From lua-bounces@bazar2.conectiva.com.br Wed Jul 1 04:23:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n617N3vQ017353; Wed, 1 Jul 2009 04:23:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17B6018ED1; Wed, 1 Jul 2009 04:22:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13CB518C94 for ; Wed, 1 Jul 2009 04:22:18 -0300 (BRT) Received: by ewy26 with SMTP id 26so837689ewy.5 for ; Wed, 01 Jul 2009 00:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lVy6psi6U7MXR1asp8wnLKjLSofGIll1K5M3T/NpHF4=; b=FAi3/W+hx3UPs4dLfIRLSVYO3+ssMstrcYTJS87mqmwGaoNKlBpsG558xOFWoAg82O vIKkCfniPLdoSVmQp/vmwssCAq3ah5z2duopaYz975jgLK5lizsLsOqRkKOZnWHm0V+L CCY9gvu/qHbk241JbOS5WUkzSBUB4adFP2XZQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dQCfr368NHuXcOhvRO5A7xkhGn/0NYtESfzXfyNqSmZMheLs53SPQcydLMOuNkc8Li T/emVuy0GaKjIklGFY4gguycosXJUqZwjma2CrpjG2L4uOSbNUV4zy78eI8totzOD+BG u6kqX4uXp+NY/JqDzZmB5xsd5IRjK2riPZ1ac= MIME-Version: 1.0 Received: by 10.216.2.201 with SMTP id 51mr2771674wef.17.1246432937064; Wed, 01 Jul 2009 00:22:17 -0700 (PDT) In-Reply-To: <89d273ba0906250353x4861577encb9630b0ae015209@mail.gmail.com> References: <4A431B89.7080504@013net.net> <790db3550906242349g159fe6d4g3e28c5efd9c3f79a@mail.gmail.com> <4A434D1F.1020902@013net.net> <89d273ba0906250353x4861577encb9630b0ae015209@mail.gmail.com> Date: Wed, 1 Jul 2009 09:22:17 +0200 Message-ID: Subject: Re: lua_replace finding From: Erik Lindroos To: Lua list Content-Type: multipart/alternative; boundary=0016364c7cfb733aa5046d9fc850 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 1327 Lines: 34 --0016364c7cfb733aa5046d9fc850 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Jun 25, 2009 at 12:53 PM, Jerome Vuarand wrote: > [...] > On the other hand I agree the current behaviour of lua_replace(L, > lua_gettop(L)) is counter-intuitive. IMHO it should either be a no-op > or throw an error. > It should not be a no-op. Functions that result in different stack depths, especially without producing an error, are very annoying. --0016364c7cfb733aa5046d9fc850 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Thu, Jun 25, 2009 at 12:53 PM, Jerome Vuarand= <jerome.v= uarand@gmail.com> wrote:
[...]
On the other hand I agree the current behaviour of lua_replace(L,
lua_gettop(L)) is counter-intuitive. IMHO it should either be a no-op
or throw an error.

It should not be a no-op. Functions that result in d= ifferent stack depths, especially without producing an error, are very anno= ying.
--0016364c7cfb733aa5046d9fc850-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 1 13:08:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n61G8Fvq004545; Wed, 1 Jul 2009 13:08:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E87F618C43; Wed, 1 Jul 2009 13:07:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asgc.be (unknown [77.73.99.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5B4118AF1 for ; Wed, 1 Jul 2009 13:07:29 -0300 (BRT) Received: (qmail 9676 invoked by uid 512); 1 Jul 2009 18:07:20 +0200 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on 77-73-99-136.ant.nucleus.be X-Spam-Level: X-Spam-Status: No, hits=-3.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, J_CHICKENPOX_63 autolearn=no version=3.2.5 Received: from localhost (HELO www.asgc.be) (127.0.0.1) by asgc.be with SMTP; 1 Jul 2009 18:07:20 +0200 Received: from 81.243.245.215 (SquirrelMail authenticated user wim@asgc.be) by www.asgc.be with HTTP; Wed, 1 Jul 2009 18:07:20 +0200 Message-ID: <05d30f9f1f940ac008c11ec7950ef136.squirrel@www.asgc.be> Date: Wed, 1 Jul 2009 18:07:20 +0200 Subject: Installed lua , luarocks and Nanoki - luasocket not found - newbie From: "Wim Paulussen" To: lua@bazar2.conectiva.com.br User-Agent: SquirrelMail/1.4.19 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I recently discovered the existence of lua and want to investigate more about what I could do with it. I installed Lua (5.1.4 - built on Centos ), installed luarocks and Nanoki. I also installed the required modules (filesystem, luasocket, lzlib and slncrypto) . 'luarocks list' displays these modules as installed. so far, I did not get any error messages, so I assumed everything is OK. When trying to launch Nanoki, I get the following 'lua: ./TCPServer.lua:15: module 'socket' not found: ....(more error messages about files not found) ' As far as I can see this means that socket.lua, although present, cannot be found by lua. Also, I do not have a LUA_PATH variable set. Anyone able to point me in the right direction ? Thank you very much in advance. From lua-bounces@bazar2.conectiva.com.br Wed Jul 1 13:43:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n61Ghjff012196; Wed, 1 Jul 2009 13:43:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13DF018EF0; Wed, 1 Jul 2009 13:43:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A942E18D70 for ; Wed, 1 Jul 2009 13:42:57 -0300 (BRT) Received: by fxm28 with SMTP id 28so1015934fxm.5 for ; Wed, 01 Jul 2009 09:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=FRCD6hlP4oqdvG9UaN5k8/Ild1GUdx9mK+C3J660LXo=; b=ecoEoPlhZ8Q2S301tlyBYwPw4cobdtGlMBMSzuJS6vTIlariM81xGv+uV4rjnlaM4Z 9m2/UiDwywMNKS4HmsC1Rost9vR/rilHqaW2QXrNSwO3s/BJ9SXYAZqClM70uIFjNvrO rbdTyT0rnhvjySfB/6J/hWBsPcYIBqMI3u390= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=LXyOhC8NKVL6dhkpYtZohkdZcBE9snE2QOGaNfZR/mXCL/HytTDPseDZRyyKcqX9AG xhM6lt1wCbTGa9nvFDbsgoo+1bsjsWs5I/USB0+m9hAbtCq5jTvNAilY9diJNWwljWSs iBJxS/mrul8JqS7rIZpS9wBUjvgJ3tQ8imlQw= MIME-Version: 1.0 Received: by 10.204.70.196 with SMTP id e4mr5859800bkj.65.1246466575126; Wed, 01 Jul 2009 09:42:55 -0700 (PDT) In-Reply-To: <05d30f9f1f940ac008c11ec7950ef136.squirrel@www.asgc.be> References: <05d30f9f1f940ac008c11ec7950ef136.squirrel@www.asgc.be> From: Hisham Date: Wed, 1 Jul 2009 13:42:35 -0300 Message-ID: <5e7d91620907010942o33541174tde6a23dae41880ff@mail.gmail.com> Subject: Re: Installed lua , luarocks and Nanoki - luasocket not found - newbie To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 1, 2009 at 1:07 PM, Wim Paulussen wrote: > I recently discovered the existence of lua and want to investigate more > about what I could do with it. > > I installed Lua (5.1.4 - built on Centos ), installed luarocks and Nanoki. > I also installed the required modules (filesystem, luasocket, lzlib and > slncrypto) . 'luarocks list' displays these modules as installed. so far, > I did not get any error messages, so I assumed everything is OK. > > When trying to launch Nanoki, I get the following 'lua: > ./TCPServer.lua:15: module 'socket' not found: ....(more error messages > about files not found) ' > As far as I can see this means that socket.lua, although present, cannot > be found by lua. > > Also, I do not have a LUA_PATH variable set. Anyone able to point me in > the right direction ? First, check if luarocks.require is in Lua's module path. You can do this by launching the interpreter in the command line and doing: require("luarocks.require") if that returns no error messages, you should be ok. (You should also be able to do require("socket") after loading luarocks.require). If you did a default install of Lua and LuaRocks that should be already the case. If it fails, you should edit your LUA_PATH variable (there should be documentation around on how to edit this, somewhere). If you're able to load luarocks.require, then the next question is: How did you launch the script? The luarocks.require module needs to be loaded in order for modules to be found, so if you did lua ./TCPServer.lua then you should do lua -lluarocks.require ./TCPServer.lua and if the script is executable and you launched it with ./TCPServer.lua then you should edit its first line from something like #!/usr/bin/lua to something like #!/usr/bin/lua -lluarocks.require Let us know if you still have problems. -- Hisham From lua-bounces@bazar2.conectiva.com.br Wed Jul 1 13:47:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n61GlP69013076; Wed, 1 Jul 2009 13:47:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E635192C5; Wed, 1 Jul 2009 13:46:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E0EF18D75 for ; Wed, 1 Jul 2009 13:46:46 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so342165fgg.5 for ; Wed, 01 Jul 2009 09:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=Ca/ST2POl7+YB9Z5HaQ0nLsVxC/ly4DqSNDumzFM+z4=; b=ZJNBOCdIcA0vdw1UR3CErja09HiDAEuawmQQNKT88DT7+RaY2EAu43J0/eWKewga6E 2HD4abLO0fY4oeeVWcZLowuMsDcyULimKErAIAJBTzZyW0rlGR2FTPdGDXzN52dpmVsg WBt8uxjGDWMp5DJP6Ho3gx8c1NQtFK63Fjd/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=ho72pMMDsZQjR7omrDZcfsQmirStQpom1jqd0RUq+yKwETUSfUHSqduGVUi2vIqYJz H3NJnVWjcDRds69sHkNj8QFiDUjqLeyhEzw/mfldmvdSu/325VUYOMZZqKhifmLyMgcd TAIjQ/xw+CUXkkcZz5ZWmioSswt1pNzNA9YJE= Received: by 10.86.23.9 with SMTP id 9mr4444301fgw.5.1246466804460; Wed, 01 Jul 2009 09:46:44 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id 12sm11624933fgg.4.2009.07.01.09.46.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Jul 2009 09:46:43 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <05d30f9f1f940ac008c11ec7950ef136.squirrel@www.asgc.be> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Installed lua , luarocks and Nanoki - luasocket not found - newbie X-Priority: 3 (Normal) Date: Wed, 1 Jul 2009 18:46:12 +0200 References: <05d30f9f1f940ac008c11ec7950ef136.squirrel@www.asgc.be> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Wim, On Jul 1, 2009, at 6:07 PM, Wim Paulussen wrote: > When trying to launch Nanoki, I get the following 'lua: > ./TCPServer.lua:15: module 'socket' not found: ....(more error > messages > about files not found) ' > As far as I can see this means that socket.lua, although present, > cannot > be found by lua. What's in your package.path? E.g.: % lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > print( package.path ) ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/ init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua socket.lua should be in one of the directories defined in package.path... alternatively... copy all the *.lua files in the same directory and run everything from there, e.g.: % cp *.lua Nanoki % cd Nanoki % lua Nanoki.lua . 0 1080 2009-07-01 16:45:32 Version Nanoki/1.13 2009-07-01 16:45:32 Location . 2009-07-01 16:45:32 Server tcp 0 1080 2009-07-01 16:45:32 Forwarded false 2009-07-01 16:45:32 Secure false HTH. Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 03:33:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n626XG2j026473; Thu, 2 Jul 2009 03:33:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9FDF1A556; Thu, 2 Jul 2009 03:32:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asgc.be (unknown [77.73.99.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADAAC18925 for ; Thu, 2 Jul 2009 03:32:41 -0300 (BRT) Received: (qmail 12343 invoked by uid 512); 2 Jul 2009 08:32:24 +0200 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on 77-73-99-136.ant.nucleus.be X-Spam-Level: X-Spam-Status: No, hits=-4.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, J_CHICKENPOX_74 autolearn=no version=3.2.5 Received: from localhost (HELO www.asgc.be) (127.0.0.1) by asgc.be with SMTP; 2 Jul 2009 08:32:24 +0200 Received: from 87.64.231.208 (SquirrelMail authenticated user wim@asgc.be) by www.asgc.be with HTTP; Thu, 2 Jul 2009 08:32:24 +0200 Message-ID: <62bc595b4da077ee82330a7964c5adb4.squirrel@www.asgc.be> Date: Thu, 2 Jul 2009 08:32:24 +0200 Subject: Installed lua , luarocks and Nanoki - luasocket not found - newbie From: "Wim Paulussen" To: lua@bazar2.conectiva.com.br User-Agent: SquirrelMail/1.4.19 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dear Hisham and Petitte Abeille, Even a newbie on mailing lists ! Thanks to your info I got it working now. But again a question too : my package.path returns nil : is this something to worry about ? Wim Paulussen From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 05:04:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62847QQ003668; Thu, 2 Jul 2009 05:04:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A43AE1911E; Thu, 2 Jul 2009 05:03:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64BCD190B7 for ; Thu, 2 Jul 2009 05:03:30 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 9401F388F8C for ; Thu, 2 Jul 2009 04:03:29 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 02 Jul 2009 04:03:29 -0400 X-Sasl-enc: tKQCwOuRP4g0DEW86X/LFeeQIQmjQ0Ak7cpQLs0h2wn4 1246521804 Received: from [192.168.1.102] (97-120-106-191.ptld.qwest.net [97.120.106.191]) by mail.messagingengine.com (Postfix) with ESMTPSA id BCAA01D05 for ; Thu, 2 Jul 2009 04:03:24 -0400 (EDT) Message-ID: <4A4C69FC.2020009@bitfighter.org> Date: Thu, 02 Jul 2009 01:04:12 -0700 From: Watusimoto User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Lunar, C++, and premature object destruction Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm working on a game that uses Lua to control robot players, written in C++, and bound with Lunar, and am having problems controlling the lifespan of objects created in C++ and referenced in Lua. (It's at http://bitfighter.org, if you are curious, and the linked wiki contains examples of some robot scripts.) My primary object is a Ship. The lifetime of the Ship object is completely controlled by C++. I also have a proxy object, called LuaShip, that contains a pointer to the Ship, and handles all the requests for information about the Ship from the Lua script. The goal is that when the Ship is destroyed, the pointer on the LuaShip will be set to NULL, and any future requests to the LuaShip can be intelligently handled (probably by generating an error of some sort). The LuaShip is exposed to Lua via Lunar if the robot script requests it (using a getShip() method or somesuch). The Ship object also contains a pointer to its LuaShip proxy. My problem is that when the Ship object is destroyed, C++ seems to think that all pointers to the LuaShip are gone, and it is OK to destroy the LuaShip as well. It does not seem to recognize when a Lua instance is also referring to the LuaShip. The result is that the LuaShip is destroyed, and the Lua script is now left holding a reference to nothing. When the script acts on it (thinking it's still valid), the app crashes. My questions are 1) Is this an appropriate architecture for managing Lua instances that can have persistent references to C++ objects (Ship in this case) that can be deleted without warning, and 2) are there any good examples of code that uses Lunar in this manner that I can examine to see where my problem might be? Thank you, Chris From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 08:04:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62B4TxX020773; Thu, 2 Jul 2009 08:04:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A8A319054; Thu, 2 Jul 2009 08:03:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0133.hostedemail.com [64.99.136.133]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B82518F06 for ; Thu, 2 Jul 2009 08:03:49 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay04.hostedemail.com (Postfix) with SMTP id 4B9F47BFE86 for ; Thu, 2 Jul 2009 11:03:47 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 004be52527eedd3d, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:967:968:973:988:989:1260:1277:1311:1313:1314:1345:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1766:1792:2393:2525:2553:2565:2682:2685:2828:2857:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3352:3865:3866:3867:3868:3869:3870:3871:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:4384:5007:6261:7679:7875:7903:8829:8957:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 1912 Received: from taboche (unknown [78.146.249.123]) (Authenticated sender: thomas.lauer) by omf10.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2009 11:03:46 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: [ANN] Lua Short Reference, minor upgrade Date: Thu, 02 Jul 2009 12:03:46 +0100 Organization: TL Message-ID: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n62B4TxX020773 The Lua short reference provides a concise summary of the Lua syntax and core libraries. I have just updated and uploaded another draft of the 5.1 version. This can be downloaded from either the lua-users.org wiki: http://lua-users.org/wiki/LuaShortReference or from my website: http://thomaslauer.com/comp/Lua_Short_Reference A few small errors and inconsistencies were removed. However, there are certainly still errors and omissions to be found in this draft. PLEASE, everyone who uses this card -- take the time and trouble to send a bug report if you happen on something that needs correcting. (BTW, the exclusion of deprecated language features (like table.setn()) is by design.) Acknowledgements: Enrico Colombini (the original author) and I are grateful to all the good people who contributed with notes and suggestions, including John Belmonte, Albert-Jan Brouwer, Tiago Dionizio, Marius Gheorghe, Asko Kauppi, Philippe Lhoste, Mike Pall, Virgil Smith, Ando Sonenblick, Nick Trout, Clemens Wacha, Blake T. Garretson, mbp, James Salsman and of course Roberto Ierusalimschy, whose “Lua 5.1 Reference Manual” and “Programming in Lua” have been our main sources of Lua lore. -- cheers thomasl web : http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 09:00:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62C0Yqm027790; Thu, 2 Jul 2009 09:00:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1E77190E0; Thu, 2 Jul 2009 09:00:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9EDB18A1F for ; Thu, 2 Jul 2009 08:59:49 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so378783eyd.41 for ; Thu, 02 Jul 2009 04:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nJcfye05gAO64uvsGMnOE3LkDdmJIONskpc2ANFvqYM=; b=inLtzxEwWVga3Na7IJUPy0+L64+l9/CT2viTBJ5lqj/5z3CwhCU/YBwbjAN1cuvgSj vD2SpFTfi+4QcigFaqs8jtgBbpnkCw12XVDpdJfzGobwiq6VQwoq5FSTUFkSKl5BbM34 /2fZj0QDFnmLL1RhcT5ZTTrPOJIAaWKEii9n8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EaHbZ8Gz4YtY4p5SxGFC5S2La1DGHtaLBPw4psficWebQdyD9BW6D6ihDt0bYRos1i f6jIkXQZzwvg840roE8Xx2S9kI33EbCCuAV813qCGwMWoH8Rn21Nkdo4ej9m59puFxno 9BQ1ojQ3RkB6ZiuG54PKCt2u5LmIfLB63Mx6g= MIME-Version: 1.0 Received: by 10.216.49.211 with SMTP id x61mr3150959web.222.1246535987472; Thu, 02 Jul 2009 04:59:47 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Jul 2009 12:59:47 +0100 Message-ID: Subject: Re: [ANN] Lua Short Reference, minor upgrade From: Duncan Cross To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n62C0Yqm027790 On Thu, Jul 2, 2009 at 12:03 PM, Thomas Lauer wrote: > The Lua short reference provides a concise summary of the Lua syntax and > core libraries. I have just updated and uploaded another draft of the > 5.1 version. This can be downloaded from either the lua-users.org wiki: > > http://lua-users.org/wiki/LuaShortReference > > or from my website: > > http://thomaslauer.com/comp/Lua_Short_Reference > > A few small errors and inconsistencies were removed. However, there are > certainly still errors and omissions to be found in this draft. PLEASE, > everyone who uses this card -- take the time and trouble to send a bug > report if you happen on something that needs correcting. (BTW, the > exclusion of deprecated language features (like table.setn()) is by > design.) > > Acknowledgements: Enrico Colombini (the original author) and I are > grateful to all the good people who contributed with notes and > suggestions, including John Belmonte, Albert-Jan Brouwer, Tiago > Dionizio, Marius Gheorghe, Asko Kauppi, Philippe Lhoste, Mike Pall, > Virgil Smith, Ando Sonenblick, Nick Trout, Clemens Wacha, Blake T. > Garretson, mbp, James Salsman and of course Roberto Ierusalimschy, whose > “Lua 5.1 Reference Manual” and “Programming in Lua” have been our main > sources of Lua lore. > > -- > cheers thomasl > > web : http://thomaslauer.com/start > Thank you for maintaining this, it is very useful having this kind of "cheat-sheet", particularly for getting people who are good at programming but just not that familiar with Lua yet up to speed quickly. I have noticed a few things just skimming it now: - One of the table constructors {[-900] = 3, [+900] = 4} - Lua actually does not support the "unary plus" and throws a parse error at this. - Potential for confusion, maybe: x:move (2, -3) object call: shortcut for x.move(x, 2, -3), x will be assigned to self ..."x will be assigned to self", only if x.move was also created using the same syntax. Someone could misread this as 'whatever parameter was named "self", wherever it appears in the parameter list, will be set to x'. - setmetatable and setfenv returns the table/function, I don't know if you'd consider this worth mentioning in this but I find it quite useful - string.byte also allows two parameters to get the numerical code of each character in a range - Would it be worth mentioning how strings by default have a metatable set allowing for method calls that use the string table (and how you can use it on string literals only if you put them in parentheses)? -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 10:11:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62DB1xE007652; Thu, 2 Jul 2009 10:11:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B11E7191C9; Thu, 2 Jul 2009 10:10:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0134.hostedemail.com [64.99.136.134]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0BE61911E for ; Thu, 2 Jul 2009 10:10:21 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay05.hostedemail.com (Postfix) with SMTP id 121F8123D127 for ; Thu, 2 Jul 2009 13:10:18 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 997a1eb44ead159c, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:800:960:967:973:980:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1766:1792:2377:2379:2393:2525:2560:2563:2682:2685:2693:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3353:3770:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:4362:4605:5007:6261:7514:7679:7875:7903:7904:8660:9010:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 2607 Received: from taboche (unknown [89.240.50.169]) (Authenticated sender: thomas.lauer) by omf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2009 13:10:17 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Thu, 02 Jul 2009 14:10:17 +0100 Organization: TL Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n62DB1xE007652 Duncan Cross wrote: > I have noticed a few things just skimming it now: > - One of the table constructors {[-900] = 3, [+900] = 4} - Lua actually does > not support the "unary plus" and throws a parse error at this. Ack and changed. > - Potential for confusion, maybe: > > x:move (2, -3) > object call: shortcut for x.move(x, 2, -3), x will be assigned to self > > ..."x will be assigned to self", only if x.move was also created using the > same syntax. Someone could misread this as 'whatever parameter was named > "self", wherever it appears in the parameter list, will be set to x'. What wording would you propose instead? Perhaps removing the "x will be assigned to self" altogether? > - setmetatable and setfenv returns the table/function, I don't know if you'd > consider this worth mentioning in this but I find it quite useful setmetatable: ack and changed. setfenv: the manual says "As a special case, when f is 0 setfenv changes the environment of the running thread. In this case, setfenv returns no values." So I'll leave it as it is. > - string.byte also allows two parameters to get the numerical code of each > character in a range Ack and changed. > - Would it be worth mentioning how strings by default have a metatable set > allowing for method calls that use the string table (and how you can use > it on string literals only if you put them in parentheses)? I've included a note to that effect. Thanks for reporting. I'm going to wait a few more days for possible further feedback and then go ahead with a new draft. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 10:51:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62DpoVK017424; Thu, 2 Jul 2009 10:51:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 453A8191D6; Thu, 2 Jul 2009 10:51:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25F9F19054 for ; Thu, 2 Jul 2009 10:51:16 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so396249eyd.41 for ; Thu, 02 Jul 2009 06:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=i14bQucxAcXAvjSlWnbParV+/cAC7pMcMqvEV5+DIOg=; b=CKndpREfF+x/DFyAg+guonfV6TQr72Schf9ROZUhxOY38Xto95mTXThT9vICVPItYb W9RNVb0lMTkrz1DgMo3Ao8v6oyF+80af0TR8LBByygH4zCj78+fiXAGIA1dqRtdfdvKn OTXotpfk5GsUu4CAapYQM9SicqpL2k/TSzLjA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CKeIlpulxMn4ftVjPzDA/t5T714bxGetvXcer112eymVfi9rdfyoskxUQaK8y+cXMJ aeRhSIwZl4lPwU27xKwbHJshGBAKfvtWSr7bxwplPKMxCmU/t0fpYPzttjZ84Iojn2Al oA/ExOG97ohH205WNTZK+1En/D8JRT1Glfb68= MIME-Version: 1.0 Received: by 10.216.71.19 with SMTP id q19mr24695wed.65.1246542674841; Thu, 02 Jul 2009 06:51:14 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Jul 2009 14:51:14 +0100 Message-ID: Subject: Re: [ANN] Lua Short Reference, minor upgrade From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 2, 2009 at 2:10 PM, Thomas Lauer wrote: >> - Potential for confusion, maybe: >> >> x:move (2, -3) >> object call: shortcut for x.move(x, 2, -3), x will be assigned to self >> >> ..."x will be assigned to self", only if x.move was also created using the >> same syntax. Someone could misread this as 'whatever parameter was named >> "self", wherever it appears in the parameter list, will be set to x'. > > What wording would you propose instead? Perhaps removing the "x will be > assigned to self" altogether? I think so. I'd also specify in the "Function definition" section that self is an extra *first* argument. (The reason I think that it is useful to deconstruct the syntactic sugar a little bit here is that sometimes I want to define a function inside a {} table literal, and of course in that situation you have to add the "self" parameter explicitly.) >> - setmetatable and setfenv returns the table/function, I don't know if you'd >> consider this worth mentioning in this but I find it quite useful > > setmetatable: ack and changed. > > setfenv: the manual says "As a special case, when f is 0 setfenv changes > the environment of the running thread. In this case, setfenv returns no > values." So I'll leave it as it is. True, I had forgotten about this extra complication. Some additional notes: - Multi-line strings: One thing that is easy to forget is that if it starts immediately with a new line, that new line is removed. (You also don't mention the variable number of =s, but you do for multi-line comments, maybe this is deliberate.) - Decimal escape sequence can have one or two digits instead of three, again not mentioning this might be deliberate. - Very minor: "nil" not bolded in coroutine.running() - The __len metamethod is (currently) only used by userdata. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 12:27:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62FRdwB007297; Thu, 2 Jul 2009 12:27:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 192D2191E8; Thu, 2 Jul 2009 12:27:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0173.hostedemail.com [64.99.136.173]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1062618B15 for ; Thu, 2 Jul 2009 12:27:03 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay06.hostedemail.com (Postfix) with SMTP id 0537421D7956 for ; Thu, 2 Jul 2009 15:26:58 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 74dbdd495d9b3ba0, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:800:946:960:967:968:973:980:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1513:1515:1516:1518:1521:1534:1542:1593:1594:1711:1730:1747:1766:1792:2377:2379:2393:2525:2553:2560:2563:2682:2685:2693:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3318:3354:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:4605:5007:6261:7514:7679:7875:7903:7904:8660:9010:9025:9040:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 3547 Received: from taboche (unknown [89.240.50.169]) (Authenticated sender: thomas.lauer) by omf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2009 15:26:57 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Thu, 02 Jul 2009 16:26:57 +0100 Organization: TL Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n62FRdwB007297 Duncan Cross wrote: > On Thu, Jul 2, 2009 at 2:10 PM, Thomas Lauer wrote: > >> - Potential for confusion, maybe: > >> > >> x:move (2, -3) > >> object call: shortcut for x.move(x, 2, -3), x will be assigned to self > >> > >> ..."x will be assigned to self", only if x.move was also created using the > >> same syntax. Someone could misread this as 'whatever parameter was named > >> "self", wherever it appears in the parameter list, will be set to x'. > > > > What wording would you propose instead? Perhaps removing the "x will be > > assigned to self" altogether? > > I think so. I'd also specify in the "Function definition" section that self is > an extra *first* argument. (The reason I think that it is useful to > deconstruct the syntactic sugar a little bit here is that sometimes I want to > define a function inside a {} table literal, and of course in that situation > you have to add the "self" parameter explicitly.) I've removed that bit and added "additional first argument self" with the object function definition. (A short ref can never be as complete and accurate as the original. This exercise is a little like repeatedly trying to compress a compressed file, until you end up with a file of just 1 byte length: my less IT-literate friends still find the impossibility of doing this puzzling -- "hey, just zip the zip!".) > > setfenv: the manual says "As a special case, when f is 0 setfenv changes > > the environment of the running thread. In this case, setfenv returns no > > values." So I'll leave it as it is. > > True, I had forgotten about this extra complication. As there was just enough space I have now added both cases;-) > Some additional notes: > - Multi-line strings: One thing that is easy to forget is that if it starts > immediately with a new line, that new line is removed. (You also don't > mention the variable number of =s, but you do for multi-line comments, > maybe this is deliberate.) It is deliberate in the sense that adding it would wreak havoc with the table formatting. > - Decimal escape sequence can have one or two digits instead of three, again > not mentioning this might be deliberate. Added. > - Very minor: "nil" not bolded in coroutine.running() Changed. > - The __len metamethod is (currently) only used by userdata. Added. And thanks again. Anything else? -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 14:18:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62HIbSG001246; Thu, 2 Jul 2009 14:18:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B6F619191; Thu, 2 Jul 2009 14:17:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0136719131 for ; Thu, 2 Jul 2009 14:17:48 -0300 (BRT) Received: by ewy26 with SMTP id 26so2180758ewy.5 for ; Thu, 02 Jul 2009 10:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Uw/NBdO1l8P+BqD0QW5FXeu5PDQxrKGg2ytq31ji5j8=; b=aANLBxO4NvGi0ju1YzTU1kq6Ha6/98Hz+UTr0R2vdCjtrW61O556VHz8C3JquodFsw jqczoG6aMmr6D6dorChpaKFsWcvE35kYjqFmilBIQbF9rwRC6CQrFMr/tBFFu1zZ8dy7 oh77PZYDcVJ7W4BStBxydrAMPa3Bv5o3vsMyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=mzsjvfxyhspnAzF2SPb0VEhw5aGa8dwTPh7Q6EvXniIg5rA98lAvvrBq0Tg5ZBxNpj a48ePiYWvyihfspARrxzmhyCVVxDCodoKziTJV06iuwu8e3TGuPeUDyuYyQm5zMd8BRy 4g4e75PCgbKerbqBSngvJWAt1I/zLyEvVfKRg= MIME-Version: 1.0 Received: by 10.216.70.205 with SMTP id p55mr87114wed.55.1246555066002; Thu, 02 Jul 2009 10:17:46 -0700 (PDT) In-Reply-To: <20090629180318.GA6727@inf.puc-rio.br> References: <560972290906270028u8d6a0b9l9cdc63d2e31e5789@mail.gmail.com> <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> Date: Thu, 2 Jul 2009 13:17:45 -0400 Message-ID: Subject: Re: A crash bug in v5.1.4 From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 6/29/09, Roberto Ierusalimschy wrote: > > Is the short bugfix by Mike Pall the likely one incorporated into the > > > Lua buglist as the fix... [...]? > > Probably yes. > > > -- Roberto > As of today official Lua bug's list at http://www.lua.org/bugs.html still does not list this bug/patch. Is there anything that keeps this patch in a "holding pattern"? --Leo-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 14:25:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62HPXan003030; Thu, 2 Jul 2009 14:25:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19F3919219; Thu, 2 Jul 2009 14:25:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D54B18B28 for ; Thu, 2 Jul 2009 14:25:04 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n62HP3i9004056 for ; Thu, 2 Jul 2009 14:25:03 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 790C954C11E; Thu, 2 Jul 2009 14:25:03 -0300 (BRT) Date: Thu, 2 Jul 2009 14:25:03 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: A crash bug in v5.1.4 Message-ID: <20090702172503.GA6259@inf.puc-rio.br> References: <560972290906270028u8d6a0b9l9cdc63d2e31e5789@mail.gmail.com> <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > As of today official Lua bug's list at http://www.lua.org/bugs.html > still does not list this bug/patch. Is there anything that keeps this > patch in a "holding pattern"? Laziness? -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 14:27:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62HRmed003543; Thu, 2 Jul 2009 14:27:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29AD919276; Thu, 2 Jul 2009 14:27:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out-02.simnet.is (smtp-out-02.simnet.is [194.105.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AA651925F for ; Thu, 2 Jul 2009 14:27:20 -0300 (BRT) Authentication-Results: smtp-out-02.simnetpro.is; dkim=neutral (message not signed) header.i=none X-SBRS: 0.8 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloHAGqITErCaedFbGdsb2JhbACZDQsOCQcTtxKEEAU X-IronPort-AV: E=Sophos;i="4.42,336,1243814400"; d="scan'208";a="209643468" Received: from consumer-mta-01.simnet.is ([194.105.231.69]) by smtp-out-02.simnetpro.is with ESMTP; 02 Jul 2009 17:27:18 +0000 Subject: Re: A crash bug in v5.1.4 From: =?ISO-8859-1?Q?Gabr=EDel?= "A." =?ISO-8859-1?Q?P=E9tursson?= To: Lua list In-Reply-To: <20090702172503.GA6259@inf.puc-rio.br> References: <560972290906270028u8d6a0b9l9cdc63d2e31e5789@mail.gmail.com> <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> <20090702172503.GA6259@inf.puc-rio.br> Content-Type: text/plain Date: Thu, 02 Jul 2009 17:27:18 +0000 Message-Id: <1246555638.3759.1.camel@debian.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The Lua developers are not lazy. I am sure they have a good reason for not having updated the list yet. On Thu, 2009-07-02 at 14:25 -0300, Roberto Ierusalimschy wrote: > > As of today official Lua bug's list at http://www.lua.org/bugs.html > > still does not list this bug/patch. Is there anything that keeps this > > patch in a "holding pattern"? > > Laziness? > > -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 14:29:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62HTXW6004010; Thu, 2 Jul 2009 14:29:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 952CF1928C; Thu, 2 Jul 2009 14:29:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCD5819284 for ; Thu, 2 Jul 2009 14:29:04 -0300 (BRT) Received: by bwz11 with SMTP id 11so523298bwz.5 for ; Thu, 02 Jul 2009 10:29:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.79.144 with SMTP id p16mr283289bkk.4.1246555742122; Thu, 02 Jul 2009 10:29:02 -0700 (PDT) In-Reply-To: <1246555638.3759.1.camel@debian.lan> References: <560972290906270028u8d6a0b9l9cdc63d2e31e5789@mail.gmail.com> <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> <20090702172503.GA6259@inf.puc-rio.br> <1246555638.3759.1.camel@debian.lan> Date: Thu, 2 Jul 2009 18:29:02 +0100 Message-ID: Subject: Re: A crash bug in v5.1.4 From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n62HTXW6004010 On Thu, Jul 2, 2009 at 6:27 PM, Gabríel A. wrote: > The Lua developers are not lazy. I am sure they have a good reason for > not having updated the list yet. > > On Thu, 2009-07-02 at 14:25 -0300, Roberto Ierusalimschy wrote: >> > As of today official Lua bug's list at http://www.lua.org/bugs.html >> > still does not list this bug/patch. Is there anything that keeps this >> > patch in a "holding pattern"? >> >> Laziness? >> >> -- Roberto > > Roberto _is_ one of the Lua developers. From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 14:45:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62Hj072007676; Thu, 2 Jul 2009 14:45:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F9CD19169; Thu, 2 Jul 2009 14:44:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93E3E18FB7 for ; Thu, 2 Jul 2009 14:44:30 -0300 (BRT) Received: by pxi28 with SMTP id 28so1718532pxi.33 for ; Thu, 02 Jul 2009 10:44:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.141.27.7 with SMTP id e7mr398130rvj.257.1246556667162; Thu, 02 Jul 2009 10:44:27 -0700 (PDT) In-Reply-To: References: <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> <20090702172503.GA6259@inf.puc-rio.br> <1246555638.3759.1.camel@debian.lan> Date: Thu, 2 Jul 2009 12:44:26 -0500 Message-ID: <8a25d01b0907021044s6ee5d52eq361947cf42c06ca2@mail.gmail.com> Subject: Re: A crash bug in v5.1.4 From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1b37e56b0bd046dbc97e5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1b37e56b0bd046dbc97e5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable A "cardinal virtue", according to Larry Wall. =3Dp Phoenix Sol On Thu, Jul 2, 2009 at 12:29 PM, Peter Cawley wrote: > On Thu, Jul 2, 2009 at 6:27 PM, Gabr=EDel A. wrote: > > The Lua developers are not lazy. I am sure they have a good reason for > > not having updated the list yet. > > > > On Thu, 2009-07-02 at 14:25 -0300, Roberto Ierusalimschy wrote: > >> > As of today official Lua bug's list at http://www.lua.org/bugs.html > >> > still does not list this bug/patch. Is there anything that keeps thi= s > >> > patch in a "holding pattern"? > >> > >> Laziness? > >> > >> -- Roberto > > > > > > Roberto _is_ one of the Lua developers. > --000e0cd1b37e56b0bd046dbc97e5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable A "cardinal virtue", according to Larry Wall.=A0=A0 =3Dp

<= br>Phoenix Sol


On Thu, Jul 2, 2009 at 12:29 PM, Peter C= awley <lua@corsix.or= g> wrote:
On Thu, Jul 2, 2009 at 6:27 PM, Gabr=EDel= A.<gabrielp@simnet.is> wro= te:
> The Lua developers are not lazy. I am sure they have a good reason for=
> not having updated the list yet.
>
> On Thu, 2009-07-02 at 14:25 -0300, Roberto Ierusalimschy wrote:
>> > As of today official Lua bug's list at http://www.lua.org/bugs.html >> > still does not list this bug/patch. Is there anything that ke= eps this
>> > patch in a "holding pattern"?
>>
>> Laziness?
>>
>> -- Roberto
>
>

Roberto _is_ one of the Lua developers.

--000e0cd1b37e56b0bd046dbc97e5-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 16:57:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62Jv11K010931; Thu, 2 Jul 2009 16:57:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F08E18B30; Thu, 2 Jul 2009 16:56:27 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E029118AC9 for ; Thu, 2 Jul 2009 16:56:21 -0300 (BRT) Received: by qyk31 with SMTP id 31so2077950qyk.33 for ; Thu, 02 Jul 2009 12:56:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.45.137 with SMTP id e9mr616113qaf.216.1246564580814; Thu, 02 Jul 2009 12:56:20 -0700 (PDT) Date: Thu, 2 Jul 2009 14:56:20 -0500 Message-ID: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> Subject: Tyrant Client? From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0015175cdc260771d4046dbe6f41 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cdc260771d4046dbe6f41 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Anybody have a Lua client for Tokyo Tyrant? ( For this: http://code.google.com/p/luacloud ) Thanks a heap, Phoenix Sol --0015175cdc260771d4046dbe6f41 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Anybody have a Lua client for Tokyo Tyrant?

(=A0 For this:=A0 http://code.google.com/p/luacloud=A0 )

Thanks a heap,
Phoenix Sol
--0015175cdc260771d4046dbe6f41-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 17:08:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62K8IOH013995; Thu, 2 Jul 2009 17:08:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9A4B190B5; Thu, 2 Jul 2009 17:07:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95E0E18AD6 for ; Thu, 2 Jul 2009 17:07:45 -0300 (BRT) Received: by fxm28 with SMTP id 28so1858868fxm.5 for ; Thu, 02 Jul 2009 13:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=oYNLfLSLEFH98oH/eDhIC8GxtC5dMUCs9nL0B7wntok=; b=SOVd6IjAk1INcNMtzHh8b795P0/YMmEWUP9vDSVs+jeXORH/rrJRdig1RREoVklX+H rDhv/vW++dyBWpIvENzORFgAz2FcOMGl2zrsa17RcNcVmeIlM4Xyqdc1NWs97t+jFdj/ I9RamczJWvid3ktFTiwzZ9BaHiQJ3VY0MfevQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=BNIpalj0fYHrss0gghW3nQzzPTP2HzykYP5lxBCUsmIcu9a1kEHn9N5wfiscMhnT9y N+xjjPS8kJuzV1slaFpBl/IRrSHz9x32kAXmIzy956te3ZMMCpBB/W3ExfUeniAItfym sMqEcMRhYa/Sz20lcE42Oqzt9B7nr5SCG7Q7E= Received: by 10.86.25.10 with SMTP id 10mr636834fgy.44.1246565261941; Thu, 02 Jul 2009 13:07:41 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id e20sm14903330fga.15.2009.07.02.13.07.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Jul 2009 13:07:41 -0700 (PDT) Message-Id: <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Tyrant Client? Date: Thu, 2 Jul 2009 22:07:10 +0200 References: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote: > Anybody have a Lua client for Tokyo Tyrant? HTTP? "As for the HTTP/1.1 compatible protocol, the server implements the following commands; "GET" (relevant to `tcrdbget'), "HEAD" (relevant to `tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to `tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of each request is treated as the key encoded by the URL encoding. And the entity body is treated as the value. However, headers except for "Connection" and "Content-Length" are ignored. "PUT" can have the header "X-TT-PDMODE" whose value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to `tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should have the header "X-TT-XNAME" whose value stands for the function name to be called. "POST" can have the header "X-TT-XOPTS" whose value stands for bitwise-or options of 1 (record locking) and 2 (global locking)." http://tokyocabinet.sourceforge.net/tyrantdoc/ From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 18:03:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62L3G73032749; Thu, 2 Jul 2009 18:03:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8136C191F0; Thu, 2 Jul 2009 18:02:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BF271916D for ; Thu, 2 Jul 2009 18:02:34 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so469265eyd.41 for ; Thu, 02 Jul 2009 14:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:reply-to:to:cc :subject:message-id:user-agent:mime-version:content-type; bh=03T/9FaWOgsNO9kCDV0ZcZWvs0K5LL+zhNJdm5d/wcs=; b=TWCAwH2auTLXjcaHD4e+WTnkiDPE3pzOee8G7YGg6IjxXzw/dj+Svz5FShxoP2qf3N zDAX1tbZ0AOhS8xrfZHK0gdjH2Q6toDceZayivBA1U51tyNnnnf9+QTTLOWBj+LKJ/Ff kJKjt9P6QHFhUkH38EQztn6OKl1JI9M+3SRLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:reply-to:to:cc:subject:message-id:user-agent:mime-version :content-type; b=bNtBEZNCJPMVJ9i/K09cdXL5VnO5Oo7odAYIfgkULzdXZglH1O6gmPjvATTQURuohQ bciSwuk+LuuLWbAF/jqdln7cHB9giJA9hPlQG/KlEDCYFplyQ/AwOStLi+27IC/LBYF0 37mYfbJKShv02XW1U2ZZFs9yhrLOpeL1sU5hM= Received: by 10.216.11.213 with SMTP id 63mr132081wex.176.1246568551760; Thu, 02 Jul 2009 14:02:31 -0700 (PDT) Received: from muon.client.research.att.com ([135.207.175.77]) by mx.google.com with ESMTPS id p10sm6560191gvf.4.2009.07.02.14.02.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Jul 2009 14:02:31 -0700 (PDT) Date: Thu, 2 Jul 2009 17:02:21 -0400 (EDT) From: Leo Razoumov To: kepler-project@lists.luaforge.net, Lua list Subject: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-68016220-1246568550=:7380" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-68016220-1246568550=:7380 Content-Type: TEXT/PLAIN; format=flowed; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT Unfortunately, lfs CVS version (src/lfs.c revision 1.60) does not compile under Linux Ubuntu-9.04 (jaunty) x86, kernel 2.6.28, gcc-4.3.3, glibc-2.9. src/lfs.c: In function ¡lfs_lock_dir¢: src/lfs.c:278: error: ¡struct stat¢ has no member named ¡st_mtimespec¢ gcc -O2 -I/pkg/lua-5.1.4.LR2/include -c src/lfs.c -o src/lfs.o Error: Build error: Build error Indeed, neither /usr/include/sys/stat.h nor /usr/include/bits/stat.h define st_mtimespec member of struct stat. POSIX compliant name should be st_mtime. Simple patch below fixed the problem for me. --Leo-- --------%<--------%<--------%<-------- diff --git a/src/lfs.c b/src/lfs.c index 13562ee..d96ca38 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -275,7 +275,7 @@ static int lfs_lock_dir(lua_State *L) { while(symlink(tmpln, ln) == -1) { if(errno == EEXIST) { if(lstat(ln, &statbuf) == -1) goto fail; - if(time(NULL) - statbuf.st_mtimespec.tv_sec > expires) { + if(time(NULL) - statbuf.st_mtime > expires) { unlink(ln); continue; } -------->%-------->%-------->%-------- --8323329-68016220-1246568550=:7380-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 20:08:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n62N8WrX023150; Thu, 2 Jul 2009 20:08:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 146461926D; Thu, 2 Jul 2009 20:08:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f202.google.com (mail-vw0-f202.google.com [209.85.212.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BAC4190E0 for ; Thu, 2 Jul 2009 20:07:56 -0300 (BRT) Received: by vwj40 with SMTP id 40so1191164vwj.33 for ; Thu, 02 Jul 2009 16:07:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.94.139 with SMTP id z11mr1038022vcm.106.1246576074175; Thu, 02 Jul 2009 16:07:54 -0700 (PDT) In-Reply-To: <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> References: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> Date: Thu, 2 Jul 2009 18:07:54 -0500 Message-ID: <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> Subject: Re: Tyrant Client? From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016e6480dc8163812046dc11c88 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6480dc8163812046dc11c88 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thank-you, Petite. I will implement Tyrant's binary protocol in Lua. Respectfully, Phoenix Sol On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille wrote: > > On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote: > > Anybody have a Lua client for Tokyo Tyrant? >> > > HTTP? > > "As for the HTTP/1.1 compatible protocol, the server implements the > following commands; "GET" (relevant to `tcrdbget'), "HEAD" (relevant to > `tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to > `tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of each request > is treated as the key encoded by the URL encoding. And the entity body is > treated as the value. However, headers except for "Connection" and > "Content-Length" are ignored. "PUT" can have the header "X-TT-PDMODE" whose > value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to > `tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should have the > header "X-TT-XNAME" whose value stands for the function name to be called. > "POST" can have the header "X-TT-XOPTS" whose value stands for bitwise-or > options of 1 (record locking) and 2 (global locking)." > > http://tokyocabinet.sourceforge.net/tyrantdoc/ > > > --0016e6480dc8163812046dc11c88 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank-you, Petite.=A0 I will implement Tyrant's binary protocol in Lua.=

Respectfully,
Phoenix Sol


On Thu, Jul 2, 2009 at 3:07 PM, Petite A= beille <pe= tite.abeille@gmail.com> wrote:

On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote:

Anybody have a Lua client for Tokyo Tyrant?

HTTP?

"As for the HTTP/1.1 compatible protocol, the server implements the fo= llowing commands; "GET" (relevant to `tcrdbget'), "HEAD&= quot; (relevant to `tcrdbvsiz'), "PUT" (relevant to `tcrdbput= '), "POST" (relevant to `tcrdbext'), and "DELETE&quo= t; (relevant to `tcrdbout'). The URI of each request is treated as the = key encoded by the URL encoding. And the entity body is treated as the valu= e. However, headers except for "Connection" and "Content-Len= gth" are ignored. "PUT" can have the header "X-TT-PDMOD= E" whose value is either of 1 (relevant to `tcrdbputkeep'), 2 (rel= evant to `tcrdbputcat'), or else (relevant to `tcrdbput'). "PO= ST" should have the header "X-TT-XNAME" whose value stands f= or the function name to be called. "POST" can have the header &qu= ot;X-TT-XOPTS" whose value stands for bitwise-or options of 1 (record = locking) and 2 (global locking)."

http://tokyocabinet.sourceforge.net/tyrantdoc/



--0016e6480dc8163812046dc11c88-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 2 21:44:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n630iEtR002077; Thu, 2 Jul 2009 21:44:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AFE018D18; Thu, 2 Jul 2009 21:43:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id DDD8218BD6 for ; Thu, 2 Jul 2009 21:43:38 -0300 (BRT) Received: (qmail invoked by alias); 03 Jul 2009 00:43:35 -0000 Received: from p5B0121BD.dip0.t-ipconnect.de (EHLO dialup) [91.1.33.189] by mail.gmx.net (mp014) with SMTP; 03 Jul 2009 02:43:35 +0200 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX19kKPxBwhZkmMjRaVvm5x+hVlhBF084E/VIzT331J Y3HJrYBU/qr6pk Date: Fri, 3 Jul 2009 02:43:32 +0200 From: Edgar Toernig To: Lua list Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty Message-Id: <20090703024332.454b6ec8.froese@gmx.de> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.74 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > > Simple patch below fixed the problem for me. > > @@ -275,7 +275,7 @@ static int lfs_lock_dir(lua_State *L) { >... It fixes the compilation problem but that function is still broken (racy, busy looping, potentional fd and mem leak, strange algorithm). From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 00:21:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n633L3FL020337; Fri, 3 Jul 2009 00:21:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F93F192A1; Fri, 3 Jul 2009 00:20:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f202.google.com (mail-vw0-f202.google.com [209.85.212.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4880A19296 for ; Fri, 3 Jul 2009 00:20:19 -0300 (BRT) Received: by vwj40 with SMTP id 40so1343764vwj.33 for ; Thu, 02 Jul 2009 20:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=B3FAZ28FpuCpayZk+T/S/93wuBYnFDKvk7yLcuLsbBE=; b=xnqE8YgEqmzXVixNP0J0d0DdenZmpiAGb0QMQzsquZxbmQxgSo2MMWSWWo4n7zNGIo lgkqmRGyjFasydCAK6NQqketz+nCgCt+QoyGz8PYInOqRc2VDmiLrCNNVGCMQQsN3Cqg WmdbuNijACk8+xF58hliifevQ0ddqJC79uLKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=sKzZ2miGElnlynLhlnAsgt4maZIZSJ7wyDIuSy8k4CEgC+R+pY6BH1ZRMji6ltsjRw EUYrM4+4EKYcacrylC3SQpoZAWWYDYKIIDQA+1EQO678tsZ+SMXMHZ1dPQHMz5o9K0sd IZ5zDh2qzT3CAY/qsHEnAHbtLIqRD15VmFyTI= MIME-Version: 1.0 Received: by 10.220.91.208 with SMTP id o16mr1660758vcm.25.1246591217417; Thu, 02 Jul 2009 20:20:17 -0700 (PDT) In-Reply-To: <20090703024332.454b6ec8.froese@gmx.de> References: <20090703024332.454b6ec8.froese@gmx.de> Date: Fri, 3 Jul 2009 00:20:17 -0300 X-Google-Sender-Auth: f4adcba61e3dffc9 Message-ID: <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty From: Fabio Mascarenhas To: Lua list , Kepler Project mailing list Content-Type: multipart/alternative; boundary=0016e6464e04b1be45046dc4a291 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6464e04b1be45046dc4a291 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The algorithm uses a symlink-based lockfile on POSIX (I have to make up a more descriptive name than lock_dir, as the lock can be used to as an exclusive lock to any resource). I think mkstemp and symlink are supposed to be atomic, so where is the race condition? See http://flinflon.brandonu.ca/Dueck/1997/62306/UNIX/shlock.html for a high-level description of a similar algorithm, and http://ftp.df.lth.se/pub/NetBSD/NetBSD-current/src/usr.bin/shlock/shlock.cfor a NetBSD implementation of shlock. Lockfiles are a solution that works for both intra and interprocess locks. If the lock is taken lock_dir returns an error, how to wait until trying again is up to the user. The ideal way would be to have change notification, but this is very system-specific, so unfortunately busy waiting is the easier way... Obviously I am not married to this solution, so if you have a suggestion on how to implement exclusive locks that works both inside the same process (even in the same thread) and across processes, for both POSIX and Windows, I am all ears. :-) -- Fabio Mascarenhas On Thu, Jul 2, 2009 at 9:43 PM, Edgar Toernig wrote: > Leo Razoumov wrote: > > > > Simple patch below fixed the problem for me. > > > > @@ -275,7 +275,7 @@ static int lfs_lock_dir(lua_State *L) { > >... > > It fixes the compilation problem but that function is still > broken (racy, busy looping, potentional fd and mem leak, > strange algorithm). > --0016e6464e04b1be45046dc4a291 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

The algorithm uses a symlink-based lockfile on POSIX (I have to make = up a more descriptive name than lock_dir, as the lock can be used to as an = exclusive lock to any resource). I think mkstemp and symlink are supposed t= o be atomic, so where is the race condition? See http://flinflon.brandonu.ca= /Dueck/1997/62306/UNIX/shlock.html for a high-level description of a si= milar algorithm, and http://ftp.df.lth.se/pub/NetBSD/NetBSD-cur= rent/src/usr.bin/shlock/shlock.c for a NetBSD implementation of shlock.= =C2=A0Lockfiles are a solution that works for both intra and interprocess l= ocks.


If the lock is taken lock_dir returns an error, how to wait until try= ing again is up to the user. The ideal way would be to have change notifica= tion, but this is very system-specific, so unfortunately busy waiting is th= e easier way...


Obviously I am not married to this solution, so if you have a suggest= ion on how to implement exclusive locks that works both inside the same pro= cess (even in the same thread) and across processes, for both POSIX and Win= dows, I am all ears. :-)


--=
Fabio Mascarenhas



--0016e6464e04b1be45046dc4a291-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 03:24:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n636OHdU006079; Fri, 3 Jul 2009 03:24:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36B96192AC; Fri, 3 Jul 2009 03:23:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2330019285 for ; Fri, 3 Jul 2009 03:23:43 -0300 (BRT) Received: by ewy26 with SMTP id 26so2566989ewy.5 for ; Thu, 02 Jul 2009 23:23:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.25.209 with SMTP id z59mr262664wez.204.1246602221328; Thu, 02 Jul 2009 23:23:41 -0700 (PDT) In-Reply-To: <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> References: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> Date: Fri, 3 Jul 2009 08:23:41 +0200 Message-ID: Subject: Re: Tyrant Client? From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n636OHdU006079 On Fri, Jul 3, 2009 at 1:07 AM, Phoenix Sol wrote: > Thank-you, Petite.  I will implement Tyrant's binary protocol in Lua. > > Respectfully, > Phoenix Sol > > > On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille > wrote: >> >> On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote: >> >>> Anybody have a Lua client for Tokyo Tyrant? >> >> HTTP? >> >> "As for the HTTP/1.1 compatible protocol, the server implements the >> following commands; "GET" (relevant to `tcrdbget'), "HEAD" (relevant to >> `tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to >> `tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of each request >> is treated as the key encoded by the URL encoding. And the entity body is >> treated as the value. However, headers except for "Connection" and >> "Content-Length" are ignored. "PUT" can have the header "X-TT-PDMODE" whose >> value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to >> `tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should have the >> header "X-TT-XNAME" whose value stands for the function name to be called. >> "POST" can have the header "X-TT-XOPTS" whose value stands for bitwise-or >> options of 1 (record locking) and 2 (global locking)." >> >> http://tokyocabinet.sourceforge.net/tyrantdoc/ I think the http interface does not perform as well as the binary one and does not allow you to do everything that Tokyo Tyrant proposes. I have written a PHP version of the binary protocol which is complete and up-to-date. FYI, the Python version is not up-to-date. If you want a model to get inspiration, either use my PHP implementation or the Perl or Ruby ones. You can find my code here: http://mamasam.indefero.net/p/tyrant/ -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 04:43:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n637humh015688; Fri, 3 Jul 2009 04:43:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB1A118E6D; Fri, 3 Jul 2009 04:43:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0DF218D64 for ; Fri, 3 Jul 2009 04:43:20 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so706383fgg.5 for ; Fri, 03 Jul 2009 00:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=oLjg3NSytHlXnK8oQgjxPGvbHEixzCAHRc14WX9xD4o=; b=bdftJid8RnMxZCXtAAW3qMWCTolaD+DD2hK0hu67j+3h+LUzS7APZ9mIseAyKahu4S tLQUDzrtAb1ea4ZAQYrVUFtPTfnjy7HOCUOgW1dY6qLObPD8QACnQwirewaFamoM+5DT +b8v+MK92AP87GtA8wUiZfFMJuo3+SwwJF2NQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=KFfiAOg/APu+0r0F1rrtwvmlTnW1G5ZU4bRztkZDdMpO5+THuSdM9jAeNXlh17esIr 21RdhkKSHmMemVlf/ZkHnnIsyv1wSDAZiwWLG3rFGOzisjhsJO9a0zE09VXBARdqArb9 R5iihxcj+3RBxyT6EBlaIucl/RrhJcjRLz6cg= MIME-Version: 1.0 Received: by 10.86.27.15 with SMTP id a15mr932865fga.28.1246606998377; Fri, 03 Jul 2009 00:43:18 -0700 (PDT) Date: Fri, 3 Jul 2009 09:43:18 +0200 Message-ID: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> Subject: Lua for MediaWiki? From: Peter Jacobi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just FYI: There is a discussion on the wikitech-l mailing list, whether to replace MediaWiki's current templating system (a Turing-complete language uglier than PERL) with Lua (or other options). Lua could gain some millions of new users by this... Peter From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 04:55:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n637tlVo016747; Fri, 3 Jul 2009 04:55:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46CA419290; Fri, 3 Jul 2009 04:55:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3535018E61 for ; Fri, 3 Jul 2009 04:55:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so2606409ewy.5 for ; Fri, 03 Jul 2009 00:55:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.25.209 with SMTP id z59mr281262wez.204.1246607722641; Fri, 03 Jul 2009 00:55:22 -0700 (PDT) In-Reply-To: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> Date: Fri, 3 Jul 2009 09:55:22 +0200 Message-ID: Subject: Re: Lua for MediaWiki? From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 3, 2009 at 9:43 AM, Peter Jacobi wrote: > Just FYI: There is a discussion on the wikitech-l mailing list, > whether to replace MediaWiki's current templating system (a > Turing-complete language uglier than PERL) with Lua (or other > options). Lua could gain some millions of new users by this... Lua is already available in MediaWiki: http://www.mediawiki.org/wiki/Extension:Lua But I think it is still experimental. I had a look at this code for my Try Lua! experiment. -- Bertrand Mansion http://trylua.mamasam.com Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 09:05:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63C5VeV012216; Fri, 3 Jul 2009 09:05:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B531B18EC5; Fri, 3 Jul 2009 09:05:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96EA018B2B for ; Fri, 3 Jul 2009 09:04:55 -0300 (BRT) Received: by bwz11 with SMTP id 11so990926bwz.5 for ; Fri, 03 Jul 2009 05:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=zs08JZv2oS/NBRRqGvya9SX8fUpy5OswEX7M+DP++W8=; b=Y/Y2fNXqzOkCo/EIGa21K9hSXMwqGeqXk983044aAWeMz782ag/71piIgibF0j19ky AbZk9QfPGJDA4b3XQpvIwXCV9940lVVKAoIaIr/4BHx2o8RdV4cDbUkModMPb1P3xofx LQVBfL79m2PxN/4EpLgGxbjZA8KWnAmAtvzEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=HMt7jsZ/CoCtYi1hyeAegxNpxZM/IWL2qL8cgqfbNDsmdjHq2M5kMoWfcBnGvpI2Y0 gtzSSwLwDOr82d6pFMd7qs/fX0PwY4e5MeWLCM2UmKruibc6BMIFOqrqbqMk7VIJq7vr mM7DSjNfPQMZWAdHVy3VJ8gONiieHHY4MMxjI= MIME-Version: 1.0 Received: by 10.239.175.131 with SMTP id n3mr99167hbf.82.1246622693239; Fri, 03 Jul 2009 05:04:53 -0700 (PDT) Date: Fri, 3 Jul 2009 14:04:53 +0200 Message-ID: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> Subject: Inling C/Fortran in Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Of course, luatcc does this already, but does not free you from having to write the binding code, such as would be generated by tolua++. Inling performance-critical code can be an effective trick: http://on-ruby.blogspot.com/2006/07/rubyinline-making-making-things-faster.html Now the question is, is it worth pursuing this for Lua? tolua++ works rather nicely, but you have to maintain a separate .c/.cpp file and hand-roll the .pkg file (the cleaned header). So, for proof-of-concept, I'd build on tolua++. After the first compile, a quick dependency check means that the inlined code need not be recompiled. One has to make sure that the .so/.dll is loadable from the same location as the original Lua file, etc. I've been generally thinking about Lua and High-Performance Computing. A library like this, plus MPI bindings, and one has a means to write very effective parallelized programs in a nicer language than FORTRAN. Actually, modern FORTRAN is a good companion to Lua in this context, since it's cleaner and faster than C, especially for things like bulk array operations and complex arithmetic. Any thoughts? steve d. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 09:09:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63C9EfL012750; Fri, 3 Jul 2009 09:09:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B5AA19219; Fri, 3 Jul 2009 09:08:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 403B619169 for ; Fri, 3 Jul 2009 09:08:47 -0300 (BRT) Received: by qyk31 with SMTP id 31so2535403qyk.33 for ; Fri, 03 Jul 2009 05:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=zbOXAa7A/fBsZurGmg0hz+37v26BCkx1lxbPsVjzjwI=; b=rFiGCZIHArkn2TeZPQK7iNGml7ivAWIDA5QwHZoWRHQI08EbJmpKQuu/j2i2MaVde4 lYD1/BE/XLXxA412gmrw7J/hm+wr3Dh/8pyxJ865EVO/JrgkzZmGqMzT3kBc87Wa9QEo 8EwpgfLvFuM4x3iSxU02pBrl3nLKq9jPFbxgA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=MZGl0sQB2MzZC96x1jQQu3FPfkuM3bYKIFOOGy3s+ObfZ2TRFWDAHWo40KwZTcwoFJ H/TxKF7o5BIeXtpqFyWSsSwcVf7wbjhUW10NeHyNz+Ra/VQizy+1HvOY73imtVAiS64p kdtuMa+yfUvNAYxREoxRTnoEjZ3xUWeUgeU3Y= Received: by 10.224.54.17 with SMTP id o17mr1773821qag.350.1246622925546; Fri, 03 Jul 2009 05:08:45 -0700 (PDT) Received: from ?192.168.1.2? (user-0cdfe6c.cable.mindspring.com [24.215.184.204]) by mx.google.com with ESMTPS id 5sm7363979qwg.5.2009.07.03.05.08.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 05:08:44 -0700 (PDT) Message-Id: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> From: kino To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Lua Workshop 2008 Videos Date: Fri, 3 Jul 2009 08:08:43 -0400 X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Lua community, Last year I made videos of some of the Lua Workshop 2008 presentation. I learned a lot about Lua making these videos and was even able to use Lua for my Masters thesis which I successfully defended last month. I posted these videos to Vimeo and my university server. At Vimeo it is possible to download these videos in the form which I uploaded them by simply making an account with an email address and clicking a link on the bottom of the page for each video. I still had to compress them a bit because they are all quite long and there is an upload data limit. Vimeo compressed them again in order to stream them. Vimeo is now changing its policy for the basic free accounts that they will delete the original uploads and only keep their compressed streaming version available for download. This will take effect August 1 and I thought I would let the Lua community know in case people are interested in downloading them before then. I think there may be a limit on the number of downloads per video file per day, so if you encounter some limit simply wait 24 hours if this is the case. You can find the videos on Vimeo here: http://www.vimeo.com/tag:luaworkshop and at the university server here: http://v.poly.edu/stories/Lua Please note that both sites operate with flash player. Cheers Jeremy Schaller From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 09:15:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63CFFut013659; Fri, 3 Jul 2009 09:15:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5C9D192AD; Fri, 3 Jul 2009 09:14:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (unknown [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D120819297 for ; Fri, 3 Jul 2009 09:14:50 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MMhfD-0003JY-Q6 for lua@bazar2.conectiva.com.br; Fri, 03 Jul 2009 13:14:47 +0100 Received: from [192.168.2.24] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id E167D4E6CE for ; Fri, 3 Jul 2009 13:14:44 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:12997 with envelope Message-ID: <4A4DF629.2060209@cowlark.com> Date: Fri, 03 Jul 2009 13:14:33 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty References: <20090703024332.454b6ec8.froese@gmx.de> <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> In-Reply-To: <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n63CFFut013659 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fabio Mascarenhas wrote: [...] > Obviously I am not married to this solution, so if you have a suggestion > on how to implement exclusive locks that works both inside the same > process (even in the same thread) and across processes, for both POSIX > and Windows, I am all ears. :-) We did this at work. On Unix our solution was to create a dummy file and then use advisory locks with fcntl(_, F_SETLKW, _) locking across the whole file. These have the nice behaviour of being automatically unlocked if the app terminates unexpectedly. Allegedly these even work across NFS these days. For Windows we used named semaphores --- there's an atomic lookup-by-name-or-create-if-not-found function call. Then you just use them like an ordinary mutex. If you want to lock *between* Windows and a Posix subsystem? Pass, I'm afraid... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpN9iYACgkQf9E0noFvlzgcnACgoXmC4xTGVVSt6ihnwlaR0FU9 fEYAoKwOWTvUmcp43+lYPhC1N1LcN6RV =atYC -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 11:11:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63EBlI5006205; Fri, 3 Jul 2009 11:11:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC8001928C; Fri, 3 Jul 2009 11:11:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B54CE18EDB for ; Fri, 3 Jul 2009 11:11:05 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so750292rvb.41 for ; Fri, 03 Jul 2009 07:11:03 -0700 (PDT) Received: by 10.140.139.20 with SMTP id m20mr470307rvd.142.1246630263614; Fri, 03 Jul 2009 07:11:03 -0700 (PDT) Received: from ?192.168.0.8? (64-193-220-123.wco.clearwire-dns.net [64.193.220.123]) by mx.google.com with ESMTPS id c20sm6838385rvf.49.2009.07.03.07.11.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 07:11:02 -0700 (PDT) Message-Id: <6472C845-E4CB-410A-896D-7D8854E83F0B@burninglabs.com> From: Phoenix Sol To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A341) Mime-Version: 1.0 (iPhone Mail 7A341) Subject: Re: Tyrant Client? Date: Fri, 3 Jul 2009 09:09:29 -0500 References: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks a lot, Bertrand. On Jul 3, 2009, at 1:23 AM, Bertrand Mansion wrote: > On Fri, Jul 3, 2009 at 1:07 AM, Phoenix Sol > wrote: >> Thank-you, Petite. I will implement Tyrant's binary protocol in Lua. >> >> Respectfully, >> Phoenix Sol >> >> >> On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille > > >> wrote: >>> >>> On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote: >>> >>>> Anybody have a Lua client for Tokyo Tyrant? >>> >>> HTTP? >>> >>> "As for the HTTP/1.1 compatible protocol, the server implements the >>> following commands; "GET" (relevant to `tcrdbget'), >>> "HEAD" (relevant to >>> `tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to >>> `tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of >>> each request >>> is treated as the key encoded by the URL encoding. And the entity >>> body is >>> treated as the value. However, headers except for "Connection" and >>> "Content-Length" are ignored. "PUT" can have the header "X-TT- >>> PDMODE" whose >>> value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to >>> `tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should >>> have the >>> header "X-TT-XNAME" whose value stands for the function name to be >>> called. >>> "POST" can have the header "X-TT-XOPTS" whose value stands for >>> bitwise-or >>> options of 1 (record locking) and 2 (global locking)." >>> >>> http://tokyocabinet.sourceforge.net/tyrantdoc/ > > I think the http interface does not perform as well as the binary one > and does not allow you to do everything that Tokyo Tyrant proposes. > > I have written a PHP version of the binary protocol which is complete > and up-to-date. FYI, the Python version is not up-to-date. If you want > a model to get inspiration, either use my PHP implementation or the > Perl or Ruby ones. > > You can find my code here: > http://mamasam.indefero.net/p/tyrant/ > > > -- > Bertrand Mansion > Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 11:32:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63EWYoR011392; Fri, 3 Jul 2009 11:32:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 735A819219; Fri, 3 Jul 2009 11:32:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout02.plus.net (relay.pcl-ipout02.plus.net [212.159.7.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7F3618B3D for ; Fri, 3 Jul 2009 11:32:06 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAOzTUrUnw6U/2dsb2JhbADOH4QSBQ Received: from fhw-relay07.plus.net ([212.159.14.148]) by relay.pcl-ipout02.plus.net with ESMTP; 03 Jul 2009 15:32:02 +0100 Received: from flute.plus.com ([212.159.60.16] helo=[127.0.0.1]) by fhw-relay07.plus.net with esmtp (Exim) id 1MMjo1-0005IS-T3 for lua@bazar2.conectiva.com.br; Fri, 03 Jul 2009 15:32:02 +0100 Message-ID: <4A4E165E.6060105@gpsl.net> Date: Fri, 03 Jul 2009 15:31:58 +0100 From: Tim Channon User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 939f549b397ef4eb83010afb645af161 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Lauer wrote: > The Lua short reference provides a concise summary of the Lua syntax and > core libraries. I have just updated and uploaded another draft of the > 5.1 version. This can be downloaded from either the lua-users.org wiki: This is a major item and it needs public discussion. When I found the PDF is hard to read I checked and there is a known common problem, the chosen font does not work as intended across all platforms. The only solution of which I am aware is change to a more universally acceptable font. None are perfect. Unfortunately the issues is especially hard because it also has to print universally and in small sizes. I am not naming any fonts, let others argue over that. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 11:54:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63EsHeI016314; Fri, 3 Jul 2009 11:54:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DCA1192EF; Fri, 3 Jul 2009 11:53:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9F91192E9 for ; Fri, 3 Jul 2009 11:53:45 -0300 (BRT) Received: by fxm28 with SMTP id 28so2332061fxm.5 for ; Fri, 03 Jul 2009 07:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=vPs56kMVEwaiWoeM4hTjoKTl08J4uWtE1ZFTjozEHsQ=; b=Ta/mfY/6dKno+1wWCkpYHEfljhWdlOKs3kSGp2UjvQvMux0Gx0vrrRQW1P3LV7hnqd jlgz0dWb4MEcjBxWKIQyjKpNvxJrx1SMbn6FooR5SegyH+TyobDoIgqYH3u4fnVOQR6B 6HKEIUjlBko3AxCqgxKx9ZKx8mybwVKEqnnwM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=TKwEANYk3Hx1q0Y+mJKnyXN6p3LVHNJPvv2M/ERsnHQz1hkT/BGykQaxbsGm94pQD0 b2GEBmcEnHFOseBPkxD33UZ86tv+M45QhIpWm7dj7GqLKS/q+P4c7GfyZfjesD6BzJlE d2qvGc9x8zC98trJUkknOp+jguPWQ2zkgEoiQ= MIME-Version: 1.0 Received: by 10.223.105.139 with SMTP id t11mr1019530fao.37.1246632824382; Fri, 03 Jul 2009 07:53:44 -0700 (PDT) In-Reply-To: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> Date: Fri, 3 Jul 2009 10:53:44 -0400 X-Google-Sender-Auth: e092f6682ac9572d Message-ID: Subject: Re: Lua Workshop 2008 Videos From: "A.S. Bradbury" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/3 kino : > Vimeo is now changing its policy for the basic free accounts that they will > delete the original uploads and only keep their compressed streaming version > available for download. This will take effect August 1 and I thought I would > let the Lua community know in case people are interested in downloading them > before then. I think there may be a limit on the number of downloads per > video file per day, so if you encounter some limit simply wait 24 hours if > this is the case. You can find the videos on Vimeo here: > > http://www.vimeo.com/tag:luaworkshop I've downloaded the .mov for all videos apart from the NumLua presentation, for which I see "Sorry. This video is not available for download". Any idea what the problem is there? If it were possible to choose a suitable Creative Commons license it seems these videos could be uploaded to the Internet Archive, allowing people to download them in high quality in the future. This might be worth looking in to. Alex From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:02:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63F2CPp018526; Fri, 3 Jul 2009 12:02:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7038019302; Fri, 3 Jul 2009 12:01:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C272192F8 for ; Fri, 3 Jul 2009 12:01:41 -0300 (BRT) Received: by fxm28 with SMTP id 28so2336635fxm.5 for ; Fri, 03 Jul 2009 08:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jis5P6SaPsm0uH3MtwiywVR/ox7/tThW9jHTZhu0mcg=; b=ejqPw/+3mZfgUDlrUvsqEMoBjLcBgNfegmP5t1PeoYQ0NJbdF7BPFZwol7ReGNPXhW /z7czfHV9H8LP9hcdF/1Kfa9lRj1G9cmnNUKN0DX17mu7TgmIkoXHdDGpiWRgtVcmMHK G9ecF4MYO5OzHl1EHB0lryFRa5dhtQhn8TVA4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=IPQzCRnHDYRRTu4sy8NXU76ztu/WmJVPhSFOXTDU8wI16e3/Hs/4V7NWae93vf/mGV TzrsqleABK8SnMEnFjF5VvV9PC/6Pzw0oE183j4K1x7zNT4LI3MjLgcwV+Nnqu4KTZpK iZryVs42DHnX3KCwFpjdffDLD/h/CQ9aJQ9VU= MIME-Version: 1.0 Received: by 10.223.106.148 with SMTP id x20mr985455fao.68.1246633300263; Fri, 03 Jul 2009 08:01:40 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Jul 2009 11:01:40 -0400 X-Google-Sender-Auth: 36fd65386e5ef9a8 Message-ID: Subject: Re: [ANN] Lua Short Reference, minor upgrade From: "A.S. Bradbury" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/2 Thomas Lauer : > The Lua short reference provides a concise summary of the Lua syntax and > core libraries. I have just updated and uploaded another draft of the > 5.1 version. This can be downloaded from either the lua-users.org wiki: Might you consider releasing whatever source files you use to create this quick reference? That way people can customise it to their needs. It could be particularly useful for projects which use Lua as an embedded scripting language. Alex From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:04:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63F3uhJ019125; Fri, 3 Jul 2009 12:03:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 957271930C; Fri, 3 Jul 2009 12:03:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F94A192E6 for ; Fri, 3 Jul 2009 12:03:29 -0300 (BRT) Received: by wa-out-1112.google.com with SMTP id v27so513511wah.5 for ; Fri, 03 Jul 2009 08:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=tCKSp4jRFqwdUs51BmaPSu3RrZ+hd41h+GOQ5GTAeAw=; b=UY8CgvuVE/661aS5USccIPf7PsWmGaRD6pFUzgNLEdLwnvFI6ZzNlGrrpiCe+eSod2 nINUA1ugYweMhIULCgDm6qVOBshX0qF2Ad4lnrvyu5nMqIE7LNVNaaMImbVRj3bYqEQh JrWKvyge5RxveeurdyhvtoAKqEz1Um8WcTHfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=kdg1769J751JrSBjt9N9HSpy/XALVTBoLDznHVmGkafEpb2KSA26S4c5mUThAcsoiF mCc09wD4L1dJRBlxWPyLnWrymMnSKjXN/fT7c62KnedaWGoTqiZ5NGyxZtpBRQd5lQP8 b48ipCh0wZnQ3mW8xoJRqV3JdWZFsy/Xdx85w= Received: by 10.114.113.6 with SMTP id l6mr2085820wac.157.1246633407687; Fri, 03 Jul 2009 08:03:27 -0700 (PDT) Received: from ?192.168.1.2? (user-0cdfe6c.cable.mindspring.com [24.215.184.204]) by mx.google.com with ESMTPS id j15sm6422123waf.51.2009.07.03.08.03.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 08:03:26 -0700 (PDT) Message-Id: <5847A678-017E-41F3-9C6E-F292576D1F7F@gmail.com> From: kino To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Lua Workshop 2008 Videos Date: Fri, 3 Jul 2009 11:03:24 -0400 References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 3, 2009, at 10:53 AM, A.S. Bradbury wrote: > > I've downloaded the .mov for all videos apart from the NumLua > presentation, for which I see "Sorry. This video is not available for > download". Any idea what the problem is there? Yes, it should fixed now. Thank you. > If it were possible to choose a suitable Creative Commons license it > seems these videos could be uploaded to the Internet Archive, allowing > people to download them in high quality in the future. This might be > worth looking in to. > > Alex Yes this might be a worthwhile solution. Cheers Jeremy From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:07:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63F534Z019498; Fri, 3 Jul 2009 12:05:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4477D19316; Fri, 3 Jul 2009 12:04:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f202.google.com (mail-vw0-f202.google.com [209.85.212.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4FE519312 for ; Fri, 3 Jul 2009 12:04:36 -0300 (BRT) Received: by vwj40 with SMTP id 40so1536399vwj.33 for ; Fri, 03 Jul 2009 08:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+JuRQvB6syjRWju6kDbYxNaRp6F6EBYVc+tksRKonpk=; b=rw8HPwEUsN+hiarTbeZ20/hG90YJCaMT1iYwE7DEEnB30MQJPFZw7gXay+lXW7jnOp pjXNCHxJK3oW27TV09RD8ucOCa5NnZwPbPE0JDrglMjyr46otBux1eaLfdaJYJR+TAIZ 1Rhn3hKpgsi+AIwDxkGUhoRRVjTg5zmn8R5Vc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=mykmIE3oi5y6sQ2HQwTQCU+kWtyR3kLKTXv27juRJB8lKjGDONhiJvE4RsriRx8hlp xHL1/dOcanl1ZaC41VkHJDxV3rwo1Nv74jmnWcy6ri2TuRgnoSpbUFvk9db+Xc2IB6yx Pjc+fm5JNA1tp4XxKIFH5paD8hCxXzKGYLxDU= MIME-Version: 1.0 Received: by 10.220.85.198 with SMTP id p6mr2932041vcl.48.1246633475271; Fri, 03 Jul 2009 08:04:35 -0700 (PDT) Date: Fri, 3 Jul 2009 12:04:35 -0300 X-Google-Sender-Auth: 3637286d1f5b0e3b Message-ID: <92ab989c0907030804h5700791fh256171d4c742961a@mail.gmail.com> Subject: LuaForge temporarily out of reach From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n63F534Z019498 LuaForge's ISP is going through some maintenance services and the site will be down for the next 2 hours. The server is still up, just out of reach. André From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:18:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63FIZML022559; Fri, 3 Jul 2009 12:18:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C3691931F; Fri, 3 Jul 2009 12:18:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from postduif.ic.uva.nl (postduif.ic.uva.nl [145.18.40.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06DF419319 for ; Fri, 3 Jul 2009 12:18:06 -0300 (BRT) Received: from [192.168.178.21] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by postduif.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n63FI0rA011457 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 3 Jul 2009 17:18:01 +0200 Message-Id: From: Hans van der Meer To: lua-list Content-Type: multipart/alternative; boundary=Apple-Mail-1--108376131 Mime-Version: 1.0 (Apple Message framework v935.3) Subject: XCode template for lua modules Date: Fri, 3 Jul 2009 17:17:59 +0200 X-Mailer: Apple Mail (2.935.3) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.180 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1--108376131 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Working on a Macintosh under MacOSX I am trying to get the XCode build settings in shape for compilation of a Lua C-module into module.so; starting with the XCode-template for a BSD dynamic library. Having read the instructions for using make I have the following question: Why does one prescribe for the Mach-O Type the choice "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both seem to work when the result is "require"-ed. Does it matter? Or is there a fundamental difference I am overlooking? Hans van der Meer --Apple-Mail-1--108376131 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Working on a Macintosh under = MacOSX I am trying to get the XCode build settings in shape for = compilation of a Lua C-module into module.so; starting with the = XCode-template for a BSD dynamic library.

Having read = the instructions for using make I have the following = question:

Why does one prescribe for the Mach-O = Type the choice "bundle" (mh_bundle) instead of "dynamic library" = (mh_dylib). Both seem to work when the result is "require"-ed. Does it = matter? Or is there a fundamental difference I am = overlooking?

=
Hans van der = Meer



=

= --Apple-Mail-1--108376131-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:28:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63FS85T024446; Fri, 3 Jul 2009 12:28:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 346C71A592; Fri, 3 Jul 2009 12:27:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from DS1-7684.ns.make247.co.uk (ns.make247.co.uk [217.199.173.58]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F3CA192EB for ; Fri, 3 Jul 2009 12:27:39 -0300 (BRT) Received: from [192.168.0.6] ([91.85.129.203]) by DS1-7684.ns.make247.co.uk with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jul 2009 16:27:36 +0100 Message-ID: <4A4E2367.6010604@make247.co.uk> Date: Fri, 03 Jul 2009 16:27:35 +0100 From: Dave Nichols Organization: Match-IT Limited User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jul 2009 15:27:36.0931 (UTC) FILETIME=[CB5D3330:01C9FBF2] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Another reason for releasing the 'source' is to allow formatting as a booklet style - double-sided A4 centre-folded. The 4 page option but formatted 1 page per sheet would allow use of the many booklet printing utilities around. As it is, the pages are in the wrong order to do this. A.S. Bradbury wrote: > 2009/7/2 Thomas Lauer : > >> The Lua short reference provides a concise summary of the Lua syntax and >> core libraries. I have just updated and uploaded another draft of the >> 5.1 version. This can be downloaded from either the lua-users.org wiki: >> > > Might you consider releasing whatever source files you use to create > this quick reference? That way people can customise it to their needs. > It could be particularly useful for projects which use Lua as an > embedded scripting language. > > Alex > > > -- Regards, Dave Nichols Match-IT Limited Tel: 0845 1300 510 Fax: 0845 1300 610 mailto:dave.nichols@make247.co.uk http://www.make247.co.uk Email Disclaimer: The contents of this electronic mail message and any attachments (collectively "this message") are confidential, possibly privileged and intended only for its addressee ("the addressee"). If received in error, please delete immediately without disclosing its contents to anyone. Neither the sender nor its management or employees will in any way be responsible for any advice, opinion, conclusion or other information contained in this message or arising from it's disclosure. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 12:44:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63FiUPf027579; Fri, 3 Jul 2009 12:44:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57AE41A600; Fri, 3 Jul 2009 12:44:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0154.hostedemail.com [64.99.136.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFCB11A59E for ; Fri, 3 Jul 2009 12:44:01 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay05.hostedemail.com (Postfix) with SMTP id 27A7717CAF24 for ; Fri, 3 Jul 2009 15:44:00 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 488a64cf08fc827e, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:946:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1431:1437:1487:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1766:1792:2393:2525:2560:2563:2682:2685:2857:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3318:3352:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:5007:6261:7679:8829:8957:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 1992 Received: from taboche (unknown [89.242.149.45]) (Authenticated sender: thomas.lauer) by omf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2009 15:43:59 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Fri, 03 Jul 2009 16:43:59 +0100 Organization: TL Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n63FiUPf027579 "A.S. Bradbury" wrote: > 2009/7/2 Thomas Lauer : > > The Lua short reference provides a concise summary of the Lua syntax and > > core libraries. I have just updated and uploaded another draft of the > > 5.1 version. This can be downloaded from either the lua-users.org wiki: > > Might you consider releasing whatever source files you use to create > this quick reference? That way people can customise it to their needs. Absolutely. I have already sent the source files to a few people with special requirements. A problem with general release might be the fact that the source is a set of MS Word .doc files with some hairy formatting. I have always wanted to "port" this to OpenOffice, but I've never found the time to do so. Any volunteers? In fact, if someone else wants to take over in toto, that would be fine with me. It's not really a lot of work; it just pops up every now and then, with a couple hours (at worst half a day, if there's a backlog of changes) to check everything in and prepare a new version. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 13:08:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63G8LnD032122; Fri, 3 Jul 2009 13:08:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61816192DB; Fri, 3 Jul 2009 13:07:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 145C118E5B for ; Fri, 3 Jul 2009 13:07:46 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so999156qwi.11 for ; Fri, 03 Jul 2009 09:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Dh7N96ATUDQF8/RP87QJYVy7LSsgipcwvAY3OBHnnfI=; b=xvaL3LRNjWpDCoi/gxMMtdp3JRSU8pOPyGkh7W3WOfW+O2IhH5DccVaDl8ki8QUPH7 4tzFy5+Pepr1+MjmyHai2oFckFmkxqBoAq+uKt0KNgVPO7kxmtf61VfKZ6gBoKR5dn5/ HGm0QZwOEfQNMy1zIuBfadC/MRPkTYQZfO3UE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=NPK8vnafqAkDUIYwvZwJnYzSE4fAO6qUNLl+EAgX32OCSJhzUrcn/tKHtfSjpp0Gao pszgISDCpC/I2mN02xWZ0agciC85fqH42ghn3glNnGoKivdly0YbJ4yqDCxqhze6YRZo msABhELkvZ6SVMoecYdfx6jgUfufpzDrGi+cM= MIME-Version: 1.0 Received: by 10.224.45.70 with SMTP id d6mr2111167qaf.346.1246637265167; Fri, 03 Jul 2009 09:07:45 -0700 (PDT) In-Reply-To: <4A4DF629.2060209@cowlark.com> References: <20090703024332.454b6ec8.froese@gmx.de> <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> <4A4DF629.2060209@cowlark.com> Date: Fri, 3 Jul 2009 13:07:45 -0300 X-Google-Sender-Auth: 41dbdf71dcc8e48c Message-ID: <7913df4d0907030907u41809ce1u3e38bc7deffe36b1@mail.gmail.com> Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty From: Fabio Mascarenhas To: Lua list Content-Type: multipart/alternative; boundary=0015175cba4e5aa7f2046dcf5b32 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cba4e5aa7f2046dcf5b32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Jul 3, 2009 at 9:14 AM, David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Fabio Mascarenhas wrote: > [...] > > Obviously I am not married to this solution, so if you have a suggestion > > on how to implement exclusive locks that works both inside the same > > process (even in the same thread) and across processes, for both POSIX > > and Windows, I am all ears. :-) > > We did this at work. On Unix our solution was to create a dummy file and > then use advisory locks with fcntl(_, F_SETLKW, _) locking across the > whole file. These have the nice behaviour of being automatically > unlocked if the app terminates unexpectedly. Allegedly these even work > across NFS these days. > I thought about using file-level locks (lfs already has those), but they do let the process that acquired the lock acquire it again, which is quite common if you are using coroutines for cooperative threading (using the Xavante web server, for example). Lockfiles don't have this problem. > For Windows we used named semaphores --- there's an atomic > lookup-by-name-or-create-if-not-found function call. Then you just use > them like an ordinary mutex. > I haven't tested, but mutexes probably have the same problem as above. In Windows I use a call to CreateFile that always fails if the file already exists, and set the file to be automatically deleted when its fd is closed (or the process is killed). > > If you want to lock *between* Windows and a Posix subsystem? Pass, I'm > afraid... > -- Fabio Mascarenhas --0015175cba4e5aa7f2046dcf5b32 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Jul 3, 2009 at 9:14 AM, David Given <dg@cowlark.com><= /span> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fabio Mascarenhas wrote:
[...]
> Obviously I am not married to this solution, so if y= ou have a suggestion
> on how to implement exclusive locks that works both inside the same > process (even in the same thread) and across processes, for both POSIX=
> and Windows, I am all ears. :-)

We did this at work. On Unix our solution was to create a dummy file = and
then use advisory locks with fcntl(_, F_SETLKW, _) locking across the
whole file. These have the nice behaviour of being automatically
unlocked if the app terminates unexpectedly. Allegedly these even work
across NFS these days.

I thought about using file-level locks (lfs alre= ady has those), but they do let the process that acquired the lock acquire = it again, which is quite common if you are using coroutines for cooperative= threading (using the Xavante web server, for example). Lockfiles don't= have this problem.


For Windows we used named semaphores --- there's an atomic
looku= p-by-name-or-create-if-not-found function call. Then you just use
them l= ike an ordinary mutex.

I haven't tested, b= ut mutexes probably have the same problem as above. In Windows I use a call= to CreateFile that always fails if the file already exists, and set the fi= le to be automatically deleted when its fd is closed (or the process is kil= led).
=C2=A0

If you want to lock *between* Windows and a Posix subsystem? Pass, I= 9;m
afraid...
=C2=A0
--
F= abio Mascarenhas
=C2=A0

--0015175cba4e5aa7f2046dcf5b32-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 13:13:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63GDgHO000849; Fri, 3 Jul 2009 13:13:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC5B019306; Fri, 3 Jul 2009 13:13:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F32E0192FB for ; Fri, 3 Jul 2009 13:12:56 -0300 (BRT) Received: by bwz11 with SMTP id 11so1136035bwz.5 for ; Fri, 03 Jul 2009 09:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=OkosHnxXCtlxkp9jl7ncjZOcRBHR3N8rPrdVsHxiND4=; b=qkPgWjHCEjBVy8TtVnm2+EmhtuMBUUvsF5EXiPGBor/McfLv5JAquxdtMfWf00ytoS iLr0o/DDZYlLy5xfgGgyuMCWI45BqwvJ00CuKK+dLocfE8BE5oZ4e6JLcXge3L+VRvwj 45O+X3Ehd70aJ6uf+srewvYFtkjfcTrkvYTLs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Nk57XmHajqbJDN8auqh6dj0G3os3GF8rGRDk4ORrp2X1odgM4pSUNEFdB5SqbbmEMF RMsVtDWaopHo5qUJt5R59l7OYb0vf0t7NrgkbGg2vzfIUB6L6A73VSwkNNOtTIVD7v8m pRPDR8qBLAJAND02edpnDDGyerAxo43yolQ7I= MIME-Version: 1.0 Received: by 10.223.122.15 with SMTP id j15mr1031984far.74.1246637573887; Fri, 03 Jul 2009 09:12:53 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Jul 2009 12:12:53 -0400 X-Google-Sender-Auth: d88d742e90e4aa94 Message-ID: Subject: Re: [ANN] Lua Short Reference, minor upgrade From: "A.S. Bradbury" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/3 Thomas Lauer : > "A.S. Bradbury" wrote: >> 2009/7/2 Thomas Lauer : >> > The Lua short reference provides a concise summary of the Lua syntax and >> > core libraries. I have just updated and uploaded another draft of the >> > 5.1 version. This can be downloaded from either the lua-users.org wiki: >> >> Might you consider releasing whatever source files you use to create >> this quick reference? That way people can customise it to their needs. > > Absolutely. I have already sent the source files to a few people with > special requirements. > > A problem with general release might be the fact that the source is a > set of MS Word .doc files with some hairy formatting. I have always > wanted to "port" this to OpenOffice, but I've never found the time to do > so. Any volunteers? I would suggest just putting the source files you have online despite the fact MS Word isn't an ideal format - that way anybody with a remote interest in seeing how difficult it would be to 'port' it to something else can try to do so with minimum fuss. Thanks to you and the other contributors for your work on the short reference. Alex From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 13:44:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63GiCm7008163; Fri, 3 Jul 2009 13:44:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4973519321; Fri, 3 Jul 2009 13:43:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B9E01930C for ; Fri, 3 Jul 2009 13:43:41 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id n63Ghcd7021640 for ; Fri, 3 Jul 2009 18:43:39 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALrRTUrDbohc/2dsb2JhbADOMYQSBQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 03 Jul 2009 18:43:37 +0200 Received: from [192.168.127.128] (host119-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.119]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id n63Ghbds099130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jul 2009 18:43:38 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A4E3537.7090607@erix.it> Date: Fri, 03 Jul 2009 18:43:35 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Lauer wrote: > A problem with general release might be the fact that the source is a > set of MS Word .doc files with some hairy formatting. I have always > wanted to "port" this to OpenOffice, but I've never found the time to do > so. Any volunteers? Considering that I used OpenOffice for the first version, converting back to OO shouldn't be too hard (I hope), unless you had to make major formatting changes when you upgraded and improved it. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 13:50:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63Go2cZ009545; Fri, 3 Jul 2009 13:50:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48F5B1932E; Fri, 3 Jul 2009 13:49:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0132.hostedemail.com [64.99.136.132]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 932C719327 for ; Fri, 3 Jul 2009 13:49:34 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay04.hostedemail.com (Postfix) with SMTP id 220F56F51C4 for ; Fri, 3 Jul 2009 16:49:31 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 209f52ffdf8d8578, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1487:1513:1515:1516:1518:1521:1534:1539:1593:1594:1711:1730:1747:1766:1792:2393:2525:2560:2563:2682:2685:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3352:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:4250:5007:6261:7679:8957:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 1673 Received: from taboche (unknown [89.242.149.45]) (Authenticated sender: thomas.lauer) by omf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2009 16:49:30 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Fri, 03 Jul 2009 17:49:30 +0100 Organization: TL Message-ID: References: <4A4E3537.7090607@erix.it> In-Reply-To: <4A4E3537.7090607@erix.it> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n63Go2cZ009545 Enrico Colombini wrote: > Thomas Lauer wrote: > > A problem with general release might be the fact that the source is a > > set of MS Word .doc files with some hairy formatting. I have always > > wanted to "port" this to OpenOffice, but I've never found the time to do > > so. Any volunteers? > > Considering that I used OpenOffice for the first version, converting > back to OO shouldn't be too hard (I hope), unless you had to make major > formatting changes when you upgraded and improved it. Is that a general observation or are you volunteering? ;-) I agree that it's probably not too hard though with these "hard-formatted" things the devil is where he usually is: in the detail. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 13:55:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63GtD6a010943; Fri, 3 Jul 2009 13:55:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63AA419338; Fri, 3 Jul 2009 13:54:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D0CF19332 for ; Fri, 3 Jul 2009 13:54:46 -0300 (BRT) Received: by qyk31 with SMTP id 31so2745534qyk.33 for ; Fri, 03 Jul 2009 09:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=pXowv68BxYd7NNxCFLYdDMNrGbztodLqpdYoxA5hO2g=; b=nKV2H2RbjRFPDnGWSfC9g42d88MnbULs4aHKwd4WZ76OaxkBkc6zlHLclqKMAqHf+M N1kFYS/vuqBFK97AcJ5mjw0BNnukkrJwGP067jvZxgoL5xs1Ues0Gs4WibVzmTtPTIU9 6odrfyan8aGGbUD7QlGwX3JrgRaiaqHAMJF88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=stZwvL1ArGETlzfrJflRMFANdUqtLPowVQpaSc/ePYJl/0hqRRrqIPl7Ff00Ve3VGl AtNuzH9cHOZBsXGBDRXcQS2KcozvC1FvqYeYWPvPs77zPvHuc7GlcZJtFj3diV8iJLUm kKztVlsZlwZvFgmXY2X6l9dfIONhO1KeN3jQ4= Received: by 10.224.2.80 with SMTP id 16mr2194462qai.269.1246640084388; Fri, 03 Jul 2009 09:54:44 -0700 (PDT) Received: from ?192.168.0.103? ([75.68.47.100]) by mx.google.com with ESMTPS id 4sm7903015qwe.38.2009.07.03.09.54.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 09:54:43 -0700 (PDT) Message-Id: <1F02C25E-6BED-4F80-80A8-0A79E14D92BA@gmail.com> From: Doug Currie To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Fri, 3 Jul 2009 12:54:41 -0400 References: X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 3, 2009, at 11:43 AM, Thomas Lauer wrote: > In fact, if someone else wants to take over in toto, that would be > fine > with me. It's not really a lot of work; it just pops up every now and > then, with a couple hours (at worst half a day, if there's a backlog > of > changes) to check everything in and prepare a new version. I an NOT volunteering. If anyone is motivated to further improve this already very nice contribution, a fine example for a much larger language (Common Lisp), implemented using LaTeX, can be found at http://clqr.berlios.de/download.php e From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 14:05:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63H5htI013607; Fri, 3 Jul 2009 14:05:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3473A19349; Fri, 3 Jul 2009 14:05:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout1.mclink.it (smtpout1.mclink.it [195.110.128.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 579A219341 for ; Fri, 3 Jul 2009 14:05:11 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout1.mclink.it (8.13.6/8.13.6) with ESMTP id n63H59kR064334 for ; Fri, 3 Jul 2009 19:05:09 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOPWTUrDbohc/2dsb2JhbADOIoQSBQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 03 Jul 2009 19:05:09 +0200 Received: from [192.168.127.128] (host119-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.119]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id n63H58ds002074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jul 2009 19:05:09 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A4E3A41.6060809@erix.it> Date: Fri, 03 Jul 2009 19:05:05 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: <4A4E3537.7090607@erix.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Lauer wrote: > Is that a general observation or are you volunteering? ;-) Definitely a general observation :-) I'm afraid I'm to busy volunteering to find/build a new job... but if nobody volunteers, I could take a look. > I agree that it's probably not too hard though with these > "hard-formatted" things the devil is where he usually is: in the detail. Of course. That's why I stopped at a general observation ;-) Enrico From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 14:07:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63H74sK013856; Fri, 3 Jul 2009 14:07:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3489519352; Fri, 3 Jul 2009 14:06:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78E3D1934E for ; Fri, 3 Jul 2009 14:06:37 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id n63H6Z7P033662 for ; Fri, 3 Jul 2009 19:06:36 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJPXTUrDbohb/2dsb2JhbADOJ4QSBQ Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 03 Jul 2009 19:06:34 +0200 Received: from [192.168.127.128] (host119-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.119]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n63H6WRA075647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jul 2009 19:06:35 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A4E3A95.7060002@erix.it> Date: Fri, 03 Jul 2009 19:06:29 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: <1F02C25E-6BED-4F80-80A8-0A79E14D92BA@gmail.com> In-Reply-To: <1F02C25E-6BED-4F80-80A8-0A79E14D92BA@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Doug Currie wrote: > I an NOT volunteering. If anyone is motivated to further improve this > already very nice contribution, a fine example for a much larger > language (Common Lisp), implemented using LaTeX, can be found at > http://clqr.berlios.de/download.php LaTeX would make lots of sense. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 14:09:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63H9rgM014457; Fri, 3 Jul 2009 14:09:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AEE819361; Fri, 3 Jul 2009 14:09:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E28E1935A for ; Fri, 3 Jul 2009 14:09:19 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id ECF8C2F74D4 for ; Fri, 3 Jul 2009 10:09:14 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KTxD-5f36UkA for ; Fri, 3 Jul 2009 10:09:13 -0700 (PDT) Received: from [192.168.122.101] (unknown [211.210.213.51]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 6C3A52F7496 for ; Fri, 3 Jul 2009 10:09:13 -0700 (PDT) Message-Id: <485B717C-405C-40D8-BA47-11BA28BC215B@grahamwakefield.net> From: Graham Wakefield To: Lua list In-Reply-To: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Inling C/Fortran in Lua Date: Sat, 4 Jul 2009 02:08:30 +0900 References: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Maybe related? I've been using LLVM to write and JIT compile performance critical code within a Lua script. Basically, along the lines of llvm-py [1], i.e. binding the most useful parts of the LLVM C++ API to Lua, and generating machine code by manipulating LLVM IR. The binding is a bit messy at the moment, but I'm hoping to clean it up and make it public sometime soon. It can also compile inlined C, using LLVM's Clang driver. Interfacing with Lua is basically by means of the Lua C API, in both cases. It's definitely fast, but the API is cumbersome... I'm toying with LPEG to write a kind of slimmed down C that talks more seamlessly with Lua, as a more usable alternative for JIT compiled inline code. Definitely some potential, but also some trickiness. [1] http://mdevan.nfshost.com/llvm-py/ On Jul 3, 2009, at 9:04 PM, steve donovan wrote: > Of course, luatcc does this already, but does not free you from having > to write the binding code, such as would be generated by tolua++. > > Inling performance-critical code can be an effective trick: > > http://on-ruby.blogspot.com/2006/07/rubyinline-making-making-things-faster.html > > Now the question is, is it worth pursuing this for Lua? tolua++ works > rather nicely, but you have to maintain a separate .c/.cpp file and > hand-roll the .pkg file (the cleaned header). So, for > proof-of-concept, I'd build on tolua++. After the first compile, a > quick dependency check means that the inlined code need not be > recompiled. One has to make sure that the .so/.dll is loadable from > the same location as the original Lua file, etc. > > I've been generally thinking about Lua and High-Performance Computing. > A library like this, plus MPI bindings, and one has a means to write > very effective parallelized programs in a nicer language than FORTRAN. > Actually, modern FORTRAN is a good companion to Lua in this context, > since it's cleaner and faster than C, especially for things like bulk > array operations and complex arithmetic. > > Any thoughts? > > steve d. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 14:26:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63HQmee018531; Fri, 3 Jul 2009 14:26:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C505E19339; Fri, 3 Jul 2009 14:26:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6FA5192AE for ; Fri, 3 Jul 2009 14:26:09 -0300 (BRT) Received: by fxm28 with SMTP id 28so2411529fxm.5 for ; Fri, 03 Jul 2009 10:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=IaodVQUY3CTJt8csbah9+92ugyTfZ7IeC96gVdSNjyc=; b=Z52Zha6TicOJmBZoV95AW6AAhZs1GErZBGN5ErMGGDOaqIKdqn+0NAh17Vn412z70G 8MY5VB9mzLuop0SB8E61NRyWcE0AQ5xTlCTUh2omewowZ9Jd1YbY1ituMpEKD2ut3x33 0mDCaAiYr4tq09aAR6f1c6V0IsSMWfzfsfJCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UBQup1gk81eXibNQJsiizlL3nuidTOCeK55SQ9mmgKOviWod8NpSPc2iru9DPgrtN2 2iyfVvXRBrcS/oMK+JQ2jOWmSpskbCgJ2O9UucONyVN/+I88GeFb76/FKKEeAESLbXa4 Wc5BKYgvirGJqxhBQ1Q4oHIa5sRPX19sSe+64= MIME-Version: 1.0 Received: by 10.239.131.17 with SMTP id 17mr124521hbl.66.1246641967544; Fri, 03 Jul 2009 10:26:07 -0700 (PDT) In-Reply-To: <485B717C-405C-40D8-BA47-11BA28BC215B@grahamwakefield.net> References: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> <485B717C-405C-40D8-BA47-11BA28BC215B@grahamwakefield.net> Date: Fri, 3 Jul 2009 19:26:07 +0200 Message-ID: <560972290907031026q453aa686x43cbddadc457c65e@mail.gmail.com> Subject: Re: Inling C/Fortran in Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 3, 2009 at 7:08 PM, Graham Wakefield wrote: > It's definitely fast, but the API is cumbersome... I'm toying with LPEG to > write a kind of slimmed down C that talks more seamlessly with Lua, as a > more usable alternative for JIT compiled inline code. Definitely some > potential, but also some trickiness. Oh yes, C/C++ is a bastard to parse (learned the hard way) I did not jump directly into implementation, precisely because Lua is getting faster with JIT, to the point where having inlined C (or Fortran) would be something that's only useful occaisionally, like inlined asm in C. And tolua++ really is clever. It remains true that most big high-performance number-crunching apps spend most of their cycles in 10% of the code - that's essentially the Knuth rule of thumb. The other 90% of the code is mostly bureaucracy, which is not Fortran's forte... (or C, for that matter) steve d. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 14:58:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63HwtRJ026639; Fri, 3 Jul 2009 14:58:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA9D1934A; Fri, 3 Jul 2009 14:58:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9560E19325 for ; Fri, 3 Jul 2009 14:58:21 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh03-2.mail.saunalahti.fi (Postfix) with SMTP id C8204EBE64 for ; Fri, 3 Jul 2009 20:58:16 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A0499AC4A0F; Fri, 03 Jul 2009 20:58:16 +0300 Received: from [192.168.1.5] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id AABD3E51A4 for ; Fri, 3 Jul 2009 20:58:13 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: XCode template for lua modules Date: Fri, 3 Jul 2009 20:58:13 +0300 References: X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The recommendation was that "bundle" is when dylibs are loaded software-wise (as in Lua) and "dylib" when they are loaded as part of the linkage. Not sure if this matters any more. I have the understanding it was more important at earlier stages of OS X. But I may be wrong. This has been discussed earlier, but I'm too lazy to find out the right one. Check here: http://lua-users.org/cgi-bin/namazu.cgi?query=os+x+bundle&sort=score&idxname=lua-l&max=20 -asko Hans van der Meer kirjoitti 3.7.2009 kello 18:17: > Working on a Macintosh under MacOSX I am trying to get the XCode > build settings in shape for compilation of a Lua C-module into > module.so; starting with the XCode-template for a BSD dynamic library. > > Having read the instructions for using make I have the following > question: > > Why does one prescribe for the Mach-O Type the choice > "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both > seem to work when the result is "require"-ed. Does it matter? Or is > there a fundamental difference I am overlooking? > > Hans van der Meer > > > > From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 20:43:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n63NhWEO030756; Fri, 3 Jul 2009 20:43:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1F51192CC; Fri, 3 Jul 2009 20:42:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id CF9D119276 for ; Fri, 3 Jul 2009 20:42:53 -0300 (BRT) Received: (qmail invoked by alias); 03 Jul 2009 23:42:51 -0000 Received: from p5B0124CE.dip0.t-ipconnect.de (EHLO dialup) [91.1.36.206] by mail.gmx.net (mp001) with SMTP; 04 Jul 2009 01:42:51 +0200 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX1/iOgwc1pXiXhJlvEEzbg6yT4PgsETeyDireb4L+L aX6XA8pzha9uWW Date: Sat, 4 Jul 2009 01:42:49 +0200 From: Edgar Toernig To: Lua list Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty Message-Id: <20090704014249.425d8998.froese@gmx.de> In-Reply-To: <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> References: <20090703024332.454b6ec8.froese@gmx.de> <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabio Mascarenhas wrote: > > I think mkstemp and symlink are supposed to > be atomic, so where is the race condition? The symlink is fine. The race is when the lock is broken: ///// while (symlink("foobar", lockfile) == -1) { if (errno == EEXIST) if (lstat(lockfile, &st) == 0) if (time(NULL) - st.st_mtime > expire) { unlink(lockfile) continue; } return ERROR } return SUCCESS; ///// Process A Process B T symlink -> EEXIST symlink -> EEXIST i lstat -> OK lstat -> OK m expired expired e unlink symlink -> OK return SUCCESS unlink symlink -> OK return SUCCESS Generally, breaking locks without appropriate rollback is seldom a good idea. The lock holder tried to perform some non-atomic changes (else it wouldn't need the lock) and for whatever reason didn't finish with that. Breaking the lock now just means: I don't care if the data is in an inconsistant state. So, why using a lock in the first place? *g* I was wrong about the busy loop, sorry. When I read the code, I thought the "while" loops until it gets the lock. The memory and fd leak happens when lua_newuserdata fails. Regarding that "strange algorithm": I have no idea what the mkstemp file is good for. Afaics, it has no function. Its name is used as the contents of the symlink and it is kept open until unlock. What for? > If the lock is taken lock_dir returns an error, how to wait until trying > again is up to the user. Well, here is a global problem with lfs: error reporting. You only get a random (system and locale dependant) error string. The caller has no chance to check what kind of error happened (i.e. why was the lock not taken? ENOENT? EACCESS? EEXIST?) and take appropriate action. Btw, errno is often read too late in lfs, intervening calls may have modified it. Ciao, ET. From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 21:45:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n640jodJ004920; Fri, 3 Jul 2009 21:45:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA225190D1; Fri, 3 Jul 2009 21:45:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83CF118C14 for ; Fri, 3 Jul 2009 21:45:13 -0300 (BRT) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1MMtNQ-00027m-Hl for lua@bazar2.conectiva.com.br; Fri, 03 Jul 2009 17:45:12 -0700 Subject: lpeg question From: Norbert Kiesel To: lua@bazar2.conectiva.com.br Content-Type: text/plain Date: Fri, 03 Jul 2009 17:45:05 -0700 Message-Id: <1246668306.32753.14.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I started to play around a bit with lpeg and found a (for me) suprising behavior: the following lua code lpeg=require"lpeg" require"re" print("lpeg version", lpeg.version()) x = {re.find('hello', [[ { 'h' . . } { . } { . } -> {} ]])} print(type(x), #x, x[1], x[2], x[3], x[4]) print(type(x[4]), #x[4], x[4][1]) prints lpeg version 0.8 table 4 1 hel l table: 0x6c7710 table 1 o I would have expected to get lpeg version 0.8 table 4 1 hel l o string 1 nil why is the last capture returned as a table? From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 21:54:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n640sXLc005896; Fri, 3 Jul 2009 21:54:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DF57192F9; Fri, 3 Jul 2009 21:54:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 071C4192D1 for ; Fri, 3 Jul 2009 21:54:09 -0300 (BRT) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1MMtW4-000283-1n for lua@bazar2.conectiva.com.br; Fri, 03 Jul 2009 17:54:08 -0700 Subject: Re: lpeg question From: Norbert Kiesel To: Lua list In-Reply-To: <1246668306.32753.14.camel@defiant.tbdnetworks.com> References: <1246668306.32753.14.camel@defiant.tbdnetworks.com> Content-Type: text/plain Date: Fri, 03 Jul 2009 17:54:07 -0700 Message-Id: <1246668847.32753.20.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean added ".*" at the end of the pattern. I'd assume that would not change anything, but it does: lpeg=require"lpeg" require"re" print("lpeg version", lpeg.version()) x = {re.find('hello', [[ { 'h' . . } { . } { . } .* -> {} ]])} print(type(x), #x, x[1], x[2], x[3], x[4], x[5]) print(type(x[4]), #x[4], x[4][1]) print(type(x[5]), #x[5], x[5][1]) prints lpeg version 0.8 table 5 1 hel l o table: 0xa854e0 string 1 nil table 0 nil So now I get the 3rd capture in x[4] as expected, but still an additional (empty) table as the last element From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 22:19:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n641Iw0J008209; Fri, 3 Jul 2009 22:18:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4970919328; Fri, 3 Jul 2009 22:18:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A72F11930E for ; Fri, 3 Jul 2009 22:18:24 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so1092608qwi.11 for ; Fri, 03 Jul 2009 18:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=w6v3X39rVxw2p6b3QC2LQzNWxSHHmpx7jGsPK1o5wck=; b=hj/Sobf77o8NJnYI+8IY+eZBTM1SbKASRPnYfbAU+cyPBMTtSVdcz8C7cw+U0UJ8xy 7aG+4SitnxVzSY5v8avaxZWFKmjK0jV1kQEKof9IDrvzJaUUzdZ4trJXDSzO06Be7Wff xBTpcFAlfs7M18qkPxk6g4chHfWEZl8C63kJU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=pphDeciHGXx8FMXBEqmNyFgo8QWSleWs9jRca9+9z9jmW9BQRiJvh9t30tNhdA+FgD IavH+GARhU4LEA/ADeIjvn0Ye+A986St+O+O1K/Xt6cioimuSWwzyu/2cHDiOWwZFXIM d3rW5Tc6e0enAT1HzKnLx1oUhWIYS16tNcQlc= Received: by 10.224.67.129 with SMTP id r1mr2667830qai.234.1246670303496; Fri, 03 Jul 2009 18:18:23 -0700 (PDT) Received: from ?192.168.0.103? ([75.68.47.100]) by mx.google.com with ESMTPS id 26sm8670442qwa.37.2009.07.03.18.18.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 18:18:22 -0700 (PDT) Message-Id: <13156289-BF80-4B93-900E-5EE99B7725BD@gmail.com> From: Doug Currie To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: XCode template for lua modules Date: Fri, 3 Jul 2009 21:18:20 -0400 References: X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 3, 2009, at 11:17 AM, Hans van der Meer wrote: > Why does one prescribe for the Mach-O Type the choice > "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both > seem to work when the result is "require"-ed. Does it matter? Or is > there a fundamental difference I am overlooking? As Asko said, bundle was preferred in very early os x versions. If your Lua is built to use dlopen it can use bundles or dynamic libraries. Lua uses dlopen when built using -DLUA_USE_LINUX or -DLUA_USE_POSIX -DLUA_USE_DLOPEN but not when built using -DLUA_USE_MACOSX or -DLUA_USE_POSIX -DLUA_DL_DYLD Note that if you make the macosx Lua Makefile target you get - DLUA_USE_LINUX and therefore dlopen. Based on the example of other libraries (thanks, Mike Pall), and my reading of http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/000-Introduction/Introduction.html#/ /apple_ref/doc/uid/TP40001908 my Makefiles use: gcc -fPIC -dynamiclib -single_module -undefined dynamic_lookup -o xxx.so xxx.o yyy.o The -single_module option is considered obsolete and is the default since OS X 10.4.0. http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ld.1.html e From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 22:46:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n641jxnE010944; Fri, 3 Jul 2009 22:45:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AD6619337; Fri, 3 Jul 2009 22:45:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f215.google.com (mail-gx0-f215.google.com [209.85.217.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C38D0192BF for ; Fri, 3 Jul 2009 22:45:16 -0300 (BRT) Received: by gxk11 with SMTP id 11so3783887gxk.5 for ; Fri, 03 Jul 2009 18:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=bPZBww35UH5TmLBKl9ILJenmT93+ZiCG84VUhjsA5rg=; b=HfVdrto0t9yoxiBtLTZ9Jpqm8fmzHJv5bhDDhRUSG5VrDu+ghdhJv1OSOoisd2pp9n cAJB15ghyayAwFrZ+8isuUXJBOCTmdY5NQM1mxs8bN14mxzBz1LfRMCOFjJqpMUx7OVi WyEH1QLCP3cruIhxrw1Adm1mKHZAJLIbDIeS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Pml48xz13c7QyMC83Wu2F4r0Cfe+J2WvjkZeQDxepIR2XIgvAta+fsw7inavtr/bwh goIxcWIVan6yGCODls+gWhizPCDIAzsOtcixUfwtnqL75HOUFhKkoJkjUuEysbPVAQAO 0jpdVrZznLQenMpSwBGRkC+Ro4DwSm4UGqueg= MIME-Version: 1.0 Received: by 10.100.211.3 with SMTP id j3mr3359261ang.19.1246671915026; Fri, 03 Jul 2009 18:45:15 -0700 (PDT) In-Reply-To: <20090704014249.425d8998.froese@gmx.de> References: <20090703024332.454b6ec8.froese@gmx.de> <7913df4d0907022020m9de96c0i3e2fc3e20053f3a7@mail.gmail.com> <20090704014249.425d8998.froese@gmx.de> Date: Fri, 3 Jul 2009 22:45:14 -0300 X-Google-Sender-Auth: 7e8fbfa9c287abb0 Message-ID: <7913df4d0907031845r1b77aef6w903c227bb2a87bd7@mail.gmail.com> Subject: Re: lfs (CVS version) compilation error under Ununtu-9.04 Jaunty From: Fabio Mascarenhas To: Lua list Content-Type: multipart/alternative; boundary=00163662e657a58d7c046dd76ca7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163662e657a58d7c046dd76ca7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Jul 3, 2009 at 8:42 PM, Edgar Toernig wrote: > Fabio Mascarenhas wrote: > > > > I think mkstemp and symlink are supposed to > > be atomic, so where is the race condition? > > The symlink is fine. The race is when the lock is broken: > > ///// > while (symlink("foobar", lockfile) == -1) { > if (errno == EEXIST) > if (lstat(lockfile, &st) == 0) > if (time(NULL) - st.st_mtime > expire) { > unlink(lockfile) > continue; > } > return ERROR > } > return SUCCESS; > ///// > > Process A Process B > > T symlink -> EEXIST symlink -> EEXIST > i lstat -> OK lstat -> OK > m expired expired > e unlink > symlink -> OK > return SUCCESS > unlink > symlink -> OK > return SUCCESS > I stand corrected, and do not know how I missed this; as a weak defense I notice that the NetBSD implementation of shlock that I linked in the previous message has the same race condition... I guess I have been spoiled by lock-free threading models. :-) > > Generally, breaking locks without appropriate rollback is > seldom a good idea. The lock holder tried to perform some > non-atomic changes (else it wouldn't need the lock) and > for whatever reason didn't finish with that. Breaking the > lock now just means: I don't care if the data is in an > inconsistant state. So, why using a lock in the first > place? *g* > Yes, the only way a lock can be orphaned forever is if there is a segfault before releasing it, as the lock's finalizer also releases it. I will remove the staleness check (and the race condition that goes with it) while I think this over. > I was wrong about the busy loop, sorry. When I read the code, > I thought the "while" loops until it gets the lock. > > The memory and fd leak happens when lua_newuserdata fails. > I will move the lua_newuserdata call to the beginning of the function, thanks. I am so used to not checking the return value of lua_newuserdata, as it raises a Lua error in case it has problems, that I forget that you should allocate the userdata for the source *before* acquiring it... > > Regarding that "strange algorithm": I have no idea what the > mkstemp file is good for. Afaics, it has no function. > Its name is used as the contents of the symlink and it is > kept open until unlock. What for? > I thought symlink cared about where you are linking from (as link), but I now see in the POSIX documentation (buried the NOTES section, sigh) that it can be anything. > > > If the lock is taken lock_dir returns an error, how to wait until trying > > again is up to the user. > > Well, here is a global problem with lfs: error reporting. > You only get a random (system and locale dependant) error > string. The caller has no chance to check what kind of > error happened (i.e. why was the lock not taken? ENOENT? > EACCESS? EEXIST?) and take appropriate action. > Yeah, lfs error reporting needs an overhaul, it should at least return the errno of what caused the error, too... but this problem is not restricted to lfs, Lua functions that raise errors should move away from just error messages to more structured error objects. On the flip side, overhauling the error reporting will probably break a lot of clients. :-) > > Btw, errno is often read too late in lfs, intervening calls > may have modified it. > > Ciao, ET. > Many thanks for the feedback! -- Fabio Mascarenhas --00163662e657a58d7c046dd76ca7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Jul 3, 2009 at 8:42 PM, Edgar Toernig <froese@gmx.de> wrote:
Fabio Mascarenhas wrote:
>
> I think mkstemp and symlink are supposed to
> be atomic, so where is the race condition?

The symlink is fine. =C2=A0The race is when the lock is broken:

=C2=A0 =C2=A0 =C2=A0 =C2=A0/////
=C2=A0 =C2=A0 =C2=A0 =C2=A0while (symlink("foobar", lockfile) = =3D=3D -1) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (errno =3D=3D EE= XIST)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (lstat(lo= ckfile, &st) =3D=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (t= ime(NULL) - st.st_mtime > expire) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0unlink(lockfile)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0continue;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ERROR
=C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0return SUCCESS;
=C2=A0 =C2=A0 =C2=A0 =C2=A0/////

=C2=A0 =C2=A0 =C2=A0 =C2=A0Process A =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Process B

=C2=A0T =C2=A0 =C2=A0 symlink -> EEXIST =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 symlink -> EEXIST
=C2=A0i =C2=A0 =C2=A0 lstat -> OK =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lstat -> OK
=C2=A0m =C2=A0 =C2=A0 expired =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expired
=C2=A0e =C2=A0 =C2=A0 unlink
=C2=A0 =C2=A0 =C2=A0 =C2=A0symlink -> OK
=C2=A0 =C2=A0 =C2=A0 =C2=A0return SUCCESS
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unlink =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0symlink -= > OK
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return SU= CCESS

I stand corrected, and do not know how I m= issed this; as a weak defense I notice that the NetBSD implementation of sh= lock that I linked in the previous message has the same race condition... I= guess I have been spoiled by lock-free threading models. :-)
=C2=A0

Generally, breaking locks without appropriate rollback is
seldom a good idea. =C2=A0The lock holder tried to perform some
non-atomic changes (else it wouldn't need the lock) and
for whatever reason didn't finish with that. =C2=A0Breaking the
lock now just means: I don't care if the data is in an
inconsistant state. =C2=A0So, why using a lock in the first
place? *g*

Yes, the only way a lock can be orphaned f= orever is if there is a segfault before releasing it, as the lock's fin= alizer also releases it. I will remove the staleness check (and the race co= ndition that goes with it) while I think this over.=C2=A0


I was wrong about the busy loop, sorry. =C2=A0When I read the code,
I thought the "while" loops until it gets the lock.

The memory and fd leak happens when lua_newuserdata fails.

I will move the lua_newuserdata call to th= e beginning of the function, thanks. I am so used to not checking the retur= n value of lua_newuserdata, as it raises a Lua error in case it has problem= s, that I forget that you should allocate the userdata for the source *befo= re* acquiring it...
=C2=A0

Regarding that "strange algorithm": I have no idea what the
mkstemp file is good for. =C2=A0Afaics, it has no function.
Its name is used as the contents of the symlink and it is
kept open until unlock. =C2=A0What for?

I thought symlink = cared about where you are linking from (as link), but I now see in the POSI= X documentation (buried the NOTES section, sigh) that it can be anything.= =C2=A0
=C2=A0

> If the lock is taken lock_dir returns an error, how to wait until tryi= ng
> again is up to the user.

Well, here is a global problem with lfs: error reporting.
You only get a random (system and locale dependant) error
string. =C2=A0The caller has no chance to check what kind of
error happened (i.e. why was the lock not taken? ENOENT?
EACCESS? EEXIST?) and take appropriate action.

Yeah, lfs=C2=A0error=C2=A0reporting=C2=A0n= eeds=C2=A0an=C2=A0overhaul,=C2=A0it=C2=A0should=C2=A0at=C2=A0least=C2=A0ret= urn=C2=A0the=C2=A0errno=C2=A0of=C2=A0what=C2=A0caused=C2=A0the=C2=A0error,= =C2=A0too... but this problem is not restricted to lfs, Lua functions that = raise errors should move away from just error messages to more structured e= rror objects.

On the flip side, overhauling the error reporting will = probably break a lot of clients. :-)
=C2=A0

Btw, errno is often read too late in lfs, intervening calls
may have modified it.

Ciao, ET.

Many thanks for the feedback!
<= br>
--
Fabio Mascarenhas

--00163662e657a58d7c046dd76ca7-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 3 22:52:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n641qOLs011729; Fri, 3 Jul 2009 22:52:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 829E319352; Fri, 3 Jul 2009 22:51:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f188.google.com (mail-yx0-f188.google.com [209.85.210.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C72519342 for ; Fri, 3 Jul 2009 22:51:50 -0300 (BRT) Received: by yxe26 with SMTP id 26so3850992yxe.33 for ; Fri, 03 Jul 2009 18:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=18HolJJGDI0k8jeMOnedJ2Jauf4utZyZwt3zeVgbbo4=; b=a1SPOfull1I9/+U7Ma0YnTy6x7oHxN1fY87T9b0NKgzDxn2Elp3mRr/thKbZ1YfaZA dF1PhY0Tkxd99gypAyUkjP5gENS84QdbjepVnMiJFOpemJngsSJ170FCQUVbrW55f6sY +bM4H3gPiJZDV086tz4ptL0SoPrc3yPYkl4tU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=bNL8B3b0a9suz1qcViaB4QC1SRHH9d/vXrBMMKj5wWcJVbBRu7tiwVb9a2mUB/LLfs 90jhssK2r3wE31PXxgCCD+Hr/YAMLGD4uDkNbUHld5Rzv3ss3ou6xYZOIF0g3fBdczzc C2ISUJS+PAJDbE1LJfA2rmYA7H//3E6vf4rUc= MIME-Version: 1.0 Received: by 10.100.38.5 with SMTP id l5mr3117387anl.183.1246672308099; Fri, 03 Jul 2009 18:51:48 -0700 (PDT) In-Reply-To: <1246668306.32753.14.camel@defiant.tbdnetworks.com> References: <1246668306.32753.14.camel@defiant.tbdnetworks.com> Date: Fri, 3 Jul 2009 22:51:48 -0300 X-Google-Sender-Auth: 88290dba6f0332a9 Message-ID: <7913df4d0907031851u70123ef1o7233e92a2abe5e96@mail.gmail.com> Subject: Re: lpeg question From: Fabio Mascarenhas To: Lua list Content-Type: multipart/alternative; boundary=001485f8721c135f6c046dd78411 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f8721c135f6c046dd78411 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit "-> {}" is a table capture that is consuming your last capture (the 'o' in the first example, an empty capture in the second) and producing a table. Remove it and you will get the result you want. -- Fabio Mascarenhas On Fri, Jul 3, 2009 at 9:45 PM, Norbert Kiesel wrote: > Hi, > > I started to play around a bit with lpeg and found a (for me) suprising > behavior: the following lua code > > lpeg=require"lpeg" > require"re" > print("lpeg version", lpeg.version()) > x = {re.find('hello', [[ { 'h' . . } { . } { . } -> {} ]])} > print(type(x), #x, x[1], x[2], x[3], x[4]) > print(type(x[4]), #x[4], x[4][1]) > > prints > > lpeg version 0.8 > table 4 1 hel l table: 0x6c7710 > table 1 o > > I would have expected to get > > lpeg version 0.8 > table 4 1 hel l o > string 1 nil > > why is the last capture returned as a table? > > > > > --001485f8721c135f6c046dd78411 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
"-> {}" is a table capture that is consuming your last ca= pture (the 'o' in the first example, an empty capture in the second= ) and producing a table. Remove it and you will get the result you want.
--
Fabio Mascarenhas


On Fri, Jul 3, 2009 at 9:45 PM, Norbert = Kiesel <nki= esel@tbdnetworks.com> wrote:
Hi,

I started to play around a bit with lpeg and found a (for me) suprising
behavior: the following lua code

lpeg=3Drequire"lpeg"
require"re"
print("lpeg version", lpeg.version())
x =3D {re.find('hello', [[ { 'h' . . } { . } { . } =C2=A0-&= gt; {} ]])}
print(type(x), #x, x[1], x[2], x[3], x[4])
print(type(x[4]), #x[4], x[4][1])

prints

lpeg version =C2=A0 =C2=A00.8
table =C2=A0 4 =C2=A0 =C2=A0 =C2=A0 1 =C2=A0 =C2=A0 =C2=A0 hel =C2=A0 =C2= =A0 l =C2=A0 =C2=A0 =C2=A0 table: 0x6c7710
table =C2=A0 1 =C2=A0 =C2=A0 =C2=A0 o

I would have expected to get

lpeg version =C2=A0 =C2=A00.8
table =C2=A0 4 =C2=A0 =C2=A0 =C2=A0 1 =C2=A0 =C2=A0 =C2=A0 hel =C2=A0 =C2= =A0 l =C2=A0 =C2=A0 =C2=A0 o
string =C2=A01 =C2=A0 =C2=A0 =C2=A0 nil

why is the last capture returned as a table?

</nk>



--001485f8721c135f6c046dd78411-- From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 00:37:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n643bFfb024192; Sat, 4 Jul 2009 00:37:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B22CE19355; Sat, 4 Jul 2009 00:36:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 229D31932B for ; Sat, 4 Jul 2009 00:36:42 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so842163rvb.41 for ; Fri, 03 Jul 2009 20:36:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.192.18 with SMTP id p18mr519586rvf.95.1246678601344; Fri, 03 Jul 2009 20:36:41 -0700 (PDT) Date: Fri, 3 Jul 2009 23:36:41 -0400 Message-ID: Subject: possible bug in lua.c main report lua_tostring malloc From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In Lua 5.1.4, in lua.h:main, the call to "report" invokes lua_tostring, which according to the Lua Reference Manual may raise a memory error, presumably in the condition where the error value is a number that must be translated into a string and therefore allocate memory for the string. In this context, the call to lua_tostring is unprotected. I was able to cause "lua -e 'error(5)'" to crash by triggering an allocation failure in lmem.c: --- src/lmem.c~ +++ src/lmem.c @@ -74,9 +74,11 @@ ** generic allocation routine. */ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { + static int count = 0; global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); block = (*g->frealloc)(g->ud, block, osize, nsize); + if (nsize > osize && ++count > 450) luaD_throw(L, LUA_ERRMEM); if (block == NULL && nsize > 0) luaD_throw(L, LUA_ERRMEM); lua_assert((nsize == 0) == (block == NULL)); BTW, the following type of code is probably fairly common for users to include at the top level C stack: if (lua_cpcall(L, f, NULL) != 0) { fprintf(stderr, "%s\n", lua_tostring(L, -1) ? lua_tostring(L, -1) : "(not a string)"); } The hidden bug is that lua_tostring needs to be protected itself or simply checked against lua_type(L, -1) == LUA_TSTRING, which presumably cannot raise a memory error. Ideally, we want to handle the __tostring metamethod properly here too. The correct solution to that, accounting to errors as well, is not obvious. From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 02:13:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n645DM2u000456; Sat, 4 Jul 2009 02:13:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD2B718ED1; Sat, 4 Jul 2009 02:12:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19B4F18E58 for ; Sat, 4 Jul 2009 02:12:49 -0300 (BRT) Received: by ewy26 with SMTP id 26so3209237ewy.5 for ; Fri, 03 Jul 2009 22:12:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.54.9 with SMTP id c9mr2122298eba.35.1246684367757; Fri, 03 Jul 2009 22:12:47 -0700 (PDT) In-Reply-To: References: Date: Sat, 4 Jul 2009 01:12:47 -0400 Message-ID: Subject: Re: possible bug in lua.c main report lua_tostring malloc From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 3, 2009 at 11:36 PM, David Manura wrote: > I was able to cause "lua -e 'error(5)'" to crash by triggering an > allocation failure in lmem.c: That modification to lmem.c was likely not valid (returns alloc failure after successfully allocating); I should have made the change instead to lauxlib.c:l_alloc. The code may be fragile here, but I do not currently have a valid crash in practice. From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 04:31:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n647Vp6T014661; Sat, 4 Jul 2009 04:31:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18A8019358; Sat, 4 Jul 2009 04:31:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f202.google.com (mail-vw0-f202.google.com [209.85.212.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34F8718B39 for ; Sat, 4 Jul 2009 04:31:12 -0300 (BRT) Received: by vwj40 with SMTP id 40so1853488vwj.33 for ; Sat, 04 Jul 2009 00:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=S+6K4c/gKB1nWPs7acXUMUV/0wUYMFoFPIWCTlQUdgo=; b=outHybR80qfBCb8ui8cgeuVqgKnShQ6N20cY4ocVFfgS7gAXHHGhGtcH3EsgHMWWHx vDWbrGgIkYd1G2ycUYtWFk3lOi0jHeWXU07h5r7hpewErFjGu6kMfODyuM2F+lQ5SYNY v8Feham4mSDHUfK11KjPiRlvU4iowEw4qvg/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=QeJPbFcPIuZfVJgC6oHm8tHiCku8tNczpAj4JUA/iKxhu/37U7YXXBp9zdWi550R3o EmVJdZoVJ1oSck9jTq0ZScTJonH92eBlYWObsUji8PYxqi65dL449B46jru9p3w+j72C yvwJj+dCa4uAFdo2H4VLmX0w+aETB2AYbXbkU= MIME-Version: 1.0 Received: by 10.220.93.65 with SMTP id u1mr4544772vcm.59.1246692670783; Sat, 04 Jul 2009 00:31:10 -0700 (PDT) Date: Sat, 4 Jul 2009 09:31:10 +0200 Message-ID: <3e4778d50907040031n9b31694v891246183c93d176@mail.gmail.com> Subject: strange behaviour with luaL_checkinteger() From: matthias To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I wrote my own Lua-crc function and got some weired results. For proofing correctness I also implemented a c-program. But when the c-program returned a negative value (with %d) I got a different value from the Lua-library. My algorithm is quite similar to the one from lash-lua: http://code.google.com/p/lash-lua/source/browse/trunk/crc32.c?spec=svn5&r=5#112 Although I got the data with the luaL_checkinteger()-function. Seems that there lies the problem, but I don't get what I've done wrong. Inside Lua every number is a floating-point. So when I call my library function from a Lua-script I pass the value converting it to a number. Therefore a floatingpoint number should be on the stack and I "cast " it into my c- integer variable with the check integer-function. But representation of integer-values shouldn't be a problem (http://lua-users.org/wiki/FloatingPoint). In the c-program I pass the value via atoi()-function call from argv[] which shouldn't be a problem, too. Can anyone give me a hint, what I am missing. Thanks Matthias -- motzblog.wordpress.com From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 05:56:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n648ujms021827; Sat, 4 Jul 2009 05:56:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8CBB190F9; Sat, 4 Jul 2009 05:56:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE46618ADE for ; Sat, 4 Jul 2009 05:56:05 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 2948A3A40AD for ; Sat, 4 Jul 2009 04:56:02 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 04 Jul 2009 04:56:02 -0400 X-Sasl-enc: ZfnXeLglXNhG+tj5C4wQdLkIfTlCPOQUAtcurAgQbdIi 1246697761 Received: from [10.1.1.3] (222-152-72-105.jetstream.xtra.co.nz [222.152.72.105]) by mail.messagingengine.com (Postfix) with ESMTPSA id 427B7BBE4 for ; Sat, 4 Jul 2009 04:56:00 -0400 (EDT) Message-Id: From: Geoff Leyland To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: XCode template for lua modules Date: Sat, 4 Jul 2009 10:30:50 +1200 References: X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 4/07/2009, at 3:17 AM, Hans van der Meer wrote: > Working on a Macintosh under MacOSX I am trying to get the XCode > build settings in shape for compilation of a Lua C-module into > module.so; starting with the XCode-template for a BSD dynamic library. > > Having read the instructions for using make I have the following > question: > > Why does one prescribe for the Mach-O Type the choice > "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both > seem to work when the result is "require"-ed. Does it matter? Or is > there a fundamental difference I am overlooking? I've got an XCode template for a lua plugin that you could use if you want. It's not much, but it took me a while to work out how to make a template, so it might save you some time. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 07:04:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64A4aUP027700; Sat, 4 Jul 2009 07:04:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABEDE19357; Sat, 4 Jul 2009 07:03:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from postduif.ic.uva.nl (postduif.ic.uva.nl [145.18.40.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FAC4190F9 for ; Sat, 4 Jul 2009 07:03:42 -0300 (BRT) Received: from [192.168.178.21] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by postduif.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n64A3YMY003540 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Sat, 4 Jul 2009 12:03:38 +0200 Message-Id: <068DB1E9-A9C7-4CD3-864C-FBDC8FA9A5D9@uva.nl> From: Hans van der Meer To: Lua list In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-1--40841701 Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: XCode template for lua modules Date: Sat, 4 Jul 2009 12:03:34 +0200 References: X-Mailer: Apple Mail (2.935.3) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.180 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1--40841701 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Thanks for the offer. I have already done some work on the Xcode (most recent version) build settings. I put them below. If you differ in opinion on some of these settings, I will be glad to hear. The thing I would like to happen is, having the Lua (test) script being executed in the console window instead of in the build window. The "Build and Go" button is grayed out, presumably because the template is for a library, which inherently is not an executable in the direct sense. Hans van der Meer Template for compiling Lua C-modules in XCode Start with the template BSD Dynamic Library. Set Mach-O Type to 1. bundle (mh_bundle) this requires emptying of the following two shell variables: Compatibility Version Current Library Version 2. dynamic library (mh_dylib) Set Other Linker Flags to: -undefined dynamic_lookup Set Executable Extension to: so I did not succeed in emptying the Executable Prefix (default = lib) Set Header Serach Path to /usr/local/include/** (** from recursive) Placing the product in the main project directory requires adddition of a new setting: TARGET_BUID_DIR ${PROJECT_DIR} For debugging set Preprocessor Macros Not Used in Precompiler to: TRACE Addtional changes: 1. compiling c only 2. language dialect ANSI-C Add a final shell script phase containing: mv lib.so .so /usr/local/bin/lua testfile On 4 jul 2009, at 00:30, Geoff Leyland wrote: > On 4/07/2009, at 3:17 AM, Hans van der Meer wrote: > >> Working on a Macintosh under MacOSX I am trying to get the XCode >> build settings in shape for compilation of a Lua C-module into >> module.so; starting with the XCode-template for a BSD dynamic >> library. >> >> Having read the instructions for using make I have the following >> question: >> >> Why does one prescribe for the Mach-O Type the choice >> "bundle" (mh_bundle) instead of "dynamic library" (mh_dylib). Both >> seem to work when the result is "require"-ed. Does it matter? Or is >> there a fundamental difference I am overlooking? > > I've got an XCode template for a lua plugin that you could use if > you want. It's not much, but it took me a while to work out how to > make a template, so it might save you some time. > > Cheers, > Geoff > --Apple-Mail-1--40841701 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Thanks for the offer. I have = already done some work on the Xcode (most recent version) build = settings. I put them below. If you differ in opinion on some of these = settings, I will be glad to hear.
The thing I would like to happen = is, having the Lua (test) script being executed in the console window = instead of in the build window. The "Build and Go" button is grayed out, = presumably because the template is for a library, which inherently is = not an executable in the direct sense.

Hans van der = Meer


Start with the template BSD = Dynamic Library.

1. bundle (mh_bundle)
= this requires emptying of the following two shell = variables:
Compatibility = Version
Current Library = Version
2. dynamic library (mh_dylib)

Set Other Linker Flags to: = -undefined dynamic_lookup

I did not succeed in emptying the = Executable Prefix (default =3D lib)


TARGET_BUID_DIR = ${PROJECT_DIR}


1. compiling c only
2. = language dialect ANSI-C



= mv lib<product>.so <product>.so
= /usr/local/bin/lua testfile


=

On 4 jul 2009, at 00:30, Geoff Leyland = wrote:

On 4/07/2009, at 3:17 AM, Hans van der Meer = wrote:

Working on a Macintosh under = MacOSX I am trying to get the XCode build settings in shape for = compilation of a Lua C-module into module.so; starting with the = XCode-template for a BSD dynamic library.

Having read the = instructions for using make I have the following = question:

Why does one = prescribe for the Mach-O Type the choice "bundle" (mh_bundle) instead of = "dynamic library" (mh_dylib). Both seem to work when the result is = "require"-ed. Does it matter? Or is there a fundamental difference I am = overlooking?

I've got an XCode template for a lua = plugin that you could use if you want.  It's not much, but it took = me a while to work out how to make a template, so it might save you some = time.

Cheers,
Geoff


= --Apple-Mail-1--40841701-- From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 08:34:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64BYrKc004748; Sat, 4 Jul 2009 08:34:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5A9619375; Sat, 4 Jul 2009 08:34:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08CE219366 for ; Sat, 4 Jul 2009 08:34:19 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64BYHji004711 for ; Sat, 4 Jul 2009 08:34:18 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n64BYGI02630; Sat, 4 Jul 2009 08:34:16 -0300 Date: Sat, 4 Jul 2009 08:34:16 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: A crash bug in v5.1.4 Message-ID: <20090704083416.A2625@lua.tecgraf.puc-rio.br> References: <560972290906270028u8d6a0b9l9cdc63d2e31e5789@mail.gmail.com> <20090627084909.017DDCF4.lostgallifreyan@googlemail.com> <20090628131952.GA11012@mike.de> <20090629180318.GA6727@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from slonik.az@gmail.com on Thu, Jul 02, 2009 at 01:17:45PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > As of today official Lua bug's list at http://www.lua.org/bugs.html > still does not list this bug/patch. The bugs page has been updated. From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 11:37:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64EbSUl022395; Sat, 4 Jul 2009 11:37:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E593118FF3; Sat, 4 Jul 2009 11:36:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f193.google.com (mail-pz0-f193.google.com [209.85.222.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5315C18994 for ; Sat, 4 Jul 2009 11:36:51 -0300 (BRT) Received: by pzk31 with SMTP id 31so1375535pzk.33 for ; Sat, 04 Jul 2009 07:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=7MD0lJe8fQH8mmWvvTtay/nEmnXEoHcaJ+DqwDhsvV0=; b=i5+2SLqZcO0Q1C/FQBEhmSaI/rdDnKAmKnjCyIP6frf9j60K4ct4uJ2FwFAcWpwsxL WBKNv0alaqGh0AphAwsSy8XE9oFaTOj8tujobkV8l26BQLrNOf1uiOYjmK0xHW/DVspg GrMeg89ABn57xXroNoAsrc85s12XaWX5hImGA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=CF/o5evh5H1w+rOkF9BDoZLjehhFEfeozqrAyF6nrII4/ZFYQt5gspCGaJHiOy/wE3 Ahaqjw38pcj1+IbTTHP2HcGvgA80XlIovPahz9vkba8Km13LDVPCFuecujX1MxrQh8Z7 JIcrW2aV8dl3L9tTUHuGV28cyJNbzw/znFkm4= Received: by 10.142.88.3 with SMTP id l3mr791845wfb.5.1246718209087; Sat, 04 Jul 2009 07:36:49 -0700 (PDT) Received: from ?115.135.22.128? ([115.135.22.128]) by mx.google.com with ESMTPS id 30sm14534265wfa.15.2009.07.04.07.36.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 04 Jul 2009 07:36:48 -0700 (PDT) Message-ID: <4A4F68F4.5020305@gmail.com> Date: Sat, 04 Jul 2009 22:36:36 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: strange behaviour with luaL_checkinteger() References: <3e4778d50907040031n9b31694v891246183c93d176@mail.gmail.com> In-Reply-To: <3e4778d50907040031n9b31694v891246183c93d176@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean matthias wrote: > I wrote my own Lua-crc function and got some weired results. For > proofing correctness I also implemented a c-program. > But when the c-program returned a negative value (with %d) I got a > different value from the Lua-library. There is no such thing as a negative number in a CRC calculation. If you got a negative number displayed, it's in the wrong representation. If you have got sample code and test cases to show us, perhaps someone on the list can point out the specifics. > My algorithm is quite similar to the one from lash-lua: > http://code.google.com/p/lash-lua/source/browse/trunk/crc32.c?spec=svn5&r=5#112 [snip snip] -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 11:42:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64EglBE023168; Sat, 4 Jul 2009 11:42:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B21F819068; Sat, 4 Jul 2009 11:42:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0184.hostedemail.com [64.99.136.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC1C118CE6 for ; Sat, 4 Jul 2009 11:42:19 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay08.hostedemail.com (Postfix) with SMTP id 5A5421AC29B for ; Sat, 4 Jul 2009 14:42:17 +0000 (UTC) X-Spam-Summary: 50, 0, 0, 91abe87978ea5930, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:945:946:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1431:1437:1487:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1766:1792:2194:2199:2393:2525:2560:2563:2682:2685:2693:2741:2857:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3318:3354:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:5007:6119:6261:7679:7875:7903:8829:8957:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 2935 Received: from taboche (unknown [89.241.151.38]) (Authenticated sender: thomas.lauer) by omf10.hostedemail.com (Postfix) with ESMTP for ; Sat, 4 Jul 2009 14:42:16 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Sat, 04 Jul 2009 15:42:17 +0100 Organization: TL Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n64EglBE023168 "A.S. Bradbury" wrote: > 2009/7/3 Thomas Lauer : > > "A.S. Bradbury" wrote: > >> 2009/7/2 Thomas Lauer : > >> > The Lua short reference provides a concise summary of the Lua syntax and > >> > core libraries. I have just updated and uploaded another draft of the > >> > 5.1 version. This can be downloaded from either the lua-users.org wiki: > >> > >> Might you consider releasing whatever source files you use to create > >> this quick reference? That way people can customise it to their needs. > > > > Absolutely. I have already sent the source files to a few people with > > special requirements. > > > > A problem with general release might be the fact that the source is a > > set of MS Word .doc files with some hairy formatting. I have always > > wanted to "port" this to OpenOffice, but I've never found the time to do > > so. Any volunteers? > > I would suggest just putting the source files you have online despite > the fact MS Word isn't an ideal format - that way anybody with a > remote interest in seeing how difficult it would be to 'port' it to > something else can try to do so with minimum fuss. In principle that's a sound idea and in an ideal world it would work as you envisage. I am afraid in practice it's not always so easy. As I am the one who's actually releasing the files (even if I'd do so with an explicit as-is disclaimer), people with problems (there are always people with problems) will naturally turn to me with more or less polite requests for help. Trying to be not too undiplomatic, let's just say Been There, Done That. I'd probably ignore most such requests but it's still a less than ideal situation. Anyway. Enrico: would you -- as the original author of the short reference -- mind making the MS WORD .doc files generally available? -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 12:00:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64F0sJw024944; Sat, 4 Jul 2009 12:00:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23A7A191EF; Sat, 4 Jul 2009 12:00:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E11A4190FC for ; Sat, 4 Jul 2009 12:00:24 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id n64F0NCF010060 for ; Sat, 4 Jul 2009 17:00:23 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEABMLT0rDbohc/2dsb2JhbADKW4QSBQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 04 Jul 2009 17:00:22 +0200 Received: from [192.168.127.128] (host119-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.119]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id n64F0Lds036505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 4 Jul 2009 17:00:22 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A4F6E84.4030803@erix.it> Date: Sat, 04 Jul 2009 17:00:20 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Lauer wrote: > Anyway. Enrico: would you -- as the original author of the short > reference -- mind making the MS WORD .doc files generally available? No problem: my original oo-writer document was posted along with the pdf. Enrico From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 12:09:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64F9Jke025764; Sat, 4 Jul 2009 12:09:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4174D1924B; Sat, 4 Jul 2009 12:08:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0178.hostedemail.com [64.99.136.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 908E0190FC for ; Sat, 4 Jul 2009 12:08:52 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay05.hostedemail.com (Postfix) with SMTP id BEBC91CDF9F2 for ; Sat, 4 Jul 2009 15:08:50 +0000 (UTC) X-Spam-Summary: 50, 0, 0, e4b61f9780195aa8, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1487:1513:1515:1516:1518:1521:1534:1538:1568:1593:1594:1711:1714:1730:1747:1766:1792:2393:2525:2560:2563:2682:2685:2693:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3865:3866:3867:3868:3872:3873:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:5007:6117:6261:7679:7875:7903:9025:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 1463 Received: from taboche (unknown [89.241.151.38]) (Authenticated sender: thomas.lauer) by omf13.hostedemail.com (Postfix) with ESMTP for ; Sat, 4 Jul 2009 15:08:49 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Sat, 04 Jul 2009 16:08:51 +0100 Organization: TL Message-ID: <80su4554trmqp28ja8029fegab251ind3l@thomaslauer.com> References: <4A4F6E84.4030803@erix.it> In-Reply-To: <4A4F6E84.4030803@erix.it> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n64F9Jke025764 Enrico Colombini wrote: > Thomas Lauer wrote: > > Anyway. Enrico: would you -- as the original author of the short > > reference -- mind making the MS WORD .doc files generally available? > > No problem: my original oo-writer document was posted along with the pdf. OK. So I will prepare another set of PDFs sometime next week and also post the .doc files used to produce them. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 15:38:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64IcFOH014168; Sat, 4 Jul 2009 15:38:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86C1B19024; Sat, 4 Jul 2009 15:37:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD70018ED1 for ; Sat, 4 Jul 2009 15:37:36 -0300 (BRT) Received: by ewy26 with SMTP id 26so3495942ewy.5 for ; Sat, 04 Jul 2009 11:37:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.76.4 with SMTP id y4mr2651747eba.8.1246732655273; Sat, 04 Jul 2009 11:37:35 -0700 (PDT) In-Reply-To: <4A4F68F4.5020305@gmail.com> References: <3e4778d50907040031n9b31694v891246183c93d176@mail.gmail.com> <4A4F68F4.5020305@gmail.com> Date: Sat, 4 Jul 2009 14:37:35 -0400 Message-ID: Subject: Re: strange behaviour with luaL_checkinteger() From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Jul 4, 2009 at 10:36 AM, KHMan wrote: > There is no such thing as a negative number in a CRC calculation. If you got > a negative number displayed, it's in the wrong representation. For example, be careful if casting an unsigned 32-bit integer as signed, as in Python 2.6: $ python >>> import binascii >>> binascii.crc32("test") # might not be what you expected -662733300 >>> binascii.crc32("test") & 0xffffffff # workaround 3632233996L From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 16:53:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64Jreu9021791; Sat, 4 Jul 2009 16:53:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B23831912F; Sat, 4 Jul 2009 16:53:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 566A918FAA for ; Sat, 4 Jul 2009 16:53:08 -0300 (BRT) Received: by ewy26 with SMTP id 26so3525495ewy.5 for ; Sat, 04 Jul 2009 12:53:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.194.9 with SMTP id w9mr2715083ebp.10.1246737183783; Sat, 04 Jul 2009 12:53:03 -0700 (PDT) In-Reply-To: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> References: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> Date: Sat, 4 Jul 2009 15:53:03 -0400 Message-ID: Subject: Re: Inling C/Fortran in Lua From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 3, 2009 at 8:04 AM, steve wrote: > Inling performance-critical code can be an effective trick: That approach is to compile C into a shared library that is called from Lua, which is fairly typical except that additional conveniences allow the C to be written inline and without binding boilerplate. A related idea is shown in [1]. I've considered trying a different approach with lua2c [2] but have not had the time to go far with it. lua2c already converts Lua to C. Taking it to the next level of inlining C into Lua would be very natural because the inlined C can be directly inlined into the translated C. For example, you can have a Lua algorithm that operates on both Lua and C data structures without writing a binding to those C data structures. The C compiler will even optimize across the boundary between C and Lua, which I understand LuaJIT does not do. This type of thing might have a niche. The generated C might even be consumed by LLVM. [1] http://lua-users.org/wiki/InlineCee [2] http://lua-users.org/wiki/LuaToCee From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 16:54:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64JsC1t021896; Sat, 4 Jul 2009 16:54:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0E0119183; Sat, 4 Jul 2009 16:53:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F5B218FAA for ; Sat, 4 Jul 2009 16:53:10 -0300 (BRT) Received: by qyk31 with SMTP id 31so3214420qyk.33 for ; Sat, 04 Jul 2009 12:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ao2wfr5SMz327NyKSERmcraqH+LKfq/kEUT4aPX35oQ=; b=PBOxNk7iZgTRFRc4pQ5wnoWZHG+eIsv+APM+p+00g1iuNjLFTu/moaGxt/+G+ajE6/ QQyge7e6o4fzwwhWb7UkVlEaZTpIaFvgW0M3E5cI4rNZzjDdfj5gOxSuj26JTnaNdKrS QwlCV94okXE2Cvu6e6w23QcFBlhGddZSn/zZs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rj9idj14Hy5Asla2KcTtH2YYSDNA2CIVC5N8Eyk5/ck83nD2jZeb9xGs31p+eHKf92 60bXL/MQk/dwe/pX0jO9y/fiXPq5zMYcldHfdGD/fXN4gKmqpgnpDYOTk6dPGEgOlbB/ K22FYH6nmyvvyHWc1w6fqgRW2fgXlgBasSmzA= MIME-Version: 1.0 Received: by 10.229.99.146 with SMTP id u18mr1586827qcn.97.1246737188379; Sat, 04 Jul 2009 12:53:08 -0700 (PDT) In-Reply-To: References: Date: Sat, 4 Jul 2009 12:53:08 -0700 Message-ID: <17eac67c0907041253m443bcbc0nc666e1293da94b78@mail.gmail.com> Subject: Re: possible bug in lua.c main report lua_tostring malloc From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n64JsC1t021896 On Fri, Jul 3, 2009 at 10:12 PM, David Manura wrote: > On Fri, Jul 3, 2009 at 11:36 PM, David Manura wrote: >> I was able to cause "lua -e 'error(5)'" to crash by triggering an >> allocation failure in lmem.c: > > That modification to lmem.c was likely not valid (returns alloc > failure after successfully allocating); I should have made the change > instead to lauxlib.c:l_alloc.  The code may be fragile here, but I do > not currently have a valid crash in practice. If you are really interested in testing lua's handling of allocation failure, I'd suggest creating a lua state with your own alloc function pointer. You should be able to avoid all the fragile hacking of the lua core code, and systematically fail every single allocation. We used to do this at a company I worked with where we cared a lot. We did this for cryptographic toolkits expected to run on embedded devices, and we wrapped all our unit test suites in this kind of loop. It basically systematically fails every single malloc that might occur, not just at every call site, but in every call sequence (that is exercised by the test code). I've never seen a C library that survived a test loop like this, including ours, which we would write knowing that they would have to pass. The basic approach was this (lua uses realloc, not malloc, so it would have to be adjusted): int failon; int allocations=0; void *our_malloc(size) { if(failon == 0) { return 0; } else { alloctions++ return malloc(size); } our_free(void*v) { if(v) { allocations--; free(v) } } int success; for(failon = 0;;failon++) { L = lua_newstate( ... our_malloc, ); int successfail = pcall(... run unit tests) lua_destroystate(L); // evaluate: // all memory should have been freed assert(allocations == 0); if(failon == 0) { // malloc failed, so expectation is unit test must have failed (errored, i guess, in lua's case) // with an "out of memory" exception assert(successorfail == ENOMEM); } if(failon > 0) { //malloc didn't fail, so we ran unit test to completion, result of unit test should be success assert(sucessorfail == SUCCESS) break; } } From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 19:53:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64MrR6N006284; Sat, 4 Jul 2009 19:53:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E1C618A57; Sat, 4 Jul 2009 19:52:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from eastrmmtao106.cox.net (eastrmmtao106.cox.net [68.230.240.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A92D1894D for ; Sat, 4 Jul 2009 19:52:52 -0300 (BRT) Received: from eastrmimpo01.cox.net ([68.1.16.119]) by eastrmmtao106.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20090704225249.XPX28892.eastrmmtao106.cox.net@eastrmimpo01.cox.net> for ; Sat, 4 Jul 2009 18:52:49 -0400 Received: from [127.0.0.1] ([98.169.46.242]) by eastrmimpo01.cox.net with bizsmtp id Byse1c0065DWrBW02ysfLe; Sat, 04 Jul 2009 18:52:48 -0400 X-VR-Score: 0.00 X-Authority-Analysis: v=1.0 c=1 a=6k8DaERGtHqAUNO_J5QA:9 a=Z3Hgv3RWsaVEAkVETk_mJpBJf0cA:4 X-CM-Score: 0.00 Message-ID: <4A4FDD2A.2010507@cox.net> Date: Sat, 04 Jul 2009 18:52:26 -0400 From: Olivier Hamel User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Structure of Lua (In C) References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Now before I start confusing myself past what I already am (medication isn't helping), I'd like someone to confirm that the following description of how Lua's data structures are built internally and that I'm not going insane. (Just check the src again to make sure, and now I'm certain I'm going insane. Probably will become as clear as day once someone actually explains it...) Create a new state -> Returns a lua_State structure With that state you also created indirectly a global_State structure which holds the 'real' state (the one all 'threads' share) Create a new coroutine ('thread', why can't we use the same terminology?) spawns a new lua_State and makes it point to the global_State that it's parent points to. So lua_State is more of a coroutine instance and global_State holds all the real meat of that Lua universe. Now all I need to figure out is what the LG structure does. (No bloody clue. It seems to be some sort of marker to specify the size of an empty global state and one lua state. Right?) Thanks for any clarification, Olivier From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 20:18:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64NIrUD008686; Sat, 4 Jul 2009 20:18:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 575F018F43; Sat, 4 Jul 2009 20:18:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f188.google.com (mail-yx0-f188.google.com [209.85.210.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D651E18C23 for ; Sat, 4 Jul 2009 20:18:29 -0300 (BRT) Received: by yxe26 with SMTP id 26so4423868yxe.33 for ; Sat, 04 Jul 2009 16:18:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.33.4 with SMTP id f4mr998292ibd.8.1246749508006; Sat, 04 Jul 2009 16:18:28 -0700 (PDT) In-Reply-To: <4A4FDD2A.2010507@cox.net> References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> <4A4FDD2A.2010507@cox.net> Date: Sat, 4 Jul 2009 17:18:27 -0600 Message-ID: <790db3550907041618n3dc6d6a6gf1551ac84a116081@mail.gmail.com> Subject: Re: Structure of Lua (In C) From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Olivier, On Sat, Jul 4, 2009 at 4:52 PM, Olivier Hamel wrote: > Now before I start confusing myself past what I already am (medication isn't > helping), I'd like someone to confirm that the following description of how > Lua's data structures are built internally and that I'm not going insane. > > (Just check the src again to make sure, and now I'm certain I'm going > insane. Probably will become as clear as day once someone actually explains > it...) > > Create a new state -> Returns a lua_State structure > With that state you also created indirectly a global_State structure which > holds the 'real' state (the one all 'threads' share) > Create a new coroutine ('thread', why can't we use the same terminology?) > spawns a new lua_State and makes it point to the global_State that it's > parent points to. This is all right. > So lua_State is more of a coroutine instance and global_State holds all the > real meat of that Lua universe. Now all I need to figure out is what the LG > structure does. (No bloody clue. It seems to be some sort of marker to > specify the size of an empty global state and one lua state. Right?) The LG structure holds everything (most) of what Lua needs for the required global state and main Lua state. It is useful for malloc'ing everything needed in one call (among other things). The main state is special in that it is never collected and is not (supposed to be) used as a coroutine. HTH, -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 20:46:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64Nk2Il011027; Sat, 4 Jul 2009 20:46:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3817C18F84; Sat, 4 Jul 2009 20:45:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from eastrmmtao107.cox.net (eastrmmtao107.cox.net [68.230.240.59]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41DA318D70 for ; Sat, 4 Jul 2009 20:45:31 -0300 (BRT) Received: from eastrmimpo01.cox.net ([68.1.16.119]) by eastrmmtao107.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20090704234529.KODI4885.eastrmmtao107.cox.net@eastrmimpo01.cox.net> for ; Sat, 4 Jul 2009 19:45:29 -0400 Received: from [127.0.0.1] ([98.169.46.242]) by eastrmimpo01.cox.net with bizsmtp id BzlV1c0055DWrBW02zlVmJ; Sat, 04 Jul 2009 19:45:29 -0400 X-VR-Score: -100.00 X-Authority-Analysis: v=1.0 c=1 a=DC9ksu0vi9PhtDfaQyAA:9 a=MLfHepLP0I08TcPCa9tv1rtYaUIA:4 X-CM-Score: 0.00 Message-ID: <4A4FE997.9070404@cox.net> Date: Sat, 04 Jul 2009 19:45:27 -0400 From: Olivier Hamel User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Structure of Lua (In C) References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> <4A4FDD2A.2010507@cox.net> <790db3550907041618n3dc6d6a6gf1551ac84a116081@mail.gmail.com> In-Reply-To: <790db3550907041618n3dc6d6a6gf1551ac84a116081@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick Donnelly wrote: > The LG structure holds everything (most) of what Lua needs for the > required global state and main Lua state. It is useful for malloc'ing > everything needed in one call (among other things). The main state is > special in that it is never collected and is not (supposed to be) used > as a coroutine. > > HTH, > So LG is some sort of base-package (a main/root coroutine and a global_State) on which you can throw more coroutines (lua_State/ threads) and these make up the Lua 'instance'? Olivier, From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 20:53:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n64NrVEJ011785; Sat, 4 Jul 2009 20:53:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2547190FD; Sat, 4 Jul 2009 20:53:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1384B18F56 for ; Sat, 4 Jul 2009 20:53:06 -0300 (BRT) Received: by bwz11 with SMTP id 11so1764743bwz.5 for ; Sat, 04 Jul 2009 16:53:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.50.212 with SMTP id a20mr2903529bkg.35.1246751584496; Sat, 04 Jul 2009 16:53:04 -0700 (PDT) In-Reply-To: <4A4FDD2A.2010507@cox.net> References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> <4A4FDD2A.2010507@cox.net> Date: Sun, 5 Jul 2009 00:53:04 +0100 Message-ID: Subject: Re: Structure of Lua (In C) From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Jul 4, 2009 at 11:52 PM, Olivier Hamel wrote: > Now all I need to figure out is what the LG > structure does. (No bloody clue. It seems to be some sort of marker to > specify the size of an empty global state and one lua state. Right?) Where possible, when two things have the same lifetime, the Lua source likes to allocate them as one unit. Generally, this improves efficiency (both execution time and memory usage). If you're going to allocate a lua_State and global_State as one unit, then you need to know the size of that unit. The obvious choice might be sizeof(lua_State) + sizeof(global_State), but that would not guarantee correct alignment on the global_State, hence a struct of the two is used, as this will add whatever padding is required to give correct alignment on the global_State. Also, the global_State cannot be managed by the garbage collector, as it contains the state for the garbage collector. Furthermore, the primary lua_State cannot be managed by the garbage collector. LG thus neatly contains all of the objects which are outside of the garbage collector. At least, that is my interpretation of the source code. From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 21:43:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n650hFcL015949; Sat, 4 Jul 2009 21:43:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FC6718F94; Sat, 4 Jul 2009 21:42:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from eastrmmtao103.cox.net (eastrmmtao103.cox.net [68.230.240.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BEED18C1B for ; Sat, 4 Jul 2009 21:42:42 -0300 (BRT) Received: from eastrmimpo03.cox.net ([68.1.16.126]) by eastrmmtao103.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20090705004239.DEAN12338.eastrmmtao103.cox.net@eastrmimpo03.cox.net> for ; Sat, 4 Jul 2009 20:42:39 -0400 Received: from [127.0.0.1] ([98.169.46.242]) by eastrmimpo03.cox.net with bizsmtp id C0iW1c00J5DWrBW020iZfw; Sat, 04 Jul 2009 20:42:39 -0400 X-VR-Score: -100.00 X-Authority-Analysis: v=1.0 c=1 a=GhBCbzHr82TDaTJ3STcA:9 a=-0KMTWx0NFwkI_xJ3aUA:7 a=NMg1yh74vncA9WWP9pVWGCgUjUUA:4 X-CM-Score: 0.00 Message-ID: <4A4FF6F1.40100@cox.net> Date: Sat, 04 Jul 2009 20:42:25 -0400 From: Olivier Hamel User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Structure of Lua (In C) References: <8621A113-1A20-4117-992A-0E4838CEA715@gmail.com> <4A4FDD2A.2010507@cox.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Peter Cawley wrote: > Where possible, when two things have the same lifetime, the Lua source > likes to allocate them as one unit. Generally, this improves > efficiency (both execution time and memory usage). If you're going to > allocate a lua_State and global_State as one unit, then you need to > know the size of that unit. The obvious choice might be > sizeof(lua_State) + sizeof(global_State), but that would not guarantee > correct alignment on the global_State, hence a struct of the two is > used, as this will add whatever padding is required to give correct > alignment on the global_State. Also, the global_State cannot be > managed by the garbage collector, as it contains the state for the > garbage collector. Furthermore, the primary lua_State cannot be > managed by the garbage collector. LG thus neatly contains all of the > objects which are outside of the garbage collector. > > At least, that is my interpretation of the source code. > Alright, pretty close to the image/concept that I'd formed. Thank you to everyone for clarifying this! Olivier From lua-bounces@bazar2.conectiva.com.br Sat Jul 4 23:25:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n652PATX025537; Sat, 4 Jul 2009 23:25:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2332D18B72; Sat, 4 Jul 2009 23:24:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E19F418ACF for ; Sat, 4 Jul 2009 23:24:40 -0300 (BRT) Received: by ewy26 with SMTP id 26so3652134ewy.5 for ; Sat, 04 Jul 2009 19:24:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.19.7 with SMTP id 7mr2978562ebs.55.1246760678943; Sat, 04 Jul 2009 19:24:38 -0700 (PDT) Date: Sat, 4 Jul 2009 22:24:38 -0400 Message-ID: Subject: hyphens in module names From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The purpose of the following comment in the Lua Reference Manual was not immediately clear to at least two people: "Moreover, if the module name has a hyphen, its prefix up to (and including) the first hyphen is removed. For instance, if the module name is a.v1-b.c, the function name will be luaopen_b_c." This appears to be intended to allow multiple versions of a module to be named without modifying their binary interface. Having the version number be a prefix rather than a postfix is a bit unorthodox though. From lua-bounces@bazar2.conectiva.com.br Sun Jul 5 06:22:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n659M74R008827; Sun, 5 Jul 2009 06:22:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB2BD18AB8; Sun, 5 Jul 2009 06:21:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BFC118A74 for ; Sun, 5 Jul 2009 06:21:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so3771119ewy.5 for ; Sun, 05 Jul 2009 02:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=AzezhwSuvghszqhkj51KDP6Wm4RBVcutUptMOOgmLJ4=; b=L2HmwofGMgVFMjEnR8FwGxFPgi1xtk5BRJeMw722vdU2BUqMI1zUHRCDsYxAPvcqvt orvLf8Z5VJUBd2vgRdh/cXXNghNCO/ztZeZzCAJqbdz1jk5p0i3d2+FDTYthw3f3p9Do jmUJGKQ3G7uR6K7dESSXJGXHbN2YCkQLmG7QQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eN187ckWEPFmZvxtVBaGmkc31DaDz26Tx0XCEOVOXcDKph79MsaRF01D94qlnEzLxg hPzSu7opQ1sg7U65Bi/qfoP2E7qG2wvmCJB8dAeeELbPAQXs0uE7oXDSEoTIg3Ag76/K qB+sTAJ1aZMXXzY58rIlxx3d2eQCXBrPbkN6w= MIME-Version: 1.0 Received: by 10.210.71.13 with SMTP id t13mr2230271eba.57.1246785686435; Sun, 05 Jul 2009 02:21:26 -0700 (PDT) In-Reply-To: <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> References: <8a25d01b0907021256p6a974759seac55388cec6276d@mail.gmail.com> <6FB093FF-B8A1-41E7-ABBA-26CF5F8CE5A7@gmail.com> <8a25d01b0907021607w2c26819kb12e771e8eba5551@mail.gmail.com> Date: Sun, 5 Jul 2009 11:21:26 +0200 Message-ID: <2084b47d0907050221r2211e78yadd4b6f5fae824a3@mail.gmail.com> Subject: Re: Tyrant Client? From: Jose To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n659M74R008827 Hi Phoenix, pls let us know when the client is available. That seems a great addtion to TC/TT ! regards jose On Fri, Jul 3, 2009 at 1:07 AM, Phoenix Sol wrote: > Thank-you, Petite.  I will implement Tyrant's binary protocol in Lua. > > Respectfully, > Phoenix Sol > > > On Thu, Jul 2, 2009 at 3:07 PM, Petite Abeille > wrote: >> >> On Jul 2, 2009, at 9:56 PM, Phoenix Sol wrote: >> >>> Anybody have a Lua client for Tokyo Tyrant? >> >> HTTP? >> >> "As for the HTTP/1.1 compatible protocol, the server implements the >> following commands; "GET" (relevant to `tcrdbget'), "HEAD" (relevant to >> `tcrdbvsiz'), "PUT" (relevant to `tcrdbput'), "POST" (relevant to >> `tcrdbext'), and "DELETE" (relevant to `tcrdbout'). The URI of each request >> is treated as the key encoded by the URL encoding. And the entity body is >> treated as the value. However, headers except for "Connection" and >> "Content-Length" are ignored. "PUT" can have the header "X-TT-PDMODE" whose >> value is either of 1 (relevant to `tcrdbputkeep'), 2 (relevant to >> `tcrdbputcat'), or else (relevant to `tcrdbput'). "POST" should have the >> header "X-TT-XNAME" whose value stands for the function name to be called. >> "POST" can have the header "X-TT-XOPTS" whose value stands for bitwise-or >> options of 1 (record locking) and 2 (global locking)." >> >> http://tokyocabinet.sourceforge.net/tyrantdoc/ >> >> > > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 06:42:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n669gpE6018514; Mon, 6 Jul 2009 06:42:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 899FA18861; Mon, 6 Jul 2009 06:42:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD9A318714 for ; Mon, 6 Jul 2009 06:42:09 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so597409fgb.5 for ; Mon, 06 Jul 2009 02:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=HcsYwyMGsTwQGj8pesQjoyrAwXEBG8YHtz4ARd7dKhw=; b=Voh9BUxii/0E/ZXPuLiLAJXS7VwpKxHkXEqql/+rRJAJ/ioakU8LPLn00lOmJIjish hbUthPUtaRAO4DLnxvSPI/nWbWJ62PUHX3xzH9VZEfBy0o9OK8bqxm5oLBKISZ3TljYq lZnl1BNU66hpSduOY65ksnrFOqpIwZt0LmXfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YJ0vz59HxIxnzVCfaV5kBLFwp/9lsSg2lH1qSMRq/gQJvcwFkYw7y6sQKz3mb1UJQK BsYha+LivGkovgrK1Yl6QFBIP8eRIga/VEYa2FdJEOxngAf9TcGqYPNRQapf/ie7Fn1I kzWM6l/QlsB4Bp6PdaRFVmZnNdKd5r1cnXRHw= MIME-Version: 1.0 Received: by 10.239.131.202 with SMTP id 10mr318828hbo.94.1246873326826; Mon, 06 Jul 2009 02:42:06 -0700 (PDT) In-Reply-To: References: <560972290907030504i6ff47e74s18e651041234226@mail.gmail.com> Date: Mon, 6 Jul 2009 11:42:06 +0200 Message-ID: <560972290907060242m41e0015ex1e6720e90aca9290@mail.gmail.com> Subject: Re: Inling C/Fortran in Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n669gpE6018514 On Sat, Jul 4, 2009 at 9:53 PM, David Manura wrote: > That approach is to compile C into a shared library that is called > from Lua, which is fairly typical except that additional conveniences > allow the C to be written inline and without binding boilerplate.  A > related idea is shown in [1]. That's cool, especially using LuaRocks as the cross-platform build engine. However, you still have to use the Lua API in such inlined code, just as in luatcc. A piece of the puzzle can be provided by tolua++, which relies on cleaned headers. Now if the cleaned headers could be extracted from the inline code, then things would work more directly, and the marshalling of basic Lua and C types is handled by tolua++. Another piece would be implementing a simple dependency check, so that the inlined code is only actually compiled if it changes. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 10:49:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66DnBUF026957; Mon, 6 Jul 2009 10:49:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DA3818B72; Mon, 6 Jul 2009 10:48:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3691F187C4 for ; Mon, 6 Jul 2009 10:48:29 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n66DmPWC014942 for ; Mon, 6 Jul 2009 10:48:28 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 9360854C11E; Mon, 6 Jul 2009 10:48:26 -0300 (BRT) Date: Mon, 6 Jul 2009 10:48:26 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: hyphens in module names Message-ID: <20090706134826.GA21966@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The purpose of the following comment in the Lua Reference Manual was > not immediately clear to at least two people: > > "Moreover, if the module name has a hyphen, its prefix up to (and > including) the first hyphen is removed. For instance, if the module > name is a.v1-b.c, the function name will be luaopen_b_c." > > This appears to be intended to allow multiple versions of a module to > be named without modifying their binary interface. > > Having the version number be a prefix rather than a postfix is a bit > unorthodox though. Yes, that was a design mistake. We may correct that for 5.2. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 11:04:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66E4eZd030378; Mon, 6 Jul 2009 11:04:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E872A18C54; Mon, 6 Jul 2009 11:04:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3EF118BD4 for ; Mon, 6 Jul 2009 11:04:07 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n66E46US016879 for ; Mon, 6 Jul 2009 11:04:06 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 7936554C11E; Mon, 6 Jul 2009 11:04:07 -0300 (BRT) Date: Mon, 6 Jul 2009 11:04:07 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: possible bug in lua.c main report lua_tostring malloc Message-ID: <20090706140407.GC21966@inf.puc-rio.br> References: <17eac67c0907041253m443bcbc0nc666e1293da94b78@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17eac67c0907041253m443bcbc0nc666e1293da94b78@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > We used to do this at a company I worked with where we cared a lot. We > did this for cryptographic toolkits expected to run on embedded > devices, and we wrapped all our unit test suites in this kind of loop. > It basically systematically fails every single malloc that might > occur, not just at every call site, but in every call sequence (that > is exercised by the test code). I've never seen a C library that > survived a test loop like this, including ours, which we would write > knowing that they would have to pass. The standard tests for Lua include something along these lines, although we cannot garantee every call sequence. And it does not test lua.c... The allocator has a variable with the maximum memory it can use. The test then proceeds to do some task (e.g., load a file) starting with a zero limit and increasing it by small steps (something like 3 bytes) until it is able to finish the task. All along the garbage collector and the error recovery system are tested too. We do this test for several tasks (creating a new state, new threads, loadstring, dofile, string creation, constructors, closure creation, etc.). -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 13:31:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66GUv1F028655; Mon, 6 Jul 2009 13:31:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E599918CD2; Mon, 6 Jul 2009 13:30:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from EXSMTP014-6.exch014.msoutlookonline.net (exsmtp014-6.exch014.msoutlookonline.net [207.5.72.211]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38CEE18B39 for ; Mon, 6 Jul 2009 13:30:11 -0300 (BRT) Received: from EXVBE014-13.exch014.msoutlookonline.net ([207.5.72.33]) by EXSMTP014-6.exch014.msoutlookonline.net with Microsoft SMTPSVC(6.0.3790.1830); Mon, 6 Jul 2009 09:30:09 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Lunar, C++, and premature object destruction Date: Mon, 6 Jul 2009 09:30:08 -0700 Message-ID: <860F2CFC00882245AB73832D5137264C06A3F5B4@EXVBE014-13.exch014.msoutlookonline.net> In-Reply-To: <4A4C69FC.2020009@bitfighter.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Lunar, C++, and premature object destruction Thread-Index: Acn666VBZsgvbWMPRdm2qCB8fHJeCwDa0FxA From: "Sean Riley" To: "Lua list" X-OriginalArrivalTime: 06 Jul 2009 16:30:09.0106 (UTC) FILETIME=[0712EB20:01C9FE57] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n66GUv1F028655 Looking briefly at the Lunar code, I don't see anything that tries to handle the case of the object being deleted from the C++ side. The only cleanup appears to be when the object's associated userdata is garbage collected from the lua side. Maybe you could always delete the ship from the lua code? This would require a wrapper function that calls into lua to nil out the reference to the shup in script, causing it to be garbage collected. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto > Sent: Thursday, July 02, 2009 1:04 AM > To: lua@bazar2.conectiva.com.br > Subject: Lunar, C++, and premature object destruction > > I'm working on a game that uses Lua to control robot players, written in > C++, and bound with Lunar, and am having problems controlling the > lifespan of objects created in C++ and referenced in Lua. (It's at > http://bitfighter.org, if you are curious, and the linked wiki contains > examples of some robot scripts.) > > My primary object is a Ship. The lifetime of the Ship object is > completely controlled by C++. I also have a proxy object, called > LuaShip, that contains a pointer to the Ship, and handles all the > requests for information about the Ship from the Lua script. The goal > is that when the Ship is destroyed, the pointer on the LuaShip will be > set to NULL, and any future requests to the LuaShip can be intelligently > handled (probably by generating an error of some sort). The LuaShip is > exposed to Lua via Lunar if the robot script requests it (using a > getShip() method or somesuch). > > The Ship object also contains a pointer to its LuaShip proxy. My > problem is that when the Ship object is destroyed, C++ seems to think > that all pointers to the LuaShip are gone, and it is OK to destroy the > LuaShip as well. It does not seem to recognize when a Lua instance is > also referring to the LuaShip. The result is that the LuaShip is > destroyed, and the Lua script is now left holding a reference to > nothing. When the script acts on it (thinking it's still valid), the > app crashes. > > My questions are 1) Is this an appropriate architecture for managing Lua > instances that can have persistent references to C++ objects (Ship in > this case) that can be deleted without warning, and 2) are there any > good examples of code that uses Lunar in this manner that I can examine > to see where my problem might be? > > Thank you, > > Chris From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 14:12:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66H6u2Q003778; Mon, 6 Jul 2009 14:06:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9999118E57; Mon, 6 Jul 2009 14:06:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0D6618CDD for ; Mon, 6 Jul 2009 14:06:17 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id EBC063AEB27 for ; Mon, 6 Jul 2009 13:06:16 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 06 Jul 2009 13:06:16 -0400 X-Sasl-enc: 5URG8qLL67xt2Btupgy+p+h0Ycr4nx5CvnUv5/gqoND0 1246899976 Received: from [192.168.1.100] (97-120-106-191.ptld.qwest.net [97.120.106.191]) by mail.messagingengine.com (Postfix) with ESMTPSA id 47E902E292 for ; Mon, 6 Jul 2009 13:06:16 -0400 (EDT) Message-ID: <4A522F02.8080508@bitfighter.org> Date: Mon, 06 Jul 2009 10:06:10 -0700 From: Watusimoto User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Lunar, C++, and premature object destruction References: <860F2CFC00882245AB73832D5137264C06A3F5B4@EXVBE014-13.exch014.msoutlookonline.net> In-Reply-To: <860F2CFC00882245AB73832D5137264C06A3F5B4@EXVBE014-13.exch014.msoutlookonline.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sean, Thanks for your response. I may have found a solution just last night. You are right that with Luna, the C++ code is unaware of any references that Lua has to an object, so when C++ is done with it, it gets deleted, creating the problem I reported. My solution was to rearchitect my Ship/LuaShip relationship, such that there is no longer a one-to-one relationship. When Lua wants a LuaShip, I create a new one, and let Lua control its lifespan. I used a reference-counting pointer on LuaShip to refer back to the Ship, so that if the Ship is killed and deleted, the LuaShip pointer to it is set to NULL, and I can detect and handle that situation when dealing with the LuaShip object. That let me remove the pointer from Ship to LuaShip that led to the problems in my previous design. The only drawback to this solution is that I end up creating a lot of LuaShip objects (the Lua script may ask for several such references each game cycle), whereas in my previous scheme, there was only one for each Ship. But it does work -- Lua can hold or delete the LuaShip as it likes, and C++ doesn't care; it will just create another when it needs one. The only lingering problem I'm having is that while mucking around with this, I found that some objects aren't being fully destroyed, leading to a memory leak, but I think this is purely a C++ problem, and not related to any of the above. Chris Sean Riley wrote: > Looking briefly at the Lunar code, I don't see anything that tries to > handle the case of the object being deleted from the C++ side. The only > cleanup appears to be when the object's associated userdata is garbage > collected from the lua side. > > Maybe you could always delete the ship from the lua code? This would > require a wrapper function that calls into lua to nil out the reference > to the shup in script, causing it to be garbage collected. > > >> -----Original Message----- >> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- >> bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto >> Sent: Thursday, July 02, 2009 1:04 AM >> To: lua@bazar2.conectiva.com.br >> Subject: Lunar, C++, and premature object destruction >> >> I'm working on a game that uses Lua to control robot players, written >> > in > >> C++, and bound with Lunar, and am having problems controlling the >> lifespan of objects created in C++ and referenced in Lua. (It's at >> http://bitfighter.org, if you are curious, and the linked wiki >> > contains > >> examples of some robot scripts.) >> >> My primary object is a Ship. The lifetime of the Ship object is >> completely controlled by C++. I also have a proxy object, called >> LuaShip, that contains a pointer to the Ship, and handles all the >> requests for information about the Ship from the Lua script. The goal >> is that when the Ship is destroyed, the pointer on the LuaShip will be >> set to NULL, and any future requests to the LuaShip can be >> > intelligently > >> handled (probably by generating an error of some sort). The LuaShip >> > is > >> exposed to Lua via Lunar if the robot script requests it (using a >> getShip() method or somesuch). >> >> The Ship object also contains a pointer to its LuaShip proxy. My >> problem is that when the Ship object is destroyed, C++ seems to think >> that all pointers to the LuaShip are gone, and it is OK to destroy the >> LuaShip as well. It does not seem to recognize when a Lua instance is >> also referring to the LuaShip. The result is that the LuaShip is >> destroyed, and the Lua script is now left holding a reference to >> nothing. When the script acts on it (thinking it's still valid), the >> app crashes. >> >> My questions are 1) Is this an appropriate architecture for managing >> > Lua > >> instances that can have persistent references to C++ objects (Ship in >> this case) that can be deleted without warning, and 2) are there any >> good examples of code that uses Lunar in this manner that I can >> > examine > >> to see where my problem might be? >> >> Thank you, >> >> Chris >> > > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 15:12:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66I1mQr017031; Mon, 6 Jul 2009 15:01:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2F7C18E71; Mon, 6 Jul 2009 15:01:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exsmtp014-4.exch014.msoutlookonline.net (exsmtp014-4.exch014.msoutlookonline.net [207.5.72.81]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6959518C46 for ; Mon, 6 Jul 2009 15:00:59 -0300 (BRT) Received: from EXVBE014-13.exch014.msoutlookonline.net ([207.5.72.33]) by exsmtp014-4.exch014.msoutlookonline.net with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Jul 2009 11:00:53 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Lunar, C++, and premature object destruction Date: Mon, 6 Jul 2009 11:00:52 -0700 Message-ID: <860F2CFC00882245AB73832D5137264C06A3F5B8@EXVBE014-13.exch014.msoutlookonline.net> In-Reply-To: <4A522F02.8080508@bitfighter.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Lunar, C++, and premature object destruction Thread-Index: Acn+XCJElakQsJjTTJ64s4rla3FvagAB6Xxw From: "Sean Riley" To: "Lua list" X-OriginalArrivalTime: 06 Jul 2009 18:00:53.0519 (UTC) FILETIME=[B43269F0:01C9FE63] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n66I1mQr017031 Another possible strategy is to store an ID rather than a pointer in the userdata object. That way you can lookup the ID to see if the object still exists, instead of dereferencing a pointer that may have been free'ed. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto > Sent: Monday, July 06, 2009 10:06 AM > To: Lua list > Subject: Re: Lunar, C++, and premature object destruction > > Sean, > > Thanks for your response. I may have found a solution just last night. > You are right that with Luna, the C++ code is unaware of any references > that Lua has to an object, so when C++ is done with it, it gets deleted, > creating the problem I reported. My solution was to rearchitect my > Ship/LuaShip relationship, such that there is no longer a one-to-one > relationship. When Lua wants a LuaShip, I create a new one, and let Lua > control its lifespan. I used a reference-counting pointer on LuaShip to > refer back to the Ship, so that if the Ship is killed and deleted, the > LuaShip pointer to it is set to NULL, and I can detect and handle that > situation when dealing with the LuaShip object. That let me remove the > pointer from Ship to LuaShip that led to the problems in my previous > design. > > The only drawback to this solution is that I end up creating a lot of > LuaShip objects (the Lua script may ask for several such references each > game cycle), whereas in my previous scheme, there was only one for each > Ship. But it does work -- Lua can hold or delete the LuaShip as it > likes, and C++ doesn't care; it will just create another when it needs > one. > > The only lingering problem I'm having is that while mucking around with > this, I found that some objects aren't being fully destroyed, leading to > a memory leak, but I think this is purely a C++ problem, and not related > to any of the above. > > Chris > > > > Sean Riley wrote: > > Looking briefly at the Lunar code, I don't see anything that tries to > > handle the case of the object being deleted from the C++ side. The only > > cleanup appears to be when the object's associated userdata is garbage > > collected from the lua side. > > > > Maybe you could always delete the ship from the lua code? This would > > require a wrapper function that calls into lua to nil out the reference > > to the shup in script, causing it to be garbage collected. > > > > > >> -----Original Message----- > >> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > >> bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto > >> Sent: Thursday, July 02, 2009 1:04 AM > >> To: lua@bazar2.conectiva.com.br > >> Subject: Lunar, C++, and premature object destruction > >> > >> I'm working on a game that uses Lua to control robot players, written > >> > > in > > > >> C++, and bound with Lunar, and am having problems controlling the > >> lifespan of objects created in C++ and referenced in Lua. (It's at > >> http://bitfighter.org, if you are curious, and the linked wiki > >> > > contains > > > >> examples of some robot scripts.) > >> > >> My primary object is a Ship. The lifetime of the Ship object is > >> completely controlled by C++. I also have a proxy object, called > >> LuaShip, that contains a pointer to the Ship, and handles all the > >> requests for information about the Ship from the Lua script. The goal > >> is that when the Ship is destroyed, the pointer on the LuaShip will be > >> set to NULL, and any future requests to the LuaShip can be > >> > > intelligently > > > >> handled (probably by generating an error of some sort). The LuaShip > >> > > is > > > >> exposed to Lua via Lunar if the robot script requests it (using a > >> getShip() method or somesuch). > >> > >> The Ship object also contains a pointer to its LuaShip proxy. My > >> problem is that when the Ship object is destroyed, C++ seems to think > >> that all pointers to the LuaShip are gone, and it is OK to destroy the > >> LuaShip as well. It does not seem to recognize when a Lua instance is > >> also referring to the LuaShip. The result is that the LuaShip is > >> destroyed, and the Lua script is now left holding a reference to > >> nothing. When the script acts on it (thinking it's still valid), the > >> app crashes. > >> > >> My questions are 1) Is this an appropriate architecture for managing > >> > > Lua > > > >> instances that can have persistent references to C++ objects (Ship in > >> this case) that can be deleted without warning, and 2) are there any > >> good examples of code that uses Lunar in this manner that I can > >> > > examine > > > >> to see where my problem might be? > >> > >> Thank you, > >> > >> Chris > >> > > > > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 15:51:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66IpGqo030035; Mon, 6 Jul 2009 15:51:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6A5B18EA5; Mon, 6 Jul 2009 15:50:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6946618C1B for ; Mon, 6 Jul 2009 15:50:35 -0300 (BRT) Received: by qyk31 with SMTP id 31so4110265qyk.33 for ; Mon, 06 Jul 2009 11:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1m0Hg4jq9zBpc05aCJLKXVvKEJMfQWIOlucp3xf8dFI=; b=DGFBDQ59p5YF+kIeIdI225PcYY91Axm941dZleJVzBwOLBSKhWzLbvoqBrQcb5sUcd L2cvoPBk1UlMosMYHun/m633qZ83QsoaBK+0UMe6CV6776HkuD6I8CMxtzS0ry3z7IkY yc53vP9PotF/1OCgp+P90YZ37zR1AfBuJb/Uc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YtQSth3jzDLo8Y3u3Jdqu+BDV6CaaFk0TD9Ec04ihwYgBcDmQsLh0Cu2cOKXLbcoDK 1LSnoOjj6jO+oiRPu2OSSquI+kwZIvsoAAA2kSMib2lmyQdsofIROOE1sJODum21YDlK z54BI0TFVozaFISSCK1/TS0zYeW+r9V4n4MFE= MIME-Version: 1.0 Received: by 10.229.95.4 with SMTP id b4mr2477008qcn.40.1246906232351; Mon, 06 Jul 2009 11:50:32 -0700 (PDT) In-Reply-To: <4A522F02.8080508@bitfighter.org> References: <860F2CFC00882245AB73832D5137264C06A3F5B4@EXVBE014-13.exch014.msoutlookonline.net> <4A522F02.8080508@bitfighter.org> Date: Mon, 6 Jul 2009 11:50:32 -0700 Message-ID: <17eac67c0907061150y5bdf236bq9a481ea1681f3d34@mail.gmail.com> Subject: Re: Lunar, C++, and premature object destruction From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 6, 2009 at 10:06 AM, Watusimoto wrote: > Sean, > > Thanks for your response. I may have found a solution just last night. > You are right that with Luna, the C++ code is unaware of any references > that Lua has to an object, so when C++ is done with it, it gets deleted, > creating the problem I reported. My solution was to rearchitect my > Ship/LuaShip relationship, such that there is no longer a one-to-one > relationship. When Lua wants a LuaShip, I create a new one, and let Lua > control its lifespan. I used a reference-counting pointer on LuaShip to > refer back to the Ship, so that if the Ship is killed and deleted, the > LuaShip pointer to it is set to NULL, and I can detect and handle that > situation when dealing with the LuaShip object. That let me remove the > pointer from Ship to LuaShip that led to the problems in my previous design. > > The only drawback to this solution is that I end up creating a lot of > LuaShip objects (the Lua script may ask for several such references each > game cycle), whereas in my previous scheme, there was only one for each > Ship. But it does work -- Lua can hold or delete the LuaShip as it > likes, and C++ doesn't care; it will just create another when it needs one. One pattern for avoiding overcreation of userdata is to ensure you never have more than 1 userdata (luaship) for each C++ object (c++ship). When creating a luaship, store it in a global weak table, indexed by lightuserdata of the c++ship's pointer value. Before creating a luaship for a c++ship, look up the pointer value in the global table, and return the preexisting luaship if possible, only creating a new luaship if necessary. In the c++ship's delete, you can then look up any possibly existing luaship that might have a reference to it, and both zero the pointer in the userdata, as you are now, and also delete the pointer->luaship mapping from the global weak table. Lots of variations on this are possible, but they key is using weak tables with lightuserdata as keys to maintain a mapping from the C++ world to the lua world. Sam From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 16:38:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66Jc5VE009711; Mon, 6 Jul 2009 16:38:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8190518CDB; Mon, 6 Jul 2009 16:37:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 809D218B28 for ; Mon, 6 Jul 2009 16:37:23 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id E7AAE3AEFC1 for ; Mon, 6 Jul 2009 15:37:17 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 06 Jul 2009 15:37:17 -0400 X-Sasl-enc: K0A39xh7JUVyKben2Wlz0VM3r0xhRgYcUQkc3ZP5nOgO 1246909037 Received: from [192.168.1.100] (97-120-106-191.ptld.qwest.net [97.120.106.191]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6AEDB2E46D for ; Mon, 6 Jul 2009 15:37:17 -0400 (EDT) Message-ID: <4A525267.1000209@bitfighter.org> Date: Mon, 06 Jul 2009 12:37:11 -0700 From: Watusimoto User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Lunar, C++, and premature object destruction References: <860F2CFC00882245AB73832D5137264C06A3F5B8@EXVBE014-13.exch014.msoutlookonline.net> In-Reply-To: <860F2CFC00882245AB73832D5137264C06A3F5B8@EXVBE014-13.exch014.msoutlookonline.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yes, I thought about that... the downside is that it would require a little more effort on the Lua side (i.e when do you use the object itself, vs lookup the ID), and I feel it is important to streamline the Lua coding as much as possible, as it will be exposed to (advanced) users, not just devs. More streamlined == less documentation == less support == happier devs :-) And even so, I would still need to handle the situation where some wayward Lua coder stores a reference (rather than its ID), which would likely bring the whole game down if the script used it after the underlying object were deleted. I need to make sure that can't happen. If you are interested, I explored some of the alternate strategies here: http://stackoverflow.com/questions/1047212/detecting-stale-c-references-in-lua Sean Riley wrote: > Another possible strategy is to store an ID rather than a pointer in the > userdata object. That way you can lookup the ID to see if the object > still exists, instead of dereferencing a pointer that may have been > free'ed. > > >> -----Original Message----- >> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- >> bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto >> Sent: Monday, July 06, 2009 10:06 AM >> To: Lua list >> Subject: Re: Lunar, C++, and premature object destruction >> >> Sean, >> >> Thanks for your response. I may have found a solution just last >> > night. > >> You are right that with Luna, the C++ code is unaware of any >> > references > >> that Lua has to an object, so when C++ is done with it, it gets >> > deleted, > >> creating the problem I reported. My solution was to rearchitect my >> Ship/LuaShip relationship, such that there is no longer a one-to-one >> relationship. When Lua wants a LuaShip, I create a new one, and let >> > Lua > >> control its lifespan. I used a reference-counting pointer on LuaShip >> > to > >> refer back to the Ship, so that if the Ship is killed and deleted, the >> LuaShip pointer to it is set to NULL, and I can detect and handle that >> situation when dealing with the LuaShip object. That let me remove >> > the > >> pointer from Ship to LuaShip that led to the problems in my previous >> design. >> >> The only drawback to this solution is that I end up creating a lot of >> LuaShip objects (the Lua script may ask for several such references >> > each > >> game cycle), whereas in my previous scheme, there was only one for >> > each > >> Ship. But it does work -- Lua can hold or delete the LuaShip as it >> likes, and C++ doesn't care; it will just create another when it needs >> one. >> >> The only lingering problem I'm having is that while mucking around >> > with > >> this, I found that some objects aren't being fully destroyed, leading >> > to > >> a memory leak, but I think this is purely a C++ problem, and not >> > related > >> to any of the above. >> >> Chris >> >> >> >> Sean Riley wrote: >> >>> Looking briefly at the Lunar code, I don't see anything that tries >>> > to > >>> handle the case of the object being deleted from the C++ side. The >>> > only > >>> cleanup appears to be when the object's associated userdata is >>> > garbage > >>> collected from the lua side. >>> >>> Maybe you could always delete the ship from the lua code? This would >>> require a wrapper function that calls into lua to nil out the >>> > reference > >>> to the shup in script, causing it to be garbage collected. >>> >>> >>> >>>> -----Original Message----- >>>> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- >>>> bounces@bazar2.conectiva.com.br] On Behalf Of Watusimoto >>>> Sent: Thursday, July 02, 2009 1:04 AM >>>> To: lua@bazar2.conectiva.com.br >>>> Subject: Lunar, C++, and premature object destruction >>>> >>>> I'm working on a game that uses Lua to control robot players, >>>> > written > >>> in >>> >>> >>>> C++, and bound with Lunar, and am having problems controlling the >>>> lifespan of objects created in C++ and referenced in Lua. (It's at >>>> http://bitfighter.org, if you are curious, and the linked wiki >>>> >>>> >>> contains >>> >>> >>>> examples of some robot scripts.) >>>> >>>> My primary object is a Ship. The lifetime of the Ship object is >>>> completely controlled by C++. I also have a proxy object, called >>>> LuaShip, that contains a pointer to the Ship, and handles all the >>>> requests for information about the Ship from the Lua script. The >>>> > goal > >>>> is that when the Ship is destroyed, the pointer on the LuaShip will >>>> > be > >>>> set to NULL, and any future requests to the LuaShip can be >>>> >>>> >>> intelligently >>> >>> >>>> handled (probably by generating an error of some sort). The >>>> > LuaShip > >>> is >>> >>> >>>> exposed to Lua via Lunar if the robot script requests it (using a >>>> getShip() method or somesuch). >>>> >>>> The Ship object also contains a pointer to its LuaShip proxy. My >>>> problem is that when the Ship object is destroyed, C++ seems to >>>> > think > >>>> that all pointers to the LuaShip are gone, and it is OK to destroy >>>> > the > >>>> LuaShip as well. It does not seem to recognize when a Lua instance >>>> > is > >>>> also referring to the LuaShip. The result is that the LuaShip is >>>> destroyed, and the Lua script is now left holding a reference to >>>> nothing. When the script acts on it (thinking it's still valid), >>>> > the > >>>> app crashes. >>>> >>>> My questions are 1) Is this an appropriate architecture for >>>> > managing > >>> Lua >>> >>> >>>> instances that can have persistent references to C++ objects (Ship >>>> > in > >>>> this case) that can be deleted without warning, and 2) are there >>>> > any > >>>> good examples of code that uses Lunar in this manner that I can >>>> >>>> >>> examine >>> >>> >>>> to see where my problem might be? >>>> >>>> Thank you, >>>> >>>> Chris >>>> >>>> >>> > > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 17:21:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66KLGgO024712; Mon, 6 Jul 2009 17:21:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CF2018D42; Mon, 6 Jul 2009 17:20:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D08E318CDB for ; Mon, 6 Jul 2009 17:20:41 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MNufz-0007PA-3x for ; Mon, 06 Jul 2009 21:20:35 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MNug4-0004oc-Dn for lua@bazar2.conectiva.com.br; Mon, 06 Jul 2009 21:20:40 +0100 Date: Mon, 6 Jul 2009 21:20:38 +0100 From: Rob Kendrick To: Lua list Subject: Function environment table interface Message-ID: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I just had a thought; why are function environments not implemented via a field in a metatable? For example; setmetatable(func, { _env = sometable }) rather than; setfenv(func, sometable) While I can't see how it makes any functional difference to how they are done, it does mean there is only one interface the programmer has to remember rather than one, as well as removing two functions that pollute the global namespace. It also feels more orthogonal and consistent. What am I missing? B. From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 17:31:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66KVHrE027058; Mon, 6 Jul 2009 17:31:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF50118EDF; Mon, 6 Jul 2009 17:30:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f219.google.com (mail-fx0-f219.google.com [209.85.220.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D04B018CDB for ; Mon, 6 Jul 2009 17:30:46 -0300 (BRT) Received: by fxm19 with SMTP id 19so614799fxm.5 for ; Mon, 06 Jul 2009 13:30:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.112.16 with SMTP id u16mr4991415bkp.29.1246912243697; Mon, 06 Jul 2009 13:30:43 -0700 (PDT) In-Reply-To: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> Date: Mon, 6 Jul 2009 21:30:43 +0100 Message-ID: Subject: Re: Function environment table interface From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n66KVHrE027058 Firstly, environment tables are per-function, whereas all functions share a single metatable, so function environments could not be set via metatable. Secondly, separating the environment from the metatable allows for one to be per-instance and one to be per-class. In the case of full userdata, if environment tables were set via metatable, then the common paradigm of setting the metatable to the userdata's class and the environment table for per-instance data would no longer work, as the environment table could not be set per-instance without the metatable being per-instance. On Mon, Jul 6, 2009 at 9:20 PM, Rob Kendrick wrote: > Hi, > > I just had a thought; why are function environments not implemented via > a field in a metatable?  For example; > >        setmetatable(func, { _env = sometable }) > > rather than; > >        setfenv(func, sometable) > > While I can't see how it makes any functional difference to how they > are done, it does mean there is only one interface the programmer has > to remember rather than one, as well as removing two functions that > pollute the global namespace.  It also feels more orthogonal and > consistent. > > What am I missing? > > B. > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 17:37:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66KW3It027227; Mon, 6 Jul 2009 17:32:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5248218F94; Mon, 6 Jul 2009 17:31:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36F1118F56 for ; Mon, 6 Jul 2009 17:31:31 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so1544115qwi.11 for ; Mon, 06 Jul 2009 13:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+mX93ZJzTgZyneGyTSQMJMd+xzQ/R1yojsPHn/v8uv8=; b=G5Q4b+JftABLSgguLCFLv0F8EX3HHiAt+WaZ2GbT4Pn96KXavykxbXko2G2pI5kX0S 8+VnAMS2mC3E6MSZLHkXApf3w+CkPhJTHoGcdEK9Jl8N0VTClmRZeCWxLYYUku5MLH7z skYG/Rkdkp2bGzVO07Z+rS4BR+3/r1cc+Udj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=yIE6vZTNR1Wd1Jjk+cgR0EvdXQ588PJmVSzRIrNg2k66sK8h24V1k8DriRg/PNB2ks vzGZ3l0pxdIP7cAvj8HHatPliHPQyZ/7/YGsFyc7kvhcqdnjB+dTKxv2/Q2ZUMh3US23 vIH4oSojHuxtta+3419odlbyzO7DWid51X6SI= MIME-Version: 1.0 Received: by 10.229.96.10 with SMTP id f10mr2588316qcn.72.1246912289406; Mon, 06 Jul 2009 13:31:29 -0700 (PDT) In-Reply-To: <4A525267.1000209@bitfighter.org> References: <860F2CFC00882245AB73832D5137264C06A3F5B8@EXVBE014-13.exch014.msoutlookonline.net> <4A525267.1000209@bitfighter.org> Date: Mon, 6 Jul 2009 13:31:29 -0700 Message-ID: <17eac67c0907061331k3b95ba71ycd6c8105b0f6f155@mail.gmail.com> Subject: Re: Lunar, C++, and premature object destruction From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 6, 2009 at 12:37 PM, Watusimoto wrote: > Yes, I thought about that... the downside is that it would require a > little more effort on the Lua side (i.e when do you use the object > itself, vs lookup the ID), and I feel it is important to streamline the > Lua coding as much as possible, as it will be exposed to (advanced) > users, not just devs. More streamlined == less documentation == less > support == happier devs :-) Absolutely agree. > And even so, I would still need to handle the situation where some > wayward Lua coder stores a reference (rather than its ID), which would > likely bring the whole game down if the script used it after the > underlying object were deleted. I need to make sure that can't happen. I'm not suggesting that anybody coding in lua even know that lookups are occuring. > If you are interested, I explored some of the alternate strategies here: > > http://stackoverflow.com/questions/1047212/detecting-stale-c-references-in-lua "Now, when the Lua script requests a LuaShip object, I create a new one and hand it off to Lua, and let Lua delete it when it's done with it." "The only drawback is that I'm potentially creating a lot of LuaShip objects, but it's really not that bad." I'm saying, when the script requests a LuaShip object, don't create a new one if one already exists. It's unnecessary. If it already exists, just return the one that exists. Lua has a mechanism called weak tables that allow you to keep track of all LuaShip objects, look them up via the c++ ship pointer, and most importantly, to prevent the existence of the table to count as a "ref" for the purposes of garbage collection. Without the "weakness" of the lookup table, the lookup table itself would prevent LuaShip objects that are no longer referenced by your user's lua code from ever getting garbage collected. Sam From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 18:33:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66LXnMp007621; Mon, 6 Jul 2009 18:33:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 743AA18D9B; Mon, 6 Jul 2009 18:33:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF46E1873F for ; Mon, 6 Jul 2009 18:33:10 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id BBB243AEFE6 for ; Mon, 6 Jul 2009 17:33:06 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 06 Jul 2009 17:33:06 -0400 X-Sasl-enc: jjzJyOsvPUkYtbKcqTG//+bGbG+GFC+orSPkgUi07g2Y 1246915986 Received: from [192.168.1.100] (71-20-247-121.war.clearwire-wmx.net [71.20.247.121]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3B308383C for ; Mon, 6 Jul 2009 17:33:06 -0400 (EDT) Message-ID: <4A526D8B.8010600@bitfighter.org> Date: Mon, 06 Jul 2009 14:32:59 -0700 From: Watusimoto User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Lunar, C++, and premature object destruction References: <860F2CFC00882245AB73832D5137264C06A3F5B4@EXVBE014-13.exch014.msoutlookonline.net> <4A522F02.8080508@bitfighter.org> <17eac67c0907061150y5bdf236bq9a481ea1681f3d34@mail.gmail.com> In-Reply-To: <17eac67c0907061150y5bdf236bq9a481ea1681f3d34@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sam, > One pattern for avoiding overcreation of userdata is to ensure you > never have more than 1 userdata (luaship) > for each C++ object (c++ship). > > When creating a luaship, store it in a global weak table, indexed by > lightuserdata of the c++ship's pointer value. > > Before creating a luaship for a c++ship, look up the pointer value in > the global table, and return the preexisting luaship if possible, only > creating a new luaship if necessary. > > This is an interesting idea, and will probably work well for my situation. I have been thinking of ways to do this on the C++ side, but hadn't considered using weak tables on the Lua side to fit it all together. I'm assuming that the overhead of asking Lua to look up a value in a table is much lower than that of creating a relatively lightweight object directly in C++ (then garbage collecting it later). Presumably the weak table would have weak keys only. So if my current code were: // C++, in Ship LuaShip *Ship::getLuaShip() { return new LuaShip(this); } The new code might be: LuaShip *Ship::getLuaShip() { LuaShip *luaship = findShipInWeakTable(L, this); // Use this as "key" to find LuaShip in Lua table if(luaship) { return luaship; } else { luaship = new LuaShip(this); storeShipInWeakTable(L, this, luaship ); // Store luaship in Lua table, using "this" as key return luaship; } } > In the c++ship's delete, you can then look up any possibly existing > luaship that might have a reference to it, and both zero the pointer > in the userdata, as you are now, and also delete the pointer->luaship > mapping from the global weak table. > Would I need to manually delete the pointer from the weak table, or would gc take care of that once the ship has been deleted? I suppose it wouldn't, as that's an analogous situation to the problem I'm trying to solve. > Lots of variations on this are possible, but they key is using weak > tables with lightuserdata as keys to maintain a mapping from the C++ > world to the lua world. > > Sam > > Thanks for the good advice. Chris From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 18:39:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66LdcKa009327; Mon, 6 Jul 2009 18:39:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9073518CE1; Mon, 6 Jul 2009 18:39:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4736018A0C for ; Mon, 6 Jul 2009 18:39:06 -0300 (BRT) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Mon, 06 Jul 2009 16:37:18 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Jul 2009 17:36:40 -0400 Message-ID: <4A527027.3070708@elbitsystems-us.com> Date: Mon, 06 Jul 2009 17:44:07 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Function environment table interface References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Jul 2009 21:36:40.0250 (UTC) FILETIME=[D90CC9A0:01C9FE81] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Peter Cawley wrote: > On Mon, Jul 6, 2009 at 9:20 PM, Rob Kendrick wrote: >> I just had a thought; why are function environments not implemented via >> a field in a metatable? For example; > Firstly, environment tables are per-function, whereas all functions > share a single metatable, so function environments could not be set > via metatable. Secondly, separating the environment from the metatable > allows for one to be per-instance and one to be per-class. It may be that OP meant also to ask "Why not a per-instance metatable for functions?" If so, I'd recommend a fun journey through these threads: http://lua-users.org/lists/lua-l/2009-05/msg00298.html http://lua-users.org/lists/lua-l/2009-03/msg00479.html IMHO, the short reply to the original question is "performance". Requiring the attachment of a metatable for __env would levy the overhead of a table lookup, possibly a chain of them due to __index, for each function call. I like the general direction you're going - unifying and generalizing - but it seems that separate environments for functions are too useful for such a price to be paid per call. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 18:46:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66LkL4D010829; Mon, 6 Jul 2009 18:46:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D48018F98; Mon, 6 Jul 2009 18:45:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C03B18F02 for ; Mon, 6 Jul 2009 18:45:49 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 4230E3AEFE0 for ; Mon, 6 Jul 2009 17:45:48 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 06 Jul 2009 17:45:48 -0400 X-Sasl-enc: /qJEahLh9oVK2cZ/DXjfwXFX07arTouKAzw+W3nz3/Lj 1246916747 Received: from [192.168.1.100] (71-20-247-121.war.clearwire-wmx.net [71.20.247.121]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8B08F3861 for ; Mon, 6 Jul 2009 17:45:47 -0400 (EDT) Message-ID: <4A527084.7000101@bitfighter.org> Date: Mon, 06 Jul 2009 14:45:40 -0700 From: Watusimoto User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Lunar, C++, and premature object destruction References: <860F2CFC00882245AB73832D5137264C06A3F5B8@EXVBE014-13.exch014.msoutlookonline.net> <4A525267.1000209@bitfighter.org> <17eac67c0907061331k3b95ba71ycd6c8105b0f6f155@mail.gmail.com> In-Reply-To: <17eac67c0907061331k3b95ba71ycd6c8105b0f6f155@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It is interesting that I was just about to start reading the Weak Tables section of PiL. I will now do so with greater enthusiasm! The downside of making the ID scheme transparent is that I'd probably need to implement it for the dozen or so objects that are permanent members of the game (and thus pose no danger of stale references), and that might be a fair bit of coding. I want to present a consistent interface for all these objects, so all need to be handled in the same manner. I think that weak tables will solve the issue of creating an excessive number of objects very nicely. Chris Sam Roberts wrote: > On Mon, Jul 6, 2009 at 12:37 PM, Watusimoto wrote: > >> Yes, I thought about that... the downside is that it would require a >> little more effort on the Lua side (i.e when do you use the object >> itself, vs lookup the ID), and I feel it is important to streamline the >> Lua coding as much as possible, as it will be exposed to (advanced) >> users, not just devs. More streamlined == less documentation == less >> support == happier devs :-) >> > > Absolutely agree. > > >> And even so, I would still need to handle the situation where some >> wayward Lua coder stores a reference (rather than its ID), which would >> likely bring the whole game down if the script used it after the >> underlying object were deleted. I need to make sure that can't happen. >> > > I'm not suggesting that anybody coding in lua even know that lookups > are occuring. > > >> If you are interested, I explored some of the alternate strategies here: >> >> http://stackoverflow.com/questions/1047212/detecting-stale-c-references-in-lua >> > > "Now, when the Lua script requests a LuaShip object, I create a new > one and hand it off to Lua, and let Lua delete it when it's done with > it." > > "The only drawback is that I'm potentially creating a lot of LuaShip > objects, but it's really not that bad." > > I'm saying, when the script requests a LuaShip object, don't create a > new one if one already exists. It's unnecessary. If it already exists, > just return the one that exists. > > Lua has a mechanism called weak tables that allow you to keep track of > all LuaShip objects, look them up via the c++ ship pointer, and most > importantly, to prevent the existence of the table to count as a "ref" > for the purposes of garbage collection. Without the "weakness" of the > lookup table, the lookup table itself would prevent LuaShip objects > that are no longer referenced by your user's lua code from ever > getting garbage collected. > > Sam > > From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 20:20:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66NKf5K024728; Mon, 6 Jul 2009 20:20:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0B4218EDF; Mon, 6 Jul 2009 20:20:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 131AA189C7 for ; Mon, 6 Jul 2009 20:20:03 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MNxTY-0003ZI-De for ; Tue, 07 Jul 2009 00:19:56 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MNxTd-0003aL-NK for lua@bazar2.conectiva.com.br; Tue, 07 Jul 2009 00:20:01 +0100 Date: Tue, 7 Jul 2009 00:20:01 +0100 From: Rob Kendrick To: Lua list Subject: Re: Function environment table interface Message-ID: <20090707002001.0e9120f2@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n66NKf5K024728 On Mon, 6 Jul 2009 21:30:43 +0100 Peter Cawley wrote: > > While I can't see how it makes any functional difference to how they > > are done, it does mean there is only one interface the programmer > > has to remember rather than one, as well as removing two functions > > that pollute the global namespace.  It also feels more orthogonal > > and consistent. > > > > What am I missing? > Firstly, environment tables are per-function, whereas all functions > share a single metatable, so function environments could not be set > via metatable. Secondly, separating the environment from the metatable > allows for one to be per-instance and one to be per-class. I can't quite think of a reason why you'd want the environment to be per-instance, and not some of the other metatable fields, but OK. B. From lua-bounces@bazar2.conectiva.com.br Mon Jul 6 20:22:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n66NMAp8024878; Mon, 6 Jul 2009 20:22:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71C8518FF0; Mon, 6 Jul 2009 20:21:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F74E18BFD for ; Mon, 6 Jul 2009 20:21:45 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MNxVC-0004A8-JV for ; Tue, 07 Jul 2009 00:21:38 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MNxVI-0003lb-0m for lua@bazar2.conectiva.com.br; Tue, 07 Jul 2009 00:21:44 +0100 Date: Tue, 7 Jul 2009 00:21:43 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Function environment table interface Message-ID: <20090707002143.495749b9@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4A527027.3070708@elbitsystems-us.com> References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> <4A527027.3070708@elbitsystems-us.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 06 Jul 2009 17:44:07 -0400 Doug Rogers wrote: > IMHO, the short reply to the original question is "performance". > Requiring the attachment of a metatable for __env would levy the > overhead of a table lookup, possibly a chain of them due to __index, > for each function call. Or at least each function call to a function that had a metatable; a check for such a thing shouldn't be expensive, and short-circuiting things like this has been discussed before. B. From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 04:48:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n677mDCX016800; Tue, 7 Jul 2009 04:48:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DD7419085; Tue, 7 Jul 2009 04:47:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas05p.mx.bigpond.com (nskntmtas05p.mx.bigpond.com [61.9.168.149]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9602018B15 for ; Tue, 7 Jul 2009 04:47:36 -0300 (BRT) Received: from nskntotgx03p.mx.bigpond.com ([124.190.153.145]) by nskntmtas05p.mx.bigpond.com with ESMTP id <20090707074730.EIOT1919.nskntmtas05p.mx.bigpond.com@nskntotgx03p.mx.bigpond.com> for ; Tue, 7 Jul 2009 07:47:30 +0000 Received: from [10.0.0.122] (really [124.190.153.145]) by nskntotgx03p.mx.bigpond.com with ESMTP id <20090707074729.MBWS26776.nskntotgx03p.mx.bigpond.com@[10.0.0.122]> for ; Tue, 7 Jul 2009 07:47:29 +0000 Message-Id: From: Nick Gammon To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Spaces before brackets - acceptable? Date: Tue, 7 Jul 2009 17:47:29 +1000 X-Mailer: Apple Mail (2.935.3) X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150202.4A52FD92.002D,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I have been using Lua for a few years now, and feel comfortable with it. It is incorporated into one of my programs which gets thousands of downloads. However I was recently thrown by a complaint from a user that my examples on my web site are "wrong" because I gave examples like: print ("Hello World") instead of: print("Hello World"") Now we all know that both forms work (with or without the space before the bracket). So, I reached for my copy of Programming in Lua, to set him on his way, explaining that if he only RTFM he would see, that on page XXX it says that white space is not significant. This is where I hit a problem. I seem to recall reading it somewhere, but can't find the page. Searching the online manual on the website for "space" only returns references to things like "stack space". The page about "Some Lexical Conventions" for example, does not mention spaces at all. I note that many of the examples in Programming in Lua actually omit the space when explaining function calls. Even "The Complete Syntax Of Lua" doesn't seem to mention whitespace. Obviously it is needed to separate words like "local" and "function" but that seems to be implied. So please don't laugh, but can someone point me to where it says, on the official documentation, that a space is OK between a function name and the bracket which starts the arguments? Thank you. - Nick Gammon From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 05:11:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n678BE5r018917; Tue, 7 Jul 2009 05:11:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1458119143; Tue, 7 Jul 2009 05:10:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 982D118CE1 for ; Tue, 7 Jul 2009 05:10:47 -0300 (BRT) Received: by pxi28 with SMTP id 28so4086745pxi.33 for ; Tue, 07 Jul 2009 01:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=E86OUb6L44lYDT5mwNZ967ZOl9i5jKxzM/iPBz4zu84=; b=D2yp0LMr+lalqEcPjimk5xfuLbv2lcI8tjyKuC5BPP6hChD8R4/DwXMSGfntlFOqNp DTgTsukKQvKtD+ehRY/ld3YiXn8B8zw0K9kis+2gJhgRZ1OLGfR9Wz7cX2YL0HzguW6w wJua1b3Jzt2vApBP1Qh1XPVEYgrkvM04Kx+lE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=mhggIi5/YztxUaJz7mZVm3THdmxakzPNxnolOYWdB5f6JMwzPMZ7XJfayds5X/Z8RP zGRtyxG/vVK2ZyjS7mQD1bdPv/joJKeP6GrlWIPVzmT5ZaIP+stKBK6LfBEt943BoD6U 4BBOZohyOzDRCbBzZ7uZJRSOk4FvWEHFo6rPk= Received: by 10.115.60.2 with SMTP id n2mr9209551wak.36.1246954245452; Tue, 07 Jul 2009 01:10:45 -0700 (PDT) Received: from ?124.13.54.123? ([124.13.54.123]) by mx.google.com with ESMTPS id j28sm1002097waf.67.2009.07.07.01.10.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 07 Jul 2009 01:10:45 -0700 (PDT) Message-ID: <4A5302FD.6050008@gmail.com> Date: Tue, 07 Jul 2009 16:10:37 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Spaces before brackets - acceptable? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Nick Gammon wrote: > [snip snip] > Even "The Complete Syntax Of Lua" doesn't seem to mention whitespace. > Obviously it is needed to separate words like "local" and "function" but > that seems to be implied. The lexical analyzer separates the input into tokens, so the parser sees tokens only. Whitespace, comments, etc. are removed during lexical analysis. So I guess it's implied, the ref manual kinda expects that you are aware of the two processing phases. > So please don't laugh, but can someone point me to where it says, on the > official documentation, that a space is OK between a function name and > the bracket which starts the arguments? Thank you. I think either one is fine, as long as it is consistent. But then I'm not much of a stickler for particular styles, so YMMV... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 05:23:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n678NQbT019974; Tue, 7 Jul 2009 05:23:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70BF419155; Tue, 7 Jul 2009 05:22:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE440190B4 for ; Tue, 7 Jul 2009 05:22:52 -0300 (BRT) Received: by ewy26 with SMTP id 26so5299351ewy.5 for ; Tue, 07 Jul 2009 01:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=HhKAwjEkOjfWqK0OTb97+PT3AFI0WPUfKZVLukiHvo8=; b=tC+EyiGoEJiz+UjItKofiIugNyNxJ5TKH4eV7d6dStFHFW7mSfsv2XVuejQVBKZjAe MaAIHcxI/wN2yzHtwZYIYSQsRC3zVsQLF1yUoq8nyolUaJPH8PaUiCUI8vygr22mUsfe Tdc2RLeFTjA1mgXk5dP4NflQNn36J4jI1Nqwo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=x2YmluyiYad27hTaCP5GhTXmtPQgA37JgIX+mJTMZdwUdiSBuGc3PD44mNtuj9bEUJ oVxAjHSGkkZqcb5n6Hu8xNezqCrcohXuT22dKQGfg9e2NBWXW5II+CarlEHxkDZzwjy/ kQghljNYc5SMf01kBipRcTPoxWPq3TCznTa58= MIME-Version: 1.0 Received: by 10.216.50.198 with SMTP id z48mr1474498web.227.1246954970172; Tue, 07 Jul 2009 01:22:50 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Tue, 7 Jul 2009 10:22:30 +0200 Message-ID: <89d273ba0907070122r2130edu3bcf630ba0d34266@mail.gmail.com> Subject: Re: Spaces before brackets - acceptable? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/7 Nick Gammon : > I have been using Lua for a few years now, and feel comfortable with it. It > is incorporated into one of my programs which gets thousands of downloads. > However I was recently thrown by a complaint from a user that my examples on > my web site are "wrong" because I gave examples like: > > print ("Hello World") > > instead of: > > print("Hello World"") > > > Now we all know that both forms work (with or without the space before the > bracket). > > So, I reached for my copy of Programming in Lua, to set him on his way, > explaining that if he only RTFM he would see, that on page XXX it says that > white space is not significant. This is where I hit a problem. I seem to > recall reading it somewhere, but can't find the page. Searching the online > manual on the website for "space" only returns references to things like > "stack space". > > The page about "Some Lexical Conventions" for example, does not mention > spaces at all. > > I note that many of the examples in Programming in Lua actually omit the > space when explaining function calls. > > Even "The Complete Syntax Of Lua" doesn't seem to mention whitespace. > Obviously it is needed to separate words like "local" and "function" but > that seems to be implied. > > So please don't laugh, but can someone point me to where it says, on the > official documentation, that a space is OK between a function name and the > bracket which starts the arguments? Thank you. The closest I found is: "As an exception to the free-format syntax of Lua, you cannot put a line break before the '(' in a function call." Why do you need to prove it to that user ? Can't you just point him on this mailing list so that he discredits himself on his own ? From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 06:14:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n679EsN2024665; Tue, 7 Jul 2009 06:14:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC87619180; Tue, 7 Jul 2009 06:14:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5B051914C for ; Tue, 7 Jul 2009 06:14:19 -0300 (BRT) Received: by qyk31 with SMTP id 31so4580535qyk.33 for ; Tue, 07 Jul 2009 02:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bXmwzUoSeG0WesNqRDfH0hNb2HAHI+rGC8ypohnGWD0=; b=KKPECUjmAdm80aZbnKYEXbRabdZGVje7JU/Dd6C6nzV33DQrdwHqq/2d+UzGabAQh5 gFDNGEJVgrHeCo6NnRMPs2a9NHYOnQMc80qCnZeM0sVjLdXFrX46+mfeVLOKA6HEOAXh B1xyLj0jzgL1WP61r2zbsrWLPKVxzBaD4P/XE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v0zUayAxNzoCAnsQn5EJMS8TAVFGsDg+SCQ+FW1NYFIvSu0fQmvWBgt9r7tyJJcEAp SUNxcblGFfb5w6asm9nM/viEfPrufBmRCRnaW98ERLOp2Fc9qZ3RQm2/lBVUNxHLBpwr noPG4Roted9qM8xRLq0EzVa9CjDfOg6k5T8ug= MIME-Version: 1.0 Received: by 10.224.67.16 with SMTP id p16mr6275518qai.180.1246958058113; Tue, 07 Jul 2009 02:14:18 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Jul 2009 02:14:18 -0700 Message-ID: <5ac4e42f0907070214y5e4872e5jc1209a93105d44be@mail.gmail.com> Subject: Re: Spaces before brackets - acceptable? From: Eric Tetz To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Nick Gammon wrote: > I was recently thrown by a complaint from a user that > my examples on my web site are "wrong" because > I gave examples like: > > print ("Hello World") > > instead of: > > print("Hello World"") Then he'd probably lose his mind over stuff like: ( print ) "Hello World" print [[ Hello World]] *lol* In any case, given that whitespace is not significant in most programming languages, and that your examples clearly work, I'd say the burden is on him to show where in the manual it says superfluous whitespace is verboten. From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 06:51:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n679ouEp027830; Tue, 7 Jul 2009 06:50:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E70719180; Tue, 7 Jul 2009 06:50:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1787E18F8D for ; Tue, 7 Jul 2009 06:50:20 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so1058504eyd.41 for ; Tue, 07 Jul 2009 02:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=90FWjWn/Okh2D4Brt3OLkRdMRIi1eRSbE1WYsbRe5tY=; b=x7yK6J8uCxQ/iXxCVdjNmy3hdfKH4E0s4w+2kpdK54ujzrctKQXBuKYNFTAEi+SitX woa1BkYLF4FO/PtmbBqXNtJbltl6kFoV7Kc89MY11Nbicq8jEmWBqRoUSqKlRNjKMqIf Ogl6/SpXrUc2OvoA7VS+5k/ECNUv3Kp02nVqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=quwWChlPgg5PJEBmq1bcUvH3e1EbYEs2qpCOJVSwbxHN6Ylj+/rx30NY2Rxxqs1seH YG5SaB+l9KCCDQX6xUkGt5BPw5rR+piurezvcxwUk2Q/M7YBGBl0VAzlZZVDWgMj53Rz /TCHRiwfAN6+Lp6Q+NF0c0mlX4B5ecPOcxtoc= MIME-Version: 1.0 Received: by 10.216.50.198 with SMTP id z48mr1493345web.227.1246960218775; Tue, 07 Jul 2009 02:50:18 -0700 (PDT) In-Reply-To: <20090707002001.0e9120f2@trite.i.flarn.net.i.flarn.net> References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> <20090707002001.0e9120f2@trite.i.flarn.net.i.flarn.net> From: Jerome Vuarand Date: Tue, 7 Jul 2009 11:49:58 +0200 Message-ID: <89d273ba0907070249x5cc04b3dl5d62628f6f5c9275@mail.gmail.com> Subject: Re: Function environment table interface To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/7 Rob Kendrick : > On Mon, 6 Jul 2009 21:30:43 +0100 > Peter Cawley wrote: > >> > While I can't see how it makes any functional difference to how they >> > are done, it does mean there is only one interface the programmer >> > has to remember rather than one, as well as removing two functions >> > that pollute the global namespace. It also feels more orthogonal >> > and consistent. >> > >> > What am I missing? > >> Firstly, environment tables are per-function, whereas all functions >> share a single metatable, so function environments could not be set >> via metatable. Secondly, separating the environment from the metatable >> allows for one to be per-instance and one to be per-class. > > I can't quite think of a reason why you'd want the environment to be > per-instance, and not some of the other metatable fields, but OK. For example your userdata1 may contain a pointer to another userdata2, so to prevent userdata2 from being collected before userdata1 you may want to keep a reference to userdata2 in some table associated with userdata1. You can then use either the metatable or the environment of userdata1 to store these per-instance references. However, since some metamethods (eq, lt, le) only work if the metatable is shared by several userdata (ie. per-class metatable), you have to use the environment to hold per-instance data. From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 07:55:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67AtEq4002075; Tue, 7 Jul 2009 07:55:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCE45191C8; Tue, 7 Jul 2009 07:54:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BC4319180 for ; Tue, 7 Jul 2009 07:54:42 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MO8Jp-0004Qc-W0 for lua@bazar2.conectiva.com.br; Tue, 07 Jul 2009 10:54:38 +0000 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jul 2009 10:54:37 +0000 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jul 2009 10:54:37 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Spaces before brackets - acceptable? Date: Tue, 07 Jul 2009 12:54:29 +0200 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 07/07/2009 09:47, Nick Gammon wrote: > I was recently thrown by a complaint from a user that > my examples on my web site are "wrong" because I gave examples like: > > print ("Hello World") > > instead of: > > print("Hello World"") > > Now we all know that both forms work (with or without the space before > the bracket). Indeed. Personally, I am too used to x() syntax so I frown when I see x () (but I separate keywords like if/for -- in C or Java) but I wouldn't have the idea to call that "wrong"! At least as long as the lexer is pleased... I noticed that Roberto and Luiz declare functions with the space before the opening parenthesis, but call them without. As said, as long as you are consistent... Because if you write either way, it makes harder to find a call (or definition) with a simple editor. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 08:37:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67BbEMi008148; Tue, 7 Jul 2009 08:37:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CD0E19155; Tue, 7 Jul 2009 08:36:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtprelay-virgin.hostedemail.com (smtprelay-virgin0135.hostedemail.com [64.99.136.135]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 106CC19076 for ; Tue, 7 Jul 2009 08:36:38 -0300 (BRT) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay07.hostedemail.com (Postfix) with SMTP id E3B4B1265D3B for ; Tue, 7 Jul 2009 11:36:33 +0000 (UTC) X-Spam-Summary: 50, 0, 0, dfe46d0106c4a02c, d41d8cd98f00b204, thomas.lauer@virgin.net, lua@bazar2.conectiva.com.br, RULES_HIT:355:379:541:599:601:800:946:960:967:968:973:980:988:989:1260:1277:1311:1313:1314:1345:1358:1359:1437:1487:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1766:1792:2393:2525:2553:2566:2682:2685:2828:2857:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3318:3353:3865:3866:3867:3868:3869:3870:3871:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:3961:4362:4384:5007:6119:6261:7514:7679:7688:7875:7903:8599:8829:8957:8985:9010:9025:9040:9388:10004, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:none, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 74686F6D61732E6C61756572 X-Filterd-Recvd-Size: 2714 Received: from taboche (unknown [92.29.21.92]) (Authenticated sender: thomas.lauer) by omf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2009 11:36:33 +0000 (UTC) From: Thomas Lauer To: Lua list Subject: Re: [ANN] Lua Short Reference, minor upgrade Date: Tue, 07 Jul 2009 12:36:35 +0100 Organization: TL Message-ID: <2mc655pqpedn88b1993lrrbof7rlh80kfq@thomaslauer.com> References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n67BbEMi008148 Thomas Lauer wrote: > The Lua short reference provides a concise summary of the Lua syntax and > core libraries. I have just updated and uploaded another draft of the > 5.1 version. This can be downloaded from either the lua-users.org wiki: > > http://lua-users.org/wiki/LuaShortReference > > or from my website: > > http://thomaslauer.com/comp/Lua_Short_Reference > > A few small errors and inconsistencies were removed. However, there are > certainly still errors and omissions to be found in this draft. PLEASE, > everyone who uses this card -- take the time and trouble to send a bug > report if you happen on something that needs correcting. (BTW, the > exclusion of deprecated language features (like table.setn()) is by > design.) Another draft is available, same locations. I've also prepared a zip file with the two MS Word .doc files used to produce the .pdf files (Microsoft Word 2002 v10.4219). These files are released as-is. http://thomaslauer.com/download/luarefv51.zip Anyone who finds errors and/or omissions and then changes the .doc files locally, PLEASE do send a bug report as well, either via the list or to thomas.lauer@gmail.com so that I can keep my versions up-to-date. > Acknowledgements: Enrico Colombini (the original author) and I are > grateful to all the good people who contributed with notes and > suggestions, including John Belmonte, Albert-Jan Brouwer, Tiago > Dionizio, Marius Gheorghe, Asko Kauppi, Philippe Lhoste, Mike Pall, > Virgil Smith, Ando Sonenblick, Nick Trout, Clemens Wacha, Blake T. > Garretson, mbp, James Salsman and of course Roberto Ierusalimschy, whose > “Lua 5.1 Reference Manual” and “Programming in Lua” have been our main > sources of Lua lore. To whom I'm adding Duncan Cross who found a few errors and niggles. Thanks, guys! -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 09:32:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67CWiws017936; Tue, 7 Jul 2009 09:32:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13AB3191D5; Tue, 7 Jul 2009 09:32:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB444187A3 for ; Tue, 7 Jul 2009 09:32:11 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n67CWBjI005977 for ; Tue, 7 Jul 2009 09:32:11 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id A972C54C11E; Tue, 7 Jul 2009 09:32:11 -0300 (BRT) Date: Tue, 7 Jul 2009 09:32:11 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Spaces before brackets - acceptable? Message-ID: <20090707123211.GA27224@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > [...] > > So please don't laugh, but can someone point me to where it says, on the > official documentation, that a space is OK between a function name and > the bracket which starts the arguments? Thank you. We will add this information to the manual. Thanks for the feedback. -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 09:33:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67CXh12018149; Tue, 7 Jul 2009 09:33:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DFAC19219; Tue, 7 Jul 2009 09:33:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87D3F191E8 for ; Tue, 7 Jul 2009 09:33:21 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67CXKtE018083 for ; Tue, 7 Jul 2009 09:33:20 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n67CXK321174; Tue, 7 Jul 2009 09:33:20 -0300 Date: Tue, 7 Jul 2009 09:33:19 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Spaces before brackets - acceptable? Message-ID: <20090707093319.C21050@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from nick@gammon.com.au on Tue, Jul 07, 2009 at 05:47:29PM +1000 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > can someone point me to where it says, on the official documentation, > that a space is OK between a function name and the bracket which > starts the arguments? Whitespace is not mentioned at all in the reference manual. It is implicit in the BNF at the end that Lua is a free-form language that deals with tokens and that whitespace is not relevant except where needed to separate tokens. Perhaps the manual should be explicit about it, given that whitespace is significant in some languages (e.g., Python). From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 10:30:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67DU7or029476; Tue, 7 Jul 2009 10:30:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A16F61924D; Tue, 7 Jul 2009 10:29:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 870F81918C for ; Tue, 7 Jul 2009 10:29:35 -0300 (BRT) Received: by ewy26 with SMTP id 26so5488353ewy.5 for ; Tue, 07 Jul 2009 06:29:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.102.12 with SMTP id z12mr7206676ebb.5.1246973373618; Tue, 07 Jul 2009 06:29:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Jul 2009 09:29:33 -0400 Message-ID: Subject: Re: Spaces before brackets - acceptable? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 7, 2009 at 6:54 AM, Philippe Lhoste wrote: > Personally, I am too used to x() syntax so I frown when I see x () (but I > separate keywords like if/for -- in C or Java) but I wouldn't have the idea > to call that "wrong"! The no-space form except for keywords/statements is a common convention, even in other languages (e.g. [1]). Many, though not all, of the Lua Programming Gems use it. Some mostly use it but follow the Roberto convention of space inside declarations (which could be consistent since that is not an expression). [1] http://www.amazon.com/Perl-Best-Practices-Damian-Conway/dp/0596001738 From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 10:31:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67DVsne029857; Tue, 7 Jul 2009 10:31:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 585BE19276; Tue, 7 Jul 2009 10:31:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wmproxy1-g27.free.fr (wmproxy1-g27.free.fr [212.27.42.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F5601918C for ; Tue, 7 Jul 2009 10:31:29 -0300 (BRT) Received: from wmproxy1-g27.free.fr (localhost [127.0.0.1]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 59F96633F3 for ; Tue, 7 Jul 2009 15:31:25 +0200 (CEST) Received: from UNKNOWN (imp5-g19.priv.proxad.net [172.20.243.135]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 74314633FE for ; Tue, 7 Jul 2009 15:31:24 +0200 (CEST) Received: by UNKNOWN (Postfix, from userid 0) id 738A6F594F21; Tue, 7 Jul 2009 15:31:24 +0200 (CEST) Received: from ([160.103.2.224,160.103.107.92]) by webmail.free.fr (IMP) with HTTP for ; Tue, 07 Jul 2009 15:31:24 +0200 Message-ID: <1246973484.4a534e2c6d9be@webmail.free.fr> Date: Tue, 07 Jul 2009 15:31:24 +0200 From: matias.guijarro@free.fr To: Lua list Subject: token filter questions References: <20090707093319.C21050@lua.tecgraf.puc-rio.br> In-Reply-To: <20090707093319.C21050@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 160.103.2.224 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I would like to Luiz's token filter facility in order to add runtime function argument type checking in some Lua code, e.g something along the lines of : function F(x :: integer, y :: float) ... do something useful ... end This type checking would be optional. Of course, it would not be limited to integer or float, ideally I would like to be able to define my own types. Is it a good idea to use token filtering ? Does someone already did something similar ? (don't want to reinvent a wheel !) Anyway before starting anything interesting, I have a first problem : the token filter patch doesn't work as I expect ; I just compiled a brand new Lua 5.1.4 with the patch and tried fdebug.lua ; here is what I get : Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("fdebug.lua") > print(1+2) FILTER =stdin FILTER 1 print FILTER 1 ( nil FILTER 1 1 FILTER 1 + nil FILTER 1 2 FILTER 1 ) nil FILTER 1 nil 3 > print(1+2) FILTER 0 nil FILTER 0 nil > Why the second "print" is not displaying the same output ??? I find this very confusing. Thanks in advance for any help, cheers, Matias. From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 10:42:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67DgSpY000705; Tue, 7 Jul 2009 10:42:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B98C1928D; Tue, 7 Jul 2009 10:42:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8247119287 for ; Tue, 7 Jul 2009 10:42:02 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67Dfvwo000426 for ; Tue, 7 Jul 2009 10:41:59 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n67Dfvca000419 for lua@bazar2.conectiva.com.br; Tue, 7 Jul 2009 10:41:57 -0300 Date: Tue, 7 Jul 2009 10:41:56 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: token filter questions Message-ID: <20090707134156.GA32729@duchamp.tecgraf.puc-rio.br> References: <20090707093319.C21050@lua.tecgraf.puc-rio.br> <1246973484.4a534e2c6d9be@webmail.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1246973484.4a534e2c6d9be@webmail.free.fr> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Why the second "print" is not displaying the same > output ??? I find this very confusing. I think this is relevant here: http://lua-users.org/lists/lua-l/2006-09/msg00425.html From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 11:06:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67E6fJ7007596; Tue, 7 Jul 2009 11:06:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6813919286; Tue, 7 Jul 2009 11:06:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wmproxy1-g27.free.fr (wmproxy1-g27.free.fr [212.27.42.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC6DB1924D for ; Tue, 7 Jul 2009 11:06:04 -0300 (BRT) Received: from wmproxy1-g27.free.fr (localhost [127.0.0.1]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 097C0635DA for ; Tue, 7 Jul 2009 16:06:00 +0200 (CEST) Received: from UNKNOWN (imp8-g19.priv.proxad.net [172.20.243.138]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 27DA263587 for ; Tue, 7 Jul 2009 16:05:59 +0200 (CEST) Received: by UNKNOWN (Postfix, from userid 0) id 27085F5EB089; Tue, 7 Jul 2009 16:05:59 +0200 (CEST) Received: from ([160.103.2.224,160.103.107.170]) by webmail.free.fr (IMP) with HTTP for ; Tue, 07 Jul 2009 16:05:59 +0200 Message-ID: <1246975559.4a5356472168a@webmail.free.fr> Date: Tue, 07 Jul 2009 16:05:59 +0200 From: matias.guijarro@free.fr To: Lua list Subject: Re: token filter questions References: <20090707093319.C21050@lua.tecgraf.puc-rio.br> <1246973484.4a534e2c6d9be@webmail.free.fr> <20090707134156.GA32729@duchamp.tecgraf.puc-rio.br> In-Reply-To: <20090707134156.GA32729@duchamp.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 160.103.2.224 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Thanks a lot Luiz, I read archives but I didn't see this one ! Now it works, I can continue investigating this type checking thing... Cheers, Matias. Selon Luiz Henrique de Figueiredo : > > Why the second "print" is not displaying the same > > output ??? I find this very confusing. > > I think this is relevant here: > http://lua-users.org/lists/lua-l/2006-09/msg00425.html > From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 15:11:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67IBcnS005500; Tue, 7 Jul 2009 15:11:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68B43192B9; Tue, 7 Jul 2009 15:11:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0804F19198 for ; Tue, 7 Jul 2009 15:10:56 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id 9FC24EF3BE for ; Tue, 7 Jul 2009 21:10:49 +0300 (EEST) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A059379496C; Tue, 07 Jul 2009 21:10:49 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 7B84A2BD50 for ; Tue, 7 Jul 2009 21:10:45 +0300 (EEST) Message-Id: <1EEA08FE-A9D8-48A9-96B0-BF1D89934A54@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <1246973484.4a534e2c6d9be@webmail.free.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: token filter questions Date: Tue, 7 Jul 2009 21:10:45 +0300 References: <20090707093319.C21050@lua.tecgraf.puc-rio.br> <1246973484.4a534e2c6d9be@webmail.free.fr> X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I suggested this back in Lua Oh Six (2006). Don't know why nothing much has happened on the area. Both luaSub and the other filtering solution do implement it (so look at them instead of rolling your own), but the consensus on the list seemed to be that such "half static" checking would not be required, or that it would be outright negative for the Lua as a language. I never understood this reasoning. About extending with one's own types (i.e. objects that are supposed to have certain fields), luaSub defines the tests by making 'type' and 'assert' be tables (backwards compatible with Lua 5.1 API). So you can do: type.foo= function ... assert.foo= function ... Built-in functions s.a. type.table, type.int, type.number and so on of course exist. Token filtering is the right approach to do this. I did try a patch earlier, but the area is way too complex for a proper patch. That means the patch gets fairly big. I would really like this feature in future Lua. Built-in and allowing the use of even some static type checking tools (s.a. lua-lint) to find those mistakes that can be at compilation time. -asko matias.guijarro@free.fr kirjoitti 7.7.2009 kello 16:31: > Hello, > > I would like to Luiz's token filter facility in order to > add runtime function argument type checking in some Lua > code, e.g something along the lines of : > > function F(x :: integer, y :: float) > ... do something useful ... > end > > This type checking would be optional. Of course, it would > not be limited to integer or float, ideally I would like > to be able to define my own types. > > Is it a good idea to use token filtering ? > Does someone already did something similar ? (don't want > to reinvent a wheel !) > > Anyway before starting anything interesting, I have a first > problem : the token filter patch doesn't work as I expect ; > I just compiled a brand new Lua 5.1.4 with the patch and tried > fdebug.lua ; here is what I get : > > > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio >> dofile("fdebug.lua") >> print(1+2) > FILTER =stdin > FILTER 1 print > FILTER 1 ( nil > FILTER 1 1 > FILTER 1 + nil > FILTER 1 2 > FILTER 1 ) nil > FILTER 1 nil > 3 >> print(1+2) > FILTER 0 nil > FILTER 0 nil >> > > Why the second "print" is not displaying the same > output ??? I find this very confusing. > > Thanks in advance for any help, > cheers, > Matias. > > > > From lua-bounces@bazar2.conectiva.com.br Tue Jul 7 15:26:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n67IQBBJ009397; Tue, 7 Jul 2009 15:26:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10E421929D; Tue, 7 Jul 2009 15:25:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh04.mail.saunalahti.fi (emh04.mail.saunalahti.fi [62.142.5.110]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7960919198 for ; Tue, 7 Jul 2009 15:25:36 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 9B55013B957 for ; Tue, 7 Jul 2009 21:25:23 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A0715699D58; Tue, 07 Jul 2009 21:25:23 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 546EE158A62 for ; Tue, 7 Jul 2009 21:25:21 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <89d273ba0907070249x5cc04b3dl5d62628f6f5c9275@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Function environment table interface Date: Tue, 7 Jul 2009 21:25:21 +0300 References: <20090706212038.7d206a6b@trite.i.flarn.net.i.flarn.net> <20090707002001.0e9120f2@trite.i.flarn.net.i.flarn.net> <89d273ba0907070249x5cc04b3dl5d62628f6f5c9275@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean What could be done though, is to address the userdata's / function's environment table via a similar mechanism as globals (LUA_GLOBALSINDEX) and upvalues (lua_upvalueindex(n)). Let's say our userdata is at stack slot 1. Now: lua_getfenv( L, 1 ); // [-1]: environment table (or nil?) lua_pushliteral( L, "monkey" ); lua_gettable( L, 1 ); // [-1]: value 'env.table["monkey"]' // [-2]: environment table lua_remove(L,-2); Then: lua_pushliteral( L, "monkey" ); lua_gettable( L, lua_envindex(L,1) ); With functions, we could use a system just like 'lua_upvalueindex(n)', treating the function environment as an implicit upvalue (say, upvalue 0). With userdata, we'd need to specify which userdata's environment we need. Maybe the 'lua_getfenv()' and 'lua_setfenv()' functions could be removed, if all userdata and functions had the table automatically created, if needed. In this way, it would serve for making the API thinner. - asko Jerome Vuarand kirjoitti 7.7.2009 kello 12:49: > 2009/7/7 Rob Kendrick : >> On Mon, 6 Jul 2009 21:30:43 +0100 >> Peter Cawley wrote: >> >>>> While I can't see how it makes any functional difference to how >>>> they >>>> are done, it does mean there is only one interface the programmer >>>> has to remember rather than one, as well as removing two functions >>>> that pollute the global namespace. It also feels more orthogonal >>>> and consistent. >>>> >>>> What am I missing? >> >>> Firstly, environment tables are per-function, whereas all functions >>> share a single metatable, so function environments could not be set >>> via metatable. Secondly, separating the environment from the >>> metatable >>> allows for one to be per-instance and one to be per-class. >> >> I can't quite think of a reason why you'd want the environment to be >> per-instance, and not some of the other metatable fields, but OK. > > For example your userdata1 may contain a pointer to another userdata2, > so to prevent userdata2 from being collected before userdata1 you may > want to keep a reference to userdata2 in some table associated with > userdata1. You can then use either the metatable or the environment of > userdata1 to store these per-instance references. > > However, since some metamethods (eq, lt, le) only work if the > metatable is shared by several userdata (ie. per-class metatable), you > have to use the environment to hold per-instance data. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 05:29:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n688TLBG008453; Wed, 8 Jul 2009 05:29:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BFC319300; Wed, 8 Jul 2009 05:28:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp130.mail.mud.yahoo.com (smtp130.mail.mud.yahoo.com [209.191.107.113]) by bazar2.conectiva.com.br (Postfix) with SMTP id BD07C192F9 for ; Wed, 8 Jul 2009 05:28:45 -0300 (BRT) Received: (qmail 3693 invoked from network); 8 Jul 2009 08:28:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent; b=3EocsKEMMaFr3avLsxq9AerYZWtbXIaXKF8VrzZA10bTeciPKXmvslewhcKC/z6xM0RJR31eKtdj2qynMzJOhAoYfHcZQ70mWHvaEH9zr4H+2F1Fg7QPPrsK2F2N0n5wojZVdhAEQiSbCE1+0ImJ38snPmbvG3i4kBUVLGDwQDo= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.167.27 with login) by smtp130.mail.mud.yahoo.com with SMTP; 8 Jul 2009 08:28:43 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: 3A4QCIQVM1lEC52OSME1_VA_lzbSrH51g0QvN7hgRVVY6k1LIwRYS.9n41vV6S7nxp2kOQj6DC8gceMtSIuCI30zYJWrIeOgv.cFaibbH5W9lXhwF3LUr7MsOvMRxIDYMyz7WbvhCQTlAXmxQg62tMu4LPngOVFzPyXyinC7K3R570D6TPkSNugG8B_Unz0AqlM.UQyZVUfgbzU7Wosxo4sJx3ipJRJcIjK8yCvl7y5jAUD0nUFbp_o38c2E9F75u1_03U2xwavs9xzMho315u0kKItTHQYqnQdk9L7gZ7eOu74UmxI- X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id 3A35B8162D; Tue, 7 Jul 2009 17:06:04 +0200 (CEST) Date: Tue, 7 Jul 2009 17:06:04 +0200 From: Martin To: Lua list Subject: alien: global variables in C Message-ID: <20090707150604.GC2685@alfa.qvirt.zxc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean How do I use global variables with alien? I have some global variables in my C library: how do I read or set the value from lua? In my C program I have: int my_global; int get_my_global() { return my_global; } This is only for reading - and it is enough for now. Or similarly how do I get stdout to use it with fprintf function? For now I have created function FILE * get_stdout() { return stdout; } but this only possible if I am interfacing my own c-library. Is there a way to get hold of stdout without writing my own c-library? Martin From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 06:41:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n689fnbp014572; Wed, 8 Jul 2009 06:41:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 704AD19308; Wed, 8 Jul 2009 06:41:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 406EF192A3 for ; Wed, 8 Jul 2009 06:41:14 -0300 (BRT) Received: by bwz8 with SMTP id 8so479446bwz.5 for ; Wed, 08 Jul 2009 02:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=j1BL0oIN8MYAq/rftQfVGz3T6k6uIH4sByPolrO0VPI=; b=DF9juMuE7+pyvMFyuwW9cvxgy8kxUv5Fr9T0zW8EihSq1e4iTa+8c9QnVGhoEwuLYq 6H41n1qWfEuWUfvkwXkTOPPLvG6R/UQapbT+3nG58r8r88EbwprSx0SBs5NB2wTW7ZlA zKJtvZkaSsFQYr8eMqWLlKXeJqsxg8J3HA7QY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=puoggYiJYUYIxrOpx+2Om9jgVQgBpu+W6LDhsB1OBz1h/M8PVvOmev6nF6yBuAFZeC /AC98qW5tcVAgrz6HbN8eXqmOipqSm38FhE0CrXn4POLg5jl/odS4Uf7P4fg+9JjXe2u lbfv3kue32XuuAYsIIBBCtHkNJSV4Wm3kmDPg= MIME-Version: 1.0 Received: by 10.103.167.14 with SMTP id u14mr4086263muo.55.1247046071849; Wed, 08 Jul 2009 02:41:11 -0700 (PDT) In-Reply-To: <20090707150604.GC2685@alfa.qvirt.zxc> References: <20090707150604.GC2685@alfa.qvirt.zxc> Date: Wed, 8 Jul 2009 04:41:11 -0500 Message-ID: Subject: Re: alien: global variables in C From: Jeff Pohlmeyer To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 7, 2009 at 10:06 AM, Martin wrote: > Is there a way to get hold of stdout without writing my own c-library? require "alien" alien.default.fprintf:types("int","pointer","string") alien.default.fdopen:types("pointer","int","string") local stdout=alien.default.fdopen(1,"w") alien.default.fprintf(stdout,"hello world\n") - Jeff From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 09:59:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68CxdRB008867; Wed, 8 Jul 2009 09:59:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAD9919180; Wed, 8 Jul 2009 09:59:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 508C8188C8 for ; Wed, 8 Jul 2009 09:58:58 -0300 (BRT) Received: by bwz8 with SMTP id 8so592368bwz.5 for ; Wed, 08 Jul 2009 05:58:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.63.147 with SMTP id b19mr5420062bki.132.1247057936526; Wed, 08 Jul 2009 05:58:56 -0700 (PDT) Date: Wed, 8 Jul 2009 15:58:56 +0300 X-Google-Sender-Auth: 20e4a3f9b1bc2487 Message-ID: Subject: Why the dot in package.path? ..and finding the source filename From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I was wondering what's the point for current directory (the dot) in package.path? That is, above being a security risk, and not in the control of the script, but the caller...what am I missing? I have to parse package.path to remove those entries. Maybe I'm missing something obvious, I dunno... (somewhat related) I'm guessing debug.getinfo(f).source is available to any script that is dofile()'d, and so to any script that is require()'d and found by the standard disk-searching loaders. If so, it would be nice to have this information available in the modules table for each module. You may argue that this information is not useful without introducing the concept of paths which is not in lua's dictionary, but I would deal with that myself. Cosmin. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 10:12:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68DBu0j011746; Wed, 8 Jul 2009 10:11:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B117E18B3D; Wed, 8 Jul 2009 10:11:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1EA318A35 for ; Wed, 8 Jul 2009 10:11:27 -0300 (BRT) Received: by bwz8 with SMTP id 8so601529bwz.5 for ; Wed, 08 Jul 2009 06:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=8i9rPptLV4qL+lPWqPh01XAK4uh9i075RHaGVTXD9gk=; b=dAEsPz2EkPQaWvtDfZhOkqSNv06tVpZRpfjcFK/hFiDppZNoD/huMJH+Urz+BjbT6q vumaZsxuw5K+EoTVlPCxjWODYwCvwrLRFnnsYFqop7NvEgrkWzLWLZikt/pOwJ8g6jFp sYfxFLm2GzIPXMxnqgCaEu9/lcikHb0B9OeC8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tD3KBKQUszCaX/FX/oGdSsjIAgdiTdZVVW2mtGPESovSjNXNiLYw2s1Q/o+25CLqiI 64Nr+2b9YGmZUUCrFxSf0HM5i/9ry2+QrMAMw2Dy1NqoZJfdakGff/Qt4uBmArRh6XdB HQPI4kT+ZnPMAVq5x35PwMR5XyndFMdhLO7ZE= MIME-Version: 1.0 Received: by 10.239.153.193 with SMTP id a1mr553300hbc.105.1247058685906; Wed, 08 Jul 2009 06:11:25 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Jul 2009 15:11:25 +0200 Message-ID: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> Subject: Re: Why the dot in package.path? ..and finding the source filename From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 8, 2009 at 2:58 PM, Cosmin Apreutesei wrote: > I was wondering what's the point for current directory (the dot) in > package.path? That is, above being a security risk, and not in the > control of the script, but the caller...what am I missing? I have to > parse package.path to remove those entries. Maybe I'm missing > something obvious, I dunno... Well, can always set LUA_PATH explicitly, or just recompile Lua ;) It would be IMHO rather more useful to have something meaning 'directory of current module', so you could deploy an application that just used require() to tie itself together. Currently this takes a certain amount of hacking... steve d. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 10:42:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68DgkUQ018389; Wed, 8 Jul 2009 10:42:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5D68192E2; Wed, 8 Jul 2009 10:42:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wmproxy1-g27.free.fr (wmproxy1-g27.free.fr [212.27.42.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 377AC1924D for ; Wed, 8 Jul 2009 10:42:10 -0300 (BRT) Received: from wmproxy1-g27.free.fr (localhost [127.0.0.1]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 6BBD4635B7 for ; Wed, 8 Jul 2009 15:42:07 +0200 (CEST) Received: from UNKNOWN (imp5-g19.priv.proxad.net [172.20.243.135]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id BDE8F63356 for ; Wed, 8 Jul 2009 15:41:59 +0200 (CEST) Received: by UNKNOWN (Postfix, from userid 0) id BF5691030B157; Wed, 8 Jul 2009 15:41:59 +0200 (CEST) Received: from ([160.103.2.224,160.103.107.92]) by webmail.free.fr (IMP) with HTTP for ; Wed, 08 Jul 2009 15:41:59 +0200 Message-ID: <1247060519.4a54a227bb9c7@webmail.free.fr> Date: Wed, 08 Jul 2009 15:41:59 +0200 From: matias.guijarro@free.fr To: Lua list Subject: [c api] Finding coroutine "parent" References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> In-Reply-To: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 160.103.2.224 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I wonder if there is a way to determine the "parent" lua_State of a coroutine, given its own lua_State. In other words, I am trying to find the lua_State a given coroutine has been created from. Is it possible ? For the moment I am stuck. Thanks in advance, Matias. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 14:54:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68HsM0I017384; Wed, 8 Jul 2009 14:54:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C9BA18B2B; Wed, 8 Jul 2009 14:53:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f219.google.com (mail-fx0-f219.google.com [209.85.220.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DF4318ACF for ; Wed, 8 Jul 2009 14:53:42 -0300 (BRT) Received: by fxm19 with SMTP id 19so1927621fxm.5 for ; Wed, 08 Jul 2009 10:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=rUoArM1w4OFHHpm5HXcf6zf2ugwaPWS7QAy0vFjKmTs=; b=GLMNuhRF6/I91j1h3iOxmFB7pkgQ1G3ha8csVaM3yv7SFsDzihK+xXOw4bMxuoRO3K 1XAl3dJggo8zPauQVhJDzL2ti3Hrak0x6Asv5uxNn7xMmpg7hJKS49d2ioyuXF9JoXHf WKU7DIOsiGTj32SxBMw2v3yDJWq26YpDHxkOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=rNWLzZYUHblOyc1IBb4Tiw5A6e9VpixZc1YovX4Vj4HETcHV3V/DEsJ9RvmCyi0HBQ kAJsrkDpM6H/czefg2KpXIRNC94waUSyVkfbV0xx2UKzb9vMzpDjF0UFjjNrm/apT6RL M5OwqvZ8/aLglieltHqKgDIM0yT2/noWya4KU= Received: by 10.103.212.9 with SMTP id o9mr1428529muq.135.1247075620029; Wed, 08 Jul 2009 10:53:40 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id n7sm2715821mue.58.2009.07.08.10.53.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Jul 2009 10:53:38 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Why the dot in package.path? ..and finding the source filename Date: Wed, 8 Jul 2009 19:53:07 +0200 References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 8, 2009, at 3:11 PM, steve donovan wrote: > It would be IMHO rather more useful to have something meaning > 'directory of current module', so you could deploy an application that > just used require() to tie itself together. Currently this takes a > certain amount of hacking... I would second that... it would indeed be rather handy for modules to seamlessly know where they where loaded from... FWIW, here is the circus I'm going through to load resources relative to their code: http://dev.alt.textdrive.com/browser/HTTP/Bundle.lua If anyone has a more straightforward approach which works for both lua and luac, then I'm all ears :) There was a thread a while back regarding this: "Location of a package" http://lua-users.org/lists/lua-l/2008-02/msg00678.html Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 15:00:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68HxqRM019648; Wed, 8 Jul 2009 14:59:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9273618C55; Wed, 8 Jul 2009 14:59:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C151D18ACF for ; Wed, 8 Jul 2009 14:59:24 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so1293713eyd.41 for ; Wed, 08 Jul 2009 10:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=MAEYarsaFwsuVTGws8D3PXSE8YzWzKwilDF50149v1w=; b=lCbxbzY5daw8jcszG3L9IrsHMPhPMaWUUQA1uBF+yqsm47FkWiH+Hh587tq9KSKOyX oQOTt5EIBwH/aHMfzJEjXXewMIj/LkqC0F1ZHUACff6qjtAispRAXuZAmTMfdJbJ+4qR WGPGf0xCdtUdXICLBnNR8gb5OItPE8MzrjVuY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=T3VpOz6Dnw5Cmkq5M7yBDXO5wn7oLf5dv6oGS0NqdnuZFcGNlDX8J8BXsDJNZ4H/Nx uuIE9SXWvW9QExCxoWGPs6Ac2yj5VbCzWq3mDvZG1cNuMDIQ9fKFQXXDMxVHvyWPrnch UscliCK7J/wwGmnWJTpCs15jcwO63jn3HanUg= MIME-Version: 1.0 Received: by 10.216.8.65 with SMTP id 43mr2032043weq.168.1247075963136; Wed, 08 Jul 2009 10:59:23 -0700 (PDT) In-Reply-To: <1247060519.4a54a227bb9c7@webmail.free.fr> References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> <1247060519.4a54a227bb9c7@webmail.free.fr> From: Jerome Vuarand Date: Wed, 8 Jul 2009 19:59:03 +0200 Message-ID: <89d273ba0907081059t3a3b09dbge6b9e866011ddf29@mail.gmail.com> Subject: Re: [c api] Finding coroutine "parent" To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/8 : > I wonder if there is a way to determine the "parent" lua_State > of a coroutine, given its own lua_State. In other words, I am > trying to find the lua_State a given coroutine has been created > from. > > Is it possible ? > For the moment I am stuck. It is not possible. A coroutine "A" can create a coroutine "B", pass it to a coroutine "C", and terminate. "A" was the creator of "B", but it no longer exists. There is no coroutine ownership mechanism, coroutines are garbage collected objects like tables or functions. From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 15:49:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68InJZe003604; Wed, 8 Jul 2009 15:49:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D15C18C46; Wed, 8 Jul 2009 15:48:48 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C954818B6F for ; Wed, 8 Jul 2009 15:48:42 -0300 (BRT) Received: by vwj37 with SMTP id 37so585240vwj.33 for ; Wed, 08 Jul 2009 11:48:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.76.1 with SMTP id a1mr14753358vck.80.1247078920637; Wed, 08 Jul 2009 11:48:40 -0700 (PDT) Date: Wed, 8 Jul 2009 13:48:40 -0500 Message-ID: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> Subject: using 'uint64_t' with Alien From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016e64ec390124c00046e3630c5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64ec390124c00046e3630c5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit How can I use Alien with C functions which receive and return 'uint64_t' ? Thanks, Phoenix Sol --0016e64ec390124c00046e3630c5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
How can I use Alien with C functions which receive and return 'uint64_t' ?

Thanks,
Phoenix Sol
--0016e64ec390124c00046e3630c5-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 15:54:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68IsnBm005203; Wed, 8 Jul 2009 15:54:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEE5E18D70; Wed, 8 Jul 2009 15:54:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D28918CE6 for ; Wed, 8 Jul 2009 15:54:18 -0300 (BRT) Received: by bwz8 with SMTP id 8so825114bwz.5 for ; Wed, 08 Jul 2009 11:54:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.167.14 with SMTP id u14mr4400582muo.38.1247079256225; Wed, 08 Jul 2009 11:54:16 -0700 (PDT) In-Reply-To: <89d273ba0907081059t3a3b09dbge6b9e866011ddf29@mail.gmail.com> References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> <1247060519.4a54a227bb9c7@webmail.free.fr> <89d273ba0907081059t3a3b09dbge6b9e866011ddf29@mail.gmail.com> Date: Wed, 8 Jul 2009 13:54:16 -0500 Message-ID: <90eb1dc70907081154y2633c098o2be440aa86fa51d7@mail.gmail.com> Subject: Re: [c api] Finding coroutine "parent" From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n68IsnBm005203 On Wed, Jul 8, 2009 at 12:59 PM, Jerome Vuarand wrote: > 2009/7/8  : >> I wonder if there is a way to determine the "parent" lua_State >> of a coroutine, given its own lua_State. In other words, I am >> trying to find the lua_State a given coroutine has been created >> from. >> >> Is it possible ? >> For the moment I am stuck. > > It is not possible. A coroutine "A" can create a coroutine "B", pass > it to a coroutine "C", and terminate. "A" was the creator of "B", but > it no longer exists. There is no coroutine ownership mechanism, > coroutines are garbage collected objects like tables or functions. the full creation tree isn't relevant; but knowing that all those coroutines (or threads, from the C API) belong to the same lua_State is quite valuable. -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 16:19:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68JJb9F011685; Wed, 8 Jul 2009 16:19:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3EBD18D90; Wed, 8 Jul 2009 16:19:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E6BD18BCD for ; Wed, 8 Jul 2009 16:19:04 -0300 (BRT) MailScanner-NULL-Check: 1247685529.27743@nTEs+Q0FDiS57yz8QXeZ2g Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n68JIkYD014081 for ; Wed, 8 Jul 2009 16:18:47 -0300 Message-ID: <4A54F104.4050301@inconcertcc.com> Date: Wed, 08 Jul 2009 16:18:28 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: How to collect as much as possible with collectgarbage() ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted), SpamAssassin (puntaje=-1.8, requerido 5, autolearn=not spam, ALL_TRUSTED -1.80) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi everyone. Maybe this topic has been discussed to death, but I don't fully understand how it is supposed to work. I need to read a huge file from a socket, write it to disk and then call a library which will perform some operations on the file. That library requires lots of memory, and I'm trying to release as much memory as possible before calling into the library (I already got some "not enough memory" errors and I'm trying to avoid that). Given this simple script: local function showMem(msg) print( "Memory used: " .. math.floor(collectgarbage("count")) .. " Kb " .. (msg or "")) end local filename = [[c:\file_50mb.txt]] -- a 50 megabyte file with random data local f = io.open(filename, "rb") showMem() local data = f:read("*a") f:close() f = nil showMem("before collecting") data = nil for i=1,20 do collectgarbage() showMem("after collecting") end I get the following: (under Windows XP SP3, Lua 5.1.4) Memory used: 230 Kb Memory used: 157204 Kb before collecting Memory used: 12997 Kb after collecting Memory used: 3397 Kb after collecting Memory used: 997 Kb after collecting Memory used: 397 Kb after collecting Memory used: 247 Kb after collecting Memory used: 210 Kb after collecting Memory used: 201 Kb after collecting Memory used: 198 Kb after collecting Memory used: 198 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Memory used: 197 Kb after collecting Calling collectgarbage does not free all possible memory, so I suppose that each time it is called, more stuff becomes collectable, until there is nothing more. Short of measuring the memory use and stopping when the used Kbytes don't change between two calls to collectgarbage() (ugly hack!) is there any other way to collect everything? Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 16:22:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68JIH3P011355; Wed, 8 Jul 2009 16:18:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6064718CCC; Wed, 8 Jul 2009 16:17:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f188.google.com (mail-yx0-f188.google.com [209.85.210.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F09218BCD for ; Wed, 8 Jul 2009 16:17:48 -0300 (BRT) Received: by yxe26 with SMTP id 26so8278370yxe.33 for ; Wed, 08 Jul 2009 12:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=3iSVsFUKz5VIfC55J4nY2djLSscnLVkqeof8ukSw5m0=; b=SsWNPn9oWVzxj+H0Krw7jXjEvpLmaVo/CjlaWtSaZY8ak/LK7Vt9gpUtk1ECUBYkYe 9lV9fbfahvMVuivNoKWywzPDyMj7PfU6paux+7agevDoCG2hBodAQ+zI+agjdhP075QW 6+yz+qlQh8wbnIiPYZQjVM47OOv9tGyJev2DY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=CA/Y6R9y3IENeG5Ny/mXvY+UpFKP3xWBFPRFp9YJZc1PPlhLi8YfG2Qu+rIi+U7Vv+ yEQM5C08Eohg008/3DG7Qj02t9+YbKMzQixWsSdyEYtalm9d6K3Ey6q3bfr7MApmAv4W fIV4gN8AVc3tXZTfnJK0qDiGq8id57CZ/de1Q= MIME-Version: 1.0 Received: by 10.151.44.2 with SMTP id w2mr2565924ybj.226.1247080666552; Wed, 08 Jul 2009 12:17:46 -0700 (PDT) In-Reply-To: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> Date: Wed, 8 Jul 2009 16:17:46 -0300 X-Google-Sender-Auth: 772b4d80a436241f Message-ID: <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean No direct support for 64-bit integers right now; adding the type is trivial, the problem is that a 64 bit integer is too big to fit in a Lua number... -- Fabio Mascarenhas On Wed, Jul 8, 2009 at 3:48 PM, Phoenix Sol wrote: > > How can I use Alien with C functions which receive and return 'uint64_t' ? > > Thanks, > Phoenix Sol > From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 16:48:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68Jm9P8020647; Wed, 8 Jul 2009 16:48:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B01E18BCD; Wed, 8 Jul 2009 16:47:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A994B1881C for ; Wed, 8 Jul 2009 16:47:37 -0300 (BRT) Received: by vwj37 with SMTP id 37so623532vwj.33 for ; Wed, 08 Jul 2009 12:47:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.77.17 with SMTP id e17mr14866406vck.3.1247082454671; Wed, 08 Jul 2009 12:47:34 -0700 (PDT) In-Reply-To: <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> Date: Wed, 8 Jul 2009 14:47:34 -0500 Message-ID: <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016e64eabf4b7cc4a046e3702e0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64eabf4b7cc4a046e3702e0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Aha; Thanks, Fabio. So then I need to wrap those C functions with my own, correct? ( I'm still pretty ignorant of C, unfortunately... I wonder if I can do an implicit conversion, and 'shoe-horn' longs in there? I'm about to try it, but do please reply if you have an answer. ) The relevant functions are from 'tcrdb' in tokyotyrant; three which take 'uint64_t' timestamps in microseconds, and two which return them. Is there another way to do this manipulation? Or am I just being silly? (I'm pretty sure I can write *a little C.*) Thanks a heap, Phoenix Sol On Wed, Jul 8, 2009 at 2:17 PM, Fabio Mascarenhas wrote: > No direct support for 64-bit integers right now; adding the type is > trivial, the problem is that a 64 bit integer is too big to fit in a > Lua number... > > -- > Fabio Mascarenhas > > > On Wed, Jul 8, 2009 at 3:48 PM, Phoenix Sol > wrote: > > > > How can I use Alien with C functions which receive and return 'uint64_t' > ? > > > > Thanks, > > Phoenix Sol > > > --0016e64eabf4b7cc4a046e3702e0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Aha; Thanks, Fabio.

So then I need to wrap those C functions with my= own, correct?
( I'm still pretty ignorant of C, unfortunately... I = wonder if I can do an implicit conversion, and 'shoe-horn' longs in= there? I'm about to try it, but do please reply if you have an answer.= )

The relevant functions are from 'tcrdb' in tokyotyrant; three w= hich take 'uint64_t' timestamps in microseconds, and two which retu= rn them.
Is there another way to do this manipulation? Or am I just bein= g silly? (I'm pretty sure I can write a little C.)

Thanks a heap,
Phoenix Sol


On Wed, Jul 8, 2009 at 2:17 PM, Fabio Ma= scarenhas <mascarenhas@acm.org> wrote:
No direct support for 64-bit integers right now; adding the type is
trivial, the problem is that a 64 bit integer is too big to fit in a
Lua number...

--
Fabio Mascarenhas


On Wed, Jul 8, 2009 at 3:48 PM, Phoenix Sol<phoenix@burninglabs.com> wrote:
>
> How can I use Alien with C functions which receive and return 'uin= t64_t' ?
>
> Thanks,
> Phoenix Sol
>

--0016e64eabf4b7cc4a046e3702e0-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 17:03:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68K3Qnf027551; Wed, 8 Jul 2009 17:03:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66D8118C24; Wed, 8 Jul 2009 17:02:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0241718976 for ; Wed, 8 Jul 2009 17:02:45 -0300 (BRT) Received: by qyk31 with SMTP id 31so5634165qyk.33 for ; Wed, 08 Jul 2009 13:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2/FR9lE7h6jknSPPD1Ri68XRetMOhtUjNCvRkIJIObY=; b=KLilY4Bd8dgyrUCPp0JAjzGYDs3hk9J18cG2vlCLLohJPjrd+n31Poi2E1Dp401HuW OxrCEYHphSlo5aFvgg/keaFOZnShZvYFU/hyzhQy9L7u9FDB2lqYR9Wrdqrk/3k+jxhQ l60j0aDA3OGBP6AfS7oM/+qfgoEik3R+ds5WM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MoqoiN5thpk2uz1ySW2FC7T+4eG2kKv3nnjN1FrpaLCWrIifbOIj8VY+6dGLQVn/YW hDFou5X/yg9Iw3vfYAI4riMPaRf6Ywnabi4+Ai/BUFezFDh/2rz3OsVD0Ist1oPbpbp9 I92SezXHi+L2vJLjOFZFv6SLjUuJtfdlgc1tM= MIME-Version: 1.0 Received: by 10.229.110.5 with SMTP id l5mr3605252qcp.88.1247083363742; Wed, 08 Jul 2009 13:02:43 -0700 (PDT) In-Reply-To: <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> Date: Wed, 8 Jul 2009 13:02:41 -0700 Message-ID: <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 8, 2009 at 12:47 PM, Phoenix Sol wrote: > Aha; Thanks, Fabio. > > So then I need to wrap those C functions with my own, correct? > ( I'm still pretty ignorant of C, unfortunately... I wonder if I can do an > implicit conversion, and 'shoe-horn' longs in there? I'm about to try it, > but do please reply if you have an answer. ) > > The relevant functions are from 'tcrdb' in tokyotyrant; three which take > 'uint64_t' timestamps in microseconds, and two which return them. > Is there another way to do this manipulation? Or am I just being silly? (I'm > pretty sure I can write a little C.) I'm not familiar with alien, but I think you'd have to write C code to create a uint64 userdata. Google the list for lots of discussion. But, do people need to do arithmetic on the timestamps? I.e., do they really need to pass them around as numbers? Add them? Divide them? Pass to math.sin()? Probably not. It's convenient to keep timestamps as a numeric type in C, but not in Lua. I'd suggest using a string to pass them around as the decimal representation of usecs, that makes them easy to print, and easy to set. You could even provide library functions: tokyotimestamp.diff(a, b) tokyotimestamp.cmp(a, b) .breakdown(a) -> return seconds and microseconds (easy to do by truncating bottom 6 characters, and then returning tonumber() of the seconds part and microseconds part?) Converting to/from uint64 and a string is easy in C. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 17:15:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68KFjNe030510; Wed, 8 Jul 2009 17:15:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DB0918E8A; Wed, 8 Jul 2009 17:15:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ED0D18976 for ; Wed, 8 Jul 2009 17:15:06 -0300 (BRT) Received: by vwj37 with SMTP id 37so641140vwj.33 for ; Wed, 08 Jul 2009 13:15:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.46.20 with SMTP id h20mr14891079vcf.78.1247084103489; Wed, 08 Jul 2009 13:15:03 -0700 (PDT) In-Reply-To: <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> Date: Wed, 8 Jul 2009 15:15:03 -0500 Message-ID: <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016364ecd80fe5adf046e37642e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364ecd80fe5adf046e37642e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit K; Sounds like good advice; thanks, Sam. To answer your questions re manipulating these timestamps, though: I don't think they require much (or any) manipulation. This is probably overkill, but here are the prototypes I am looking at: /* Restore the database file of a remote database object from the update log. `rdb' specifies the remote database object. `path' specifies the path of the update log directory. `ts' specifies the beginning timestamp in microseconds. `opts' specifies options by bitwise-or: `RDBROCHKCON' for consistency checking. If successful, the return value is true, else, it is false. */ bool tcrdbrestore(TCRDB *rdb, const char *path, uint64_t ts, int opts); /* Set the replication master of a remote database object. `rdb' specifies the remote database object. `host' specifies the name or the address of the server. If it is `NULL', replication of the database is disabled. `port' specifies the port number. `ts' specifies the beginning timestamp in microseconds. `opts' specifies options by bitwise-or: `RDBROCHKCON' for consistency checking. If successful, the return value is true, else, it is false. */ bool tcrdbsetmst(TCRDB *rdb, const char *host, int port, uint64_t ts, int opts); /* Set the replication master of a remote database object with a simple server expression. `rdb' specifies the remote database object. `expr' specifies the simple server expression. It is composed of two substrings separated by ":". The former field specifies the name or the address of the server. The latter field specifies the port number. If the latter field is omitted, the default port number is specified. `ts' specifies the beginning timestamp in microseconds. `opts' specifies options by bitwise-or: `RDBROCHKCON' for consistency checking. If successful, the return value is true, else, it is false. */ bool tcrdbsetmst2(TCRDB *rdb, const char *expr, uint64_t ts, int opts); /* Get the number of records of a remote database object. `rdb' specifies the remote database object. The return value is the number of records or 0 if the object does not connect to any database server. */ uint64_t tcrdbrnum(TCRDB *rdb); /* Get the size of the database of a remote database object. `rdb' specifies the remote database object. The return value is the size of the database or 0 if the object does not connect to any database server. */ uint64_t tcrdbsize(TCRDB *rdb); Phoenix Sol On Wed, Jul 8, 2009 at 3:02 PM, Sam Roberts wrote: > On Wed, Jul 8, 2009 at 12:47 PM, Phoenix Sol > wrote: > > Aha; Thanks, Fabio. > > > > So then I need to wrap those C functions with my own, correct? > > ( I'm still pretty ignorant of C, unfortunately... I wonder if I can do > an > > implicit conversion, and 'shoe-horn' longs in there? I'm about to try it, > > but do please reply if you have an answer. ) > > > > The relevant functions are from 'tcrdb' in tokyotyrant; three which take > > 'uint64_t' timestamps in microseconds, and two which return them. > > Is there another way to do this manipulation? Or am I just being silly? > (I'm > > pretty sure I can write a little C.) > > I'm not familiar with alien, but I think you'd have to write C code to > create a uint64 userdata. > > Google the list for lots of discussion. > > But, do people need to do arithmetic on the timestamps? I.e., do they > really need to pass them around as numbers? Add them? Divide them? > Pass to math.sin()? Probably not. It's convenient to keep timestamps > as a numeric type in C, but not in Lua. > > I'd suggest using a string to pass them around as the decimal > representation of usecs, that makes them easy to print, and easy to > set. You could even provide library functions: > > tokyotimestamp.diff(a, b) > tokyotimestamp.cmp(a, b) > .breakdown(a) -> return seconds and microseconds (easy to do by > truncating bottom 6 characters, and then returning tonumber() of the > seconds part and microseconds part?) > > Converting to/from uint64 and a string is easy in C. > > Cheers, > Sam > --0016364ecd80fe5adf046e37642e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable K; Sounds like good advice; thanks, Sam.

To answer your questions re= manipulating these timestamps, though:
I don't think they require m= uch (or any) manipulation.

This is probably overkill, but here are t= he prototypes I am looking at:

/* Restore the database file of a remote database object from the updat= e log.
=A0=A0 `rdb' specifies the remote database object.
=A0=A0 = `path' specifies the path of the update log directory.
=A0=A0 `ts= 9; specifies the beginning timestamp in microseconds.
=A0=A0 `opts' specifies options by bitwise-or: `RDBROCHKCON' for co= nsistency checking.
=A0=A0 If successful, the return value is true, else= , it is false. */
bool tcrdbrestore(TCRDB *rdb, const char *path, uint64= _t ts, int opts);

/* Set the replication master of a remote database object.
=A0=A0 `r= db' specifies the remote database object.
=A0=A0 `host' specifie= s the name or the address of the server.=A0 If it is `NULL', replicatio= n of the
=A0=A0 database is disabled.
=A0=A0 `port' specifies the port number= .
=A0=A0 `ts' specifies the beginning timestamp in microseconds.
= =A0=A0 `opts' specifies options by bitwise-or: `RDBROCHKCON' for co= nsistency checking.
=A0=A0 If successful, the return value is true, else, it is false. */
bo= ol tcrdbsetmst(TCRDB *rdb, const char *host, int port, uint64_t ts, int opt= s);

/* Set the replication master of a remote database object with a= simple server expression.
=A0=A0 `rdb' specifies the remote database object.
=A0=A0 `expr'= specifies the simple server expression.=A0 It is composed of two substring= s separated
=A0=A0 by ":".=A0 The former field specifies the n= ame or the address of the server.=A0 The latter field
=A0=A0 specifies the port number.=A0 If the latter field is omitted, the de= fault port number is
=A0=A0 specified.
=A0=A0 `ts' specifies the = beginning timestamp in microseconds.
=A0=A0 `opts' specifies options= by bitwise-or: `RDBROCHKCON' for consistency checking.
=A0=A0 If successful, the return value is true, else, it is false. */
bo= ol tcrdbsetmst2(TCRDB *rdb, const char *expr, uint64_t ts, int opts);
/* Get the number of records of a remote database object.
=A0=A0 `rdb&= #39; specifies the remote database object.
=A0=A0 The return value is the number of records or 0 if the object does no= t connect to any database
=A0=A0 server. */
uint64_t tcrdbrnum(TCRDB = *rdb);

/* Get the size of the database of a remote database object.<= br>=A0=A0 `rdb' specifies the remote database object.
=A0=A0 The return value is the size of the database or 0 if the object does= not connect to any
=A0=A0 database server. */
uint64_t tcrdbsize(TCR= DB *rdb);


Phoenix Sol


On Wed, Jul 8, 2009 at 3:02 PM, Sam Robe= rts <vieuxtech@= gmail.com> wrote:
On Wed, Jul 8, 2009 at 12:47 PM, Phoenix Sol<phoenix@burninglabs.com> wrote:<= br> > Aha; Thanks, Fabio.
>
> So then I need to wrap those C functions with my own, correct?
> ( I'm still pretty ignorant of C, unfortunately... I wonder if I c= an do an
> implicit conversion, and 'shoe-horn' longs in there? I'm a= bout to try it,
> but do please reply if you have an answer. )
>
> The relevant functions are from 'tcrdb' in tokyotyrant; three = which take
> 'uint64_t' timestamps in microseconds, and two which return th= em.
> Is there another way to do this manipulation? Or am I just being silly= ? (I'm
> pretty sure I can write a little C.)

I'm not familiar with alien, but I think you'd have to write = C code to
create a uint64 userdata.

Google the list for lots of discussion.

But, do people need to do arithmetic on the timestamps? I.e., do they
really need to pass them around as numbers? Add them? Divide them?
Pass to math.sin()? Probably not. It's convenient to keep timestamps as a numeric type in C, but not in Lua.

I'd suggest using a string to pass them around as the decimal
representation of usecs, that makes them easy to print, and easy to
set. You could even provide library functions:

=A0tokyotimestamp.diff(a, b)
=A0tokyotimestamp.cmp(a, b)
=A0 =A0 =A0.breakdown(a) -> return seconds and microseconds (easy to do= by
truncating bottom 6 characters, and then returning tonumber() of the
seconds part and microseconds part?)

Converting to/from uint64 and a string is easy in C.

Cheers,
Sam

--0016364ecd80fe5adf046e37642e-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 17:42:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n68Kfw7T005677; Wed, 8 Jul 2009 17:41:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7510618BA1; Wed, 8 Jul 2009 17:41:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f215.google.com (mail-gx0-f215.google.com [209.85.217.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30B3718ACF for ; Wed, 8 Jul 2009 17:41:17 -0300 (BRT) Received: by gxk11 with SMTP id 11so8191527gxk.5 for ; Wed, 08 Jul 2009 13:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LhuqncsD4H2vyvkX5BT0o0COm9VU/fGpLB5QgL5XBvc=; b=mDcflYQ99xbgpFPpPtBbbL1vLIiT8pu1Emu/O3U/Q7KLAU0fuHLpk+ov7//hRXObQv 9x0oGkK8JHRTl2h3qvTTYcp1S/Bp44JiDWoa3A6WMhjsUr1VgVZL7r1s8z4ybpMm/p03 RGr0vGGXFmhG9pRs8GTs2Ar9QnehDp5Us7SVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wrFsl8TGgLppVuQRKmnFUdfHYudonx7veXANRATGHd4s6iVOpE7tYK42JGmQUz58BY U3z4IK/FuosvpoXHW7ptU+fiKThCH6iO7Lj3rp0kQ/VBdTR5kKnBywE1o323/vbOeZsw gw4NhWpR4cUY68D2OxKv5qk36UwUJFPNyNJjE= MIME-Version: 1.0 Received: by 10.151.154.8 with SMTP id g8mr2715947ybo.331.1247085675478; Wed, 08 Jul 2009 13:41:15 -0700 (PDT) In-Reply-To: <90eb1dc70907081154y2633c098o2be440aa86fa51d7@mail.gmail.com> References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> <1247060519.4a54a227bb9c7@webmail.free.fr> <89d273ba0907081059t3a3b09dbge6b9e866011ddf29@mail.gmail.com> <90eb1dc70907081154y2633c098o2be440aa86fa51d7@mail.gmail.com> Date: Wed, 8 Jul 2009 16:41:15 -0400 Message-ID: <411299900907081341s375c028dm61001cda3ceb77af@mail.gmail.com> Subject: Re: [c api] Finding coroutine "parent" From: Ben Sunshine-Hill To: Lua list Content-Type: multipart/alternative; boundary=00151750db1cb10000046e37c249 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151750db1cb10000046e37c249 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The simplest solution would probably be to associate threads with unique integers. Wrap coroutine.create such that it generates a new unique integer and stores it in a table, with the newly created thread as (weak) key. With that done, have coroutine.create also look up the creating thread's integer and store it in a different table, with the newly created thread as (weak) key. Ben On Wed, Jul 8, 2009 at 2:54 PM, Javier Guerra wrote: > On Wed, Jul 8, 2009 at 12:59 PM, Jerome Vuarand > wrote: > > 2009/7/8 : > >> I wonder if there is a way to determine the "parent" lua_State > >> of a coroutine, given its own lua_State. In other words, I am > >> trying to find the lua_State a given coroutine has been created > >> from. > >> > >> Is it possible ? > >> For the moment I am stuck. > > > > It is not possible. A coroutine "A" can create a coroutine "B", pass > > it to a coroutine "C", and terminate. "A" was the creator of "B", but > > it no longer exists. There is no coroutine ownership mechanism, > > coroutines are garbage collected objects like tables or functions. > > the full creation tree isn't relevant; but knowing that all those > coroutines (or threads, from the C API) belong to the same lua_State > is quite valuable. > > -- > Javier > --00151750db1cb10000046e37c249 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The simplest solution would probably be to associate threads with unique in= tegers. Wrap coroutine.create such that it generates a new unique integer a= nd stores it in a table, with the newly created thread as (weak) key. With = that done, have coroutine.create also look up the creating thread's int= eger and store it in a different table, with the newly created thread as (w= eak) key.

Ben

On Wed, Jul 8, 2009 at 2:54 PM, J= avier Guerra <ja= vier@guerrag.com> wrote:
On Wed, Jul 8, 2009 at 12:59 PM, Jerome V= uarand<jerome.vuarand@gmail.= com> wrote:
> 2009/7/8 =A0<matias.guij= arro@free.fr>:
>> I wonder if there is a way to determine the "parent" lua= _State
>> of a coroutine, given its own lua_State. In other words, I am
>> trying to find the lua_State a given coroutine has been created >> from.
>>
>> Is it possible ?
>> For the moment I am stuck.
>
> It is not possible. A coroutine "A" can create a coroutine &= quot;B", pass
> it to a coroutine "C", and terminate. "A" was the = creator of "B", but
> it no longer exists. There is no coroutine ownership mechanism,
> coroutines are garbage collected objects like tables or functions.

the full creation tree isn't relevant; but knowing that all= those
coroutines (or threads, from the C API) belong to the same lua_State
is quite valuable.

--
Javier

--00151750db1cb10000046e37c249-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 22:42:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n691gG7s020346; Wed, 8 Jul 2009 22:42:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7808718E78; Wed, 8 Jul 2009 22:41:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD97018C46 for ; Wed, 8 Jul 2009 22:41:38 -0300 (BRT) Received: by ewy26 with SMTP id 26so6799452ewy.5 for ; Wed, 08 Jul 2009 18:41:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.116.16 with SMTP id o16mr221324ebc.49.1247103697400; Wed, 08 Jul 2009 18:41:37 -0700 (PDT) In-Reply-To: References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> Date: Wed, 8 Jul 2009 21:41:37 -0400 Message-ID: Subject: Re: Why the dot in package.path? ..and finding the source filename From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 8, 2009 at 1:53 PM, Petite Abeille wrote: > On Jul 8, 2009, at 3:11 PM, steve donovan wrote: >> It would be IMHO rather more useful to have something meaning >> 'directory of current module'... > > I would second that... it would indeed be rather handy for modules to > seamlessly know where they where loaded from... The mapping of module names to file paths is contained inside package.path and package.cpath. You can parse this information yourself--for example, see [1]. That assumes package.path/cpath and the current directory don't change in an incompatible way between when a module is loaded and when you query the path information again. If this is any concern (and I suppose it is not), you may redefine require to immediately compute and store the module path when a module is loaded. [1] http://lua-users.org/lists/lua-l/2008-11/msg00308.html From lua-bounces@bazar2.conectiva.com.br Wed Jul 8 23:30:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n692Up34026521; Wed, 8 Jul 2009 23:30:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B52218CF8; Wed, 8 Jul 2009 23:30:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C24C18CA1 for ; Wed, 8 Jul 2009 23:30:13 -0300 (BRT) Received: by qyk31 with SMTP id 31so5806089qyk.33 for ; Wed, 08 Jul 2009 19:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=R696KBGGsQ2vSoCYvnvaJJ4MXMhwrwRW2kkLwEY7/RQ=; b=cXJdl3BuIMGIMbmv9w8yCsQ78bDH3Wu7lO5C7ysjIX3SRMCcnc8aIpAG+Ol3QZQL7e GPg7llbFxg0BPMCCumF1L3ozi9CLKoMh1c6wUjG0Kx2TmWq9pTvE3FPlaJGYCa1YMVJZ 4doicaqS9X41KKeKlB5Ipq5GEzObw2pFhKKnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hTSfuplv6xkw8JyHnPSZ0ffMsEJoTIXgpE2hF+WjMMc8VjgF6NQa1mq56VbX5oiIL6 O/kuTPH3j5gbiMfGufp7A/qWZEcKPY3MN9qTYkNlj7lM08TUcMkpX6Gp0vicU/lASG+U 1gwQ8ywNKF/27++bhLARL6AGXdMXBUX+fjhHY= MIME-Version: 1.0 Received: by 10.229.82.79 with SMTP id a15mr43358qcl.57.1247106610122; Wed, 08 Jul 2009 19:30:10 -0700 (PDT) In-Reply-To: <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> Date: Wed, 8 Jul 2009 19:30:10 -0700 Message-ID: <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 8, 2009 at 1:15 PM, Phoenix Sol wrote: > K; Sounds like good advice; thanks, Sam. > > To answer your questions re manipulating these timestamps, though: > I don't think they require much (or any) manipulation. > > This is probably overkill, but here are the prototypes I am looking at: Judging from those APIs, something that might work is that for returning uint64, return a lua_Number if it can fit without loss of precision, otherwise a string. So, you'd have to be a bit careful when calling tcrdbsize(), it could return a number or a string. If you really want a number, you would have to call tonumber() on the return value, which will work, it'll just get converted to a large floating point number, and a bit of precision will be lost. For uint64 arguments, do the opposite, if it's already a number, use it. If its a string, call strtoull(). Just a thought. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 00:05:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6935g0o030305; Thu, 9 Jul 2009 00:05:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D534518CAD; Thu, 9 Jul 2009 00:05:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C3F618A97 for ; Thu, 9 Jul 2009 00:05:08 -0300 (BRT) Received: by vwj37 with SMTP id 37so806357vwj.33 for ; Wed, 08 Jul 2009 20:05:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.76.199 with SMTP id d7mr342341vck.74.1247108705664; Wed, 08 Jul 2009 20:05:05 -0700 (PDT) In-Reply-To: <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> Date: Wed, 8 Jul 2009 22:05:05 -0500 Message-ID: <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016e64ec4ae65beb7046e3d1f73 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64ec4ae65beb7046e3d1f73 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks, Sam. I tried doing this: *tyr.tcrdbrnum:types('double', 'pointer')* --( that's *return type, arg type(s)*, in case you don't speak Alien ) ( and Alien will try to convert that double to lua_Number ) for the 'uint64 returning' ones, which gives *'nan'*; and this: *tyr.tcrdbrnum:types('string', 'pointer')* which *segfaults* the program. I'm not going to bother to try with the others, which *take* that type, since I suppose I already need to write some C anyway; better do it 'right' while I'm at it. --( And yes, I decided to go with an Alien binding for now, rather than implement the tyrant protocol in Lua, out of *laziness*. I like Alien; I hope it doesn't bite. )-- Phoenix Sol On Wed, Jul 8, 2009 at 9:30 PM, Sam Roberts wrote: > On Wed, Jul 8, 2009 at 1:15 PM, Phoenix Sol > wrote: > > K; Sounds like good advice; thanks, Sam. > > > > To answer your questions re manipulating these timestamps, though: > > I don't think they require much (or any) manipulation. > > > > This is probably overkill, but here are the prototypes I am looking at: > > Judging from those APIs, something that might work is that for > returning uint64, return a lua_Number if it can fit without loss of > precision, otherwise a string. > > So, you'd have to be a bit careful when calling tcrdbsize(), it could > return a number or a string. If you really want a number, you would > have to call tonumber() on the return value, which will work, it'll > just get converted to a large floating point number, and a bit of > precision will be lost. > > For uint64 arguments, do the opposite, if it's already a number, use > it. If its a string, call strtoull(). > > Just a thought. > > Cheers, > Sam > --0016e64ec4ae65beb7046e3d1f73 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, Sam.

I tried doing this:
=A0 tyr.tcrdbrnum:types('= double', 'pointer')=A0 --( that's return type, arg t= ype(s), in case you don't speak Alien ) ( and Alien will try to con= vert that double to lua_Number )
for the 'uint64 returning' ones, which gives 'nan';<= br>
and this:
=A0 tyr.tcrdbrnum:types('string', 'point= er')
which segfaults the program.

I'm not goin= g to bother to try with the others, which take that type, since I su= ppose I already need to write some C anyway; better do it 'right' w= hile I'm at it.

--( And yes, I decided to go with an Alien binding for now, rather than= implement the tyrant protocol in Lua, out of laziness. I like Alien= ; I hope it doesn't bite. )--

Phoenix Sol


On Wed, Jul 8, 2009 at 9:30 PM, Sam Robe= rts <vieuxtech@= gmail.com> wrote:
On Wed, Jul 8, 2009 at 1:15 PM, Phoenix Sol<phoenix@burninglabs.com> wrote:
> K; Sounds like good advice; thanks, Sam.
>
> To answer your questions re manipulating these timestamps, though:
> I don't think they require much (or any) manipulation.
>
> This is probably overkill, but here are the prototypes I am looking at= :

Judging from those APIs, something that might work is that for
returning uint64, return a lua_Number if it can fit without loss of
precision, otherwise a string.

So, you'd have to be a bit careful when calling tcrdbsize(), it could return a number or a string. If you really want a number, you would
have to call tonumber() on the return value, which will work, it'll
just get converted to a large floating point number, and a bit of
precision will be lost.

For uint64 arguments, do the opposite, if it's already a number, use it. If its a string, call strtoull().

Just a thought.

Cheers,
Sam

--0016e64ec4ae65beb7046e3d1f73-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 00:29:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n693TpYo000718; Thu, 9 Jul 2009 00:29:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D7E818E67; Thu, 9 Jul 2009 00:29:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f193.google.com (mail-qy0-f193.google.com [209.85.221.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA69518B2F for ; Thu, 9 Jul 2009 00:29:27 -0300 (BRT) Received: by qyk31 with SMTP id 31so5824154qyk.33 for ; Wed, 08 Jul 2009 20:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=XsJvJ+DHVmvvHwnpqDwXEAoRmRnqd0Hv9Hl9eRA2GjM=; b=VpbTpmWQ3xdDb9PTqsmAH9PDTwUVXsmNAtAeEypPVCB/ke2vnr05PqKlYZfbUkXukq 8FjoiUJaoDh0UKlSbWv2LjL5dXnv/utCEWQmRINgoPCTDgwlxzfyXzufOWB9KgPvkQH4 Rlg3mbOHeAf93kom/xwj7ImCIr8ZHHQd2xZ1o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LDhMB3hN/WlMAVx7dhELyAdEwH8cS6ueWYXEVAWcDU8hRpR7XVbOFHdY2DRnj8Hw9T a96vC+8gSrczabNoT86CrBMl5rGxzg3HcuhyZle/M7zPP6KkeNz4/TithdmZTcWC7FVp awKh7x54miQr4yWxZlxV96FCEZzX6L3fLxVg0= MIME-Version: 1.0 Received: by 10.229.81.198 with SMTP id y6mr43607qck.106.1247110163946; Wed, 08 Jul 2009 20:29:23 -0700 (PDT) In-Reply-To: <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> Date: Wed, 8 Jul 2009 20:29:23 -0700 Message-ID: <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n693TpYo000718 On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol wrote: > Thanks, Sam. > > I tried doing this: >   tyr.tcrdbrnum:types('double', 'pointer')  --( that's return type, arg > type(s), in case you don't speak Alien ) ( and Alien will try to convert I'd never heard of alien before this post. It doesn't surprise me the things you tried failed. You have to tell alien the truth about the C API, it won't be able to magically figure out what you want it to do. I'd talk to Fabio, I think he could modify Alien (or you could) pretty trivially so that it used decimal strings on the lua side for (u)int64s on the C side. Without that, you aren't going to be able to use Alien, I don't think. Sam From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 00:55:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n693t5xN003840; Thu, 9 Jul 2009 00:55:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4264918E6D; Thu, 9 Jul 2009 00:54:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E41718C93 for ; Thu, 9 Jul 2009 00:54:36 -0300 (BRT) Received: by vwj37 with SMTP id 37so823763vwj.33 for ; Wed, 08 Jul 2009 20:54:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.92.212 with SMTP id s20mr374419vcm.91.1247111675935; Wed, 08 Jul 2009 20:54:35 -0700 (PDT) In-Reply-To: <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> Date: Wed, 8 Jul 2009 22:54:35 -0500 Message-ID: <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016364edd6e707e66046e3dd086 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364edd6e707e66046e3dd086 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sigh; I was ignorantly hoping that these things could be 'implicitly converted' on the C side. ( Though not very optimistic about the result of doing so. ) I really need to make the time to learn C; which shall I give up: sleeping, eating, or my children? ( I've already given up entertainment, social life, and sex. ) Phoenix Sol On Wed, Jul 8, 2009 at 10:29 PM, Sam Roberts wrote: > On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol > wrote: > > Thanks, Sam. > > > > I tried doing this: > > tyr.tcrdbrnum:types('double', 'pointer') --( that's return type, arg > > type(s), in case you don't speak Alien ) ( and Alien will try to convert > > I'd never heard of alien before this post. It doesn't surprise me the > things you tried failed. You have to tell alien the truth about the C > API, it won't be able to magically figure out what you want it to do. > > I'd talk to Fabio, I think he could modify Alien (or you could) pretty > trivially so that it used decimal strings on the lua side for > (u)int64s on the C side. Without that, you aren't going to be able to > use Alien, I don't think. > > Sam > --0016364edd6e707e66046e3dd086 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sigh; I was ignorantly hoping that these things could be 'implicitly co= nverted' on the C side.
( Though not very optimistic about the resul= t of doing so. )

I really need to make the time to learn C; which sh= all I give up: sleeping, eating, or my children?
( I've already given up entertainment, social life, and sex. )

Phoenix Sol


On Wed, Jul 8, 2009 at 10:29 PM, Sam Rob= erts <vieuxtech= @gmail.com> wrote:
On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol<phoenix@burninglabs.com> wrote:
> Thanks, Sam.
>
> I tried doing this:
> =A0 tyr.tcrdbrnum:types('double', 'pointer')=A0 --( th= at's return type, arg
> type(s), in case you don't speak Alien ) ( and Alien will try to c= onvert

I'd never heard of alien before this post. It doesn't surpris= e me the
things you tried failed. You have to tell alien the truth about the C
API, it won't be able to magically figure out what you want it to do.
I'd talk to Fabio, I think he could modify Alien (or you could) pretty<= br> trivially so that it used decimal strings on the lua side for
(u)int64s on the C side. Without that, you aren't going to be able to use Alien, I don't think.

Sam

--0016364edd6e707e66046e3dd086-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 02:13:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n695DmvG010694; Thu, 9 Jul 2009 02:13:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FBE518E8A; Thu, 9 Jul 2009 02:13:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f188.google.com (mail-yx0-f188.google.com [209.85.210.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B538D18C93 for ; Thu, 9 Jul 2009 02:13:14 -0300 (BRT) Received: by yxe26 with SMTP id 26so8847854yxe.33 for ; Wed, 08 Jul 2009 22:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=CdB0C1EkZWtBEpmzKytS7khLgYOzPdbEBKBDQqcXckQ=; b=m4xNsfmFgYWc1ST25WiROHTCBFVm5wFmgU3/0gTdLmNhLj9js9oaYZ2m4wIC6Lvdpk /65AbCs3iZdqGG4dG60+rpPFxTFfMIMcCnI1wC/KpeRriwQw+odfYN0aML/CookiRGie jdKyK6Zfzuv6Eylr1xnnlPOmqiyOS8fCH5rYw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=UMYhH7ORuX1vziK7CUE4MEKyFmgGbqbUJjRDqDTrnY+b3xQdhVKJx3iFALQpZHI3f1 Atam2+qUY8PAmuF6tUbkgcbLRpOvi5J/0Pq5oIzU64YAEB448BqELCDHVvH30AdMAVi5 hdu/84lMErjCgOsswXfnYSp+EyM10D5uhed1E= MIME-Version: 1.0 Received: by 10.151.114.9 with SMTP id r9mr404537ybm.113.1247116393104; Wed, 08 Jul 2009 22:13:13 -0700 (PDT) In-Reply-To: <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> Date: Thu, 9 Jul 2009 02:13:13 -0300 X-Google-Sender-Auth: c09bf3df6a954215 Message-ID: <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> Subject: Re: using 'uint64_t' with Alien From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n695DmvG010694 Phoenix, I just found out about LGMP (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a nice solution for representing 64-bit integers in Lua if you want to hack something up quickly, as it has both arithmetic and bitwise ops if you want to hack something up quickly. If you want to do it by modifying Alien I suggest you check out the head at http://github.com/mascarenhas/alien/tree/master, as I did some refactoring of Alien's code that makes adding new types a little easier. The way I will do it for Alien when I get around to implemeting this, though, is to use a 64-bit long userdata, and have bitops as methods of this userdata's __index metamethod (plus conversion to and from strings, and arithmetic/relational metamethods, of course). -- Fabio Mascarenhas On Thu, Jul 9, 2009 at 2:12 AM, Fabio Mascarenhas wrote: > Phoenix, > > I just found out about LGMP > (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a > nice solution for representing 64-bit integers in Lua if you want to > hack something up quickly, as it has both arithmetic and bitwise ops > if you want to hack something up quickly. If you want to do it by > modifying Alien I suggest you check out the head at > http://github.com/mascarenhas/alien/tree/master, as I did some > refactoring of Alien's code that makes adding new types a little > easier. > > The way I will do it for Alien when I get around to implemeting this, > though, is to use a 64-bit long userdata, and have bitops as methods > of this userdata's __index metamethod (plus conversion to and from > strings, and arithmetic/relational metamethods, of course). > > -- > Fabio Mascarenhas > > > > On Thu, Jul 9, 2009 at 12:54 AM, Phoenix Sol wrote: >> Sigh; I was ignorantly hoping that these things could be 'implicitly >> converted' on the C side. >> ( Though not very optimistic about the result of doing so. ) >> >> I really need to make the time to learn C; which shall I give up: sleeping, >> eating, or my children? >> ( I've already given up entertainment, social life, and sex. ) >> >> Phoenix Sol >> >> >> On Wed, Jul 8, 2009 at 10:29 PM, Sam Roberts wrote: >>> >>> On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol >>> wrote: >>> > Thanks, Sam. >>> > >>> > I tried doing this: >>> >   tyr.tcrdbrnum:types('double', 'pointer')  --( that's return type, arg >>> > type(s), in case you don't speak Alien ) ( and Alien will try to convert >>> >>> I'd never heard of alien before this post. It doesn't surprise me the >>> things you tried failed. You have to tell alien the truth about the C >>> API, it won't be able to magically figure out what you want it to do. >>> >>> I'd talk to Fabio, I think he could modify Alien (or you could) pretty >>> trivially so that it used decimal strings on the lua side for >>> (u)int64s on the C side. Without that, you aren't going to be able to >>> use Alien, I don't think. >>> >>> Sam >> >> > From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 03:06:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6966cnn015411; Thu, 9 Jul 2009 03:06:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78CE518B72; Thu, 9 Jul 2009 03:06:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f175.google.com (mail-pz0-f175.google.com [209.85.222.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F8F018ACF for ; Thu, 9 Jul 2009 03:06:05 -0300 (BRT) Received: by pzk5 with SMTP id 5so263217pzk.33 for ; Wed, 08 Jul 2009 23:06:04 -0700 (PDT) Received: by 10.115.75.14 with SMTP id c14mr696396wal.50.1247119564375; Wed, 08 Jul 2009 23:06:04 -0700 (PDT) Received: from ?192.168.0.7? (64-193-220-123.wco.clearwire-dns.net [64.193.220.123]) by mx.google.com with ESMTPS id m34sm16513114waf.22.2009.07.08.23.06.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Jul 2009 23:06:03 -0700 (PDT) Message-Id: <7362E9F7-5D12-438B-B787-D3FD08196D15@burninglabs.com> From: Phoenix Sol To: Lua list In-Reply-To: <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A341) Mime-Version: 1.0 (iPhone Mail 7A341) Subject: Re: using 'uint64_t' with Alien Date: Thu, 9 Jul 2009 01:04:32 -0500 References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks; You rock, Fabio. Much respect. Phoenix Sol On Jul 9, 2009, at 12:13 AM, Fabio Mascarenhas wrote: > Phoenix, > > I just found out about LGMP > (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a > nice solution for representing 64-bit integers in Lua if you want to > hack something up quickly, as it has both arithmetic and bitwise ops > if you want to hack something up quickly. If you want to do it by > modifying Alien I suggest you check out the head at > http://github.com/mascarenhas/alien/tree/master, as I did some > refactoring of Alien's code that makes adding new types a little > easier. > > The way I will do it for Alien when I get around to implemeting this, > though, is to use a 64-bit long userdata, and have bitops as methods > of this userdata's __index metamethod (plus conversion to and from > strings, and arithmetic/relational metamethods, of course). > > -- > Fabio Mascarenhas > > On Thu, Jul 9, 2009 at 2:12 AM, Fabio Mascarenhas > wrote: >> Phoenix, >> >> I just found out about LGMP >> (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a >> nice solution for representing 64-bit integers in Lua if you want to >> hack something up quickly, as it has both arithmetic and bitwise ops >> if you want to hack something up quickly. If you want to do it by >> modifying Alien I suggest you check out the head at >> http://github.com/mascarenhas/alien/tree/master, as I did some >> refactoring of Alien's code that makes adding new types a little >> easier. >> >> The way I will do it for Alien when I get around to implemeting this, >> though, is to use a 64-bit long userdata, and have bitops as methods >> of this userdata's __index metamethod (plus conversion to and from >> strings, and arithmetic/relational metamethods, of course). >> >> -- >> Fabio Mascarenhas >> >> >> >> On Thu, Jul 9, 2009 at 12:54 AM, Phoenix >> Sol wrote: >>> Sigh; I was ignorantly hoping that these things could be 'implicitly >>> converted' on the C side. >>> ( Though not very optimistic about the result of doing so. ) >>> >>> I really need to make the time to learn C; which shall I give up: >>> sleeping, >>> eating, or my children? >>> ( I've already given up entertainment, social life, and sex. ) >>> >>> Phoenix Sol >>> >>> >>> On Wed, Jul 8, 2009 at 10:29 PM, Sam Roberts >>> wrote: >>>> >>>> On Wed, Jul 8, 2009 at 8:05 PM, Phoenix >>>> Sol >>>> wrote: >>>>> Thanks, Sam. >>>>> >>>>> I tried doing this: >>>>> tyr.tcrdbrnum:types('double', 'pointer') --( that's return >>>>> type, arg >>>>> type(s), in case you don't speak Alien ) ( and Alien will try to >>>>> convert >>>> >>>> I'd never heard of alien before this post. It doesn't surprise me >>>> the >>>> things you tried failed. You have to tell alien the truth about >>>> the C >>>> API, it won't be able to magically figure out what you want it to >>>> do. >>>> >>>> I'd talk to Fabio, I think he could modify Alien (or you could) >>>> pretty >>>> trivially so that it used decimal strings on the lua side for >>>> (u)int64s on the C side. Without that, you aren't going to be >>>> able to >>>> use Alien, I don't think. >>>> >>>> Sam >>> >>> >> From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 06:27:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n699R3w6000776; Thu, 9 Jul 2009 06:27:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F3EC18C93; Thu, 9 Jul 2009 06:26:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23BF518B1F for ; Thu, 9 Jul 2009 06:26:20 -0300 (BRT) Received: by fxm11 with SMTP id 11so28115fxm.5 for ; Thu, 09 Jul 2009 02:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=9RfOWIMhkjrhIpfV0P0z1HD8cP4DAQsAu+e3VoQQon8=; b=GBkbv+qYBzJhVQLsdCDAbK32OHPbQRdF+wl3+xH5d2aWt3oY7IesB52cDnmM5s22sG D1HTu8cE3CZgaROEDO+NyJcFH5WKV4dNqskyqC0IF0ka4sk2KQpNPSa9Ijit3ZccMZtT BSkOP6s03GZgyw1ITASJcqoW9Zw4N/SSIcub4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=BWi0Py0hItOHNdIS2L6uN7JvXIuK/cmvQnA9ej/2Y6rft8qsHjM8ZVPcH8CTm9heAQ RxbwgLElyTpILm4KUbJ2LfYThe8fObJmzdd4i7ztynUFce70u+YOcpcE0B6lMhjqFRL7 Cu4U/6/7mUsjfBGfSkLu8O+p+4sol5Q+wYjTQ= Received: by 10.103.167.14 with SMTP id u14mr302296muo.55.1247131578138; Thu, 09 Jul 2009 02:26:18 -0700 (PDT) Received: from ?95.78.67.36? ([95.78.67.36]) by mx.google.com with ESMTPS id s10sm18484624muh.27.2009.07.09.02.26.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jul 2009 02:26:17 -0700 (PDT) Date: Thu, 9 Jul 2009 13:26:09 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1876584377.20090709132609@gmail.com> To: Fabio Mascarenhas Subject: Re[2]: using 'uint64_t' with Alien In-Reply-To: <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <7913df4d0907081217i26e2188cnaf98be3ebceefaba@mail.gmail.com> <8a25d01b0907081247i246ef425tcdab4e586ffa4e7d@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Fabio, Thursday, July 9, 2009, 9:13:13 AM, you wrote: LGMP implements unbounded integers. it is somewhat overkill for 64-bit integers that have more efficient representation > Phoenix, > I just found out about LGMP > (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a > nice solution for representing 64-bit integers in Lua if you want to > hack something up quickly, as it has both arithmetic and bitwise ops > if you want to hack something up quickly. If you want to do it by > modifying Alien I suggest you check out the head at > http://github.com/mascarenhas/alien/tree/master, as I did some > refactoring of Alien's code that makes adding new types a little > easier. > The way I will do it for Alien when I get around to implemeting this, > though, is to use a 64-bit long userdata, and have bitops as methods > of this userdata's __index metamethod (plus conversion to and from > strings, and arithmetic/relational metamethods, of course). > -- > Fabio Mascarenhas > On Thu, Jul 9, 2009 at 2:12 AM, Fabio > Mascarenhas wrote: >> Phoenix, >> >> I just found out about LGMP >> (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a >> nice solution for representing 64-bit integers in Lua if you want to >> hack something up quickly, as it has both arithmetic and bitwise ops >> if you want to hack something up quickly. If you want to do it by >> modifying Alien I suggest you check out the head at >> http://github.com/mascarenhas/alien/tree/master, as I did some >> refactoring of Alien's code that makes adding new types a little >> easier. >> >> The way I will do it for Alien when I get around to implemeting this, >> though, is to use a 64-bit long userdata, and have bitops as methods >> of this userdata's __index metamethod (plus conversion to and from >> strings, and arithmetic/relational metamethods, of course). >> >> -- >> Fabio Mascarenhas >> >> >> >> On Thu, Jul 9, 2009 at 12:54 AM, Phoenix Sol wrote: >>> Sigh; I was ignorantly hoping that these things could be 'implicitly >>> converted' on the C side. >>> ( Though not very optimistic about the result of doing so. ) >>> >>> I really need to make the time to learn C; which shall I give up: sleeping, >>> eating, or my children? >>> ( I've already given up entertainment, social life, and sex. ) >>> >>> Phoenix Sol >>> >>> >>> On Wed, Jul 8, 2009 at 10:29 PM, Sam Roberts wrote: >>>> >>>> On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol >>>> wrote: >>>> > Thanks, Sam. >>>> > >>>> > I tried doing this: >>>> >   tyr.tcrdbrnum:types('double', 'pointer')  --( that's return type, arg >>>> > type(s), in case you don't speak Alien ) ( and Alien will try to convert >>>> >>>> I'd never heard of alien before this post. It doesn't surprise me the >>>> things you tried failed. You have to tell alien the truth about the C >>>> API, it won't be able to magically figure out what you want it to do. >>>> >>>> I'd talk to Fabio, I think he could modify Alien (or you could) pretty >>>> trivially so that it used decimal strings on the lua side for >>>> (u)int64s on the C side. Without that, you aren't going to be able to >>>> use Alien, I don't think. >>>> >>>> Sam >>> >>> >> -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 06:27:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n699Rbdt000873; Thu, 9 Jul 2009 06:27:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C101118FCC; Thu, 9 Jul 2009 06:26:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A61D18F12 for ; Thu, 9 Jul 2009 06:26:45 -0300 (BRT) Received: by mail-fx0-f215.google.com with SMTP id 11so28115fxm.5 for ; Thu, 09 Jul 2009 02:26:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.59.14 with SMTP id j14mr540807bkh.39.1247131604994; Thu, 09 Jul 2009 02:26:44 -0700 (PDT) In-Reply-To: References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> Date: Thu, 9 Jul 2009 12:26:44 +0300 X-Google-Sender-Auth: 2513c584186c19fa Message-ID: Subject: Re: Why the dot in package.path? ..and finding the source filename From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I would second that... it would indeed be rather handy for modules to > seamlessly know where they where loaded from... I don't think I'll ever see paths in the core modules (which I don't mind) since lua tries to be transparent to them and wouldn't know how to strip the filename out of a filepath in a portable way. But an opaque filepath as it was given to loadfile() when the module was require()'d seems reasonable. Since it uses user-supplied information to find the file, it might as well tell us back which path worked. From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 10:35:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69DZEKI002499; Thu, 9 Jul 2009 10:35:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3349118A70; Thu, 9 Jul 2009 10:34:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f188.google.com (mail-yx0-f188.google.com [209.85.210.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E50571897B for ; Thu, 9 Jul 2009 10:34:24 -0300 (BRT) Received: by yxe26 with SMTP id 26so233055yxe.33 for ; Thu, 09 Jul 2009 06:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=HyAbCXq53e/psu6ksT4eOgNygO+e/Ecp/4Qm0VU0xSc=; b=Ld9jNUUDag2xwUff8kXTCicTOLs/4upiB9Y971tEgT8MxJnGQ6gUqZwASQT1Ls5LZ1 F/LOH8ZntTzX1Cky0edCJTqaHrJWVplmd5jet3eV3MdDrjNX4MOpn28umofS2Ep+89N/ xPRgrXxeVStWo/xIjUIj++NSikAoyx4Y8uyOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=bSOs8xsZ2Rn92y477KBL+yE0c57q8m2D0SoCbjIz2LtzgPAk/RTcST/wRAJpcywPrs W6ZwscRDC2NLDdUyb0Nt1PVoVv/oCJuh3eDTM4YBuzrHC3aAf7uJ15EolUtny3m3VBKR wt8psGsif38bHcbSYWSAYFXCH8oGVAGCtey18= MIME-Version: 1.0 Received: by 10.151.114.9 with SMTP id r9mr1132842ybm.113.1247146463194; Thu, 09 Jul 2009 06:34:23 -0700 (PDT) In-Reply-To: <1876584377.20090709132609@gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <17eac67c0907081302r21ca7c15qa5341bcef360c304@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> <1876584377.20090709132609@gmail.com> Date: Thu, 9 Jul 2009 10:34:23 -0300 X-Google-Sender-Auth: de3674f733d923ac Message-ID: <7913df4d0907090634l140940a1l9f223aa8a404858b@mail.gmail.com> Subject: Re: Re[2]: using 'uint64_t' with Alien From: Fabio Mascarenhas To: Bulat Ziganshin Content-Type: text/plain; charset=UTF-8 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n69DZEKI002499 On Thu, Jul 9, 2009 at 6:26 AM, Bulat Ziganshin wrote: > Hello Fabio, > > Thursday, July 9, 2009, 9:13:13 AM, you wrote: > > LGMP implements unbounded integers. it is somewhat overkill for 64-bit > integers that have more efficient representation Yep, that is why I said that it is good for a quick hack, but for adding to Alien I prefer to use 64-bit long userdatas and implement all the arithmetic and bitops on those. LGMP is just something Phoenix could use to add 64-bit support to Alien in half-dozen lines of code. -- Fabio Mascarenhas >> Phoenix, > >> I just found out about LGMP >> (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a >> nice solution for representing 64-bit integers in Lua if you want to >> hack something up quickly, as it has both arithmetic and bitwise ops >> if you want to hack something up quickly. If you want to do it by >> modifying Alien I suggest you check out the head at >> http://github.com/mascarenhas/alien/tree/master, as I did some >> refactoring of Alien's code that makes adding new types a little >> easier. > >> The way I will do it for Alien when I get around to implemeting this, >> though, is to use a 64-bit long userdata, and have bitops as methods >> of this userdata's __index metamethod (plus conversion to and from >> strings, and arithmetic/relational metamethods, of course). > >> -- >> Fabio Mascarenhas > >> On Thu, Jul 9, 2009 at 2:12 AM, Fabio >> Mascarenhas wrote: >>> Phoenix, >>> >>> I just found out about LGMP >>> (http://members.chello.nl/~w.couwenberg/lgmp.htm), I think it is a >>> nice solution for representing 64-bit integers in Lua if you want to >>> hack something up quickly, as it has both arithmetic and bitwise ops >>> if you want to hack something up quickly. If you want to do it by >>> modifying Alien I suggest you check out the head at >>> http://github.com/mascarenhas/alien/tree/master, as I did some >>> refactoring of Alien's code that makes adding new types a little >>> easier. >>> >>> The way I will do it for Alien when I get around to implemeting this, >>> though, is to use a 64-bit long userdata, and have bitops as methods >>> of this userdata's __index metamethod (plus conversion to and from >>> strings, and arithmetic/relational metamethods, of course). >>> >>> -- >>> Fabio Mascarenhas >>> >>> >>> >>> On Thu, Jul 9, 2009 at 12:54 AM, Phoenix Sol wrote: >>>> Sigh; I was ignorantly hoping that these things could be 'implicitly >>>> converted' on the C side. >>>> ( Though not very optimistic about the result of doing so. ) >>>> >>>> I really need to make the time to learn C; which shall I give up: sleeping, >>>> eating, or my children? >>>> ( I've already given up entertainment, social life, and sex. ) >>>> >>>> Phoenix Sol >>>> >>>> >>>> On Wed, Jul 8, 2009 at 10:29 PM, Sam Roberts wrote: >>>>> >>>>> On Wed, Jul 8, 2009 at 8:05 PM, Phoenix Sol >>>>> wrote: >>>>> > Thanks, Sam. >>>>> > >>>>> > I tried doing this: >>>>> >   tyr.tcrdbrnum:types('double', 'pointer')  --( that's return type, arg >>>>> > type(s), in case you don't speak Alien ) ( and Alien will try to convert >>>>> >>>>> I'd never heard of alien before this post. It doesn't surprise me the >>>>> things you tried failed. You have to tell alien the truth about the C >>>>> API, it won't be able to magically figure out what you want it to do. >>>>> >>>>> I'd talk to Fabio, I think he could modify Alien (or you could) pretty >>>>> trivially so that it used decimal strings on the lua side for >>>>> (u)int64s on the C side. Without that, you aren't going to be able to >>>>> use Alien, I don't think. >>>>> >>>>> Sam >>>> >>>> >>> > > > > -- > Best regards, >  Bulat                            mailto:Bulat.Ziganshin@gmail.com > > From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 10:58:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69Dwg85008428; Thu, 9 Jul 2009 10:58:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EEBC18FEB; Thu, 9 Jul 2009 10:58:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19BBB18F36 for ; Thu, 9 Jul 2009 10:58:15 -0300 (BRT) Received: by bwz8 with SMTP id 8so186424bwz.5 for ; Thu, 09 Jul 2009 06:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xL99WMjUoo5Y4QeQvMvy/M1yeuOA1D/H6w8v9hX/LW4=; b=uJVWaXOyUqpWCUrF2UROtoehsMzR9iFzyeN2tL+3X0tKqeGqQYqZWDiuC1u+S7XSCk xu8kbqD5bYE6pe2/d8C9XBbVbgUPf1Giqstl0lCAK6oXC/3rcXq7CB3c/mPLaTBIUS+2 WrTOZVG+SKrOMmSHsSly/IpTU+EYlm2mvlvZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ffB18ryXdc8d+PWMq5u411t7+COuCcXqdXqSt3g/SWfGsnC5/ClHYPVgfORquMfQwv 2AjKIMb3UeBmv1jzCE6Rk6WyjCcu/R/kwze7LPet6N29knxYQHCjMT0XxaGkcXUm/M+f itJwIvdUQSm1Y9l2tkPMddjiWHT7vetUuAYao= MIME-Version: 1.0 Received: by 10.239.163.138 with SMTP id p10mr72310hbd.121.1247147893815; Thu, 09 Jul 2009 06:58:13 -0700 (PDT) In-Reply-To: <7913df4d0907090634l140940a1l9f223aa8a404858b@mail.gmail.com> References: <8a25d01b0907081148j18bb4f11k553d2428b460edd4@mail.gmail.com> <8a25d01b0907081315w2e6786bby276e80387879c4aa@mail.gmail.com> <17eac67c0907081930m70ecfab6qa16bf5d63df03293@mail.gmail.com> <8a25d01b0907082005q2bff30a6xf957e53a34d77df1@mail.gmail.com> <17eac67c0907082029v3d28cepb227cc0682fe1e1a@mail.gmail.com> <8a25d01b0907082054o6e514b84m837121156b16237c@mail.gmail.com> <7913df4d0907082212q67900b90we52121baed220868@mail.gmail.com> <7913df4d0907082213w6d6989a8k85f3f95ca0bd6134@mail.gmail.com> <1876584377.20090709132609@gmail.com> <7913df4d0907090634l140940a1l9f223aa8a404858b@mail.gmail.com> Date: Thu, 9 Jul 2009 15:58:13 +0200 Message-ID: <560972290907090658v1d509cc9p3280937eec9e6c30@mail.gmail.com> Subject: Re: Re[2]: using 'uint64_t' with Alien From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 9, 2009 at 3:34 PM, Fabio Mascarenhas wrote: > Yep, that is why I said that it is good for a quick hack, but for > adding to Alien I prefer to use 64-bit long userdatas and implement > all the arithmetic and bitops on those. LGMP is just something Phoenix > could use to add 64-bit support to Alien in half-dozen lines of code. Which in fact would be generally useful when dealing with this common problem, maybe factor it out as 'alien.uint64' like 'alien.struct' steve d. From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 12:25:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69FPMrG031621; Thu, 9 Jul 2009 12:25:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C91F18CA1; Thu, 9 Jul 2009 12:24:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E583718B9F for ; Thu, 9 Jul 2009 12:24:37 -0300 (BRT) Received: by ewy26 with SMTP id 26so277921ewy.5 for ; Thu, 09 Jul 2009 08:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=t/mVBV/TjXDs15VwGn7r4tiVNDDxHiwEWVd2HTuVRhE=; b=pbMOxmRPPXbN3fArG1kCY5zigbNZApBVwI/BRLYK7emLZWF/sDw/eFvYhE0opqzCbN HQaNtz1E1SNSg8/FPQ9ba/7ive2GIn/GM/6BKpX4N+9C+LWKMbl1rp3KUMty2Ukc1cOr WQvnd7Qt0G4pedKh0bc1TR2YRQfnwV9sxZpfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=iKyRpAS4OCYC/jB/9ZfantA0kUsOoTwsQvkdMxZg9CoEXkxHOjqp8HLybL5JY7pjPP jj4sLP/sR+/TxOxbdasmHpdLMuqO9VXYocF0T/2whan5FjFJopp+c9NzfqZzqfcTbt+H XHmpS5jp1ug9nziz9B8vrtwRKH+JamGfo0dHc= MIME-Version: 1.0 Received: by 10.216.74.71 with SMTP id w49mr254694wed.135.1247153076106; Thu, 09 Jul 2009 08:24:36 -0700 (PDT) In-Reply-To: <4A54F104.4050301@inconcertcc.com> References: <4A54F104.4050301@inconcertcc.com> From: Jerome Vuarand Date: Thu, 9 Jul 2009 17:24:16 +0200 Message-ID: <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> Subject: Re: How to collect as much as possible with collectgarbage() ? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n69FPMrG031621 2009/7/8 Ignacio Burgueño : > Hi everyone. Maybe this topic has been discussed to death, but I don't fully > understand how it is supposed to work. > > I need to read a huge file from a socket, write it to disk and then call a > library which will perform some operations on the file. That library > requires lots of memory, and I'm trying to release as much memory as > possible before calling into the library (I already got some "not enough > memory" errors and I'm trying to avoid that). > > Given this simple script: > > local function showMem(msg) > print( "Memory used: " .. math.floor(collectgarbage("count")) .. " Kb " .. > (msg or "")) > end > > local filename = [[c:\file_50mb.txt]] -- a 50 megabyte file with random > data > local f = io.open(filename, "rb") > > showMem() > > local data = f:read("*a") > f:close() > f = nil > > showMem("before collecting") > data = nil > for i=1,20 do > collectgarbage() > showMem("after collecting") > end > > I get the following: (under Windows XP SP3, Lua 5.1.4) > > Memory used: 230 Kb > Memory used: 157204 Kb before collecting > Memory used: 12997 Kb after collecting > Memory used: 3397 Kb after collecting > Memory used: 997 Kb after collecting > Memory used: 397 Kb after collecting > Memory used: 247 Kb after collecting > Memory used: 210 Kb after collecting > Memory used: 201 Kb after collecting > Memory used: 198 Kb after collecting > Memory used: 198 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > Memory used: 197 Kb after collecting > > > > Calling collectgarbage does not free all possible memory, so I suppose that > each time it is called, more stuff becomes collectable, until there is > nothing more. Short of measuring the memory use and stopping when the used > Kbytes don't change between two calls to collectgarbage() (ugly hack!) is > there any other way to collect everything? IIRC the number of cycles necessary depends on the depth of the data to collect. For example t={} t=nil will require one cycle, while t = { t = { t = { t = { t = { t = {} } } } } } will require 6 cycles. Your example quite surprised me, because data is a single string. But I don't know what is the layout of the file userdata and its attached values. So I split your test to see that: Memory used: 30 Kb Memory used: 194776 Kb before collecting file Memory used: 62359 Kb after collecting file Memory used: 52971 Kb after collecting file Memory used: 50624 Kb after collecting file Memory used: 50040 Kb after collecting file Memory used: 49894 Kb after collecting file Memory used: 49858 Kb after collecting file Memory used: 49849 Kb after collecting file Memory used: 49846 Kb after collecting file Memory used: 49846 Kb after collecting file Memory used: 49846 Kb after collecting file Memory used: 49846 Kb before collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data Memory used: 30 Kb after collecting data As you can see data is collected in one cycle, while the file is collected in 8 cycles. I don't think there is a way to predict that number besides knowing exactly how data is structured. What you can do is repeatedly collect until nothing is collected. Here is my script: local function showMem(msg) print( "Memory used: " .. math.floor(collectgarbage("count")) .. " Kb " .. (msg or "")) end local filename = [[c:\file_50mb.txt]] -- a 50 megabyte file with random data local f = io.open(filename, "rb") showMem() local data = f:read("*a") f:close() showMem("before collecting file") f = nil for i=1,10 do collectgarbage() showMem("after collecting file") end showMem("before collecting data") data = nil for i=1,10 do collectgarbage() showMem("after collecting data") end From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 13:30:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69GUnrR016258; Thu, 9 Jul 2009 13:30:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F5C518A27; Thu, 9 Jul 2009 13:30:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 602EF18743 for ; Thu, 9 Jul 2009 13:30:00 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n69GTvqr025277 for ; Thu, 9 Jul 2009 13:29:59 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id B86EC54C11E; Thu, 9 Jul 2009 13:29:57 -0300 (BRT) Date: Thu, 9 Jul 2009 13:29:57 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? Message-ID: <20090709162957.GA8231@inf.puc-rio.br> References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > IIRC the number of cycles necessary depends on the depth of the data > to collect. For example > t={} > t=nil > will require one cycle, while > t = { t = { t = { t = { t = { t = {} } } } } } > will require 6 cycles. That is not true, unless the program uses weak tables. Otherwise a table like the one above should be collected in one cycle. There are three things that may "delay" the release of all available memory. One is weak tables. Another is finalizers: a userdata with a __gc metamethod cannot be collected in the same cycle that runs its finalizer. The third is some internal arrays, such as stacks and buffers. When they are too big, the collector shrinks them by some fixed factor (e.g., it may halve the original size). So, if they are really big, it may take some cycles for them to shrink to a size that the collector will not shrink anymore. Probably what is happening in that program is this: when Lua reads that huge string, an internal buffer grows to accomodate that string. After that, it takes some collections for the buffer to resize to a reasonable size again. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 15:22:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69ILt1d013181; Thu, 9 Jul 2009 15:21:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D24F18ADE; Thu, 9 Jul 2009 15:21:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 205E318994 for ; Thu, 9 Jul 2009 15:21:08 -0300 (BRT) Received: by fxm11 with SMTP id 11so355801fxm.5 for ; Thu, 09 Jul 2009 11:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=j9tncrxdZV5OEVuKxOqJOoY4htKqVz0jmDLUHVzRXAc=; b=M0yEg7BLqIVvRI/OIpNWjLwJ5TteSf66kmrDI9CVTLZjslG4kqRB1R0m7rhmNX8qFL 1IMCs0yJPtIGYzCVjC/M1zrMlDZBEifTSSECGBQ2lEUP1uVHY7ornx3YkHmSJWUYIJCq Mr+/snbwp+lyv0YyRb2uAm84/0DW3hzWvqs2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=KDtlefe/h9nNQjAJ4Uu2zB5T34eDA6gd5rJuafMlc1o7tWDKt+nchk0hoYZZtu9LiJ +vnynvcqbYa0l++crTjedyMR+aVrMA6Tjdeb87ptrC6GWwT4jB1l5zsEFCTfClwDwlup n551FnqfEplwSSHNDeq5n33twmjeLDkGjC5DM= Received: by 10.103.5.2 with SMTP id h2mr402737mui.132.1247163667229; Thu, 09 Jul 2009 11:21:07 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id n10sm666158mue.17.2009.07.09.11.21.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 11:21:06 -0700 (PDT) Message-Id: <2DF81C1F-A7E9-47EF-B718-A4163D6F099B@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Why the dot in package.path? ..and finding the source filename Date: Thu, 9 Jul 2009 20:20:35 +0200 References: <560972290907080611x470858cdp32fb79017621e10@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 9, 2009, at 3:41 AM, David Manura wrote: > The mapping of module names to file paths is contained inside > package.path and package.cpath. You can parse this information > yourself--for example, see [1]. Hmmm... right... but that doesn't address cases where you have multiple modules in one file [1], or one module defined across multiple files [2][3], or multiple modules across multiple files aggregated into one file [4], or code which hasn't been loaded through 'require' [5], or ... pick your poison :) [1] http://dev.alt.textdrive.com/browser/HTTP/URL.lua [2] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua [3] http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua [4] http://dev.alt.textdrive.com/browser/HTTP/Makefile [5] http://dev.alt.textdrive.com/browser/HTTP/Nanoki.lua From lua-bounces@bazar2.conectiva.com.br Thu Jul 9 20:26:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n69NQHpl022903; Thu, 9 Jul 2009 20:26:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23C7718A4B; Thu, 9 Jul 2009 20:25:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4AD15187E4 for ; Thu, 9 Jul 2009 20:25:31 -0300 (BRT) MailScanner-NULL-Check: 1247786719.29045@LHNSXpStDcon4Gzh/gGkjA Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n69NPFod031957 for ; Thu, 9 Jul 2009 20:25:17 -0300 Message-ID: <4A567C4A.1040506@inconcertcc.com> Date: Thu, 09 Jul 2009 20:24:58 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> In-Reply-To: <20090709162957.GA8231@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted), SpamAssassin (puntaje=-4.399, requerido 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: >> IIRC the number of cycles necessary depends on the depth of the data >> to collect. For example >> t={} >> t=nil >> will require one cycle, while >> t = { t = { t = { t = { t = { t = {} } } } } } >> will require 6 cycles. Thanks Jerome, Roberto. > > Probably what is happening in that program is this: when Lua reads > that huge string, an internal buffer grows to accomodate that string. > After that, it takes some collections for the buffer to resize to > a reasonable size again. That would be the luaL_Buffer used in read_chars (@liolib.c), right? I thought that since that structure is in C it wouldn't affect Lua's memory use (i.e, it would release its memory right away once it goes out of scope), but I see it uses the stack. So, I'd have to take care of issuing enough collectgarbage's after reading large files or calling table.concat, right? Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 08:24:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ABNsrB005617; Fri, 10 Jul 2009 08:23:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1803C190D3; Fri, 10 Jul 2009 08:23:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wipro-chn-out02.wipro.com (wipro-chn-out02.wipro.com [203.91.208.7]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2AE018F02 for ; Fri, 10 Jul 2009 08:23:16 -0300 (BRT) X-AuditID: cb5bdd89-b7b5eae00000696a-ba-4a57249b0ee9 Received: from blr-ec-aa01.wipro.com (Unknown_Domain [10.201.18.41]) by wipro-chn-out02.wipro.com (Symantec Mail Security) with SMTP id 96.1D.26986.C94275A4; Fri, 10 Jul 2009 16:53:08 +0530 (IST) Received: from blr-ec-bh01.wipro.com ([10.201.50.91]) by blr-ec-aa01.wipro.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Jul 2009 16:52:46 +0530 Received: from BLR-EC-MBX06.wipro.com ([10.201.50.165]) by blr-ec-bh01.wipro.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Jul 2009 16:52:43 +0530 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: pairs function in lua Date: Fri, 10 Jul 2009 16:52:42 +0530 Message-ID: <6DBC282D20C5094CB66373568D22FE5F010D405D@BLR-EC-MBX06.wipro.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: pairs function in lua Thread-Index: AcoApgKOjo1zmWj2RsGLfvOe60erxwAqScjw References: From: To: X-OriginalArrivalTime: 10 Jul 2009 11:22:43.0329 (UTC) FILETIME=[BE2FB710:01CA0150] X-Brightmail-Tracker: AAAAAQAAAZE= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6ABNsrB005617 Hi, I am not able to understand the behavior for the following lua code. I am expecting The portcardlog () function needs to be called for each pair in slot_tbl, but that was not happening. The portcardlog() function will be calling only once and that's it. Can anybody clarify this behavior. for k,v in pairs(slot_tbl) do portcardlog(k,v) end slot_tbl = { 1="ONE",2="TWO"...} Thanks Abdul Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 08:30:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ABUVDb006735; Fri, 10 Jul 2009 08:30:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE422190FD; Fri, 10 Jul 2009 08:30:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE055190D1 for ; Fri, 10 Jul 2009 08:30:02 -0300 (BRT) Received: by bwz8 with SMTP id 8so751100bwz.5 for ; Fri, 10 Jul 2009 04:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wA4c+Kiy6P30l8JPH3ZCWTq3FJ6ZHt67L1/F/c1CkcU=; b=XN72M6uv2H/QwCu2POOgNsN83+YEPjAL5UAnSYCmxIA5hnuyJ4cQTTJAkFk0Ex5crX VkSc1aZkpb+6J1S+hSm8bXtZex0S76Z4h7zOzWU4hLwq+qYl9EahJGnA6r2PTTFpKX6x 1cbEyFVD1KeX4DT8e70/JUhYEmZO+fcqaDgXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LgssqJDPq4I48YBUDYtnPSNMSCOoMJDrqC33klLBL4yaHi1OrnYWOsOQ4WOV5GobnS vR6fAj8Bnft8BLqQ3V93Nefzi/rWV2o0IMi1gRdbvBsmG/78cmOe40v/2xmi9HSi7zSX VyYdSzMwTsMlvk6l5wibhXiG1NYP3zcp0vWcM= MIME-Version: 1.0 Received: by 10.223.111.140 with SMTP id s12mr899127fap.45.1247225401084; Fri, 10 Jul 2009 04:30:01 -0700 (PDT) In-Reply-To: <6DBC282D20C5094CB66373568D22FE5F010D405D@BLR-EC-MBX06.wipro.com> References: <6DBC282D20C5094CB66373568D22FE5F010D405D@BLR-EC-MBX06.wipro.com> Date: Fri, 10 Jul 2009 12:30:01 +0100 Message-ID: <5fe281d40907100430nd0a9660j26557dcb2138ad76@mail.gmail.com> Subject: Re: pairs function in lua From: Jim Whitehead II To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6ABUVDb006735 On Fri, Jul 10, 2009 at 12:22 PM, wrote: > I am not able to understand the behavior for the following lua code.  I > am expecting > The portcardlog () function needs to be called for each pair in > slot_tbl, but that was > not happening.  The portcardlog() function will be calling only once and > that's it. > Can anybody clarify this behavior. > > >         for k,v in pairs(slot_tbl) do >                portcardlog(k,v) >         end > > slot_tbl = { 1="ONE",2="TWO"...} You will need to provide us with a bit more context. As you can see with a normal function like 'print', the code operates as expected: > slot_tbl = {"ONE", "TWO", "THREE"} > for k,v in pairs(slot_tbl) do >> print(k, v) >> end 1 ONE 2 TWO 3 THREE What could be happening is that the portcardlog function is erroring, causing whatever the overall handler is to exit. For example: > function exitfunc(...) >> print(...) >> os.exit() >> end > slot_tbl = {"ONE", "TWO", "THREE"} > for k,v in pairs(slot_tbl) do >> exitfunc(k, v) >> end 1 ONE Please give us some more information, if you can. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 08:31:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ABV27P006888; Fri, 10 Jul 2009 08:31:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 927AF1912F; Fri, 10 Jul 2009 08:30:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52FFB19107 for ; Fri, 10 Jul 2009 08:30:30 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so237165fgg.5 for ; Fri, 10 Jul 2009 04:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UHQYtDfHEsBX8MBitCZgm2OMwaGei/cYIJjRz3TccF8=; b=gRShFp8qSeewyWJ2rt6gRtD6CMXsKiWcUIoRjJB05YsgWxqA+1pHQN4+UjCc1/Xs3/ sXr9rRFTC9YNHpWzTFux4BbUePsGwQ0LeqPA+WJFETndDLHEowORZJ4G9yLmNH77Uhqh hWkpLpPPx8pFa/UPe/+2lkJH5rZhXQRFIF4vo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PkhxwKX88BkpD5sw6hSr/yXjP2vpXGuGPzC13dARDJxErYVqsIXsj+UY3c1b+u5yCC ttHZvZvd98tKHNt43GpVuBfvvZU9HoOjixt+iFh/zi654CJO73I4DCBIcggRW1zPuf0V PRNdCjlBwRpE8WMzeALunWu1ZYqHGIxNVoOyQ= MIME-Version: 1.0 Received: by 10.239.170.142 with SMTP id s14mr162102hbe.89.1247225428220; Fri, 10 Jul 2009 04:30:28 -0700 (PDT) In-Reply-To: <6DBC282D20C5094CB66373568D22FE5F010D405D@BLR-EC-MBX06.wipro.com> References: <6DBC282D20C5094CB66373568D22FE5F010D405D@BLR-EC-MBX06.wipro.com> Date: Fri, 10 Jul 2009 13:30:28 +0200 Message-ID: <560972290907100430s1f0ee3fy1b3b75fb843d81e8@mail.gmail.com> Subject: Re: pairs function in lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 10, 2009 at 1:22 PM, wrote: > slot_tbl = { 1="ONE",2="TWO"...} Well, this is actually a syntax error; you can only put the keys like this if they are valid identifiers. Now, what do you want this to say: 1) {[1]="ONE",[2}="TWO"} 2) {["1"]="ONE",["2"]="TWO"} These are very different. If it's 1), then why not say? 3) {"ONE","TWO"} If using numeric keys like this, and you _do_ want the order, then use ipairs steve d. From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 08:36:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ABa5cf007575; Fri, 10 Jul 2009 08:36:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FC181911A; Fri, 10 Jul 2009 08:35:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30205190E0 for ; Fri, 10 Jul 2009 08:35:41 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n6ABZeuK023221 for ; Fri, 10 Jul 2009 08:35:40 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 03C9154C11E; Fri, 10 Jul 2009 08:35:41 -0300 (BRT) Date: Fri, 10 Jul 2009 08:35:40 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? Message-ID: <20090710113540.GB9257@inf.puc-rio.br> References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A567C4A.1040506@inconcertcc.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > That would be the luaL_Buffer used in read_chars (@liolib.c), right? No. It is an internal buffer used by the core to perform concats. (luaL_Buffer uses concats to build its results.) > So, I'd have to take care of issuing enough collectgarbage's after > reading large files or calling table.concat, right? Yes, if you really need all the memory back as soon as possible. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 09:01:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6AC1k7V011201; Fri, 10 Jul 2009 09:01:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDDC919012; Fri, 10 Jul 2009 09:01:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f175.google.com (mail-pz0-f175.google.com [209.85.222.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19F1618436 for ; Fri, 10 Jul 2009 09:01:12 -0300 (BRT) Received: by pzk5 with SMTP id 5so622829pzk.33 for ; Fri, 10 Jul 2009 05:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=LTH/Diac7vtc98RPl2PaTdo49maQwrF3k45NYpVo0Jw=; b=HS3Wb9MZ/DB6TKBEcciF8VTjfiMYuutHsOTFKxyRTfs35yC95wUJVdWL3FrLQWjBFo VWQG0X48IMVXNyzBWeTQ0tumuyK6nwMM0EtaBpQxMX6AjctW8YV7+5E/6JAf+spYbwqQ qcqprBuc4rGd6j2vyuKfqw+DC9L7B29PpXlrE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=k/8bRaOEsMD3hUZRivqijPJODdvvNUSVDwQys4dVfADZLLnMu7fiMnSMrXr9aZol/F zvC6UBZz/Qu26Bf3FRgDsOYW3tKG/D3ytoGFbUSkUnNp0ozETVX7iS+x3t9V8c9eauBV SAJbQgjud8zJeWfwbt154XVRT8SCwHkKmNW9U= MIME-Version: 1.0 Received: by 10.143.40.3 with SMTP id s3mr602214wfj.258.1247227271069; Fri, 10 Jul 2009 05:01:11 -0700 (PDT) In-Reply-To: <20090710113540.GB9257@inf.puc-rio.br> References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> <20090710113540.GB9257@inf.puc-rio.br> Date: Fri, 10 Jul 2009 14:01:11 +0200 Message-ID: <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> Subject: Re: How to collect as much as possible with collectgarbage() ? From: Dirk Feytons To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 10, 2009 at 1:35 PM, Roberto Ierusalimschy wrote: >> So, I'd have to take care of issuing enough collectgarbage's after >> reading large files or calling table.concat, right? > > Yes, if you really need all the memory back as soon as possible. To make that a bit easier it would be nice if collectgarbage("collect") returned how much memory it released. On a related note, I've been wondering why collectgarbage("count") returns the current memory use in kilobytes instead of bytes? When using Lua with an integer core instead of floating point we're losing some precision and on an embedded platform those small bytecounts are significant. -- Dirk From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 09:22:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ACMCce014213; Fri, 10 Jul 2009 09:22:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBD6919109; Fri, 10 Jul 2009 09:21:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75E5418A02 for ; Fri, 10 Jul 2009 09:21:36 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0252.bmts.com [209.240.125.252]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n6ACLR7d002392 for ; Fri, 10 Jul 2009 08:21:30 -0400 Message-ID: <4A573247.903@hempeldesigngroup.com> Date: Fri, 10 Jul 2009 08:21:27 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> <20090710113540.GB9257@inf.puc-rio.br> <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> In-Reply-To: <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dirk Feytons wrote: > On Fri, Jul 10, 2009 at 1:35 PM, Roberto > Ierusalimschy wrote: >>> So, I'd have to take care of issuing enough collectgarbage's after >>> reading large files or calling table.concat, right? >> Yes, if you really need all the memory back as soon as possible. > > To make that a bit easier it would be nice if > collectgarbage("collect") returned how much memory it released. > > On a related note, I've been wondering why collectgarbage("count") > returns the current memory use in kilobytes instead of bytes? When > using Lua with an integer core instead of floating point we're losing > some precision and on an embedded platform those small bytecounts are > significant. I posted a note on this exact problem a few months (years?) ago. I suspect that Lua was never intended to run on little micros, but I am certainly happy that it does :-) Making it display bytes now could break a lot of existing code, but it's pretty easy to mod the code to add your own option... Ralph From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 09:31:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ACVVfH015654; Fri, 10 Jul 2009 09:31:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 870691914F; Fri, 10 Jul 2009 09:31:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36F18190FC for ; Fri, 10 Jul 2009 09:31:02 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ACUwux015547 for ; Fri, 10 Jul 2009 09:30:58 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6ACUwX03402; Fri, 10 Jul 2009 09:30:58 -0300 Date: Fri, 10 Jul 2009 09:30:57 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? Message-ID: <20090710093056.A3391@lua.tecgraf.puc-rio.br> References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> <20090710113540.GB9257@inf.puc-rio.br> <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> <4A573247.903@hempeldesigngroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4A573247.903@hempeldesigngroup.com>; from rhempel@hempeldesigngroup.com on Fri, Jul 10, 2009 at 08:21:27AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Making it display bytes now could break a lot of existing code, but > it's pretty easy to mod the code to add your own option... For instance, collectgarbage("count") could return two values: one in K and one in bytes. The change is simple: lbaselib.c: static int luaB_collectgarbage (lua_State *L) { ... case LUA_GCCOUNT: { int b = lua_gc(L, LUA_GCCOUNTB, 0); lua_pushnumber(L, res + ((lua_Number)b/1024)); lua_pushnumber(L, res*1024 + b); <<< return 2; <<< } From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 09:36:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ACaIi6016547; Fri, 10 Jul 2009 09:36:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB0C419172; Fri, 10 Jul 2009 09:35:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DD12190E0 for ; Fri, 10 Jul 2009 09:35:45 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n6ACZiiX028566 for ; Fri, 10 Jul 2009 09:35:44 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 425A354C11E; Fri, 10 Jul 2009 09:35:45 -0300 (BRT) Date: Fri, 10 Jul 2009 09:35:45 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? Message-ID: <20090710123545.GA9924@inf.puc-rio.br> References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> <20090710113540.GB9257@inf.puc-rio.br> <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> <4A573247.903@hempeldesigngroup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A573247.903@hempeldesigngroup.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> On a related note, I've been wondering why collectgarbage("count") >> returns the current memory use in kilobytes instead of bytes? When >> using Lua with an integer core instead of floating point we're losing >> some precision and on an embedded platform those small bytecounts are >> significant. On several machines an int is not large enough to count memory. It seems better to lose precision than the most significant bits. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Jul 10 09:58:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ACwrqi021933; Fri, 10 Jul 2009 09:58:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA92A1916D; Fri, 10 Jul 2009 09:58:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4272A18CCD for ; Fri, 10 Jul 2009 09:58:24 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0252.bmts.com [209.240.125.252]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n6ACwK1j031314 for ; Fri, 10 Jul 2009 08:58:21 -0400 Message-ID: <4A573AEC.9050808@hempeldesigngroup.com> Date: Fri, 10 Jul 2009 08:58:20 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: How to collect as much as possible with collectgarbage() ? References: <4A54F104.4050301@inconcertcc.com> <89d273ba0907090824x449d1099k92f3689677579d14@mail.gmail.com> <20090709162957.GA8231@inf.puc-rio.br> <4A567C4A.1040506@inconcertcc.com> <20090710113540.GB9257@inf.puc-rio.br> <6dfff91b0907100501r272b059cqfad64c75f98d6d09@mail.gmail.com> <4A573247.903@hempeldesigngroup.com> <20090710093056.A3391@lua.tecgraf.puc-rio.br> In-Reply-To: <20090710093056.A3391@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> Making it display bytes now could break a lot of existing code, but >> it's pretty easy to mod the code to add your own option... > > For instance, collectgarbage("count") could return two values: one in K > and one in bytes. The change is simple: And to combine this with Roberto's comment, the first value could be in K, the second is (usage % 1024) :-) Ralph From lua-bounces@bazar2.conectiva.com.br Sat Jul 11 14:59:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6BHxFu0015958; Sat, 11 Jul 2009 14:59:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94CFA18D64; Sat, 11 Jul 2009 14:58:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A256189E9 for ; Sat, 11 Jul 2009 14:58:33 -0300 (BRT) Received: (qmail 32342 invoked from network); 11 Jul 2009 19:58:35 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 11 Jul 2009 19:58:35 +0200 From: Steven Barth To: Lua list Subject: [ANN] nixio 0.3 - System, Networking and I/O library Date: Sat, 11 Jul 2009 19:50:57 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907111950.58415.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Everyone, I'm happy to announce version 0.3 of nixio, a well-documented multipurpose Lua library offering system, networking (IPv4, IPv6 and UNIX), I/O (Files, Pipes, UDP-, TCP-, and TLS-sockets), byte manipulation, hashing and other useful functionality. nixio is FOSS under the Apache 2 license and has been successfully compiled under Linux/glibc, Linux/uClibc, FreeBSD, OpenSolaris and Windows XP and later (using MinGW, no full POSIX support). It's also the base library for my GSoC project this year. Source Tarball: http://dev.luci.freifunk-halle.net/nixio/nixio-0.3.tar.bz2 Documentation: http://dev.luci.freifunk-halle.net/nixio/doc/ Cheers, Steven Changes from version 0.2: * Added getifaddrs() function. * Added getsockopt(), setsockopt(), getsockname() and getpeername() directly to TLS-socket objects unifying the socket interface. * Added support for CyaSSL as cryptographical backend. * Added support for x509 certificates in DER format. * Added support for splice() in UnifiedIO.copyz(). * Added interface to inject chunks into UnifiedIO.linesource() buffer. * Changed TLS behaviour to explicitely separate servers and clients. * Fixed usage of signed datatype breaking Base64 decoding. * Fixed namespace clashes for nixio.fs. * Fixed splice() support for some exotic C libraries. * Reconfigure axTLS cryptographical provider and mark it as obsolete. From lua-bounces@bazar2.conectiva.com.br Sat Jul 11 16:10:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6BJAGuP022155; Sat, 11 Jul 2009 16:10:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD6B6189E9; Sat, 11 Jul 2009 16:09:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f199.google.com (mail-vw0-f199.google.com [209.85.212.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8084B1892B for ; Sat, 11 Jul 2009 16:09:36 -0300 (BRT) Received: by vwj37 with SMTP id 37so1285126vwj.33 for ; Sat, 11 Jul 2009 12:09:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.46.10 with SMTP id h10mr4863865vcf.8.1247339374074; Sat, 11 Jul 2009 12:09:34 -0700 (PDT) In-Reply-To: <200907111950.58415.steven@midlink.org> References: <200907111950.58415.steven@midlink.org> Date: Sat, 11 Jul 2009 14:09:34 -0500 Message-ID: <8a25d01b0907111209j1281cad0i5110114c08b3077f@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016363b86de4e5c61046e72d43e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016363b86de4e5c61046e72d43e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Holy smokes, this looks awesome. Thanks for sharing, Steven. ( I feel like a kid in a toy store playing with it... ) Phoenix Sol On Sat, Jul 11, 2009 at 12:50 PM, Steven Barth wrote: > Hi Everyone, > > I'm happy to announce version 0.3 of nixio, a well-documented multipurpose > Lua > library offering system, networking (IPv4, IPv6 and UNIX), I/O (Files, > Pipes, > UDP-, TCP-, and TLS-sockets), byte manipulation, hashing and other useful > functionality. > > nixio is FOSS under the Apache 2 license and has been successfully compiled > under Linux/glibc, Linux/uClibc, FreeBSD, OpenSolaris and Windows XP and > later > (using MinGW, no full POSIX support). It's also the base library for my > GSoC > project this year. > > Source Tarball: http://dev.luci.freifunk-halle.net/nixio/nixio-0.3.tar.bz2 > Documentation: http://dev.luci.freifunk-halle.net/nixio/doc/ > > Cheers, > Steven > > > > Changes from version 0.2: > * Added getifaddrs() function. > * Added getsockopt(), setsockopt(), getsockname() and getpeername() > directly > to TLS-socket objects unifying the socket interface. > * Added support for CyaSSL as cryptographical backend. > * Added support for x509 certificates in DER format. > * Added support for splice() in UnifiedIO.copyz(). > * Added interface to inject chunks into UnifiedIO.linesource() buffer. > * Changed TLS behaviour to explicitely separate servers and clients. > * Fixed usage of signed datatype breaking Base64 decoding. > * Fixed namespace clashes for nixio.fs. > * Fixed splice() support for some exotic C libraries. > * Reconfigure axTLS cryptographical provider and mark it as obsolete. > > --0016363b86de4e5c61046e72d43e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Holy smokes, this looks awesome. Thanks for sharing, Steven.

( I feel like a kid in a toy store playing with it... )

Phoen= ix Sol


On Sat, Jul 11, 2009 at 12:50 PM, Steven= Barth <steven@m= idlink.org> wrote:
Hi Everyone,

I'm happy to announce version 0.3 of nixio, a well-documented multipurp= ose Lua
library offering system, networking (IPv4, IPv6 and UNIX), I/O (Files, Pipe= s,
UDP-, TCP-, and TLS-sockets), byte manipulation, hashing and other useful functionality.

nixio is FOSS under the Apache 2 license and has been successfully compiled=
under Linux/glibc, Linux/uClibc, FreeBSD, OpenSolaris and Windows XP and la= ter
(using MinGW, no full POSIX support). It's also the base library for my= GSoC
project this year.

Source Tarball: http://dev.luci.freifunk-halle.net/nixio/nixi= o-0.3.tar.bz2
Documentation: http://dev.luci.freifunk-halle.net/nixio/doc/

Cheers,
Steven



Changes from version 0.2:
* Added getifaddrs() function.
* Added getsockopt(), setsockopt(), getsockname() and getpeername() directl= y
to TLS-socket objects unifying the socket interface.
* Added support for CyaSSL as cryptographical backend.
* Added support for x509 certificates in DER format.
* Added support for splice() in UnifiedIO.copyz().
* Added interface to inject chunks into UnifiedIO.linesource() buffer.
* Changed TLS behaviour to explicitely separate servers and clients.
* Fixed usage of signed datatype breaking Base64 decoding.
* Fixed namespace clashes for nixio.fs.
* Fixed splice() support for some exotic C libraries.
* Reconfigure axTLS cryptographical provider and mark it as obsolete.


--0016363b86de4e5c61046e72d43e-- From lua-bounces@bazar2.conectiva.com.br Sun Jul 12 19:51:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6CMpI3d017193; Sun, 12 Jul 2009 19:51:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98DAD187FE; Sun, 12 Jul 2009 19:50:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A468187C4 for ; Sun, 12 Jul 2009 19:50:32 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so414447eyd.41 for ; Sun, 12 Jul 2009 15:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=nmyLbheCtmwFhsEWCJoRbIKulGQO1CTn07QEOcgjqrM=; b=Csw8ReHF53jDFDMJMz2TfafOjlH+W510ATywU7DFdRAVT1EFIuhYcTlMmnIKBdkMRj FuhOyvNdpHCRReS0mVhpdTypZ2iz6LCn3kL+vLK5N4AyalyNidxkHAoa7QkbvO4xyH3i H6BGdmXIN1wuGqI79tdF1xluMYUgFqfnTj1vY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=YV53hTVWRcglT8Bp5QU1bc508miXk0RvFmnDtHRl9WbUcgG1igMN5U7KI93JjCxvIG IRSUpZDNQSXLJk4yhN5/gvDAdwMVOnpcM34KuPVnIx5DYw53XaPcnhYlIMTZuqN/nJhK CFYR1qnHC88yUb9MN0QV0isRpgoB8EQLDYNn8= MIME-Version: 1.0 Received: by 10.216.19.141 with SMTP id n13mr1242106wen.47.1247439029581; Sun, 12 Jul 2009 15:50:29 -0700 (PDT) Date: Sun, 12 Jul 2009 17:50:29 -0500 Message-ID: <4a89b8680907121550t40c9bb9ch6a4da511e30f6345@mail.gmail.com> Subject: nixio 0.3 - System, Networking and I/O library platforms From: paul.hermeneutic@gmail.com To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > From: Steven Barth > Subject: [ANN] nixio 0.3 - System, Networking and I/O library > ... > Source Tarball: http://dev.luci.freifunk-halle.net/nixio/nixio-0.3.tar.bz2 > Documentation: http://dev.luci.freifunk-halle.net/nixio/doc/ > > Cheers, > Steven This looks very nice. I look forward to trying it out. Looking at user.c, it would appear that most functions are not supported on Windows. Is that correct? From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 04:20:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D7KGiZ030806; Mon, 13 Jul 2009 04:20:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E183B189C7; Mon, 13 Jul 2009 04:19:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F78018822 for ; Mon, 13 Jul 2009 04:19:34 -0300 (BRT) Received: (qmail 17296 invoked from network); 13 Jul 2009 09:19:31 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 13 Jul 2009 09:19:31 +0200 From: Steven Barth To: Lua list Subject: Re: nixio 0.3 - System, Networking and I/O library platforms Date: Mon, 13 Jul 2009 08:58:05 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: <4a89b8680907121550t40c9bb9ch6a4da511e30f6345@mail.gmail.com> In-Reply-To: <4a89b8680907121550t40c9bb9ch6a4da511e30f6345@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907130858.05473.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Am Montag 13 Juli 2009 00:50:29 schrieb paul.hermeneutic@gmail.com: > > From: Steven Barth > > Subject: [ANN] nixio 0.3 - System, Networking and I/O library > > ... > > Source Tarball: > > http://dev.luci.freifunk-halle.net/nixio/nixio-0.3.tar.bz2 Documentation: > > http://dev.luci.freifunk-halle.net/nixio/doc/ > > > > Cheers, > > Steven > > This looks very nice. I look forward to trying it out. > > Looking at user.c, it would appear that most functions are not > supported on Windows. Is that correct? Yes unfortunately, if you are unsure whether a functions is POSIX-only just have a look at the documentation. If there is a prefix like (POSIX) or (Linux) then its only availalbe on that platform(s). Maybe one could write a wrapper in the future that uses WinAPI calls to emulate something like getspnam under Windows. But I'm not very familiar with the WinAPI by myself. Windows support was just a thing I added because I need this library in a cross-platform project. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 04:20:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D7Khp8030885; Mon, 13 Jul 2009 04:20:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9173818A58; Mon, 13 Jul 2009 04:19:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58C8918822 for ; Mon, 13 Jul 2009 04:19:36 -0300 (BRT) Received: (qmail 17302 invoked from network); 13 Jul 2009 09:19:31 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 13 Jul 2009 09:19:31 +0200 From: Steven Barth To: Lua list Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library Date: Mon, 13 Jul 2009 09:17:45 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: <200907111950.58415.steven@midlink.org> In-Reply-To: <200907111950.58415.steven@midlink.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907130917.45394.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Because I got a few requests by mail a few examples: File operations: local nixio = require "nixio", require "nixio.util" local file = nixio.open("myfile", "w") -- Open myfile for writing file:writeall("somedata") -- Write some buffer into a file file:seek(5) -- Seek to offset 5 file:lock("lock", 2) -- Lock 2 bytes beginning from current offset file:close() FS operations: local fs = require "nixio.fs" for entry in fs.dir("/tmp") do print(entry) end -- Traverse directory fs.copyr("/tmp", "/tmp/tmp2") -- Recursive copying Hashing: local nixio = require "nixio", require "nixio.util" local newmd5 = nixio.crypto.hash("md5") newmd5:update("Lorem ipsum") print((newmd5:update("some stuff"):final())) Sockets: local nixio = require "nixio", require "nixio.util" -- local mysock = nixio.connect("ipv6.google.com", 443) -- IPv6 is supported local mysock = nixio.connect("google.com", 443) -- Open TCP connection print(mysock:getpeername()) local mytlssock = nixio.tls("client"):create(mysock) -- TLS context and socket mytlssock:connect() -- TLS Handshake mytlssock:writeall("GET / HTTP/1.0\r\n\r\n") -- High-level write print(mytlssock:read(1024)) mytlssock:close() From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 05:21:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D8LVig003679; Mon, 13 Jul 2009 05:21:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F308189F6; Mon, 13 Jul 2009 05:21:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B8111873F for ; Mon, 13 Jul 2009 05:21:01 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n6D8Klir002787; Mon, 13 Jul 2009 17:20:57 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay11.aps.necel.com with ESMTP; Mon, 13 Jul 2009 17:20:57 +0900 Received: from dhlpc061 ([10.114.114.32] [10.114.114.32]) by relay11.aps.necel.com with ESMTP; Mon, 13 Jul 2009 17:20:57 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id A130552E226; Mon, 13 Jul 2009 17:20:57 +0900 (JST) From: Miles Bader To: Steven Barth Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library References: <200907111950.58415.steven@midlink.org> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 13 Jul 2009 17:20:57 +0900 In-Reply-To: <200907111950.58415.steven@midlink.org> (Steven Barth's message of "Sat, 11 Jul 2009 19:50:57 +0200") Message-ID: Lines: 9 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Any reason for the duplicating the functionality of luafilesystem, luasocket, etc ( which AFAICT seem well regarded)? Thanks, -Miles -- Patience, n. A minor form of despair, disguised as a virtue. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 05:25:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D8PJHK004015; Mon, 13 Jul 2009 05:25:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09822189E9; Mon, 13 Jul 2009 05:25:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48F9E187EE for ; Mon, 13 Jul 2009 05:24:54 -0300 (BRT) Received: by bwz17 with SMTP id 17so700970bwz.5 for ; Mon, 13 Jul 2009 01:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PMlZQv3KMrlA9QC53guVEmx9p8yFsLox7hIyGax9zJA=; b=m7kzr91VR+38qHlGw5qXZ1uy1tbJpWnrDldw/bN2O6mrhkywRBkysfawjjyUiRlRWq Ww56z84B+K4msVnR7Y61D3ToDCmlvpeKBEzxfhVy+l/megxGODVQowgd5Pxw3mmXP8qE 46XR6ZOQXekXt+uGJn02cwXVdmzOlKfQllpP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cETl73DIStlpgTSx8LUw9pEdWsMgzJTIzxtc0CmekejTpvWApIsLWA6ZZbnDk7rwxa ikFUBmEJNn1yvHbkkT0+GhinbeG9gvpbt0dichqRkscHKhdnYCV2cVDYfYp2uTUURICc TCFgETqNn3NQDk/d9siYgMu7YdPxeLEegjrH8= MIME-Version: 1.0 Received: by 10.239.149.207 with SMTP id k15mr463539hbb.48.1247473492063; Mon, 13 Jul 2009 01:24:52 -0700 (PDT) In-Reply-To: References: <200907111950.58415.steven@midlink.org> Date: Mon, 13 Jul 2009 10:24:52 +0200 Message-ID: <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009 at 10:20 AM, Miles Bader wrote: > Any reason for the duplicating the functionality of luafilesystem, > luasocket, etc ( which AFAICT seem well regarded)? I'd second that question. What stuff does it bring to the table that isn't covered by existing modules like lfs, lposix, md5, etc? steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 05:26:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D8Q2VK004117; Mon, 13 Jul 2009 05:26:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 839F618ADE; Mon, 13 Jul 2009 05:25:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6170018A5B for ; Mon, 13 Jul 2009 05:25:38 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MQGqv-0007hg-FV for lua@bazar2.conectiva.com.br; Mon, 13 Jul 2009 08:25:37 +0000 Received: from aaubervilliers-155-1-41-52.w86-198.abo.wanadoo.fr ([86.198.64.52]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jul 2009 08:25:37 +0000 Received: from PhiLho by aaubervilliers-155-1-41-52.w86-198.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jul 2009 08:25:37 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Lua in Anime Studio Date: Mon, 13 Jul 2009 10:25:29 +0200 Lines: 18 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-41-52.w86-198.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) X-Antivirus: avast! (VPS 090712-0, 12/07/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I just downloaded a free copy of the previous (5.5) version of e frontier's Anime Studio (previously named LostMarble Moho): http://my.smithmicro.com/freeanime/ http://my.smithmicro.com/win/anime/index.html I had the nice surprise to see .lua files in the installation directory! Looking at the credit screen, I see they used some other fine stuff, like Anti-Grain Geometry and Ming. Not sure yet how they use and expose Lua (looking further, it seems limited to the Pro version... :-( ) but I thought it was worth reporting it, as it isn't mentioned in the Wiki page (LuaUses). -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 06:35:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D9Zm0A010477; Mon, 13 Jul 2009 06:35:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74CB1189AD; Mon, 13 Jul 2009 06:35:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA7FD1874C for ; Mon, 13 Jul 2009 06:35:15 -0300 (BRT) Received: (qmail 1390 invoked from network); 13 Jul 2009 11:35:15 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 13 Jul 2009 11:35:15 +0200 From: Steven Barth To: Lua list Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library Date: Mon, 13 Jul 2009 11:30:23 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> In-Reply-To: <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907131130.23913.steven@midlink.org> Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Am Montag 13 Juli 2009 10:20:57 schrieb Miles Bader: > Any reason for the duplicating the functionality of luafilesystem, > luasocket, etc ( which AFAICT seem well regarded)? I understand your points and I really don't want to insult any developer of the mentioned Lua libraries. Even before writing nixio I by myself relied mainly on the libraries you mentioned. They worked fine in most cases and really met my demands for over a year. To clarify: I mainly work on embedded devices with 4 or 8 MB of flash so sizes of libraries really do matter. Everything is being cross-compiled and I have to take care of the additional Lua libraries for the project working well with the cross-compile toolchain. So each new library adds an additional administrative overhead over time. And as the project evolved the problems I had with the "classic" Lua modules began to increase, mainly: luaposix * It does not cover all POSIX functionality that I need. A co-developer began writing patches to add functionality. I think at least one of them - the crypt() function - went back upstream. * When it comes to third-party developers wanting to join the project - the lack of documentation was a relatively big problem. * As we had a cross-plattform project in sight this could be problematic as well. lfs * I used this before switching to luaposix. Works well for what it does. Also the documentation is good but unfortunately it has a very limited scope. For the POSIX part I need chmod(), chown(), realpath() and so on. bitlib * Autotools for a single C-file?! * Not possible to cross-compile without doing dirty hacks. luasocket: * A really nice piece of software, but: * I need IPv6 support in the near future. * What has always bugged me is that a receive() given an amount of bytes to read always blocked until the whole chunk was available. So when writing network software - like a JSON-RPC server or client - where the protocol is not line-based and you don't know how big the request-chunk will be, it was hard to get the request without fidddling with asynchronous I/O which would be clearly overkill in this case. * I need zero-copy-support (sendfile and splice) -at least on the server-side which is Linux - to efficiently transfer files from a USB disk attached to an embedded device over the network. luasec: * As I also need TLS support this was the next library I stumbled upon. Unfortunately it was - besides luaxyssl where xyssl was discontinued for a longer period - the only one that I found and as I said above if you are working on embedded devices you are thinking twice about putting the 1MB openssl monster - even in a compressed form - on your 4MB of flash memory. So given the overall overhead of maintaining all these third-party libraries in the buildsystem that cover only 80% or 90% of my demands and then writing and maintaining patches. I decided to start a new library that has everything I need for my projects. Am Montag 13 Juli 2009 10:24:52 schrieb steve donovan: > I'd second that question. What stuff does it bring to the table that > isn't covered by existing modules like lfs, lposix, md5, etc? To name a few things: * IPv6 support * sendfile() support * Some other misc POSIX features like poll(), nice(), signal(), ... * TLS and crypto support on top of CyaSSL or axTLS (or OpenSSL) * A unified I/O interface (read, write, readall, writeall, linesource, blocksource, sink, copy, ...) for dealing with files, pipes, TCP-sockets and TLS-sockets the same way. * Having only ONE library ;-) Regards Steven From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 06:47:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D9l74b011471; Mon, 13 Jul 2009 06:47:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5137118A1C; Mon, 13 Jul 2009 06:46:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D50BF18743 for ; Mon, 13 Jul 2009 06:46:33 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so429818fgb.5 for ; Mon, 13 Jul 2009 02:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=BdEFZBDG490smz85bsRq19wtf76aGTdXUImlBp6G5P8=; b=HgjKVrkKZZNYrco9nUFFEsX86rvXBAILdTPewyQMZDqcE17ycQ8z9w9y6FrOph1Qw0 TZwZG0uGWOs5886ZdmNy7qdTNSzqRZ3rxZeg5XD7NZepfBIZHVCuTBKNZL022pb10a9C nawqUAKWZryIJZoEv0odQ8pvyBLervAVs3tFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=WEq5r37BizFaXt9/0YNNm0FK7h7y4XbM151l1cAGZDfpRuf16kHXjQcvq6dtQ2EcR5 Rhcafbuq88SEM4aTF/SnjczIXk+WxOMg8Gd2AaaVtLWZUDk9/v36OtrJ9x9z7KAyixZG XhR9VUplCitb4oCxrssRCVFc4Qrsj9DzOU3LQ= MIME-Version: 1.0 Received: by 10.86.25.14 with SMTP id 14mr3146280fgy.14.1247478391127; Mon, 13 Jul 2009 02:46:31 -0700 (PDT) In-Reply-To: <200907131130.23913.steven@midlink.org> References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> From: Bogdan Marinescu Date: Mon, 13 Jul 2009 12:46:11 +0300 Message-ID: <81fbe47d0907130246kecf38edk8e2e37a52e5a7de1@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library To: Lua list Content-Type: multipart/alternative; boundary=000e0cd249845e3e40046e93326d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd249845e3e40046e93326d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Very nice work. Any change you'll add a good serial port module to this? My Asus WL-500gP kinda needs something like this ... :) Best, Bogdan On Mon, Jul 13, 2009 at 12:30 PM, Steven Barth wrote: > Am Montag 13 Juli 2009 10:20:57 schrieb Miles Bader: > > Any reason for the duplicating the functionality of luafilesystem, > > luasocket, etc ( which AFAICT seem well regarded)? > > I understand your points and I really don't want to insult any developer of > the mentioned Lua libraries. > Even before writing nixio I by myself relied mainly on the libraries you > mentioned. They worked fine in most cases and really met my demands for > over a > year. > To clarify: I mainly work on embedded devices with 4 or 8 MB of flash so > sizes > of libraries really do matter. Everything is being cross-compiled and I > have > to take care of the additional Lua libraries for the project working well > with > the cross-compile toolchain. So each new library adds an additional > administrative overhead over time. > And as the project evolved the problems I had with the "classic" Lua > modules > began to increase, mainly: > > luaposix > * It does not cover all POSIX functionality that I need. A co-developer > began > writing patches to add functionality. I think at least one of them - the > crypt() function - went back upstream. > * When it comes to third-party developers wanting to join the project - the > lack of documentation was a relatively big problem. > * As we had a cross-plattform project in sight this could be problematic as > well. > > lfs > * I used this before switching to luaposix. Works well for what it does. > Also > the documentation is good but unfortunately it has a very limited scope. > For > the POSIX part I need chmod(), chown(), realpath() and so on. > > bitlib > * Autotools for a single C-file?! > * Not possible to cross-compile without doing dirty hacks. > > luasocket: > * A really nice piece of software, but: > * I need IPv6 support in the near future. > * What has always bugged me is that a receive() given an amount of bytes to > read always blocked until the whole chunk was available. So when writing > network software - like a JSON-RPC server or client - where the protocol is > not line-based and you don't know how big the request-chunk will be, it was > hard to get the request without fidddling with asynchronous I/O which would > be > clearly overkill in this case. > * I need zero-copy-support (sendfile and splice) -at least on the > server-side > which is Linux - to efficiently transfer files from a USB disk attached to > an > embedded device over the network. > > luasec: > * As I also need TLS support this was the next library I stumbled upon. > Unfortunately it was - besides luaxyssl where xyssl was discontinued for a > longer period - the only one that I found and as I said above if you are > working on embedded devices you are thinking twice about putting the 1MB > openssl monster - even in a compressed form - on your 4MB of flash memory. > > So given the overall overhead of maintaining all these third-party > libraries > in the buildsystem that cover only 80% or 90% of my demands and then > writing > and maintaining patches. I decided to start a new library that has > everything > I need for my projects. > > > Am Montag 13 Juli 2009 10:24:52 schrieb steve donovan: > > I'd second that question. What stuff does it bring to the table that > > isn't covered by existing modules like lfs, lposix, md5, etc? > > To name a few things: > * IPv6 support > * sendfile() support > * Some other misc POSIX features like poll(), nice(), signal(), ... > * TLS and crypto support on top of CyaSSL or axTLS (or OpenSSL) > * A unified I/O interface (read, write, readall, writeall, linesource, > blocksource, sink, copy, ...) for dealing with files, pipes, TCP-sockets > and > TLS-sockets the same way. > * Having only ONE library ;-) > > Regards > Steven > > --000e0cd249845e3e40046e93326d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Very nice work. Any change you'll add a good serial port module to this= ? My Asus WL-500gP kinda needs something like this ... :)

Best,
B= ogdan

On Mon, Jul 13, 2009 at 12:30 PM, S= teven Barth <ste= ven@midlink.org> wrote:
Am Montag 13 Juli= 2009 10:20:57 schrieb Miles Bader:
> Any reason for the duplicating the functionality of = luafilesystem,
> luasocket, etc ( which AFAICT seem well regarded)?

I understand your points and I really don't want to insult any de= veloper of
the mentioned Lua libraries.
Even before writing nixio I by myself relied mainly on the libraries you mentioned. They worked fine in most cases and really met my demands for ove= r a
year.
To clarify: I mainly work on embedded devices with 4 or 8 MB of flash so si= zes
of libraries really do matter. Everything is being cross-compiled and I hav= e
to take care of the additional Lua libraries for the project working well w= ith
the cross-compile toolchain. So each new library adds an additional
administrative overhead over time.
And as the project evolved the problems I had with the "classic" = Lua modules
began to increase, mainly:

luaposix
* It does not cover all POSIX functionality that I need. A co-developer beg= an
writing patches to add functionality. I think at least one of them - the crypt() function - went back upstream.
* When it comes to third-party developers wanting to join the project - the=
lack of documentation was a relatively big problem.
* As we had a cross-plattform project in sight this could be problematic as=
well.

lfs
* I used this before switching to luaposix. Works well for what it does. Al= so
the documentation is good but unfortunately it has a very limited scope. Fo= r
the POSIX part I need chmod(), chown(), realpath() and so on.

bitlib
* Autotools for a single C-file?!
* Not possible to cross-compile without doing dirty hacks.

luasocket:
* A really nice piece of software, but:
* I need IPv6 support in the near future.
* What has always bugged me is that a receive() given an amount of bytes to=
read always blocked until the whole chunk was available. So when writing network software - like a JSON-RPC server or client - where the protocol is=
not line-based and you don't know how big the request-chunk will be, it= was
hard to get the request without fidddling with asynchronous I/O which would= be
clearly overkill in this case.
* I need zero-copy-support (sendfile and splice) =A0-at least on the server= -side
which is Linux - to efficiently transfer files from a USB disk attached to = an
embedded device over the network.

luasec:
* As I also need TLS support this was the next library I stumbled upon.
Unfortunately it was - besides luaxyssl where xyssl was discontinued for a<= br> longer period - the only one that I found and as I said above if you are working on embedded devices you are thinking twice about putting the 1MB openssl monster - even in a compressed form - on your 4MB of flash memory.<= br>
So given the overall overhead of maintaining all these third-party librarie= s
in the buildsystem that cover only 80% or 90% of my demands and then writin= g
and maintaining patches. I decided to start a new library that has everythi= ng
I need for my projects.


Am Montag 13 Juli 2009 10:24:52 schrieb steve donovan:
> I'd second that question. =A0What stuff does it = bring to the table that
> isn't covered by existing modules like lfs, lposix, md5, etc?

To name a few things:
* IPv6 support
* sendfile() support
* Some other misc POSIX features like poll(), nice(), signal(), ...
* TLS and crypto support on top of CyaSSL or axTLS (or OpenSSL)
* A unified I/O interface (read, write, readall, writeall, linesource,
blocksource, sink, copy, ...) for dealing with files, pipes, TCP-sockets an= d
TLS-sockets the same way.
* Having only ONE library ;-)

Regards
Steven


--000e0cd249845e3e40046e93326d-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 06:58:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6D9wGQs012335; Mon, 13 Jul 2009 06:58:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2B3518A87; Mon, 13 Jul 2009 06:57:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D6E31874C for ; Mon, 13 Jul 2009 06:57:52 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n6D9vn9Z015324; Mon, 13 Jul 2009 18:57:49 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay11.aps.necel.com with ESMTP; Mon, 13 Jul 2009 18:57:49 +0900 Received: from dhlpc061 ([10.114.114.32] [10.114.114.32]) by relay11.aps.necel.com with ESMTP; Mon, 13 Jul 2009 18:57:48 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id C8EE152E226; Mon, 13 Jul 2009 18:57:48 +0900 (JST) From: Miles Bader To: Steven Barth Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 13 Jul 2009 18:57:48 +0900 In-Reply-To: <200907131130.23913.steven@midlink.org> (Steven Barth's message of "Mon, 13 Jul 2009 11:30:23 +0200") Message-ID: Lines: 25 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Steven Barth writes: >> Any reason for the duplicating the functionality of luafilesystem, >> luasocket, etc ( which AFAICT seem well regarded)? > > I understand your points and I really don't want to insult any developer of > the mentioned Lua libraries. > > Even before writing nixio I by myself relied mainly on the libraries > you mentioned. They worked fine in most cases and really met my > demands for over a year. Well certainly it's understandable that you may have had problems with them, needed to cram your desired function set into as small a space as possible, and wanted to get something out the door quickly, etc. We've all been there. As a community, what do we do now though? Nixio undoubtedly improves on the aforementioned libraries in various ways, but it does muddy the waters a bit, and do-it-all blunder-buss libraries don't seem like a very good way forward in general. -Miles -- Once, adj. Enough. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 07:32:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DAWV8U015293; Mon, 13 Jul 2009 07:32:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 556D818B51; Mon, 13 Jul 2009 07:32:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F90518A93 for ; Mon, 13 Jul 2009 07:31:55 -0300 (BRT) Received: by fxm11 with SMTP id 11so2672117fxm.5 for ; Mon, 13 Jul 2009 03:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=kUE1++HO1/046iqmUZfLZKkCfIu2UMShRJGE2GmbQ2w=; b=VQkkQzZGpgpeZk0DXCF3xmFi/vBDFjnPXnzH1HFt4HEUV2l0KtiD409IqcdAOPK4DA 9vOorQZQTr7ZcFKanUrSQ39fls8BC7XiCtEyxdIfuKUzKHdsKswhOjVMvbqMaKOflS3K hCQvYC4XN58yplol3ZmEoovhQ/aqLCUzVbA1o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=otFxY8DCG8GeVICTUzDmi1Y0pRoGiZN8T5mOVfKDUrOxq7YZlJrYmFYnveqTf26NDV FvU4593Z9lCLgvJYtRuzlx6hpZZJjAaKJT4OFUYJNYSpN4e7+GtHc3kaXjdbn2RKIObT pJB0xCTf3DBDc8P+wJ6H1rojXx7NO+6GWF9kA= MIME-Version: 1.0 Received: by 10.239.149.207 with SMTP id k15mr472881hbb.48.1247481113456; Mon, 13 Jul 2009 03:31:53 -0700 (PDT) In-Reply-To: References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> Date: Mon, 13 Jul 2009 12:31:53 +0200 Message-ID: <560972290907130331r65cc29a3q6477d4684cf4d0e9@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6DAWV8U015293 On Mon, Jul 13, 2009 at 11:57 AM, Miles Bader wrote: > As a community, what do we do now though?  Nixio undoubtedly improves on > the aforementioned libraries in various ways, but it does muddy the > waters a bit, and do-it-all blunder-buss libraries don't seem like a > very good way forward in general. It's clear that nixio solves the particular problem very well. Generally, however, things are in flux. There was a discussion about Luiz' proposal for a osex: http://lua-users.org/lists/lua-l/2009-05/msg00470.html i.e. answering the question 'what basic cross-platform OS functionality can we package in a library'? lfs is cool, but I miss things like access (which IHMO should be part of lfs), so I go to lua-ex, but this has an ad-hoc approach to modifying system namespaces (like os) which feels dirty. The consensus was that adding things to os is not necessarily evil, but there should be agreement as to what extra functions should live here, and what their parameters and return values should be. For example, os.sleep() is a nice candidate for an external function, easy to implement on most OSses, but the specification should be clear on what the meaning of its argument should be (milliseconds? fractional seconds?) Another theme of that thread is that it's easy to work at the wrong level of abstraction when designing such a library, overfocusing on the platform implementation. For instance, the lfs pattern of iterating over entries in a directory is very efficient on POSIX, but this pattern isn't the most efficient way to do it on Windows if you then have to stat each filename, since the _find_next function is actually grabbing more than the file name - so an alternative iterator over file entries turns out to be needed. lua-ex is not bad at what it does, it does provide a portable Process abstraction, etc. However, it has recently been growing in some ad-hoc ways; when I was packaging it for Lua for Linux, I found myself stripping out the new path manipulation functions since they don't need to be in C and were a bit .. eccentric. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 07:44:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DAitV5016482; Mon, 13 Jul 2009 07:44:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EBF718B38; Mon, 13 Jul 2009 07:44:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4762418A02 for ; Mon, 13 Jul 2009 07:44:31 -0300 (BRT) Received: (qmail 9867 invoked from network); 13 Jul 2009 12:44:32 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 13 Jul 2009 12:44:32 +0200 From: Steven Barth To: Lua list Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library Date: Mon, 13 Jul 2009 12:43:32 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: <200907111950.58415.steven@midlink.org> <200907131130.23913.steven@midlink.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907131243.32714.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Am Montag 13 Juli 2009 11:57:48 schrieb Miles Bader: > As a community, what do we do now though? Nixio undoubtedly improves on > the aforementioned libraries in various ways, but it does muddy the > waters a bit, and do-it-all blunder-buss libraries don't seem like a > very good way forward in general. I think that mainly depends on the way you see and use Lua. If you see it as a scripting language for bigger applications then you obviously don't need a standard library with system functions. But if you see Lua as a kind of lighter alternative to Python you really begin to miss one important thing that has made Java, Python etc. popular - a good standard library. I support your statement about do-it-all-libraries when they cover different high-level functions that aren't related to each other but we are talking about a basic featureset here, which is simply I/O and bindings to lower-level c-library functions. The only thing I could see as higher-level story are the cryptographical parts but thats also nothing that you wouldn't find in the standard-library of YOUR_HIGHER_LEVEL_LANGUAGE. > As a community, what do we do now though? A cooperative competition is something nice to have. We will just see what happens - in particular - if anyone wants to use nixio in their projects or not. nixio is just what I wanted to give back to the Lua community after over one year of using the communities' resources - namely third-party modules. Nobody should be afraid or upset about a bit of diversity in the Lua module community ;-) Have a nice day Steven From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 08:28:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DBS4Zs021650; Mon, 13 Jul 2009 08:28:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42ACE18A9B; Mon, 13 Jul 2009 08:27:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EE9D183B2 for ; Mon, 13 Jul 2009 08:27:34 -0300 (BRT) Received: by bwz17 with SMTP id 17so861535bwz.5 for ; Mon, 13 Jul 2009 04:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=LH1XmhRYtRH1Re7yOSwHjqfHz4f5Jsper8hUMDVOjKM=; b=nMmzF7wtNFNAHXS8BAlxWkCiarSdp1em3VrzrJxY+lXX2yJ3sCvA0/CVRgfxMW9bDm dYYN9td8meXXdsfiBznpXCrgYxmuV+0UEzrnpcfzA7sJm/0sUwhRkvbj03qnjH8IY1pH f3K4NU2yrXtz630CoU269QJaDnlgKz4XSZk4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZrUK4Vgm9XpqX9T/vnFUiOxIXsefrSoWwc783VlQT3XzkGetzR+i7vgYKUvOp6i3MW TZ3Kv13AiTV/djUOp02XDF6pqvQSGiLtOjuh1kwx1mKFtj09gsihpW1Bh2rNVJFk8S8c uCyWJIvXZfgyDkJ5C7+mF3PJxWx74bZjClofo= MIME-Version: 1.0 Received: by 10.239.151.15 with SMTP id p15mr420201hbb.139.1247484452479; Mon, 13 Jul 2009 04:27:32 -0700 (PDT) In-Reply-To: <200907131243.32714.steven@midlink.org> References: <200907111950.58415.steven@midlink.org> <200907131130.23913.steven@midlink.org> <200907131243.32714.steven@midlink.org> Date: Mon, 13 Jul 2009 13:27:32 +0200 Message-ID: <560972290907130427n5774ad0ey3f532cae671de938@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009 at 12:43 PM, Steven Barth wrote: > Nobody should be afraid or upset about a bit of diversity in the Lua module > community ;-) Yes, it's never scared us before ;) Different tools for different jobs. This can all feed back into the the 'standard' modules, e.g. LuaSocket. I do worry about newcomers to Lua, because it's not clear what to use, and where to find the best set of batteries. This is where the distributions come into play. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 10:02:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DD2J7A005787; Mon, 13 Jul 2009 10:02:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D408518A97; Mon, 13 Jul 2009 10:01:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mengele.ibawizard.net (ibawizard.net [82.208.49.253]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D501518490 for ; Mon, 13 Jul 2009 10:01:40 -0300 (BRT) Received: by mengele.ibawizard.net (Postfix, from userid 1002) id DC2281D36129; Mon, 13 Jul 2009 15:01:31 +0200 (CEST) Date: Mon, 13 Jul 2009 15:01:31 +0200 From: Petr =?iso-8859-2?Q?=A9tetiar?= To: Lua list Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library Message-ID: <20090713130131.GZ21874@ibawizard.net> References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> <81fbe47d0907130246kecf38edk8e2e37a52e5a7de1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81fbe47d0907130246kecf38edk8e2e37a52e5a7de1@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bogdan Marinescu [2009-07-13 12:46:11]: > Very nice work. Any change you'll add a good serial port module to this? My > Asus WL-500gP kinda needs something like this ... :) I wrote simple serial port lib. maybe it's what you're looking for. You can find it at Github[1]. I'm using it on Win32, Windows CE/Mobile and on Linux/ARM in OpenEmbedded successfully. It's MIT licensed. 1. http://github.com/ynezz/librs232 -- ynezz From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 12:51:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DFpcHb011605; Mon, 13 Jul 2009 12:51:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA9B518BD6; Mon, 13 Jul 2009 12:51:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E39EE18B4E for ; Mon, 13 Jul 2009 12:51:03 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so703661qwi.11 for ; Mon, 13 Jul 2009 08:51:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.35.140 with SMTP id p12mr1142227ibd.7.1247500261415; Mon, 13 Jul 2009 08:51:01 -0700 (PDT) In-Reply-To: References: Date: Tue, 14 Jul 2009 01:51:01 +1000 Message-ID: Subject: Re: Lua Digest, Vol 163, Issue 1 From: Quae Quack To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=002215048957f05a25046e984937 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --002215048957f05a25046e984937 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I really like the look of nixio, but before I start using it, It needs to be easy for users to find and install it. Is there, or can someone make rocks, debs, and whatever other packaging formats people use for it? Without an easy install option, I'll be sticking with luasocket, lfs, etc... Daurn. --002215048957f05a25046e984937 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I really like the look of nixio, but before I start using it, It needs to b= e easy for users to find and install it.
Is there, or can someone make r= ocks, debs, and whatever other packaging formats people use for it? Without= an easy install option, I'll be sticking with luasocket, lfs, etc...
Daurn.
--002215048957f05a25046e984937-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 15:46:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DIkDCB022057; Mon, 13 Jul 2009 15:46:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5255D18CD5; Mon, 13 Jul 2009 15:45:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8905518994 for ; Mon, 13 Jul 2009 15:45:34 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so752827qwi.11 for ; Mon, 13 Jul 2009 11:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=45U4XGJVo7wwUGz3fkO/izHd6oE3Dq/i60er8B/YRd8=; b=mvCUuoLEaNFSCnwW+/ukBL9qsgWBsFzNVtE74QCHi/HzcdVCx6s4yaM07b6Lhh26Qg 0FEikr7AaO/+spkyHqqt8BU+D7I0MYAM+u1dLuxxaPTA19IshnRN23SwKjWmz1wuN6hE TXviVoizF4ABctL7LvFXAQnDeUWz8hKHn7Skw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=e63ybaBgxvEGcHDOH99ZQDkRWTOBQap8VLZsfLdlx/VDAVBWymtlRoawG1NnGgFpFT 3rwvUENhxHda6c+nxbYl1SyP2E9dXkb8zCElhnGNlKFaD+c8bIDxZa4/lzEihG+0XD+5 covIkN4YczoO93TDvae2zByAX/buikDXx67mI= MIME-Version: 1.0 Received: by 10.229.85.204 with SMTP id p12mr942302qcl.49.1247510731421; Mon, 13 Jul 2009 11:45:31 -0700 (PDT) In-Reply-To: <560972290907130331r65cc29a3q6477d4684cf4d0e9@mail.gmail.com> References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> <560972290907130331r65cc29a3q6477d4684cf4d0e9@mail.gmail.com> Date: Mon, 13 Jul 2009 11:45:31 -0700 Message-ID: <17eac67c0907131145y309ce74bt892b105fbc5de98a@mail.gmail.com> Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009 at 3:31 AM, steve donovan wrote: > On Mon, Jul 13, 2009 at 11:57 AM, Miles Bader wrote: > It's clear that nixio solves the particular problem very well. > Generally, however, things are in flux. There was a discussion about > Luiz' proposal for a osex: > > http://lua-users.org/lists/lua-l/2009-05/msg00470.html > > i.e. answering the question 'what basic cross-platform OS > functionality can we package in a library'? People who intend to write cross platform lua code care about the answer to that, but nxio looks like it goes beyond cross-platform, which is why I'll be downloading and evaluating it. A fair amount of reworking of some of the commonly used libraries involves adding functionality that is not cross-platform, like sendfile(), or unified integer file and socket descriptors. Since libraries like lfs are so small, usually a single C file, and since changes that don't work on Windows can't be accepted upstream, and maintaining your own version with the same name but extra functions is annoying (and monkey-patching modules is possibly in bad taste), it increases pressure to rewrite, or fork and rename. Examining ruby or python's cross-platform APIs and building up the same functionality would be useful, but both those languages standard libraries also include platform specific functionality. Sometimes in a seperate module, sometimes as API usage warnings. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 16:13:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DJDYXA029788; Mon, 13 Jul 2009 16:13:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D23218CF4; Mon, 13 Jul 2009 16:13:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 975CB18CD2 for ; Mon, 13 Jul 2009 16:13:02 -0300 (BRT) Received: (qmail 7534 invoked from network); 13 Jul 2009 21:13:03 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 13 Jul 2009 21:13:03 +0200 From: Steven Barth To: Lua list Subject: Re: Lua Digest, Vol 163, Issue 1 Date: Mon, 13 Jul 2009 21:12:29 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907132112.29554.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Daurn, I never worked with Luarocks before but I tried to make a Rockspec. You can find it here: http://dev.luci.freifunk-halle.net/nixio/nixio-0.3-1.rockspec It seems to build and hopefully does what it should do ;-) Cheers Steven From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 17:22:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6DKMVSr015584; Mon, 13 Jul 2009 17:22:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A7E918E73; Mon, 13 Jul 2009 17:21:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A973518D75 for ; Mon, 13 Jul 2009 17:21:50 -0300 (BRT) Received: by bwz17 with SMTP id 17so1397747bwz.5 for ; Mon, 13 Jul 2009 13:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=iQqJDBZzh864iaJ5bvwjJjdlPpt8L1+oZvmKdiw/kJI=; b=Br1G8+E6NdnkMyMZ2mwGRLgK/GRvpdrVYSdB6AL1tyU73Cs2C6HKmNeaw71Cwf/53v Zs8RU/N/coGN36ClE0Uck7nCtWMbhea0a80s/LKOWDGadHxncI8As4moVJcuVAaRIE9a 778lgDFLNyGSdglSFTKcVjzc+5ZygvAI6ABcc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=QAXrst4SS97jbYstQDWTZX+uWEmfjUb6vKLwazM2z4eZR0dEr+1KrOtPG/GheHKL70 egItwVliTjfHqCKXO+arWZbV0H8i280gbmY7Y935uGSdYjsYGhNOYOIzTdPO25pWxmZn Q5eYTKAXQwbtHqEezgM7NKA/b7hZaJ4R3oKWU= MIME-Version: 1.0 Received: by 10.204.116.212 with SMTP id n20mr5593239bkq.138.1247516508143; Mon, 13 Jul 2009 13:21:48 -0700 (PDT) In-Reply-To: <200907132112.29554.steven@midlink.org> References: <200907132112.29554.steven@midlink.org> From: Hisham Date: Mon, 13 Jul 2009 17:21:28 -0300 Message-ID: <5e7d91620907131321k46cc44f0o1afcbe845769f381@mail.gmail.com> Subject: Re: Lua Digest, Vol 163, Issue 1 To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009 at 4:12 PM, Steven Barth wrote: > Hi Daurn, > I never worked with Luarocks before but I tried to make a Rockspec. You can > find it here: > http://dev.luci.freifunk-halle.net/nixio/nixio-0.3-1.rockspec > > It seems to build and hopefully does what it should do ;-) I did some minor portability tweaks to the rockspec and uploaded it to the main repository. LuaRocks users (on Unix, at least) should now be able to install nixio by typing 'luarocks install nixio'. Thanks! -- Hisham From lua-bounces@bazar2.conectiva.com.br Mon Jul 13 21:22:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6E0M52N030678; Mon, 13 Jul 2009 21:22:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 871D118F70; Mon, 13 Jul 2009 21:21:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 554BD18CE6 for ; Mon, 13 Jul 2009 21:21:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so3317159ewy.5 for ; Mon, 13 Jul 2009 17:21:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.201.8 with SMTP id d8mr2135266ebq.7.1247530886285; Mon, 13 Jul 2009 17:21:26 -0700 (PDT) In-Reply-To: <200907131130.23913.steven@midlink.org> References: <200907111950.58415.steven@midlink.org> <560972290907130124k793ca538l6c4f96b416e46562@mail.gmail.com> <200907131130.23913.steven@midlink.org> Date: Mon, 13 Jul 2009 20:21:26 -0400 Message-ID: Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009 at 5:30 AM, Steven Barth wrote: > bitlib > * Autotools for a single C-file?! > * Not possible to cross-compile without doing dirty hacks. Yeah, the fourteenth bit library! [1] :) The docs say, "Can be used as a drop-in replacement for bitlib." At least it attempts to reuse the bitlib API, which Lua BitOp also reuses. However, there are some differences (e.g. "shl" v.s. "lshift"). Have you considered Mike's Lua BitOp? That seems to be the "best practice" at the moment. [1] http://lua-users.org/wiki/BitwiseOperators From lua-bounces@bazar2.conectiva.com.br Tue Jul 14 00:16:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6E3G1cb020720; Tue, 14 Jul 2009 00:16:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A6F4183A4; Tue, 14 Jul 2009 00:15:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f205.google.com (mail-gx0-f205.google.com [209.85.217.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4ADE418A22 for ; Tue, 14 Jul 2009 00:15:18 -0300 (BRT) Received: by gxk1 with SMTP id 1so3240410gxk.5 for ; Mon, 13 Jul 2009 20:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=yItTui5VZNmOtXpTe0nDew+7WfVoUDxCuqR3E6/u+2Y=; b=T/VH/Xqhqe/8P2DJt3EZOnPyN51XQEX4fz/4QVOD2ahZGF2ELs/5UOy+RMfEwpk/F9 jCpP7YmhU6t/ko8joo6hVXzdqs3EkjoDKmLrWmw/kf6JCiXPTv+8lbFqWLrv0L8BQAhR lVg3R5yF/BIgAV7LOH9ZOdE+YZ1mV5YlyyhuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ILvIAT0+BoR5RyRm4qNXLQP3ajanbs/aSog8qvEIwexOyy/Rb5rgs9FiMC8jTrA5Y6 T+tAOFJznG6p0I9o+K+8Lr/uYsDqag7zgoK7qR1E4jQzW6hI+hl0jLz+jfako4X2zsY/ O7+rUdwLByC8pGUZv5WTvsmZwa1gSiGiK4EFg= MIME-Version: 1.0 Received: by 10.151.13.6 with SMTP id q6mr9307431ybi.339.1247541316921; Mon, 13 Jul 2009 20:15:16 -0700 (PDT) Date: Mon, 13 Jul 2009 23:15:16 -0400 Message-ID: <1079b050907132015i7b88738cs48efd3ad9d3ee0c7@mail.gmail.com> Subject: lua task and pthreads From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If there's a more appropriate place to ask this, please let me know. I've been using lua task to perform some work in a non-blocking manner and at the same time I have some C++ code that I've made bindings for that under the hood uses pthreads to load images from disk. When I use their lua task or my own threaded loader, I have no problems, but as soon as I use both in one script, I get all kinds of memory corruption, bad access etc. errors. Does anyone know if there's anything in lua task preventing the use of pthreads in other areas of a program tat might cause this? I'm at a loss as to how to debug this problem because the section that cashes is not where the problem is. I think memory is getting stomped on somewhere but haven't been able to pin point it. thanks, wes From lua-bounces@bazar2.conectiva.com.br Tue Jul 14 03:35:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6E6ZkUJ008181; Tue, 14 Jul 2009 03:35:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 097E718C54; Tue, 14 Jul 2009 03:35:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BAA818B1F for ; Tue, 14 Jul 2009 03:35:07 -0300 (BRT) Received: by fxm11 with SMTP id 11so3813067fxm.5 for ; Mon, 13 Jul 2009 23:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=csboqRIRmj/IjtcTLjpoBUsvpUFEh07PBTS0K0Pj7ag=; b=iib9UwXz9B6pv8cb7ysyoPre/bCTf9CViUz2ckB4DxoBrizw9uuCga33gsUjsvYdi+ UsUKlbEH1Zu3fqsA8qFY8HlaVdz/791RVhXd0gx8UbAHdEWHSXeR9s33RX3bF8ALjCJW 7iF3HRp9YPY+3XEj+ULk5vVHhZz5Hd6QFJ8gI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fadgDrthE+Kud29PUgvSqbyqBtbfIoCKZ89nXQ21wourvOPiGeg/4fDJUMCvHporPc 4OAp4sKCMyM55SLR5sijKQIz81+121vV/aGnkZsBPuxlLNIMwSseq6d0AJkZONwAP+Dk RgVYsskT1c8X11vVFUj0t0Gf2OS7FsIuaEaw8= MIME-Version: 1.0 Received: by 10.103.6.14 with SMTP id j14mr3107996mui.48.1247553305782; Mon, 13 Jul 2009 23:35:05 -0700 (PDT) In-Reply-To: <1079b050907132015i7b88738cs48efd3ad9d3ee0c7@mail.gmail.com> References: <1079b050907132015i7b88738cs48efd3ad9d3ee0c7@mail.gmail.com> Date: Tue, 14 Jul 2009 01:35:05 -0500 Message-ID: Subject: Re: lua task and pthreads From: Jeff Pohlmeyer To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 13, 2009, Wesley Smith wrote: > the section that crashes is not where the problem is. I think > memory is getting stomped on somewhere but haven't been able > to pin point it. If you happen to be running on Linux, valgrind[1] sometimes helps to track down those kind of problems: valgrind --tool=memcheck - Jeff [1] http://valgrind.org/ From lua-bounces@bazar2.conectiva.com.br Tue Jul 14 12:27:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6EFRY5p000618; Tue, 14 Jul 2009 12:27:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA597190B5; Tue, 14 Jul 2009 12:27:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from host4.germeshausen.de (host4.germeshausen.de [213.239.205.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C227518BCE for ; Tue, 14 Jul 2009 12:26:54 -0300 (BRT) Received: (qmail 4631 invoked from network); 14 Jul 2009 17:26:48 +0200 Received: from 83-221-92-64.dynamic.primacom.net (HELO alchemist.localnet) (83.221.92.64) by host4.germeshausen.de with (DHE-RSA-AES256-SHA encrypted) SMTP; 14 Jul 2009 17:26:48 +0200 From: Steven Barth To: Lua list Subject: Re: [ANN] nixio 0.3 - System, Networking and I/O library Date: Tue, 14 Jul 2009 17:26:25 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc2-alchemist; KDE/4.2.4; x86_64; ; ) References: <200907111950.58415.steven@midlink.org> <200907131130.23913.steven@midlink.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907141726.25450.steven@midlink.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The docs say, "Can be used as a drop-in replacement for bitlib." At > least it attempts to reuse the bitlib API, which Lua BitOp also > reuses. However, there are some differences (e.g. "shl" v.s. > "lshift"). Thanks for pointing that out, it was just a mistake in the documentation. The library itself uses lshift, rshift, etc. I've fixed it in the online reference. > > Have you considered Mike's Lua BitOp? That seems to be the "best > practice" at the moment. I'll put that on the todo for 0.4 Thanks Steven From lua-bounces@bazar2.conectiva.com.br Tue Jul 14 17:04:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6EK2Ka9004664; Tue, 14 Jul 2009 17:02:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E13F019189; Tue, 14 Jul 2009 17:01:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ip1.myway.loc (n2.myway.com.ar [200.123.153.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9ED5C1914C for ; Tue, 14 Jul 2009 17:01:41 -0300 (BRT) Received: from [10.0.0.195] (host134.190-136-180.telecom.net.ar [190.136.180.134]) by ip1.myway.loc (Postfix) with ESMTPSA id A92345D8250 for ; Tue, 14 Jul 2009 17:01:32 -0300 (ART) Message-ID: <4A5CE419.8060302@soongsoft.com> Date: Tue, 14 Jul 2009 17:01:29 -0300 From: Daniel Quintela User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: lua task and pthreads References: <1079b050907132015i7b88738cs48efd3ad9d3ee0c7@mail.gmail.com> In-Reply-To: <1079b050907132015i7b88738cs48efd3ad9d3ee0c7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Wesley Smith escribió: > If there's a more appropriate place to ask this, please let me know. > I've been using lua task to perform some work in a non-blocking manner > and at the same time I have some C++ code that I've made bindings for > that under the hood uses pthreads to load images from disk. When I > use their lua task or my own threaded loader, I have no problems, but > as soon as I use both in one script, I get all kinds of memory > corruption, bad access etc. errors. Does anyone know if there's > anything in lua task preventing the use of pthreads in other areas of > a program tat might cause this? I'm at a loss as to how to debug this > problem because the section that cashes is not where the problem is. > I think memory is getting stomped on somewhere but haven't been able > to pin point it. > > thanks, > wes > Hi, LuaTask must not prevent any other use of pthreads. ¿Are you using any thread local storage in your own library?. ¿Are your own threads launched from the main task or from subtasks?. I hope those questions can trigger some idea... ;-) Regards, Daniel From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 07:26:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FAQNQ4009183; Wed, 15 Jul 2009 07:26:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48571192C6; Wed, 15 Jul 2009 07:25:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F04E519294 for ; Wed, 15 Jul 2009 07:25:45 -0300 (BRT) MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_SK0HUgwa2zwo5v9LXBJQcQ)" Received: from michel ([24.202.165.131]) by VL-MH-MR002.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00EPMJMV5QC0@VL-MH-MR002.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 06:25:44 -0400 (EDT) Message-id: <66F201371C92469C9432606F44F1558A@michel> From: michel To: lua@bazar2.conectiva.com.br Subject: Installing LUA directiory problems Date: Wed, 15 Jul 2009 06:25:49 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --Boundary_(ID_SK0HUgwa2zwo5v9LXBJQcQ) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Hi, I am trying to install LUA on a Linux server with no success because it tries to create directories in /usr and I am on shared server with no root privileges. I figure I could fix it with configure --prefix but when I run configure from the directory where I opened lua-5.1.4.tar.gz I am told 'No such file or directory'. Any help wpuld be great! --Boundary_(ID_SK0HUgwa2zwo5v9LXBJQcQ) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
Hi,
 
 
I am trying to install LUA on a Linux  server with no success because it tries to create directories in /usr and I am on  shared server with no root privileges. I figure I could fix it with configure --prefix but when I run configure from the directory where I opened lua-5.1.4.tar.gz I am told 'No such file or directory'.
 
 
Any help wpuld be great!
 
 
 
--Boundary_(ID_SK0HUgwa2zwo5v9LXBJQcQ)-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 07:39:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FAdiD2010345; Wed, 15 Jul 2009 07:39:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFC8C192DB; Wed, 15 Jul 2009 07:39:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D46FE1929D for ; Wed, 15 Jul 2009 07:39:17 -0300 (BRT) Received: by fxm11 with SMTP id 11so5516764fxm.5 for ; Wed, 15 Jul 2009 03:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=d18gBjgebe2NGKqrVQhT+CW/H3++BOJwRwCHRgLuVzE=; b=KhEormmtXDtg0E+WiTkS0FtLMBkE2olqa8vnIpx0Yuto3WFV3nD0zJ21gKx73M6ezP c+k2qLwUdeNRMwC2y9dTTs8JuR20ycKjTTIg+lH67ekzYHhc7mQ2bAc9206A63e2ILUm 0a0Xyaoub9tkKhXkOVuANZ1BcqlYceeDwemww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wTP6ZbWpsxq2PYC5xSQ5hoUcvTlHxduXNNhTRk96hkcF6P1gkPBSaq/y7owfKzP/C0 4oBwBbIiFsNr6wX0K226WVcNW4ooUTxgxfJj+yD/r6CW4lZpi0C1LqY9Dh4rGNCwACBt Fnn9eprJbzlFTHYYrFvA1FxNAjNH/Q6nQ40L4= MIME-Version: 1.0 Received: by 10.204.57.18 with SMTP id a18mr7522964bkh.19.1247654355390; Wed, 15 Jul 2009 03:39:15 -0700 (PDT) In-Reply-To: <66F201371C92469C9432606F44F1558A@michel> References: <66F201371C92469C9432606F44F1558A@michel> Date: Wed, 15 Jul 2009 12:39:15 +0200 Message-ID: <560972290907150339h3a3cfee7m5b4d10d30736f64c@mail.gmail.com> Subject: Re: Installing LUA directiory problems From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6FAdiD2010345 On Wed, Jul 15, 2009 at 12:25 PM, michel wrote: > I am trying to install LUA on a Linux  server with no success because it > tries to create directories in /usr and I am on  shared server with no root > privileges. I figure I could fix it with configure --prefix but when I run > configure from the directory where I opened lua-5.1.4.tar.gz I am told 'No > such file or directory'. There is a 'local' install option, but you will have to set environment variables LUA_PATH (and later, LUA_CPATH) so that your Lua will be able to find modules. The executable ends up in the src directory, you can copy this anywhere on your path. $ export LUA_PATH=';;/home/sdonovan/projects/lua/lua/?.lua;/home/sdonovan/projects/lua/lua/?/init.lua' $ lua Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > print(package.path) ;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/home/sdonovan/projects/lua/lua/?.lua;/home/sdonovan/projects/lua/lua/?/init.lua So you can put your own directories into package.path (the ;; expands to the existing one). steve d. From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 08:11:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FBBnMa014904; Wed, 15 Jul 2009 08:11:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E876192AF; Wed, 15 Jul 2009 08:11:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D064191D6 for ; Wed, 15 Jul 2009 08:11:16 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id n6FBBDUk081476 for ; Wed, 15 Jul 2009 13:11:13 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKtVXUrDbohb/2dsb2JhbADQK4QJBQ Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 15 Jul 2009 13:11:13 +0200 Received: from [192.168.127.128] (host20-103-dynamic.45-79-r.retail.telecomitalia.it [79.45.103.20]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n6FBBA4b013440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Jul 2009 13:11:13 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A5DB94A.6010807@erix.it> Date: Wed, 15 Jul 2009 13:11:06 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Installing LUA directiory problems References: <66F201371C92469C9432606F44F1558A@michel> In-Reply-To: <66F201371C92469C9432606F44F1558A@michel> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean michel wrote: > but when I run configure from the directory where I opened > lua-5.1.4.tar.gz I am told 'No such file or directory'. Just a wild guess: for the current directory you have to do ./configure, not just configure. Enrico From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 08:15:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FBFCcG015498; Wed, 15 Jul 2009 08:15:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBE10192C1; Wed, 15 Jul 2009 08:14:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6844719294 for ; Wed, 15 Jul 2009 08:14:47 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MR2Rb-0003YH-Lz for ; Wed, 15 Jul 2009 12:14:39 +0100 Received: from [192.168.3.116] (helo=necrosis.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MR2Rh-0007ND-JH for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 12:14:45 +0100 Date: Wed, 15 Jul 2009 12:13:51 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Installing LUA directiory problems Message-ID: <20090715121351.2e829f86@necrosis.i.flarn.net> In-Reply-To: <66F201371C92469C9432606F44F1558A@michel> References: <66F201371C92469C9432606F44F1558A@michel> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 15 Jul 2009 06:25:49 -0400 michel wrote: > I am trying to install LUA on a Linux server with no success because > it tries to create directories in /usr and I am on shared server > with no root privileges. I figure I could fix it with configure > --prefix but when I run configure from the directory where I opened > lua-5.1.4.tar.gz I am told 'No such file or directory'. Lua (note the capitalisation) does not use autoconf, and so it does not have a configure script. Edit the top-level Makefile; at the top you will see a variable being set called INSTALL_TOP near the start of the file. Change that to point to where you want to install it. You'll also want to edit src/luaconf.h and modify the #defines that control where Lua searches for modules by default; search for LUA_PATH in that file, and it should be self-explanatory. Then; make clean && make && make install B. From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 08:23:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FBNLIl016371; Wed, 15 Jul 2009 08:23:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 446D3192D5; Wed, 15 Jul 2009 08:23:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CD67192A5 for ; Wed, 15 Jul 2009 08:22:56 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=response Received: from michel ([24.202.165.131]) by VL-MO-MR001.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00GUNMA6KAJ0@VL-MO-MR001.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 07:22:55 -0400 (EDT) Message-id: From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 07:23:01 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Enrico, good point and I should have been more accurate when I wrote down my problem. Michel ----- Original Message ----- From: "Enrico Colombini" To: "Lua list" Sent: Wednesday, July 15, 2009 7:11 AM Subject: Re: Installing LUA directiory problems > michel wrote: >> but when I run configure from the directory where I opened >> lua-5.1.4.tar.gz I am told 'No such file or directory'. > > Just a wild guess: for the current directory you have to do ./configure, > not just configure. > > Enrico From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 09:00:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FC0rb6020159; Wed, 15 Jul 2009 09:00:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18C1818BED; Wed, 15 Jul 2009 09:00:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F4AF18B7A for ; Wed, 15 Jul 2009 09:00:19 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=response Received: from michel ([24.202.165.131]) by VL-MO-MR005.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT007B7NHU9470@VL-MO-MR005.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 07:49:06 -0400 (EDT) Message-id: <4ED223A95EE849EFBAF335E139CE4928@michel> From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 08:00:19 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Taking in all the great suggestions I tried this: I hardcoded paths in Makefile INSTALL_TOP= /home/qsys/lib/lua-5.1.4 INSTALL_BIN= /home/qsys/lib/lua-5.1.4/bin INSTALL_INC= /home/qsys/lib/lua-5.1.4/include INSTALL_LIB= /home/qsys/lib/lua-5.1.4/lib INSTALL_MAN= /home/qsys/lib/lua-5.1.4/man/man1 and I executed set LUA-PATH=/home/qsys/lib/lua-5.1.4 export LUA_PATH set LUA_CPATH=/home/qsys/lib/lua-5.1.4 export LUA_CPATH cd /home/qsys/lib/lua-5.1.4 make clean make generic make install and it seems to work. Is there some test that I can use to verify if it worked? Thanks! From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 09:07:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FC6w0k020854; Wed, 15 Jul 2009 09:06:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9B5B19294; Wed, 15 Jul 2009 09:06:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C55318BB2 for ; Wed, 15 Jul 2009 09:06:32 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MR3Fg-0003wm-2j for ; Wed, 15 Jul 2009 13:06:24 +0100 Received: from [192.168.3.116] (helo=necrosis.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MR3Fl-00018E-VM for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 13:06:30 +0100 Date: Wed, 15 Jul 2009 13:06:28 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Installing LUA directiory problems Message-ID: <20090715130628.0b8b2fe1@necrosis.i.flarn.net> In-Reply-To: <4ED223A95EE849EFBAF335E139CE4928@michel> References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 15 Jul 2009 08:00:19 -0400 michel wrote: > and it seems to work. Is there some test that I can use to verify if > it worked? Try running it? B. From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 09:10:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FCAhmh021631; Wed, 15 Jul 2009 09:10:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9806B192CA; Wed, 15 Jul 2009 09:10:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0E4818BB2 for ; Wed, 15 Jul 2009 09:10:19 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original Received: from michel ([24.202.165.131]) by VL-MO-MR004.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00JSQOH68Z20@VL-MO-MR004.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 08:10:18 -0400 (EDT) Message-id: From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 08:10:24 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: "Rob Kendrick" To: Sent: Wednesday, July 15, 2009 8:06 AM Subject: Re: Installing LUA directiory problems > On Wed, 15 Jul 2009 08:00:19 -0400 > michel wrote: > >> and it seems to work. Is there some test that I can use to verify if >> it worked? > > Try running it? > > B. That makes sense ... what is the easiest way to do that? Sorry, I am new to this. Michel From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 09:36:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FCaLwl025316; Wed, 15 Jul 2009 09:36:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C535192B7; Wed, 15 Jul 2009 09:35:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from caleb.petrasoft.net (caleb.petrasoft.net [174.46.30.71]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F066192A4 for ; Wed, 15 Jul 2009 09:35:49 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by caleb.petrasoft.net (Postfix) with ESMTP id DBE12912AC5 for ; Wed, 15 Jul 2009 07:35:40 -0500 (CDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Debian amavisd-new at petrasoft.net Received: from caleb.petrasoft.net ([127.0.0.1]) by localhost (caleb.petrasoft.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r5CwLaAieeDu for ; Wed, 15 Jul 2009 07:35:40 -0500 (CDT) Received: from [10.205.1.122] (unknown [10.205.1.122]) by caleb.petrasoft.net (Postfix) with ESMTPA id 6E05B912A9C for ; Wed, 15 Jul 2009 07:35:40 -0500 (CDT) Message-Id: From: Phil Birkelbach To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Installing LUA directiory problems X-Priority: 3 Date: Wed, 15 Jul 2009 07:35:39 -0500 References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean $ cd /home/qsys/lib/lua-5.1.4/bin $ ./lua > print "Hello World" On Jul 15, 2009, at 7:10 AM, michel wrote: > > ----- Original Message ----- From: "Rob Kendrick" > To: > Sent: Wednesday, July 15, 2009 8:06 AM > Subject: Re: Installing LUA directiory problems > > >> On Wed, 15 Jul 2009 08:00:19 -0400 >> michel wrote: >> >>> and it seems to work. Is there some test that I can use to verify if >>> it worked? >> >> Try running it? >> >> B. > > > That makes sense ... what is the easiest way to do that? Sorry, I am > new to this. > > > > Michel From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 09:43:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FCh7On026617; Wed, 15 Jul 2009 09:43:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DE3E192DE; Wed, 15 Jul 2009 09:42:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CFCD192B3 for ; Wed, 15 Jul 2009 09:42:40 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=response Received: from michel ([24.202.165.131]) by VL-MO-MR003.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00H7WPZ19P00@VL-MO-MR003.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 08:42:38 -0400 (EDT) Message-id: From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 08:42:43 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Great and much thanks to all for the great help! It seem to work so now I need to set it up llighttpd ... Thanks all! ----- Original Message ----- From: "Phil Birkelbach" To: "Lua list" Sent: Wednesday, July 15, 2009 8:35 AM Subject: Re: Installing LUA directiory problems >$ cd /home/qsys/lib/lua-5.1.4/bin > $ ./lua > > print "Hello World" > > > On Jul 15, 2009, at 7:10 AM, michel wrote: > >> >> ----- Original Message ----- From: "Rob Kendrick" >> To: >> Sent: Wednesday, July 15, 2009 8:06 AM >> Subject: Re: Installing LUA directiory problems >> >> >>> On Wed, 15 Jul 2009 08:00:19 -0400 >>> michel wrote: >>> >>>> and it seems to work. Is there some test that I can use to verify if >>>> it worked? >>> >>> Try running it? >>> >>> B. >> >> >> That makes sense ... what is the easiest way to do that? Sorry, I am >> new to this. >> >> >> >> Michel > From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 10:29:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FDTAL5005245; Wed, 15 Jul 2009 10:29:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A014192E5; Wed, 15 Jul 2009 10:28:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 732AB192CC for ; Wed, 15 Jul 2009 10:28:34 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=response Received: from michel ([24.202.165.131]) by VL-MO-MR005.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00JG5RKOUO20@VL-MO-MR005.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 09:17:12 -0400 (EDT) Message-id: From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 09:28:23 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am still having some problems when I try to compile lighttpd with lua I get: --with-lua=/home/qsys/lib/lua-5.1.4 checking for LUA ... configure: error: package requirements (lua5.1 >=5.1) where not met I was able to run $ cd /home/qsys/lib/lua-5.1.4/bin $ ./lua print "Hello World" Thank you! From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 10:35:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FDZFo5006806; Wed, 15 Jul 2009 10:35:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 476E5192EE; Wed, 15 Jul 2009 10:34:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F9D7192E9 for ; Wed, 15 Jul 2009 10:34:46 -0300 (BRT) Received: by fxm11 with SMTP id 11so5712585fxm.5 for ; Wed, 15 Jul 2009 06:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nzLGxvZVXYs9ocRUXIbdDwTHh9f/4kpMsnEqIhe7km8=; b=P17q44SOQ78XNkz9IlpcwDT8CGSQNZPXzanTtbaq3KrSo0OISsnTVt2rSTw1Dldtxe ZY6TDnmbuy+4fUO18pSmBO6PBX7usY2ZCkcXzRnO1ZSiaPCr5ZvvjuJ+8QvGC7rNMQZD TPUsDgi/NcbU/p+IwKC8nmKbC9OKT8J2PE6WY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZcnA3ZJ1Vg3eZtEQhJVqwPtzeWa/1a3dl3ybL7i0YIBQOksEmVoj3oa0Wey2jDWOHn lJ33Ib3E3JwEd/6LPghm6IXw5kTE9HCnHnvgUeqvm7kOxdp0uY4AvMohW6UM0+SuNJSw op3a91iaBFgWdhcVJGIUYYY1AXjWsnVU36hck= MIME-Version: 1.0 Received: by 10.204.70.196 with SMTP id e4mr7599348bkj.65.1247664881058; Wed, 15 Jul 2009 06:34:41 -0700 (PDT) In-Reply-To: References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> Date: Wed, 15 Jul 2009 15:34:38 +0200 Message-ID: <560972290907150634m4d1e835ai28b8fa48827f276d@mail.gmail.com> Subject: Re: Installing LUA directiory problems From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6FDZFo5006806 On Wed, Jul 15, 2009 at 3:28 PM, michel wrote: > --with-lua=/home/qsys/lib/lua-5.1.4 > checking for LUA ... configure: error:  package requirements (lua5.1 >=5.1) > where not met Hm, look in the configure script for that error message. They may be using pkg-config or some tool like that, which hasn't been told about your Lua. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 11:08:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FE8QvI015109; Wed, 15 Jul 2009 11:08:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A547C192F1; Wed, 15 Jul 2009 11:07:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8CF0192E8 for ; Wed, 15 Jul 2009 11:07:50 -0300 (BRT) MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_HNG4hCY1w3IJwfo0+UnDvw)" Received: from michel ([24.202.165.131]) by VL-MO-MR005.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KMT00J67TE5UO80@VL-MO-MR005.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 09:56:30 -0400 (EDT) Message-id: <1258FCF6FD894DD399F2A29F7890E51D@michel> From: michel To: Lua list References: <66F201371C92469C9432606F44F1558A@michel> <4A5DB94A.6010807@erix.it> <4ED223A95EE849EFBAF335E139CE4928@michel> <20090715130628.0b8b2fe1@necrosis.i.flarn.net> <560972290907150634m4d1e835ai28b8fa48827f276d@mail.gmail.com> Subject: Re: Installing LUA directiory problems Date: Wed, 15 Jul 2009 10:07:42 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090714-0, 07/14/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --Boundary_(ID_HNG4hCY1w3IJwfo0+UnDvw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Steve, thanks and that got me pointed in the right direction! I added export LUA_CFLAGS="-I/home/qsys/lib/lua-5.1.4/include" export LUA_LIBS="-L//home/qsys/lib/lua-5.1.4/lib -llua" and I was able to get it installed and running! ----- Original Message ----- From: "steve donovan" To: "Lua list" Sent: Wednesday, July 15, 2009 9:34 AM Subject: Re: Installing LUA directiory problems > Hm, look in the configure script for that error message. They may be > using pkg-config or some tool like that, which hasn't been told about > your Lua. > steve d. --Boundary_(ID_HNG4hCY1w3IJwfo0+UnDvw) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
Steve,
 
thanks and that got me pointed in the right direction!
 
I added
 

export LUA_CFLAGS="-I/home/qsys/lib/lua-5.1.4/include"

export LUA_LIBS="-L//home/qsys/lib/lua-5.1.4/lib -llua"

 

and I was able to get it installed and running!
 
 
 
 
 
----- Original Message -----
From: "steve donovan" <steve.j.donovan@gmail.com>
Sent: Wednesday, July 15, 2009 9:34 AM
Subject: Re: Installing LUA directiory problems

> Hm, look in the configure script for that error message. They may be
> using pkg-config or some tool like that, which hasn't been told about
> your Lua.

> steve d.
--Boundary_(ID_HNG4hCY1w3IJwfo0+UnDvw)-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 20:32:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6FNWHU8022577; Wed, 15 Jul 2009 20:32:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E489018C57; Wed, 15 Jul 2009 20:31:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0e.pop-rio.com.br [200.239.248.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59DA518AF1 for ; Wed, 15 Jul 2009 20:31:40 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.101]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MRDwo-0001Ae-8d for lua@bazar2.conectiva.com.br; Wed, 15 Jul 2009 20:31:39 -0300 Message-ID: <4A5E66F0.7070607@sct.microlink.com.br> Date: Wed, 15 Jul 2009 20:32:00 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Lua Workshop 2009 registration References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I sent the registration form on June 1st and sent an e-mail asking for confirmation one month later but didn't get any answer. Could someone confirm the registration process is working? Or better yet, that I am registered? Thanks, Andre From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 22:05:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6G14vc2032691; Wed, 15 Jul 2009 22:04:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96ACF18E6D; Wed, 15 Jul 2009 22:04:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp.brion.com (unknown [67.111.218.37]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C685118E57 for ; Wed, 15 Jul 2009 22:04:22 -0300 (BRT) Received: from ex02.briontech.com (HELO email.brion.com) ([10.101.100.10]) by mailgate.briontech.com with ESMTP; 15 Jul 2009 18:03:49 -0700 Received: from ex02.briontech.com ([10.101.100.10]) by ex02.briontech.com ([10.101.100.10]) with mapi; Wed, 15 Jul 2009 18:03:49 -0700 From: Antoine Bruguier To: "lua@bazar2.conectiva.com.br" Date: Wed, 15 Jul 2009 18:03:47 -0700 Subject: [Newbie] Including a lua file from another lua file (problems with paths) Thread-Topic: [Newbie] Including a lua file from another lua file (problems with paths) Thread-Index: AcoFsUXvZrEEX8XMRIiakzF5r48T1Q== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6G14vc2032691 Hello, I am having a problem with including other Lua files from a Lua file because of inconsistent paths. Here's are the three files that I have: ---- main.cc --- { ... luaL_loadfile(L, "subdir/hello.lua"); lua_pcall(L, 0, LUA_MULTRET, 0); ... } ---- subdir/hello.lua --- ... dofile('subhello.lua'); ... ---- subdir/subhello.lua --- ... print('Hello world'); ... ---- ----- However, this fails with the message: cannot read subhello.lua: No such file or directory I have trolled the web for an answer, but I can't find anything. It seems there are three ways to include a lua file * dofile * loadfile * require However, none is relative to the current Lua source file. Of course, I could do a dofile('subdir/subhello.lua'); but that doesn't help me, because the name of 'subdir' is not known until runtime. Is there any way to get around this? A workaround would be to get the current's file path and concatenate the strings, but I haven't found a way to do that either. Thanks in advance, Tony From lua-bounces@bazar2.conectiva.com.br Wed Jul 15 22:13:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6G1DlJr001159; Wed, 15 Jul 2009 22:13:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEF9D18EBE; Wed, 15 Jul 2009 22:13:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA50418E57 for ; Wed, 15 Jul 2009 22:13:24 -0300 (BRT) Received: by fxm11 with SMTP id 11so6440800fxm.5 for ; Wed, 15 Jul 2009 18:13:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.58.73 with SMTP id f9mr8150722bkh.164.1247706802248; Wed, 15 Jul 2009 18:13:22 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Jul 2009 02:13:22 +0100 Message-ID: Subject: Re: [Newbie] Including a lua file from another lua file (problems with paths) From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 16, 2009 at 2:03 AM, Antoine Bruguier wrote: > A workaround would be to get the current's file path and concatenate the strings, but I haven't found a way to do that either. Given the file "Lua\libs\dir.lua": local path = debug.getinfo(1,"S").source:match("@(.*"..package.config:sub(1,1)..")") print(path) Then the following: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile [[Lua\libs\dir.lua]] Lua\libs\ > require "Lua.libs.dir" .\Lua\libs\ From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 08:22:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GBMAXZ005725; Thu, 16 Jul 2009 08:22:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7809E192E1; Thu, 16 Jul 2009 06:16:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04CD818D70 for ; Thu, 16 Jul 2009 06:16:38 -0300 (BRT) Received: by fxm11 with SMTP id 11so6796263fxm.5 for ; Thu, 16 Jul 2009 02:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lVZkpZL87Tb3vuUK6/tJOqdpzfxoPIHyBmK1EdSziIY=; b=bqaP7eTL5k1Gn0eHsV4WFx7G8odqEXuwupgkiwmyv2kWliV5WNiqU3t+XILkH4+bgo fqv8XQnXXWbuwXtWtinwn7yoCfmFmEvy1V+Nvaeyh4K/SY9QmNjhv4LTBqrfwgF7+nnd Pb67NLCYFodV2mtNmrW9qq4MaVdhjbDpd4DME= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dwfXEKONim28FtuIynBRRwK+aQ+alliddBJnkGwpDEkPLZu1pg1WKZyoamjTvgTmLL Htk4s919C02d+se7XQ6l9yQ6VW33tcKfHpCWMkY/IuYsiPnIw2awHeW9JEZV558q0j4C sfrqGBztzHdoM+LQc+3FMOIP76a/rOaDEfaIk= MIME-Version: 1.0 Received: by 10.239.143.138 with SMTP id k10mr643971hba.5.1247735797407; Thu, 16 Jul 2009 02:16:37 -0700 (PDT) In-Reply-To: <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> Date: Thu, 16 Jul 2009 11:16:37 +0200 Message-ID: <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> Subject: Re: Lua for MediaWiki? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 16, 2009 at 10:08 AM, Peter Jacobi wrote: > where installing > a binary is impossible, so something like a Lua-Interpreter > written in PHP would be required. Now, that's an ugly > project! But perhaps someone already has explored this > path? That is a truly nasty path to follow! Implementing an interpreter using another (slow) interpreter. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 08:38:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GBcnHs009351; Thu, 16 Jul 2009 08:38:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAAE21928F; Thu, 16 Jul 2009 05:08:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E98A418FF3 for ; Thu, 16 Jul 2009 05:08:32 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so1094442fgb.5 for ; Thu, 16 Jul 2009 01:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qkDbBqSy+uMwbG43QaPgvRAxAe3sGVl62s/jrRxDDg4=; b=glCLAy2mm9Pnb37zInEmTGmtvr7uqR3z8W0IfjlqZbXhfZ8WeI5+zEJ9E7pd+yfnfq 93gPSs4L/20LLH+ZBVfvNtECchXKkTd69tSXQJpE8w5499HL34c5Gu80L3KL6nH/7F9f r5pIzHweVJq779OI1XqYCeWbBQZYl8oNi+0lc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W1k0kHDpb4pfJnNUTNlZezMjB0RTaxGMmiZB+SaxgLjY1SiLYLeVvKkrV0Gfcj60A4 bQnOha8rxEDIS91IKh2/YrwSd78gtA4bYrp+A265korwMe6vtKl3PS0/qNhiNGMhVqfO yxsuv71TC4AN3xtFHPOYHXMAQH1nOe0KusE6w= MIME-Version: 1.0 Received: by 10.86.93.20 with SMTP id q20mr5928535fgb.16.1247731710913; Thu, 16 Jul 2009 01:08:30 -0700 (PDT) In-Reply-To: References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> Date: Thu, 16 Jul 2009 10:08:30 +0200 Message-ID: <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> Subject: Re: Lua for MediaWiki? From: Peter Jacobi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just three additional remarks on this topic (1) Extension On Fri, Jul 3, 2009 at 9:55 AM, Bertrand Mansion wrote: > Lua is already available in MediaWiki: > http://www.mediawiki.org/wiki/Extension:Lua > > But I think it is still experimental. > I had a look at this code for my Try Lua! experiment. Yes, but being just an extension and being enabled by default on Wikipedia makes a big difference. (2) Link to the Blog, I've missed to give http://techblog.wikimedia.org/2009/06/on-templates-and-programming-languages/ (3) Strangely the biggest one point which seems to block selecting Lua, is the compatibility issue for small MediaWiki installations on shared hosting sites. The MediaWiki techs would like to have a fallback for sites, where installing a binary is impossible, so something like a Lua-Interpreter written in PHP would be required. Now, that's an ugly project! But perhaps someone already has explored this path? Regards, Peter From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 08:41:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GBfIv3009919; Thu, 16 Jul 2009 08:41:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D91DE19051; Thu, 16 Jul 2009 08:40:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C7D018D88 for ; Thu, 16 Jul 2009 08:40:38 -0300 (BRT) Received: by fxm11 with SMTP id 11so94457fxm.5 for ; Thu, 16 Jul 2009 04:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=5ldyMhXg6BKsJesV2Fy0+c6mWLrqbNkQ8g/aJxlFHaQ=; b=Y3jDHYXkCN6A0ykzLlMIm6+bgcmhUvpCCJMkwoNXlpPmYXyyHLZLfFM87Lmhgjfjm0 fUMNyuPdyhAjxWlgoTLaoKZQaWzJGc6x1yRUg9dpS2z92ur6F7xzW4OxwM/Frb38VJcm +NkjBsgXkArOD+C2at8pGjEDlInoyLoqx/dtA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=KhNnq1x2ND8KnauxAvCQmjDdLEQnQjU9Cpqg3aWDVpXAR94GcDMAS3E5lTKlIkbOzC 6NJCRfc5tVZnwk8P8j5drh3ggGq/hQxwC+XnEJPx4rdHCSGrwtvRi5m76oIj0NkD9vIb 69tlajN7E5KSVi8dXuEKMgMMHPxiB+O5mnb5I= MIME-Version: 1.0 Received: by 10.239.149.195 with SMTP id k3mr667790hbb.108.1247744435836; Thu, 16 Jul 2009 04:40:35 -0700 (PDT) Date: Thu, 16 Jul 2009 13:40:35 +0200 Message-ID: <560972290907160440h4c5b130em8ad274a98adc5183@mail.gmail.com> Subject: Vala and Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean http://live.gnome.org/Vala/LuaSample Very cute concept: a modern object-orientated language without bloat or runtime necessary (although to be fair GLib/Gnome is the runtime for Vala) And it interfaces very nicely with C interfaces, such as Lua. You can look at the generated C, and it's just what you would type anyway. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 09:12:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GCCACO021997; Thu, 16 Jul 2009 09:12:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1DDD192EC; Thu, 16 Jul 2009 06:25:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA0D118F8D for ; Thu, 16 Jul 2009 06:25:52 -0300 (BRT) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090716092545.FMQT5579.mtaout03-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Thu, 16 Jul 2009 10:25:45 +0100 Received: from [92.24.110.112] (helo=taboche) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1MRNDi-0003g7-Sy for lua@bazar2.conectiva.com.br; Thu, 16 Jul 2009 10:25:43 +0100 From: Thomas Lauer To: Lua list Subject: [ANN] Idle 0.7b Date: Thu, 16 Jul 2009 10:25:44 +0100 Organization: TL Message-ID: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=SFBYNVl0AAAA:8 a=_Sp9wsD7N9sYJIc9vIMA:9 a=5aEyw_u3hkhUrAWDMmglUS53w4IA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6GCCACO021997 The Idle v0.7beta is out. See http://idle.thomaslauer.com for details about Idle and http://idle.thomaslauer.com/download for downloads. This release will be the last beta version. Changes include: + the file I/O routines support files larger than 2/4 GB + new function gui.RegisterHotkey(hk[,cb]) connects system-wide hotkeys with Idle callback functions + task.cancel(id) ends or kills a running task/thread + task.forcereturn(id) ends a runaway task/thread + strings can escape hexadecimal values as '\xXX' - sqlite3.dll has been renamed idlesql.dll (should be transparent) - the Tiny C support has been upgraded to v0.9.25 - the Perl support has been upgraded to the Perl 5.10 stream Idle is a compact, powerful scripting language based on Lua. It is available for Windows 2000 and later systems. Idle is released under the MIT licence. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 10:00:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GD0OSk031621; Thu, 16 Jul 2009 10:00:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4F451A55E; Thu, 16 Jul 2009 09:59:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 421831A51A for ; Thu, 16 Jul 2009 09:59:42 -0300 (BRT) Received: by ewy26 with SMTP id 26so144512ewy.5 for ; Thu, 16 Jul 2009 05:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=QkWLJV0Kf9OesxtsaN/JEoNLTqEp09Rr9WzP3OlSpmc=; b=hH4aqB/gLRSHeT2YbP7PvSWio6G1dil2lhT4WpZZ1uloWAFTG+V89vBjHs7CU9DsuU XnbJsGoAIkfwZkJ0Cm1EZOYJ63nZiiBrBzanKOnuNkggmudIp3iMvpxizmdEYvpUYNAu yQ28MwcVAIMbq+kaIl3JoOQtGPPnoAq4ZNIwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=J7abIuU4tdN6vzhv97Ks0J1qf1Cjx2j3HuQPPkRA4OtQ6mgxmgWLxWS2OjV2nd4FvM chpV4Nf2bjprHrriu0pCeKr1JEaOTNaezMNe/AOSzvdhgZa3nKr24JVmvL69oDbZGIx9 1ogIEhtSd/st7qrU1KWNNiogpiOHkV3jPyXNM= MIME-Version: 1.0 Received: by 10.216.30.195 with SMTP id k45mr2403770wea.197.1247749180123; Thu, 16 Jul 2009 05:59:40 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Thu, 16 Jul 2009 14:59:20 +0200 Message-ID: <89d273ba0907160559l4bd644bv562555a9abb168b1@mail.gmail.com> Subject: Re: [Newbie] Including a lua file from another lua file (problems with paths) To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/16 Antoine Bruguier : > Hello, > > I am having a problem with including other Lua files from a Lua file because of inconsistent paths. Here's are the three files that I have: > ---- main.cc --- > { > ... > luaL_loadfile(L, "subdir/hello.lua"); > lua_pcall(L, 0, LUA_MULTRET, 0); > ... > } > ---- subdir/hello.lua --- > ... > dofile('subhello.lua'); > ... > ---- subdir/subhello.lua --- > ... > print('Hello world'); > ... > ---- ----- > > However, this fails with the message: > cannot read subhello.lua: No such file or directory > > I have trolled the web for an answer, but I can't find anything. It seems there are three ways to include a lua file > * dofile > * loadfile > * require > > However, none is relative to the current Lua source file. Of course, I could do a dofile('subdir/subhello.lua'); but that doesn't help me, because the name of 'subdir' is not known until runtime. > > Is there any way to get around this? A workaround would be to get the current's file path and concatenate the strings, but I haven't found a way to do that either. Try modules and require: ---- main.cc --- { ... lua_getglobal(L, "require"); lua_pushstring(L, "subdir.hello"); lua_pcall(L, 1, LUA_MULTRET, 0); ... } ---- subdir/hello.lua --- ... module(..., package.seeall) require(_PACKAGE..'subhello'); ... ---- subdir/subhello.lua --- ... print('Hello world'); ... ---- ----- From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 10:34:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GDXqpd007175; Thu, 16 Jul 2009 10:33:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 641EB18C93; Thu, 16 Jul 2009 10:33:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5096318B6F for ; Thu, 16 Jul 2009 10:33:19 -0300 (BRT) Received: by bwz17 with SMTP id 17so192560bwz.5 for ; Thu, 16 Jul 2009 06:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=w96neJErUYukYQ911a6ZQq827M0TCQK1GDyhMt43iME=; b=Y6dGaePywzMtmazlPokS4/XEF4RKbBhH5coNg1QFhA2nilqjMhWL3gJPDJJ2ZxcsTm vyBCMqcd2PGunoiRD37VQaqSp4kftZHpGEmCNMmNPKMJYVB4tNPPyVitJVdeCmGpi+We kfnrXti+Au/uhaJzm7hFlArdooWI6yJWcrjGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=tHMVJluwBo6Feyg0W7ZjGVnzCVwH4xfG2GNg5UIeJxBI50Ry4yPoHdqteVbwwA9ueR daHssh5HJ0VyvI8+dgFagBbgnKtN+2Qcbpwq3eIhG9hA8Ag9aVNF2zJicJNh0D8b4P3U R+0qvFnHIth9qHzLc5WFbErafLo/Li6L90gZc= MIME-Version: 1.0 Received: by 10.239.142.3 with SMTP id e3mr664489hba.101.1247751197122; Thu, 16 Jul 2009 06:33:17 -0700 (PDT) Date: Thu, 16 Jul 2009 15:33:17 +0200 Message-ID: <560972290907160633q114155daod5ba66b3ca9b59d5@mail.gmail.com> Subject: Generating Lua code browsing information from coverage From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I have been playing with a little idea for a while. When comparing to static languages, there is this irritating issue with dynamic languages; it is hard to train development tools to browse code. Obviously one can parse code, but generally the destination of a particular method call is only known at run-time. So the idea is to generate enough coverage information (which is fairly straightforward using the debug library) from test runs to build a call graph. I can then teach an editor like SciTE to jump to the actual function call afterwards. Of course, there may be multiple such, but that's what makes it interesting. Using a ctags-like trick, one doesn't store line numbers but rather string patterns for the targets - otherwise the database rapidly gets useless as one edits. This does mean that you have to run the code before you can browse it, but this is not bad practice. Also can visually highlight covered code, etc. Is this a worthwhile idea to pursue? steve d. From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 11:16:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GEFuWu017569; Thu, 16 Jul 2009 11:15:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CEC318FAA; Thu, 16 Jul 2009 11:15:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B21AF18E61 for ; Thu, 16 Jul 2009 11:15:21 -0300 (BRT) Received: by bwz17 with SMTP id 17so232312bwz.5 for ; Thu, 16 Jul 2009 07:15:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.6.14 with SMTP id j14mr4817606mui.48.1247753719521; Thu, 16 Jul 2009 07:15:19 -0700 (PDT) In-Reply-To: <560972290907160633q114155daod5ba66b3ca9b59d5@mail.gmail.com> References: <560972290907160633q114155daod5ba66b3ca9b59d5@mail.gmail.com> Date: Thu, 16 Jul 2009 14:15:19 +0000 Message-ID: <90eb1dc70907160715s576e4e12s686b3b25f2312499@mail.gmail.com> Subject: Re: Generating Lua code browsing information from coverage From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6GEFuWu017569 On Thu, Jul 16, 2009 at 1:33 PM, steve donovan wrote: > This does mean that you have to run the code before you can browse it, > but this is not bad practice.  Also can visually highlight covered > code, etc. > > Is this a worthwhile idea to pursue? i think this is how the PLTScheme IDE's profiler/debugger/browser works. or am i widely wrong? -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 12:38:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GFcq1k006794; Thu, 16 Jul 2009 12:38:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D47E18B6F; Thu, 16 Jul 2009 12:38:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E52618ADE for ; Thu, 16 Jul 2009 12:38:14 -0300 (BRT) Received: by fxm11 with SMTP id 11so335244fxm.5 for ; Thu, 16 Jul 2009 08:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MMExHVQPCYvT4qmDknvce6qoucgpKdHW/9lDMiU1+4M=; b=UgWZlK3Zsqimzfk0n/xC9lESBG57TubyAxJVRkXNWtes/f8NngAFluwwv27XuWK2DM Mn3R8E0wmAfUcxuCCslDTfrB2fBKMZ64t8YMkaiY0aSxHveBUlAJBmHUfGJ3VT5vpB8M Un4LlgLFPTvoDJ97wI3x8nwK8BeTvUERr2mMU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qFQc/MX69MADy+kOcDWm0LOdM0lV+3h6mMYNCW7VC/lvutqN+H9phA2gdnR93akSql DwwfO7nEajnh47UIfWeIShEp9V10D0qw2j9ryhTcJZPP7Ashiq/FDOB5mO8KYFp9I6GQ cJq6iXvp94yajWK5V43xh04uzIHV7bpi1BvH0= MIME-Version: 1.0 Received: by 10.86.76.4 with SMTP id y4mr4843fga.22.1247758692554; Thu, 16 Jul 2009 08:38:12 -0700 (PDT) In-Reply-To: <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> Date: Thu, 16 Jul 2009 17:38:12 +0200 Message-ID: <2dcdf68e0907160838y6aba584dg6b6df693d8eed59c@mail.gmail.com> Subject: Re: Lua for MediaWiki? From: Peter Jacobi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 16, 2009 at 11:16 AM, steve donovan wrote: > That is a truly nasty path to follow! Implementing an interpreter > using another (slow) interpreter. But not without precedent. There's the Python-on-Javascript interpreter http://github.com/davisp/python-spidermonkey/tree/master and at least two (stale, AFAIK) attempts on Javascript-on-PHP (now, putting them in series, you'd have Python-on-PHP, with slow-motion already in the bundle...) Peter From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 12:51:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GFpMdt009702; Thu, 16 Jul 2009 12:51:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 007B2192E7; Thu, 16 Jul 2009 12:51:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F33A19143 for ; Thu, 16 Jul 2009 12:50:54 -0300 (BRT) Received: by bwz17 with SMTP id 17so324176bwz.5 for ; Thu, 16 Jul 2009 08:50:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.65.18 with SMTP id g18mr8947778bki.5.1247759452160; Thu, 16 Jul 2009 08:50:52 -0700 (PDT) Date: Thu, 16 Jul 2009 18:50:52 +0300 X-Google-Sender-Auth: cf4df96e76855ea6 Message-ID: Subject: # operator again... (sorry) From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, [the following it's just my current understanding of lua language -- apologies for any noise] Arrays are said to hold nils[1] but they cannot be iterated over orderly, nor can they hold trailing nils. You can only _infer_ how many nils are in between two contiguous sequences. This is just a bonus you get out of implementing arrays over maps, and not even a full bonus, since there's no sentinel at the end to allow you to infer the number of trailing nils, and you cannot iterate them orderly. The inability to use a table to store and later orderly iterate a vararg (which is a true sparse array) proves this point. That being said, I don't mind this, as long as the "map" concept stays consistent. That solves sparse arrays (by denying them). Now for the concept of contiguous arrays: ipairs() gives a simple and consistent definition of a contiguous array for _any table_. I'd like the # operator to follow that by always returning the index that ipairs() would return last (that is, the last index in the sequence that starts at 1). That way we would have contiguous arrays consistently defined by all built-in functions and operators. Currently, there's a subtile difference between for i=1,#t do print(t[i]) end, and for i,v in ipairs(t) do print v end This change modifies the meaning of the following idioms in the context of sparse arrays: t[#t+1] = v -- would always append to the array defined by ipairs(); now the holes are filled randomly. t[#t] = nil -- would always pop from the array defined by ipairs() first; not it consumes sequences randomly. t[#t] -- would always give the last element in the array defined by ipairs(); now it gives the last element in a randomly chosen sequence. Anything that could conflict with such changes? [1] http://lua-users.org/lists/lua-l/2006-03/msg00576.html From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 12:55:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GFtubD010468; Thu, 16 Jul 2009 12:55:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B237192F8; Thu, 16 Jul 2009 12:55:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B22119143 for ; Thu, 16 Jul 2009 12:55:28 -0300 (BRT) Received: by bwz17 with SMTP id 17so328466bwz.5 for ; Thu, 16 Jul 2009 08:55:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.24.11 with SMTP id b11mr4875309muj.133.1247759726465; Thu, 16 Jul 2009 08:55:26 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Jul 2009 15:55:26 +0000 Message-ID: <90eb1dc70907160855y6ee19822od9fc5b140dd2b12a@mail.gmail.com> Subject: Re: # operator again... (sorry) From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 16, 2009 at 3:50 PM, Cosmin Apreutesei wrote: > Anything that could conflict with such changes? performance. #t would decay into a O(n) operation -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 13:12:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GGBx0w014029; Thu, 16 Jul 2009 13:11:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 953E819312; Thu, 16 Jul 2009 13:11:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B1921930E for ; Thu, 16 Jul 2009 13:11:14 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MRTY3-0007OJ-76 for lua@bazar2.conectiva.com.br; Thu, 16 Jul 2009 16:11:07 +0000 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jul 2009 16:11:07 +0000 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jul 2009 16:11:07 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Lua for MediaWiki? Date: Thu, 16 Jul 2009 18:10:56 +0200 Lines: 16 Message-ID: References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> <2dcdf68e0907160838y6aba584dg6b6df693d8eed59c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <2dcdf68e0907160838y6aba584dg6b6df693d8eed59c@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 16/07/2009 17:38, Peter Jacobi wrote: > But not without precedent. There's the Python-on-Javascript > interpreter http://github.com/davisp/python-spidermonkey/tree/master > and at least two > (stale, AFAIK) attempts on Javascript-on-PHP (now, putting them in series, > you'd have Python-on-PHP, with slow-motion already in the bundle...) After all, we have already the Java on JavaScript from none less the mighty Google... :-) It would be funny... Imagine Kepler running on PHP! :-D -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 14:00:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GH0QMR025528; Thu, 16 Jul 2009 14:00:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBD74190A3; Thu, 16 Jul 2009 13:59:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C07DC18A9B for ; Thu, 16 Jul 2009 13:59:48 -0300 (BRT) Received: by ewy26 with SMTP id 26so372420ewy.5 for ; Thu, 16 Jul 2009 09:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=tLNDq8kDS+6pKRsLRhuwrHO0Wq8Xuecs0XR/ODBwIdc=; b=LVobH/SQkF0s3aaU/m/ED1lxwTl3AF7fCosMRTBQe8edav40gG5O7CIyxwBSlnA9it l8kNTxWcXYgUGBb5UUjudqcvcZbk4pPYUz4gusjBIfFWwuF0IjnxWy1254QOL5qasC3k IcMhiJ8401wca2iirP7MD8WeFnPJcCGgrgOHI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=mcUEnIvzewq6qIqpuGbRjD19tJAThw9GHPYy/x6ZhX0kF+VqyEkN17oS/JEFGhcoKi ZKtwVzFSSdHqQUUjBoh6rc+pq8Q2HVR02Yuf/yWouEJW9Nmg/Lk+OxDouyHdaXayq1MB 6ypJAchXDfC6VjtQiPM93de4bReKGtocDrY0I= MIME-Version: 1.0 Received: by 10.216.35.69 with SMTP id t47mr2483707wea.221.1247763586267; Thu, 16 Jul 2009 09:59:46 -0700 (PDT) In-Reply-To: <90eb1dc70907160855y6ee19822od9fc5b140dd2b12a@mail.gmail.com> References: <90eb1dc70907160855y6ee19822od9fc5b140dd2b12a@mail.gmail.com> From: Jerome Vuarand Date: Thu, 16 Jul 2009 18:59:26 +0200 Message-ID: <89d273ba0907160959s6001cc3cjcbdf319defff1a73@mail.gmail.com> Subject: Re: # operator again... (sorry) To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/16 Javier Guerra : > On Thu, Jul 16, 2009 at 3:50 PM, Cosmin > Apreutesei wrote: >> Anything that could conflict with such changes? > > performance. #t would decay into a O(n) operation And without a single change to Lua itself you can add support for sparse arrays with a couple functions: function pack(...) return {['#'] = select('#', ...), ...} end local _unpack = unpack function unpack(t, i, j) return _unpack(t, i, j or t['#']) end -- example local function foo(skip1, skip2, ...) return pack(...) end print(unpack(foo(1, 2, 3, nil, 5, 6, nil, nil))) --> 3 nil 5 6 nil nil If necessary you can even avoid putting the length in the array itself (in the example above at the key '#') with the help of a weak table. From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 14:44:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GHi1lF005786; Thu, 16 Jul 2009 14:44:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 559CE18FC9; Thu, 16 Jul 2009 14:43:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B77218CD5 for ; Thu, 16 Jul 2009 14:43:21 -0300 (BRT) Received: by fxm11 with SMTP id 11so455051fxm.5 for ; Thu, 16 Jul 2009 10:43:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.119.71 with SMTP id y7mr41794bkq.24.1247766198710; Thu, 16 Jul 2009 10:43:18 -0700 (PDT) In-Reply-To: <89d273ba0907160959s6001cc3cjcbdf319defff1a73@mail.gmail.com> References: <90eb1dc70907160855y6ee19822od9fc5b140dd2b12a@mail.gmail.com> <89d273ba0907160959s6001cc3cjcbdf319defff1a73@mail.gmail.com> Date: Thu, 16 Jul 2009 20:43:18 +0300 X-Google-Sender-Auth: 04181eb4a8f29da1 Message-ID: Subject: Re: # operator again... (sorry) From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6GHi1lF005786 Varargs have limited size and are much slower than tables (I speculate they were designed with the tuple concept in mind). With just tables you can't iterate sparse arrays without a sort or hashing operation. However, I'm fine with that, I don't need sparse arrays. I just wanted contiguous arrays with known length to work with _any_ table, just like ipairs() defines them for _any_ table. Right now I use the iterator ipairs() gives me in a while loop just to get the functionality of for i=2,#t. Btw, shouldn't inext() be exposed along with next()? On Thu, Jul 16, 2009 at 19:59, Jerome Vuarand wrote: > 2009/7/16 Javier Guerra : >> On Thu, Jul 16, 2009 at 3:50 PM, Cosmin >> Apreutesei wrote: >>> Anything that could conflict with such changes? >> >> performance.   #t would decay into a O(n) operation > > And without a single change to Lua itself you can add support for > sparse arrays with a couple functions: > > function pack(...) >    return {['#'] = select('#', ...), ...} > end > > local _unpack = unpack > function unpack(t, i, j) >    return _unpack(t, i, j or t['#']) > end > > -- example > local function foo(skip1, skip2, ...) >    return pack(...) > end > > print(unpack(foo(1, 2, 3, nil, 5, 6, nil, nil))) > --> 3       nil     5       6       nil     nil > > If necessary you can even avoid putting the length in the array itself > (in the example above at the key '#') with the help of a weak table. > -- http://www.gazolin.ro From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 15:32:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GIWD9n019363; Thu, 16 Jul 2009 15:32:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD1A218E78; Thu, 16 Jul 2009 15:31:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1FAC18A9B for ; Thu, 16 Jul 2009 15:31:35 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n6GIVY8j023931 for ; Thu, 16 Jul 2009 15:31:34 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 2FE9E54C04F; Thu, 16 Jul 2009 15:31:35 -0300 (BRT) Date: Thu, 16 Jul 2009 15:31:35 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua Workshop 2009 registration Message-ID: <20090716183135.GA24243@inf.puc-rio.br> References: <4A5E66F0.7070607@sct.microlink.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A5E66F0.7070607@sct.microlink.com.br> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I sent the registration form on June 1st and sent an e-mail asking for > confirmation one month later but didn't get any answer. > > Could someone confirm the registration process is working? Or better > yet, that I am registered? Luiz (lhf) is taking care of the pre-registration process, but he is travelling right now. He will answer you when he returns. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 16:04:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GJ4a7w026838; Thu, 16 Jul 2009 16:04:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 794B319024; Thu, 16 Jul 2009 16:04:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37DB718D03 for ; Thu, 16 Jul 2009 16:03:53 -0300 (BRT) Received: by fxm11 with SMTP id 11so526967fxm.5 for ; Thu, 16 Jul 2009 12:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=duzns6iPPiCAnB/4eKqrR8Z/7G++US8KEe0OI0m0rSk=; b=maX+hxz/vD0MET29oEPjWOvz6tHcvw01RfOfFNAMZI7BdI4BaSEKGJzynVz3txuRck XnkZMfBqZjSayoweO01RKJNT3qMfhBbiaQ7jPcdoRQeYwl2mgptcLR9VMrJnRZeUfewZ ovghxY5bjHc0B22s9/KjuoUQkTNvkvQL5nuLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=OWn+FP2USqnv7zQZ7LkT+m3ghvjFa2bRBkV8+3Z3nEJD3NCpiXZtUUBW1AWolk0Jgg a0gH4f4mn3ewZwPRd339NNP6A/FNvv/XFKKkNMjcRAJmk9aNn57YZdn8D8oamEue6wLj sf6o+aB9SYz/z4ZcJuL93MGLqf89WDB/QiLAY= Received: by 10.103.198.20 with SMTP id a20mr66938muq.29.1247771029648; Thu, 16 Jul 2009 12:03:49 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id y6sm1775074mug.40.2009.07.16.12.03.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 16 Jul 2009 12:03:49 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: common prefix? Date: Thu, 16 Jul 2009 21:03:17 +0200 X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, Does anyone has a little function to compute the common prefix of a list of strings? E.g.: local aList = { 'foobarbaz', 'foobar', 'foo' } print( CommonPrefix( aList ) ) > foo TIA. Cheers, PA. P.S. FWIW, this is what I have concocted so far, but it looks, hmmm, not right :) function LCP() local aPrefix = nil return function( aValue ) local aValue = tostring( aValue ) or '' aPrefix = aPrefix or aValue local aLength = math.min( aPrefix:len(), aValue:len() ) for anIndex = 0, aLength do aPrefix = aPrefix:sub( 1, aLength - anIndex ) if aValue:find( aPrefix, 1, true ) then break end end return aPrefix end end local aList = { 'foobarbaz', 'foobar', 'foo' } local aLCP = LCP() for anIndex, aValue in ipairs( aList ) do print( anIndex, aLCP( aValue ) ) end From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 16:18:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GJHuf7030250; Thu, 16 Jul 2009 16:17:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDCE119018; Thu, 16 Jul 2009 16:17:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D214518CE6 for ; Thu, 16 Jul 2009 16:17:22 -0300 (BRT) Received: by fxm11 with SMTP id 11so538874fxm.5 for ; Thu, 16 Jul 2009 12:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=6CmUdKyMnf4Pn/64bzSGaW3pm8aeGdcVnvPM4OwR4V8=; b=mci8mOEVO+JDQYcceqzhcvrf9dXa9upAShUJ3gyC2D8foh6+sYppgsrZ7ZEWlfWYNH z2zFCAC8AwoLPC4zjG5jHL5110Z9h0xvDCFMKhLW3FrsNgz9erKcsuPK560NDo/aVgYS iZx3oETQ0Cvir5NqOlP3iI8lcJwzPJrJLylzM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=DEFs0AznrrCeUEBX92KFGsrra0ayIQUvPGtqxEKrQXz6mERDRdfs474Hj/Rd9EEkVZ SDFoeCAJvnUMWmA1/X4aRorgjmy4fcKWr/7zFTubQJGfrwS3QBCLmnIQa91CG5b4KL0y yfiAsJCujPy/sfGhHnRffb6vwJytR//qCXus8= Received: by 10.103.160.9 with SMTP id m9mr55480muo.96.1247771840133; Thu, 16 Jul 2009 12:17:20 -0700 (PDT) Received: from ?95.78.67.76? ([95.78.67.76]) by mx.google.com with ESMTPS id j10sm1730544mue.59.2009.07.16.12.17.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jul 2009 12:17:19 -0700 (PDT) Date: Thu, 16 Jul 2009 23:17:10 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1547247329.20090716231710@gmail.com> To: Petite Abeille Subject: Re: common prefix? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Petite, Thursday, July 16, 2009, 11:03:17 PM, you wrote: > Does anyone has a little function to compute the common prefix of a > list of strings? str = aList[1] || '' n = length (str) for _,s in ipairs(aList) do while s:sub(1,n)~=str && n>0 do n=n-1 str=s:sub(1,n) end end > E.g.: > local aList = { 'foobarbaz', 'foobar', 'foo' } > print( CommonPrefix( aList ) ) >> foo > TIA. > Cheers, > PA. > P.S. > FWIW, this is what I have concocted so far, but it looks, hmmm, not > right :) > function LCP() > local aPrefix = nil > return function( aValue ) > local aValue = tostring( aValue ) or '' > aPrefix = aPrefix or aValue > local aLength = math.min( aPrefix:len(), aValue:len() ) > for anIndex = 0, aLength do > aPrefix = aPrefix:sub( 1, aLength - anIndex ) > if aValue:find( aPrefix, 1, true ) then > break > end > end > return aPrefix > end > end > local aList = { 'foobarbaz', 'foobar', 'foo' } > local aLCP = LCP() > for anIndex, aValue in ipairs( aList ) do > print( anIndex, aLCP( aValue ) ) > end -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Jul 16 16:22:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6GJMTUo031325; Thu, 16 Jul 2009 16:22:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA71218FDF; Thu, 16 Jul 2009 16:22:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97A8A18AB8 for ; Thu, 16 Jul 2009 16:22:00 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so115119eyd.11 for ; Thu, 16 Jul 2009 12:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MKxAiAGew/hG0zzii/rwnYzlrdD+hhJ4jE3JyV9Svh8=; b=vtEVh3r38X0xEOnr8v6kIUFv9S14PRrHSdOPx2fDS1/svIB+1qyGvCfY+D4nS1Zii1 M7BCC3ou1fR7iw8rdyLLEky1qAXSIBD5pXLayovIXj3WfzIHgLojL/e5Is7O/xp+xDCC 5KWRWsrxs47dos2lJ7kHGhzZ8c2Tknnezxgvk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pO0hmpLdTA/t6YsDbTJY8q9JymXQmKPySp5PiHhTBchnszf3oufcAuWXtExcZen139 MzRqWmqIWrw0TKrXOxUOSbozPhLuEzHEVFyIVqIpttoVGFdDNSceAx3/NxG+PZKy00ti kAo4g/VqoaSL7tqT2NS0Ai0JwKguqvH3rAIPE= MIME-Version: 1.0 Received: by 10.216.71.19 with SMTP id q19mr43771wed.65.1247772116948; Thu, 16 Jul 2009 12:21:56 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Jul 2009 20:21:56 +0100 Message-ID: Subject: Re: common prefix? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 16, 2009 at 8:03 PM, Petite Abeille wrote: > Hello, > > Does anyone has a little function to compute the common prefix of a list of > strings? > > E.g.: > > local aList = { 'foobarbaz', 'foobar', 'foo' } > > print( CommonPrefix( aList ) ) > >> foo > > TIA. > > Cheers, > > PA. Hi PA, This is how I would do it: -- local function commonprefix_aux(a,b,max) local count = 0 for i = 1,max do if (string.sub(a,i,i) ~= string.sub(b,i,i)) then return count end count = count + 1 end return count end function commonprefix(list) local first local prefixsize for i,v in ipairs(list) do if (i == 1) then first = v prefixsize = #first else prefixsize = math.min(prefixsize, commonprefix_aux(first,v,prefixsize)) if (prefixsize == 0) then break end end end return string.sub(first or '',1,prefixsize or 0) end -- -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 02:11:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6H5BbBB007257; Fri, 17 Jul 2009 02:11:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 672AD1920D; Fri, 17 Jul 2009 02:11:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33676191E4 for ; Fri, 17 Jul 2009 02:11:01 -0300 (BRT) Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n6H5AvpZ026651; Fri, 17 Jul 2009 14:10:57 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay31.aps.necel.com with ESMTP; Fri, 17 Jul 2009 14:10:57 +0900 Received: from dhlpc061 ([10.114.113.45] [10.114.113.45]) by relay31.aps.necel.com with ESMTP; Fri, 17 Jul 2009 14:10:57 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 5059352E228; Fri, 17 Jul 2009 14:10:57 +0900 (JST) From: Miles Bader To: steve donovan Subject: Re: Vala and Lua References: <560972290907160440h4c5b130em8ad274a98adc5183@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 17 Jul 2009 14:10:57 +0900 In-Reply-To: <560972290907160440h4c5b130em8ad274a98adc5183@mail.gmail.com> (steve donovan's message of "Thu, 16 Jul 2009 13:40:35 +0200") Message-ID: Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > Very cute concept: a modern object-orientated language without bloat > or runtime necessary (although to be fair GLib/Gnome is the runtime > for Vala) It seems that vala's entire purpose is to be a more programmer-friendly method for using glib/gtk, so that's not surprising... -Miles -- Patience, n. A minor form of despair, disguised as a virtue. From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 05:52:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6H8qRu8026163; Fri, 17 Jul 2009 05:52:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C00D1926F; Fri, 17 Jul 2009 05:51:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C684818D03 for ; Fri, 17 Jul 2009 05:51:53 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MRjAQ-00042h-IH for lua@bazar2.conectiva.com.br; Fri, 17 Jul 2009 08:51:47 +0000 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2009 08:51:46 +0000 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2009 08:51:46 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: common prefix? Date: Fri, 17 Jul 2009 10:51:39 +0200 Lines: 43 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 16/07/2009 21:03, Petite Abeille wrote: > Does anyone has a little function to compute the common prefix of a list > of strings? Perhaps not the best method, but it is an amusing approach, I think: function CommonPrefix(list) if #list == 0 then return '' end local first = list[1] local SEP = '\1' local listLen = #list local cl = SEP .. table.concat(list, SEP) local prefix = '' local pLen, maxLen = 0, #first local bOK = false repeat pLen = pLen + 1 prefix = string.sub(first, 1, pLen) --~ print(pLen .. ' ' .. prefix) local pattern = string.rep(SEP .. prefix .. '.-', listLen) --~ print(pattern) bOK = pLen <= maxLen and string.match(cl, pattern) until not bOK return string.sub(first, 1, pLen - 1) end print(CommonPrefix({ 'foobarbaz', 'foobar', 'foo' })) print(CommonPrefix({ 'foo', 'foobarbaz', 'foobar', 'foorass' })) print(CommonPrefix({ 'one' })) print(CommonPrefix({ 'x', 'y' })) print(CommonPrefix({ })) I would have preferred to write: local pattern = SEP .. prefix .. '.-{' .. listLen .. '}' (perhaps faster) but it is not possible in standard Lua. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 05:55:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6H8tPfV026454; Fri, 17 Jul 2009 05:55:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45F3819286; Fri, 17 Jul 2009 05:55:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2F11191D9 for ; Fri, 17 Jul 2009 05:55:02 -0300 (BRT) Received: by ewy26 with SMTP id 26so899949ewy.5 for ; Fri, 17 Jul 2009 01:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=pXiyZt9m0rbW+nxksryG8yRTEUbzf2zt1FQods19XOM=; b=PjGeJNTo8sutKpkoqBTyJF6MVbDMiHNHeSynFfpyztbK6gXj4PoQfnRNgik9QJNJbT dzYXymAAnz5Mmfs07YZZEECKMjL/z0Ns9QyNJeRYRlB8mhxkVHAybCY139qP+8emLEtE 1NlGvvT+YR1M25wt2tv7W6Q0S6Mwbn1JckMa0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=fhNCjQLlNpjPlEZ0w+OC2uOq7TaUmjpl2x+B+oiNNTBQ8+mouJrtlxHJGsdvbGFOdQ m/6QFXhCTrBdJcC+5jCCeFIKP/2Rbeb05Qw8FMd5rGDDK0/Nw95yfXhGB7C+AHa1v8fp E8x/9IrTGLc7gSr9rATCfxBpCjjuueLUPRJX8= MIME-Version: 1.0 Received: by 10.216.26.80 with SMTP id b58mr241061wea.35.1247820901217; Fri, 17 Jul 2009 01:55:01 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Fri, 17 Jul 2009 10:54:41 +0200 Message-ID: <89d273ba0907170154tbf60418r6518357d43617977@mail.gmail.com> Subject: Re: common prefix? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/17 Philippe Lhoste : > On 16/07/2009 21:03, Petite Abeille wrote: >> Does anyone has a little function to compute the common prefix of a list >> of strings? All the examples above use string.sub, so here is a different approach. It unpacks strings with string.byte, and check for character identity with the next(set, next(set))==nil construct. function lcp(...) local t1,t2 = {...},{} for k,v in pairs(t1) do t2[k] = {string.byte(v, 1, #v)} end local result = {} local i = 0 repeat i = i + 1 -- build a set of characters at index i local set = {} for _,t in ipairs(t2) do -- mark out of range access with a special marker set[t[i] or 'end'] = true end local c = next(set) -- if the set has more than one element, we reached the end of lcp local mismatch = next(set, c)~=nil local strend = c=='end' local lcpend = mismatch or strend if c and not lcpend then result[#result+1] = c end until lcpend return string.char(unpack(result)) end assert(lcp('foobarbaz', 'foobar', 'foofoo')=='foo') From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 06:00:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6H90WSE026933; Fri, 17 Jul 2009 06:00:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DDEA19285; Fri, 17 Jul 2009 06:00:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C861C190FC for ; Fri, 17 Jul 2009 06:00:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so902818ewy.5 for ; Fri, 17 Jul 2009 02:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=h2i7NFoJ4JEPU40+YMiHIyY4MHGDTlJJMQop3IaKJVo=; b=Ht3fDWfKVwtyqLKL9anfP6/LjQEQYqKfUsLsHUeFwTMpTrsqWAwWOcBC5NVCQaj+XO uGipiDtIUjcP2LPnEeZ9UY7QlmiN6/3XA7eIFUpT4Y/k6Kp00van03+bPIa+DKoSAx5/ gzcb+9E+sUU10oeYXI92P33gseCk3T74r1bW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jjWdIWp+MTOsrRlGFIHU50QgnE3wPTo4P9im67W/zXqp6bXh4xoNVW4txuTBfFC+Tk IWcXSnNhE1L2WJa5Zp4ERQvv8C592Ok+X8Dy+pu1+9s3u8xKr4DrDc1CZ6F+uJashqya woPFzWj3bYzde33PNI6tRMd3cHDP06GtXplS0= MIME-Version: 1.0 Received: by 10.216.15.84 with SMTP id e62mr225245wee.207.1247821203089; Fri, 17 Jul 2009 02:00:03 -0700 (PDT) In-Reply-To: References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> <2dcdf68e0907160838y6aba584dg6b6df693d8eed59c@mail.gmail.com> From: Jerome Vuarand Date: Fri, 17 Jul 2009 10:59:43 +0200 Message-ID: <89d273ba0907170159h5d99e540k525cb7149ced97b1@mail.gmail.com> Subject: Re: Lua for MediaWiki? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/16 Philippe Lhoste : > On 16/07/2009 17:38, Peter Jacobi wrote: >> >> But not without precedent. There's the Python-on-Javascript >> interpreter http://github.com/davisp/python-spidermonkey/tree/master >> and at least two >> (stale, AFAIK) attempts on Javascript-on-PHP (now, putting them in series, >> you'd have Python-on-PHP, with slow-motion already in the bundle...) > > After all, we have already the Java on JavaScript from none less the mighty > Google... :-) > > It would be funny... Imagine Kepler running on PHP! :-D If I followed correctly, the following exists: - Javascript-on-PHP - Java-on-Javascript - Lua-on-Java (Kahlua et al.) So transitively Lua-on-PHP should already work :-) From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 07:21:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HALZfl001806; Fri, 17 Jul 2009 07:21:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF3861929C; Fri, 17 Jul 2009 07:21:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08F7C18CD5 for ; Fri, 17 Jul 2009 07:21:02 -0300 (BRT) Received: by bwz17 with SMTP id 17so995457bwz.5 for ; Fri, 17 Jul 2009 03:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CeDWB+L4p32eVRNOiUIayLSzxRKJ8afVMNSaXCweW60=; b=KSB2dUshTFJDvSmIwoQ/rfM9cfE07DxhO/Lt6yfC51PeKueBVdcCqFyblkYTnReX/L MY9lQL/ioZHcv1sj8DkwMIqtIDsttp3pjqEDbXwLOAno2/zf1muCWjI3zIS9JD9Dg2pi 0zenl5X8nmMHG9C/pbPwicH0Hhos2tHaqziFc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AtLwdn76xTm12bxmttBwnK7ILCiPr8EomooLKc+RVnOniVzrCsKATAud/EhtP25Hqh x076ELQ+mWSkPwpCTkDTU3VUdQSgoweoaFK87Drc8KC26Yj8pq9jMDAivgvYubFpyz3Q MNQfJpgO87zXkxe9TJaG8Cv4CkakwW9NhR0Mo= MIME-Version: 1.0 Received: by 10.239.162.81 with SMTP id k17mr76780hbd.116.1247826061285; Fri, 17 Jul 2009 03:21:01 -0700 (PDT) In-Reply-To: <89d273ba0907170159h5d99e540k525cb7149ced97b1@mail.gmail.com> References: <2dcdf68e0907030043w7dbc9e15vec124f659f80b8f@mail.gmail.com> <2dcdf68e0907160108u3d840d55vdbc40da5c5f68a95@mail.gmail.com> <560972290907160216x12801707hd40a1c946754823b@mail.gmail.com> <2dcdf68e0907160838y6aba584dg6b6df693d8eed59c@mail.gmail.com> <89d273ba0907170159h5d99e540k525cb7149ced97b1@mail.gmail.com> Date: Fri, 17 Jul 2009 12:21:01 +0200 Message-ID: <560972290907170321r7333f2ddxd0d3a65a9abf172c@mail.gmail.com> Subject: Re: Lua for MediaWiki? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 17, 2009 at 10:59 AM, Jerome Vuarand wrote: > So transitively Lua-on-PHP should already work :-) > Well, translation is probably the way to go, which has been discussed before: http://lua-users.org/lists/lua-l/2008-11/msg00259.html But man, the semantic tangles! It would have to be a proper compiler, which happens to emit JavaScript, PHP or whatever. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 10:57:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HDv3Rq002428; Fri, 17 Jul 2009 10:57:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 340981929F; Fri, 17 Jul 2009 10:56:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67CBD1920D for ; Fri, 17 Jul 2009 10:56:20 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MRnv3-0001Th-TP for lua@bazar2.conectiva.com.br; Fri, 17 Jul 2009 13:56:14 +0000 Received: from dsl-rb-64-118-22-49.wtccommunications.ca ([64.118.22.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2009 13:56:13 +0000 Received: from arpin by dsl-rb-64-118-22-49.wtccommunications.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jul 2009 13:56:13 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Andre Subject: Re: common prefix? Date: Fri, 17 Jul 2009 13:56:01 +0000 (UTC) Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 64.118.22.49 (Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSN Optimized; US)) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille gmail.com> writes: > > Hello, > > Does anyone has a little function to compute the common prefix of a > list of strings? > > E.g.: > > local aList = { 'foobarbaz', 'foobar', 'foo' } > > print( CommonPrefix( aList ) ) > > > foo > > TIA. > > Cheers, > > PA. > > P.S. > I think this is really a matching problem ------------------------ start function getPrefix(t) -- empty tables should returned an empty string local prefix = "" for k,v in pairs(t) do if #prefix == 0 then -- first entry in the table is the longest prefix prefix = v else repeat -- if the prefix matches this is still the longest prefix if string.match(v, '^'..prefix) then break end -- remove the last character in the prefix prefix = string.sub(prefix,1,#prefix-1) until #prefix == 0 end -- we much check for an empty prefix otherwise we would -- use the next string as the prefix if #prefix == 0 then break end end return prefix end assert ('foo' == getPrefix({'foobarbaz', 'foobar', 'foofoo'})) ---------------------------end For efficiency you could set the prefix to "^" so you would not have to concatenate the caret in each loop. But this is easier to code. Andre From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 11:27:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HERdZS010238; Fri, 17 Jul 2009 11:27:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61C7A192AE; Fri, 17 Jul 2009 11:27:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EFFA19294 for ; Fri, 17 Jul 2009 11:26:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so1120575ewy.5 for ; Fri, 17 Jul 2009 07:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=r8g7wHGQQ+HGb97qJczmearv2P8xwIu8aPpO1pd6Sow=; b=NstwWX55jWG0mAl5poOkV3tGDsBNbyIyxSFYpnHc8EPjawR+tNLLbKUTgVhXw/AYcc 0J6FFVT+XXJ2/wnA7JsSC7EcdSVhym6XAfIdIWOXkFvEgnBYguFhLc8lTS+sw7klzA10 p3g2jlSHjUP6FOu7c9CWvGhnNAd1D0Be89XA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mIrUhxKRPjXdhemTIIZ0dGcEj2/Mkvvv8PpBRJnHLzky+XDqq8C7OBuRWz8Pn3JRQC B9jp+JOy25/4oXidE0feT6F5CIsN4skPqzztKUWuh1PxvJRopTMObRCZ90bV8s7DmTqI f+1AocQQyHjmQUcVg+tnd7KbVLMD26Irb36Ic= MIME-Version: 1.0 Received: by 10.216.29.213 with SMTP id i63mr315197wea.90.1247840812464; Fri, 17 Jul 2009 07:26:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Jul 2009 15:26:52 +0100 Message-ID: Subject: Re: common prefix? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6HERdZS010238 On Fri, Jul 17, 2009 at 2:56 PM, Andre wrote: > Petite Abeille gmail.com> writes: > >> >> Hello, >> >> Does anyone has a little function to compute the common prefix of a >> list of strings? >> >> E.g.: >> >> local aList = { 'foobarbaz', 'foobar', 'foo' } >> >> print( CommonPrefix( aList ) ) >> >>  > foo >> >> TIA. >> >> Cheers, >> >> PA. >> >> P.S. >> > > I think this is really a matching problem I can't see any reason to use: string.match(v, '^'..prefix) ...instead of: (string.sub(v,1,#prefix)==prefix) ...and using match also has the disadvantage that your prefix cannot include any of the "magic" matching characters like . [ ] % etc. Of course you can use a gsub to prefix these with % beforehand. Also I have a simpler suggested implementation to replace my earlier one: -- function commonprefix(list) local prefix for i,v in ipairs(list) do if (i == 1) then prefix = v else if (string.sub(v,1,#prefix) ~= prefix) then for i=1,#prefix do if (string.sub(v,i,i) ~= string.sub(prefix,i,i)) then prefix = string.sub(prefix,1,i-1) break end end end end if (#prefix == 0) then break end end return prefix or '' end -- -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 11:33:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HEXHcP011654; Fri, 17 Jul 2009 11:33:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CE38192B0; Fri, 17 Jul 2009 11:32:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD319192A1 for ; Fri, 17 Jul 2009 11:32:43 -0300 (BRT) Received: by gxk18 with SMTP id 18so230374gxk.5 for ; Fri, 17 Jul 2009 07:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Px8Vrn3/Qv+0n0o+rFbyxlenVFtOQiK9NtPeujCQKgw=; b=OpIz3RSPNDe/4PDeC+g8i9cGLRzKVk+2ID7knjHmSu2bzs86delakr+GYg/x9mqriu uQWWHv4bSIWHTzSXY4KKphjOf8sX/cCBXWD2KPQAHfNVPaHErOFdkbImm6hunFEJYQI2 Nbltm379vRY7b0Cmae8KSdU4h06wdFK4cfvU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=cN/a876+amzqgVzFl4HXNiDRuiOCMY7dngAUFL0Y4u3zBEk24IjQ9nZ/1+jQjVuq3V PVCVzU3WtlxLlQm/NVpiMtfIq6aKSTzcgHJktWADzzIjDPKNWbl5LGBz2j9JoZjH2795 /b6v+OtT/eUWCOmIrNiGS9KlRaUI5AM9+ZDc8= MIME-Version: 1.0 Received: by 10.150.152.17 with SMTP id z17mr814161ybd.150.1247841161195; Fri, 17 Jul 2009 07:32:41 -0700 (PDT) Date: Fri, 17 Jul 2009 10:32:39 -0400 Message-ID: <389545b10907170732w1b4cac7ai1538432d620712ce@mail.gmail.com> Subject: LuaSocket problem From: LW To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000e0cd47e1e263341046ee7a9fa X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd47e1e263341046ee7a9fa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I recently downloaded LuaSocket and started a small project to help me learn lua. So I took an old perl project I did a few years back and started porting it and adding features. For the network (web) piece I ran into a problem connecting to an IIS web server. On execution I get an error from the remote server about the request verb bad. A couple of things to note: After a bit of googling I found one post on a forum that suggested some versions of IIS are picky about headers so this lead me to change header casing in the adjustheaders function. It was also suggested to add a simple function to adjust the header casing from lower to capitalize.. Just above the adjustheaders I added a function for this and I'm still getting the, "request verb being bad". Below is the code in question: Does anyone see anything out of the obvious? #!/usr/loca/bin/lua local http = require("socket.http") local io = require("io") local ltn12 = require("ltn12") UserID = "userID=XXXXX" APIKey = "apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" CharID = "characterID=XXXXXXX" --Lame I know... reqbody = UserID.."&"..APIKey.."&"..CharID http.request { method = "POST", url = "http://api.eve-online.com/char/CharacterSheet.xml.aspx", headers= { ["Content-Type"] = "application/x-www-form-urlencoded", ["Content-Length"] = string.len(reqbody), }, source = ltn12.source.string(reqbody), sink = ltn12.sink.file(io.stdout) } Thanks, -LW --000e0cd47e1e263341046ee7a9fa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I recently downloaded LuaSocket and started a small project to help me= learn lua.
So I took an old perl project I did a few years back and started porti= ng it and adding
features.=A0
For the network (web) piece I ran into a problem connecting to an IIS = web server.
On execution I get an error from the remote server about the request v= erb bad.
=A0
A couple of things to note:
After a bit of googling I found one post on a forum that
suggested some versions of IIS=A0are picky about headers
so this lead me to change header casing in the adjustheaders function.=
It was also suggested to add a simple function to adjust the header ca= sing
from lower to capitalize.. Just above the adjustheaders I added a func= tion for this
and I'm still getting the, "request verb being bad".
=A0
Below is the code in question:
Does anyone see anything out of the obvious?

#!/usr/loca/bin/lua
=A0
local http =3D require("socket.http")
local io =3D requir= e("io")
local ltn12 =3D require("ltn12")
=A0

UserID =3D "userID=3DXXXXX"
APIKey =3D "apiKey= =3DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
CharID =3D "character= ID=3DXXXXXXX"
=A0
--Lame I know...=A0
reqbody =3D UserID.."&"..APIKey.= ."&"..CharID

http.request {
=A0=A0 method =3D "POST",
=A0=A0 ur= l =3D "http://api.eve-online.com/char/CharacterSheet.xml.aspx",
= =A0=A0 headers=3D {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ["Content-Type"] =3D "appl= ication/x-www-form-urlencoded",
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [= "Content-Length"] =3D string.len(reqbody),
=A0=A0 },
=A0=A0= source =3D ltn12.source.string(reqbody),
=A0=A0 sink =3D ltn12.sink.fil= e(io.stdout)

}
=A0
=A0
Thanks,
-LW
--000e0cd47e1e263341046ee7a9fa-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 12:18:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HFIGhi022143; Fri, 17 Jul 2009 12:18:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44220192BC; Fri, 17 Jul 2009 12:17:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (mx1.wp.pl [212.77.101.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1E1E192B0 for ; Fri, 17 Jul 2009 12:17:43 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 15293 invoked from network); 17 Jul 2009 17:17:39 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 17 Jul 2009 17:17:39 +0200 Message-ID: <4A609613.3010100@wp.pl> Date: Fri, 17 Jul 2009 17:17:39 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.21 (X11/20090319) MIME-Version: 1.0 To: Lua list Subject: Re: common prefix? References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [4dNk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille wrote: > Hello, > > Does anyone has a little function to compute the common prefix of a list > of strings? > > E.g.: > > local aList = { 'foobarbaz', 'foobar', 'foo' } > > print( CommonPrefix( aList ) ) > >> foo Here is my try: function CommonPrefix(...) local iterator=function(...) local T={...} local n=#T return function() if n>=1 then n=n-1 return T[n+1] else n=#T end end end local result={} local eos=false while not eos do local char, pos=nil, #result+1 for x in iterator(...) do if not char then char=x:sub(pos,pos) if char=='' then return (table.concat(result)) end else if char~=x:sub(pos,pos) then eos=true return table.concat(result) end end end result[#result+1]=char end return table.concat(result) end Good luck, miko From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 14:18:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HHHwZs013007; Fri, 17 Jul 2009 14:17:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53C29192BE; Fri, 17 Jul 2009 14:17:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (mx1.wp.pl [212.77.101.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76E8D192B4 for ; Fri, 17 Jul 2009 14:17:24 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 3720 invoked from network); 17 Jul 2009 19:17:20 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 17 Jul 2009 19:17:19 +0200 Message-ID: <4A60B21E.1090207@wp.pl> Date: Fri, 17 Jul 2009 19:17:18 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.21 (X11/20090319) MIME-Version: 1.0 To: Lua list Subject: Re: common prefix? References: <4A609613.3010100@wp.pl> In-Reply-To: <4A609613.3010100@wp.pl> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [kQNk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Michal Kolodziejczyk wrote: > Petite Abeille wrote: >> Hello, >> >> Does anyone has a little function to compute the common prefix of a list >> of strings? >> >> E.g.: >> >> local aList = { 'foobarbaz', 'foobar', 'foo' } >> >> print( CommonPrefix( aList ) ) >> >>> foo > > Here is my try: ...and yet another - you may like this one: function CommonPrefix(...) local anIterator=function(...) local TStrings={...} local numStrings=#TStrings local aCharPointer=1 local aChar return function() aChar=TStrings[1]:sub(aCharPointer,aCharPointer) for i=2,numStrings do if aChar~=TStrings[i]:sub(aCharPointer,aCharPointer) then return nil end end aCharPointer=aCharPointer+1 return aChar end end local aResult={} for aChar in anIterator(...) do aResult[#aResult+1]=aChar end return table.concat(aResult) end Regards, miko From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 15:45:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HIjJSN003414; Fri, 17 Jul 2009 15:45:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F30E6192CD; Fri, 17 Jul 2009 15:44:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0A71192B1 for ; Fri, 17 Jul 2009 15:44:36 -0300 (BRT) Received: by bwz17 with SMTP id 17so1327676bwz.5 for ; Fri, 17 Jul 2009 11:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=L5wV2qMimRSjOboU2Ya1YfUhlNt6fUrx1oECAw+ogaw=; b=x1+H/xA+kFRriQBm2ocLFER7MC/zea1Kl0rfZ0qtdJ8ryAeekw/40rMjHOgKv/y6RB LqccDEznK6d+p8vX10/2cqNfmXCeQhHdP74JGXkKiOQx92LoAEoWOorniwKXL2UJPbuV yt8bLFSsj52+2JWjXdnFY7CIU4tcDgOXw0SM0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LD9worYQvuSG9clMgKanaQW0ewHffklxH1QGdlivi6bf8Lg1e0OE/ob7ixWNpBXzyw wSwrO3FAoatkjstNbpdMgGiD6U6G/IG/N4LS5g+3LjD7D8Nhkhsaq4ALf1GTIJXnyt/s q8pOav+tGhzvyB7DiO0h5qNFtthFTDtQ3maBY= MIME-Version: 1.0 Received: by 10.223.112.204 with SMTP id x12mr665140fap.70.1247856272976; Fri, 17 Jul 2009 11:44:32 -0700 (PDT) Date: Fri, 17 Jul 2009 14:44:32 -0400 Message-ID: <7ca9cdc40907171144mb1ed23o73acc5a7a607b333@mail.gmail.com> Subject: Using Lua with .Net 2.0 (Visual Studio 2005) and LuaInterface From: Terry Bayne To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636c5b1f4e1adf1046eeb2db3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5b1f4e1adf1046eeb2db3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Good day, Not completely sure this is the correct venue since my questions only relate to Windows with .NET and Lua I've been using LuaInterface with .NET 2.0 and all and all it's been going pretty smoothly. I am trying to figure out how to install LuaInterface.dll the global assembly cache. Is there a tutorial somewhere on how to accomplish this? >From the LuaInterface readme, the dll now has a strong name.... but how the heck do I use it? Thanks Terry -- --001636c5b1f4e1adf1046eeb2db3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Good day,

Not completely sure this is the correct venue since my que= stions only relate to Windows with .NET and Lua

I've been using = LuaInterface with .NET 2.0 and all and all it's been going pretty smoot= hly.

I am trying to figure out how to install LuaInterface.dll the global as= sembly cache.=A0 Is there a tutorial somewhere on how to accomplish this?
From the LuaInterface readme, the dll now has a strong name.... but h= ow the heck do I use it?

Thanks
Terry

--

--001636c5b1f4e1adf1046eeb2db3-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 17 19:39:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6HMdfLY023190; Fri, 17 Jul 2009 19:39:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B029218904; Fri, 17 Jul 2009 19:39:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0e.pop-rio.com.br [200.239.248.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BECD7188EA for ; Fri, 17 Jul 2009 19:39:01 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MRw4y-0003Dx-30 for lua@bazar2.conectiva.com.br; Fri, 17 Jul 2009 19:39:00 -0300 Message-ID: <4A60FD9A.9030302@sct.microlink.com.br> Date: Fri, 17 Jul 2009 19:39:22 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Lua Workshop 2009 registration References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Great, thanks! ------------------------------ > > I sent the registration form on June 1st and sent an e-mail asking for > > confirmation one month later but didn't get any answer. > > > > Could someone confirm the registration process is working? Or better > > yet, that I am registered? Luiz (lhf) is taking care of the pre-registration process, but he is travelling right now. He will answer you when he returns. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Jul 18 12:33:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6IFXOe8011270; Sat, 18 Jul 2009 12:33:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 711F21902A; Sat, 18 Jul 2009 12:32:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F64418EA0 for ; Sat, 18 Jul 2009 12:32:45 -0300 (BRT) Received: by pzk28 with SMTP id 28so1061741pzk.11 for ; Sat, 18 Jul 2009 08:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hbFyEVK8Btrf6xtqMyx/B7dS/Cg1r8mdxj0HBe2DRPg=; b=xqTux4kEAjCAG99/xgYvpin9hhTVAljM/yVhQBMPC3mqtQXiw8JCTuKIfu2Pl2X2eR 4YVX2BhLhyE1YBleb/ffSc6j2qIB/l6VJKvgm74GeHQ+YZc3I5Hxo3ghngz8p3PbEsgf XJjnSB3a+0AvpEC4ORWB+n+AgF6nVbCHp+jJU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MKMwRQ4lJW8f+3hQYqNMHwTrJiR761xnJN2xVV5ZfZ48L+SkPGQ6WxpiI33ngGAj5+ mENSrU8XCgo4bcLQCnCK6RcyCfkqLS0iq8q1KNk24VUeA9rCU2nrBbX1BZ4es8FUpZ23 XlElL/S0R6w1lOL2UX+VKr1zexU/BjswBmhb8= MIME-Version: 1.0 Received: by 10.143.11.11 with SMTP id o11mr539824wfi.288.1247931164142; Sat, 18 Jul 2009 08:32:44 -0700 (PDT) In-Reply-To: <7ca9cdc40907171144mb1ed23o73acc5a7a607b333@mail.gmail.com> References: <7ca9cdc40907171144mb1ed23o73acc5a7a607b333@mail.gmail.com> Date: Sat, 18 Jul 2009 15:32:44 +0000 Message-ID: Subject: Re: Using Lua with .Net 2.0 (Visual Studio 2005) and LuaInterface From: Linker To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6IFXOe8011270 You may try Lua for Windows. On Fri, Jul 17, 2009 at 18:44, Terry Bayne wrote: > Good day, > > Not completely sure this is the correct venue since my questions only relate > to Windows with .NET and Lua > > I've been using LuaInterface with .NET 2.0 and all and all it's been going > pretty smoothly. > > I am trying to figure out how to install LuaInterface.dll the global > assembly cache.  Is there a tutorial somewhere on how to accomplish this? > > From the LuaInterface readme, the dll now has a strong name.... but how the > heck do I use it? > > Thanks > Terry > > -- > > -- Regards, Linker Lin linker.m.lin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Jul 18 15:30:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6IIULZ0026183; Sat, 18 Jul 2009 15:30:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 410A818B73; Sat, 18 Jul 2009 15:29:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20CF718B3D for ; Sat, 18 Jul 2009 15:29:46 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so391802eyd.11 for ; Sat, 18 Jul 2009 11:29:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.7.67 with SMTP id 45mr718288weo.95.1247941785117; Sat, 18 Jul 2009 11:29:45 -0700 (PDT) From: =?UTF-8?Q?Franti=C5=A1ek_Fuka?= Date: Sat, 18 Jul 2009 20:29:25 +0200 Message-ID: Subject: collectgarbage("count") To: Lua-List Content-Type: multipart/alternative; boundary=0016e64c1e8ccd638f046eff16e2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64c1e8ccd638f046eff16e2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit collectgarbage("count") should return "the total memory in use by Lua (in Kbytes)", which it does. But I am a little bit freaked out by the fact that it returns values like "17.6513671875", e.g. with precision higher than one-millionth of byte. Is this intentional and what exactly does it mean? -- Frantisek Fuka (yes, that IS my real name) (and it's pronounced "Fran-tjee-shek Foo-kah") Jabber/GoogleTalk ID: fuka@fuxoft.cz Homepage: http://www.fuxoft.cz --0016e64c1e8ccd638f046eff16e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable collectgarbage("count") should return "the total memory in u= se by Lua (in Kbytes)", which it does. But I am a little bit freaked o= ut by the fact that it returns values like "17.6513671875", e.g. = with precision higher than one-millionth of byte. Is this intentional and w= hat exactly does it mean?

--
Frantisek Fuka
(yes, that IS my real name)
(and it's p= ronounced "Fran-tjee-shek Foo-kah")

Jabber/GoogleTalk ID: = fuka@fuxoft.cz
Homepage: http://www.fuxoft.cz

--0016e64c1e8ccd638f046eff16e2-- From lua-bounces@bazar2.conectiva.com.br Sat Jul 18 15:36:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6IIaInJ026642; Sat, 18 Jul 2009 15:36:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A10A418C1B; Sat, 18 Jul 2009 15:35:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f184.google.com (mail-yx0-f184.google.com [209.85.210.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0E3018BB3 for ; Sat, 18 Jul 2009 15:35:53 -0300 (BRT) Received: by yxe14 with SMTP id 14so2549953yxe.33 for ; Sat, 18 Jul 2009 11:35:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.205.15 with SMTP id c15mr3565746ang.5.1247942152138; Sat, 18 Jul 2009 11:35:52 -0700 (PDT) In-Reply-To: References: Date: Sat, 18 Jul 2009 19:35:52 +0100 X-Google-Sender-Auth: df60859acbaf9064 Message-ID: Subject: Re: collectgarbage("count") From: Peter Cawley To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6IIaInJ026642 On Sat, Jul 18, 2009 at 7:29 PM, František Fuka wrote: > collectgarbage("count") should return "the total memory in use by Lua (in > Kbytes)", which it does. But I am a little bit freaked out by the fact that > it returns values like "17.6513671875", e.g. with precision higher than > one-millionth of byte. Is this intentional and what exactly does it mean? It's a result of converting the number to decimal. 17.6513671875 does not mean 17 Kb and 651.36... bytes, it means 17 Kb and 65136/100000 of a Kb. However, as a Kb is 1024 bytes rather than 1000 bytes, a fraction Kb in base 10 will often look odd. If you multiply the value by 1024, you get the byte count, which is a whole number: 17.6513671875 * 1024 = 18075 From lua-bounces@bazar2.conectiva.com.br Sun Jul 19 08:08:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6JB80fi017603; Sun, 19 Jul 2009 08:08:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCB901890C; Sun, 19 Jul 2009 08:07:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1D4B188F0 for ; Sun, 19 Jul 2009 08:07:24 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so437696eyd.11 for ; Sun, 19 Jul 2009 04:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=UxMG2LkftBbQPSNcL9CP36jMz9axnLdaK4nHeFPoeFA=; b=N2vuHQGzrtR3IYtqSExFhIN9GwMEwPVLYf8Co7xYFH2UAUhiO9/UPHjIXAo5RCRIta 8h6Um6EvoVPKS2kIEg1jgPEy0KN6astoceTvd0v6vwAgmWaUR+lA4JRhWp21cu14jVI3 OAMW412VZPAQRjtnN4rBHitcGixlUrmUgD1IQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=exIb1XdxNIFON7zyIXqEN2VyLdT6k8IFQbK4VevSyXmxq0mL+4+vEeScnNX4e3mHJ2 YUBjTmBnTlLYVo0LrDCMyFc3MGeMEfjsNycDCaXu1UDNUlGTxgv9LcyDrACQQIoWHsGg MH4NN95qOJlWLu0nm245ee1CcLSPcyyxQk5TM= Received: by 10.210.71.13 with SMTP id t13mr3785915eba.56.1248001642691; Sun, 19 Jul 2009 04:07:22 -0700 (PDT) Received: from ?192.168.1.5? (dsl-tkubrasgw1-ffccc100-243.dhcp.inet.fi [88.193.204.243]) by mx.google.com with ESMTPS id 28sm3314013eye.28.2009.07.19.04.07.21 (version=SSLv3 cipher=RC4-MD5); Sun, 19 Jul 2009 04:07:22 -0700 (PDT) Message-ID: <4A62FE7B.5020402@gmail.com> Date: Sun, 19 Jul 2009 14:07:39 +0300 From: Toni Spets User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: x86 floating-point unit assembly messing up Lua Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! I've been doing a Lua integration to the Quake 2 game engine and came across some strange optimizations in it that messes up Lua. Failing Lua code is a simple case like: foo = { "bar" } print(foo[1]) That should print "bar" but instead prints "nil". I wrote a hack that resets the FPU to it's original state before executing Lua and then setting it back to "optimized" mode. That seems to do the trick but I'm not 100% happy with it. The question here is: why this breaks Lua and should Lua do anything from the language side to workaround situations like this? I provided a simple C program that demonstrates the problem: -- snip -- #include #include #include #include #include /* Lua should print "bar", instead it prints "nil" on i386 */ #define LUA_CODE_BAD "local foo = { \"bar\" } print(foo[1])" void dolua(); int main(int argc, char **argv) { /* here is some i386 optimizations Quake 2 does and it breaks Lua if used with the game */ #ifdef __i386__ uint16_t cw; __asm__ __volatile__( "fnstcw %0" : "=m" (cw) ); printf( "Original FPU control word: %x\n", cw ); if( cw & 0x300 ) { printf( "Setting FPU to single precision mode\n" ); cw &= ~0x300; } printf( "Setting FPU control word: %x\n", cw ); __asm__ __volatile__( "fldcw %0" : : "m" (cw) ); #endif dolua(); return 0; } void dolua() { lua_State *lua_L; lua_L = lua_open(); luaL_openlibs(lua_L); luaL_loadstring(lua_L, LUA_CODE_BAD); printf("Executing: %s\nResult: ", LUA_CODE_BAD); lua_pcall(lua_L, 0, 0, 0); lua_close(lua_L); } -- snap -- From lua-bounces@bazar2.conectiva.com.br Sun Jul 19 08:26:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6JBQniX019081; Sun, 19 Jul 2009 08:26:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31CB518A93; Sun, 19 Jul 2009 08:26:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C82EE189AD for ; Sun, 19 Jul 2009 08:26:23 -0300 (BRT) Received: by ewy26 with SMTP id 26so1996006ewy.5 for ; Sun, 19 Jul 2009 04:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3QLqKY8WtThFlNUj45wOA3WwXUwndlgD9GduSjjMVOc=; b=lNwQpJwvnv8MhVI7qeu/TfDYRjgDeQ59/3gaI/2kDgR21RuXM4vI66yOesFbszQjJQ u495W3wJVOlAb3TTXaqvInnc8OaAQsWhevgCkHhFSugSLr60GXkkmLpb3nRO7po17rmr zFi0hmhc34t7/35UFMLj8fySVC0M3wW+/To38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=sT0n9iPnOjIlEXKV32bLMkTLOo6RnE1peVS2IUuRo1oCkJRT76LS4VY4uCputiFzJA 6gbK0Pfw0HJSkoo+hWtp5BFT3aU+w0EKfgRUE5VseM6rR0RG+ripTkIgAmuOxuffU/fD xGhOjNztjL70u415osa0F9Ca4SZOFJgVI1Asc= MIME-Version: 1.0 Received: by 10.216.22.206 with SMTP id t56mr888310wet.131.1248002780856; Sun, 19 Jul 2009 04:26:20 -0700 (PDT) In-Reply-To: <4A62FE7B.5020402@gmail.com> References: <4A62FE7B.5020402@gmail.com> Date: Sun, 19 Jul 2009 12:26:20 +0100 Message-ID: Subject: Re: x86 floating-point unit assembly messing up Lua From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Jul 19, 2009 at 12:07 PM, Toni Spets wrote: > I wrote a hack that resets the FPU to it's original state before executing > Lua and then setting it back to "optimized" mode. That seems to do the trick > but I'm not 100% happy with it. > > The question here is: why this breaks Lua and should Lua do anything from > the language side to workaround situations like this? This has come up before - Microsoft's DirectX will also clobber the FPU to single-precision mode when it starts up unless specifically told not to (search the Lua list archive for 'DirectX' and you should be able to find discussion about it). Unfortunately, unless the situation is different here somehow, the conclusion was that there isn't anything Lua can reasonably do out-of-the-box to dynamically work around it. I believe you can redefine lua_Number to be a single-precision float, but then of course you no longer have enough bits of integer precision to store all 32-bit integers. If what you have works, it may well be the best option available. -Duncan From lua-bounces@bazar2.conectiva.com.br Sun Jul 19 08:40:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6JBdwmM020621; Sun, 19 Jul 2009 08:39:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F827189EE; Sun, 19 Jul 2009 08:39:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43A401898D for ; Sun, 19 Jul 2009 08:39:29 -0300 (BRT) Received: by ewy26 with SMTP id 26so1999237ewy.5 for ; Sun, 19 Jul 2009 04:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Ie+rhcDFMAGuNWehhCt8WyuufOI2qiUVddVyJh38ZBg=; b=vcAdspKiHReXEACpIycUpYINai8HDziNztM2L7XgrbL78LUkLx1BZGPJ6JfcSTLSb1 /uvjRWsSMQmYfuCnD14T81qeB/g1Ubx/+05oSgbkCF3qbNIiHf7Hg107T056RW/a/iTI 4qnim1MW3vQ2wwNT1XZhcBiq4jNFXwL0KFz1U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=guoSMvy8COxnL0iwMKww02joL2tedjeqhk+IZs+0pzIP7HJNHkJ507XZO+2DlmOl0m /U3I9wO0zW/S0209GGEEXw/3WMv/L6lAzLbEQiuYP6itBYZA6l0M/Md+uBy00EJyPWmx zZ3ZRDuCIKALdxqCQQeBgQkp+hqtPChmR29jE= Received: by 10.211.194.4 with SMTP id w4mr3253520ebp.46.1248003566869; Sun, 19 Jul 2009 04:39:26 -0700 (PDT) Received: from ?192.168.1.5? ([88.193.204.243]) by mx.google.com with ESMTPS id 28sm3347405eye.58.2009.07.19.04.39.26 (version=SSLv3 cipher=RC4-MD5); Sun, 19 Jul 2009 04:39:26 -0700 (PDT) Message-ID: <4A6305FF.4090602@gmail.com> Date: Sun, 19 Jul 2009 14:39:43 +0300 From: Toni Spets User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: x86 floating-point unit assembly messing up Lua References: <4A62FE7B.5020402@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Duncan Cross wrote: > On Sun, Jul 19, 2009 at 12:07 PM, Toni Spets wrote: > >> I wrote a hack that resets the FPU to it's original state before executing >> Lua and then setting it back to "optimized" mode. That seems to do the trick >> but I'm not 100% happy with it. >> >> The question here is: why this breaks Lua and should Lua do anything from >> the language side to workaround situations like this? >> > > This has come up before - Microsoft's DirectX will also clobber the > FPU to single-precision mode when it starts up unless specifically > told not to (search the Lua list archive for 'DirectX' and you should > be able to find discussion about it). Unfortunately, unless the > situation is different here somehow, the conclusion was that there > isn't anything Lua can reasonably do out-of-the-box to dynamically > work around it. I believe you can redefine lua_Number to be a > single-precision float, but then of course you no longer have enough > bits of integer precision to store all 32-bit integers. If what you > have works, it may well be the best option available. > > -Duncan > Thanks for the reply. Should've searched the archives first :-) -- Toni Spets From lua-bounces@bazar2.conectiva.com.br Sun Jul 19 12:11:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6JFBN53004293; Sun, 19 Jul 2009 12:11:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC19D189EE; Sun, 19 Jul 2009 12:10:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FB2C1891C for ; Sun, 19 Jul 2009 12:10:49 -0300 (BRT) Received: by gxk18 with SMTP id 18so1582756gxk.5 for ; Sun, 19 Jul 2009 08:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=GLZmy1Yn6vvXBHjsnNe16Jjri8vtqg98xTM4jB/vulE=; b=RjSNnhlujqX96T0bJmO7WnXMf/n7c+SFrOgVezpksCyn+hZ28WMLVfVMxhJHmHKS/1 RfhQDX0cL7Qq8W76ZBqPfIAMhWY1qdH1dNOZvBIAlYxHpLI0rQW7D+sMaW+3o4uIVDoR PqooRrRdlCtjpf6HzVgOTXzRT+ySst7yfe08w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=LWb6YFsAN7IKDftbXDR+PQYhfE7X4AuLqXM/M0paHPJGxICo63JzdOI8aUPQNB7jmj Z/ZbnA+X7sZG+zoWMjHblZvqot9Gp3OpKmjNxYWjHQA88p/9XlQCa9hCMiw5B//o3d76 EGW34UJXJ/RDCTwQueWh5IBvwCE7RHI4TsT60= MIME-Version: 1.0 Received: by 10.151.148.7 with SMTP id a7mr1554445ybo.108.1248016246657; Sun, 19 Jul 2009 08:10:46 -0700 (PDT) Date: Sun, 19 Jul 2009 11:10:46 -0400 Message-ID: Subject: [ANN] lua-xosd (and wrapper library linking question) From: Scott Vokes To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I wrote a Lua wrapper for XOSD, an onscreen display library for X. The README and included test suite document its usage. XOSD: http://ignavus.net/software.html lua-xosd: http://silentbicycle.com/projects/lua-xosd-0.3.tar.gz I have a question about linking for libraries, though. If I require "xosd", but never use it for anything, Lua dumps core as the script completes. It works fine during normal operation, however. Am I building the shared library wrong? I haven't had this issue while wrapping other C libraries. (While this may be an issue with XOSD, I haven't been able to duplicate it in C.) Any thoughts? Running the included test2.lua segfaults for me. Thanks, Scott From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 01:05:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6K45Zpl006143; Mon, 20 Jul 2009 01:05:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAE9A18C57; Mon, 20 Jul 2009 01:05:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f171.google.com (mail-vw0-f171.google.com [209.85.212.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA74118866 for ; Mon, 20 Jul 2009 01:04:55 -0300 (BRT) Received: by vwj1 with SMTP id 1so262942vwj.33 for ; Sun, 19 Jul 2009 21:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=hrTII9sUSEPcxJoiIUYqHmKRvPw6j5kj0n71jSgCBTA=; b=Ck7XBZUGS2Sr6aUdpK/1eMILMkQotvZBI7Y9u5WmyN+/0GuqQcu5GLoQd42y9xOyKt nG+GAJYShjnRvUwXv0GPqeEO2jgv5WXKMHB+UvY0dYD3nNgWpvb4B9sDrt3kp5gM87Fq s6tpscjFAROgedPqRhuvMjSUBxd4s+e4GtRvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=M660rqfWmvjyKVHX4stEOUq5i5kPSDyyYM4VPc0iPVGIPeZXvlpB8uNl0gXlbUrU8t qjEIq6qkPQTq0Kw1dWoHikBD/gzw77oOwY89vrV25kyeHpUBUum3gsJl8DmpSxW4tvAy eg2WxgiUOxt5wGDOgFZ6AABAcEgHBPzHVYG4Q= MIME-Version: 1.0 Received: by 10.220.74.2 with SMTP id s2mr5283242vcj.37.1248062694309; Sun, 19 Jul 2009 21:04:54 -0700 (PDT) Date: Mon, 20 Jul 2009 01:04:54 -0300 Message-ID: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> Subject: os.date From: Marco Antonio Abreu To: Lua list Content-Type: multipart/alternative; boundary=00163631094f8d4060046f1b3ddb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163631094f8d4060046f1b3ddb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Guys, I was writting some code with os.date function and almost unintentionally I discovered some tag that is not in Lua documentation. Some of them are %F, %l, %j, %k, %s, %U, %W, %Z, %z and others Some I identified what they are, but some didn't. Anyone knows why they are not in Lua Documentation? Anyone has the complete table of the tags with their meaninng? Thanks, -- Marco Antonio Abreu mabreu.ti@gmail.com System Analist/Developer *Use caution:* Category: More info >> --00163631094f8d4060046f1b3ddb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Guys,
I was writting some code with os.date function and almost unint= entionally I discovered some tag that is not in Lua documentation. Some of= them are %F, %l, %j, %k, %s, %U, %W, %Z, %z and others

Some I iden= tified what they are, but some didn't.

Anyone knows why they are not in Lua Documentation?
Anyone has the c= omplete table of the tags with their meaninng?

Thanks,

-- Marco Antonio Abreu
mabreu.ti@gm= ail.com
System Analist/Developer
--00163631094f8d4060046f1b3ddb-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 02:12:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6K5CULM011213; Mon, 20 Jul 2009 02:12:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9507518B2F; Mon, 20 Jul 2009 02:12:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB7BD1888A for ; Mon, 20 Jul 2009 02:11:56 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so2415572rvb.41 for ; Sun, 19 Jul 2009 22:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=l6taeowaTlR1feCKuPpIiPMxKsZwKd7HXenwd2V82R8=; b=aJBkPRPuSJXtv/8H7YjmN+vQrodb17LUBIZIASH6RozPPytRImDzuQFIDUjnKW4H9P h0PEkGodwhwOPgPhRYMyRXmc1JFXC89u5wZ2MRf75Nbrk/wcLmdt0DlsKIGwwKAI84dL KbdENWQTEBUUFBACMaG3zqVcZkgdEfeOPS9l8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=UbsSyMneH5u3IfjH9vjkYom+2VNUpMOwhDVHaJoH1mae93WM3kTbl2Us2tZVR04GE6 HmjYAeFvMerreASR6gWsQm2AGgCfxMrWs7hWT1xm8pQDLpIGMdYd7Uvwxw2Ff6Yk9yog XvjxdLPWqTb4WMagWLz98oXlj+qxTPMISUa1k= Received: by 10.141.13.19 with SMTP id q19mr1968204rvi.31.1248066714690; Sun, 19 Jul 2009 22:11:54 -0700 (PDT) Received: from ?115.135.22.148? ([115.135.22.148]) by mx.google.com with ESMTPS id k41sm20180169rvb.37.2009.07.19.22.11.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 19 Jul 2009 22:11:54 -0700 (PDT) Message-ID: <4A63FC99.10103@gmail.com> Date: Mon, 20 Jul 2009 13:11:53 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: os.date References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> In-Reply-To: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Marco Antonio Abreu wrote: > Hi Guys, > I was writting some code with os.date function and almost > unintentionally I discovered some tag that is not in Lua documentation. > Some of them are %F, %l, %j, %k, %s, %U, %W, %Z, %z and others > > Some I identified what they are, but some didn't. > > Anyone knows why they are not in Lua Documentation? > Anyone has the complete table of the tags with their meaninng? Depends on the platform. Not all platform are standards-compliant. MinGW, for instance, nominally links to MSVCRT, and thus have many compliance issues. So, in order to be broadly multi-platform, I think not all tags can be used. But if you want to maximize what you can do with the platform you are on, just check the man pages for the full set of tags. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 03:19:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6K6JM7x016128; Mon, 20 Jul 2009 03:19:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58CD318CF8; Mon, 20 Jul 2009 03:18:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0E9818B55 for ; Mon, 20 Jul 2009 03:18:50 -0300 (BRT) Received: by bwz17 with SMTP id 17so2283109bwz.5 for ; Sun, 19 Jul 2009 23:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=i6vYGp+wiojwoUBLctjSd0DjEvVpuHDis0G1c5Xc/qU=; b=Gl7nFFA89ZSGANnmW+z4wzLX/PYL1RqSYJMwV0cCPNPektT6L+JVF4rxCUoZJ6NVT5 Qw5nku9tUjBZvEsaYDpurtNNtt5LVV4RC/l4z81a/P1DFYRUW41BtLF7alysw8eN4g8u YU+2a45lUtuOMZu4njVLM2i1Ln6OTSN57LLkQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PeEfTku4SDp3VihW3/hXkb6R6F57jMkCCSB+iLfXVlJeEwYCPj1nMQExQqp7RAwAt1 2cxM4xaYA2BlgeGA3QgEnAbSyimEu2M2EzZQgVsOJRi7dVuZU3YZnJWkuIj8J5+5PBjG qZNHaOhEN3gTlvfGrMCfgmJz6/n2XPg2BIuTU= MIME-Version: 1.0 Received: by 10.239.161.132 with SMTP id h4mr390838hbd.14.1248070728467; Sun, 19 Jul 2009 23:18:48 -0700 (PDT) In-Reply-To: <4A63FC99.10103@gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> Date: Mon, 20 Jul 2009 08:18:48 +0200 Message-ID: <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> Subject: Re: os.date From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 20, 2009 at 7:11 AM, KHMan wrote: > Depends on the platform. > > Not all platform are standards-compliant. MinGW, for instance, nominally > links to MSVCRT, and thus have many compliance issues. So, in order to be > broadly multi-platform, I think not all tags can be used. > > But if you want to maximize what you can do with the platform you are on, > just check the man pages for the full set of tags. These are provided by the 'standard' C function strftime, so either man or the MSDN page. There is a common set, but buyer beware! steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 05:28:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6K8Sqxg027302; Mon, 20 Jul 2009 05:28:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD5F318B28; Mon, 20 Jul 2009 05:28:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51F211892D for ; Mon, 20 Jul 2009 05:28:16 -0300 (BRT) Received: by ewy26 with SMTP id 26so2361229ewy.5 for ; Mon, 20 Jul 2009 01:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=i31kbVrjDMFRJo5xMF/EGgiegH4L5Qu5KL9kIkKWx4M=; b=SPAXUiCSDPlw8nRn1+D1g8Gx6iDUiMYdySF7MihUFxWKO+rvmSuISt6pgxgD/d3Rbw F0+EufCtmk0d7v3njtgCMN0QkAUKn6+vhIeQwp60r0aWnuxqVkhrQOuPT3/Eiy2xZkpq xqPXTWWfSgfVdUTAJOuewL9NaLfbiqlpPfA04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=CSCs/hdXl3eP+3x2dMTfPF0DgIFNmQ6cZ+yjzKo0/hC80mSus9cDgt0GcoIA3QYlDb hkVABeQ2IyCiAjOAmk7aFAMm8kJcd56zn9Ux+K6LO9iorRK6FlEy1U1dcitpCfwdQWBK MHyEfjQ0VXBqyiEGjLQ52yjiEKDUunWAQRXus= MIME-Version: 1.0 Received: by 10.216.26.80 with SMTP id b58mr1111976wea.35.1248078494355; Mon, 20 Jul 2009 01:28:14 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Mon, 20 Jul 2009 10:27:54 +0200 Message-ID: <89d273ba0907200127k592cdac6m41ff10721f6d43fb@mail.gmail.com> Subject: Re: collectgarbage("count") To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6K8Sqxg027302 2009/7/18 Peter Cawley : > On Sat, Jul 18, 2009 at 7:29 PM, František Fuka wrote: >> collectgarbage("count") should return "the total memory in use by Lua (in >> Kbytes)", which it does. But I am a little bit freaked out by the fact that >> it returns values like "17.6513671875", e.g. with precision higher than >> one-millionth of byte. Is this intentional and what exactly does it mean? > > It's a result of converting the number to decimal. > > 17.6513671875 does not mean 17 Kb and 651.36... bytes, it means 17 Kb > and 65136/100000 of a Kb. However, as a Kb is 1024 bytes rather than > 1000 bytes, a fraction Kb in base 10 will often look odd. If you > multiply the value by 1024, you get the byte count, which is a whole > number: > > 17.6513671875 * 1024 = 18075 IMHO it would feel more natural if the returned value was in kiB rather than in kB. It would preserve byte precision for much bigger values. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 05:31:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6K8V0QD027593; Mon, 20 Jul 2009 05:31:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD25818BD4; Mon, 20 Jul 2009 05:30:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C61A1892D for ; Mon, 20 Jul 2009 05:30:34 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so515126eyd.11 for ; Mon, 20 Jul 2009 01:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=9wTpk2cVDEdiqMJvXg+LI8gSNZ9rFRAxP61ZdqMi24E=; b=GTFumNu8h1VCALghBd3DQypBrJfQIikxyQ7VYB8fcsPiV/qqiFE/mVSzyrGL8HHuDO BQUOvBGFcYROolywDni1+5s8eGMhdmQfHWva8nXGAXifEJ7N2+Qg+jF9eKl0RvGR9E2s qXgb1QEMJQOENxg0ZGOf6IurCV6YD6yvlIWdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PyJIWHPVva8EMwlz0zBdYcgFm6h3ZLJAwOhscBSsvfyTIPMC/2v5pi6i+He5XuTq2g lclmVEgTRfS1vVhCESxGGPraxGDVIt6SkkGhsV/7KQBN07Wo4FXkm2m8kipvf4vO8Mu0 W/DI7kEbam7nW2V+L7GAEGs157T+s+p6VAZdg= MIME-Version: 1.0 Received: by 10.216.3.196 with SMTP id 46mr1127090weh.205.1248078633475; Mon, 20 Jul 2009 01:30:33 -0700 (PDT) In-Reply-To: <89d273ba0907200127k592cdac6m41ff10721f6d43fb@mail.gmail.com> References: <89d273ba0907200127k592cdac6m41ff10721f6d43fb@mail.gmail.com> From: Jerome Vuarand Date: Mon, 20 Jul 2009 10:30:13 +0200 Message-ID: <89d273ba0907200130w38ce0a69k2f6cb811fb3f2f77@mail.gmail.com> Subject: Re: collectgarbage("count") To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6K8V0QD027593 2009/7/20 Jerome Vuarand : > 2009/7/18 Peter Cawley : >> On Sat, Jul 18, 2009 at 7:29 PM, František Fuka wrote: >>> collectgarbage("count") should return "the total memory in use by Lua (in >>> Kbytes)", which it does. But I am a little bit freaked out by the fact that >>> it returns values like "17.6513671875", e.g. with precision higher than >>> one-millionth of byte. Is this intentional and what exactly does it mean? >> >> It's a result of converting the number to decimal. >> >> 17.6513671875 does not mean 17 Kb and 651.36... bytes, it means 17 Kb >> and 65136/100000 of a Kb. However, as a Kb is 1024 bytes rather than >> 1000 bytes, a fraction Kb in base 10 will often look odd. If you >> multiply the value by 1024, you get the byte count, which is a whole >> number: >> >> 17.6513671875 * 1024 = 18075 > > IMHO it would feel more natural if the returned value was in kiB > rather than in kB. It would preserve byte precision for much bigger > values. Forget about my previous email, I just realized the value is actually expressed in kiBs. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:23:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDNkw5027688; Mon, 20 Jul 2009 10:23:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61D7318C46; Mon, 20 Jul 2009 10:22:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-dub.microsoft.com (smtp-dub.microsoft.com [213.199.138.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC82818B55 for ; Mon, 20 Jul 2009 10:22:41 -0300 (BRT) Received: from dub-exhub-c302.europe.corp.microsoft.com (65.53.213.92) by DUB-EXGWY-E802.partners.extranet.microsoft.com (10.251.129.2) with Microsoft SMTP Server (TLS) id 8.2.99.4; Mon, 20 Jul 2009 14:22:35 +0100 Received: from EA-EXMSG-C332.europe.corp.microsoft.com ([65.53.221.85]) by DUB-EXHUB-C302.europe.corp.microsoft.com ([65.53.213.92]) with mapi; Mon, 20 Jul 2009 14:22:34 +0100 From: Jonathan Shaw To: Lua list Date: Mon, 20 Jul 2009 14:22:32 +0100 Subject: Potential bug in Lua when hooking functions Thread-Topic: Potential bug in Lua when hooking functions Thread-Index: AcoJPSMvH+gKn/PCR5WQZBHnVJXitQ== Message-ID: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_811C9037A5D58848B733B6F36BA8BB532D10E2C2FDEAEXMSGC332eu_" MIME-Version: 1.0 Cc: Stephen Broadley X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_811C9037A5D58848B733B6F36BA8BB532D10E2C2FDEAEXMSGC332eu_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello! We've come across an interesting behaviour when calling a function in the c= ontext of a coroutine that's yielded. Our Lua Debugger programmer believes = that there's a bug in Lua, and has a proposed solution: When executing code on a lua_State in a LUA_YIELD state, if the Lua traceex= ec function is called, the "L->state" variable remains LUA_YIELD after the = traceexec call and unexpectedly interrupts execution. Proposed solution in RED. File is lvm.c, starting on line 388 in luaV_execu= te if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && (--L->hookcount =3D=3D 0 || L->hookmask & LUA_MASKLINE)) { const lu_byte saved_status =3D L->status; L->status =3D 0; traceexec(L, pc); if (L->status =3D=3D LUA_YIELD) { /* did hook yield? */ L->savedpc =3D pc - 1; return; } L->status =3D saved_status; base =3D L->base; Thank you, and thank you for Lua - we love it :) Jonathan --_000_811C9037A5D58848B733B6F36BA8BB532D10E2C2FDEAEXMSGC332eu_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello!=

 =

We’ve come across = an interesting behaviour when calling a function in the context of a coroutine that’s yielded. Our Lua Debugger programmer believes that there’= ;s a bug in Lua, and has a proposed solution:

 =

When executing code on a lua_State in a LUA_YIELD state, if the Lua traceexec function is called, th= e “L->state” variable remains LUA_YIELD after the traceexec ca= ll and unexpectedly interrupts execution.

 =

Proposed solution in RED. File is lvm.c, starting on line 388 in luaV_execu= te

 =

    if ((L->hookma= sk & (LUA_MASKLINE | LUA_MASKCOUNT)) &&

        (--L->hookcount =3D=3D 0 || L->hookmask & LUA_MASKLINE))= {

      const= lu_byte saved_status =3D L->status;

      L->status =3D 0;

      traceexec(L<= /b>, pc);

      if (L-&g= t;status =3D=3D LUA_YIELD) {  /* did hook yield? */

        L-&= gt;savedpc =3D pc - 1;

        return<= /b>;

      }

      L->status =3D saved_status;

      base =3D L->base;

 

Thank you, and thank you for Lua – we love it J

 

Jonathan

--_000_811C9037A5D58848B733B6F36BA8BB532D10E2C2FDEAEXMSGC332eu_-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:29:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDT6Av029038; Mon, 20 Jul 2009 10:29:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 758E218C6A; Mon, 20 Jul 2009 10:28:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0928018B30 for ; Mon, 20 Jul 2009 10:28:36 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MSsup-0001v2-Si for ; Mon, 20 Jul 2009 14:28:27 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MSsuw-0000fD-7P for lua@bazar2.conectiva.com.br; Mon, 20 Jul 2009 14:28:34 +0100 Date: Mon, 20 Jul 2009 14:28:33 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Potential bug in Lua when hooking functions Message-ID: <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> In-Reply-To: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 20 Jul 2009 14:22:32 +0100 Jonathan Shaw wrote: > Proposed solution in RED In red? It's all black here :) Perhaps a traditional diff would be better. B. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:37:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDbsFG031294; Mon, 20 Jul 2009 10:37:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 559B918CF8; Mon, 20 Jul 2009 10:37:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-dub.microsoft.com (smtp-dub.microsoft.com [213.199.138.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D29AD18CCC for ; Mon, 20 Jul 2009 10:37:25 -0300 (BRT) Received: from dub-exhub-c302.europe.corp.microsoft.com (65.53.213.92) by DUB-EXGWY-E801.partners.extranet.microsoft.com (10.251.129.1) with Microsoft SMTP Server (TLS) id 8.2.99.4; Mon, 20 Jul 2009 14:37:24 +0100 Received: from EA-EXMSG-C332.europe.corp.microsoft.com ([65.53.221.85]) by DUB-EXHUB-C302.europe.corp.microsoft.com ([65.53.213.92]) with mapi; Mon, 20 Jul 2009 14:37:24 +0100 From: Jonathan Shaw To: Lua list Date: Mon, 20 Jul 2009 14:37:22 +0100 Subject: RE: Potential bug in Lua when hooking functions Thread-Topic: Potential bug in Lua when hooking functions Thread-Index: AcoJPgnPImhldtV9RVqt3wxWdrsiMwAAQRmg Message-ID: <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6KDbsFG031294 Forgive my ignorance, but how would a traditional diff be best displayed in a text only format? For now I've put a + in front of the new lines: if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + const lu_byte saved_status = L->status; + L->status = 0; traceexec(L, pc); if (L->status == LUA_YIELD) { /* did hook yield? */ L->savedpc = pc - 1; return; } + L->status = saved_status; base = L->base; -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Rob Kendrick Sent: 20 July 2009 14:29 To: lua@bazar2.conectiva.com.br Subject: Re: Potential bug in Lua when hooking functions On Mon, 20 Jul 2009 14:22:32 +0100 Jonathan Shaw wrote: > Proposed solution in RED In red? It's all black here :) Perhaps a traditional diff would be better. B. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:44:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDi8kQ032661; Mon, 20 Jul 2009 10:44:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 126AF18D42; Mon, 20 Jul 2009 10:43:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C42218C55 for ; Mon, 20 Jul 2009 10:43:41 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so1120905ana.26 for ; Mon, 20 Jul 2009 06:43:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.205.15 with SMTP id c15mr6221620ang.5.1248097418469; Mon, 20 Jul 2009 06:43:38 -0700 (PDT) In-Reply-To: <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> Date: Mon, 20 Jul 2009 14:43:38 +0100 X-Google-Sender-Auth: 78cb166639ea7c78 Message-ID: Subject: Re: Potential bug in Lua when hooking functions From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 20, 2009 at 2:37 PM, Jonathan Shaw wrote: > Forgive my ignorance, but how would a traditional diff be best displayed in a text only format? As the plaintext output from the diff program would be one option: E:\CPP\lua-5.1.4>diff -u src\lvm.c srcnew\lvm.c --- src\lvm.c Sun Feb 8 13:30:49 2009 +++ srcnew\lvm.c Mon Jul 20 14:41:03 2009 @@ -387,11 +387,14 @@ StkId ra; if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + const lu_byte saved_status = L->status; + L->status = 0; traceexec(L, pc); if (L->status == LUA_YIELD) { /* did hook yield? */ L->savedpc = pc - 1; return; } + L->status = saved_status; base = L->base; } /* warning!! several calls may realloc the stack and invalidate `ra' */ From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:45:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDjZGf000579; Mon, 20 Jul 2009 10:45:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C338118D9B; Mon, 20 Jul 2009 10:45:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC01818C55 for ; Mon, 20 Jul 2009 10:45:09 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MStAv-0005p7-00; Mon, 20 Jul 2009 15:45:05 +0200 Date: Mon, 20 Jul 2009 15:45:00 +0200 From: Mike Pall To: Lua list Subject: Re: Potential bug in Lua when hooking functions Message-ID: <20090720134500.GA7733@mike.de> References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jonathan Shaw wrote: > We've come across an interesting behaviour when calling a > function in the context of a coroutine that's yielded. The only thing you're allowed to do with a coroutine in yielded state is to resume it. Calling a function on a lua_State object which is in any state other than 0 (as returned by lua_status()) is invoking undefined behavior. You may get away with it in the current version of Lua, but that's not a guarantee for future versions or different VMs implementing the Lua ABI. The problem you've just discovered illustrates one meaning of 'undefined'. In general it's not advisable to mix resume/yield and call/pcall on the same lua_State. Lua states/coroutines are cheap to create, so better create extra ones for different purposes. Summary: not a bug in Lua, please fix your application. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:46:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDkYiR000745; Mon, 20 Jul 2009 10:46:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBA9818E78; Mon, 20 Jul 2009 10:46:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E472E18C55 for ; Mon, 20 Jul 2009 10:46:07 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0152.bmts.com [209.240.125.152]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n6KDjrKm014476 for ; Mon, 20 Jul 2009 09:46:00 -0400 Message-ID: <4A647511.9020306@hempeldesigngroup.com> Date: Mon, 20 Jul 2009 09:45:53 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Potential bug in Lua when hooking functions References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> In-Reply-To: <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jonathan Shaw wrote: > Forgive my ignorance, but how would a traditional diff be best > displayed in a text only format? For now I've put a + in front of the new lines: I think he means a diff generated by using the *nix diff program :-) Ralph From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 10:48:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KDm9B8001190; Mon, 20 Jul 2009 10:48:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 176B718EE3; Mon, 20 Jul 2009 10:47:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BC6E18C55 for ; Mon, 20 Jul 2009 10:47:42 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MStDK-0005IL-Jl for ; Mon, 20 Jul 2009 14:47:34 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MStDR-0001U0-2J for lua@bazar2.conectiva.com.br; Mon, 20 Jul 2009 14:47:41 +0100 Date: Mon, 20 Jul 2009 14:47:40 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Potential bug in Lua when hooking functions Message-ID: <20090720144740.17e39b28@trite.i.flarn.net.i.flarn.net> In-Reply-To: <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> References: <811C9037A5D58848B733B6F36BA8BB532D10E2C2FD@EA-EXMSG-C332.europe.corp.microsoft.com> <20090720142833.744b8a9a@trite.i.flarn.net.i.flarn.net> <811C9037A5D58848B733B6F36BA8BB532D10E2C314@EA-EXMSG-C332.europe.corp.microsoft.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 20 Jul 2009 14:37:22 +0100 Jonathan Shaw wrote: > Forgive my ignorance, but how would a traditional diff be best > displayed in a text only format? Traditionally, using the diff tool. For your patch, it generates the following; diff -aru lua-5.1.4/src/lvm.c lua-5.1.4-yeild-fix/src/lvm.c --- lua-5.1.4/src/lvm.c 2009-03-20 18:03:04.517261443 +0000 +++ lua-5.1.4-yeild-fix/src/lvm.c 2009-07-20 14:44:18.067091491 +0100 @@ -616,11 +616,14 @@ StkId ra; if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + const lu_byte saved_status = L->status; + L->status = 0; traceexec(L, pc); if (L->status == LUA_YIELD) { /* did hook yield? */ L->savedpc = pc - 1; return; } + L->status = saved_status; base = L->base; } /* warning!! several calls may realloc the stack and invalidate `ra' */ (Incidentally, in my copy of Lua 5.1.4, this region starts around line 620, not on line 388; have you modified your copy of Lua in other ways?) B. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 13:26:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KGQDbx007768; Mon, 20 Jul 2009 13:26:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FC48189F6; Mon, 20 Jul 2009 13:25:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29E781880A for ; Mon, 20 Jul 2009 13:25:35 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KGPXFU007677 for ; Mon, 20 Jul 2009 13:25:33 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6KGPUi15050; Mon, 20 Jul 2009 13:25:30 -0300 Date: Mon, 20 Jul 2009 13:25:30 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Workshop 2009 registration Message-ID: <20090720132530.A15033@lua.tecgraf.puc-rio.br> References: <4A5E66F0.7070607@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4A5E66F0.7070607@sct.microlink.com.br>; from aleirade@sct.microlink.com.br on Wed, Jul 15, 2009 at 08:32:00PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I sent the registration form on June 1st and sent an e-mail asking for > confirmation one month later but didn't get any answer. We are still collecting pre-registrations. We expect that this process will be over by the end of August (if not sooner) and then registrations will be confirmed based on the demand and on the size of the room at PUC-Rio. > Could someone confirm the registration process is working? Or better > yet, that I am registered? The process seems to be working -- we haven't had any complaints about messages to lua.workshop@gmail.com bouncing. In particular, your form has been received. Thanks for your interest in the workshop. --lhf From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 14:17:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KHHk3g020596; Mon, 20 Jul 2009 14:17:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F329118C55; Mon, 20 Jul 2009 14:17:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30D1718B38 for ; Mon, 20 Jul 2009 14:17:11 -0300 (BRT) Received: by fxm25 with SMTP id 25so1530427fxm.5 for ; Mon, 20 Jul 2009 10:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=0aRB5DDnioS1mFparHyml+B+/KfLDiWH6w0kIa+tqzU=; b=C3S4wqNrkhAEo3q8LyRtRKZEpOqdhExykbJM0yaI9X0kXsnZcCLfeyi2LBC5nCRJ7Y KxB2Pptl4c+obiLYXvDi7cp7fvJL3i9wNQWE2UVB+t2gAk4mi+t1A+5+jCkKgcuor8G9 uyYCUKnEK2cu7YiuO6XzYCnfHSSFtjZ+FjpvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Md1g/cxr29iRj5Xj6NYW3HbVpMVrvJxv4fhhadQPwZyA3zMy8Vknt4cu+50zrBPQRt BoOQzoOpkoCYVI3OLLhf/BUtBH8up8ohmiPBywysTVIV5DtNcvC/jWxQWpmmiHpC5y7F CGzH5LvQbtKgOownU7lV7d/6iWflzbPX+sPxA= Received: by 10.103.177.1 with SMTP id e1mr915268mup.109.1248110230689; Mon, 20 Jul 2009 10:17:10 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id 7sm22999070mup.24.2009.07.20.10.17.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 20 Jul 2009 10:17:10 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <4A60B21E.1090207@wp.pl> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: common prefix? Date: Mon, 20 Jul 2009 19:16:38 +0200 References: <4A609613.3010100@wp.pl> <4A60B21E.1090207@wp.pl> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 17, 2009, at 7:17 PM, Michal Kolodziejczyk wrote: >> Here is my try: > > ...and yet another - you may like this one: Thanks to all who responded :) Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Mon Jul 20 19:02:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6KM2q7t018728; Mon, 20 Jul 2009 19:02:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8B0E18E5B; Mon, 20 Jul 2009 19:01:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67FFA18993 for ; Mon, 20 Jul 2009 19:01:46 -0300 (BRT) Received: by bwz17 with SMTP id 17so2803418bwz.5 for ; Mon, 20 Jul 2009 15:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=HohmOa/wYX8E6ixUvdgqtwVliaBemPHua/ncQU4jBXQ=; b=w1h+eOJ/csKOxj6gxISOaXtPXwEJ7nGx0w/Ay1IYCih8DDRn4//BB72OzVOLFMvZZi lVMxO+ExP13IAIzdXu+w43sQAVO6TzKnzAWx/Ae+7cPsuk2apslfT3QaCkn4P1g0+D+l kfKV5Jea0BDPd/AZhIAgy9BwL3OeJfXkarm0E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=VAjiaWuYAMdnRgORJC/Y2VDVjm45NDXJHbN26SSNd2Y7tsxGgC52/MRtZhQzrK4+JA 8+0ar95yiC0u9N293NB30gLjeeZbh3Kf6T4u9UsaFyYdHnsnvaF0rfkxS889Lg9fEEhG Ohvk5Z9Y0XcsjkPjAWhp9GvYlLtIYvgTWzLqo= MIME-Version: 1.0 Received: by 10.223.108.75 with SMTP id e11mr1613117fap.97.1248127303883; Mon, 20 Jul 2009 15:01:43 -0700 (PDT) Date: Mon, 20 Jul 2009 18:01:43 -0400 Message-ID: <3bc2d2600907201501s4237d82ev2809fce6f9f7255f@mail.gmail.com> Subject: Re: common prefix? From: phlnc8 To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Here is a compact version (maybe not very efficient...) function lcp(lst, i, pfx) return (not lst[i] or lst[i]:sub(1, #pfx) == lcp(lst, i+1, pfx) ) and pfx or lcp(lst, 1, pfx:sub(1, #pfx-1)) end aList = { 'foobarbaz', 'foobar', 'foo' } > print( lcp(aList, 1, aList[1]) ) foo Could be made nicer with one additional line: function lcp(lst, i, pfx) i = i or 1; pfx = pfx or lst[1] return (not lst[i] or lst[i]:sub(1, #pfx) == lcp(lst, i+1, pfx) ) and pfx or lcp(lst, 1, pfx:sub(1, #pfx-1)) end > print( lcp(aList) ) foo Of course replacing the and/or with if/then/else would make it more legible, but larger :-) --Phil From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 05:06:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L86M0V016917; Tue, 21 Jul 2009 05:06:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A1F418AB4; Tue, 21 Jul 2009 05:05:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.ucrony.net (mail.ucrony.net [212.43.82.249]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 218DF18807 for ; Tue, 21 Jul 2009 05:05:41 -0300 (BRT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: startx@plentyfact.org) with ESMTPSA id 92B292E3118 Date: Tue, 21 Jul 2009 09:05:17 +0100 From: startx To: lua@bazar2.conectiva.com.br Subject: require vs dofile and how to organise many functions Message-ID: <20090721090517.030527f0@worthil> In-Reply-To: <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hello. i recently started to use a lot of lua and really like the language. however, i am currently working on a project where i use lua as a kind of glue/wrapper language to create an library around various functions around video encoding, and i came across some questions how to organise and use these functions. 1) so my "library" consists of about 50-60 functions, and my first question is if it is preferable to write that simply as a list of functions in a specific namespace such as function myproject.do_something() function myproject.do_this() etc and then make those function available via dofile 'mylib.lua' or if i should use the pure lua module format and load make it avalable with require 'mylib' i know that require has the advantage to load both pure lua and C extentions, but is there any other technical difference i am not aware of? (memory management etc) or is this just a decision of coding style? 2) my second question is about the use of namespaces: as i have quite a lot of functions, i would like to use a "subnamespace" to group the functions to something like: myproject.core.do_something() myproject.core.do_this() myproject.media.get_videolenght() myproject.media.get_metatags() etc ... would this be considered an inappropriate coding style? i haven't seen this in other projects so far .... thx for any help, startx From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 05:22:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L8M607018456; Tue, 21 Jul 2009 05:22:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34C6818A57; Tue, 21 Jul 2009 05:21:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7921A18925 for ; Tue, 21 Jul 2009 05:21:35 -0300 (BRT) Received: by bwz17 with SMTP id 17so2993073bwz.5 for ; Tue, 21 Jul 2009 01:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=b5cZwODfBYp9LKRMFWXvZJFTzk8M8lR7kLx2Tbl8iZc=; b=c1VYm4TzLk6bVk1NXKVPyyPY8egOfzu4oGAQKmuefRIoDTiwME2KMuNnHjKslmCkzC SzYW4fOhJBp95iXSw6tRbgbzWUb647SEItt2j/pAkmMpCH/zif2DSIhv52knijXemNtQ N2acFH2o/bbzaUO0FwlcQQbNJzrIMUfBviWAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SVXHRplJSWw3jgbIpQdGABKatJjeizefWJJdAibJ9yepr3t8t22oEF6XU3J+p8ORBc gOmPKL3g5Qi9i0J0dNhhe6v6yaXpWSp1jj0yuNgVruiCbPM2gpc7dO/fkyCHYTowKjGK 2CNJArxznCOE1kMuzlUbAo12IBlDP6LGocLq4= MIME-Version: 1.0 Received: by 10.239.152.143 with SMTP id v15mr514436hbb.26.1248164493151; Tue, 21 Jul 2009 01:21:33 -0700 (PDT) In-Reply-To: <20090721090517.030527f0@worthil> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> Date: Tue, 21 Jul 2009 10:21:33 +0200 Message-ID: <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> Subject: Re: require vs dofile and how to organise many functions From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 21, 2009 at 10:05 AM, startx wrote: > dofile 'mylib.lua' > > or if i should use the pure lua module format and load make it avalable > with > > require 'mylib' Ultimately, there isn't much difference; creating modules is a useful way to load code from a set of standard locations, and require() will not load code _twice_ since the loader keeps track of loaded modules. You do not have to use module() to make something available using require(), as long as the file is on LUA_PATH. In that case you do have to explicitly say 'function myproject.fun() ' etc and actually create the table myproject explicitly. The downside of require() is that it works from LUA_PATH. Python has a cute feature that 'import' will automatically pick up a module in the same directory as the importing file; Lua doesn't do that. It's a question of where you want to put files. If it is an application then using dofile() to stitch things together is not a bad idea (although watch out for including things repeatedly!). If these libraries are meant to be used in other Lua programs then require() makes sense and they should sit somewhere on LUA_PATH (which can be modified if necessary) You can modify the value of package.path before you call require(), which gives another deployment option. > 2) my second question is about the use of namespaces: as i have quite > a lot of functions, i would like to use a "subnamespace" to group the > functions to something like: > > myproject.core.do_something() It's actually a common pattern, e.g. look at LuaSocket. If on the LUA_PATH there is a directory myproject, which contains core.lua, then require 'myproject.core' will pull it in. If you use module() then the 'namespaces' are automatically created for you. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 05:40:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L8efMv020102; Tue, 21 Jul 2009 05:40:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17E5218A1B; Tue, 21 Jul 2009 05:40:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (outbound.icp-qv1-irony-out4.iinet.net.au [203.59.1.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBCEC189C2 for ; Tue, 21 Jul 2009 05:40:08 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsABAIMbZUp8qReJ/2dsb2JhbAAI0EKEDAWBQA X-IronPort-AV: E=Sophos;i="4.43,239,1246809600"; d="scan'208";a="443284366" Received: from unknown (HELO [10.1.1.2]) ([124.169.23.137]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 21 Jul 2009 16:40:00 +0800 Message-Id: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> From: Jacques Chester To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Luacrypto does not seem to successfully install on two platforms. Date: Tue, 21 Jul 2009 16:39:59 +0800 X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello all; As part of a project I am developing I am planning to use SHA1 HMAC digests. LuaCrypto advertises the ability to do these by wrapping OpenSSL. However, I cannot get LuaCrypto to work. So far I have tried: Installing via LuaRocks on OS X. Installing manually on OS X. Installing via LuaRocks on Ubuntu 9.04. I was unable to find any previous threads or posts on installation problems via Google or the list archive. Has anybody else had trouble installing Luacrypto? Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 05:45:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L8jB4D020536; Tue, 21 Jul 2009 05:45:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F7EE18A80; Tue, 21 Jul 2009 05:44:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9B62189F8 for ; Tue, 21 Jul 2009 05:44:46 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MTAxj-0005PQ-3U for ; Tue, 21 Jul 2009 09:44:39 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MTAxp-0005DS-2a for lua@bazar2.conectiva.com.br; Tue, 21 Jul 2009 09:44:45 +0100 Date: Tue, 21 Jul 2009 09:44:44 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Luacrypto does not seem to successfully install on two platforms. Message-ID: <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> In-Reply-To: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 21 Jul 2009 16:39:59 +0800 Jacques Chester wrote: > As part of a project I am developing I am planning to use SHA1 HMAC > digests. > LuaCrypto advertises the ability to do these by wrapping OpenSSL. Firstly, if all you are planning on using from LuaCrypto is SHA1, then it may be a bit of a heavy-weight solution; writing your own binding to an off-the-shelf SHA1 implementation should take about 10 minutes. Secondly, I assume you know that SHA1 is no longer safe to use in new designs :) B. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 05:56:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L8twMu021491; Tue, 21 Jul 2009 05:55:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51A9918BB1; Tue, 21 Jul 2009 05:55:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 326B218A58 for ; Tue, 21 Jul 2009 05:55:32 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsABAAcfZUp8qReJ/2dsb2JhbAAI0CSEDAWBQA X-IronPort-AV: E=Sophos;i="4.43,239,1246809600"; d="scan'208";a="540411837" Received: from unknown (HELO [10.1.1.2]) ([124.169.23.137]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 21 Jul 2009 16:55:28 +0800 Message-Id: From: Jacques Chester To: Lua list In-Reply-To: <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Luacrypto does not seem to successfully install on two platforms. Date: Tue, 21 Jul 2009 16:55:27 +0800 References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob; On 21/07/2009, at 4:44 PM, Rob Kendrick wrote: > Firstly, if all you are planning on using from LuaCrypto is SHA1, then > it may be a bit of a heavy-weight solution; writing your own binding > to > an off-the-shelf SHA1 implementation should take about 10 minutes. > > Secondly, I assume you know that SHA1 is no longer safe to use in new > designs :) I only want to use SHA1 / luacrypto for a prototype with an eye to writing a wrapper for the Skein hashing algorithm at some future point. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 06:05:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L954D6022301; Tue, 21 Jul 2009 06:05:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA5D918CAD; Tue, 21 Jul 2009 06:04:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (trick.b-et-a.de [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8314418B73 for ; Tue, 21 Jul 2009 06:04:37 -0300 (BRT) Received: (qmail 30689 invoked by uid 600); 21 Jul 2009 09:04:33 -0000 Date: Tue, 21 Jul 2009 11:04:32 +0200 From: Klaus Ripke To: Lua list Subject: Re: Luacrypto does not seem to successfully install on two platforms. Message-ID: <20090721090432.GC86754@one.local> Mail-Followup-To: Lua list References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 21, 2009 at 04:55:27PM +0800, Jacques Chester wrote: > Rob; > > On 21/07/2009, at 4:44 PM, Rob Kendrick wrote: > >Firstly, if all you are planning on using from LuaCrypto is SHA1, then > >it may be a bit of a heavy-weight solution; writing your own binding > >to > >an off-the-shelf SHA1 implementation should take about 10 minutes. > > > >Secondly, I assume you know that SHA1 is no longer safe to use in new > >designs :) > > > I only want to use SHA1 / luacrypto for a prototype with an eye > to writing a wrapper for the Skein hashing algorithm at some future > point. see slncrypto for a small implementation of SHA-1, no additional libs needed http://luaforge.net/forum/forum.php?forum_id=415 cheers Klaus From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 06:07:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L97WQt022577; Tue, 21 Jul 2009 06:07:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D701418F36; Tue, 21 Jul 2009 06:07:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35E0118A58 for ; Tue, 21 Jul 2009 06:07:06 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MTBJK-0001Yx-1e for ; Tue, 21 Jul 2009 10:06:58 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MTBJQ-0006GQ-D9 for lua@bazar2.conectiva.com.br; Tue, 21 Jul 2009 10:07:04 +0100 Date: Tue, 21 Jul 2009 10:07:04 +0100 From: Rob Kendrick To: Lua list Subject: Re: Luacrypto does not seem to successfully install on two platforms. Message-ID: <20090721100704.093ff57b@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 21 Jul 2009 16:55:27 +0800 Jacques Chester wrote: > On 21/07/2009, at 4:44 PM, Rob Kendrick wrote: > > Firstly, if all you are planning on using from LuaCrypto is SHA1, > > then it may be a bit of a heavy-weight solution; writing your own > > binding to > > an off-the-shelf SHA1 implementation should take about 10 minutes. > > > > Secondly, I assume you know that SHA1 is no longer safe to use in > > new designs :) > > I only want to use SHA1 / luacrypto for a prototype with an eye > to writing a wrapper for the Skein hashing algorithm at some future > point. In that case I strongly recommend just writing your own that exports an interface that pleases you. And you demonstrate good taste with Skein; we're already using that in some of our projects. It solves half our cryptography needs. B. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 06:08:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L986YW022663; Tue, 21 Jul 2009 06:08:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10C1D18FAA; Tue, 21 Jul 2009 06:07:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (trick.b-et-a.de [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4B5A218C94 for ; Tue, 21 Jul 2009 06:07:26 -0300 (BRT) Received: (qmail 32232 invoked by uid 600); 21 Jul 2009 09:07:25 -0000 Date: Tue, 21 Jul 2009 11:07:23 +0200 From: Klaus Ripke To: Lua list Subject: Re: Luacrypto does not seem to successfully install on two platforms. Message-ID: <20090721090723.GD86754@one.local> Mail-Followup-To: Lua list References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> <20090721094444.39f307b1@trite.i.flarn.net.i.flarn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 21, 2009 at 04:55:27PM +0800, Jacques Chester wrote: > Rob; > > On 21/07/2009, at 4:44 PM, Rob Kendrick wrote: > >Firstly, if all you are planning on using from LuaCrypto is SHA1, then > >it may be a bit of a heavy-weight solution; writing your own binding > >to > >an off-the-shelf SHA1 implementation should take about 10 minutes. > > > >Secondly, I assume you know that SHA1 is no longer safe to use in new > >designs :) > > > I only want to use SHA1 / luacrypto for a prototype with an eye > to writing a wrapper for the Skein hashing algorithm at some future > point. and of course there's LHF's lmd5 with SHA-1 support http://luaforge.net/forum/forum.php?forum_id=415 regards From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 06:23:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6L9NESs024055; Tue, 21 Jul 2009 06:23:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99CE618FCE; Tue, 21 Jul 2009 06:22:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 055ED18B2B for ; Tue, 21 Jul 2009 06:22:40 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so677988eyd.11 for ; Tue, 21 Jul 2009 02:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=5U/pqC5GpMXA4ndt8nHxEPXhdFDG8IF70FQlXF+U7SU=; b=Q5xqN+ttG7Y2c83IQE810iyK8CF3GMTeGKn/YUwRXa38v5J0kyuBRhxZMC0IClRTaw lFOTbNb+3ewCBG7q4xIVblefvdNoNX12SDsxH//uuEgymUFTNeuoEoC7aUPnK0WQrebw YABGyIt1gc/ldSzr4IRGNL/Ql2Gb/iSIYvPwY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Jme06O4IqhH13rrEwXSsun7rEpJ6VMI/UK8vQv3+5+1FyuWGK1UxdSRqZICeIZEnJ6 mmVoOf9Ttg3QHaG2A7K4pFxwJVjzHp1B6zfDp4q240KaiDTkS9CR8tEjduik4UpxNUKK ytYZ342nugSD9qZLc130Luha9iByAyOh5ZEe4= MIME-Version: 1.0 Received: by 10.216.54.202 with SMTP id i52mr1490901wec.196.1248168159265; Tue, 21 Jul 2009 02:22:39 -0700 (PDT) In-Reply-To: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> From: Jerome Vuarand Date: Tue, 21 Jul 2009 11:22:19 +0200 Message-ID: <89d273ba0907210222o223b22dbwcea3f43de8a024a1@mail.gmail.com> Subject: Re: Luacrypto does not seem to successfully install on two platforms. To: Lua list Content-Type: multipart/mixed; boundary=0016e6de04c4c0c32f046f33cb49 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6de04c4c0c32f046f33cb49 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 2009/7/21 Jacques Chester : > As part of a project I am developing I am planning to use SHA1 HMAC digests. > LuaCrypto advertises the ability to do these by wrapping OpenSSL. > > However, I cannot get LuaCrypto to work. So far I have tried: > > Installing via LuaRocks on OS X. > Installing manually on OS X. > Installing via LuaRocks on Ubuntu 9.04. > > I was unable to find any previous threads or posts on installation problems > via Google or the list archive. > > Has anybody else had trouble installing Luacrypto? I'm compiling LuaCrypto from sources as-is on a Slackware Linux machine, and with the 2 attached patches on a Windows XP x64 platform, both without any further problem. What errors do you get ? --0016e6de04c4c0c32f046f33cb49 Content-Type: application/octet-stream; name="luacrypto-c-variable-declaration.patch" Content-Disposition: attachment; filename="luacrypto-c-variable-declaration.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxef2el90 ZGlmZiAtdXJOIGEvbHVhY3J5cHRvLTAuMi4wL3NyYy9sY3J5cHRvLmMgYi9sdWFjcnlwdG8tMC4y LjAvc3JjL2xjcnlwdG8uYw0KLS0tIGEvbHVhY3J5cHRvLTAuMi4wL3NyYy9sY3J5cHRvLmMJVGh1 IEF1ZyAyNCAyMzoyNDoxOCAyMDA2DQorKysgYi9sdWFjcnlwdG8tMC4yLjAvc3JjL2xjcnlwdG8u YwlUaHUgRGVjIDI3IDAzOjE5OjQ5IDIwMDcNCkBAIC00OTgsMTEgKzQ5OCwxMiBAQA0KICovDQog TFVBQ1JZUFRPX0FQSSBpbnQgbHVhb3Blbl9jcnlwdG8obHVhX1N0YXRlICpMKQ0KIHsNCi0gIE9w ZW5TU0xfYWRkX2FsbF9kaWdlc3RzKCk7DQotICANCiAgIHN0cnVjdCBsdWFMX3JlZyBjb3JlW10g PSB7DQogICAgIHtOVUxMLCBOVUxMfSwNCiAgIH07DQorICANCisgIE9wZW5TU0xfYWRkX2FsbF9k aWdlc3RzKCk7DQorICANCiAgIGNyZWF0ZV9tZXRhdGFibGVzIChMKTsNCiAgIGx1YUxfb3Blbmxp YiAoTCwgTFVBQ1JZUFRPX0NPUkVOQU1FLCBjb3JlLCAwKTsNCiAgIGx1YWNyeXB0b19zZXRfaW5m byAoTCk7DQo= --0016e6de04c4c0c32f046f33cb49 Content-Type: application/octet-stream; name="luacrypto-64bit-openssl-api.patch" Content-Disposition: attachment; filename="luacrypto-64bit-openssl-api.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxef2o2e1 ZGlmZiAtdXJOIGEvbHVhY3J5cHRvLTAuMi4wL3NyYy9sY3J5cHRvLmMgYi9sdWFjcnlwdG8tMC4y LjAvc3JjL2xjcnlwdG8uYw0KLS0tIGEvbHVhY3J5cHRvLTAuMi4wL3NyYy9sY3J5cHRvLmMJVGh1 IEF1ZyAyNCAyMzoyNDoxOCAyMDA2DQorKysgYi9sdWFjcnlwdG8tMC4yLjAvc3JjL2xjcnlwdG8u YwlUaHUgRGVjIDI3IDAzOjIwOjI2IDIwMDcNCkBAIC05Niw3ICs5Niw3IEBADQogICBFVlBfTURf Q1RYICpjID0gZXZwX3BnZXQoTCwgMSk7DQogICBFVlBfTURfQ1RYICpkID0gTlVMTDsNCiAgIHVu c2lnbmVkIGNoYXIgZGlnZXN0W0VWUF9NQVhfTURfU0laRV07DQotICBzaXplX3Qgd3JpdHRlbiA9 IDA7DQorICB1bnNpZ25lZCBpbnQgd3JpdHRlbiA9IDA7DQogICB1bnNpZ25lZCBpbnQgaTsNCiAg IGNoYXIgKmhleDsNCiAgIA0KQEAgLTE0OCw3ICsxNDgsNyBAQA0KICAgY29uc3QgY2hhciAqcyA9 IGx1YUxfY2hlY2tzdHJpbmcoTCwgMik7DQogICBjb25zdCBFVlBfTUQgKnR5cGUgPSBFVlBfZ2V0 X2RpZ2VzdGJ5bmFtZSh0eXBlX25hbWUpOw0KICAgdW5zaWduZWQgY2hhciBkaWdlc3RbRVZQX01B WF9NRF9TSVpFXTsNCi0gIHNpemVfdCB3cml0dGVuID0gMDsNCisgIHVuc2lnbmVkIGludCB3cml0 dGVuID0gMDsNCiAgIHVuc2lnbmVkIGludCBpOw0KICAgY2hhciAqaGV4Ow0KICAgDQpAQCAtMjM4 LDcgKzIzOCw3IEBADQogew0KICAgSE1BQ19DVFggKmMgPSBobWFjX3BnZXQoTCwgMSk7DQogICB1 bnNpZ25lZCBjaGFyIGRpZ2VzdFtFVlBfTUFYX01EX1NJWkVdOw0KLSAgc2l6ZV90IHdyaXR0ZW4g PSAwOw0KKyAgdW5zaWduZWQgaW50IHdyaXR0ZW4gPSAwOw0KICAgdW5zaWduZWQgaW50IGk7DQog ICBjaGFyICpoZXg7DQogDQpAQCAtMjg0LDcgKzI4NCw3IEBADQogew0KICAgSE1BQ19DVFggYzsN CiAgIHVuc2lnbmVkIGNoYXIgZGlnZXN0W0VWUF9NQVhfTURfU0laRV07DQotICBzaXplX3Qgd3Jp dHRlbiA9IDA7DQorICB1bnNpZ25lZCBpbnQgd3JpdHRlbiA9IDA7DQogICB1bnNpZ25lZCBpbnQg aTsNCiAgIGNoYXIgKmhleDsNCiAgIGNvbnN0IGNoYXIgKnQgPSBsdWFMX2NoZWNrc3RyaW5nKEws IDEpOw0K --0016e6de04c4c0c32f046f33cb49-- From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 13:40:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LGePvn029215; Tue, 21 Jul 2009 13:40:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 575D2189C3; Tue, 21 Jul 2009 13:39:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9002E187E4 for ; Tue, 21 Jul 2009 13:39:47 -0300 (BRT) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KN500JFK4WUMK10@asmtp013.mac.com> for lua@bazar2.conectiva.com.br; Tue, 21 Jul 2009 09:39:44 -0700 (PDT) Message-id: <4895272E-40F7-4C69-B34D-828548C606BF@mac.com> From: Petite Abeille To: Lua list In-reply-to: <20090721090517.030527f0@worthil> Subject: Re: require vs dofile and how to organise many functions Date: Tue, 21 Jul 2009 18:38:53 +0200 References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6LGePvn029215 On Jul 21, 2009, at 10:05 AM, startx wrote: > i know that require has the advantage to load both pure lua and C > extentions, but is there any other technical difference i am not aware > of? (memory management etc) As mentioned by Steve, require will keep track of what has already been loaded. Take a look at Kepler's 'compat' to get a sense on how to simulate it: http://luaforge.net/plugins/scmcvs/cvsweb.php/compat/src/?cvsroot=compat http://luaforge.net/plugins/scmcvs/cvsweb.php/~checkout~/compat/src/ compat-5.1.lua?rev=1.22;content-type=text%2Fplain;cvsroot=compat > or is this just a decision of coding style? Style and pragmatism. After all, Lua doesn't include many batteries. Doesn't hurt to use the few which are provided. For a contrarian view on module, check David Manura rant: http://lua-users.org/wiki/LuaModuleFunctionCritiqued I, for one, welcome our module overlord :) > would this be considered an inappropriate coding style? Yes, quite bad taste indeed :P On the other hand, "des goûts et des couleurs on ne discute pas"... > i haven't seen this in other projects so far .... LuaSocket uses such constructs. Always found that sort of packaging very cumbersome. Of course, YMMV. Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 13:43:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LGhq3w029946; Tue, 21 Jul 2009 13:43:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE33318A5B; Tue, 21 Jul 2009 13:43:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6C51187E4 for ; Tue, 21 Jul 2009 13:43:25 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LGhN7a029840 for ; Tue, 21 Jul 2009 13:43:23 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6LGhNK19210; Tue, 21 Jul 2009 13:43:23 -0300 Date: Tue, 21 Jul 2009 13:43:23 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] lua-xosd (and wrapper library linking question) Message-ID: <20090721134322.A19207@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from vokes.s@gmail.com on Sun, Jul 19, 2009 at 11:10:46AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Running the included test2.lua segfaults for me. It works fine for me (ie, it does not segfault). From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 13:48:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LGmKI8030788; Tue, 21 Jul 2009 13:48:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C123B18C5A; Tue, 21 Jul 2009 13:47:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8BBE187E4 for ; Tue, 21 Jul 2009 13:47:46 -0300 (BRT) Received: by bwz17 with SMTP id 17so3296674bwz.5 for ; Tue, 21 Jul 2009 09:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=gxYt4WNKJgOaorrCGtsFxNMwf92/q5f0FpEvONqwJnw=; b=QaMq9N1NkTURnDoqOBC/k/fg6qsC+PVXvwlBEXyrRmxzAssKikC7RASUiIB0w3hJyJ X8UjZuv8hPa0kq1Wfa3aUgTx4dlLpnw+ydjQM+lt/D64Ug56xzNk9xAr0CUe9wdcxiNp x7GG+60LSolxzbsgp5P4vvHsG6QJceMP77pNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=jeOGBbKmH9CniVzMs5IFHsxhGsRSrPNVf8JTohpXzQeR8ki8GqUebxbNTmOZ0OruWo Ra8+ZuXYmbBgfov3e6IjTk8K0aWWCOs4IdTbV5UpZMwle+3k1skhUXcS6rTOj7ZRN9j/ 1oY1gohT845NGIHsV1wL1MPtc1F7JU98NTIBw= Received: by 10.103.239.10 with SMTP id q10mr3021399mur.36.1248194864049; Tue, 21 Jul 2009 09:47:44 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id y6sm29355496mug.40.2009.07.21.09.47.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Jul 2009 09:47:43 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Luacrypto does not seem to successfully install on two platforms. Date: Tue, 21 Jul 2009 18:47:12 +0200 References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 21, 2009, at 10:39 AM, Jacques Chester wrote: > As part of a project I am developing I am planning to use SHA1 HMAC > digests. If this is not performance critical, there is also a SHA1 implementation in pure Lua: http://luaforge.net/projects/sha1-rsa/ FWIW, here is an HMAC-SHA1 implementation: http://dev.alt.textdrive.com/browser/HTTP/HMAC.lua Usage example: local HMAC = require( 'HMAC' ) print( HMAC( 'Jefe', 'what do ya want for nothing?' ) ) > 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79' This uses Klaus Ripke's excellent slncrypto library: http://luaforge.net/projects/sln/ Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 13:59:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LGxUgN000573; Tue, 21 Jul 2009 13:59:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B434518940; Tue, 21 Jul 2009 13:59:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D44C18941 for ; Tue, 21 Jul 2009 13:59:00 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MTIg0-0001DB-N4 for ; Tue, 21 Jul 2009 17:58:52 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MTIg6-0000BB-Th for lua@bazar2.conectiva.com.br; Tue, 21 Jul 2009 17:58:59 +0100 Date: Tue, 21 Jul 2009 17:58:58 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Luacrypto does not seem to successfully install on two platforms. Message-ID: <20090721175858.290d5a22@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 21 Jul 2009 18:47:12 +0200 Petite Abeille wrote: > > As part of a project I am developing I am planning to use SHA1 > > HMAC digests. > > If this is not performance critical, there is also a SHA1 > implementation in pure Lua: Along similar hideous lines, here is a pure-Lua implementation of the RC4 PRNG and stream cipher I threw together: B. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 15:29:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LISxGr021236; Tue, 21 Jul 2009 15:28:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAE1C18FCD; Tue, 21 Jul 2009 15:28:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f204.google.com (mail-pz0-f204.google.com [209.85.222.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97DB5189C4 for ; Tue, 21 Jul 2009 15:28:15 -0300 (BRT) Received: by pzk42 with SMTP id 42so625271pzk.33 for ; Tue, 21 Jul 2009 11:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=SOmmmfUN0IID+V15iG4CkalVozldxPhMQfbatMEyBRw=; b=hJnTRtrzCnHhCIQUF/kV8+21DlSZClv9Pn/0D7jfW80HNibHEUuIb66iR68JqdWZY8 J4WkJeExi/f8K8v5E26Wi4zpCfoLNoIBlnO6OghTGS3rtVrUAN2u9DwTW1Q7cudqe5WF 386x6kR01gPt2v3xiE0aQ/AxK17hCMwD5Ua5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=d/Nfzt7w7lvwZHhf4xWFHJvdHmM0IysxZtRZEGJdwq2Fw3VTTRgeoMRMdWL83IQC/p g/+bCRSstuhBna0Bdeyf09Nak9ClAhppVq9prigfR/0e7kfbKqytkiO+bpoT9yP6rCPy NXRoE7uJoPiPAI1MMaVCj8DkFGV+kpIexBZME= MIME-Version: 1.0 Received: by 10.142.135.16 with SMTP id i16mr1256917wfd.243.1248200893680; Tue, 21 Jul 2009 11:28:13 -0700 (PDT) In-Reply-To: <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> Date: Tue, 21 Jul 2009 11:28:13 -0700 Message-ID: <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> Subject: Re: require vs dofile and how to organise many functions From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 21, 2009 at 1:21 AM, steve donovan wrote: > On Tue, Jul 21, 2009 at 10:05 AM, startx wrote: >> 2) my second question is about the use of namespaces: as i have quite >> a lot of functions, i would like to use a "subnamespace" to group the >> functions to something like: >> >> myproject.core.do_something() > > It's actually a common pattern, e.g. look at LuaSocket. If on the > LUA_PATH there is a directory myproject, which contains core.lua, then > require 'myproject.core' will pull it in. If you use module() then the > 'namespaces' are automatically created for you. Maybe I misunderstand what you mean by "namespaces are automatically created for you", because it doesn't look like it to me. I would expect after require"hi.bye" to be able to access "hi.bye", if namespace were created, but that isn't how it works, as far as I can tell. ~/w/wt/achilles-engine % lua Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > require"hi.bye" > = hi nil > return hi.bye stdin:1: attempt to index global 'hi' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > = bye table: 0x64bf50 > return bye.name I am bye > ~/w/wt/achilles-engine % cat hi/bye.lua module("bye") name = "I am bye" From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 15:40:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LIeciU024398; Tue, 21 Jul 2009 15:40:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C51C81A51A; Tue, 21 Jul 2009 15:40:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC4D81899C for ; Tue, 21 Jul 2009 15:40:00 -0300 (BRT) Received: by ewy26 with SMTP id 26so3571132ewy.5 for ; Tue, 21 Jul 2009 11:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=33vN7UtSK6uiNddRo5bGbxEia6QRw/0h0cCd2D08Gwc=; b=U6qLTQuapl2wg+TXhKG0ZthSCHIqD4Wzya3r//mfQzOhELJc1e6AaGQF5A+kTjt2Fw G4a7FSl/DVu4nN2FlhH5Jx1Yv2HmUDrpDZmeT5mI1XqAyCP90YQUZ9lk41FK390dL9qs NrhD2cOO0emc5bWAjHIXWQigAzLV5/HS6x3fY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=VrTAykqzNSKRl1zp2n6OMg6YrB6WJ/gPYCO4LoK6NxZM8wbREN6n69FulQkBLwyh1s 7yF4N7cG21+lwS5+PSimeg6mi6IBPVAVcAQncIz/Tdbu4goLKzquPkeofH8S7OV/HwYA We2NnL8A4yAU7bcyLw31abgQFuPsSlGu7BGPY= MIME-Version: 1.0 Received: by 10.216.54.194 with SMTP id i44mr1587712wec.93.1248201598489; Tue, 21 Jul 2009 11:39:58 -0700 (PDT) In-Reply-To: <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> Date: Tue, 21 Jul 2009 19:39:58 +0100 Message-ID: Subject: Re: require vs dofile and how to organise many functions From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6LIeciU024398 On Tue, Jul 21, 2009 at 7:28 PM, Sam Roberts wrote: > On Tue, Jul 21, 2009 at 1:21 AM, steve donovan wrote: >> On Tue, Jul 21, 2009 at 10:05 AM, startx wrote: >>> 2) my second question is about the use of namespaces: as i have quite >>> a lot of functions, i would like to use a "subnamespace" to group the >>> functions to something like: >>> >>> myproject.core.do_something() >> >> It's actually a common pattern, e.g. look at LuaSocket.   If on the >> LUA_PATH there is a directory myproject, which contains core.lua, then >> require 'myproject.core' will pull it in. If you use module() then the >> 'namespaces' are automatically created for you. > > Maybe I misunderstand what you mean by "namespaces are automatically > created for you", because > it doesn't look like it to me. > > I would expect after require"hi.bye" to be able to access "hi.bye", if > namespace were created, but that isn't how it works, as far as I can > tell. You still need the full namespace path in the module() call, so module("hi.bye") instead of module("bye"). I think what he meant is that it will handle creating the "hi" table for you automatically if it does not already exist. Also, consider using module(...) as this will automatically use "hi.bye" which is passed in to the function as a parameter by the require loader. -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 16:04:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJ4fVh030140; Tue, 21 Jul 2009 16:04:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40DC41903D; Tue, 21 Jul 2009 16:04:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exdisc02.msghub.com (exdisc01.msghub.com [77.93.144.111]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBE3F18FDF for ; Tue, 21 Jul 2009 16:03:59 -0300 (BRT) Received: from EXSMTP02.msghub.com ([192.168.95.73]) by exdisc02.msghub.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 21 Jul 2009 20:08:44 +0100 Received: from MSGEXVS01.msghub.com ([192.168.95.51]) by EXSMTP02.msghub.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 21 Jul 2009 20:08:44 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA0A36.AADFC1F0" Subject: calling a function who's name is contained within a string variable Date: Tue, 21 Jul 2009 20:03:49 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: calling a function who's name is contained within a string variable Thread-Index: AcoKNfsUd8xOXtXbTRiz0G6HXVKhIw== From: "Sean Farrow" To: X-OriginalArrivalTime: 21 Jul 2009 19:08:44.0708 (UTC) FILETIME=[AB02CE40:01CA0A36] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA0A36.AADFC1F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi List:=20 I havethe name of a function I wish to call in a string passed to me in this case through shared memory. Is there a way of calling this function in lua? Any help appreciated. Sean. ------_=_NextPart_001_01CA0A36.AADFC1F0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi List:

I havethe name of a function I = wish to call in a string passed to me in this case through shared = memory.

Is there a way of calling this = function in lua?

Any help = appreciated.

Sean.



__________ Information from ESET NOD32 Antivirus, version of = virus signature database 4264 (20090721) __________

The message = was checked by ESET NOD32 Antivirus.

http://www.eset.com
------_=_NextPart_001_01CA0A36.AADFC1F0-- From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 16:14:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJEjLR032607; Tue, 21 Jul 2009 16:14:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D63D219085; Tue, 21 Jul 2009 16:14:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E3F718FF3 for ; Tue, 21 Jul 2009 16:14:14 -0300 (BRT) Received: by bwz17 with SMTP id 17so3383796bwz.5 for ; Tue, 21 Jul 2009 12:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=ejqBkbMRsgd1aX55+aMTU9i0MISfs3RCVLm4F8DQzfs=; b=jGJQcFDpQgKOjIs/g0ANct7hqC/QMVpT9J9DePuaS3sGPcSFaYBlU4VOJ2qnoKBVOf 49twaIFaRcznzUIfwLW0O/rgXzO7YB1fNvou7fvy8DxnsI+/Zamzf1Zx9yhAgfjmFpVO dIhx+5mmPwHpQ8XcdC52ugm8HWD3IzHCkzITY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=hzf3T5bTsC87zmSSpj8wDAztTu3Z8h1YJwg0s9W2B6+e/FxE9drlmMiFL2NN2+ccIv /qsdPKMYyZFkWudGu+TuzswtII0TGEQXM3yTCDuXScBCdwjcxUCBRhToWjUlGjthGUBT 7FTgG38lXDYCNSc/StXvWiO34J9NTe9YYgJa4= Received: by 10.103.243.9 with SMTP id v9mr13525mur.31.1248203653061; Tue, 21 Jul 2009 12:14:13 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id n7sm24256467mue.28.2009.07.21.12.14.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Jul 2009 12:14:12 -0700 (PDT) Message-Id: <8061F758-D16B-4759-B67F-C5B754BA9214@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: calling a function who's name is contained within a string variable Date: Tue, 21 Jul 2009 21:13:41 +0200 References: X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 21, 2009, at 9:03 PM, Sean Farrow wrote: > I havethe name of a function I wish to call in a string passed to me > in > this case through shared memory. > > Is there a way of calling this function in lua? Sure. Assuming the function is in _G: _G[ 'aFunctionNameReceivedThoughSharedMemory' ]() From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 16:18:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJImhT000977; Tue, 21 Jul 2009 16:18:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 758DD190C7; Tue, 21 Jul 2009 16:18:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B30F1190AC for ; Tue, 21 Jul 2009 16:18:22 -0300 (BRT) Received: from papaya.tek (dslb-088-072-012-106.pools.arcor-ip.net [88.72.12.106]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id DAE343D75B for ; Tue, 21 Jul 2009 21:18:20 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id E4D46EA131 for ; Tue, 21 Jul 2009 21:18:19 +0200 (CEST) Date: Tue, 21 Jul 2009 21:18:19 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: calling a function who's name is contained within a string variable Message-Id: <20090721211819.a0157409.tmueller@schulze-mueller.de> In-Reply-To: References: X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 21 Jul 2009 20:03:49 +0100 "Sean Farrow" wrote: > I havethe name of a function I wish to call in a string passed to me in > this case through shared memory. > > Is there a way of calling this function in lua? It depends on where the function value is known under the name (functions have no names in Lua). The most generic form would be getfenv()[string]() Given that a function under the given name is known in the global environment, you could also write _G[string]() or, if the function value is stored in some other table table[string]() -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 16:37:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJbYY0004622; Tue, 21 Jul 2009 16:37:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C036019054; Tue, 21 Jul 2009 16:37:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7ADAD18866 for ; Tue, 21 Jul 2009 16:36:57 -0300 (BRT) Received: by gxk18 with SMTP id 18so3824024gxk.5 for ; Tue, 21 Jul 2009 12:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ytxcNIUa/KUy9LfdMHKCNdhZ0A/WOnfG4TR7zUUXdBc=; b=tuyPDr8d1lXFqst37wnkWYd3ixjr0yELW9FEZ5HwHvaSSPoG7lNLAd73hzgQ7R3B2B EfmtSmJqQ9Fx09zJPwzQ74m1ykZ34qjplq/4oOmv6EV6Kvi6sXIN7nht4JKynYLacvcY qVGV2J8or/LaU+cvuWtzwVm02t1bBvO/No/II= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MP4+kfZ8ptBzrMvsHSx2mZeGX4MIKWtx3GmjohKnLRSJtlbE/UQcc2pZH6eFqMiMUk C1mwuBNQUs0SqoeSXA/PiKPEgpynmor7Vs5JKDI3bY9b9ob4SkMLJvASUBla2Hq80fqy Ze6tv/wJvpHxqwBNaLMF0iJENSYZ7a83iUYWU= MIME-Version: 1.0 Received: by 10.151.46.4 with SMTP id y4mr251888ybj.65.1248205016098; Tue, 21 Jul 2009 12:36:56 -0700 (PDT) In-Reply-To: <20090721134322.A19207@lua.tecgraf.puc-rio.br> References: <20090721134322.A19207@lua.tecgraf.puc-rio.br> Date: Tue, 21 Jul 2009 15:36:56 -0400 Message-ID: Subject: Re: [ANN] lua-xosd (and wrapper library linking question) From: Scott Vokes To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 21, 2009 at 12:43 PM, Luiz Henrique de Figueiredo wrote: >> Running the included test2.lua segfaults for me. > It works fine for me (ie, it does not segfault). Which OS and hardware platform are you using? It was segfaulting for me on OpenBSD/amd64. Thanks, Scott From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 16:40:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJeOk6005098; Tue, 21 Jul 2009 16:40:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3AF0190FD; Tue, 21 Jul 2009 16:40:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93F5B18866 for ; Tue, 21 Jul 2009 16:39:57 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LJdt2v005018 for ; Tue, 21 Jul 2009 16:39:55 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6LJdsq19543; Tue, 21 Jul 2009 16:39:54 -0300 Date: Tue, 21 Jul 2009 16:39:54 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] lua-xosd (and wrapper library linking question) Message-ID: <20090721163954.A19540@lua.tecgraf.puc-rio.br> References: <20090721134322.A19207@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from vokes.s@gmail.com on Tue, Jul 21, 2009 at 03:36:56PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Which OS and hardware platform are you using? It was segfaulting > for me on OpenBSD/amd64. Fedora Core 4 (32-bit). (Yes, I know it's ancient.) From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 18:46:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LLkiis030742; Tue, 21 Jul 2009 18:46:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46CE518A5A; Tue, 21 Jul 2009 18:46:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BC12189AD for ; Tue, 21 Jul 2009 18:46:01 -0300 (BRT) Received: by fxm25 with SMTP id 25so2360126fxm.5 for ; Tue, 21 Jul 2009 14:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=Vi6GAzPsbPeX5cKpaVTBkQ3WJSp9nNbpps5WTJRSPCI=; b=SF3i/hhiZfTDyG4CUVtcnQGtPuBnMiE04WwOTJAG5TtTiluX56p9SXdfRDrifUExQ8 4I2ZXy/X+PlIfHJBIw+e69GuVkm+aw4IvMxpP3Ue//8yur1SgdVEhN/z04GOiMwQErZu XnubMezGp3A0Gub/BeaSjEQobpDUGLZAH68FA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=TneqhVhMtzodtyc/WQgqXLi9hT3DcbbdT4MP2z6wzAJkUPeNv8EWveTn85dtIwjpiz +Q4d/2i0DMINDTCGdIgd5j46QunIrNnvPlzuzsTqbf9oQmM6/ie9n08V9J+t9p/XjsyK U8cg+PWgtZVgh8nxiP2NZDvXTd/RL/MA4etSg= MIME-Version: 1.0 Received: by 10.204.68.10 with SMTP id t10mr121806bki.182.1248212759257; Tue, 21 Jul 2009 14:45:59 -0700 (PDT) Date: Tue, 21 Jul 2009 22:45:59 +0100 Message-ID: <4db9cacb0907211445o7ebd929dvefdd52e91e8db7b8@mail.gmail.com> Subject: [ANN] Prosody 0.5.0 released From: Matthew Wild To: prosody-users@googlegroups.com, prosody-dev@googlegroups.com, "Jabber/XMPP software development list" , Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean We are pleased to announce the release of Prosody 0.5.0. Prosody is a lightweight Jabber/XMPP server written in Lua. It aims to be flexible, easy to extend, and simple to use for both users and developers alike. This release is something of a milestone, both with respect to the version number, and in that we have restructured and decentralised Prosody's core routing code. The benefits of the changes include greater flexibility, performance, and allowing modules to catch and filter any stanza types they need to. Significantly, even the handling of the standard message, presence and iq stanza types is now performed by automatically-loaded core plugins. Apart from the internal and API changes, this release finally brings us much-anticipated support for PEP. Remember to add "pep" to your config if you are upgrading from a previous release! :) The following is a summary of changes since the previous version: * New mod_presence, mod_message and mod_iq to modularise routing * Support for modules to finally intercept any routed stanza * mod_pep: PEP support (user tune, mood, activity and more) * New util.muc API to ease development of custom MUC-based services * Support for requiring encryption of client connections * Improved telnet console, with c2s:show() and s2s:show() * mod_groups: "shared roster" support to configure groups * mod_announce: Plugin to send announcement to all online users * mod_welcome: New plugin to welcome users who register accounts * mod_watchregistrations: Plugin to alert admins of registrations * Many optimisations and performance improvements That about sums it up! We're already looking forward to 0.6, where we are planning to complete our MUC support, and add support for more storage backends. Download: http://prosody.im/download/ Happy Jabbering, The Prosody Team From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 18:53:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6LLrOqR031660; Tue, 21 Jul 2009 18:53:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 948C418ADE; Tue, 21 Jul 2009 18:53:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60C87189AD for ; Tue, 21 Jul 2009 18:52:57 -0300 (BRT) Received: by fxm25 with SMTP id 25so2363225fxm.5 for ; Tue, 21 Jul 2009 14:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=2auEp0dIDRqs09jzFcqYR44Oyk4CRfh7vGB7zBC2xio=; b=NFlwHczxzBtm6dhkIRtTE9LhM3bk+gSH1PTQNQdk90B5DCPxh6rinhdM9SWi6OwB4O igQ2sZMwlPd5nzViDIbS+1AUamF8A5Hx63Rs8pzzPXL/0YkymOTV2nKy9u93q0It0Mcr v89XMp0Xl1oA7zmCAafsr++wMlMhZs0iNMAPo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=q4vbTYCD4pzTkl4CyPhX03cQ1LW2zglsf1XUwLm6lU6tTtmxNT5+ipWEU8aJE4nuC5 spW5VSBq3eE1F0oCGmQvw09LKtdhn9MuKPnzqRtyVckI2pr/yg0M09XDG3BBiO/KAB9g efc4QfoJj6tC3rRrrEsXm+dXgR3hOknjsqvug= MIME-Version: 1.0 Received: by 10.239.156.193 with SMTP id n1mr17253hbc.43.1248213175045; Tue, 21 Jul 2009 14:52:55 -0700 (PDT) Date: Tue, 21 Jul 2009 22:52:55 +0100 Message-ID: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> Subject: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean A libpurple based multi-protocol, multi-user conference bot. Based on code from melissa [http://www.cowlark.com/melissa/index.html] Currently, starts, connects to different IM services and broadcasts any message it receives to all online and available users. For more details please check out http://bitbucket.org/axhixh/lconfbot/src/tip/README.confbot Code available at http://bitbucket.org/axhixh/lconfbot/ Released under GPL2 as it links to libpurple which is GPL2. Ashish From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:10:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0AVnw018845; Tue, 21 Jul 2009 21:10:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C889D1899C; Tue, 21 Jul 2009 21:10:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A2D2188F0 for ; Tue, 21 Jul 2009 21:09:59 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M09wNp018793 for ; Tue, 21 Jul 2009 21:09:58 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6M09vH20057; Tue, 21 Jul 2009 21:09:57 -0300 Date: Tue, 21 Jul 2009 21:09:56 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090721210956.A20013@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com>; from axhixh.rss@gmail.com on Tue, Jul 21, 2009 at 10:52:55PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Released under GPL2 as it links to libpurple which is GPL2. I don't want to launch an off-topic discussion on license religion, but I think that you don't need to release code as GPL simply because it links to GPL code, if you don't include the GPL code in your package. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:15:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0FRf0019386; Tue, 21 Jul 2009 21:15:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85BDC18A74; Tue, 21 Jul 2009 21:15:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B971189D4 for ; Tue, 21 Jul 2009 21:15:00 -0300 (BRT) Received: by fxm25 with SMTP id 25so2415072fxm.5 for ; Tue, 21 Jul 2009 17:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=yOeY8OF6znh/NYoMxtP1g+F6aO/1nQoaWOWVpQ6zsgc=; b=qHU8bnC76Y6RM8fcaSoBUp4nr/JKX0ygN1BktnoGdUGvkmHllpbGCcZhSH6U3NKLVf G8TdKLvjiNq1JyEXiu8p2fdRAhyPpyej/hrFHaOwyL0kiIu024Xnq5+Fdyiqi82+RXPJ JCvRtELz7YB7Ve65GnD4OFfniE4hfWDqoIdz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=teZFmWOyRT0bcaS1jLhk8r7xWL2+Nr+Z06bSNGI6A2Bb50JKc4UGaS7AWnHAVFVF7Z wDKRcE+erA4EHE26J/FOgZzl5sEePp91GFisYbF0+wF5uJ04WRPI3HuD9bfb6vdlaGVl KQvS5AbMH/wPaNAygLSu7ewDF+MURNb6SBP48= MIME-Version: 1.0 Received: by 10.239.178.140 with SMTP id z12mr27615hbf.120.1248221697968; Tue, 21 Jul 2009 17:14:57 -0700 (PDT) In-Reply-To: <20090721210956.A20013@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <20090721210956.A20013@lua.tecgraf.puc-rio.br> Date: Wed, 22 Jul 2009 01:14:57 +0100 Message-ID: <379686bd0907211714m40854723yd56f64e790cc438d@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Don't know about this. As far as I understood if you link to GPL stuff you need to do GPL. I thought LGPL was so you could avoid this. If it weren't that I would release under do whatever you like just don't sue me license. Ashish On Wed, Jul 22, 2009 at 1:09 AM, Luiz Henrique de Figueiredo wrote: >> Released under GPL2 as it links to libpurple which is GPL2. > > I don't want to launch an off-topic discussion on license religion, but > I think that you don't need to release code as GPL simply because it > links to GPL code, if you don't include the GPL code in your package. > From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:18:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0IIQB019715; Tue, 21 Jul 2009 21:18:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EF0B18AE0; Tue, 21 Jul 2009 21:18:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13D07189D4 for ; Tue, 21 Jul 2009 21:17:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so3766894ewy.5 for ; Tue, 21 Jul 2009 17:17:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.29.213 with SMTP id i63mr77132wea.90.1248221873489; Tue, 21 Jul 2009 17:17:53 -0700 (PDT) In-Reply-To: <20090721210956.A20013@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <20090721210956.A20013@lua.tecgraf.puc-rio.br> Date: Wed, 22 Jul 2009 01:17:53 +0100 X-Google-Sender-Auth: ccaa57887fb75040 Message-ID: Subject: Re: [ANN] Lua Conference Bot 0.1 From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 1:09 AM, Luiz Henrique de Figueiredo wrote: > I don't want to launch an off-topic discussion on license religion, but > I think that you don't need to release code as GPL simply because it > links to GPL code, if you don't include the GPL code in your package. > The wikipedia quick-info box for http://en.wikipedia.org/wiki/GPL states "Linking from code with a different license: No", which would imply that you cannot link non-GPL code against GPL code. I'm sure that the full legalese of the license thus states that derivative works of GPL code must themselves be GPL and that linking against creates a derivative work. From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:21:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0LC8N020165; Tue, 21 Jul 2009 21:21:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF70218B06; Tue, 21 Jul 2009 21:20:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63418189D4 for ; Tue, 21 Jul 2009 21:20:48 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0Kk3a020062 for ; Tue, 21 Jul 2009 21:20:46 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6M0KjM20124; Tue, 21 Jul 2009 21:20:45 -0300 Date: Tue, 21 Jul 2009 21:20:45 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090721212045.A20118@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <20090721210956.A20013@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from lua@corsix.org on Wed, Jul 22, 2009 at 01:17:53AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On Wed, Jul 22, 2009 at 1:09 AM, Luiz Henrique de > Figueiredo wrote: > > I don't want to launch an off-topic discussion on license religion, but > > I think that you don't need to release code as GPL simply because it > > links to GPL code, if you don't include the GPL code in your package. > > > > The wikipedia quick-info box for http://en.wikipedia.org/wiki/GPL > states "Linking from code with a different license: No", which would > imply that you cannot link non-GPL code against GPL code. I'm sure > that the full legalese of the license thus states that derivative > works of GPL code must themselves be GPL and that linking against > creates a derivative work. The GPL FAQ says otherwise: http://www.gnu.org/licenses/gpl-faq.html#LinkingWithGPL From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:24:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0O9O6020562; Tue, 21 Jul 2009 21:24:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEA4A18B73; Tue, 21 Jul 2009 21:23:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 752A018AD6 for ; Tue, 21 Jul 2009 21:23:42 -0300 (BRT) Received: by bwz17 with SMTP id 17so3524590bwz.5 for ; Tue, 21 Jul 2009 17:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=XEtJRym+733MhECHtRYgQ188um5ZhMiIWr1Q2NCdwpE=; b=GqIU6UV++b4XmQU/REGkW7CrRTGA3PcWOzJX+FMIA6QtdUxbCkq+ztzsyCEOJk4gvM lvUPXli7EZ8OFZLycVTtJ7BoK+Macsjuz8t7v+CjNjUPuuH3aspZRfumuaiEYCjnggUE v5UfZAJdcuc6bQNg52sr+S8lhPsef017bddd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TFG4+Pg/kcYwRpAAW6FSCmZA0vxo3QCvnBtcWxMb8pLkPIskhAe42jumr8Mb5L1cX9 yF5JnUMUoaxGas3vZUcw30AfMg2qbf7753Xf1CCSFs52kNjjhwI+UOhCGXJayrq/lniJ TIoUF7WbmnXTfqvux9nu3rSOY0VRxyDn9Ng7U= MIME-Version: 1.0 Received: by 10.239.146.212 with SMTP id x20mr30028hba.97.1248222219321; Tue, 21 Jul 2009 17:23:39 -0700 (PDT) In-Reply-To: <20090721212045.A20118@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <20090721210956.A20013@lua.tecgraf.puc-rio.br> <20090721212045.A20118@lua.tecgraf.puc-rio.br> Date: Wed, 22 Jul 2009 01:23:39 +0100 Message-ID: <379686bd0907211723y3f8fdceam43c994d0a10161e5@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6M0O9O6020562 quoting: Not exactly. It means you must release your program under a license compatible with the GPL (more precisely, compatible with one or more GPL versions accepted by all the rest of the code in the combination that you link). The combination itself is then available under those GPL versions. The last part says the combination itself is then available under those GPL versions. On Wed, Jul 22, 2009 at 1:20 AM, Luiz Henrique de Figueiredo wrote: >> On Wed, Jul 22, 2009 at 1:09 AM, Luiz Henrique de >> Figueiredo wrote: >> > I don't want to launch an off-topic discussion on license religion, but >> > I think that you don't need to release code as GPL simply because it >> > links to GPL code, if you don't include the GPL code in your package. >> > >> >> The wikipedia quick-info box for http://en.wikipedia.org/wiki/GPL >> states "Linking from code with a different license: No", which would >> imply that you cannot link non-GPL code against GPL code. I'm sure >> that the full legalese of the license thus states that derivative >> works of GPL code must themselves be GPL and that linking against >> creates a derivative work. > > The GPL FAQ says otherwise: >        http://www.gnu.org/licenses/gpl-faq.html#LinkingWithGPL > From lua-bounces@bazar2.conectiva.com.br Tue Jul 21 21:26:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0QgtW020828; Tue, 21 Jul 2009 21:26:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 582DE18AD6; Tue, 21 Jul 2009 21:26:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 023B618914 for ; Tue, 21 Jul 2009 21:26:20 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M0QJNF020807 for ; Tue, 21 Jul 2009 21:26:19 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6M0QI320193; Tue, 21 Jul 2009 21:26:18 -0300 Date: Tue, 21 Jul 2009 21:26:18 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090721212618.A20159@lua.tecgraf.puc-rio.br> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <20090721210956.A20013@lua.tecgraf.puc-rio.br> <20090721212045.A20118@lua.tecgraf.puc-rio.br> <379686bd0907211723y3f8fdceam43c994d0a10161e5@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <379686bd0907211723y3f8fdceam43c994d0a10161e5@mail.gmail.com>; from axhixh.rss@gmail.com on Wed, Jul 22, 2009 at 01:23:39AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The last part says the combination itself is then available under > those GPL versions. By "combination" they mean the final, fully (but possibly dynamically) linked program, I guess. Anyway, enough of this :) Thanks for the code. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 01:55:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M4tFwI016331; Wed, 22 Jul 2009 01:55:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9C9718A1F; Wed, 22 Jul 2009 01:54:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0e.pop-rio.com.br [200.239.248.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A21E2188F5 for ; Wed, 22 Jul 2009 01:54:44 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.101]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MTTql-0006n6-Q6 for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 01:54:43 -0300 Message-ID: <4A669BAA.7010807@sct.microlink.com.br> Date: Wed, 22 Jul 2009 01:55:06 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Lua Workshop 2009 registration References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Message: 1 > Date: Mon, 20 Jul 2009 13:25:30 -0300 > From: Luiz Henrique de Figueiredo > Subject: Re: Lua Workshop 2009 registration > To: Lua list > Message-ID: <20090720132530.A15033@lua.tecgraf.puc-rio.br> > Content-Type: text/plain; charset=us-ascii > >> I sent the registration form on June 1st and sent an e-mail asking for >> confirmation one month later but didn't get any answer. > > We are still collecting pre-registrations. We expect that this process > will be over by the end of August (if not sooner) and then registrations > will be confirmed based on the demand and on the size of the room at PUC-Rio. > >> Could someone confirm the registration process is working? Or better >> yet, that I am registered? > > The process seems to be working -- we haven't had any complaints about > messages to lua.workshop@gmail.com bouncing. In particular, your form > has been received. Ah, that's what I wanted to know, thanks! > Thanks for your interest in the workshop. > --lhf From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 04:05:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M74u4B028100; Wed, 22 Jul 2009 04:04:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39B6E18C89; Wed, 22 Jul 2009 04:04:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38B6F18BAB for ; Wed, 22 Jul 2009 04:04:09 -0300 (BRT) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id n6M73w5r011275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 22 Jul 2009 03:04:06 -0400 (EDT) Date: Wed, 22 Jul 2009 03:03:58 -0400 (EDT) From: Diego Nehab To: Lua list Subject: Re: LuaSocket problem In-Reply-To: <389545b10907170732w1b4cac7ai1538432d620712ce@mail.gmail.com> Message-ID: References: <389545b10907170732w1b4cac7ai1538432d620712ce@mail.gmail.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5683 signatures=539212 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > local http = require("socket.http") > local io = require("io") > local ltn12 = require("ltn12") > UserID = "userID=XXXXX" > APIKey = "apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" > CharID = "characterID=XXXXXXX" > > --Lame I know... > reqbody = UserID.."&"..APIKey.."&"..CharID > > http.request { > method = "POST", > url = "http://api.eve-online.com/char/CharacterSheet.xml.aspx", > headers= { ["Content-Type"] = "application/x-www-form-urlencoded", > ["Content-Length"] = string.len(reqbody), > }, > source = ltn12.source.string(reqbody), > sink = ltn12.sink.file(io.stdout) > } > On execution I get an error from the remote server about the request verb > bad. That's not what happens here. What I get is: 2009-07-22 06:59:17 Must provide userID parameter for authentication. 2009-07-22 07:04:17 What version of LuaSocket are you using? Regards, Diego From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 06:37:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M9bhjA008855; Wed, 22 Jul 2009 06:37:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C98D18C54; Wed, 22 Jul 2009 06:37:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75D5E1886D for ; Wed, 22 Jul 2009 06:37:07 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTYFz-0000dW-VC for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 10:37:04 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 8CEDC5278D for ; Wed, 22 Jul 2009 10:37:01 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:34648 with envelope Message-ID: <4A66DDB5.4050604@cowlark.com> Date: Wed, 22 Jul 2009 10:36:53 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> In-Reply-To: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6M9bhjA008855 Ashish Shrestha wrote: [...] > Based on code from melissa [http://www.cowlark.com/melissa/index.html] Someone's actually *using* Melissa? Awesome! [...] > Released under GPL2 as it links to libpurple which is GPL2. I hadn't noticed that libpurple is GPL'd, not LGPL'd as I'd assumed --- my bad. So I shall relicense Melissa accordingly; consider it to be GPLv2 from now on. (Sigh. Obviously, someone just forgot to relicense libpurple after it got split off from the Pidgin core. Unfortunately, it's now probably too late to fix...) -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 06:43:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M9hKf1009419; Wed, 22 Jul 2009 06:43:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1474D1902A; Wed, 22 Jul 2009 06:43:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exch03.pdv-fs.de (exch03.pdv-fs.de [194.25.104.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B37718FEB for ; Wed, 22 Jul 2009 06:42:54 -0300 (BRT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Subject: When "#!/usr/bin/env lua" doesn't cut it Date: Wed, 22 Jul 2009 11:42:48 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: When "#!/usr/bin/env lua" doesn't cut it Thread-Index: AcoKsMXADid6gZSRSbqQllr1zy/OBg== From: =?utf-8?B?UmljaHRlciwgSsO2cmc=?= To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id n6M9hKf1009419 Hi, I find myself often using the shebang to start a Lua script: #!/usr/bin/env lua print "hello" But now and then one needs more flexibility. Be it that you want to use a different lua interpreter than found in the PATH or /usr/bin/env doesn't exist for your platform, et cetera. This is what I came up with to solve this problem: #!/bin/sh A=--[[ # here be your adjustments exec lua "$0" "$@" ]]A print "hello" I hope it's useful to anyone. Jörg From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 06:51:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6M9owlV010169; Wed, 22 Jul 2009 06:50:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97AD91909A; Wed, 22 Jul 2009 06:50:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.c.painless.aaisp.net.uk (b.c.painless.aaisp.net.uk [81.187.30.54]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7196718FEB for ; Wed, 22 Jul 2009 06:50:35 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTYT1-0001HS-Uy for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 10:50:32 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 36F9E75187 for ; Wed, 22 Jul 2009 10:50:29 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:47193 with envelope Message-ID: <4A66E0DD.1030002@cowlark.com> Date: Wed, 22 Jul 2009 10:50:21 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> In-Reply-To: <4A66DDB5.4050604@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6M9owlV010169 David Given wrote: [...] > I hadn't noticed that libpurple is GPL'd, not LGPL'd as I'd assumed --- > my bad. So I shall relicense Melissa accordingly; consider it to be > GPLv2 from now on. Corrected version now uploaded to http://www.cowlark.com/melissa/index.html. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 07:11:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MABVGL011936; Wed, 22 Jul 2009 07:11:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEC1619049; Wed, 22 Jul 2009 07:11:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D3E3189F1 for ; Wed, 22 Jul 2009 07:10:58 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so889799fgb.5 for ; Wed, 22 Jul 2009 03:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=v406Z9W9fN2zQkZYwJ+mvFx0L4W8/Lz6dEwQ2gpIs8Q=; b=DPgpQ6yGB4SU86a8eDHSkjxJFIC4HkUgsHLNhiShd+BCoHbP3aVvGge5E/mv0i6lku HVAu7078hHfuZr+2OEiShcu4kmGaJ4kE3GIsDgbXyDSCDWRcklHnb7eZixfku5unHw8D c2NlZSic21uS1oFJMtOtNrhh+DJnMQA0ry1ao= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=GiJGLsTMH1aI38JMP5YRhDEHGEEfH5dqBgPio3gYEAoDa53EqzySg5//8kbqdR7/oa 9eSmHtd1IeVjQMZcUcavtsW65g9HBYembiBVJTkSDXuHSkmSUSTPgZ9YlwQSQZzSPW6G opO///pDjss/Sd2/fPFfnhpJ3AuT5SOpb/te4= MIME-Version: 1.0 Received: by 10.239.144.131 with SMTP id o3mr68031hba.128.1248257457508; Wed, 22 Jul 2009 03:10:57 -0700 (PDT) In-Reply-To: <4A66DDB5.4050604@cowlark.com> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> Date: Wed, 22 Jul 2009 11:10:57 +0100 Message-ID: <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MABVGL011936 Yes, melissa was great for me to learn a few things. I normally code is Java and Python do a bit of scheme and clojure. I am learning Lua and haven't done C since school. Ideally, I would love to write a lua wrapper for libpurple, but neither my C nor my Lua knowledge is up for it. Thanks again for melissa. Ashish On Wed, Jul 22, 2009 at 10:36 AM, David Given wrote: > Ashish Shrestha wrote: > [...] >> >> Based on code from melissa [http://www.cowlark.com/melissa/index.html] > > Someone's actually *using* Melissa? Awesome! > > [...] >> >> Released under GPL2 as it links to libpurple which is GPL2. > > I hadn't noticed that libpurple is GPL'd, not LGPL'd as I'd assumed --- my > bad. So I shall relicense Melissa accordingly; consider it to be GPLv2 from > now on. > > (Sigh. Obviously, someone just forgot to relicense libpurple after it got > split off from the Pidgin core. Unfortunately, it's now probably too late to > fix...) > > -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "They laughed at Newton. They laughed at Einstein. Of course, they > │ also laughed at Bozo the Clown." --- Carl Sagan > From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 07:20:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MAKJdY012732; Wed, 22 Jul 2009 07:20:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B187C19109; Wed, 22 Jul 2009 07:19:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.ucrony.net (mail.ucrony.net [212.43.82.249]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77E8218EBE for ; Wed, 22 Jul 2009 07:19:52 -0300 (BRT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: startx@plentyfact.org) with ESMTPSA id E9C692E30F1 Date: Wed, 22 Jul 2009 11:19:02 +0100 From: startx To: lua@bazar2.conectiva.com.br Subject: Re: require vs dofile and how to organise many functions Message-ID: <20090722111902.63912339@worthil> In-Reply-To: <4895272E-40F7-4C69-B34D-828548C606BF@mac.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <4895272E-40F7-4C69-B34D-828548C606BF@mac.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MAKJdY012732 On Tue, 21 Jul 2009 18:38:53 +0200 Petite Abeille wrote: > > > would this be considered an inappropriate coding style? > > Yes, quite bad taste indeed :P > > On the other hand, "des goûts et des couleurs on ne discute pas"... > not that i want to discuss taste only ;) ... but what would be your alternative suggestion to organise a huge bunch of functions? im open to try different flavours ... startx From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 09:04:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MC4Fo7023315; Wed, 22 Jul 2009 09:04:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F9441911A; Wed, 22 Jul 2009 09:03:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01A0118B28 for ; Wed, 22 Jul 2009 09:03:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so149120ewy.5 for ; Wed, 22 Jul 2009 05:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=OPc/+eGoVgWS1IZnS6Xa7RMOQJaZV6AAQKvmomBed78=; b=IM/TZaMCa/hu11UiEXFfE4M8wmZEJU9AlAtvl8GJcnbOJZtZgpCxCMyAbc8edGmntI cu4Vt4svA5Op6MhF+vH1A4BYZKrlcbKmAvCOOWQYY61/gThIQDfMUaiTDIb1sxPOqlHU LzWtR+4PCuYcqCJAjLPLBwLu4fA3LTcq1x+HU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=lO1ifE7cuZE9aAOvT6kUiPNXxTTrSlFakL5GCEzPOSNsXKSODVT6fXw2Bb+1MsEDLG 0HOiCLV6zqMdV+ts8sa+YF4kX6F2kqSXruFx/ifbaT6DG7ikxCCg0kiHqXh9DvM1SZJ7 4uh/IEf6a3Kqua9gY07tS6KhanmUgdKeBuKE0= MIME-Version: 1.0 Received: by 10.216.8.65 with SMTP id 43mr215281weq.168.1248264204104; Wed, 22 Jul 2009 05:03:24 -0700 (PDT) In-Reply-To: <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> From: Jerome Vuarand Date: Wed, 22 Jul 2009 14:03:04 +0200 Message-ID: <89d273ba0907220503u39ed2b46g7dff98760488a517@mail.gmail.com> Subject: Re: require vs dofile and how to organise many functions To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/21 Sam Roberts : > On Tue, Jul 21, 2009 at 1:21 AM, steve donovan wrote: >> On Tue, Jul 21, 2009 at 10:05 AM, startx wrote: >>> 2) my second question is about the use of namespaces: as i have quite >>> a lot of functions, i would like to use a "subnamespace" to group the >>> functions to something like: >>> >>> myproject.core.do_something() >> >> It's actually a common pattern, e.g. look at LuaSocket. If on the >> LUA_PATH there is a directory myproject, which contains core.lua, then >> require 'myproject.core' will pull it in. If you use module() then the >> 'namespaces' are automatically created for you. > > Maybe I misunderstand what you mean by "namespaces are automatically > created for you", because > it doesn't look like it to me. > > I would expect after require"hi.bye" to be able to access "hi.bye", if > namespace were created, but that isn't how it works, as far as I can > tell. > > > > ~/w/wt/achilles-engine % lua > Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio >> require"hi.bye" >> = hi > nil >> return hi.bye > stdin:1: attempt to index global 'hi' (a nil value) > stack traceback: > stdin:1: in main chunk > [C]: ? >> = bye > table: 0x64bf50 >> return bye.name > I am bye >> > ~/w/wt/achilles-engine % cat hi/bye.lua > module("bye") > > name = "I am bye" To avoid that problem you can use the parameter passed to modules, which is the module name. So a better implementation of bye.lua would be: % cat hi/bye.lua module(...) name = "I am bye" Also the module function defines some useful variables, which can be used to look for relative modules: % cat hi.lua module(..., package.seeall) local bye = require(_NAME..".bye") print(bye.name) Here require(_NAME..".bye") is used to find a child module. You can use require(_PACKAGE.."hello") to find a sibling module. With these constructs you can have your Lua modules really independent from their path and name, which let you move them between namespaces. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 09:14:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MCDuWr024363; Wed, 22 Jul 2009 09:13:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3ABC619182; Wed, 22 Jul 2009 09:13:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDD6F19176 for ; Wed, 22 Jul 2009 09:13:24 -0300 (BRT) Received: by gxk18 with SMTP id 18so206020gxk.5 for ; Wed, 22 Jul 2009 05:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=b2Sz4/MQkst9Ep5WdkqpH8eCc41jmHUuT/4ccDK8mYw=; b=g+jk1LyB2iHGLay8CKIirvcQROuZSKOCdpUZpomz2bDsL1KFGI3MIgHZwHoVUjA2SX 4GS8Ei+IE43uZ6iCRCUSN03nI96u2winVZYq+SNi1HeB5NRL9y/30I12UGrE0PtACDzQ jftvB+wZo65w5O5n5lToW3We6La1al4lG48Cs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=yB5fc7IPvE/BSrOLgJe3ChFIZKNmivkCD0mwwEE3mlcOsuBktqi+jGisrUKy6LPjqA FomZEAMdrof/OPpIXE6xB5R39tk373Uy/sOeXRA7NOf/x4Z2Ma+GYHJVAOs6xCyJuZmZ E53DfaU+65Mwzb8m1A9/JiB9E1CCg8vmRL9a0= MIME-Version: 1.0 Received: by 10.151.105.18 with SMTP id h18mr757152ybm.45.1248264803325; Wed, 22 Jul 2009 05:13:23 -0700 (PDT) In-Reply-To: References: <389545b10907170732w1b4cac7ai1538432d620712ce@mail.gmail.com> Date: Wed, 22 Jul 2009 08:13:23 -0400 Message-ID: <389545b10907220513q6f16b57ao894c204f794a4467@mail.gmail.com> Subject: Re: LuaSocket problem From: LW To: Lua list Content-Type: multipart/alternative; boundary=0015174c46103017d8046f4a4c04 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174c46103017d8046f4a4c04 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks for the reply, Diego. I got the same reply as well, even when posting the correct UserID, APIKey and CharID (though I did see the added verbage about the 'verb' error if I looked at the packet data using tcpdump or tshark). . I wrote a simular statement using perl and received the proper XML datadump I was looking for. Having done that, I ran tcpdump and tshark to capture what was going on (my network stack knowledge is limited so I was doing a lot of guessing) and noticed a few differences on the structure of the data being sent. I will post the detailed information once I'm home (just got to work so it will be 8 hours or so from now). LuaSocket version was 2.0.2 Best, -LW On Wed, Jul 22, 2009 at 3:03 AM, Diego Nehab wrote: > Hi, > > local http = require("socket.http") >> local io = require("io") >> local ltn12 = require("ltn12") >> UserID = "userID=XXXXX" >> APIKey = "apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" >> CharID = "characterID=XXXXXXX" >> >> --Lame I know... >> reqbody = UserID.."&"..APIKey.."&"..CharID >> >> http.request { >> method = "POST", >> url = "http://api.eve-online.com/char/CharacterSheet.xml.aspx", >> headers= { ["Content-Type"] = "application/x-www-form-urlencoded", >> ["Content-Length"] = string.len(reqbody), >> }, >> source = ltn12.source.string(reqbody), >> sink = ltn12.sink.file(io.stdout) >> } >> > > On execution I get an error from the remote server about the request verb >> bad. >> > > That's not what happens here. What I get is: > > > > 2009-07-22 06:59:17 > Must provide userID parameter for > authentication. > 2009-07-22 07:04:17 > > > What version of LuaSocket are you using? > > Regards, > Diego > --0015174c46103017d8046f4a4c04 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for the reply, Diego.
=A0
I got the same reply as well, even when posting the correct UserID, AP= IKey and CharID (though I did see the added verbage about the 'verb'= ; error if I looked at the packet data using tcpdump or tshark).
.
I wrote a simular statement using perl and received the proper XML dat= adump I was looking for.
Having done that, I ran tcpdump and tshark =A0to capture what was goin= g on (my network stack knowledge is limited so I was doing a lot of guessin= g) and noticed a few differences on the structure of the data being sent.= =A0
I will post the detailed information once I'm home (just got to wo= rk so it will be 8 hours or so from now).
=A0
LuaSocket version was 2.0.2
=A0
=A0
Best,
=A0
-LW
=A0
=A0
=A0
=A0


=A0
On Wed, Jul 22, 2009 at 3:03 AM, Diego Nehab <diego@tecgra= f.puc-rio.br> wrote:
Hi,=20


=A0 local http =3D require("= ;socket.http")
=A0 local io =3D require("io")
=A0 loca= l ltn12 =3D require("ltn12")
=A0 UserID =3D "userID=3DXXXXX"
=A0 APIKey =3D "apiKey=3D= XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
=A0 CharID =3D "characte= rID=3DXXXXXXX"

=A0 --Lame I know...
=A0 reqbody =3D UserID..= "&"..APIKey.."&"..CharID

=A0 http.request {
=A0 =A0 =A0method =3D "POST",
=A0 = =A0 =A0url =3D "http://api.eve-online.com/char/CharacterShee= t.xml.aspx",
=A0 =A0 =A0headers=3D { ["Content-Type"] =3D "application/x-= www-form-urlencoded",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 ["Content-Le= ngth"] =3D string.len(reqbody),
=A0 =A0 =A0},
=A0 =A0 =A0source = =3D ltn12.source.string(reqbody),
=A0 =A0 =A0sink =3D ltn12.sink.file(io.stdout)
=A0 }
On execution I get an error from= the remote server about the request verb
bad.

That's not what happens here. What I get is:

<?xml version=3D= '1.0' encoding=3D'UTF-8'?>
<eveapi version=3D"= ;2">
=A0<currentTime>2009-07-22 06:59:17</currentTime&g= t;
=A0<error code=3D"106">Must provide userID parameter for au= thentication.</error>
=A0<cachedUntil>2009-07-22 07:04:17<= ;/cachedUntil>
</eveapi>

What version of LuaSocket are y= ou using?

Regards,
Diego
=
--0015174c46103017d8046f4a4c04-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 09:21:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MCL8fr025603; Wed, 22 Jul 2009 09:21:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A77D7191C8; Wed, 22 Jul 2009 09:20:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1023119176 for ; Wed, 22 Jul 2009 09:20:38 -0300 (BRT) Received: by fxm25 with SMTP id 25so154553fxm.5 for ; Wed, 22 Jul 2009 05:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UyjCg7+Jv7fV9rIxfKOh+OVbdQkbynsDk73Npy5PUSg=; b=FjDBZI74UNKOI/p1wHoZDX5yntuX53DM6hY9JT9rEKD9fhYIBbT+bffTN9AJYtNOYR V13J0o4Xs2kH7SBuvc6Vhn0bHgAmKkRVJhqa08narSARRlqP87AaUNJRYN/RfQDj5/Q8 +qbrHjrtBX37hOhUzQKYZ31g3zXBXuwMeqTy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RMKaTj7gDDYw06/B90srlw2wV8i8qRXhiL+0s8nxX6XUaBNpwLQzSEAYmE50+iA6vx Ihdz2qGzXlkD39lDNP/rQsbCUhnpCxlAZCzZUqOZIsy11ToxbLNK+qz89FcVVGSRL6X+ kcaiYdmfV+6jXNE5m8fzTrj3TWzWQ5zZJexho= MIME-Version: 1.0 Received: by 10.239.164.76 with SMTP id s12mr81330hbd.125.1248265237190; Wed, 22 Jul 2009 05:20:37 -0700 (PDT) In-Reply-To: <89d273ba0907220503u39ed2b46g7dff98760488a517@mail.gmail.com> References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> <89d273ba0907220503u39ed2b46g7dff98760488a517@mail.gmail.com> Date: Wed, 22 Jul 2009 14:20:37 +0200 Message-ID: <560972290907220520l5511a8efg5e4ff16f2f60ea16@mail.gmail.com> Subject: Re: require vs dofile and how to organise many functions From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 2:03 PM, Jerome Vuarand wrote: > With these constructs you can have your Lua modules really independent > from their path and name, which let you move them between namespaces. That's really cool, thanks Jerome steve d. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 11:56:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MEud2V002831; Wed, 22 Jul 2009 11:56:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E3CD18AB8; Wed, 22 Jul 2009 11:56:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f197.google.com (mail-yx0-f197.google.com [209.85.210.197]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13E3D189C3 for ; Wed, 22 Jul 2009 11:55:57 -0300 (BRT) Received: by yxe35 with SMTP id 35so390276yxe.33 for ; Wed, 22 Jul 2009 07:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=D368+XQxGApqg8MWs3w8GfvkIRZvmLEFypZAPIFCeV8=; b=j+u7gYNg410mxeHbbFw8fR4i47fTj6MGVQ8bgcDcc2yzqVwFCdOdw9g8zhLrD7su5d 1KbTSdEzJkkcPfWoz3I5wH/V0sMPNbiW3om3HWkVSt5M8zuLO6vi3iY1AejGzllC4UI6 IU6feOmptH+DZLa3vAXedJvwFGPPgCErbHKq4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=EBuFZJYnRjC0HcxXzAGLtLh8/Zi42QmYy0klJowNlcg2/SDC/39CAiPLhbPammCExf Z8J2BMlpStXbr/NCUhw1NiYmX8X7wYG70kMFztcW4+M3Prn2slI9JGFfsCXjqfw2T1Ae CWx35SrgcHJBejYboDQXbe776QWPsrUX24gcQ= MIME-Version: 1.0 Received: by 10.100.47.6 with SMTP id u6mr1301652anu.97.1248274556057; Wed, 22 Jul 2009 07:55:56 -0700 (PDT) Date: Wed, 22 Jul 2009 10:55:56 -0400 Message-ID: Subject: Support for Windows unicode paths From: "Thomas Harning Jr." To: Lua list Content-Type: multipart/alternative; boundary=0016e6509e6c7ef8e7046f4c9182 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6509e6c7ef8e7046f4c9182 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit One problem I've recently run into was accessing Windows unicode paths is impossible from Lua with its standard interface. I blame not Lua for its use of the standard C apis, but instead Windows for bad fallbacks (not to mention Outlook Express dies if you have a unicode username).... in any case it still needs to be dealt with. Has anybody come up with solutions? The only reasonably solution I can think of is to have 'replacement' APIs at boundaries that send/receive certain text from the OS... Ex: os.getenv() io.open() io.popen() os.execute .... even the require libraries would need something to deal with paths it's using The replacement format would be: Lua -> WIN : (some charset, ex UTF-8) => Wide WIN -> Lua : wide => (some charset, ex UTF-8) ... any other ideas? -- Thomas Harning Jr. --0016e6509e6c7ef8e7046f4c9182 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable One problem I've recently run into was accessing Windows unicode paths = is impossible from Lua with its standard interface.=C2=A0 I blame not Lua f= or its use of the standard C apis, but instead Windows for bad fallbacks (n= ot to mention Outlook Express dies if you have a unicode username).... in a= ny case it still needs to be dealt with.

Has anybody come up with solutions?=C2=A0 The only reasonably solution = I can think of is to have 'replacement' APIs at boundaries that sen= d/receive certain text from the OS...

Ex:
=C2=A0 os.getenv()
= =C2=A0 io.open()
=C2=A0 io.popen()
=C2=A0 os.execute
=C2=A0 .... even the require libr= aries would need something to deal with paths it's using

The rep= lacement format would be:

=C2=A0Lua -> WIN=C2=A0 : (some charset,= ex UTF-8) =3D> Wide
=C2=A0WIN -> Lua=C2=A0 : wide =3D> (some charset, ex UTF-8)

..= . any other ideas?

--
Thomas Harning Jr.
--0016e6509e6c7ef8e7046f4c9182-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:25:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFPV1l009739; Wed, 22 Jul 2009 12:25:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF9A719178; Wed, 22 Jul 2009 12:25:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33EE919076 for ; Wed, 22 Jul 2009 12:25:00 -0300 (BRT) Received: by ewy26 with SMTP id 26so304265ewy.5 for ; Wed, 22 Jul 2009 08:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=pcB7QHvfrF1dXxgmHaLCG6DYTsZE7CBI6SZOs6lo0yU=; b=uHXNE4plaM1+5oAbHuIOsESo6kANjL4PnbIaUCEuKWpgiH9xGTOEWJLHH+XKFZTSBv yinCXz1CRRHjj7KyZDs48sZ7AIYjobLXdHtGT5zUjH6B5gO+JYcIIGKhVhD97UMlsQOG 3SR6nKYmDcE9K243LNvoVq0ivYNc4LHIbme28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=ZtfkEDcge09pbcN2OSQ88FWQEzPeSNSuXRg51VxJozo8zzuOGHhnjV/8b1mQSEuNDH TgUowW6DCSLIahFfGzcZd5RtddBSI+BLelZXxn2LqEpYv9Gt1xTUJ/jH0uqRHRAuMbxK tK9SuQX6j8TuooLAmBuczQRzGJSHP4bgaK70U= Received: by 10.210.59.14 with SMTP id h14mr5539869eba.27.1248276298913; Wed, 22 Jul 2009 08:24:58 -0700 (PDT) Received: from ?124.13.56.169? ([124.13.56.169]) by mx.google.com with ESMTPS id 28sm1795476eyg.32.2009.07.22.08.24.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Jul 2009 08:24:57 -0700 (PDT) Message-ID: <4A672F4D.8000201@gmail.com> Date: Wed, 22 Jul 2009 23:25:01 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Harning Jr. wrote: > [snip] > The replacement format would be: > > Lua -> WIN : (some charset, ex UTF-8) => Wide > WIN -> Lua : wide => (some charset, ex UTF-8) > > ... any other ideas? Yeah, in theory the Lua side should just see UTF-8 for all platforms and be done with it. I've done some Lua file handling code in such a way myself. Yet I think it is not so simple if you want to target broad compatibility; look at some of the Cygwin's discussions this past few weeks and see the various charset issues still being worked out for Cygwin 1.7. A limited feature set (like "UTF-8 or the highway") would be easier to implement than what they are doing on Cygwin. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:27:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFR3NM010061; Wed, 22 Jul 2009 12:27:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1802218866; Wed, 22 Jul 2009 12:26:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94FEB186E6 for ; Wed, 22 Jul 2009 12:26:31 -0300 (BRT) Received: by fxm25 with SMTP id 25so280807fxm.5 for ; Wed, 22 Jul 2009 08:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=3hBg/7BeizgEEKEnGeTRkGaBPdaY436E2v0O9zCixMM=; b=o9tjYoaDgrjGt+/4HwM5Y745KjQBlHGoqXLp7ky6outtq/rz1wqTA3DkoqnsyPCzQF fct8n5gg3cDoaGwTKspvK0C4BrOLic+zLkUEk/FLtZa4/1g28CXDPYCKvRJy6t1iRgKu eW+D2M5yR4Bw5MXRnqQXd2hQ721Mxy83PVKa4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=ZPv0o8+REwCXMRyh3Oh6gsHs9HwSqq438Y4/kZ7irUtJQrUKknPDvBwg/ZEAoW+W+l jaBiosZm1R6nYQsVKmnNS8RvefsxJ7QeBOrCeOrLQy8qphyiwddozm8jUO3K/y7exEGG eVAunQnyU66LW5gBL7Zr3e1Z29LUP+t8DdMTM= Received: by 10.103.224.8 with SMTP id b8mr542376mur.118.1248276388703; Wed, 22 Jul 2009 08:26:28 -0700 (PDT) Received: from ?95.78.70.11? ([95.78.70.11]) by mx.google.com with ESMTPS id 25sm2509124mul.50.2009.07.22.08.26.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jul 2009 08:26:27 -0700 (PDT) Date: Wed, 22 Jul 2009 19:26:22 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1209655696.20090722192622@gmail.com> To: "Thomas Harning Jr." Subject: Re: Support for Windows unicode paths In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Thomas, Wednesday, July 22, 2009, 6:55:56 PM, you wrote: > Has anybody come up with solutions?  The only reasonably solution I > can think of is to have 'replacement' APIs at boundaries that > send/receive certain text from the OS... i don't understand that you mean by "replacement APIs". i think the best way is to provide C low-level functions that implements open, popen, getenv functionality using utf8-encoded strings (internally converting them to/from utf-16) and use in io/os packages these functions instead of usual ones just adding encoding/decoding layer is probably impossible since open/popen/... on windows uses OEM/ANSI encoding by default, and encoding from utf-8 to oem/ansi is lossy -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:30:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFUQp5010945; Wed, 22 Jul 2009 12:30:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E142188CE; Wed, 22 Jul 2009 12:30:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABF47186E6 for ; Wed, 22 Jul 2009 12:29:51 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so121713ana.26 for ; Wed, 22 Jul 2009 08:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=v15KgwnnNI9gWVEC3d7b/vdBJCG9wnjBCCE9D9W+8yY=; b=g2PO0mQpq66enfJOK7rRyAJtUUIMdJupqCn1RF0kjlU2+nDvJnlPBIDDnhpQjEOL9w VyPdpO228Y4GyDttCa76+RQ9cNKUlXBXTO5r/V+CkZRWkY/vHrlDNSx4zof3dizyqq0q EScZqPiIbC2dadyEq1/WYQJCggZvCwDp25MmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=VINwwlA+lzmr1D4CZPYCwO9G4dhs9Cj7FqQMHNtQMO8Ol1PXUVvqW+PMf6ZM/UaWyZ Nh/7GZWj3O/WW6+yS22l5H8O84dSJPqpjdN3zsbRzq921shP/AaiMhIktqTS162VWZOv zzJo4ba9ksc/yk3c0TToB6cUYe3AOKvqFbw6Y= MIME-Version: 1.0 Received: by 10.100.109.10 with SMTP id h10mr1244786anc.176.1248276588381; Wed, 22 Jul 2009 08:29:48 -0700 (PDT) In-Reply-To: <1209655696.20090722192622@gmail.com> References: <1209655696.20090722192622@gmail.com> Date: Wed, 22 Jul 2009 11:29:48 -0400 Message-ID: Subject: Re: Support for Windows unicode paths From: "Thomas Harning Jr." To: Bulat Ziganshin Content-Type: multipart/alternative; boundary=0016e650976ea1c694046f4d0a49 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e650976ea1c694046f4d0a49 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Wed, Jul 22, 2009 at 11:26 AM, Bulat Ziganshin wrote: > Hello Thomas, > > Wednesday, July 22, 2009, 6:55:56 PM, you wrote: > > > Has anybody come up with solutions? The only reasonably solution I > > can think of is to have 'replacement' APIs at boundaries that > > send/receive certain text from the OS... > > i don't understand that you mean by "replacement APIs". i think the > best way is to provide C low-level functions that implements open, > popen, getenv functionality using utf8-encoded strings (internally > converting them to/from utf-16) and use in io/os packages these > functions instead of usual ones > What you've just described /is/ the replacement API I was thinking about. Has anyone already performed this work (making a 'lightweight' wrapper for Windows to make Lua operate like this)"? -- Thomas Harning Jr. --0016e650976ea1c694046f4d0a49 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Jul 22, 2009 at 11:26 AM, Bulat Ziganshi= n <bulat.= ziganshin@gmail.com> wrote:
Hello Thomas,

Wednesday, July 22, 2009, 6:55:56 PM, you wrote:

> Has anybody come up with solutions?=C2=A0 The only reasonably solution= I
> can think of is to have 'replacement' APIs at boundaries that<= br> > send/receive certain text from the OS...

i don't understand that you mean by "replacement APIs".= i think the
best way is to provide C low-level functions that implements open,
popen, getenv functionality using utf8-encoded strings (internally
converting them to/from utf-16) and use in io/os packages these
functions instead of usual ones
What you've just described /is/ the replacement API I= was thinking about.

Has anyone already performed this work (making = a 'lightweight' wrapper for Windows to make Lua operate like this)&= quot;?

--
Thomas Harning Jr.
--0016e650976ea1c694046f4d0a49-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:36:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFaTWe012122; Wed, 22 Jul 2009 12:36:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2532B189C3; Wed, 22 Jul 2009 12:36:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDC06188A4 for ; Wed, 22 Jul 2009 12:36:01 -0300 (BRT) Received: by wa-out-1112.google.com with SMTP id v27so38596wah.5 for ; Wed, 22 Jul 2009 08:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=6l760qZBaKOAtj0A/sF0L/z5KP63+9annBkwoB3T9M0=; b=bC2DDZ8MF6Y0cki00bhQrM3nq1S6LrLf+YTmK4hNUHLzJEyq4tUve9jarqO/L7AVZL lHfbjrUU36Bvr9/m7irxICSWG+auieP55sZn2lF0f8Q7vUOcqkdtONM8zUw66n2P8NjM f4Qd8Lctlb+7Z/0KgE/k5ML3feyDcr6aKqsPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=uibN1CiXm1HBxE9OnpE1mSFEzM/qCFE1l9lpZEiyDLo/byOPcrpchoFz4dhp/FTUC9 wKAPs3nmfXhZnkDeY6/IdjEnjZVKsa/vGbbX0A53nHC7w65YqwNqIQNUt1pIXX3Yslhv paoUaxG+KRO+DDkvv+RR5HrIOElxt3iahWhfQ= Received: by 10.114.210.3 with SMTP id i3mr740067wag.207.1248276960121; Wed, 22 Jul 2009 08:36:00 -0700 (PDT) Received: from ?124.13.56.169? ([124.13.56.169]) by mx.google.com with ESMTPS id j28sm1291390waf.67.2009.07.22.08.35.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Jul 2009 08:35:59 -0700 (PDT) Message-ID: <4A6731E6.6070909@gmail.com> Date: Wed, 22 Jul 2009 23:36:06 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Harning Jr. wrote: > On Wed, Jul 22, 2009 at 11:26 AM, Bulat Ziganshin wrote: > > Hello Thomas, > > Wednesday, July 22, 2009, 6:55:56 PM, you wrote: > > > Has anybody come up with solutions? The only reasonably solution I > > can think of is to have 'replacement' APIs at boundaries that > > send/receive certain text from the OS... > > i don't understand that you mean by "replacement APIs". i think the > best way is to provide C low-level functions that implements open, > popen, getenv functionality using utf8-encoded strings (internally > converting them to/from utf-16) and use in io/os packages these > functions instead of usual ones > > What you've just described /is/ the replacement API I was thinking about. > > Has anyone already performed this work (making a 'lightweight' wrapper > for Windows to make Lua operate like this)"? Oh, just forgot, it has already been done, check apr, the Apache Portable Runtime, the file i/o uses all sorts of UTF-something. There might be a binding available, but I am too lazy to check the wiki... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:44:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFismp013657; Wed, 22 Jul 2009 12:44:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DC7518A35; Wed, 22 Jul 2009 12:44:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (unknown [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A230F1897E for ; Wed, 22 Jul 2009 12:44:25 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTdzR-0000o3-5J for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 16:44:21 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 5173C5278D for ; Wed, 22 Jul 2009 16:44:18 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:52861 with envelope Message-ID: <4A6733CA.9090200@cowlark.com> Date: Wed, 22 Jul 2009 16:44:10 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> In-Reply-To: <1209655696.20090722192622@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MFismp013657 Bulat Ziganshin wrote: [...] > just adding encoding/decoding layer is probably impossible since > open/popen/... on windows uses OEM/ANSI encoding by default, and > encoding from utf-8 to oem/ansi is lossy It's worse than you think. On Windows, the ANSI file system APIs have a much shorter maximum path length than the UTF-16 ones! Read this: http://subversion.tigris.org/faq.html#long-paths So a naive mapping of the Lua functions to the corresponding Windows ones is not necessarily going to work --- it's entirely possible to be in a situation where just calling getcwd() fails. Ditching the ANSI APIs completely and using the UTF-16 ones entirely is probably the best way to go, unfortunately... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 12:47:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MFl3wp014244; Wed, 22 Jul 2009 12:47:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A55B18B28; Wed, 22 Jul 2009 12:46:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00B1318A5B for ; Wed, 22 Jul 2009 12:46:34 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so127201ana.26 for ; Wed, 22 Jul 2009 08:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FsZYl/PgXbVcNSjx8t1Eta4eNrdr6UgoiD9jd04EPCg=; b=jEZgqkVw/Z+RG+AyRvpXMWxYJ0S2cReREZZYSZDTnSYONIBvtng2EVCvMM4HKiv1i0 tDtQ/sJSobmotwd+tYC2BKiLjFOhYn5wIwWtpZ1gHbVKasW+vpHoIqh/TFrkSHSicZaD IVxAFq+cePLcMn0bBF9rLTbKp1P6smb5K0ShY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BU+usHFBv8dRoDYjrCF1SVo6fud3PTOGd6d2+rH2h/TxDQV42Izf838Ks2VKaRlwGY 5ZIoXGvIPIYH4bgh+prYDI+TC48J/6d10fD7PlL+hxeUQE7b1Cfp/unDStXXN8WixcSs 1cC3rr88pg6XYmOAk/W4vJskQtteShGun6Rsc= MIME-Version: 1.0 Received: by 10.100.47.10 with SMTP id u10mr1412190anu.17.1248277593050; Wed, 22 Jul 2009 08:46:33 -0700 (PDT) In-Reply-To: <4A6733CA.9090200@cowlark.com> References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> Date: Wed, 22 Jul 2009 11:46:33 -0400 Message-ID: Subject: Re: Support for Windows unicode paths From: "Thomas Harning Jr." To: Lua list Content-Type: multipart/alternative; boundary=0016e642de0683cdad046f4d4615 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e642de0683cdad046f4d4615 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Wed, Jul 22, 2009 at 11:44 AM, David Given wrote: > Bulat Ziganshin wrote: > [...] > >> just adding encoding/decoding layer is probably impossible since >> open/popen/... on windows uses OEM/ANSI encoding by default, and >> encoding from utf-8 to oem/ansi is lossy >> > > It's worse than you think. On Windows, the ANSI file system APIs have a > much shorter maximum path length than the UTF-16 ones! Read this: > > http://subversion.tigris.org/faq.html#long-paths > > So a naive mapping of the Lua functions to the corresponding Windows ones > is not necessarily going to work --- it's entirely possible to be in a > situation where just calling getcwd() fails. > > Ditching the ANSI APIs completely and using the UTF-16 ones entirely is > probably the best way to go, unfortunately... Yeah, that's what I'd figured I had to do. Basically replace all ANSI APIs with the UTF-16 ones, and have an automatic conversion from UTF-8 => UTF-16 [and back when pulling data out] -- Thomas Harning Jr. --0016e642de0683cdad046f4d4615 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Jul 22, 2009 at 11:44 AM, David Given <dg@cowlark.com>= ; wrote:

just adding encoding/decoding layer is probably impossible since
open/popen/... on windows uses OEM/ANSI encoding by default, and
encoding from utf-8 to oem/ansi is lossy

It's worse than you think. On Windows, the ANSI file system APIs have a= much shorter maximum path length than the UTF-16 ones! Read this:

http://subversion.tigris.org/faq.html#long-paths

So a naive mapping of the Lua functions to the corresponding Windows ones i= s not necessarily going to work --- it's entirely possible to be in a s= ituation where just calling getcwd() fails.

Ditching the ANSI APIs completely and using the UTF-16 ones entirely is pro= bably the best way to go, unfortunately...
Yeah, that's what I'd figured I had to do.

Basically replace all ANSI APIs with the UTF-16 ones, and have an automatic= conversion from UTF-8 =3D> UTF-16=C2=A0 [and back when pulling data out= ]


--
Thomas Harning Jr.
--0016e642de0683cdad046f4d4615-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 13:19:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MGJR8E020807; Wed, 22 Jul 2009 13:19:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B312D1899C; Wed, 22 Jul 2009 13:18:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68D641886D for ; Wed, 22 Jul 2009 13:18:39 -0300 (BRT) Received: by ewy26 with SMTP id 26so347311ewy.5 for ; Wed, 22 Jul 2009 09:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=FtaL7YfcnHKXABPkbdDpwUYELmqMEFR8z0iBiPswcAA=; b=UsKj+KGv0ezm9KNy/RzlLeOqWUFH+cFBJWYSXhhWJRH6rS0EYSEPzjhwGAY+619D09 MlB2ZJhhjE2V05+7KKfrydqP3JhHwiupjXw217Y1TkEcpglDVrmL6g1HnOrW7wxtgM9T bM/Kd/AQCW1cxItorloEh84yc8Hen+nUTkyxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=oQVv8Pt5h1GH3M7afqx72NiFPAvgPiyNgXr5phc/HrG8T/rFGyt5HeUEzVoPx8uowh Qh4MoJQ7W074k3OnLJOSa3rh/pJ+oxhduewUeAtk0kV3U1XJmnmzL0Bt2yOHxJCExrbC Tw/huZPVpBhygCYF7tC6wRSJ469byoAoqrt1s= MIME-Version: 1.0 Received: by 10.216.29.201 with SMTP id i51mr292842wea.214.1248279515123; Wed, 22 Jul 2009 09:18:35 -0700 (PDT) In-Reply-To: References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> From: Jerome Vuarand Date: Wed, 22 Jul 2009 18:18:15 +0200 Message-ID: <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> Subject: Re: Support for Windows unicode paths To: Lua list Content-Type: multipart/mixed; boundary=0016368e2f4f145082046f4db909 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016368e2f4f145082046f4db909 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 2009/7/22 Thomas Harning Jr. : > On Wed, Jul 22, 2009 at 11:44 AM, David Given wrote: >> >> Bulat Ziganshin wrote: >> [...] >>> >>> just adding encoding/decoding layer is probably impossible since >>> open/popen/... on windows uses OEM/ANSI encoding by default, and >>> encoding from utf-8 to oem/ansi is lossy >> >> It's worse than you think. On Windows, the ANSI file system APIs have a >> much shorter maximum path length than the UTF-16 ones! Read this: >> >> http://subversion.tigris.org/faq.html#long-paths >> >> So a naive mapping of the Lua functions to the corresponding Windows ones >> is not necessarily going to work --- it's entirely possible to be in a >> situation where just calling getcwd() fails. >> >> Ditching the ANSI APIs completely and using the UTF-16 ones entirely is >> probably the best way to go, unfortunately... > > Yeah, that's what I'd figured I had to do. > > Basically replace all ANSI APIs with the UTF-16 ones, and have an automatic > conversion from UTF-8 => UTF-16 [and back when pulling data out] I have a patch (attached) replacing win32 API calls with the wide versions, with the help of a couple helper functions (lua_towstring, lua_pushwstring) that convert between utf-8 (Lua side) and utf-16 (win32 side). You can use that as a basis to replace all appropriate clib calls. I have more complete wstring management functions in another lib if you're interested (lua_tolwstring, lua_pushlwstring, luaL_*, etc.). I also have a partial win32 binding using the same mechanism (ie. utf-8 in Lua and wide version of win32 API calls). That could be a basis to add utf-8 support to Lua standard libraries without patching the core. It's available as sources there: http://piratery.net/hg/lwin32/archive/tip.tar.gz. --0016368e2f4f145082046f4db909 Content-Type: application/octet-stream; name="win32-unicode.patch" Content-Disposition: attachment; filename="win32-unicode.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxg92o1j0 ZGlmZiAtdXJOIGEvbHVhLTUuMS40L3NyYy9sb2FkbGliLmMgYi9sdWEtNS4xLjQvc3JjL2xvYWRs aWIuYw0KLS0tIGEvbHVhLTUuMS40L3NyYy9sb2FkbGliLmMJRnJpIERlYyAyOCAwOTo1ODo0MyAy MDA3DQorKysgYi9sdWEtNS4xLjQvc3JjL2xvYWRsaWIuYwlNb24gTWFyIDMxIDIzOjIyOjIyIDIw MDgNCkBAIC05MSwzMCArOTEsNTggQEANCiANCiAjaW5jbHVkZSA8d2luZG93cy5oPg0KIA0KK3dj aGFyX3QqIGx1YV90b3dzdHJpbmcobHVhX1N0YXRlKiBMLCBpbnQgaW5kZXgpDQorew0KKyAgY29u c3QgY2hhciogdXRmODsNCisgIHNpemVfdCBzaXplOw0KKyAgd2NoYXJfdCogdXRmMTY7DQorICB1 dGY4ID0gbHVhX3Rvc3RyaW5nKEwsIGluZGV4KTsNCisgIHNpemUgPSBNdWx0aUJ5dGVUb1dpZGVD aGFyKENQX1VURjgsIDAsIHV0ZjgsIC0xLCAwLCAwKTsNCisgIHV0ZjE2ID0gKHdjaGFyX3QqKWx1 YV9uZXd1c2VyZGF0YShMLCBzaXplICogc2l6ZW9mKHdjaGFyX3QpKTsNCisgIE11bHRpQnl0ZVRv V2lkZUNoYXIoQ1BfVVRGOCwgMCwgdXRmOCwgLTEsIHV0ZjE2LCBzaXplKTsNCisgIGx1YV9yZXBs YWNlKEwsIGluZGV4KTsNCisgIHJldHVybiB1dGYxNjsNCit9DQorDQordm9pZCBsdWFfcHVzaHdz dHJpbmcobHVhX1N0YXRlKiBMLCBjb25zdCB3Y2hhcl90KiB2YWx1ZSkNCit7DQorICBzaXplX3Qg c2l6ZTsNCisgIGNoYXIqIHV0Zjg7DQorICBzaXplID0gV2lkZUNoYXJUb011bHRpQnl0ZShDUF9V VEY4LCAwLCB2YWx1ZSwgLTEsIDAsIDAsIDAsIDApOw0KKyAgdXRmOCA9IChjaGFyKilsdWFfbmV3 dXNlcmRhdGEoTCwgc2l6ZSk7DQorICBXaWRlQ2hhclRvTXVsdGlCeXRlKENQX1VURjgsIDAsIHZh bHVlLCAtMSwgdXRmOCwgc2l6ZSwgMCwgMCk7DQorICBsdWFfcHVzaHN0cmluZyhMLCB1dGY4KTsN CisgIGx1YV9yZW1vdmUoTCwgLTIpOyAvKiByZW1vdmUgdGhlIHV0Zi04IHVzZXJkYXRhICovDQor fQ0KIA0KICN1bmRlZiBzZXRwcm9nZGlyDQogDQogc3RhdGljIHZvaWQgc2V0cHJvZ2RpciAobHVh X1N0YXRlICpMKSB7DQotICBjaGFyIGJ1ZmZbTUFYX1BBVEggKyAxXTsNCi0gIGNoYXIgKmxiOw0K LSAgRFdPUkQgbnNpemUgPSBzaXplb2YoYnVmZikvc2l6ZW9mKGNoYXIpOw0KLSAgRFdPUkQgbiA9 IEdldE1vZHVsZUZpbGVOYW1lQShOVUxMLCBidWZmLCBuc2l6ZSk7DQotICBpZiAobiA9PSAwIHx8 IG4gPT0gbnNpemUgfHwgKGxiID0gc3RycmNocihidWZmLCAnXFwnKSkgPT0gTlVMTCkNCisgIHdj aGFyX3QgYnVmZltNQVhfUEFUSCArIDFdOw0KKyAgd2NoYXJfdCAqbGI7DQorICBEV09SRCBuc2l6 ZSA9IE1BWF9QQVRIICsgMTsNCisgIERXT1JEIG4gPSBHZXRNb2R1bGVGaWxlTmFtZVcoTlVMTCwg YnVmZiwgbnNpemUpOw0KKyAgaWYgKG4gPT0gMCB8fCBuID09IG5zaXplIHx8IChsYiA9IHdjc3Jj aHIoYnVmZiwgTCdcXCcpKSA9PSBOVUxMKQ0KICAgICBsdWFMX2Vycm9yKEwsICJ1bmFibGUgdG8g Z2V0IE1vZHVsZUZpbGVOYW1lIik7DQogICBlbHNlIHsNCi0gICAgKmxiID0gJ1wwJzsNCi0gICAg bHVhTF9nc3ViKEwsIGx1YV90b3N0cmluZyhMLCAtMSksIExVQV9FWEVDRElSLCBidWZmKTsNCi0g ICAgbHVhX3JlbW92ZShMLCAtMik7ICAvKiByZW1vdmUgb3JpZ2luYWwgc3RyaW5nICovDQorICAg ICpsYiA9IEwnXDAnOw0KKyAgICBsdWFfcHVzaHdzdHJpbmcoTCwgYnVmZik7DQorICAgIGx1YUxf Z3N1YihMLCBsdWFfdG9zdHJpbmcoTCwgLTIpLCBMVUFfRVhFQ0RJUiwgbHVhX3Rvc3RyaW5nKEws IC0xKSk7DQorICAgIGx1YV9yZW1vdmUoTCwgLTMpOyAgLyogcmVtb3ZlIG9yaWdpbmFsIHN0cmlu ZyAqLw0KKyAgICBsdWFfcmVtb3ZlKEwsIC0yKTsgIC8qIHJlbW92ZSB1dGYtOCBjb3B5IG9mIGJ1 ZmYgKi8NCiAgIH0NCiB9DQogDQogDQogc3RhdGljIHZvaWQgcHVzaGVycm9yIChsdWFfU3RhdGUg KkwpIHsNCiAgIGludCBlcnJvciA9IEdldExhc3RFcnJvcigpOw0KLSAgY2hhciBidWZmZXJbMTI4 XTsNCi0gIGlmIChGb3JtYXRNZXNzYWdlQShGT1JNQVRfTUVTU0FHRV9JR05PUkVfSU5TRVJUUyB8 IEZPUk1BVF9NRVNTQUdFX0ZST01fU1lTVEVNLA0KLSAgICAgIE5VTEwsIGVycm9yLCAwLCBidWZm ZXIsIHNpemVvZihidWZmZXIpLCBOVUxMKSkNCi0gICAgbHVhX3B1c2hzdHJpbmcoTCwgYnVmZmVy KTsNCisgIHdjaGFyX3QqIGJ1ZmZlcjsNCisgIGlmIChGb3JtYXRNZXNzYWdlVyhGT1JNQVRfTUVT U0FHRV9JR05PUkVfSU5TRVJUUyB8IEZPUk1BVF9NRVNTQUdFX0ZST01fU1lTVEVNIHwgRk9STUFU X01FU1NBR0VfQUxMT0NBVEVfQlVGRkVSLA0KKyAgICAgIE5VTEwsIGVycm9yLCAwLCAod2NoYXJf dCopJmJ1ZmZlciwgMCwgTlVMTCkpDQorICB7DQorICAgIGx1YV9wdXNod3N0cmluZyhMLCBidWZm ZXIpOw0KKyAgICBMb2NhbEZyZWUoKEhMT0NBTClidWZmZXIpOw0KKyAgfQ0KICAgZWxzZQ0KICAg ICBsdWFfcHVzaGZzdHJpbmcoTCwgInN5c3RlbSBlcnJvciAlZFxuIiwgZXJyb3IpOw0KIH0NCkBA IC0xMjMsOSArMTUxLDEzIEBADQogICBGcmVlTGlicmFyeSgoSElOU1RBTkNFKWxpYik7DQogfQ0K IA0KLQ0KIHN0YXRpYyB2b2lkICpsbF9sb2FkIChsdWFfU3RhdGUgKkwsIGNvbnN0IGNoYXIgKnBh dGgpIHsNCi0gIEhJTlNUQU5DRSBsaWIgPSBMb2FkTGlicmFyeUEocGF0aCk7DQorICB3Y2hhcl90 KiB3cGF0aDsNCisgIEhJTlNUQU5DRSBsaWI7DQorICBsdWFfcHVzaHN0cmluZyhMLCBwYXRoKTsN CisgIHdwYXRoID0gbHVhX3Rvd3N0cmluZyhMLCAtMSk7DQorICBsaWIgPSBMb2FkTGlicmFyeVco d3BhdGgpOw0KKyAgbHVhX3BvcChMLCAxKTsNCiAgIGlmIChsaWIgPT0gTlVMTCkgcHVzaGVycm9y KEwpOw0KICAgcmV0dXJuIGxpYjsNCiB9DQo= --0016368e2f4f145082046f4db909-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 13:33:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MGX2VS023820; Wed, 22 Jul 2009 13:33:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BB8E18A4B; Wed, 22 Jul 2009 13:32:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 059BC1892D for ; Wed, 22 Jul 2009 13:32:30 -0300 (BRT) Received: (qmail 19662 invoked by uid 399); 22 Jul 2009 10:32:22 -0600 Received: from unknown (HELO ?10.102.8.74?) (jjensen@workspacewhiz.com@204.128.230.1) by hsmail.qwknetllc.com with ESMTPAM; 22 Jul 2009 10:32:22 -0600 X-Originating-IP: 204.128.230.1 Message-ID: <4A673F14.3090609@workspacewhiz.com> Date: Wed, 22 Jul 2009 10:32:20 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> In-Reply-To: <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Jerome Vuarand Date: 7/22/2009 10:18 AM > I have a patch (attached) replacing win32 API calls with the wide > versions, with the help of a couple helper functions (lua_towstring, > lua_pushwstring) that convert between utf-8 (Lua side) and utf-16 > (win32 side). You can use that as a basis to replace all appropriate > clib calls. I have more complete wstring management functions in > another lib if you're interested (lua_tolwstring, lua_pushlwstring, > luaL_*, etc.). > FWIW, LuaPlus (http://luaplus.org) has wide string support. It is probably similar to your patch, but the wide string functionality is built into the language itself. It can even read UCS-2 .lua files. Be sure to grab latest Subversion from svn://svn.luaplus.org/LuaPlus/work51. Everything is #ifdef'ed. Look for LUA_WIDESTRING and LUA_WIDESTRING_FILE. Josh From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 13:38:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MGcIeW024963; Wed, 22 Jul 2009 13:38:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B43818A02; Wed, 22 Jul 2009 13:37:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF15D18A4B for ; Wed, 22 Jul 2009 13:37:50 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KN6006WHZH9PP70@asmtp012.mac.com> for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 09:37:35 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <89d273ba0907220503u39ed2b46g7dff98760488a517@mail.gmail.com> Subject: Re: require vs dofile and how to organise many functions Date: Wed, 22 Jul 2009 18:36:45 +0200 References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <560972290907210121yaf30cdfr2d28e93d200f681c@mail.gmail.com> <17eac67c0907211128l1796c109g5efbd36af71c43ec@mail.gmail.com> <89d273ba0907220503u39ed2b46g7dff98760488a517@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 22, 2009, at 2:03 PM, Jerome Vuarand wrote: > With these constructs you can have your Lua modules really independent > from their path and name, which let you move them between namespaces. Hmmm... right... you are trading one set of problems for another, e.g.: % cat TestFoo.lua module( ..., package.seeall ) print( _NAME ) % cat TestBar.lua module( ..., package.seeall ) print( _NAME ) % cat TestBaz.lua print( require( 'TestBar' )._NAME ) print( require( 'TestFoo' )._NAME ) % lua TestBaz.lua TestBar TestBar TestFoo TestFoo % luac -o TestBaz.luac TestFoo.lua TestBar.lua % lua TestBaz.luac lua: TestFoo.lua:1: bad argument #1 to 'module' (string expected, got nil) stack traceback: [C]: in function 'module' TestFoo.lua:1: in main chunk (luac): in main chunk [C]: ? Ooooops... your code now depends on its physical representation... oh, well... Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 13:54:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MGspJD028582; Wed, 22 Jul 2009 13:54:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D85218C23; Wed, 22 Jul 2009 13:54:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F97C18A35 for ; Wed, 22 Jul 2009 13:54:19 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KN7009LJ09L5B20@asmtp019.mac.com> for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 09:54:17 -0700 (PDT) Message-id: <64F49FA5-F290-4600-9CF2-FA5DC23CC1E1@mac.com> From: Petite Abeille To: Lua list In-reply-to: <20090722111902.63912339@worthil> Subject: Re: require vs dofile and how to organise many functions Date: Wed, 22 Jul 2009 18:53:44 +0200 References: <31ca41400907192104mff51fdcj3ea4cd9aaacb6159@mail.gmail.com> <4A63FC99.10103@gmail.com> <560972290907192318j1c61dc69of5bfd4cc2cd9f53f@mail.gmail.com> <20090721090517.030527f0@worthil> <4895272E-40F7-4C69-B34D-828548C606BF@mac.com> <20090722111902.63912339@worthil> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 22, 2009, at 12:19 PM, startx wrote: > not that i want to discuss taste only ;) ... but what would be your > alternative suggestion to organise a huge bunch of functions? im open > to try different flavours ... There are many ways to skin that cat, but I personally use module( 'MyModule' ) and that's all. In general, one file, one named module, one private name space, one public API exposed through meta methods. For example, assuming a module 'HMAC': http://dev.alt.textdrive.com/browser/HTTP/HMAC.lua % cat HMAC.lua -- import external dependencies local getmetatable = getmetatable local setmetatable = setmetatable -- explicitly name the module module( 'HMAC' ) -- add meta table when appropriate local self = setmetatable( _M, {} ) local meta = getmetatable( self ) -- do stuff in the privacy of the module local function HMAC( aKey, aValue ) end -- expose stuff to the outside function meta:__call( aKey, aValue ) return HMAC( aKey, aValue ) end FWIW, the above convention is followed by Nanoki: http://dev.alt.textdrive.com/browser/HTTP As with many other things in Lua, it takes a while to come up with an organizational style which consistently support one programming mannerism due to Lua's inherent flexibility. http://lua-users.org/wiki/LuaStyleGuide Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 14:16:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MHGb9E001570; Wed, 22 Jul 2009 14:16:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB40318C54; Wed, 22 Jul 2009 14:16:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gateway01.websitewelcome.com (gateway01.websitewelcome.com [69.93.139.19]) by bazar2.conectiva.com.br (Postfix) with SMTP id D922218ADE for ; Wed, 22 Jul 2009 14:16:04 -0300 (BRT) Received: (qmail 20281 invoked from network); 22 Jul 2009 17:21:45 -0000 Received: from gator504.hostgator.com (74.53.141.18) by gateway01.websitewelcome.com with SMTP; 22 Jul 2009 17:21:45 -0000 Received: from 204.234.100.97.cfl.res.rr.com ([97.100.234.204]:49319 helo=VADER) by gator504.hostgator.com with esmtpa (Exim 4.69) (envelope-from ) id 1MTfQ4-0000m6-12 for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 12:15:56 -0500 From: "b's spam" To: References: In-Reply-To: Subject: Direct Memory Access to Lua variables? Date: Wed, 22 Jul 2009 13:15:56 -0400 Message-ID: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01CA0ACE.8CE09670" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcoK7xO36ljRbuYjQKWyNyFWk4h4TAAAPJiA X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator504.hostgator.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - inlandstudios.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0007_01CA0ACE.8CE09670 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm writing a C++ wrapper class that allows me to manipulate variables in a loaded lua script. It works fine, but is very slow because I'm performing these operations many times (in real-time). Is there a way to write directly to the memory location without having to search and push the variable onto the stack by name? example: LuaBool myBool ( lua_state, "boolvar_in_script" ); LuaFloat myValue ( lua_state, "floatvar_in_script" ); for loop() { myBool = false; // write to variable myValue= 1.25f; bool tmpBoolean = myBool; // read from variable } ------=_NextPart_000_0007_01CA0ACE.8CE09670 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I'm writing a C++ wrapper class that allows = me to manipulate variables in a loaded lua script. It works fine, but is very = slow because I'm performing these operations many times (in real-time). Is = there a way to write directly to the memory location without having to search = and push the variable onto the stack by name?

example:

LuaBool myBool ( lua_state, = "boolvar_in_script" );
LuaFloat myValue ( lua_state, "floatvar_in_script" );

for loop()
{
   myBool =3D false; // write to = variable
   myValue=3D 1.25f; =

 

   bool tmpBoolean =3D myBool; // = read from variable
}

------=_NextPart_000_0007_01CA0ACE.8CE09670-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 14:25:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MHOvYY004135; Wed, 22 Jul 2009 14:24:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4046B18D02; Wed, 22 Jul 2009 14:24:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C31EC18C23 for ; Wed, 22 Jul 2009 14:24:23 -0300 (BRT) Received: by bwz17 with SMTP id 17so354911bwz.5 for ; Wed, 22 Jul 2009 10:24:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.241.15 with SMTP id t15mr357620mur.1.1248283460739; Wed, 22 Jul 2009 10:24:20 -0700 (PDT) In-Reply-To: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> Date: Wed, 22 Jul 2009 17:24:20 +0000 Message-ID: <90eb1dc70907221024i4d7b7f31kba45c83a0c66886a@mail.gmail.com> Subject: Re: Direct Memory Access to Lua variables? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 5:15 PM, b's spam wrote: > I'm writing a C++ wrapper class that allows me to manipulate variables in a > loaded lua script. It works fine, but is very slow because I'm performing > these operations many times (in real-time). Is there a way to write directly > to the memory location without having to search and push the variable onto > the stack by name? if you're executing Lua code between the C++ accesses, any Lua table (including _G) could've been rehashed, rendering any 'direct access' address unusable. -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 14:47:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MHlV17010905; Wed, 22 Jul 2009 14:47:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F32F18C89; Wed, 22 Jul 2009 14:47:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E34318AB8 for ; Wed, 22 Jul 2009 14:47:00 -0300 (BRT) Received: by ewy26 with SMTP id 26so412438ewy.5 for ; Wed, 22 Jul 2009 10:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=O7F0/hK0qW6eLgSp0mSo+HDLarhQcIOIp9uOi4z53LU=; b=HAHzBRbA89A1oD8s8p9w8P57nau1RJO+AebOK5v5/51x2pc/EN5CxHh4YtWrxU9yUr MRugKSTbWfXXAOWhk6V+s3zakhjgUE2nAt3mXeY++rOWk5nU4Qhmo+lBIlmWKhckAHRq kDPesH95fJu8+HH7plpfxi1+9Pmr0Qb+yggss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bjjAsNqMx294rVoeOyx1x/mbSNLpgLHwackLmCpccoEZK2fItoB9XAmpYv3D+HYs7t 5JbuXuVRl/8/B7KnXCnhumnJnpaxwZFOnic/WaozWWHreHLab6axxuXgFqrbSJZd2oSR i7Ab8i5y80sticgGNyufgwJBAoMMVUpLt8Izo= MIME-Version: 1.0 Received: by 10.216.10.74 with SMTP id 52mr319096weu.226.1248284818131; Wed, 22 Jul 2009 10:46:58 -0700 (PDT) In-Reply-To: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> Date: Wed, 22 Jul 2009 18:46:58 +0100 Message-ID: Subject: Re: Direct Memory Access to Lua variables? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 6:15 PM, b's spam wrote: > I'm writing a C++ wrapper class that allows me to manipulate variables in a > loaded lua script. It works fine, but is very slow because I'm performing > these operations many times (in real-time). Is there a way to write directly > to the memory location without having to search and push the variable onto > the stack by name? Unfortunately I think the immediate answer is no, you can't get a trustworthy memory location. If you're interested, what I'd recommend trying instead is storing the values on the C++ side, with "getter" and "setter" functions for them present in the Lua universe. Once you have these you can also try using them inside __index and __newindex metamethods on a table/userdata so that it feels more seamless (although you will probably lose some performance again in doing that). -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 15:21:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MILhYJ018696; Wed, 22 Jul 2009 15:21:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84DC31865D; Wed, 22 Jul 2009 15:21:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B3B7185EB for ; Wed, 22 Jul 2009 15:20:57 -0300 (BRT) Received: from tux.CS.Princeton.EDU (tux.CS.Princeton.EDU [128.112.155.166]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id n6MIKqdn028631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 22 Jul 2009 14:20:54 -0400 (EDT) Date: Wed, 22 Jul 2009 14:20:52 -0400 (EDT) From: Diego Nehab To: Lua list Subject: Re: LuaSocket problem In-Reply-To: <389545b10907220513q6f16b57ao894c204f794a4467@mail.gmail.com> Message-ID: References: <389545b10907170732w1b4cac7ai1538432d620712ce@mail.gmail.com> <389545b10907220513q6f16b57ao894c204f794a4467@mail.gmail.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5684 signatures=539483 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > I got the same reply as well, even when posting the > correct UserID, APIKey and CharID (though I did see the > added verbage about the 'verb' error if I looked at the > packet data using tcpdump or tshark). I am willing to debug this for you. There really are only three options: A bug in LuaSocket, a bug in the server that other browsers work around, or a bug in your code. Unless it is a bug in your code, I have to fix it. So let's talk in private so I can get the complete data over what is going on. Regards, Diego From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:14:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJEkcu000625; Wed, 22 Jul 2009 16:14:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 050A11892D; Wed, 22 Jul 2009 16:14:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 764FC18890 for ; Wed, 22 Jul 2009 16:14:05 -0300 (BRT) Received: by gxk18 with SMTP id 18so638466gxk.5 for ; Wed, 22 Jul 2009 12:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=3VWNpGQOf6NkOBbvharkbxausHEDv9sc7IhsQYKUB/U=; b=S9hnjhbSzDqLA3kuEpGTpFWpUdnI/ckjhI5bnVpq0XZlAKESvyeT95S4xb117JVi8a KPFqKzA1vyxzhtvMVWWQNWGu3Iv3WXvOGGj/uSUpu7eUFymKNasmgDUMBHG5q8rQEl6T DKV+LjlLZlKftPVempj+BWjy2WkG8tOnNaiOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=rd3dy6CJiBHm9HDb0JOoC5GxdBRa73fft1tM2pk579ZzinvIZCurkZguWwbBQku/Gm q0tuPeycSV50eOAXZGxVeOiszAtiZhdlh00n3hC+oUZbQJ/38tm4URdp7WoDH+lTnYxk XnFU2VtJBaVlupm4q5Ob6b/v2tAd+rlXRFMGk= MIME-Version: 1.0 Received: by 10.150.203.13 with SMTP id a13mr1511396ybg.162.1248290044096; Wed, 22 Jul 2009 12:14:04 -0700 (PDT) Date: Wed, 22 Jul 2009 12:14:04 -0700 Message-ID: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> Subject: lua modules and OO From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean After reading module v. dofile discussion I was curious how people handle OO constructs as Lua modules. I like having the module itself act as the "class" or "prototype" and use it as a constructor for an instance of that module or class. For example, to support the syntax: ----------------------------------------------- local myobject = require("myobject") local obj = myobject() ----------------------------------------------- I use the following technique in the module script ----------------------------------------------- local C = {} local M local function setconstructor(m) M = m setmetatable(M, C) end module('myobject', setconstructor) function C:__call(init) local m = setmetatable({}, M) -- init object return m end function M:method() -- some method end ----------------------------------------------- From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:20:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJKMul002098; Wed, 22 Jul 2009 16:20:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF31B18A35; Wed, 22 Jul 2009 16:19:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8496B18925 for ; Wed, 22 Jul 2009 16:19:52 -0300 (BRT) Received: by bwz17 with SMTP id 17so420770bwz.5 for ; Wed, 22 Jul 2009 12:19:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.192.10 with SMTP id u10mr638200mup.128.1248290389926; Wed, 22 Jul 2009 12:19:49 -0700 (PDT) In-Reply-To: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> Date: Wed, 22 Jul 2009 19:19:49 +0000 Message-ID: <90eb1dc70907221219i20a6817dy3fe27715cb29709c@mail.gmail.com> Subject: Re: lua modules and OO From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MJKMul002098 On Wed, Jul 22, 2009 at 7:14 PM, Wesley Smith wrote: > After reading module v. dofile discussion I was curious how people > handle OO constructs as Lua modules.  I like having the module itself > act as the "class" or "prototype" and use it as a constructor for an > instance of that module or class.  For example, to support the syntax: i do similar things too. in short, anywhere you need a table with functions, i arrange them to be callable in OO style (usually not mandatory), and a nice way to write them is to just do a module. in short, the more 'inline' syntax: { onefunc=function () .... end, otherfunc=function() ... end, ........ } is nice only for a few small (mostly trivial) functions. as soon as you're wrapping significant functionality, it's better to write a module. -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:34:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJYDNb005605; Wed, 22 Jul 2009 16:34:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6733318A97; Wed, 22 Jul 2009 16:33:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout016.mac.com (asmtpout016.mac.com [17.148.16.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C483189F6 for ; Wed, 22 Jul 2009 16:33:41 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp016.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KN700NCY7N40E90@asmtp016.mac.com> for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 12:33:37 -0700 (PDT) Message-id: <010143B3-937A-484E-8C74-9528842C4E87@mac.com> From: Petite Abeille To: Lua list In-reply-to: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> Subject: Re: lua modules and OO Date: Wed, 22 Jul 2009 21:33:04 +0200 References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 22, 2009, at 9:14 PM, Wesley Smith wrote: > After reading module v. dofile discussion I was curious how people > handle OO constructs as Lua modules. A while back, this is what I used: local LUObject = require( "LUObject" ) local super = LUObject local self = super() For example, a List object: http://dev.alt.textdrive.com/browser/lu/LUList.lua Some usage examples: http://dev.alt.textdrive.com/browser/lu/Example.lua Root object: http://dev.alt.textdrive.com/browser/lu/LUObject.lua But, after reflexion, I moved away from OO in Lua. Not worth the bother :)) Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:38:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJcmlY006722; Wed, 22 Jul 2009 16:38:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1319918FEB; Wed, 22 Jul 2009 16:38:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8B971892D for ; Wed, 22 Jul 2009 16:38:22 -0300 (BRT) Received: from [93.172.237.86] by mxout2.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KN700M1Z7VVV200@mxout2.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 22 Jul 2009 22:38:19 +0300 (IDT) Date: Wed, 22 Jul 2009 22:38:21 +0300 From: Shmuel Zeigerman Subject: Re: Support for Windows unicode paths In-reply-to: <4A673F14.3090609@workspacewhiz.com> To: Lua list Message-id: <4A676AAD.6030407@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7BIT References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: > FWIW, LuaPlus (http://luaplus.org) has wide string support. It is > probably similar to your patch, but the wide string functionality is > built into the language itself. It can even read UCS-2 .lua files. Be > sure to grab latest Subversion from > svn://svn.luaplus.org/LuaPlus/work51. Everything is #ifdef'ed. Look > for LUA_WIDESTRING and LUA_WIDESTRING_FILE. It would be great to have this functionality in Lua 5.2. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:45:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJjAe5008105; Wed, 22 Jul 2009 16:45:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6360219051; Wed, 22 Jul 2009 16:44:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1EFB1892D for ; Wed, 22 Jul 2009 16:44:32 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so112911wfa.11 for ; Wed, 22 Jul 2009 12:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qpMEd8uQow40ZcUc1siaW9DCfcnxBQPaRE2zVYOOFGo=; b=HL0d5XgLUNhOGN3QWS/rKxZivYNFPwWteex+3SX6nbOn7mh+xm3PpSt00btkxPh6ka CVewTy9uH5i5hfEm0uEUCz4HT3E89sViq/rkqB1L859LVRAHWKseuZTVmjywxQHt704O Tqp7kBhP4U2PahidD0N2zosGFqmqSWAEEeQbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iUjPXeJJ4UktlbZX7uS3jC4EltfuoS3M6fOYW/aCi7lBRc7q2nb8s107SMUpuzs0NW 6NRozDPhDuIEFk3EOXS+0GoHlDD1CrxROCXcxW1FxFRQo768DbrhideAfPLuBng0Dp5Z FME9j57diNVi0Pu19xAQulEDdWCRmvxlkD7EU= MIME-Version: 1.0 Received: by 10.220.85.8 with SMTP id m8mr1117298vcl.79.1248291868367; Wed, 22 Jul 2009 12:44:28 -0700 (PDT) In-Reply-To: <010143B3-937A-484E-8C74-9528842C4E87@mac.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> <010143B3-937A-484E-8C74-9528842C4E87@mac.com> Date: Wed, 22 Jul 2009 16:44:28 -0300 Message-ID: Subject: Re: lua modules and OO From: Lucas Hermann Negri To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I use this style: local MyClass = {} local MyCalssMT = {__index = MyClass} function MyClass.new() local self = {} -- or call the base class constructor setmetatable(self, MyClassMT) return self end ... other methods ... return MyClass This way I don't pollute' the names: local MyClass = require("MyClass") local obj = MyClass.new() .... On Wed, Jul 22, 2009 at 4:33 PM, Petite Abeille wrote: > > On Jul 22, 2009, at 9:14 PM, Wesley Smith wrote: > >> After reading module v. dofile discussion I was curious how people >> handle OO constructs as Lua modules. > > A while back, this is what I used: > > local LUObject = require( "LUObject" ) > local super = LUObject > local self = super() > > For example, a List object: > > http://dev.alt.textdrive.com/browser/lu/LUList.lua > > Some usage examples: > > http://dev.alt.textdrive.com/browser/lu/Example.lua > > Root object: > > http://dev.alt.textdrive.com/browser/lu/LUObject.lua > > But, after reflexion, I moved away from OO in Lua. Not worth the bother :)) > > Cheers, > > PA. > > -- http://oproj.tuxfamily.org From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 16:57:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MJvWAX011002; Wed, 22 Jul 2009 16:57:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 445B61888F; Wed, 22 Jul 2009 16:57:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC500187E6 for ; Wed, 22 Jul 2009 16:57:05 -0300 (BRT) Received: by fxm25 with SMTP id 25so444947fxm.5 for ; Wed, 22 Jul 2009 12:57:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.167.14 with SMTP id u14mr677096muo.81.1248292623203; Wed, 22 Jul 2009 12:57:03 -0700 (PDT) In-Reply-To: <010143B3-937A-484E-8C74-9528842C4E87@mac.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> <010143B3-937A-484E-8C74-9528842C4E87@mac.com> Date: Wed, 22 Jul 2009 19:57:03 +0000 Message-ID: <90eb1dc70907221257u4e28343eubf0b874573e7c7d4@mail.gmail.com> Subject: Re: lua modules and OO From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 7:33 PM, Petite Abeille wrote: > But, after reflexion, I moved away from OO in Lua. Not worth the bother :)) Amen! but OOP has it's place. in fact, both encapsulation and polymorphism are easy, natural and often helpful in Lua. inheritance, on the other hand.... -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:20:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKKGvr018950; Wed, 22 Jul 2009 17:20:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBDA118A97; Wed, 22 Jul 2009 17:19:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9492187A1 for ; Wed, 22 Jul 2009 17:19:42 -0300 (BRT) Received: from papaya.tek (dslb-088-072-012-106.pools.arcor-ip.net [88.72.12.106]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id 3DD9E4A084 for ; Wed, 22 Jul 2009 22:19:39 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id 5AF86175E4 for ; Wed, 22 Jul 2009 22:19:38 +0200 (CEST) Date: Wed, 22 Jul 2009 22:19:37 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: lua modules and OO Message-Id: <20090722221937.ef5b4f60.tmueller@schulze-mueller.de> In-Reply-To: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 22 Jul 2009 12:14:04 -0700 Wesley Smith wrote: > After reading module v. dofile discussion I was curious how people > handle OO constructs as Lua modules. I like having the module itself > act as the "class" or "prototype" and use it as a constructor for an > instance of that module or class. I use the second argument to the module function to specify the superclass from which the class in a module is to be derived: local polygon = require "polygon" module("rectangle", polygon) I don't know if somebody else came up with this idea, but I find this rather nifty. At first I thought inheritance in Lua had to be confusing and impracticable for large projects, but with this approach it all became clearly organized and sober. (My base class also bails out with an error message when uninitialized ('nil') members in a class are read or written to - this also improved OO a lot for me. In Lua you can fabricate tools that really suit your needs.) - Timm -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:20:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKKmb4019145; Wed, 22 Jul 2009 17:20:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B24DA18CA2; Wed, 22 Jul 2009 17:20:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f197.google.com (mail-yx0-f197.google.com [209.85.210.197]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E512D18B51 for ; Wed, 22 Jul 2009 17:20:12 -0300 (BRT) Received: by yxe35 with SMTP id 35so740482yxe.33 for ; Wed, 22 Jul 2009 13:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MATOXh9+Cw4jGWyMEt5/DDgeXZvBx1qK5uqTlUBPeu4=; b=QNI49mubX4G2xBwdNZlLWc3CTyWTwQSzccok/uuPb7eWWYQKj2TfmALY/zXQc+Hgeo UbEz3GVIoCq+aU4RCsLdy17tYshe9Goxm9+WSKMORSjSI3xEiy/vxpmvBtWUehdW3djf XnDLZRsxXeqMzZS7cQKfew9zWt8pz7Bgc4yDc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kSP8jMkyqqo/WQRqpshl0hukJ8FDP10ixu04TEm7xjl645aVRRFCCDtGPsWiXVD1Iv JNOEIhYCTddCLginqd+hxpddskSvxyqEAtZ92LzPYZXWttFdMJhx/f1VZBhcqY8yqvsT NgA6tEXVMoTKqc/iVVMD4KS+8fvyaZAXG/ByM= MIME-Version: 1.0 Received: by 10.151.153.13 with SMTP id f13mr1567405ybo.152.1248294011184; Wed, 22 Jul 2009 13:20:11 -0700 (PDT) In-Reply-To: <90eb1dc70907221257u4e28343eubf0b874573e7c7d4@mail.gmail.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> <010143B3-937A-484E-8C74-9528842C4E87@mac.com> <90eb1dc70907221257u4e28343eubf0b874573e7c7d4@mail.gmail.com> Date: Wed, 22 Jul 2009 13:20:11 -0700 Message-ID: <1079b050907221320h3cfc41cwca9fdb97572048b4@mail.gmail.com> Subject: Re: lua modules and OO From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MKKmb4019145 > but OOP has it's place.  in fact, both encapsulation and polymorphism > are easy, natural and often helpful in Lua.  inheritance, on the other > hand.... Indeed. I never do anything with inheritance in Lua, but having objects is certainly useful to maintain state across a set of functions. wes From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:29:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKTq4N021305; Wed, 22 Jul 2009 17:29:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09B6118B51; Wed, 22 Jul 2009 17:29:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35A4618883 for ; Wed, 22 Jul 2009 17:29:25 -0300 (BRT) Received: by fxm25 with SMTP id 25so462639fxm.5 for ; Wed, 22 Jul 2009 13:29:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.70.196 with SMTP id e4mr1217919bkj.65.1248294564264; Wed, 22 Jul 2009 13:29:24 -0700 (PDT) Date: Wed, 22 Jul 2009 23:29:24 +0300 X-Google-Sender-Auth: ef1f967c0d2b895f Message-ID: Subject: tables holding nil From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Just found out that the __index metamethod is called for x=a[nil], but __newindex is not called for a[nil]=x -- instead the operation is specifically forbidden. I'd rather have it called too and not throw an error. What am I missing? From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:31:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKVKcO021659; Wed, 22 Jul 2009 17:31:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92A7419051; Wed, 22 Jul 2009 17:31:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E5B718883 for ; Wed, 22 Jul 2009 17:30:55 -0300 (BRT) Received: by bwz17 with SMTP id 17so460345bwz.5 for ; Wed, 22 Jul 2009 13:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=wnA73fTZ3NDP6ZWeIBSHJUCIyHR/PBeH0HrhFQ/C1MA=; b=TOS/hMCzgIxcR8SPNFFlrRPo4puagK7QiAPrGD8rFftvWY9gVgxYVRcYa3IPZRvmUf 7aoT3YgJIX7GNJMpaasKnwaFnimiHYtTG0TXdlE33fsgaF4grBoZk8DFND7Rt9qgNSNW KYaAOB2DPwCOyHkCVb/WIZjzInpxbGxtuAj6U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=WCNoI2s3NKwf1TKdczd3DlB3Yq2SnrWIZjAZ3gQFacUdkaETFiux4YgSp00s+jYlKr spFfbc9dRo1vda0non31iNlzP1+VfSkoqncqJ8Ccs6mXq3RMHO8qg9Z+/sYQWicgc8j2 zj25IZqPxJzGU2DOZ9nC6Sy5Md/K1VDCag8jc= MIME-Version: 1.0 Received: by 10.223.121.6 with SMTP id f6mr746522far.77.1248294652099; Wed, 22 Jul 2009 13:30:52 -0700 (PDT) In-Reply-To: References: From: Jim Whitehead II Date: Wed, 22 Jul 2009 21:30:32 +0100 Message-ID: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> Subject: Re: tables holding nil To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 9:29 PM, Cosmin Apreutesei wrote: > Hi, > > Just found out that the __index metamethod is called for x=a[nil], but > __newindex is not called for a[nil]=x -- instead the operation is > specifically forbidden. I'd rather have it called too and not throw an > error. What am I missing? nil is not a valid table key. That's all! - Jim From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:35:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKZP3i022605; Wed, 22 Jul 2009 17:35:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56DA21909A; Wed, 22 Jul 2009 17:35:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AF6218883 for ; Wed, 22 Jul 2009 17:34:57 -0300 (BRT) Received: by bwz17 with SMTP id 17so462693bwz.5 for ; Wed, 22 Jul 2009 13:34:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.102.14 with SMTP id e14mr1182670bko.209.1248294894045; Wed, 22 Jul 2009 13:34:54 -0700 (PDT) In-Reply-To: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> Date: Wed, 22 Jul 2009 23:34:54 +0300 X-Google-Sender-Auth: 4c6856b4dbcd6315 Message-ID: Subject: Re: tables holding nil From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MKZP3i022605 >> Just found out that the __index metamethod is called for x=a[nil], but >> __newindex is not called for a[nil]=x -- instead the operation is >> specifically forbidden. I'd rather have it called too and not throw an >> error. What am I missing? > > nil is not a valid table key.  That's all! Then shouldn't access to a[nil] be forbidden too? Not that I'd like it any better. What's the logic behind this limitation though? From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:36:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKacFj022923; Wed, 22 Jul 2009 17:36:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7A3A190F9; Wed, 22 Jul 2009 17:36:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E13818883 for ; Wed, 22 Jul 2009 17:36:13 -0300 (BRT) Received: by ewy26 with SMTP id 26so529148ewy.5 for ; Wed, 22 Jul 2009 13:36:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.22.78 with SMTP id s56mr367441wes.100.1248294969906; Wed, 22 Jul 2009 13:36:09 -0700 (PDT) In-Reply-To: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> Date: Wed, 22 Jul 2009 21:36:09 +0100 X-Google-Sender-Auth: cb31e9ecc2931fa2 Message-ID: Subject: Re: tables holding nil From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MKacFj022923 On Wed, Jul 22, 2009 at 9:30 PM, Jim Whitehead II wrote: > nil is not a valid table key.  That's all! > Indeed, nil is not a valid table key, but metatables are intended for non-standard cases, so allowing __newindex to handle the case of key == nil would seem to be within the Lua philosophy. The manual's psuedo-code for __newindex would also not give the impression of nil being filtered out. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 17:39:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MKdCOX023496; Wed, 22 Jul 2009 17:39:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E3A519180; Wed, 22 Jul 2009 17:38:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAD4B19049 for ; Wed, 22 Jul 2009 17:38:40 -0300 (BRT) Received: by fxm25 with SMTP id 25so467614fxm.5 for ; Wed, 22 Jul 2009 13:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=J42k2CpBWshNRd67PPsI9p+9bxwjw87vibIytEdTzYY=; b=tIM6H0NbjkZUbty8m0dqqOjle9t6H4H+5c+z1na219N4FvHiRfIjtdUTSIAK6BPay/ Qmx9IknVW1P5cKr+ey3IO5zvlVNY2IRJ2XL7nu/xo0Z5YRJBPWzUtwO5MW65GahCEy3n 6jNUZIcPsUFZubGsp3ldsRf96nDV6Kl0zzsk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Mkev18TDow3xeghrQmgS/1nzz4TPT+e2UpNygUevBRM+tIkG1+yPv16bDSSyzdQxGE aqjrFj9y9WiNjr7ObvC9nXKbIycEMn31E/r3xO2CEmDUU05i68FgxO+QOhPBv2nYldZt vwmQ5LxeaH92/xZslyOTzWq5bVXiguhNZNGlY= MIME-Version: 1.0 Received: by 10.223.116.203 with SMTP id n11mr773019faq.13.1248295118074; Wed, 22 Jul 2009 13:38:38 -0700 (PDT) In-Reply-To: References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> From: Jim Whitehead II Date: Wed, 22 Jul 2009 21:38:18 +0100 Message-ID: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> Subject: Re: tables holding nil To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6MKdCOX023496 On Wed, Jul 22, 2009 at 9:36 PM, Peter Cawley wrote: > On Wed, Jul 22, 2009 at 9:30 PM, Jim Whitehead II wrote: >> nil is not a valid table key.  That's all! >> > > Indeed, nil is not a valid table key, but metatables are intended for > non-standard cases, so allowing __newindex to handle the case of key > == nil would seem to be within the Lua philosophy. The manual's > psuedo-code for __newindex would also not give the impression of nil > being filtered out. Completely right, forgive my hasty response. I actually misread the OP and misunderstood what was being asked. It is pretty interesting that access tbl[nil] is allowed, while setting it is not. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 18:15:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLFmoE030630; Wed, 22 Jul 2009 18:15:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF78C18E65; Wed, 22 Jul 2009 18:15:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C30F18D02 for ; Wed, 22 Jul 2009 18:15:07 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLF3VW030495 for ; Wed, 22 Jul 2009 18:15:03 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6MLF2J23953; Wed, 22 Jul 2009 18:15:02 -0300 Date: Wed, 22 Jul 2009 18:15:01 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tables holding nil Message-ID: <20090722181501.A23850@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com>; from jnwhiteh@gmail.com on Wed, Jul 22, 2009 at 09:38:18PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > It is pretty interesting that access tbl[nil] is allowed, > while setting it is not. Access to tbl[nil] must be allowed: otherwise "print(xxx)" would give an error, not nil. That's the whole point of nil being the default value of global variables and absent table entries (which are the same thing). Setting tbl[nil] is a different matter because it probably comes from a programmer error. On the other hand, a case can be made for allowing it and then return that value when accessing tbl[nil]. So the default behavior would correspond to tbl[nil]=nil. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 18:18:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLHuMq031148; Wed, 22 Jul 2009 18:18:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1626118EF2; Wed, 22 Jul 2009 18:17:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C58018E5E for ; Wed, 22 Jul 2009 18:17:24 -0300 (BRT) Received: by bwz17 with SMTP id 17so485136bwz.5 for ; Wed, 22 Jul 2009 14:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=7upElf68wneGpAKDcF58VM1xBEZbK3OHDI860bZn7Co=; b=uX97t0CBWm0jVRlNglL0UVyp7P0U9fiiO7EQ5a3BrstnaADfer5AUKKgu63xOChQUR WlX+D5CUkqbbyCxrijthv4ZG/pWAORXY6gLBS9mHYI9GgsNLKpGUy/D525TEMtkgSRfB MqlAE1+OgFbQf2h73EhEgI+lTpHTcdo9oL6jw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=VkwVqlkK7SafVwBvtea++Fe1xFrh4n3eNeUpx+CxzfL0Xn652fgc0TORDnDorMLFh/ gr6HC8MR0sB9n9Bf8GzYeFe2lPZKxbSHf7U2QJyIrcKsMolajL0EylbM5qXVbCZG5NCg Jk+5X+IuZ2bWRFgfgmU0wQqna3Sf/VhjhC10c= MIME-Version: 1.0 Received: by 10.223.105.9 with SMTP id r9mr786083fao.66.1248297443168; Wed, 22 Jul 2009 14:17:23 -0700 (PDT) In-Reply-To: <20090722181501.A23850@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> From: Jim Whitehead II Date: Wed, 22 Jul 2009 22:17:03 +0100 Message-ID: <5fe281d40907221417u53a9b7a7ie15aae59f55b7044@mail.gmail.com> Subject: Re: tables holding nil To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 10:15 PM, Luiz Henrique de Figueiredo wrote: >> It is pretty interesting that access tbl[nil] is allowed, >> while setting it is not. > > Access to tbl[nil] must be allowed: otherwise "print(xxx)" would give an > error, not nil. That's the whole point of nil being the default value of > global variables and absent table entries (which are the same thing). > > Setting tbl[nil] is a different matter because it probably comes from > a programmer error. On the other hand, a case can be made for allowing > it and then return that value when accessing tbl[nil]. So the default > behavior would correspond to tbl[nil]=nil. Thanks for the clarification, that makes perfect sense. - Jim From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 18:19:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLJUYY031759; Wed, 22 Jul 2009 18:19:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C659D19024; Wed, 22 Jul 2009 18:19:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA04.westchester.pa.mail.comcast.net (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEB8B18D78 for ; Wed, 22 Jul 2009 18:18:59 -0300 (BRT) Received: from OMTA12.westchester.pa.mail.comcast.net ([76.96.62.44]) by QMTA04.westchester.pa.mail.comcast.net with comcast id JyGA1c0050xGWP8549JyDM; Wed, 22 Jul 2009 21:18:58 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA12.westchester.pa.mail.comcast.net with comcast id K9Jx1c00524UxC23Y9Jyrv; Wed, 22 Jul 2009 21:18:58 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id 33224372AF; Wed, 22 Jul 2009 17:18:56 -0400 (EDT) Date: Wed, 22 Jul 2009 17:18:55 -0400 From: Etan Reisner To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090722211855.GY1849@aran> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A66DDB5.4050604@cowlark.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 10:36:53AM +0100, David Given wrote: > (Sigh. Obviously, someone just forgot to relicense libpurple after it got > split off from the Pidgin core. Unfortunately, it's now probably too late > to fix...) Unfortunately it was always too late, the number of people who have contributed code to libpurple (and who still "own" the code they contributed) is much too vast to have even contemplated contacting them to negotiate a license change. Despite our (the pidgin developers) willingness to relicense. -Etan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 18:20:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLKn0f032282; Wed, 22 Jul 2009 18:20:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 620C8190AC; Wed, 22 Jul 2009 18:20:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AEFF18D78 for ; Wed, 22 Jul 2009 18:20:02 -0300 (BRT) Received: by ewy26 with SMTP id 26so557863ewy.5 for ; Wed, 22 Jul 2009 14:20:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.52.78 with SMTP id d56mr368439wec.143.1248297600923; Wed, 22 Jul 2009 14:20:00 -0700 (PDT) In-Reply-To: <20090722181501.A23850@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Date: Wed, 22 Jul 2009 22:20:00 +0100 X-Google-Sender-Auth: a2063ad19bdc1378 Message-ID: Subject: Re: tables holding nil From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 10:15 PM, Luiz Henrique de Figueiredo wrote: > On the other hand, a case can be made for allowing > it and then return that value when accessing tbl[nil]. > If nil is allowed as a table key, then next() would have to use some other value for the beginning and end of a table. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 18:24:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MLOnVC000409; Wed, 22 Jul 2009 18:24:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 363A2191D9; Wed, 22 Jul 2009 18:24:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA05.westchester.pa.mail.comcast.net (qmta05.westchester.pa.mail.comcast.net [76.96.62.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F31F19182 for ; Wed, 22 Jul 2009 18:24:12 -0300 (BRT) Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA05.westchester.pa.mail.comcast.net with comcast id JycJ1c0010EZKEL559QBpY; Wed, 22 Jul 2009 21:24:11 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA01.westchester.pa.mail.comcast.net with comcast id K9QA1c00C24UxC23M9QA4L; Wed, 22 Jul 2009 21:24:10 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id 143A0372AF; Wed, 22 Jul 2009 17:24:08 -0400 (EDT) Date: Wed, 22 Jul 2009 17:24:08 -0400 From: Etan Reisner To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090722212408.GZ1849@aran> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 11:10:57AM +0100, Ashish Shrestha wrote: > Ideally, I would love to write a lua wrapper for libpurple, but > neither my C nor my Lua knowledge is up for it. > > Thanks again for melissa. > > Ashish I would be more than happy to help work on a lua wrapper for libpurple, however that is currently a far from trivial task. I had started work on a lua plugin loader for libpurple though a while back (before the libpurple name change) but ran out of spare time for it and it has since sat and bit-rot. At this point I don't like the idea I had for how to handle it anyway, so I would want to start again on a new one were I to have time to pick it up again. There is currently SoC and associated work under way to GObject-ify many of the core objects in libpurple, when this work finally lands in libpurple a lua binding will likely be much easier to accomplish (using the same set of tools used for the lgob bindings). -Etan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 19:06:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MM6gt9007385; Wed, 22 Jul 2009 19:06:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C86C19076; Wed, 22 Jul 2009 19:06:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 047D718C6A for ; Wed, 22 Jul 2009 19:06:05 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MM647G007228 for ; Wed, 22 Jul 2009 19:06:04 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6MM61o24079; Wed, 22 Jul 2009 19:06:01 -0300 Date: Wed, 22 Jul 2009 19:06:01 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tables holding nil Message-ID: <20090722190600.A24047@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from lua@corsix.org on Wed, Jul 22, 2009 at 10:20:00PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > If nil is allowed as a table key, then next() would have to use some > other value for the beginning and end of a table. Yes, and there are possibly other implications. I never suggested that nil be allowed as a table key. I think one way would be to store the default value in a special place in the table, outside the hash. But then people would complain that nil was never traversed by next, etc. Bottom line, I don't think this is going to change in future versions of Lua... From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 19:09:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MM9a6x007989; Wed, 22 Jul 2009 19:09:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0224191D0; Wed, 22 Jul 2009 19:09:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94CD519049 for ; Wed, 22 Jul 2009 19:09:03 -0300 (BRT) Received: by fxm25 with SMTP id 25so512327fxm.5 for ; Wed, 22 Jul 2009 15:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iUIe2PHstkKi2bMO9F3sPKZD/xjkgKuZK2DBqZwGK5o=; b=duhmGow2B6dxDhwi1m31riH2QWzqOFVLVmUQZh4y0bpeVlhc+2681KE7EDp1mGjmjg qUSw/neuOqKnJlT2NS4pEf8w4bj6aUDCW76GdQPPGrpUdcW6A9o25I2TYDYJtbmxN+rb 2vK+5Oc7QDcf+D69X+Igf0yR08r376egbEH3A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=GcoPsca3x6AbRxuKkyIHbE/3vFBGzQCwe6VJoGtMSSRolWQ6Yu4s7vNIsRVoVlH0FY PSTla069D9/lWLC9p7mu4MZVa1/uMffmf6HwTcYyc3XLRNSx+zzgtbpqg40rYbv6VOOP YzvNYwnMrAGmulrEHPBJqS+OxtC95XooOtwPM= MIME-Version: 1.0 Received: by 10.239.180.206 with SMTP id j14mr135621hbg.27.1248300540660; Wed, 22 Jul 2009 15:09:00 -0700 (PDT) In-Reply-To: <20090722212408.GZ1849@aran> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> Date: Wed, 22 Jul 2009 23:09:00 +0100 Message-ID: <379686bd0907221509t1cf93a4ek46b33549c10f175e@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 10:24 PM, Etan Reisner wrote: > There is currently SoC and associated work under way to GObject-ify many > of the core objects in libpurple, when this work finally lands in > libpurple a lua binding will likely be much easier to accomplish (using > the same set of tools used for the lgob bindings). I am trying to refresh my C and plan to learn glib. Had a quick look at lgob. I understand glib and GObject is part of GTK but do not include the widgets themselves. Ideally would like to have a wrapper around libpurple without having to depend on any X or rest of GTK for running on servers in a headless environment. The current code is something I hacked onto melissa to get a usable (for me) bot. I still have a lot to learn. Lua, C, glib, GObject, libpurple and now lgob. Any pointers on how to proceed is welcome. Etan, thank you for information about lgob. Ashish From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 19:17:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MMHKh8009317; Wed, 22 Jul 2009 19:17:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 231181920D; Wed, 22 Jul 2009 19:16:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [76.96.62.96]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60973191B7 for ; Wed, 22 Jul 2009 19:16:49 -0300 (BRT) Received: from OMTA21.westchester.pa.mail.comcast.net ([76.96.62.72]) by QMTA09.westchester.pa.mail.comcast.net with comcast id Jzr31c00D1ZXKqc59AGm75; Wed, 22 Jul 2009 22:16:46 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA21.westchester.pa.mail.comcast.net with comcast id KAJn1c00V24UxC23hAJoxY; Wed, 22 Jul 2009 22:18:50 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id 1A0C7372AF; Wed, 22 Jul 2009 18:16:42 -0400 (EDT) Date: Wed, 22 Jul 2009 18:16:41 -0400 From: Etan Reisner To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090722221641.GA1849@aran> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <379686bd0907221509t1cf93a4ek46b33549c10f175e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <379686bd0907221509t1cf93a4ek46b33549c10f175e@mail.gmail.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 22, 2009 at 11:09:00PM +0100, Ashish Shrestha wrote: > I am trying to refresh my C and plan to learn glib. Had a quick look > at lgob. I understand glib and GObject is part of GTK but do not > include the widgets themselves. Ideally would like to have a wrapper > around libpurple without having to depend on any X or rest of GTK for > running on servers in a headless environment. GObject is the core object system used by GLib and GTK+. GLib is a set of core libraries for use by applications (things like hash tables, main loops, file parsers, etc). GTK+ is a widget toolkit (which uses GLib). libpurple depends on GLib not GTK+ and as such has no dependency on X (which is why the console libpurple client finch can exist). > Ashish I'd be more than happy to continue any discussions in this direction but they should probably take place somewhere other than lua-l. -Etan From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 20:25:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MNPlNr017859; Wed, 22 Jul 2009 20:25:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 436C918A57; Wed, 22 Jul 2009 20:25:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F14661886D for ; Wed, 22 Jul 2009 20:25:14 -0300 (BRT) Received: by bwz17 with SMTP id 17so537281bwz.5 for ; Wed, 22 Jul 2009 16:25:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.64.67 with SMTP id d3mr1367586bki.142.1248305112371; Wed, 22 Jul 2009 16:25:12 -0700 (PDT) In-Reply-To: References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 02:25:12 +0300 Message-ID: Subject: Re: tables holding nil From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > If nil is allowed as a table key, then next() would have to use some > other value for the beginning and end of a table. Actually, I never liked the fact that nil is used to signal the end of an iteration. Whenever I build an iterator that might return nil elements, I have to put a pseudo-index as the first return value of the iterator as a workaround. From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 20:40:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6MNe9De019387; Wed, 22 Jul 2009 20:40:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B870218CF4; Wed, 22 Jul 2009 20:39:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C94818B72 for ; Wed, 22 Jul 2009 20:39:43 -0300 (BRT) Received: by bwz17 with SMTP id 17so541808bwz.5 for ; Wed, 22 Jul 2009 16:39:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.50.195 with SMTP id a3mr1370199bkg.123.1248305981587; Wed, 22 Jul 2009 16:39:41 -0700 (PDT) In-Reply-To: <20090722181501.A23850@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 02:39:41 +0300 X-Google-Sender-Auth: 403b7a2d9f0e30b1 Message-ID: Subject: Re: tables holding nil From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 00:15, Luiz Henrique de Figueiredo wrote: >> It is pretty interesting that access tbl[nil] is allowed, >> while setting it is not. > > Access to tbl[nil] must be allowed: otherwise "print(xxx)" would give an > error, not nil. That's the whole point of nil being the default value of > global variables and absent table entries (which are the same thing). Sorry, I must be dumber than usual today, cuz I don't get it. I thought print(xxx) tries getfenv(1)['xxx'], and not getfenv(1)[nil]. Same for nil being the default value for globals (which are always string keys since they have to be valid identifiers). From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 23:47:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N2ls96005639; Wed, 22 Jul 2009 23:47:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B0FB18BFD; Wed, 22 Jul 2009 23:47:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31CF018858 for ; Wed, 22 Jul 2009 23:47:23 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N2lLUS005596 for ; Wed, 22 Jul 2009 23:47:21 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6N2lLv24567; Wed, 22 Jul 2009 23:47:21 -0300 Date: Wed, 22 Jul 2009 23:47:20 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tables holding nil Message-ID: <20090722234720.A24559@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from cosmin.apreutesei@gmail.com on Thu, Jul 23, 2009 at 02:39:41AM +0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I thought print(xxx) tries getfenv(1)['xxx'], and not getfenv(1)[nil]. Yes, pretty much. But my point was: do you want print(xxx) to abort with an error? From lua-bounces@bazar2.conectiva.com.br Wed Jul 22 23:48:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N2mQcR005726; Wed, 22 Jul 2009 23:48:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A11C18C6A; Wed, 22 Jul 2009 23:48:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAF7618C30 for ; Wed, 22 Jul 2009 23:47:58 -0300 (BRT) Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n6N2lpN1000825; Thu, 23 Jul 2009 11:47:51 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay31.aps.necel.com with ESMTP; Thu, 23 Jul 2009 11:47:51 +0900 Received: from dhlpc061 ([10.114.113.45] [10.114.113.45]) by relay31.aps.necel.com with ESMTP; Thu, 23 Jul 2009 11:47:51 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id BCC6752E22B; Thu, 23 Jul 2009 11:47:50 +0900 (JST) From: Miles Bader To: Shmuel Zeigerman Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Thu, 23 Jul 2009 11:47:50 +0900 In-Reply-To: <4A676AAD.6030407@013net.net> (Shmuel Zeigerman's message of "Wed, 22 Jul 2009 22:38:21 +0300") Message-ID: Lines: 13 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman writes: >> FWIW, LuaPlus (http://luaplus.org) has wide string support. > > It would be great to have this functionality in Lua 5.2. Why? Lua shouldn't be infected with this crap. -miles -- Helpmate, n. A wife, or bitter half. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 00:04:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N34Xjb007394; Thu, 23 Jul 2009 00:04:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F5F618C43; Thu, 23 Jul 2009 00:04:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FF6418B39 for ; Thu, 23 Jul 2009 00:04:06 -0300 (BRT) Received: (qmail 13485 invoked by uid 399); 22 Jul 2009 21:04:00 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 22 Jul 2009 21:04:00 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4A67D31D.2010506@workspacewhiz.com> Date: Wed, 22 Jul 2009 21:03:57 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030901040508020008000903" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------030901040508020008000903 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: Miles Bader Date: 7/22/2009 8:47 PM > Shmuel Zeigerman writes: > >>> FWIW, LuaPlus (http://luaplus.org) has wide string support. >>> >> It would be great to have this functionality in Lua 5.2. >> > Why? Lua shouldn't be infected with this crap. > LuaPlus's wide string support has, among other things, been used to ship a number of commercial console games (Xbox and others) to in Far Eastern languages. So should Lua be infected with this world-wide language enabling "crap"? That's not my call. Unicode is far more than just 16-bit characters, but having those 16-bit characters was sufficient to ship properly localized string tables. FWIW, I just simply leave the #defines off the majority of the time. Josh --------------030901040508020008000903 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: Miles Bader
Date: 7/22/2009 8:47 PM
Shmuel Zeigerman <shmuz@013net.net> writes:
  
FWIW, LuaPlus (http://luaplus.org) has wide string support.
      
It would be great to have this functionality in Lua 5.2.
    
Why?  Lua shouldn't be infected with this crap.
  
LuaPlus's wide string support has, among other things, been used to ship a number of commercial console games (Xbox and others) to in Far Eastern languages.

So should Lua be infected with this world-wide language enabling "crap"?  That's not my call.  Unicode is far more than just 16-bit characters, but having those 16-bit characters was sufficient to ship properly localized string tables.

FWIW, I just simply leave the #defines off the majority of the time.

Josh
--------------030901040508020008000903-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 04:13:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N7DQve030805; Thu, 23 Jul 2009 04:13:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93EAA18C5A; Thu, 23 Jul 2009 04:13:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2689A18A5A for ; Thu, 23 Jul 2009 04:12:52 -0300 (BRT) Received: from [93.173.199.46] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KN8009E641B4L10@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 10:12:48 +0300 (IDT) Date: Thu, 23 Jul 2009 10:12:50 +0300 From: Shmuel Zeigerman Subject: Re: Support for Windows unicode paths In-reply-to: <4A67D31D.2010506@workspacewhiz.com> To: Lua list Message-id: <4A680D72.4020103@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: > LuaPlus's wide string support has, among other things, been used to ship > a number of commercial console games (Xbox and others) to in Far Eastern > languages. > > So should Lua be infected with this world-wide language enabling > "crap"? That's not my call. Unicode is far more than just 16-bit > characters, but having those 16-bit characters was sufficient to ship > properly localized string tables. > > FWIW, I just simply leave the #defines off the majority of the time. Here's an example of why I'd like to have Unicode support in Lua. I'm maintaining a library ("LuaFAR") that allows writing plugins for FAR (www.farmanager.com) in Lua. Since couple years ago, FAR has become a Unicode application. This caused plugin writers to modify their plugins to support Unicode too. That probably was not an easy task but still quite feasible for those writing plugins in C/C++, Pascal and PowerShell. It seems that to do so with Lua, both LuaFAR *and* Lua itself have to support Unicode. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 05:26:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N8QGC4004146; Thu, 23 Jul 2009 05:26:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F97A1A663; Thu, 23 Jul 2009 05:25:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB0351A65F for ; Thu, 23 Jul 2009 05:25:40 -0300 (BRT) Received: by fxm25 with SMTP id 25so700753fxm.5 for ; Thu, 23 Jul 2009 01:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iayoilykuFzLuUHzlxJ0ZLSBL6jjH3HSHqbcqm8omnk=; b=Y5B6IeqjIX6IIWvZVUWNdK1AcHDbKmrDS/WRWObk5JK1ZFN7sC1NFZK0WcI+4Y/k3q s4FwCsQnEAk1tTLQYP6TQGPqm4g2IyUJffhIXslysH+m6E1mjRQ8PiW0i/a1YjgGaZ+y qspAk1T1t6ZcxFHV9pXxM7FgAP4Vn4WnVYyDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=prZZt8IqrFJJtvAHub9rpAqK2BnC7YxR4h+8Ts6hD+Z7FY19JqXIipHMJPhjHWqEGF bHj8SBDMpZebI0JWmiHvmJ5aMeTxi40esMBY8w7zSlMVSgA/be46IaGsmemQlvuU50JA DUfj4hGLU9ynl1Qr5afgUBsdjUbBBcHBmOObI= MIME-Version: 1.0 Received: by 10.239.135.129 with SMTP id d1mr196297hbd.137.1248337539222; Thu, 23 Jul 2009 01:25:39 -0700 (PDT) In-Reply-To: <1079b050907221320h3cfc41cwca9fdb97572048b4@mail.gmail.com> References: <1079b050907221214u53dc60fy2eb0a793addf6190@mail.gmail.com> <010143B3-937A-484E-8C74-9528842C4E87@mac.com> <90eb1dc70907221257u4e28343eubf0b874573e7c7d4@mail.gmail.com> <1079b050907221320h3cfc41cwca9fdb97572048b4@mail.gmail.com> Date: Thu, 23 Jul 2009 10:25:39 +0200 Message-ID: <560972290907230125k37c1db84q13934ea631654208@mail.gmail.com> Subject: Re: lua modules and OO From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6N8QGC4004146 On Wed, Jul 22, 2009 at 10:20 PM, Wesley Smith wrote: >> but OOP has it's place.  in fact, both encapsulation and polymorphism >> are easy, natural and often helpful in Lua.  inheritance, on the other >> hand.... > > Indeed.  I never do anything with inheritance in Lua, but having > objects is certainly useful to maintain state across a set of > functions. Once again the flexibility of the language can bite us. I've often wondered if the situation could have been helped if there was a few 'blessed' pure Lua libraries that came with the basic distribution - currently there's only one, strict.lua! Two principles about OOP in Lua (a) keep it simple and reusable (b) pick a scheme, any scheme and stick to it. Of course, having closures and other means of maintaining state means that classes only become necessary at a higher level of complexity. In this discussion (http://lambda-the-ultimate.org/node/3517), basically a cry for Simplicity, Lua is mentioned but the questioner also talks about Perl, which encourages the same ad hoc approach: [[ Curiously enough in the days when I did Perl I found it trivial to spin endlessly complex datastructures out of arrays and hashes.... ...but then found I couldn't maintain them. In ruby I've learned as soon as I start doing that to make (another) class. Much more maintainable. ]] What one can get away with in a script ain't necessarily good for Big Programs... The class 'library' I use involves a single function and 'fat metatable' single inheritance. http://lua-users.org/wiki/SimpleLuaClasses steve d. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 06:26:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6N9QS03008975; Thu, 23 Jul 2009 06:26:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B2EE18814; Thu, 23 Jul 2009 06:26:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5659187E6 for ; Thu, 23 Jul 2009 06:25:55 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As0BABDJZ0p8qReJ/2dsb2JhbAAI0HiEDQWBPw X-IronPort-AV: E=Sophos;i="4.43,253,1246809600"; d="scan'208";a="541510502" Received: from unknown (HELO [10.1.1.2]) ([124.169.23.137]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 23 Jul 2009 17:25:50 +0800 Message-Id: From: Jacques Chester To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Luacrypto does not seem to successfully install on two platforms. Date: Thu, 23 Jul 2009 17:25:49 +0800 References: <2A7AB6FD-D246-401B-8476-D263772D34B1@chester.id.au> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 22/07/2009, at 12:47 AM, Petite Abeille wrote: > FWIW, here is an HMAC-SHA1 implementation: > > http://dev.alt.textdrive.com/browser/HTTP/HMAC.lua Thanks for this link -- I'm also using this for a Lua library I'm writing to talk to Amazon SQS. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 07:10:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAAFqV012352; Thu, 23 Jul 2009 07:10:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA6B018A57; Thu, 23 Jul 2009 07:09:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B910418687 for ; Thu, 23 Jul 2009 07:09:41 -0300 (BRT) Received: by bwz17 with SMTP id 17so749503bwz.5 for ; Thu, 23 Jul 2009 03:09:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.62.68 with SMTP id w4mr1895436bkh.93.1248343389097; Thu, 23 Jul 2009 03:03:09 -0700 (PDT) In-Reply-To: <20090722234720.A24559@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 13:03:09 +0300 X-Google-Sender-Auth: 3b21dcb3856a4675 Message-ID: Subject: Re: tables holding nil From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> I thought print(xxx) tries getfenv(1)['xxx'], and not getfenv(1)[nil]. > > Yes, pretty much. But my point was: do you want print(xxx) to abort with > an error? No, but I don't understand how it could. I mean how would tbl[nil] throwing an error affect print(xxx)? Does print(xxx) access the nil key of any table? I thought it just tries the 'xxx' key of getfenv(). Maybe you meant print(t[xxx])? That would indeed access the nil key of a for an undefined variable xxx. In that case, yes, it should throw and error. Allow me to restate my puzzle: Currently, metatables allows me for virtualizing the nil key, but just as a read-only key. I asked what is the logic behind this since I was expecting either: 1) __index and __newindex is not called when reading/writing the nil key --> the nil key is not a valid table key and therefore there's nothing to virtualize about. 2) __index and __newindex is called when reading/writing the nil key --> nil is virtualizable, even if it's not a valid key for real tables; breaking next() doesn't matter in this case since virtual tables would override __next() or __pairs() anyway or provide their own iterators. Now regardless of metatables, tbl[nil] not throwing an error means that nil is indeed a valid table key that just has the default value nil, just as any other key has. If so, I should be able to write any value to it. Otherwise I expect an error. Currently, for an undefined variable xxx, x=a[xxx] works but a[xxx]=x doesn't. It just seems inconsistent, that's all. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 07:20:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAKbRM013246; Thu, 23 Jul 2009 07:20:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C8D718A97; Thu, 23 Jul 2009 07:20:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C81E21888F for ; Thu, 23 Jul 2009 07:20:12 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n6NAK8Eg017292; Thu, 23 Jul 2009 19:20:08 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay21.aps.necel.com with ESMTP; Thu, 23 Jul 2009 19:20:08 +0900 Received: from dhlpc061 ([10.114.113.45] [10.114.113.45]) by relay21.aps.necel.com with ESMTP; Thu, 23 Jul 2009 19:20:08 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 73EF952E231; Thu, 23 Jul 2009 19:20:08 +0900 (JST) From: Miles Bader To: Joshua Jensen Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Thu, 23 Jul 2009 19:20:08 +0900 In-Reply-To: <4A67D31D.2010506@workspacewhiz.com> (Joshua Jensen's message of "Wed, 22 Jul 2009 21:03:57 -0600") Message-ID: Lines: 19 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen writes: >>> It would be great to have this functionality in Lua 5.2. >>> >> Why? Lua shouldn't be infected with this crap. >> > LuaPlus's wide string support has, among other things, been used to ship > a number of commercial console games (Xbox and others) to in Far Eastern > languages. One doesn't need wide strings to use unicode, utf-8 works fine. Microsoft made a bad call, and they're stuck with it, but Lua need not do so. -Miles -- History, n. An account mostly false, of events mostly unimportant, which are brought about by rulers mostly knaves, and soldiers mostly fools. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 07:25:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAPVui013606; Thu, 23 Jul 2009 07:25:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAE1718C30; Thu, 23 Jul 2009 07:25:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAA6918B38 for ; Thu, 23 Jul 2009 07:25:05 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTvTx-00057X-5B for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 11:25:01 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 2D0F96D339 for ; Thu, 23 Jul 2009 11:24:59 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:54269 with envelope Message-ID: <4A683A71.30104@cowlark.com> Date: Thu, 23 Jul 2009 11:24:49 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> In-Reply-To: <20090722212408.GZ1849@aran> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NAPVui013606 Etan Reisner wrote: [...] > I would be more than happy to help work on a lua wrapper for libpurple, > however that is currently a far from trivial task. I had started work on a > lua plugin loader for libpurple though a while back (before the libpurple > name change) but ran out of spare time for it and it has since sat and > bit-rot. At this point I don't like the idea I had for how to handle it > anyway, so I would want to start again on a new one were I to have time to > pick it up again. Ditto; I have a Gaim plugin for the Citadel IM protocol written in Lua. Citadel's protocol is so stateful that it was actually *easier* to bind Lua to Gaim and write the protocol code in a Lua coroutine than it would have been to do with a traditional state machine! (I can package up the code if anyone's interested.) [...] > There is currently SoC and associated work under way to GObject-ify many > of the core objects in libpurple, when this work finally lands in > libpurple a lua binding will likely be much easier to accomplish (using > the same set of tools used for the lgob bindings). Sounds good; this should allow dynamic creation of bindings via GObject introspection, right? -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 07:31:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAVpn8014193; Thu, 23 Jul 2009 07:31:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D644918BFD; Thu, 23 Jul 2009 07:31:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6DDC18A22 for ; Thu, 23 Jul 2009 07:31:26 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAVP3N014172 for ; Thu, 23 Jul 2009 07:31:25 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6NAVOR25983; Thu, 23 Jul 2009 07:31:24 -0300 Date: Thu, 23 Jul 2009 07:31:23 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tables holding nil Message-ID: <20090723073123.A25958@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from cosmin.apreutesei@gmail.com on Thu, Jul 23, 2009 at 01:03:09PM +0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I mean how would tbl[nil] throwing an error affect print(xxx)? Does > print(xxx) access the nil key of any table? You're right. My bad. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 07:57:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NAv9x2016396; Thu, 23 Jul 2009 07:57:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F390218B38; Thu, 23 Jul 2009 07:56:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A763B18A61 for ; Thu, 23 Jul 2009 07:56:34 -0300 (BRT) Received: by ewy26 with SMTP id 26so882116ewy.5 for ; Thu, 23 Jul 2009 03:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0lIt0MkUWFomdNTk+H0XMz9kEsho4cabgopA0nSn8Lc=; b=xO2NaHNRx9V0ybRVkdG2y013eDVg7QoR5vX0BAOwj+jj1ZipbcmvZK33YoCS9S5qx5 623FiZ23QJou1AgFtI0Djab316HdPKitO39Y3d/+Z1TwGo0En8Bofys+SFCVVBHUJnri F7n5QnqJKfdbOHHO/ix6Zke0zt4jjC1hwKGZg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eeu//79f2wt4S0nOklMj3ECYK72J9aIFwZ9SgGy1Ot81CU8lBjPLM+lZ19M8Ubgkur 7iT+U4Z2emnan5gs3VtmoShHZg7l+YUS7k9a4pVVzR7oPLfhO85XmxmRQEVbn4wwWjU0 wtBvEGm/x34fEl94oz7/dauPCDcs3RsqJRisg= MIME-Version: 1.0 Received: by 10.210.129.20 with SMTP id b20mr7872339ebd.83.1248346591169; Thu, 23 Jul 2009 03:56:31 -0700 (PDT) In-Reply-To: <20090723073123.A25958@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 12:56:31 +0200 Message-ID: <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> Subject: Re: tables holding nil From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=0015174bde141f8e83046f5d5761 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174bde141f8e83046f5d5761 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Jul 23, 2009 at 12:31 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > I mean how would tbl[nil] throwing an error affect print(xxx)? Does > > print(xxx) access the nil key of any table? > > You're right. My bad. > Interesting, I had no idea that reading of tables with keys nil and nan were allowed. Kahlua throws an error when a table key is nil or nan, both for get and set, and I don't think anyone has even noticed that different behaviour yet. Are there any use cases where allowing reading t[nil] or t[nan] is useful? I still haven't decided if I should update Kahlua to reflect this behaviour or not. --0015174bde141f8e83046f5d5761 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Jul 23, 2009 at 12:31 PM, Luiz H= enrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> I mean how would tbl[nil] throwing an error affect p= rint(xxx)? Does
> print(xxx) access the nil key of any table?

You're right. My bad.

Interesting, I had no idea that reading of tables wi= th keys nil and nan were allowed.
Kahlua throws an error when a table ke= y is nil or nan, both for get and set, and I don't think anyone has eve= n noticed that different behaviour yet.

Are there any use cases where allowing reading t[nil] or t[nan] is usef= ul?
I still haven't decided if I should update Kahlua to reflect thi= s behaviour or not.

--0015174bde141f8e83046f5d5761-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:04:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NB44a6017289; Thu, 23 Jul 2009 08:04:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D16A18C6A; Thu, 23 Jul 2009 08:03:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6C8318A61 for ; Thu, 23 Jul 2009 08:03:39 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NB3bgm017244 for ; Thu, 23 Jul 2009 08:03:38 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6NB3bj26125; Thu, 23 Jul 2009 08:03:37 -0300 Date: Thu, 23 Jul 2009 08:03:37 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tables holding nil Message-ID: <20090723080336.A26077@lua.tecgraf.puc-rio.br> References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com>; from kristofer.karlsson@gmail.com on Thu, Jul 23, 2009 at 12:56:31PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Are there any use cases where allowing reading t[nil] or t[nan] is useful? t[nil] is what happens when you do t[x] and x is nil :-) This may or not be a programmer error: you may be trying to determine whether a field given by the user exists in a table. If the user does not define the name of that field, then it's nil and you get t[nil]. Not too common an idiom, though. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:07:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NB7BlQ017659; Thu, 23 Jul 2009 08:07:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3270B18CF4; Thu, 23 Jul 2009 08:06:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD55718CA2 for ; Thu, 23 Jul 2009 08:06:48 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id n6NB6kDC010098 for ; Thu, 23 Jul 2009 13:06:46 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMfgZ0rDbohb/2dsb2JhbADQQoQNBQ Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 23 Jul 2009 13:06:46 +0200 Received: from [192.168.127.128] (host253-28-dynamic.31-79-r.retail.telecomitalia.it [79.31.28.253]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n6NB6e47046914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jul 2009 13:06:46 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4A684444.2050705@erix.it> Date: Thu, 23 Jul 2009 13:06:44 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: tables holding nil References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> In-Reply-To: <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Kristofer Karlsson wrote: > Are there any use cases where allowing reading t[nil] or t[nan] is useful? I often rely on the former to avoid checking for nil at every table access, e.g.: a = b[c[d]] Enrico From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:14:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NBElen018481; Thu, 23 Jul 2009 08:14:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B19618CD2; Thu, 23 Jul 2009 08:14:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9D2418A35 for ; Thu, 23 Jul 2009 08:14:19 -0300 (BRT) Received: by ewy26 with SMTP id 26so892034ewy.5 for ; Thu, 23 Jul 2009 04:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bunW+87iBD04FgXEsiYQoBd5FY7XqXTIRghnlppTgn8=; b=L8mTyEAhYQQqprN3epcQ6QGDncEsWdgClqzN+wakVzgcEDf61pGSjN+xxW5GC2PZKZ FOKqF+3PThBf3vQDPWMEk7l2PJssMqKqmU6hrbKd5Y0Dm/VSvjMJSLs3fJnLcLxIgkSm Yy8cXkG61ua0vESdPwunaRDut/y6e/LbGDffo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WuOOkJyhq8o/N1fyGBkAiqK+/cSTfMvbVMpBOgira2rg9+n7CkexnYB+0t9lSfdHo6 02dpDWhCYORokr0gySY3TSFnCIwaY+78B+eA6lqBjA+CahSfMZizf2xEKn+xr2MoH2zH cfvTe6UEkgfJLT2doJgP/V5tSP3OnsgV0Q5SE= MIME-Version: 1.0 Received: by 10.210.78.16 with SMTP id a16mr8014070ebb.1.1248347658514; Thu, 23 Jul 2009 04:14:18 -0700 (PDT) In-Reply-To: <20090723080336.A26077@lua.tecgraf.puc-rio.br> References: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> <20090723080336.A26077@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 13:14:18 +0200 Message-ID: <13af99c70907230414i112c7a07n946391921e193091@mail.gmail.com> Subject: Re: tables holding nil From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1eb70bdf236046f5d96e5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1eb70bdf236046f5d96e5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Jul 23, 2009 at 1:03 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > Are there any use cases where allowing reading t[nil] or t[nan] is > useful? > > t[nil] is what happens when you do t[x] and x is nil :-) > Yes, obviously :-) > > This may or not be a programmer error: you may be trying to determine > whether a field given by the user exists in a table. If the user does > not define the name of that field, then it's nil and you get t[nil]. > Not too common an idiom, though. > That may be a valid use case I suppose. How about chaining table lookups like this: heightmap = {{1,2,3},{4,5,6}} local value = heightmap[1][4] local value = heightmap[3][4] In the first case, it will return nil, since the y value is out of range. In the second case it would throw an error (tried to index nil). Couldn't the same reasoning be applied here, and change table lookups to return nil if the table itself was nil? (But throw an error when setting) This would mean that heightmap[x][y] would return nil instead of erroring, and it would give somewhat more consistency. The following is already allowed: assert(("Hello world")[123] == nil) But this is not: assert((1234)[123] == nil) assert((nil)[123] == nil) --000e0cd1eb70bdf236046f5d96e5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Jul 23, 2009 at 1:03 PM, Luiz He= nrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> Are there any use cases where allowing reading t[nil= ] or t[nan] is useful?

t[nil] is what happens when you do t[x] and x is nil :-)

Yes, obviously :-)
=A0

This may or not be a programmer error: you may be trying to determine
whether a field given by the user exists in a table. If the user does
not define the name of that field, then it's nil and you get t[nil]. Not too common an idiom, though.

That may be a valid use case I suppose.
How about= chaining table lookups like this:

heightmap =3D {{1,2,3},{4,5,6}}
local value =3D heightmap[1][4]
local value =3D heightmap[3][4]

In the first case, it will return ni= l, since the y value is out of range.
In the second case it would throw = an error (tried to index nil).

Couldn't the same reasoning be ap= plied here, and change table lookups to return nil if the table itself was = nil? (But throw an error when setting)
This would mean that heightmap[x][y] would return nil instead of erroring, = and it would give somewhat more consistency.

The following is alread= y allowed:
assert(("Hello world")[123] =3D=3D nil)

But = this is not:
assert((1234)[123] =3D=3D nil)
assert((nil)[123] =3D=3D nil)

--000e0cd1eb70bdf236046f5d96e5-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:15:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NBFL22018596; Thu, 23 Jul 2009 08:15:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7735F18D70; Thu, 23 Jul 2009 08:14:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64A6D18D18 for ; Thu, 23 Jul 2009 08:14:40 -0300 (BRT) Received: by fxm25 with SMTP id 25so786170fxm.5 for ; Thu, 23 Jul 2009 04:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=NJ/mSU08AT4ne8cRMseaJF6wkqx4WSYViVkgT4ub0dY=; b=YaE18dCdG7qDnz7Wfl77/ys3uCVlMNlezGrmZUMnuIWjql2/HpVX/DL11uF9GrFDGz yLarvbgrSBCBDdYLOMrCQf6R6qoWEuChGXy07iPVk1EDe4tfbeIpqaaoGMovrVlsJioM mIaTNaoOqCEg2Ot0vrhuFFOKQEc2JbaqgCmNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pK0tr1lEAuDbZKC3YjsfrlVMnRCkkGCSXNJy9IVraD1/pCpBhjxkX7wz5GEUXUoO9C CK18kOUHyVblEBNgREzUacF/+mkc2KrF+/OR3iCQ66wVSzLf460XBAkdGiMQHVyGkoY9 6h/zN7VrMDTx4C+ng/3l0vUGrLeY9rzWpqMeE= MIME-Version: 1.0 Received: by 10.204.113.12 with SMTP id y12mr1916538bkp.214.1248347678246; Thu, 23 Jul 2009 04:14:38 -0700 (PDT) In-Reply-To: <20090723080336.A26077@lua.tecgraf.puc-rio.br> References: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> <20090723080336.A26077@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 12:14:38 +0100 Message-ID: <4db9cacb0907230414y56489a2bj5f9ff2f77e71b658@mail.gmail.com> Subject: Re: tables holding nil From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 12:03 PM, Luiz Henrique de Figueiredo wrote: >> Are there any use cases where allowing reading t[nil] or t[nan] is useful? > > t[nil] is what happens when you do t[x] and x is nil :-) > > This may or not be a programmer error: you may be trying to determine > whether a field given by the user exists in a table. If the user does > not define the name of that field, then it's nil and you get t[nil]. > Not too common an idiom, though. > Exactly. We rely on this behaviour in quite a few places in our code. Otherwise we would have to explicitly guard such accesses with a nil check. I don't want this to throw an error, but I'm not sure how /setting/ a nil could be handled any different than it is today. The logic I use is that there is no key for nil (hence it returns nil) and you can't set it because it happens to be an invalid key. Matthew From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:22:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NBMi7x019324; Thu, 23 Jul 2009 08:22:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9A2B18D9B; Thu, 23 Jul 2009 08:22:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D3B918C5A for ; Thu, 23 Jul 2009 08:22:15 -0300 (BRT) Received: by fxm25 with SMTP id 25so790244fxm.5 for ; Thu, 23 Jul 2009 04:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=AcgeTsLMRnFo4lMAkS8WjjOdsZHfDNKgEC0vfNAaK0U=; b=QomC2gCCJObMwmJ4gdp5VDprWmMo1lXSavUS67rEJN/2a6uRCtzmBO4dgIDVhgtqog QyYntTzhlSqVP0VewJx4RqnTD7IYIPPcoCYd4ynHfENLpXMV0KzBULwJTlNZVisi+1IF RaqVHuF3jdECG/BD8YR5zHWzQWrwLDaEl7ZL8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=HAfE7ngqMBGNRbjAaGpzCY/NEGf9iup4YbOFKVKJdCgZr9cH4X+hBlnx46cXH9W2vS 3VQ6+8YAz+TS1SRn+gI+SE2fzP/82c35ClVQwYhXzmOPlJJWDtzUz4gOpHV1GZphwK4I vCen6YInU5B5pjb+tOa4/Uzt8HWpKjrd7n1qw= MIME-Version: 1.0 Received: by 10.204.103.145 with SMTP id k17mr1962168bko.79.1248348133568; Thu, 23 Jul 2009 04:22:13 -0700 (PDT) In-Reply-To: <13af99c70907230414i112c7a07n946391921e193091@mail.gmail.com> References: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> <20090722234720.A24559@lua.tecgraf.puc-rio.br> <20090723073123.A25958@lua.tecgraf.puc-rio.br> <13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com> <20090723080336.A26077@lua.tecgraf.puc-rio.br> <13af99c70907230414i112c7a07n946391921e193091@mail.gmail.com> Date: Thu, 23 Jul 2009 12:22:13 +0100 Message-ID: <4db9cacb0907230422h5e89e687ib8c23eed9ed5062c@mail.gmail.com> Subject: Re: tables holding nil From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 12:14 PM, Kristofer Karlsson wrote: > > > On Thu, Jul 23, 2009 at 1:03 PM, Luiz Henrique de Figueiredo > wrote: >> >> > Are there any use cases where allowing reading t[nil] or t[nan] is >> > useful? >> >> t[nil] is what happens when you do t[x] and x is nil :-) > > Yes, obviously :-) > >> >> This may or not be a programmer error: you may be trying to determine >> whether a field given by the user exists in a table. If the user does >> not define the name of that field, then it's nil and you get t[nil]. >> Not too common an idiom, though. > > That may be a valid use case I suppose. > How about chaining table lookups like this: > > heightmap = {{1,2,3},{4,5,6}} > > local value = heightmap[1][4] > local value = heightmap[3][4] > > In the first case, it will return nil, since the y value is out of range. > In the second case it would throw an error (tried to index nil). > > Couldn't the same reasoning be applied here, and change table lookups to > return nil if the table itself was nil? (But throw an error when setting) > This would mean that heightmap[x][y] would return nil instead of erroring, > and it would give somewhat more consistency. > Myself and several other people I know would do anything for this :) Having to check each step of a lookup is a very big pain, especially when you have deeply-nested tables (which are common and almost encouraged by Lua). The cleanest solution would be simply for nil[nil] == nil, but I don't know how much that would affect other things. > The following is already allowed: > assert(("Hello world")[123] == nil) > That's simply because strings have a metatable. > But this is not: > assert((1234)[123] == nil) > assert((nil)[123] == nil) > and numbers and nils don't :) Matthew From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 08:26:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NBQMvJ019626; Thu, 23 Jul 2009 08:26:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3380F18C5A; Thu, 23 Jul 2009 08:26:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exch03.pdv-fs.de (exch03.pdv-fs.de [194.25.104.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C407318782 for ; Thu, 23 Jul 2009 08:25:56 -0300 (BRT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: tables holding nil Date: Thu, 23 Jul 2009 13:25:54 +0200 Message-ID: In-Reply-To: <4db9cacb0907230422h5e89e687ib8c23eed9ed5062c@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: tables holding nil Thread-Index: AcoLh+iDxEZ/1L07RimhcEDogSijSAAAFjqQ References: <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com><20090722181501.A23850@lua.tecgraf.puc-rio.br><20090722234720.A24559@lua.tecgraf.puc-rio.br><20090723073123.A25958@lua.tecgraf.puc-rio.br><13af99c70907230356m42b7ef9bvea39c4992693e97d@mail.gmail.com><20090723080336.A26077@lua.tecgraf.puc-rio.br><13af99c70907230414i112c7a07n946391921e193091@mail.gmail.com> <4db9cacb0907230422h5e89e687ib8c23eed9ed5062c@mail.gmail.com> From: =?iso-8859-1?Q?Richter=2C_J=F6rg?= To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NBQMvJ019626 >> Couldn't the same reasoning be applied here, and change >table lookups to >> return nil if the table itself was nil? (But throw an error >when setting) >> This would mean that heightmap[x][y] would return nil >instead of erroring, >> and it would give somewhat more consistency. >> > >Myself and several other people I know would do anything for this :) How about: debug.setmetatable( nil, { __index=function() end } ) print( NIL[nil] ) Jörg From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 09:17:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NCHrOM026709; Thu, 23 Jul 2009 09:17:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5F8718E8A; Thu, 23 Jul 2009 09:17:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9489218D64 for ; Thu, 23 Jul 2009 09:17:19 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so1112332fgb.5 for ; Thu, 23 Jul 2009 05:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=jBqeXD/wCfyKC1JQcPkbd9UGPh29BrHruc0j1r3LbtA=; b=qHshSVc7w08m3PyMzKvZQKAjAnyyB2Pg6QeIIRpcOO9r9YYl4kWhokmeHYC5EQf9lG o/z1i0gNYVDhrIVzky12sGJh4paCaa4290RhB11Zzp+IZk8kLCod+t9RP0uB0AlPn/GM C4olqXTD/h68JldWhWJduqDPBVFMsDL4IUs8c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PY78UVbItgiKhEhYb0un8vIPvbKIilBf1zKIZVnP+FX9qv0TqRdCQQkLtx80dvCapS iziNWfOy1lUVcuNPlFpaK4ExaJGP7q4urcy9vRGEQAQtFkqnFZE4nlYmxWRKr9jp7jI5 GTpyQSi209dZh3YtDbhY79Zs8o4vIy8RK4tLA= MIME-Version: 1.0 Received: by 10.239.156.193 with SMTP id n1mr192586hbc.43.1248351436923; Thu, 23 Jul 2009 05:17:16 -0700 (PDT) In-Reply-To: <4A683A71.30104@cowlark.com> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <4A683A71.30104@cowlark.com> Date: Thu, 23 Jul 2009 13:17:16 +0100 Message-ID: <379686bd0907230517p77476375i257bcfde991847e3@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 11:24 AM, David Given wrote: [...] > Ditto; I have a Gaim plugin for the Citadel IM protocol written in Lua. > Citadel's protocol is so stateful that it was actually *easier* to bind Lua > to Gaim and write the protocol code in a Lua coroutine than it would have > been to do with a traditional state machine! (I can package up the code if > anyone's interested.) I would definitely be interested in seeing how coroutines are used. Ashish From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 09:31:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NCV0iQ028867; Thu, 23 Jul 2009 09:31:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04BB718F43; Thu, 23 Jul 2009 09:30:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C22D718F06 for ; Thu, 23 Jul 2009 09:30:26 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so434544qwi.11 for ; Thu, 23 Jul 2009 05:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pWQUrnyXUhtFdR2K42hTaFI/3hjLXVX6aKTIqNbgVXc=; b=wA6NVZxIDHgzC1F91UA0R98HMDhyEKLoGBKLZuNxj9aqgATDs9M0x92BgMFccHO8Je 29UEOf/AHqx2EfhhX8V/mU4vtVIS0k1kJBGRVz9g2XctV0TUi7xpyS1HTpk1aQZdqNPd OT1tWCBiZpREvMadKK9zdZmQvgp99xdLJBhmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QddYO/2cEG9CTLW7thLRyGl51Ll17FaXCnWfylONcOh9iaDHlfX6/G4I3Pgpt+Oh+Y 8aEcez+bAllJ5cylOtICf+02IsqDBlZvfJWdqCbjwyNfYnnqT2cJwT2+B/POZjYR6re7 nNbltIfKQWL++ifQ9pLX7z5WlKUk9didtWhAw= MIME-Version: 1.0 Received: by 10.220.85.8 with SMTP id m8mr1421225vcl.79.1248352224793; Thu, 23 Jul 2009 05:30:24 -0700 (PDT) In-Reply-To: <4A683A71.30104@cowlark.com> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <4A683A71.30104@cowlark.com> Date: Thu, 23 Jul 2009 09:30:24 -0300 Message-ID: Subject: Re: [ANN] Lua Conference Bot 0.1 From: Lucas Hermann Negri To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NCV0iQ028867 If it's possible to generate the gobject-introspection gir file for the library, then bindings can be generated with lgob with ease. On Thu, Jul 23, 2009 at 7:24 AM, David Given wrote: > Etan Reisner wrote: > [...] >> >> I would be more than happy to help work on a lua wrapper for libpurple, >> however that is currently a far from trivial task. I had started work on a >> lua plugin loader for libpurple though a while back (before the libpurple >> name change) but ran out of spare time for it and it has since sat and >> bit-rot. At this point I don't like the idea I had for how to handle it >> anyway, so I would want to start again on a new one were I to have time to >> pick it up again. > > Ditto; I have a Gaim plugin for the Citadel IM protocol written in Lua. > Citadel's protocol is so stateful that it was actually *easier* to bind Lua > to Gaim and write the protocol code in a Lua coroutine than it would have > been to do with a traditional state machine! (I can package up the code if > anyone's interested.) > > [...] >> >> There is currently SoC and associated work under way to GObject-ify many >> of the core objects in libpurple, when this work finally lands in >> libpurple a lua binding will likely be much easier to accomplish (using >> the same set of tools used for the lgob bindings). > > Sounds good; this should allow dynamic creation of bindings via GObject > introspection, right? > > -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "They laughed at Newton. They laughed at Einstein. Of course, they > │ also laughed at Bozo the Clown." --- Carl Sagan > -- http://oproj.tuxfamily.org From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 09:44:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NCiagM031206; Thu, 23 Jul 2009 09:44:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4A6819018; Thu, 23 Jul 2009 09:44:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5612118F94 for ; Thu, 23 Jul 2009 09:44:07 -0300 (BRT) Received: by ewy26 with SMTP id 26so945328ewy.5 for ; Thu, 23 Jul 2009 05:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=keGwjOGQFRf0I8Q34nHjzKYmq6iSFiJhhAB5gm8GWBQ=; b=S/LM6OWwQ3FYDan6WX+q6WomXItprIoALoNDwwGbn5ZOZqjZLFROMj9/pFn3n1HtUm jGV3fCbp+/LUGxaig05CXsBIvKrS4RG6p8/xYUW4rvOUyTySYJR4XISZGcnrMey4YcRY iXfSK4BLzSd4QkjzhZDWz9YlFkxaVLH9yyhYQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=G3RPCFksT4aMox8TaDqUMGBzmwGH6VPvPgsRqTGF6gt9owD/FrcOhiOvcnLWbjs43f VthVs/UxaUgeaS7OfCksnrfUlVPKt5y/O1HqbJwp2SiHrZDXcCoap7DB9Q1eRRYQC4kJ gj0KEFcFdLQ4idhcJibEj3AAWWKksW+EYx6b8= MIME-Version: 1.0 Received: by 10.216.39.85 with SMTP id c63mr586552web.103.1248353044119; Thu, 23 Jul 2009 05:44:04 -0700 (PDT) In-Reply-To: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> From: Jerome Vuarand Date: Thu, 23 Jul 2009 14:43:44 +0200 Message-ID: <89d273ba0907230543v54603e9av7edb1825a4768a04@mail.gmail.com> Subject: Re: Direct Memory Access to Lua variables? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/22 b's spam : > I'm writing a C++ wrapper class that allows me to manipulate variables in a > loaded lua script. It works fine, but is very slow because I'm performing > these operations many times (in real-time). Is there a way to write directly > to the memory location without having to search and push the variable onto > the stack by name? If you're doing a lot more C access than Lua access, you can store the variable data in a userdata, that will never be moved (just store its address in your C code). Then you can use index/newindex metamethods to read or write that data from Lua. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 10:00:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ND03Pm002487; Thu, 23 Jul 2009 10:00:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECBF119068; Thu, 23 Jul 2009 09:59:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 371AB18EDF for ; Thu, 23 Jul 2009 09:59:31 -0300 (BRT) Received: by fxm25 with SMTP id 25so845549fxm.5 for ; Thu, 23 Jul 2009 05:59:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.76.129 with SMTP id c1mr2063557bkk.9.1248353969371; Thu, 23 Jul 2009 05:59:29 -0700 (PDT) In-Reply-To: References: <5fe281d40907221330u11394bf5k12750dc78c9003c7@mail.gmail.com> <5fe281d40907221338o6200c950p3e9efbe28aae53ed@mail.gmail.com> <20090722181501.A23850@lua.tecgraf.puc-rio.br> Date: Thu, 23 Jul 2009 15:59:29 +0300 Message-ID: Subject: Re: tables holding nil From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6ND03Pm002487 On Thu, Jul 23, 2009 at 02:25, Cosmin Apreutesei wrote: >> If nil is allowed as a table key, then next() would have to use some >> other value for the beginning and end of a table. > > Actually, I never liked the fact that nil is used to signal the end of > an iteration. Whenever I build an iterator that might return nil > elements, I have to put a pseudo-index as the first return value of > the iterator as a workaround. To allow iterators to return nil as a value, the iterator protocol could be generalized as do local f, s, var_1, ···, var_n = explist while true do local more, var_1, ···, var_n = f(s, var_1, ···, var_n) if not more then break end block end end Should next() continue to be the iterator returned by pairs() (but who says it shoud), its common usage scenario would be more,k,v=next(t) while more do ........ more,k,v=next(t) end This would allow constructing simple iterators for sparse arrays, sets, or varargs, all of which can return nil as a valid value. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 10:21:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NDL8Tt007416; Thu, 23 Jul 2009 10:21:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0197190AC; Thu, 23 Jul 2009 10:20:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f184.google.com (mail-yx0-f184.google.com [209.85.210.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F0AB18EF2 for ; Thu, 23 Jul 2009 10:20:30 -0300 (BRT) Received: by yxe14 with SMTP id 14so407617yxe.33 for ; Thu, 23 Jul 2009 06:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aLmd00Q0uf6AHEhtnqlxF4nO6Kon2GBx96PaxSHjKe0=; b=B/NJ50ZlZoJiJ9MdWW5wQkRNQ6TK2/jeRlq5un7JC/nTMRErnjHA0mcv6qWI9l2oux a0+f4qoX0N0m+cQvmQoABRLacS1ju6ldC8MLUv3lx0UNPdCj2inmuDZeGyyDkXWa4hb+ mk8xFGtC9ifQODvVERbxNWw01688CqPZaj/Mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=QMO/1/upzIBwv/UtHbE0e/LtgmqPwuAqaTw9IAYTOAHEi6lDRfpnkXmwt+QiIJqfAU 0h7XUSTavydJwOoYSOTcXSvlixx7/8Rz0A1JmCYuiTpM+p4Pnksic92e4MJjg8KbLKND vVmrr/9nmS3Zlem+XudTpu0cV6rfwWFezkjTU= MIME-Version: 1.0 Received: by 10.90.79.4 with SMTP id c4mr1864869agb.21.1248355227976; Thu, 23 Jul 2009 06:20:27 -0700 (PDT) In-Reply-To: References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> Date: Thu, 23 Jul 2009 13:20:27 +0000 Message-ID: <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> Subject: Re: Support for Windows unicode paths From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 7/23/09, Miles Bader wrote: > > > One doesn't need wide strings to use unicode, utf-8 works fine. > > Microsoft made a bad call, and they're stuck with it, but Lua need not > do so. > UTF-8 is best for serialisation (writing text to disk, to socket etc.). For in-memory strings it makes a lot of algorithms harder. UCS-2 was a bad idea, but UTF-16 works perfectly well. UTF-32 is even better. -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 10:24:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NDO1th008159; Thu, 23 Jul 2009 10:24:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA2B119092; Thu, 23 Jul 2009 10:23:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.c.painless.aaisp.net.uk (unknown [81.187.30.63]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37AEA18FAA for ; Thu, 23 Jul 2009 10:23:34 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTyGf-0004VZ-K8 for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 14:23:29 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id E82766F043 for ; Thu, 23 Jul 2009 14:23:26 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:51007 with envelope Message-ID: <4A686447.3090804@cowlark.com> Date: Thu, 23 Jul 2009 14:23:19 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> In-Reply-To: <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NDO1th008159 Alex Queiroz wrote: [...] > UTF-8 is best for serialisation (writing text to disk, to socket > etc.). For in-memory strings it makes a lot of algorithms harder. > UCS-2 was a bad idea, but UTF-16 works perfectly well. UTF-32 is even > better. Not much, I'm afraid --- as each glyph can be comprised from multiple code points, having fixed-size code points doesn't help a great deal. Your algorithms still have to cope with variable-sized groups of code points. And if you're going to do that, you might as well use UTF-8 for its ASCII interoperability features. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 10:32:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NDWVCX009674; Thu, 23 Jul 2009 10:32:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8CA11911A; Thu, 23 Jul 2009 10:31:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f192.google.com (mail-pz0-f192.google.com [209.85.222.192]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF05C187CD for ; Thu, 23 Jul 2009 10:31:50 -0300 (BRT) Received: by pzk30 with SMTP id 30so468707pzk.33 for ; Thu, 23 Jul 2009 06:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GSml/1FcVRn2KF1eHSacmsxMLgcDBt5HZS1l6wkymLo=; b=bbxNf/nth+JkU5YZZHbJ03PnZ5gVTdoNryGsZ+mZaXg8nKgHtC4+/bZ/4oTYW0lv4e ol9e1T315+tJ2rBBT3f1/5rip+LyG5/osGEEJpTBBdUaWQMx5gpypp7jwz4eX/boeGB2 j60qsKVqc0mc92i2sbKX3Ebcxya7ASGZuXWyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vu9cAWhgJwIRVSqG2Xue4ehYvt5XxS/USFEo6hnlZs8BAizLkBGd8NbP9qQZCD0ROm f+Aj5qw52u1KnV+uMNlWzlahFK1W2t0EBl55RrpGVh48iIOIH3NZjclqcvnt8Z3apn0n +4mHrLPkBk9njPmXEtx1JTZzBBADzZ8ENmcY4= MIME-Version: 1.0 Received: by 10.143.33.19 with SMTP id l19mr367060wfj.154.1248355908492; Thu, 23 Jul 2009 06:31:48 -0700 (PDT) In-Reply-To: <4A686447.3090804@cowlark.com> References: <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> <4A686447.3090804@cowlark.com> Date: Thu, 23 Jul 2009 13:31:48 +0000 Message-ID: <54e12800907230631p1bd8a6aeif214bf054e5c8cd6@mail.gmail.com> Subject: Re: Support for Windows unicode paths From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 7/23/09, David Given wrote: > Alex Queiroz wrote: > [...] > > > UTF-8 is best for serialisation (writing text to disk, to socket > > etc.). For in-memory strings it makes a lot of algorithms harder. > > UCS-2 was a bad idea, but UTF-16 works perfectly well. UTF-32 is even > > better. > > > > Not much, I'm afraid --- as each glyph can be comprised from multiple code > points, having fixed-size code points doesn't help a great deal. Your > algorithms still have to cope with variable-sized groups of code points. And > if you're going to do that, you might as well use UTF-8 for its ASCII > interoperability features. > This is an interesting point. I and thought I had everything figured out for my VM's text handling... -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 10:35:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NDZa5I010443; Thu, 23 Jul 2009 10:35:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 870F6191C9; Thu, 23 Jul 2009 10:35:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4CEE1903D for ; Thu, 23 Jul 2009 10:35:07 -0300 (BRT) Received: by bwz17 with SMTP id 17so865765bwz.5 for ; Thu, 23 Jul 2009 06:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=tSUUy7tpG+I4Sisg+okzNmEN9zQ8pCXc703FCsWuEi8=; b=phnpsiyhjp+uP07G9QZwZQp+DKGgohNdTKbOqIVVI7INRVctc8EFikK+fp88wl+YjT ffZGk1yawunRJdrW/iqprg7+HBs7gMDTLDBMdmZIvSjYw99U/Wv8udyBYHXxtPR848Ug elWB099sVD5Fl3qsG2ez5a2w5HuvyFFDd6LqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=WXGK3UiJmJp1ePTUDcXeYLMdJiMuuMTkvRSOXgGKNirvpSVNk5UGWKqRCKU0LmTIdb CjJ49FCyN8+0gYSmsa96OKu7wlOfJ37xo4e90t7TNgW9KhgKDPDsoWF9Ep22vYcXQ8Iz EWyax62pZd6cikiq1lsYxtAfjcv3ipdG93lTQ= Received: by 10.103.227.13 with SMTP id e13mr1140951mur.117.1248356105693; Thu, 23 Jul 2009 06:35:05 -0700 (PDT) Received: from ?95.78.70.11? ([95.78.70.11]) by mx.google.com with ESMTPS id j9sm7703637mue.21.2009.07.23.06.35.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Jul 2009 06:35:04 -0700 (PDT) Date: Thu, 23 Jul 2009 17:34:58 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1037637790.20090723173458@gmail.com> To: Alex Queiroz Subject: Re[2]: Support for Windows unicode paths In-Reply-To: <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> References: <1209655696.20090722192622@gmail.com> <4A6733CA.9090200@cowlark.com> <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Alex, Thursday, July 23, 2009, 5:20:27 PM, you wrote: > UTF-8 is best for serialisation (writing text to disk, to socket > etc.). For in-memory strings it makes a lot of algorithms harder. > UCS-2 was a bad idea, but UTF-16 works perfectly well. UTF-32 is even > better. ucs-4 better because it's easier to use. utf-16 doesn't buy us anything. utf-8 is really great since it provides easy migration path from ascii -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 11:06:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NE624B019056; Thu, 23 Jul 2009 11:06:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2ACB2190D8; Thu, 23 Jul 2009 11:05:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78E7519049 for ; Thu, 23 Jul 2009 11:05:15 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MTyv0-0002F3-Ai for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 15:05:10 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 281997116F for ; Thu, 23 Jul 2009 15:05:08 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:48216 with envelope Message-ID: <4A686E0C.5000303@cowlark.com> Date: Thu, 23 Jul 2009 15:05:00 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Support for Windows unicode paths References: <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> <4A686447.3090804@cowlark.com> <54e12800907230631p1bd8a6aeif214bf054e5c8cd6@mail.gmail.com> In-Reply-To: <54e12800907230631p1bd8a6aeif214bf054e5c8cd6@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NE624B019056 Alex Queiroz wrote: [...] > This is an interesting point. I and thought I had everything > figured out for my VM's text handling... There's some good reading here (which I hadn't found before): http://www.unicode.org/reports/tr29 It turns out to be possible to programmatically split a Unicode string up into its component grapheme clusters (what I was incorrectly referring to as glyphs, and what most people think of as characters). So, it ought to be fairly simple to do a Lua addon where you can say: for c in s:graphemes() do print(c) end ...where c is a *string* containing a particular grapheme cluster (which might be quite long; the link has an example of a four-code point cluster). This would actually allow a string to be broken down into an array of grapheme clusters to give true random access, which I'd previously thought of as being impossible. It'd be expensive, though... possibly it'd be worth doing lazily. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 13:37:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NGbcQ1023339; Thu, 23 Jul 2009 13:37:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2231118FF3; Thu, 23 Jul 2009 13:36:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (trick.b-et-a.de [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id 464CF18B9F for ; Thu, 23 Jul 2009 13:36:44 -0300 (BRT) Received: (qmail 25378 invoked by uid 600); 23 Jul 2009 16:36:38 -0000 Date: Thu, 23 Jul 2009 18:36:37 +0200 From: Klaus Ripke To: Lua list Subject: Re: Support for Windows unicode paths Message-ID: <20090723163637.GC4350@one.local> Mail-Followup-To: Lua list References: <89d273ba0907220918r3f869dd2n894fe7ff456336c0@mail.gmail.com> <4A673F14.3090609@workspacewhiz.com> <4A676AAD.6030407@013net.net> <4A67D31D.2010506@workspacewhiz.com> <54e12800907230620w61e920c8p295c37b3694b43e9@mail.gmail.com> <4A686447.3090804@cowlark.com> <54e12800907230631p1bd8a6aeif214bf054e5c8cd6@mail.gmail.com> <4A686E0C.5000303@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A686E0C.5000303@cowlark.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 03:05:00PM +0100, David Given wrote: ... > It turns out to be possible to programmatically split a Unicode string > up into its component grapheme clusters (what I was incorrectly > referring to as glyphs, and what most people think of as characters). > So, it ought to be fairly simple to do a Lua addon where you can say: > > for c in s:graphemes() do > print(c) > end It is, and actually slnunicode does this, with a few caveats: " See http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries for default grapheme clusters. Lazy westerners we are (and lacking the Hangul_Syllable_Type data), we care for base char + Grapheme_Extend, but not for Hangul syllable sequences. For http://unicode.org/Public/UNIDATA/UCD.html#Grapheme_Extend we use Mn (NON_SPACING_MARK) + Me (ENCLOSING_MARK), ignoring the 18 mostly south asian Other_Grapheme_Extend (16 Mc, 2 Cf) from http://www.unicode.org/Public/UNIDATA/PropList.txt " It provides multiple string libs, one of which operates on graphemes, meaning length, substr etc all count grapheme clusters. > ...where c is a *string* containing a particular grapheme cluster (which > might be quite long; the link has an example of a four-code point > cluster). This would actually allow a string to be broken down into an > array of grapheme clusters to give true random access, which I'd > previously thought of as being impossible. It'd be expensive, though... > possibly it'd be worth doing lazily. It boild down to snippets like: if (MODE_GRAPH == mode) while (Grapheme_Extend(code) && p>s) code = utf8_oced(&p, s); It is not much more expensive than plain UTF-8, which in turn is not more expensive than UTF-16 done right, i.e. with checking for the surrogate pairs to encode characters beyond the BMP. enjoy From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 15:02:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NI1u7G010259; Thu, 23 Jul 2009 15:01:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D599619257; Thu, 23 Jul 2009 15:01:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gateway09.websitewelcome.com (gateway09.websitewelcome.com [67.18.15.8]) by bazar2.conectiva.com.br (Postfix) with SMTP id 80AC819235 for ; Thu, 23 Jul 2009 15:01:08 -0300 (BRT) Received: (qmail 15512 invoked from network); 23 Jul 2009 18:08:08 -0000 Received: from gator504.hostgator.com (74.53.141.18) by gateway09.websitewelcome.com with SMTP; 23 Jul 2009 18:08:08 -0000 Received: from 204.234.100.97.cfl.res.rr.com ([97.100.234.204]:60909 helo=VADER) by gator504.hostgator.com with esmtpa (Exim 4.69) (envelope-from ) id 1MU2bA-0003K5-GU for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 13:00:56 -0500 From: "b's spam" To: "'Lua list'" References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> <89d273ba0907230543v54603e9av7edb1825a4768a04@mail.gmail.com> In-Reply-To: <89d273ba0907230543v54603e9av7edb1825a4768a04@mail.gmail.com> Subject: RE: Direct Memory Access to Lua variables? Date: Thu, 23 Jul 2009 14:00:56 -0400 Message-ID: <4D6EB001315D4F569D614DFCBF062521@VADER> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcoLk01kq6DZRr90SfWjK4aQE7HIWQALAdQw X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator504.hostgator.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - inlandstudios.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm not too sure how to use the index/newindex metamethods for what I'm trying to do. Are there examples of this somewhere? -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand Sent: Thursday, July 23, 2009 8:44 AM To: Lua list Subject: Re: Direct Memory Access to Lua variables? 2009/7/22 b's spam : > I'm writing a C++ wrapper class that allows me to manipulate variables in a > loaded lua script. It works fine, but is very slow because I'm performing > these operations many times (in real-time). Is there a way to write directly > to the memory location without having to search and push the variable onto > the stack by name? If you're doing a lot more C access than Lua access, you can store the variable data in a userdata, that will never be moved (just store its address in your C code). Then you can use index/newindex metamethods to read or write that data from Lua. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.23/2254 - Release Date: 07/23/09 06:02:00 From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 15:12:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NICDPb012605; Thu, 23 Jul 2009 15:12:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDEBF19276; Thu, 23 Jul 2009 15:11:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA05.westchester.pa.mail.comcast.net (qmta05.westchester.pa.mail.comcast.net [76.96.62.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A38D018A5F for ; Thu, 23 Jul 2009 15:11:40 -0300 (BRT) Received: from OMTA18.westchester.pa.mail.comcast.net ([76.96.62.90]) by QMTA05.westchester.pa.mail.comcast.net with comcast id KNjR1c00J1wpRvQ55WBf8o; Thu, 23 Jul 2009 18:11:39 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA18.westchester.pa.mail.comcast.net with comcast id KWDT1c00524UxC23eWDTAf; Thu, 23 Jul 2009 18:13:28 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id 84406372AF; Thu, 23 Jul 2009 14:11:37 -0400 (EDT) Date: Thu, 23 Jul 2009 14:11:37 -0400 From: Etan Reisner To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 Message-ID: <20090723181137.GD1849@aran> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <4A683A71.30104@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A683A71.30104@cowlark.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 11:24:49AM +0100, David Given wrote: > Etan Reisner wrote: > [...] >> I would be more than happy to help work on a lua wrapper for libpurple, >> however that is currently a far from trivial task. I had started work on a >> lua plugin loader for libpurple though a while back (before the libpurple >> name change) but ran out of spare time for it and it has since sat and >> bit-rot. At this point I don't like the idea I had for how to handle it >> anyway, so I would want to start again on a new one were I to have time to >> pick it up again. > > Ditto; I have a Gaim plugin for the Citadel IM protocol written in Lua. > Citadel's protocol is so stateful that it was actually *easier* to bind Lua > to Gaim and write the protocol code in a Lua coroutine than it would have > been to do with a traditional state machine! (I can package up the code if > anyone's interested.) I would be very interested in this, people have often asked if they can write protocol plugins in non-C languages and the official answer is "not currently". The un-official answer has always been "nothing stops you from writing your protocol code in a non-C language and wrapping it for libpurple usage". So an example of that would certainly be interesting to see. > [...] >> There is currently SoC and associated work under way to GObject-ify many >> of the core objects in libpurple, when this work finally lands in >> libpurple a lua binding will likely be much easier to accomplish (using >> the same set of tools used for the lgob bindings). > > Sounds good; this should allow dynamic creation of bindings via GObject > introspection, right? That's my hope, yes. At least for as many parts as have been migrated. The less manual work needed the better. -Etan From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 17:32:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NKW7YB016090; Thu, 23 Jul 2009 17:32:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D5BE190D1; Thu, 23 Jul 2009 17:31:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5225618F02 for ; Thu, 23 Jul 2009 17:31:30 -0300 (BRT) Received: by ewy26 with SMTP id 26so1308891ewy.5 for ; Thu, 23 Jul 2009 13:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=l2IgRkTP4NRKglorqrHVkcHuqcH70fPGKGZ9eLlxKSs=; b=Qp/wDRPnO2bEYnAid4auIKW7qs1O21Tr52+v8ZT9p+Mfuy/XBfSsrNSlFwlPTHCvFx gz2PWFQfq9xvI33/aD/YyP92Wjoy6ASMpGsMt7Vi15I4vYjsoAghP9X1gMEcrkFnIcrR Zq02zLGDQWMfVtlC1Wt37PetkOoslA0XFtKdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=jAQt4RZw2C8eilpi6eyg0BwUfNuF/tIhMiuQhbHamnv2TF5hAKTwqaWneIFQFygU+p 3VCqbWHM0vJhdIxbD4rnyfqVBOH0VCCO/0VfWm5IM8wJsBdY/+q4aRQoop+/rkQ+ujhj yl6eQr63ulA+UYbUbllCQlntuzG7OXHzliRBE= MIME-Version: 1.0 Received: by 10.216.55.194 with SMTP id k44mr773518wec.25.1248381087480; Thu, 23 Jul 2009 13:31:27 -0700 (PDT) Date: Thu, 23 Jul 2009 15:31:27 -0500 Message-ID: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> Subject: tecgraf.puc-rio.br domain unavailable From: paul.hermeneutic@gmail.com To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The LuaBinaries page at: http://luabinaries.luaforge.net/ provides an email address: scuri-NO-SPAM-PLEASE@tecgraf.puc-rio.br which does not appear to work. Yes, I removed the "-NO-SPAM-PLEASE" portion of the address. In return, I received: Technical details of permanent failure: DNS Error: Domain name not found Is this domain still active? From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 17:37:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NKb5vM017432; Thu, 23 Jul 2009 17:37:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 149541928F; Thu, 23 Jul 2009 17:36:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88C6A190F9 for ; Thu, 23 Jul 2009 17:36:34 -0300 (BRT) Received: by gxk18 with SMTP id 18so1978679gxk.5 for ; Thu, 23 Jul 2009 13:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=VD6TIzz+BiIOd6TNGMxOyFeKFZhCpOw1jC1OnUekxC8=; b=jbYu3yJ14VdzlaAVZOm4wC9QiO1D9oMXmPcZWSV82C3XdBIiZCsyfqpvTsEDGfZwx6 K5IIQLvG6p6/RRSPVnAUdPET6g5NkMpYpvBX/N/vMUe+auPbXj1NPN6paOOJI5yuh+O0 v4ijXYtzLi6GSnvGzoBShR0JDVUxaVYs8foT8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Wmhr435TbMOHDlmbIIE293wvpy6AV61Ce9ld1l4Um0WB/FSG/NfWWLFn4k0DI4J8H1 hDzH4kUGenSov7Ppm3attq/wE71y2qotfxEm3v32gs3JxGFgTW9x9KCioCS9CimP/3QR LA4B3nDWNkfsiRjcDossJEt0EQZNu8NbgKci4= MIME-Version: 1.0 Received: by 10.90.72.3 with SMTP id u3mr2168673aga.11.1248381391505; Thu, 23 Jul 2009 13:36:31 -0700 (PDT) In-Reply-To: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> References: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> Date: Thu, 23 Jul 2009 20:36:31 +0000 Message-ID: <54e12800907231336p2eedec3aq9f57c3f380a360ef@mail.gmail.com> Subject: Re: tecgraf.puc-rio.br domain unavailable From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 7/23/09, paul.hermeneutic@gmail.com wrote: > > Is this domain still active? > Works for me: alex@li17-123:~$ host -a tecgraf.puc-rio.br Trying "tecgraf.puc-rio.br" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21249 ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 3, ADDITIONAL: 2 ;; QUESTION SECTION: ;tecgraf.puc-rio.br. IN ANY ;; ANSWER SECTION: tecgraf.puc-rio.br. 86400 IN A 139.82.85.1 tecgraf.puc-rio.br. 86400 IN MX 0 duchamp.tecgraf.puc-rio.br. tecgraf.puc-rio.br. 86400 IN SOA duchamp.tecgraf.puc-rio.br. suporte.tecgraf.puc-rio.br. 2009072301 3600 1800 604800 86400 tecgraf.puc-rio.br. 86400 IN NS duchamp.tecgraf.puc-rio.br. tecgraf.puc-rio.br. 86400 IN NS exu.inf.puc-rio.br. tecgraf.puc-rio.br. 86400 IN NS vialactea.rdc.puc-rio.br. ;; AUTHORITY SECTION: tecgraf.puc-rio.br. 86400 IN NS duchamp.tecgraf.puc-rio.br. tecgraf.puc-rio.br. 86400 IN NS exu.inf.puc-rio.br. tecgraf.puc-rio.br. 86400 IN NS vialactea.rdc.puc-rio.br. ;; ADDITIONAL SECTION: duchamp.tecgraf.puc-rio.br. 86400 IN A 139.82.85.1 exu.inf.puc-rio.br. 84338 IN A 139.82.16.3 Received 258 bytes from 75.127.97.6#53 in 846 ms -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 17:41:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NKfMoD018560; Thu, 23 Jul 2009 17:41:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8EC419296; Thu, 23 Jul 2009 17:41:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8E7C1928E for ; Thu, 23 Jul 2009 17:40:55 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NKem7Q018371 for ; Thu, 23 Jul 2009 17:40:51 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6NKemu27295; Thu, 23 Jul 2009 17:40:48 -0300 Date: Thu, 23 Jul 2009 17:40:47 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: tecgraf.puc-rio.br domain unavailable Message-ID: <20090723174047.A27289@lua.tecgraf.puc-rio.br> References: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com>; from paul.hermeneutic@gmail.com on Thu, Jul 23, 2009 at 03:31:27PM -0500 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Is this domain still active? It sure is; otherwise I wouldn't get or make lua-l postings. From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 18:14:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NLEHD3027762; Thu, 23 Jul 2009 18:14:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F354F1928E; Thu, 23 Jul 2009 18:13:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33E4F19271 for ; Thu, 23 Jul 2009 18:13:43 -0300 (BRT) Received: by ewy26 with SMTP id 26so1338838ewy.5 for ; Thu, 23 Jul 2009 14:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=IW4emcOx/DEm0l/NdEX5R0cewUimBZWKxF4s4YsX3Hc=; b=EacQR9k9GA4I/0Q2n7+7NNSxkMNmbarWVgpJo4+23KIaY54P888tseyph/pKkKCIWS yd22k4BcfuOMX8WqR6IHv3ROB08ZYKAbcaCkHtkcmaEWJXINFZzz11C5FtOtXxFi6Dke FtdIXOQZEz+HVREvPjs/Uga4VkwYzWVVx8V60= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=NOmofrG6uf355l4Hm2SMMwyMP6IVSr/uTIgdioXJkqwNay/FO3LXSO4ZZJiqAHmlip HA5CjtkUGDipmSTXHh44+n1n9mRBLE05h31swnwqkdQLDPB1yDvkl3Rt1ryVyiV70D2/ QB6z/BtNk4TysK+PKj2IyNp572I+dPDtB/aYg= Received: by 10.210.81.3 with SMTP id e3mr8725155ebb.77.1248383622726; Thu, 23 Jul 2009 14:13:42 -0700 (PDT) Received: from ?192.168.1.5? ([88.193.204.243]) by mx.google.com with ESMTPS id 28sm1368890eyg.42.2009.07.23.14.13.41 (version=SSLv3 cipher=RC4-MD5); Thu, 23 Jul 2009 14:13:42 -0700 (PDT) Message-ID: <4A68D2A6.8000304@gmail.com> Date: Fri, 24 Jul 2009 00:14:14 +0300 From: Toni Spets User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: tecgraf.puc-rio.br domain unavailable References: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> In-Reply-To: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: paul.hermeneutic@gmail.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean paul.hermeneutic@gmail.com wrote: > The LuaBinaries page at: > > http://luabinaries.luaforge.net/ > > provides an email address: > > scuri-NO-SPAM-PLEASE@tecgraf.puc-rio.br > > which does not appear to work. Yes, I removed the "-NO-SPAM-PLEASE" > portion of the address. In return, I received: > > Technical details of permanent failure: > DNS Error: Domain name not found > > Is this domain still active? > The DNS servers seem to be b0rked. vialactea.rdc.puc-rio.br works exu.inf.puc-rio.br returns SERVFAIL calisto.rdc.puc-rio.br works guanabara.rederio.br returns a list of the other DNS servers Your ISP has cached the SERVFAIL status or something so the domain is not resolving for you. It's a problem at PUC-RIO. -- Toni Spets From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 18:33:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NLX74s030897; Thu, 23 Jul 2009 18:33:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA9C19295; Thu, 23 Jul 2009 18:32:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0767919271 for ; Thu, 23 Jul 2009 18:32:39 -0300 (BRT) Received: from braque.tecgraf.puc-rio.br (braque [10.0.8.46]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NLWbW9030836 for ; Thu, 23 Jul 2009 18:32:37 -0300 Received: by braque.tecgraf.puc-rio.br (Postfix, from userid 48) id 3A7F6A004A; Thu, 23 Jul 2009 18:32:37 -0300 (BRT) Received: from 189.60.135.105 (SquirrelMail authenticated user scuri) by webmail.tecgraf.puc-rio.br with HTTP; Thu, 23 Jul 2009 18:32:37 -0300 (BRT) Message-ID: <1887.189.60.135.105.1248384757.squirrel@webmail.tecgraf.puc-rio.br> In-Reply-To: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> References: <4a89b8680907231331j46597b6av4565b398e81ea1cf@mail.gmail.com> Date: Thu, 23 Jul 2009 18:32:37 -0300 (BRT) Subject: Re: tecgraf.puc-rio.br domain unavailable From: scuri@tecgraf.puc-rio.br To: "Lua list" User-Agent: SquirrelMail/1.4.8-5.el4_7.3 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br The funny thing is that I got all the messages from this thread... Best. scuri > The LuaBinaries page at: > > http://luabinaries.luaforge.net/ > > provides an email address: > > scuri-NO-SPAM-PLEASE@tecgraf.puc-rio.br > > which does not appear to work. Yes, I removed the "-NO-SPAM-PLEASE" > portion of the address. In return, I received: > > Technical details of permanent failure: > DNS Error: Domain name not found > > Is this domain still active? > From lua-bounces@bazar2.conectiva.com.br Thu Jul 23 19:29:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6NMTF5F005740; Thu, 23 Jul 2009 19:29:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47E1619291; Thu, 23 Jul 2009 19:28:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.c.painless.aaisp.net.uk (b.c.painless.aaisp.net.uk [81.187.30.63]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 940CB1924D for ; Thu, 23 Jul 2009 19:28:41 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MU6m9-0005FE-2N for lua@bazar2.conectiva.com.br; Thu, 23 Jul 2009 23:28:33 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 5F2BF1E0F7 for ; Thu, 23 Jul 2009 23:28:30 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:48407 with envelope Message-ID: <4A68E40D.9090805@cowlark.com> Date: Thu, 23 Jul 2009 23:28:29 +0100 From: David Given User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Lua Conference Bot 0.1 References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <4A683A71.30104@cowlark.com> <20090723181137.GD1849@aran> In-Reply-To: <20090723181137.GD1849@aran> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6NMTF5F005740 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Etan Reisner wrote: [...] > I would be very interested in this, people have often asked if they can > write protocol plugins in non-C languages and the official answer is "not > currently". By popular demand: http://www.cowlark.com/gaim-citadel I'd forgotten just how ancient it is (2006...); it uses Lua 5.0 and doesn't build any more because it needs gaim-dev. But at least it's available to study. Technically there's not much to it --- it uses tolua to bind a (large) subset of the gaim APIs. Most of the explicit C code is either setting up and destroying the Lua environment, stub functions that just call into Lua, or callbacks (Gaim was very callback-centric). On the Lua side of things, each socket gets its own coroutine, and a simple scheduler ensures that they all get a chance to read from their sockets whenever Gaim kicks the plugin. I only bother to yield during pending reads, assuming that writes will all happen quickly. I hope this is some use to someone! - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKaOQNf9E0noFvlzgRAjCrAJ9zjoBBatPlZ0x34tapeiF9yinSJQCeM7Us zuZlRd4Jt/fy74M4g2MuXmI= =2rRH -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 04:23:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6O7Ne31023096; Fri, 24 Jul 2009 04:23:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F0EF192A2; Fri, 24 Jul 2009 04:23:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 533651929C for ; Fri, 24 Jul 2009 04:23:00 -0300 (BRT) Received: by bwz6 with SMTP id 6so392470bwz.5 for ; Fri, 24 Jul 2009 00:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=OEYfOsxyPWnbTLe6nouaeSb+LDdlcDiFIAgkIUgNWvk=; b=hgbzc0yqqx2Mr/N0Pnaj51T/JNsqPEEW2v9Wa01Y7fzvYw8xBBKrjujBt3gc5Uoz/J 3HS0P7/v3cTRNMG/nheZLTtIUf5GEA2nGBenAdldlolnhVrcgpl+b9f2gA9ZxXMVD8nm aCvNh0GaxpZ0IM7GlnhSbW+VNMbnVW539JD58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=VQ6uEBpN7LO9U4WT7WdU1k/+YKbx2MfHUV+Fpz6wZVfgZ3jFUXTYAxgDXZUaKyUOfP UHHLWCRuKDQugOjnAstFvcqjZCfhnsjEiQTrcYp9bs2de0pluFeQD1ITZlyPws+3sSj7 ofWIy9W87ZaPU0dnHwr5EhRldqU0dAnaGJ8A4= MIME-Version: 1.0 Received: by 10.239.168.6 with SMTP id i6mr314927hbe.85.1248420178133; Fri, 24 Jul 2009 00:22:58 -0700 (PDT) In-Reply-To: <4A68E40D.9090805@cowlark.com> References: <379686bd0907211452u7a4d597et9d5f1389f2fb565d@mail.gmail.com> <4A66DDB5.4050604@cowlark.com> <379686bd0907220310y6fc180f4q502b6dce7d3b8bd6@mail.gmail.com> <20090722212408.GZ1849@aran> <4A683A71.30104@cowlark.com> <20090723181137.GD1849@aran> <4A68E40D.9090805@cowlark.com> Date: Fri, 24 Jul 2009 08:22:58 +0100 Message-ID: <379686bd0907240022q6e1ba025o3012b8a6f6e01739@mail.gmail.com> Subject: Re: [ANN] Lua Conference Bot 0.1 From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 23, 2009 at 11:28 PM, David Given wrote: > By popular demand: > > http://www.cowlark.com/gaim-citadel Thank you for this. Hoping to learn from it. Ashish From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 07:10:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6OAAunh004186; Fri, 24 Jul 2009 07:10:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E231B18D70; Fri, 24 Jul 2009 07:10:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4301718CDD for ; Fri, 24 Jul 2009 07:10:18 -0300 (BRT) Received: by ewy26 with SMTP id 26so1637489ewy.5 for ; Fri, 24 Jul 2009 03:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Q/lkXzwdUjBtQ1GKDuDgp7cBhKr6gvdscBNByi5dUMM=; b=ZQHica3QC2XojjnJ+ai+QvUcn1iotBuIXJEmH3cxAWKPgPIGDgaotBtnroOAToRJWo 8rRMza+x9V9WeWtKI7H4bj2BCXN8JJ/1w91aEyP24SrERJlRVBCGegSyDQ/q3bauMIy5 Blv1fbdRyft35P+xXpvgyAF96SyoxVkRZk6/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=rhFjL9BDwkphdnyUg9nYrhmEST09HnD5AYBuHTUOhTlhlPaQAgJ1FAprJOaID/THzV agZfGrH9g4tx/Iljo/HxARV7QLllkbSMyU1oUNsAdPYsx6/HBzltXpabwkRfDq9vZrvN M9fRk+VPN4p0FtyEzQI2Ugu95x1uLlaFFDH+8= MIME-Version: 1.0 Received: by 10.216.20.210 with SMTP id p60mr951684wep.172.1248430216139; Fri, 24 Jul 2009 03:10:16 -0700 (PDT) In-Reply-To: <4D6EB001315D4F569D614DFCBF062521@VADER> References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER> <89d273ba0907230543v54603e9av7edb1825a4768a04@mail.gmail.com> <4D6EB001315D4F569D614DFCBF062521@VADER> From: Jerome Vuarand Date: Fri, 24 Jul 2009 12:09:56 +0200 Message-ID: <89d273ba0907240309kb3b9ee0r594a3691dc189f26@mail.gmail.com> Subject: Re: Direct Memory Access to Lua variables? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/23 b's spam : > I'm not too sure how to use the index/newindex metamethods for what I'm > trying to do. Are there examples of this somewhere? Here is an (untested) example of what you can do (I used the prototype of the classes you used in your example) : template int index(lua_State* L); template <> int index(lua_State* L); { bool* ptr = (bool*)lua_touserdata(L, 1); lua_pushboolean(L, *ptr ? 1 : 0); return 1; } template <> int index(lua_State* L); { float* ptr = (float*)lua_touserdata(L, 1); lua_pushnumber(L, *ptr); return 1; } template int newindex(lua_State* L); template <> int newindex(lua_State* L); { bool* ptr = (bool*)lua_touserdata(L, 1); *ptr = lua_toboolean(L, 3)!=0; return 0; } template <> int newindex(lua_State* L); { float* ptr = (float*)lua_touserdata(L, 1); if (!lua_isnumber(L, 3)) return luaL_error(L, "new value must be a number"); *ptr = (float)lua_tonumber(L, 3); return 1; } template struct LuaValue { lua_State* L; std::string name; T* ptr; LuaValue(lua_State* _L, std::string _name) : L(_L) , name(_name) , ptr(0) { ptr = lua_newuserdata(L, sizeof(T)) *ptr = T(); lua_createtable(L, 0, 2); lua_pushcfunction(L, index); lua_setfield(L, -2, "__index"); lua_pushcfunction(L, newindex); lua_setfield(L, -2, "__newindex"); lua_setmetatable(L, -2); lua_setglobal(L, name.c_str()); } ~LuaValue() { lua_pushnil(L); lua_setglobal(L, name.c_str()); ptr = 0; L = 0; } LuaValue& operator=(const T& value) { *ptr = value; return *this; } operator T() { return *ptr; } } typedef LuaValue LuaFloat; typedef LuaValue LuaBool; LuaBool myBool ( lua_state, "boolvar_in_script" ); LuaFloat myValue ( lua_state, "floatvar_in_script" ); for loop() { myBool = false; // write to variable myValue= 1.25f; // faster access: bool* pBool = myBool.ptr; float* pValue = myValue.ptr; *pBool = false; // write to variable *pValue= 1.25f; bool tmpBoolean = myBool; // read from variable } And from the Lua side, you can do: if boolvar_in_script.value then floatvar_in_script.value = 42 end From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 08:34:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6OBYTfS011869; Fri, 24 Jul 2009 08:34:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72B0518C57; Fri, 24 Jul 2009 08:33:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4F0018BFD for ; Fri, 24 Jul 2009 08:33:51 -0300 (BRT) Received: by bwz6 with SMTP id 6so506465bwz.5 for ; Fri, 24 Jul 2009 04:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=bgrIH3saZZo712qAA3R8+3TyhOWOOP8GUbdG495y61Y=; b=d3j2xxTWAMl0oI3CxMUyDb0A+vvhfdvhVSpXUW8OAwRo//hP3D4+U9Wn4Lv3Mi+wl4 9Zn2DwRkBWnlAOanvcXKXtp5tYjP07X+yEWJDuse577fT4BqrvNGfLVrlGisYvfyJ/br rBb9PT+psuKEmxMq8LhPUSBbZHnm6iB4Liv6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=U4QMHv4rlYSi6BKESIEkrpTfi2vEiBTn4PBmk/zQlXrXymBDnrsll/GAItGhfu2BzC HDwMBVWJnf/PSnyEJAiDlJZRf045+AaYPJFgq6eNMN0UdhxZjDak9RpEIDVcP0mXpJPi CXFy7u+VuIsrtVidWX8LrZX8Z7N2dS2L2oYjM= MIME-Version: 1.0 Received: by 10.103.12.2 with SMTP id p2mr1684030mui.70.1248435229520; Fri, 24 Jul 2009 04:33:49 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 Jul 2009 07:33:49 -0400 X-Google-Sender-Auth: 82e57998b660a552 Message-ID: Subject: tables holding nil: another way to look at the question itself From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei wrote: > Just found out that the __index metamethod is called for x=a[nil], but > __newindex is not called for a[nil]=x -- instead the operation is > specifically forbidden. I'd rather have it called too and not throw an > error. What am I missing? I suspect, but have not verified, that (1) any value received by __newindex as its first argument (index) is a value which will not cause rawset to throw an error when passed to rawset as its second argument (index); and (2) any value received by __index is a value which will not cause rawget to throw an error when passed to rawget as its second argument (index). But that observation does not address your question, which has two parts: What should a[nil]=x do? and What should x=a[nil] do? The first question is easy, since Lua forbids nil as a table index. Semantically, a[k] on the left side of an assignment statement must denote a location in the "store" (storage, i.e. memory). Since a[nil] does not denote a location, the assignment cannot be accomplished. An error must be thrown. The second question verges on the meta-physical. In an expression, a[k] denotes the value in the store at a particular location. But a[nil] is not a valid location, so it makes no sense to ask "What is the value stored in this non-existent location, a[nil]?" When a question makes no sense, does it matter what the answer is? (What is the sound of one hand clapping?) A language designer can rule it illegal to even ask the question, e.g. Scheme forbids asking (car '()). Or, an arbitrary answer can be defined because it is convenient, e.g. in Lisp (car nil) is nil. In Lua, the non-sensical expression a[nil] is simply defined to be nil, for any table a. (Compare to how 0! can be, and is, defined to be 1 for convenience, when in fact it makes no sense to ask "what is the value of 0!" when factorial is defined as n!=(n)(n-1)...1.) If we were to write a formal semantics for Lua, we could describe the table index operator [] as a partial function from the domain of all Lua values to locations in the store when a[k] is the left side of an assignment (partial because nil and NaN do not map to locations). And we could describe the same operator [] as a total function from Lua values to Lua values when a[k] appears in an expression. This corresponds to an intuitive definition such as this one: "The expression a[k] returns what is in table a at index k. Since nil is an illegal index, there can be no value stored at a[nil], and 'no value' in Lua is represented by nil. So, a[nil]==nil." If you have read this far, you are a patient person. This is my first post to the Lua mailing list, provoked by Cosmin's interesting observation. I have possibly violated the norm here, which seems to be short posts. Apologies to all if this is the case. --Jim Jennings From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 10:25:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ODPlww031259; Fri, 24 Jul 2009 10:25:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13CC91A67A; Fri, 24 Jul 2009 10:25:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A54D51A670 for ; Fri, 24 Jul 2009 10:25:11 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so787937qwi.11 for ; Fri, 24 Jul 2009 06:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=r+fvHh4v8edLFrxwst3obRYnKCKnuur0MHv1XTqFJYk=; b=X+j19eprAOJ6/6EU50eJamtP2Ffe4L4H+Kz0NJ//i+C0yM16DAcnmGbzJ5jW95ow3A XbYItc4PV0hzJNQ/rUQzEKcs+Wwzx0lSO1sSAqNA0/ybi6aW1sW5GlaK6kpZluqGAx62 UqqwxXgerkd+xNmcMVBppXuvfukaQRkuj+9/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=byKbztc9NO8EasYNIGuv1WN8eTBIhXUDEE87GqfKKBchWADdvQvK8LTFWKMSbjT9I3 RDnSN8TGgtReTsp+bdxoe2m/4FuOM21bNJ+P5/IRh62Qw72Pk4Pr4c2jluvnG7KwWrxT n/jGlMQXnlK2D+BTFx4gvmXoNKAvLSNFyI9p4= MIME-Version: 1.0 Received: by 10.231.37.141 with SMTP id x13mr1193300ibd.39.1248441910400; Fri, 24 Jul 2009 06:25:10 -0700 (PDT) Date: Fri, 24 Jul 2009 10:25:10 -0300 Message-ID: Subject: Lua incremental parser From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= To: Lua list Content-Type: multipart/alternative; boundary=0003255769469798d6046f7388f1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255769469798d6046f7388f1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, folks I need to write a lua-based Parser that can build and repair a Lua AST for the LuaEclipse project. Although is relatively easy to create parsers with LPEG, error-detection an= d 'online' matching is a pain. Besides, I am not familiar with all the issues of this particular problem, so I am looking for examples. Therefore, I wonder if anyone has ever written an incremental parser for Lu= a that I could use as a reference. Interesting papers on the subject are welcome too. Thanks in advance! Lu=EDs Eduardo Jason Santos --0003255769469798d6046f7388f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, folks

I need to write a lua-based Parser that can build and repa= ir a Lua AST for the LuaEclipse project.

Although is relatively eas= y to create parsers with LPEG, error-detection and 'online' matchin= g is a pain.

Besides, I am not familiar with all the issues of this particular probl= em, so I am looking for examples.

Therefore, I wonder if anyone has = ever written an incremental parser for Lua that I could use as a reference.=

Interesting papers on the subject are welcome too.

Thanks in adv= ance!

Lu=EDs Eduardo Jason Santos
--0003255769469798d6046f7388f1-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 11:16:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6OEG0iS010103; Fri, 24 Jul 2009 11:16:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEDFC1894D; Fri, 24 Jul 2009 11:15:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f207.google.com (mail-ew0-f207.google.com [209.85.219.207]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1721187E4 for ; Fri, 24 Jul 2009 11:15:25 -0300 (BRT) Received: by ewy3 with SMTP id 3so1739558ewy.7 for ; Fri, 24 Jul 2009 07:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=wKlUuFKSItJsYf9R5NCvx6RTVIfYFMDw2bMOae4wli8=; b=Hi4pA/BdE/yRPhP5SknXzUo1SfG4RyfOb1tjcJLzFBEKjHDmbYJprRadoMnZ7VGk+u 3pTPP4U2mSvr6vOFzpCu6Qy5R9wCEMCMlMV9FwjS8Q7LMy+ML6tskAJT+A0Po3r/VcvE oVpDwhqcj7PfqHqUu2hbSlae1IdxYcaS8x1BE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=ur6LpvLqqtJoWYiuIZK77hZeF9LVa+cUjvb1g/k6e1Eyu5/VQJgF5E95QjlmCXfOF+ aUz0WIIf2DfUns3smkz0vOw5/7nXbaiSGOXMiPwpjw/2FQKkBjp3/znkGeD5sSwDl0qb B+6cFoyoOMSAMor9vNTgY9k0GfPkJ1xSU7xe0= MIME-Version: 1.0 Received: by 10.216.53.207 with SMTP id g57mr1038739wec.3.1248444924132; Fri, 24 Jul 2009 07:15:24 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Fri, 24 Jul 2009 16:15:04 +0200 Message-ID: <89d273ba0907240715y28ce73c8q61092c4a0a57ace4@mail.gmail.com> Subject: Re: tables holding nil: another way to look at the question itself To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/24 Jim Jennings : > Cosmin Apreutesei wrote: > > [...] > > This corresponds to an intuitive definition such as this one: "The > expression a[k] returns what is in table a at index k. Since nil is > an illegal index, there can be no value stored at a[nil], and 'no > value' in Lua is represented by nil. So, a[nil]==nil." You can always turn the problem one way or the other to have your prefered solution look more or less natural. For me Lua tables are infinite sets of key-value pairs, with any Lua object associated with another one. And I'm just considering the pair with nil as key is a read-only pair. For consistency I'd rather have it writable, but the guarantee that the value nil is always associated to the key nil simplifies a lot some other uses of tables (eg. iteration over pairs with a non-nil value, which is a frequent operation). From lua-bounces@bazar2.conectiva.com.br Fri Jul 24 12:38:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6OFcNNE030062; Fri, 24 Jul 2009 12:38:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 315DE18B9F; Fri, 24 Jul 2009 12:37:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0185818B12 for ; Fri, 24 Jul 2009 12:37:48 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 2DBA53BD0EE for ; Fri, 24 Jul 2009 11:37:45 -0400 (EDT) Received: from web7.messagingengine.com ([10.202.2.216]) by compute1.internal (MEProxy); Fri, 24 Jul 2009 11:37:45 -0400 Received: by web7.messagingengine.com (Postfix, from userid 99) id 061004A949; Fri, 24 Jul 2009 11:37:45 -0400 (EDT) Message-Id: <1248449864.31589.1326632269@webmail.messagingengine.com> X-Sasl-Enc: I/jA3mJY7b4fUNlo2ZOO60xvi9cexRJYAoH84Ya9cP6N 1248449864 From: "V S P" To: "Lua list" Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="_----------=_1248449864315896" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: References: Subject: Re: Lua incremental parser Date: Fri, 24 Jul 2009 11:37:44 -0400 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --_----------=_1248449864315896 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface Date: Fri, 24 Jul 2009 15:37:44 UT Although metalua (http://metalua.luaforge.net/) would error out when given incorrect Lua syntax, may be modifying/relaxing its internals is the right approach for you (perhaps creating another 'token' type indicating possibly incorrect syntax ) On Fri, 24 Jul 2009 10:25 -0300, "Lu=C3=ADs Eduardo Jason Santos" wrote: Hi, folks I need to write a lua-based Parser that can build and repair a Lua AST for the LuaEclipse project. Although is relatively easy to create parsers with LPEG, error-detection and 'online' matching is a pain. Besides, I am not familiar with all the issues of this particular problem, so I am looking for examples. Therefore, I wonder if anyone has ever written an incremental parser for Lua that I could use as a reference. Interesting papers on the subject are welcome too. Thanks in advance! Lu=C3=ADs Eduardo Jason Santos --=20 Vlad P author of C++ ORM http://github.com/vladp/CppOrm/tree/master --=20 http://www.fastmail.fm - Faster than the air-speed velocity of an=0D unladen european swallow --_----------=_1248449864315896 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface Date: Fri, 24 Jul 2009 15:37:44 UT =0D

Is there a standard calling convention for building the= Lua DLL on Windows?  The Lua DLLs I’ve seen from a couple of projects= are not using the __cdecl convention.  Is the standard __stdcall?  Is there a standard?

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, i= s for the sole use of the intended recipient(s) and may contain information= that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized= review, use, disclosure or distribution is prohibited. If you are not the i= ntended recipient, immediately contact the sender by reply e-mail and destro= y all copies of the original message.

--_000_85861A744C29EA46BFD9BB61889AE59D3CB1704657KLMExchklmicr_-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:12:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGC79E003728; Mon, 27 Jul 2009 13:12:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28CF7190AC; Mon, 27 Jul 2009 13:11:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4520418C23 for ; Mon, 27 Jul 2009 13:11:27 -0300 (BRT) Received: by fxm25 with SMTP id 25so2884254fxm.5 for ; Mon, 27 Jul 2009 09:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mQQud/Id4g/nynDrwTxuJKzDypWEOWbrkkslbxFmB6I=; b=BwTt6dEeS9SE/ZkOB79pEfkHGPKo1kQmJ//Wo917+ByeAamTUihaxu8I6PePfzs7sP um3EOC73sBaHTobSqOLPbnBq8p0Jy4oRKwbam3f0jzFuu6rHgVDzbwkfGVH090gpvhny ilOed5hE/52IvsU8xCcwLkHqnisN6Kyi36a1M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=V52l8fK5lNQztIYwb0tw2pmxVw9boDnW6WlvLz4qjb+fAhHDpbJj5Qbo82S8gk9TcH mc+KB2Fq1fWAP89stGgc4lJiJfsJHomyilZD3DfLb+FeJ/zsp10pTqa6LGddgwBLut/S NH3TymqqDJeLFqMyG+IHxW1PxaxPtL7XU6Ajw= MIME-Version: 1.0 Received: by 10.239.146.212 with SMTP id x20mr695629hba.97.1248711084975; Mon, 27 Jul 2009 09:11:24 -0700 (PDT) In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> Date: Mon, 27 Jul 2009 18:11:24 +0200 Message-ID: <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> Subject: Re: Standard calling convention on Windows? From: steve donovan To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6RGC79E003728 On Mon, Jul 27, 2009 at 5:37 PM, King, Mike wrote: > Is there a standard calling convention for building the Lua DLL on Windows? > The Lua DLLs I’ve seen from a couple of projects are not using the __cdecl > convention. Is the standard __stdcall? Is there a standard? They are exported as just plain cdecl C functions. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:19:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGJ2iB005276; Mon, 27 Jul 2009 13:19:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F35C01911E; Mon, 27 Jul 2009 13:18:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com [209.85.211.197]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DB6E19092 for ; Mon, 27 Jul 2009 13:18:31 -0300 (BRT) Received: by ywh35 with SMTP id 35so835049ywh.11 for ; Mon, 27 Jul 2009 09:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=IZWGwP6+uliTW/4nV5Y8tS7jdiPwOmDgG8Dw0BWt7nE=; b=SNRE8QfFZekXR4LIR274dMpwwRkEQQiBw4IpnlODkUUBkxzkRb8bxCphU+NERkm8uD qe4bkkAymbjT2khskDjel2ZXKhCm1Mjkmv5gufdMA8ZE9BX+0DwU0Nm4iVbS+7XG+FNr sMEE0VfgTRXipnqN4x0+mvUfvno65Tk5rpbOI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=QJCwLrl3s2lEApfLE8YGLcYol4IalsdEEiCJOvMTuCKYWOJLFPvUE6pyfzA3yRKZdx 0MZlzOb5eec2Xy+Q8KmQjp1k9Y6+IPwxEo+LzLZ+nGz5RVEkNeT5AkWmt0cEvvC4NbvW 8cbrREehK5VHn8DlNjrR8REJLGJzsaNdEHpa8= MIME-Version: 1.0 Received: by 10.151.108.10 with SMTP id k10mr12459496ybm.107.1248711075044; Mon, 27 Jul 2009 09:11:15 -0700 (PDT) In-Reply-To: <20027697-0E04-4EB2-A564-13BA1C777CE1@burninglabs.com> References: <8a25d01b0907261419g74924c94x8011257c583c0ea8@mail.gmail.com> <7913df4d0907261836u665cd7fft124f5bb8472101ff@mail.gmail.com> <20027697-0E04-4EB2-A564-13BA1C777CE1@burninglabs.com> Date: Mon, 27 Jul 2009 13:11:15 -0300 X-Google-Sender-Auth: f77285b35545a3b1 Message-ID: <7913df4d0907270911q330e9365nd80c2d1e57fab893@mail.gmail.com> Subject: Re: can alien callbacks receive pointers (and then pass them to C functions)? From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 2:17 AM, Phoenix Sol wrote: > >> Are you using the "pointer" type in both the callback's and the C >> function's signatures? > > Yes, Fabio. You seem to imply that it should work; perhaps I have overlooked > something. > > In my callback function, should type(my_pointer_arg) == 'userdata'? Yep, it should be a light userdata, and is working for me. :-) Remember that the first type you pass to alien.callback is the return type, not the type of the first argument: function foo(ud) -- do something with userdata ud return 0 end foo_cb = alien.callback(foo, "int", "pointer") > Currently, it is 'number'. I'm certain that it should be receiving a > pointer. > > Thanks, > Phoenix Sol > -- Fabio Mascarenhas From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:33:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGWxnV007893; Mon, 27 Jul 2009 13:33:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCC20190D3; Mon, 27 Jul 2009 13:32:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38B0618B28 for ; Mon, 27 Jul 2009 13:32:28 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so726536eyd.11 for ; Mon, 27 Jul 2009 09:32:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.36.84 with SMTP id v62mr1815321wea.128.1248712346660; Mon, 27 Jul 2009 09:32:26 -0700 (PDT) In-Reply-To: <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> Date: Mon, 27 Jul 2009 17:32:26 +0100 X-Google-Sender-Auth: 7721d5711bd0da05 Message-ID: Subject: Re: Standard calling convention on Windows? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6RGWxnV007893 I'm not aware of any formal standard, though the de-facto standard is probably __cdecl. Given that some of the API functions have to be __cdecl due to variable argument lists, it makes sense to export all of them as __cdecl. Though as a counter-example, all of the (recent) games by Relic Entertainment use Lua via a DLL and export everything as __stdcall (apart from the aforementioned vararg functions). On Mon, Jul 27, 2009 at 5:11 PM, steve donovan wrote: > On Mon, Jul 27, 2009 at 5:37 PM, King, Mike wrote: >> Is there a standard calling convention for building the Lua DLL on Windows? >> The Lua DLLs I’ve seen from a couple of projects are not using the __cdecl >> convention.  Is the standard __stdcall?  Is there a standard? > > They are exported as just plain cdecl C functions. > > steve d. > From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:39:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGdqPE009252; Mon, 27 Jul 2009 13:39:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 259D719182; Mon, 27 Jul 2009 13:39:18 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B817F19176 for ; Mon, 27 Jul 2009 13:39:12 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so1509610qwi.11 for ; Mon, 27 Jul 2009 09:39:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.97.77 with SMTP id k13mr3775522vcn.30.1248712750964; Mon, 27 Jul 2009 09:39:10 -0700 (PDT) In-Reply-To: <7913df4d0907270911q330e9365nd80c2d1e57fab893@mail.gmail.com> References: <8a25d01b0907261419g74924c94x8011257c583c0ea8@mail.gmail.com> <7913df4d0907261836u665cd7fft124f5bb8472101ff@mail.gmail.com> <20027697-0E04-4EB2-A564-13BA1C777CE1@burninglabs.com> <7913df4d0907270911q330e9365nd80c2d1e57fab893@mail.gmail.com> Date: Mon, 27 Jul 2009 11:39:10 -0500 Message-ID: <8a25d01b0907270939y56afdb63n824d35d5cceee5d7@mail.gmail.com> Subject: Re: can alien callbacks receive pointers (and then pass them to C functions)? From: Phoenix Sol To: Lua list Content-Type: multipart/alternative; boundary=0016e6469018f29f74046fb29728 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6469018f29f74046fb29728 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Oh, now I'm embarrassed, and must apologize for noise... In my call to alien.callback, my type arguments were not strings :p foo_cb = alien.callback(foo, int, pointer) Duh. Next time I have a mysterious error, I will try getting some sleep before posting on a mailing list. I'm sorry for wasting your time :( Thanks, Phoenix Sol On Mon, Jul 27, 2009 at 11:11 AM, Fabio Mascarenhas wrote: > On Mon, Jul 27, 2009 at 2:17 AM, Phoenix Sol > wrote: > > > >> Are you using the "pointer" type in both the callback's and the C > >> function's signatures? > > > > Yes, Fabio. You seem to imply that it should work; perhaps I have > overlooked > > something. > > > > In my callback function, should type(my_pointer_arg) == 'userdata'? > > Yep, it should be a light userdata, and is working for me. :-) > Remember that the first type you pass to alien.callback is the return > type, not the type of the first argument: > > function foo(ud) > -- do something with userdata ud > return 0 > end > > foo_cb = alien.callback(foo, "int", "pointer") > > > Currently, it is 'number'. I'm certain that it should be receiving a > > pointer. > > > > Thanks, > > Phoenix Sol > > > > -- > Fabio Mascarenhas > --0016e6469018f29f74046fb29728 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oh, now I'm embarrassed, and must apologize for noise...

In my c= all to alien.callback, my type arguments were not strings=A0 :p
foo_cb = =3D alien.callback(foo, int, pointer)

Duh.=A0 Next time I have a mys= terious error, I will try getting some sleep before posting on a mailing li= st.
I'm sorry for wasting your time=A0 :(

Thanks,
P= hoenix Sol


On Mon, Jul 27, 2009 at 11:11 AM, Fabio = Mascarenhas <ma= scarenhas@acm.org> wrote:
On Mon, Jul 27, 2009 at 2:17 AM, Phoenix Sol<phoenix@burninglabs.com> wrote:<= br> >
>> Are you using the "pointer" type in both the callback= 9;s and the C
>> function's signatures?
>
> Yes, Fabio. You seem to imply that it should work; perhaps I have over= looked
> something.
>
> In my callback function, should type(my_pointer_arg) =3D=3D 'userd= ata'?

Yep, it should be a light userdata, and is working for me. :-)
Remember that the first type you pass to alien.callback is the return
type, not the type of the first argument:

function foo(ud)
=A0-- do something with userdata ud
=A0return 0
end

foo_cb =3D alien.callback(foo, "int", "pointer")

> Currently, it is 'number'. I'm certain that it should be r= eceiving a
> pointer.
>
> Thanks,
> Phoenix Sol
>

--
Fabio Mascarenhas

--0016e6469018f29f74046fb29728-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:45:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGj27X010364; Mon, 27 Jul 2009 13:45:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 165421911A; Mon, 27 Jul 2009 13:44:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C08718D42 for ; Mon, 27 Jul 2009 13:44:22 -0300 (BRT) X-AuditID: ac100205-000016a800000608-11-4a6dd95914c9 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Jul 2009 12:44:09 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Mon, 27 Jul 2009 12:44:09 -0400 From: "King, Mike" To: Lua list Date: Mon, 27 Jul 2009 12:44:07 -0400 Subject: RE: Standard calling convention on Windows? Thread-Topic: Standard calling convention on Windows? Thread-Index: AcoO19aLpfw8QmZwReiVhyCEQRnqRQAANYvQ Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6RGj27X010364 Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix. When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix. What am I missing? -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley Sent: Monday, July 27, 2009 12:32 PM To: Lua list Subject: Re: Standard calling convention on Windows? I'm not aware of any formal standard, though the de-facto standard is probably __cdecl. Given that some of the API functions have to be __cdecl due to variable argument lists, it makes sense to export all of them as __cdecl. Though as a counter-example, all of the (recent) games by Relic Entertainment use Lua via a DLL and export everything as __stdcall (apart from the aforementioned vararg functions). On Mon, Jul 27, 2009 at 5:11 PM, steve donovan wrote: > On Mon, Jul 27, 2009 at 5:37 PM, King, Mike wrote: >> Is there a standard calling convention for building the Lua DLL on Windows? >> The Lua DLLs I've seen from a couple of projects are not using the __cdecl >> convention.  Is the standard __stdcall?  Is there a standard? > > They are exported as just plain cdecl C functions. > > steve d. > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:45:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGjiUA010540; Mon, 27 Jul 2009 13:45:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCF47191C8; Mon, 27 Jul 2009 13:44:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B25819180 for ; Mon, 27 Jul 2009 13:44:33 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so728388eyd.11 for ; Mon, 27 Jul 2009 09:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=yQaykACAiWyBUCl+0VpA3TYrj1i8+NoIzjS2+WsbYZg=; b=XMXM7zNkkb6yi4l1XY3FNdUZkAeKT5IeENaV+wSNN5imTSV5hZ4fDNzbmyJ82dU0KW 8AqYgGuTiZHGMosm00BIErzQ2iCeuUjLoDOpZGYnQ0fGGboGVbkhVO6cY+4JxipZRzcT L3KvE0e1QthCoJl/kpOmXsGYSOpw4GLXhRlCE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=O0KulXSZ0cR7sv3ClFfOhyKOdZpcAncLBT8QFP7XiqFAzFAFiGQwm/qVMQLRIzgCTC n8eOnw86fe4tBY5FHhOmV6Y6T0M0kDlW1E32xO69cMXqtQTva/kwLL+KgB0AvG1OF3jb KPIz8GUsGKYjBpjlhvgnDvibE4gkNeE0Lz0vY= Received: by 10.216.39.80 with SMTP id c58mr1717254web.122.1248713069709; Mon, 27 Jul 2009 09:44:29 -0700 (PDT) Received: from ?124.13.58.65? ([124.13.58.65]) by mx.google.com with ESMTPS id 10sm21557eyz.1.2009.07.27.09.44.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Jul 2009 09:44:28 -0700 (PDT) Message-ID: <4A6DD96B.10502@gmail.com> Date: Tue, 28 Jul 2009 00:44:27 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] Squish References: <4db9cacb0907270650q159bba46w8c0845b9bc014731@mail.gmail.com> In-Reply-To: <4db9cacb0907270650q159bba46w8c0845b9bc014731@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew Wild wrote: > I'm introducing Squish, a quick tool I put together over the weekend > to package some libraries and applications (Prosody, etc.) I'm working > on: http://matthewwild.co.uk/projects/squish > [snip] > So here are some nice features of Squish... Nice work :-), feel free to use code from Yueliang and LuaSrcDiet. Picking names is not so easy with such a tool, because people might confuse it with classic data compression. However, there are only so much English words to use... Since LuaSrcDiet is more of the unsupported experimental software kind of thingy, I deliberately avoided single words, also to avoid polluting the Lua namespace too much. > Ideas for the future... There is also a small WoW niche where people want a LuaSrcDiet-like tool for simple obfuscation, as a mild deterrent against casual plagiarism. I think a project like yours can provide these users with a better tool than LuaSrcDiet. > In addition to the existing compression methods, it would be great to > add a 'gzip' method, whereby the script is compressed during squshing > and decompressed at runtime. The only reason I did not make such a > filter is that there appears to be no gzip /compression/ algorithm in > pure Lua. [snip] David Manura wrote something in Lua :-) http://lua-users.org/wiki/ModuleCompressDeflateLua gzip specifies a small header and packages deflated blocks. You can just stick to zlib, but gzip will enable users to use the gzip program, more portable that way. lzma is much better, it's turning into xz now, which may well be the next de-facto standard. > [snip] > Other ideas are welcome. I had fun building Squish, and I hope others > will have fun hacking on it too. If you have feature ideas that you would really like LuaSrcDiet to have, let me know and perhaps we can further improve that aspect of squish. Happy hacking! :-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:46:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGkL2w010707; Mon, 27 Jul 2009 13:46:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0819191C9; Mon, 27 Jul 2009 13:45:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78FCA191C9 for ; Mon, 27 Jul 2009 13:45:02 -0300 (BRT) Received: by bwz6 with SMTP id 6so1947080bwz.5 for ; Mon, 27 Jul 2009 09:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=EXzkfRqlLbv+V4KfxRvlTi7bgEKnUXK4upxhyz+IRnc=; b=tCfo4uqdpZxznbR13dVEe+xUrrH55swJgBpMnc8vA9K5cP+tNgU3pSeCadvQaIHCCr /GB10EbsHSJMrvREszSB5cBwlCGWvUr4Nk5nc/94K8eoVzJjeLgCciWrepJ4cmSyTK/0 h+c/nFR16J2mb9Sq3jDKNsmD+3lTkvkV0nbs8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=MlWsHC700tp+G2y6UIgrO3OCchkuZj3G8ep5IsZawjJakIiecowuA/EmTOj7MNaUgE UqqeoSkoqZNBCv6Pfe5/9OuQRg5LiGqcoK8uDAQTN9KsO+K2SLcpKej2yIkno3YOBS2o 1l35Z8W/ETVlk9Ldvb1oBeC7C1E3titUir8ac= MIME-Version: 1.0 Received: by 10.204.121.131 with SMTP id h3mr2640536bkr.172.1248713099329; Mon, 27 Jul 2009 09:44:59 -0700 (PDT) Date: Mon, 27 Jul 2009 17:44:59 +0100 Message-ID: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> Subject: development environment on mac osx From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, All. Sorry if this is off topic. I currently do all Lua development on a remote Arch Linux box. My personal machine is a Mac. Can people who have setup a Lua development environment to do Lua and C development share how/what their environment is setup? What tools do you use? Do you use MacPort? How do you setup to do Lua and C together. Do you use luarocks? Thank you. Ashish -- http://bitbucket.org/axhixh/lconfbot From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:48:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGmGiG011220; Mon, 27 Jul 2009 13:48:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A4E7191F0; Mon, 27 Jul 2009 13:47:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F231A1903D for ; Mon, 27 Jul 2009 13:47:46 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so728921eyd.11 for ; Mon, 27 Jul 2009 09:47:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.55.194 with SMTP id k44mr1767355wec.25.1248713265078; Mon, 27 Jul 2009 09:47:45 -0700 (PDT) In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> Date: Mon, 27 Jul 2009 17:47:45 +0100 X-Google-Sender-Auth: cf6e504d5641098e Message-ID: Subject: Re: Standard calling convention on Windows? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6RGmGiG011220 Your compiler's default calling convention? Microsoft Visual C++ creates projects with __cdecl as the default calling convention (or at least recent versions do), though I cannot speak for other compilers. On Mon, Jul 27, 2009 at 5:44 PM, King, Mike wrote: > Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix.  When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix.  What am I missing? > > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley > Sent: Monday, July 27, 2009 12:32 PM > To: Lua list > Subject: Re: Standard calling convention on Windows? > > I'm not aware of any formal standard, though the de-facto standard is > probably __cdecl. Given that some of the API functions have to be > __cdecl due to variable argument lists, it makes sense to export all > of them as __cdecl. Though as a counter-example, all of the (recent) > games by Relic Entertainment use Lua via a DLL and export everything > as __stdcall (apart from the aforementioned vararg functions). > > On Mon, Jul 27, 2009 at 5:11 PM, steve donovan wrote: >> On Mon, Jul 27, 2009 at 5:37 PM, King, Mike wrote: >>> Is there a standard calling convention for building the Lua DLL on Windows? >>> The Lua DLLs I've seen from a couple of projects are not using the __cdecl >>> convention.  Is the standard __stdcall?  Is there a standard? >> >> They are exported as just plain cdecl C functions. >> >> steve d. >> > > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. > From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:57:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGvWgF013217; Mon, 27 Jul 2009 13:57:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69DA919235; Mon, 27 Jul 2009 13:57:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6015C191D9 for ; Mon, 27 Jul 2009 13:57:05 -0300 (BRT) X-AuditID: ac100205-00000e2000000608-32-4a6ddc5653b7 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Jul 2009 12:56:54 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Mon, 27 Jul 2009 12:56:54 -0400 From: "King, Mike" To: Lua list Date: Mon, 27 Jul 2009 12:56:52 -0400 Subject: RE: Standard calling convention on Windows? Thread-Topic: Standard calling convention on Windows? Thread-Index: AcoO2fmDvMxxqozPTxuAIThKj/dv0gAAIqHg Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB17046B5@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6RGvWgF013217 The default is __cdecl. I'm now thinking "a C project" in C++Builder 2009 isn't really a C project. The following page shows the prefix is added or not added depending on the linkage. http://msdn.microsoft.com/en-us/library/zkwh89ks.aspx -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley Sent: Monday, July 27, 2009 12:48 PM To: Lua list Subject: Re: Standard calling convention on Windows? Your compiler's default calling convention? Microsoft Visual C++ creates projects with __cdecl as the default calling convention (or at least recent versions do), though I cannot speak for other compilers. On Mon, Jul 27, 2009 at 5:44 PM, King, Mike wrote: > Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix.  When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix.  What am I missing? > > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley > Sent: Monday, July 27, 2009 12:32 PM > To: Lua list > Subject: Re: Standard calling convention on Windows? > > I'm not aware of any formal standard, though the de-facto standard is > probably __cdecl. Given that some of the API functions have to be > __cdecl due to variable argument lists, it makes sense to export all > of them as __cdecl. Though as a counter-example, all of the (recent) > games by Relic Entertainment use Lua via a DLL and export everything > as __stdcall (apart from the aforementioned vararg functions). > > On Mon, Jul 27, 2009 at 5:11 PM, steve donovan wrote: >> On Mon, Jul 27, 2009 at 5:37 PM, King, Mike wrote: >>> Is there a standard calling convention for building the Lua DLL on Windows? >>> The Lua DLLs I've seen from a couple of projects are not using the __cdecl >>> convention.  Is the standard __stdcall?  Is there a standard? >> >> They are exported as just plain cdecl C functions. >> >> steve d. >> > > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 13:59:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RGxlND013974; Mon, 27 Jul 2009 13:59:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EBF619271; Mon, 27 Jul 2009 13:59:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9006619191 for ; Mon, 27 Jul 2009 13:59:20 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KNG00NKU9TP2Y40@asmtp014.mac.com> for lua@bazar2.conectiva.com.br; Mon, 27 Jul 2009 09:59:19 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> Subject: Re: development environment on mac osx Date: Mon, 27 Jul 2009 18:58:37 +0200 References: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Jul 27, 2009, at 6:44 PM, Ashish Shrestha wrote: FWIW. > What tools do you use? A text editor with Lua syntax highlight, e.g. SubEthaEdit [1] or TextMate [2]. > Do you use MacPort? No. > How do you setup to do Lua and C together. Text editor for Lua. Command line to compile C modules [3]. > Do you use luarocks? No. Cheers, -- PA. http://alt.textdrive.com/nanoki/ [1] http://www.codingmonkeys.de/subethaedit/ [2] http://macromates.com/ [3] http://dev.alt.textdrive.com/browser/lu/lub.lua From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 14:01:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RH1Q6O014580; Mon, 27 Jul 2009 14:01:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D185D1909C; Mon, 27 Jul 2009 14:01:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E02B018B51 for ; Mon, 27 Jul 2009 14:00:59 -0300 (BRT) Received: from [85.250.239.40] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KNG004NP9XI1G30@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Mon, 27 Jul 2009 20:00:54 +0300 (IDT) Date: Mon, 27 Jul 2009 20:00:54 +0300 From: Shmuel Zeigerman Subject: Re: Standard calling convention on Windows? In-reply-to: <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> To: Lua list Message-id: <4A6DDD46.7080502@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean King, Mike wrote: > Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix. When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix. What am I missing? With C++ Builder 5, in order to get rid of the underscore prefix, I add a .def file like that: mylib.def: EXPORTS luaopen_mylib = _luaopen_mylib -- Shmuel From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 14:12:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RHC4qR017114; Mon, 27 Jul 2009 14:12:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8709C1916D; Mon, 27 Jul 2009 14:11:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC24519143 for ; Mon, 27 Jul 2009 14:11:35 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 939428C9E7 for ; Mon, 27 Jul 2009 20:11:30 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A04B7390991; Mon, 27 Jul 2009 20:11:30 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 8AEE1158A74 for ; Mon, 27 Jul 2009 20:11:26 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <20090727085822.GV14561@pruts.nl> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: is it possible to make longjmp-free Lua? Date: Mon, 27 Jul 2009 20:11:26 +0300 References: <20090727085822.GV14561@pruts.nl> X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ico kirjoitti 27.7.2009 kello 11:58: > > * On 2009-07-27 Juris Kalnins wrote : > >> I'm thinking whether it is possible to modify Lua so that it >> doesn't do >> setjmp/longjmp stack unwinding. > > Just curious, what is your reason for needing this ? At least one potential use would be running Lua within CUDA (on GPU cores). However, there are also other limitations that may prove too hard (s.a. no recursive calls). -asko From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 14:15:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RHFEXE018069; Mon, 27 Jul 2009 14:15:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3631C1925F; Mon, 27 Jul 2009 14:14:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF82219178 for ; Mon, 27 Jul 2009 14:14:44 -0300 (BRT) Received: by bwz6 with SMTP id 6so1965734bwz.5 for ; Mon, 27 Jul 2009 10:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=WEeGkAn7dpq3atLvtNxB2nZcBHl7nAnigywWTrdAAUw=; b=hTG/OrbYH2kj4HHb9ioXLuQWYqSqcsh2bmX1+BiaKsS0sqV/gn22Y7MeRZZYDb+ax0 PByUcAYR/oUO6nriCN2s6zo8ZYt9YjHjqGakWZrZhc/t3L56FrwdSkNeCMhBeNdKoE0B A0gUhJln14ivtYZ1BtmaVIK58GoZwPjKJQ5XY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=DuLNktQd2xfTGoM0OHZfA5wFmGrkgunnteSYDVVVm1EXvvkBHOOcQBnRp3d2ql/n1f K738TkrCm3+4GYwOncROEvX4oqhyguWr2q4R8BPL4zp0jpzbMdwSXeJdqCCojrdS9soP ts+YuD+atNpXCnE03oSlyk0WlJr3hABpaTM40= MIME-Version: 1.0 Received: by 10.204.71.68 with SMTP id g4mr3364493bkj.81.1248714883192; Mon, 27 Jul 2009 10:14:43 -0700 (PDT) In-Reply-To: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> References: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> From: Hisham Date: Mon, 27 Jul 2009 14:14:23 -0300 Message-ID: <5e7d91620907271014l213d5fb1of0526b277cc1965@mail.gmail.com> Subject: Re: development environment on mac osx To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 1:44 PM, Ashish Shrestha wrote: > Hi, All. > > Sorry if this is off topic. I currently do all Lua development on a > remote Arch Linux box. My personal machine is a Mac. Can people who > have setup a Lua development environment to do Lua and C development > share how/what their environment is setup? > > What tools do you use? Do you use MacPort? How do you setup to do Lua > and C together. Do you use luarocks? In my Mac system, I installed the Dev Tools from the OSX discs, and then did a vanilla build of Lua (installing it under /usr/local). Since I do LuaRocks development, I have a copy of LuaRocks svn installed under my $HOME, but you can also run a vanilla build of LuaRocks ( ./configure && make && make install ) and it will install under /usr/local as well. More info here: http://lua-users.org/lists/lua-l/2009-06/msg00480.html -- Hisham From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 14:39:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RHdLcf023677; Mon, 27 Jul 2009 14:39:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67A0D19189; Mon, 27 Jul 2009 14:38:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA7618814 for ; Mon, 27 Jul 2009 14:38:53 -0300 (BRT) Received: by fxm25 with SMTP id 25so2940482fxm.5 for ; Mon, 27 Jul 2009 10:38:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.116.15 with SMTP id k15mr3341060bkq.111.1248716330436; Mon, 27 Jul 2009 10:38:50 -0700 (PDT) In-Reply-To: References: <7913df4d0907261834i1a6f9d1cxe8e8133e28bf15d7@mail.gmail.com> Date: Mon, 27 Jul 2009 20:38:50 +0300 X-Google-Sender-Auth: 84891a9b121fb5d1 Message-ID: Subject: Re: alien question: how to get the address of a buffer object? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> BTW, have you thought about using a buffer instead of struct.pack? Oh, also support for unsigned types would be nice (really important for some libraries with lots of ushorts, eg. firebird). And some way to get a slice off a buffer as a substring, i.e. add length to buffer:get() and buffer:set() for type 'string'. Easy to ask for stuff, eh? :) From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 15:36:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RIafsV004727; Mon, 27 Jul 2009 15:36:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 849871916D; Mon, 27 Jul 2009 15:35:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.f9e.com (webmail.f9e.com [207.170.252.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E35101909C for ; Mon, 27 Jul 2009 15:35:45 -0300 (BRT) Received: from npbmail01.F9.internal ([10.8.0.25]) by webmail.f9e.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Jul 2009 11:35:36 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA0EE9.0890E82B" Subject: Table cache Date: Mon, 27 Jul 2009 11:35:34 -0700 Message-ID: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Table cache Thread-Index: AcoO6Qclrddi8NO8TLiIysP9OavBpA== From: "Brian Weed" To: X-OriginalArrivalTime: 27 Jul 2009 18:35:36.0654 (UTC) FILETIME=[088456E0:01CA0EE9] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA0EE9.0890E82B Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is there a way to cache/re-use tables automatically behind the scenes? =20 This is what I want to do: =20 function foo() local t =3D ObjectFactory() - This function returns tables (from a pool of reusable tables, or new table if pool is empty) ... -- use 't' ... -- When 't' goes out of scope, (i.e. no more refs to it) I want it to automatically be added back into the pool for re-use.=20 -- 't' may be passed to other functions (or returned from this function), so I can't just place it back into the cache manually at the end of this function. end =20 I was hoping that when someone wants a "new" object, I could remove it from the pool of unused objects, and add it to a table of weak references to "used" objects before I give it to the user. If there was a way for me to be notified when the object has no more strong refs to it, I could move it back into the pool (before its actually garbage collected). It seems that I can't use __gc to do this, since that only gets called for userdata (not tables), and may be too late. =20 The problem I'm trying to solve is that the programmers on this project have written lots of code that is constantly creating way too many temporary objects, which bogs down the memory manager (causes low frame rates, and choppiness). =20 I would like to solve this problem automatically in one spot, at all possible (auto cache these objects, and reuse them), so that we don't have to modify all the places that cause this. =20 I'm thinking that maybe this can't be done. Perhaps there would be too many side effects to resurrecting the object. =20 Thanks. =20 Brian ------_=_NextPart_001_01CA0EE9.0890E82B Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Is there a way to cache/re-use tables automatically = behind the scenes?

 

This is what I want to = do:

 

function foo()

    local t =3D ObjectFactory() = – This function returns tables (from a pool of reusable tables, or new table if pool is = empty)

    = …

    -- use = ‘t’

    = …

-- When ‘t’ = goes out of scope, (i.e. no more refs to it) I want it to automatically be added = back into the pool for re-use.

-- ‘t’ may be = passed to other functions (or returned from this function), so I can’t just = place it back into the cache manually at the end of this = function.

end

 

I was hoping that when someone wants a = “new” object, I could remove it from the pool of unused objects, and add it to = a table of weak references to “used” objects before I give it to the = user.

If there was a way for me to be notified when the = object has no more strong refs to it, I could move it back into the pool (before = its actually garbage collected).  It seems that I can’t use __gc = to do this, since that only gets called for userdata (not tables), and may be too = late.

 

The problem I’m trying to solve is that the programmers on this project have written lots of code that is constantly = creating way too many temporary objects, which bogs down the memory manager = (causes low frame rates, and choppiness).

 

I would like to solve this problem automatically in = one spot, at all possible (auto cache these objects, and reuse them), so that we = don’t have to modify all the places that cause = this.

 

I’m thinking that maybe this can’t be = done.  Perhaps there would be too many side effects to resurrecting the = object.

 

Thanks.

 

Brian

------_=_NextPart_001_01CA0EE9.0890E82B-- From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 16:11:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6RJBgdG012271; Mon, 27 Jul 2009 16:11:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9D1C190D1; Mon, 27 Jul 2009 16:11:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp145.mail.mud.yahoo.com (smtp145.mail.mud.yahoo.com [209.191.106.56]) by bazar2.conectiva.com.br (Postfix) with SMTP id B260C18D64 for ; Mon, 27 Jul 2009 16:10:58 -0300 (BRT) Received: (qmail 7727 invoked from network); 27 Jul 2009 19:10:55 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:User-Agent; b=UiMOveFC07+Grc6pjXZAzouUg6/TXCEphVv2ogmlb/da7F2VQtaSjIBDDKCb0ttw9XZ3f5jU4skqzKphPnILNSqTWtOYYgGtw1SWuFexhk+ClrU93wlHBCZyfEfhSi1KNxLjnIkbJJ9+toDeb8OtIMeFtPTbYeWHij7bpfAROSQ= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.169.100 with login) by smtp145.mail.mud.yahoo.com with SMTP; 27 Jul 2009 19:10:54 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: 7ToulE0VM1l0CB3gtsaw8eyg4UsqpanHEdLh8RvZfww.pHnjuFzQFMIx4K42AcMr0gjGaeDpjOhq9uei59wXMd5KojEq846vJABhaQrJ3AGftngFnNFaU_1DyYFOk5zvJMvFJY25pUnkdaMTtyP6250MYUl59CUVT8MHhrEu9kTblz3_rRGbEJAoet4cVUcZXF2kIJX8X5yottjU4wWqwPBaXRSlLzGbovaqQJ8xqGaNk2Iu_.HtjjNFN0Kz.i.6biKopgwYicKuamqESpQSu0E46WQ1yw0yciIX13bS67tb2of7QHvv X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id 5B7A280856; Mon, 27 Jul 2009 19:50:29 +0200 (CEST) Date: Mon, 27 Jul 2009 19:50:28 +0200 From: Martin To: Lua list Subject: error while compiling nixio Message-ID: <20090727175027.GA2674@alfa.qvirt.zxc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean While compiling nixio I got this error: It seems it can not find 'splice' function and related macros. I have Debian etch installed. Maybe I need to install some additional headers file - from which package? gcc -O2 --std=gnu99 -Wall -Werror -pedantic -I/usr/include/lua5.1 -fPIC -c -o src/splice.o src/splice.c cc1: warnings being treated as errors src/splice.c: In function ‘nixio_splice’: src/splice.c:84: warning: implicit declaration of function ‘splice’ src/splice.c: In function ‘nixio_splice_flags’: src/splice.c:104: error: ‘SPLICE_F_MOVE’ undeclared (first use in this function) src/splice.c:104: error: (Each undeclared identifier is reported only once src/splice.c:104: error: for each function it appears in.) src/splice.c:106: error: ‘SPLICE_F_NONBLOCK’ undeclared (first use in this function) src/splice.c:108: error: ‘SPLICE_F_MORE’ undeclared (first use in this function) Martin From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 22:36:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S1akPn007774; Mon, 27 Jul 2009 22:36:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5DB3191C8; Mon, 27 Jul 2009 22:36:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3108718F75 for ; Mon, 27 Jul 2009 22:36:08 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so794010eyd.11 for ; Mon, 27 Jul 2009 18:36:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.41.14 with SMTP id o14mr5896377ebo.23.1248744967148; Mon, 27 Jul 2009 18:36:07 -0700 (PDT) In-Reply-To: <89d273ba0907270145l23933345jf935df06b728b857@mail.gmail.com> References: <89d273ba0907270145l23933345jf935df06b728b857@mail.gmail.com> Date: Mon, 27 Jul 2009 21:36:07 -0400 X-Google-Sender-Auth: 562a55d5152a350b Message-ID: Subject: Re: preallocating space in tables from Lua From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 4:45 AM, Jerome wrote: > I thought the normal way to do that from Lua was to put nil in a table > constructor (ie. local t = {nil,nil,nil,nil,nil} would be equivalent > to lua_createtable(L, 5, 0)), but that's not mentionned on your page. > I was certain that lhf posted several times about that pseudo-feature, > but now I can't find any of these threads in the mailing list archive, > so I may be wrong. Yes, that would be better, and I'll mention it (though still involves an unnecessary loadnil/setlist, which the bytecode hack solution avoids): $ echo 'local t = {nil,nil,nil,nil,nil}' | luac -p -l - main (4 instructions, 16 bytes at 0x680df8) 0+ params, 6 slots, 0 upvalues, 1 local, 0 constants, 0 functions 1 [1] NEWTABLE 0 5 0 2 [1] LOADNIL 1 5 3 [1] SETLIST 0 5 1 ; 1 4 [1] RETURN 0 1 From lua-bounces@bazar2.conectiva.com.br Mon Jul 27 22:57:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S1vUGp009645; Mon, 27 Jul 2009 22:57:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DA2319018; Mon, 27 Jul 2009 22:57:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4C3918D70 for ; Mon, 27 Jul 2009 22:57:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so3724081ewy.5 for ; Mon, 27 Jul 2009 18:57:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.109.19 with SMTP id h19mr5967753ebc.56.1248746223436; Mon, 27 Jul 2009 18:57:03 -0700 (PDT) In-Reply-To: <4A6D7E4F.7040107@cowlark.com> References: <20090727085822.GV14561@pruts.nl> <20090727104943.27ba18d6@trite.i.flarn.net.i.flarn.net> <4A6D7E4F.7040107@cowlark.com> Date: Mon, 27 Jul 2009 21:57:03 -0400 X-Google-Sender-Auth: a2737aaef2413571 Message-ID: Subject: Re: is it possible to make longjmp-free Lua? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 6:15 AM, David Given wrote: > BTW, not having anything like stdlib or stdio does make certain aspects of > the porting a... challenge. In particular, it surprised me that the file I/O > parts of Lua are mixed in with the pure logic parts; I had to disembowel > lauxlib.c quite heavily. It would be nice if we could have all the file I/O > moved into a separate file, for ease of use in file-less embedded > environments. I think this is related to the "I/O library abstraction" proposal [1,2]. [1] http://lua-users.org/wiki/FeatureProposals [2] http://lua-users.org/lists/lua-l/2008-07/threads.html#00345 From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 00:18:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S3InFJ018999; Tue, 28 Jul 2009 00:18:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F8A4190F9; Tue, 28 Jul 2009 00:18:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 550A318CE1 for ; Tue, 28 Jul 2009 00:18:06 -0300 (BRT) Received: by ewy26 with SMTP id 26so3750956ewy.5 for ; Mon, 27 Jul 2009 20:18:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.88.7 with SMTP id l7mr5982558ebb.15.1248751084258; Mon, 27 Jul 2009 20:18:04 -0700 (PDT) In-Reply-To: <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Mon, 27 Jul 2009 23:18:04 -0400 X-Google-Sender-Auth: ef09b35c27ffc157 Message-ID: Subject: Re: is it possible to make longjmp-free Lua? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 11:09 AM, Mark Hamburg wrote: > On Jul 27, 2009, at 4:47 AM, Juris Kalnins wrote: >> Sorry, this reply was unnecessarily terse. To clarify: problem is not that >> setjmp doesn't work with -fno-exceptions, but that C++ throw/catch cannot be >> used with -fno-exceptions, and thus any Lua exception that unwinds C++ stack >> frame is an error. In other words, it is not possible to call most of Lua >> API from C++ functions that have non-trivial local variables, if Lua doesn't >> use C++ throw for exception handling. > > You can address that by only using lua_pcall to call from C++ to Lua and > being prepared for any errors that come back. Or you could if you didn't > have to also worry about all of the memory and parameter errors that will > then necessitate going though lua_cpcall. And unfortunately, lua_cpcall is > moderately expensive since it needs to build a new function object... > > This brings up an old thought I had when I last looked at trying to > bottleneck things through lua_cpcall: Would it be useful to have a light C > function data type that would have no environment or upvalues and which > could be stored in a TVALUE without allocating storage? I was thinking of posting something on this exact performance problem with lua_cpcall allocating a new function object on each call. The allocation can be avoided. In brief....first construct a Lua C function that when executed calls the C function pointer stored in the lightuserdata passed as the first argument. This is done only once. Now, whenever you need to call a C function, lua_pushvalue that Lua C function mentioned previously, lua_pushlightuserdata the C function pointer you want to call, and finally do the lua_pcall. All three operations never longjump and are safe, assuming you have sufficient stack space. The approach does assume that C function pointers can fit inside a lightuserdata, which is usually safe in practice. I had done some micro-benchmarking of this and got a good speedup. Now, back to the original question...wrapping every bunch of unsafe C API operations in a lua_cpcall, may be the "correct" and proper way to mix Lua longjump error handling with other types of error handling (e.g. C++ exceptions), but it can also be a pain/ugly. Juris's example from lposix.c is a good one that does not even involve C++. I have found "exception safe" solutions to such problems, but they are not necessarily obvious. For example, I can replace lua_cpcalls with lua_pcalls as described above. I have a C++ RAII object that resets the Lua stack upon teardown. I have a version of lua_pushstring that raises a C++ exception rather than longjumps via some trickery (lua_pcall a certain Lua function that returns a Lua string based on the C string passed as lightuserdata). This could be implemented more straightforwardly if there were a version of lua_pushstring that returned an error rather than longjumped, for then I can avoid the pcall. Likewise, I could likely find some uses for a lua_newuserdata that did not longjump on error. For example, I could placement new a C++ object into userdata memory managed by Lua gc without wrapping the allocation in a pcall. Now, perhaps there is already a way to do this, such as, as stated, define your own memory allocator that is guaranteed not to fail under certain circumstances, but most will likely want to avoid doing that, if they are even permitted to do so. I would hope that Lua 5.2 makes some improvement here. When there are not obvious solutions to simple problems, most programmers will not code solutions correctly. (An example of that I mentioned previously was the common problem of safely converting a Lua error object, returned by lua_pcall, to a string. In general, this requires grabbing "tostring" from _G and calling it, which in turn may itself error.) Note that some choose to give up on memory allocation exception safety because of the overcommit feature on certain operating systems [1]. [1] http://lua-users.org/lists/lua-l/2008-10/threads.html#00363 From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 00:30:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S3U8nH020049; Tue, 28 Jul 2009 00:30:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1FAF18D18; Tue, 28 Jul 2009 00:29:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF84E18D18 for ; Tue, 28 Jul 2009 00:29:36 -0300 (BRT) Received: by ewy26 with SMTP id 26so3754683ewy.5 for ; Mon, 27 Jul 2009 20:29:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.118.13 with SMTP id q13mr5930298ebc.48.1248751773961; Mon, 27 Jul 2009 20:29:33 -0700 (PDT) In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704657@KLMExch.klmicrowave.com> <560972290907270911v41f0170bpcde03953fe4161a7@mail.gmail.com> <85861A744C29EA46BFD9BB61889AE59D3CB17046A3@KLMExch.klmicrowave.com> Date: Mon, 27 Jul 2009 23:29:33 -0400 X-Google-Sender-Auth: 79f93bae477b37f3 Message-ID: Subject: Re: Standard calling convention on Windows? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 12:44 PM, King, Mike wrote: > Both DLLs from LuaBinaries and Lua with Batteries export functions without the underscore prefix. When I build the DLL using C++Builder 2009, all of the exported functions have the underscore prefix. What am I missing? Some comments on decl and related things are in [1-2]. If in doubt, follow LuaBinaries (as well as Lua for Windows, which is based on LuaBinaries). [1] http://luabinaries.luaforge.net/configuration.html [2] http://luabinaries.luaforge.net/manual.html From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 00:56:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S3uBja022416; Tue, 28 Jul 2009 00:56:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B16BE19292; Tue, 28 Jul 2009 00:55:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hermes.gamehouse.com (mail.gamehouse.com [216.127.40.134]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 838741928C for ; Tue, 28 Jul 2009 00:55:41 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.gamehouse.com (Postfix) with ESMTP id 41AC5845AD9 for ; Mon, 27 Jul 2009 20:55:39 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new at gamehouse.com Received: from hermes.gamehouse.com ([127.0.0.1]) by localhost (hermes.gamehouse.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eE7b4wTFfpFV for ; Mon, 27 Jul 2009 20:55:34 -0700 (PDT) Received: from [10.0.1.9] (ddunham.seanet.com [64.38.167.24]) by hermes.gamehouse.com (Postfix) with ESMTP id A42BD845AD6 for ; Mon, 27 Jul 2009 20:55:31 -0700 (PDT) Message-Id: <2A06DE1B-0BBA-4A4F-9E34-8D28BA595A50@gamehouse.com> From: David Dunham To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: development environment on mac osx Date: Mon, 27 Jul 2009 20:55:31 -0700 References: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean On 27 Jul 2009, at 09:58, Petite Abeille wrote: >> What tools do you use? > > A text editor with Lua syntax highlight, e.g. SubEthaEdit [1] or > TextMate [2]. Xcode can do it too. >> Do you use MacPort? > > No. > >> How do you setup to do Lua and C together. > > Text editor for Lua. Command line to compile C modules [3]. Everything handled through Xcode (the Lua is simply loaded at runtime). David Dunham Development Manager +1 206 926 5722 GameHouse Studios From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 02:38:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S5cWhb030742; Tue, 28 Jul 2009 02:38:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0CCA118E61; Tue, 28 Jul 2009 02:38:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 168D81883D for ; Tue, 28 Jul 2009 02:37:58 -0300 (BRT) Received: from [192.168.254.14] (ppp-133-230.bmts.com [216.183.133.230]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n6S5bj9c025863 for ; Tue, 28 Jul 2009 01:37:52 -0400 Message-ID: <4A6E8EA9.2000807@hempeldesigngroup.com> Date: Tue, 28 Jul 2009 01:37:45 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: is it possible to make longjmp-free Lua? References: <20090727085822.GV14561@pruts.nl> <20090727104943.27ba18d6@trite.i.flarn.net.i.flarn.net> <4A6D7E4F.7040107@cowlark.com> In-Reply-To: <4A6D7E4F.7040107@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > BTW, not having anything like stdlib or stdio does make certain aspects > of the porting a... challenge. In particular, it surprised me that the > file I/O parts of Lua are mixed in with the pure logic parts; I had to > disembowel lauxlib.c quite heavily. It would be nice if we could have > all the file I/O moved into a separate file, for ease of use in > file-less embedded environments. Or you could just provide a library of stub functions to save yourself the trouble of redisemboweling (is that a word?) the next time lauxlib.c changes :-) Ralph From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 02:50:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S5oc8S031785; Tue, 28 Jul 2009 02:50:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 555BD192AD; Tue, 28 Jul 2009 02:50:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth23.prod.mesa1.secureserver.net (smtpauth23.prod.mesa1.secureserver.net [64.202.165.47]) by bazar2.conectiva.com.br (Postfix) with SMTP id 46B5B1928F for ; Tue, 28 Jul 2009 02:50:10 -0300 (BRT) Received: (qmail 2784 invoked from network); 28 Jul 2009 05:50:02 -0000 Received: from unknown (96.240.121.67) by smtpauth23.prod.mesa1.secureserver.net (64.202.165.47) with ESMTP; 28 Jul 2009 05:50:02 -0000 Message-Id: <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: is it possible to make longjmp-free Lua? Date: Mon, 27 Jul 2009 22:50:02 -0700 References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I like the light userdata holding the C function pointer trick. Of course, we still need a way to push without throwing or at least to guarantee the existence of stack space without throwing. Mark From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 03:01:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S61Ia8032670; Tue, 28 Jul 2009 03:01:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B41F2192B6; Tue, 28 Jul 2009 03:00:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 323D119293 for ; Tue, 28 Jul 2009 03:00:44 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id AYQ92290; Tue, 28 Jul 2009 02:00:41 -0400 (EDT) Received: (from mymail.erau.edu [209.216.186.56]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id AOT16079 (AUTH delbu9c1); Tue, 28 Jul 2009 02:00:41 -0400 (EDT) From: Matthew Paul Del Buono Subject: [Bug?] 0 vs -0 / Incorrect Optimization or Parsing To: lua@bazar2.conectiva.com.br X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090728020041.AOT16079@mymail.erau.edu> Date: Tue, 28 Jul 2009 02:00:41 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I think this has been raised before in IRC a year or two ago, but I don't think there was ever a consensus on exactly what the result should be. Lua seems to have trouble parsing both -0 and 0 while reading a file. Individually, it works fine, however when both are present in the same file, the compiler seems to fold -0 and 0 into the same constant. Reference the following: mpdelbuono@li23-154 ~ $ luac -l - a = -0.0 main (3 instructions, 12 bytes at 0x805fb30) 0+ params, 2 slots, 0 upvalues, 0 locals, 2 constants, 0 functions 1 [1] LOADK 0 -2 ; -0 2 [1] SETGLOBAL 0 -1 ; a 3 [1] RETURN 0 1 This wouldn't be an issue if -0 and 0 operated the same in all situations (primarily because Lua follows that -0 == 0). However, we encounter an issue in the situation where there is an actual distinction between -0 and 0, like the following: mpdelbuono@li23-154 ~ $ lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > return 1 / -0 -inf > return 1 / 0 inf Surely we all agree that -inf ~= inf, and as such 1/-0 ~= 1/0. However, we get the following: > return 1 / -0 == 1 / 0 true Why does this happen? Because of the same problem: mpdelbuono@li23-154 ~ $ luac -l - return 1 / -0 == 1 /0 main (8 instructions, 32 bytes at 0x805fb30) 0+ params, 2 slots, 0 upvalues, 0 locals, 2 constants, 0 functions 1 [1] DIV 0 -2 -1 ; 1 -0 2 [1] DIV 1 -2 -1 ; 1 -0 3 [1] EQ 1 0 1 4 [1] JMP 1 ; to 6 5 [1] LOADBOOL 0 0 1 6 [1] LOADBOOL 0 1 0 7 [1] RETURN 0 2 8 [1] RETURN 0 1 Again, notice the statement of 2 constants instead of the expected 3. The flaw here is that it is being turned into "1 /0 == 1 / 0" instead of what was entered. It seems Lua always chooses the first zero. Simply reversing the sides of the expression will yield a different, but equally incorrect, result: mpdelbuono@li23-154 ~ $ luac -l - return 1 / 0 == 1 / -0 main (8 instructions, 32 bytes at 0x805fb30) 0+ params, 2 slots, 0 upvalues, 0 locals, 2 constants, 0 functions 1 [1] DIV 0 -2 -1 ; 1 0 2 [1] DIV 1 -2 -1 ; 1 0 3 [1] EQ 1 0 1 4 [1] JMP 1 ; to 6 5 [1] LOADBOOL 0 0 1 6 [1] LOADBOOL 0 1 0 7 [1] RETURN 0 2 8 [1] RETURN 0 1 If I had to venture a guess, Lua is making a naive check to see if a constant is already present in the constants list by checking equality directly, rather than actually checking if they are truly the same constant. Personally, I think this is a bug, but it is an extremely borderline case. However, as shown above, it does in fact cause incorrect bytecode to be generated in a very specific use case. Regards, -- Matthew P. Del Buono Embry-Riddle Aeronautical University From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 04:11:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S7BEKV007568; Tue, 28 Jul 2009 04:11:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CB2A192A7; Tue, 28 Jul 2009 04:10:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 922E919299 for ; Tue, 28 Jul 2009 04:10:36 -0300 (BRT) Received: by fxm25 with SMTP id 25so3280198fxm.5 for ; Tue, 28 Jul 2009 00:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=M5kWiVscppDlb85tFYsQ02z4yQFwiQcRIOy0xkvJxA4=; b=g8P4cda2Ug/hLsJOspwI83UgNrJsam0XSMj5pvciwvDPyHiR5UsiPbMpaFVm1t4t7S WHPgWJYG5CtvRxeVhRWUR7B2AlE5RilvNx1ZujpwSSlRafjC7PawFR/dTNWNWtMPsEKT BxVHwkmv2EghrmeWkoFEslZe0VME06YrlB/MQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xlMt1f/9Zq/+kXjl0tl1N2Bx1OVc+6utcykt3nNuwrjn9KTRBaWOrw6GtnjHggfxxB ddVogk33EylYTBLMI/ZvY4KJHWnrmyIRdvUtSvYTpQRz3CrU+v1aGpmuy4JUPTa0lnXQ Z/z5Q20+LDnTwYFrbk7nr6Y/fBIelLsWnhNOI= MIME-Version: 1.0 Received: by 10.239.154.3 with SMTP id b3mr787075hbc.114.1248765035061; Tue, 28 Jul 2009 00:10:35 -0700 (PDT) In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> Date: Tue, 28 Jul 2009 09:10:35 +0200 Message-ID: <560972290907280010h20e7d80ft377f2d594826765f@mail.gmail.com> Subject: Re: Table cache From: steve donovan To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6S7BEKV007568 On Mon, Jul 27, 2009 at 8:35 PM, Brian Weed wrote: > collected).  It seems that I can’t use __gc to do this, since that only gets > called for userdata (not tables), and may be too late. There is the undocumented newproxy() hack; this creates a userdata object, and you can set __gc on its MT. But alas, the GC has no idea about _your_ priorities! There was recently a discussion about guaranteed finalization . steve d. From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 04:18:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S7IJAu008276; Tue, 28 Jul 2009 04:18:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50C18192BE; Tue, 28 Jul 2009 04:17:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC67A1929C for ; Tue, 28 Jul 2009 04:17:23 -0300 (BRT) Received: by wa-out-1112.google.com with SMTP id v27so505866wah.5 for ; Tue, 28 Jul 2009 00:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :x-mailer:thread-index:content-language; bh=XTjaELfWJNa/ULRX6FE4uNLHZEIvpoDefrXvpu92eCY=; b=tnONxB70KjJcErC7fvpWOLk1EEO3iRDXwgThkYmnaHEqLonkpWTV3pvwA87N1zrjGe eFtSQxhWhr1frSRKlwl30UOj92E5owLzy/C1FUH7Rk3fUrBvQ8a0N8rEt9++YeDY9flx Reefa7/va8kWIpTErzn/dlwUQCxG1PbvgfoPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:x-mailer:thread-index:content-language; b=jbSqSrhvbJPfqwD+7ndQ0BMmB6kuPfegVZzJPNVdVjSHULsZmyLk2+e3ZcXfWsAQVE Ngch9ZNDL7sfXG35oaD7CZCWFsK05lw2YiVvfST8kchIIRjbZwN836cWtAcfpj7v6eiE 6kcAsAwyH7QjQN6pJ4JEa8NGYO0cNSJsOijGk= Received: by 10.114.67.3 with SMTP id p3mr11492468waa.63.1248765441840; Tue, 28 Jul 2009 00:17:21 -0700 (PDT) Received: from GaryHaiLaptop ([202.91.182.18]) by mx.google.com with ESMTPS id k37sm15277076waf.42.2009.07.28.00.17.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Jul 2009 00:17:21 -0700 (PDT) From: "greegree" To: "'Lua list'" References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> Subject: RE: Table cache Date: Tue, 28 Jul 2009 15:17:15 +0800 Message-ID: <002b01ca0f53$71265440$5372fcc0$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002C_01CA0F96.7F499440" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoO6Qclrddi8NO8TLiIysP9OavBpAAaZyvQ Content-Language: zh-cn X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_002C_01CA0F96.7F499440 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I wrote code below to cache read-only table specially for environment table. ---- immutable multiple inheritance --- retrieve and cache item from base classes local function cache_index(t, k) local val; if not k or type(k) == "number" then return nil end for _, env in ipairs(t) do val = env[k] if val then rawset(t, k, val) -- cache value return val end end end ---- Readonly inherit from one or more base classes. --- If child is nil, return new class inherit from ... --- ... can be nil, while #child > 1. --- All parameters should be tables. --- child should not has numeric member --- Carefully check dead-loop of multiple inheritance. function inherit_scopes(child, ...) if not child then child = {__mode = "kv"} end local n = select('#', ...) for k = 1, n do child[#child + 1] = select(k, ...); end if #child < 1 then return false, "No base class found."; end if #child == 1 then return setmetatable(child, {__index = child[1]}) end return setmetatable(child, {__index = cache_index}) end Regards, Gary From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Brian Weed Sent: Tuesday, July 28, 2009 2:36 AM To: lua@bazar2.conectiva.com.br Subject: Table cache Is there a way to cache/re-use tables automatically behind the scenes? This is what I want to do: function foo() local t = ObjectFactory() - This function returns tables (from a pool of reusable tables, or new table if pool is empty) . -- use 't' . -- When 't' goes out of scope, (i.e. no more refs to it) I want it to automatically be added back into the pool for re-use. -- 't' may be passed to other functions (or returned from this function), so I can't just place it back into the cache manually at the end of this function. end I was hoping that when someone wants a "new" object, I could remove it from the pool of unused objects, and add it to a table of weak references to "used" objects before I give it to the user. If there was a way for me to be notified when the object has no more strong refs to it, I could move it back into the pool (before its actually garbage collected). It seems that I can't use __gc to do this, since that only gets called for userdata (not tables), and may be too late. The problem I'm trying to solve is that the programmers on this project have written lots of code that is constantly creating way too many temporary objects, which bogs down the memory manager (causes low frame rates, and choppiness). I would like to solve this problem automatically in one spot, at all possible (auto cache these objects, and reuse them), so that we don't have to modify all the places that cause this. I'm thinking that maybe this can't be done. Perhaps there would be too many side effects to resurrecting the object. Thanks. Brian ------=_NextPart_000_002C_01CA0F96.7F499440 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

 

I wrote code below to cache read-only table specially for environment table.

 

---- immutable multiple inheritance

--- retrieve and cache item from base = classes

local function cache_index(t, k)

  local val;

  if not k or type(k) =3D=3D "number" then = return nil end

  for _, env in ipairs(t) do

    val =3D env[k]

    if val then

      rawset(t, k, val) -- cache = value

      return = val

    end

  end

end

---- Readonly inherit from one or more base = classes.

--- If child is nil, return new class inherit from = ...

--- ... can be nil, while #child > = 1.

--- All parameters should be tables. =

--- child should not has numeric = member

--- Carefully check dead-loop of multiple = inheritance.

function inherit_scopes(child, ...)

  if not child then

    child =3D {__mode =3D = "kv"}

  end

  local n =3D select('#', ...)

  for k =3D 1, n do child[#child + 1] =3D select(k, = ...); end

  if #child < 1 then return false, "No base = class found."; end

  if #child =3D=3D 1 then

    return setmetatable(child, {__index = =3D child[1]})

  end

  return setmetatable(child, {__index =3D = cache_index})

end

 

 

Regards,

Gary

 

From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Brian = Weed
Sent: Tuesday, July 28, 2009 2:36 AM
To: lua@bazar2.conectiva.com.br
Subject: Table cache

 

Is there a way to cache/re-use tables automatically behind the = scenes?

 

This is what I want to do:

 

function foo()

  &= nbsp; local t =3D ObjectFactory() – This function returns tables (from a = pool of reusable tables, or new table if pool is empty)

  &= nbsp; …

  &= nbsp; -- use ‘t’

  &= nbsp; …

-- When ‘t’ goes out of scope, (i.e. no more refs to it) I want it = to automatically be added back into the pool for re-use. =

-- = ‘t’ may be passed to other functions (or returned from this function), so I can’t just place it back into the cache manually at the end of = this function.

end

 

I was hoping that when someone wants a “new” object, I could = remove it from the pool of unused objects, and add it to a table of weak = references to “used” objects before I give it to the = user.

If there was a way for me to be notified when the object has no more strong = refs to it, I could move it back into the pool (before its actually garbage collected).  It seems that I can’t use __gc to do this, since = that only gets called for userdata (not tables), and may be too = late.

 

The problem I’m trying to solve is that the programmers on this = project have written lots of code that is constantly creating way too many temporary objects, which bogs down the memory manager (causes low frame rates, and choppiness).

 

I would like to solve this problem automatically in one spot, at all = possible (auto cache these objects, and reuse them), so that we don’t have = to modify all the places that cause this.

 

I’m thinking that maybe this can’t be done.  Perhaps there would = be too many side effects to resurrecting the object.

 

Thanks.<= /o:p>

 

Brian

------=_NextPart_000_002C_01CA0F96.7F499440-- From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 04:39:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S7dNC2010201; Tue, 28 Jul 2009 04:39:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EA241A5DE; Tue, 28 Jul 2009 04:38:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from pony.ic.uva.nl (pony.ic.uva.nl [145.18.40.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCC1B1A5A0 for ; Tue, 28 Jul 2009 04:38:44 -0300 (BRT) Received: from [192.168.178.21] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by pony.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n6S7caMs023489 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 28 Jul 2009 09:38:40 +0200 Message-Id: <065091FC-B366-4FA3-B625-72A35BB2BC19@uva.nl> From: Hans van der Meer To: Lua list In-Reply-To: <2A06DE1B-0BBA-4A4F-9E34-8D28BA595A50@gamehouse.com> Content-Type: multipart/alternative; boundary=Apple-Mail-4--123423566 Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: development environment on mac osx Date: Tue, 28 Jul 2009 09:38:35 +0200 References: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> <2A06DE1B-0BBA-4A4F-9E34-8D28BA595A50@gamehouse.com> X-Mailer: Apple Mail (2.935.3) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.181 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-4--123423566 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit The BBEdit editor knows Lua by itself (nota bene: BBEdit 9.2.1 corrects a serious bug in the Lua processing). For those who want Lua syntax coloring in XCode, this will do it fine, follow the installation instructions inside: Hans van der Meer On 28 jul 2009, at 05:55, David Dunham wrote: > On 27 Jul 2009, at 09:58, Petite Abeille wrote: > >>> What tools do you use? >> >> A text editor with Lua syntax highlight, e.g. SubEthaEdit [1] or >> TextMate [2]. > > Xcode can do it too. > >>> Do you use MacPort? >> >> No. >> >>> How do you setup to do Lua and C together. >> >> Text editor for Lua. Command line to compile C modules [3]. > > > Everything handled through Xcode (the Lua is simply loaded at > runtime). > > David Dunham Development Manager > +1 206 926 5722 GameHouse Studios > --Apple-Mail-4--123423566 Content-Type: multipart/mixed; boundary=Apple-Mail-5--123423565 --Apple-Mail-5--123423565 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: 7bit
The BBEdit editor knows Lua by itself (nota bene: BBEdit 9.2.1 corrects a serious bug in the Lua processing).

For those who want Lua syntax coloring in XCode, this will do it fine, follow the installation instructions inside:

--Apple-Mail-5--123423565 Content-Disposition: attachment; filename=LuaXcode3SyntaxColor.zip Content-Type: application/zip; x-unix-mode=0664; name="LuaXcode3SyntaxColor.zip" Content-Transfer-Encoding: base64 UEsDBBQACAAIAO9ahDcAAAAAAAAAAAAAAAAOABAATHVhLnBiZmlsZXNwZWNVWAwA4EhXRwGeVEf1 ARQAhY49C8IwEIb3Qv7DkantYAdHcVEqFPwYdNAxtlcJaFLyARXxv5tr1aqL75DhnvcuT5amLIKQ pRej5ljLM9oGS2DPGVjtTYlAAIhYqLWBfakrhDFgJZ02LM0iFncrt+6lFBUqJ2uJBqbPK7Q0Onsx eZdmwmK1UV+NSfSia3HBgDh5LMiMD5t561BZqZUNjZiHqzwZ6KpY5btrgz102LrspzHXl8Y7NEuh Tl6c6J8vs485b3vxMCH7D4nC7sJpUgu1Q77tyZ0l78a/PABQSwcI7pHfJssAAACAAQAAUEsDBBQA CAAIAIJehjcAAAAAAAAAAAAAAAAOABAATHVhLnhjbGFuZ3NwZWNVWAwA4EhXR7NHV0f1ARQA7Vzr cxM5Ev8cV+V/UPnLka0wzoPs3oXiqACB5ZbXJYHdPW7LJc/Itjaa0SBp/FiK+9uvNQ/bsVvzCHYC 7E5BBebX0+p3qzUDnQ55kdDtVqdD7B+8iS9oNNAx88no0Nvz9rdbFtwCjFgkoQNGLMz73KeGy4j0 pSK/+DJgZN878sh3HUv/SDFD3nHfSLVL7nUO4Nfe3lFrK8WoZgGBJ8+T3qkZ0tOAm79puzwJgc0u oVFAzJCRXsKFucujnP2V9TWh5thy65xPtWFh5wXvKaqmnTeKj6hhTxUN2ViqS915wkYXUgr9WCrm 9Yv7nXdMaZBfd046Z0zLRPlMdx4VSxaLaS/uFSbJxH8bkwAWABFlKvORt0/0NDJ0QnpT8kzRIQ3J jyzSRvFgAOqA8vt7Vv/vU818GfW5ClmQWV3GTKWGpIKMuRnmyh5497zM9oS8jbMF9zv7B529H+zC KdGhY8GUDSVEcGMEI0MmYtJXMty2zJ7QEQ/I6ZhHAzAhOYljILFXir7VTKe2j9iYLEYDeDmkZjfF AtbnEU+dL/tkPOT+kHBNImkIHVEuaE+w3ZTdUI7ZiCmSaLvciCouE036XLDCf4RY/zBhzVDiw1Rf GyhVDkyXpVpzbTQBPyZRAGQGDG8lsNIXnp2Z942gPgOIZ5It54H1mb0V91K57S3gG3DFbHRPjzMm /5sJby1a5MZ5EsdSmQUVz4dUsSDTp3O+mEgge6t1B353vlvjZbORvDw5++k4DdZLNgXbBXrdi2x9 bG1tPQ9YZEAfcPgD0p5YFT1rRk+A+fgMbN/fBuLzLGUekI/bLbJwnRuqzGOwkrZMaM+HaBsM+e+X Ioxk/AF8mYzGk+kfJ48ePzl9+uzH5//66cXLV6/f/Pvs/OLtu59/+fU/3fft+1dYfha3vf2Dw3tH 3//w9390H77/bYnzz9aWwPkOKFTca0PAtHe3ydLV7ilGLzEgkO1dsnqbCc0wcnuf91EEXxhSF72d RL6NOwzD+XOUVkifCgyAeoDdxqVRLGYUpYdOkih0Zchm9H4CgYZKBKVKWJuuIlAxmEKX96UQkOkD qnpQNHD/9TO2KwhTCtd2wEyfRSMHFDJDjS2iqBNiypXGHUFR/9v7LgktZvtGNGjvtlZQaMcJ/lzE Jqi1nMLFECSoT2JYHPc7HbMPCR5agIGdHIh2IMANijYGaWZdjCNOR+kKRxkZJWGPof43sjA6gk1j lF8SxdRHC8gkN+6qA7vP0LvvTs/On79+BVjavCCPFMs6+JjESvZApSlsIHrMGKjlYzq1fX7IB0MB v03RSPuQGdLuI6Bnra7RpQEajd0ubIB8PNW73YCjtu522Qf8/sDH73Po+xMcwt0F9x0ylXoZYGhz DiRBg7fbhc1ViXyxHOOATno4UBZO3W4ShWjNs+HkKGk55PkxNcMyAls/GOrnRQrBUcELkqpFYsVc ta0g0Yxl9QUr4EomELSoojPQ86E9mwoaxXQSVtEkUeRwxZwINqQmQevknGasaFxOMeVMWKsg6eeu 6Rni9aa4sjnsw5apBA6SEJUth2E8QL1VwOksUUIwANhHQ6IgyFLBqZ3ANwYFClNJmXZVq8NepQR1 ZGmOwkCArr2qSl5yHIBXVFEXzqNsR+PCQzqJ3KhioRyVrK5lyhvZMjhy2d73aA+N+QzzZQmo8b1n BsJ0VwoeOFGf4RvFDCwRCDC3mgFD0z/F2ASNnRTrC4lvFzMUGo0bVGWMhwle5lNQBGWPCunWBbD9 PScKAebGStwJaqLTRwrG3A3hbTPFFN49ciwKZFgBQ39xcygLTsDcgaI/4DNHCmZRjWeYBYd45ecS y1ouPV9IfKAErC8SPJ4B41GcoFICJqANoUkCmIzxIgxQXIJBb3OvBz0adQNAJoxdQ45FHZtqgMaK o60QmZiB/3FhxlUbp3BhSQdcGMwB5/o5UAjCyzLUjHpJ301QKIoEja102F0bNPjMAVjg2C9ZiPf7 huNbJYDZhPmJ82E24fjBgfZg6HNMYwAWPcsBRtQpD5guPcVw4SWqQNg5GCMBFLBegpbTFPAq4JJD gxnBUEr8jKkg4FFflhI4j3NmFKXz0IxKsQGHPc+0lCiJR1QkJYxK5u8ZQbnOulKlqkF+RlUprVHU Z71sSr+STjv3r/79AsrR/Iw0e3vg5WezS0eMJ8Kg1IvnqZYO5vhIRneLA15C7Ug/o9Gtra1PuRCf 5vKnf/g4W899gEsT6AOGwQBkx//X6TsLqfSCrPPzXMcJ6YrNPA8rOh5m3uNlyp371faMBYXGPCf8 dD9Xv9XKDLG90aP23CCPpZB257/utVp1XZfQBRs8YdpXPE5fTgCdlbMQcIEqfUP3OlripHkYC4aQ P498kQTsefSSRQk89Ovp+Rx8BdUxX6o6Wi7kJYv4H+gLBAFdQ3lGggwjJpayJBfhLLFvltBoW+JW HG1WEvqCarQ7LtHNj9MrSXtZU61H59mz+Jqk+fl2TeriyL0mefoaoZoWSuAldOlJXIc6hioVIbSf l972R5bhkJAXiyeVRIHTSfZGQRNjo83+SI8zpT0GTQl0g9zKwrI6shsHqC/DkEV13JNT2lFjIJhI T7pKH3IfDq0Q2QX2alPu16Y8qE15WJvyXm3KowpKe/pFfcPqhPBCH8aO5ufExduAco6uRnuV944r 7BtHLlZQv6IQLrX4XyFcL4SzXgjjB/S6NNzqtsVmjxQdstlTi/lVSozmF5oodXe9i/FTmR3pdwuW wfvlzw9Oo8De/2354wG0q+WBjed33exeDOcGgj9wSf7gNkQ/aCS6W/ZbEf6wmfAl0t+K+Pcail8m /60ocNRUgVINblCFhdlkc9PSTPXKRoDaxH5ndBV4KkVgj0+Whz97nTE/UZqPULD5nuLzxrE6g8X8 88Z8tfIZo5FTcdte179LXiix4uzjl+v32zqms0ehdqgznIr1mG3ZAzeVCiv7my8uE24iwht76rbi u25ZqL2btMQ6gfEr5fywvZlUaGLfuTQ3atm7/1xT0Zhpvt1Y9Vmo33wdwIaWL64U/HWguI4DxYWq iATc9RO3PIQ2n8ENTqZnombvNCtT+fq2SBe4SSt8TiO4IjXs5BR7uIHN0fXr4lyuGzUp+v7uJreT ucU2+x4vLVZr/wczdV2clfa1e3XW7j7i3ezT7fayP3uPun6BnZlvcyFzhbm91r8DStc6MY9ev7iF /dG3HVCNpu9Fg2wuoJb52+sbi6kG9exrCyj7o3lM5VpuLqhWFrBXHlXZPxD8k8VVs7L2lYZVfxOz 1Sym+jcw/H+b4VS/qH0hnW/OeXPhdAcPpp3lCWy9+2ungddzVrfIf3Omc72t26jpGtevZm868q9l Ko02M8Ldu7W/NSgrR8t2QD5cXxA1UQL97wqukngh5ZV0xVc/IVWXbdf3TfZCDwdW7bUUtdex/uIX SE0cgbvhv1H72zd1awcq6/8BUEsHCG4qAFAaCgAASEgAAFBLAwQUAAgACAD6XoY3AAAAAAAAAAAA AAAACgAQAFJFQURNRS50eHRVWAwA4EhXR5dIV0f1ARQAXZDNbtVADIWfYN7B6rq9qSgSEisQFVCp SEhBiK0zcRJzJ/ZofpqbDc+OM70bWIysOePx8Xf6XQpeYOF5CXYKywyTJniuCCzwy+tI8ODc94Ce DvUUh4kD5UgeUMYmXXxAmZvE8t796Z55SJj27mOMgT0WVoG+xqipdI/0QkEjpa5fMNHYNY+ut988 XZtz547ZiQbV8rrECb7hDkI0QlGz4cIYwg4rngnQilQMgDmr51dDncDRhXNjikl/ky+QfeJYoCFA zcfTT6btrm85fNKgybS7gwo+Ww5CG7jr5wxloX8sOAPWoqvd/Mm5nug6+YhwMWtNe0spJjbFGy6X 7NyPhf4PrgXtUWCk6aAjYxsIeDXzFxpvYajFvIGLud6Cs7ppOmcLCbMKDta/UQgneCptzkxWVaaa LTLb1S9VzsZv0YPbFhIg8Vql0EEMgcX23rgssNZQOAaCXLDQStLI0YzFh2pr3pCMN8b7JeGCK3wl ySXxOJObm/LBY5z15HV1b+HR4N7c378D9xdQSwcI55a7UogBAABsAgAAUEsDBAoAAAAAACJfhjcA AAAAAAAAAAAAAAAJABAAX19NQUNPU1gvVVgMAOBIV0fgSFdH9QEUAFBLAwQUAAgACAD6XoY3AAAA AAAAAAAAAAAAFQAQAF9fTUFDT1NYLy5fUkVBRE1FLnR4dFVYDADgSFdHl0hXR/UBFABjYBVjZ2Bi YPBNTFbwD1aIUIACkBgDJxAbAbECEIP4QUDMoAUEHilFiQw4AABQSwcI+XRUSC0AAABSAAAAUEsB AhUDFAAIAAgA71qEN+6R3ybLAAAAgAEAAA4ADAAAAAAAAAAAQKSBAAAAAEx1YS5wYmZpbGVzcGVj VVgIAOBIV0cBnlRHUEsBAhUDFAAIAAgAgl6GN24qAFAaCgAASEgAAA4ADAAAAAAAAAAAQKSBFwEA AEx1YS54Y2xhbmdzcGVjVVgIAOBIV0ezR1dHUEsBAhUDFAAIAAgA+l6GN+eWu1KIAQAAbAIAAAoA DAAAAAAAAAAAQKSBfQsAAFJFQURNRS50eHRVWAgA4EhXR5dIV0dQSwECFQMKAAAAAAAiX4Y3AAAA AAAAAAAAAAAACQAMAAAAAAAAAABA/UFNDQAAX19NQUNPU1gvVVgIAOBIV0fgSFdHUEsBAhUDFAAI AAgA+l6GN/l0VEgtAAAAUgAAABUADAAAAAAAAAAAQKSBhA0AAF9fTUFDT1NYLy5fUkVBRE1FLnR4 dFVYCADgSFdHl0hXR1BLBQYAAAAABQAFAGYBAAAEDgAAAAA= --Apple-Mail-5--123423565 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable


Hans van der = Meer



=

On 28 jul 2009, at 05:55, David Dunham = wrote:

On 27 Jul 2009, at 09:58, Petite Abeille = wrote:

What = tools do you use?

A text editor = with Lua syntax highlight, e.g. SubEthaEdit [1] or TextMate = [2].

Xcode can do it too.

Do you use = MacPort?

No.

How do you setup to do Lua and C = together.

Text editor for = Lua. Command line to compile C modules = [3].


Everything handled through Xcode (the Lua = is simply loaded at runtime).

David Dunham =       Development Manager
+1 206 926 = 5722      GameHouse = Studios


= --Apple-Mail-5--123423565-- --Apple-Mail-4--123423566-- From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 06:35:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6S9ZJpj019951; Tue, 28 Jul 2009 06:35:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0C17192CA; Tue, 28 Jul 2009 06:34:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4BB4818ED1 for ; Tue, 28 Jul 2009 06:34:38 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MVj4s-00067A-00; Tue, 28 Jul 2009 11:34:34 +0200 Date: Tue, 28 Jul 2009 11:34:28 +0200 From: Mike Pall To: Lua list Subject: Re: [Bug?] 0 vs -0 / Incorrect Optimization or Parsing Message-ID: <20090728093428.GA4517@mike.de> References: <20090728020041.AOT16079@mymail.erau.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090728020041.AOT16079@mymail.erau.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew Paul Del Buono wrote: > Lua seems to have trouble parsing both -0 and 0 while reading > a file. Individually, it works fine, however when both are > present in the same file, the compiler seems to fold -0 and 0 > into the same constant. This is a known issue and there's even a bug fix for it: http://lua-users.org/lists/lua-l/2008-04/msg00136.html But for some reason that fix never went into Lua 5.1.4. :-( --Mike From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 08:52:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SBq443000958; Tue, 28 Jul 2009 08:52:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E49B1A53B; Tue, 28 Jul 2009 08:51:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE7001A2E8 for ; Tue, 28 Jul 2009 08:51:30 -0300 (BRT) Received: by fxm25 with SMTP id 25so3435162fxm.5 for ; Tue, 28 Jul 2009 04:51:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.54.80 with SMTP id p16mr4191380bkg.115.1248781887131; Tue, 28 Jul 2009 04:51:27 -0700 (PDT) In-Reply-To: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> References: <379686bd0907270944ocbaaa1aw7c071278f1ec39c7@mail.gmail.com> Date: Tue, 28 Jul 2009 13:51:25 +0200 X-Google-Sender-Auth: 25e4f815a94df2ff Message-ID: Subject: Re: development environment on mac osx From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Jul 27, 2009 at 6:44 PM, Ashish Shrestha wrote: > Hi, All. > > Sorry if this is off topic. I currently do all Lua development on a > remote Arch Linux box. My personal machine is a Mac. Can people who > have setup a Lua development environment to do Lua and C development > share how/what their environment is setup? > > What tools do you use? Do you use MacPort? How do you setup to do Lua > and C together. Do you use luarocks? Hi Ashish, I use TextMate with my own Lua bundle (although this one probably needs some more work): http://github.com/golgote/lua-tmbundle/tree/master I compile my modules from the command line. I am not a gcc and C expert but this is what I use to compile a json module on Leopard for example: gcc -Wall -O2 -fno-common -c json_tokener.c -I/opt/local/include gcc -Wall -O2 -fno-common -c json_lua.c -I/opt/local/include gcc -Wall -bundle -undefined dynamic_lookup json_lua.o json_tokener.o -o json.so For the module, see: http://mamasam.indefero.net/p/luajson/ I am not sure my flags are perfect, so feel free to correct them... My version of Lua is installed in /opt/local because I used MacPorts. But you don't need Macports as Lua is easy to compile once you have the developers tools from Apple. Lua usually installs in /usr/local. I also use LuaRocks for some modules and it usually works fine with most modules. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 09:23:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SCNY0h005265; Tue, 28 Jul 2009 09:23:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E27119286; Tue, 28 Jul 2009 09:23:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A837818E7A for ; Tue, 28 Jul 2009 09:22:56 -0300 (BRT) Received: by ewy26 with SMTP id 26so4021182ewy.5 for ; Tue, 28 Jul 2009 05:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=JxaKKnSfJW0FWUzSiP2Shu05xstzuk9N4NY8PdAJW74=; b=VfomJKvyzcOMs5C673X718Zy3LmzQFHYrBjHcUawaQdkOuy5PSY1NcJvkRr2nXwNKz dTDr6YU2u4TVc7ApG/HHj/5uUVcBQJLHpJ6rgWp0BTSR9nTU6sZAMb/0ip6btJSVYozt B6YCFOoRMPwDrbUbTfAWyMOnbT2O2ldAedBIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=sIOAhsEZdBJBxhKE2i41rPQJxsGXH4Zwzm9U4vsmKwpXhwXTLkpzSHtiRtLKmdNqYn K59iwmgNDgt9l6LFd5GZzInrvRz5D98TbKoYhP2u56hhGfUD6owlNsSkGV915klNdxfo 08cTzlp12hOEWYtUt/9AnE36kwXovPobLaJlg= MIME-Version: 1.0 Received: by 10.216.1.85 with SMTP id 63mr2024583wec.26.1248783774118; Tue, 28 Jul 2009 05:22:54 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Tue, 28 Jul 2009 14:22:34 +0200 Message-ID: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> Subject: Re: tables holding nil: another way to look at the question itself To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SCNY0h005265 2009/7/25 Cosmin Apreutesei : >> When a question makes no sense, does it matter what the answer is? >> (What is the sound of one hand clapping?) A language designer can >> rule it illegal to even ask the question, e.g. Scheme forbids asking >> (car '()). Or, an arbitrary answer can be defined because it is >> convenient, e.g. in Lisp (car nil) is nil. > > If I can have nil in function argument/return value, store it in a > variable (as transferable information, not as meaning "unbounded"), > then I need it in table keys and table values, and in return value of > iterators. Any interpretation of nil (as an end marker, etc.) makes > its usage as a value non-transparent. At least the iterator thingie > really itches me as I can't find a workaround for it. > > ---- boring rant follows ---- > > As I'm learning out, the nil value/type has many responsibilities in > Lua, unlike say, SQL where it's meaning is more tight (convenient- the > context is much tighter too). The lua manual is quite careful not to > constrain your understanding with any bounds or vision upon the > concepts it defines (I dig it), so you're left alone to build your own > mental models. As a novice, all this liberty makes me uneasy, so > (mistake #1) I try to infer semantics from behavior (like in reverse > engineering) -- which involves the nil value a lot. So questions pop > out about the nature of the nil and the things around it, like: > > - why is there a difference between a list of nil arguments and no > argument? --> nil is acting like any other value here. That's an extra feature provided for convenience. Just like you can see tables as infinite key-value pairs, you can see argument list as infinite list of values, defaulting to nil. As a convenience you can get the number of values that was actually passed to a function call, but you can still access all elements of the argument list (just call select(42, ...) for example). > - the nil value is transferable (by assignment), along with the > responsibility of unbounding a variable --> double duty. Like any other assignment, assigning to nil is unbinding the variable from its previous value, and binding it to its new value. No special case here. In "a=print; a={}", the second assignment is unbinding 'a' from print and it's binding it to a table. > - nil responds to type() --> a hint that nil is a value, if so, > shouldn't it be allowed as a table key? table keys are said to hold > any lua value. nil is a normal value, just like 42, true, false and "Hello World!". The authors decided that the value associated to nil in a table should always be nil, that key-value pair is read-only. Sometimes you have to accept exceptions to the rule. That exception has motivations (previously discussed on that list). > - the for protocol uses nil to break the loop --> nil can't be used as > the first return value of an iterator. what does that saying? It simplifies the iterator protocol a lot to mark the end of iteration with a special value rather than another mechanism. Whatever the special value (currently it's nil), if it's a regular value, it implies you cannot iterate over it. As with most questions of this thread it's mostly a matter of taste. > - can arrays hold the nil? those "defined" by ipairs() can't, but what > if I provide the bounds myself? lua hints me that indexing integer > keys is not a hash operation and seems to be all I need to know.. so > is ipairs() really needed? I mean apart from being bad PR making some > people believe that arrays are crippled in Lua, along with the darn # > operator. The array is not such a fundamental data structure in Lua, as opposed to C for example. I think all these pseudo-problems around them quickly vanish once you start programming in Lua "à la Lua". From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 10:57:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SDvFIo025507; Tue, 28 Jul 2009 10:57:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F6ED18838; Tue, 28 Jul 2009 10:56:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C31E1187EE for ; Tue, 28 Jul 2009 10:56:36 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SDuZen025292 for ; Tue, 28 Jul 2009 10:56:35 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6SDuZF20375; Tue, 28 Jul 2009 10:56:35 -0300 Date: Tue, 28 Jul 2009 10:56:34 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [Bug?] 0 vs -0 / Incorrect Optimization or Parsing Message-ID: <20090728105634.A20372@lua.tecgraf.puc-rio.br> References: <20090728020041.AOT16079@mymail.erau.edu> <20090728093428.GA4517@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20090728093428.GA4517@mike.de>; from mikelu-0907@mike.de on Tue, Jul 28, 2009 at 11:34:28AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > This is a known issue and there's even a bug fix for it: > > http://lua-users.org/lists/lua-l/2008-04/msg00136.html > > But for some reason that fix never went into Lua 5.1.4. :-( It will be in Lua 5.2. From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 11:20:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SEKlgY032563; Tue, 28 Jul 2009 11:20:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBA7D191F2; Tue, 28 Jul 2009 11:20:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95F0F189F6 for ; Tue, 28 Jul 2009 11:20:14 -0300 (BRT) Received: by qyk34 with SMTP id 34so68470qyk.33 for ; Tue, 28 Jul 2009 07:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PVzIMit7++NKr055RJC7NY379MHkw4adxxRWERHY9IE=; b=YkvW+aDVHohq8hdlwOUbtbu0WohgGnuCPZuwor9llrH/nZKSgjuQKagIySVO8OHx6V uXIlSSRYhC8BJ61VgSXfadyZc02Ud4RQsK0sxpsXQbP75BcQwU7qJJTyzDMkbaqB72aX 5gfh2K2On/CINzT1brX/BEiTpSCv/wK4Zot9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UJtYLU25LmKZQTALueIEB+8DpivEIS311HPg8IZzDup6wKW6ucjBB55hUF8fM2esTH TeNf6lwT8bGRqE2Jn8m3ZXgSdyI9w24uVWPMAgHyvDMgl+Cw1kdeOBpPb4RG9xJNC6ip RrxdWT/dVnzdMbIiAW70jbXQl41tAEv/B+c8Q= MIME-Version: 1.0 Received: by 10.151.27.8 with SMTP id e8mr13480249ybj.302.1248790812210; Tue, 28 Jul 2009 07:20:12 -0700 (PDT) In-Reply-To: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> References: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> Date: Wed, 29 Jul 2009 00:20:11 +1000 Message-ID: <305dffcb0907280720q7da5e06ei1c3f73c1f824170@mail.gmail.com> Subject: Re: tables holding nil: another way to look at the question itself From: Vaughan McAlley To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SEKlgY032563 2009/7/28 Jerome Vuarand : > The array is not such a fundamental data structure in Lua, as opposed > to C for example. I think all these pseudo-problems around them > quickly vanish once you start programming in Lua "à la Lua". Yes, I think a "native" Lua programmer will avoid using ipairs and the # operator on arrays unless they know the arrays won't have holes. Dealing with embedded nils can be a little fiddly but there are performance advantages in not having to traverse the array after each element is added (in the case of the # operator for example). 2009/7/25 Cosmin Apreutesei : > so is ipairs() really needed? Not as much as pairs() is needed. To me it's almost in the category of syntactic sugar, as the keys to an array without holes are accessible with a simple arithmetical loop: t = { "one", "two", "three" } for i = 1, #t do ... end -- or this local i = 1 while t[i] do ... -- though this requires an extra table lookup per iteration i = i + 1 end Vaughan From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 11:21:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SELeXP000353; Tue, 28 Jul 2009 11:21:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 102FD192DA; Tue, 28 Jul 2009 11:21:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 037D21928F for ; Tue, 28 Jul 2009 11:21:14 -0300 (BRT) Received: by bwz6 with SMTP id 6so65815bwz.5 for ; Tue, 28 Jul 2009 07:21:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.72.129 with SMTP id m1mr4057142bkj.61.1248790872071; Tue, 28 Jul 2009 07:21:12 -0700 (PDT) Date: Tue, 28 Jul 2009 17:21:12 +0300 X-Google-Sender-Auth: eb30585bdbe2cd55 Message-ID: Subject: alien library - proposed changes From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, As I am writing some wrappers with alien, I have compiled a small list of changes that would make alien work better with complex and/or bad APIs. I'm planning to implement them myself as time allows, but I'd thought I'd post them here first to avoid any duplicate work :) I'd appreciate any comment on why any of these is a bad idea. 1) buf:topointer(offset) -> light_userdata motivation: neither alien.to(), buf:tostring(s), nor struct.unpack(layout,buffer,size) don't have an offset parameter; the returned userdata could be wrapped up with buffer(), or dereferenced with alien.to(). 2) buf:tostring([size, [offset]]) motivation: allow easy extraction of a small structure out of a large buffer for processing with struct.unpack(). 3) alien.to(buffer, [offset]) motivation: allow easy dereferencing a pointer inside a buffer (multi-dimensional arrays etc.) 4) struct.size('p') -> sizeof(void*) motivation: for when sizeof(void*) is different than sizeof(int), and for better expression of intent. 5) struct.pack('p', light_userdata or buffer) motivation: allow packing structures with pointer members; keeping the buffer from being garbage-collected is left to the programmer. 6) struct.unpack('p', string, offset) -> light_userdata motivation: allow unpacking structures with pointer members; the resulted luserdata could then be wraped up with buffer or dereferenced with alien.to(). 7) struct.unpack(layout, string or buffer, [offset, [size]]) motivation: generalize unpack to work with buffers and strings transparently given an offset and size. 8) struct.unpack_offsets(layout, string or buffer, [offset, [size]]) -> offset1, offset2, ... motivation: directly access a member without unpacking the whole structure. *) update documentation, unittesting. From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 11:57:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SEvOjj009068; Tue, 28 Jul 2009 11:57:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0067A192FB; Tue, 28 Jul 2009 11:56:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4756192EF for ; Tue, 28 Jul 2009 11:56:46 -0300 (BRT) Received: by fxm25 with SMTP id 25so91491fxm.5 for ; Tue, 28 Jul 2009 07:56:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.97.140 with SMTP id l12mr4366142bkn.133.1248793004060; Tue, 28 Jul 2009 07:56:44 -0700 (PDT) In-Reply-To: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> References: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> Date: Tue, 28 Jul 2009 17:56:43 +0300 Message-ID: Subject: Re: tables holding nil: another way to look at the question itself From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SEvOjj009068 >> - why is there a difference between a list of nil arguments and no >> argument? --> nil is acting like any other value here. > > That's an extra feature provided for convenience. Just like you can > see tables as infinite key-value pairs, you can see argument list as > infinite list of values, defaulting to nil. As a convenience you can > get the number of values that was actually passed to a function call, > but you can still access all elements of the argument list (just call > select(42, ...) for example). Yea, but providing the arg. count is leaking the abstraction. If I am to make an optional parameter in the middle of the arg. list, should I account for the real arg. count or use an ipairs()-like iteration? In other words, should I account for trailing nils? What if some other function that my function wraps up is sensible about the arg. count as well? I have to carry around arg. count everywhere. Whereas without this leak, {...} would had been enough. > >> - the nil value is transferable (by assignment), along with the >> responsibility of unbounding a variable --> double duty. > > Like any other assignment, assigning to nil is unbinding the variable > from its previous value, and binding it to its new value. No special > case here. In "a=print; a={}", the second assignment is unbinding 'a' > from print and it's binding it to a table. Yes, I was wrong. There's no "unbounding", just re-bounding to a new value, which can happen to be nil. > >> - nil responds to type() --> a hint that nil is a value, if so, >> shouldn't it be allowed as a table key? table keys are said to hold >> any lua value. > > nil is a normal value, just like 42, true, false and "Hello World!". > The authors decided that the value associated to nil in a table should > always be nil, that key-value pair is read-only. Sometimes you have to > accept exceptions to the rule. That exception has motivations > (previously discussed on that list). > I dig it. But then __index should not be called for the nil key to make sure the rule is not broken. >> - the for protocol uses nil to break the loop --> nil can't be used as >> the first return value of an iterator. what does that saying? > > It simplifies the iterator protocol a lot to mark the end of iteration > with a special value rather than another mechanism. Whatever the > special value (currently it's nil), if it's a regular value, it > implies you cannot iterate over it. As with most questions of this > thread it's mostly a matter of taste. > This I don't buy. How does it simplifies it? The few iterators that I wrote don't get any more complex if they return a flag up front. I don't think it's a matter of taste when the result is loss of functionality (i.e. it's not natural to have a pseudo-index for iterators like varargs(...), or sparse_array:values()). >> - can arrays hold the nil? those "defined" by ipairs() can't, but what >> if I provide the bounds myself? lua hints me that indexing integer >> keys is not a hash operation and seems to be all I need to know.. so >> is ipairs() really needed? I mean apart from being bad PR making some >> people believe that arrays are crippled in Lua, along with the darn # >> operator. > > The array is not such a fundamental data structure in Lua, as opposed > to C for example. I think all these pseudo-problems around them > quickly vanish once you start programming in Lua "à la Lua". > I'm getting there :) But (I'm not letting this go you see) if I write a function that supposedly works with the "array part" of a table, and not just with an "array", then I must be careful not to use #t and only use ipairs() instead. Or maybe I shouldn't care and always ask for a proper array? From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 12:45:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SFjbKl020711; Tue, 28 Jul 2009 12:45:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDBD11930A; Tue, 28 Jul 2009 12:45:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f207.google.com (mail-ew0-f207.google.com [209.85.219.207]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C99218F94 for ; Tue, 28 Jul 2009 12:45:00 -0300 (BRT) Received: by ewy3 with SMTP id 3so124097ewy.7 for ; Tue, 28 Jul 2009 08:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=2Htz5OrNPzCUN/wCefAaqAFWhVKNS3tyFhI5TJxsZVQ=; b=T1/uoUVcQjJcdm9ux2kPChHva8Ze3g0p/g3xYRiO77Qww1kSWrynmGMa48OV7xTJbC mJ0i6Ew7M013eTCv84Vo62UMQdIxw/XCKIFpg/LZ7HXM1YuttfIhXEy87N75CZAsLEe3 GuampnSgAe7SzMNzTYkiETr3X0N6DnPgBQA2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jgRrk+MQgDD2i3xm86TcWTDmR9CM2HHpIROiSI1aZJX4ux/O+ni3LiXLGAxiE4+Kak 5K1o19YzefekuLO3roKLMGQYwqZdl4lyOM4e45EWH1fOX9U7Tdftg1vGunkQE4BbfT/a FGgbPFTcpOfyFAm8xXY6aZahq5vkNZvVVoUGw= MIME-Version: 1.0 Received: by 10.216.87.67 with SMTP id x45mr1019365wee.18.1248795896118; Tue, 28 Jul 2009 08:44:56 -0700 (PDT) In-Reply-To: References: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> From: Jerome Vuarand Date: Tue, 28 Jul 2009 17:44:36 +0200 Message-ID: <89d273ba0907280844ned3a994j4a14633f16715d0b@mail.gmail.com> Subject: Re: tables holding nil: another way to look at the question itself To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SFjbKl020711 2009/7/28 Cosmin Apreutesei : >>> - why is there a difference between a list of nil arguments and no >>> argument? --> nil is acting like any other value here. >> >> That's an extra feature provided for convenience. Just like you can >> see tables as infinite key-value pairs, you can see argument list as >> infinite list of values, defaulting to nil. As a convenience you can >> get the number of values that was actually passed to a function call, >> but you can still access all elements of the argument list (just call >> select(42, ...) for example). > > Yea, but providing the arg. count is leaking the abstraction. If I am > to make an optional parameter in the middle of the arg. list, should I > account for the real arg. count or use an ipairs()-like iteration? In > other words, should I account for trailing nils? What if some other > function that my function wraps up is sensible about the arg. count as > well? I have to carry around arg. count everywhere. Whereas without > this leak, {...} would had been enough. Vararg lists are special kind of objects that you cannot instantiate or reference. They are not tables. You don't have to use or allow the vararg feature of Lua. You can write functions that expect a fixed number of arguments, no more and no less (even with forced trailing nils). >> nil is a normal value, just like 42, true, false and "Hello World!". >> The authors decided that the value associated to nil in a table should >> always be nil, that key-value pair is read-only. Sometimes you have to >> accept exceptions to the rule. That exception has motivations >> (previously discussed on that list). > > I dig it. But then __index should not be called for the nil key to > make sure the rule is not broken. We're talking about an exception, why should it obey another rule ? Also the read-only nil-key pair is a feature of tables, while index and newindex let you build other types of objects (eventually with different semantics) on top of tables. Keep in mind that index and newindex in tables are exceptions in the real of metamethods, because they let you override a behaviour that is otherwise perfectly defined and valid. >> It simplifies the iterator protocol a lot to mark the end of iteration >> with a special value rather than another mechanism. Whatever the >> special value (currently it's nil), if it's a regular value, it >> implies you cannot iterate over it. As with most questions of this >> thread it's mostly a matter of taste. > > This I don't buy. How does it simplifies it? The few iterators that I > wrote don't get any more complex if they return a flag up front. I > don't think it's a matter of taste when the result is loss of > functionality (i.e. it's not natural to have a pseudo-index for > iterators like varargs(...), or sparse_array:values()). Actually, all you're asking for is to hide the first variable of a for loop. Because nothing prevent you from using your proposed iterators with the current for loop. The only real difference is that the flag variable is not hidden. I can't count how often I skip the first variable of a pairs loop: for _,value in pairs(t) do process(value) end The _ variable is a very common way to "skip" an unneeded value. Also a side effect of the current iterator protocol is that it plays nicely with table indexing. For example in local t = {} for x in values(...) do t[x] = true end you are sure that the loop content will not throw an error (of course the iterator itself can). That's not a crucial feature, but that's one nonetheless. >> The array is not such a fundamental data structure in Lua, as opposed >> to C for example. I think all these pseudo-problems around them >> quickly vanish once you start programming in Lua "à la Lua". > > I'm getting there :) > > But (I'm not letting this go you see) if I write a function that > supposedly works with the "array part" of a table, and not just with > an "array", then I must be careful not to use #t and only use ipairs() > instead. Or maybe I shouldn't care and always ask for a proper array? When I talked about "à la Lua" programming, I meant that in Lua you have much more powerful data structures than in C. With a simple pair of curly braces, you can have maps, sets, arbitrary complex object structures, without the hassle to predeclare that structure. So cases where you really need an array are very few. And for these cases, you should ask yourself what defines an array in that precise situation. Of course you have the basic "i in ipairs(t)" vs. "i=1,#t". But also should your function taking an array ignore the hash part of the table ? Should it throw an error ? Should it copy it in the output array if any ? From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 16:08:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SJ8gK3004799; Tue, 28 Jul 2009 16:08:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39E1B18C54; Tue, 28 Jul 2009 16:07:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB01518C15 for ; Tue, 28 Jul 2009 16:07:53 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKzpbkqDaFvI/2dsb2JhbADEdQqRMoQQBYdR X-IronPort-AV: E=Sophos;i="4.43,284,1246852800"; d="scan'208";a="40837034" Received: from darling.cs.uoguelph.ca ([131.104.91.200]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 28 Jul 2009 15:07:49 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 3A2EE940073 for ; Tue, 28 Jul 2009 15:07:49 -0400 (EDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at darling.cs.uoguelph.ca Received: from darling.cs.uoguelph.ca ([127.0.0.1]) by localhost (darling.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QDhWKzvxb3Es for ; Tue, 28 Jul 2009 15:07:48 -0400 (EDT) Received: from [127.0.0.1] (muncher.cs.uoguelph.ca [131.104.91.102]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id CD9819400D4 for ; Tue, 28 Jul 2009 15:07:47 -0400 (EDT) Message-ID: <4A6F4C82.7080001@gmail.com> Date: Tue, 28 Jul 2009 15:07:46 -0400 From: Ben Kelly User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Lua list Subject: [ANN] vstruct 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean That's right, it's out of beta! 1.0.x is now feature complete; everything else is just bugfixing, and I'm starting work on 1.1. You may be wondering why 1.0 was never announced. Well, shortly after I pushed it and on the day I was going to announce it, sanooj reported some serious bugs in the floating point handling. He also contributed a set of floating point tests which are now available as tests/fp-*.lua; these were invaluable in fixing said bugs. Props. We now return you to your regularly scheduled announcement email. What is it? A library for packing and unpacking binary data, not unlike lhf's lpack or Roberto's struct library. It is written in pure Lua and supports a wide variety of data types and several advanced features. (It doesn't support bitpacks yet, but that's in for 1.1.) Why use it? - read and write support for signed and unsigned integers, fixed point rationals, fixed-length, null-terminated, null-padded & counted strings, skipping and padding, booleans, floats, and bitmasks - unpack/pack from/to strings, files, or anything that supports file-like :read/:write/:seek operations - any type can be any byte-aligned width - 24-bit integers? booleans stored as uint32_ts? 128-bit masks? No problem. - supports naming, grouping and repetition of fields (and groups, nested arbitrarily deep). You can specify the structure of the data in the format string and get back a table with conveniently named fields (and possibly subtables); and then you can unpack an array of 10,000 of them just by putting "* 10000" on the end. - written entirely in Lua, and thus very portable and easy to extend. Why NOT use it? - written entirely in Lua, and thus slower and more memory-hungry than C equivalents - no support for bit-aligned fields (yet) - all fields must be byte aligned Who wrote it? - Peter Cawley (Corsix) contributed the original floating point module, which the current one is based on. - M Joonas Pihlaja (sanooj) contributed a huge amount of testing and numerous bug reports, of which the floating point bugs mentioned above are only the most recent; without his constant prodding this library would probably never have seen release. - The rest of it was written by me, Ben Kelly (ToxicFrog). What's planned for 1.1? - bitfield support Where is it? The project is available via github at: http://github.com/ToxicFrog/vstruct The latest release can be downloaded from: http://github.com/ToxicFrog/vstruct/archives/v1.0.1 And the README: http://github.com/ToxicFrog/vstruct/blob/f1af3eda6bf346aa884b48a5b62a28d0783f1c23/README From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 17:01:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SK1Ed5017483; Tue, 28 Jul 2009 17:01:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA40618B38; Tue, 28 Jul 2009 17:00:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod6og105.obsmtp.com (exprod6og105.obsmtp.com [64.18.1.189]) by bazar2.conectiva.com.br (Postfix) with SMTP id B461918AB4 for ; Tue, 28 Jul 2009 17:00:30 -0300 (BRT) Received: from source ([207.168.191.2]) by exprod6ob105.postini.com ([64.18.5.12]) with SMTP ID DSNKSm9Y2m48QmNGT0YtPnvyRgaHZXytqRW9@postini.com; Tue, 28 Jul 2009 13:00:32 PDT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: Error Handling Part 2 Date: Tue, 28 Jul 2009 12:59:11 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Error Handling Part 2 Thread-Index: AcoPvd+5r8v7+b0cQMCaEtmHIRb48w== From: "John Dunn" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SK1Ed5017483 I've made a little more progess on getting better error reporting when overriding __newindex. If I implement my __newindex in C instead of lua I can better control the error that is reported. Take the following code as an example - static int SetValue( lua_State* L ) { MyObject* obj = *(MyObject**)luaL_checkudata(L,1, MyObjectClass);; double val = luaL_checknumber(L,2); std::cout << "SetValue " << val << std::endl; if( val > 10 ) { luaL_error(L, "value too big"); } obj->value = val; return 0; } static const struct luaL_reg MyObjectInstanceMethods[] = { { "SetValue", SetValue }, {NULL,NULL} }; static int NewIndex( lua_State* L ) { MyObject* obj = *(MyObject**)luaL_checkudata(L,1, MyObjectClass); std::string key = luaL_checkstring(L,2); if( key == "Value" ) { double value = luaL_checknumber(L,3); if( value > 10 ) { lua_pushstring(L,"value too big"); lua_error(L); } obj->set_value(value); } return 0; } int luaMyObjectOpen( lua_State* L ) { luaL_newmetatable( L, MyObjectClass ); lua_pushvalue(L, -1); lua_pushvalue(L, -1); // normal index lua_setfield(L, -2, "__index"); luaL_register( L, NULL, MyObjectInstanceMethods ); // __newindex lua_pushcfunction(L, NewIndex); lua_setfield(L, -2, "__newindex"); luaL_openlib(L, "Object", ObjectLibMethods, 0); return 0; } The goal is that if a user specifies a value greater than 9, an error should be raised. If the user uses the SetValue function directly, I get exactly the error reporting I desire- obj = Object.New() obj:SetValue(12) ----------- test.lua:2: value too big But if I use the __newindex interface to set the value, I don't get the line number obj = Object.New() obj.Value = 12 ----------- value too big When I raise the error inside my NewIndex function, is there a way to get the current line number from the script being executed so it acts the same as the :SetValue() call? From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 18:57:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SLv6En008053; Tue, 28 Jul 2009 18:57:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DFD718E57; Tue, 28 Jul 2009 18:56:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1591218B91 for ; Tue, 28 Jul 2009 18:56:26 -0300 (BRT) X-AuditID: ac100205-000016ac00000608-25-4a6f73fc7e95 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Jul 2009 17:56:12 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Tue, 28 Jul 2009 17:56:12 -0400 From: "King, Mike" To: Lua list Date: Tue, 28 Jul 2009 17:56:07 -0400 Subject: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoPzjW5qyyt9M4QSS6hAV7fI48U3g== Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: AUCX BvYU CUCr CdQ6 Cv1E Drmp D28C ET1o FTEz JcH4 Jtex J6K4 KEL4 K3EC K+iq Lkvi; 1; bAB1AGEAQABiAGEAegBhAHIAMgAuAGMAbwBuAGUAYwB0AGkAdgBhAC4AYwBvAG0ALgBiAHIA; Sosha1_v1; 7; {3D790128-D29D-4F3A-B88B-B5A22C71040D}; bQBrAGkAbgBnAEAAawBsAG0AaQBjAHIAbwB3AGEAdgBlAC4AYwBvAG0A; Tue, 28 Jul 2009 21:56:07 GMT; bAB1AGEAYwBvAG0AOgAgAHcAaAB5ACAAbgBvACAAUgBlAGwAZQBhAHMAZQAoACkAPwA= x-cr-puzzleid: {3D790128-D29D-4F3A-B88B-B5A22C71040D} acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SLv6En008053 Why is it that COM objects are not gc'ed (Released) when Lua exits? CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 19:56:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SMuhXR020645; Tue, 28 Jul 2009 19:56:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B84FF18CD5; Tue, 28 Jul 2009 19:56:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3573718C43 for ; Tue, 28 Jul 2009 19:56:08 -0300 (BRT) Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n6SMu39o032631 for ; Tue, 28 Jul 2009 19:56:05 -0300 Message-ID: <4A6F81FB.20208@inconcertcc.com> Date: Tue, 28 Jul 2009 19:55:55 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: luacom: why no Release()? References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean King, Mike wrote: > Why is it that COM objects are not gc'ed (Released) when Lua exits? > Well, they are. Under which circumstances it is failing to release your objects?? For instance, this test script instances a COM object of mine, which shows a message box when it is finally released, and it works fine: require"luacom" a = luacom.CreateObject("foo.bar") when the script ends, I got my message box as intended. Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 20:44:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SNibtl000399; Tue, 28 Jul 2009 20:44:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1514618F84; Tue, 28 Jul 2009 20:44:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 604D218EA0 for ; Tue, 28 Jul 2009 20:43:59 -0300 (BRT) X-AuditID: ac100205-00001e9400000608-e8-4a6f8d334983 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Jul 2009 19:43:47 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Tue, 28 Jul 2009 19:43:47 -0400 From: "King, Mike" To: Lua list Date: Tue, 28 Jul 2009 19:42:23 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoP1prnk2sAcNpqRUWclEqp2uqTtAABnNih Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com>, <4A6F81FB.20208@inconcertcc.com> In-Reply-To: <4A6F81FB.20208@inconcertcc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SNibtl000399 require"luacom" excel = luacom.GetObject("Excel.Application") ________________________________________ From: lua-bounces@bazar2.conectiva.com.br [lua-bounces@bazar2.conectiva.com.br] On Behalf Of Ignacio Burgueño [ignaciob@inconcertcc.com] Sent: Tuesday, July 28, 2009 6:55 PM To: Lua list Subject: Re: luacom: why no Release()? King, Mike wrote: > Why is it that COM objects are not gc'ed (Released) when Lua exits? > Well, they are. Under which circumstances it is failing to release your objects?? For instance, this test script instances a COM object of mine, which shows a message box when it is finally released, and it works fine: require"luacom" a = luacom.CreateObject("foo.bar") when the script ends, I got my message box as intended. Regards, Ignacio Burgueño CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 20:47:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6SNl6dk000989; Tue, 28 Jul 2009 20:47:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 977B918F94; Tue, 28 Jul 2009 20:46:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AF3D18F8B for ; Tue, 28 Jul 2009 20:46:42 -0300 (BRT) Received: by ewy26 with SMTP id 26so463101ewy.5 for ; Tue, 28 Jul 2009 16:46:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.78.16 with SMTP id a16mr10712173ebb.73.1248824800368; Tue, 28 Jul 2009 16:46:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 Jul 2009 19:46:40 -0400 X-Google-Sender-Auth: 995aba57b29d8af0 Message-ID: Subject: Re: Error Handling Part 2 From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6SNl6dk000989 On Tue, Jul 28, 2009 at 3:59 PM, John Dunn wrote: >    luaL_error(L, "value too big"); > ... >    lua_pushstring(L,"value too big"); >    lua_error(L); > ,,, > When I raise the error inside my NewIndex function, is there a way to > get the current line number from the script being executed so it acts > the same as the :SetValue() call? luaL_error (unlike lua_error) prepends line info [1]. In fact, the implementation of luaL_error calls luaL_where [2]: LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { va_list argp; va_start(argp, fmt); luaL_where(L, 1); lua_pushvfstring(L, fmt, argp); va_end(argp); lua_concat(L, 2); return lua_error(L); } [1] http://www.lua.org/manual/5.1/manual.html#luaL_error [2] http://www.lua.org/manual/5.1/manual.html#luaL_where From lua-bounces@bazar2.conectiva.com.br Tue Jul 28 21:34:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6T0YNXp007739; Tue, 28 Jul 2009 21:34:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E2EF18FDF; Tue, 28 Jul 2009 21:33:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E8DE18F06 for ; Tue, 28 Jul 2009 21:33:51 -0300 (BRT) Received: by ewy26 with SMTP id 26so482979ewy.5 for ; Tue, 28 Jul 2009 17:33:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.82.13 with SMTP id f13mr10711944ebb.95.1248827628105; Tue, 28 Jul 2009 17:33:48 -0700 (PDT) In-Reply-To: <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> Date: Tue, 28 Jul 2009 20:33:45 -0400 X-Google-Sender-Auth: 473a9fc4690007d7 Message-ID: Subject: Re: is it possible to make longjmp-free Lua? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 28, 2009 at 1:50 AM, Mark Hamburg wrote: > I like the light userdata holding the C function pointer trick. Of course, > we still need a way to push without throwing or at least to guarantee the > existence of stack space without throwing. We have at least LUA_MINSTACK positions available. lua_pushlightuserdata and many of the other lua_push* functions are guaranteed not to fail if stack space is available. The few that can fail (e.g. lua_pushstring) due to memory allocation can be wrapped in a pcall that returns the constructed object on the stack. Stack space usage can be determined by static code analysis. If we need more than LUA_MINSTACK, then we can call lua_checkstack. However, lua_checkstack can longjump. We cannot just wrap lua_checkstack alone in a pcall since pcall runs under a different stack space. We'd normally be advised to refactor our code so that the lua_checkstack and whatever other operations we'd want to perform are both inside that pcall. However, I can think of a workaround to avoid refactoring: lua_pcall an empty function with nresults set to the number of stack spaces you want to add and then pop the nil's from the stack. This has the same effect as lua_checkstack but will never longjump. A much better solution would be for Lua to provide a version lua_checkstack that doesn't longjump. Preventing longjumps is a recurring problem of mine that pushes toward refactoring code in a way I don't want or going through contortions. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 04:19:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6T7JhUZ017852; Wed, 29 Jul 2009 04:19:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C89A192E6; Wed, 29 Jul 2009 04:19:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11B4F19143 for ; Wed, 29 Jul 2009 04:19:00 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 83348E00B1 for ; Wed, 29 Jul 2009 10:18:52 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: is it possible to make longjmp-free Lua? References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> Date: Wed, 29 Jul 2009 10:18:48 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > A much better solution would be for Lua to provide a version > lua_checkstack that doesn't longjump. Preventing longjumps is a > recurring problem of mine that pushes toward refactoring code in a way > I don't want or going through contortions. > I started experimenting with a code like in a patch below[*], and immediately stepped on rakes with luaD_throw usage in the Lua core. One case is the throw that you are talking about (ldo.c): /* ** generic allocation routine. */ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); block = (*g->frealloc)(g->ud, block, osize, nsize); if (block == NULL && nsize > 0) luaD_throw(L, LUA_ERRMEM); <<<<<<<<<<<<<<<<<<<<<<< here, and making THROW a nop breaks everything :( lua_assert((nsize == 0) == (block == NULL)); g->totalbytes = (g->totalbytes - osize) + nsize; return block; } This is the only place where lua_checkstack can throw that I found. But a big one. Because of this Lua code always assumes that memory allocation is successful. So going that way would mean patching big part of the core. I still feel that it is worth it in a long run. However, if you only need to be assured that lua_checkstack will not throw, you can do something like: safe_checkstack(L, n) { void *p = luaM_malloc(L, 0, 0, how_much_mem_it_will_take(n)); if (!p) return 0; luaM_free(p); lua_checkstack(L, n); return 1; } [*] a toy patch: diff -Nurbd ../../lua-5.1.4/src/luaconf.h ./luaconf.h --- ../../lua-5.1.4/src/luaconf.h 2008-02-11 18:25:08.000000000 +0200 +++ ./luaconf.h 2009-07-28 11:42:14.000000000 +0300 @@ -603,7 +604,19 @@ ** compiling as C++ code, with _longjmp/_setjmp when asked to use them, ** and with longjmp/setjmp otherwise. */ -#if defined(__cplusplus) + +#if ! defined(LUA_NOUNWIND) +#define LUAI_HASERROR(L) 0 +#endif + +#if defined(LUA_NOUNWIND) +/* Slow exceptions without stack unwinding */ +#define LUAI_HASERROR(L) lua_haserror(L) +#define LUAI_THROW(L,c) (void) 0 +#define LUAI_TRY(L,c,a) { a } +#define luai_jmpbuf int /* dummy variable */ + +#elif defined(__cplusplus) /* C++ exceptions */ #define LUAI_THROW(L,c) throw(c) #define LUAI_TRY(L,c,a) try { a } catch(...) \ diff -Nurbd ../../lua-5.1.4/src/lua.h ./lua.h --- ../../lua-5.1.4/src/lua.h 2008-08-06 16:30:12.000000000 +0300 +++ ./lua.h 2009-07-28 09:50:14.000000000 +0300 @@ -112,6 +112,9 @@ LUA_API lua_State *(lua_newthread) (lua_State *L); LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); +#if defined(LUA_NOUNWIND) +LUA_API int lua_haserror(lua_State *); +#endif From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 06:35:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6T9ZL0E030159; Wed, 29 Jul 2009 06:35:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 395E8192EE; Wed, 29 Jul 2009 06:34:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4321B18A9B for ; Wed, 29 Jul 2009 06:34:46 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 9032EE00A6 for ; Wed, 29 Jul 2009 12:34:37 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: is it possible to make longjmp-free Lua? References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Wed, 29 Jul 2009 12:34:34 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 28 Jul 2009 06:18:04 +0300, David Manura wrote: > I was thinking of posting something on this exact performance problem > with lua_cpcall allocating a new function object on each call. The > allocation can be avoided. In brief....first construct a Lua C > function that when executed calls the C function pointer stored in the > lightuserdata passed as the first argument. This is done only once. > Now, whenever you need to call a C function, lua_pushvalue that Lua C > function mentioned previously, lua_pushlightuserdata the C function > pointer you want to call, and finally do the lua_pcall. All three > operations never longjump and are safe, assuming you have sufficient > stack space. The approach does assume that C function pointers can > fit inside a lightuserdata, which is usually safe in practice. I had > done some micro-benchmarking of this and got a good speedup. May I ask how big was your speedup? I just tried microbenchmark with lua_cpcall and the following: int my_auxcpcall(lua_State *L) { lua_CFunction f = (lua_CFunction) lua_topointer(L, -1); lua_pop(L, 1); return f(L); } int my_cpcall(lua_State *L, lua_CFunction func, void *ud) { lua_pushvalue(L, myauxcpcallIdx); /* global reference index that has my_auxcpcall CFunction value */ lua_pushlightuserdata(L, ud); lua_pushlightuserdata(L, (void *) func); return lua_pcall(L, 2, 0, 0); } and got 0.15 vs 0.22 seconds on 1000000 calls on core2, and 40 vs 47 seconds on mips. I was expecting something more spectacular... From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 11:28:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TESRQU008827; Wed, 29 Jul 2009 11:28:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3518E192CD; Wed, 29 Jul 2009 11:27:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.4funding.com (mail3.4funding.com [63.144.177.234]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 218E619143 for ; Wed, 29 Jul 2009 11:27:43 -0300 (BRT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA1058.B987382E" X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Date: Wed, 29 Jul 2009 10:27:37 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Index: AcoQWLjn7d5M3F8vTdqREBEAHPpe8g== X-Priority: 1 Priority: Urgent Importance: high From: "Raju Thomas" To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA1058.B987382E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable =20 Good Morning Lua Members, My name is Raj Thomas and I am a National Technical Recruiter with Total Technical Services (TTS), we a National Firm out of Massachusetts. I was introduced to this group by one of your members, I am not sure if there a lot of recruiters who use this forum. I would how ever like to let the members know that I have a contract opportunity in the California area that is looking for people with experience in C Programming and Lua. If this is of interest to you or if you would like further information please reach out to me directly via email. Sincerely,=20 =20 =20 Raj Thomas Technical Recruiter Total Technical Services 315 College Farm Rd. Suite 2 Waltham, MA. 02451 800-776-0562 ext 305 781-899-4497 local 888-887-6285 fax rthomas@total-tech.com =20 ------_=_NextPart_001_01CA1058.B987382E Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

Good Morning Lua = Members,


      My name is Raj Thomas and I am a National = Technical Recruiter with Total Technical Services (TTS), we a National Firm out of Massachusetts.   I was = introduced to this group by one of your members, I am not sure if there a lot of recruiters = who use this forum.  I would how ever like to let the members know that = I have a contract opportunity in the California area that is looking for people with experience in C Programming and = Lua.  If this is of interest to you or if you would like further information = please reach out to me directly via email.


Sincerely,

 

 

Raj Thomas

Technical Recruiter
Total Technical Services
315 College Farm Rd. = Suite 2
Waltham, MA. 02451
800-776-0562 ext 305
781-899-4497 local
888-887-6285 fax
rthomas@total-tech.com

 

------_=_NextPart_001_01CA1058.B987382E-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 11:40:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TEeqCG011591; Wed, 29 Jul 2009 11:40:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65360192F7; Wed, 29 Jul 2009 11:40:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B35719027 for ; Wed, 29 Jul 2009 11:40:23 -0300 (BRT) Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n6TEeK1u002124 for ; Wed, 29 Jul 2009 11:40:21 -0300 Message-ID: <4A705F4B.3050604@inconcertcc.com> Date: Wed, 29 Jul 2009 11:40:11 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: luacom: why no Release()? References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com>, <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean King, Mike wrote: > require"luacom" > excel = luacom.GetObject("Excel.Application") > I've no Office installed here so I can't test, but I presume that when your script ends, excel.exe process won't go away. I think you need to call Close or Quit or something like that. require"luacom" excel = luacom.GetObject("Excel.Application") excel:Close() -- or excel:Quit() Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 11:50:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TEoYSp013859; Wed, 29 Jul 2009 11:50:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EB4119304; Wed, 29 Jul 2009 11:50:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8949B192FE for ; Wed, 29 Jul 2009 11:50:01 -0300 (BRT) MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_Qsq+ZYVbpJ0wMIKk3Vxjww)" Received: from michel ([24.202.165.131]) by VL-MO-MR004.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with SMTP id <0KNJ005M4T7AYS80@VL-MO-MR004.ip.videotron.ca> for lua@bazar2.conectiva.com.br; Wed, 29 Jul 2009 10:49:59 -0400 (EDT) Message-id: <42FDF929DAAF4E5592F24FDD594B4272@michel> From: michel To: Lua list References: Subject: Re: Date: Wed, 29 Jul 2009 10:50:03 -0400 X-Priority: 3 X-MSMail-priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090728-0, 07/28/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --Boundary_(ID_Qsq+ZYVbpJ0wMIKk3Vxjww) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Thank for not providing a subject, so I was forced to read the email to figure out that it was of no importance to me. marking it ha high priority was a nice touch. ----- Original Message ----- From: Raju Thomas To: lua@bazar2.conectiva.com.br Sent: Wednesday, July 29, 2009 10:27 AM Good Morning Lua Members, My name is Raj Thomas and I am a National Technical Recruiter with Total Technical Services (TTS), we a National Firm out of Massachusetts. I was introduced to this group by one of your members, I am not sure if there a lot of recruiters who use this forum. I would how ever like to let the members know that I have a contract opportunity in the California area that is looking for people with experience in C Programming and Lua. If this is of interest to you or if you would like further information please reach out to me directly via email. Sincerely, Raj Thomas Technical Recruiter Total Technical Services 315 College Farm Rd. Suite 2 Waltham, MA. 02451 800-776-0562 ext 305 781-899-4497 local 888-887-6285 fax rthomas@total-tech.com --Boundary_(ID_Qsq+ZYVbpJ0wMIKk3Vxjww) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
Thank for not providing a subject, so I was forced to read the email to figure out that it was of no importance to me. marking it ha high priority was a nice touch.
 
 
 
----- Original Message -----
Sent: Wednesday, July 29, 2009 10:27 AM

 

Good Morning Lua Members,


      My name is Raj Thomas and I am a National Technical Recruiter with Total Technical Services (TTS), we a National Firm out of Massachusetts.   I was introduced to this group by one of your members, I am not sure if there a lot of recruiters who use this forum.  I would how ever like to let the members know that I have a contract opportunity in the California area that is looking for people with experience in C Programming and Lua.  If this is of interest to you or if you would like further information please reach out to me directly via email.


Sincerely,

 

 

Raj Thomas

Technical Recruiter
Total Technical Services
315 College Farm Rd. Suite 2
Waltham, MA. 02451
800-776-0562 ext 305
781-899-4497 local
888-887-6285 fax
rthomas@total-tech.com

 

--Boundary_(ID_Qsq+ZYVbpJ0wMIKk3Vxjww)-- From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 11:55:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TEtBWU014698; Wed, 29 Jul 2009 11:55:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7445119313; Wed, 29 Jul 2009 11:54:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04EE61930B for ; Wed, 29 Jul 2009 11:54:43 -0300 (BRT) X-AuditID: ac100205-0000111000000608-f8-4a7062a82459 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 10:54:32 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 10:54:31 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 10:54:30 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQWoLiDQtfO4pnQGu7aafOcnW+BwAALZhw Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com>, <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> <4A705F4B.3050604@inconcertcc.com> In-Reply-To: <4A705F4B.3050604@inconcertcc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6TEtBWU014698 > I've no Office installed here so I can't test, but I presume that when > your script ends, excel.exe process won't go away. I think you need to > call Close or Quit or something like that. > require"luacom" > excel = luacom.GetObject("Excel.Application") > excel:Close() -- or excel:Quit() I have a script that can run forever until someone terminates it. The script runs in a Windows console window. What should happen when someone closes the window? I don't believe Lua has a way to hook the TERM signal. How can I call Close() or Quit()? CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 11:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TEuK5t015013; Wed, 29 Jul 2009 11:56:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E1381931E; Wed, 29 Jul 2009 11:56:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35E1119310 for ; Wed, 29 Jul 2009 11:55:59 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MWAZR-0003AJ-00; Wed, 29 Jul 2009 16:55:57 +0200 Date: Wed, 29 Jul 2009 16:55:26 +0200 From: Mike Pall To: Lua list Subject: Re: [Bug?] 0 vs -0 / Incorrect Optimization or Parsing Message-ID: <20090729145526.GA16468@mike.de> References: <20090728020041.AOT16079@mymail.erau.edu> <20090728093428.GA4517@mike.de> <20090728105634.A20372@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090728105634.A20372@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > > This is a known issue and there's even a bug fix for it: > > > > http://lua-users.org/lists/lua-l/2008-04/msg00136.html > > > > But for some reason that fix never went into Lua 5.1.4. :-( > > It will be in Lua 5.2. Err, but this is a genuine bug, not a new feature. IMHO a fix for it should be merged into Lua 5.1.5 (like all the other pending bug fixes). BTW: same problem, but not fixed by the provided patch: $ lua -e "print(-2^-2000, 0)" -0 -0 (Should print -0 and 0) --Mike From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 12:04:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TF4DcG016607; Wed, 29 Jul 2009 12:04:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84C2A1932A; Wed, 29 Jul 2009 12:03:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E37A419323 for ; Wed, 29 Jul 2009 12:03:40 -0300 (BRT) Received: by ewy26 with SMTP id 26so942845ewy.5 for ; Wed, 29 Jul 2009 08:03:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.9.81 with SMTP id 59mr2278059wes.181.1248879819229; Wed, 29 Jul 2009 08:03:39 -0700 (PDT) In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> <4A705F4B.3050604@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> Date: Wed, 29 Jul 2009 16:03:39 +0100 X-Google-Sender-Auth: aac51cf7b9151d33 Message-ID: Subject: Re: luacom: why no Release()? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6TF4DcG016607 On Wed, Jul 29, 2009 at 3:54 PM, King, Mike wrote: > The script runs in a Windows console window.  What should happen when someone closes the window?  I don't believe Lua has a way to hook the TERM signal.  How can I call Close() or Quit()? I would use the undocumented newproxy function to create a global userdata and attach a __gc handler to be called when Lua closes: C:\Users\Peter>lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > _X = newproxy(true) > getmetatable(_X).__gc = function() print "Goodbye" end > Goodbye ^C From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 15:15:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TIFaBa029489; Wed, 29 Jul 2009 15:15:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60A0C19310; Wed, 29 Jul 2009 15:15:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08BC91923D for ; Wed, 29 Jul 2009 15:14:57 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TIEt28029374 for ; Wed, 29 Jul 2009 15:14:55 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6TIEr903688; Wed, 29 Jul 2009 15:14:53 -0300 Date: Wed, 29 Jul 2009 15:14:52 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [Bug?] 0 vs -0 / Incorrect Optimization or Parsing Message-ID: <20090729151452.A3639@lua.tecgraf.puc-rio.br> References: <20090728020041.AOT16079@mymail.erau.edu> <20090728093428.GA4517@mike.de> <20090728105634.A20372@lua.tecgraf.puc-rio.br> <20090729145526.GA16468@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20090729145526.GA16468@mike.de>; from mikelu-0907@mike.de on Wed, Jul 29, 2009 at 04:55:26PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Err, but this is a genuine bug, not a new feature. I agree it's annoying but I don't think it's a bug: Lua is based on C89 which (unlike C99) does not say much about floating-point types; there's certainly no mention of negative 0 and signed infinities. The only way to distinguish -0 from 0 is to compute their inverses, which is clearly a troublesome operation if you're not running on IEEE 754 hardware. > IMHO a fix for it should be merged into Lua 5.1.5 (like all the other > pending bug fixes). It probably will if there is a Lua 5.1.5 (also probable). From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 15:57:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TIvTte007199; Wed, 29 Jul 2009 15:57:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51B3519315; Wed, 29 Jul 2009 15:56:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 549F719307 for ; Wed, 29 Jul 2009 15:56:49 -0300 (BRT) X-AuditID: ac100205-000016ac00000608-df-4a709b630130 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 14:56:35 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 14:56:35 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 14:56:32 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQXcXs/qCvxyauS7W8sNOF+cjo0gAHVXuQ Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1704F1F@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> <4A705F4B.3050604@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6TIvTte007199 > I would use the undocumented newproxy function to create a global > userdata and attach a __gc handler to be called when Lua closes: > C:\Users\Peter>lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > _X = newproxy(true) > > getmetatable(_X).__gc = function() print "Goodbye" end > > > Goodbye > ^C Using the following code, I never see "Goodbye" printed. C:\Users\Mike>lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > require"luacom" > e=luacom.GetObject("Excel.Application") > _X = newproxy(true) > getmetatable(_X).__gc = function() >> e=nil -- or e:Quit() >> print"Goodbye" >> end ^C CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 16:09:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TJ94kx010371; Wed, 29 Jul 2009 16:09:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63C5D18FDF; Wed, 29 Jul 2009 16:08:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4D2C18C89 for ; Wed, 29 Jul 2009 16:08:34 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TJ8X5J010256 for ; Wed, 29 Jul 2009 16:08:33 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6TJ8WB03979; Wed, 29 Jul 2009 16:08:32 -0300 Date: Wed, 29 Jul 2009 16:08:32 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: luacom: why no Release()? Message-ID: <20090729160832.A3976@lua.tecgraf.puc-rio.br> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> <4A705F4B.3050604@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704F1F@KLMExch.klmicrowave.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704F1F@KLMExch.klmicrowave.com>; from MKing@klmicrowave.com on Wed, Jul 29, 2009 at 02:56:32PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Using the following code, I never see "Goodbye" printed. > > C:\Users\Mike>lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > require"luacom" > > e=luacom.GetObject("Excel.Application") > > _X = newproxy(true) > > getmetatable(_X).__gc = function() > >> e=nil -- or e:Quit() > >> print"Goodbye" > >> end > ^C Try ^Z instead of ^C... From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 16:28:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TJSTJ9014774; Wed, 29 Jul 2009 16:28:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84CB8190D8; Wed, 29 Jul 2009 16:28:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9758618FEB for ; Wed, 29 Jul 2009 16:27:55 -0300 (BRT) X-AuditID: ac100205-000016a800000608-51-4a70a2af2e37 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 15:27:43 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 15:27:43 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 15:27:41 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQf/stHKRVvcUPTpeS/dp8LRXmNwAAgmFw Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1704F55@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <4A6F81FB.20208@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1663AD6@KLMExch.klmicrowave.com> <4A705F4B.3050604@inconcertcc.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704DC5@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704F1F@KLMExch.klmicrowave.com> <20090729160832.A3976@lua.tecgraf.puc-rio.br> In-Reply-To: <20090729160832.A3976@lua.tecgraf.puc-rio.br> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6TJSTJ9014774 >> Using the following code, I never see "Goodbye" printed. >> >> C:\Users\Mike>lua >> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio >> > require"luacom" >> > e=luacom.GetObject("Excel.Application") >> > _X = newproxy(true) >> > getmetatable(_X).__gc = function() >> >> e=nil -- or e:Quit() >> >> print"Goodbye" >> >> end >> ^C > Try ^Z instead of ^C... I see "Goodbye" when I push ^Z^C but if I swap the order of when "e" and "_X" are assigned, I will not get the printout. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 18:43:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TLhZaO011436; Wed, 29 Jul 2009 18:43:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EED5618F84; Wed, 29 Jul 2009 18:43:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E510318E6D for ; Wed, 29 Jul 2009 18:42:56 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MWGv9-0006eO-RQ for lua@bazar2.conectiva.com.br; Wed, 29 Jul 2009 21:42:47 +0000 Received: from aaubervilliers-155-1-10-149.w83-199.abo.wanadoo.fr ([83.199.181.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jul 2009 21:42:47 +0000 Received: from PhiLho by aaubervilliers-155-1-10-149.w83-199.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jul 2009 21:42:47 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Date: Wed, 29 Jul 2009 23:42:33 +0200 Lines: 18 Message-ID: References: <42FDF929DAAF4E5592F24FDD594B4272@michel> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-10-149.w83-199.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: <42FDF929DAAF4E5592F24FDD594B4272@michel> X-Antivirus: avast! (VPS 090729-0, 29/07/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 29/07/2009 16:50, michel wrote: > *Thank for not providing a subject, so I was forced to read the email to > figure out that it was of no importance to me. marking it ha high > priority was a nice touch.* You are right, but while we are on the etiquette topic, general policy on the mailing list is to avoid HTML messages (indeed, the original one was HTML too) and avoiding top posting (OK, it might not be in the general policy but it is a general consensus, although broken by some regulars). Oh, and avoiding quoting unnecessarily the whole message you answer to. All this tend to bloat the message box... (except top posting, I admit). -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 19:41:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6TMf7OC019069; Wed, 29 Jul 2009 19:41:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8895418FEB; Wed, 29 Jul 2009 19:40:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B774718CE6 for ; Wed, 29 Jul 2009 19:40:29 -0300 (BRT) X-AuditID: ac100205-00000e1400000608-e3-4a70cfcd4018 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 18:40:13 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 18:40:13 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 18:40:12 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoPzjW5qyyt9M4QSS6hAV7fI48U3gAzc+UQ Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6TMf7OC019069 > Why is it that COM objects are not gc'ed (Released) when Lua exits? Why do I need to call collectgarbage() for the Excel instance to be closed? I have tried using weak tables and control-z followed by control-c. I have to call collectgarbage() before the Lua interpreter terminates. Does the garbage collector run when the process terminates? C:\Users\Mike>lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > require"luacom" > e=luacom.GetObject("Excel.Application") > e=nil > collectgarbage() CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 23:05:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U25UCx010103; Wed, 29 Jul 2009 23:05:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4296E18F43; Wed, 29 Jul 2009 23:05:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D417918D88 for ; Wed, 29 Jul 2009 23:04:56 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U24nSJ010033 for ; Wed, 29 Jul 2009 23:04:55 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n6U24k604808; Wed, 29 Jul 2009 23:04:46 -0300 Date: Wed, 29 Jul 2009 23:04:45 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: luacom: why no Release()? Message-ID: <20090729230445.A4802@lua.tecgraf.puc-rio.br> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com>; from MKing@klmicrowave.com on Wed, Jul 29, 2009 at 06:40:12PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Does the garbage collector run when the process terminates? The garbage collector runs when the Lua state is closed. The standard Lua interpreter closes its Lua state before exiting. The garbage collector does not run if the process terminates abnormaly or via an explicit call to os.exit. From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 23:07:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U27pZe010288; Wed, 29 Jul 2009 23:07:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54484190D3; Wed, 29 Jul 2009 23:07:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hermes.gamehouse.com (mail.gamehouse.com [216.127.40.134]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A93D319027 for ; Wed, 29 Jul 2009 23:07:28 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.gamehouse.com (Postfix) with ESMTP id 6256F8458AA for ; Wed, 29 Jul 2009 19:07:27 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new at gamehouse.com Received: from hermes.gamehouse.com ([127.0.0.1]) by localhost (hermes.gamehouse.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4aFUSF7ia0hh for ; Wed, 29 Jul 2009 19:07:22 -0700 (PDT) Received: from [10.0.1.2] (ddunham.seanet.com [64.38.167.24]) by hermes.gamehouse.com (Postfix) with ESMTP id E94EF84586F for ; Wed, 29 Jul 2009 19:07:21 -0700 (PDT) Message-Id: <51FF3F96-CA83-4516-A885-CFD75EBB2971@gamehouse.com> From: David Dunham To: Lua list In-Reply-To: <20090729230445.A4802@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: luacom: why no Release()? Date: Wed, 29 Jul 2009 19:07:22 -0700 References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> <20090729230445.A4802@lua.tecgraf.puc-rio.br> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean On 29 Jul 2009, at 19:04, Luiz Henrique de Figueiredo wrote: > The garbage collector runs when the Lua state is closed. The > standard Lua > interpreter closes its Lua state before exiting. The garbage > collector does > not run if the process terminates abnormaly or via an explicit call > to os.exit. To me this suggests that the average app should not close the Lua state -- who wants to wait for GC when your user is trying to quit? David Dunham Development Manager +1 206 926 5722 GameHouse Studios From lua-bounces@bazar2.conectiva.com.br Wed Jul 29 23:57:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U2v8J1015433; Wed, 29 Jul 2009 23:57:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C00071909C; Wed, 29 Jul 2009 23:56:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A6F718BA1 for ; Wed, 29 Jul 2009 23:56:36 -0300 (BRT) X-AuditID: ac100205-000016ac00000608-41-4a710bd70919 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 22:56:23 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 22:56:23 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 22:56:22 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQuoBksLvDFvcRRtCr3Plsa0gyrgABeGl4 Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1663AD7@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> <20090729230445.A4802@lua.tecgraf.puc-rio.br>, <51FF3F96-CA83-4516-A885-CFD75EBB2971@gamehouse.com> In-Reply-To: <51FF3F96-CA83-4516-A885-CFD75EBB2971@gamehouse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6U2v8J1015433 >> The garbage collector runs when the Lua state is closed. The >> standard Lua >> interpreter closes its Lua state before exiting. The garbage >> collector does >> not run if the process terminates abnormaly or via an explicit call >> to os.exit. >To me this suggests that the average app should not close the Lua >state -- who wants to wait for GC when your user is trying to quit? I would agree if one only allocates blocks of memory and not handles to external things like database connections, COM objects, etc. The OS will close some things like file handles and network sockets. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 00:24:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U3OhuW018859; Thu, 30 Jul 2009 00:24:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B0E418FCE; Thu, 30 Jul 2009 00:24:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C05F318D03 for ; Thu, 30 Jul 2009 00:24:09 -0300 (BRT) Received: by fxm25 with SMTP id 25so1179158fxm.5 for ; Wed, 29 Jul 2009 20:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=FNbsGKALbVzXtqtX23H/O9SQYEjhu77e4uV+yB62lAU=; b=XHklz3Pn3eAVzGhkNrnTM3IlHVBdBUJe7v22DhjkjoWxcnuxt6wxhXKTT5vVHxbxkC 4njqp5M7iyLxJ0tBeLyobA89+S5KeRGQr9YUuxJ+eFEu4IlqYiSIxdDEOgTXW3H8bjai PHSCoGjx3rv0CMWd8MN3/aiwV25AojCOJiXjo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type:content-transfer-encoding; b=gF+BYkrkLBxUYWVm5I9MyZcpKo6V2XHEPewQgeodGH460H6NnrJcWpi9eaZQGsXbm+ WfGY9uZ8V3usMwVQioIwJN5Fqqw9PRDFIdXFGKqWC1RLHAuYqU1qvH8YWqFwy59bnDzZ 239ve/qP95fidpoo1Y90nvRd7vB+8lR6ErAF8= MIME-Version: 1.0 Received: by 10.204.71.15 with SMTP id f15mr603793bkj.42.1248924248079; Wed, 29 Jul 2009 20:24:08 -0700 (PDT) From: Geoffroy Carrier Date: Thu, 30 Jul 2009 05:23:48 +0200 X-Google-Sender-Auth: 9ee2334d49f6fc02 Message-ID: Subject: [useless] Having some fun with lua To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello! An "ridiculous" evaluation of the Levenshtein distance in pure Lua: http://gist.github.com/158506/ I took no care in the "quality" of this code, so you might want to tear your eyes out. I'd be very interested in performance tweaks/code reduction, from minor remarks to global rewrites, as long as it remains pure Lua with standard libraries. I didn't think a lot about it, specially the use of table.sort which must be stupid. I used this dictionary: http://koon.fr/~gcarrier/web2 (from NetBSD). You can deduce from the commented block that I first intended to "build the whole map of words by proximity" (whatever that would have meant by the time I got there). But with computations taking up to dozens of seconds per word... Anyway, if someone wants to play on a clever and/or efficient way to do something around a dictionary, I'd be interested too! Something a little older now... Try to guess what this does (warning!! answer and thoughts below): guess = function(a,b) return a==0 and b or b==0 and a or a>b and guess(a-b,b) or guess(a,b-a) end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . These are dumb implementations of the Euclidean algorithm: http://gist.github.com/151987 Sometimes white spaces might help :) I'm looking for a precise analysis of the small time difference (5%). My current guess: - Tails call optimization in guess2(), not guess() - guess() checks whether if the first call returns true (which is pretty straightforward, as numeric). I'm pretty sure there are more complicated reasons... Any "bytecode expert" to enlighten my day? Is there a simple way to disable tail calls optimization, with no side effects (which excludes return(f()+0))? -- Geoffroy Carrier P.S.: I also recently started using lua for work. So I might have more serious messages in the future. Maybe not. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 00:31:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U3VFqP019435; Thu, 30 Jul 2009 00:31:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD826190E0; Thu, 30 Jul 2009 00:30:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72E8618F36 for ; Thu, 30 Jul 2009 00:30:49 -0300 (BRT) X-AuditID: ac100205-000016a800000608-84-4a7113dd34a7 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Jul 2009 23:30:37 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Wed, 29 Jul 2009 23:30:37 -0400 From: "King, Mike" To: Lua list Date: Wed, 29 Jul 2009 23:29:12 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQuiW/j34yZPC6Sau0Dss/lNDd0gAC8JM5 Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB1663ADA@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com>, <20090729230445.A4802@lua.tecgraf.puc-rio.br> In-Reply-To: <20090729230445.A4802@lua.tecgraf.puc-rio.br> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6U3VFqP019435 >> Does the garbage collector run when the process terminates? > The garbage collector runs when the Lua state is closed. The standard Lua > interpreter closes its Lua state before exiting. The garbage collector does > not run if the process terminates abnormaly or via an explicit call to os.exit. So I probably need to hook the SIGBREAK signal. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 01:00:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U40Kq7022251; Thu, 30 Jul 2009 01:00:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67C6219189; Thu, 30 Jul 2009 00:59:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D905619176 for ; Thu, 30 Jul 2009 00:59:51 -0300 (BRT) Received: by ewy26 with SMTP id 26so1389682ewy.5 for ; Wed, 29 Jul 2009 20:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=eqSMNv3wTRJWawJ1sTxJORy8gODF8u8AreCZzGB77wE=; b=vHALyHS9FgtD2CwKdi3lhadiAn+TdQfOdSeNcBBlBoZ8j24iwPsnFzqb9RrRZE40+u vqSD0cMRzlVe9yYmQd6NnE7yMpCsAmrkSAxEDf3vJ4miA9r2rqzTpG8lhle9sG+TJaHq TYMm8w9qfrsL2/bMCYXUAA9TsuX9jzWu1A2U0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=Q5JvN115+MjjUyMMPtPT5zeCvRdqdpaCksnLHCRQkDEZiInOtS8BSY+6xWJDYRR7Ai QF4N489g24ShVxjazqRj6MVnchnvrmN/PUTULACafe3d8nvBQXiLg3Gk/vpxBc8SZmKz WBwekdymZSW4S8F+xy0Q9OwWwEZugqLZqoz/s= Received: by 10.210.52.15 with SMTP id z15mr1001260ebz.36.1248926389403; Wed, 29 Jul 2009 20:59:49 -0700 (PDT) Received: from ?95.78.82.228? ([95.78.82.228]) by mx.google.com with ESMTPS id 24sm933554eyx.43.2009.07.29.20.59.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jul 2009 20:59:48 -0700 (PDT) Date: Thu, 30 Jul 2009 07:59:24 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <164478062.20090730075924@gmail.com> To: David Dunham Subject: Re[2]: luacom: why no Release()? In-Reply-To: <51FF3F96-CA83-4516-A885-CFD75EBB2971@gamehouse.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> <20090729230445.A4802@lua.tecgraf.puc-rio.br> <51FF3F96-CA83-4516-A885-CFD75EBB2971@gamehouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello David, Thursday, July 30, 2009, 6:07:22 AM, you wrote: > To me this suggests that the average app should not close the Lua > state -- who wants to wait for GC when your user is trying to quit? GC when all objects are to be freed should be rather fast operation. also, i see that some of my apps (uTorent, FireFox) having large shutdown time just hides themselves from desktop and continue hidden -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 05:43:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6U8hETB012567; Thu, 30 Jul 2009 05:43:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 014B518FCE; Thu, 30 Jul 2009 05:42:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.peterodding.com (mailinghelper.nl [79.99.133.60]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37FA418C2F for ; Thu, 30 Jul 2009 05:42:37 -0300 (BRT) Received: from [192.168.1.3] (82-136-228-62.ip.telfort.nl [82.136.228.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.peterodding.com (Postfix) with ESMTPSA id 2BDB1202B5B9 for ; Thu, 30 Jul 2009 08:57:58 +0000 (UTC) Message-ID: <4A715CF7.5060601@peterodding.com> Date: Thu, 30 Jul 2009 10:42:31 +0200 From: Peter Odding User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [useless] Having some fun with lua References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoffroy Carrier schreef: > Hello! > > An "ridiculous" evaluation of the Levenshtein distance in pure Lua: > http://gist.github.com/158506/ > I took no care in the "quality" of this code, so you might want to > tear your eyes out. > I'd be very interested in performance tweaks/code reduction, from > minor remarks to global rewrites, as long as it remains pure Lua with > standard libraries. I didn't think a lot about it, specially the use > of table.sort which must be stupid. I don't have any real insights but my implementation of Levenshtein uses a single Lua table to hold the whole matrix. I haven't a clue how much faster this is but it must account for something, with all that table creation :) function levenshtein(s, t) local d, sn, tn = {}, #s, #t local byte, min = string.byte, math.min for i = 0, sn do d[i * tn] = i end for j = 0, tn do d[j] = j end for i = 1, sn do local si = byte(s, i) for j = 1, tn do d[i*tn+j] = min(d[(i-1)*tn+j]+1, d[i*tn+j-1]+1, d[(i-1)*tn+j-1]+(si == byte(t,j) and 0 or 1)) end end return d[#d] end - Peter From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 07:22:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UAMdR4021565; Thu, 30 Jul 2009 07:22:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEA561A5DD; Thu, 30 Jul 2009 07:22:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22048321B3 for ; Thu, 30 Jul 2009 07:21:56 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so1127681fgb.5 for ; Thu, 30 Jul 2009 03:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=V8PmTgV58xHh4UsGlquu2NdOEUtYI58MtscHV/qRhtQ=; b=sMKTRT+uHGoQtyn1WjcILB9WtIpo28uPHZMGoYBkTLYCMfHB81qXnRMJp9ywNXQYMS OfK/WMryQk/jd1nx8gCfZt8Mk32Q+aTrBfwrqB6C4ud/Zc9t7rq2L6UXlcTb+jLDR37q +wTedsQV3TCS312pd2ErKtjTYbM93yKRQRRms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jYE2JE5B+idpX1Hr/uunGXq/bEFQ4iGNKWbupqPK7S491E5lB3wFO8Sbv0NU4JDwBK Sxduxmrht0Rt1cUrQY0z0yx0FigNexbvBo+/1Crskmb0WtDopIYPflAV5dUxbexSc0FS Zz0w1sSAuFBKioh/KQPNP/+c7JqOTh1vKGCRs= MIME-Version: 1.0 Received: by 10.86.92.13 with SMTP id p13mr354520fgb.43.1248949314948; Thu, 30 Jul 2009 03:21:54 -0700 (PDT) In-Reply-To: <9386fb2d0907270317w570ef640saf78eae33c98004@mail.gmail.com> References: <9386fb2d0907270317w570ef640saf78eae33c98004@mail.gmail.com> Date: Thu, 30 Jul 2009 12:21:54 +0200 Message-ID: <9386fb2d0907300321l5f93541cw892a9b0ca08345f2@mail.gmail.com> Subject: Containment test fails From: Pierre LeMoine To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UAMdR4021565 Hi! I sent the following message to the kepler list, and as i'm impatient i'm thinking maybe nobody watches that list or maybe i made failed to send it properly. I'm sending this here mail to the lua list, in hopes of getting a response =p /Pierre ---------- Forwarded message ---------- From: Pierre LeMoine Date: 2009/7/27 Subject: Containment test fails To: kepler-project@lists.luaforge.net Hi I've just reinstalled my server, and decided to go with kepler-xavante instead of apache. I noticed that the containment test fails, or at least i suppose it fails. browse to http://luben.se/test.lp to see for yourselves =p I also noted that the file upload/remove thing produces the following when removing the file: There was an error in the specified application. The full error message follows: There was an error in the specified application. The full error message follows: d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: attempt to use a closed file stack traceback:        [C]: in function 'close'        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: in function        [C]: in function 'foreachi'        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:584: in function 'reset'        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:637: in function 'main'        ...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:49: in function <...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:7>        (tail call): ? stack traceback:        ...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in function <...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22>        (tail call): ?        (tail call): ?        (tail call): ?        (tail call): ?        (tail call): ?        [string "  if (select(2,...)) then..."]:66: in function <[string " if (select(2,...)) then..."]:63> That message i get every time i go to the test page, until i restart xavante, wich makes me think it's related to the earlier failing. Also, is there a way to make xavante start without me having to log in? (windows) or should i use something like the XYNTService? Thanks a load =] /Pierre From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 11:39:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UEdNe1031693; Thu, 30 Jul 2009 11:39:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31DC11A666; Thu, 30 Jul 2009 11:38:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62AD41A65F for ; Thu, 30 Jul 2009 11:38:42 -0300 (BRT) Received: by ewy26 with SMTP id 26so1736678ewy.5 for ; Thu, 30 Jul 2009 07:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=GnWnJNQD+f4EKzaN5Q8M1S3xcWghVnhai1g1ZOk1X+s=; b=PPxfu2Xz19P3T17dn6mZXDmrn9XJFu3sYFpi7MYWZ2RlPc1DKTjEJIeD8dOK9oME3+ 2XMvdq/MKUCAphDA0DP9BsHAkAS0VnWVynZi9KOifoi7wsHaqk+PPGrcRYC7D359hJgT 1KFweh1t68fwSRG2nkLt9e/OK4ygU8WvjCulc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=SB3ujA3CYSkaM1kN3QpU44E5JC3jWhhxj3BSSLI219vRSL8AnLGO4jUjsK77bEt16l 7Fo880D9htiO+wuHyV0nOpyowdvI7azpdpNlck4EPcK3XNHIhL+OYj/kGcM3I7hVp4Yi fHlnGNMQMpInngeUvh3zQSVXfI19hoMPGK764= MIME-Version: 1.0 Received: by 10.216.29.72 with SMTP id h50mr246159wea.137.1248964719192; Thu, 30 Jul 2009 07:38:39 -0700 (PDT) In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> From: Jerome Vuarand Date: Thu, 30 Jul 2009 16:38:19 +0200 Message-ID: <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> Subject: Re: Table cache To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UEdNe1031693 2009/7/27 Brian Weed : > The problem I’m trying to solve is that the programmers on this project have > written lots of code that is constantly creating way too many temporary > objects, which bogs down the memory manager (causes low frame rates, and > choppiness). > > I would like to solve this problem automatically in one spot, at all > possible (auto cache these objects, and reuse them), so that we don’t have > to modify all the places that cause this. > > I’m thinking that maybe this can’t be done. Perhaps there would be too many > side effects to resurrecting the object. If you want to reuse tables, I guess you want to clean them before reuse. In the end you will spend more CPU cycles cleaning table than just allocating new ones and let the garbage collector be smart. Lua 5.1 has an incremental garbage collector, you should tweak it a bit to improve your framerate. If you really believe than cleaning tables is cheaper than allocating new ones, you should search the mailing list archive for previous attempts at doing so, and see how it ended (I don't remember the final result, since I'm not interested in the topic, but I remember it was discussed recently). You can use the newproxy hack, but it implies creating a userdata and metatable per pooled object reference. Even with a shared metatable, each userdata proxy is still more work for the garbage collector. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:16:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFGBxD008811; Thu, 30 Jul 2009 12:16:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E4C818939; Thu, 30 Jul 2009 12:15:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from blrmail1.satyam.com (unknown [125.16.201.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A012187E7 for ; Thu, 30 Jul 2009 12:15:11 -0300 (BRT) Received: from blr.satyam.com (blr.satyam.com [172.19.57.132]) by blrmail1.satyam.com (8.13.8/8.13.8) with ESMTP id n6UF7nRD020577 for ; Thu, 30 Jul 2009 20:37:50 +0530 Received: from bsdmsg009.corp.satyam.ad (bsdmsg009.corp.satyam.ad. [172.19.129.232]) by blr.satyam.com (8.13.8/8.13.8) with ESMTP id n6UFF8oe006830 for ; Thu, 30 Jul 2009 20:45:08 +0530 Received: from BSDMBX001.corp.satyam.ad ([172.19.129.225]) by bsdmsg009.corp.satyam.ad ([172.19.129.232]) with mapi; Thu, 30 Jul 2009 20:45:07 +0530 From: Subhash_Patil To: "lua@bazar2.conectiva.com.br" Date: Thu, 30 Jul 2009 20:45:05 +0530 Subject: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Topic: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Index: AcoRHZDo+rI1wP2PTLGDT/FVo3jjKAAA5AMgAABGEbAAAYxDgA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C5BSDMBX001corp_" MIME-Version: 1.0 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.1rc1, clamav-milter version 0.94.1rc1 on blr.satyam.com X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br --_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C5BSDMBX001corp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dear Sir, I am trying to bring some interactivity to my c appliaction, To begin with, I am trying to draw a rectangle which is defined in Gui.c fr= om LUA in my application Application_main.c. Gui.c /*structure actually defined in Gui.h*/ typedef struct { char R; char G; char B; } Gui_color_t; Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_t *)color*/){ Gui_color_t color; // I have had coded this for testing LUA; I am not comfo= rtable with tables yet ******Some code******* } Application_main.c Int Lua_main( void ) { int error; lua_State *L =3D lua_open(); /* opens Lua */ luaL_Reg Creg; lua_Integer n; luaL_openlibs(L); printf("luaL_openlibs\n"); lua_pushcfunction(L, SCSL_Draw_Rect(L)); printf("lua_pushcfunction\n"); /* n =3D 0; lua_pushinteger(L, n);*/ n =3D 100; lua_pushinteger(L, n); n =3D 100; printf("lua_pushinteger\n"); lua_pushinteger(L, n); n =3D 300; lua_pushinteger(L, n); n =3D 300; lua_pushinteger(L, n); printf("lua_call\n"); lua_call( L, 5, 0); printf("lua_call\n"); lua_close(L); return 0; } Int Application_MainEntry ( ) { ********Some code ******** Lua_main(); *******Some Code******** } I get all the prints in the Lua_main function. I see all the prints on the = console but not the rectangle. Can you help me out in this regard. Thanks in advance. Best Regards, Patil ________________________________ DISCLAIMER: This email (including any attachments) is intended for the sole use of the = intended recipient/s and may contain material that is CONFIDENTIAL AND PRIV= ATE COMPANY INFORMATION. Any review or reliance by others or copying or dis= tribution or forwarding of any or all of the contents in this message is ST= RICTLY PROHIBITED. If you are not the intended recipient, please contact th= e sender by email and delete all copies; your cooperation in this regard is= appreciated. --_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C5BSDMBX001corp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Dear Sir,

 

I am trying to bring some interactivity to my c appliact= ion,

To begin with, I am trying to draw a rectangle which is defined in Gui.c from LU= A in my application Applica= tion_main.c.

 

Gui.c

 

/*structure actually defined in Gui.h*/

 

typedef struct {

char  R;

char  G;

char  B;

} Gui_color_t;

 

Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_= t *)color*/){=

Gui_color_t color; // I have had coded this for testing = LUA; I am not comfortable with tables yet

******Some code*******

 

}

 

Application_mai= n.c

 

Int Lua_main( void )

{

         &n= bsp;  int error;

         &n= bsp;  lua_State *L =3D lua_open();   /* opens Lua */

         &n= bsp;  luaL_Reg Creg;

 

         &n= bsp;  lua_Integer n;

         &n= bsp;  luaL_openlibs(L);

 

         &n= bsp;  printf("luaL_openlibs\n");

         &n= bsp;  lua_pushcfunction(L, SCSL_Draw_Rect(L));

         &n= bsp;  printf("lua_pushcfunction\n");

 

/*  &= nbsp;         n =3D 0;

         &n= bsp;  lua_pushinteger(L, n);*/

         &n= bsp;  n =3D 100;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 100;

         &n= bsp;  printf("lua_pushinteger\n");<= /p>

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 300;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 300;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  printf("lua_call\n");

         &n= bsp;  lua_call( L, 5, 0);

         &n= bsp;  printf("lua_call\n");

         &n= bsp;  lua_close(L);

 

         &n= bsp;  return 0;

}

 

 

Int Application_MainEntry ( )

{

         &n= bsp;  ********Some code ********

Lua_main();<= /o:p>

 =

*******Some Code*= *******

}

 

 

I get all the prints in the Lua_main function. I see all= the prints on the console but not the rectangle.<= /p>

 

Can you help me out in this regard.

 

Thanks in advance.

 

Best Regards,

Patil

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the = intended recipient/s and may contain material that is CONFIDENTIAL AND PRIV= ATE COMPANY INFORMATION. Any review or reliance by others or copying or dis= tribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not= the intended recipient, please contact the sender by email and delete all = copies; your cooperation in this regard is appreciated.
--_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C5BSDMBX001corp_-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:26:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFQNdq010816; Thu, 30 Jul 2009 12:26:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26EA6189D4; Thu, 30 Jul 2009 12:26:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5B3F1898D for ; Thu, 30 Jul 2009 12:25:56 -0300 (BRT) Received: by qyk34 with SMTP id 34so852115qyk.33 for ; Thu, 30 Jul 2009 08:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=42Mqi/nXCqTRgdlsN8c6SOPHfhOf/jm+w6AAzOPm41c=; b=K9zopgg+rqfHB9KfiWcRmQ2o/Aloh7M07c4VMLkm946DUyPHIexVXk2PiDmp2hJoTW mGovQ47STjusDq3Lxkoy3PJNFyK4sT+s7G3kHDt68xDA9NNKJi5rBp8vTf0UnzprUByQ LR3gOm+D2ujoPZl6mH6Wp2nS35QcEO1RGJpxU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=HGOzp+5RUVtSoVUbSqT7qC0G7EVetzhhnTvpgk5k7Itq/ZVhZ3GQzW/Lxcp932ho/8 Rn13g4FfCYbaceAYpo4ergu3mIxJonjEK0iZS/Mm7/eTtSwXCsvuqNoyaS5Md0u7cmji 3FQwYQllnz+1ptIbHQ5hCTKDpIYw+jUXOA7+Y= MIME-Version: 1.0 Received: by 10.229.85.14 with SMTP id m14mr241392qcl.64.1248967555635; Thu, 30 Jul 2009 08:25:55 -0700 (PDT) In-Reply-To: <4A715CF7.5060601@peterodding.com> References: <4A715CF7.5060601@peterodding.com> Date: Thu, 30 Jul 2009 11:25:55 -0400 X-Google-Sender-Auth: 38cedf6b68c585d0 Message-ID: Subject: Re: [useless] Having some fun with lua From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I don't have any real insights but my implementation of Levenshtein uses a > single Lua table to hold the whole matrix. I haven't a clue how much faster > this is but it must account for something, with all that table creation :) Yours appears about 25% faster when run on a dictionary with 80K English words: 15 seconds vs. 21 seconds on my laptop. - yuri -- http://spu.tnik.org/ From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:30:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFUICb011672; Thu, 30 Jul 2009 12:30:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E715418A02; Thu, 30 Jul 2009 12:29:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D248189F1 for ; Thu, 30 Jul 2009 12:29:49 -0300 (BRT) Received: by ewy26 with SMTP id 26so1781494ewy.5 for ; Thu, 30 Jul 2009 08:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=t5T2fkWVB0L1uaEGDuJy7iyPKjdKr3gOlI5MUTGDm64=; b=Ej9zWrojlJ37Gi3ALbJ+P4ljClgyiWg83lLSuEPSaj4tDvJ4p7YTXRDuvQfDXcxcM0 VsWBWecBN622thJCcFeb+t/slfg5+fixpkUnOypxpSPMXUxjKLX7iUUrTwseRND5sRcW jRkkpmJOLPT0PW/vHxteK0K9ude+dnQqCR2mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=JPTMUH/VgOK1FDwsni+6hgPIAp5rkhplX2NKkaL19Ksc52lYZtVFnx6q66tJn0qdhz +H/hrruoLDzcTw7TzuSOi+DkLF7WhSkfqB8kgPT2XVh24wnHjprIbcQwUstXV6fncQfh l9iMLQysNMLwvIECczXxVNvWJtYLcj56UNSps= MIME-Version: 1.0 Received: by 10.216.90.133 with SMTP id e5mr250461wef.23.1248967787166; Thu, 30 Jul 2009 08:29:47 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Thu, 30 Jul 2009 17:29:27 +0200 Message-ID: <89d273ba0907300829m41fe5a14yd285fc59baab4e4a@mail.gmail.com> Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/30 Subhash_Patil : > I am trying to bring some interactivity to my c appliaction, > > To begin with, I am trying to draw a rectangle which is defined in Gui.c > from LUA in my application Application_main.c. > > [...] > > Int Lua_main( void ) > { > int error; > lua_State *L = lua_open(); /* opens Lua */ > luaL_Reg Creg; > > lua_Integer n; > luaL_openlibs(L); > > printf("luaL_openlibs\n"); > lua_pushcfunction(L, SCSL_Draw_Rect(L)); > printf("lua_pushcfunction\n"); > > /* n = 0; > lua_pushinteger(L, n);*/ > n = 100; > lua_pushinteger(L, n); > n = 100; > printf("lua_pushinteger\n"); > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > printf("lua_call\n"); > lua_call( L, 5, 0); > printf("lua_call\n"); > lua_close(L); > > return 0; > } > > I get all the prints in the Lua_main function. I see all the prints on the > console but not the rectangle. > > Can you help me out in this regard. > > Thanks in advance. You forgot to give us the content of SCSL_Draw_Rect. Lua is not an acronym, you shouldn't capitalize it (see http://www.lua.org/about.html#name). Please send emails as plain text, not html, especially when you paste code. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:35:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFZfka012683; Thu, 30 Jul 2009 12:35:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 538961A65F; Thu, 30 Jul 2009 12:35:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from blrmail1.satyam.com (unknown [125.16.201.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5962718A35 for ; Thu, 30 Jul 2009 12:35:14 -0300 (BRT) Received: from blr.satyam.com (blr.satyam.com [172.19.57.132]) by blrmail1.satyam.com (8.13.8/8.13.8) with ESMTP id n6UFRlFl020898 for ; Thu, 30 Jul 2009 20:57:55 +0530 Received: from bsdmsg009.corp.satyam.ad (bsdmsg009.corp.satyam.ad. [172.19.129.232]) by blr.satyam.com (8.13.8/8.13.8) with ESMTP id n6UFZ6cJ007206 for ; Thu, 30 Jul 2009 21:05:06 +0530 Received: from BSDMBX001.corp.satyam.ad ([172.19.129.225]) by bsdmsg009.corp.satyam.ad ([172.19.129.232]) with mapi; Thu, 30 Jul 2009 21:05:05 +0530 From: Subhash_Patil To: Lua list Date: Thu, 30 Jul 2009 21:05:04 +0530 Subject: RE: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Topic: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Index: AcoRKqQTvuGTkcFRQl+WDwgDetBM5AAACvHg Message-ID: References: <89d273ba0907300829m41fe5a14yd285fc59baab4e4a@mail.gmail.com> In-Reply-To: <89d273ba0907300829m41fe5a14yd285fc59baab4e4a@mail.gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.1rc1, clamav-milter version 0.94.1rc1 on blr.satyam.com X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UFZfka012683 SCSL_Draw_Rect(lua_State*L) { GUI_Color_t asvDrawColor = {31, 31, 0}; int i,j[3]; int n = lua_gettop(L); for (i = 1; i <= n; i++){ if (!lua_isnumber(L, i)){ lua_pushstring(L, "incorrect argument"); lua_error(L); } j[(i-1)] = lua_tonumber(L, i); printf("from stack %d\n",j[(i-1)]); } ML_GUI_DrawRectangle(j[1], j[2], j[3], &asvDrawColor); } -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand Sent: Thursday, July 30, 2009 8:59 PM To: Lua list Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! 2009/7/30 Subhash_Patil : > I am trying to bring some interactivity to my c appliaction, > > To begin with, I am trying to draw a rectangle which is defined in Gui.c > from LUA in my application Application_main.c. > > [...] > > Int Lua_main( void ) > { > int error; > lua_State *L = lua_open(); /* opens Lua */ > luaL_Reg Creg; > > lua_Integer n; > luaL_openlibs(L); > > printf("luaL_openlibs\n"); > lua_pushcfunction(L, SCSL_Draw_Rect(L)); > printf("lua_pushcfunction\n"); > > /* n = 0; > lua_pushinteger(L, n);*/ > n = 100; > lua_pushinteger(L, n); > n = 100; > printf("lua_pushinteger\n"); > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > printf("lua_call\n"); > lua_call( L, 5, 0); > printf("lua_call\n"); > lua_close(L); > > return 0; > } > > I get all the prints in the Lua_main function. I see all the prints on the > console but not the rectangle. > > Can you help me out in this regard. > > Thanks in advance. You forgot to give us the content of SCSL_Draw_Rect. Lua is not an acronym, you shouldn't capitalize it (see http://www.lua.org/about.html#name). Please send emails as plain text, not html, especially when you paste code. DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:41:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFfIup013699; Thu, 30 Jul 2009 12:41:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FE2218A7F; Thu, 30 Jul 2009 12:40:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from blrmail1.satyam.com (unknown [125.16.201.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBE4318A5B for ; Thu, 30 Jul 2009 12:40:11 -0300 (BRT) Received: from blr.satyam.com (blr.satyam.com [172.19.57.132]) by blrmail1.satyam.com (8.13.8/8.13.8) with ESMTP id n6UFWp4S020978 for ; Thu, 30 Jul 2009 21:02:51 +0530 Received: from bsdmsg009.corp.satyam.ad (bsdmsg009.corp.satyam.ad. [172.19.129.232]) by blr.satyam.com (8.13.8/8.13.8) with ESMTP id n6UFe9n2007277 for ; Thu, 30 Jul 2009 21:10:09 +0530 Received: from BSDMBX001.corp.satyam.ad ([172.19.129.225]) by bsdmsg009.corp.satyam.ad ([172.19.129.232]) with mapi; Thu, 30 Jul 2009 21:10:08 +0530 From: Subhash_Patil To: Lua list Date: Thu, 30 Jul 2009 21:10:06 +0530 Subject: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Topic: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Index: AcoRHZDo+rI1wP2PTLGDT/FVo3jjKAAA5AMgAABGEbAAAlgWYA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C9BSDMBX001corp_" MIME-Version: 1.0 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.1rc1, clamav-milter version 0.94.1rc1 on blr.satyam.com X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br --_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C9BSDMBX001corp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dear Sir, I am trying to bring some interactivity to my c appliaction, To begin with, I am trying to draw a rectangle which is defined in Gui.c fr= om LUA in my application Application_main.c. Gui.c /*structure actually defined in Gui.h*/ typedef struct { char R; char G; char B; } Gui_color_t; Int Gui_Draw_Rectangle( x,y,Width,Height, (Gui_color_t *)color){ ******Some code******* } SCSL_Draw_Rect(lua_State*L) { GUI_Color_t asvDrawColor =3D {31, 31, 0}; int i,j[4]; int n =3D lua_gettop(L); for (i =3D 1; i <=3D n; i++){ if (!lua_isnumber(L, i)){ lua_pushstring(L, "incorrect argument"); lua_error(L); } j[(i-1)] =3D lua_tonumber(L, i); printf("from stack %d\n",j[(i-1)]); } GUI_DrawRectangle(j[1], j[2], j[3], j[4] &asvDrawColor); } Application_main.c Int Lua_main( void ) { int error; lua_State *L =3D lua_open(); /* opens Lua */ luaL_Reg Creg; lua_Integer n; luaL_openlibs(L); printf("luaL_openlibs\n"); lua_pushcfunction(L, SCSL_Draw_Rect(L)); printf("lua_pushcfunction\n"); /* n =3D 0; lua_pushinteger(L, n);*/ n =3D 100; lua_pushinteger(L, n); n =3D 100; printf("lua_pushinteger\n"); lua_pushinteger(L, n); n =3D 300; lua_pushinteger(L, n); n =3D 300; lua_pushinteger(L, n); printf("lua_call\n"); lua_call( L, 5, 0); printf("lua_call\n"); lua_close(L); return 0; } Int Application_MainEntry ( ) { ********Some code ******** Lua_main(); *******Some Code******** } I get all the prints in the Lua_main function. I see all the prints on the = console but not the rectangle. Can you help me out in this regard. Thanks in advance. Best Regards, Subhash Patil ________________________________ DISCLAIMER: This email (including any attachments) is intended for the sole use of the = intended recipient/s and may contain material that is CONFIDENTIAL AND PRIV= ATE COMPANY INFORMATION. Any review or reliance by others or copying or dis= tribution or forwarding of any or all of the contents in this message is ST= RICTLY PROHIBITED. If you are not the intended recipient, please contact th= e sender by email and delete all copies; your cooperation in this regard is= appreciated. --_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C9BSDMBX001corp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Dear Sir,

 

I am trying to bring some interactivity to my c appliact= ion,

To begin with, I am trying to draw a rectangle which is defined in Gui.c from LU= A in my application Applica= tion_main.c.

 

Gui.c

 

/*structure actually defined in Gui.h*/

 

typedef struct {

char  R;

char  G;

char  B;

} Gui_color_t;

 

Int Gui_Draw_Rectangle( x,y,Width,Height, (Gui_color_t *= )color){<= /font>

 

******Some code*******

}

 

SCSL_Draw_Rect(lua_State*L)

{

      GUI_Color_t asvDrawColor =3D {31,= 31, 0};

 

      int i,j[4];

      int n =3D lua_gettop(L);

     

      for (i =3D 1; i <=3D n; i++= ){

        if (!lua_isnumber(L, = i)){

           lua= _pushstring(L, "incorrect argument");

           lua= _error(L);

         }

        j[(i-1)] =3D lua_tonumber(= L, i);

 

        printf("from stack %d= \n",j[(i-1)]);

      }

      GUI_DrawRectangle(j[1], j[2], j[3= ], j[4] &asvDrawColor);

}

 

Application_mai= n.c

 

Int Lua_main( void )

{

         &n= bsp;  int error;

         &n= bsp;  lua_State *L =3D lua_open();   /* opens Lua */

         &n= bsp;  luaL_Reg Creg;

 

         &n= bsp;  lua_Integer n;

         &n= bsp;  luaL_openlibs(L);

 

         &n= bsp;  printf("luaL_openlibs\n");

         &n= bsp;  lua_pushcfunction(L, SCSL_Draw_Rect(L));

         &n= bsp;  printf("lua_pushcfunction\n");

 

/*  &= nbsp;         n =3D 0;

         &n= bsp;  lua_pushinteger(L, n);*/

         &n= bsp;  n =3D 100;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 100;

         &n= bsp;  printf("lua_pushinteger\n");<= /p>

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 300;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  n =3D 300;

         &n= bsp;  lua_pushinteger(L, n);

         &n= bsp;  printf("lua_call\n");

         &n= bsp;  lua_call( L, 5, 0);

         &n= bsp;  printf("lua_call\n");

         &n= bsp;  lua_close(L);

 

         &n= bsp;  return 0;

}

 

 

Int Application_MainEntry ( )

{

         &n= bsp;  ********Some code ********

Lua_main();<= /o:p>

 =

*******Some Code*= *******

}

 

 

I get all the prints in the Lua_main function. I see all= the prints on the console but not the rectangle.<= /p>

 

Can you help me out in this regard.

 

Thanks in advance.

 

Best Regards,

Subhash Patil

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the = intended recipient/s and may contain material that is CONFIDENTIAL AND PRIV= ATE COMPANY INFORMATION. Any review or reliance by others or copying or dis= tribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not= the intended recipient, please contact the sender by email and delete all = copies; your cooperation in this regard is appreciated.
--_000_DCEE636B645BEA41A2B32B548CB3980F0AC9C0A8C9BSDMBX001corp_-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:41:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFfp5o013802; Thu, 30 Jul 2009 12:41:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34F2218AAD; Thu, 30 Jul 2009 12:40:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AF0D18A80 for ; Thu, 30 Jul 2009 12:40:27 -0300 (BRT) Received: by ewy26 with SMTP id 26so1790682ewy.5 for ; Thu, 30 Jul 2009 08:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=09X8L5qJJNTgI035jFMLcHA7EkfUeGtiGRs/dHWlFww=; b=JhOe7JcVUWtIJBH7SoqmVyIo6w8ntLIzFVMrmjrfc6839gyHYPye0mbYpHJYDSnghT EfdzJYYKXLVm753TmIkoJTVDUAtYa8oJ7Es8Xwd4LQeQM2VWpLGpb7tF+PPEI3H55ApW hCZDqNKLjH8gR2gJEe5BXyMabeo/14zLHbDZc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=poldHFcZnf7c9+eBl8AtCSqMfqMYcCMFA+Z3pDs3mcj6Kw3Bv+LUFZn2KLT/Q7+Oeq ep+qXnnUzjdFz3ZQCwDTyYzbocAB0mCMG3sWTpqMeCpl5g2st3deGZDqIMaBinvpKaIE +uYeRI880okNoqrPfkTpkH7tvlOG5fiSbUbLA= MIME-Version: 1.0 Received: by 10.216.93.141 with SMTP id l13mr264348wef.67.1248968425603; Thu, 30 Jul 2009 08:40:25 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Jul 2009 16:40:25 +0100 Message-ID: Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UFfp5o013802 On Thu, Jul 30, 2009 at 4:15 PM, Subhash_Patil wrote: >             lua_pushcfunction(L, SCSL_Draw_Rect(L)); Do you mean to be actually calling the function here? It looks like lua_pushcfunction(L, SCSL_Draw_Rect); ...might be what you want instead. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 12:53:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UFrarj016459; Thu, 30 Jul 2009 12:53:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6269F1929E; Thu, 30 Jul 2009 12:53:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC79918A02 for ; Thu, 30 Jul 2009 12:53:04 -0300 (BRT) Received: by bwz6 with SMTP id 6so1507827bwz.5 for ; Thu, 30 Jul 2009 08:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=b3h40PqVcX71okvOjWmTgLLk1FX+m9Rn/qchr/mWars=; b=e3XVOJZJqTOjyt3EIrw/T8Aa3DIcgfF8mvg+TQLuzfxxTx7OporbDzNV+Rr5Wqd3kU RdKafg6lruszo0LjMuDUr9DaOQfcUz/HUkq0HaG4rm63GxwrJH1xSKmQahR7PjT1AiXi dgSFLpXSCf9fFgKKSf4G963FzVAYmHGklzLRw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=li/FrdCwtAE8LzqbYkygpAqn0EPl/oBuLiFwBsF3/y9eRBfQbNBozL9ua4z8fT/hNf 465OrbU1GIGUAF9Ql6Cs0GNS5narPduHSHz8UiecM0z6lPuhO5xoyY52pNkO6DroPbvE KpXrxfCcUAl3J2nS4uIz1cZ5wvhLkQp/AYZ2k= MIME-Version: 1.0 Received: by 10.204.57.67 with SMTP id b3mr1361994bkh.99.1248969182169; Thu, 30 Jul 2009 08:53:02 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Thu, 30 Jul 2009 17:51:04 +0200 Message-ID: <89d273ba0907300851n56910aebsd3deb8bf298276a3@mail.gmail.com> Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/30 Duncan Cross : > On Thu, Jul 30, 2009 at 4:15 PM, Subhash_Patil wrote: >> lua_pushcfunction(L, SCSL_Draw_Rect(L)); > > Do you mean to be actually calling the function here? It looks like > > lua_pushcfunction(L, SCSL_Draw_Rect); > > ...might be what you want instead. SCSL_Draw_Rect has no declared return type, and no return value, so I guess it defaults to 0 as an int. Assuming that lua_pushcfunction with a NULL parameter doesn't throw an error, I'd expect lua_call to throw. Also the lua_call is passed parameter 5, while only 4 lua_pushinteger are not commented out, so what is pushed by lua_pushfunction is not even called. I don't know what is called though. The pasted code has so many such problems I seriously doubts the reported symptoms (the printf works but not the draw) are really what is happening. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 13:32:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UGWlqM025689; Thu, 30 Jul 2009 13:32:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDA0C18AB8; Thu, 30 Jul 2009 13:32:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B48A18993 for ; Thu, 30 Jul 2009 13:32:08 -0300 (BRT) Received: by gxk18 with SMTP id 18so2609243gxk.5 for ; Thu, 30 Jul 2009 09:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0i8xFtoifKAe2KXo8YzZPOeLFZVJ8Iqu/Dir88Ix9f4=; b=CAzAhA6M6kZ7/Er9HiULVGyD42R69J8ETYnupp/XWmmRUX5DNuJQI2luJm/WrY9Dke zTeuxjEK/IHIGTq39zexLaAsMqA/KOZuz/7pHJBybFtHAzx1CMILlnstsejuuI4aXs9f leNaYInuL+u3RivdLsJOzsn0+62St43T4Nf6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=B9Mc4/x9o2AGt2nbHDCsHdwDrVWuK8b+soz43O1aG05x9aafQ+1MeoSGKGswHbcNjG kgkP8Z9PXMP6BbYp+bB94TVETW07yrtzbDrrhtFRQMjd0PTYMJfHSQadH5JsecXCcZQJ kSdBsw9senktjrHd2esOcvwTUxWqRuCWlAt38= MIME-Version: 1.0 Received: by 10.151.10.4 with SMTP id n4mr2428116ybi.226.1248971150134; Thu, 30 Jul 2009 09:25:50 -0700 (PDT) In-Reply-To: <9386fb2d0907300321l5f93541cw892a9b0ca08345f2@mail.gmail.com> References: <9386fb2d0907270317w570ef640saf78eae33c98004@mail.gmail.com> <9386fb2d0907300321l5f93541cw892a9b0ca08345f2@mail.gmail.com> Date: Thu, 30 Jul 2009 13:25:50 -0300 X-Google-Sender-Auth: 28e22ecdef79ed7c Message-ID: <7913df4d0907300925x3020dd50scfc1283c6cfeedb9@mail.gmail.com> Subject: Re: Containment test fails From: Fabio Mascarenhas To: Lua list , Kepler Project mailing list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UGWlqM025689 Hi, Pierre, The truly impatient check the list archives: :-) http://www.google.com/search?rlz=1C1GGLS_enBR336BR336&sourceid=chrome&ie=UTF-8&q=site:http://lists.luaforge.net/pipermail/kepler-project/+containment++test http://luaservice.luaforge.net/ -- Fabio Mascarenhas On Thu, Jul 30, 2009 at 7:21 AM, Pierre LeMoine wrote: > Hi! > I sent the following message to the kepler list, and as i'm impatient > i'm thinking maybe nobody watches that list or maybe i made failed to > send it properly. > I'm sending this here mail to the lua list, in hopes of getting a response =p > /Pierre > > > ---------- Forwarded message ---------- > From: Pierre LeMoine > Date: 2009/7/27 > Subject: Containment test fails > To: kepler-project@lists.luaforge.net > > > Hi > > I've just reinstalled my server, and decided to go with kepler-xavante > instead of apache. > I noticed that the containment test fails, or at least i suppose it fails. > browse to http://luben.se/test.lp to see for yourselves =p > > I also noted that the file upload/remove thing produces the following > when removing the file: > There was an error in the specified application. The full error message follows: > There was an error in the specified application. The full error message follows: > > d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: attempt to > use a closed file > stack traceback: >        [C]: in function 'close' >        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: in function >        [C]: in function 'foreachi' >        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:584: in > function 'reset' >        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:637: in > function 'main' >        ...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:49: in > function <...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:7> >        (tail call): ? > stack traceback: >        ...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in > function <...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22> >        (tail call): ? >        (tail call): ? >        (tail call): ? >        (tail call): ? >        (tail call): ? >        [string "  if (select(2,...)) then..."]:66: in function <[string " > if (select(2,...)) then..."]:63> > > That message i get every time i go to the test page, until i restart > xavante, wich makes me think it's related to the earlier failing. > > Also, is there a way to make xavante start without me having to log > in? (windows) or should i use something like the XYNTService? > > Thanks a load =] > /Pierre > From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 14:52:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UHqZvV010826; Thu, 30 Jul 2009 14:52:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A85501A65B; Thu, 30 Jul 2009 14:52:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.f9e.com (webmail.f9e.com [207.170.252.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 600F13216D for ; Thu, 30 Jul 2009 14:51:55 -0300 (BRT) Received: from npbmail01.F9.internal ([10.8.0.25]) by webmail.f9e.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 30 Jul 2009 10:51:45 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Table cache Date: Thu, 30 Jul 2009 10:50:57 -0700 Message-ID: <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> In-Reply-To: <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Table cache Thread-Index: AcoRI3ewE94bRhXwQT2OuXb/GS8TOAAGGpVQ References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> From: "Brian Weed" To: "Lua list" X-OriginalArrivalTime: 30 Jul 2009 17:51:45.0934 (UTC) FILETIME=[67B992E0:01CA113E] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6UHqZvV010826 Well, the tables would not be re-tasked for different object types (vectors would stay vectors, etc...), and re-setting x, y, z to 0 is much less expensive then deleting and then allocating a new table. Either way, I don't have high hopes about solving this automatically. I'm thinking that I just need to get my programmers to not create thousands of temporary tables per frame. Brian -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand Sent: Thursday, July 30, 2009 10:38 AM To: Lua list Subject: Re: Table cache 2009/7/27 Brian Weed : > The problem I'm trying to solve is that the programmers on this project have > written lots of code that is constantly creating way too many temporary > objects, which bogs down the memory manager (causes low frame rates, and > choppiness). > > I would like to solve this problem automatically in one spot, at all > possible (auto cache these objects, and reuse them), so that we don't have > to modify all the places that cause this. > > I'm thinking that maybe this can't be done. Perhaps there would be too many > side effects to resurrecting the object. If you want to reuse tables, I guess you want to clean them before reuse. In the end you will spend more CPU cycles cleaning table than just allocating new ones and let the garbage collector be smart. Lua 5.1 has an incremental garbage collector, you should tweak it a bit to improve your framerate. If you really believe than cleaning tables is cheaper than allocating new ones, you should search the mailing list archive for previous attempts at doing so, and see how it ended (I don't remember the final result, since I'm not interested in the topic, but I remember it was discussed recently). You can use the newproxy hack, but it implies creating a userdata and metatable per pooled object reference. Even with a shared metatable, each userdata proxy is still more work for the garbage collector. From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 15:06:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UI69dS014189; Thu, 30 Jul 2009 15:06:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D37AE186A7; Thu, 30 Jul 2009 15:05:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B051118658 for ; Thu, 30 Jul 2009 15:05:40 -0300 (BRT) Received: by ewy26 with SMTP id 26so1906174ewy.5 for ; Thu, 30 Jul 2009 11:05:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.88.18 with SMTP id z18mr290818wee.78.1248977138469; Thu, 30 Jul 2009 11:05:38 -0700 (PDT) In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> Date: Thu, 30 Jul 2009 19:05:38 +0100 X-Google-Sender-Auth: 47b22f3427121e1a Message-ID: Subject: Re: Table cache From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You attack the problem from C, and write a memory allocator which pools small allocations, or modify the Lua source code and add pooling to the table creation / destruction functions. On Thu, Jul 30, 2009 at 6:50 PM, Brian Weed wrote: > Well, the tables would not be re-tasked for different object types > (vectors would stay vectors, etc...), and re-setting x, y, z to 0 is > much less expensive then deleting and then allocating a new table. > > Either way, I don't have high hopes about solving this automatically. > I'm thinking that I just need to get my programmers to not create > thousands of temporary tables per frame. > > Brian From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 15:08:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UI8mut014853; Thu, 30 Jul 2009 15:08:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9915E186F1; Thu, 30 Jul 2009 15:08:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4A63186D6 for ; Thu, 30 Jul 2009 15:08:20 -0300 (BRT) Received: by fxm25 with SMTP id 25so1670533fxm.5 for ; Thu, 30 Jul 2009 11:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lpayV0X/uM567o+DjvqdDYl1Ui6uDUhn/BF0oezpjZk=; b=PhzItDMtQ/LN/1CwD2ospY8HGSk0CR8XGxCb4dVhAw823DiZU0Z1RNF3ZFc7JJOcGJ V0BcPIKZKb6mVTJt5+OjI7DuJzsZ1dBAqNm59niqPI699aXhh/UrwJ+h5LKr/dQ89FP2 S8CmapUN78itWr6vkYyrMfKSDIie7yt7AS/9Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Wi7MI57lh6SUMG0U+BCXhATjZd33KxlcQ91ktT1bb5w5Ba2d7+zOJE9fzIv9UnvCEE xgYcQpWEW7GP2IUyEvXPEOBfqZf6M++ZOqGrAalk/LEeaGcgZBr/I9C92z6LQOwJBowM 9gRxEX9gqgKMSRPHvBi63DWreX8JZ72Bz4Jpk= MIME-Version: 1.0 Received: by 10.204.65.18 with SMTP id g18mr1134910bki.5.1248977298272; Thu, 30 Jul 2009 11:08:18 -0700 (PDT) In-Reply-To: References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> Date: Thu, 30 Jul 2009 19:08:18 +0100 Message-ID: <58bff7f70907301108s2030230cy238ec1d3aaff8c21@mail.gmail.com> Subject: Re: Table cache From: Simon Cooper To: Lua list Content-Type: multipart/alternative; boundary=0016e6de14e3323492046ff03063 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6de14e3323492046ff03063 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit If you did this you could track where the allocations came from and fix the worst cases until the allocations become managable. On Jul 30, 2009 7:05 PM, "Peter Cawley" wrote: You attack the problem from C, and write a memory allocator which pools small allocations, or modify the Lua source code and add pooling to the table creation / destruction functions. On Thu, Jul 30, 2009 at 6:50 PM, Brian Weed wrote: > Well, the tables woul... --0016e6de14e3323492046ff03063 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

If you did this you could track where the allocations came from and fix the worst cases until the allocations become managable.

On Jul 30, 2009 7:05 PM, "Peter Cawley" <lua@corsix.org> wrote:

You attack the problem from C, and write a memory allocator which
pools small allocations, or modify the Lua source code and add pooling
to the table creation / destruction functions.

On Thu, Jul 30, 2009 at 6:50 PM, Brian Weed<brianw@imaginengine.com> wrote: > Well, the tables woul...

--0016e6de14e3323492046ff03063-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 16:47:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6UJgHUh007917; Thu, 30 Jul 2009 16:42:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 037B5192B6; Thu, 30 Jul 2009 16:41:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B83E192AA for ; Thu, 30 Jul 2009 16:41:30 -0300 (BRT) X-AuditID: ac100205-000010fc00000608-0c-4a71f75974ac Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 30 Jul 2009 15:41:13 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Thu, 30 Jul 2009 15:41:13 -0400 From: "King, Mike" To: Lua list Date: Thu, 30 Jul 2009 15:41:11 -0400 Subject: Using IUP with blocking calls Thread-Topic: Using IUP with blocking calls Thread-Index: AcoRTbE1Di6Yp7r1QdGAct/ludQx1g== Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB174FC17@KLMExch.klmicrowave.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_85861A744C29EA46BFD9BB61889AE59D3CB174FC17KLMExchklmicr_" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_85861A744C29EA46BFD9BB61889AE59D3CB174FC17KLMExchklmicr_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is there a way to use IUP and call functions that take a long time to return= without blocking the GUI thread? There's probably a way using Lua Lanes. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is f= or the sole use of the intended recipient(s) and may contain information tha= t is confidential or proprietary to K&L Microwave, Inc. Any unauthorized rev= iew, use, disclosure or distribution is prohibited. If you are not the inten= ded recipient, immediately contact the sender by reply e-mail and destroy al= l copies of the original message. --_000_85861A744C29EA46BFD9BB61889AE59D3CB174FC17KLMExchklmicr_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Is there a way to use IUP and call functions that take= a long time to return without blocking the GUI thread?  There’s probably a way using Lua Lanes.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, i= s for the sole use of the intended recipient(s) and may contain information= that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized= review, use, disclosure or distribution is prohibited. If you are not the i= ntended recipient, immediately contact the sender by reply e-mail and destro= y all copies of the original message.

--_000_85861A744C29EA46BFD9BB61889AE59D3CB174FC17KLMExchklmicr_-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 18:30:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ULTxUg030738; Thu, 30 Jul 2009 18:30:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F7441A669; Thu, 30 Jul 2009 18:28:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4DE11A65F for ; Thu, 30 Jul 2009 18:28:16 -0300 (BRT) Received: by fxm25 with SMTP id 25so1805899fxm.5 for ; Thu, 30 Jul 2009 14:28:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.53.143 with SMTP id m15mr1733074bkg.119.1248989293005; Thu, 30 Jul 2009 14:28:13 -0700 (PDT) Date: Fri, 31 Jul 2009 00:28:12 +0300 X-Google-Sender-Auth: 5ec229fc9c52580b Message-ID: Subject: patch for alien 0.4.1 From: Cosmin Apreutesei To: lua Content-Type: multipart/mixed; boundary=001636c5ba67234e01046ff2fbf8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5ba67234e01046ff2fbf8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Good news everyone, I made a small patch (with diff -uN, attached) for alien, based on my experience with some bindings I made recently. Hope is ok to post it here, also hope it will make it into the alien "tree" (I'd like to release a firebird driver that would love this patch). List of changes: - added "ushort", "uint", "ulong", and "ref uint" types along with alien.toushort(), alien. touint(), alien.toulong(); - added optional arg. offset to buf:topointer() making it buf:topointer([offset]); - added optional arg. offset to buf:tostring() making it buf:tostring([size],[offset]) -- setting size to nil will call strlen(); - added struct.offset(layout, record_number) which gives you a byte offset given a record offset -- as with struct.size(), it only works with fixed-size structures. - added type 'p' for struct.pack() for packing up a pointer (userdata or lightuserdata), and to struct.unpack() for unpacking it (gets you a light userdata); struct.size('p') == sizeof(void*); the 'p' type is not affected by the endianness of the layout. - added test file. Limitations: - only tested on 32bit linux My questions for Fabio and/or others interested: 1) I need a way to copy a string into a buffer at some offset -- I'd rather not summon memcpy() and co., instead this should be built-in into alien. Some ideas: - alien.memcpy(dst_buf, src_buf or light_userdata, size) - buf:get() and buf:set() applied with the "string" type, which currently don't have clear semantics. What do you think? 2) What's the point of "ref" types for buffers? any semantics planned for them? 3) What do I need to make "luarocks make" work with the alien recipe in Windows? Or what is the preferred method to build alien on diff. platforms with min. of fuss? Thank you all, Cosmin. --001636c5ba67234e01046ff2fbf8 Content-Type: application/octet-stream; name="patch.struct.c" Content-Disposition: attachment; filename="patch.struct.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxryuybm0 LS0tIHN0cnVjdF80XzFfMS5jCTIwMDgtMDktMDQgMDY6MDc6NDIuMDAwMDAwMDAwICswMzAwCisr KyBzdHJ1Y3QuYwkyMDA5LTA3LTMwIDE3OjI3OjEzLjAwMDAwMDAwMCArMDMwMApAQCAtMTMsNiAr MTMsOCBAQAogKiogcyAtIHplcm8tdGVybWluYXRlZCBzdHJpbmcKICoqIGYgLSBmbG9hdAogKiog ZCAtIGRvdWxiZQorKiogcCAtIHBvaW50ZXI6IHVucGFja3MgdG8gYSBsaWdodF91c2VyZGF0YSwg cGFja3MgYSBsaWdodF91c2VyZGF0YSBvciB1c2VyZGF0YS4KKwkJbm90IGFmZmVjdGVkIGJ5IGVu ZGlhbm5lcyBzZXR0aW5nLgogKi8KIAogCkBAIC04Myw2ICs4NSw3IEBACiAgICAgY2FzZSAnaSc6 IHJldHVybiBnZXRudW0oZm10LCBzaXplb2YoaW50KSk7CiAgICAgY2FzZSAnYyc6IHJldHVybiBn ZXRudW0oZm10LCAxKTsKICAgICBjYXNlICdzJzogcmV0dXJuIDA7CisgICAgY2FzZSAncCc6IHJl dHVybiBzaXplb2Yodm9pZCopOwogICAgIGRlZmF1bHQ6IHJldHVybiAxOyAgLyogaW52YWxpZCBj b2RlICovCiAgIH0KIH0KQEAgLTE3Myw2ICsxNzYsMjkgQEAKICAgcmV0dXJuIDE7CiB9CiAKK3N0 YXRpYyBpbnQgYl9vZmZzZXQgKGx1YV9TdGF0ZSAqTCkgeworICBpbnQgbmF0aXZlOworICBjb25z dCBjaGFyICpmbXQgPSBsdWFMX2NoZWNrc3RyaW5nKEwsIDEpOworICBpbnQgb2Zmc2V0ID0gbHVh TF9vcHRpbnQoTCwgMiwgMSk7CisgIGludCBvcHRuID0gMTsKKyAgaW50IGFsaWduOworICBpbnQg dG90YWxzaXplID0gMDsKKyAgZ2V0ZW5kaWFuZXNzKCZmbXQsICZuYXRpdmUpOworICBhbGlnbiA9 IGdldGFsaWduKCZmbXQpOworICB3aGlsZSAoKmZtdCAmJiBvcHRuIDwgb2Zmc2V0KSB7CisgICAg aW50IG9wdCA9ICpmbXQrKzsKKyAgICBpbnQgc2l6ZSA9IG9wdHNpemUob3B0LCAmZm10KTsKKyAg ICBpbnQgdG9hbGlnbiA9IGdldHRvYWxpZ24oTCwgYWxpZ24sIG9wdCwgc2l6ZSk7CisgICAgaWYg KHNpemUgPT0gMCkKKyAgICAgIGx1YUxfZXJyb3IoTCwgIm9wdGlvbnMgYGMwJyAtIGBzJyBoYXZl IHVuZGVmaW5lZCBzaXplcyIpOworICAgIHRvdGFsc2l6ZSArPSB0b2FsaWduIC0gMTsKKyAgICB0 b3RhbHNpemUgLT0gdG90YWxzaXplJih0b2FsaWduLTEpOworICAgIHRvdGFsc2l6ZSArPSBzaXpl OworICAgIG9wdG4gKz0gMTsKKyAgfQorICBsdWFfcHVzaG51bWJlcihMLCB0b3RhbHNpemUgKyAx KTsKKyAgcmV0dXJuIDE7Cit9CiAKIHN0YXRpYyBpbnQgYl9wYWNrIChsdWFfU3RhdGUgKkwpIHsK ICAgbHVhTF9CdWZmZXIgYjsKQEAgLTIyOCw2ICsyNTQsMTIgQEAKICAgICAgICAgfQogICAgICAg ICBicmVhazsKICAgICAgIH0KKyAgICAgIGNhc2UgJ3AnOiB7CisJbHVhTF9hcmdjaGVjayhMLCBs dWFfaXN1c2VyZGF0YShMLCBhcmcpLCBhcmcsICJ1c2VyZGF0YSBvciBsaWdodCB1c2VyZGF0YSBy ZXF1aXJlZCIpOworICAgICAgICB2b2lkKiBwID0gbHVhX3RvdXNlcmRhdGEoTCwgYXJnKTsKKyAg ICAgICAgbHVhTF9hZGRsc3RyaW5nKCZiLCAoY2hhciopJnAsIHNpemUpOworICAgICAgICBicmVh azsKKyAgICAgIH0KICAgICAgIGRlZmF1bHQ6IGludmFsaWRmb3JtYXQoTCwgb3B0KTsKICAgICB9 CiAgICAgdG90YWxzaXplICs9IHNpemU7CkBAIC0yNzIsNyArMzA0LDcgQEAKICAgaWYobHVhX2lz dXNlcmRhdGEoTCwgMikpIHsKICAgICBkYXRhID0gKGNvbnN0IGNoYXIqKWx1YV90b3VzZXJkYXRh KEwsIDIpOwogICAgIGxkID0gKHNpemVfdClsdWFMX2NoZWNraW50ZWdlcihMLCAzKTsKLSAgICBw b3MgPSAwOworICAgIHBvcyA9IGx1YUxfb3B0aW50KEwsIDQsIDEpIC0gMTsKICAgfSBlbHNlIHsK ICAgICBkYXRhID0gbHVhTF9jaGVja2xzdHJpbmcoTCwgMiwgJmxkKTsKICAgICBwb3MgPSBsdWFM X29wdGludChMLCAzLCAxKSAtIDE7CkBAIC0zMzEsNiArMzYzLDEyIEBACiAgICAgICAgIGx1YV9w dXNobHN0cmluZyhMLCBkYXRhK3Bvcywgc2l6ZSAtIDEpOwogICAgICAgICBicmVhazsKICAgICAg IH0KKyAgICAgIGNhc2UgJ3AnOiB7CisJdm9pZCogcDsKKwltZW1jcHkoJnAsIGRhdGErcG9zLCBz aXplKTsKKwlsdWFfcHVzaGxpZ2h0dXNlcmRhdGEoTCwgcCk7CisJYnJlYWs7CisgICAgICB9CiAg ICAgICBkZWZhdWx0OiBpbnZhbGlkZm9ybWF0KEwsIG9wdCk7CiAgICAgfQogICAgIHBvcyArPSBz aXplOwpAQCAtMzM5LDEyICszNzcsMTEgQEAKICAgcmV0dXJuIGx1YV9nZXR0b3AoTCkgLSAyOwog fQogCi0KLQogc3RhdGljIGNvbnN0IHN0cnVjdCBsdWFMX3JlZyB0aGlzbGliW10gPSB7CiAgIHsi cGFjayIsIGJfcGFja30sCiAgIHsidW5wYWNrIiwgYl91bnBhY2t9LAogICB7InNpemUiLCBiX3Np emV9LAorICB7Im9mZnNldCIsIGJfb2Zmc2V0fSwKICAge05VTEwsIE5VTEx9CiB9OwogCg== --001636c5ba67234e01046ff2fbf8 Content-Type: application/octet-stream; name="patch.core.c" Content-Disposition: attachment; filename="patch.core.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxryuyby1 LS0tIGNvcmVfNF8xXzEuYwkyMDA4LTA5LTA0IDA2OjA3OjQyLjAwMDAwMDAwMCArMDMwMAorKysg Y29yZS5jCTIwMDktMDctMzAgMjM6Mjc6MTMuMDAwMDAwMDAwICswMzAwCkBAIC0zNyw4ICszNywx MSBAQAogCiB0eXBlZGVmIGVudW0gewogICBBVF9TSE9SVCwKKyAgQVRfVVNIT1JULAogICBBVF9J TlQsCisgIEFUX1VJTlQsCiAgIEFUX0xPTkcsCisgIEFUX1VMT05HLAogICBBVF9WT0lELAogICBB VF9GTE9BVCwKICAgQVRfRE9VQkxFLApAQCAtNDcsNiArNTAsNyBAQAogICBBVF9TVFJJTkcsCiAg IEFUX1BUUiwKICAgQVRfUkVGSU5ULAorICBBVF9SRUZVSU5ULAogICBBVF9SRUZDSEFSLAogICBB VF9SRUZET1VCTEUsCiAgIEFUX0NBTExCQUNLCkBAIC00NDAsMTQgKzQ0NCwyMCBAQAogICAgIGNh c2UgQVRfQllURTogbHVhX3B1c2hudW1iZXIoYWMtPkwsIChzaWduZWQgY2hhcikqKChpbnQqKWFy Z3NbaV0pKTsgYnJlYWs7CiAgICAgY2FzZSBBVF9DSEFSOiBsdWFfcHVzaG51bWJlcihhYy0+TCwg KHVjaGFyKSooKGludCopYXJnc1tpXSkpOyBicmVhazsKICAgICBjYXNlIEFUX1NIT1JUOiBsdWFf cHVzaG51bWJlcihhYy0+TCwgKHNob3J0KSooKGludCopYXJnc1tpXSkpOyBicmVhazsKLSAgICBj YXNlIEFUX0xPTkc6IAorICAgIGNhc2UgQVRfVVNIT1JUOiBsdWFfcHVzaG51bWJlcihhYy0+TCwg KHVuc2lnbmVkIHNob3J0KSooKGludCopYXJnc1tpXSkpOyBicmVhazsKKyAgICBjYXNlIEFUX0xP Tkc6CiAgICAgICBsdWFfcHVzaG51bWJlcihhYy0+TCwgKGxvbmcpKigobG9uZyopYXJnc1tpXSkp OyBicmVhazsKKyAgICBjYXNlIEFUX1VMT05HOgorICAgICAgbHVhX3B1c2hudW1iZXIoYWMtPkws ICh1bnNpZ25lZCBsb25nKSooKHVuc2lnbmVkIGxvbmcqKWFyZ3NbaV0pKTsgYnJlYWs7CiAgICAg Y2FzZSBBVF9JTlQ6IGx1YV9wdXNobnVtYmVyKGFjLT5MLCAqKChpbnQqKWFyZ3NbaV0pKTsgYnJl YWs7CisgICAgY2FzZSBBVF9VSU5UOiBsdWFfcHVzaG51bWJlcihhYy0+TCwgKigodW5zaWduZWQg aW50KilhcmdzW2ldKSk7IGJyZWFrOwogICAgIGNhc2UgQVRfRkxPQVQ6IGx1YV9wdXNobnVtYmVy KGFjLT5MLCAoZmxvYXQpKigoZmxvYXQqKWFyZ3NbaV0pKTsgYnJlYWs7CiAgICAgY2FzZSBBVF9E T1VCTEU6IGx1YV9wdXNobnVtYmVyKGFjLT5MLCAqKChkb3VibGUqKWFyZ3NbaV0pKTsgYnJlYWs7 CiAgICAgY2FzZSBBVF9TVFJJTkc6IGx1YV9wdXNoc3RyaW5nKGFjLT5MLCAqKChjaGFyKiopYXJn c1tpXSkpOyBicmVhazsKICAgICBjYXNlIEFUX1JFRklOVDogCiAgICAgICBsdWFfcHVzaG51bWJl cihhYy0+TCwgKiooKGludCoqKWFyZ3NbaV0pKTsgYnJlYWs7CisgICAgY2FzZSBBVF9SRUZVSU5U OiAKKyAgICAgIGx1YV9wdXNobnVtYmVyKGFjLT5MLCAqKigodW5zaWduZWQgaW50KiopYXJnc1tp XSkpOyBicmVhazsKICAgICBjYXNlIEFUX1JFRkNIQVI6CiAgICAgICBsdWFfcHVzaG51bWJlcihh Yy0+TCwgKiooKHVjaGFyKiopYXJnc1tpXSkpOyBicmVhazsKICAgICBjYXNlIEFUX1JFRkRPVUJM RTogCkBAIC00NjMsOSArNDczLDEzIEBACiAgIHN3aXRjaChhYy0+cmV0X3R5cGUpIHsKICAgY2Fz ZSBBVF9WT0lEOiBicmVhazsKICAgY2FzZSBBVF9TSE9SVDogKigoaW50KilyZXNwKSA9IChzaG9y dClsdWFfdG9pbnRlZ2VyKGFjLT5MLCAtMSk7IGJyZWFrOworICBjYXNlIEFUX1VTSE9SVDogKigo aW50KilyZXNwKSA9ICh1bnNpZ25lZCBzaG9ydClsdWFfdG9pbnRlZ2VyKGFjLT5MLCAtMSk7IGJy ZWFrOwogICBjYXNlIEFUX0xPTkc6IAogICAgICooKGxvbmcqKXJlc3ApID0gKGxvbmcpbHVhX3Rv aW50ZWdlcihhYy0+TCwgLTEpOyBicmVhazsKKyAgY2FzZSBBVF9VTE9ORzogCisgICAgKigodW5z aWduZWQgbG9uZyopcmVzcCkgPSAodW5zaWduZWQgbG9uZylsdWFfdG9pbnRlZ2VyKGFjLT5MLCAt MSk7IGJyZWFrOwogICBjYXNlIEFUX0lOVDogKigoaW50KilyZXNwKSA9IChpbnQpbHVhX3RvaW50 ZWdlcihhYy0+TCwgLTEpOyBicmVhazsKKyAgY2FzZSBBVF9VSU5UOiAqKCh1bnNpZ25lZCBpbnQq KXJlc3ApID0gKHVuc2lnbmVkIGludClsdWFfdG9pbnRlZ2VyKGFjLT5MLCAtMSk7IGJyZWFrOwog ICBjYXNlIEFUX0NIQVI6ICooKGludCopcmVzcCkgPSAodWNoYXIpbHVhX3RvaW50ZWdlcihhYy0+ TCwgLTEpOyBicmVhazsKICAgY2FzZSBBVF9CWVRFOiAqKChpbnQqKXJlc3ApID0gKHNpZ25lZCBj aGFyKWx1YV90b2ludGVnZXIoYWMtPkwsIC0xKTsgYnJlYWs7CiAgIGNhc2UgQVRfRkxPQVQ6ICoo KGZsb2F0KilyZXNwKSA9IChmbG9hdClsdWFfdG9udW1iZXIoYWMtPkwsIC0xKTsgYnJlYWs7CkBA IC00OTQsMjMgKzUwOCwyMyBAQAogICBpbnQgaSwgbnBhcmFtczsKICAgZmZpX3N0YXR1cyBzdGF0 dXM7CiAgIGZmaV9hYmkgYWJpOwotICBzdGF0aWMgZmZpX3R5cGUgKmNvbnN0IGZmaXR5cGVzW10g PSB7JmZmaV90eXBlX3ZvaWQsICZmZmlfdHlwZV9zaW50LCAmZmZpX3R5cGVfZG91YmxlLCAKKyAg c3RhdGljIGZmaV90eXBlICpjb25zdCBmZml0eXBlc1tdID0geyZmZmlfdHlwZV92b2lkLCAmZmZp X3R5cGVfc2ludCwgJmZmaV90eXBlX3VpbnQsICZmZmlfdHlwZV9kb3VibGUsIAogCQkJCSAmZmZp X3R5cGVfdWNoYXIsICZmZmlfdHlwZV9wb2ludGVyLCAmZmZpX3R5cGVfcG9pbnRlciwKIAkJCQkg JmZmaV90eXBlX3BvaW50ZXIsICZmZmlfdHlwZV9wb2ludGVyLCAmZmZpX3R5cGVfcG9pbnRlciwK LQkJCQkgJmZmaV90eXBlX3BvaW50ZXIsICZmZmlfdHlwZV9zc2hvcnQsICZmZmlfdHlwZV9zY2hh ciwKKwkJCQkgJmZmaV90eXBlX3BvaW50ZXIsICZmZmlfdHlwZV9zc2hvcnQsICZmZmlfdHlwZV91 c2hvcnQsICZmZmlfdHlwZV9zY2hhciwKICNpZm5kZWYgV0lORE9XUwotCQkJCSAmZmZpX3R5cGVf c2xvbmcsIAorCQkJCSAmZmZpX3R5cGVfc2xvbmcsICZmZmlfdHlwZV91bG9uZywKICNlbHNlCi0J CQkJICZmZmlfdHlwZV9zaW50LAorCQkJCSAmZmZpX3R5cGVfc2ludCwgJmZmaV90eXBlX3VpbnQs CiAjZW5kaWYKIAkJCQkgJmZmaV90eXBlX2Zsb2F0fTsKLSAgc3RhdGljIGludCBjb25zdCB0eXBl c1tdID0ge0FUX1ZPSUQsIEFUX0lOVCwgQVRfRE9VQkxFLCBBVF9DSEFSLCBBVF9TVFJJTkcsIEFU X1BUUiwgQVRfUkVGSU5ULCAKLQkJCSAgICAgIEFUX1JFRkRPVUJMRSwgQVRfUkVGQ0hBUiwgQVRf Q0FMTEJBQ0ssIEFUX1NIT1JULCBBVF9CWVRFLCBBVF9MT05HLAotCQkJICAgICAgQVRfRkxPQVR9 OworICBzdGF0aWMgaW50IGNvbnN0IHR5cGVzW10gPSB7QVRfVk9JRCwgQVRfSU5ULCBBVF9VSU5U LCBBVF9ET1VCTEUsIEFUX0NIQVIsIEFUX1NUUklORywgQVRfUFRSLCBBVF9SRUZJTlQsIEFUX1JF RlVJTlQsCisJCQkgICAgICBBVF9SRUZET1VCTEUsIEFUX1JFRkNIQVIsIEFUX0NBTExCQUNLLCBB VF9TSE9SVCwgQVRfVVNIT1JULCBBVF9CWVRFLCBBVF9MT05HLAorCQkJICAgICAgQVRfVUxPTkcs IEFUX0ZMT0FUfTsKICAgc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHR5cGVuYW1lc1tdID0gCi0g ICAgeyJ2b2lkIiwgImludCIsICJkb3VibGUiLCAiY2hhciIsICJzdHJpbmciLCAicG9pbnRlciIs Ci0gICAgICJyZWYgaW50IiwgInJlZiBkb3VibGUiLCAicmVmIGNoYXIiLCAiY2FsbGJhY2siLCAK LSAgICAgInNob3J0IiwgImJ5dGUiLCAibG9uZyIsICJmbG9hdCIsIE5VTEx9OworICAgIHsidm9p ZCIsICJpbnQiLCAidWludCIsICJkb3VibGUiLCAiY2hhciIsICJzdHJpbmciLCAicG9pbnRlciIs CisgICAgICJyZWYgaW50IiwgInJlZiB1aW50IiwgInJlZiBkb3VibGUiLCAicmVmIGNoYXIiLCAi Y2FsbGJhY2siLCAKKyAgICAgInNob3J0IiwgInVzaG9ydCIsICJieXRlIiwgImxvbmciLCAidWxv bmciLCAiZmxvYXQiLCBOVUxMfTsKICAgbHVhTF9jaGVja3R5cGUoTCwgMSwgTFVBX1RGVU5DVElP Tik7CiAgIGlmKGx1YV9pc3RhYmxlKEwsIDIpKSB7CiAgICAgbnBhcmFtcyA9IGx1YV9vYmpsZW4o TCwgMik7CkBAIC01ODAsNTEgKzU5NCw1MSBAQAogfQogCiBzdGF0aWMgaW50IGFsaWVuX3NpemVv ZihsdWFfU3RhdGUgKkwpIHsKLSAgc3RhdGljIGNvbnN0IGludCBzaXplc1tdID0ge3NpemVvZihp bnQpLCBzaXplb2YoZG91YmxlKSwgc2l6ZW9mKHVjaGFyKSwgCisgIHN0YXRpYyBjb25zdCBpbnQg c2l6ZXNbXSA9IHtzaXplb2YoaW50KSwgc2l6ZW9mKHVuc2lnbmVkIGludCksIHNpemVvZihkb3Vi bGUpLCBzaXplb2YodWNoYXIpLCAKIAkJCSAgICAgIHNpemVvZihjaGFyKiksIHNpemVvZih2b2lk KiksIHNpemVvZihjaGFyKSwKLQkJCSAgICAgIHNpemVvZihzaG9ydCksIHNpemVvZihsb25nKSwg c2l6ZW9mKGZsb2F0KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZih2b2lk KiksIHNpemVvZihjaGFyKiksIHNpemVvZihpbnQqKSwKKwkJCSAgICAgIHNpemVvZihzaG9ydCks IHNpemVvZih1bnNpZ25lZCBzaG9ydCksIHNpemVvZihsb25nKSwgc2l6ZW9mKHVuc2lnbmVkIGxv bmcpLAorCQkJICAgICAgc2l6ZW9mKGZsb2F0KSwgc2l6ZW9mKHZvaWQqKSwgc2l6ZW9mKGNoYXIq KSwgc2l6ZW9mKGludCopLCBzaXplb2YodW5zaWduZWQgaW50KiksCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzaXplb2YoZG91YmxlKil9OwotICBzdGF0aWMgY29uc3QgY2hhciAqY29u c3QgdHlwZW5hbWVzW10gPSB7ImludCIsICJkb3VibGUiLCAiY2hhciIsICJzdHJpbmciLCAKLQkJ CQkJICAicG9pbnRlciIsICJieXRlIiwgInNob3J0IiwgImxvbmciLAorICBzdGF0aWMgY29uc3Qg Y2hhciAqY29uc3QgdHlwZW5hbWVzW10gPSB7ImludCIsICJ1aW50IiwgImRvdWJsZSIsICJjaGFy IiwgInN0cmluZyIsIAorCQkJCQkgICJwb2ludGVyIiwgImJ5dGUiLCAic2hvcnQiLCAidXNob3J0 IiwgImxvbmciLCAidWxvbmciLAogCQkJCQkgICJmbG9hdCIsICJjYWxsYmFjayIsICJyZWYgY2hh ciIsCi0JCQkJCSAgInJlZiBpbnQiLCAicmVmIGRvdWJsZSIsIE5VTEx9OworCQkJCQkgICJyZWYg aW50IiwgInJlZiB1aW50IiwgInJlZiBkb3VibGUiLCBOVUxMfTsKICAgbHVhX3B1c2hudW1iZXIo TCwgc2l6ZXNbbHVhTF9jaGVja29wdGlvbihMLCAxLCAiaW50IiwgdHlwZW5hbWVzKV0pOwogICBy ZXR1cm4gMTsKIH0KIAogc3RhdGljIGludCBhbGllbl9hbGlnbihsdWFfU3RhdGUgKkwpIHsKLSAg c3RhdGljIGNvbnN0IGludCBhbGlnbnNbXSA9IHtBVF9JTlRfQUxJR04sIEFUX0RPVUJMRV9BTElH TiwgQVRfQ0hBUl9BTElHTiwgCisgIHN0YXRpYyBjb25zdCBpbnQgYWxpZ25zW10gPSB7QVRfSU5U X0FMSUdOLCBBVF9JTlRfQUxJR04sIEFUX0RPVUJMRV9BTElHTiwgQVRfQ0hBUl9BTElHTiwgCiAJ CQkgICAgICBBVF9DSEFSX1BfQUxJR04sIEFUX1ZPSURfUF9BTElHTiwgQVRfQ0hBUl9BTElHTiwK LQkJCSAgICAgIEFUX1NIT1JUX0FMSUdOLCBBVF9MT05HX0FMSUdOLCBBVF9GTE9BVF9BTElHTiwK LQkJCSAgICAgIEFUX1ZPSURfUF9BTElHTiwgQVRfQ0hBUl9QX0FMSUdOLCBBVF9WT0lEX1BfQUxJ R04sCisJCQkgICAgICBBVF9TSE9SVF9BTElHTiwgQVRfU0hPUlRfQUxJR04sIEFUX0xPTkdfQUxJ R04sIEFUX0xPTkdfQUxJR04sIEFUX0ZMT0FUX0FMSUdOLAorCQkJICAgICAgQVRfVk9JRF9QX0FM SUdOLCBBVF9DSEFSX1BfQUxJR04sIEFUX1ZPSURfUF9BTElHTiwgQVRfVk9JRF9QX0FMSUdOLAog CQkJICAgICAgIEFUX1ZPSURfUF9BTElHTn07Ci0gIHN0YXRpYyBjb25zdCBjaGFyICpjb25zdCB0 eXBlbmFtZXNbXSA9IHsiaW50IiwgImRvdWJsZSIsICJjaGFyIiwgInN0cmluZyIsIAotCQkJCQkg ICJwb2ludGVyIiwgImJ5dGUiLCAic2hvcnQiLCAibG9uZyIsCisgIHN0YXRpYyBjb25zdCBjaGFy ICpjb25zdCB0eXBlbmFtZXNbXSA9IHsiaW50IiwgInVpbnQiLCAiZG91YmxlIiwgImNoYXIiLCAi c3RyaW5nIiwgCisJCQkJCSAgInBvaW50ZXIiLCAiYnl0ZSIsICJzaG9ydCIsICJ1c2hvcnQiLCAi bG9uZyIsICJ1bG9uZyIsCiAJCQkJCSAgImZsb2F0IiwgImNhbGxiYWNrIiwgInJlZiBjaGFyIiwK LQkJCQkJICAicmVmIGludCIsICJyZWYgZG91YmxlIiwgTlVMTH07CisJCQkJCSAgInJlZiBpbnQi LCAicmVmIHVpbnQiLCAicmVmIGRvdWJsZSIsIE5VTEx9OwogICBsdWFfcHVzaG51bWJlcihMLCBh bGlnbnNbbHVhTF9jaGVja29wdGlvbihMLCAxLCAiY2hhciIsIHR5cGVuYW1lcyldKTsKICAgcmV0 dXJuIDE7CiB9CiAKIHN0YXRpYyBpbnQgYWxpZW5fZnVuY3Rpb25fdHlwZXMobHVhX1N0YXRlICpM KSB7Ci0gIHN0YXRpYyBmZmlfdHlwZSogZmZpdHlwZXNbXSA9IHsmZmZpX3R5cGVfdm9pZCwgJmZm aV90eXBlX3NpbnQsICZmZmlfdHlwZV9kb3VibGUsIAorICBzdGF0aWMgZmZpX3R5cGUqIGZmaXR5 cGVzW10gPSB7JmZmaV90eXBlX3ZvaWQsICZmZmlfdHlwZV9zaW50LCAmZmZpX3R5cGVfdWludCwg JmZmaV90eXBlX2RvdWJsZSwgCiAJCQkJICZmZmlfdHlwZV91Y2hhciwgJmZmaV90eXBlX3BvaW50 ZXIsICZmZmlfdHlwZV9wb2ludGVyLAotCQkJCSAmZmZpX3R5cGVfcG9pbnRlciwgJmZmaV90eXBl X3BvaW50ZXIsICZmZmlfdHlwZV9wb2ludGVyLAotCQkJCSAmZmZpX3R5cGVfcG9pbnRlciwgJmZm aV90eXBlX3NzaG9ydCwgJmZmaV90eXBlX3NjaGFyLAorCQkJCSAmZmZpX3R5cGVfcG9pbnRlciwg JmZmaV90eXBlX3BvaW50ZXIsICZmZmlfdHlwZV9wb2ludGVyLCAmZmZpX3R5cGVfcG9pbnRlciwK KwkJCQkgJmZmaV90eXBlX3BvaW50ZXIsICZmZmlfdHlwZV9zc2hvcnQsICZmZmlfdHlwZV91c2hv cnQsICZmZmlfdHlwZV9zY2hhciwKICNpZm5kZWYgV0lORE9XUwotCQkJCSAmZmZpX3R5cGVfc2xv bmcsIAorCQkJCSAmZmZpX3R5cGVfc2xvbmcsICZmZmlfdHlwZV91bG9uZywKICNlbHNlCi0JCQkJ ICZmZmlfdHlwZV9zaW50LAorCQkJCSAmZmZpX3R5cGVfc2ludCwgJmZmaV90eXBlX3VpbnQsCiAj ZW5kaWYKIAkJCQkgJmZmaV90eXBlX2Zsb2F0fTsKLSAgc3RhdGljIGNvbnN0IGludCB0eXBlc1td ID0ge0FUX1ZPSUQsIEFUX0lOVCwgQVRfRE9VQkxFLCBBVF9DSEFSLCBBVF9TVFJJTkcsIEFUX1BU UiwgQVRfUkVGSU5ULCAKLQkJCSAgICAgIEFUX1JFRkRPVUJMRSwgQVRfUkVGQ0hBUiwgQVRfQ0FM TEJBQ0ssIEFUX1NIT1JULCBBVF9CWVRFLCBBVF9MT05HLAotCQkJICAgICAgQVRfRkxPQVR9Owor ICBzdGF0aWMgY29uc3QgaW50IHR5cGVzW10gPSB7QVRfVk9JRCwgQVRfSU5ULCBBVF9VSU5ULCBB VF9ET1VCTEUsIEFUX0NIQVIsIEFUX1NUUklORywgQVRfUFRSLCBBVF9SRUZJTlQsIEFUX1JFRlVJ TlQsIAorCQkJICAgICAgQVRfUkVGRE9VQkxFLCBBVF9SRUZDSEFSLCBBVF9DQUxMQkFDSywgQVRf U0hPUlQsIEFUX1VTSE9SVCwgQVRfQllURSwgQVRfTE9ORywKKwkJCSAgICAgIEFUX1VMT05HLCBB VF9GTE9BVH07CiAgIHN0YXRpYyBjb25zdCBjaGFyICpjb25zdCB0eXBlbmFtZXNbXSA9IAotICAg IHsidm9pZCIsICJpbnQiLCAiZG91YmxlIiwgImNoYXIiLCAic3RyaW5nIiwgInBvaW50ZXIiLAot ICAgICAicmVmIGludCIsICJyZWYgZG91YmxlIiwgInJlZiBjaGFyIiwgImNhbGxiYWNrIiwgCi0g ICAgICJzaG9ydCIsICJieXRlIiwgImxvbmciLCAiZmxvYXQiLCBOVUxMfTsKKyAgICB7InZvaWQi LCAiaW50IiwgInVpbnQiLCAiZG91YmxlIiwgImNoYXIiLCAic3RyaW5nIiwgInBvaW50ZXIiLAor ICAgICAicmVmIGludCIsICJyZWYgdWludCIsICJyZWYgZG91YmxlIiwgInJlZiBjaGFyIiwgImNh bGxiYWNrIiwgCisgICAgICJzaG9ydCIsICJ1c2hvcnQiLCAiYnl0ZSIsICJsb25nIiwgInVsb25n IiwgImZsb2F0IiwgTlVMTH07CiAgIGZmaV9zdGF0dXMgc3RhdHVzOwogICBmZmlfYWJpIGFiaTsK ICAgYWxpZW5fRnVuY3Rpb24gKmFmID0gYWxpZW5fY2hlY2tmdW5jdGlvbihMLCAxKTsKQEAgLTY5 MSw3ICs3MDUsOSBAQAogc3RhdGljIGludCBhbGllbl9mdW5jdGlvbl9jYWxsKGx1YV9TdGF0ZSAq TCkgewogICBpbnQgaSwgaiwgbmFyZ3MsIG5wYXJhbXM7CiAgIGludCBpcmV0OyBkb3VibGUgZHJl dDsgdm9pZCAqcHJldDsgbG9uZyBscmV0OyBmbG9hdCBmcmV0OwotICBpbnQgKnJlZmlfYXJncywg bnJlZmksIG5yZWZkLCBucmVmYzsKKyAgaW50IG5yZWZpLCBucmVmdWksIG5yZWZkLCBucmVmYzsK KyAgaW50ICpyZWZpX2FyZ3M7CisgIHVuc2lnbmVkIGludCAqcmVmdWlfYXJnczsKICAgZG91Ymxl ICpyZWZkX2FyZ3M7CiAgIGNoYXIgKnJlZmNfYXJnczsKICAgdm9pZCAqKmFyZ3M7CkBAIC03MDYs MTQgKzcyMiwxNiBAQAogICBlbHNlIGlmKG5hcmdzID4gbnBhcmFtcykKICAgICBsdWFMX2Vycm9y KEwsICJhbGllbjogdG9vIG1hbnkgYXJndW1lbnRzIChmdW5jdGlvbiAlcykiLCBhZi0+bmFtZSA/ CiAJICAgICAgIGFmLT5uYW1lIDogImFub255bW91cyIpOwotICBmb3IoaSA9IDAsIG5yZWZpID0g MCwgbnJlZmQgPSAwLCBucmVmYyA9IDA7IGkgPCBucGFyYW1zOyBpKyspIHsKKyAgZm9yKGkgPSAw LCBucmVmaSA9IDAsIG5yZWZ1aSA9IDAsIG5yZWZkID0gMCwgbnJlZmMgPSAwOyBpIDwgbnBhcmFt czsgaSsrKSB7CiAgICAgc3dpdGNoKGFmLT5wYXJhbXNbaV0pIHsKICAgICBjYXNlIEFUX1JFRklO VDogbnJlZmkrKzsgYnJlYWs7CisgICAgY2FzZSBBVF9SRUZVSU5UOiBucmVmdWkrKzsgYnJlYWs7 CiAgICAgY2FzZSBBVF9SRUZET1VCTEU6IG5yZWZkKys7IGJyZWFrOwogICAgIGNhc2UgQVRfUkVG Q0hBUjogbnJlZmMrKzsgYnJlYWs7CiAgICAgfQogICB9CiAgIGlmKG5yZWZpID4gMCkgcmVmaV9h cmdzID0gKGludCopQUxMT0NBKHNpemVvZihpbnQpICogbnJlZmkpOworICBpZihucmVmdWkgPiAw KSByZWZ1aV9hcmdzID0gKHVuc2lnbmVkIGludCopQUxMT0NBKHNpemVvZih1bnNpZ25lZCBpbnQp ICogbnJlZnVpKTsKICAgaWYobnJlZmQgPiAwKSByZWZkX2FyZ3MgPSAoZG91YmxlKilBTExPQ0Eo c2l6ZW9mKGRvdWJsZSkgKiBucmVmZCk7CiAgIGlmKG5yZWZjID4gMCkgcmVmY19hcmdzID0gKGNo YXIqKUFMTE9DQShzaXplb2YoY2hhcikgKiBucmVmYyk7CiAgIGlmKG5hcmdzID4gMCkgYXJncyA9 IEFMTE9DQShzaXplb2Yodm9pZCopICogbmFyZ3MpOwpAQCAtNzIzLDEyICs3NDEsMjEgQEAKICAg ICBjYXNlIEFUX1NIT1JUOgogICAgICAgYXJnID0gQUxMT0NBKHNpemVvZihzaG9ydCkpOyAqKChz aG9ydCopYXJnKSA9IChzaG9ydClsdWFfdG9pbnRlZ2VyKEwsIGopOyAKICAgICAgIGFyZ3NbaV0g PSBhcmc7IGJyZWFrOworICAgIGNhc2UgQVRfVVNIT1JUOgorICAgICAgYXJnID0gQUxMT0NBKHNp emVvZih1bnNpZ25lZCBzaG9ydCkpOyAqKCh1bnNpZ25lZCBzaG9ydCopYXJnKSA9ICh1bnNpZ25l ZCBzaG9ydClsdWFfdG9pbnRlZ2VyKEwsIGopOyAKKyAgICAgIGFyZ3NbaV0gPSBhcmc7IGJyZWFr OwogICAgIGNhc2UgQVRfTE9ORzoKICAgICAgIGFyZyA9IEFMTE9DQShzaXplb2YobG9uZykpOyAq KChsb25nKilhcmcpID0gKGxvbmcpbHVhX3RvaW50ZWdlcihMLCBqKTsgCiAgICAgICBhcmdzW2ld ID0gYXJnOyBicmVhazsKKyAgICBjYXNlIEFUX1VMT05HOgorICAgICAgYXJnID0gQUxMT0NBKHNp emVvZih1bnNpZ25lZCBsb25nKSk7ICooKHVuc2lnbmVkIGxvbmcqKWFyZykgPSAodW5zaWduZWQg bG9uZylsdWFfdG9pbnRlZ2VyKEwsIGopOyAKKyAgICAgIGFyZ3NbaV0gPSBhcmc7IGJyZWFrOwog ICAgIGNhc2UgQVRfSU5UOgogICAgICAgYXJnID0gQUxMT0NBKHNpemVvZihpbnQpKTsgKigoaW50 KilhcmcpID0gKGludClsdWFfdG9pbnRlZ2VyKEwsIGopOyAKICAgICAgIGFyZ3NbaV0gPSBhcmc7 IGJyZWFrOworICAgIGNhc2UgQVRfVUlOVDoKKyAgICAgIGFyZyA9IEFMTE9DQShzaXplb2YodW5z aWduZWQgaW50KSk7ICooKHVuc2lnbmVkIGludCopYXJnKSA9ICh1bnNpZ25lZCBpbnQpbHVhX3Rv aW50ZWdlcihMLCBqKTsgCisgICAgICBhcmdzW2ldID0gYXJnOyBicmVhazsKICAgICBjYXNlIEFU X0NIQVI6CiAgICAgICBhcmcgPSBBTExPQ0Eoc2l6ZW9mKHVjaGFyKSk7ICooKHVjaGFyKilhcmcp ID0gKHVjaGFyKWx1YV90b2ludGVnZXIoTCwgaik7IAogICAgICAgYXJnc1tpXSA9IGFyZzsgYnJl YWs7CkBAIC03NjcsNiArNzk0LDEyIEBACiAgICAgICAqKChpbnQqKilhcmcpID0gcmVmaV9hcmdz OwogICAgICAgYXJnc1tpXSA9IGFyZzsgcmVmaV9hcmdzKys7IGJyZWFrOwogICAgICAgYnJlYWs7 CisgICAgY2FzZSBBVF9SRUZVSU5UOgorICAgICAgKnJlZnVpX2FyZ3MgPSAodW5zaWduZWQgaW50 KWx1YV90b2ludGVnZXIoTCwgaik7CisgICAgICBhcmcgPSBBTExPQ0Eoc2l6ZW9mKHVuc2lnbmVk IGludCopKTsKKyAgICAgICooKHVuc2lnbmVkIGludCoqKWFyZykgPSByZWZ1aV9hcmdzOworICAg ICAgYXJnc1tpXSA9IGFyZzsgcmVmdWlfYXJncysrOyBicmVhazsKKyAgICAgIGJyZWFrOwogICAg IGNhc2UgQVRfUkVGQ0hBUjoKICAgICAgICpyZWZjX2FyZ3MgPSAoY2hhcilsdWFfdG9pbnRlZ2Vy KEwsIGopOwogICAgICAgYXJnID0gQUxMT0NBKHNpemVvZihjaGFyKikpOwpAQCAtNzg4LDkgKzgy MSwxMSBAQAogICBzd2l0Y2goYWYtPnJldF90eXBlKSB7CiAgIGNhc2UgQVRfVk9JRDogZmZpX2Nh bGwoY2lmLCBhZi0+Zm4sIE5VTEwsIGFyZ3MpOyBsdWFfcHVzaG5pbChMKTsgYnJlYWs7CiAgIGNh c2UgQVRfU0hPUlQ6IGZmaV9jYWxsKGNpZiwgYWYtPmZuLCAmaXJldCwgYXJncyk7IGx1YV9wdXNo bnVtYmVyKEwsIChzaG9ydClpcmV0KTsgYnJlYWs7Ci0gIGNhc2UgQVRfTE9ORzogCi0gICAgZmZp X2NhbGwoY2lmLCBhZi0+Zm4sICZscmV0LCBhcmdzKTsgbHVhX3B1c2hudW1iZXIoTCwgbHJldCk7 IGJyZWFrOworICBjYXNlIEFUX1VTSE9SVDogZmZpX2NhbGwoY2lmLCBhZi0+Zm4sICZpcmV0LCBh cmdzKTsgbHVhX3B1c2hudW1iZXIoTCwgKHVuc2lnbmVkIHNob3J0KWlyZXQpOyBicmVhazsKKyAg Y2FzZSBBVF9MT05HOiBmZmlfY2FsbChjaWYsIGFmLT5mbiwgJmxyZXQsIGFyZ3MpOyBsdWFfcHVz aG51bWJlcihMLCBscmV0KTsgYnJlYWs7CisgIGNhc2UgQVRfVUxPTkc6IGZmaV9jYWxsKGNpZiwg YWYtPmZuLCAmbHJldCwgYXJncyk7IGx1YV9wdXNobnVtYmVyKEwsICh1bnNpZ25lZCBsb25nKWxy ZXQpOyBicmVhazsKICAgY2FzZSBBVF9JTlQ6IGZmaV9jYWxsKGNpZiwgYWYtPmZuLCAmaXJldCwg YXJncyk7IGx1YV9wdXNobnVtYmVyKEwsIGlyZXQpOyBicmVhazsKKyAgY2FzZSBBVF9VSU5UOiBm ZmlfY2FsbChjaWYsIGFmLT5mbiwgJmlyZXQsIGFyZ3MpOyBsdWFfcHVzaG51bWJlcihMLCAodW5z aWduZWQgaW50KWlyZXQpOyBicmVhazsKICAgY2FzZSBBVF9DSEFSOiBmZmlfY2FsbChjaWYsIGFm LT5mbiwgJmlyZXQsIGFyZ3MpOyBsdWFfcHVzaG51bWJlcihMLCAodWNoYXIpaXJldCk7IGJyZWFr OwogICBjYXNlIEFUX0JZVEU6IGZmaV9jYWxsKGNpZiwgYWYtPmZuLCAmaXJldCwgYXJncyk7IGx1 YV9wdXNobnVtYmVyKEwsIChzaWduZWQgY2hhcilpcmV0KTsgYnJlYWs7CiAgIGNhc2UgQVRfRkxP QVQ6IGZmaV9jYWxsKGNpZiwgYWYtPmZuLCAmZnJldCwgYXJncyk7IGx1YV9wdXNobnVtYmVyKEws IGZyZXQpOyBicmVhazsKQEAgLTgwMywxNSArODM4LDE2IEBACiAgICAgbHVhTF9lcnJvcihMLCAi YWxpZW46IHVua25vd24gcmV0dXJuIHR5cGUgKGZ1bmN0aW9uICVzKSIsIGFmLT5uYW1lID8KIAkg ICAgICAgYWYtPm5hbWUgOiAiYW5vbnltb3VzIik7CiAgIH0KLSAgcmVmaV9hcmdzIC09IG5yZWZp OyByZWZkX2FyZ3MgLT0gbnJlZmQ7IHJlZmNfYXJncyAtPSBucmVmYzsKKyAgcmVmaV9hcmdzIC09 IG5yZWZpOyByZWZ1aV9hcmdzIC09IG5yZWZ1aTsgcmVmZF9hcmdzIC09IG5yZWZkOyByZWZjX2Fy Z3MgLT0gbnJlZmM7CiAgIGZvcihpID0gMDsgaSA8IG5wYXJhbXM7IGkrKykgewogICAgIHN3aXRj aChhZi0+cGFyYW1zW2ldKSB7CiAgICAgY2FzZSBBVF9SRUZJTlQ6IGx1YV9wdXNobnVtYmVyKEws ICpyZWZpX2FyZ3MpOyByZWZpX2FyZ3MrKzsgYnJlYWs7CisgICAgY2FzZSBBVF9SRUZVSU5UOiBs dWFfcHVzaG51bWJlcihMLCAqcmVmdWlfYXJncyk7IHJlZnVpX2FyZ3MrKzsgYnJlYWs7CiAgICAg Y2FzZSBBVF9SRUZET1VCTEU6IGx1YV9wdXNobnVtYmVyKEwsICpyZWZkX2FyZ3MpOyByZWZkX2Fy Z3MrKzsgYnJlYWs7CiAgICAgY2FzZSBBVF9SRUZDSEFSOiBsdWFfcHVzaG51bWJlcihMLCAqcmVm Y19hcmdzKTsgcmVmY19hcmdzKys7IGJyZWFrOwogICAgIH0KICAgfQotICByZXR1cm4gMSArIG5y ZWZpICsgbnJlZmMgKyBucmVmZDsKKyAgcmV0dXJuIDEgKyBucmVmaSArIG5yZWZ1aSArIG5yZWZj ICsgbnJlZmQ7CiB9CiAKIHN0YXRpYyBpbnQgYWxpZW5fbGlicmFyeV9nYyhsdWFfU3RhdGUgKkwp IHsKQEAgLTk0NywxMyArOTgzLDE3IEBACiAKIHN0YXRpYyBpbnQgYWxpZW5fYnVmZmVyX3Rvc3Ry aW5nKGx1YV9TdGF0ZSAqTCkgewogICBjaGFyICpiOwotICBpbnQgc2l6ZTsKKyAgaW50IHNpemUs IG9mZnNldDsKICAgYiA9IGFsaWVuX2NoZWNrYnVmZmVyKEwsIDEpOwotICBpZihsdWFfZ2V0dG9w KEwpIDwgMiB8fCBsdWFfaXNuaWwoTCwgMikpCisgIGlmKGx1YV9nZXR0b3AoTCkgPCAyIHx8IGx1 YV9pc25pbChMLCAyKSkgewogICAgIHNpemUgPSBzdHJsZW4oYik7Ci0gIGVsc2UKKyAgICBvZmZz ZXQgPSAwOworICB9CisgIGVsc2UgewogICAgIHNpemUgPSBsdWFMX2NoZWNraW50ZWdlcihMLCAy KTsKLSAgbHVhX3B1c2hsc3RyaW5nKEwsIGIsIHNpemUpOworICAgIG9mZnNldCA9IGx1YUxfb3B0 aW50KEwsIDMsIDEpIC0gMTsKKyAgfQorICBsdWFfcHVzaGxzdHJpbmcoTCwgYiArIG9mZnNldCwg c2l6ZSk7CiAgIHJldHVybiAxOwogfQogCkBAIC05NjUsNyArMTAwNSw4IEBACiAKIHN0YXRpYyBp bnQgYWxpZW5fYnVmZmVyX3RvcG9pbnRlcihsdWFfU3RhdGUgKkwpIHsKICAgY2hhciAqYiA9IGFs aWVuX2NoZWNrYnVmZmVyKEwsIDEpOwotICBsdWFfcHVzaGxpZ2h0dXNlcmRhdGEoTCwgYik7Cisg IGludCBvZmZzZXQgPSBsdWFMX29wdGludChMLCAyLCAxKSAtIDE7CisgIGx1YV9wdXNobGlnaHR1 c2VyZGF0YShMLCBiICsgb2Zmc2V0KTsKICAgcmV0dXJuIDE7CiB9CiAKQEAgLTk3OCwxMyArMTAx OSwxMyBAQAogCQkJCSZhbGllbl9idWZmZXJfZ2V0LAogCQkJCSZhbGllbl9idWZmZXJfcHV0fTsK ICAgc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IGZ1bmNuYW1lc1tdID0geyAidG9zdHJpbmciLCAi dG9wb2ludGVyIiwgImxlbiIsICJnZXQiLCAic2V0IiwgTlVMTCB9OwotICBzdGF0aWMgY29uc3Qg aW50IHR5cGVzW10gPSB7QVRfVk9JRCwgQVRfSU5ULCBBVF9ET1VCTEUsIEFUX0NIQVIsIEFUX1NU UklORywgQVRfUFRSLCBBVF9SRUZJTlQsIAotCQkJICAgICAgQVRfUkVGRE9VQkxFLCBBVF9SRUZD SEFSLCBBVF9DQUxMQkFDSywgQVRfU0hPUlQsIEFUX0JZVEUsIEFUX0xPTkcsCi0JCQkgICAgICBB VF9GTE9BVH07CisgIHN0YXRpYyBjb25zdCBpbnQgdHlwZXNbXSA9IHtBVF9WT0lELCBBVF9JTlQs IEFUX1VJTlQsIEFUX0RPVUJMRSwgQVRfQ0hBUiwgQVRfU1RSSU5HLCBBVF9QVFIsIEFUX1JFRklO VCwgQVRfUkVGVUlOVCwKKwkJCSAgICAgIEFUX1JFRkRPVUJMRSwgQVRfUkVGQ0hBUiwgQVRfQ0FM TEJBQ0ssIEFUX1NIT1JULCBBVF9VU0hPUlQsIEFUX0JZVEUsIEFUX0xPTkcsCisJCQkgICAgICBB VF9VTE9ORywgQVRfRkxPQVR9OwogICBzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgdHlwZW5hbWVz W10gPSAKLSAgICB7InZvaWQiLCAiaW50IiwgImRvdWJsZSIsICJjaGFyIiwgInN0cmluZyIsICJw b2ludGVyIiwKLSAgICAgInJlZiBpbnQiLCAicmVmIGRvdWJsZSIsICJyZWYgY2hhciIsICJjYWxs YmFjayIsIAotICAgICAic2hvcnQiLCAiYnl0ZSIsICJsb25nIiwgImZsb2F0IiwgTlVMTH07Cisg ICAgeyJ2b2lkIiwgImludCIsICJ1aW50IiwgImRvdWJsZSIsICJjaGFyIiwgInN0cmluZyIsICJw b2ludGVyIiwKKyAgICAgInJlZiBpbnQiLCAicmVmIHVpbnQiLCAicmVmIGRvdWJsZSIsICJyZWYg Y2hhciIsICJjYWxsYmFjayIsIAorICAgICAic2hvcnQiLCAidXNob3J0IiwgImJ5dGUiLCAibG9u ZyIsICJ1bG9uZyIsICJmbG9hdCIsIE5VTEx9OwogICBjaGFyICpiID0gYWxpZW5fY2hlY2tidWZm ZXIoTCwgMSk7CiAgIGlmKGx1YV90eXBlKEwsIDIpID09IExVQV9UU1RSSU5HKSB7CiAgICAgbHVh X3B1c2hjZnVuY3Rpb24oTCwgCkBAIC05OTUsOCArMTAzNiwxMSBAQAogICAgIGludCB0eXBlID0g dHlwZXNbbHVhTF9jaGVja29wdGlvbihMLCAzLCAiY2hhciIsIHR5cGVuYW1lcyldOwogICAgIHN3 aXRjaCh0eXBlKSB7CiAgICAgY2FzZSBBVF9TSE9SVDogbHVhX3B1c2hudW1iZXIoTCwgKigoc2hv cnQqKSgmYltvZmZzZXRdKSkpOyBicmVhazsKKyAgICBjYXNlIEFUX1VTSE9SVDogbHVhX3B1c2hu dW1iZXIoTCwgKigodW5zaWduZWQgc2hvcnQqKSgmYltvZmZzZXRdKSkpOyBicmVhazsKICAgICBj YXNlIEFUX0lOVDogbHVhX3B1c2hudW1iZXIoTCwgKigoaW50KikoJmJbb2Zmc2V0XSkpKTsgYnJl YWs7CisgICAgY2FzZSBBVF9VSU5UOiBsdWFfcHVzaG51bWJlcihMLCAqKCh1bnNpZ25lZCBpbnQq KSgmYltvZmZzZXRdKSkpOyBicmVhazsKICAgICBjYXNlIEFUX0xPTkc6IGx1YV9wdXNobnVtYmVy KEwsICooKGxvbmcqKSgmYltvZmZzZXRdKSkpOyBicmVhazsKKyAgICBjYXNlIEFUX1VMT05HOiBs dWFfcHVzaG51bWJlcihMLCAqKCh1bnNpZ25lZCBsb25nKikoJmJbb2Zmc2V0XSkpKTsgYnJlYWs7 CiAgICAgY2FzZSBBVF9CWVRFOiBsdWFfcHVzaG51bWJlcihMLCAoc2lnbmVkIGNoYXIpYltvZmZz ZXRdKTsgYnJlYWs7CiAgICAgY2FzZSBBVF9DSEFSOiBsdWFfcHVzaG51bWJlcihMLCBiW29mZnNl dF0pOyBicmVhazsKICAgICBjYXNlIEFUX0ZMT0FUOiBsdWFfcHVzaG51bWJlcihMLCAqKChmbG9h dCopKCZiW29mZnNldF0pKSk7IGJyZWFrOwpAQCAtMTAyMSwyMCArMTA2NSwyMyBAQAogfQogCiBz dGF0aWMgaW50IGFsaWVuX2J1ZmZlcl9wdXQobHVhX1N0YXRlICpMKSB7Ci0gIHN0YXRpYyBjb25z dCBpbnQgdHlwZXNbXSA9IHtBVF9WT0lELCBBVF9JTlQsIEFUX0RPVUJMRSwgQVRfQ0hBUiwgQVRf U1RSSU5HLCBBVF9QVFIsIEFUX1JFRklOVCwgCi0JCQkgICAgICBBVF9SRUZET1VCTEUsIEFUX1JF RkNIQVIsIEFUX0NBTExCQUNLLCBBVF9TSE9SVCwgQVRfQllURSwgQVRfTE9ORywKLQkJCSAgICAg IEFUX0ZMT0FUfTsKKyAgc3RhdGljIGNvbnN0IGludCB0eXBlc1tdID0ge0FUX1ZPSUQsIEFUX0lO VCwgQVRfVUlOVCwgQVRfRE9VQkxFLCBBVF9DSEFSLCBBVF9TVFJJTkcsIEFUX1BUUiwgQVRfUkVG SU5ULCBBVF9SRUZVSU5ULCAKKwkJCSAgICAgIEFUX1JFRkRPVUJMRSwgQVRfUkVGQ0hBUiwgQVRf Q0FMTEJBQ0ssIEFUX1NIT1JULCBBVF9VU0hPUlQsIEFUX0JZVEUsIEFUX0xPTkcsCisJCQkgICAg ICBBVF9VTE9ORywgQVRfRkxPQVR9OwogICBzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgdHlwZW5h bWVzW10gPSAKLSAgICB7InZvaWQiLCAiaW50IiwgImRvdWJsZSIsICJjaGFyIiwgInN0cmluZyIs ICJwb2ludGVyIiwKLSAgICAgInJlZiBpbnQiLCAicmVmIGRvdWJsZSIsICJyZWYgY2hhciIsICJj YWxsYmFjayIsIAotICAgICAic2hvcnQiLCAiYnl0ZSIsICJsb25nIiwgImZsb2F0IiwgTlVMTH07 CisgICAgeyJ2b2lkIiwgImludCIsICJ1aW50IiwgImRvdWJsZSIsICJjaGFyIiwgInN0cmluZyIs ICJwb2ludGVyIiwKKyAgICAgInJlZiBpbnQiLCAicmVmIHVpbnQiLCAicmVmIGRvdWJsZSIsICJy ZWYgY2hhciIsICJjYWxsYmFjayIsIAorICAgICAic2hvcnQiLCAidXNob3J0IiwgImJ5dGUiLCAi bG9uZyIsICJ1bG9uZyIsICJmbG9hdCIsIE5VTEx9OwogICBjaGFyICpiID0gYWxpZW5fY2hlY2ti dWZmZXIoTCwgMSk7CiAgIGludCBvZmZzZXQgPSBsdWFMX2NoZWNraW50ZWdlcihMLCAyKSAtIDE7 CiAgIGludCB0eXBlID0gdHlwZXNbbHVhTF9jaGVja29wdGlvbihMLCA0LCAiY2hhciIsIHR5cGVu YW1lcyldOwogICBzd2l0Y2godHlwZSkgewogICBjYXNlIEFUX1NIT1JUOiAqKChzaG9ydCopKCZi W29mZnNldF0pKSA9IChzaG9ydClsdWFfdG9pbnRlZ2VyKEwsIDMpOyBicmVhazsKKyAgY2FzZSBB VF9VU0hPUlQ6ICooKHVuc2lnbmVkIHNob3J0KikoJmJbb2Zmc2V0XSkpID0gKHVuc2lnbmVkIHNo b3J0KWx1YV90b2ludGVnZXIoTCwgMyk7IGJyZWFrOwogICBjYXNlIEFUX0lOVDogKigoaW50Kiko JmJbb2Zmc2V0XSkpID0gKGludClsdWFfdG9pbnRlZ2VyKEwsIDMpOyBicmVhazsKKyAgY2FzZSBB VF9VSU5UOiAqKCh1bnNpZ25lZCBpbnQqKSgmYltvZmZzZXRdKSkgPSAodW5zaWduZWQgaW50KWx1 YV90b2ludGVnZXIoTCwgMyk7IGJyZWFrOwogICBjYXNlIEFUX0xPTkc6ICooKGxvbmcqKSgmYltv ZmZzZXRdKSkgPSAobG9uZylsdWFfdG9pbnRlZ2VyKEwsIDMpOyBicmVhazsKKyAgY2FzZSBBVF9V TE9ORzogKigodW5zaWduZWQgbG9uZyopKCZiW29mZnNldF0pKSA9ICh1bnNpZ25lZCBsb25nKWx1 YV90b2ludGVnZXIoTCwgMyk7IGJyZWFrOwogICBjYXNlIEFUX0JZVEU6IGJbb2Zmc2V0XSA9IChz aWduZWQgY2hhcilsdWFfdG9pbnRlZ2VyKEwsIDMpOyBicmVhazsKICAgY2FzZSBBVF9DSEFSOiBi W29mZnNldF0gPSAoY2hhcilsdWFfdG9pbnRlZ2VyKEwsIDMpOyBicmVhazsKICAgY2FzZSBBVF9G TE9BVDogKigoZmxvYXQqKSgmYltvZmZzZXRdKSkgPSAoZmxvYXQpbHVhX3RvbnVtYmVyKEwsIDMp OyBicmVhazsKQEAgLTExNzcsNiArMTIyNCwyNSBAQAogICByZXR1cm4gc2l6ZTsKIH0KIAorc3Rh dGljIGludCBhbGllbl91ZGF0YTJ1aW50KGx1YV9TdGF0ZSAqTCkgeworICB1bnNpZ25lZCBpbnQg KnVkOworICBpbnQgc2l6ZSwgaTsKKyAgaWYobHVhX2lzbmlsKEwsIDEpKSB7CisgICAgbHVhX3B1 c2huaWwoTCk7CisgICAgcmV0dXJuIDE7CisgIH0KKyAgbHVhTF9jaGVja3R5cGUoTCwgMSwgTFVB X1RMSUdIVFVTRVJEQVRBKTsKKyAgaWYobHVhX2dldHRvcChMKSA8IDIgfHwgbHVhX2lzbmlsKEws IDIpKQorICAgIHNpemUgPSAxOworICBlbHNlCisgICAgc2l6ZSA9IGx1YUxfY2hlY2tpbnRlZ2Vy KEwsIDIpOworICB1ZCA9ICh1bnNpZ25lZCBpbnQgKilsdWFfdG91c2VyZGF0YShMLCAxKTsKKyAg Zm9yKGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7CisgICAgbHVhX3B1c2hudW1iZXIoTCwgdWRbaV0p OworICB9CisgIHJldHVybiBzaXplOworfQorCiBzdGF0aWMgaW50IGFsaWVuX3VkYXRhMnNob3J0 KGx1YV9TdGF0ZSAqTCkgewogICBzaG9ydCAqdWQ7CiAgIGludCBzaXplLCBpOwpAQCAtMTE5NSw2 ICsxMjYxLDI0IEBACiAgIHJldHVybiBzaXplOwogfQogCitzdGF0aWMgaW50IGFsaWVuX3VkYXRh MnVzaG9ydChsdWFfU3RhdGUgKkwpIHsKKyAgdW5zaWduZWQgc2hvcnQgKnVkOworICBpbnQgc2l6 ZSwgaTsKKyAgaWYobHVhX2lzbmlsKEwsIDEpKSB7CisgICAgbHVhX3B1c2huaWwoTCk7CisgICAg cmV0dXJuIDE7CisgIH0KKyAgbHVhTF9jaGVja3R5cGUoTCwgMSwgTFVBX1RMSUdIVFVTRVJEQVRB KTsKKyAgaWYobHVhX2dldHRvcChMKSA8IDIgfHwgbHVhX2lzbmlsKEwsIDIpKQorICAgIHNpemUg PSAxOworICBlbHNlCisgICAgc2l6ZSA9IGx1YUxfY2hlY2tpbnRlZ2VyKEwsIDIpOworICB1ZCA9 ICh1bnNpZ25lZCBzaG9ydCAqKWx1YV90b3VzZXJkYXRhKEwsIDEpOworICBmb3IoaSA9IDA7IGkg PCBzaXplOyBpKyspCisgICAgbHVhX3B1c2hudW1iZXIoTCwgdWRbaV0pOworICByZXR1cm4gc2l6 ZTsKK30KKwogc3RhdGljIGludCBhbGllbl91ZGF0YTJjaGFyKGx1YV9TdGF0ZSAqTCkgewogICBj aGFyICp1ZDsKICAgaW50IHNpemUsIGk7CkBAIC0xMjMxLDYgKzEzMTUsMjQgQEAKICAgcmV0dXJu IHNpemU7CiB9CiAKK3N0YXRpYyBpbnQgYWxpZW5fdWRhdGEydWxvbmcobHVhX1N0YXRlICpMKSB7 CisgIHVuc2lnbmVkIGxvbmcgKnVkOworICBpbnQgc2l6ZSwgaTsKKyAgaWYobHVhX2lzbmlsKEws IDEpKSB7CisgICAgbHVhX3B1c2huaWwoTCk7CisgICAgcmV0dXJuIDE7CisgIH0KKyAgbHVhTF9j aGVja3R5cGUoTCwgMSwgTFVBX1RMSUdIVFVTRVJEQVRBKTsKKyAgaWYobHVhX2dldHRvcChMKSA8 IDIgfHwgbHVhX2lzbmlsKEwsIDIpKQorICAgIHNpemUgPSAxOworICBlbHNlCisgICAgc2l6ZSA9 IGx1YUxfY2hlY2tpbnRlZ2VyKEwsIDIpOworICB1ZCA9ICh1bnNpZ25lZCBsb25nICopbHVhX3Rv dXNlcmRhdGEoTCwgMSk7CisgIGZvcihpID0gMDsgaSA8IHNpemU7IGkrKykKKyAgICBsdWFfcHVz aG51bWJlcihMLCB1ZFtpXSk7CisgIHJldHVybiBzaXplOworfQorCiBzdGF0aWMgaW50IGFsaWVu X3VkYXRhMmZsb2F0KGx1YV9TdGF0ZSAqTCkgewogICBmbG9hdCAqdWQ7CiAgIGludCBzaXplLCBp OwpAQCAtMTI3OCw5ICsxMzgwLDEyIEBACiAgIHsic2l6ZW9mIiwgYWxpZW5fc2l6ZW9mfSwKICAg eyJ0b2RvdWJsZSIsIGFsaWVuX3VkYXRhMmRvdWJsZX0sCiAgIHsidG9pbnQiLCBhbGllbl91ZGF0 YTJpbnR9LAorICB7InRvdWludCIsIGFsaWVuX3VkYXRhMnVpbnR9LAogICB7InRvbG9uZyIsIGFs aWVuX3VkYXRhMmxvbmd9LAorICB7InRvdWxvbmciLCBhbGllbl91ZGF0YTJ1bG9uZ30sCiAgIHsi dG9mbG9hdCIsIGFsaWVuX3VkYXRhMmZsb2F0fSwKICAgeyJ0b3Nob3J0IiwgYWxpZW5fdWRhdGEy c2hvcnR9LAorICB7InRvdXNob3J0IiwgYWxpZW5fdWRhdGEydXNob3J0fSwKICAgeyJ0b2NoYXIi LCBhbGllbl91ZGF0YTJjaGFyfSwKICAgeyJidWZmZXIiLCBhbGllbl9idWZmZXJfbmV3fSwKICAg eyJjYWxsYmFjayIsIGFsaWVuX2NhbGxiYWNrX25ld30sCg== --001636c5ba67234e01046ff2fbf8 Content-Type: application/octet-stream; name="test_alien_new.lua" Content-Disposition: attachment; filename="test_alien_new.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fxrywi5k2 CnJlcXVpcmUgJ2FsaWVuJwpyZXF1aXJlICdhbGllbi5zdHJ1Y3QnCgpkbwogICBsb2NhbCBzdHJ1 Y3QgPSBhbGllbi5zdHJ1Y3QKCiAgIGxvY2FsIGJ1ZiA9IGFsaWVuLmJ1ZmZlcignMTIzNDU2JykK ICAgYXNzZXJ0KGFsaWVuLmJ1ZmZlcihidWY6dG9wb2ludGVyKDMpKTp0b3N0cmluZygzLDIpPT0n NDU2JykKICAgCiAgIC0tYnVmOnNldCgxLCcxMjNhYmMnKQogICAtLWFzc2VydChhbGllbi5idWZm ZXIoYnVmOnRvcG9pbnRlcigzKSk6dG9zdHJpbmcoMywyKT09J2FiYycpCgogICBsb2NhbCBTID0g Jz5pcGJwaCcKICAgbG9jYWwgYmEgPSBhbGllbi5idWZmZXIoJ2FcMCcpCiAgIGxvY2FsIGJiID0g YWxpZW4uYnVmZmVyKCdiXDAnKQogICBsb2NhbCBzID0gc3RydWN0LnBhY2soUywxLGJhLDIsYmIs MykKICAgbG9jYWwgYnVmID0gYWxpZW4uYnVmZmVyKHMpCiAgIGxvY2FsIG9uZSxwYmEsdHdvLHBi Yix0aHJlZSA9IHN0cnVjdC51bnBhY2soUyxidWYsc3RydWN0LnNpemUoUykpCiAgIGFzc2VydChv bmU9PTEpIGFzc2VydCh0d289PTIpIGFzc2VydCh0aHJlZT09MykKICAgYXNzZXJ0KGFsaWVuLmJ1 ZmZlcihwYmEpOnRvc3RyaW5nKCk9PSdhJykKICAgYXNzZXJ0KGFsaWVuLnRvc3RyaW5nKHBiYik9 PSdiJykKICAgCiAgIGxvY2FsIHBiYix0aHJlZSA9IHN0cnVjdC51bnBhY2soJz5waCcsYnVmLHN0 cnVjdC5zaXplKFMpLHN0cnVjdC5vZmZzZXQoUyw0KSkKICAgYXNzZXJ0KGFsaWVuLmJ1ZmZlcihw YmIpOnRvc3RyaW5nKCk9PSdiJykKICAgYXNzZXJ0KHRocmVlPT0zKQoKICAgLS1idWY6c2V0KHN0 cnVjdC5vZmZzZXQoUyw0KSxzdHJ1Y3QucGFjaygncCcsYmEpKQogICAtLWFzc2VydChhbGllbi5i dWZmZXIoc3RydWN0LnVucGFjaygncCcsYnVmLHN0cnVjdC5zaXplKFMpLHN0cnVjdC5vZmZzZXQo Uyw0KSkpOnRvc3RyaW5nKCk9PSdhJykKCiAgIGFzc2VydChzdHJ1Y3Quc2l6ZSgncCcpPT00KQog ICBhc3NlcnQoc3RydWN0Lm9mZnNldChTLDEpPT0xKQogICBhc3NlcnQoc3RydWN0Lm9mZnNldChT LDQpPT0xMCkKICAgYXNzZXJ0KHN0cnVjdC5vZmZzZXQoUyw2KT09c3RydWN0LnNpemUoUykrMSkK ZW5kCgpkbwogICBhc3NlcnQoYWxpZW4uc2l6ZW9mKCd1c2hvcnQnKT09YWxpZW4uc2l6ZW9mKCdz aG9ydCcpKQogICBhc3NlcnQoYWxpZW4uc2l6ZW9mKCd1aW50Jyk9PWFsaWVuLnNpemVvZignaW50 JykpCiAgIGFzc2VydChhbGllbi5zaXplb2YoJ3Vsb25nJyk9PWFsaWVuLnNpemVvZignbG9uZycp KQogICBsb2NhbCBidWYgPSBhbGllbi5idWZmZXIoYWxpZW4uc2l6ZW9mKCd1bG9uZycpKQogICBi dWY6c2V0KDEsLTEsJ3VzaG9ydCcpCiAgIGFzc2VydChidWY6Z2V0KDEsJ3Nob3J0Jyk9PS0xKQog ICBhc3NlcnQoYnVmOmdldCgxLCd1c2hvcnQnKT09Ml4xNi0xKQogICBhc3NlcnQoYWxpZW4udG91 c2hvcnQoYnVmOnRvcG9pbnRlcigpKT09Ml4xNi0xKQogICBidWY6c2V0KDEsLTEsJ3VpbnQnKQog ICBhc3NlcnQoYnVmOmdldCgxLCdpbnQnKT09LTEpCiAgIGFzc2VydChidWY6Z2V0KDEsJ3VpbnQn KT09Ml4zMi0xKQogICBhc3NlcnQoYWxpZW4udG91aW50KGJ1Zjp0b3BvaW50ZXIoKSk9PTJeMzIt MSkKICAgYnVmOnNldCgxLC0xLCd1bG9uZycpCiAgIGFzc2VydChidWY6Z2V0KDEsJ2xvbmcnKT09 LTEpCiAgIGFzc2VydChidWY6Z2V0KDEsJ3Vsb25nJyk9PTJeMzItMSkKICAgYXNzZXJ0KGFsaWVu LnRvdWludChidWY6dG9wb2ludGVyKCkpPT0yXjMyLTEpCmVuZAoKbG9jYWwgZGxsID0gYWxpZW4u YWxpZW50ZXN0CmRvCiAgYXNzZXJ0KGFsaWVuLnNpemVvZigndXNob3J0Jyk9PTIpCiAgYXNzZXJ0 KGFsaWVuLnNpemVvZigndWludCcpPT00KQogIGFzc2VydChhbGllbi5zaXplb2YoJ3Vsb25nJyk9 PTQpCiAgbG9jYWwgZiA9IGRsbC5fdGVzdGZ1bmNfTF9ISUwKICBmOnR5cGVzKCJ1bG9uZyIsICJ1 c2hvcnQiLCAidWludCIsICJ1bG9uZyIpCiAgYXNzZXJ0KGYoMCwwLC0xKT09Ml4zMi0xKQogIGFz c2VydChmKDAsLTEsMCk9PTJeMzItMSkKICBhc3NlcnQoZigtMSwwLDApPT0yXjE2LTEpCiAgYXNz ZXJ0KGYoMCwwLDJeMzItMSk9PTJeMzItMSkKZW5kCgpsb2NhbCBkbGwgPSBhbGllbi5hbGllbnRl c3QKZG8KICBsb2NhbCBmID0gZGxsLl90ZXN0ZnVuY19MX0hJTAogIC0tIG1pc3R5cGluZyB0byBz ZWUgdGhlIGVmZmVjdHM6IG9ubHkgdGhlIHJldHVybiB2YWx1ZSBpcyBhZmZlY3RlZC4KICBmOnR5 cGVzKCJsb25nIiwgInNob3J0IiwgImludCIsICJsb25nIikKICBhc3NlcnQoZigyXjE2LDAsMCk9 PTApCiAgYXNzZXJ0KGYoMCwyXjMyLDApPT0wKQogIGFzc2VydChmKDAsMCwyXjMyKT09MCkKICBh c3NlcnQoZigwLDAsMl4zMi0xKT09LTEpCiAgYXNzZXJ0KGYoMCwtMSwwKT09LTEpCmVuZAoK --001636c5ba67234e01046ff2fbf8-- From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 18:43:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6ULh62s000414; Thu, 30 Jul 2009 18:43:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDD4A1879E; Thu, 30 Jul 2009 18:42:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A27B318743 for ; Thu, 30 Jul 2009 18:42:36 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so493025fgg.5 for ; Thu, 30 Jul 2009 14:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uN0dY8n40bIHOb2CHUPHU+jJiDfjRW/hZlEXQOiAUZI=; b=HE95PrDF8Z+ixVJFcDbWKaSvyPWbtnALluvasbjGjdGwfwxrJUEuR3MTVHtK+mcuhB jElyov0xdy0m1VBw/tDsppEcSyegVHHbwBTWJNtR2xRrNVgOupWxOKupGrp22Pf2oaIU 4+VaAeTSAEcMUt/h5Y0n0gH1pT8YwfK8Kl7qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FP/M8JUoRn8r371EyqInbMUV29h+C++HkUeRbghYS2C8sn5jS9tnC+EHF7bEkJJHSE +M8w9Orr3MemOUzNt2t8Ch0OdD/57BKyWXAJNV7AiCs2SsiAJjfHyZozGU94qbu2DCD0 P9ChC7TCGAJkm+Tq3tOCuRkQFQrzl8lz+q/7c= MIME-Version: 1.0 Received: by 10.86.90.8 with SMTP id n8mr595582fgb.59.1248990153212; Thu, 30 Jul 2009 14:42:33 -0700 (PDT) In-Reply-To: <7913df4d0907300925x3020dd50scfc1283c6cfeedb9@mail.gmail.com> References: <9386fb2d0907270317w570ef640saf78eae33c98004@mail.gmail.com> <9386fb2d0907300321l5f93541cw892a9b0ca08345f2@mail.gmail.com> <7913df4d0907300925x3020dd50scfc1283c6cfeedb9@mail.gmail.com> Date: Thu, 30 Jul 2009 23:42:33 +0200 Message-ID: <9386fb2d0907301442hf26036emeeff903bd756212b@mail.gmail.com> Subject: Re: [Kepler-Project] Re: Containment test fails From: Pierre LeMoine To: Kepler Project mailing list Content-Type: text/plain; charset=ISO-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6ULh62s000414 Thanks, i though about searching the archives but couldn't find any information on how to do it. =P Now i know, two things learned, thanks again x] /Pierre 2009/7/30 Fabio Mascarenhas : > Hi, Pierre, > > The truly impatient check the list archives: :-) > > http://www.google.com/search?rlz=1C1GGLS_enBR336BR336&sourceid=chrome&ie=UTF-8&q=site:http://lists.luaforge.net/pipermail/kepler-project/+containment++test > http://luaservice.luaforge.net/ > > -- > Fabio Mascarenhas > > > On Thu, Jul 30, 2009 at 7:21 AM, Pierre LeMoine wrote: >> Hi! >> I sent the following message to the kepler list, and as i'm impatient >> i'm thinking maybe nobody watches that list or maybe i made failed to >> send it properly. >> I'm sending this here mail to the lua list, in hopes of getting a response =p >> /Pierre >> >> >> ---------- Forwarded message ---------- >> From: Pierre LeMoine >> Date: 2009/7/27 >> Subject: Containment test fails >> To: kepler-project@lists.luaforge.net >> >> >> Hi >> >> I've just reinstalled my server, and decided to go with kepler-xavante >> instead of apache. >> I noticed that the containment test fails, or at least i suppose it fails. >> browse to http://luben.se/test.lp to see for yourselves =p >> >> I also noted that the file upload/remove thing produces the following >> when removing the file: >> There was an error in the specified application. The full error message follows: >> There was an error in the specified application. The full error message follows: >> >> d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: attempt to >> use a closed file >> stack traceback: >>        [C]: in function 'close' >>        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:585: in function >>        [C]: in function 'foreachi' >>        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:584: in >> function 'reset' >>        d:\lua\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:637: in >> function 'main' >>        ...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:49: in >> function <...:\lua\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:7> >>        (tail call): ? >> stack traceback: >>        ...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in >> function <...a\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22> >>        (tail call): ? >>        (tail call): ? >>        (tail call): ? >>        (tail call): ? >>        (tail call): ? >>        [string "  if (select(2,...)) then..."]:66: in function <[string " >> if (select(2,...)) then..."]:63> >> >> That message i get every time i go to the test page, until i restart >> xavante, wich makes me think it's related to the earlier failing. >> >> Also, is there a way to make xavante start without me having to log >> in? (windows) or should i use something like the XYNTService? >> >> Thanks a load =] >> /Pierre >> > > _______________________________________________ > Kepler-Project mailing list > Kepler-Project@lists.luaforge.net > http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project > http://www.keplerproject.org/ > From lua-bounces@bazar2.conectiva.com.br Thu Jul 30 22:25:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6V1Pj9W027417; Thu, 30 Jul 2009 22:25:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7190018FCC; Thu, 30 Jul 2009 22:25:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7B8C18AD6 for ; Thu, 30 Jul 2009 22:25:08 -0300 (BRT) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6V1P5eV027306 for ; Thu, 30 Jul 2009 22:25:07 -0300 From: "Antonio Scuri" To: "'Lua list'" References: <85861A744C29EA46BFD9BB61889AE59D3CB174FC17@KLMExch.klmicrowave.com> In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB174FC17@KLMExch.klmicrowave.com> Subject: RE: Using IUP with blocking calls Date: Thu, 30 Jul 2009 22:24:28 -0300 Message-ID: <000901ca117d$a70e0ae0$f52a20a0$@puc-rio.br> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01CA1164.81C0D2E0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoRTbE1Di6Yp7r1QdGAct/ludQx1gAL82lg Content-Language: pt-br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This is a multi-part message in MIME format. ------=_NextPart_000_000A_01CA1164.81C0D2E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Yes, there is. During your loop call IupLoopStep. Best, scuri From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of King, Mike Sent: quinta-feira, 30 de julho de 2009 16:41 To: Lua list Subject: Using IUP with blocking calls Is there a way to use IUP and call functions that take a long time to return without blocking the GUI thread? There's probably a way using Lua Lanes. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. ------=_NextPart_000_000A_01CA1164.81C0D2E0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

  = Yes, there is. During your loop call IupLoopStep.

 

Best,

scuri

 

From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of King, = Mike
Sent: quinta-feira, 30 de julho de 2009 16:41
To: Lua list
Subject: Using IUP with blocking calls

 

Is there a way to use IUP and = call functions that take a long time to return without blocking the GUI thread?  There’s probably a way using Lua = Lanes.

CONFIDENTIALITY NOTICE: This e-mail message, = including any attachments, is for the sole use of the intended recipient(s) and may = contain information that is confidential or proprietary to K&L Microwave, = Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If = you are not the intended recipient, immediately contact the sender by reply = e-mail and destroy all copies of the original message.

------=_NextPart_000_000A_01CA1164.81C0D2E0-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 05:53:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6V8rXr8005613; Fri, 31 Jul 2009 05:53:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDAE219214; Fri, 31 Jul 2009 05:53:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C3EF191E8 for ; Fri, 31 Jul 2009 05:52:58 -0300 (BRT) Received: by ewy26 with SMTP id 26so2312863ewy.5 for ; Fri, 31 Jul 2009 01:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=7LgwfeMWkKD9s79Of6qscyg1p/716mUE63z0Tbi3iF0=; b=pPafhnF++xLX1FcYD4GB4jcOoyC5Veom3LlthRO/qJqC6e+ObsSb2CFx/SvZmTdM7O XxJqoBmx6an/vHiQYbhYmzdQ+WUqKiTzmZQiyu9ngU65Lyh2Uy/i4sF6Ye/zqZpkg+zB zBnuLzIbW5hCqvzWxho/MHWzT3ArTyZLwhn9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=pnsLZvuGaeeqhWxrUfTSKlumiEtIKe4/gmtljAZImC8P5nwtB7FVpT7gIrxkoS1XWy HDNEvunByeAdkKKF8Ka/e4ZcmoGjhkXz/MhDOLMiLrssG47YSZzIF8IRzFs0xqIBAZkB XW8KlmoDeq01CbEECFoAJAGyA5D564ww9oOm8= MIME-Version: 1.0 Received: by 10.216.86.204 with SMTP id w54mr484400wee.54.1249030376131; Fri, 31 Jul 2009 01:52:56 -0700 (PDT) In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> From: Jerome Vuarand Date: Fri, 31 Jul 2009 10:52:36 +0200 Message-ID: <89d273ba0907310152y39314346xe211572406c027fc@mail.gmail.com> Subject: Re: Table cache To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/7/30 Brian Weed : > Well, the tables would not be re-tasked for different object types > (vectors would stay vectors, etc...), and re-setting x, y, z to 0 is > much less expensive then deleting and then allocating a new table. Did you benchmark that ? From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 09:05:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VC5CI7024365; Fri, 31 Jul 2009 09:05:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EBC51929F; Fri, 31 Jul 2009 09:04:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp124.mail.mud.yahoo.com (smtp124.mail.mud.yahoo.com [209.191.84.227]) by bazar2.conectiva.com.br (Postfix) with SMTP id 09C5119298 for ; Fri, 31 Jul 2009 09:04:31 -0300 (BRT) Received: (qmail 18426 invoked from network); 31 Jul 2009 12:04:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=sV3VLaqx/bPWTpuoFOHF0GvZkodULLBk2fOOXrYEUL3qwifltACn6NiNbF1E1e9XiXgsMG1XnAN77BlxQt1RD5RbQJLYzgJAifBevh0wqwZP+/TNROIZRSDZbsVbfBYD7az6U9yh/Vf2MNJJfc16354XNYIcHkhv76ySl57HSdU= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.170.137 with login) by smtp124.mail.mud.yahoo.com with SMTP; 31 Jul 2009 12:04:28 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: VrZQ_UQVM1luYOnLFpVIa9pKdX5sO8zQNLaDgv0kcs97EmlpjzvvzEIpeasyYGvG6J1RBMuyP65uY6cJCnp.JJYWr.fwk2PVCTrPEZ3E56khKmowdKTTzEz.1si1VyxsXIm8I7QI6jJCfbV2.eZQTjpu_6Qlze0.VCPfYRNcDBmCdMtTWKijLtz2JP.4U_FYqbu6vEebLigocCy3wrGnZVfemVLlr2gJCeD.rmUOwIkdZt9VOdh8XOzQkfVulW92BpOAaFQLhXlUbw0BNihQSkz2sWOhwQI0IhDBe_kwiFB96DA245iT.6.zOiNp6qNvgxPvSz_ubQYF2vPsTTgxsRl2HgGR6S_8AG.98cwdFtUCTmj9SS9eqYin.VuRjNY- X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id 0E803815EA; Fri, 31 Jul 2009 13:59:00 +0200 (CEST) Date: Fri, 31 Jul 2009 13:59:00 +0200 From: Martin To: Lua list Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! Message-ID: <20090731115900.GA2673@alfa.qvirt.zxc> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Jul 30, 2009 at 08:45:05PM +0530, Subhash_Patil wrote: > I get all the prints in the Lua_main function. I see all the prints > on the console but not the rectangle. > > Can you help me out in this regard. In your example there is too many errors, including some unrelated to Lua, and you can not really expect it to be functional. As first step I would recommend to add a option (switch) to your compiler let it print warnings on all errors. I use gcc -Wall. Let me first point some errors in C. In your function: > SCSL_Draw_Rect(lua_State*L) > { > GUI_Color_t asvDrawColor = {31, 31, 0}; > > int i,j[3]; > int n = lua_gettop(L); > > for (i = 1; i <= n; i++){ > if (!lua_isnumber(L, i)){ > lua_pushstring(L, "incorrect argument"); > lua_error(L); > } > j[(i-1)] = lua_tonumber(L, i); > > printf("from stack %d\n",j[(i-1)]); > } > ML_GUI_DrawRectangle(j[1], j[2], j[3], &asvDrawColor); > } > SCSL_Draw_Rect has no declared return type, and no return value, so I > guess it defaults to 0 as an int. Assuming that lua_pushcfunction with > a NULL parameter doesn't throw an error, I'd expect lua_call to throw. It very poor practise to not include return value in function definition. It default to int but it is always better to be explicit. I would even recommend to declare it as: LUALIB_API int SCSL_Draw_Rect(lua_State*L) And when you do not end function with return 0; it does not default to returning zero. If return statement is omitted returned value is undefined (it can be anything - including zero). Therefore you must always end function with return statement. You define variable j as array of 3 elements but subsequently you pack in it as many numbers as your Lua function gets arguments (it may be any number of arguments). I guess you want to use 4 argument in this case so you should define j as int j[4] and accept only first 4 argument from Lua stack. If you force buffer overflow you can not expect anything good to happen! Also I guess ML_GUI_DrawRectangle function need 5 arguments, but you are passing it only 4. Maybe you want to write ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); I would write this function something like: LUALIB_API int SCSL_Draw_Rect(lua_State*L) { GUI_Color_t asvDrawColor = {31, 31, 0}; int j[4]; int n = lua_gettop(L); if (n != 4) { luaL_error(L, "wrong number of argument passed (expected 4, got %d)", n); } for (; n; n--) { j[(n-1)] = luaL_checkint(L, n); } ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); return 0; } Now to your Lua_main function > Int Lua_main( void ) > { > int error; > lua_State *L = lua_open(); /* opens Lua */ > luaL_Reg Creg; > > lua_Integer n; > luaL_openlibs(L); > > printf("luaL_openlibs\n"); > lua_pushcfunction(L, SCSL_Draw_Rect(L)); > printf("lua_pushcfunction\n"); > > /* n = 0; > lua_pushinteger(L, n);*/ > n = 100; > lua_pushinteger(L, n); > n = 100; > printf("lua_pushinteger\n"); > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > printf("lua_call\n"); > lua_call( L, 5, 0); > printf("lua_call\n"); > lua_close(L); > > return 0; > } As Duncan Cross and Jerome Vuarand said you should use lua_pushcfunction(L, SCSL_Draw_Rect); and lua_call( L, 4, 0); instead of lua_pushcfunction(L, SCSL_Draw_Rect(L)); and lua_call( L, 5, 0); Since this is for testing only I would personally drop all lua_pushfunction, lua_pushinteger and lua_call and instead write if (luaL_dostring(L, "SCSL_Draw_Rect(100, 100, 300, 300)") { const char *err = luaL_optstring(L, -1, NULL); if (err) { puts(err); lua_pop(L, 1); } } Of course this assume that you have registered SCSL_Draw_Rect as Lua function which can not be seen from your snippet. But there is > luaL_Reg Creg; so I assume you know what it is for and you use it. I do fully agree with Jerome that the code as you passed in here is so bad that symptoms you describe are the only one that shows. > I get all the prints in the Lua_main function. I see all the prints > on the console but not the rectangle. Also it in not clear where you use this function > Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_t *)color*/){ > Gui_color_t color; // I have had coded this for testing LUA; I am not comfortable with tables yet You could look at wiki for many helpful article. Some of them http://lua-users.org/wiki/SimpleLuaApiExample) http://lua-users.org/wiki/BindingCodeToLua http://lua-users.org/wiki/UserDataExample http://lua-users.org/wiki/UserDataWithPointerExample http://lua-users.org/wiki/UserDataEnvironmentExamples http://lua-users.org/wiki/BindingWithMembersAndMethods You should really activate all warning with your compiler and try to solve them. Martin From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 10:36:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VDa5fd009680; Fri, 31 Jul 2009 10:36:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C5FE192B5; Fri, 31 Jul 2009 10:35:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from blrmail1.satyam.com (unknown [125.16.201.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A480D19286 for ; Fri, 31 Jul 2009 10:35:18 -0300 (BRT) Received: from blr.satyam.com (blr.satyam.com [172.19.57.132]) by blrmail1.satyam.com (8.13.8/8.13.8) with ESMTP id n6VDRmbH018872; Fri, 31 Jul 2009 18:57:57 +0530 Received: from bsdmsg009.corp.satyam.ad (bsdmsg009.corp.satyam.ad. [172.19.129.232]) by blr.satyam.com (8.13.8/8.13.8) with ESMTP id n6VDZ899005154; Fri, 31 Jul 2009 19:05:08 +0530 Received: from BSDMBX001.corp.satyam.ad ([172.19.129.225]) by bsdmsg009.corp.satyam.ad ([172.19.129.232]) with mapi; Fri, 31 Jul 2009 19:05:06 +0530 From: Subhash_Patil To: "wtxnh-lua@yahoo.com.au" , Jerome Vuarand , Duncan Cross Date: Fri, 31 Jul 2009 19:05:05 +0530 Subject: RE: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Topic: Newbie... trying to bring interactivity in C application using LUA...!! Thread-Index: AcoR1ydGU5t4UeXJRdejAIPtSjUE0gAC0IGg Message-ID: References: <20090731115900.GA2673@alfa.qvirt.zxc> In-Reply-To: <20090731115900.GA2673@alfa.qvirt.zxc> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.1rc1, clamav-milter version 0.94.1rc1 on blr.satyam.com X-Virus-Status: Clean Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6VDa5fd009680 Thanks for the help. I am clear what to do now. I am developing a C application. To bring some interactivity (through my Gui functions which is again in C), I was learning LUA. I was looking for a sample glue code for a C function and how call that glue/ C function from my application. This link is also good for the beginners to start up with. http://www.gamedev.net/reference/articles/article1932.asp Best Regards, Subhash -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Martin Sent: Friday, July 31, 2009 5:29 PM To: Lua list Subject: Re: Newbie... trying to bring interactivity in C application using LUA...!! On Thu, Jul 30, 2009 at 08:45:05PM +0530, Subhash_Patil wrote: > I get all the prints in the Lua_main function. I see all the prints > on the console but not the rectangle. > > Can you help me out in this regard. In your example there is too many errors, including some unrelated to Lua, and you can not really expect it to be functional. As first step I would recommend to add a option (switch) to your compiler let it print warnings on all errors. I use gcc -Wall. Let me first point some errors in C. In your function: > SCSL_Draw_Rect(lua_State*L) > { > GUI_Color_t asvDrawColor = {31, 31, 0}; > > int i,j[3]; > int n = lua_gettop(L); > > for (i = 1; i <= n; i++){ > if (!lua_isnumber(L, i)){ > lua_pushstring(L, "incorrect argument"); > lua_error(L); > } > j[(i-1)] = lua_tonumber(L, i); > > printf("from stack %d\n",j[(i-1)]); > } > ML_GUI_DrawRectangle(j[1], j[2], j[3], &asvDrawColor); > } > SCSL_Draw_Rect has no declared return type, and no return value, so I > guess it defaults to 0 as an int. Assuming that lua_pushcfunction with > a NULL parameter doesn't throw an error, I'd expect lua_call to throw. It very poor practise to not include return value in function definition. It default to int but it is always better to be explicit. I would even recommend to declare it as: LUALIB_API int SCSL_Draw_Rect(lua_State*L) And when you do not end function with return 0; it does not default to returning zero. If return statement is omitted returned value is undefined (it can be anything - including zero). Therefore you must always end function with return statement. You define variable j as array of 3 elements but subsequently you pack in it as many numbers as your Lua function gets arguments (it may be any number of arguments). I guess you want to use 4 argument in this case so you should define j as int j[4] and accept only first 4 argument from Lua stack. If you force buffer overflow you can not expect anything good to happen! Also I guess ML_GUI_DrawRectangle function need 5 arguments, but you are passing it only 4. Maybe you want to write ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); I would write this function something like: LUALIB_API int SCSL_Draw_Rect(lua_State*L) { GUI_Color_t asvDrawColor = {31, 31, 0}; int j[4]; int n = lua_gettop(L); if (n != 4) { luaL_error(L, "wrong number of argument passed (expected 4, got %d)", n); } for (; n; n--) { j[(n-1)] = luaL_checkint(L, n); } ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); return 0; } Now to your Lua_main function > Int Lua_main( void ) > { > int error; > lua_State *L = lua_open(); /* opens Lua */ > luaL_Reg Creg; > > lua_Integer n; > luaL_openlibs(L); > > printf("luaL_openlibs\n"); > lua_pushcfunction(L, SCSL_Draw_Rect(L)); > printf("lua_pushcfunction\n"); > > /* n = 0; > lua_pushinteger(L, n);*/ > n = 100; > lua_pushinteger(L, n); > n = 100; > printf("lua_pushinteger\n"); > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > n = 300; > lua_pushinteger(L, n); > printf("lua_call\n"); > lua_call( L, 5, 0); > printf("lua_call\n"); > lua_close(L); > > return 0; > } As Duncan Cross and Jerome Vuarand said you should use lua_pushcfunction(L, SCSL_Draw_Rect); and lua_call( L, 4, 0); instead of lua_pushcfunction(L, SCSL_Draw_Rect(L)); and lua_call( L, 5, 0); Since this is for testing only I would personally drop all lua_pushfunction, lua_pushinteger and lua_call and instead write if (luaL_dostring(L, "SCSL_Draw_Rect(100, 100, 300, 300)") { const char *err = luaL_optstring(L, -1, NULL); if (err) { puts(err); lua_pop(L, 1); } } Of course this assume that you have registered SCSL_Draw_Rect as Lua function which can not be seen from your snippet. But there is > luaL_Reg Creg; so I assume you know what it is for and you use it. I do fully agree with Jerome that the code as you passed in here is so bad that symptoms you describe are the only one that shows. > I get all the prints in the Lua_main function. I see all the prints > on the console but not the rectangle. Also it in not clear where you use this function > Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_t *)color*/){ > Gui_color_t color; // I have had coded this for testing LUA; I am not comfortable with tables yet You could look at wiki for many helpful article. Some of them http://lua-users.org/wiki/SimpleLuaApiExample) http://lua-users.org/wiki/BindingCodeToLua http://lua-users.org/wiki/UserDataExample http://lua-users.org/wiki/UserDataWithPointerExample http://lua-users.org/wiki/UserDataEnvironmentExamples http://lua-users.org/wiki/BindingWithMembersAndMethods You should really activate all warning with your compiler and try to solve them. Martin DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 11:56:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VEutbZ028278; Fri, 31 Jul 2009 11:56:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 211D8192A2; Fri, 31 Jul 2009 11:56:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.f9e.com (webmail.f9e.com [207.170.252.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC9D419178 for ; Fri, 31 Jul 2009 11:56:18 -0300 (BRT) Received: from npbmail01.F9.internal ([10.8.0.25]) by webmail.f9e.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 31 Jul 2009 07:56:10 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Table cache Date: Fri, 31 Jul 2009 07:56:08 -0700 Message-ID: <586133FEA1374B4CBD88BE56C0D0DE300754BD65@npbmail01.f9.internal> In-Reply-To: <89d273ba0907310152y39314346xe211572406c027fc@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Table cache Thread-Index: AcoRvFUu2nLGToCVTQuIR47YA43ZKAALw6CQ References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> <89d273ba0907310152y39314346xe211572406c027fc@mail.gmail.com> From: "Brian Weed" To: "Lua list" X-OriginalArrivalTime: 31 Jul 2009 14:56:10.0995 (UTC) FILETIME=[0AD33430:01CA11EF] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6VEutbZ028278 >> Did you benchmark that ? Yes. After facing the same problem on another project 3 weeks ago (same game engine), I changed the game code to re-use a global vector object, instead of recreating them as local temporary objects. This was a huge boost to performance. The purpose of this thread was to find a way for me to implement that optimization automatically, because the amount of code affected on this project is much greater. Consider the following example which may be called hundreds of times per frame: function sprite.foo(self) local v = vector(1, 2, 3) self.position:AddVector(v) end vector() is function that returns a table (that has methods, a metatable, etc...) self.position is also a vector. Creating many temp objects like this is the cause of our performance problems (according to the profiler). Now obviously that function could be re-written to be much less expensive, but unfortunately, that's just one example of hundreds of places across 156k lines of Lua code. Perhaps my biggest problem is our memory manager not handling thousands of small allocations speedily. Brian -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand Sent: Friday, July 31, 2009 4:53 AM To: Lua list Subject: Re: Table cache 2009/7/30 Brian Weed : > Well, the tables would not be re-tasked for different object types > (vectors would stay vectors, etc...), and re-setting x, y, z to 0 is > much less expensive then deleting and then allocating a new table. Did you benchmark that ? From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 14:48:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VHlxVU028753; Fri, 31 Jul 2009 14:48:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B55C19104; Fri, 31 Jul 2009 14:47:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailgw.klmicrowave.com (mailgw.klmicrowave.com [64.45.143.245]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F77E190B4 for ; Fri, 31 Jul 2009 14:47:19 -0300 (BRT) X-AuditID: ac100205-00000e2000000608-a1-4a732e197b4d Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by mailgw.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 31 Jul 2009 13:47:05 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Fri, 31 Jul 2009 13:47:05 -0400 From: "King, Mike" To: Lua list Date: Fri, 31 Jul 2009 13:47:03 -0400 Subject: RE: luacom: why no Release()? Thread-Topic: luacom: why no Release()? Thread-Index: AcoQuiW/j34yZPC6Sau0Dss/lNDd0gBTJhIg Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB174FED1@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB1704C62@KLMExch.klmicrowave.com> <85861A744C29EA46BFD9BB61889AE59D3CB1704FDD@KLMExch.klmicrowave.com> <20090729230445.A4802@lua.tecgraf.puc-rio.br> In-Reply-To: <20090729230445.A4802@lua.tecgraf.puc-rio.br> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n6VHlxVU028753 >> Does the garbage collector run when the process terminates? > The garbage collector runs when the Lua state is closed. The standard Lua > interpreter closes its Lua state before exiting. The garbage collector does > not run if the process terminates abnormaly or via an explicit call to os.exit. I ended up using IUP. When the form closes, the GC occurs. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 14:51:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VHp5bC029934; Fri, 31 Jul 2009 14:51:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB7FA19292; Fri, 31 Jul 2009 14:50:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D99B1926D for ; Fri, 31 Jul 2009 14:50:30 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 15346C82CF for ; Fri, 31 Jul 2009 20:50:27 +0300 (EEST) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A00D7211D89; Fri, 31 Jul 2009 20:50:27 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 994C92BD45 for ; Fri, 31 Jul 2009 20:50:23 +0300 (EEST) Message-Id: <9AB384B1-FC58-41ED-8B5F-30E55331F0C7@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Newbie... trying to bring interactivity in C application using Lua...!! Date: Fri, 31 Jul 2009 20:50:24 +0300 References: <20090731115900.GA2673@alfa.qvirt.zxc> X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just maybe, you should look at this: http://lua-gtk.luaforge.net/en/index.html And forget the C side. - asko Subhash_Patil kirjoitti 31.7.2009 kello 16:35: > Thanks for the help. > > I am clear what to do now. > > I am developing a C application. > To bring some interactivity (through my Gui functions which is again > in C), I was learning LUA. > > I was looking for a sample glue code for a C function and how call > that glue/ C function from my application. > > This link is also good for the beginners to start up with. > http://www.gamedev.net/reference/articles/article1932.asp > > Best Regards, > Subhash > > > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br > ] On Behalf Of Martin > Sent: Friday, July 31, 2009 5:29 PM > To: Lua list > Subject: Re: Newbie... trying to bring interactivity in C > application using LUA...!! > > On Thu, Jul 30, 2009 at 08:45:05PM +0530, Subhash_Patil wrote: >> I get all the prints in the Lua_main function. I see all the prints >> on the console but not the rectangle. >> >> Can you help me out in this regard. > > In your example there is too many errors, including some unrelated to > Lua, and you can not really expect it to be functional. > > As first step I would recommend to add a option (switch) to your > compiler let it print warnings on all errors. I use gcc -Wall. > > Let me first point some errors in C. > In your function: > >> SCSL_Draw_Rect(lua_State*L) >> { >> GUI_Color_t asvDrawColor = {31, 31, 0}; >> >> int i,j[3]; >> int n = lua_gettop(L); >> >> for (i = 1; i <= n; i++){ >> if (!lua_isnumber(L, i)){ >> lua_pushstring(L, "incorrect argument"); >> lua_error(L); >> } >> j[(i-1)] = lua_tonumber(L, i); >> >> printf("from stack %d\n",j[(i-1)]); >> } >> ML_GUI_DrawRectangle(j[1], j[2], j[3], &asvDrawColor); >> } > >> SCSL_Draw_Rect has no declared return type, and no return value, so I >> guess it defaults to 0 as an int. Assuming that lua_pushcfunction >> with >> a NULL parameter doesn't throw an error, I'd expect lua_call to >> throw. > > It very poor practise to not include return value in function > definition. It default to int but it is always better to be > explicit. I would even recommend to declare it as: > LUALIB_API int SCSL_Draw_Rect(lua_State*L) > And when you do not end function with > return 0; > it does not default to returning zero. If return statement is omitted > returned value is undefined (it can be anything - including zero). > Therefore you must always end function with return statement. > > You define variable j as array of 3 elements but subsequently you pack > in it as many numbers as your Lua function gets arguments (it may be > any number of arguments). I guess you want to use 4 argument in this > case so you should define j as > int j[4] > and accept only first 4 argument from Lua stack. If you force > buffer overflow you can not expect anything good to happen! > > Also I guess ML_GUI_DrawRectangle function need 5 arguments, but > you are passing it only 4. Maybe you want to write > ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); > > I would write this function something like: > > LUALIB_API int SCSL_Draw_Rect(lua_State*L) > { > GUI_Color_t asvDrawColor = {31, 31, 0}; > > int j[4]; > int n = lua_gettop(L); > if (n != 4) { > luaL_error(L, "wrong number of argument passed > (expected 4, got %d)", n); > } > for (; n; n--) { > j[(n-1)] = luaL_checkint(L, n); > } > ML_GUI_DrawRectangle(j[0], j[1], j[2], j[3], &asvDrawColor); > return 0; > } > > Now to your Lua_main function > >> Int Lua_main( void ) >> { >> int error; >> lua_State *L = lua_open(); /* opens Lua */ >> luaL_Reg Creg; >> >> lua_Integer n; >> luaL_openlibs(L); >> >> printf("luaL_openlibs\n"); >> lua_pushcfunction(L, SCSL_Draw_Rect(L)); >> printf("lua_pushcfunction\n"); >> >> /* n = 0; >> lua_pushinteger(L, n);*/ >> n = 100; >> lua_pushinteger(L, n); >> n = 100; >> printf("lua_pushinteger\n"); >> lua_pushinteger(L, n); >> n = 300; >> lua_pushinteger(L, n); >> n = 300; >> lua_pushinteger(L, n); >> printf("lua_call\n"); >> lua_call( L, 5, 0); >> printf("lua_call\n"); >> lua_close(L); >> >> return 0; >> } > > As Duncan Cross and Jerome Vuarand said you should use > lua_pushcfunction(L, SCSL_Draw_Rect); > and > lua_call( L, 4, 0); > instead of > lua_pushcfunction(L, SCSL_Draw_Rect(L)); > and > lua_call( L, 5, 0); > > Since this is for testing only I would personally drop all > lua_pushfunction, lua_pushinteger and lua_call and instead write > > if (luaL_dostring(L, "SCSL_Draw_Rect(100, 100, 300, 300)") { > const char *err = luaL_optstring(L, -1, NULL); > if (err) { > puts(err); > lua_pop(L, 1); > } > } > Of course this assume that you have registered SCSL_Draw_Rect as Lua > function which can not be seen from your snippet. But there is >> luaL_Reg Creg; > so I assume you know what it is for and you use it. > > I do fully agree with Jerome that the code as you passed in here is so > bad that symptoms you describe are the only one that shows. >> I get all the prints in the Lua_main function. I see all the prints >> on the console but not the rectangle. > > Also it in not clear where you use this function >> Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_t *)color*/){ >> Gui_color_t color; // I have had coded this for testing LUA; I am >> not comfortable with tables yet > > You could look at wiki for many helpful article. Some of them > http://lua-users.org/wiki/SimpleLuaApiExample) > http://lua-users.org/wiki/BindingCodeToLua > http://lua-users.org/wiki/UserDataExample > http://lua-users.org/wiki/UserDataWithPointerExample > http://lua-users.org/wiki/UserDataEnvironmentExamples > http://lua-users.org/wiki/BindingWithMembersAndMethods > > You should really activate all warning with your compiler and try to > solve them. > > Martin > > > DISCLAIMER: > This email (including any attachments) is intended for the sole use > of the intended recipient/s and may contain material that is > CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance > by others or copying or distribution or forwarding of any or all of > the contents in this message is STRICTLY PROHIBITED. If you are not > the intended recipient, please contact the sender by email and > delete all copies; your cooperation in this regard is appreciated. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 15:08:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VI8piS001278; Fri, 31 Jul 2009 15:08:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0441A192AD; Fri, 31 Jul 2009 15:08:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f179.google.com (mail-px0-f179.google.com [209.85.216.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E9C11912F for ; Fri, 31 Jul 2009 15:08:19 -0300 (BRT) Received: by pxi9 with SMTP id 9so281380pxi.33 for ; Fri, 31 Jul 2009 11:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:subject :date:mime-version:content-type:x-priority:x-msmail-priority :x-mailer:x-mimeole; bh=hVmcOomUrxLqsPOTd+zV5LqhDc9l4HCWtFALOmStPi0=; b=emFtt0/xXV43oZZ2RTN0ScuiA9WLylI5mTFBJ+qwdObhSwCvwPse6wpcRkAXhU4ADS KiaRuIOkTyKlIQl/gvW3AaVQfjwQAvMNdH0/EntPthvNkdeI4OPnncZpVi/69cBngymY I0km9ReTHsSkGXZkLtshiqI+cOWW2KNNonBpI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:mime-version:content-type :x-priority:x-msmail-priority:x-mailer:x-mimeole; b=WKuh6I3jT0fidk9W0nZhTlfcsMgkvs3K7dYIWVCE5iv41Z9C+42Z7EO9EsCfvrx7gx ugPCggzCG8bPYLrrJB/kQ24ZNYDAWQFZP4GbL02RZMTTFWV3zd14pHbF7nabgeVwQqpT pOZw5B5XbfyY9/GFCCPHY/Tf6sOi/ECZHx4pU= Received: by 10.140.142.7 with SMTP id p7mr2299415rvd.80.1249063698132; Fri, 31 Jul 2009 11:08:18 -0700 (PDT) Received: from Especiales (host108.201-252-35.telecom.net.ar [201.252.35.108]) by mx.google.com with ESMTPS id g22sm18666180rvb.12.2009.07.31.11.08.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 11:08:16 -0700 (PDT) Message-ID: <001c01ca1209$9bd147f0$3601a8c0@semat.local> From: "Daniel Barbier" To: Subject: Bluetooth and LUA Date: Fri, 31 Jul 2009 15:06:17 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0019_01CA11F0.741CD3F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0019_01CA11F0.741CD3F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everyone. I'm starting developing with Plua, palm environment for LUA, and I'm = wondering if there is some code written for Bluetooth handling. My = device is a Centro and would like to build remote control for PC's = mmedia on Linux. Some advice? thanks a lot. BTW, check facebook group PLUA programming :D ------=_NextPart_000_0019_01CA11F0.741CD3F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi everyone.
I'm starting developing with Plua, palm = environment=20 for LUA, and I'm wondering if there is some code written for Bluetooth = handling.=20 My device is a Centro and would like to build remote control for PC's = mmedia on=20 Linux.
Some advice?
thanks a lot.
BTW, check facebook group PLUA = programming=20 :D
------=_NextPart_000_0019_01CA11F0.741CD3F0-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 16:08:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VJ84Ix015283; Fri, 31 Jul 2009 16:08:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F22FD192C8; Fri, 31 Jul 2009 16:07:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A21AD192B3 for ; Fri, 31 Jul 2009 16:07:25 -0300 (BRT) Received: by gxk18 with SMTP id 18so3704356gxk.5 for ; Fri, 31 Jul 2009 12:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=f9NA87c6Y5oZGFu9WydOROsBpJyYoxn+yOHRpbCu7Qo=; b=syFHgdni9RjY80RrIOAbwNrm1e5SOlSmbulqQ5dCnOa0uksfO2sonreXc3iS+71+Cw e/BibHHep8wDII8HjVNwVJWi3FmRNxHpG3XNjo6k+b+TF6gQzMH2e6/NYEubWWFBeKI1 dRIkBkS0JBePbPRExL+ct6C2SgQgbPWX/US50= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=GZoq7zdz3lKeUhKvVpVpVdJ54bwb4vLRSIPehaEbDHQkn2RuWNHy7Lbg7S4hxiD6cA lflISCzL58BFS/n/S3mGVDZ3UhsfGb3OWHc5yDirTmF6pRZuDNZR9KIFmjATICiH03s2 eIjimo0wIQtc7mQBMR0PeWG4oijgfRv1avW0U= MIME-Version: 1.0 Received: by 10.100.5.9 with SMTP id 9mr2765361ane.45.1249067244204; Fri, 31 Jul 2009 12:07:24 -0700 (PDT) In-Reply-To: References: From: "Thomas Harning Jr." Date: Fri, 31 Jul 2009 15:07:04 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Any further work in the finalization patch? I tried rebuilding to see if perhaps it was my environment at the time, but I get the same error: x86_64 http://pastebin.com/m69d835c0 x86 http://pastebin.com/m43f079ac I'll try to dig into this more tonight... -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 16:24:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VJOE8X018552; Fri, 31 Jul 2009 16:24:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFAFE19298; Fri, 31 Jul 2009 16:23:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.211.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDBB118B55 for ; Fri, 31 Jul 2009 16:23:42 -0300 (BRT) Received: by ywh11 with SMTP id 11so2076689ywh.14 for ; Fri, 31 Jul 2009 12:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=BTi5YL7fOMe5VPNA4p37PnWp4tLy+pvESBXcB0WKoz4=; b=tJQ1/SkFyq8X62NmzxAlkX6NqBq6fUCBKDpRCSfmJ22a4uRLARB7D5cg1t7zCkjtXa 4rm8n7EZuxUEj/7V+BKIp5oU0rNyzfWoX1iREcAMTGPG94BvqjxTmDiILMDDJU7lMmya uWa8m8A7XdXk2h8mFTrhfMVVy1MvvzUVxktF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=cK1UablMDv9pUhGWKha0MKNGiyV1bxMRpNDKlrKvJiWw66YeqFdB8OVa0eCjQ1M4ge Ob0sYGTak3e9Nd3Nw0A6t2xW/jTm1ikqvDtrbq63bGW9FPgaFSgCPsZNlq8BpzsANxqL uLmpTKGfSODlruQ4nTKlWsf1rQWEI/FyYGvSg= MIME-Version: 1.0 Received: by 10.100.5.9 with SMTP id 9mr2789267ane.45.1249068221109; Fri, 31 Jul 2009 12:23:41 -0700 (PDT) In-Reply-To: References: From: "Thomas Harning Jr." Date: Fri, 31 Jul 2009 15:23:21 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 31, 2009 at 3:07 PM, Thomas Harning Jr. wrote: > Any further work in the finalization patch? > > I tried rebuilding to see if perhaps it was my environment at the > time, but I get the same error: > > x86_64 > http://pastebin.com/m69d835c0 > x86 > http://pastebin.com/m43f079ac > > I'll try to dig into this more tonight... I've narrowed this down to the GC'ed coroutine. Ah hah! do local g function collect() g = true end local function foo() finally(collect) coroutine.yield() end local co = coroutine.create(foo) coroutine.resume(co) -- force GC co = nil collectgarbage("collect") assert(g, "Not finalized") print"OK" end Works do local g local function foo() finally(function() g = true end) coroutine.yield() end local co = coroutine.create(foo) coroutine.resume(co) -- force GC co = nil collectgarbage("collect") assert(g, "Not finalized") print"OK" end Does not safely work! My guess is that the locally defined function somehow got cleaned up during the coroutine finalization.... then the op got called and it passes due to the fact that the memory hadn't yet been written over. I don't know how valgrind misses it on your system (from way back)... but I can reproducibly cause valgrind errors and 'fix' them. Now to see how in the world to fix this in the patch. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 17:29:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VKTBVT001647; Fri, 31 Jul 2009 17:29:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 594EC18E73; Fri, 31 Jul 2009 17:28:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from n6.bullet.re3.yahoo.com (n6.bullet.re3.yahoo.com [68.142.237.91]) by bazar2.conectiva.com.br (Postfix) with SMTP id 0A2E918CD2 for ; Fri, 31 Jul 2009 17:28:23 -0300 (BRT) Received: from [68.142.230.28] by n6.bullet.re3.yahoo.com with NNFMP; 31 Jul 2009 20:28:19 -0000 Received: from [67.195.9.81] by t1.bullet.re2.yahoo.com with NNFMP; 31 Jul 2009 20:42:30 -0000 Received: from [67.195.9.110] by t1.bullet.mail.gq1.yahoo.com with NNFMP; 31 Jul 2009 20:28:19 -0000 Received: from [127.0.0.1] by omp114.mail.gq1.yahoo.com with NNFMP; 31 Jul 2009 20:28:19 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 562544.64097.bm@omp114.mail.gq1.yahoo.com Received: (qmail 92251 invoked by uid 60001); 31 Jul 2009 20:28:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1249072099; bh=aFfwNjuTSGvQ78eO+giF51tDDsC9umxGH7ar8vaEbFY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=MmH+6A17dYtMD9BMSWQGEpBP4x9Y/cQE+R+oWONyS6jxJ66+UCG6nJ+p6+WcJVw3T0NyzE4HE03ZYibDf8Rc8YdF0ZUXLS4f/12J1gNg0i9gu3p1hgWMUFp1nrkpCoxk/c6za4de9Ju8TQUwsVBgl8qfRnS0wJWAhBLBjwVkqus= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=mqg38ww94Yj8osByti0mKXrg9c1EiqYcYNF1MzBnb8EwtTYpSCyK6m0Pq5FYuLXtue89skZ3DlmB2bdgT/rzZnr4pSyWZSY6KquqdhDWfyQTclLyITxXmsFCQSojT/yk3LTpaqGVar8qfmqxr1aBM+VFTXSzmL8AS54+nrrw/LU=; Message-ID: <348256.92108.qm@web111312.mail.gq1.yahoo.com> X-YMail-OSG: kroxk5AVM1kHK2_PNZcYc15cM0zaRRUk_WB63H.kOAUPO_LdGKz6Hujkpgb2rIF3XWn1vpZ411nsTabpODbpD_2UJ__vuQbar8RN8ufeV.pGnRCNA1h1ujmf9vL5nvhNXD1UkbE148hYp0m0UgLRMwAEFoptO7bZwO39SVb553SGh7E58En4tvzl0UVw_tfMZQms1QNX2MQNzIV8qJiQu9Lis7AB004kZOczBuDXWbpNhBsm_VopJJ581N49eIPQBK78dEhOfNsQ13ISPNMZ.Ahn7JON7z4KtHuGmb0Eg5dpG15gql5is3qbo8q3V7yJzS3hCpc- Received: from [122.172.12.131] by web111312.mail.gq1.yahoo.com via HTTP; Fri, 31 Jul 2009 13:28:19 PDT X-Mailer: YahooMailRC/1358.27 YahooMailWebService/0.7.338.2 Date: Fri, 31 Jul 2009 13:28:19 -0700 (PDT) From: Ashok N N Subject: Re: Register Lua callback functions from within Lua to C++ To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-195099791-1249072099=:92108" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0-195099791-1249072099=:92108 Content-Type: text/plain; charset=us-ascii When you want to invoke the callback, how do you get the Lua stack? Do you save the Lua stack pointer when registering the callback? thanks, ashok --0-195099791-1249072099=:92108 Content-Type: text/html; charset=us-ascii
When you want to invoke the callback, how do you get the Lua stack? Do you save the Lua stack pointer when registering the callback?

thanks,
ashok

--0-195099791-1249072099=:92108-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 17:56:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VKudKY006855; Fri, 31 Jul 2009 17:56:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC63F18C89; Fri, 31 Jul 2009 17:55:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-07.bluehost.com (outbound-mail-07.bluehost.com [69.89.17.207]) by bazar2.conectiva.com.br (Postfix) with SMTP id E5B8A18AE7 for ; Fri, 31 Jul 2009 17:55:23 -0300 (BRT) Received: (qmail 31455 invoked by uid 0); 31 Jul 2009 20:55:20 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy1.bluehost.com with SMTP; 31 Jul 2009 20:55:20 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=1xnxZ3XWiM1Y8sYuX0bj0m4RdeKADKGPpOX2DPSk97BuAwy76wApNsCAetnlap9RELXa/8wtDyiM6qEKXWLEchUEf+G8C0yWcPNG11i+9RcminiO/J3gUuRiRTBM8SNC; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MWz8K-0005Mi-BW for lua@bazar2.conectiva.com.br; Fri, 31 Jul 2009 14:55:20 -0600 Date: Fri, 31 Jul 2009 16:55:13 -0400 From: TNHarris To: Lua list Subject: Re: [Patch] Finalization of function objects Message-ID: <20090731165513.69e2fab6@egeria.whoopdedo.org> In-Reply-To: References: Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Fri__31_Jul_2009_16_55_13_-0400_qTm2Ehm+OxGqn/ke" X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Multipart_Fri__31_Jul_2009_16_55_13_-0400_qTm2Ehm+OxGqn/ke Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, 31 Jul 2009 15:23:21 -0400 "Thomas Harning Jr." wrote: > I've narrowed this down to the GC'ed coroutine. Ah hah! > > My guess is that the locally defined function somehow got cleaned up > during the coroutine finalization.... then the op got called and it > passes due to the fact that the memory hadn't yet been written over. > > I don't know how valgrind misses it on your system (from way back)... > but I can reproducibly cause valgrind errors and 'fix' them. Now to > see how in the world to fix this in the patch. > I don't believe the original patch was marking the coroutines properly. I redid the GC so finalizers are treated similarly to userdata __gc methods, the coroutine doesn't get collected until a second finalize pass is done. [lua514-finalizers0609.patch] At the same time I simplified how finalizers are stored, and also improves the speed. A call with finally is as fast as pcall and 43% slower than using neither. With the previous patch, finally was 8% slower than pcall and 59% slower than a regular call. That said, I'm not even sure if this patch is needed, as I also put together a rough framework of finalizers in pure lua. [final.lua] -- tom telliamed@whoopdedo.org --Multipart_Fri__31_Jul_2009_16_55_13_-0400_qTm2Ehm+OxGqn/ke Content-Type: text/x-diff; name=lua514-finalizers0609.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=lua514-finalizers0609.patch diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lapi.c lua.mod/src/lapi.c --- lua.orig/src/lapi.c 2008-07-04 14:41:18.000000000 -0400 +++ lua.mod/src/lapi.c 2009-05-30 15:47:13.396958400 -0400 @@ -1085,3 +1085,64 @@ return name; } + + +/* +** finalization functions +*/ + + +LUA_API int lua_getfinalframe (lua_State *L) { + int base = L->fin_stack ? L->fin_top - L->fin_stack + 1 : 1; + return base; +} + + +LUA_API int lua_finally (lua_State *L, int nargs, int scope, int when) { + int base; + StkId fin,o; + TValue key; + lua_lock(L); + api_checknelems(L, nargs + 1); + api_check(L, scope <= 0 && L->base_ci <= scope + L->ci); + fin = L->top - (nargs+1); + if (!ttisfunction(fin)) { + setsvalue(L, &key, luaS_new(L, "close")); + luaV_gettable(L, fin, &key, L->top); + if (!ttisfunction(L->top)) { + setobj2s(L, L->top, luaT_gettmbyobj(L, fin, TM_GC)); + if (!ttisfunction(L->top)) { + base = L->fin_stack ? L->fin_top - L->fin_stack + 1 : 1; + L->top = fin; + lua_unlock(L); + return base; + } + } + api_incr_top(L); + o = fin; + for (o = L->top; o>fin; o--) setobjs2s(L, o, o-1); + setobjs2s(L, fin, L->top); + nargs++; + } + base = luaD_finally(L, fin, scope, when); + lua_unlock(L); + return base; +} + + +LUA_API void lua_finalize (lua_State *L, int base, int failure) { + StkId fin; + lua_lock(L); + if (base == 0) { + if (NULL == (fin = L->ci->fin_base)) { + lua_unlock(L); + return; + } + } + else + fin = L->fin_stack + base - 1; + api_check(L, L->fin_stack <= fin && fin <= L->fin_top); + luaD_finalize(L, fin, failure); + lua_unlock(L); +} + diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lbaselib.c lua.mod/src/lbaselib.c --- lua.orig/src/lbaselib.c 2008-02-14 11:46:22.000000000 -0500 +++ lua.mod/src/lbaselib.c 2009-05-30 15:59:47.561393600 -0400 @@ -393,6 +393,32 @@ } +static int luaB_finally (lua_State *L) { + int base; + int when = LUA_FINALWAYS; + int nargs = lua_gettop(L) - 1; + if (nargs >= 0) { + if (lua_isboolean(L, 1)) { + nargs--; + luaL_checkany(L, 2); + when = lua_toboolean(L, 1) ? LUA_FINSUCCESS : LUA_FINERROR; + } + base = lua_finally(L, nargs, -1, when); + } + else + base = lua_getfinalframe(L); + lua_pushinteger(L, base); + return 1; +} + + +static int luaB_finalize (lua_State *L) { + int base = luaL_optint(L, 1, 0); + lua_finalize(L, base, !lua_isnoneornil(L, 2)); + return 0; +} + + static int luaB_tostring (lua_State *L) { luaL_checkany(L, 1); if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ @@ -469,6 +495,8 @@ {"type", luaB_type}, {"unpack", luaB_unpack}, {"xpcall", luaB_xpcall}, + {"finally", luaB_finally}, + {"finalize", luaB_finalize}, {NULL, NULL} }; diff -urN -x '*.exe' -x '*.lua' lua.orig/src/ldo.c lua.mod/src/ldo.c --- lua.orig/src/ldo.c 2008-01-18 17:31:22.000000000 -0500 +++ lua.mod/src/ldo.c 2009-05-30 19:54:16.100960000 -0400 @@ -83,6 +83,8 @@ L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); + L->allowhook = 0; + if (L->fin_top) luaD_finalize(L, L->fin_top, 1); L->nCcalls = L->baseCcalls; L->allowhook = 1; restore_stack_limit(L); @@ -293,6 +295,7 @@ L->savedpc = p->code; /* starting point */ ci->tailcalls = 0; ci->nresults = nresults; + ci->fin_base = NULL; for (st = L->top; st < ci->top; st++) setnilvalue(st); L->top = ci->top; @@ -313,6 +316,7 @@ ci->top = L->top + LUA_MINSTACK; lua_assert(ci->top <= L->stack_last); ci->nresults = nresults; + ci->fin_base = NULL; if (L->hookmask & LUA_MASKCALL) luaD_callhook(L, LUA_HOOKCALL, -1); lua_unlock(L); @@ -345,6 +349,11 @@ CallInfo *ci; if (L->hookmask & LUA_MASKRET) firstResult = callrethooks(L, firstResult); + if (L->ci->fin_base) { + ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ + luaD_finalize(L, L->ci->fin_base, 0); + firstResult = restorestack(L, fr); + } ci = L->ci--; res = ci->func; /* res == final position of 1st result */ wanted = ci->nresults; @@ -360,6 +369,94 @@ } +void luaD_reallocFIN (lua_State *L, int newsize) { + CallInfo *ci; + TValue *oldfin = L->fin_stack; + luaM_reallocvector(L, L->fin_stack, L->fin_size, newsize, TValue); + L->fin_size = newsize; + L->fin_top = (L->fin_top - oldfin) + L->fin_stack; + for (ci = L->base_ci; ci <= L->ci; ci++) + if (ci->fin_base) ci->fin_base = (ci->fin_base - oldfin) + L->fin_stack; +} + + +void luaD_growfinstack (lua_State *L, int n) { + if (n <= L->fin_size) /* double size is enough? */ + luaD_reallocFIN(L, 2*L->fin_size); + else + luaD_reallocFIN(L, L->fin_size + (n < BASIC_STACK_SIZE ? BASIC_STACK_SIZE : n)); +} + + +int luaD_finally (lua_State *L, StkId func, int scope, int when) { + StkId o; + TValue *fin; + int ncond = when==LUA_FINALWAYS ? 0 : + when==LUA_FINERROR ? 2*LUAI_MAXCSTACK : + LUAI_MAXCSTACK; /* conditional call */ + int n = L->top - func + 1; + L->fin_top += n; + if (L->fin_top - L->fin_stack >= L->fin_size) { + luaD_growfinstack(L, n); + } + fin = L->fin_top - 1; + setnvalue(fin, cast_num(ncond + --n)); + for (o = func; n-- != 0; o++) { /* push objects to finalization stack */ + setobj2n(L, --fin, o); + luaC_barrier(L, obj2gco(L), o); + } + /* set finalization base of call frame */ + { + CallInfo *ci = L->ci + scope; + lua_assert(L->base_ci <= ci); + if (!ci->fin_base) ci->fin_base = fin; + } + return fin - L->fin_stack + 1; +} + + +void luaD_finalize (lua_State *L, StkId base, int failure) { + TValue *fin; + int nmax = 0; + lua_assert(base && L->fin_stack && L->fin_stack <= base && base <= L->fin_top); + while ((fin = L->fin_top-1) > base) { + StkId o, func; + int call = 1, n; + lua_assert(ttisnumber(fin)); + n = cast_int(nvalue(fin)); + if (n >= LUAI_MAXCSTACK) { /* call on success */ + n -= LUAI_MAXCSTACK; + if (n >= LUAI_MAXCSTACK) { /* call on failure */ + n -= LUAI_MAXCSTACK; + call = failure; + } + else + call = !failure; + } + L->fin_top = fin - n; + lua_assert(L->fin_stack <= L->fin_top); + if (!call) { + fin -= n + 1; + continue; + } + if (n > nmax) { + nmax = n; + luaD_checkstack(L, n + 1); /* with error message */ + } + o = func = L->top; + fin--; + lua_assert(ttisfunction(fin)); + while (n-- != 0) /* pop objects from finalization stack */ + setobj2s(L, o++, fin--); + if (failure) + setobj2s(L, o++, func - 1); /* push error message */ + L->top = o; + luaD_call(L, func, 0); + } + if (L->ci->fin_base >= L->fin_top) L->ci->fin_base = NULL; +} + + /* ** Call a function (C or Lua). The function to be called is at *func. ** The arguments are on the stack, right after the function. @@ -428,6 +525,7 @@ if (status != 0) { /* error? */ L->status = cast_byte(status); /* mark thread as `dead' */ luaD_seterrorobj(L, status, L->top); + if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_top, 1); L->ci->top = L->top; } else { @@ -459,12 +557,15 @@ ptrdiff_t old_ci = saveci(L, L->ci); lu_byte old_allowhooks = L->allowhook; ptrdiff_t old_errfunc = L->errfunc; + ptrdiff_t old_fin = savefin(L, L->fin_top); L->errfunc = ef; status = luaD_rawrunprotected(L, func, u); if (status != 0) { /* an error occurred? */ StkId oldtop = restorestack(L, old_top); + StkId fintop = restorefin(L, old_fin); luaF_close(L, oldtop); /* close eventual pending closures */ luaD_seterrorobj(L, status, oldtop); + if (fintop) luaD_finalize(L, fintop, 1); L->nCcalls = oldnCcalls; L->ci = restoreci(L, old_ci); L->base = L->ci->base; diff -urN -x '*.exe' -x '*.lua' lua.orig/src/ldo.h lua.mod/src/ldo.h --- lua.orig/src/ldo.h 2007-12-27 08:02:25.000000000 -0500 +++ lua.mod/src/ldo.h 2009-05-30 17:08:26.414012800 -0400 @@ -27,6 +27,9 @@ #define saveci(L,p) ((char *)(p) - (char *)L->base_ci) #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) +#define savefin(L,p) ((char *)(p) - (char *)L->fin_stack) +#define restorefin(L,n) ((TValue *)((char *)L->fin_stack + (n))) + /* results from luaD_precall */ #define PCRLUA 0 /* initiated a call to a Lua function */ @@ -47,6 +50,10 @@ LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); LUAI_FUNC void luaD_growstack (lua_State *L, int n); +LUAI_FUNC void luaD_reallocFIN (lua_State *L, int newsize); +LUAI_FUNC void luaD_growfinstack (lua_State *L, int n); +LUAI_FUNC int luaD_finally (lua_State *L, StkId func, int scope, int when); +LUAI_FUNC void luaD_finalize (lua_State *L, StkId base, int failure); LUAI_FUNC void luaD_throw (lua_State *L, int errcode); LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lgc.c lua.mod/src/lgc.c --- lua.orig/src/lgc.c 2007-12-27 08:02:25.000000000 -0500 +++ lua.mod/src/lgc.c 2009-05-30 16:36:09.388707200 -0400 @@ -40,8 +40,8 @@ #define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) -#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) -#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) +#define isfinalized(u) testbit((u)->gch.marked, FINALIZEDBIT) +#define markfinalized(u) l_setbit((u)->gch.marked, FINALIZEDBIT) #define KEYWEAK bitmask(KEYWEAKBIT) @@ -131,15 +131,27 @@ GCObject **p = &g->mainthread->next; GCObject *curr; while ((curr = *p) != NULL) { - if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) + if (!(iswhite(curr) || all) || isfinalized(curr)) p = &curr->gch.next; /* don't bother with them */ - else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { - markfinalized(gco2u(curr)); /* don't need finalization */ - p = &curr->gch.next; - } - else { /* must call its gc method */ - deadmem += sizeudata(gco2u(curr)); - markfinalized(gco2u(curr)); + else { + if (curr->gch.tt == LUA_TTHREAD) { + lua_State *th = gco2th(curr); + if (th->fin_stack == NULL || th->fin_top <= th->fin_stack) { + markfinalized(curr); /* don't need finalization */ + p = &curr->gch.next; + continue; + } + } + else { + if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { + markfinalized(curr); /* don't need finalization */ + p = &curr->gch.next; + continue; + } + /* must call its gc method */ + deadmem += sizeudata(gco2u(curr)); + } + markfinalized(curr); *p = curr->gch.next; /* link `curr' at the end of `tmudata' list */ if (g->tmudata == NULL) /* list is empty? */ @@ -241,6 +253,7 @@ static void checkstacksizes (lua_State *L, StkId max) { int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ int s_used = cast_int(max - L->stack); /* part of stack in use */ + int fin_used = cast_int(L->fin_top - L->fin_stack); /* size of finalizer stack */ if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ return; /* do not touch the stacks */ if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) @@ -250,6 +263,10 @@ 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ condhardstacktests(luaD_reallocstack(L, s_used)); + if (4*fin_used < L->fin_size && + 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->fin_size) + luaD_reallocFIN(L, L->fin_size/2); /* still big enough... */ + condhardstacktests(luaD_reallocFIN(L, fin_used)); } @@ -257,6 +274,10 @@ StkId o, lim; CallInfo *ci; markvalue(g, gt(l)); + if (l->fin_stack) { + for (o = l->fin_stack; o < l->fin_top; o++) + markvalue(g, o); + } lim = l->top; for (ci = l->base_ci; ci <= l->ci; ci++) { lua_assert(ci->top <= l->stack_last); @@ -302,7 +323,8 @@ black2gray(o); traversestack(g, th); return sizeof(lua_State) + sizeof(TValue) * th->stacksize + - sizeof(CallInfo) * th->size_ci; + sizeof(CallInfo) * th->size_ci + + sizeof(TValue) * th->fin_size; } case LUA_TPROTO: { Proto *p = gco2p(o); @@ -341,7 +363,8 @@ return 0; } return iswhite(gcvalue(o)) || - (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); + (ttisuserdata(o) && (!iskey && isfinalized(obj2gco(o)))) || + (ttisthread(o) && (!iskey && isfinalized(obj2gco(o)))); } @@ -445,28 +468,42 @@ static void GCTM (lua_State *L) { global_State *g = G(L); GCObject *o = g->tmudata->gch.next; /* get first element */ - Udata *udata = rawgco2u(o); - const TValue *tm; /* remove udata from `tmudata' */ if (o == g->tmudata) /* last element? */ g->tmudata = NULL; else - g->tmudata->gch.next = udata->uv.next; - udata->uv.next = g->mainthread->next; /* return it to `root' list */ + g->tmudata->gch.next = o->gch.next; + o->gch.next = g->mainthread->next; /* return it to `root' list */ g->mainthread->next = o; makewhite(g, o); - tm = fasttm(L, udata->uv.metatable, TM_GC); - if (tm != NULL) { - lu_byte oldah = L->allowhook; - lu_mem oldt = g->GCthreshold; - L->allowhook = 0; /* stop debug hooks during GC tag method */ - g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ - setobj2s(L, L->top, tm); - setuvalue(L, L->top+1, udata); - L->top += 2; - luaD_call(L, L->top - 2, 0); - L->allowhook = oldah; /* restore hooks */ - g->GCthreshold = oldt; /* restore threshold */ + if (o->gch.tt == LUA_TTHREAD) { + lua_State *th = gco2th(o); + if (th->fin_stack) { + lu_byte oldah = th->allowhook; + lu_mem oldt = g->GCthreshold; + th->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + luaD_finalize(th, th->fin_stack, 0); + th->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } + } + else { + Udata *udata = rawgco2u(o); + const TValue *tm; + tm = fasttm(L, udata->uv.metatable, TM_GC); + if (tm != NULL) { + lu_byte oldah = L->allowhook; + lu_mem oldt = g->GCthreshold; + L->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + setobj2s(L, L->top, tm); + setuvalue(L, L->top+1, udata); + L->top += 2; + luaD_call(L, L->top - 2, 0); + L->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } } } diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lstate.c lua.mod/src/lstate.c --- lua.orig/src/lstate.c 2008-01-03 10:20:39.000000000 -0500 +++ lua.mod/src/lstate.c 2009-05-30 16:57:46.664097600 -0400 @@ -55,12 +55,14 @@ setnilvalue(L1->top++); /* `function' entry for this `ci' */ L1->base = L1->ci->base = L1->top; L1->ci->top = L1->top + LUA_MINSTACK; + L1->ci->fin_base = NULL; } static void freestack (lua_State *L, lua_State *L1) { luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); luaM_freearray(L, L1->stack, L1->stacksize, TValue); + luaM_freearray(L, L1->fin_stack, L1->fin_size, TValue); } @@ -99,6 +101,9 @@ L->savedpc = NULL; L->errfunc = 0; setnilvalue(gt(L)); + L->fin_stack = NULL; + L->fin_top = NULL; + L->fin_size = 0; } @@ -118,7 +123,11 @@ lua_State *luaE_newthread (lua_State *L) { lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); - luaC_link(L, obj2gco(L1), LUA_TTHREAD); + /*luaC_link(L, obj2gco(L1), LUA_TTHREAD);*/ + L1->marked = luaC_white(G(L)); + L1->tt = LUA_TTHREAD; + L1->next = G(L)->mainthread->next; + G(L)->mainthread->next = obj2gco(L1); preinit_state(L1, G(L)); stack_init(L1, L); /* init stack */ setobj2n(L, gt(L1), gt(L)); /* share table of globals */ @@ -133,6 +142,8 @@ void luaE_freethread (lua_State *L, lua_State *L1) { luaF_close(L1, L1->stack); /* close all upvalues for this thread */ + /*if (L1->fin_stack) luaD_finalize(L1, L1->fin_stack, 0); thread is finalized by GC */ + lua_assert(L1->fin_stack == NULL || L1->fin_top <= L1->fin_stack); lua_assert(L1->openupval == NULL); luai_userstatefree(L1); freestack(L, L1); @@ -200,6 +211,7 @@ L = G(L)->mainthread; /* only the main thread can be closed */ lua_lock(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ + if (L->fin_stack) luaD_finalize(L, L->fin_stack, 0); luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ L->errfunc = 0; /* no error function during GC metamethods */ do { /* repeat until no more errors */ diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lstate.h lua.mod/src/lstate.h --- lua.orig/src/lstate.h 2008-01-03 10:20:39.000000000 -0500 +++ lua.mod/src/lstate.h 2009-05-30 16:50:27.622787200 -0400 @@ -52,6 +52,7 @@ const Instruction *savedpc; int nresults; /* expected number of results from this function */ int tailcalls; /* number of tail calls lost under this entry */ + StkId fin_base; /* start of the finalization stack */ } CallInfo; @@ -124,6 +125,9 @@ GCObject *gclist; struct lua_longjmp *errorJmp; /* current error recover point */ ptrdiff_t errfunc; /* current error handling function (stack index) */ + StkId fin_stack; /* finalization stack */ + StkId fin_top; /* first free slot in the finalization stack */ + int fin_size; /* size of finalization stack */ }; diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lua.h lua.mod/src/lua.h --- lua.orig/src/lua.h 2008-08-06 09:30:12.000000000 -0400 +++ lua.mod/src/lua.h 2009-05-30 16:04:14.465182400 -0400 @@ -244,6 +244,19 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); +/* +** finalization functions +*/ + +#define LUA_FINALWAYS 0 +#define LUA_FINSUCCESS 1 +#define LUA_FINERROR 2 + +LUA_API int lua_getfinalframe (lua_State *L); +LUA_API int lua_finally (lua_State *L, int nargs, int scope, int when); +LUA_API void lua_finalize (lua_State *L, int base, int failure); + + /* ** =============================================================== diff -urN -x '*.exe' -x '*.lua' lua.orig/src/lvm.c lua.mod/src/lvm.c --- lua.orig/src/lvm.c 2007-12-28 10:32:23.000000000 -0500 +++ lua.mod/src/lvm.c 2009-05-30 16:41:32.262977600 -0400 @@ -613,6 +613,7 @@ StkId func = ci->func; StkId pfunc = (ci+1)->func; /* previous function index */ if (L->openupval) luaF_close(L, ci->base); + if (ci->fin_base) luaD_finalize(L, ci->fin_base, 0); L->base = ci->base = ci->func + ((ci+1)->base - pfunc); for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ setobjs2s(L, func+aux, pfunc+aux); --Multipart_Fri__31_Jul_2009_16_55_13_-0400_qTm2Ehm+OxGqn/ke Content-Type: application/octet-stream; name=final.lua Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=final.lua bG9jYWwgZ2V0ZmVudixzZXRmZW52LHNldG1ldGF0YWJsZSA9IGdldGZlbnYsc2V0ZmVudixzZXRt ZXRhdGFibGUKbG9jYWwgcGNhbGwsaXBhaXJzLGFzc2VydCA9IHBjYWxsLGlwYWlycyxhc3NlcnQK bG9jYWwgc2VsZWN0LHVucGFjayxnZXRtZXRhdGFibGUgPSBzZWxlY3QsdW5wYWNrLGdldG1ldGF0 YWJsZQoKbG9jYWwgdGluc2VydCA9IHRhYmxlLmluc2VydApsb2NhbCBmdW5jdGlvbiBjYWxsKGZu LC4uLikgcmV0dXJuIGZuKC4uLikgZW5kCgpsb2NhbCBmdW5jdGlvbiBkb19maW5hbChlLGwsZXJy LHByb3QpCiAgbG9jYWwgY2FsbGVyID0gcHJvdCBhbmQgcGNhbGwgb3IgY2FsbAogIGwgPSBsIG9y IDEKICBmb3IgaT0jZSxsLC0xIGRvCiAgICBsb2NhbCBmID0gZVtpXQogICAgZVtpXSA9IG5pbAog ICAgbG9jYWwgYyA9IGZbMV0KICAgIGlmIG5vdCBlcnIgYW5kIChjPT0wIG9yIGM9PXRydWUpIHRo ZW4KICAgICAgY2FsbGVyKHNlbGVjdCgyLHVucGFjayhmKSkpCiAgICBlbHNlaWYgZXJyIGFuZCAo Yz09MCBvciBjPT1mYWxzZSkgdGhlbgogICAgICBmWyNmKzFdID0gZXJyCiAgICAgIGNhbGxlcihz ZWxlY3QoMix1bnBhY2soZikpKQogICAgZW5kCiAgZW5kCmVuZAoKZnVuY3Rpb24gZmNhbGwoZnVu YywgLi4uKQogIGxvY2FsIGU9e19maW5hbD17fX0KICBsb2NhbCBkPW5ld3Byb3h5KHRydWUpCiAg Z2V0bWV0YXRhYmxlKGQpLl9fZ2MgPSBmdW5jdGlvbigpIGRvX2ZpbmFsKGUuX2ZpbmFsKSBlbmQK ICBlLl9wcm94eT1kCiAgc2V0ZmVudigxLCBlKQogIGxvY2FsIHJlc3VsdCA9IHtwY2FsbChmdW5j LC4uLil9CiAgbG9jYWwgc3VjY2VzcyA9IHJlc3VsdFsxXQogIGxvY2FsIGVycgogIGlmIG5vdCBz dWNjZXNzIHRoZW4gZXJyID0gcmVzdWx0WzJdIGVuZAogIGRvX2ZpbmFsKGUuX2ZpbmFsLCAxLCBl cnIsIHRydWUpCiAgcmV0dXJuIHVucGFjayhyZXN1bHQpCmVuZAoKZnVuY3Rpb24gZmluYWxseShm dW5jLC4uLikKICBsb2NhbCB3aGVuLGFyZ3M9MAogIGxvY2FsIGUKICBmb3IgbD0yLDk5OSBkbwog ICAgZSA9IGdldGZlbnYobCkKICAgIGlmIGUgYW5kIGUuX2ZpbmFsIHRoZW4gYnJlYWsgZW5kCiAg ZW5kCiAgYXNzZXJ0KGUsICJubyBmY2FsbCBvbiBzdGFjayIpCiAgaWYgZnVuYz09dHJ1ZSBvciBm dW5jPT1mYWxzZSB0aGVuCiAgICB3aGVuLGZ1bmMgPSBmdW5jLC4uLgogICAgYXJncyA9IHtzZWxl Y3QoMiwuLi4pfQogIGVsc2UKICAgIGFyZ3MgPSB7Li4ufQogIGVuZAogIGlmIG5vdCBmdW5jIHRo ZW4KICAgIHJldHVybiAjZS5fZmluYWwKICBlbmQKICBpZiB0eXBlKGZ1bmMpfj0nZnVuY3Rpb24n IHRoZW4KICAgIGlmIHR5cGUoZnVuYy5jbG9zZSk9PSdmdW5jdGlvbicgdGhlbgogICAgICB0aW5z ZXJ0KGFyZ3MsMSxmdW5jKQogICAgICBmdW5jID0gZnVuYy5jbG9zZQogICAgZWxzZQogICAgICBs b2NhbCBtdCA9IGdldG1ldGF0YWJsZShmdW5jKQogICAgICBpZiBtdCBhbmQgdHlwZShtdC5fX2dj KT09J2Z1bmN0aW9uJyB0aGVuCiAgICAgICAgdGluc2VydChhcmdzLDEsZnVuYykKICAgICAgICBm dW5jID0gbXQuX19nYwogICAgICBlbHNlCiAgICAgICAgcmV0dXJuICNlLl9maW5hbAogICAgICBl bmQKICAgIGVuZAogIGVuZAogIHRpbnNlcnQoYXJncywxLHdoZW4pCiAgdGluc2VydChhcmdzLDIs ZnVuYykKICBlLl9maW5hbFsjZS5fZmluYWwrMV0gPSBhcmdzCiAgcmV0dXJuICNlLl9maW5hbApl bmQKCmZ1bmN0aW9uIGZpbmFsaXplKGxldmVsLGVycikKICBsb2NhbCBlCiAgZm9yIGw9Miw5OTkg ZG8KICAgIGUgPSBnZXRmZW52KGwpCiAgICBpZiBlIGFuZCBlLl9maW5hbCB0aGVuIGJyZWFrIGVu ZAogIGVuZAogIGFzc2VydChlLCAibm8gZmNhbGwgb24gc3RhY2siKQogIGRvX2ZpbmFsKGUuX2Zp bmFsLCBsZXZlbCwgZXJyKQplbmQK --Multipart_Fri__31_Jul_2009_16_55_13_-0400_qTm2Ehm+OxGqn/ke-- From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 18:27:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VLQvZB011669; Fri, 31 Jul 2009 18:26:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1770E18F8B; Fri, 31 Jul 2009 18:26:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-10.prod.phx3.secureserver.net (p3plsmtpa01-10.prod.phx3.secureserver.net [72.167.82.90]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6F4F518ED1 for ; Fri, 31 Jul 2009 18:26:27 -0300 (BRT) Received: (qmail 24709 invoked from network); 31 Jul 2009 21:26:24 -0000 Received: from unknown (96.240.121.67) by p3plsmtpa01-10.prod.phx3.secureserver.net (72.167.82.90) with ESMTP; 31 Jul 2009 21:26:24 -0000 Message-Id: <24127362-D0CD-458F-88BA-4F6BABAE9E6A@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: <586133FEA1374B4CBD88BE56C0D0DE300754BD65@npbmail01.f9.internal> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Table cache Date: Fri, 31 Jul 2009 14:26:24 -0700 References: <586133FEA1374B4CBD88BE56C0D0DE30074CF844@npbmail01.f9.internal> <89d273ba0907300738l7d6d5b73j762539996fec6a82@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754B88E@npbmail01.f9.internal> <89d273ba0907310152y39314346xe211572406c027fc@mail.gmail.com> <586133FEA1374B4CBD88BE56C0D0DE300754BD65@npbmail01.f9.internal> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I would start by installing a custom allocator into Lua that would serve as a suballocator for common object types. That should make the cost to allocate and free your vector objects cheap. That still leaves the need to construct them -- i.e., set their metatable, etc -- but at least you won't be fighting with your allocator. You could also add new methods such as AddVectorXYZ and change your example to: function sprite.foo( self ) self.position:AddVectorXYZ( 1, 2, 3 ) end I take it that AddVector was already modifying its receiver rather than simply adding two vectors and returning a third. If it doesn't do so, then consider adding versions that do and that return themselves. Then you can write chaining code like the following: self.postion:OffsetByXYZ( -xcenter, -ycenter, - zcenter ):RotateByXYZ( 12, 5, 4 ):OffsetByXYZ( xcenter, ycenter, zcenter ) Mark From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 18:52:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VLpwXK015173; Fri, 31 Jul 2009 18:51:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9064B1902A; Fri, 31 Jul 2009 18:51:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8CBA18EF2 for ; Fri, 31 Jul 2009 18:51:29 -0300 (BRT) Received: by yxe5 with SMTP id 5so444278yxe.33 for ; Fri, 31 Jul 2009 14:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=X9lBQ4Gwb3yMGkGbQsCMLCn2vgaMPzgemqg7nSffick=; b=MdKL+L+xTiMXGrk3QWJSlQlPbNFrqEPGAybxp3xoxYHGcyweHvz1L7CIAfOJ2uVoMp Lq623fUQRHGYrItHWvbj9feFAZlO8EfC4alMiEGMAP+7KiMyY62Xttl4k7WusfDK0ePp TLqn8Cchrps8kZp+Pd/J6Lh2DILVd/E00uE8g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=H9SKayXhYb1j85NaV+ztFfMgZTUJoQ03aaM1FjYYK+cawSceBRPCYrVgkzvyUVuAJa wbh6kILS16z2bCjDGwq8jPLV/HDFHvevn+MHNNHuYv+gs96Ede6gChbstJ/8qadA0r7Q Fov8X38J8vBpW6GPhU62rWT9SSiUWcoIumnds= MIME-Version: 1.0 Received: by 10.100.127.17 with SMTP id z17mr4083875anc.153.1249077088102; Fri, 31 Jul 2009 14:51:28 -0700 (PDT) In-Reply-To: <20090731165513.69e2fab6@egeria.whoopdedo.org> References: <20090731165513.69e2fab6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Fri, 31 Jul 2009 17:51:08 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 31, 2009 at 4:55 PM, TNHarris wrote: > I don't believe the original patch was marking the coroutines > properly. I redid the GC so finalizers are treated similarly to userdata > __gc methods, the coroutine doesn't get collected until a second > finalize pass is done. > [lua514-finalizers0609.patch] Awesome, the patch passes successfully. An enhancement I'll probably make to this sometime soon is to see what is necessary to make it non-throwing so I can use lua_finally in a case like: struct resource *x = get_resource(); lua_pushlightuserdata(L, x); lua_pushclosure(L, cleanup_x, 1); lua_finally(L, 1, 0, LUA_FINALWAYS); .. though... lua_pushclosure may throw as well, couldn't it :-/ I suppose I could push the closure first with one empty slot, get the resource, then populate that slot, then hook lua_finally in... Any thoughts on this use case? > At the same time I simplified how finalizers are stored, and also > improves the speed. A call with finally is as fast as pcall and 43% > slower than using neither. With the previous patch, finally was 8% > slower than pcall and 59% slower than a regular call. > > That said, I'm not even sure if this patch is needed, as I also put > together a rough framework of finalizers in pure lua. > [final.lua] While a lua-based finalizer's scheme is quite a useful item. You can't as easily throw a finalizer into 'C' ... My guess is you do 'fcall(function,....)' to define a scope and finally/finalize much like the C-based version. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 20:37:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n6VNbKcG029671; Fri, 31 Jul 2009 20:37:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36B5B18E7A; Fri, 31 Jul 2009 20:36:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89B6318AF1 for ; Fri, 31 Jul 2009 20:36:48 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MX1eS-0000pk-3h for ; Sat, 01 Aug 2009 00:36:40 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MX1eZ-0007d5-6g for lua@bazar2.conectiva.com.br; Sat, 01 Aug 2009 00:36:47 +0100 Date: Sat, 1 Aug 2009 00:36:46 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Bluetooth and LUA Message-ID: <20090801003646.0da79644@trite.i.flarn.net.i.flarn.net> In-Reply-To: <001c01ca1209$9bd147f0$3601a8c0@semat.local> References: <001c01ca1209$9bd147f0$3601a8c0@semat.local> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 31 Jul 2009 15:06:17 -0300 "Daniel Barbier" wrote: > Hi everyone. > I'm starting developing with Plua, palm environment for LUA, and I'm > wondering if there is some code written for Bluetooth handling. My > device is a Centro and would like to build remote control for PC's > mmedia on Linux. Some advice? thanks a lot. BTW, check facebook group > PLUA programming :D Firstly, Lua is not an acronym. Secondly, if Plua does not provide an API for Bluetooth, I suspect you're stuffed. (PalmOS, the last time I looked, did not support dynamic libraries.) B. From lua-bounces@bazar2.conectiva.com.br Fri Jul 31 23:10:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n712AEcs011549; Fri, 31 Jul 2009 23:10:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F29918F94; Fri, 31 Jul 2009 23:09:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F26818D75 for ; Fri, 31 Jul 2009 23:09:35 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so1244036ana.26 for ; Fri, 31 Jul 2009 19:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=woMuXiJnQe2GvWQRJJJSncGiIFsUf8nMfVHm2DsS1sI=; b=W1xMRiJsqBZJIkSfmU6WyTv2ydrINLh+cTobSDeIA46jarPZDOMpypYlZFuA8EpvRD F9+SMkaYkeTPr5RiKb6ROw86ZiYBTearPWAHl2LFhKqnkyTqFyueNJQQTnWYO7MRw9/i rYS/FQpdsmPc+ECZZe+tYSWTSfHJ5OULpM5tw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=JjEgn0ypcASwwH0pnsRulK9nC6BGnOHU3D0g97VpymWtlrQPni8fhistfQjEHoSXyB jHxKZCqjXPZwbXSe2xAIORbISFpTrguhSsdujYEwfWn2aLP03wh/CGl1IAIQZX3iSFvE OkkGGvmvZ8UthFrKUQ9X4+7btM5Wvvxy4HICs= MIME-Version: 1.0 Received: by 10.100.248.4 with SMTP id v4mr4397817anh.57.1249092573086; Fri, 31 Jul 2009 19:09:33 -0700 (PDT) In-Reply-To: References: <20090731165513.69e2fab6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Fri, 31 Jul 2009 22:09:13 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 31, 2009 at 5:51 PM, Thomas Harning Jr. wrote: > On Fri, Jul 31, 2009 at 4:55 PM, TNHarris wrote: >> I don't believe the original patch was marking the coroutines >> properly. I redid the GC so finalizers are treated similarly to userdata >> __gc methods, the coroutine doesn't get collected until a second >> finalize pass is done. >> [lua514-finalizers0609.patch] > Awesome, the patch passes successfully. Ran through the test and things don't quick look right. I'll have to write up some more detailed test cases. Here's the diff in the output of the original and your finalizer patch: --- out 2009-07-31 22:04:30.000000000 -0400 +++ out2 2009-07-31 22:04:38.000000000 -0400 @@ -15,8 +15,8 @@ -- Transaction OK -- Coroutine -F test.lua:113: on failure -Z test.lua:113: on failure OK -- GC'ed coroutine +T +Z OK Basically, it looks like the on-error-condition patch is not getting called in the co-routine case. I don't recall what was required to get that working... Also.. it looks like it's printing the success case rather than the failure case. I'll see if I can figure out what is going on... will need to first digest how your patch does the condition tracking. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Sat Aug 1 01:53:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n714rVsC026074; Sat, 1 Aug 2009 01:53:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C226018D03; Sat, 1 Aug 2009 01:53:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B37E518CCC for ; Sat, 1 Aug 2009 01:52:59 -0300 (BRT) Received: by ewy26 with SMTP id 26so2928274ewy.5 for ; Fri, 31 Jul 2009 21:52:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.104.8 with SMTP id b8mr1893378ebc.7.1249102377089; Fri, 31 Jul 2009 21:52:57 -0700 (PDT) In-Reply-To: References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Sat, 1 Aug 2009 00:52:57 -0400 X-Google-Sender-Auth: ba68e13464f894e7 Message-ID: Subject: Re: is it possible to make longjmp-free Lua? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Jul 29, 2009 at 5:34 AM, Juris Kalnins wrote: > May I ask how big was your speedup? > I just tried microbenchmark with lua_cpcall and the following: > .... and got 0.15 vs 0.22 seconds on 1000000 calls on core2, and 40 vs 47 > seconds on mips. I was expecting something more spectacular... About 1.3x (Linux/gcc3.4) to 6x (Cygwin/gcc3.4) speedup over lua_cpcall depending on the compiler. See below. ===== /* improved equivalent of lua_cpcall */ /* warning: assumes function pointers fit inside regular lightuserdata */ #include #include #include #include #include const int N = 10000000; int cpcallproxy(lua_State * L) { lua_CFunction f = (lua_CFunction)lua_touserdata(L, 1); lua_remove(L, 1); return f(L); } int myluacpcall(lua_State * L, lua_CFunction func, int nargs, int nresults, int errfunc) { lua_pushvalue(L, 1); /* cpcallproxy */ lua_insert(L, -nargs-1); lua_pushlightuserdata(L, (void*)func); lua_insert(L, -nargs-1); return lua_pcall(L, nargs+1, nresults, errfunc); } static int myluapushstringhelper(lua_State * L) { lua_pushstring(L, (const char*)lua_touserdata(L, 1)); return 1; } int myluapushstring(lua_State * L, const char * s) { lua_pushlightuserdata(L, (char*)s); return myluacpcall(L, myluapushstringhelper, 1,1,0); } int test(lua_State * L) { return 0; } int test2(lua_State * L) { //luaL_error(L, "failed"); lua_pushnumber(L, lua_tonumber(L, 1) + strlen(lua_tostring(L,2))); return 1; } static int init_helper(lua_State * L) { lua_pushcfunction(L, cpcallproxy); return lua_error(L); } int init(lua_State * L) { int ret = lua_cpcall(L, init_helper, NULL); if (ret == LUA_ERRRUN) ret = 0; return ret; } void tests(lua_State * L) { int i; clock_t start, diff; // test: lua_cpcall start = clock(); for(i=0; i Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n71CeltE032289; Sat, 1 Aug 2009 09:40:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7184A19024; Sat, 1 Aug 2009 09:40:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62DD918F02 for ; Sat, 1 Aug 2009 09:40:13 -0300 (BRT) Received: by ywh26 with SMTP id 26so3125624ywh.5 for ; Sat, 01 Aug 2009 05:40:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.46.10 with SMTP id t10mr5051459ant.116.1249130412136; Sat, 01 Aug 2009 05:40:12 -0700 (PDT) In-Reply-To: <20090731165513.69e2fab6@egeria.whoopdedo.org> References: <20090731165513.69e2fab6@egeria.whoopdedo.org> Date: Sat, 1 Aug 2009 08:40:12 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects From: John Belmonte To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Jul 31, 2009 at 4:55 PM, TNHarris wrote: > That said, I'm not even sure if this patch is needed, as I also put > together a rough framework of finalizers in pure lua. > [final.lua] I'm quite interested in what you have there, but gave up trying to deduce the meaning of your severely abbreviated variable names. Even undocumented code can be readily understood given good naming. --John From lua-bounces@bazar2.conectiva.com.br Sat Aug 1 18:19:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n71LIu25008541; Sat, 1 Aug 2009 18:18:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C72B918B7A; Sat, 1 Aug 2009 18:18:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp148.mail.mud.yahoo.com (smtp148.mail.mud.yahoo.com [209.191.106.59]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1186618B39 for ; Sat, 1 Aug 2009 18:18:07 -0300 (BRT) Received: (qmail 21990 invoked from network); 1 Aug 2009 21:18:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent; b=DRZR2l7gD7tRrWuLbhKYjMAbGtWW6AfRDX9VIfR8xtuF4oDEFjg0b3WlJah9/OhNYyVubIPrYQOAQSPfJlRv5McMEZmlrwuoYolkHtJIzeSTqmtPT4JhSOh7tRII/vCynYjOjg6gQuVtqmh87hQd0bOCsTrAbBGGHImQlDbdvIU= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.168.140 with login) by smtp148.mail.mud.yahoo.com with SMTP; 1 Aug 2009 21:18:03 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: espEQSoVM1mUvBdbc5EzGU6giSJz0F0cEGV2.ZZm75sk6ZT4MRbeuSE51IcT.yUHbhlV0AzuvJmvjEqv52Uu6PQPNytWB0imsxvvO4nXkHs36vwyOXVZpgSPVbxfVxsztoxKaegTJwzoQlOACBtLFp5nnTnCUNvBXv6grWInNPKwfTXAVk1YKiz7NARH64oIA7meacgHnrEMhFFUI20hdyvVIB0gZoRlN1IB3VkDvTQ6DPyACSXsYrwJ09urAzuUsS4ixsz800XSmsFAI7chSS_7yphlv4z5gKgZXxizMMoTrTIttfl4qOhErOUp3EuZRXKSJqbp9O7KdQ-- X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id BF735815E6; Sat, 1 Aug 2009 22:56:07 +0200 (CEST) Date: Sat, 1 Aug 2009 22:56:07 +0200 From: Martin To: Lua list Subject: What am I doing wrong? Message-ID: <20090801205606.GA2671@alfa.qvirt.zxc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am creating lua binding for my library. And it works fine. But when I run a test under valgrind memory error detector some errors pop up. As I was trying to narrow it down where is error I came to this artificial minimal example that shows same symptoms -- mylib.c #include "lua.h" #include "lauxlib.h" #include "lualib.h" #include static int l_sin(lua_State *L) { double d = luaL_checknumber(L, 1); lua_pushnumber(L, sin(d)); return 1; } static const luaL_reg mylib_f [] = { {"mysin", l_sin}, {0, 0} }; LUALIB_API int luaopen_mylib(lua_State *L) { luaL_register(L, "mylib", mylib_f); return 0; } I am compiling this file with gcc -shared -o mylib.so mylib.c -I/usr/include/lua5.1 Then I have small test program -- test.lua require('mylib') local mysin = mylib.mysin print("mysin(1) =", mysin(1)) print("math.sin(1) =", math.sin(1)) It runs ok like this: $ lua test.lua mysin(1) = 0.8414709848079 math.sin(1) = 0.8414709848079 But when I run it under valgrind it shows some errors. There are no memory leaks but some invalid memory access. Can somebody confirm that this is not happening only to me? Should I be worried about this? And what I need to do to fix it? Martin $ valgrind lua test.lua ==7008== Memcheck, a memory error detector. ==7008== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==7008== Using LibVEX rev 1658, a library for dynamic binary translation. ==7008== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==7008== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. ==7008== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==7008== For more details, rerun with: -v ==7008== ==7008== Invalid read of size 4 ==7008== at 0x4010CB8: (within /lib/ld-2.3.6.so) ==7008== by 0x4006704: (within /lib/ld-2.3.6.so) ==7008== by 0x418C36F: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== Address 0x420C8A0 is 24 bytes inside a block of size 27 alloc'd ==7008== at 0x401C38B: malloc (vg_replace_malloc.c:149) ==7008== by 0x401C415: realloc (vg_replace_malloc.c:306) ==7008== by 0x80510A2: (within /usr/bin/lua5.1) ==7008== by 0x8054A95: (within /usr/bin/lua5.1) ==7008== by 0x804C55A: lua_pushlstring (in /usr/bin/lua5.1) ==7008== by 0x805876B: (within /usr/bin/lua5.1) ==7008== by 0x8058CA0: luaL_pushresult (in /usr/bin/lua5.1) ==7008== by 0x80590C2: luaL_gsub (in /usr/bin/lua5.1) ==7008== by 0x8065010: (within /usr/bin/lua5.1) ==7008== by 0x80653E8: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Invalid read of size 4 ==7008== at 0x4010E00: (within /lib/ld-2.3.6.so) ==7008== by 0x4006704: (within /lib/ld-2.3.6.so) ==7008== by 0x418C36F: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== Address 0x420C8A0 is 24 bytes inside a block of size 27 alloc'd ==7008== at 0x401C38B: malloc (vg_replace_malloc.c:149) ==7008== by 0x401C415: realloc (vg_replace_malloc.c:306) ==7008== by 0x80510A2: (within /usr/bin/lua5.1) ==7008== by 0x8054A95: (within /usr/bin/lua5.1) ==7008== by 0x804C55A: lua_pushlstring (in /usr/bin/lua5.1) ==7008== by 0x805876B: (within /usr/bin/lua5.1) ==7008== by 0x8058CA0: luaL_pushresult (in /usr/bin/lua5.1) ==7008== by 0x80590C2: luaL_gsub (in /usr/bin/lua5.1) ==7008== by 0x8065010: (within /usr/bin/lua5.1) ==7008== by 0x80653E8: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Invalid read of size 4 ==7008== at 0x4010E00: (within /lib/ld-2.3.6.so) ==7008== by 0x4004B78: (within /lib/ld-2.3.6.so) ==7008== by 0x4006792: (within /lib/ld-2.3.6.so) ==7008== by 0x418C36F: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== Address 0x420C8A0 is 24 bytes inside a block of size 27 alloc'd ==7008== at 0x401C38B: malloc (vg_replace_malloc.c:149) ==7008== by 0x401C415: realloc (vg_replace_malloc.c:306) ==7008== by 0x80510A2: (within /usr/bin/lua5.1) ==7008== by 0x8054A95: (within /usr/bin/lua5.1) ==7008== by 0x804C55A: lua_pushlstring (in /usr/bin/lua5.1) ==7008== by 0x805876B: (within /usr/bin/lua5.1) ==7008== by 0x8058CA0: luaL_pushresult (in /usr/bin/lua5.1) ==7008== by 0x80590C2: luaL_gsub (in /usr/bin/lua5.1) ==7008== by 0x8065010: (within /usr/bin/lua5.1) ==7008== by 0x80653E8: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x4010C8D: (within /lib/ld-2.3.6.so) ==7008== by 0x4004B78: (within /lib/ld-2.3.6.so) ==7008== by 0x4006792: (within /lib/ld-2.3.6.so) ==7008== by 0x418C36F: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x40089F2: (within /lib/ld-2.3.6.so) ==7008== by 0x418C7C4: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x4008E57: (within /lib/ld-2.3.6.so) ==7008== by 0x418C7C4: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x4008C58: (within /lib/ld-2.3.6.so) ==7008== by 0x418C7C4: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x4008ED5: (within /lib/ld-2.3.6.so) ==7008== by 0x418C7C4: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) ==7008== ==7008== Conditional jump or move depends on uninitialised value(s) ==7008== at 0x4008B2E: (within /lib/ld-2.3.6.so) ==7008== by 0x418C7C4: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x418BDDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==7008== by 0x4058D8D: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x400B44E: (within /lib/ld-2.3.6.so) ==7008== by 0x405942C: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x4058D20: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==7008== by 0x806529C: (within /usr/bin/lua5.1) ==7008== by 0x8065402: (within /usr/bin/lua5.1) ==7008== by 0x804F0FB: (within /usr/bin/lua5.1) ==7008== by 0x804F53F: (within /usr/bin/lua5.1) mysin(1) = 0.8414709848079 math.sin(1) = 0.8414709848079 ==7008== ==7008== ERROR SUMMARY: 10 errors from 9 contexts (suppressed: 19 from 1) ==7008== malloc/free: in use at exit: 0 bytes in 0 blocks. ==7008== malloc/free: 512 allocs, 512 frees, 32,209 bytes allocated. ==7008== For counts of detected errors, rerun with: -v ==7008== All heap blocks were freed -- no leaks are possible. From lua-bounces@bazar2.conectiva.com.br Sat Aug 1 18:25:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n71LPoPj009396; Sat, 1 Aug 2009 18:25:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D49518C2F; Sat, 1 Aug 2009 18:25:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out-02.simnet.is (smtp-out-02.simnet.is [194.105.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6F9F18B72 for ; Sat, 1 Aug 2009 18:25:27 -0300 (BRT) Authentication-Results: smtp-out-02.simnetpro.is; dkim=neutral (message not signed) header.i=none X-SBRS: 2.9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlkDAM9LdErCaehFgWdsb2JhbACaHwEBFiS3C4QYBYFK Received: from consumer-mta-02.simnet.is ([194.105.232.69]) by smtp-out-02.simnetpro.is with ESMTP; 01 Aug 2009 21:25:21 +0000 Subject: Re: What am I doing wrong? From: =?ISO-8859-1?Q?Gabr=EDel?= "A." =?ISO-8859-1?Q?P=E9tursson?= To: Lua list In-Reply-To: <20090801205606.GA2671@alfa.qvirt.zxc> References: <20090801205606.GA2671@alfa.qvirt.zxc> Content-Type: text/plain Date: Sat, 01 Aug 2009 21:25:20 +0000 Message-Id: <1249161920.6312.0.camel@debian.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 2009-08-01 at 22:56 +0200, Martin wrote: > I am creating lua binding for my library. And it works fine. > But when I run a test under valgrind memory error detector > some errors pop up. As I was trying to narrow it down where > is error I came to this artificial minimal example that shows > same symptoms You may wish to compile Lua with debugging symbols (-ggdb3) for valgrind to produce more explaining error messages. From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 06:00:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7290qpD012794; Sun, 2 Aug 2009 06:00:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D94161897E; Sun, 2 Aug 2009 06:00:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.kak-sam.to (unknown [195.88.252.15]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48B8318967 for ; Sun, 2 Aug 2009 06:00:13 -0300 (BRT) Received: from gw (unknown [91.191.180.48]) by mail.kak-sam.to (Postfix) with ESMTP id 2641F57AA for ; Sun, 2 Aug 2009 22:00:08 +1300 (TOT) Received: from amd64.home (amd64.home [192.168.0.222]) by gw (Postfix) with ESMTP id E4F7815248 for ; Sun, 2 Aug 2009 13:00:07 +0400 (MSD) Received: by amd64.home (Postfix, from userid 1000) id CCB141F22A1; Sun, 2 Aug 2009 13:00:07 +0400 (MSD) From: eugeny gladkih To: Lua list Subject: Re: What am I doing wrong? References: <20090801205606.GA2671@alfa.qvirt.zxc> X-Comment-To: Martin Date: Sun, 02 Aug 2009 13:00:07 +0400 In-Reply-To: <20090801205606.GA2671@alfa.qvirt.zxc> (Martin's message of "Sat, 1 Aug 2009 22:56:07 +0200") Message-ID: <87ws5mfv54.fsf@amd64.home> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >>>>> "Martin" == Martin writes: Martin> But when I run it under valgrind it shows some errors. There are no Martin> memory leaks but some invalid memory access. Martin> Can somebody confirm that this is not happening only to me? Should I Martin> be worried about this? And what I need to do to fix it? nothing, that's not your problem. you have too old valgrind and/or shown errors are in glibc. you may just ignore 'em Martin> ==7008== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. -- Yours sincerely, Eugeny. GM of Enterprise Solutions Department Doctor Web, Ltd. http://www.drweb.com, +79119997425 From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 10:39:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n72DcwxN001335; Sun, 2 Aug 2009 10:38:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A469E18BA1; Sun, 2 Aug 2009 10:38:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bitdojo.org (bitdojo.org [200.46.204.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E3EE18A3A for ; Sun, 2 Aug 2009 10:38:25 -0300 (BRT) Received: from localhost (unknown [200.46.208.211]) by bitdojo.org (Postfix) with ESMTP id E8D82E0A2E7 for ; Sun, 2 Aug 2009 13:38:21 +0000 (UTC) Received: from bitdojo.org ([200.46.204.210]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81228-09 for ; Sun, 2 Aug 2009 13:38:13 +0000 (UTC) Received: from Haiku.local (ip70-179-117-193.dc.dc.cox.net [70.179.117.193]) by bitdojo.org (Postfix) with ESMTPA id 7CB7CE09DA0 for ; Sun, 2 Aug 2009 13:38:20 +0000 (UTC) Message-ID: <4A7596CA.5070506@bluedino.net> Date: Sun, 02 Aug 2009 09:38:18 -0400 From: "Matthew M. Burke" User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Bluetooth and LUA References: <001c01ca1209$9bd147f0$3601a8c0@semat.local> <20090801003646.0da79644@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090801003646.0da79644@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > API for Bluetooth, I suspect you're stuffed. (PalmOS, the last time I > looked, did not support dynamic libraries.) > > Actually, PalmOS supports libraries you can load at runtime, but it often tends to be tricky. Plua provides facilities for writing libraries in C that your lua code can load using the loadlib command. I would check the archives of the Yahoo Plua group. I think I remember people discussing making use of bluetooth before, but I'm not sure of the outcome. It may be possible using the PalmOS docs to write a wrapper around the bluetooth functionality, but off the top of my head, I'm wondering if maybe the way Marcio interacts with the event queue might preclude it from working. Matt From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 12:17:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n72FHKjT009293; Sun, 2 Aug 2009 12:17:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E924F1890C; Sun, 2 Aug 2009 12:16:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s2.cableone.net (s2.cableone.net [24.116.0.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29BBB18866 for ; Sun, 2 Aug 2009 12:16:45 -0300 (BRT) Received: from [192.168.0.128] (unverified [24.119.216.81]) by s2.cableone.net (CableOne SMTP Service s2) with ESMTP id 22240074-1872270 for ; Sun, 02 Aug 2009 08:16:38 -0700 Message-Id: From: Irayo To: Lua list In-Reply-To: <87ws5mfv54.fsf@amd64.home> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7C116a) Mime-Version: 1.0 (iPhone Mail 7C116a) Subject: Re: Valgrind (was: What am I doing wrong?) Date: Sun, 2 Aug 2009 10:16:36 -0500 References: <20090801205606.GA2671@alfa.qvirt.zxc> <87ws5mfv54.fsf@amd64.home> X-Vpipe: Scanner said ok (av_avast) X-IP-stats: Incoming Outgoing Last 7, First 253, in=125, out=4, spam=0 Known=true ip=24.119.216.81 X-Originating-IP: 24.119.216.81 X-Abuse-Info: Send abuse complaints to abuse@cableone.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 2, 2009, at 4:00 AM, eugeny gladkih wrote: >>>>>> "Martin" == Martin writes: > > Martin> But when I run it under valgrind it shows some errors. There > are no > Martin> memory leaks but some invalid memory access. > Martin> Can somebody confirm that this is not happening only to me? > Should I > Martin> be worried about this? And what I need to do to fix it? > > nothing, that's not your problem. you have too old valgrind and/or > shown errors are in glibc. you may just ignore 'em > > Martin> ==7008== Using valgrind-3.2.1-Debian, a dynamic binary > instrumentation framework. > This may be mildly off-topic but certainly Valgrind related. I've been debugging my own lib with valgrind and it's very difficult to sift through all of the warnings and errors from the libraries I'm using (OpenGL in particular seems to confuse valgrind). These are useless to me since I can't do anything about them anyway. Is there a switch to make it only show results from my test program and library? From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 12:57:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n72FuxnT012045; Sun, 2 Aug 2009 12:56:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FA8618CE1; Sun, 2 Aug 2009 12:56:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ringworld.transsys.com (ringworld.transsys.com [144.202.0.15]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BAAF18BD6 for ; Sun, 2 Aug 2009 12:56:27 -0300 (BRT) Received: from PM-G5.transsys.com (c-69-141-150-106.hsd1.nj.comcast.net [69.141.150.106]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: louie) by ringworld.transsys.com (Postfix) with ESMTP id 34FE25C4B for ; Sun, 2 Aug 2009 11:56:25 -0400 (EDT) Message-Id: <3BC4F4D7-194C-4BE3-BF79-2D37307143D4@transsys.com> From: Louis Mamakos To: Lua list In-Reply-To: <4A7596CA.5070506@bluedino.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Bluetooth and LUA Date: Sun, 2 Aug 2009 11:56:24 -0400 References: <001c01ca1209$9bd147f0$3601a8c0@semat.local> <20090801003646.0da79644@trite.i.flarn.net.i.flarn.net> <4A7596CA.5070506@bluedino.net> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 2, 2009, at 9:38 AM, Matthew M. Burke wrote: > Rob Kendrick wrote: > >> API for Bluetooth, I suspect you're stuffed. (PalmOS, the last >> time I >> looked, did not support dynamic libraries.) >> >> > Actually, PalmOS supports libraries you can load at runtime, but it > often tends to be tricky. Plua provides facilities for writing > libraries in C that your lua code can load using the loadlib command. > > I would check the archives of the Yahoo Plua group. I think I > remember people discussing making use of bluetooth before, but I'm > not sure of the outcome. It may be possible using the PalmOS docs > to write a wrapper around the bluetooth functionality, but off the > top of my head, I'm wondering if maybe the way Marcio interacts with > the event queue might preclude it from working. > > Matt > > This might not even be necessary, depending on how you want to use Bluetooth. A couple of years ago before switching to an iPhone, I had a Treo 650 with Plua installed. I was able to use Plua's ability to use serial devices to communicate with a small GPS "puck" over a Bluetooth serial profile, if that makes sense. I no longer have access to the code, and it was just on a lark to see if it worked or not. If you look at the Plua documentation, you'll see various ways to use the serial device support to interact with the IRDA, Bluetooth and actual serial hardware. If you're planning to use Bluetooth in some other way, then this doesn't really apply. Perhaps for your remote control application, you can write a small server on the Linux box that listens over a virtual serial port via Bluetooth? Louis Mamakos From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 17:04:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n72K4BCv031999; Sun, 2 Aug 2009 17:04:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89EF118F43; Sun, 2 Aug 2009 17:03:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4979F18C54 for ; Sun, 2 Aug 2009 17:03:34 -0300 (BRT) Received: by ywh26 with SMTP id 26so3827870ywh.5 for ; Sun, 02 Aug 2009 13:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WcASoHIAiK3UhuBq7MzCTYNTWaZOkQFEhuYMi8UMeRI=; b=IXV6lPuYHvS+jcwrahlB5FM2F1PLGrHrZ+t5xGzbL7XFXnqr1zzsNIhZ42yjpuZlFF CjJ+bDdjiHzALVCU42/ae/qdh84n6tapdfejp/gZeIHn/2yYnxY9TPwSNzAL2klggvr7 4qvPLFbXk8EZ0g2DQ2Uc9axeFuVkhnFBy1VVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=K3Yha9fLeClOsj6dq9vSM90nvymd2Kd1GFDAYhwGPKrIDIg/pyb05eUDjEUYqBKrlt xBNQpmSOkHY4GoBjQEiup93kis+RGWz51VaUaIF3l99p4bbUalChGluNm/zbfuHxdRxB 9cR+i22VYLvrBtzRqulAV7C6V/cC2M6JxbN+8= MIME-Version: 1.0 Received: by 10.100.107.8 with SMTP id f8mr6875140anc.149.1249243412407; Sun, 02 Aug 2009 13:03:32 -0700 (PDT) In-Reply-To: References: Date: Sun, 2 Aug 2009 17:03:32 -0300 Message-ID: <9ef5389f0908021303j715f2dbfn54e014603785e92a@mail.gmail.com> Subject: Re: Lua Digest, Vol 165, Issue 9 From: Daniel Barbier To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e6440254d5a81904702e2590 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6440254d5a81904702e2590 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ok, thanks. I will explore Plua stuff a little more. --0016e6440254d5a81904702e2590 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ok, thanks. I will explore Plua stuff a little more.
--0016e6440254d5a81904702e2590-- From lua-bounces@bazar2.conectiva.com.br Sun Aug 2 22:24:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n731OGr0026793; Sun, 2 Aug 2009 22:24:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 210621892B; Sun, 2 Aug 2009 22:23:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from blrmail1.satyam.com (unknown [125.16.201.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C36918D42 for ; Sat, 1 Aug 2009 12:30:28 -0300 (BRT) Received: from blr.satyam.com (blr.satyam.com [172.19.57.132]) by blrmail1.satyam.com (8.13.8/8.13.8) with ESMTP id n71FMnTm006003; Sat, 1 Aug 2009 20:52:58 +0530 Received: from bsdmsg008.corp.satyam.ad (bsdmsg008.corp.satyam.ad. [172.19.129.231]) by blr.satyam.com (8.13.8/8.13.8) with ESMTP id n71FU8sQ025440; Sat, 1 Aug 2009 21:00:08 +0530 Received: from BSDMBX001.corp.satyam.ad ([172.19.129.225]) by bsdmsg008.corp.satyam.ad ([172.19.129.231]) with mapi; Sat, 1 Aug 2009 21:00:08 +0530 From: Subhash_Patil To: Lua list , Jerome Vuarand , Duncan Cross , Luiz Henrique de Figueiredo Date: Sat, 1 Aug 2009 21:00:05 +0530 Subject: Need some help here .. Had agood start...!! Thread-Topic: Need some help here .. Had agood start...!! Thread-Index: AcoRLeco+ViMKVXoQyysWpeRa/qSmQBjP8mQ Message-ID: References: <89d273ba0907300851n56910aebsd3deb8bf298276a3@mail.gmail.com> In-Reply-To: <89d273ba0907300851n56910aebsd3deb8bf298276a3@mail.gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.1rc1, clamav-milter version 0.94.1rc1 on blr.satyam.com X-Virus-Status: Clean X-Mailman-Approved-At: Sun, 02 Aug 2009 22:23:34 -0300 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n731OGr0026793 Dear Sir/Team, Had a good startup. Was able to call some c functions. Now I am looking for loading and executing an external LUA (startup.lua) file. Here if you see the "startup.lua" there are two lines of code. The first one gets executed but nothing for the second function call. But the same function works fine if called directly (not from external "startup.lua" file). The next step is to pass the events from the C function to LUA. TD_BOOLEAN GUI_DrawFillCircle(TD_UINT8 INucHandleIndex, TD_UINT32 INuiX, TD_UINT32 INuiY, TD_UINT32 INuiRadius) { **********Some code here**************** } TD_BOOLEAN GUI_DrawFilledRect(TD_UINT8 INucHandleIndex, TD_UINT32 INuiX, TD_UINT32 INuiY, TD_UINT32 INuiWidth, TD_UINT32 INuiHeight) { **********Some code here**************** } int DrawFill_Circle(lua_State*Lua_VM) { int i,j[5], n; n = lua_gettop(Lua_VM); printf("stack size:%d\n",n ); for (i = 1; i <= n; i++) { if ( ! lua_isnumber(Lua_VM, -1)) { printf("from stack not an integer:%d\n",i ); } else { j[(i-1)] = lua_tonumber(Lua_VM, -1); lua_pop(Lua_VM, 1); printf("from stack %d\n",j[(i-1)]); } if ( lua_isnumber(Lua_VM, n-1)) { printf("from stack n-1 is an integer:%d\n",n-1 ); } }//end for GUI_DrawFillCircle (j[3], j[2] , j[1] , j[0]); return 0; } int Draw_Rect(lua_State*Lua_VM) { int i,j[5], n; n = lua_gettop(Lua_VM); printf("stack size:%d\n",n ); for (i = 1; i <= n; i++) { if ( ! lua_isnumber(Lua_VM, -1)) { printf("from stack not an integer:%d\n",i ); } else { j[(i-1)] = lua_tonumber(Lua_VM, -1); lua_pop(Lua_VM, 1); printf("from stack %d\n",j[(i-1)]); } if ( lua_isnumber(Lua_VM, n-1)) { printf("from stack n-1 is an integer:%d\n",n-1 ); } } GUI_DrawFilledRect(j[4] , j[3] , j[2] , j[1] , j[0] ); return 0; } int Lua_Main( void ){ int error; lua_State *Lua_VM = lua_open(); /* opens Lua */ lua_Integer n; luaL_openlibs(Lua_VM); printf("luaL_openlibs\n"); lua_setglobal(Lua_VM, " DrawRect"); lua_setglobal(Lua_VM, " DrawFill_Circle"); n = lua_gettop(Lua_VM); printf("stack size:%d\n",n ); lua_pushcfunction(Lua_VM, Draw_Rect); lua_pushcfunction(Lua_VM, DrawFill_Circle); n = lua_gettop(Lua_VM); printf("stack size:%d\n",n ); #if LUA_CIRCLE n = 0; lua_pushinteger(Lua_VM, n); n = 300; lua_pushinteger(Lua_VM, n); n = 100; lua_pushinteger(Lua_VM, n); n = 50; lua_pushinteger(Lua_VM, n); lua_call(Lua_VM, 4 , 1); #elif LUA_RECT n = 0; lua_pushinteger(Lua_VM, n); n = 100; lua_pushinteger(Lua_VM, n); n = 100; lua_pushinteger(Lua_VM, n); n = 300; lua_pushinteger(Lua_VM, n); n = 300; lua_pushinteger(Lua_VM, n); lua_call(Lua_VM, 5 , 1); #else luaL_dofile(Lua_VM, "./startup.lua"); #endif /* luaL_loadbuffer(Lua_VM, buff, strlen(buff), "Rectangle"); printf("luaL_loadbuffer\n"); lua_pcall( Lua_VM, 5, 0,0); printf("lua_call\n"); */ lua_close(Lua_VM); return 0; } /************startup.lua************* io.write("Hello File load successful from LUA \n") SCSL_DrawFill_Circle(0,300,100,50) Best Regards, Subhash DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 03:53:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n736r6Av021498; Mon, 3 Aug 2009 03:53:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FA6A18AB4; Mon, 3 Aug 2009 03:52:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B400318846 for ; Mon, 3 Aug 2009 03:52:28 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 7F7A06A34 for ; Mon, 3 Aug 2009 09:52:21 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: is it possible to make longjmp-free Lua? References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Mon, 03 Aug 2009 09:52:22 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 01 Aug 2009 07:52:57 +0300, David Manura wrote: > About 1.3x (Linux/gcc3.4) to 6x (Cygwin/gcc3.4) speedup over > lua_cpcall depending on the compiler. See below. > > [snip] good code [/snip] > > (gcc 3.4/linux) > $ gcc -O2 lt.c -llua -lm > $ ./a.out > --- > lua_cpcall: 2.150000 > lua_pcall: 0.950000 > lua_call: 0.600000 > myluacpcall: 1.600000 > myluacpcall2: 5.420000 > --- Thank you, this is consistent with what I'm getting. I first saw the cygwin timings and thought I've broken GC. But probably it's cygwin's memory allocator that's broken. These are timing I get. GCPAUSE is the default 200, decreasing it slows lua_cpcall much more than the other variants. gcc-4.2 -DN=10000000 -Os --- lua_cpcall: 1.920000 lua_pcall: 0.810000 lua_call: 0.460000 myluacpcall: 1.390000 myluacpcall2: 5.430000 my_cpcall: 1.210000 --- mipsel-linux-uclibc-gcc-4.2 -DN=100000 -Os --- lua_cpcall: 4.820000 lua_pcall: 2.800000 lua_call: 0.330000 myluacpcall: 4.040000 myluacpcall2: 11.720000 my_cpcall: 4.090000 --- Where my_cpcall was changed to match your calling convention, for an apples-to-apples: int my_cpcall(lua_State * L, lua_CFunction func, int nargs, int nresults, int errfunc) { lua_pushvalue(L, cpcallIdx); /* myauxccall, cpcallIdx is C ref returned by lua_refi */ if (nargs) lua_insert(L, -nargs-1); lua_pushlightuserdata(L, (void*)func); return lua_pcall(L, nargs+1, nresults, errfunc); } int myauxccall(lua_State *L) { lua_CFunction f = (lua_CFunction) lua_topointer(L, -1); lua_pop(L, 1); return f(L); } Still, the difference between plain call and p-calls is appalling, especially on the mips. But I think that adding some kind of automatic code generator for wrapping Lua API code in an outline function plus using this protected calling should be good enough solution. Too bad it seems that C++0x lambda functions are not appearing in GCC any time soon, they would be just perfect for this task. Thank you all for the help. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 08:34:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73BYVGe015077; Mon, 3 Aug 2009 08:34:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D251F18B73; Mon, 3 Aug 2009 08:34:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46ACD18A5A for ; Mon, 3 Aug 2009 08:33:57 -0300 (BRT) Received: by fxm25 with SMTP id 25so3441297fxm.5 for ; Mon, 03 Aug 2009 04:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=HPOEQcSN25GTQdLo3SA7M4+lalF+yoFJCt5UX0eeF68=; b=IW4XvdSV8/yIWiKz4tDrD+rRZyoPW2KJqk6fvv/v5U4forqIzT+67WLGHtKA4cZEiH GUgwSYQ4cIWRB9CYW2P04/Ki+dt3enpuCZ2w3TRkWdYuwHkG0/pubo4P4TJLUl5Hqdnj vAZ6xp2wcRn4068+bc6YYscIBTOk6M1I7YrAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=wHI/iyxpNqAK9eiIwPvsN3e5cRCFUWnaT+519HtjMVBxymKywXfL1pnixuxDearay7 u8LR3Y7NrE23jLb5fo4RCAsLmW8VdgQtvsXZRtyIBWrMm25UxcXnPpJjeVfQSkSK8zot Df1xXw0PvpuUfdZ64oefCTWVtm4iqmabg0CEM= MIME-Version: 1.0 Received: by 10.239.157.82 with SMTP id p18mr587547hbc.6.1249299235456; Mon, 03 Aug 2009 04:33:55 -0700 (PDT) Date: Mon, 3 Aug 2009 13:33:55 +0200 Message-ID: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> Subject: [ANN] LuaCSV From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, Recently we were talking about CSV format again, and there was a suggestion that we needed a fast low-level extension [1] Well, [2] is an attempt to supply that extension. It does the quoting rules correctly, as far as I can tell, but does not do the case where multiline records are encoded in double-quotes. That is an exercise for another day. It provides an iterator, which returns the _same table_ each time. So for a little inconvenience in some cases, one gets absolutely minimal hit on Lua memory. The returned table does have a copy() method, however. By default, it looks at the first data line and works out whether they are to convertible to numbers. Thereafter, it keeps a mask of these fields and converts them. This will particuarly help you if you have a lot of numerical data to bring in. (You can always switch it off if it guesses incorrectly) Tested on Debian 32-bit (gcc), and Windows XP (MS compiler). The zip contains a dll for those poor Windows souls without compilers. steve d. 1 http://lua-users.org/lists/lua-l/2000-11/msg00134.html 2 http://mysite.mweb.co.za/residents/sdonovan/lua/luaCSV.zip From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:16:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73CGkgH019344; Mon, 3 Aug 2009 09:16:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7047A18C15; Mon, 3 Aug 2009 09:15:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 147BA18B38 for ; Mon, 3 Aug 2009 09:15:53 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 59EAEDD811 for ; Mon, 3 Aug 2009 15:15:35 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Faster cpcall and ENVIRONINDEX (was Re: is it possible to make longjmp-free Lua) References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Mon, 03 Aug 2009 15:15:39 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 03 Aug 2009 09:52:22 +0300, Juris Kalnins wrote: Lua has a rather obscure feature, C function environment, which in case of lua_cpcall is initialized from the environment of currently active function. If lua_cpcall is changed to look like the code below (which doesn't use function pointer casts and thus is still ANSI C in this regard), it has perfomance comparable to lua_pcall, and is even a little faster than lua_pcall if two lines marked with /**/ are removed. However, LUA_ENVIRONINDEX behaves differently than with the original. The question is how much trouble this difference can cause in practice, i.e. how widely is LUA_ENVIRONINDEX used by existing libraries? ==== the code below ==== LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) { struct CallS c; int status; TValue *o; lua_lock(L); o = index2adr(L, LUA_REFAUXCPC); /* Load address of one per global_State CClosure object, used as a temporary */ setobj2s(L, L->top, o); api_incr_top(L); setpvalue(L->top, ud); /* push only argument */ api_incr_top(L); clvalue(o)->c.f = func; /* Is this good enough approximation of original behaviour? */ /**/ clvalue(o)->c.env = getcurrenv(L); /**/ luaC_objbarrier(L, gcvalue(o), clvalue(o)->c.env); c.func = L->top - 2; /* function to be called */ c.nresults = 0; status = luaD_pcall(L, f_call, &c, savestack(L, c.func), 0); lua_unlock(L); return status; } From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:19:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73CJmnm019714; Mon, 3 Aug 2009 09:19:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B87D18CD2; Mon, 3 Aug 2009 09:19:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout3.netvision.net.il (mxout3.netvision.net.il [194.90.6.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E15F18BA1 for ; Mon, 3 Aug 2009 09:19:17 -0300 (BRT) Received: from [93.173.185.118] by mxout3.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KNS00LZ1W0DI600@mxout3.netvision.net.il> for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 15:29:02 +0300 (IDT) Date: Mon, 03 Aug 2009 15:19:12 +0300 From: Shmuel Zeigerman Subject: Re: [ANN] LuaCSV In-reply-to: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> To: Lua list Message-id: <4A76D5C0.5000601@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: [...] > 2 http://mysite.mweb.co.za/residents/sdonovan/lua/luaCSV.zip > All is good, except the license and version number are missing. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:44:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73ChweI023873; Mon, 3 Aug 2009 09:43:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10B1518CDD; Mon, 3 Aug 2009 09:43:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D500818C55 for ; Mon, 3 Aug 2009 09:43:15 -0300 (BRT) Received: from know-smtpout-1.server.virginmedia.net ([62.254.123.1]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090803124308.TCZK5579.mtaout03-winn.ispmail.ntl.com@know-smtpout-1.server.virginmedia.net> for ; Mon, 3 Aug 2009 13:43:08 +0100 Received: from [78.151.109.204] (helo=taboche) by know-smtpout-1.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1MXwse-0000eE-E8 for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 13:43:08 +0100 From: Thomas Lauer To: Lua list Subject: Re: [ANN] LuaCSV Date: Mon, 03 Aug 2009 13:43:10 +0100 Organization: TL Message-ID: References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> In-Reply-To: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=AjNtXHXTAAAA:8 a=Yf8n6GSCAAAA:8 a=KXWhGMP7Mqmt6Pxkl90A:9 a=T6hZquY6KIw_KrnqvPv2BzXIJi0A:4 a=26cUCVMrHfUA:10 a=MSl-tDqOz04A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73ChweI023873 Hi Steve, I have not yet looked into your code but one question springs to mind immediately: have you done some benchmarks (informal or otherwise), eg with a pure-Lua solution that works with LPEG or some other pattern-matching algorithms? I am confident that a low-level interface would be faster than pure Lua... the question is how much faster? -- cheers thomasl steve donovan wrote: ----original message---- From: steve donovan Date: Mon, 3 Aug 2009 13:33:55 +0200 Subj: [ANN] LuaCSV > Hi all, > > Recently we were talking about CSV format again, and there was a > suggestion that we needed a fast low-level extension [1] > > Well, [2] is an attempt to supply that extension. It does the quoting > rules correctly, as far as I can tell, but does not do the case where > multiline records are encoded in double-quotes. That is an exercise > for another day. > > It provides an iterator, which returns the _same table_ each time. So > for a little inconvenience in some cases, one gets absolutely minimal > hit on Lua memory. The returned table does have a copy() method, > however. > > By default, it looks at the first data line and works out whether they > are to convertible to numbers. Thereafter, it keeps a mask of these > fields and converts them. This will particuarly help you if you have a > lot of numerical data to bring in. (You can always switch it off if > it guesses incorrectly) > > Tested on Debian 32-bit (gcc), and Windows XP (MS compiler). The zip > contains a dll for those poor Windows souls without compilers. > > steve d. > > 1 http://lua-users.org/lists/lua-l/2000-11/msg00134.html > 2 http://mysite.mweb.co.za/residents/sdonovan/lua/luaCSV.zip From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:47:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Cl531024619; Mon, 3 Aug 2009 09:47:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0749818D88; Mon, 3 Aug 2009 09:46:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43DA618CA2 for ; Mon, 3 Aug 2009 09:46:26 -0300 (BRT) Received: by fxm25 with SMTP id 25so3479891fxm.5 for ; Mon, 03 Aug 2009 05:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=snCPDz0lolNn2yfvLjxI5kK4WivFHJb6yEOKPN3olM8=; b=fkYeXLfrEe/lCrl0YsCU9FiLf8iyZcAk94UfFCs3kX1UhFB6IC5vZUcYHuSTJNZiln fDTpYWRbNwp/1zvBeUP28WXhirTsvWbyPwQP52xdScNe9Kxzqgil1Vdl3Upsrejz5kjC 83zVEN+HYYdjjLfqDq2p6yD+JhIn8zZLg5wso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=krdZZ7w0q/r8sk90T+X/StgSmtpUdRC1x6R6FUtOqmEfoI7PEkrRtOHe34BSwVzdDW kXTAHMvJ7KLVmGIy/iZ+nWUJ+jzLOTBWWPwDvpeNi6TeFuoBdXXy/UG8jpL/yI1U89m2 BXpXCLzbIieKKZ+m1oqiDGo51buPjDnAPsR7w= MIME-Version: 1.0 Received: by 10.239.154.16 with SMTP id b16mr594571hbc.50.1249303583742; Mon, 03 Aug 2009 05:46:23 -0700 (PDT) In-Reply-To: References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> Date: Mon, 3 Aug 2009 14:46:23 +0200 Message-ID: <560972290908030546v39634616w1732ffa17949ba26@mail.gmail.com> Subject: Re: [ANN] LuaCSV From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 2:43 PM, Thomas Lauer wrote: > I have not yet looked into your code but one question springs to mind > immediately: have you done some benchmarks (informal or otherwise), eg > with a pure-Lua solution that works with LPEG or some other > pattern-matching algorithms? I am confident that a low-level interface > would be faster than pure Lua... the question is how much faster? Obviously, but if LPEG comes within say 50% percent of the speed, then really one doesn't need a specialized module. I know some people have been using LPEG for this task; I'd like to look that those solutions to give them a test. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:48:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73CmgG7024875; Mon, 3 Aug 2009 09:48:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C080018E78; Mon, 3 Aug 2009 09:48:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4385718E61 for ; Mon, 3 Aug 2009 09:48:09 -0300 (BRT) Received: by fxm25 with SMTP id 25so3480861fxm.5 for ; Mon, 03 Aug 2009 05:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=vojjSQowSH3Khq+kPOi7s2WbD1cCkNNClE1lfRSgGec=; b=Wz5uKw/GXSBcGNN3tnT6+BZM0Z9Bz33BBoch267opD+fPIVEPVWt9S/ScE9QdyFZR2 rqCyDGlJou7FjhByIe6umn43BYtT40puIWOWxdzkHVfFARBOdzjbCeRHtdRb7HHlin1X mIJmb+Hq+SuV8tflFEWW8Iyg60kCr+xeRJoSo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WHo0YyM9NBUebUevJZ9D3Ih5rniEU9WmOl65L7Tnn8FhnlR6jfivZlOEgFnrPeIMyR 7P1n5VU/cqc8Bs0lGi/Se6yRd/NVXm3WdJkqtXpdqQfvfkGpQiVs8t0EawuJ7RZbRmTd pU256ErNDA1+H3aKqA9mQw2TLUhO+OAdKgDbM= MIME-Version: 1.0 Received: by 10.239.141.68 with SMTP id b4mr584323hba.11.1249303687363; Mon, 03 Aug 2009 05:48:07 -0700 (PDT) In-Reply-To: <4A76D5C0.5000601@013net.net> References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> <4A76D5C0.5000601@013net.net> Date: Mon, 3 Aug 2009 14:48:07 +0200 Message-ID: <560972290908030548k38523cafm3ebda791f08b932a@mail.gmail.com> Subject: Re: [ANN] LuaCSV From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 2:19 PM, Shmuel Zeigerman wrote: > steve donovan wrote: > All is good, except the license and version number are missing. I always end up skipping that stuff - it's MIT/X as always. Initial version numbers always feel arbitrary I expect to fix a few bugs then there will be an explicit LICENCE file, currently it's just at the top of the C file steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 09:49:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73CnfGc025105; Mon, 3 Aug 2009 09:49:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2120518EDB; Mon, 3 Aug 2009 09:49:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA5818EA0 for ; Mon, 3 Aug 2009 09:49:10 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Cn8MB025066 for ; Mon, 3 Aug 2009 09:49:08 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n73Cn7s0025064 for lua@bazar2.conectiva.com.br; Mon, 3 Aug 2009 09:49:07 -0300 Date: Mon, 3 Aug 2009 09:49:05 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] LuaCSV Message-ID: <20090803124905.GA24789@duchamp.tecgraf.puc-rio.br> References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > have you done some benchmarks (informal or otherwise), eg with a pure-Lua > solution that works with LPEG or some other pattern-matching algorithms? There's code in PiL: http://www.lua.org/pil/20.4.html From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:09:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73D9uId028940; Mon, 3 Aug 2009 10:09:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56D3B18CCC; Mon, 3 Aug 2009 10:09:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.236]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58CE318BAB for ; Mon, 3 Aug 2009 10:09:23 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so977278rvb.41 for ; Mon, 03 Aug 2009 06:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=X1jf4F50X4lkOOsRnuVeNQxDcAQuzz9A2BYNczDmWxA=; b=MP5o44d0AcoC/Bf1aADYMEdvl/ybD2/Rpv1rxjzzOL4TdI5lOu3bv9u/7aHOrBVZGZ vcWJZM1weQbJ/bqBFp6symK6tgxujmbLJ7U11muOmWvxNPDpOwyYCuiMacsLKAhIRUdw rWoORBjiqtyYQtaokjafcm3BA1FBqvPqtzIBw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=QHvizp0+GQYPN+meRjkJr/1NSBNRcoe8p9YeLdhPR4g3M3v8ykrKUvzBubZdsvUcpW EpN1Ig+SKSMzTSrdmb30LGodUO2HSjj4K7Rlp9Xul5BgqaDqwJuk293hg+rKS2lR6QX0 0EWj9x3vFrsvqEH9SEnoBhG5H5e9A9CPCF/sc= Received: by 10.141.41.3 with SMTP id t3mr3668582rvj.93.1249304961555; Mon, 03 Aug 2009 06:09:21 -0700 (PDT) Received: from ?192.168.0.102? ([75.68.47.100]) by mx.google.com with ESMTPS id g14sm1297850rvb.40.2009.08.03.06.09.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Aug 2009 06:09:20 -0700 (PDT) Message-Id: <6888A891-714D-4045-89C0-E0BF0949CAAE@gmail.com> From: Doug Currie To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Faster cpcall and ENVIRONINDEX (was Re: is it possible to make longjmp-free Lua) Date: Mon, 3 Aug 2009 09:09:17 -0400 References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 3, 2009, at 8:15 AM, Juris Kalnins wrote: > two lines marked with /**/ are removed. However, LUA_ENVIRONINDEX > behaves differently than with the original. > The question is how much trouble this difference can cause in > practice, i.e. how widely is LUA_ENVIRONINDEX used by existing > libraries? My libraries use LUA_ENVIRONINDEX to maintain a Per-Thread Library Context (see Lua Gems, Chapter 1). e From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:15:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73DF4tA029855; Mon, 3 Aug 2009 10:15:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB4C618D43; Mon, 3 Aug 2009 10:14:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA7EE18C5A for ; Mon, 3 Aug 2009 10:14:34 -0300 (BRT) Received: (qmail 30706 invoked by uid 399); 3 Aug 2009 07:14:28 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 3 Aug 2009 07:14:28 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4A76E2B6.6020908@workspacewhiz.com> Date: Mon, 03 Aug 2009 07:14:30 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaCSV References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> <20090803124905.GA24789@duchamp.tecgraf.puc-rio.br> In-Reply-To: <20090803124905.GA24789@duchamp.tecgraf.puc-rio.br> Content-Type: multipart/alternative; boundary="------------060507080602020603010603" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------060507080602020603010603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: Luiz Henrique de Figueiredo Date: 8/3/2009 6:49 AM >> have you done some benchmarks (informal or otherwise), eg with a pure-Lua >> solution that works with LPEG or some other pattern-matching algorithms? >> > There's code in PiL: http://www.lua.org/pil/20.4.html > This is based on some help from the list, PiL, and some techniques on the LPEG recipes page. It does build one "massive" table of the contents of the .csv file, a tremendous difference over Steve's implementation, I believe. -Josh --------------------------------------------------- -- lexers/csv.lua -- -- Given a .csv file, convert it into a Lua table. module(..., package.seeall) local lpeg = require 'lpeg' local C, Cs, Ct, P, S = lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.P, lpeg.S local eol = P'\r\n' + P'\n' local quoted_field = '"' * Cs(((P(1) - '"') + P'""' / '"')^0) * '"' local unquoted_field = C((1 - S',\r\n"')^0) local field = quoted_field + unquoted_field local record = Ct(field * (',' * field)^0) local nonemptyrecord = #P(1 - eol) * record local records = Ct((record * eol)^0 * nonemptyrecord^-1) * -1 local one_line_record = record * (eol + -1) function parse_line(line) assert(type(line) == 'string', 'bad argument #1 (expected string)') return lpeg.match(one_line_record, line) end -- public interface getmetatable(getfenv(1)).__call = function(self, input) assert(type(input) == 'string', 'bad argument #1 (expected string)') return lpeg.match(records, input) end --------------060507080602020603010603 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: Luiz Henrique de Figueiredo
Date: 8/3/2009 6:49 AM
have you done some benchmarks (informal or otherwise), eg with a pure-Lua
solution that works with LPEG or some other pattern-matching algorithms?
    
There's code in PiL: http://www.lua.org/pil/20.4.html 
  
This is based on some help from the list, PiL, and some techniques on the LPEG recipes page.  It does build one "massive" table of the contents of the .csv file, a tremendous difference over Steve's implementation, I believe.

-Josh

---------------------------------------------------
-- lexers/csv.lua
--
-- Given a .csv file, convert it into a Lua table.
module(..., package.seeall)

local lpeg = require 'lpeg'
local C, Cs, Ct, P, S = lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.P, lpeg.S

local eol = P'\r\n' + P'\n'
local quoted_field = '"' * Cs(((P(1) - '"') + P'""' / '"')^0) * '"'
local unquoted_field = C((1 - S',\r\n"')^0)
local field = quoted_field + unquoted_field
local record = Ct(field * (',' * field)^0)
local nonemptyrecord = #P(1 - eol) * record
local records = Ct((record * eol)^0 * nonemptyrecord^-1) * -1
local one_line_record = record * (eol + -1)

function parse_line(line)
   assert(type(line) == 'string', 'bad argument #1 (expected string)')
   return lpeg.match(one_line_record, line)
end

-- public interface
getmetatable(getfenv(1)).__call = function(self, input)
   assert(type(input) == 'string', 'bad argument #1 (expected string)')
   return lpeg.match(records, input)
end

--------------060507080602020603010603-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:18:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73DITEQ030404; Mon, 3 Aug 2009 10:18:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5696B18EA5; Mon, 3 Aug 2009 10:18:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E33C918D9B for ; Mon, 3 Aug 2009 10:18:01 -0300 (BRT) Received: by bwz6 with SMTP id 6so3386018bwz.5 for ; Mon, 03 Aug 2009 06:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1382ybzaKP/7QAStsye8VVH5JUhfZ/4hrtLNkzy1cd0=; b=YdfSJf0bQy3IpDwi6Bvbw8+TO5e2ANYIIKvxTGt/F1GtK/exUOVj6MHwnMvuM7zD/o 5lzuqrw6kr6dE5f+zvU1CT4zh4EgtYwgRtwr7aT6bgkYd/wZdc7tYLFmt+WIAoapt+9N 1FIFGiuo5gr1Wnou5cfvHFfCOwBSWvbIb109I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=f/J6wdtconvMzHCUVNbvYbWwTCxk9LjdlSY53GdLvrX9nNyufkY7Su9gwXXIAYbPH2 2/K/hsc9dWhPp2o+QAb4AhTzxla0/UMJUJ8ecrXv+C2aJfbLosLuqeL8ZyMft1tebRCy Rj4STFeOQbQXfFKxR8whpqDeTIpo4zm72ZgKk= MIME-Version: 1.0 Received: by 10.239.162.70 with SMTP id k6mr572251hbd.109.1249305479223; Mon, 03 Aug 2009 06:17:59 -0700 (PDT) In-Reply-To: References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> Date: Mon, 3 Aug 2009 15:17:59 +0200 Message-ID: <560972290908030617o35688843q88d819d62245e7e2@mail.gmail.com> Subject: Re: [ANN] LuaCSV From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 2:43 PM, Thomas Lauer wrote: > I have not yet looked into your code but one question springs to mind > immediately: have you done some benchmarks (informal or otherwise), eg > with a pure-Lua solution that works with LPEG or some other > pattern-matching algorithms? I am confident that a low-level interface > would be faster than pure Lua... the question is how much faster? The results were rather interesting: I compared against the pure Lua solution given in http://lua-users.org/wiki/CsvUtils. My first result showed them basically taking the same, until I realized that by default I'm doing the floating-point conversion. The target was a 20meg csv file, randomly generated rows of ten numbers. (A) No floating-point conversion: lua: 1.94 csv: 0.63 (B) Floating point conversion: lua: 4.22 csv: 1.80 (This just added up all the numbers) So the conversions are expensive; if you need them, it's cheaper to do them in C. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:28:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73DSSSm000396; Mon, 3 Aug 2009 10:28:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5319618EDF; Mon, 3 Aug 2009 10:28:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2826F18AF1 for ; Mon, 3 Aug 2009 10:27:57 -0300 (BRT) Received: by fxm25 with SMTP id 25so3505496fxm.5 for ; Mon, 03 Aug 2009 06:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=M87wJ7NfBrB0M6g+tq1iFNAkMfYyfxO0Q08A2Xz3eS4=; b=VrUNIJq0h/dPimPIlwKymaeQxtBqiGc21FmvoeQJDUNQSlYi6uAsFjZB/oim5671bm SC73lDopkNAVhdv840yGqOF5TjJxgYXPiKGDpABt3xcNV9RY94iUjECLPMUqqBLY7eo9 FNPbnyePzKiP0Nnsfzndug5ciNg/DuQt8q2B4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=DSZ4yEHjIHMCAHd16vujGZ2fsHestSaE38ADISJ6tGealrZ2M8MgDMjzxZS8CVV7N7 LTwGgkV94VJsx6g2d7p727xGzngnID28123J2vJ/RNWpH+N8A0Fw8iM4HwcDCRO8oDAR 5DH71goqXK1EyazcjFyO0VOjnG/dqOwH0BFS8= MIME-Version: 1.0 Received: by 10.239.166.8 with SMTP id z8mr594913hbd.85.1249306076473; Mon, 03 Aug 2009 06:27:56 -0700 (PDT) In-Reply-To: <4A76E2B6.6020908@workspacewhiz.com> References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> <20090803124905.GA24789@duchamp.tecgraf.puc-rio.br> <4A76E2B6.6020908@workspacewhiz.com> Date: Mon, 3 Aug 2009 15:27:56 +0200 Message-ID: <560972290908030627o16b091c3q28c9c47d15266a6e@mail.gmail.com> Subject: Re: [ANN] LuaCSV From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73DSSSm000396 On Mon, Aug 3, 2009 at 3:14 PM, Joshua Jensen wrote: > This is based on some help from the list, PiL, and some techniques on the > LPEG recipes page.  It does build one "massive" table of the contents of the > .csv file, a tremendous difference over Steve's implementation, I believe. It's a little bit faster, about 10% for the 20meg file. Definitely shows the power of the approach! Interesting to see how these approaches cope with more 'interesting' data. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:44:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73DicVD004311; Mon, 3 Aug 2009 10:44:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB44818F70; Mon, 3 Aug 2009 10:44:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D411218EE3 for ; Mon, 3 Aug 2009 10:43:59 -0300 (BRT) Received: by yxe5 with SMTP id 5so1954466yxe.33 for ; Mon, 03 Aug 2009 06:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=scdme56nkr5Z6uYCWOj5tJlZetJZqKzumhmxyIuuLjM=; b=tGA6dBNET/uU4Y/zIwTVhvl++YHBX/s60uUGthalkQZ4TlojcxrTObG3L8I+KxIyzC DaLMl6UFZ9r5UU6p73I4uryIRxYCbz/35aVFPC6FsAfeacRhNz5/gQCdQDHBFyPS50aL qZ5YuBscLhJT8C+Vs9YWjNcDs1RxVkwBZ3VAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=pYsTmchFDXey5izwyP4HJrboQMHUjKPqDQ4QS0PEIpxIJQt36DegvB4PPxpaGu8cc0 vih+2B8pnGOFqnsrG4tur/YWAwCtfP1XlgDN1xD0irGjSUINiZ+TvKC2pyr7GkuqHmRw ucL6A0QR0flMt0YjWf8xdpCQ9AiE5ONGSTT/g= MIME-Version: 1.0 Received: by 10.100.191.16 with SMTP id o16mr7395600anf.173.1249307036261; Mon, 03 Aug 2009 06:43:56 -0700 (PDT) In-Reply-To: References: <20090731165513.69e2fab6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Mon, 3 Aug 2009 09:43:36 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73DicVD004311 On Fri, Jul 31, 2009 at 10:09 PM, Thomas Harning Jr. wrote: > Basically, it looks like the on-error-condition patch is not getting > called in the co-routine case.  I don't recall what was required to > get that working... > Also.. it looks like it's printing the success case rather than the > failure case.  I'll see if I can figure out what is going on... will > need to first digest how your patch does the condition tracking. Checking through this and writing up a quick test (at: http://pastebin.com/m40f2d12b), I found that if there is an error inside a coroutine, the failure is 'absorbed' and when the coroutine is collected, the success 'finalizers' get executed. Running this test set on the old version yield no errors, besides the valgrind-detect access to freed memory. Hopefully this test can be massaged into a more clean test for correctness of the patch, but for now, it should work effectively to root out incorrect behavior. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 10:49:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73DnPMd005408; Mon, 3 Aug 2009 10:49:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9ABF18EA5; Mon, 3 Aug 2009 10:49:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp140.mail.mud.yahoo.com (smtp140.mail.mud.yahoo.com [209.191.107.123]) by bazar2.conectiva.com.br (Postfix) with SMTP id 2E69018D18 for ; Mon, 3 Aug 2009 10:48:54 -0300 (BRT) Received: (qmail 74726 invoked from network); 3 Aug 2009 13:48:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=dXvijNgo5ZOlBBiW36fRKxSNQGZRfMD62BlKmrC8FW6QZseL6BT6GhEAgnCTsuUAQvakPnTN4dyp7SaCK8Yrj3DaViAdzokz5Tc0JGW7+7RdHiL/U0m94+otjJ2/ddhVeWGjNxD/KXNc2bfR+u/BGOn7h91f8R+3FdEGGMWGYHk= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.170.154 with login) by smtp140.mail.mud.yahoo.com with SMTP; 3 Aug 2009 13:48:51 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: mMGuVyMVM1mfiqit1P05I0OdNdl5kt8ywyN4RYzmhw4VmfgoOXq9EKLC3o4vqA.VbuuHOhkd7p7lLTrtWyNajnIS2wDDuVncRivacWHJ_P9FqBIJXwKxmMppJabAiT6H.2GqzNdawq36YzpAllchmhRgHDTCsFQvDo17mBy2cHMtkF2VV5KidHGnCviMeFusKW2PT0cIh3ADcv3Tl3Ks.Hk6OcjtvNYkh7j1Hv48Yc1si48e.1MJFC0Yj9OjmIFmBJBeP_Jd2kaEtMppHE0k4Iih2DKkWnlYr6Dc.w28zCWCdOVoJrtr X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id 01F6D8157D; Mon, 3 Aug 2009 11:39:07 +0200 (CEST) Date: Mon, 3 Aug 2009 11:39:07 +0200 From: Martin To: Lua list Subject: Re: Need some help here .. Had agood start...!! Message-ID: <20090803093907.GA2687@alfa.qvirt.zxc> References: <89d273ba0907300851n56910aebsd3deb8bf298276a3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Aug 01, 2009 at 09:00:05PM +0530, Subhash_Patil wrote: > int Draw_Rect(lua_State*Lua_VM) > { > int i,j[5], n; > > n = lua_gettop(Lua_VM); > printf("stack size:%d\n",n ); > > for (i = 1; i <= n; i++) > { > if ( ! lua_isnumber(Lua_VM, -1)) > { > printf("from stack not an integer:%d\n",i ); > } > else > { > j[(i-1)] = lua_tonumber(Lua_VM, -1); > lua_pop(Lua_VM, 1); > printf("from stack %d\n",j[(i-1)]); > } > if ( lua_isnumber(Lua_VM, n-1)) > { > printf("from stack n-1 is an integer:%d\n",n-1 ); > } > } > GUI_DrawFilledRect(j[4] , j[3] , j[2] , j[1] , j[0] ); > return 0; > } To investigate depth and content of stack You may use function void stackDump(lua_State *L) as shown in book 'Programming in Lua'. You can change it a little if You want it to be little more verbose. Your handling of stack in Draw_... functions is wrong. For one you do not handle errors. When condition 'if ( ! lua_isnumber(Lua_VM, -1))' is true you need to raise an error (not only print debugging info). Another condition 'if ( lua_isnumber(Lua_VM, n-1))' is referring to constant stack slot and this slot becomes invalid after two lua_pop(Lua_VM, 1) You should ask yourself what happens if Lua script calls Your function with wrong number of argument and take care of this case. I would suggest to use function in shape I posted to You inprevoiuss mail eventually adding some call to stackDump until you have understanding what is happening on the stack. > lua_setglobal(Lua_VM, " DrawRect"); > lua_setglobal(Lua_VM, " DrawFill_Circle"); >From Lua manual reference: void lua_setglobal (lua_State *L, const char *name); Pops a value from the stack and sets it as the new value of global name. This means you need first to push function on the stack and then call lua_setglobal. Do this: lua_pushcfunction(Lua_VM, Draw_Rect); lua_setglobal(Lua_VM, "DrawRect"); lua_pushcfunction(Lua_VM, DrawFill_Circle); lua_setglobal(Lua_VM, "DrawFill_Circle"); > /************startup.lua************* > > io.write("Hello File load successful from LUA \n") > SCSL_DrawFill_Circle(0,300,100,50) You registered function to Lua as " DrawFill_Circle" not as SCSL_DrawFill_Circle.. Also note that you do not want to include space as the first char in function name. Good luck Martin From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 11:41:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Eev7q015360; Mon, 3 Aug 2009 11:40:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36BFB18FB7; Mon, 3 Aug 2009 11:40:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09D5B18E75 for ; Mon, 3 Aug 2009 11:40:09 -0300 (BRT) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090803144006.WZJF6611.mtaout02-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Mon, 3 Aug 2009 15:40:06 +0100 Received: from [78.151.109.204] (helo=taboche) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1MXyhq-0005cf-FO for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 15:40:06 +0100 From: Thomas Lauer To: Lua list Subject: Re: [ANN] LuaCSV Date: Mon, 03 Aug 2009 15:40:07 +0100 Organization: TL Message-ID: <25td75pkvmvpc4j6o4r49p1n56to948c83@thomaslauer.com> References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> <560972290908030617o35688843q88d819d62245e7e2@mail.gmail.com> In-Reply-To: <560972290908030617o35688843q88d819d62245e7e2@mail.gmail.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=8RloEfZUAAAA:8 a=AjNtXHXTAAAA:8 a=rAtpK5JIC8M0ugaJkhIA:9 a=Wx0vXT4ULb3hTaUNA-YA:7 a=TyrYsQJcbbhTLPZOuyolyPtwOr0A:4 a=MSl-tDqOz04A:10 a=O58u2wXj750A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73Eev7q015360 steve donovan wrote: > On Mon, Aug 3, 2009 at 2:43 PM, Thomas Lauer wrote: > > I have not yet looked into your code but one question springs to mind > > immediately: have you done some benchmarks (informal or otherwise), eg > > with a pure-Lua solution that works with LPEG or some other > > pattern-matching algorithms? I am confident that a low-level interface > > would be faster than pure Lua... the question is how much faster? > > The results were rather interesting: > > I compared against the pure Lua solution given in > http://lua-users.org/wiki/CsvUtils. My first result showed them > basically taking the same, until I realized that by default I'm doing > the floating-point conversion. > > The target was a 20meg csv file, randomly generated rows of ten numbers. > > (A) No floating-point conversion: > lua: 1.94 > csv: 0.63 > > (B) Floating point conversion: > lua: 4.22 > csv: 1.80 > > (This just added up all the numbers) > > So the conversions are expensive; if you need them, it's cheaper to do > them in C. Interesting indeed. It seems a carefully optimised LPEG solution is not too far away from the C code. If one needs raw speed then C is obviously the way to go, but this looks very promising. It'll take me some time to have a closer look into this (also experimenting with some other pattern-matching approaches) but if I find something interesting I will report back. -- cheers thomasl From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 11:49:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73EnaI9017046; Mon, 3 Aug 2009 11:49:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AB8018FEB; Mon, 3 Aug 2009 11:49:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E67018D64 for ; Mon, 3 Aug 2009 11:48:57 -0300 (BRT) Received: by ywh26 with SMTP id 26so4282960ywh.5 for ; Mon, 03 Aug 2009 07:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ybeEFNb9QKfonbJIe4zSrCY09WXI2DzkHrfHtFuumys=; b=h56zxaOpFUuXp/gS+VmUj7bfXXlSKvKLdCyIQHR3StIUY7CYpsxErfAe8j57N31UGb oERrHd+R/lZIFa5VmLl5oaFdC/+DevX9jJeTuvva97kKr8ySCDP/s7Z4V1OsWcC9ipms ab08ryyn9w9BlXoFLUtk4nDS6c7FsQJwq/lik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jVaXfpJHPbOFbFiYoK0EwmOtiUvonpYhFj8r24DZhSyxufIFwbNau9RK3nSPtAbUKc w9Ho0EeaQ62ZBuxkT6m7YMTdc4l4mmVyey2uz2wPM1poL2rk1njqes6d3Cucnks6CD4b +uMB4O64l8h7kcbbJc+nqks5/tF156UTkDwb0= MIME-Version: 1.0 Received: by 10.100.191.16 with SMTP id o16mr7492486anf.173.1249310932540; Mon, 03 Aug 2009 07:48:52 -0700 (PDT) In-Reply-To: References: <20090731165513.69e2fab6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Mon, 3 Aug 2009 10:48:32 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 9:43 AM, Thomas Harning Jr. wrote: > Checking through this and writing up a quick test (at: > http://pastebin.com/m40f2d12b), > I found that if there is an error inside a coroutine, the failure is > 'absorbed' and when the coroutine is collected, the success > 'finalizers' get executed. > > Running this test set on the old version yield no errors, besides the > valgrind-detect access to freed memory. > > Hopefully this test can be massaged into a more clean test for > correctness of the patch, but for now, it should work effectively to > root out incorrect behavior. In comparing how the different patches work to see if I could fix the coroutine glitch by myself, I found that some of the cleanup code is performed in different order... particularly WRT baseline code. Comparing from 'original' finalizer patch (Nodir) to the newer one provided by TNHarris... I'm not sure which is 'correct' or not, especially ones that alter the Lua internal stack/etc. diff --git a/src/ldo.c b/src/ldo.c index 883873c..db52477 100644 --- a/src/ldo.c +++ b/src/ldo.c @@ -515,8 +525,8 @@ LUA_API int lua_resume (lua_State *L, int nargs) { if (status != 0) { /* error? */ L->status = cast_byte(status); /* mark thread as `dead' */ luaD_seterrorobj(L, status, L->top); + if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_top, 1); L->ci->top = L->top; - if (L->fin_top != 0) luaD_finalize(L, 1, 1); } else { @@ -543,24 +553,25 @@ LUA_API int lua_yield (lua_State *L, int nresults) { int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef) { int status; - int fin_top = L->fin_top; unsigned short oldnCcalls = L->nCcalls; ptrdiff_t old_ci = saveci(L, L->ci); lu_byte old_allowhooks = L->allowhook; ptrdiff_t old_errfunc = L->errfunc; + ptrdiff_t old_fin = savefin(L, L->fin_top); L->errfunc = ef; status = luaD_rawrunprotected(L, func, u); if (status != 0) { /* an error occurred? */ StkId oldtop = restorestack(L, old_top); + StkId fintop = restorefin(L, old_fin); luaF_close(L, oldtop); /* close eventual pending closures */ luaD_seterrorobj(L, status, oldtop); + if (fintop) luaD_finalize(L, fintop, 1); L->nCcalls = oldnCcalls; L->ci = restoreci(L, old_ci); L->base = L->ci->base; L->savedpc = L->ci->savedpc; L->allowhook = old_allowhooks; restore_stack_limit(L); - if (L->fin_top > fin_top) luaD_finalize(L, fin_top + 1, 1); } L->errfunc = old_errfunc; return status; -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 12:04:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73F4RQV020045; Mon, 3 Aug 2009 12:04:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE3E119018; Mon, 3 Aug 2009 12:03:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C41BC190B4 for ; Mon, 3 Aug 2009 12:03:51 -0300 (BRT) Received: by bwz6 with SMTP id 6so3456384bwz.5 for ; Mon, 03 Aug 2009 08:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=lfxfY7ejUoGYCtlDad39r0K9DUUKGkaLckp07dzafiE=; b=EJ2nIlV2ET3POFOtVebBN2rh8oI3t+w9KLBNrlSxMvCOVJ1uijOiR395gYmglsSks3 zW8uNXn1aSLWVEAIlYHUfZU3Yj3g2dNM9iFAMFwjygMVrlJbBm+MdFI50oQPoYUJO1Ia cFVsypNMOyZA4lPNCRIedIXevPuUrQdRHK5SY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=dZ1/LEpj6gRYrefubU6xiAe8AGXqtvq4twAw1Dv0qBtXxdJkuO4KBdntzMFFTrdsuO z1FJCkx48LLC21HcNRictlaDDGKCxEbh/V15X7g8mLWB2b1KVe2ZkRbWON3OLcssdLfR KXntUW+CFiXDXJCf1Q/q5Ifs/YPrTUuTEJZVU= MIME-Version: 1.0 Received: by 10.204.101.13 with SMTP id a13mr5546263bko.89.1249311828811; Mon, 03 Aug 2009 08:03:48 -0700 (PDT) From: Geoffroy Carrier Date: Mon, 3 Aug 2009 17:03:28 +0200 Message-ID: Subject: A factory in lunar To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! I'm trying to use lunar with my C++ code... I'd like to expose a factory to Lua. In short, my problem is something like (see the comment): class MyClassFactoryWrapperForLua { MyClassFactory * factory; int Create(lua_State * L) { char * param = luaL_checkstring(L, 1); //// // How can I push on the stack // an object using MyClassWrapperForLua // generated through factory->NewObject(param); //// } } class MyClassWrapperForLua { MyClass * object; [...] } Any idea? -- Geoffroy Carrier From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 12:08:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73F7QNs020608; Mon, 3 Aug 2009 12:07:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 345EF19107; Mon, 3 Aug 2009 12:07:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22CC619027 for ; Mon, 3 Aug 2009 12:06:55 -0300 (BRT) Received: by wa-out-1112.google.com with SMTP id v27so511394wah.5 for ; Mon, 03 Aug 2009 08:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=b7F4k8TS+f8SJXfMcXEd4Kit4ZZkkSp/ErGhP+ghIVA=; b=beWMUvPAga0HXGnuq9cT0htlFMRTOeszke8xoBT4MeABRFuepemzFCMQbKVipSyaU5 SKFSS7icB9Lau84woGGs8L9+X+jO7P0gKz9aF5nged/vOhgPnpcVikfrXs4E+GPJwEW+ ffgDYFTU2wj3nUzxD7PpQe2HNDk+JHL0vXF4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bwlNXbvUjoLonxHCYFfTa7j8CpLLW+IFAugwJLeM+eC0PBl+DM5TZkozYzTeHDhSMg 3AWwDGBFink885Yy/lRiPu5/bCpbx7mITZ+8/KX6FQQ56YbcNpSG2xwITpX4hq2uZBDo aIM+WgMuzZrF+1CDkINUUO5pTituBE8vgMXEo= MIME-Version: 1.0 Received: by 10.115.108.18 with SMTP id k18mr9310078wam.228.1249312013135; Mon, 03 Aug 2009 08:06:53 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Aug 2009 12:06:53 -0300 Message-ID: <9ef5389f0908030806t385c4f3bvceb29b5834e5254@mail.gmail.com> Subject: Re: Lua Digest, Vol 166, Issue 1 From: Daniel Barbier To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016364c597fc1b10804703e1ed8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364c597fc1b10804703e1ed8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks a lot Louis Mamakos. that a good start. -- Daniel B. www.fragancialluvia.blogspot.com --0016364c597fc1b10804703e1ed8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks a lot Louis Mamakos. that a good start.
--
Daniel B.
www.fragancialluvia.blogspot.com

--0016364c597fc1b10804703e1ed8-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 12:38:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Fc7UU025775; Mon, 3 Aug 2009 12:38:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E76BE190B4; Mon, 3 Aug 2009 12:37:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from www55.your-server.de (www55.your-server.de [213.133.104.55]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4DE318FF3 for ; Mon, 3 Aug 2009 12:37:22 -0300 (BRT) Received: from [24.68.159.14] (helo=mir.internal.wonderlanding.no-ip.org) by www55.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MXzbC-0003qx-EP for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 17:37:18 +0200 Date: Mon, 3 Aug 2009 08:36:51 -0700 From: Tobias Kieslich To: Lua list Subject: Re: [ANN] LuaCSV Message-ID: <20090803153651.GA4095@mir.internal.wonderlanding.no-ip.org> References: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290908030433v3658317ya111cc9623ec1c22@mail.gmail.com> Priority: normal User-Agent: Mutt/1.5.20 (2009-06-14) X-Authenticated-Sender: tobias@justdreams.de X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Clear (ClamAV 0.95.1/9648/Mon Aug 3 15:27:08 2009) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi, thanks for trying. I have to head to work now so I have to look into it later. It's a week too late for me as I was parsing big files in Lua the other week. I found that eventually it was best for me to write it in Lua and the bigger bottlenek was to parse the big files into big strings. So I came up with a file iterator that returns only one row at a time, even for multiline. Note, that the code below uses \ for escaping as I was parsing MySQL based CSV files. It might help you with the multiline stuff. And yes it was a quick hack based on the PiL code. -T -- smart generator, that deals with multiple line fields and properly escaped quotes -- FIXME: This escapes single quotes which can be here for two reasons: -- - single quotes as such or apotrophe -> escape for the SQL insert here is cheaper than on every single word! -- - numerical delimiter -> we don't support numerical formatting in csv. Period! function csv_generator(filename) local f = assert(io.open(filename, 'r')) return function() local line = f:read("*line") if line then local ml = false line = string.gsub(line, "'", "\\'") .. ',' -- ending comma local row = {} -- table to collect fields local f_start = 1 repeat -- multiline field if ml then line = line .. string.gsub(f:read("*line"), "'", "\\'") .. ',' local i = f_start repeat -- find closing quote; chew accross escaped quotes a, i, c = string.find(line, '(\\?)"', i+1) until c ~= '\\' -- not an escaped quote? if i then local f = string.sub(line, f_start+1, i-1) table.insert(row, (string.gsub(f, '\\"', '"'))) f_start = string.find(line, ',', i) + 1 ml = false end end -- next field is quoted? (start with `"'?) if string.find(line, '^"', f_start) then local a, c local i = f_start repeat -- find closing quote; chew accross escaped quotes a, i, c = string.find(line, '(\\?)"', i+1) until c ~= '\\' -- not an escaped quote? if not i then -- error('unmatched "') line = string.gsub(line, '\\,$', '\n') ml = true else local f = string.sub(line, f_start+1, i-1) table.insert(row, (string.gsub(f, '\\"', '"'))) f_start = string.find(line, ',', i) + 1 end else -- unquoted; find next comma local nexti = string.find(line, ',', f_start) table.insert(row, string.sub(line, f_start, nexti-1)) f_start = nexti + 1 end until f_start > string.len(line) return row else f:close() end end end From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 13:06:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73G6JWC030460; Mon, 3 Aug 2009 13:06:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1ABAC18FCE; Mon, 3 Aug 2009 13:05:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39CA418C6A for ; Mon, 3 Aug 2009 13:05:48 -0300 (BRT) Received: by yxe5 with SMTP id 5so2076334yxe.33 for ; Mon, 03 Aug 2009 09:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=TBrPUEWnzvZToD128azJo4dntDonF81FnFPZYRYtFZ8=; b=HKQu2rAuSih8mD1Z9sq8i44j4rOdEhuD4h6TO3TW3bYGqfLI2ZR8zm6f6nsAn3Hiwl lQciEL2MeRJi3lnF5mf/+BmoG5qS7LRIdSHU39ujDmkWcGk0sFkBzyOJuCFqh46LAn3Y Qhku2zvu3VK2rs3zzr/jUEupTa1REkbN7/slQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=F24ddQFQYHuUnYMnN2T35JZxHf2rl5xANG3kPyhmGy5WUAz0h+wVuy/MsHn+j6spEj wLbCyaYwV9OAW7MqVCOSFzk8KvX06f3mtHcfe25ETQgsm3jblyL+w942Lmf0edAG7BR/ rwBJWuxyM7SWHCi7VvlrCJTCb71/l649Cjm3A= MIME-Version: 1.0 Received: by 10.100.189.8 with SMTP id m8mr7268017anf.110.1249315546335; Mon, 03 Aug 2009 09:05:46 -0700 (PDT) In-Reply-To: References: <20090731165513.69e2fab6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Mon, 3 Aug 2009 12:05:26 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73G6JWC030460 On Mon, Aug 3, 2009 at 9:43 AM, Thomas Harning Jr. wrote: > On Fri, Jul 31, 2009 at 10:09 PM, Thomas Harning Jr. wrote: >> Basically, it looks like the on-error-condition patch is not getting >> called in the co-routine case.  I don't recall what was required to >> get that working... >> Also.. it looks like it's printing the success case rather than the >> failure case.  I'll see if I can figure out what is going on... will >> need to first digest how your patch does the condition tracking. > Checking through this and writing up a quick test (at: > http://pastebin.com/m40f2d12b), > I found that if there is an error inside a coroutine, the failure is > 'absorbed' and when the coroutine is collected, the success > 'finalizers' get executed. > > Running this test set on the old version yield no errors, besides the > valgrind-detect access to freed memory. > > Hopefully this test can be massaged into a more clean test for > correctness of the patch, but for now, it should work effectively to > root out incorrect behavior. The following patch to TNHarris's code makes the code pass the current test-set. I think it is correct and may have been a little typo in the original code: diff --git a/src/ldo.c b/src/ldo.c index db52477..320aa1c 100644 --- a/src/ldo.c +++ b/src/ldo.c @@ -525,7 +525,7 @@ LUA_API int lua_resume (lua_State *L, int nargs) { if (status != 0) { /* error? */ L->status = cast_byte(status); /* mark thread as `dead' */ luaD_seterrorobj(L, status, L->top); - if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_top, 1); + if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_stack, 1); L->ci->top = L->top; } else { Basically... the code to handle coroutine errors was originally doing nothing because it was finalizing from L->fin_top to L->fin_top ... quite an empty set. Since this is freeing everything in that thread, it needs to free from L->fin_top to L->fin_stack (the base) -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 13:18:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73GIGBe000397; Mon, 3 Aug 2009 13:18:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3301C190B4; Mon, 3 Aug 2009 13:17:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7079418F75 for ; Mon, 3 Aug 2009 13:17:46 -0300 (BRT) Received: by fxm25 with SMTP id 25so3617673fxm.5 for ; Mon, 03 Aug 2009 09:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=cllLAPmao6fAvAL3wsfKn/xZieuXjAVbjo0/8zBw8lc=; b=vDar7h2KqCHv63lDF4WjTtJwGEfKOsChwgnBnrcGJJACBwRX6TXZtZlYhjDzuiW95K x7npgfy103lNZFWgH9ezTZkh1P+Sy1VYyJ3eXRE1FCZiqgJKRDcBSLvaY1IcX6eMzvCD oGGWlxp84wrX0YnrbEkDCWGdyD4MLVnbacrnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=P9y72rYXfZTl/HyjxHrxfmjTZQn6u/ShIXU3SFdu86WEvtXBeth7RQ5LZ4r2g6/cP0 gSl8u/MH2eH3M5MHu+B6gSe5jULuDqsK/rkKdVFAmDukru1nmhkJSX3E3cMoGkTg417p E5jLvMFXOIrdsF6H+BwESuXa4/M9x6BRMPaz4= MIME-Version: 1.0 Received: by 10.204.100.11 with SMTP id w11mr8000587bkn.32.1249316263213; Mon, 03 Aug 2009 09:17:43 -0700 (PDT) From: Geoffroy Carrier Date: Mon, 3 Aug 2009 18:17:23 +0200 Message-ID: Subject: Compiler error on IBM XL for AIX To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I got an error compiling lua 5.1.4 with IBM XL for AIX (unknown version), under AIX Version 6, using C++ and LUA_USE_POSIX (not that it matters). "[...]/src/loslib.cpp", line 222: Error: "os_exit(lua_State*)" is expected to return a value. 1 Error(s) detected. Trivial handcrafted patch: loslib.c (here loslib.cpp): =static int os_exit (lua_State *L) { = exit(luaL_optint(L, 1, EXIT_SUCCESS)); + return 0; =} -- Geoffroy Carrier From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 13:27:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73GQwb2002109; Mon, 3 Aug 2009 13:27:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E53AD190FC; Mon, 3 Aug 2009 13:26:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD82919068 for ; Mon, 3 Aug 2009 13:26:29 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73GQQ5w002025 for ; Mon, 3 Aug 2009 13:26:27 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n73GQQh31658; Mon, 3 Aug 2009 13:26:26 -0300 Date: Mon, 3 Aug 2009 13:26:26 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Compiler error on IBM XL for AIX Message-ID: <20090803132625.A31625@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from geoffroy.carrier@gmail.com on Mon, Aug 03, 2009 at 06:17:23PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > loslib.c (here loslib.cpp): > =static int os_exit (lua_State *L) { > = exit(luaL_optint(L, 1, EXIT_SUCCESS)); > + return 0; > =} Other compilers know that exit never returns and complain that "return 0" is never reached. :-( See for instance these threads: http://lua-users.org/lists/lua-l/2008-01/msg00367.html http://lua-users.org/lists/lua-l/2006-09/msg00872.html http://lua-users.org/lists/lua-l/2002-06/msg00063.html It seems an unsolvable issue... (Note the dates!) From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 13:28:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73GSPmp002549; Mon, 3 Aug 2009 13:28:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8693D1912F; Mon, 3 Aug 2009 13:28:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2512190FC for ; Mon, 3 Aug 2009 13:28:00 -0300 (BRT) Received: by fxm25 with SMTP id 25so3623963fxm.5 for ; Mon, 03 Aug 2009 09:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=iTk13Wm4D4R/JvhkkJM0vlxzyLC0vgc436APwAB6cX8=; b=EzJxtkqtTgJ1ft1XVWcuhtN5DgtB07oqraigSd4B8jD+wN1LkusMPe9fUdSk87rpUj XfbMTr9MADzd1dkHPFnT3BEM3AMlJcSrwjofcle83mcaubA29p9BNJYGXtkBUt5rdIDX sRbB9CIDrbGm99WgVFIAfqoFCZWR6bnwwP758= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=A7JTbUoodyPPLn4TPdMaos3uTWqOrapJdnjwqIlS8Y0zeIbkVTfR+HtT4EbiOhiNlq n5w2HbHgOLdysmvzfmc6O1+rI8HEAzem5xFjv523i7SIzpOmvBQEdLSrqyJpJ6qzqc8l TXLIp26DCH//dxANOi0dMA7MF6Rru1UBAx/oI= MIME-Version: 1.0 Received: by 10.239.153.81 with SMTP id y17mr645148hbb.55.1249316878537; Mon, 03 Aug 2009 09:27:58 -0700 (PDT) Date: Mon, 3 Aug 2009 18:27:58 +0200 Message-ID: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Subject: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hi all, Although really the title should be 'Frequently Anticipated Questions'. http://penlight.luaforge.net/FAQ The markdown source is here: http://penlight.luaforge.net/FAQ/faq.zip It is intended to get the ball rolling, obviously there are areas that need expansion. In particular, things like Web Development or the arcana of the C API. This current draft has a lot of editorializing, and far too many links to projects I've been involved in. Plus, there may well be outrageous errors. Yes, I did think of using the wiki, but it's hard to write a big document using it. But the wiki is a good place to keep discussions about it. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 13:49:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Gnr0d006816; Mon, 3 Aug 2009 13:49:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96945190FD; Mon, 3 Aug 2009 13:49:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CADD19085 for ; Mon, 3 Aug 2009 13:49:17 -0300 (BRT) Received: by fxm25 with SMTP id 25so3636872fxm.5 for ; Mon, 03 Aug 2009 09:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=x2gcj0e94sssEGpZV2DAMWdips7EEkqfYB7BTkMZ3BA=; b=P05vhB5+w/sO/EiJ31CbM+9U8GLJ8ktur3JpbZVfMjOd7FLg5K05cOCfGZWf7+XFFp mxBaSwXQ0HRw6x/2rEu3teIOaZJcqK5885LyLq8uagF4Ah0IO9qc9aHLHjBLkcFc1aYW yNGy0lH0jJmwQFP+nIBnJSDfUvuyP3S86Cpyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=FcfMpmbN51aTtdz0gkr7ac1T6RpbjAv4n/PQQbUJgu1kdPGi8vFE1O0kIyrX33rwY0 5mSxU5byo8X29RBFYq1zuMjidt33ZQKxXrx+g4YgCHPhBl/nA+nLv4MimcAZutVhvl78 Hp+pdq3ufhj2jpm7lxYduJ3DF0D6VpX/YNuas= MIME-Version: 1.0 Received: by 10.204.118.12 with SMTP id t12mr7802378bkq.158.1249318155125; Mon, 03 Aug 2009 09:49:15 -0700 (PDT) In-Reply-To: <20090803132625.A31625@lua.tecgraf.puc-rio.br> References: <20090803132625.A31625@lua.tecgraf.puc-rio.br> From: Geoffroy Carrier Date: Mon, 3 Aug 2009 18:48:55 +0200 Message-ID: Subject: Re: Compiler error on IBM XL for AIX To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 18:26, Luiz Henrique de Figueiredo wrote: > It seems an unsolvable issue... (Note the dates!) For the information of whoever runs on this problem, those are usable to identify this compiler (I don't know if any other compiler requires return after exit and didn't spend much time on those threads, sorry if this has already been said): Predefined macro name Description __IBMC__ Indicates the level of the XL C compiler as an integer constant representing version, release, and modification number. __IBMCPP__ Indicates the level of the XL C++ compiler as an integer constant representing version, release, and modification number. __xlc__ Indicates the level of the XL C compiler as a string displaying the version, release, modification, and fix level. __xlC__ Indicates the level of the XL C++ compiler as a three-digit hexadecimal constant, representing version, release, and modification number. Using the XL C compiler also automatically defines this macro. -- Geoffroy Carrier From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 14:15:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73HFAvG013225; Mon, 3 Aug 2009 14:15:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F07B118C2F; Mon, 3 Aug 2009 14:14:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 458FE18B4E for ; Mon, 3 Aug 2009 14:14:38 -0300 (BRT) Received: by qyk34 with SMTP id 34so3060798qyk.33 for ; Mon, 03 Aug 2009 10:14:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.74.85 with SMTP id t21mr4943132vcj.105.1249319675248; Mon, 03 Aug 2009 10:14:35 -0700 (PDT) In-Reply-To: <20090803132625.A31625@lua.tecgraf.puc-rio.br> References: <20090803132625.A31625@lua.tecgraf.puc-rio.br> From: Greg Falcon Date: Mon, 3 Aug 2009 13:14:14 -0400 Message-ID: <3cdcefb80908031014n7b8dda97x551050ede86b299f@mail.gmail.com> Subject: Re: Compiler error on IBM XL for AIX To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73HFAvG013225 On Mon, Aug 3, 2009 at 12:26 PM, Luiz Henrique de Figueiredo wrote: >> loslib.c (here loslib.cpp): >> =static int os_exit (lua_State *L) { >> =  exit(luaL_optint(L, 1, EXIT_SUCCESS)); >> +  return 0; >> =} > > Other compilers know that exit never returns and complain that "return 0" > is never reached. :-( > > http://lua-users.org/lists/lua-l/2002-06/msg00063.html > > It seems an unsolvable issue... (Note the dates!) I'm curious about what you think of the solution provided in the 2002 thread here: http://lua-users.org/lists/lua-l/2002-06/msg00067.html I was just about to suggest the same thing myself, and then discovered it had already been suggested: static int os_exit (lua_State *L) { if (L) exit(luaL_optint(L, 1, EXIT_SUCCESS)); return 0; } This doesn't change the behavior of any well-formed Lua client, and paying for one extra pointer test at os_exit() doesn't seem too steep a cost to squash a warning. Greg F From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 14:32:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73HWpAV017344; Mon, 3 Aug 2009 14:32:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E92EA19149; Mon, 3 Aug 2009 14:32:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8AF618FEB for ; Mon, 3 Aug 2009 14:32:16 -0300 (BRT) Received: by fxm25 with SMTP id 25so3662843fxm.5 for ; Mon, 03 Aug 2009 10:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=zi974u4Chv9mHyW8OCY7OZvafoj9TavFfmMCQYaQJOE=; b=ASeGSTtXXH+oCj4bf8f/4mJ6J1JkiFcLUhCCRhxQFML5LiXqWKzrlTWc/NialgVtCF BT4JX31EJS8775kIOBWcQNWfQACnhNujoq9Upy1EE45FaoKiyP9U7SCI9wiFaCskKilC Gj8P3xXX2n7agXcnMv+pPJzSH0TTh/9OVqkW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=SxVpplGAGcgdde4U7CsaO6NOIzStPWtj8/sVcsTRrwCSNM+tNOsw+lfEflHDtIGE+g tYgL/QPoHRD5cjVAnkE7Q7GGlukagUn26KhMd8HjwGWbC4S3Rl/ztA3PZcJkeZrlpBlG N5dF8qlgx6FE5vu/ey1UTLjxTF3jBr+aj+mNo= Received: by 10.103.212.16 with SMTP id o16mr429359muq.34.1249320734513; Mon, 03 Aug 2009 10:32:14 -0700 (PDT) Received: from ?95.78.64.153? ([95.78.64.153]) by mx.google.com with ESMTPS id s10sm39874839mue.38.2009.08.03.10.32.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Aug 2009 10:32:13 -0700 (PDT) Date: Mon, 3 Aug 2009 21:32:07 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <121518210.20090803213207@gmail.com> To: Greg Falcon Subject: Re[2]: Compiler error on IBM XL for AIX In-Reply-To: <3cdcefb80908031014n7b8dda97x551050ede86b299f@mail.gmail.com> References: <20090803132625.A31625@lua.tecgraf.puc-rio.br> <3cdcefb80908031014n7b8dda97x551050ede86b299f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Greg, Monday, August 3, 2009, 9:14:14 PM, you wrote: > static int os_exit (lua_State *L) { > if (L) > exit(luaL_optint(L, 1, EXIT_SUCCESS)); > return 0; > } > This doesn't change the behavior of any well-formed Lua client, and but ill-formed client may silently return instead of producing error. smth like L!=L+1 would be better if we may find way to fool any C compiler :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 14:42:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73HgARH019587; Mon, 3 Aug 2009 14:42:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 641131912F; Mon, 3 Aug 2009 14:41:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15E1918ED1 for ; Mon, 3 Aug 2009 14:41:39 -0300 (BRT) Received: by fxm25 with SMTP id 25so3668469fxm.5 for ; Mon, 03 Aug 2009 10:41:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.134.17 with SMTP id l17mr1083983mun.109.1249321297863; Mon, 03 Aug 2009 10:41:37 -0700 (PDT) In-Reply-To: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Date: Mon, 3 Aug 2009 12:41:37 -0500 Message-ID: <90eb1dc70908031041g61b253c9t9447026da00e2d33@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 11:27 AM, steve donovan wrote: > This current draft has a lot of editorializing, and far too many links > to projects I've been involved in. Plus, there may well be outrageous > errors. i think this is a good thing to do, and might be a good starting seed; but just glancing over it, found too many assertions that might be correct in practice, but wrong in theory, or at least doesn't define the concepts before using them. maybe i wouldn't change much about it, just add a big fat warning about not being an authoritative reference in any sense, and adding a lot of links back to the relevant official definitions in the reference. personally, i do like the terse, precise and succinct language used in the reference. but that makes it not the easiest tutorial, so a FAQ that explains the practical issues, and then refers to the reference would be best. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:00:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73I0PMA023797; Mon, 3 Aug 2009 15:00:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 156ED19182; Mon, 3 Aug 2009 15:00:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f175.google.com (mail-px0-f175.google.com [209.85.216.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6762E1914C for ; Mon, 3 Aug 2009 14:59:54 -0300 (BRT) Received: by pxi5 with SMTP id 5so2685825pxi.11 for ; Mon, 03 Aug 2009 10:59:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.79.7 with SMTP id c7mr9598607wab.186.1249322391100; Mon, 03 Aug 2009 10:59:51 -0700 (PDT) In-Reply-To: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Date: Mon, 3 Aug 2009 12:59:51 -0500 Message-ID: <576e7620908031059j1efd2517o1d0c1f6bb4dc7161@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In Section "What is the difference between pairs and ipairs?", mixed up: "ipairs(t) gives a general iterator over all the keys and values in a table, numerical or not, and in no particular order; pairs(t) goes over the array part, in order." From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:20:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IKKmR027701; Mon, 3 Aug 2009 15:20:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E80761917B; Mon, 3 Aug 2009 15:19:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0D8919107 for ; Mon, 3 Aug 2009 15:19:39 -0300 (BRT) Received: by bwz6 with SMTP id 6so3574828bwz.5 for ; Mon, 03 Aug 2009 11:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tPkLGPqjjaBVPusTUetSayzX5Uv+uk4zLgnZOl79Xs0=; b=B/sZZDK4/bAv/odxdmANiX8KCu/oSnFkrEsP6jNOlBJMFSJV+gxc9gx6LtfE1woomn YpAKI9zGxlJ1sXJ1pxfeFzscy4tq1b2qYYcTZOshdG5k/2P1+R3jBHiIDjBZB/xcOzuP QGJKsyAcxT6xe0UEZWleatVGBjFApH6JKTLSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=p3lWvCVtxN45msDAfEHX9MkdXhVZ10kC79ePZQw9VIgSndQT3gH6SDhpxCaPbKj76p M/GwiBAUq7WLL6vPIYZtWFOnoNiDvPLPCGmnh0yuhmJ9Nys74XSUXTpYnghr1UyUxjfM D+oMxMDVJpqganxXcNIQhZVNzkujXsQoA2CV0= MIME-Version: 1.0 Received: by 10.204.62.135 with SMTP id x7mr6188136bkh.124.1249323573092; Mon, 03 Aug 2009 11:19:33 -0700 (PDT) In-Reply-To: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Date: Mon, 3 Aug 2009 20:19:33 +0200 Message-ID: <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Colin To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Without wanting to contest the idea of a dedicated string concatenation operator, the explanation "Overloading '+' to mean string concatenation is a long tradition, although not very mathematically sound. [...]" seems rather strange to me: The set of strings over an alphabet, with concatenation as addition, and the empty string as neutral element, forms an algebraical structure, a monoid, that is quite mathematically sound, used frequently in theoretical computer science, and surely not unknown to mathematicians. In general, the slightly more 'chatty' style of the FAQ seems a very good complement to the more 'direct' style of the reference manual, definitely a good idea. Colin From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:23:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IN25V028201; Mon, 3 Aug 2009 15:23:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09A0119178; Mon, 3 Aug 2009 15:22:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2401D19155 for ; Mon, 3 Aug 2009 15:22:28 -0300 (BRT) Received: by bwz6 with SMTP id 6so3576508bwz.5 for ; Mon, 03 Aug 2009 11:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=w1nebIKQyjlXhZGjeuLLGilA15JvWm1dsuWQoUZzOZ4=; b=jOoIy50Qh8IC+0Z5kGsUMSd+akCzNxgjImY0s+2bWWiRIR2f6rn+B+TScGyGPep5cD UGVDbz10ECNH0iYo/IUZE2j7k9tZUTbaiAf5RV/BEFOcwoJfawSahrBCxeQBZsH4P24p 7xECKCfIB2xTPmVBA38I4+b7bz8HWBZmEwrSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=GDUwslqvz3h1c1noXTzKfWOxq/04TrzpBOPyRy7loGkYe2i0frxaJdsaDDfopual6H jBmFlSANn3g6Ae/k+og/N6wXE8/fhI57lv9fibrNaTcOYWWEVtGm3Ar/n8WAlAJVUBuo SHAEdN4htQ6Ps13KaXhJ4fdzdSBGLtpkMRr1I= MIME-Version: 1.0 Received: by 10.239.163.146 with SMTP id p18mr630903hbd.52.1249323747339; Mon, 03 Aug 2009 11:22:27 -0700 (PDT) In-Reply-To: <90eb1dc70908031041g61b253c9t9447026da00e2d33@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <90eb1dc70908031041g61b253c9t9447026da00e2d33@mail.gmail.com> Date: Mon, 3 Aug 2009 20:22:27 +0200 Message-ID: <560972290908031122u3e89091bvf04d15a3223afc44@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73IN25V028201 On Mon, Aug 3, 2009 at 7:41 PM, Javier Guerra wrote: > i think this is a good thing to do, and might be a good starting seed; > but just glancing over it, found too many assertions that might be > correct in practice, but wrong in theory I think this is the best sentence I have read all day, thanks Javier >, or at least doesn't define > the concepts before using them. Yes, if it's trying to be a tutorial, then that has to be carefully done. I worry about the unevenness of tone, mixing stuff of different levels. > maybe i wouldn't change much about it, just add a big fat warning > about not being an authoritative reference in any sense, and adding a > lot of links back to the relevant official definitions in the > reference. Yes, that's a good idea - This is Not a Reference (TINAR) I realized too late that people might be confused by the existing Lua FAQ, which has a different scope and purpose. > personally, i do like the terse, precise and succinct language used in > the reference.  but that makes it not the easiest tutorial, so a FAQ > that explains the practical issues, and then refers to the reference > would be best. I've come to appreciate the well-written precision of the manual myself. And of course anybody who is half-serious should read PiL. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:32:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IWghG030191; Mon, 3 Aug 2009 15:32:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D6A1191E4; Mon, 3 Aug 2009 15:32:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B39B19191 for ; Mon, 3 Aug 2009 15:32:12 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n73IWAc6032595 for ; Mon, 3 Aug 2009 15:32:10 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 51A6F54C04F; Mon, 3 Aug 2009 15:32:11 -0300 (BRT) Date: Mon, 3 Aug 2009 15:32:11 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Compiler error on IBM XL for AIX Message-ID: <20090803183211.GB20014@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I got an error compiling lua 5.1.4 with IBM XL for AIX (unknown > version), under AIX Version 6, using C++ and LUA_USE_POSIX (not that > it matters). > > "[...]/src/loslib.cpp", line 222: Error: "os_exit(lua_State*)" is > expected to return a value. > 1 Error(s) detected. This is a bug in the compiler. ISO/IEC 9899:1999 (E) does not require that a function with a return type actually returns any value, unless the returned value is actually used: ISO/IEC 9899:1999 (E), Section 6.9.1: If the } that terminates a function is reached, and the value of the function call is used by the caller,the behavior is undefined. The other restrictions about returns are these: Section 6.8.6.4: A return statement with an expression shall not appear in a function whose return type is void. A return statement without an expression shall only appear in a function whose return type is void. [...] A function may have any number of return statements. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:33:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IXNan030414; Mon, 3 Aug 2009 15:33:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A553B1920D; Mon, 3 Aug 2009 15:32:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B108B191E8 for ; Mon, 3 Aug 2009 15:32:22 -0300 (BRT) Received: by fxm25 with SMTP id 25so3698276fxm.5 for ; Mon, 03 Aug 2009 11:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=K/Rh26rOY59dOgAfiXcDsg3oVk8gqln+jusX3yA1/EM=; b=A1p/Zt1nV14xcE6yrMSEs9ieiOvwCOImVcbxdbOB8d6UJllaO90/B2OBjRmwlisjF0 DBwcIDcNcxPqh6g9Qqwo2xohvhy8VMv1U10N3UJvXvzOfTH37qqt0C4Ka9AcmS+V1ith HZSH4+Hbo9VE/EWqhsDYdAWS3Zqgi+RiMpBrM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cUMbwU6uVLt50WHNf+yhRR9AQArl32k5/fiS5vKwslgP8a2QiRhbjRXpyr1YVP/tUs pB7XFDNRwc+a4OJbTj3KW/GNaTUxSG9p+GKdoLtLe6Htwqzk8CtBX1biN/rkJKOJ8nci vLLOUBX+UyrPOAOQN8SSHgYOhPg2h6juujf/0= MIME-Version: 1.0 Received: by 10.239.154.137 with SMTP id e9mr663206hbc.153.1249324340180; Mon, 03 Aug 2009 11:32:20 -0700 (PDT) In-Reply-To: <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> Date: Mon, 3 Aug 2009 20:32:20 +0200 Message-ID: <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 8:19 PM, Colin wrote: > seems rather strange to me: The set of strings over an alphabet, with > concatenation as addition, and the empty string as neutral element, > forms an algebraical structure, a monoid, that is quite mathematically > sound, used frequently in theoretical computer science, and surely not > unknown to mathematicians. This is what comes from making wild assertions, the dark side of the chatty-and-relaxed approach to writing tutorials. I suppose I've still got the 2nd year maths concepts of Group and Field engraved on my brain. Which is still the best guide (I think) for overloading arithmetic operations. I come from a C++ background, and people really do wild things with operators, because They Can. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:54:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IsaXQ003087; Mon, 3 Aug 2009 15:54:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 569A71924D; Mon, 3 Aug 2009 15:54:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B648919152 for ; Mon, 3 Aug 2009 15:54:03 -0300 (BRT) Received: by bwz6 with SMTP id 6so3593701bwz.5 for ; Mon, 03 Aug 2009 11:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qdORAvUGsb1Qqc77oYfZEpYR6K69LBV0REn8AJvcIqg=; b=nr0v6kyD0d5L5fQ66KiyivDZlVo8Ff7WLFizYwghV9nhXtHzzRsmGk4/4+CnFapUs1 zbpvloPEU7o62OgRP0CIGoPBF1WhFkiLLaCnCl5JO7e9IETE6JxdvZScQvOhEfMvhY7j e+5Tl9mME8qwKChbYhNcVNeX+Efr8dJX4EIoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jSZtspTlxqb7g74m1rikANdMBRarKe0ERR5Tmg0vVnCcgl2x/KMjzY0621kaxv1/+F wbYaWzX0NPKbt44ehiVZCJlO1ksXFu9v/9NeSY5GXW7HpF74DRierya+4SxcPafh5t/5 kZ8NIP0+AzSYu2uaQK49fpu+2sClVSAbjIj5I= MIME-Version: 1.0 Received: by 10.204.117.65 with SMTP id p1mr7184356bkq.91.1249325641119; Mon, 03 Aug 2009 11:54:01 -0700 (PDT) In-Reply-To: <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> Date: Mon, 3 Aug 2009 20:54:01 +0200 Message-ID: <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Colin To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n73IsaXQ003087 On Mon, Aug 3, 2009 at 8:32 PM, steve donovan wrote: > On Mon, Aug 3, 2009 at 8:19 PM, Colin wrote: >> seems rather strange to me: The set of strings over an alphabet, with >> concatenation as addition, and the empty string as neutral element, >> forms an algebraical structure, a monoid, that is quite mathematically >> sound, used frequently in theoretical computer science, and surely not >> unknown to mathematicians. > > This is what comes from making wild assertions, the dark side of the > chatty-and-relaxed approach to writing tutorials. (I hope you don't become discouraged too easily, would be a shame.) > I suppose I've still got the 2nd year maths concepts of Group and > Field engraved on my brain.  Which is still the best guide (I think) > for overloading arithmetic operations.  I come from a C++ background, > and people really do wild things with operators, because They Can. Regarding the strings as monoid, with the addition as concatenation, is nowhere near wild, it's wildly normal ;-) Colin From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:56:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IufKb003641; Mon, 3 Aug 2009 15:56:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 208C119276; Mon, 3 Aug 2009 15:56:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-02.bluehost.com (outbound-mail-02.bluehost.com [69.89.21.12]) by bazar2.conectiva.com.br (Postfix) with SMTP id B01301925F for ; Mon, 3 Aug 2009 15:56:13 -0300 (BRT) Received: (qmail 4900 invoked by uid 0); 3 Aug 2009 18:56:10 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy1.bluehost.com with SMTP; 3 Aug 2009 18:56:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Subject:Message-ID:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=PWohwWdtfOwU4w1UTNWTWlIJv0W4+Dh5FtF8t2mNotiIBRL1ef2TOn9UR4154MrdeAeTJP2dkTYBWvSSrfNAEXPgH6pGWwlD3gdBuEYMPTPbuTrBnaibEP/VyjFejUjY; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MY2hd-0001WU-NU for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 12:56:10 -0600 Date: Mon, 3 Aug 2009 13:55:59 -0500 From: Rob Hoelz To: Lua list Subject: [ANN] linotify Message-ID: <20090803135559.1fc70082@hoelzro.net> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ojoLYr=Qp1sXZiVaqr5coFQ"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/ojoLYr=Qp1sXZiVaqr5coFQ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello fellow Lua users, I wrote a binding to Linux's inotify facility for Lua, and I'm announcing it here with the hope that someone other than myself will find it useful. Here's the GitHub URL: http://github.com/hoelzro/linotify/tree/master Let me know if you have any suggestions/find any bugs/etc. Thanks, Rob Hoelz --Sig_/ojoLYr=Qp1sXZiVaqr5coFQ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkp3MsIACgkQUoGaR6SGEaoCGACeJrJ+xQ1cgis1Jg1cQsnxKZkE 1E8An1+bQkjuLl7YAEPVuJLbyOMdbNvA =zLyf -----END PGP SIGNATURE----- --Sig_/ojoLYr=Qp1sXZiVaqr5coFQ-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 15:59:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IxSjV004572; Mon, 3 Aug 2009 15:59:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD4F719289; Mon, 3 Aug 2009 15:59:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7275E191AE for ; Mon, 3 Aug 2009 15:59:02 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73IwwK0004304 for ; Mon, 3 Aug 2009 15:58:59 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n73IwvJ32687; Mon, 3 Aug 2009 15:58:57 -0300 Date: Mon, 3 Aug 2009 15:58:56 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] An extended Lua FAQ Message-ID: <20090803155856.A32680@lua.tecgraf.puc-rio.br> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com>; from colin.hch@gmail.com on Mon, Aug 03, 2009 at 08:54:01PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Regarding the strings as monoid, with the addition as concatenation, > is nowhere near wild, it's wildly normal ;-) Sure. But that does not mean you *need* to use "+" to represent its operation. AWK for instance uses nothing (i.e., juxtaposition), which is the popular practice in formal languages. From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 16:33:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73JXZF6013223; Mon, 3 Aug 2009 16:33:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41C1319292; Mon, 3 Aug 2009 16:33:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17181928D for ; Mon, 3 Aug 2009 16:32:58 -0300 (BRT) Received: by bwz6 with SMTP id 6so3617198bwz.5 for ; Mon, 03 Aug 2009 12:32:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.54.4 with SMTP id o4mr8947934bkg.208.1249327976385; Mon, 03 Aug 2009 12:32:56 -0700 (PDT) Date: Mon, 3 Aug 2009 22:32:56 +0300 X-Google-Sender-Auth: 0f3c279cf0b3eabd Message-ID: Subject: small glitch in alien.struct library From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, struct.c from alien (maybe the original struct lib too) line 83 should be case 'i': case 'I': return getnum(fmt, sizeof(int)); instead of case 'i': return getnum(fmt, sizeof(int)); .. and since I'm spamming the list with small potatoes, I also made a handy memcpy() for alien to copy strings and userdata into buffers directly. static int alien_memcpy(lua_State *L) { void* dst; void* src; size_t size; dst = lua_touserdata(L, 1); if (!dst) luaL_typerror(L, 1, "userdata or light userdata"); if (!(lua_isuserdata(L, 2) || lua_isstring(L, 2))) luaL_typerror(L, 2, "string, userdata, or light userdata"); if (lua_isuserdata(L, 2)) { src = lua_touserdata(L, 2); size = luaL_checkint(L, 3); } else { src = (void*)lua_tolstring(L, 2, &size); size = luaL_optint(L, 3, size); } if (size > 0) memcpy(dst, src, size); return 1; } From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 16:48:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73JmRss016768; Mon, 3 Aug 2009 16:48:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 297901929D; Mon, 3 Aug 2009 16:48:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70BA819286 for ; Mon, 3 Aug 2009 16:47:54 -0300 (BRT) Received: by fxm25 with SMTP id 25so3742831fxm.5 for ; Mon, 03 Aug 2009 12:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZjpYL0H5reg16b3hGSOHne+zJABtyl9B1clcqx8ChgQ=; b=lfxnbQjyYtWTdf5YWswAKWxRj2UuobhBl9ee7PoMaTeRCppDHzx1TUng6eEgtg7r71 N2xTcwCI9vcj0q5SanqsyoZ/+mlUWtkJN17ItEhXfR5wP0mKW9RpgkrE6/rb7a55pqDX vZCHajlW8rZ8UtZmJLTKhc49wbg2bICklcQEA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SFUKKiJ6kaCBQGuvjB5VLkcMV8GAeI0GVVgOFRt2XBGy8PO39SSWZJEP0XmT+FcgN5 oaNXx3mbzDW4WfLNW//vmo1b4rj4TL4OVdTieHskGR+HidbllKIANIJrMZk38nMen4d7 JYb+izHMchlQVx5Y4SAYzv3ZYK14UR9B3PCb8= MIME-Version: 1.0 Received: by 10.204.64.145 with SMTP id e17mr8213692bki.129.1249328872003; Mon, 03 Aug 2009 12:47:52 -0700 (PDT) In-Reply-To: <20090803155856.A32680@lua.tecgraf.puc-rio.br> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <20090803155856.A32680@lua.tecgraf.puc-rio.br> Date: Mon, 3 Aug 2009 21:47:50 +0200 Message-ID: <97d148f50908031247n41db4dffx1ac58ee7e5be3615@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Colin To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 8:58 PM, Luiz Henrique de Figueiredo wrote: >> Regarding the strings as monoid, with the addition as concatenation, >> is nowhere near wild, it's wildly normal ;-) > > Sure. But that does not mean you *need* to use "+" to represent its operation. > AWK for instance uses nothing (i.e., juxtaposition), which is the popular > practice in formal languages. Right, you absolutely don't _need_ to use "+" here, and I am not trying to argue in that direction. My point was just that the "mathematical not sound" argument seemed bogus to me. Presumably there are some other reasons for this design decision. Actually, I darkly remember something, let's check... Yes, the "Evolution" paper on Lua says "Because the language allows coercion of strings to numbers, a + signal would be ambiguous; so, we created the syntax .. (two dots) for that operation [concatenation]." Colin From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 17:17:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73KHpd1024464; Mon, 3 Aug 2009 17:17:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17750192A5; Mon, 3 Aug 2009 17:17:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A60411929E for ; Mon, 3 Aug 2009 17:17:11 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so855973eyd.11 for ; Mon, 03 Aug 2009 13:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=mn9lhZLt7+5774SKVyF0TS38em7ByFPitFNayMQXgXk=; b=jtktCi+YebcFdROdflreMqq3m6mMmsS6lLnPGIRktyWkwnPPH/RXmXuw8L1CycB7cO +899blvvygUW1Jro+5y52009ZDMHFk1eE6lAcOJ+vnUMmqYYaQbpiAF7AUaBPoMh6TmQ HE9NfZBYyTMGE5yrRQX8ho+k6BLa17dSjKBi0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=po0HJHNKQavLTONSA3LihkJ2hi+wDHq0UQBMLxMhRJAHNv1WsX++ir9hohZHQOssHl KTqIBpEv5kmsNlMINwT0+BfUnRSW2bu+qYBlqaeeEQ1ws0BshFnCB4oxHt8InGAQOXtj lrUfT2YwhxCryTYu3BFhOdjyTD85rMbeQz/Zg= MIME-Version: 1.0 Received: by 10.216.20.197 with SMTP id p47mr1319114wep.13.1249330628238; Mon, 03 Aug 2009 13:17:08 -0700 (PDT) Date: Mon, 3 Aug 2009 16:17:08 -0400 Message-ID: Subject: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Everyone, I am in a process of creating Lua bindings to some numerical C/C++ libraries with rich matrix API. In modern day numeric software it is fashionable to use algebraic notations for math operations for the sake of readability of mathematical expressions. Unfortunately, these algebraic notations, being indeed readable and familiar, could cause mayhem by means of producing numerous temporary objects depleting memory resources and taxing CPU. Let me give an example to illustrate Let say: m, m1 and m2 are square NxN matrices. In the following for-loop for n=1,1000 do m= m*m1 + m2 end on each iteration one temporary matrix is created to store the result of matrix multiplication "*". It is used only once as an input-variable to "+" which in turn allocates another matrix which is then bound to m. The previous value of m as well the temporary object are now unreferenced and eligible for garbage collection. As a result, performance suffers first from excessive "malloc" overhead allocation matrices on each iteration and, secondly, from GC overhead if GC is actively reclaiming all those "use once" temporary objects. In the older days of numerics from 60-es to 80-es this problem was easily resolved by shifting *all* resource management to a user. Matrix APIs simply were not allocating or freeing the resources. A user was supposed to pass a reference or pointer to pre-allocated matrix to hold the result. Such a design solved the problem at the expense of readability. Now you cannot copy/paste math expressions from text-books into the code anymore. Modern and successful systems such as Matlab (not very modern after all) or Mathematica do retain math-formula like algebraic notations and hopefully do some proprietary stuff to eliminate/reuse temporaries. Is it possible to do something in Lua and somehow control use of temporary objects when dealing with typical +-*/ math operations in Lua?? The underlying math library API is of the older variety and expects user to do all the resource allocations. Any hint is appreciated! --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 17:44:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Kic5P031474; Mon, 3 Aug 2009 17:44:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69189192AA; Mon, 3 Aug 2009 17:43:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC0C5192A3 for ; Mon, 3 Aug 2009 17:43:13 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MY4O5-00041B-00; Mon, 03 Aug 2009 22:44:05 +0200 Date: Mon, 3 Aug 2009 22:43:19 +0200 From: Mike Pall To: Lua list Subject: Re: matrix operations and temporary objects? Message-ID: <20090803204319.GA5357@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > Is it possible to do something in Lua and somehow control use of > temporary objects when dealing with typical +-*/ math operations in > Lua?? The underlying math library API is of the older variety and > expects user to do all the resource allocations. This paper might give you further ideas and has more references: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.4562 E. Christopher Lewis, Calvin Lin, and Lawrence Snyder, "The Implementation and Evaluation of Fusion and Contraction in Array Languages", PLDI '98 --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 17:46:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73KknYN031944; Mon, 3 Aug 2009 17:46:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F325E192B8; Mon, 3 Aug 2009 17:45:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CB3C192B2 for ; Mon, 3 Aug 2009 17:45:29 -0300 (BRT) Received: by fxm25 with SMTP id 25so3777911fxm.5 for ; Mon, 03 Aug 2009 13:46:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.102.234.18 with SMTP id g18mr3747919muh.129.1249332380070; Mon, 03 Aug 2009 13:46:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Aug 2009 15:46:18 -0500 Message-ID: <90eb1dc70908031346t25b5de79r3eb4e45fffb15877@mail.gmail.com> Subject: Re: matrix operations and temporary objects? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 3:17 PM, Leo Razoumov wrote: > Is it possible to do something in Lua and somehow control use of > temporary objects when dealing with typical +-*/ math operations in > Lua?? The underlying math library API is of the older variety and > expects user to do all the resource allocations. two ideas: (not that i have done anything similar) 1: parse a user string with the whole expression to build the operating objects: m=import "matrix" m.var("A") = {.... data...} m.var("B") = {....more data...} for n=1,1000 do m.oper ("A = A * B") end print (m.get("A")) 2: override operators in your userdata; but don't make them calculate, make them generate the calculators, a bit like LPEG constructing operators -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 19:21:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73MLojT013493; Mon, 3 Aug 2009 19:21:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE95C192C5; Mon, 3 Aug 2009 19:20:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-144.bluehost.com (outbound-mail-144.bluehost.com [67.222.38.34]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9B67E192B1 for ; Mon, 3 Aug 2009 19:20:41 -0300 (BRT) Received: (qmail 7062 invoked by uid 0); 3 Aug 2009 22:20:37 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy5.bluehost.com with SMTP; 3 Aug 2009 22:20:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=1BuBjkNhJrs6FOdoCFAXpnbOjOZ4GynnpGtgqPg9UO8jQygmq08nlcxxIvuQxJEbK+GXKeivr5Q+On1tKG+NHBEGVHr3wgiKUf+L6mKQsdOPgEhVxonNUtVIXyo64Uh+; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MY5tU-000793-W2 for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 16:20:37 -0600 Date: Mon, 3 Aug 2009 18:20:34 -0400 From: TNHarris To: Lua list Subject: Re: [Patch] Finalization of function objects Message-ID: <20090803182034.432894c6@egeria.whoopdedo.org> In-Reply-To: References: <20090731165513.69e2fab6@egeria.whoopdedo.org> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=Multipart_Mon__3_Aug_2009_18_20_34_-0400_IZqEKG1rT6c9ktTt X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Multipart_Mon__3_Aug_2009_18_20_34_-0400_IZqEKG1rT6c9ktTt Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 3 Aug 2009 12:05:26 -0400 "Thomas Harning Jr." wrote: > The following patch to TNHarris's code makes the code pass the current > test-set. I think it is correct and may have been a little typo in > the original code: > - if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_top, 1); > + if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_stack, > 1); > > Basically... the code to handle coroutine errors was originally doing > nothing because it was finalizing from L->fin_top to L->fin_top ... > quite an empty set. Since this is freeing everything in that thread, > it needs to free from L->fin_top to L->fin_stack (the base) > Yes, that was the problem. And also in resetstack, the same thing: diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/ldo.c lua.mod/src/ldo.c --- lua.orig/src/ldo.c 2008-01-18 17:31:22.000000000 -0500 +++ lua.mod/src/ldo.c 2009-08-02 06:57:33.526611200 -0400 @@ -83,6 +83,8 @@ L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); + L->allowhook = 0; + if (L->fin_top) luaD_finalize(L, L->fin_stack, 1); L->nCcalls = L->baseCcalls; L->allowhook = 1; restore_stack_limit(L); > Comparing from 'original' finalizer patch (Nodir) to the newer one > provided by TNHarris... I'm not sure which is 'correct' or not, > especially ones that alter the Lua internal stack/etc. Mostly, this is because of the change from a base+offset stack to stack pointers. But when it comes to calling finalizers after an error, I'm not too sure how the Lua state and call info should be massaged to avoid "Bad Things". I guessed on a lot of it and, if it appeared to work, let it be. I think the order should be to clean up from the callee, invoke finalizers, restore the caller state. -- tom telliamed@whoopdedo.org --Multipart_Mon__3_Aug_2009_18_20_34_-0400_IZqEKG1rT6c9ktTt Content-Type: text/x-diff; name=lua514-finalizers0709.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=lua514-finalizers0709.patch diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lapi.c lua.mod/src/lapi.c --- lua.orig/src/lapi.c 2008-07-04 14:41:18.000000000 -0400 +++ lua.mod/src/lapi.c 2009-05-30 15:47:13.396958400 -0400 @@ -1085,3 +1085,64 @@ return name; } + + +/* +** finalization functions +*/ + + +LUA_API int lua_getfinalframe (lua_State *L) { + int base = L->fin_stack ? L->fin_top - L->fin_stack + 1 : 1; + return base; +} + + +LUA_API int lua_finally (lua_State *L, int nargs, int scope, int when) { + int base; + StkId fin,o; + TValue key; + lua_lock(L); + api_checknelems(L, nargs + 1); + api_check(L, scope <= 0 && L->base_ci <= scope + L->ci); + fin = L->top - (nargs+1); + if (!ttisfunction(fin)) { + setsvalue(L, &key, luaS_new(L, "close")); + luaV_gettable(L, fin, &key, L->top); + if (!ttisfunction(L->top)) { + setobj2s(L, L->top, luaT_gettmbyobj(L, fin, TM_GC)); + if (!ttisfunction(L->top)) { + base = L->fin_stack ? L->fin_top - L->fin_stack + 1 : 1; + L->top = fin; + lua_unlock(L); + return base; + } + } + api_incr_top(L); + o = fin; + for (o = L->top; o>fin; o--) setobjs2s(L, o, o-1); + setobjs2s(L, fin, L->top); + nargs++; + } + base = luaD_finally(L, fin, scope, when); + lua_unlock(L); + return base; +} + + +LUA_API void lua_finalize (lua_State *L, int base, int failure) { + StkId fin; + lua_lock(L); + if (base == 0) { + if (NULL == (fin = L->ci->fin_base)) { + lua_unlock(L); + return; + } + } + else + fin = L->fin_stack + base - 1; + api_check(L, L->fin_stack <= fin && fin <= L->fin_top); + luaD_finalize(L, fin, failure); + lua_unlock(L); +} + diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lbaselib.c lua.mod/src/lbaselib.c --- lua.orig/src/lbaselib.c 2008-02-14 11:46:22.000000000 -0500 +++ lua.mod/src/lbaselib.c 2009-05-30 15:59:47.561393600 -0400 @@ -393,6 +393,32 @@ } +static int luaB_finally (lua_State *L) { + int base; + int when = LUA_FINALWAYS; + int nargs = lua_gettop(L) - 1; + if (nargs >= 0) { + if (lua_isboolean(L, 1)) { + nargs--; + luaL_checkany(L, 2); + when = lua_toboolean(L, 1) ? LUA_FINSUCCESS : LUA_FINERROR; + } + base = lua_finally(L, nargs, -1, when); + } + else + base = lua_getfinalframe(L); + lua_pushinteger(L, base); + return 1; +} + + +static int luaB_finalize (lua_State *L) { + int base = luaL_optint(L, 1, 0); + lua_finalize(L, base, !lua_isnoneornil(L, 2)); + return 0; +} + + static int luaB_tostring (lua_State *L) { luaL_checkany(L, 1); if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ @@ -469,6 +495,8 @@ {"type", luaB_type}, {"unpack", luaB_unpack}, {"xpcall", luaB_xpcall}, + {"finally", luaB_finally}, + {"finalize", luaB_finalize}, {NULL, NULL} }; diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/ldo.c lua.mod/src/ldo.c --- lua.orig/src/ldo.c 2008-01-18 17:31:22.000000000 -0500 +++ lua.mod/src/ldo.c 2009-08-02 06:57:33.526611200 -0400 @@ -83,6 +83,8 @@ L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); + L->allowhook = 0; + if (L->fin_top) luaD_finalize(L, L->fin_stack, 1); L->nCcalls = L->baseCcalls; L->allowhook = 1; restore_stack_limit(L); @@ -293,6 +295,7 @@ L->savedpc = p->code; /* starting point */ ci->tailcalls = 0; ci->nresults = nresults; + ci->fin_base = NULL; for (st = L->top; st < ci->top; st++) setnilvalue(st); L->top = ci->top; @@ -313,6 +316,7 @@ ci->top = L->top + LUA_MINSTACK; lua_assert(ci->top <= L->stack_last); ci->nresults = nresults; + ci->fin_base = NULL; if (L->hookmask & LUA_MASKCALL) luaD_callhook(L, LUA_HOOKCALL, -1); lua_unlock(L); @@ -345,6 +349,11 @@ CallInfo *ci; if (L->hookmask & LUA_MASKRET) firstResult = callrethooks(L, firstResult); + if (L->ci->fin_base) { + ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ + luaD_finalize(L, L->ci->fin_base, 0); + firstResult = restorestack(L, fr); + } ci = L->ci--; res = ci->func; /* res == final position of 1st result */ wanted = ci->nresults; @@ -360,6 +369,94 @@ } +void luaD_reallocFIN (lua_State *L, int newsize) { + CallInfo *ci; + TValue *oldfin = L->fin_stack; + luaM_reallocvector(L, L->fin_stack, L->fin_size, newsize, TValue); + L->fin_size = newsize; + L->fin_top = (L->fin_top - oldfin) + L->fin_stack; + for (ci = L->base_ci; ci <= L->ci; ci++) + if (ci->fin_base) ci->fin_base = (ci->fin_base - oldfin) + L->fin_stack; +} + + +void luaD_growfinstack (lua_State *L, int n) { + if (n <= L->fin_size) /* double size is enough? */ + luaD_reallocFIN(L, 2*L->fin_size); + else + luaD_reallocFIN(L, L->fin_size + (n < BASIC_STACK_SIZE ? BASIC_STACK_SIZE : n)); +} + + +int luaD_finally (lua_State *L, StkId func, int scope, int when) { + StkId o; + TValue *fin; + int ncond = when==LUA_FINALWAYS ? 0 : + when==LUA_FINERROR ? 2*LUAI_MAXCSTACK : + LUAI_MAXCSTACK; /* conditional call */ + int n = L->top - func + 1; + L->fin_top += n; + if (L->fin_top - L->fin_stack >= L->fin_size) { + luaD_growfinstack(L, n); + } + fin = L->fin_top - 1; + setnvalue(fin, cast_num(ncond + --n)); + for (o = func; n-- != 0; o++) { /* push objects to finalization stack */ + setobj2n(L, --fin, o); + luaC_barrier(L, obj2gco(L), o); + } + /* set finalization base of call frame */ + { + CallInfo *ci = L->ci + scope; + lua_assert(L->base_ci <= ci); + if (!ci->fin_base) ci->fin_base = fin; + } + return fin - L->fin_stack + 1; +} + + +void luaD_finalize (lua_State *L, StkId base, int failure) { + TValue *fin; + int nmax = 0; + lua_assert(base && L->fin_stack && L->fin_stack <= base && base <= L->fin_top); + while ((fin = L->fin_top-1) > base) { + StkId o, func; + int call = 1, n; + lua_assert(ttisnumber(fin)); + n = cast_int(nvalue(fin)); + if (n >= LUAI_MAXCSTACK) { /* call on success */ + n -= LUAI_MAXCSTACK; + if (n >= LUAI_MAXCSTACK) { /* call on failure */ + n -= LUAI_MAXCSTACK; + call = failure; + } + else + call = !failure; + } + L->fin_top = fin - n; + lua_assert(L->fin_stack <= L->fin_top); + if (!call) { + fin -= n + 1; + continue; + } + if (n > nmax) { + nmax = n; + luaD_checkstack(L, n + 1); /* with error message */ + } + o = func = L->top; + fin--; + lua_assert(ttisfunction(fin)); + while (n-- != 0) /* pop objects from finalization stack */ + setobj2s(L, o++, fin--); + if (failure) + setobj2s(L, o++, func - 1); /* push error message */ + L->top = o; + luaD_call(L, func, 0); + } + if (L->ci->fin_base >= L->fin_top) L->ci->fin_base = NULL; +} + + /* ** Call a function (C or Lua). The function to be called is at *func. ** The arguments are on the stack, right after the function. @@ -428,6 +525,7 @@ if (status != 0) { /* error? */ L->status = cast_byte(status); /* mark thread as `dead' */ luaD_seterrorobj(L, status, L->top); + if (L->fin_top >= L->fin_stack) luaD_finalize(L, L->fin_stack, 1); L->ci->top = L->top; } else { @@ -459,12 +557,15 @@ ptrdiff_t old_ci = saveci(L, L->ci); lu_byte old_allowhooks = L->allowhook; ptrdiff_t old_errfunc = L->errfunc; + ptrdiff_t old_fin = savefin(L, L->fin_top); L->errfunc = ef; status = luaD_rawrunprotected(L, func, u); if (status != 0) { /* an error occurred? */ StkId oldtop = restorestack(L, old_top); + StkId fintop = restorefin(L, old_fin); luaF_close(L, oldtop); /* close eventual pending closures */ luaD_seterrorobj(L, status, oldtop); + if (fintop) luaD_finalize(L, fintop, 1); L->nCcalls = oldnCcalls; L->ci = restoreci(L, old_ci); L->base = L->ci->base; diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/ldo.h lua.mod/src/ldo.h --- lua.orig/src/ldo.h 2007-12-27 08:02:25.000000000 -0500 +++ lua.mod/src/ldo.h 2009-05-30 17:08:26.414012800 -0400 @@ -27,6 +27,9 @@ #define saveci(L,p) ((char *)(p) - (char *)L->base_ci) #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) +#define savefin(L,p) ((char *)(p) - (char *)L->fin_stack) +#define restorefin(L,n) ((TValue *)((char *)L->fin_stack + (n))) + /* results from luaD_precall */ #define PCRLUA 0 /* initiated a call to a Lua function */ @@ -47,6 +50,10 @@ LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); LUAI_FUNC void luaD_growstack (lua_State *L, int n); +LUAI_FUNC void luaD_reallocFIN (lua_State *L, int newsize); +LUAI_FUNC void luaD_growfinstack (lua_State *L, int n); +LUAI_FUNC int luaD_finally (lua_State *L, StkId func, int scope, int when); +LUAI_FUNC void luaD_finalize (lua_State *L, StkId base, int failure); LUAI_FUNC void luaD_throw (lua_State *L, int errcode); LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lgc.c lua.mod/src/lgc.c --- lua.orig/src/lgc.c 2007-12-27 08:02:25.000000000 -0500 +++ lua.mod/src/lgc.c 2009-05-30 16:36:09.388707200 -0400 @@ -40,8 +40,8 @@ #define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) -#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) -#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) +#define isfinalized(u) testbit((u)->gch.marked, FINALIZEDBIT) +#define markfinalized(u) l_setbit((u)->gch.marked, FINALIZEDBIT) #define KEYWEAK bitmask(KEYWEAKBIT) @@ -131,15 +131,27 @@ GCObject **p = &g->mainthread->next; GCObject *curr; while ((curr = *p) != NULL) { - if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) + if (!(iswhite(curr) || all) || isfinalized(curr)) p = &curr->gch.next; /* don't bother with them */ - else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { - markfinalized(gco2u(curr)); /* don't need finalization */ - p = &curr->gch.next; - } - else { /* must call its gc method */ - deadmem += sizeudata(gco2u(curr)); - markfinalized(gco2u(curr)); + else { + if (curr->gch.tt == LUA_TTHREAD) { + lua_State *th = gco2th(curr); + if (th->fin_stack == NULL || th->fin_top <= th->fin_stack) { + markfinalized(curr); /* don't need finalization */ + p = &curr->gch.next; + continue; + } + } + else { + if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { + markfinalized(curr); /* don't need finalization */ + p = &curr->gch.next; + continue; + } + /* must call its gc method */ + deadmem += sizeudata(gco2u(curr)); + } + markfinalized(curr); *p = curr->gch.next; /* link `curr' at the end of `tmudata' list */ if (g->tmudata == NULL) /* list is empty? */ @@ -241,6 +253,7 @@ static void checkstacksizes (lua_State *L, StkId max) { int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ int s_used = cast_int(max - L->stack); /* part of stack in use */ + int fin_used = cast_int(L->fin_top - L->fin_stack); /* size of finalizer stack */ if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ return; /* do not touch the stacks */ if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) @@ -250,6 +263,10 @@ 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ condhardstacktests(luaD_reallocstack(L, s_used)); + if (4*fin_used < L->fin_size && + 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->fin_size) + luaD_reallocFIN(L, L->fin_size/2); /* still big enough... */ + condhardstacktests(luaD_reallocFIN(L, fin_used)); } @@ -257,6 +274,10 @@ StkId o, lim; CallInfo *ci; markvalue(g, gt(l)); + if (l->fin_stack) { + for (o = l->fin_stack; o < l->fin_top; o++) + markvalue(g, o); + } lim = l->top; for (ci = l->base_ci; ci <= l->ci; ci++) { lua_assert(ci->top <= l->stack_last); @@ -302,7 +323,8 @@ black2gray(o); traversestack(g, th); return sizeof(lua_State) + sizeof(TValue) * th->stacksize + - sizeof(CallInfo) * th->size_ci; + sizeof(CallInfo) * th->size_ci + + sizeof(TValue) * th->fin_size; } case LUA_TPROTO: { Proto *p = gco2p(o); @@ -341,7 +363,8 @@ return 0; } return iswhite(gcvalue(o)) || - (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); + (ttisuserdata(o) && (!iskey && isfinalized(obj2gco(o)))) || + (ttisthread(o) && (!iskey && isfinalized(obj2gco(o)))); } @@ -445,28 +468,42 @@ static void GCTM (lua_State *L) { global_State *g = G(L); GCObject *o = g->tmudata->gch.next; /* get first element */ - Udata *udata = rawgco2u(o); - const TValue *tm; /* remove udata from `tmudata' */ if (o == g->tmudata) /* last element? */ g->tmudata = NULL; else - g->tmudata->gch.next = udata->uv.next; - udata->uv.next = g->mainthread->next; /* return it to `root' list */ + g->tmudata->gch.next = o->gch.next; + o->gch.next = g->mainthread->next; /* return it to `root' list */ g->mainthread->next = o; makewhite(g, o); - tm = fasttm(L, udata->uv.metatable, TM_GC); - if (tm != NULL) { - lu_byte oldah = L->allowhook; - lu_mem oldt = g->GCthreshold; - L->allowhook = 0; /* stop debug hooks during GC tag method */ - g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ - setobj2s(L, L->top, tm); - setuvalue(L, L->top+1, udata); - L->top += 2; - luaD_call(L, L->top - 2, 0); - L->allowhook = oldah; /* restore hooks */ - g->GCthreshold = oldt; /* restore threshold */ + if (o->gch.tt == LUA_TTHREAD) { + lua_State *th = gco2th(o); + if (th->fin_stack) { + lu_byte oldah = th->allowhook; + lu_mem oldt = g->GCthreshold; + th->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + luaD_finalize(th, th->fin_stack, 0); + th->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } + } + else { + Udata *udata = rawgco2u(o); + const TValue *tm; + tm = fasttm(L, udata->uv.metatable, TM_GC); + if (tm != NULL) { + lu_byte oldah = L->allowhook; + lu_mem oldt = g->GCthreshold; + L->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + setobj2s(L, L->top, tm); + setuvalue(L, L->top+1, udata); + L->top += 2; + luaD_call(L, L->top - 2, 0); + L->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } } } diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lstate.c lua.mod/src/lstate.c --- lua.orig/src/lstate.c 2008-01-03 10:20:39.000000000 -0500 +++ lua.mod/src/lstate.c 2009-05-30 16:57:46.664097600 -0400 @@ -55,12 +55,14 @@ setnilvalue(L1->top++); /* `function' entry for this `ci' */ L1->base = L1->ci->base = L1->top; L1->ci->top = L1->top + LUA_MINSTACK; + L1->ci->fin_base = NULL; } static void freestack (lua_State *L, lua_State *L1) { luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); luaM_freearray(L, L1->stack, L1->stacksize, TValue); + luaM_freearray(L, L1->fin_stack, L1->fin_size, TValue); } @@ -99,6 +101,9 @@ L->savedpc = NULL; L->errfunc = 0; setnilvalue(gt(L)); + L->fin_stack = NULL; + L->fin_top = NULL; + L->fin_size = 0; } @@ -118,7 +123,11 @@ lua_State *luaE_newthread (lua_State *L) { lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); - luaC_link(L, obj2gco(L1), LUA_TTHREAD); + /*luaC_link(L, obj2gco(L1), LUA_TTHREAD);*/ + L1->marked = luaC_white(G(L)); + L1->tt = LUA_TTHREAD; + L1->next = G(L)->mainthread->next; + G(L)->mainthread->next = obj2gco(L1); preinit_state(L1, G(L)); stack_init(L1, L); /* init stack */ setobj2n(L, gt(L1), gt(L)); /* share table of globals */ @@ -133,6 +142,8 @@ void luaE_freethread (lua_State *L, lua_State *L1) { luaF_close(L1, L1->stack); /* close all upvalues for this thread */ + /*if (L1->fin_stack) luaD_finalize(L1, L1->fin_stack, 0); thread is finalized by GC */ + lua_assert(L1->fin_stack == NULL || L1->fin_top <= L1->fin_stack); lua_assert(L1->openupval == NULL); luai_userstatefree(L1); freestack(L, L1); @@ -200,6 +211,7 @@ L = G(L)->mainthread; /* only the main thread can be closed */ lua_lock(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ + if (L->fin_stack) luaD_finalize(L, L->fin_stack, 0); luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ L->errfunc = 0; /* no error function during GC metamethods */ do { /* repeat until no more errors */ diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lstate.h lua.mod/src/lstate.h --- lua.orig/src/lstate.h 2008-01-03 10:20:39.000000000 -0500 +++ lua.mod/src/lstate.h 2009-05-30 16:50:27.622787200 -0400 @@ -52,6 +52,7 @@ const Instruction *savedpc; int nresults; /* expected number of results from this function */ int tailcalls; /* number of tail calls lost under this entry */ + StkId fin_base; /* start of the finalization stack */ } CallInfo; @@ -124,6 +125,9 @@ GCObject *gclist; struct lua_longjmp *errorJmp; /* current error recover point */ ptrdiff_t errfunc; /* current error handling function (stack index) */ + StkId fin_stack; /* finalization stack */ + StkId fin_top; /* first free slot in the finalization stack */ + int fin_size; /* size of finalization stack */ }; diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lua.h lua.mod/src/lua.h --- lua.orig/src/lua.h 2008-08-06 09:30:12.000000000 -0400 +++ lua.mod/src/lua.h 2009-05-30 16:04:14.465182400 -0400 @@ -244,6 +244,19 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); +/* +** finalization functions +*/ + +#define LUA_FINALWAYS 0 +#define LUA_FINSUCCESS 1 +#define LUA_FINERROR 2 + +LUA_API int lua_getfinalframe (lua_State *L); +LUA_API int lua_finally (lua_State *L, int nargs, int scope, int when); +LUA_API void lua_finalize (lua_State *L, int base, int failure); + + /* ** =============================================================== diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/lvm.c lua.mod/src/lvm.c --- lua.orig/src/lvm.c 2007-12-28 10:32:23.000000000 -0500 +++ lua.mod/src/lvm.c 2009-05-30 16:41:32.262977600 -0400 @@ -613,6 +613,7 @@ StkId func = ci->func; StkId pfunc = (ci+1)->func; /* previous function index */ if (L->openupval) luaF_close(L, ci->base); + if (ci->fin_base) luaD_finalize(L, ci->fin_base, 0); L->base = ci->base = ci->func + ((ci+1)->base - pfunc); for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ setobjs2s(L, func+aux, pfunc+aux); --Multipart_Mon__3_Aug_2009_18_20_34_-0400_IZqEKG1rT6c9ktTt-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 19:53:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n73Mr7ED017678; Mon, 3 Aug 2009 19:53:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F0EC192C4; Mon, 3 Aug 2009 19:52:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-144.bluehost.com (outbound-mail-144.bluehost.com [67.222.38.34]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3675C19287 for ; Mon, 3 Aug 2009 19:52:20 -0300 (BRT) Received: (qmail 18914 invoked by uid 0); 3 Aug 2009 22:52:17 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy5.bluehost.com with SMTP; 3 Aug 2009 22:52:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=Q4AfFNdDIR3Z7emI4ClXxEtL1SdI+usPAbMho62yOpDchGGfPVZH8bnBCQg3/xtj4oyXBtgu9zEaCngIzVwFGXW1AjjxluwbxpRezyXet15Y8mNNTGws9YAlOvCynIIf; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MY6O8-0000Ut-JZ for lua@bazar2.conectiva.com.br; Mon, 03 Aug 2009 16:52:16 -0600 Date: Mon, 3 Aug 2009 18:52:14 -0400 From: TNHarris To: Lua list Subject: Re: Compiler error on IBM XL for AIX Message-ID: <20090803185214.4b9cde6b@egeria.whoopdedo.org> In-Reply-To: <121518210.20090803213207@gmail.com> References: <20090803132625.A31625@lua.tecgraf.puc-rio.br> <3cdcefb80908031014n7b8dda97x551050ede86b299f@mail.gmail.com> <121518210.20090803213207@gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 3 Aug 2009 21:32:07 +0400 Bulat Ziganshin wrote: > > but ill-formed client may silently return instead of producing error. > smth like L!=L+1 would be better if we may find way to fool any C > compiler :) > Some compilers will complain that the expression is always true, then. I think conditionally adding the return statement for misbehaving compilers is the most reasonable solution. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Mon Aug 3 23:58:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n742wtXq012271; Mon, 3 Aug 2009 23:58:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67F7118EDB; Mon, 3 Aug 2009 23:58:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D846A18CE6 for ; Mon, 3 Aug 2009 23:58:17 -0300 (BRT) Received: by ewy26 with SMTP id 26so4567385ewy.5 for ; Mon, 03 Aug 2009 19:58:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.43.10 with SMTP id q10mr8321240ebq.23.1249354695749; Mon, 03 Aug 2009 19:58:15 -0700 (PDT) In-Reply-To: <90eb1dc70908031346t25b5de79r3eb4e45fffb15877@mail.gmail.com> References: <90eb1dc70908031346t25b5de79r3eb4e45fffb15877@mail.gmail.com> Date: Mon, 3 Aug 2009 22:58:15 -0400 X-Google-Sender-Auth: 41a01019097fe620 Message-ID: Subject: Re: matrix operations and temporary objects? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 4:46 PM, Javier Guerra wrote: > two ideas: (not that i have done anything similar) > > 1: parse a user string with the whole expression to build the operating objects: > ... > 2: override operators in your userdata; but don't make them calculate, > make them generate the calculators, a bit like LPEG constructing > operators Similar types of things have been done in [1-4]. [1] http://lua-users.org/wiki/ListComprehensions [2] http://lua-users.org/wiki/ExpressionTemplatesInLua [3] http://lua-users.org/wiki/SourcePreprocessing [4] http://met.sourceforge.net/ (C++) From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 00:49:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n743nEJu017045; Tue, 4 Aug 2009 00:49:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D74618FB7; Tue, 4 Aug 2009 00:48:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E2D918F02 for ; Tue, 4 Aug 2009 00:48:43 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so1893454ana.26 for ; Mon, 03 Aug 2009 20:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=5kpwZemB1xe7WyAV7X3lGlFiuIsYC3DP0isX/fjf3jE=; b=t3DR3IoqrGjtLCnuvWPB243RfVTA9D8zbE7qJWnp7Nnri3y5n8FkcHxE+oVCxtCxtU XrfdLluwOd5A5BZ2W9VKNwk2vYXlQR9rH/w5YX0fYVQz/H77ITK1UNAZVAfg9Pb/+NiJ 6wncNYdKp0yfXix1nXhSM2PnZ5iZsk4wIxCjI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Jyq3QxJtfB5P/2KLB0mCA1QKxoBAbHzxTI8TrlW3Qt1y+A/eCtnY2Jz4gJ9DgQva8F qrz2L2uPO6hyE1hV/N4zRenIGO7DK+3XUeUmmwrPRHURFuY+LkjUsAZQNRQ1khbgfUGe wr+BUPx0A/BXPZNf5m+r/cx5RqgeiwaQhSXHA= MIME-Version: 1.0 Received: by 10.100.154.9 with SMTP id b9mr8133683ane.11.1249357721466; Mon, 03 Aug 2009 20:48:41 -0700 (PDT) In-Reply-To: <8a25d01b0907251002j66f02ac4pf653b246d29f9052@mail.gmail.com> References: <8a25d01b0907251002j66f02ac4pf653b246d29f9052@mail.gmail.com> Date: Mon, 3 Aug 2009 23:48:41 -0400 X-Google-Sender-Auth: cab407dd74d2187c Message-ID: Subject: Re: lua-tokyotyrant From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > http://github.com/phoenixsol/lua-tokyotyrant > > Implements all features of Mikio Hirabayashi's tokytyrant.rb, but needs > testing. Nice. I just tested it as a storage option for Sputnik and it seems to pass the smoke test at least. Any chance of making this available via LuaRock? (LR is currently missing a rockspec for struct, but I wrote one and will submit it to Hisham. If it gets accepted, then LR will have all the dependencies.) - yuri -- http://spu.tnik.org/ From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 01:12:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n744CviV019047; Tue, 4 Aug 2009 01:12:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD37C18A9B; Tue, 4 Aug 2009 01:12:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail2.edulinksys.com (mail2.edulinksys.com [67.151.130.237]) by bazar2.conectiva.com.br (Postfix) with SMTP id 97B0018EDB for ; Tue, 4 Aug 2009 01:12:31 -0300 (BRT) Received: from ESS5 ([127.0.0.1]) by mail2.edulinksys.com with hMailServer ; Mon, 3 Aug 2009 21:12:28 -0700 Received: from [192.168.111.112] ([67.151.130.226] helo=[192.168.111.112]) with IPv4:25 by ASSP.nospam; 3 Aug 2009 21:12:28 -0700 Message-ID: <4A77B52A.4040607@edulinksys.com> Date: Mon, 03 Aug 2009 21:12:26 -0700 From: Evan Burkitt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090408 Eudora/3.0b2 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Using part of a Lua script from C Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have an application that calls functions in Lua scripts from C (C++, actually). My design expects a certain function, "filter()", to exist in the scripts it uses. filter() typically calls other functions in the script as part of its behavior, but the C/C++ code doesn't know of or use these other functions. The scripts also contain a section of code that calls filter(). This exists so the script as a whole can be run stand-alone via the lua command line. Here's a minimal illustration of what my lua script looks like: --internal functions: function internal1() end function internal2() end --function called by C/C++: function filter(a,b) internal1() internal2() end --code to allow the script to run stand-alone: a = 1 b = 2 filter(a,b) When I load and compile the script via luaL_loadfile() and lua_pcall(), the code at the end begins to execute when I call lua_pcall(). My question is, what is the best way to process the script file so that my C/C++ code can call filter() yet the entire script does get executed in the process? -evan From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 02:00:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7450E6k024105; Tue, 4 Aug 2009 02:00:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18CC719149; Tue, 4 Aug 2009 01:59:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46B31190F7 for ; Tue, 4 Aug 2009 01:59:42 -0300 (BRT) Received: by ywh26 with SMTP id 26so4910486ywh.5 for ; Mon, 03 Aug 2009 21:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9PKgXySMH5pmTP1FoTaa4rh4ip33tj09n7YWdjYgTek=; b=rdUunAY0Rr5tHvr7IxeAMFGzmmk6159rZuRNTNl4i7J6MYIpoio33BKoloJZ4mNYlO c6Ueef6QqjE+V+6+Ib3qV3PbMciVp9Xwr7NYkEdmtJ7MIiWNdYCJfl/KtaXNbqNM+ORI 5ssqi6dJA/EQGWHNfB96z+u3uJGHIx6z875nw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vUpr3dR5vmmhB5OGWiJJDZuELtlCPu0F5g746h5C+AnU1v7/yXU0/CI8dn79NSskS4 4/18WaKT3GI80LfA1AbQ6MQSLLPONDwDnUlrnEpGwlfaStTwbocuwtmnonMi80319tkH 0Z+lb9jqinMN29EjNxxhnA7IPSBp1s+xf8hR8= MIME-Version: 1.0 Received: by 10.150.230.8 with SMTP id c8mr10891346ybh.314.1249361981224; Mon, 03 Aug 2009 21:59:41 -0700 (PDT) In-Reply-To: <4A77B52A.4040607@edulinksys.com> References: <4A77B52A.4040607@edulinksys.com> Date: Mon, 3 Aug 2009 21:59:41 -0700 Message-ID: <1079b050908032159k787c1e0cpfe73b62dc44f6352@mail.gmail.com> Subject: Re: Using part of a Lua script from C From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Obviously you could do some basic string matching on the script to clip it to the appropriate length. You could also do something pretty basic like: // in C lua_pushboolean(L, 1); lua_setglobal(L, "global_var_set_by_app") --internal functions: function internal1() end function internal2() end --function called by C/C++: function filter(a,b) internal1() internal2() end --code to allow the script to run stand-alone: if(not global_var_set_by_app) then a = 1 b = 2 filter(a,b) end From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 02:01:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7451Jgu024327; Tue, 4 Aug 2009 02:01:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42C1819183; Tue, 4 Aug 2009 02:01:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 499821917B for ; Tue, 4 Aug 2009 02:00:55 -0300 (BRT) Received: by qyk34 with SMTP id 34so3489547qyk.33 for ; Mon, 03 Aug 2009 22:00:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.71.207 with SMTP id i15mr5835617vcj.77.1249362053088; Mon, 03 Aug 2009 22:00:53 -0700 (PDT) In-Reply-To: References: <8a25d01b0907251002j66f02ac4pf653b246d29f9052@mail.gmail.com> From: Phoenix Sol Date: Tue, 4 Aug 2009 00:00:33 -0500 Message-ID: <8a25d01b0908032200m4d4e95bfm31d594fa3eacd8f8@mail.gmail.com> Subject: Re: lua-tokyotyrant To: Lua list Content-Type: multipart/alternative; boundary=0016e646064e5ec64d047049c5d1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e646064e5ec64d047049c5d1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Oh, gee whiz; I forgot to say "[ANN]". On Mon, Aug 3, 2009 at 10:48 PM, Yuri Takhteyev wrote: > > http://github.com/phoenixsol/lua-tokyotyrant > > > > Implements all features of Mikio Hirabayashi's tokytyrant.rb, but needs > > testing. > > Nice. I just tested it as a storage option for Sputnik and it seems to > pass the smoke test at least. The smoke test... I like the sound of that. Thanks, Yuri. Don't get any funny ideas, though; it's probably buggy as hell. There is much of it that I have yet to test at all. I intend to write a complete set of tests soon... Any chance of making this available via LuaRock? (LR is currently > missing a rockspec for struct, but I wrote one and will submit it to > Hisham. If it gets accepted, then LR will have all the dependencies.) Yeah, sure. I have been meaning to look at this 'rockspec' thing one of these days; I like LuaRocks. Respect, Phoenix Sol PS, [ANN] --0016e646064e5ec64d047049c5d1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oh, gee whiz; I forgot to say "[ANN]".

On Mon, Aug 3, 2009 at 10:48 PM, Yuri Takhteyev &= lt;yuri@sims.berkeley.edu>= wrote:
> http://github.com/phoenixsol/lua-tokyotyrant
>
> Implements all features of Mikio Hirabayashi's tokytyrant.rb, but = needs
> testing.

Nice. I just tested it as a storage option for Sputnik and it seems t= o
pass the smoke test at least.

The smoke test...=A0 I l= ike the sound of that.=A0 Thanks, Yuri.

Don't get any funny idea= s, though; it's probably buggy as hell. There is much of it that I have= yet to test at all.
I intend to write a complete set of tests soon...

Any chance of making this available via LuaRock? (LR is currently
missing a rockspec for struct, but I wrote one and will submit it to
Hisham. If it gets accepted, then LR will have all the dependencies.)

Yeah, sure. I have been meaning to look at this 'rocksp= ec' thing one of these days; I like LuaRocks.

Respec= t,
Phoenix Sol

PS,=A0 [ANN]

--0016e646064e5ec64d047049c5d1-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 02:03:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7453ctH024542; Tue, 4 Aug 2009 02:03:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52595191D5; Tue, 4 Aug 2009 02:03:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D247A190B4 for ; Tue, 4 Aug 2009 02:03:16 -0300 (BRT) Received: by bwz6 with SMTP id 6so3855592bwz.5 for ; Mon, 03 Aug 2009 22:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=YawmwauXml5JxDJRVZE2XykoGyow4NGRIgZPqRXGlj0=; b=xjqmAzb0ubFFQw/IX87zC9lsElHUTImodWgr+ncevt6PSuUjTeJi2dGKycGuGg77mH HwhtnDRfMUYoFI10aNE3Ihd1qmPJJLH5NiXIfu672915tFu1tLSNhCSnR4kkeX2H4plD +2zTefyVhXviM+zBbsDnluos4ynwFD/+C8H6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=H3kWIC8SG9+SFnqBoKz3CQGzTTYOhv4m6Ewu9UeYuKunojWt5FlzA767zH5DReOhOg EP47anT8Z5IcnPPSNi9YDT8TMdkd8YS3t9cF7eI4sDNdCuskDZDfOS9nhsEPRC3al9Pj VOcocGpMTmqQrXTOLUmyVsnJtun6C5oPPuypk= MIME-Version: 1.0 Received: by 10.204.122.141 with SMTP id l13mr5696957bkr.106.1249362194793; Mon, 03 Aug 2009 22:03:14 -0700 (PDT) In-Reply-To: References: <8a25d01b0907251002j66f02ac4pf653b246d29f9052@mail.gmail.com> From: Hisham Date: Tue, 4 Aug 2009 02:02:54 -0300 Message-ID: <5e7d91620908032202p126cee37pcdd12b155d01db0e@mail.gmail.com> Subject: Re: lua-tokyotyrant To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 12:48 AM, Yuri Takhteyev wrote: >> http://github.com/phoenixsol/lua-tokyotyrant >> >> Implements all features of Mikio Hirabayashi's tokytyrant.rb, but needs >> testing. > > Nice. I just tested it as a storage option for Sputnik and it seems to > pass the smoke test at least. > > Any chance of making this available via LuaRock? (LR is currently > missing a rockspec for struct, but I wrote one and will submit it to > Hisham. If it gets accepted, then LR will have all the dependencies.) Thanks for the submission -- your struct rockspec is already in the repository. :) -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 03:09:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7469rTH029464; Tue, 4 Aug 2009 03:09:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11C2C18C8B; Tue, 4 Aug 2009 03:09:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E6C518B9F for ; Tue, 4 Aug 2009 03:09:21 -0300 (BRT) Received: by fxm25 with SMTP id 25so3988524fxm.5 for ; Mon, 03 Aug 2009 23:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FhDZ+i8P7VglKwyAeL/PVGphAv564ZEY+dQdN7BMIPk=; b=Cmfno0mPVsFHV4dARfq45B0iT4sl0KxY7XcOyVILIBaxzC9Ppea5M076SpYgVFLBBM zahlVal2ogBKoDWxLu+89H3OiYinKQJ7t6p4h3HKQCvIkyHGVQ/eAEWswgBv+5ohOjr8 yhaa/4fWTF3+ldhw1FzQipuQQzbQpRfFInyh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=auV6DDmjClO00YCvlKH2sPXe+Hu/U/pZb6t1QWD7ytKaxffeKJO2iqxPPzCsS3VF3W wnr0m4kWW2YOSQDRfJIqbMQp3KeFtZbKxmG/38/wJpWvBimD19D/Xxc8WIu1JI3eIxxY 3nb/U/zrBxnalNUHADaIJNi4Fjz2vNZdRhVxo= MIME-Version: 1.0 Received: by 10.239.135.78 with SMTP id c14mr701654hbc.102.1249366160044; Mon, 03 Aug 2009 23:09:20 -0700 (PDT) In-Reply-To: <97d148f50908031247n41db4dffx1ac58ee7e5be3615@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <20090803155856.A32680@lua.tecgraf.puc-rio.br> <97d148f50908031247n41db4dffx1ac58ee7e5be3615@mail.gmail.com> Date: Tue, 4 Aug 2009 08:09:19 +0200 Message-ID: <560972290908032309i7d9e4164tc23a0f8bd04d2c6f@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 9:47 PM, Colin wrote: > > Presumably there are some other reasons for this design decision. > Actually, I darkly remember something, let's check... Yes, the > "Evolution" paper on Lua says "Because the language allows coercion of > strings to numbers, a + signal would be ambiguous; so, we created the > syntax .. (two dots) for that operation [concatenation]." >From my limited Javascript experience, you get ugly messes! Just one of things which makes lua->JS/JS->lua translation harder than it might appear at first. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 04:00:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7470p4Z000595; Tue, 4 Aug 2009 04:00:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCCEC19178; Tue, 4 Aug 2009 04:00:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 813AD18FCC for ; Tue, 4 Aug 2009 04:00:19 -0300 (BRT) Received: by fxm25 with SMTP id 25so4006487fxm.5 for ; Tue, 04 Aug 2009 00:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=m//mj+bUSAREJjZzn9t4zSV+DZ4OP0Yr7nbE9fbTGwE=; b=eBEjuxxZ5LlKM/p2QHWHqdjKIO9vL8OWut7YMQil6j6AALMz58PNzqcvq+c7xp0SXG 5SE99aTf6qzTWWsJ1A6N5IQGSbxJrJfZUIgNYmvbXj7YOiHedxus0Eyk1BX4TrgEwx4m dCMeXxwQksZcUzTqG/yxaaq0of/wJ3f1HhszM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OAHQ8Eylhl+UPCXlIwSG3K4RcAwHrUA4aepI3dA7/czHQM6mbikiqtn/qNvVkkW+Y0 i2v0h/eCpjvzPcP25LwQFjXaRpcbyOBnjggHY69QphETYzUU2lBOgbvdZBSzJoDFsGvs MF5hbCkWewdXr1Ci06g9VNZlY1m/UzN3C+NYc= MIME-Version: 1.0 Received: by 10.239.154.137 with SMTP id e9mr733090hbc.153.1249369217894; Tue, 04 Aug 2009 00:00:17 -0700 (PDT) In-Reply-To: <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> Date: Tue, 4 Aug 2009 09:00:17 +0200 Message-ID: <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 8:54 PM, Colin wrote: >> This is what comes from making wild assertions, the dark side of the >> chatty-and-relaxed approach to writing tutorials. > > (I hope you don't become discouraged too easily, would be a shame.) Not a chance! I'm an engineer by inclination, if not by training (was a theoretical physicist at one point), I must just remember not to use the word 'mathematics'. The basic purpose of this (unofficial) FAQ is to provide a resource where the curious can find information, that they would otherwise end up asking here. So I'm looking for 'problem patterns'. And I need contributions from people with other areas of expertise, although I'm appreciating the feedback so far. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 04:10:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7479whJ003044; Tue, 4 Aug 2009 04:09:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B0721920F; Tue, 4 Aug 2009 04:09:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailrelay2.kpn.net (mailrelay2.kpn.net [194.151.226.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 195D519104 for ; Tue, 4 Aug 2009 04:09:26 -0300 (BRT) Received: from boskalis.nl (mail.boskalis.nl [193.173.151.149]) by mailrelay2.kpn.net (8.13.6/8.13.6) with ESMTP id n7479MOx018879 for ; Tue, 4 Aug 2009 09:09:24 +0200 (CEST) Received: from nlhub002.rbw-nl.boskalis.net ([192.168.7.62]) by mail.boskalis.nl with SMTP id n7479MQI015513 for ; Tue, 4 Aug 2009 09:09:22 +0200 Received: from nlmbx002.rbw-nl.boskalis.net ([10.10.1.89]) by nlhub002.rbw-nl.boskalis.net with Microsoft SMTPSVC(6.0.3790.3959); Tue, 4 Aug 2009 09:09:59 +0200 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Using part of a Lua script from C Date: Tue, 4 Aug 2009 09:09:21 +0200 Message-ID: In-Reply-To: <4A77B52A.4040607@edulinksys.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Using part of a Lua script from C thread-index: AcoUue3NfDTbMro2S66Skc+ot4J2CgAFmUXQ References: <4A77B52A.4040607@edulinksys.com> From: "Elbers, H.P." To: "Lua list" X-OriginalArrivalTime: 04 Aug 2009 07:09:59.0066 (UTC) FILETIME=[93E88FA0:01CA14D2] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7479whJ003044 Hi Evan, You can test the the value of 'arg': When using the interpreter arg[-1] will be Lua, argv[0] will be the name of your script. When loaded with luaL_dofile (or luaL_loadfile), arg will be nil. --code to allow the script to run stand-alone: if arg then a = 1 b = 2 filter(a,b) end HtH, Hans Elbers. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br > [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Evan Burkitt > Sent: dinsdag 4 augustus 2009 6:12 > To: lua@bazar2.conectiva.com.br > Subject: Using part of a Lua script from C > > I have an application that calls functions in Lua scripts > from C (C++, actually). My design expects a certain function, > "filter()", to exist in the scripts it uses. filter() > typically calls other functions in the script as part of its > behavior, but the C/C++ code doesn't know of or use these > other functions. > > The scripts also contain a section of code that calls > filter(). This exists so the script as a whole can be run > stand-alone via the lua command line. > > Here's a minimal illustration of what my lua script looks like: > --internal functions: > function internal1() end > function internal2() end > > --function called by C/C++: > function filter(a,b) > internal1() > internal2() > end > > --code to allow the script to run stand-alone: > a = 1 > b = 2 > filter(a,b) > > When I load and compile the script via luaL_loadfile() and > lua_pcall(), the code at the end begins to execute when I > call lua_pcall(). > > My question is, what is the best way to process the script > file so that my C/C++ code can call filter() yet the entire > script does get executed in the process? > > -evan > > From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 04:28:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n747St7f004670; Tue, 4 Aug 2009 04:28:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E79DE1924D; Tue, 4 Aug 2009 04:28:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from saarni.dnainternet.net (saarni.dnainternet.net [83.102.40.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8111D1920D for ; Tue, 4 Aug 2009 04:28:28 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by saarni.dnainternet.net (Postfix) with ESMTP id CDE1AE680C for ; Tue, 4 Aug 2009 10:28:26 +0300 (EEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Debian amavisd-new at !change-mydomain-variable!.example.com X-Spam-Flag: NO X-Spam-Score: -2.312 X-Spam-Level: X-Spam-Status: No, score=-2.312 tagged_above=-9999 required=7 tests=[BAYES_00=-2.312] Received: from saarni.dnainternet.net ([83.102.40.136]) by localhost (saarni.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id yLrdpYk39ApP for ; Tue, 4 Aug 2009 10:28:26 +0300 (EEST) Received: from luumupuu.dnainternet.net (luumupuu.dnainternet.net [83.102.40.213]) by saarni.dnainternet.net (Postfix) with ESMTP id 8D5BEE668B for ; Tue, 4 Aug 2009 10:28:26 +0300 (EEST) Received: from suomenpihlaja.dnainternet.net (unknown [83.102.40.46]) by luumupuu.dnainternet.net (Postfix) with ESMTP id 8586F2BAF2 for ; Tue, 4 Aug 2009 10:28:26 +0300 (EEST) Received: by suomenpihlaja.dnainternet.net (Postfix, from userid 33) id 7D6D2405C; Tue, 4 Aug 2009 10:28:26 +0300 (EEST) Date: Tue, 04 Aug 2009 10:28:26 +0300 From: =?UTF-8?Q?Asko_Kauppi?= Subject: Re: matrix operations and temporary objects? To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=UTF-8 Content-Description: Mailbody Content-Disposition: inline User-Agent: Taajama X-Mailer: Taajama Webmail Message-Id: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean I'd like to make a point that such GC-avoiding optimizations only make sense (imho) when matrices are rather small in size. That is, when the pure mathematical time taken does not grow essential. Or am I wrong? We're currently using Lua for matrix calculations with matrix sizes around 50x60 to 500x600. Operations are SSE optimized, but we do not do any operation merging or GC avoidance. - asko 04.08.2009 05:58, David Manura kirjoitti: > On Mon, Aug 3, 2009 at 4:46 PM, Javier Guerra wrote: > > two ideas: (not that i have done anything similar) > > > > 1: parse a user string with the whole expression to build the operating > objects: > > ... > > 2: override operators in your userdata; but don't make them calculate, > > make them generate the calculators, a bit like LPEG constructing > > operators > > Similar types of things have been done in [1-4]. > > [1] http://lua-users.org/wiki/ListComprehensions > [2] http://lua-users.org/wiki/ExpressionTemplatesInLua > [3] http://lua-users.org/wiki/SourcePreprocessing > [4] http://met.sourceforge.net/ (C++) > From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 05:41:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n748fchC010409; Tue, 4 Aug 2009 05:41:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE57819257; Tue, 4 Aug 2009 05:41:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D49D19180 for ; Tue, 4 Aug 2009 05:41:05 -0300 (BRT) Received: by fxm25 with SMTP id 25so4050876fxm.5 for ; Tue, 04 Aug 2009 01:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Y5bdFu/BnvLZtLqqmc5hmRPHqPqDI/nXY45s4VdMFWM=; b=LjAqjxgcsDIkKObdC2UetpwHCbiKOXASJtTwEftIhddwBnpIvtuL0ub/trnB6ramJB 7oRCVoxIeWdTNGEtTxfli1sjQxoIKZE3244JBcGLfopJdjrScreIy4GZBgLCYMNsmwfx igbIIqRBjbzuWTD5NZVkovS2jYk6ViLMGm0vw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=BFGVI13IyX+6eYWSaxQRyBCH+jtbg2066hcY+qaOyk+HMYiI5lmFkSvqOH7KWGoqlG W8AR9k0ICyn8v1qMom87M2EssWHphlK9sTbAVIvtwKw1Zl6sZmsGe8QsfTs7pmx5OG6a zdlmaDHAZfD5zXIzf9Hj7BMNeNYfMlXD9yAoE= MIME-Version: 1.0 Received: by 10.239.131.143 with SMTP id 15mr178276hbn.140.1249375262846; Tue, 04 Aug 2009 01:41:02 -0700 (PDT) In-Reply-To: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> References: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> Date: Tue, 4 Aug 2009 10:41:02 +0200 Message-ID: <560972290908040141h2556d91am8d51f99c406ec31b@mail.gmail.com> Subject: Re: matrix operations and temporary objects? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 9:28 AM, Asko Kauppi wrote: > We're currently using Lua for matrix calculations with matrix sizes around 50x60 to 500x600. Operations are SSE optimized, but we do not do any operation merging or GC avoidance. So the question is, is worrying about this premature optimization? Do we have some numbers? steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 05:48:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n748mKgh010973; Tue, 4 Aug 2009 05:48:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92CC81928B; Tue, 4 Aug 2009 05:48:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16C621921E for ; Tue, 4 Aug 2009 05:47:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so4706118ewy.5 for ; Tue, 04 Aug 2009 01:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Nhtf4bnp5QfM+Z7Tq/IAj4U3yRyYsEEucIHFMz/2FA8=; b=U/vjCUMqx8vxP5FEwcxYoQSaZ5qzdUaRG6XbBHydI8mMTPRulTddDeIuxEx+siAuaH OC4LQdXZJK1pvTaDOuA+M/UID6Jno7vylZvIPvAguA0mrvQ0IAPjWG5zwNwHZnPTSfqF iuDGyFfq4QN9AtkGgiLJ5ae5uw9GERz73Iy5Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=LP4MF0GZX7kmI2vTdhZPdxLo5DY9ehQOkRw7qZbjgWowjArCFMAz8AYZaLVeNNv4fN ub/jcNA+ZnCqfxtbHyQPMYmngeIqd54CZLoPBtHr4YtNDfPfMFQbrsSyja8M7oP4nElY tJewJftJyIc3MLCyyJr8NDltaNIxTiHo+oEeg= MIME-Version: 1.0 Received: by 10.216.89.137 with SMTP id c9mr1422754wef.80.1249375673110; Tue, 04 Aug 2009 01:47:53 -0700 (PDT) In-Reply-To: <4A77B52A.4040607@edulinksys.com> References: <4A77B52A.4040607@edulinksys.com> From: Jerome Vuarand Date: Tue, 4 Aug 2009 10:47:33 +0200 Message-ID: <89d273ba0908040147oc31f9bat32e44adc3bad300@mail.gmail.com> Subject: Re: Using part of a Lua script from C To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/4 Evan Burkitt : > I have an application that calls functions in Lua scripts from C (C++, > actually). My design expects a certain function, "filter()", to exist in the > scripts it uses. filter() typically calls other functions in the script as > part of its behavior, but the C/C++ code doesn't know of or use these other > functions. > > The scripts also contain a section of code that calls filter(). This exists > so the script as a whole can be run stand-alone via the lua command line. > > Here's a minimal illustration of what my lua script looks like: > --internal functions: > function internal1() end > function internal2() end > > --function called by C/C++: > function filter(a,b) > internal1() > internal2() > end > > --code to allow the script to run stand-alone: > a = 1 > b = 2 > filter(a,b) > > When I load and compile the script via luaL_loadfile() and lua_pcall(), the > code at the end begins to execute when I call lua_pcall(). > > My question is, what is the best way to process the script file so that my > C/C++ code can call filter() yet the entire script does get executed in the > process? You can pass a value to the script when you load it from your app, and check for that parameter inside the script. If it's present you're within your app (or another app (like a unit test) that wants your script to believe it's in your app). If the parameter is absent you can assume your script was run standalone (or with dofile). From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 06:14:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n749EUQ4012862; Tue, 4 Aug 2009 06:14:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5397E1928C; Tue, 4 Aug 2009 06:14:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F3B419219 for ; Tue, 4 Aug 2009 06:14:00 -0300 (BRT) Received: by yxe5 with SMTP id 5so2745134yxe.33 for ; Tue, 04 Aug 2009 02:13:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.33.137 with SMTP id h9mr1993184ibd.15.1249377238782; Tue, 04 Aug 2009 02:13:58 -0700 (PDT) In-Reply-To: <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> Date: Tue, 4 Aug 2009 03:13:58 -0600 Message-ID: <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n749EUQ4012862 Hi Steve, On Tue, Aug 4, 2009 at 1:00 AM, steve donovan wrote: > On Mon, Aug 3, 2009 at 8:54 PM, Colin wrote: >>> This is what comes from making wild assertions, the dark side of the >>> chatty-and-relaxed approach to writing tutorials. >> >> (I hope you don't become discouraged too easily, would be a shame.) > > Not a chance! I'm an engineer by inclination, if not by training (was > a theoretical physicist at one point), I must just remember not to use > the word 'mathematics'. > > The basic purpose of this (unofficial) FAQ is to provide a resource > where the curious can find information, that they would otherwise end > up asking here.  So I'm looking for 'problem patterns'. > > And I need contributions from people with other areas of expertise, > although I'm appreciating the feedback so far. I like most of what you're doing there. I think an additional tagging organization would be useful as well, so that, someone looking for help with tables could see all the relevant questions for them. Perhaps I missed it somewhere, but how do we contribute? -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 06:27:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n749Repw013796; Tue, 4 Aug 2009 06:27:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FC77192A4; Tue, 4 Aug 2009 06:27:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4628B1927F for ; Tue, 4 Aug 2009 06:27:15 -0300 (BRT) Received: by bwz6 with SMTP id 6so3957856bwz.5 for ; Tue, 04 Aug 2009 02:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=grylWYeeDWtrE5fcHYYEGPn512IyaDVSPQFePFbGsxQ=; b=wvE69ZDmG+vkfFvEjgjrHfhWsviLGfyzgAPBGYnZd6Y3fV/RpUtgP/XdUBEKudpA0J nHNPvYmOVQBTzoo3ZIktqxA5xBW0a8HaJ+qBCaEDbHjf5Q+kO+bbp69o5CgOUd7zI9Ru P0ICTsn/mKF/RHXRA1gG0ZyWQ+uPZEiwp8QwM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=j3jexK1gHlTgPK1DsWhFo/E9OBQq1ADh5O9yV3Cwf6NW7W6ibuB6sx3/XuZIxdtKi9 nKUtvYMV6wlsVDnQuWMMuRQSy/NtO9uXl1JajRDTDr0iBi0OBnXNxquKKNejJNpXF9u5 UYfG81GFH3KBT0LHld/347v0L7vjWznxcX6gg= MIME-Version: 1.0 Received: by 10.239.153.193 with SMTP id a1mr623556hbc.105.1249378033021; Tue, 04 Aug 2009 02:27:13 -0700 (PDT) In-Reply-To: <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> Date: Tue, 4 Aug 2009 11:27:12 +0200 Message-ID: <560972290908040227o646bd5c8rb553db4bdb50f5a1@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 11:13 AM, Patrick Donnelly wrote: > I like most of what you're doing there. I think an additional tagging > organization would be useful as well, so that, someone looking for > help with tables could see all the relevant questions for them. That seems possible - I'm already using a hacked markdown.lua which automatically does a TOC. That kind of extra structure becomes important as the thing gets larger, eventually a single HTML document doesn't really cut it! There was a request for numbering items, which is cool, except when the document is re-ordered. > Perhaps I missed it somewhere, but how do we contribute? (1) edit the markdown source and post diffs against it (2) just post items in markdown format for us to discuss (3) Put comments here: http://lua-users.org/wiki/UnofficialFaqDiscussion Contributions are most welcome - one area that needs filling out is all those pesky corner cases of the C API, but also the simple stuff like 'iterating over a table in C'. Another place which is crying out for attention is the section on Web Programming, which has precisely one sentence. steve d From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 06:52:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n749quOQ015502; Tue, 4 Aug 2009 06:52:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B85718CAD; Tue, 4 Aug 2009 06:52:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B36018BD4 for ; Tue, 4 Aug 2009 06:52:27 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so1119837fgg.5 for ; Tue, 04 Aug 2009 02:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=QX9+xL4rv/wF590CdVxtCL5vL2x1inw4RSoBHmxjy54=; b=LQzTpboKK0uBJZvvrd+77jBKCafq7ZgRGpyPOZETdEdu8dVM9x00mO2+4NTUQEpzUB 3cjc/+JFknnmz20Udph5IPRpycGUC3O495PtK3+sQZYQIvyT96MkvhgwQTbfvDYcF+H7 YFCR6Zq+6VktvA6SoNdCreZoaKvXTWMkgdq8c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pFLH79c8m+piY11KkMZgBX5VRsqTT+7UonPhSQM8ZrAEp5t7YbQXVs7NlQtKXY6kRD MB73oYPuwYEasuo8zeEWVM58Rb72IWv1Bkq0lOeBn7r11966+S+li+iNJbuSiNXEu34L xX0uEIRmVmOrHnsH/M7jHoZvyGYZBNTqRDQy8= MIME-Version: 1.0 Received: by 10.239.133.74 with SMTP id 10mr715284hbu.29.1249379545573; Tue, 04 Aug 2009 02:52:25 -0700 (PDT) In-Reply-To: <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> Date: Tue, 4 Aug 2009 11:52:25 +0200 Message-ID: <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 11:13 AM, Patrick Donnelly wrote: > I think an additional tagging > organization would be useful as well, so that, someone looking for > help with tables could see all the relevant questions for them. OK, version 1.1, sans mathematical blunders, ipairs/pairs confusion and plus a few more extras. http://penlight.luaforge.net/FAQ (/faq.zip for code) But I am thinking - this is a very 1993 way of doing a FAQ. Surely in this age of Web 2.0 something more intelligent can be put together? I'm wondering what Yuri and the other Web devs think. Clearly this Does Not Scale. I'd also prefer not to host on luaforge, because the upload is really slow, I can make tea while the lexpect script is running. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 07:00:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74A0UGL016122; Tue, 4 Aug 2009 07:00:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DFD318E67; Tue, 4 Aug 2009 07:00:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 904B618C15 for ; Tue, 4 Aug 2009 07:00:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so4745913ewy.5 for ; Tue, 04 Aug 2009 03:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rwg59L4qy4HxPLB015ewWaeuqbV32tu8TV/SfFz0zqM=; b=AYAjGXPdbVofLttTo5mOC68asePeb6NLkkTwAxiGGuIQEVHD8xt9kHVXccF2qTMs7r GoDLoMSHY2FqbvZMLUPX6omT0nHK5MveZXEoJ1FIEgcoJH6yHTJnsfH08JurlxIw8YOH 0C8xEcm0+WxM+ihd9G8hsFKVQy08ZJY5eJFj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=ZapFmkMigg++dsZtkRuGOYSdCNChk/vKjz2K2MvUhTgwBW0nRcVmppDLZ+TQunJw5S wEGpueWYquNDu3x363aX64qzKpsADD5vSAawNut9+bN/vl2wCjQRSToAfLsboorNQRdF K/UsMLdOg4KLw6kBAXjlFqZ9JMzCrVMX1YMuM= MIME-Version: 1.0 Received: by 10.216.88.14 with SMTP id z14mr223965wee.25.1249380003032; Tue, 04 Aug 2009 03:00:03 -0700 (PDT) In-Reply-To: <20090803204319.GA5357@mike.de> References: <20090803204319.GA5357@mike.de> Date: Tue, 4 Aug 2009 06:00:02 -0400 Message-ID: Subject: Re: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/3/09, Mike Pall wrote: > Leo Razoumov wrote: > > Is it possible to do something in Lua and somehow control use of > > temporary objects when dealing with typical +-*/ math operations in > > Lua?? The underlying math library API is of the older variety and > > expects user to do all the resource allocations. > > > This paper might give you further ideas and has more references: > > http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.4562 > > E. Christopher Lewis, Calvin Lin, and Lawrence Snyder, > "The Implementation and Evaluation of Fusion and Contraction > in Array Languages", PLDI '98 > > > --Mike Interesting paper, indeed. But implementing array fusion will require massive changes to Lua code itself. I was hoping to be able to manage temporaries within standard lua and luajit. I am afraid it is not possible. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 07:14:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74AEOha017291; Tue, 4 Aug 2009 07:14:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D90A31928B; Tue, 4 Aug 2009 07:14:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88F3019257 for ; Tue, 4 Aug 2009 07:13:59 -0300 (BRT) Received: by ewy26 with SMTP id 26so4753809ewy.5 for ; Tue, 04 Aug 2009 03:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=jSuBxVqe/nUOKfSCRePT/TDxKDRaGMS1lYf+5nE96Q8=; b=XDXBlrmpWFiiaJMLGBDHK2gjtAUyF+RlpHuPyvDXdTuJR54PZQVSUwb5xlP55amoHc I8SocvIMZjasuXhjoGFY3eA2z3Kw7TKkdzaBpfDmg8FcGpGVD5H4Bh+/sU3m6252Lk4r paE7r82iHPGDWpymqn0IV5PJc4aZzv3al0xOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=w2qaI1e6iHP4Xn1LxbxqrJJPwtZX9KIjUJsgYSEfuhINdxMlgGVijJDTaTRcXoiwad ph0SdcLMYSzRqyfd9v4lit8klNiUIKw3GU26EFGqLMbN7ZReW+vmAdIRUKpd2nPpUtF7 SlcCvQHbpVZdmKb4wpoPqqZztF3SnYqaMGyPg= MIME-Version: 1.0 Received: by 10.216.74.71 with SMTP id w49mr1463438wed.135.1249380837583; Tue, 04 Aug 2009 03:13:57 -0700 (PDT) In-Reply-To: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> References: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> Date: Tue, 4 Aug 2009 06:13:57 -0400 Message-ID: Subject: Re: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/4/09, Asko Kauppi wrote: > > I'd like to make a point that such GC-avoiding optimizations only make sense (imho) when matrices are rather small in size. That is, when the pure mathematical time taken does not grow essential. > > Or am I wrong? > > We're currently using Lua for matrix calculations with matrix sizes around 50x60 to 500x600. Operations are SSE optimized, but we do not do any operation merging or GC avoidance. > > - asko In general, the "temporaries in a loop" problem bites at both ends of the spectrum. For large matrices (complex number matrix 1000x1000) GC will run on almost every iteration. In addition, moving massive matrices from heap to CPU cache and back will cause CPU cache misses and defeat processor optimizations. For small matrices, excessive calls to malloc slow you down. Also when GC runs it will have to collect lots of small objects and it is slow. In general, in numerics you simply do not allocate/free any resources inside the loops. Fortran does it all nicely for you in a compiler. C/C++ folks manage resources manually. C++ has also "expressions template" approach which uses template mechanism to rewrite expressions but it is compile time thing and is useless for Lua expressions that are run-time entities. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 07:19:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74AJh5d017707; Tue, 4 Aug 2009 07:19:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFAB418B91; Tue, 4 Aug 2009 07:19:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2114618A54 for ; Tue, 4 Aug 2009 07:19:16 -0300 (BRT) Received: by ewy26 with SMTP id 26so4756875ewy.5 for ; Tue, 04 Aug 2009 03:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7vRGdVFPkWppoDl2G5rIBjhohz/95yRcHdabJl4a+As=; b=C5vJ5Rn1o8X+H9+ohMNS3+VCs/nbIQEYE8O5HcA475q4WtKnbbEBTIKI2slbDKE1Ih UkeRZXg1VMNipCowrKhrUaFdnYbKT/kvlt3kDS3IyULAU3efAkXpPt4bPy2ZMarNcvoS OE/TIfBFRFVgxe+662Rz5LFYDj5E0U6h+qalE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=LsgyJS+fLXVSKoTViAVKh1Eryxcaj9degf3f5Zxx9S9ni3vMFD8JGGGj4+v4WExTbn QiSB6r2sJ78wFBfEhQXOje8vig5GKjNWY/HijdE66RYJhcBGsK5nqXLYyN9aKRDolqmT v+f7GaL089fbyn+U34/piHK6TPpwRpEYUywAQ= MIME-Version: 1.0 Received: by 10.216.20.197 with SMTP id p47mr1457490wep.13.1249381154802; Tue, 04 Aug 2009 03:19:14 -0700 (PDT) In-Reply-To: <560972290908040141h2556d91am8d51f99c406ec31b@mail.gmail.com> References: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> <560972290908040141h2556d91am8d51f99c406ec31b@mail.gmail.com> Date: Tue, 4 Aug 2009 06:19:14 -0400 Message-ID: Subject: Re: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/4/09, steve donovan wrote: > On Tue, Aug 4, 2009 at 9:28 AM, Asko Kauppi wrote: > > We're currently using Lua for matrix calculations with matrix sizes around 50x60 to 500x600. Operations are SSE optimized, but we do not do any operation merging or GC avoidance. > > > So the question is, is worrying about this premature optimization? Do > we have some numbers? > > steve d. In numerics this problem is common knowledge that was beaten to death 20 years ago and providing any performance numbers at this point would not add much value. If you need to do few matrix ops now and then you typically do not worry about performance at all. But if you run it in an inner loop billion times per simulation you do care about billion extra mallocs and GC cycles. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 07:45:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74Ajboe019948; Tue, 4 Aug 2009 07:45:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA0861926D; Tue, 4 Aug 2009 07:45:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2BD41916D for ; Tue, 4 Aug 2009 07:45:07 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74Aj4Nw019823 for ; Tue, 4 Aug 2009 07:45:05 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n74Aj4wS019821 for lua@bazar2.conectiva.com.br; Tue, 4 Aug 2009 07:45:04 -0300 Date: Tue, 4 Aug 2009 07:45:04 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: matrix operations and temporary objects? Message-ID: <20090804104504.GA19033@duchamp.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Is it possible to do something in Lua and somehow control use of > temporary objects when dealing with typical +-*/ math operations in Lua?? It is not possible to know directly when Lua is creating a temporary object, though you could do something along the lines of the "Using fallbacks" section in the SPE paper: http://www.lua.org/spe.html (I have the equivalent code for Lua 5.1 somewhere). Another alternative is to provide "begin_computation" and "end_computation" functions that will store all objects created between these calls in an internal C stack that can be freed or recycled in one go. for n=1,1000 do begin_computation() m= m*m1 + m2 end_computation() -- must not free m, ie, the last object created end From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 08:09:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74B9B2e022621; Tue, 4 Aug 2009 08:09:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D830B19178; Tue, 4 Aug 2009 08:08:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CC4118AC9 for ; Tue, 4 Aug 2009 08:08:43 -0300 (BRT) Received: by bwz6 with SMTP id 6so4007075bwz.5 for ; Tue, 04 Aug 2009 04:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=DYxsW+Lwo/MLK7jERoJJbrZZriJXw9hItzuUQj0CoEU=; b=PWTeBn5FQfHaxfLPqVHH2mphATWF/VzOdXKTvOXl9rYdPePcQOC+dj7IMuDdAExXI6 XUe+lvF6JUGa0u/ej45k7puPmEwFg7rzsF5onPPdz8j1nBHzoETH7+IhFz2o2f9nyhZu RAUXQckPjvh9B6YKx9IPOuQHAnFFYujp1HT8Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XOcrsYuJFxo6WaHltIhuE0qdhsOEB4GJ29WfqNbJOAfhlXnYNJK8syRRm+mvyhlhYS MRjaRbuxZoqRT97V/LKbG5xJH3zrLjUwLjWBXOk5butzACIODu1le+BNV0bGEftKiT4M VA2hMSafBzMIWKuEbX14xVZw5Ai9fF2mEvf04= MIME-Version: 1.0 Received: by 10.239.131.132 with SMTP id 4mr809471hbn.32.1249384121162; Tue, 04 Aug 2009 04:08:41 -0700 (PDT) In-Reply-To: References: <20090804072826.7D6D2405C@suomenpihlaja.dnainternet.net> Date: Tue, 4 Aug 2009 13:08:41 +0200 Message-ID: <560972290908040408i65517cck97de674ecfa64448@mail.gmail.com> Subject: Re: matrix operations and temporary objects? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n74B9B2e022621 On Tue, Aug 4, 2009 at 12:13 PM, Leo Razoumov wrote: > C++ has also "expressions template" approach which uses template > mechanism to rewrite expressions but  it is compile time thing and is > useless for Lua expressions that are run-time entities. But we do have such facilities, as the posts by Javier and David M point out. There is either 'express as string' or 'express as abstract expression using operators'; the first is a little awkward, and controlling variable scope is tricky. So I would go with the second approach. It is not difficult to construct 'AST' representations of Lua expressions: http://lua-users.org/wiki/SymbolicDifferentiation Using that, one can rewrite the Lua expression (assuming vectors, for simplicity) u = 1 + 3*v*u as the C code: for (i = 0; i < N; i++) u[i] = 1 + 3*v[i]*u[i]; Then you 'just' have to compile the C on the fly, initially: http://lua-users.org/lists/lua-l/2009-07/msg00073.html And voila, you can have fast numerics in Lua without doing any unnecessary allocation. steve d. PS I would do this over the weekend, but my coding stack is full ;) From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 08:24:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74BO3ZI024314; Tue, 4 Aug 2009 08:24:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C645118B30; Tue, 4 Aug 2009 08:23:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE14218AB8 for ; Tue, 4 Aug 2009 08:23:34 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 33FF850AD for ; Tue, 4 Aug 2009 14:23:25 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: matrix operations and temporary objects? References: Date: Tue, 04 Aug 2009 14:23:28 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 03 Aug 2009 23:17:08 +0300, Leo Razoumov wrote: > In the older days of numerics from 60-es to 80-es this problem was > easily resolved by shifting *all* resource management to a user. > .. > The underlying math library API is of the older variety and > expects user to do all the resource allocations. Don't fight the library, then. function matrix.add(arg1, arg2, dst) function matrix.mul(arg1, arg2, dst) for n=1,1000 do mul(m, m1, t) add(t, m2, m) end From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 08:37:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74BbCcn025677; Tue, 4 Aug 2009 08:37:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A34E1A578; Tue, 4 Aug 2009 08:36:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5FFC1A54F for ; Tue, 4 Aug 2009 08:36:48 -0300 (BRT) Received: by ywh26 with SMTP id 26so5073142ywh.5 for ; Tue, 04 Aug 2009 04:36:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.32.138 with SMTP id c10mr1884945ibd.28.1249385806203; Tue, 04 Aug 2009 04:36:46 -0700 (PDT) In-Reply-To: <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> Date: Tue, 4 Aug 2009 05:36:46 -0600 Message-ID: <790db3550908040436i12337044g9f8381c2641c0929@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n74BbCcn025677 On Tue, Aug 4, 2009 at 3:52 AM, steve donovan wrote: > On Tue, Aug 4, 2009 at 11:13 AM, Patrick Donnelly wrote: >> I think an additional tagging >> organization would be useful as well, so that, someone looking for >> help with tables could see all the relevant questions for them. > > OK, version 1.1, sans mathematical blunders, ipairs/pairs confusion > and plus a few more extras. > > http://penlight.luaforge.net/FAQ  (/faq.zip for code) > > But I am thinking - this is a very 1993 way of doing a FAQ.  Surely in > this age of Web 2.0 something more intelligent can be put together? > I'm wondering what Yuri and the other Web devs think. Clearly this > Does Not Scale. > > I'd also prefer not to host on luaforge, because the upload is really > slow, I can make  tea while the lexpect script is running. I can host it if you want; I have lots of spare bandwidth. I can also set up a subversion repository w/ a cron job that periodically runs your build script. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 09:30:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74CUHNY032648; Tue, 4 Aug 2009 09:30:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FEE219285; Tue, 4 Aug 2009 09:29:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 427B5191F0 for ; Tue, 4 Aug 2009 09:29:37 -0300 (BRT) Received: by ewy26 with SMTP id 26so4836928ewy.5 for ; Tue, 04 Aug 2009 05:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=WU+svOY9HBIa8E8zli2jx7GemnCjV/EvsgFcNMZlsuo=; b=tlKgWa3WCJUvOcktN6YBksJUTmOKNfHFZXyiHsv5FGJTxs/Wh+boDg4kz9JxePu2Cx tObKQjN8ddnEtRIaCfIVyyplw+T4wBERiJ5KaCIuw+0WbBOPA/ntZDQMsYoxiw/PrcEi tbmkWirzxZMFfme7Z12jekx8jfS/7sslVYtuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=Tq1F93pAb6NkkfnRymANf5PLtNBPuekuu6Sg9kMMIVJeJVzezEudHNgrBrCJrwL5pD N/GWO6MXnvlhBzIq2+6qtXzT5iE5+3S7r3j9efEYxq7MO0gPG1pBFmIUOq445D6N9Zit YO47WFZy5SPPPDu9X4xe0xEXTd/5DqHS2Q7Dk= MIME-Version: 1.0 Received: by 10.216.89.135 with SMTP id c7mr1445985wef.62.1249388975366; Tue, 04 Aug 2009 05:29:35 -0700 (PDT) In-Reply-To: <20090804104504.GA19033@duchamp.tecgraf.puc-rio.br> References: <20090804104504.GA19033@duchamp.tecgraf.puc-rio.br> Date: Tue, 4 Aug 2009 08:29:35 -0400 Message-ID: Subject: Re: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/4/09, Luiz Henrique de Figueiredo wrote: > > Is it possible to do something in Lua and somehow control use of > > temporary objects when dealing with typical +-*/ math operations in Lua?? > > > It is not possible to know directly when Lua is creating a temporary object, > though you could do something along the lines of the "Using fallbacks" section > in the SPE paper: http://www.lua.org/spe.html (I have the equivalent code for > Lua 5.1 somewhere). > > Another alternative is to provide "begin_computation" and "end_computation" > functions that will store all objects created between these calls in an > internal C stack that can be freed or recycled in one go. > > > for n=1,1000 do > > begin_computation() > m= m*m1 + m2 > end_computation() -- must not free m, ie, the last object created > end This is what I have been doing recently. I am even playing with Matrix "Factory" allocators that reuse temporary matrices of compatible sizes to avoid malloc/free overhead. When matrix is deallocated it returns back to the factory for reuse. But this approach has a very serious problem, as illustrated below for n=1,1000 do begin_computation() m = m*m1 + m2 m1= m*m2 + m1 end_computation() -- must not free new m, m1 end How could I tell end_computation() that objects referenced by m and m1 have to be preserved?? It is difficult and error-prone to predict location of object "m" on the C stack which is tracking new object allocations. Even though it looks ugly, I would rather do this: for n=1,1000 do begin_computation() -- start tracking newly allocated objects m = compute(m*m1 + m2) -- compute and cleanup m1= compute(m*m2 + m1) -- compute and cleanup end_computation() end function compute(x) end_computation() -- cleanup all but the last allocated object begin_computation() -- rearm return x end I hope that together with factory allocators that reuse objects, the overhead can be acceptable. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 09:51:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74Cp5kx004049; Tue, 4 Aug 2009 09:51:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E372192A1; Tue, 4 Aug 2009 09:50:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1AFAA1920F for ; Tue, 4 Aug 2009 09:50:37 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so949503eyd.11 for ; Tue, 04 Aug 2009 05:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=WFXXwZwulfFpyXB9a4YUX+ociaXviTINI9mPXTpdDJY=; b=C9WIVTcJQqhAUTMho2NzVfGovJ9th/pTzIwYWc8ZktM3XIFwbNkEXVaGKRPXv7CylO cSPtbQoETsvX2bSHU7tCGS8zSsXxxCHNdoFQArnWOUYPholXLpLzkssY5YEfcipgXMCh HmoUEUEkHQYs9jHEtt7eXJUBFgLB+OsxzQOqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=p/AzY6y04E5d3SJb/XzNNXfDVEs9o3psHMzCU6CfhClh1aCnJf4VyO1GNT3LPhtUQI BiACF0hl0W3ERkPIJL2VNlOmMIlN6aCa2o80mBJGymJRWK11Ew06JMbG7nIHzf/xNI/n c8Z0b8mDyG5Jm2cJsbROmXkV8ysayITc1IZPo= MIME-Version: 1.0 Received: by 10.216.87.143 with SMTP id y15mr1490784wee.39.1249390235819; Tue, 04 Aug 2009 05:50:35 -0700 (PDT) In-Reply-To: References: Date: Tue, 4 Aug 2009 08:50:35 -0400 Message-ID: Subject: Re: matrix operations and temporary objects? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/4/09, Juris Kalnins wrote: > On Mon, 03 Aug 2009 23:17:08 +0300, Leo Razoumov > wrote: > > > > In the older days of numerics from 60-es to 80-es this problem was > > easily resolved by shifting *all* resource management to a user. > > .. > > The underlying math library API is of the older variety and > > expects user to do all the resource allocations. > > > > Don't fight the library, then. > > function matrix.add(arg1, arg2, dst) > function matrix.mul(arg1, arg2, dst) > > for n=1,1000 do > mul(m, m1, t) > add(t, m2, m) > end > The intended audience of my efforts is "Matlab crowd" who are accustomed to a concept of free lunch. Of course, a "real programmer" will allocate all the memory manually:-) Seriously, though, I do agree with you. It is for a good reason that time honored high performance libraries such as BLAS or LAPACK let users manually handle the resources. It gives them full control and after some practice is not that hard. But in today's world of shortcuts and instant gratification it is expected that the "platform" is smart enough to do all sort of boiler-plate stuff. Give me "do_what_I_mean()" function call, pleease!:-) --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:04:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74D4ggx006501; Tue, 4 Aug 2009 10:04:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C968192A8; Tue, 4 Aug 2009 10:04:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.peterodding.com (mailinghelper.nl [79.99.133.60]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2F9D1928B for ; Tue, 4 Aug 2009 10:04:08 -0300 (BRT) Received: from [192.168.1.3] (82-136-228-62.ip.telfort.nl [82.136.228.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.peterodding.com (Postfix) with ESMTPSA id 27B63202AFB5 for ; Tue, 4 Aug 2009 13:20:05 +0000 (UTC) Message-ID: <4A7831C3.3060609@peterodding.com> Date: Tue, 04 Aug 2009 15:04:03 +0200 From: Peter Odding User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] An extended Lua FAQ References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040227o646bd5c8rb553db4bdb50f5a1@mail.gmail.com> In-Reply-To: <560972290908040227o646bd5c8rb553db4bdb50f5a1@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------040802090508060502040302" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------040802090508060502040302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit steve donovan wrote: > Patrick Donnelly wrote: >> Perhaps I missed it somewhere, but how do we contribute? > > (1) edit the markdown source and post diffs against it > (2) just post items in markdown format for us to discuss > (3) Put comments here: > > http://lua-users.org/wiki/UnofficialFaqDiscussion I found two places in the FAQ HTML document where Markdown changed the input '\' (a single-quoted backslash) into '' (empty single-quotes), which makes the affected paragraphs in the FAQ rather confusing. I don't know which Markdown code you're using, but [1] gives me the same output based on FAQ.md in [2], and changing the input to '\\' gives the correct output. I also added some missing dots to end sentences. Please see the attached diff. - Peter [1] http://www.frykholm.se/files/markdown.lua [2] http://penlight.luaforge.net/FAQ/faq.zip --------------040802090508060502040302 Content-Type: text/x-patch; name="FAQ.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="FAQ.diff" 284c284 < The usual operators can be overloaded using [metamethods](http://lua-users.org/wiki/MetamethodsTutorial) If an object (either a Lua table or C userdata) has a metatable then we can control the meaning of the arithmetic operators (like + - * / ^), --- > The usual operators can be overloaded using [metamethods](http://lua-users.org/wiki/MetamethodsTutorial). If an object (either a Lua table or C userdata) has a metatable then we can control the meaning of the arithmetic operators (like + - * / ^), 486c486 < Some method names are special, like `__tostring` (["metamethods"](http://www.lua.org/manual/5.1/manual.html#2.8)) Defining this function controls how our objects are represented as strings. --- > Some method names are special, like `__tostring` (["metamethods"](http://www.lua.org/manual/5.1/manual.html#2.8)). Defining this function controls how our objects are represented as strings. 795c795 < Naturally! But see if you really cannot do the task with Lua's built-in _string patterns_. Although simpler than traditional regular expressions, they are powerful enough for most tasks. In most cases, you can understand a Lua string pattern by mentally replacing '%' with '\'; the advantage of % of course is that it does not itself need escaping in C-style strings such as Lua uses. --- > Naturally! But see if you really cannot do the task with Lua's built-in _string patterns_. Although simpler than traditional regular expressions, they are powerful enough for most tasks. In most cases, you can understand a Lua string pattern by mentally replacing '%' with '\\'; the advantage of % of course is that it does not itself need escaping in C-style strings such as Lua uses. 1058c1058 < If you prefer a higher-level library that harnesses LuaFileSystem, then look at Penlight's [pl.path](http://penlight.luaforge.net/api/modules/pl.path.html) module. This is modelled after Python's `os.path` module, and makes it easier to do cross-platform coding (e.g. using `path.join` instead of explicitly stringing paths together with '/' or '\') --- > If you prefer a higher-level library that harnesses LuaFileSystem, then look at Penlight's [pl.path](http://penlight.luaforge.net/api/modules/pl.path.html) module. This is modelled after Python's `os.path` module, and makes it easier to do cross-platform coding (e.g. using `path.join` instead of explicitly stringing paths together with '/' or '\\') 1208c1208 < A good place to start is the [Libraries and Bindings](http://lua-users.org/wiki/LibrariesAndBindings) page at the [Lua Wiki](http://lua-users.org/wiki) It's not a complete list, but a good start. [LuaForge](http://luaforge.net) is the community repository of Lua libraries and hosts most of the good ones. A useful list of the most popular modules is available [here](http://luaforge.net/top/mostactive.php). --- > A good place to start is the [Libraries and Bindings](http://lua-users.org/wiki/LibrariesAndBindings) page at the [Lua Wiki](http://lua-users.org/wiki). It's not a complete list, but a good start. [LuaForge](http://luaforge.net) is the community repository of Lua libraries and hosts most of the good ones. A useful list of the most popular modules is available [here](http://luaforge.net/top/mostactive.php). --------------040802090508060502040302-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:20:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DKhPp009956; Tue, 4 Aug 2009 10:20:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 640371A5D9; Tue, 4 Aug 2009 10:20:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B02F21A51A for ; Tue, 4 Aug 2009 10:20:17 -0300 (BRT) Received: by bwz6 with SMTP id 6so4080007bwz.5 for ; Tue, 04 Aug 2009 06:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ONLK/KimxtMOG+vP72Qlcp2Nuj6bkllSPw//qC8ExIg=; b=j1jjxrQTki9unT530R4K+58foHaVBx1N4fa8ZRXhRs7XyRsMc379ZYj4bynUWwHk44 IpEWKLVsRxf/wK8xP6T685tsGFAd6HV7BvnXXIwzjsUTN+pnTHLAxj4X8p9qG6apIIk+ bysvjPLgXvOxOlTjszaL2/KWPdsfTi5kKL0kU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=S4E2W92g2710AtKqjVowM29sT1gMQXC4B+ixl+C2nwPTJCh1E8WgAIU87TJzSRQrMK 6XyQ0XG4hdIo7cnd7I6vzi2sWH2NV1jWks77FyV/mO/2fq8ZabkuKIwDhq9ZjFTH+JDE wwjhbIWNGHKtNsaAyftpu6xJozEJdYNInF+U4= MIME-Version: 1.0 Received: by 10.239.155.11 with SMTP id g11mr798315hbc.99.1249392015382; Tue, 04 Aug 2009 06:20:15 -0700 (PDT) In-Reply-To: <20090803135559.1fc70082@hoelzro.net> References: <20090803135559.1fc70082@hoelzro.net> Date: Tue, 4 Aug 2009 15:20:15 +0200 Message-ID: <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> Subject: Re: [ANN] linotify From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 8:55 PM, Rob Hoelz wrote: > I wrote a binding to Linux's inotify facility for Lua, and I'm > announcing it here with the hope that someone other than myself will > find it useful. Compiled fine after a few Debian-specific issues about sys/inotify, but there is a most curious bug. Here is my version of your test script: local inotify = require 'inotify' local handle = inotify.init() local wd = handle:addwatch('/home/sdonovan/aggregator/lasync', inotify.IN_CREATE, inotify.IN_MOVE) local events = handle:read() for _, ev in ipairs(events) do print(ev.name .. ' was created or renamed') end handle:rmwatch(wd) handle:close() And yes it worked, but only the ev.name was printed, the concat did not work. This fixed it. On line 100, there was a lua_pushlstring(L, name, iev->len - 1); which I needed to replace by char name[512]; // yes I know, arbitrary constant strncpy(name,iev->name,iev->len); name[iev->len] = '\0'; lua_pushstring(L,name); So it was a problem with not properly terminating the buffer with NUL ? steve d. (Linux debian 2.6.18-4-486 #1 Mon Mar 26 16:39:10 UTC 2007 i686 GNU/Linux) From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:25:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DPkRj011376; Tue, 4 Aug 2009 10:25:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46BFF18955; Tue, 4 Aug 2009 10:25:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB904188EF for ; Tue, 4 Aug 2009 10:25:18 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so645873fgb.5 for ; Tue, 04 Aug 2009 06:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ClbT8lDfFZmRclItZyKhSnJzyT8G+amIYE4PjPaZID0=; b=Iiopm040ms4KBVcl5VK3eeZMJl7+ehDkeIkX5SC4W8sanBHiwYTF8/frZUQQtYnzbF drD8O5PjCc1f/L1e0J3T1pg6hT5PkROpg8kxpKYvkAqXVFwoSgYcHYir97310iFy/5Oi 2TNDTk5Rl0s3uXv2ufYV/4EJTpe2WDAHrgA1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Rhp1LATLyoaZfV+Gr85FR2yycCV4rL40Zx7N8f5aGmcI+MYndZxbHIRd/mf/1WDLJa JFMR8Qw4tWOAzByFevL+EpCoYgetvnmhoH5c8LsA2LqUlb3CFI/7dXZ8lGvv+JlSvc1U lKU1p/nU+6uFhJ74uweYJO1O4i56i8QfCfm1A= MIME-Version: 1.0 Received: by 10.239.167.212 with SMTP id h20mr672562hbe.68.1249392316483; Tue, 04 Aug 2009 06:25:16 -0700 (PDT) In-Reply-To: <4A7831C3.3060609@peterodding.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040227o646bd5c8rb553db4bdb50f5a1@mail.gmail.com> <4A7831C3.3060609@peterodding.com> Date: Tue, 4 Aug 2009 15:25:16 +0200 Message-ID: <560972290908040625q6014678dj251176b9465e7c0d@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 3:04 PM, Peter Odding wrote: > I found two places in the FAQ HTML document where Markdown changed the input > '\' (a single-quoted backslash) into '' (empty single-quotes), which makes > the affected paragraphs in the FAQ rather confusing. I don't know which > Markdown code you're using, but [1] gives me the same output based on FAQ.md > in [2], and changing the input to '\\' gives the correct output. I also > added some missing dots to end sentences. Please see the attached diff. Thanks, Peter! Well spotted, exactly what a technical writer needs! I'm using a slightly patched version of markdown.lua that does the TOC stuff: http://mysite.mweb.co.za/residents/sdonovan/lua/markdown.zip steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:38:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DcjWC014624; Tue, 4 Aug 2009 10:38:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6508318C2F; Tue, 4 Aug 2009 10:38:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE80318B12 for ; Tue, 4 Aug 2009 10:38:12 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DcAUa014527 for ; Tue, 4 Aug 2009 10:38:10 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n74Dc9904138; Tue, 4 Aug 2009 10:38:09 -0300 Date: Tue, 4 Aug 2009 10:38:09 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] linotify Message-ID: <20090804103808.B4129@lua.tecgraf.puc-rio.br> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com>; from steve.j.donovan@gmail.com on Tue, Aug 04, 2009 at 03:20:15PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > char name[512]; // yes I know, arbitrary constant > strncpy(name,iev->name,iev->len); > name[iev->len] = '\0'; > lua_pushstring(L,name); You can simply use lua_pushlstring(L,iev->name,iev->len). From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:39:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DdPiM014896; Tue, 4 Aug 2009 10:39:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF40418CCD; Tue, 4 Aug 2009 10:38:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (unknown [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BDE418C57 for ; Tue, 4 Aug 2009 10:38:27 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id D529266C4 for ; Tue, 4 Aug 2009 16:38:15 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: matrix operations and temporary objects? References: Date: Tue, 04 Aug 2009 16:38:20 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 04 Aug 2009 15:50:35 +0300, Leo Razoumov wrote: > The intended audience of my efforts is "Matlab crowd" who are > accustomed to a concept of free lunch. Then you can at least try and use lazy evaluation: http://lua-users.org/lists/lua-l/2006-05/msg00204.html That gives a lot of free lunch. Since Lua GC means that lifetime of _any_ object can extend arbitrarily long (or until next gc "collect"), there is no way to automatically reclaim temporaries other than writing hacks that will be incorrect in corner cases. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:42:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DgZjG015528; Tue, 4 Aug 2009 10:42:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B42F19198; Tue, 4 Aug 2009 10:42:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0553E18C1B for ; Tue, 4 Aug 2009 10:42:03 -0300 (BRT) Received: by bwz6 with SMTP id 6so4093933bwz.5 for ; Tue, 04 Aug 2009 06:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=exOT2NgITn8lphzXv2QvshEB5dSxI/Jf5HXEqhftuUU=; b=xQcJqcEprgB4IOV+U4KvvJ954MQsC3v9UvfgREoF7Q7Jy8aybyxPOXSkpuVtI2FyoZ 6ACVFfrrbFznJi/C3v6U0pDDNp8APLBFAJ0EfE/98Hgb80X6Ov4eIQSMHnJVNOtEC/x4 +zazeFgq/SeFep7dxbIo25CVTMTN2ZPvqp9zs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WwU8/AruHUl1PrmkLPTDk9vd5akwji6OAuFT7AKI11lL6qDmGaREwH6FyewqRSW6dh 1RsTrPSxfqw0G8QEWnjFfFQd7y48keq+yB7C3Jz0yAKba2PQLacl2iuP5Nxk0R27Xl2s DchusUk1GGbnWxYbJMlUuH2sxOKvp21pkvikY= MIME-Version: 1.0 Received: by 10.239.153.81 with SMTP id y17mr768590hbb.55.1249393321332; Tue, 04 Aug 2009 06:42:01 -0700 (PDT) In-Reply-To: <20090804103808.B4129@lua.tecgraf.puc-rio.br> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> Date: Tue, 4 Aug 2009 15:42:01 +0200 Message-ID: <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> Subject: Re: [ANN] linotify From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 3:38 PM, Luiz Henrique de Figueiredo wrote: > You can simply use lua_pushlstring(L,iev->name,iev->len). Yes, that was the first thing I tried, but it didn't seem to help... From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:45:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DjDCI016196; Tue, 4 Aug 2009 10:45:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF5C1192A7; Tue, 4 Aug 2009 10:44:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFF711926C for ; Tue, 4 Aug 2009 10:44:46 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DijxE016011 for ; Tue, 4 Aug 2009 10:44:45 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n74Diiq04204; Tue, 4 Aug 2009 10:44:44 -0300 Date: Tue, 4 Aug 2009 10:44:43 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] linotify Message-ID: <20090804104443.A4199@lua.tecgraf.puc-rio.br> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com>; from steve.j.donovan@gmail.com on Tue, Aug 04, 2009 at 03:42:01PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > You can simply use lua_pushlstring(L,iev->name,iev->len). > > Yes, that was the first thing I tried, but it didn't seem to help... And the strcpy helped?? From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:47:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DlBRT016768; Tue, 4 Aug 2009 10:47:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1D55192B8; Tue, 4 Aug 2009 10:46:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61E86192AB for ; Tue, 4 Aug 2009 10:46:45 -0300 (BRT) Received: by fxm25 with SMTP id 25so4213036fxm.5 for ; Tue, 04 Aug 2009 06:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iZS/uD5rL8nrWEl5KjvWyDUGwjisb5LKGQwIZuIm5Wo=; b=tsiOimiz/89OQcODkASgZKeadUXFb4KmTwLQYLw4k6RyqWhWTghpR/jowl8Y/53t8k v3Ghv1NUC5FO8s5LZOByXP/E3yoGKb9972NLlDsuhUWuVdaxaRzYFmoUFX9UmIJ5vyn1 +POodb5k5HgUEqrMY5QWYxTLYa7E9BTO2GKOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dekbZwEA6VQqk+o9hO2xyarLDa1p3GWeDvNaTEfzDE6m6awoFrbJBBhB1+Vr/hKRAS WdEDybBZbU7ArN5EyckkeLoH+RGFVep+tdsO7AtT+PlZ8EmTe6/rbWT7nQ9igRithcwr 1/fd48FXI1N5qskdO3Qb5C4yog9uviCzCk0y8= MIME-Version: 1.0 Received: by 10.239.153.81 with SMTP id y17mr769159hbb.55.1249393602606; Tue, 04 Aug 2009 06:46:42 -0700 (PDT) In-Reply-To: <20090804104443.A4199@lua.tecgraf.puc-rio.br> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> <20090804104443.A4199@lua.tecgraf.puc-rio.br> Date: Tue, 4 Aug 2009 15:46:42 +0200 Message-ID: <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> Subject: Re: [ANN] linotify From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 3:44 PM, Luiz Henrique de Figueiredo wrote: > And the strcpy helped?? > Oh yes, then it was a well-behaved string. A mystery to me also. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:54:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74Ds4Jc018303; Tue, 4 Aug 2009 10:54:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22267192C6; Tue, 4 Aug 2009 10:53:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E95F4192AE for ; Tue, 4 Aug 2009 10:53:35 -0300 (BRT) Received: by bwz6 with SMTP id 6so4101566bwz.5 for ; Tue, 04 Aug 2009 06:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ze8qLf0NkAjG78yzYe1jV640lEgSBWG4xrDWG+zY+6A=; b=YgUWTecCYLm169nnj8iMeV1bVbb9DhdGy51K9IEE5hEiVxaW0ILnCxsbpBwi0lekGM iKhk9bN+ZI0NBS6Jx1aH/WEZhVcvfVl5MnrFz11ohj/BxaabKgME+rsBHncxKe0trUYq E5rbSwdokP2/2wcGw4kWWiGV+GRQ8vsP0RkyM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LDESV5hw0XQ+yts8I4rOwIisMbY4+pU1yDXbfaMiGWM2PyzSwbn2UGc5Pga4amegK0 CwsthC18rwGYEPurH9K5c/lNVDUZDhO6WMxUemmOY6p7FNWolvxllR9ZGb998KixkAnh bPAXqi6orQVsifDRYeyb968AFBpAV9GfdFmxI= MIME-Version: 1.0 Received: by 10.239.154.137 with SMTP id e9mr772715hbc.153.1249394013464; Tue, 04 Aug 2009 06:53:33 -0700 (PDT) In-Reply-To: <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> Date: Tue, 4 Aug 2009 15:53:33 +0200 Message-ID: <560972290908040653s7c226c24k65b23883cc9847ff@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 11:13 AM, Patrick Donnelly wrote: > Perhaps I missed it somewhere, but how do we contribute? Due to a lack of due dillgence, I only found this today: http://lua-users.org/wiki/LuaFaq Now, it illustrates the problem with that particular wiki engine, no TOC. But the question is: there is material there that I would like to include. I want to move from being 'sole author' to being maintainer of this FAQ. How best to handle the attribution issue? steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:54:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74Dsa4K018407; Tue, 4 Aug 2009 10:54:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43576192D3; Tue, 4 Aug 2009 10:53:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AA22192C7 for ; Tue, 4 Aug 2009 10:53:54 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MYKSY-0004ii-0X for ; Tue, 04 Aug 2009 14:53:46 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MYKSf-0002RY-6Q for lua@bazar2.conectiva.com.br; Tue, 04 Aug 2009 14:53:53 +0100 Date: Tue, 4 Aug 2009 14:53:52 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] linotify Message-ID: <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> In-Reply-To: <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> <20090804104443.A4199@lua.tecgraf.puc-rio.br> <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 4 Aug 2009 15:46:42 +0200 steve donovan wrote: > On Tue, Aug 4, 2009 at 3:44 PM, Luiz Henrique de > Figueiredo wrote: > > And the strcpy helped?? > > > > Oh yes, then it was a well-behaved string. A mystery to me also. Valgrind to the rescue. B. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 10:57:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74DvUOw019301; Tue, 4 Aug 2009 10:57:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52D7A18E8A; Tue, 4 Aug 2009 10:57:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D82B18BCE for ; Tue, 4 Aug 2009 10:56:59 -0300 (BRT) Received: by ywh26 with SMTP id 26so5181983ywh.5 for ; Tue, 04 Aug 2009 06:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=FL9xjz7KP38+afyMBE3g+rFAiHWpelKlCaxhwObn6S8=; b=t4VwSuINwcx5xzlI87vFeCt+ruL1UBQjTVyIzN7SWYydnTDbn1iZpN2VDU/sHeb4IR ib6oqtbwKVstJvWNKPWOy6MO3tGAaltLnwhOWsDtKvLdYh8vtLo8U7xTv4sZnpiIPq8z UtguRTajo+eaIE6VtM+ZFpRMKxU0rkIOoowv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=M0j71jdNTR41AWwanMrwzfMsneAMvFEOtLCP/cZa1W1Qi8cTnZ42aroARISEf8C1DK q3HVpmWpOOqPjiDVM6KMEnO2x62Fxm8v4ps6/JfcgT8Qa9rdnuV5KwaM70lss2KVzS5z XMOyXVvGbeLRInXLdwVw3Gv9VMp/H1BilekwE= MIME-Version: 1.0 Received: by 10.100.227.18 with SMTP id z18mr3261791ang.35.1249394218070; Tue, 04 Aug 2009 06:56:58 -0700 (PDT) In-Reply-To: <20090803182034.432894c6@egeria.whoopdedo.org> References: <20090731165513.69e2fab6@egeria.whoopdedo.org> <20090803182034.432894c6@egeria.whoopdedo.org> From: "Thomas Harning Jr." Date: Tue, 4 Aug 2009 09:56:38 -0400 Message-ID: Subject: Re: [Patch] Finalization of function objects To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n74DvUOw019301 On Mon, Aug 3, 2009 at 6:20 PM, TNHarris wrote: > Yes, that was the problem. And also in resetstack, the same thing: > diff -urN -x '*.o' -x '*.a' -x '*.exe' -x '*.lua' lua.orig/src/ldo.c > lua.mod/src/ldo.c --- lua.orig/src/ldo.c        2008-01-18 17:31:22.000000000 -0500 > +++ lua.mod/src/ldo.c   2009-08-02 06:57:33.526611200 -0400 > @@ -83,6 +83,8 @@ >   L->base = L->ci->base; >   luaF_close(L, L->base);  /* close eventual pending closures */ >   luaD_seterrorobj(L, status, L->base); > +  L->allowhook = 0; > +  if (L->fin_top) luaD_finalize(L, L->fin_stack, 1); >   L->nCcalls = L->baseCcalls; >   L->allowhook = 1; >   restore_stack_limit(L); > >> Comparing from 'original' finalizer patch (Nodir) to the newer one >> provided by  TNHarris... I'm not sure which is 'correct' or not, >> especially ones that alter the Lua internal stack/etc. > > Mostly, this is because of the change from a base+offset stack to stack > pointers. But when it comes to calling finalizers after an error, I'm > not too sure how the Lua state and call info should be massaged to avoid > "Bad Things". I guessed on a lot of it and, if it appeared to work, let > it be. I think the order should be to clean up from the callee, invoke > finalizers, restore the caller state. One thing I found that affects both patches and am not at all sure on how it should be handled... when a finalizer throws, odd things happen. It appears that the first error in a finalizer can be handled (maybe due to an outer pcall I'm using), but a second one causes the lua interpreter's exception handler to get used. My best guess is that when the finalization stack runs into an exception, it performs the longjmp and then starts the process of cleaning up finalizers all over again. IN a quick little test (in the same test framework I had before): test("Error in finally", function() finally(print, 'HELLO1') finally(function() error("FAIL IN FINALIZE1") end) finally(function() error("FAIL IN FINALIZE2") end) finally(print, 'HELLO'2) end, 0, 0, 0) If I comment out the second error, things seem to go ok and I get the following output: HELLO2 HELLO1 test-correct.lua:87: FAIL IN FINALIZE1 However, if I do not and throw in that second finalizer, i get: HELLO2 HELLO1 test-correct.lua:87: FAIL IN FINALIZE1 lua-5.1.4-fin1/src/lua: test-correct.lua:87: FAIL IN FINALIZE1 Notice that FAIL IN FINALIZE2 is not the error, but fail in finalize1 is called again. It looks like when the first fail in finalize occurred, it managed to mark that the new top of the cleanup stack... however two errors in a row (?) caused it to mark the top of the stack for the previous cleanup.... I 'think' that finalizers should effectively be run in a 'pcall' environment... but that would probably kill performance. Perhaps it should be assumed that if you throw in a finalizer and don't catch within... expect bad things. Also.... How do hooks handle exceptions? I suspect they behave similarly... (cause the outer pcall to get invoked), but they do not have the "interesting" state issue that finalization stacks do. I'm tempted to rework this patch such that you can isolate cleanup/etc from the inner code, but have callbacks on: * function exit * function error-based exit * coroutine error/exit * coroutine collection -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 11:05:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74E58D5020896; Tue, 4 Aug 2009 11:05:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67204192C5; Tue, 4 Aug 2009 11:04:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-105.bluehost.com (outbound-mail-105.bluehost.com [69.89.18.5]) by bazar2.conectiva.com.br (Postfix) with SMTP id BC17018D35 for ; Tue, 4 Aug 2009 11:04:31 -0300 (BRT) Received: (qmail 12519 invoked by uid 0); 4 Aug 2009 14:04:29 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy3.bluehost.com with SMTP; 4 Aug 2009 14:04:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=APAAv3ZI+XMe33hn3exM9sUXWspLgP6xsZwvJtTGZBGVZzv+qzrFq7GGhDtGNGxi+5eah2lwbujUylCnA9j/WMlQ+6XYg8842nCfCGDI1T0Og7pbQbpRFrPoV0sDx7Wh; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MYKcu-0003pv-Va; Tue, 04 Aug 2009 08:04:29 -0600 Date: Tue, 4 Aug 2009 09:04:19 -0500 From: Rob Hoelz To: Lua list Subject: Re: [ANN] linotify Message-ID: <20090804090419.445d5225@hoelzro.net> In-Reply-To: <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> <20090804104443.A4199@lua.tecgraf.puc-rio.br> <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/l.0DDT=_eWScVJD9SsIstOJ"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/l.0DDT=_eWScVJD9SsIstOJ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 4 Aug 2009 14:53:52 +0100 Rob Kendrick wrote: > On Tue, 4 Aug 2009 15:46:42 +0200 > steve donovan wrote: >=20 > > On Tue, Aug 4, 2009 at 3:44 PM, Luiz Henrique de > > Figueiredo wrote: > > > And the strcpy helped?? > > > > >=20 > > Oh yes, then it was a well-behaved string. A mystery to me also. >=20 > Valgrind to the rescue. >=20 > B. Here's something interesting: I added the following line just before the pushlstring in question: printf("name =3D %s (len %d) len =3D %d\n", iev->name, strlen(iev->name), iev->len); And lo and behold, what output do I get? =20 This: name =3D foo (len 3) len =3D 16 Looks like I need to look at the inotify docs again... -Rob --Sig_/l.0DDT=_eWScVJD9SsIstOJ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkp4P+YACgkQUoGaR6SGEaomdQCgkGQwEVLw6G7pZpc8vnY6+zD2 BVUAn3hur6BX+2p1cMthJE/nifFxsQ4D =8SmM -----END PGP SIGNATURE----- --Sig_/l.0DDT=_eWScVJD9SsIstOJ-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 11:07:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74E7NrT021503; Tue, 4 Aug 2009 11:07:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 874A2192DD; Tue, 4 Aug 2009 11:07:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1026B18E6D for ; Tue, 4 Aug 2009 11:06:57 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74E6sde021407 for ; Tue, 4 Aug 2009 11:06:54 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n74E6rV04281; Tue, 4 Aug 2009 11:06:53 -0300 Date: Tue, 4 Aug 2009 11:06:53 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] linotify Message-ID: <20090804110653.A4278@lua.tecgraf.puc-rio.br> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> <20090804104443.A4199@lua.tecgraf.puc-rio.br> <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> <20090804090419.445d5225@hoelzro.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20090804090419.445d5225@hoelzro.net>; from rob@hoelzro.net on Tue, Aug 04, 2009 at 09:04:19AM -0500 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I added the following line just before the pushlstring in question: > > printf("name = %s (len %d) len = %d\n", iev->name, strlen(iev->name), > iev->len); > > And lo and behold, what output do I get? > This: > > name = foo (len 3) len = 16 > > Looks like I need to look at the inotify docs again... I did the same just now. man inotify says: char name[]; /* Optional null-terminated name */ So, the solution is to use simply lua_pushstring(L,iev->name) From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 11:10:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74EADYk022100; Tue, 4 Aug 2009 11:10:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E941192E0; Tue, 4 Aug 2009 11:09:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-151.bluehost.com (outbound-mail-151.bluehost.com [67.222.39.31]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6CDAD192DB for ; Tue, 4 Aug 2009 11:09:40 -0300 (BRT) Received: (qmail 11390 invoked by uid 0); 4 Aug 2009 14:09:35 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy5.bluehost.com with SMTP; 4 Aug 2009 14:09:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=MQxsBmkXUeU5g1GQMFYmCbm4vOZqTOE9yHp4WTIvmCL8g4Eg+nUDryeSLNw2fUWFVnIBsLw1ePa+AbzJDVuEJzp85ZcBKinp6tZfRMo+oJBZfmMoFfMAS17/h/0Af+Dc; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MYKhq-0007fE-Sc for lua@bazar2.conectiva.com.br; Tue, 04 Aug 2009 08:09:35 -0600 Date: Tue, 4 Aug 2009 09:09:25 -0500 From: Rob Hoelz To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] linotify Message-ID: <20090804090925.32ac3301@hoelzro.net> In-Reply-To: <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> References: <20090803135559.1fc70082@hoelzro.net> <560972290908040620i1dbcc667l35ad36fe86edf4bc@mail.gmail.com> <20090804103808.B4129@lua.tecgraf.puc-rio.br> <560972290908040642r2de42f75n16d80758fbf3938a@mail.gmail.com> <20090804104443.A4199@lua.tecgraf.puc-rio.br> <560972290908040646t4a3c08a1jfa16040c5c0567b2@mail.gmail.com> <20090804145352.6dd564f0@trite.i.flarn.net.i.flarn.net> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/BhT.6MDexn09c4Fy1AT4i0i"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/BhT.6MDexn09c4Fy1AT4i0i Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 4 Aug 2009 14:53:52 +0100 Rob Kendrick wrote: > On Tue, 4 Aug 2009 15:46:42 +0200 > steve donovan wrote: >=20 > > On Tue, Aug 4, 2009 at 3:44 PM, Luiz Henrique de > > Figueiredo wrote: > > > And the strcpy helped?? > > > > >=20 > > Oh yes, then it was a well-behaved string. A mystery to me also. >=20 > Valgrind to the rescue. >=20 > B. Okay, as the output from my previous mail would suggest, the problem wasn't that the string wasn't null-terminated; rather, it was that the string was a little too null-terminated. Since print uses the C-side printf facility, it saw this string: foo\0\0\0\0...was created or renamed And only printed until the first NULL. My solution was simple: use lua_pushstring instead. Linux filenames can't have NULL in them anyway, right? Updates have been pushed to GitHub. -Rob --Sig_/BhT.6MDexn09c4Fy1AT4i0i Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkp4QRgACgkQUoGaR6SGEarSygCeIIXMBONw7BQzR3lmnM5013Yj 9vMAoJT6+7H9bDA5ty+QD4rL9aI7OzZ8 =ozny -----END PGP SIGNATURE----- --Sig_/BhT.6MDexn09c4Fy1AT4i0i-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 11:12:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74ECK9n022588; Tue, 4 Aug 2009 11:12:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A9DD192E9; Tue, 4 Aug 2009 11:11:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78844192E5 for ; Tue, 4 Aug 2009 11:11:53 -0300 (BRT) Received: by yxe5 with SMTP id 5so2944316yxe.33 for ; Tue, 04 Aug 2009 07:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=e5UIOqpbC1SVoJeGZwWta2nrDwQvz7hUIBpwGm6P4Qk=; b=CV16ga3lxnUlMnk480sf2okh5KxSy69vv3p7buYwzyFrOyTy3G3AEeNznRXCAHCMFf AkPlPYkQCxYaSkjZ7RJsGUis2d1tHkoXpPIijOljYJG+NP813pSHkkG0ABy173HbltXr oOvL7nrnV+Webg5jN1/RaxanvtaUF9sTCz5QU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=med7AOeTvt5p2o/KsKGdgWANDtgMZTmMnoKK8zlZngqI6kvCPI/39EcSxIgwz5htYo yEfu+8sNwbZfOO+7RZgNnfqH/8cz4RYGBWM1rtj1FX+gT2o4ZqtMWVwMrQ/phMrIrUYa ZU+6UEyhbmgJGN6y0r8OjB411YEeSF18ceOPI= MIME-Version: 1.0 Received: by 10.100.105.15 with SMTP id d15mr3241953anc.140.1249395111700; Tue, 04 Aug 2009 07:11:51 -0700 (PDT) In-Reply-To: <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> Date: Tue, 4 Aug 2009 10:11:51 -0400 X-Google-Sender-Auth: 9426ce0d8cd9a382 Message-ID: Subject: Re: [ANN] An extended Lua FAQ From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n74ECK9n022588 > But I am thinking - this is a very 1993 way of doing a FAQ.  Surely in > this age of Web 2.0 something more intelligent can be put together? > I'm wondering what Yuri and the other Web devs think. Clearly this > Does Not Scale. What I would suggest is using a simple Wiki/CMS, making each question a separate node, breaking it into a short answer (2-3 lines) and the details, then displaying just the short answers in the index with a link for more. (The link could just trigger AJAXy expansion of the answer on the same page.) You could keep it semi-controlled, giving editing privileges to some people, but not to all. You could also enable comments on each question's URL. You should add syntax highlighting too. The content could still all be in Markdown. Maybe add RSS too. If you are interested, I can recommend a Lua-based Wiki/CMS that can do all of this. :) - yuri -- http://spu.tnik.org/ From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 12:24:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74FOGVN007659; Tue, 4 Aug 2009 12:24:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5034818C43; Tue, 4 Aug 2009 12:23:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B632192DB for ; Tue, 4 Aug 2009 12:23:34 -0300 (BRT) Received: by fxm25 with SMTP id 25so4278913fxm.5 for ; Tue, 04 Aug 2009 08:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=na5E/YI/rikq8rCSb3f5ViVlNE/Wj9qfwiWJYHxMQAE=; b=D0GPuc0a36i+Jq2l5hbiQUaM7OfoJnw6E2IVCGEL9vKRksTAesdPSjSzJAUbjIgo5R Mq2/uDN3BVuiSNM2IydmzfZ8iy8UY99baysN5F2r+Og72WCX7Yc4Y88bL94NjUKwD4Bz gnxOhhIMuxXsT0wrYf42xOFazdNy88160O3nU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lCUUntBE21YGhIQCDyurlEFvWkzpFvCswvL6kRgzZqzZY6ma5sRWSddggGBaRR3MPa wPoCoas5ThMDNYzsIUxSgdLze/+Ybqq+KgEfARPYlu3Hm0EjOOQ1Ww1p2cQu9C0dEPzr 12wykyEQxMbVM/wGvSZc6owl/KlDByCIZpHP0= MIME-Version: 1.0 Received: by 10.239.131.143 with SMTP id 15mr191332hbn.140.1249399412322; Tue, 04 Aug 2009 08:23:32 -0700 (PDT) In-Reply-To: References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> Date: Tue, 4 Aug 2009 17:23:32 +0200 Message-ID: <560972290908040823y18bd7cc9p33deda94d8ce0b01@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 4, 2009 at 4:11 PM, Yuri Takhteyev wrote: > If you are interested, I can recommend a Lua-based Wiki/CMS that can > do all of this. :) Sounds very interesting, very scalable. Because really we would want to put _loads of nodes_ into it. All searchable, yes? Now only to find the time to get into this new fabled technology! steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 4 13:16:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n74GG5Rl017302; Tue, 4 Aug 2009 13:16:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A69719309; Tue, 4 Aug 2009 13:15:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A118B191D0 for ; Tue, 4 Aug 2009 13:15:22 -0300 (BRT) Received: by bwz6 with SMTP id 6so4195475bwz.5 for ; Tue, 04 Aug 2009 09:15:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.98.13 with SMTP id o13mr3989146bkn.80.1249402520035; Tue, 04 Aug 2009 09:15:20 -0700 (PDT) In-Reply-To: <89d273ba0907280844ned3a994j4a14633f16715d0b@mail.gmail.com> References: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> <89d273ba0907280844ned3a994j4a14633f16715d0b@mail.gmail.com> Date: Tue, 4 Aug 2009 19:15:19 +0300 X-Google-Sender-Auth: 7d1751f7822cf6c3 Message-ID: Subject: Re: tables holding nil: another way to look at the question itself From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n74GG5Rl017302 Sorry I missed your message completely... Please allow me to reply, if you still remember the conversation. On Tue, Jul 28, 2009 at 18:44, Jerome Vuarand wrote: > 2009/7/28 Cosmin Apreutesei : >>>> - why is there a difference between a list of nil arguments and no >>>> argument? --> nil is acting like any other value here. >>> >>> That's an extra feature provided for convenience. Just like you can >>> see tables as infinite key-value pairs, you can see argument list as >>> infinite list of values, defaulting to nil. As a convenience you can >>> get the number of values that was actually passed to a function call, >>> but you can still access all elements of the argument list (just call >>> select(42, ...) for example). >> >> Yea, but providing the arg. count is leaking the abstraction. If I am >> to make an optional parameter in the middle of the arg. list, should I >> account for the real arg. count or use an ipairs()-like iteration? In >> other words, should I account for trailing nils? What if some other >> function that my function wraps up is sensible about the arg. count as >> well? I have to carry around arg. count everywhere. Whereas without >> this leak, {...} would had been enough. > > Vararg lists are special kind of objects that you cannot instantiate > or reference. They are not tables. > > You don't have to use or allow the vararg feature of Lua. You can > write functions that expect a fixed number of arguments, no more and > no less (even with forced trailing nils). > You don't seem to have read my arguments about this. Allow me an example: Suppose I have to wrap function f in function g. I don't care for f's arguments, just need to pass them along as g receives them. Can I just ignore the feature of arg. count in this case? My own function g surely don't need the feature, but the function f, written by someone else, might be sensible about arg. count, forcing me to account for this feature too if I am to implement g() correctly. That's what I meant when I said I have to carry the abstraction leak everywhere -- after all, that's what makes it a leak. I see pairs() as an abstraction leak too, allowing me to "see" a small set of the invinite set of keys. Example: say I need an unordered list of objects, any of which can have a value attached. This can be represented in two obvious ways: 1) { {obj1, obj2, ... }, {[obj1] = obj1_value, [obj2] = obj2_value, ... } 2) { [obj1] = obj1_value, [obj2] = obj2_value, ... } The first allows objN_value to be any value, including nil, and doesn't require pairs() to exist. The second representation is made available by pairs(), and that's the one I see most of the time in Lua code, usually with nil values "fixed" with a boolean false value. When I see code like this I understand why some people believe tables "can't hold nil" :) Without pairs(), you couldn't have representation #2, and so no issues with nils, but pairs() leaks hidden information about tables, specifically the list of non-nil keys, a table which itself can't hold the nil :) I'm not pleading ditch pairs() here, it's probably too useful, but it all falls down on poor nil. Sorry if this sounds too pedantic or theoretical, but the effects are quite practical. >>> nil is a normal value, just like 42, true, false and "Hello World!". >>> The authors decided that the value associated to nil in a table should >>> always be nil, that key-value pair is read-only. Sometimes you have to >>> accept exceptions to the rule. That exception has motivations >>> (previously discussed on that list). >> >> I dig it. But then __index should not be called for the nil key to >> make sure the rule is not broken. > > We're talking about an exception, why should it obey another rule ? > Also the read-only nil-key pair is a feature of tables, while index > and newindex let you build other types of objects (eventually with > different semantics) on top of tables. Keep in mind that index and > newindex in tables are exceptions in the real of metamethods, because > they let you override a behaviour that is otherwise perfectly defined > and valid. Metatables should allow me to override the implementation of a table, they shouldn't let me corrupt its semantics (whatever that is) or things will break. > Also a side effect of the current iterator protocol is that it plays > nicely with table indexing. For example in >   local t = {} >   for x in values(...) do t[x] = true end > you are sure that the loop content will not throw an error (of course > the iterator itself can). That's not a crucial feature, but that's one > nonetheless. > That's looks like matching two limitations together to make a feature :) From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:02:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H2PkO027375; Thu, 6 Aug 2009 14:02:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8050B1839D; Thu, 6 Aug 2009 14:01:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9234192F2 for ; Tue, 4 Aug 2009 13:45:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so5048412ewy.5 for ; Tue, 04 Aug 2009 09:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=w6aAGpePgZhlPTbaAg3MUynpJDbEo3+Wu6VzuCJkhZ0=; b=n39u/8vdAAztcJzyReWSRiKshfSZe9kA2HenRDxwd7zFNyQT/rj+FBbHCxZ6vRwH3P Q1qznsYbCRbqyeNxic8djCGtQ9WrqvcKUBYz055Kn5wjf+iu0KkpsPjNVoXxsUUPPnoh 47HO3cyrHBnyjhynoxUcVPvnDR6ycLT+p8/mU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=iWW33M31p5yuNAf2Ab4mdD+RwFHZoaZqRlDeK/oqJwPp4e2NYXO2nv/jZtEk0AvWFP hWdHsJWqMYuAxHb02KOk4gaKkAzhA20G9SmNOZ8En3rYk4Pso8gcjuZ1geP37SdbrvhJ 1jBtZ46IltM2utg6COuHx+h++JZnlAebeYNLM= Received: by 10.210.76.6 with SMTP id y6mr9037865eba.64.1249404405038; Tue, 04 Aug 2009 09:46:45 -0700 (PDT) Received: from ?95.78.64.153? ([95.78.64.153]) by mx.google.com with ESMTPS id 10sm3398672eyz.31.2009.08.04.09.46.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Aug 2009 09:46:44 -0700 (PDT) Date: Tue, 4 Aug 2009 20:44:35 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <14129165.20090804204435@gmail.com> To: Yuri Takhteyev Subject: Re[2]: [ANN] An extended Lua FAQ In-Reply-To: References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Yuri, Tuesday, August 4, 2009, 6:11:51 PM, you wrote: > What I would suggest is using a simple Wiki/CMS, making each question > a separate node, breaking it into a short answer (2-3 lines) and the > details, then displaying just the short answers in the index with a > link for more. it was great to read entire faq with a cup of coffee (or print it), so it will be great to have such option. for editing, i agree that each node should be editable at its own, like it is done in many modern wiki engines -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:03:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H34jv027538; Thu, 6 Aug 2009 14:03:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35202183A2; Thu, 6 Aug 2009 14:01:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBA24192F2 for ; Tue, 4 Aug 2009 13:55:43 -0300 (BRT) Received: by ywh26 with SMTP id 26so5367891ywh.5 for ; Tue, 04 Aug 2009 09:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=JVqsWm+uI2u/4LoW+S+GnOU6jMeLz/J+cnxn+PzqBlU=; b=VpnfvTv5l1Dj+iKIPDPFiwHXfDR11KBTCooWKF9wqb3fiCe6oYcnl4dYlCbDLw6oIH DFfT6qCNQe3OueU/jHFyd4RYi50pEvj89TFOJv7yUp7/FLZcRKySPLYsbV6fo8zEPoGy Ysc40GNgeRV5VFThDqkR41jO1fIDwOTtiHfDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=VuyWAqPQ9itRdT0D5VPAjH49v6wFKmROed8R1W5Hqsdx3Jj2yJ+rzAZeG5JT2LFPlB 6RlG27UXOhB6v7eFXPt7XsVAd7VTTUosVISFD7rFm2/QsanPh3pNwR2FL5eIBWUzdVzz RjqxdjllBjBC/TFHpMjt5IJr3mKY4phMyJP68= MIME-Version: 1.0 Received: by 10.100.167.5 with SMTP id p5mr10161517ane.36.1249404992235; Tue, 04 Aug 2009 09:56:32 -0700 (PDT) In-Reply-To: <14129165.20090804204435@gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <97d148f50908031119x7c8c4c79l809a2b5773aa1b7a@mail.gmail.com> <560972290908031132n6e74287dw6fce03ac7de814ec@mail.gmail.com> <97d148f50908031154x1bda3c55ga6a215000578e520@mail.gmail.com> <560972290908040000q2e222d7er988c99908691d36@mail.gmail.com> <790db3550908040213h7383954eo38bb1ce4225d98c9@mail.gmail.com> <560972290908040252m79fea96bwb37a3d660bdeed80@mail.gmail.com> <14129165.20090804204435@gmail.com> Date: Tue, 4 Aug 2009 12:56:32 -0400 X-Google-Sender-Auth: eb025a5f2103221d Message-ID: Subject: Re: Re[2]: [ANN] An extended Lua FAQ From: Yuri Takhteyev To: Bulat Ziganshin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > it was great to read entire faq with a cup of coffee (or print it), so > it will be great to have such option. for editing, i agree that each > node should be editable at its own, like it is done in many modern > wiki engines That could be done just by adding "Expand All Answers" button. The reason I am suggesting making them separate nodes is because some of the answers are already long and I can see the short ones turning into mini-essays eventually. A good way to deal with this is to just assume that each answer has two parts - a brief summary and the gory details. - yuri -- http://spu.tnik.org/ From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:03:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H3sRh027711; Thu, 6 Aug 2009 14:03:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98C771840A; Thu, 6 Aug 2009 14:02:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail2.edulinksys.com (mail2.edulinksys.com [67.151.130.237]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8587E192C1 for ; Tue, 4 Aug 2009 15:11:35 -0300 (BRT) Received: from ESS5 ([127.0.0.1]) by mail2.edulinksys.com with hMailServer ; Tue, 4 Aug 2009 11:11:29 -0700 Received: from [192.168.111.112] ([67.151.130.226] helo=[192.168.111.112]) with IPv4:25 by ASSP.nospam; 4 Aug 2009 11:11:29 -0700 Message-ID: <4A7879C8.6090306@edulinksys.com> Date: Tue, 04 Aug 2009 11:11:20 -0700 From: Evan Burkitt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090408 Eudora/3.0b2 MIME-Version: 1.0 To: Lua list Subject: Re: Using part of a Lua script from C References: <4A77B52A.4040607@edulinksys.com> <1079b050908032159k787c1e0cpfe73b62dc44f6352@mail.gmail.com> In-Reply-To: <1079b050908032159k787c1e0cpfe73b62dc44f6352@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 08/03/2009 21:59, Wesley Smith wrote: > Obviously you could do some basic string matching on the script to > clip it to the appropriate length. You could also do something pretty > basic like: > > // in C > lua_pushboolean(L, 1); > lua_setglobal(L, "global_var_set_by_app") > ... > --code to allow the script to run stand-alone: > if(not global_var_set_by_app) then > a = 1 > b = 2 > filter(a,b) > end > Processing the script to remove any non-functions was my original thought; I wanted to be sure I wasn't missing any easier fix. I like the if (not...) idea too, especially for development and testing. For "production", though (whatever that ends up being), explicitly preventing execution by extracting only the functions looks like the ultimate solution. I appreciate your help. Thanks, too, to Hans Elbers and Jerome Vuarand for their variations of the "am-I-standalone" test idea. -evan From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:04:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H4YTD027895; Thu, 6 Aug 2009 14:04:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9DE4184A4; Thu, 6 Aug 2009 14:03:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (smtp.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89B8618EA0 for ; Tue, 4 Aug 2009 16:12:09 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n74JBvoY009489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 4 Aug 2009 16:12:00 -0300 (UYT) Subject: Re: [ANN] An extended Lua FAQ From: Jorge To: Lua list In-Reply-To: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Content-Type: text/plain Date: Tue, 04 Aug 2009 16:11:57 -0300 Message-Id: <1249413117.24659.9.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Tue, 04 Aug 2009 16:12:00 -0300 (UYT) X-Spam-Score: -0.762 () AWL,BAYES_20,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Quick! Fix Roberto's last name before he gets angry! :) Jorge On Mon, 2009-08-03 at 18:27 +0200, steve donovan wrote: > hi all, > > Although really the title should be 'Frequently Anticipated Questions'. From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:05:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H5HF3028083; Thu, 6 Aug 2009 14:05:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8162F1845B; Thu, 6 Aug 2009 14:04:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-15.bluehost.com (outbound-mail-15.bluehost.com [69.89.18.115]) by bazar2.conectiva.com.br (Postfix) with SMTP id E1D091917B for ; Tue, 4 Aug 2009 16:24:39 -0300 (BRT) Received: (qmail 23214 invoked by uid 0); 4 Aug 2009 19:24:37 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy1.bluehost.com with SMTP; 4 Aug 2009 19:24:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=Jjo3emi+JlT8TkJN4j+mNSmIlh4gHvxW68F2qpjSsjaW2XBdMZ0s3mlyGlUB2PB7+f2U2THLjpQIuNIbQMxtViQKB9ouP3RhC/cbkyN2ZtULvXmgLai2QBDann5PX2ss; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MYPcj-0003Xt-FS; Tue, 04 Aug 2009 13:24:37 -0600 Date: Tue, 4 Aug 2009 14:24:27 -0500 From: Rob Hoelz To: Alexandre Erwin Ittner Subject: Re: [ANN] linotify Message-ID: <20090804142427.07f43f2a@hoelzro.net> In-Reply-To: <20090804152616.e8201b6f.alexandre@ittner.com.br> References: <20090803135559.1fc70082@hoelzro.net> <20090804152616.e8201b6f.alexandre@ittner.com.br> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/g=DgZs.rFKGNoVZTO4/U=vg"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/g=DgZs.rFKGNoVZTO4/U=vg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 4 Aug 2009 15:26:16 -0300 Alexandre Erwin Ittner wrote: > Rob Hoelz wrote >=20 > > Let me know if you have any suggestions/find any bugs/etc. >=20 > Hi Rob, >=20 > Thanks for this binding, it will be pretty useful for me. I have just > written a new Makefile, making some build procedures easier and more > portable (automatic detection of Lua libraries, paths and filenames). > I think it will be interesting for packagers.=20 >=20 > Best regards, >=20 Thanks for the patch, Alexandre. I've committed it and pushed it to GitHub. -Rob --Sig_/g=DgZs.rFKGNoVZTO4/U=vg Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkp4iu4ACgkQUoGaR6SGEart1ACgnlBRyAIqP0w2oehHq0XrrjGA HpsAoM7mTXTbJvuymBRd5GhVvzU+ke+u =nfA4 -----END PGP SIGNATURE----- --Sig_/g=DgZs.rFKGNoVZTO4/U=vg-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:08:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H8Jem028764; Thu, 6 Aug 2009 14:08:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6827818484; Thu, 6 Aug 2009 14:07:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vms173001pub.verizon.net (vms173001pub.verizon.net [206.46.173.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C6DD18704 for ; Tue, 4 Aug 2009 22:37:17 -0300 (BRT) Received: from homedog.cs.tufts.edu ([68.163.169.197]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KNV00HXOR5KNDB4@vms173001.mailsrvcs.net> for lua@bazar2.conectiva.com.br; Tue, 04 Aug 2009 20:36:56 -0500 (CDT) Received: by homedog.cs.tufts.edu (Postfix, from userid 32074) id D28245004DA0B; Tue, 04 Aug 2009 21:36:55 -0400 (EDT) To: lua@bazar2.conectiva.com.br Subject: how to load a very large table with more than 2^18 literal strings? Message-id: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> Date: Tue, 04 Aug 2009 21:36:55 -0400 (EDT) From: nr@cs.tufts.edu (Norman Ramsey) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm accustomed to use Lua to store persistent data structures on disk. Unfortunately, in my latest venture, I run out of string space. I did a little investigation in the source, and it appears that only 2^18 literal constants may appear in any one source file, and this appears to be a hard limit built into the bytecode format. I would like to write large Lua tables out to disk, possibly nested, but with no sharing or cycles. Does anybody have any suggestions how to achieve this without running afoul of the dreaded 'constant table overflow'? Norman From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:09:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H93Ta028978; Thu, 6 Aug 2009 14:09:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24C6C1877F; Thu, 6 Aug 2009 14:07:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA69B18704 for ; Tue, 4 Aug 2009 22:50:34 -0300 (BRT) Received: by ewy26 with SMTP id 26so5375528ewy.5 for ; Tue, 04 Aug 2009 18:50:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.12.13 with SMTP id 13mr7532890ebl.12.1249437035907; Tue, 04 Aug 2009 18:50:35 -0700 (PDT) Date: Tue, 4 Aug 2009 21:50:35 -0400 X-Google-Sender-Auth: 9fc0277a4a7372a4 Message-ID: Subject: lmathx missing nexttoward in cygwin From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean lmathx [1] fails compilation under Cygwin: lmathx.o:lmathx.c:(.text+0x85c): undefined reference to `_nexttoward' Cygwin uses the newlib [2-3] C standard library, which lacks nexttoward [4]. This is preventing LuaRocks and LuaDist from installing lmathx cleanly under Cygwin. The following patch will allow it to work: --- lmathx.c~ +++ lmathx.c @@ -186,11 +186,13 @@ return 1; } +#ifdef HAVE_NEXTTOWARD static int Lnexttoward(lua_State *L) { lua_pushnumber(L,nexttoward(A(1),A(2))); return 1; } +#endif static int Lremainder(lua_State *L) { @@ -263,7 +265,9 @@ { "logb", Llogb }, { "nearbyint", Lnearbyint }, { "nextafter", Lnextafter }, +#ifdef HAVE_NEXTTOWARD { "nexttoward", Lnexttoward }, +#endif { "remainder", Lremainder }, { "rint", Lrint }, { "round", Lround }, BTW, it's not clear to me when nexttoward is useful over nextafter. Moreover, nexttoward has a signature using "long double", but lmathx treats double and long double both as a lua_Number. [1] http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lmathx [2] http://en.wikipedia.org/wiki/Newlib [3] http://sourceware.org/newlib/libm.html [4] http://www.cygwin.com/ml/cygwin/2009-07/msg00919.html From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:09:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H9mS0029149; Thu, 6 Aug 2009 14:09:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C54B18813; Thu, 6 Aug 2009 14:08:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6192F187A1 for ; Wed, 5 Aug 2009 00:05:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so5403405ewy.5 for ; Tue, 04 Aug 2009 20:05:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.112.4 with SMTP id k4mr9806655ebc.22.1249441507434; Tue, 04 Aug 2009 20:05:07 -0700 (PDT) In-Reply-To: <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> <1C69BB72-58E0-4A25-8B2D-7D9103C40DC7@grubmah.com> Date: Tue, 4 Aug 2009 23:05:07 -0400 X-Google-Sender-Auth: 241d50f882d93000 Message-ID: Subject: Re: is it possible to make longjmp-free Lua? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Jul 28, 2009 at 1:50 AM, Mark Hamburg wrote: > I like the light userdata holding the C function pointer trick. Which I see now was previously proposed in a form. [1] myluacpcall also extends cpcall to take and return arbitrary arguments a la pcall. [1] http://lua-users.org/lists/lua-l/2004-08/msg00415.html From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:12:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76H7cVL028642; Thu, 6 Aug 2009 14:07:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73D9F183B3; Thu, 6 Aug 2009 14:07:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A622188A1 for ; Tue, 4 Aug 2009 21:34:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so5345131ewy.5 for ; Tue, 04 Aug 2009 17:34:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.43.10 with SMTP id q10mr9721650ebq.23.1249432466727; Tue, 04 Aug 2009 17:34:26 -0700 (PDT) Date: Tue, 4 Aug 2009 20:34:26 -0400 X-Google-Sender-Auth: 964ef4b3a7d79241 Message-ID: Subject: symbol for concatenation operator (was Re: [ANN] An extended Lua FAQ) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 3, 2009 at 3:47 PM, Colin wrote: > On Mon, Aug 3, 2009 at 8:58 PM, Luiz Henrique de wrote: >>> Regarding the strings as monoid, with the addition as concatenation, >>> is nowhere near wild, it's wildly normal ;-) >> >> Sure. But that does not mean you *need* to use "+" to represent its operation. >> AWK for instance uses nothing (i.e., juxtaposition), which is the popular >> practice in formal languages > ....Presumably there are some other reasons for this design decision. > Actually, I darkly remember something, let's check... Yes, the > "Evolution" paper on Lua says "Because the language allows coercion of > strings to numbers, a + signal would be ambiguous; so, we created the > syntax .. (two dots) for that operation [concatenation]." Also should be considered: how to represent repetition. Formal languages use "x y^n" or "x (dot) y^n" to represent one x followed by n y's. Likewise, Lpeg uses the operator pair (*,^) for concatenation and repetition (sort-of), while languages like Python use the operator pair (+,*). Lua has no operator suitable for representing n repetitions via "..". From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:13:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HDKWG030050; Thu, 6 Aug 2009 14:13:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A10F218B5F; Thu, 6 Aug 2009 14:12:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B800A18709 for ; Wed, 5 Aug 2009 11:47:49 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n75ElmM5026955 for ; Wed, 5 Aug 2009 11:47:48 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n75ElmW08657; Wed, 5 Aug 2009 11:47:48 -0300 Date: Wed, 5 Aug 2009 11:47:47 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: is the list server down? Message-ID: <20090805114747.A8654@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br bazar2.conectiva.com.br seems to be up: it answers smtp connections but not http. I wonder whether the list is down... From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:14:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HEEBC030519; Thu, 6 Aug 2009 14:14:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFC0118CCC; Thu, 6 Aug 2009 14:13:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA9F7186A1 for ; Wed, 5 Aug 2009 13:07:28 -0300 (BRT) Received: by fxm25 with SMTP id 25so215019fxm.5 for ; Wed, 05 Aug 2009 09:07:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.119.207 with SMTP id a15mr1013309bkr.132.1249486611155; Wed, 05 Aug 2009 08:36:51 -0700 (PDT) Date: Wed, 5 Aug 2009 18:36:51 +0300 X-Google-Sender-Auth: 063306d44a9acfec Message-ID: Subject: handling asynchronous events in lua From: Cosmin Apreutesei To: lua Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I have a library in which I can register asynchronous callbacks. Problem is, I can't call Lua inside the callback because the state is not consistent (obviously). Is there any way I can handle the lua state in consistent steps so I can enter back to lua and call a lua function? Python has this signal lib[1] that seems to work this way, executing the callbacks just between "atomic" python instructions. Sorry if this is old potatoes, I'm reading the list as fast as I can :) Another solution would be to keep the callbacks into FIFO list and have lua pull them from there -- and let the user solve the threading problem separately, with a threading library or with coroutines, depending on the design of the app. I was thinking of adding this functionality to alien as a general solution for async. callbacks. Is that a generally useful pattern to belong to a binding library or just my special needs? [1] http://docs.python.org/library/signal.html From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:20:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HKPNd032171; Thu, 6 Aug 2009 14:20:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EEFD1921E; Thu, 6 Aug 2009 14:20:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83F78183A4 for ; Thu, 6 Aug 2009 06:57:46 -0300 (BRT) Received: by fxm25 with SMTP id 25so697210fxm.5 for ; Thu, 06 Aug 2009 02:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=TZ1t4j3wg/lwiSMKE/nJOcDbdcDjL1pDLO6gksvAxPE=; b=QFHa+HQMPwAkilWbww53qyc5jDBqUt3M2ggXJI3pP9DTy+PXnTZ2hKYXUW7sTbgJA/ L0QTFtWTKLPLkU94aq7/tLXGA8LdFfkkjf+XGPLBhcjVxeq4btE5gfA1xPUBfK6Yxazh nYzQ7dXZY3w/LJaw43n5x++ajaVgTVN/t/AWc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=X6IorG4FZ4vz2lMpzwiZSiZQru6A4swEEG0Jbk6AP1TGFic+J0gvnv+2HRu/KYg1Px dUOpFnfXCps/OoApzafzWCsfQUE1OBRCWoqu4RYcwBn87F4PrYUUUdGwLjaZoE+fHcIM pU2CdX9J0nf/1lymMu87pPjsxa4UWKO4k4UEw= MIME-Version: 1.0 Received: by 10.86.98.19 with SMTP id v19mr4792985fgb.29.1249552664469; Thu, 06 Aug 2009 02:57:44 -0700 (PDT) Date: Thu, 6 Aug 2009 10:57:44 +0100 Message-ID: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> Subject: How do I pass a pointer to a lua function into C++? From: Colm Sloan To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm new to Lua so I apologize for any horrible mistakes I'm making here. I have a timer that I want to run two pieces of code in Lua periodically. Here's my attempt so far: -- Lua code delay = 10 t = Timer(delay, function() [code] end, function() [code] end) //C++ code Timer::Timer(int x, int y, ??? luaFunction1, ??? luaFunction2)// I don't know what object they'd be { //is any of this right? lua_pushvalue( L, -1 ); // this is meant to push the function onto the stack m_timerFunction2 = luaL_ref( L, LUA_REGISTRYINDEX ); //which I then move to the registry lua_pushvalue( L, -1 ); m_timerFunction1 = luaL_ref( L, LUA_REGISTRYINDEX ); } Timer::ExecuteTimer1() //just making up a simple name for the example { lua_rawgeti( L, LUA_REGISTRYINDEX, m_timerFunction1 ); lua_call( L, 0, 0 ); //is this right? } //something like this? Timer::~Timer() { luaL_unref( L, LUA_REGISTRYINDEX, m_timerFunction1 ); luaL_unref( L, LUA_REGISTRYINDEX, m_timerFunction2 ); } } From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:23:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HN9ee000390; Thu, 6 Aug 2009 14:23:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 593E218F06; Thu, 6 Aug 2009 14:21:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FC10183A2 for ; Thu, 6 Aug 2009 11:34:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so981671ewy.5 for ; Thu, 06 Aug 2009 07:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=as1HP0Xn9fK7Rv1huM115UmyIJSTvU0vvoNwms0UvaY=; b=Gv2wRFpjjjmhIBDYoIUr/n87QKF+/0mHwPOX62ALckGhFxxPLdE0D+9vO2LIKGPUHS aPCC/It/ehDmhnryXBwdQouH2lGx9CSTTAV6Tg+zYfdgbDAEF7wP3C6AFuNStQeR3R8O zZC5vT70EBo/gtTjPUHk6FHExNfqdzxgw+h9c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=vteMBiSMXEZmWGe9HYEtdh0cueP4Pizi8MUdw+iwKwHB8+MmmC8fb415dLD1SEBxr+ Tnel+O71UWhGwbG8+YgO0eojEVbnlEMBEsXM+shLffzyFlSREtPEYEzFaWh6AsXjzQFo KY63EBH3ttE9b8lkssxAbbMENDu3irh27fRuQ= MIME-Version: 1.0 Received: by 10.216.18.199 with SMTP id l49mr2009126wel.23.1249569291139; Thu, 06 Aug 2009 07:34:51 -0700 (PDT) From: Jerome Vuarand Date: Thu, 6 Aug 2009 16:34:31 +0200 Message-ID: <89d273ba0908060734g6170dufc1d3d4165f2640b@mail.gmail.com> Subject: Feature proposal: Fast lua_lock To: Lua Content-Type: multipart/mixed; boundary=0016e64c2a48b87aa004707a050e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64c2a48b87aa004707a050e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi list, I'm currently writing a library that allow passing data between several threads, each running a Lua interpreter. The shared data is stored in a shared Lua state. The lua_lock mechanism ensures that my two (or more) threads cannot corrupt the state while accessing it concurrently. However some manipulations of the shared state imply calling several functions of the Lua API, and since between each call the state is unlocked another thread could have messed with the stack state. For that reason I call lua_lock in my library, and made sure recursive calls to lua_lock were ok. However my initial implementation of lua_lock was a fast macro accessing members of the lua_State structure. Since the structure is not exposed by the Lua API, I cannot use these macros outside of Lua source code, and had to create a lua_lock function. To keeps benefits of both the macro (very fast locking inside Lua source code) and the function (ability to lock from outside Lua code), I've modified Lua sources with the attached patch. It replaces all calls to lua_lock (resp. lua_unlock) with calls to luai_lock (resp. luai_unlock), which is defined as a no-op macro if not otherwise defined (like the old lua_lock). Additionnally, I've added two functions called lua_lock and lua_unlock, declared in lua.h and implemented in lstate.c, which simply call luai_lock and luai_unlock respectively. It would be nice to incorporate such changes in the next version of Lua. --0016e64c2a48b87aa004707a050e Content-Type: application/octet-stream; name="luai-lock.patch" Content-Disposition: attachment; filename="luai-lock.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fy1l5nek0 ZGlmZiAtZHVyTiBhL2x1YS01LjEuNC9zcmMvbGFwaS5jIGIvbHVhLTUuMS40L3NyYy9sYXBpLmMN Ci0tLSBhL2x1YS01LjEuNC9zcmMvbGFwaS5jCUZyaSBKdWwgIDQgMjA6NDE6MTggMjAwOA0KKysr IGIvbHVhLTUuMS40L3NyYy9sYXBpLmMJVGh1IEF1ZyAgNiAxNjowODo1NyAyMDA5DQpAQCAtOTQs NyArOTQsNyBAQA0KIA0KIExVQV9BUEkgaW50IGx1YV9jaGVja3N0YWNrIChsdWFfU3RhdGUgKkws IGludCBzaXplKSB7DQogICBpbnQgcmVzID0gMTsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9s b2NrKEwpOw0KICAgaWYgKHNpemUgPiBMVUFJX01BWENTVEFDSyB8fCAoTC0+dG9wIC0gTC0+YmFz ZSArIHNpemUpID4gTFVBSV9NQVhDU1RBQ0spDQogICAgIHJlcyA9IDA7ICAvKiBzdGFjayBvdmVy ZmxvdyAqLw0KICAgZWxzZSBpZiAoc2l6ZSA+IDApIHsNCkBAIC0xMDIsNyArMTAyLDcgQEANCiAg ICAgaWYgKEwtPmNpLT50b3AgPCBMLT50b3AgKyBzaXplKQ0KICAgICAgIEwtPmNpLT50b3AgPSBM LT50b3AgKyBzaXplOw0KICAgfQ0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwp Ow0KICAgcmV0dXJuIHJlczsNCiB9DQogDQpAQCAtMTEwLDcgKzExMCw3IEBADQogTFVBX0FQSSB2 b2lkIGx1YV94bW92ZSAobHVhX1N0YXRlICpmcm9tLCBsdWFfU3RhdGUgKnRvLCBpbnQgbikgew0K ICAgaW50IGk7DQogICBpZiAoZnJvbSA9PSB0bykgcmV0dXJuOw0KLSAgbHVhX2xvY2sodG8pOw0K KyAgbHVhaV9sb2NrKHRvKTsNCiAgIGFwaV9jaGVja25lbGVtcyhmcm9tLCBuKTsNCiAgIGFwaV9j aGVjayhmcm9tLCBHKGZyb20pID09IEcodG8pKTsNCiAgIGFwaV9jaGVjayhmcm9tLCB0by0+Y2kt PnRvcCAtIHRvLT50b3AgPj0gbik7DQpAQCAtMTE4LDcgKzExOCw3IEBADQogICBmb3IgKGkgPSAw OyBpIDwgbjsgaSsrKSB7DQogICAgIHNldG9iajJzKHRvLCB0by0+dG9wKyssIGZyb20tPnRvcCAr IGkpOw0KICAgfQ0KLSAgbHVhX3VubG9jayh0byk7DQorICBsdWFpX3VubG9jayh0byk7DQogfQ0K IA0KIA0KQEAgLTEyOSwyMiArMTI5LDIyIEBADQogDQogTFVBX0FQSSBsdWFfQ0Z1bmN0aW9uIGx1 YV9hdHBhbmljIChsdWFfU3RhdGUgKkwsIGx1YV9DRnVuY3Rpb24gcGFuaWNmKSB7DQogICBsdWFf Q0Z1bmN0aW9uIG9sZDsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgb2xk ID0gRyhMKS0+cGFuaWM7DQogICBHKEwpLT5wYW5pYyA9IHBhbmljZjsNCi0gIGx1YV91bmxvY2so TCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVybiBvbGQ7DQogfQ0KIA0KIA0KIExVQV9B UEkgbHVhX1N0YXRlICpsdWFfbmV3dGhyZWFkIChsdWFfU3RhdGUgKkwpIHsNCiAgIGx1YV9TdGF0 ZSAqTDE7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGx1YUNfY2hlY2tH QyhMKTsNCiAgIEwxID0gbHVhRV9uZXd0aHJlYWQoTCk7DQogICBzZXR0aHZhbHVlKEwsIEwtPnRv cCwgTDEpOw0KICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlf dW5sb2NrKEwpOw0KICAgbHVhaV91c2Vyc3RhdGV0aHJlYWQoTCwgTDEpOw0KICAgcmV0dXJuIEwx Ow0KIH0NCkBAIC0xNjIsNyArMTYyLDcgQEANCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3NldHRv cCAobHVhX1N0YXRlICpMLCBpbnQgaWR4KSB7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9j ayhMKTsNCiAgIGlmIChpZHggPj0gMCkgew0KICAgICBhcGlfY2hlY2soTCwgaWR4IDw9IEwtPnN0 YWNrX2xhc3QgLSBMLT5iYXNlKTsNCiAgICAgd2hpbGUgKEwtPnRvcCA8IEwtPmJhc2UgKyBpZHgp DQpAQCAtMTczLDM2ICsxNzMsMzYgQEANCiAgICAgYXBpX2NoZWNrKEwsIC0oaWR4KzEpIDw9IChM LT50b3AgLSBMLT5iYXNlKSk7DQogICAgIEwtPnRvcCArPSBpZHgrMTsgIC8qIGBzdWJ0cmFjdCcg aW5kZXggKGluZGV4IGlzIG5lZ2F0aXZlKSAqLw0KICAgfQ0KLSAgbHVhX3VubG9jayhMKTsNCisg IGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3JlbW92ZSAobHVh X1N0YXRlICpMLCBpbnQgaWR4KSB7DQogICBTdGtJZCBwOw0KLSAgbHVhX2xvY2soTCk7DQorICBs dWFpX2xvY2soTCk7DQogICBwID0gaW5kZXgyYWRyKEwsIGlkeCk7DQogICBhcGlfY2hlY2t2YWxp ZGluZGV4KEwsIHApOw0KICAgd2hpbGUgKCsrcCA8IEwtPnRvcCkgc2V0b2JqczJzKEwsIHAtMSwg cCk7DQogICBMLT50b3AtLTsNCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsN CiB9DQogDQogDQogTFVBX0FQSSB2b2lkIGx1YV9pbnNlcnQgKGx1YV9TdGF0ZSAqTCwgaW50IGlk eCkgew0KICAgU3RrSWQgcDsNCiAgIFN0a0lkIHE7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlf bG9jayhMKTsNCiAgIHAgPSBpbmRleDJhZHIoTCwgaWR4KTsNCiAgIGFwaV9jaGVja3ZhbGlkaW5k ZXgoTCwgcCk7DQogICBmb3IgKHEgPSBMLT50b3A7IHE+cDsgcS0tKSBzZXRvYmpzMnMoTCwgcSwg cS0xKTsNCiAgIHNldG9ianMycyhMLCBwLCBMLT50b3ApOw0KLSAgbHVhX3VubG9jayhMKTsNCisg IGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3JlcGxhY2UgKGx1 YV9TdGF0ZSAqTCwgaW50IGlkeCkgew0KICAgU3RrSWQgbzsNCi0gIGx1YV9sb2NrKEwpOw0KKyAg bHVhaV9sb2NrKEwpOw0KICAgLyogZXhwbGljaXQgdGVzdCBmb3IgaW5jb21wYXRpYmxlIGNvZGUg Ki8NCiAgIGlmIChpZHggPT0gTFVBX0VOVklST05JTkRFWCAmJiBMLT5jaSA9PSBMLT5iYXNlX2Np KQ0KICAgICBsdWFHX3J1bmVycm9yKEwsICJubyBjYWxsaW5nIGVudmlyb25tZW50Iik7DQpAQCAt MjIxLDE1ICsyMjEsMTUgQEANCiAgICAgICBsdWFDX2JhcnJpZXIoTCwgY3Vycl9mdW5jKEwpLCBM LT50b3AgLSAxKTsNCiAgIH0NCiAgIEwtPnRvcC0tOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1 YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3B1c2h2YWx1ZSAobHVh X1N0YXRlICpMLCBpbnQgaWR4KSB7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsN CiAgIHNldG9iajJzKEwsIEwtPnRvcCwgaW5kZXgyYWRyKEwsIGlkeCkpOw0KICAgYXBpX2luY3Jf dG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiAN CkBAIC0yODcsMTEgKzI4NywxMSBAQA0KIExVQV9BUEkgaW50IGx1YV9lcXVhbCAobHVhX1N0YXRl ICpMLCBpbnQgaW5kZXgxLCBpbnQgaW5kZXgyKSB7DQogICBTdGtJZCBvMSwgbzI7DQogICBpbnQg aTsNCi0gIGx1YV9sb2NrKEwpOyAgLyogbWF5IGNhbGwgdGFnIG1ldGhvZCAqLw0KKyAgbHVhaV9s b2NrKEwpOyAgLyogbWF5IGNhbGwgdGFnIG1ldGhvZCAqLw0KICAgbzEgPSBpbmRleDJhZHIoTCwg aW5kZXgxKTsNCiAgIG8yID0gaW5kZXgyYWRyKEwsIGluZGV4Mik7DQogICBpID0gKG8xID09IGx1 YU9fbmlsb2JqZWN0IHx8IG8yID09IGx1YU9fbmlsb2JqZWN0KSA/IDAgOiBlcXVhbG9iaihMLCBv MSwgbzIpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJu IGk7DQogfQ0KIA0KQEAgLTI5OSwxMiArMjk5LDEyIEBADQogTFVBX0FQSSBpbnQgbHVhX2xlc3N0 aGFuIChsdWFfU3RhdGUgKkwsIGludCBpbmRleDEsIGludCBpbmRleDIpIHsNCiAgIFN0a0lkIG8x LCBvMjsNCiAgIGludCBpOw0KLSAgbHVhX2xvY2soTCk7ICAvKiBtYXkgY2FsbCB0YWcgbWV0aG9k ICovDQorICBsdWFpX2xvY2soTCk7ICAvKiBtYXkgY2FsbCB0YWcgbWV0aG9kICovDQogICBvMSA9 IGluZGV4MmFkcihMLCBpbmRleDEpOw0KICAgbzIgPSBpbmRleDJhZHIoTCwgaW5kZXgyKTsNCiAg IGkgPSAobzEgPT0gbHVhT19uaWxvYmplY3QgfHwgbzIgPT0gbHVhT19uaWxvYmplY3QpID8gMA0K ICAgICAgICA6IGx1YVZfbGVzc3RoYW4oTCwgbzEsIG8yKTsNCi0gIGx1YV91bmxvY2soTCk7DQor ICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVybiBpOw0KIH0NCiANCkBAIC0zNDMsMTUgKzM0Mywx NSBAQA0KIExVQV9BUEkgY29uc3QgY2hhciAqbHVhX3RvbHN0cmluZyAobHVhX1N0YXRlICpMLCBp bnQgaWR4LCBzaXplX3QgKmxlbikgew0KICAgU3RrSWQgbyA9IGluZGV4MmFkcihMLCBpZHgpOw0K ICAgaWYgKCF0dGlzc3RyaW5nKG8pKSB7DQotICAgIGx1YV9sb2NrKEwpOyAgLyogYGx1YVZfdG9z dHJpbmcnIG1heSBjcmVhdGUgYSBuZXcgc3RyaW5nICovDQorICAgIGx1YWlfbG9jayhMKTsgIC8q IGBsdWFWX3Rvc3RyaW5nJyBtYXkgY3JlYXRlIGEgbmV3IHN0cmluZyAqLw0KICAgICBpZiAoIWx1 YVZfdG9zdHJpbmcoTCwgbykpIHsgIC8qIGNvbnZlcnNpb24gZmFpbGVkPyAqLw0KICAgICAgIGlm IChsZW4gIT0gTlVMTCkgKmxlbiA9IDA7DQotICAgICAgbHVhX3VubG9jayhMKTsNCisgICAgICBs dWFpX3VubG9jayhMKTsNCiAgICAgICByZXR1cm4gTlVMTDsNCiAgICAgfQ0KICAgICBsdWFDX2No ZWNrR0MoTCk7DQogICAgIG8gPSBpbmRleDJhZHIoTCwgaWR4KTsgIC8qIHByZXZpb3VzIGNhbGwg bWF5IHJlYWxsb2NhdGUgdGhlIHN0YWNrICovDQotICAgIGx1YV91bmxvY2soTCk7DQorICAgIGx1 YWlfdW5sb2NrKEwpOw0KICAgfQ0KICAgaWYgKGxlbiAhPSBOVUxMKSAqbGVuID0gdHN2YWx1ZShv KS0+bGVuOw0KICAgcmV0dXJuIHN2YWx1ZShvKTsNCkBAIC0zNjYsOSArMzY2LDkgQEANCiAgICAg Y2FzZSBMVUFfVFRBQkxFOiByZXR1cm4gbHVhSF9nZXRuKGh2YWx1ZShvKSk7DQogICAgIGNhc2Ug TFVBX1ROVU1CRVI6IHsNCiAgICAgICBzaXplX3QgbDsNCi0gICAgICBsdWFfbG9jayhMKTsgIC8q IGBsdWFWX3Rvc3RyaW5nJyBtYXkgY3JlYXRlIGEgbmV3IHN0cmluZyAqLw0KKyAgICAgIGx1YWlf bG9jayhMKTsgIC8qIGBsdWFWX3Rvc3RyaW5nJyBtYXkgY3JlYXRlIGEgbmV3IHN0cmluZyAqLw0K ICAgICAgIGwgPSAobHVhVl90b3N0cmluZyhMLCBvKSA/IHRzdmFsdWUobyktPmxlbiA6IDApOw0K LSAgICAgIGx1YV91bmxvY2soTCk7DQorICAgICAgbHVhaV91bmxvY2soTCk7DQogICAgICAgcmV0 dXJuIGw7DQogICAgIH0NCiAgICAgZGVmYXVsdDogcmV0dXJuIDA7DQpAQCAtNDE5LDM1ICs0MTks MzUgQEANCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3B1c2huaWwgKGx1YV9TdGF0ZSAqTCkgew0K LSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICBzZXRuaWx2YWx1ZShMLT50b3Ap Ow0KICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2Nr KEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3B1c2hudW1iZXIgKGx1YV9TdGF0ZSAq TCwgbHVhX051bWJlciBuKSB7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAg IHNldG52YWx1ZShMLT50b3AsIG4pOw0KICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9j ayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3B1 c2hpbnRlZ2VyIChsdWFfU3RhdGUgKkwsIGx1YV9JbnRlZ2VyIG4pIHsNCi0gIGx1YV9sb2NrKEwp Ow0KKyAgbHVhaV9sb2NrKEwpOw0KICAgc2V0bnZhbHVlKEwtPnRvcCwgY2FzdF9udW0obikpOw0K ICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwp Ow0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3B1c2hsc3RyaW5nIChsdWFfU3RhdGUgKkws IGNvbnN0IGNoYXIgKnMsIHNpemVfdCBsZW4pIHsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9s b2NrKEwpOw0KICAgbHVhQ19jaGVja0dDKEwpOw0KICAgc2V0c3ZhbHVlMnMoTCwgTC0+dG9wLCBs dWFTX25ld2xzdHIoTCwgcywgbGVuKSk7DQogICBhcGlfaW5jcl90b3AoTCk7DQotICBsdWFfdW5s b2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogfQ0KIA0KIA0KQEAgLTQ2MiwxMCArNDYyLDEw IEBADQogTFVBX0FQSSBjb25zdCBjaGFyICpsdWFfcHVzaHZmc3RyaW5nIChsdWFfU3RhdGUgKkws IGNvbnN0IGNoYXIgKmZtdCwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZhX2xpc3QgYXJncCkgew0KICAgY29uc3QgY2hhciAqcmV0Ow0KLSAgbHVhX2xvY2soTCk7DQor ICBsdWFpX2xvY2soTCk7DQogICBsdWFDX2NoZWNrR0MoTCk7DQogICByZXQgPSBsdWFPX3B1c2h2 ZnN0cmluZyhMLCBmbXQsIGFyZ3ApOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2Nr KEwpOw0KICAgcmV0dXJuIHJldDsNCiB9DQogDQpAQCAtNDczLDE5ICs0NzMsMTkgQEANCiBMVUFf QVBJIGNvbnN0IGNoYXIgKmx1YV9wdXNoZnN0cmluZyAobHVhX1N0YXRlICpMLCBjb25zdCBjaGFy ICpmbXQsIC4uLikgew0KICAgY29uc3QgY2hhciAqcmV0Ow0KICAgdmFfbGlzdCBhcmdwOw0KLSAg bHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICBsdWFDX2NoZWNrR0MoTCk7DQogICB2 YV9zdGFydChhcmdwLCBmbXQpOw0KICAgcmV0ID0gbHVhT19wdXNodmZzdHJpbmcoTCwgZm10LCBh cmdwKTsNCiAgIHZhX2VuZChhcmdwKTsNCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9j ayhMKTsNCiAgIHJldHVybiByZXQ7DQogfQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfcHVzaGNj bG9zdXJlIChsdWFfU3RhdGUgKkwsIGx1YV9DRnVuY3Rpb24gZm4sIGludCBuKSB7DQogICBDbG9z dXJlICpjbDsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgbHVhQ19jaGVj a0dDKEwpOw0KICAgYXBpX2NoZWNrbmVsZW1zKEwsIG4pOw0KICAgY2wgPSBsdWFGX25ld0NjbG9z dXJlKEwsIG4sIGdldGN1cnJlbnYoTCkpOw0KQEAgLTQ5NiwzMSArNDk2LDMxIEBADQogICBzZXRj bHZhbHVlKEwsIEwtPnRvcCwgY2wpOw0KICAgbHVhX2Fzc2VydChpc3doaXRlKG9iajJnY28oY2wp KSk7DQogICBhcGlfaW5jcl90b3AoTCk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxv Y2soTCk7DQogfQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfcHVzaGJvb2xlYW4gKGx1YV9TdGF0 ZSAqTCwgaW50IGIpIHsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgc2V0 YnZhbHVlKEwtPnRvcCwgKGIgIT0gMCkpOyAgLyogZW5zdXJlIHRoYXQgdHJ1ZSBpcyAxICovDQog ICBhcGlfaW5jcl90b3AoTCk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7 DQogfQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfcHVzaGxpZ2h0dXNlcmRhdGEgKGx1YV9TdGF0 ZSAqTCwgdm9pZCAqcCkgew0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICBz ZXRwdmFsdWUoTC0+dG9wLCBwKTsNCiAgIGFwaV9pbmNyX3RvcChMKTsNCi0gIGx1YV91bmxvY2so TCk7DQorICBsdWFpX3VubG9jayhMKTsNCiB9DQogDQogDQogTFVBX0FQSSBpbnQgbHVhX3B1c2h0 aHJlYWQgKGx1YV9TdGF0ZSAqTCkgew0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7 DQogICBzZXR0aHZhbHVlKEwsIEwtPnRvcCwgTCk7DQogICBhcGlfaW5jcl90b3AoTCk7DQotICBs dWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogICByZXR1cm4gKEcoTCktPm1haW50 aHJlYWQgPT0gTCk7DQogfQ0KIA0KQEAgLTUzMyw1NCArNTMzLDU0IEBADQogDQogTFVBX0FQSSB2 b2lkIGx1YV9nZXR0YWJsZSAobHVhX1N0YXRlICpMLCBpbnQgaWR4KSB7DQogICBTdGtJZCB0Ow0K LSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICB0ID0gaW5kZXgyYWRyKEwsIGlk eCk7DQogICBhcGlfY2hlY2t2YWxpZGluZGV4KEwsIHQpOw0KICAgbHVhVl9nZXR0YWJsZShMLCB0 LCBMLT50b3AgLSAxLCBMLT50b3AgLSAxKTsNCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3Vu bG9jayhMKTsNCiB9DQogDQogDQogTFVBX0FQSSB2b2lkIGx1YV9nZXRmaWVsZCAobHVhX1N0YXRl ICpMLCBpbnQgaWR4LCBjb25zdCBjaGFyICprKSB7DQogICBTdGtJZCB0Ow0KICAgVFZhbHVlIGtl eTsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgdCA9IGluZGV4MmFkcihM LCBpZHgpOw0KICAgYXBpX2NoZWNrdmFsaWRpbmRleChMLCB0KTsNCiAgIHNldHN2YWx1ZShMLCAm a2V5LCBsdWFTX25ldyhMLCBrKSk7DQogICBsdWFWX2dldHRhYmxlKEwsIHQsICZrZXksIEwtPnRv cCk7DQogICBhcGlfaW5jcl90b3AoTCk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxv Y2soTCk7DQogfQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfcmF3Z2V0IChsdWFfU3RhdGUgKkws IGludCBpZHgpIHsNCiAgIFN0a0lkIHQ7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhM KTsNCiAgIHQgPSBpbmRleDJhZHIoTCwgaWR4KTsNCiAgIGFwaV9jaGVjayhMLCB0dGlzdGFibGUo dCkpOw0KICAgc2V0b2JqMnMoTCwgTC0+dG9wIC0gMSwgbHVhSF9nZXQoaHZhbHVlKHQpLCBMLT50 b3AgLSAxKSk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogfQ0KIA0K IA0KIExVQV9BUEkgdm9pZCBsdWFfcmF3Z2V0aSAobHVhX1N0YXRlICpMLCBpbnQgaWR4LCBpbnQg bikgew0KICAgU3RrSWQgbzsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAg byA9IGluZGV4MmFkcihMLCBpZHgpOw0KICAgYXBpX2NoZWNrKEwsIHR0aXN0YWJsZShvKSk7DQog ICBzZXRvYmoycyhMLCBMLT50b3AsIGx1YUhfZ2V0bnVtKGh2YWx1ZShvKSwgbikpOw0KICAgYXBp X2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0N CiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX2NyZWF0ZXRhYmxlIChsdWFfU3RhdGUgKkwsIGludCBu YXJyYXksIGludCBucmVjKSB7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAg IGx1YUNfY2hlY2tHQyhMKTsNCiAgIHNldGh2YWx1ZShMLCBMLT50b3AsIGx1YUhfbmV3KEwsIG5h cnJheSwgbnJlYykpOw0KICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisg IGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCkBAIC01ODgsNyArNTg4LDcgQEANCiAgIGNvbnN0 IFRWYWx1ZSAqb2JqOw0KICAgVGFibGUgKm10ID0gTlVMTDsNCiAgIGludCByZXM7DQotICBsdWFf bG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIG9iaiA9IGluZGV4MmFkcihMLCBvYmppbmRl eCk7DQogICBzd2l0Y2ggKHR0eXBlKG9iaikpIHsNCiAgICAgY2FzZSBMVUFfVFRBQkxFOg0KQEAg LTYwOCwxNCArNjA4LDE0IEBADQogICAgIGFwaV9pbmNyX3RvcChMKTsNCiAgICAgcmVzID0gMTsN CiAgIH0NCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVybiBy ZXM7DQogfQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfZ2V0ZmVudiAobHVhX1N0YXRlICpMLCBp bnQgaWR4KSB7DQogICBTdGtJZCBvOw0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7 DQogICBvID0gaW5kZXgyYWRyKEwsIGlkeCk7DQogICBhcGlfY2hlY2t2YWxpZGluZGV4KEwsIG8p Ow0KICAgc3dpdGNoICh0dHlwZShvKSkgew0KQEAgLTYzMyw3ICs2MzMsNyBAQA0KICAgICAgIGJy ZWFrOw0KICAgfQ0KICAgYXBpX2luY3JfdG9wKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1 YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCkBAIC02NDQsNjAgKzY0NCw2MCBAQA0KIA0KIExVQV9B UEkgdm9pZCBsdWFfc2V0dGFibGUgKGx1YV9TdGF0ZSAqTCwgaW50IGlkeCkgew0KICAgU3RrSWQg dDsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgYXBpX2NoZWNrbmVsZW1z KEwsIDIpOw0KICAgdCA9IGluZGV4MmFkcihMLCBpZHgpOw0KICAgYXBpX2NoZWNrdmFsaWRpbmRl eChMLCB0KTsNCiAgIGx1YVZfc2V0dGFibGUoTCwgdCwgTC0+dG9wIC0gMiwgTC0+dG9wIC0gMSk7 DQogICBMLT50b3AgLT0gMjsgIC8qIHBvcCBpbmRleCBhbmQgdmFsdWUgKi8NCi0gIGx1YV91bmxv Y2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiB9DQogDQogDQogTFVBX0FQSSB2b2lkIGx1YV9z ZXRmaWVsZCAobHVhX1N0YXRlICpMLCBpbnQgaWR4LCBjb25zdCBjaGFyICprKSB7DQogICBTdGtJ ZCB0Ow0KICAgVFZhbHVlIGtleTsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0K ICAgYXBpX2NoZWNrbmVsZW1zKEwsIDEpOw0KICAgdCA9IGluZGV4MmFkcihMLCBpZHgpOw0KICAg YXBpX2NoZWNrdmFsaWRpbmRleChMLCB0KTsNCiAgIHNldHN2YWx1ZShMLCAma2V5LCBsdWFTX25l dyhMLCBrKSk7DQogICBsdWFWX3NldHRhYmxlKEwsIHQsICZrZXksIEwtPnRvcCAtIDEpOw0KICAg TC0+dG9wLS07ICAvKiBwb3AgdmFsdWUgKi8NCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3Vu bG9jayhMKTsNCiB9DQogDQogDQogTFVBX0FQSSB2b2lkIGx1YV9yYXdzZXQgKGx1YV9TdGF0ZSAq TCwgaW50IGlkeCkgew0KICAgU3RrSWQgdDsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2Nr KEwpOw0KICAgYXBpX2NoZWNrbmVsZW1zKEwsIDIpOw0KICAgdCA9IGluZGV4MmFkcihMLCBpZHgp Ow0KICAgYXBpX2NoZWNrKEwsIHR0aXN0YWJsZSh0KSk7DQogICBzZXRvYmoydChMLCBsdWFIX3Nl dChMLCBodmFsdWUodCksIEwtPnRvcC0yKSwgTC0+dG9wLTEpOw0KICAgbHVhQ19iYXJyaWVydChM LCBodmFsdWUodCksIEwtPnRvcC0xKTsNCiAgIEwtPnRvcCAtPSAyOw0KLSAgbHVhX3VubG9jayhM KTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgbHVhX3Jhd3Nl dGkgKGx1YV9TdGF0ZSAqTCwgaW50IGlkeCwgaW50IG4pIHsNCiAgIFN0a0lkIG87DQotICBsdWFf bG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGFwaV9jaGVja25lbGVtcyhMLCAxKTsNCiAg IG8gPSBpbmRleDJhZHIoTCwgaWR4KTsNCiAgIGFwaV9jaGVjayhMLCB0dGlzdGFibGUobykpOw0K ICAgc2V0b2JqMnQoTCwgbHVhSF9zZXRudW0oTCwgaHZhbHVlKG8pLCBuKSwgTC0+dG9wLTEpOw0K ICAgbHVhQ19iYXJyaWVydChMLCBodmFsdWUobyksIEwtPnRvcC0xKTsNCiAgIEwtPnRvcC0tOw0K LSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJ IGludCBsdWFfc2V0bWV0YXRhYmxlIChsdWFfU3RhdGUgKkwsIGludCBvYmppbmRleCkgew0KICAg VFZhbHVlICpvYmo7DQogICBUYWJsZSAqbXQ7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9j ayhMKTsNCiAgIGFwaV9jaGVja25lbGVtcyhMLCAxKTsNCiAgIG9iaiA9IGluZGV4MmFkcihMLCBv YmppbmRleCk7DQogICBhcGlfY2hlY2t2YWxpZGluZGV4KEwsIG9iaik7DQpAQCAtNzI2LDcgKzcy Niw3IEBADQogICAgIH0NCiAgIH0NCiAgIEwtPnRvcC0tOw0KLSAgbHVhX3VubG9jayhMKTsNCisg IGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIDE7DQogfQ0KIA0KQEAgLTczNCw3ICs3MzQsNyBA QA0KIExVQV9BUEkgaW50IGx1YV9zZXRmZW52IChsdWFfU3RhdGUgKkwsIGludCBpZHgpIHsNCiAg IFN0a0lkIG87DQogICBpbnQgcmVzID0gMTsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2Nr KEwpOw0KICAgYXBpX2NoZWNrbmVsZW1zKEwsIDEpOw0KICAgbyA9IGluZGV4MmFkcihMLCBpZHgp Ow0KICAgYXBpX2NoZWNrdmFsaWRpbmRleChMLCBvKTsNCkBAIC03NTUsNyArNzU1LDcgQEANCiAg IH0NCiAgIGlmIChyZXMpIGx1YUNfb2JqYmFycmllcihMLCBnY3ZhbHVlKG8pLCBodmFsdWUoTC0+ dG9wIC0gMSkpOw0KICAgTC0+dG9wLS07DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxv Y2soTCk7DQogICByZXR1cm4gcmVzOw0KIH0NCiANCkBAIC03NzUsMTMgKzc3NSwxMyBAQA0KIA0K IExVQV9BUEkgdm9pZCBsdWFfY2FsbCAobHVhX1N0YXRlICpMLCBpbnQgbmFyZ3MsIGludCBucmVz dWx0cykgew0KICAgU3RrSWQgZnVuYzsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwp Ow0KICAgYXBpX2NoZWNrbmVsZW1zKEwsIG5hcmdzKzEpOw0KICAgY2hlY2tyZXN1bHRzKEwsIG5h cmdzLCBucmVzdWx0cyk7DQogICBmdW5jID0gTC0+dG9wIC0gKG5hcmdzKzEpOw0KICAgbHVhRF9j YWxsKEwsIGZ1bmMsIG5yZXN1bHRzKTsNCiAgIGFkanVzdHJlc3VsdHMoTCwgbnJlc3VsdHMpOw0K LSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCkBAIC04MDYs NyArODA2LDcgQEANCiAgIHN0cnVjdCBDYWxsUyBjOw0KICAgaW50IHN0YXR1czsNCiAgIHB0cmRp ZmZfdCBmdW5jOw0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICBhcGlfY2hl Y2tuZWxlbXMoTCwgbmFyZ3MrMSk7DQogICBjaGVja3Jlc3VsdHMoTCwgbmFyZ3MsIG5yZXN1bHRz KTsNCiAgIGlmIChlcnJmdW5jID09IDApDQpAQCAtODIwLDcgKzgyMCw3IEBADQogICBjLm5yZXN1 bHRzID0gbnJlc3VsdHM7DQogICBzdGF0dXMgPSBsdWFEX3BjYWxsKEwsIGZfY2FsbCwgJmMsIHNh dmVzdGFjayhMLCBjLmZ1bmMpLCBmdW5jKTsNCiAgIGFkanVzdHJlc3VsdHMoTCwgbnJlc3VsdHMp Ow0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIHN0YXR1 czsNCiB9DQogDQpAQCAtODUwLDExICs4NTAsMTEgQEANCiBMVUFfQVBJIGludCBsdWFfY3BjYWxs IChsdWFfU3RhdGUgKkwsIGx1YV9DRnVuY3Rpb24gZnVuYywgdm9pZCAqdWQpIHsNCiAgIHN0cnVj dCBDQ2FsbFMgYzsNCiAgIGludCBzdGF0dXM7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9j ayhMKTsNCiAgIGMuZnVuYyA9IGZ1bmM7DQogICBjLnVkID0gdWQ7DQogICBzdGF0dXMgPSBsdWFE X3BjYWxsKEwsIGZfQ2NhbGwsICZjLCBzYXZlc3RhY2soTCwgTC0+dG9wKSwgMCk7DQotICBsdWFf dW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogICByZXR1cm4gc3RhdHVzOw0KIH0NCiAN CkBAIC04NjMsMTEgKzg2MywxMSBAQA0KICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFy ICpjaHVua25hbWUpIHsNCiAgIFpJTyB6Ow0KICAgaW50IHN0YXR1czsNCi0gIGx1YV9sb2NrKEwp Ow0KKyAgbHVhaV9sb2NrKEwpOw0KICAgaWYgKCFjaHVua25hbWUpIGNodW5rbmFtZSA9ICI/IjsN CiAgIGx1YVpfaW5pdChMLCAmeiwgcmVhZGVyLCBkYXRhKTsNCiAgIHN0YXR1cyA9IGx1YURfcHJv dGVjdGVkcGFyc2VyKEwsICZ6LCBjaHVua25hbWUpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1 YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIHN0YXR1czsNCiB9DQogDQpAQCAtODc1LDE0ICs4NzUs MTQgQEANCiBMVUFfQVBJIGludCBsdWFfZHVtcCAobHVhX1N0YXRlICpMLCBsdWFfV3JpdGVyIHdy aXRlciwgdm9pZCAqZGF0YSkgew0KICAgaW50IHN0YXR1czsNCiAgIFRWYWx1ZSAqbzsNCi0gIGx1 YV9sb2NrKEwpOw0KKyAgbHVhaV9sb2NrKEwpOw0KICAgYXBpX2NoZWNrbmVsZW1zKEwsIDEpOw0K ICAgbyA9IEwtPnRvcCAtIDE7DQogICBpZiAoaXNMZnVuY3Rpb24obykpDQogICAgIHN0YXR1cyA9 IGx1YVVfZHVtcChMLCBjbHZhbHVlKG8pLT5sLnAsIHdyaXRlciwgZGF0YSwgMCk7DQogICBlbHNl DQogICAgIHN0YXR1cyA9IDE7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7 DQogICByZXR1cm4gc3RhdHVzOw0KIH0NCiANCkBAIC04OTksNyArODk5LDcgQEANCiBMVUFfQVBJ IGludCBsdWFfZ2MgKGx1YV9TdGF0ZSAqTCwgaW50IHdoYXQsIGludCBkYXRhKSB7DQogICBpbnQg cmVzID0gMDsNCiAgIGdsb2JhbF9TdGF0ZSAqZzsNCi0gIGx1YV9sb2NrKEwpOw0KKyAgbHVhaV9s b2NrKEwpOw0KICAgZyA9IEcoTCk7DQogICBzd2l0Y2ggKHdoYXQpIHsNCiAgICAgY2FzZSBMVUFf R0NTVE9QOiB7DQpAQCAtOTUwLDcgKzk1MCw3IEBADQogICAgIH0NCiAgICAgZGVmYXVsdDogcmVz ID0gLTE7ICAvKiBpbnZhbGlkIG9wdGlvbiAqLw0KICAgfQ0KLSAgbHVhX3VubG9jayhMKTsNCisg IGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIHJlczsNCiB9DQogDQpAQCAtOTYyLDEwICs5NjIs MTAgQEANCiANCiANCiBMVUFfQVBJIGludCBsdWFfZXJyb3IgKGx1YV9TdGF0ZSAqTCkgew0KLSAg bHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQogICBhcGlfY2hlY2tuZWxlbXMoTCwgMSk7 DQogICBsdWFHX2Vycm9ybXNnKEwpOw0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2Nr KEwpOw0KICAgcmV0dXJuIDA7ICAvKiB0byBhdm9pZCB3YXJuaW5ncyAqLw0KIH0NCiANCkBAIC05 NzMsNyArOTczLDcgQEANCiBMVUFfQVBJIGludCBsdWFfbmV4dCAobHVhX1N0YXRlICpMLCBpbnQg aWR4KSB7DQogICBTdGtJZCB0Ow0KICAgaW50IG1vcmU7DQotICBsdWFfbG9jayhMKTsNCisgIGx1 YWlfbG9jayhMKTsNCiAgIHQgPSBpbmRleDJhZHIoTCwgaWR4KTsNCiAgIGFwaV9jaGVjayhMLCB0 dGlzdGFibGUodCkpOw0KICAgbW9yZSA9IGx1YUhfbmV4dChMLCBodmFsdWUodCksIEwtPnRvcCAt IDEpOw0KQEAgLTk4MiwxMyArOTgyLDEzIEBADQogICB9DQogICBlbHNlICAvKiBubyBtb3JlIGVs ZW1lbnRzICovDQogICAgIEwtPnRvcCAtPSAxOyAgLyogcmVtb3ZlIGtleSAqLw0KLSAgbHVhX3Vu bG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIG1vcmU7DQogfQ0KIA0KIA0K IExVQV9BUEkgdm9pZCBsdWFfY29uY2F0IChsdWFfU3RhdGUgKkwsIGludCBuKSB7DQotICBsdWFf bG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGFwaV9jaGVja25lbGVtcyhMLCBuKTsNCiAg IGlmIChuID49IDIpIHsNCiAgICAgbHVhQ19jaGVja0dDKEwpOw0KQEAgLTEwMDAsMzYgKzEwMDAs MzYgQEANCiAgICAgYXBpX2luY3JfdG9wKEwpOw0KICAgfQ0KICAgLyogZWxzZSBuID09IDE7IG5v dGhpbmcgdG8gZG8gKi8NCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiB9 DQogDQogDQogTFVBX0FQSSBsdWFfQWxsb2MgbHVhX2dldGFsbG9jZiAobHVhX1N0YXRlICpMLCB2 b2lkICoqdWQpIHsNCiAgIGx1YV9BbGxvYyBmOw0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xv Y2soTCk7DQogICBpZiAodWQpICp1ZCA9IEcoTCktPnVkOw0KICAgZiA9IEcoTCktPmZyZWFsbG9j Ow0KLSAgbHVhX3VubG9jayhMKTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KICAgcmV0dXJuIGY7DQog fQ0KIA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfc2V0YWxsb2NmIChsdWFfU3RhdGUgKkwsIGx1YV9B bGxvYyBmLCB2b2lkICp1ZCkgew0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7DQog ICBHKEwpLT51ZCA9IHVkOw0KICAgRyhMKS0+ZnJlYWxsb2MgPSBmOw0KLSAgbHVhX3VubG9jayhM KTsNCisgIGx1YWlfdW5sb2NrKEwpOw0KIH0NCiANCiANCiBMVUFfQVBJIHZvaWQgKmx1YV9uZXd1 c2VyZGF0YSAobHVhX1N0YXRlICpMLCBzaXplX3Qgc2l6ZSkgew0KICAgVWRhdGEgKnU7DQotICBs dWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGx1YUNfY2hlY2tHQyhMKTsNCiAgIHUg PSBsdWFTX25ld3VkYXRhKEwsIHNpemUsIGdldGN1cnJlbnYoTCkpOw0KICAgc2V0dXZhbHVlKEws IEwtPnRvcCwgdSk7DQogICBhcGlfaW5jcl90b3AoTCk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAg bHVhaV91bmxvY2soTCk7DQogICByZXR1cm4gdSArIDE7DQogfQ0KIA0KQEAgLTEwNTcsMTMgKzEw NTcsMTMgQEANCiBMVUFfQVBJIGNvbnN0IGNoYXIgKmx1YV9nZXR1cHZhbHVlIChsdWFfU3RhdGUg KkwsIGludCBmdW5jaW5kZXgsIGludCBuKSB7DQogICBjb25zdCBjaGFyICpuYW1lOw0KICAgVFZh bHVlICp2YWw7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIG5hbWUgPSBh dXhfdXB2YWx1ZShpbmRleDJhZHIoTCwgZnVuY2luZGV4KSwgbiwgJnZhbCk7DQogICBpZiAobmFt ZSkgew0KICAgICBzZXRvYmoycyhMLCBMLT50b3AsIHZhbCk7DQogICAgIGFwaV9pbmNyX3RvcChM KTsNCiAgIH0NCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVy biBuYW1lOw0KIH0NCiANCkBAIC0xMDcyLDcgKzEwNzIsNyBAQA0KICAgY29uc3QgY2hhciAqbmFt ZTsNCiAgIFRWYWx1ZSAqdmFsOw0KICAgU3RrSWQgZmk7DQotICBsdWFfbG9jayhMKTsNCisgIGx1 YWlfbG9jayhMKTsNCiAgIGZpID0gaW5kZXgyYWRyKEwsIGZ1bmNpbmRleCk7DQogICBhcGlfY2hl Y2tuZWxlbXMoTCwgMSk7DQogICBuYW1lID0gYXV4X3VwdmFsdWUoZmksIG4sICZ2YWwpOw0KQEAg LTEwODEsNyArMTA4MSw3IEBADQogICAgIHNldG9iaihMLCB2YWwsIEwtPnRvcCk7DQogICAgIGx1 YUNfYmFycmllcihMLCBjbHZhbHVlKGZpKSwgTC0+dG9wKTsNCiAgIH0NCi0gIGx1YV91bmxvY2so TCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVybiBuYW1lOw0KIH0NCiANCmRpZmYgLWR1 ck4gYS9sdWEtNS4xLjQvc3JjL2xkZWJ1Zy5jIGIvbHVhLTUuMS40L3NyYy9sZGVidWcuYw0KLS0t IGEvbHVhLTUuMS40L3NyYy9sZGVidWcuYwlUaHUgTWF5ICA4IDE4OjU2OjI2IDIwMDgNCisrKyBi L2x1YS01LjEuNC9zcmMvbGRlYnVnLmMJVGh1IEF1ZyAgNiAxNjowODo1NyAyMDA5DQpAQCAtODQs NyArODQsNyBAQA0KIExVQV9BUEkgaW50IGx1YV9nZXRzdGFjayAobHVhX1N0YXRlICpMLCBpbnQg bGV2ZWwsIGx1YV9EZWJ1ZyAqYXIpIHsNCiAgIGludCBzdGF0dXM7DQogICBDYWxsSW5mbyAqY2k7 DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGZvciAoY2kgPSBMLT5jaTsg bGV2ZWwgPiAwICYmIGNpID4gTC0+YmFzZV9jaTsgY2ktLSkgew0KICAgICBsZXZlbC0tOw0KICAg ICBpZiAoZl9pc0x1YShjaSkpICAvKiBMdWEgZnVuY3Rpb24/ICovDQpAQCAtOTksNyArOTksNyBA QA0KICAgICBhci0+aV9jaSA9IDA7DQogICB9DQogICBlbHNlIHN0YXR1cyA9IDA7ICAvKiBubyBz dWNoIGxldmVsICovDQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogICBy ZXR1cm4gc3RhdHVzOw0KIH0NCiANCkBAIC0xMjcsMTAgKzEyNywxMCBAQA0KIExVQV9BUEkgY29u c3QgY2hhciAqbHVhX2dldGxvY2FsIChsdWFfU3RhdGUgKkwsIGNvbnN0IGx1YV9EZWJ1ZyAqYXIs IGludCBuKSB7DQogICBDYWxsSW5mbyAqY2kgPSBMLT5iYXNlX2NpICsgYXItPmlfY2k7DQogICBj b25zdCBjaGFyICpuYW1lID0gZmluZGxvY2FsKEwsIGNpLCBuKTsNCi0gIGx1YV9sb2NrKEwpOw0K KyAgbHVhaV9sb2NrKEwpOw0KICAgaWYgKG5hbWUpDQogICAgICAgbHVhQV9wdXNob2JqZWN0KEws IGNpLT5iYXNlICsgKG4gLSAxKSk7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2so TCk7DQogICByZXR1cm4gbmFtZTsNCiB9DQogDQpAQCAtMTM4LDExICsxMzgsMTEgQEANCiBMVUFf QVBJIGNvbnN0IGNoYXIgKmx1YV9zZXRsb2NhbCAobHVhX1N0YXRlICpMLCBjb25zdCBsdWFfRGVi dWcgKmFyLCBpbnQgbikgew0KICAgQ2FsbEluZm8gKmNpID0gTC0+YmFzZV9jaSArIGFyLT5pX2Np Ow0KICAgY29uc3QgY2hhciAqbmFtZSA9IGZpbmRsb2NhbChMLCBjaSwgbik7DQotICBsdWFfbG9j ayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGlmIChuYW1lKQ0KICAgICAgIHNldG9ianMycyhM LCBjaS0+YmFzZSArIChuIC0gMSksIEwtPnRvcCAtIDEpOw0KICAgTC0+dG9wLS07ICAvKiBwb3Ag dmFsdWUgKi8NCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVy biBuYW1lOw0KIH0NCiANCkBAIC0yMzMsNyArMjMzLDcgQEANCiAgIGludCBzdGF0dXM7DQogICBD bG9zdXJlICpmID0gTlVMTDsNCiAgIENhbGxJbmZvICpjaSA9IE5VTEw7DQotICBsdWFfbG9jayhM KTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGlmICgqd2hhdCA9PSAnPicpIHsNCiAgICAgU3RrSWQg ZnVuYyA9IEwtPnRvcCAtIDE7DQogICAgIGx1YWlfYXBpY2hlY2soTCwgdHRpc2Z1bmN0aW9uKGZ1 bmMpKTsNCkBAIC0yNTQsNyArMjU0LDcgQEANCiAgIH0NCiAgIGlmIChzdHJjaHIod2hhdCwgJ0wn KSkNCiAgICAgY29sbGVjdHZhbGlkbGluZXMoTCwgZik7DQotICBsdWFfdW5sb2NrKEwpOw0KKyAg bHVhaV91bmxvY2soTCk7DQogICByZXR1cm4gc3RhdHVzOw0KIH0NCiANCmRpZmYgLWR1ck4gYS9s dWEtNS4xLjQvc3JjL2xkby5jIGIvbHVhLTUuMS40L3NyYy9sZG8uYw0KLS0tIGEvbHVhLTUuMS40 L3NyYy9sZG8uYwlGcmkgSmFuIDE4IDIzOjMxOjIyIDIwMDgNCisrKyBiL2x1YS01LjEuNC9zcmMv bGRvLmMJVGh1IEF1ZyAgNiAxNjowODo1NyAyMDA5DQpAQCAtMTAwLDcgKzEwMCw3IEBADQogICAg IEwtPnN0YXR1cyA9IGNhc3RfYnl0ZShlcnJjb2RlKTsNCiAgICAgaWYgKEcoTCktPnBhbmljKSB7 DQogICAgICAgcmVzZXRzdGFjayhMLCBlcnJjb2RlKTsNCi0gICAgICBsdWFfdW5sb2NrKEwpOw0K KyAgICAgIGx1YWlfdW5sb2NrKEwpOw0KICAgICAgIEcoTCktPnBhbmljKEwpOw0KICAgICB9DQog ICAgIGV4aXQoRVhJVF9GQUlMVVJFKTsNCkBAIC0xOTQsOSArMTk0LDkgQEANCiAgICAgTC0+Y2kt PnRvcCA9IEwtPnRvcCArIExVQV9NSU5TVEFDSzsNCiAgICAgbHVhX2Fzc2VydChMLT5jaS0+dG9w IDw9IEwtPnN0YWNrX2xhc3QpOw0KICAgICBMLT5hbGxvd2hvb2sgPSAwOyAgLyogY2Fubm90IGNh bGwgaG9va3MgaW5zaWRlIGEgaG9vayAqLw0KLSAgICBsdWFfdW5sb2NrKEwpOw0KKyAgICBsdWFp X3VubG9jayhMKTsNCiAgICAgKCpob29rKShMLCAmYXIpOw0KLSAgICBsdWFfbG9jayhMKTsNCisg ICAgbHVhaV9sb2NrKEwpOw0KICAgICBsdWFfYXNzZXJ0KCFMLT5hbGxvd2hvb2spOw0KICAgICBM LT5hbGxvd2hvb2sgPSAxOw0KICAgICBMLT5jaS0+dG9wID0gcmVzdG9yZXN0YWNrKEwsIGNpX3Rv cCk7DQpAQCAtMzE1LDkgKzMxNSw5IEBADQogICAgIGNpLT5ucmVzdWx0cyA9IG5yZXN1bHRzOw0K ICAgICBpZiAoTC0+aG9va21hc2sgJiBMVUFfTUFTS0NBTEwpDQogICAgICAgbHVhRF9jYWxsaG9v ayhMLCBMVUFfSE9PS0NBTEwsIC0xKTsNCi0gICAgbHVhX3VubG9jayhMKTsNCisgICAgbHVhaV91 bmxvY2soTCk7DQogICAgIG4gPSAoKmN1cnJfZnVuYyhMKS0+Yy5mKShMKTsgIC8qIGRvIHRoZSBh Y3R1YWwgY2FsbCAqLw0KLSAgICBsdWFfbG9jayhMKTsNCisgICAgbHVhaV9sb2NrKEwpOw0KICAg ICBpZiAobiA8IDApICAvKiB5aWVsZGluZz8gKi8NCiAgICAgICByZXR1cm4gUENSWUlFTEQ7DQog ICAgIGVsc2Ugew0KQEAgLTQwOSwxNCArNDA5LDE0IEBADQogICBMLT50b3AgPSBMLT5jaS0+YmFz ZTsNCiAgIHNldHN2YWx1ZTJzKEwsIEwtPnRvcCwgbHVhU19uZXcoTCwgbXNnKSk7DQogICBpbmNy X3RvcChMKTsNCi0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVy biBMVUFfRVJSUlVOOw0KIH0NCiANCiANCiBMVUFfQVBJIGludCBsdWFfcmVzdW1lIChsdWFfU3Rh dGUgKkwsIGludCBuYXJncykgew0KICAgaW50IHN0YXR1czsNCi0gIGx1YV9sb2NrKEwpOw0KKyAg bHVhaV9sb2NrKEwpOw0KICAgaWYgKEwtPnN0YXR1cyAhPSBMVUFfWUlFTEQgJiYgKEwtPnN0YXR1 cyAhPSAwIHx8IEwtPmNpICE9IEwtPmJhc2VfY2kpKQ0KICAgICAgIHJldHVybiByZXN1bWVfZXJy b3IoTCwgImNhbm5vdCByZXN1bWUgbm9uLXN1c3BlbmRlZCBjb3JvdXRpbmUiKTsNCiAgIGlmIChM LT5uQ2NhbGxzID49IExVQUlfTUFYQ0NBTExTKQ0KQEAgLTQzNSwxOSArNDM1LDE5IEBADQogICAg IHN0YXR1cyA9IEwtPnN0YXR1czsNCiAgIH0NCiAgIC0tTC0+bkNjYWxsczsNCi0gIGx1YV91bmxv Y2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIHJldHVybiBzdGF0dXM7DQogfQ0KIA0KIA0K IExVQV9BUEkgaW50IGx1YV95aWVsZCAobHVhX1N0YXRlICpMLCBpbnQgbnJlc3VsdHMpIHsNCiAg IGx1YWlfdXNlcnN0YXRleWllbGQoTCwgbnJlc3VsdHMpOw0KLSAgbHVhX2xvY2soTCk7DQorICBs dWFpX2xvY2soTCk7DQogICBpZiAoTC0+bkNjYWxscyA+IEwtPmJhc2VDY2FsbHMpDQogICAgIGx1 YUdfcnVuZXJyb3IoTCwgImF0dGVtcHQgdG8geWllbGQgYWNyb3NzIG1ldGFtZXRob2QvQy1jYWxs IGJvdW5kYXJ5Iik7DQogICBMLT5iYXNlID0gTC0+dG9wIC0gbnJlc3VsdHM7ICAvKiBwcm90ZWN0 IHN0YWNrIHNsb3RzIGJlbG93ICovDQogICBMLT5zdGF0dXMgPSBMVUFfWUlFTEQ7DQotICBsdWFf dW5sb2NrKEwpOw0KKyAgbHVhaV91bmxvY2soTCk7DQogICByZXR1cm4gLTE7DQogfQ0KIA0KZGlm ZiAtZHVyTiBhL2x1YS01LjEuNC9zcmMvbGR1bXAuYyBiL2x1YS01LjEuNC9zcmMvbGR1bXAuYw0K LS0tIGEvbHVhLTUuMS40L3NyYy9sZHVtcC5jCVRodSBEZWMgMjcgMTQ6MDI6MjUgMjAwNw0KKysr IGIvbHVhLTUuMS40L3NyYy9sZHVtcC5jCVRodSBBdWcgIDYgMTY6MDg6NTcgMjAwOQ0KQEAgLTMw LDkgKzMwLDkgQEANCiB7DQogIGlmIChELT5zdGF0dXM9PTApDQogIHsNCi0gIGx1YV91bmxvY2so RC0+TCk7DQorICBsdWFpX3VubG9jayhELT5MKTsNCiAgIEQtPnN0YXR1cz0oKkQtPndyaXRlciko RC0+TCxiLHNpemUsRC0+ZGF0YSk7DQotICBsdWFfbG9jayhELT5MKTsNCisgIGx1YWlfbG9jayhE LT5MKTsNCiAgfQ0KIH0NCiANCmRpZmYgLWR1ck4gYS9sdWEtNS4xLjQvc3JjL2xsaW1pdHMuaCBi L2x1YS01LjEuNC9zcmMvbGxpbWl0cy5oDQotLS0gYS9sdWEtNS4xLjQvc3JjL2xsaW1pdHMuaAlU aHUgRGVjIDI3IDE0OjAyOjI1IDIwMDcNCisrKyBiL2x1YS01LjEuNC9zcmMvbGxpbWl0cy5oCVRo dSBBdWcgIDYgMTY6MDg6NTcgMjAwOQ0KQEAgLTEwNiwxMyArMTA2LDEzIEBADQogI2VuZGlmDQog DQogDQotI2lmbmRlZiBsdWFfbG9jaw0KLSNkZWZpbmUgbHVhX2xvY2soTCkgICAgICgodm9pZCkg MCkgDQotI2RlZmluZSBsdWFfdW5sb2NrKEwpICAgKCh2b2lkKSAwKQ0KKyNpZm5kZWYgbHVhaV9s b2NrDQorI2RlZmluZSBsdWFpX2xvY2soTCkgICAgICgodm9pZCkgMCkgDQorI2RlZmluZSBsdWFp X3VubG9jayhMKSAgICgodm9pZCkgMCkNCiAjZW5kaWYNCiANCiAjaWZuZGVmIGx1YWlfdGhyZWFk eWllbGQNCi0jZGVmaW5lIGx1YWlfdGhyZWFkeWllbGQoTCkgICAgIHtsdWFfdW5sb2NrKEwpOyBs dWFfbG9jayhMKTt9DQorI2RlZmluZSBsdWFpX3RocmVhZHlpZWxkKEwpICAgICB7bHVhaV91bmxv Y2soTCk7IGx1YWlfbG9jayhMKTt9DQogI2VuZGlmDQogDQogDQpkaWZmIC1kdXJOIGEvbHVhLTUu MS40L3NyYy9sc3RhdGUuYyBiL2x1YS01LjEuNC9zcmMvbHN0YXRlLmMNCi0tLSBhL2x1YS01LjEu NC9zcmMvbHN0YXRlLmMJVGh1IEphbiAgMyAxNjoyMDozOSAyMDA4DQorKysgYi9sdWEtNS4xLjQv c3JjL2xzdGF0ZS5jCVRodSBBdWcgIDYgMTY6MDg6NTcgMjAwOQ0KQEAgLTE5OCw3ICsxOTgsNyBA QA0KIA0KIExVQV9BUEkgdm9pZCBsdWFfY2xvc2UgKGx1YV9TdGF0ZSAqTCkgew0KICAgTCA9IEco TCktPm1haW50aHJlYWQ7ICAvKiBvbmx5IHRoZSBtYWluIHRocmVhZCBjYW4gYmUgY2xvc2VkICov DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAgIGx1YUZfY2xvc2UoTCwgTC0+ c3RhY2spOyAgLyogY2xvc2UgYWxsIHVwdmFsdWVzIGZvciB0aGlzIHRocmVhZCAqLw0KICAgbHVh Q19zZXBhcmF0ZXVkYXRhKEwsIDEpOyAgLyogc2VwYXJhdGUgdWRhdGEgdGhhdCBoYXZlIEdDIG1l dGFtZXRob2RzICovDQogICBMLT5lcnJmdW5jID0gMDsgIC8qIG5vIGVycm9yIGZ1bmN0aW9uIGR1 cmluZyBHQyBtZXRhbWV0aG9kcyAqLw0KQEAgLTIxMCw1ICsyMTAsMTMgQEANCiAgIGx1YV9hc3Nl cnQoRyhMKS0+dG11ZGF0YSA9PSBOVUxMKTsNCiAgIGx1YWlfdXNlcnN0YXRlY2xvc2UoTCk7DQog ICBjbG9zZV9zdGF0ZShMKTsNCit9DQorDQorTFVBX0FQSSB2b2lkIGx1YV9sb2NrIChsdWFfU3Rh dGUgKkwpIHsNCisgIGx1YWlfbG9jayhMKTsNCit9DQorDQorTFVBX0FQSSB2b2lkIGx1YV91bmxv Y2sgKGx1YV9TdGF0ZSAqTCkgew0KKyAgbHVhaV91bmxvY2soTCk7DQogfQ0KIA0KZGlmZiAtZHVy TiBhL2x1YS01LjEuNC9zcmMvbHVhLmggYi9sdWEtNS4xLjQvc3JjL2x1YS5oDQotLS0gYS9sdWEt NS4xLjQvc3JjL2x1YS5oCVdlZCBBdWcgIDYgMTU6MzA6MTIgMjAwOA0KKysrIGIvbHVhLTUuMS40 L3NyYy9sdWEuaAlUaHUgQXVnICA2IDE2OjA4OjU3IDIwMDkNCkBAIC0yOTgsNiArMjk4LDkgQEAN CiBMVUFfQVBJIHZvaWQgbHVhX3NldGxldmVsCShsdWFfU3RhdGUgKmZyb20sIGx1YV9TdGF0ZSAq dG8pOw0KIA0KIA0KK0xVQV9BUEkgdm9pZCBsdWFfbG9jayAobHVhX1N0YXRlICpMKTsNCitMVUFf QVBJIHZvaWQgbHVhX3VubG9jayAobHVhX1N0YXRlICpMKTsNCisNCiAvKg0KICoqIHs9PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09DQogKiogRGVidWcgQVBJDQpkaWZmIC1kdXJOIGEvbHVhLTUuMS40L3NyYy9sdWFjLmMg Yi9sdWEtNS4xLjQvc3JjL2x1YWMuYw0KLS0tIGEvbHVhLTUuMS40L3NyYy9sdWFjLmMJRnJpIEp1 biAgMiAxOTozNzoxMSAyMDA2DQorKysgYi9sdWEtNS4xLjQvc3JjL2x1YWMuYwlUaHUgQXVnICA2 IDE2OjA4OjU3IDIwMDkNCkBAIC0xNzQsOSArMTc0LDkgQEANCiAgew0KICAgRklMRSogRD0gKG91 dHB1dD09TlVMTCkgPyBzdGRvdXQgOiBmb3BlbihvdXRwdXQsIndiIik7DQogICBpZiAoRD09TlVM TCkgY2Fubm90KCJvcGVuIik7DQotICBsdWFfbG9jayhMKTsNCisgIGx1YWlfbG9jayhMKTsNCiAg IGx1YVVfZHVtcChMLGYsd3JpdGVyLEQsc3RyaXBwaW5nKTsNCi0gIGx1YV91bmxvY2soTCk7DQor ICBsdWFpX3VubG9jayhMKTsNCiAgIGlmIChmZXJyb3IoRCkpIGNhbm5vdCgid3JpdGUiKTsNCiAg IGlmIChmY2xvc2UoRCkpIGNhbm5vdCgiY2xvc2UiKTsNCiAgfQ0KZGlmZiAtZHVyTiBhL2x1YS01 LjEuNC9zcmMvbHppby5jIGIvbHVhLTUuMS40L3NyYy9semlvLmMNCi0tLSBhL2x1YS01LjEuNC9z cmMvbHppby5jCVRodSBEZWMgMjcgMTQ6MDI6MjUgMjAwNw0KKysrIGIvbHVhLTUuMS40L3NyYy9s emlvLmMJVGh1IEF1ZyAgNiAxNjowODo1NyAyMDA5DQpAQCAtMjIsOSArMjIsOSBAQA0KICAgc2l6 ZV90IHNpemU7DQogICBsdWFfU3RhdGUgKkwgPSB6LT5MOw0KICAgY29uc3QgY2hhciAqYnVmZjsN Ci0gIGx1YV91bmxvY2soTCk7DQorICBsdWFpX3VubG9jayhMKTsNCiAgIGJ1ZmYgPSB6LT5yZWFk ZXIoTCwgei0+ZGF0YSwgJnNpemUpOw0KLSAgbHVhX2xvY2soTCk7DQorICBsdWFpX2xvY2soTCk7 DQogICBpZiAoYnVmZiA9PSBOVUxMIHx8IHNpemUgPT0gMCkgcmV0dXJuIEVPWjsNCiAgIHotPm4g PSBzaXplIC0gMTsNCiAgIHotPnAgPSBidWZmOw0K --0016e64c2a48b87aa004707a050e-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:24:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HO8vN000835; Thu, 6 Aug 2009 14:24:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2BB3192C1; Thu, 6 Aug 2009 14:22:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83300183A2 for ; Thu, 6 Aug 2009 12:16:38 -0300 (BRT) Received: by ewy26 with SMTP id 26so1017034ewy.5 for ; Thu, 06 Aug 2009 08:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ykXTpOTxWqMv7+L3eq/A6YOaJRMJ5kgF3kte+Na4k8I=; b=wWP70dtMKUnMT1Q2mUOgGbr78eabEusPxdy5Zv//I3HoDRf3cDR+T42F4pVGsFwKMZ kYidbzQzFzxZkhtyI+D/ABHresx0b8MEhk3EtwuVtJYBJl6p6Rl610E98haILtM7kpXD bVUa+K3R9IM1wsO0XlkRA69yadvdj9GBvbUBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=mux47TTUG15ctg8O7W5ng2sTxIBnJ3yaeRRmDo2cQJ65mIQqBZ9FzVt7+esvGy62cw bBRl7+n8tSFWeh5RZIgeFoO/JhrG5ZRdpsKtPRNh2IME3I0B/SyyrqlyvRIynM4M0KtT tckxHpdNosvEhDP3+4oq75MN5HXB64V3kpl5I= MIME-Version: 1.0 Received: by 10.216.18.82 with SMTP id k60mr2079531wek.118.1249571785244; Thu, 06 Aug 2009 08:16:25 -0700 (PDT) In-Reply-To: References: <89d273ba0907280522t1d6f989cvd98104824c28960e@mail.gmail.com> <89d273ba0907280844ned3a994j4a14633f16715d0b@mail.gmail.com> From: Jerome Vuarand Date: Thu, 6 Aug 2009 17:16:05 +0200 Message-ID: <89d273ba0908060816w47def127o93176c688c946a6a@mail.gmail.com> Subject: Re: tables holding nil: another way to look at the question itself To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/4 Cosmin Apreutesei : > Suppose I have to wrap function f in function g. I don't care for f's > arguments, just need to pass them along as g receives them. Can I just > ignore the feature of arg. count in this case? My own function g > surely don't need the feature, but the function f, written by someone > else, might be sensible about arg. count, forcing me to account for > this feature too if I am to implement g() correctly. That's what I > meant when I said I have to carry the abstraction leak everywhere -- > after all, that's what makes it a leak. I think your example doesn't show what you're trying to explain. If you want g to forward all its arguments to f, you would write g like this: function g(...) f(...) end Here the argument count is not visible, and it could as well be unavailable, you wouldn't notice. So it's clearly not leaking. It's not intrinsically part of ... (you could have ... without select('#', ...)). And ... in g argument list is the only way to forward all arguments to another function. Even if you need to pack the arguments in a table, you don't need select('#', ...) since you could use next/pairs to get the biggest non-nil argument index to pass as third parameter to unpack. > I see pairs() as an abstraction leak too, allowing me to "see" a small > set of the invinite set of keys. Example: say I need an unordered list > of objects, any of which can have a value attached. This can be > represented in two obvious ways: > > 1) { {obj1, obj2, ... }, {[obj1] = obj1_value, [obj2] = obj2_value, ... } > 2) { [obj1] = obj1_value, [obj2] = obj2_value, ... } Your example 2 is clearly a misuse of table for your needs. You want to represent a finite set of key-value pairs, while tables are infinite. You need a convention to represent a finite set of pairs with a table. Either store the list of keys in another table (like your solution 1), or forbid a value to be used in key-value pairs of the set, and assign that value to all the keys *not* in your set, as a "not in the set" tag (and obviously using nil as the tag makes your life much easier). That handles nil values. For the nil key, you have to find another mechanism, but since the number of pairs in that case is finite (only 1), it's relatively easy. Also I assumed your set of pairs don't allow several pairs to have the same key, so as to make them somewhat compatible to tables. If that's not the case you have to do more complex stuff anyway, and the infinite aspect of tables is less of a concern anyway. > The first allows objN_value to be any value, including nil, and > doesn't require pairs() to exist. The second representation is made > available by pairs(), and that's the one I see most of the time in Lua > code, usually with nil values "fixed" with a boolean false value. When > I see code like this I understand why some people believe tables > "can't hold nil" :) Without pairs(), you couldn't have representation > #2, and so no issues with nils, but pairs() leaks hidden information > about tables, specifically the list of non-nil keys, a table which > itself can't hold the nil :) I'm not pleading ditch pairs() here, it's > probably too useful, but it all falls down on poor nil. pairs doesn't *leak* the list of non-nil keys, since there is no reason that information should be hidden in the first place. If you consider tables to be infinite, you cannot iterate over them in a finite time. However if you know a subset of your table key-value pairs is finite, it's useful to be able to iterate over them. It happens that most of the time the set of pairs with a non-nil key is finite, so pairs conveniently gives you access to these pairs. And since iterators are not required to terminate, pairs is not even leaking the fact that the current implementation of tables don't allow one to have an infinite set of pairs with non-nil keys (some new syntax or library would be need to create these anyway). >> Also the read-only nil-key pair is a feature of tables, while index >> and newindex let you build other types of objects (eventually with >> different semantics) on top of tables. Keep in mind that index and >> newindex in tables are exceptions in the real of metamethods, because >> they let you override a behaviour that is otherwise perfectly defined >> and valid. > > Metatables should allow me to override the implementation of a table, > they shouldn't let me corrupt its semantics (whatever that is) or > things will break. I somewhat agree with the second part of your statement, index and newindex let users corrupt the semantics of a table. IMHO they shouldn't be called on tables, since they break the general rule that metamethods are only called on undefined operations (ie. which would throw an error). Instead, if users want to create new data types, they should use full userdata. And ideally some new mechanism to create pure-Lua (ie. without C) zero-sized userdata should be created instead, based on the newproxy experiment, eventually as a separate type from userdata (what about 'object'?). From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:25:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HOqNw001209; Thu, 6 Aug 2009 14:24:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72AD5192BA; Thu, 6 Aug 2009 14:22:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98A2418399 for ; Thu, 6 Aug 2009 12:43:53 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76Fhp66010727 for ; Thu, 6 Aug 2009 12:43:51 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 32BE51F1162; Thu, 6 Aug 2009 12:43:51 -0300 (BRT) Date: Thu, 6 Aug 2009 12:43:51 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: Re: is the list server down? Message-ID: <20090806154351.GA14078@magritte.tecgraf.puc-rio.br> References: <20090805114747.A8654@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090805114747.A8654@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br bazar2.conectiva.com.br seems to be up again but lua-l postings are not coming (yet?) From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:25:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HPhsE001666; Thu, 6 Aug 2009 14:25:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A1D11930D; Thu, 6 Aug 2009 14:24:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AF9D18E57 for ; Thu, 6 Aug 2009 14:14:27 -0300 (BRT) Received: by ewy26 with SMTP id 26so1111213ewy.5 for ; Thu, 06 Aug 2009 10:14:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.36.82 with SMTP id v60mr22008wea.120.1249578865386; Thu, 06 Aug 2009 10:14:25 -0700 (PDT) In-Reply-To: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> Date: Thu, 6 Aug 2009 18:14:25 +0100 X-Google-Sender-Auth: 2bbe49d94a63f32c Message-ID: Subject: Re: how to load a very large table with more than 2^18 literal strings? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n76HPhsE001666 2^18 is the limit per function, not per file. Of course, if you file is a single function (i.e. the unnamed top-level chunk), then 2^18 becomes the file limit. You can transform code like this: X = { a = "b", c = "d", e = { f = "g", h = "i", }, j = "k", } Into something like this: X = { a = "b", c = "d", e = (function() return { f = "g", h = "i", } end)(), j = "k", } Thus moving some constants out of the top-level and into subfunctions. On Wed, Aug 5, 2009 at 2:36 AM, Norman Ramsey wrote: > I'm accustomed to use Lua to store persistent data structures on disk. > Unfortunately, in my latest venture, I run out of string space.  I did > a little investigation in the source, and it appears that only 2^18 > literal constants may appear in any one source file, and this appears > to be a hard limit built into the bytecode format. > > I would like to write large Lua tables out to disk, possibly nested, but > with no sharing or cycles.  Does anybody have any suggestions how to > achieve this without running afoul of the dreaded 'constant table overflow'? > > > Norman > From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:26:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HQSdx001974; Thu, 6 Aug 2009 14:26:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01A7D19303; Thu, 6 Aug 2009 14:24:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37D5A1911E for ; Thu, 6 Aug 2009 14:17:42 -0300 (BRT) Received: by fxm25 with SMTP id 25so969583fxm.5 for ; Thu, 06 Aug 2009 10:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hFXxFDwd7i5wHJTuE+nLvP2iQeUxjYoYpstqVQNwMeQ=; b=ocC1DPIiph6lUOyr5d86859z+D0gMe0HqUEbHIbxWMnEliz2wob8q2i3J8FSZ2DRRq FaCOstgL+l93LQtprQqlG9tASZARZB1B0CrUGXrx+Rlo+rX79p8yo7kCGqJD8edsR/Q2 lMAdA8TSzwZdb54XOpmA1rwmznOl0QeVfZvv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hNOxGKFB3PW8ui5c9jPxfYr+gRplEXzjj/kQBTUhzRkjgOWQ64/iUamuYexCnX2fZr I683tCZ3rsKibL7yS6JoGyykYSydFX/3GOYdwZJ+IIzy+dPMfe/pa8+qqMxqm9xO7nie uQW2xuQmHblWzOfqMSs+ncmHKUQc9lfScEUDY= MIME-Version: 1.0 Received: by 10.204.64.136 with SMTP id e8mr637085bki.91.1249579058770; Thu, 06 Aug 2009 10:17:38 -0700 (PDT) In-Reply-To: <20090805114747.A8654@lua.tecgraf.puc-rio.br> References: <20090805114747.A8654@lua.tecgraf.puc-rio.br> Date: Thu, 6 Aug 2009 18:17:38 +0100 Message-ID: <4db9cacb0908061017w4cedddafq61ec0c19ccdc96a7@mail.gmail.com> Subject: Re: is the list server down? From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 5, 2009 at 3:47 PM, Luiz Henrique de Figueiredo wrote: > bazar2.conectiva.com.br seems to be up: it answers smtp connections but > not http. I wonder whether the list is down... > By the flood of emails I just received, I'd say it was, but is back now :) Thanks, Matthew From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:27:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HR7q7002197; Thu, 6 Aug 2009 14:27:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87765192F6; Thu, 6 Aug 2009 14:24:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35F1219198 for ; Thu, 6 Aug 2009 14:18:54 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HIprL031726 for ; Thu, 6 Aug 2009 14:18:51 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 91B8F1F1162; Thu, 6 Aug 2009 14:18:51 -0300 (BRT) Date: Thu, 6 Aug 2009 14:18:51 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? Message-ID: <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm accustomed to use Lua to store persistent data structures on disk. > Unfortunately, in my latest venture, I run out of string space. I did > a little investigation in the source, and it appears that only 2^18 > literal constants may appear in any one source file, and this appears > to be a hard limit built into the bytecode format. > > I would like to write large Lua tables out to disk, possibly nested, but > with no sharing or cycles. Does anybody have any suggestions how to > achieve this without running afoul of the dreaded 'constant table overflow'? The usual solution for this is to divide your data into functions because the limit is per function. This has been discussed before: http://lua-users.org/lists/lua-l/2008-02/msg00298.html From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:27:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HRhm6002438; Thu, 6 Aug 2009 14:27:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B0841928A; Thu, 6 Aug 2009 14:25:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A6261925F for ; Thu, 6 Aug 2009 14:20:32 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n76HKVhl021106 for ; Thu, 6 Aug 2009 14:20:31 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 4774854C04F; Thu, 6 Aug 2009 14:20:32 -0300 (BRT) Date: Thu, 6 Aug 2009 14:20:32 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: [ANN] An extended Lua FAQ Message-ID: <20090806172032.GB6178@inf.puc-rio.br> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <1249413117.24659.9.camel@matroskin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1249413117.24659.9.camel@matroskin> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Quick! Fix Roberto's last name before he gets angry! I am quite used to see my last name wrong, but "Ieruslemamy" is a first :) -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 14:32:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76HWaDY003957; Thu, 6 Aug 2009 14:32:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 315AB193A9; Thu, 6 Aug 2009 14:32:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27946192DB for ; Thu, 6 Aug 2009 14:32:07 -0300 (BRT) Received: by vws15 with SMTP id 15so906828vws.5 for ; Thu, 06 Aug 2009 10:32:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.95.212 with SMTP id e20mr293127vcn.4.1249579926307; Thu, 06 Aug 2009 10:32:06 -0700 (PDT) In-Reply-To: <20090806172032.GB6178@inf.puc-rio.br> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <1249413117.24659.9.camel@matroskin> <20090806172032.GB6178@inf.puc-rio.br> From: Phoenix Sol Date: Thu, 6 Aug 2009 12:31:43 -0500 Message-ID: <8a25d01b0908061031j4a07e6c0s5f47ea4ec6618834@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ To: Lua list Content-Type: multipart/alternative; boundary=0016e64601f6a044ee04707c7f2f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64601f6a044ee04707c7f2f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > > I am quite used to see my last name wrong, but "Ieruslemamy" is a first :) > > -- Roberto > That's blasphemamy! --0016e64601f6a044ee04707c7f2f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
I am quite used to see my last name wrong, but "Ieruslemamy" is a first :)

-- Roberto

That's blasphemamy!

--0016e64601f6a044ee04707c7f2f-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 15:16:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76IGqSL014589; Thu, 6 Aug 2009 15:16:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FA2418BCE; Thu, 6 Aug 2009 15:16:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sirppi.helsinki.fi (sirppi.helsinki.fi [128.214.205.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F41418B7A for ; Thu, 6 Aug 2009 15:16:16 -0300 (BRT) Received: from sirppi.helsinki.fi (localhost [127.0.0.1]) by sirppi.helsinki.fi (8.13.7/8.13.7) with ESMTP id n76IGC2e242203 for ; Thu, 6 Aug 2009 21:16:12 +0300 (EEST) Received: (from jpihlaja@localhost) by sirppi.helsinki.fi (8.13.7/8.13.7/Submit) id n76IGBHr242492; Thu, 6 Aug 2009 21:16:11 +0300 (EEST) Date: Thu, 6 Aug 2009 21:16:10 +0300 (EEST) From: M Joonas Pihlaja To: Lua list Subject: Re: Feature proposal: Fast lua_lock In-Reply-To: <89d273ba0908060734g6170dufc1d3d4165f2640b@mail.gmail.com> Message-ID: References: <89d273ba0908060734g6170dufc1d3d4165f2640b@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Jerome, On Thu, 6 Aug 2009, Jerome Vuarand wrote: > The shared data is > stored in a shared Lua state. The lua_lock mechanism ensures that my > two (or more) threads cannot corrupt the state while accessing it > concurrently. However some manipulations of the shared state imply > calling several functions of the Lua API, and since between each call > the state is unlocked another thread could have messed with the stack > state. Yow.. this sounds dangerous! Usually I'd advocate against using the same lua_State directly from multiple threads even if the VM has a sane lua_lock/unlock implementation. I think the intended mechanism for shared access is for threads to access the same global state via related lua_States created by lua_newthread(). This approach gets around the problem of The Stack State being messed up by separate threads by not having a single stack state at all. > For that reason I call lua_lock in my library, and made sure recursive > calls to lua_lock were ok. OK, so I guess this means concretely that your lua_lock is twiddling a recursive mutex, right? > Additionnally, I've added two functions called lua_lock and > lua_unlock, declared in lua.h and implemented in lstate.c, which > simply call luai_lock and luai_unlock respectively. One problem I see with exposing lua_lock()/unlock in the official API is that the current implementation is carefully balanced to work with a non-recursive mutex on the assumption that only the Lua VM can call lua_lock()/unlock(). In particular it assumes that it can pass ownership of the lock from one level of lua API calls to another level across longjmps regardless of how much user C code it's jumping over. Exposing lua_lock/unlock() via the Lua API might cause problems on longjmps across sandwiched user C code which is *also* holding the lock because the user code is never given a chance to release its lock. In the worst case it could lead to leaked lock references and deadlock depending on how exactly it's implemented and what the lock ownership policy is. One approach to allowing recursive holds on the same mutex with lua_lock()/unlock() might involve the user establishing a stack of handlers to call before longjmping so that they can do scope-exit cleanup such as releasing their lock holds. A simpler alternative might be for the VM to directly keep track of the number of recursive holds on the same lock and use the appropriate number of lua_unlocks() to keep the lock balanced when catching a longjmp. Joonas From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 15:17:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76IHRZU014740; Thu, 6 Aug 2009 15:17:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE02618C23; Thu, 6 Aug 2009 15:17:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E189818BED for ; Thu, 6 Aug 2009 15:16:57 -0300 (BRT) Received: by fxm25 with SMTP id 25so1005300fxm.5 for ; Thu, 06 Aug 2009 11:16:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.193.12 with SMTP id v12mr69219mup.93.1249582616218; Thu, 06 Aug 2009 11:16:56 -0700 (PDT) In-Reply-To: References: Date: Thu, 6 Aug 2009 13:16:56 -0500 Message-ID: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> Subject: Re: handling asynchronous events in lua From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 5, 2009 at 10:36 AM, Cosmin Apreutesei wrote: > Another solution would be to keep the callbacks into FIFO list and > have lua pull them from there that's what i did for my Helper Threads Toolkit (http://luaforge.net/projects/helper-threads/). feel free to use whatever code you want from there. in fact, my 'grand vision' for that project had two parts: 1:- a generic asynchrounous Lua API. (the front end) 2:- make it easy to write asynchronous bindings to C libraries. (the back end) to make 2 possible, i resorted to the helper threads trick, since most interesting C libraries aren't asynchronous by nature; but in theory, if your C library is really async, you should be able to use some of the back end API and get the front end 'for free' if you're interested in the idea, i can dig the code to help somewhat better, since i really don't remember how 'threading independent' the code resulted in the end. -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 15:45:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76IjbBJ021408; Thu, 6 Aug 2009 15:45:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 498FC192E3; Thu, 6 Aug 2009 15:45:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68CE418D78 for ; Thu, 6 Aug 2009 15:45:02 -0300 (BRT) Received: by pzk28 with SMTP id 28so1127609pzk.11 for ; Thu, 06 Aug 2009 11:45:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.112.3 with SMTP id k3mr270139wac.110.1249584300130; Thu, 06 Aug 2009 11:45:00 -0700 (PDT) In-Reply-To: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> References: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> Date: Thu, 6 Aug 2009 13:45:00 -0500 Message-ID: <576e7620908061145j1378248x8c23969c5e29e33f@mail.gmail.com> Subject: Re: How do I pass a pointer to a lua function into C++? From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > //C++ code > Timer::Timer(int x, int y, ??? luaFunction1, ??? luaFunction2)// I > don't know what object they'd be > { > //is any of this right? > lua_pushvalue( L, -1 ); // this is meant to push the function onto the stack > m_timerFunction2 = luaL_ref( L, LUA_REGISTRYINDEX ); //which I then > move to the registry > lua_pushvalue( L, -1 ); > m_timerFunction1 = luaL_ref( L, LUA_REGISTRYINDEX ); > } If you don't need to do anything more with the functions once they're bound (and assuming they're at the top of the stack), you can just remove the lua_pushvalue() calls. Otherwise, your indices should be -1 and -2, respectively (as is, you end up making both refs to function #2). The last two parameters are only needed if the functions aren't on top of the stack. In that case, they would just be the stack indices passed to the lua_pushvalue() calls before the refs. From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 16:02:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76J2t6a026156; Thu, 6 Aug 2009 16:02:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8C5019352; Thu, 6 Aug 2009 16:02:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh05.mail.saunalahti.fi (emh05.mail.saunalahti.fi [62.142.5.111]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C0FB19340 for ; Thu, 6 Aug 2009 16:02:20 -0300 (BRT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh05-2.mail.saunalahti.fi (Postfix) with SMTP id A6DC48BF67 for ; Thu, 6 Aug 2009 22:02:16 +0300 (EEST) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A00D8596C0C; Thu, 06 Aug 2009 22:02:16 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 9042541BE8 for ; Thu, 6 Aug 2009 22:02:13 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: handling asynchronous events in lua Date: Thu, 6 Aug 2009 22:02:11 +0300 References: X-Mailer: Apple Mail (2.935.3) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You will find discussion on this in the archives, if only you dig deep enough. (sorry, no link here) Helper Threads was already mentioned. Also other Lua threading kits each solve this in their own way (with own pros and cons). My code, Lua Lanes, is an addon library so it requires no patching to Lua itself. You'd bring up one "lane" (separate Lua state, and OS thread) that would take in the callbacks and forward them to Lindas, which are inter-state coordinated data moving vehicles. Think of them as shared tables (with FIFO behaviour if required). Yet another approach, which I have taken years back with SDL audio callbacks, was to craft my own C-side data structures that would be filled with the callbacks and emptied by a poll from Lua. There the issue becomes how general purpose you want it to be. If only a flow of numbers, even this should do. It might fit the Alien usage model, but personally I don't like that level of binding, personally. -asko Cosmin Apreutesei kirjoitti 5.8.2009 kello 18:36: > Hi, > > I have a library in which I can register asynchronous callbacks. > Problem is, I can't call Lua inside the callback because the state is > not consistent (obviously). Is there any way I can handle the lua > state in consistent steps so I can enter back to lua and call a lua > function? Python has this signal lib[1] that seems to work this way, > executing the callbacks just between "atomic" python instructions. > Sorry if this is old potatoes, I'm reading the list as fast as I can > :) > > Another solution would be to keep the callbacks into FIFO list and > have lua pull them from there -- and let the user solve the threading > problem separately, with a threading library or with coroutines, > depending on the design of the app. I was thinking of adding this > functionality to alien as a general solution for async. callbacks. Is > that a generally useful pattern to belong to a binding library or just > my special needs? > > [1] http://docs.python.org/library/signal.html From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 16:17:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76JHK0U030274; Thu, 6 Aug 2009 16:17:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C15E18B12; Thu, 6 Aug 2009 16:16:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9960518967 for ; Thu, 6 Aug 2009 16:16:44 -0300 (BRT) Received: by fxm25 with SMTP id 25so1041944fxm.5 for ; Thu, 06 Aug 2009 12:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=GgVQ8oI4GH8gOEu1YIRS5wtKCeG1mLmJiwpBzWlTvcA=; b=HHkP3YhoKL/zLtJTBC08Z2gH9n7bXeP+/ujem6vASGQcZEL++HHJcOcRHy7ZND2L/q i1hGjKMvAv2twMQmcZFqxUI5ElJngYuZaTbCjrNHElsupQi9xKgq0aEXVFRl93Zhigh6 75mhZG2JacDKJSGyUUIJNrgVuJn7OgtMJHr/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=kJBI56rb3UXKU8AhlJgRgEs+EkbFG4r9bFkC2thlBX8QqG/Q6i6dl/BVUoJ8M4+O1a suKbZTNABjffXI4BIM0B1qY42tbmfCFH6nECScK65t2W1YDxAq7XnEoujth5DZFCnMLW vZOFnI78Ofpsa6y/qF1KKMZbT6uWrS8sb76xk= MIME-Version: 1.0 Received: by 10.223.103.196 with SMTP id l4mr74895fao.97.1249586201630; Thu, 06 Aug 2009 12:16:41 -0700 (PDT) Date: Thu, 6 Aug 2009 23:16:41 +0400 Message-ID: Subject: Lua Alchemy: call for contributors From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lua Alchemy (http://code.google.com/p/lua-alchemy) is the system that brings Lua (http://lua.org) to Adobe Flash -- and it needs your help! We have started our development in December 2008. We are now at version 0.2. We even do have our users. :-) Lua Alchemy currently allows running Lua code from AS3 and allows that Lua code to use AS3 objects transparently. (See our live demo: http://lua-alchemy.googlecode.com/svn/trunk/demo/index.html) Lua Alchemy is impressive as it is now, but it can be even better! We have large number of features to implement, from easiest coding tasks to the hard but interesting intellectual challenges. As Lua Alchemy is still in early stage of development, it has a couple of non-fatal issues, that nevertheless do annoy its users. See our issue tracker: http://code.google.com/p/lua-alchemy/issues/list Some of most juicy features planned: -- Lua replacement for MXML. -- Full support for advanced Lua types (tables, coroutines) from AS3. -- A library to wrap asynchronous AS3 operations (like file access) into Lua coroutines for more straightforward end-user's code. (Also would serve as a workaround for the notorious flyield() bug of Adobe Alchemy, allowing remote dofile() etc.) Can You Help Lua Alchemy? -------------------------------------- -- Have a question on how Lua Alchemy works or how is best to use it? -- Want to share how you use Lua Alchemy in your project? -- Have an idea on how to make Lua Alchemy better? -- Have some time to write documentation? -- Perhaps even have some time to contribute code? Please post to lua-alchemy-dev@googlegroups.com! (You may also add an issue to our bug-tracker: http://code.google.com/p/lua-alchemy/issues/list) On Code Contributions ------------------------------- We accept: 1. GitHub pull requests from your forks (preferable). 2. Git patches based on the master branch (send them to the mailing list). 3. If you're not familiar with Git, but do want to help, you may simply get current master, change it and send to mailing list a regular patch (or even modified master itself in an archive). When writing code for Lua Alchemy, please try to follow these non-mandatory simple rules: 1. Try to follow code style. (Some things are described here: http://code.google.com/p/lua-alchemy/wiki/CodingGuidelines.) 2. Try to write tests for the code you wrote. 3. If to implement a feature you need to write some complex code, please ask in the mailing list first -- perhaps one of us have something relevant around. What do you need to know: To contribute code to Lua Alchemy, you need to know ActionScript and/or plain C and/or Lua. We have some tasks for any of these languages alone, however, due to the nature of Lua Alchemy, most of our tasks require a mix of them in various proportions. If you do not know any of these technologies, but still want to help, do not hesitate asking any questions on mailing list. How to Setup Development Environment ------------------------------------------------------- If you're on OS X or Linux, things are easy. Just install Adobe Flex SDK (http://opensource.adobe.com/wiki/display/flexsdk/Setup) and Adobe Alchemy (http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started) and you're good to go. If you're on Windows, things are bit harder. This guide describes how to install required toolchain on Windows: http://code.google.com/p/lua-alchemy/wiki/SetupFlexSdkAlchemyOnWindows. As you may see it is a rather complicated process. To help our contributors who work on Windows, we plan to create free VMWare Appliance image (runnable in a free VMWare player), containing full Lua Alchemy toolchain installed on Ubuntu JeOS system. This would allow users to compile Lua Alchemy code without installation hassle, while still allowing to edit it in a favorite Windows IDE. If you'd like to use such appliance, please drop a note to the mailing list, we would provide it ASAP. One Final Note --------------------- Please remember: we're always glad to help you! If you have any questions, please post them to the mailing list (lua-alchemy-dev@googlegroups.com or http://groups.google.com/group/lua-alchemy-dev) From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 18:11:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76LBfke023533; Thu, 6 Aug 2009 18:11:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D29D6192CB; Thu, 6 Aug 2009 18:11:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from appsserver4.klmicrowave.com (75-145-8-82-Delmarva.hfc.comcastbusiness.net [75.145.8.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88656192BB for ; Thu, 6 Aug 2009 18:11:02 -0300 (BRT) X-AuditID: ac1000fb-00005208000005dc-ba-4a7b46d877e1 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by appsserver4.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 6 Aug 2009 17:10:48 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Thu, 6 Aug 2009 17:10:48 -0400 From: "King, Mike" To: Lua list Date: Thu, 6 Aug 2009 17:10:42 -0400 Subject: Versioning libraries Thread-Topic: Versioning libraries Thread-Index: AcoW2ltMP5nGB7OGQIiT6F2wLNHoww== Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB17D403C@KLMExch.klmicrowave.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: AaW5 AtBc BRFO CCU/ CM5Q Ch96 DLah DO9L EZDu Fy6p F1SU GoHT IPCI Kxi2 LCYO MLcn; 1; bAB1AGEAQABiAGEAegBhAHIAMgAuAGMAbwBuAGUAYwB0AGkAdgBhAC4AYwBvAG0ALgBiAHIA; Sosha1_v1; 7; {0496146F-0415-422D-BF09-D7D4C2955547}; bQBrAGkAbgBnAEAAawBsAG0AaQBjAHIAbwB3AGEAdgBlAC4AYwBvAG0A; Thu, 06 Aug 2009 21:10:42 GMT;VgBlAHIAcwBpAG8AbgBpAG4AZwAgAGwAaQBiAHIAYQByAGkAZQBzAA== x-cr-puzzleid: {0496146F-0415-422D-BF09-D7D4C2955547} acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n76LBfke023533 I'm trying to find a way to allow Lua to load different versions of a library but only one per process. I need to be able to create Lua scripts in a short amount of time. Some scripts may require me to write a C library. The problem is creating a complete well thought out library could take some time. I would like the freedom to release incomplete libraries that solve the immediate need and have the option in the future to complete the libraries without having to worry about previous scripts failing because of the changes. The scripts would need to specific the version of the library. I realize if a library has a bug, I would have to update all the scripts that use that version to use a newer version that has the fix. This is okay for me. I'm probably going to rewrite the require function to enable this requirement. Does anyone have any thoughts on this? CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 18:31:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76LVqLl026494; Thu, 6 Aug 2009 18:31:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3598F192D0; Thu, 6 Aug 2009 18:31:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B19E2192BB for ; Thu, 6 Aug 2009 18:31:22 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76LVKqg026421 for ; Thu, 6 Aug 2009 18:31:20 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n76LVJQ14565; Thu, 6 Aug 2009 18:31:19 -0300 Date: Thu, 6 Aug 2009 18:31:18 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Versioning libraries Message-ID: <20090806183118.B14524@lua.tecgraf.puc-rio.br> References: <85861A744C29EA46BFD9BB61889AE59D3CB17D403C@KLMExch.klmicrowave.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <85861A744C29EA46BFD9BB61889AE59D3CB17D403C@KLMExch.klmicrowave.com>; from MKing@klmicrowave.com on Thu, Aug 06, 2009 at 05:10:42PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm trying to find a way to allow Lua to load different versions of a library but only one per process. [...] I'm probably going to rewrite the require function to enable this requirement. require already does support versions albeit in an awkward way: "Moreover, if the module name has a hyphen, its prefix up to (and including) the first hyphen is removed. For instance, if the module name is a.v1-b.c, the function name will be luaopen_b_c." http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 19:09:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76M8xDV001196; Thu, 6 Aug 2009 19:09:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 170DE18AAD; Thu, 6 Aug 2009 19:08:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9FD618A7F for ; Thu, 6 Aug 2009 19:08:27 -0300 (BRT) Received: by bwz19 with SMTP id 19so1083230bwz.37 for ; Thu, 06 Aug 2009 15:08:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.52.138 with SMTP id i10mr2560185bkg.0.1249596505327; Thu, 06 Aug 2009 15:08:25 -0700 (PDT) In-Reply-To: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> References: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> Date: Fri, 7 Aug 2009 01:08:25 +0300 X-Google-Sender-Auth: 8b97580cf266e695 Message-ID: Subject: Re: handling asynchronous events in lua From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n76M8xDV001196 On Thu, Aug 6, 2009 at 21:16, Javier Guerra wrote: > On Wed, Aug 5, 2009 at 10:36 AM, Cosmin > Apreutesei wrote: >> Another solution would be to keep the callbacks into FIFO list and >> have lua pull them from there > > that's what i did for my Helper Threads Toolkit > (http://luaforge.net/projects/helper-threads/).  feel free to use > whatever code you want from there. In fact, HTT was the first lib I checked for this. Problem is I want a pure-lua solution. Reason: With a few minor mods to alien, I managed to bind the most of a quite old little API, the kind which wants you to do all alloc & struct-filling in a mixed alignment/byte-order mode.. you know the 80's kind. Results: no compilation, no makefile, still more readable and simple code than I would have had in C (even the pointer-offseting stuff!), no much garbage, less bugs, less time, more fun, merry popins, london... So obviously I'm impressed by this coding style than by the traditional C+Lua mix and I wouldn't want to spoil it all now with this asynchronous business... that's why I'm still looking... phew, so many words :) From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 20:07:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76N7mfA007912; Thu, 6 Aug 2009 20:07:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55BD21928B; Thu, 6 Aug 2009 20:07:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C126E19276 for ; Thu, 6 Aug 2009 20:07:11 -0300 (BRT) Received: by bwz19 with SMTP id 19so1107222bwz.37 for ; Thu, 06 Aug 2009 16:07:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.54.80 with SMTP id p16mr2554511bkg.115.1249600029734; Thu, 06 Aug 2009 16:07:09 -0700 (PDT) In-Reply-To: References: Date: Fri, 7 Aug 2009 02:07:09 +0300 X-Google-Sender-Auth: 3562c83419ecd8cf Message-ID: Subject: Re: handling asynchronous events in lua From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > My code, Lua Lanes, is an addon library so it requires no patching to Lua > itself. You'd bring up one "lane" (separate Lua state, and OS thread) that > would take in the callbacks and forward them to Lindas, which are > inter-state coordinated data moving vehicles. Think of them as shared tables > (with FIFO behaviour if required). Here's my understanding of the situation: the callback (a lua function) is going to be called from a thread in the asynchronous library, which needs the lua state in which the callback resides to be in a consistent state at the moment of entrance. Considering that the state is the state of a lua lane, the question is: can I suspend a lane into a *reentrant* position of its lua state, and only after it ran some initialization code (I need it to load the callback function in the first place)? Does this makes any sense to you or am I asking the wrong questions here? > Yet another approach, which I have taken years back with SDL audio > callbacks, was to craft my own C-side data structures that would be filled > with the callbacks and emptied by a poll from Lua. There the issue becomes > how general purpose you want it to be. If only a flow of numbers, even this > should do. If I can find the "general pattern of async. callbacks", it's all a matter of putting it in a standard library, then the bindings will flow :) It can even have a lil'more complex interface to cover a wide range of usage cases, as long as it's a lua-only interface. Ideas welcomed :) From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 20:27:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76NRO37010202; Thu, 6 Aug 2009 20:27:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E52D19191; Thu, 6 Aug 2009 20:27:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFE7318A98 for ; Thu, 6 Aug 2009 20:26:59 -0300 (BRT) Received: by fxm25 with SMTP id 25so1164004fxm.5 for ; Thu, 06 Aug 2009 16:26:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.114.9 with SMTP id c9mr2533844bkq.161.1249601216911; Thu, 06 Aug 2009 16:26:56 -0700 (PDT) In-Reply-To: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> References: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> Date: Fri, 7 Aug 2009 02:26:56 +0300 X-Google-Sender-Auth: adf3a76afdef3e76 Message-ID: Subject: Re: handling asynchronous events in lua From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > if you're interested in the idea, i can dig the code to help somewhat > better, since i really don't remember how 'threading independent' the > code resulted in the end. [hit send too fast] Since you spent some time in that direction, how about a front-end-only API for just solving async. callbacks (the ones called from an external thread, signal traps, etc.)? Would it be possible without the backend part? Can't figure out the requirements for enough genericity... From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 20:40:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76NeIhQ011295; Thu, 6 Aug 2009 20:40:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E92FC19298; Thu, 6 Aug 2009 20:39:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hm1479-21.locaweb.com.br (hm1479-21.locaweb.com.br [201.76.49.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 079801928B for ; Thu, 6 Aug 2009 20:39:27 -0300 (BRT) Received: from cl01.mobimail.com (201.76.62.23) by hm1479-38.locaweb.com.br (PowerMTA(TM) v3.5r13) id hfdkqu0nvdca for ; Thu, 6 Aug 2009 20:39:19 -0300 (envelope-from ) Received: from [200.166.40.173] (account saulot@lemon.com HELO saulot) by hm1090.cl01.mobimail.com (CommuniGate Pro SMTP 5.2.14) with ESMTPA id 94839372 for lua@bazar2.conectiva.com.br; Thu, 06 Aug 2009 20:39:17 -0300 From: "Saulo Tauil" To: References: In-Reply-To: Subject: Precompiled multiplatform code (ARMxPC) Date: Thu, 6 Aug 2009 20:45:32 -0300 Message-ID: <01ab01ca16f0$0810a0b0$1831e210$@com.br> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01AC_01CA16D6.E2C368B0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoW7r9I0SpN2YmORXeaLobw7PLhtwAAPGoA Content-Language: pt-br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_01AC_01CA16D6.E2C368B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello .. This is my first question. I'm sorry if it is obvious. I'm trying to use Lua in a POS (point-of-sale) terminal, which is ARM based. The lib was compiled successfully (with a lots of warnings) and statically linked to POS project. I have a PC version of the same project only for simulation and debug. The real problem is when I try to run a precompiled lua chunk. The code bellow runs OK on both platforms when LUASTR__ is defined, but lua_load returns a syntax error ONLY ON POS when LUASTR__ is not defined. So the program works on POS only if parsed/compiled inside the terminal. I think that the lua compiled binary is platform independent, right? Is there some endianess issue? Thank you in advance, Saulo Tauil //#define LUASTR__ #ifdef LUASTR__ static char testscript[] = "\r\n" "print(\"oba\")" "\r\n"; #else // Compiled with luac static const unsigned char testscript[]={ 27, 76,117, 97, 81, 0, 1, 4, 4, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 0, 0, 0, 5, 0, 0, 0, 65, 64, 0, 0, 28, 64, 0, 1, 30, 0,128, 0, 2, 0, 0, 0, 4, 6, 0, 0, 0,112,114,105, 110,116, 0, 4, 4, 0, 0, 0,111, 98, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #endif static const char *readMemFile(lua_State *L, void *ud, size_t *size) { // Convert the ud pointer (UserData) to a pointer of our structure luaMemFile *luaMF = (luaMemFile *) ud; // Are we done? if(luaMF->size == 0) return NULL; // Read everything at once // And set size to zero to tell the next call we're done *size = luaMF->size; luaMF->size = 0; // Return a pointer to the readed text return luaMF->text; } int main(int argc, char * argv[] ) { int iErr; char xstr[20]; // initialize Lua pos_init(); SYSLOG(1,"Iniciando...\r\n"); //L = lua_open(); L = lua_newstate(pos_l_alloc, NULL); SYSLOG(1,"fez newstate...\r\n"); lua_register(L,"print",print); SYSLOG(1,"fez register print...\r\n"); {// Test block luaMemFile luaMF; // Load the command and try to execute it... luaMF.text = testscript; #ifdef LUASTR__ luaMF.size = strlen(testscript); #else luaMF.size = sizeof(testscript); #endif if((iErr = lua_load(L, readMemFile, &luaMF, "test script")) == 0) { // Execute the loaded command... // The function takes 0 parameters and will return 1 result if(lua_pcall(L, 0, 1, 0) == 0) { lua_Number result; SYSLOG(1,"fez Pcal...\r\n"); // There was no error // Let's get the result from the stack result = lua_tonumber(L, lua_gettop(L)); } SYSLOG(1,"Fim Pcal...\r\n"); // Clean-up the stack lua_pop(L, 1); } else { SYSLOG(1,"NAO FEZ Load. err=%d...\r\n", iErr); // There was a lua_load error... // Pop the error value from the stack lua_pop(L, 1); } } // cleanup Lua lua_close(L); SYSLOG(1,"fez close...\r\n"); //Infinite loop!!!! for(;;) { sleep10(1); kbd_hit(); } return 0; } ------=_NextPart_000_01AC_01CA16D6.E2C368B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello .. This is my first question. I'm sorry if = it is obvious.

 

I'm trying to use Lua in a POS (point-of-sale) = terminal, which is ARM based. The lib was compiled successfully (with a lots of = warnings) and statically linked to POS project. I have a PC version of the same = project only for simulation and debug.

The real problem is when I try to run a = precompiled lua chunk. The code bellow runs OK on both platforms when LUASTR__ is = defined, but lua_load returns a syntax error ONLY ON POS when LUASTR__ is not = defined.

So the program works on POS only if = parsed/compiled inside the terminal.

 

I think that the lua compiled binary is platform independent, right?

Is there some endianess issue?

 

Thank you in advance,

 

Saulo Tauil

 

//#define LUASTR__

#ifdef LUASTR__

static char testscript[] =3D "\r\n" "print(\"oba\")" "\r\n"; #else // Compiled = with luac static const unsigned char testscript[]=3D{

      27, 76,117, 97, = 81,  0,  1,  4,  4,  4,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,

  0,  0,  0,  0,  = 0,  0,  2,  2,  4,  0,  0,  0,  5,  0,  0,  0, 65, 64,  0,  0,  28, 64,  = 0,  1, 30,  0,128,  0,  2,  0,  0,  0,  = 4,  6,  0,  0,  0,112,114,105, 110,116,  0,  = 4,  4,  0,  0,  0,111, 98, 97,  0,  0,  = 0,  0,  0,  0,  0,  0,  0,

  0,  0,  0,  0,  = 0,  0,  0,  0,

};

#endif

 

static const char *readMemFile(lua_State *L, = void *ud, size_t *size) {

      // Convert the ud = pointer (UserData) to a pointer of our structure

      luaMemFile *luaMF = =3D (luaMemFile *) ud;

      // Are we = done?

      if(luaMF->size = =3D=3D 0)

        &nbs= p;   return NULL;

      // Read = everything at once

      // And set size = to zero to tell the next call we're done

      *size =3D = luaMF->size;

      luaMF->size = =3D 0;

      // Return a = pointer to the readed text

      return = luaMF->text;

}

 

int main(int argc, char * argv[] = )

{

      int = iErr;

      char xstr[20];

      // initialize Lua

 

      pos_init();

 

      SYSLOG(1,"Iniciando...\r\n");

      //L =3D lua_open();

      L =3D lua_newstate(pos_l_alloc, NULL);

      SYSLOG(1,"fez newstate...\r\n");

      lua_register(L,"print",print);

      SYSLOG(1,"fez register print...\r\n");

      {// Test block

        &nbs= p;   luaMemFile luaMF;

        &nbs= p;   // Load the command and try to execute it...

        &nbs= p;   luaMF.text =3D testscript;

#ifdef LUASTR__

        &nbs= p;   luaMF.size =3D strlen(testscript);

#else

        &nbs= p;   luaMF.size =3D sizeof(testscript);

#endif

        &nbs= p;   if((iErr =3D lua_load(L, readMemFile, &luaMF, "test = script")) =3D=3D 0)

        &nbs= p;   {

        &nbs= p;         // Execute the loaded command...

        &nbs= p;         // The function takes 0 parameters and will return 1 = result           &= nbsp;

        &nbs= p;         if(lua_pcall(L, 0, 1, 0) =3D=3D 0)

        &nbs= p;         {

        &nbs= p;            = ;   lua_Number result;

          =             &= nbsp; SYSLOG(1,"fez Pcal...\r\n");

          =             &= nbsp; // There was no error

        &nbs= p;            = ;   // Let's get the result from the stack

        &nbs= p;            = ;   result =3D lua_tonumber(L, lua_gettop(L));

        &nbs= p;         }

          =         SYSLOG(1,"Fim Pcal...\r\n");

          =         // Clean-up the stack

        &nbs= p;         lua_pop(L, 1);

        &nbs= p;   }

        &nbs= p;   else

        &nbs= p;   {

        &nbs= p;         SYSLOG(1,"NAO FEZ Load. err=3D%d...\r\n", = iErr);

        &nbs= p;         // There was a lua_load error...

        &nbs= p;         // Pop the error value from the stack

        &nbs= p;         lua_pop(L, 1);

          =   }

      }

 

      // cleanup Lua

      lua_close(L);

      SYSLOG(1,"fez close...\r\n");

 

      //Infinite loop!!!!

      = for(;;)

      {

        &nbs= p;   sleep10(1);

        &nbs= p;   kbd_hit();

      }

      return = 0;

}

 

------=_NextPart_000_01AC_01CA16D6.E2C368B0-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 20:45:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76NjMZb012056; Thu, 6 Aug 2009 20:45:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0D6619297; Thu, 6 Aug 2009 20:45:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA5E519287 for ; Thu, 6 Aug 2009 20:44:55 -0300 (BRT) Received: by ewy26 with SMTP id 26so1358708ewy.5 for ; Thu, 06 Aug 2009 16:44:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.7.141 with SMTP id 13mr94744wep.24.1249602294307; Thu, 06 Aug 2009 16:44:54 -0700 (PDT) In-Reply-To: <01ab01ca16f0$0810a0b0$1831e210$@com.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> Date: Fri, 7 Aug 2009 00:44:54 +0100 X-Google-Sender-Auth: 1b97828d25b1f5f1 Message-ID: Subject: Re: Precompiled multiplatform code (ARMxPC) From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 7, 2009 at 12:45 AM, Saulo Tauil wrote: > I think that the lua compiled binary is platform independent, right? Precompiled chunks are dependant upon several factors: * Lua version * Endianness * sizeof(int) * sizeof(size_t) * sizeof(Instruction) (which is typically a typedef onto lu_int32) * lua_Number type From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 20:45:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76NjoiS012143; Thu, 6 Aug 2009 20:45:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B0F9192A6; Thu, 6 Aug 2009 20:45:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DFBE192A1 for ; Thu, 6 Aug 2009 20:45:06 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n76Nj511012030 for ; Thu, 6 Aug 2009 20:45:05 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n76Nj4w15035; Thu, 6 Aug 2009 20:45:04 -0300 Date: Thu, 6 Aug 2009 20:45:03 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090806204503.A15029@lua.tecgraf.puc-rio.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <01ab01ca16f0$0810a0b0$1831e210$@com.br>; from saulot@muitofaciltec.com.br on Thu, Aug 06, 2009 at 08:45:32PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I think that the lua compiled binary is platform independent, right? No, it's not. > Is there some endianess issue? This and probably also the representation of floating-point numbers. Search the archives for a version of lundump.c for ARM that handles that. From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 21:10:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n770AbD7014880; Thu, 6 Aug 2009 21:10:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F84219295; Thu, 6 Aug 2009 21:10:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hm1479-22.locaweb.com.br (hm1479-22.locaweb.com.br [201.76.49.92]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4886819191 for ; Thu, 6 Aug 2009 21:10:07 -0300 (BRT) Received: from cl01.mobimail.com (201.76.62.9) by hm1479-38.locaweb.com.br (PowerMTA(TM) v3.5r13) id hfdodu0nvdch for ; Thu, 6 Aug 2009 21:09:52 -0300 (envelope-from ) Received: from [200.166.40.173] (account saulot@lemon.com HELO saulot) by hm1090.cl01.mobimail.com (CommuniGate Pro SMTP 5.2.14) with ESMTPA id 94849071 for lua@bazar2.conectiva.com.br; Thu, 06 Aug 2009 21:09:51 -0300 From: "Saulo Tauil" To: "'Lua list'" References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> In-Reply-To: Subject: RE: Precompiled multiplatform code (ARMxPC) Date: Thu, 6 Aug 2009 21:16:07 -0300 Message-ID: <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoW7/4gcnj5/pUxROqAExftXBY9rwAAZL6Q Content-Language: pt-br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there some way to make it "more" interchangeable? Would it work? -Using the same version of lua compiler. -Limit to platforms with the same sizeof(int), sizeof(size_t), sizeof(Instruction). -Use always int32 as lua_number type (I would never use float in this case) -Make lua "endianess-proof" like java. Maybe the endianess is the most serious issue. I already have to do conversions to communicate between different terminals. If it's not possible... Is there a cross-compilation method? It would be impossible to compile everything inside the terminal. It has not much memory and there isn't a way to read its files. Thks, Saulo Tauil -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley Sent: quinta-feira, 6 de agosto de 2009 20:45 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) On Fri, Aug 7, 2009 at 12:45 AM, Saulo Tauil wrote: > I think that the lua compiled binary is platform independent, right? Precompiled chunks are dependant upon several factors: * Lua version * Endianness * sizeof(int) * sizeof(size_t) * sizeof(Instruction) (which is typically a typedef onto lu_int32) * lua_Number type From lua-bounces@bazar2.conectiva.com.br Thu Aug 6 21:51:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n770plFJ019250; Thu, 6 Aug 2009 21:51:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E35A18A98; Thu, 6 Aug 2009 21:51:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D10FF18A5B for ; Thu, 6 Aug 2009 21:51:17 -0300 (BRT) Received: by ewy26 with SMTP id 26so1383218ewy.5 for ; Thu, 06 Aug 2009 17:51:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.88.3 with SMTP id l3mr160027ebb.96.1249606276656; Thu, 06 Aug 2009 17:51:16 -0700 (PDT) In-Reply-To: <20090806183118.B14524@lua.tecgraf.puc-rio.br> References: <85861A744C29EA46BFD9BB61889AE59D3CB17D403C@KLMExch.klmicrowave.com> <20090806183118.B14524@lua.tecgraf.puc-rio.br> Date: Thu, 6 Aug 2009 20:51:16 -0400 X-Google-Sender-Auth: 8dcc708bb78f2822 Message-ID: Subject: Re: Versioning libraries From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n770plFJ019250 On Thu, Aug 6, 2009 at 5:31 PM, Luiz Henrique de Figueiredo wrote: >> I'm trying to find a way to allow Lua to load different versions of a library but only one per process. [...] I'm probably going to rewrite the require function to enable this requirement. > > require already does support versions albeit in an awkward way: > >  "Moreover, if the module name has a hyphen, its prefix up to (and >  including) the first hyphen is removed. For instance, if the module name >  is a.v1-b.c, the function name will be luaopen_b_c." If you have two versions of a library, you can rename them (e.g. foo1 and foo2) and then simply do require "foo1" and require "foo2". In some cases, the two versions can exist in memory simultaneously this way. If you don't want to rename the libraries, you may store the libraries in different folders and set package.path and package.cpath search paths so that require "foo" picks the library from a certain folder (possibly preferentially from the current working directory, otherwise from a global location). These solutions require no change to require. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 01:51:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n774pWt2007513; Fri, 7 Aug 2009 01:51:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 199C519325; Fri, 7 Aug 2009 01:51:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32050192F6 for ; Fri, 7 Aug 2009 01:50:59 -0300 (BRT) Received: by ywh26 with SMTP id 26so1880231ywh.5 for ; Thu, 06 Aug 2009 21:50:57 -0700 (PDT) Received: by 10.90.28.16 with SMTP id b16mr567759agb.44.1249620656882; Thu, 06 Aug 2009 21:50:56 -0700 (PDT) Received: from mothra.localnet ([201.230.156.145]) by mx.google.com with ESMTPS id 1sm1850783agb.48.2009.08.06.21.50.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Aug 2009 21:50:56 -0700 (PDT) From: Javier Guerra To: lua@bazar2.conectiva.com.br Subject: Re: handling asynchronous events in lua Date: Thu, 6 Aug 2009 23:50:52 -0500 User-Agent: KMail/1.11.4 (Linux/2.6.30; KDE/4.2.4; x86_64; ; ) References: <90eb1dc70908061116m1df7d783j1b8e283e5bd9aa0b@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908062350.52989.javier@guerrag.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei wrote: > > if you're interested in the idea, i can dig the code to help somewhat > > better, since i really don't remember how 'threading independent' the > > code resulted in the end. > > [hit send too fast] Since you spent some time in that direction, how > about a front-end-only API for just solving async. callbacks (the ones > called from an external thread, signal traps, etc.)? Would it be > possible without the backend part? Can't figure out the requirements > for enough genericity... sounds interesting, i'd like to hammer out this idea. (maybe should we take this off-list?) first, i'd like to define a simple, non-threading, C API; suitable for binding libraries with async APIs (like yours). in principle, this would still need the implementor (you) to write the C binding code. Of course, if you want to avoid make and friends, you could use Lua-TCC to compile at runtime :-) any thoughts on this? -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 02:00:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7750Pnm008833; Fri, 7 Aug 2009 02:00:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D6601923D; Fri, 7 Aug 2009 02:00:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4908618A25 for ; Fri, 7 Aug 2009 01:59:59 -0300 (BRT) Received: by ywh26 with SMTP id 26so1883967ywh.5 for ; Thu, 06 Aug 2009 21:59:57 -0700 (PDT) Received: by 10.90.88.16 with SMTP id l16mr611321agb.6.1249621197538; Thu, 06 Aug 2009 21:59:57 -0700 (PDT) Received: from mothra.localnet ([201.230.156.145]) by mx.google.com with ESMTPS id 20sm1842318agd.23.2009.08.06.21.59.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Aug 2009 21:59:56 -0700 (PDT) From: Javier Guerra To: lua@bazar2.conectiva.com.br Subject: Re: Precompiled multiplatform code (ARMxPC) Date: Thu, 6 Aug 2009 23:59:49 -0500 User-Agent: KMail/1.11.4 (Linux/2.6.30; KDE/4.2.4; x86_64; ; ) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> In-Reply-To: <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908062359.49573.javier@guerrag.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Saulo Tauil wrote: > If it's not possible... Is there a cross-compilation method? I haven't done this, but what i would try is to use qemu. it can emulate a full ARM system, where you can install the very same Lua executable as in your POS, but with much more memory and better connected to your desktop, so filetransfer would be easy. then just compile (and test!) the Lua code there. the bytecode files should be directly usable by your deployed environment. -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 03:11:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n776BZfZ014213; Fri, 7 Aug 2009 03:11:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11B8C19351; Fri, 7 Aug 2009 03:11:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A23F819346 for ; Fri, 7 Aug 2009 03:11:02 -0300 (BRT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh03-2.mail.saunalahti.fi (Postfix) with SMTP id A17B2EC079 for ; Fri, 7 Aug 2009 09:10:59 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A0392977DF0; Fri, 07 Aug 2009 09:10:59 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 20C37E51A3 for ; Fri, 7 Aug 2009 09:10:54 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: handling asynchronous events in lua Date: Fri, 7 Aug 2009 09:10:53 +0300 References: X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei kirjoitti 7.8.2009 kello 2:07: >> My code, Lua Lanes, is an addon library so it requires no patching >> to Lua >> itself. You'd bring up one "lane" (separate Lua state, and OS >> thread) that >> would take in the callbacks and forward them to Lindas, which are >> inter-state coordinated data moving vehicles. Think of them as >> shared tables >> (with FIFO behaviour if required). > > Here's my understanding of the situation: the callback (a lua > function) is going to be called from a thread in the asynchronous > library, which needs the lua state in which the callback resides to be > in a consistent state at the moment of entrance. Considering that the > state is the state of a lua lane, the question is: can I suspend a > lane into a *reentrant* position of its lua state, and only after it > ran some initialization code (I need it to load the callback function > in the first place)? Does this makes any sense to you or am I asking > the wrong questions here? You're asking the right question. The hidden Linda Lua state is not executing any code. It's there just for data storage, and obviously has locks for this purpose. Sorry that I really don't remember the inside details without looking at the code (which I won't now) but let's say it's this: - linda Lua state is normally hibernating, and available (not locked) - read or write of lindas will naturally lock the state for the duration of the access - async callbacks should use a C function exposed by Lanes (hopefully, check the code!) to allow C libaries access linda content But I think this is not the solution you want. Your mental plane is more towards the alien world :) and that would not like a dependency on an otherwise unnecessary extension library, I think. Wanted yet to clarify the Lanes side. Have a good day! -asko From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 04:33:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n777XsOg023900; Fri, 7 Aug 2009 04:33:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83DBF1936A; Fri, 7 Aug 2009 04:33:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCB7919363 for ; Fri, 7 Aug 2009 04:33:17 -0300 (BRT) Received: by fxm25 with SMTP id 25so1303728fxm.5 for ; Fri, 07 Aug 2009 00:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=yhb7K0gT0riPXZ15btcelftfGc79LmyYhP3/vlieahE=; b=CPLHO4yctha9zVB5IOyZEvNomjs0JmQodyJWpAGnNUmsayN0e9L2k0s9GaqMAZxGpn AINMD0xksne9qgoWluB+hzY+B4BBumAOCvaPmyIvGH1RvGOGOEDgLhio9h5Qbk1WPnyy 4PWnKbS6FfjJX/iKNU8d7mP5f7Vjq+H+/Io8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=JkYSrL9PI7VYtg0IjR9wsSiiROZ11yv7YorIJNn7QnINEKL8imvvOVmylhiIfKKHo/ wuXxn3JN+YUk8l9mHlQqGdgxy1XGQ+hhvLL10mvnijEpA2lC/ZUXC/ctSwvT23Vwrlp2 k7q5dpXTIfxMWNoOmAm11ae8jxT2U3H9227LI= MIME-Version: 1.0 Received: by 10.239.179.200 with SMTP id e8mr93501hbg.122.1249630395843; Fri, 07 Aug 2009 00:33:15 -0700 (PDT) In-Reply-To: <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> Date: Fri, 7 Aug 2009 09:33:15 +0200 Message-ID: <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> Subject: Re: Precompiled multiplatform code (ARMxPC) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 7, 2009 at 2:16 AM, Saulo Tauil wrote: > Maybe the endianess is the most serious issue. I already have to do > conversions to communicate between different terminals. Some of these ARMs have an even more interesting feature; the doubles are not stored in the appropriate order (that you would expect from the endianness) Found this out the hard way, of course. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 05:38:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n778cLoF029221; Fri, 7 Aug 2009 05:38:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFC631936E; Fri, 7 Aug 2009 05:37:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0E531935B for ; Fri, 7 Aug 2009 05:37:50 -0300 (BRT) Received: by ewy26 with SMTP id 26so1548862ewy.5 for ; Fri, 07 Aug 2009 01:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=gZfC24V8NK4mlZZwmzVMTi8R2MBZtWCCtQfmQyRajg4=; b=FrnnxsM8BM9DPReTL5P2pnZo8FfI668CPbET0Im7xWsn3DukKegV/7lDvOsu87otbg dULuLEkpo0iFdGX7tnbZ4JoLjkHbVJse35rYrJDGJmKoz/UqIkun4hKVU6RD/kXNwiD0 qeE8880X22UHg3ksMeByoyBqqzANGqToVlZIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=jlnBgfDcFcgGrNgw/48sdR/d/cScUoIGbPJF9ZMQpbkz2fFghVvaTpL7inrHp7C2g/ nRO8bpJitq8LDH3Uip7lWasDatWVYpoA56r7kBhIoUD3jW/x1fAAY26BhFx0CHhuWPUW P5L3Pua37Bk3+9sU7BZDtHO4+H6VFgGJ9ryvI= MIME-Version: 1.0 Received: by 10.211.199.11 with SMTP id b11mr1051847ebq.68.1249634269172; Fri, 07 Aug 2009 01:37:49 -0700 (PDT) In-Reply-To: <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> From: Bogdan Marinescu Date: Fri, 7 Aug 2009 11:37:29 +0300 Message-ID: <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> Subject: Re: Precompiled multiplatform code (ARMxPC) To: Lua list Content-Type: multipart/alternative; boundary=0015175933a6b694e60470892641 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175933a6b694e60470892641 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Fri, Aug 7, 2009 at 10:33 AM, steve donovan wrote: > On Fri, Aug 7, 2009 at 2:16 AM, Saulo Tauil > wrote: > > Maybe the endianess is the most serious issue. I already have to do > > conversions to communicate between different terminals. > > Some of these ARMs have an even more interesting feature; the doubles > are not stored in the appropriate order (that you would expect from > the endianness) Found this out the hard way, of course. Yes, me too :) The eLua project includes a cross-compiler (based on a patch posted on this list a while ago) that can cross-compile to ARM and that actually works (tested on many ARMs). Also, make sure that your stack is 8-byte aligned. Best, Bogdan --0015175933a6b694e60470892641 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Aug 7, 2009 at 10:33 AM, steve d= onovan <s= teve.j.donovan@gmail.com> wrote:
On Fri, Aug 7, 2009 at 2:16 AM, Saulo Tauil<saulot@muitofaciltec.com.br> wr= ote:
> Maybe the endianess is the most serious issue. I already have to do > conversions to communicate between different terminals.

Some of these ARMs have an even more interesting feature; the doubles=
are not stored in the appropriate order (that you would expect from
the endianness) =A0Found this out the hard way, of course.

Yes, me too :)
The eLua project includes a cross-compiler (based o= n a patch posted on this list a while ago) that can cross-compile to ARM an= d that actually works (tested on many ARMs). Also, make sure that your stac= k is 8-byte aligned.

Best,
Bogdan


--0015175933a6b694e60470892641-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 06:32:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n779WRsh000602; Fri, 7 Aug 2009 06:32:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C5A41937E; Fri, 7 Aug 2009 06:32:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47D7319375 for ; Fri, 7 Aug 2009 06:31:55 -0300 (BRT) Received: by ewy26 with SMTP id 26so1576414ewy.5 for ; Fri, 07 Aug 2009 02:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=qFoHECuEw34eZYqVpTUG5ypXAngsENo+TD8004drg8c=; b=S9CmGP7+put0QyrvwJaDHAjIwRfL47YvmQUTlnSKujzaXqh7c83AWZh8qzDesnGNXx bm5/luOh9HAQzbXRuu+HQ0hVcbPOJLwptmuFtrFrI+z+gz19WlM+BUWx5yXSBGP1N5a4 WBeHZ+7NhNFWhYxeNVQa991lL5M4CMUm7PBDg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=H+gwrF6iRkKuMcOoZwW2AiBIXtQ7S1kj+IVOd9Y0QeGagH2jNaaHhk4SNrr9Th/+Gb Gg06RYP3qczZkjoTPus6OGMjMXSZNj7L7A6TrNktAPt4/eguJHurFgNYwgfcFKi0jlJ3 IKwDVNRJiRFqI1WNIBk9EhA2NDKJbYxooFyuE= MIME-Version: 1.0 Received: by 10.216.46.83 with SMTP id q61mr206221web.71.1249637513095; Fri, 07 Aug 2009 02:31:53 -0700 (PDT) In-Reply-To: References: <89d273ba0908060734g6170dufc1d3d4165f2640b@mail.gmail.com> From: Jerome Vuarand Date: Fri, 7 Aug 2009 11:31:33 +0200 Message-ID: <89d273ba0908070231k641c6a33i2406a50aba548df7@mail.gmail.com> Subject: Re: Feature proposal: Fast lua_lock To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/6 M Joonas Pihlaja : > On Thu, 6 Aug 2009, Jerome Vuarand wrote: >> The shared data is >> stored in a shared Lua state. The lua_lock mechanism ensures that my >> two (or more) threads cannot corrupt the state while accessing it >> concurrently. However some manipulations of the shared state imply >> calling several functions of the Lua API, and since between each call >> the state is unlocked another thread could have messed with the stack >> state. > > Yow.. this sounds dangerous! Usually I'd advocate against using the > same lua_State directly from multiple threads even if the VM has a > sane lua_lock/unlock implementation. I think the intended mechanism > for shared access is for threads to access the same global state via > related lua_States created by lua_newthread(). This approach gets > around the problem of The Stack State being messed up by separate > threads by not having a single stack state at all. I'll try that. But that doesn't impact the potential usefulness of the proposed patch. >> For that reason I call lua_lock in my library, and made sure recursive >> calls to lua_lock were ok. > > OK, so I guess this means concretely that your lua_lock is twiddling a > recursive mutex, right? Kindof, I'm using a Windows CRITICAL_SECTION. But that's a detail that doesn't matter for the need described in my original post. >> Additionnally, I've added two functions called lua_lock and >> lua_unlock, declared in lua.h and implemented in lstate.c, which >> simply call luai_lock and luai_unlock respectively. > > One problem I see with exposing lua_lock()/unlock in the official API > is that the current implementation is carefully balanced to work with > a non-recursive mutex on the assumption that only the Lua VM can call > lua_lock()/unlock(). In particular it assumes that it can pass > ownership of the lock from one level of lua API calls to another level > across longjmps regardless of how much user C code it's jumping over. > Exposing lua_lock/unlock() via the Lua API might cause problems on > longjmps across sandwiched user C code which is *also* holding the > lock because the user code is never given a chance to release its > lock. In the worst case it could lead to leaked lock references and > deadlock depending on how exactly it's implemented and what the lock > ownership policy is. Of course the user would have to properly balance the locks and unlocks, but that wouldn't be the first thing to take care of while using the Lua C API. And since the actual content of lua_lock and lua_unlock is defined by the user anyway, he can do what he wants with it. > One approach to allowing recursive holds on the same mutex with > lua_lock()/unlock() might involve the user establishing a stack of > handlers to call before longjmping so that they can do scope-exit > cleanup such as releasing their lock holds. A simpler alternative > might be for the VM to directly keep track of the number of recursive > holds on the same lock and use the appropriate number of lua_unlocks() > to keep the lock balanced when catching a longjmp. This looks like a big and complicated change. I don't need a coffee machine, only to slightly improve the Lua C API. I can already implement lua_lock as a function, let Lua source code mostly unpatched and still call lua_lock from my user code. My proposed patch just reduces the overhead of locking in situations where it's applicable, without adding or removing any other feature from the existing Lua code base. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 06:38:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n779cMrF001082; Fri, 7 Aug 2009 06:38:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7712619389; Fri, 7 Aug 2009 06:38:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2027219375 for ; Fri, 7 Aug 2009 06:37:55 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so428856eyd.11 for ; Fri, 07 Aug 2009 02:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=kZyhedyoLJbZLf728bh9OaGEA0Vsrg+iKaoILxOkE2o=; b=HXFt/uNHg9MzWi7dzWGU0UYobSym1UuEXhm9e+XmhEyWS1tMNmVy+2unoLRhABM7di SehjgGQOb5fX0C5X8pEJeNmeNdKNkZzAlzvbYomDhAaSE0KR0tYO0TTG1ZdSaM2LqDfr zwpLdNJepdy4flle6DdfgFgAEzYBX8NA5at04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=vJu7qwtOv9cRadb/y+f8Uwa12qCdVjoiFBnsbnom9mWOMu449WRoH2mAtIdYyi3jyH NnSJ07bLzw9bbSDpCxzsPOIR13woHIDI9lNt368BHf4tXDb2DBt1r/R4i6w91SsUpB8v csBO1asnpCocDhMonzt4zDNf3yAiULRuKb3OY= MIME-Version: 1.0 Received: by 10.216.3.206 with SMTP id 56mr198211weh.99.1249637874113; Fri, 07 Aug 2009 02:37:54 -0700 (PDT) In-Reply-To: References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> From: Jerome Vuarand Date: Fri, 7 Aug 2009 11:37:34 +0200 Message-ID: <89d273ba0908070237q13751aa3p92d0a89aade3d4b5@mail.gmail.com> Subject: Re: how to load a very large table with more than 2^18 literal strings? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/6 Peter Cawley : > On Wed, Aug 5, 2009 at 2:36 AM, Norman Ramsey wrote: >> I would like to write large Lua tables out to disk, possibly nested, but >> with no sharing or cycles. Does anybody have any suggestions how to >> achieve this without running afoul of the dreaded 'constant table overflow'? > > 2^18 is the limit per function, not per file. Of course, if you file > is a single function (i.e. the unnamed top-level chunk), then 2^18 > becomes the file limit. > > You can transform code like this: > > X = { > a = "b", > c = "d", > e = { > f = "g", > h = "i", > }, > j = "k", > } > > Into something like this: > > X = { > a = "b", > c = "d", > e = (function() return { > f = "g", > h = "i", > } end)(), > j = "k", > } > > Thus moving some constants out of the top-level and into subfunctions. This can be done easily with a couple gsub in the file content: function dofile(filename, ...) return assert(loadstring(assert(assert(io.open(filename, "rb")):read("*a")):gsub("{", "(function() return {"):gsub("}", "} end)()")))(...) end Loading will be a bit slower, but this should remove the limit. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 06:43:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n779hLhJ001434; Fri, 7 Aug 2009 06:43:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3CB11938D; Fri, 7 Aug 2009 06:43:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B101A1892D for ; Fri, 7 Aug 2009 06:42:55 -0300 (BRT) Received: by ewy26 with SMTP id 26so1582105ewy.5 for ; Fri, 07 Aug 2009 02:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=pfFNhttg0NAyslTnaA3J9DU0EAJsM+t0nZchatgVOpA=; b=oEUuQ/44kR+g8j6jKRRhlS7PksS2wFolXwyqSlE4xXDRYanpbOYyxQQoeCP+Yi4zQc nF7bkXhFbe6e2MJiMhO/pZDjQyxKncBmZA3wteoFgh6J+VJSg98XcYqTtslVnSaIEYSJ IwvJ1uC6lccNfrFVcA4N51G00pX+n7i5Ndnes= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=MT8KP8mcz4SdXNWBhP+NR+dzDO8F+lonCfn8DJ++6LWV7yj9RIfnlo3pwVmbQVfVcL mvmiUDSLaFF3wGrLfIf4Zb1Rr3/Ag5hZfBp6wqK7pAFhbXpuoGFLCpUuauxa+bqIRCCn 3RHsN/jSfn0LG7yDLxI6YiLwChiPSv77XhuBU= MIME-Version: 1.0 Received: by 10.216.3.206 with SMTP id 56mr199045weh.99.1249638174131; Fri, 07 Aug 2009 02:42:54 -0700 (PDT) In-Reply-To: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> References: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> From: Jerome Vuarand Date: Fri, 7 Aug 2009 11:42:34 +0200 Message-ID: <89d273ba0908070242h75e1b7celc2978629a0d04ccb@mail.gmail.com> Subject: Re: How do I pass a pointer to a lua function into C++? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/6 Colm Sloan : > I'm new to Lua so I apologize for any horrible mistakes I'm making > here. I have a timer that I want to run two pieces of code in Lua > periodically. Here's my attempt so far: > > -- Lua code > delay = 10 > t = Timer(delay, function() [code] end, function() [code] end) > > //C++ code > Timer::Timer(int x, int y, ??? luaFunction1, ??? luaFunction2)// I > don't know what object they'd be > { > //is any of this right? > lua_pushvalue( L, -1 ); // this is meant to push the function onto the stack > m_timerFunction2 = luaL_ref( L, LUA_REGISTRYINDEX ); //which I then > move to the registry > lua_pushvalue( L, -1 ); > m_timerFunction1 = luaL_ref( L, LUA_REGISTRYINDEX ); > } > > Timer::ExecuteTimer1() //just making up a simple name for the example > { > lua_rawgeti( L, LUA_REGISTRYINDEX, m_timerFunction1 ); > lua_call( L, 0, 0 ); //is this right? > } Unless you properly built Lua with C++ exceptions support, and Lua is already on the call stack, you should use lua_pcall to make sure your callback won't throw an error that is not caught. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 08:10:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77BAGAF009500; Fri, 7 Aug 2009 08:10:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B89419392; Fri, 7 Aug 2009 08:09:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFF8E1938E for ; Fri, 7 Aug 2009 08:09:44 -0300 (BRT) Received: from [192.168.254.14] (os-dsl-0882.bmts.com [216.183.155.115]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n77B9PNL028434 for ; Fri, 7 Aug 2009 07:09:40 -0400 Message-ID: <4A7C0B65.30702@hempeldesigngroup.com> Date: Fri, 07 Aug 2009 07:09:25 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> In-Reply-To: <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bogdan Marinescu wrote: > The eLua project includes a cross-compiler (based on a patch posted on > this list a while ago) that can cross-compile to ARM and that actually > works (tested on many ARMs). Also, make sure that your stack is 8-byte > aligned. Do you mean 4 byte? And if not - why 8 byte? Ralph From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 08:21:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77BLmie011440; Fri, 7 Aug 2009 08:21:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 361F7193A2; Fri, 7 Aug 2009 08:21:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f225.google.com (mail-bw0-f225.google.com [209.85.218.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F39301936F for ; Fri, 7 Aug 2009 08:21:23 -0300 (BRT) Received: by bwz25 with SMTP id 25so1409605bwz.35 for ; Fri, 07 Aug 2009 04:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FthrU+M7SsOavfDvLk4dOXx0T6M8I8egSWs3WDPK35I=; b=pQfQZZ3JgtokyTjmyJ+TMmsUuOQ2eRnSCBM/csynUPEU9pGz+THykPXfeHB4ak6IM7 9JEtZpLPJ1R11ynS9nX8OuKSsPdpsj8fKzgS8gsmfo2hRRvrn/2uEXP9DZBx9uM3jK6a rLF6efg4DDMy3VrRxyRi5UnAYBywUTZUGMlbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CuCWgL8MBBfKU5Nk5fkeG/2pen9LM/O+elyXwQVwV0rozGzC+ru5TwHkUkLzUt3JuY 5+Lx80mnT6VWWCIb/PVOVSQdurTZ73OJHNkbkyWCPdbucv6H7nld1Wsae9pwlXglbbJO bNHeFFoEt78T99S3Vjr8kZoEqhE+Uscot06T4= MIME-Version: 1.0 Received: by 10.239.134.65 with SMTP id 1mr88163hby.160.1249644077051; Fri, 07 Aug 2009 04:21:17 -0700 (PDT) In-Reply-To: <8a25d01b0908061031j4a07e6c0s5f47ea4ec6618834@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <1249413117.24659.9.camel@matroskin> <20090806172032.GB6178@inf.puc-rio.br> <8a25d01b0908061031j4a07e6c0s5f47ea4ec6618834@mail.gmail.com> Date: Fri, 7 Aug 2009 13:21:16 +0200 Message-ID: <560972290908070421p2bfa135web7726737d632184@mail.gmail.com> Subject: Re: [ANN] An extended Lua FAQ From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 6, 2009 at 7:31 PM, Phoenix Sol wrote: >> I am quite used to see my last name wrong, but "Ieruslemamy" is a first :) Problem corrected! Proofreading by community is probably a scary misuse of resources, like doing your homework on a supercomputer. Also, the items are now automatically numbered, which should help discussion. There is a new Section 5 on Hardware, which needs filling in. http://penlight.luaforge.net/FAQ steve d. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 08:23:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77BNRXE011695; Fri, 7 Aug 2009 08:23:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E328193A5; Fri, 7 Aug 2009 08:23:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD201931E for ; Fri, 7 Aug 2009 08:23:02 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so395159fgg.5 for ; Fri, 07 Aug 2009 04:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xaEL/6BejsOrfVyB8Sk9n2rnaiXExzqpNKM1q7+CNgk=; b=B7xxgy2RaXmslgM4yszGE3k1IcmWR0UTSvXfWX0xokISAHGdRQ/qef+0E5eYkVQWw/ HTeCWtNWimGXMJk4S9FJGRMCp/fVze2Y6rgk+GUaK4lKLaCFhWYmro3sTfN5wNoIRVTT JXEw30JAM+y0jLTBm0Yj7ItrWftcfoZZg4dFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MO2YKYZxO3S9Zjg/ZN3U6HlshZmC9wDP4M41WPMR7Ibo1HfephjnHOmrttEne/Y0Xh XP8mBvzfhli8g/7frFwafokYIj170+ZsNYRmI0pE/MF7nBTCG4aHQAfWdit5rqnjsekf AKhf3Mjpz08pNwdjgJfAD0e+i3lS95Qm4ajhA= MIME-Version: 1.0 Received: by 10.86.99.12 with SMTP id w12mr819114fgb.77.1249644180015; Fri, 07 Aug 2009 04:23:00 -0700 (PDT) In-Reply-To: <89d273ba0908070242h75e1b7celc2978629a0d04ccb@mail.gmail.com> References: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> <89d273ba0908070242h75e1b7celc2978629a0d04ccb@mail.gmail.com> Date: Fri, 7 Aug 2009 12:22:59 +0100 Message-ID: <86a6bb870908070422k41b52763oa9aeda7033a4ef0e@mail.gmail.com> Subject: Re: How do I pass a pointer to a lua function into C++? From: Colm Sloan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I tried what you said and got an error: No matching overload found, candidates: void __init(luabind::argument const&,custom [float],int,lua_State*) I removed the lua_State* from my constructors and binding etc. and stopped receiving the error. It's like it's just not recognising the function() argument as a lua_State*. Here's the lua code: myTimer = Timer( 2, 10, function() Msg('in timer constructor') end ) Here's the constructor call: Timer::Timer( float delay, int repetitions, lua_State* L ) : m_fDelay( delay ), m_iRepetitions( repetitions ), m_fInitialTime( gpGlobals->curtime ) { luaL_checktype( L, -1, LUA_TFUNCTION ); m_luaFunction = luaL_ref( L, LUA_REGISTRYINDEX ); } Any ideas why it's generating that error? Thanks. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 08:35:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77BZV9A012923; Fri, 7 Aug 2009 08:35:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C859193AE; Fri, 7 Aug 2009 08:35:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29BCA1939B for ; Fri, 7 Aug 2009 08:35:04 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so440446eyd.11 for ; Fri, 07 Aug 2009 04:35:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.141 with SMTP id c13mr193818wef.66.1249644903622; Fri, 07 Aug 2009 04:35:03 -0700 (PDT) In-Reply-To: <89d273ba0908070237q13751aa3p92d0a89aade3d4b5@mail.gmail.com> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <89d273ba0908070237q13751aa3p92d0a89aade3d4b5@mail.gmail.com> Date: Fri, 7 Aug 2009 12:35:03 +0100 X-Google-Sender-Auth: 6bd3ce94192a7140 Message-ID: Subject: Re: how to load a very large table with more than 2^18 literal strings? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n77BZV9A012923 On Fri, Aug 7, 2009 at 10:37 AM, Jerome Vuarand wrote: > This can be done easily with a couple gsub in the file content: > > function dofile(filename, ...) >  return assert(loadstring(assert(assert(io.open(filename, > "rb")):read("*a")):gsub("{", "(function() return {"):gsub("}", "} > end)()")))(...) > end > > Loading will be a bit slower, but this should remove the limit. > This will work fine until you have curly braces within string literals. If you want to do the transformation automatically, I'd write a minimal LPEG parser to detect string literals and only perform the replacement outside of them. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 08:38:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77BchUl013314; Fri, 7 Aug 2009 08:38:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BD11193B3; Fri, 7 Aug 2009 08:38:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFA61193AC for ; Fri, 7 Aug 2009 08:38:07 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so440789eyd.11 for ; Fri, 07 Aug 2009 04:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=+CnRxmaauh7krZ0CUVDdCPt5taiDBM0vBZztJMmZOjA=; b=a6DyRwwOWTQbaB8hoH4mO4WVzR3PLzrx4z/1xDCX3VfZ7dTjHdwKSKizeBLWbD8VvR XCO/MsF00l6IVMbWhrv5u/iYaUVe4lrfNn6b5WNSbblfrpi8nMIUNGWLMRUQ8mkSElwC QxFEJAEpV5voHwxr/Xy/Ca9x92m113KEAj9hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=BTc8E2yQcahF4RGEr581t+9vgn1T4M7uuhI2rlTK1tfshEUyNfgpHRwQOM3s4WhktC 3ztiB7ZP+7fskilkiVjJSJfF6koVzxaqO3UCIe2AvKuejpfRZEIloUjcH3F5qfkIjGLz SRIhu99+lkd1o9/tc9oybeUQgIyzvz1dAJF9E= MIME-Version: 1.0 Received: by 10.210.82.13 with SMTP id f13mr1231396ebb.95.1249645078596; Fri, 07 Aug 2009 04:37:58 -0700 (PDT) In-Reply-To: <4A7C0B65.30702@hempeldesigngroup.com> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> <4A7C0B65.30702@hempeldesigngroup.com> From: Bogdan Marinescu Date: Fri, 7 Aug 2009 14:37:38 +0300 Message-ID: <81fbe47d0908070437l2de82518lecf9552d733b17e2@mail.gmail.com> Subject: Re: Precompiled multiplatform code (ARMxPC) To: Lua list Content-Type: multipart/alternative; boundary=0015174c17b4014e3504708babf1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174c17b4014e3504708babf1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I know it has to be 8-byte aligned on ARM9, but at least a thread in the lpc2000 group suggests that in practice this seems to be needed by gcc on ARM7 as well, at least in some cases. Best, Bogdan On Fri, Aug 7, 2009 at 2:09 PM, Ralph Hempel wrote: > Bogdan Marinescu wrote: > > The eLua project includes a cross-compiler (based on a patch posted on >> this list a while ago) that can cross-compile to ARM and that actually works >> (tested on many ARMs). Also, make sure that your stack is 8-byte aligned. >> > > Do you mean 4 byte? And if not - why 8 byte? > > Ralph > > > --0015174c17b4014e3504708babf1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I know it has to be 8-byte aligned on ARM9, but at least a thread in the lp= c2000 group suggests that in practice this seems to be needed by gcc on ARM= 7 as well, at least in some cases.

Best,
Bogdan

On Fri, Aug 7, 2009 at 2:09 PM, Ralph Hempel <rhempel@hempeldesigngroup.com= > wrote:
Bogdan Marinescu wrote:

The eLua project includes a cross-compiler (based on a patch posted on this= list a while ago) that can cross-compile to ARM and that actually works (t= ested on many ARMs). Also, make sure that your stack is 8-byte aligned.

Do you mean 4 byte? And if not - why 8 byte?

Ralph



--0015174c17b4014e3504708babf1-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 09:00:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77C0kIP015985; Fri, 7 Aug 2009 09:00:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B65EA193BF; Fri, 7 Aug 2009 09:00:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB198193B0 for ; Fri, 7 Aug 2009 08:59:53 -0300 (BRT) Received: by fxm25 with SMTP id 25so1433049fxm.5 for ; Fri, 07 Aug 2009 04:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=f+R+ah76nx31hO8v39Yh/lH2sCS7gh/uTcPI2ukxr1E=; b=fkNTFFLT5jetY/yAwa8ftzr+LDJW1/vHbWseYCJQyE+5vtDwYM2B9UUJi+7WTlbJUW eQage0eAFFd4O8++mZ3U3VzbAuhT3f+By2QzMhB2yBaxvKUbvVyRZ9INw7tbqEB/j6Po j/DEe0i8hmq/mfZKnZd8dyYXOHbZX0ug2APD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=Sy8LtPMqqbJeXdFg14+r8wIIaP9sWl8ffee2kRDmf+ZcBWUw5BJH6/UAvkqnQnlTb4 /GtM8VO/3VzJz92DG27voGsMZJpaqQQOWkL6gNi1FzPhIBg7ZncxPgNz7AVAV5DrmlJX eE5H0TXzl0hf9CypN2ejaX8mq/iqX5z7OsY6U= MIME-Version: 1.0 Received: by 10.239.154.199 with SMTP id f7mr127363hbc.42.1249646391776; Fri, 07 Aug 2009 04:59:51 -0700 (PDT) Date: Fri, 7 Aug 2009 13:59:51 +0200 Message-ID: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Subject: Strict 'struct' pattern From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, We all know that global variables can be a pain [1] and should be avoided. The 'strict struct' pattern brings these benefits to tables with named keys A 'struct' can be declared so: struct.Alice { x = 1; y = 2; } And instantiated like so: a = Alice {x = 10, y = 20} or b = Alice {x = 10} -- y will be set to 2 Any attempt to access an unknown field of a and b will be an error, like a.z = 1 or print(b.zz), or even Alice{z = 4}. So this brings two things to the party: (1) typos in fieldnames are errors, not silent problems. (2) such tables now have an _identity_, and this in particular helps when trying to write more self-documenting code. In LuaDoc, you can then confidently give the type of a parameter as Alice, rather than 'a table with x and y being numbers' Stronger typing also means that type-specific assertions can be thrown. A simple overload of __tostring would also give you type-specific string representations like 'Alice #23' for debugging purposes. It would be possible (using a suitable proxy table) to enforce dynamic type checking on field assignments, but of course this would incur a run-time cost. --------------------------------- -- struct.lua --- defining a struct constructor --- local struct_mt = { -- instances can be created by calling the struct object __call = function(s,t) local obj = t or {} -- pass it a table (or nothing) local fields = s._fields -- attempt to set a non-existent field in ctor? for k,v in pairs(obj) do if not fields[k] then s._error_nf(nil,k) end end -- fill in any default values if not supplied for k,v in pairs(fields) do if not obj[k] then obj[k] = v end end setmetatable(obj,s._mt) return obj end; } -- creating a new struct triggered by struct.STRUCTNAME struct = setmetatable({},{ __index = function(tbl,sname) -- so we create a new struct object with a name local s = {_name = sname} -- and put the struct in the enclosing context _G[sname] = s -- the not-found error s._error_nf = function (tbl,key) error("field '"..key.."' is not in "..s._name) end -- reading or writing an undefined field of this struct is an error s._mt = { _name = s._name; __index = s._error_nf; __newindex = s._error_nf; } -- the struct has a ctor setmetatable(s,struct_mt) -- return a function that sets the struct's fields return function(t) s._fields = t end end }) ----------------------- [1] http://lua-users.org/wiki/DetectingUndefinedVariables steve d. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 09:16:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77CG5xt018594; Fri, 7 Aug 2009 09:16:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 574AF193C5; Fri, 7 Aug 2009 09:15:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFA20193B5 for ; Fri, 7 Aug 2009 09:15:37 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77CFUFM018372 for ; Fri, 7 Aug 2009 09:15:32 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n77CFTt16839; Fri, 7 Aug 2009 09:15:29 -0300 Date: Fri, 7 Aug 2009 09:15:28 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090807091528.A16824@lua.tecgraf.puc-rio.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br>; from saulot@muitofaciltec.com.br on Thu, Aug 06, 2009 at 09:16:07PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Maybe the endianess is the most serious issue. I've posted a version of lundump.c that handles the endianess issue here several times. > If it's not possible... Is there a cross-compilation method? I've also posted a discussion of the innards of saving and loading precompiled programs: the bottom line is that the format of precompiled files is not sacred and can be changed at will since it's restricted to two files: ldump.c and lundump.c. If you have trouble locating these threads in the archives, let me know. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 09:34:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77CYlFN020845; Fri, 7 Aug 2009 09:34:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F212193DC; Fri, 7 Aug 2009 09:34:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7643193C8 for ; Fri, 7 Aug 2009 09:34:12 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAI+8e0rL1hyP/2dsb2JhbACCVcx9hBYF X-IronPort-AV: E=Sophos;i="4.43,341,1246809600"; d="scan'208,217";a="488564027" Received: from unknown (HELO tigereye) ([203.214.28.143]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 07 Aug 2009 20:34:07 +0800 From: "John C. Turnbull" To: Subject: LuaJIT performance Date: Fri, 7 Aug 2009 22:34:07 +1000 Message-ID: <00e101ca175b$5b618160$12248420$@com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00E2_01CA17AF.2D0D9160" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoXW1q1GpPXRZwNQLKYbCCz/p2NeQ== Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00E2_01CA17AF.2D0D9160 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I am in the early stages of deciding on a fast scripting language for a new C++ project and obviously Lua is a candidate. When I say fast I mean fast so we'd probably be using LuaJIT as opposed to interpreted Lua. Does anyone know a performance comparison of JIT'ed Lua versus something like V8 JavaScript? Lua has the reputation as the fastest scripting language (in fact that's how I came across it) but does the JIT compiler used in modern JavaScript implementations like V8 greatly narrow the performance gap? JavaScript is clearly a much more comprehensive and complex language so I would be surprised if it could be executed faster than Lua but it's the speed that we really need over language features. Thanks, -JCT ------=_NextPart_000_00E2_01CA17AF.2D0D9160 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

I am in the early stages of deciding on a fast = scripting language for a new C++ project and obviously Lua is a candidate.  = When I say fast I mean fast so we’d probably be using LuaJIT as opposed = to interpreted Lua.

 

Does anyone know a performance comparison of = JIT’ed Lua versus something like V8 JavaScript?  Lua has the reputation as = the fastest scripting language (in fact that’s how I came across it) = but does the JIT compiler used in modern JavaScript implementations like V8 = greatly narrow the performance gap?  JavaScript is clearly a much more comprehensive and complex language so I would be surprised if it could = be executed faster than Lua but it’s the speed that we really need = over language features.

 

Thanks,

 

-JCT

------=_NextPart_000_00E2_01CA17AF.2D0D9160-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:03:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77D3Agd026044; Fri, 7 Aug 2009 10:03:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCC8F193E7; Fri, 7 Aug 2009 10:02:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74E50193E1 for ; Fri, 7 Aug 2009 10:02:40 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MZP5e-0006W9-0P for lua@bazar2.conectiva.com.br; Fri, 07 Aug 2009 14:02:34 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 552D8338F4 for ; Fri, 7 Aug 2009 14:02:31 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:37187 with envelope Message-ID: <4A7C25DF.4020708@cowlark.com> Date: Fri, 07 Aug 2009 14:02:23 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> <4A7C0B65.30702@hempeldesigngroup.com> <81fbe47d0908070437l2de82518lecf9552d733b17e2@mail.gmail.com> In-Reply-To: <81fbe47d0908070437l2de82518lecf9552d733b17e2@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n77D3Agd026044 Bogdan Marinescu wrote: > I know it has to be 8-byte aligned on ARM9, but at least a thread in the > lpc2000 group suggests that in practice this seems to be needed by gcc > on ARM7 as well, at least in some cases. EABI absolutely decrees 8-byte stack alignment, and if you don't have it your app will break. For example, passing 64-bit values through varargs will do really weird things. I'm not sure about the other ARM ABIs but EABI is the most common these days. (I've just encountered this problem in real production code, and had to manually fix the stack alignment before our app would work. Non-Lua-related, though.) -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:08:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77D7nHh027286; Fri, 7 Aug 2009 10:07:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEBC0193ED; Fri, 7 Aug 2009 10:06:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47F80193DE for ; Fri, 7 Aug 2009 10:06:51 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MZP9k-00074g-Se for lua@bazar2.conectiva.com.br; Fri, 07 Aug 2009 14:06:49 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B56FC338F4 for ; Fri, 7 Aug 2009 14:06:45 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:33290 with envelope Message-ID: <4A7C26DD.4040402@cowlark.com> Date: Fri, 07 Aug 2009 14:06:37 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT performance References: <00e101ca175b$5b618160$12248420$@com.au> In-Reply-To: <00e101ca175b$5b618160$12248420$@com.au> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n77D7nHh027286 John C. Turnbull wrote: [...] > Does anyone know a performance comparison of JIT’ed Lua versus something > like V8 JavaScript? Lua has the reputation as the fastest scripting > language (in fact that’s how I came across it) but does the JIT compiler > used in modern JavaScript implementations like V8 greatly narrow the > performance gap? JavaScript is clearly a much more comprehensive and > complex language so I would be surprised if it could be executed faster > than Lua but it’s the speed that we really need over language features. I did some quick-and-dirty benchmarks as part of Clue. Back then, V8 wasn't really set up for running command-line Javascript applications so I was never able to integrate it into the benchmark suite (I should check again), and the benchmarks are astonishingly artificial, but I saw that while V8 was way faster than any other Javascript interpreter out there, LuaJIT was still a lot better. However, I wasn't quite testing like-for-like, so I'm not sure that this was a meaningful result. I need to go and have another look to see if V8 has a proper command-line driver these days. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:15:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77DFqkL028826; Fri, 7 Aug 2009 10:15:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4ECDB193F4; Fri, 7 Aug 2009 10:15:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D39B193EC for ; Fri, 7 Aug 2009 10:15:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so1701807ewy.5 for ; Fri, 07 Aug 2009 06:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=fwyr9lnhwkSZbLEDsQ1cDtFvE6Xrg6JHhRYQ0wrK7b4=; b=IiRCiKKLJiXoVFCmd//jNlWiFelyTXGKp9DNPO0WDXMy/SA5zmOwqnLXJAO2RWnZqx QvzbOf6FBvxs9i9G6zdQMBiiSQ54IOwzf4K3fhsH5e5xOzdqaU/RNID12p1+OFDgFutj 52a+A+kTzHkeLnA1Lbl+nh7YS8/FZCWlBoIno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=SgDRBwrhFLVaFk8x8/4H6awUkFDdaShtpB6Xvp519mjTOZl926NWOepZ7czQMv/Lf2 qKy8I8HU4tRZvopzqEGxqUzJJJTC/UL6J4xeQJ1Si3Ejmd1szaZOWnCYwTzwcf4smhfm aMk2UR0hd7PjLSG/BGs5OBgsho8cjUZ+IMy1o= MIME-Version: 1.0 Received: by 10.211.201.8 with SMTP id d8mr1428069ebq.7.1249650922040; Fri, 07 Aug 2009 06:15:22 -0700 (PDT) In-Reply-To: <00e101ca175b$5b618160$12248420$@com.au> References: <00e101ca175b$5b618160$12248420$@com.au> Date: Fri, 7 Aug 2009 09:15:22 -0400 X-Google-Sender-Auth: a1b492ffa33e52f3 Message-ID: Subject: Re: LuaJIT performance From: Peter Harris To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n77DFqkL028826 On Fri, Aug 7, 2009 at 8:34 AM, John C. Turnbull wrote: > > Does anyone know a performance comparison of JIT’ed Lua versus something > like V8 JavaScript?  Lua has the reputation as the fastest scripting > language (in fact that’s how I came across it) but does the JIT compiler > used in modern JavaScript implementations like V8 greatly narrow the > performance gap? This was posted recently: http://gmarceau.qc.ca/blog/2009/05/speed-size-and-dependability-of.html It shows V8 being slightly faster than stock Lua, and noticeably slower than LuaJIT. As usual, take other people's benchmarks with a block of salt. The only benchmark that matters is your own app. Peter Harris From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:18:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77DINub029206; Fri, 7 Aug 2009 10:18:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 663DF193FF; Fri, 7 Aug 2009 10:18:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f225.google.com (mail-bw0-f225.google.com [209.85.218.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C015F193EC for ; Fri, 7 Aug 2009 10:17:57 -0300 (BRT) Received: by bwz25 with SMTP id 25so1468533bwz.35 for ; Fri, 07 Aug 2009 06:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=OlxHg6Ql71k7plsPzy6pZKcq07q961aZu8ZykRo+HbA=; b=coKLOZQ7G4RkBNEeR4kx7oLxl7Nq4Rdnm8hGRZ3scX0MNIjiH5nAqgxjhW4kB3WuiO 80g5UTiYpB6yfoXvCsKhkXyLbpVK0b5IbaECk0RBsdV1Sic1PlAaBDWj9btM6CJJ1oYY HlV0K5ir3UrfkKS3YYkWKVk0hvsw2ojWQxswM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AlIrFm+9wcoW2XETvsGfmQ/MPYeXfX1Xd4T/ybEC2WfM6gk3FYo4wiD+V4K5BlMJmX 4zaa/aHRdaHsDQf6TXgFVn0JCxz0xHIa1bkI2k2Cg01rD9kYYpqtOI5UdqAkNGYZ7/Qr FJ/945B4Mh26czHhWpc9g0cJ45w0Tt/CaxxlY= MIME-Version: 1.0 Received: by 10.239.174.76 with SMTP id i12mr123220hbf.62.1249651074611; Fri, 07 Aug 2009 06:17:54 -0700 (PDT) In-Reply-To: References: Date: Fri, 7 Aug 2009 15:17:54 +0200 Message-ID: <560972290908070617s6017d68ej647f9d343e5e6fb6@mail.gmail.com> Subject: Re: handling asynchronous events in lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 5, 2009 at 5:36 PM, Cosmin Apreutesei wrote: > I have a library in which I can register asynchronous callbacks. > Problem is, I can't call Lua inside the callback because the state is > not consistent (obviously). Seems to be a common problem. On Windows, I 'recoupled' to the main thread by sending messages to a custom window, on GTK+ I used the async io mechanism for the same thing. But it keeps coming up; I had to solve a similar problem with a little Copas server by making a thread read from stdin and getting it to write to a socket. Didn't feel like the most elegant way to do things! So yes, I'm also interested in a more general solution to the problem. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:31:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77DVGRi031652; Fri, 7 Aug 2009 10:31:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B655919403; Fri, 7 Aug 2009 10:30:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 114B8193D7 for ; Fri, 7 Aug 2009 10:30:52 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MZPWr-00064n-OX for ; Fri, 07 Aug 2009 14:30:41 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MZPWz-0004bj-07 for lua@bazar2.conectiva.com.br; Fri, 07 Aug 2009 14:30:49 +0100 Date: Fri, 7 Aug 2009 14:30:48 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090807143048.1d9142de@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4A7C25DF.4020708@cowlark.com> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <560972290908070033u5ba4ca57j24aa5128d3777f98@mail.gmail.com> <81fbe47d0908070137k579260f1xc7b071c64ad4bf55@mail.gmail.com> <4A7C0B65.30702@hempeldesigngroup.com> <81fbe47d0908070437l2de82518lecf9552d733b17e2@mail.gmail.com> <4A7C25DF.4020708@cowlark.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 07 Aug 2009 14:02:23 +0100 David Given wrote: > I'm not sure about the other ARM ABIs but EABI is the most common > these days. In our experience, it's about 50/50 between EABI and using APCS/OABI. Certainly when Linux is involved. Although we're trying to get our customers to move over to EABI as soon as possible, due to the performance improvements yielded by soft-float and the new syscall system. -- B. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 10:59:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77Dwwp4005361; Fri, 7 Aug 2009 10:58:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A942193FC; Fri, 7 Aug 2009 10:58:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 777F8193EE for ; Fri, 7 Aug 2009 10:58:20 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so113992fgb.5 for ; Fri, 07 Aug 2009 06:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iMuyhgPV7t1WHQQIXaofJtnI6jiprqVW5i1owNbN9Cg=; b=ulryEUryLA5MjHeWmwzPJG6798jba3gl7OGFScYuF2ghqtpF/DQeiDB8+r9yPWBbVz HIrEQoGmsnVC95H3Rie5oj2KNp3AmJI2cEWhDVNfKzUL37x8T56LVggAosvgqzWYz6tT g/zDpjbXE9wkwd1+xRs9cWw5UzSmRloCOnHlw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=q8kPUjnN5BThIaAOboZXiFQAC96IgUaln5amyd52WvyolAzQn61ZyKRKqdLkEOT9KM qz6p1YEXUsSUA3RN/B5AgEMA5VmRRvnOwU5N4xibRjBc6+GkbaPnbRdPyAcQApWr8AWt QivAIRSejeByFXmU6WD54Csv8eU/jUitAKwgs= MIME-Version: 1.0 Received: by 10.86.50.4 with SMTP id x4mr881454fgx.76.1249653497475; Fri, 07 Aug 2009 06:58:17 -0700 (PDT) In-Reply-To: <86a6bb870908070422k41b52763oa9aeda7033a4ef0e@mail.gmail.com> References: <86a6bb870908060257q61b2a07x5ad297e3f13599cd@mail.gmail.com> <89d273ba0908070242h75e1b7celc2978629a0d04ccb@mail.gmail.com> <86a6bb870908070422k41b52763oa9aeda7033a4ef0e@mail.gmail.com> Date: Fri, 7 Aug 2009 14:58:17 +0100 Message-ID: <86a6bb870908070658t65c2474fy7689804603bb166d@mail.gmail.com> Subject: Re: How do I pass a pointer to a lua function into C++? From: Colm Sloan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I figured it out. I just cahnged the lua_State* to luabind::object like so: Timer::Timer( float delay, int repetitions, luabind::object luaFunction ) : m_fDelay( delay ), m_iRepetitions( repetitions ), m_fInitialTime( gpGlobals->curtime ) { if ( luabind::type( luaFunction ) != LUA_TFUNCTION ) throw std::runtime_error("Invalid parameter for Timer constructor. A function must be used\n"); m_luaFunction = luaFunction; } void Timer::Execute() { m_luaFunction(); } I honestly don't know the non-luabind way and I'm curious about it but this will do. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 12:25:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77FPUcH023144; Fri, 7 Aug 2009 12:25:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E96E1941F; Fri, 7 Aug 2009 12:24:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81BB819411 for ; Fri, 7 Aug 2009 12:24:51 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MZRJH-00081q-00; Fri, 07 Aug 2009 17:24:47 +0200 Date: Fri, 7 Aug 2009 17:23:39 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090807152339.GA6283@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00e101ca175b$5b618160$12248420$@com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean John C. Turnbull wrote: > I am in the early stages of deciding on a fast scripting language for a new > C++ project and obviously Lua is a candidate. When I say fast I mean fast > so we'd probably be using LuaJIT as opposed to interpreted Lua. You should also consider the size of scripting engine you're embedding and how easy it is to bind to it. Lua and LuaJIT are more than ten times smaller than V8 and IMHO much easier to embed. > Does anyone know a performance comparison of JIT'ed Lua versus something > like V8 JavaScript? Well, we can find out ... so I fetched today's V8 trunk and ran some standard benchmarks. Unfortunately the V8 standalone shell is very limited and is unable to run quite a few of them. And there's no JavaScript translation for some others. :-( All ratios are normalized relative to the performance of the standard Lua interpreter. E.g. 5.0 means something is five times faster than Lua. Higher numbers are better: | Lua | V8* | LJ1 | LJ2 | GCC -------------+------+------+-------------+------ mandelbrot | 1.0 | 0.9 | 5.8 | 12.6 | 15.4 fasta | 1.0 | 1.1 | 2.8 | 4.0 | 13.3 partialsums | 1.0 | 1.4 | 3.8 | 4.2 | 2.2 spectralnorm | 1.0 | 2.9 | 3.1 | 19.8 | 18.5 nbody | 1.0 | 3.0 | 5.0 | 15.3 | 33.0 nsieve | 1.0 | 4.1 | 2.2 | 4.7 | 27.3 nsievebits | 1.0 | 5.7 | 5.2 | 31.6 | 56.0 recursive | 1.0 | 6.8 | 6.3 | 3.0~| 33.1 fannkuch | 1.0 | 6.8 | 7.3 | 21.4 | 34.6 binarytrees | 1.0 | 8.1 | 1.6 | 3.0~| 11.0 All measurements made on a Core2 E8400, comparing single-threaded, non-hand-vectorized benchmark versions only. Lua = Lua 5.1.4 V8 = V8 trunk 2009-08-07 IA32 (* sorted by this column) LJ1 = LuaJIT 1.1.5 -O LJ2 = LuaJIT 2.0 (unreleased, preliminary numbers, ~ = not JIT compiled (yet)) GCC = GCC 4.3.3 -m32 -O2 -fomit-frame-pointer (or -O3 where it's faster) Summary: Ok, so V8 is catching up. But LuaJIT 1.x still beats it on 6 out of 10 benchmarks. V8 is mainly faster on object allocation. But, surprisingly, V8 is slower for nbody, even though its complex logic for managing object shapes should make this go really fast. Not suprisingly, Lua and LuaJIT still have the lead on numeric benchmarks (unboxed floating point numbers pay off here). And LuaJIT 2.x will completely change the game (sorry, still no ETA). But as others have said: please compare the different VMs with benchmarks that best match *your* performance needs. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 12:51:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77FpgCD027535; Fri, 7 Aug 2009 12:51:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFEDF19425; Fri, 7 Aug 2009 12:51:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDF6B19416 for ; Fri, 7 Aug 2009 12:51:12 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAELqe0rL1hyP/2dsb2JhbADQZYQWBQ X-IronPort-AV: E=Sophos;i="4.43,342,1246809600"; d="scan'208";a="548277798" Received: from unknown (HELO tigereye) ([203.214.28.143]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 07 Aug 2009 23:51:08 +0800 From: "John C. Turnbull" To: "'Lua list'" References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> In-Reply-To: <20090807152339.GA6283@mike.de> Subject: RE: LuaJIT performance Date: Sat, 8 Aug 2009 01:51:05 +1000 Message-ID: <000f01ca1776$e004c830$a00e5890$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoXc030CuME/ffrQaWDQ2fwuo16aQAAuJxw Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Mike, > You should also consider the size of scripting engine you're > embedding and how easy it is to bind to it. Lua and LuaJIT are > more than ten times smaller than V8 and IMHO much easier to embed. [JCT] Yes that is certainly a consideration. > > Does anyone know a performance comparison of JIT'ed Lua versus > something > > like V8 JavaScript? > > Well, we can find out ... so I fetched today's V8 trunk and ran > some standard benchmarks. Unfortunately the V8 standalone shell is > very limited and is unable to run quite a few of them. And there's > no JavaScript translation for some others. :-( > > All ratios are normalized relative to the performance of the > standard Lua interpreter. E.g. 5.0 means something is five times > faster than Lua. Higher numbers are better: > > | Lua | V8* | LJ1 | LJ2 | GCC > -------------+------+------+-------------+------ > mandelbrot | 1.0 | 0.9 | 5.8 | 12.6 | 15.4 > fasta | 1.0 | 1.1 | 2.8 | 4.0 | 13.3 > partialsums | 1.0 | 1.4 | 3.8 | 4.2 | 2.2 > spectralnorm | 1.0 | 2.9 | 3.1 | 19.8 | 18.5 > nbody | 1.0 | 3.0 | 5.0 | 15.3 | 33.0 > nsieve | 1.0 | 4.1 | 2.2 | 4.7 | 27.3 > nsievebits | 1.0 | 5.7 | 5.2 | 31.6 | 56.0 > recursive | 1.0 | 6.8 | 6.3 | 3.0~| 33.1 > fannkuch | 1.0 | 6.8 | 7.3 | 21.4 | 34.6 > binarytrees | 1.0 | 8.1 | 1.6 | 3.0~| 11.0 [JCT] Thanks very much for this very helpful comparison. I am surprised that LJ2 actually beats GCC on some tests. > Not suprisingly, Lua and LuaJIT still have the lead on numeric > benchmarks (unboxed floating point numbers pay off here). And > LuaJIT 2.x will completely change the game (sorry, still no ETA). [JCT] LJ2 looks positively awesome on those numbers. > But as others have said: please compare the different VMs with > benchmarks that best match *your* performance needs. [JCT] Yes, this is true and I intend to do that. I just wanted to get some ballpark feel for the relative speeds and you have provided that info so thanks again. John From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 13:35:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77GZAUH002439; Fri, 7 Aug 2009 13:35:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1369E1942B; Fri, 7 Aug 2009 13:34:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-03.prod.phx3.secureserver.net (p3plsmtpa01-03.prod.phx3.secureserver.net [72.167.82.83]) by bazar2.conectiva.com.br (Postfix) with SMTP id 07AFA19400 for ; Fri, 7 Aug 2009 13:34:28 -0300 (BRT) Received: (qmail 30186 invoked from network); 7 Aug 2009 16:34:24 -0000 Received: from unknown (96.240.121.67) by p3plsmtpa01-03.prod.phx3.secureserver.net (72.167.82.83) with ESMTP; 07 Aug 2009 16:34:24 -0000 Message-Id: <6E794C86-C32B-47BB-B29D-850DFC6BE395@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: matrix operations and temporary objects? Date: Fri, 7 Aug 2009 09:34:23 -0700 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean To make begin_computation/end_computation work, you essentially want something like: for n = 1, 1000 do begin_computation() m = m * m1 + m2 end_computation( m ) end m1 and m2 are preserved because they don't get reallocated in the loop. We signal preservation of m by passing it to end_computation. This pattern is risky with respect to exceptions since the computation can remain open longer than desired. The following variation suffers from function call (specifically pcall) overhead but could fix that problem: local body = function() return m * m1 + m2 end for n = 1, 1000 do m = compute( body ) end compute can know that it should preserve its results. (It could also use the debug API to get it to preserve its upvalues.) But now we're basically back to the situation with using strings or some other mechanism to allow the code to be compiled differently. How about the following form: function computation( flush, m, m1, m2 ) for n = 1, 1000 do m = m * m1 + m2 flush( m ) end return m end m = run_computation( computation, m, m1, m2 ) run_computation adds an extra first argument which is a function which flushes all newly allocated temporaries except the ones that get handed to it. Of course, any of these schemes are pretty bug prone since you are doing essentially manual memory management but its non-obvious manual memory management. Using the debug library could mitigate that by having the flush function actually be aware of the local variables and upvalues in the computation. On a related note, I keep speculating about whether it's worth the effort and complexity to detect objects that don't gain non-stack references and collect them immediately when their last stack reference goes away. It's enough of a whack to the Lua implementation and I lack sufficiently good benchmarks to judge the results that this remains at the speculation phase. In any event, the model I've been thinking about here wouldn't help you because I was only going to collect at function boundaries. Finally, something that would work if one is into patching Lua is to use reference counting. Generally, the overhead isn't worth the trouble, but it might not be in this case since rapid recycling of memory is very useful. There used to be a reference counting patch for Lua, but I don't know whether there is one for 5.1.4. Mark From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 14:25:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77HPtEa012071; Fri, 7 Aug 2009 14:25:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16F71193B2; Fri, 7 Aug 2009 14:25:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from appsserver4.klmicrowave.com (75-145-8-82-Delmarva.hfc.comcastbusiness.net [75.145.8.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F5D51939C for ; Fri, 7 Aug 2009 14:25:05 -0300 (BRT) X-AuditID: ac1000fb-00005344000005dc-fb-4a7c636366a2 Received: from KLMExch.klmicrowave.com ([172.16.2.28]) by appsserver4.klmicrowave.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 13:24:51 -0400 Received: from KLMExch.KLMICROWAVE.COM ([172.16.2.28]) by KLMExch.klmicrowave.com ([172.16.2.28]) with mapi; Fri, 7 Aug 2009 13:24:51 -0400 From: "King, Mike" To: Lua list Date: Fri, 7 Aug 2009 13:24:49 -0400 Subject: RE: Versioning libraries Thread-Topic: Versioning libraries Thread-Index: AcoW3UDmzfRhppOkSaGCampdyLC3YAApoD3Q Message-ID: <85861A744C29EA46BFD9BB61889AE59D3CB17D4253@KLMExch.klmicrowave.com> References: <85861A744C29EA46BFD9BB61889AE59D3CB17D403C@KLMExch.klmicrowave.com> <20090806183118.B14524@lua.tecgraf.puc-rio.br> In-Reply-To: <20090806183118.B14524@lua.tecgraf.puc-rio.br> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n77HPtEa012071 > require already does support versions albeit in an awkward way: > > "Moreover, if the module name has a hyphen, its prefix up to (and > including) the first hyphen is removed. For instance, if the module name > is a.v1-b.c, the function name will be luaopen_b_c." > > http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders Outstanding, you guys have thought of everything! CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message. From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 14:46:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77HkZxq016198; Fri, 7 Aug 2009 14:46:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5875193C0; Fri, 7 Aug 2009 14:46:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hm1479-35.locaweb.com.br (hm1479-35.locaweb.com.br [201.76.49.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC5CE193B0 for ; Fri, 7 Aug 2009 14:45:58 -0300 (BRT) Received: from cl01.mobimail.com (201.76.62.32) by hm1479-38.locaweb.com.br (PowerMTA(TM) v3.5r13) id hfhk5c0nvdcr for ; Fri, 7 Aug 2009 14:45:57 -0300 (envelope-from ) Received: from [200.166.40.172] (account saulot@lemon.com HELO saulot) by hm1836.cl01.mobimail.com (CommuniGate Pro SMTP 5.2.14) with ESMTPA id 27789896; Fri, 07 Aug 2009 14:45:55 -0300 From: "Saulo Tauil" To: "'Javier Guerra'" , References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> In-Reply-To: <200908062359.49573.javier@guerrag.com> Subject: RE: Precompiled multiplatform code (ARMxPC) Date: Fri, 7 Aug 2009 14:52:06 -0300 Message-ID: <020c01ca1787$d5aa6be0$80ff43a0$@com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoXG/QU0z1Gw/RCQu+PonFPFUIIWgAU/65Q Content-Language: pt-br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thank you very much. What if I make changes in Lua to do automatic big/little-endian conversions, some type redefinitions (size_t=>ulong) and disable double operation. Would it be possible? The automatic conversion may slowdown my app, but would bring an invaluable feature. I'm looking for a way to run a lightweight customizable interpreter in several terminals. The compiled script interchangeability would be a very good thing. Does Lua fit to my needs? Some advice? Thank you again, Saulo Tauil -----Original Message----- From: Javier Guerra [mailto:javier@guerrag.com] Sent: sexta-feira, 7 de agosto de 2009 02:00 To: lua@bazar2.conectiva.com.br Cc: Saulo Tauil Subject: Re: Precompiled multiplatform code (ARMxPC) Saulo Tauil wrote: > If it's not possible... Is there a cross-compilation method? I haven't done this, but what i would try is to use qemu. it can emulate a full ARM system, where you can install the very same Lua executable as in your POS, but with much more memory and better connected to your desktop, so filetransfer would be easy. then just compile (and test!) the Lua code there. the bytecode files should be directly usable by your deployed environment. -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 15:03:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77I3bUl020200; Fri, 7 Aug 2009 15:03:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A962193A5; Fri, 7 Aug 2009 15:03:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 071F6193C5 for ; Fri, 7 Aug 2009 15:02:52 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77I2gdx020068; Fri, 7 Aug 2009 15:02:42 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n77I2fN17921; Fri, 7 Aug 2009 15:02:41 -0300 Date: Fri, 7 Aug 2009 15:02:41 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090807150240.A17911@lua.tecgraf.puc-rio.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <020c01ca1787$d5aa6be0$80ff43a0$@com.br>; from saulot@muitofaciltec.com.br on Fri, Aug 07, 2009 at 02:52:06PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm looking for a way to run a lightweight customizable interpreter in > several terminals. The compiled script interchangeability would be a very > good thing. > Does Lua fit to my needs? Most probably. If you have control of the architecture of the terminals then it should be simple to modify lundump.c to cater for those. It's just a lot of work to do it for *all* architectures. If the only difference between architectures is endianness, then it's quite simple: I've posted a modified lundump.c that handles endianness; search the archives. If you have trouble finding it or adapting lundump.c to your needs, please get in touch with me (em portugues mesmo, claro!) --lhf From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 15:25:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77IPqKo024670; Fri, 7 Aug 2009 15:25:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C2DE193FE; Fri, 7 Aug 2009 15:25:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2327193F9 for ; Fri, 7 Aug 2009 15:25:07 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77IP54s024483 for ; Fri, 7 Aug 2009 15:25:05 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n77IP5I17996; Fri, 7 Aug 2009 15:25:05 -0300 Date: Fri, 7 Aug 2009 15:25:04 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: lmathx missing nexttoward in cygwin Message-ID: <20090807152504.A17953@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Tue, Aug 04, 2009 at 09:50:35PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > lmathx [1] fails compilation under Cygwin: Thanks for the report. > +#ifdef HAVE_NEXTTOWARD > static int Lnexttoward(lua_State *L) > { > lua_pushnumber(L,nexttoward(A(1),A(2))); > return 1; > } > +#endif A simpler patch (with less #if) is this: > static int Lnexttoward(lua_State *L) > { > +#ifdef HAVE_NEXTTOWARD > lua_pushnumber(L,nexttoward(A(1),A(2))); > return 1; > +#else > + return 0; > +#endif > } Or even this: #define nexttoward nextafter > BTW, it's not clear to me when nexttoward is useful over nextafter. > Moreover, nexttoward has a signature using "long double", but lmathx > treats double and long double both as a lua_Number. You have a point. I hadn't notice that "The nexttoward() functions do the same as the nextafter() functions, except that they have a long double second argument." as the man page says. nexttoward should have been named nextafterll or something like that... I just wrote a binding based on all functions listed in http://www.dinkumware.com/manuals/default.aspx?manual=compleat&page=math.htm and that page does not contain the man page remark. I wonder whether there are other functions that cater only for long doubles. Anyway, I think I'll just remove nexttoward from lmathx if no one minds. --lhf From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 18:01:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n77L15uM026015; Fri, 7 Aug 2009 18:01:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 619451943E; Fri, 7 Aug 2009 18:00:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81CE01943A for ; Fri, 7 Aug 2009 18:00:26 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so677968wfa.11 for ; Fri, 07 Aug 2009 14:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZoWcx60hhpYVE99ZaF60UCx+KaV6q+VzQ09ItIDPukE=; b=F65xOYeWDUjjneMxzEG4yJW9ACjrYGjFjNa23N5huksfupUQR2X62Ne8/1Vg2QoQJx a5aK4nrwe/LOWOtTz4TQZuR0Bn7DC+i/lAkj3h1kcxyT5/5m78/Z8luWC2W2fy/foUiZ vd1emZByDuaY19DA1SMPYfuJltbQmZBj1Yo/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=GA1QwW/51iODDjpVKV9Mfk0X1PwmaNkIUb/BGanHiXl4K8F9iLskit2boZdyvgwj1V KmlAcx5e45Q4Kre8mE++zWDnpF5jDWpZXu2dkmmBYEtYoSumAu2b3ZoKa3428BiQM5ia UOw6qa7wsW3Uzim9G2gVZotnAV6+xIKDZPCR8= MIME-Version: 1.0 Received: by 10.142.142.19 with SMTP id p19mr335041wfd.158.1249678824626; Fri, 07 Aug 2009 14:00:24 -0700 (PDT) In-Reply-To: <020c01ca1787$d5aa6be0$80ff43a0$@com.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> Date: Fri, 7 Aug 2009 14:00:24 -0700 Message-ID: <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> Subject: Re: Precompiled multiplatform code (ARMxPC) From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 7, 2009 at 10:52 AM, Saulo Tauil wrote: > Thank you very much. > > What if I make changes in Lua to do automatic big/little-endian conversions, > some type redefinitions (size_t=>ulong) and disable double operation. Would > it be possible? > The automatic conversion may slowdown my app, but would bring an invaluable > feature. > > I'm looking for a way to run a lightweight customizable interpreter in > several terminals. The compiled script interchangeability would be a very > good thing. > Does Lua fit to my needs? > Some advice? Its not clear to me, at least, why you are trying to precompile. Your lua on the ARM device has the ability to accept lua code in text form if you are using it as an interpreter. So why do you want to precompile lua to bytecode on your workstation, and then transfer the bytecode to the target ARM device? Uncompiled lua code is the most portable form of a lua program. The standard reason to want to put precompiled code on a device is because the lua core has been hacked to remove the parser/compiler, so it lacks the ability to compile lua itself. Doing this saves code space on embedded devices. This doesn't seem to be your case. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Aug 7 21:45:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n780jnJs017512; Fri, 7 Aug 2009 21:45:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C61211946B; Fri, 7 Aug 2009 21:45:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E168E19456 for ; Fri, 7 Aug 2009 21:45:13 -0300 (BRT) Received: by ewy26 with SMTP id 26so2088395ewy.5 for ; Fri, 07 Aug 2009 17:45:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.10.8 with SMTP id 8mr2112918ebj.82.1249692312484; Fri, 07 Aug 2009 17:45:12 -0700 (PDT) In-Reply-To: <20090807152504.A17953@lua.tecgraf.puc-rio.br> References: <20090807152504.A17953@lua.tecgraf.puc-rio.br> Date: Fri, 7 Aug 2009 20:45:12 -0400 X-Google-Sender-Auth: 1ca46e0dea7c2e92 Message-ID: Subject: Re: lmathx missing nexttoward in cygwin From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n780jnJs017512 On Fri, Aug 7, 2009 at 2:25 PM, Luiz Henrique de Figueiredo wrote: > A simpler patch (with less #if) is this: > >>  static int Lnexttoward(lua_State *L) >>  { >> +#ifdef HAVE_NEXTTOWARD >>    lua_pushnumber(L,nexttoward(A(1),A(2))); >>    return 1; >> +#else >> +  return 0; >> +#endif >>  } > > Or even this: >        #define nexttoward      nextafter > ... > I wonder whether there are other functions that cater only for long doubles. >... > Anyway, I think I'll just remove nexttoward from lmathx if no one minds. I think it's best to remove it rather than have it behave incorrectly (return 0). Then one can test for existence ("if math.nexttoward then") and act accordingly. lmathx appears to not include long double functions by design, though I guess you could "#define cosh coshl" if you were compiling Lua with long doubles. > I just wrote a binding based on all functions listed in > http://www.dinkumware.com/manuals/default.aspx?manual=compleat&page=math.htm (note: above link extension should be ".html") I probably already mentioned before that math.h contains a whole host of interesting additional functions under C++. This may warrant an lmathxx library. A lot of this is also in Boost [1-2]. Getting that build automated under LuaRocks may take some work though--e.g. LuaRocks currently has some issues with C++ [3]. [1] http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/index.html [2] http://www.boost.org/doc/libs/1_35_0/libs/math/doc/html/index.html [3] http://lists.luaforge.net/pipermail/luarocks-developers/2009-July/001113.html From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 00:43:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n783h5Ep002265; Sat, 8 Aug 2009 00:43:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFB6619493; Sat, 8 Aug 2009 00:42:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (outbound.icp-qv1-irony-out4.iinet.net.au [203.59.1.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E85921948C for ; Sat, 8 Aug 2009 00:42:35 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAOaQfErLzkqh/2dsb2JhbACQar5fhBYF X-IronPort-AV: E=Sophos;i="4.43,344,1246809600"; d="scan'208";a="451130245" Received: from unknown (HELO Mania) ([203.206.74.161]) by outbound.icp-qv1-irony-out4.iinet.net.au with SMTP; 08 Aug 2009 11:42:29 +0800 Message-ID: <00530750997A40B1B4FB24C937A50C5E@Mania> From: "Alex Davies" To: "Lua list" References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> In-Reply-To: <20090807152339.GA6283@mike.de> Subject: Re: LuaJIT performance Date: Sat, 8 Aug 2009 11:42:20 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Not suprisingly, Lua and LuaJIT still have the lead on numeric > benchmarks (unboxed floating point numbers pay off here). And > LuaJIT 2.x will completely change the game (sorry, still no ETA). Those times for LuaJIT 2.x are simply mindboggling. A JIT compiler beating GCC in more then one standardised/non hand-picked tests? Also made me smile to hear it's still being worked on, has been quiet for a while now. Excited would be an understatement... - Alex From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 08:35:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n78BZPtF006787; Sat, 8 Aug 2009 08:35:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3C8C1951B; Sat, 8 Aug 2009 08:35:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from igate.falcom.de (igate.falcom.de [195.145.229.203]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E788D194B7 for ; Sat, 8 Aug 2009 08:34:53 -0300 (BRT) Received: from igate.falcom.de (igate.falcom.de [195.145.229.203]) by igate.falcom.de (8.13.8/8.13.4/Submit) with ESMTP id n78BYpQr006337 for ; Sat, 8 Aug 2009 13:34:51 +0200 Received: from mail.falcom.de (mail.falcom.de [195.145.229.205]) by igate.falcom.de (8.13.8/8.13.8/Submit) with ESMTP id n78BYmO6006334 for ; Sat, 8 Aug 2009 13:34:50 +0200 Received: from [192.168.178.47] (p5B28450C.dip0.t-ipconnect.de [91.40.69.12]) (authenticated bits=0) by mail.falcom.de (8.13.8/8.13.8/Debian-3) with ESMTP id n78BYk4H020898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 8 Aug 2009 13:34:48 +0200 Message-ID: <4A7D62D1.4080302@falcom.de> Date: Sat, 08 Aug 2009 13:34:41 +0200 From: Michael Bauroth User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT performance References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> In-Reply-To: <00530750997A40B1B4FB24C937A50C5E@Mania> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-Product-Ver: : ISVW-6.0.0.2339-5.6.0.1016-16812002 X-TM-AS-Result: : No X-TM-AS-Category-Info: : 31:0.000000 X-TM-AS-MatchedID: : =?us-ascii?B?MTQ1MDAyLTE1MDU2Ny03MDk1?= =?us-ascii?B?ODQtMTg4MDE5LTEzOTAxMC03MDAwNzUtODQyMDM0LTcwNTkwMS0x?= =?us-ascii?B?MDU3MDAtNzAxMjM2LTcwMTc3My03MDA5NDktNzAyMTEzLTcwMzA2?= =?us-ascii?B?MS03MDE0MDctNzA0NzQ4LTcwMTYxOC03MDkwNTAtMTQ4MDM5LTE0?= =?us-ascii?B?ODA1MQ==?= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Does there exist eventually an ARM port? Would be great to hear ... Best Regards Michael Alex Davies schrieb: > Mike Pall wrote: >> Not suprisingly, Lua and LuaJIT still have the lead on numeric >> benchmarks (unboxed floating point numbers pay off here). And >> LuaJIT 2.x will completely change the game (sorry, still no ETA). > > Those times for LuaJIT 2.x are simply mindboggling. A JIT compiler > beating GCC in more then one standardised/non hand-picked tests? Also > made me smile to hear it's still being worked on, has been quiet for a > while now. Excited would be an understatement... > > - Alex From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 11:52:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n78Eqrgs023401; Sat, 8 Aug 2009 11:52:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DDFD1953F; Sat, 8 Aug 2009 11:52:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD1EA1953B for ; Sat, 8 Aug 2009 11:52:18 -0300 (BRT) Received: by gxk18 with SMTP id 18so2640599gxk.5 for ; Sat, 08 Aug 2009 07:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=YAJIkKO7Iz7mGZYc6Ih6F0T/8zDeXgy5yjdBwe2LOOQ=; b=XyGt+gKZjc7o5xOo59Yj4shPKuh8tytm3J9wQ0TiOxvOSr9iJ79D9Tj4FnWLfOqRYh tzRTLWDnMqWImcO9DkEvtTJUNq2Dl7E4wHKhUPtTnNXPeXDHavXD4tj1s8E1glG6Ski0 Y/CeP6by3l6sYO1SBHKqRsIMuk4miktIsqfq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=tp5xR2GYv1A5lJvKTncqFUf1kY1WLZrv7GxWM0gBKERdn3TuyOcRinQWV0aFrgGHBq UeNlw2Ty5jZU2qkg32RmqnZ93yIVJ00+q7SpMhMZHgXaPGJLLf1ewgu6CurJkETBN1eK w+nAibzhgb9/ubdZLycHrxv4Qk8tLky8Me45E= MIME-Version: 1.0 Received: by 10.150.189.9 with SMTP id m9mr1596521ybf.342.1249743137118; Sat, 08 Aug 2009 07:52:17 -0700 (PDT) In-Reply-To: <4A7D62D1.4080302@falcom.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> From: RJP Computing Date: Sat, 8 Aug 2009 10:51:57 -0400 X-Google-Sender-Auth: 20a2c0c2fa41f371 Message-ID: Subject: Re: LuaJIT performance To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n78Eqrgs023401 On Sat, Aug 8, 2009 at 7:34 AM, Michael Bauroth wrote: > Does there exist eventually an ARM port? Would be great to hear ... > > Best Regards > Michael > > Alex Davies schrieb: >> >> Mike Pall wrote: >>> >>> Not suprisingly, Lua and LuaJIT still have the lead on numeric >>> benchmarks (unboxed floating point numbers pay off here). And >>> LuaJIT 2.x will completely change the game (sorry, still no ETA). >> >> Those times for LuaJIT 2.x are simply mindboggling.  A JIT compiler >> beating GCC in more then one standardised/non hand-picked tests?  Also made >> me smile to hear it's still being worked on, has been quiet for a while now. >>  Excited would be an understatement... Is there a 64bit version coming when version 2 is done? That would be so great!!! -- Regards, Ryan From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 16:50:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n78JoIh7015860; Sat, 8 Aug 2009 16:50:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89C0218B9F; Sat, 8 Aug 2009 16:49:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5409118838 for ; Sat, 8 Aug 2009 16:49:39 -0300 (BRT) Received: by yxe5 with SMTP id 5so2884303yxe.33 for ; Sat, 08 Aug 2009 12:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=/T07f1+pl9c0con4OuhFDWfE/iVrB0DO/G6UKUTQ1k0=; b=qJL3YFLAfbQFIyly2+lB3tcVlKKluJuaHiO2fQn4AmaqwbF9M3TTI1tJtTWcWiYFqq zCyqhCLCizXZt6yrX9YS/9kKaafCzU5cyETmzKQ0tXso84t77nPhd4uzQepfv+i4Lr/T AmV9dntFZyTt40dofsW1DLdbTfzXCPUvUOubY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=GGeo6k10SyGjTOO9uD1EwciflA0DiBksSvsPn50VpAV4UFweqN006QKjTeK0gfe0aY UHVOq/PXYNGKCHoS7G2nfVwIo8kQSZwFLO6x6A1b5ePuKWb/mRSuX56AO+pheISO39DQ 4/rxr4mH9doOxscJu/Lbpw+m1XuO3i2X94mIo= MIME-Version: 1.0 Received: by 10.150.146.18 with SMTP id t18mr5039809ybd.211.1249760977517; Sat, 08 Aug 2009 12:49:37 -0700 (PDT) Date: Sat, 8 Aug 2009 15:49:37 -0400 Message-ID: <2984a1fb0908081249q659db5d5g40c5e500501072ae@mail.gmail.com> Subject: pcall() in chdk lua From: Matt Kime To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm using lua on chdk which runs on a Canon Powershot a650IS, a point and shoot camera. I'm trying to use pcall() in order to trap errors I'm unable to eliminate in my scripts. more specifically, there are a couple of chdk native functions (press("half_shoot"), release("half_shoot"))which very occasionally fail. (1% to 0.1% of the time) unfortunately calling these functions through pcall results in the following error message - attempt to yield across metamethod / c-call boundary any advice on how to resolve this? I realize that chdk lua specific issues may be at fault but any ideas or suggestions on how to fix or work around this are greatly appreciated. --matt From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 17:02:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n78K2eDL016810; Sat, 8 Aug 2009 17:02:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC94A18B55; Sat, 8 Aug 2009 17:02:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kirsi2.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF5B618A93 for ; Sat, 8 Aug 2009 17:02:14 -0300 (BRT) Received: from [93.106.63.114] (93.106.63.114) by kirsi2.inet.fi (8.5.014) id 4A77692A002962BA for lua@bazar2.conectiva.com.br; Sat, 8 Aug 2009 23:02:13 +0300 Message-Id: <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: LuaJIT performance Date: Sat, 8 Aug 2009 22:55:20 +0300 References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n78K2eDL016810 Lähetetty iPhonesta RJP Computing kirjoitti 8.8.2009 kello 17.51: > On Sat, Aug 8, 2009 at 7:34 AM, Michael > Bauroth wrote: >> Does there exist eventually an ARM port? Would be great to hear ... >> >> Best Regards >> Michael >> >> Alex Davies schrieb: >>> >>> Mike Pall wrote: >>>> >>>> Not suprisingly, Lua and LuaJIT still have the lead on numeric >>>> benchmarks (unboxed floating point numbers pay off here). And >>>> LuaJIT 2.x will completely change the game (sorry, still no ETA). >>> >>> Those times for LuaJIT 2.x are simply mindboggling. A JIT compiler >>> beating GCC in more then one standardised/non hand-picked tests? >>> Also made >>> me smile to hear it's still being worked on, has been quiet for a >>> while now. >>> Excited would be an understatement... > > Is there a 64bit version coming when version 2 is done? That would be > so great! My customer also would be interested in a x64 LuaJIT. Maybe we can come up with some company sponsorship for Mike on this? He'd sure deserved some!! -Asko > -- > Regards, > Ryan From lua-bounces@bazar2.conectiva.com.br Sat Aug 8 20:15:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n78NFIB2031322; Sat, 8 Aug 2009 20:15:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C38B218BAB; Sat, 8 Aug 2009 20:14:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.211.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F075E18B2B for ; Sat, 8 Aug 2009 20:14:44 -0300 (BRT) Received: by ywh32 with SMTP id 32so3168889ywh.11 for ; Sat, 08 Aug 2009 16:14:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.15.194 with SMTP id l2mr1104283iba.25.1249773282805; Sat, 08 Aug 2009 16:14:42 -0700 (PDT) In-Reply-To: <2984a1fb0908081249q659db5d5g40c5e500501072ae@mail.gmail.com> References: <2984a1fb0908081249q659db5d5g40c5e500501072ae@mail.gmail.com> Date: Sat, 8 Aug 2009 16:14:42 -0700 Message-ID: <790db3550908081614x557f5a80t9d0459b2948bde04@mail.gmail.com> Subject: Re: pcall() in chdk lua From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Aug 8, 2009 at 12:49 PM, Matt Kime wrote: > I'm using lua on chdk which runs on a Canon Powershot a650IS, a point > and shoot camera. I'm trying to use pcall() in order to trap errors > I'm unable to eliminate in my scripts. more specifically, there are a > couple of chdk native functions (press("half_shoot"), > release("half_shoot"))which very occasionally fail. (1% to 0.1% of the > time) unfortunately calling these functions through pcall results in > the following error message - > > attempt to yield across metamethod / c-call boundary > > any advice on how to resolve this? > > I realize that chdk lua specific issues may be at fault but any ideas > or suggestions on how to fix or work around this are greatly > appreciated. This sounds like a problem Nmap had itself. We yield the current script whenever it performs a socket operation. This unfortunately makes it very difficult for the script to catch errors because you can't yield across a pcall. There is an alternative to pcall: one can use a coroutine to run code protected. The issue is propagating a yield back to the system as it was intended. I recently added a patch to Nmap that hooks coroutine.resume and coroutine.wrap to propagate Nmap initiated yields back to Nmap through all the script's coroutines. When Nmap again resumes the script, the resume goes back up the chain of coroutines. If your platform is willing to make a similar patch, its users can use coroutine.resume to make protected calls while keeping the system yields working properly. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 09:56:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79CuGFl007022; Sun, 9 Aug 2009 09:56:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BB4418904; Sun, 9 Aug 2009 09:55:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26113188DB for ; Sun, 9 Aug 2009 09:55:43 -0300 (BRT) Received: by fxm25 with SMTP id 25so2348762fxm.5 for ; Sun, 09 Aug 2009 05:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fLHQNyEyXYwkpycSLdYGfo6KTWAlfHyDpejMHl606I4=; b=ETFezShQSKyLof+WG4p5u/3k2Qb2YzuXOF+5ez/NNN5Leg5+PNrMK7nWSxfrphQ7qu rVePbeQXClHEmj63vn1UKr/jq+oq2j1evUpBaRoY5YJroRfu+JDeo8TNFI46oKR5AP2U TrUY/F444QT+vTC01AOAzD9y6y0I8yWMczRss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=BOkrLZrUhlZ8NxD4jlZsoy013dk7Q5kc99U4+VDp8sNxI+VgVVCgfP1Udvp/63iXOX xlC2F7CfMe/TwZIivb1CFVSfsX1kwd8hDkeqSvG4XIjhj4+suSWJWTm9NGApDnLJsf2T WZE81aiTN0MFiHoe5eQnjxwkHqUc0FFBUzz4Y= MIME-Version: 1.0 Received: by 10.223.111.82 with SMTP id r18mr667795fap.83.1249822541790; Sun, 09 Aug 2009 05:55:41 -0700 (PDT) In-Reply-To: <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> Date: Sun, 9 Aug 2009 16:55:41 +0400 Message-ID: Subject: Re: LuaJIT performance From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> Is there a 64bit version coming when version 2 is done? That would be >> so great! > My customer also would be interested in a x64 LuaJIT. Maybe we can come up > with some company sponsorship for Mike on this? He'd sure deserved some!! Actually, there is a chance our company would be able to participate in such sponsorship as well. We'd love to use 64bit LuaJIT 2 in our products! Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 12:05:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79F4uEI016839; Sun, 9 Aug 2009 12:04:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F03E1892B; Sun, 9 Aug 2009 12:04:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBDC7188E9 for ; Sun, 9 Aug 2009 12:04:22 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Ma9wZ-0001Q2-00; Sun, 09 Aug 2009 17:04:19 +0200 Date: Sun, 9 Aug 2009 17:03:22 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090809150322.GA14154@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean RJP Computing wrote: > Is there a 64bit version coming when version 2 is done? The goal is to release the x86 version and stabilize it a bit before starting the x64 port. Most of the LJ2 VM is already "64 bit ready". E.g. it has an arch-independent 32 bit pointer abstraction for all GC objects. This keeps tagged values at 8 bytes on all platforms. But several major areas need more work: porting DynASM to x64, porting the interpreter (which is 100% x86 assembler), dealing with the different x64 calling conventions (WIN64 is different than the rest of the world) and a couple more open issues. Michael Bauroth wrote: > Does there exist eventually an ARM port? Given the market share and the estimated demand, that's most likely the next port after the x64 port. But it's much more complicated, since there is no uniform ARM platform. The choice of the number type for Lua is the main difficulty. Using double-precision floating-point numbers is one option. But it needs really fast FP arithmetics (x86/x64 provides that). Unfortunately most older ARM devices have no FPU at all and NEON doesn't do double precision FP. And about VFP ... well, some vendors like to hide the fact that most of their gadgets only contain something called "VFPlite". The high latencies and the low throughput makes softfp suddenly look like an attractive option. Another option is to use 32 bit integers only. Certainly easier to implement, but I'm not so sure everyone would be happy with it. I've also considered using 32.31 fixed-point numbers. Yes, it's a bit of an awkward choice. But you'd get fractional numbers at the speed of integer arithmetics. Again, I'm not sure about the needs of developers who'd like to have LJ2 ported to ARM. [Note that support for multiple number types per platform is not an option. A JIT compiler needs to emit very different instruction sequences for each number type. Switching number types is not as easy as changing a couple of C macros.] --Mike From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 12:06:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79F60l9017006; Sun, 9 Aug 2009 12:06:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F2AF1894D; Sun, 9 Aug 2009 12:05:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5539188E9 for ; Sun, 9 Aug 2009 12:05:37 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Ma9xo-0001QU-00; Sun, 09 Aug 2009 17:05:36 +0200 Date: Sun, 9 Aug 2009 17:04:58 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090809150458.GA15804@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > >> Is there a 64bit version coming when version 2 is done? That would be > >> so great! > > > My customer also would be interested in a x64 LuaJIT. Maybe we can come up > > with some company sponsorship for Mike on this? He'd sure deserved some!! > > Actually, there is a chance our company would be able to participate > in such sponsorship as well. > > We'd love to use 64bit LuaJIT 2 in our products! Sure, I can put up a proposal for a sponsorship program for the x64 port (*after* the x86 release of course). Since I'm an independent consultant, you'll get a proper bill/invoice/tax receipt or whatever it's called in your country. Companies should be able to deduct the expenses. But before going to the effort, I'd like to know a rough estimate what your respective companies might be willing to spend on this. You can email me privately about this and any amounts are of course not binding (yet). Depending on the outcome I may go for it. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 13:19:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79GJDeX023671; Sun, 9 Aug 2009 13:19:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05BA61896F; Sun, 9 Aug 2009 13:18:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF453188EF for ; Sun, 9 Aug 2009 13:18:40 -0300 (BRT) Received: by fxm25 with SMTP id 25so2410404fxm.5 for ; Sun, 09 Aug 2009 09:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lpuTL4kLRZnGauSMN5Rbjduw5YReJSsPy4qvfPIWLTI=; b=Mog9rnrRfswyijheVvbKKab5xrcUCF2bVcCcEJY4wpCRMKLXBH613uXEeHr/FDp6Vp UxiyqYz6Hnvwe3MY3Gpj4gdIMik55jC9Z/1OOm90z+UrSX+Nu1K/mUTuUILrDhs6Oa7a va/aG2qZTl4XVAGFKroLSrN7gplyeM46l0IBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=po1o+TBUr+kp2yNTrKugFzHteUTgUbpEFA9hEDhSJKCf2bXbeR3hNnCRC3DhTyY1fy bBp3FYMlJ/z5mIeFFnND6pALriyPA0EAXNFxWCYHLSIAYr6ZLTeAuw4FpbH8xx8Whonb Jr47voNfMUkUMXA2p1cj/9+TtsEsjmru/VKuE= MIME-Version: 1.0 Received: by 10.223.107.210 with SMTP id c18mr59348fap.54.1249834718887; Sun, 09 Aug 2009 09:18:38 -0700 (PDT) In-Reply-To: <20090809150322.GA14154@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> Date: Sun, 9 Aug 2009 20:18:38 +0400 Message-ID: Subject: Re: LuaJIT performance From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Michael Bauroth wrote: >> Does there exist eventually an ARM port? > Given the market share and the estimated demand, that's most > likely the next port after the x64 port. But it's much more > complicated, since there is no uniform ARM platform. The choice of > the number type for Lua is the main difficulty. <...> I, personally, am interested in LJ2 for iPhone (which is ARM-based). As I intend to reuse existing (x86) game logic code on it, I would need floating point support. Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 13:26:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79GQ8wQ024171; Sun, 9 Aug 2009 13:26:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E084189C4; Sun, 9 Aug 2009 13:25:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 217AF1891C for ; Sun, 9 Aug 2009 13:25:43 -0300 (BRT) Received: by fxm25 with SMTP id 25so2412353fxm.5 for ; Sun, 09 Aug 2009 09:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xa+iMIrpt0FVN6jVApJeeCHtJ0HVSXbIHLSanneVdk0=; b=pTmuiLitGX3bIMA+NRo+ge8hb7HuH8bKcWNXTVJZS/c7+GRBokY7P3fLzG/GgWKpCV 8wFu/WUYS6hpH4O9beqAlgwJlzes0T+JS4wpuLKhjdxCrF0KqveCXRUoY5jVxND2vIpB ACHg4KR6Ycl+JeO+tykfa+C3hv8uCBLtioVIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jsxNQOzGv3qNnZCyh0eYxpi9Aor/NeMWsLoOSNiGKpwtfRBSoBzErNlEwnXGkXyMQu lCvC08hlQGUKvzmy6PDepI5gH1ByUsOPjOxcJZuOyh69eyRwMb7nJROBcz06SRwFaa9f PLEDrlfIUGkBKvM4OevdExFWlK31Kr0yzeFek= MIME-Version: 1.0 Received: by 10.223.127.4 with SMTP id e4mr648499fas.100.1249835142728; Sun, 09 Aug 2009 09:25:42 -0700 (PDT) In-Reply-To: <20090809150458.GA15804@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> Date: Sun, 9 Aug 2009 20:25:42 +0400 Message-ID: Subject: Re: LuaJIT performance From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> We'd love to use 64bit LuaJIT 2 in our products! > Sure, I can put up a proposal for a sponsorship program for the x64 > port (*after* the x86 release of course). Since I'm an independent > consultant, you'll get a proper bill/invoice/tax receipt or > whatever it's called in your country. Companies should be able to > deduct the expenses. > But before going to the effort, I'd like to know a rough estimate > what your respective companies might be willing to spend on this. > You can email me privately about this and any amounts are of > course not binding (yet). Depending on the outcome I may go for it. Cool! But it looks like we'd need to sponsor x86 release first! :-) You've said there is no ETA yet for x86, but, perhaps, you may share some information on the amount of work left to do? Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 13:47:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79Glnj5025843; Sun, 9 Aug 2009 13:47:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B735F18994; Sun, 9 Aug 2009 13:47:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD10A188EF for ; Sun, 9 Aug 2009 13:47:24 -0300 (BRT) Received: from papaya.tek (dslb-088-072-020-054.pools.arcor-ip.net [88.72.20.54]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id 348D23A89F for ; Sun, 9 Aug 2009 18:47:23 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id EF6D51B681 for ; Sun, 9 Aug 2009 18:47:21 +0200 (CEST) Date: Sun, 9 Aug 2009 18:47:21 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: LuaJIT performance Message-Id: <20090809184721.d1f829a7.tmueller@schulze-mueller.de> In-Reply-To: <20090809150322.GA14154@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 9 Aug 2009 17:03:22 +0200 Mike Pall wrote: > Another option is to use 32 bit integers only. Certainly easier to > implement, but I'm not so sure everyone would be happy with it. Just for the record: a port of LuaJIT to ARM would be very welcome, and I'd be perfectly happy with a 32 bit numerical datatype on this architecture. - Timm -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 15:10:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79IACGW031940; Sun, 9 Aug 2009 15:10:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6717C18A1B; Sun, 9 Aug 2009 15:09:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E126189F6 for ; Sun, 9 Aug 2009 15:09:37 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so653490eyd.11 for ; Sun, 09 Aug 2009 11:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=po2szaT1XmMKRcmW8z5J6n181kx3UKjTpN8CaA0U9Jo=; b=IHwrkJXb0Ul9ACjYXr8mSRrsqkzMmKk1/zAvVpkyuIiMm2xgYQw2bODoWUgi2DN1PP FGYkDmaUlK3lhdYP5zCTzEQSwfeKOUmQ41I+lQxf78FVIepzlEOBtrVTjsgwEjkz/G0r 8YXYKrtM/vT0Aa/79HruG3ehqM1uX1FVy0CfI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=aYGlx4eQbmvuBebb6Xt+ryAQak6CY9b7fP5q3Jmv8bc6iOPQQztgltHkX4uFeX334g Ow7QsVFDon3HXSTGBVBqVK1ku6Y7TFc9uH5YKaMu6IcNMuw8kJoGe1EQ+JaQD5fJMa5n N+BIf0XDj9h60maJu5445H9TWfybisla1TJsw= MIME-Version: 1.0 Received: by 10.216.28.207 with SMTP id g57mr717482wea.163.1249841375181; Sun, 09 Aug 2009 11:09:35 -0700 (PDT) In-Reply-To: <20090809150322.GA14154@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> Date: Sun, 9 Aug 2009 21:09:35 +0300 Message-ID: Subject: Re: LuaJIT performance From: Ivan-Assen Ivanov To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Another option is to use 32 bit integers only. Certainly easier to > implement, but I'm not so sure everyone would be happy with it. If you go this way eventually, please backport to x86. We use stock Lua with 32-bit integers on x86 and PowerPC (Xbox 360) for very peculiar reasons (synchronicity of calculations across the network) and are generally happy with it. I was unpleasantly surprised when I learned there's no support for that in LuaJIT 1.x. Best regards, Assen From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 16:54:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79JsOAM006889; Sun, 9 Aug 2009 16:54:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2924189F8; Sun, 9 Aug 2009 16:53:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C256E188A4 for ; Sun, 9 Aug 2009 16:53:48 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n79JrkD4006817 for ; Sun, 9 Aug 2009 16:53:46 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n79JrkXd006814 for lua@bazar2.conectiva.com.br; Sun, 9 Aug 2009 16:53:46 -0300 Date: Sun, 9 Aug 2009 16:53:46 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: lmathx missing nexttoward in cygwin Message-ID: <20090809195346.GA6716@duchamp.tecgraf.puc-rio.br> References: <20090807152504.A17953@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090807152504.A17953@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Anyway, I think I'll just remove nexttoward from lmathx if no one minds. Done. From http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/release.txt : Name Last update Size MD5 digest 5.1/lmathx.tar.gz 2009-08-08 2997 e3e43b0f66511a59e635e0eaff33926c Thanks for the report. --lhf From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 21:59:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A0xKE3029307; Sun, 9 Aug 2009 21:59:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9379A188AE; Sun, 9 Aug 2009 21:58:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2F2118850 for ; Sun, 9 Aug 2009 21:58:43 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaJDj-0005te-00; Mon, 10 Aug 2009 02:58:39 +0200 Date: Mon, 10 Aug 2009 02:36:43 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810003643.GA17119@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > I, personally, am interested in LJ2 for iPhone (which is ARM-based). > As I intend to reuse existing (x86) game logic code on it, I would > need floating point support. Ok, but you may be in for a nasty surprise: the 3GS has an ARM Cortex-A8 CPU which only has VFPlite. This is actually a step back from the previous models which had an ARM 1176JZ(F)-S with a full VFP unit. And since the vector mode of VFP is officially deprecated, you're in for more surprises in the future. Not to squash your hopes, but I suggest you try to measure whether the iPhone FP performance can keep up with your requirements. Maybe try some simple double-precision FP benchmarks in C (don't compile as Thumb code or you get softfp). Timm S. Mueller wrote: > Just for the record: a port of LuaJIT to ARM would be very welcome, and > I'd be perfectly happy with a 32 bit numerical datatype on this > architecture. Umm, so one probably needs at least two different VMs for ARM (FP vs. int-only). Then combine this with the options for ARM vs. Thumb vs. Thumb2 code and with ARMv4-ARMv7 support and soon we'll have an exponential number of targets to support ... *sigh* Thank you to both of you for the quick feedback! --Mike From lua-bounces@bazar2.conectiva.com.br Sun Aug 9 22:34:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A1XsBJ031823; Sun, 9 Aug 2009 22:33:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF84618A27; Sun, 9 Aug 2009 22:33:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 754B0188E9 for ; Sun, 9 Aug 2009 22:33:23 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaJlH-0005vV-00; Mon, 10 Aug 2009 03:33:19 +0200 Date: Mon, 10 Aug 2009 03:33:07 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810013307.GA18673@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > You've said there is no ETA yet for x86, but, perhaps, you may share > some information on the amount of work left to do? Well, I'm already cutting corners everywhere wrt. features for the first alpha. But issues with correctness and completeness keep me busy (the coordination between the JIT code and the GC is currently a minefield). And the code needs to be cleaned up a lot before it's ready for public consumption. Then I'll need to work on the packaging, the docs, the web site reorganization and so on ... Thankfully I've recently removed the last major stumbling block (better trace linking) and the benchmark results demonstrate that going for a trace compiler was a sound design decision after all. But I have to say it was an expensive decision: I've considerably underestimated the amount of research and trial-and-error which was needed to convert a research toy into a production compiler. There are some important implementation details which the few papers about trace compilers completely fail to mention ... :-| --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 03:01:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A61a76021100; Mon, 10 Aug 2009 03:01:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A87AC18B6D; Mon, 10 Aug 2009 03:01:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D33D18925 for ; Mon, 10 Aug 2009 03:01:01 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MaNwG-0008BI-GQ for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 06:00:56 +0000 Received: from c-71-231-140-251.hsd1.wa.comcast.net ([71.231.140.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 06:00:56 +0000 Received: from joshua by c-71-231-140-251.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 06:00:56 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 06:00:46 +0000 (UTC) Lines: 31 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.231.140.251 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm writing a Lua extension that exposes container-like objects. I can go into the full specifics of what my extension does if you like, but for the question I'm posing, I think it will be enough to say that my extension will create userdata objects that have references to other Lua objects. My question is how to make GC work properly, but also efficiently. Unlike Ruby and Python, Lua does not (from what I can see) let userdata objects define their own "mark" function. This means that all objects that are reachable only through my container will get collected unless I do something to prevent that. Unfortunately my options don't look very good. The only real option I can see is: for each of my container objects, create a Lua table that always contains all of the other Lua objects that this container references. Then put this table in the registry. This will work (I think), but it's quite inefficient in both space and time: 1. It's inefficient in space, because I'm creating all these redundant tables. They are redundant because they contain information that I already have stored in another form, and can recreate at will very efficiently. 2. It's inefficient in time, because I'm paying the cost to keep all these tables up to date (malloc(), table resizes, not to mention the cache effects). So I guess I'm wondering: is there any reason why Lua doesn't let userdata have a custom mark function? It would allow me to implement my extension much more efficiently. Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 03:43:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A6hCNa023789; Mon, 10 Aug 2009 03:43:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DA1B18C24; Mon, 10 Aug 2009 03:42:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EC0918A25 for ; Mon, 10 Aug 2009 03:42:41 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEEANtdf0rLzkqh/2dsb2JhbACQb7wShBgFgjY X-IronPort-AV: E=Sophos;i="4.43,352,1246809600"; d="scan'208";a="548999884" Received: from unknown (HELO Mania) ([203.206.74.161]) by outbound.icp-qv1-irony-out2.iinet.net.au with SMTP; 10 Aug 2009 14:42:36 +0800 Message-ID: <6E9D2A887A21460DA3EF843422AFE7FF@Mania> From: "Alex Davies" To: "Lua list" References: In-Reply-To: Subject: Re: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 14:42:17 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I had the same problem when I was just starting out, as it isn't obvious in the documentation but Lua allows a table to be associated with a userdata and marks it appropriately. So all circularly references are handled correctly, something that's hard to do via the registry. Quick example: lua_newuserdata(L, 0); lua_newtable(L); lua_pushvalue(L, -1); lua_setfenv(L, -3); After this script the table at the top of the stack is associated with the userdata below it (and can be retrieved by lua_getfenv). Hope this helps :) - Alex From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 04:19:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A7JjUl027765; Mon, 10 Aug 2009 04:19:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54C46189C3; Mon, 10 Aug 2009 04:19:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B37CB187A1 for ; Mon, 10 Aug 2009 04:19:11 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MaP9t-0002Jd-Vw for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 07:19:06 +0000 Received: from 216-239-45-4.google.com ([216.239.45.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 07:19:05 +0000 Received: from joshua by 216-239-45-4.google.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 07:19:05 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 07:18:53 +0000 (UTC) Lines: 20 Message-ID: References: <6E9D2A887A21460DA3EF843422AFE7FF@Mania> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 216.239.45.4 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alex Davies iinet.net.au> writes: > > I had the same problem when I was just starting out, as it isn't obvious in > the documentation but Lua allows a table to be associated with a userdata > and marks it appropriately. So all circularly references are handled > correctly, something that's hard to do via the registry. > > Quick example: > lua_newuserdata(L, 0); > lua_newtable(L); > lua_pushvalue(L, -1); > lua_setfenv(L, -3); Thanks for the info Alex! It's true that this is better than putting stuff in the registry. I would still prefer to avoid having to construct this per-userdata table at all, but this at least makes it a little more tolerable. Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 05:07:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A87eZ9031675; Mon, 10 Aug 2009 05:07:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B274C18CA2; Mon, 10 Aug 2009 05:07:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3760318C89 for ; Mon, 10 Aug 2009 05:07:06 -0300 (BRT) Received: from papaya.tek (dslb-088-075-210-193.pools.arcor-ip.net [88.75.210.193]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id EEE2C3A89F for ; Mon, 10 Aug 2009 10:07:04 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id DD7C417587 for ; Mon, 10 Aug 2009 10:07:03 +0200 (CEST) Date: Mon, 10 Aug 2009 10:07:03 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: LuaJIT performance Message-Id: <20090810100703.f7b80c78.tmueller@schulze-mueller.de> In-Reply-To: <20090810003643.GA17119@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009 02:36:43 +0200 Mike Pall wrote: > > Just for the record: a port of LuaJIT to ARM would be very welcome, and > > I'd be perfectly happy with a 32 bit numerical datatype on this > > architecture. > > Umm, so one probably needs at least two different VMs for ARM (FP > vs. int-only). Then combine this with the options for ARM vs. > Thumb vs. Thumb2 code and with ARMv4-ARMv7 support and soon we'll > have an exponential number of targets to support ... *sigh* Please make a sensible decision, the sky isn't falling over if I'm not getting LuaJIT/ARM for free. My deployment needs are in the no-FPU, no-2nd-level-cache, ~200MHz range. That's where throughput for user interfaces is scarce and desperately needed. But Lua is up to the task. I have designed my libraries to work with integer (using fixpoint arithmetics in places), so that I can use them in these contexts, and ARM-7 is an architecture I am frequently concerned with. - Timm -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 05:32:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A8W8Nk000854; Mon, 10 Aug 2009 05:32:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A27518CCD; Mon, 10 Aug 2009 05:31:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E600518C79 for ; Mon, 10 Aug 2009 05:31:42 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MaQHy-00005c-NX for ; Mon, 10 Aug 2009 09:31:30 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MaQI6-0002pA-6l for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 09:31:38 +0100 Date: Mon, 10 Aug 2009 09:31:37 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: LuaJIT performance Message-ID: <20090810093137.602509b6@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090810003643.GA17119@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009 02:36:43 +0200 Mike Pall wrote: > Umm, so one probably needs at least two different VMs for ARM (FP > vs. int-only). Then combine this with the options for ARM vs. > Thumb vs. Thumb2 code and with ARMv4-ARMv7 support and soon we'll > have an exponential number of targets to support ... *sigh* Ignore Thumb; I'm not sure anybody would want to run LuaJIT on a Thumb-only device (like a Cortex M3). ARM's hardware FP has always left something to be desired, so a combined approach like Asko's integer patch might be a solution. And for the most part (excluding floating point), it should be quite easy to produce code that will run on both ARMv3 and 4 and ARMv7. B. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 05:43:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7A8hSuI001587; Mon, 10 Aug 2009 05:43:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72E5918CF4; Mon, 10 Aug 2009 05:43:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6050A18CDD for ; Mon, 10 Aug 2009 05:42:57 -0300 (BRT) Received: by ewy26 with SMTP id 26so3034394ewy.5 for ; Mon, 10 Aug 2009 01:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uN5Mh+99wQcpoEjTTFGUHKKhKlSLfLfXGMJZGRmqUco=; b=YI6Njg9zZay084plTStUqIS9IC/n+FEYVSKppBQVhZCfXFoN9saEIieIspPnbE0ISu jKLdkenoCInUeS9X7g9uZyhS63hY7LF/RJco0yrmEQIlA1ZFCaxFnvk+GHd/qf8KUMHt bIsRNHBv53BUg3EF/SsoOe0GcrMYs1xXsV3/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KrzZ0LN6wO1RV8zK/Mxm7TOhC85JGtlxwcRxu9x2Iq+FCbasHZZmLuQkrE08paTpH5 jlIcltOiE57JzWcs0WeqmK04L89V0amveGP4foQkYahElAVvAdXwS4Zg3CjP+m+QNy1n uvSFrQxDKNLWZwB4aZtNX3oYTa47o4PiA9/l0= MIME-Version: 1.0 Received: by 10.216.47.71 with SMTP id s49mr865111web.129.1249893775202; Mon, 10 Aug 2009 01:42:55 -0700 (PDT) In-Reply-To: <20090809150322.GA14154@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> Date: Mon, 10 Aug 2009 10:42:55 +0200 Message-ID: <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> Subject: Re: LuaJIT performance From: Dirk Feytons To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Aug 9, 2009 at 5:03 PM, Mike Pall wrote: [...] > Michael Bauroth wrote: >> Does there exist eventually an ARM port? > > Given the market share and the estimated demand, that's most > likely the next port after the x64 port. But it's much more > complicated, since there is no uniform ARM platform. The choice of > the number type for Lua is the main difficulty. > [...] Am I the only one who would be interested in a MIPS port? :) > Another option is to use 32 bit integers only. Certainly easier to > implement, but I'm not so sure everyone would be happy with it. > > I've also considered using 32.31 fixed-point numbers. Yes, it's a > bit of an awkward choice. But you'd get fractional numbers at the > speed of integer arithmetics. Again, I'm not sure about the needs > of developers who'd like to have LJ2 ported to ARM. In my experience, Lua with a 32-bit integer core is covering 95+% of our needs. However, sometimes you just need to represent something that is larger (file/disk sizes, traffic counters, ...) or you need non-integer arithmetic. Using userdata in these cases is just awkward. > [Note that support for multiple number types per platform is not > an option. A JIT compiler needs to emit very different instruction > sequences for each number type. Switching number types is not as > easy as changing a couple of C macros.] I know next-to-nothing about JIT so the following might sound ridiculous: would it be possible to combine Asko's LNUM patch with JIT? -- Dirk From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:00:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AB0Q5j012468; Mon, 10 Aug 2009 08:00:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B685A18D03; Mon, 10 Aug 2009 07:59:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82C2F18CE1 for ; Mon, 10 Aug 2009 07:59:52 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AAxpJT012275 for ; Mon, 10 Aug 2009 07:59:51 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7AAxp103590; Mon, 10 Aug 2009 07:59:51 -0300 Date: Mon, 10 Aug 2009 07:59:50 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810075950.B3576@lua.tecgraf.puc-rio.br> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com>; from dirk.feytons@gmail.com on Mon, Aug 10, 2009 at 10:42:55AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > In my experience, Lua with a 32-bit integer core is covering 95+% of > our needs. However, sometimes you just need to represent something > that is larger (file/disk sizes, traffic counters, ...) or you need > non-integer arithmetic. Using userdata in these cases is just awkward. Why is it awkward? I se that creating an object is a bit awkward, as in one = real(1) half = real(1,2) -- 1/2 but from then on the metamethods should make it transparent: x = (r+2/r)/2 Am I missing something? From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:25:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ABPWIV016658; Mon, 10 Aug 2009 08:25:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7912A18D5E; Mon, 10 Aug 2009 08:25:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4743118D18 for ; Mon, 10 Aug 2009 08:25:03 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so824708rvb.41 for ; Mon, 10 Aug 2009 04:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=e0DUxJSqYRuYamm29cns469wJ2VxHiaRZ0gmJEvgEh0=; b=uSt1FE59g41kNPzByVQAB79Zq00k4d3yxEdQ0H4hJG5jWZGW9dWcFD5oYY55G2/V09 dMcgA81zQ6i20jWDR4nZN9eEjTT7+nLJ0x4Zmye2Ridyfn27FSx/ehU0X9sQdFDyDvSU 4iFJ7K3pU1ejOe7++KfG9CXjK+QLsxS3A5dWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=KMgspFZn1xFVbCP+gPwkF2KAzt5fgNyTHbRY5vXTtsTy9zjHWnwQSdeobbvNIyy4fO ZF2hw+vWPnPlU2FxrqTWkcYP3GMpqLPiZsVzPpCd21V0HXJJ+VPafwazvmzYUbixfXeY 48kdD9gytFSUn/4Dqo6EHWiccH4ixDoW3u/dI= Received: by 10.142.217.14 with SMTP id p14mr788808wfg.184.1249903501862; Mon, 10 Aug 2009 04:25:01 -0700 (PDT) Received: from ?124.13.56.165? ([124.13.56.165]) by mx.google.com with ESMTPS id 30sm11742894wfc.31.2009.08.10.04.25.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 04:25:01 -0700 (PDT) Message-ID: <4A800383.6050102@gmail.com> Date: Mon, 10 Aug 2009 19:24:51 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT performance References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> In-Reply-To: <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dirk Feytons wrote: > On Sun, Aug 9, 2009 at 5:03 PM, Mike Pall wrote: > [...] >> Michael Bauroth wrote: >>> Does there exist eventually an ARM port? >> Given the market share and the estimated demand, that's most >> likely the next port after the x64 port. But it's much more >> complicated, since there is no uniform ARM platform. The choice of >> the number type for Lua is the main difficulty. >> > [...] > > Am I the only one who would be interested in a MIPS port? :) PIC32MX? Yayy! :-) It's an interesting arms race (arms, heh) and the specs for MCUs down the line is going to be lovely... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:39:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ABcsBN017883; Mon, 10 Aug 2009 08:39:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEF8918E4E; Mon, 10 Aug 2009 08:38:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout02.plus.net (relay.pcl-ipout02.plus.net [212.159.7.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 903CE18C79 for ; Mon, 10 Aug 2009 08:38:25 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALOjf0rUnw4U/2dsb2JhbADNbwmEDwU Received: from pih-relay08.plus.net ([212.159.14.20]) by relay.pcl-ipout02.plus.net with ESMTP; 10 Aug 2009 12:38:18 +0100 Received: from [80.229.242.93] (helo=iyonix) by pih-relay08.plus.net with esmtp (Exim) id 1MaTCj-0000sH-Mg for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 12:38:17 +0100 Date: Mon, 10 Aug 2009 12:38:10 +0100 From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: LuaJIT performance Message-ID: References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> <20090810075950.B3576@lua.tecgraf.puc-rio.br> In-Reply-To: <20090810075950.B3576@lua.tecgraf.puc-rio.br> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: fdda18f5673ff288941bec0cfc13c6ac X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message <20090810075950.B3576@lua.tecgraf.puc-rio.br> you wrote: > > In my experience, Lua with a 32-bit integer core is covering 95+% of > > our needs. However, sometimes you just need to represent something > > that is larger (file/disk sizes, traffic counters, ...) or you need > > non-integer arithmetic. Using userdata in these cases is just awkward. > > Why is it awkward? I se that creating an object is a bit awkward, as in > ..... > but from then on the metamethods should make it transparent: > x = (r+2/r)/2 > Am I missing something? RiscLua ( http://lua.riscos.org.uk/ ) uses a 32-bit integer core and implements doubles as userdata, using metamethods for as much syntactic sugar as possible. The only delicate point is the difference between copying and non-copying assignment. I hope that the RiscLua notation makes the difference clear: x = @ '0.5' y = x -- still only one number in heap z = @(x) -- now there are two x:add(7) -- x is updated, z is not w = z + 11 -- now there are three print(y,",",z,",",w) --> 7.5,0.5,11.5 Actually, from the point of view of memory economy, lots of standard numerical calculations (e.g. Horner's rule) are better served by updateable numbers. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:43:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ABhaWf018300; Mon, 10 Aug 2009 08:43:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6581518E65; Mon, 10 Aug 2009 08:43:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8E2518D9B for ; Mon, 10 Aug 2009 08:43:09 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaTHQ-0006au-00; Mon, 10 Aug 2009 13:43:08 +0200 Date: Mon, 10 Aug 2009 13:26:40 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810112640.GA7703@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dirk Feytons wrote: > I know next-to-nothing about JIT so the following might sound > ridiculous: would it be possible to combine Asko's LNUM patch with > JIT? Certainly not the patch itself. Maybe the basic idea of having a dual number representation. But the semantics can get quite ugly (overflow handling and preserving -0). Case in point: Mozilla's SpiderMonkey JavaScript engine uses such a dual number representation (int31 vs. boxed doubles). The interpreter always converts all operands to doubles, performs a double-precision FP operation and then checks whether the result is in range of int31 to avoid boxing it. Ok, so that's not exactly helpful without a hardware FPU. Their TraceMonkey JIT compiler can turn this into a check for integer overflow in many cases. But the required logic for managing the two number domains looks excessive. Has anybody ever dared to run Firefox on a FP-challenged ARM box with JS-intensive apps? Whee ... Of course one can go crazy optimizing this with special bytecodes for each case, patching the bytecode at runtime depending on the observed domain of its operands (like a polymorphic inline cache). Same goes for the JIT compiler. Not sure I want to go down this path. A pure int32 VM suddenly looks really easy in comparison. ;-) --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:51:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ABp3NZ019227; Mon, 10 Aug 2009 08:51:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCF5918E7A; Mon, 10 Aug 2009 08:50:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A450C18E73 for ; Mon, 10 Aug 2009 08:50:38 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MaTOX-00023U-54 for ; Mon, 10 Aug 2009 12:50:29 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MaTOc-0002v3-Tl for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 12:50:35 +0100 Date: Mon, 10 Aug 2009 12:50:34 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: LuaJIT performance Message-ID: <20090810125034.1e20855e@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090810112640.GA7703@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> <20090810112640.GA7703@mike.de> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009 13:26:40 +0200 Mike Pall wrote: > Their TraceMonkey JIT compiler can turn this into a check for > integer overflow in many cases. But the required logic for > managing the two number domains looks excessive. Has anybody ever > dared to run Firefox on a FP-challenged ARM box with JS-intensive > apps? Whee ... *Firefox* is a JS-intensive app. And yes, it's painful :) I found a nice YouTube video the other day showing Firefox on a 200MHz StrongARM, and it taking 4 minutes to load, and 5 minutes to show a window, due to the UI basically being JS and XML. -- B. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 08:57:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ABvsYJ019941; Mon, 10 Aug 2009 08:57:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 816A218D75; Mon, 10 Aug 2009 08:57:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 094B418D43 for ; Mon, 10 Aug 2009 08:57:25 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MaTVB-0005xB-0N for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 12:57:21 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 5AC8C1731F for ; Mon, 10 Aug 2009 12:57:18 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:60203 with envelope Message-ID: <4A800B17.8010505@cowlark.com> Date: Mon, 10 Aug 2009 12:57:11 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT performance References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> In-Reply-To: <20090810003643.GA17119@mike.de> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7ABvsYJ019941 Mike Pall wrote: [...] > Umm, so one probably needs at least two different VMs for ARM (FP > vs. int-only). Then combine this with the options for ARM vs. > Thumb vs. Thumb2 code and with ARMv4-ARMv7 support and soon we'll > have an exponential number of targets to support ... *sigh* Does LJ2 not use dual representation where numbers are promoted from integer to float as needed? I'd have thought (based on my minimal knowledge of trace compilers...) that this wouldn't be terribly hard and would allow, e.g., use of the integer ALU instructions where possible and only fall back to floats for those operations that needed it. Is the extra complexity not worth the speed boost in real life? -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:17:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGHmge009573; Mon, 10 Aug 2009 13:17:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F1EE19024; Mon, 10 Aug 2009 13:17:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth05.prod.mesa1.secureserver.net (smtpauth05.prod.mesa1.secureserver.net [64.202.165.99]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1E84318EA0 for ; Mon, 10 Aug 2009 13:17:08 -0300 (BRT) Received: (qmail 5801 invoked from network); 10 Aug 2009 16:17:03 -0000 Received: from unknown (96.240.121.67) by smtpauth05.prod.mesa1.secureserver.net (64.202.165.99) with ESMTP; 10 Aug 2009 16:17:03 -0000 Message-Id: <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: <20090810013307.GA18673@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaJIT performance Date: Mon, 10 Aug 2009 09:17:01 -0700 References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 836 Lines: 19 On Aug 9, 2009, at 6:33 PM, Mike Pall wrote: > Thankfully I've recently removed the last major stumbling block > (better trace linking) and the benchmark results demonstrate that > going for a trace compiler was a sound design decision after all. > > But I have to say it was an expensive decision: I've considerably > underestimated the amount of research and trial-and-error which > was needed to convert a research toy into a production compiler. > There are some important implementation details which the few > papers about trace compilers completely fail to mention ... :-| It will be interesting to see your results. I've talked to people doing dynamic language implementations who've observed that the tracing JITs haven't been faring as well as their initial hype suggested particularly in the JavaScript world. Mark From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:22:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGMD9C010751; Mon, 10 Aug 2009 13:22:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80523190DD; Mon, 10 Aug 2009 13:21:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth22.prod.mesa1.secureserver.net (smtpauth22.prod.mesa1.secureserver.net [64.202.165.44]) by bazar2.conectiva.com.br (Postfix) with SMTP id 313771909C for ; Mon, 10 Aug 2009 13:21:45 -0300 (BRT) Received: (qmail 2814 invoked from network); 10 Aug 2009 16:21:40 -0000 Received: from unknown (96.240.121.67) by smtpauth22.prod.mesa1.secureserver.net (64.202.165.44) with ESMTP; 10 Aug 2009 16:21:40 -0000 Message-Id: <081334DE-071F-4001-8DF7-5F28369C2C70@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: <20090809150322.GA14154@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaJIT performance Date: Mon, 10 Aug 2009 09:21:39 -0700 References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 224 Lines: 9 On Aug 9, 2009, at 8:03 AM, Mike Pall wrote: > Most of the LJ2 VM is already "64 bit ready". E.g. it has an > arch-independent 32 bit pointer abstraction for all GC objects. Handles? A limited range 64-bit pointer? Mark From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:23:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGNTOU011028; Mon, 10 Aug 2009 13:23:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7A6819109; Mon, 10 Aug 2009 13:23:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E53E190F9 for ; Mon, 10 Aug 2009 13:23:03 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7AGN26W031061 for ; Mon, 10 Aug 2009 13:23:02 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id F003D54C11A; Mon, 10 Aug 2009 13:23:02 -0300 (BRT) Date: Mon, 10 Aug 2009 13:23:02 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: possible bug in lua.c main report lua_tostring malloc Message-ID: <20090810162302.GA1285@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 551 Lines: 15 > In Lua 5.1.4, in lua.h:main, the call to "report" invokes > lua_tostring, which according to the Lua Reference Manual may raise a > memory error, presumably in the condition where the error value is a > number that must be translated into a string and therefore allocate > memory for the string. In this context, the call to lua_tostring is > unprotected. > > I was able to cause "lua -e 'error(5)'" to crash by triggering an > allocation failure in lmem.c: > > [...] Just a small detail: By "crash" you mean a panicked exit, right? -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:24:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGO7ac011191; Mon, 10 Aug 2009 13:24:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0D1119143; Mon, 10 Aug 2009 13:23:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hm1479-12.locaweb.com.br (hm1479-12.locaweb.com.br [201.76.49.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E07F190F9 for ; Mon, 10 Aug 2009 13:23:03 -0300 (BRT) Received: from cl01.mobimail.com (201.76.62.22) by hm1479-38.locaweb.com.br (PowerMTA(TM) v3.5r13) id hg14me0nvdcl for ; Mon, 10 Aug 2009 13:23:02 -0300 (envelope-from ) Received: from [200.166.40.173] (account saulot@lemon.com HELO saulot) by hm1089.cl01.mobimail.com (CommuniGate Pro SMTP 5.2.14) with ESMTPA id 94454347 for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 13:23:01 -0300 From: "Saulo Tauil" To: "'Lua list'" References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> In-Reply-To: <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> Subject: RE: Precompiled multiplatform code (ARMxPC) Date: Mon, 10 Aug 2009 13:29:18 -0300 Message-ID: <006d01ca19d7$c02eb530$408c1f90$@com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoXszzKD+k0nasSQ36lk/zhC0PpUgCImj3Q Content-Language: pt-br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 1759 Lines: 52 The terminals have little memory, low cpu clock and lack of space. The portability of uncompiled code is a security issue too, since I want avoid code manipulation by third party. Initially this precompiled code will be remotely transferred to the terminals. Thanks, Saulo -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Sam Roberts Sent: sexta-feira, 7 de agosto de 2009 18:00 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) On Fri, Aug 7, 2009 at 10:52 AM, Saulo Tauil wrote: > Thank you very much. > > What if I make changes in Lua to do automatic big/little-endian conversions, > some type redefinitions (size_t=>ulong) and disable double operation. Would > it be possible? > The automatic conversion may slowdown my app, but would bring an invaluable > feature. > > I'm looking for a way to run a lightweight customizable interpreter in > several terminals. The compiled script interchangeability would be a very > good thing. > Does Lua fit to my needs? > Some advice? Its not clear to me, at least, why you are trying to precompile. Your lua on the ARM device has the ability to accept lua code in text form if you are using it as an interpreter. So why do you want to precompile lua to bytecode on your workstation, and then transfer the bytecode to the target ARM device? Uncompiled lua code is the most portable form of a lua program. The standard reason to want to put precompiled code on a device is because the lua core has been hacked to remove the parser/compiler, so it lacks the ability to compile lua itself. Doing this saves code space on embedded devices. This doesn't seem to be your case. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:31:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGVaL1012658; Mon, 10 Aug 2009 13:31:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACCC71916D; Mon, 10 Aug 2009 13:31:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth16.prod.mesa1.secureserver.net (smtpauth16.prod.mesa1.secureserver.net [64.202.165.22]) by bazar2.conectiva.com.br (Postfix) with SMTP id A112B190F9 for ; Mon, 10 Aug 2009 13:31:04 -0300 (BRT) Received: (qmail 12941 invoked from network); 10 Aug 2009 16:31:00 -0000 Received: from unknown (96.240.121.67) by smtpauth16.prod.mesa1.secureserver.net (64.202.165.22) with ESMTP; 10 Aug 2009 16:31:00 -0000 Message-Id: <87DB33AC-3E1C-4FAF-BBFA-65866554296B@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 09:30:59 -0700 References: <6E9D2A887A21460DA3EF843422AFE7FF@Mania> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 2152 Lines: 50 On Aug 10, 2009, at 12:18 AM, Joshua Haberman wrote: > Alex Davies iinet.net.au> writes: > >> >> I had the same problem when I was just starting out, as it isn't >> obvious in >> the documentation but Lua allows a table to be associated with a >> userdata >> and marks it appropriately. So all circularly references are handled >> correctly, something that's hard to do via the registry. >> >> Quick example: >> lua_newuserdata(L, 0); >> lua_newtable(L); >> lua_pushvalue(L, -1); >> lua_setfenv(L, -3); > > Thanks for the info Alex! It's true that this is better than putting > stuff in the registry. I would still prefer to avoid having to > construct this per-userdata table at all, but this at least makes it a > little more tolerable. Note that from a space standpoint, if you use the array portion of the table, the overhead is relatively small. It's basically the cost of having a table object allocated and whatever per allocation overhead your memory allocator imposes. From a usage standpoint, it's a bit of a pain since one needs to fetch the table in any functions that work on the data, though that's not horrendous. (I have thought about adding a pseudo-index for the environment table of the value at index 1 in the stack frame just to make working with userdata objects with environment tables easier. Doing so is pretty easy. Doing so and keeping compatibility with any code that has expectations about what range the pseudo-indices occupy is risky.) From a performance standpoint, the hit comes in having to go through lua_rawgeti and lua_rawseti and then having to process and pop the results. That's more or less the price for having a compact API to Lua that completely shields implementation details such as the TValue structure. (Consider, for example, that LuaJIT 2 does not use this representation for Lua values.) At the expense of a larger API, it could be useful to provide more combined accessors -- e.g., lua_rawgeti_number -- though note that the character pointers for strings technically only remain valid as long as the string is on the stack. Mark From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:32:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGWAQf012795; Mon, 10 Aug 2009 13:32:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9178719189; Mon, 10 Aug 2009 13:31:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A5301917B for ; Mon, 10 Aug 2009 13:31:20 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MaXmB-0007lp-2k for ; Mon, 10 Aug 2009 17:31:11 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MaXmI-0006ak-KM for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 17:31:18 +0100 Date: Mon, 10 Aug 2009 17:31:18 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> In-Reply-To: <006d01ca19d7$c02eb530$408c1f90$@com.br> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 709 Lines: 17 On Mon, 10 Aug 2009 13:29:18 -0300 "Saulo Tauil" wrote: > The terminals have little memory, low cpu clock and lack of space. Given that compiled Lua is often /larger/ than the source, you may find that leaving the compiler in and gzipping and/or using something like LuaSrcDiet saves more space, depending on your exact circumstances. > The portability of uncompiled code is a security issue too, since I > want avoid code manipulation by third party. Initially this > precompiled code will be remotely transferred to the terminals. Compiled Lua offers no security advantages beyond preventing casual snooping. Anybody who wants to break it will. And quite easily. B. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:39:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGdf2l014236; Mon, 10 Aug 2009 13:39:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41E4319076; Mon, 10 Aug 2009 13:39:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFB6C18E9D for ; Mon, 10 Aug 2009 13:39:11 -0300 (BRT) Received: by rv-out-0506.google.com with SMTP id f9so875522rvb.41 for ; Mon, 10 Aug 2009 09:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=c6IeHPFx1VQT/PWCHRUIhpT2ajujfpUyGeUPixcnn/s=; b=CIAqdhCK3ZraC7ROLGUs91cfp25bMPI2XtDHwcXmtpDb7QqFDttBOXtL1OYuxllF1x LjtEXz6YYiNh3ryJXbVbDzso3PhroMaBsT49UD+BXBCYQTIEjMKdwoTz3gs+9+n9goTq RPCdLHAcdbVQrqEIwaBxWBH47hH91TIa/o2oE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=L+WswYLFRLxrEK0RE0gPr5LlD/poeBW2XfmUf7qT0VOVfxf/oj8izJP+6m6w/8M5yE HqTfDQ6OwK/L+dUftaF+UzNsuiy58dkpeaZkuKnHQjQwV+zQ3HSIXiFLstZDvsd0vVbn fMBvVPuHnEOx+aHE1cw6Fg6/a+oydMDa+Lzvc= Received: by 10.141.41.3 with SMTP id t3mr1716184rvj.93.1249922350010; Mon, 10 Aug 2009 09:39:10 -0700 (PDT) Received: from ?124.13.58.36? ([124.13.58.36]) by mx.google.com with ESMTPS id g31sm26003285rvb.36.2009.08.10.09.39.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 09:39:09 -0700 (PDT) Message-ID: <4A804D24.1010305@gmail.com> Date: Tue, 11 Aug 2009 00:39:00 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 1302 Lines: 31 Rob Kendrick wrote: > On Mon, 10 Aug 2009 13:29:18 -0300 > "Saulo Tauil" wrote: > >> The terminals have little memory, low cpu clock and lack of space. > > Given that compiled Lua is often /larger/ than the source, you may > find that leaving the compiler in and gzipping and/or using something > like LuaSrcDiet saves more space, depending on your exact circumstances. > >> The portability of uncompiled code is a security issue too, since I >> want avoid code manipulation by third party. Initially this >> precompiled code will be remotely transferred to the terminals. > > Compiled Lua offers no security advantages beyond preventing casual > snooping. Anybody who wants to break it will. And quite easily. I think he means one of those lower-end 32-bit ARMs. They probably have about 8-32KB internal SRAM. Everything runs on-chip, and the program memory can probably be protected. You can upload your programs as firmware, with a bootstrapper that can probably include some sort of security encryption. Can't really do the compilation or interpretation front-end on-chip. There are at least two broad kinds of ARM MCUs, and I don't believe Saulo is talking about the kind that can run Linux. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:45:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGjSeW015235; Mon, 10 Aug 2009 13:45:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BA47191E8; Mon, 10 Aug 2009 13:45:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01CB418E61 for ; Mon, 10 Aug 2009 13:45:00 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MaXzK-0001M9-LR for ; Mon, 10 Aug 2009 17:44:46 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MaXzS-00072n-5Y for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 17:44:54 +0100 Date: Mon, 10 Aug 2009 17:44:52 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Precompiled multiplatform code (ARMxPC) Message-ID: <20090810174452.458001c8@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4A804D24.1010305@gmail.com> References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> <4A804D24.1010305@gmail.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 1213 Lines: 30 On Tue, 11 Aug 2009 00:39:00 +0800 KHMan wrote: > Rob Kendrick wrote: > > On Mon, 10 Aug 2009 13:29:18 -0300 > > "Saulo Tauil" wrote: > > > >> The terminals have little memory, low cpu clock and lack of > >> space. > > > > Given that compiled Lua is often /larger/ than the source, you may > > find that leaving the compiler in and gzipping and/or using > > something like LuaSrcDiet saves more space, depending on your exact > > circumstances. > > I think he means one of those lower-end 32-bit ARMs. They probably > have about 8-32KB internal SRAM. Everything runs on-chip, and the > program memory can probably be protected. You can upload your > programs as firmware, with a bootstrapper that can probably > include some sort of security encryption. Can't really do the > compilation or interpretation front-end on-chip. > > There are at least two broad kinds of ARM MCUs, and I don't > believe Saulo is talking about the kind that can run Linux. We're in broadly the same situation. Although I'd never actually consider Lua for anything with as little as 32kB of RAM. Of course, compiled code would come out of your Flash budget, anyway. B. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 13:46:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AGkiOc015578; Mon, 10 Aug 2009 13:46:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F41719219; Mon, 10 Aug 2009 13:46:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 194FE191F2 for ; Mon, 10 Aug 2009 13:46:19 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7AGkIO7000730 for ; Mon, 10 Aug 2009 13:46:18 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id E18FD54C11A; Mon, 10 Aug 2009 13:46:18 -0300 (BRT) Date: Mon, 10 Aug 2009 13:46:18 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: custom "mark" function for userdata? Message-ID: <20090810164618.GA1480@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Length: 541 Lines: 11 > So I guess I'm wondering: is there any reason why Lua doesn't let > userdata have a custom mark function? It would allow me to implement my > extension much more efficiently. Note that the Lua API does not have anything like a PyObject type. Lua values have no representation in C at all. So, what would be the use of a mark function? Where would it get the Lua objects to mark? If the mark function can access a Lua object, this object is accessible and therefore will be marked by Lua, without the need of a mark function. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:01:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AH1boQ018866; Mon, 10 Aug 2009 14:01:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52F72191C9; Mon, 10 Aug 2009 14:01:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.173]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A114D19176 for ; Mon, 10 Aug 2009 14:00:59 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so1085258wfa.11 for ; Mon, 10 Aug 2009 10:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=kiK9ZNwbEFategEm3pSliWZu9+iH0L9rasbIkIJ/I0M=; b=FU12ntLn0eWZUCrJEBNQknc0EQNpv3+PBNgmI1aIRKn0pV9DifVtHrhWkxZXqlIOYo cfX1BcrITdhU82JZowHRYL8wJcCrqUoXQAcv8Ck2FODs0Fy7rqRx2MiYIvNtBInZvfA+ 3N/yOEfd5Zudp7BDNb65DDprU4hN3Cms1JtfY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=bqdJ/MHLv4KTRRM8ckbuJZa1Zr81AjPgVKZIMrnjjbJ0i9ZPOWd35UGT6M+5YfhGxk eJjG/NOYzAgS4ppUTmC1aP+PMrWh+TVVQTXNqAl6gh6qAks7Vsap/MdufvX2VvMbhs8J H4BZ9aQ8tyxDOtMsoXMiG69HToSX5T/lokc6s= Received: by 10.142.230.7 with SMTP id c7mr166641wfh.137.1249923657458; Mon, 10 Aug 2009 10:00:57 -0700 (PDT) Received: from ?124.13.58.36? ([124.13.58.36]) by mx.google.com with ESMTPS id 32sm12688214wfa.33.2009.08.10.10.00.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 10:00:56 -0700 (PDT) Message-ID: <4A80523E.9010301@gmail.com> Date: Tue, 11 Aug 2009 01:00:46 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> <4A804D24.1010305@gmail.com> <20090810174452.458001c8@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090810174452.458001c8@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > On Tue, 11 Aug 2009 00:39:00 +0800 > KHMan wrote: > >> Rob Kendrick wrote: >>> On Mon, 10 Aug 2009 13:29:18 -0300 >>> "Saulo Tauil" wrote: >>> >>>> The terminals have little memory, low cpu clock and lack of >>>> space. >>> Given that compiled Lua is often /larger/ than the source, you may >>> find that leaving the compiler in and gzipping and/or using >>> something like LuaSrcDiet saves more space, depending on your exact >>> circumstances. >> I think he means one of those lower-end 32-bit ARMs. They probably >> have about 8-32KB internal SRAM. Everything runs on-chip, and the >> program memory can probably be protected. You can upload your >> programs as firmware, with a bootstrapper that can probably >> include some sort of security encryption. Can't really do the >> compilation or interpretation front-end on-chip. >> >> There are at least two broad kinds of ARM MCUs, and I don't >> believe Saulo is talking about the kind that can run Linux. > > We're in broadly the same situation. Although I'd never actually > consider Lua for anything with as little as 32kB of RAM. Of course, > compiled code would come out of your Flash budget, anyway. Yeah, I agree, I wouldn't do it myself either, I would also want memory usage to be very strictly determined. I guess Bogdan Marinescu's eLua, if it has not been mentioned already, is something the OP can scope out. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:07:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AH7rcM020133; Mon, 10 Aug 2009 14:07:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EED851926D; Mon, 10 Aug 2009 14:07:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A49DA19104 for ; Mon, 10 Aug 2009 14:07:20 -0300 (BRT) Received: from [192.168.254.14] (os-dsl-0882.bmts.com [216.183.155.115]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n7AH7D50003273 for ; Mon, 10 Aug 2009 13:07:16 -0400 Message-ID: <4A8053C1.1030802@hempeldesigngroup.com> Date: Mon, 10 Aug 2009 13:07:13 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> <4A804D24.1010305@gmail.com> <20090810174452.458001c8@trite.i.flarn.net.i.flarn.net> <4A80523E.9010301@gmail.com> In-Reply-To: <4A80523E.9010301@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > Rob Kendrick wrote: >> We're in broadly the same situation. Although I'd never actually >> consider Lua for anything with as little as 32kB of RAM. Of course, >> compiled code would come out of your Flash budget, anyway. > > Yeah, I agree, I wouldn't do it myself either, I would also want memory > usage to be very strictly determined. I guess Bogdan Marinescu's eLua, > if it has not been mentioned already, is something the OP can scope out. And I'll point out my own pbLua for the LEGO MINDSTORMS NXT as another example of a severely memory constrained (but usable) Lua Ralph From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:15:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHFkEC022086; Mon, 10 Aug 2009 14:15:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D43D21928B; Mon, 10 Aug 2009 14:15:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D822E19235 for ; Mon, 10 Aug 2009 14:15:12 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaYSj-00072F-00; Mon, 10 Aug 2009 19:15:09 +0200 Date: Mon, 10 Aug 2009 19:15:02 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810171502.GA20684@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> <4A800B17.8010505@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A800B17.8010505@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > Does LJ2 not use dual representation where numbers are promoted from > integer to float as needed? I'd have thought (based on my minimal > knowledge of trace compilers...) that this wouldn't be terribly hard and > would allow, e.g., use of the integer ALU instructions where possible > and only fall back to floats for those operations that needed it. Is the > extra complexity not worth the speed boost in real life? Well, it does. But too much narrowing is not beneficial. At least on a desktop-class super-scalar CPU. In general one needs to replace one FP ALU op with an int ALU op plus a branch for the overflow check. But the execution bandwidth of int or FP ALU ops is e.g. 3 per cycle vs. only 1 branch per cycle on a Core2. Saturating the branch execution port and the reorder buffers quickly nullifies any performance gain. Another problem is the increased pressure on integer registers and integer execution bandwidth. The available FPU execution bandwidth is effectively wasted. It's hard to avoid the overflow checks, except for induction variables. And you need one more compare and branch to preserve -0 for NEG/MUL/DIV. The longer latencies for FP ops are a non-issue, except in loop-controlling expressions. Of course you can't avoid the integer conversions for indexing expressions. That's why LJ2 does predictive narrowing for induction variables and demand-driven narrowing via backpropagation for indexing expressions and bit operations. Numbers are never stored as integers, except inside compiled traces. The interpreter and most parts of the VM only have to deal with a single FP number type. This works out just fine for desktop-class CPUs, but of course one needs to rethink narrowing for FP-challenged CPUs. In this case a dual representation of stored number values with normalization steps after FP operations is probably better. But this has far-reaching consequences for the whole VM. So far I've been able to avoid it. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:22:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHMThg023927; Mon, 10 Aug 2009 14:22:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27E6B1929B; Mon, 10 Aug 2009 14:22:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CDAE19292 for ; Mon, 10 Aug 2009 14:21:58 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so773319eyd.11 for ; Mon, 10 Aug 2009 10:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=6TdhUGpVmJpS530EyPdWrijqxmpa+mL29nGqdw39d2w=; b=jHavrdDMR6dWnrkN5bzrXGiVZ1g/2Hdzt/RFVQjVRNG8et1WnG++JDxaCq8JNXNGbW 0pbMaq4WgkeJSI/mU9jtgmmH6WmRjuzcPHAoJRFxbfYG+TrIKSSEaqucgmI4EH5qwWry SHyrE/ikkgw3dVCRsG2Rkn7uJX+6aJll8WWSU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=FULKaons9LWDsfCauVpshJVJ+pxYMFrdjz2bCBl22ohrClC5rZ0Hg4EwQ3alM1eIbE w+E56nxipheN4STh9DIiKUbU8+n/TVwLRiPOtA4OXqyhCOJHhCsrF9ao1jaaBT693TjP Wdd4xZCV1bcsV/DHS8b5/jW1gXPUB7k7LjmbM= Received: by 10.211.202.14 with SMTP id e14mr5196169ebq.50.1249924917026; Mon, 10 Aug 2009 10:21:57 -0700 (PDT) Received: from ?95.78.76.170? ([95.78.76.170]) by mx.google.com with ESMTPS id 28sm839119eyg.52.2009.08.10.10.21.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Aug 2009 10:21:56 -0700 (PDT) Date: Mon, 10 Aug 2009 21:21:38 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <121844120.20090810212138@gmail.com> To: Mike Pall Subject: Re[2]: LuaJIT performance In-Reply-To: <20090810171502.GA20684@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> <4A800B17.8010505@cowlark.com> <20090810171502.GA20684@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Mike, Monday, August 10, 2009, 9:15:02 PM, you wrote: > This works out just fine for desktop-class CPUs, but of course one > needs to rethink narrowing for FP-challenged CPUs. In this case a > dual representation of stored number values with normalization > steps after FP operations is probably better. But this has > far-reaching consequences for the whole VM. So far I've been able > to avoid it. it's probably obvious, but are you considered distinguishing 2 number types and dispatching code for them separately? JIT does it for Lua standard types, i.e. you may generate two invocations of some functions depending on number/string type of its parameter. how about separating also the int/double cases? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:30:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHUD7k025492; Mon, 10 Aug 2009 14:30:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 064E31928A; Mon, 10 Aug 2009 14:29:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA5C61914F for ; Mon, 10 Aug 2009 14:29:42 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so1090820wfa.11 for ; Mon, 10 Aug 2009 10:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Bg3izyAlc0Zy8SR0qlEU+XjKCoVd/+YjVm7tlyB8Juk=; b=mmoPQqoprmOJzNbt9ynRbygm2+6o9F8y1Y6M0zLe0W99xW8CcyxggOgMO6ZD36vNbg BcYX3WrbN8jdnWbOKBewNorH+EEGVSy0nkrWS9CLXL5G9FcbPDFWTFD5srzrhZqfryF9 ECv7wFv0cGR4/7JL/SaJ7tD0XYEhyz5WhGnT8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=S4qwz7XXhPmGECVmn6IBlqSrXpqTihwr98g6qRWCdrRKmHdWSf3mBi3peyKEvOtNEm u1y9XE9wE8FcB/DRMkGKiHAtonatrYyXMzecJm52k/GOtPujsBnddJ4pXSAoQQc468sh GIkvGJZzutbHC8oUO/yV4T067qq6TkQ7b0hh0= Received: by 10.142.52.2 with SMTP id z2mr879975wfz.64.1249925379680; Mon, 10 Aug 2009 10:29:39 -0700 (PDT) Received: from ?124.13.58.36? ([124.13.58.36]) by mx.google.com with ESMTPS id 22sm12777141wfg.27.2009.08.10.10.29.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 10:29:39 -0700 (PDT) Message-ID: <4A8058FA.5010601@gmail.com> Date: Tue, 11 Aug 2009 01:29:30 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Precompiled multiplatform code (ARMxPC) References: <01ab01ca16f0$0810a0b0$1831e210$@com.br> <01b301ca16f4$4d3e24b0$e7ba6e10$@com.br> <200908062359.49573.javier@guerrag.com> <020c01ca1787$d5aa6be0$80ff43a0$@com.br> <17eac67c0908071400o38eacf7ehf765761d221e9bcc@mail.gmail.com> <006d01ca19d7$c02eb530$408c1f90$@com.br> <20090810173118.65b874e2@trite.i.flarn.net.i.flarn.net> <4A804D24.1010305@gmail.com> <20090810174452.458001c8@trite.i.flarn.net.i.flarn.net> <4A80523E.9010301@gmail.com> <4A8053C1.1030802@hempeldesigngroup.com> In-Reply-To: <4A8053C1.1030802@hempeldesigngroup.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ralph Hempel wrote: > KHMan wrote: >> Rob Kendrick wrote: > >>> We're in broadly the same situation. Although I'd never actually >>> consider Lua for anything with as little as 32kB of RAM. Of course, >>> compiled code would come out of your Flash budget, anyway. >> >> Yeah, I agree, I wouldn't do it myself either, I would also want >> memory usage to be very strictly determined. I guess Bogdan >> Marinescu's eLua, if it has not been mentioned already, is something >> the OP can scope out. > > And I'll point out my own pbLua for the LEGO MINDSTORMS NXT as > another example of a severely memory constrained (but usable) Lua A lot of people seem to be looking for such solutions. I think a page on the Lua wiki would be useful. A quick glance -- both "lua wiki microcontroller" and "lua wiki mcu" on Google do not appear to turn up a good reference page. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:47:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHlYVd029922; Mon, 10 Aug 2009 14:47:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D172F192A6; Mon, 10 Aug 2009 14:47:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D847C1929C for ; Mon, 10 Aug 2009 14:47:00 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaYxV-00075z-00; Mon, 10 Aug 2009 19:46:57 +0200 Date: Mon, 10 Aug 2009 19:46:50 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810174650.GA21768@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <081334DE-071F-4001-8DF7-5F28369C2C70@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <081334DE-071F-4001-8DF7-5F28369C2C70@grubmah.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: >> Most of the LJ2 VM is already "64 bit ready". E.g. it has an >> arch-independent 32 bit pointer abstraction for all GC objects. > > Handles? A limited range 64-bit pointer? 32 bit pointers on a 64 bit system. :-) They just have to reside in the lowest 4 GB (actually it's more efficient to only use the lowest 2 GB). That's easy to guarantee since LJ2 already uses a (much faster) bundled memory allocator. You can turn it off in 32 bit mode, but not in 64 bit mode. The argument for restricting the VM to max. 4 GB is that this only applies to the objects managed by the VM itself. You can still load many gigabytes into memory, since all those data-intensive libraries (like libpng) use their own memory management and give you a pointer or handle which can be stored in a tiny userdata. The other argument is that given typical object sizes you can estimate the time for a full GC traversal by the time for random L2 cache misses. That's probably several seconds for a GB. Or in other words: the Lua GC currently is just not up to the task to manage billions of tiny objects, anyway. If someone, somehow eventually outgrows the 4G limit one could switch to compressed pointers. Shifting the pointer by 3 or 4 bits results in a 32 GB or 64 GB limit. [All of that is needed to preserve the special kind of tagged values which overlap with a double and use only 64 bits.] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:51:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHpMpc030836; Mon, 10 Aug 2009 14:51:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BB81192AF; Mon, 10 Aug 2009 14:51:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6252F192A9 for ; Mon, 10 Aug 2009 14:50:56 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MaZ1I-0004mx-OK for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 17:50:53 +0000 Received: from c-71-231-140-251.hsd1.wa.comcast.net ([71.231.140.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 17:50:52 +0000 Received: from joshua by c-71-231-140-251.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 17:50:52 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 17:50:43 +0000 (UTC) Lines: 20 Message-ID: References: <20090810164618.GA1480@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.231.140.251 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy inf.puc-rio.br> writes: > > > So I guess I'm wondering: is there any reason why Lua doesn't let > > userdata have a custom mark function? It would allow me to implement my > > extension much more efficiently. > > Note that the Lua API does not have anything like a PyObject type. Lua > values have no representation in C at all. So, what would be the use > of a mark function? Where would it get the Lua objects to mark? If the > mark function can access a Lua object, this object is accessible and > therefore will be marked by Lua, without the need of a mark function. Hmm, I hadn't realized that. I hoped that there would be a way to store/recall arbitrary Lua objects as an opaque void*, even if there was no way to interpret or dereference its data. It would be nice if Lua could support this. Otherwise extensions aren't able to create optimized container types. Tables are very versatile, but there are times when a different container type would be better. Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 14:55:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AHtGIE031828; Mon, 10 Aug 2009 14:55:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B19FC192B6; Mon, 10 Aug 2009 14:54:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8994A192B1 for ; Mon, 10 Aug 2009 14:54:45 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaZ51-000781-00; Mon, 10 Aug 2009 19:54:43 +0200 Date: Mon, 10 Aug 2009 19:54:29 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810175429.GA8552@mike.de> References: <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> <4A800B17.8010505@cowlark.com> <20090810171502.GA20684@mike.de> <121844120.20090810212138@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <121844120.20090810212138@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin wrote: > > This works out just fine for desktop-class CPUs, but of course one > > needs to rethink narrowing for FP-challenged CPUs. In this case a > > dual representation of stored number values with normalization > > steps after FP operations is probably better. But this has > > far-reaching consequences for the whole VM. So far I've been able > > to avoid it. > > it's probably obvious, but are you considered distinguishing 2 number > types and dispatching code for them separately? JIT does it for Lua > standard types, i.e. you may generate two invocations of some > functions depending on number/string type of its parameter. how about > separating also the int/double cases? Sure, that's what I meant. Specializing JIT-generated code to a particular number representation is fairly easy with the current framework. The complications arise because all of the static parts of the VM need to handle both types, too. And it's hard to avoid the expensive normalization steps outside of compiled code. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 15:02:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AI2aQV001578; Mon, 10 Aug 2009 15:02:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E9C81928D; Mon, 10 Aug 2009 15:02:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6443190D8 for ; Mon, 10 Aug 2009 15:01:57 -0300 (BRT) Received: by yxe5 with SMTP id 5so4025278yxe.33 for ; Mon, 10 Aug 2009 11:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=1HWYjaukCHZ8tNqKUM2Mozlk33BcjIiLJr3Ow7yg7UM=; b=mzTMW6lKL4QVq5K7ouex3m7KnrMmaWI59W7ZaYwlzQ+3NsZ6FAJKEOdZMydng22Wjk oCed6rYSyb4VGXuTy6W5pQvLaWaM75/v5A6vcw3qYmyr7/gXVlwB5peIsQWy7/cMULdt T/GhcZgwbhLu6twqcRI0QPVjWmmmCPCxjmCUA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=DfIvUzxQxd3XEkGCs95HP2w4qpPd1x1NOUGI8ylKZeEuRhdXEf7Rf8Cf7lD3a6VEKX pUTzel+5eIiYnchen7myGOIRZq6hUEJMuWXzKJyDH5PO5o7T0Gvl1EDr6BaHBJIjJ/6b PXshs+/23StM2HaJR3q2QRN4zSPEJkMBpZRYM= MIME-Version: 1.0 Received: by 10.100.43.14 with SMTP id q14mr4015238anq.47.1249927306089; Mon, 10 Aug 2009 11:01:46 -0700 (PDT) From: "Thomas Harning Jr." Date: Mon, 10 Aug 2009 14:01:26 -0400 Message-ID: Subject: LuaJIT + finalizer patch To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just wondering, would it be possible to inject the upcoming LuaJIT 2 with a patch like the 'finalizer'[1] one? Certain workloads would seem to benefit from having finalizers that can execute on scope exit without wrapping pcall/etc. I think this is esp true when dealing with the C-side and a possible error occurs that you don't expect, but you don't want to go through wrapping it in a pcall (if it's something simple like a table-get that might use a metatable) and you don't want to use up a userdata ptr with __gc to handle cleanup on the error case. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 15:09:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AI9bPe004458; Mon, 10 Aug 2009 15:09:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F58A192BC; Mon, 10 Aug 2009 15:09:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02917192A7 for ; Mon, 10 Aug 2009 15:09:08 -0300 (BRT) Received: by fxm25 with SMTP id 25so3045168fxm.5 for ; Mon, 10 Aug 2009 11:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.251.20 with SMTP id d20mr2032612mus.42.1249927746682; Mon, 10 Aug 2009 11:09:06 -0700 (PDT) In-Reply-To: References: <20090810164618.GA1480@inf.puc-rio.br> Date: Mon, 10 Aug 2009 13:09:06 -0500 Message-ID: <90eb1dc70908101109h15301005y506ecd44f1025d45@mail.gmail.com> Subject: Re: custom "mark" function for userdata? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7AI9bPe004458 On Mon, Aug 10, 2009 at 12:50 PM, Joshua Haberman wrote: >  Otherwise > extensions aren't able to create optimized container types. put the objects into the array part, and manage the indexes. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 15:14:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AIERp9005813; Mon, 10 Aug 2009 15:14:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCF76192C4; Mon, 10 Aug 2009 15:14:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 666C4192BF for ; Mon, 10 Aug 2009 15:13:59 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaZNd-0007DM-00; Mon, 10 Aug 2009 20:13:57 +0200 Date: Mon, 10 Aug 2009 20:13:01 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT + finalizer patch Message-ID: <20090810181301.GA3767@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thomas Harning Jr. wrote: > Just wondering, would it be possible to inject the upcoming LuaJIT 2 > with a patch like the 'finalizer'[1] one? Very unlikely. It's about as likely that a patch for the Lua VM applies cleanly against the Python VM. :-) > Certain workloads would seem to benefit from having finalizers that > can execute on scope exit without wrapping pcall/etc. Maybe it makes you feel better to know that pcall() is designed to be a zero-cost operation in LJ2. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 15:58:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AIwhtE017305; Mon, 10 Aug 2009 15:58:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BD8D192C9; Mon, 10 Aug 2009 15:58:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 660E9192C5 for ; Mon, 10 Aug 2009 15:58:07 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:46000) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1Maa4H-0006NU-Pe (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Mon, 10 Aug 2009 19:58:01 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Maa4H-000798-Tw (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Mon, 10 Aug 2009 19:58:01 +0100 Date: Mon, 10 Aug 2009 19:58:01 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua list Subject: Re: LuaJIT performance In-Reply-To: <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> Message-ID: References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009, Mark Hamburg wrote: > > It will be interesting to see your results. I've talked to people doing > dynamic language implementations who've observed that the tracing JITs haven't > been faring as well as their initial hype suggested particularly in the > JavaScript world. What tracing JITs are there other than TraceMonkey and LuaJIT2? Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 16:07:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AJ7g5i019361; Mon, 10 Aug 2009 16:07:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A8C4192D2; Mon, 10 Aug 2009 16:07:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24ADE19293 for ; Mon, 10 Aug 2009 16:07:14 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MaaD9-0007r9-Fv for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 19:07:11 +0000 Received: from 74.125.59.1 ([74.125.59.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 19:07:11 +0000 Received: from joshua by 74.125.59.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 19:07:11 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: LuaJIT performance Date: Mon, 10 Aug 2009 19:07:01 +0000 (UTC) Lines: 20 Message-ID: References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <081334DE-071F-4001-8DF7-5F28369C2C70@grubmah.com> <20090810174650.GA21768@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 74.125.59.1 (Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.196.0 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall mike.de> writes: > > Mark Hamburg wrote: > >> Most of the LJ2 VM is already "64 bit ready". E.g. it has an > >> arch-independent 32 bit pointer abstraction for all GC objects. > > > > Handles? A limited range 64-bit pointer? > > 32 bit pointers on a 64 bit system. > > They just have to reside in the lowest 4 GB (actually it's more > efficient to only use the lowest 2 GB). That's easy to guarantee > since LJ2 already uses a (much faster) bundled memory allocator. > You can turn it off in 32 bit mode, but not in 64 bit mode. Interesting, how does this coexist with malloc()? Are you calling brk or mmap to get your memory? Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 16:10:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AJAZ19020134; Mon, 10 Aug 2009 16:10:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D33C192D9; Mon, 10 Aug 2009 16:10:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E17B318FF3 for ; Mon, 10 Aug 2009 16:10:06 -0300 (BRT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1MaaFv-0007y0-IU for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 19:10:03 +0000 Received: from 74.125.59.1 ([74.125.59.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 19:10:03 +0000 Received: from joshua by 74.125.59.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 19:10:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: custom "mark" function for userdata? Date: Mon, 10 Aug 2009 19:09:25 +0000 (UTC) Lines: 14 Message-ID: References: <20090810164618.GA1480@inf.puc-rio.br> <90eb1dc70908101109h15301005y506ecd44f1025d45@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 74.125.59.1 (Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.196.0 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Javier Guerra guerrag.com> writes: > > On Mon, Aug 10, 2009 at 12:50 PM, Joshua Haberman reverberate.org> wrote: > >  Otherwise > > extensions aren't able to create optimized container types. > > put the objects into the array part, and manage the indexes. Yes, that seems to work alright. I can probably use a variation on this for my use case. Thanks for the suggestion. Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 16:34:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AJYKlw026211; Mon, 10 Aug 2009 16:34:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AB27192DE; Mon, 10 Aug 2009 16:33:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from igtmail01.igt.com (igtmail01.igt.com [12.24.60.81]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFBA118EF2 for ; Mon, 10 Aug 2009 16:33:42 -0300 (BRT) Received: from RNOEXHTCAS02.is.ad.igt.com ([10.210.11.7]) by mail01 (8.14.3/8.14.3) with ESMTP id n7AJXct6018270 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 10 Aug 2009 12:33:38 -0700 Received: from RNOMBX01.is.ad.igt.com ([10.210.11.4]) by RNOEXHTCAS02.is.ad.igt.com ([::1]) with mapi; Mon, 10 Aug 2009 12:34:01 -0700 From: "Stern.Jason" To: "'lua@bazar2.conectiva.com.br'" Date: Mon, 10 Aug 2009 12:34:01 -0700 Subject: REVERSE_INULL in lparser.c Thread-Topic: REVERSE_INULL in lparser.c Thread-Index: AcoZ8YM6u4Uejd8jQr+oQQtfOrURag== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1307-5.600.1016-16816.005 x-tm-as-result: No--34.457000-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-08-10_10:2009-07-24, 2009-08-10, 2009-08-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=1 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0907200000 definitions=main-0908100139 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7AJYKlw026211 Coverity found a dereference of the variable fs, then a later null check of the same variable without an additional assignment: 356 static void close_func (LexState *ls) { 357 lua_State *L = ls->L; 358 FuncState *fs = ls->fs; Event deref_ptr: Directly dereferenced pointer "fs" 359 Proto *f = fs->f; 360 removevars(ls, 0); 361 luaK_ret(fs, 0, 0); /* final return */ 362 luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); 363 f->sizecode = fs->pc; 364 luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); 365 f->sizelineinfo = fs->pc; 366 luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); 367 f->sizek = fs->nk; 368 luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); 369 f->sizep = fs->np; 370 luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); 371 f->sizelocvars = fs->nlocvars; 372 luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); 373 f->sizeupvalues = f->nups; 374 lua_assert(luaG_checkcode(f)); 375 lua_assert(fs->bl == NULL); 376 ls->fs = fs->prev; 377 L->top -= 2; /* remove table and prototype from the stack */ 378 /* last token read was anchored in defunct function; must reanchor it */ Event check_after_deref: Pointer "fs" dereferenced before NULL check 379 if (fs) anchor_token(ls); 380 } Is it safe to remove this null check, or should the null check be moved to before line 359? Thank you, Jason Stern From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 16:37:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AJbbQB027146; Mon, 10 Aug 2009 16:37:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F0E7192E5; Mon, 10 Aug 2009 16:37:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62F3C192E1 for ; Mon, 10 Aug 2009 16:37:11 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MaagA-0007Hh-00; Mon, 10 Aug 2009 21:37:10 +0200 Date: Mon, 10 Aug 2009 21:35:54 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090810193554.GA6127@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <081334DE-071F-4001-8DF7-5F28369C2C70@grubmah.com> <20090810174650.GA21768@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Haberman wrote: > > 32 bit pointers on a 64 bit system. > > > > They just have to reside in the lowest 4 GB (actually it's more > > efficient to only use the lowest 2 GB). That's easy to guarantee > > since LJ2 already uses a (much faster) bundled memory allocator. > > You can turn it off in 32 bit mode, but not in 64 bit mode. > > Interesting, how does this coexist with malloc()? Are you calling > brk or mmap to get your memory? It doesn't use malloc() (or brk(), which might confuse malloc). It allocates pages with mmap() or VirtualAlloc(), like any add-on memory allocator would need to. In fact it's a relentlessly butchered and tuned variant of dlmalloc. I've tested many other allocators, but this was the best match for Lua's needs. It's about 10x faster than MSVCRT's malloc(). :-) [A bump allocator would be even faster of course. But this is not feasible without a moving GC, which would be a really big redesign. It would cause a lot of trouble with the Lua/C API, too.] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 17:03:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AK32Wt001168; Mon, 10 Aug 2009 17:03:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6718192A4; Mon, 10 Aug 2009 17:02:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D577191EE for ; Mon, 10 Aug 2009 17:02:27 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Mab4c-0007Im-00; Mon, 10 Aug 2009 22:02:26 +0200 Date: Mon, 10 Aug 2009 22:01:54 +0200 From: Mike Pall To: Lua list Subject: Re: REVERSE_INULL in lparser.c Message-ID: <20090810200154.GA14693@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stern.Jason wrote: > 376 ls->fs = fs->prev; > 377 L->top -= 2; /* remove table and prototype from the stack */ > 378 /* last token read was anchored in defunct function; must reanchor it */ > > Event check_after_deref: Pointer "fs" dereferenced before NULL check > 379 if (fs) anchor_token(ls); > > Is it safe to remove this null check, or should the null check be moved to before line 359? Within close_func() fs is always a valid pointer. The check should be against ls->fs (i.e. fs->prev), since that's the outer scope where the token is going to be reanchored: if (ls->fs) anchor_token(ls); But ... that's a pointless check because the parser can only get there with ls->fs == NULL when the outermost scope hits the end of the stream. Then the token must be TK_EOS (see luaY_parser). But this token is not reanchored in anchor_token(), so ls->fs is not dereferenced in this case (deep down in luaX_newstring()). This also implies the original code cannot crash. Suggested fix: either replace 'if (fs)' with 'if (ls->fs)' or remove the check and document that anchor_token() depends on ls->t.token == TK_EOS in case ls->fs == NULL. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 17:17:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AKHYDp004379; Mon, 10 Aug 2009 17:17:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 285B3192BA; Mon, 10 Aug 2009 17:17:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3028A19276 for ; Mon, 10 Aug 2009 17:16:59 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MabId-0002Db-PJ for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 20:16:56 +0000 Received: from 74.125.59.1 ([74.125.59.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 20:16:55 +0000 Received: from joshua by 74.125.59.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Aug 2009 20:16:55 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: Strict 'struct' pattern Date: Mon, 10 Aug 2009 20:16:46 +0000 (UTC) Lines: 105 Message-ID: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 74.125.59.1 (Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.196.0 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan gmail.com> writes: > > Hi all, > > We all know that global variables can be a pain [1] and should be > avoided. The 'strict struct' pattern brings these benefits to tables > with named keys > > A 'struct' can be declared so: > > struct.Alice { > x = 1; > y = 2; > } > > And instantiated like so: > > a = Alice {x = 10, y = 20} > > or > > b = Alice {x = 10} -- y will be set to 2 > > Any attempt to access an unknown field of a and b will be an error, > like a.z = 1 or print(b.zz), or even Alice{z = 4}. > > So this brings two things to the party: > (1) typos in fieldnames are errors, not silent problems. > (2) such tables now have an _identity_, and this in particular helps > when trying to write more self-documenting code. In LuaDoc, you can > then confidently give the type of a parameter as Alice, rather than 'a > table with x and y being numbers' > > Stronger typing also means that type-specific assertions can be thrown. > > A simple overload of __tostring would also give you type-specific > string representations like 'Alice #23' for debugging purposes. > > It would be possible (using a suitable proxy table) to enforce dynamic > type checking on field assignments, but of course this would incur a > run-time cost. So I have been working on a project that does something a lot like this. It's a little bit bigger in scope than what you describe. It's based on Protocol Buffers, the serialization format Google released last year. The idea is this: you define your structure type as a protocol buffer type. So instead of writing this in your .lua file: struct.Alice { x = 1; y = 2; } ...you can write this in a .proto file: message Alice { optional int32 x = 1; optional int32 y = 2; } or you could write this in a .lua file: Alice = upb.new_type(" message Alice { optional int32 x = 1; optional int32 y = 2; } ") This may seem a bit roundabout to you, but here's what it buys you: - instances of Alice have a more efficient representation in memory. Since the set of all possible fields is known, it can be stored as an array with known offsets for each member instead of as a table keyed by "x" and "y". - since "x" and "y" are strongly typed, we can throw an error if you put the wrong types in them. There might be cases where you don't want this -- for those cases, your solution would be more appropriate. - you get a very efficient, backward compatible, language-independent serialization format for free (protocol buffers). You can serialize it to disk and load it into Python, Ruby, C++, etc. - to get even slightly crazier, you can pass an in-memory "Alice" instance to any other language that has support for my pb system. You can pass it to C++ and get full reflection over the fields and values, without copying. If this all sounds a bit heavyweight, let me assure you by saying that my library is currently ~2300 sloc of C, and compiles to <30kb of object code on x86. You can check it out here (the Lua parts aren't written yet): http://github.com/haberman/upb/tree/master I won't argue that people should use this in every situation. But if you're in the market for a strongly-typed, compact, language-independent, serializable struct-like object, I think you might like it. ETA: 2 weeks to 2 months (I'm bad at estimating). Josh From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 17:51:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7AKotxD012047; Mon, 10 Aug 2009 17:50:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9336618C79; Mon, 10 Aug 2009 17:50:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8299D18A1B for ; Mon, 10 Aug 2009 17:50:14 -0300 (BRT) Received: by ewy26 with SMTP id 26so3527124ewy.5 for ; Mon, 10 Aug 2009 13:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=gLjzDLb8WKXx8mTg7oieebIoVUmw+wwLLvIjVVFjtQw=; b=u2xQR2a8M+5T2O2f88bkgaFhO1XfgQyWkvZAEspa8Tf5EcGqcBMHdlmd5WuF6irhf0 fMbh8jSyaO3cgMnbLYx2EclVrOHZvotmSoIp9tUQQ2M1NZrqEEnn6J4llrPSvmpde6kh 9HlIrqEtCy6bi4LQMAFOhnG8Lij+JsGZMT+14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RKkqEVEn17ZechjfG61ezTLn5h0dIU+nJyvj+eJT5VUVa/66EGwKZvi/00B5w9kCWb g9qbuIrU6PDE3LWFTjXn+z0nh+E5Pf8zDzUCJz/x785tMtcDDgsM8x81eNvXnrhuqynT ipVv2F2P0M8u6fM8rVFDRqDM7b/xcTOzjo7Vs= MIME-Version: 1.0 Received: by 10.216.87.7 with SMTP id x7mr1060573wee.53.1249937411369; Mon, 10 Aug 2009 13:50:11 -0700 (PDT) In-Reply-To: <20090810075950.B3576@lua.tecgraf.puc-rio.br> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <6dfff91b0908100142t6cb62979l503fb32cbda9f19@mail.gmail.com> <20090810075950.B3576@lua.tecgraf.puc-rio.br> Date: Mon, 10 Aug 2009 22:50:11 +0200 Message-ID: <6dfff91b0908101350w5720a93du4e2549dc63cc3a42@mail.gmail.com> Subject: Re: LuaJIT performance From: Dirk Feytons To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7AKotxD012047 On Mon, Aug 10, 2009 at 12:59 PM, Luiz Henrique de Figueiredo wrote: >> In my experience, Lua with a 32-bit integer core is covering 95+% of >> our needs. However, sometimes you just need to represent something >> that is larger (file/disk sizes, traffic counters, ...) or you need >> non-integer arithmetic. Using userdata in these cases is just awkward. > > Why is it awkward? I se that creating an object is a bit awkward, as in >        one = real(1) >        half = real(1,2)        -- 1/2 > but from then on the metamethods should make it transparent: >        x = (r+2/r)/2 > Am I missing something? Well, the values are mostly coming from a binding to our configuration backend. Having to treat certain parameters in a special way would complicate that binding. I agree that with metamagic it will almost be transparent for the users but I'm a bit afraid of that 'almost'. Our users are not always experienced programmers so the less they (and me) have to worry about the internals the better. -- Dirk From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 18:48:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ALlv5t023943; Mon, 10 Aug 2009 18:47:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C0491924D; Mon, 10 Aug 2009 18:47:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth21.prod.mesa1.secureserver.net (smtpauth21.prod.mesa1.secureserver.net [64.202.165.38]) by bazar2.conectiva.com.br (Postfix) with SMTP id 02C41191D6 for ; Mon, 10 Aug 2009 18:47:19 -0300 (BRT) Received: (qmail 17237 invoked from network); 10 Aug 2009 21:47:17 -0000 Received: from unknown (96.240.121.67) by smtpauth21.prod.mesa1.secureserver.net (64.202.165.38) with ESMTP; 10 Aug 2009 21:47:17 -0000 Message-Id: <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaJIT performance Date: Mon, 10 Aug 2009 14:47:17 -0700 References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 10, 2009, at 11:58 AM, Tony Finch wrote: > On Mon, 10 Aug 2009, Mark Hamburg wrote: >> >> It will be interesting to see your results. I've talked to people >> doing >> dynamic language implementations who've observed that the tracing >> JITs haven't >> been faring as well as their initial hype suggested particularly in >> the >> JavaScript world. > > What tracing JITs are there other than TraceMonkey and LuaJIT2? TraceMonkey is the poster child for tracing JITs at this point, I think, and V8 is generally reported to be faster. I don't know what the status is on Tamarind Tracing. Mark From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 21:12:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B0CE6H010213; Mon, 10 Aug 2009 21:12:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 432D2192BD; Mon, 10 Aug 2009 21:11:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E73B5192A8 for ; Mon, 10 Aug 2009 21:11:31 -0300 (BRT) Received: from 75-164-85-75.tcso.qwest.net ([75.164.85.75]:2306 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MaexJ-00069K-0V for lua@bazar2.conectiva.com.br; Mon, 10 Aug 2009 20:11:09 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <00e101ca175b$5b618160$12248420$@com.au><20090807152339.GA6283@mike.de><00530750997A40B1B4FB24C937A50C5E@Mania><4A7D62D1.4080302@falcom.de><049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net><20090809150458.GA15804@mike.de><20090810013307.GA18673@mike.de><25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> Subject: How to create multi-dimensional table in C? Date: Mon, 10 Aug 2009 17:11:40 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I want to create a 2-D table (array) in C to return to a lua script. In other words, a={} and b = {}, then a[1] = b, a[2] = b, etc., for each new b. I can't figure out how to assign each "column" table to an element of the "row" table, like a[1] = b. My gut tells me to do something like the following, but this code hits a dead end: lua_newtable( L ); // push a Row Table (the main table) onto the stack for ( int j = 1; j <= nRows; j++ ) { lua_newtable( L ); // push a Column Table onto the stack for ( int i = 1; i <= nCols; i++ ) { lua_pushnumber( L, i ); lua_pushstring( L, sValue ); lua_settable( L, -3 ); } // Now stack looks like -2: RowTable, -1: ColumnTable // How do I do the equivalent of RT[ j ] = CT? } Any help would be greatly appreciated. Michael From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 21:16:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B0G0L0011629; Mon, 10 Aug 2009 21:16:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6BAC192E1; Mon, 10 Aug 2009 21:15:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDC8C192CB for ; Mon, 10 Aug 2009 21:15:33 -0300 (BRT) Received: by ewy26 with SMTP id 26so3634661ewy.5 for ; Mon, 10 Aug 2009 17:15:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.196 with SMTP id 46mr1141877weh.205.1249949731694; Mon, 10 Aug 2009 17:15:31 -0700 (PDT) In-Reply-To: References: <00e101ca175b$5b618160$12248420$@com.au> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> Date: Tue, 11 Aug 2009 01:15:31 +0100 X-Google-Sender-Auth: a57c3204fc306bb3 Message-ID: Subject: Re: How to create multi-dimensional table in C? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B0G0L0011629 On Tue, Aug 11, 2009 at 1:11 AM, Michael Newberry wrote: >   // Now stack looks like  -2: RowTable,   -1: ColumnTable >   // How do I do the equivalent of RT[ j ] = CT? lua_rawseti(L, -2, j); That'll set the item on the top of the stack (CT) to index j of the table at -2 (RT). lua_newtable( L ); // push a Row Table (the main table) onto the stack for ( int j = 1; j <= nRows; j++ ) { lua_newtable( L ); // push a Column Table onto the stack for ( int i = 1; i <= nCols; i++ ) { lua_pushnumber( L, i ); lua_pushstring( L, sValue ); lua_settable( L, -3 ); } lua_rawseti(L, -2, j); // RT[j] = CT } From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 21:36:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B0a5ep019630; Mon, 10 Aug 2009 21:36:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64585192EC; Mon, 10 Aug 2009 21:35:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from igtmail01.igt.com (igtmail01.igt.com [12.24.60.81]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2EA718A74 for ; Mon, 10 Aug 2009 21:35:37 -0300 (BRT) Received: from RNOEXHTCAS02.is.ad.igt.com ([10.210.11.7]) by mail01 (8.14.3/8.14.3) with ESMTP id n7B0ZYHe009742 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 10 Aug 2009 17:35:34 -0700 Received: from RNOMBX01.is.ad.igt.com ([10.210.11.4]) by RNOEXHTCAS02.is.ad.igt.com ([::1]) with mapi; Mon, 10 Aug 2009 17:35:56 -0700 From: "Stern.Jason" To: "'lua@bazar2.conectiva.com.br'" Date: Mon, 10 Aug 2009 17:35:56 -0700 Subject: RE: REVERSE_INULL in lparser.c Thread-Topic: REVERSE_INULL in lparser.c Thread-Index: AcoZ8YM6u4Uejd8jQr+oQQtfOrURagAKduug Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1307-5.600.1016-16816.005 x-tm-as-result: No--38.993500-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-08-10_11:2009-07-24, 2009-08-10, 2009-08-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=11 spamscore=11 ipscore=0 phishscore=0 bulkscore=54 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0907200000 definitions=main-0908100191 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B0a5ep019630 > Suggested fix: either replace 'if (fs)' with 'if (ls->fs)' or > remove the check and document that anchor_token() depends on > ls->t.token == TK_EOS in case ls->fs == NULL. Thank you. I was fairly certain it was a non-issue, but wanted to double check before I made any changes (read "break working code to shut Coverity up"). :) From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 22:38:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B1bq9W012064; Mon, 10 Aug 2009 22:37:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41048192EB; Mon, 10 Aug 2009 22:37:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA2F192E0 for ; Mon, 10 Aug 2009 22:37:16 -0300 (BRT) Received: (qmail 28362 invoked by uid 399); 10 Aug 2009 19:37:11 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 10 Aug 2009 19:37:11 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4A80CB47.9090102@workspacewhiz.com> Date: Mon, 10 Aug 2009 19:37:11 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: custom "mark" function for userdata? References: <20090810164618.GA1480@inf.puc-rio.br> In-Reply-To: <20090810164618.GA1480@inf.puc-rio.br> Content-Type: multipart/alternative; boundary="------------070700010100040408030607" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------070700010100040408030607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: Roberto Ierusalimschy Date: 8/10/2009 10:46 AM >> So I guess I'm wondering: is there any reason why Lua doesn't let >> userdata have a custom mark function? It would allow me to implement my >> extension much more efficiently. >> > Note that the Lua API does not have anything like a PyObject type. Lua > values have no representation in C at all. So, what would be the use > of a mark function? Where would it get the Lua objects to mark? If the > mark function can access a Lua object, this object is accessible and > therefore will be marked by Lua, without the need of a mark function. > I've been meaning to suggest being able to patch into the Lua garbage collector for some time. LuaPlus can stores its LuaObject C++ objects on the stack or in a C++ object. When the constructor is called, the LuaObject is added to a linked list of active LuaObjects. When the destructor is called, the LuaObject is removed from the linked list. This isn't the same thing as a custom mark function in the style of Python or Ruby, but I think it could be related. The patch is added to lgc.c (svn://svn.luaplus.org/LuaPlus/work51/Src/LuaPlus/src/lgc.c) in markroot() and atomic(): #if LUAPLUS_EXTENSIONS if (G(L)->userGCFunction) G(L)->userGCFunction(L); #endif /* LUAPLUS_EXTENSIONS */ I also provide the ability to set the extra garbage collection function: lua_setusergcfunction(L, LuaPlusGCFunction); Whose implementation is: #if LUAPLUS_EXTENSIONS #define markvalue(g,o) { checkconsistency(o); \ if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); } #define markobject(g,t) { if (iswhite(obj2gco(t))) \ reallymarkobject(g, obj2gco(t)); } void LuaPlusGCFunction(void* s) { lua_State* L = (lua_State*)s; LuaPlus::LuaState* state = lua_State_To_LuaState(L); if (!state) return; global_State* g = G(L); LuaPlus::LuaObject* curObj = (LuaPlus::LuaObject*)G(L)->gchead_next; while (curObj != (LuaPlus::LuaObject*)&G(L)->gctail_next) { markvalue(g, curObj->GetTObject()); curObj = *(LuaPlus::LuaObject**)curObj; } } #endif /* LUAPLUS_EXTENSIONS */ Josh --------------070700010100040408030607 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: Roberto Ierusalimschy
Date: 8/10/2009 10:46 AM
So I guess I'm wondering: is there any reason why Lua doesn't let
userdata have a custom mark function?  It would allow me to implement my
extension much more efficiently.
    
Note that the Lua API does not have anything like a PyObject type. Lua
values have no representation in C at all. So, what would be the use
of a mark function? Where would it get the Lua objects to mark? If the
mark function can access a Lua object, this object is accessible and
therefore will be marked by Lua, without the need of a mark function.
  
I've been meaning to suggest being able to patch into the Lua garbage collector for some time.  LuaPlus can stores its LuaObject C++ objects on the stack or in a C++ object.  When the constructor is called, the LuaObject is added to a linked list of active LuaObjects.  When the destructor is called, the LuaObject is removed from the linked list.

This isn't the same thing as a custom mark function in the style of Python or Ruby, but I think it could be related.

The patch is added to lgc.c (svn://svn.luaplus.org/LuaPlus/work51/Src/LuaPlus/src/lgc.c) in markroot() and atomic():

#if LUAPLUS_EXTENSIONS
  if (G(L)->userGCFunction)
    G(L)->userGCFunction(L);
#endif /* LUAPLUS_EXTENSIONS */

I also provide the ability to set the extra garbage collection function:

    lua_setusergcfunction(L, LuaPlusGCFunction);

Whose implementation is:

#if LUAPLUS_EXTENSIONS
#define markvalue(g,o) { checkconsistency(o); \
  if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }

#define markobject(g,t) { if (iswhite(obj2gco(t))) \
        reallymarkobject(g, obj2gco(t)); }

void LuaPlusGCFunction(void* s)
{
    lua_State* L = (lua_State*)s;
    LuaPlus::LuaState* state = lua_State_To_LuaState(L);
    if (!state)
        return;

    global_State* g = G(L);

    LuaPlus::LuaObject* curObj = (LuaPlus::LuaObject*)G(L)->gchead_next;
    while (curObj != (LuaPlus::LuaObject*)&G(L)->gctail_next)
    {
        markvalue(g, curObj->GetTObject());
        curObj = *(LuaPlus::LuaObject**)curObj;
    }
}
#endif /* LUAPLUS_EXTENSIONS */

Josh
--------------070700010100040408030607-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 10 23:39:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B2dAZp004983; Mon, 10 Aug 2009 23:39:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E62518F70; Mon, 10 Aug 2009 23:38:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9476F18EE6 for ; Mon, 10 Aug 2009 23:38:36 -0300 (BRT) Received: by vws32 with SMTP id 32so3075106vws.11 for ; Mon, 10 Aug 2009 19:38:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.74.79 with SMTP id t15mr5746532vcj.82.1249958315272; Mon, 10 Aug 2009 19:38:35 -0700 (PDT) Date: Mon, 10 Aug 2009 21:38:35 -0500 X-Google-Sender-Auth: 56cf5c83f1c0850a Message-ID: Subject: tonumber From: George Neill To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi All, I have been reading up on the 'tonumber' function. From what I can tell, it doesn't appear to work the way it's documented (http://pgl.yoyo.org/luai/i/tonumber, my reference) For example, [gneill@blackfoot ~]$ cat !$ cat t.lua print( tonumber( "ff", G)) print( tonumber( "ff", 16)) print( tonumber( "GG", H)) print( tonumber( "GG", 17)) [gneill@blackfoot ~]$ ~/tmp/lua-5.1.4/src/lua < t.lua nil 255 nil 288 looking at the luaB_tonumber function ... static int luaB_tonumber (lua_State *L) { int base = luaL_optint(L, 2, 10); luaL_optint returns the default (10) when passed A, B, C ... etc... Is this a bug? (documentation/code) or am I just not using it correctly? TIA, George From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 00:28:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B3RXga023894; Tue, 11 Aug 2009 00:27:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEA6A18C6A; Tue, 11 Aug 2009 00:27:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A08BE18BA2 for ; Tue, 11 Aug 2009 00:26:59 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so1201023wfa.11 for ; Mon, 10 Aug 2009 20:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uiAK77EzfZcUN4bUVrNUVSsTpOgNET2h+oQXtqq3Zdg=; b=oHCaHsqRLE5mtbYsiAcWpdrnLC3FgM0fxwM/coQoVR8MgUWPR33bFtGBOSC4K/blbe C5c/a9E0DIRpdDCxu1L38loCCoNuLmaReX8yI3l/P5zSegiaQshDuwybPYmpTA+tBuWR LpVh0mfR+7VpD5MKDAMoSJlWBSoCitDfilhPw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RDns2/4arlsm/5cA4xqNdifNKoUBlLTiN54Lz7lxE9bFPv4h49YbRy5cOHuU/yhI6c VzlELJeGumqG4DTf8OyNAjwwjIIfdBQqYlwsGGQprgOuMNGoKdyvxRL9HVhL5S281RIp tLsG0ebWBH7m96Hf7Jzi27Ll9YzoCW59SZGS8= MIME-Version: 1.0 Received: by 10.142.98.17 with SMTP id v17mr578382wfb.345.1249961217767; Mon, 10 Aug 2009 20:26:57 -0700 (PDT) In-Reply-To: References: Date: Mon, 10 Aug 2009 20:26:57 -0700 Message-ID: <17eac67c0908102026h798aaf00nf1bb9e40b2a56a0e@mail.gmail.com> Subject: Re: tonumber From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B3RXga023894 On Mon, Aug 10, 2009 at 7:38 PM, George Neill wrote: > [gneill@blackfoot ~]$ cat !$ > cat t.lua > print( tonumber( "ff", G)) > print( tonumber( "ff", 16)) > print( tonumber( "GG", H)) > print( tonumber( "GG", 17)) > > [gneill@blackfoot ~]$ ~/tmp/lua-5.1.4/src/lua < t.lua > nil > 255 > nil > 288 > > looking at the luaB_tonumber function ... > > static int luaB_tonumber (lua_State *L) { >  int base = luaL_optint(L, 2, 10); > > luaL_optint returns the default (10) when passed A, B, C ... etc... No, A, B, C are names of undefined variables, so you are passing nil as the second argument. Passing nil causes the default to be used. Sam From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 00:33:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B3Xe1b026490; Tue, 11 Aug 2009 00:33:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CDDC18F56; Tue, 11 Aug 2009 00:33:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98E2518BCE for ; Tue, 11 Aug 2009 00:33:15 -0300 (BRT) Received: by vws32 with SMTP id 32so3096412vws.11 for ; Mon, 10 Aug 2009 20:33:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.75.82 with SMTP id x18mr5858721vcj.31.1249961594625; Mon, 10 Aug 2009 20:33:14 -0700 (PDT) In-Reply-To: <17eac67c0908102026h798aaf00nf1bb9e40b2a56a0e@mail.gmail.com> References: <17eac67c0908102026h798aaf00nf1bb9e40b2a56a0e@mail.gmail.com> Date: Mon, 10 Aug 2009 22:33:14 -0500 X-Google-Sender-Auth: 85b9e8e450563f84 Message-ID: Subject: Re: tonumber From: George Neill To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B3Xe1b026490 On Mon, Aug 10, 2009 at 10:26 PM, Sam Roberts wrote: > On Mon, Aug 10, 2009 at 7:38 PM, George Neill wrote: >> [gneill@blackfoot ~]$ cat !$ >> cat t.lua >> print( tonumber( "ff", G)) >> print( tonumber( "ff", 16)) >> print( tonumber( "GG", H)) >> print( tonumber( "GG", 17)) >> >> [gneill@blackfoot ~]$ ~/tmp/lua-5.1.4/src/lua < t.lua >> nil >> 255 >> nil >> 288 >> >> looking at the luaB_tonumber function ... >> >> static int luaB_tonumber (lua_State *L) { >>  int base = luaL_optint(L, 2, 10); >> >> luaL_optint returns the default (10) when passed A, B, C ... etc... > > No, A, B, C are names of undefined variables, so you are passing nil > as the second argument. Passing nil causes the default to be used. Makes complete sense. Is it possible to pass A-Z as the documentation suggests? TIA, George From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 00:41:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B3fO8B029603; Tue, 11 Aug 2009 00:41:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52F5C190C7; Tue, 11 Aug 2009 00:41:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B856C18BCE for ; Tue, 11 Aug 2009 00:40:56 -0300 (BRT) Received: by vws32 with SMTP id 32so3099412vws.11 for ; Mon, 10 Aug 2009 20:40:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.83.210 with SMTP id g18mr5822086vcl.65.1249962055495; Mon, 10 Aug 2009 20:40:55 -0700 (PDT) In-Reply-To: References: <17eac67c0908102026h798aaf00nf1bb9e40b2a56a0e@mail.gmail.com> Date: Mon, 10 Aug 2009 22:40:55 -0500 X-Google-Sender-Auth: 5de9b44578a6b6ec Message-ID: Subject: Re: tonumber From: George Neill To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B3fO8B029603 On Mon, Aug 10, 2009 at 10:33 PM, George Neill wrote: > On Mon, Aug 10, 2009 at 10:26 PM, Sam Roberts wrote: >> On Mon, Aug 10, 2009 at 7:38 PM, George Neill wrote: >>> [gneill@blackfoot ~]$ cat !$ >>> cat t.lua >>> print( tonumber( "ff", G)) >>> print( tonumber( "ff", 16)) >>> print( tonumber( "GG", H)) >>> print( tonumber( "GG", 17)) >>> >>> [gneill@blackfoot ~]$ ~/tmp/lua-5.1.4/src/lua < t.lua >>> nil >>> 255 >>> nil >>> 288 >>> >>> looking at the luaB_tonumber function ... >>> >>> static int luaB_tonumber (lua_State *L) { >>>  int base = luaL_optint(L, 2, 10); >>> >>> luaL_optint returns the default (10) when passed A, B, C ... etc... >> >> No, A, B, C are names of undefined variables, so you are passing nil >> as the second argument. Passing nil causes the default to be used. > > Makes complete sense.  Is it possible to pass A-Z as the documentation suggests? oh man, I completely misread that (http://www.lua.org/manual/5.1/manual.html#pdf-tonumber) sorry for the noise. Thanks, George From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 01:28:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B4Ro0B015596; Tue, 11 Aug 2009 01:27:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E71E819155; Tue, 11 Aug 2009 01:27:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1815619109 for ; Tue, 11 Aug 2009 01:27:18 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so838618eyd.11 for ; Mon, 10 Aug 2009 21:27:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.70.8 with SMTP id s8mr320888eba.69.1249964836647; Mon, 10 Aug 2009 21:27:16 -0700 (PDT) In-Reply-To: <20090810162302.GA1285@inf.puc-rio.br> References: <20090810162302.GA1285@inf.puc-rio.br> Date: Tue, 11 Aug 2009 00:27:16 -0400 X-Google-Sender-Auth: af8533b1f8df7a43 Message-ID: Subject: Re: possible bug in lua.c main report lua_tostring malloc From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B4Ro0B015596 On Mon, Aug 10, 2009 at 12:23 PM, Roberto Ierusalimschy wrote: >> In Lua 5.1.4, in lua.h:main, the call to "report" invokes >> lua_tostring, which according to the Lua Reference Manual may raise a >> memory error, presumably in the condition where the error value is a >> number that must be translated into a string and therefore allocate >> memory for the string.  In this context, the call to lua_tostring is >> unprotected. >> >> [...] > > Just a small detail: By "crash" you mean a panicked exit, right? That is, panicked exit. I suspected some condition might cause one to occur here, but I didn't find one. (I also referred to a real crash, but as noted in my second post, that was due instead to an error in my patch.) From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 01:39:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B4cwdc020075; Tue, 11 Aug 2009 01:39:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48611191D0; Tue, 11 Aug 2009 01:38:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA86819183 for ; Tue, 11 Aug 2009 01:38:32 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 3634AC7CB6 for ; Tue, 11 Aug 2009 07:38:28 +0300 (EEST) Received: from emh05.mail.saunalahti.fi ([62.142.5.111]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A07BCA32511; Tue, 11 Aug 2009 07:38:28 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh05.mail.saunalahti.fi (Postfix) with ESMTP id 2675A27D83 for ; Tue, 11 Aug 2009 07:38:22 +0300 (EEST) Message-Id: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> From: Asko Kauppi To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Mailing list etiquette: do NOT press 'reply' when starting a new thread Date: Tue, 11 Aug 2009 07:38:23 +0300 X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Since this still happens so often, I am bothering everyone on the list. Pressing 'reply' to start a new thread is easy for the poster. You get the Lua list address (lua@bazar2.conectiva.com.br) without needing to copy/paste or type it. Unfortunately, it has the following consequences: - it completely messes up mail clients (s.a. OS X Mail) that can show discussion threads i.e. the "LuaJIT performance" thread remained "clean" for quite a while. Now it's merged with "How to create multi-dimensional table in C" thread. - it messes up the threads also in the Lua list archive, so "next in thread" won't actually do as it says PLEASE, stop this habit, and someone please take on the habit of mentioning it to newcomers who don't know. Just press 'New message'. :) - asko From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 03:40:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B6dpQw003574; Tue, 11 Aug 2009 03:39:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A54518F70; Tue, 11 Aug 2009 03:39:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (unknown [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 249D518CCD for ; Tue, 11 Aug 2009 03:39:18 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 6A45FB1DCC for ; Tue, 11 Aug 2009 09:39:13 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: is it possible to make longjmp-free Lua? References: <89d273ba0907270131i51d661a9j13d9c71e33cc28c7@mail.gmail.com> <89d273ba0907270235p6f96aa69sec43dbbd519f028c@mail.gmail.com> <68542504-1A21-4C11-B0F8-B3312CB1DF60@grubmah.com> Date: Tue, 11 Aug 2009 09:39:11 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 03 Aug 2009 09:52:22 +0300, Juris Kalnins wrote: > Still, the difference between plain call and p-calls is appalling, .. > But I think .. wrapping Lua API code > in an outline function plus using this protected calling should be good > enough solution. Finally arrived at a good enough solution that avoids the overhead of the lua_cpcall, and doesn't require heavy source refactoring. Too bad it doesn't seem possible to do without exposing at least some internals. Timings: --- lua_cpcall: 1.070000 luatry + call: 0.990000 luatry: 0.690000 lua_pcall: 0.990000 lua_call: 0.690000 myluacpcall: 1.680000 lua_xcpcall: 1.350000 --- where "luatry + call:" is: for(i=0; i Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B7IJ6c018176; Tue, 11 Aug 2009 04:18:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17ECA18FCC; Tue, 11 Aug 2009 04:17:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0175B18D90 for ; Tue, 11 Aug 2009 04:17:42 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so1249515wfa.11 for ; Tue, 11 Aug 2009 00:17:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.224.8 with SMTP id w8mr994185wfg.57.1249975060608; Tue, 11 Aug 2009 00:17:40 -0700 (PDT) In-Reply-To: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> Date: Tue, 11 Aug 2009 00:17:40 -0700 Message-ID: <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B7IJ6c018176 On Mon, Aug 10, 2009 at 9:38 PM, Asko Kauppi wrote: > > Since this still happens so often, I am bothering everyone on the list. > > Pressing 'reply' to start a new thread is easy for the poster. You get the > Lua list address (lua@bazar2.conectiva.com.br) without needing to copy/paste > or type it. > > Unfortunately, it has the following consequences: > > - it completely messes up mail clients (s.a. OS X Mail) that can show > discussion threads >        i.e. the "LuaJIT performance" thread remained "clean" for quite a > while. Now it's merged with "How to create multi-dimensional table in C" > thread. > > - it messes up the threads also in the Lua list archive, so "next in thread" > won't actually do as it says > > PLEASE, stop this habit, and someone please take on the habit of mentioning > it to newcomers who don't know. > > Just press 'New message'. :) Pressing "Reply" works just fine in Gmail. Some e-mail providers just suck I guess : / -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 04:24:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B7Nav3020297; Tue, 11 Aug 2009 04:23:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEAB1190D3; Tue, 11 Aug 2009 04:23:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71E3D18FC9 for ; Tue, 11 Aug 2009 04:23:04 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 1894FE20A9 for ; Tue, 11 Aug 2009 09:22:58 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y1dxrKQ1VKA8 for ; Tue, 11 Aug 2009 09:22:54 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 982B3E20B5; Tue, 11 Aug 2009 09:22:54 +0200 (CEST) Date: Tue, 11 Aug 2009 09:22:54 +0200 From: Ico Doornekamp To: Lua list Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Message-ID: <20090811072254.GS27413@pruts.nl> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-08-11 Patrick Donnelly wrote : > On Mon, Aug 10, 2009 at 9:38 PM, Asko Kauppi wrote: > > > > Since this still happens so often, I am bothering everyone on the list. > > > > Pressing 'reply' to start a new thread is easy for the poster. You get the > > Lua list address (lua@bazar2.conectiva.com.br) without needing to copy/paste > > or type it. > > > > Unfortunately, it has the following consequences: > > > > - it completely messes up mail clients (s.a. OS X Mail) that can show > > discussion threads > >        i.e. the "LuaJIT performance" thread remained "clean" for quite a > > while. Now it's merged with "How to create multi-dimensional table in C" > > thread. > > > > - it messes up the threads also in the Lua list archive, so "next in thread" > > won't actually do as it says > > > > PLEASE, stop this habit, and someone please take on the habit of mentioning > > it to newcomers who don't know. > > > > Just press 'New message'. :) > > Pressing "Reply" works just fine in Gmail. Some e-mail providers just > suck I guess : / The problem is not with the e-mail providers, but with the users. Every mail has an unique ID attached to it. If one replies to a message, a header is included in the mail to indicate the preceeding message to which the mail is a reply. For example, in the headers of the mail I'm typing now you can see the line: In-Reply-To: <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> These headers are used by mail clients to keep track of threads. So, if you'd reply to a mail, and simply change the subject, this will result in wrong behaviour, because the In-Reply-To header 'remembers' the original thread the mail belongs to. I usually post new messages to a mailing list by replying to the list, and then removing the In-Reply-To header before sending it off, because I'm too laze to look up the list address. -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 06:13:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B9Cm6q031100; Tue, 11 Aug 2009 06:12:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02AA618B6F; Tue, 11 Aug 2009 06:12:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4703E18B39 for ; Tue, 11 Aug 2009 06:12:13 -0300 (BRT) Received: by fxm25 with SMTP id 25so3423319fxm.5 for ; Tue, 11 Aug 2009 02:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lGIbNWYp8gmck4Enw+MTf1Y76MJ3/RdeL/wkZ4cXUJU=; b=Y0xHNnUJs+0udhwrtUli52Sx+GjqCA6Syim4PLwxGDyviwUaB9Jx27NEMsMHBm6mjT PygXhF3pTjoTlHKHCwvs70bmBvTwZVLr/Eym69+a5E7pxzrtkTu1A0jqeg43XSgU4Rjw KMqU2km8P6ILlg4WpL4yL0PAT3yn8R0wOx/uM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Z1STR6v41P/LJt0cSJUbItL1uxAx5tYVP4kyJLrBnj0TWcFiQibWOiP/b3/7MnwDfw wfEyKCWcdRJJBd3n46RZgAxMpCpGM/uidRFXUAM0qtbwPouMNM3XCBQ/wVPtGULiMh62 /E/KqA6dMEg7a3+FeRqmnjB0FB608sqI0hDtM= MIME-Version: 1.0 Received: by 10.239.181.16 with SMTP id k16mr597246hbg.3.1249981593466; Tue, 11 Aug 2009 02:06:33 -0700 (PDT) In-Reply-To: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Date: Tue, 11 Aug 2009 11:06:33 +0200 Message-ID: <560972290908110206m9b8a1dbs895dc6e8c6a237cd@mail.gmail.com> Subject: Re: Strict 'struct' pattern From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7B9Cm6q031100 On Mon, Aug 10, 2009 at 10:16 PM, Joshua Haberman wrote: 1 > - instances of Alice have a more efficient representation in memory. 2 > - since "x" and "y" are strongly typed, we can throw an error 3 > - you get a very efficient, backward compatible, language-independent >  serialization format for free (protocol buffers). This is a good combination of features, especially if you did need to interoperate with other languages. (Protocol buffers are a lot simpler than all that IDL that gave me a headache last year, and using XML has always seemed slightly insane) And, nice for RPC. Does it require the Google proto compiler? It is definitely Efficiency Week on the Lua list ;) steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 06:24:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B9OPOr003303; Tue, 11 Aug 2009 06:24:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24F751917B; Tue, 11 Aug 2009 06:24:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.tuwien.ac.at (webmail.tuwien.ac.at [128.130.35.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9FF41914F for ; Tue, 11 Aug 2009 06:24:01 -0300 (BRT) Received: from webmail.tuwien.ac.at (localhost [127.0.0.1]) by webmail.tuwien.ac.at (8.13.1/8.13.1) with ESMTP id n7B9O0HX012194 for ; Tue, 11 Aug 2009 11:24:00 +0200 Received: (from apache@localhost) by webmail.tuwien.ac.at (8.13.1/8.13.1/Submit) id n7B9O0xe012193 for lua@bazar2.conectiva.com.br; Tue, 11 Aug 2009 11:24:00 +0200 Received: from 78.142.148.74 ([78.142.148.74]) by webmail.tuwien.ac.at (Horde MIME library) with HTTP; Tue, 11 Aug 2009 11:24:00 +0200 Message-ID: <20090811112400.w3s5euk96scwwogg@webmail.tuwien.ac.at> Date: Tue, 11 Aug 2009 11:24:00 +0200 From: Sebastian Wolff To: lua@bazar2.conectiva.com.br Subject: How do you document C++Lua interfaces? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.4) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I am wondering how people document their Lua bindings. I am currently using Doxygen for the C++ API. The Lua bindings are provided by SWIG. I can configure Doxygen in such a way that it creates a second documentation beside the C++-API-doc which parses only those parts of the C++ headers that will be exported to Lua. This is not satisfactory, i.e. the syntax between C++ and Lua is quite different. Most modules I found in the WWW are not documented yet in terms of C++ AND Lua API. Therefore, I'd like to ask you directly, which method is the best in your opinion. Thanks. Sebastian From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 06:57:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7B9v1B1016078; Tue, 11 Aug 2009 06:57:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B1DA19176; Tue, 11 Aug 2009 06:56:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5ED819109 for ; Tue, 11 Aug 2009 06:56:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so3872030ewy.5 for ; Tue, 11 Aug 2009 02:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=uEo4BN7SnRUMLOX4haaJGUIiZ40ZdzL7dOfLq+qf5bs=; b=jtZ1liqOOUPCQzU3VUMARxv+/luQ1HfE1AiK5kpX2NH7C5Z9ndYtLv5JAJduJnYPvJ A89jkh2ZN0WTs598t+PRezHVSaVNPoBgxod77uPI1y0whX78W8IbmcvK4MRZZRariief o4B62Eis4LvolTArDOOhIkOO3koA3O4R25BRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=LZ+VUw8cOXdT4fMunOrRytMMQIweU89ktd81ITrzY5F/IYOOOe5fyCqPPAK+LwmeUn OilU6pp8UzdEdauM6WEw2y37dE/ucolOpWDefoHX7GOUmwHlsEiUJjS1dMr3X+5y+8kM nYVdT+vv5ATfGkhPc+MrxbKMNF7MoERQfKOms= Received: by 10.210.89.7 with SMTP id m7mr6199909ebb.92.1249984586530; Tue, 11 Aug 2009 02:56:26 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 7sm2516568eyb.20.2009.08.11.02.56.25 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 02:56:26 -0700 (PDT) Message-ID: <4A814049.3040206@gmail.com> Date: Tue, 11 Aug 2009 10:56:25 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: How reliable is lua_topointer() ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm looking at using the pointer returned from lua_topointer() as an index into a weak-keyed table, but it's not obvious whether Lua might ever change these pointers during the execution of my scripts (ie whether a gc cycle might moving things around internally). I'm guessing that for userdata, ghe pointer cannot be changed (since Lua has no way of knowing the relevance of the data pointed to in the userdata), but I'm not so sure whether this would hold true for functions/tables. I've had a look at the PiL on lua_topointer(), and all that says is that the pointer cannot be used to to retrieve what was being pointed to. To be honest, from trying it out, there doesn't seem to be any issues, but I'd like to be sure. Thanks Lawrie From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 07:45:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BAjWkf023428; Tue, 11 Aug 2009 07:45:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 958F419235; Tue, 11 Aug 2009 07:45:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F176191D6 for ; Tue, 11 Aug 2009 07:45:02 -0300 (BRT) Received: by ewy26 with SMTP id 26so3899443ewy.5 for ; Tue, 11 Aug 2009 03:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=iliXgtCCj/jd0PaIkEHWAkW6+cyhyeaCrJTUXLSgrb4=; b=qJf7IG4VUP2BhkpGJe36wdRdtYGsL97r0YCteLmFmeQYCCP7DXZQSaH4JsAZmswhf2 e+//MWY7WTZdMctmlIMyfQ5kp0EHWoep2u60Gnl0WoqfhTbdnbhPNx9hzI5Jh+djoE4u 1/VSRT3483GpbnqQ9jCTisjblgbhG+BVswcQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=CJ+3t2u+1MiKYQ5QkCiU8uh9RZlGxb8epjAkOx+XMlwSESxfsWKmEDIzNNCutf7rjf m63WmN/GIbi8m9lkK9iXqOLEJWXYLm1QYklSzBbZgGqRldHcG0Kt9QtyhRays8tIoWBM +yeYYMIQb/f3UBpNVUYNdUilAx1CviHwZjsZ8= MIME-Version: 1.0 Received: by 10.216.71.196 with SMTP id r46mr1266884wed.54.1249987500338; Tue, 11 Aug 2009 03:45:00 -0700 (PDT) Date: Tue, 11 Aug 2009 12:45:00 +0200 Message-ID: Subject: break operator From: Eike Decker To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I recently had a loop where I had to read a value that looped like this: while true do local line = readline() if not line then break end ... end I know that there are ways how to write this in a nicer way (i.e. having an iterator function), but wouldn't it be more nice if this would work as well this way: while true do local line = readline() or break ... end I think it would break some relationship to have a language feature like that - however it simply looks so much nicer... Of course this concept could be used in a coroutine environment, i.e. having a "stop" function that yields the coroutine, i.e. while true do local line = readline() or stop() ... end which looks already quite nice... cheers, Eike From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 07:47:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BAlBsE023782; Tue, 11 Aug 2009 07:47:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2375219285; Tue, 11 Aug 2009 07:46:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C0341926C for ; Tue, 11 Aug 2009 07:46:50 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BAkb0j023616 for ; Tue, 11 Aug 2009 07:46:43 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7BAkac08822; Tue, 11 Aug 2009 07:46:36 -0300 Date: Tue, 11 Aug 2009 07:46:36 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: How reliable is lua_topointer() ? Message-ID: <20090811074636.A8815@lua.tecgraf.puc-rio.br> References: <4A814049.3040206@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4A814049.3040206@gmail.com>; from lawrien@gmail.com on Tue, Aug 11, 2009 at 10:56:25AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm looking at using the pointer returned from lua_topointer() as an > index into a weak-keyed table, but it's not obvious whether Lua might > ever change these pointers during the execution of my scripts (ie > whether a gc cycle might moving things around internally). Lua's GC is not a moving GC. From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 08:09:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BB9G1D026779; Tue, 11 Aug 2009 08:09:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 226EE19298; Tue, 11 Aug 2009 08:08:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63DAC1928D for ; Tue, 11 Aug 2009 08:08:50 -0300 (BRT) Received: by pzk28 with SMTP id 28so3493989pzk.11 for ; Tue, 11 Aug 2009 04:08:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.52.5 with SMTP id z5mr864540wfz.135.1249988928990; Tue, 11 Aug 2009 04:08:48 -0700 (PDT) In-Reply-To: <4A814049.3040206@gmail.com> References: <4A814049.3040206@gmail.com> Date: Tue, 11 Aug 2009 04:08:48 -0700 Message-ID: <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> Subject: Re: How reliable is lua_topointer() ? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Lawrie, On Tue, Aug 11, 2009 at 2:56 AM, Lawrie Nichols wrote: > I'm looking at using the pointer returned from lua_topointer() as an index > into a weak-keyed table, but it's not obvious whether Lua might ever change > these pointers during the execution of my scripts (ie whether a gc cycle > might moving things around internally). > > I'm guessing that for userdata, ghe pointer cannot be changed (since Lua has > no way of knowing the relevance of the data pointed to in the userdata), but > I'm not so sure whether this would hold true for functions/tables. > > I've had a look at the PiL on lua_topointer(), and all that says is that the > pointer cannot be used to to retrieve what was being pointed to. > > To be honest, from trying it out, there doesn't seem to be any issues, but > I'd like to be sure. I have not encountered an instance where lua_topointer is necessary. You can instead use luaL_ref and luaL_unref for an integer reference into the lua registry. Instead of pushing your light userdata with the void pointer you stored, you can use this: lua_rawgeti(L, LUA_REGISTRYINDEX, index); -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 09:39:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BCdJ6Z007097; Tue, 11 Aug 2009 09:39:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 007F2192C1; Tue, 11 Aug 2009 09:38:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FF7B1928F for ; Tue, 11 Aug 2009 09:38:42 -0300 (BRT) Received: from [192.168.254.14] (os-dsl-0882.bmts.com [216.183.155.115]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n7BCcVY0026769 for ; Tue, 11 Aug 2009 08:38:39 -0400 Message-ID: <4A81661F.9020205@hempeldesigngroup.com> Date: Tue, 11 Aug 2009 08:37:51 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> <20090811072254.GS27413@pruts.nl> In-Reply-To: <20090811072254.GS27413@pruts.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ico Doornekamp wrote: > I usually post new messages to a mailing list by replying to the list, > and then removing the In-Reply-To header before sending it off, because > I'm too laze to look up the list address. Or, you could just add the list to your address book...and let the autocompletion feature of most mailers find it after typing in a few letters. Ralph From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 09:45:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BCjYj0008177; Tue, 11 Aug 2009 09:45:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAD62192CF; Tue, 11 Aug 2009 09:45:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACC8C192BD for ; Tue, 11 Aug 2009 09:45:06 -0300 (BRT) Received: by fxm25 with SMTP id 25so3545433fxm.5 for ; Tue, 11 Aug 2009 05:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=h7yBhrbFAbUpQ6xzL1uI476CY2iVWj9Mk60aE69SqXI=; b=U4D4PnEjzqUJ+SpjbtdVBJOpJf4Ng6Un9XGffRWqwwiufOIiO2c+y0ZNDeKwHkcsve C5tK94LVxN0ErQXLnw3iWmsY8n08U3+pwbPOGuWwPMvrksqitY2KY3ps63moMMSrEEUs lqGVjTL4r8+f8WFEnM5l+ymSTE5Du1lH2EzqY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cEKhV0hpjkJeOL8v+AP3UtFGSEkyV1P2pi1IM6lWuSpDZ7kSlmvkDVsiXCEwU7TFA2 7uxfUOy3pzj/nki6pWbz727bTCDoofPdbVSo3yKH+uXmuhOIxLt5btld9tXJK1sxU5Jh q7rEifZdchzDPj1ZjSCIf4+qVTIq/KPHlCgVI= MIME-Version: 1.0 Received: by 10.239.174.76 with SMTP id i12mr588128hbf.62.1249994704720; Tue, 11 Aug 2009 05:45:04 -0700 (PDT) In-Reply-To: <20090811112400.w3s5euk96scwwogg@webmail.tuwien.ac.at> References: <20090811112400.w3s5euk96scwwogg@webmail.tuwien.ac.at> Date: Tue, 11 Aug 2009 14:45:04 +0200 Message-ID: <560972290908110545t5e68b915q521458b621b6e7a7@mail.gmail.com> Subject: Re: How do you document C++Lua interfaces? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 11, 2009 at 11:24 AM, Sebastian Wolff wrote: > Most modules I found in the WWW are not documented yet in terms of C++ AND > Lua API. LuaDoc can be fooled by feeding it pseudo-Lua files, like the example for LuaFileSystem. Some developers, like Wolfgang Oertl with his LuaGnome, use a modified form of LuaDoc to work on C/C++ files as well. Then the parallel sets of documentation can at least exist in the same files. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 09:54:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BCss6L009591; Tue, 11 Aug 2009 09:54:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 085CC192E0; Tue, 11 Aug 2009 09:54:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9112F192A8 for ; Tue, 11 Aug 2009 09:54:24 -0300 (BRT) Received: by fxm25 with SMTP id 25so3551320fxm.5 for ; Tue, 11 Aug 2009 05:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tb1EEmDthrDemPxsK7PiqVZyucrPw/w9BzBZA/7CAyA=; b=mHQMrAi4wJKYArwy5I7+eIyXii4JEv/0obAOgt0M2yippfpevuG9mgh5F3L72wLll+ 9QFig3kwWQL0ZP6KrxmToaUXOHs60+DrSCmAEZvlqMkoDV3B/vWhvKRNO4RhDUK5/iPj oZbCRF6116YuNQtseiZ8YMMoCxvfF6iih7VrU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kO4PIjxtpVYGZr/nwnZAP8jeNNCLJacfL3/7T+4vyyk9fxwf8aXR9VayLlRo5SyvZt Tg3igsHztrQIRsjIjbVOsZprowX3P8e/AGEch+vvG79GahHGBxkRxuvctNt74qKRTn6O VN8pgIDVcgHBsfIdmcjjSSwxS21T+fpi5b3QM= MIME-Version: 1.0 Received: by 10.223.105.72 with SMTP id s8mr1263351fao.44.1249993583088; Tue, 11 Aug 2009 05:26:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2009 13:26:23 +0100 Message-ID: <6a3ae47e0908110526g8eb965dr62c0dbc7cf63d179@mail.gmail.com> Subject: Re: break operator From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=0016e6d27c907dd2d70470dccf3c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d27c907dd2d70470dccf3c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Tue, Aug 11, 2009 at 11:45 AM, Eike Decker wrote: > Hi, > I recently had a loop where I had to read a value that looped like this: > > while true do > local line = readline() > if not line then break end > ... > end > > I know that there are ways how to write this in a nicer way (i.e. > having an iterator function), but wouldn't it be more nice if this > would work as well this way: > > while true do > local line = readline() or break > ... > end > > I think it would break some relationship to have a language feature > like that - however it simply looks so much nicer... Of course this > concept could be used in a coroutine environment, i.e. having a "stop" > function that yields the coroutine, i.e. > > while true do > local line = readline() or stop() > ... > end > > which looks already quite nice... > > cheers, > Eike This looks a lot like Icon (http://www.cs.arizona.edu/icon/). Robby --0016e6d27c907dd2d70470dccf3c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Aug 11, 2009 at 11:45 AM, Eike Decke= r <zet23t@goo= glemail.com> wrote:
Hi,
I recently had a loop where I had to read a value that looped like this:
while true do
=C2=A0local line =3D readline()
=C2=A0if not line then break end
=C2=A0...
end

I know that there are ways how to write this in a nicer way (i.e.
having an iterator function), but wouldn't it be more nice if this
would work as well this way:

while true do
=C2=A0local line =3D readline() or break
=C2=A0...
end

I think it would break some relationship to have a language feature
like that - however it simply looks so much nicer... Of course this
concept could be used in a coroutine environment, i.e. having a "stop&= quot;
function that yields the coroutine, i.e.

while true do
=C2=A0local line =3D readline() or stop()
=C2=A0...
end

which looks already quite nice...

cheers,
Eike


This looks a l= ot like Icon (http://www.cs.ari= zona.edu/icon/).

Robby
=C2=A0
--0016e6d27c907dd2d70470dccf3c-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 10:02:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BD2u44011036; Tue, 11 Aug 2009 10:02:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4500192EE; Tue, 11 Aug 2009 10:02:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F234A192BA for ; Tue, 11 Aug 2009 10:02:29 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7BD2TNI020259 for ; Tue, 11 Aug 2009 10:02:29 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id B5AC554C11A; Tue, 11 Aug 2009 10:02:29 -0300 (BRT) Date: Tue, 11 Aug 2009 10:02:29 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: break operator Message-ID: <20090811130229.GB5917@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > [...] Of course this > concept could be used in a coroutine environment, i.e. having a "stop" > function that yields the coroutine, i.e. > > while true do > local line = readline() or stop() > ... > end > > which looks already quite nice... Just do 'stop = coroutine.yield'. -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 10:10:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BDApVj012749; Tue, 11 Aug 2009 10:10:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7892A192DF; Tue, 11 Aug 2009 10:10:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97D14192D0 for ; Tue, 11 Aug 2009 10:10:20 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:39704) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1Mar7I-0008Qw-4J (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Tue, 11 Aug 2009 14:10:16 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mar7I-0004Qz-AO (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Tue, 11 Aug 2009 14:10:16 +0100 Date: Tue, 11 Aug 2009 14:10:16 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua list Subject: Re: LuaJIT performance In-Reply-To: <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> Message-ID: References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009, Mark Hamburg wrote: > On Aug 10, 2009, at 11:58 AM, Tony Finch wrote: > > > > What tracing JITs are there other than TraceMonkey and LuaJIT2? > > TraceMonkey is the poster child for tracing JITs at this point, I think, and > V8 is generally reported to be faster. I don't know what the status is on > Tamarind Tracing. Oh yes, I forgot about Tamarin which (IIRC) was an ancestor of TraceMonkey developed by Adobe for ActionScript. AFAIK V8 isn't a trace JIT: it has a Self-style backend. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 10:12:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BDCZkJ013185; Tue, 11 Aug 2009 10:12:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFD01192F6; Tue, 11 Aug 2009 10:12:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s22.bay0.hotmail.com (bay0-omc1-s22.bay0.hotmail.com [65.54.246.94]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84630192F2 for ; Tue, 11 Aug 2009 10:12:09 -0300 (BRT) Received: from BAY119-W25 ([207.46.9.60]) by bay0-omc1-s22.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 06:12:06 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_107a3051-5bd8-4d47-ab35-992fd278f8fd_" X-Originating-IP: [82.10.105.191] From: tim pynegar To: Lua Subject: =?windows-1256?Q?Integer_-_?= =?windows-1256?Q?Number_con?= =?windows-1256?Q?version=2C_c?= =?windows-1256?Q?omparison_?= =?windows-1256?Q?issue=FE?= Date: Tue, 11 Aug 2009 13:12:06 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 11 Aug 2009 13:12:06.0713 (UTC) FILETIME=[537CA290:01CA1A85] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_107a3051-5bd8-4d47-ab35-992fd278f8fd_ Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: 8bit Hi, I've got a problem passing in an Integer from C++ into the Lua program. I'm using the following code to pass the variable in. lua_pushinteger (state, iInt); The issue is that the type of the parameter that comes through into the lua function always seems to be "number". The values i'm trying to use are 32 bit hash's so the have the top bits set most of the time. function this.HandleEvent( this, id, to, param ) trace( "In HandleEvent" ) -- EVENT_ACTIVATE if( id == 0x88D37A6C ) then return 3 -- EVENT_DEACTIVATE elseif( id == 0x80AAE13F ) then return 2 -- UNHANDLED else return id end end The value returned is always the "id" that i sent in and that's no problem. The issue is that neithre of the if comparisons work. I've tested out using these values and comparing the hex version against the decimal version in an equality operator and it's compares fine. I've tried on the pre built .exe the following if( 2158682431 == 0x80AAE13F ) then io.write( "Hello" ) end and i've tried quierying what type each of these are such as io.write( type( 0x80AAE13F ) ) and they come back as numbers. So i'm a little confused as lua seems fine dealing with these 32 bit integers but when it comes to passing in my own it seems to fail the comparision operation but then is happy to return back the same value that i pass in. Thanks, Tim. --_107a3051-5bd8-4d47-ab35-992fd278f8fd_ Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: 8bit Hi,
 
I've got a problem passing in an Integer from C++ into the Lua program. I'm using the following
code to pass the variable in.
 
lua_pushinteger (state, iInt);
 
The issue is that the type of the parameter that comes through into the lua function always
seems to be "number". The values i'm trying to use are 32 bit hash's so the have the top bits
set most of the time.
 

function this.HandleEvent( this, id, to, param )
trace( "In HandleEvent" )
-- EVENT_ACTIVATE
if( id == 0x88D37A6C ) then
     return 3
-- EVENT_DEACTIVATE
elseif( id == 0x80AAE13F ) then
     return 2
-- UNHANDLED
else
    return id
end
end
 
The value returned is always the "id" that i sent in and that's no problem. The issue is that
neithre of the if comparisons work. I've tested out using these values and comparing the
hex version against the decimal version in an equality operator and it's compares fine.
 
I've tried on the pre built .exe the following
 
if( 2158682431 == 0x80AAE13F ) then
io.write( "Hello" )
end
 
and i've tried quierying what type each of these are such as
 
io.write( type( 0x80AAE13F  ) )
 
and they come back as numbers. So i'm a little confused as lua seems fine dealing with these
32 bit integers but when it comes to passing in my own it seems to fail the comparision operation
but then is happy to return back the same value that i pass in.
 
Thanks,
Tim.
--_107a3051-5bd8-4d47-ab35-992fd278f8fd_-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 10:18:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BDIfXV014524; Tue, 11 Aug 2009 10:18:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EDF2192F7; Tue, 11 Aug 2009 10:18:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F89F192DD for ; Tue, 11 Aug 2009 10:18:14 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so890927eyd.11 for ; Tue, 11 Aug 2009 06:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=/9NDPbhuq2YE6PqM5nle72u1iM4a6uOWQrQw1E+lqcw=; b=pNHV0EOft6Rctmx2lqoYBXOceCiKsXl3K0mQxYs5jeaTCscYi+3WiEjnaEvIwqQxhH oop5rq7QjB3Uu++ZKW5reAWy4cccr/2CQl3L+9HZ1O39+T9hI5xprjtPif0cdTHSq+vD YmFc5lRPJpCFPvfY7Ro93nLPD0IObK5711Aak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=NxF3pH1Ws/+9mC1ziDrkp9k8yI2pgg4xxgO/9efXs12xOt7gLIdL8EtcxHIOxkVR52 koKzI2/UtpRqOLjCfSZIbkagYqb7YY0m2vwE/4g/1FfA37Og0o2to3IWli7aOTNkIvUz ntC0Oop7Rz9DzH83VuMs/7RylOCCi0SjAjcx4= MIME-Version: 1.0 Received: by 10.216.19.68 with SMTP id m46mr1296167wem.7.1249996690571; Tue, 11 Aug 2009 06:18:10 -0700 (PDT) Date: Tue, 11 Aug 2009 14:18:10 +0100 Message-ID: Subject: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi List, Back in June, somewhere in the middle of a thread that threw around various ideas about the next version of Lua, I made a syntax suggestion that I'd like to bring up again. I'm planning to get a patch implemented to see how it feels to use and also to see how much code change would be required - I made a start on this, but I'm still not all that familiar with Lua's internals, so it might take a while. My proposal is that if '...' appears just before a comma (in either the list of arguments in a function call, a separator between two array elements in a table constructor, or the right hand side of a multiple variable assignment) or a semicolon (in the case of a separator between two array elements only) then it changes the meaning of that comma or semicolon. Instead of truncating or expanding the list of values that result from evaluating the expression that preceded it, the full list is preserved. Here is an example of how I would expect Lua code to look and act with such a change: ----- function multivalues() return 1, 2, 3 end function printvalues(a,b,c,d,e,f) print('"' .. tostring(a) .. ',' .. tostring(b) .. ',' .. tostring(c) .. tostring(d) .. ',' .. tostring(e) .. ',' .. tostring(f) .. '"') end -- Function calls printvalues(multivalues(), 4, 5, 6) --> "1,4,5,6,nil,nil" printvalues(multivalues()..., 4, 5, 6) --> "1,2,3,4,5,6" -- Array constructors ar = {multivalues(), 4, 5, 6} --> {1,4,5,6} ar2 = {multivalues()..., 4, 5, 6} --> {1,2,3,4,5,6} -- RHS of variable assignments p,q,r,s,t,u = multivalues(), 4, 5, 6 --> p=1, q=4, r=5, s=6, t=nil, u=nil p,q,r,s,t,u = multivalues()..., 4, 5, 6 --> p=1, q=2, r=3, s=4, t=5, u=6 ----- If '...' appears after an expression in any other context, I think it should be ignored, rather than causing an error. This is mainly so that people can use it on the last element of a list if they wish - even though the full expansion would still happen without it. When I originally suggested this a few people said that it looks odd, particularly in the case of ... ... - I don't really have any argument for that, it *is* a bit odd. But hopefully, not too odd to be given consideration. To me, using ... in this way has a kind of symmetrical elegance, as it already has a meaning of "accommodate a variable number of values" - but in this case it would mean, accommodate a variable number of *output* values, rather than input. A previous idea with a similar intention was to change the meaning of the semicolon inside an array constructor. See "Extend table constructor syntax to allow multiple expansion of multireturn functions" in the LuaPowerPatches page of the Lua Users' Wiki for a patch that implements this. I think my proposal has two advantages over it: - It does not change the meaning of existing valid code. - It would work not only for array elements in table constructors, but also the parameters of a function call and the right-hand side of a multiple variable assignment. So, what do people think? Is it something you'd ever use? Is it just too ugly and weird? -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 10:21:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BDLFTG015074; Tue, 11 Aug 2009 10:21:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32D81192FD; Tue, 11 Aug 2009 10:20:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10A8A192F9 for ; Tue, 11 Aug 2009 10:20:48 -0300 (BRT) Received: by ewy26 with SMTP id 26so4001398ewy.5 for ; Tue, 11 Aug 2009 06:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EkcUiA1+dh71uHcnsETrRv1pWgGO6/vdJuRIKwbM7ho=; b=xwcO2sSckLJKgB8AayNMKkd50I78EMvR5ZcFtqCpGEBWCfzV3C+Sk8JjRjU1QLpZCy PuNYIzij+wvOJwYUwBKtXFc7SOPHIaRjRJQkUqx7EdlpSMdMnulskbWwjT568/DYEr9F gg4Hx97iCNlx7SGEkxRWxA3FR2qhWwD3vT5Xc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wq+hJ/TqeDvxNY1arQq07C4gaH2fTO+ww2djFnAaBeaO9mqaU1ksQsSYHOH8Zgzm3D nWpBOjDJA9tbIC/hwpwHOxeOAoA28jLzS4G3Wg3Df4PfOQg9FnwcHcuh7Kxtv2TdFgl5 2HVPQ2JpNIC+c7/MD0ldstJluCc64NTSRlAT0= MIME-Version: 1.0 Received: by 10.216.7.141 with SMTP id 13mr1254861wep.24.1249996846627; Tue, 11 Aug 2009 06:20:46 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2009 15:20:46 +0200 Message-ID: Subject: =?UTF-8?Q?Re=3A_Integer_=2D_Number_conversion=2C_comparison_issue=E2=80=8F?= From: Erik Lindroos To: Lua list Content-Type: multipart/alternative; boundary=0016364c7b99037b970470dd92dd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364c7b99037b970470dd92dd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/8/11 tim pynegar > Hi, > > I've got a problem passing in an Integer from C++ into the Lua program. I'm > using the following > code to pass the variable in. > > lua_pushinteger (state, iInt); > The integer is signed and can't hold a number such as 0x88D37A6C, it will probably turn into a negative number. Use lua_pushnumber to pass such large integers. --0016364c7b99037b970470dd92dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2009/8/11 tim pynegar <tpynegar@hotmail.com>
=
Hi,
=A0
I've got a problem passing in an Integer from C++ into th= e Lua program. I'm using the following
code to pass the variable in= .
=A0
lua_pushinteger (state, iInt);

The integer is signed and can't hold a number su= ch as 0x88D37A6C, it will probably turn i= nto a negative number. Use lua_pushnumber to pass such large integers.
<= /font>
--0016364c7b99037b970470dd92dd-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 11:18:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BEIBdt026868; Tue, 11 Aug 2009 11:18:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6275319318; Tue, 11 Aug 2009 11:17:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 154DE1930F for ; Tue, 11 Aug 2009 11:17:30 -0300 (BRT) Received: by ewy26 with SMTP id 26so4047382ewy.5 for ; Tue, 11 Aug 2009 07:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Aj1egciYMSwLgZHqOEiXSx/XmLwEGc+78gnu6iqvDfw=; b=eeb7xbxonNXVUWeIvkRih8sfnPHRSur4HM/D/8A1RxUqj/21myQkERfL53MMsTad1/ Nl+UUuSyEsfUs2a1y6gtgwLSQ2RCBZCUzp6X8hpC0C6bKBGmEZ6zBshqKjTJtTmKYQrM /3oky+0lKBem7/deFPm/6WAjfM/jrtxjW+dms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=ncmeCHcBoOcYulqiSFfgYEDERl2KwTiFoIIKxr8UGIPSaVGFfAA2/X7in/zU/4cIc4 9RUhffgoD3UDeUzCd6t+zth+5zQMYzdU5GbpF8bqI1WBpPRrSrtZ1DsNezwj7+MjIEGx OnHnpfnN1x3iN+3t2FKvLUGLbuBlOv/k6PZCA= Received: by 10.210.13.12 with SMTP id 12mr989088ebm.63.1250000249232; Tue, 11 Aug 2009 07:17:29 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 7sm14868534eyb.50.2009.08.11.07.17.28 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 07:17:28 -0700 (PDT) Message-ID: <4A817D77.3020308@gmail.com> Date: Tue, 11 Aug 2009 15:17:27 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: Re: How reliable is lua_topointer() ? References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> In-Reply-To: <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Patrick thanks, but it's really the pointers I'm looking for. Firstly, I need to be able to store UD pointers in a weak-keyed table so that I can look it up based on a pointer coming into a C callback, and I need to be sure that Lua is going to return the same pointer for the given UD each time. Secondly, I wanted to know whether storing a pointer to a function in a given table could be used later to determine whether the function had been updated in that table (since __nexindex only notifies of new items in a table, it's quite awkward to figure out if a function has been updated, and using UDs as proxies is real slow...). Obviously, if the function pointer might be updated by Lua, this wouldn't work, but as it is I think I'm going to try using it :-) Finally, not too sure if refs work in weak-referenced tables.... Thanks for the pointer (no pun intended) anyway, Lawrie On 11/08/09 12:08, Patrick Donnelly wrote: > Hi Lawrie, > > On Tue, Aug 11, 2009 at 2:56 AM, Lawrie Nichols wrote: > >> I'm looking at using the pointer returned from lua_topointer() as an index >> into a weak-keyed table, but it's not obvious whether Lua might ever change >> these pointers during the execution of my scripts (ie whether a gc cycle >> might moving things around internally). >> >> I'm guessing that for userdata, ghe pointer cannot be changed (since Lua has >> no way of knowing the relevance of the data pointed to in the userdata), but >> I'm not so sure whether this would hold true for functions/tables. >> >> I've had a look at the PiL on lua_topointer(), and all that says is that the >> pointer cannot be used to to retrieve what was being pointed to. >> >> To be honest, from trying it out, there doesn't seem to be any issues, but >> I'd like to be sure. >> > I have not encountered an instance where lua_topointer is necessary. > You can instead use luaL_ref and luaL_unref for an integer reference > into the lua registry. Instead of pushing your light userdata with the > void pointer you stored, you can use this: > > lua_rawgeti(L, LUA_REGISTRYINDEX, index); > > From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 11:20:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BEKGXc027403; Tue, 11 Aug 2009 11:20:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC13A1931E; Tue, 11 Aug 2009 11:19:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 426021930E for ; Tue, 11 Aug 2009 11:19:50 -0300 (BRT) Received: by fxm25 with SMTP id 25so3608444fxm.5 for ; Tue, 11 Aug 2009 07:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZcWjwWYVrsg3uFDgfGwOaapGpcmQZx4OF3P1waDcDcA=; b=m9Q0rPuCZAsTio4sIbeZ0hL5GD0NDrqIcIs9rL1u9/MGny1euES78H844uLDYAhX4n 0A7c4EyrGT+MddUqlWUklEwavUe/MlT57pEvfCHWJu9MIqLphqubRRwZy87R6RmHs0+q UvUxvma3eQ4HRiZsyJMCjV65seUgudt8AMzJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oiOrQi+7afQe5xzWFI5WqaL/1H9rG2LSynbodVk7SgFxa/op7BfYM6DK5Qd/fdlMvF 4NsJQ1y+w5kabMChGD3ntcQTiXtDXazA71qQnVc1pUYlsxAYXi376diH0HQxF4Tk/aBw 0r/WQr5gb9LxyYNhSeIaGeUpuwh7jtG7xkAjU= MIME-Version: 1.0 Received: by 10.204.100.201 with SMTP id z9mr2503863bkn.8.1249998521892; Tue, 11 Aug 2009 06:48:41 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2009 15:48:41 +0200 Message-ID: <9386fb2d0908110648s2a8e173ex72595f96b5da9de0@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've been missing this a number of times recently, i'd certainly like and use it. Maybe > When I originally suggested this a few people said that it looks odd, > particularly in the case of ... ... - I don't really have any argument > for that, it *is* a bit odd. If ... seems wierd, it shouldn't be too hard to change it to something else, right? maybe a ~? ...~ multivalues()~ From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 11:28:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BESguL028822; Tue, 11 Aug 2009 11:28:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B342D19324; Tue, 11 Aug 2009 11:28:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98E2B1930E for ; Tue, 11 Aug 2009 11:28:03 -0300 (BRT) Received: by ywh29 with SMTP id 29so247207ywh.33 for ; Tue, 11 Aug 2009 07:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=gUZ+Rq4LtIbQxiGVADBSiFdcRbtSihEX3Y/B9SC5TWo=; b=N42WD60iKAuqcT7SXlCoTf7fy5Y1g/M/0N2mWMGlA2OcZ6H4r1y2UgexRI1u0TAI4R Y9xORDmSayItJgA8vv9owrO4JBC/gyoqrajPMCJRV2Hdk+9gkL2yKBGM9WeSnSW3B8Ct iRs0qY8AgGyk06jSigTFsf7h8fFFhUl82tYnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=SHLSZ6QEAGCyRZir8WzgWeSFm9RoWfJcNhvMiJodEyuSBxM63J7Uywfpr6bNejXQBd yGVX/QhECf4IMnRPkF0A79FyxhO+PAX0QrDvY6fy5ypDCg5fwP6QxMQJ2tYYtdZCViEZ VwnMKazCQpmT4KMUkSVHj0zcdyqgrY/JhLF+s= MIME-Version: 1.0 Received: by 10.100.96.4 with SMTP id t4mr5377321anb.170.1250000881283; Tue, 11 Aug 2009 07:28:01 -0700 (PDT) In-Reply-To: <4A817D77.3020308@gmail.com> References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> From: "Thomas Harning Jr." Date: Tue, 11 Aug 2009 10:27:41 -0400 Message-ID: Subject: Re: How reliable is lua_topointer() ? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 11, 2009 at 10:17 AM, Lawrie Nichols wrote: > Hi Patrick > > thanks, but it's really the pointers I'm looking for. Firstly, I need to be > able to store UD pointers in a weak-keyed table so that I can look it up > based on a pointer coming into a C callback, and I need to be sure that Lua > is going to return the same pointer for the given UD each time. > > Secondly, I wanted to know whether storing a pointer to a function in a > given table could be used later to determine whether the function had been > updated in that table (since __nexindex only notifies of new items in a > table, it's quite awkward to figure out if a function has been updated, and > using UDs as proxies is real slow...). Obviously, if the function pointer > might be updated by Lua, this wouldn't work, but as it is I think I'm going > to try using it :-) > > Finally, not too sure if refs work in weak-referenced tables.... Pointer's wouldn't work either (if I have that right)... assuming you're pushing them as lightuserdata, my guess is that they behave just like strings and numbers would, since they are a 'primitive' type. Also... the GC has no clue that a lightuserdata is equivalent to a given userdata, table, function when iterating for cleanup, so the GC wouldn't even be able to mark the two items as the same.... now.. that's assuming weak-keyed... As for weak-valued, then both lightuserdata and luaL_ref and the like would work correctly (I think) .. just that there'd be holes showing up over time. If the holes can be re-filled by new data and re-returned through luaL_ref ... I don't know.... implementation defined. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 11:52:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BEqCe7002222; Tue, 11 Aug 2009 11:52:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08C2C1932C; Tue, 11 Aug 2009 11:51:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E51919322 for ; Tue, 11 Aug 2009 11:51:39 -0300 (BRT) Received: by ewy26 with SMTP id 26so4076653ewy.5 for ; Tue, 11 Aug 2009 07:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=dlMi8K2Y/pIfuRJh05tSBvq9li25ehZ68j2rVtcq5ek=; b=r8bVA/efVzOXcUlgR2bMAclpQtUtFBGiYdTaFqqgf3lSjGVmFiRGbEhpfkCO+/LN8i R0XNTeU3HQJLU2V3D5bG9FgYTZuhjbpwk8ue8nKUlEVKBfGej0pHtRw4APww2k5fIs5i Z0zjzgXtEuHRioiEuGn74/TzDbNZuiRtlkl3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=MXLD+zZov8I1MMQIX4JF7/l6rK8NSJTUMn6VxnRD2+jGEQOj612qRHV7AfRbatgk9g /XcVy6dioHEQxjjVTRopM1bw7139aCPBwXyHe9n+6SQ2wVDUtMDwCRx/fyYiYiFSxubU FSfMNC/ltLUhT/dM6+Y7ECFK02Fsuta0uiky4= Received: by 10.211.202.14 with SMTP id e14mr6558725ebq.50.1250002297821; Tue, 11 Aug 2009 07:51:37 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 10sm3089523eyz.11.2009.08.11.07.51.37 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 07:51:37 -0700 (PDT) Message-ID: <4A818578.8070102@gmail.com> Date: Tue, 11 Aug 2009 15:51:36 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: Re: How reliable is lua_topointer() ? References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Thomas On 11/08/09 15:27, Thomas Harning Jr. wrote: > Pointer's wouldn't work either (if I have that right)... assuming > you're pushing them as lightuserdata, my guess is that they behave > just like strings and numbers would, since they are a 'primitive' > type. Also... the GC has no clue that a lightuserdata is equivalent > to a given userdata, table, function when iterating for cleanup, so > the GC wouldn't even be able to mark the two items as the same.... > now.. that's assuming weak-keyed... > Sorry, bit of brain-fade. I meant weak-valued table (light ud pointer as key, UD as value). > As for weak-valued, then both lightuserdata and luaL_ref and the like > would work correctly (I think) .. just that there'd be holes showing > up over time. If the holes can be re-filled by new data and > re-returned through luaL_ref ... I don't know.... implementation > defined. > Hmm...quick look in PiL doesn't add anything here. Not too sure what happens if you try and unref something that's already been removed by the GC.... Lawrie From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 11:57:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BEvOm6003636; Tue, 11 Aug 2009 11:57:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DD3519331; Tue, 11 Aug 2009 11:57:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60F961932B for ; Tue, 11 Aug 2009 11:56:58 -0300 (BRT) Received: from 75-164-85-75.tcso.qwest.net ([75.164.85.75]:2302 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MasmL-0004PC-2o for lua@bazar2.conectiva.com.br; Tue, 11 Aug 2009 10:56:45 -0400 Message-ID: <45E2B6DF2ADF4B7E97ADE9E474D1D326@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <00e101ca175b$5b618160$12248420$@com.au><049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net><20090809150458.GA15804@mike.de><20090810013307.GA18673@mike.de><25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com><8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> Subject: Re: How to create multi-dimensional table in C? Date: Tue, 11 Aug 2009 07:57:09 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Peter, Thank you very much for the help. That solved my problem! Michael ----- Original Message ----- From: "Peter Cawley" To: "Lua list" Sent: Monday, August 10, 2009 5:15 PM Subject: Re: How to create multi-dimensional table in C? On Tue, Aug 11, 2009 at 1:11 AM, Michael Newberry wrote: > // Now stack looks like -2: RowTable, -1: ColumnTable > // How do I do the equivalent of RT[ j ] = CT? lua_rawseti(L, -2, j); That'll set the item on the top of the stack (CT) to index j of the table at -2 (RT). lua_newtable( L ); // push a Row Table (the main table) onto the stack for ( int j = 1; j <= nRows; j++ ) { lua_newtable( L ); // push a Column Table onto the stack for ( int i = 1; i <= nCols; i++ ) { lua_pushnumber( L, i ); lua_pushstring( L, sValue ); lua_settable( L, -3 ); } lua_rawseti(L, -2, j); // RT[j] = CT } From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 12:17:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BFH9qo008170; Tue, 11 Aug 2009 12:17:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C819019343; Tue, 11 Aug 2009 12:16:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C911119328 for ; Tue, 11 Aug 2009 12:16:42 -0300 (BRT) Received: by fxm25 with SMTP id 25so3648525fxm.5 for ; Tue, 11 Aug 2009 08:16:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.193.6 with SMTP id v6mr133800mup.57.1250003800239; Tue, 11 Aug 2009 08:16:40 -0700 (PDT) In-Reply-To: <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> Date: Tue, 11 Aug 2009 10:16:40 -0500 Message-ID: <90eb1dc70908110816r6f96d40ana0f45d4fad238f9e@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 11, 2009 at 2:17 AM, Patrick Donnelly wrote: > Pressing "Reply" works just fine in Gmail. Some e-mail providers just > suck I guess : / no it doesn't. it just (wrongly) joins messages by subject instead of real threads. -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 12:20:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BFK1bW008647; Tue, 11 Aug 2009 12:20:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2153B19348; Tue, 11 Aug 2009 12:19:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89CFE19338 for ; Tue, 11 Aug 2009 12:19:32 -0300 (BRT) Received: by fxm25 with SMTP id 25so3650767fxm.5 for ; Tue, 11 Aug 2009 08:19:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.49.7 with SMTP id b7mr1345876muk.25.1250003971054; Tue, 11 Aug 2009 08:19:31 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2009 10:19:31 -0500 Message-ID: <90eb1dc70908110819i2e2b90a2h92905bb1da7646ec@mail.gmail.com> Subject: Re: break operator From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7BFK1bW008647 On Tue, Aug 11, 2009 at 5:45 AM, Eike Decker wrote: > but wouldn't it be more nice if this > would work as well this way: > > while true do >  local line = readline() or break >  ... > end emulating english isn't a worthwhile goal in my book -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 13:17:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BGHjar020156; Tue, 11 Aug 2009 13:17:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D03C1934E; Tue, 11 Aug 2009 13:17:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.tuwien.ac.at (webmail.tuwien.ac.at [128.130.35.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C366319344 for ; Tue, 11 Aug 2009 13:16:59 -0300 (BRT) Received: from webmail.tuwien.ac.at (localhost [127.0.0.1]) by webmail.tuwien.ac.at (8.13.1/8.13.1) with ESMTP id n7BGGvWR017195 for ; Tue, 11 Aug 2009 18:16:57 +0200 Received: (from apache@localhost) by webmail.tuwien.ac.at (8.13.1/8.13.1/Submit) id n7BGGvFC017194 for lua@bazar2.conectiva.com.br; Tue, 11 Aug 2009 18:16:57 +0200 Received: from 78.142.148.74 ([78.142.148.74]) by webmail.tuwien.ac.at (Horde MIME library) with HTTP; Tue, 11 Aug 2009 18:16:57 +0200 Message-ID: <20090811181657.yx4dvbnuu8kgwk8c@webmail.tuwien.ac.at> Date: Tue, 11 Aug 2009 18:16:57 +0200 From: Sebastian Wolff To: lua@bazar2.conectiva.com.br Subject: Re: How do you document C++Lua interfaces? (steve donovan) References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.4) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks for this hint, Steve. Particularly the solution of LuaGnome looks interesting. Having the documentation in one header file side by side is indeed what I am looking for. I wonder if it is possible to hide Doxygen-specific and Lua-specific documentation from each other. When I look at http://lua-gtk.luaforge.net/reference/modules/src/gnome/boxed.c.html#lg_get_boxed_value and compare it with the source in http://luaforge.net/plugins/scmcvs/cvsweb.php/lua-gtk/src/gnome/boxed.c?rev=1.2;cvsroot=lua-gtk it looks like both blocks can reside in the very same Doxygen documentation block. The problems I see here, are: (1) How to distinguish between blocks which are entirely on the C++ side and those which are parsed by SWIG? Is that possible? (2) How to distinguish differnt parameter settings within C++ and Lua, for example something like /** \return error value \param s input string \param some_output output pointer */ int foo(std::string s, int * some_output) in C++ vs. /** \luaparam mystring input string \return error value \return some integer output */ (int,int) foo(mystring) in Lua? (3) Is it possible to use some Doxygen-alike commands, for example I would need to setup the "module" name manually as it looks like from LuaGnome. Any ideas? Do you know about more references and download pages on such modified LuaDocs? Thanks! Sebastian From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 20:02:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BN2Zpu010131; Tue, 11 Aug 2009 20:02:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EC0319323; Tue, 11 Aug 2009 20:01:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (smtp.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BE4E18C15 for ; Tue, 11 Aug 2009 20:01:43 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n7BN1a5U027894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 11 Aug 2009 20:01:39 -0300 (UYT) Subject: LuaSocket and ns3 From: Jorge To: Lua list Content-Type: text/plain Date: Tue, 11 Aug 2009 20:01:34 -0300 Message-Id: <1250031694.10013.46.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Tue, 11 Aug 2009 20:01:39 -0300 (UYT) X-Spam-Score: -0.387 () AWL,BAYES_50,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi to all. I've been using Lua for prototyping and developing communication-heavy socket-based lightweight apps. Now we are incurring in some complicated network behavior, and would like to simulate it in a network simulator. We're evaluating how to use ns-3 (a discret event network simulator written in C++) [1]. Ideally, we would like to be able to run our "production" code in the simulator. I've already got the basic Lua linking, and even bound one function (pfew!). Now to the interesting part: the socket API. ns-3 socket API [2] is broadly aligned to BSD sockets, with one major difference: is asynchronous, where sending and receiving is made trough callbacks. Of course, that makes sense in a event-driven system. The folks at ns-3 are working on a blocking API that directly mimics BSD API, to simplify running "real" apps in the simulator, but there's no promised date. So it occurred to me it could be possible to add support for ns-3 right into LuaSocket. The possibilities of that are mind-boggling (to me, at least). I've looked around, and the platform-dependant code for Unix and Windows is nicely isolated, and it doesn't seem an awful lot of code. What kind of work would be to implement that using the ns-3 API? How would it look? I suppose a dispatcher of some sort would be needed... Any ideas/insight? Jorge [1] http://www.nsnam.org/ [2] http://www.nsnam.org/doxygen/classns3_1_1_socket.html From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 20:20:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BNKVoS012528; Tue, 11 Aug 2009 20:20:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 424E81933A; Tue, 11 Aug 2009 20:20:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4059E19321 for ; Tue, 11 Aug 2009 20:20:05 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mb0dN-0006Nn-F3 for lua@bazar2.conectiva.com.br; Tue, 11 Aug 2009 23:20:01 +0000 Received: from 74.125.59.1 ([74.125.59.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Aug 2009 23:20:01 +0000 Received: from joshua by 74.125.59.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Aug 2009 23:20:01 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: Strict 'struct' pattern Date: Tue, 11 Aug 2009 23:19:51 +0000 (UTC) Lines: 42 Message-ID: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> <560972290908110206m9b8a1dbs895dc6e8c6a237cd@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 74.125.59.1 (Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.197.11 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan gmail.com> writes: > > On Mon, Aug 10, 2009 at 10:16 PM, Joshua Haberman reverberate.org> wrote: > 1 > - instances of Alice have a more efficient representation in memory. > > 2 > - since "x" and "y" are strongly typed, we can throw an error > > 3 > - you get a very efficient, backward compatible, language-independent > >  serialization format for free (protocol buffers). > > This is a good combination of features, especially if you did need to > interoperate with other languages. I am really glad you think so. > (Protocol buffers are a lot > simpler than all that IDL that gave me a headache last year, and using > XML has always seemed slightly insane) Yes. I think XML has the unfortunate combination of being completely wrong for this problem space but *appearing* to be a reasonable solution. I agree that protocol buffers are a much better solution, which is one reason that I'm spending so much effort on this project. And by the way, if you're not aware protobufs have a text format also! > And, nice for RPC. > > Does it require the Google proto compiler? Nope! When you are working in a dynamic language like Lua, no compile step will be necessary -- you'll (eventually) be able to load .proto files directly. You'll be able to include them as easily as you can include Lua source. I do have a proto compiler (which is totally separate from the Google compiler), but it is only required if you want static type safety from a static language like C++ or Java. Josh From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 20:50:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7BNoIW6017830; Tue, 11 Aug 2009 20:50:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E135D19338; Tue, 11 Aug 2009 20:49:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1038719323 for ; Tue, 11 Aug 2009 20:49:44 -0300 (BRT) Received: by ewy26 with SMTP id 26so4444091ewy.5 for ; Tue, 11 Aug 2009 16:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=u3Pr1pSlENC/wxtqm8pXseFddNBVuuZqIaitODnAeaI=; b=SshKv9mBVFdV2Y26oEf7esxC0o0aijeq6Y8hCFZOHcG6mKTsuqehC/MmW4tgP6sCF1 /v8Go3XvB5WmsSaU1GBWML/4hU/cV2yFu4YYT3jVhl4O44NnjSSEshOiIKHhQHsO/2bL KdUWEK0SRu1KeNdqhq3noCom8DbMLnBXpDlKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=v8rPV+SinAW+gO/l0vxdiasfoHkS0evc2YA2dQUJ1DcRJjK8aWczvnJX+c+maxH4y7 YutAaVNc7lJvaQk2IWp1E/Y1q6zuhk295knbEclOsPO6Ph0HaKYrCyqzUaXRUqsISCls CtrQS35Wg2iFkSwbvv8/zd11rcoSVYuxo6SHA= MIME-Version: 1.0 Received: by 10.216.30.5 with SMTP id j5mr1461688wea.209.1250034583080; Tue, 11 Aug 2009 16:49:43 -0700 (PDT) In-Reply-To: <20090811072254.GS27413@pruts.nl> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> <20090811072254.GS27413@pruts.nl> From: Jerome Vuarand Date: Wed, 12 Aug 2009 01:49:23 +0200 Message-ID: <89d273ba0908111649v663badf4v9c24633fc4f31aa8@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/11 Ico Doornekamp : > * On 2009-08-11 Patrick Donnelly wrote : > >> On Mon, Aug 10, 2009 at 9:38 PM, Asko Kauppi wrote: >> > >> > Since this still happens so often, I am bothering everyone on the list. >> > >> > Pressing 'reply' to start a new thread is easy for the poster. You get the >> > Lua list address (lua@bazar2.conectiva.com.br) without needing to copy/paste >> > or type it. >> > >> > Unfortunately, it has the following consequences: >> > >> > - it completely messes up mail clients (s.a. OS X Mail) that can show >> > discussion threads >> > i.e. the "LuaJIT performance" thread remained "clean" for quite a >> > while. Now it's merged with "How to create multi-dimensional table in C" >> > thread. >> > >> > - it messes up the threads also in the Lua list archive, so "next in thread" >> > won't actually do as it says >> > >> > PLEASE, stop this habit, and someone please take on the habit of mentioning >> > it to newcomers who don't know. >> > >> > Just press 'New message'. :) >> >> Pressing "Reply" works just fine in Gmail. Some e-mail providers just >> suck I guess : / > > The problem is not with the e-mail providers, but with the users. > > Every mail has an unique ID attached to it. If one replies to a message, > a header is included in the mail to indicate the preceeding message to > which the mail is a reply. For example, in the headers of the mail I'm > typing now you can see the line: > > In-Reply-To: <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> > > These headers are used by mail clients to keep track of threads. > > So, if you'd reply to a mail, and simply change the subject, this will > result in wrong behaviour, because the In-Reply-To header 'remembers' > the original thread the mail belongs to. > > I usually post new messages to a mailing list by replying to the list, > and then removing the In-Reply-To header before sending it off, because > I'm too laze to look up the list address. I was very surprised when I reached the current end of the LuaJIT Performance thread and didn't see any posts about muti dimensional tables. So I looked for the topic Asko mentions, and checked the content of Michael Newberry's email. AFAICT it does not contain any In-Reply-To header. It has a References header, which references the topic mentionned by Asko. I don't know what is the usage when it comes to the "References" header, and whether it should be treated as in the same thread or not. The point is that removing In-Reply-To headers wouldn't have been enough to satisfy Asko (I'm personnally totally satisfied with Michael Newberry's email client and his way to use it since my own email client didn't consider his email as in the LuaJIT performance thread). From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 21:19:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C0JtPH021086; Tue, 11 Aug 2009 21:19:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A8F119328; Tue, 11 Aug 2009 21:19:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F6FC18CD2 for ; Tue, 11 Aug 2009 21:19:23 -0300 (BRT) Received: from 75-164-85-75.tcso.qwest.net ([75.164.85.75]:3719 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mb1YU-0000Y4-1x for lua@bazar2.conectiva.com.br; Tue, 11 Aug 2009 20:19:02 -0400 Message-ID: <911501E6FDF648479FFD67BF39FECD05@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> <20090811072254.GS27413@pruts.nl> <89d273ba0908111649v663badf4v9c24633fc4f31aa8@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Date: Tue, 11 Aug 2009 17:19:34 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I apologize that my post caused trouble with some people's threaded mail readers. I'll try to do better next time. Incidentally, Asko mentioned something about "newcomers". I don't know how new a newcomer is, but I've been posting to this group occasionally for 5-1/2 years. Regards, Michael ----- Original Message ----- From: "Jerome Vuarand" To: "Lua list" Sent: Tuesday, August 11, 2009 4:49 PM Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread > 2009/8/11 Ico Doornekamp : >> * On 2009-08-11 Patrick Donnelly wrote : >> >>> On Mon, Aug 10, 2009 at 9:38 PM, Asko Kauppi >>> wrote: >>> > >>> > Since this still happens so often, I am bothering everyone on the >>> > list. >>> > >>> > Pressing 'reply' to start a new thread is easy for the poster. You get >>> > the >>> > Lua list address (lua@bazar2.conectiva.com.br) without needing to >>> > copy/paste >>> > or type it. >>> > >>> > Unfortunately, it has the following consequences: >>> > >>> > - it completely messes up mail clients (s.a. OS X Mail) that can show >>> > discussion threads >>> > i.e. the "LuaJIT performance" thread remained "clean" for quite >>> > a >>> > while. Now it's merged with "How to create multi-dimensional table in >>> > C" >>> > thread. >>> > >>> > - it messes up the threads also in the Lua list archive, so "next in >>> > thread" >>> > won't actually do as it says >>> > >>> > PLEASE, stop this habit, and someone please take on the habit of >>> > mentioning >>> > it to newcomers who don't know. >>> > >>> > Just press 'New message'. :) >>> From lua-bounces@bazar2.conectiva.com.br Tue Aug 11 22:10:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C1AUA6026981; Tue, 11 Aug 2009 22:10:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5603919338; Tue, 11 Aug 2009 22:10:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF54819321 for ; Tue, 11 Aug 2009 22:09:54 -0300 (BRT) Received: by ywh29 with SMTP id 29so785228ywh.33 for ; Tue, 11 Aug 2009 18:09:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.77 with SMTP id z13mr1877651iba.49.1250039392335; Tue, 11 Aug 2009 18:09:52 -0700 (PDT) In-Reply-To: <4A817D77.3020308@gmail.com> References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> Date: Tue, 11 Aug 2009 18:09:52 -0700 Message-ID: <790db3550908111809u20f9e126nd5a8d2bad5c44ec9@mail.gmail.com> Subject: Re: How reliable is lua_topointer() ? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 11, 2009 at 7:17 AM, Lawrie Nichols wrote: > Hi Patrick > > thanks, but it's really the pointers I'm looking for. Firstly, I need to be > able to store UD pointers in a weak-keyed table so that I can look it up > based on a pointer coming into a C callback, Light Userdata and Numbers are both considered strong references in any weak table. Also, passing a pointer to an integer on the stack is just as simple in my opinion as passing a pointer returned from lua_topointer. > Obviously, if the function pointer > might be updated by Lua, this wouldn't work, but as it is I think I'm going > to try using it :-) > > Finally, not too sure if refs work in weak-referenced tables.... > > Thanks for the pointer (no pun intended) anyway, Lua's luaL_ref and luaL_unref both work in a weak valued table so long as you eventually luaL_unref each collected item. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 00:43:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C3haAj012055; Wed, 12 Aug 2009 00:43:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EC76192E4; Wed, 12 Aug 2009 00:43:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C287F18AD6 for ; Wed, 12 Aug 2009 00:43:01 -0300 (BRT) Received: by ewy26 with SMTP id 26so4531538ewy.5 for ; Tue, 11 Aug 2009 20:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.10.8 with SMTP id 8mr7369913ebj.82.1250048579677; Tue, 11 Aug 2009 20:42:59 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2009 23:42:59 -0400 X-Google-Sender-Auth: 143417be6fb7cd72 Message-ID: Subject: Re: break operator From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7C3haAj012055 On Tue, Aug 11, 2009 at 6:45 AM, Eike Decker wrote: > ...wouldn't it be more nice if this would work as well this way: > > while true do >  local line = readline() or break >  ... > end A few Perl-like things along these lines are in [1]. [1] http://lua-users.org/wiki/MetaLuaRecipes From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 01:08:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C48hhp014836; Wed, 12 Aug 2009 01:08:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B01D192A6; Wed, 12 Aug 2009 01:08:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D980019285 for ; Wed, 12 Aug 2009 01:08:18 -0300 (BRT) Received: by ewy26 with SMTP id 26so4539436ewy.5 for ; Tue, 11 Aug 2009 21:08:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.41.14 with SMTP id o14mr1858177ebo.23.1250050096585; Tue, 11 Aug 2009 21:08:16 -0700 (PDT) In-Reply-To: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Date: Wed, 12 Aug 2009 00:08:16 -0400 X-Google-Sender-Auth: 09a1b9c28f184e48 Message-ID: Subject: Re: Strict 'struct' pattern From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7C48hhp014836 On Mon, Aug 10, 2009 at 4:16 PM, Joshua Haberman wrote: > The idea is this: you define your structure type as a protocol buffer > type. .... you could write this in a .lua file: > > Alice = upb.new_type(" >  message Alice { >    optional int32 x = 1; >    optional int32 y = 2; >  } > ") >... > - instances of Alice have a more efficient representation in memory. >  Since the set of all possible fields is known, it can be stored >  as an array with known offsets for each member instead of as a >  table keyed by "x" and "y". That's interesting. A similar type of thing might be done using one of the struct libs [1]. > my library is currently ~2300 sloc of C, and compiles to <30kb of object > code on x86.  You can check it out here (the Lua parts aren't written > yet): I had tried protocol buffers before, but it seemed somewhat bulky for what it did (added 1 MB to the binary I think). It looks like they may now have a new "lite" version [2] that much improves this. [1] http://lua-users.org/wiki/LibrariesAndBindings [2] http://groups.google.com/group/protobuf/browse_thread/thread/a7f55a418085eaed/19e95baa9dfa5526 From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 01:34:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C4Y5HF017263; Wed, 12 Aug 2009 01:34:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDB28192DF; Wed, 12 Aug 2009 01:33:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21713192AE for ; Wed, 12 Aug 2009 01:33:36 -0300 (BRT) Received: by ewy26 with SMTP id 26so4547174ewy.5 for ; Tue, 11 Aug 2009 21:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=HYqxLEKQqCoOEJG5yySyHO+yhin73n8bdjZOjwymFcI=; b=Gj6JsXcssDjs6NW+JAsdBfe7tAaID1lE7U+0Xm3nm0nSrrWu0REA2shukoG19FO23z 5wrQnJxKofXqWC2tMx4s5UD8Qb3ygZc0Pdc/eOpfYDOqtu/GFOViPYEtdiDAqZNoXIzx tQWKB/A3gFbL59okiONepdVTsqPXrz8Ud5OtU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=eskNFICm+EauZcEmTnVEIf+TwfHVdgkroCDLLE+SOhpCOdfmCCTf8Xj4tGAjVn1ya5 aA7jngSW65J6pHKo1QheI+iV0kPl2U0M7GNjEmRQpWy5SAMQXXy5RNI57ZiZCUdpj6MZ 0vhRAuUdQNJtFeACmyx1aNSDPRf9gIJW/nqlg= Received: by 10.210.34.5 with SMTP id h5mr7398510ebh.71.1250051615263; Tue, 11 Aug 2009 21:33:35 -0700 (PDT) Received: from ?95.78.88.163? ([95.78.88.163]) by mx.google.com with ESMTPS id 28sm1730277eye.54.2009.08.11.21.33.33 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Aug 2009 21:33:34 -0700 (PDT) Date: Wed, 12 Aug 2009 08:33:28 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1332668363.20090812083328@gmail.com> To: David Manura Subject: Re[2]: Strict 'struct' pattern In-Reply-To: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello David, Wednesday, August 12, 2009, 8:08:16 AM, you wrote: > I had tried protocol buffers before, but it seemed somewhat bulky for > what it did (added 1 MB to the binary I think). It looks like they i don't used it but docs mention that generated code may be optimized for speed or code size by adding directive to proto file -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 01:55:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C4stdI019004; Wed, 12 Aug 2009 01:54:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BBC319320; Wed, 12 Aug 2009 01:54:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B47219303 for ; Wed, 12 Aug 2009 01:54:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so4552842ewy.5 for ; Tue, 11 Aug 2009 21:54:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.110.5 with SMTP id i5mr1876327ebc.80.1250052866668; Tue, 11 Aug 2009 21:54:26 -0700 (PDT) In-Reply-To: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Date: Wed, 12 Aug 2009 00:54:26 -0400 X-Google-Sender-Auth: b5b5bbda25dfcc51 Message-ID: Subject: Re: Strict 'struct' pattern From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 7, 2009 at 7:59 AM, steve donovan wrote: > We all know that global variables can be a pain [1] and should be > avoided. True. Without the methods in [1], I think programming in Lua is error prone. > It would be possible (using a suitable proxy table) to enforce dynamic > type checking on field assignments, but of course this would incur a > run-time cost. There's also ways to do such things statically. My concept of how this might work is given in luanalyze [2]: -- examples/ex1.lua do --! typeimport('luaanalyze.library.standard') --! typematch('idx$', 'luaanalyze.type.number') --! checkglobals() --! checktypes() for my_idx=1,10 do local s = string local f = s.format --print(f(my_idx)) -- fails: got number expected string --print(myy_idx) -- fails: undefined global end end print(myy_idx) -- no error The special "--!" comments are Lua statements to be executed by the type checker within the context of the current lexical scope. typeimport('luaanalyze.library.standard') loads predefined types for the standard library (e.g. string). typematch associates types to variables whose name matches some pattern (thereby supporting Hungarian like conventions). checkglobals() check the AST to ensure no unbound globals are used. checktypes() evaluates the AST in a special manner, propagating types, doing basically a very rudimentary form of dataflow analysis that is extensible with metamethods. The dataflow analysis could be much improved by someone with more experience in this area and willingness to devote the time. A real example of its use is in the source code of lua2c [3], where, for example, it checks that invalid fields aren't accessed from AST node objects. [1] http://lua-users.org/wiki/DetectingUndefinedVariables [2] http://lua-users.org/wiki/LuaFish (bottom of page) [3] http://github.com/davidm/lua2c/blob/6c1da4eb84cc52cccb57805b90e6e6f74a5ef199/lib/lua2c/ast2cast.lua From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 02:26:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C5PwTM022334; Wed, 12 Aug 2009 02:25:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D134E19366; Wed, 12 Aug 2009 02:25:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth01.prod.mesa1.secureserver.net (smtpauth01.prod.mesa1.secureserver.net [64.202.165.181]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5627719358 for ; Wed, 12 Aug 2009 02:25:31 -0300 (BRT) Received: (qmail 4065 invoked from network); 12 Aug 2009 05:25:27 -0000 Received: from unknown (96.240.121.67) by smtpauth01.prod.mesa1.secureserver.net (64.202.165.181) with ESMTP; 12 Aug 2009 05:25:27 -0000 Message-Id: <1174FDEE-5B1B-41B9-8ADF-0BDF1F807368@grubmah.com> From: Mark Hamburg To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaJIT performance Date: Tue, 11 Aug 2009 22:25:28 -0700 References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> <25D9E0F5-1C22-4E98-87C0-2B1FC9A9A275@grubmah.com> <8CEC0D1F-E585-4117-9E17-29A08B8AD296@grubmah.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 11, 2009, at 6:10 AM, Tony Finch wrote: > On Mon, 10 Aug 2009, Mark Hamburg wrote: >> On Aug 10, 2009, at 11:58 AM, Tony Finch wrote: >>> >>> What tracing JITs are there other than TraceMonkey and LuaJIT2? >> >> TraceMonkey is the poster child for tracing JITs at this point, I >> think, and >> V8 is generally reported to be faster. I don't know what the status >> is on >> Tamarind Tracing. > > Oh yes, I forgot about Tamarin which (IIRC) was an ancestor of > TraceMonkey developed by Adobe for ActionScript. > > AFAIK V8 isn't a trace JIT: it has a Self-style backend. Correct V8 does fairly straightforward code generation. The point is that it seems to be outpacing Trace Monkey. (That said, I haven't seen any definitive benchmarks.) Mark From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 03:14:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C6E0os026093; Wed, 12 Aug 2009 03:14:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BC1A19370; Wed, 12 Aug 2009 03:13:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh07.mail.saunalahti.fi (emh07.mail.saunalahti.fi [62.142.5.117]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84C3E192FC for ; Wed, 12 Aug 2009 03:13:28 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 281CC18CF04 for ; Wed, 12 Aug 2009 09:13:26 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A054EA259FF; Wed, 12 Aug 2009 09:13:26 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 180DFE51AE for ; Wed, 12 Aug 2009 09:13:23 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: SVG generation in Lua Date: Wed, 12 Aug 2009 09:13:23 +0300 X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'll be doing some SVG graphics work and applied some Lumikki-kind thinking to making a simple SVG generation tool, in Lua. Currently available only by svn checkout, from: svn co svn://slugak.dyndns.org/public/2009/Svg Here's one of the sample files: -- -- ELLIPSE1.LUA -- require "svgcore" local rgb= assert(svg.rgb) print( svg.document( svg.default{ stroke_dasharray={2,2}, -- svg.ellipse{ {80,110}, {75,105}, fill="#538" }, svg.ellipse{ {80,110}, {60,40}, fill="black", stroke="red", stroke_width=25 }, svg.ellipse{ {80,110}, {35,20}, fill="#538", stroke="yellow", stroke_width=25 }, svg.ellipse{ {80,50}, {40,30}, fill="red", stroke="black", stroke_width=25 }, svg.ellipse{ {80,50}, {30,20}, fill="orange", stroke="red", stroke_width=10 }, svg.ellipse{ {80,170}, {40,30}, fill="yellow", stroke="orange", stroke_width=25 }, svg.ellipse{ {80,170}, {30,20}, fill="red", stroke="black", stroke_width=10 } } ) ) The idea is that Lua syntax is a bit nicer to craft than XML, but this also allows programmatic creation of macro-like objects (functions that create graphical objects) that can be turned around, copied etc.. SVG has a "uses" element for that, but this is more easy on the eyes (clearer code). I post this mostly to inform if anyone has a similar need. Be my guest and use it. Haven't decided the license yet. Btw, SVG + JavaScript is a perfect blend for making visually good- looking UI applications. SVG in theory support any scripting language, so maybe we can at one day have SVG+Lua viewer. -asko From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 03:20:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C6KLg1026627; Wed, 12 Aug 2009 03:20:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AC2219378; Wed, 12 Aug 2009 03:20:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh04.mail.saunalahti.fi (emh04.mail.saunalahti.fi [62.142.5.110]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE96C19374 for ; Wed, 12 Aug 2009 03:19:56 -0300 (BRT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 28A5213C026 for ; Wed, 12 Aug 2009 09:19:55 +0300 (EEST) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A052E1E08B9; Wed, 12 Aug 2009 09:19:54 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 176A82BD45 for ; Wed, 12 Aug 2009 09:19:53 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <911501E6FDF648479FFD67BF39FECD05@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread X-Priority: 3 Date: Wed, 12 Aug 2009 09:19:53 +0300 References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> <20090811072254.GS27413@pruts.nl> <89d273ba0908111649v663badf4v9c24633fc4f31aa8@mail.gmail.com> <911501E6FDF648479FFD67BF39FECD05@CAYENNE> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It's mostly been newcomers who have done this before. The issue seems to be more complex than I had envisioned. Seeing the threads in OS X Mail is a small nuisance (still not sure if it's a Mail feature-done-right or a bug?). What my main point is is how the threads are stored in the archive. We'll have to wait some more to see how the particular thread will end up in. Thanks for bearing me. :) -asko Michael Newberry kirjoitti 12.8.2009 kello 3:19: > I apologize that my post caused trouble with some people's threaded > mail readers. I'll try to do better next time. > > Incidentally, Asko mentioned something about "newcomers". I don't > know how new a newcomer is, but I've been posting to this group > occasionally for 5-1/2 years. > > Regards, > > Michael > From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 03:51:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C6pIM1029134; Wed, 12 Aug 2009 03:51:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0010D19388; Wed, 12 Aug 2009 03:50:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82EBC1937A for ; Wed, 12 Aug 2009 03:50:51 -0300 (BRT) Received: by ewy26 with SMTP id 26so4593137ewy.5 for ; Tue, 11 Aug 2009 23:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=peF/+uNra2Rqcmta3KNcgdOMaGDEXYfpXfOCasueL9s=; b=UsAkAHBfuNF+rSI8ytwsILyL0UGNOvKpQtMKEOnpIbL0aPpr0+z+PSSllZg6cIz/KD 7ID0u2W6SuONePslgLaY/t2N3jua2BrZVAlam8OZmwdFZv5HwBBHTEI1h8krNOydUxTL V94oUE5gIWENK73ptAwGnR7KXNE/nYigumG/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=dNHkKOZe+fxq/3Q34lCrHDbXw7ijNjVe3VpDMQTSUm/pgleiqQwGHD+ObKjngaYHmV A5a3Y5nSm0DG8in5nf8WLQK0p64lNmSPs4KqZxEtPTMvPGeumnapUks7or8C95VF+uZA Y9xJUQVqiQoL4FibEbtVlJiet/PdY2YjtKl2w= Received: by 10.210.79.3 with SMTP id c3mr7490360ebb.84.1250059849617; Tue, 11 Aug 2009 23:50:49 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 10sm1890379eyz.51.2009.08.11.23.50.49 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 23:50:49 -0700 (PDT) Message-ID: <4A826648.5050703@gmail.com> Date: Wed, 12 Aug 2009 07:50:48 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: How reliable is lua_topointer() ? References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> <790db3550908111809u20f9e126nd5a8d2bad5c44ec9@mail.gmail.com> In-Reply-To: <790db3550908111809u20f9e126nd5a8d2bad5c44ec9@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Patrick On 12/08/09 02:09, Patrick Donnelly wrote: > Light Userdata and Numbers are both considered strong references in > any weak table. You're absolutely right....I meant it weak-valued table (I should read my posts before hitting the send button...). > Also, passing a pointer to an integer on the stack is > just as simple in my opinion as passing a pointer returned from > lua_topointer. > Agreed. However, in my case I'll be getting a pointer (to my allocated UD) coming back from a third-party library. If I can use this pointer as the index, then that's going to be easiest for me at this stage. Thanks for the help, Lawrie From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 04:04:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C72I3e030301; Wed, 12 Aug 2009 04:02:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4BDA21938E; Wed, 12 Aug 2009 04:01:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from cdactvm.in (cdactvm.in [210.212.236.18]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CAA71937F for ; Wed, 12 Aug 2009 04:01:38 -0300 (BRT) Received: (from root@localhost) by cdactvm.in (8.12.10/8.12.10) id n7C6uHeq027670 for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 12:26:17 +0530 Received: from rccf019 ([172.16.29.19]) by cdactvm.in (8.12.10/8.12.10) with ESMTP id n7C6uGiS027494 for ; Wed, 12 Aug 2009 12:26:17 +0530 Date: Wed, 12 Aug 2009 12:29:22 +0530 To: "Lua list" Subject: Re: SVG generation in Lua From: Lloyd Organization: CDAC Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 References: Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.62 (Win32) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cdactvm.in X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-scanner: Scanned by Xamime-LT 0.1.5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there any method available to plot interactive graphs using this method? For example if we have millions of items in a graph, it will be difficult to present in a single screen. In that case, we will represent items as very small items, and will give the user more option to zoom the graph. Like this, is it possible to draw an interactive graph? Thanks, Lloyd On Wed, 12 Aug 2009 11:43:23 +0530, Asko Kauppi wrote: > > I'll be doing some SVG graphics work and applied some Lumikki-kind > thinking to making a simple SVG generation tool, in Lua. > > Currently available only by svn checkout, from: > > svn co svn://slugak.dyndns.org/public/2009/Svg > > Here's one of the sample files: > > -- > -- ELLIPSE1.LUA > -- > > require "svgcore" > > local rgb= assert(svg.rgb) > > print( svg.document( > svg.default{ stroke_dasharray={2,2}, > -- > svg.ellipse{ {80,110}, {75,105}, fill="#538" }, > svg.ellipse{ {80,110}, {60,40}, fill="black", stroke="red", > stroke_width=25 }, > svg.ellipse{ {80,110}, {35,20}, fill="#538", stroke="yellow", > stroke_width=25 }, > svg.ellipse{ {80,50}, {40,30}, fill="red", stroke="black", > stroke_width=25 }, > svg.ellipse{ {80,50}, {30,20}, fill="orange", stroke="red", > stroke_width=10 }, > svg.ellipse{ {80,170}, {40,30}, fill="yellow", stroke="orange", > stroke_width=25 }, > svg.ellipse{ {80,170}, {30,20}, fill="red", stroke="black", > stroke_width=10 } > } > ) ) > > The idea is that Lua syntax is a bit nicer to craft than XML, but this > also allows programmatic creation of macro-like objects (functions that > create graphical objects) that can be turned around, copied etc.. SVG > has a "uses" element for that, but this is more easy on the eyes > (clearer code). > > I post this mostly to inform if anyone has a similar need. Be my guest > and use it. Haven't decided the license yet. > > Btw, SVG + JavaScript is a perfect blend for making visually good- > looking UI applications. SVG in theory support any scripting language, > so maybe we can at one day have SVG+Lua viewer. > > -asko > ______________________________________ Scanned and protected by Email scanner From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 04:37:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C7bqqj001982; Wed, 12 Aug 2009 04:37:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C65B19394; Wed, 12 Aug 2009 04:37:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jenni2.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A88FA1938F for ; Wed, 12 Aug 2009 04:37:15 -0300 (BRT) Received: from [93.106.103.19] (93.106.103.19) by jenni2.inet.fi (8.5.014) id 4A7770910048F467 for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 10:37:13 +0300 Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: SVG generation in Lua Date: Wed, 12 Aug 2009 10:32:58 +0300 References: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've planned a separate svggraph module for such. This is just a start. So, not yet. - asko On 12.8.2009, at 9.59, Lloyd wrote: > Is there any method available to plot interactive graphs using this > method? For example if we have millions of items in a graph, it will > be difficult to present in a single screen. In that case, we will > represent items as very small items, and will give the user more > option to zoom the graph. Like this, is it possible to draw an > interactive graph? > > Thanks, > Lloyd > > > On Wed, 12 Aug 2009 11:43:23 +0530, Asko Kauppi > wrote: > >> >> I'll be doing some SVG graphics work and applied some Lumikki-kind >> thinking to making a simple SVG generation tool, in Lua. >> >> Currently available only by svn checkout, from: >> >> svn co svn://slugak.dyndns.org/public/2009/Svg >> >> Here's one of the sample files: >> >> -- >> -- ELLIPSE1.LUA >> -- >> >> require "svgcore" >> >> local rgb= assert(svg.rgb) >> >> print( svg.document( >> svg.default{ stroke_dasharray={2,2}, >> -- >> svg.ellipse{ {80,110}, {75,105}, fill="#538" }, >> svg.ellipse{ {80,110}, {60,40}, fill="black", stroke="red", >> stroke_width=25 }, >> svg.ellipse{ {80,110}, {35,20}, fill="#538", >> stroke="yellow", stroke_width=25 }, >> svg.ellipse{ {80,50}, {40,30}, fill="red", stroke="black", >> stroke_width=25 }, >> svg.ellipse{ {80,50}, {30,20}, fill="orange", stroke="red", >> stroke_width=10 }, >> svg.ellipse{ {80,170}, {40,30}, fill="yellow", >> stroke="orange", stroke_width=25 }, >> svg.ellipse{ {80,170}, {30,20}, fill="red", stroke="black", >> stroke_width=10 } >> } >> ) ) >> >> The idea is that Lua syntax is a bit nicer to craft than XML, but >> this also allows programmatic creation of macro-like objects >> (functions that create graphical objects) that can be turned >> around, copied etc.. SVG has a "uses" element for that, but this is >> more easy on the eyes (clearer code). >> >> I post this mostly to inform if anyone has a similar need. Be my >> guest and use it. Haven't decided the license yet. >> >> Btw, SVG + JavaScript is a perfect blend for making visually good- >> looking UI applications. SVG in theory support any scripting >> language, so maybe we can at one day have SVG+Lua viewer. >> >> -asko >> > > > > ______________________________________ > Scanned and protected by Email scanner From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 04:41:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C7fdqS002355; Wed, 12 Aug 2009 04:41:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B68B7193A2; Wed, 12 Aug 2009 04:41:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 185361939A for ; Wed, 12 Aug 2009 04:41:08 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mb8SG-000638-Mu for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 07:41:05 +0000 Received: from c-71-231-140-251.hsd1.wa.comcast.net ([71.231.140.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 07:41:04 +0000 Received: from joshua by c-71-231-140-251.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 07:41:04 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: Strict 'struct' pattern Date: Wed, 12 Aug 2009 07:40:55 +0000 (UTC) Lines: 48 Message-ID: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.231.140.251 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Manura math2.org> writes: > > On Mon, Aug 10, 2009 at 4:16 PM, Joshua Haberman wrote: > > The idea is this: you define your structure type as a protocol buffer > > type. .... you could write this in a .lua file: > > > > Alice = upb.new_type(" > >  message Alice { > >    optional int32 x = 1; > >    optional int32 y = 2; > >  } > > ") > >... > > - instances of Alice have a more efficient representation in memory. > >  Since the set of all possible fields is known, it can be stored > >  as an array with known offsets for each member instead of as a > >  table keyed by "x" and "y". > > That's interesting. A similar type of thing might be done using one > of the struct libs [1]. > > > my library is currently ~2300 sloc of C, and compiles to <30kb of object > > code on x86.  You can check it out here (the Lua parts aren't written > > yet): > > I had tried protocol buffers before, but it seemed somewhat bulky for > what it did (added 1 MB to the binary I think). I had the same feeling, which is one reason I started writing upb (the "u" is for "micro"). > It looks like they > may now have a new "lite" version [2] that much improves this. The lite version improves this by stripping out all of the reflection features and the code that lets you load .proto types at runtime. What this means is that you have to generate and link in a C++ class for each different .proto type you want to handle. For Lua, you'd have to compile and link a separate extension for each message type. For an interpreted language like Lua where you don't want to have a compile step, this is really inconvenient. upb (my project) compiles to 30kb which *includes* code to load .proto types at runtime. I designed it specifically to be ideal for exposing protobufs to languages like Lua. Josh From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 04:47:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C7l4iq002806; Wed, 12 Aug 2009 04:47:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2B5A1938F; Wed, 12 Aug 2009 04:46:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DF13188A4 for ; Wed, 12 Aug 2009 04:46:22 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mb8XL-0006GU-TE for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 07:46:20 +0000 Received: from c-71-231-140-251.hsd1.wa.comcast.net ([71.231.140.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 07:46:19 +0000 Received: from joshua by c-71-231-140-251.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 07:46:19 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Joshua Haberman Subject: Re: Re[2]: Strict 'struct' pattern Date: Wed, 12 Aug 2009 07:46:11 +0000 (UTC) Lines: 27 Message-ID: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> <1332668363.20090812083328@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.231.140.251 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin gmail.com> writes: > > Hello David, > > Wednesday, August 12, 2009, 8:08:16 AM, you wrote: > > > I had tried protocol buffers before, but it seemed somewhat bulky for > > what it did (added 1 MB to the binary I think). It looks like they > > i don't used it but docs mention that generated code may be optimized > for speed or code size by adding directive to proto file This is true, but unrelated. The setting you are referring to affects the C++ classes that the proto compiler generates for each .proto type you want to parse. The 1MB that David is referring to is the core libprotobuf library, which you link in in *addition* to any specific message classes. In other words, the 1MB is overhead, while the "optimize_for" setting controls how large the per-message generated code is (which is added to the 1MB core library). libprotobuf-lite is something like 90kb, but then you have to link in the per-message code which you can optimize for either speed or size. And you lose the ability to load .proto types at runtime. Josh From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 04:57:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C7uxJx003602; Wed, 12 Aug 2009 04:56:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B3E1193AE; Wed, 12 Aug 2009 04:56:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31045193AA for ; Wed, 12 Aug 2009 04:56:33 -0300 (BRT) Received: by fxm25 with SMTP id 25so4078454fxm.5 for ; Wed, 12 Aug 2009 00:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TnL77XX4v+WCvVwssEOnaemUt9cKtoBcsSh1P1Us/Dw=; b=cTuel+UY7ZaTf/aDLsjX1Eje15JBz80ykZcpvBXuVVWNtKOsg7QxMpHsaVq3rYfnuE YmkLEl3ejxMX491A9PvF1EvA+Cp6DdT/sCMyRwqsZecYg45saRNtZ90z7M5oUSNAsFJ9 97s6mjdirXod5Bt/OlZ1mfOrra6hvhoPC88FE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=C8Yrrc2bbWaecUFwBuqIjlxFjyNvGyB1vez4tzcJgyTBNHJhHpVepQ8y56tNWm0hrS qwb4QTnmFgHaNfpuPymyCfVw86B3iKDBccqR8M7hwCFxCtpA+MzeYcsyOcQfX8kGYmA4 /T/rHcUN7IflBNkokNbOZKSTkpRz01nmFmYTI= MIME-Version: 1.0 Received: by 10.239.181.16 with SMTP id k16mr741321hbg.3.1250063791628; Wed, 12 Aug 2009 00:56:31 -0700 (PDT) In-Reply-To: References: <560972290908070459v2ea8eff2v4be8aa7da2253e1@mail.gmail.com> Date: Wed, 12 Aug 2009 09:56:31 +0200 Message-ID: <560972290908120056s6bf09f0eq53a3972d7a07288b@mail.gmail.com> Subject: Re: Strict 'struct' pattern From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7C7uxJx003602 On Wed, Aug 12, 2009 at 6:08 AM, David Manura wrote: >> - instances of Alice have a more efficient representation in memory. >>  Since the set of all possible fields is known, it can be stored >>  as an array with known offsets for each member instead of as a >>  table keyed by "x" and "y". > > That's interesting.  A similar type of thing might be done using one > of the struct libs [1]. This does seem like an option; parse some simple representation (could well be a stripped-down proto format) and generate the formating codes for lstruct (etc). The focus would be on reading and writing the 'native' binary representation and would make code for reading binary files much more obvious. Such a representation is then a way to go from Lua tables to struct layout, and vice versa. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 06:19:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7C9JmkS009479; Wed, 12 Aug 2009 06:19:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E01A8193BE; Wed, 12 Aug 2009 06:19:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wmproxy1-g27.free.fr (wmproxy1-g27.free.fr [212.27.42.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 873AC193A9 for ; Wed, 12 Aug 2009 06:19:17 -0300 (BRT) Received: from wmproxy1-g27.free.fr (localhost [127.0.0.1]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 93F25345D for ; Wed, 12 Aug 2009 11:19:14 +0200 (CEST) Received: from UNKNOWN (imp5-g19.priv.proxad.net [172.20.243.135]) by wmproxy1-g27.free.fr (Postfix) with ESMTP id 7A8FB2C58 for ; Wed, 12 Aug 2009 11:19:14 +0200 (CEST) Received: by UNKNOWN (Postfix, from userid 0) id 797D725468979; Wed, 12 Aug 2009 11:19:14 +0200 (CEST) Received: from ([160.103.2.224,160.103.107.92]) by webmail.free.fr (IMP) with HTTP for ; Wed, 12 Aug 2009 11:19:14 +0200 Message-ID: <1250068754.4a828912745a4@webmail.free.fr> Date: Wed, 12 Aug 2009 11:19:14 +0200 From: matias.guijarro@free.fr To: lua@bazar2.conectiva.com.br Subject: Where to find finalization patch ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.8 X-Originating-IP: 160.103.2.224 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hello, Sorry to ask but... I have read some interesting messages about a finalization patch and I would like to give it a try. I have found this page on the Lua wiki : http://lua-users.org/wiki/ResourceAcquisitionIsInitialization It seems the finalization patch recently discussed on the list can be find here : http://lua-users.org/files/wiki_insecure/users/tnodir/lua-5.1.4-finpatch.tar.gz But looking at the file date, it probably doesn't include latest bug fixes and improvements from Thomas Harning Jr. and others. Is there a place where to find the patch ? Is there a project page or something like that ? By the way... Reading all messages it is not clear in which state the patch is. Are there still known bugs to be fixed ? Thanks in advance for your inputs, Matias. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 07:05:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CA5CXj013133; Wed, 12 Aug 2009 07:05:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C126C193BD; Wed, 12 Aug 2009 07:04:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD9D71937A for ; Wed, 12 Aug 2009 07:04:39 -0300 (BRT) Received: by ewy26 with SMTP id 26so4691488ewy.5 for ; Wed, 12 Aug 2009 03:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ygM67lNXB/2gWbb2N7oKV0Cbm7j3ayfbyZtKPUXhB7A=; b=aGFKrWOsMUQp992KLALojIooLiULFUpXG05E8u/qR6BLQ+hrLOFW+ocrOTSMl8wh90 qxy/VB7UCfFA/9CuFIM1YMC9lpXvJttigNb5mlqU4Mh37txgHmQ9zTy6WDBOtoO7ajf/ +wJMzhCnJyhhUf1xmWrhBmkADcMIRyaBfVAEY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=xBT6rehyQ25ppnGIjxPFXlfDHyt7kQn+KiV4GUcDwlfVAljX1O/bXn1Pk1QJ2TjPpP dVxmycC/stMfQvGCI6cR5G7/vpCp7Irn/39kEWIq2LYtbuAGhe5+aoUTLY8cbhXKUmnq KjaxTTVOGNiSsC/9MUFWCow86XbiErDzhhhF8= MIME-Version: 1.0 Received: by 10.216.19.212 with SMTP id n62mr1455412wen.66.1250071478175; Wed, 12 Aug 2009 03:04:38 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Wed, 12 Aug 2009 12:04:18 +0200 Message-ID: <89d273ba0908120304u151b008q68fb80de66a6a5fe@mail.gmail.com> Subject: Re: custom "mark" function for userdata? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/10 Joshua Haberman : > My question is how to make GC work properly, but also efficiently. > Unlike Ruby and Python, Lua does not (from what I can see) let userdata > objects define their own "mark" function. This means that all objects > that are reachable only through my container will get collected unless I > do something to prevent that. I think that this very kind of "feature" (I'd call it bloat) is what makes Python or Ruby so slow compared to Lua. Keep in mind that using a table environment for your userdata is still likely to keep your special containers faster than they would in these languages. Tables are the only structuring data type in Lua, why do you assume they are not efficient when all the optimization efforts can be put into them ? From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 08:58:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CBwb64023840; Wed, 12 Aug 2009 08:58:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 564291932F; Wed, 12 Aug 2009 08:58:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39EF818BA1 for ; Wed, 12 Aug 2009 08:58:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so4756331ewy.5 for ; Wed, 12 Aug 2009 04:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=2nXGqZ2594HnPrCAFnRuBly/S0YPkQcgvaIG0ohHcHM=; b=L/DBF9ce151nqzUzfqT41XxOlYpe6250MxXARrK3I1nicBcJc7uGC5g4CB+Edfj9wP 23jHqMVFxqiGKtJ1TIA4wTMokh4YYSyTktDvLvNCRkmqjzQnlzgX9TcNB2f5VFQ2GTzG awrpor19bvsEAin6USolMZPqzeMzkNHt78Se4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=tu99jACAXjCqVmZu/z/iQL09YoazgQy+hPPEASjv/PaNxDC9J6mu1y1LYN5Z2Z9+A1 qUhuR6n11Z/13a2Hc669d2eEOGFodL3WW1FAQ3/Q8mynHBSjtjVMRiz+BZIxrUrpDeqF uEc1hSuYHKOMAtxAs7osAS/jEPWY+iOYdAiQw= MIME-Version: 1.0 Received: by 10.216.70.134 with SMTP id p6mr8648wed.40.1250078283475; Wed, 12 Aug 2009 04:58:03 -0700 (PDT) In-Reply-To: References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <790db3550908110017l76621928s597c11f5b9c144e5@mail.gmail.com> <20090811072254.GS27413@pruts.nl> <89d273ba0908111649v663badf4v9c24633fc4f31aa8@mail.gmail.com> <911501E6FDF648479FFD67BF39FECD05@CAYENNE> From: Jerome Vuarand Date: Wed, 12 Aug 2009 13:57:43 +0200 Message-ID: <89d273ba0908120457p4fdc246ag5a11c3e2538f71fe@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/12 Asko Kauppi : > The issue seems to be more complex than I had envisioned. Seeing the threads > in OS X Mail is a small nuisance (still not sure if it's a Mail > feature-done-right or a bug?). What my main point is is how the threads are > stored in the archive. We'll have to wait some more to see how the > particular thread will end up in. It's listing references: http://lua-users.org/lists/lua-l/2009-08/msg00217.html From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 10:12:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CDC8TO002581; Wed, 12 Aug 2009 10:12:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53B5E193E1; Wed, 12 Aug 2009 10:11:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68367193DD for ; Wed, 12 Aug 2009 10:11:33 -0300 (BRT) Received: by fxm25 with SMTP id 25so4236887fxm.5 for ; Wed, 12 Aug 2009 06:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ccav3jMvSLcFkPlVI+splENa9lxUnKzy59Ms3noOAHc=; b=RsN5o6FvgIv64HcCpKyrZ8oyepbMJOjNehrFZVQf9Q8OQSviSiRmw4luTUhawLygWK tzgLNZ01lgA4HfteagNvO001itv5bs/xhtFJVCZRhKnlbzcl+9WSv/JP9dWxWskIUUt9 wEw2ZSi/rMjdix9ZtDUA1ynsrtoVrTQqB8Jxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=f5fDtVqaFzRUmuA0+THVOjbVW4qXl5vAcZzajRpDVobYL6+1yglZ3St/L1+0G7Dv9k 0+LnIsj2VDIzrhK6LlSGrxZd5n/QL1uB7pR6qj31kqHt+gEPj5Gw8dD1SrTr9joKlWbo f0hYg0fI8BKohvW897ABE0dxA4zuC57BKHXW4= MIME-Version: 1.0 Received: by 10.239.179.6 with SMTP id b6mr4660hbg.161.1250082691829; Wed, 12 Aug 2009 06:11:31 -0700 (PDT) In-Reply-To: References: Date: Wed, 12 Aug 2009 15:11:31 +0200 Message-ID: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 11, 2009 at 3:18 PM, Duncan Cross wrote: > So, what do people think? Is it something you'd ever use? Is it just > too ugly and weird? I think one meaning for ... is enough ;) Have you considered it as a function, say 'explode'? That would be more visually distinctive. However, it ends up as yet another rule that people have to learn. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 10:30:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CDUpk7006529; Wed, 12 Aug 2009 10:30:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD23B193EA; Wed, 12 Aug 2009 10:30:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89274193C0 for ; Wed, 12 Aug 2009 10:30:22 -0300 (BRT) Received: by ewy26 with SMTP id 26so18817ewy.5 for ; Wed, 12 Aug 2009 06:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pY6Ev+priPmXkuDFSbPsINbGJKpfMxVMIBMdShiHM6U=; b=f85uOyJJ7PLa/lb6mH9zgx2/USce+FICgCvG5zV9ti2U5/n2OS5d0O5z4aQOau8T4q S6/snbvQQ8soUynCi9vhW2jbbB8tLXykm7I8LC4FePmEN9/zrkma1b9Kn7IFcDZvYPsX TpREN2e99qd7TVUziJENs4NYuCV2zW13YnsXk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wOMfoEolvhOrXsknpyG0GxY4XkIsOLNVSQ4hl6wSCTTgnRPckznzzK7zVBuvLwo1b7 JTKgikpZIA3E7W/J9xm2lxWr4S/ezn3/4jqfSqgpw7kNEoHX7ICGngHGPQ0vBi31iaCN 39Oc+azn9XknfMmOUl9IfeKAEWgxJgZQfh1eY= MIME-Version: 1.0 Received: by 10.216.29.201 with SMTP id i51mr15250wea.214.1250083820197; Wed, 12 Aug 2009 06:30:20 -0700 (PDT) In-Reply-To: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Date: Wed, 12 Aug 2009 14:30:20 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7CDUpk7006529 On Wed, Aug 12, 2009 at 2:11 PM, steve donovan wrote: > On Tue, Aug 11, 2009 at 3:18 PM, Duncan Cross wrote: >> So, what do people think? Is it something you'd ever use? Is it just >> too ugly and weird? > > I think one meaning for ... is enough ;)  Have you considered it as a > function, say 'explode'?  That would be more visually distinctive. You mean, have something that looks like a function call but is actually not? So these would work: printvalues(explode(multivalues()), 4, 5, 6) ar2 = {explode(multivalues()), 4, 5, 6} p,q,r,s,t,u = explode(multivalues()), 4, 5, 6 If not, and you mean an actual function that simulates it somehow, I'm not sure how it would work. > However, it ends up as yet another rule that people have to learn. That's a pessimistic way of looking at it :) It'd be another "tool" people can choose to learn about and use, probably if and when they come across a problem that it would help for. -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 10:34:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CDYdEh007174; Wed, 12 Aug 2009 10:34:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E0A8193F3; Wed, 12 Aug 2009 10:34:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48C7F193C0 for ; Wed, 12 Aug 2009 10:34:12 -0300 (BRT) Received: by ewy26 with SMTP id 26so21916ewy.5 for ; Wed, 12 Aug 2009 06:34:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.16 with SMTP id b16mr19213wef.57.1250084050154; Wed, 12 Aug 2009 06:34:10 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Date: Wed, 12 Aug 2009 14:34:10 +0100 X-Google-Sender-Auth: 4f9f65ee90e8742e Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7CDYdEh007174 On Wed, Aug 12, 2009 at 2:30 PM, Duncan Cross wrote: > On Wed, Aug 12, 2009 at 2:11 PM, steve donovan wrote: >> On Tue, Aug 11, 2009 at 3:18 PM, Duncan Cross wrote: >>> So, what do people think? Is it something you'd ever use? Is it just >>> too ugly and weird? >> >> I think one meaning for ... is enough ;)  Have you considered it as a >> function, say 'explode'?  That would be more visually distinctive. > > You mean, have something that looks like a function call but is > actually not? So these would work: > If something looks like a function call, it should be a function call. As this cannot be implemented as a function call, it should not look like one. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 10:40:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CDeASO008505; Wed, 12 Aug 2009 10:40:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBAB8193F6; Wed, 12 Aug 2009 10:39:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CDDF193DD for ; Wed, 12 Aug 2009 10:39:39 -0300 (BRT) Received: by ewy26 with SMTP id 26so26269ewy.5 for ; Wed, 12 Aug 2009 06:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=kONYViWnDhYX0VMNWwyBE/6qonjZM8dW5V6oKiaeL88=; b=p4WigYcMgQm2FWMElYHUWv8BDbAxX7J1jMDUIQJo2aYTYlC3YqMznnt/i6+alMj7EU uK/nuwcWzMSTvLMFrYbF8FgCdofxNbdZJzO/Pum7PyUzLGK8L4cyytHus4vWtR6nRSD/ SRO6a+1rNFGMdTCZ4/BJgMnLdJakDRtx115fA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kRkYYHz+DtHncDDYnJag0ObuwQnJfn5imI1M8lRKsM5RxaadIdc0L3FCBaY597pcKA VvgDzNOnRMiaFcEjQ2dEk+y1ZAJRFoIni5njg1YPvV6mDfEVpCfzLu1KYH0kJXXuP+T5 vii5WcCJoUHr6lTT4MDvFb+HKeZzbfuhaEVtQ= MIME-Version: 1.0 Received: by 10.216.20.197 with SMTP id p47mr23208wep.13.1250084378236; Wed, 12 Aug 2009 06:39:38 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Date: Wed, 12 Aug 2009 14:39:38 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7CDeASO008505 On Wed, Aug 12, 2009 at 2:34 PM, Peter Cawley wrote: > On Wed, Aug 12, 2009 at 2:30 PM, Duncan Cross wrote: >> On Wed, Aug 12, 2009 at 2:11 PM, steve donovan wrote: >>> On Tue, Aug 11, 2009 at 3:18 PM, Duncan Cross wrote: >>>> So, what do people think? Is it something you'd ever use? Is it just >>>> too ugly and weird? >>> >>> I think one meaning for ... is enough ;)  Have you considered it as a >>> function, say 'explode'?  That would be more visually distinctive. >> >> You mean, have something that looks like a function call but is >> actually not? So these would work: >> > If something looks like a function call, it should be a function call. > As this cannot be implemented as a function call, it should not look > like one. > I agree - I just wanted to fully understand what steve was suggesting first, he might have meant a real function that does the same thing somehow. -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 10:55:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CDsURx011554; Wed, 12 Aug 2009 10:54:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1EA019403; Wed, 12 Aug 2009 10:54:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 285E5193FD for ; Wed, 12 Aug 2009 10:53:59 -0300 (BRT) Received: by fxm25 with SMTP id 25so24930fxm.5 for ; Wed, 12 Aug 2009 06:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=r3i8IVP1bf55j2PHtXtN3CcL74+qvz9e8Qh79m/e92s=; b=nB+fcGkO2wcRiaf1fSV7dQKo6XWB4HnwXP61wWrPYciFluEXnoTXT+ev67si2pSbrS ddC9bUEwnJ7ugyij2YSjCD85Fj6UsvhN5Qrxz4qy+HxVlCK+3w/dMbrSbKbzCSF70qvy ojQFA7lnAImRtJMRf7Dl9t6y3ERUj6xCqzsh4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZbLVGwbqq8nwhP12eutS/RzLMlumPBL0K5roHEmKW7E2Mp7pDgh9HoRZXPfThqTKn/ TIOtoxyCdnZuVWpKSdR1G69mGnnrTLfKqjqyRA8Pmkqjs+yBw9oPXt4pO0N96Fm6S8F2 kAbsdVU1IRm1rhPBFR99lJOwOvCTNwYHtr1ws= MIME-Version: 1.0 Received: by 10.239.138.34 with SMTP id n34mr8922hbn.64.1250085237666; Wed, 12 Aug 2009 06:53:57 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Date: Wed, 12 Aug 2009 15:53:57 +0200 Message-ID: <560972290908120653s3280d579ga4f416e28188529a@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 12, 2009 at 3:39 PM, Duncan Cross wrote: >> If something looks like a function call, it should be a function call. >> As this cannot be implemented as a function call, it should not look >> like one. >> > > I agree - I just wanted to fully understand what steve was suggesting > first, he might have meant a real function that does the same thing > somehow. Fair enough, it is a pseudo-function. I suppose I was thinking of t = {explode(multiple()),10,20}; it is a pseudo-function because although normally it means function(...) return ... end, it would then have special semantics inside a table constructor. Actually, the usual rule is confusing for beginners and experts alike - that {multiple(),10} behaves differently from {10,multiple()}, and that you have to use () for the second case to only insert the first value returned. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 11:15:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CEF4GR016106; Wed, 12 Aug 2009 11:15:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F320193A4; Wed, 12 Aug 2009 11:14:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7E37019348 for ; Wed, 12 Aug 2009 11:14:22 -0300 (BRT) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Wed, 12 Aug 2009 09:03:14 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 12 Aug 2009 10:14:18 -0400 Message-ID: <4A82CE3A.8020007@elbitsystems-us.com> Date: Wed, 12 Aug 2009 10:14:18 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: ... as an "expand list" unary postfix operator References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> In-Reply-To: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Aug 2009 14:14:18.0741 (UTC) FILETIME=[2E5CAA50:01CA1B57] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > On Tue, Aug 11, 2009 at 3:18 PM, Duncan Cross wrote: >> So, what do people think? Is it something you'd ever use? Is it just >> too ugly and weird? > I think one meaning for ... is enough ;) Steve, I can certainly see the argument against multiple meanings for the same tokens, though Lua (like most languages) has plenty of those already. And the reasoning is solid for truncation of return values as a default behavior in the contexts in which it currently happens. But the fact that we get many surprised queries about this behavior indicates that users expect to be able to capture all return values in the early part of an array initialization, etc. While I I don't see it as a big problem, it's still something that I could see myself using occasionally. And I think { get_items()..., "no more" } is a clever solution. Being an ellipsis, the ... token has a relatively clear meaning in this context. It would take me a while to grok the implications in the parser and VM. But that's for the OP to do. So I encourage you, Duncan, to try it out and share any results. Even if it doesn't work out, you (and we) will learn from it. Doug PS - I've always liked the phrase "elegant over clever" when considering an engineering/programming idea. I noticed that I used 'clever' above for something that Duncan labeled 'elegant'. I'm on the fence about this particular idea, but if its implementation is clean, I'd be happy to swing my mind towards 'elegant'! ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 11:33:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CEWvMl020545; Wed, 12 Aug 2009 11:32:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59CEE1940D; Wed, 12 Aug 2009 11:32:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from quasor.lunarpages.com (quasor.lunarpages.com [67.210.126.125]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 425E219402 for ; Wed, 12 Aug 2009 11:32:26 -0300 (BRT) Received: from ip72-193-211-133.lv.lv.cox.net ([72.193.211.133] helo=[192.168.20.129]) by quasor.lunarpages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MbEsG-00031D-Sa for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 07:32:20 -0700 Message-ID: <4A82D274.9060601@weijers.org> Date: Wed, 12 Aug 2009 07:32:20 -0700 From: =?UTF-8?B?R8OpIFdlaWplcnM=?= User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: How reliable is lua_topointer() ? References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> <790db3550908111809u20f9e126nd5a8d2bad5c44ec9@mail.gmail.com> <4A826648.5050703@gmail.com> In-Reply-To: <4A826648.5050703@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - quasor.lunarpages.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - weijers.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lawrie, One warning: if the C library keeps the pointer for a long time a new object can end up at the same location as the old one, and it can get really hard to figure out what's going on. A 'ref' value is safer in that respect. Ge' Lawrie Nichols wrote: > Hi Patrick > > On 12/08/09 02:09, Patrick Donnelly wrote: >> Light Userdata and Numbers are both considered strong references in >> any weak table. > You're absolutely right....I meant it weak-valued table (I should read > my posts before hitting the send button...). > >> Also, passing a pointer to an integer on the stack is >> just as simple in my opinion as passing a pointer returned from >> lua_topointer. >> > Agreed. However, in my case I'll be getting a pointer (to my allocated > UD) coming back from a third-party library. If I can use this pointer > as the index, then that's going to be easiest for me at this stage. > > Thanks for the help, > > Lawrie From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 11:58:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CEwnAK026194; Wed, 12 Aug 2009 11:58:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FE4A1941C; Wed, 12 Aug 2009 11:58:25 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F9A319371 for ; Wed, 12 Aug 2009 11:58:19 -0300 (BRT) Received: by qyk34 with SMTP id 34so55628qyk.33 for ; Wed, 12 Aug 2009 07:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=uwDu8nAYF6N+a0Op5j4GrO+CTuuUiJ0A4cMpBOx2cUo=; b=kMsfmnYGuEvMETEEZrvB3Opy+O5wzdgv/DXiL/PsovpCFs/B/6Mf7d7LadIumRh4dl YqvjXabHJlsPgFolDFhIDPnyq0uqj/8011TARn7BZSTDH9fJLuskoI9eEdqahTgVBL4Q eqHfQElLXsMUuyiibCU/Wb5wj7UEV9rdGBrsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=AjnuXgu1OfWpD8ApXrwHAMXS7GmbfZC67j1CJP1TCrcszEXUf6+1UsysBfGLftwpm1 hRdYpNf2H0NzdJg8nHfFPzkQ/ExLDvYvhnzMnmHrAoC/v7yRyLe3Ke+1MzDvcQuwSLNI DOwlTe6WZOvftqjz8OonLogWXtgCZIUnMPgwU= MIME-Version: 1.0 Received: by 10.229.3.12 with SMTP id 12mr195727qcl.98.1250089098127; Wed, 12 Aug 2009 07:58:18 -0700 (PDT) Date: Wed, 12 Aug 2009 10:58:18 -0400 Message-ID: Subject: RAM out of computer From: Zach Dwiel To: lua Content-Type: multipart/alternative; boundary=0016e64eb2caa1aace0470f30c30 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64eb2caa1aace0470f30c30 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit There was some RAM in the computer sitting on the floor in the closet that I grabbed since it didn't look like it was getting used. It looked like there were 2x1gb sticks. Were those yours? Did you want them in your current computer? If not, I'll hold onto them and put them on the server. Also, you been working on anything on the server recently? Was there a problem you got stuck on recently? Or did you just end up getting the server set up on your own computer? zach --0016e64eb2caa1aace0470f30c30 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable There was some RAM in the computer sitting on the floor in the closet that = I grabbed since it didn't look like it was getting used.=A0 It looked l= ike there were 2x1gb sticks.=A0 Were those yours?=A0 Did you want them in y= our current computer?=A0 If not, I'll hold onto them and put them on th= e server.

Also, you been working on anything on the server recently?=A0 Was there= a problem you got stuck on recently?=A0 Or did you just end up getting the= server set up on your own computer?

zach
--0016e64eb2caa1aace0470f30c30-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 13:05:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CG5Hm0008791; Wed, 12 Aug 2009 13:05:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 892AF1941B; Wed, 12 Aug 2009 13:04:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 372351940B for ; Wed, 12 Aug 2009 13:04:35 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 9so60841eyd.11 for ; Wed, 12 Aug 2009 09:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=+qfbygiagYoCsdC1ShI/WeaKMk+QKmmS9xnSRjmS/y0=; b=qWi9Tk6S+qMmf+X/cOIks/+JK9goqrb4QtnfsTbTqQG6rjr8j55thvBBWHK66UswnX Muo6M1PMuWwAzO5/mzxorcL8MMXSRz17aUVaAqHlfVoSXPysOegpAa65n8oTkz0cgG4y a2epS7FyAeV/Xj1VOu1OiJVBG06nYYnPKdWrE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=w7OTB+xNc/4b/aoij8mAJzvhGYk8yhzAAVe8G4qScFCoXswRwteTFjFp2ciq32vg73 CxsLxxwWpxTPxujN7Q6n86JhgiVxOrAuL8ifcNlVSgajPeioAGwV0lADBn2wBpZC+b05 KB94buFeorXlOQv9+ZtgVrWtS6ml532Ix46gE= MIME-Version: 1.0 Received: by 10.216.86.145 with SMTP id w17mr37717wee.85.1250093073124; Wed, 12 Aug 2009 09:04:33 -0700 (PDT) In-Reply-To: <4A82D274.9060601@weijers.org> References: <4A814049.3040206@gmail.com> <790db3550908110408u7f7b27a8mcb3b549ea10a9b53@mail.gmail.com> <4A817D77.3020308@gmail.com> <790db3550908111809u20f9e126nd5a8d2bad5c44ec9@mail.gmail.com> <4A826648.5050703@gmail.com> <4A82D274.9060601@weijers.org> From: Jerome Vuarand Date: Wed, 12 Aug 2009 18:04:13 +0200 Message-ID: <89d273ba0908120904n219e9c95m6ffb80de26753d86@mail.gmail.com> Subject: Re: How reliable is lua_topointer() ? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7CG5Hm0008791 2009/8/12 Gé Weijers : > One warning: if the C library keeps the pointer for a long time a new object > can end up at the same location as the old one, and it can get really hard > to figure out what's going on. A 'ref' value is safer in that respect. I'm not advocating the use of lua_topointer at all, but in that respect the use of a 'ref' is not safer, it's just as safe in a table with strong references, and just as unsafe in a table with weak references. If the 'ref' is weak, the object can be collected, and another object receive the same integer id in a subsequent call to luaL_ref. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 13:06:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CG5tDv008947; Wed, 12 Aug 2009 13:05:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E301A19428; Wed, 12 Aug 2009 13:04:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B4431941E for ; Wed, 12 Aug 2009 13:04:48 -0300 (BRT) Received: by ywh29 with SMTP id 29so149687ywh.33 for ; Wed, 12 Aug 2009 09:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Tui+ALrcoEpTnnScymkVyRzlw/cN8uBvhVu+wSJowTc=; b=MjkciFJqGc8RtspANs2uNKv89coIOKIqGZm4Bo5/iCQwpOLQzsyUMz6/TY5xbBz7BB qoNe8j7dW+qGLl/X5yWx2i1pGlZe5hy/iZHWQgOgys1YQyxgyahXTugCUNLo4UHD2GBa puS5MP3aJs+8+Kp8+evCAtZQPAUI9VbdjN96U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=gYskRE1IVcDMC2ZIdgpoiWkOWKwmQXscZTi94sMa+Xz02+u+GEcSDlZksAOGenVg45 sz8yC52msIVaz/vROw+5DXpsljPl/VcmVOZLy+G/3AAE6qhwpN1HJsFSugf9t5hTesux nEvp18MiNMK0BaCrcIgkXUHggcckMUW8ImX14= MIME-Version: 1.0 Received: by 10.100.232.17 with SMTP id e17mr213029anh.107.1250093087110; Wed, 12 Aug 2009 09:04:47 -0700 (PDT) In-Reply-To: <1250068754.4a828912745a4@webmail.free.fr> References: <1250068754.4a828912745a4@webmail.free.fr> From: "Thomas Harning Jr." Date: Wed, 12 Aug 2009 12:04:27 -0400 Message-ID: Subject: Re: Where to find finalization patch ? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 12, 2009 at 5:19 AM, wrote: > Hello, > > Sorry to ask but... I have read some interesting > messages about a finalization patch and I would like > to give it a try. I have found this page on the Lua > wiki : > > http://lua-users.org/wiki/ResourceAcquisitionIsInitialization > > It seems the finalization patch recently discussed > on the list can be find here : > > http://lua-users.org/files/wiki_insecure/users/tnodir/lua-5.1.4-finpatch.tar.gz > > But looking at the file date, it probably doesn't > include latest bug fixes and improvements from > Thomas Harning Jr. and others. > > Is there a place where to find the patch ? Is there > a project page or something like that ? No project page AFAIK... latest patch from this msg: http://lua-users.org/lists/lua-l/2009-08/msg00051.html > By the way... Reading all messages it is not clear > in which state the patch is. Are there still known > bugs to be fixed ? Not entirely certain... code needs some more testing probably. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 14:20:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CHJx7E025402; Wed, 12 Aug 2009 14:19:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B99D3190A3; Wed, 12 Aug 2009 14:19:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 281B519068 for ; Wed, 12 Aug 2009 14:19:18 -0300 (BRT) Received: by wa-out-1112.google.com with SMTP id v27so22603wah.5 for ; Wed, 12 Aug 2009 10:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=Dpjm9nzPtXKcuuVBsnW0Boa1bo/iqxp5bz1Nj+EjVuo=; b=mAeJ8Sc65v6KBMZwaR36VEntZoSCOTgltuJ9DknYGjGdxmIDKLBgkGAPau2Bsuu8Ta znsJCDhFaQy1Qv9ho4vGmcC41C9gPCbq067CuQ+z3Jbn9EJSWZKQaaUnGuXeXMAsKqCU GnFp9GoDhYOEmHkAU/dbmUqLkcQng7Z1Zs3wA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=HUKhpwrWE7imecjLsuUfsMLxilXGz9cEkZqJeMPIG91y29x//ZfZbhMV4xXiXaJzcn 0grTbnYxtfP6BhcxBkj7RsV/zOkqyal4E4kmUB0lTkq2+flFhbZ453c8rpaGvU4i0dP8 w7HcBGRAGJn5xVA080GtuUzlicjXEaxLI9sQ0= Received: by 10.114.2.24 with SMTP id 24mr253758wab.109.1250097556584; Wed, 12 Aug 2009 10:19:16 -0700 (PDT) Received: from ?127.0.0.1? ([218.88.87.198]) by mx.google.com with ESMTPS id l38sm13068656waf.18.2009.08.12.10.19.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Aug 2009 10:19:15 -0700 (PDT) Message-ID: <4A82F98B.4070506@gmail.com> Date: Thu, 13 Aug 2009 01:19:07 +0800 From: cometwk User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: In lua VM , can i yield after some bytecode executed? Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In my project , I want to schedule two or more lua VMs in one native thread. in this way, the scheduler between VMs is preemptive . example: main() { lua_resume(VM1) VM1 -> execute bytecode1, bytecode2, bytecode-N then yield lua_resume(VM2) VM2 -> execute bytecode1, bytecode2, bytecode-N then yield ... } I know lua_yield() and lua_resume() can do this, but how to do after some bytecode executed ? or insert a bytecode (YIELD) into the lua bytecodes ? Sorry for my poor english. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 14:25:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CHPSBw026460; Wed, 12 Aug 2009 14:25:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7115191EF; Wed, 12 Aug 2009 14:25:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 986B519198 for ; Wed, 12 Aug 2009 14:25:01 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7CHOwxA018248 for ; Wed, 12 Aug 2009 14:24:58 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id BA89154C11A; Wed, 12 Aug 2009 14:24:58 -0300 (BRT) Date: Wed, 12 Aug 2009 14:24:58 -0300 From: Roberto Ierusalimschy To: Lua list Subject: game context in LatinoWare 2009 Message-ID: <20090812172458.GA11774@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean LatinoWare 2009 will held a game context where the use of Lua will be considered a "plus". (The rules are in http://www.latinoware.org/node/76, but currently only in Portuguese...) -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 14:58:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CHwT32003878; Wed, 12 Aug 2009 14:58:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D527C192AE; Wed, 12 Aug 2009 14:57:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68C1719296 for ; Wed, 12 Aug 2009 14:57:54 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so21003eye.11 for ; Wed, 12 Aug 2009 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rF804uork0BhWMzQIgjD7N39Xn5LNKVCqbzfLHEJDaE=; b=gPLHatPRAZ8MJMcBtyxYomrsEv9KC8A7xCvXgxIsWE/dj/6s+Nsy3yX9z/vPJZqcse zb+L8/3+VJ7St2SmWPDDajymQesi4Jed6CH/AjhioUbOiyJhtySxhCFg2Pgv1F0vhYCT BT2C6ch+o/HxYd5v0b01D/hmEB98X6HZPs97A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bUDBypDaVlorQC2d+QaB+P5bMriLVk3Hd/n9DjX+jYB29NjYIyybi48ZqzrN8DavPB B9lBCkT1ZxAzUXyK2+y+K1qGGts9F1De3pct+I3rQgUjEw0Umezs1/zNm7DkvmOnOKGM feTSMPB+DQHuadG8v6zPkGOlivqJE7q8It0fc= MIME-Version: 1.0 Received: by 10.210.11.13 with SMTP id 13mr2723540ebk.90.1250099872482; Wed, 12 Aug 2009 10:57:52 -0700 (PDT) In-Reply-To: <20090812172458.GA11774@inf.puc-rio.br> References: <20090812172458.GA11774@inf.puc-rio.br> Date: Wed, 12 Aug 2009 14:57:52 -0300 Message-ID: Subject: Re: game context in LatinoWare 2009 From: Romulo To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "context" or "contest" ? On Wed, Aug 12, 2009 at 2:24 PM, Roberto Ierusalimschy wrote: > LatinoWare 2009 will held a game context where the use of Lua will be > considered a "plus". (The rules are in http://www.latinoware.org/node/76, > but currently only in Portuguese...) > > -- Roberto > From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 15:19:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CIJSw6008983; Wed, 12 Aug 2009 15:19:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23A72191D9; Wed, 12 Aug 2009 15:18:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E30E918ED1 for ; Wed, 12 Aug 2009 15:18:49 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7CIIl28025564 for ; Wed, 12 Aug 2009 15:18:47 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 436A054C11A; Wed, 12 Aug 2009 15:18:48 -0300 (BRT) Date: Wed, 12 Aug 2009 15:18:48 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: game context in LatinoWare 2009 Message-ID: <20090812181848.GB11914@inf.puc-rio.br> References: <20090812172458.GA11774@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > "context" or "contest" ? "contest"; sorry about that. -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 15:50:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CIocJ2017245; Wed, 12 Aug 2009 15:50:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA04E19180; Wed, 12 Aug 2009 15:50:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 931BF19018 for ; Wed, 12 Aug 2009 15:49:58 -0300 (BRT) Received: from 75-164-85-75.tcso.qwest.net ([75.164.85.75]:2412 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MbItE-0007TG-Cf for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 14:49:36 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" Subject: Why can't I read a file using io.read? Date: Wed, 12 Aug 2009 11:50:04 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0618_01CA1B43.07EB9980" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0618_01CA1B43.07EB9980 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I've been using lua for almost 15 years and I've never had to use the io = package before now. I can't get it to work. The fragment below returns a = nil string. I know the file name (sName, which is a full path) is good and that the = file has multiple lines of text inside it. I printed the handle (nFile) = returned by io.open and it is non zero. nFile, sMsg =3D io.open( sName, "r" ) if not nFile then Exit(sMsg) end for i =3D 1, 10000000 do local sLine =3D io.read("*line") On the first call to io.read, sLine is returned as nil. I also tried = using "*number" and the returned value was like 1.e-312, or garbage. = Problem is, I can't figure out how to debug it beyond this point. Michael ------=_NextPart_000_0618_01CA1B43.07EB9980 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I've been using lua for almost 15 years = and I've=20 never had to use the io package before now. I can't get it to work.=20 The fragment below returns a nil string.
 
I know the file name (sName, which is a = full=20 path) is good and that the file has multiple lines of = text inside it.=20 I printed the handle (nFile) returned by io.open and it is non=20 zero.
 
 
nFile, sMsg =3D io.open( sName, "r" = )
if not nFile=20 then Exit(sMsg) end
 
for i =3D 1, 10000000 = do
  local sLine =3D=20 io.read("*line")
On the first call to io.read, sLine is = returned=20 as nil. I also tried using "*number" and the returned value was = like=20 1.e-312, or garbage. Problem is, I can't figure out how to debug it = beyond=20 this point.
 
Michael
------=_NextPart_000_0618_01CA1B43.07EB9980-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 15:53:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CIrcVC018227; Wed, 12 Aug 2009 15:53:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68FBD18A58; Wed, 12 Aug 2009 15:53:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6BCC189E1 for ; Wed, 12 Aug 2009 15:53:10 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id EE624E20A8 for ; Wed, 12 Aug 2009 20:53:04 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tz3oYAuPDYHy for ; Wed, 12 Aug 2009 20:53:01 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id DFB84E20B5; Wed, 12 Aug 2009 20:53:01 +0200 (CEST) Date: Wed, 12 Aug 2009 20:53:01 +0200 From: Ico To: Lua list Subject: Re: Why can't I read a file using io.read? Message-ID: <20090812185301.GF27413@pruts.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-08-12 Michael Newberry wrote : > I've been using lua for almost 15 years and I've never had to use the io package before now. I can't get it to work. The fragment below returns a nil string. > > I know the file name (sName, which is a full path) is good and that the file has multiple lines of text inside it. I printed the handle (nFile) returned by io.open and it is non zero. > > > nFile, sMsg = io.open( sName, "r" ) > if not nFile then Exit(sMsg) end > > for i = 1, 10000000 do > local sLine = io.read("*line") You're reading from stdin, instead of from your newly opened filehandle. Try: local sLine = nFile:read("*l") -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 16:01:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CJ1BQg020788; Wed, 12 Aug 2009 16:01:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B61A19180; Wed, 12 Aug 2009 16:00:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A7CB18A02 for ; Wed, 12 Aug 2009 16:00:35 -0300 (BRT) Received: from 75-164-85-75.tcso.qwest.net ([75.164.85.75]:2504 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MbJ3a-0000ho-Mh for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 15:00:19 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <20090812185301.GF27413@pruts.nl> Subject: Re: Why can't I read a file using io.read? Date: Wed, 12 Aug 2009 12:00:46 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks, that worked! I haven't dealt with stdin, etc. for many years and just didn't even think of it. Now I see in the book, that it mentions "standard input". Michael ----- Original Message ----- From: "Ico" To: "Lua list" Sent: Wednesday, August 12, 2009 11:53 AM Subject: Re: Why can't I read a file using io.read? > > > * On 2009-08-12 Michael Newberry wrote : > >> I've been using lua for almost 15 years and I've never had to use the io >> package before now. I can't get it to work. The fragment below returns a >> nil string. >> >> I know the file name (sName, which is a full path) is good and that the >> file has multiple lines of text inside it. I printed the handle (nFile) >> returned by io.open and it is non zero. >> >> >> nFile, sMsg = io.open( sName, "r" ) >> if not nFile then Exit(sMsg) end >> >> for i = 1, 10000000 do >> local sLine = io.read("*line") > > You're reading from stdin, instead of from your newly opened filehandle. > Try: > > local sLine = nFile:read("*l") > > -- > :wq > ^X^Cy^K^X^C^C^C^C > From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 17:12:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CKCGZ5008637; Wed, 12 Aug 2009 17:12:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BFF718D35; Wed, 12 Aug 2009 17:11:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0285B18D64 for ; Wed, 12 Aug 2009 17:11:36 -0300 (BRT) Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n7CKBT67012879 for ; Wed, 12 Aug 2009 17:11:29 -0300 Message-ID: <4A8321EA.4010009@inconcertcc.com> Date: Wed, 12 Aug 2009 17:11:22 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Using a luaL_Buffer while traversing a table Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi. Does anyone have some tips (or code, preferable :D) on how to traverse a table using lua_next while adding stuff to a luaL_Buffer ? The fact that the buffer operations may change my stack top is giving me trouble. I thought of saving the positions of the key and value after lua_next, adding stuff to the buffer and then lua_remove(L, value_pos) and bringing the key to the top of the stack. I haven't tried this, but I'm afraid that it might break the buffer operations. Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 17:30:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CKUmNU012964; Wed, 12 Aug 2009 17:30:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D44219109; Wed, 12 Aug 2009 17:30:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A590F190AC for ; Wed, 12 Aug 2009 17:30:10 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CKU820012835 for ; Wed, 12 Aug 2009 17:30:08 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7CKU6415002; Wed, 12 Aug 2009 17:30:06 -0300 Date: Wed, 12 Aug 2009 17:30:06 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Using a luaL_Buffer while traversing a table Message-ID: <20090812173006.A14994@lua.tecgraf.puc-rio.br> References: <4A8321EA.4010009@inconcertcc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4A8321EA.4010009@inconcertcc.com>; from ignaciob@inconcertcc.com on Wed, Aug 12, 2009 at 05:11:22PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Hi. Does anyone have some tips (or code, preferable :D) on how to > traverse a table using lua_next while adding stuff to a luaL_Buffer ? > The fact that the buffer operations may change my stack top is giving me > trouble. I thought of saving the positions of the key and value after > lua_next, adding stuff to the buffer and then lua_remove(L, value_pos) > and bringing the key to the top of the stack. I haven't tried this, but > I'm afraid that it might break the buffer operations. I had a similar problem in my take on unrope for ropes implemented as Lua tables. In the end I had to reserve some stack space before the Lua buffer data. The final C code is below. The original thread started at http://lua-users.org/lists/lua-l/2008-12/msg00055.html but the initial versions had bugs... /* * lrope.c * provides unrope * Luiz Henrique de Figueiredo * 06 Dec 2008 00:13:56 * This code is hereby placed in the public domain. */ #include "lua.h" #include "lauxlib.h" #define MAXLEVEL 30 static int doconcat (lua_State *L, luaL_Buffer *b, int t, int needsep) { int i; if (t>MAXLEVEL+1) luaL_error(L,"table too deep for "LUA_QL("unrope")); for (i=1;; i++) { lua_rawgeti(L,t,i); switch (lua_type(L,-1)) { case LUA_TNIL: lua_pop(L,1); return needsep; case LUA_TNUMBER: case LUA_TSTRING: if (needsep) {lua_pushvalue(L,1); luaL_addvalue(b);} luaL_addvalue(b); needsep=1; break; case LUA_TTABLE: lua_replace(L,t+1); needsep=doconcat(L,b,t+1,needsep); break; default: lua_pop(L,1); } } } static int unrope (lua_State *L) { luaL_Buffer b; luaL_checktype(L,1,LUA_TTABLE); lua_settop(L,2); if (lua_isnil(L,2)) {lua_pushliteral(L,""); lua_replace(L,2);} else luaL_checkstring(L,2); lua_insert(L,1); luaL_checkstack(L,MAXLEVEL-1+LUA_MINSTACK,"cannot grow stack"); lua_settop(L,MAXLEVEL+1); luaL_buffinit(L,&b); doconcat(L,&b,2,0); luaL_pushresult(&b); return 1; } LUALIB_API int luaopen_rope (lua_State *L) { lua_register(L,"unrope",unrope); return 0; } From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 18:18:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CLI0xo023078; Wed, 12 Aug 2009 18:18:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 411B91902A; Wed, 12 Aug 2009 18:17:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0185318C30 for ; Wed, 12 Aug 2009 18:17:17 -0300 (BRT) Received: by yxe5 with SMTP id 5so426051yxe.33 for ; Wed, 12 Aug 2009 14:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=BfpDZyD5OqHC7JAqKDzVlNu1BUza8d2d2UHjOcKYlxk=; b=Xa3y/6ddZDqU8pstBNgAvFpiSUOPAUIv6um+cGEkAbpY0/pBqAQ7SEFk/mLeZZDzzS OGXFSDpurAlvk5XxoRJPAKSrnaycgumdmRtNDEnVBAVAYebt9trHsIurlyPG8AaR8nY4 RvUNXbbvlc++cTMlFWJLsoB84p08eUYzeXez4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=K/APLiukjfiJFaexUl5DLIXGU/7MNEEoDp9WC1QkKCpuPicDkJ0iblbt8Ecbqud4Jy 7tmiVCqFJkkCCTKXyLXRZmE8d0LkpKlcuEfWYKW+lJ1hg+/sBJRxudpXsb8T+CRpy/D5 Hmq1txR0lekvMfYH96WUXhNSYay1+7JVkjVNM= Received: by 10.90.119.15 with SMTP id r15mr206700agc.112.1250111836603; Wed, 12 Aug 2009 14:17:16 -0700 (PDT) Received: from ?192.168.1.101? (adsl-99-65-192-210.dsl.wlfrct.sbcglobal.net [99.65.192.210]) by mx.google.com with ESMTPS id 39sm167628aga.21.2009.08.12.14.17.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Aug 2009 14:17:15 -0700 (PDT) Message-Id: <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> From: Doug Currie To: Lua list In-Reply-To: <4A82CE3A.8020007@elbitsystems-us.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: ... as an "expand list" unary postfix operator Date: Wed, 12 Aug 2009 17:17:13 -0400 References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 12, 2009, at 10:14 AM, Doug Rogers wrote: > > And I think { get_items()..., "no more" } is a clever solution. > Being an ellipsis, the ... token has a relatively clear meaning in > this context. I agree. It looks clear to me, too. Being unsupported syntax now means there's little risk in adding it: existing code won't break. > So I encourage you, Duncan, to try it out and share any results. > Even if it doesn't work out, you (and we) will learn from it. Ditto. e From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 19:29:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CMTK6F001642; Wed, 12 Aug 2009 19:29:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4C95191AE; Wed, 12 Aug 2009 19:28:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81C9F1908D for ; Wed, 12 Aug 2009 19:28:48 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CMSlSt001486 for ; Wed, 12 Aug 2009 19:28:47 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 079221F115F; Wed, 12 Aug 2009 19:28:47 -0300 (BRT) Date: Wed, 12 Aug 2009 19:28:46 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: Lua BR Message-ID: <20090812222846.GA17366@magritte.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Lua BR é a versão brasileira da lista de Lua. Para participar, visite http://groups.google.com/group/lua-br/subscribe Todos são bem vindos! A gente se vê por lá também! --lhf From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 19:59:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CMxZup008745; Wed, 12 Aug 2009 19:59:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5F8A1918C; Wed, 12 Aug 2009 19:59:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D24B818FC9 for ; Wed, 12 Aug 2009 19:58:55 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CMwrqS008676 for ; Wed, 12 Aug 2009 19:58:53 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n7CMwrdx008674 for lua@bazar2.conectiva.com.br; Wed, 12 Aug 2009 19:58:53 -0300 Date: Wed, 12 Aug 2009 19:58:52 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: Re: Lua BR Message-ID: <20090812225852.GA8444@duchamp.tecgraf.puc-rio.br> References: <20090812222846.GA17366@magritte.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090812222846.GA17366@magritte.tecgraf.puc-rio.br> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Lua BR é a versão brasileira da lista de Lua. Para participar, visite > http://groups.google.com/group/lua-br/subscribe > > Todos são bem vindos! A gente se vê por lá também! I'm sorry for posting only in Portuguese. Anyway, Lua BR is the brazilian version of lua-l. The primary language of Lua BR is meant to be Portuguese. Everyone is welcome. See you there as well. From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 20:26:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7CNQnmp012016; Wed, 12 Aug 2009 20:26:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FFC019180; Wed, 12 Aug 2009 20:26:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76A8718F5F for ; Wed, 12 Aug 2009 20:26:11 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so163917ana.26 for ; Wed, 12 Aug 2009 16:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=/dc3A9ypO2CT2JrEhfVVbmijtfP7vWTYaKBskf3I6eA=; b=ax/DWsC4IpKTTkYXEXGc103Jiahhn0lBBqmY23Z5Xodj2vZCuBTpBL/8J3u7IK65bx 7PmtdytlIBqw8p31q0wvaDUrbomXcOwThbxb8vaUuBeVhoS02hQqHWr/UPeBG6xow7z/ z9bAGf5G6gSlOKg/Q+ZKPGzQW4gkWFJ0iwVw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=FWjbU9pkStCuL+gE7mh1J/mvc4B3V7DjpkbLw3XITixdELk0L/yr6tqB17kHyTCNSD 2O/uAXhCOFEtsQ/j5Roqnomz4uGmgVsEJ+NK0l+LFgLS3YFtLx7yEdMvzcim6UF9YqH9 xBtuPwZMusHNQSQANc3jG4WHyqGL3yReWzFBo= MIME-Version: 1.0 Received: by 10.101.166.37 with SMTP id t37mr507533ano.138.1250119570283; Wed, 12 Aug 2009 16:26:10 -0700 (PDT) In-Reply-To: <20090812222846.GA17366@magritte.tecgraf.puc-rio.br> References: <20090812222846.GA17366@magritte.tecgraf.puc-rio.br> Date: Wed, 12 Aug 2009 19:26:10 -0400 X-Google-Sender-Auth: d7673cf4ddd8e3a2 Message-ID: Subject: Re: Lua BR From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7CNQnmp012016 > Lua BR é a versão brasileira da lista de Lua. Para participar, visite >        http://groups.google.com/group/lua-br/subscribe Or, if you want to subscribe without creating a google account, just send a blank message to: lua-br+subscribe@googlegroups.com (The sender address will get subscribed.) - yuri From lua-bounces@bazar2.conectiva.com.br Wed Aug 12 22:40:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7D1e50R026605; Wed, 12 Aug 2009 22:40:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8E6E1928C; Wed, 12 Aug 2009 22:38:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1859C1920D for ; Wed, 12 Aug 2009 22:38:47 -0300 (BRT) Received: by ewy26 with SMTP id 26so478640ewy.5 for ; Wed, 12 Aug 2009 18:38:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.2.212 with SMTP id 62mr115505wef.150.1250127525322; Wed, 12 Aug 2009 18:38:45 -0700 (PDT) In-Reply-To: <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> Date: Thu, 13 Aug 2009 02:38:45 +0100 X-Google-Sender-Auth: b1e1db5b7acfb833 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: multipart/mixed; boundary=0016364d259712210c0470fbffbd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364d259712210c0470fbffbd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Aug 12, 2009 at 10:17 PM, Doug Currie wrote: > > On Aug 12, 2009, at 10:14 AM, Doug Rogers wrote: >> >> And I think { get_items()..., "no more" } is a clever solution. Being an >> ellipsis, the ... token has a relatively clear meaning in this context. > > I agree. It looks clear to me, too. Being unsupported syntax now means > there's little risk in adding it: existing code won't break. > >> So I encourage you, Duncan, to try it out and share any results. Even if >> it doesn't work out, you (and we) will learn from it. > To get the ball rolling with some code, I've attached a diff which allows "..." after an expression in an expression list and after a list value in a table constructor, along with a file which has a few tests / examples in it. My knowledge of the Lua source code is not overly great, so the patch may be rather rough in places. This patch is implemented in two parts. Firstly, there is the table constructor part, which involves a major change to the SETLIST opcode. Instead of the SETLIST specifying where to insert the values, each Table structure remembers where SETLIST should insert values. This conveniently does away with the SETLIST with c == 0 edge condition, which can simplify the bytecode verifier. The downsides are an extra int field in every table, and lack of bytecode compatibility. The second part is for expanding expressions in expression lists. In terms of pseudo code, this transforms expression lists like "e1, e2 ..., e3, ..." into "e1, detuple(tuple(e2), e3, ...)", though tuple and detuple are VM opcodes rather than functions. The TUPLE opcode takes 2 or more stack values, copies them to a new tuple data array area of a lua_State, and replaces them with a single value which points to the new position of the values in the tuple array. The DETUPLE opcode expands zero or more tuples back into the stack. --0016364d259712210c0470fbffbd Content-Type: application/octet-stream; name="expvar.diff" Content-Disposition: attachment; filename="expvar.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fyaswu6q0 ZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5jIHNyYy9sY29kZS5jDQotLS0gLi4v Li4vbHVhLTUuMS40L3NyYy9sY29kZS5jCUZyaSBEZWMgMjggMTU6MzI6MjQgMjAwNw0KKysrIHNy Yy9sY29kZS5jCVRodSBBdWcgMTMgMDE6Mzg6MTggMjAwOQ0KQEAgLTI3OCw3ICsyNzgsNyBAQA0K IA0KIA0KIHZvaWQgbHVhS19zZXRyZXR1cm5zIChGdW5jU3RhdGUgKmZzLCBleHBkZXNjICplLCBp bnQgbnJlc3VsdHMpIHsNCi0gIGlmIChlLT5rID09IFZDQUxMKSB7ICAvKiBleHByZXNzaW9uIGlz IGFuIG9wZW4gZnVuY3Rpb24gY2FsbD8gKi8NCisgIGlmIChlLT5rID09IFZDQUxMIHx8IGUtPmsg PT0gVkRFVFVQTEUpIHsgIC8qIGV4cHJlc3Npb24gaXMgYW4gb3BlbiBmdW5jdGlvbiBjYWxsPyAq Lw0KICAgICBTRVRBUkdfQyhnZXRjb2RlKGZzLCBlKSwgbnJlc3VsdHMrMSk7DQogICB9DQogICBl bHNlIGlmIChlLT5rID09IFZWQVJBUkcpIHsNCkBAIC0zMjUsNyArMzI1LDggQEANCiAgICAgICBi cmVhazsNCiAgICAgfQ0KICAgICBjYXNlIFZWQVJBUkc6DQotICAgIGNhc2UgVkNBTEw6IHsNCisg ICAgY2FzZSBWQ0FMTDoNCisgICAgY2FzZSBWREVUVVBMRTogew0KICAgICAgIGx1YUtfc2V0b25l cmV0KGZzLCBlKTsNCiAgICAgICBicmVhazsNCiAgICAgfQ0KQEAgLTgyNCwxNiArODI1LDEwIEBA DQogfQ0KIA0KIA0KLXZvaWQgbHVhS19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwg aW50IG5lbGVtcywgaW50IHRvc3RvcmUpIHsNCi0gIGludCBjID0gIChuZWxlbXMgLSAxKS9MRklF TERTX1BFUl9GTFVTSCArIDE7DQordm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMsIGlu dCBiYXNlLCBpbnQgdG9zdG9yZSkgew0KICAgaW50IGIgPSAodG9zdG9yZSA9PSBMVUFfTVVMVFJF VCkgPyAwIDogdG9zdG9yZTsNCiAgIGx1YV9hc3NlcnQodG9zdG9yZSAhPSAwKTsNCi0gIGlmIChj IDw9IE1BWEFSR19DKQ0KLSAgICBsdWFLX2NvZGVBQkMoZnMsIE9QX1NFVExJU1QsIGJhc2UsIGIs IGMpOw0KLSAgZWxzZSB7DQotICAgIGx1YUtfY29kZUFCQyhmcywgT1BfU0VUTElTVCwgYmFzZSwg YiwgMCk7DQotICAgIGx1YUtfY29kZShmcywgY2FzdChJbnN0cnVjdGlvbiwgYyksIGZzLT5scy0+ bGFzdGxpbmUpOw0KLSAgfQ0KKyAgbHVhS19jb2RlQUJDKGZzLCBPUF9TRVRMSVNULCBiYXNlLCBi LCAwKTsNCiAgIGZzLT5mcmVlcmVnID0gYmFzZSArIDE7ICAvKiBmcmVlIHJlZ2lzdGVycyB3aXRo IGxpc3QgdmFsdWVzICovDQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29k ZS5oIHNyYy9sY29kZS5oDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5oCVRodSBEZWMg MjcgMTM6MDI6MjYgMjAwNw0KKysrIHNyYy9sY29kZS5oCVRodSBBdWcgMTMgMDE6Mzg6MjggMjAw OQ0KQEAgLTcwLDcgKzcwLDcgQEANCiBMVUFJX0ZVTkMgdm9pZCBsdWFLX3ByZWZpeCAoRnVuY1N0 YXRlICpmcywgVW5PcHIgb3AsIGV4cGRlc2MgKnYpOw0KIExVQUlfRlVOQyB2b2lkIGx1YUtfaW5m aXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdik7DQogTFVBSV9GVU5DIHZv aWQgbHVhS19wb3NmaXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdjEsIGV4 cGRlc2MgKnYyKTsNCi1MVUFJX0ZVTkMgdm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMs IGludCBiYXNlLCBpbnQgbmVsZW1zLCBpbnQgdG9zdG9yZSk7DQorTFVBSV9GVU5DIHZvaWQgbHVh S19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwgaW50IHRvc3RvcmUpOw0KIA0KIA0K ICNlbmRpZg0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sZGVidWcuYyBzcmMvbGRlYnVn LmMNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xkZWJ1Zy5jCVRodSBNYXkgIDggMTc6NTY6MjYg MjAwOA0KKysrIHNyYy9sZGVidWcuYwlXZWQgQXVnIDEyIDE5OjMxOjUzIDIwMDkNCkBAIC0yOTIs NyArMjkyLDkgQEANCiAgICAgY2FzZSBPUF9DQUxMOg0KICAgICBjYXNlIE9QX1RBSUxDQUxMOg0K ICAgICBjYXNlIE9QX1JFVFVSTjoNCi0gICAgY2FzZSBPUF9TRVRMSVNUOiB7DQorICAgIGNhc2Ug T1BfU0VUTElTVDoNCisgICAgY2FzZSBPUF9UVVBMRToNCisgICAgY2FzZSBPUF9ERVRVUExFOiB7 DQogICAgICAgY2hlY2soR0VUQVJHX0IoaSkgPT0gMCk7DQogICAgICAgcmV0dXJuIDE7DQogICAg IH0NCkBAIC00NjYsNiArNDY4LDE4IEBADQogICAgICAgICBiLS07DQogICAgICAgICBpZiAoYiA9 PSBMVUFfTVVMVFJFVCkgY2hlY2soY2hlY2tvcGVub3AocHQsIHBjKSk7DQogICAgICAgICBjaGVj a3JlZyhwdCwgYStiLTEpOw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNhc2Ug T1BfVFVQTEU6IHsNCisgICAgICAgIC8qIFRPRE86IEFyZSBhbnkgY2hlY2tzIHJlcXVpcmVkPyAq Lw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfREVUVVBMRTogew0K KyAgICAgICAgLyogVE9ETzogQXJlIGFueSBvdGhlciBjaGVja3MgcmVxdWlyZWQ/ICovDQorICAg ICAgICBjLS07ICAvKiBjID0gbnVtLiByZXR1cm5zICovDQorICAgICAgICBpZiAoYyA9PSBMVUFf TVVMVFJFVCkgew0KKyAgICAgICAgICBjaGVjayhjaGVja29wZW5vcChwdCwgcGMpKTsNCisgICAg ICAgIH0NCiAgICAgICAgIGJyZWFrOw0KICAgICAgIH0NCiAgICAgICBkZWZhdWx0OiBicmVhazsN CmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbGRvLmMgc3JjL2xkby5jDQotLS0gLi4vLi4v bHVhLTUuMS40L3NyYy9sZG8uYwlGcmkgSmFuIDE4IDIyOjMxOjIyIDIwMDgNCisrKyBzcmMvbGRv LmMJV2VkIEF1ZyAxMiAxNzo0NDoyOCAyMDA5DQpAQCAtMjkxLDYgKzI5MSw3IEBADQogICAgIGNp LT50b3AgPSBMLT5iYXNlICsgcC0+bWF4c3RhY2tzaXplOw0KICAgICBsdWFfYXNzZXJ0KGNpLT50 b3AgPD0gTC0+c3RhY2tfbGFzdCk7DQogICAgIEwtPnNhdmVkcGMgPSBwLT5jb2RlOyAgLyogc3Rh cnRpbmcgcG9pbnQgKi8NCisgICAgY2ktPnNhdmVkdHVwID0gY2FzdF9pbnQoTC0+dHVwbGVzdG9w IC0gTC0+dHVwbGVzKTsNCiAgICAgY2ktPnRhaWxjYWxscyA9IDA7DQogICAgIGNpLT5ucmVzdWx0 cyA9IG5yZXN1bHRzOw0KICAgICBmb3IgKHN0ID0gTC0+dG9wOyBzdCA8IGNpLT50b3A7IHN0Kysp DQpAQCAtMzEyLDYgKzMxMyw3IEBADQogICAgIEwtPmJhc2UgPSBjaS0+YmFzZSA9IGNpLT5mdW5j ICsgMTsNCiAgICAgY2ktPnRvcCA9IEwtPnRvcCArIExVQV9NSU5TVEFDSzsNCiAgICAgbHVhX2Fz c2VydChjaS0+dG9wIDw9IEwtPnN0YWNrX2xhc3QpOw0KKyAgICBjaS0+c2F2ZWR0dXAgPSBjYXN0 X2ludChMLT50dXBsZXN0b3AgLSBMLT50dXBsZXMpOw0KICAgICBjaS0+bnJlc3VsdHMgPSBucmVz dWx0czsNCiAgICAgaWYgKEwtPmhvb2ttYXNrICYgTFVBX01BU0tDQUxMKQ0KICAgICAgIGx1YURf Y2FsbGhvb2soTCwgTFVBX0hPT0tDQUxMLCAtMSk7DQpAQCAtNDY3LDYgKzQ2OSw3IEBADQogICAg IGx1YURfc2V0ZXJyb3JvYmooTCwgc3RhdHVzLCBvbGR0b3ApOw0KICAgICBMLT5uQ2NhbGxzID0g b2xkbkNjYWxsczsNCiAgICAgTC0+Y2kgPSByZXN0b3JlY2koTCwgb2xkX2NpKTsNCisgICAgTC0+ dHVwbGVzdG9wID0gTC0+dHVwbGVzICsgTC0+Y2ktPnNhdmVkdHVwOw0KICAgICBMLT5iYXNlID0g TC0+Y2ktPmJhc2U7DQogICAgIEwtPnNhdmVkcGMgPSBMLT5jaS0+c2F2ZWRwYzsNCiAgICAgTC0+ YWxsb3dob29rID0gb2xkX2FsbG93aG9va3M7DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3Jj L2xnYy5jIHNyYy9sZ2MuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbGdjLmMJVGh1IERlYyAy NyAxMzowMjoyNiAyMDA3DQorKysgc3JjL2xnYy5jCVRodSBBdWcgMTMgMDA6NTc6MTAgMjAwOQ0K QEAgLTI2Niw2ICsyNjYsOCBAQA0KICAgICBtYXJrdmFsdWUoZywgbyk7DQogICBmb3IgKDsgbyA8 PSBsaW07IG8rKykNCiAgICAgc2V0bmlsdmFsdWUobyk7DQorICBmb3IgKG8gPSBsLT50dXBsZXM7 IG8gPCBsLT50dXBsZXN0b3A7IG8rKykNCisgICAgbWFya3ZhbHVlKGcsIG8pOw0KICAgY2hlY2tz dGFja3NpemVzKGwsIGxpbSk7DQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9s b2JqZWN0Lmggc3JjL2xvYmplY3QuaA0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9iamVjdC5o CVdlZCBBdWcgIDYgMTQ6Mjk6NDggMjAwOA0KKysrIHNyYy9sb2JqZWN0LmgJVGh1IEF1ZyAxMyAw MjoxMDo1NCAyMDA5DQpAQCAtMjgsNiArMjgsNyBAQA0KICNkZWZpbmUgTFVBX1RQUk9UTwkoTEFT VF9UQUcrMSkNCiAjZGVmaW5lIExVQV9UVVBWQUwJKExBU1RfVEFHKzIpDQogI2RlZmluZSBMVUFf VERFQURLRVkJKExBU1RfVEFHKzMpDQorI2RlZmluZSBMVUFfVFRVUExFICAoTFVBX1ROT05FLTEp IC8qIHR0ID49IExVQV9UU1RSSU5HIGFyZSBjb2xsZWN0YWJsZSAqLw0KIA0KIA0KIC8qDQpAQCAt NTEsOCArNTIsNiBAQA0KIH0gR0NoZWFkZXI7DQogDQogDQotDQotDQogLyoNCiAqKiBVbmlvbiBv ZiBhbGwgTHVhIHZhbHVlcw0KICovDQpAQCAtMTI1LDYgKzEyNCw5IEBADQogI2RlZmluZSBzZXRi dmFsdWUob2JqLHgpIFwNCiAgIHsgVFZhbHVlICppX289KG9iaik7IGlfby0+dmFsdWUuYj0oeCk7 IGlfby0+dHQ9TFVBX1RCT09MRUFOOyB9DQogDQorI2RlZmluZSBzZXR0dXZhbHVlKG9iaix4KSBc DQorICB7IFRWYWx1ZSAqaV9vPShvYmopOyBpX28tPnZhbHVlLmI9KHgpOyBpX28tPnR0PUxVQV9U VFVQTEU7IH0NCisNCiAjZGVmaW5lIHNldHN2YWx1ZShMLG9iaix4KSBcDQogICB7IFRWYWx1ZSAq aV9vPShvYmopOyBcDQogICAgIGlfby0+dmFsdWUuZ2M9Y2FzdChHQ09iamVjdCAqLCAoeCkpOyBp X28tPnR0PUxVQV9UU1RSSU5HOyBcDQpAQCAtMTg4LDYgKzE5MCw5IEBADQogDQogI2RlZmluZSBp c2NvbGxlY3RhYmxlKG8pCSh0dHlwZShvKSA+PSBMVUFfVFNUUklORykNCiANCisjZGVmaW5lIGdl dHR1dmFsdWUob2JqKSAoKG9iaiktPnZhbHVlLmIpDQorDQorI2RlZmluZSBnZXR0dXNpemUoTCwg b2JqKSAoZ2V0dHV2YWx1ZSgoTCktPnR1cGxlcyArIGdldHR1dmFsdWUob2JqKSkpDQogDQogDQog dHlwZWRlZiBUVmFsdWUgKlN0a0lkOyAgLyogaW5kZXggdG8gc3RhY2sgZWxlbWVudHMgKi8NCkBA IC0zNDUsOCArMzUwLDggQEANCiAgIE5vZGUgKmxhc3RmcmVlOyAgLyogYW55IGZyZWUgcG9zaXRp b24gaXMgYmVmb3JlIHRoaXMgcG9zaXRpb24gKi8NCiAgIEdDT2JqZWN0ICpnY2xpc3Q7DQogICBp bnQgc2l6ZWFycmF5OyAgLyogc2l6ZSBvZiBgYXJyYXknIGFycmF5ICovDQorICBpbnQgbmV4dHNl dGxpc3Q7ICAvKiBpbmRleCBmb3IgbmV4dCBPUF9TRVRMSVNUIHRvIGluc2VydCBhdCAqLw0KIH0g VGFibGU7DQotDQogDQogDQogLyoNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9wY29k ZXMuYyBzcmMvbG9wY29kZXMuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9wY29kZXMuYwlU aHUgRGVjIDI3IDEzOjAyOjI2IDIwMDcNCisrKyBzcmMvbG9wY29kZXMuYwlUaHUgQXVnIDEzIDAx OjI3OjExIDIwMDkNCkBAIC01Miw2ICs1Miw4IEBADQogICAiQ0xPU0UiLA0KICAgIkNMT1NVUkUi LA0KICAgIlZBUkFSRyIsDQorICAiVFVQTEUiLA0KKyAgIkRFVFVQTEUiLA0KICAgTlVMTA0KIH07 DQogDQpAQCAtOTQsOSArOTYsMTEgQEANCiAgLG9wbW9kZSgwLCAxLCBPcEFyZ1IsIE9wQXJnTiwg aUFzQngpCQkvKiBPUF9GT1JMT09QICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdSLCBPcEFyZ04s IGlBc0J4KQkJLyogT1BfRk9SUFJFUCAqLw0KICAsb3Btb2RlKDEsIDAsIE9wQXJnTiwgT3BBcmdV LCBpQUJDKQkJLyogT1BfVEZPUkxPT1AgKi8NCi0gLG9wbW9kZSgwLCAwLCBPcEFyZ1UsIE9wQXJn VSwgaUFCQykJCS8qIE9QX1NFVExJU1QgKi8NCisgLG9wbW9kZSgwLCAwLCBPcEFyZ1UsIE9wQXJn TiwgaUFCQykJCS8qIE9QX1NFVExJU1QgKi8NCiAgLG9wbW9kZSgwLCAwLCBPcEFyZ04sIE9wQXJn TiwgaUFCQykJCS8qIE9QX0NMT1NFICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBPcEFyZ04s IGlBQngpCQkvKiBPUF9DTE9TVVJFICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBPcEFyZ04s IGlBQkMpCQkvKiBPUF9WQVJBUkcgKi8NCisgLG9wbW9kZSgwLCAxLCBPcEFyZ1UsIE9wQXJnTiwg aUFCQykgICAgICAgIC8qIE9QX1RVUExFICovDQorICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBPcEFy Z1UsIGlBQkMpICAgICAgICAvKiBPUF9ERVRVUExFICovDQogfTsNCiANCmRpZmYgLXVQIC4uLy4u L2x1YS01LjEuNC9zcmMvbG9wY29kZXMuaCBzcmMvbG9wY29kZXMuaA0KLS0tIC4uLy4uL2x1YS01 LjEuNC9zcmMvbG9wY29kZXMuaAlUaHUgRGVjIDI3IDEzOjAyOjI2IDIwMDcNCisrKyBzcmMvbG9w Y29kZXMuaAlXZWQgQXVnIDEyIDE5OjI4OjAyIDIwMDkNCkBAIC0yMDQsMTEgKzIwNCwxNCBAQA0K IE9QX0NMT1NFLC8qCUEgCWNsb3NlIGFsbCB2YXJpYWJsZXMgaW4gdGhlIHN0YWNrIHVwIHRvICg+ PSkgUihBKSovDQogT1BfQ0xPU1VSRSwvKglBIEJ4CVIoQSkgOj0gY2xvc3VyZShLUFJPVE9bQnhd LCBSKEEpLCAuLi4gLFIoQStuKSkJKi8NCiANCi1PUF9WQVJBUkcvKglBIEIJUihBKSwgUihBKzEp LCAuLi4sIFIoQStCLTEpID0gdmFyYXJnCQkqLw0KK09QX1ZBUkFSRywvKglBIEIJUihBKSwgUihB KzEpLCAuLi4sIFIoQStCLTEpID0gdmFyYXJnCQkqLw0KKw0KK09QX1RVUExFLC8qICBBIEIgICAg UihBKSA6PSB0dXBsZShSKEEpLCAuLi4sIFIoQStCLTEpKSovDQorT1BfREVUVVBMRSwvKiBBIEIg QyBSKEEpLCAuLi4gLFIoQStDLTIpIDo9IGRldHVwbGUoUihBKSkuLi4sIGRldHVwbGUoUihBKzEp Li4uLCAuLi4sIGRldHVwbGUoUihBK0ItMSkpICovDQogfSBPcENvZGU7DQogDQogDQotI2RlZmlu ZSBOVU1fT1BDT0RFUwkoY2FzdChpbnQsIE9QX1ZBUkFSRykgKyAxKQ0KKyNkZWZpbmUgTlVNX09Q Q09ERVMJKGNhc3QoaW50LCBPUF9ERVRVUExFKSArIDEpDQogDQogDQogDQpAQCAtMjE3LDYgKzIy MCwxMiBAQA0KICAgKCopIEluIE9QX0NBTEwsIGlmIChCID09IDApIHRoZW4gQiA9IHRvcC4gQyBp cyB0aGUgbnVtYmVyIG9mIHJldHVybnMgLSAxLA0KICAgICAgIGFuZCBjYW4gYmUgMDogT1BfQ0FM TCB0aGVuIHNldHMgYHRvcCcgdG8gbGFzdF9yZXN1bHQrMSwgc28NCiAgICAgICBuZXh0IG9wZW4g aW5zdHJ1Y3Rpb24gKE9QX0NBTEwsIE9QX1JFVFVSTiwgT1BfU0VUTElTVCkgbWF5IHVzZSBgdG9w Jy4NCisNCisgICgqKSBJbiBPUF9UVVBMRSwgaWYgKEIgPT0gMCkgdGhlbiBCID0gdG9wLiBJZiAo QiA9PSAxKSB0aGVuIG5vcC4NCisNCisgICgqKSBJbiBPUF9ERVRVUExFLCBpZiAoQiA9PSAwKSB0 aGVuIEIgPSB0b3AuIEMgaXMgdGhlIG51bWJlciBvZiByZXR1cm5zIC0gMSwNCisgICAgICBhbmQg Y2FuIGJlIDA6IE9QX0RFVFVQTEUgdGhlbiBzZXRzIGB0b3AnIHRvIGxhc3RfcmVzdWx0KzEsIHNv DQorICAgICAgbmV4dCBvcGVuIGluc3RydWN0aW9uIG1heSB1c2UgYHRvcCcuDQogDQogICAoKikg SW4gT1BfVkFSQVJHLCBpZiAoQiA9PSAwKSB0aGVuIHVzZSBhY3R1YWwgbnVtYmVyIG9mIHZhcmFy Z3MgYW5kDQogICAgICAgc2V0IHRvcCAobGlrZSBpbiBPUF9DQUxMIHdpdGggQyA9PSAwKS4NCmRp ZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbHBhcnNlci5jIHNyYy9scGFyc2VyLmMNCi0tLSAu Li8uLi9sdWEtNS4xLjQvc3JjL2xwYXJzZXIuYwlGcmkgRGVjIDI4IDE1OjMyOjI0IDIwMDcNCisr KyBzcmMvbHBhcnNlci5jCVRodSBBdWcgMTMgMDE6NDY6MDUgMjAwOQ0KQEAgLTI3LDcgKzI3LDcg QEANCiANCiANCiANCi0jZGVmaW5lIGhhc211bHRyZXQoaykJCSgoaykgPT0gVkNBTEwgfHwgKGsp ID09IFZWQVJBUkcpDQorI2RlZmluZSBoYXNtdWx0cmV0KGspCQkoKGspID09IFZDQUxMIHx8IChr KSA9PSBWVkFSQVJHIHx8IChrKSA9PSBWREVUVVBMRSkNCiANCiAjZGVmaW5lIGdldGxvY3Zhcihm cywgaSkJKChmcyktPmYtPmxvY3ZhcnNbKGZzKS0+YWN0dmFyW2ldXSkNCiANCkBAIC0xMjcsNiAr MTI3LDcgQEANCiAgIGUtPmYgPSBlLT50ID0gTk9fSlVNUDsNCiAgIGUtPmsgPSBrOw0KICAgZS0+ dS5zLmluZm8gPSBpOw0KKyAgZS0+dHVwID0gMDsNCiB9DQogDQogDQpAQCAtNDM1LDcgKzQzNiw3 IEBADQogICBleHBkZXNjIHY7ICAvKiBsYXN0IGxpc3QgaXRlbSByZWFkICovDQogICBleHBkZXNj ICp0OyAgLyogdGFibGUgZGVzY3JpcHRvciAqLw0KICAgaW50IG5oOyAgLyogdG90YWwgbnVtYmVy IG9mIGByZWNvcmQnIGVsZW1lbnRzICovDQotICBpbnQgbmE7ICAvKiB0b3RhbCBudW1iZXIgb2Yg YXJyYXkgZWxlbWVudHMgKi8NCisgIGludCBuYTsgIC8qIGd1ZXNzIGFzIHRvIHRvdGFsIG51bWJl ciBvZiBgYXJyYXknIGVsZW1lbnRzICovDQogICBpbnQgdG9zdG9yZTsgIC8qIG51bWJlciBvZiBh cnJheSBlbGVtZW50cyBwZW5kaW5nIHRvIGJlIHN0b3JlZCAqLw0KIH07DQogDQpAQCAtNDYzLDEw ICs0NjQsMTcgQEANCiANCiBzdGF0aWMgdm9pZCBjbG9zZWxpc3RmaWVsZCAoRnVuY1N0YXRlICpm cywgc3RydWN0IENvbnNDb250cm9sICpjYykgew0KICAgaWYgKGNjLT52LmsgPT0gVlZPSUQpIHJl dHVybjsgIC8qIHRoZXJlIGlzIG5vIGxpc3QgaXRlbSAqLw0KKyAgaWYgKGhhc211bHRyZXQoY2Mt PnYuaykgJiYgY2MtPnYudHVwKSB7DQorICAgIGx1YUtfc2V0bXVsdHJldChmcywgJmNjLT52KTsN CisgICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+dC0+dS5zLmluZm8sIExVQV9NVUxUUkVUKTsNCisg ICAgY2MtPnRvc3RvcmUgPSAwOyAgLyogbm8gbW9yZSBpdGVtcyBwZW5kaW5nICovDQorICAgIGNj LT5uYS0tOw0KKyAgICByZXR1cm47DQorICB9DQogICBsdWFLX2V4cDJuZXh0cmVnKGZzLCAmY2Mt PnYpOw0KICAgY2MtPnYuayA9IFZWT0lEOw0KICAgaWYgKGNjLT50b3N0b3JlID09IExGSUVMRFNf UEVSX0ZMVVNIKSB7DQotICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBjYy0+ bmEsIGNjLT50b3N0b3JlKTsgIC8qIGZsdXNoICovDQorICAgIGx1YUtfc2V0bGlzdChmcywgY2Mt PnQtPnUucy5pbmZvLCBjYy0+dG9zdG9yZSk7ICAvKiBmbHVzaCAqLw0KICAgICBjYy0+dG9zdG9y ZSA9IDA7ICAvKiBubyBtb3JlIGl0ZW1zIHBlbmRpbmcgKi8NCiAgIH0NCiB9DQpAQCAtNDc2LDIw ICs0ODQsMTkgQEANCiAgIGlmIChjYy0+dG9zdG9yZSA9PSAwKSByZXR1cm47DQogICBpZiAoaGFz bXVsdHJldChjYy0+di5rKSkgew0KICAgICBsdWFLX3NldG11bHRyZXQoZnMsICZjYy0+dik7DQot ICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBjYy0+bmEsIExVQV9NVUxUUkVU KTsNCi0gICAgY2MtPm5hLS07ICAvKiBkbyBub3QgY291bnQgbGFzdCBleHByZXNzaW9uICh1bmtu b3duIG51bWJlciBvZiBlbGVtZW50cykgKi8NCisgICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+dC0+ dS5zLmluZm8sIExVQV9NVUxUUkVUKTsNCisgICAgY2MtPm5hLS07DQogICB9DQogICBlbHNlIHsN CiAgICAgaWYgKGNjLT52LmsgIT0gVlZPSUQpDQogICAgICAgbHVhS19leHAybmV4dHJlZyhmcywg JmNjLT52KTsNCi0gICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+dC0+dS5zLmluZm8sIGNjLT5uYSwg Y2MtPnRvc3RvcmUpOw0KKyAgICBsdWFLX3NldGxpc3QoZnMsIGNjLT50LT51LnMuaW5mbywgY2Mt PnRvc3RvcmUpOw0KICAgfQ0KIH0NCiANCiANCiBzdGF0aWMgdm9pZCBsaXN0ZmllbGQgKExleFN0 YXRlICpscywgc3RydWN0IENvbnNDb250cm9sICpjYykgew0KICAgZXhwcihscywgJmNjLT52KTsN Ci0gIGx1YVlfY2hlY2tsaW1pdChscy0+ZnMsIGNjLT5uYSwgTUFYX0lOVCwgIml0ZW1zIGluIGEg Y29uc3RydWN0b3IiKTsNCiAgIGNjLT5uYSsrOw0KICAgY2MtPnRvc3RvcmUrKzsNCiB9DQpAQCAt NTI2LDYgKzUzMyw4IEBADQogICAgICAgfQ0KICAgICAgIGRlZmF1bHQ6IHsgIC8qIGNvbnN0cnVj dG9yX3BhcnQgLT4gbGlzdGZpZWxkICovDQogICAgICAgICBsaXN0ZmllbGQobHMsICZjYyk7DQor ICAgICAgICBpZiAodGVzdG5leHQobHMsIFRLX0RPVFMpKQ0KKyAgICAgICAgICBjYy52LnR1cCA9 IDE7DQogICAgICAgICBicmVhazsNCiAgICAgICB9DQogICAgIH0NCkBAIC01OTYsMTEgKzYwNSw0 OSBAQA0KIHN0YXRpYyBpbnQgZXhwbGlzdDEgKExleFN0YXRlICpscywgZXhwZGVzYyAqdikgew0K ICAgLyogZXhwbGlzdDEgLT4gZXhwciB7IGAsJyBleHByIH0gKi8NCiAgIGludCBuID0gMTsgIC8q IGF0IGxlYXN0IG9uZSBleHByZXNzaW9uICovDQorICBpbnQgdHVwbGVzID0gMDsNCisgIGludCBk ZXR1cGxlX2Zyb20gPSAtMTsNCiAgIGV4cHIobHMsIHYpOw0KKyAgaWYgKHRlc3RuZXh0KGxzLCBU S19ET1RTKSkNCisgICAgdi0+dHVwID0gdHVwbGVzID0gMTsNCiAgIHdoaWxlICh0ZXN0bmV4dChs cywgJywnKSkgew0KLSAgICBsdWFLX2V4cDJuZXh0cmVnKGxzLT5mcywgdik7DQorICAgIGlmKHYt PnR1cCkgew0KKyAgICAgIGlmICghaGFzbXVsdHJldCh2LT5rKSkNCisgICAgICAgIGx1YVhfc3lu dGF4ZXJyb3IobHMsICJDYW5ub3QgZXhwYW5kIGZpeGVkLWxlbmd0aCBleHByZXNzaW9uIik7DQor ICAgICAgbHVhS19zZXRtdWx0cmV0KGxzLT5mcywgdik7DQorICAgICAgbHVhS19jb2RlQUJDKGxz LT5mcywgT1BfVFVQTEUsIGxzLT5mcy0+ZnJlZXJlZyAtIDEsIDAsIDApOw0KKyAgICAgIGlmIChk ZXR1cGxlX2Zyb20gPT0gLTEpDQorICAgICAgICBkZXR1cGxlX2Zyb20gPSBscy0+ZnMtPmZyZWVy ZWcgLSAxOw0KKyAgICB9DQorICAgIGVsc2Ugew0KKyAgICAgIGx1YUtfZXhwMm5leHRyZWcobHMt PmZzLCB2KTsNCisgICAgfQ0KICAgICBleHByKGxzLCB2KTsNCisgICAgaWYgKHR1cGxlcyAhPSAw KQ0KKyAgICAgdHVwbGVzKys7DQorICAgIGlmICh0ZXN0bmV4dChscywgVEtfRE9UUykpIHsNCisg ICAgICBpZiAodHVwbGVzID09IDApDQorICAgICAgICB0dXBsZXMgPSAxOw0KKyAgICAgIHYtPnR1 cCA9IDE7DQorICAgIH0NCiAgICAgbisrOw0KKyAgfQ0KKyAgaWYgKHR1cGxlcyAhPSAwKSB7DQor ICAgIGludCB1cHRvOw0KKyAgICBpZiAodi0+dHVwID09IDEpIHsNCisgICAgICBsdWFYX3N5bnRh eGVycm9yKGxzLCAiQ2Fubm90IGV4cGFuZCBsYXN0IGV4cHJlc3Npb24gaW4gYSBsaXN0LCBhcyBp dCBpcyBhbHJlYWR5IGV4cGFuZGVkIik7DQorICAgIH0NCisgICAgaWYgKGhhc211bHRyZXQodi0+ aykpIHsNCisgICAgICBsdWFLX3NldG11bHRyZXQobHMtPmZzLCB2KTsNCisgICAgICB1cHRvID0g MDsgLyogdG9wICovDQorICAgIH0NCisgICAgZWxzZSB7DQorICAgICAgbHVhS19leHAybmV4dHJl Zyhscy0+ZnMsIHYpOw0KKyAgICAgIHVwdG8gPSBscy0+ZnMtPmZyZWVyZWcgLSBkZXR1cGxlX2Zy b207DQorICAgIH0NCisgICAgaW5pdF9leHAodiwgVkRFVFVQTEUsIGx1YUtfY29kZUFCQyhscy0+ ZnMsIE9QX0RFVFVQTEUsIGRldHVwbGVfZnJvbSwgdXB0bywgMCkpOw0KKyAgICBscy0+ZnMtPmZy ZWVyZWcgKz0gMSAtIHR1cGxlczsNCisgICAgcmV0dXJuIChuIC0gdHVwbGVzICsgMSk7DQogICB9 DQogICByZXR1cm4gbjsNCiB9DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xwYXJzZXIu aCBzcmMvbHBhcnNlci5oDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9scGFyc2VyLmgJVGh1IERl YyAyNyAxMzowMjoyNiAyMDA3DQorKysgc3JjL2xwYXJzZXIuaAlXZWQgQXVnIDEyIDE5OjI1OjQ5 IDIwMDkNCkBAIC0zMSw3ICszMSw4IEBADQogICBWUkVMT0NBQkxFLAkvKiBpbmZvID0gaW5zdHJ1 Y3Rpb24gcGMgKi8NCiAgIFZOT05SRUxPQywJLyogaW5mbyA9IHJlc3VsdCByZWdpc3RlciAqLw0K ICAgVkNBTEwsCS8qIGluZm8gPSBpbnN0cnVjdGlvbiBwYyAqLw0KLSAgVlZBUkFSRwkvKiBpbmZv ID0gaW5zdHJ1Y3Rpb24gcGMgKi8NCisgIFZWQVJBUkcsCS8qIGluZm8gPSBpbnN0cnVjdGlvbiBw YyAqLw0KKyAgVkRFVFVQTEUgIC8qIGluZm8gPSBpbnN0cnVjdGlvbiBwYyAqLw0KIH0gZXhwa2lu ZDsNCiANCiB0eXBlZGVmIHN0cnVjdCBleHBkZXNjIHsNCkBAIC00Miw2ICs0Myw3IEBADQogICB9 IHU7DQogICBpbnQgdDsgIC8qIHBhdGNoIGxpc3Qgb2YgYGV4aXQgd2hlbiB0cnVlJyAqLw0KICAg aW50IGY7ICAvKiBwYXRjaCBsaXN0IG9mIGBleGl0IHdoZW4gZmFsc2UnICovDQorICBpbnQgdHVw OyAvKiBpZiBub24temVybywgdHVybiBpbnRvIGEgdHVwbGUgKi8NCiB9IGV4cGRlc2M7DQogDQog DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xzdGF0ZS5jIHNyYy9sc3RhdGUuYw0KLS0t IC4uLy4uL2x1YS01LjEuNC9zcmMvbHN0YXRlLmMJVGh1IEphbiAgMyAxNToyMDo0MCAyMDA4DQor Kysgc3JjL2xzdGF0ZS5jCVdlZCBBdWcgMTIgMTc6NDA6MzYgMjAwOQ0KQEAgLTUxLDE2ICs1MSwy MiBAQA0KICAgTDEtPnRvcCA9IEwxLT5zdGFjazsNCiAgIEwxLT5zdGFja19sYXN0ID0gTDEtPnN0 YWNrKyhMMS0+c3RhY2tzaXplIC0gRVhUUkFfU1RBQ0spLTE7DQogICAvKiBpbml0aWFsaXplIGZp cnN0IGNpICovDQorICBMMS0+Y2ktPnNhdmVkdHVwID0gMDsNCiAgIEwxLT5jaS0+ZnVuYyA9IEwx LT50b3A7DQogICBzZXRuaWx2YWx1ZShMMS0+dG9wKyspOyAgLyogYGZ1bmN0aW9uJyBlbnRyeSBm b3IgdGhpcyBgY2knICovDQogICBMMS0+YmFzZSA9IEwxLT5jaS0+YmFzZSA9IEwxLT50b3A7DQog ICBMMS0+Y2ktPnRvcCA9IEwxLT50b3AgKyBMVUFfTUlOU1RBQ0s7DQorICAvKiB0dXBsZXMgKi8N CisgIEwxLT50dXBsZXNzaXplID0gNDsNCisgIEwxLT50dXBsZXMgPSBsdWFNX25ld3ZlY3RvcihM LCBMMS0+dHVwbGVzc2l6ZSwgVFZhbHVlKTsNCisgIEwxLT50dXBsZXN0b3AgPSBMMS0+dHVwbGVz Ow0KIH0NCiANCiANCiBzdGF0aWMgdm9pZCBmcmVlc3RhY2sgKGx1YV9TdGF0ZSAqTCwgbHVhX1N0 YXRlICpMMSkgew0KICAgbHVhTV9mcmVlYXJyYXkoTCwgTDEtPmJhc2VfY2ksIEwxLT5zaXplX2Np LCBDYWxsSW5mbyk7DQogICBsdWFNX2ZyZWVhcnJheShMLCBMMS0+c3RhY2ssIEwxLT5zdGFja3Np emUsIFRWYWx1ZSk7DQorICBsdWFNX2ZyZWVhcnJheShMLCBMMS0+dHVwbGVzLCBMMS0+dHVwbGVz c2l6ZSwgVFZhbHVlKTsNCiB9DQogDQogDQpAQCAtODUsNiArOTEsOSBAQA0KICAgRyhMKSA9IGc7 DQogICBMLT5zdGFjayA9IE5VTEw7DQogICBMLT5zdGFja3NpemUgPSAwOw0KKyAgTC0+dHVwbGVz ID0gTlVMTDsNCisgIEwtPnR1cGxlc3RvcCA9IE5VTEw7DQorICBMLT50dXBsZXNzaXplID0gMDsN CiAgIEwtPmVycm9ySm1wID0gTlVMTDsNCiAgIEwtPmhvb2sgPSBOVUxMOw0KICAgTC0+aG9va21h c2sgPSAwOw0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sc3RhdGUuaCBzcmMvbHN0YXRl LmgNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xzdGF0ZS5oCVRodSBKYW4gIDMgMTU6MjA6NDAg MjAwOA0KKysrIHNyYy9sc3RhdGUuaAlXZWQgQXVnIDEyIDE2OjI3OjU1IDIwMDkNCkBAIC01MCw2 ICs1MCw3IEBADQogICBTdGtJZCBmdW5jOyAgLyogZnVuY3Rpb24gaW5kZXggaW4gdGhlIHN0YWNr ICovDQogICBTdGtJZAl0b3A7ICAvKiB0b3AgZm9yIHRoaXMgZnVuY3Rpb24gKi8NCiAgIGNvbnN0 IEluc3RydWN0aW9uICpzYXZlZHBjOw0KKyAgaW50IHNhdmVkdHVwOyAgLyogYW1vdW50IG9mIHR1 cGxlIHNwYWNlIHVzZWQgdW5kZXIgdGhpcyBmdW5jdGlvbiAqLw0KICAgaW50IG5yZXN1bHRzOyAg LyogZXhwZWN0ZWQgbnVtYmVyIG9mIHJlc3VsdHMgZnJvbSB0aGlzIGZ1bmN0aW9uICovDQogICBp bnQgdGFpbGNhbGxzOyAgLyogbnVtYmVyIG9mIHRhaWwgY2FsbHMgbG9zdCB1bmRlciB0aGlzIGVu dHJ5ICovDQogfSBDYWxsSW5mbzsNCkBAIC0xMDcsNiArMTA4LDkgQEANCiAgIGNvbnN0IEluc3Ry dWN0aW9uICpzYXZlZHBjOyAgLyogYHNhdmVkcGMnIG9mIGN1cnJlbnQgZnVuY3Rpb24gKi8NCiAg IFN0a0lkIHN0YWNrX2xhc3Q7ICAvKiBsYXN0IGZyZWUgc2xvdCBpbiB0aGUgc3RhY2sgKi8NCiAg IFN0a0lkIHN0YWNrOyAgLyogc3RhY2sgYmFzZSAqLw0KKyAgU3RrSWQgdHVwbGVzOyAvKiB0dXBs ZXMgYmFzZSAqLw0KKyAgU3RrSWQgdHVwbGVzdG9wOyAvKiBmcmVlIHBvc2l0aW9uIGZvciBuZXh0 IHR1cGxlICovDQorICBpbnQgdHVwbGVzc2l6ZTsgLyogc2l6ZSBvZiB0dXBsZXMgYXJyYXkgKi8N CiAgIENhbGxJbmZvICplbmRfY2k7ICAvKiBwb2ludHMgYWZ0ZXIgZW5kIG9mIGNpIGFycmF5Ki8N CiAgIENhbGxJbmZvICpiYXNlX2NpOyAgLyogYXJyYXkgb2YgQ2FsbEluZm8ncyAqLw0KICAgaW50 IHN0YWNrc2l6ZTsNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbHRhYmxlLmMgc3JjL2x0 YWJsZS5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sdGFibGUuYwlGcmkgRGVjIDI4IDE1OjMy OjI0IDIwMDcNCisrKyBzcmMvbHRhYmxlLmMJVGh1IEF1ZyAxMyAwMToyNTo0MCAyMDA5DQpAQCAt MzYzLDYgKzM2Myw3IEBADQogICAvKiB0ZW1wb3JhcnkgdmFsdWVzIChrZXB0IG9ubHkgaWYgc29t ZSBtYWxsb2MgZmFpbHMpICovDQogICB0LT5hcnJheSA9IE5VTEw7DQogICB0LT5zaXplYXJyYXkg PSAwOw0KKyAgdC0+bmV4dHNldGxpc3QgPSAwOw0KICAgdC0+bHNpemVub2RlID0gMDsNCiAgIHQt Pm5vZGUgPSBjYXN0KE5vZGUgKiwgZHVtbXlub2RlKTsNCiAgIHNldGFycmF5dmVjdG9yKEwsIHQs IG5hcnJheSk7DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2x2bS5jIHNyYy9sdm0uYw0K LS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbHZtLmMJU3VuIEZlYiAgOCAxMzozMDo0OSAyMDA5DQor Kysgc3JjL2x2bS5jCVRodSBBdWcgMTMgMDI6MTc6MTUgMjAwOQ0KQEAgLTY5MiwxNyArNjkyLDE2 IEBADQogICAgICAgfQ0KICAgICAgIGNhc2UgT1BfU0VUTElTVDogew0KICAgICAgICAgaW50IG4g PSBHRVRBUkdfQihpKTsNCi0gICAgICAgIGludCBjID0gR0VUQVJHX0MoaSk7DQogICAgICAgICBp bnQgbGFzdDsNCiAgICAgICAgIFRhYmxlICpoOw0KICAgICAgICAgaWYgKG4gPT0gMCkgew0KICAg ICAgICAgICBuID0gY2FzdF9pbnQoTC0+dG9wIC0gcmEpIC0gMTsNCiAgICAgICAgICAgTC0+dG9w ID0gTC0+Y2ktPnRvcDsNCiAgICAgICAgIH0NCi0gICAgICAgIGlmIChjID09IDApIGMgPSBjYXN0 X2ludCgqcGMrKyk7DQogICAgICAgICBydW50aW1lX2NoZWNrKEwsIHR0aXN0YWJsZShyYSkpOw0K ICAgICAgICAgaCA9IGh2YWx1ZShyYSk7DQotICAgICAgICBsYXN0ID0gKChjLTEpKkxGSUVMRFNf UEVSX0ZMVVNIKSArIG47DQorICAgICAgICBsYXN0ID0gaC0+bmV4dHNldGxpc3QgKyBuOw0KKyAg ICAgICAgaC0+bmV4dHNldGxpc3QgKz0gbjsNCiAgICAgICAgIGlmIChsYXN0ID4gaC0+c2l6ZWFy cmF5KSAgLyogbmVlZHMgbW9yZSBzcGFjZT8gKi8NCiAgICAgICAgICAgbHVhSF9yZXNpemVhcnJh eShMLCBoLCBsYXN0KTsgIC8qIHByZS1hbGxvYyBpdCBhdCBvbmNlICovDQogICAgICAgICBmb3Ig KDsgbiA+IDA7IG4tLSkgew0KQEAgLTc1Myw2ICs3NTIsNzggQEANCiAgICAgICAgICAgfQ0KICAg ICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICBzZXRuaWx2YWx1ZShyYSArIGopOw0KKyAgICAg ICAgICB9DQorICAgICAgICB9DQorICAgICAgICBjb250aW51ZTsNCisgICAgICB9DQorICAgICAg Y2FzZSBPUF9UVVBMRTogew0KKyAgICAgICAgaW50IGIgPSBHRVRBUkdfQihpKSAtIDE7DQorICAg ICAgICBpbnQgc3RhcnQ7DQorICAgICAgICBpbnQgajsNCisgICAgICAgIFN0a0lkIHR1cDsNCisg ICAgICAgIGlmIChiID09IExVQV9NVUxUUkVUKQ0KKyAgICAgICAgew0KKyAgICAgICAgICBiID0g Y2FzdF9pbnQoTC0+dG9wIC0gcmEpOw0KKyAgICAgICAgICBMLT50b3AgPSBMLT5jaS0+dG9wOw0K KyAgICAgICAgfQ0KKyAgICAgICAgaWYgKGIgPD0gMCkNCisgICAgICAgICAgICBjb250aW51ZTsN CisgICAgICAgIGlmIChjYXN0X2ludChMLT50dXBsZXN0b3AgLSBMLT50dXBsZXMpICsgYiArIDEg PiBMLT50dXBsZXNzaXplKSB7DQorICAgICAgICAgIGludCByZWFsc2l6ZSA9IEwtPnR1cGxlc3Np emUgKiAyICsgYiArIDE7DQorICAgICAgICAgIHR1cCA9IEwtPnR1cGxlczsNCisgICAgICAgICAg bHVhTV9yZWFsbG9jdmVjdG9yKEwsIEwtPnR1cGxlcywgTC0+dHVwbGVzc2l6ZSwgcmVhbHNpemUs IFRWYWx1ZSk7DQorICAgICAgICAgIEwtPnR1cGxlc3NpemUgPSByZWFsc2l6ZTsNCisgICAgICAg ICAgTC0+dHVwbGVzdG9wID0gY2FzdF9pbnQoTC0+dHVwbGVzdG9wIC0gdHVwKSArIEwtPnR1cGxl czsNCisgICAgICAgIH0NCisgICAgICAgIHR1cCA9IEwtPnR1cGxlc3RvcDsNCisgICAgICAgIEwt PnR1cGxlc3RvcCArPSBiICsgMTsNCisgICAgICAgIHN0YXJ0ID0gY2FzdF9pbnQodHVwIC0gTC0+ dHVwbGVzKTsNCisgICAgICAgIHNldHR1dmFsdWUodHVwLCBiKTsNCisgICAgICAgIGZvciAoaiA9 IDA7IGogPCBiOyBqKyspIHsNCisgICAgICAgICAgc2V0b2JqKEwsIHR1cCArIDEgKyBqLCByYSAr IGopOw0KKyAgICAgICAgfQ0KKyAgICAgICAgc2V0dHV2YWx1ZShyYSwgc3RhcnQpOw0KKyAgICAg ICAgY29udGludWU7DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfREVUVVBMRTogew0KKyAgICAg ICAgaW50IG5yZXN1bHRzID0gR0VUQVJHX0MoaSkgLSAxOw0KKyAgICAgICAgaW50IGV4dHJhLCBq LCBiOw0KKyAgICAgICAgU3RrSWQgcnAsIGxhc3Q7DQorICAgICAgICBiID0gR0VUQVJHX0IoaSkg LSAxOw0KKyAgICAgICAgaWYgKGIgPT0gTFVBX01VTFRSRVQpDQorICAgICAgICAgIGIgPSBjYXN0 X2ludChMLT50b3AgLSByYSkgLSAxOw0KKyAgICAgICAgZXh0cmEgPSAwOw0KKyAgICAgICAgZm9y IChycCA9IHJhOyBycCA8PSByYSArIGI7IHJwKyspIHsNCisgICAgICAgICAgaWYocnAtPnR0ID09 IExVQV9UVFVQTEUpDQorICAgICAgICAgICAgZXh0cmEgKz0gZ2V0dHVzaXplKEwsIHJwKSAtIDE7 DQorICAgICAgICB9DQorICAgICAgICBpZiAoZXh0cmEgPT0gMCkNCisgICAgICAgICAgY29udGlu dWU7DQorICAgICAgICBQcm90ZWN0KGx1YURfY2hlY2tzdGFjayhMLCBleHRyYSkpOw0KKyAgICAg ICAgcmEgPSBSQShpKTsgIC8qIHByZXZpb3VzIGNhbGwgbWF5IGNoYW5nZSB0aGUgc3RhY2sgKi8N CisgICAgICAgIHJwID0gcmEgKyBiOw0KKyAgICAgICAgaWYgKG5yZXN1bHRzID09IExVQV9NVUxU UkVUKSB7DQorICAgICAgICAgIGxhc3QgPSBycCArIGV4dHJhICsgMTsNCisgICAgICAgICAgTC0+ dG9wID0gbGFzdDsNCisgICAgICAgIH0NCisgICAgICAgIGVsc2Ugew0KKyAgICAgICAgICBsYXN0 ID0gcmEgKyBucmVzdWx0czsNCisgICAgICAgICAgd2hpbGUocnAgKyBleHRyYSArIDEgPCBsYXN0 KQ0KKyAgICAgICAgICAgIHNldG5pbHZhbHVlKC0tbGFzdCk7DQorICAgICAgICB9DQorICAgICAg ICBmb3IgKDsgcnAgPj0gcmE7IHJwLS0gKSB7DQorICAgICAgICAgIGlmKHJwLT50dCAhPSBMVUFf VFRVUExFKSB7DQorICAgICAgICAgICAgc2V0b2JqMnMoTCwgcnAgKyBleHRyYSwgcnApOw0KKyAg ICAgICAgICB9DQorICAgICAgICAgIGVsc2Ugew0KKyAgICAgICAgICAgIEwtPnR1cGxlc3RvcCA9 IEwtPnR1cGxlcyArIGdldHR1dmFsdWUocnApOw0KKyAgICAgICAgICAgIGZvciAoaiA9IGdldHR1 c2l6ZShMLCBycCkgLSAxOyBqID49IDA7IGotLSwgZXh0cmEtLSkgew0KKyAgICAgICAgICAgICAg aWYgKHJwICsgZXh0cmEgPCBsYXN0KQ0KKyAgICAgICAgICAgICAgICBzZXRvYmooTCwgcnAgKyBl eHRyYSwgTC0+dHVwbGVzICsgcnAtPnZhbHVlLmIgKyAxICsgaik7DQorICAgICAgICAgICAgfQ0K KyAgICAgICAgICAgIGV4dHJhKys7DQorICAgICAgICAgICAgaWYoZXh0cmEgPT0gMCkNCisgICAg ICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICB9DQogICAgICAgICB9DQogICAgICAgICBjb250 aW51ZTsNCg== --0016364d259712210c0470fbffbd Content-Type: application/octet-stream; name="tuples.lua" Content-Disposition: attachment; filename="tuples.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fyasx5wd1 bG9jYWwgZnVuY3Rpb24gYXJncyguLi4pDQogIGxvY2FsIHQgPSB7Li4ufQ0KICB0Lm4gPSBzZWxl Y3QoJyMnLCAuLi4pDQogIHJldHVybiB0DQplbmQNCg0KbG9jYWwgZnVuY3Rpb24gcGFzcyguLi4p IHJldHVybiAuLi4gZW5kDQoNCmZ1bmN0aW9uIGNoZWNrX2VxdWFsKG5hbWUsIGFyZ3MxLCBhcmdz MikNCiAgbG9jYWwgZXF1YWwgPSBhcmdzMS5uID09IGFyZ3MyLm4NCiAgaWYgZXF1YWwgdGhlbg0K ICAgIGZvciBpID0gMSwgYXJnczEubiBkbw0KICAgICAgaWYgYXJnczFbaV0gfj0gYXJnczJbaV0g dGhlbg0KICAgICAgICBlcXVhbCA9IGZhbHNlDQogICAgICAgIGJyZWFrDQogICAgICBlbmQNCiAg ICBlbmQNCiAgZW5kDQogIHByaW50KG5hbWUsIGVxdWFsIGFuZCAiR29vZCIgb3IgIkJBRCIpDQog IGlmIG5vdCBlcXVhbCB0aGVuDQogICAgcHJpbnQodW5wYWNrKGFyZ3MxLCAxLCBhcmdzMS5uKSkN CiAgICBwcmludCh1bnBhY2soYXJnczIsIDEsIGFyZ3MyLm4pKQ0KICBlbmQNCmVuZA0KDQpmdW5j dGlvbiBjaGVja19lcXVhbF90KG5hbWUsIHQxLCB0MikNCiAgbG9jYWwgZXF1YWwgPSB0cnVlDQog IGxvY2FsIGsyDQogIGZvciBrLCB2IGluIHBhaXJzKHQxKSBkbw0KICAgIGlmIHQyW2tdIH49IHYg dGhlbg0KICAgICAgZXF1YWwgPSBmYWxzZQ0KICAgIGVuZA0KICAgIGsyID0gbmV4dCh0MiwgazIp DQogIGVuZA0KICBpZiBuZXh0KHQyLCBrMikgfj0gbmlsIHRoZW4NCiAgICBlcXVhbCA9IGZhbHNl DQogIGVuZA0KICBwcmludChuYW1lLCBlcXVhbCBhbmQgIkdvb2QiIG9yICJCQUQiKQ0KZW5kDQoN CmNoZWNrX2VxdWFsKCJSZXR1cm4gZHVwbGljYXRlZCBhcmd1bWVudHMiLA0KICBhcmdzKChmdW5j dGlvbiguLi4pIHJldHVybiAuLi4gLi4uLCAuLi4gZW5kKSgiQSIsICJCIiwgIkMiKSksDQogIGFy Z3MoIkEiLCAiQiIsICJDIiwgIkEiLCAiQiIsICJDIikNCikNCiAgDQpjaGVja19lcXVhbCgiUmV0 dXJuIGR1cGxpY2F0ZWQgYXJndW1lbnRzIHdpdGggcGFzcyIsDQogIGFyZ3MoKGZ1bmN0aW9uKC4u LikgcmV0dXJuIHBhc3MoLi4uKSAuLi4sIHBhc3MoLi4uKSBlbmQpKCJBIiwgIkIiLCAiQyIpKSwN CiAgYXJncygiQSIsICJCIiwgIkMiLCAiQSIsICJCIiwgIkMiKQ0KKQ0KICANCmNoZWNrX2VxdWFs KCJSZXR1cm4gdHJpcGxlIGR1cGxpY2F0ZWQgYXJndW1lbnRzIiwNCiAgYXJncygoZnVuY3Rpb24o Li4uKSByZXR1cm4gLi4uIC4uLiwgLi4uIC4uLiwgLi4uIGVuZCkoIkEiLCBuaWwpKSwNCiAgYXJn cygiQSIsIG5pbCwgIkEiLCBuaWwsICJBIiwgbmlsKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhwYW5z aW9uIGF0IHN0YXJ0IG9mIGZ1bmN0aW9uIGFyZ3VtZW50cyIsDQogIGFyZ3MoKGZ1bmN0aW9uKCkg cmV0dXJuICJBIiwgIkIiLCAiQyIsICJEIiBlbmQpKCkgLi4uLCAiRSIpLA0KICBhcmdzKCJBIiwg IkIiLCAiQyIsICJEIiwgIkUiKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhwYW5zaW9uIGluIG1pZGRs ZSBvZiBmdW5jdGlvbiBhcmd1bWVudHMiLA0KICBhcmdzKCJBIiwgKGZ1bmN0aW9uKCkgcmV0dXJu ICJCIiwgIkMiIGVuZCkoKSAuLi4sICJEIiwgIkUiKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAi RCIsICJFIikNCikNCg0KY2hlY2tfZXF1YWwoIkV4cGFuc2lvbiBpbiBtaWRkbGUgb2YgZnVuY3Rp b24gYXJndW1lbnRzIHdpdGggdmFyYXJnIGVuZCIsDQogIGFyZ3MoIkEiLCAoZnVuY3Rpb24oKSBy ZXR1cm4gIkIiLCAiQyIgZW5kKSgpIC4uLiwgIkQiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkUiLCAi RiIgZW5kKSgpKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAiRCIsICJFIiwgIkYiKQ0KKQ0KDQpj aGVja19lcXVhbCgiRHVhbCBleHBhbnNpb24gaW4gbWlkZGxlIG9mIGZ1bmN0aW9uIGFyZ3VtZW50 cyIsDQogIGFyZ3MoIkEiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkIiLCAiQyIgZW5kKSgpIC4uLiwg IkQiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkUiLCAiRiIgZW5kKSgpIC4uLiwgIkciKSwNCiAgYXJn cygiQSIsICJCIiwgIkMiLCAiRCIsICJFIiwgIkYiLCAiRyIpDQopDQoNCmNoZWNrX2VxdWFsKCJF eHBhbnNpb24gaW4gYXNzaWdubWVudCIsDQogIGFyZ3MoKGZ1bmN0aW9uKC4uLikNCiAgICBsb2Nh bCBhLCBiLCBjLCBkLCBlID0gIkEiLCAuLi4gLi4uLCAiRSINCiAgICByZXR1cm4gYSwgYiwgYywg ZCwgZQ0KICBlbmQpKCJCIiwgIkMiLCAiRCIpKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAiRCIs ICJFIikNCikNCg0KZnVuY3Rpb24gTHNlbGVjdChuLCAuLi4pDQogIGlmIG4gPT0gJyMnIHRoZW4N CiAgICBsb2NhbCBtYXJrZXIgPSB7fQ0KICAgIGxvY2FsIHQgPSB7Li4uIC4uLiwgbWFya2VyfQ0K ICAgIGZvciBrLCB2IGluIHBhaXJzKHQpIGRvDQogICAgICBpZiB2ID09IG1hcmtlciB0aGVuDQog ICAgICAgIHJldHVybiBrIC0gMQ0KICAgICAgZW5kDQogICAgZW5kDQogIGVsc2VpZiBuIDwgMCB0 aGVuDQogICAgcmV0dXJuIExzZWxlY3QoTHNlbGVjdCgnIycsIC4uLikgKyAxICsgbiwgLi4uKQ0K ICBlbmQNCiAgcmV0dXJuICh7Li4ufSlbbl0NCmVuZA0KDQpjaGVja19lcXVhbCgiTHNlbGVjdCAj IiwNCiAgYXJncyhMc2VsZWN0KCcjJywgImEiLCAiYiIsIG5pbCwgbmlsKSksDQogIGFyZ3Moc2Vs ZWN0KCcjJywgImEiLCAiYiIsIG5pbCwgbmlsKSkNCikNCg0KY2hlY2tfZXF1YWxfdCgiU3RhbmRh cmQgdGFibGUgY29uc3RydWN0b3IiLA0KICB7IkEiLCAiQiIsICJDIiwgWzBdID0gIiAiLCBrID0g InYiLCAiRCJ9LA0KICB7WzBdID0gIiAiLCBbMV0gPSAiQSIsIFsyXSA9ICJCIiwgWzNdID0gIkMi LCBbNF0gPSAiRCIsIFsiayJdID0gInYifQ0KKQ0K --0016364d259712210c0470fbffbd-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 02:00:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7D50ITa014196; Thu, 13 Aug 2009 02:00:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D002D18E4E; Thu, 13 Aug 2009 01:59:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C063A185D7 for ; Thu, 13 Aug 2009 01:59:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so544417ewy.5 for ; Wed, 12 Aug 2009 21:59:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.30.1 with SMTP id d1mr1048783ebd.62.1250139580023; Wed, 12 Aug 2009 21:59:40 -0700 (PDT) Date: Thu, 13 Aug 2009 00:59:40 -0400 X-Google-Sender-Auth: 8bf90ced18d8e982 Message-ID: Subject: package.seeall and strict conflict From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'd like to document a conflict, perhaps not all together new, that came up today between package.seeall and the strict module... Let some module A in a program do require "strict" and some other module B in the program do module(..., package.seeall). Now, strict behavior is applied to the implementation of B. This may be desirable or it might not be. More seriously, if a client of B tries to access B.C where C is not a member of B, then strict will raise an error. I came across an instance of this problem in a program (LuaDist) where B represented the program's configuration settings. Here, B.C may or may not exist depending on the user's settings, but clients of B need to at least test whether B.C exists. The particular code was actually "if config[n] then", where "n" might be nil (which is not an invalid thing to do), in which case the line 'error("variable '"..n.."' is not declared", 2)' in strict.lua itself fails with an error about attempting to concatenate nil. There are other problems too [1]--e.g. if some module loads a module C (which happens to have the same name) then B.C suddenly comes into existence and alters the programs configuration. I've long felt there are significant flaws in how the "module" function works [1] because it encourages certain practices and has subtle behaviors that make writing reliable and secure programs more difficult. The main problem is that it mixes up a module's private (imported) namespace used by its implementation with the global environment namespace, and if package.seeall is used, it also mixes these up with a module's public (exported) namespace. The problems can be mitigated, however, by avoiding package.seeall, avoiding and checking for global variables (e.g. local B = require "B", plus methods in [2]), and following certain conventions for naming modules (e.g. the maintainer of module B shall control who can name a module B.C). [1] http://lua-users.org/wiki/LuaModuleFunctionCritiqued [2] http://lua-users.org/wiki/DetectingUndefinedVariables From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 09:00:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DC0qbR020405; Thu, 13 Aug 2009 09:00:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 222E918F13; Thu, 13 Aug 2009 09:00:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC75518C94 for ; Thu, 13 Aug 2009 09:00:14 -0300 (BRT) Received: by bwz10 with SMTP id 10so591664bwz.5 for ; Thu, 13 Aug 2009 05:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=z4EXfkrfKmfC3T4Wjr4hPHV7WZxL99nf2sjpACfuNMA=; b=uy/nuCKYkGzd9g9WEUABMxzd1I+MzFlUtPuceOCjgDy4rTVWl9RsYZUTksTTaqiQob R0hKAZMIZYDE1otRscyNq9eKGavpHBTDUygEAZIl0gv/6S28QNzT+ch9sNs8uMtxH+nF /Cew3gE15T/ekEPdtZfsCbzI1fBH7ux0dA0Hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jOdBcLWskg1asBbpT1Fx1WdtQ5dRl6TN4iltpRkBLRQ4C0VpFEsU4i9V+RGBONnhYe u+kucepLNMSqOdfZtRYztlFOzAIHo3j3bWtYhC7lY8FPXSb4i2cEsWCAWSl6CCDf7KlS x5wWKqXtr4uomYw3wDv9ub0c9pYNB4amyFFfQ= MIME-Version: 1.0 Received: by 10.239.182.149 with SMTP id q21mr78835hbg.32.1250164811618; Thu, 13 Aug 2009 05:00:11 -0700 (PDT) In-Reply-To: <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> Date: Thu, 13 Aug 2009 14:00:11 +0200 Message-ID: <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 12, 2009 at 11:17 PM, Doug Currie wrote: >> So I encourage you, Duncan, to try it out and share any results. Even if >> it doesn't work out, you (and we) will learn from it. > > Ditto. Thinking about this, it is really a cool little feature, precisely because there's no existing code that gets broken. We get new idioms, like concatenating two lists {unpack(t1)...,unpack(t2)}, etc (although like {unpack(t)} this is not recommended for big tables). Now, would this also apply to function argument lists, which is the other place where multiple returns are not discarded if at the end? steve d. From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 09:21:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DCL1YA023175; Thu, 13 Aug 2009 09:21:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C41F418FCD; Thu, 13 Aug 2009 09:19:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4719C18ED1 for ; Thu, 13 Aug 2009 09:19:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so757528ewy.5 for ; Thu, 13 Aug 2009 05:19:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.47.213 with SMTP id t63mr193028web.134.1250165962913; Thu, 13 Aug 2009 05:19:22 -0700 (PDT) In-Reply-To: <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Thu, 13 Aug 2009 13:19:22 +0100 X-Google-Sender-Auth: f87b9930a37a3e77 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: multipart/mixed; boundary=001485f6d2a4213a9c047104f2ca X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f6d2a4213a9c047104f2ca Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Aug 13, 2009 at 1:00 PM, steve donovan wrote: > Now, would this also apply to function argument lists, which is the > other place where multiple returns are not discarded if at the end? According to the BNF description of Lua, the arguments in a function call are an expression list, so IMO it should apply here too (and my patch does so). E:\CPP\2K8\lua-5.1.4-proto>Debug\lua-5.1.4-proto.exe Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > t = {4, 5, 6} > print(unpack(t) ..., 7) 4 5 6 7 > print(unpack{4, unpack{5, 6} ..., 7} ..., 8) 4 5 6 7 8 Also note that attached is a revised patch. --001485f6d2a4213a9c047104f2ca Content-Type: application/octet-stream; name="expvar.diff" Content-Disposition: attachment; filename="expvar.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fybghc4x0 ZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5jIHNyYy9sY29kZS5jDQotLS0gLi4v Li4vbHVhLTUuMS40L3NyYy9sY29kZS5jCUZyaSBEZWMgMjggMTU6MzI6MjQgMjAwNw0KKysrIHNy Yy9sY29kZS5jCVRodSBBdWcgMTMgMDE6Mzg6MTggMjAwOQ0KQEAgLTI3OCw3ICsyNzgsNyBAQA0K IA0KIA0KIHZvaWQgbHVhS19zZXRyZXR1cm5zIChGdW5jU3RhdGUgKmZzLCBleHBkZXNjICplLCBp bnQgbnJlc3VsdHMpIHsNCi0gIGlmIChlLT5rID09IFZDQUxMKSB7ICAvKiBleHByZXNzaW9uIGlz IGFuIG9wZW4gZnVuY3Rpb24gY2FsbD8gKi8NCisgIGlmIChlLT5rID09IFZDQUxMIHx8IGUtPmsg PT0gVkRFVFVQTEUpIHsgIC8qIGV4cHJlc3Npb24gaXMgYW4gb3BlbiBmdW5jdGlvbiBjYWxsPyAq Lw0KICAgICBTRVRBUkdfQyhnZXRjb2RlKGZzLCBlKSwgbnJlc3VsdHMrMSk7DQogICB9DQogICBl bHNlIGlmIChlLT5rID09IFZWQVJBUkcpIHsNCkBAIC0zMjUsNyArMzI1LDggQEANCiAgICAgICBi cmVhazsNCiAgICAgfQ0KICAgICBjYXNlIFZWQVJBUkc6DQotICAgIGNhc2UgVkNBTEw6IHsNCisg ICAgY2FzZSBWQ0FMTDoNCisgICAgY2FzZSBWREVUVVBMRTogew0KICAgICAgIGx1YUtfc2V0b25l cmV0KGZzLCBlKTsNCiAgICAgICBicmVhazsNCiAgICAgfQ0KQEAgLTgyNCwxNiArODI1LDEwIEBA DQogfQ0KIA0KIA0KLXZvaWQgbHVhS19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwg aW50IG5lbGVtcywgaW50IHRvc3RvcmUpIHsNCi0gIGludCBjID0gIChuZWxlbXMgLSAxKS9MRklF TERTX1BFUl9GTFVTSCArIDE7DQordm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMsIGlu dCBiYXNlLCBpbnQgdG9zdG9yZSkgew0KICAgaW50IGIgPSAodG9zdG9yZSA9PSBMVUFfTVVMVFJF VCkgPyAwIDogdG9zdG9yZTsNCiAgIGx1YV9hc3NlcnQodG9zdG9yZSAhPSAwKTsNCi0gIGlmIChj IDw9IE1BWEFSR19DKQ0KLSAgICBsdWFLX2NvZGVBQkMoZnMsIE9QX1NFVExJU1QsIGJhc2UsIGIs IGMpOw0KLSAgZWxzZSB7DQotICAgIGx1YUtfY29kZUFCQyhmcywgT1BfU0VUTElTVCwgYmFzZSwg YiwgMCk7DQotICAgIGx1YUtfY29kZShmcywgY2FzdChJbnN0cnVjdGlvbiwgYyksIGZzLT5scy0+ bGFzdGxpbmUpOw0KLSAgfQ0KKyAgbHVhS19jb2RlQUJDKGZzLCBPUF9TRVRMSVNULCBiYXNlLCBi LCAwKTsNCiAgIGZzLT5mcmVlcmVnID0gYmFzZSArIDE7ICAvKiBmcmVlIHJlZ2lzdGVycyB3aXRo IGxpc3QgdmFsdWVzICovDQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29k ZS5oIHNyYy9sY29kZS5oDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5oCVRodSBEZWMg MjcgMTM6MDI6MjYgMjAwNw0KKysrIHNyYy9sY29kZS5oCVRodSBBdWcgMTMgMDE6Mzg6MjggMjAw OQ0KQEAgLTcwLDcgKzcwLDcgQEANCiBMVUFJX0ZVTkMgdm9pZCBsdWFLX3ByZWZpeCAoRnVuY1N0 YXRlICpmcywgVW5PcHIgb3AsIGV4cGRlc2MgKnYpOw0KIExVQUlfRlVOQyB2b2lkIGx1YUtfaW5m aXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdik7DQogTFVBSV9GVU5DIHZv aWQgbHVhS19wb3NmaXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdjEsIGV4 cGRlc2MgKnYyKTsNCi1MVUFJX0ZVTkMgdm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMs IGludCBiYXNlLCBpbnQgbmVsZW1zLCBpbnQgdG9zdG9yZSk7DQorTFVBSV9GVU5DIHZvaWQgbHVh S19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwgaW50IHRvc3RvcmUpOw0KIA0KIA0K ICNlbmRpZg0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sZGVidWcuYyBzcmMvbGRlYnVn LmMNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xkZWJ1Zy5jCVRodSBNYXkgIDggMTc6NTY6MjYg MjAwOA0KKysrIHNyYy9sZGVidWcuYwlUaHUgQXVnIDEzIDEzOjEzOjQzIDIwMDkNCkBAIC0yOTIs NyArMjkyLDkgQEANCiAgICAgY2FzZSBPUF9DQUxMOg0KICAgICBjYXNlIE9QX1RBSUxDQUxMOg0K ICAgICBjYXNlIE9QX1JFVFVSTjoNCi0gICAgY2FzZSBPUF9TRVRMSVNUOiB7DQorICAgIGNhc2Ug T1BfU0VUTElTVDoNCisgICAgY2FzZSBPUF9UVVBMRToNCisgICAgY2FzZSBPUF9ERVRVUExFOiB7 DQogICAgICAgY2hlY2soR0VUQVJHX0IoaSkgPT0gMCk7DQogICAgICAgcmV0dXJuIDE7DQogICAg IH0NCkBAIC0zNDUsMjAgKzM0Nyw2IEBADQogICAgICAgICBpZiAoZ2V0Qk1vZGUob3ApID09IE9w QXJnUikgew0KICAgICAgICAgICBpbnQgZGVzdCA9IHBjKzErYjsNCiAgICAgICAgICAgY2hlY2so MCA8PSBkZXN0ICYmIGRlc3QgPCBwdC0+c2l6ZWNvZGUpOw0KLSAgICAgICAgICBpZiAoZGVzdCA+ IDApIHsNCi0gICAgICAgICAgICBpbnQgajsNCi0gICAgICAgICAgICAvKiBjaGVjayB0aGF0IGl0 IGRvZXMgbm90IGp1bXAgdG8gYSBzZXRsaXN0IGNvdW50OyB0aGlzDQotICAgICAgICAgICAgICAg aXMgdHJpY2t5LCBiZWNhdXNlIHRoZSBjb3VudCBmcm9tIGEgcHJldmlvdXMgc2V0bGlzdCBtYXkN Ci0gICAgICAgICAgICAgICBoYXZlIHRoZSBzYW1lIHZhbHVlIG9mIGFuIGludmFsaWQgc2V0bGlz dDsgc28sIHdlIG11c3QNCi0gICAgICAgICAgICAgICBnbyBhbGwgdGhlIHdheSBiYWNrIHRvIHRo ZSBmaXJzdCBvZiB0aGVtIChpZiBhbnkpICovDQotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8 IGRlc3Q7IGorKykgew0KLSAgICAgICAgICAgICAgSW5zdHJ1Y3Rpb24gZCA9IHB0LT5jb2RlW2Rl c3QtMS1qXTsNCi0gICAgICAgICAgICAgIGlmICghKEdFVF9PUENPREUoZCkgPT0gT1BfU0VUTElT VCAmJiBHRVRBUkdfQyhkKSA9PSAwKSkgYnJlYWs7DQotICAgICAgICAgICAgfQ0KLSAgICAgICAg ICAgIC8qIGlmICdqJyBpcyBldmVuLCBwcmV2aW91cyB2YWx1ZSBpcyBub3QgYSBzZXRsaXN0IChl dmVuIGlmDQotICAgICAgICAgICAgICAgaXQgbG9va3MgbGlrZSBvbmUpICovDQotICAgICAgICAg ICAgY2hlY2soKGomMSkgPT0gMCk7DQotICAgICAgICAgIH0NCiAgICAgICAgIH0NCiAgICAgICAg IGJyZWFrOw0KICAgICAgIH0NCkBAIC0zNzQsOCArMzYyLDYgQEANCiAgICAgICBjYXNlIE9QX0xP QURCT09MOiB7DQogICAgICAgICBpZiAoYyA9PSAxKSB7ICAvKiBkb2VzIGl0IGp1bXA/ICovDQog ICAgICAgICAgIGNoZWNrKHBjKzIgPCBwdC0+c2l6ZWNvZGUpOyAgLyogY2hlY2sgaXRzIGp1bXAg Ki8NCi0gICAgICAgICAgY2hlY2soR0VUX09QQ09ERShwdC0+Y29kZVtwYysxXSkgIT0gT1BfU0VU TElTVCB8fA0KLSAgICAgICAgICAgICAgICBHRVRBUkdfQyhwdC0+Y29kZVtwYysxXSkgIT0gMCk7 DQogICAgICAgICB9DQogICAgICAgICBicmVhazsNCiAgICAgICB9DQpAQCAtNDQxLDEwICs0Mjcs NiBAQA0KICAgICAgIH0NCiAgICAgICBjYXNlIE9QX1NFVExJU1Q6IHsNCiAgICAgICAgIGlmIChi ID4gMCkgY2hlY2tyZWcocHQsIGEgKyBiKTsNCi0gICAgICAgIGlmIChjID09IDApIHsNCi0gICAg ICAgICAgcGMrKzsNCi0gICAgICAgICAgY2hlY2socGMgPCBwdC0+c2l6ZWNvZGUgLSAxKTsNCi0g ICAgICAgIH0NCiAgICAgICAgIGJyZWFrOw0KICAgICAgIH0NCiAgICAgICBjYXNlIE9QX0NMT1NV UkU6IHsNCkBAIC00NjYsNiArNDQ4LDE4IEBADQogICAgICAgICBiLS07DQogICAgICAgICBpZiAo YiA9PSBMVUFfTVVMVFJFVCkgY2hlY2soY2hlY2tvcGVub3AocHQsIHBjKSk7DQogICAgICAgICBj aGVja3JlZyhwdCwgYStiLTEpOw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNh c2UgT1BfVFVQTEU6IHsNCisgICAgICAgIC8qIFRPRE86IEFyZSBhbnkgY2hlY2tzIHJlcXVpcmVk PyAqLw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfREVUVVBMRTog ew0KKyAgICAgICAgLyogVE9ETzogQXJlIGFueSBvdGhlciBjaGVja3MgcmVxdWlyZWQ/ICovDQor ICAgICAgICBjLS07ICAvKiBjID0gbnVtLiByZXR1cm5zICovDQorICAgICAgICBpZiAoYyA9PSBM VUFfTVVMVFJFVCkgew0KKyAgICAgICAgICBjaGVjayhjaGVja29wZW5vcChwdCwgcGMpKTsNCisg ICAgICAgIH0NCiAgICAgICAgIGJyZWFrOw0KICAgICAgIH0NCiAgICAgICBkZWZhdWx0OiBicmVh azsNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbGRvLmMgc3JjL2xkby5jDQotLS0gLi4v Li4vbHVhLTUuMS40L3NyYy9sZG8uYwlGcmkgSmFuIDE4IDIyOjMxOjIyIDIwMDgNCisrKyBzcmMv bGRvLmMJV2VkIEF1ZyAxMiAxNzo0NDoyOCAyMDA5DQpAQCAtMjkxLDYgKzI5MSw3IEBADQogICAg IGNpLT50b3AgPSBMLT5iYXNlICsgcC0+bWF4c3RhY2tzaXplOw0KICAgICBsdWFfYXNzZXJ0KGNp LT50b3AgPD0gTC0+c3RhY2tfbGFzdCk7DQogICAgIEwtPnNhdmVkcGMgPSBwLT5jb2RlOyAgLyog c3RhcnRpbmcgcG9pbnQgKi8NCisgICAgY2ktPnNhdmVkdHVwID0gY2FzdF9pbnQoTC0+dHVwbGVz dG9wIC0gTC0+dHVwbGVzKTsNCiAgICAgY2ktPnRhaWxjYWxscyA9IDA7DQogICAgIGNpLT5ucmVz dWx0cyA9IG5yZXN1bHRzOw0KICAgICBmb3IgKHN0ID0gTC0+dG9wOyBzdCA8IGNpLT50b3A7IHN0 KyspDQpAQCAtMzEyLDYgKzMxMyw3IEBADQogICAgIEwtPmJhc2UgPSBjaS0+YmFzZSA9IGNpLT5m dW5jICsgMTsNCiAgICAgY2ktPnRvcCA9IEwtPnRvcCArIExVQV9NSU5TVEFDSzsNCiAgICAgbHVh X2Fzc2VydChjaS0+dG9wIDw9IEwtPnN0YWNrX2xhc3QpOw0KKyAgICBjaS0+c2F2ZWR0dXAgPSBj YXN0X2ludChMLT50dXBsZXN0b3AgLSBMLT50dXBsZXMpOw0KICAgICBjaS0+bnJlc3VsdHMgPSBu cmVzdWx0czsNCiAgICAgaWYgKEwtPmhvb2ttYXNrICYgTFVBX01BU0tDQUxMKQ0KICAgICAgIGx1 YURfY2FsbGhvb2soTCwgTFVBX0hPT0tDQUxMLCAtMSk7DQpAQCAtNDY3LDYgKzQ2OSw3IEBADQog ICAgIGx1YURfc2V0ZXJyb3JvYmooTCwgc3RhdHVzLCBvbGR0b3ApOw0KICAgICBMLT5uQ2NhbGxz ID0gb2xkbkNjYWxsczsNCiAgICAgTC0+Y2kgPSByZXN0b3JlY2koTCwgb2xkX2NpKTsNCisgICAg TC0+dHVwbGVzdG9wID0gTC0+dHVwbGVzICsgTC0+Y2ktPnNhdmVkdHVwOw0KICAgICBMLT5iYXNl ID0gTC0+Y2ktPmJhc2U7DQogICAgIEwtPnNhdmVkcGMgPSBMLT5jaS0+c2F2ZWRwYzsNCiAgICAg TC0+YWxsb3dob29rID0gb2xkX2FsbG93aG9va3M7DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQv c3JjL2xnYy5jIHNyYy9sZ2MuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbGdjLmMJVGh1IERl YyAyNyAxMzowMjoyNiAyMDA3DQorKysgc3JjL2xnYy5jCVRodSBBdWcgMTMgMDA6NTc6MTAgMjAw OQ0KQEAgLTI2Niw2ICsyNjYsOCBAQA0KICAgICBtYXJrdmFsdWUoZywgbyk7DQogICBmb3IgKDsg byA8PSBsaW07IG8rKykNCiAgICAgc2V0bmlsdmFsdWUobyk7DQorICBmb3IgKG8gPSBsLT50dXBs ZXM7IG8gPCBsLT50dXBsZXN0b3A7IG8rKykNCisgICAgbWFya3ZhbHVlKGcsIG8pOw0KICAgY2hl Y2tzdGFja3NpemVzKGwsIGxpbSk7DQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3Ny Yy9sb2JqZWN0Lmggc3JjL2xvYmplY3QuaA0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9iamVj dC5oCVdlZCBBdWcgIDYgMTQ6Mjk6NDggMjAwOA0KKysrIHNyYy9sb2JqZWN0LmgJVGh1IEF1ZyAx MyAwMjoxMDo1NCAyMDA5DQpAQCAtMjgsNiArMjgsNyBAQA0KICNkZWZpbmUgTFVBX1RQUk9UTwko TEFTVF9UQUcrMSkNCiAjZGVmaW5lIExVQV9UVVBWQUwJKExBU1RfVEFHKzIpDQogI2RlZmluZSBM VUFfVERFQURLRVkJKExBU1RfVEFHKzMpDQorI2RlZmluZSBMVUFfVFRVUExFICAoTFVBX1ROT05F LTEpIC8qIHR0ID49IExVQV9UU1RSSU5HIGFyZSBjb2xsZWN0YWJsZSAqLw0KIA0KIA0KIC8qDQpA QCAtNTEsOCArNTIsNiBAQA0KIH0gR0NoZWFkZXI7DQogDQogDQotDQotDQogLyoNCiAqKiBVbmlv biBvZiBhbGwgTHVhIHZhbHVlcw0KICovDQpAQCAtMTI1LDYgKzEyNCw5IEBADQogI2RlZmluZSBz ZXRidmFsdWUob2JqLHgpIFwNCiAgIHsgVFZhbHVlICppX289KG9iaik7IGlfby0+dmFsdWUuYj0o eCk7IGlfby0+dHQ9TFVBX1RCT09MRUFOOyB9DQogDQorI2RlZmluZSBzZXR0dXZhbHVlKG9iaix4 KSBcDQorICB7IFRWYWx1ZSAqaV9vPShvYmopOyBpX28tPnZhbHVlLmI9KHgpOyBpX28tPnR0PUxV QV9UVFVQTEU7IH0NCisNCiAjZGVmaW5lIHNldHN2YWx1ZShMLG9iaix4KSBcDQogICB7IFRWYWx1 ZSAqaV9vPShvYmopOyBcDQogICAgIGlfby0+dmFsdWUuZ2M9Y2FzdChHQ09iamVjdCAqLCAoeCkp OyBpX28tPnR0PUxVQV9UU1RSSU5HOyBcDQpAQCAtMTg4LDYgKzE5MCw5IEBADQogDQogI2RlZmlu ZSBpc2NvbGxlY3RhYmxlKG8pCSh0dHlwZShvKSA+PSBMVUFfVFNUUklORykNCiANCisjZGVmaW5l IGdldHR1dmFsdWUob2JqKSAoKG9iaiktPnZhbHVlLmIpDQorDQorI2RlZmluZSBnZXR0dXNpemUo TCwgb2JqKSAoZ2V0dHV2YWx1ZSgoTCktPnR1cGxlcyArIGdldHR1dmFsdWUob2JqKSkpDQogDQog DQogdHlwZWRlZiBUVmFsdWUgKlN0a0lkOyAgLyogaW5kZXggdG8gc3RhY2sgZWxlbWVudHMgKi8N CkBAIC0zNDUsOCArMzUwLDggQEANCiAgIE5vZGUgKmxhc3RmcmVlOyAgLyogYW55IGZyZWUgcG9z aXRpb24gaXMgYmVmb3JlIHRoaXMgcG9zaXRpb24gKi8NCiAgIEdDT2JqZWN0ICpnY2xpc3Q7DQog ICBpbnQgc2l6ZWFycmF5OyAgLyogc2l6ZSBvZiBgYXJyYXknIGFycmF5ICovDQorICBpbnQgbmV4 dHNldGxpc3Q7ICAvKiBpbmRleCBmb3IgbmV4dCBPUF9TRVRMSVNUIHRvIGluc2VydCBhdCAqLw0K IH0gVGFibGU7DQotDQogDQogDQogLyoNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9w Y29kZXMuYyBzcmMvbG9wY29kZXMuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9wY29kZXMu YwlUaHUgRGVjIDI3IDEzOjAyOjI2IDIwMDcNCisrKyBzcmMvbG9wY29kZXMuYwlUaHUgQXVnIDEz IDAxOjI3OjExIDIwMDkNCkBAIC01Miw2ICs1Miw4IEBADQogICAiQ0xPU0UiLA0KICAgIkNMT1NV UkUiLA0KICAgIlZBUkFSRyIsDQorICAiVFVQTEUiLA0KKyAgIkRFVFVQTEUiLA0KICAgTlVMTA0K IH07DQogDQpAQCAtOTQsOSArOTYsMTEgQEANCiAgLG9wbW9kZSgwLCAxLCBPcEFyZ1IsIE9wQXJn TiwgaUFzQngpCQkvKiBPUF9GT1JMT09QICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdSLCBPcEFy Z04sIGlBc0J4KQkJLyogT1BfRk9SUFJFUCAqLw0KICAsb3Btb2RlKDEsIDAsIE9wQXJnTiwgT3BB cmdVLCBpQUJDKQkJLyogT1BfVEZPUkxPT1AgKi8NCi0gLG9wbW9kZSgwLCAwLCBPcEFyZ1UsIE9w QXJnVSwgaUFCQykJCS8qIE9QX1NFVExJU1QgKi8NCisgLG9wbW9kZSgwLCAwLCBPcEFyZ1UsIE9w QXJnTiwgaUFCQykJCS8qIE9QX1NFVExJU1QgKi8NCiAgLG9wbW9kZSgwLCAwLCBPcEFyZ04sIE9w QXJnTiwgaUFCQykJCS8qIE9QX0NMT1NFICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBPcEFy Z04sIGlBQngpCQkvKiBPUF9DTE9TVVJFICovDQogICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBPcEFy Z04sIGlBQkMpCQkvKiBPUF9WQVJBUkcgKi8NCisgLG9wbW9kZSgwLCAxLCBPcEFyZ1UsIE9wQXJn TiwgaUFCQykgICAgICAgIC8qIE9QX1RVUExFICovDQorICxvcG1vZGUoMCwgMSwgT3BBcmdVLCBP cEFyZ1UsIGlBQkMpICAgICAgICAvKiBPUF9ERVRVUExFICovDQogfTsNCiANCmRpZmYgLXVQIC4u Ly4uL2x1YS01LjEuNC9zcmMvbG9wY29kZXMuaCBzcmMvbG9wY29kZXMuaA0KLS0tIC4uLy4uL2x1 YS01LjEuNC9zcmMvbG9wY29kZXMuaAlUaHUgRGVjIDI3IDEzOjAyOjI2IDIwMDcNCisrKyBzcmMv bG9wY29kZXMuaAlXZWQgQXVnIDEyIDE5OjI4OjAyIDIwMDkNCkBAIC0yMDQsMTEgKzIwNCwxNCBA QA0KIE9QX0NMT1NFLC8qCUEgCWNsb3NlIGFsbCB2YXJpYWJsZXMgaW4gdGhlIHN0YWNrIHVwIHRv ICg+PSkgUihBKSovDQogT1BfQ0xPU1VSRSwvKglBIEJ4CVIoQSkgOj0gY2xvc3VyZShLUFJPVE9b QnhdLCBSKEEpLCAuLi4gLFIoQStuKSkJKi8NCiANCi1PUF9WQVJBUkcvKglBIEIJUihBKSwgUihB KzEpLCAuLi4sIFIoQStCLTEpID0gdmFyYXJnCQkqLw0KK09QX1ZBUkFSRywvKglBIEIJUihBKSwg UihBKzEpLCAuLi4sIFIoQStCLTEpID0gdmFyYXJnCQkqLw0KKw0KK09QX1RVUExFLC8qICBBIEIg ICAgUihBKSA6PSB0dXBsZShSKEEpLCAuLi4sIFIoQStCLTEpKSovDQorT1BfREVUVVBMRSwvKiBB IEIgQyBSKEEpLCAuLi4gLFIoQStDLTIpIDo9IGRldHVwbGUoUihBKSkuLi4sIGRldHVwbGUoUihB KzEpLi4uLCAuLi4sIGRldHVwbGUoUihBK0ItMSkpICovDQogfSBPcENvZGU7DQogDQogDQotI2Rl ZmluZSBOVU1fT1BDT0RFUwkoY2FzdChpbnQsIE9QX1ZBUkFSRykgKyAxKQ0KKyNkZWZpbmUgTlVN X09QQ09ERVMJKGNhc3QoaW50LCBPUF9ERVRVUExFKSArIDEpDQogDQogDQogDQpAQCAtMjE3LDYg KzIyMCwxMiBAQA0KICAgKCopIEluIE9QX0NBTEwsIGlmIChCID09IDApIHRoZW4gQiA9IHRvcC4g QyBpcyB0aGUgbnVtYmVyIG9mIHJldHVybnMgLSAxLA0KICAgICAgIGFuZCBjYW4gYmUgMDogT1Bf Q0FMTCB0aGVuIHNldHMgYHRvcCcgdG8gbGFzdF9yZXN1bHQrMSwgc28NCiAgICAgICBuZXh0IG9w ZW4gaW5zdHJ1Y3Rpb24gKE9QX0NBTEwsIE9QX1JFVFVSTiwgT1BfU0VUTElTVCkgbWF5IHVzZSBg dG9wJy4NCisNCisgICgqKSBJbiBPUF9UVVBMRSwgaWYgKEIgPT0gMCkgdGhlbiBCID0gdG9wLiBJ ZiAoQiA9PSAxKSB0aGVuIG5vcC4NCisNCisgICgqKSBJbiBPUF9ERVRVUExFLCBpZiAoQiA9PSAw KSB0aGVuIEIgPSB0b3AuIEMgaXMgdGhlIG51bWJlciBvZiByZXR1cm5zIC0gMSwNCisgICAgICBh bmQgY2FuIGJlIDA6IE9QX0RFVFVQTEUgdGhlbiBzZXRzIGB0b3AnIHRvIGxhc3RfcmVzdWx0KzEs IHNvDQorICAgICAgbmV4dCBvcGVuIGluc3RydWN0aW9uIG1heSB1c2UgYHRvcCcuDQogDQogICAo KikgSW4gT1BfVkFSQVJHLCBpZiAoQiA9PSAwKSB0aGVuIHVzZSBhY3R1YWwgbnVtYmVyIG9mIHZh cmFyZ3MgYW5kDQogICAgICAgc2V0IHRvcCAobGlrZSBpbiBPUF9DQUxMIHdpdGggQyA9PSAwKS4N CmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbHBhcnNlci5jIHNyYy9scGFyc2VyLmMNCi0t LSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xwYXJzZXIuYwlGcmkgRGVjIDI4IDE1OjMyOjI0IDIwMDcN CisrKyBzcmMvbHBhcnNlci5jCVRodSBBdWcgMTMgMTM6MDk6MDQgMjAwOQ0KQEAgLTI3LDcgKzI3 LDcgQEANCiANCiANCiANCi0jZGVmaW5lIGhhc211bHRyZXQoaykJCSgoaykgPT0gVkNBTEwgfHwg KGspID09IFZWQVJBUkcpDQorI2RlZmluZSBoYXNtdWx0cmV0KGspCQkoKGspID09IFZDQUxMIHx8 IChrKSA9PSBWVkFSQVJHIHx8IChrKSA9PSBWREVUVVBMRSkNCiANCiAjZGVmaW5lIGdldGxvY3Zh cihmcywgaSkJKChmcyktPmYtPmxvY3ZhcnNbKGZzKS0+YWN0dmFyW2ldXSkNCiANCkBAIC0xMjcs NiArMTI3LDcgQEANCiAgIGUtPmYgPSBlLT50ID0gTk9fSlVNUDsNCiAgIGUtPmsgPSBrOw0KICAg ZS0+dS5zLmluZm8gPSBpOw0KKyAgZS0+dHVwID0gMDsNCiB9DQogDQogDQpAQCAtNDM1LDcgKzQz Niw3IEBADQogICBleHBkZXNjIHY7ICAvKiBsYXN0IGxpc3QgaXRlbSByZWFkICovDQogICBleHBk ZXNjICp0OyAgLyogdGFibGUgZGVzY3JpcHRvciAqLw0KICAgaW50IG5oOyAgLyogdG90YWwgbnVt YmVyIG9mIGByZWNvcmQnIGVsZW1lbnRzICovDQotICBpbnQgbmE7ICAvKiB0b3RhbCBudW1iZXIg b2YgYXJyYXkgZWxlbWVudHMgKi8NCisgIGludCBuYTsgIC8qIGd1ZXNzIGFzIHRvIHRvdGFsIG51 bWJlciBvZiBgYXJyYXknIGVsZW1lbnRzICovDQogICBpbnQgdG9zdG9yZTsgIC8qIG51bWJlciBv ZiBhcnJheSBlbGVtZW50cyBwZW5kaW5nIHRvIGJlIHN0b3JlZCAqLw0KIH07DQogDQpAQCAtNDYz LDEwICs0NjQsMTcgQEANCiANCiBzdGF0aWMgdm9pZCBjbG9zZWxpc3RmaWVsZCAoRnVuY1N0YXRl ICpmcywgc3RydWN0IENvbnNDb250cm9sICpjYykgew0KICAgaWYgKGNjLT52LmsgPT0gVlZPSUQp IHJldHVybjsgIC8qIHRoZXJlIGlzIG5vIGxpc3QgaXRlbSAqLw0KKyAgaWYgKGhhc211bHRyZXQo Y2MtPnYuaykgJiYgY2MtPnYudHVwKSB7DQorICAgIGx1YUtfc2V0bXVsdHJldChmcywgJmNjLT52 KTsNCisgICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+dC0+dS5zLmluZm8sIExVQV9NVUxUUkVUKTsN CisgICAgY2MtPnRvc3RvcmUgPSAwOyAgLyogbm8gbW9yZSBpdGVtcyBwZW5kaW5nICovDQorICAg IGNjLT5uYS0tOw0KKyAgICByZXR1cm47DQorICB9DQogICBsdWFLX2V4cDJuZXh0cmVnKGZzLCAm Y2MtPnYpOw0KICAgY2MtPnYuayA9IFZWT0lEOw0KICAgaWYgKGNjLT50b3N0b3JlID09IExGSUVM RFNfUEVSX0ZMVVNIKSB7DQotICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBj Yy0+bmEsIGNjLT50b3N0b3JlKTsgIC8qIGZsdXNoICovDQorICAgIGx1YUtfc2V0bGlzdChmcywg Y2MtPnQtPnUucy5pbmZvLCBjYy0+dG9zdG9yZSk7ICAvKiBmbHVzaCAqLw0KICAgICBjYy0+dG9z dG9yZSA9IDA7ICAvKiBubyBtb3JlIGl0ZW1zIHBlbmRpbmcgKi8NCiAgIH0NCiB9DQpAQCAtNDc2 LDIyICs0ODQsMjMgQEANCiAgIGlmIChjYy0+dG9zdG9yZSA9PSAwKSByZXR1cm47DQogICBpZiAo aGFzbXVsdHJldChjYy0+di5rKSkgew0KICAgICBsdWFLX3NldG11bHRyZXQoZnMsICZjYy0+dik7 DQotICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBjYy0+bmEsIExVQV9NVUxU UkVUKTsNCi0gICAgY2MtPm5hLS07ICAvKiBkbyBub3QgY291bnQgbGFzdCBleHByZXNzaW9uICh1 bmtub3duIG51bWJlciBvZiBlbGVtZW50cykgKi8NCisgICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+ dC0+dS5zLmluZm8sIExVQV9NVUxUUkVUKTsNCisgICAgY2MtPm5hLS07DQogICB9DQogICBlbHNl IHsNCiAgICAgaWYgKGNjLT52LmsgIT0gVlZPSUQpDQogICAgICAgbHVhS19leHAybmV4dHJlZyhm cywgJmNjLT52KTsNCi0gICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+dC0+dS5zLmluZm8sIGNjLT5u YSwgY2MtPnRvc3RvcmUpOw0KKyAgICBsdWFLX3NldGxpc3QoZnMsIGNjLT50LT51LnMuaW5mbywg Y2MtPnRvc3RvcmUpOw0KICAgfQ0KIH0NCiANCiANCiBzdGF0aWMgdm9pZCBsaXN0ZmllbGQgKExl eFN0YXRlICpscywgc3RydWN0IENvbnNDb250cm9sICpjYykgew0KICAgZXhwcihscywgJmNjLT52 KTsNCi0gIGx1YVlfY2hlY2tsaW1pdChscy0+ZnMsIGNjLT5uYSwgTUFYX0lOVCwgIml0ZW1zIGlu IGEgY29uc3RydWN0b3IiKTsNCiAgIGNjLT5uYSsrOw0KICAgY2MtPnRvc3RvcmUrKzsNCisgIGlm ICh0ZXN0bmV4dChscywgVEtfRE9UUykpDQorICAgIGNjLT52LnR1cCA9IDE7DQogfQ0KIA0KIA0K QEAgLTU5NiwxMSArNjA1LDQ5IEBADQogc3RhdGljIGludCBleHBsaXN0MSAoTGV4U3RhdGUgKmxz LCBleHBkZXNjICp2KSB7DQogICAvKiBleHBsaXN0MSAtPiBleHByIHsgYCwnIGV4cHIgfSAqLw0K ICAgaW50IG4gPSAxOyAgLyogYXQgbGVhc3Qgb25lIGV4cHJlc3Npb24gKi8NCisgIGludCB0dXBs ZXMgPSAwOw0KKyAgaW50IGRldHVwbGVfZnJvbSA9IC0xOw0KICAgZXhwcihscywgdik7DQorICBp ZiAodGVzdG5leHQobHMsIFRLX0RPVFMpKQ0KKyAgICB2LT50dXAgPSB0dXBsZXMgPSAxOw0KICAg d2hpbGUgKHRlc3RuZXh0KGxzLCAnLCcpKSB7DQotICAgIGx1YUtfZXhwMm5leHRyZWcobHMtPmZz LCB2KTsNCisgICAgaWYodi0+dHVwKSB7DQorICAgICAgaWYgKCFoYXNtdWx0cmV0KHYtPmspKQ0K KyAgICAgICAgbHVhWF9zeW50YXhlcnJvcihscywgIkNhbm5vdCBleHBhbmQgZml4ZWQtbGVuZ3Ro IGV4cHJlc3Npb24iKTsNCisgICAgICBsdWFLX3NldG11bHRyZXQobHMtPmZzLCB2KTsNCisgICAg ICBsdWFLX2NvZGVBQkMobHMtPmZzLCBPUF9UVVBMRSwgbHMtPmZzLT5mcmVlcmVnIC0gMSwgMCwg MCk7DQorICAgICAgaWYgKGRldHVwbGVfZnJvbSA9PSAtMSkNCisgICAgICAgIGRldHVwbGVfZnJv bSA9IGxzLT5mcy0+ZnJlZXJlZyAtIDE7DQorICAgIH0NCisgICAgZWxzZSB7DQorICAgICAgbHVh S19leHAybmV4dHJlZyhscy0+ZnMsIHYpOw0KKyAgICB9DQogICAgIGV4cHIobHMsIHYpOw0KKyAg ICBpZiAodHVwbGVzICE9IDApDQorICAgICB0dXBsZXMrKzsNCisgICAgaWYgKHRlc3RuZXh0KGxz LCBUS19ET1RTKSkgew0KKyAgICAgIGlmICh0dXBsZXMgPT0gMCkNCisgICAgICAgIHR1cGxlcyA9 IDE7DQorICAgICAgdi0+dHVwID0gMTsNCisgICAgfQ0KICAgICBuKys7DQorICB9DQorICBpZiAo dHVwbGVzICE9IDApIHsNCisgICAgaW50IHVwdG87DQorICAgIGlmICh2LT50dXAgPT0gMSkgew0K KyAgICAgIGx1YVhfc3ludGF4ZXJyb3IobHMsICJDYW5ub3QgZXhwYW5kIGxhc3QgZXhwcmVzc2lv biBpbiBhIGxpc3QsIGFzIGl0IGlzIGFscmVhZHkgZXhwYW5kZWQiKTsNCisgICAgfQ0KKyAgICBp ZiAoaGFzbXVsdHJldCh2LT5rKSkgew0KKyAgICAgIGx1YUtfc2V0bXVsdHJldChscy0+ZnMsIHYp Ow0KKyAgICAgIHVwdG8gPSAwOyAvKiB0b3AgKi8NCisgICAgfQ0KKyAgICBlbHNlIHsNCisgICAg ICBsdWFLX2V4cDJuZXh0cmVnKGxzLT5mcywgdik7DQorICAgICAgdXB0byA9IGxzLT5mcy0+ZnJl ZXJlZyAtIGRldHVwbGVfZnJvbTsNCisgICAgfQ0KKyAgICBpbml0X2V4cCh2LCBWREVUVVBMRSwg bHVhS19jb2RlQUJDKGxzLT5mcywgT1BfREVUVVBMRSwgZGV0dXBsZV9mcm9tLCB1cHRvLCAwKSk7 DQorICAgIGxzLT5mcy0+ZnJlZXJlZyArPSAxIC0gdHVwbGVzOw0KKyAgICByZXR1cm4gKG4gLSB0 dXBsZXMgKyAxKTsNCiAgIH0NCiAgIHJldHVybiBuOw0KIH0NCmRpZmYgLXVQIC4uLy4uL2x1YS01 LjEuNC9zcmMvbHBhcnNlci5oIHNyYy9scGFyc2VyLmgNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3Jj L2xwYXJzZXIuaAlUaHUgRGVjIDI3IDEzOjAyOjI2IDIwMDcNCisrKyBzcmMvbHBhcnNlci5oCVdl ZCBBdWcgMTIgMTk6MjU6NDkgMjAwOQ0KQEAgLTMxLDcgKzMxLDggQEANCiAgIFZSRUxPQ0FCTEUs CS8qIGluZm8gPSBpbnN0cnVjdGlvbiBwYyAqLw0KICAgVk5PTlJFTE9DLAkvKiBpbmZvID0gcmVz dWx0IHJlZ2lzdGVyICovDQogICBWQ0FMTCwJLyogaW5mbyA9IGluc3RydWN0aW9uIHBjICovDQot ICBWVkFSQVJHCS8qIGluZm8gPSBpbnN0cnVjdGlvbiBwYyAqLw0KKyAgVlZBUkFSRywJLyogaW5m byA9IGluc3RydWN0aW9uIHBjICovDQorICBWREVUVVBMRSAgLyogaW5mbyA9IGluc3RydWN0aW9u IHBjICovDQogfSBleHBraW5kOw0KIA0KIHR5cGVkZWYgc3RydWN0IGV4cGRlc2Mgew0KQEAgLTQy LDYgKzQzLDcgQEANCiAgIH0gdTsNCiAgIGludCB0OyAgLyogcGF0Y2ggbGlzdCBvZiBgZXhpdCB3 aGVuIHRydWUnICovDQogICBpbnQgZjsgIC8qIHBhdGNoIGxpc3Qgb2YgYGV4aXQgd2hlbiBmYWxz ZScgKi8NCisgIGludCB0dXA7IC8qIGlmIG5vbi16ZXJvLCB0dXJuIGludG8gYSB0dXBsZSAqLw0K IH0gZXhwZGVzYzsNCiANCiANCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbHN0YXRlLmMg c3JjL2xzdGF0ZS5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sc3RhdGUuYwlUaHUgSmFuICAz IDE1OjIwOjQwIDIwMDgNCisrKyBzcmMvbHN0YXRlLmMJV2VkIEF1ZyAxMiAxNzo0MDozNiAyMDA5 DQpAQCAtNTEsMTYgKzUxLDIyIEBADQogICBMMS0+dG9wID0gTDEtPnN0YWNrOw0KICAgTDEtPnN0 YWNrX2xhc3QgPSBMMS0+c3RhY2srKEwxLT5zdGFja3NpemUgLSBFWFRSQV9TVEFDSyktMTsNCiAg IC8qIGluaXRpYWxpemUgZmlyc3QgY2kgKi8NCisgIEwxLT5jaS0+c2F2ZWR0dXAgPSAwOw0KICAg TDEtPmNpLT5mdW5jID0gTDEtPnRvcDsNCiAgIHNldG5pbHZhbHVlKEwxLT50b3ArKyk7ICAvKiBg ZnVuY3Rpb24nIGVudHJ5IGZvciB0aGlzIGBjaScgKi8NCiAgIEwxLT5iYXNlID0gTDEtPmNpLT5i YXNlID0gTDEtPnRvcDsNCiAgIEwxLT5jaS0+dG9wID0gTDEtPnRvcCArIExVQV9NSU5TVEFDSzsN CisgIC8qIHR1cGxlcyAqLw0KKyAgTDEtPnR1cGxlc3NpemUgPSA0Ow0KKyAgTDEtPnR1cGxlcyA9 IGx1YU1fbmV3dmVjdG9yKEwsIEwxLT50dXBsZXNzaXplLCBUVmFsdWUpOw0KKyAgTDEtPnR1cGxl c3RvcCA9IEwxLT50dXBsZXM7DQogfQ0KIA0KIA0KIHN0YXRpYyB2b2lkIGZyZWVzdGFjayAobHVh X1N0YXRlICpMLCBsdWFfU3RhdGUgKkwxKSB7DQogICBsdWFNX2ZyZWVhcnJheShMLCBMMS0+YmFz ZV9jaSwgTDEtPnNpemVfY2ksIENhbGxJbmZvKTsNCiAgIGx1YU1fZnJlZWFycmF5KEwsIEwxLT5z dGFjaywgTDEtPnN0YWNrc2l6ZSwgVFZhbHVlKTsNCisgIGx1YU1fZnJlZWFycmF5KEwsIEwxLT50 dXBsZXMsIEwxLT50dXBsZXNzaXplLCBUVmFsdWUpOw0KIH0NCiANCiANCkBAIC04NSw2ICs5MSw5 IEBADQogICBHKEwpID0gZzsNCiAgIEwtPnN0YWNrID0gTlVMTDsNCiAgIEwtPnN0YWNrc2l6ZSA9 IDA7DQorICBMLT50dXBsZXMgPSBOVUxMOw0KKyAgTC0+dHVwbGVzdG9wID0gTlVMTDsNCisgIEwt PnR1cGxlc3NpemUgPSAwOw0KICAgTC0+ZXJyb3JKbXAgPSBOVUxMOw0KICAgTC0+aG9vayA9IE5V TEw7DQogICBMLT5ob29rbWFzayA9IDA7DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xz dGF0ZS5oIHNyYy9sc3RhdGUuaA0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbHN0YXRlLmgJVGh1 IEphbiAgMyAxNToyMDo0MCAyMDA4DQorKysgc3JjL2xzdGF0ZS5oCVdlZCBBdWcgMTIgMTY6Mjc6 NTUgMjAwOQ0KQEAgLTUwLDYgKzUwLDcgQEANCiAgIFN0a0lkIGZ1bmM7ICAvKiBmdW5jdGlvbiBp bmRleCBpbiB0aGUgc3RhY2sgKi8NCiAgIFN0a0lkCXRvcDsgIC8qIHRvcCBmb3IgdGhpcyBmdW5j dGlvbiAqLw0KICAgY29uc3QgSW5zdHJ1Y3Rpb24gKnNhdmVkcGM7DQorICBpbnQgc2F2ZWR0dXA7 ICAvKiBhbW91bnQgb2YgdHVwbGUgc3BhY2UgdXNlZCB1bmRlciB0aGlzIGZ1bmN0aW9uICovDQog ICBpbnQgbnJlc3VsdHM7ICAvKiBleHBlY3RlZCBudW1iZXIgb2YgcmVzdWx0cyBmcm9tIHRoaXMg ZnVuY3Rpb24gKi8NCiAgIGludCB0YWlsY2FsbHM7ICAvKiBudW1iZXIgb2YgdGFpbCBjYWxscyBs b3N0IHVuZGVyIHRoaXMgZW50cnkgKi8NCiB9IENhbGxJbmZvOw0KQEAgLTEwNyw2ICsxMDgsOSBA QA0KICAgY29uc3QgSW5zdHJ1Y3Rpb24gKnNhdmVkcGM7ICAvKiBgc2F2ZWRwYycgb2YgY3VycmVu dCBmdW5jdGlvbiAqLw0KICAgU3RrSWQgc3RhY2tfbGFzdDsgIC8qIGxhc3QgZnJlZSBzbG90IGlu IHRoZSBzdGFjayAqLw0KICAgU3RrSWQgc3RhY2s7ICAvKiBzdGFjayBiYXNlICovDQorICBTdGtJ ZCB0dXBsZXM7IC8qIHR1cGxlcyBiYXNlICovDQorICBTdGtJZCB0dXBsZXN0b3A7IC8qIGZyZWUg cG9zaXRpb24gZm9yIG5leHQgdHVwbGUgKi8NCisgIGludCB0dXBsZXNzaXplOyAvKiBzaXplIG9m IHR1cGxlcyBhcnJheSAqLw0KICAgQ2FsbEluZm8gKmVuZF9jaTsgIC8qIHBvaW50cyBhZnRlciBl bmQgb2YgY2kgYXJyYXkqLw0KICAgQ2FsbEluZm8gKmJhc2VfY2k7ICAvKiBhcnJheSBvZiBDYWxs SW5mbydzICovDQogICBpbnQgc3RhY2tzaXplOw0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3Ny Yy9sdGFibGUuYyBzcmMvbHRhYmxlLmMNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2x0YWJsZS5j CUZyaSBEZWMgMjggMTU6MzI6MjQgMjAwNw0KKysrIHNyYy9sdGFibGUuYwlUaHUgQXVnIDEzIDAx OjI1OjQwIDIwMDkNCkBAIC0zNjMsNiArMzYzLDcgQEANCiAgIC8qIHRlbXBvcmFyeSB2YWx1ZXMg KGtlcHQgb25seSBpZiBzb21lIG1hbGxvYyBmYWlscykgKi8NCiAgIHQtPmFycmF5ID0gTlVMTDsN CiAgIHQtPnNpemVhcnJheSA9IDA7DQorICB0LT5uZXh0c2V0bGlzdCA9IDA7DQogICB0LT5sc2l6 ZW5vZGUgPSAwOw0KICAgdC0+bm9kZSA9IGNhc3QoTm9kZSAqLCBkdW1teW5vZGUpOw0KICAgc2V0 YXJyYXl2ZWN0b3IoTCwgdCwgbmFycmF5KTsNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMv bHZtLmMgc3JjL2x2bS5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sdm0uYwlTdW4gRmViICA4 IDEzOjMwOjQ5IDIwMDkNCisrKyBzcmMvbHZtLmMJVGh1IEF1ZyAxMyAwMjoxNzoxNSAyMDA5DQpA QCAtNjkyLDE3ICs2OTIsMTYgQEANCiAgICAgICB9DQogICAgICAgY2FzZSBPUF9TRVRMSVNUOiB7 DQogICAgICAgICBpbnQgbiA9IEdFVEFSR19CKGkpOw0KLSAgICAgICAgaW50IGMgPSBHRVRBUkdf QyhpKTsNCiAgICAgICAgIGludCBsYXN0Ow0KICAgICAgICAgVGFibGUgKmg7DQogICAgICAgICBp ZiAobiA9PSAwKSB7DQogICAgICAgICAgIG4gPSBjYXN0X2ludChMLT50b3AgLSByYSkgLSAxOw0K ICAgICAgICAgICBMLT50b3AgPSBMLT5jaS0+dG9wOw0KICAgICAgICAgfQ0KLSAgICAgICAgaWYg KGMgPT0gMCkgYyA9IGNhc3RfaW50KCpwYysrKTsNCiAgICAgICAgIHJ1bnRpbWVfY2hlY2soTCwg dHRpc3RhYmxlKHJhKSk7DQogICAgICAgICBoID0gaHZhbHVlKHJhKTsNCi0gICAgICAgIGxhc3Qg PSAoKGMtMSkqTEZJRUxEU19QRVJfRkxVU0gpICsgbjsNCisgICAgICAgIGxhc3QgPSBoLT5uZXh0 c2V0bGlzdCArIG47DQorICAgICAgICBoLT5uZXh0c2V0bGlzdCArPSBuOw0KICAgICAgICAgaWYg KGxhc3QgPiBoLT5zaXplYXJyYXkpICAvKiBuZWVkcyBtb3JlIHNwYWNlPyAqLw0KICAgICAgICAg ICBsdWFIX3Jlc2l6ZWFycmF5KEwsIGgsIGxhc3QpOyAgLyogcHJlLWFsbG9jIGl0IGF0IG9uY2Ug Ki8NCiAgICAgICAgIGZvciAoOyBuID4gMDsgbi0tKSB7DQpAQCAtNzUzLDYgKzc1Miw3OCBAQA0K ICAgICAgICAgICB9DQogICAgICAgICAgIGVsc2Ugew0KICAgICAgICAgICAgIHNldG5pbHZhbHVl KHJhICsgaik7DQorICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIGNvbnRpbnVlOw0K KyAgICAgIH0NCisgICAgICBjYXNlIE9QX1RVUExFOiB7DQorICAgICAgICBpbnQgYiA9IEdFVEFS R19CKGkpIC0gMTsNCisgICAgICAgIGludCBzdGFydDsNCisgICAgICAgIGludCBqOw0KKyAgICAg ICAgU3RrSWQgdHVwOw0KKyAgICAgICAgaWYgKGIgPT0gTFVBX01VTFRSRVQpDQorICAgICAgICB7 DQorICAgICAgICAgIGIgPSBjYXN0X2ludChMLT50b3AgLSByYSk7DQorICAgICAgICAgIEwtPnRv cCA9IEwtPmNpLT50b3A7DQorICAgICAgICB9DQorICAgICAgICBpZiAoYiA8PSAwKQ0KKyAgICAg ICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgaWYgKGNhc3RfaW50KEwtPnR1cGxlc3RvcCAtIEwt PnR1cGxlcykgKyBiICsgMSA+IEwtPnR1cGxlc3NpemUpIHsNCisgICAgICAgICAgaW50IHJlYWxz aXplID0gTC0+dHVwbGVzc2l6ZSAqIDIgKyBiICsgMTsNCisgICAgICAgICAgdHVwID0gTC0+dHVw bGVzOw0KKyAgICAgICAgICBsdWFNX3JlYWxsb2N2ZWN0b3IoTCwgTC0+dHVwbGVzLCBMLT50dXBs ZXNzaXplLCByZWFsc2l6ZSwgVFZhbHVlKTsNCisgICAgICAgICAgTC0+dHVwbGVzc2l6ZSA9IHJl YWxzaXplOw0KKyAgICAgICAgICBMLT50dXBsZXN0b3AgPSBjYXN0X2ludChMLT50dXBsZXN0b3Ag LSB0dXApICsgTC0+dHVwbGVzOw0KKyAgICAgICAgfQ0KKyAgICAgICAgdHVwID0gTC0+dHVwbGVz dG9wOw0KKyAgICAgICAgTC0+dHVwbGVzdG9wICs9IGIgKyAxOw0KKyAgICAgICAgc3RhcnQgPSBj YXN0X2ludCh0dXAgLSBMLT50dXBsZXMpOw0KKyAgICAgICAgc2V0dHV2YWx1ZSh0dXAsIGIpOw0K KyAgICAgICAgZm9yIChqID0gMDsgaiA8IGI7IGorKykgew0KKyAgICAgICAgICBzZXRvYmooTCwg dHVwICsgMSArIGosIHJhICsgaik7DQorICAgICAgICB9DQorICAgICAgICBzZXR0dXZhbHVlKHJh LCBzdGFydCk7DQorICAgICAgICBjb250aW51ZTsNCisgICAgICB9DQorICAgICAgY2FzZSBPUF9E RVRVUExFOiB7DQorICAgICAgICBpbnQgbnJlc3VsdHMgPSBHRVRBUkdfQyhpKSAtIDE7DQorICAg ICAgICBpbnQgZXh0cmEsIGosIGI7DQorICAgICAgICBTdGtJZCBycCwgbGFzdDsNCisgICAgICAg IGIgPSBHRVRBUkdfQihpKSAtIDE7DQorICAgICAgICBpZiAoYiA9PSBMVUFfTVVMVFJFVCkNCisg ICAgICAgICAgYiA9IGNhc3RfaW50KEwtPnRvcCAtIHJhKSAtIDE7DQorICAgICAgICBleHRyYSA9 IDA7DQorICAgICAgICBmb3IgKHJwID0gcmE7IHJwIDw9IHJhICsgYjsgcnArKykgew0KKyAgICAg ICAgICBpZihycC0+dHQgPT0gTFVBX1RUVVBMRSkNCisgICAgICAgICAgICBleHRyYSArPSBnZXR0 dXNpemUoTCwgcnApIC0gMTsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChleHRyYSA9PSAwKQ0K KyAgICAgICAgICBjb250aW51ZTsNCisgICAgICAgIFByb3RlY3QobHVhRF9jaGVja3N0YWNrKEws IGV4dHJhKSk7DQorICAgICAgICByYSA9IFJBKGkpOyAgLyogcHJldmlvdXMgY2FsbCBtYXkgY2hh bmdlIHRoZSBzdGFjayAqLw0KKyAgICAgICAgcnAgPSByYSArIGI7DQorICAgICAgICBpZiAobnJl c3VsdHMgPT0gTFVBX01VTFRSRVQpIHsNCisgICAgICAgICAgbGFzdCA9IHJwICsgZXh0cmEgKyAx Ow0KKyAgICAgICAgICBMLT50b3AgPSBsYXN0Ow0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSB7 DQorICAgICAgICAgIGxhc3QgPSByYSArIG5yZXN1bHRzOw0KKyAgICAgICAgICB3aGlsZShycCAr IGV4dHJhICsgMSA8IGxhc3QpDQorICAgICAgICAgICAgc2V0bmlsdmFsdWUoLS1sYXN0KTsNCisg ICAgICAgIH0NCisgICAgICAgIGZvciAoOyBycCA+PSByYTsgcnAtLSApIHsNCisgICAgICAgICAg aWYocnAtPnR0ICE9IExVQV9UVFVQTEUpIHsNCisgICAgICAgICAgICBzZXRvYmoycyhMLCBycCAr IGV4dHJhLCBycCk7DQorICAgICAgICAgIH0NCisgICAgICAgICAgZWxzZSB7DQorICAgICAgICAg ICAgTC0+dHVwbGVzdG9wID0gTC0+dHVwbGVzICsgZ2V0dHV2YWx1ZShycCk7DQorICAgICAgICAg ICAgZm9yIChqID0gZ2V0dHVzaXplKEwsIHJwKSAtIDE7IGogPj0gMDsgai0tLCBleHRyYS0tKSB7 DQorICAgICAgICAgICAgICBpZiAocnAgKyBleHRyYSA8IGxhc3QpDQorICAgICAgICAgICAgICAg IHNldG9iaihMLCBycCArIGV4dHJhLCBMLT50dXBsZXMgKyBycC0+dmFsdWUuYiArIDEgKyBqKTsN CisgICAgICAgICAgICB9DQorICAgICAgICAgICAgZXh0cmErKzsNCisgICAgICAgICAgICBpZihl eHRyYSA9PSAwKQ0KKyAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgIH0NCiAgICAgICAg IH0NCiAgICAgICAgIGNvbnRpbnVlOw0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9wcmlu dC5jIHNyYy9wcmludC5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9wcmludC5jCU1vbiBNYXIg MjYgMDE6MTc6MzggMjAwNw0KKysrIHNyYy9wcmludC5jCVRodSBBdWcgMTMgMTM6MTU6NTIgMjAw OQ0KQEAgLTE0NCwxMCArMTQ0LDYgQEANCiAgICBjYXNlIE9QX0NMT1NVUkU6DQogICAgIHByaW50 ZigiXHQ7ICVwIixWT0lEKGYtPnBbYnhdKSk7DQogICAgIGJyZWFrOw0KLSAgIGNhc2UgT1BfU0VU TElTVDoNCi0gICAgaWYgKGM9PTApIHByaW50ZigiXHQ7ICVkIiwoaW50KWNvZGVbKytwY10pOw0K LSAgICBlbHNlIHByaW50ZigiXHQ7ICVkIixjKTsNCi0gICAgYnJlYWs7DQogICAgZGVmYXVsdDoN CiAgICAgYnJlYWs7DQogICB9DQo= --001485f6d2a4213a9c047104f2ca Content-Type: application/octet-stream; name="tuples.lua" Content-Disposition: attachment; filename="tuples.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fybghk151 bG9jYWwgZnVuY3Rpb24gYXJncyguLi4pDQogIGxvY2FsIHQgPSB7Li4ufQ0KICB0Lm4gPSBzZWxl Y3QoJyMnLCAuLi4pDQogIHJldHVybiB0DQplbmQNCg0KbG9jYWwgZnVuY3Rpb24gcGFzcyguLi4p IHJldHVybiAuLi4gZW5kDQoNCmZ1bmN0aW9uIGNoZWNrX2VxdWFsKG5hbWUsIGFyZ3MxLCBhcmdz MikNCiAgbG9jYWwgZXF1YWwgPSBhcmdzMS5uID09IGFyZ3MyLm4NCiAgaWYgZXF1YWwgdGhlbg0K ICAgIGZvciBpID0gMSwgYXJnczEubiBkbw0KICAgICAgaWYgYXJnczFbaV0gfj0gYXJnczJbaV0g dGhlbg0KICAgICAgICBlcXVhbCA9IGZhbHNlDQogICAgICAgIGJyZWFrDQogICAgICBlbmQNCiAg ICBlbmQNCiAgZW5kDQogIHByaW50KG5hbWUsIGVxdWFsIGFuZCAiR29vZCIgb3IgIkJBRCIpDQog IGlmIG5vdCBlcXVhbCB0aGVuDQogICAgcHJpbnQodW5wYWNrKGFyZ3MxLCAxLCBhcmdzMS5uKSkN CiAgICBwcmludCh1bnBhY2soYXJnczIsIDEsIGFyZ3MyLm4pKQ0KICBlbmQNCmVuZA0KDQpmdW5j dGlvbiBjaGVja19lcXVhbF90KG5hbWUsIHQxLCB0MikNCiAgbG9jYWwgZXF1YWwgPSB0cnVlDQog IGxvY2FsIGsyDQogIGZvciBrLCB2IGluIHBhaXJzKHQxKSBkbw0KICAgIGlmIHQyW2tdIH49IHYg dGhlbg0KICAgICAgZXF1YWwgPSBmYWxzZQ0KICAgIGVuZA0KICAgIGsyID0gbmV4dCh0MiwgazIp DQogIGVuZA0KICBpZiBuZXh0KHQyLCBrMikgfj0gbmlsIHRoZW4NCiAgICBlcXVhbCA9IGZhbHNl DQogIGVuZA0KICBwcmludChuYW1lLCBlcXVhbCBhbmQgIkdvb2QiIG9yICJCQUQiKQ0KZW5kDQoN CmNoZWNrX2VxdWFsKCJSZXR1cm4gZHVwbGljYXRlZCBhcmd1bWVudHMiLA0KICBhcmdzKChmdW5j dGlvbiguLi4pIHJldHVybiAuLi4gLi4uLCAuLi4gZW5kKSgiQSIsICJCIiwgIkMiKSksDQogIGFy Z3MoIkEiLCAiQiIsICJDIiwgIkEiLCAiQiIsICJDIikNCikNCiAgDQpjaGVja19lcXVhbCgiUmV0 dXJuIGR1cGxpY2F0ZWQgYXJndW1lbnRzIHdpdGggcGFzcyIsDQogIGFyZ3MoKGZ1bmN0aW9uKC4u LikgcmV0dXJuIHBhc3MoLi4uKSAuLi4sIHBhc3MoLi4uKSBlbmQpKCJBIiwgIkIiLCAiQyIpKSwN CiAgYXJncygiQSIsICJCIiwgIkMiLCAiQSIsICJCIiwgIkMiKQ0KKQ0KICANCmNoZWNrX2VxdWFs KCJSZXR1cm4gdHJpcGxlIGR1cGxpY2F0ZWQgYXJndW1lbnRzIiwNCiAgYXJncygoZnVuY3Rpb24o Li4uKSByZXR1cm4gLi4uIC4uLiwgLi4uIC4uLiwgLi4uIGVuZCkoIkEiLCBuaWwpKSwNCiAgYXJn cygiQSIsIG5pbCwgIkEiLCBuaWwsICJBIiwgbmlsKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhwYW5z aW9uIGF0IHN0YXJ0IG9mIGZ1bmN0aW9uIGFyZ3VtZW50cyIsDQogIGFyZ3MoKGZ1bmN0aW9uKCkg cmV0dXJuICJBIiwgIkIiLCAiQyIsICJEIiBlbmQpKCkgLi4uLCAiRSIpLA0KICBhcmdzKCJBIiwg IkIiLCAiQyIsICJEIiwgIkUiKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhwYW5zaW9uIGluIG1pZGRs ZSBvZiBmdW5jdGlvbiBhcmd1bWVudHMiLA0KICBhcmdzKCJBIiwgKGZ1bmN0aW9uKCkgcmV0dXJu ICJCIiwgIkMiIGVuZCkoKSAuLi4sICJEIiwgIkUiKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAi RCIsICJFIikNCikNCg0KY2hlY2tfZXF1YWwoIkV4cGFuc2lvbiBpbiBtaWRkbGUgb2YgZnVuY3Rp b24gYXJndW1lbnRzIHdpdGggdmFyYXJnIGVuZCIsDQogIGFyZ3MoIkEiLCAoZnVuY3Rpb24oKSBy ZXR1cm4gIkIiLCAiQyIgZW5kKSgpIC4uLiwgIkQiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkUiLCAi RiIgZW5kKSgpKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAiRCIsICJFIiwgIkYiKQ0KKQ0KDQpj aGVja19lcXVhbCgiRHVhbCBleHBhbnNpb24gaW4gbWlkZGxlIG9mIGZ1bmN0aW9uIGFyZ3VtZW50 cyIsDQogIGFyZ3MoIkEiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkIiLCAiQyIgZW5kKSgpIC4uLiwg IkQiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkUiLCAiRiIgZW5kKSgpIC4uLiwgIkciKSwNCiAgYXJn cygiQSIsICJCIiwgIkMiLCAiRCIsICJFIiwgIkYiLCAiRyIpDQopDQoNCmNoZWNrX2VxdWFsKCJF eHBhbnNpb24gaW4gYXNzaWdubWVudCIsDQogIGFyZ3MoKGZ1bmN0aW9uKC4uLikNCiAgICBsb2Nh bCBhLCBiLCBjLCBkLCBlID0gIkEiLCAuLi4gLi4uLCAiRSINCiAgICByZXR1cm4gYSwgYiwgYywg ZCwgZQ0KICBlbmQpKCJCIiwgIkMiLCAiRCIpKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAiRCIs ICJFIikNCikNCg0KZnVuY3Rpb24gTHNlbGVjdChuLCAuLi4pDQogIGlmIG4gPT0gJyMnIHRoZW4N CiAgICBsb2NhbCBtYXJrZXIgPSB7fQ0KICAgIGxvY2FsIHQgPSB7Li4uIC4uLiwgbWFya2VyfQ0K ICAgIGZvciBrLCB2IGluIHBhaXJzKHQpIGRvDQogICAgICBpZiB2ID09IG1hcmtlciB0aGVuDQog ICAgICAgIHJldHVybiBrIC0gMQ0KICAgICAgZW5kDQogICAgZW5kDQogIGVsc2VpZiBuIDwgMCB0 aGVuDQogICAgcmV0dXJuIExzZWxlY3QoTHNlbGVjdCgnIycsIC4uLikgKyAxICsgbiwgLi4uKQ0K ICBlbmQNCiAgcmV0dXJuICh7Li4ufSlbbl0NCmVuZA0KDQpjaGVja19lcXVhbCgiTHNlbGVjdCAj IiwNCiAgYXJncyhMc2VsZWN0KCcjJywgImEiLCAiYiIsIG5pbCwgbmlsKSksDQogIGFyZ3Moc2Vs ZWN0KCcjJywgImEiLCAiYiIsIG5pbCwgbmlsKSkNCikNCg0KY2hlY2tfZXF1YWxfdCgiU3RhbmRh cmQgdGFibGUgY29uc3RydWN0b3IiLA0KICB7IkEiLCAiQiIsICJDIiwgWzBdID0gIiAiLCBrID0g InYiLCAiRCJ9LA0KICB7WzBdID0gIiAiLCBbMV0gPSAiQSIsIFsyXSA9ICJCIiwgWzNdID0gIkMi LCBbNF0gPSAiRCIsIFsiayJdID0gInYifQ0KKQ0KDQpjaGVja19lcXVhbF90KCJNdWx0aXBsZSBl eHBhbmRlZCB1bnBhY2tzIiwNCiAge3VucGFja3s0LCB1bnBhY2t7NSwgNn0gLi4uLCA3fSAuLi4s IDh9LA0KICB7NCwgNSwgNiwgNywgOH0NCikNCg== --001485f6d2a4213a9c047104f2ca-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 11:20:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DEKBVj014980; Thu, 13 Aug 2009 11:20:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E857818C23; Thu, 13 Aug 2009 11:19:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C50018AAD for ; Thu, 13 Aug 2009 11:19:22 -0300 (BRT) Received: by ewy26 with SMTP id 26so847945ewy.5 for ; Thu, 13 Aug 2009 07:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pKLTcSvNZEeQJ3NdhXL+c3C19fGq6wDyluafDzZWxdc=; b=NsUmh+0aT3VHhR/Pf447R9UXpZ0mqyRRlyVO13xslofT+otinXC6TkB0XQyofA6nJN G1lfKmUu8KRsaS/VKvxk4LlDRpBQg0cRpMgr9xB6OUJbMcg2BvNvjGPfEA7cQsaHw2a2 YV8cYgXLv8yHgW75s+G3ky6R+0SpPuGIFSyUQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=HKH5rlySWtMG+K1DSpquEZQbAn7HTirguQ7eT710MxVW4eKL57e3ssHUKTxi+r4W07 D2zYl439miWCBoScTpoHAxh+OBh1kLY9ZwOF1Fl5WbbkskRhb+lkTGWAK29WVT62WSFo /kYiGV4u7gLLTOoIkmSxgXIN/aCN+GLfEIV5U= MIME-Version: 1.0 Received: by 10.216.36.82 with SMTP id v60mr195799wea.120.1250173159492; Thu, 13 Aug 2009 07:19:19 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Thu, 13 Aug 2009 15:19:19 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 13, 2009 at 1:19 PM, Peter Cawley wrote: > On Thu, Aug 13, 2009 at 1:00 PM, steve donovan wrote: >> Now, would this also apply to function argument lists, which is the >> other place where multiple returns are not discarded if at the end? > > According to the BNF description of Lua, the arguments in a function > call are an expression list, so IMO it should apply here too (and my > patch does so). It is part of my original proposal as well - I think it is an important factor, that this should work consistently anywhere it makes sense. In fact Peter's tuples.lua example makes me realise that in my original post I'd actually missed out another case - in the list of *return* values from a function, e.g.: ----- function multivalues() return 1,2,3 end function multivalues2() return multivalues()..., 4 end ----- Thank you for creating your patch so quickly, Peter, it is much appreciated - I was still in the early stages with mine. I've tried it out here and it works with everything I can think to throw at it. I can see it's not a trivial change - it does require new opcodes, etc. - but it doesn't look too drastic to me. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 12:22:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DFM0df028784; Thu, 13 Aug 2009 12:22:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 367BF191F0; Thu, 13 Aug 2009 12:21:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D7731914F for ; Thu, 13 Aug 2009 12:21:21 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so150288eye.11 for ; Thu, 13 Aug 2009 08:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uBWfdSDBiu8ipoAGwQ3oGhb0FthDLe6Vgirn1i+vmjA=; b=sFdmLVJSPsz1kQjOEtO448NG6tHBa3NUAJoxDBbD7dIbQaIvIZ9MKvKW0msg9i599I IlbvRPpi+YTGNSB4nf/+GMGVN25TGAWU6D0thi9ufS2vrT4qPl7DOvfDnmJkNloAKCsU +L9HvBLHumcPQw/DciHrt/ciDfKALGHuVq4cc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RdxkmxAGdJjgX3YdGL3VwCbGAZ36CGHcsiUOupIYplrYGFabCPcvKG8Xq+hNUxAuR9 87nqstyGmaERklN0oCJ6ZKYUEMmcEV7Vqu77cDDuDVv3KfVsfMelAH7hxWZ93OR+hSuV xjpsO27N3TuAHJpYyoAOZWVwFli4ogSs0tkn0= MIME-Version: 1.0 Received: by 10.216.54.207 with SMTP id i57mr203987wec.114.1250176879425; Thu, 13 Aug 2009 08:21:19 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Thu, 13 Aug 2009 16:21:19 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7DFM0df028784 On Thu, Aug 13, 2009 at 1:19 PM, Peter Cawley wrote: > On Thu, Aug 13, 2009 at 1:00 PM, steve donovan wrote: >> Now, would this also apply to function argument lists, which is the >> other place where multiple returns are not discarded if at the end? > > According to the BNF description of Lua, the arguments in a function > call are an expression list, so IMO it should apply here too (and my > patch does so). > > E:\CPP\2K8\lua-5.1.4-proto>Debug\lua-5.1.4-proto.exe > Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio >> t = {4, 5, 6} >> print(unpack(t) ..., 7) > 4       5       6       7 >> print(unpack{4, unpack{5, 6} ..., 7} ..., 8) > 4       5       6       7       8 > > Also note that attached is a revised patch. > Thanks again for this Peter, I've experimented with it a bit more and found some bugs - both relating to trying the "Return duplicated arguments" test with different numbers of arguments: + Zero arguments ends up with a single "nil" value (it looks like detuple is expanding an empty list to one nil value?) + One argument ends up with some weird value that Lua represents as ": 0000000" instead (a tuple that never got detupled?) I have only tried the revised patch, so I don't know if these are present in the original one as well. Cheers, -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 13:11:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DGAxQZ006339; Thu, 13 Aug 2009 13:10:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38A118BED; Thu, 13 Aug 2009 13:09:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 416CE189F8 for ; Thu, 13 Aug 2009 13:09:24 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so157505eye.11 for ; Thu, 13 Aug 2009 09:09:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.16 with SMTP id b16mr206429wef.57.1250179761183; Thu, 13 Aug 2009 09:09:21 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Thu, 13 Aug 2009 17:09:21 +0100 X-Google-Sender-Auth: e04dad7753fdd875 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: multipart/mixed; boundary=0016e6d7ee5c92398f04710828d6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d7ee5c92398f04710828d6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Aug 13, 2009 at 4:21 PM, Duncan Cross wrote: > > Thanks again for this Peter, I've experimented with it a bit more and > found some bugs - both relating to trying the "Return duplicated > arguments" test with different numbers of arguments: > + Zero arguments ends up with a single "nil" value (it looks like > detuple is expanding an empty list to one nil value?) > + One argument ends up with some weird value that Lua represents as ": > 0000000" instead (a tuple that never got detupled?) Should now be fixed. --0016e6d7ee5c92398f04710828d6 Content-Type: application/octet-stream; name="expvar.diff" Content-Disposition: attachment; filename="expvar.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fybopcso0 ZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5jIHNyYy9sY29kZS5jDQotLS0gLi4v Li4vbHVhLTUuMS40L3NyYy9sY29kZS5jCUZyaSBEZWMgMjggMTU6MzI6MjQgMjAwNw0KKysrIHNy Yy9sY29kZS5jCVRodSBBdWcgMTMgMDE6Mzg6MTggMjAwOQ0KQEAgLTI3OCw3ICsyNzgsNyBAQA0K IA0KIA0KIHZvaWQgbHVhS19zZXRyZXR1cm5zIChGdW5jU3RhdGUgKmZzLCBleHBkZXNjICplLCBp bnQgbnJlc3VsdHMpIHsNCi0gIGlmIChlLT5rID09IFZDQUxMKSB7ICAvKiBleHByZXNzaW9uIGlz IGFuIG9wZW4gZnVuY3Rpb24gY2FsbD8gKi8NCisgIGlmIChlLT5rID09IFZDQUxMIHx8IGUtPmsg PT0gVkRFVFVQTEUpIHsgIC8qIGV4cHJlc3Npb24gaXMgYW4gb3BlbiBmdW5jdGlvbiBjYWxsPyAq Lw0KICAgICBTRVRBUkdfQyhnZXRjb2RlKGZzLCBlKSwgbnJlc3VsdHMrMSk7DQogICB9DQogICBl bHNlIGlmIChlLT5rID09IFZWQVJBUkcpIHsNCkBAIC0zMjUsNyArMzI1LDggQEANCiAgICAgICBi cmVhazsNCiAgICAgfQ0KICAgICBjYXNlIFZWQVJBUkc6DQotICAgIGNhc2UgVkNBTEw6IHsNCisg ICAgY2FzZSBWQ0FMTDoNCisgICAgY2FzZSBWREVUVVBMRTogew0KICAgICAgIGx1YUtfc2V0b25l cmV0KGZzLCBlKTsNCiAgICAgICBicmVhazsNCiAgICAgfQ0KQEAgLTgyNCwxNiArODI1LDEwIEBA DQogfQ0KIA0KIA0KLXZvaWQgbHVhS19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwg aW50IG5lbGVtcywgaW50IHRvc3RvcmUpIHsNCi0gIGludCBjID0gIChuZWxlbXMgLSAxKS9MRklF TERTX1BFUl9GTFVTSCArIDE7DQordm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMsIGlu dCBiYXNlLCBpbnQgdG9zdG9yZSkgew0KICAgaW50IGIgPSAodG9zdG9yZSA9PSBMVUFfTVVMVFJF VCkgPyAwIDogdG9zdG9yZTsNCiAgIGx1YV9hc3NlcnQodG9zdG9yZSAhPSAwKTsNCi0gIGlmIChj IDw9IE1BWEFSR19DKQ0KLSAgICBsdWFLX2NvZGVBQkMoZnMsIE9QX1NFVExJU1QsIGJhc2UsIGIs IGMpOw0KLSAgZWxzZSB7DQotICAgIGx1YUtfY29kZUFCQyhmcywgT1BfU0VUTElTVCwgYmFzZSwg YiwgMCk7DQotICAgIGx1YUtfY29kZShmcywgY2FzdChJbnN0cnVjdGlvbiwgYyksIGZzLT5scy0+ bGFzdGxpbmUpOw0KLSAgfQ0KKyAgbHVhS19jb2RlQUJDKGZzLCBPUF9TRVRMSVNULCBiYXNlLCBi LCAwKTsNCiAgIGZzLT5mcmVlcmVnID0gYmFzZSArIDE7ICAvKiBmcmVlIHJlZ2lzdGVycyB3aXRo IGxpc3QgdmFsdWVzICovDQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sY29k ZS5oIHNyYy9sY29kZS5oDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9sY29kZS5oCVRodSBEZWMg MjcgMTM6MDI6MjYgMjAwNw0KKysrIHNyYy9sY29kZS5oCVRodSBBdWcgMTMgMDE6Mzg6MjggMjAw OQ0KQEAgLTcwLDcgKzcwLDcgQEANCiBMVUFJX0ZVTkMgdm9pZCBsdWFLX3ByZWZpeCAoRnVuY1N0 YXRlICpmcywgVW5PcHIgb3AsIGV4cGRlc2MgKnYpOw0KIExVQUlfRlVOQyB2b2lkIGx1YUtfaW5m aXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdik7DQogTFVBSV9GVU5DIHZv aWQgbHVhS19wb3NmaXggKEZ1bmNTdGF0ZSAqZnMsIEJpbk9wciBvcCwgZXhwZGVzYyAqdjEsIGV4 cGRlc2MgKnYyKTsNCi1MVUFJX0ZVTkMgdm9pZCBsdWFLX3NldGxpc3QgKEZ1bmNTdGF0ZSAqZnMs IGludCBiYXNlLCBpbnQgbmVsZW1zLCBpbnQgdG9zdG9yZSk7DQorTFVBSV9GVU5DIHZvaWQgbHVh S19zZXRsaXN0IChGdW5jU3RhdGUgKmZzLCBpbnQgYmFzZSwgaW50IHRvc3RvcmUpOw0KIA0KIA0K ICNlbmRpZg0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3NyYy9sZGVidWcuYyBzcmMvbGRlYnVn LmMNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xkZWJ1Zy5jCVRodSBNYXkgIDggMTc6NTY6MjYg MjAwOA0KKysrIHNyYy9sZGVidWcuYwlUaHUgQXVnIDEzIDEzOjEzOjQzIDIwMDkNCkBAIC0yOTIs NyArMjkyLDkgQEANCiAgICAgY2FzZSBPUF9DQUxMOg0KICAgICBjYXNlIE9QX1RBSUxDQUxMOg0K ICAgICBjYXNlIE9QX1JFVFVSTjoNCi0gICAgY2FzZSBPUF9TRVRMSVNUOiB7DQorICAgIGNhc2Ug T1BfU0VUTElTVDoNCisgICAgY2FzZSBPUF9UVVBMRToNCisgICAgY2FzZSBPUF9ERVRVUExFOiB7 DQogICAgICAgY2hlY2soR0VUQVJHX0IoaSkgPT0gMCk7DQogICAgICAgcmV0dXJuIDE7DQogICAg IH0NCkBAIC0zNDUsMjAgKzM0Nyw2IEBADQogICAgICAgICBpZiAoZ2V0Qk1vZGUob3ApID09IE9w QXJnUikgew0KICAgICAgICAgICBpbnQgZGVzdCA9IHBjKzErYjsNCiAgICAgICAgICAgY2hlY2so MCA8PSBkZXN0ICYmIGRlc3QgPCBwdC0+c2l6ZWNvZGUpOw0KLSAgICAgICAgICBpZiAoZGVzdCA+ IDApIHsNCi0gICAgICAgICAgICBpbnQgajsNCi0gICAgICAgICAgICAvKiBjaGVjayB0aGF0IGl0 IGRvZXMgbm90IGp1bXAgdG8gYSBzZXRsaXN0IGNvdW50OyB0aGlzDQotICAgICAgICAgICAgICAg aXMgdHJpY2t5LCBiZWNhdXNlIHRoZSBjb3VudCBmcm9tIGEgcHJldmlvdXMgc2V0bGlzdCBtYXkN Ci0gICAgICAgICAgICAgICBoYXZlIHRoZSBzYW1lIHZhbHVlIG9mIGFuIGludmFsaWQgc2V0bGlz dDsgc28sIHdlIG11c3QNCi0gICAgICAgICAgICAgICBnbyBhbGwgdGhlIHdheSBiYWNrIHRvIHRo ZSBmaXJzdCBvZiB0aGVtIChpZiBhbnkpICovDQotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8 IGRlc3Q7IGorKykgew0KLSAgICAgICAgICAgICAgSW5zdHJ1Y3Rpb24gZCA9IHB0LT5jb2RlW2Rl c3QtMS1qXTsNCi0gICAgICAgICAgICAgIGlmICghKEdFVF9PUENPREUoZCkgPT0gT1BfU0VUTElT VCAmJiBHRVRBUkdfQyhkKSA9PSAwKSkgYnJlYWs7DQotICAgICAgICAgICAgfQ0KLSAgICAgICAg ICAgIC8qIGlmICdqJyBpcyBldmVuLCBwcmV2aW91cyB2YWx1ZSBpcyBub3QgYSBzZXRsaXN0IChl dmVuIGlmDQotICAgICAgICAgICAgICAgaXQgbG9va3MgbGlrZSBvbmUpICovDQotICAgICAgICAg ICAgY2hlY2soKGomMSkgPT0gMCk7DQotICAgICAgICAgIH0NCiAgICAgICAgIH0NCiAgICAgICAg IGJyZWFrOw0KICAgICAgIH0NCkBAIC0zNzQsOCArMzYyLDYgQEANCiAgICAgICBjYXNlIE9QX0xP QURCT09MOiB7DQogICAgICAgICBpZiAoYyA9PSAxKSB7ICAvKiBkb2VzIGl0IGp1bXA/ICovDQog ICAgICAgICAgIGNoZWNrKHBjKzIgPCBwdC0+c2l6ZWNvZGUpOyAgLyogY2hlY2sgaXRzIGp1bXAg Ki8NCi0gICAgICAgICAgY2hlY2soR0VUX09QQ09ERShwdC0+Y29kZVtwYysxXSkgIT0gT1BfU0VU TElTVCB8fA0KLSAgICAgICAgICAgICAgICBHRVRBUkdfQyhwdC0+Y29kZVtwYysxXSkgIT0gMCk7 DQogICAgICAgICB9DQogICAgICAgICBicmVhazsNCiAgICAgICB9DQpAQCAtNDQxLDEwICs0Mjcs NiBAQA0KICAgICAgIH0NCiAgICAgICBjYXNlIE9QX1NFVExJU1Q6IHsNCiAgICAgICAgIGlmIChi ID4gMCkgY2hlY2tyZWcocHQsIGEgKyBiKTsNCi0gICAgICAgIGlmIChjID09IDApIHsNCi0gICAg ICAgICAgcGMrKzsNCi0gICAgICAgICAgY2hlY2socGMgPCBwdC0+c2l6ZWNvZGUgLSAxKTsNCi0g ICAgICAgIH0NCiAgICAgICAgIGJyZWFrOw0KICAgICAgIH0NCiAgICAgICBjYXNlIE9QX0NMT1NV UkU6IHsNCkBAIC00NjYsNiArNDQ4LDE4IEBADQogICAgICAgICBiLS07DQogICAgICAgICBpZiAo YiA9PSBMVUFfTVVMVFJFVCkgY2hlY2soY2hlY2tvcGVub3AocHQsIHBjKSk7DQogICAgICAgICBj aGVja3JlZyhwdCwgYStiLTEpOw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNh c2UgT1BfVFVQTEU6IHsNCisgICAgICAgIC8qIFRPRE86IEFyZSBhbnkgY2hlY2tzIHJlcXVpcmVk PyAqLw0KKyAgICAgICAgYnJlYWs7DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfREVUVVBMRTog ew0KKyAgICAgICAgLyogVE9ETzogQXJlIGFueSBvdGhlciBjaGVja3MgcmVxdWlyZWQ/ICovDQor ICAgICAgICBjLS07ICAvKiBjID0gbnVtLiByZXR1cm5zICovDQorICAgICAgICBpZiAoYyA9PSBM VUFfTVVMVFJFVCkgew0KKyAgICAgICAgICBjaGVjayhjaGVja29wZW5vcChwdCwgcGMpKTsNCisg ICAgICAgIH0NCiAgICAgICAgIGJyZWFrOw0KICAgICAgIH0NCiAgICAgICBkZWZhdWx0OiBicmVh azsNCmRpZmYgLXVQIC4uLy4uL2x1YS01LjEuNC9zcmMvbGRvLmMgc3JjL2xkby5jDQotLS0gLi4v Li4vbHVhLTUuMS40L3NyYy9sZG8uYwlGcmkgSmFuIDE4IDIyOjMxOjIyIDIwMDgNCisrKyBzcmMv bGRvLmMJV2VkIEF1ZyAxMiAxNzo0NDoyOCAyMDA5DQpAQCAtMjkxLDYgKzI5MSw3IEBADQogICAg IGNpLT50b3AgPSBMLT5iYXNlICsgcC0+bWF4c3RhY2tzaXplOw0KICAgICBsdWFfYXNzZXJ0KGNp LT50b3AgPD0gTC0+c3RhY2tfbGFzdCk7DQogICAgIEwtPnNhdmVkcGMgPSBwLT5jb2RlOyAgLyog c3RhcnRpbmcgcG9pbnQgKi8NCisgICAgY2ktPnNhdmVkdHVwID0gY2FzdF9pbnQoTC0+dHVwbGVz dG9wIC0gTC0+dHVwbGVzKTsNCiAgICAgY2ktPnRhaWxjYWxscyA9IDA7DQogICAgIGNpLT5ucmVz dWx0cyA9IG5yZXN1bHRzOw0KICAgICBmb3IgKHN0ID0gTC0+dG9wOyBzdCA8IGNpLT50b3A7IHN0 KyspDQpAQCAtMzEyLDYgKzMxMyw3IEBADQogICAgIEwtPmJhc2UgPSBjaS0+YmFzZSA9IGNpLT5m dW5jICsgMTsNCiAgICAgY2ktPnRvcCA9IEwtPnRvcCArIExVQV9NSU5TVEFDSzsNCiAgICAgbHVh X2Fzc2VydChjaS0+dG9wIDw9IEwtPnN0YWNrX2xhc3QpOw0KKyAgICBjaS0+c2F2ZWR0dXAgPSBj YXN0X2ludChMLT50dXBsZXN0b3AgLSBMLT50dXBsZXMpOw0KICAgICBjaS0+bnJlc3VsdHMgPSBu cmVzdWx0czsNCiAgICAgaWYgKEwtPmhvb2ttYXNrICYgTFVBX01BU0tDQUxMKQ0KICAgICAgIGx1 YURfY2FsbGhvb2soTCwgTFVBX0hPT0tDQUxMLCAtMSk7DQpAQCAtNDY3LDYgKzQ2OSw3IEBADQog ICAgIGx1YURfc2V0ZXJyb3JvYmooTCwgc3RhdHVzLCBvbGR0b3ApOw0KICAgICBMLT5uQ2NhbGxz ID0gb2xkbkNjYWxsczsNCiAgICAgTC0+Y2kgPSByZXN0b3JlY2koTCwgb2xkX2NpKTsNCisgICAg TC0+dHVwbGVzdG9wID0gTC0+dHVwbGVzICsgTC0+Y2ktPnNhdmVkdHVwOw0KICAgICBMLT5iYXNl ID0gTC0+Y2ktPmJhc2U7DQogICAgIEwtPnNhdmVkcGMgPSBMLT5jaS0+c2F2ZWRwYzsNCiAgICAg TC0+YWxsb3dob29rID0gb2xkX2FsbG93aG9va3M7DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQv c3JjL2xnYy5jIHNyYy9sZ2MuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbGdjLmMJVGh1IERl YyAyNyAxMzowMjoyNiAyMDA3DQorKysgc3JjL2xnYy5jCVRodSBBdWcgMTMgMDA6NTc6MTAgMjAw OQ0KQEAgLTI2Niw2ICsyNjYsOCBAQA0KICAgICBtYXJrdmFsdWUoZywgbyk7DQogICBmb3IgKDsg byA8PSBsaW07IG8rKykNCiAgICAgc2V0bmlsdmFsdWUobyk7DQorICBmb3IgKG8gPSBsLT50dXBs ZXM7IG8gPCBsLT50dXBsZXN0b3A7IG8rKykNCisgICAgbWFya3ZhbHVlKGcsIG8pOw0KICAgY2hl Y2tzdGFja3NpemVzKGwsIGxpbSk7DQogfQ0KIA0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40L3Ny Yy9sb2JqZWN0Lmggc3JjL2xvYmplY3QuaA0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbG9iamVj dC5oCVdlZCBBdWcgIDYgMTQ6Mjk6NDggMjAwOA0KKysrIHNyYy9sb2JqZWN0LmgJVGh1IEF1ZyAx MyAxNjozMDo1NyAyMDA5DQpAQCAtMjgsNiArMjgsOCBAQA0KICNkZWZpbmUgTFVBX1RQUk9UTwko TEFTVF9UQUcrMSkNCiAjZGVmaW5lIExVQV9UVVBWQUwJKExBU1RfVEFHKzIpDQogI2RlZmluZSBM VUFfVERFQURLRVkJKExBU1RfVEFHKzMpDQorI2RlZmluZSBMVUFfVFRVUExFICAoTFVBX1ROT05F LTEpIC8qIHR0ID49IExVQV9UU1RSSU5HIGFyZSBjb2xsZWN0YWJsZQ0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBMVUFfVE5PTkUgdXNlZCBmb3IgZW1wdHkgdHVwbGUgKi8N CiANCiANCiAvKg0KQEAgLTUxLDggKzUzLDYgQEANCiB9IEdDaGVhZGVyOw0KIA0KIA0KLQ0KLQ0K IC8qDQogKiogVW5pb24gb2YgYWxsIEx1YSB2YWx1ZXMNCiAqLw0KQEAgLTEyNSw2ICsxMjUsOSBA QA0KICNkZWZpbmUgc2V0YnZhbHVlKG9iaix4KSBcDQogICB7IFRWYWx1ZSAqaV9vPShvYmopOyBp X28tPnZhbHVlLmI9KHgpOyBpX28tPnR0PUxVQV9UQk9PTEVBTjsgfQ0KIA0KKyNkZWZpbmUgc2V0 dHV2YWx1ZShvYmoseCkgXA0KKyAgeyBUVmFsdWUgKmlfbz0ob2JqKTsgaV9vLT52YWx1ZS5iPSh4 KTsgaV9vLT50dD1MVUFfVFRVUExFOyB9DQorDQogI2RlZmluZSBzZXRzdmFsdWUoTCxvYmoseCkg XA0KICAgeyBUVmFsdWUgKmlfbz0ob2JqKTsgXA0KICAgICBpX28tPnZhbHVlLmdjPWNhc3QoR0NP YmplY3QgKiwgKHgpKTsgaV9vLT50dD1MVUFfVFNUUklORzsgXA0KQEAgLTE4OCw2ICsxOTEsOSBA QA0KIA0KICNkZWZpbmUgaXNjb2xsZWN0YWJsZShvKQkodHR5cGUobykgPj0gTFVBX1RTVFJJTkcp DQogDQorI2RlZmluZSBnZXR0dXZhbHVlKG9iaikgKChvYmopLT52YWx1ZS5iKQ0KKw0KKyNkZWZp bmUgZ2V0dHVzaXplKEwsIG9iaikgKGdldHR1dmFsdWUoKEwpLT50dXBsZXMgKyBnZXR0dXZhbHVl KG9iaikpKQ0KIA0KIA0KIHR5cGVkZWYgVFZhbHVlICpTdGtJZDsgIC8qIGluZGV4IHRvIHN0YWNr IGVsZW1lbnRzICovDQpAQCAtMzQ1LDggKzM1MSw4IEBADQogICBOb2RlICpsYXN0ZnJlZTsgIC8q IGFueSBmcmVlIHBvc2l0aW9uIGlzIGJlZm9yZSB0aGlzIHBvc2l0aW9uICovDQogICBHQ09iamVj dCAqZ2NsaXN0Ow0KICAgaW50IHNpemVhcnJheTsgIC8qIHNpemUgb2YgYGFycmF5JyBhcnJheSAq Lw0KKyAgaW50IG5leHRzZXRsaXN0OyAgLyogaW5kZXggZm9yIG5leHQgT1BfU0VUTElTVCB0byBp bnNlcnQgYXQgKi8NCiB9IFRhYmxlOw0KLQ0KIA0KIA0KIC8qDQpkaWZmIC11UCAuLi8uLi9sdWEt NS4xLjQvc3JjL2xvcGNvZGVzLmMgc3JjL2xvcGNvZGVzLmMNCi0tLSAuLi8uLi9sdWEtNS4xLjQv c3JjL2xvcGNvZGVzLmMJVGh1IERlYyAyNyAxMzowMjoyNiAyMDA3DQorKysgc3JjL2xvcGNvZGVz LmMJVGh1IEF1ZyAxMyAwMToyNzoxMSAyMDA5DQpAQCAtNTIsNiArNTIsOCBAQA0KICAgIkNMT1NF IiwNCiAgICJDTE9TVVJFIiwNCiAgICJWQVJBUkciLA0KKyAgIlRVUExFIiwNCisgICJERVRVUExF IiwNCiAgIE5VTEwNCiB9Ow0KIA0KQEAgLTk0LDkgKzk2LDExIEBADQogICxvcG1vZGUoMCwgMSwg T3BBcmdSLCBPcEFyZ04sIGlBc0J4KQkJLyogT1BfRk9STE9PUCAqLw0KICAsb3Btb2RlKDAsIDEs IE9wQXJnUiwgT3BBcmdOLCBpQXNCeCkJCS8qIE9QX0ZPUlBSRVAgKi8NCiAgLG9wbW9kZSgxLCAw LCBPcEFyZ04sIE9wQXJnVSwgaUFCQykJCS8qIE9QX1RGT1JMT09QICovDQotICxvcG1vZGUoMCwg MCwgT3BBcmdVLCBPcEFyZ1UsIGlBQkMpCQkvKiBPUF9TRVRMSVNUICovDQorICxvcG1vZGUoMCwg MCwgT3BBcmdVLCBPcEFyZ04sIGlBQkMpCQkvKiBPUF9TRVRMSVNUICovDQogICxvcG1vZGUoMCwg MCwgT3BBcmdOLCBPcEFyZ04sIGlBQkMpCQkvKiBPUF9DTE9TRSAqLw0KICAsb3Btb2RlKDAsIDEs IE9wQXJnVSwgT3BBcmdOLCBpQUJ4KQkJLyogT1BfQ0xPU1VSRSAqLw0KICAsb3Btb2RlKDAsIDEs IE9wQXJnVSwgT3BBcmdOLCBpQUJDKQkJLyogT1BfVkFSQVJHICovDQorICxvcG1vZGUoMCwgMSwg T3BBcmdVLCBPcEFyZ04sIGlBQkMpICAgICAgICAvKiBPUF9UVVBMRSAqLw0KKyAsb3Btb2RlKDAs IDEsIE9wQXJnVSwgT3BBcmdVLCBpQUJDKSAgICAgICAgLyogT1BfREVUVVBMRSAqLw0KIH07DQog DQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xvcGNvZGVzLmggc3JjL2xvcGNvZGVzLmgN Ci0tLSAuLi8uLi9sdWEtNS4xLjQvc3JjL2xvcGNvZGVzLmgJVGh1IERlYyAyNyAxMzowMjoyNiAy MDA3DQorKysgc3JjL2xvcGNvZGVzLmgJV2VkIEF1ZyAxMiAxOToyODowMiAyMDA5DQpAQCAtMjA0 LDExICsyMDQsMTQgQEANCiBPUF9DTE9TRSwvKglBIAljbG9zZSBhbGwgdmFyaWFibGVzIGluIHRo ZSBzdGFjayB1cCB0byAoPj0pIFIoQSkqLw0KIE9QX0NMT1NVUkUsLyoJQSBCeAlSKEEpIDo9IGNs b3N1cmUoS1BST1RPW0J4XSwgUihBKSwgLi4uICxSKEErbikpCSovDQogDQotT1BfVkFSQVJHLyoJ QSBCCVIoQSksIFIoQSsxKSwgLi4uLCBSKEErQi0xKSA9IHZhcmFyZwkJKi8NCitPUF9WQVJBUkcs LyoJQSBCCVIoQSksIFIoQSsxKSwgLi4uLCBSKEErQi0xKSA9IHZhcmFyZwkJKi8NCisNCitPUF9U VVBMRSwvKiAgQSBCICAgIFIoQSkgOj0gdHVwbGUoUihBKSwgLi4uLCBSKEErQi0xKSkqLw0KK09Q X0RFVFVQTEUsLyogQSBCIEMgUihBKSwgLi4uICxSKEErQy0yKSA6PSBkZXR1cGxlKFIoQSkpLi4u LCBkZXR1cGxlKFIoQSsxKS4uLiwgLi4uLCBkZXR1cGxlKFIoQStCLTEpKSAqLw0KIH0gT3BDb2Rl Ow0KIA0KIA0KLSNkZWZpbmUgTlVNX09QQ09ERVMJKGNhc3QoaW50LCBPUF9WQVJBUkcpICsgMSkN CisjZGVmaW5lIE5VTV9PUENPREVTCShjYXN0KGludCwgT1BfREVUVVBMRSkgKyAxKQ0KIA0KIA0K IA0KQEAgLTIxNyw2ICsyMjAsMTIgQEANCiAgICgqKSBJbiBPUF9DQUxMLCBpZiAoQiA9PSAwKSB0 aGVuIEIgPSB0b3AuIEMgaXMgdGhlIG51bWJlciBvZiByZXR1cm5zIC0gMSwNCiAgICAgICBhbmQg Y2FuIGJlIDA6IE9QX0NBTEwgdGhlbiBzZXRzIGB0b3AnIHRvIGxhc3RfcmVzdWx0KzEsIHNvDQog ICAgICAgbmV4dCBvcGVuIGluc3RydWN0aW9uIChPUF9DQUxMLCBPUF9SRVRVUk4sIE9QX1NFVExJ U1QpIG1heSB1c2UgYHRvcCcuDQorDQorICAoKikgSW4gT1BfVFVQTEUsIGlmIChCID09IDApIHRo ZW4gQiA9IHRvcC4gSWYgKEIgPT0gMSkgdGhlbiBub3AuDQorDQorICAoKikgSW4gT1BfREVUVVBM RSwgaWYgKEIgPT0gMCkgdGhlbiBCID0gdG9wLiBDIGlzIHRoZSBudW1iZXIgb2YgcmV0dXJucyAt IDEsDQorICAgICAgYW5kIGNhbiBiZSAwOiBPUF9ERVRVUExFIHRoZW4gc2V0cyBgdG9wJyB0byBs YXN0X3Jlc3VsdCsxLCBzbw0KKyAgICAgIG5leHQgb3BlbiBpbnN0cnVjdGlvbiBtYXkgdXNlIGB0 b3AnLg0KIA0KICAgKCopIEluIE9QX1ZBUkFSRywgaWYgKEIgPT0gMCkgdGhlbiB1c2UgYWN0dWFs IG51bWJlciBvZiB2YXJhcmdzIGFuZA0KICAgICAgIHNldCB0b3AgKGxpa2UgaW4gT1BfQ0FMTCB3 aXRoIEMgPT0gMCkuDQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xwYXJzZXIuYyBzcmMv bHBhcnNlci5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9scGFyc2VyLmMJRnJpIERlYyAyOCAx NTozMjoyNCAyMDA3DQorKysgc3JjL2xwYXJzZXIuYwlUaHUgQXVnIDEzIDEzOjA5OjA0IDIwMDkN CkBAIC0yNyw3ICsyNyw3IEBADQogDQogDQogDQotI2RlZmluZSBoYXNtdWx0cmV0KGspCQkoKGsp ID09IFZDQUxMIHx8IChrKSA9PSBWVkFSQVJHKQ0KKyNkZWZpbmUgaGFzbXVsdHJldChrKQkJKChr KSA9PSBWQ0FMTCB8fCAoaykgPT0gVlZBUkFSRyB8fCAoaykgPT0gVkRFVFVQTEUpDQogDQogI2Rl ZmluZSBnZXRsb2N2YXIoZnMsIGkpCSgoZnMpLT5mLT5sb2N2YXJzWyhmcyktPmFjdHZhcltpXV0p DQogDQpAQCAtMTI3LDYgKzEyNyw3IEBADQogICBlLT5mID0gZS0+dCA9IE5PX0pVTVA7DQogICBl LT5rID0gazsNCiAgIGUtPnUucy5pbmZvID0gaTsNCisgIGUtPnR1cCA9IDA7DQogfQ0KIA0KIA0K QEAgLTQzNSw3ICs0MzYsNyBAQA0KICAgZXhwZGVzYyB2OyAgLyogbGFzdCBsaXN0IGl0ZW0gcmVh ZCAqLw0KICAgZXhwZGVzYyAqdDsgIC8qIHRhYmxlIGRlc2NyaXB0b3IgKi8NCiAgIGludCBuaDsg IC8qIHRvdGFsIG51bWJlciBvZiBgcmVjb3JkJyBlbGVtZW50cyAqLw0KLSAgaW50IG5hOyAgLyog dG90YWwgbnVtYmVyIG9mIGFycmF5IGVsZW1lbnRzICovDQorICBpbnQgbmE7ICAvKiBndWVzcyBh cyB0byB0b3RhbCBudW1iZXIgb2YgYGFycmF5JyBlbGVtZW50cyAqLw0KICAgaW50IHRvc3RvcmU7 ICAvKiBudW1iZXIgb2YgYXJyYXkgZWxlbWVudHMgcGVuZGluZyB0byBiZSBzdG9yZWQgKi8NCiB9 Ow0KIA0KQEAgLTQ2MywxMCArNDY0LDE3IEBADQogDQogc3RhdGljIHZvaWQgY2xvc2VsaXN0Zmll bGQgKEZ1bmNTdGF0ZSAqZnMsIHN0cnVjdCBDb25zQ29udHJvbCAqY2MpIHsNCiAgIGlmIChjYy0+ di5rID09IFZWT0lEKSByZXR1cm47ICAvKiB0aGVyZSBpcyBubyBsaXN0IGl0ZW0gKi8NCisgIGlm IChoYXNtdWx0cmV0KGNjLT52LmspICYmIGNjLT52LnR1cCkgew0KKyAgICBsdWFLX3NldG11bHRy ZXQoZnMsICZjYy0+dik7DQorICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBM VUFfTVVMVFJFVCk7DQorICAgIGNjLT50b3N0b3JlID0gMDsgIC8qIG5vIG1vcmUgaXRlbXMgcGVu ZGluZyAqLw0KKyAgICBjYy0+bmEtLTsNCisgICAgcmV0dXJuOw0KKyAgfQ0KICAgbHVhS19leHAy bmV4dHJlZyhmcywgJmNjLT52KTsNCiAgIGNjLT52LmsgPSBWVk9JRDsNCiAgIGlmIChjYy0+dG9z dG9yZSA9PSBMRklFTERTX1BFUl9GTFVTSCkgew0KLSAgICBsdWFLX3NldGxpc3QoZnMsIGNjLT50 LT51LnMuaW5mbywgY2MtPm5hLCBjYy0+dG9zdG9yZSk7ICAvKiBmbHVzaCAqLw0KKyAgICBsdWFL X3NldGxpc3QoZnMsIGNjLT50LT51LnMuaW5mbywgY2MtPnRvc3RvcmUpOyAgLyogZmx1c2ggKi8N CiAgICAgY2MtPnRvc3RvcmUgPSAwOyAgLyogbm8gbW9yZSBpdGVtcyBwZW5kaW5nICovDQogICB9 DQogfQ0KQEAgLTQ3NiwyMiArNDg0LDIzIEBADQogICBpZiAoY2MtPnRvc3RvcmUgPT0gMCkgcmV0 dXJuOw0KICAgaWYgKGhhc211bHRyZXQoY2MtPnYuaykpIHsNCiAgICAgbHVhS19zZXRtdWx0cmV0 KGZzLCAmY2MtPnYpOw0KLSAgICBsdWFLX3NldGxpc3QoZnMsIGNjLT50LT51LnMuaW5mbywgY2Mt Pm5hLCBMVUFfTVVMVFJFVCk7DQotICAgIGNjLT5uYS0tOyAgLyogZG8gbm90IGNvdW50IGxhc3Qg ZXhwcmVzc2lvbiAodW5rbm93biBudW1iZXIgb2YgZWxlbWVudHMpICovDQorICAgIGx1YUtfc2V0 bGlzdChmcywgY2MtPnQtPnUucy5pbmZvLCBMVUFfTVVMVFJFVCk7DQorICAgIGNjLT5uYS0tOw0K ICAgfQ0KICAgZWxzZSB7DQogICAgIGlmIChjYy0+di5rICE9IFZWT0lEKQ0KICAgICAgIGx1YUtf ZXhwMm5leHRyZWcoZnMsICZjYy0+dik7DQotICAgIGx1YUtfc2V0bGlzdChmcywgY2MtPnQtPnUu cy5pbmZvLCBjYy0+bmEsIGNjLT50b3N0b3JlKTsNCisgICAgbHVhS19zZXRsaXN0KGZzLCBjYy0+ dC0+dS5zLmluZm8sIGNjLT50b3N0b3JlKTsNCiAgIH0NCiB9DQogDQogDQogc3RhdGljIHZvaWQg bGlzdGZpZWxkIChMZXhTdGF0ZSAqbHMsIHN0cnVjdCBDb25zQ29udHJvbCAqY2MpIHsNCiAgIGV4 cHIobHMsICZjYy0+dik7DQotICBsdWFZX2NoZWNrbGltaXQobHMtPmZzLCBjYy0+bmEsIE1BWF9J TlQsICJpdGVtcyBpbiBhIGNvbnN0cnVjdG9yIik7DQogICBjYy0+bmErKzsNCiAgIGNjLT50b3N0 b3JlKys7DQorICBpZiAodGVzdG5leHQobHMsIFRLX0RPVFMpKQ0KKyAgICBjYy0+di50dXAgPSAx Ow0KIH0NCiANCiANCkBAIC01OTYsMTEgKzYwNSw0OSBAQA0KIHN0YXRpYyBpbnQgZXhwbGlzdDEg KExleFN0YXRlICpscywgZXhwZGVzYyAqdikgew0KICAgLyogZXhwbGlzdDEgLT4gZXhwciB7IGAs JyBleHByIH0gKi8NCiAgIGludCBuID0gMTsgIC8qIGF0IGxlYXN0IG9uZSBleHByZXNzaW9uICov DQorICBpbnQgdHVwbGVzID0gMDsNCisgIGludCBkZXR1cGxlX2Zyb20gPSAtMTsNCiAgIGV4cHIo bHMsIHYpOw0KKyAgaWYgKHRlc3RuZXh0KGxzLCBUS19ET1RTKSkNCisgICAgdi0+dHVwID0gdHVw bGVzID0gMTsNCiAgIHdoaWxlICh0ZXN0bmV4dChscywgJywnKSkgew0KLSAgICBsdWFLX2V4cDJu ZXh0cmVnKGxzLT5mcywgdik7DQorICAgIGlmKHYtPnR1cCkgew0KKyAgICAgIGlmICghaGFzbXVs dHJldCh2LT5rKSkNCisgICAgICAgIGx1YVhfc3ludGF4ZXJyb3IobHMsICJDYW5ub3QgZXhwYW5k IGZpeGVkLWxlbmd0aCBleHByZXNzaW9uIik7DQorICAgICAgbHVhS19zZXRtdWx0cmV0KGxzLT5m cywgdik7DQorICAgICAgbHVhS19jb2RlQUJDKGxzLT5mcywgT1BfVFVQTEUsIGxzLT5mcy0+ZnJl ZXJlZyAtIDEsIDAsIDApOw0KKyAgICAgIGlmIChkZXR1cGxlX2Zyb20gPT0gLTEpDQorICAgICAg ICBkZXR1cGxlX2Zyb20gPSBscy0+ZnMtPmZyZWVyZWcgLSAxOw0KKyAgICB9DQorICAgIGVsc2Ug ew0KKyAgICAgIGx1YUtfZXhwMm5leHRyZWcobHMtPmZzLCB2KTsNCisgICAgfQ0KICAgICBleHBy KGxzLCB2KTsNCisgICAgaWYgKHR1cGxlcyAhPSAwKQ0KKyAgICAgdHVwbGVzKys7DQorICAgIGlm ICh0ZXN0bmV4dChscywgVEtfRE9UUykpIHsNCisgICAgICBpZiAodHVwbGVzID09IDApDQorICAg ICAgICB0dXBsZXMgPSAxOw0KKyAgICAgIHYtPnR1cCA9IDE7DQorICAgIH0NCiAgICAgbisrOw0K KyAgfQ0KKyAgaWYgKHR1cGxlcyAhPSAwKSB7DQorICAgIGludCB1cHRvOw0KKyAgICBpZiAodi0+ dHVwID09IDEpIHsNCisgICAgICBsdWFYX3N5bnRheGVycm9yKGxzLCAiQ2Fubm90IGV4cGFuZCBs YXN0IGV4cHJlc3Npb24gaW4gYSBsaXN0LCBhcyBpdCBpcyBhbHJlYWR5IGV4cGFuZGVkIik7DQor ICAgIH0NCisgICAgaWYgKGhhc211bHRyZXQodi0+aykpIHsNCisgICAgICBsdWFLX3NldG11bHRy ZXQobHMtPmZzLCB2KTsNCisgICAgICB1cHRvID0gMDsgLyogdG9wICovDQorICAgIH0NCisgICAg ZWxzZSB7DQorICAgICAgbHVhS19leHAybmV4dHJlZyhscy0+ZnMsIHYpOw0KKyAgICAgIHVwdG8g PSBscy0+ZnMtPmZyZWVyZWcgLSBkZXR1cGxlX2Zyb207DQorICAgIH0NCisgICAgaW5pdF9leHAo diwgVkRFVFVQTEUsIGx1YUtfY29kZUFCQyhscy0+ZnMsIE9QX0RFVFVQTEUsIGRldHVwbGVfZnJv bSwgdXB0bywgMCkpOw0KKyAgICBscy0+ZnMtPmZyZWVyZWcgKz0gMSAtIHR1cGxlczsNCisgICAg cmV0dXJuIChuIC0gdHVwbGVzICsgMSk7DQogICB9DQogICByZXR1cm4gbjsNCiB9DQpkaWZmIC11 UCAuLi8uLi9sdWEtNS4xLjQvc3JjL2xwYXJzZXIuaCBzcmMvbHBhcnNlci5oDQotLS0gLi4vLi4v bHVhLTUuMS40L3NyYy9scGFyc2VyLmgJVGh1IERlYyAyNyAxMzowMjoyNiAyMDA3DQorKysgc3Jj L2xwYXJzZXIuaAlXZWQgQXVnIDEyIDE5OjI1OjQ5IDIwMDkNCkBAIC0zMSw3ICszMSw4IEBADQog ICBWUkVMT0NBQkxFLAkvKiBpbmZvID0gaW5zdHJ1Y3Rpb24gcGMgKi8NCiAgIFZOT05SRUxPQywJ LyogaW5mbyA9IHJlc3VsdCByZWdpc3RlciAqLw0KICAgVkNBTEwsCS8qIGluZm8gPSBpbnN0cnVj dGlvbiBwYyAqLw0KLSAgVlZBUkFSRwkvKiBpbmZvID0gaW5zdHJ1Y3Rpb24gcGMgKi8NCisgIFZW QVJBUkcsCS8qIGluZm8gPSBpbnN0cnVjdGlvbiBwYyAqLw0KKyAgVkRFVFVQTEUgIC8qIGluZm8g PSBpbnN0cnVjdGlvbiBwYyAqLw0KIH0gZXhwa2luZDsNCiANCiB0eXBlZGVmIHN0cnVjdCBleHBk ZXNjIHsNCkBAIC00Miw2ICs0Myw3IEBADQogICB9IHU7DQogICBpbnQgdDsgIC8qIHBhdGNoIGxp c3Qgb2YgYGV4aXQgd2hlbiB0cnVlJyAqLw0KICAgaW50IGY7ICAvKiBwYXRjaCBsaXN0IG9mIGBl eGl0IHdoZW4gZmFsc2UnICovDQorICBpbnQgdHVwOyAvKiBpZiBub24temVybywgdHVybiBpbnRv IGEgdHVwbGUgKi8NCiB9IGV4cGRlc2M7DQogDQogDQpkaWZmIC11UCAuLi8uLi9sdWEtNS4xLjQv c3JjL2xzdGF0ZS5jIHNyYy9sc3RhdGUuYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbHN0YXRl LmMJVGh1IEphbiAgMyAxNToyMDo0MCAyMDA4DQorKysgc3JjL2xzdGF0ZS5jCVdlZCBBdWcgMTIg MTc6NDA6MzYgMjAwOQ0KQEAgLTUxLDE2ICs1MSwyMiBAQA0KICAgTDEtPnRvcCA9IEwxLT5zdGFj azsNCiAgIEwxLT5zdGFja19sYXN0ID0gTDEtPnN0YWNrKyhMMS0+c3RhY2tzaXplIC0gRVhUUkFf U1RBQ0spLTE7DQogICAvKiBpbml0aWFsaXplIGZpcnN0IGNpICovDQorICBMMS0+Y2ktPnNhdmVk dHVwID0gMDsNCiAgIEwxLT5jaS0+ZnVuYyA9IEwxLT50b3A7DQogICBzZXRuaWx2YWx1ZShMMS0+ dG9wKyspOyAgLyogYGZ1bmN0aW9uJyBlbnRyeSBmb3IgdGhpcyBgY2knICovDQogICBMMS0+YmFz ZSA9IEwxLT5jaS0+YmFzZSA9IEwxLT50b3A7DQogICBMMS0+Y2ktPnRvcCA9IEwxLT50b3AgKyBM VUFfTUlOU1RBQ0s7DQorICAvKiB0dXBsZXMgKi8NCisgIEwxLT50dXBsZXNzaXplID0gNDsNCisg IEwxLT50dXBsZXMgPSBsdWFNX25ld3ZlY3RvcihMLCBMMS0+dHVwbGVzc2l6ZSwgVFZhbHVlKTsN CisgIEwxLT50dXBsZXN0b3AgPSBMMS0+dHVwbGVzOw0KIH0NCiANCiANCiBzdGF0aWMgdm9pZCBm cmVlc3RhY2sgKGx1YV9TdGF0ZSAqTCwgbHVhX1N0YXRlICpMMSkgew0KICAgbHVhTV9mcmVlYXJy YXkoTCwgTDEtPmJhc2VfY2ksIEwxLT5zaXplX2NpLCBDYWxsSW5mbyk7DQogICBsdWFNX2ZyZWVh cnJheShMLCBMMS0+c3RhY2ssIEwxLT5zdGFja3NpemUsIFRWYWx1ZSk7DQorICBsdWFNX2ZyZWVh cnJheShMLCBMMS0+dHVwbGVzLCBMMS0+dHVwbGVzc2l6ZSwgVFZhbHVlKTsNCiB9DQogDQogDQpA QCAtODUsNiArOTEsOSBAQA0KICAgRyhMKSA9IGc7DQogICBMLT5zdGFjayA9IE5VTEw7DQogICBM LT5zdGFja3NpemUgPSAwOw0KKyAgTC0+dHVwbGVzID0gTlVMTDsNCisgIEwtPnR1cGxlc3RvcCA9 IE5VTEw7DQorICBMLT50dXBsZXNzaXplID0gMDsNCiAgIEwtPmVycm9ySm1wID0gTlVMTDsNCiAg IEwtPmhvb2sgPSBOVUxMOw0KICAgTC0+aG9va21hc2sgPSAwOw0KZGlmZiAtdVAgLi4vLi4vbHVh LTUuMS40L3NyYy9sc3RhdGUuaCBzcmMvbHN0YXRlLmgNCi0tLSAuLi8uLi9sdWEtNS4xLjQvc3Jj L2xzdGF0ZS5oCVRodSBKYW4gIDMgMTU6MjA6NDAgMjAwOA0KKysrIHNyYy9sc3RhdGUuaAlXZWQg QXVnIDEyIDE2OjI3OjU1IDIwMDkNCkBAIC01MCw2ICs1MCw3IEBADQogICBTdGtJZCBmdW5jOyAg LyogZnVuY3Rpb24gaW5kZXggaW4gdGhlIHN0YWNrICovDQogICBTdGtJZAl0b3A7ICAvKiB0b3Ag Zm9yIHRoaXMgZnVuY3Rpb24gKi8NCiAgIGNvbnN0IEluc3RydWN0aW9uICpzYXZlZHBjOw0KKyAg aW50IHNhdmVkdHVwOyAgLyogYW1vdW50IG9mIHR1cGxlIHNwYWNlIHVzZWQgdW5kZXIgdGhpcyBm dW5jdGlvbiAqLw0KICAgaW50IG5yZXN1bHRzOyAgLyogZXhwZWN0ZWQgbnVtYmVyIG9mIHJlc3Vs dHMgZnJvbSB0aGlzIGZ1bmN0aW9uICovDQogICBpbnQgdGFpbGNhbGxzOyAgLyogbnVtYmVyIG9m IHRhaWwgY2FsbHMgbG9zdCB1bmRlciB0aGlzIGVudHJ5ICovDQogfSBDYWxsSW5mbzsNCkBAIC0x MDcsNiArMTA4LDkgQEANCiAgIGNvbnN0IEluc3RydWN0aW9uICpzYXZlZHBjOyAgLyogYHNhdmVk cGMnIG9mIGN1cnJlbnQgZnVuY3Rpb24gKi8NCiAgIFN0a0lkIHN0YWNrX2xhc3Q7ICAvKiBsYXN0 IGZyZWUgc2xvdCBpbiB0aGUgc3RhY2sgKi8NCiAgIFN0a0lkIHN0YWNrOyAgLyogc3RhY2sgYmFz ZSAqLw0KKyAgU3RrSWQgdHVwbGVzOyAvKiB0dXBsZXMgYmFzZSAqLw0KKyAgU3RrSWQgdHVwbGVz dG9wOyAvKiBmcmVlIHBvc2l0aW9uIGZvciBuZXh0IHR1cGxlICovDQorICBpbnQgdHVwbGVzc2l6 ZTsgLyogc2l6ZSBvZiB0dXBsZXMgYXJyYXkgKi8NCiAgIENhbGxJbmZvICplbmRfY2k7ICAvKiBw b2ludHMgYWZ0ZXIgZW5kIG9mIGNpIGFycmF5Ki8NCiAgIENhbGxJbmZvICpiYXNlX2NpOyAgLyog YXJyYXkgb2YgQ2FsbEluZm8ncyAqLw0KICAgaW50IHN0YWNrc2l6ZTsNCmRpZmYgLXVQIC4uLy4u L2x1YS01LjEuNC9zcmMvbHRhYmxlLmMgc3JjL2x0YWJsZS5jDQotLS0gLi4vLi4vbHVhLTUuMS40 L3NyYy9sdGFibGUuYwlGcmkgRGVjIDI4IDE1OjMyOjI0IDIwMDcNCisrKyBzcmMvbHRhYmxlLmMJ VGh1IEF1ZyAxMyAwMToyNTo0MCAyMDA5DQpAQCAtMzYzLDYgKzM2Myw3IEBADQogICAvKiB0ZW1w b3JhcnkgdmFsdWVzIChrZXB0IG9ubHkgaWYgc29tZSBtYWxsb2MgZmFpbHMpICovDQogICB0LT5h cnJheSA9IE5VTEw7DQogICB0LT5zaXplYXJyYXkgPSAwOw0KKyAgdC0+bmV4dHNldGxpc3QgPSAw Ow0KICAgdC0+bHNpemVub2RlID0gMDsNCiAgIHQtPm5vZGUgPSBjYXN0KE5vZGUgKiwgZHVtbXlu b2RlKTsNCiAgIHNldGFycmF5dmVjdG9yKEwsIHQsIG5hcnJheSk7DQpkaWZmIC11UCAuLi8uLi9s dWEtNS4xLjQvc3JjL2x2bS5jIHNyYy9sdm0uYw0KLS0tIC4uLy4uL2x1YS01LjEuNC9zcmMvbHZt LmMJU3VuIEZlYiAgOCAxMzozMDo0OSAyMDA5DQorKysgc3JjL2x2bS5jCVRodSBBdWcgMTMgMTc6 MDY6MzcgMjAwOQ0KQEAgLTY5MiwxNyArNjkyLDE2IEBADQogICAgICAgfQ0KICAgICAgIGNhc2Ug T1BfU0VUTElTVDogew0KICAgICAgICAgaW50IG4gPSBHRVRBUkdfQihpKTsNCi0gICAgICAgIGlu dCBjID0gR0VUQVJHX0MoaSk7DQogICAgICAgICBpbnQgbGFzdDsNCiAgICAgICAgIFRhYmxlICpo Ow0KICAgICAgICAgaWYgKG4gPT0gMCkgew0KICAgICAgICAgICBuID0gY2FzdF9pbnQoTC0+dG9w IC0gcmEpIC0gMTsNCiAgICAgICAgICAgTC0+dG9wID0gTC0+Y2ktPnRvcDsNCiAgICAgICAgIH0N Ci0gICAgICAgIGlmIChjID09IDApIGMgPSBjYXN0X2ludCgqcGMrKyk7DQogICAgICAgICBydW50 aW1lX2NoZWNrKEwsIHR0aXN0YWJsZShyYSkpOw0KICAgICAgICAgaCA9IGh2YWx1ZShyYSk7DQot ICAgICAgICBsYXN0ID0gKChjLTEpKkxGSUVMRFNfUEVSX0ZMVVNIKSArIG47DQorICAgICAgICBs YXN0ID0gaC0+bmV4dHNldGxpc3QgKyBuOw0KKyAgICAgICAgaC0+bmV4dHNldGxpc3QgKz0gbjsN CiAgICAgICAgIGlmIChsYXN0ID4gaC0+c2l6ZWFycmF5KSAgLyogbmVlZHMgbW9yZSBzcGFjZT8g Ki8NCiAgICAgICAgICAgbHVhSF9yZXNpemVhcnJheShMLCBoLCBsYXN0KTsgIC8qIHByZS1hbGxv YyBpdCBhdCBvbmNlICovDQogICAgICAgICBmb3IgKDsgbiA+IDA7IG4tLSkgew0KQEAgLTc1Myw2 ICs3NTIsMTAwIEBADQogICAgICAgICAgIH0NCiAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAg ICAgc2V0bmlsdmFsdWUocmEgKyBqKTsNCisgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAg ICAgY29udGludWU7DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfVFVQTEU6IHsNCisgICAgICAg IGludCBiID0gR0VUQVJHX0IoaSkgLSAxOw0KKyAgICAgICAgaW50IHN0YXJ0Ow0KKyAgICAgICAg aW50IGo7DQorICAgICAgICBTdGtJZCB0dXA7DQorICAgICAgICBpZiAoYiA9PSBMVUFfTVVMVFJF VCkNCisgICAgICAgIHsNCisgICAgICAgICAgYiA9IGNhc3RfaW50KEwtPnRvcCAtIHJhKTsNCisg ICAgICAgICAgTC0+dG9wID0gTC0+Y2ktPnRvcDsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChi IDw9IDEpIHsNCisgICAgICAgICAgLyogU2l6ZSAwIHR1cGxlcyBhcmUgcmVwcmVzZW50ZWQgYnkg TFVBX1ROT05FIHJhdGhlciB0aGFuDQorICAgICAgICAgICAgIExVQV9UVFVQTEUuIFNpemUgMSB0 dXBsZXMgYXJlIHBvaW50bGVzcywgYW5kIHRodXMgbmV2ZXINCisgICAgICAgICAgICAgY3JlYXRl ZC4gKi8NCisgICAgICAgICAgaWYgKGIgPT0gMCkNCisgICAgICAgICAgICByYS0+dHQgPSBMVUFf VE5PTkU7DQorICAgICAgICAgIGNvbnRpbnVlOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKGNh c3RfaW50KEwtPnR1cGxlc3RvcCAtIEwtPnR1cGxlcykgKyBiICsgMSA+IEwtPnR1cGxlc3NpemUp IHsNCisgICAgICAgICAgaW50IHJlYWxzaXplID0gTC0+dHVwbGVzc2l6ZSAqIDIgKyBiICsgMTsN CisgICAgICAgICAgdHVwID0gTC0+dHVwbGVzOw0KKyAgICAgICAgICBsdWFNX3JlYWxsb2N2ZWN0 b3IoTCwgTC0+dHVwbGVzLCBMLT50dXBsZXNzaXplLCByZWFsc2l6ZSwgVFZhbHVlKTsNCisgICAg ICAgICAgTC0+dHVwbGVzc2l6ZSA9IHJlYWxzaXplOw0KKyAgICAgICAgICBMLT50dXBsZXN0b3Ag PSBjYXN0X2ludChMLT50dXBsZXN0b3AgLSB0dXApICsgTC0+dHVwbGVzOw0KKyAgICAgICAgfQ0K KyAgICAgICAgdHVwID0gTC0+dHVwbGVzdG9wOw0KKyAgICAgICAgTC0+dHVwbGVzdG9wICs9IGIg KyAxOw0KKyAgICAgICAgc3RhcnQgPSBjYXN0X2ludCh0dXAgLSBMLT50dXBsZXMpOw0KKyAgICAg ICAgc2V0dHV2YWx1ZSh0dXAsIGIgLSAxKTsNCisgICAgICAgIGZvciAoaiA9IDA7IGogPCBiOyBq KyspIHsNCisgICAgICAgICAgc2V0b2JqKEwsIHR1cCArIDEgKyBqLCByYSArIGopOw0KKyAgICAg ICAgfQ0KKyAgICAgICAgc2V0dHV2YWx1ZShyYSwgc3RhcnQpOw0KKyAgICAgICAgY29udGludWU7 DQorICAgICAgfQ0KKyAgICAgIGNhc2UgT1BfREVUVVBMRTogew0KKyAgICAgICAgaW50IG5yZXN1 bHRzID0gR0VUQVJHX0MoaSkgLSAxOw0KKyAgICAgICAgaW50IGV4dHJhLCBqLCBiLCBubm9uZTsN CisgICAgICAgIFN0a0lkIHJwLCBsYXN0Ow0KKyAgICAgICAgYiA9IEdFVEFSR19CKGkpIC0gMTsN CisgICAgICAgIGlmIChiID09IExVQV9NVUxUUkVUKQ0KKyAgICAgICAgICBiID0gY2FzdF9pbnQo TC0+dG9wIC0gcmEpIC0gMTsNCisgICAgICAgIGV4dHJhID0gMDsNCisgICAgICAgIG5ub25lID0g MDsNCisgICAgICAgIGZvciAocnAgPSByYTsgcnAgPD0gcmEgKyBiOyBycCsrKSB7DQorICAgICAg ICAgIGlmKHJwLT50dCA9PSBMVUFfVFRVUExFKQ0KKyAgICAgICAgICAgIGV4dHJhICs9IGdldHR1 c2l6ZShMLCBycCk7DQorICAgICAgICAgIGVsc2UgaWYocnAtPnR0ID09IExVQV9UTk9ORSkNCisg ICAgICAgICAgICBubm9uZSsrOw0KKyAgICAgICAgfQ0KKyAgICAgICAgUHJvdGVjdChsdWFEX2No ZWNrc3RhY2soTCwgZXh0cmEpKTsNCisgICAgICAgIHJhID0gUkEoaSk7ICAvKiBwcmV2aW91cyBj YWxsIG1heSBjaGFuZ2UgdGhlIHN0YWNrICovDQorICAgICAgICBycCA9IHJhICsgYjsNCisgICAg ICAgIGIgPSAwOw0KKyAgICAgICAgaWYgKG5yZXN1bHRzID09IExVQV9NVUxUUkVUKSB7DQorICAg ICAgICAgIGxhc3QgPSBycCArIGV4dHJhICsgMTsNCisgICAgICAgICAgTC0+dG9wID0gbGFzdCAt IG5ub25lOw0KKyAgICAgICAgfQ0KKyAgICAgICAgZWxzZSB7DQorICAgICAgICAgIGxhc3QgPSBy YSArIG5yZXN1bHRzICsgbm5vbmU7DQorICAgICAgICAgIHdoaWxlKHJwICsgZXh0cmEgKyAxIDwg bGFzdCkNCisgICAgICAgICAgICBzZXRuaWx2YWx1ZSgtLWxhc3QpOw0KKyAgICAgICAgfQ0KKyAg ICAgICAgLyogRG8gdGhlIGV4cGFuc2lvbiBwYXNzIGZyb20gdG9wIHRvIGJvdHRvbSAqLw0KKyAg ICAgICAgaWYgKGV4dHJhICE9IDApIHsNCisgICAgICAgICAgZm9yICg7IHJwID49IHJhOyBycC0t ICkgew0KKyAgICAgICAgICAgIGlmIChycC0+dHQgIT0gTFVBX1RUVVBMRSkgew0KKyAgICAgICAg ICAgICAgc2V0b2JqMnMoTCwgcnAgKyBleHRyYSwgcnApOw0KKyAgICAgICAgICAgIH0NCisgICAg ICAgICAgICBlbHNlIHsNCisgICAgICAgICAgICAgIEwtPnR1cGxlc3RvcCA9IEwtPnR1cGxlcyAr IGdldHR1dmFsdWUocnApOw0KKyAgICAgICAgICAgICAgZm9yIChqID0gZ2V0dHVzaXplKEwsIHJw KTsgaiA+PSAwOyBqLS0sIGV4dHJhLS0pIHsNCisgICAgICAgICAgICAgICAgaWYgKHJwICsgZXh0 cmEgPCBsYXN0KQ0KKyAgICAgICAgICAgICAgICAgIHNldG9iaihMLCBycCArIGV4dHJhLCBMLT50 dXBsZXMgKyBycC0+dmFsdWUuYiArIDEgKyBqKTsNCisgICAgICAgICAgICAgIH0NCisgICAgICAg ICAgICAgIGV4dHJhKys7DQorICAgICAgICAgICAgICBpZihleHRyYSA9PSAwKQ0KKyAgICAgICAg ICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9DQorICAgICAgICAgIH0NCisgICAgICAgIH0N CisgICAgICAgIC8qIERvIHRoZSBzaHJpbmtpbmcgcGFzcyBmcm9tIGJvdHRvbSB0byB0b3AgKi8N CisgICAgICAgIGlmIChubm9uZSAhPSAwKSB7DQorICAgICAgICAgIGx1YV9hc3NlcnQoZXh0cmEg PT0gMCk7DQorICAgICAgICAgIGZvciAocnAgPSByYTsgcnAgPCBsYXN0OyBycCsrKSB7DQorICAg ICAgICAgICAgaWYgKHJwLT50dCA9PSBMVUFfVE5PTkUpDQorICAgICAgICAgICAgICBleHRyYSsr Ow0KKyAgICAgICAgICAgIGVsc2UgaWYgKGV4dHJhICE9IDApIHsNCisgICAgICAgICAgICAgIHNl dG9iajJzKEwsIHJwIC0gZXh0cmEsIHJwKTsNCisgICAgICAgICAgICB9DQogICAgICAgICAgIH0N CiAgICAgICAgIH0NCiAgICAgICAgIGNvbnRpbnVlOw0KZGlmZiAtdVAgLi4vLi4vbHVhLTUuMS40 L3NyYy9wcmludC5jIHNyYy9wcmludC5jDQotLS0gLi4vLi4vbHVhLTUuMS40L3NyYy9wcmludC5j CU1vbiBNYXIgMjYgMDE6MTc6MzggMjAwNw0KKysrIHNyYy9wcmludC5jCVRodSBBdWcgMTMgMTM6 MTU6NTIgMjAwOQ0KQEAgLTE0NCwxMCArMTQ0LDYgQEANCiAgICBjYXNlIE9QX0NMT1NVUkU6DQog ICAgIHByaW50ZigiXHQ7ICVwIixWT0lEKGYtPnBbYnhdKSk7DQogICAgIGJyZWFrOw0KLSAgIGNh c2UgT1BfU0VUTElTVDoNCi0gICAgaWYgKGM9PTApIHByaW50ZigiXHQ7ICVkIiwoaW50KWNvZGVb KytwY10pOw0KLSAgICBlbHNlIHByaW50ZigiXHQ7ICVkIixjKTsNCi0gICAgYnJlYWs7DQogICAg ZGVmYXVsdDoNCiAgICAgYnJlYWs7DQogICB9DQo= --0016e6d7ee5c92398f04710828d6 Content-Type: application/octet-stream; name="tuples.lua" Content-Disposition: attachment; filename="tuples.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fybopjc61 bG9jYWwgZnVuY3Rpb24gYXJncyguLi4pDQogIGxvY2FsIHQgPSB7Li4ufQ0KICB0Lm4gPSBzZWxl Y3QoJyMnLCAuLi4pDQogIHJldHVybiB0DQplbmQNCg0KbG9jYWwgZnVuY3Rpb24gcGFzcyguLi4p IHJldHVybiAuLi4gZW5kDQoNCmZ1bmN0aW9uIGNoZWNrX2VxdWFsKG5hbWUsIGFyZ3MxLCBhcmdz MikNCiAgbG9jYWwgZXF1YWwgPSBhcmdzMS5uID09IGFyZ3MyLm4NCiAgaWYgZXF1YWwgdGhlbg0K ICAgIGZvciBpID0gMSwgYXJnczEubiBkbw0KICAgICAgaWYgYXJnczFbaV0gfj0gYXJnczJbaV0g dGhlbg0KICAgICAgICBlcXVhbCA9IGZhbHNlDQogICAgICAgIGJyZWFrDQogICAgICBlbmQNCiAg ICBlbmQNCiAgZW5kDQogIHByaW50KG5hbWUsIGVxdWFsIGFuZCAiR29vZCIgb3IgIkJBRCIpDQog IGlmIG5vdCBlcXVhbCB0aGVuDQogICAgcHJpbnQoIkdvdCIsIHVucGFjayhhcmdzMSwgMSwgYXJn czEubikpDQogICAgcHJpbnQoIkV4cGVjdCIsIHVucGFjayhhcmdzMiwgMSwgYXJnczIubikpDQog IGVuZA0KZW5kDQoNCmZ1bmN0aW9uIGNoZWNrX2VxdWFsX3QobmFtZSwgdDEsIHQyKQ0KICBsb2Nh bCBlcXVhbCA9IHRydWUNCiAgbG9jYWwgazINCiAgZm9yIGssIHYgaW4gcGFpcnModDEpIGRvDQog ICAgaWYgdDJba10gfj0gdiB0aGVuDQogICAgICBlcXVhbCA9IGZhbHNlDQogICAgZW5kDQogICAg azIgPSBuZXh0KHQyLCBrMikNCiAgZW5kDQogIGlmIG5leHQodDIsIGsyKSB+PSBuaWwgdGhlbg0K ICAgIGVxdWFsID0gZmFsc2UNCiAgZW5kDQogIHByaW50KG5hbWUsIGVxdWFsIGFuZCAiR29vZCIg b3IgIkJBRCIpDQplbmQNCg0KY2hlY2tfZXF1YWwoIlJldHVybiBkdXBsaWNhdGVkIHNpbmdsZSBh cmd1bWVudCIsDQogIGFyZ3MoKGZ1bmN0aW9uKC4uLikgcmV0dXJuIC4uLiAuLi4sIC4uLiBlbmQp KCJYIikpLA0KICBhcmdzKCJYIiwgIlgiKQ0KKQ0KDQpjaGVja19lcXVhbCgiUmV0dXJuIGR1cGxp Y2F0ZWQgYXJndW1lbnRzIiwNCiAgYXJncygoZnVuY3Rpb24oLi4uKSByZXR1cm4gLi4uIC4uLiwg Li4uIGVuZCkoIkEiLCAiQiIsICJDIikpLA0KICBhcmdzKCJBIiwgIkIiLCAiQyIsICJBIiwgIkIi LCAiQyIpDQopDQoNCmNoZWNrX2VxdWFsKCJSZXR1cm4gZHVwbGljYXRlZCBub3RoaW5nIiwNCiAg YXJncygoZnVuY3Rpb24oLi4uKSByZXR1cm4gLi4uIC4uLiwgLi4uIGVuZCkoKSksDQogIGFyZ3Mo KQ0KKQ0KICANCmNoZWNrX2VxdWFsKCJSZXR1cm4gZHVwbGljYXRlZCBhcmd1bWVudHMgd2l0aCBw YXNzIiwNCiAgYXJncygoZnVuY3Rpb24oLi4uKSByZXR1cm4gcGFzcyguLi4pIC4uLiwgcGFzcygu Li4pIGVuZCkoIkEiLCAiQiIsICJDIikpLA0KICBhcmdzKCJBIiwgIkIiLCAiQyIsICJBIiwgIkIi LCAiQyIpDQopDQogIA0KY2hlY2tfZXF1YWwoIlJldHVybiB0cmlwbGUgZHVwbGljYXRlZCBhcmd1 bWVudHMiLA0KICBhcmdzKChmdW5jdGlvbiguLi4pIHJldHVybiAuLi4gLi4uLCAuLi4gLi4uLCAu Li4gZW5kKSgiQSIsIG5pbCkpLA0KICBhcmdzKCJBIiwgbmlsLCAiQSIsIG5pbCwgIkEiLCBuaWwp DQopDQoNCmNoZWNrX2VxdWFsKCJFeHBhbnNpb24gYXQgc3RhcnQgb2YgZnVuY3Rpb24gYXJndW1l bnRzIiwNCiAgYXJncygoZnVuY3Rpb24oKSByZXR1cm4gIkEiLCAiQiIsICJDIiwgIkQiIGVuZCko KSAuLi4sICJFIiksDQogIGFyZ3MoIkEiLCAiQiIsICJDIiwgIkQiLCAiRSIpDQopDQoNCmNoZWNr X2VxdWFsKCJFeHBhbnNpb24gaW4gbWlkZGxlIG9mIGZ1bmN0aW9uIGFyZ3VtZW50cyIsDQogIGFy Z3MoIkEiLCAoZnVuY3Rpb24oKSByZXR1cm4gIkIiLCAiQyIgZW5kKSgpIC4uLiwgIkQiLCAiRSIp LA0KICBhcmdzKCJBIiwgIkIiLCAiQyIsICJEIiwgIkUiKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhw YW5zaW9uIGluIG1pZGRsZSBvZiBmdW5jdGlvbiBhcmd1bWVudHMgd2l0aCB2YXJhcmcgZW5kIiwN CiAgYXJncygiQSIsIChmdW5jdGlvbigpIHJldHVybiAiQiIsICJDIiBlbmQpKCkgLi4uLCAiRCIs IChmdW5jdGlvbigpIHJldHVybiAiRSIsICJGIiBlbmQpKCkpLA0KICBhcmdzKCJBIiwgIkIiLCAi QyIsICJEIiwgIkUiLCAiRiIpDQopDQoNCmNoZWNrX2VxdWFsKCJEdWFsIGV4cGFuc2lvbiBpbiBt aWRkbGUgb2YgZnVuY3Rpb24gYXJndW1lbnRzIiwNCiAgYXJncygiQSIsIChmdW5jdGlvbigpIHJl dHVybiAiQiIsICJDIiBlbmQpKCkgLi4uLCAiRCIsIChmdW5jdGlvbigpIHJldHVybiAiRSIsICJG IiBlbmQpKCkgLi4uLCAiRyIpLA0KICBhcmdzKCJBIiwgIkIiLCAiQyIsICJEIiwgIkUiLCAiRiIs ICJHIikNCikNCg0KY2hlY2tfZXF1YWwoIkV4cGFuc2lvbiBpbiBhc3NpZ25tZW50IiwNCiAgYXJn cygoZnVuY3Rpb24oLi4uKQ0KICAgIGxvY2FsIGEsIGIsIGMsIGQsIGUgPSAiQSIsIC4uLiAuLi4s ICJFIg0KICAgIHJldHVybiBhLCBiLCBjLCBkLCBlDQogIGVuZCkoIkIiLCAiQyIsICJEIikpLA0K ICBhcmdzKCJBIiwgIkIiLCAiQyIsICJEIiwgIkUiKQ0KKQ0KDQpjaGVja19lcXVhbCgiRXhwYW5z aW9ucyBvZiBkaWZmZXJlbnQgbGVuZ3RocyIsDQogIGFyZ3MoIkEiLCB1bnBhY2t7fSAuLi4sIHVu cGFja3siQiJ9IC4uLiwgdW5wYWNreyJDIiwgIkQifSAuLi4sICJFIiksDQogIGFyZ3MoIkEiLCAi QiIsICJDIiwgIkQiLCAiRSIpDQopDQoNCmNoZWNrX2VxdWFsKCJFeHBhbnNpb25zIG9mIGRpZmZl cmVudCBsZW5ndGhzIGluIGFzc2lnbm1lbnQiLA0KICBhcmdzKChmdW5jdGlvbiguLi4pDQogICAg bG9jYWwgYSwgYiwgYywgZCwgZSA9ICJBIiwgLi4uIC4uLiwgdW5wYWNrey4uLiAuLi4sICJCIn0g Li4uLCB1bnBhY2t7IkMiLCAiRCJ9IC4uLiwgIkUiDQogICAgcmV0dXJuIGEsIGIsIGMsIGQsIGUN CiAgZW5kKSgpKSwNCiAgYXJncygiQSIsICJCIiwgIkMiLCAiRCIsICJFIikNCikNCg0KZnVuY3Rp b24gTHNlbGVjdChuLCAuLi4pDQogIGlmIG4gPT0gJyMnIHRoZW4NCiAgICBsb2NhbCBtYXJrZXIg PSB7fQ0KICAgIGxvY2FsIHQgPSB7Li4uIC4uLiwgbWFya2VyfQ0KICAgIGZvciBrLCB2IGluIHBh aXJzKHQpIGRvDQogICAgICBpZiB2ID09IG1hcmtlciB0aGVuDQogICAgICAgIHJldHVybiBrIC0g MQ0KICAgICAgZW5kDQogICAgZW5kDQogIGVsc2VpZiBuIDwgMCB0aGVuDQogICAgcmV0dXJuIExz ZWxlY3QoTHNlbGVjdCgnIycsIC4uLikgKyAxICsgbiwgLi4uKQ0KICBlbmQNCiAgcmV0dXJuICh7 Li4ufSlbbl0NCmVuZA0KDQpjaGVja19lcXVhbCgiTHNlbGVjdCAjIiwNCiAgYXJncyhMc2VsZWN0 KCcjJywgImEiLCAiYiIsIG5pbCwgbmlsKSksDQogIGFyZ3Moc2VsZWN0KCcjJywgImEiLCAiYiIs IG5pbCwgbmlsKSkNCikNCg0KY2hlY2tfZXF1YWxfdCgiU3RhbmRhcmQgdGFibGUgY29uc3RydWN0 b3IiLA0KICB7IkEiLCAiQiIsICJDIiwgWzBdID0gIiAiLCBrID0gInYiLCAiRCJ9LA0KICB7WzBd ID0gIiAiLCBbMV0gPSAiQSIsIFsyXSA9ICJCIiwgWzNdID0gIkMiLCBbNF0gPSAiRCIsIFsiayJd ID0gInYifQ0KKQ0KDQpjaGVja19lcXVhbF90KCJNdWx0aXBsZSBleHBhbmRlZCB1bnBhY2tzIiwN CiAge3VucGFja3s0LCB1bnBhY2t7NSwgNn0gLi4uLCA3fSAuLi4sIDh9LA0KICB7NCwgNSwgNiwg NywgOH0NCikNCg== --0016e6d7ee5c92398f04710828d6-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 15:01:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DI1DPt030697; Thu, 13 Aug 2009 15:01:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B25419172; Thu, 13 Aug 2009 15:00:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from server70.hosting2go.nl (server70.hosting2go.nl [83.137.194.102]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 191B619107 for ; Thu, 13 Aug 2009 15:00:25 -0300 (BRT) Received: (qmail 28805 invoked from network); 13 Aug 2009 20:00:19 +0200 Received: from cc1113629-a.delfz1.gr.home.nl (HELO BasGrooLapTop) (217.121.135.2) by server70.hosting2go.nl with SMTP; 13 Aug 2009 20:00:19 +0200 Message-ID: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop> From: "Imagine Mailing Lists" To: "Lua list" Subject: Table inside table Date: Thu, 13 Aug 2009 19:59:46 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01CA1C50.9BD13160" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dit is een meerdelig bericht in de MIME-indeling. ------=_NextPart_000_0011_01CA1C50.9BD13160 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey everyone, I'm quite new to PBapi for Lua (structure is the same as = in the C api) I've been struggling for ages to push a table on the stack and fill it = with data... this is what i've got lua_newtable(*lua) lua_pushstring(*lua, "NodeName") lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) So inserting strings, booleans and numbers into a nummerically index, or = name indexed table is getting along nice. But now I'd like to insert a table in a node, and I'm completely lost = here. This is the Purebasic syntax ProcedureC Somefunction(*lua) lua_newtable(*lua) For i=3D1 to 20 lua_pushnumber(*lua, i) lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) next EndProcedure Instead of pushing a string, i'd like to push a table in that index. How = would I do that? (even the filling must be done in that moment) Thanks, Bas ------=_NextPart_000_0011_01CA1C50.9BD13160 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hey everyone, I'm quite new to PBapi for = Lua=20 (structure is the same as in the C api)
I've been struggling for ages to push a table = on the=20 stack and fill it with data... this is what i've got
 
lua_newtable(*lua)
 
lua_pushstring(*lua, "NodeName")
lua_pushstring(*lua, "Nodevalue")
lua_settable(*lua, -3)
 
So inserting strings, booleans and numbers = into a=20 nummerically index, or name indexed table is getting along = nice.
But now I'd like to insert a table in a node, = and I'm=20 completely lost here.
 
This is the Purebasic syntax
 
ProcedureC Somefunction(*lua)
    lua_newtable(*lua)
    For i=3D1 to 20
        lua_pushnu= mber(*lua,=20 i)
        lua_pushst= ring(*lua,=20 "Nodevalue")
        lua_settab= le(*lua,=20 -3)
    next
EndProcedure
 
Instead of pushing a string, i'd like to push = a table in=20 that index. How would I do that? (even the filling must be done in that=20 moment)
 
Thanks,
Bas
------=_NextPart_000_0011_01CA1C50.9BD13160-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 15:08:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DI8lja000326; Thu, 13 Aug 2009 15:08:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46B42191E4; Thu, 13 Aug 2009 15:08:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D62119182 for ; Thu, 13 Aug 2009 15:08:12 -0300 (BRT) Received: by fxm25 with SMTP id 25so839983fxm.5 for ; Thu, 13 Aug 2009 11:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uohn32iVmQp2RyJQFyaPX2hDmhxBO9mIEmQ9ogsa4Dc=; b=kgh+e+cuBqWgTFHn/hgIT6C0fdfM4ez51nhJuZknAzdZxSGNSDdOip0PMIcYO1TSlY Gy/yljRnyz5RWMg5ZqHOGvnuvHsQlX+2x6Kj0O58kvEoU8LtposqOeuYfs2HlaIIDPmw cG79nRIEYR1aSrWJcxG0tTUBOSp0aUeCy4YqE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vOwVUkp5QfxSvnvVFEHWyqPKr1u37CqD2Zeg0DNKDHUAw5O5EUGHT5I5Zp9PTWT8h5 QaMOaYWFQWHWXjAgzh73akLm/TtqQnBiAotrch6Jny1detNL7X7W1+hKijKSLm/SH63z bQPog64e2Dt8Pjzotm2QazpevIaG7FGP2O0es= MIME-Version: 1.0 Received: by 10.239.139.161 with SMTP id t33mr87759hbt.115.1250186889119; Thu, 13 Aug 2009 11:08:09 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Thu, 13 Aug 2009 20:08:09 +0200 Message-ID: <560972290908131108t3add3525ga8521d4a182468cf@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 13, 2009 at 6:09 PM, Peter Cawley wrote: > Should now be fixed. Patch applied fine, then built with MS cl compiler. None of my code falling over so far. The {unpack(t1)...,unpack(t2)} idiom is a good deal faster than the manual method of creating a table which is the concatenation of t1 and t2. For t1 and t2 both having 3 elements, then this method takes 1.6 vs 3.5 sec; For t1 and t2 having 10 elements, then we get 2.4 vs 7.2 sec. It's possible that someone might be able to squeeze a little extra bit of speed out of the normal code (pulling in an explicit table size setter would probably help) so here is the unscientific code behind the numbers: steve d. ----- N = 1e6 function concatn1 (t1,t2) for K = 1,N do local t = {} for i = 1,#t1 do t[i] = t1[i] end local k = #t1 + 1 for i = 1,#t2 do t[k] = t2[i] k = k + 1 end end end function concatn2 (t1,t2) for K = 1,N do local t = {unpack(t1)...,unpack(t2)} end end t1 = {10,20,30,1,2,3,11,12,13,14} t2 = {40,50,60,4,5,6,41,51,61,62} t = os.clock() concatn1(t1,t2) print('elapsed',os.clock()-t) t = os.clock() concatn2(t1,t2) print('elapsed',os.clock()-t) From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 15:11:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DIB9wD000736; Thu, 13 Aug 2009 15:11:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5A151926D; Thu, 13 Aug 2009 15:10:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD6ED1914F for ; Thu, 13 Aug 2009 15:10:32 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:4872 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mbekf-00056n-Er for lua@bazar2.conectiva.com.br; Thu, 13 Aug 2009 14:10:13 -0400 Message-ID: <714D2555D5F64066B392B7E8F8AF86A3@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop> Subject: Re: Table inside table Date: Thu, 13 Aug 2009 11:10:41 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00BC_01CA1C06.B1BA0460" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00BC_01CA1C06.B1BA0460 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Bas, I had a similar question a couple of days ago. Turns out, it's quite = simple, actually, and obvious once you see it. Go to the list archive at = http://lua-users.org/lists/lua-l/ and do a search on "multi-dimensional = table". Michael ----- Original Message -----=20 From: Imagine Mailing Lists=20 To: Lua list=20 Sent: Thursday, August 13, 2009 10:59 AM Subject: Table inside table Hey everyone, I'm quite new to PBapi for Lua (structure is the same as = in the C api) I've been struggling for ages to push a table on the stack and fill it = with data... this is what i've got lua_newtable(*lua) lua_pushstring(*lua, "NodeName") lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) So inserting strings, booleans and numbers into a nummerically index, = or name indexed table is getting along nice. But now I'd like to insert a table in a node, and I'm completely lost = here. This is the Purebasic syntax ProcedureC Somefunction(*lua) lua_newtable(*lua) For i=3D1 to 20 lua_pushnumber(*lua, i) lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) next EndProcedure Instead of pushing a string, i'd like to push a table in that index. = How would I do that? (even the filling must be done in that moment) Thanks, Bas ------=_NextPart_000_00BC_01CA1C06.B1BA0460 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Bas,
 
I had a similar question a couple of = days ago.=20 Turns out, it's quite simple, actually, and obvious once you see it. Go = to the=20 list archive at http://lua-users.org/lists/lua-l/ and do a = search=20 on  "multi-dimensional table".
 
Michael
----- Original Message -----
From:=20 Imagine Mailing = Lists=20
Sent: Thursday, August 13, 2009 = 10:59=20 AM
Subject: Table inside = table

Hey everyone, I'm quite new to = PBapi for Lua=20 (structure is the same as in the C api)
I've been struggling for ages to push a = table on the=20 stack and fill it with data... this is what i've got
 
lua_newtable(*lua)
 
lua_pushstring(*lua, = "NodeName")
lua_pushstring(*lua, = "Nodevalue")
lua_settable(*lua, -3)
 
So inserting strings, booleans and numbers = into a=20 nummerically index, or name indexed table is getting along = nice.
But now I'd like to insert a table in a = node, and I'm=20 completely lost here.
 
This is the Purebasic syntax
 
ProcedureC Somefunction(*lua)
    lua_newtable(*lua)
    For i=3D1 to 20
        lua_pushnu= mber(*lua,=20 i)
        lua_pushst= ring(*lua,=20 "Nodevalue")
        lua_settab= le(*lua,=20 -3)
    next
EndProcedure
 
Instead of pushing a string, i'd like to = push a table=20 in that index. How would I do that? (even the filling must be done in = that=20 moment)
 
Thanks,
Bas
------=_NextPart_000_00BC_01CA1C06.B1BA0460-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 15:12:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DICmlR001205; Thu, 13 Aug 2009 15:12:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B75BF19290; Thu, 13 Aug 2009 15:12:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02AFF19276 for ; Thu, 13 Aug 2009 15:12:18 -0300 (BRT) Received: by bwz10 with SMTP id 10so824104bwz.5 for ; Thu, 13 Aug 2009 11:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Jti0203vIAIMzuarcW9JU6avYSKIcWCJOSZ+ay0owjc=; b=bYaDqMxhh5l/prTJ1gYuZGHxAie7xZ2OVFs1K5NqjnKZNu6tl0d49n8Fd1xZNhYTtK KR8KC2iUENB3ysATsmX7KH3goqUWur8dvgBseZV7UfcD4qT74UYmLRsDpdi7lmN89lUS Cpqp/skCMLCkaEtjRT75f9IUOgEIM8uvjQG+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CDIg9AtEuZ4zmwivyXadUHpsBc+AKM0g2qjErmuN5WBibRTFxmgwtQ4egYJMDnHZMM kCk58rZG5WIRuB+0hLG5z7KmsMIePWRyaDtDHFs3t/NJTdIU87TLjZQB4rIuyf48wh4P 0GevoPMoitepn3QAFuvRKYxwto/rg6pPniQc0= MIME-Version: 1.0 Received: by 10.239.182.149 with SMTP id q21mr101619hbg.32.1250187134875; Thu, 13 Aug 2009 11:12:14 -0700 (PDT) In-Reply-To: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop> References: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop> Date: Thu, 13 Aug 2009 20:12:14 +0200 Message-ID: <560972290908131112k9ae4bb6wd7b80abacc03908b@mail.gmail.com> Subject: Re: Table inside table From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7DICmlR001205 On Thu, Aug 13, 2009 at 7:59 PM, Imagine Mailing Lists wrote: > ProcedureC Somefunction(*lua) >     lua_newtable(*lua) >     For i=1 to 20 >         lua_pushnumber(*lua, i) >         lua_pushstring(*lua, "Nodevalue") >         lua_settable(*lua, -3) >     next > EndProcedure > > Instead of pushing a string, i'd like to push a table in that index. How > would I do that? (even the filling must be done in that moment) lua_newtable() will do the job, again. You then have to fill it in, using lua_settable, etc. The main thing is to avoid getting confused with the stack - drawings seem to help ;) steve d. From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 16:09:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DJ9blu014254; Thu, 13 Aug 2009 16:09:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1347E18CAD; Thu, 13 Aug 2009 16:09:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id C024F18BA2 for ; Thu, 13 Aug 2009 16:08:56 -0300 (BRT) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 13 Aug 2009 13:57:46 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 13 Aug 2009 15:08:53 -0400 Message-ID: <4A8464C5.4050603@elbitsystems-us.com> Date: Thu, 13 Aug 2009 15:08:53 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: ... as an "expand list" unary postfix operator References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 13 Aug 2009 19:08:53.0520 (UTC) FILETIME=[7FC3A900:01CA1C49] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Peter Cawley wrote: > On Thu, Aug 13, 2009 at 4:21 PM, Duncan Cross wrote: > >> Thanks again for this Peter... > Should now be fixed. > Great stuff, Peter, and clearly a lot of work. Thank you! Your replacement of SETLIST by TUPLE and DETUPLE was a nice insight into how to achieve the goal. And as I scanned the diff, I noticed quite a few places where there were more leading '-' than '+' characters; that's always a good sign that you're on the right track. Of course the final product contained more '+' lines, especially when it came time to tweak the VM. FYI, I put it through the tests at: http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz It passed completely. I had a little trouble with the expected strings for the interpreter tests (-i) in main.lua. Running "lua -i < prepfile > outfile" included echoes of the text from the prepfile, just as if they were typed by hand. I played around with how I was launching the test (shell prompt, shell script, emacs compile) but couldn't make it go away. I'm sure there's some tty setting that I need to make for it to work (I'm using Ubuntu 8.04). Any tips for this? Since the code was clearly working and it seemed like there were only a few '-i' tests, I inspected each false negative by hand and commented out the checkout() calls one at a time. Props to you, Peter. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 16:26:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DJQpOT018674; Thu, 13 Aug 2009 16:26:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DFAB18C93; Thu, 13 Aug 2009 16:26:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D88818BED for ; Thu, 13 Aug 2009 16:26:16 -0300 (BRT) Received: from [192.168.22.143] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n7DJQ6LQ030236 for ; Thu, 13 Aug 2009 16:26:07 -0300 Message-ID: <4A8468C4.3040700@inconcertcc.com> Date: Thu, 13 Aug 2009 16:25:56 -0300 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Using a luaL_Buffer while traversing a table References: <4A8321EA.4010009@inconcertcc.com> <20090812173006.A14994@lua.tecgraf.puc-rio.br> In-Reply-To: <20090812173006.A14994@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > > I had a similar problem in my take on unrope for ropes implemented as > Lua tables. In the end I had to reserve some stack space before the > Lua buffer data. The final C code is below. The original thread started > at http://lua-users.org/lists/lua-l/2008-12/msg00055.html but the initial > versions had bugs... Thanks Luiz. It seems that it is indeed difficult to mix those things. In this case I guess that the code will be easier to understand and maintain if I don't use buffers. Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 18:14:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DLE6NJ013364; Thu, 13 Aug 2009 18:14:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC60018B9F; Thu, 13 Aug 2009 18:13:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F27218B3D for ; Thu, 13 Aug 2009 18:13:20 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7DLDHxF000667 for ; Thu, 13 Aug 2009 18:13:19 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 1779954C11A; Thu, 13 Aug 2009 18:13:17 -0300 (BRT) Date: Thu, 13 Aug 2009 18:13:17 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: ... as an "expand list" unary postfix operator Message-ID: <20090813211317.GD16892@inf.puc-rio.br> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> <4A8464C5.4050603@elbitsystems-us.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8464C5.4050603@elbitsystems-us.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I had a little trouble with the expected strings for the interpreter > tests (-i) in main.lua. Running "lua -i < prepfile > outfile" included > echoes of the text from the prepfile, just as if they were typed by > hand. I played around with how I was launching the test (shell prompt, > shell script, emacs compile) but couldn't make it go away. I'm sure > there's some tty setting that I need to make for it to work (I'm using > Ubuntu 8.04). Any tips for this? May it have something to do with the readline library? IIRC, I had this problem before and it was related to that library. (Something like it echoes only if you define LUA_USE_READLINE, or vice-versa...) -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 18:41:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DLfQg1018454; Thu, 13 Aug 2009 18:41:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D91A18BA2; Thu, 13 Aug 2009 18:40:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from server70.hosting2go.nl (server70.hosting2go.nl [83.137.194.102]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B67218A22 for ; Thu, 13 Aug 2009 18:40:52 -0300 (BRT) Received: (qmail 6586 invoked from network); 13 Aug 2009 23:40:46 +0200 Received: from cc1113629-a.delfz1.gr.home.nl (HELO BasGrooLapTop) (217.121.135.2) by server70.hosting2go.nl with SMTP; 13 Aug 2009 23:40:46 +0200 Message-ID: <449587CBEEAB40ADAB17A939A788D83F@BasGrooLapTop> From: "Imagine Mailing Lists" To: "Lua list" References: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop> <714D2555D5F64066B392B7E8F8AF86A3@CAYENNE> In-Reply-To: <714D2555D5F64066B392B7E8F8AF86A3@CAYENNE> Subject: Re: Table inside table Date: Thu, 13 Aug 2009 23:40:14 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0023_01CA1C6F.67CC4BB0" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dit is een meerdelig bericht in de MIME-indeling. ------=_NextPart_000_0023_01CA1C6F.67CC4BB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Michael, Thank you for the quick response, I must have missed this one in my = inbox. This should do it, thank you! From: Michael Newberry=20 Sent: Thursday, August 13, 2009 8:10 PM To: Lua list=20 Subject: Re: Table inside table Bas, I had a similar question a couple of days ago. Turns out, it's quite = simple, actually, and obvious once you see it. Go to the list archive at = http://lua-users.org/lists/lua-l/ and do a search on "multi-dimensional = table". Michael ----- Original Message -----=20 From: Imagine Mailing Lists=20 To: Lua list=20 Sent: Thursday, August 13, 2009 10:59 AM Subject: Table inside table Hey everyone, I'm quite new to PBapi for Lua (structure is the same as = in the C api) I've been struggling for ages to push a table on the stack and fill it = with data... this is what i've got lua_newtable(*lua) lua_pushstring(*lua, "NodeName") lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) So inserting strings, booleans and numbers into a nummerically index, = or name indexed table is getting along nice. But now I'd like to insert a table in a node, and I'm completely lost = here. This is the Purebasic syntax ProcedureC Somefunction(*lua) lua_newtable(*lua) For i=3D1 to 20 lua_pushnumber(*lua, i) lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) next EndProcedure Instead of pushing a string, i'd like to push a table in that index. = How would I do that? (even the filling must be done in that moment) Thanks, Bas __________ NOD32 4333 (20090813) Informatie __________ Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem. http://www.nod32.nl ------=_NextPart_000_0023_01CA1C6F.67CC4BB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Michael,
 
Thank you for the quick response, I must have = missed=20 this one in my inbox.
This should do it, thank you!

Sent: Thursday, August 13, 2009 8:10 PM
Subject: Re: Table inside table

Bas,
 
I had a similar question a couple of = days ago.=20 Turns out, it's quite simple, actually, and obvious once you see it. Go = to the=20 list archive at http://lua-users.org/lists/lua-l/ and do a = search=20 on  "multi-dimensional table".
 
Michael
----- Original Message -----
From:=20 Imagine Mailing = Lists=20
Sent: Thursday, August 13, 2009 = 10:59=20 AM
Subject: Table inside = table

Hey everyone, I'm quite new to = PBapi for Lua=20 (structure is the same as in the C api)
I've been struggling for ages to push a = table on the=20 stack and fill it with data... this is what i've got
 
lua_newtable(*lua)
 
lua_pushstring(*lua, = "NodeName")
lua_pushstring(*lua, = "Nodevalue")
lua_settable(*lua, -3)
 
So inserting strings, booleans and numbers = into a=20 nummerically index, or name indexed table is getting along = nice.
But now I'd like to insert a table in a = node, and I'm=20 completely lost here.
 
This is the Purebasic syntax
 
ProcedureC Somefunction(*lua)
    lua_newtable(*lua)
    For i=3D1 to 20
        lua_pushnu= mber(*lua,=20 i)
        lua_pushst= ring(*lua,=20 "Nodevalue")
        lua_settab= le(*lua,=20 -3)
    next
EndProcedure
 
Instead of pushing a string, i'd like to = push a table=20 in that index. How would I do that? (even the filling must be done in = that=20 moment)
 
Thanks,
Bas


__________ NOD32=20 4333 (20090813) Informatie __________

Dit bericht is = gecontroleerd door=20 het NOD32 Antivirus Systeem.
http://www.nod32.nl
------=_NextPart_000_0023_01CA1C6F.67CC4BB0-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 19:45:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DMjhqD028617; Thu, 13 Aug 2009 19:45:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA8E018CD5; Thu, 13 Aug 2009 19:45:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CDB618C23 for ; Thu, 13 Aug 2009 19:45:06 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so207400eye.11 for ; Thu, 13 Aug 2009 15:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=kvX5KTT34YwUuRYnUBjyAMwLQs/c2knEIpaSVB9lXrA=; b=S31/U6vKgkP1w2S1KHvE8OQSuNZPiu2/PC81LRmjnof3PhRXRrY8rf0vwL9vt3VuR5 gBFx4zX8ULotvVtGqwZMnrmCfW0MqYadVlO5tUfI4GpzYj+lInh5eBCEZyZsNXXYIZoC vDqEUJ9EWUnNBHAz2hxvL+H03QM71gvATGdW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=BFd0RdlCQHpMyolHeYJMoQrQ3oCg7/mBnNWYPyKcCMIKakYza3Wjctg/CsAblOOJr2 nsCG76dBIvcA1lJxFJF4GQCEUmOHyP2xt3ntD62KlpeXalK6UmjGtke/Q88ypfQOiAkz RjNhH9TVLiSW6c1uRoYwtoVyrRUDhxwvTQOxQ= MIME-Version: 1.0 Received: by 10.216.8.65 with SMTP id 43mr299833weq.168.1250203505329; Thu, 13 Aug 2009 15:45:05 -0700 (PDT) Date: Thu, 13 Aug 2009 23:45:05 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator [alternate symbols] From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7DMjhqD028617 On Tue, Aug 11, 2009 at 2:48 PM, Pierre LeMoine wrote: > I've been missing this a number of times recently, i'd certainly like > and use it. Maybe > >> When I originally suggested this a few people said that it looks odd, >> particularly in the case of ... ... - I don't really have any argument >> for that, it *is* a bit odd. > > If ... seems wierd, it shouldn't be too hard to change it to something > else, right? maybe  a ~? ...~ multivalues()~ > If, after further discussion, there comes a consensus that re-using '...' like this is not appropriate, it seems much more Lua-ish to go with a keyword operator instead of a symbol. I can't think of any word that seems quite right, though - "expanded"? "complete"? It should ideally be short and simple - Lua's other keywords are all basic, single-syllable words. (For the record, I still think '...' is right for the job - but if we can find something better, great.) -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 19:57:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7DMv8fm030295; Thu, 13 Aug 2009 19:57:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F6E118782; Thu, 13 Aug 2009 19:56:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B74E718743 for ; Thu, 13 Aug 2009 19:56:35 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:3993 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MbjDR-0001m6-FF for lua@bazar2.conectiva.com.br; Thu, 13 Aug 2009 18:56:14 -0400 Message-ID: <9C6D428AA21E4D729E92FE03A8069639@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <634D07920388413DA5C1EF8F345D19DB@BasGrooLapTop><714D2555D5F64066B392B7E8F8AF86A3@CAYENNE> <449587CBEEAB40ADAB17A939A788D83F@BasGrooLapTop> Subject: Re: Table inside table Date: Thu, 13 Aug 2009 15:56:45 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0112_01CA1C2E.A8C7A510" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0112_01CA1C2E.A8C7A510 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You're welcome! Michael ----- Original Message -----=20 From: Imagine Mailing Lists=20 To: Lua list=20 Sent: Thursday, August 13, 2009 2:40 PM Subject: Re: Table inside table Michael, Thank you for the quick response, I must have missed this one in my = inbox. This should do it, thank you! From: Michael Newberry=20 Sent: Thursday, August 13, 2009 8:10 PM To: Lua list=20 Subject: Re: Table inside table Bas, I had a similar question a couple of days ago. Turns out, it's quite = simple, actually, and obvious once you see it. Go to the list archive at = http://lua-users.org/lists/lua-l/ and do a search on "multi-dimensional = table". Michael ----- Original Message -----=20 From: Imagine Mailing Lists=20 To: Lua list=20 Sent: Thursday, August 13, 2009 10:59 AM Subject: Table inside table Hey everyone, I'm quite new to PBapi for Lua (structure is the same = as in the C api) I've been struggling for ages to push a table on the stack and fill = it with data... this is what i've got lua_newtable(*lua) lua_pushstring(*lua, "NodeName") lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) So inserting strings, booleans and numbers into a nummerically = index, or name indexed table is getting along nice. But now I'd like to insert a table in a node, and I'm completely = lost here. This is the Purebasic syntax ProcedureC Somefunction(*lua) lua_newtable(*lua) For i=3D1 to 20 lua_pushnumber(*lua, i) lua_pushstring(*lua, "Nodevalue") lua_settable(*lua, -3) next EndProcedure Instead of pushing a string, i'd like to push a table in that index. = How would I do that? (even the filling must be done in that moment) Thanks, Bas __________ NOD32 4333 (20090813) Informatie __________ Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem. http://www.nod32.nl ------=_NextPart_000_0112_01CA1C2E.A8C7A510 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
You're welcome!
 
Michael
----- Original Message -----
From:=20 Imagine Mailing = Lists=20
Sent: Thursday, August 13, 2009 = 2:40=20 PM
Subject: Re: Table inside = table

Michael,
 
Thank you for the quick response, I must = have missed=20 this one in my inbox.
This should do it, thank you!

Sent: Thursday, August 13, 2009 8:10 PM
Subject: Re: Table inside table

Bas,
 
I had a similar question a couple of = days ago.=20 Turns out, it's quite simple, actually, and obvious once you see it. = Go to the=20 list archive at http://lua-users.org/lists/lua-l/ and do a = search=20 on  "multi-dimensional table".
 
Michael
----- Original Message -----
From:=20 Imagine = Mailing=20 Lists
To: Lua list
Sent: Thursday, August 13, = 2009 10:59=20 AM
Subject: Table inside = table

Hey everyone, I'm quite new to = PBapi for Lua=20 (structure is the same as in the C api)
I've been struggling for ages to push a = table on the=20 stack and fill it with data... this is what i've got
 
lua_newtable(*lua)
 
lua_pushstring(*lua, = "NodeName")
lua_pushstring(*lua, = "Nodevalue")
lua_settable(*lua, -3)
 
So inserting strings, booleans and numbers = into a=20 nummerically index, or name indexed table is getting along=20 nice.
But now I'd like to insert a table in a = node, and=20 I'm completely lost here.
 
This is the Purebasic syntax
 
ProcedureC Somefunction(*lua)
    lua_newtable(*lua)
    For i=3D1 to 20
        lua_pushnu= mber(*lua,=20 i)
        lua_pushst= ring(*lua,=20 "Nodevalue")
        lua_settab= le(*lua,=20 -3)
    next
EndProcedure
 
Instead of pushing a string, i'd like to = push a=20 table in that index. How would I do that? (even the filling must be = done in=20 that moment)
 
Thanks,
Bas


__________ NOD32=20 4333 (20090813) Informatie __________

Dit bericht is = gecontroleerd door=20 het NOD32 Antivirus Systeem.
http://www.nod32.nl
------=_NextPart_000_0112_01CA1C2E.A8C7A510-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 21:03:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E03chc006439; Thu, 13 Aug 2009 21:03:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C008718B9F; Thu, 13 Aug 2009 21:03:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D8F71897E for ; Thu, 13 Aug 2009 21:02:57 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so213286eye.11 for ; Thu, 13 Aug 2009 17:02:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.21.211 with SMTP id r61mr276546wer.211.1250208175824; Thu, 13 Aug 2009 17:02:55 -0700 (PDT) In-Reply-To: <4A8464C5.4050603@elbitsystems-us.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> <4A8464C5.4050603@elbitsystems-us.com> Date: Fri, 14 Aug 2009 01:02:55 +0100 X-Google-Sender-Auth: 649f407ea427661a Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 13, 2009 at 8:08 PM, Doug Rogers wrote: > Your replacement of SETLIST by TUPLE and DETUPLE was a nice insight into how > to achieve the goal. And as I scanned the diff, I noticed quite a few places > where there were more leading '-' than '+' characters; that's always a good > sign that you're on the right track. Of course the final product contained > more '+' lines, especially when it came time to tweak the VM. SETLIST is totally separate from DE/TUPLE. The changing of SETLIST is the reason for most of the removed lines; the new SETLIST simplifies the bytecode format, and allows simple and efficient expansion of expressions in table constructors, with the cost being increased memory usage from each table being increased by sizeof(int). DE/TUPLE are the reason for most of the added lines, and are for the very separate issue of expanding expressions within an expression list. The TUPLE instruction complicates writing a strong bytecode verifier, as such a verifier would need to guarantee that a tuple isn't used for anything other than a DETUPLE instruction. As the current verifier is considered broken and is probably being removed in 5.2, I don't consider breaking the bytecode verifier further to be too big of a crime. From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 21:04:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E04Ft3006526; Thu, 13 Aug 2009 21:04:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 502CF18FEB; Thu, 13 Aug 2009 21:03:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id 54FBB18CF8 for ; Thu, 13 Aug 2009 21:03:32 -0300 (BRT) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 13 Aug 2009 18:52:21 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 13 Aug 2009 20:03:28 -0400 Message-ID: <4A84A9D0.4010805@elbitsystems-us.com> Date: Thu, 13 Aug 2009 20:03:28 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: ... as an "expand list" unary postfix operator References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> <4A8464C5.4050603@elbitsystems-us.com> <20090813211317.GD16892@inf.puc-rio.br> In-Reply-To: <20090813211317.GD16892@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Aug 2009 00:03:28.0762 (UTC) FILETIME=[A7078DA0:01CA1C72] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: >> ... Running "lua -i < prepfile > outfile" included >> echoes of the text from the prepfile, ... Any tips for this? > May it have something to do with the readline library? Good call. Recompiling with 'make ansi' fixed it. I've just spent a too many minutes searching the web for a way to make GNU's Readline library disable echoing. I thought there might be an environment variable or something I could put in my .inputrc that would allow readline to detect whether its output is a tty. No luck so far. Thanks for the answer, Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Thu Aug 13 21:31:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E0Vj3I009519; Thu, 13 Aug 2009 21:31:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD9E1191DC; Thu, 13 Aug 2009 21:31:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA04.westchester.pa.mail.comcast.net (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADBFF18E4E for ; Thu, 13 Aug 2009 21:30:56 -0300 (BRT) Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA04.westchester.pa.mail.comcast.net with comcast id U09c1c0020ldTLk540WvjB; Fri, 14 Aug 2009 00:30:55 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA04.westchester.pa.mail.comcast.net with comcast id U0Wt1c00H24UxC23Q0WtaY; Fri, 14 Aug 2009 00:30:55 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id DC69B3729E; Thu, 13 Aug 2009 20:30:51 -0400 (EDT) Date: Thu, 13 Aug 2009 20:30:51 -0400 From: Etan Reisner To: Lua list Subject: Some minor FAQ tweaks (a bit delayed). Message-ID: <20090814003051.GE1825@aran> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline A number of these tweaks are simple spelling and grammar fixes the rest are various tweaks which make things flow better, read better, sound better, or explain better (at least if you ask me). Feel free to ignore any changes you don't like. The first, fourth, tenth, thirteenth, fourteenth, eighteenth, and nineteenth X hunks are typo and grammar fixes. Second hunk, clarification of the pairs/ipairs sentences and explanation of what '#t' means. Third hunk, tries to explain that # is unreliable for sparse arrays (without giving a potentially misleading length). Fifth hunk, s/Nil/Sentinel/ I think 'Nil' is too likely to be confusing. Sixth hunk, removes 'indeed' I think it reads better. Seventh hunk, removes reference to 'self' as I think that's a bit too magic for the moment (and hasn't been mentioned before). Eighth hunk, adds 'only' to '... and are [only] local if ...'. Ninth hunk, moves the emphasis to 'cannot' as opposed to 'find a key'. Eleventh hunk, setting a field will not error if the field doesn't exist, but will error if the table is not a table. Twelfth hunk, clarifies why the env "contortions" are desired... the code is potentially untrusted. Fifteenth hunk, removes (an incorrect as far as I'm aware) reference to porting history. Sixteenth hunk, grammar fixes and removes an unnecessary comparison to python. Seventeenth hunk, replaces the old luaL_openlib with the current luaL_register. I hope my hunk counts are right. =) -Etan --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="FAQ.diff" --- FAQ.md.orig 2009-08-04 11:15:48.000000000 -0400 +++ FAQ.md 2009-08-05 16:57:32.510520200 -0400 @@ -16,9 +16,9 @@ One scenario is that you already have big C/C++/Java/C# (etc) applications and wish to let your users script those applications. Lua will only add about 170K, which gets you a modern extension language which understands your special needs (like sandboxing) and can be easily integrated with your code. -The other is that you have a lot of components which you use in your workflow and you are looking for a [glue language](http://en.wikipedia.org/wiki/Glue_language) to easily bind them together quickly without messy recompilation. (See [Ousterhout's Dichomomy](http://wiki.tcl.tk/9865).) +The other is that you have a lot of components which you use in your workflow and you are looking for a [glue language](http://en.wikipedia.org/wiki/Glue_language) to easily bind them together quickly without messy recompilation. (See [Ousterhout's Dichotomy](http://wiki.tcl.tk/9865).) -Another powerful use case which combines these two is embedding Lua as a _aid to debugging_. It is possible to provide an intelligent debug console (even for GUI applications, such as Java/Swing) running Lua, which can let you operate _inside_ an application, querying state and running little test scripts. +Another powerful use case which combines these two is embedding Lua as an _aid to debugging_. It is possible to provide an intelligent debug console (even for GUI applications, such as Java/Swing) running Lua, which can let you operate _inside_ an application, querying state and running little test scripts. ### Any good editors and debuggers? @@ -30,13 +30,13 @@ ### What is the difference between pairs and ipairs? -Lua tables are general data structures that have an 'array-like' and a 'map-like' part. The idea is that you can use them efficiently as resizeable arrays with integer indices, but can also index them with any other value as a hashmap. `pairs(t)` gives a general iterator over all the keys and values in a table, numerical or not, and in no particular order; `ipairs(t)` goes over the array part, in order. +Lua tables are general data structures that have an 'array-like' and a 'map-like' part. The idea is that you can use them efficiently as resizeable arrays with integer indices, but can also index them with any other value as a hashmap. `pairs(t)` gives a general iterator over all the keys and values in a table, numerical or not, in no particular order; `ipairs(t)` iterates over the array part, in numerical order. Tables can contain a mixture of array and map entries: t = {fred='one',[0]=1; 10,20,30,40} -The semi-colon is not required, it can be used as an alternative separator in table constructors. Just because `0` is a numerical index does not mean it is an _array index_! By definition, these go from `1` to `#t`. +The semi-colon is not required, it can be used as an alternative separator in table constructors. Just because `0` is a numerical index does not mean it is an _array index_! By definition, these go from `1` to `#t` (the length of the table). These are equivalent ways to access the array elements: @@ -48,12 +48,12 @@ t = {[1] = 200, [2] = 300, [6] = 400, [13] = 500} -In this case, `#t` is just `2`, since it counts the number of elements up to the first `nil` value (or 'hole'). If you wish to keep track of the size of a sparse array, then it is best to keep and increment a counter: +In this case, `#t` is unreliable, since then length operator `#` is only defined for non-sparse arrays (arrays without holes). If you wish to keep track of the size of a sparse array, then it is best to keep and increment a counter: t[idx] = val; t.n = t.n + 1 -It is a little awkward to iterate _only_ over the non-array part of a table: +It is a little awkward to iterate over _only_ the non-array (non-sparse) part of a table: local n = #t for k,v in pairs(t) do @@ -94,7 +94,7 @@ ### How can one put a nil value in an array? -Putting `nil` directly into an array causes a 'hole', and `nil` is always indicates the end of an array. There are two ways to get around this. One approach is a sparse array with an explicit size; the iterator must return the index and the value: +Putting `nil` directly into an array causes a 'hole', and `nil` always indicates the end of an array. There are two ways to get around this. One approach is a sparse array with an explicit size; the iterator must return the index and the value: local sa = {n=0} @@ -119,7 +119,7 @@ for i,v in sparse_iter(sa) do ... end -The other approach is to store a special unique value `Nil` in place of an actual `nil`; `Nil = {}` will do. +The other approach is to use a unique value `Sentinel` in place of an actual `nil`; `Sentinel = {}` will do. ### How can I dump out a table? @@ -147,7 +147,7 @@ ### Why does print 'hello' work, and not print 42? -The confusion arises because some languages (like Python 2.x) have a print _statement_, whereas `print` is a _function_ in Lua (as it is indeed in Python 3). +The confusion arises because some languages (like Python 2.x) have a print _statement_, whereas `print` is a _function_ in Lua (as it is in Python 3). However, there are two cases where you can leave out the parentheses when calling a Lua function: you may pass a single value of either string or table type. So `myfunc{a=1,b=2}` is also fine. This little bit of 'syntactic sugar' comes from Lua's heritage as a data description language. @@ -155,7 +155,7 @@ `a.f` simply means 'look up f in a'. If the result is 'callable' then you can call it. A common pattern is to keep functions in tables, which is the approach taken by the standard libraries, e.g. `table.insert` etc. -`a:f` actually has no meaning on its own. `a:f(x)` is short for `a.f(a,x)` - that is, look up the function in the context of the object `a`, and call it passing an implicit `self` parameter. +`a:f` actually has no meaning on its own. `a:f(x)` is short for `a.f(a,x)` - that is, look up the function in the context of the object `a`, and call it passing the object `a` as the first parameter. Given an object `a`, it is a common error to call a method using `.`. The method is found, but the `self` parameter is not set, and the method crashes, complaining that the first parameter passed is not the object it was expecting. @@ -164,7 +164,7 @@ ### How are variables scoped? -By default, variables are global, and are local if they are function arguments or explicitly declared as `local`. (This is of course opposite to the Python rule.) +By default, variables are global, and are only local if they are function arguments or explicitly declared as `local`. (This is of course opposite to the Python rule.) G = 'hello' -- global @@ -288,7 +288,7 @@ Note a restriction on overloading operators like ==: both arguments must be of the same type. You cannot create your own `SuperNumber` class and get `sn == 0` to work, unfortunately. You would have to create an instance of `SuperNumber` called `Zero` and use that in your comparisons. -You can control the meaning of `a[i]` but this is not strictly speaking _overloading the [] operator_. `__index` fires when Lua cannot _find a key_ inside a table. `__index` can be set to either a table or to a function; objects are often implemented by setting `__index` to be the metatable itself, and by putting the methods in the metatable. Since `a.fun` is equivalent to `a['fun']`, there is _no way_ to distinguish between looking up using explicit indexing and using a dot. A naive `Set` class would put some methods in the metatable and store the elements of the set as keys in the object itself. But if `Set` a method 'set', then `s['set']` would always be true, even though 'set' would not be a member of the set. +You can control the meaning of `a[i]` but this is not strictly speaking _overloading the [] operator_. `__index` fires when Lua _cannot_ find a key inside a table. `__index` can be set to either a table or to a function; objects are often implemented by setting `__index` to be the metatable itself, and by putting the methods in the metatable. Since `a.fun` is equivalent to `a['fun']`, there is _no way_ to distinguish between looking up using explicit indexing and using a dot. A naive `Set` class would put some methods in the metatable and store the elements of the set as keys in the object itself. But if `Set` a method 'set', then `s['set']` would always be true, even though 'set' would not be a member of the set. The size operator and action when garbage-collected can be overriden by C extensions, not by plain Lua. But there is an undocumented function, `newproxy` which creates a little piece of 'userdata'. Here is a useful trick for writing a module finalization function: @@ -389,7 +389,7 @@ local x if a then x = b else x = c end -### Why no continue statement? +### Why is there no _continue_ statement? This is a common complaint. The reason that the Lua authors resist its inclusion is that it breaks the semantics for the `repeat..until` statement: @@ -416,7 +416,7 @@ Of course, we know that in large applications it is often better to let the error immediately break execution and then to catch it outside. This allows us to write code that is not so cluttered with conditional error checking. Lua does allow a function to be called in a protected environment using `pcall`. Wrapping up the code in an anonymous function gives us the equivalent to a `try/catch` construct: local status,err = pcall(function() - t.alpha = 2.0 -- will throw an error if t is nil or doesn't have a field alpha + t.alpha = 2.0 -- will throw an error if t is nil or not a table end) if not status then print(err) @@ -565,7 +565,7 @@ A new contender is [Squish](http://matthewwild.co.uk/projects/squish/home) which s a tool to pack many individual Lua scripts and their modules into a single Lua script, which can then be embedded using `srlua`. -### How do I load and run Lua code? +### How do I load and run (potentially untrusted) Lua code? The task is to execute some code that comes from a (possibly) untrusted source. @@ -816,7 +816,7 @@ Sometimes a [lexical scanner](http://penlight.luaforge.net/penlight.html#T21) gives a cleaner solution than pattern matching. This works particularly well if your 'complex structured text' is Lua or C code. -### Mathematical libraries like complex numbers, higher-precision arithmetic, matrices, etc? +### Are there mathematical libraries for complex numbers, higher-precision arithmetic, matrices, etc? There are several ways to bring complex arithmetic into Lua. [lcomplex](http://penlight.luaforge.net/packages/lcomplex.html) allows you to write code like this: @@ -1213,7 +1213,7 @@ Another approach is [LuaRocks](http://www.luarocks.org) which provides a cross-platform repository for downloading Lua packages. Like apt-get, it understands dependencies so that if you want LuaLogging it will also fetch LuaSocket; unlike apt-get, it works for Unix, OS X and Windows. -Another option is [LuaDist](http://luadist.sourceforge.net) which is pretty much an 'executable crticism' of LuaRocks. This may appeal to you if you're a fan of CMake. +Another option is [LuaDist](http://luadist.sourceforge.net) which is pretty much an 'executable criticism' of LuaRocks. This may appeal to you if you're a fan of CMake. ### What GUI toolkits are available? @@ -1221,7 +1221,7 @@ Probably the most full-featured and well-maintained binding is [wxLua](http://wxlua.sourceforge.net) -An easy and lightweight alternative for more casual scripting is [IUP](http://www.tecgraf.puc-rio.br/iup/); both IUP and wxLua are part of[Lua for Windows](http://luaforwindows.luaforge.net) but they have been ported to all major platforms. A little tutorial is available [here](http://penlight.luaforge.net/iupx). +An easy and lightweight alternative for more casual scripting is [IUP](http://www.tecgraf.puc-rio.br/iup/); both IUP and wxLua are available as part of [Lua for Windows](http://luaforwindows.luaforge.net) but are also available on their own. A little tutorial is available [here](http://penlight.luaforge.net/iupx). Here is a simple plotting program: @@ -1278,16 +1278,16 @@ [Lua-GD](http://lua-gd.luaforge.net) is a binding to the [gd](http://www.boutell.com/gd) library. GD is particularly useful for Web applications, since it creates output in common formats like PNG, JPEG or GIF. -[luagraph](http://luagraph.luaforge.net) is a binding to the Graphviz library, which allows you to analyze visualize complex graphs - that is, in the sense of a set of connected nodes. +[luagraph](http://luagraph.luaforge.net) is a binding to the Graphviz library, which allows you to visualize complex graphs - that is, in the sense of a set of connected nodes. This [simple interface](http://luaforge.net/projects/gnuplot) to gnuplot is useful if you are already somewhat familiar with this package and want to integrate it closer with your Lua code. ### How to interface to my C/C++ Libraries? -It is straightforward to bind Lua to C code, compared to say Python. One reason is that Lua only has one complex data type, so once you have learnt to manage tables from the C side, you have mostly mastered the art of binding to Lua. +It is straightforward to bind Lua to C code. One reason is that Lua only has one complex data type, so once you have learned to manage tables from the C side, you have mostly mastered the art of binding to Lua. -Arguments are taken off a stack, and return results are pushed on the stack, and the C function must return the number of items pushed. +Arguments are taken off the stack, return results are pushed on the stack, and the C function returns the number of items it intends to return to the caller. // build@ gcc -shared -I/home/sdonovan/lua/include -o mylib.so mylib.c // includes for your code @@ -1333,7 +1333,7 @@ LUALIB_API int luaopen_mylib(lua_State *L) { - luaL_openlib (L, "mylib", mylib, 0); + luaL_register (L, "mylib", mylib); return 1; } @@ -1357,7 +1357,7 @@ As a general rule, only go down to C if you have something that needs special optimization, or have an existing library that already does the job well. -Using the raw API is mostly straightforward, but can be tedious. There are several tools that will semi-automatically do the hard work for you, and they understand C++ as well. [tolua++](http://www.codenix.com/~tolua/tolua++.html) is an attractive solution because it can parse 'cleaned' C/C++ headers and generate the bindings. +Using the raw API is mostly straightforward, but can be tedious. There are several tools that will semi-automatically do the hard work for you, and they understand C++ as well. [tolua++](http://www.codenix.com/~tolua/tolua++.html) is an attractive solution because it can parse 'cleaned' C/C++ headers and generate the bindings. A very simple example: say we have a burning need for the C function `strstr`; given this file `lib.pkg`: @@ -1365,7 +1365,7 @@ then `tolua -o lib.c lib.pkg` will generate a binding file `lib.c` which can be compiled and linked against the `tolua` library. -`require 'lib'` may result in a suprise, since there is no table `lib` generated, only a global function `strstr`. To put the function into a tble `lib`, `lib.pkg` must look like this: +`require 'lib'` may result in a suprise, since there is no table `lib` generated, only a global function `strstr`. To put the function into a table `lib`, `lib.pkg` must look like this: module lib { --tKW2IUtsqtDRztdT-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 01:00:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E40k30002886; Fri, 14 Aug 2009 01:00:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8620419297; Fri, 14 Aug 2009 01:00:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE02C1928E for ; Fri, 14 Aug 2009 01:00:09 -0300 (BRT) Received: by ewy26 with SMTP id 26so1300992ewy.5 for ; Thu, 13 Aug 2009 21:00:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.60.3 with SMTP id i3mr281521eba.17.1250222408373; Thu, 13 Aug 2009 21:00:08 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> Date: Fri, 14 Aug 2009 00:00:08 -0400 X-Google-Sender-Auth: fcadbd5352146732 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 12, 2009 at 9:38 PM, Peter Cawley wrote: > The second part is for expanding expressions in expression lists. In > terms of pseudo code, this transforms expression lists like "e1, e2 > ..., e3, ..." into "e1, detuple(tuple(e2), e3, ...)", though tuple and > detuple are VM opcodes rather than functions. The TUPLE opcode takes 2 > or more stack values, copies them to a new tuple data array area of a > lua_State, and replaces them with a single value which points to the > new position of the values in the tuple array. The DETUPLE opcode > expands zero or more tuples back into the stack. One of the prototypical problems in [1] was to implement a function this: --Wraps a function with trace statements. function trace(f) return function(...) print("begin", f) local result = tuple(f(...)) print("end", f) return result() end end Could we add new keywords that correspond with the TUPLE/DETUPLE opcodes to achieve something like the above? [1] http://lua-users.org/wiki/VarargTheSecondClassCitizen From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 03:24:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E6OZWI015936; Fri, 14 Aug 2009 03:24:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DB961926D; Fri, 14 Aug 2009 03:24:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E18CE191D5 for ; Fri, 14 Aug 2009 03:24:01 -0300 (BRT) Received: by bwz10 with SMTP id 10so1073009bwz.5 for ; Thu, 13 Aug 2009 23:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4WvY4pDXWfaC/fe7zQ7nqxX5aVNOSm12kPCtK5e3hOQ=; b=XqboDtNoMaNM1UeLPIRTqQQ7WRvxM/647vceXlVvI7GiOstHZwzGkW5Ew0HQUJxkZu cCXEH+YQBei5vCRyVqCh/ruOzWLolGnr5mSrbRmgKzRZjdDyG7gETFKoDmS9Gzn8k3Cr hiSMDDd0onD53/UhS38RQGhMy3lOeaS9PuoFE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Fg/Y3Dxy0pv5sshaR5Xe1D7TK4SPaAh/5qPQFni9uuiztN1Qr4Y0rcceQrZLsqknWx WbCV+TXxazCAUHNoPKy0tqWlztLouRAtrVdyRxeXtCp6rVt2tDvhyghZzer0PEKEdid+ yy8Ihi1VIIQMDH73y+X7VRBB9liu/JP9WvKhk= MIME-Version: 1.0 Received: by 10.239.151.206 with SMTP id s14mr135700hbb.129.1250231039986; Thu, 13 Aug 2009 23:23:59 -0700 (PDT) In-Reply-To: <20090814003051.GE1825@aran> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> Date: Fri, 14 Aug 2009 08:23:59 +0200 Message-ID: <560972290908132323u862ff5aka6116d8a099364de@mail.gmail.com> Subject: Re: Some minor FAQ tweaks (a bit delayed). From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 2:30 AM, Etan Reisner wrote: Thanks, Etan: they look good. Except perhaps for this: > Fifteenth hunk, removes (an incorrect as far as I'm aware) reference to > porting history. The original: An easy and lightweight alternative for more casual scripting is [IUP](); both IUP and wxLua are part of[Lua for Windows]() but they have been ported to all major platforms. A little tutorial is available [here](). 'but they have been ported..' becomes 'but are also available on their own'. OK, that does _read_ better but AFAIK IUP and wxLua are cross-platform. According to [1], IUP has 3 ports, Motif,GTK+ and Windows. wxWidgets covers them all really [2] (there is even a Cocoa port for OS X, although still immature) I don't wish the sentence to give the impression that these are Windows-only toolkits. steve d. [1] http://www.tecgraf.puc-rio.br/iup/ [2] http://docs.wxwidgets.org/trunk/page_port.html From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 05:12:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7E8CjJn028516; Fri, 14 Aug 2009 05:12:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB9BA18BFD; Fri, 14 Aug 2009 05:12:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9355418A9B for ; Fri, 14 Aug 2009 05:12:07 -0300 (BRT) Received: by ewy26 with SMTP id 26so1387664ewy.5 for ; Fri, 14 Aug 2009 01:12:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.20.74 with SMTP id o52mr375695weo.147.1250237524945; Fri, 14 Aug 2009 01:12:04 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> Date: Fri, 14 Aug 2009 09:12:04 +0100 X-Google-Sender-Auth: 6f67c6111ca57f34 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7E8CjJn028516 On Fri, Aug 14, 2009 at 5:00 AM, David Manura wrote: > One of the prototypical problems in [1] was to implement a function this: > >  --Wraps a function with trace statements. >  function trace(f) >    return function(...) >      print("begin", f) >      local result = tuple(f(...)) >      print("end", f) >      return result() >    end >  end > > Could we add new keywords that correspond with the TUPLE/DETUPLE > opcodes to achieve something like the above? > > [1] http://lua-users.org/wiki/VarargTheSecondClassCitizen > In theory, yes, the new opcodes could be used to solve this problem. One approach would be to use something akin to the Lua 4.0 syntax for upvalues and prefix the variable name with a special symbol to show it has special usage: function trace(f) return function(...) print("begin", f) local %results = f(...) print("end", f) return %results end end In this situation, %name on the left hand side of an assignment, where name is the name of a local variable, creates a tuple. %name anywhere else destroys the tuple, yielding its values. If this syntax were to be adopted, it would carry several restrictions: * At any given scope level (i.e at any block, excluding its "child" blocks) there can exist a maximum of one tuple variable at any one time. * A tuple variable must be always be destroyed exactly once. * A tuple variable can only be destroyed at the scope level of its creation. * You cannot do anything with a tuple variable other than destroy it. * After a tuple has been destroyed, the local will contain nil. If some other syntax were adopted to solve this problem, it would have to carry similar restrictions to ensure that a TUPLE is always matched by a DETUPLE, that tuples are destroyed in reserve order to that in which they were created, and that a tuple is not used for anything except DETUPLE. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 07:13:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EAD7gs007023; Fri, 14 Aug 2009 07:13:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA76C192A1; Fri, 14 Aug 2009 07:12:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B26A919295 for ; Fri, 14 Aug 2009 07:12:34 -0300 (BRT) Received: from [93.172.62.142] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KOD00HPH30VQJB0@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Fri, 14 Aug 2009 13:12:31 +0300 (IDT) Date: Fri, 14 Aug 2009 13:12:32 +0300 From: Shmuel Zeigerman Subject: lua_tolstring and wide character strings To: Lua list Message-id: <4A853890.40707@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Recently I was manipulating wide character strings in a Lua library. Windows API assumes these strings to end with L'\0' which is represented as 2 successive zero bytes. The problem is, lua_tolstring guarantees only 1 zero byte at the end (according to the manual): > lua_tolstring returns a fully aligned pointer to a string inside the Lua state. This string always has a zero ('\0') after its last character (as in C), but can contain other zeros in its body. If I solve this by appending L'\0' to strings (which is expensive operation), then I have problems to lua_concat such strings. So I've a wish for Lua 5.2: "Make lua_tolstring guarantee 2 zero bytes at the string end". It seems that no noticeable overhead would be incurred, and no compatibility issues would arise. Please correct me if I'm wrong, or if better options exist. Thanks. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 07:28:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EASQ0q008421; Fri, 14 Aug 2009 07:28:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 468AB192B4; Fri, 14 Aug 2009 07:28:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86FCF19295 for ; Fri, 14 Aug 2009 07:28:02 -0300 (BRT) Received: by ewy26 with SMTP id 26so1454752ewy.5 for ; Fri, 14 Aug 2009 03:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=F8LEDfTEWZnjCq2RWcytyC4+1AGnmzelYchKApIjQb0=; b=tTU31zdb8q9S1tdNxoHlXLxdseDtD/iPg7H5uamSxDGKmAFYsMDQxk6TjWazvooH8r HBKy12aa9w3Ux+cNw1lEePNoc7uVH+sH/Sc6N3OcI6xYaCfkidNZ4TrWWJ2ZIkaaotvK 5P4AvFAwoWVB1xkeivlktne5vmjECs4YUWj9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=EsU/iMhjRU/HfkuXE8YN7AtU2zP87YGwWghhHbzqcBOGR9kgLCL8By3IOVXwQUpZ4A XIIO6DOEMwFqsOlDomVGFmEF0FkhnbRA9FpqeHlz46L0/1799XbPu3AdTDptNrU1Ievh /WUcERczkt5ygCyHlPlrEYk9c6PY4TiFEw/00= Received: by 10.210.127.4 with SMTP id z4mr2158030ebc.0.1250245680330; Fri, 14 Aug 2009 03:28:00 -0700 (PDT) Received: from ?95.78.88.163? ([95.78.88.163]) by mx.google.com with ESMTPS id 10sm3694032eyd.45.2009.08.14.03.27.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Aug 2009 03:27:59 -0700 (PDT) Date: Fri, 14 Aug 2009 14:27:52 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <85627281.20090814142752@gmail.com> To: Shmuel Zeigerman Subject: Re: lua_tolstring and wide character strings In-Reply-To: <4A853890.40707@013net.net> References: <4A853890.40707@013net.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Shmuel, Friday, August 14, 2009, 2:12:32 PM, you wrote: > Recently I was manipulating wide character strings in a Lua library. > Windows API assumes these strings to end with L'\0' which is represented > as 2 successive zero bytes. The problem is, lua_tolstring guarantees > only 1 zero byte at the end (according to the manual): i think that idea that you may hold utf-16 strings in Lua strings is wrong by itself. you should make specialized datatype -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 07:33:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EAXL4p008969; Fri, 14 Aug 2009 07:33:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84842192BD; Fri, 14 Aug 2009 07:33:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8869A192B7 for ; Fri, 14 Aug 2009 07:32:54 -0300 (BRT) Received: by bwz10 with SMTP id 10so1172044bwz.5 for ; Fri, 14 Aug 2009 03:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ANr9r3R6AhgupzSUE5VvRfvI+9wlUSeL9OM2GOIV2LA=; b=tuHgZTfykHTOewwrBeIfvbeCDzWnw4/1a785C0v15TuZl9r1RA2pvNWUKV+oDxhOUv 7iFX+np4xAuOQN/FJUVF8vre9BcRmFLZj/jgpLdyMoC61RtlzXQyvJqXjNmISiZ6sG7Z WXeIuRQlC1BWh9Vb03CZMfzdRoSjr4Bbjoyo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=oHImiNqTpem9YqZAVLNtIHVwb2g2ZfgaE7bqdBpyktQkMCJsYIXuVPwQhwofE7Uso9 IBUQjpwD5hzaVCnyIbbPlxieRW81Uz2i7jGbpw4fRdqDtuo5DgWlXw5+DOFAvXkMVhWB sbqFGt1AKEfQdlJokTF2G+zDdTpqeTRP7kixE= MIME-Version: 1.0 Received: by 10.223.122.141 with SMTP id l13mr512745far.99.1250245972855; Fri, 14 Aug 2009 03:32:52 -0700 (PDT) In-Reply-To: <4A853890.40707@013net.net> References: <4A853890.40707@013net.net> Date: Fri, 14 Aug 2009 11:32:52 +0100 Message-ID: <6a3ae47e0908140332u781aa1c7sa01c1bd5f1f52897@mail.gmail.com> Subject: Re: lua_tolstring and wide character strings From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=001636c59879180d7f04711793ea X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c59879180d7f04711793ea Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Aug 14, 2009 at 11:12 AM, Shmuel Zeigerman wrote: > Recently I was manipulating wide character strings in a Lua library. > Windows API assumes these strings to end with L'\0' which is represented as > 2 successive zero bytes. The problem is, lua_tolstring guarantees only 1 > zero byte at the end (according to the manual): > > lua_tolstring returns a fully aligned pointer to a string inside the Lua >> state. This string always has a zero ('\0') after its last character (as in >> C), but can contain other zeros in its body. >> > > If I solve this by appending L'\0' to strings (which is expensive > operation), then I have problems to lua_concat such strings. > > So I've a wish for Lua 5.2: > "Make lua_tolstring guarantee 2 zero bytes at the string end". > It seems that no noticeable overhead would be incurred, and no > compatibility issues would arise. > > Please correct me if I'm wrong, or if better options exist. > Thanks. > > -- > Shmuel > When processing "strings" that may contain non-ASCII data it is imperative you always only ever use the C API functions where you pass in the length of the buffer holding your "string"! Never rely on the C style terminating zero. Robby --001636c59879180d7f04711793ea Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Aug 14, 2009 at 11:12 AM, Shmuel= Zeigerman <shmuz@= 013net.net> wrote:
Recently I was manipulating wide character strings in a Lua library. Window= s API assumes these strings to end with L'\0' which is represented = as 2 successive zero bytes. The problem is, lua_tolstring guarantees only 1= zero byte at the end (according to the manual):

lua_tolstring returns a fully aligned pointer to a string inside the Lua st= ate. This string always has a zero ('\0') after its last character = (as in C), but can contain other zeros in its body.

If I solve this by appending L'\0' to strings (which is expensive o= peration), then I have problems to lua_concat such strings.

So I've a wish for Lua 5.2:
=C2=A0 =C2=A0"Make lua_tolstring guarantee 2 zero bytes at the string= end".
It seems that no noticeable overhead would be incurred, and no compatibilit= y issues would arise.

Please correct me if I'm wrong, or if better options exist.
Thanks.

--
Shmuel

When processing "strings" that may = contain non-ASCII data it is imperative you always only ever use the C API = functions where you pass in the length of the buffer holding your "str= ing"! Never rely on the C style terminating zero.

Robby

--001636c59879180d7f04711793ea-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 08:42:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EBgMda017207; Fri, 14 Aug 2009 08:42:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7187E192BA; Fri, 14 Aug 2009 08:41:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87043192BA for ; Fri, 14 Aug 2009 08:41:46 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n7EBfdb1007572; Fri, 14 Aug 2009 20:41:39 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay11.aps.necel.com with ESMTP; Fri, 14 Aug 2009 20:41:39 +0900 Received: from dhlpc061 ([10.114.113.123] [10.114.113.123]) by relay11.aps.necel.com with ESMTP; Fri, 14 Aug 2009 20:41:39 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 60E2552E240; Fri, 14 Aug 2009 20:41:39 +0900 (JST) From: Miles Bader To: Bulat Ziganshin Subject: Re: lua_tolstring and wide character strings References: <4A853890.40707@013net.net> <85627281.20090814142752@gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 14 Aug 2009 20:41:39 +0900 In-Reply-To: <85627281.20090814142752@gmail.com> (Bulat Ziganshin's message of "Fri, 14 Aug 2009 14:27:52 +0400") Message-ID: Lines: 16 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin writes: >> Recently I was manipulating wide character strings in a Lua library. >> Windows API assumes these strings to end with L'\0' which is represented >> as 2 successive zero bytes. The problem is, lua_tolstring guarantees >> only 1 zero byte at the end (according to the manual): > > i think that idea that you may hold utf-16 strings in Lua strings is > wrong by itself. you should make specialized datatype Exactly. -Miles -- "She looks like the wax version of herself." [Comment under a Paris Hilton fashion pic] From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 09:08:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EC8733020964; Fri, 14 Aug 2009 09:08:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63263192DE; Fri, 14 Aug 2009 09:07:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C3A8188EF for ; Fri, 14 Aug 2009 09:07:36 -0300 (BRT) Received: by bwz10 with SMTP id 10so1216905bwz.5 for ; Fri, 14 Aug 2009 05:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ey8XD6HvYadMM1D5I5H9Gj+aE+0hQXIuhtWmENBg3LA=; b=D3b856BXG1kJRy6iyTfKs610tt/yCFVq2RVxWQSV5YZF3v0/bX2qxztt2KAdSAvY4x zIAopbYuOhW1sMUdLLyJX3Swwk8ypjyVNrngEns1iNGwEZBtl+PAJIrGxReX9gUzwhSH CggFCpglWoRUFaVbMeqOdCE57feqP9sUpb0TQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Q0Zwo+o3sF0PSWb+twb+uGauDWDO6gmmY64cHv0GnhoMCoSEmfpoyf2IpVgMUEh+nC graQzRh21f30IAXsMZS9cddE+t20XWwj0Mgby/bWVkBWWM/MvQO6/fpDMe67zWrabPYe Tti5fTl+6U5ewuQUTMWc1edkooiNZ2lml/XVg= MIME-Version: 1.0 Received: by 10.239.182.149 with SMTP id q21mr150640hbg.32.1250251654764; Fri, 14 Aug 2009 05:07:34 -0700 (PDT) In-Reply-To: <20090814003051.GE1825@aran> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> Date: Fri, 14 Aug 2009 14:07:34 +0200 Message-ID: <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> Subject: Re: Some minor FAQ tweaks (a bit delayed). From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 2:30 AM, Etan Reisner wrote: > A number of these tweaks are simple spelling and grammar fixes the rest > are various tweaks which make things flow better, read better, sound > better, or explain better (at least if you ask me). Feel free to ignore > any changes you don't like. Cool, here's version 1.2: http://penlight.luaforge.net/FAQ It now has a section 7, the C API. Since I don't consider myself an expert, I would like some feedback on this. (In particular, I may have committed the sin of Original Research at the end) More questions, common and/or revealing, are needed! It would be cool if the code was syntax-colorized. Any suggestions? On mature reflection, the FAQ can probably be condensed into the following micro-summary: 1. Lua is easily extended and embeddable. 2. Lua is not Python, neither is it C. 3. Read Roberto's book. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 09:28:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ECS86X023811; Fri, 14 Aug 2009 09:28:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB5F9192EE; Fri, 14 Aug 2009 09:27:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7D60192E9 for ; Fri, 14 Aug 2009 09:27:31 -0300 (BRT) Received: by qyk34 with SMTP id 34so1114604qyk.33 for ; Fri, 14 Aug 2009 05:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=oxuXidMPkupSn98DC5chLdho/IcHKNxr77YX13LTkIg=; b=J/JUrR/L83aNo44Aig8NeZawPr293pKKYO/fRECFl5hx2jp/OW5A8ky+XkFa1i8C10 yaEq2AkvwmFW5aW/s4GKi3nLXNS5DrpyEjV89pE41F2MhscBvfao58ZQ44G7t5hD58aV m20AnNDVn+yxPw/zA0lqGcs911dO8jq6+epnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JO9bnL8GGjjryBTJxGWtIbH6PqMWHNIr4uWbKoSFJwXteR0RwbYX6mUtDuaFKY2XaC 2d/hyquehvrUgYSyBnn06I2DW7Z5KIMaIev3/Y9/XGPeFSMfM4pyewVc1VSBZZO23Gp6 OoJ04ZoFW8m9v8Q+4JrrAC4WcEfm9/khJmn1A= Received: by 10.224.102.212 with SMTP id h20mr2213392qao.40.1250252850008; Fri, 14 Aug 2009 05:27:30 -0700 (PDT) Received: from ?192.168.0.102? ([75.68.47.100]) by mx.google.com with ESMTPS id 2sm3355925qwi.23.2009.08.14.05.27.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 Aug 2009 05:27:29 -0700 (PDT) Message-Id: <33196254-020E-4A36-8FCE-50575F737A74@gmail.com> From: Doug Currie To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: ... as an "expand list" unary postfix operator Date: Fri, 14 Aug 2009 08:27:27 -0400 References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 14, 2009, at 12:00 AM, David Manura wrote: > One of the prototypical problems in [1] was to implement a function > this: > > --Wraps a function with trace statements. > function trace(f) > return function(...) > print("begin", f) > local result = tuple(f(...)) > print("end", f) > return result() > end > end > > Could we add new keywords that correspond with the TUPLE/DETUPLE > opcodes to achieve something like the above? > > [1] http://lua-users.org/wiki/VarargTheSecondClassCitizen Would this work? function trace (f) return function(...) print("begin", f) local function vals(...) print("end", f) return(...) end vals(f(...)...) end end e From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 09:29:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ECSqUX023947; Fri, 14 Aug 2009 09:28:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF32D192F8; Fri, 14 Aug 2009 09:28:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF314192F0 for ; Fri, 14 Aug 2009 09:28:26 -0300 (BRT) Received: by ewy26 with SMTP id 26so1519919ewy.5 for ; Fri, 14 Aug 2009 05:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=TipV+I3PH3h3Gi/BZmtDV15vLW56wcCL2USTArfrfto=; b=YHK1LP9RbsR5EC05/3hrOYWnQZuJR9ZIWJDWiI7ArM4YARHelJu+6xbv4Vukt/k2PH NvpAfoFpUMGRV/AjDPQ6eAluCifJILpiZnUp5nlzUIxXhc+Jm6e/36sPZ7ILziDMYEUz +1VeGaYUXHx4kY+8NsOAS9o5nmelIuq275P3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PWjKlx3F3vKlxwbKis5k2BG/kCGCx4r3h/s2h2UYIszLwpqmMZX1KMhq5/GM2DJEAx aOkwkDntvQoLqPV44gbAfiqKYwu9x/lIlm9VJDf7bt0LAvGMEkzpMyGSoRBlvUqJhlUj g4Ux7+dwlhndjXKa9g7rjpnUu65dfOJFeM1lI= MIME-Version: 1.0 Received: by 10.216.70.134 with SMTP id p6mr412620wed.40.1250252904189; Fri, 14 Aug 2009 05:28:24 -0700 (PDT) In-Reply-To: <4A853890.40707@013net.net> References: <4A853890.40707@013net.net> From: Jerome Vuarand Date: Fri, 14 Aug 2009 14:28:04 +0200 Message-ID: <89d273ba0908140528q496359f3oc4b96c147098499f@mail.gmail.com> Subject: Re: lua_tolstring and wide character strings To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/14 Shmuel Zeigerman : > Recently I was manipulating wide character strings in a Lua library. Windows > API assumes these strings to end with L'\0' which is represented as 2 > successive zero bytes. The problem is, lua_tolstring guarantees only 1 zero > byte at the end (according to the manual): > >> lua_tolstring returns a fully aligned pointer to a string inside the Lua >> state. This string always has a zero ('\0') after its last character (as in >> C), but can contain other zeros in its body. > > If I solve this by appending L'\0' to strings (which is expensive > operation), then I have problems to lua_concat such strings. > > So I've a wish for Lua 5.2: > "Make lua_tolstring guarantee 2 zero bytes at the string end". > It seems that no noticeable overhead would be incurred, and no compatibility > issues would arise. > > Please correct me if I'm wrong, or if better options exist. AFAIK there is little reason to use UTF-16 in Lua rather than UTF-8. With UTF-8 most string library functions can be used to some extent. There are nice functions in the win32 API to convert from UTF-8 to UTF-16 and back : MultiByteToWideChar and WideCharToMultiByte. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 09:29:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ECToiQ024171; Fri, 14 Aug 2009 09:29:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D9D119303; Fri, 14 Aug 2009 09:29:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6D93192FE for ; Fri, 14 Aug 2009 09:29:23 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so270973eye.11 for ; Fri, 14 Aug 2009 05:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CUky6tKWDXG63tFWQQX6MrxPztEV0z/A/rMJGUKbw+w=; b=Rp61FglPgWHchAChup+ZrFZkD92sTTub6RQlLI9+QxvohcrJVOw7fFBsroIj345wN8 4eB8rFsOXKtyMFDhkui0NyqnLCvrHEuLeEptMOsd1RGJj5WJbhU8wvYc1CWUOuBimkhr WUTRIkPF730nPK1C40UbOTNZxHOxRvieTPACY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=G8EjzJAzyDS5F8kuWahaVlEZWbRuVi5rp1aQhtitVVezxYGsNvJbjTf1ovQ1sjGtgU q8JHm0D5r+kDEAu1W9btjsqCJBcvPmh6VJ/oNljP9+z1C12VNB0DR8zxmJvOQSg1trlI PaTUkf+veWkcKx6UvlyeIC3u954FvEgRhaERc= MIME-Version: 1.0 Received: by 10.216.20.197 with SMTP id p47mr408568wep.13.1250252962346; Fri, 14 Aug 2009 05:29:22 -0700 (PDT) In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <560972290908130500l18dacb30l8da5416371242e80@mail.gmail.com> Date: Fri, 14 Aug 2009 13:29:22 +0100 Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 13, 2009 at 5:09 PM, Peter Cawley wrote: > Should now be fixed. Yes, indeed. I am slightly humbled by how quickly someone picked this up and ran with it! Not really a bug, but I did notice a minor inconsistency (if you're busy, I wouldn't bother updating the patch for it): > function multivalues() return 1,2,3; end > print( unpack{multivalues()...} ) 1 2 3 > print( multivalues()... ) stdin:1: Cannot expand last expression in a list, as it is already expanded near ')' In the "array elements" context it ignores ... on the final element, while in the "expression list" context, it throws an error. In my opinion, both cases should ignore it - that seems more Lua-ish, a bit like ignoring the final comma/semicolon in a table constructor. However, I feel the opposite way about a very similar inconsistency: > print( unpack{"a"..., "b"} ) a b > print( "a"..., "b" ) stdin:1: Cannot expand fixed-length expression near '"b"' It seems correct to me to always throw an error when someone tries to expand what is known to be a fixed-length expression. -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 10:12:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EDC9sX000804; Fri, 14 Aug 2009 10:12:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA58192F3; Fri, 14 Aug 2009 10:11:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FA61192B9 for ; Fri, 14 Aug 2009 10:11:34 -0300 (BRT) Received: by ewy26 with SMTP id 26so1547077ewy.5 for ; Fri, 14 Aug 2009 06:11:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.147 with SMTP id e19mr437689wef.96.1250255492103; Fri, 14 Aug 2009 06:11:32 -0700 (PDT) In-Reply-To: <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> Date: Fri, 14 Aug 2009 14:11:31 +0100 X-Google-Sender-Auth: 6a789c68b6cbae0e Message-ID: Subject: Re: Some minor FAQ tweaks (a bit delayed). From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 1:07 PM, steve donovan wrote: > It would be cool if the code was syntax-colorized. Any suggestions? I've got some Lua code which uses LPEG to tokenise C and then syntax colours it for HTML output: http://codepad.org/1RREka9a It wouldn't be too hard to plug in an LPEG Lua tokeniser and appropriate highlighting rules to do it for Lua code too. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 10:31:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EDVjVd004537; Fri, 14 Aug 2009 10:31:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 597A4192F9; Fri, 14 Aug 2009 10:31:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8470A192E2 for ; Fri, 14 Aug 2009 10:31:17 -0300 (BRT) Received: (qmail 12059 invoked by uid 399); 14 Aug 2009 07:31:15 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 14 Aug 2009 07:31:15 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4A856725.4080702@workspacewhiz.com> Date: Fri, 14 Aug 2009 07:31:17 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: lua_tolstring and wide character strings References: <4A853890.40707@013net.net> In-Reply-To: <4A853890.40707@013net.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Shmuel Zeigerman Date: 8/14/2009 4:12 AM > Recently I was manipulating wide character strings in a Lua library. > Windows API assumes these strings to end with L'\0' which is > represented as 2 successive zero bytes. The problem is, lua_tolstring > guarantees only 1 zero byte at the end (according to the manual): > > Please correct me if I'm wrong, or if better options exist. You might try LuaPlus (http://luaplus.org/) which has real wide character string support. Be sure to grab the Subversion build from svn://svn.luaplus.org/LuaPlus/work51. If you would like to merge it into your Lua, look for #ifdef'ed blocks of LUA_WIDESTRING and LUA_WIDESTRING_FILE. Josh From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 10:39:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EDdSY9006270; Fri, 14 Aug 2009 10:39:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BC4B19307; Fri, 14 Aug 2009 10:39:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E996C192ED for ; Fri, 14 Aug 2009 10:39:02 -0300 (BRT) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EDcwRP006141 for ; Fri, 14 Aug 2009 10:39:01 -0300 From: "Antonio Scuri" To: "'Lua list'" Subject: [ANN] LuaGL 1.3 Released Date: Fri, 14 Aug 2009 10:38:32 -0300 Message-ID: <000f01ca1ce4$85a5b070$90f11150$@puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acoc5ILMeQ/GXH13RKWNxKf51OLZGQ== Content-Language: pt-br x-cr-hashedpuzzle: AaxA AtQB Awhn CgXn Damm Dh2Y D8eC EFg2 EmM+ HOnC Hh79 H17H IiOX IzjG LDYJ LEp1; 1; bAB1AGEAQABiAGEAegBhAHIAMgAuAGMAbwBuAGUAYwB0AGkAdgBhAC4AYwBvAG0ALgBiAHIA; Sosha1_v1; 7; {DBCFEEDA-BB7F-491E-9BD8-A72A05720F8C}; cwBjAHUAcgBpAEAAdABlAGMAZwByAGEAZgAuAHAAdQBjAC0AcgBpAG8ALgBiAHIA; Fri, 14 Aug 2009 13:38:30 GMT; WwBBAE4ATgBdACAATAB1AGEARwBMACAAMQAuADMAIABSAGUAbABlAGEAcwBlAGQA x-cr-puzzleid: {DBCFEEDA-BB7F-491E-9BD8-A72A05720F8C} X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Hi All, LuaGL 1.3 has been released. This is a derivation from the LuaGL available in SourceForge. It was already included in LuaBinaries but now there is an official website with some pre-compiled binaries at LuaForge: http://luagl.luaforge.net In this version there are several fixes in the documentation, a correction in gl.ReadPixels, some GLU functions, and new functions to support raw data images. Best Regards, Antonio Scuri From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 11:31:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EEV8I9018947; Fri, 14 Aug 2009 11:31:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F9601930A; Fri, 14 Aug 2009 11:30:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94C45192FB for ; Fri, 14 Aug 2009 11:30:28 -0300 (BRT) Received: by ywh26 with SMTP id 26so2022329ywh.5 for ; Fri, 14 Aug 2009 07:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=trgr09dFiAplmFk4Mwy3ef/Brh4agsG4VDOr1ZA8ekc=; b=g+vKJKJZaULJEwZsT4HuAcrfGrAjDSr1rD/KAuFVvAipqy0KQjv/PoPEqSSv862wK+ V8SGFNf3wNhYlcWMXvUN1zTVrtHgZWtKKFaX4T2RDB6XjK9ONGBNy0HkjW5hzuncbheT 1XVDO+1wIxT/WTt3MQPVpeXcriLfs4W/obtJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Y/1daUhzF5PheXMsvWaD2WmQpmjafj7e3zZ/OwaRvDSzDEDjBvFXglnKFwp3idP75T bP03uniIxITyP9nLBvKQ3YkpxI1sFXq8DzPtoOr7YSAHuaNU+xoLKjoI7cqMi/u/Vcmz MfOmRlRH7DnmsEs4kRD+WNCqgof4Foxh38tx0= MIME-Version: 1.0 Received: by 10.100.164.20 with SMTP id m20mr1231629ane.142.1250260227151; Fri, 14 Aug 2009 07:30:27 -0700 (PDT) In-Reply-To: <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> Date: Fri, 14 Aug 2009 10:30:27 -0400 X-Google-Sender-Auth: b186625a7e12e2bf Message-ID: Subject: Re: Some minor FAQ tweaks (a bit delayed). From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7EEV8I9018947 > It would be cool if the code was syntax-colorized. Any suggestions? The easiest way to do this is using a Java Script library, letting the syntax highlighting happen on the client side. There are many different ones available. Not all support Lua, but some do. Sérgio Medeiros and I recently wrote a Lua plugin for Alex Gorbatchev's SyntaxHighlighter (http://alexgorbatchev.com/wiki/). Here is a quick demo: http://spu.tnik.org/en/Syntax_Highlighting The code is at: http://gitorious.org/sputnik/mainline/blobs/master/syntaxhighlighter/original/scripts/shBrushLua.js There is also a Lua module that encapsulates SyntaxHighlighter for anyone is interested in integrating it into a Lua web application. (The Lua module basically gives you a function for generating customized JavaScript that you can then serve to the client - handy if you want _all_ of your requests to be answers by Lua.) We can release it as a rock if there is interest. - yuri From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 11:38:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EEcK8L021429; Fri, 14 Aug 2009 11:38:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FBC519318; Fri, 14 Aug 2009 11:37:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp142.mail.mud.yahoo.com (smtp142.mail.mud.yahoo.com [209.191.107.125]) by bazar2.conectiva.com.br (Postfix) with SMTP id A1FCB19308 for ; Fri, 14 Aug 2009 11:37:52 -0300 (BRT) Received: (qmail 14917 invoked from network); 14 Aug 2009 14:37:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent; b=RrVLXXfHVIPY65wHkTAdChRrHJ1K9CgtlFa/eBWTuarGbugUfsdDsy1HkwclZvN6EwtkrMSRPFbGYjihubbL0H1oFG3GdBZrgTFAHL9QrWydFHa/HznuP4RnmsHi5S20UZVb1KASBxNcPEXlRuFlSezfZ2ycw3ZCBPpu3upcbg4= ; Received: from unknown (HELO alfa) (wtxnh-lua@80.74.167.115 with login) by smtp142.mail.mud.yahoo.com with SMTP; 14 Aug 2009 14:37:49 -0000 X-Yahoo-SMTP: QXpZGM6swBCFZg0hw_JKmxWlXNHQTUK3uyWTJwxOj2o14bGZwOzz X-YMail-OSG: S2lfPpMVM1mjya4C9HRMY6WF_PQ5QqSmJpARuMkiwTclzT3gLBQA1SuPlHXjugXg1ddMuGgV06UODxF.4uybO36OlA9FNVK0W.erdRXGrodSVBl2C1AQvAA17IujNzHfVXeRuNdnA3uxidJ1NcFiz.j7uTXJxl0aFx3x96MT3s4HYyf7NdSdW8n3SWlfQx_mftDiIZ3Fzoq8FtlyuehV2gJYCAnzhB9YRk9eH8CQd12OrOYggb.q0x60nilZG0kBKP_uzokX0E2Pq4mc X-Yahoo-Newman-Property: ymail-3 Received: by alfa (Postfix, from userid 1001) id 2C2718157D; Fri, 14 Aug 2009 16:31:44 +0200 (CEST) Date: Fri, 14 Aug 2009 16:31:44 +0200 From: Martin To: Lua list Subject: lua-gtk pixmap example Message-ID: <20090814143144.GB2704@alfa.qvirt.zxc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have managed to understand pixmap.lua example in lua-gtk-0.8 and now I want to do some changes to it but I am clueless. 3BI want to draw rectangle in different color and change font to Courier. I have been reading gtk reference manual for C whole day but did not find a way to do it (I am new to gtk too). There I found description for GdkGC, GdkColormap and GdkColor and I got totally lost there. Can somebody show me how to modify pixmap.lua example so that it use custom color (red=100, green=150, blue=200) for drawing rectangle and changing font family and size (and color)? Thanks Martin From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 12:03:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EF2x7f026575; Fri, 14 Aug 2009 12:02:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F038E1931B; Fri, 14 Aug 2009 12:02:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7529C192CC for ; Fri, 14 Aug 2009 12:02:19 -0300 (BRT) Received: by ewy26 with SMTP id 26so1628512ewy.5 for ; Fri, 14 Aug 2009 08:02:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.138.3 with SMTP id l3mr3319931ebd.20.1250262136741; Fri, 14 Aug 2009 08:02:16 -0700 (PDT) Date: Fri, 14 Aug 2009 17:02:16 +0200 X-Google-Sender-Auth: 966ee39f886e597b Message-ID: Subject: [ANN] lua-Coat 0.2.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), a Perl module which mimics Moose (http://www.iinteractive.com/moose/), an object system for Perl5 which borrows features from Perl6, CLOS (LISP), Smalltalk and many other languages. The main features are : Classes, Roles & type constraints. The attribute declaration with many properties is the most powerful and flexible part of lua-Coat. The homepage is at http://lua-coat.luaforge.net/, and the sources are hosted at http://github.com/fperrad/lua-Coat/. Thanks, Francois Perrad. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 12:15:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EFFiT0028835; Fri, 14 Aug 2009 12:15:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B6F819320; Fri, 14 Aug 2009 12:15:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34BDC19313 for ; Fri, 14 Aug 2009 12:15:15 -0300 (BRT) Received: by bwz10 with SMTP id 10so1328881bwz.5 for ; Fri, 14 Aug 2009 08:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5JacNTEzGqWcfsvsZgUat8NuFssFsNBVACO/LV8jJek=; b=flmO55s+fWAYiW9yVfjZRa5tty0wDRofxA4NfuAK3Wv1o7S6iOF1eylvWVOt6EJgCB YxUJFJljItvJ8rQfNXlaK+37PsS8D3PyJ+VG6Rzi+IwfrNIS9iylDDZabl5ni+5PZjC9 xLrsbJ5f5oQ9u+Va8g/5QTd+cAjnMN6kBhkTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rIBASa5yZGJmr2R6KIyp8fabGfvjPp7ZcLKG8oV/uiEyiFPU2yF0bbajCJHGEshFnW ROjtSkQqB0k/Gg9ijBVsXUNY9SDmTwhbMzjGgWAEYnjYTWcBD1W94U6ACBqQ1RM5+KdP fNUFYnOu8vR9CKEobOFvA2I+VyIHou+YK7uYQ= MIME-Version: 1.0 Received: by 10.223.54.15 with SMTP id o15mr563092fag.96.1250262913687; Fri, 14 Aug 2009 08:15:13 -0700 (PDT) In-Reply-To: <20090810003643.GA17119@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> Date: Fri, 14 Aug 2009 19:15:13 +0400 Message-ID: Subject: Re: LuaJIT performance From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 10, 2009 at 04:36, Mike Pall wrote: > Alexander Gladysh wrote: >> I, personally, am interested in LJ2 for iPhone (which is ARM-based). >> As I intend to reuse existing (x86) game logic code on it, I would >> need floating point support. > Ok, but you may be in for a nasty surprise: the 3GS has an ARM > Cortex-A8 CPU which only has VFPlite. This is actually a step back > from the previous models which had an ARM 1176JZ(F)-S with a full > VFP unit. And since the vector mode of VFP is officially deprecated, > you're in for more surprises in the future. Ugh, that is not nice. > Not to squash your hopes, but I suggest you try to measure whether > the iPhone FP performance can keep up with your requirements. > Maybe try some simple double-precision FP benchmarks in C (don't > compile as Thumb code or you get softfp). Well, while I do need floating point support for my Lua code to work properly, it is not that computationally expensive. Actually, plain Lua interpreter seems to be fast enough for my current needs. But I'd like to be able to stuff even more logic in it in future -- so some JIT-ting should be quite handy. <...> > Thank you to both of you for the quick feedback! You're welcome! Alexander. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 12:26:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EFQHQH031042; Fri, 14 Aug 2009 12:26:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3882E19302; Fri, 14 Aug 2009 12:25:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77FAE192C6 for ; Fri, 14 Aug 2009 12:25:48 -0300 (BRT) Received: by bwz10 with SMTP id 10so1335100bwz.5 for ; Fri, 14 Aug 2009 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UW7oTbrah/Gu/xu2ZAFJw0sWymBfTxEEQV3KaXeCTAY=; b=pQ6qJ4ccrRbSeZd0KmieN7HnU7WOgaBuVAP4jbMPmJbeiE3sjaqo4NmHAVHWWQzMJB DUIkg2jNl50dJWYOAaMRMe18YVdiDKMnPbJZVrA/MmMcpl5MxFAx0VGeqc1RVd1SuGVd 18AxazWMTjKC7oW7IU8SpklYAeqHkQ0uwAnyw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dVEln92QGcSE117TWGNVLVj5HCeACr2rA4cQekUqNoqfHfDSA/YG3781tnhFI1AD84 q98kNPu/znf1iec0K09GnnAg9hWMydz+d/RjQHClUhCie/rZM9MODf/0S53xhdQ1zlcw Jdg1I2+eE9UutFNgFwt8mVAL/O0whXj5nAINo= MIME-Version: 1.0 Received: by 10.223.72.203 with SMTP id n11mr545734faj.62.1250263546733; Fri, 14 Aug 2009 08:25:46 -0700 (PDT) In-Reply-To: <20090810013307.GA18673@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> Date: Fri, 14 Aug 2009 19:25:46 +0400 Message-ID: Subject: Re: LuaJIT performance From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 10, 2009 at 05:33, Mike Pall wrote: > Alexander Gladysh wrote: >> You've said there is no ETA yet for x86, but, perhaps, you may share >> some information on the amount of work left to do? > Well, I'm already cutting corners everywhere wrt. features for the > first alpha. But issues with correctness and completeness keep me > busy (the coordination between the JIT code and the GC is currently > a minefield). Do you consider to release a test suite along with LJ2? > And the code needs to be cleaned up a lot before it's > ready for public consumption. Then I'll need to work on the > packaging, the docs, the web site reorganization and so on ... If the community may help you anyhow, please do not hesitate to ask. I'm sure we'll be able to lend a hand with routine tasks at least. > Thankfully I've recently removed the last major stumbling block > (better trace linking) and the benchmark results demonstrate that > going for a trace compiler was a sound design decision after all. That is good to hear! > But I have to say it was an expensive decision: I've considerably > underestimated the amount of research and trial-and-error which > was needed to convert a research toy into a production compiler. > There are some important implementation details which the few > papers about trace compilers completely fail to mention ... :-| Perhaps that is the reason to write one yourself someday? ;-) Alexander. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 12:30:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EFUlpx032096; Fri, 14 Aug 2009 12:30:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F8FC1932A; Fri, 14 Aug 2009 12:30:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F8DC19324 for ; Fri, 14 Aug 2009 12:30:21 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MbyjM-0005hc-Ak for ; Fri, 14 Aug 2009 16:30:12 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MbyjT-0008Tw-Ay for lua@bazar2.conectiva.com.br; Fri, 14 Aug 2009 16:30:20 +0100 Date: Fri, 14 Aug 2009 16:30:18 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: LuaJIT performance Message-ID: <20090814163018.7b4200a1@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090810003643.GA17119@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 10 Aug 2009 02:36:43 +0200 Mike Pall wrote: > Ok, but you may be in for a nasty surprise: the 3GS has an ARM > Cortex-A8 CPU which only has VFPlite. This is actually a step back > from the previous models which had an ARM 1176JZ(F)-S with a full > VFP unit. And since the vector mode of VFP is officially deprecated, > you're in for more surprises in the future. Have you got a citation for this? My guy inside ARM is of the opinion that NEON is a /superset/ of VFP, and that there are three types for VFP; none, partial, and full. Nothing on the market implements full, and partial is only missing a handful of instructions. B. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 13:00:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EG0axY005725; Fri, 14 Aug 2009 13:00:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28B4E1933A; Fri, 14 Aug 2009 13:00:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C3A519328 for ; Fri, 14 Aug 2009 12:59:55 -0300 (BRT) Received: by ywh26 with SMTP id 26so2107138ywh.5 for ; Fri, 14 Aug 2009 08:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=M2FeWV13wgslVrj/Ix4JIQb13PpanRvJozTy8lrkZ0Q=; b=b/A2z5vOpOxvPe6prpAVevl5bWY6S7eH1H4QL0DX+XW8ivrxKFKIqnZcL3sKdKWACu 3dE3ELzaMIx7ckM2gLciYyUcoaRLyDHNMwa8NzOPZlw0+aQB9zQxF6u0oMdFe/Q/xpRF 4qtnACWVS0dI00uTJ/ouCevBp9hRgLb+737r0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=fepyZDfekIzmPB6RDDH9PUeUjaDSjBoeXU+Xz/Tu6K0GuCY0OCIcCEORaRMrl2hcYO JQ0CBQf3tZZIEG0Rcc5yl6Xgi5kbzwmTGyGjMcW0gAoX7w1Q6k3/ydnZsv3NMPza6WYz jaQIRq5QzNtjagORF3SRGal1GERE+y+k1ylW8= MIME-Version: 1.0 Received: by 10.100.3.13 with SMTP id 13mr1885750anc.29.1250265592415; Fri, 14 Aug 2009 08:59:52 -0700 (PDT) Date: Fri, 14 Aug 2009 11:59:52 -0400 X-Google-Sender-Auth: ff7706f5bb7986c4 Message-ID: Subject: a dissertation dealing with Lua (in part) From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean As I've mentioned a couple of times before on this list, I spent the last few years working on a dissertation about software developers in Rio, which has a few chapters dedicated to Lua (2.2, 2.3, a part of 1.2 plus additional mentions here and there). The dissertation is now finished, and if anyone is interested, you can look at it at http://takhteyev.org/dissertation/ Just to be clear, the dissertation deals with the social side of Lua (and software development more broadly). The technical issues are discussed only on a very basic level and only when absolutely necessary. Many thanks to the people who have offered their time! Comments and questions are welcome. Given the length, don't feel you need to "RTFD" before volunteering comments. (Consider, though, whether a private discussion may be more appropriate than emailing the list.) - yuri From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 13:04:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EG4RUB006788; Fri, 14 Aug 2009 13:04:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 704B219347; Fri, 14 Aug 2009 13:03:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7625319328 for ; Fri, 14 Aug 2009 13:03:53 -0300 (BRT) Received: by ewy26 with SMTP id 26so1674468ewy.5 for ; Fri, 14 Aug 2009 09:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=7fAcOycIPVyaBVPU28O11tVL2Ud1tqGBDYwNZxalE3A=; b=RyNh7Kc/DrXJlylQPU88l89o1/Dc7vaPx6jOX4D/KuVITtGQHxhnkdpCcoO8T9kufl fiuC9GrSLT4c+WcUJg4Jn3B/RDeBYwgo7ZB1Sm/A3qlK2gvPabGXTNGpvIqJKNVCmzMm gok04O4wayQeaVQbZlq13aRHcYXKa7Bq06G44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=t1j2GM6J1TbDbMiIBwytiIbBdqnx7ABFh0CnTY1zQL+17+XrPhZwBwACNQ+bueP4pi Vd89l0wU3nu9DzKxL82JBU8xdUMGwQghsiGXyDHW/yUpeSybY+oQ6JW8Ii1kYmAW+c+e 2pL/v+t/DnURnlyhzTcFACTzi4JpbDpOEvnF0= MIME-Version: 1.0 Received: by 10.216.89.20 with SMTP id b20mr430588wef.61.1250265830410; Fri, 14 Aug 2009 09:03:50 -0700 (PDT) In-Reply-To: <20090814163018.7b4200a1@trite.i.flarn.net.i.flarn.net> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> <20090814163018.7b4200a1@trite.i.flarn.net.i.flarn.net> From: Jerome Vuarand Date: Fri, 14 Aug 2009 18:03:30 +0200 Message-ID: <89d273ba0908140903i574b9c20j11ff35017601e805@mail.gmail.com> Subject: Re: LuaJIT performance To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/14 Rob Kendrick : > On Mon, 10 Aug 2009 02:36:43 +0200 > Mike Pall wrote: > >> Ok, but you may be in for a nasty surprise: the 3GS has an ARM >> Cortex-A8 CPU which only has VFPlite. This is actually a step back >> from the previous models which had an ARM 1176JZ(F)-S with a full >> VFP unit. And since the vector mode of VFP is officially deprecated, >> you're in for more surprises in the future. > > Have you got a citation for this? My guy inside ARM is of the opinion > that NEON is a /superset/ of VFP, and that there are three types for > VFP; none, partial, and full. Nothing on the market implements full, > and partial is only missing a handful of instructions. In [1] you can read: "The VFPLite coprocessor supports all data-processing instructions and data types in the VFPv3 architecture and is described in the ARM Architecture Reference Manual, Advanced SIMD Extension and VFPv3 supplement." But maybe there are non-"data-processing" instructions in VFPv3 that are missing, or Mike refered to another VFP specification. [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344b/I1019986.html From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 13:17:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EGHFZN009680; Fri, 14 Aug 2009 13:17:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AD7C19329; Fri, 14 Aug 2009 13:16:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C55C189C3 for ; Fri, 14 Aug 2009 13:16:42 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MbzSJ-00064j-00; Fri, 14 Aug 2009 18:16:39 +0200 Date: Fri, 14 Aug 2009 18:15:59 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090814161559.GA15891@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <20090809184721.d1f829a7.tmueller@schulze-mueller.de> <20090810003643.GA17119@mike.de> <20090814163018.7b4200a1@trite.i.flarn.net.i.flarn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090814163018.7b4200a1@trite.i.flarn.net.i.flarn.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > > Ok, but you may be in for a nasty surprise: the 3GS has an ARM > > Cortex-A8 CPU which only has VFPlite. This is actually a step back > > from the previous models which had an ARM 1176JZ(F)-S with a full > > VFP unit. And since the vector mode of VFP is officially deprecated, > > you're in for more surprises in the future. > > Have you got a citation for this? My guy inside ARM is of the opinion > that NEON is a /superset/ of VFP, and that there are three types for > VFP; none, partial, and full. Nothing on the market implements full, > and partial is only missing a handful of instructions. NEON can only do *single precision* floating-point. But we need *double precision* floating-point operations for Lua (and for JavaScript, too). Only VFP can do double-precision. So in that sense NEON is certainly not a superset of VFP. The more important difference between the different VFP versions is that VFPlite is non-pipelined and has rather high latencies. Actually it looks like they've purged the term VFPlite from their product literature -- can't imagine why. :-) The Cortex-A8 in the iPhone 3GS definitely only has non-pipelined VFP. Someone found that out the hard way: http://diaryofagraphicsprogrammer.blogspot.com/2008/11/iphone-arm-vfp-code.html#c7064614874794429950 Note that this was comparing single-precision FP performance (yes, you should use NEON for that). But it only gets worse with double-precison FP. I've already said that softfp suddenly looks like an attractive option. About the vector part of VFP being deprecated: http://forums.arm.com/index.php?showtopic=13053&pid=31161&st=0&#entry31161 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204i/Chdehgeh.html Quoting: "The use of VFP vector mode is deprecated ..." Well, not that this was a particular useful feature. The VFP vector mode is not true SIMD. It's about quickly issuing multiple operations in succession. But turning it on and off involved a pipeline flush and programming it was quite tricky. I guess it wasn't popular outside of handcoded assembly. Given the sad state of floating-point support for ARM devices in the past, it's about time they get their act together. I just don't see anything in the published specs which indicates that we'll see good *double-precision* floating-point performance in ARM-based mobile devices anytime soon. This will hurt them badly in the future when mobile devices will run JavaScript all day. I bet Intel is ready to jump in ... --Mike From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 13:49:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EGnjZj015815; Fri, 14 Aug 2009 13:49:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6146B19353; Fri, 14 Aug 2009 13:49:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97F561931E for ; Fri, 14 Aug 2009 13:49:09 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Mbzxi-00066C-00; Fri, 14 Aug 2009 18:49:06 +0200 Date: Fri, 14 Aug 2009 18:48:09 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT performance Message-ID: <20090814164809.GA18231@mike.de> References: <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <049A757B-B8C7-4733-8C56-CF1F6A4B69AA@dnainternet.net> <20090809150458.GA15804@mike.de> <20090810013307.GA18673@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > Do you consider to release a test suite along with LJ2? Probably not. Because mine is a real big mess, thrown together from snippets of various sources with various copyrights and I haven't kept track of their origins. There's of course the standard Lua test suite, but it's of limited use with a JIT compiler. Most of it is never compiled and other tests fail, because they test for implementation characteristics and not just language characteristics. E.g. the test suite checks whether 'for i=1,100 do local t={} end' allocates memory and drives the GC forward. But LJ2 is able to eliminate the table allocation and thus doesn't need to run the GC. [Yes, I'm of the strong opinion that side-effects of the GC are implementation-defined.] But I may document, package and release my Lua benchmark collection whenever I get around to it. > > But I have to say it was an expensive decision: I've considerably > > underestimated the amount of research and trial-and-error which > > was needed to convert a research toy into a production compiler. > > There are some important implementation details which the few > > papers about trace compilers completely fail to mention ... :-| > > Perhaps that is the reason to write one yourself someday? ;-) Well, Roberto has urged me to write some papers, too. But I'm a lot better at writing code than writing papers. And, not being at a university anymore, there's no urgent need to write papers ... --Mike From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 13:55:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EGtXFq017104; Fri, 14 Aug 2009 13:55:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01F401935A; Fri, 14 Aug 2009 13:55:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56E8E19352 for ; Fri, 14 Aug 2009 13:55:03 -0300 (BRT) Received: by qyk34 with SMTP id 34so1249080qyk.33 for ; Fri, 14 Aug 2009 09:55:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.111.195 with SMTP id t3mr1417868qcp.44.1250268900720; Fri, 14 Aug 2009 09:55:00 -0700 (PDT) In-Reply-To: <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> Date: Fri, 14 Aug 2009 09:55:00 -0700 Message-ID: <5f907f40908140955r39a29c4fvab5457fe93cbac33@mail.gmail.com> Subject: Re: Some minor FAQ tweaks (a bit delayed). From: Joshua Beeler To: Lua list Content-Type: multipart/alternative; boundary=0023544706f4b3833604711ce913 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023544706f4b3833604711ce913 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Aug 14, 2009 at 5:07 AM, steve donovan wrote: > It would be cool if the code was syntax-colorized. Any suggestions? > You could try Google Code Prettify: http://code.google.com/p/google-code-prettify/ --0023544706f4b3833604711ce913 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Aug 14, 2009 at 5:07 AM, steve donovan <= span dir=3D"ltr"><steve.j.d= onovan@gmail.com> wrote:
It would be cool if the code was syntax-colorized. Any su= ggestions?

You could try Google Code Prettify:
<= br>

--0023544706f4b3833604711ce913-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 14:11:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EHBgDu020938; Fri, 14 Aug 2009 14:11:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A7FC1934A; Fri, 14 Aug 2009 14:11:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E77F19322 for ; Fri, 14 Aug 2009 14:11:11 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so309543eye.11 for ; Fri, 14 Aug 2009 10:11:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.21.211 with SMTP id r61mr451955wer.211.1250269861943; Fri, 14 Aug 2009 10:11:01 -0700 (PDT) In-Reply-To: <5f907f40908140955r39a29c4fvab5457fe93cbac33@mail.gmail.com> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> <5f907f40908140955r39a29c4fvab5457fe93cbac33@mail.gmail.com> Date: Fri, 14 Aug 2009 18:11:01 +0100 X-Google-Sender-Auth: 19248392702db91d Message-ID: Subject: Re: Some minor FAQ tweaks (a bit delayed). From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 5:55 PM, Joshua Beeler wrote: > On Fri, Aug 14, 2009 at 5:07 AM, steve donovan > wrote: >> >> It would be cool if the code was syntax-colorized. Any suggestions? > > You could try Google Code Prettify: > http://code.google.com/p/google-code-prettify/ > I've found that is not great at highlighting Lua. For example, lines 108 through 224 of http://code.google.com/p/corsix-th/source/browse/trunk/CorsixTH/Lua/audio.lua are highlighted as comment, despite (mainly) not being comments. From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 17:33:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EKXUuJ002663; Fri, 14 Aug 2009 17:33:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9F4C192F7; Fri, 14 Aug 2009 17:32:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42CEF192B6 for ; Fri, 14 Aug 2009 17:32:38 -0300 (BRT) Received: by pzk28 with SMTP id 28so1182513pzk.11 for ; Fri, 14 Aug 2009 13:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=vI4inwRkUAa9xOtYHitsR8AWU79KacDgqGrclLtcUcw=; b=DtVkL2sYw1XFBWt4xvaw+4qm0XOFyTWqwmc5N6jbgxrN4/FreaJsk1lwoKmAU8MgCE /S9X8Ae1HUQ+cPmm4qwQqFYH1j3xHVojANM8XVpYH20d44ZdWNDIE90WeOwHVPG3Ymde NJGCYBKrd1baBbuhv1ltCMHF/QccMmooYQpzU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=MXJTyiHhSyahDILD3yY6lZj+frNDLvJeXZuVyNWof7z/lDeHebApYdyG4BvbAvXyNR Y2wwxpCl6si2tm2hSAFmpxDkEWGh2TfpxrYlNeHqJQOZjPUgRISBf5CDjf1sNOEICrMw MS00qTqD+sszSw2w3nvIti4khuJQn0ROg/Hok= MIME-Version: 1.0 Received: by 10.142.74.4 with SMTP id w4mr373927wfa.195.1250281956151; Fri, 14 Aug 2009 13:32:36 -0700 (PDT) Date: Fri, 14 Aug 2009 13:32:36 -0700 Message-ID: <17eac67c0908141332y2c4ed455oca49626ae96e8786@mail.gmail.com> Subject: luasocket bug: sending zero length udp packets has the appearance of failure From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean luasocket thinks it can't send zero length udp packets: > return socket.udp():sendto("", "127.0.0.1", 7) nil refused The message doesn't mean anything, the packet is actually sent. It doesn't have this trouble with tcp: > return socket.connect("127.0.0.1", 7):send("") 0 nil nil We work around this in our code, but it would be nice to see a fix in the next release. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 19:38:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EMcDm3021698; Fri, 14 Aug 2009 19:38:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E96818B4C; Fri, 14 Aug 2009 19:37:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11D0E18B1F for ; Fri, 14 Aug 2009 19:37:38 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:3544 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mc5Od-0002jB-Oe for lua@bazar2.conectiva.com.br; Fri, 14 Aug 2009 18:37:16 -0400 Message-ID: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> From: "Michael Newberry" To: "Lua list" Subject: how does GC work with complex expressions using metamethods? Date: Fri, 14 Aug 2009 15:37:29 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00AB_01CA1CF5.22251020" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00AB_01CA1CF5.22251020 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I wonder if anyone can help me with the following questions. I am trying = to add metamethods like _add and __mul to a lua class (a table = configured in the appropriate way). Each of these arithmetic metamethods = must return a new object. For example, suppose B and C are objects and I = use A =3D B + C The result A is a new object, which is fine. I can delete A and grab its = memory whenever I want to. Now what if I use an expression like the = following? A =3D (B + C - D) / D - F*G ^ H There are a whole bunch of intermediate objects created as each operator = is processed, but I can never get to them to delete them. When do they = get garbage collected? Is it automatic, right after the expression is = evaluated? That's the first question. Related to that is a second question. The class holds a pointer to a C++ = object. So, when the table (class) gets gc'd, it needs to delete that = C++ object as well. I've gone back and forth in the blue book trying to understand this and = I just don't get it from the discussion and the examples. I can see that = *something* has to have a metamethod __gc which calls a Cfunction with = userdata containing the C++ pointer. But the question is the linkage = between all these things. I just don't see what to do. Whenever lua = tries to collect the table, I want it to call a Cfunction with the = pointer that should be deleted. Michael ------=_NextPart_000_00AB_01CA1CF5.22251020 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I wonder if anyone can help me with the = following=20 questions. I am trying to add metamethods like _add and __mul to a lua = class (a=20 table configured in the appropriate way). Each of these = arithmetic=20 metamethods must return a new object. For example, suppose B and C are=20 objects and I use
 
    A =3D B + = C
 
The result A is a new object, which is = fine. I=20 can delete A and grab its memory whenever I want to. Now what if I use = an=20 expression like the following?
 
    A =3D (B + C - D) / = D - F*G ^=20 H
 
There are a whole bunch of intermediate = objects=20 created as each operator is processed, but I can never get to them to = delete=20 them. When do they get garbage collected? Is it automatic, right after = the=20 expression is evaluated?
 
That's the first question.
 
Related to that is a second = question. The=20 class holds a pointer to a C++ object. So, when the table (class) gets=20 gc'd, it needs to delete that C++ object as = well.
 
I've gone back and forth in the blue = book trying to=20 understand this and I just don't get it from the discussion and the = examples. I=20 can see that *something* has to have a metamethod __gc which calls a = Cfunction=20 with userdata containing the C++ pointer. But the question is the = linkage=20 between all these things. I just don't see what to do. Whenever lua = tries=20 to collect the table, I want it to call a Cfunction with the = pointer that=20 should be deleted.
 
Michael
 
------=_NextPart_000_00AB_01CA1CF5.22251020-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 19:51:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EMps4j023200; Fri, 14 Aug 2009 19:51:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E957219104; Fri, 14 Aug 2009 19:51:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5F5A190A3 for ; Fri, 14 Aug 2009 19:51:26 -0300 (BRT) Received: by bwz10 with SMTP id 10so1534531bwz.5 for ; Fri, 14 Aug 2009 15:51:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.102.165.11 with SMTP id n11mr775154mue.5.1250290283381; Fri, 14 Aug 2009 15:51:23 -0700 (PDT) In-Reply-To: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> Date: Fri, 14 Aug 2009 17:51:23 -0500 Message-ID: <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7EMps4j023200 On Fri, Aug 14, 2009 at 5:37 PM, Michael Newberry wrote: > I wonder if anyone can help me with the following questions. I am trying to > add metamethods like _add and __mul to a lua class (a table configured in > the appropriate way). so your objects are not userdatas, right? just tables with metatables? > Each of these arithmetic metamethods must return a new > object. For example, suppose B and C are objects and I use > >     A = B + C > > The result A is a new object, which is fine. I can delete A and grab its > memory whenever I want to. no, you can't _delete_ an object, you just remove any reference to it, and the GC will eventually collect it. > Now what if I use an expression like the > following? > >     A = (B + C - D) / D - F*G ^ H > > There are a whole bunch of intermediate objects created as each operator is > processed, but I can never get to them to delete them. When do they get > garbage collected? Is it automatic, right after the expression is evaluated? there's no reference to them, so yes, they'll be collected. but not right after the expression, only when (if) there's memory pressure. > > That's the first question. > > Related to that is a second question. The class holds a pointer to a C++ > object. So, when the table (class) gets gc'd, it needs to delete that C++ > object as well. > > I've gone back and forth in the blue book trying to understand this and I > just don't get it from the discussion and the examples. I can see that > *something* has to have a metamethod __gc which calls a Cfunction with > userdata containing the C++ pointer. But the question is the linkage between > all these things. I just don't see what to do. Whenever lua tries to collect > the table, I want it to call a Cfunction with the pointer that should be > deleted. Lua tables don't call a __gc metamethod, only userdata objects do. if you have a __gc method (and you should if you have a pointer to a C object), you have to use userdata, not Lua tables. But, a table can't hold C pointers, so you should be using userdatas anyway, right? -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 20:07:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7EN79Ks024711; Fri, 14 Aug 2009 20:07:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C96A189C7; Fri, 14 Aug 2009 20:06:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6829B189C7 for ; Fri, 14 Aug 2009 20:06:37 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:3807 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mc5qj-00053w-5e for lua@bazar2.conectiva.com.br; Fri, 14 Aug 2009 19:06:17 -0400 Message-ID: <1286F5BE029B4C228D910AF774EB824A@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Fri, 14 Aug 2009 16:06:32 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: "Javier Guerra" To: "Lua list" Sent: Friday, August 14, 2009 3:51 PM Subject: Re: how does GC work with complex expressions using metamethods? > On Fri, Aug 14, 2009 at 5:37 PM, Michael > Newberry wrote: > > I wonder if anyone can help me with the following questions. I am trying > > to > > add metamethods like _add and __mul to a lua class (a table configured > > in > > the appropriate way). > > so your objects are not userdatas, right? just tables with metatables? Right, my classes are tables, declared generally like this: CData = { Cptr = nil } function CData:new() local o = {} setmetatable(o,self) self.__index = self o.Cptr = CreateData() return o end When the user uses A = CData:new() the registered function "CreateData" is called and it creates the C++ object aand returns a pointer to it. Class methods use o.Cptr to talk to the C++ object. > > Each of these arithmetic metamethods must return a new > > object. For example, suppose B and C are objects and I use > > > > A = B + C > > > > The result A is a new object, which is fine. I can delete A and grab its > > memory whenever I want to. > > no, you can't _delete_ an object, you just remove any reference to it, > and the GC will eventually collect it. Sorry, my terminology wasn't clear. When the user does A:delete(), the delete method calls a CFunction with self.Cptr which allows the C++ object to get deleted. Then delete() sets self = nil and I leave the rest to the lua GC. So my question comes down to how to automatically get the Cfunction called with the object pointer so the C++ object can be free'd? Michael From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 20:30:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ENU8ie027216; Fri, 14 Aug 2009 20:30:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6CFA191D0; Fri, 14 Aug 2009 20:29:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2091F19131 for ; Fri, 14 Aug 2009 20:29:35 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so470427wfa.11 for ; Fri, 14 Aug 2009 16:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=T9Ib5WnMRPlhGJpBgOEry896K4Cw/ZkX8L9jp8W8/s4=; b=rQ6jQz6n4jt6iAiPPodAYlRhS4UVE4DXqKj4bj76S2p1MgRMoyBY+UPej/6YLNxGNH mxVaHkQDTE1QTqoJBWKjLjbgGWV9drHMUFIeuDddRQokjElTVtdsq6HBmgxuNARh3cb9 JSwpcQfVh4hZFlz5tDsYQHk7fom7ihwoT0B+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v8XLoPk/3v/UkZk1QY8rjo2nO743Sh76DPFOjn3aG32W5yW0wHVm6WrUHt5IEIG/ZT qqnR5vnPvWCtqtIHQEFoRvRc/QlzR2XQTVgXCyMF4ggbx0mMJExIR8RVph6B+J0Usdz5 K1WXfuPOpClbnJRixHq+EIZnJulJiPFGPXkl0= MIME-Version: 1.0 Received: by 10.142.147.20 with SMTP id u20mr196137wfd.115.1250292574276; Fri, 14 Aug 2009 16:29:34 -0700 (PDT) In-Reply-To: <1286F5BE029B4C228D910AF774EB824A@CAYENNE> References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> <1286F5BE029B4C228D910AF774EB824A@CAYENNE> Date: Fri, 14 Aug 2009 16:29:34 -0700 Message-ID: <17eac67c0908141629n563c0f27ja72ba1f0129f43d1@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 4:06 PM, Michael Newberry wrote: > Right, my classes are tables, declared generally like this: > > CData = { Cptr = nil } > > function CData:new() > local o = {} > setmetatable(o,self) > self.__index = self > o.Cptr = CreateData() > return o > end > > When the user uses A = CData:new() the registered function "CreateData" is > called and it creates the C++ object aand returns a pointer to it. Class > methods use o.Cptr to talk to the C++ object. This isn't going to work. CreateData needs to return a (full) userdata. That userdata will probably contain nothing but your c++ pointer, and must have a metatable, with a __gc function that will delete that pointer. I can think of ways of getting around this, but they are unstable hacks, and besides, userdata was designed to do exactly what you are doing: encapsulate a C/C++ object/pointer, and give you hooks into garbage collection so you can manage their lifecycle. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 20:39:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ENcxaL028108; Fri, 14 Aug 2009 20:38:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77656192A7; Fri, 14 Aug 2009 20:38:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hermes.gamehouse.com (mail.gamehouse.com [216.127.40.134]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4691A19178 for ; Fri, 14 Aug 2009 20:38:33 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.gamehouse.com (Postfix) with ESMTP id 00C48845B06 for ; Fri, 14 Aug 2009 16:38:29 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new at gamehouse.com Received: from hermes.gamehouse.com ([127.0.0.1]) by localhost (hermes.gamehouse.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xag17KLULKqy for ; Fri, 14 Aug 2009 16:38:28 -0700 (PDT) Message-Id: <9F367203-C5A8-4850-B34B-F409DFCCD9C2@gamehouse.com> From: David Dunham To: Lua list In-Reply-To: <89d273ba0908140528q496359f3oc4b96c147098499f@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: lua_tolstring and wide character strings Date: Fri, 14 Aug 2009 16:38:27 -0700 References: <4A853890.40707@013net.net> <89d273ba0908140528q496359f3oc4b96c147098499f@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean On 14 Aug 2009, at 05:28, Jerome Vuarand wrote: >> Please correct me if I'm wrong, or if better options exist. > > AFAIK there is little reason to use UTF-16 in Lua rather than UTF-8. > With UTF-8 most string library functions can be used to some extent. > There are nice functions in the win32 API to convert from UTF-8 to > UTF-16 and back : MultiByteToWideChar and WideCharToMultiByte. We've been using UTF-8 as well. Works great, and it's also cross- platform (wide characters aren't really). David Dunham Macintosh Game Developer GameHouse Studios +1 206 926 5722 www.gamehouse.com "They said it couldn't be done but sometimes it doesn't work out that way." -- Casey Stengel From lua-bounces@bazar2.conectiva.com.br Fri Aug 14 20:40:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ENeuXN028330; Fri, 14 Aug 2009 20:40:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ED0A18FC9; Fri, 14 Aug 2009 20:40:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A258E188B4 for ; Fri, 14 Aug 2009 20:40:32 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:4161 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mc6NY-0007XC-OK for lua@bazar2.conectiva.com.br; Fri, 14 Aug 2009 19:40:13 -0400 Message-ID: <74E9D32057124692BFA98409E85DA842@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE> <17eac67c0908141629n563c0f27ja72ba1f0129f43d1@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Fri, 14 Aug 2009 16:40:28 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: "Sam Roberts" To: "Lua list" Sent: Friday, August 14, 2009 4:29 PM Subject: Re: how does GC work with complex expressions using metamethods? > On Fri, Aug 14, 2009 at 4:06 PM, Michael > Newberry wrote: >> Right, my classes are tables, declared generally like this: >> >> CData = { Cptr = nil } >> >> function CData:new() >> local o = {} >> setmetatable(o,self) >> self.__index = self >> o.Cptr = CreateData() >> return o >> end >> >> When the user uses A = CData:new() the registered function "CreateData" >> is >> called and it creates the C++ object aand returns a pointer to it. Class >> methods use o.Cptr to talk to the C++ object. > > This isn't going to work. > Maybe I'm not understanding what you are saying here, but what I described has worked for years. But it requires the user call CData:delete(). So it isn't automatic. Is it "not being automatic" that you mean isn't going to work? If so, yes, that is the problem. > CreateData needs to return a (full) userdata. That userdata will > probably contain nothing but your c++ pointer, and must have a > metatable, with a __gc function that will delete that pointer. > I already tried to do that, but maybe I goofed something. Here was the code inside the Cfunction CreateData(): // ... create the C++ object with pointer pData CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); *ptr = pData; return 1; Back in the lua new() method, the value of self.Cptr has "something". But what is that something? And how do I attach a __gc metamethod to it? Michael > I can think of ways of getting around this, but they are unstable > hacks, and besides, userdata was designed to do exactly what you are > doing: encapsulate a C/C++ object/pointer, and give you hooks into > garbage collection so you can manage their lifecycle. > > Cheers, > Sam > From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 03:31:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7F6V5bH029864; Sat, 15 Aug 2009 03:31:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84EE918C1B; Sat, 15 Aug 2009 03:30:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BC3118B3D for ; Sat, 15 Aug 2009 03:30:23 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so502193wfa.11 for ; Fri, 14 Aug 2009 23:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CNRT4Xde3D7Wj/lP2WnOKkCFu6mmaC5FCZ4Gl2/zXsw=; b=LP6MN0DaSufHS6Fi/9uanW7gCYMhqj6vpok4h2DlOPrgtTnsUgt1ezasKxznuAdCYp UTV+poU/FCq0dokbPS/EMyR/ttNIFDJxIJhvJkxsvjU27ijneZJJYn+ig/u3FbhjlN5o TlJtRukTS0dB029R3v8Cg5DPLdrX8zKdEwmws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=huHpTYPGi9cXv/LiEUzOKwgjuFzN61dkFtlZ9Rzh+2fHgfvwznzjM2+HyLDhYFpyX2 1VL71TRNUzbm4enGgQcWIReVZjk5H2LcD7K+NkDeWL6hOxPubDrrBvyeYVDU7VzJ3QRD w71A1Ai9mx4Xru7rqiBAhWnfHJDVclf/6Wpps= MIME-Version: 1.0 Received: by 10.142.72.14 with SMTP id u14mr40270wfa.135.1250317822106; Fri, 14 Aug 2009 23:30:22 -0700 (PDT) In-Reply-To: <74E9D32057124692BFA98409E85DA842@CAYENNE> References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> <1286F5BE029B4C228D910AF774EB824A@CAYENNE> <17eac67c0908141629n563c0f27ja72ba1f0129f43d1@mail.gmail.com> <74E9D32057124692BFA98409E85DA842@CAYENNE> Date: Fri, 14 Aug 2009 23:30:22 -0700 Message-ID: <17eac67c0908142330j70ec8d9eu4cb3b4df9b1ca48@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7F6V5bH029864 >   Maybe I'm not understanding what you are saying here, but what I described > has worked for years. But it requires the user call CData:delete(). So it > isn't automatic. Is it "not being automatic" that you mean isn't going to > work? If so, yes, that is the problem. Requiring a user to call :delete() is a problem, IMO. Being able to write code in a gced language that leaks memory is not so great. Anyhow, your specific example involves expressions where there are unnamed temporary variables created by operator overloading metamethods. The user never has a ref to them, so can't manually delete them, and __gc isn't called on tables, so you can't automatically delete them. So, you can't do what you are trying to do this way. >> CreateData needs to return a (full) userdata. That userdata will >> probably contain nothing but your c++ pointer, and must have a >> metatable, with a __gc function that will delete that pointer. >> > >   I already tried to do that, but maybe I goofed something. Here was the > code inside the Cfunction CreateData(): > >   // ... create the C++ object with pointer pData > >   CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); >   *ptr = pData; >   return 1; > > Back in the lua new() method, the value of self.Cptr has "something". But > what is that something? And how do I attach a __gc metamethod to it? You use lua_setmetatable() to attach a __gc metamethod. The io lib is a good example: http://www.lua.org/source/5.1/liolib.c.html newfile() shows how to do it. createmeta() creates the meta table used in newfile(). This is described here in more detail: http://www.lua.org/pil/29.html Sam From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 05:46:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7F8kaFO009323; Sat, 15 Aug 2009 05:46:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6906018EC5; Sat, 15 Aug 2009 05:46:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ipmail03.adl6.internode.on.net (ipmail03.adl6.internode.on.net [203.16.214.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C2BB18D78 for ; Sat, 15 Aug 2009 05:46:00 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAIRhkrLevkm/2dsb2JhbADRP4QZBQ X-IronPort-AV: E=Sophos;i="4.43,385,1246804200"; d="scan'208";a="20690316" Received: from ppp122-249-38.static.internode.on.net (HELO Tabletboy) ([203.122.249.38]) by ipmail03.adl6.internode.on.net with SMTP; 15 Aug 2009 18:15:56 +0930 Message-ID: From: "Peter Loveday" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> <1286F5BE029B4C228D910AF774EB824A@CAYENNE> In-Reply-To: <1286F5BE029B4C228D910AF774EB824A@CAYENNE> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sat, 15 Aug 2009 18:15:56 +0930 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Sorry, my terminology wasn't clear. When the user does A:delete(), the > delete method calls a CFunction with self.Cptr which allows the C++ object > to get deleted. Ack. This really should be done with a __gc metamethod on the usedata object. How do you know if any other references to the same C object exist or not (aside from assumed implementation conventions)? Allowing a hanging C ptr that has been deleted explicitly is asking for trouble. > Then delete() sets self = nil and I leave the rest to the lua GC. This isn't really useful.. setting self to nil won't cause the table to be cleaned up. Keep in mind 'self' is merely one reference to the table; any caller references will need to be cleaned up too. That is to say, every call to delete would have to be followed by settting (all) references to nil: A:delete() A = nil > So my question comes down to how to automatically get the Cfunction called > with the object pointer so the C++ object can be free'd? Right, so what you need to do is set a metatable on the userdata object with __gc defined. When the table is collected, and the last reference to that userdata goes away, it will (at some undefined time) be called. - Peter From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 05:51:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7F8ptZC009751; Sat, 15 Aug 2009 05:51:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4281318F75; Sat, 15 Aug 2009 05:51:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5124918EF2 for ; Sat, 15 Aug 2009 05:51:30 -0300 (BRT) Received: by fxm27 with SMTP id 27so1580979fxm.35 for ; Sat, 15 Aug 2009 01:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lmIRdkU7xIPSdN9eFxxKnDxzJabT0v53lXtf7sBr6h4=; b=wSLE4ihpZzjY9XVw/LqyDehwnoiDB5UtxKUrso/2Z16I5xQMRR0+FVMrNqdzarAI7b mj1/DYG1D8xMCKn7dRokL3HKIyvdm4HSDWE1/Gr7HKq2Yo7rtoJq7q6GWWeQG0PCODcm QMRLvSsWPXt79Kh2QW2vxsG6mrqs0rCzlm9mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OfTeSEsZThe0viuc0Qz66ZSuJCsc/RKZp6WUBFUQX1yttPlD30yAsFQ54wGxhxc8g7 whz3PHe1EYOvErwyKOvFUTEWE8BS3jtruPEf/G5xdSgYivePQks2V1oe8PrX+TFrwcz4 A84MZUd9nw0Tajvk1L+Fl9mGbwx4afTBHMdWo= MIME-Version: 1.0 Received: by 10.239.182.149 with SMTP id q21mr207671hbg.32.1250326288205; Sat, 15 Aug 2009 01:51:28 -0700 (PDT) In-Reply-To: References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908140507q1637bb5aj4a3108ccfc4539c@mail.gmail.com> <5f907f40908140955r39a29c4fvab5457fe93cbac33@mail.gmail.com> Date: Sat, 15 Aug 2009 10:51:28 +0200 Message-ID: <560972290908150151m8a1eb8w71cfc1b3ee1634c@mail.gmail.com> Subject: Re: Some minor FAQ tweaks (a bit delayed). From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 14, 2009 at 7:11 PM, Peter Cawley wrote: > I've found that is not great at highlighting Lua. It's not bad with the short code snippets, except that it isn't doing the comments: http://mysite.mweb.co.za/residents/sdonovan/lua/FAQ/ I apologize for the new temporary URL; luaforge won't let me in today. Also, the FAQ.zip on the luaforge site was not updated, due to an absent-minded release process. Service will be resumed on Monday ;) As for the look-and-feel, well the colours seem a little muted, but I tried a white background for the code blocks and it looks kinda bare... steve d. From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 09:21:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FCLbA3025568; Sat, 15 Aug 2009 09:21:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B58A818E61; Sat, 15 Aug 2009 09:21:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 741A118AE7 for ; Sat, 15 Aug 2009 09:21:03 -0300 (BRT) Received: by bwz10 with SMTP id 10so1714288bwz.5 for ; Sat, 15 Aug 2009 05:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6ysajWSuvgn8/KBJybgtwOMpzcMTPzueUy0P5l1OCwY=; b=U6gGAZMuCJH+VRK9UdwgJyQRE7apU4VU67z6HxoezubJloCB/92LTvYCVxqmKc3yY/ s+X5tzQnbztiAKFbyo/flTPpkJkGzHKfLLFLJVyOuFJqZn+QNY9PySIANCRbhhFNe+5p KphoSABVyHFbKVyBaO7MKjTywNFuvn6StDMH4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IkMDXcRVVBq8YPvQk6g9qqjjn2J8JPfspSHWAg0ZBjmdVgkhFJPJG5DwAz9rXgWh55 CDOCzLCwz1qhQ5rLF0gn/KUDq9ULTz/P7Y7bGTgmeyy66czWyzA3GH1i1q0R9G6zwzNo s4YSqWuSIyLxskUz4+1U9WvXi3ei8edtUPNDc= MIME-Version: 1.0 Received: by 10.223.145.9 with SMTP id b9mr647184fav.78.1250338860068; Sat, 15 Aug 2009 05:21:00 -0700 (PDT) In-Reply-To: <000f01ca1ce4$85a5b070$90f11150$@puc-rio.br> References: <000f01ca1ce4$85a5b070$90f11150$@puc-rio.br> Date: Sat, 15 Aug 2009 16:21:00 +0400 Message-ID: Subject: Re: [ANN] LuaGL 1.3 Released From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7FCLbA3025568 On Fri, Aug 14, 2009 at 17:38, Antonio Scuri wrote: >  LuaGL 1.3 has been released. >  This is a derivation from the LuaGL available in SourceForge. It was > already included in LuaBinaries but now there is an official website with > some pre-compiled binaries at LuaForge: > http://luagl.luaforge.net Congratulations with the release! I've noticed that the Download link on the page points back to http://luagl.luaforge.net/, whereas it should point to http://luaforge.net/projects/luagl. BTW, could we get an updated luarock for LuaGL? There is 1.01 still there. Alexander. From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 09:53:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FCr3c2028415; Sat, 15 Aug 2009 09:53:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36FF818E71; Sat, 15 Aug 2009 09:52:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2087318BB1 for ; Sat, 15 Aug 2009 09:52:33 -0300 (BRT) Received: from [89.139.36.225] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KOF007JH53GO330@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 15:52:29 +0300 (IDT) Date: Sat, 15 Aug 2009 15:52:27 +0300 From: Shmuel Zeigerman Subject: Re: lua_tolstring and wide character strings In-reply-to: <4A853890.40707@013net.net> To: Lua list Message-id: <4A86AF8B.9040204@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4A853890.40707@013net.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin wrote: > i think that idea that you may hold utf-16 strings in Lua strings > is wrong by itself. you should make specialized datatype Maybe I wasn't clear enough: my library isn't using utf-16 on the Lua side (though "wrong by itself" is an exaggeration IMHO). Robert Raschke wrote: > When processing "strings" that may contain non-ASCII data it is > imperative you always only ever use the C API functions where you pass > in the length of the buffer holding your "string"! Never rely on the C > style terminating zero. That's very true, and I never intended to do so. But the things are different with Windows API: utf-16 strings do contain non-ASCII data, and these functions know that the strings end with L'\0' (two consecutive zero bytes). Jerome Vuarand wrote: > AFAIK there is little reason to use UTF-16 in Lua rather than UTF-8. > With UTF-8 most string library functions can be used to some extent. > There are nice functions in the win32 API to convert from UTF-8 to > UTF-16 and back : MultiByteToWideChar and WideCharToMultiByte. I'm using utf-8 on the Lua side and utf-16 on the C side, where it is required by Windows API. The conversions between them are made by functions downloaded from www.unicode.org (that adds approx. 3 KiB of size to the executable). Joshua Jensen wrote: > You might try LuaPlus (http://luaplus.org/) which has real wide > character string support. Be sure to grab the Subversion build from > svn://svn.luaplus.org/LuaPlus/work51. If you would like to merge it > into your Lua, look for #ifdef'ed blocks of LUA_WIDESTRING and > LUA_WIDESTRING_FILE. If I write for LuaPlus then the users of my software would have to use LuaPlus too (and this is not desirable). Still, there's an opportunity to study how LuaPlus solves these problems (and even borrow some parts from it, as its license permits that) :) Many thanks to all who responded. My proposal was intended to alleviate manipulation of wide character strings with Lua API, before passing them to Windows functions, the same way as keeping one extra zero byte by Lua makes things easier with the C-string API. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 11:06:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FE6gfI003602; Sat, 15 Aug 2009 11:06:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62E5918D78; Sat, 15 Aug 2009 11:06:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C93C18CF4 for ; Sat, 15 Aug 2009 11:06:05 -0300 (BRT) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FE61vo003531 for ; Sat, 15 Aug 2009 11:06:03 -0300 From: "Antonio Scuri" To: "'Lua list'" References: <000f01ca1ce4$85a5b070$90f11150$@puc-rio.br> In-Reply-To: Subject: RE: [ANN] LuaGL 1.3 Released Date: Sat, 15 Aug 2009 11:05:30 -0300 Message-ID: <005401ca1db1$74431250$5cc936f0$@puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acodou/iALRz5NxpR9ac5NjfYo0VXgADmjYw Content-Language: pt-br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I've noticed that the Download link on the page points back to > http://luagl.luaforge.net/, whereas it should point to > http://luaforge.net/projects/luagl. Fixed. Thanks. > BTW, could we get an updated luarock for LuaGL? There is 1.01 still > there. Ok. I'm going to check this. Best, Scuri From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 13:23:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FGN9XY016690; Sat, 15 Aug 2009 13:23:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FD3F18EE6; Sat, 15 Aug 2009 13:22:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A648518B7A for ; Sat, 15 Aug 2009 13:22:31 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:2920 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1McM1H-0006Wx-A9 for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 12:22:15 -0400 Message-ID: <211BB727534A4CDF9C9FC92BCB242685@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><17eac67c0908141629n563c0f27ja72ba1f0129f43d1@mail.gmail.com><74E9D32057124692BFA98409E85DA842@CAYENNE> <17eac67c0908142330j70ec8d9eu4cb3b4df9b1ca48@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sat, 15 Aug 2009 09:22:25 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks! I'll take a look. Michael ----- Original Message ----- From: "Sam Roberts" To: "Lua list" Sent: Friday, August 14, 2009 11:30 PM Subject: Re: how does GC work with complex expressions using metamethods? > Maybe I'm not understanding what you are saying here, but what I described > has worked for years. But it requires the user call CData:delete(). So it > isn't automatic. Is it "not being automatic" that you mean isn't going to > work? If so, yes, that is the problem. Requiring a user to call :delete() is a problem, IMO. Being able to write code in a gced language that leaks memory is not so great. Anyhow, your specific example involves expressions where there are unnamed temporary variables created by operator overloading metamethods. The user never has a ref to them, so can't manually delete them, and __gc isn't called on tables, so you can't automatically delete them. So, you can't do what you are trying to do this way. >> CreateData needs to return a (full) userdata. That userdata will >> probably contain nothing but your c++ pointer, and must have a >> metatable, with a __gc function that will delete that pointer. >> > > I already tried to do that, but maybe I goofed something. Here was the > code inside the Cfunction CreateData(): > > // ... create the C++ object with pointer pData > > CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); > *ptr = pData; > return 1; > > Back in the lua new() method, the value of self.Cptr has "something". But > what is that something? And how do I attach a __gc metamethod to it? You use lua_setmetatable() to attach a __gc metamethod. The io lib is a good example: http://www.lua.org/source/5.1/liolib.c.html newfile() shows how to do it. createmeta() creates the meta table used in newfile(). This is described here in more detail: http://www.lua.org/pil/29.html Sam From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 13:37:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FGbJgE017781; Sat, 15 Aug 2009 13:37:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC823190A3; Sat, 15 Aug 2009 13:36:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D450919018 for ; Sat, 15 Aug 2009 13:36:52 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:3040 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1McMFD-0007df-3Y for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 12:36:39 -0400 Message-ID: <9E041F4F488442149B79E55244A693E9@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sat, 15 Aug 2009 09:36:49 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: "Peter Loveday" To: "Lua list" Sent: Saturday, August 15, 2009 1:45 AM Subject: Re: how does GC work with complex expressions using metamethods? >> Sorry, my terminology wasn't clear. When the user does A:delete(), the >> delete method calls a CFunction with self.Cptr which allows the C++ >> object to get deleted. > > Ack. This really should be done with a __gc metamethod on the usedata > object. How do you know if any other references to the same C object > exist or not (aside from assumed implementation conventions)? Allowing a > hanging C ptr that has been deleted explicitly is asking for trouble. No, that can't happen. Our C code registers each such pointer allocation and automatically deletes it later, regardless of whether there was one or multiple references in the lua script. But using metamethods like __add in expressions opens the new issue of intermediate C++ objects not being deleted until our C code gets around to it. We set it up this way many years ago because we couldn't figure out how to get the C++ object deleted automatically by the lua code. I know that was a bit of a hack but it was the best we could come up with at the time. > >> Then delete() sets self = nil and I leave the rest to the lua GC. > > This isn't really useful.. setting self to nil won't cause the table to be > cleaned up. Keep in mind 'self' is merely one reference to the table; any > caller references will need to be cleaned up too. > No, setting self = nil isn't done to get the table cleaned up faster. It's for our use in the script. > That is to say, every call to delete would have to be followed by settting > (all) references to nil: > > A:delete() > A = nil > >> So my question comes down to how to automatically get the Cfunction >> called with the object pointer so the C++ object can be free'd? > > Right, so what you need to do is set a metatable on the userdata object > with __gc defined. When the table is collected, and the last reference to > that userdata goes away, it will (at some undefined time) be called. > That's what I'm working on today, but the process isn't at all transparent to me yet. Michael From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 15:13:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FICvNr027003; Sat, 15 Aug 2009 15:12:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E8A218BA1; Sat, 15 Aug 2009 15:12:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D95D218A4B for ; Sat, 15 Aug 2009 15:12:17 -0300 (BRT) Received: by ewy26 with SMTP id 26so2230106ewy.5 for ; Sat, 15 Aug 2009 11:12:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.111.7 with SMTP id j7mr4828326ebc.18.1250359935179; Sat, 15 Aug 2009 11:12:15 -0700 (PDT) In-Reply-To: References: Date: Sat, 15 Aug 2009 14:12:15 -0400 X-Google-Sender-Auth: f4146f11e5444dd0 Message-ID: Subject: Re: [ANN] lua-Coat 0.2.0 : Yet Another Lua Object-Oriented Model From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7FICvNr027003 On Fri, Aug 14, 2009 at 11:02 AM, François Perrad wrote: > lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), > a Perl module which mimics Moose (http://www.iinteractive.com/moose/), > an object system for Perl5 which borrows features from Perl6, > CLOS (LISP), Smalltalk and many other languages. > ...The homepage is at http://lua-coat.luaforge.net/, That seems to have some traction [3-4]. In this syntax: require 'Coat' class 'Point' has( 'x', { is = 'rw', isa = 'number', default = 0 } ) has( 'y', { is = 'rw', isa = 'number', default = 0 } ) overload( '__tostring', function (self) return '(' .. self:x() .. ', ' .. self:y() .. ')' end ) method( 'draw', function (self) return "drawing " .. self._CLASS .. tostring(self) end ) the "end )" feels a bit awkward to write for every method in a program: it's a statement-level keyword (end) contained inside an expression-level ")", which tend not to mix in Lua. The "end" and ")" don't align to their matching start tokens, and the function block has less indentation than the "function" keyword. The original also involves quoting identifiers ('draw'). It could be written in a more luaesque way a follows: require 'Coat' class 'Point' has.x = { is = 'rw', isa = 'number', default = 0 } has.y = { is = 'rw', isa = 'number', default = 0 } overload.__tostring = function (self) return '(' .. self.x .. ', ' .. self.y .. ')' end method.draw = function (self) return "drawing " .. self._CLASS .. tostring(self) end -- The above can also be written as such: -- function method.draw(self) -- return "drawing " .. self._CLASS .. tostring(self) -- end where "has", "overload", and "method" are tables, possibly with __newindex metamethods. I think self.x rather than self:x() tends to be the preferred syntax for object properties in Lua. This requires a proxy table though. Here's a few initial comments on the source: > module(..., package.seeall) I recommend avoiding package.seeall since it pollutes your external interface: require "Coat" print(Coat.math) --> table: 0x100549c8 > basic_type = type > local basic_type = basic_type > local function object_type (obj) > local t = basic_type(obj) > if t == 'table' and obj._CLASS then > return obj._CLASS > else > return t > end > end > _G.type = object_type This breaks type(). Consider: require "Coat" require "someothermodule" where someothermodule internally applies type to a read-only table: local t = setmetatable({x=1}, {__index=function() error'read only' end}) assert(type(t) == 'table') and now fails. > function _G.class (modname) This can then imply that other modules in your program cannot internally use Steve's class.lua module [1]. Consider this: -- b.lua require "class" -- internally uses class.lua ..... which in turn is used by this: -- a.lua require "Coat" require "b" class "a" -- opps, invokes class.lua not Coat.lua I've had complaints about the Lua module system in the past [2]. > function _G.class (modname) > checktype('class', 1, modname, 'string') > if _G[modname] then > error("name conflict for module '" .. modname .. "'") > end Is there a way to create anonymous classes? or lexically scoped classes? For example, local class = require "Coat" . class local T = class(function() function method.test() print 'test' end end) T():test() --> test [1] http://lua-users.org/wiki/SimpleLuaClasses [2] http://lua-users.org/lists/lua-l/2009-08/msg00297.html [3] http://www.iinteractive.com/moose/ [4] http://search.cpan.org/~drolsky/Moose/lib/Moose/Manual/Unsweetened.pod From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 16:52:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FJqbRh003117; Sat, 15 Aug 2009 16:52:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 209B71909C; Sat, 15 Aug 2009 16:52:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3ECF18D35 for ; Sat, 15 Aug 2009 16:52:02 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:4798 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1McPI0-0004bk-Ha for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 15:51:44 -0400 Message-ID: <4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE> <9E041F4F488442149B79E55244A693E9@CAYENNE> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sat, 15 Aug 2009 12:51:57 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 5 X-MSMail-Priority: Low X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean OK, Here's what I have come up with (but it doesn't work): When the script starts, the app executes this new function: void SetupCDataGC( struct lua_State* L ) // setup garbage collection { luaL_newmetatable( L, "CData_type" ); // create metatable for CData lua_pushstring( L, "__gc" ); lua_pushcfunction( L, CDataDelete ); lua_settable( L, -3 ); } The new userdata delete function is declared like this: int CDataDelete( struct lua_State* L ) { // deletion stuff return 0; } When the lua script creates the CData table (a lua "class"), it calls a CFunction to create the C++ object (existing code). Inside that function, I added the following code: CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); *ptr = pData; luaL_getmetatable( L, "CData_type" ); lua_setmetatable( L, -2 ); lua_pushlightuserdata( L, pData ); // return the C++ object's pointer to the script return 1; The script executes as usual but the CDataDelete function is not called. So I must still be missing a link in the process. Michael From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 17:34:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FKYm6U006395; Sat, 15 Aug 2009 17:34:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8156319076; Sat, 15 Aug 2009 17:34:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1ACE218C30 for ; Sat, 15 Aug 2009 17:34:14 -0300 (BRT) Received: by pzk28 with SMTP id 28so1443957pzk.11 for ; Sat, 15 Aug 2009 13:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=phsJU2d13OxsLHeYCKgP8WXFmeEwyuR+p0cf3JLk94s=; b=HbtXF5ASlKRT7q/jt1/5LJWtTOA4unw1aGKwQ5KukAOsGQA0RtGnIhqbsqzfiOOXWR M8++4qe//FCMe7pQ0U6o8CoZwVxhZ3x6VwVANSvNltmC8gva94LruimMsUQRt5YmKoQq FCyGTQaoHHs9wO3aisUc+5dX5dJgLA+IvmZGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mOfsuQSpsEwOYZ19PfhfprEHC2uswAnLlOpXIvbjfY2xaLe9h+0rWwCINTrQ/wzjb7 ugnxo+VK5OoVg1Z895OQtz8sYojUraV7cYkbeLECqJzrMJ4frnF2q+oELm5Ftw+Ty+3H VMzsuIHfOzjFWkoPENvQqmKrLT1TwqqoUUO1k= MIME-Version: 1.0 Received: by 10.143.13.3 with SMTP id q3mr106115wfi.343.1250368453647; Sat, 15 Aug 2009 13:34:13 -0700 (PDT) In-Reply-To: <4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> <1286F5BE029B4C228D910AF774EB824A@CAYENNE> <9E041F4F488442149B79E55244A693E9@CAYENNE> <4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> Date: Sat, 15 Aug 2009 13:34:13 -0700 Message-ID: <17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7FKYm6U006395 On Sat, Aug 15, 2009 at 12:51 PM, Michael Newberry wrote: > OK, Here's what I have come up with (but it doesn't work): > > When the script starts, the app executes this new function: > > void SetupCDataGC( struct lua_State* L )    // setup garbage collection > { >   luaL_newmetatable( L, "CData_type" ); // create metatable for CData >   lua_pushstring( L, "__gc" ); >   lua_pushcfunction( L, CDataDelete ); >   lua_settable( L, -3 ); > } > > The new userdata delete function is declared like this: > > int CDataDelete( struct lua_State* L ) > { >   // deletion stuff >   return 0; > } > > When the lua script creates the CData table (a lua "class"), it calls a > CFunction to create the C++ object (existing code).  Inside that function, I > added the following code: > >   CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); >   *ptr = pData; >   luaL_getmetatable( L, "CData_type" ); >   lua_setmetatable( L, -2 ); > >   lua_pushlightuserdata( L, pData );    // return the C++ object's pointer > to the script >   return 1; You are creating userdata, but not returning it, instead just returning lightuserdata. This can't work. Not seeing all your code, but since you aren't returning the userdata, it will become unreferenced immediately after you create it, and garbage collected sometime later, causing your lightuserdata to point to a deleted object at some random future time. I think what you have done in the past is just bind a bunch of c fns into lua, wrap them in a lua object/table, make a table key that is light userdata, and write "methods" in lua that pass in that light userdata. Once you get userdata working, you'll find that it offers much more direct and useful ways of doing all that, but you may have to throw away some of your existing thinking. Anyhow, for debugging, I suggest starting from scratch, use the userdata as your lua "object", not a table, and start implementing from there. Once you've got it working, integrate back into your app. Also, remember to call collectgarbage() to force a gc cycle, otherwise you might have to wait a while, even for lua to exit, before gc happens. Put a printf() in your __gc so you can watch the collection happen. Also, take a look at debug.getmetatable(), it will help you inspect your userdata to verify it's metatable has a __gc. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 18:36:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FLaZQx011622; Sat, 15 Aug 2009 18:36:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D10F218E7A; Sat, 15 Aug 2009 18:36:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87D0F18C2F for ; Sat, 15 Aug 2009 18:35:59 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:1763 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1McQuZ-0004lC-MK for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 17:35:39 -0400 Message-ID: <42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> <17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sat, 15 Aug 2009 14:35:54 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sam, I really appreciate your feedback, but it's not helping. You are giving me concepts assuming that I already understand them. For example, how do I return userdata from the Cfunction to the script so that it will not "become unreferenced immediately after I create it"? The missing concept in precisely what has to happen for the userdata I've created to be referenced? Do I push the userdata ptr onto the return stack using lua_pushlightuserdata( ptr ) and then, in the script, set a table element to the return value? I tried that and then set the table element to nil and called collectgarbage(), but my Cfunction garbage collector did not get called. Michael ----- Original Message ----- From: "Sam Roberts" To: "Lua list" Sent: Saturday, August 15, 2009 1:34 PM Subject: Re: how does GC work with complex expressions using metamethods? On Sat, Aug 15, 2009 at 12:51 PM, Michael Newberry wrote: > OK, Here's what I have come up with (but it doesn't work): > > When the script starts, the app executes this new function: > > void SetupCDataGC( struct lua_State* L ) // setup garbage collection > { > luaL_newmetatable( L, "CData_type" ); // create metatable for CData > lua_pushstring( L, "__gc" ); > lua_pushcfunction( L, CDataDelete ); > lua_settable( L, -3 ); > } > > The new userdata delete function is declared like this: > > int CDataDelete( struct lua_State* L ) > { > // deletion stuff > return 0; > } > > When the lua script creates the CData table (a lua "class"), it calls a > CFunction to create the C++ object (existing code). Inside that function, > I > added the following code: > > CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); > *ptr = pData; > luaL_getmetatable( L, "CData_type" ); > lua_setmetatable( L, -2 ); > > lua_pushlightuserdata( L, pData ); // return the C++ object's pointer > to the script > return 1; You are creating userdata, but not returning it, instead just returning lightuserdata. This can't work. Not seeing all your code, but since you aren't returning the userdata, it will become unreferenced immediately after you create it, and garbage collected sometime later, causing your lightuserdata to point to a deleted object at some random future time. I think what you have done in the past is just bind a bunch of c fns into lua, wrap them in a lua object/table, make a table key that is light userdata, and write "methods" in lua that pass in that light userdata. Once you get userdata working, you'll find that it offers much more direct and useful ways of doing all that, but you may have to throw away some of your existing thinking. Anyhow, for debugging, I suggest starting from scratch, use the userdata as your lua "object", not a table, and start implementing from there. Once you've got it working, integrate back into your app. Also, remember to call collectgarbage() to force a gc cycle, otherwise you might have to wait a while, even for lua to exit, before gc happens. Put a printf() in your __gc so you can watch the collection happen. Also, take a look at debug.getmetatable(), it will help you inspect your userdata to verify it's metatable has a __gc. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 19:41:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FMfFPg016236; Sat, 15 Aug 2009 19:41:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29A1C18D42; Sat, 15 Aug 2009 19:40:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8185418CDB for ; Sat, 15 Aug 2009 19:40:40 -0300 (BRT) Received: by ewy26 with SMTP id 26so2307042ewy.5 for ; Sat, 15 Aug 2009 15:40:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.130.13 with SMTP id c13mr1331307ebd.0.1250376037776; Sat, 15 Aug 2009 15:40:37 -0700 (PDT) Date: Sat, 15 Aug 2009 18:40:37 -0400 X-Google-Sender-Auth: f8545206cf6ddc6c Message-ID: Subject: x="abc":upper() v.s. x=("abc"):upper() patch From: David Manura To: Lua list Content-Type: multipart/mixed; boundary=0015174c391a913f7d047135dbb6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174c391a913f7d047135dbb6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Would there be any reason not to allow ("abc"):upper() to be rewritten as "abc":upper() ? One complication is that the syntax is ambiguous if the function call is used as or could be interpreted as a statement. The following is twice ambiguous: x = lower "abc" -- ambiguous "abc":foo() -- ambiguous We'd like to avoid adding ambiguous syntax. However, it could be argued that the above doesn't add a new class of ambiguous syntax but rather makes that existing class more consistent. The above is just syntactic sugar for x = lower ("abc") -- ambiguous ("abc"):foo() -- ambiguous which itself is just as ambiguous, even under Lua 5.1. The new rule enforced by the parser becomes "there can be no line break between prefixexp and args". This new rule, unlike the old one, is invariant under any translation between the two syntax forms above. A prototype of how this might be implemented is given in the attached patch (lua-5.1-string-paren-patch). There is also a related patch [1] that avoids spurious ambiguous syntax errors when the expression cannot be interpreted as a statement. Part of the reason for suggesting this was to analogously allow things like ({3,2,1}):map(f) to be rewritten as {3,2,1}:map(f). Now, even if that could give no syntax error, it would normally still give a runtime error. That would be avoided if we could automatically assign a default metatable with __index to constructed tables [3,*]. Lua doesn't do that, at least in part, because it interferes with using tables as maps/sets, but this problem can be avoided under the __methindex (a.k.a. __mcall) proposal [2], which allows ":" to be treated differently from ".". [1] http://lua-users.org/lists/lua-l/2009-01/msg00052.html [2] http://lua-users.org/lists/lua-l/2009-06/msg00394.html [3] http://lua-users.org/lists/lua-l/2003-12/msg00384.html [*] I was thinking of also adding a new table metamethod that would process fields (including nils) passed to the table constructor --0015174c391a913f7d047135dbb6 Content-Type: application/octet-stream; name="lua-5.1-string-paren-patch" Content-Disposition: attachment; filename="lua-5.1-string-paren-patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fyevtahl0 LS0tIGx1YS01LjEuNC9zcmMvbGxleC5jCisrKyBsdWEtY2FsbC9zcmMvbGxleC5jCkBAIC0xNDIs NiArMTQyLDcgQEAKICAgbHMtPnogPSB6OwogICBscy0+ZnMgPSBOVUxMOwogICBscy0+bGluZW51 bWJlciA9IDE7CisgIGxzLT5iZWdpbmxpbmVudW1iZXIgPSAxOwogICBscy0+bGFzdGxpbmUgPSAx OwogICBscy0+c291cmNlID0gc291cmNlOwogICBsdWFaX3Jlc2l6ZWJ1ZmZlcihscy0+TCwgbHMt PmJ1ZmYsIExVQV9NSU5CVUZGRVIpOyAgLyogaW5pdGlhbGl6ZSBidWZmZXIgKi8KQEAgLTIyMSw2 ICsyMjIsNyBAQAogc3RhdGljIHZvaWQgcmVhZF9sb25nX3N0cmluZyAoTGV4U3RhdGUgKmxzLCBT ZW1JbmZvICpzZW1pbmZvLCBpbnQgc2VwKSB7CiAgIGludCBjb250ID0gMDsKICAgKHZvaWQpKGNv bnQpOyAgLyogYXZvaWQgd2FybmluZ3Mgd2hlbiBgY29udCcgaXMgbm90IHVzZWQgKi8KKyAgbHMt PmJlZ2lubGluZW51bWJlciA9IGxzLT5saW5lbnVtYmVyOyAvKiBzdGFydCBvZiBzdHJpbmcgKi8K ICAgc2F2ZV9hbmRfbmV4dChscyk7ICAvKiBza2lwIDJuZCBgWycgKi8KICAgaWYgKGN1cnJJc05l d2xpbmUobHMpKSAgLyogc3RyaW5nIHN0YXJ0cyB3aXRoIGEgbmV3bGluZT8gKi8KICAgICBpbmNs aW5lbnVtYmVyKGxzKTsgIC8qIHNraXAgaXQgKi8KQEAgLTI3NCw2ICsyNzYsNyBAQAogCiAKIHN0 YXRpYyB2b2lkIHJlYWRfc3RyaW5nIChMZXhTdGF0ZSAqbHMsIGludCBkZWwsIFNlbUluZm8gKnNl bWluZm8pIHsKKyAgbHMtPmJlZ2lubGluZW51bWJlciA9IGxzLT5saW5lbnVtYmVyOyAvKiBzdGFy dCBvZiBzdHJpbmcgKi8KICAgc2F2ZV9hbmRfbmV4dChscyk7CiAgIHdoaWxlIChscy0+Y3VycmVu dCAhPSBkZWwpIHsKICAgICBzd2l0Y2ggKGxzLT5jdXJyZW50KSB7CmRpZmYgLXVyIGx1YS01LjEu NC9zcmMvbGxleC5oIGx1YS1jYWxsL3NyYy9sbGV4LmgKLS0tIGx1YS01LjEuNC9zcmMvbGxleC5o CTIwMDctMTItMjcgMDg6MDI6MjUuMDAwMDAwMDAwIC0wNTAwCisrKyBsdWEtY2FsbC9zcmMvbGxl eC5oCTIwMDktMDgtMTUgMTc6MzE6MDQuNTYyNTAwMDAwIC0wNDAwCkBAIC01NSw2ICs1NSw3IEBA CiB0eXBlZGVmIHN0cnVjdCBMZXhTdGF0ZSB7CiAgIGludCBjdXJyZW50OyAgLyogY3VycmVudCBj aGFyYWN0ZXIgKGNoYXJpbnQpICovCiAgIGludCBsaW5lbnVtYmVyOyAgLyogaW5wdXQgbGluZSBj b3VudGVyICovCisgIGludCBiZWdpbmxpbmVudW1iZXI7ICAvKiBsaW5lIG9mIHN0YXJ0IG9mIHRv a2VuIChzdHJpbmdzIG9ubHkpICovCiAgIGludCBsYXN0bGluZTsgIC8qIGxpbmUgb2YgbGFzdCB0 b2tlbiBgY29uc3VtZWQnICovCiAgIFRva2VuIHQ7ICAvKiBjdXJyZW50IHRva2VuICovCiAgIFRv a2VuIGxvb2thaGVhZDsgIC8qIGxvb2sgYWhlYWQgdG9rZW4gKi8KZGlmZiAtdXIgbHVhLTUuMS40 L3NyYy9scGFyc2VyLmMgbHVhLWNhbGwvc3JjL2xwYXJzZXIuYwotLS0gbHVhLTUuMS40L3NyYy9s cGFyc2VyLmMKKysrIGx1YS1jYWxsL3NyYy9scGFyc2VyLmMKQEAgLTYzMCw2ICs2MzAsOCBAQAog ICAgICAgYnJlYWs7CiAgICAgfQogICAgIGNhc2UgVEtfU1RSSU5HOiB7ICAvKiBmdW5jYXJncyAt PiBTVFJJTkcgKi8KKyAgICAgIGlmIChscy0+YmVnaW5saW5lbnVtYmVyICE9IGxzLT5sYXN0bGlu ZSkKKyAgICAgICAgbHVhWF9zeW50YXhlcnJvcihscywiYW1iaWd1b3VzIHN5bnRheCAoZnVuY3Rp b24gY2FsbCB4IG5ldyBzdGF0ZW1lbnQpIik7CiAgICAgICBjb2Rlc3RyaW5nKGxzLCAmYXJncywg bHMtPnQuc2VtaW5mby50cyk7CiAgICAgICBsdWFYX25leHQobHMpOyAgLyogbXVzdCB1c2UgYHNl bWluZm8nIGJlZm9yZSBgbmV4dCcgKi8KICAgICAgIGJyZWFrOwpAQCAtNjc1LDYgKzY3NywxMCBA QAogICAgICAgbHVhS19kaXNjaGFyZ2V2YXJzKGxzLT5mcywgdik7CiAgICAgICByZXR1cm47CiAg ICAgfQorICAgIGNhc2UgVEtfU1RSSU5HOgorICAgICAgY29kZXN0cmluZyhscywgdiwgbHMtPnQu c2VtaW5mby50cyk7CisgICAgICBsdWFYX25leHQobHMpOworICAgICAgcmV0dXJuOwogICAgIGNh c2UgVEtfTkFNRTogewogICAgICAgc2luZ2xldmFyKGxzLCB2KTsKICAgICAgIHJldHVybjsKQEAg LTczMywxMCArNzM5LDYgQEAKICAgICAgIHYtPnUubnZhbCA9IGxzLT50LnNlbWluZm8ucjsKICAg ICAgIGJyZWFrOwogICAgIH0KLSAgICBjYXNlIFRLX1NUUklORzogewotICAgICAgY29kZXN0cmlu ZyhscywgdiwgbHMtPnQuc2VtaW5mby50cyk7Ci0gICAgICBicmVhazsKLSAgICB9CiAgICAgY2Fz ZSBUS19OSUw6IHsKICAgICAgIGluaXRfZXhwKHYsIFZOSUwsIDApOwogICAgICAgYnJlYWs7Cg== --0015174c391a913f7d047135dbb6-- From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 19:48:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FMlsXD016817; Sat, 15 Aug 2009 19:47:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6166719076; Sat, 15 Aug 2009 19:47:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F98118CD2 for ; Sat, 15 Aug 2009 19:47:30 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1McS22-0008Ag-0v for lua@bazar2.conectiva.com.br; Sat, 15 Aug 2009 23:47:26 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id D455C2E68F for ; Sat, 15 Aug 2009 23:47:22 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:53284 with envelope Message-ID: <4A873B08.40908@cowlark.com> Date: Sat, 15 Aug 2009 23:47:36 +0100 From: David Given User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: how does GC work with complex expressions using metamethods? References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> <17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com> <42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE> In-Reply-To: <42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7FMlsXD016817 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Newberry wrote: [...] > The missing concept in precisely what has to happen for the userdata > I've created to be referenced? Do I push the userdata ptr onto the > return stack using lua_pushlightuserdata( ptr ) and then, in the script, > set a table element to the return value? A userdata is just another Lua object type, like a lightuserdata. So just push it onto the stack and return it. You don't need to use lightuserdatas at all. Basically: lightuserdata: 4 bytes only, no metatable, no notification when GCd userdata: any number of bytes, metatable, notification when GCd Check out the example here: http://www.lua.org/pil/28.1.html - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKhzsIf9E0noFvlzgRApXnAJ95YVNQj3/pFimihcaFBc04d4CwKACg387L Hn8x9kNNGixMEoTAL9VsrkU= =k9vO -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 20:30:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FNUrfc020132; Sat, 15 Aug 2009 20:30:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6428518ED1; Sat, 15 Aug 2009 20:30:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp06.bis.na.blackberry.com (smtp06.bis.na.blackberry.com [216.9.248.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1413918CDB for ; Sat, 15 Aug 2009 20:30:21 -0300 (BRT) Received: from bda159.bisx.prod.on.blackberry (bda159.bisx.prod.on.blackberry [172.20.226.139]) by srs.bis.na.blackberry.com (8.13.7 TEAMON/8.13.7) with ESMTP id n7FNU0mq024905 for ; Sat, 15 Aug 2009 23:30:00 GMT Received: from bda159.bisx.prod.on.blackberry (localhost.localdomain [127.0.0.1]) by bda159.bisx.prod.on.blackberry (8.13.7 TEAMON/8.13.7) with ESMTP id n7FNU0NO004638 for ; Sat, 15 Aug 2009 23:30:00 GMT X-rim-org-msg-ref-id: 1301622269 Message-ID: <1301622269-1250378999-cardhu_decombobulator_blackberry.rim.net-1999156460-@bxe1018.bisx.prod.on.blackberry> X-Priority: Normal References: In-Reply-To: Sensitivity: Normal Importance: Normal Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch To: "Lua list" From: delbu9c1@erau.edu Date: Sat, 15 Aug 2009 23:34:29 +0000 Content-Type: text/plain MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id n7FNUrfc020132 It seems like you're advocating that the following be ambiguous, if I understand you correctly. Foo = bar "baz":quux() That does not seem like a good idea to me... It would approach the point where semicolons are required all over the place. Personally I use semicolons all the time...but that's not the point. Matt Sent from my Verizon Wireless BlackBerry -----Original Message----- From: David Manura Date: Sat, 15 Aug 2009 18:40:37 To: Lua list Subject: x="abc":upper() v.s. x=("abc"):upper() patch Would there be any reason not to allow ("abc"):upper() to be rewritten as "abc":upper() ? One complication is that the syntax is ambiguous if the function call is used as or could be interpreted as a statement. The following is twice ambiguous: x = lower "abc" -- ambiguous "abc":foo() -- ambiguous We'd like to avoid adding ambiguous syntax. However, it could be argued that the above doesn't add a new class of ambiguous syntax but rather makes that existing class more consistent. The above is just syntactic sugar for x = lower ("abc") -- ambiguous ("abc"):foo() -- ambiguous which itself is just as ambiguous, even under Lua 5.1. The new rule enforced by the parser becomes "there can be no line break between prefixexp and args". This new rule, unlike the old one, is invariant under any translation between the two syntax forms above. A prototype of how this might be implemented is given in the attached patch (lua-5.1-string-paren-patch). There is also a related patch [1] that avoids spurious ambiguous syntax errors when the expression cannot be interpreted as a statement. Part of the reason for suggesting this was to analogously allow things like ({3,2,1}):map(f) to be rewritten as {3,2,1}:map(f). Now, even if that could give no syntax error, it would normally still give a runtime error. That would be avoided if we could automatically assign a default metatable with __index to constructed tables [3,*]. Lua doesn't do that, at least in part, because it interferes with using tables as maps/sets, but this problem can be avoided under the __methindex (a.k.a. __mcall) proposal [2], which allows ":" to be treated differently from ".". [1] http://lua-users.org/lists/lua-l/2009-01/msg00052.html [2] http://lua-users.org/lists/lua-l/2009-06/msg00394.html [3] http://lua-users.org/lists/lua-l/2003-12/msg00384.html [*] I was thinking of also adding a new table metamethod that would process fields (including nils) passed to the table constructor From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 20:35:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7FNZhwU020424; Sat, 15 Aug 2009 20:35:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7ABF118B30; Sat, 15 Aug 2009 20:35:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp09.bis.na.blackberry.com (smtp09.bis.na.blackberry.com [216.9.248.56]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4508718A3A for ; Sat, 15 Aug 2009 20:35:16 -0300 (BRT) Received: from bda159.bisx.prod.on.blackberry (bda159.bisx.prod.on.blackberry [172.20.226.139]) by srs.bis.na.blackberry.com (8.13.7 TEAMON/8.13.7) with ESMTP id n7FNZoba004032 for ; Sat, 15 Aug 2009 23:35:50 GMT Received: from bda159.bisx.prod.on.blackberry (localhost.localdomain [127.0.0.1]) by bda159.bisx.prod.on.blackberry (8.13.7 TEAMON/8.13.7) with ESMTP id n7FNZ8ZT009300 for ; Sat, 15 Aug 2009 23:35:08 GMT X-rim-org-msg-ref-id: 934144935 Message-ID: <934144935-1250379307-cardhu_decombobulator_blackberry.rim.net-63171639-@bxe1018.bisx.prod.on.blackberry> X-Priority: Normal References: <1301622269-1250378999-cardhu_decombobulator_blackberry.rim.net-1999156460-@bxe1018.bisx.prod.on.blackberry> In-Reply-To: <1301622269-1250378999-cardhu_decombobulator_blackberry.rim.net-1999156460-@bxe1018.bisx.prod.on.blackberry> Sensitivity: Normal Importance: Normal Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch To: "Lua list" From: delbu9c1@erau.edu Date: Sat, 15 Aug 2009 23:39:37 +0000 Content-Type: text/plain MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id n7FNZhwU020424 To clarify this, I am addressing this because the (...) has an obvious ambiguity -- that of a function call vs a new statement. However, my code would not appear, especially to beginners, to have the potential to be a function call. It is a strange construct similar to that of using no tabulation in code. Sent from my Verizon Wireless BlackBerry -----Original Message----- From: delbu9c1@erau.edu Date: Sat, 15 Aug 2009 23:34:29 To: Lua list Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch It seems like you're advocating that the following be ambiguous, if I understand you correctly. Foo = bar "baz":quux() That does not seem like a good idea to me... It would approach the point where semicolons are required all over the place. Personally I use semicolons all the time...but that's not the point. Matt Sent from my Verizon Wireless BlackBerry -----Original Message----- From: David Manura Date: Sat, 15 Aug 2009 18:40:37 To: Lua list Subject: x="abc":upper() v.s. x=("abc"):upper() patch Would there be any reason not to allow ("abc"):upper() to be rewritten as "abc":upper() ? One complication is that the syntax is ambiguous if the function call is used as or could be interpreted as a statement. The following is twice ambiguous: x = lower "abc" -- ambiguous "abc":foo() -- ambiguous We'd like to avoid adding ambiguous syntax. However, it could be argued that the above doesn't add a new class of ambiguous syntax but rather makes that existing class more consistent. The above is just syntactic sugar for x = lower ("abc") -- ambiguous ("abc"):foo() -- ambiguous which itself is just as ambiguous, even under Lua 5.1. The new rule enforced by the parser becomes "there can be no line break between prefixexp and args". This new rule, unlike the old one, is invariant under any translation between the two syntax forms above. A prototype of how this might be implemented is given in the attached patch (lua-5.1-string-paren-patch). There is also a related patch [1] that avoids spurious ambiguous syntax errors when the expression cannot be interpreted as a statement. Part of the reason for suggesting this was to analogously allow things like ({3,2,1}):map(f) to be rewritten as {3,2,1}:map(f). Now, even if that could give no syntax error, it would normally still give a runtime error. That would be avoided if we could automatically assign a default metatable with __index to constructed tables [3,*]. Lua doesn't do that, at least in part, because it interferes with using tables as maps/sets, but this problem can be avoided under the __methindex (a.k.a. __mcall) proposal [2], which allows ":" to be treated differently from ".". [1] http://lua-users.org/lists/lua-l/2009-01/msg00052.html [2] http://lua-users.org/lists/lua-l/2009-06/msg00394.html [3] http://lua-users.org/lists/lua-l/2003-12/msg00384.html [*] I was thinking of also adding a new table metamethod that would process fields (including nils) passed to the table constructor From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 21:38:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G0cXgP024695; Sat, 15 Aug 2009 21:38:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9021018CD2; Sat, 15 Aug 2009 21:38:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [76.96.62.96]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E12E218B3D for ; Sat, 15 Aug 2009 21:38:01 -0300 (BRT) Received: from OMTA10.westchester.pa.mail.comcast.net ([76.96.62.28]) by QMTA09.westchester.pa.mail.comcast.net with comcast id UoTo1c0040cZkys59oe0WA; Sun, 16 Aug 2009 00:38:00 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA10.westchester.pa.mail.comcast.net with comcast id Uoe01c00224UxC23Woe05Q; Sun, 16 Aug 2009 00:38:00 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id 225A73729E; Sat, 15 Aug 2009 20:37:59 -0400 (EDT) Date: Sat, 15 Aug 2009 20:37:58 -0400 From: Etan Reisner To: Lua list Subject: Re: Some minor FAQ tweaks (a bit delayed). Message-ID: <20090816003758.GG1825@aran> References: <560972290908030927y1b793a27qb2dd5f7c1f1a5199@mail.gmail.com> <20090814003051.GE1825@aran> <560972290908132323u862ff5aka6116d8a099364de@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290908132323u862ff5aka6116d8a099364de@mail.gmail.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My issue with the original text was the implication that they were developed for Windows and ported to other platforms, hence my reference to "porting history". I have no objections to the indication that they are available for multiple platforms. -Etan From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 22:50:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G1ojph029548; Sat, 15 Aug 2009 22:50:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3000B18ED1; Sat, 15 Aug 2009 22:50:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90A8818B06 for ; Sat, 15 Aug 2009 22:50:16 -0300 (BRT) Received: by ewy26 with SMTP id 26so2349543ewy.5 for ; Sat, 15 Aug 2009 18:50:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.104.11 with SMTP id b11mr1473491ebc.4.1250387414300; Sat, 15 Aug 2009 18:50:14 -0700 (PDT) In-Reply-To: <934144935-1250379307-cardhu_decombobulator_blackberry.rim.net-63171639-@bxe1018.bisx.prod.on.blackberry> References: <1301622269-1250378999-cardhu_decombobulator_blackberry.rim.net-1999156460-@bxe1018.bisx.prod.on.blackberry> <934144935-1250379307-cardhu_decombobulator_blackberry.rim.net-63171639-@bxe1018.bisx.prod.on.blackberry> Date: Sat, 15 Aug 2009 21:50:14 -0400 X-Google-Sender-Auth: 0c9a2a79283be61a Message-ID: Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Aug 15, 2009 at 7:39 PM, delbu9c1 wrote: > On Sat, Aug 15, 2009 at 7:34 PM, delbu9c1 wrote: >> It seems like you're advocating that the following be ambiguous, if I understand you correctly. >> >> Foo = bar >> "baz":quux() Yes, that would give an "ambiguous syntax" error under the new proposal, whereas currently it is interpreted as Foo = bar("baz"):quux(); . Alternatives without semicolons include Foo = bar "baz" :quux() Some discussion on semicolons was in [4]. [4] http://lua-users.org/lists/lua-l/2009-02/msg00360.html From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 23:12:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G2CRTB031827; Sat, 15 Aug 2009 23:12:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B8D3190B5; Sat, 15 Aug 2009 23:12:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E73E318A5A for ; Sat, 15 Aug 2009 23:12:04 -0300 (BRT) Received: by ewy26 with SMTP id 26so2354366ewy.5 for ; Sat, 15 Aug 2009 19:12:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.30.19 with SMTP id j19mr779127wea.46.1250388719984; Sat, 15 Aug 2009 19:11:59 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2009 03:11:59 +0100 X-Google-Sender-Auth: 860db5ccbfbc3040 Message-ID: Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7G2CRTB031827 On Sat, Aug 15, 2009 at 11:40 PM, David Manura wrote: > The new rule > enforced by the parser becomes "there can be no line break between > prefixexp and args". Given that: functioncall ::= prefixexp args | prefixexp `:´ Name args In the latter case, is the rule "no line break between prefixexp and args", or is it "no line break between Name and args"? Personally, I often find myself using this style of indenting in some situations: factory_function(...) :modifier_method_1(...) :modifier_method_2(...) -- etc. This places a newline between the prefixexp and the args, so if this no longer works, it would cause me problems. From lua-bounces@bazar2.conectiva.com.br Sat Aug 15 23:31:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G2VtGU000635; Sat, 15 Aug 2009 23:31:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC5AF1909C; Sat, 15 Aug 2009 23:31:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp07.bis.na.blackberry.com (smtp07.bis.na.blackberry.com [216.9.248.54]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E98F18ED1 for ; Sat, 15 Aug 2009 23:31:29 -0300 (BRT) Received: from bda159.bisx.prod.on.blackberry (bda159.bisx.prod.on.blackberry [172.20.226.139]) by srs.bis.na.blackberry.com (8.13.7 TEAMON/8.13.7) with ESMTP id n7G2VjEs032364 for ; Sun, 16 Aug 2009 02:31:45 GMT Received: from bda159.bisx.prod.on.blackberry (localhost.localdomain [127.0.0.1]) by bda159.bisx.prod.on.blackberry (8.13.7 TEAMON/8.13.7) with ESMTP id n7G2VI1F025747 for ; Sun, 16 Aug 2009 02:31:18 GMT X-rim-org-msg-ref-id: 1564675244 Message-ID: <1564675244-1250389878-cardhu_decombobulator_blackberry.rim.net-348102577-@bxe1018.bisx.prod.on.blackberry> X-Priority: Normal Sensitivity: Normal Importance: Normal Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch To: "Lua list" From: delbu9c1@erau.edu Date: Sun, 16 Aug 2009 02:35:45 +0000 Content-Type: text/plain MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sorry for being unclear. I feel that this would make more sense as two statements than it would as a single (complex) statement. ------Original Message------ From: David Manura Sender: lua-bounces@bazar2.conectiva.com.br To: Lua list ReplyTo: Lua list Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch Sent: Aug 15, 2009 6:50 PM On Sat, Aug 15, 2009 at 7:39 PM, delbu9c1 wrote: > On Sat, Aug 15, 2009 at 7:34 PM, delbu9c1 wrote: >> It seems like you're advocating that the following be ambiguous, if I understand you correctly. >> >> Foo = bar >> "baz":quux() Yes, that would give an "ambiguous syntax" error under the new proposal, whereas currently it is interpreted as Foo = bar("baz"):quux(); . Alternatives without semicolons include Foo = bar "baz" :quux() Some discussion on semicolons was in [4]. [4] http://lua-users.org/lists/lua-l/2009-02/msg00360.html Sent from my Verizon Wireless BlackBerry From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 00:59:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G3xRvm007445; Sun, 16 Aug 2009 00:59:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F49C18ED1; Sun, 16 Aug 2009 00:58:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f190.google.com (mail-pz0-f190.google.com [209.85.222.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CF4D18C2F for ; Sun, 16 Aug 2009 00:58:51 -0300 (BRT) Received: by pzk28 with SMTP id 28so1504897pzk.11 for ; Sat, 15 Aug 2009 20:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/yCnGC689QnL00BfERw2jj6OzPpKER3ebZNuxZ+b7fg=; b=XCtlB3YEhMdStd/D8KAwoQcTu8OshMDi6TIodeqEUFySYO25qBdWd5KabbvcQ8im+G Wow0/KCUsxCF0sNdLfLmVeAgCMgh1JKtxvfLCSNn6TctZQR5KewxH4eJmZRCV8PQpIEe 1InVOBJJxevJvTfKUbz0LI1n8QfksqfHkr7Nc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eSczBpzpCPhGordI3eS+E0lDM343N+OSD5k8pZY8gUHTv2+NKMK0mnq5weWifQ6FNE ej7XTDgLcQI2iJRgrjg32nJj8AUsGgsJE3lkOf7P5UvD6vVoCaggqngkt/7VYrXOEQQt aBL54xWQryJv9nW/6Z4CNyK+92azaZprhqPwo= MIME-Version: 1.0 Received: by 10.142.239.17 with SMTP id m17mr468669wfh.2.1250395129902; Sat, 15 Aug 2009 20:58:49 -0700 (PDT) In-Reply-To: <4A873B08.40908@cowlark.com> References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE> <90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com> <1286F5BE029B4C228D910AF774EB824A@CAYENNE> <9E041F4F488442149B79E55244A693E9@CAYENNE> <4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE> <17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com> <42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE> <4A873B08.40908@cowlark.com> Date: Sat, 15 Aug 2009 20:58:49 -0700 Message-ID: <17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Aug 15, 2009 at 3:47 PM, David Given wrote: > Michael Newberry wrote: > [...] >> The missing concept in precisely what has to happen for the userdata >> I've created to be referenced? Do I push the userdata ptr onto the >> return stack using lua_pushlightuserdata( ptr ) and then, in the script, >> set a table element to the return value? Sorry, Michael, I thought you said you'd be binding code into lua for years. Your code ends with pushlightuserdata(), then does "return 1". So, it is returning only 1 thing, and that thing is not the userdata you'd created earlier. > A userdata is just another Lua object type, like a lightuserdata. So > just push it onto the stack and return it. You don't need to use > lightuserdatas at all. > > Basically: > > lightuserdata: 4 bytes only, no metatable, no notification when GCd > > userdata: any number of bytes, metatable, notification when GCd > > Check out the example here: http://www.lua.org/pil/28.1.html The fundamentals of this are covered in the above, and the succeeding chapters which cover __gc (and I also posted a link to), and explained much better than I can. If are comfortable in C, and sit down and spend a few hours reading carefully through those chapters, and write a small example to start with, then build up, you should be OK. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 05:40:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G8eoi8008446; Sun, 16 Aug 2009 05:40:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F178E18B38; Sun, 16 Aug 2009 05:40:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF83F18A7F for ; Sun, 16 Aug 2009 05:40:13 -0300 (BRT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1McbHW-0004OI-MN for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 08:40:02 +0000 Received: from c-76-104-160-178.hsd1.wa.comcast.net ([76.104.160.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 08:40:02 +0000 Received: from stuart by c-76-104-160-178.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 08:40:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Xavante WebDAV support? Date: Sun, 16 Aug 2009 01:21:38 -0700 Lines: 5 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-104-160-178.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I saw some messages about this dating from about 4 years ago, so I was wondering: does the latest version of Xavante have WebDAV support? I noticed the old versions' main pages listed that "WebDAV support [was] in the works" and that that line is not on the 2.X pages. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 05:46:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G8kdYI008897; Sun, 16 Aug 2009 05:46:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5C9D18CD5; Sun, 16 Aug 2009 05:46:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDF9018C14 for ; Sun, 16 Aug 2009 05:46:07 -0300 (BRT) Received: from Stucomet (c-76-104-160-178.hsd1.wa.comcast.net [76.104.160.178]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1McbNL2Llo-000D8m; Sun, 16 Aug 2009 04:46:06 -0400 Message-ID: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: SVG generation in Lua Date: Sun, 16 Aug 2009 01:45:50 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0124_01CA1E13.48C71920" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-Provags-ID: V01U2FsdGVkX18/v37doRCtCj3Lex5lOTOilSnzzh+XR4RnpZU WPkftbH8gMXsk5pBYpJTUQ3kaLXWVDEAeGECReQvCU23EzWXXC dZ55H4ERuCKD0K/Pq62YaPB0UfvV8NA X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0124_01CA1E13.48C71920 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit Woah, crazy! Not only was I wondering about SVG generation in Lua the other day, but I've also written a modeling framework that works almost exactly like this! function hq.thriller() local waist=.825 local shoulders=.3 local shouldout=.1 local blackw=.05 local headheight=.15 local hairw=.5 local hairh=.4 local neckout=.15 local hcenter=right/2 color(1,1,1) rect(left,top,right,bottom) --hair color(.02,.01,0) cutcircle({hcenter,headheight},hairw,25,160,hairh) cutcircle({hcenter,headheight},hairw,120,230,hairh) --base jacket color(1,0,0) rect(left,top+shoulders,right,bottom) polygon( {left-shouldout,shoulders}, {right+shouldout,shoulders}, {right-hcenter/2,bottom}, {left+hcenter/2,bottom}) --lines color(0,0,0) parallelogram( {left-blackw,shoulders}, {hcenter-blackw,bottom}, blackw) parallelogram( {right,shoulders}, {hcenter,bottom}, blackw) polygon( {hcenter-neckout,shoulders}, {hcenter+neckout,shoulders}, {hcenter,waist} ) end (This gets passed to a function "model", which uses as an environment a table of primitive-generating functions. The result is attached, and yes, due to a slight miscalculation I haven't bothered to fix, the "hair" wedges above the top of the "head".) Also, would SVG work as a driver for CanvasDraw? -------------------------------------------------- From: "Asko Kauppi" Sent: Wednesday, August 12, 2009 A12:32 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: SVG generation in Lua > I've planned a separate svggraph module for such. This is just a start. > So, not yet. > > - asko > > On 12.8.2009, at 9.59, Lloyd wrote: > >> Is there any method available to plot interactive graphs using this >> method? For example if we have millions of items in a graph, it will be >> difficult to present in a single screen. In that case, we will represent >> items as very small items, and will give the user more option to zoom >> the graph. Like this, is it possible to draw an interactive graph? >> >> Thanks, >> Lloyd >> >> >> On Wed, 12 Aug 2009 11:43:23 +0530, Asko Kauppi >> wrote: >> >>> >>> I'll be doing some SVG graphics work and applied some Lumikki-kind >>> thinking to making a simple SVG generation tool, in Lua. >>> >>> Currently available only by svn checkout, from: >>> >>> svn co svn://slugak.dyndns.org/public/2009/Svg >>> >>> Here's one of the sample files: >>> >>> -- >>> -- ELLIPSE1.LUA >>> -- >>> >>> require "svgcore" >>> >>> local rgb= assert(svg.rgb) >>> >>> print( svg.document( >>> svg.default{ stroke_dasharray={2,2}, >>> -- >>> svg.ellipse{ {80,110}, {75,105}, fill="#538" }, >>> svg.ellipse{ {80,110}, {60,40}, fill="black", stroke="red", >>> stroke_width=25 }, >>> svg.ellipse{ {80,110}, {35,20}, fill="#538", stroke="yellow", >>> stroke_width=25 }, >>> svg.ellipse{ {80,50}, {40,30}, fill="red", stroke="black", >>> stroke_width=25 }, >>> svg.ellipse{ {80,50}, {30,20}, fill="orange", stroke="red", >>> stroke_width=10 }, >>> svg.ellipse{ {80,170}, {40,30}, fill="yellow", stroke="orange", >>> stroke_width=25 }, >>> svg.ellipse{ {80,170}, {30,20}, fill="red", stroke="black", >>> stroke_width=10 } >>> } >>> ) ) >>> >>> The idea is that Lua syntax is a bit nicer to craft than XML, but this >>> also allows programmatic creation of macro-like objects (functions that >>> create graphical objects) that can be turned around, copied etc.. SVG >>> has a "uses" element for that, but this is more easy on the eyes >>> (clearer code). >>> >>> I post this mostly to inform if anyone has a similar need. Be my guest >>> and use it. Haven't decided the license yet. >>> >>> Btw, SVG + JavaScript is a perfect blend for making visually good- >>> looking UI applications. SVG in theory support any scripting language, >>> so maybe we can at one day have SVG+Lua viewer. >>> >>> -asko >>> >> >> >> >> ______________________________________ >> Scanned and protected by Email scanner > ------=_NextPart_000_0124_01CA1E13.48C71920 Content-Type: image/png; name="thriller.png" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="thriller.png" iVBORw0KGgoAAAANSUhEUgAAAUEAAAFuCAMAAAAoKlrgAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRF AAAABQMAAAAz/wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX5wS8gAAABh0RVh0U29mdHdhcmUAUGFpbnQuTkVU IHYzLjM2qefiJQAACmZJREFUeF7t3dl24zYURNGO3f//zeluTyJF4g5VF5PKT1kxIYlbBwBFOSu/ 3vSDCfzChmv0mwTRCCQoQVQAHa8GJYgKoOPVoARRAXS8GpQgKoCOV4MSRAXQ8WpQgqgAOl4NShAV QMerQQmiAuh4NShBVAAdrwYliAqg49WgBFEBdLwalCAqgI5XgxJEBdDxalCCqAA6ft4G/7v5Qc+Y PX46wTu453/Ppkg+3kSCfrvHI5PnzRs2h2AO72cUzyP+SOMFUb2v8fFz54wYK8jSG6k4UJDN9/F4 nLACjzJKsIZvBOIQwUq+7oj9Bev5+iJ2FuzF1xGxq2Bfv077SkfB/n5dDLsJjvHrYNhJcJxfuWEX wbF+xYYdBMf7lRqWC87hV2hYLDiPX5lhreBcgDW3HSoFZ/OrybBOcEa/CsMywVkB6VO5SHBeP3qG NYJzA3IzLBGcHZBKWCA4vx91JvMF1wDkZUgXXAWQRkgWXMePNpO5gmsBcjKkCq4GSCFkCq4HyCAk Cq4ISCDkCa4JiBPSBFcFhAlZgusCooQkwZUBQUKO4NqAGCFFcHVAiJAhuD4gQkgQ3AEQIMQF9wDM E0rwq4DAH58fDoUFd0kwHSEquA9glhAU3AkwSYgJ7gWYI5TgYwWZ3QQS3C3BVISI4H6AGUIJHjuI z2NAcMcEExHmBfcEjBNK8FxCdB6nBZXgJ/UrCkYrax+fFZw8QS5S89EWFuyo1HqqpGCnBCdBqmiQ KPh76A/+HuUaDAIONWo/uQTRN2eQ4D4J/pbgmg0GE/wPPcvK8WMalOCje2IvjgKqwXPoEkS/cZcg KBgG1Cw+zWIJHkHiO0lYsPJiBH7sAVczYcCpJ/GIzyQSPGUbnsUSlOBh7ey/DsYT1Dp4fJckeK42 ug5KUILHS8ju6+BuCfa/HpTgU7TBdVCCEjx9ktY6iN5akOBqgollcO6PJN33Ygk+z/rYXixBCZ7X zd47SaJBdKkvHi9BFFiCEkQF0PFqUIKoADpeDUoQFUDHq8H9BdEzrB4/f4PVAujjS1CCqAA6Xg2u JvgWvjmDnmH1+N4NShC9wypBCY6+Rx1usHoZgx9/+nUQPsPqB+guGI2wGgB+fAmihBKUICqAju/f YHAhRE+wfLwEUWIJ7i6Inl/9+AENhhbCegH0GSQoQVQAHT+iwcg0Rs+vfrwEUWMJLikYmMbo+dWP H9KgBA/ssb/l/xzq/cauPiH4GcY06I4QPr/6Bxgk6CWsB4CfQYIo4ShBZ4To6XUYP0bw/eHn18PP 47/3//PjIyD/7H9Gz+v3y6b2Ys9LcJ8Qoga/f3cP4Ad8Gy/4ziF0v2OHA2cQPACkTmOg4G3D1Q2+ TTiN4Tfv8QECgLlZfBCcI0Iq4Hu94HwRUgUjgMkGuREyFsKMIGMVfKMIovN4kOD9pVCPBmeLcFyC 2QaPguMjTAiSEkwLUiPEpzFTMDSH0+vg21wRMgFDlzJ/tFOf6v69S65PR85TQyN0Po3rg0AwQZYg uBL2F2StgrQGJRhN92kaDyWMT2JegsAspu4l2DReVZBJ2FmQmCDSIFMQus06NEGiILYSIhGGBRtf DsQ3hPz14PmS8B0i7ClIBYQaPE1jCcYDnoMwOom5CWINShD6XPx8UQ2thPmFMNhg6zvmxDQEG5wh wiBga7XOAJIFkc0kG2FQkJ0gKkiMcLxgKkG2IBBhH0F6grDg8Ah5kziXIF2we4QxQX6CEvx5B0Y1 eJ7GnSMcniDeoAST7T4MO2eQ/sPSzG4carBgFUS+afo2fDqJLGG1YPN1pUuC7g9+PCtNMHGjmpZg 9Hv2H3CCII8wHmFEsCZBwk5CjPBlBcdFOEGClAYlmN6GvgY+p5DcjqPTONBg+xUBBIydhLcSjhIE ADmz+HkaZz/bxQhnSJAkSFsJxwgiCZYJJiOsEixbBSmf6qgfTCKErEkMJchqkLYS1ggWJlgomJvH JYLGtdUcDbIiHCCIAdIavBCsjtC9DJYmyBPsHyFJEEywVDAVoX8aewVrE5xP0H2b1QtovY/zNMha Cb0RegWLEyQ2KEG05os7NKk/KCQ3WJ0gs8G+Ec4yiasFrWX8ysEXoVPQutWLzzzOHdabrz3/nKV1 BhcQEjyiFBGSEsx/Tfwdb3WDVRG+kGCC0DONfYL2BJh/HcwshTRBG3CFWZzZTGxCVoJrCMbnMUnQ kaAEmy3uI8iP0DWJPYCLNChB745/X4Yrh4fh1kLoadD3nN5zuz+u/Ir638n6zubHRYJPjXAJeQmu sg6yI3xFweg8bk9jh6A3+lXWQW6EDkD3O7aOoPuUPnlaEToEvQmusw6G92NM0A0owZsc9xQMzuP7 CO1J7AdcqkEJ2ruWFUcgjePmfezReprQW2WflXVEn091HycdErz9+xkTMPQ8lo/9+56CoVPLC4be KFvIOkKClpD1+66CoQjvNmNrFocSXGsvjq6E14QWYOhdel9OMHR6OcFYghJ8LnJ3QThCaxIHAddr UILNrd3qI3pZfbUQGs8RTXDBBiOfTOKCYcDNBS8+lrATXFIwsBQ+R9gWjCcowaPoqwgCEdITXLNB Cd5e0biuZkI3Cs8LYfMZEnN4wc/FwVutErxrxp1L4P6++zEPL8q6+2f/vu/9wa8X7z5bCaIR+gXd b8rxJdmNWUeMadC/Hbth3AduIugm9MJ4jztPCqsw+/eDGnTfYHDKOA97XlRsIesICVpC1u+HCXrn 8U9djcvpdIKLfqoLXVZL8L4cXzgeQd8jXb4Sa47avx83i6PTuGQSLz2LvdvxV2BozNfj7casIwY2 6IxQgujsMwWBVXDZu1uxGwwfQjWTePF10LkSGoJQghL8U+ZrC/pOvzmJMcDlG5Tg8VrJ/U3Tw4Ge hFoNesa3Xpd1tWf/fuT1oPcvkRqCKOD6s9i3Edxfy0jQt5feCsKAOzTo2UwkyP9zl9Atxs13Et9K eI2AT+ItZnGekAAowW/EzLXo3zH29Z51xPDrwb+nkYspN+pEbfnYv5egbdQ+YgrBVISUBHeZxRL8 zDy7mqdWQk6C2zQY30xIgBI0vkKxZwW6j/D+f3V/X4n9etHv7b7HsxLcqMHgZiLBixgjKJFj2zNj o1kcilCCl134WfxHmkvzTg0GIpTgTRleGO9xZoD73Jv5PFWvjPe41xN0zmMm4E7Xg/77hBIEP5hQ AXdr0DWNJdhc320e+wjPBvJ9zFbXg64/oyEDbjeL7fuEEjSnWJuIDbhhg8ZmIkEzwfY8pgPu2GAz Qgk6EmxFyAfcssFGhBJ0JXgfYQHgng3eRihBZ4J3EVYAbtrgTYQSdCd4HWEJ4K4NXhHWAEow0PX1 ofvd3fo6z3NyRQnu2+DTZiLB8HQ7klUBbtzgKUIJhhO8/5+FJR6qMWSunQR/NSs+AvO/hljx/PHX LEHUUIISRAXQ8WpQgqgAOl4NShAVQMerQQmiAuh4NShBVAAdrwYliAqg49WgBFEBdLwalCAqgI5X gxJEBdDxalCCqAA6Xg1KEBVAx6tBCaIC6Hg1KEFUAB2vBiWICqDj1aAEUQF0vBqUICqAjv8fKSbU WLjE+hwAAAAASUVORK5CYII= ------=_NextPart_000_0124_01CA1E13.48C71920-- From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 05:53:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G8r8bJ009581; Sun, 16 Aug 2009 05:53:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56C0C190C7; Sun, 16 Aug 2009 05:52:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E841C18F56 for ; Sun, 16 Aug 2009 05:52:44 -0300 (BRT) Received: by gxk18 with SMTP id 18so2959934gxk.5 for ; Sun, 16 Aug 2009 01:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=uL8sg7Jf6w1Jh9KwoDyg6hFNHYfKQuHVWce7XU9wuLA=; b=t8jUstztiHJXZMMN1nr9AikmtEpkmU1CanMZewEf0/DFrBnnqnCXkl56oGxiIRtfI5 7Y2t7M+k57HEGIAFPJE1X6f7cvGNTl9SHLU/9IP+9grfK0bd3jU6Fea3KFyxd3TnmnTP zR8NcPtCczJvQmITHQDPeYVBielAXDMB/Jua4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=DI4oQP4l+AhlvnTYxMNxunxEXDNkAAETL0i8ctwHjkYXFIuf4iVdgMNFA52SJC6XUb VONsqvjh1lYYRcFNqWO+Ij0CvLSOmIBwjhG37tR4Knhy7hDJPGa93jjdsm7LORsnjzv/ MbCnrNEyFKxA8CEpW1SEFe64XbyUsxxxwZ6QY= Received: by 10.90.104.9 with SMTP id b9mr516agc.14.1250412761871; Sun, 16 Aug 2009 01:52:41 -0700 (PDT) Received: from ?192.168.1.34? ([72.14.241.8]) by mx.google.com with ESMTPS id 9sm3845434agc.22.2009.08.16.01.52.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 01:52:40 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Xavante WebDAV support? Date: Sun, 16 Aug 2009 10:52:07 +0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 16, 2009, at 10:21 AM, Stuart P.Bentley wrote: > I saw some messages about this dating from about 4 years ago, so I > was wondering: does the latest version of Xavante have WebDAV > support? I noticed the old versions' main pages listed that "WebDAV > support [was] in the works" and that that line is not on the 2.X > pages. Not sure about the state of Xavante's WebDAV code: http://luaforge.net/plugins/scmcvs/cvsweb.php/xavante/src/webdav/?cvsroot=xavante Alternatively, Nanoki does provide WebDAV support: http://dev.alt.textdrive.com/browser/HTTP/WikiDAV.lua For example, you can access the online demo of Nanoki through WebDAV: http://svr225.stepx.com:3388/ webdav://svr225.stepx.com:3388/ In a contemporary OS, the above will mount Nanoki as a remote file system (e.g. on Mac OS X, under Finder -> Go -> Connect to Server / Network ). Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 06:37:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7G9bXOW012558; Sun, 16 Aug 2009 06:37:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F014818BED; Sun, 16 Aug 2009 06:37:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85A0918B1F for ; Sun, 16 Aug 2009 06:36:58 -0300 (BRT) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090816093649.LORJ6611.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Sun, 16 Aug 2009 10:36:49 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090816093649.EAEK21638.aamtaout02-winn.ispmail.ntl.com@STORE.store> for ; Sun, 16 Aug 2009 10:36:49 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id BA7D0B9E4 for ; Sun, 16 Aug 2009 10:41:34 +0100 (BST) Message-ID: <4A87D32C.4010402@ntlworld.com> Date: Sun, 16 Aug 2009 10:36:44 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Hi and pushing existing UserData from pointer Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=DQPCZR6BsDoA:10 a=AjNtXHXTAAAA:8 a=IYjqJruMM1-1ZDeRn0IA:9 a=ARpcWCja_f7nHoHjXCwA:7 a=wd3GtoQ5ET2eyXcSXrtVklDGOesA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all! First off nice language! nice and light, reasonably fast and yet small, without being crippled.... I'm wrapping a library and have a good portion done, I've used user data, so that I have newly created objects from the C library collected by lua's GC (nice!) All is working well as I'm just creating new instances and returning them, basically very much like this http://lua-users.org/wiki/UserDataExample I can set up from lua a callback by having a kind of callback proxy in C which actually receives the callback and then runs the appropriate lua function The Lua call back function needs to receive some references to userdata objects that are already in existence and all I have for them is the C pointer to the structure I've wrapped. At the moment I can see different return values from different lua callback functions but I cannot send them useful information! heres what I have after trying many different things, (as a result its a mess!) I can pass a number as a parameter and all works as it should void* d; // temp will live in void* data with other stuff int CollFunc(cpShape *a, cpShape *b, cpContact *contacts, int numContacts, cpFloat normal_coef, void *data) { lua_getglobal(d,data); // routine name will be inside struct pointer to callback data // lua_pushlightuserdata(d, a); lua_pushvalue(d,(void*)a); luaL_getmetatable(d, "cpShape"); // luaL_pushUDfromPointer((void*)a)! lua_setmetatable(d, -2); // lua_pushlightuserdata(d, b); lua_pcall(d, 1, 1, 0); int r=lua_toboolean(d,1); lua_pop(d,1); return r; } Is there any way to make a new userdata that is a reference to an already allocated userdata from just a C pointer? I did google but couldn't really find too much (I will do a quick wiki page on this once I understand how to do it...) Best Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 07:34:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GAYSX8016302; Sun, 16 Aug 2009 07:34:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29F3518CF8; Sun, 16 Aug 2009 07:34:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82D0018A7F for ; Sun, 16 Aug 2009 07:33:59 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mcd3h-0000dQ-J2 for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 10:33:53 +0000 Received: from c-76-104-160-178.hsd1.wa.comcast.net ([76.104.160.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 10:33:53 +0000 Received: from stuart by c-76-104-160-178.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 10:33:53 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Suggestion: strip indentation for long string constructor Date: Sun, 16 Aug 2009 03:33:28 -0700 Lines: 19 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-104-160-178.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It would be nice if Lua supported some form of indentation in the long string constructor (similar to http://en.wikipedia.org/wiki/YAML#Indented_delimiting), so that a table of multiple long strings could indent them, as seen below: example={ deep={ deeper={ string= [[ This string starts with 6 spaces! And there's another six after that newline! Does that look right to you?]] } } } From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 10:19:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GDJpa7028916; Sun, 16 Aug 2009 10:19:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5D4B18A5B; Sun, 16 Aug 2009 10:19:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95F9318814 for ; Sun, 16 Aug 2009 10:19:20 -0300 (BRT) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GDJHIl028875 for ; Sun, 16 Aug 2009 10:19:19 -0300 From: "Antonio Scuri" To: "'Lua list'" References: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> In-Reply-To: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> Subject: RE: SVG generation in Lua Date: Sun, 16 Aug 2009 10:18:46 -0300 Message-ID: <001501ca1e74$1741d370$45c57a50$@puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoeThHlVEJP2EPbQ0GmvzqJ+tVFUgAJc2Aw Content-Language: pt-br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Also, would SVG work as a driver for CanvasDraw? Yes, we can do a driver for CD. It is on To Do list for the next version. Best, Scuri From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 10:30:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GDUnFs029668; Sun, 16 Aug 2009 10:30:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A56071894D; Sun, 16 Aug 2009 10:30:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 573EF18743 for ; Sun, 16 Aug 2009 10:30:22 -0300 (BRT) Received: by ewy26 with SMTP id 26so2507822ewy.5 for ; Sun, 16 Aug 2009 06:30:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.131.14 with SMTP id e14mr1999144ebd.11.1250429420068; Sun, 16 Aug 2009 06:30:20 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2009 15:30:20 +0200 X-Google-Sender-Auth: c35fde236b6f069e Message-ID: Subject: Re: [ANN] lua-Coat 0.2.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7GDUnFs029668 2009/8/15 David Manura : > On Fri, Aug 14, 2009 at 11:02 AM, François Perrad wrote: >> lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), >> a Perl module which mimics Moose (http://www.iinteractive.com/moose/), >> an object system for Perl5 which borrows features from Perl6, >> CLOS (LISP), Smalltalk and many other languages. >> ...The homepage is at http://lua-coat.luaforge.net/, > > > That seems to have some traction [3-4]. > Yes, it's a port. > In this syntax: > >  require 'Coat' >  class 'Point' >  has( 'x', { is = 'rw', isa = 'number', default = 0 } ) >  has( 'y', { is = 'rw', isa = 'number', default = 0 } ) >  overload( '__tostring', function (self) >    return '(' .. self:x() .. ', ' .. self:y() .. ')' >  end ) >  method( 'draw', function (self) >    return "drawing " .. self._CLASS .. tostring(self) >  end ) > > the "end )" feels a bit awkward to write for every method in a > program: it's a statement-level keyword (end) contained inside an > expression-level ")", which tend not to mix in Lua.  The "end" and ")" > don't align to their matching start tokens, and the function block has > less indentation than the "function" keyword.  The original also > involves quoting identifiers ('draw'). > I agree. The syntax needs improvement. I wrote small patches (see patch/) which allows a more perlish syntax. I will send a specific message about them. > It could be written in a more luaesque way a follows: > >  require 'Coat' >  class 'Point' >  has.x = { is = 'rw', isa = 'number', default = 0 } >  has.y = { is = 'rw', isa = 'number', default = 0 } >  overload.__tostring = function (self) >    return '(' .. self.x .. ', ' .. self.y .. ')' >  end >  method.draw = function (self) >    return "drawing " .. self._CLASS .. tostring(self) >  end >  -- The above can also be written as such: >  -- function method.draw(self) >  --   return "drawing " .. self._CLASS .. tostring(self) >  -- end > > where "has", "overload", and "method" are tables, possibly with > __newindex metamethods. > > I think self.x rather than self:x() tends to be the preferred syntax > for object properties in Lua.  This requires a proxy table though. > > Here's a few initial comments on the source: > > >> module(..., package.seeall) > > > I recommend avoiding package.seeall since it pollutes your external interface: > >  require "Coat" >  print(Coat.math) --> table: 0x100549c8 > Fixed in release 0.2.1 > >> basic_type = type >> local basic_type = basic_type >> local function object_type (obj) >>     local t = basic_type(obj) >>     if t == 'table' and obj._CLASS then >>         return obj._CLASS >>     else >>         return t >>     end >> end >> _G.type = object_type > > > This breaks type().  Consider: > Fixed in release 0.2.1 >  require "Coat" >  require "someothermodule" > > where someothermodule internally applies type to a read-only table: > >  local t = setmetatable({x=1}, {__index=function() error'read only' end}) >  assert(type(t) == 'table') > > and now fails. > > >> function _G.class (modname) > > > This can then imply that other modules in your program cannot > internally use Steve's class.lua module [1].  Consider this: > Yes, there is a conflict between them. >  -- b.lua >  require "class"   -- internally uses class.lua >  ..... > > which in turn is used by this: > >  -- a.lua >  require "Coat" >  require "b" >  class "a" -- opps, invokes class.lua not Coat.lua > > I've had complaints about the Lua module system in the past [2]. > > >> function _G.class (modname) >>     checktype('class', 1, modname, 'string') >>     if _G[modname] then >>         error("name conflict for module '" .. modname .. "'") >>     end > > > Is there a way to create anonymous classes? or lexically scoped > classes?  For example, > No. In fact, class 'Foo' acts like module 'Foo' (with some OO magic). My current plan for release 0.3.0 is a support of submodule, like class 'MyApp.Foo.Bar'. Thanks for this great feedback. François Perrad >  local class = require "Coat" . class >  local T = >    class(function() >      function method.test() print 'test' end >    end) >  T():test() --> test > > > [1] http://lua-users.org/wiki/SimpleLuaClasses > [2] http://lua-users.org/lists/lua-l/2009-08/msg00297.html > [3] http://www.iinteractive.com/moose/ > [4] http://search.cpan.org/~drolsky/Moose/lib/Moose/Manual/Unsweetened.pod > > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 10:35:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GDZ4rE030028; Sun, 16 Aug 2009 10:35:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51ADE18A93; Sun, 16 Aug 2009 10:34:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout7.freenet.de (mout7.freenet.de [195.4.92.97]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 866831879E for ; Sun, 16 Aug 2009 10:34:35 -0300 (BRT) Received: from [195.4.92.24] (helo=14.mx.freenet.de) by mout7.freenet.de with esmtpa (ID lunoxos@freenet.de) (port 25) (Exim 4.69 #92) id 1McfsV-0006Dt-Jc for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 15:34:31 +0200 Received: from dslb-092-078-047-204.pools.arcor-ip.net ([92.78.47.204]:32984 helo=[192.168.0.3]) by 14.mx.freenet.de with esmtpsa (ID lunoxos@freenet.de) (SSLv3:AES256-SHA:256) (port 465) (Exim 4.69 #94) id 1McfsV-0007Zx-Cl for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 15:34:31 +0200 Subject: CouchDB for Lua? From: Jan =?ISO-8859-1?Q?Sch=FCtze?= To: "'Lua list'" Content-Type: text/plain Date: Sun, 16 Aug 2009 15:34:29 +0200 Message-Id: <1250429669.6796.8.camel@kymari> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-purgate-ID: 149285::1250429671-00000AC2-CE3328EE/0-0/0-0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello! I would like to try out couchdb with lua. Is there any library, yet? Kind regards, Jan ------------------------ http://dracoblue.net From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 10:43:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GDhmTL030745; Sun, 16 Aug 2009 10:43:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ADFE1855B; Sun, 16 Aug 2009 10:42:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD0B818BB2 for ; Sun, 16 Aug 2009 10:42:49 -0300 (BRT) Received: by ewy26 with SMTP id 26so2511686ewy.5 for ; Sun, 16 Aug 2009 06:42:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.136.1 with SMTP id j1mr1954751ebd.74.1250430166490; Sun, 16 Aug 2009 06:42:46 -0700 (PDT) Date: Sun, 16 Aug 2009 15:42:46 +0200 X-Google-Sender-Auth: 7fe0139c6c6675ac Message-ID: Subject: Improvements for creating DSL with Lua From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/mixed; boundary=0015174bee94e3df44047142751a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174bee94e3df44047142751a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit For creating a DSL (Domain Specific Language), you have choice between writing your own parser or extending a language. Since its origin, Lua is well suited for data oriented DSL. But for declarative DSL, the mandatory use of parenthesis for arguments function (except in case of a single string or table) is a big limitation. As example, consider the 2 following versions of the same code (which come from my current work on and it is not really a DSL and David Manura already send me some good suggestions in pure Lua) -- "classic" Lua class 'Point' has( 'x', { is = 'rw', isa = 'number', default = 0 } ) has( 'y', { is = 'rw', isa = 'number', default = 0 } ) overload( '__tostring', function (self) return '(' .. self:x() .. ', ' .. self:y() .. ')' end ) method( 'draw', function (self) return "drawing " .. self._CLASS .. tostring(self) end ) and -- "patched" Lua class 'Point' has 'x' => { is = 'rw', isa = 'number', default = 0 } has 'y' => { is = 'rw', isa = 'number', default = 0 } overload '__tostring' => function (self) return '(' .. self:x() .. ', ' .. self:y() .. ')' end method 'draw' => function (self) return "drawing " .. self._CLASS .. tostring(self) end A seasoned Lua developper could make abstraction of extra parenthesis. But a DSL user cannot because usually he doesn't known Lua. My first patch allows multiple arguments without parenthesis if the first argument is a string. It also introduces the token `=>' named FAT_COMMA. The grammar modifications are : funcargs -> ( [explist] ) | tableconstructor |STRING { expsep expr } expsep -> `,' | `=>' Some examples : > print 'a', 2, 'c', 4 a 2 c 4 > print('a', 2, 'c', 4) -- equiv a 2 c 4 nested call is possible > print 'a', 2, print 'c', 4 c 4 a 2 > print( 'a', 2, print( 'c', 4)) -- equiv c 4 a 2 semicolon forces the end of a level > print 'a', 2, print 'c';, 4 c a 2 nil 4 > print('a', 2, print('c'), 4) -- equiv c a 2 nil 4 This patch is not backward compatible with Lua, for example it breaks the following code : function printf(...) io.write(string.format(...)) end printf("Hello %s from %s\n", os.getenv "USER", _VERSION) it must be rewritten : printf("Hello %s from %s\n", os.getenv("USER"), _VERSION) My second patch allows multiple arguments without parenthesis in all case (except if the first argument is a name) The grammar modifications are : funcargs -> ( [explist] ) | expr { expsep expr } expsep -> `,' | `=>' The syntax becomes ambiguous in many case. I parse the indentation (like Python) in order to solve this issue, and the lexer generates extra semicol. This second patch is very experimental. Now with it, I could write : subtype 'Natural' => as 'number'; => where function (n) return n > 0 end; instead of : subtype( 'Natural', as( 'number' ), where( function (n) return n > 0 end ) ) I hope that Lua will become the best choice for building DSL. Francois Perrad --0015174bee94e3df44047142751a Content-Type: application/octet-stream; name="0001-function-call-allows-arguments-after-a-initial-strin.patch" Content-Disposition: attachment; filename="0001-function-call-allows-arguments-after-a-initial-strin.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fyfthq4c0 RnJvbSA2NzhhZmNmYTBiNjZiODgwZjNjMjljMjcwYjlhYjA3NWRmNGQ3Yjk0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGcmFuY29pcyBQZXJyYWQgPGZyYW5jb2lzLnBlcnJhZEBnYWR6 Lm9yZz4KRGF0ZTogTW9uLCAzIEF1ZyAyMDA5IDExOjE1OjE4ICswMjAwClN1YmplY3Q6IFtQQVRD SF0gZnVuY3Rpb24gY2FsbCBhbGxvd3MgYXJndW1lbnRzIGFmdGVyIGEgaW5pdGlhbCBzdHJpbmcg d2l0aG91dCBwYXJlbnRoZXNpcwoKICAgIGZ1bmNhcmdzIC0+IFNUUklORyB7IGV4cHNlcCBleHBy IH0KICAgIGV4cHNlcCAtPiBgLCcgfCBgPT4nCi0tLQogZG9jL21hbnVhbC5odG1sIHwgICAgNCAr KystCiBzcmMvbGxleC5jICAgICAgfCAgICA5ICsrKysrKystLQogc3JjL2xsZXguaCAgICAgIHwg ICAgMiArLQogc3JjL2xwYXJzZXIuYyAgIHwgICAxMCArKysrKysrLS0tCiA0IGZpbGVzIGNoYW5n ZWQsIDE4IGluc2VydGlvbnMoKyksIDcgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZG9jL21h bnVhbC5odG1sIGIvZG9jL21hbnVhbC5odG1sCmluZGV4IGY0NmYxN2MuLjVhODRkMzEgMTAwNjQ0 Ci0tLSBhL2RvYy9tYW51YWwuaHRtbAorKysgYi9kb2MvbWFudWFsLmh0bWwKQEAgLTg3NTYsNyAr ODc1Niw5IEBAIEhlcmUgaXMgdGhlIGNvbXBsZXRlIHN5bnRheCBvZiBMdWEgaW4gZXh0ZW5kZWQg Qk5GLgogCiAJZnVuY3Rpb25jYWxsIDo6PSAgcHJlZml4ZXhwIGFyZ3MgfCBwcmVmaXhleHAgYDxi Pjo8L2I+JmFjdXRlOyBOYW1lIGFyZ3MgCiAKLQlhcmdzIDo6PSAgYDxiPig8L2I+JmFjdXRlOyBb ZXhwbGlzdF0gYDxiPik8L2I+JmFjdXRlOyB8IHRhYmxlY29uc3RydWN0b3IgfCBTdHJpbmcgCisJ YXJncyA6Oj0gIGA8Yj4oPC9iPiZhY3V0ZTsgW2V4cGxpc3RdIGA8Yj4pPC9iPiZhY3V0ZTsgfCB0 YWJsZWNvbnN0cnVjdG9yIHwgU3RyaW5nIHtleHBzZXAgZXhwfQorCisJZXhwc2VwIDo6PSBgPGI+ LDwvYj4mYWN1dGU7IHwgYDxiPj0mZ3Q7PC9iPiZhY3V0ZTsKIAogCWZ1bmN0aW9uIDo6PSA8Yj5m dW5jdGlvbjwvYj4gZnVuY2JvZHkKIApkaWZmIC0tZ2l0IGEvc3JjL2xsZXguYyBiL3NyYy9sbGV4 LmMKaW5kZXggNmRjMzE5My4uNzdmNzJjOCAxMDA2NDQKLS0tIGEvc3JjL2xsZXguYworKysgYi9z cmMvbGxleC5jCkBAIC0zNjgsOCArMzY4LDEzIEBAIHN0YXRpYyBpbnQgbGxleCAoTGV4U3RhdGUg KmxzLCBTZW1JbmZvICpzZW1pbmZvKSB7CiAgICAgICB9CiAgICAgICBjYXNlICc9JzogewogICAg ICAgICBuZXh0KGxzKTsKLSAgICAgICAgaWYgKGxzLT5jdXJyZW50ICE9ICc9JykgcmV0dXJuICc9 JzsKLSAgICAgICAgZWxzZSB7IG5leHQobHMpOyByZXR1cm4gVEtfRVE7IH0KKyAgICAgICAgaWYg KGxzLT5jdXJyZW50ID09ICc9JykgeworICAgICAgICAgIG5leHQobHMpOyByZXR1cm4gVEtfRVE7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAobHMtPmN1cnJlbnQgPT0gJz4nKSB7CisgICAg ICAgICAgbmV4dChscyk7IHJldHVybiBUS19GQVRfQ09NTUE7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZSAgcmV0dXJuICc9JzsKICAgICAgIH0KICAgICAgIGNhc2UgJzwnOiB7CiAgICAgICAgIG5l eHQobHMpOwpkaWZmIC0tZ2l0IGEvc3JjL2xsZXguaCBiL3NyYy9sbGV4LmgKaW5kZXggYTkyMDFj ZS4uNDJjZmU0YiAxMDA2NDQKLS0tIGEvc3JjL2xsZXguaAorKysgYi9zcmMvbGxleC5oCkBAIC0y OSw3ICsyOSw3IEBAIGVudW0gUkVTRVJWRUQgewogICBUS19SRVRVUk4sIFRLX1RIRU4sIFRLX1RS VUUsIFRLX1VOVElMLCBUS19XSElMRSwKICAgLyogb3RoZXIgdGVybWluYWwgc3ltYm9scyAqLwog ICBUS19DT05DQVQsIFRLX0RPVFMsIFRLX0VRLCBUS19HRSwgVEtfTEUsIFRLX05FLCBUS19OVU1C RVIsCi0gIFRLX05BTUUsIFRLX1NUUklORywgVEtfRU9TCisgIFRLX05BTUUsIFRLX1NUUklORywg VEtfRU9TLCBUS19GQVRfQ09NTUEKIH07CiAKIC8qIG51bWJlciBvZiByZXNlcnZlZCB3b3JkcyAq LwpkaWZmIC0tZ2l0IGEvc3JjL2xwYXJzZXIuYyBiL3NyYy9scGFyc2VyLmMKaW5kZXggMWUyYTlh OC4uNTAxNDMyMSAxMDA2NDQKLS0tIGEvc3JjL2xwYXJzZXIuYworKysgYi9zcmMvbHBhcnNlci5j CkBAIC02MjksOSArNjI5LDEzIEBAIHN0YXRpYyB2b2lkIGZ1bmNhcmdzIChMZXhTdGF0ZSAqbHMs IGV4cGRlc2MgKmYpIHsKICAgICAgIGNvbnN0cnVjdG9yKGxzLCAmYXJncyk7CiAgICAgICBicmVh azsKICAgICB9Ci0gICAgY2FzZSBUS19TVFJJTkc6IHsgIC8qIGZ1bmNhcmdzIC0+IFNUUklORyAq LwotICAgICAgY29kZXN0cmluZyhscywgJmFyZ3MsIGxzLT50LnNlbWluZm8udHMpOwotICAgICAg bHVhWF9uZXh0KGxzKTsgIC8qIG11c3QgdXNlIGBzZW1pbmZvJyBiZWZvcmUgYG5leHQnICovCisg ICAgY2FzZSBUS19TVFJJTkc6IHsgIC8qIGZ1bmNhcmdzIC0+IFNUUklORyB7IGV4cHNlcCBleHBy IH0gKi8KKyAgICAgIGV4cHIobHMsICZhcmdzKTsKKyAgICAgIHdoaWxlICghdGVzdG5leHQobHMs ICc7JykgJiYgKHRlc3RuZXh0KGxzLCAnLCcpIHx8IHRlc3RuZXh0KGxzLCBUS19GQVRfQ09NTUEp KSkgeworICAgICAgICBsdWFLX2V4cDJuZXh0cmVnKGxzLT5mcywgJmFyZ3MpOworICAgICAgICBl eHByKGxzLCAmYXJncyk7CisgICAgICB9CisgICAgICBsdWFLX3NldG11bHRyZXQoZnMsICZhcmdz KTsKICAgICAgIGJyZWFrOwogICAgIH0KICAgICBkZWZhdWx0OiB7Ci0tIAoxLjYuMS45Lmc5N2Mz NAoK --0015174bee94e3df44047142751a Content-Type: application/octet-stream; name="0001-function-call-allows-multiple-arguments-without-pare.patch" Content-Disposition: attachment; filename="0001-function-call-allows-multiple-arguments-without-pare.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fyfthviz1 RnJvbSAwNTczZjdjMTlkZWI2Y2RiNGY3MmE3ZWQ4ZjNlZWM0Y2Q4NjJiYWI1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGcmFuY29pcyBQZXJyYWQgPGZyYW5jb2lzLnBlcnJhZEBnYWR6 Lm9yZz4KRGF0ZTogU2F0LCA4IEF1ZyAyMDA5IDA5OjQ0OjEzICswMjAwClN1YmplY3Q6IFtQQVRD SF0gZnVuY3Rpb24gY2FsbCBhbGxvd3MgbXVsdGlwbGUgYXJndW1lbnRzIHdpdGhvdXQgcGFyZW50 aGVzaXMKCiAgICBmdW5jYXJncyAtPiBleHByIHsgZXhwc2VwIGV4cHIgfQogICAgZXhwc2VwIC0+ IGAsJyB8IGA9PicKClRoaXMgcGF0Y2ggaXMgZXhwZXJpbWVudGFsLgotLS0KIGRvYy9tYW51YWwu aHRtbCB8ICAgIDQgKysrLQogc3JjL2xsZXguYyAgICAgIHwgICAzNiArKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrLS0KIHNyYy9sbGV4LmggICAgICB8ICAgIDYgKysrKystCiBzcmMv bHBhcnNlci5jICAgfCAgIDQyICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystLS0t LS0tLQogNCBmaWxlcyBjaGFuZ2VkLCA3NiBpbnNlcnRpb25zKCspLCAxMiBkZWxldGlvbnMoLSkK CmRpZmYgLS1naXQgYS9kb2MvbWFudWFsLmh0bWwgYi9kb2MvbWFudWFsLmh0bWwKaW5kZXggZjQ2 ZjE3Yy4uYTA4MWFkMyAxMDA2NDQKLS0tIGEvZG9jL21hbnVhbC5odG1sCisrKyBiL2RvYy9tYW51 YWwuaHRtbApAQCAtODc1Niw3ICs4NzU2LDkgQEAgSGVyZSBpcyB0aGUgY29tcGxldGUgc3ludGF4 IG9mIEx1YSBpbiBleHRlbmRlZCBCTkYuCiAKIAlmdW5jdGlvbmNhbGwgOjo9ICBwcmVmaXhleHAg YXJncyB8IHByZWZpeGV4cCBgPGI+OjwvYj4mYWN1dGU7IE5hbWUgYXJncyAKIAotCWFyZ3MgOjo9 ICBgPGI+KDwvYj4mYWN1dGU7IFtleHBsaXN0XSBgPGI+KTwvYj4mYWN1dGU7IHwgdGFibGVjb25z dHJ1Y3RvciB8IFN0cmluZyAKKwlhcmdzIDo6PSAgYDxiPig8L2I+JmFjdXRlOyBbZXhwbGlzdF0g YDxiPik8L2I+JmFjdXRlOyB8IGV4cCB7ZXhwc2VwIGV4cH0KKworCWV4cHNlcCA6Oj0gYDxiPiw8 L2I+JmFjdXRlOyB8IGA8Yj49Jmd0OzwvYj4mYWN1dGU7CiAKIAlmdW5jdGlvbiA6Oj0gPGI+ZnVu Y3Rpb248L2I+IGZ1bmNib2R5CiAKZGlmZiAtLWdpdCBhL3NyYy9sbGV4LmMgYi9zcmMvbGxleC5j CmluZGV4IDZkYzMxOTMuLmEwMWEzMjQgMTAwNjQ0Ci0tLSBhL3NyYy9sbGV4LmMKKysrIGIvc3Jj L2xsZXguYwpAQCAtMTQ0LDYgKzE0NCwxMCBAQCB2b2lkIGx1YVhfc2V0aW5wdXQgKGx1YV9TdGF0 ZSAqTCwgTGV4U3RhdGUgKmxzLCBaSU8gKnosIFRTdHJpbmcgKnNvdXJjZSkgewogICBscy0+bGlu ZW51bWJlciA9IDE7CiAgIGxzLT5sYXN0bGluZSA9IDE7CiAgIGxzLT5zb3VyY2UgPSBzb3VyY2U7 CisgIGxzLT5pbmRlbnRfbm90X2ZvdW5kID0gMTsKKyAgbHMtPmxhc3RfaW5kZW50ID0gMDsKKyAg bHMtPmluZGVudCA9IDA7CisgIGxzLT5uZWVkX3NlbWljb2wgPSAxOwogICBsdWFaX3Jlc2l6ZWJ1 ZmZlcihscy0+TCwgbHMtPmJ1ZmYsIExVQV9NSU5CVUZGRVIpOyAgLyogaW5pdGlhbGl6ZSBidWZm ZXIgKi8KICAgbmV4dChscyk7ICAvKiByZWFkIGZpcnN0IGNoYXIgKi8KIH0KQEAgLTMyOCw2ICsz MzIsMjYgQEAgc3RhdGljIHZvaWQgcmVhZF9zdHJpbmcgKExleFN0YXRlICpscywgaW50IGRlbCwg U2VtSW5mbyAqc2VtaW5mbykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBs dWFaX2J1ZmZsZW4obHMtPmJ1ZmYpIC0gMik7CiB9CiAKKyN1bmRlZiBuZXh0CisjZGVmaW5lIG5l eHQobHMpIHsgXAorICBpZiAobHMtPmluZGVudF9ub3RfZm91bmQpIHsgXAorICAgIGludCBjID0g bHVhWl9sb29rYWhlYWQobHMtPnopOyBcCisgICAgaWYgKGMgPT0gJyAnKSB7IFwKKyAgICAgIGxz LT5pbmRlbnQrKzsgXAorICAgIH0gZWxzZSBpZiAoYyA9PSAnXHQnKSB7IFwKKyAgICAgIGxzLT5p bmRlbnQrPSA0OyBcCisgICAgfSBlbHNlIHsgXAorICAgICAgbHMtPmluZGVudF9ub3RfZm91bmQg PSAwOyBcCisgICAgICBpZiAobHMtPm5lZWRfc2VtaWNvbCAmJiAobHMtPmluZGVudCA8PSBscy0+ bGFzdF9pbmRlbnQpKSB7IFwKKyAgICAgICAgcmV0dXJuICc7JzsgXAorICAgICAgfSBcCisgICAg fSBcCisgIH0gXAorICBscy0+Y3VycmVudCA9IHpnZXRjKGxzLT56KTsgXAorfQorCisjdW5kZWYg c2F2ZV9hbmRfbmV4dAorI2RlZmluZSBzYXZlX2FuZF9uZXh0KGxzKSBzYXZlKGxzLCBscy0+Y3Vy cmVudCk7IG5leHQobHMpCiAKIHN0YXRpYyBpbnQgbGxleCAoTGV4U3RhdGUgKmxzLCBTZW1JbmZv ICpzZW1pbmZvKSB7CiAgIGx1YVpfcmVzZXRidWZmZXIobHMtPmJ1ZmYpOwpAQCAtMzM2LDYgKzM2 MCw5IEBAIHN0YXRpYyBpbnQgbGxleCAoTGV4U3RhdGUgKmxzLCBTZW1JbmZvICpzZW1pbmZvKSB7 CiAgICAgICBjYXNlICdcbic6CiAgICAgICBjYXNlICdccic6IHsKICAgICAgICAgaW5jbGluZW51 bWJlcihscyk7CisgICAgICAgIGxzLT5sYXN0X2luZGVudCA9IGxzLT5pbmRlbnQ7CisgICAgICAg IGxzLT5pbmRlbnRfbm90X2ZvdW5kID0gMTsKKyAgICAgICAgbHMtPmluZGVudCA9IDA7CiAgICAg ICAgIGNvbnRpbnVlOwogICAgICAgfQogICAgICAgY2FzZSAnLSc6IHsKQEAgLTM2OCw4ICszOTUs MTMgQEAgc3RhdGljIGludCBsbGV4IChMZXhTdGF0ZSAqbHMsIFNlbUluZm8gKnNlbWluZm8pIHsK ICAgICAgIH0KICAgICAgIGNhc2UgJz0nOiB7CiAgICAgICAgIG5leHQobHMpOwotICAgICAgICBp ZiAobHMtPmN1cnJlbnQgIT0gJz0nKSByZXR1cm4gJz0nOwotICAgICAgICBlbHNlIHsgbmV4dChs cyk7IHJldHVybiBUS19FUTsgfQorICAgICAgICBpZiAobHMtPmN1cnJlbnQgPT0gJz0nKSB7Cisg ICAgICAgICAgbmV4dChscyk7IHJldHVybiBUS19FUTsKKyAgICAgICAgfQorICAgICAgICBlbHNl IGlmIChscy0+Y3VycmVudCA9PSAnPicpIHsKKyAgICAgICAgICBuZXh0KGxzKTsgcmV0dXJuIFRL X0ZBVF9DT01NQTsKKyAgICAgICAgfQorICAgICAgICBlbHNlICByZXR1cm4gJz0nOwogICAgICAg fQogICAgICAgY2FzZSAnPCc6IHsKICAgICAgICAgbmV4dChscyk7CmRpZmYgLS1naXQgYS9zcmMv bGxleC5oIGIvc3JjL2xsZXguaAppbmRleCBhOTIwMWNlLi5hMGEzZWNkIDEwMDY0NAotLS0gYS9z cmMvbGxleC5oCisrKyBiL3NyYy9sbGV4LmgKQEAgLTI5LDcgKzI5LDcgQEAgZW51bSBSRVNFUlZF RCB7CiAgIFRLX1JFVFVSTiwgVEtfVEhFTiwgVEtfVFJVRSwgVEtfVU5USUwsIFRLX1dISUxFLAog ICAvKiBvdGhlciB0ZXJtaW5hbCBzeW1ib2xzICovCiAgIFRLX0NPTkNBVCwgVEtfRE9UUywgVEtf RVEsIFRLX0dFLCBUS19MRSwgVEtfTkUsIFRLX05VTUJFUiwKLSAgVEtfTkFNRSwgVEtfU1RSSU5H LCBUS19FT1MKKyAgVEtfTkFNRSwgVEtfU1RSSU5HLCBUS19FT1MsIFRLX0ZBVF9DT01NQQogfTsK IAogLyogbnVtYmVyIG9mIHJlc2VydmVkIHdvcmRzICovCkBAIC02NCw2ICs2NCwxMCBAQCB0eXBl ZGVmIHN0cnVjdCBMZXhTdGF0ZSB7CiAgIE1idWZmZXIgKmJ1ZmY7ICAvKiBidWZmZXIgZm9yIHRv a2VucyAqLwogICBUU3RyaW5nICpzb3VyY2U7ICAvKiBjdXJyZW50IHNvdXJjZSBuYW1lICovCiAg IGNoYXIgZGVjcG9pbnQ7ICAvKiBsb2NhbGUgZGVjaW1hbCBwb2ludCAqLworICBpbnQgaW5kZW50 X25vdF9mb3VuZDsKKyAgaW50IGluZGVudDsKKyAgaW50IGxhc3RfaW5kZW50OworICBpbnQgbmVl ZF9zZW1pY29sOwogfSBMZXhTdGF0ZTsKIAogCmRpZmYgLS1naXQgYS9zcmMvbHBhcnNlci5jIGIv c3JjL2xwYXJzZXIuYwppbmRleCAxZTJhOWE4Li5iZjZkOGE4IDEwMDY0NAotLS0gYS9zcmMvbHBh cnNlci5jCisrKyBiL3NyYy9scGFyc2VyLmMKQEAgLTUwMSw2ICs1MDEsOCBAQCBzdGF0aWMgdm9p ZCBjb25zdHJ1Y3RvciAoTGV4U3RhdGUgKmxzLCBleHBkZXNjICp0KSB7CiAgIGludCBsaW5lID0g bHMtPmxpbmVudW1iZXI7CiAgIGludCBwYyA9IGx1YUtfY29kZUFCQyhmcywgT1BfTkVXVEFCTEUs IDAsIDAsIDApOwogICBzdHJ1Y3QgQ29uc0NvbnRyb2wgY2M7CisgIGludCBzYXZlID0gbHMtPm5l ZWRfc2VtaWNvbDsKKyAgbHMtPm5lZWRfc2VtaWNvbCA9IDA7CiAgIGNjLm5hID0gY2MubmggPSBj Yy50b3N0b3JlID0gMDsKICAgY2MudCA9IHQ7CiAgIGluaXRfZXhwKHQsIFZSRUxPQ0FCTEUsIHBj KTsKQEAgLTUzNCw2ICs1MzYsNyBAQCBzdGF0aWMgdm9pZCBjb25zdHJ1Y3RvciAoTGV4U3RhdGUg KmxzLCBleHBkZXNjICp0KSB7CiAgIGxhc3RsaXN0ZmllbGQoZnMsICZjYyk7CiAgIFNFVEFSR19C KGZzLT5mLT5jb2RlW3BjXSwgbHVhT19pbnQyZmIoY2MubmEpKTsgLyogc2V0IGluaXRpYWwgYXJy YXkgc2l6ZSAqLwogICBTRVRBUkdfQyhmcy0+Zi0+Y29kZVtwY10sIGx1YU9faW50MmZiKGNjLm5o KSk7ICAvKiBzZXQgaW5pdGlhbCB0YWJsZSBzaXplICovCisgIGxzLT5uZWVkX3NlbWljb2wgPSBz YXZlOwogfQogCiAvKiB9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwpAQCAtNTQ1LDYgKzU0OCw4IEBAIHN0YXRp YyB2b2lkIHBhcmxpc3QgKExleFN0YXRlICpscykgewogICBGdW5jU3RhdGUgKmZzID0gbHMtPmZz OwogICBQcm90byAqZiA9IGZzLT5mOwogICBpbnQgbnBhcmFtcyA9IDA7CisgIGludCBzYXZlID0g bHMtPm5lZWRfc2VtaWNvbDsKKyAgbHMtPm5lZWRfc2VtaWNvbCA9IDA7CiAgIGYtPmlzX3ZhcmFy ZyA9IDA7CiAgIGlmIChscy0+dC50b2tlbiAhPSAnKScpIHsgIC8qIGlzIGBwYXJsaXN0JyBub3Qg ZW1wdHk/ICovCiAgICAgZG8gewpAQCAtNTcwLDYgKzU3NSw3IEBAIHN0YXRpYyB2b2lkIHBhcmxp c3QgKExleFN0YXRlICpscykgewogICBhZGp1c3Rsb2NhbHZhcnMobHMsIG5wYXJhbXMpOwogICBm LT5udW1wYXJhbXMgPSBjYXN0X2J5dGUoZnMtPm5hY3R2YXIgLSAoZi0+aXNfdmFyYXJnICYgVkFS QVJHX0hBU0FSRykpOwogICBsdWFLX3Jlc2VydmVyZWdzKGZzLCBmcy0+bmFjdHZhcik7ICAvKiBy ZXNlcnZlIHJlZ2lzdGVyIGZvciBwYXJhbWV0ZXJzICovCisgIGxzLT5uZWVkX3NlbWljb2wgPSBz YXZlOwogfQogCiAKQEAgLTYxOSwxOSArNjI1LDI2IEBAIHN0YXRpYyB2b2lkIGZ1bmNhcmdzIChM ZXhTdGF0ZSAqbHMsIGV4cGRlc2MgKmYpIHsKICAgICAgIGlmIChscy0+dC50b2tlbiA9PSAnKScp ICAvKiBhcmcgbGlzdCBpcyBlbXB0eT8gKi8KICAgICAgICAgYXJncy5rID0gVlZPSUQ7CiAgICAg ICBlbHNlIHsKKyAgICAgICAgaW50IHNhdmUgPSBscy0+bmVlZF9zZW1pY29sOworICAgICAgICBs cy0+bmVlZF9zZW1pY29sID0gMDsKICAgICAgICAgZXhwbGlzdDEobHMsICZhcmdzKTsKICAgICAg ICAgbHVhS19zZXRtdWx0cmV0KGZzLCAmYXJncyk7CisgICAgICAgIGxzLT5uZWVkX3NlbWljb2wg PSBzYXZlOwogICAgICAgfQogICAgICAgY2hlY2tfbWF0Y2gobHMsICcpJywgJygnLCBsaW5lKTsK ICAgICAgIGJyZWFrOwogICAgIH0KLSAgICBjYXNlICd7JzogeyAgLyogZnVuY2FyZ3MgLT4gY29u c3RydWN0b3IgKi8KLSAgICAgIGNvbnN0cnVjdG9yKGxzLCAmYXJncyk7Ci0gICAgICBicmVhazsK LSAgICB9Ci0gICAgY2FzZSBUS19TVFJJTkc6IHsgIC8qIGZ1bmNhcmdzIC0+IFNUUklORyAqLwot ICAgICAgY29kZXN0cmluZyhscywgJmFyZ3MsIGxzLT50LnNlbWluZm8udHMpOwotICAgICAgbHVh WF9uZXh0KGxzKTsgIC8qIG11c3QgdXNlIGBzZW1pbmZvJyBiZWZvcmUgYG5leHQnICovCisgICAg Y2FzZSAneyc6IGNhc2UgVEtfU1RSSU5HOiBjYXNlIFRLX05VTUJFUjogY2FzZSBUS19OSUw6IGNh c2UgVEtfVFJVRTogY2FzZSBUS19GQUxTRToKKyAgICBjYXNlIFRLX0RPVFM6IGNhc2UgVEtfRlVO Q1RJT046IHsgIC8qIGZ1bmNhcmdzIC0+IGV4cHIgeyBleHBzZXAgZXhwciB9ICovCisgICAgICBp bnQgc2F2ZSA9IGxzLT5uZWVkX3NlbWljb2w7CisgICAgICBscy0+bmVlZF9zZW1pY29sID0gMDsK KyAgICAgIGV4cHIobHMsICZhcmdzKTsKKyAgICAgIHdoaWxlICghdGVzdG5leHQobHMsICc7Jykg JiYgKHRlc3RuZXh0KGxzLCAnLCcpIHx8IHRlc3RuZXh0KGxzLCBUS19GQVRfQ09NTUEpKSkgewor ICAgICAgICBsdWFLX2V4cDJuZXh0cmVnKGxzLT5mcywgJmFyZ3MpOworICAgICAgICBleHByKGxz LCAmYXJncyk7CisgICAgICB9CisgICAgICBsdWFLX3NldG11bHRyZXQoZnMsICZhcmdzKTsKKyAg ICAgIGxzLT5uZWVkX3NlbWljb2wgPSBzYXZlOwogICAgICAgYnJlYWs7CiAgICAgfQogICAgIGRl ZmF1bHQ6IHsKQEAgLTcxMyw3ICs3MjYsOCBAQCBzdGF0aWMgdm9pZCBwcmltYXJ5ZXhwIChMZXhT dGF0ZSAqbHMsIGV4cGRlc2MgKnYpIHsKICAgICAgICAgZnVuY2FyZ3MobHMsIHYpOwogICAgICAg ICBicmVhazsKICAgICAgIH0KLSAgICAgIGNhc2UgJygnOiBjYXNlIFRLX1NUUklORzogY2FzZSAn eyc6IHsgIC8qIGZ1bmNhcmdzICovCisgICAgICBjYXNlICcoJzogY2FzZSAneyc6IGNhc2UgVEtf U1RSSU5HOiBjYXNlIFRLX05VTUJFUjogY2FzZSBUS19OSUw6IGNhc2UgVEtfVFJVRToKKyAgICAg IGNhc2UgVEtfRkFMU0U6IGNhc2UgVEtfRE9UUzogY2FzZSBUS19GVU5DVElPTjogeyAgLyogZnVu Y2FyZ3MgKi8KICAgICAgICAgbHVhS19leHAybmV4dHJlZyhmcywgdik7CiAgICAgICAgIGZ1bmNh cmdzKGxzLCB2KTsKICAgICAgICAgYnJlYWs7CkBAIC05NjUsOSArOTc5LDEyIEBAIHN0YXRpYyB2 b2lkIGFzc2lnbm1lbnQgKExleFN0YXRlICpscywgc3RydWN0IExIU19hc3NpZ24gKmxoLCBpbnQg bnZhcnMpIHsKIHN0YXRpYyBpbnQgY29uZCAoTGV4U3RhdGUgKmxzKSB7CiAgIC8qIGNvbmQgLT4g ZXhwICovCiAgIGV4cGRlc2MgdjsKKyAgaW50IHNhdmUgPSBscy0+bmVlZF9zZW1pY29sOworICBs cy0+bmVlZF9zZW1pY29sID0gMDsKICAgZXhwcihscywgJnYpOyAgLyogcmVhZCBjb25kaXRpb24g Ki8KICAgaWYgKHYuayA9PSBWTklMKSB2LmsgPSBWRkFMU0U7ICAvKiBgZmFsc2VzJyBhcmUgYWxs IGVxdWFsIGhlcmUgKi8KICAgbHVhS19nb2lmdHJ1ZShscy0+ZnMsICZ2KTsKKyAgbHMtPm5lZWRf c2VtaWNvbCA9IHNhdmU7CiAgIHJldHVybiB2LmY7CiB9CiAKQEAgLTExMTQsNiArMTEzMSw4IEBA IHN0YXRpYyB2b2lkIGZvcnN0YXQgKExleFN0YXRlICpscywgaW50IGxpbmUpIHsKICAgRnVuY1N0 YXRlICpmcyA9IGxzLT5mczsKICAgVFN0cmluZyAqdmFybmFtZTsKICAgQmxvY2tDbnQgYmw7Cisg IGludCBzYXZlID0gbHMtPm5lZWRfc2VtaWNvbDsKKyAgbHMtPm5lZWRfc2VtaWNvbCA9IDA7CiAg IGVudGVyYmxvY2soZnMsICZibCwgMSk7ICAvKiBzY29wZSBmb3IgbG9vcCBhbmQgY29udHJvbCB2 YXJpYWJsZXMgKi8KICAgbHVhWF9uZXh0KGxzKTsgIC8qIHNraXAgYGZvcicgKi8KICAgdmFybmFt ZSA9IHN0cl9jaGVja25hbWUobHMpOyAgLyogZmlyc3QgdmFyaWFibGUgbmFtZSAqLwpAQCAtMTEy NCw2ICsxMTQzLDcgQEAgc3RhdGljIHZvaWQgZm9yc3RhdCAoTGV4U3RhdGUgKmxzLCBpbnQgbGlu ZSkgewogICB9CiAgIGNoZWNrX21hdGNoKGxzLCBUS19FTkQsIFRLX0ZPUiwgbGluZSk7CiAgIGxl YXZlYmxvY2soZnMpOyAgLyogbG9vcCBzY29wZSAoYGJyZWFrJyBqdW1wcyB0byB0aGlzIHBvaW50 KSAqLworICBscy0+bmVlZF9zZW1pY29sID0gc2F2ZTsKIH0KIAogCkBAIC0xMzE0LDYgKzEzMzQs OSBAQCBzdGF0aWMgaW50IHN0YXRlbWVudCAoTGV4U3RhdGUgKmxzKSB7CiAgICAgICBicmVha3N0 YXQobHMpOwogICAgICAgcmV0dXJuIDE7ICAvKiBtdXN0IGJlIGxhc3Qgc3RhdGVtZW50ICovCiAg ICAgfQorICAgIGNhc2UgJzsnOiB7CisgICAgICByZXR1cm4gMDsKKyAgICB9CiAgICAgZGVmYXVs dDogewogICAgICAgZXhwcnN0YXQobHMpOwogICAgICAgcmV0dXJuIDA7ICAvKiB0byBhdm9pZCB3 YXJuaW5ncyAqLwpAQCAtMTMyNSw2ICsxMzQ4LDggQEAgc3RhdGljIGludCBzdGF0ZW1lbnQgKExl eFN0YXRlICpscykgewogc3RhdGljIHZvaWQgY2h1bmsgKExleFN0YXRlICpscykgewogICAvKiBj aHVuayAtPiB7IHN0YXQgW2A7J10gfSAqLwogICBpbnQgaXNsYXN0ID0gMDsKKyAgaW50IHNhdmUg PSBscy0+bmVlZF9zZW1pY29sOworICBscy0+bmVlZF9zZW1pY29sID0gMTsKICAgZW50ZXJsZXZl bChscyk7CiAgIHdoaWxlICghaXNsYXN0ICYmICFibG9ja19mb2xsb3cobHMtPnQudG9rZW4pKSB7 CiAgICAgaXNsYXN0ID0gc3RhdGVtZW50KGxzKTsKQEAgLTEzMzQsNiArMTM1OSw3IEBAIHN0YXRp YyB2b2lkIGNodW5rIChMZXhTdGF0ZSAqbHMpIHsKICAgICBscy0+ZnMtPmZyZWVyZWcgPSBscy0+ ZnMtPm5hY3R2YXI7ICAvKiBmcmVlIHJlZ2lzdGVycyAqLwogICB9CiAgIGxlYXZlbGV2ZWwobHMp OworICBscy0+bmVlZF9zZW1pY29sID0gc2F2ZTsKIH0KIAogLyogfT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8K LS0gCjEuNi4xLjkuZzk3YzM0Cgo= --0015174bee94e3df44047142751a-- From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 11:16:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GEGPDi001255; Sun, 16 Aug 2009 11:16:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FEFF18A25; Sun, 16 Aug 2009 11:16:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDD4B189C7 for ; Sun, 16 Aug 2009 11:15:54 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1McgWV-0003DJ-2o for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 14:15:51 +0000 Received: from aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr ([83.199.243.29]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:15:51 +0000 Received: from PhiLho by aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:15:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: SVG generation in Lua Date: Sun, 16 Aug 2009 16:15:39 +0200 Lines: 12 Message-ID: References: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> <001501ca1e74$1741d370$45c57a50$@puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: <001501ca1e74$1741d370$45c57a50$@puc-rio.br> X-Antivirus: avast! (VPS 090815-0, 15/08/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 16/08/2009 15:18, Antonio Scuri wrote: >> Also, would SVG work as a driver for CanvasDraw? > > Yes, we can do a driver for CD. It is on To Do list for the next version. Note that luacairo has a SVG backend. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 11:22:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GEMj6g001695; Sun, 16 Aug 2009 11:22:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 078AC18A4B; Sun, 16 Aug 2009 11:22:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B945B189EE for ; Sun, 16 Aug 2009 11:22:19 -0300 (BRT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mcgcj-0003od-03 for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 14:22:17 +0000 Received: from aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr ([83.199.243.29]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:22:16 +0000 Received: from PhiLho by aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:22:16 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Date: Sun, 16 Aug 2009 16:22:05 +0200 Lines: 18 Message-ID: References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-8-29.w83-199.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> X-Antivirus: avast! (VPS 090815-0, 15/08/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 11/08/2009 06:38, Asko Kauppi wrote: > PLEASE, stop this habit, and someone please take on the habit of > mentioning it to newcomers who don't know. I mentioned this a few times, but I don't want to be seen as a boring person "guardian of netiquette" or something if I pointed that out each time I see a hijacked thread... So I am happy somebody else mention it. :-) Of course, we can mention some other etiquette points (not sending HTML messages, answering below short, trimmed down quotations...) but it might become controversial... :-P -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 11:34:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GEY7SA002587; Sun, 16 Aug 2009 11:34:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B9331894D; Sun, 16 Aug 2009 11:33:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BB811883F for ; Sun, 16 Aug 2009 11:33:46 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mcgnh-0001iN-E4 for ; Sun, 16 Aug 2009 15:33:37 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mcgnp-0007Qq-6F for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 15:33:45 +0100 Date: Sun, 16 Aug 2009 15:33:44 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Message-ID: <20090816153344.0168876e@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 16 Aug 2009 16:22:05 +0200 Philippe Lhoste wrote: > Of course, we can mention some other etiquette points (not sending > HTML messages, answering below short, trimmed down quotations...) but > it might become controversial... :-P For me, top-quoting is way more annoying than thread hijacking. It reminds me of this classic: A. Because it breaks the logical sequence of discussion Q. Why is top posting bad? B. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 11:59:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GEximB004554; Sun, 16 Aug 2009 11:59:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6840E188EF; Sun, 16 Aug 2009 11:59:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA21818704 for ; Sun, 16 Aug 2009 11:59:17 -0300 (BRT) Received: by fxm27 with SMTP id 27so2000119fxm.35 for ; Sun, 16 Aug 2009 07:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=l7cl75vPZ2tESeYQoy5I0JfTTi8dQoltINrYKY7Isns=; b=ZE0K6Ojh9bmgZzJH1BQ3tTxb8Kz2iyZZP84PV5eXisEZ1DQtvf3nWjgmkiK1wntV4N H9xunWbJ9vUZijriHmAZiQAyhzCUvmrm6qeTY1Cn0wE7ypGPRS5SU3sfxNvTLyNeRGHK Y0di7oCmbwWDw1AYpRwIEAd6iD39i03wOnle8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P4bzjXvJhdsfh2bTJFDJk4nRI95KShjk7vv+DX3LQGQSH9cXPi43KU+SBxN77eAWtk Mb2PS84Q02tCLEuCaWEsmvBnu5V0t2KeNOWjqCNBR2Sv1dDto9VggnMdC0ekli1LuGDp yPl/XO8yzZ2tyzMQl0kWiWAVep3ras7/fabmw= MIME-Version: 1.0 Received: by 10.239.179.19 with SMTP id b19mr242184hbg.2.1250434756437; Sun, 16 Aug 2009 07:59:16 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2009 16:59:16 +0200 Message-ID: <560972290908160759p6b272cacl14cf392724508b93@mail.gmail.com> Subject: Re: Suggestion: strip indentation for long string constructor From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7GEximB004554 On Sun, Aug 16, 2009 at 12:33 PM, Stuart P.Bentley wrote: >     [[ >     This string starts with 6 spaces! >     And there's another six after that newline! >     Does that look right to you?]] But it's not difficult to strip out initial indentation using pure Lua code: For instance, pl.text.dedent: --- dedent a multiline string by removing any initial indent. -- useful when working with [[..]] strings. -- @param s the string -- @return a string with initial indent zero. function dedent (s) local sl = split(s,'\n') local i1,i2 = sl[1]:find('^%s*') sl = sl:mapn('sub',i2+1) return sl:concat('\n') end steve d. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 12:02:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GF2QxU004916; Sun, 16 Aug 2009 12:02:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 945D618967; Sun, 16 Aug 2009 12:02:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BDDF18742 for ; Sun, 16 Aug 2009 12:02:04 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:46444) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1MchF9-0005ku-P3 (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Sun, 16 Aug 2009 16:01:59 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MchF9-000345-O9 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Sun, 16 Aug 2009 16:01:59 +0100 Date: Sun, 16 Aug 2009 16:01:59 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua list Subject: Re: Hi and pushing existing UserData from pointer In-Reply-To: <4A87D32C.4010402@ntlworld.com> Message-ID: References: <4A87D32C.4010402@ntlworld.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 16 Aug 2009, Chris Camacho wrote: > > Is there any way to make a new userdata that is a reference to an > already allocated userdata from just a C pointer? Create a weak table mapping lightuserdata to the full userdata. You can convert a C pointer directly to a lightuserdata which you can use to index the table. The table must have weak values so that your objects are still collected. Lightuserdata doesn't affect collection of the objects it points to. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 12:07:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GF6DDl005328; Sun, 16 Aug 2009 12:06:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 196A118A1F; Sun, 16 Aug 2009 12:05:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D8B718742 for ; Sun, 16 Aug 2009 12:05:51 -0300 (BRT) Received: by ywh26 with SMTP id 26so3226733ywh.5 for ; Sun, 16 Aug 2009 08:05:50 -0700 (PDT) Received: by 10.90.113.11 with SMTP id l11mr2135027agc.97.1250435150343; Sun, 16 Aug 2009 08:05:50 -0700 (PDT) Received: from ?192.168.2.3? ([71.21.67.37]) by mx.google.com with ESMTPS id 11sm4398106aga.56.2009.08.16.08.05.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 08:05:49 -0700 (PDT) Message-Id: <02930941-B3B4-44EB-B7FE-647FE18C2492@burninglabs.com> From: Phoenix Sol To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A341) Mime-Version: 1.0 (iPhone Mail 7A341) Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Date: Sun, 16 Aug 2009 10:05:42 -0500 References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > answering below short, trimmed down quotations... Like this? Is it bad? I like it, but I suppose it creates more work for those who come along later and read the archives? Phoenix Sol From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 12:12:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GFCZvi005931; Sun, 16 Aug 2009 12:12:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1C54189C7; Sun, 16 Aug 2009 12:12:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5042C18904 for ; Sun, 16 Aug 2009 12:12:15 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MchOw-0007cg-BP for ; Sun, 16 Aug 2009 16:12:06 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MchP4-0000jB-2A for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 16:12:14 +0100 Date: Sun, 16 Aug 2009 16:12:13 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Message-ID: <20090816161213.414fd789@trite.i.flarn.net.i.flarn.net> In-Reply-To: <02930941-B3B4-44EB-B7FE-647FE18C2492@burninglabs.com> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <02930941-B3B4-44EB-B7FE-647FE18C2492@burninglabs.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 16 Aug 2009 10:05:42 -0500 Phoenix Sol wrote: > > answering below short, trimmed down quotations... > > Like this? Is it bad? Absolutely not bad. > I like it, but I suppose it creates more work for those who come > along later and read the archives? That's what threading is for, which neatly brings us back to the beginning of... the thread. B. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 12:13:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GFDolU006069; Sun, 16 Aug 2009 12:13:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 264DA18A5B; Sun, 16 Aug 2009 12:13:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A159118A27 for ; Sun, 16 Aug 2009 12:13:31 -0300 (BRT) Received: by bwz10 with SMTP id 10so2080196bwz.5 for ; Sun, 16 Aug 2009 08:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nk4GyQy+xc/K/eUjLJB4CRezb2Vlu7vstffObacsaRg=; b=hEwydyCx68C5ieXRlIgC6rHTKKyZ7GB+KMsgLz7DHrvsZ5p22zrARiTGB4FkrUi/yZ /KpV0c06cEfLpLaELc+zpMXaZMughjdrosiJfsQO1svDf/ndue0BaT61nWBtcb50wPKx ZuEh/UGSIlvZUwBxwajWzmQE4n+kBSU1pNJAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=m+Pn6r/jAIzVKfa8T60PZim8PMxOndl9TLsugtUEDtzrzRNYNXVNW81Msc+gAl3pc4 5thLP/MlApNo97UncJZm7w8uBw8XO2zKry5Ely9f8FYeZcS+50mMsvcdstB5TmzyLYgO yfV4GgnM2Da1pC3GfYTvzh69WGhdlaJ9jB8gs= MIME-Version: 1.0 Received: by 10.239.151.206 with SMTP id s14mr264854hbb.129.1250435609044; Sun, 16 Aug 2009 08:13:29 -0700 (PDT) In-Reply-To: <02930941-B3B4-44EB-B7FE-647FE18C2492@burninglabs.com> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <02930941-B3B4-44EB-B7FE-647FE18C2492@burninglabs.com> Date: Sun, 16 Aug 2009 17:13:28 +0200 Message-ID: <560972290908160813t69505aact40003aa107525afe@mail.gmail.com> Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Aug 16, 2009 at 5:05 PM, Phoenix Sol wrote: > I like it, but I suppose it creates more work for those who come along later > and read the archives? Ah, but they can use the modern wonder of hyperlinks to see the rest of the thread... steve d. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 12:28:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GFSMrc007069; Sun, 16 Aug 2009 12:28:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4BF818A70; Sun, 16 Aug 2009 12:28:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kirsi2.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 961841896F for ; Sun, 16 Aug 2009 12:27:58 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by kirsi2.inet.fi (8.5.014) (authenticated as forske-1) id 4A77692A006B765A for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 18:27:57 +0300 Message-ID: <4A882573.10906@pp.inet.fi> Date: Sun, 16 Aug 2009 18:27:47 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> <20090816153344.0168876e@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20090816153344.0168876e@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean No, more like this: Because it antagonises linearly handicapped people. Foo posted: > Q: Why is top posting bad? Kenneth Rob Kendrick wrote: > On Sun, 16 Aug 2009 16:22:05 +0200 > Philippe Lhoste wrote: > >> Of course, we can mention some other etiquette points (not sending >> HTML messages, answering below short, trimmed down quotations...) but >> it might become controversial... :-P > > For me, top-quoting is way more annoying than thread hijacking. It > reminds me of this classic: > > A. Because it breaks the logical sequence of discussion > Q. Why is top posting bad? > > B. > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 13:50:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GGoL8j013210; Sun, 16 Aug 2009 13:50:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B08918B06; Sun, 16 Aug 2009 13:49:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF17118A87 for ; Sun, 16 Aug 2009 13:49:49 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GGnmFB013146 for ; Sun, 16 Aug 2009 13:49:48 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7GGnl006787; Sun, 16 Aug 2009 13:49:47 -0300 Date: Sun, 16 Aug 2009 13:49:47 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Mailing list etiquette: do NOT press 'reply' when starting a new thread Message-ID: <20090816134947.B6776@lua.tecgraf.puc-rio.br> References: <73401450-2B24-4F91-A89F-315F38D900D3@dnainternet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from PhiLho@GMX.net on Sun, Aug 16, 2009 at 04:22:05PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On 11/08/2009 06:38, Asko Kauppi wrote: > > PLEASE, stop this habit, and someone please take on the habit of > > mentioning it to newcomers who don't know. > > I mentioned this a few times, but I don't want to be seen as a boring > person "guardian of netiquette" or something if I pointed that out each > time I see a hijacked thread... > So I am happy somebody else mention it. :-) > > Of course, we can mention some other etiquette points (not sending HTML > messages, answering below short, trimmed down quotations...) but it > might become controversial... :-P All this is mentioned in http://www.lua.org/lua-l.html#netiquette including a sentence about reply x new threads, which was added recently. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 13:50:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GGonnu013283; Sun, 16 Aug 2009 13:50:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D60A18B28; Sun, 16 Aug 2009 13:50:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B7A118A02 for ; Sun, 16 Aug 2009 13:49:46 -0300 (BRT) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090816164944.WZBW6611.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Sun, 16 Aug 2009 17:49:44 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090816164944.MDYB22934.aamtaout04-winn.ispmail.ntl.com@STORE.store> for ; Sun, 16 Aug 2009 17:49:44 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 4BB9CB9E4 for ; Sun, 16 Aug 2009 17:54:23 +0100 (BST) Message-ID: <4A88389C.2060107@ntlworld.com> Date: Sun, 16 Aug 2009 17:49:32 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <4A87D32C.4010402@ntlworld.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=SIuIqij-VXsME0ueGbgA:9 a=Kjl1Dcekt0z4C122CsIA:7 a=W14ALaOIzW_3qgz4RrTvEDDtPtgA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Im not too sure what you're getting at, however I have found one answer.... lua_pushlightuserdata(L, a); luaL_getmetatable(L, "cpShape"); lua_setmetatable(L, -2); does actually work! I'm getting userdata of the appropriate type and if I add an impulse to the colliding shape the correct body moves so the above *must* be passing a userdata reference correctly, although what I suspect I'm doing is making a dummy user data with the pointer inside ??? (This and some other "types" I'm going to remove from the lua GC, in any case as it make more sense to pass back these objects back to the library when you want to remove them from the simulation) Can you explain your method? can you provide a simple code example that shows your technique working? Best Chris Tony Finch wrote: > On Sun, 16 Aug 2009, Chris Camacho wrote: > >> Is there any way to make a new userdata that is a reference to an >> already allocated userdata from just a C pointer? >> > > Create a weak table mapping lightuserdata to the full userdata. You can > convert a C pointer directly to a lightuserdata which you can use to index > the table. The table must have weak values so that your objects are still > collected. Lightuserdata doesn't affect collection of the objects it > points to. > > Tony. > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 14:03:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GH31Oc014262; Sun, 16 Aug 2009 14:03:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4416318C57; Sun, 16 Aug 2009 14:02:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp02.bis.na.blackberry.com (smtp02.bis.na.blackberry.com [216.9.248.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6B6718A02 for ; Sun, 16 Aug 2009 14:02:33 -0300 (BRT) Received: from bda159.bisx.prod.on.blackberry (bda159.bisx.prod.on.blackberry [172.20.226.139]) by srs.bis.na.blackberry.com (8.13.7 TEAMON/8.13.7) with ESMTP id n7GH38JD011610 for ; Sun, 16 Aug 2009 17:03:08 GMT Received: from bda159.bisx.prod.on.blackberry (localhost.localdomain [127.0.0.1]) by bda159.bisx.prod.on.blackberry (8.13.7 TEAMON/8.13.7) with ESMTP id n7GH2M5c012518 for ; Sun, 16 Aug 2009 17:02:22 GMT X-rim-org-msg-ref-id: 1493466630 Message-ID: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> X-Priority: Normal Sensitivity: Normal Importance: Normal Subject: Re: Hi and pushing existing UserData from pointer To: "Lua list" From: delbu9c1@erau.edu Date: Sun, 16 Aug 2009 17:06:52 +0000 Content-Type: text/plain MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id n7GH31Oc014262 Be careful. Lightuserdata all share the same metatable. This may not be your intent. Lightuserdata does not create any kind of proxy. It is a pointer and that's it. My approach to your problem would be to make a userdata the size of your pointer and then essentially use double indirection on any appropriate pointer you receive. Matt ------Original Message------ From: Chris Camacho Sender: lua-bounces@bazar2.conectiva.com.br To: Lua list ReplyTo: Lua list Subject: Re: Hi and pushing existing UserData from pointer Sent: Aug 16, 2009 9:49 AM Im not too sure what you're getting at, however I have found one answer.... lua_pushlightuserdata(L, a); luaL_getmetatable(L, "cpShape"); lua_setmetatable(L, -2); does actually work! I'm getting userdata of the appropriate type and if I add an impulse to the colliding shape the correct body moves so the above *must* be passing a userdata reference correctly, although what I suspect I'm doing is making a dummy user data with the pointer inside ??? (This and some other "types" I'm going to remove from the lua GC, in any case as it make more sense to pass back these objects back to the library when you want to remove them from the simulation) Can you explain your method? can you provide a simple code example that shows your technique working? Best Chris Tony Finch wrote: > On Sun, 16 Aug 2009, Chris Camacho wrote: > >> Is there any way to make a new userdata that is a reference to an >> already allocated userdata from just a C pointer? >> > > Create a weak table mapping lightuserdata to the full userdata. You can > convert a C pointer directly to a lightuserdata which you can use to index > the table. The table must have weak values so that your objects are still > collected. Lightuserdata doesn't affect collection of the objects it > points to. > > Tony. > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. Sent from my Verizon Wireless BlackBerry From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 14:11:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GHBOHG014897; Sun, 16 Aug 2009 14:11:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8DD0190DD; Sun, 16 Aug 2009 14:11:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CD5718AE7 for ; Sun, 16 Aug 2009 14:10:57 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so623235wfa.11 for ; Sun, 16 Aug 2009 10:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rqcnCUacHGQq6uuvj1LOSeUgx737voqy/9hPEUqgdaA=; b=foA51iisllmZOwmOF6PL+P2KfnK7fVOd6wKbTZjU5Eflug214P+SVq74Xc+PGR13X8 0GO9edfcAD8Slw4yKPEZec3Coxklkchyb6RKq/ltvw5Og14qPjTeTHfIwkPBoDdi+SXs YEUPrUck3zGtqt35CkceLBJl4btWBRfo4z7mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Tyu4XcdTyjRRot8igHIHiy+SbfDH6YWH8xsoQOfAEWTr7QABKjdPX0UK44DlF2/7UB Jg9C5HEpsavykro+PDvk5qvhclfi1DmSNH2+hJBmC416c4B7eNqdA36Y4EBV6BYaGbVI hUyXy5KnIUD5g8LRaW8RfkQfB/ZcBDVAqBpeI= MIME-Version: 1.0 Received: by 10.142.13.3 with SMTP id 3mr757634wfm.40.1250442655602; Sun, 16 Aug 2009 10:10:55 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2009 10:10:54 -0700 Message-ID: <17eac67c0908161010u3ac4f9cet3ea7f1d1a8f1263@mail.gmail.com> Subject: Re: Improvements for creating DSL with Lua From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7GHBOHG014897 On Sun, Aug 16, 2009 at 6:42 AM, François Perrad wrote: > But for declarative DSL, the mandatory use of parenthesis for arguments function > (except in case of a single string or table) is a big limitation. A single character difference is "big"? > As example, consider the 2 following versions of the same code > (which come from my current work on > and it is not really a DSL > and David Manura already send me some good suggestions in pure Lua) >        -- "classic" Lua >        class 'Point' > >        has( 'x', { is = 'rw', isa = 'number', default = 0 } ) What about class{"Point", x = { is = 'rw', isa = 'number', default = 0 }, -- ... or x = property{0, is="rw", isa="number") or class.Point{ x = property{0, is="rw", isa="number") -- isa should default to type(default), is should default to rw ... } > A seasoned Lua developper could make abstraction of extra parenthesis. > But a DSL user cannot because usually he doesn't known Lua. Maybe in general, but in this particular case, why would a non-lua programmer be creating lua classes? Aren't classes abstractions that are only useful to programmers? > has( 'x', { is = 'rw', isa = 'number', default = 0 } ) > has 'x' => { is = 'rw', isa = 'number', default = 0 } I don't believe that a non programmer, someone unfamiliar with lua and ruby, would find either of these more or less cryptic than the other. You've removed two parentheses, and replaced them with a new thingy "=>" that would be just as completely meaningless to the non-programmer. Perhaps this non-programmer is actually a programmer familiar with some other language than lua, and his expectations come from that language? > has 'x' => { is = 'rw', isa = 'number', default = 0 } Even this would seem to be clearer to me: has{"x", is = 'rw', isa = 'number', default = 0} > This patch is not backward compatible with Lua, > for example it breaks the following code : >        printf("Hello %s from %s\n", os.getenv "USER", _VERSION) > it must be rewritten : >        printf("Hello %s from %s\n", os.getenv("USER"), _VERSION) > I hope that Lua will become the best choice for building DSL. I think you will find that in a language where functions are first class, that implicit method calls don't work, the syntax becomes ambiguous or horridly unpredictable, as in the above. It works in ruby, but the price is that there are no functions, just methods, and methods are not first class, you need to manipulate them as objects (BoundMethod or UnboundMethod objects). Different language, different choices. Anyway, if you have such specific desires for the syntax of your DSL, why not use lpeg to build a real DSL? Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 14:22:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GHM9Tr015690; Sun, 16 Aug 2009 14:22:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFCB118B2F; Sun, 16 Aug 2009 14:21:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30D5A189C4 for ; Sun, 16 Aug 2009 14:21:37 -0300 (BRT) Received: by wf-out-1314.google.com with SMTP id 25so623844wfa.11 for ; Sun, 16 Aug 2009 10:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pAHmmcBoUDwdeCOMlmSkrGyJe+QaXTE931cMFwzlYVg=; b=xJUkPg0yuZF9v9NjuSaCtMZe3MeomGCuc0LNq2iA/pKE0guXxm1museCXUacIrO7n7 04XzTGxhvbvEPNYZUTJD+MNEc1VDK/UhCoDepleOn7t0/Ia0eGQjLR3eP8kCSc5HofP8 H4f51hCrZgMqpy9wfwBHgwm+0/LBrdnbOKEBU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XNwYEpIP5rJGVQR299JhfFFJ5WPA5w0mfnW10/9yB11DufybN/J6PGFR5tVuTjArrZ 6bGM2qfXd7dFU5B9QRkGGTGY9+wkBRvaYPglDKvaa1+ClF7ONNIy/vzr8Bj8w2GE8wTi tuPGXOK4AXu5Y5JK2ehY+H5i9CErhMAol5M2A= MIME-Version: 1.0 Received: by 10.143.137.7 with SMTP id p7mr646471wfn.335.1250443296736; Sun, 16 Aug 2009 10:21:36 -0700 (PDT) In-Reply-To: <4A88389C.2060107@ntlworld.com> References: <4A87D32C.4010402@ntlworld.com> <4A88389C.2060107@ntlworld.com> Date: Sun, 16 Aug 2009 10:21:36 -0700 Message-ID: <17eac67c0908161021rc9a06c6uc862dbbd7346e29e@mail.gmail.com> Subject: Re: Hi and pushing existing UserData from pointer From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Aug 16, 2009 at 9:49 AM, Chris Camacho wrote: > does actually work! I'm getting userdata of the appropriate > type and if I add an impulse to the colliding shape the correct > body moves so the above *must* be passing a userdata reference > correctly, although what I suspect I'm doing is making a > dummy user data with the pointer inside ??? no, lightuserdata and userdata are actually different value types in lua > (This and some other "types" I'm going to remove from the > lua GC, in any case as it make more sense to pass back these > objects back to the library when you want to remove them > from the simulation) > > Can you explain your method? can you provide a simple > code example that shows your technique working? See: http://www.lua.org/pil/28.5.html Pay special attention to the "weak" tables ref at end of the page, weak tables are also described in the book. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 14:23:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GHNHOi015809; Sun, 16 Aug 2009 14:23:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5F4118FD6; Sun, 16 Aug 2009 14:22:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AC0F189C4 for ; Sun, 16 Aug 2009 14:22:53 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090816172252.YNLY6742.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Sun, 16 Aug 2009 18:22:52 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090816172251.WEXY2093.aamtaout03-winn.ispmail.ntl.com@STORE.store> for ; Sun, 16 Aug 2009 18:22:51 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 83CCBB9E4 for ; Sun, 16 Aug 2009 18:27:34 +0100 (BST) Message-ID: <4A884066.1010301@ntlworld.com> Date: Sun, 16 Aug 2009 18:22:46 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> In-Reply-To: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=Xie9NPzdAAAA:8 a=QdQNIsmI2hrOUri22BMA:9 a=SBwkDmA6TXnLmp-0cioA:7 a=8GS58xEXATJukoBqTelEE_etIY4A:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Be careful. Lightuserdata all share the same metatable. This may not be your intent. By adding the "cpShape" metatable I can use the "cpShape" methods it is defiantly returning the correct pointer as the right object reacts when I use that userdata's methods, how can what I'm returning to lua be sharing the same metatable if I can call a method that's unique to cpShape??? > My approach to your problem would be to make a userdata the size of your pointer and then > essentially use double indirection on any appropriate pointer you receive. really? that seems a lot of work (there must be something easier and more elegant!) Best Chris delbu9c1@erau.edu wrote: > Be careful. Lightuserdata all share the same metatable. This may not be your intent. > > Lightuserdata does not create any kind of proxy. It is a pointer and that's it. > > My approach to your problem would be to make a userdata the size of your pointer and then essentially use double indirection on any appropriate pointer you receive. > > Matt > ------Original Message------ > From: Chris Camacho > Sender: lua-bounces@bazar2.conectiva.com.br > To: Lua list > ReplyTo: Lua list > Subject: Re: Hi and pushing existing UserData from pointer > Sent: Aug 16, 2009 9:49 AM > > Im not too sure what you're getting at, however > I have found one answer.... > > lua_pushlightuserdata(L, a); > luaL_getmetatable(L, "cpShape"); > lua_setmetatable(L, -2); > > does actually work! I'm getting userdata of the appropriate > type and if I add an impulse to the colliding shape the correct > body moves so the above *must* be passing a userdata reference > correctly, although what I suspect I'm doing is making a > dummy user data with the pointer inside ??? > > (This and some other "types" I'm going to remove from the > lua GC, in any case as it make more sense to pass back these > objects back to the library when you want to remove them > from the simulation) > > Can you explain your method? can you provide a simple > code example that shows your technique working? > > Best > Chris > > Tony Finch wrote: > >> On Sun, 16 Aug 2009, Chris Camacho wrote: >> >> >>> Is there any way to make a new userdata that is a reference to an >>> already allocated userdata from just a C pointer? >>> >>> >> Create a weak table mapping lightuserdata to the full userdata. You can >> convert a C pointer directly to a lightuserdata which you can use to index >> the table. The table must have weak values so that your objects are still >> collected. Lightuserdata doesn't affect collection of the objects it >> points to. >> >> Tony. >> >> > > > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 14:44:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GHisCa017260; Sun, 16 Aug 2009 14:44:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CB0219152; Sun, 16 Aug 2009 14:44:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73AAB190D1 for ; Sun, 16 Aug 2009 14:44:28 -0300 (BRT) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090816174426.YQJW6611.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sun, 16 Aug 2009 18:44:26 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090816174426.NSFV13254.aamtaout01-winn.ispmail.ntl.com@STORE.store> for ; Sun, 16 Aug 2009 18:44:26 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id C6630B9E4 for ; Sun, 16 Aug 2009 18:49:08 +0100 (BST) Message-ID: <4A884575.8040800@ntlworld.com> Date: Sun, 16 Aug 2009 18:44:21 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <4A87D32C.4010402@ntlworld.com> <4A88389C.2060107@ntlworld.com> <17eac67c0908161021rc9a06c6uc862dbbd7346e29e@mail.gmail.com> In-Reply-To: <17eac67c0908161021rc9a06c6uc862dbbd7346e29e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=f227EVX2UF4aQVkL8UsA:9 a=MGhmwdFDjEZi6jPqFNUA:7 a=CNAh0jt7W2LgxwAd3sXT3j0b_VoA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sam Roberts wrote: > > no, lightuserdata and userdata are actually different value types in lua > I know, but how can I be using methods of "cpShape" of the returned userdata, if its lightuserdata..? how can it still have the same metatable as other lightuserdata .... lua_pushlightuserdata(d, a); luaL_getmetatable(d, "cpShape"); lua_setmetatable(d, -2); -- <----- so now the lightuserdata has a different metatable what is it! .... eventually pushright is called with lua_pcall function pushright(a,b) bdy=a:getBody() -- <--- lightuserdata executing getBody ??? bdy:applyImpulse(cpVect.new(20000,0),cpVect.new()) -- <--- correct body returned from lightuserdata ??? how? Best Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 15:07:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GI7SwV019283; Sun, 16 Aug 2009 15:07:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F085191D0; Sun, 16 Aug 2009 15:07:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85914190B7 for ; Sun, 16 Aug 2009 15:06:57 -0300 (BRT) Received: by fxm27 with SMTP id 27so2049485fxm.35 for ; Sun, 16 Aug 2009 11:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pcXDGU9OvOLfi5TgOoWhxZ3CAFhplWBrFXLtYsy0dFM=; b=XfgsjQ5O25PXaV+jFfRl+p/y6GaztnAjE8BJckBUmuITLCgjZwJYtN+sCqu6tW1CbD OWen3LjNFT37GLtEdokQTBjpOfURw3BKwtYVku99p0Tb2HwL1RDXonte+1kPnaCZAs/A qDH2Szw8ubdg5oFW+HmVCm6GbLU/mWBFfjKfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UJ2x1V1qmIR5mxg5A+zfDaujDVgzMZPb/E9pj5cd/1R1JfeJeA4T0lCXieWFV5rlAH 6/hZCpgjxXo4SbntZjDoweHUCZ1bsJdAd0djJ6bklc8ya0M+WqUZr8sSMXzNwDcn62G4 MAvDerTtmiG8Cf42GOkVE29LifkMO5q9xSnys= MIME-Version: 1.0 Received: by 10.223.103.74 with SMTP id j10mr774792fao.50.1250446014626; Sun, 16 Aug 2009 11:06:54 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2009 22:06:54 +0400 Message-ID: Subject: Re: Improvements for creating DSL with Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7GI7SwV019283 > Since its origin, Lua is well suited for data oriented DSL. > But for declarative DSL, the mandatory use of parenthesis for arguments function > (except in case of a single string or table) is a big limitation. > As example, consider the 2 following versions of the same code > (which come from my current work on > and it is not really a DSL > and David Manura already send me some good suggestions in pure Lua) >        -- "classic" Lua >        class 'Point' > >        has( 'x', { is = 'rw', isa = 'number', default = 0 } ) >        has( 'y', { is = 'rw', isa = 'number', default = 0 } ) I usually use this idiom in my DSLs: has "x" { is = 'rw', isa = 'number', default = 0 } has = function(name) return function(data) return has_impl(name, data) end end Also, if you have an urge to patch Lua syntax, take look at Metalua: http://metalua.luaforge.net. HTH, Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 15:19:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GIJhBR020207; Sun, 16 Aug 2009 15:19:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB37F1926C; Sun, 16 Aug 2009 15:19:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16ECD19219 for ; Sun, 16 Aug 2009 15:19:19 -0300 (BRT) Received: by fxm27 with SMTP id 27so2052985fxm.35 for ; Sun, 16 Aug 2009 11:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=OevFFQUUvHnncP/HAhIt8EKkydvsVxK6ybUgo4p7IT8=; b=Ipr3fkKVGsN6eKlc7kGWhqM5GV3auSrlygFmqBHxRyqKOav7l0Q6GjatoKPAd2pJdh 6jc6QwVSWLKR6Ql2EOesTrssAHRHrbrRfWA5JcjlsnFigLb4hEXS+tSGb6ttmabQFs2Z CXweRCeaiKfqopR8Ja8SPLAhIdzqXHXgh4lfo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=eNsQWFmyenIeZJUThXQar5gyDWBnEEAxO0vxT46vHK/LCkD1llZL1tkXwmK20KEaii cyRI77bhud44d1wIbKBJNiB6Es+3fDjhGh2L+k8WBqyaaFG9QLlnrkSphk39vHs2Ghi0 LSqWFK033ITsUpLx9MFGMwSab/3fylZ4Y2t6I= Received: by 10.103.37.33 with SMTP id p33mr1126956muj.132.1250446756519; Sun, 16 Aug 2009 11:19:16 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id j2sm15410820mue.50.2009.08.16.11.19.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 11:19:14 -0700 (PDT) Message-Id: <03C27861-A4B9-4BDA-9AA9-22635A3BC29B@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Improvements for creating DSL with Lua Date: Sun, 16 Aug 2009 20:18:43 +0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 16, 2009, at 8:06 PM, Alexander Gladysh wrote: > I usually use this idiom in my DSLs: > > has "x" { is = 'rw', isa = 'number', default = 0 } Furthermore, one could avoid all those confusing quotes around strings, e.g.: Is( Author ) Has( name ) HasMany( publishers ) HasMany( books ) The literals ( Author, name, publishers, books ) can be resolved properly at runtime given a proper environment: http://dev.alt.textdrive.com/browser/DB/TestModel.lua http://dev.alt.textdrive.com/browser/DB/DBModelStatement.lua http://dev.alt.textdrive.com/browser/DB/DBSQLStatement.lua That said... not sure if this is really worth the bother... YMMV... Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 15:23:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GIN8wG020622; Sun, 16 Aug 2009 15:23:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C14B1928A; Sun, 16 Aug 2009 15:22:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B06F51921E for ; Sun, 16 Aug 2009 15:22:42 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:1143 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MckN9-00014E-4G for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 14:22:27 -0400 Message-ID: <4891CFB52D4247BD835F5DEADF711990@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com> <17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sun, 16 Aug 2009 11:22:40 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean [...] > > Sorry, Michael, I thought you said you'd be binding code into lua for > years. > Yes, I have, for almost 15 years. But I've never dealt with userdata before now. > Your code ends with pushlightuserdata(), then does "return 1". So, it > is returning only 1 thing, and that thing is not the userdata you'd > created earlier. > >> A userdata is just another Lua object type, like a lightuserdata. So >> just push it onto the stack and return it. You don't need to use >> lightuserdatas at all. I already did what you describe. The CFunction that creates the userdata is named CreadeData(). After creating the C++ object, it returns 2 parameters: the C++ object pointer and the userdata. It ends like this: lua_pushlightuserdata( L, pData ); luaL_getmetatable( L, "CData_type" ); return 2; The __gc metamethod I registered for this kind of userdata is created and it has the correct pointer for the pData object (which I test using luaL_checkudata()). BUT... that __gc CFuntion is being called by lua *immediately* after the return from the above code. The lua calling code is like this: self.ptr, self.pUserData = CreateData() Why is it the __gc being done immediately? This is what I was talking about when I asked about the carbage collector "What defines being "used" by lua?" For some reason, lua believes it is time for this userdata to be deleted. Why? >> >> Basically: >> >> lightuserdata: 4 bytes only, no metatable, no notification when GCd >> >> userdata: any number of bytes, metatable, notification when GCd >> >> Check out the example here: http://www.lua.org/pil/28.1.html > > The fundamentals of this are covered in the above, and the succeeding > chapters which cover __gc (and I also posted a link to), and explained > much better than I can. > > If are comfortable in C, and sit down and spend a few hours reading > carefully through those chapters, and write a small example to start > with, then build up, you should be OK. I've read that stuff over and over. That's why I said something just is not clicking. Michael > > Cheers, > Sam > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 15:47:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GIlpQi022649; Sun, 16 Aug 2009 15:47:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2263B1916D; Sun, 16 Aug 2009 15:47:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15B0718BD4 for ; Sun, 16 Aug 2009 15:47:23 -0300 (BRT) Received: by qyk34 with SMTP id 34so1879400qyk.33 for ; Sun, 16 Aug 2009 11:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=Hee1Io6f6kYgDCawPvSKvVqn/YuFJYfkPDjsCF79YVQ=; b=VDs2QV554ttW4pbFX5SvhLzOlw+Rqs3qoXgXba4l9n1U3huQ60diwbN8m9tq70l9rb Q0rpNlvNQibIKDtEc1ViHW4J/B6lBAUY1Xo5NpzrlJjxG2kjoSRyz6u5ii2FnP7hqkK5 5SQthwBWT+a3SVdsGR3z09dtR2etnnLyeGan4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=KXn2/tWrm4pXXfHRc1w3ZY+Z6q4GF0zp9ErKmIhNxzORNjnDBwM7Jan3Ukwlr09aiG d2XJHHxvlPU0jFqPT4j/BgWoH/RJGAjHwjTlr8+VZvO+tUGgtUKBuV0Nk/nLCj8eCRuU TCizy/VwRZN8VoyJUDN0D3mo9UFmr/hjJ5D3I= Received: by 10.224.36.139 with SMTP id t11mr3723042qad.350.1250448442944; Sun, 16 Aug 2009 11:47:22 -0700 (PDT) Received: from ?192.168.0.102? ([75.68.47.100]) by mx.google.com with ESMTPS id 7sm7069694qwf.17.2009.08.16.11.47.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 11:47:22 -0700 (PDT) Message-Id: From: Doug Currie To: Lua list In-Reply-To: <4891CFB52D4247BD835F5DEADF711990@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: how does GC work with complex expressions using metamethods? X-Priority: 3 Date: Sun, 16 Aug 2009 14:47:20 -0400 References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com> <17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com> <4891CFB52D4247BD835F5DEADF711990@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 16, 2009, at 2:22 PM, Michael Newberry wrote: > This is what I was talking about when I asked about the carbage > collector "What defines being "used" by lua?" It is considered used if Lua can find it by following references (but NOT lightuserdata pointers) from global variables or the Lua stack. > For some reason, lua believes it is time for this userdata to be > deleted. Why? Probably because you returned lightuserdata from CreadeData() instead of userdata? Where is the userdata being returned and/or stored? e From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 15:55:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GItMFN023208; Sun, 16 Aug 2009 15:55:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F29D1924B; Sun, 16 Aug 2009 15:55:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4B82191E4 for ; Sun, 16 Aug 2009 15:54:56 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:1469 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1McksJ-00045M-1h for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 14:54:39 -0400 Message-ID: <97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com><17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com><4891CFB52D4247BD835F5DEADF711990@CAYENNE> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sun, 16 Aug 2009 11:54:50 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean No, I returned both lightuserdata and the metatable containing the GC method. I also tried returning the pointer to the userdata using lua_pushlightuserdata and that made no difference. Remember I am returning two values, and I am assigning the second value to a table element back in the lua code. The two return values are stored in a table which I has setup as a class. Michael ----- Original Message ----- From: "Doug Currie" To: "Lua list" Sent: Sunday, August 16, 2009 11:47 AM Subject: Re: how does GC work with complex expressions using metamethods? > On Aug 16, 2009, at 2:22 PM, Michael Newberry wrote: > >> This is what I was talking about when I asked about the carbage >> collector "What defines being "used" by lua?" > > It is considered used if Lua can find it by following references (but NOT > lightuserdata pointers) from global variables or the Lua stack. > >> For some reason, lua believes it is time for this userdata to be >> deleted. Why? > > Probably because you returned lightuserdata from CreadeData() instead of > userdata? > > Where is the userdata being returned and/or stored? > > e > > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 16:03:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GJ37vZ023939; Sun, 16 Aug 2009 16:03:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3ABF919284; Sun, 16 Aug 2009 16:02:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 810DD18D1B for ; Sun, 16 Aug 2009 16:02:39 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so720602qwi.11 for ; Sun, 16 Aug 2009 12:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=2LmomOTLfS/W4PtbaKc/xPSoVuEXxdoitrmXMoG7oiU=; b=XRN3jCHvW7QGgL23asz5yUdRtIqhRYGba7IyGFotSjAop+9e0bjWJRGDLqaoOqcAdl Lq4SgyhV32bZMkoeW87di/D5Y9O+LFVBPsfiAozsQqpSXbJleJzRdriyJRkDew1TmWPG /TuJwyi6NIAh+dPWRfUQ2pEjnhFtNOtojEXOo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=hMHMD6nYTpAyafxZWI735vVcgsgohpu6RK59wWu1J4sEzxXtqx1O2QedpgfK3ZRe2W HYQLmZoGqLCsbdl1lJZ7tb8FPEVhWTRY+yqHsW1mS0K/UxK7GbcBLAjvW1H0cQf7p0y/ wHBseX3l+WSzKHlfWgpIlVB/OhRrn+vnROE7U= Received: by 10.224.103.12 with SMTP id i12mr3735601qao.120.1250449357295; Sun, 16 Aug 2009 12:02:37 -0700 (PDT) Received: from ?192.168.0.102? ([75.68.47.100]) by mx.google.com with ESMTPS id 8sm7046928qwj.46.2009.08.16.12.02.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 12:02:36 -0700 (PDT) Message-Id: <7D003F07-019C-43A5-B88C-98F3ED4D7B90@gmail.com> From: Doug Currie To: Lua list In-Reply-To: <97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: how does GC work with complex expressions using metamethods? X-Priority: 3 Date: Sun, 16 Aug 2009 15:02:34 -0400 References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com><17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com><4891CFB52D4247BD835F5DEADF711990@CAYENNE> <97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 16, 2009, at 2:54 PM, Michael Newberry wrote: > No, I returned both lightuserdata and the metatable containing the > GC method. You did not return (full) userdata. You returned lightuserdata. We are all telling you, over and over again, this won't work. > I also tried returning the pointer to the userdata using > lua_pushlightuserdata and that made no difference. lua_pushlightuserdata does not return (full) userdata. lua_newuserdata pushes the (full) userdata on the Lua stack. That is what you need to return from your function. > Remember I am returning two values, and I am assigning the second > value to a table element back in the lua code. The two return values > are stored in a table which I has setup as a class. That doesn't help since neither is the (full) userdata you need to store. e From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 16:58:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GJwc3b027717; Sun, 16 Aug 2009 16:58:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5013919191; Sun, 16 Aug 2009 16:58:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C8A718A27 for ; Sun, 16 Aug 2009 16:58:06 -0300 (BRT) Received: from tiar.cowlark.co.uk ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mclrd-0005Sd-GN for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 20:58:01 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 0061146758 for ; Sun, 16 Aug 2009 20:57:58 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:48683 with envelope Message-ID: <4A8864D6.8020704@cowlark.com> Date: Sun, 16 Aug 2009 20:58:14 +0100 From: David Given User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: how does GC work with complex expressions using metamethods? References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com> <17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com> <4891CFB52D4247BD835F5DEADF711990@CAYENNE> In-Reply-To: <4891CFB52D4247BD835F5DEADF711990@CAYENNE> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7GJwc3b027717 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Newberry wrote: [...] > I already did what you describe. The CFunction that creates the userdata > is named CreadeData(). After creating the C++ object, it returns 2 > parameters: the C++ object pointer and the userdata. It ends like this: > > lua_pushlightuserdata( L, pData ); You don't need to return two things. What you're trying to do here is to create an object and *also* create an object containing the address of the object, which is unnecessary and is just causing complications. You only need to return the userdata itself. The usual way of solving this sort of problem is: 1. Create C-side object. 2. Create a userdata 4 bytes long. 3. Put point to C-side object in userdata. 4. Set userdata's metatable to something with a __gc method. 5. Return userdata. Note that this isn't using lightuserdatas *at all*! Typically this boils down to about four lines of code. Now you're only returning one thing, your Lua-side code is much simplified, and there's much less scope for horrible bugs (such as losing track of your userdata, causing it to be garbage collected, causing the C-side object to be freed, causing the address in the lightuserdata to become bogus. Which is bad. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD4DBQFKiGTSf9E0noFvlzgRAvGxAJ4izJ+87CQ0zueX3dRSzF1ITfP4OgCYkoHU UqG7u+zfa2Pridzb/EjN+g== =QSUL -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 17:58:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GKvwfM032284; Sun, 16 Aug 2009 17:57:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 848BC190DD; Sun, 16 Aug 2009 17:57:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E056B19076 for ; Sun, 16 Aug 2009 17:57:29 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:2660 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mcmmr-0006Wq-OK for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 16:57:10 -0400 Message-ID: <4ABA84282BA54A23909F1F1F5C377739@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com><17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com><4891CFB52D4247BD835F5DEADF711990@CAYENNE><97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE> <7D003F07-019C-43A5-B88C-98F3ED4D7B90@gmail.com> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sun, 16 Aug 2009 13:57:25 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Doug, It is not true that anyone has told me explicitly to return full userdata using lua_newuserdata(). Perhaps you think someone has told me that, but it isn't so. With all due respect, you've been leaving that particular part for me to guess! I had tried returning the userdata pointer from ptr = lua_newmetatable(), like this: lua_pushlightuserdata( L, pData ); lua_pushlightuserdata( L, ptr ); return 2; But, obviously, that did not work. So, after you just now told me *explicitly* that I need to return lua_newuserdata(), rather than the value it returns, I simply moved my C++ object pointer up above the call to lua_newuserdata() as shown below. // C++ object pointer pData exists at this point lua_pushlightuserdata( L, pData ); // my object pointer // create a userdata and add it to the userdata metatable for CData CData** ptr = (CData**)lua_newuserdata( L, sizeof(CData*) ); *ptr = pData; luaL_getmetatable( L, "CData_type" ); lua_setmetatable( L, -2 ); return 2; After that change, the __gc is not called right away and it does get called correctly at the end of the script. I'll do some testing and see if this change solves the problem. Thanks for mentioning lua_newuserdata() explitly. BTW, Yes, I know I can get the C++ object pointer from the userdata, so I don;t need both. If this code now gives me what I want, then I'll see about cleaning that up. Michael ----- Original Message ----- From: "Doug Currie" To: "Lua list" Sent: Sunday, August 16, 2009 12:02 PM Subject: Re: how does GC work with complex expressions using metamethods? > > On Aug 16, 2009, at 2:54 PM, Michael Newberry wrote: > >> No, I returned both lightuserdata and the metatable containing the GC >> method. > > You did not return (full) userdata. You returned lightuserdata. We are > all telling you, over and over again, this won't work. > >> I also tried returning the pointer to the userdata using >> lua_pushlightuserdata and that made no difference. > > lua_pushlightuserdata does not return (full) userdata. > > lua_newuserdata pushes the (full) userdata on the Lua stack. That is what > you need to return from your function. > >> Remember I am returning two values, and I am assigning the second value >> to a table element back in the lua code. The two return values are >> stored in a table which I has setup as a class. > > That doesn't help since neither is the (full) userdata you need to store. > > e > > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 19:18:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GMIYhv006232; Sun, 16 Aug 2009 19:18:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B95D190D1; Sun, 16 Aug 2009 19:18:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE5C318D70 for ; Sun, 16 Aug 2009 19:18:03 -0300 (BRT) Received: from Stucomet (c-76-104-160-178.hsd1.wa.comcast.net [76.104.160.178]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1Mco332gy9-000Cq9; Sun, 16 Aug 2009 18:18:01 -0400 Message-ID: <23CA68F19D474D5A94D2356F0F2FD634@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <17eac67c0908161010u3ac4f9cet3ea7f1d1a8f1263@mail.gmail.com> In-Reply-To: <17eac67c0908161010u3ac4f9cet3ea7f1d1a8f1263@mail.gmail.com> Subject: Re: Improvements for creating DSL with Lua Date: Sun, 16 Aug 2009 15:17:39 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-Provags-ID: V01U2FsdGVkX18hPzhzYOwnpNuKz0UxfN24/PIRwX/zPEn3LqM wWYuZPmod5IIFU3bPWgWULz5RbjTFknvMs23Jaw5v6lO49Tsp5 R0IKRIcrxC6WK1Bu8xlHxYeYeZkHNgc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > Anyway, if you have such specific desires for the syntax of your DSL, > why not use lpeg to build a real DSL? > Or for that matter, yacc, which is what Lua originally used before the parser was rewritten manually? From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 20:14:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GNEsBp010435; Sun, 16 Aug 2009 20:14:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED7EC18FF3; Sun, 16 Aug 2009 20:14:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1EB518A87 for ; Sun, 16 Aug 2009 20:14:21 -0300 (BRT) Received: by qyk34 with SMTP id 34so1934738qyk.33 for ; Sun, 16 Aug 2009 16:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=MF5Fr2A20AJyONML39T2+M38p68S661WJD6arMw6PzU=; b=lAwRhxA/T2VUKXCJ0aDAOTWaO/CuR22ysLqPRq1lgJ2CQ9c0Se0vGOjjEYZUBwzebo aPQE1UCckYejK7uX8SBXo5LrHFP5832zkm1iYx30iDyKuqOzPRHw2srbWCN7BacDPWUE jOvS4DRIa2eiQXM6X8ZaXhw2UiO8D8m+BCrKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=MWG/Ldrws5WgvVbITxxx7rLW9g62e6vPz86LWT5a/ccxB1kOb5tJqNiqyg8v1sEsNd z1UAMOJyZ4ljDBSHF1Ade2Gfc0SjsPAI29WnmU3xO8tuFV8jG+Zn6BB9OwFxHR5+G8UI o3WOcS+QzZgWDC6ZHpwJE6Q3QYPWfFQV6kBNQ= Received: by 10.224.103.70 with SMTP id j6mr3833283qao.208.1250464459941; Sun, 16 Aug 2009 16:14:19 -0700 (PDT) Received: from ?192.168.0.102? ([75.68.47.100]) by mx.google.com with ESMTPS id 4sm7384051qwe.15.2009.08.16.16.14.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 Aug 2009 16:14:19 -0700 (PDT) Message-Id: From: Doug Currie To: Lua list In-Reply-To: <4ABA84282BA54A23909F1F1F5C377739@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: how does GC work with complex expressions using metamethods? X-Priority: 3 Date: Sun, 16 Aug 2009 19:14:17 -0400 References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com><17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com><4891CFB52D4247BD835F5DEADF711990@CAYENNE><97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE> <7D003F07-019C-43A5-B88C-98F3ED4D7B90@gmail.com> <4ABA84282BA54A23909F1F1F5C377739@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 16, 2009, at 4:57 PM, Michael Newberry wrote: > It is not true that anyone has told me explicitly to return full > userdata using lua_newuserdata(). Well, in their defense, Sam and David (and maybe others in this thread) directed you to http://www.lua.org/pil/28.1.html which is all about lua_newuserdata(). It seemed to me you needed a whack with the keisaku. I'm glad you're on the right track now. e From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 20:27:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7GNRScI012107; Sun, 16 Aug 2009 20:27:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C58F18B28; Sun, 16 Aug 2009 20:27:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 500591892F for ; Sun, 16 Aug 2009 20:27:02 -0300 (BRT) Received: from 75-164-67-1.tcso.qwest.net ([75.164.67.1]:4176 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mcp7Z-0001KQ-Bz for lua@bazar2.conectiva.com.br; Sun, 16 Aug 2009 19:26:41 -0400 Message-ID: <79FF5AEED0DB4B97816F0AC121350E77@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <6C3F13DF15934BF4A5DF194E9F60789A@CAYENNE><90eb1dc70908141551h221ceca6wd87516893dc67ce@mail.gmail.com><1286F5BE029B4C228D910AF774EB824A@CAYENNE><9E041F4F488442149B79E55244A693E9@CAYENNE><4D35A2D628394209A8E8C5E8BA035BE4@CAYENNE><17eac67c0908151334t49f5a47kfd7ee39561345bf0@mail.gmail.com><42D7AAF73AD641EFB494CE805DBF04AC@CAYENNE><4A873B08.40908@cowlark.com><17eac67c0908152058j5a97e8bfg79bfb7518c78f64a@mail.gmail.com><4891CFB52D4247BD835F5DEADF711990@CAYENNE><97EDEE86C98841A9A0861A66A2A1FFEB@CAYENNE><7D003F07-019C-43A5-B88C-98F3ED4D7B90@gmail.com><4ABA84282BA54A23909F1F1F5C377739@CAYENNE> Subject: Re: how does GC work with complex expressions using metamethods? Date: Sun, 16 Aug 2009 16:26:49 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Well, in my defense, I already have read and re-read that chapter, both in the white book and the blue book. And I still did not get the subtle issue that lua_newuserdata() has to be left on the stack for return by the Cfunction. That is the missing detail. Instead I was returning its value (the pointer it allocates). Obviously you know a heck of a lot more about userdata than I do, so I don't know if you can appreciate the subtle difference when the person at the other end (me) has been going round and round for a couple of days. That little nugget of information you gave was the key I was missing. So tanks---I really do appreciate your help. Michael ----- Original Message ----- From: "Doug Currie" To: "Lua list" Sent: Sunday, August 16, 2009 4:14 PM Subject: Re: how does GC work with complex expressions using metamethods? > On Aug 16, 2009, at 4:57 PM, Michael Newberry wrote: > >> It is not true that anyone has told me explicitly to return full >> userdata using lua_newuserdata(). > > Well, in their defense, Sam and David (and maybe others in this thread) > directed you to > http://www.lua.org/pil/28.1.html > which is all about lua_newuserdata(). > > It seemed to me you needed a whack with the keisaku. I'm glad you're on > the right track now. > > e > > From lua-bounces@bazar2.conectiva.com.br Sun Aug 16 23:50:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H2odPv028330; Sun, 16 Aug 2009 23:50:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAC9F18BF7; Sun, 16 Aug 2009 23:50:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0390618967 for ; Sun, 16 Aug 2009 23:50:04 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n7H2o0Pc028089; Mon, 17 Aug 2009 11:50:00 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Mon, 17 Aug 2009 11:50:00 +0900 Received: from dhlpc061 ([10.114.113.123] [10.114.113.123]) by relay21.aps.necel.com with ESMTP; Mon, 17 Aug 2009 11:50:00 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 1AB3452E240; Mon, 17 Aug 2009 11:50:00 +0900 (JST) From: Miles Bader To: "Stuart P. Bentley" Subject: Re: Improvements for creating DSL with Lua References: <17eac67c0908161010u3ac4f9cet3ea7f1d1a8f1263@mail.gmail.com> <23CA68F19D474D5A94D2356F0F2FD634@Stucomet> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 17 Aug 2009 11:50:00 +0900 In-Reply-To: <23CA68F19D474D5A94D2356F0F2FD634@Stucomet> (Stuart P. Bentley's message of "Sun, 16 Aug 2009 15:17:39 -0700") Message-ID: Lines: 15 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "Stuart P. Bentley" writes: >> Anyway, if you have such specific desires for the syntax of your DSL, >> why not use lpeg to build a real DSL? > > Or for that matter, yacc, which is what Lua originally used before the > parser was rewritten manually? Lpeg is better in just about every way though... -Miles -- Cynic, n. A blackguard whose faulty vision sees things as they are, not as they ought to be. Hence the custom among the Scythians of plucking out a cynic's eyes to improve his vision. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 02:21:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H5LNUh008415; Mon, 17 Aug 2009 02:21:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFC2819271; Mon, 17 Aug 2009 02:20:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4454A18BF7 for ; Mon, 17 Aug 2009 02:20:48 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJuFiErL1kkT/2dsb2JhbACCVc9bhBkF X-IronPort-AV: E=Sophos;i="4.43,394,1246809600"; d="scan'208,217";a="492386675" Received: from unknown (HELO tigereye) ([203.214.73.19]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 17 Aug 2009 13:20:42 +0800 From: "John C. Turnbull" To: "'Lua list'" Subject: Java wrapper for LuaJIT? Date: Mon, 17 Aug 2009 15:20:42 +1000 Message-ID: <000901ca1efa$77919f90$66b4deb0$@com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01CA1F4E.493E4BD0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acoe+nXJo35FN2eHTVOM2hFHp0X/FQ== Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_000A_01CA1F4E.493E4BD0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Does anyone know of a Java wrapper for LuaJIT? I am looking for the absolute fastest way to script my Java apps. Thanks, -JCT ------=_NextPart_000_000A_01CA1F4E.493E4BD0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Does anyone know of a Java wrapper for = LuaJIT?  I am looking for the absolute fastest way to script my Java = apps.

 

Thanks,

 

-JCT

------=_NextPart_000_000A_01CA1F4E.493E4BD0-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 03:28:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H6S6t8013037; Mon, 17 Aug 2009 03:28:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B99041927F; Mon, 17 Aug 2009 03:27:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E67B519219 for ; Mon, 17 Aug 2009 03:27:34 -0300 (BRT) Received: by fxm27 with SMTP id 27so2219368fxm.35 for ; Sun, 16 Aug 2009 23:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=v7DphMhUNxV22nNTxfoS1o7j+9oPRWmBSzO/mZ/IoUg=; b=pDtZa7I9UKQ/l6HNpqkym2iw8HfLBiV8vkmooU6lVhbUekxwYFxrQjPMS274yx/Jwn 89UDUXIduaOcorRPcfJaUGXs821bTCtWuhu7Zbq0yvfkqJZJA99Y/SVKaVMrddjfCFeZ 11kj5QsJJsuVvnUwfOS17BSKPPUXHTwWpwQ4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QTi13zbtGxQzKHesBGHh27urBm3UpJeg0exOeo1e05ugqjqlTEZJOBO+clzeBbAcWP wZ7TigZ/4z0QCUr0M6wZyJ88C/r5EOK7QJ7n1aR+TgaPRpW5UcpDO7PpJxV9Gv1emf4U C6x71064jbfAhQIB7LCkOQQAWvxpNelcOj8Cg= MIME-Version: 1.0 Received: by 10.239.135.16 with SMTP id b16mr235329hbb.145.1250490452760; Sun, 16 Aug 2009 23:27:32 -0700 (PDT) In-Reply-To: <000901ca1efa$77919f90$66b4deb0$@com.au> References: <000901ca1efa$77919f90$66b4deb0$@com.au> Date: Mon, 17 Aug 2009 08:27:32 +0200 Message-ID: <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> Subject: Re: Java wrapper for LuaJIT? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7H6S6t8013037 On Mon, Aug 17, 2009 at 7:20 AM, John C. Turnbull wrote: > > Does anyone know of a Java wrapper for LuaJIT?  I am looking for the absolute fastest way to script my Java apps. I haven't tried it, but you should be able to build LuaJava against LuaJIT, the external API is just the same. If you're on Windows, I can provide the binary .dll, it's pretty straightforward on Linux x86 (doesn't do i86_64, sorry) just use the liblua.a from LuaJIT in the build. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 03:32:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H6W8fv013363; Mon, 17 Aug 2009 03:32:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C0161928A; Mon, 17 Aug 2009 03:31:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 477E519285 for ; Mon, 17 Aug 2009 03:31:43 -0300 (BRT) Received: by fxm27 with SMTP id 27so2220502fxm.35 for ; Sun, 16 Aug 2009 23:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9AWBJDD6sP6s4FZp+8rJC+zSVNzho96uK2R/yQVL31A=; b=fjoqNTTmQCWtnVwD+NQZGSuLcZf47VxHYdN1xXMVG3AC2h5O8BwvKXKrWQMjKd+T9K OShm/vvBZPf3xU7VgAVhl7bWDNSPODumoZweO6SiOe+rA60j8kenyOf5WebEeFnZH+EF 4q1NZLEKwhb2G+cwa4Rtsh/d1d7GMyQY8q3Mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fzkVtAuaNRDDAwijBQw/3oHS0WdZhcTVmtnxOkRanZKRcKBcqeSifZKovwtxjaI76F mrUQpy4fZ0ajay9BzHPHnZja8mgv5M68Ytd/h/DIITcxcXbU8c246ZafLLulhm1PCyUd JAhskEqcywOMbfdZtpSsCyRwi+Nwbb4/3nB+4= MIME-Version: 1.0 Received: by 10.239.179.13 with SMTP id b13mr261361hbg.81.1250490701637; Sun, 16 Aug 2009 23:31:41 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Aug 2009 08:31:41 +0200 Message-ID: <560972290908162331u315a3a23x573292776c98e83f@mail.gmail.com> Subject: Re: Improvements for creating DSL with Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7H6W8fv013363 On Sun, Aug 16, 2009 at 3:42 PM, François Perrad wrote: > For creating a DSL (Domain Specific Language), > you have choice between writing your own parser or extending a language. > > Since its origin, Lua is well suited for data oriented DSL. > But for declarative DSL, the mandatory use of parenthesis for arguments function > (except in case of a single string or table) is a big limitation. I would suggest, go with the language, don't fight it. Try some various syntaxes out on your users. IHMO, your notation seems kinda klunky, it can be done using standard Lua idioms, as has been suggested. As for doing your own DSL (as also suggested), man that's an (unnecessary) road of pain. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 04:11:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H7B6Yp017512; Mon, 17 Aug 2009 04:11:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20AFD1928A; Mon, 17 Aug 2009 04:10:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB9281925E for ; Mon, 17 Aug 2009 04:10:23 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADeeiErL1kkT/2dsb2JhbADSfIQZBYFN X-IronPort-AV: E=Sophos;i="4.43,394,1246809600"; d="scan'208";a="552188937" Received: from unknown (HELO tigereye) ([203.214.73.19]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 17 Aug 2009 15:10:17 +0800 From: "John C. Turnbull" To: "'Lua list'" References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> In-Reply-To: <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> Subject: RE: Java wrapper for LuaJIT? Date: Mon, 17 Aug 2009 17:10:17 +1000 Message-ID: <002401ca1f09$c6564630$5302d290$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcofA+KRO0sESt9lRFmP1cg/Jab+PAABa+yQ Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7H7B6Yp017512 Hi Steve, Thanks for the info - I'll try to build against the current LuaJIT. Could you please send me the Windows DLL you referred to? Thanks, John > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: Monday, 17 August 2009 16:28 > To: Lua list > Subject: Re: Java wrapper for LuaJIT? > > On Mon, Aug 17, 2009 at 7:20 AM, John C. Turnbull > wrote: > > > > Does anyone know of a Java wrapper for LuaJIT?  I am looking for the > absolute fastest way to script my Java apps. > > I haven't tried it, but you should be able to build LuaJava against > LuaJIT, the external API is just the same. > > If you're on Windows, I can provide the binary .dll, it's pretty > straightforward on Linux x86 (doesn't do i86_64, sorry) just use the > liblua.a from LuaJIT in the build. > > steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 04:33:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H7WvAY019187; Mon, 17 Aug 2009 04:32:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 721A7190DD; Mon, 17 Aug 2009 04:32:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2109B18B1F for ; Mon, 17 Aug 2009 04:32:27 -0300 (BRT) Received: by bwz10 with SMTP id 10so2324208bwz.5 for ; Mon, 17 Aug 2009 00:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Bc3TPtwNeX/hwBOjzFF6cprfNM2uEa1iwS2bA9x9EKc=; b=N+mQljyGAaPCqdp8luNbDQN371uNDeGGmQsfifvbJRfM5Oc/QkxXHXoJyUk1clD4EU 7pDNzgLSVnCgbviz8fwRI/Jlj3j/ITGjk6W7N6PKJwNO6frgcYZ+bJMM7YKLOJ2lNmMW IiHJFgh7FA/nfznxTV5dbfxpbJnEwPwG2EIlU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v4oEo5n2qBmxHXMzEfy5UdSGPAdWG2ZgfD9bAv8dHpCC6pVCiZuzYK/fjmCFOfkiAB qnH0jE2V8cCdY20sxykeSpjQoWE0qyVm9Xj3Kom44OsExiIyxDtOMz+9VJhqdFqkakLH Robk0R5Ulsi2fewenhjCMxKExIZdJ0o8pXVXg= MIME-Version: 1.0 Received: by 10.239.143.216 with SMTP id l24mr242238hba.166.1250494345636; Mon, 17 Aug 2009 00:32:25 -0700 (PDT) In-Reply-To: <002401ca1f09$c6564630$5302d290$@com.au> References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <002401ca1f09$c6564630$5302d290$@com.au> Date: Mon, 17 Aug 2009 09:32:25 +0200 Message-ID: <560972290908170032k1f41337bp661b2051f493819a@mail.gmail.com> Subject: Re: Java wrapper for LuaJIT? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7H7WvAY019187 On Mon, Aug 17, 2009 at 9:10 AM, John C. Turnbull wrote: > Thanks for the info - I'll try to build against the current LuaJIT.  Could > you please send me the Windows DLL you referred to? Assuming you have the JDK and a C compiler, then that's all you need, plus LuaJIT source. I mentioned the dll in case you were having difficulties building LuaJava yourself. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 04:40:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H7eZfm019903; Mon, 17 Aug 2009 04:40:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAAF319295; Mon, 17 Aug 2009 04:40:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (outbound.icp-qv1-irony-out4.iinet.net.au [203.59.1.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 738811928E for ; Mon, 17 Aug 2009 04:40:05 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAPKliErL1kkT/2dsb2JhbADTA4QZBQ X-IronPort-AV: E=Sophos;i="4.43,394,1246809600"; d="scan'208";a="454860462" Received: from unknown (HELO tigereye) ([203.214.73.19]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 17 Aug 2009 15:40:00 +0800 From: "John C. Turnbull" To: "'Lua list'" References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <002401ca1f09$c6564630$5302d290$@com.au> <560972290908170032k1f41337bp661b2051f493819a@mail.gmail.com> In-Reply-To: <560972290908170032k1f41337bp661b2051f493819a@mail.gmail.com> Subject: RE: Java wrapper for LuaJIT? Date: Mon, 17 Aug 2009 17:40:00 +1000 Message-ID: <002501ca1f0d$ed803a00$c880ae00$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcofDPJh5pP7kKNTTPeSFLnhSX2C/gAAOKeQ Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Assuming you have the JDK and a C compiler, then that's all you need, > plus LuaJIT source. I mentioned the dll in case you were having > difficulties building LuaJava yourself. Ah, OK thanks - I'll get it a go. John From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 06:07:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H97lai026217; Mon, 17 Aug 2009 06:07:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B18818E73; Mon, 17 Aug 2009 06:07:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E65618A22 for ; Mon, 17 Aug 2009 06:07:14 -0300 (BRT) Received: by ewy26 with SMTP id 26so2892351ewy.5 for ; Mon, 17 Aug 2009 02:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=EgBkEl+hStTG8LbMxgzOhv5BJa8J51YMt1sSmNQ7te8=; b=Qlozs7PXZkODfZymteBHBwPMExbRsd4u4whNAgJZ9J/zNK8mAzGo36iUfSNIjzLvuz JIqwkV1r3ok/+qQAOQQAkNmgGmS+8ktWrBSV2yzniNLtfhBMta1pVzQo2qhblmYZddrv 5aXy9ZKzyUWUI963M/74Dkh2S2G/lzI4jPBbI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=a2PgE8YNfjg5GnBAukr+x4JpEaK50vMBC30kNxEXPAy/cn8RXdQjemzkoVWiTfv3mk gy85JtpNrj5chkeNPYsz8pvkMeSmVQmq4S5bmPK74v0swU9h70G1IgT2VS9fp/nw/7l5 8owBkkzr2Uly5KmdjXZttiSqOU/U7tEGon3Ks= MIME-Version: 1.0 Received: by 10.216.88.65 with SMTP id z43mr1033871wee.5.1250500031211; Mon, 17 Aug 2009 02:07:11 -0700 (PDT) In-Reply-To: <1250429669.6796.8.camel@kymari> References: <1250429669.6796.8.camel@kymari> From: Jerome Vuarand Date: Mon, 17 Aug 2009 11:06:51 +0200 Message-ID: <89d273ba0908170206t79bf5a07xfe0b1a0f56083756@mail.gmail.com> Subject: Re: CouchDB for Lua? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7H97lai026217 2009/8/16 Jan Schütze : > I would like to try out couchdb with lua. Is there any library, yet? AFAIK there is none yet. But you can use LuaSocket [1] for the HTTP requests, and JSON4Lua [2] to encode and decode request content. [1] http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ [2] http://json.luaforge.net/ From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 06:24:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7H9OWgE027357; Mon, 17 Aug 2009 06:24:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52B781928A; Mon, 17 Aug 2009 06:24:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E438318E5E for ; Mon, 17 Aug 2009 06:24:03 -0300 (BRT) Received: by ewy26 with SMTP id 26so2901328ewy.5 for ; Mon, 17 Aug 2009 02:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=61Wf3jaFsaTpNUJ+7CimvteSkZK6WRGjoUaCcgtEzLw=; b=WYcsJgtu4qQhYE6NWLRCTgrXVnuS0OiySd0dRjQqWOrMfT+9PHkKx/FfywZbjKMxka COlfu/Ev6+wI2OrWzXbbJzOr2hRd/z6lOVhks8LzMlKNwVixmAeDv2q3HYkAaeq9ITFY mBgHdFD0oTpQcp22YJd8wD1PZfEy1ou2Yxc8w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=wvolm9ZuW4SVTXXY3+qtpkzleStQ4j5zZMJ4TbBoo33xZuwdXfOMWt2Og1DyxuIW6T PqoW8FTna1BZSicLdvGdnHhgU54SOGzZXHeMOWVhrrj2vIxbSVYW5G0v/HUfnn1wFRj6 2D/u7x8TJgncs90s17jvNld5XML++ZYz5gflQ= MIME-Version: 1.0 Received: by 10.216.53.196 with SMTP id g46mr959522wec.63.1250501041224; Mon, 17 Aug 2009 02:24:01 -0700 (PDT) In-Reply-To: <4A884066.1010301@ntlworld.com> References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> From: Jerome Vuarand Date: Mon, 17 Aug 2009 11:23:41 +0200 Message-ID: <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> Subject: Re: Hi and pushing existing UserData from pointer To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/16 Chris Camacho : >> Be careful. Lightuserdata all share the same metatable. This may not be >> your intent. > > > By adding the "cpShape" metatable I can use the "cpShape" methods > it is defiantly returning the correct pointer as the right object reacts > when I use that userdata's methods, how can what I'm returning > to lua be sharing the same metatable if I can call a method that's > unique to cpShape??? By assigning cpShape as the metatable of one light userdata, all light userdata now have that metatable. It means that if you create a light userdata elsewhere that is not a shape, it will still have cpShape as its metatable. And if you assign another metatable to that non-shape light userdata, it will change the metatable or all you existing shape light userdatas. You don't see the problem because you only use one type of object. But try with two or more and you will start getting very weird things. >> My approach to your problem would be to make a userdata the size of your >> pointer and then essentially use double indirection on any appropriate >> pointer you receive. > > really? that seems a lot of work (there must be something easier and > more elegant!) The most elegant solution is to have a weak table in the registry, as proposed earlier by Tony Finch. You can have your userdata constructor function put them there, and not care about that table thereafter, just use it to convert a light userdata to a full userdata. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 09:02:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HC1wRp009588; Mon, 17 Aug 2009 09:01:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05E4F18E75; Mon, 17 Aug 2009 09:01:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7537418B91 for ; Mon, 17 Aug 2009 09:01:03 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 24BAFB1C93 for ; Mon, 17 Aug 2009 15:00:53 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: lua@bazar2.conectiva.com.br Date: Mon, 17 Aug 2009 15:00:57 +0300 Subject: alternative to lua_call MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I wonder if there is an easy way to implement the following without doing excessive stack moves. There are many cases where calling Lua functions from C involves a lot of stack shuffling. For example, when using C API to iterate over sequence using Lua iterator protocol, or when lua_CFunction is forwarding call to another Lua function. It would help to have a more generic way to call Lua function from C. Something like: lua_calli(L, int fi, int argi, int reti, int nret) fi - index of function argi - index of first functoin argument reti - index where first return value should be located nret - if not LUA_MULTRET, number of returned values so lua_call(L, a, b) would be the same as lua_calli(L, -a-1, -a, -a-1, b), and lua_calli(L, idx, idx + 1, idx + 2, 2) where idx is the index of iterator function, would update stack with values from the next iteration. It is easy to implement this by duplicating function + arguments on a stack. But I don't know how to do any better, since stack position of called function value is tightly coupled with the call frame in Lua internals. Any ideas. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 09:50:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HCoS3j017692; Mon, 17 Aug 2009 09:50:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C15EB18F4E; Mon, 17 Aug 2009 09:50:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4367318EA0 for ; Mon, 17 Aug 2009 09:49:54 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Md1em-00048t-00; Mon, 17 Aug 2009 14:49:48 +0200 Date: Mon, 17 Aug 2009 14:49:40 +0200 From: Mike Pall To: Lua list Subject: Re: Java wrapper for LuaJIT? Message-ID: <20090817124940.GA8924@mike.de> References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > John C. Turnbull wrote: > > Does anyone know of a Java wrapper for LuaJIT?  I am looking for the absolute fastest way to script my Java apps. > > I haven't tried it, but you should be able to build LuaJava against > LuaJIT, the external API is just the same. Please note that LuaJava uses JNI for calls from Java to Lua or back from Lua into Java. It's well known that JNI is *slow*. And LuaJava also has to serialize/unserialize all values passed across the Lua/Java boundary. Neither Java's JIT compiler, not LuaJIT will be able to speed this process up. The more often you cross the language boundary, the more performance loss this incurs. E.g. repeatedly calling a Lua method from inside a Java loop (or vice versa) is a bad idea. Alas, this more or less rules out many good use cases for scripting a Java application. You really need to stay in *either* the Java domain *or* the Lua domain for as long as possible. A long running loop in pure Lua will definitely benefit from the use of LuaJIT. But if you're just running a couple of instructions on either side, you're not going to see much of a difference. So, please don't be disappointed of the results. If you have a large Java code base, it may be a better choice to look for a scripting language which stays inside the Java domain (i.e. generates Java classes at runtime) and thus doesn't have to use JNI. [Note that this is not a critique of either LuaJava or JNI. The use of JNI is a design decision of LuaJava. And the performance of JNI simply reflects the inherent impedance mismatch between the Java and the C side.] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 09:59:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HCxUWo019346; Mon, 17 Aug 2009 09:59:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9603419271; Mon, 17 Aug 2009 09:59:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B736519049 for ; Mon, 17 Aug 2009 09:59:02 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so664058fgg.5 for ; Mon, 17 Aug 2009 05:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FKwS4iWZJ8CLEEtWEOAsUcboQ529xwFWE5N3txs0d+Q=; b=KObaZK0exu1prfVqaBhS+wtM3uxdss7woJceOyT1GUXp18oONcpQCcTlq6dNRdvXCv JVPXSepX1I3kUdceF307vLjFeg0aHxbNjqDJde2EKB8a5cPvRFGh9YK4UPv+UDdSkvxV ER+uwRvMyvi3rWspcNKH1QeSExD6i98YEnkYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vgWddLdgEctWHQMeJSOVL4+EzOgQTE9MDmuvVlDs8V6FOj51XJEkwoCRCyNQpLQUSZ hr5BdbvnIknx8IukFh4K03dYnaFdu4gF0rVZRf653DsmFvF0TvBEUaKNQfd7VAKcHkEG GQhA0ndZVOy1QUrg0KwAOpGo3/GUba5aj1TDY= MIME-Version: 1.0 Received: by 10.239.145.148 with SMTP id s20mr318436hba.142.1250513939512; Mon, 17 Aug 2009 05:58:59 -0700 (PDT) In-Reply-To: <20090817124940.GA8924@mike.de> References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <20090817124940.GA8924@mike.de> Date: Mon, 17 Aug 2009 14:58:59 +0200 Message-ID: <560972290908170558n55fa26d9p64ccb7b82163677f@mail.gmail.com> Subject: Re: Java wrapper for LuaJIT? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 17, 2009 at 2:49 PM, Mike Pall wrote: > If you have a large Java code base, it may be a better choice to > look for a scripting language which stays inside the Java domain > (i.e. generates Java classes at runtime) and thus doesn't have to > use JNI. I did indicate to John privately that calls between Lua and Java are not going to be fast. For scripting glue, that is acceptable, I suppose - but he did say _fast_ ;) There is at least one pure Java implementation of Lua (Kahlua) which I'm aware of. Their niche is smart phones. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 13:06:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HG6DER032594; Mon, 17 Aug 2009 13:06:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD5F11888A; Mon, 17 Aug 2009 13:05:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B10C318869 for ; Mon, 17 Aug 2009 13:05:35 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Md4i3-00055A-Dn for lua@bazar2.conectiva.com.br; Mon, 17 Aug 2009 18:05:23 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2009 18:05:23 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2009 18:05:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Java wrapper for LuaJIT? Date: Mon, 17 Aug 2009 18:06:24 +0200 Lines: 18 Message-ID: References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <20090817124940.GA8924@mike.de> <560972290908170558n55fa26d9p64ccb7b82163677f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <560972290908170558n55fa26d9p64ccb7b82163677f@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 17/08/2009 14:58, steve donovan wrote: > There is at least one pure Java implementation of Lua (Kahlua) which > I'm aware of. Their niche is smart phones. Yes, looks like a viable solution as the JVM isn't too bad and has its own JIT compiler (HotSpot if I am not mistaken). I wonder if Kahlua can benefit of new Java 7 JVM improvements for dynamic languages... Although I don't know/recall if Kahlua is generating Java bytecode out of Lua code or if it is interpreting Lua bytecode with its own Lua interpreter. In the latter case, it might not gain as much a performance boost from HotSpot nor latest features. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 15:52:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HIqUL8011717; Mon, 17 Aug 2009 15:52:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84C9318EF2; Mon, 17 Aug 2009 15:51:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA7CB18815 for ; Mon, 17 Aug 2009 15:51:52 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so457710fgb.5 for ; Mon, 17 Aug 2009 11:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=VWV/AeDbSvzJ8aOBu+D6l4oLO9YyqWOFJe6gC9LF/i8=; b=i5YHIAH70mfXn587AQCQ3ONT5wr7d20kmdAfwoT8TfNTKCG2YZqRl3DQ0q2umJLLUs IXvx6FsUtR/KHTHNDhcNK93BTtlPqS5vGI9T/yUvEY0Cihpc6jmk1TFt1YWUIaSuBQHN T2U8tCx8J8DsTY5TWqC8RIeWOLV1XOUFWKulg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Q9kiVFPrI/QESiwvFOTZjGfyF8ms+NhD+dPZ2oqN/9I6EUgORVZUUiRtrnImbkeFfT fY/dB/FXc/l8uvANDUZbBtslttWjz4gkUv+phfZ/OjHLbJfcs2SI8PrP5auqxCjicDFl jBHjfhI2Lr7BHblkQfPC+8y3o7SuuWgZrE0WQ= MIME-Version: 1.0 Received: by 10.86.251.6 with SMTP id y6mr2565449fgh.24.1250535110396; Mon, 17 Aug 2009 11:51:50 -0700 (PDT) Date: Mon, 17 Aug 2009 13:51:50 -0500 Message-ID: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> Subject: building lua 5.1.4 as a shared lib on os x and intel x86_64 From: Michael Kohout To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001485e9ab4f08d2c404715ae591 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485e9ab4f08d2c404715ae591 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all- I've got to link lua as a shared lib for a project of mine (I'm using ffi from common lisp to embed lua...but I digress). Considering the last time I really touched makefiles/gcc was 10 years ago in college, I'm having trouble figuring out what I've got to change in the makefile so I can generate a 64 bit shared library. Do any of you have any hints, or perhaps there is something that I've missed in the docs on how to accomplish this? thanks for the help Mike Kohout --001485e9ab4f08d2c404715ae591 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all-

I've got to link lua as a shared lib for a project of mi= ne (I'm using ffi from common lisp to embed lua...but I digress).
Considering the last time I really touched makefiles/gcc was 10 years ago= in college, I'm having trouble figuring out what I've got to chang= e in the makefile so I can generate a 64 bit shared library.

Do any of you have any hints, or perhaps there is something that I'= ve missed in the docs on how to accomplish this?

thanks for the help=
Mike Kohout
--001485e9ab4f08d2c404715ae591-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 16:09:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HJ9Hl0015678; Mon, 17 Aug 2009 16:09:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5ECFD18FB7; Mon, 17 Aug 2009 16:08:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AD1518F06 for ; Mon, 17 Aug 2009 16:08:42 -0300 (BRT) Received: by fxm27 with SMTP id 27so2600422fxm.35 for ; Mon, 17 Aug 2009 12:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=nmTLQZx/pLQDS+MzpZBbR6ZR32GgHQx4UmFdQwTKJnU=; b=JphBHrBXcAprIuw6Jo1lfWLtwlWKJTf1PqkSAhBGVv7uWY2vD3cmoQizubb3jkpoRv vMHb7DBEvNR+IscpqI06+oRulSckuXbTrIfjlU4R0t+yW4W1x4dIkZP+ZBhPL3e+V1/0 MJ+FRq0JeE8KjGfjYsalLYAVainIbUefzdVo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mp0qiGiX+DVLQR4BBdn7jGuwEf4X6JzL03zEGfykqgKOi3j3XPJYiOQn38qj/k061X iDH3Ig3Esv4yeupqSgGztxue3tTPKQIy0VVdCVp+lkPadCNRSmLzFmg/RvyjpnkzqFq6 UeWyaeBjMbMSA/yPfQ3Xrr6kw7aveJiyRVMuQ= MIME-Version: 1.0 Received: by 10.204.141.26 with SMTP id k26mr3004526bku.130.1250536121488; Mon, 17 Aug 2009 12:08:41 -0700 (PDT) In-Reply-To: References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <20090817124940.GA8924@mike.de> <560972290908170558n55fa26d9p64ccb7b82163677f@mail.gmail.com> Date: Mon, 17 Aug 2009 21:08:41 +0200 Message-ID: <13af99c70908171208qb79aebfj23bf211aee273b38@mail.gmail.com> Subject: Re: Java wrapper for LuaJIT? From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=0015175cd6084cd63104715b2184 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cd6084cd63104715b2184 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Kahlua does not generate bytecode, it's a plain bytecode interpreter. I also doubt it benefits much from the JIT, it would be very hard for it to optimize for it or do any sort of predictions. Still, my own benchmarks (possibly not fair or measuring the right thing) show it to be about the same speed as LuaJ, much faster than MiniJoe, Groovy, Cajuscript and Rhino, and about 30 times slower than plain Java. On Mon, Aug 17, 2009 at 6:06 PM, Philippe Lhoste wrote: > On 17/08/2009 14:58, steve donovan wrote: > >> There is at least one pure Java implementation of Lua (Kahlua) which >> I'm aware of. Their niche is smart phones. >> > > Yes, looks like a viable solution as the JVM isn't too bad and has its own > JIT compiler (HotSpot if I am not mistaken). > > I wonder if Kahlua can benefit of new Java 7 JVM improvements for dynamic > languages... > > Although I don't know/recall if Kahlua is generating Java bytecode out of > Lua code or if it is interpreting Lua bytecode with its own Lua interpreter. > In the latter case, it might not gain as much a performance boost from > HotSpot nor latest features. > > -- > Philippe Lhoste > -- (near) Paris -- France > -- http://Phi.Lho.free.fr > -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > --0015175cd6084cd63104715b2184 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Kahlua does not generate bytecode, it's a plain bytecode interpreter.I also doubt it benefits much from the JIT, it would be very hard for it = to optimize for it or do any sort of predictions.

Still, my own benc= hmarks (possibly not fair or measuring the right thing) show it to be about= the same speed as LuaJ, much faster than MiniJoe, Groovy, Cajuscript and R= hino, and about 30 times slower than plain Java.

On Mon, Aug 17, 2009 at 6:06 PM, Philippe Lh= oste <PhiLho@gmx.net= > wrote:
On 17/08/2009 14:58, steve donovan wrote:
There is at least one pure Java implementation of Lua (Kahlua) which
I'm aware of. =A0Their niche is smart phones.

Yes, looks like a viable solution as the JVM isn't too bad and has its = own JIT compiler (HotSpot if I am not mistaken).

I wonder if Kahlua can benefit of new Java 7 JVM improvements for dynamic l= anguages...

Although I don't know/recall if Kahlua is generating Java bytecode out = of Lua code or if it is interpreting Lua bytecode with its own Lua interpre= ter. In the latter case, it might not gain as much a performance boost from= HotSpot nor latest features.

--
Philippe Lhoste
-- =A0(near) Paris -- France
-- =A0http://Phi.Lho.f= ree.fr
-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- = =A0--


--0015175cd6084cd63104715b2184-- From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 16:39:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HJcurA021706; Mon, 17 Aug 2009 16:38:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A249119018; Mon, 17 Aug 2009 16:38:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BBFA18F02 for ; Mon, 17 Aug 2009 16:38:19 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1Md820-0006Nt-C3 for lua@bazar2.conectiva.com.br; Mon, 17 Aug 2009 21:38:12 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1Md81z-0000dL-PV for lua@bazar2.conectiva.com.br; Mon, 17 Aug 2009 21:38:11 +0200 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Java wrapper for LuaJIT? References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <20090817124940.GA8924@mike.de> Date: Mon, 17 Aug 2009 21:38:11 +0200 In-Reply-To: <20090817124940.GA8924@mike.de> (Mike Pall's message of "Mon, 17 Aug 2009 14:49:40 +0200") Message-ID: <87ws52kz8c.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Mike Pall: > Please note that LuaJava uses JNI for calls from Java to Lua or > back from Lua into Java. It's well known that JNI is *slow*. Have you recently benchmarked Hotspot? 8-) It's not that bad anymore. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 17:30:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HKUQqg001698; Mon, 17 Aug 2009 17:30:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C8B618FCC; Mon, 17 Aug 2009 17:29:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A70818F06 for ; Mon, 17 Aug 2009 17:29:36 -0300 (BRT) Received: by fxm27 with SMTP id 27so2644392fxm.35 for ; Mon, 17 Aug 2009 13:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FJhlcXtuVn9DogScSb5DA2ER1ibSmLWFJJyV90GRgaw=; b=eOq3pIKKjWmTADu2yXZAxxyholsz5iccXKuz8Q5dTw7Vru9fIMF1aV4ZgzxjKbn+nR paPbvD1akBm/rQ5s7YBEQkM1xwjEnnxibgqTniAMWT0/ifL2J6wqq/t79g0+ysS+goov 8H6f5dbTRKzrglyiJ56iPdK88MHO0d20MALv8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=bYr7ZGkTP6O2+Y/HC/Q6fM9QfEXBuGWckJ+pGl9vn8HmeqkD89Uu8e89Q0CWof8ZuP 3t754KAmGfOp5PM4EcpnDuYLZADGZncdiqgAZWU/670zY4j3gI3nbuxSPQ81g9SWDGlJ wr23GLWv4lMLbywRA1WpJaZEaebJXnfOWvLoY= MIME-Version: 1.0 Received: by 10.223.144.149 with SMTP id z21mr911092fau.79.1250540974002; Mon, 17 Aug 2009 13:29:34 -0700 (PDT) Date: Mon, 17 Aug 2009 16:29:33 -0400 X-Google-Sender-Auth: feddb03bfa4a95af Message-ID: Subject: Re: package.seeall and strict conflict From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7HKUQqg001698 On Thu, 13 Aug 2009 00:59:40 -0400, David Manura wrote: > Let some module A in a program do require "strict" and some other > module B in the program do module(..., package.seeall).  Now, strict > behavior is applied to the implementation of B.  This may be desirable > or it might not be. In my opinion, this is *not* desirable. If A is written using "strict", then "strict" should apply only to A, and not to modules that use A. > I've long felt there are significant flaws in how the "module" > function works [1] because it encourages certain practices and has > subtle behaviors that make writing reliable and secure programs more > difficult. I agree. In the short time I've been using Lua, I have missed the kind of module systems I have used with some other languages, in particular those that enforce isolation between modules and control over their imports and exports. As I only use Lua in my spare time (outside of work), I was able to let a number of ideas percolate in my brain for a while before I had time to do anything about it. Then, during a June vacation from work, I did an implementation (on a Linux laptop, by the side of a lake in the mountains, which is a wonderful way to code). If there is interest, I could find a place to post my implementation. (On Luaforge?) The rest of this email is a description of what I designed and implemented. I borrowed heavily from ML and Scheme48 and other places, while trying hard to keep the result in the spirit of Lua. Every time you see the word "structure", you should think "module" or "package". Oh, and I'm using a rather narrow definition of "binding" in my explanations [2]. My system achieves these goals: (1) Backwards compatibility with all of the existing module features, which continue to work as they do today. You can run your code in an environment that has a mix of regular Lua modules and "structures", which are what my system defines. (2) The ability to declare "structures", which are proper modules that import the bindings they need, and export the bindings they want to expose. The name "structure" is from ML and Scheme48. It was a convenient choice because both "module" and "package" are already used in Lua. The declaration of a structure is typically separate from the code that implements it, making it easy to reuse existing code without modifying any files. (3) When you open a structure S, its exported bindings become visible to you. You get a copy of the bindings, which means you cannot affect other code that uses S. The copy is necessary because Lua does not support read-only tables (without using metatables). (4) Structure declarations are short, and can refer to (re-use) existing code (both Lua and object libraries). Most of the time, the existing file of code does not have to be modified at all, whether it uses Lua's "module" function or not. (5) You can easily create a "user" package that is a tightly controlled environment for running user code. My primary goals were enforced namespace control (secure == no leaks!) and isolation (robust module code == no unwanted interactions!). My system, called Darwin, supplies a function structure.open(modname) which opens a structure (a module). A configuration option causes Darwin to insert entries in package.preload of the form [modname]=structure.open, which effectively extends the existing Lua "require" function to first look for a defined structure to open before trying other loaders. I have been using Darwin for all of my (spare time) Lua coding since June, and so far it is doing everything I want. I've tested various bits of Lua code available online, including pure C libraries, pure Lua libraries, and hybrids (e.g. "lanes"). I'm sure there are bugs and perhaps unintuitive behavior lurking still in Darwin, though the rate at which I am finding them has dropped off. Perhaps by sharing Darwin, others can help me find more flaws. The implementation is around 950 lines of Lua code, about 200 of which are re-implementations of most of loadlib.c. (The loadlib functions are effectively closed over a single package table, and Darwin provides a package table for each structure that needs one.) The run-time space is also larger than it could be, adding between 4-8k (mostly copies of bindings) for each structure you load, depending on if that structure uses _G (around 3k) or _G plus all the standard libraries (around 8k). If there were a clean way to support read-only tables, then the overhead incurred by copying tables of bindings would go away. Note: I do not like the idea of using a metatable to create a read-only table in this particular situation, because you need to protect the metatable in order to prevent user code from escaping its "jail" (which is the structure in which it executes). But once you protect the metatable, you break a useful (and widely used) feature of Lua, which is the ability to change the metatable of the environment. That is why I chose a copying approach. Darwin works fine with "strict" -- the effects of "strict" are limited to only the structures that use it. Here's a quick example using Lua Lanes 2.0.3, which I installed unmodified. After playing with it, I wrote this declaration [3]: > structure.declare { name="lanes"; open={"_G", "package", "table", "string"}; environment=[[ require("lanes"); return lanes ]]; } > require "lanes" > dofile "lanes-test.lua" done pending waiting... 5083 true 6500 true . running ....... cancelled Lane starts! 1 received 1 sent 2 received 2 sent ...... [Remainder of test output deleted] The declaration of the structure "lanes" uses Lua's require function (reimplemented in Darwin), which uses the loaders in the package table. By declaring the structure, an entry for "lanes" was put into package.preload, so that I could then type 'require "lanes"' to open the lanes structure. As you can guess from the example declaration, the "environment" field of a declaration contains code that returns the table that will become the environment of the module. There are other fields that can be used in a declaration as well, e.g. to load in files of code and to direct where the bindings should appear when the structure is opened (so that you can put them anywhere you want, even at top level). I think the design is the right one to enable separate compilation of modules in such a way that compiled module code retains its run-time behavior when mixed with other code -- it is isolated. But I have not had time to look into this yet. Also, there may be an opportunity to exploit weak populations to reduce run-time space, i.e. to use weak tables for imported bindings so that, e.g. if you only use two functions in _G, your copies of the other bindings will be collected. Of course, this can break reflective code. I conjecture that a couple of small changes to the implementation of Lua (not to the language) would allow me to shrink the Darwin code to about 500 lines, and also to reduce the run-time space used by the private tables of bindings in each structure. Putting aside any changes to Lua, I'd like to know if there's interest in Darwin. If so, then I'll write up some docs and put those and the code online. Would anyone find this useful? --Jim > [1] http://lua-users.org/wiki/LuaModuleFunctionCritiqued [2] A binding is a mapping from a name to a location in the store (which is an abstraction of memory). The binding of "dofile" in _G maps the name "dofile" to a location that happens to contain a function. An assignment to "dofile" (e.g. dofile=4) causes a change in its binding -- the name will map to a different location. The function to which "dofile" was bound still exists, and there may well be other bindings to the location containing that function. When there are no bindings (or only weak bindings) to that location, the function that implements the dofile operation can be garbage collected. (This definition technically only applies to boxed values, but it generalizes to "location or unboxed value". And, my point was to illustrate that a Darwin structure does not have its own copies of all of the functions from structures it opens (e.g. _G, string, os, lanes, ...). A Darwin structure has copies of *bindings* to those functions.) [3] In the example above, I typed in the declaration for "lanes". In normal practice, I have some files containing such declarations, and I load the relevant ones into my interactive Lua state. Since structures are not loaded until they are opened, I can have lots of declared structures and they take up almost no space until I start using them (e.g. with "require(modname)"). From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 18:45:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HLjb7O018691; Mon, 17 Aug 2009 18:45:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F28419155; Mon, 17 Aug 2009 18:45:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D94918CF4 for ; Mon, 17 Aug 2009 18:44:57 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090817214451.ZTFR6742.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Mon, 17 Aug 2009 22:44:51 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090817214451.QOYP2093.aamtaout03-winn.ispmail.ntl.com@STORE.store> for ; Mon, 17 Aug 2009 22:44:51 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 611EEB9E4 for ; Mon, 17 Aug 2009 22:49:33 +0100 (BST) Message-ID: <4A89CF4C.9010302@ntlworld.com> Date: Mon, 17 Aug 2009 22:44:44 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> In-Reply-To: <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=JDT5rc8tuDO1naQnGFcA:9 a=y2psQD4f9monh-fvErgA:7 a=spUehYzfzqc_MdvhDYYW-TS6RLsA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The most elegant solution is to have a weak table in the registry, as > proposed earlier by Tony Finch. You can have your userdata constructor > function put them there, and not care about that table thereafter, > just use it to convert a light userdata to a full userdata. > slight problem... when I create the user data on the stack if I pop it off to save it to a table there's no way to push userdata onto the stack How would I "peek" into the stack and save the new userdata without disturbing the values I'm assembling on the stack for the return? Thanks for explaining lightuserdata metatables in a clearer manner, although I have 8 or more types wrapped this is the first time I've had to return a reference to existing userdata and what a PITA it is! thanks Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 18:50:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HLoiXp019973; Mon, 17 Aug 2009 18:50:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17C51928C; Mon, 17 Aug 2009 18:50:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FF8B1926F for ; Mon, 17 Aug 2009 18:50:19 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HLoGPr019868 for ; Mon, 17 Aug 2009 18:50:17 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 31D221F1154; Mon, 17 Aug 2009 18:50:16 -0300 (BRT) Date: Mon, 17 Aug 2009 18:50:16 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: package.seeall and strict conflict Message-ID: <20090817215016.GA1411@magritte.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I conjecture that a couple of small changes to the implementation of > Lua (not to the language) would allow me to shrink the Darwin code to > about 500 lines, and also to reduce the run-time space used by the > private tables of bindings in each structure. What changes would that be? Would they be restricted to loadlib.c? From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 18:56:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HLu4ak021173; Mon, 17 Aug 2009 18:56:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D451192A6; Mon, 17 Aug 2009 18:55:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C0F81926F for ; Mon, 17 Aug 2009 18:55:38 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HLtaxR021116 for ; Mon, 17 Aug 2009 18:55:36 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 7B5771F1154; Mon, 17 Aug 2009 18:55:36 -0300 (BRT) Date: Mon, 17 Aug 2009 18:55:36 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: building lua 5.1.4 as a shared lib on os x and intel x86_64 Message-ID: <20090817215536.GB1411@magritte.tecgraf.puc-rio.br> References: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm having trouble figuring out what I've got to change in the > makefile so I can generate a 64 bit shared library. Add -fPIC to CFLAGS and to MYLDFLAGS. Then do this: make clean linux rm lua.o luac.o print.o cc -shared -o liblua.so *.o I'm not sure whether you need -fPIC in the last line or not. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 19:10:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HMAAVb023077; Mon, 17 Aug 2009 19:10:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A023192AC; Mon, 17 Aug 2009 19:09:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D622190FC for ; Mon, 17 Aug 2009 19:09:35 -0300 (BRT) Received: by ewy26 with SMTP id 26so3418641ewy.5 for ; Mon, 17 Aug 2009 15:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=5AKWbOIXbdFaWhtgV8Ttu2xzGZzAbJXJ2q9bxHqOGEw=; b=g7YY7QWEgpr7jDxAmGuHyErivRSDMtBcL6pc8NHU5rPaknJZgKDTthDIDyRpllccsI zqkWS458JcKZAT8PxqNsbps600DbPumFVwPsd8ZZo0et0RHLoNrRCQc53VmN4GQsdXOX a7XpVpvBSv80gIs0IyOZtjlfz03DV+IbHHrmk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PhS07Zxy7+DwfwOm4bSsy7LK4oqhOBjNOmw5gD8qYhFxQ7lxqUP8DZJ2B33FLqQ+Va a8D+v4UTvtZicNKNOooQ7yJ5MM9zP6Bc1I8/BByGYpWJCZ+3I5h+k/VRCM5tY5Z58CYq lvyd/IFVRz7NEwYWA9Vlyei3EUwAdWCWJbItM= MIME-Version: 1.0 Received: by 10.216.88.209 with SMTP id a59mr1102776wef.50.1250546972172; Mon, 17 Aug 2009 15:09:32 -0700 (PDT) In-Reply-To: <4A89CF4C.9010302@ntlworld.com> References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> From: Jerome Vuarand Date: Tue, 18 Aug 2009 00:09:12 +0200 Message-ID: <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> Subject: Re: Hi and pushing existing UserData from pointer To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/17 Chris Camacho : >> The most elegant solution is to have a weak table in the registry, as >> proposed earlier by Tony Finch. You can have your userdata constructor >> function put them there, and not care about that table thereafter, >> just use it to convert a light userdata to a full userdata. > > slight problem... when I create the user data on the stack > if I pop it off to save it to a table there's no way to push > userdata onto the stack You could eventually have indexed the weak table again to retrieve the userdata reference, but since the weak reference would have been the last one, it could have been collected in between (any call to the Lua C API can trigger a collection cycle). > How would I "peek" into the stack and save the new userdata > without disturbing the values I'm assembling on the stack for > the return? You can use lua_pushvalue to duplicate the reference to the userdata on the stack. Then you can save one in the weak table (with the light userdata key), and do whatever you want with the other one. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 19:45:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7HMjlwm028001; Mon, 17 Aug 2009 19:45:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EACA6192A9; Mon, 17 Aug 2009 19:45:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-152.bluehost.com (outbound-mail-152.bluehost.com [67.222.39.32]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1BBDC1929E for ; Mon, 17 Aug 2009 19:45:09 -0300 (BRT) Received: (qmail 5505 invoked by uid 0); 17 Aug 2009 22:45:04 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy5.bluehost.com with SMTP; 17 Aug 2009 22:45:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=6ldfjrTrBJZcrWiFAnkOdBt8aKFnr0/5FKlbRa2VeycLt0N2xllcfDhZvfA7v7OvD9tADQOJwwXfMhiebDjRmr67kZaJbHzUn6efYnoB16oUphUz1PsLEJP3s/k0PYsg; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MdAwo-0001Q1-H4 for lua@bazar2.conectiva.com.br; Mon, 17 Aug 2009 16:45:04 -0600 Date: Mon, 17 Aug 2009 18:44:52 -0400 From: TNHarris To: Lua list Subject: Re: ... as an "expand list" unary postfix operator Message-ID: <20090817184452.759663ab@egeria.whoopdedo.org> In-Reply-To: References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 14 Aug 2009 00:00:08 -0400 David Manura wrote: > > One of the prototypical problems in [1] was to implement a function > this: > > --Wraps a function with trace statements. > function trace(f) > return function(...) > print("begin", f) > local result = tuple(f(...)) > print("end", f) > return result() > end > end > I'd be preferential to the syntax: -- snip print("begin", f) ... = f(...) print("end", f) return ... -- snip -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 21:22:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I0Luw3008972; Mon, 17 Aug 2009 21:21:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E9C919297; Mon, 17 Aug 2009 21:21:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABF90191D9 for ; Mon, 17 Aug 2009 21:21:21 -0300 (BRT) Received: by ewy26 with SMTP id 26so3475250ewy.5 for ; Mon, 17 Aug 2009 17:21:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.128.17 with SMTP id a17mr3848743ebd.38.1250554879879; Mon, 17 Aug 2009 17:21:19 -0700 (PDT) In-Reply-To: <560972290908160759p6b272cacl14cf392724508b93@mail.gmail.com> References: <560972290908160759p6b272cacl14cf392724508b93@mail.gmail.com> Date: Mon, 17 Aug 2009 20:21:19 -0400 X-Google-Sender-Auth: 914a9271a92f3215 Message-ID: Subject: Re: Suggestion: strip indentation for long string constructor From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I0Luw3008972 On Sun, Aug 16, 2009 at 10:59 AM, steve donovan wrote: > On Sun, Aug 16, 2009 at 12:33 PM, Stuart P.Bentley wrote: >>     [[ >>     This string starts with 6 spaces! >>     And there's another six after that newline! >>     Does that look right to you?]] > > But it's not difficult to strip out initial indentation using pure Lua code: When doing this, you can also omit parenthesis in the function call, in which case the function (f) resembles a modifier on the string: f[[ ..... ]] . See also [1]. [1] http://lua-users.org/wiki/MetaLuaRecipes ("Multiline String Break Escapes") From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 21:43:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I0hrve011709; Mon, 17 Aug 2009 21:43:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDC84191C9; Mon, 17 Aug 2009 21:43:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF7EF18D42 for ; Mon, 17 Aug 2009 21:43:26 -0300 (BRT) Received: by ewy26 with SMTP id 26so3485570ewy.5 for ; Mon, 17 Aug 2009 17:43:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.63.18 with SMTP id l18mr7677657eba.67.1250556204535; Mon, 17 Aug 2009 17:43:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Aug 2009 20:43:24 -0400 X-Google-Sender-Auth: 0c4701e502c81f82 Message-ID: Subject: Re: x="abc":upper() v.s. x=("abc"):upper() patch From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I0hrve011709 On Sat, Aug 15, 2009 at 10:11 PM, Peter Cawley wrote: > On Sat, Aug 15, 2009 at 11:40 PM, David Manura wrote: >> The new rule >> enforced by the parser becomes "there can be no line break between >> prefixexp and args". > > Given that: > functioncall ::=  prefixexp args | prefixexp `:´ Name args > > In the latter case, is the rule "no line break between prefixexp and > args", or is it "no line break between Name and args"? > .... > factory_function(...) > :modifier_method_1(...) In that case there would be no rule because there is no ambiguity. "factory_function(...) :", "factory_function(...) : name", and ":modifier_method_1(...)" cannot form valid statements. Now, there was a proposal, related to [2] above, that would cause "a:b" to be equivalent to "(function(...) return a(b, ...) end)". Under that proposal, "factory_function(...) : name" _could_ be a suffix of a valid statement. The first rule should then be simplified to "no line break before args". Even without the "a:b" proposal, we could still choose to make that simplification. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 21:52:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I0qRg5012843; Mon, 17 Aug 2009 21:52:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 309ED192A3; Mon, 17 Aug 2009 21:52:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0891919239 for ; Mon, 17 Aug 2009 21:51:58 -0300 (BRT) Received: by ewy26 with SMTP id 26so3489562ewy.5 for ; Mon, 17 Aug 2009 17:51:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.82.18 with SMTP id f18mr7695290ebb.38.1250556717482; Mon, 17 Aug 2009 17:51:57 -0700 (PDT) In-Reply-To: <20090817184452.759663ab@egeria.whoopdedo.org> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <20090817184452.759663ab@egeria.whoopdedo.org> Date: Mon, 17 Aug 2009 20:51:57 -0400 X-Google-Sender-Auth: 5897717fcd5af97a Message-ID: Subject: Re: ... as an "expand list" unary postfix operator From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I0qRg5012843 On Fri, Aug 14, 2009 at 4:12 AM, Peter Cawley wrote: > If this syntax were to > be adopted, it would carry several restrictions: > * At any given scope level (i.e at any block, excluding its "child" > blocks) there can exist a maximum of one tuple variable at any one > time. ..... > similar restrictions to ensure that a TUPLE is always matched > by a DETUPLE, that tuples are destroyed in reserve order to that in > which they were created, and that a tuple is not used for anything > except DETUPLE. On Mon, Aug 17, 2009 at 6:44 PM, TNHarris wrote: > I'd be preferential to the syntax: > >  print("begin", f) >  ... = f(...) >  print("end", f) >  return ... Having a single writable list "..." per function may satisfy the most common case. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 22:18:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I1IsmJ015853; Mon, 17 Aug 2009 22:18:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E44BE19294; Mon, 17 Aug 2009 22:18:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 376E518F06 for ; Mon, 17 Aug 2009 22:18:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so3502127ewy.5 for ; Mon, 17 Aug 2009 18:18:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.128.17 with SMTP id a17mr3884690ebd.38.1250558303942; Mon, 17 Aug 2009 18:18:23 -0700 (PDT) In-Reply-To: <13af99c70908171208qb79aebfj23bf211aee273b38@mail.gmail.com> References: <000901ca1efa$77919f90$66b4deb0$@com.au> <560972290908162327p25b8c31cs1fc2b9380e68f767@mail.gmail.com> <20090817124940.GA8924@mike.de> <560972290908170558n55fa26d9p64ccb7b82163677f@mail.gmail.com> <13af99c70908171208qb79aebfj23bf211aee273b38@mail.gmail.com> Date: Mon, 17 Aug 2009 21:18:23 -0400 X-Google-Sender-Auth: 7027b19c8ad21e09 Message-ID: Subject: Re: Java wrapper for LuaJIT? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 17, 2009 at 3:08 PM, Kristofer Karlsson wrote: > Kahlua does not generate bytecode, it's a plain bytecode interpreter. > I also doubt it benefits much from the JIT, it would be very hard for it to > optimize for it or do any sort of predictions. > > Still, my own benchmarks (possibly not fair or measuring the right thing) > show it to be about the same speed as LuaJ, much faster than MiniJoe, > Groovy, Cajuscript and Rhino, and about 30 times slower than plain Java. The list of known Lua implementations in Java are in [1]. Perhaps yet another way to go about this is to translate Lua code into Lua API code (like lua2c) or Lua bytecode (like luac2c) or maybe even LuaJIT2 bytecode, but instead of binding it to C Lua, bind it to one of the Java implementations of Lua. I've heard that Mochalua is "(slavishly) true to the C API" [2]. If so, it shouldn't be much work to patch lua2c to work with Mochalua, for example. However, see "limitations" (e.g. coroutines). [1] http://lua-users.org/wiki/LuaImplementations [2] http://lua-users.org/lists/lua-l/2008-11/msg00319.html From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 22:40:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I1eMoP017979; Mon, 17 Aug 2009 22:40:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51762192AB; Mon, 17 Aug 2009 22:39:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE13D18C8B for ; Mon, 17 Aug 2009 22:39:49 -0300 (BRT) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090818013948.HXBN6611.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Tue, 18 Aug 2009 02:39:48 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090818013942.CTUL22934.aamtaout04-winn.ispmail.ntl.com@STORE.store> for ; Tue, 18 Aug 2009 02:39:42 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 62911B9E4 for ; Tue, 18 Aug 2009 02:44:20 +0100 (BST) Message-ID: <4A8A0654.3000000@ntlworld.com> Date: Tue, 18 Aug 2009 02:39:32 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> In-Reply-To: <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=A_Tu0p2PN1Z1KlsWZG0A:9 a=7WU7CNvIp-6RJrKej2MA:7 a=FrBkM01wjY-VoNTqp-4DAh3HbLQA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > You can use lua_pushvalue to duplicate the reference to the userdata > on the stack. Then you can save one in the weak table (with the light > userdata key), and do whatever you want with the other one. > char buf[40]; cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); lua_pushvalue(L,-1); lua_pushstring(L,"__cpBody_ptrs"); sprintf(buf,"%ld\0",(long)bb); lua_setfield(L,-2,buf); luaL_getmetatable(L, "cpBody"); lua_setmetatable(L, -2); return bb; what on earth does attempt to index a userdata value mean? Thanks Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 22:52:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I1qdAm019251; Mon, 17 Aug 2009 22:52:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D87C5192B0; Mon, 17 Aug 2009 22:52:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E23E219299 for ; Mon, 17 Aug 2009 22:52:12 -0300 (BRT) Received: by ewy26 with SMTP id 26so3517674ewy.5 for ; Mon, 17 Aug 2009 18:52:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.17.16 with SMTP id 16mr7747853ebq.17.1250560330427; Mon, 17 Aug 2009 18:52:10 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Aug 2009 21:52:10 -0400 X-Google-Sender-Auth: 3d96eb0184c284a8 Message-ID: Subject: Re: package.seeall and strict conflict From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I1qdAm019251 On Mon, Aug 17, 2009 at 4:29 PM, Jim Jennings wrote: > On Thu, 13 Aug 2009 00:59:40 -0400, David Manura wrote: >> Let some module A in a program do require "strict" and some other >> module B in the program do module(..., package.seeall).  Now, strict >> behavior is applied to the implementation of B.  This may be desirable >> or it might not be. > > In my opinion, this is *not* desirable.  If A is written using > "strict", then "strict" should apply only to A, and not to modules > that use A. I agree. For example, require "strict" "globals" where require "string" returns a function that when called updates the environment of the caller (e.g. a private environment). > If there is interest, I could find a place to post my implementation. > (On Luaforge?) I'm interested. You may also post a page on the wiki (e.g. if you feel it's not yet ready for LuaForge). > But once you > protect the metatable, you break a useful (and widely used) feature of > Lua, which is the ability to change the metatable of the environment. Though you can still change the environment (e.g. proxy the old environment). > Here's a quick example using Lua Lanes 2.0.3, which I installed > unmodified.  After playing with it, I wrote this declaration [3]: > >> structure.declare { name="lanes"; >                                 open={"_G", "package", "table", "string"}; >                                 environment=[[ require("lanes"); > return lanes ]]; >                               } >> require "lanes" >> dofile "lanes-test.lua" What is the semantics of "open" ? Does this add the listed symbols to the private environment of the lanes module? From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 23:26:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I2QqLl023284; Mon, 17 Aug 2009 23:26:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B830192B8; Mon, 17 Aug 2009 23:26:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9245F19290 for ; Mon, 17 Aug 2009 23:26:20 -0300 (BRT) Received: from OMTA07.westchester.pa.mail.comcast.net ([76.96.62.59]) by QMTA01.westchester.pa.mail.comcast.net with comcast id Vdin1c0021GhbT851eSJdK; Tue, 18 Aug 2009 02:26:18 +0000 Received: from aran.gvhome.net ([98.233.40.96]) by OMTA07.westchester.pa.mail.comcast.net with comcast id VeSG1c00H24UxC23TeSHZT; Tue, 18 Aug 2009 02:26:18 +0000 Received: by aran.gvhome.net (Postfix, from userid 1000) id AC349372A0; Mon, 17 Aug 2009 22:26:15 -0400 (EDT) Date: Mon, 17 Aug 2009 22:26:15 -0400 From: Etan Reisner To: Lua list Subject: Re: Hi and pushing existing UserData from pointer Message-ID: <20090818022615.GH1825@aran> References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8A0654.3000000@ntlworld.com> Jabber-ID: deryni@pidgin.im User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 18, 2009 at 02:39:32AM +0100, Chris Camacho wrote: > >> You can use lua_pushvalue to duplicate the reference to the userdata >> on the stack. Then you can save one in the weak table (with the light >> userdata key), and do whatever you want with the other one. >> > char buf[40]; > cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); > lua_pushvalue(L,-1); > lua_pushstring(L,"__cpBody_ptrs"); > sprintf(buf,"%ld\0",(long)bb); > lua_setfield(L,-2,buf); > > luaL_getmetatable(L, "cpBody"); > lua_setmetatable(L, -2); > return bb; > > what on earth does attempt to index a userdata value mean? > > Thanks > Chris foo = some_function_that_creates_a_userdata() print(foo.bar) It means you tried to index a userdata, in your example you tried to setfield on a userdata, you can't do that by default. In order for that to work the userdata needs to have an __index metamethod. -Etan From lua-bounces@bazar2.conectiva.com.br Mon Aug 17 23:49:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I2nBLp025920; Mon, 17 Aug 2009 23:49:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0DA9192CB; Mon, 17 Aug 2009 23:48:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92599192BE for ; Mon, 17 Aug 2009 23:48:45 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090818024831.ICWV6611.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Tue, 18 Aug 2009 03:48:31 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090818024831.SFQE2093.aamtaout03-winn.ispmail.ntl.com@STORE.store> for ; Tue, 18 Aug 2009 03:48:31 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id B7FEEB9E4 for ; Tue, 18 Aug 2009 03:53:11 +0100 (BST) Message-ID: <4A8A1678.6010701@ntlworld.com> Date: Tue, 18 Aug 2009 03:48:24 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> <20090818022615.GH1825@aran> In-Reply-To: <20090818022615.GH1825@aran> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=4qR9ixwGKCpUXVDVni4A:9 a=IuJqwbON840Si1s73WEA:7 a=bFaHHUcP0nrAViywmiE0xJNtY4sA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > It means you tried to index a userdata, in your example you tried to > setfield on a userdata, you can't do that by default. In order for that to > work the userdata needs to have an __index metamethod. > > -Etan > it does have a __index metamethod thats how I can call methods on the userdata, do you mean I need an __index method? if so what should it receive as params and what should it return? Thanks C -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 00:15:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I3FH76029624; Tue, 18 Aug 2009 00:15:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16AAC19239; Tue, 18 Aug 2009 00:14:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f205.google.com (mail-ew0-f205.google.com [209.85.219.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F35C218C30 for ; Tue, 18 Aug 2009 00:14:42 -0300 (BRT) Received: by ewy1 with SMTP id 1so1573139ewy.6 for ; Mon, 17 Aug 2009 20:14:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.135.9 with SMTP id i9mr1986086ebd.65.1250565278449; Mon, 17 Aug 2009 20:14:38 -0700 (PDT) In-Reply-To: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> References: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> Date: Mon, 17 Aug 2009 23:14:38 -0400 X-Google-Sender-Auth: 19a7e856a6b38536 Message-ID: Subject: Re: SVG generation in Lua From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 12, 2009 at 2:13 AM, Asko Kauppi wrote: > The idea is that Lua syntax is a bit nicer to craft than XML, but this also > allows programmatic creation of macro-like objects (functions that create > graphical objects) that can be turned around, copied etc.. SVG has a "uses" > element for that, but this is more easy on the eyes (clearer code). On Sun, Aug 16, 2009 at 4:45 AM, Stuart P. Bentley wrote: > I've also written a modeling framework that works almost exactly like this! .... > (This gets passed to a function "model", which uses as an environment a > table of primitive-generating functions. There's a number of ways to design this [1,2], and some ways can be expressed in terms of wrappers around other ways. I've been tending to settle on Asko's style, which avoids the function and environment (which has undesirable qualities like locals outside the function overriding environment variables and environments complicating static methods of detecting undefined variables [3]). As Asko mentioned, the Lua structure is somewhat like XML, and in that way it can be made to work like pure data provided you don't intersperse other Lua constructs into it (which unfortunately complicates clean round-trip serialization). [1] http://lua-users.org/wiki/LuaDataFormats [2] http://lua-users.org/wiki/TableScope [3] http://lua-users.org/wiki/DetectingUndefinedVariables From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 00:22:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I3Mfst030321; Tue, 18 Aug 2009 00:22:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E1D5192C0; Tue, 18 Aug 2009 00:22:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f205.google.com (mail-ew0-f205.google.com [209.85.219.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2B10191D9 for ; Tue, 18 Aug 2009 00:22:12 -0300 (BRT) Received: by ewy1 with SMTP id 1so1576333ewy.6 for ; Mon, 17 Aug 2009 20:22:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.143.20 with SMTP id q20mr1656672ebd.62.1250565731547; Mon, 17 Aug 2009 20:22:11 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Aug 2009 23:22:11 -0400 X-Google-Sender-Auth: 829844dd05046e44 Message-ID: Subject: Re: Improvements for creating DSL with Lua From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Aug 16, 2009 at 2:06 PM, Alexander Gladysh wrote: > I usually use this idiom in my DSLs: > has "x" { is = 'rw', isa = 'number', default = 0 } or just has.x { is = 'rw', isa = 'number', default = 0 } [1] http://lua-users.org/lists/lua-l/2009-08/msg00357.html From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 01:02:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I42XB9002196; Tue, 18 Aug 2009 01:02:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3176D192CD; Tue, 18 Aug 2009 01:02:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BE79192B5 for ; Tue, 18 Aug 2009 01:02:02 -0300 (BRT) Received: by qyk34 with SMTP id 34so2541736qyk.33 for ; Mon, 17 Aug 2009 21:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:date:to:subject :mime-version:content-transfer-encoding:from:message-id:user-agent; bh=Ejag4Tpy9RtrHdzm7EpgFolpiKnpOiyUJDROv8KstZQ=; b=ftVtYCq31mi/fAd7nUpzolJsSLhKI7vBAqB3td/Z4AIvvI/wAeh42B0bpfVOP/5sxi Til3PbUrIMDMuf7PVlmYdhG5hRSbrNUNwa98zlc5IvsJQr879TEog4ppfMIML+6xzUL2 M2l/ioQaQG4SYZxdhvFnSyKJbKGIEAD0dhvqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:date:to:subject:mime-version:content-transfer-encoding :from:message-id:user-agent; b=fDC8htcOPwDviNlgApt4CJZRWRBfCqpVepK+4ZG2DPbsMcClLvnfmtcYzk8MME8r5b sFGAxhnvNlGBcmTD261s4k4OEUJyBDtKRsQtvsNGVgzH3g7PJBZ2qa0cPIuvb6gzCf4S wf/atkj0WVOhffYFkcbq3d93nm22nzrrlmt6k= Received: by 10.224.15.135 with SMTP id k7mr4966281qaa.31.1250568120389; Mon, 17 Aug 2009 21:02:00 -0700 (PDT) Received: from nodir.fido.uz (PPPoE-9.pool.tshtt.uz [84.54.73.9]) by mx.google.com with ESMTPS id 7sm9489623qwf.47.2009.08.17.21.01.58 (version=SSLv3 cipher=RC4-MD5); Mon, 17 Aug 2009 21:01:59 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Date: Tue, 18 Aug 2009 09:05:29 +0500 To: lua@bazar2.conectiva.com.br Subject: Re: Java wrapper for LuaJIT? MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Nodir Message-ID: User-Agent: Opera Mail/10.00 (Win32) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Another option: https://pnuts.dev.java.net/ Pnuts is a script language for Java environment. - Simple and clean syntax - Dynamic/static translation to JVM bytecode - One of the fastest scripting language implementations on JVM ... From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 02:43:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I5hKh6011571; Tue, 18 Aug 2009 02:43:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71615192DB; Tue, 18 Aug 2009 02:42:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34D3F192D2 for ; Tue, 18 Aug 2009 02:42:33 -0300 (BRT) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090818054231.DTKE6742.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Tue, 18 Aug 2009 06:42:31 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090818054231.DIGW22934.aamtaout04-winn.ispmail.ntl.com@STORE.store> for ; Tue, 18 Aug 2009 06:42:31 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 1C601B9E4 for ; Tue, 18 Aug 2009 06:47:08 +0100 (BST) Message-ID: <4A8A3F3E.2000109@ntlworld.com> Date: Tue, 18 Aug 2009 06:42:22 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: SVG generation in Lua References: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=AjNtXHXTAAAA:8 a=yZgfmuCkIKNZmrzXTRUA:9 a=DkYinoqmiJqrMr5gtrcA:7 a=VuUeIGHGXEf6e_7TXNVxbptj3u0A:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just a though cairo is wrapped for Lua and can render to svg Its a clean easy to use C api with the graphics functions working a bit like a logo turtle Could make of an easy to implement low level part of what you are trying for... Best C David Manura wrote: > On Wed, Aug 12, 2009 at 2:13 AM, Asko Kauppi wrote: > >> The idea is that Lua syntax is a bit nicer to craft than XML, but this also >> allows programmatic creation of macro-like objects (functions that create >> graphical objects) that can be turned around, copied etc.. SVG has a "uses" >> element for that, but this is more easy on the eyes (clearer code). >> > > On Sun, Aug 16, 2009 at 4:45 AM, Stuart P. Bentley wrote: > >> I've also written a modeling framework that works almost exactly like this! .... >> (This gets passed to a function "model", which uses as an environment a >> table of primitive-generating functions. >> > > There's a number of ways to design this [1,2], and some ways can be > expressed in terms of wrappers around other ways. I've been tending > to settle on Asko's style, which avoids the function and environment > (which has undesirable qualities like locals outside the function > overriding environment variables and environments complicating static > methods of detecting undefined variables [3]). As Asko mentioned, the > Lua structure is somewhat like XML, and in that way it can be made to > work like pure data provided you don't intersperse other Lua > constructs into it (which unfortunately complicates clean round-trip > serialization). > > [1] http://lua-users.org/wiki/LuaDataFormats > [2] http://lua-users.org/wiki/TableScope > [3] http://lua-users.org/wiki/DetectingUndefinedVariables > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 03:06:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I66mfF013886; Tue, 18 Aug 2009 03:06:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BDCD192DE; Tue, 18 Aug 2009 03:06:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DCFC192A5 for ; Tue, 18 Aug 2009 03:06:23 -0300 (BRT) Received: by bwz10 with SMTP id 10so2938596bwz.5 for ; Mon, 17 Aug 2009 23:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=n1pEmK8sK3tylGQcJNh9kXRp9WjbP+xXbxEUmBgNFm8=; b=r9HV4xZaH6q+BY0alPrJtI0cCjOMNqIemnog7cBBOFujwksLhF2K8/vFPFeXfhrJEy 4WS/DhaT9LWGbpkmu+mFm98EVZh/HSLsxK0x+MRpQxsvh0JrS0BFfdaLUkwOBTzlDPkL 6SVq4aPQIzuAlBJTrsHV+ASymvqtsZ+04sDf0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ppr2TFWq8A4MktH3XwcsBkGd8AtRAieAJtwsLBywdrJ1jz05dyEbPtj2E0Y5FapBm1 Q8wHkmO2yb1ZZvnuRLgZIV/M2HnchEv8rdQbauUjXz51IyMefNrfoJge8EEMEEiSJJBm Mo36pD6cryuAyURVh7s/AAx2pkqw/BHxmuzeQ= MIME-Version: 1.0 Received: by 10.239.145.2 with SMTP id q2mr358676hba.123.1250575581607; Mon, 17 Aug 2009 23:06:21 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Aug 2009 08:06:21 +0200 Message-ID: <560972290908172306x41453167yf7a1c2b467735eed@mail.gmail.com> Subject: Re: Improvements for creating DSL with Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I66mfF013886 On Tue, Aug 18, 2009 at 5:22 AM, David Manura wrote: >  has.x { is = 'rw', isa = 'number', default = 0 } > Yes, that's a good example of Lua being used creatively. If there is a default, then usually 'isa' can be easily auto-detected; there can be a default for 'is' as well. Can then have the default notation: has.x (0) From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 04:05:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I75muV020920; Tue, 18 Aug 2009 04:05:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8C04192DD; Tue, 18 Aug 2009 04:05:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 021DD192C6 for ; Tue, 18 Aug 2009 04:04:59 -0300 (BRT) Received: by fxm27 with SMTP id 27so2853250fxm.35 for ; Tue, 18 Aug 2009 00:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ng3DE1GYYZHxt9lJ76+Wi1xtfqwrWTnz3LaOn5fmOq0=; b=vuXEk3CHPlx8hx/1KquqAILy9869x0xVq8Z5k0YzjQQyZwaPjWYC5bMbQMXDFzJUSF a/K72dSAUeftWcXLt1DKw14JAbNcutkXaYgWoOxgm29CB7sX47aKhv4LFT/qBVIH6Jrh DT6qfS5z/8zyIkEqNa7wcR4UKt+E3nCYeBxHQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lj1Rxgox51CMr7mmr4VH0UkJs0VfsnfPnWZRU1xvoGpeG7+R+HfpB4CZK1wrckvX7G aLRDTsHhuqQJx/J2HoumV+ZHAMY8u7pwDZfYM3RvDpxPLDPRkN0AJMfUaL6VAEOzp3pN vT+s8YjR6ZDuKvl/XARjaE1siGuiJCIc+e5NM= MIME-Version: 1.0 Received: by 10.239.145.2 with SMTP id q2mr362783hba.123.1250579095965; Tue, 18 Aug 2009 00:04:55 -0700 (PDT) In-Reply-To: <20090817215536.GB1411@magritte.tecgraf.puc-rio.br> References: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> <20090817215536.GB1411@magritte.tecgraf.puc-rio.br> Date: Tue, 18 Aug 2009 09:04:55 +0200 Message-ID: <560972290908180004r72f50ea3lb776ce1546c1be65@mail.gmail.com> Subject: Re: building lua 5.1.4 as a shared lib on os x and intel x86_64 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7I75muV020920 On Mon, Aug 17, 2009 at 11:55 PM, Luiz Henrique de Figueiredo wrote: >        cc -shared -o liblua.so *.o You need a special incantation for OS X http://blog.yimingliu.com/2008/01/23/building-dynamic-library-on-os-x/ Why they don't just define -shared to mean this? History, I guess. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 06:03:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I93cF2000510; Tue, 18 Aug 2009 06:03:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E019C18C89; Tue, 18 Aug 2009 06:03:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7AE818BFD for ; Tue, 18 Aug 2009 06:03:01 -0300 (BRT) Received: by ewy26 with SMTP id 26so3712550ewy.5 for ; Tue, 18 Aug 2009 02:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=2mlYO7MeIMQOCwCkxySpPJkrhFZ78Sf/2sw124Yzh3s=; b=byATZBshrfOTgnR9Gwpi5I2WRb/Ffw3w2UzjRUr12lLG+9KosybF+Of6YnOoeZJzlL guUr4HVC8gGxutobA2paRguQ3NI6u3rPvRcSXI6IQbrD2tWwqC9tyeSW5GD54fyrabBr lGPX151oAqn9xrEO9iZLrNZA47/AkFDbB30YM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=iErhrl419jvryvVjabLqlvvNLdjI3w1R7kwIHh23L16fIMS3uInriSp/5C9WIb1lje xUGyBbkIvbu3JT4JXMrgo13mhg2fUVYOmejvoj820x0GbhutKFp6ZU4rnZfBSENjpnQL REv6rxF8CyrvXpFTBRbqb2iCzAmu2RGVKviNI= MIME-Version: 1.0 Received: by 10.216.53.199 with SMTP id g49mr1162156wec.49.1250586180200; Tue, 18 Aug 2009 02:03:00 -0700 (PDT) In-Reply-To: <4A8A0654.3000000@ntlworld.com> References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> From: Jerome Vuarand Date: Tue, 18 Aug 2009 11:02:40 +0200 Message-ID: <89d273ba0908180202l2b89b1dfv94ad4dd507800dcb@mail.gmail.com> Subject: Re: Hi and pushing existing UserData from pointer To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/18 Chris Camacho : >> You can use lua_pushvalue to duplicate the reference to the userdata >> on the stack. Then you can save one in the weak table (with the light >> userdata key), and do whatever you want with the other one. > > char buf[40]; > cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); > lua_pushvalue(L,-1); > lua_pushstring(L,"__cpBody_ptrs"); > sprintf(buf,"%ld\0",(long)bb); > lua_setfield(L,-2,buf); > > luaL_getmetatable(L, "cpBody"); > lua_setmetatable(L, -2); > return bb; > > what on earth does attempt to index a userdata value mean? You're calling lua_setfield (which is an indexing operation), with the parameter -2 pointing to the stack slot where you created the 'bb' userdata. Since that userdata has no metatable the indexing operation fails. I don't know if that lua_pushvalue call is supposed to reflect the previous advices I gave you, but if it is you are clearly misusing it. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 06:08:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7I984SB000875; Tue, 18 Aug 2009 06:08:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FE51192AC; Tue, 18 Aug 2009 06:07:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC0FC192A7 for ; Tue, 18 Aug 2009 06:07:33 -0300 (BRT) Received: by ewy26 with SMTP id 26so3715831ewy.5 for ; Tue, 18 Aug 2009 02:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Gr7+5dUk8uQJsIHl9wo2Rc3AtjpFYJ2U5UwAJ34VZ9A=; b=jjpDnnR3KkhX20K03rFcITkTzdhkiWShOfImJGsC+Pr+LI0BudQdx9fui96GbgBxjm OPZTPa43ZGJpFhig8WPqoFpnv2GuOc+O/6I0YuMYwwJlNtZytoa7ogvv/jfyIZnQMsTw swRYjq5fIYSIGSEymKl3zLO/Ehg5aTjq57POs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=SLrlLwOrfS36DGJ60ptC2TJDExZ+bNjK6y7orO+QF0nq5cVHe4o6R51lac6PmSF2s8 cM1a7Tiq3R1TnUGaCsrjoQe7XtSVOypNuPdVRWIdyiZZKVKZTR1wPhSxRUELirHpMIk+ kj7wB3OcRI7s1e7sx/M7oscK1b8Fo2QNeuv7k= MIME-Version: 1.0 Received: by 10.216.53.196 with SMTP id g46mr1193705wec.63.1250586452122; Tue, 18 Aug 2009 02:07:32 -0700 (PDT) In-Reply-To: <33196254-020E-4A36-8FCE-50575F737A74@gmail.com> References: <560972290908120611g14216acek4a78b95da4f6e6c6@mail.gmail.com> <4A82CE3A.8020007@elbitsystems-us.com> <203AF7F9-2728-4AF2-A6F8-71C42B90035C@gmail.com> <33196254-020E-4A36-8FCE-50575F737A74@gmail.com> From: Jerome Vuarand Date: Tue, 18 Aug 2009 11:07:12 +0200 Message-ID: <89d273ba0908180207x776d0472h2df47e6d8975c49b@mail.gmail.com> Subject: Re: ... as an "expand list" unary postfix operator To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/14 Doug Currie : > > On Aug 14, 2009, at 12:00 AM, David Manura wrote: > >> One of the prototypical problems in [1] was to implement a function this: >> >> --Wraps a function with trace statements. >> function trace(f) >> return function(...) >> print("begin", f) >> local result = tuple(f(...)) >> print("end", f) >> return result() >> end >> end >> >> Could we add new keywords that correspond with the TUPLE/DETUPLE >> opcodes to achieve something like the above? >> >> [1] http://lua-users.org/wiki/VarargTheSecondClassCitizen > > > Would this work? > > function trace (f) > return function(...) > print("begin", f) > local function vals(...) > print("end", f) > return(...) > end > vals(f(...)...) > end > end You don't need the patch in that situation, since f(...) is the last parameter of the call to vals, and therefore the result list is not truncated. This works perfectly: function trace (f) return function(...) print("begin", f) local function vals(...) print("end", f) return ... end return vals(f(...)) end end From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 07:05:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IA5MxW007302; Tue, 18 Aug 2009 07:05:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50E2F19109; Tue, 18 Aug 2009 07:04:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E83FF18E7A for ; Tue, 18 Aug 2009 07:04:49 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IA4m6G007257 for ; Tue, 18 Aug 2009 07:04:48 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7IA4kP13756; Tue, 18 Aug 2009 07:04:46 -0300 Date: Tue, 18 Aug 2009 07:04:45 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: building lua 5.1.4 as a shared lib on os x and intel x86_64 Message-ID: <20090818070445.A13743@lua.tecgraf.puc-rio.br> References: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> <20090817215536.GB1411@magritte.tecgraf.puc-rio.br> <560972290908180004r72f50ea3lb776ce1546c1be65@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290908180004r72f50ea3lb776ce1546c1be65@mail.gmail.com>; from steve.j.donovan@gmail.com on Tue, Aug 18, 2009 at 09:04:55AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On Mon, Aug 17, 2009 at 11:55 PM, Luiz Henrique de > Figueiredo wrote: > >        cc -shared -o liblua.so *.o > > You need a special incantation for OS X Yes, I'm sorry I misssed that part. I use this for my libraries: env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -o liblua.so *.o > Why they don't just define -shared to mean this? Indeed! From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 09:12:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ICCSsB022765; Tue, 18 Aug 2009 09:12:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA38C192E5; Tue, 18 Aug 2009 09:11:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09754192D2 for ; Tue, 18 Aug 2009 09:11:41 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 6D6B38CB22 for ; Tue, 18 Aug 2009 15:11:37 +0300 (EEST) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A0655368C26; Tue, 18 Aug 2009 15:11:37 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 518F11C6388 for ; Tue, 18 Aug 2009 15:11:32 +0300 (EEST) Message-Id: <3634E025-1846-41BE-9071-9DE41C3496AD@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <4A8A3F3E.2000109@ntlworld.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: SVG generation in Lua Date: Tue, 18 Aug 2009 15:11:31 +0300 References: <13082CCBC7AE4432BABE197A41C6D608@Stucomet> <4A8A3F3E.2000109@ntlworld.com> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The beauty of not needing Cairo or any other library is that Lua can generate SVG just by itself. We will be using both clean-generated SVG (vector graphics) but also Cairo for bitmap output. -asko Chris Camacho kirjoitti 18.8.2009 kello 8:42: > Just a though cairo is wrapped for Lua and can render to svg > > Its a clean easy to use C api with the graphics functions working > a bit like a logo turtle > > Could make of an easy to implement low level part of what you > are trying for... > > Best > C > > David Manura wrote: >> On Wed, Aug 12, 2009 at 2:13 AM, Asko Kauppi wrote: >> >>> The idea is that Lua syntax is a bit nicer to craft than XML, but >>> this also >>> allows programmatic creation of macro-like objects (functions that >>> create >>> graphical objects) that can be turned around, copied etc.. SVG has >>> a "uses" >>> element for that, but this is more easy on the eyes (clearer code). >>> >> >> On Sun, Aug 16, 2009 at 4:45 AM, Stuart P. Bentley wrote: >> >>> I've also written a modeling framework that works almost exactly >>> like this! .... >>> (This gets passed to a function "model", which uses as an >>> environment a >>> table of primitive-generating functions. >>> >> >> There's a number of ways to design this [1,2], and some ways can be >> expressed in terms of wrappers around other ways. I've been tending >> to settle on Asko's style, which avoids the function and environment >> (which has undesirable qualities like locals outside the function >> overriding environment variables and environments complicating static >> methods of detecting undefined variables [3]). As Asko mentioned, >> the >> Lua structure is somewhat like XML, and in that way it can be made to >> work like pure data provided you don't intersperse other Lua >> constructs into it (which unfortunately complicates clean round-trip >> serialization). >> >> [1] http://lua-users.org/wiki/LuaDataFormats >> [2] http://lua-users.org/wiki/TableScope >> [3] http://lua-users.org/wiki/DetectingUndefinedVariables >> > > > -- > Disclaimer: > By sending an email to ANY of my addresses you are agreeing that: > > 1. I am by definition, "the intended recipient" > > 2. All information in the email is mine to do with as I see fit and > make such financial profit, political mileage, or good joke as it > lends > itself to. In particular, I may quote it where I please. > > 3. I may take the contents as representing the views of your company. > > 4. This overrides any disclaimer or statement of confidentiality that > may be included on your message. > From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 09:43:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IChEmr027698; Tue, 18 Aug 2009 09:43:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2464D191C9; Tue, 18 Aug 2009 09:42:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D2DA18D35 for ; Tue, 18 Aug 2009 09:42:37 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090818124235.USTD6742.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Tue, 18 Aug 2009 13:42:35 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090818124235.ZHVY2093.aamtaout03-winn.ispmail.ntl.com@STORE.store> for ; Tue, 18 Aug 2009 13:42:35 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 83E33B9E4 for ; Tue, 18 Aug 2009 13:47:15 +0100 (BST) Message-ID: <4A8AA1B6.7010804@ntlworld.com> Date: Tue, 18 Aug 2009 13:42:30 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> <89d273ba0908180202l2b89b1dfv94ad4dd507800dcb@mail.gmail.com> In-Reply-To: <89d273ba0908180202l2b89b1dfv94ad4dd507800dcb@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=NLZqzBF-AAAA:8 a=Gq5EENs7DingEGvPgXYA:9 a=Dr69XUPOGBecctvd9loA:7 a=L0k_i52onx9shjQEhGzHX_5DWY8A:4 a=_dQi-Dcv4p4A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean well I'm totally lost now... cpBody *has* a metatable (__index is used for the methods) I even tried char buf[40]; cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); lua_pushvalue(L,-1); luaL_getmetatable(L, "cpBody"); lua_setmetatable(L, -2); lua_pushstring(L,"__cpBody_ptrs"); sprintf(buf,"%ld\0",(long)bb); lua_setfield(L,-2,buf); luaL_getmetatable(L, "cpBody"); lua_setmetatable(L, -2); return bb; How am I missing your previous advice, are you able to explain in a clearer manner? how else would I index the cpBody* C pointer with the userdata instance in a table called __cpBody_ptrs ? Thanks Chris Jerome Vuarand wrote: > 2009/8/18 Chris Camacho : > >>> You can use lua_pushvalue to duplicate the reference to the userdata >>> on the stack. Then you can save one in the weak table (with the light >>> userdata key), and do whatever you want with the other one. >>> >> char buf[40]; >> cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); >> lua_pushvalue(L,-1); >> lua_pushstring(L,"__cpBody_ptrs"); >> sprintf(buf,"%ld\0",(long)bb); >> lua_setfield(L,-2,buf); >> >> luaL_getmetatable(L, "cpBody"); >> lua_setmetatable(L, -2); >> return bb; >> >> what on earth does attempt to index a userdata value mean? >> > > You're calling lua_setfield (which is an indexing operation), with the > parameter -2 pointing to the stack slot where you created the 'bb' > userdata. Since that userdata has no metatable the indexing operation > fails. > > I don't know if that lua_pushvalue call is supposed to reflect the > previous advices I gave you, but if it is you are clearly misusing it. > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 10:03:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ID2uJr031674; Tue, 18 Aug 2009 10:02:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8D58192E2; Tue, 18 Aug 2009 10:02:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1644192DA for ; Tue, 18 Aug 2009 10:02:23 -0300 (BRT) Received: by bwz10 with SMTP id 10so3243252bwz.5 for ; Tue, 18 Aug 2009 06:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=P8YOTJzQYthiq8zR4cYgI8X73jsJhsKWPigVH2F4DJk=; b=lQBNKSMFMQzvTSPfE0c4HHcHjTNT921JwsC3L780fcNx3bn+Jd23vse7eGt1/ErDJt bJQjm3G9sAJSFtS962nKhheAHWLe1Wg9vfUEFICM5Cwbhh3TsI2leumluW09oyHV3hPo ut1tr1eJmfI5YQ3jK1ArkymQkRRuqd+SIN82I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RP/BzheZtZwUQRw1vml4a+N/AKcUog98ubKb8FiqKAGloCJkRDIfG/YqiKpGvujwjy Z0Qy3vFZpNH7AWNv8gizVQob9K1c/qxMXKN5figmjvjKoBiMvgDOV6E93nzbkjjKAxK/ tAg0KqYl7ZyIG+6pt46Bb4/ChRFXeKRzjEEYM= MIME-Version: 1.0 Received: by 10.239.130.29 with SMTP id 29mr399506hbh.135.1250600540620; Tue, 18 Aug 2009 06:02:20 -0700 (PDT) In-Reply-To: <560972290908172306x41453167yf7a1c2b467735eed@mail.gmail.com> References: <560972290908172306x41453167yf7a1c2b467735eed@mail.gmail.com> Date: Tue, 18 Aug 2009 10:02:20 -0300 Message-ID: Subject: Re: Improvements for creating DSL with Lua From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7ID2uJr031674 I have written a module called schema [1] to help me figure a generic way of declaring DSLs to use with my ORM 'Loft' [2]. I found it an interesting technique to use the index metamethod to capture field names, so I wouldn't have to patch Lua or build a pattern. The thing goes like this: Schema 'default' { Type 'Point' .x : Number{is='rw', default='0'} .y : Number{is='rw', default='0'} ; Type 'Area' .name -- defaults to string .start : Point() .end : Point() ; } Luís Eduardo Jason Santos [1] http://luaforge.net/projects/schema/ [2] http://luaforge.net/projects/loft/ On Tue, Aug 18, 2009 at 3:06 AM, steve donovan wrote: > On Tue, Aug 18, 2009 at 5:22 AM, David Manura wrote: >>  has.x { is = 'rw', isa = 'number', default = 0 } >> > > Yes, that's a good example of Lua being used creatively. > > If there is a default, then usually 'isa' can be easily auto-detected; > there can be a default for 'is' as well. > > Can then have the default notation: > > has.x (0) > From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 10:25:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IDPj9d006815; Tue, 18 Aug 2009 10:25:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6449E192DA; Tue, 18 Aug 2009 10:25:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A70A18E7A for ; Tue, 18 Aug 2009 10:25:13 -0300 (BRT) Received: by ywh26 with SMTP id 26so4747095ywh.5 for ; Tue, 18 Aug 2009 06:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=nEQpCi3kcUXLygY0iIFPp8q4WcjnpY3wInMbOjgQFPY=; b=nMCPwW9AG8E5Nsv1Pm81ifYppB3aKb4ciSujVhu8hL8KfdpJ1sFGPu6EejBnrbEzUm iN4BqvYACSrFe4juyQwAgrQOd7OePWd4yuZr93laL/ydF+Ehj7vc77F/ylELn+Yq7wc0 uQaxPtvQQEn3DKH7nlatJa4O3wWjcp+faZzb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=QRRzDAtHek4/Y7a9G8waIpT5UikTfHSH0dUTTdilBL9hvZ8KcY6/K8IDZFXp6OeV5f Ni6whuGFYCqL/ah96WpP/XNIVro3MVoEnJXCn1PKHLijT9KZvRLWwNBx65V4rNf9bv7G lYFH9jGtV2+tgumK+nKK6hoE6XWLHimy0crPM= MIME-Version: 1.0 Received: by 10.101.9.10 with SMTP id m10mr5454959ani.130.1250601912480; Tue, 18 Aug 2009 06:25:12 -0700 (PDT) In-Reply-To: <560972290908180004r72f50ea3lb776ce1546c1be65@mail.gmail.com> References: <512044650908171151u1bd8433fne88138be819c4773@mail.gmail.com> <20090817215536.GB1411@magritte.tecgraf.puc-rio.br> <560972290908180004r72f50ea3lb776ce1546c1be65@mail.gmail.com> From: "Thomas Harning Jr." Date: Tue, 18 Aug 2009 09:24:52 -0400 Message-ID: Subject: Re: building lua 5.1.4 as a shared lib on os x and intel x86_64 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7IDPj9d006815 On Tue, Aug 18, 2009 at 3:04 AM, steve donovan wrote: > On Mon, Aug 17, 2009 at 11:55 PM, Luiz Henrique de > Figueiredo wrote: >>        cc -shared -o liblua.so *.o > > You need a special incantation for OS X > > http://blog.yimingliu.com/2008/01/23/building-dynamic-library-on-os-x/ > > Why they don't just define -shared to mean this? History, I guess. My best bet is due to the bizarre (to me) two types of libraries available. Dylib and bundle... where dylibs are load-once, never-unload and bundles are IIRR just like linux SOs where they can be loaded/unloaded. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 13:30:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IGTjti022257; Tue, 18 Aug 2009 13:29:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6260919315; Tue, 18 Aug 2009 13:29:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B6301930F for ; Tue, 18 Aug 2009 13:29:06 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so1067463qwi.11 for ; Tue, 18 Aug 2009 09:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=wXgcw8I04rpEzMyS4EQV6OTO+n6FtwLOdzKyIXUhzD8=; b=Vu68f8uZ3w9pdKjwiwY6IOvLm7sVqfgX7m8b6TLxs8SCiw8C7IswlRQRbX9mtF3+lc DP1g9Z4//sIjVqCi5oZCg95BhwNaFXbUtGkh4tc7RhOzkhg9Kiv7a2KtN6I2ERKCD9mU lpgXY73oo+AAl6rSCGbH4U9keXo2K98IBYzZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=vVugdo7AMRTBUaQf2d2ux0ubR6JMsDbt0XDBzurT6FSWNwL8hhjBjJ5avvgAC3j1Cn 9SCZoiYTqVD/ZXlEKdZNcdnRYK8jy4UszuLmzfhWESiGiVbPLlvz+2lie1l8qX1zZhUZ pTlIJEi8HxA/rRoGKqUeXwXr/Sypk4De8tGvw= MIME-Version: 1.0 Received: by 10.224.57.135 with SMTP id c7mr5616499qah.168.1250612945180; Tue, 18 Aug 2009 09:29:05 -0700 (PDT) Date: Tue, 18 Aug 2009 12:29:05 -0400 Message-ID: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> Subject: Pluto 2.4 tests fail on new installation From: David Haley To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Lua, I'm having some trouble getting Pluto to work. I'm on x86_64, gcc 4.3.3, with lua 5.1.4. (Is Pluto known to work on x86_64?) I got the most recent version of Pluto (2.4) here: http://luaforge.net/frs/?group_id=31&release_id=1019 It compiled successfully (there were some warnings about casting between pointers and ints). I ran pptest -- it seemed to work -- but when running puptest, I get the following message: attempt to call a nil value I changed the Makefile CFLAGS to the following: CFLAGS= -g3 -Wall -ansi -pedantic -I/usr/include/lua5.1 -Dlua_assert=assert re-compiled, re-ran and got this: $ ./puptest puptest: pluto.c:1502: unpersist: Assertion `!inreftable(upi->L, ref)' failed. zsh: abort ./puptest Am I doing something wrong? Please let me know if there's any other information I should provide. Cheers, - David p.s. I hope this message comes out in plain-text. I'm using gmail's web interface (normally I use Thunderbird) and I think I told it to send in plain, but we'll see... Sorry if it doesn't. From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 13:34:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IGYVQC023766; Tue, 18 Aug 2009 13:34:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 669D218FCC; Tue, 18 Aug 2009 13:34:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-01.bluehost.com (outbound-mail-01.bluehost.com [69.89.21.11]) by bazar2.conectiva.com.br (Postfix) with SMTP id DEB99189F4 for ; Tue, 18 Aug 2009 13:34:02 -0300 (BRT) Received: (qmail 9924 invoked by uid 0); 18 Aug 2009 16:34:00 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy1.bluehost.com with SMTP; 18 Aug 2009 16:34:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=ZgOagdAgVFJcFaVpA4fTyFGchUPnJ1SfDJEjxAm5YW4hZ1V7NSyODw6RV+IVwnNjtSc0mxu4RkSNdxUh3Ei1dzDvuI5WRxfpo2BFibqKBp2yJDSK5RA2rP1zNAzvi0ut; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MdRdI-0000QL-5P; Tue, 18 Aug 2009 10:34:00 -0600 Date: Tue, 18 Aug 2009 11:33:49 -0500 From: Rob Hoelz To: Lua list Subject: Re: Pluto 2.4 tests fail on new installation Message-ID: <20090818113349.0cd7926e@hoelzro.net> In-Reply-To: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.5; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/K2IUPjkKofKv=kw8f7M3cOk"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/K2IUPjkKofKv=kw8f7M3cOk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 18 Aug 2009 12:29:05 -0400 David Haley wrote: > Hi Lua, >=20 > I'm having some trouble getting Pluto to work. I'm on x86_64, gcc > 4.3.3, with lua 5.1.4. (Is Pluto known to work on x86_64?) >=20 > I got the most recent version of Pluto (2.4) here: > http://luaforge.net/frs/?group_id=3D31&release_id=3D1019 >=20 > It compiled successfully (there were some warnings about casting > between pointers and ints). I ran pptest -- it seemed to work -- but > when running puptest, I get the following message: >=20 > attempt to call a nil value >=20 > I changed the Makefile CFLAGS to the following: > CFLAGS=3D -g3 -Wall -ansi -pedantic -I/usr/include/lua5.1 > -Dlua_assert=3Dassert >=20 > re-compiled, re-ran and got this: >=20 > $ ./puptest > puptest: pluto.c:1502: unpersist: Assertion `!inreftable(upi->L, > ref)' failed. zsh: abort ./puptest >=20 > Am I doing something wrong? Please let me know if there's any other > information I should provide. >=20 > Cheers, > - David >=20 > p.s. I hope this message comes out in plain-text. I'm using gmail's > web interface (normally I use Thunderbird) and I think I told it to > send in plain, but we'll see... Sorry if it doesn't. David- I've had troubles using Pluto on a 64-bit system; if I remember correctly, I found that the string serialization/deserialization routine writes the string size out as an int, and reads it in as a long (or something along those lines), so that it's the same size on a 32-bit system, but not a 64-bit one. If you'd like, I can send you a patched version I made; everything but live coroutine restoration seems to work. -Rob --Sig_/K2IUPjkKofKv=kw8f7M3cOk Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqK1/AACgkQUoGaR6SGEaqAiACeP7/jmJOAYUOe+GTRAI+2FCLi ahsAnjM8iXm27+GTQ5JWAu+womKGuXT7 =iE8J -----END PGP SIGNATURE----- --Sig_/K2IUPjkKofKv=kw8f7M3cOk-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 13:43:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IGhLAA025441; Tue, 18 Aug 2009 13:43:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B35F11931A; Tue, 18 Aug 2009 13:42:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 048F219308 for ; Tue, 18 Aug 2009 13:42:44 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so1070598qwi.11 for ; Tue, 18 Aug 2009 09:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+F5A2fo7JqzJZ9q6ftMBhdVK22hbRKt7w12nGK9gkFw=; b=tAvbH/y5G2ljCWrs/shmUyQRGRhnabdOhnk2e5x7g+gavGn59b3OJN7TgKRDrATfI7 vn6+aWwQAsVckiDhOYM2hMwybDSRrSNI88Lq9vdHbg6ZiUAOUCKnTNqzm/IlBWjHDXbD LTMIHIlIzggQsIlOylWXnxRVgn/9sruw8QBqg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=pzHg/KAxpAZPaFQcVMHO1lzYXJ2kK2mNzW2f33R+pjWZuPcJ4WjpbVAxB+tsDyapSg 53WzLeZprclkqMnJdA0XvNLSQA8bKQnE7O9Mm0Ks3FLJ1NniXJ6Q2UHGhclWsgW+KTOF sbPTpUGxqvdR9YDnhUDwSxKANktpsyX8kYktA= MIME-Version: 1.0 Received: by 10.224.91.74 with SMTP id l10mr5650796qam.241.1250613757897; Tue, 18 Aug 2009 09:42:37 -0700 (PDT) In-Reply-To: <20090818113349.0cd7926e@hoelzro.net> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> <20090818113349.0cd7926e@hoelzro.net> Date: Tue, 18 Aug 2009 12:42:37 -0400 Message-ID: <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> Subject: Re: Pluto 2.4 tests fail on new installation From: David Haley To: Rob Hoelz Content-Type: text/plain; charset=ISO-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7IGhLAA025441 Hi Rob, On Tue, Aug 18, 2009 at 12:33 PM, Rob Hoelz wrote: > On Tue, 18 Aug 2009 12:29:05 -0400 > David Haley wrote: > >> Hi Lua, >> >> I'm having some trouble getting Pluto to work. I'm on x86_64, gcc >> 4.3.3, with lua 5.1.4. (Is Pluto known to work on x86_64?) >> > > I've had troubles using Pluto on a 64-bit system; if I remember > correctly, I found that the string serialization/deserialization routine > writes the string size out as an int, and reads it in as a long (or > something along those lines), so that it's the same size on a 32-bit > system, but not a 64-bit one.  If you'd like, I can send you a patched > version I made; everything but live coroutine restoration seems to work. Ah, so it's a 64-bit problem after all. Does it work out of the box on 32-bit systems? (All the computers I have access to at the moment are 64-bit, so I can't verify this myself presently.) I would be very happy to get a patched version -- I don't need live coroutine restoration (not at the moment, at least). Do you know what it is about live coroutines that don't work? (Normally, Pluto can handle them, right?) Cheers, - David From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 13:56:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IGuqdw028088; Tue, 18 Aug 2009 13:56:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E13191931E; Tue, 18 Aug 2009 13:56:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-40.bluehost.com (outbound-mail-40.bluehost.com [69.89.20.194]) by bazar2.conectiva.com.br (Postfix) with SMTP id 95FDC19290 for ; Tue, 18 Aug 2009 13:56:11 -0300 (BRT) Received: (qmail 6594 invoked by uid 0); 18 Aug 2009 16:56:08 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy2.bluehost.com with SMTP; 18 Aug 2009 16:56:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=TBI0SjLoKF2fW2pc9iQmJRh0aUm3KiW5uCFTgE2DIr8X/ozghs3F56mHYXBFzFg/3H5wqKE9CbevW04XPeCGgsR+4I3d230AyghxCBUgkUT9AcNpxc/9r5lVDLRM52G5; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MdRyh-000356-Pl; Tue, 18 Aug 2009 10:56:07 -0600 Date: Tue, 18 Aug 2009 11:55:57 -0500 From: Rob Hoelz To: David Haley Subject: Re: Pluto 2.4 tests fail on new installation Message-ID: <20090818115557.4bd5c884@hoelzro.net> In-Reply-To: <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> <20090818113349.0cd7926e@hoelzro.net> <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.5; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/qKVpPSKb..Z_60IFSrWWCHw"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/qKVpPSKb..Z_60IFSrWWCHw Content-Type: multipart/mixed; boundary="MP_/A/fdvYv0ANOYpI8MNvAa6C1" --MP_/A/fdvYv0ANOYpI8MNvAa6C1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tue, 18 Aug 2009 12:42:37 -0400 David Haley wrote: > Hi Rob, >=20 > On Tue, Aug 18, 2009 at 12:33 PM, Rob Hoelz wrote: > > On Tue, 18 Aug 2009 12:29:05 -0400 > > David Haley wrote: > > > >> Hi Lua, > >> > >> I'm having some trouble getting Pluto to work. I'm on x86_64, gcc > >> 4.3.3, with lua 5.1.4. (Is Pluto known to work on x86_64?) > >> > > > > I've had troubles using Pluto on a 64-bit system; if I remember > > correctly, I found that the string serialization/deserialization > > routine writes the string size out as an int, and reads it in as a > > long (or something along those lines), so that it's the same size > > on a 32-bit system, but not a 64-bit one. =C2=A0If you'd like, I can > > send you a patched version I made; everything but live coroutine > > restoration seems to work. >=20 > Ah, so it's a 64-bit problem after all. Does it work out of the box on > 32-bit systems? (All the computers I have access to at the moment are > 64-bit, so I can't verify this myself presently.) >=20 > I would be very happy to get a patched version -- I don't need live > coroutine restoration (not at the moment, at least). Do you know what > it is about live coroutines that don't work? (Normally, Pluto can > handle them, right?) >=20 > Cheers, > - David Patch is attached. I've never had a problem with Pluto on a 32-bit system; only this issue with 64-bit string (de)serialization. I've never tried restoring live coroutines on a 32-bit system, though. -Rob --MP_/A/fdvYv0ANOYpI8MNvAa6C1 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=pluto.patch --- ../pluto-pristine/pluto.c 2008-04-15 12:58:16.000000000 -0500 +++ pluto.c 2009-08-18 11:51:49.472726525 -0500 @@ -890,10 +890,10 @@ static void unpersiststring(UnpersistInfo *upi) { /* perms reftbl sptbl ref */ - int length; + size_t length; char* string; lua_checkstack(upi->L, 1); - verify(LIF(Z,read)(&upi->zio, &length, sizeof(int)) =3D=3D 0); + verify(LIF(Z,read)(&upi->zio, &length, sizeof(size_t)) =3D=3D 0); string =3D pdep_newvector(upi->L, length, char); verify(LIF(Z,read)(&upi->zio, string, length) =3D=3D 0); lua_pushlstring(upi->L, string, length); --MP_/A/fdvYv0ANOYpI8MNvAa6C1-- --Sig_/qKVpPSKb..Z_60IFSrWWCHw Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqK3SAACgkQUoGaR6SGEaonpgCgjn16DlcYGYM2TmIryqC8MwOX MWwAoMVNMGt/lNZj8hJCbSpyTuh2jX11 =wSfO -----END PGP SIGNATURE----- --Sig_/qKVpPSKb..Z_60IFSrWWCHw-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 17:41:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7IKfE1O024257; Tue, 18 Aug 2009 17:41:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DFF218E71; Tue, 18 Aug 2009 17:40:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04FAA18D03 for ; Tue, 18 Aug 2009 17:40:32 -0300 (BRT) Received: by ewy26 with SMTP id 26so4265089ewy.5 for ; Tue, 18 Aug 2009 13:40:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.38.5 with SMTP id l5mr4975395ebl.64.1250628030910; Tue, 18 Aug 2009 13:40:30 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Aug 2009 22:40:30 +0200 X-Google-Sender-Auth: 64a7527fd335c092 Message-ID: Subject: Re: [ANN] lua-Coat 0.2.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7IKfE1O024257 2009/8/16 François Perrad : > 2009/8/15 David Manura : >> On Fri, Aug 14, 2009 at 11:02 AM, François Perrad wrote: >>> lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), >>> a Perl module which mimics Moose (http://www.iinteractive.com/moose/), >>> an object system for Perl5 which borrows features from Perl6, >>> CLOS (LISP), Smalltalk and many other languages. >>> ...The homepage is at http://lua-coat.luaforge.net/, >> >> >> That seems to have some traction [3-4]. >> > > Yes, it's a port. > >> In this syntax: >> >>  require 'Coat' >>  class 'Point' >>  has( 'x', { is = 'rw', isa = 'number', default = 0 } ) >>  has( 'y', { is = 'rw', isa = 'number', default = 0 } ) >>  overload( '__tostring', function (self) >>    return '(' .. self:x() .. ', ' .. self:y() .. ')' >>  end ) >>  method( 'draw', function (self) >>    return "drawing " .. self._CLASS .. tostring(self) >>  end ) >> >> the "end )" feels a bit awkward to write for every method in a >> program: it's a statement-level keyword (end) contained inside an >> expression-level ")", which tend not to mix in Lua.  The "end" and ")" >> don't align to their matching start tokens, and the function block has >> less indentation than the "function" keyword.  The original also >> involves quoting identifiers ('draw'). >> > > I agree. The syntax needs improvement. > I wrote small patches (see patch/) which allows a more perlish syntax. > I will send a specific message about them. > >> It could be written in a more luaesque way a follows: >> >>  require 'Coat' >>  class 'Point' >>  has.x = { is = 'rw', isa = 'number', default = 0 } >>  has.y = { is = 'rw', isa = 'number', default = 0 } >>  overload.__tostring = function (self) >>    return '(' .. self.x .. ', ' .. self.y .. ')' >>  end >>  method.draw = function (self) >>    return "drawing " .. self._CLASS .. tostring(self) >>  end >>  -- The above can also be written as such: >>  -- function method.draw(self) >>  --   return "drawing " .. self._CLASS .. tostring(self) >>  -- end >> >> where "has", "overload", and "method" are tables, possibly with >> __newindex metamethods. >> Now, lua-Coat is fully refactored with this syntax. But not yet released, see HEAD on http://github.com/fperrad/lua-Coat/ New comment wellcomed >> I think self.x rather than self:x() tends to be the preferred syntax >> for object properties in Lua.  This requires a proxy table though. >> the attribute setter is : self:x(val) so the attribute getter must be : val = self:x() In fact, self.x is the getter/setter function. François. >> Here's a few initial comments on the source: >> >> >>> module(..., package.seeall) >> >> >> I recommend avoiding package.seeall since it pollutes your external interface: >> >>  require "Coat" >>  print(Coat.math) --> table: 0x100549c8 >> > > Fixed in release 0.2.1 > >> >>> basic_type = type >>> local basic_type = basic_type >>> local function object_type (obj) >>>     local t = basic_type(obj) >>>     if t == 'table' and obj._CLASS then >>>         return obj._CLASS >>>     else >>>         return t >>>     end >>> end >>> _G.type = object_type >> >> >> This breaks type().  Consider: >> > > Fixed in release 0.2.1 > >>  require "Coat" >>  require "someothermodule" >> >> where someothermodule internally applies type to a read-only table: >> >>  local t = setmetatable({x=1}, {__index=function() error'read only' end}) >>  assert(type(t) == 'table') >> >> and now fails. >> >> >>> function _G.class (modname) >> >> >> This can then imply that other modules in your program cannot >> internally use Steve's class.lua module [1].  Consider this: >> > > Yes, there is a conflict between them. > >>  -- b.lua >>  require "class"   -- internally uses class.lua >>  ..... >> >> which in turn is used by this: >> >>  -- a.lua >>  require "Coat" >>  require "b" >>  class "a" -- opps, invokes class.lua not Coat.lua >> >> I've had complaints about the Lua module system in the past [2]. >> >> >>> function _G.class (modname) >>>     checktype('class', 1, modname, 'string') >>>     if _G[modname] then >>>         error("name conflict for module '" .. modname .. "'") >>>     end >> >> >> Is there a way to create anonymous classes? or lexically scoped >> classes?  For example, >> > > No. In fact, class 'Foo' acts like module 'Foo' (with some OO magic). > > My current plan for release 0.3.0 is a support of submodule, > like class 'MyApp.Foo.Bar'. > > Thanks for this great feedback. > > François Perrad > >>  local class = require "Coat" . class >>  local T = >>    class(function() >>      function method.test() print 'test' end >>    end) >>  T():test() --> test >> >> >> [1] http://lua-users.org/wiki/SimpleLuaClasses >> [2] http://lua-users.org/lists/lua-l/2009-08/msg00297.html >> [3] http://www.iinteractive.com/moose/ >> [4] http://search.cpan.org/~drolsky/Moose/lib/Moose/Manual/Unsweetened.pod >> >> > From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 21:37:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7J0bJYA024305; Tue, 18 Aug 2009 21:37:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34FCA18CF4; Tue, 18 Aug 2009 21:36:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from igtmail01.igt.com (igtmail01.igt.com [12.24.60.81]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5341918CA1 for ; Tue, 18 Aug 2009 21:36:39 -0300 (BRT) Received: from RNOEXHTCAS02.is.ad.igt.com ([10.210.11.7]) by mail01 (8.14.3/8.14.3) with ESMTP id n7J0aaXf009502 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 18 Aug 2009 17:36:36 -0700 Received: from RNOMBX01.is.ad.igt.com ([10.210.11.4]) by RNOEXHTCAS02.is.ad.igt.com ([::1]) with mapi; Tue, 18 Aug 2009 17:36:59 -0700 From: "Stern.Jason" To: "'lua@bazar2.conectiva.com.br'" Date: Tue, 18 Aug 2009 17:36:59 -0700 Subject: LuaJIT on QNX Momentics issue Thread-Topic: LuaJIT on QNX Momentics issue Thread-Index: AcogZSmUEGfyl0xNQzyYq+UrrKRPxA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1307-5.600.1016-16834.000 x-tm-as-result: No--38.486300-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-08-18_15:2009-08-11, 2009-08-18, 2009-08-18 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0907200000 definitions=main-0908180200 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7J0bJYA024305 I currently have a cross-platform project running Lua. I tried to implement LuaJIT on it, and was successful in Windows under Visual Studio 8. However, when I try to compile the project in QNX Momentics 4.6, I receive the following error: size of array `check_TVALUE_SIZE_in_ljit_x86_dash_' is too large inc/ljit_x86.h line 367 Looking at the code: /* Check some assumptions. Should compile to nop. */ static int jit_consistency_check(jit_State *J) { do { /* Force a compiler error for inconsistent structure sizes. */ /* Check LUA_TVALUE_ALIGN in luaconf.h, too. */ int check_TVALUE_SIZE_in_ljit_x86_dash[1+16-sizeof(TValue)]; int check_TVALUE_SIZE_in_ljit_x86_dash_[1+sizeof(TValue)-16]; ((void)check_TVALUE_SIZE_in_ljit_x86_dash[0]); ((void)check_TVALUE_SIZE_in_ljit_x86_dash_[0]); if (LUA_TNIL != 0 || LUA_TBOOLEAN != 1 || PCRLUA != 0) break; if ((int)&(((Node *)0)->i_val) != (int)&(((StkId)0)->value)) break; return JIT_S_OK; } while (0); J->dasmstatus = 999999999; /* Recognizable error. */ return JIT_S_COMPILER_ERROR; } ...it clearly looks like this is intentional to prevent some issue. However, I am afraid that I am inexperienced enough to know exactly what would cause this issue and what the recommended way of handling it is. Thank you, Jason Stern From lua-bounces@bazar2.conectiva.com.br Tue Aug 18 22:05:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7J15HEP027631; Tue, 18 Aug 2009 22:05:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1226A191C9; Tue, 18 Aug 2009 22:04:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E803B19183 for ; Tue, 18 Aug 2009 22:04:49 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MdZbc-0005CR-00; Wed, 19 Aug 2009 03:04:48 +0200 Date: Wed, 19 Aug 2009 03:04:39 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT on QNX Momentics issue Message-ID: <20090819010439.GA7519@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stern.Jason wrote: > I currently have a cross-platform project running Lua. I tried to implement LuaJIT on it, and was successful in Windows under Visual Studio 8. However, when I try to compile the project in QNX Momentics 4.6, I receive the following error: > > size of array `check_TVALUE_SIZE_in_ljit_x86_dash_' is too large > inc/ljit_x86.h line 367 This indicates that the size of the TValue structure does not match with the pregenerated DynASM file. It should be 16 bytes, but is probably only 12 on your target platform due to weak alignment for doubles. Apparently the compiler from your toolchain doesn't trigger on the following part of luaconf.h: #if defined(LUA_NUMBER_DOUBLE) && defined(__GNUC__) && \ (defined(__i386) || defined(__i386__)) && !defined(_WIN32) #define LUA_TVALUE_ALIGN __attribute__ ((aligned(8))) #else #define LUA_TVALUE_ALIGN #endif First try to delete the hole #if cruft and only use this line: #define LUA_TVALUE_ALIGN __attribute__ ((aligned(8))) Then recompile everything. If you still get the same error, then your compiler's alignment directives are disabled or broken. The next best workaround is to modify lobject.h: typedef struct lua_TValue { TValuefields; int dummy; /* <--- Insert this line. */ } LUA_TVALUE_ALIGN TValue; Well, if that doesn't help, then I'm out of clues ... --Mike From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 06:32:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7J9WsaW013099; Wed, 19 Aug 2009 06:32:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4F5819290; Wed, 19 Aug 2009 06:32:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB0AC19176 for ; Wed, 19 Aug 2009 06:32:15 -0300 (BRT) Received: by bwz10 with SMTP id 10so3840580bwz.5 for ; Wed, 19 Aug 2009 02:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Ikavv0uYBpjSDU80G32IxyGrHf5dkruoq+p61HtESBM=; b=GxGQlgKyl9YJ5XzjsEEpNLP8wLmtwLFmpX6JwGcm/Ew7WiCib1Hb7U13c/cWdNCGrV 0Dc1G5P1rt00skXlPqL9M7WdiZw2q6Ze/Wn80G+JrpZpCV6Zd6ZI2xRDApUNTiFjFfRI 69jp6rt7qi7/XmyQalj15XEFy3kCIQoHy3isg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=hQlEVOZyOzR+RpMqE65NaMgzczWr/HktZtGcYvVMVQpvcF/c1Coi5ObSp1HieN+asD d9B54Arltj6jmvKDBRVNYNdK1dxPG+tuqiFNg4jff+o8LaQj8NiD5NDCyKlcFb3UU7LW c4F1XVCWuSIZxX39yrK2HY+U9gVXySuQ/B6zw= MIME-Version: 1.0 Received: by 10.204.148.69 with SMTP id o5mr4771805bkv.99.1250674334143; Wed, 19 Aug 2009 02:32:14 -0700 (PDT) In-Reply-To: <4A8AA1B6.7010804@ntlworld.com> References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> <89d273ba0908180202l2b89b1dfv94ad4dd507800dcb@mail.gmail.com> <4A8AA1B6.7010804@ntlworld.com> From: Jerome Vuarand Date: Wed, 19 Aug 2009 11:31:54 +0200 Message-ID: <89d273ba0908190231n7e577ea5h4397745e5d6733b6@mail.gmail.com> Subject: Re: Hi and pushing existing UserData from pointer To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/18 Chris Camacho : > well I'm totally lost now... > > cpBody *has* a metatable (__index is used for the methods) I even tried cpBody has no metatable until you call lua_setmetatable. In your previous email, you were indexing the userdata *before* assigning a metatable to it. > char buf[40]; > cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); > lua_pushvalue(L,-1); > luaL_getmetatable(L, "cpBody"); > lua_setmetatable(L, -2); > > lua_pushstring(L,"__cpBody_ptrs"); > sprintf(buf,"%ld\0",(long)bb); > lua_setfield(L,-2,buf); > > luaL_getmetatable(L, "cpBody"); > lua_setmetatable(L, -2); > return bb; > > > How am I missing your previous advice, are you able to > explain in a clearer manner? The principle was to store a reference to your userdata object (keep in mind that all stack slots and table fields are merely references) inside a weak table. In the example above there is no such weak table. The principle was also to use the userdata address as a key, in the form of a "light userdata" (which is a different Lua data type from "userdata", cf. the manual), not as a string. > how else would I index the cpBody* C pointer with the userdata instance > in a table called __cpBody_ptrs ? Assuming __cpBody_ptrs is a global table with weak values (ask if you don't know how to create it), you're clearly not using the Lua C API correctly to put stuff in it. You seam to be using lua_pushstring alone to get the global variable __cpBody_ptrs. To get a global variable either use lua_getglobal, or lua_pushstring along with lua_gettable. Here is how to do it: /* create the userdata */ cpBody *bb = (cpBody *)lua_newuserdata(L, sizeof(cpBody)); /* set the metatable */ luaL_getmetatable(L, "cpBody"); lua_setmetatable(L, -2); /* push the weak table name */ lua_pushstring(L,"__cpBody_ptrs"); /* retrieve the weak table (I assume it's in the globals) */ lua_gettable(L, LUA_GLOBALSINDEX); /* push the userdata adress as a light userdata, this is the key */ lua_pushlightuserdata(L, (void*)bb); /* push a reference to the full userdata, this is the (weak) value */ lua_pushvalue(L, -3); /* put the lightudata/fulludata pair into __cpBody_ptrs table (which is on the stack) */ lua_settable(L, -3); /* remove __cpBody_ptrs from the stack */ lua_pop(L, 1); /* return bb so it get initialized. keep in mind that here the full udata is still on the stack */ return bb; From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 12:56:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JFuJ2P011881; Wed, 19 Aug 2009 12:56:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E90DB191C9; Wed, 19 Aug 2009 12:55:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E331018FEB for ; Wed, 19 Aug 2009 12:55:38 -0300 (BRT) Received: by bwz10 with SMTP id 10so4067169bwz.5 for ; Wed, 19 Aug 2009 08:55:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.148.76 with SMTP id o12mr5030776bkv.147.1250697335953; Wed, 19 Aug 2009 08:55:35 -0700 (PDT) In-Reply-To: <89d273ba0908170206t79bf5a07xfe0b1a0f56083756@mail.gmail.com> References: <1250429669.6796.8.camel@kymari> <89d273ba0908170206t79bf5a07xfe0b1a0f56083756@mail.gmail.com> Date: Wed, 19 Aug 2009 17:55:35 +0200 X-Google-Sender-Auth: 5b936d79c9e6dda3 Message-ID: Subject: Re: CouchDB for Lua? From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7JFuJ2P011881 On Mon, Aug 17, 2009 at 11:06 AM, Jerome Vuarand wrote: > 2009/8/16 Jan Schütze : >> I would like to try out couchdb with lua. Is there any library, yet? > > AFAIK there is none yet. But you can use LuaSocket [1] for the HTTP > requests, and JSON4Lua [2] to encode and decode request content. > > [1] http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ > [2] http://json.luaforge.net/ If you need a document database, you could also try Tokyo Cabinet with its Tokyo Tyrant server which uses Lua as its UDF language (instead of JS for CouchDB). I am really having fun with it. There is a Lua module to communicate with it: http://github.com/phoenixsol/lua-tokyotyrant The network protocol is easy to understand so you could also write your own. And there is a C library in case you want better performance. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 13:18:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JGIobA016273; Wed, 19 Aug 2009 13:18:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF9C618A61; Wed, 19 Aug 2009 13:18:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C11C18A35 for ; Wed, 19 Aug 2009 13:18:17 -0300 (BRT) Received: by vws32 with SMTP id 32so3843736vws.11 for ; Wed, 19 Aug 2009 09:18:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.82.134 with SMTP id b6mr9194132vcl.9.1250698696237; Wed, 19 Aug 2009 09:18:16 -0700 (PDT) In-Reply-To: References: <1250429669.6796.8.camel@kymari> <89d273ba0908170206t79bf5a07xfe0b1a0f56083756@mail.gmail.com> From: Phoenix Sol Date: Wed, 19 Aug 2009 11:17:56 -0500 Message-ID: <8a25d01b0908190917l465facb1k46725a5578d0bf68@mail.gmail.com> Subject: Re: CouchDB for Lua? To: Lua list Content-Type: multipart/alternative; boundary=001636833c7082a3b6047180fbfc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636833c7082a3b6047180fbfc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > > There is a Lua module > to communicate with it: > http://github.com/phoenixsol/lua-tokyotyrant > [hypnoticSuggestion] Test the module and submit feedback; I command you! [/hypnoticSuggestion] Phoenix Sol --001636833c7082a3b6047180fbfc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
There is a Lua module
to communicate with it:
= http://github.com/phoenixsol/lua-tokyotyrant

= [hypnoticSuggestion]=A0 Test the module and submit feedback; I command you!= =A0 [/hypnoticSuggestion]


Phoenix Sol
--001636833c7082a3b6047180fbfc-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 13:24:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JGOGl1017501; Wed, 19 Aug 2009 13:24:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF53D18FEB; Wed, 19 Aug 2009 13:23:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E6AF18A5B for ; Wed, 19 Aug 2009 13:23:48 -0300 (BRT) Received: by qyk34 with SMTP id 34so3374947qyk.33 for ; Wed, 19 Aug 2009 09:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XpPuTjx/qaJfz/jv89ya2PDMhBRmjHtsIN5keUdTe2Q=; b=VF97femjBu6mfxqFrg6aZ19Qk3QL3+aqgbpbXcJ6vT3LeZ83W7mlH5ZtaOB9UAGGp5 oJdIOe+9gRzpPjX1uEa/w9qJWLfqgOCCL8Y40QZ8dntX2CnfsznoUe3dsyveDjdRsmyE 8vSLsODVW9E4p8b6DXDM7I3JCcgjEoTANOM40= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xkDemhgjNclRlngxg0ITgIF6egbqgBaXnAXqejyAHLV/vjqIRg4MmyNjS0TqN9R8nA 1nf9fG5BNE3fZO0btjx9z3Y6dkB7DKMtsMbREpC09raxLPEyzbJBO6AHACP8yv7PoK/x 1l/Int0MFJgIWyr7fXkLwUruspQ/t2CH1C8LI= MIME-Version: 1.0 Received: by 10.224.102.18 with SMTP id e18mr6607548qao.44.1250699026063; Wed, 19 Aug 2009 09:23:46 -0700 (PDT) In-Reply-To: <20090818115557.4bd5c884@hoelzro.net> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> <20090818113349.0cd7926e@hoelzro.net> <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> <20090818115557.4bd5c884@hoelzro.net> Date: Wed, 19 Aug 2009 12:23:46 -0400 Message-ID: <959c3d590908190923q384ffb93k6275cba86185086a@mail.gmail.com> Subject: Re: Pluto 2.4 tests fail on new installation From: David Haley To: Rob Hoelz Content-Type: text/plain; charset=ISO-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7JGOGl1017501 Hi Rob, On Tue, Aug 18, 2009 at 12:55 PM, Rob Hoelz wrote: > Patch is attached.  I've never had a problem with Pluto on a 32-bit > system; only this issue with 64-bit string (de)serialization.  I've > never tried restoring live coroutines on a 32-bit system, though. Perfect -- it works. Thanks much! Ben Sunshine-Hill: Is there any chance that the patch could be put into the main Pluto distribution? I believe that on a 32-bit system, sizeof(int) == sizeof(size_t) so it won't be a problem there, and it will fix things on 64-bit systems. (Is Pluto still maintained?) Cheers, - David From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 15:49:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JIngtC022359; Wed, 19 Aug 2009 15:49:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8400A18D64; Wed, 19 Aug 2009 15:49:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp118.iad.emailsrvr.com (smtp118.iad.emailsrvr.com [207.97.245.118]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E79D518D02 for ; Wed, 19 Aug 2009 15:48:58 -0300 (BRT) Received: from relay31.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay31.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 74C871B4255 for ; Wed, 19 Aug 2009 14:48:55 -0400 (EDT) Received: by relay31.relay.iad.mlsrvr.com (Authenticated sender: garyb-AT-strata.com) with ESMTPSA id 242101B4243 for ; Wed, 19 Aug 2009 14:48:55 -0400 (EDT) From: Gary Bringhurst Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: LuaJIT 1.1.5 table indexing performance with various key types Date: Wed, 19 Aug 2009 12:48:53 -0600 Message-Id: To: lua@bazar2.conectiva.com.br Mime-Version: 1.0 (Apple Message framework v1075.2) X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I've searched the archives but can't find a post regarding this question. I've been timing table accesses under LuaJIT using various key types in a very simple tight loop. Positive integers are the fastest (of course), while negative integers, tables, and functions used as indices are approximately 33% slower. That's not bad, given that we're using the hashed storage for the table in these cases. But when I test using strings as table keys they time out as over 100% slower, meaning they take twice as long to execute. I've got the code structured to avoid any string operations, so those aren't a part of the timing. This was very surprising to me, because my assumption was that any key would be used in essentially the same way for a lookup. Does anyone know why string keys are so much slower? And does this mean that for maximum performance we'd be better off always using "tab[index]" accesses instead of "tab.name" accesses? Inquiring minds want to know, :-) -gary The test code: > local count = 10000000 > local size = 100000 > > local h = {} > local hi = {} > local t = {} > local ti = {} > > for i = 1, size do > local key = -i -- change the key type we're testing right here. > -- local key = ""..i -- as string > -- local key = {} -- as table > -- local key = function () end -- as function > h[key] = i > hi[i] = key > t[i] = i > ti[i] = i > end > > local random = math.random > local time = os.clock() > local acc = 0 > for i = 1, count do > acc = acc + t[ ti[random(size)] ] > end > printf( "index time is %0.2f\n", os.clock() - time ) > > time = os.clock() > acc = 0 > for i = 1, count do > acc = acc + h[ hi[random(size)] ] > end > printf( "hash time is %0.2f\n", os.clock() - time ) From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 15:55:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JIssV5023903; Wed, 19 Aug 2009 15:54:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E390E18E57; Wed, 19 Aug 2009 15:54:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1C3818CE2 for ; Wed, 19 Aug 2009 15:54:13 -0300 (BRT) Received: by bwz10 with SMTP id 10so4163871bwz.5 for ; Wed, 19 Aug 2009 11:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=p39pE93OOR3NPE1Hu5DUdPIOT3jsO1sF1s7ukyMk284=; b=XAl81h+8hhmgTFGbYMfwHfDBfd0E0d51zgteXjsVL585XH4ZXL8p3F6iI1kbKv53FF hhwuLHspDFAHlt9m57sXrm/NzMWK+GFOhx8LbvmE++d9rvfs7ykprLPqjMu0y6HDVHaL yFxxHqPRfzY2CQME6B9cY/pGPllCTvBvyTodM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=cdbHIPINmJwachLMWv+1N3gL9ctD3q0lhhojuCZ5z5LnXxdB2mHxFgY43Y2FLxWTTW p50/FgP1wAgzdlk+KW70kkj2iEtl/A7xRgs814l7c35UXyDglJ7lW9UQGGLijAcPCGwu EggZttMp4v1tFCdJvfAf9inPu8+WywQieZtFI= MIME-Version: 1.0 Received: by 10.223.6.9 with SMTP id 9mr1822837fax.84.1250708049915; Wed, 19 Aug 2009 11:54:09 -0700 (PDT) In-Reply-To: <0016e68ea0b2d12b5a047182fc3a@google.com> References: <0016e68ea0b2d12b5a047182fc3a@google.com> Date: Wed, 19 Aug 2009 14:54:09 -0400 X-Google-Sender-Auth: 8d945cce00a27fae Message-ID: Subject: Re: package.seeall and strict conflict From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7JIssV5023903 On Mon, 17 Aug 2009 18:50:16 -0300 Luiz Henrique de Figueiredo lhf@tecgraf.puc-rio.br> wrote: > > I conjecture that a couple of small changes to the implementation of > > Lua (not to the language) would allow me to shrink the Darwin code to > > about 500 lines, and also to reduce the run-time space used by the > > private tables of bindings in each structure. > > What changes would that be? Would they be restricted to loadlib.c? Yes, I believe that a change or two to loadlib (systematically applied therein) would eliminate my need to reimplement those functions in Lua. (Let me know if what I need is already possible without changes.) Here's one: loadlib functions refer to LUA_GLOBALSINDEX. In Darwin, there is the notion of the *current* global environment. An example is the Darwin implementation of package.seeall: local function seeall(module) if type(module)~="table" then error("argument to seeall is not a table: "..tostring(module)) end local mt = getmetatable(module) if not mt then mt = {} setmetatable(module, mt) end mt.__index = structure.currentenvironment() -- mt.__index = the current notion of _G end Compare the last line above to the equivalent lines in loadlib.c: lua_pushvalue(L, LUA_GLOBALSINDEX); lua_setfield(L, -2, "__index"); /* mt.__index = _G */ I'd like a way to call the functions in loadlib as if LUA_GLOBALSINDEX were bound to a different table. Not knowing the Lua source well, I don't know how best to achieve this. A similar change is needed to make LUA_REGISTRYINDEX._LOADED point to the package.loaded table of the current environment, because each structure has its own package table which reflects the set of Darwin structures and Lua modules that are open in that structure. Digression_involving_read_only_tables = [[ An entirely different kind of change would make Darwin more space-efficient at run-time. Today, when you open a structure S, Darwin makes you a copy of the bindings exported by S. Instead, I would prefer to somehow link your environment to a single immutable table containing the bindings exported by S. Certainly, I could use the __index metamethod of _G (or a table in _G) to establish the link. The obstacle is that the binding table of S needs to be read-only. Using metamethods to make S immutable is how my first implementation worked. But I *really* want to allow easy re-use of existing code, and techniques like "strict" rely on being able to modify the metatable of their environment (_G for "strict" and a module's table for Lua modules). I know that read-only tables is a topic that people like to write about (ironic, eh?), so I won't pursue this (much) further. If I were contemplating such a feature, I would be tempted to pattern it after __metatable, such that getmetatable(S).__readonly=true would cause any attempt to write into S to throw an error (even rawset). The readonly state could be revoked by unsetting __readonly. Locking the metatable would, of course, prevent such a change, giving a truly immutable table and metatable. ]] On Mon, 17 Aug 2009 21:52:10 -0400 David Manura dm.lua@math2.org> wrote: > > If there is interest, I could find a place to post my implementation. > > I'm interested.  You may also post a page on the wiki (e.g. if you feel it's not yet ready for LuaForge). Good idea. I'll make a page with some doc and examples and another page for the code. When it's up, I'll post the link here on the mailing list. Possibly this weekend. > What is the semantics of "open" ?  Does this add the listed symbols to the private environment of the lanes module? Yes. In a structure declaration, the 'open' clause lists the structures that Darwin should open after creating a new (empty) environment for the declared structure. After processing all the declaration clauses, the 'environment' clause is evaluated to produce the final environment. In order to facilitate interactive development, Darwin creates a structure called "structure" containing useful run-time operations including these: open(modname, ...) -- open each modname in the current environment close(modname) -- close modname and delete its bindings from the current environment delete(modname) -- delete the declaration for modname (future attempts to open modname will fail) declared() -- return a table of declared structures in the system (like package.loaders) By default, "open" puts the bindings in a table named after the module, just like Lua's module function does. But you can add a 'location' clause in your structure declaration that specifies another place. (The special location "." means "at top level in the global environment".) That way it's easy to achieve some common cases, such as when you have more than one implementation of a module. E.g. suppose you want to reuse some code that uses the "os" package, but you want to intercept calls to certain os functions so that you can enforce certain conditions, e.g. a white list of executables for os.execute(). You can write your own implementation of the "os" functions which mostly just reuses the existing "os" module. If you name your structure "protectedOS", then you can put location="os" in the declaration and Darwin will put your functions (date, execute, etc.) in a table called "os". Code that needs "os" will get your functions, which enforce your conditions. Also, you can convert an arbitrary file of code that litters the global environment into a structure that puts those bindings neatly into a table (or into a mix of some top-level bindings and some in a table, as you wish). --Jim From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 16:01:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JJ1Q7j025702; Wed, 19 Aug 2009 16:01:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08A3618EDB; Wed, 19 Aug 2009 16:00:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 339C318B15 for ; Wed, 19 Aug 2009 16:00:50 -0300 (BRT) Received: by ywh26 with SMTP id 26so6010037ywh.5 for ; Wed, 19 Aug 2009 12:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=uM3zJfJYslwOsBKdX/XIQQr7G77LBWmc8s2czbh7090=; b=QOKorPiXYSHCbNdiWESYXG6HYU2IrvG7HgVALf7waU61rgi3KPuQ7yH20frELCqdo3 lmoBeA3nfv9CY3G+yFOUDHaLD/VIOrYRdPvBAdjGdvFHQeCz2DQLTtK3cDiv3gvRlOVD ixhXoTj5t8KThNHKojCEXHVT2tFc4c3rfEM4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=X3dx6f7HpzQyCGWz8JPqVTYEgtpigMQSRyT5i+K+L3lRAy0qwD2353fEbi1v+uUtqg TBCuUWOzRN6IWslfoDOqu6dh43n/GIlyA7LifuGTmL6Av/7rVb0T7nrLD/FDGjlWPui7 /uqHM7xZpdoVSpt2TSuH0pbzgxCHog4Bkfr9I= MIME-Version: 1.0 Received: by 10.151.24.17 with SMTP id b17mr11004461ybj.172.1250708449305; Wed, 19 Aug 2009 12:00:49 -0700 (PDT) In-Reply-To: <959c3d590908190923q384ffb93k6275cba86185086a@mail.gmail.com> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> <20090818113349.0cd7926e@hoelzro.net> <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> <20090818115557.4bd5c884@hoelzro.net> <959c3d590908190923q384ffb93k6275cba86185086a@mail.gmail.com> Date: Wed, 19 Aug 2009 15:00:49 -0400 Message-ID: <411299900908191200j3bb5f874qf7a2eca21e2c6f10@mail.gmail.com> Subject: Re: Pluto 2.4 tests fail on new installation From: Ben Sunshine-Hill To: Lua list Content-Type: multipart/alternative; boundary=000e0cd23ff2d6a6420471834099 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd23ff2d6a6420471834099 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yeah, I've been meaning to put out a new version, but was blocked on an overhaul of the dependencies system that I reeeally didn't want to do. It's still maintained, though I don't have much time for it these days -- if someone wanted to take over maintenance, I wouldn't say no. On Wed, Aug 19, 2009 at 12:23 PM, David Haley wrote: > Hi Rob, > > On Tue, Aug 18, 2009 at 12:55 PM, Rob Hoelz wrote: > > Patch is attached. I've never had a problem with Pluto on a 32-bit > > system; only this issue with 64-bit string (de)serialization. I've > > never tried restoring live coroutines on a 32-bit system, though. > > Perfect -- it works. Thanks much! > > Ben Sunshine-Hill: Is there any chance that the patch could be put > into the main Pluto distribution? I believe that on a 32-bit system, > sizeof(int) == sizeof(size_t) so it won't be a problem there, and it > will fix things on 64-bit systems. (Is Pluto still maintained?) > > > Cheers, > - David > --000e0cd23ff2d6a6420471834099 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yeah, I've been meaning to put out a new version, but was blocked on an= overhaul of the dependencies system that I reeeally didn't want to do.= It's still maintained, though I don't have much time for it these = days -- if someone wanted to take over maintenance, I wouldn't say no.<= br>
On Wed, Aug 19, 2009 at 12:23 PM, David Hale= y <dchaley@gmail.= com> wrote:
Hi Rob,

On Tue, Aug 18, 2009 at 12:55 PM, Rob Hoelz<rob@hoelzro.net> wrote:
> Patch is attached. =A0I've never had a problem with Pluto on a 32-= bit
> system; only this issue with 64-bit string (de)serialization. =A0I'= ;ve
> never tried restoring live coroutines on a 32-bit system, though.

Perfect -- it works. Thanks much!

Ben Sunshine-Hill: Is there any chance that the patch could be put
into the main Pluto distribution? I believe that on a 32-bit system,
sizeof(int) =3D=3D sizeof(size_t) so it won't be a problem there, and i= t
will fix things on 64-bit systems. (Is Pluto still maintained?)


Cheers,
- David

--000e0cd23ff2d6a6420471834099-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 16:17:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JJH836029332; Wed, 19 Aug 2009 16:17:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EC8C18FCC; Wed, 19 Aug 2009 16:16:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5384818D1B for ; Wed, 19 Aug 2009 16:16:32 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090819191628.QLGX5579.mtaout03-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Wed, 19 Aug 2009 20:16:28 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090819191628.ZGDP2093.aamtaout03-winn.ispmail.ntl.com@STORE.store> for ; Wed, 19 Aug 2009 20:16:28 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id B08C6B9E4 for ; Wed, 19 Aug 2009 20:21:05 +0100 (BST) Message-ID: <4A8C4F85.1080609@ntlworld.com> Date: Wed, 19 Aug 2009 20:16:21 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Lua list Subject: Re: Hi and pushing existing UserData from pointer References: <1493466630-1250442141-cardhu_decombobulator_blackberry.rim.net-729176389-@bxe1018.bisx.prod.on.blackberry> <4A884066.1010301@ntlworld.com> <89d273ba0908170223l66e2ac7atfaada5c054f8b8ac@mail.gmail.com> <4A89CF4C.9010302@ntlworld.com> <89d273ba0908171509k7c1e3596s1029fa3c498f47e9@mail.gmail.com> <4A8A0654.3000000@ntlworld.com> <89d273ba0908180202l2b89b1dfv94ad4dd507800dcb@mail.gmail.com> <4A8AA1B6.7010804@ntlworld.com> <89d273ba0908190231n7e577ea5h4397745e5d6733b6@mail.gmail.com> In-Reply-To: <89d273ba0908190231n7e577ea5h4397745e5d6733b6@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=gRi77Tzdv6cA:10 a=AR9k92DA5oKIzOkfHKoA:9 a=a9tNB5Jb0kBuCfbnnToA:7 a=UiuAdnXn_ZLo4nPvQigiyb3vXDAA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Here is how to do it: > > I ended up with something different (I'm not using weak ref's as with this particular lib I've decided its more appropriate to "hand back" the object from the lib) static cpBody *push_cpBody (lua_State *L) { cpBody *bb=cpBodyNew(0,0); // initialise later cpBody **pbb = (cpBody **)lua_newuserdata(L, sizeof(cpBody*)); // ptr to ptr *pbb = bb; // Lua is only holding a pointer to the object pointer luaL_getmetatable(L, "cpBody"); lua_setmetatable(L, -2); lua_getglobal(L,"__cpBody_ptrs"); // this table is created when cpBody UD is created lua_pushlightuserdata(L, bb); // table index lua_pushvalue(L,-3); // previously created table of *cpBody pointers to userdata lua_rawset(L, -3); // update the table lua_pop(L,1); // restore stack return bb; } What do you think any obvious bloopers? -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 16:19:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JJJntQ030061; Wed, 19 Aug 2009 16:19:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FBBC1928E; Wed, 19 Aug 2009 16:19:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-308.bluehost.com (outbound-mail-308.bluehost.com [67.222.53.254]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8751519287 for ; Wed, 19 Aug 2009 16:19:10 -0300 (BRT) Received: (qmail 4565 invoked by uid 0); 19 Aug 2009 19:19:06 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy6.bluehost.com with SMTP; 19 Aug 2009 19:19:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=Y+J1X/UXqlP3lFQ/MTqHzIUDgx9FWj3d8whNMQfSqtRH97tBoUP3ylrM1Ek6hOqG/mXBALwRt8viMbuYWxFeYcvnNEGVMhw35/5qMkK5/THYBxWJNNDRxxmYkfP5aKGb; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Mdqga-00030I-W8; Wed, 19 Aug 2009 13:19:06 -0600 Date: Wed, 19 Aug 2009 14:18:54 -0500 From: Rob Hoelz To: Lua list Subject: Re: Pluto 2.4 tests fail on new installation Message-ID: <20090819141854.6ed6c3dd@hoelzro.net> In-Reply-To: <411299900908191200j3bb5f874qf7a2eca21e2c6f10@mail.gmail.com> References: <959c3d590908180929v1f6c9acesc01d0ee7e3627f8@mail.gmail.com> <20090818113349.0cd7926e@hoelzro.net> <959c3d590908180942w7425fd7er4ee48590129ea14e@mail.gmail.com> <20090818115557.4bd5c884@hoelzro.net> <959c3d590908190923q384ffb93k6275cba86185086a@mail.gmail.com> <411299900908191200j3bb5f874qf7a2eca21e2c6f10@mail.gmail.com> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.5; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Ky+vqZD_vAiFOP=NSysPcCQ"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/Ky+vqZD_vAiFOP=NSysPcCQ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 19 Aug 2009 15:00:49 -0400 Ben Sunshine-Hill wrote: > Yeah, I've been meaning to put out a new version, but was blocked on > an overhaul of the dependencies system that I reeeally didn't want to > do. It's still maintained, though I don't have much time for it these > days -- if someone wanted to take over maintenance, I wouldn't say no. >=20 > On Wed, Aug 19, 2009 at 12:23 PM, David Haley > wrote: >=20 > > Hi Rob, > > > > On Tue, Aug 18, 2009 at 12:55 PM, Rob Hoelz wrote: > > > Patch is attached. I've never had a problem with Pluto on a > > > 32-bit system; only this issue with 64-bit string > > > (de)serialization. I've never tried restoring live coroutines on > > > a 32-bit system, though. > > > > Perfect -- it works. Thanks much! > > > > Ben Sunshine-Hill: Is there any chance that the patch could be put > > into the main Pluto distribution? I believe that on a 32-bit system, > > sizeof(int) =3D=3D sizeof(size_t) so it won't be a problem there, and it > > will fix things on 64-bit systems. (Is Pluto still maintained?) > > > > > > Cheers, > > - David > > Ben, if you wouldn't mind sending me notes/TODOs/etc, I can try to adopt Pluto. I intend to use it as a persistence layer for a game I'm writing, so that should keep me on track. =3D) -Rob --Sig_/Ky+vqZD_vAiFOP=NSysPcCQ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqMUCEACgkQUoGaR6SGEapE9gCglqU2i8o73pROcmiDPnhcT4mH NikAnjACTXMRW0cUVwXBSeE5/BTJN2l3 =cFCT -----END PGP SIGNATURE----- --Sig_/Ky+vqZD_vAiFOP=NSysPcCQ-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 16:24:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JJOXlA031187; Wed, 19 Aug 2009 16:24:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FCF01928A; Wed, 19 Aug 2009 16:24:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dptr1988.mooo.com (w160091.wireless.fsr.net [64.126.160.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC5AB18E67 for ; Wed, 19 Aug 2009 16:24:02 -0300 (BRT) Received: from peter-desktop.local (unknown [192.168.1.103]) by dptr1988.mooo.com (Postfix) with ESMTP id 1F31C11453 for ; Wed, 19 Aug 2009 12:23:54 -0700 (PDT) From: Peter To: Lua list Subject: Re: LuaJIT 1.1.5 table indexing performance with various key types Date: Wed, 19 Aug 2009 12:23:52 -0700 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908191223.52912.junk_mail@dptr1988.mooo.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wednesday 19 August 2009 11:48:53 am Gary Bringhurst wrote: > Hi all, > > I've searched the archives but can't find a post regarding this > question. > > I've been timing table accesses under LuaJIT using various key types > in a very simple tight loop. Positive integers are the fastest (of > course), while negative integers, tables, and functions used as > indices are approximately 33% slower. That's not bad, given that > we're using the hashed storage for the table in these cases. > > But when I test using strings as table keys they time out as over 100% > slower, meaning they take twice as long to execute. I've got the code > structured to avoid any string operations, so those aren't a part of > the timing. > > This was very surprising to me, because my assumption was that any key > would be used in essentially the same way for a lookup. Does anyone > know why string keys are so much slower? And does this mean that for > maximum performance we'd be better off always using "tab[index]" > accesses instead of "tab.name" accesses? > > Inquiring minds want to know, :-) > -gary > > Have you taken into account the time taken to create a new string with the 'local key = "" .. i" statement? I'm not sure, but I thought that creating new strings could be expensive. To test indexing performance, you would want to make sure that all of you keys were created outside of the timed loop. Peter From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:15:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKEwAt010821; Wed, 19 Aug 2009 17:14:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C63F318CDB; Wed, 19 Aug 2009 17:14:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 510A918CA2 for ; Wed, 19 Aug 2009 17:14:18 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:4650 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MdrXi-0008BY-Et for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 16:13:58 -0400 Message-ID: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> From: "Michael Newberry" To: "Lua list" Subject: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 13:14:13 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_02BB_01CA20CE.F2A43500" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_02BB_01CA20CE.F2A43500 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there an easy way to create a large string of blanks? Say, 2500 or = more long? I don't want it to involve 2500 reallocations like = concatenation. I'm looking for something short of making a CFunction to = do it. I was trying something like this, but the precision and width are too = long: sFmt =3D string.format( "%%-%d.%ds", nSkip, nSkip ) return string.format( sFmt, " " ) Thanks, Michael ------=_NextPart_000_02BB_01CA20CE.F2A43500 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Is there an easy way to create a large = string of=20 blanks? Say, 2500 or more long? I don't want it to involve = 2500=20 reallocations like concatenation. I'm looking for something short of = making a=20 CFunction to do it.
 
I was trying something like this, but = the precision=20 and width are too long:
 
  sFmt =3D string.format( = "%%-%d.%ds",=20 nSkip, nSkip )
  return string.format( sFmt, " " = )
Thanks,
 
Michael
------=_NextPart_000_02BB_01CA20CE.F2A43500-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:18:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKIedh011820; Wed, 19 Aug 2009 17:18:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7018718E67; Wed, 19 Aug 2009 17:18:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7014418CD2 for ; Wed, 19 Aug 2009 17:18:13 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.1.34] ([85.4.4.213]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KON003CG4DCW860@asmtp015.mac.com> for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 13:18:09 -0700 (PDT) Message-id: <72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com> From: Petite Abeille To: Lua list In-reply-to: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> Subject: Re: Simple way to create a big string of blanks? X-Priority: 3 Date: Wed, 19 Aug 2009 22:17:36 +0200 References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 19, 2009, at 10:14 PM, Michael Newberry wrote: > Is there an easy way to create a large string of blanks? http://www.lua.org/manual/5.1/manual.html#pdf-string.rep From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:20:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKK0ae021599; Wed, 19 Aug 2009 17:20:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC5DD183A4; Wed, 19 Aug 2009 17:19:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 474F218EC5 for ; Wed, 19 Aug 2009 17:19:29 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKJPTI019153 for ; Wed, 19 Aug 2009 17:19:25 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7JKJPf20204; Wed, 19 Aug 2009 17:19:25 -0300 Date: Wed, 19 Aug 2009 17:19:24 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Simple way to create a big string of blanks? Message-ID: <20090819171924.A20197@lua.tecgraf.puc-rio.br> References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE>; from mnewberry@mirametrics.com on Wed, Aug 19, 2009 at 01:14:13PM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Is there an easy way to create a large string of blanks? Say, 2500 or more long? string.rep(" ",2500) From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:23:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKNSUG029577; Wed, 19 Aug 2009 17:23:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 625DF19085; Wed, 19 Aug 2009 17:23:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 838DF18E57 for ; Wed, 19 Aug 2009 17:22:58 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:4867 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mdrg8-0000em-2d for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 16:22:40 -0400 Message-ID: <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 13:22:55 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You mean like string.rep()? No, I'm wanting to avoid concatenations as much as possible. Sure I could do something like make a literal string of 100 and then concetenate 25 of them, but the number of bytes is arbitrary. Michael ----- Original Message ----- From: "Petite Abeille" To: "Lua list" Sent: Wednesday, August 19, 2009 1:17 PM Subject: Re: Simple way to create a big string of blanks? > > On Aug 19, 2009, at 10:14 PM, Michael Newberry wrote: > >> Is there an easy way to create a large string of blanks? > > http://www.lua.org/manual/5.1/manual.html#pdf-string.rep > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:24:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKOF1x031826; Wed, 19 Aug 2009 17:24:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 983D419289; Wed, 19 Aug 2009 17:23:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE4F4191C9 for ; Wed, 19 Aug 2009 17:23:48 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:4868 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mdrgx-0000jI-5l for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 16:23:31 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <20090819171924.A20197@lua.tecgraf.puc-rio.br> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 13:23:46 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean What if n = 50,003 or something? Is it doing 50,002 concatenations? Michael ----- Original Message ----- From: "Luiz Henrique de Figueiredo" To: "Lua list" Sent: Wednesday, August 19, 2009 1:19 PM Subject: Re: Simple way to create a big string of blanks? >> Is there an easy way to create a large string of blanks? Say, 2500 or >> more long? > > string.rep(" ",2500) > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:31:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKVHEl001151; Wed, 19 Aug 2009 17:31:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 747991928D; Wed, 19 Aug 2009 17:30:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A8B418FAA for ; Wed, 19 Aug 2009 17:30:49 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 16so1157509fgg.5 for ; Wed, 19 Aug 2009 13:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=xM9DFmXZY3nijMGVnRJR6eZmf7WT9+WHLKhTgFRf3k8=; b=HOVbRgoOPOm22Rkol21Is9n6XlWSIG9A4nOdyQBvmCzezkL8g7C+jCZEj0NwU83+1F tFK+enX45nhMwDQG8FqLEEfKLDdaELCRSjII/o6vmwAQv7ZFfgODErIPb+EV6KZK5DCt NQVWMPpfvHieX6aKRboQP6AlfABKM/zau3sC8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=MFjZtEIb90VRO0rtVk/6ACbJwYAV2s2ZECIUAUYo/Ddh4PNfPWtIwwg7tJER/WsHDp ETMAdnOcq23C0XknkeF/BSyWixV9oxSt1cyssu8fuPlobwZlO+8xVWR5Xk3FY1C3TRg1 JhFP0y0EUmdEF6WPNg+56IwtGziBf0uXA6t6o= Received: by 10.86.249.22 with SMTP id w22mr4428785fgh.1.1250713847565; Wed, 19 Aug 2009 13:30:47 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id l19sm1217664fgb.12.2009.08.19.13.30.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 13:30:46 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Simple way to create a big string of blanks? X-Priority: 3 Date: Wed, 19 Aug 2009 22:30:15 +0200 References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com> <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 19, 2009, at 10:22 PM, Michael Newberry wrote: > You mean like string.rep()? No, I'm wanting to avoid concatenations > as much as possible. Sure I could do something like make a literal > string of 100 and then concetenate 25 of them, but the number of > bytes is arbitrary. http://www.lua.org/source/5.1/lstrlib.c.html#str_rep From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:39:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKcvBZ002802; Wed, 19 Aug 2009 17:38:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD35A18FF0; Wed, 19 Aug 2009 17:38:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0DF818D31 for ; Wed, 19 Aug 2009 17:38:26 -0300 (BRT) Received: by fxm25 with SMTP id 25so3915211fxm.5 for ; Wed, 19 Aug 2009 13:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:x-priority:date:references:x-mailer; bh=nf0ydutwT8799BwgRvQB3UQBRnHagsMVUjelKsZJ5Mo=; b=YA/q70P76oN9fa8JPP0pkJp/YwKcZCXPq6CgJxGzbooZCoVag0PZieQhx9+uzHrmW1 SyRKg/O0n9+yD9Rd8tdhwYruQvax1SOnzoXSxoowgTQRb/qeHVY/Eh/QOyf5dfXmYV+u pW/C/VEepi0iOy6kCUAHqLic0MhuCPgCHLpts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:x-priority:date :references:x-mailer; b=B8GcYeeJ/Y8Uwmlr2LpRLUY6dPED1C+O5B4YXYlZpdbB/zP+gdfL9GjBkzoL3JzqJy bHmpgaZJugTaRfD6G6rssKzpZ0yWcH859F+s0x8NsN0tgt1qFt9LVZYnOGlpgsOLDkLJ bmJqD0/WUmH8ACjGI1JknLPno1xRx4kUP46vI= Received: by 10.103.67.31 with SMTP id u31mr2734100muk.93.1250714303619; Wed, 19 Aug 2009 13:38:23 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id e8sm1814898muf.36.2009.08.19.13.38.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 13:38:22 -0700 (PDT) Message-Id: <7C238A62-74D3-46CC-976D-8FD3ABCE2642@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Simple way to create a big string of blanks? X-Priority: 3 Date: Wed, 19 Aug 2009 22:37:51 +0200 References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com> <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 19, 2009, at 10:22 PM, Michael Newberry wrote: > Sure I could do something like make a literal string of 100 and then > concetenate 25 of them, but the number of bytes is arbitrary. Out of curiosity, what are you planning to use such a string for? From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:41:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKf32J003262; Wed, 19 Aug 2009 17:41:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5601619293; Wed, 19 Aug 2009 17:40:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1490819290 for ; Wed, 19 Aug 2009 17:40:33 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MdrxP-000659-00; Wed, 19 Aug 2009 22:40:31 +0200 Date: Wed, 19 Aug 2009 22:40:19 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT 1.1.5 table indexing performance with various key types Message-ID: <20090819204019.GA13141@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Gary Bringhurst wrote: > I've been timing table accesses under LuaJIT using various key types in a > very simple tight loop. Positive integers are the fastest (of course), > while negative integers, tables, and functions used as indices are > approximately 33% slower. That's not bad, given that we're using the > hashed storage for the table in these cases. > > But when I test using strings as table keys they time out as over 100% > slower, meaning they take twice as long to execute. I've got the code > structured to avoid any string operations, so those aren't a part of the > timing. Your benchmark is flawed in several ways: - Quite a bit of the runtime is used by calling random(). ==> You're not only measuring what you intended to measure. - The size of the created tables is too large, making this an out-of-cache problem. And to top this off, you are using randomized access for an out-of-cache problem. ==> This is not representative of indexing as used by regular Lua programs. > This was very surprising to me, because my assumption was that any key > would be used in essentially the same way for a lookup. Strings are hashed once when they created. Their hash value is stored in the string object. Other GC objects use pointer hashing, i.e. their address is hashed before every hash lookup. The performance of a hash lookup is mainly dominated by the lookup in the hash table itself. Here we have an out-of-cache problem, so this accounts for several cache line fills. Pointer hashing never dereferences the pointer and never accesses the GC object itself. But string hashes are fetched from the string object, which may add another cache line fill. Cache misses are costly (10-100 cycles). And in this case they are in the dependency chain, so their latency cannot be hidden. The total performance is bound by the performance of the cache misses. And string keys happen to add some more cache misses in this benchmark. You can verify this by running LuaJIT under Valgrind's cachegrind tool. I've subtracted the time for the initial setup and divided the D1 and L2d misses by "count". Here's the number of cache misses per iteration and their estimated cost (10/100 cycles): | D1 L2d | Est. cost of | misses misses | cache misses ---------------+---------------+-------------- string key | 6.26 1.26 | 188.6 cycles non-string key | 3.43 0.97 | 131.2 cycles That's a lot, compared to the few cycles for the hash lookups themselves. And it explains the performance differences you're seeing *in this particular benchmark*. > Does anyone know why string keys are so much slower? Well, they are not. In fact they are slightly faster in practice, because their hash values are precomputed. Method tables are usually tiny compared to other data structures in an application. And there is only a small number of them (one for every class or module you define). This is almost certainly an in-cache problem and interned strings *do* pay off here. > And does this mean that for > maximum performance we'd be better off always using "tab[index]" > accesses instead of "tab.name" accesses? Umm, of course t[1] is faster than t["foo"] because an array access is faster than a hash access. But when it comes to method lookups, the performance difference becomes mostly irrelevant. Also, I'm not sure you'd want to trade this: math.abs(math.sin(x)) - math.abs(math.cos(y)) * math.sqrt(z) for that: _G[1][11](_G[1][3](x)) - _G[1][11](_G[1][4](y)) * _G[1][16](z) Well, probably not ... :-) --Mike From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:41:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKfYcL003404; Wed, 19 Aug 2009 17:41:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AD4F19298; Wed, 19 Aug 2009 17:40:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A808119293 for ; Wed, 19 Aug 2009 17:40:35 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1MdrxQ-0007d0-Vc for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 22:40:33 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1MdrxQ-0004Pv-Gz for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 22:40:32 +0200 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Simple way to create a big string of blanks? References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <20090819171924.A20197@lua.tecgraf.puc-rio.br> Date: Wed, 19 Aug 2009 22:40:32 +0200 In-Reply-To: (Michael Newberry's message of "Wed, 19 Aug 2009 13:23:46 -0700") Message-ID: <873a7n8rlr.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Michael Newberry: > What if n = 50,003 or something? Is it doing 50,002 concatenations? No, apparently not, otherwise it run-time would be unbearable. From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:45:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKjjVB004556; Wed, 19 Aug 2009 17:45:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76C16192A8; Wed, 19 Aug 2009 17:45:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A792A19293 for ; Wed, 19 Aug 2009 17:45:13 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:1317 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mds1f-0003Ap-BH for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 16:44:55 -0400 Message-ID: <7F474CCD7190404996917C03BD53F782@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE><72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com><1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> <7C238A62-74D3-46CC-976D-8FD3ABCE2642@gmail.com> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 13:45:11 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean To blank-pad a file whose format requires it. I realize I could make a CFunction to do this easily, but I'm just wondering if there's a way in pure lua that doesn;t involve zillions of string concatenations. Michael ----- Original Message ----- From: "Petite Abeille" To: "Lua list" Sent: Wednesday, August 19, 2009 1:37 PM Subject: Re: Simple way to create a big string of blanks? > > On Aug 19, 2009, at 10:22 PM, Michael Newberry wrote: > >> Sure I could do something like make a literal string of 100 and then >> concetenate 25 of them, but the number of bytes is arbitrary. > > Out of curiosity, what are you planning to use such a string for? > > > > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 17:47:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JKlpFV005043; Wed, 19 Aug 2009 17:47:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD50E1932F; Wed, 19 Aug 2009 17:47:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B6BC19293 for ; Wed, 19 Aug 2009 17:47:26 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:1318 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mds3o-0003Pp-7z for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 16:47:08 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE><20090819171924.A20197@lua.tecgraf.puc-rio.br> <873a7n8rlr.fsf@mid.deneb.enyo.de> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 13:47:22 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Florian, I actually didn't try using string.rep() because I veered away when I read its documentation that said it "concatenates". So it did not sound like the tool to use. Michael ----- Original Message ----- From: "Florian Weimer" To: Sent: Wednesday, August 19, 2009 1:40 PM Subject: Re: Simple way to create a big string of blanks? >* Michael Newberry: > >> What if n = 50,003 or something? Is it doing 50,002 concatenations? > > No, apparently not, otherwise it run-time would be unbearable. > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 18:04:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JL4T6P008782; Wed, 19 Aug 2009 18:04:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 665E718E57; Wed, 19 Aug 2009 18:03:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp148.iad.emailsrvr.com (smtp148.iad.emailsrvr.com [207.97.245.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6CFF18B91 for ; Wed, 19 Aug 2009 18:03:53 -0300 (BRT) Received: from relay4.r5.iad.mlsrvr.com (localhost [127.0.0.1]) by relay4.r5.iad.mlsrvr.com (SMTP Server) with ESMTP id 00FADC0AB for ; Wed, 19 Aug 2009 17:03:51 -0400 (EDT) Received: by relay4.r5.iad.mlsrvr.com (Authenticated sender: garyb-AT-strata.com) with ESMTPSA id ACD24C0B3 for ; Wed, 19 Aug 2009 17:03:51 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: LuaJIT 1.1.5 table indexing performance with various key types From: Gary Bringhurst In-Reply-To: <20090819204019.GA13141@mike.de> Date: Wed, 19 Aug 2009 15:03:50 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <20090819204019.GA13141@mike.de> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cool. That's a very enlightening answer. Thanks Mike. -gary On Aug 19, 2009, at 2:40 PM, Mike Pall wrote: > Gary Bringhurst wrote: >> I've been timing table accesses under LuaJIT using various key >> types in a >> very simple tight loop. Positive integers are the fastest (of >> course), >> while negative integers, tables, and functions used as indices are >> approximately 33% slower. That's not bad, given that we're using the >> hashed storage for the table in these cases. >> >> But when I test using strings as table keys they time out as over >> 100% >> slower, meaning they take twice as long to execute. I've got the >> code >> structured to avoid any string operations, so those aren't a part >> of the >> timing. > > Your benchmark is flawed in several ways: > > - Quite a bit of the runtime is used by calling random(). > ==> You're not only measuring what you intended to measure. > > - The size of the created tables is too large, making this an > out-of-cache problem. And to top this off, you are using > randomized access for an out-of-cache problem. > ==> This is not representative of indexing as used by regular > Lua programs. > >> This was very surprising to me, because my assumption was that any >> key >> would be used in essentially the same way for a lookup. > > Strings are hashed once when they created. Their hash value is > stored in the string object. Other GC objects use pointer hashing, > i.e. their address is hashed before every hash lookup. > > The performance of a hash lookup is mainly dominated by the lookup > in the hash table itself. Here we have an out-of-cache problem, so > this accounts for several cache line fills. > > Pointer hashing never dereferences the pointer and never accesses > the GC object itself. But string hashes are fetched from the > string object, which may add another cache line fill. > > Cache misses are costly (10-100 cycles). And in this case they are > in the dependency chain, so their latency cannot be hidden. The > total performance is bound by the performance of the cache misses. > And string keys happen to add some more cache misses in this > benchmark. > > You can verify this by running LuaJIT under Valgrind's cachegrind > tool. I've subtracted the time for the initial setup and divided > the D1 and L2d misses by "count". Here's the number of cache > misses per iteration and their estimated cost (10/100 cycles): > > | D1 L2d | Est. cost of > | misses misses | cache misses > ---------------+---------------+-------------- > string key | 6.26 1.26 | 188.6 cycles > non-string key | 3.43 0.97 | 131.2 cycles > > That's a lot, compared to the few cycles for the hash lookups > themselves. And it explains the performance differences you're > seeing *in this particular benchmark*. > >> Does anyone know why string keys are so much slower? > > Well, they are not. In fact they are slightly faster in practice, > because their hash values are precomputed. > > Method tables are usually tiny compared to other data structures > in an application. And there is only a small number of them (one > for every class or module you define). This is almost certainly an > in-cache problem and interned strings *do* pay off here. > >> And does this mean that for >> maximum performance we'd be better off always using "tab[index]" >> accesses instead of "tab.name" accesses? > > Umm, of course t[1] is faster than t["foo"] because an array > access is faster than a hash access. But when it comes to method > lookups, the performance difference becomes mostly irrelevant. > > Also, I'm not sure you'd want to trade this: > math.abs(math.sin(x)) - math.abs(math.cos(y)) * math.sqrt(z) > for that: > _G[1][11](_G[1][3](x)) - _G[1][11](_G[1][4](y)) * _G[1][16](z) > > Well, probably not ... :-) > > --Mike From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:15:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMFo9P021606; Wed, 19 Aug 2009 19:15:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 756E01908D; Wed, 19 Aug 2009 19:15:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FEEB19024 for ; Wed, 19 Aug 2009 19:15:17 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMFFfl021554 for ; Wed, 19 Aug 2009 19:15:16 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7JMFE420451; Wed, 19 Aug 2009 19:15:14 -0300 Date: Wed, 19 Aug 2009 19:15:14 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Simple way to create a big string of blanks? Message-ID: <20090819191513.A20443@lua.tecgraf.puc-rio.br> References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE><20090819171924.A20197@lua.tecgraf.puc-rio.br> <873a7n8rlr.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from mnewberry@mirametrics.com on Wed, Aug 19, 2009 at 01:47:22PM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I actually didn't try using string.rep() because I veered away when I read > its documentation that said it "concatenates". So it did not sound like the > tool to use. What is missing in the docs is the implementation detail that lua_concat is very efficient. From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:20:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMKONs022491; Wed, 19 Aug 2009 19:20:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCB191928A; Wed, 19 Aug 2009 19:20:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 241B3190E0 for ; Wed, 19 Aug 2009 19:19:57 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:2825 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MdtVI-0004Rw-IF for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 18:19:36 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE><20090819171924.A20197@lua.tecgraf.puc-rio.br><873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819191513.A20443@lua.tecgraf.puc-rio.br> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 15:19:53 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Then it would be nice to add that detail! PIL goes into detail about the performance penalty of doing great numbers of concatenations. Thanks, Michael ----- Original Message ----- From: "Luiz Henrique de Figueiredo" To: "Lua list" Sent: Wednesday, August 19, 2009 3:15 PM Subject: Re: Simple way to create a big string of blanks? >> I actually didn't try using string.rep() because I veered away when I >> read >> its documentation that said it "concatenates". So it did not sound like >> the >> tool to use. > > What is missing in the docs is the implementation detail that lua_concat > is very efficient. > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:25:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMPoqb023393; Wed, 19 Aug 2009 19:25:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55BD119298; Wed, 19 Aug 2009 19:25:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CECDD191C9 for ; Wed, 19 Aug 2009 19:25:16 -0300 (BRT) Received: by bwz10 with SMTP id 10so4266032bwz.5 for ; Wed, 19 Aug 2009 15:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6u+sFDMp9o/7EBARj3HZj/yEgpbiOaAkINmUTCFdKSE=; b=ddz0oc8S9PiTtwmw0c7ioWr185vNWnbGHs/WKR7ENUNFnIMBmYPZfuqqNNSLIfh3UU C7QyGfo9tHS5B4crZ05VE13D/MvFSP1gDdi73yvTAfGsGlr84BZssQAWUfrp18mh+bvK bdYDhkyW6E5w1h5CrKz4bHtdkwxaaT0sOS24s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bInt4uFHlGtWN/9a6+PXSdDa/G4/MOeM7YbLuLAwuIH9vOe6S9/u/AIzIIyPcO4Vyz mfAVkCQr6oAVvLUUKexRsC7Y1eQS6ISyHOWukhJaywvHueq+33a6eRa6+U5TTqEJ1l6g qPiF6d3E6zfwMrYvtcthBcvmlNaOGc/3blktk= MIME-Version: 1.0 Received: by 10.204.34.65 with SMTP id k1mr5371075bkd.111.1250720714470; Wed, 19 Aug 2009 15:25:14 -0700 (PDT) In-Reply-To: References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <20090819171924.A20197@lua.tecgraf.puc-rio.br> <873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819191513.A20443@lua.tecgraf.puc-rio.br> Date: Wed, 19 Aug 2009 23:25:14 +0100 Message-ID: <4db9cacb0908191525j7df4a29ao3299ba6ea8329d16@mail.gmail.com> Subject: Re: Simple way to create a big string of blanks? From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Aug 19, 2009 at 11:19 PM, Michael Newberry wrote: > Then it would be nice to add that detail! PIL goes into detail about the > performance penalty of doing great numbers of concatenations. > I think the key here is that concatentation in a loop in Lua is to be discouraged: for i = 1, 100 do a = a .. " " end This is because when you assign a.." " to a, the old string that was in a is discarded. So on each loop iteration you are making a new (longer string) and throwing away the old shorter string. This results in a flurry of allocation/deallocation, which is bad for performance. " ".." ".." ".." " (up to a hundred) however would only create one string, and do one (giant) concatenation. string.rep() does exactly the same as the long sequence above. It allocates as much memory as is needed in sequence, it doesn't keep throwing away old strings. Then it concatenates it all into a single Lua string when it is done. So PiL is right, don't concatentate in a loop, but the length of a concatenation is not a(s much a) concern. Matthew From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:32:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMWUVA024616; Wed, 19 Aug 2009 19:32:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8976719320; Wed, 19 Aug 2009 19:32:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 589A919293 for ; Wed, 19 Aug 2009 19:31:57 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7JMVuLt015586 for ; Wed, 19 Aug 2009 19:31:56 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id BBDD054C11A; Wed, 19 Aug 2009 19:31:56 -0300 (BRT) Date: Wed, 19 Aug 2009 19:31:56 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Simple way to create a big string of blanks? Message-ID: <20090819223156.GE9950@inf.puc-rio.br> References: <873a7n8rlr.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I actually didn't try using string.rep() because I veered away when I > read its documentation that said it "concatenates". So it did not sound > like the tool to use. The manual does not say it "concatenates". It says "Returns a string that is the concatenation of n copies of the string s." There is a subtle (but important) difference. -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:42:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMgEHO026151; Wed, 19 Aug 2009 19:42:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EA1418FC9; Wed, 19 Aug 2009 19:41:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 792EA18CE2 for ; Wed, 19 Aug 2009 19:41:36 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:3005 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1MdtqG-0006Lt-Qo for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 18:41:17 -0400 Message-ID: <418358C259C442D58155CB6F8669FDA5@CAYENNE> From: "Michael Newberry" To: "Lua list" References: <873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819223156.GE9950@inf.puc-rio.br> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 15:41:34 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yes, "subtle". But remember words can be important. Thanks for your help. Michael ----- Original Message ----- From: "Roberto Ierusalimschy" To: "Lua list" Sent: Wednesday, August 19, 2009 3:31 PM Subject: Re: Simple way to create a big string of blanks? >> I actually didn't try using string.rep() because I veered away when I >> read its documentation that said it "concatenates". So it did not sound >> like the tool to use. > > The manual does not say it "concatenates". It says "Returns a string > that is the concatenation of n copies of the string s." There is a subtle > (but important) difference. > > -- Roberto > From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:54:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMsECH027979; Wed, 19 Aug 2009 19:54:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56AAA1928E; Wed, 19 Aug 2009 19:53:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24DA018FEB for ; Wed, 19 Aug 2009 19:53:43 -0300 (BRT) Received: by ewy26 with SMTP id 26so4871606ewy.5 for ; Wed, 19 Aug 2009 15:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=weRblrbYTw/tmWWIN5bsspy21eXZIdWZfD94xNpPuf8=; b=gdPqh/LyD9Zp+qyb6fpvtWXOsvTBVF9ViprIsWcrxvN6qrbwthp+H2iIhuLQV0Bufp HlAiCmMvlbB/afRbqoKXBGbmVS9Qf5dTQiE0TcYrpGbiMiHWQgeazfgpJN/GqmDCb3mv enzhfSZQtcjrt/7lUhZDAvfwck7Yzzj6qPmoY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=shDs4BydELAZpvH45AsLJGhJFLcJ9ElzY64BW5XgMLQun456VmgI1khoKOAHVIkHaW aG/XbIZx/RYRSBOEezQaGfRKGPecmul76/r9AKmblcJUxwzCfg5meCkXFhLWrg9omK5H ikro+opVD0VSM1F2oS5msTP3MtSH9aDERL038= MIME-Version: 1.0 Received: by 10.216.20.74 with SMTP id o52mr1739557weo.147.1250722419834; Wed, 19 Aug 2009 15:53:39 -0700 (PDT) In-Reply-To: <418358C259C442D58155CB6F8669FDA5@CAYENNE> References: <873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819223156.GE9950@inf.puc-rio.br> <418358C259C442D58155CB6F8669FDA5@CAYENNE> Date: Wed, 19 Aug 2009 23:53:39 +0100 Message-ID: Subject: Re: Simple way to create a big string of blanks? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7JMsECH027979 On Wed, Aug 19, 2009 at 11:41 PM, Michael Newberry wrote: > Yes, "subtle". But remember words can be important. > > Thanks for your help. > > Michael In case it comes up for you, table.concat() is another library function that is much more efficient than concatenating large numbers of strings into one big string using the .. operator. And the manual says this about it: "Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep..table[j]. (...)" While it *does* return the equivalent of that, it is more efficient in how it goes about it. (I'm not saying that you should consider table.concat as an option in repeating a single byte, it just seems relevant to a broader understanding of these things.) -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 19:57:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7JMvGZW028275; Wed, 19 Aug 2009 19:57:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9884A192A2; Wed, 19 Aug 2009 19:56:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from navi2.webnethost.net (navi2.webnethost.net [67.227.139.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CEC719169 for ; Wed, 19 Aug 2009 19:56:47 -0300 (BRT) Received: from 75-164-76-223.tcso.qwest.net ([75.164.76.223]:3254 helo=CAYENNE) by navi2.webnethost.net with esmtpa (Exim 4.69) (envelope-from ) id 1Mdu4v-0007c2-Pj for lua@bazar2.conectiva.com.br; Wed, 19 Aug 2009 18:56:26 -0400 Message-ID: From: "Michael Newberry" To: "Lua list" References: <873a7n8rlr.fsf@mid.deneb.enyo.de><20090819223156.GE9950@inf.puc-rio.br><418358C259C442D58155CB6F8669FDA5@CAYENNE> Subject: Re: Simple way to create a big string of blanks? Date: Wed, 19 Aug 2009 15:56:43 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - navi2.webnethost.net X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mirametrics.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks. Yes, I saw that discussion in the blue PIL. Michael ----- Original Message ----- From: "Duncan Cross" To: "Lua list" Sent: Wednesday, August 19, 2009 3:53 PM Subject: Re: Simple way to create a big string of blanks? On Wed, Aug 19, 2009 at 11:41 PM, Michael Newberry wrote: > Yes, "subtle". But remember words can be important. > > Thanks for your help. > > Michael In case it comes up for you, table.concat() is another library function that is much more efficient than concatenating large numbers of strings into one big string using the .. operator. And the manual says this about it: "Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep..table[j]. (...)" While it *does* return the equivalent of that, it is more efficient in how it goes about it. (I'm not saying that you should consider table.concat as an option in repeating a single byte, it just seems relevant to a broader understanding of these things.) -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Aug 19 23:19:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7K2JN9k018008; Wed, 19 Aug 2009 23:19:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3287C190E0; Wed, 19 Aug 2009 23:18:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE65818CD5 for ; Wed, 19 Aug 2009 23:18:45 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7K2IgMH028626 for ; Wed, 19 Aug 2009 23:18:44 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id A704254C11A; Wed, 19 Aug 2009 23:18:43 -0300 (BRT) Date: Wed, 19 Aug 2009 23:18:43 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Simple way to create a big string of blanks? Message-ID: <20090820021843.GB10809@inf.puc-rio.br> References: <873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819223156.GE9950@inf.puc-rio.br> <418358C259C442D58155CB6F8669FDA5@CAYENNE> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > In case it comes up for you, table.concat() is another library > function that is much more efficient than concatenating large numbers > of strings into one big string using the .. operator. And the manual > says this about it: > > "Given an array where all elements are strings or numbers, returns > table[i]..sep..table[i+1] ··· sep..table[j]. (...)" > > While it *does* return the equivalent of that, it is more efficient in > how it goes about it. Actually it is not :) Remember that if you write "a..b..c..d" (as one single expression, as the description above) Lua does the entire concatenation in one single operation, allocating a buffer large enough. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 07:46:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KAkNjV001739; Thu, 20 Aug 2009 07:46:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B70D2192B8; Thu, 20 Aug 2009 07:45:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2638191C9 for ; Thu, 20 Aug 2009 07:45:32 -0300 (BRT) Received: by ewy26 with SMTP id 26so5177178ewy.5 for ; Thu, 20 Aug 2009 03:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xzT34O7dNon9qPHKB3BL42awyBTZp7ShMNyIjwIYkZ8=; b=rIqXzwvcU945euOPCPxV1YJt35rcMRdFVfUZjKzI75qchFe2WVfxjEcI9E21gaiS1n UylhX8EVQfoWewiJ8kYomfSqDBGs2zqjoMzt3yEd9kvR2fd/ltmtII0DQZmHK2gpW5f0 PmqomOPbktNDeKs2CD4Du9jWTPWH1xZozE4Wg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=afhYx63myfDfwPoe07uvScamcK8ceSqRN4yJ9bmAsDkxHydznD37DM/aZHafaICwPf pBL56pa5LE+MaY1+aVG+k91dcwnoWH08c++srWHYmoxFpzc06uzULE2uoERVNaUTuMYZ QzJxjnZGAJ9Iqb5XYBTHsKVEieNd/UFwniHcc= MIME-Version: 1.0 Received: by 10.216.91.10 with SMTP id g10mr1824232wef.71.1250765130426; Thu, 20 Aug 2009 03:45:30 -0700 (PDT) In-Reply-To: <20090820021843.GB10809@inf.puc-rio.br> References: <873a7n8rlr.fsf@mid.deneb.enyo.de> <20090819223156.GE9950@inf.puc-rio.br> <418358C259C442D58155CB6F8669FDA5@CAYENNE> <20090820021843.GB10809@inf.puc-rio.br> Date: Thu, 20 Aug 2009 11:45:30 +0100 Message-ID: Subject: Re: Simple way to create a big string of blanks? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7KAkNjV001739 On Thu, Aug 20, 2009 at 3:18 AM, Roberto Ierusalimschy wrote: >> In case it comes up for you, table.concat() is another library >> function that is much more efficient than concatenating large numbers >> of strings into one big string using the .. operator. And the manual >> says this about it: >> >> "Given an array where all elements are strings or numbers, returns >> table[i]..sep..table[i+1] ··· sep..table[j]. (...)" >> >> While it *does* return the equivalent of that, it is more efficient in >> how it goes about it. > > Actually it is not :)  Remember that if you write "a..b..c..d" (as one > single expression, as the description above) Lua does the entire > concatenation in one single operation, allocating a buffer large enough. > > -- Roberto > Oh! Very interesting, I somehow missed that, I will have to keep it in mind. (I think I sort of assumed it wouldn't work that way because of the possibility that some of the elements could be a table/userdata with a custom __concat metamethod rather than a proper string, and I assumed that would make things too difficult.) Thanks, -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 09:57:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KCul7a020387; Thu, 20 Aug 2009 09:56:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6065318F36; Thu, 20 Aug 2009 09:56:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54ABF18B2F for ; Thu, 20 Aug 2009 09:56:11 -0300 (BRT) Received: by ewy26 with SMTP id 26so5271316ewy.5 for ; Thu, 20 Aug 2009 05:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=mMFLilt65JAkfoAkn0wVsKId3lxbrXrWBxUQ14pmTrQ=; b=h6LZtcotsgJAQnJKv9vCsGBNrQfGghRtZ1gStwpz5x0cRnywBcSCJrah6M8oADEHGK XdbRxgz50jx/I+HBsu9XvnvYLdT5NBhaQvWiAaOsvwek+bntJMOwDaUfEQ+Z4WaeewU1 MUjuO0qMdgx9GhcMOCxu6QxRISMU5OoC0hABY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=ZZN+mh6akmoAmB4ZCZAgSr1j/uq6y7Sh/07btOfdtiYsehZC4kRTFKaK/5mql08H5B 6YkrXQq+BrzDwf+B1Jku7KVp0bp2igCxQV94xwlVu13LQgXpJwH8MkghEg9tRrJAMLRg nTRXM0s/roqBWtV88hWSoI0BhDetgWsZtyFe0= Received: by 10.210.136.15 with SMTP id j15mr31588ebd.21.1250772969119; Thu, 20 Aug 2009 05:56:09 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 5sm2443787eyh.56.2009.08.20.05.56.08 (version=SSLv3 cipher=RC4-MD5); Thu, 20 Aug 2009 05:56:08 -0700 (PDT) Message-ID: <4A8D47E7.9060606@gmail.com> Date: Thu, 20 Aug 2009 13:56:07 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: A question on GC and weak referenced tables.... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all I've got a problem trying to use weak-referenced tables. While they perform as described, it's not quite what I had hoped for. The problem is really that entries in such a table (be it weak-keyed or weak-valued) remain accessible until the underlying object is marked (or unmarked ??) by a GC cycle. So, my questions are: 1) is it possible to force the GC to just mark an object (or unmark it ??) without running a full GC cycle ? 2) if the answer to 1) above is yes, then is it possible for table keys/values to 'hide' the table entry if their underlying object has been marked to die ? Currently, is seems that such tables will only remove entries as part of a GC cycle. Apologies in advance on my ignorance of the Lua GC. Lawrie From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 10:06:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KD6Jcx022375; Thu, 20 Aug 2009 10:06:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACB2A192B6; Thu, 20 Aug 2009 10:05:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C134C1929F for ; Thu, 20 Aug 2009 10:05:52 -0300 (BRT) Received: by bwz10 with SMTP id 10so4571307bwz.5 for ; Thu, 20 Aug 2009 06:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6QK7EFelU6DX0Y1iq9xQTiWVVPDXcc0UcFxIIdRbaxw=; b=rpGgXSpGpc68DtytmH8Pcvkr2N3rrhppPcslqJaJuYNuKsMg93dsCBky/xi3cp1nvv OktNBGbGGFagx+Y3Z0Qf15oLqk6OqY33HmcKCIHspxSkWNrr4dc+kLMojF5wWnrksXBi 1bSpID7QXjN4nLs7kHYCoPs/o3HNcCWx0wwu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TBRO38qkO9lbXv4AdsxuI3EMi3FwSaBaZmz6U9EJmgSgJ+QpJucv56zlpTa7hfWozt Mr/2BUC7VYVPZ9ZUAb7KhEgFDblNDH5IVU7Ps568T19qL+gbMDsyI06Og+l055s6kJLY vnq0wVRNe5Je56xq/SA1jdqMxe325cJa7cICc= MIME-Version: 1.0 Received: by 10.204.154.147 with SMTP id o19mr6025797bkw.159.1250773551077; Thu, 20 Aug 2009 06:05:51 -0700 (PDT) In-Reply-To: <4A8D47E7.9060606@gmail.com> References: <4A8D47E7.9060606@gmail.com> Date: Thu, 20 Aug 2009 14:05:51 +0100 Message-ID: <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> Subject: Re: A question on GC and weak referenced tables.... From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 20, 2009 at 1:56 PM, Lawrie Nichols wrote: > Hi all > > I've got a problem trying to use weak-referenced tables. While they perform > as described, it's not quite what I had hoped for. The problem is really > that entries in such a table (be it weak-keyed or weak-valued) remain > accessible until the underlying object is marked (or unmarked ??) by a GC > cycle. > > So, my questions are: > > 1) is it possible to force the GC to just mark an object (or unmark it ??) > without running a full GC cycle ? > 2) if the answer to 1) above is yes, then is it possible for table > keys/values to 'hide' the table entry if their underlying object has been > marked to die ? Currently, is seems that such tables will only remove > entries as part of a GC cycle. > This is usually done by setting that field of the table to nil, whether it is weak or not. The GC makes no guarantees (as far as your code is concerned) about when it will run, mark, or collect objects. The GC just does the "right thing", if you're having problems, it seems like you are using weak tables for the "wrong thing". If I misunderstand, could you explain your use a bit more? Matthew From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 10:38:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KDcddS029316; Thu, 20 Aug 2009 10:38:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24E3B192B5; Thu, 20 Aug 2009 10:38:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1543A1929F for ; Thu, 20 Aug 2009 10:38:04 -0300 (BRT) Received: from source ([209.85.219.221]) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKSo1RujQYuOq5eb+qH0eRK1t1PcxLskRG@postini.com; Thu, 20 Aug 2009 06:38:05 PDT Received: by ewy21 with SMTP id 21so5101258ewy.45 for ; Thu, 20 Aug 2009 06:38:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.28.207 with SMTP id g57mr1790982wea.163.1250775481111; Thu, 20 Aug 2009 06:38:01 -0700 (PDT) Date: Thu, 20 Aug 2009 14:38:01 +0100 Message-ID: Subject: Updated power patches From: Reuben Thomas To: Lua mailing list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7KDcddS029316 I've updated all my Power Patches to Lua 5.1.4. (Actually, only one of the patches, which were all previously for Lua 5.1.2, failed to apply.) In the process I removed some unnecessary whitespace changes from a couple of them, so they're shorter and more readable than they used to be. All at: http://lua-users.org/wiki/LuaPowerPatches Most are backwards compatible, providing useful functionality like better signal handling (use sig_catch, so no more need to press Ctrl-C twice to halt a script waiting for input), printing of NULs, readline history saving and having the interpreter starting up without paying attention to environment variables. These patches are all tiny (~20 lines) and may be of interest to packagers as well as users. There are two more adventurous patches, one to prevent automatic conversion between strings and numbers, and the other to remove varargs (this last is new to the wiki). -- http://rrt.sc3d.org L’art des vers est de transformer en beautés les faiblesses (Aragon) From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 10:39:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KDdmTX029637; Thu, 20 Aug 2009 10:39:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81A97192C0; Thu, 20 Aug 2009 10:39:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF2F8192BA for ; Thu, 20 Aug 2009 10:39:23 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so11481eye.11 for ; Thu, 20 Aug 2009 06:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=ZwP2SnBNugqWqVsahT/v+3HFRP8TLDb45+d85ca+XAs=; b=pRx2QuYS0WyjJMFWouDZfwO1ntU/rOq8qX6TyQJGdBjV+ClerEOjYohLF0WNY8swgO zH5mRXM38bx6OUFjnAdps16ackwswgfQmiLL6yiZBgnd6T83yMt+WGkOepBaFaYkKL7K mfCE3CBJ2FK1hyGRCO/A1NjJ8ajGBg3dbZD4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=nNjIMaaxcInKVDf94PTZvwXhn9ON0tP/79T+To+3ACjb8O+F4W9GZI2ECbtvy7/yrt /yXUXh3IANyhMS5Qx3LNx6vVEkUv7aCMxJcmbnLv/D7UyOTgWGwHf70ufagwU4w9Ko2u /inGk9icd9hXWRNl+g6zgYdF8lvCR1DwOxCgU= Received: by 10.210.76.14 with SMTP id y14mr42786eba.78.1250775562367; Thu, 20 Aug 2009 06:39:22 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 7sm376257eyg.5.2009.08.20.06.39.21 (version=SSLv3 cipher=RC4-MD5); Thu, 20 Aug 2009 06:39:21 -0700 (PDT) Message-ID: <4A8D5209.2010306@gmail.com> Date: Thu, 20 Aug 2009 14:39:21 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: Re: A question on GC and weak referenced tables.... References: <4A8D47E7.9060606@gmail.com> <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> In-Reply-To: <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 20/08/09 14:05, Matthew Wild wrote: > On Thu, Aug 20, 2009 at 1:56 PM, Lawrie Nichols wrote: > >> Hi all >> >> I've got a problem trying to use weak-referenced tables. While they perform >> as described, it's not quite what I had hoped for. The problem is really >> that entries in such a table (be it weak-keyed or weak-valued) remain >> accessible until the underlying object is marked (or unmarked ??) by a GC >> cycle. >> >> So, my questions are: >> >> 1) is it possible to force the GC to just mark an object (or unmark it ??) >> without running a full GC cycle ? >> 2) if the answer to 1) above is yes, then is it possible for table >> keys/values to 'hide' the table entry if their underlying object has been >> marked to die ? Currently, is seems that such tables will only remove >> entries as part of a GC cycle. >> >> > This is usually done by setting that field of the table to nil, > whether it is weak or not. The GC makes no guarantees (as far as your > code is concerned) about when it will run, mark, or collect objects. > > The GC just does the "right thing", if you're having problems, it > seems like you are using weak tables for the "wrong thing". If I > misunderstand, could you explain your use a bit more? > > Matthew > Basically, I wanted to use them as a cache for data stored in other tables in order to avoid having to call a costly lookup function for each data access. The problem is that even if the data in the underlying tables is updated or removed, the data in the 'cache' table is not 'invalidated' until after a GC cycle. So, I end up with a situation where I need to either: a) abandon the use of the cache, and simply do the lookup each time. b) run the GC after any modification to one of the underlying tables in order to remove the cache entry in the cache table; this is unappealing as thousands of entries could be updated in the underlying tables. b) do some kind of manual check on the cache entry to see if it still matches the data in the underlying table. I suspect this would degenerate into nothing better than a). I'm open to any suggestions !! Lawrie From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 11:55:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KEtJMq015974; Thu, 20 Aug 2009 11:55:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB5B5192B6; Thu, 20 Aug 2009 11:54:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C7C418B73 for ; Thu, 20 Aug 2009 11:54:44 -0300 (BRT) Received: by fxm25 with SMTP id 25so4336541fxm.5 for ; Thu, 20 Aug 2009 07:54:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.84.30 with SMTP id m30mr3109514mul.23.1250780081150; Thu, 20 Aug 2009 07:54:41 -0700 (PDT) In-Reply-To: <4A8D5209.2010306@gmail.com> References: <4A8D47E7.9060606@gmail.com> <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> <4A8D5209.2010306@gmail.com> Date: Thu, 20 Aug 2009 09:54:41 -0500 Message-ID: <90eb1dc70908200754va5252aao856a63150b44c575@mail.gmail.com> Subject: Re: A question on GC and weak referenced tables.... From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 20, 2009 at 8:39 AM, Lawrie Nichols wrote: > a) abandon the use of the cache, and simply do the lookup each time. > b) run the GC after any modification to one of the underlying tables in > order to remove the cache entry in the cache table; this is unappealing as > thousands of entries could be updated in the underlying tables. > b) do some kind of manual check on the cache entry to see if it still > matches the data in the underlying table. I suspect this would degenerate > into nothing better than a). d) use the 'changed condition' as part of the key to your cache. -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 13:33:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KGWxvf005367; Thu, 20 Aug 2009 13:33:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1E0319109; Thu, 20 Aug 2009 13:32:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1278E18B2F for ; Thu, 20 Aug 2009 13:32:10 -0300 (BRT) Received: by ewy26 with SMTP id 26so23416ewy.5 for ; Thu, 20 Aug 2009 09:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=LFz7rAhZejbxx6UMjtFBaa6aBW5m8hesF/vS5uj/Lxs=; b=unYmIgf/+paGLWsZM0XlPnZCrXEWnJwz/asoT4EeIdWeH/sl0JKxwjVguVqwCduFoI zQbhCz1u8E/uvA5YCeo2OkJH4PHkSumWhMXunje4bq3P+feG9km3++AyigVZ0jOzJXq/ MZ8VrXZByIRjFpn5B7EXZO83GecyeSZIsklyc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=GwzRaG3M/0QbYB8zhBOvIe7AWnrYP2igTskV53osVPH9LKb5m+7OqN3SSU9dx31/SB 8NKV6KeBd2Px3RuXb7OzXBUzJCf28uHbD7jooMzoMToHIN4rzR0vrZurmZ1M82DgcRAg wQ6MNhhYNlbbdhocqL9BOe0EJvbjUiPh3x7iM= Received: by 10.210.27.8 with SMTP id a8mr2148508eba.90.1250785928128; Thu, 20 Aug 2009 09:32:08 -0700 (PDT) Received: from ?192.168.1.229? (78-86-185-83.zone2.bethere.co.uk [78.86.185.83]) by mx.google.com with ESMTPS id 10sm2378048eyd.4.2009.08.20.09.32.06 (version=SSLv3 cipher=RC4-MD5); Thu, 20 Aug 2009 09:32:06 -0700 (PDT) Message-ID: <4A8D7A86.2050706@gmail.com> Date: Thu, 20 Aug 2009 17:32:06 +0100 From: Lawrie Nichols User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Lua list Subject: Re: A question on GC and weak referenced tables.... References: <4A8D47E7.9060606@gmail.com> <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> <4A8D5209.2010306@gmail.com> <90eb1dc70908200754va5252aao856a63150b44c575@mail.gmail.com> In-Reply-To: <90eb1dc70908200754va5252aao856a63150b44c575@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 20/08/09 15:54, Javier Guerra wrote: > On Thu, Aug 20, 2009 at 8:39 AM, Lawrie Nichols wrote: > >> a) abandon the use of the cache, and simply do the lookup each time. >> b) run the GC after any modification to one of the underlying tables in >> order to remove the cache entry in the cache table; this is unappealing as >> thousands of entries could be updated in the underlying tables. >> b) do some kind of manual check on the cache entry to see if it still >> matches the data in the underlying table. I suspect this would degenerate >> into nothing better than a). >> > d) use the 'changed condition' as part of the key to your cache. > > Sorry, I don't understand what you're saying. Could you expand on this a little please ? Thanks Lawrie From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 14:05:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KH5V9N015088; Thu, 20 Aug 2009 14:05:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AAD5192C5; Thu, 20 Aug 2009 14:05:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A11718A9B for ; Thu, 20 Aug 2009 14:04:53 -0300 (BRT) Received: by bwz10 with SMTP id 10so33501bwz.5 for ; Thu, 20 Aug 2009 10:04:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.126.27 with SMTP id d27mr10530mun.56.1250787889886; Thu, 20 Aug 2009 10:04:49 -0700 (PDT) In-Reply-To: <4A8D7A86.2050706@gmail.com> References: <4A8D47E7.9060606@gmail.com> <4db9cacb0908200605r711e42a9x7a51d1f6d635fe32@mail.gmail.com> <4A8D5209.2010306@gmail.com> <90eb1dc70908200754va5252aao856a63150b44c575@mail.gmail.com> <4A8D7A86.2050706@gmail.com> Date: Thu, 20 Aug 2009 12:04:49 -0500 Message-ID: <90eb1dc70908201004g3e93b8a8v773cd78b27dac38a@mail.gmail.com> Subject: Re: A question on GC and weak referenced tables.... From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 20, 2009 at 11:32 AM, Lawrie Nichols wrote: >> d) use the 'changed condition' as part of the key to your cache. > > Sorry, I don't understand what you're saying. Could you expand on this a > little please ? you're using a weak table to cache some results, to avoid some costly calculations or data retrieval. this is valid only as long as you know that those expensive operations will give the same result every time. when some condition changes, the result changes as well, and the cache isn't valid. what you're trying to do is to act at the very moment that condition changes, to mark the cached data as invalid. you can turn the problem around, to make sure that you only cache invariant results: for example, if what you want to avoid is an expensive calculation that only depend on input parameters, then you should use all those parameters as the cache's key. a different example would be to cache a DB retrieval/template rendering, there you should use not only the DB key at cache key, but also some kind of record version. that way, you don't have to invalidate the old version. just register the new version and the old one will eventually be purged. of course, if you can easily hook the 'modification' time, you can just delete the cache entry. -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Aug 20 17:03:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7KK3H4s027694; Thu, 20 Aug 2009 17:03:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32BD118A22; Thu, 20 Aug 2009 17:02:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from igtmail01.igt.com (igtmail01.igt.com [12.24.60.81]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04D5F189F1 for ; Thu, 20 Aug 2009 17:02:34 -0300 (BRT) Received: from RNOEXHTCAS01.is.ad.igt.com ([10.210.11.6]) by mail01 (8.14.3/8.14.3) with ESMTP id n7KK2TKx018419 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 20 Aug 2009 13:02:29 -0700 Received: from RNOMBX01.is.ad.igt.com ([10.210.11.4]) by RNOEXHTCAS01.is.ad.igt.com ([::1]) with mapi; Thu, 20 Aug 2009 13:02:52 -0700 From: "Stern.Jason" To: "'lua@bazar2.conectiva.com.br'" Date: Thu, 20 Aug 2009 13:02:52 -0700 Subject: Re: LuaJIT on QNX Momentics issue Thread-Topic: Re: LuaJIT on QNX Momentics issue Thread-Index: Acoh0Tg+YeaE1RKlSsWU0Vk8ElNAmA== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1307-5.600.1016-16836.004 x-tm-as-result: No--31.983000-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-08-20_10:2009-08-11, 2009-08-20, 2009-08-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0907200000 definitions=main-0908200099 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7KK3H4s027694 Mike Pall wrote: > First try to delete the hole #if cruft and only use this line: > > #define LUA_TVALUE_ALIGN __attribute__ ((aligned(8))) > > Then recompile everything. That fixed it. Thank you! :) From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 04:23:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7L7N6al013093; Fri, 21 Aug 2009 04:23:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B2B019239; Fri, 21 Aug 2009 04:22:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18857191C8 for ; Fri, 21 Aug 2009 04:22:26 -0300 (BRT) Received: by bwz10 with SMTP id 10so328232bwz.5 for ; Fri, 21 Aug 2009 00:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=hScBCZhplw8wVmQDsE5WESGvNNQt2F/1O5Y+SAmNFVE=; b=Giaer5GjFQVetU2JLPByaTGKV/7yOb3KoDJdJ9tV59Tknkxm50mWynM/c7s2qjx1KE Ym5Y66b/qvyOLA6D74Ibc/UKbuP/fR0Wx3yN+9lOPocKSIFYKLBrL6gYY9hYf+NW4VXf aBojHQKu5KxPYEUCQ83ReEK2UkvUwW7fulYP8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eGimeQ47Iae9hBMftoSRFy+avREbRJLdwuLJo20Q0xxyCMk7bk2g0m+ig9OzT4Ob1e 4f0R0JjJsTCxRMNmTgHXxiLof/zTpTwFfSJ3NJSjsHxo/ero+zhcjRJdU9OBGgCRMclm rP+t/m1TZHexO7TCt7Rr86/rcnLLILDvKrMpA= MIME-Version: 1.0 Received: by 10.204.153.20 with SMTP id i20mr632461bkw.126.1250839345398; Fri, 21 Aug 2009 00:22:25 -0700 (PDT) Date: Fri, 21 Aug 2009 09:22:25 +0200 Message-ID: <222ade940908210022w44c0bd73l2f0cb7b1f530f476@mail.gmail.com> Subject: status of Lua on Windows CE From: Vincent Torri To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0015175cd842da85a00471a1ba62 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cd842da85a00471a1ba62 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hey, What is the status of Lua on Windows CE ? LuaCE homepage seems to not exist anymore and on LuaForge, Lua for Windows Mobile is empty thank you Vincent Torri PS: i'm not against helping in porting Lua to Windows CE. But I am not an expert of Windows CE. --0015175cd842da85a00471a1ba62 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey,

What is the status of Lua on Windows CE ? LuaCE homepage seems = to not exist anymore and on LuaForge, Lua for Windows Mobile is empty
thank you

Vincent Torri

PS: i'm not against helping in = porting Lua to Windows CE. But I am not an expert of Windows CE.
--0015175cd842da85a00471a1ba62-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 07:05:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LA531V027333; Fri, 21 Aug 2009 07:05:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F5851926D; Fri, 21 Aug 2009 07:04:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF7E119235 for ; Fri, 21 Aug 2009 07:04:25 -0300 (BRT) Received: by bwz10 with SMTP id 10so391356bwz.5 for ; Fri, 21 Aug 2009 03:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=qLgVwAJB+cIXtCP6PJzll22qWWqdVNy9xzjVzrY+jnY=; b=XM+GqpalRP5lebYnJ9Dbf4WdLHiGHUKvMUnhPxlpCJY6uKRdc3dCU/RdowbGE2rlcn UTExHMXGvip9xbYfBVNr8Ozn71noX3G007ROw7Cta+Ya6PUoat1VCV0HwphwpKfIFALc XqOr3mnlrIdfTBE2TK4DRt9ZLhfERWSlm83+E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vR0ku0MngCoFvGp7jtZjC4w98HvpzGcs/u4d7hFdvxq8mO1CKN5vuvfrELicqP7dnS BAbr1ZdUUMSY3AdAfH6tQhuKrmuUE4QIzSxYflEv/4Eb4TsFK4agqYW5KEb7nQsFALl9 tBdPHGMq+fFHhzFSKpqSPePXVuYExaQ8QQB6U= MIME-Version: 1.0 Received: by 10.204.34.196 with SMTP id m4mr780421bkd.62.1250849063951; Fri, 21 Aug 2009 03:04:23 -0700 (PDT) Date: Fri, 21 Aug 2009 12:04:23 +0200 Message-ID: <222ade940908210304w7c96104bi70ac396e5830c38c@mail.gmail.com> Subject: about sending patches for a Windows CE port From: Vincent Torri To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00032555a0921fe0500471a3fe57 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555a0921fe0500471a3fe57 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hey, After some discussion on IRC, i'm wondering if, if I provide patches for that OS, they will be accepted or not. Indeed, lua intends to be written in C ANSI, but Windows CE API does not provide full C ANSI support. So is it worth that I send patches (the purpose is that they are integrated into the lua source code), or do I write my own modified version for Windows CE ? regards Vincent --00032555a0921fe0500471a3fe57 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hey,

After some discussion on IRC, i'm wondering if, if I provide patches for that OS, they will be accepted or not. Indeed, lua intends to be written in C ANSI, but Windows CE API does not provide full C ANSI support.

So is it worth that I send patches (the purpose is that they are integrated into the lua source code), or do I write my own modified version for Windows CE ?

regards

Vincent
--00032555a0921fe0500471a3fe57-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 09:05:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LC5V9c008882; Fri, 21 Aug 2009 09:05:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2FB6192DA; Fri, 21 Aug 2009 09:04:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mengele.ibawizard.net (ibawizard.net [82.208.49.253]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 290D6192CE for ; Fri, 21 Aug 2009 09:04:49 -0300 (BRT) Received: by mengele.ibawizard.net (Postfix, from userid 1002) id C21CF1D36129; Fri, 21 Aug 2009 14:04:41 +0200 (CEST) Date: Fri, 21 Aug 2009 14:04:41 +0200 From: Petr =?iso-8859-2?Q?=A9tetiar?= To: Lua list Subject: Re: status of Lua on Windows CE Message-ID: <20090821120441.GP8129@ibawizard.net> References: <222ade940908210022w44c0bd73l2f0cb7b1f530f476@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <222ade940908210022w44c0bd73l2f0cb7b1f530f476@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vincent Torri [2009-08-21 09:22:25]: > Hey, > > What is the status of Lua on Windows CE ? LuaCE homepage seems to not exist > anymore and on LuaForge, Lua for Windows Mobile is empty > > thank you > > Vincent Torri > > PS: i'm not against helping in porting Lua to Windows CE. But I am not an > expert of Windows CE. Hi, my port can be found at GitHub[1]. My main goals for my own port were, that I tried to make upgrade path as easy as possible, so I didn't tried to patch any of Lua source code. All is done just by modification of one Lua header, one line. I use it in production on Windows CE/Mobile terminals and it works fine for me (tm). Patches are welcome. 1. http://github.com/ynezz/luace -- ynezz From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 09:18:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LCINpW010500; Fri, 21 Aug 2009 09:18:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51577192E3; Fri, 21 Aug 2009 09:18:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 023BA192CE for ; Fri, 21 Aug 2009 09:17:53 -0300 (BRT) Received: by bwz10 with SMTP id 10so447736bwz.5 for ; Fri, 21 Aug 2009 05:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vg4oCnWuUC6YbZEn2+3gjeNGF0gwFfXMWQaT0H3+U9I=; b=CVjcxTxnvDDQd1OABNNl8gpIt/0f4Gse4RHEXcjbd37qME5dFxfHGCrmGedwHfwNl2 Uq7zZwXvUY0dF6iisHlmlzLH6VHQpvZLOV3axwWwSfuPGNsZrEbzNVGK/x2A3Y94VRmF z0sCLc5JnNOOZowJCjaUas4Vm7XcINE/ocSho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E8nIVRMSaFvB468THdBndvu/UmFrcy5YioM1D/q4VNn391yccI02ksgb9+mTCFN2zq fn5YGDRXGcIQVNiPxruaCsmEk0adtD/5O6Jxg0jZjzGSfCy0d6zn9XY2OHvEV+ZuFqQo 7U3dhNFpqLpOoRO4IUhekgtFWUzneQElKxkys= MIME-Version: 1.0 Received: by 10.204.34.69 with SMTP id k5mr895215bkd.2.1250857070869; Fri, 21 Aug 2009 05:17:50 -0700 (PDT) In-Reply-To: <20090821120441.GP8129@ibawizard.net> References: <222ade940908210022w44c0bd73l2f0cb7b1f530f476@mail.gmail.com> <20090821120441.GP8129@ibawizard.net> Date: Fri, 21 Aug 2009 14:17:50 +0200 Message-ID: <222ade940908210517j60871176j72643da0b01aa4fa@mail.gmail.com> Subject: Re: status of Lua on Windows CE From: Vincent Torri To: Lua list Content-Type: multipart/alternative; boundary=000325559e825fbeb50471a5db5b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559e825fbeb50471a5db5b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Aug 21, 2009 at 2:04 PM, Petr =C5=A0tetiar wrote: > Vincent Torri [2009-08-21 09:22:25]: > > > Hey, > > > > What is the status of Lua on Windows CE ? LuaCE homepage seems to not > exist > > anymore and on LuaForge, Lua for Windows Mobile is empty > > > > thank you > > > > Vincent Torri > > > > PS: i'm not against helping in porting Lua to Windows CE. But I am not = an > > expert of Windows CE. > > Hi, > > my port can be found at GitHub[1]. My main goals for my own port were, th= at > I > tried to make upgrade path as easy as possible, so I didn't tried to patc= h > any > of Lua source code. All is done just by modification of one Lua header, o= ne > line. I use it in production on Windows CE/Mobile terminals and it works > fine > for me (tm). Patches are welcome. > > 1. http://github.com/ynezz/luace nice :-) less work to do for me. I'm using the cegcc project to cross compiling Windows CE code. May I provide a patch to compile with that framework ? I've not tested yet, but the modifications would only be in the 2 Makefile. Vincent Torri --000325559e825fbeb50471a5db5b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Aug 21, 2009 at 2:04 PM, Petr = =C5=A0tetiar <ynezz@t= rue.cz> wrote:
Vincent Torri <vincent.torri@= gmail.com> [2009-08-21 09:22:25]:

> Hey,
>
> What is the status of Lua on Windows CE ? LuaCE homepage seems to not = exist
> anymore and on LuaForge, Lua for Windows Mobile is empty
>
> thank you
>
> Vincent Torri
>
> PS: i'm not against helping in porting Lua to Windows CE. But I am= not an
> expert of Windows CE.

Hi,

my port can be found at GitHub[1]. My main goals for my own port were, that= I
tried to make upgrade path as easy as possible, so I didn't tried to pa= tch any
of Lua source code. All is done just by modification of one Lua header, one=
line. I use it in production on Windows CE/Mobile terminals and it works fi= ne
for me (tm). Patches are welcome.

1. http://githu= b.com/ynezz/luace

nice :-) less work to do for me.=

I'm using the cegcc project to cross compiling Windows CE code.= May I provide a patch to compile with that framework ? I've not tested= yet, but the modifications would only be in the 2 Makefile.

Vincent Torri

--000325559e825fbeb50471a5db5b-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 10:39:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LDdKgt023136; Fri, 21 Aug 2009 10:39:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 618F7192DD; Fri, 21 Aug 2009 10:38:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f188.google.com (mail-yw0-f188.google.com [209.85.211.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED358191F0 for ; Fri, 21 Aug 2009 10:38:40 -0300 (BRT) Received: by ywh26 with SMTP id 26so926082ywh.5 for ; Fri, 21 Aug 2009 06:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ImnqsrsHmcso8DTj/vqyYn06D3/s7afB83VcVSzdp/o=; b=YUeuroaRmQ/l9tEKQMqxlT0CRi43RVUBpcXIygTy0uhMS9zl7QLJAiX6wsdb3Ol75K 3gONvl16Ht2JoweElr2gKNxP/y+m0di5KqnQwJ6QOubwgs0QI2r1W4zFN1UAySIs0Yd9 MW39KwMdvvMpBp7ERykmTbz+ozvukPvIzWfBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=XDCQ73+1renAHi4z8KroWDcW+0hedo5Q82VStyA4V7N71Jenre8gFxkrMll2nQpRRz 7BvusZclHpzgMZjHoJDTfnmyhF8Sd/r8Hni1g1OQI2QAXv7m46UeQtnp4oshuDxLZ+lz ZcqNHL5T6YmvLN09Kv7rTiOpVCzIZAlgMuhBo= MIME-Version: 1.0 Received: by 10.100.82.7 with SMTP id f7mr1090000anb.30.1250861917105; Fri, 21 Aug 2009 06:38:37 -0700 (PDT) In-Reply-To: <222ade940908210304w7c96104bi70ac396e5830c38c@mail.gmail.com> References: <222ade940908210304w7c96104bi70ac396e5830c38c@mail.gmail.com> From: "Thomas Harning Jr." Date: Fri, 21 Aug 2009 09:38:17 -0400 Message-ID: Subject: Re: about sending patches for a Windows CE port To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 21, 2009 at 6:04 AM, Vincent Torri wrote: > Hey, > > After some discussion on IRC, i'm wondering if, if I provide patches for > that OS, they will be accepted or not. Indeed, lua intends to be written in > C ANSI, but Windows CE API does not provide full C ANSI support. > > So is it worth that I send patches (the purpose is that they are integrated > into the lua source code), or do I write my own modified version for Windows > CE ? You might want to look into the project: wcecompat which aims at filling in the ANSI C holes in the Windows CE library-set. There's the original at: http://www.essemer.com.au/windowsce .. + a patched version that tries to update it for more recent windows mobile/etc: http://github.com/mauricek/wcecompat -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 12:03:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LF3qxV008938; Fri, 21 Aug 2009 12:03:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EB8A1931F; Fri, 21 Aug 2009 12:03:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-17.bluehost.com (outbound-mail-17.bluehost.com [69.89.20.232]) by bazar2.conectiva.com.br (Postfix) with SMTP id 834F419318 for ; Fri, 21 Aug 2009 12:03:13 -0300 (BRT) Received: (qmail 10068 invoked by uid 0); 21 Aug 2009 15:03:10 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy1.bluehost.com with SMTP; 21 Aug 2009 15:03:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Subject:Message-ID:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=L7TQ6Ita1o10NIvNWjBj73kXMHq468fuEjbouEZlsQahQH9I0TbERr6dq+G/x5Fcl1pvy3gD+e3TMaImo3e9TzGb7znzzKAEloILiIfKqqqlhW96bV2Fz9jQ5/ekX9nx; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MeVe2-0008RG-KX for lua@bazar2.conectiva.com.br; Fri, 21 Aug 2009 09:03:10 -0600 Date: Fri, 21 Aug 2009 10:03:00 -0500 From: Rob Hoelz To: Lua list Subject: Pluto Git Repository on GitHub Message-ID: <20090821100300.05b45942@hoelzro.net> Organization: N/A X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.5; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/GSr.OdI+PA/HliUoZWQct5t"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/GSr.OdI+PA/HliUoZWQct5t Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Happy Friday Lusers, I've set up a Git repository on GitHub for Pluto, the heavy duty persistence library for Lua. Here's the GitHub link: http://github.com/hoelzro/pluto/tree/master Right now, there's only two commits: the initial import of Pluto, and my fix for 64-bit machines. I'm also kind of taking over maintenance of Pluto, I guess. Many thanks go out to Ben Sunshine-Hill and his excellent library! Also, any and all help for Pluto would be appreciated. =3D) -Rob Hoelz --Sig_/GSr.OdI+PA/HliUoZWQct5t Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqOtycACgkQUoGaR6SGEaoRzgCdFeTzT2uXKtnJYqNOB6beWr5K tD0AoMVb7YLYtODo+qxl70cFOF/lvAfk =dHFr -----END PGP SIGNATURE----- --Sig_/GSr.OdI+PA/HliUoZWQct5t-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 13:16:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LGGK8a022777; Fri, 21 Aug 2009 13:16:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42CFB19316; Fri, 21 Aug 2009 13:15:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0836F1928F for ; Fri, 21 Aug 2009 13:15:40 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id l27so237238fgb.5 for ; Fri, 21 Aug 2009 09:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=KvzvS6NNSfI4YpcSDGPsls55lGLcXX2k4Ecc9prc4zI=; b=yDj711pcKjPzBkaKg/5m9GoEGQidiJ7c5zskIzydblmWhtVl8448xk/tZuHsR+huxe gJz1KkyLt1BpAPBqvopbfhlpeJB0HDElihyMitLpjuwdVpiNxUTCrjinUXx3D/Zy18Dy pgO+8uyH4mEO99vOw9WW1i7fd7NT5y1yHDZt8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=brUEcMAXbUFHmmI+HNOsX903X2IULncy0ske88veTWVW3DOYS3j3LG4JK35nRa0efm MLp0XeXpRHctWp012erlRX2/UUX0/OlufNCBnxczsmYNKGzT4wP13d3c0MQh+WwBFof8 wnFOU2JjumZUtKwmyAF+vLju7wzTUOIT4jOFg= MIME-Version: 1.0 Received: by 10.239.163.201 with SMTP id q9mr136534hbd.38.1250871337414; Fri, 21 Aug 2009 09:15:37 -0700 (PDT) In-Reply-To: References: <222ade940908210304w7c96104bi70ac396e5830c38c@mail.gmail.com> Date: Fri, 21 Aug 2009 13:15:37 -0300 Message-ID: Subject: Re: about sending patches for a Windows CE port From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7LGGK8a022777 I have a project[1] on LuaForge that is a port of Lua and the Kepler platform for Windows Mobile. I believe most of the code works on WindowsCE. And yes, I had to patch the Lua source at some points -- specially file I/O. Luís Eduardo Jason Santos [1] http://luaforge.net/projects/lua4wince/ On Fri, Aug 21, 2009 at 10:38 AM, Thomas Harning Jr. wrote: > On Fri, Aug 21, 2009 at 6:04 AM, Vincent Torri wrote: >> Hey, >> >> After some discussion on IRC, i'm wondering if, if I provide patches for >> that OS, they will be accepted or not. Indeed, lua intends to be written in >> C ANSI, but Windows CE API does not provide full C ANSI support. >> >> So is it worth that I send patches (the purpose is that they are integrated >> into the lua source code), or do I write my own modified version for Windows >> CE ? > You might want to look into the project: wcecompat which aims at > filling in the ANSI C holes in the Windows CE library-set. > > There's the original at: http://www.essemer.com.au/windowsce > .. + a patched version that tries to update it for more recent windows > mobile/etc: http://github.com/mauricek/wcecompat > -- > Thomas Harning Jr. > From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 13:26:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LGQR1V024570; Fri, 21 Aug 2009 13:26:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4509919335; Fri, 21 Aug 2009 13:26:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0495219321 for ; Fri, 21 Aug 2009 13:25:59 -0300 (BRT) Received: by yxe5 with SMTP id 5so273886yxe.33 for ; Fri, 21 Aug 2009 09:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=e4qiD+U2xxOCtcqm1Xxz4cRcJek9cnrpMhPeCmfhxyo=; b=MhoObLVbmtFjYzXRT3xUESAB58/2qvksIFSLynDyES5Tb8WGymauz16+DKXEr6VWHN 9mU4B4TlidK7myEdQNK3sgHfxiOrhM23q7f//EttY881pU+nSu4MP0pO0OIKg0jCLzYw G6fmSWnLdjiDDViaZ113VkOrDzbCtqcHkMaBk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=v/o+M+M+d0sFh1BiogGQERPRzA/piWRZIqLu8SZwV36wBXoaWsiVk9DJ4NeU8DV2vP OH9yb/OvK5KPYZuuacGpzqosnqlp/nq92AvcQ2LKqx+FySV7qucd0QH29R4H7hHecNMn +yZas3CcqIXd1aVGu5gdoPIeDaLP6pe4VYkkw= MIME-Version: 1.0 Received: by 10.100.192.10 with SMTP id p10mr1222348anf.164.1250871958093; Fri, 21 Aug 2009 09:25:58 -0700 (PDT) From: "Thomas Harning Jr." Date: Fri, 21 Aug 2009 12:25:38 -0400 Message-ID: Subject: coxpcall invocation question To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Looking through the coxpcall code, I noticed something that seemed a little odd: function coxpcall(f, err, ...) local res, co = oldpcall(coroutine.create, f) if not res then local params = {...} local newf = function() return f(unpack(params)) end co = coroutine.create(newf) end return performResume(err, co, ...) end If tries to create a coroutine and if that fails, constructs a new function that unpacks args/etc to get things going. I presume this is to support calling objects that implement the __call metatable that coroutine.create may not handle... A short fix to remove unpacking would be this... since performResume already passes new args in: if not res then local newf = function(...) return f(...) end co = coroutine.create(newf) end I suspect this may have been left in from when I made patches before since I hadn't quite understood all the vararg handling then. If that fix doesn't work... then the pack/unpack will need to capture the # of args to make sure nil args are passed in.... Fix: if not res then local params = {n = select('#', ...), ...} local newf = function() return f(unpack(params, 1, n)) end co = coroutine.create(newf) end -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 13:34:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LGYEZ1026348; Fri, 21 Aug 2009 13:34:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A0191933A; Fri, 21 Aug 2009 13:33:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF0A618A9B for ; Fri, 21 Aug 2009 13:33:44 -0300 (BRT) Received: by ewy26 with SMTP id 26so820595ewy.5 for ; Fri, 21 Aug 2009 09:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=8I0yTTnGQSfY9IAv2y5wHaTAHttN81CHcz4fmZ3OKQU=; b=iQcTFx9SIhkdgvc0C992Ln/Iq51iXuPvrQS4q5N5FmCabaK/IdoeB6gsptMaIW+I1e cTgRoZVvwWb6Cg9XeJkjaCHPGV2/Xle+x0Esiix9DShMHKMXZZVN8CqFyfwhKd7//8qw oFcZ3khEbSBfZfIOMNiG+FRJk7+OugYO3r3Ms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=E9J79W3Ble8wTLv0LBeuoDR5bpl2EboGL2YXyr20SH10RT8VuGU9y6+JpWGxZthAAc QLN6yD89Y8nEJsD/KPnDePnv+ErKTTLcRMsHmofgeXI80Lt32KXvg3wHoT6P86L8wYFu yVwCwEaAdGESuIgLDBcpF/QDFa7tloNtFEvhY= MIME-Version: 1.0 Received: by 10.216.7.207 with SMTP id 57mr242682wep.104.1250872423217; Fri, 21 Aug 2009 09:33:43 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Fri, 21 Aug 2009 18:33:23 +0200 Message-ID: <89d273ba0908210933y14326b77x58585c309a89c67@mail.gmail.com> Subject: Re: coxpcall invocation question To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/21 Thomas Harning Jr. : > I suspect this may have been left in from when I made patches before > since I hadn't quite understood all the vararg handling then. > If that fix doesn't work... then the pack/unpack will need to capture > the # of args to make sure nil args are passed in.... > Fix: > if not res then > local params = {n = select('#', ...), ...} > local newf = function() return f(unpack(params, 1, n)) end > co = coroutine.create(newf) > end You're not properly accessing n. So use either n in the table: if not res then local params = {n = select('#', ...), ...} local newf = function() return f(unpack(params, 1, params.n)) end co = coroutine.create(newf) end or n as an upvalue: if not res then local n,params, = select('#', ...),{...} local newf = function() return f(unpack(params, 1, n)) end co = coroutine.create(newf) end From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 16:48:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LJm29o014072; Fri, 21 Aug 2009 16:48:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBD2219338; Fri, 21 Aug 2009 16:47:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DB3719327 for ; Fri, 21 Aug 2009 16:47:23 -0300 (BRT) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090821194719.OYLV6611.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Fri, 21 Aug 2009 20:47:19 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090821194719.YRDI22934.aamtaout04-winn.ispmail.ntl.com@STORE.store> for ; Fri, 21 Aug 2009 20:47:19 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id CE7DBB9E4 for ; Fri, 21 Aug 2009 20:51:58 +0100 (BST) Message-ID: <4A8EF9C2.8050501@ntlworld.com> Date: Fri, 21 Aug 2009 20:47:14 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: table.remove in C api? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=roUJaH_Pw1cfXnIiPVAA:9 a=fNJzH7n1mEDRsa1k3kEA:7 a=SyTMVBcUwAE9uww4QYCVxDiXGXMA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have a table indexed by pointers (lightuserdata) with userdata values to allow me to look up pointers and return userdata to Lua However in the userdata's __gc method I need to remove the pointer key from the table, there seems to be no analogue of table.remove(t,i) in lua's C api - or am I missing something obvious please, please don't tell me I have to copy all the keys but one to a temporary table and the recreate my pointer table and then copy them back (head meet wall, wall meet head....) Thanks Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 16:56:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LJuDl0016612; Fri, 21 Aug 2009 16:56:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7A6D19351; Fri, 21 Aug 2009 16:55:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BA021932F for ; Fri, 21 Aug 2009 16:55:43 -0300 (BRT) Received: by bwz10 with SMTP id 10so657747bwz.5 for ; Fri, 21 Aug 2009 12:55:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.133.25 with SMTP id k25mr656768mun.62.1250884540272; Fri, 21 Aug 2009 12:55:40 -0700 (PDT) In-Reply-To: <4A8EF9C2.8050501@ntlworld.com> References: <4A8EF9C2.8050501@ntlworld.com> Date: Fri, 21 Aug 2009 14:55:40 -0500 Message-ID: <90eb1dc70908211255v7dc8e7een889485d5e24a6140@mail.gmail.com> Subject: Re: table.remove in C api? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 21, 2009 at 2:47 PM, Chris Camacho wrote: > I have a table indexed by pointers (lightuserdata) with userdata values > to allow me to look up pointers and return userdata to Lua > > However in the userdata's __gc method I need to remove the > pointer key from the table, there seems to be no analogue of > table.remove(t,i) in lua's C api - or am I missing something obvious table.remove(t [,pos]) is handy for working with the array part of a table, not the hash part where you're storing your userdatas (since they're indexed by lightuserdatas and not small consecutive indexes). for the hash part, simply assign nil: t(yourlightuserdata)=nil in C, use lua_pushnil() and lua_settable() or lua_rawset() -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 17:04:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LK4Hbe019322; Fri, 21 Aug 2009 17:04:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8826E19355; Fri, 21 Aug 2009 17:03:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B80041934C for ; Fri, 21 Aug 2009 17:03:45 -0300 (BRT) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090821200339.JPYZ5579.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Fri, 21 Aug 2009 21:03:39 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090821200336.XGQM13254.aamtaout01-winn.ispmail.ntl.com@STORE.store> for ; Fri, 21 Aug 2009 21:03:36 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id 6FD79B9E4 for ; Fri, 21 Aug 2009 21:08:15 +0100 (BST) Message-ID: <4A8EFD93.7080906@ntlworld.com> Date: Fri, 21 Aug 2009 21:03:31 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: table.remove in C api? References: <4A8EF9C2.8050501@ntlworld.com> <90eb1dc70908211255v7dc8e7een889485d5e24a6140@mail.gmail.com> In-Reply-To: <90eb1dc70908211255v7dc8e7een889485d5e24a6140@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=NLZqzBF-AAAA:8 a=qtHlIr5hBZPag-PofBoA:9 a=X8xl3a4dgM2XGlbAFFwA:7 a=ZAopg6jdeNOUt725W64ssmE6ncAA:4 a=_dQi-Dcv4p4A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > in C, use lua_pushnil() and lua_settable() or lua_rawset() Will that collect the key or could I end up with a large table of nil values ? (just checking!) and although unlikely what would happen if I wanted a table that contained nil values ie is nil some special construct and not just zero (again just need to be sure I understand what's happening) Thanks Chris Javier Guerra wrote: > On Fri, Aug 21, 2009 at 2:47 PM, Chris Camacho wrote: > >> I have a table indexed by pointers (lightuserdata) with userdata values >> to allow me to look up pointers and return userdata to Lua >> >> However in the userdata's __gc method I need to remove the >> pointer key from the table, there seems to be no analogue of >> table.remove(t,i) in lua's C api - or am I missing something obvious >> > > table.remove(t [,pos]) is handy for working with the array part of a > table, not the hash part where you're storing your userdatas (since > they're indexed by lightuserdatas and not small consecutive indexes). > > for the hash part, simply assign nil: t(yourlightuserdata)=nil > > in C, use lua_pushnil() and lua_settable() or lua_rawset() > > -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 17:06:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LK5xHE019799; Fri, 21 Aug 2009 17:06:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 585771935C; Fri, 21 Aug 2009 17:05:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s8.bay0.hotmail.com (bay0-omc1-s8.bay0.hotmail.com [65.54.246.80]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BCB019352 for ; Fri, 21 Aug 2009 17:05:27 -0300 (BRT) Received: from BAY121-W51 ([207.46.10.86]) by bay0-omc1-s8.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 21 Aug 2009 13:05:24 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_858b0766-112b-4d6f-ae96-1578f1b97516_" X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: RE: table.remove in C api? Date: Fri, 21 Aug 2009 13:05:24 -0700 Importance: Normal In-Reply-To: <4A8EFD93.7080906@ntlworld.com> References: <4A8EF9C2.8050501@ntlworld.com> <90eb1dc70908211255v7dc8e7een889485d5e24a6140@mail.gmail.com> <4A8EFD93.7080906@ntlworld.com> MIME-Version: 1.0 X-OriginalArrivalTime: 21 Aug 2009 20:05:24.0760 (UTC) FILETIME=[B867D180:01CA229A] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_858b0766-112b-4d6f-ae96-1578f1b97516_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If I recall correctly=2C there is no difference between a key with a 'nil' = value=2C and a nonexistent key. > Date: Fri=2C 21 Aug 2009 21:03:31 +0100 > From: c.camacho@ntlworld.com > To: lua@bazar2.conectiva.com.br > Subject: Re: table.remove in C api? >=20 > > in C=2C use lua_pushnil() and lua_settable() or lua_rawset() >=20 > Will that collect the key or could I end up with a large table of > nil values ? (just checking!) >=20 > and although unlikely what would happen if I wanted a table that > contained nil values ie is nil some special construct and not just zero > (again just need to be sure I understand what's happening) >=20 > Thanks > Chris >=20 >=20 > Javier Guerra wrote: > > On Fri=2C Aug 21=2C 2009 at 2:47 PM=2C Chris Camacho wrote: > > =20 > >> I have a table indexed by pointers (lightuserdata) with userdata value= s > >> to allow me to look up pointers and return userdata to Lua > >> > >> However in the userdata's __gc method I need to remove the > >> pointer key from the table=2C there seems to be no analogue of > >> table.remove(t=2Ci) in lua's C api - or am I missing something obvious > >> =20 > > > > table.remove(t [=2Cpos]) is handy for working with the array part of a > > table=2C not the hash part where you're storing your userdatas (since > > they're indexed by lightuserdatas and not small consecutive indexes). > > > > for the hash part=2C simply assign nil: t(yourlightuserdata)=3Dnil > > > > in C=2C use lua_pushnil() and lua_settable() or lua_rawset() > > > > =20 >=20 >=20 > --=20 > Disclaimer: > By sending an email to ANY of my addresses you are agreeing that: >=20 > 1. I am by definition=2C "the intended recipient" >=20 > 2. All information in the email is mine to do with as I see fit and > make such financial profit=2C political mileage=2C or good joke as it len= ds > itself to. In particular=2C I may quote it where I please. >=20 > 3. I may take the contents as representing the views of your company. >=20 > 4. This overrides any disclaimer or statement of confidentiality that > may be included on your message.=20 >=20 >=20 _________________________________________________________________ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=3DMSHYCB&publ=3DWLHMTAG&crea=3DTEXT_MSHYC= B_BackToSchool_Cashback_BTSCashback_1x1= --_858b0766-112b-4d6f-ae96-1578f1b97516_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
If I recall correctly=2C there is no difference between a key with a '= nil' value=2C and a nonexistent key.

>=3B Date: Fri=2C 21 Aug 20= 09 21:03:31 +0100
>=3B From: c.camacho@ntlworld.com
>=3B To: lua@= bazar2.conectiva.com.br
>=3B Subject: Re: table.remove in C api?
&g= t=3B
>=3B >=3B in C=2C use lua_pushnil() and lua_settable() or lua_= rawset()
>=3B
>=3B Will that collect the key or could I end up w= ith a large table of
>=3B nil values ? (just checking!)
>=3B
= >=3B and although unlikely what would happen if I wanted a table that
= >=3B contained nil values ie is nil some special construct and not just z= ero
>=3B (again just need to be sure I understand what's happening)>=3B
>=3B Thanks
>=3B Chris
>=3B
>=3B
>=3B J= avier Guerra wrote:
>=3B >=3B On Fri=2C Aug 21=2C 2009 at 2:47 PM=2C= Chris Camacho<=3Bc.camacho@ntlworld.com>=3B wrote:
>=3B >=3B =
>=3B >=3B>=3B I have a table indexed by pointers (lightuserdata) = with userdata values
>=3B >=3B>=3B to allow me to look up pointers= and return userdata to Lua
>=3B >=3B>=3B
>=3B >=3B>=3B H= owever in the userdata's __gc method I need to remove the
>=3B >=3B&= gt=3B pointer key from the table=2C there seems to be no analogue of
>= =3B >=3B>=3B table.remove(t=2Ci) in lua's C api - or am I missing somet= hing obvious
>=3B >=3B>=3B
>=3B >=3B
>=3B >=3B = table.remove(t [=2Cpos]) is handy for working with the array part of a
= >=3B >=3B table=2C not the hash part where you're storing your userdata= s (since
>=3B >=3B they're indexed by lightuserdatas and not small c= onsecutive indexes).
>=3B >=3B
>=3B >=3B for the hash part=2C= simply assign nil: t(yourlightuserdata)=3Dnil
>=3B >=3B
>=3B= >=3B in C=2C use lua_pushnil() and lua_settable() or lua_rawset()
>= =3B >=3B
>=3B >=3B
>=3B
>=3B
>=3B --
>= =3B Disclaimer:
>=3B By sending an email to ANY of my addresses you ar= e agreeing that:
>=3B
>=3B 1. I am by definition=2C "the inte= nded recipient"
>=3B
>=3B 2. All information in the email is = mine to do with as I see fit and
>=3B make such financial profit=2C po= litical mileage=2C or good joke as it lends
>=3B itself to. In particu= lar=2C I may quote it where I please.
>=3B
>=3B 3. I may take= the contents as representing the views of your company.
>=3B
>= =3B 4. This overrides any disclaimer or statement of confidentiality tha= t
>=3B may be included on your message.
>=3B
>=3B


Get back to school stuff for them and cashback for you. Try BingT now.= = --_858b0766-112b-4d6f-ae96-1578f1b97516_-- From lua-bounces@bazar2.conectiva.com.br Fri Aug 21 17:16:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7LKG30E022695; Fri, 21 Aug 2009 17:16:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3FDD18EA5; Fri, 21 Aug 2009 17:15:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5F1318E73 for ; Fri, 21 Aug 2009 17:15:30 -0300 (BRT) Received: by bwz10 with SMTP id 10so665018bwz.5 for ; Fri, 21 Aug 2009 13:15:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.102.170.12 with SMTP id s12mr662422mue.12.1250885727582; Fri, 21 Aug 2009 13:15:27 -0700 (PDT) In-Reply-To: <4A8EFD93.7080906@ntlworld.com> References: <4A8EF9C2.8050501@ntlworld.com> <90eb1dc70908211255v7dc8e7een889485d5e24a6140@mail.gmail.com> <4A8EFD93.7080906@ntlworld.com> Date: Fri, 21 Aug 2009 15:15:27 -0500 Message-ID: <90eb1dc70908211315i27bb562em492a4d66357a77be@mail.gmail.com> Subject: Re: table.remove in C api? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Aug 21, 2009 at 3:03 PM, Chris Camacho wrote: > Will that collect the key or could I end up with a large table of > nil values ? (just checking!) it will destroy the pair, making both the key and the (previous) value available for garbage collection. of course, a lightuserdata is an atomic value, which doesn't need any allocation/collection (just like a number, or a boolean) -- Javier From lua-bounces@bazar2.conectiva.com.br Sat Aug 22 23:21:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7N2LOjg027580; Sat, 22 Aug 2009 23:21:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0C7A18E65; Sat, 22 Aug 2009 23:20:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E5E918D35 for ; Sat, 22 Aug 2009 23:20:45 -0300 (BRT) Received: by fxm25 with SMTP id 25so1035325fxm.5 for ; Sat, 22 Aug 2009 19:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=vjDmCdrfOEp4GjVxR+muWiEiQnlNzJ3jgRXbUrpHO6I=; b=t/io03B8eLTQz/74+s9+sHzw72IFeRz2cK6HjeoTn/ZBnRQSfZkFNfOYbgg2t+qrPP x5JhhrXTEegBNmjIS6l0pK8lwNdW0AbZzmF40zN3F28VKEepUfJbfriurWrapeVkGKCk FtEuluCZM+h34guzixG9wXjGkp4ZH4fFKz7Pc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=BeBM+OCURomlTzcgnkGgZTVv+4kvRFp1IOTpc1kjx33/QX5kIkORR5hZE3tttH93At WvFOuHOFNrvJKAiCp3xEe7Bn12to20iYAy7Fri6tDUgSkioB+ku2/snjImcMKGCkuQTr JdRLjiy6Sdj0RF+MzcHq79wJZPTK/0Wnu3ZYA= MIME-Version: 1.0 Received: by 10.223.144.71 with SMTP id y7mr2305788fau.53.1250994043158; Sat, 22 Aug 2009 19:20:43 -0700 (PDT) From: Leaf Storm Date: Sat, 22 Aug 2009 22:20:23 -0400 Message-ID: Subject: [ANN] libmc To: Lua List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've been working for 3 months on a project I call libmc, which is a library of random cool stuff for Lua that I got used to having in Python like string splitting, table mapping, etc. Of course, so far, to my knowledge I have 0 downloads and I've been the only one committing, so I thought that announcing on lua-l would be a good way to get feedback. It currently has 55 functions (though 21 of them are wrappers for the operators). For simplicity, it loads a good degree of them into the 'math', 'string', and 'table' standard tables, with the rest going in the 'mc' table. It's at http://bitbucket.org/leafstorm/libmc/. I'd appreciate it if you checked it out and let me know what you thought. -- Regards, LeafStorm "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 09:53:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OCrpwF022105; Mon, 24 Aug 2009 09:53:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1E01190F7; Mon, 24 Aug 2009 09:53:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4A6D18D60 for ; Mon, 24 Aug 2009 09:53:09 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MfZ2n-0001Fz-7D for lua@bazar2.conectiva.com.br; Mon, 24 Aug 2009 14:53:05 +0200 Received: from c-76-104-160-178.hsd1.wa.comcast.net ([76.104.160.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Aug 2009 14:53:05 +0200 Received: from stuart by c-76-104-160-178.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Aug 2009 14:53:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: lua crashing on unrecognized strings Date: Mon, 24 Aug 2009 05:52:39 -0700 Lines: 10 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-104-160-178.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Using the lua.exe interpreter provided with Lua for Windows, passing any letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, M, S, U, or W-Z is causing to crash (as in "has encountered a problem and needs to close" crash). This also happens when calling io.open with any undefined format string. That can't be right, can it? (At the very least %C, %D, %e, %h, %n, %r, %R, %t, %T, %u, and %V should evaluate as they are defined in the standard (http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html).) From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 09:58:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OCwPxJ022959; Mon, 24 Aug 2009 09:58:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 120201912F; Mon, 24 Aug 2009 09:58:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2682819107 for ; Mon, 24 Aug 2009 09:57:59 -0300 (BRT) Received: from Stucomet (c-76-104-160-178.hsd1.wa.comcast.net [76.104.160.178]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1MfZ7Q3lAI-000D0m; Mon, 24 Aug 2009 08:57:56 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: lua crashing on unrecognized strings Date: Mon, 24 Aug 2009 05:57:49 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-Provags-ID: V01U2FsdGVkX1+hRxCjrVRuvfrcyqXFjwcVTYJSwuG6ZlQQ6VX utR3HAptUXBo1u0eWV6UjwuP48JM46CG2OUALsa1+MQ+aS3AjU bk6kCtxiakqZlxc7XIFOG76KbYRZQV2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yeah, http://www.lua.org/cgi-bin/demo works if you call os.date"%i". I've reported this on LuaForge. -------------------------------------------------- From: "Stuart P.Bentley" Sent: Monday, August 24, 2009 A5:52 Newsgroups: gmane.comp.lang.lua.general To: Subject: lua crashing on unrecognized strings > Using the lua.exe interpreter provided with Lua for Windows, passing any > letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, > M, S, U, or W-Z is causing to crash (as in "has encountered a problem and > needs to close" crash). This also happens when calling io.open with any > undefined format string. > > That can't be right, can it? (At the very least %C, %D, %e, %h, %n, %r, > %R, %t, %T, %u, and %V should evaluate as they are defined in the standard > (http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html).) > > From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 10:02:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OD2Q2r026312; Mon, 24 Aug 2009 10:02:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BF0619169; Mon, 24 Aug 2009 10:02:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 838521914C for ; Mon, 24 Aug 2009 10:02:00 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MfZBG-00052x-4K for ; Mon, 24 Aug 2009 14:01:50 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MfZBO-0000bQ-7r for lua@bazar2.conectiva.com.br; Mon, 24 Aug 2009 14:01:58 +0100 Date: Mon, 24 Aug 2009 14:01:57 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: lua crashing on unrecognized strings Message-ID: <20090824140157.64b1d95a@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 24 Aug 2009 05:52:39 -0700 "Stuart P.Bentley" wrote: > Using the lua.exe interpreter provided with Lua for Windows, passing > any letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, > B, H, I, M, S, U, or W-Z is causing to crash (as in "has encountered > a problem and needs to close" crash). This also happens when calling > io.open with any undefined format string. I seem to recall that this is a (rare) underspecification problem in C. Passing invalid format strings to some of the C functions that take them has undefined effects. Under Linux, (which the Lua demo runs), it results in something that lets the program continue. Under Windows, it results in an explosion. I believe there was some talk that the next Lua would check these strings before passing them to the C library, which while safer means you can't use extensions your C library provides from Lua. B. From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 10:04:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OD45wd026778; Mon, 24 Aug 2009 10:04:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28CCA19182; Mon, 24 Aug 2009 10:03:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2ABF619176 for ; Mon, 24 Aug 2009 10:03:38 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so499012eye.11 for ; Mon, 24 Aug 2009 06:03:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.195 with SMTP id c45mr963323wef.38.1251119017248; Mon, 24 Aug 2009 06:03:37 -0700 (PDT) In-Reply-To: References: Date: Mon, 24 Aug 2009 14:03:37 +0100 X-Google-Sender-Auth: be02c7ba1a3119ef Message-ID: Subject: Re: lua crashing on unrecognized strings From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean os.date is a wrapping around the strftime function provided by the C runtime. On windows, the Microsoft C runtime is typically used, so you'll want to consult the MSDN reference on strftime rather than one of the standard documents. Likewise, io.open wraps fopen, and if the underlying C runtime explodes on invalid input, then so will Lua. On Mon, Aug 24, 2009 at 1:52 PM, Stuart P.Bentley wrote: > Using the lua.exe interpreter provided with Lua for Windows, passing any > letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, > M, S, U, or W-Z is causing to crash (as in "has encountered a problem and > needs to close" crash). This also happens when calling io.open with any > undefined format string. > > That can't be right, can it? (At the very least %C, %D, %e, %h, %n, %r, %R, > %t, %T, %u, and %V should evaluate as they are defined in the standard > (http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html).) > > From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 10:04:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OD4dMG026949; Mon, 24 Aug 2009 10:04:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C1C1191B7; Mon, 24 Aug 2009 10:03:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 115CD19183 for ; Mon, 24 Aug 2009 10:03:45 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OD3h1g026689 for ; Mon, 24 Aug 2009 10:03:43 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7OD3gC13107; Mon, 24 Aug 2009 10:03:42 -0300 Date: Mon, 24 Aug 2009 10:03:41 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: lua crashing on unrecognized strings Message-ID: <20090824100341.A13077@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from stuart@testtrack4.com on Mon, Aug 24, 2009 at 05:52:39AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Using the lua.exe interpreter provided with Lua for Windows, passing any > letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, > M, S, U, or W-Z is causing to crash (as in "has encountered a problem and > needs to close" crash). This also happens when calling io.open with any > undefined format string. > > That can't be right, can it? (At the very least %C, %D, %e, %h, %n, %r, %R, > %t, %T, %u, and %V should evaluate as they are defined in the standard > (http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html).) This has been reported before (but not for io.open; thanks). See this thread: http://lua-users.org/lists/lua-l/2008-09/msg00146.html Unfortunately, the ANSI C standard allows implementations to crash when the behaviour is said to be undefined in the standard. And it seems that some Windows libraries take the easy way out. :-( (The reasonable behaviour here would be to ignore unsupported directives.) In 5.2 we'll be limited to the directives listed in ANSI C, even if the underlying C library supports the full POSIX set. Sad, I know. From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 10:40:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ODecKN001863; Mon, 24 Aug 2009 10:40:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2320F191C8; Mon, 24 Aug 2009 10:40:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2707A18A0C for ; Mon, 24 Aug 2009 10:40:02 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 9314AE20A6 for ; Mon, 24 Aug 2009 15:39:58 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a30Z-FanedJ9 for ; Mon, 24 Aug 2009 15:39:56 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 5705EE20A8; Mon, 24 Aug 2009 15:39:56 +0200 (CEST) Date: Mon, 24 Aug 2009 15:39:56 +0200 From: Ico To: Lua list Subject: Re: lua crashing on unrecognized strings Message-ID: <20090824133956.GH12637@pruts.nl> References: <20090824100341.A13077@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090824100341.A13077@lua.tecgraf.puc-rio.br> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-08-24 Luiz Henrique de Figueiredo wrote : > > Using the lua.exe interpreter provided with Lua for Windows, passing any > > letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, > > M, S, U, or W-Z is causing to crash (as in "has encountered a problem and > > needs to close" crash). This also happens when calling io.open with any > > undefined format string. > > In 5.2 we'll be limited to the directives listed in ANSI C, even if the > underlying C library supports the full POSIX set. Sad, I know. Would it not be possible to make this configurable at build time ? If the 'posix' target is chosen to build the lua sources, it would be sane to allow POSIX directives to be used, imho. Ico -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 10:52:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7ODqTHx005027; Mon, 24 Aug 2009 10:52:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4400191F2; Mon, 24 Aug 2009 10:52:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 143CC191E8 for ; Mon, 24 Aug 2009 10:52:04 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7ODq3h9022774 for ; Mon, 24 Aug 2009 10:52:03 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id DF63A54C211; Mon, 24 Aug 2009 10:52:03 -0300 (BRT) Date: Mon, 24 Aug 2009 10:52:03 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: lua crashing on unrecognized strings Message-ID: <20090824135203.GB23228@inf.puc-rio.br> References: <20090824100341.A13077@lua.tecgraf.puc-rio.br> <20090824133956.GH12637@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090824133956.GH12637@pruts.nl> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > * On 2009-08-24 Luiz Henrique de Figueiredo wrote : > > > > Using the lua.exe interpreter provided with Lua for Windows, passing any > > > letter to (os.date("%"..letter)) other than a-d, j, m, p, w-z, A, B, H, I, > > > M, S, U, or W-Z is causing to crash (as in "has encountered a problem and > > > needs to close" crash). This also happens when calling io.open with any > > > undefined format string. > > > > In 5.2 we'll be limited to the directives listed in ANSI C, even if the > > underlying C library supports the full POSIX set. Sad, I know. > > Would it not be possible to make this configurable at build time ? If > the 'posix' target is chosen to build the lua sources, it would be sane > to allow POSIX directives to be used, imho. It will be. luaconf.h will have the following macros that control the valid options: #define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYz%" #define LUA_STRFTIMEPREFIX "" -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 11:04:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OE3ri5008148; Mon, 24 Aug 2009 11:03:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB9C7190F9; Mon, 24 Aug 2009 11:03:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DB4D18C94 for ; Mon, 24 Aug 2009 11:03:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so2650549ewy.5 for ; Mon, 24 Aug 2009 07:03:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.115.15 with SMTP id n15mr3019143ebc.6.1251122602754; Mon, 24 Aug 2009 07:03:22 -0700 (PDT) Date: Mon, 24 Aug 2009 16:03:22 +0200 X-Google-Sender-Auth: b3f566798d2ecd87 Message-ID: Subject: Can't upload on LuaForge From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7OE3ri5008148 Hi, I try to update some HTML files (total 20 Kb) on lua-coat.luaforge.net with ftp. I obtain the following error : 452 Transfert aborted. No space left on device Now, all my HTML files are empty (size 0). François. From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 14:13:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OHDB6v023724; Mon, 24 Aug 2009 14:13:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFD73191F2; Mon, 24 Aug 2009 14:12:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 189B2190F9 for ; Mon, 24 Aug 2009 14:12:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so2855208ewy.5 for ; Mon, 24 Aug 2009 10:12:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.133.17 with SMTP id g17mr5504846ebd.9.1251133946701; Mon, 24 Aug 2009 10:12:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 24 Aug 2009 19:12:26 +0200 X-Google-Sender-Auth: 681c78d9225961f9 Message-ID: Subject: Re: Can't upload on LuaForge From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7OHDB6v023724 2009/8/24 François Perrad : > Hi, > > I try to update some HTML files (total 20 Kb) on lua-coat.luaforge.net with ftp. > I obtain the following error : > 452 Transfert aborted. No space left on device > Now, it's OK. > Now, all my HTML files are empty (size 0). > > François. > From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 14:15:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OHF15b024330; Mon, 24 Aug 2009 14:15:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49D7D1926F; Mon, 24 Aug 2009 14:14:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42FDB1923D for ; Mon, 24 Aug 2009 14:14:30 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so547902eye.11 for ; Mon, 24 Aug 2009 10:14:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.51.10 with SMTP id y10mr2847712eby.44.1251134066476; Mon, 24 Aug 2009 10:14:26 -0700 (PDT) Date: Mon, 24 Aug 2009 19:14:24 +0200 X-Google-Sender-Auth: 931d1da3577cc49b Message-ID: Subject: [ANN] lua-Coat 0.5.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), a Perl module which mimics Moose (http://www.iinteractive.com/moose/), an object system for Perl5 which borrows features from Perl6, CLOS (LISP), Smalltalk and many other languages. The main features are : Classes, Roles & type constraints. The attribute declaration with many properties is the most powerful and flexible part of lua-Coat. This release comes with a new syntax more luaesque. The homepage is at http://lua-coat.luaforge.net/, and the sources are hosted at http://github.com/fperrad/lua-Coat/. Comment, bug report, patch are welcome. Thanks, Francois Perrad. From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 15:19:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OIJGEV013103; Mon, 24 Aug 2009 15:19:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C7BF191F2; Mon, 24 Aug 2009 15:18:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7074B190FD for ; Mon, 24 Aug 2009 15:18:35 -0300 (BRT) Received: by bwz10 with SMTP id 10so1681332bwz.5 for ; Mon, 24 Aug 2009 11:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=M1Xrt3k8QnVODjMC8uYV8P0wNM2bfE6LJEzSrTAifnI=; b=f7Moo8t8lieUEFihL9zmt6+N3L3C9BnhRs47CqICWo1CRc/XhhXtC+xsxBUdK7B1V9 K7dN3/fWIrtqN7lvwO/lmdv48M7i8UMIBXOyFduES1Hiat2S/o2XQfGqYyLAcs+EYz/M tsvVsQC3pTuFt/SB6pKKA3dgX4UAtssNhPZpI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=OeaxGBuisaWTs2n2XAa+5YhIBlj38lGLnwcg/qpl6JYz3+5b8OMowLR0AKZIH8e2N3 jbUzu0LRime+PrKMBLPLK1GVPDLyKQnFwMlGglyXxZcnWjUH2bULfaTmxkiUfmhb8eY0 z3w9r2rtPJuzDrcO8UfVNwHhEeuBaHmoueUyw= MIME-Version: 1.0 Received: by 10.223.144.204 with SMTP id a12mr5070371fav.49.1251137912907; Mon, 24 Aug 2009 11:18:32 -0700 (PDT) Date: Mon, 24 Aug 2009 22:18:32 +0400 Message-ID: Subject: Nested file:lines() From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, list! OS X 10.5.8 Lua 5.1.4 Most likely this was discussed earlier (or even is documented somewhere in the manual; or I'm doing something wrong :-) ). I'm experiencing unexpected (by me) behaviour when nesting file:lines() calls for the same file: $ jot 3 >123.txt $ cat >123.lua local f = assert(io.open("123.txt")) for l in f:lines() do print("O", l) for ll in f:lines() do -- Use the same file handle print("i", ll) end end $ lua 123.lua O 1 i 2 i 3 Looks like lines iterator is shared for all :lines() calls. Not sure if it is necessarily wrong, but perhaps it should be documented (am I missed it?) But what if I'd open two file handles for the same file? $ cat >123-1.lua local f = assert(io.open("123.txt")) local ff = assert(io.open("123.txt")) for l in f:lines() do print("O", l) for ll in ff:lines() do print("i", ll) end end $ lua 123-1.lua O 1 i 1 i 2 i 3 O 2 O 3 Looks like subsequent calls for :lines() on the same handle are ignored. Indeed: (IMO, this fact should be documented as well.) $ cat >123-2.lua local f = assert(io.open("123.txt")) for l in f:lines() do print("O", l) end for l in f:lines() do print("i", ll) end $ lua 123-2.lua O 1 O 2 O 3 So, the correct way is to re-open nested file handles on each: $ cat >123-3.lua local f = assert(io.open("123.txt")) for l in f:lines() do print("O", l) local ff = assert(io.open("123.txt")) for ll in ff:lines() do print("i", ll) end end $ lua 123-3.lua O 1 i 1 i 2 i 3 O 2 i 1 i 2 i 3 O 3 i 1 i 2 i 3 Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 17:48:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OKmPFj024710; Mon, 24 Aug 2009 17:48:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF9C9192A7; Mon, 24 Aug 2009 17:47:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D3411929F for ; Mon, 24 Aug 2009 17:47:40 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 10976 invoked from network); 24 Aug 2009 22:47:33 +0200 Received: from miko.ras.wp-sa.pl (HELO [192.168.254.110]) (miko@[212.77.97.9]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 24 Aug 2009 22:47:33 +0200 Message-ID: <4A92FC64.8010206@wp.pl> Date: Mon, 24 Aug 2009 22:47:32 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: Nested file:lines() References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [QSMk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > local f = assert(io.open("123.txt")) > for l in f:lines() do Firs of all, I am wondering why it works ion the first place. According to the manual, you need io.lines(filename), not io.lines(filehandle)! If it works with filehandle, it is not documented, so the behaviour in unexpected. > Looks like subsequent calls for :lines() on the same handle are ignored. As it is with other iterators, which - when finished - return nil. This is expected. > So, the correct way is to re-open nested file handles on each: The io.lines() manual says: "When the iterator function detects the end of file, it returns nil (to finish the loop) and automatically closes the file.". So I am expecting the behaviour you observe. You seem to expect that after the end of file, iterator closes and reopens the file, rewinding to the beginning. But it is not true, if you want to read the file many times in your internal loop, you need to open it many times, as you have just noticed. Regards, miko From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 17:54:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OKs2D1026357; Mon, 24 Aug 2009 17:54:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEF02192A8; Mon, 24 Aug 2009 17:53:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10E1D190D3 for ; Mon, 24 Aug 2009 17:53:32 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KOW00LSAFC8Y2A0@asmtp015.mac.com> for lua@bazar2.conectiva.com.br; Mon, 24 Aug 2009 13:53:29 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <4A92FC64.8010206@wp.pl> Subject: Re: Nested file:lines() Date: Mon, 24 Aug 2009 22:52:55 +0200 References: <4A92FC64.8010206@wp.pl> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 24, 2009, at 10:47 PM, Michal Kolodziejczyk wrote: > Firs of all, I am wondering why it works ion the first place. > According > to the manual, you need io.lines(filename), not io.lines(filehandle)! > If it works with filehandle, it is not documented, so the behaviour in > unexpected. io.lines( filehandle ) == filehandle:lines() http://www.lua.org/manual/5.1/manual.html#pdf-file:lines From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 18:04:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OL4PTT029379; Mon, 24 Aug 2009 18:04:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C90B8192B4; Mon, 24 Aug 2009 18:04:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 414A8192B1 for ; Mon, 24 Aug 2009 18:03:54 -0300 (BRT) Received: by fxm25 with SMTP id 25so1781483fxm.5 for ; Mon, 24 Aug 2009 14:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=zYt4MLwO8rmCYk/TdUtwID6lksrCRfQ48eB5/8ceCJU=; b=DibsijoRrvesxgmVHQ1oqL4Yg/yICsIhJu9UqZfrDp75gxKoVdUZEQgf+xHbQ7IDFa 5JJJbEsnMtDZotxfrbFUUw5Rn8K5jtOUZxt7tLwyv7iMSlqqfWJ9DbOxdUxmslCL0vo0 UiYKWBzmZ+MZNLS2TraygITV6cIW+VBrs6zT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=e0FYLooQtIqTEtvqQ3t+e+WbQ4j8f8/Ht5ylDKq/aDEoCe12OAe5naitnjL6iQWfL+ MO1l5QwWfToUipLHIEJ6VusrQvrgsMcriAbfv6+ouO83kdaj+TU/0CJsC83yBOB84jED tFEBwmZqoDmGgRu7t3t4u/5DpVJSO+E5Z4PI0= Received: by 10.86.211.38 with SMTP id j38mr3646427fgg.26.1251147830397; Mon, 24 Aug 2009 14:03:50 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id 12sm10036408fgg.15.2009.08.24.14.03.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 24 Aug 2009 14:03:49 -0700 (PDT) Message-Id: <3C579585-990B-4EE5-A3E2-3FF0EC87570A@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Nested file:lines() Date: Mon, 24 Aug 2009 23:03:18 +0200 References: <4A92FC64.8010206@wp.pl> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Aug 24, 2009, at 10:52 PM, Petite Abeille wrote: > io.lines( filehandle ) == filehandle:lines() Ooops... my bad... the above is simply not true... io.lines() and file:lines() are two totally different beasts :) From lua-bounces@bazar2.conectiva.com.br Mon Aug 24 19:25:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7OMPOqI011449; Mon, 24 Aug 2009 19:25:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DA59192BA; Mon, 24 Aug 2009 19:24:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from centaury.net-core.org (centaury.net-core.org [91.121.98.194]) by bazar2.conectiva.com.br (Postfix) with SMTP id BA6AE192A5 for ; Mon, 24 Aug 2009 19:24:44 -0300 (BRT) X-Tethys-FixMail: date_replace,tethys-smtp-envelope X-Tethys-SMTP-Envelope: From: darkgod@t-o-m-e.net To: lua@bazar2.conectiva.com.br Date: 25 Aug 2009 00:24:37 +0200 Received: from localhost by centaury.net-core.org (Tethys SMTP) ; 25 Aug 2009 00:24:37 +0200 X-Tethys-Original-Date: Tue, 25 Aug 2009 00:24:34 +0200 From: DarkGod To: lua@bazar2.conectiva.com.br Subject: Lanes + Socket (mini patch) Message-ID: <20090825002434.4fa3de2d@t-o-m-e.net> Organization: ToME X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/JPK/NU_C0fGbRLxhM3fvjE6" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --MP_/JPK/NU_C0fGbRLxhM3fvjE6 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, *Warning* This is probably a boring tale of my experiments, but I though it could help others so ... :) If you just want to see how to use lanes + sockets, go at the bottom. In my never-ending quest to make http://mailcatch.com handle more incoming mails with less cpu usage I have tested many ways to handle a multitude of sockets which all send data to the same storage. At first I used lua coroutines with Loop scheduler mechanism but it was quickly eating up cpu. Then I tried copas scheduler, it was a bit faster but still not enough for the growing incoming mails count. I tried to write my own scheduler, with as less checks as possible to make it faster but not much was gained there. Then I gave up and tried with a forking daemon. It was much better and could handle more mails, but a problem was accessing a common storage. In the previous versions I simply used some tables but with a forking daemon it was pointless. I have tried using memcached and even a RamFS mounted somewhere in the filesystem. The later option worked pretty good but forced me to use file locks and when under some pressure it happened to fail sometimes. So for the N'th time I've tried my hand at lua threading and this time, it works! For that I have used Lua Lanes, a neat threading library indeed. It spawns a few tens or hundreds of worker threads at boot and they all wait for a linda key. An other thread is responsible for the storage which thus can go back inside the program's memory (this removes the need to serialize data, thus increasing speed even more). And the main thread is a classic infinite socket accept loop. But now luasocket accept() function returns a socket objects, which lanes can't pass through linda objects to worker threads. So I modified luasocket source to allow two very small changes (I would be so happy should they be included upstream): * a new acceptfd() method that returns the file descriptor of the socket instead of a socket object * the tcp() constructor takes an optional parameter which is a file descriptor and construct a client socket directly from it I have attached the patch and a Very-Quick-Dirty-Simple-Example (which just spawns a new thread for each incoming connection, this is less optimal as it will require a new lua state+loading of all required libraries for each connections). Well, I've bothered you all too long, if you like my patch I'm happy. If you include it in luasocket I'm even happier. If you have a better solution, I'm EVEN happier :) --MP_/JPK/NU_C0fGbRLxhM3fvjE6 Content-Type: text/x-patch; name=luasocket_fd.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=luasocket_fd.patch --- luasocket-2.0.2/src/tcp.c 2007-10-15 06:21:05.000000000 +0200 +++ luasocket-2.0.2.new/src/tcp.c 2009-08-24 23:58:47.000000000 +0200 @@ -30,6 +30,7 @@ static int meth_shutdown(lua_State *L); static int meth_receive(lua_State *L); static int meth_accept(lua_State *L); +static int meth_acceptfd(lua_State *L); static int meth_close(lua_State *L); static int meth_setoption(lua_State *L); static int meth_settimeout(lua_State *L); @@ -42,6 +43,7 @@ {"__gc", meth_close}, {"__tostring", auxiliar_tostring}, {"accept", meth_accept}, + {"acceptfd", meth_acceptfd}, {"bind", meth_bind}, {"close", meth_close}, {"connect", meth_connect}, @@ -186,6 +188,27 @@ } /*-------------------------------------------------------------------------*\ +* Waits for and returns a client object attempting connection to the +* server object +\*-------------------------------------------------------------------------*/ +static int meth_acceptfd(lua_State *L) +{ + p_tcp server = (p_tcp) auxiliar_checkclass(L, "tcp{server}", 1); + p_timeout tm = timeout_markstart(&server->tm); + t_socket sock; + int err = socket_accept(&server->sock, &sock, NULL, NULL, tm); + /* if successful, push client socket */ + if (err == IO_DONE) { + lua_pushnumber(L, sock); + return 1; + } else { + lua_pushnil(L); + lua_pushstring(L, socket_strerror(err)); + return 2; + } +} + +/*-------------------------------------------------------------------------*\ * Binds an object to an address \*-------------------------------------------------------------------------*/ static int meth_bind(lua_State *L) @@ -316,12 +339,19 @@ static int global_create(lua_State *L) { t_socket sock; - const char *err = inet_trycreate(&sock, SOCK_STREAM); + const char *err = NULL; + int fd = luaL_optnumber(L, 1, -1); + if (fd < 1) + err = inet_trycreate(&sock, SOCK_STREAM); + else + sock = fd; /* try to allocate a system socket */ if (!err) { /* allocate tcp object */ p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); - /* set its type as master object */ + if (fd >= 1) + auxiliar_setclass(L, "tcp{client}", -1); + else auxiliar_setclass(L, "tcp{master}", -1); /* initialize remaining structure fields */ socket_setnonblocking(&sock); --MP_/JPK/NU_C0fGbRLxhM3fvjE6 Content-Type: text/x-lua; name=server.lua Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=server.lua require 'lanes' require 'socket' local linda = lanes.linda() function handler(fd) require'socket' local sock = socket.tcp(fd) local line = sock:receive("*l") linda:send("order", {line=line}) sock:send("line: "..tostring(line).." \n") sock:close() return "done" end function main_thread() while true do local order = linda:receive(3, "order") if order then print("order", order.line) end end end function run() local s = socket.bind("0.0.0.0", 2525) local threads = {} lanes.gen("*", main_thread)() while true do local fd = s:acceptfd() threads[lanes.gen("*", handler)(fd)] = fd print("threads:") for h, s in pairs(threads) do print(" * ", h, " :=: ", h.status) local v, err = h:join(0) if not v and err then print(err) elseif v and v == "done" then threads[h] = nil end end end end run() --MP_/JPK/NU_C0fGbRLxhM3fvjE6-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 04:39:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7P7d06f013094; Tue, 25 Aug 2009 04:39:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95B87192C7; Tue, 25 Aug 2009 04:38:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AF6F192B3 for ; Tue, 25 Aug 2009 04:38:18 -0300 (BRT) Received: by bwz10 with SMTP id 10so1980297bwz.5 for ; Tue, 25 Aug 2009 00:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=c1kw2pGrfCP/rzDwTt1e+GRx9nDYg1nTjKaIrFNxSxU=; b=Eq4podIQcfwJ0Vsj2pkmdtOyOWsnoSPmU+Y0woyZXb5Xgnsps0MIY42KtOlYN6KPP9 vAFSV2GsrHOMG6YKUmJaBf0oOfGRnzB8jml1MI/yCWYwz5lIUf8cLhTv3/GmKnzV872E mB03rIaav4/nYHjml7wAvfEmFyex3YvQEbY+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FCKHjxz402MA0GYRbOG+Eqa2e7bAOR5/HbSU5xf8sCOlaA6xsJAZsLVkkWloX5sp97 VE5xTXSwmZ2qAp/MnIWfcf2ai/epryK3G1/uBSYsi3r+iVPovJgZ9+PcLa85tqGmFpDn P8NH1pYOOtygF9dLqJ+XUJzJvMulhBAMO7+V8= MIME-Version: 1.0 Received: by 10.223.132.204 with SMTP id c12mr5250690fat.80.1251185895735; Tue, 25 Aug 2009 00:38:15 -0700 (PDT) In-Reply-To: <4A92FC64.8010206@wp.pl> References: <4A92FC64.8010206@wp.pl> Date: Tue, 25 Aug 2009 11:38:15 +0400 Message-ID: Subject: Re: Nested file:lines() From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/8/25 Michal Kolodziejczyk : > Alexander Gladysh wrote: >> local f = assert(io.open("123.txt")) >> for l in f:lines() do > Firs of all, I am wondering why it works ion the first place. According > to the manual, you need io.lines(filename), not io.lines(filehandle)! > If it works with filehandle, it is not documented, so the behaviour in > unexpected. There is file:lines() and there is io.lines() -- two different functions, behaving slightly differently. http://www.lua.org/manual/5.1/manual.html#pdf-io.lines http://www.lua.org/manual/5.1/manual.html#pdf-file:lines >> Looks like subsequent calls for :lines() on the same handle are ignored. > As it is with other iterators, which - when finished - return nil. This > is expected. Hm. I'm not sure I get you correctly. I always thought that, in this case, iterator is that :lines() returns, not the function itself. After all, each call to pairs() always return new iterator. Not? >> So, the correct way is to re-open nested file handles on each: > The io.lines() manual says: "When the iterator function detects the end > of file, it returns nil (to finish the loop) and automatically closes > the file.". Yes, indeed, for io.lines(). But I'm using file.lines(), for which the manual explicitly states (see link above): Unlike io.lines, this function does not close the file when the loop ends. It looks like while file.lines perhaps does not close the file, it does not seek it back to beginning. Furthermore, it looks like all iterators to the same file do use the same file position pointer. > So I am expecting the behaviour you observe. You seem to expect that > after the end of file, iterator closes and reopens the file, rewinding > to the beginning. But it is not true, if you want to read the file many > times in your internal loop, you need to open it many times, as you have > just noticed. See above. Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 06:19:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7P9Jr8J023234; Tue, 25 Aug 2009 06:19:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26E9419330; Tue, 25 Aug 2009 06:19:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id D99D219327 for ; Tue, 25 Aug 2009 06:19:17 -0300 (BRT) Received: (qmail invoked by alias); 25 Aug 2009 09:19:14 -0000 Received: from p54903C1F.dip.t-dialin.net (EHLO [192.100.105.98]) [84.144.60.31] by mail.gmx.net (mp068) with SMTP; 25 Aug 2009 11:19:14 +0200 X-Authenticated: #114304 X-Provags-ID: V01U2FsdGVkX19yhxImGWNyF2ZDaU1P83s7dONW2HSzAOoWYznEmx gZ/evY7IUOUSCP Message-ID: <4A93ACAF.6070008@gmx.net> Date: Tue, 25 Aug 2009 11:19:43 +0200 From: Andrew Cannon User-Agent: Thunderbird 2.0.0.16 (X11/20080720) MIME-Version: 1.0 To: Lua list Subject: Re: Nested file:lines() References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Alexander, this is nothing to do with Lua. It's just that the underlying operating system (or C library) only maintains one file pointer per open file descriptor. Once you've iterated through the file the file pointer is at the end of file and subsequent calls to :lines() will return an iterator which starts at the end of file! When you reopen the file the file pointer is back at the beginning (your last example)... but don't forget to close the inner file, otherwise the used FD will remain open and you'll soon run out of available FDs: local f = assert(io.open("123.txt")) for l in f:lines() do print("O", l) local ff = assert(io.open("123.txt")) for ll in ff:lines() do print("i", ll) end ff:close() end f:close() Of course then you might as well use io.lines() which implicitly opens and closes the file for you: for l in io.lines("123.txt") do print("O", l) for ll in io.lines("123.txt") do print("i", ll) end end A bit more efficient would be to rewind the inner FD rather than reopening the file each time through the outer loop: local f = assert(io.open("123.txt")) local ff = assert(io.open("123.txt")) for l in f:lines() do print("O", l) ff:seek"set" -- rewind ff to start (first time is redundant) for ll in ff:lines() do print("i", ll) end end ff:close() f:close() ... or if the input file is not too big why not read the whole thing into memory and process it from there, eg: local t = {} for l in io.lines("123.txt") do table.insert(t, l) end for _,l in ipairs(t) do print("O", l) for _,ll in ipairs(t) do print("i", ll) end end Then the program will also work for non-seekable inputs such as TTYs or network sockets. Cheers Andrew Alexander Gladysh wrote: > Hi, list! > > OS X 10.5.8 > Lua 5.1.4 > > Most likely this was discussed earlier (or even is documented > somewhere in the manual; or I'm doing something wrong :-) ). > > I'm experiencing unexpected (by me) behaviour when nesting > file:lines() calls for the same file: > > $ jot 3 >123.txt > > $ cat >123.lua > local f = assert(io.open("123.txt")) > for l in f:lines() do > print("O", l) > for ll in f:lines() do -- Use the same file handle > print("i", ll) > end > end > > $ lua 123.lua > O 1 > i 2 > i 3 > > Looks like lines iterator is shared for all :lines() calls. Not sure > if it is necessarily wrong, but perhaps it should be documented (am I > missed it?) > > But what if I'd open two file handles for the same file? > > $ cat >123-1.lua > local f = assert(io.open("123.txt")) > local ff = assert(io.open("123.txt")) > for l in f:lines() do > print("O", l) > for ll in ff:lines() do > print("i", ll) > end > end > > $ lua 123-1.lua > O 1 > i 1 > i 2 > i 3 > O 2 > O 3 > > Looks like subsequent calls for :lines() on the same handle are ignored. > > Indeed: (IMO, this fact should be documented as well.) > > $ cat >123-2.lua > local f = assert(io.open("123.txt")) > > for l in f:lines() do > print("O", l) > end > > for l in f:lines() do > print("i", ll) > end > > $ lua 123-2.lua > O 1 > O 2 > O 3 > > So, the correct way is to re-open nested file handles on each: > > $ cat >123-3.lua > local f = assert(io.open("123.txt")) > for l in f:lines() do > print("O", l) > local ff = assert(io.open("123.txt")) > for ll in ff:lines() do > print("i", ll) > end > end > > $ lua 123-3.lua > O 1 > i 1 > i 2 > i 3 > O 2 > i 1 > i 2 > i 3 > O 3 > i 1 > i 2 > i 3 > > Alexander. > From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 07:53:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PArU5P032120; Tue, 25 Aug 2009 07:53:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC90319338; Tue, 25 Aug 2009 07:52:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50E8219331 for ; Tue, 25 Aug 2009 07:52:53 -0300 (BRT) Received: by fxm25 with SMTP id 25so2084359fxm.5 for ; Tue, 25 Aug 2009 03:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1gSNBNZuD4RvHH+91ai/frw6fWWDwIW84YCcpcGLBTw=; b=UrnozttwOKSvpG+djZLVM7nJ/n7cQUnnZUl8Z8j8uGdRc/pX1JFB33+TLGiPfWOad2 Motx/3XoyZp0CPuw7dB4FEaRUKmTs02oFKrNfOqQJlYjij11rVf5QpoXmQMhsRORCK6e PIxPm1ZlEjsQsQ43+nInfVMia2Dq1x7gW9RhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=i3VNKctLqE9YIaV27/GCbZEwCwMdh5InBeIbbjDmCcafdCKCb1f/bgMAIvw+AzF5EK gqiTK3JjUq2VbXamSSwppyOJxBC1Yo+DBSFK7+HAadb4xn8FymUV5uruJwZGj1sc6K/w uw0jH5PWqrziyveAvBuPF5Z7GnGl/UsRMe/jY= MIME-Version: 1.0 Received: by 10.103.125.17 with SMTP id c17mr2597259mun.16.1251197569888; Tue, 25 Aug 2009 03:52:49 -0700 (PDT) In-Reply-To: <20090814143144.GB2704@alfa.qvirt.zxc> References: <20090814143144.GB2704@alfa.qvirt.zxc> Date: Tue, 25 Aug 2009 12:52:49 +0200 Message-ID: Subject: Re: lua-gtk pixmap example From: Wolfgang Oertl To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Martin, I've just now seen your message. Please get the current code from CVS, the pixmap example now draws a colored rectangle, too. Haven't looked into the fonts yet... Cheers, Wolfgang From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 09:15:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PCFHA9011817; Tue, 25 Aug 2009 09:15:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E55B18CE2; Tue, 25 Aug 2009 09:14:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF3D018BB3 for ; Tue, 25 Aug 2009 09:14:40 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7PCEbLI008591 for ; Tue, 25 Aug 2009 09:14:39 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id E4DF854C211; Tue, 25 Aug 2009 09:14:36 -0300 (BRT) Date: Tue, 25 Aug 2009 09:14:36 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Nested file:lines() Message-ID: <20090825121436.GD10100@inf.puc-rio.br> References: <4A92FC64.8010206@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > It looks like while file.lines perhaps does not close the file, it > does not seek it back to beginning. Furthermore, it looks like all > iterators to the same file do use the same file position pointer. It is just like reading the lines of a file. When you read up to the last line, you reach the end of the file. That neither closes the file nor seeks it back. What may be confusing is that we use "file" for "file handle" (or "stream" in C, even though they are denoted by FILE*.) All iterators to the same file handle use the same file handle and therefore share the file position (which is an attribute of the handle, not of the file). If you create an iterator to the same file but with a different file handle (e.g., calling 'fopen' again) it will have its own file position. -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 10:43:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PDgv87028643; Tue, 25 Aug 2009 10:42:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3EE519353; Tue, 25 Aug 2009 10:41:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out6.iinet.net.au (outbound.icp-qv1-irony-out6.iinet.net.au [203.59.1.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC7D818BA1 for ; Tue, 25 Aug 2009 10:41:39 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAAeHk0rL1kkT/2dsb2JhbACCLCrVEYQaBQ X-IronPort-AV: E=Sophos;i="4.44,272,1249228800"; d="scan'208,217";a="55774" Received: from unknown (HELO tigereye) ([203.214.73.19]) by outbound.icp-qv1-irony-out6.iinet.net.au with ESMTP; 25 Aug 2009 21:41:32 +0800 From: "John C. Turnbull" To: "'Lua list'" Subject: Basic problem with Kahlua Date: Tue, 25 Aug 2009 23:41:32 +1000 Message-ID: <00fc01ca2589$c2018ff0$4604afd0$@com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00FD_01CA25DD.93AD9FF0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acolib+451DH2DnESE+h4ZyrF1D/5A== Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00FD_01CA25DD.93AD9FF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I am just having a look at Kahlua but I cannot get the basic things to work. I am trying to call one of my Java methods from within Lua and my code looks like this: final LuaState state = new LuaState(System.out); UserdataArray.register(state); OsLib.register(state); LuaCompiler.register(state); final LuaTable john = new LuaTableImpl(); state.getEnvironment().rawset("john", john); john.rawset("m1", this); john.rawset("__index", john); state.setUserdataMetatable(KahluaTest.class, john); try { final LuaClosure closure = LuaCompiler.loadstring("function doIt() john.m1(42) end", "doIt", state .getEnvironment()); final Object runTest = state.getEnvironment().rawget("doIt"); BaseLib.luaAssert(runTest != null, "Could not find doIt"); final Object[] results = state.pcall(runTest, new Object[] {closure}); } catch (final Exception e) { KahluaTest.logger.error(e); } Where "john" is the name of the function library and "m1" is the function I am trying to call. Well, it never gets to even try to call it as the code above fails on the line where BaseLib.luaAssert() (5 lines from the bottom) is being called to check for the existence of the function doIt. No errors are returned from the Lua compiler so why can't it find "doIt" in the environment? As you can probably tell, I don't know much about Lua as I have not used it before. Thanks, John ------=_NextPart_000_00FD_01CA25DD.93AD9FF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I am just having a look at Kahlua but I cannot get = the basic things to work.

 

I am trying to call one of my Java methods from = within Lua and my code looks like this:

 

         &n= bsp;  final = LuaState state = =3D = new = LuaState(System.out);

         &n= bsp;  UserdataArray.register(state);

         &n= bsp;  OsLib.register(state);

         &n= bsp;  LuaCompiler.register(state);

 

         &n= bsp;  final = LuaTable john = =3D = new = LuaTableImpl();

         &n= bsp;  state.getEnvironment().rawset("john", = john);

         &n= bsp;  john.rawset("m1", = this);

 

         &n= bsp;  john.rawset("__index", = john);

         &n= bsp;  state.setUserdataMetatable(KahluaTest.class, = john);

 

         &n= bsp;  try = {

         &n= bsp;        final = LuaClosure closure = =3D

         &n= bsp;            LuaCompiler.loadstring("function doIt() john.m1(42) = end", = "doIt", = state

         &n= bsp;        =         .getEnvironment());

         &n= bsp;        final Object = runTest = =3D = state.getEnvironment().rawget("doIt");

         &n= bsp;        BaseLib.luaAssert(runTest = !=3D = null, = "Could not find doIt");

         &n= bsp;        final = Object[] = results = =3D = state.pcall(runTest, = new = Object[] = {closure});

         &n= bsp;  } = catch = (final = Exception e) = {

         &n= bsp;        KahluaTest.logger.error(e);

         &n= bsp;  }

 

Where “john” is the name of the = function library and “m1” is the function I am trying to call.  Well, it = never gets to even try to call it as the code above fails on the line where BaseLib.luaAssert()  (5 lines from the bottom) is being called to = check for the existence of the function doIt.

 

No errors are returned from the Lua compiler so why = can’t it find “doIt” in the environment?  As you can probably = tell, I don’t know much about Lua as I have not used it = before.

 

Thanks,

 

John

------=_NextPart_000_00FD_01CA25DD.93AD9FF0-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 10:49:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PDnj9f030288; Tue, 25 Aug 2009 10:49:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C702419361; Tue, 25 Aug 2009 10:49:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E83621935D for ; Tue, 25 Aug 2009 10:49:13 -0300 (BRT) Received: by ewy26 with SMTP id 26so3588680ewy.5 for ; Tue, 25 Aug 2009 06:49:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.26.82 with SMTP id b60mr1256646wea.177.1251208151971; Tue, 25 Aug 2009 06:49:11 -0700 (PDT) In-Reply-To: <00fc01ca2589$c2018ff0$4604afd0$@com.au> References: <00fc01ca2589$c2018ff0$4604afd0$@com.au> Date: Tue, 25 Aug 2009 14:49:11 +0100 X-Google-Sender-Auth: 3fd7f8e1bbd51232 Message-ID: Subject: Re: Basic problem with Kahlua From: Peter Cawley To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7PDnj9f030288 On Tue, Aug 25, 2009 at 2:41 PM, John C. Turnbull wrote: >                   final LuaClosure closure = > >                       LuaCompiler.loadstring("function doIt() john.m1(42) > end", "doIt", state > >                           .getEnvironment()); > >                   final Object runTest = > state.getEnvironment().rawget("doIt"); > > ... > > No errors are returned from the Lua compiler so why can’t it find “doIt” in > the environment? Assuming that the Kahlua API is similar to the standard C API, loadstring only creates a function object - it does not execute any Lua code. Thus the variable "closure" will contain a function, which when executed will assign `function() john.m1(42) end` to the global "doIt". You need to (p)call closure to actually make this happen, after which you will be able to find "doIt" in the environment. From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 12:18:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PFIEew022350; Tue, 25 Aug 2009 12:18:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97D2A19388; Tue, 25 Aug 2009 12:17:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FC811937C for ; Tue, 25 Aug 2009 12:17:40 -0300 (BRT) Received: by gv-out-0910.google.com with SMTP id s4so27503gve.40 for ; Tue, 25 Aug 2009 08:17:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.126.33 with SMTP id d33mr2091267mun.109.1251213458425; Tue, 25 Aug 2009 08:17:38 -0700 (PDT) In-Reply-To: References: <4A92FC64.8010206@wp.pl> Date: Tue, 25 Aug 2009 10:17:38 -0500 Message-ID: <90eb1dc70908250817n653bed76wc0f20d12bf311849@mail.gmail.com> Subject: Re: Nested file:lines() From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 25, 2009 at 2:38 AM, Alexander Gladysh wrote: > It looks like while file.lines perhaps does not close the file, it > does not seek it back to beginning. Furthermore, it looks like all > iterators to the same file do use the same file position pointer. The way i see it is that the file object owns the position pointer, as typical on most I/O libraries. On top of that, you could read() by line, which advances file object's pointer (as expected). the lines() iterator is just a convenient way to do the same reading, it doesn't have its own position pointer, but still uses the file object's one. that way, you could use the same file object to get the position from within the loop, or even advance the position. it's just a matter of recognizing who owns what. -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 12:35:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PFZSoV025996; Tue, 25 Aug 2009 12:35:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 417A419391; Tue, 25 Aug 2009 12:35:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out5.iinet.net.au (outbound.icp-qv1-irony-out5.iinet.net.au [203.59.1.108]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 501FD19380 for ; Tue, 25 Aug 2009 12:34:58 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAyhk0rL1kkT/2dsb2JhbADYK4QaBYFT X-IronPort-AV: E=Sophos;i="4.44,272,1249228800"; d="scan'208";a="28273226" Received: from unknown (HELO tigereye) ([203.214.73.19]) by outbound.icp-qv1-irony-out5.iinet.net.au with ESMTP; 25 Aug 2009 23:34:53 +0800 From: "John C. Turnbull" To: "'Lua list'" References: <00fc01ca2589$c2018ff0$4604afd0$@com.au> In-Reply-To: Subject: RE: Basic problem with Kahlua Date: Wed, 26 Aug 2009 01:34:53 +1000 Message-ID: <011301ca2599$97c53bf0$c74fb3d0$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoliurjW/jD4TWQSJa9nu1iXqnUqAADpKcg Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7PFZSoV025996 Thanks Peter - that solved the problem. John > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley > Sent: Tuesday, 25 August 2009 23:49 > To: Lua list > Subject: Re: Basic problem with Kahlua > > On Tue, Aug 25, 2009 at 2:41 PM, John C. > Turnbull wrote: > >                   final LuaClosure closure = > > > >                       LuaCompiler.loadstring("function doIt() > john.m1(42) > > end", "doIt", state > > > >                           .getEnvironment()); > > > >                   final Object runTest = > > state.getEnvironment().rawget("doIt"); > > > > ... > > > > No errors are returned from the Lua compiler so why can’t it find > “doIt” in > > the environment? > > Assuming that the Kahlua API is similar to the standard C API, > loadstring only creates a function object - it does not execute any > Lua code. Thus the variable "closure" will contain a function, which > when executed will assign `function() john.m1(42) end` to the global > "doIt". You need to (p)call closure to actually make this happen, > after which you will be able to find "doIt" in the environment. From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 20:51:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7PNpHbd012157; Tue, 25 Aug 2009 20:51:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3E5119366; Tue, 25 Aug 2009 20:50:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81B4A193EC for ; Tue, 25 Aug 2009 20:50:38 -0300 (BRT) Received: by ewy26 with SMTP id 26so4136964ewy.5 for ; Tue, 25 Aug 2009 16:50:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.37.4 with SMTP id k4mr7401916ebk.4.1251244235809; Tue, 25 Aug 2009 16:50:35 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Aug 2009 19:50:35 -0400 X-Google-Sender-Auth: c62df5039fe7527e Message-ID: Subject: Re: lua crashing on unrecognized strings From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Aug 24, 2009 at 9:03 AM, Peter Cawley wrote: > Likewise, io.open wraps fopen, and if the > underlying C runtime explodes on invalid input, then so will Lua. I came across that a few weeks ago actually. io.open(name, 'wa') crashed [1]. [1] http://luadist.svn.sourceforge.net/viewvc/luadist/trunk/dists/luadist-1.0.0/lmod/dist/log.lua?view=patch&r1=304&r2=303&pathrev=304 From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 22:43:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7Q1hDjR028205; Tue, 25 Aug 2009 22:43:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4E95193F8; Tue, 25 Aug 2009 22:42:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBF781873F for ; Tue, 25 Aug 2009 22:42:33 -0300 (BRT) Received: by ewy26 with SMTP id 26so4184509ewy.5 for ; Tue, 25 Aug 2009 18:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=8VHag7Q5B60YQTa7HyfPA5oZtutoPJfp3d8aBr9z/6g=; b=R6HAdRUoCUke+/3oUb8aD8pkhUQ3Gm0PpBDAOUZ+N2bJep4H3yeEMPQFNOh1RzyUBo zmgiNUpMg/EE4PNAooP5d7MKMjqSgI6T5KgBT3sHAwBlcHZf0ZN7kkhypaBoNPjlba/s r31p9GOLUg7qDZkE/QRuXRZmOY89k7GGFe0FY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=pklYMUxzlJqgAmFK5R1VyRf7ogY0jV0GkIwoKIqxK+Z4MXGC6ItKfUozxDxS/qVaLq WStj3GIfpbmtf8mM1tCBuR0O2tvFiAi1FZ/6onip6E69TUrucNbOMTqm27rHPV9UsAIB M4UE8RNCZJOe/9VgAszlMyPGFs/HhB1GsQ3zo= MIME-Version: 1.0 Received: by 10.216.11.67 with SMTP id 45mr1462582wew.53.1251250951346; Tue, 25 Aug 2009 18:42:31 -0700 (PDT) In-Reply-To: <1250429669.6796.8.camel@kymari> References: <1250429669.6796.8.camel@kymari> Date: Tue, 25 Aug 2009 20:42:31 -0500 X-Google-Sender-Auth: 598f8c157f5c4374 Message-ID: <27d4903a0908251842r35d10d62w6b79b1acec9f3adb@mail.gmail.com> Subject: Re: CouchDB for Lua? From: Marcus Irven To: Lua list Content-Type: multipart/alternative; boundary=0016364d1ef77ada23047201903a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364d1ef77ada23047201903a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It's not 100% complete but this is something I wrote and am using in a project: http://github.com/mirven/luacouchdb 2009/8/16 Jan Sch=FCtze > Hello! > > I would like to try out couchdb with lua. Is there any library, yet? > > Kind regards, > Jan > > ------------------------ > > http://dracoblue.net > > --0016364d1ef77ada23047201903a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It's not 100% complete but this is something I wrote and am using in a = project:

http://github.com/mirven/luacouchdb

= 2009/8/16 Jan Sch=FCtze <JanS@dracoblue.de>
Hello!

I would like to try out couchdb with lua. Is there any library, yet?

Kind regards,
=A0Jan

------------------------

http://dracoblue.net=


--0016364d1ef77ada23047201903a-- From lua-bounces@bazar2.conectiva.com.br Tue Aug 25 23:30:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7Q2UJ6D000491; Tue, 25 Aug 2009 23:30:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7D5519287; Tue, 25 Aug 2009 23:29:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39DAD18E73 for ; Tue, 25 Aug 2009 23:29:47 -0300 (BRT) Received: by ewy26 with SMTP id 26so4203906ewy.5 for ; Tue, 25 Aug 2009 19:29:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.63.12 with SMTP id l12mr4176306eba.31.1251253783256; Tue, 25 Aug 2009 19:29:43 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Aug 2009 22:29:42 -0400 X-Google-Sender-Auth: 594a8d3b719b95e0 Message-ID: Subject: Re: [ANN] lua-Coat 0.5.0 : Yet Another Lua Object-Oriented Model From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7Q2UJ6D000491 On Mon, Aug 24, 2009 at 1:14 PM, François Perrad wrote: > lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), ... > Comment, bug report, patch are welcome. So if Moose is the ultimate class library for Perl, and Coat is a quasi-subset Moose, and lua-Coat is a port of Coat to Lua, then does that imply that lua-Coat is a quasi-subset of the ultimate class library for Lua? We can try it on the benchmark [3] -- added code function makeob5() require "Coat" class "ob5" has.data = {is='number',default=0} function method:test() self:data(self:data() + 1) end return _M() end addbenchmark("Object using lua-Coat", "ob:test()", makeob5()) Results: $ lua bench.lua # using count = 10000000 2.969 Standard (solid) 3.406 Standard (metatable) 3.64 Object using closures (PiL 16.4) 2.25 Object using closures (noself) 16.735 Object using lua-Coat 1.469 Direct Access 0.484 Local Variable > basic_type = type > local basic_type = basic_type > local function object_type (obj) > local t = basic_type(obj) > if t == 'table' then > pcall(function () t = obj._CLASS or t end) > end > return t > end > _G.type = object_type The above code implies that type {_CLASS='x'} == 'x', which is inconsistent with the Lua specification [1]. This might not seem important, but consider the case of some code that operates on a table whose key names are generated from user input. The above would introduce subtle edge cases (or security holes). The above also implies that type(t) will now have the overhead of a pcall when t is a table. I recommend against redefining type(). > function before (class, name, func) ..... > class[name] = function (...) > local result = func(...) > super(...) > return result > end To handle multiple return values, you can use the CPS style [2]. However, I question whether before and after modifiers should alter return values. It appears Coat (in $modified_method_code) only does so for around modifiers. [1] http://www.lua.org/manual/5.1/manual.html#pdf-type [2] http://lua-users.org/wiki/VarargTheSecondClassCitizen [3] http://lua-users.org/wiki/ObjectBenchmarkTests From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 00:04:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7Q33wXa004296; Wed, 26 Aug 2009 00:03:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4350C193FA; Wed, 26 Aug 2009 00:03:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1088519323 for ; Wed, 26 Aug 2009 00:03:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so4217109ewy.5 for ; Tue, 25 Aug 2009 20:03:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.63.12 with SMTP id l12mr4204556eba.31.1251255803463; Tue, 25 Aug 2009 20:03:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Aug 2009 23:03:23 -0400 X-Google-Sender-Auth: f709847fbc786d19 Message-ID: Subject: Re: [ANN] libmc From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Aug 22, 2009 at 10:20 PM, Leaf Storm wrote: > I've been working for 3 months on a project I call libmc, which is a > library of random cool stuff for Lua that I got used to having in > Python like string splitting, table mapping, etc. Thanks for posting. There have been a number of efforts in this direction [1]. For example, there is a fair amount of overlap with Steve's recent penlight [2], including pl.operator [3], pl.stringx [4], pl.tablex [5], and pl.text.wrap [6]. I think it would be a good thing to try to merge your work with his. Knowledge of the functions that people have added to their personal standard libraries is useful when designing a shared standard library, and this overlap suggests that penlight is moving in the right direction. > For simplicity, it loads a good degree of > them into the 'math', 'string', and 'table' standard tables, with the > rest going in the 'mc' table. The can be good or bad. See "To Inject or not to Inject?" in [7]. It has been previously discussed [8][9]. [1] http://lua-users.org/wiki/StandardLibraries [2] http://penlight.luaforge.net/ [3] http://penlight.luaforge.net/api/modules/pl.operator.html [4] http://penlight.luaforge.net/api/modules/pl.stringx.html [5] http://penlight.luaforge.net/api/modules/pl.tablex.html [6] http://penlight.luaforge.net/api/modules/pl.text.html#wrap [7] http://penlight.luaforge.net/#T4 [8] http://lua-users.org/lists/lua-l/2009-04/msg00438.html [9] http://lua-users.org/lists/lua-l/2009-05/msg00001.html From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 10:31:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QDVZWX008236; Wed, 26 Aug 2009 10:31:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FF1019176; Wed, 26 Aug 2009 10:30:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91E3D18FDF for ; Wed, 26 Aug 2009 10:30:40 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so49920ana.26 for ; Wed, 26 Aug 2009 06:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=hM3+7A1oEf9AT8EdOZXIuuVhrCjD58eNAFDHOfvkMJU=; b=wQRxo3LpCLiaRJ4By9wiAAk3W8APdge/0RSiVGzjWEN2eOKWpBCbuz9F67gRgFAnAV Xx1W2nzD9EzpR8XIJUMjcXhburezRR0J7hRnZqOxI+bTM+Bqzsha2ixkiiC+DW8Q72Rs tH3/LozlckOQySytCg1ndYzzp8aRBKa8jKjBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=DBGMvyqXEqYH8xwtCelVPu8zq3cujX5l86WcinSq4jM6Mez/jXeY07TyPNVAlTaxxl MxqwBcMHDZKv1afWSKXcyc7hHV3AOY8OOaa5vpVAVw0HI2DwgEd4wDqEX8xWq3t4owl8 1NJVz5z9B2kpSrw8goTWwa9g7orHJ9hm5ytXw= MIME-Version: 1.0 Received: by 10.101.161.3 with SMTP id n3mr7777062ano.24.1251293438145; Wed, 26 Aug 2009 06:30:38 -0700 (PDT) From: "Thomas Harning Jr." Date: Wed, 26 Aug 2009 09:30:18 -0400 Message-ID: Subject: Resumable VM in 5.2? To: Lua list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just wondering, has there been any thought/work in making Lua 5.2 have a resumable VM (as in [1])? This seems like a very useful mechanism to have a stronger coroutine system without dealing with Coco. While Coco is pretty awesome, it's not ANSI C /AND/ it requires enough knowledge of how the C stack is used to determine how much stack is needed for what 'might' be called underneath.... quite a daunting task esp when dynamic modules are loadable and you have no idea what those might do WRT stack. As an aside... are there any other resumable VM options out there, perhaps with a smaller patch footprint? 1: http://lua-users.org/wiki/ResumableVmPatch -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 10:38:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QDcOUV009835; Wed, 26 Aug 2009 10:38:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E253919426; Wed, 26 Aug 2009 10:38:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD36719178 for ; Wed, 26 Aug 2009 10:37:56 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QDbsvK009699 for ; Wed, 26 Aug 2009 10:37:54 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7QDbrA23011; Wed, 26 Aug 2009 10:37:53 -0300 Date: Wed, 26 Aug 2009 10:37:53 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Resumable VM in 5.2? Message-ID: <20090826103753.A23006@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from harningt@gmail.com on Wed, Aug 26, 2009 at 09:30:18AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Just wondering, has there been any thought/work in making Lua 5.2 have > a resumable VM (as in [1])? Yes. This is the major change in 5.2. From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 10:41:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QDfHD5010612; Wed, 26 Aug 2009 10:41:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 906F91942D; Wed, 26 Aug 2009 10:40:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BEC719178 for ; Wed, 26 Aug 2009 10:40:48 -0300 (BRT) Received: by vws33 with SMTP id 33so106659vws.33 for ; Wed, 26 Aug 2009 06:40:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.41.17 with SMTP id m17mr10489397vce.97.1251294041647; Wed, 26 Aug 2009 06:40:41 -0700 (PDT) In-Reply-To: <20090826103753.A23006@lua.tecgraf.puc-rio.br> References: <20090826103753.A23006@lua.tecgraf.puc-rio.br> From: Phoenix Sol Date: Wed, 26 Aug 2009 08:40:21 -0500 Message-ID: <8a25d01b0908260640j62f6a5bdla71cd30267cfdb90@mail.gmail.com> Subject: Re: Resumable VM in 5.2? To: Lua list Content-Type: multipart/alternative; boundary=0016368342baddbac004720b9851 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016368342baddbac004720b9851 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Aug 26, 2009 at 8:37 AM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > Just wondering, has there been any thought/work in making Lua 5.2 have > > a resumable VM (as in [1])? > > Yes. This is the major change in 5.2. > Woo-hoo! --0016368342baddbac004720b9851 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Aug 26, 2009 at 8:37 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> Just wondering, has there been any thought/work in m= aking Lua 5.2 have
> a resumable VM (as in [1])?

Yes. This is the major change in 5.2.

Woo-hoo!

--0016368342baddbac004720b9851-- From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 10:43:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QDhlEw011291; Wed, 26 Aug 2009 10:43:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04F4F193FB; Wed, 26 Aug 2009 10:43:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F05419287 for ; Wed, 26 Aug 2009 10:43:15 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7QDhB3o030876 for ; Wed, 26 Aug 2009 10:43:11 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 36D8A54C211; Wed, 26 Aug 2009 10:43:12 -0300 (BRT) Date: Wed, 26 Aug 2009 10:43:12 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Resumable VM in 5.2? Message-ID: <20090826134312.GD15474@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Just wondering, has there been any thought/work in making Lua 5.2 have > a resumable VM (as in [1])? This seems like a very useful mechanism > to have a stronger coroutine system without dealing with Coco. Yes. It is basically done. The general (and relevant) ideas came from the patch, but the details are somewhat different. In the API, we did not implement the lua_v* API, only the lua_i*. And those functions also get an explicit continuation function to be called when resumming, istead of the original function. -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 13:14:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QGEAj6016694; Wed, 26 Aug 2009 13:14:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 029091914F; Wed, 26 Aug 2009 13:13:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f202.google.com (mail-px0-f202.google.com [209.85.216.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 410E018FAA for ; Wed, 26 Aug 2009 13:13:30 -0300 (BRT) Received: by pxi40 with SMTP id 40so222460pxi.5 for ; Wed, 26 Aug 2009 09:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=sr8ZySjfd7iBvOXOhV/iM9eyg1giLZKgz8SkLF+0HlQ=; b=KlcDWSXhnKXO07PjAnyy6ZVHyFslffIDgl1yJkX8bl9J2QwsZjbOfjBW8UJYatexTv FDthu0aJ47Oyn5FUvZBDlzZF9IyWYpMF5ZuHwd1LqVFqYAvB22APcixp3Cb1ClC2TYmc WaJbd+GULgWlsJ+nDr3bQ1VQyx+3ypsjcAbzw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=a79bn6hTEwjb+/jLVr9A6oQayalgIAzWUE/2BpdCxKjZR2WubD3SglfvkZ8o/RjDi4 oH7INRpeNWsErBL0Un5s+y3yurnKVanuRjWcOeqMKiYoWYDel4PP5F//qWgESwWnkAHo nWQYquITPhsGm2scVBRK6jSq7AmPR+RZeuv84= MIME-Version: 1.0 Received: by 10.141.2.13 with SMTP id e13mr3762263rvi.56.1251303207754; Wed, 26 Aug 2009 09:13:27 -0700 (PDT) Date: Wed, 26 Aug 2009 09:13:27 -0700 Message-ID: <1079b050908260913p35d73259pe0bbc23b56193900@mail.gmail.com> Subject: ambiguous syntax?? From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hi list, I'm running into an odd situation that I don't understand. The following code compiles and runs as expected built_ins = {__index = M} setmetatable(built_ins, built_ins) z = function() end (setfenv(function() end, built_ins))() -- <----- line 78 This code however (just one line commented out) compiles with the error below: built_ins = {__index = M} setmetatable(built_ins, built_ins) -- z = function() end (setfenv(function() end, built_ins))() -- <----- line 78 runtime error loading module 'value' from file '/modules/value.lua': modules/value.lua:78: ambiguous syntax (function call x new statement) near '(' Any idea why? thanks, wes From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 13:21:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QGLdDp018635; Wed, 26 Aug 2009 13:21:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EC1A1942F; Wed, 26 Aug 2009 13:21:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88E4219425 for ; Wed, 26 Aug 2009 13:21:13 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QGL2dF018498 for ; Wed, 26 Aug 2009 13:21:04 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7QGL1e23708; Wed, 26 Aug 2009 13:21:01 -0300 Date: Wed, 26 Aug 2009 13:21:00 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: ambiguous syntax?? Message-ID: <20090826132100.A23702@lua.tecgraf.puc-rio.br> References: <1079b050908260913p35d73259pe0bbc23b56193900@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1079b050908260913p35d73259pe0bbc23b56193900@mail.gmail.com>; from wesley.hoke@gmail.com on Wed, Aug 26, 2009 at 09:13:27AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > This code however (just one line commented out) compiles with the error below: > > built_ins = {__index = M} > setmetatable(built_ins, built_ins) > > -- z = function() end > > (setfenv(function() end, built_ins))() -- <----- line 78 The compiler sees this: setmetatable(built_ins, built_ins)(setfenv(function() end, built_ins))() From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 13:24:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QGO2Rs019507; Wed, 26 Aug 2009 13:24:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FCE419442; Wed, 26 Aug 2009 13:23:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDA0D1943D for ; Wed, 26 Aug 2009 13:23:33 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id AZS93584; Wed, 26 Aug 2009 12:23:32 -0400 (EDT) Received: (from mymail.erau.edu [68.204.247.55]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id APH09326 (AUTH delbu9c1); Wed, 26 Aug 2009 12:23:32 -0400 (EDT) From: Matthew Paul Del Buono Subject: Re: ambiguous syntax?? To: lua@bazar2.conectiva.com.br X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090826122332.APH09326@mymail.erau.edu> Date: Wed, 26 Aug 2009 12:23:32 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >-- z = function() end > >(setfenv(function() end, built_ins))() -- <----- line 78 > >runtime error loading module 'value' from file '/modules/value.lua': > modules/value.lua:78: ambiguous syntax (function call x new statement) near '(' > This is ambiguous because there are two ways to interpret this. Take the following example. z = (function(...) print(...); return "Bar"; end) ("Foo"):sub(1,1) There are two interpretations to this: 1) Store the newly created function, which calls print and returns "Bar" into the variable z, then call string.sub on "Foo" and discard the result 2) Create a temporary function which prints out the parameters and returns "Bar", pass in "Foo" to that function, then execute string.sub on "Bar" (returning "B" to store into variable z) Use a semicolon to disambiguate this problem. -- Matthew P. Del Buono Embry-Riddle Aeronautical University EcoEagles, Controls Team Leader (703) 395-5425 From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 16:08:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QJ80Q2032273; Wed, 26 Aug 2009 16:08:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB8C919433; Wed, 26 Aug 2009 16:07:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38D4E19418 for ; Wed, 26 Aug 2009 16:07:22 -0300 (BRT) Received: by ewy26 with SMTP id 26so509619ewy.5 for ; Wed, 26 Aug 2009 12:07:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.12.13 with SMTP id 13mr6480095ebl.15.1251313638993; Wed, 26 Aug 2009 12:07:18 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Aug 2009 21:07:18 +0200 X-Google-Sender-Auth: 738087f4ec039f90 Message-ID: Subject: Re: [ANN] lua-Coat 0.5.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7QJ80Q2032273 2009/8/26 David Manura : > On Mon, Aug 24, 2009 at 1:14 PM, François Perrad wrote: >> lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), ... >> Comment, bug report, patch are welcome. > > So if Moose is the ultimate class library for Perl, and Coat is a > quasi-subset Moose, and lua-Coat is a port of Coat to Lua, then does > that imply that lua-Coat is a quasi-subset of the ultimate class > library for Lua? > > We can try it on the benchmark [3] > >  -- added code >  function makeob5() >    require "Coat" >    class "ob5" >    has.data = {is='number',default=0} >    function method:test() self:data(self:data() + 1) end >    return _M() >  end >  addbenchmark("Object using lua-Coat", "ob:test()", makeob5()) > > Results: > >  $ lua bench.lua            # using count = 10000000 >  2.969   Standard (solid) >  3.406   Standard (metatable) >  3.64    Object using closures (PiL 16.4) >  2.25    Object using closures (noself) >  16.735  Object using lua-Coat >  1.469   Direct Access >  0.484   Local Variable > A benchmark makes sense only if it's representative of your usage. >> basic_type = type >> local basic_type = basic_type >> local function object_type (obj) >>     local t = basic_type(obj) >>     if t == 'table' then >>         pcall(function () t = obj._CLASS or t end) >>     end >>     return t >> end >> _G.type = object_type > > The above code implies that type {_CLASS='x'} == 'x', which is > inconsistent with the Lua specification [1].  This might not seem > important, but consider the case of some code that operates on a table > whose key names are generated from user input.  The above would > introduce subtle edge cases (or security holes).  The above also > implies that type(t) will now have the overhead of a pcall when t is a > table.  I recommend against redefining type(). > >> function before (class, name, func) ..... >>     class[name] = function (...) >>         local result = func(...) >>         super(...) >>         return result >>     end > > To handle multiple return values, you can use the CPS style [2]. > However, I question whether before and after modifiers should alter > return values.  It appears Coat (in $modified_method_code) only does > so for around modifiers. > > [1] http://www.lua.org/manual/5.1/manual.html#pdf-type > [2] http://lua-users.org/wiki/VarargTheSecondClassCitizen > [3] http://lua-users.org/wiki/ObjectBenchmarkTests > > From lua-bounces@bazar2.conectiva.com.br Wed Aug 26 18:15:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7QLFpWj030178; Wed, 26 Aug 2009 18:15:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 113CD18EF2; Wed, 26 Aug 2009 18:15:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C008218D78 for ; Wed, 26 Aug 2009 18:15:07 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MgPpe-0002k7-HE for lua@bazar2.conectiva.com.br; Wed, 26 Aug 2009 23:15:02 +0200 Received: from c-76-104-160-178.hsd1.wa.comcast.net ([76.104.160.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Aug 2009 23:15:02 +0200 Received: from stuart by c-76-104-160-178.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Aug 2009 23:15:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Transparent shallow copy of tables Date: Wed, 26 Aug 2009 14:14:22 -0700 Lines: 8 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-104-160-178.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean How can I do a shallow copy of a table that operates identically to the original? Currently I'm setting tables to be empty tables with metatables that save deletions and create similar shallow copies on index access, but this is causing problems with functions like table.concat(). MY current approach is online at http://bazaar.launchpad.net/~stuart/sandpad/stuart/annotate/head%3A/sandpad.wlua. From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 15:42:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RIfs2T018791; Thu, 27 Aug 2009 15:41:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D5C919287; Thu, 27 Aug 2009 15:41:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4005190AC for ; Thu, 27 Aug 2009 15:41:09 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RIf5H9018445 for ; Thu, 27 Aug 2009 15:41:07 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 8A15A1F115F; Thu, 27 Aug 2009 15:41:05 -0300 (BRT) Date: Thu, 27 Aug 2009 15:41:05 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: introductory Lua text (in Portuguese) Message-ID: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br The text that Roberto wrote for the introductory Lua course at JAI 2009 is now available at http://www.lua.org/doc/jai2009.pdf O texto "Uma Introdução à Programação em Lua" escrito pelo Roberto para o curso introdutório de Lua ministrado no JAI 2009 está disponível em http://www.lua.org/doc/jai2009.pdf From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 15:49:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RIni32020645; Thu, 27 Aug 2009 15:49:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5AE119315; Thu, 27 Aug 2009 15:49:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f202.google.com (mail-px0-f202.google.com [209.85.216.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DD38192FA for ; Thu, 27 Aug 2009 15:49:01 -0300 (BRT) Received: by pxi40 with SMTP id 40so1261291pxi.5 for ; Thu, 27 Aug 2009 11:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=C7KVef+OQlSZebVkbMLQbVnM3en5uWMJ0JMn71ualDM=; b=KxHwTI/e4QkvSpbFkb12/vgFJAicLnXrPfGHfxtHoahzq1Ux18S45F0O+lod2jTss7 I4BhRRNuNQe3jD1ejGvFZE7IAkpco0bgYYEDDtf9qPgtLY7GQZxdZLxAV7oZvLtWSTd4 XD8S9fTxVu4OnQAq4f/UfZn+G1MOjv1EsLsA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GqTUeyOjICD+38kSQ+jC9q2lWDoK1r4PKWVBbAhPY5Ii5dhhpsPChzegzQdr+LXHQ3 u4Nlx7yRvpN47CoZ3H7HuNqcDgoT7u7r6GHkjS5IHNsQZDdDiapQfFaU2LpOqzIEgVeG UIKyxfxwiUcHSWlRIZPsK9AvXiYLWehEIhk/g= MIME-Version: 1.0 Received: by 10.142.250.41 with SMTP id x41mr4468wfh.42.1251398937043; Thu, 27 Aug 2009 11:48:57 -0700 (PDT) In-Reply-To: References: Date: Thu, 27 Aug 2009 11:48:57 -0700 Message-ID: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> Subject: Re: lua crashing on unrecognized strings From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 25, 2009 at 4:50 PM, David Manura wrote: > On Mon, Aug 24, 2009 at 9:03 AM, Peter Cawley wrote: >> Likewise, io.open wraps fopen, and if the >> underlying C runtime explodes on invalid input, then so will Lua. > > I came across that a few weeks ago actually. io.open(name, 'wa') crashed [1]. > > [1] http://luadist.svn.sourceforge.net/viewvc/luadist/trunk/dists/luadist-1.0.0/lmod/dist/log.lua?view=patch&r1=304&r2=303&pathrev=304 > Is that legal? I would assumed the documented behaviour on Linux ERRORS EINVAL The mode provided to fopen(), fdopen(), or freopen() was invalid. Would be the ANSI defined behaviour. Sam From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 16:07:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RJ6npO024948; Thu, 27 Aug 2009 16:06:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1200019327; Thu, 27 Aug 2009 16:06:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0369819317 for ; Thu, 27 Aug 2009 16:06:16 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7RJ6FPb007664 for ; Thu, 27 Aug 2009 16:06:15 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 0FC7A54C211; Thu, 27 Aug 2009 16:06:16 -0300 (BRT) Date: Thu, 27 Aug 2009 16:06:16 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: lua crashing on unrecognized strings Message-ID: <20090827190616.GE21694@inf.puc-rio.br> References: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Tue, Aug 25, 2009 at 4:50 PM, David Manura wrote: > > On Mon, Aug 24, 2009 at 9:03 AM, Peter Cawley wrote: > >> Likewise, io.open wraps fopen, and if the > >> underlying C runtime explodes on invalid input, then so will Lua. > > > > I came across that a few weeks ago actually. io.open(name, 'wa') crashed [1]. > > > > [1] http://luadist.svn.sourceforge.net/viewvc/luadist/trunk/dists/luadist-1.0.0/lmod/dist/log.lua?view=patch&r1=304&r2=303&pathrev=304 > > > > Is that legal? > > I would assumed the documented behaviour on Linux > > ERRORS > EINVAL The mode provided to fopen(), fdopen(), or freopen() was invalid. > > Would be the ANSI defined behaviour. ISO/IEC 9899:1999 (E) says this (Section 7.19.5.3): The argument 'mode' points to a string. If the string is one of the following, the file is open in the indicated mode. Otherwise, the behavior is undefined. r open text file for reading ... This is very sad, but "the behavior is undefined" actually means that. (Even crashing is acceptable.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 17:55:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RKtsZi019417; Thu, 27 Aug 2009 17:55:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5788018AAD; Thu, 27 Aug 2009 17:55:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C5D318A5B for ; Thu, 27 Aug 2009 17:55:20 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 27905 invoked from network); 27 Aug 2009 22:55:16 +0200 Received: from miko.ras.wp-sa.pl (HELO [192.168.254.110]) (miko@[212.77.97.9]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with RC4-MD5 encrypted SMTP for ; 27 Aug 2009 22:55:16 +0200 Message-ID: <4A96F2B3.6090600@wp.pl> Date: Thu, 27 Aug 2009 22:55:15 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: introductory Lua text (in Portuguese) References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> In-Reply-To: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [MUNE] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > The text that Roberto wrote for the introductory Lua course at JAI 2009 > is now available at > http://www.lua.org/doc/jai2009.pdf Looks nice, but I am not able to evaluate it properly ;( Any chance of english translation? Altavista's Babelfish does not help much... Regards, miko From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 18:33:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RLXA0b026796; Thu, 27 Aug 2009 18:33:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60D4A19322; Thu, 27 Aug 2009 18:32:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A52C218FAA for ; Thu, 27 Aug 2009 18:32:37 -0300 (BRT) Received: by fxm25 with SMTP id 25so1276343fxm.5 for ; Thu, 27 Aug 2009 14:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=m+FJe1BS/0tLvDRXEAwvZBfMNqsKVkK4SHnEDTmj6L8=; b=u43Pr+VWXugHT4rGtByn/+metTZDpU2IpN9yTk9Fl+0EbFyUN72nWuCBjxkLnfRwTP HwXB17E0W4zn//G3nhK3D/z3pf54E9kjSUSK7n9JdW6OymtSAok35KoKBJMnVKZBrIKe pJzOoKvv4hqYb13lIk8aUxsC7tG72myKbo1gY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kU7d9nHtklLEEH9K43so/gaXxdPGFv0k0h3kJzqHI2v5C+pxFtzVY8UMij4u/gWMA+ IxFBr2OuOSum4YAK7ve7gqihfkUoyJx8AyF77sqWLbuj9y0AbUGoxThL9j+kDTxmhXez iD9hUZc3c1UsTeFnIPeEXKWWMLWRz7rbnQGkI= MIME-Version: 1.0 Received: by 10.204.34.70 with SMTP id k6mr144228bkd.178.1251408754754; Thu, 27 Aug 2009 14:32:34 -0700 (PDT) In-Reply-To: <4A96F2B3.6090600@wp.pl> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> Date: Thu, 27 Aug 2009 23:32:34 +0200 Message-ID: <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> Subject: Re: introductory Lua text (in Portuguese) From: Pierre LeMoine To: Lua list Content-Type: multipart/alternative; boundary=00032555b3664bc7130472264e9d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555b3664bc7130472264e9d Content-Type: text/plain; charset=ISO-8859-2 > Looks nice, but I am not able to evaluate it properly ;( Any chance of > english translation? Altavista's Babelfish does not help much... > > Regards, > miko > Try google translate http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.lua.org%2Fdoc%2Fjai2009.pdf&sl=auto&tl=en&history_state0= /Pierre --00032555b3664bc7130472264e9d Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable
Looks nice, but I am not able to evaluate it properly ;( Any = chance of
english translation? Altavista's Babelfish does not help much...

Regards,
miko

Try google translate
http://translate.google.co= m/translate?js=3Dy&prev=3D_t&hl=3Den&ie=3DUTF-8&u=3Dhttp%3A= %2F%2Fwww.lua.org%2Fdoc%2Fjai2009.pdf&sl=3Dauto&tl=3Den&history= _state0=3D

/Pierre

--00032555b3664bc7130472264e9d-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 18:42:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RLgUFD028235; Thu, 27 Aug 2009 18:42:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0AF71932D; Thu, 27 Aug 2009 18:42:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34CF0192D1 for ; Thu, 27 Aug 2009 18:42:08 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7RLg7tq021424 for ; Thu, 27 Aug 2009 18:42:07 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 0803554C211; Thu, 27 Aug 2009 18:42:08 -0300 (BRT) Date: Thu, 27 Aug 2009 18:42:08 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: introductory Lua text (in Portuguese) Message-ID: <20090827214208.GC22899@inf.puc-rio.br> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A96F2B3.6090600@wp.pl> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Luiz Henrique de Figueiredo wrote: > > The text that Roberto wrote for the introductory Lua course at JAI 2009 > > is now available at > > http://www.lua.org/doc/jai2009.pdf > > Looks nice, but I am not able to evaluate it properly ;( Any chance of > english translation? Altavista's Babelfish does not help much... I do not intend to do it, but if anyone volunteers it would be great. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 20:10:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RNAckn008360; Thu, 27 Aug 2009 20:10:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 647D819348; Thu, 27 Aug 2009 20:10:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27F1219331 for ; Thu, 27 Aug 2009 20:10:00 -0300 (BRT) Received: by fxm25 with SMTP id 25so1318592fxm.5 for ; Thu, 27 Aug 2009 16:09:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.152.27 with SMTP id e27mr222803bkw.192.1251414598316; Thu, 27 Aug 2009 16:09:58 -0700 (PDT) In-Reply-To: <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> Date: Fri, 28 Aug 2009 02:09:58 +0300 Message-ID: Subject: Re: introductory Lua text (in Portuguese) From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Try google translate > http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.lua.org%2Fdoc%2Fjai2009.pdf&sl=auto&tl=en&history_state0= LoL... it keeps saying how tables are used differently on the moon, and how the moon has many actual uses, and that Fink offers packages ready for the moon, and there's even a chapter on How to Moon and a book called Programming in Moon, supposedly written by some astronaut named Roberto :) I'm done being silly now. From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 20:13:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RNDVQq008602; Thu, 27 Aug 2009 20:13:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09BB319354; Thu, 27 Aug 2009 20:13:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2AC819342 for ; Thu, 27 Aug 2009 20:13:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so1722115ewy.5 for ; Thu, 27 Aug 2009 16:13:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.87.16 with SMTP id k16mr7053735ebb.2.1251414782482; Thu, 27 Aug 2009 16:13:02 -0700 (PDT) In-Reply-To: References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> Date: Thu, 27 Aug 2009 18:13:02 -0500 Message-ID: <90eb1dc70908271613m27de9de0j27bc802c9dd75981@mail.gmail.com> Subject: Re: introductory Lua text (in Portuguese) From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Aug 27, 2009 at 6:09 PM, Cosmin Apreutesei wrote: > LoL... it keeps saying how tables are used differently on the moon, what's even stranger is that on several places it keeps the name Lua... i wonder why -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 20:26:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RNQM6N009898; Thu, 27 Aug 2009 20:26:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C28F119363; Thu, 27 Aug 2009 20:26:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 998AF19358 for ; Thu, 27 Aug 2009 20:25:57 -0300 (BRT) Received: by gxk18 with SMTP id 18so1878614gxk.5 for ; Thu, 27 Aug 2009 16:25:55 -0700 (PDT) Received: by 10.91.189.5 with SMTP id r5mr353847agp.31.1251415555378; Thu, 27 Aug 2009 16:25:55 -0700 (PDT) Received: from gandalf (201-41-236-129.jvece701.dsl.brasiltelecom.net.br [201.41.236.129]) by mx.google.com with ESMTPS id 10sm559627agb.76.2009.08.27.16.25.53 (version=SSLv3 cipher=RC4-MD5); Thu, 27 Aug 2009 16:25:54 -0700 (PDT) Date: Thu, 27 Aug 2009 20:26:31 -0300 From: Alexandre Erwin Ittner To: Lua list Subject: Re: introductory Lua text (in Portuguese) Message-Id: <20090827202631.3866773f.alexandre@ittner.com.br> In-Reply-To: References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.12.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei wrote > > Try google translate > > http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.lua.org%2Fdoc%2Fjai2009.pdf&sl=auto&tl=en&history_state0= > It also translated "Como usar Lua" ("How to use Lua") to "How to moon" :) -- Alexandre Erwin Ittner - alexandre@ittner.com.br OpenPGP pubkey 0x0041A1FB @ http://pgp.mit.edu From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 20:39:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7RNdsLF011434; Thu, 27 Aug 2009 20:39:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C972F19331; Thu, 27 Aug 2009 20:39:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D048E18BB1 for ; Thu, 27 Aug 2009 20:39:31 -0300 (BRT) Received: by vws33 with SMTP id 33so1214870vws.33 for ; Thu, 27 Aug 2009 16:39:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.18.79 with SMTP id v15mr627417vca.117.1251416369116; Thu, 27 Aug 2009 16:39:29 -0700 (PDT) In-Reply-To: <20090827202631.3866773f.alexandre@ittner.com.br> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <9386fb2d0908271432u4ae7f573yabf5349d778366d9@mail.gmail.com> <20090827202631.3866773f.alexandre@ittner.com.br> From: Phoenix Sol Date: Thu, 27 Aug 2009 18:39:09 -0500 Message-ID: <8a25d01b0908271639j44e9e0c8x9fc79e19da595c7f@mail.gmail.com> Subject: Re: introductory Lua text (in Portuguese) To: Lua list Content-Type: multipart/alternative; boundary=00163646d09a25b84604722814f8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163646d09a25b84604722814f8 Content-Type: text/plain; charset=ISO-8859-1 > > It also translated "Como usar Lua" ("How to use Lua") to "How to moon" :) > It becomes increasingly important to know (when and) how to moon. --00163646d09a25b84604722814f8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
It also translated "Como usar Lua" ("How to use Lu= a") to "How to moon" :)

It becomes increasingly important to know (wh= en and) how to moon.
--00163646d09a25b84604722814f8-- From lua-bounces@bazar2.conectiva.com.br Thu Aug 27 21:29:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7S0Tei4016696; Thu, 27 Aug 2009 21:29:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 682C31937C; Thu, 27 Aug 2009 21:29:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8096319369 for ; Thu, 27 Aug 2009 21:29:08 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so352874qwi.11 for ; Thu, 27 Aug 2009 17:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=SjcFEbuHgdANJz01b+36fzVybsLUBZTUbz0RYx9MiB4=; b=kGCoeWDKdlXSMeqKriLOasZpauQ/9/rlopL6lg7RSNJ2NIbzZLdUz+wR09HCJO+/Vb AfdCDX89WCU0EsD4ZDqYgkLMWaqRLR2Udt7moTJAc3zb8M73MKgMKpX6BZCdSaTahcBE lmZtM/6dFHPeawrvp4MlhaFyha7KkXFAr1lxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=ZET95jg68WtMYU/KlJgpRnanDKyQPWm8ZukaNxsKosTq8RvxfbFij80Iqsj0SSErm6 D+xvPqVhbj23nSOI6/lsKooqGt2WJu/NhQW2BGf0wSxGQ8qSJhSvbHQ/PBnKCjoD6XGu 3v2h4599Bf0C0xSpLYh6hapFIk+e05Iyl0pFI= MIME-Version: 1.0 Received: by 10.229.9.83 with SMTP id k19mr309027qck.47.1251419346070; Thu, 27 Aug 2009 17:29:06 -0700 (PDT) In-Reply-To: <20090827214208.GC22899@inf.puc-rio.br> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <20090827214208.GC22899@inf.puc-rio.br> From: Norman Clarke Date: Thu, 27 Aug 2009 21:28:46 -0300 Message-ID: Subject: Re: introductory Lua text (in Portuguese) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7S0Tei4016696 On Thu, Aug 27, 2009 at 6:42 PM, Roberto Ierusalimschy wrote: >> Luiz Henrique de Figueiredo wrote: >> > The text that Roberto wrote for the introductory Lua course at JAI 2009 >> > is now available at >> >         http://www.lua.org/doc/jai2009.pdf >> >> Looks nice, but I am not able to evaluate it properly ;( Any chance of >> english translation? Altavista's Babelfish does not help much... > > I do not intend to do it, but if anyone volunteers it would be great. > > -- Roberto I'd be happy to work on it, as long as I could get a little help from a native Portuguese speaker to ask questions in case I get stuck or misunderstand a phrase. I studied Portuguese for many years but am still not completely fluent. Roberto, would it be possible to get the source files so that the translation could preserve the same formatting? Regards, Norman From lua-bounces@bazar2.conectiva.com.br Fri Aug 28 01:29:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7S4TjrI010933; Fri, 28 Aug 2009 01:29:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E5C319344; Fri, 28 Aug 2009 01:29:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B81B18EF2 for ; Fri, 28 Aug 2009 01:29:06 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so618951ana.26 for ; Thu, 27 Aug 2009 21:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=AiFcPnaBL9qsQzog94bWCTVLqle7S22S/LjBkk/QKoA=; b=XyPWs0Sf0cb2smavEFbHI0rdO1m0O2cdUYEQAr/gCxAo0IjC5g8/hLUq/asa2XqNoE +XlNRGJCpXbKGduj+w4IFq67Dl47z/Bz6tnhoXo2DmcgnIeLXZOM99Lxsjb27oobBnpu YjEGGOBY9+o5AqkBPSP/CuC/jp9r30VxGKlAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=hpKK5IeuRNumyVomWqGngn8blApROMZEf9uqkr0u8kbGTUhv1v/LyuAJEdSFyfeIjs bINqCYJUnqTvobtPvS07sBWAqviEGuBg2g4cPuBrXCDOFV5fx4zDm0gFHKEwYwKbK3kw N6WETbmyZhDpWnDIad/ZaYmx02tLpMfn28Be0= MIME-Version: 1.0 Received: by 10.101.44.1 with SMTP id w1mr516084anj.113.1251433744067; Thu, 27 Aug 2009 21:29:04 -0700 (PDT) In-Reply-To: <20090827190616.GE21694@inf.puc-rio.br> References: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> <20090827190616.GE21694@inf.puc-rio.br> From: "Thomas Harning Jr." Date: Fri, 28 Aug 2009 00:28:44 -0400 Message-ID: Subject: Re: lua crashing on unrecognized strings To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7S4TjrI010933 On Thu, Aug 27, 2009 at 3:06 PM, Roberto Ierusalimschy wrote: > ISO/IEC 9899:1999 (E) says this (Section 7.19.5.3): > >  The argument 'mode' points to a string. If the string is one of the >  following, the file is open in the indicated mode. Otherwise, the >  behavior is undefined. > >  r   open text file for reading >  ... > > > This is very sad, but "the behavior is undefined" actually means that. > (Even crashing is acceptable.) Looking at windows-docs, there appears to be an invalid-input handler you can register to handle bad input... too bad this is almost definitely not the place for standard Lua to step in, but a module could readily do it. Basically you'd want to replace the handler with something that didn't "blow up". It appears the idea is that the MS runtimes want the developer to check all inputs, even when things should be sane... and if input is wrong, the dev has to pick up the pieces in nasty ways. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Aug 28 13:40:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7SGeIYl024182; Fri, 28 Aug 2009 13:40:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7462C19012; Fri, 28 Aug 2009 13:39:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6A1118EDF for ; Fri, 28 Aug 2009 13:39:37 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7SGdXFt028550 for ; Fri, 28 Aug 2009 13:39:35 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id B1FF854C211; Fri, 28 Aug 2009 13:39:33 -0300 (BRT) Date: Fri, 28 Aug 2009 13:39:33 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: introductory Lua text (in Portuguese) Message-ID: <20090828163933.GA27014@inf.puc-rio.br> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <20090827214208.GC22899@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Thu, Aug 27, 2009 at 6:42 PM, Roberto > Ierusalimschy wrote: > >> Luiz Henrique de Figueiredo wrote: > >> > The text that Roberto wrote for the introductory Lua course at JAI 2009 > >> > is now available at > >> >         http://www.lua.org/doc/jai2009.pdf > >> > >> Looks nice, but I am not able to evaluate it properly ;( Any chance of > >> english translation? Altavista's Babelfish does not help much... > > > > I do not intend to do it, but if anyone volunteers it would be great. > > > > -- Roberto > > I'd be happy to work on it, as long as I could get a little help from > a native Portuguese speaker to ask questions in case I get stuck or > misunderstand a phrase. I studied Portuguese for many years but am > still not completely fluent. I can do that. > Roberto, would it be possible to get the source files so that the > translation could preserve the same formatting? Sure. I will send them to you. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Aug 28 13:48:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7SGmVvA026849; Fri, 28 Aug 2009 13:48:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74379192AE; Fri, 28 Aug 2009 13:48:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDAA3190A3 for ; Fri, 28 Aug 2009 13:47:59 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n7SGlwXs029222 for ; Fri, 28 Aug 2009 13:47:58 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 58CB854C211; Fri, 28 Aug 2009 13:47:58 -0300 (BRT) Date: Fri, 28 Aug 2009 13:47:58 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: introductory Lua text (in Portuguese) Message-ID: <20090828164758.GC27014@inf.puc-rio.br> References: <20090827184105.GA22318@magritte.tecgraf.puc-rio.br> <4A96F2B3.6090600@wp.pl> <20090827214208.GC22899@inf.puc-rio.br> <20090828163933.GA27014@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090828163933.GA27014@inf.puc-rio.br> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > On Thu, Aug 27, 2009 at 6:42 PM, Roberto > [...] > > > > I'd be happy to work on it, as long as I could get a little help from > > a native Portuguese speaker to ask questions in case I get stuck or > > misunderstand a phrase. I studied Portuguese for many years but am > > still not completely fluent. > > I can do that. > > > > Roberto, would it be possible to get the source files so that the > > translation could preserve the same formatting? > > Sure. I will send them to you. > > -- Roberto And many thanks!! -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Aug 28 16:28:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7SJSppT002286; Fri, 28 Aug 2009 16:28:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 537F819285; Fri, 28 Aug 2009 16:28:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1406219155 for ; Fri, 28 Aug 2009 16:28:01 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7SJRuOY001967 for ; Fri, 28 Aug 2009 16:27:58 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n7SJRtf01365; Fri, 28 Aug 2009 16:27:55 -0300 Date: Fri, 28 Aug 2009 16:27:55 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: Lua Workshop 2009: pre-registration closed Message-ID: <20090828162754.A1357@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Pre-registration for the Lua Workshop 2009 is now closed. We shall send messages to those that pre-registred by Aug, 31st. Unfortunately, not all requests will be accepted because space is limited. We thank all those interested in the event. -- The organizing committee As pré-inscrições para o Lua Workshop 2009 estão encerradas. As mensagens sobre a inscrição final serão enviadas até o dia 31/8. Infelizmente, nem todos os pedidos vão poder ser atendidos, por causa da limitação de espaço e da natureza do evento. Agradecemos a todos pelo interesse no evento. -- A comissão organizadora From lua-bounces@bazar2.conectiva.com.br Fri Aug 28 19:47:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7SMl8fD008834; Fri, 28 Aug 2009 19:47:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C879919330; Fri, 28 Aug 2009 19:46:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C97B19183 for ; Fri, 28 Aug 2009 19:46:21 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4EAIT7l0rLzg0//2dsb2JhbACCKyvWR4QZBQ X-IronPort-AV: E=Sophos;i="4.44,293,1249228800"; d="scan'208,217";a="497370712" Received: from unknown (HELO tigereye) ([203.206.13.63]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 29 Aug 2009 06:46:15 +0800 From: "John C. Turnbull" To: "'Lua list'" Subject: Kahlua usage and support Date: Sat, 29 Aug 2009 08:46:13 +1000 Message-ID: <004f01ca2831$59f4bb80$0dde3280$@com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0050_01CA2885.2BA0CB80" X-Mailer: Microsoft Office Outlook 12.0 thread-index: AcooMVR37eqtjJ9oRcCHNZ0mN8Yi+w== Content-Language: en-au X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0050_01CA2885.2BA0CB80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I am experimenting with the Java Lua library Kahlua and would like to contact the author who appears to be a person name Kristofer Karlsson. Does anyone know how to contact him? There don't appear to be any links for contacting the authors or committers on the Kahlua website. Also, is anyone else using Kahlua? So far it seems to be very fast compared to other Java scripting solutions. Thanks, John ------=_NextPart_000_0050_01CA2885.2BA0CB80 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I am experimenting with the Java Lua library Kahlua = and would like to contact the author who appears to be a person name = Kristofer Karlsson.  Does anyone know how to contact him?  There = don’t appear to be any links for contacting the authors or committers on the = Kahlua website.

 

Also, is anyone else using Kahlua?  So far it = seems to be very fast compared to other Java scripting solutions.

 

Thanks,

 

John

------=_NextPart_000_0050_01CA2885.2BA0CB80-- From lua-bounces@bazar2.conectiva.com.br Sat Aug 29 03:44:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7T6iRQY021893; Sat, 29 Aug 2009 03:44:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 893A018D90; Sat, 29 Aug 2009 03:43:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F9A218B38 for ; Sat, 29 Aug 2009 03:43:47 -0300 (BRT) Received: by bwz10 with SMTP id 10so1098422bwz.5 for ; Fri, 28 Aug 2009 23:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=I7BHUCSG1YgaYNo9AylziRn3E2an+FL5lQPChTb3xds=; b=gzkxI8HytoUQVXhwcJmqoA31fRD48qs97p3IRGJ/JraOstA4/+Vo88Tn7ld0I8e9jn jgED6tjWxwUq/i74rpZNH5As1sD9J/OK2dZmYl4tiI0sz5kih8g9fBOOnnXeZermopyN lz8ZuO24FPVHhZeuDiec81KFIECt8OkRWcrew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YLTXZn0pWmrz5noTR+vX3NP6iI+M4AcZ2CanO/ce/bBD6fWhVe4WFwohyjAr58p8hr EGlhNozVc5TPuS3cywpino4ivlDN1Nb/fULfdnKy7s5dBBrdrbpmD11wDtK71zkhW9vO FUdaeb8ObNivlKz9zQeFEiBd5GgAplEaNAF7c= MIME-Version: 1.0 Received: by 10.204.19.141 with SMTP id a13mr1738045bkb.11.1251528223082; Fri, 28 Aug 2009 23:43:43 -0700 (PDT) In-Reply-To: <004f01ca2831$59f4bb80$0dde3280$@com.au> References: <004f01ca2831$59f4bb80$0dde3280$@com.au> Date: Sat, 29 Aug 2009 08:43:43 +0200 Message-ID: <13af99c70908282343m19749091g454537a29642984@mail.gmail.com> Subject: Re: Kahlua usage and support From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=00032555fcde29c9220472421ff5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555fcde29c9220472421ff5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi, I subscribe to this list so that's one way of reaching me. You should have my email by now, but maybe I have missed adding contact information to the project site. I'll fix that! On Sat, Aug 29, 2009 at 12:46 AM, John C. Turnbull wrote: > I am experimenting with the Java Lua library Kahlua and would like to > contact the author who appears to be a person name Kristofer Karlsson. D= oes > anyone know how to contact him? There don=92t appear to be any links for > contacting the authors or committers on the Kahlua website. > > > > Also, is anyone else using Kahlua? So far it seems to be very fast > compared to other Java scripting solutions. > > > > Thanks, > > > > John > --00032555fcde29c9220472421ff5 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi, I subscribe to this list so that's one way of reaching me.

Y= ou should have my email by now, but maybe I have missed adding contact info= rmation to the project site.
I'll fix that!


On Sat, Aug 29, 2009 at 12:46 AM, John C. Turnbull <ozemale@ozemail.com.au> wrote:

I am experimenting with the Java Lua library Kahlua and would like to contact the author who appears to be a person name Kristofer Karlsson.=A0 Does anyone know how to contact him?=A0 There don=92t appear to be any links for contacting the authors or committers on the Kahl= ua website.

=A0

Also, is anyone else using Kahlua?=A0 So far it seems to be very fast compared to other Java scripting solutions.

=A0

Thanks,

=A0

John


--00032555fcde29c9220472421ff5-- From lua-bounces@bazar2.conectiva.com.br Sat Aug 29 08:40:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7TBe3rR015474; Sat, 29 Aug 2009 08:40:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2F3019183; Sat, 29 Aug 2009 08:39:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 422E319092 for ; Sat, 29 Aug 2009 08:39:30 -0300 (BRT) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090829113924.FLUR5579.mtaout03-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Sat, 29 Aug 2009 12:39:24 +0100 Received: from STORE.store ([80.6.14.212]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090829113924.ZBRH21638.aamtaout02-winn.ispmail.ntl.com@STORE.store> for ; Sat, 29 Aug 2009 12:39:24 +0100 Received: from [192.168.2.2] (unknown [192.168.2.2]) by STORE.store (Postfix) with ESMTP id A4B7EB9E4 for ; Sat, 29 Aug 2009 12:43:45 +0100 (BST) Message-ID: <4A991362.20706@ntlworld.com> Date: Sat, 29 Aug 2009 12:39:14 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: WereChipmunk a wrapper for the chipmunk "physics" (dynamics) library Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=DgL5a90Zam4A:10 a=pvUTTXiTAAAA:20 a=sHjPXZoa8f7PL7cDr0wA:9 a=BpGjfqTMZKn4jzlZofYA:7 a=PR9aG1Q0dmkpnue_DsPD-QiQaH0A:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Theres a few vid's on the site, its early days yet but more than usable http://sites.google.com/site/werechipmunk/home Enjoy! Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 00:19:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7U3JRBW032307; Sun, 30 Aug 2009 00:19:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31FC718BB1; Sun, 30 Aug 2009 00:18:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7369018F43 for ; Sun, 30 Aug 2009 00:18:48 -0300 (BRT) Received: by yxe36 with SMTP id 36so453965yxe.11 for ; Sat, 29 Aug 2009 20:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Bnc6ByjtHmREN3EiaTfze/vnkMOBgFfv5a8y6jVsHSw=; b=lUZIF8MBo7CZcJgAmEnA3QKwhduvZlT5vap5cnTAR8Es+wRtDG8A0p+tQfHXo1AJ58 T+JRNZ8egnZY6DUuJxpVoNt15x+bPvUcLiQpRWFWKX/npou80nMamTlWPRm+89en5FbH +fHICXy29mvXQru8Q7ned/vYi5thYuvy2woBw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eLxG/1DWKJ1KhBFvyWEVEbwdT0TD0b++kbX4hCEl7x7lrYrf8XfAiYhP0qvLJSfGPs +75cWSNA6TTWnT8vO80YqtN12SzSwXpOPvZXwe9a/tpBNztLwkNsNvr/M2msmTuYF57+ 1fK22DiZJfKgui2mHR6fa2g7iLpzkOZLgvIbo= MIME-Version: 1.0 Received: by 10.101.9.38 with SMTP id m38mr3488292ani.21.1251602326311; Sat, 29 Aug 2009 20:18:46 -0700 (PDT) Date: Sun, 30 Aug 2009 11:18:46 +0800 Message-ID: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> Subject: is there any lua vm on mcu? especially on 8051 From: =?GB2312?B?1Ma3q72t?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636b2b0c30f542a04725360ac X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b0c30f542a04725360ac Content-Type: text/plain; charset=ISO-8859-1 hi,i found that a python vm on mcu,so i wonder if there's a lua vm on mcuespecially on 8051 -- welcom to gtalk me http://hi.baidu.com/jyf1987 --001636b2b0c30f542a04725360ac Content-Type: text/html; charset=ISO-8859-1 hi,i found that a python vm on mcu,so i wonder if there's a lua vm on mcu
especially on 8051

--
welcom to gtalk me
http://hi.baidu.com/jyf1987
--001636b2b0c30f542a04725360ac-- From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 05:50:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7U8oJi4007689; Sun, 30 Aug 2009 05:50:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE4DE1883F; Sun, 30 Aug 2009 05:49:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jenni1.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E401F186A0 for ; Sun, 30 Aug 2009 05:49:43 -0300 (BRT) Received: from [192.168.1.2] (84.249.116.128) by jenni1.inet.fi (8.5.014) id 4A776AE600E4A922 for lua@bazar2.conectiva.com.br; Sun, 30 Aug 2009 11:49:41 +0300 Message-Id: <7704C587-2A0E-445D-81C9-4E87AF7D4C61@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: is there any lua vm on mcu? especially on 8051 Date: Sun, 30 Aug 2009 11:49:38 +0300 References: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7U8oJi4007689 Certainly not for the 8051 or any other 8-bit processor. For embedded Lua see: http://www.eluaproject.net/ -asko 云帆江 kirjoitti 30.8.2009 kello 6:18: > hi,i found that a python vm on mcu,so i wonder if there's a lua vm > on mcu > especially on 8051 > > -- > welcom to gtalk me > http://hi.baidu.com/jyf1987 From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 08:55:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UBsvNU022745; Sun, 30 Aug 2009 08:54:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 420B518E58; Sun, 30 Aug 2009 08:54:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EF621882C for ; Sun, 30 Aug 2009 08:54:19 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so665751eye.39 for ; Sun, 30 Aug 2009 04:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Nwr6DNoM0Y4CMEHjc73MU/UOgO0HW9xoNNk69udwmAQ=; b=GZQblDWWl+4NWn6rUf1hIaVIPDUlm0aaBk0FXKX0odvrlsFKb8YWz6pGsN0jRx8Kso w5TA3j2sEdZuu5oUaWdKumfq1198Yfcp/+sIxR+0uRAiEbpYpsdV2ui+jJji/FXfMFIZ Gl4IEI8SWxDEog9n3A0KpfMf/tnqqbSOAfaj8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=wMIqFue6ffqr4qPDClUimg5mjaCsbG4G876MQi4aNTeo4syMeAz1IzzulYdfeqZTQg a6KlNKVaGgPXEvpjhWTvfMiHvzlCjn1hm6u+vw+M6UeVgGjVIMNttAm9TjEVZHGQXoA2 Wz6kt+grRD2x8suMSHzzUv5KE6ZXShsT8H9go= MIME-Version: 1.0 Received: by 10.216.86.204 with SMTP id w54mr858329wee.54.1251633257084; Sun, 30 Aug 2009 04:54:17 -0700 (PDT) In-Reply-To: References: From: Leaf Storm Date: Sun, 30 Aug 2009 07:53:57 -0400 Message-ID: Subject: Re: [ANN] libmc To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Aug 25, 2009 at 11:03 PM, David Manura wrote: > There have been a number of efforts in this direction [1]. For > example, there is a fair amount of overlap with Steve's recent > penlight [2], including pl.operator [3], pl.stringx [4], pl.tablex > [5], and pl.text.wrap [6]. I've looked at Penlight before, and it's a nice project. I think, though, that there's a bit of a philosophical difference between libmc and Penlight. Some of the ideas on my wishlist page notwithstanding, the libmc idea is to fill in the stuff Lua doesn't provide, and Penlight's is to do that and add stuff - like the lexer, the 'pl.input' module, the file tools, etc. Consequently, libmc is a single .lua file at 22K, and Penlight is a big 256K package. libmc is to be pure Lua, with no dependencies. Penlight requires LuaFileSystem. libmc seperates arguments in functions with a comma and a space. Penlight doesn't bother with spaces. Of course, I'm not in Steve's head, so I can't really describe Penlight's design philosophy, but I think there are some different ideas working in libmc. (Though the Penlight source does give me some good ideas for implementation.) > I think it would be a good thing to try to > merge your work with his. I'm a bit unsure about that. There are only a few things in libmc that are not in Penlight, and our coding styles are very different. But if he asks, I'd be more than happy to let him use any of my code. >> For simplicity, it loads a good degree of >> them into the 'math', 'string', and 'table' standard tables, with the >> rest going in the 'mc' table. > > The can be good or bad. See "To Inject or not to Inject?" in [7]. It > has been previously discussed [8][9]. Now that you bring it up, I can see some problems that would arise from the injection. I suppose I could switch everything to a single 'mc' module, and then people could call 'mc:inject()' to inject the math, string, and table functions. -- Regards, LeafStorm "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 09:35:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UCZMps026073; Sun, 30 Aug 2009 09:35:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D58F519295; Sun, 30 Aug 2009 09:34:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52B2219198 for ; Sun, 30 Aug 2009 09:34:51 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so756434qwi.11 for ; Sun, 30 Aug 2009 05:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=pC1AuRGOroIVxJGWlP93g2dOSBkxUp8Dq3FWpKLFxr4=; b=Dp0JK8G/u1jI8HsGrjPO/Gw0k0kMqSp5XWQId3dtkkI+qNYXlQxy+4OB5KmhmCQhUK /UHyg8fcTyCJgVGsOY0yDsZIhAzFrRWl1bg5b9xgcUCRm8nEtvI78SP9iXWFWlaUfXRv 0XBkXzuJCG776b72XRDymzXp/8CKxSI5JCsnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=c0BCYB7VJYlRTyNsJMYxsBWlFTdqd2zGfPAJsH3I3/crGSQgTLbCkar0K2lH+Gzzcw D0wiP2JCulcAuEnlJUCJtbIeXuYDnlDVKA8lCgnQMIa/uIrqB2O8E/90M1WxZaXdg2L9 lTeQc/mT+ViwK3AwTr4NbBx18XwxQIluIUMVI= MIME-Version: 1.0 Received: by 10.229.1.218 with SMTP id 26mr1212186qcg.79.1251635689329; Sun, 30 Aug 2009 05:34:49 -0700 (PDT) In-Reply-To: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> References: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> Date: Sun, 30 Aug 2009 20:34:49 +0800 Message-ID: Subject: Re: is there any lua vm on mcu? especially on 8051 From: Linker To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7UCZMps026073 Lua vm need a ANSI C compiler. On 8/30/09, 云帆江 wrote: > hi,i found that a python vm on mcu,so i wonder if there's a lua vm on > mcuespecially > on 8051 > > -- > welcom to gtalk me > http://hi.baidu.com/jyf1987 > -- Sent from my mobile device Regards, Linker Lin linker.m.lin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 09:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UCuM4a028191; Sun, 30 Aug 2009 09:56:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25008192A2; Sun, 30 Aug 2009 09:55:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B19F31929D for ; Sun, 30 Aug 2009 09:55:51 -0300 (BRT) Received: by fxm25 with SMTP id 25so2421684fxm.5 for ; Sun, 30 Aug 2009 05:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=SW5nzbVaCm9Ok0uXMdV/lTQXiLDcumijw0uBUXRK4xQ=; b=xytgkJusMtJl48F1c038jKjrtsIiw5fWE/+NfehvIjlbHvlLi557m0lDUCHKthEa1c gncEYHvUcMvsFzOv9fHUUmAV03GgEXLjXHVJD1qQ7IdUsyBvT3QsYjXxstfESwCZegSo UEsNWW4K2UliOxaDa9Iw+VwElKWl2lUjeyFfI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WjsK3VfFgPi9w3FjiCWlUXAG/f0O3m2Av5lkGAUFTgFC19GuqoIJLqkRAqI1E+Bniu 3jBsBmya3uHUEF/hZIst+EihSZu0m//CCBxPSyoyOpK1LuzZ5VHy903gMR/TQdluicyh 3w9liAu43l2J3IEpzQOmoINfY37vlrU3uMxLM= MIME-Version: 1.0 Received: by 10.204.18.145 with SMTP id w17mr3176118bka.42.1251636949974; Sun, 30 Aug 2009 05:55:49 -0700 (PDT) In-Reply-To: References: Date: Sun, 30 Aug 2009 14:55:49 +0200 Message-ID: <560972290908300555ge13ab58ne625990e8d623773@mail.gmail.com> Subject: Re: [ANN] libmc From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Aug 30, 2009 at 1:53 PM, Leaf Storm wrote: > and Penlight. Some of the ideas on my wishlist page notwithstanding, > the libmc idea is to fill in the stuff Lua doesn't provide, and > Penlight's is to do that and add stuff - like the lexer, the > 'pl.input' module, the file tools, etc. I've been looking at the wishlist and wondering about that as well ;) http://bitbucket.org/leafstorm/libmc/wiki/Wishlist And a fine set of wishes they are - but once you have implemented them, you are going to get that 35K up to 190K which is the size of the Penlight source. I like small & focussed myself, hate huge big frameworks, so I understand the motivation. The way out of the (apparent) difficulty is a philosophy which C++ people call 'Don't have to pay for what you don't use', i.e. don't bring in the kitchen sink if the user just wants a split() function. PL uses lazy loading, that is, require 'pl' does not bring in all that 190K, but as soon as say tablex is referenced, that module will be loaded. I see you mention 'algebraic and geometric' formulae, definitely useful, but not to everyone. That probably ought to be a standalone module of its own. It would e.g. be cool to have the basic statistics functions like std dev, etc available. XML generation - I don't know the Python library, but it's a pity that there is no DOM implementation AFAIK that could be used with luaexpat, or no XML prettyprinter that could work on the same LOM format. In that case, I would probably try to motivate it as an add-on to LuaExpat (i.e. something like lxp.dom and lxp.writer). Unit conversions: documentation is a little patchy (par for the course) but this seems to work very well: http://luaforge.net/projects/luadc steve d. From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 12:16:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UFGHpB009854; Sun, 30 Aug 2009 12:16:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C0BF18C6A; Sun, 30 Aug 2009 12:15:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E98818B28 for ; Sun, 30 Aug 2009 12:15:43 -0300 (BRT) Received: from [192.168.254.14] (asy-tiv-ppp365.bmts.com [216.183.149.128]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n7UFFSJl011899 for ; Sun, 30 Aug 2009 11:15:39 -0400 Message-ID: <4A9A9790.9060700@hempeldesigngroup.com> Date: Sun, 30 Aug 2009 11:15:28 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: WereChipmunk a wrapper for the chipmunk "physics" (dynamics) library References: <4A991362.20706@ntlworld.com> In-Reply-To: <4A991362.20706@ntlworld.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Chris Camacho wrote: > Theres a few vid's on the site, its early days yet but more than usable > Oh, this is exciting. I have had this on my to-do list for months now. I was playng around with Love2D but the C++ interface was pretty ugly. A straight C based physics engine is a great tool for teaching basic game programming to kids. I look forward to having a go at this... Ralph From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 12:17:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UFH9k7009977; Sun, 30 Aug 2009 12:17:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 745E819297; Sun, 30 Aug 2009 12:16:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D029318EF0 for ; Sun, 30 Aug 2009 12:16:44 -0300 (BRT) Received: from [192.168.254.14] (asy-tiv-ppp365.bmts.com [216.183.149.128]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n7UFGfF4012512 for ; Sun, 30 Aug 2009 11:16:41 -0400 Message-ID: <4A9A97D8.4090900@hempeldesigngroup.com> Date: Sun, 30 Aug 2009 11:16:40 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: is there any lua vm on mcu? especially on 8051 References: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> <7704C587-2A0E-445D-81C9-4E87AF7D4C61@dnainternet.net> In-Reply-To: <7704C587-2A0E-445D-81C9-4E87AF7D4C61@dnainternet.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Asko Kauppi wrote: > > Certainly not for the 8051 or any other 8-bit processor. > > For embedded Lua see: http://www.eluaproject.net/ And pbLua for LEGO MINDSTORMS NXT: Ralph From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 15:40:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7UIeB5s028782; Sun, 30 Aug 2009 15:40:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F504192A1; Sun, 30 Aug 2009 15:39:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89D3518C8B for ; Sun, 30 Aug 2009 15:39:30 -0300 (BRT) Received: by ewy11 with SMTP id 11so3169563ewy.35 for ; Sun, 30 Aug 2009 11:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=UrweV29T0j2eLKVm+/l9lQwSw4k/eJNesljBir0fHTA=; b=nsl0TYSmaP4ai+DeHoUCWofR0ZK0uexIaI06lm6WfuOdWOGEV2fKvW8NK++14MtGtx e7RPdNKumScwF6BxAaXNcsPhwYhZlB6CVcwaSN+pPII3EQ7NFnDKQ5UlrFOgZsqDNJZT mxyCgLhqqRi+P806/Nb6p2ZB9XG9z+Lao14pM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=j5Dy4qjFOu4Ym5RENKY8zntKbjTD1JDAefh/f5vqzISkTF2hV6QuMsjzvr+xhyVcQa bB3KvON3oPinUadrIIPCQbMjbBtZFKuE3bG5E1RcOccXtTJpBdwp9vFnyCBK9dwcfKr9 SUnw3SVcy9m5rtGryo5bn4J+hJ04CLctIhUGY= MIME-Version: 1.0 Received: by 10.216.55.208 with SMTP id k58mr959718wec.9.1251657568148; Sun, 30 Aug 2009 11:39:28 -0700 (PDT) In-Reply-To: <560972290908300555ge13ab58ne625990e8d623773@mail.gmail.com> References: <560972290908300555ge13ab58ne625990e8d623773@mail.gmail.com> From: Leaf Storm Date: Sun, 30 Aug 2009 14:39:08 -0400 Message-ID: Subject: Re: [ANN] libmc To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n7UIeB5s028782 Now that I've really stepped back and analyzed why I'm doing this, I'm realizing how ridiculous my wishlist really is. :-) Pretty much the only thing I really think has a chance of getting in (besides the "Really useful generic stuff" section) if I want to keep libmc light and simple is the option parser. The algebraic/geometric stuff you are right about - it's not something most people need, and would be better in a separate library. And as for unit conversions, it wouldn't be that it's so hard to implement, but the conversion factors would be just really bulky. The XML generation involves something along the lines of xml.p {class = 'greeting', "Hello, world!"} - really, just a quick & dirty way of generating XML. Though I used Genshi as an example, a better idea of what I was thinking is at http://dev.pocoo.org/projects/werkzeug/browser/werkzeug/utils.py, in the HTMLBuilder class. It implements that in just a couple of KB, whereas Genshi is a big library that manipulates the DOM and stuff. Anyway, remember - it *is* a wishlist. :-) Regards, LeafStorm "There are 10 types of people in the world - those who understand binary and those who don't." On Sun, Aug 30, 2009 at 8:55 AM, steve donovan wrote: > On Sun, Aug 30, 2009 at 1:53 PM, Leaf Storm wrote: >> and Penlight. Some of the ideas on my wishlist page notwithstanding, >> the libmc idea is to fill in the stuff Lua doesn't provide, and >> Penlight's is to do that and add stuff - like the lexer, the >> 'pl.input' module, the file tools, etc. > > I've been looking at the wishlist and wondering about that as well ;) > > http://bitbucket.org/leafstorm/libmc/wiki/Wishlist > > And a fine set of wishes they are - but once you have implemented > them, you are going to get that 35K up to 190K which is the size of > the Penlight source.  I like small & focussed myself, hate huge big > frameworks, so I understand the motivation.  The way out of the > (apparent) difficulty is a philosophy which C++ people call 'Don't > have to pay for what you don't use', i.e. don't bring in the kitchen > sink if the user just wants a split() function.  PL uses lazy loading, > that is, require 'pl' does not bring in all that 190K, but as soon as > say tablex is referenced, that module will be loaded. > > I see you mention 'algebraic and geometric' formulae, definitely > useful, but not to everyone. That probably ought to be a standalone > module of its own. It would e.g. be cool to have the basic statistics > functions like std dev, etc available. > > XML generation - I don't know the Python library, but it's a pity that > there is no DOM implementation AFAIK that could be used with luaexpat, > or no XML prettyprinter that could work on the same LOM format.  In > that case, I would probably try to motivate it as an add-on to > LuaExpat (i.e. something like lxp.dom and lxp.writer). > > Unit conversions: documentation is a little patchy (par for the > course) but this seems to work very well: > > http://luaforge.net/projects/luadc > > steve d. > From lua-bounces@bazar2.conectiva.com.br Sun Aug 30 22:21:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7V1Lsjp029473; Sun, 30 Aug 2009 22:21:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B62AF19169; Sun, 30 Aug 2009 22:21:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-0.csi.cam.ac.uk (ppsw-0.csi.cam.ac.uk [131.111.8.130]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D87318682 for ; Sun, 30 Aug 2009 22:21:17 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:35829) by ppsw-0.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.150]:25) with esmtpa (EXTERNAL:fanf2) id 1Mhva4-00056N-1A (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Mon, 31 Aug 2009 02:21:12 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mhva4-0007DA-B3 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Mon, 31 Aug 2009 02:21:12 +0100 Date: Mon, 31 Aug 2009 02:21:12 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua list Subject: Re: lua crashing on unrecognized strings In-Reply-To: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> Message-ID: References: <17eac67c0908271148j3a8e7714r5a866c7e8c6ca5db@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 27 Aug 2009, Sam Roberts wrote: > > I would assumed the documented behaviour on Linux > EINVAL The mode provided to fopen(), fdopen(), or freopen() was invalid. > Would be the ANSI defined behaviour. Standard C has a surprisingly small number of errno values: just EDOM and ERANGE (for maths) and EILSEQ (for multibyte characters). Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Mon Aug 31 05:44:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n7V8irDb006399; Mon, 31 Aug 2009 05:44:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0CDA918EC5; Mon, 31 Aug 2009 05:44:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sirppi.helsinki.fi (sirppi.helsinki.fi [128.214.205.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E98DA18CF4 for ; Mon, 31 Aug 2009 05:44:16 -0300 (BRT) Received: from sirppi.helsinki.fi (localhost [127.0.0.1]) by sirppi.helsinki.fi (8.13.7/8.13.7) with ESMTP id n7V8iCbO103490 for ; Mon, 31 Aug 2009 11:44:12 +0300 (EEST) Received: (from jpihlaja@localhost) by sirppi.helsinki.fi (8.13.7/8.13.7/Submit) id n7V8iBb2092674; Mon, 31 Aug 2009 11:44:11 +0300 (EEST) Date: Mon, 31 Aug 2009 11:44:11 +0300 (EEST) From: M Joonas Pihlaja To: Lua list Subject: LUA_USE_APICHECK assert messages Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi lua-l, I have a bit of a wish list item concerning the assert messages turned on when compiling with LUA_USE_APICHECK: Could they include a human readable string which tells the user approximately what the assert is testing? The APICHECK checks could be easier to use for people who don't know the code base well enough to decipher the context of an assertion from the code alone on the spot. I've used the following style of assertions before just for this purpose to get the assert() mechanism to dump out a message explaining what's going on: assert(condition && "message"); Cheers, Joonas From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 09:31:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n81CVCfc002056; Tue, 1 Sep 2009 09:31:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69C9819330; Tue, 1 Sep 2009 09:30:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C41C19327 for ; Tue, 1 Sep 2009 09:30:24 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 06074B1DC7 for ; Tue, 1 Sep 2009 15:30:15 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: lua@bazar2.conectiva.com.br Date: Tue, 01 Sep 2009 15:30:05 +0300 Subject: userdata environment MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Maual says: << Environments associated with userdata have no meaning for Lua. It is only a convenience feature for programmers to associate a table to a userdata. >> Would it be possible to have Udata->env of type GCObject *? It seems quite a waste to allocate table just to attach, say, one string to a userdata. From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 11:21:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n81ELmHN026490; Tue, 1 Sep 2009 11:21:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C298E1934C; Tue, 1 Sep 2009 11:21:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A839419326 for ; Tue, 1 Sep 2009 11:21:10 -0300 (BRT) Received: by bwz10 with SMTP id 10so2872537bwz.5 for ; Tue, 01 Sep 2009 07:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=2pXUWzpQ98YuokQfcC3/kcoxMa3zGR3gMstLHLBkNio=; b=PKT/PotcPxEZxbb5x6yf85IADXc+Bz5IzPdrK5aDxwPqC3eL/2jgpEzI1cDvb8Li4G sWK3fJcQBNVKuBGKx2op3RnALDitgYlU9yZZEpyYS0thUVQ1EqYkFSymz8yXsQsRnZI1 zbJtvHRGAfUUjOLHeuZ18+zAiYaiNAJfucpEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=hVuEGitQkms61Ip39s27a1NtVZ1WLjf93ibiVhdDMV4NnzS+gPsqOJlGOPh7fMNSb6 +ChMagaq8jjCMVdS4kWCZNfOoJrmJ7U2VbhSUgKjUcprFkt30fDj9Yd94mbx5EB/fJyH BYdXWnsVd8l8SWMMKQBuvwwUqTvtK49ht338s= MIME-Version: 1.0 Received: by 10.204.32.206 with SMTP id e14mr5589170bkd.22.1251814868127; Tue, 01 Sep 2009 07:21:08 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Tue, 1 Sep 2009 16:20:48 +0200 Message-ID: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> Subject: Re: userdata environment To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/1 Juris Kalnins : > Maual says: << Environments associated with userdata have no meaning for > Lua. It is only a convenience feature for programmers to associate a table > to a userdata. >> > > Would it be possible to have Udata->env of type GCObject *? > It seems quite a waste to allocate table just to attach, say, one string to > a userdata. When I first used userdata environment I assumed it was the case and was quite disappointed to discover it's not. However you have other methods to associate metadata to a userdata. For example you can use a weak table in the registry, with the userdata as a weak key and the string as value. From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 17:37:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n81KbmIo021121; Tue, 1 Sep 2009 17:37:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C81871928F; Tue, 1 Sep 2009 17:37:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01D661926C for ; Tue, 1 Sep 2009 17:37:05 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mia62-0004aZ-Vb for ; Tue, 01 Sep 2009 21:36:55 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mia6B-0008NY-6d for lua@bazar2.conectiva.com.br; Tue, 01 Sep 2009 21:37:03 +0100 Date: Tue, 1 Sep 2009 21:37:02 +0100 From: Rob Kendrick To: Lua list Subject: Feature request for 5.2; make exit codes from popen()ed programs obtainable Message-ID: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Currently in Lua, it appears as if it is impossible to obtain the exit code of a program that you have opened with io.popen(); the close method on the returned object only returns true. Are there reasons for it not return this? If not, can I request it be considered for 5.2? B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 22:17:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n821HJW2030552; Tue, 1 Sep 2009 22:17:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08E8E18B9F; Tue, 1 Sep 2009 22:16:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D11BC18B12 for ; Tue, 1 Sep 2009 22:16:40 -0300 (BRT) Received: by iwn42 with SMTP id 42so205467iwn.33 for ; Tue, 01 Sep 2009 18:16:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.6.79 with SMTP id 15mr8230412iby.36.1251854196518; Tue, 01 Sep 2009 18:16:36 -0700 (PDT) In-Reply-To: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> References: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> Date: Tue, 1 Sep 2009 21:16:35 -0400 Message-ID: <790db3550909011816s45547427w40e2685ccf718bfd@mail.gmail.com> Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n821HJW2030552 On Tue, Sep 1, 2009 at 4:37 PM, Rob Kendrick wrote: > Hi, > > Currently in Lua, it appears as if it is impossible to obtain the exit > code of a program that you have opened with io.popen(); the close > method on the returned object only returns true. > > Are there reasons for it not return this?  If not, can I request it be > considered for 5.2? This has been discussed [1]. There were some hacks proposed for obtaining the status code in that thread. It would be nice if popen returned the status code. I feel it should be a second argument, however, because popen may fail early with "nil, ". -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 22:17:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n821HsGV030684; Tue, 1 Sep 2009 22:17:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82FAD19392; Tue, 1 Sep 2009 22:17:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACF8D18B12 for ; Tue, 1 Sep 2009 22:17:03 -0300 (BRT) Received: by mail-iw0-f204.google.com with SMTP id 42so205467iwn.33 for ; Tue, 01 Sep 2009 18:17:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.24.208 with SMTP id w16mr8205074ibb.38.1251854223277; Tue, 01 Sep 2009 18:17:03 -0700 (PDT) In-Reply-To: <790db3550909011816s45547427w40e2685ccf718bfd@mail.gmail.com> References: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> <790db3550909011816s45547427w40e2685ccf718bfd@mail.gmail.com> Date: Tue, 1 Sep 2009 21:17:03 -0400 Message-ID: <790db3550909011817q5b15fda4i5c0cac99cd6ef601@mail.gmail.com> Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 1, 2009 at 9:16 PM, Patrick Donnelly wrote: > This has been discussed [1]. There were some hacks proposed for > obtaining the status code in that thread. It would be nice if popen > returned the status code. I feel it should be a second argument, > however, because popen may fail early with "nil, ". Knew I forgot something... [1] http://lua-users.org/lists/lua-l/2009-06/msg00124.html -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Sep 1 23:07:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8227O5k003729; Tue, 1 Sep 2009 23:07:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E99319392; Tue, 1 Sep 2009 23:06:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.211.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FDEC19382 for ; Tue, 1 Sep 2009 23:06:50 -0300 (BRT) Received: by ywh7 with SMTP id 7so830343ywh.21 for ; Tue, 01 Sep 2009 19:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=dkgv8pjzfL0BI3z1jYhp1aFLY2pTO4c9xTkvu1MrVr8=; b=AdN0PokwX/7TOhzPsoWRYwCvFGBr9KIlHm8nfVJ8z3znUqTxDqZDTPOcteaxOk/wuO dM6KcJxm2VqNMrZsd7xV16Z3nfkBXggtSPImVkDVIVSLonHHgmBYWCjBVy5Kc8/f3NXU /vaifAls5GDOoYgH5jOLZx7UY82jz9pHMDxi0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=LmmI3qMH7r9trk9kcOGC9AdMna2Vqg5rK9teehF6GXNpDzTYIAFWgo4s+qEYmv6PiB vg40NJaccQdXk7VxHZBqXxys8dQr5rCUArzaRWkO92oTcUR5xDo0mncehzeTXtSaEZa5 JVes9UBHekVkM5w89UB75y6+7RMZI58p+eXJc= MIME-Version: 1.0 Received: by 10.150.169.6 with SMTP id r6mr12890750ybe.95.1251857208371; Tue, 01 Sep 2009 19:06:48 -0700 (PDT) In-Reply-To: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> References: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> From: RJP Computing Date: Tue, 1 Sep 2009 22:06:28 -0400 X-Google-Sender-Auth: 0f987ef70305714f Message-ID: Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8227O5k003729 On Tue, Sep 1, 2009 at 4:37 PM, Rob Kendrick wrote: > Hi, > > Currently in Lua, it appears as if it is impossible to obtain the exit > code of a program that you have opened with io.popen(); the close > method on the returned object only returns true. > > Are there reasons for it not return this?  If not, can I request it be > considered for 5.2? I would love this. Please, oh please add this. I have worked with the hacks and they are not great. -- Regards, Ryan From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 04:43:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n827hKbn006535; Wed, 2 Sep 2009 04:43:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C783193D9; Wed, 2 Sep 2009 04:42:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84780192A0 for ; Wed, 2 Sep 2009 04:42:37 -0300 (BRT) Received: by bwz10 with SMTP id 10so597503bwz.5 for ; Wed, 02 Sep 2009 00:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8BY6oQ0urmvsMJMOrP21+I6BicLe498yG7RtVsrQtnQ=; b=Nm2sRofYpIoNnQxE07rM7Uo5yq7yiWtAtU2gs16iO4KGfx5LvshYKlG4RfNB4pMHwj kiWqXbpzYXzZGqC6FeEgK/pgXHajgBsBju3qv+3cOQHfoeJ3OTKe2NXRppj8gQWPSwA8 /iQLaRbinVpx9peVUsaWTy22EAGsU2QfhogZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uv3wijDoY2GTHXp71v6hsTIS5BKhw+mEwz/qer7c4X1VkFAa9Pa/xmCIppRRFLVYIi 6kmoO2Fa3iMRhVbeaW7FMdXMurlvrVO3bucHG3yOT/vut043x1VksLmquJAPv6AdSOrU cxj7HGy/MZIrhw+ZsLIe/1/pXVKKty/0eggKU= MIME-Version: 1.0 Received: by 10.204.151.210 with SMTP id d18mr6409538bkw.203.1251877355074; Wed, 02 Sep 2009 00:42:35 -0700 (PDT) In-Reply-To: References: <20090901213702.4a6a9af0@trite.i.flarn.net.i.flarn.net> Date: Wed, 2 Sep 2009 09:42:35 +0200 Message-ID: <560972290909020042p62439f70of700edab5bb502d5@mail.gmail.com> Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 2, 2009 at 4:06 AM, RJP Computing wrote: > I would love this. Please, oh please add this. I have worked with the > hacks and they are not great. It seems very doable, since _popen/_pclose in Windows console apps works in a fairly standard way. Adding an explicit pclose method would be easy, although getting sensible errors (i.e. if called on a file object not returned by popen) might take some work. For Windows GUI apps, then one has to use something like lua-ex since the C runtime version only works for the console subsystem. But this is not Lua's problem ;) http://msdn.microsoft.com/en-us/library/96ayss4b(VS.80).aspx steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 05:23:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n828N9pJ010413; Wed, 2 Sep 2009 05:23:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E031E193E5; Wed, 2 Sep 2009 05:22:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A885F193E7 for ; Wed, 2 Sep 2009 05:22:34 -0300 (BRT) Received: by bwz10 with SMTP id 10so619069bwz.5 for ; Wed, 02 Sep 2009 01:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=v4eTLlWbOpopzB1kZzdnwuK98dqPW+UWLA682AfL/rU=; b=ruXsVRHfRmJMTFtS+Hn7imhEMP61F+PbXAYIiRsN9RtrISoQYTqPNf4/s1jSkzHeyI iF08u9m4WfwFKZFT/MvAFxGYT6FKYtTM5P/IznUsRfmYXnijMY97DUTArj+hFdHmAEVw 9rRk0jLagQg1+1t6Mq1/Uub4NL66b5mVFIBms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UkCMNHlMhAsfUOmL8vpvQXTZ+9tcQkJ6YNFc5hMCQKBudxVaDq1vH/7p7Honpv71xR 8yDco9MHTrV67wCzvRoYnnKJwpsegMFiuCFrkPMw1HJuZkVEnuC4Q8Pdazr5gBdxzljT bRdJfLgG0p1Slk+sFuv3OB5TgKw/Tb37uQozA= MIME-Version: 1.0 Received: by 10.204.154.203 with SMTP id p11mr6486176bkw.180.1251879752080; Wed, 02 Sep 2009 01:22:32 -0700 (PDT) Date: Wed, 2 Sep 2009 10:22:32 +0200 Message-ID: <560972290909020122r13aa2ef1xff1b9344e52364a@mail.gmail.com> Subject: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Anyway, remember - it *is* a wishlist. :-) While we are exchanging wishlists, here's one of mine ;) Although code may be free (in both senses of the English word) it can still be expensive in terms of time needed to understand it. In an ideal world there would be as little friction as possible in the process, i.e. that when using a new module, the accidental complexity should be as little as possible. (May well be essential complexity, sometimes things _are_ rocket science.) A The ideal module: 0 well named (using namespaces) 1 well focused 2 well contained 3 explicit dependencies 4 documented in some standard way 5 adequate test coverage 6 useful examples A0 may seem obvious but namespaces are increasingly a must. CPAN is looking after 16486 modules (!) and the only way that they can coexist is by disciplined use of namespaces (e.g [0]). A project needs a cool name, but a module needs a useful name. A2 means that a module behaves itself and doesn't mess with the global table, except to introduce its own table. A module can of course be 'injected' into the global table, but only on explicit request. B And the ideal package manager: 1 handles dependencies (must do this automatically, like LuaRocks [1]) 2 integrated documentation (must be available from a central index after installation, e.g like perldoc) 3 specifies external dependencies in a useful way (in an ideal world, it use the native package manager to find these) 4 searchable for capabilities and module names (e.g. that the module 'lfs' corresponds to the package 'LuaFileSystem' - new LR will do this) 5 flexible tag-based classification (so we aren't tied to a inflexible fixed hierarchy, like the Trove system [2]) It seems hard to do B2 without A4, without resorting to hacks & heuristics (is there a README? is there an index.html, perhaps in an 'en' folder? ...) So naturally there have been Lua people interested in the Perl POD format. B4 & B5 are related; the idea is to get as much searchable metadata into the system. And hierarchies can be constructed dynamically from tags. B3 is a tough one, which is hard enough to solve for one system (e.g. Debian) let alone the whole universe of platforms, mostly without standard library repositories. This feels like a lot of work, which it is, but the idea is to minimize the amount of work the producer of the module has to do. Personally I think LuaRocks is getting there, especially with a nice front-end; (the next version will be using a more 'normal' way to manage modules) but delivering module documentation is not a major concern and writing cross-platform rockspecs remains a bit of an art. I've even toyed with the idea of writing a wizard for writing rockspecs ;) Documentation remains a big weakness. Probably it's that psychological illusion that code is self-evident, because one's head is full of the 'meta-implementation', all that stuff and cogitation needed to write a program, and which evaporates quickly and leaves us saying WTF? when reading our own code in six months. steve d. [0] http://search.cpan.org/modlist/Option_Parameter_Config_Processing [1] http://www.luarocks.org [2] http://luaforge.net/softwaremap/trove_list.php From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 06:30:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n829UcB8015819; Wed, 2 Sep 2009 06:30:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD608193FA; Wed, 2 Sep 2009 06:30:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jim.nabble.com (216-139-236-80.aus.us.siteprotect.com [216.139.236.80]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 369B5193F4 for ; Wed, 2 Sep 2009 06:30:06 -0300 (BRT) Received: from jim ([127.0.0.1]) by jim.nabble.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Sep 2009 04:30:05 -0500 Date: Wed, 2 Sep 2009 04:30:05 -0500 (CDT) From: yxtor To: lua@bazar2.conectiva.com.br Message-ID: <1251883805483-3565721.post@n2.nabble.com> In-Reply-To: <20090429164949.3eu87mywm8o8ccco@webmail.tuwien.ac.at> References: <20090429164949.3eu87mywm8o8ccco@webmail.tuwien.ac.at> Subject: Re: Lua/SWIG: output parameters of custom types as references? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: robert.aronica@arcontia.se X-OriginalArrivalTime: 02 Sep 2009 09:30:05.0499 (UTC) FILETIME=[F48330B0:01CA2BAF] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello. I am a new user here at Nabble. I wonder if anybody has an answer to Sebs question? Its really hard finding documentation about this. /Robert Sebastian Wolff wrote: > > Dear Lua community, > > I hope someone already encountered the following problem and may assist > finding a solution. > > I have an own object class type MyClass and want to wrap a C++ library > using SWIG 1.3.39 to be used by Lua. Using this library I often have to > wrap methods of the form > > void foo1(const MyClass & a, MyClass & b) > { > b.assign_and_action(a); > } > void foo2(const MyClass & a, MyClass & b) > { > b.modify(a); > } > void foo2b(const int &a, int &b) > { > b += a; > } > > 'foo1' simply returns 'b' reading 'a'. foo2 and foo2b modify 'b' using > 'a'. Therefore, in Lua I want to call them by > > b = foo1(a) > b = foo2(a,c) > b = foo2b(a,c) > > To let SWIG know about the parameter types one has to specify which is > INPUT, OUTPUT or both: > > void foo1(const MyClass & INPUT, MyClass & OUPUT); > void foo2(const MyClass & INPUT, MyClass & INOUT); > void foo2b(const int & INPUT, int & INOUT); > > For 'foo2b' this is working fine. Somehow it does not work for 'foo1' > and 'foo2'. In the latter, all parameters are considered being input > variables. > > Any ideas what went wrong? > > Best regards > Seb > > > -- View this message in context: http://n2.nabble.com/Lua-SWIG-output-parameters-of-custom-types-as-references-tp2740991p3565721.html Sent from the Lua list mailing list archive at Nabble.com. From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 13:46:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82GkqlI029348; Wed, 2 Sep 2009 13:46:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C3FB19459; Wed, 2 Sep 2009 13:46:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp05.bis.na.blackberry.com (smtp05.bis.na.blackberry.com [216.9.248.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01CD019451 for ; Wed, 2 Sep 2009 13:46:08 -0300 (BRT) Received: from bda159.bisx.prod.on.blackberry (bda159.bisx.prod.on.blackberry [172.20.226.139]) by srs.bis.na.blackberry.com (8.13.7 TEAMON/8.13.7) with ESMTP id n82Gjh9w006564 for ; Wed, 2 Sep 2009 16:45:43 GMT Received: from bda159.bisx.prod.on.blackberry (localhost.localdomain [127.0.0.1]) by bda159.bisx.prod.on.blackberry (8.13.7 TEAMON/8.13.7) with ESMTP id n82Gjw1U020243 for ; Wed, 2 Sep 2009 16:45:58 GMT X-rim-org-msg-ref-id: 923015801 Message-ID: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> X-Priority: Normal Sensitivity: Normal Importance: Normal Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable To: "Lua list" From: delbu9c1@erau.edu Date: Wed, 2 Sep 2009 16:46:21 +0000 Content-Type: text/plain; charset="Windows-1252" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id n82GkqlI029348 I'm not sure I see a benefit to it being a second return. Nil is false and all numbers are true so existing functionality should remain in tact. However both implementation methods are arguable. ------Original Message------ From: Patrick Donnelly Sender: lua-bounces@bazar2.conectiva.com.br To: Lua list ReplyTo: Lua list Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable Sent: Sep 1, 2009 9:16 PM On Tue, Sep 1, 2009 at 4:37 PM, Rob Kendrick wrote: > Hi, > > Currently in Lua, it appears as if it is impossible to obtain the exit > code of a program that you have opened with io.popen(); the close > method on the returned object only returns true. > > Are there reasons for it not return this?  If not, can I request it be > considered for 5.2? This has been discussed [1]. There were some hacks proposed for obtaining the status code in that thread. It would be nice if popen returned the status code. I feel it should be a second argument, however, because popen may fail early with "nil, ". -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin Sent from my Verizon Wireless BlackBerry From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 14:02:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82H1ssR001087; Wed, 2 Sep 2009 14:01:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4D0F1945B; Wed, 2 Sep 2009 14:01:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A267819271 for ; Wed, 2 Sep 2009 14:01:20 -0300 (BRT) Received: by bwz10 with SMTP id 10so985348bwz.5 for ; Wed, 02 Sep 2009 10:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xFTLP3JwkcsusxAW6zWmNqxbEkgoO4pTnN/w3gQrx7k=; b=c/wgfPDnXYJBWR/ch3dc/1KuF/gZCLMzri/qUn139IvcDGtV0myoZWOpcF6MIgBC4w oJf3Gd6PoAB/cXCbkrWBWNukLMNtjMPVewr60jBHrAU2fSZcAvw6ZGv392Tjg4QEB35l waACZ3D2UxHVHpGcqNygvesPvjmlrIb+2GZ54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Clt3RIq75j9ZPpm32AL2KwXg9CDy0etknYv1K9q4lhN7YDnRDr7OVl8r37ws8a0oSo 37cNqeucqO0YDVviVn+FFUI6f2nv7SuqewlMb6x48tjE06bZ3n1/q29dW9WEoHAjP0N6 B0mCzmu++9X1H7Aiz6yUV/ffKcfUt5Qd/ZhX4= MIME-Version: 1.0 Received: by 10.204.160.73 with SMTP id m9mr6926994bkx.214.1251910878143; Wed, 02 Sep 2009 10:01:18 -0700 (PDT) In-Reply-To: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> References: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> Date: Wed, 2 Sep 2009 19:01:18 +0200 Message-ID: <560972290909021001j4a3db027w1dadce6d65f12b44@mail.gmail.com> Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 2, 2009 at 6:46 PM, wrote: > I'm not sure I see a benefit to it being a second return. Nil is false and all numbers are true so existing functionality should remain in tact. I don't think we need fool with io.popen(), just define a pclose() method on file streams that returns the error code. You may easily get output from a 'failed' process, and you won't know the status code anyway until the stream is finished. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 14:30:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82HUA1u008077; Wed, 2 Sep 2009 14:30:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 252F619462; Wed, 2 Sep 2009 14:29:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f183.google.com (mail-iw0-f183.google.com [209.85.223.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E39CB19451 for ; Wed, 2 Sep 2009 14:29:28 -0300 (BRT) Received: by iwn13 with SMTP id 13so437953iwn.12 for ; Wed, 02 Sep 2009 10:29:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.1.22 with SMTP id 22mr8579633ibd.56.1251912563619; Wed, 02 Sep 2009 10:29:23 -0700 (PDT) In-Reply-To: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> References: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> Date: Wed, 2 Sep 2009 13:29:23 -0400 Message-ID: <790db3550909021029k2f6e3403lf43d5b4fe09c7124@mail.gmail.com> Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 2, 2009 at 12:46 PM, wrote: > I'm not sure I see a benefit to it being a second return. Nil is false and all numbers are true so existing functionality should remain in tact. Yes, you're right. I'm thinking of another interface where a boolean is always the first return. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 19:06:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82M6Z9I017635; Wed, 2 Sep 2009 19:06:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D771A192C3; Wed, 2 Sep 2009 19:05:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CD781923D for ; Wed, 2 Sep 2009 19:05:54 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mixxg-0007BP-J8 for lua@bazar2.conectiva.com.br; Wed, 02 Sep 2009 19:05:53 -0300 Message-ID: <4A9EEC51.1090209@sct.microlink.com.br> Date: Wed, 02 Sep 2009 19:06:09 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Wishlists and Modules (was [ANN] libmc) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I really miss the times when Lua was just an embeddable script language. I could just compile all Lua libraries I wanted, make a host application or change lua.c to open the additional libraries, link everything and be happy. Now I must leave with modules, dynamic link libraries, requires, paths, packages, etc. Or I have to change the modules to compile as good old-fashioned Lua libraries which is a great deal of work depending on which ones I'm using. Or I have to write things from scratch instead of reusing code from the community. It's sad to see Lua move away from its niche. Or I'm completely missing an obvious way to require modules that are compiled into the application without hacks... In which case everyone is free to punch, ignore or enlighten me. Cheers, Andre ------------------------------ Message: 6 Date: Wed, 2 Sep 2009 10:22:32 +0200 From: steve donovan Subject: Wishlists and Modules (was [ANN] libmc) To: Lua list Message-ID: <560972290909020122r13aa2ef1xff1b9344e52364a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 > Anyway, remember - it *is* a wishlist. :-) While we are exchanging wishlists, here's one of mine ;) Although code may be free (in both senses of the English word) it can still be expensive in terms of time needed to understand it. In an ideal world there would be as little friction as possible in the process, i.e. that when using a new module, the accidental complexity should be as little as possible. (May well be essential complexity, sometimes things _are_ rocket science.) A The ideal module: 0 well named (using namespaces) 1 well focused 2 well contained 3 explicit dependencies 4 documented in some standard way 5 adequate test coverage 6 useful examples A0 may seem obvious but namespaces are increasingly a must. CPAN is looking after 16486 modules (!) and the only way that they can coexist is by disciplined use of namespaces (e.g [0]). A project needs a cool name, but a module needs a useful name. A2 means that a module behaves itself and doesn't mess with the global table, except to introduce its own table. A module can of course be 'injected' into the global table, but only on explicit request. B And the ideal package manager: 1 handles dependencies (must do this automatically, like LuaRocks [1]) 2 integrated documentation (must be available from a central index after installation, e.g like perldoc) 3 specifies external dependencies in a useful way (in an ideal world, it use the native package manager to find these) 4 searchable for capabilities and module names (e.g. that the module 'lfs' corresponds to the package 'LuaFileSystem' - new LR will do this) 5 flexible tag-based classification (so we aren't tied to a inflexible fixed hierarchy, like the Trove system [2]) It seems hard to do B2 without A4, without resorting to hacks & heuristics (is there a README? is there an index.html, perhaps in an 'en' folder? ...) So naturally there have been Lua people interested in the Perl POD format. B4 & B5 are related; the idea is to get as much searchable metadata into the system. And hierarchies can be constructed dynamically from tags. B3 is a tough one, which is hard enough to solve for one system (e.g. Debian) let alone the whole universe of platforms, mostly without standard library repositories. This feels like a lot of work, which it is, but the idea is to minimize the amount of work the producer of the module has to do. Personally I think LuaRocks is getting there, especially with a nice front-end; (the next version will be using a more 'normal' way to manage modules) but delivering module documentation is not a major concern and writing cross-platform rockspecs remains a bit of an art. I've even toyed with the idea of writing a wizard for writing rockspecs ;) Documentation remains a big weakness. Probably it's that psychological illusion that code is self-evident, because one's head is full of the 'meta-implementation', all that stuff and cogitation needed to write a program, and which evaporates quickly and leaves us saying WTF? when reading our own code in six months. steve d. [0] http://search.cpan.org/modlist/Option_Parameter_Config_Processing [1] http://www.luarocks.org [2] http://luaforge.net/softwaremap/trove_list.php ------------------------------ Message: 7 Date: Wed, 2 Sep 2009 04:30:05 -0500 (CDT) From: yxtor Subject: Re: Lua/SWIG: output parameters of custom types as references? To: lua@bazar2.conectiva.com.br Message-ID: <1251883805483-3565721.post@n2.nabble.com> Content-Type: text/plain; charset=us-ascii Hello. I am a new user here at Nabble. I wonder if anybody has an answer to Sebs question? Its really hard finding documentation about this. /Robert Sebastian Wolff wrote: > > Dear Lua community, > > I hope someone already encountered the following problem and may assist > finding a solution. > > I have an own object class type MyClass and want to wrap a C++ library > using SWIG 1.3.39 to be used by Lua. Using this library I often have to > wrap methods of the form > > void foo1(const MyClass & a, MyClass & b) > { > b.assign_and_action(a); > } > void foo2(const MyClass & a, MyClass & b) > { > b.modify(a); > } > void foo2b(const int &a, int &b) > { > b += a; > } > > 'foo1' simply returns 'b' reading 'a'. foo2 and foo2b modify 'b' using > 'a'. Therefore, in Lua I want to call them by > > b = foo1(a) > b = foo2(a,c) > b = foo2b(a,c) > > To let SWIG know about the parameter types one has to specify which is > INPUT, OUTPUT or both: > > void foo1(const MyClass & INPUT, MyClass & OUPUT); > void foo2(const MyClass & INPUT, MyClass & INOUT); > void foo2b(const int & INPUT, int & INOUT); > > For 'foo2b' this is working fine. Somehow it does not work for 'foo1' > and 'foo2'. In the latter, all parameters are considered being input > variables. > > Any ideas what went wrong? > > Best regards > Seb > > > -- View this message in context: http://n2.nabble.com/Lua-SWIG-output-parameters-of-custom-types-as-references-tp2740991p3565721.html Sent from the Lua list mailing list archive at Nabble.com. End of Lua Digest, Vol 170, Issue 3 *********************************** From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 19:18:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82MHowG020369; Wed, 2 Sep 2009 19:17:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F22C5192DF; Wed, 2 Sep 2009 19:17:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C605192B9 for ; Wed, 2 Sep 2009 19:17:21 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e21so527599fga.17 for ; Wed, 02 Sep 2009 15:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=q4egnUxA4zQVRYPbRE3qrpg2NJ49tXlIubEwj5xcy8E=; b=GVjo4LboNj/d1mOottb4ie0typR54X/xWGtIPey/PLgD3D+KrJAh0C6GRBM8TZ6f47 +ZT3ovwQxEASo88xnvkEQ7BxGnUkYoTAK0vrzxYgm3URDzczs4zGKSP4Xiy6TZU0hSJo lSXItftVUC5EuA8j6k36AUdYrhftFB9RwAaIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=DMG21JwktCU59mswtxR7mKMbL8oj/wg0WFecaZnEWLBA6t1CnUMh9amUqEsvwUbklu LPh/yrOzt8s3iGZ69/TbY2O7TTceY/hoPQU65rzAWtg5Jt1pOoF1acWJF9uzCUEFRF4b kLXJSj+74CnwjU/gKWZzzkbZLANsAjqYxPGxk= Received: by 10.86.187.7 with SMTP id k7mr3044624fgf.30.1251929838472; Wed, 02 Sep 2009 15:17:18 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id 12sm1580187fgg.28.2009.09.02.15.17.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Sep 2009 15:17:17 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <4A9EEC51.1090209@sct.microlink.com.br> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Wishlists and Modules (was [ANN] libmc) Date: Thu, 3 Sep 2009 00:16:45 +0200 References: <4A9EEC51.1090209@sct.microlink.com.br> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 3, 2009, at 12:06 AM, Andre de Leiradella wrote: > I really miss the times when Lua was just an embeddable script > language. I could just compile all Lua libraries I wanted, make a > host application or change lua.c to open the additional libraries, > link everything and be happy. No reason to miss anything, jut ignore the "Architecture Astronauts" and be merry :)) From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 19:51:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n82MpeEd027094; Wed, 2 Sep 2009 19:51:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 124F5192C0; Wed, 2 Sep 2009 19:51:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE8CF19235 for ; Wed, 2 Sep 2009 19:51:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so1289282ewy.5 for ; Wed, 02 Sep 2009 15:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8kFMfegNKqI7d9dV+Eo0cMwlot5izXaGOqSOMwXZv+Y=; b=gXNQB04S1lxqh/QzzMs0NCc4Jr/x1JZNwyj7uqUMWeZR5sbIYMRIOcxrXZ5BZBx1sG ZC2MpG2HQ56ACHLNmdIM7uOOfTM+APH8pnXCstWRkbk26MdgQ14n/oZJ1OS4uLZfM/nW YRY3PKvtDyroNWSVM2HvGSwHg2yaap4Cuj1rQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YwFndBcItk+rU8QE4DGnm+b61+zv7giTqCDAitt0lj513fdArSzvCZTBQbDwVykl20 k6tIKywGlCaCplPrQAP9h7FPdzvVnJPXSM0VCThAIIc5vHRkIyn6xNEAlF0MyqofIaZs 7RRtTtdvZsrnTxupRPqWqLviaE5BXzEIln1SA= MIME-Version: 1.0 Received: by 10.216.1.68 with SMTP id 46mr342453wec.77.1251931863133; Wed, 02 Sep 2009 15:51:03 -0700 (PDT) In-Reply-To: <4A9EEC51.1090209@sct.microlink.com.br> References: <4A9EEC51.1090209@sct.microlink.com.br> Date: Wed, 2 Sep 2009 23:51:03 +0100 Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 2, 2009 at 11:06 PM, Andre de Leiradella wrote: > (...) Or I'm completely missing an > obvious way to require modules that are compiled into the application > without hacks... In which case everyone is free to punch, ignore or > enlighten me. You should be able to make modules compiled into the application available to "require" by adding them into the "package.preload" table (the key is the module name as passed to require, and the value is the luaopen_... function). So, in your setup code for the Lua state, once the standard libraries have been added in, something like this should be enough: lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); lua_pushcfunction(luaopen_mymodule1); lua_setfield(L, -2, "mymodule1"); lua_pushcfunction(luaopen_mymodule2); lua_setfield(L, -2, "mymodule2"); // ... lua_pop(L,2); // remove package & package.preload -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 22:36:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n831aQnq013069; Wed, 2 Sep 2009 22:36:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76C3E192AE; Wed, 2 Sep 2009 22:35:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EB8118FF0 for ; Wed, 2 Sep 2009 22:35:54 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mj1Eq-0002CD-7U for lua@bazar2.conectiva.com.br; Thu, 03 Sep 2009 03:35:48 +0200 Received: from foi.americanprogress.org ([206.205.112.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Sep 2009 03:35:48 +0200 Received: from zhangchunlin by foi.americanprogress.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Sep 2009 03:35:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Chunlin Zhang Subject: Re: is there any lua vm on mcu? especially on 8051 Date: Thu, 03 Sep 2009 09:45:35 +0800 Lines: 10 Message-ID: References: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: foi.americanprogress.org User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: <8d896d0f0908292018l3b06f59ak36d0d7b69f5c4770@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You can porting a simplified lua vm youself.Just remove those parts the OS of mcu not support. 云帆江 wrote: > hi,i found that a python vm on mcu,so i wonder if there's a lua vm on mcu > especially on 8051 > > -- > welcom to gtalk me > http://hi.baidu.com/jyf1987 From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 22:45:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n831j2gB014144; Wed, 2 Sep 2009 22:45:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65EC1192C9; Wed, 2 Sep 2009 22:44:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14DC8192A6 for ; Wed, 2 Sep 2009 22:44:39 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n831ibJD014096 for ; Wed, 2 Sep 2009 22:44:37 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n831ibl30757; Wed, 2 Sep 2009 22:44:37 -0300 Date: Wed, 2 Sep 2009 22:44:36 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090902224436.A30754@lua.tecgraf.puc-rio.br> References: <4A9EEC51.1090209@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4A9EEC51.1090209@sct.microlink.com.br>; from aleirade@sct.microlink.com.br on Wed, Sep 02, 2009 at 07:06:09PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I really miss the times when Lua was just an embeddable script language. > I could just compile all Lua libraries I wanted, make a host application > or change lua.c to open the additional libraries, link everything and be > happy. You can do just that today: just edit linit.c to suit your needs. From lua-bounces@bazar2.conectiva.com.br Wed Sep 2 22:57:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n831vJ2F015262; Wed, 2 Sep 2009 22:57:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0C23192DF; Wed, 2 Sep 2009 22:56:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.211.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5072B192AC for ; Wed, 2 Sep 2009 22:56:51 -0300 (BRT) Received: by ywh7 with SMTP id 7so1033242ywh.21 for ; Wed, 02 Sep 2009 18:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=WaOySu/ckl7UALiDZfABbafbkT3uW+4Z6zpOcx19rqk=; b=C/3dfonIMd4W/b7qr6gCgKBF3pYA4rHovJPFMlk3zEnEjeKgLyNz7jZ5tPIkJ/YRJ9 /DjzudP/Kneo1j8svuxFKQzZx3z+yuf6DRsqIdjR5hNoGS5KY1l8xeMwc8XrNjOl9kZV WpY2R7zLRmSwHB7+2uugVVkimvbKOsQh3lh08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=NRQBH8hq4OZTtn/N+BULwLDUDm69b/SEjx68+sks2j+28iDGGu6cFWsSDXFfRXJXDP WRz2mh+Y2fZHb7ZWitWESvuemukWOfu35v5a2dX3K6cbpyhBLpjXuR5TK9pxQwB5svpO JIhMPbzrXcbJ0X5oDGmMo++ruAcFdDOwOTkgk= MIME-Version: 1.0 Received: by 10.150.114.19 with SMTP id m19mr15179293ybc.4.1251943006438; Wed, 02 Sep 2009 18:56:46 -0700 (PDT) From: RJP Computing Date: Wed, 2 Sep 2009 21:56:26 -0400 X-Google-Sender-Auth: 069825b4c6000181 Message-ID: Subject: [ANN] Lua for Windows v5.1.4-29 Released To: Lua list Content-Type: multipart/alternative; boundary=000e0cd48a8e2ded590472a2b211 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd48a8e2ded590472a2b211 Content-Type: text/plain; charset=ISO-8859-1 We are proud to announce the next release of Lua for Windows (LfW). Read the changelog for more information. Enjoy. Homepage: http://luaforwindows.luaforge.net/ Description: Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows. Lua for Windows combines Lua binaries, Lua libraries with a Lua-capable editor in a single install package for the Microsoft Windows operating system. Lua for Windows contains everything you need to write, run and debug Lua scripts on Windows. A wide variety of libraries and examples are included that are ready to use with Microsoft Windows. Lua for Windows runs on Windows 2000 and newer versions of Windows. Lua and its associated libraries are also available for other operating systems, so most scripts will be automatically cross-platform. Changelog: 09/02/2009 Version 5.1.4-29 + Added Penlight v0.7.2 Lua module. ^ Updated LuaCOM to version 1.4. ^ Updated LuaGL to version 1.3. ^ Updated VStruct to version 1.0.2. ________________________________________________________________ Legend: '+' = Addition, '*' = Bug Fix, '-' = Removed, '~' = Move, '^' = Updated Download: http://luaforwindows.googlecode.com/ or http://luaforge.net/frs/?group_id=377 -- Regards, Ryan RJP Computing --000e0cd48a8e2ded590472a2b211 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We are proud to announce the next release of Lua for Windows (LfW). Read th= e changelog for more information. Enjoy.

Homepage:

Description:

Lua for Win= dows is a 'batteries included environment' for the Lua scripting la= nguage on Windows.

Lua for Windows combines Lua binaries, Lua libraries with a Lua-capable editor in a single install package for the Microsoft Windows operating system. Lua for Windows contains everything you need to write, run and debug Lua scripts on Windows. A wide variety of libraries and examples are included that are ready to use with Microsoft Windows. Lua for Windows runs on Windows 2000 and newer versions of Windows. Lua and its associated libraries are also available for other operating systems, so most scripts will be automatically cross-platform.

Changelog:

09/02/2009 = =A0Version 5.1.4-29
+ Added Penlight v0.7.2 Lua module.
^ Updated Lua= COM to version 1.4.
^ Updated LuaGL to version 1.3.
^ Updated VStruct= to version 1.0.2.
________________________________________________________________
Legend:= '+' =3D Addition, '*' =3D Bug Fix, '-' =3D Removed= , '~' =3D Move, '^' =3D Updated

Download:
<= div style=3D"margin-left: 40px;"> http://l= uaforwindows.googlecode.com/
or
--
Regards,
Ryan
RJP Computing --000e0cd48a8e2ded590472a2b211-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 02:42:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n835gaan005147; Thu, 3 Sep 2009 02:42:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D60319418; Thu, 3 Sep 2009 02:42:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB92D19358 for ; Thu, 3 Sep 2009 02:42:03 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e12so1334523fga.17 for ; Wed, 02 Sep 2009 22:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Ts7YbD8AYkSqHEqZE3RRsfzrMJQVWUAvRLWvASntroY=; b=srpYJHowPhzL7VtwCNIxdAMhuF9UxMcE/6simWUgDmOHVJNqzmUwPbnHazH7e7wHh/ PQGsUYw90kyTQjy3aJ0wnXi4Uh1lCKUGv/R6ZtLwtUbao48T6tG9RfQvqfz1VJpLNLuV Z2a91Q97mBR56IMaXWN+9OssiGtDo5aS06TfI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bARm8+SIv8DRIV4S1UsvzmG0q+oit9WS7Wkw/4ZycfI63CzFQn51Xgpdhw3Yhakkgj CaRqInW2r9+qULCYgjlDE0CSggUgDwG50Z0F0CNbwCC7GyXvSI6ld58dxPPMsfINDR5P nxIBlpx48R/GW+wuoocaY3/P608cqJcfSUJ+w= MIME-Version: 1.0 Received: by 10.86.12.2 with SMTP id 2mr3438135fgl.12.1251956521500; Wed, 02 Sep 2009 22:42:01 -0700 (PDT) Date: Thu, 3 Sep 2009 01:42:01 -0400 Message-ID: <6cf7c3110909022242n6c460514p74939ffeb20408a2@mail.gmail.com> Subject: Coco gcc inline asm and C++ From: James Zhao To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00c09ffb56b9bd02690472a5d794 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09ffb56b9bd02690472a5d794 Content-Type: text/plain; charset=ISO-8859-1 Hi, Does the Coco gcc inline asm code also work for switching C++ stacks (I'm thinking calling conventions may be a bit different)? If not, what's a good solution that works on linux? Thanks, James --00c09ffb56b9bd02690472a5d794 Content-Type: text/html; charset=ISO-8859-1 Hi,

Does the Coco gcc inline asm code also work for switching C++ stacks (I'm thinking calling conventions may be a bit different)? If not, what's a good solution that works on linux?

Thanks,
James
--00c09ffb56b9bd02690472a5d794-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 04:31:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n837V1Ev016508; Thu, 3 Sep 2009 04:31:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07C39192C6; Thu, 3 Sep 2009 04:30:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED3F3191D5 for ; Thu, 3 Sep 2009 04:30:23 -0300 (BRT) Received: by ewy26 with SMTP id 26so1522568ewy.5 for ; Thu, 03 Sep 2009 00:30:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.38.10 with SMTP id l10mr9277426ebl.8.1251963020806; Thu, 03 Sep 2009 00:30:20 -0700 (PDT) In-Reply-To: <560972290909020122r13aa2ef1xff1b9344e52364a@mail.gmail.com> References: <560972290909020122r13aa2ef1xff1b9344e52364a@mail.gmail.com> Date: Thu, 3 Sep 2009 03:30:20 -0400 X-Google-Sender-Auth: ec945a9081cdb6ec Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n837V1Ev016508 On Wed, Sep 2, 2009 at 4:22 AM, steve donovan wrote: > Although code may be free (in both senses of the English word) it can > still be expensive in terms of time needed to understand it. > In an ideal world there would be as little friction as possible in the > process, i.e. that when using a new module, the accidental complexity > should be as little as possible. (May well be essential complexity, > sometimes things _are_ rocket science.) I suspect this friction contributes to the reinvent-the-wheel phenomena, the perception or reality that reinventing is the simplest way to ensure that requirements are met. > A The ideal module: >  0 well named (using namespaces) >  1 well focused >  2 well contained >  3 explicit dependencies >  4 documented in some standard way >  5 adequate test coverage >  6 useful examples Among other Kwalitee measures [4], this is particularly desirable: 7 automated configure+build+deploy from source Most of that can be summed up as "consistency" (a la CPAN and APT). > B And the ideal package manager: >  1 handles dependencies >       (must do this automatically, like LuaRocks [1]) >  2 integrated documentation >       (must be available from a central index after installation, e.g > like perldoc) >  3 specifies external dependencies in a useful way >       (in an ideal world, it use the native package manager to find these) >  4 searchable for capabilities and module names >       (e.g. that the module 'lfs' corresponds to the package > 'LuaFileSystem' - new LR will do this) >  5 flexible tag-based classification >      (so we aren't tied to a inflexible fixed hierarchy, like the > Trove system [2]) > > It seems hard to do B2 without A4, without resorting to hacks & > heuristics (is there a README? is there an index.html, perhaps in an > 'en' folder? ...) So naturally there have been Lua people interested > in the Perl POD format. More than two years ago, I started LuaSearch [1], loosely modeled on the hugely popular search.cpan.org, but it didn't catch on. I think the main problems were C1) This was before the establishment of centralized, easy to crawl module repositories such as LuaRocks [2] and LuaDist [3] (apart from LuaForge). C2) It assumed users would agree to use a particular doc format (POD). If this were done again, I would not impose hard restrictions C2 in documentation format but would use heuristics to render as best it can whatever it is given. I would, however, provide incentives to follow one of a couple conventions (e.g. README.txt, LuaDoc, POD, Kepler style HTML, POD, etc.). I would also automatically crawl LuaRocks/LuaDist repositories rather than rely on manual submissions. Given the developments in C1, I think there's a strong case that someone with the time and inclination should re-pursue this. It's actually not that much work to get it basically running. It can be managed independently of the LuaRocks/LuaDist projects. [1] http://lua-users.org/wiki/LuaSearch [2] http://luarocks.luaforge.net/rocks/ [3] http://luadist.org/repo/luadist/ ; http://lua-users.org/wiki/LuaDist [4] http://cpants.perl.org/kwalitee.html From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 04:52:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n837pxLC018458; Thu, 3 Sep 2009 04:51:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3707B192C6; Thu, 3 Sep 2009 04:51:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A466919276 for ; Thu, 3 Sep 2009 04:51:32 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n837pE6g005731; Thu, 3 Sep 2009 16:51:28 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay21.aps.necel.com with ESMTP; Thu, 3 Sep 2009 16:51:28 +0900 Received: from dhlpc061 ([10.114.113.45] [10.114.113.45]) by relay21.aps.necel.com with ESMTP; Thu, 3 Sep 2009 16:51:28 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 4E8C952E1E1; Thu, 3 Sep 2009 16:51:28 +0900 (JST) From: Miles Bader To: Andre de Leiradella Subject: Re: Wishlists and Modules References: <4A9EEC51.1090209@sct.microlink.com.br> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Thu, 03 Sep 2009 16:51:28 +0900 In-Reply-To: <4A9EEC51.1090209@sct.microlink.com.br> (Andre de Leiradella's message of "Wed, 02 Sep 2009 19:06:09 -0300") Message-ID: Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella writes: > I really miss the times when Lua was just an embeddable script > language. I could just compile all Lua libraries I wanted, make a host > application or change lua.c to open the additional libraries, link > everything and be happy. hmm, I must be a bit confused, 'cause lua still seems like that today... -miles -- Inhumanity, n. One of the signal and characteristic qualities of humanity. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 05:36:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n838aQ3A022661; Thu, 3 Sep 2009 05:36:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0DFF192CF; Thu, 3 Sep 2009 05:35:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E500A192A2 for ; Thu, 3 Sep 2009 05:35:53 -0300 (BRT) Received: by pxi13 with SMTP id 13so1535839pxi.10 for ; Thu, 03 Sep 2009 01:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=tISz+0EWmj0Ppuc4AzkBcEMFA6mp9l/HTUr0NaRAkxw=; b=Zml3Y15U6zoe2ZCHDzgbHsnOMxNCodlgCjQB+lZ0GA6eSRbWnCOz4Lfk9HZjhUBD1W hx1bDPjhifjEcHpfcj9FXuOW77Fzq6sde2bN2WcvpqGz7ROBQG+maBcCwrZJZZ5KEoDl 9WL4dCKK7SvKLqTU2DXFW98AjQaWw/Vk0yTWg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=pq/DGA/mgcPzwxbjRUCw8Sr1XgwzIIEgcQdxJzPzu8j5iGduphp9GoRoNVNSgc9+YK Olnm0E5DnfvLufMCa6t64JkGmL7dykvtOk6caR/9j0VFUbJp6qwe6edBxegwKiGMMtYu Th9aEHpevtsBZmq/URvBKWDy0L6NtT6vZafMA= MIME-Version: 1.0 Received: by 10.142.202.9 with SMTP id z9mr217958wff.166.1251966498083; Thu, 03 Sep 2009 01:28:18 -0700 (PDT) From: sagasw Date: Thu, 3 Sep 2009 16:27:58 +0800 Message-ID: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> Subject: Lua how to call dotnet's function To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000e0cd2e0a66395f30472a82a47 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd2e0a66395f30472a82a47 Content-Type: text/plain; charset=UTF-8 Hi, I try to follow the code in wiki to call dotnet's function in lua. But I tried require"luainterface" and require"luanet", they can't work correctly. Who can tell me how to use dotnet framework in lua? What I use is "lua for windows" package. --000e0cd2e0a66395f30472a82a47 Content-Type: text/html; charset=UTF-8 Hi, I try to follow the code in wiki to call dotnet's function in lua.
But I tried require"luainterface" and require"luanet", they can't work correctly.
Who can tell me how to use dotnet framework in lua?
What I use is "lua for windows" package.
--000e0cd2e0a66395f30472a82a47-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 05:44:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n838iHU5023280; Thu, 3 Sep 2009 05:44:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB27719176; Thu, 3 Sep 2009 05:43:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D06019131 for ; Thu, 3 Sep 2009 05:43:52 -0300 (BRT) Received: by bwz10 with SMTP id 10so1465507bwz.5 for ; Thu, 03 Sep 2009 01:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=oHrXhKABbK6eidTEMi8wNf16MbgwtGe72XW3k2zrtT4=; b=HU9LDhIj55KYb4br2hYF+QnB2abWgf5H2IQP/T3e4tpAGQ8jU2yHnibFWwi3cX1xmb /dOVIJt12RkMrwx9DxX9ythHiZmmZg+ppxRRWbEKj6BxKIbTIo+d3kSuLM/Gq9P2U58D 7Hx80OJqm9Fojl1bkjsb1MUuefAgjUXzk124Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qhxLCSCKdu1MYQif0RC8hoe5cup6aQ57Dy99yOBXXpxFLLXvPtsqMfJfeIKZWwyDVZ pbF9UuIWyqZYWD2YJm1D5052NESUyJ2xCppkDErxj5l14D+ajjBpNYoinvy20J02kYCt 1icLC1z+BnS2Li/2jvcMOGLGGPPlohuAZ+lUg= MIME-Version: 1.0 Received: by 10.204.20.138 with SMTP id f10mr259877bkb.212.1251967429940; Thu, 03 Sep 2009 01:43:49 -0700 (PDT) In-Reply-To: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> References: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> Date: Thu, 3 Sep 2009 10:43:49 +0200 Message-ID: <560972290909030143s6dc3049fw5746b39889ed5d9@mail.gmail.com> Subject: Re: Lua how to call dotnet's function From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 3, 2009 at 10:27 AM, sagasw wrote: > Hi, I try to follow the code in wiki to call dotnet's function in lua. > But I tried require"luainterface" and require"luanet", they can't work > correctly. Can you run any of the examples? E.g. hello1.lua require 'luanet' luanet.load_assembly "System" Console = luanet.import_type "System.Console" Math = luanet.import_type "System.Math" Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) What errors do you get? steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 06:09:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8399Me3025385; Thu, 3 Sep 2009 06:09:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D88E418D31; Thu, 3 Sep 2009 06:08:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55B0C18C94 for ; Thu, 3 Sep 2009 06:08:49 -0300 (BRT) Received: by pxi13 with SMTP id 13so1555056pxi.10 for ; Thu, 03 Sep 2009 02:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=ZdA1Y7lvaB3sOV8j8TQMrhdfxTEeSTeHQkNcUYyjdLc=; b=Z1W7GrVX0oApM0YnLW8hPWyHX5af/hYxkg2c75xhCz/Aq7GYoJ5R+bnlSJcwb2SX0+ ltrNj6XbzKq/H/qI2+aq9M+gmxtFkTFLMZBkifbgBCnES0+g81vWwDyyohKtSRn+BohC h87rxfJ1WNizcBbexu7ZJL+fl+Hs1cDDu+cwY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=d6sEBTioI2Ovtc2tZDD+ZPvbxF2S+Ct4uceUkVTQAamQbWL5uLomKrjoFmxDNEQqiV qc/DgM3JzDclqmHuKUY4TrSeRqOCS0O6wJtGf+NmjUpDG012QgAdURQpo/1intixczGH amwvoHoSUyClqn+dziS6rwmEKYwXSPpJu+mXg= MIME-Version: 1.0 Received: by 10.142.75.10 with SMTP id x10mr205782wfa.153.1251968927085; Thu, 03 Sep 2009 02:08:47 -0700 (PDT) In-Reply-To: <560972290909030143s6dc3049fw5746b39889ed5d9@mail.gmail.com> References: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> <560972290909030143s6dc3049fw5746b39889ed5d9@mail.gmail.com> From: sagasw Date: Thu, 3 Sep 2009 17:08:27 +0800 Message-ID: <4de92fd0909030208r6d3b5833l932a049bb12eaa76@mail.gmail.com> Subject: Re: Lua how to call dotnet's function To: Lua list Content-Type: multipart/alternative; boundary=001636e1fb222b35830472a8bb0b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e1fb222b35830472a8bb0b Content-Type: text/plain; charset=UTF-8 lua -e "io.stdout:setvbuf 'no'" "luanet.lua" lua: .\luanet.lua:1: loop or previous error loading module 'luanet' stack traceback: [C]: in function 'require' .\luanet.lua:1: in main chunk [C]: in function 'require' luanet.lua:1: in main chunk [C]: ? >Exit code: 1 I run it in Scite and get the error message, in lua installation directory (lua for windows), I could find luanet.dll and luainterface.dll. Other lua could run correctly. for example print "aaa" On Thu, Sep 3, 2009 at 4:43 PM, steve donovan wrote: > On Thu, Sep 3, 2009 at 10:27 AM, sagasw wrote: > > Hi, I try to follow the code in wiki to call dotnet's function in lua. > > But I tried require"luainterface" and require"luanet", they can't work > > correctly. > > Can you run any of the examples? E.g. hello1.lua > > require 'luanet' > luanet.load_assembly "System" > Console = luanet.import_type "System.Console" > Math = luanet.import_type "System.Math" > > Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2)) > > What errors do you get? > > steve d. > --001636e1fb222b35830472a8bb0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable lua -e "io.stdout:setvbuf 'no'" "luanet.lua" lua: .\luanet.lua:1: loop or previous error loading module 'luanet= 9;
stack traceback:
=C2=A0=C2=A0=C2=A0 [C]: in function 'require&= #39;
=C2=A0=C2=A0=C2=A0 .\luanet.lua:1: in main chunk
=C2=A0=C2=A0=C2=A0 [C]: in function 'require'
=C2=A0=C2=A0=C2=A0= luanet.lua:1: in main chunk
=C2=A0=C2=A0=C2=A0 [C]: ?
>Exit code:= 1

I run it in Scite and get the error message, in lua installation = directory (lua for windows), I could find luanet.dll and luainterface.dll. =

Other lua could run correctly.
for example
print "aaa"=

On Thu, Sep 3, 2009 at 4:43 PM, steve do= novan <st= eve.j.donovan@gmail.com> wrote:
On Thu, Sep 3, 2009 at 10:27 AM, sagasw<sagasw@gmail.com> wrote:
> Hi, I try to follow the code in wiki to call dotnet's function in = lua.
> But I tried require"luainterface" and require"luanet&qu= ot;, they can't work
> correctly.

Can you run any of the examples? =C2=A0E.g. hello1.lua

require 'luanet'
luanet.load_assembly "System"
Console =3D luanet.import_type "System.Console"
Math =3D luanet.import_type "System.Math"

Console.WriteLine("sqrt(2) is {0}",Math.Sqrt(2))

What errors do you get?

steve d.

--001636e1fb222b35830472a8bb0b-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 06:19:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n839J5oK026232; Thu, 3 Sep 2009 06:19:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A06618FEB; Thu, 3 Sep 2009 06:18:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BAD418F5F for ; Thu, 3 Sep 2009 06:18:40 -0300 (BRT) Received: by bwz10 with SMTP id 10so1487991bwz.5 for ; Thu, 03 Sep 2009 02:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+i0ZFwN7hYB3GRjw3BTyir9tG3iWC7GaVP0MVLiLYpA=; b=azr+cPLPvODnBpwj560u5M9MR67dl3Sgk6mHMmm2RHuukXznGxa7ZnTtrXABigacn+ 6O/4LUA+4dfthQVuLFf7tCYXjGuwMfw20j9px4GO1WBNkw+456t3NHipzCu9uZ/v8uub k61Lh1kCbPgd6IZNmclr4CRak5hjrnpdPk+X0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pvi+uvesDZXEJ7GOxYtGEzEynn8F26dFUNZNc8+uPjeo6hg+epziCzqyB6HkyB1Xiw qVhGTVX1s8ffjvwEv+/CFUJ6Rk0U3T923H/UkoHRklNt+9EU40Ihk+NmwCPAkbiSNmZq /AraJQ3FwwzzHHsR1bZavrl8L302i8nTMkn8E= MIME-Version: 1.0 Received: by 10.204.160.73 with SMTP id m9mr7724672bkx.214.1251969514372; Thu, 03 Sep 2009 02:18:34 -0700 (PDT) In-Reply-To: <4de92fd0909030208r6d3b5833l932a049bb12eaa76@mail.gmail.com> References: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> <560972290909030143s6dc3049fw5746b39889ed5d9@mail.gmail.com> <4de92fd0909030208r6d3b5833l932a049bb12eaa76@mail.gmail.com> Date: Thu, 3 Sep 2009 11:18:34 +0200 Message-ID: <560972290909030218q65f61621j2bdf1a001d167bbc@mail.gmail.com> Subject: Re: Lua how to call dotnet's function From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 3, 2009 at 11:08 AM, sagasw wrote: > lua -e "io.stdout:setvbuf 'no'" "luanet.lua" > lua: .\luanet.lua:1: loop or previous error loading module 'luanet' Ah, the problem is that you have named your file 'luanet.lua', so then the require 'luanet' inside tries to load luanet.lua as a module. Rename it and see what happens... steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 07:03:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83A3a8R030052; Thu, 3 Sep 2009 07:03:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A34881844B; Thu, 3 Sep 2009 07:03:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB15518FEB for ; Thu, 3 Sep 2009 07:02:50 -0300 (BRT) Received: by fxm25 with SMTP id 25so1575874fxm.5 for ; Thu, 03 Sep 2009 03:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ErZ2kKFbCJuGPi666O8n5BR3c5UUDxlfxcQ9e/O+31A=; b=VjH2N37+/oXUTEpo8LDFcYox7ToC3zvrwF9GD8nXlxaYJYyw5Lz0GWGEJwbuFW3stF nDealZPhYRSWSc5FHnB4AlpK5IOt+LgHQDlNWIrFw44VhCAAr7I6rqAD3aJS3Ge3ooUH ajvfaT0b74+/uQ+8CZOBPoVTqlwzmLMTm0eOs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=x2IJZpdmDHeiRU3VNJHbG/+xXcYdhkRLX0QeAcX6SLjy8tIxeff2ijxRQqMNdniAji Jds574cwr69/i1ORMgLd7USSPgw5rgqQC8EN2nKVR5pagI6OZpAnOeFBqP4oD0EoEsSy axNaqi8sAi+9kWBgXAp3JgDTkw6q0Fx7lZKaA= MIME-Version: 1.0 Received: by 10.204.20.138 with SMTP id f10mr327939bkb.212.1251972168721; Thu, 03 Sep 2009 03:02:48 -0700 (PDT) In-Reply-To: References: <560972290909020122r13aa2ef1xff1b9344e52364a@mail.gmail.com> Date: Thu, 3 Sep 2009 12:02:48 +0200 Message-ID: <560972290909030302t4940070es1c3a215365261743@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n83A3a8R030052 On Thu, Sep 3, 2009 at 9:30 AM, David Manura wrote: > I suspect this friction contributes to the reinvent-the-wheel > phenomena, the perception or reality that reinventing is the simplest > way to ensure that requirements are met. Yes, coding is more fun than hunting. Although coders always underestimate the effort needed to implement something thoroughly. So 'splitting a string' has been done dozens of times, although it's actually a tricky little piece of code. Maybe it's also a question of granuality. If I just want to split a string, then I might not want to want to incur the perceived overhead (and resulting dependencies) of bringing in stdlib or penlight. In that case my needs might be better met by a clever well-organized snippets database. > Among other Kwalitee measures [4], this is particularly desirable: > >    7 automated configure+build+deploy from source Yes, those are definitely the measures I was thinking about, allowing for Lua/Perl deployment differences. With more than 16K modules, the Perl people need that kind of quality assurance. > If this were done again, I would not impose hard restrictions C2 in > documentation format but would use heuristics to render as best it can > whatever it is given.  I would, however, provide incentives to follow > one of a couple conventions (e.g. README.txt, LuaDoc, POD, Kepler > style HTML, POD, etc.). I've been integrating LuaRocks into Lua for Linux, and resorting to exactly that. The price of freedom is a whole bunch of very forgiving code ;) One sets policy (like 'please provide documentation') but doesn't insist on rigid implementation and bureaucratic requirements (like 'there must be an index.html in the docs folder') > I would also automatically crawl > LuaRocks/LuaDist repositories rather than rely on manual submissions. That's interesting, because historically it's tended to go the other way, i.e people rockifying packages. A key insight is that using a data format like rockspec does not bind one to using LuaRocks. I'd like to join such an effort, although the queue needs to be emptied a bit first... steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 07:24:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83ANwXf031759; Thu, 3 Sep 2009 07:23:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B24931914C; Thu, 3 Sep 2009 07:23:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1ED2218B91 for ; Thu, 3 Sep 2009 07:23:33 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Mj9TX-0005eB-00; Thu, 03 Sep 2009 12:23:31 +0200 Date: Thu, 3 Sep 2009 12:24:46 +0200 From: Mike Pall To: Lua list Subject: Re: Coco gcc inline asm and C++ Message-ID: <20090903102446.GA3781@mike.de> References: <6cf7c3110909022242n6c460514p74939ffeb20408a2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6cf7c3110909022242n6c460514p74939ffeb20408a2@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean James Zhao wrote: > Does the Coco gcc inline asm code also work for switching C++ stacks (I'm > thinking calling conventions may be a bit different)? C++ mainly differs here wrt. exception handling. This should be independent of stack switching on Linux, i.e. just give it a try. On Windows, Coco relies on Fibers to switch exception contexts. The other issue with C++ is name mangling. If you compile Lua+Coco as C++ code, you need to add three lines before the coco_wrap_main declaration in lcoco.c (reported by Jonathan Sauer): #if defined(__cplusplus) extern "C" #endif void coco_wrap_main(void); Actually I have a couple more pending changes for Coco 1.1.5 (nothing critical). But a new release is still on hold -- I'm waiting for the eventual release of Lua 5.1.5 (to avoid doing yet another patch to get back in sync). Dunno when or if that will happen, though. :-| --Mike From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 07:44:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83AiXpR001369; Thu, 3 Sep 2009 07:44:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4D4818FEB; Thu, 3 Sep 2009 07:44:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 703CF18F75 for ; Thu, 3 Sep 2009 07:44:03 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mj9nK-00041S-Sm for lua@bazar2.conectiva.com.br; Thu, 03 Sep 2009 10:43:59 +0000 From: "John Hind" To: "'Lua list'" References: <4A9EEC51.1090209@sct.microlink.com.br> In-Reply-To: Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Thu, 3 Sep 2009 11:43:11 +0100 Message-ID: <005901ca2c83$558d1e10$00a75a30$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcosH/Y4rR5V70kpR72uojak7j/NWgAYo37Q Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Or like this: #include "LuaJHcomlib.h" static const luaL_Reg gpreloads[] = { // {"name", luaopen_name}, {"com", luaopen_com}, {NULL, NULL} }; // When setting up the environment ... const luaL_Reg * lib = gpreloads; lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); for (; lib->func; lib++) { lua_pushcfunction(L, lib->func); lua_setfield(L, -2, lib->name); }; lua_pop(L, 2); -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Duncan Cross Sent: 02 September 2009 23:51 To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) On Wed, Sep 2, 2009 at 11:06 PM, Andre de Leiradella wrote: > (...) Or I'm completely missing an > obvious way to require modules that are compiled into the application > without hacks... In which case everyone is free to punch, ignore or > enlighten me. You should be able to make modules compiled into the application available to "require" by adding them into the "package.preload" table (the key is the module name as passed to require, and the value is the luaopen_... function). So, in your setup code for the Lua state, once the standard libraries have been added in, something like this should be enough: lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); lua_pushcfunction(luaopen_mymodule1); lua_setfield(L, -2, "mymodule1"); lua_pushcfunction(luaopen_mymodule2); lua_setfield(L, -2, "mymodule2"); // ... lua_pop(L,2); // remove package & package.preload -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 07:58:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83Avrgl002848; Thu, 3 Sep 2009 07:57:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B46CF191D6; Thu, 3 Sep 2009 07:57:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from malachi.anyware-tech.com (136.163-14-84.ripe.coltfrance.com [84.14.163.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5FFC1903D for ; Thu, 3 Sep 2009 07:57:26 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by malachi.anyware-tech.com (Postfix) with ESMTP id CDB0F30300 for ; Thu, 3 Sep 2009 12:57:24 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Debian amavisd-new at malachi.anyware-tech.com Received: from malachi.anyware-tech.com ([127.0.0.1]) by localhost (malachi.anyware-tech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MKH5YnoU3jsz for ; Thu, 3 Sep 2009 12:57:19 +0200 (CEST) Received: from [10.0.1.110] (fulgur.anyware [10.0.1.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by malachi.anyware-tech.com (Postfix) with ESMTPSA id 9AA03302F7 for ; Thu, 3 Sep 2009 12:57:19 +0200 (CEST) Message-ID: <4A9FA10F.1000902@anyware-tech.com> Date: Thu, 03 Sep 2009 12:57:19 +0200 From: Cuero Bugot User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Feature request for 5.2; make exit codes from popen()ed programs obtainable References: <923015801-1251909957-cardhu_decombobulator_blackberry.rim.net-359842766-@bda644.bisx.prod.on.blackberry> <790db3550909021029k2f6e3403lf43d5b4fe09c7124@mail.gmail.com> In-Reply-To: <790db3550909021029k2f6e3403lf43d5b4fe09c7124@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Actually I faced the prb a some time ago and started to see how the status could be returned cleanly. Finally I did not need the popen anymore so I did not implement the thing, but I found out that there were very little thing to change to make it good. First by not adding a new function. The current file:close could be used as suggested delbu9c1, returning a number is equivalent to return a boolean=true (this would also enable returning status=0 which actually mean OK) The modifications to the VM would be to: 1) luaconf.h line 679 to 680: change de macro #define lua_pclose(L,file) to actually return the pclose code isntead of a boolean Something like: #define lua_pclose(L,file) ((void)L, pclose(file)) 2) liolib.c line 108, function io_pclose(): Adapt it a little to something like: static int io_pclose (lua_State *L) { FILE **p = tofilep(L); int status = lua_pclose(L, *p); *p = NULL; if (status == -1) return pushresult(L, 0, NULL); lua_pushinteger(L, status); return 1; } Watchout: It did not compile nor test the above patch, this is just to illustrate my thought ;) Cuero Patrick Donnelly wrote: > On Wed, Sep 2, 2009 at 12:46 PM, wrote: > >> I'm not sure I see a benefit to it being a second return. Nil is false and all numbers are true so existing functionality should remain in tact. >> > > Yes, you're right. I'm thinking of another interface where a boolean > is always the first return. > > From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 08:03:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83B3OlF003703; Thu, 3 Sep 2009 08:03:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 909B1192A1; Thu, 3 Sep 2009 08:03:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 223FB1911E for ; Thu, 3 Sep 2009 08:03:00 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83B2vHA003647 for ; Thu, 3 Sep 2009 08:02:57 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n83B2vlA003645 for lua@bazar2.conectiva.com.br; Thu, 3 Sep 2009 08:02:57 -0300 Date: Thu, 3 Sep 2009 08:02:56 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090903110256.GA2754@duchamp.tecgraf.puc-rio.br> References: <4A9EEC51.1090209@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9EEC51.1090209@sct.microlink.com.br> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > It's sad to see Lua move away from its niche. Just for the record, Lua is not moving away from its goals. In particular, being easy to embed remains a major goal. We're not pushing Lua in a different direction. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 08:10:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83BAkV5004626; Thu, 3 Sep 2009 08:10:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4D4B19198; Thu, 3 Sep 2009 08:10:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f185.google.com (mail-px0-f185.google.com [209.85.216.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D761618FD6 for ; Thu, 3 Sep 2009 08:10:19 -0300 (BRT) Received: by pxi15 with SMTP id 15so1550860pxi.23 for ; Thu, 03 Sep 2009 04:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4d/G/DPo2r1X/RPiIXOzzson8Mb8C1xiar4/PKMzxw4=; b=ZwG+MN63BH+c6dZEQO0Nkjv9cfvB2q8zP+QAwCTczBcNtsRJuJm2u1oaOr4wgDpPDR LaKKP3Fonf+IOPmeX8M6l6GjWTnN8932vu9SCUMpTnuyuqk7hroLqqesXQ65P1MuTBTl MvG1hQIRivKv2kg9aVQyN2d9uhQ0BNzcSGBlw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=db5585/3dHronG/+05lfcKqf/ZfPr9gJfM3Ivw/+WlmthB24N+rWMV2i6z3tHzJ2wo IncURNhKnWttVtdXoewKaJL3LjYT4/ZeAjZuergpqq4xyqk89et7uTaLRpwFsiqoswbB PIhPs04T1T0mQN8Fy0TrgvMwPGzAaRettO0CI= MIME-Version: 1.0 Received: by 10.142.9.33 with SMTP id 33mr222178wfi.110.1251976217583; Thu, 03 Sep 2009 04:10:17 -0700 (PDT) In-Reply-To: <560972290909030218q65f61621j2bdf1a001d167bbc@mail.gmail.com> References: <4de92fd0909030127j3491b3cbnbe5119dc4a922118@mail.gmail.com> <560972290909030143s6dc3049fw5746b39889ed5d9@mail.gmail.com> <4de92fd0909030208r6d3b5833l932a049bb12eaa76@mail.gmail.com> <560972290909030218q65f61621j2bdf1a001d167bbc@mail.gmail.com> Date: Thu, 3 Sep 2009 19:10:17 +0800 Message-ID: <4de92fd0909030410j746353adra7a104b17741a74e@mail.gmail.com> Subject: Re: Lua how to call dotnet's function From: sagasw To: Lua list Content-Type: multipart/alternative; boundary=00504502afbab760930472aa6de7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502afbab760930472aa6de7 Content-Type: text/plain; charset=UTF-8 It could work now, your help are great. Thanks again. On Thu, Sep 3, 2009 at 5:18 PM, steve donovan wrote: > On Thu, Sep 3, 2009 at 11:08 AM, sagasw wrote: > > lua -e "io.stdout:setvbuf 'no'" "luanet.lua" > > lua: .\luanet.lua:1: loop or previous error loading module 'luanet' > > Ah, the problem is that you have named your file 'luanet.lua', so then > the require 'luanet' inside tries to load luanet.lua as a module. > > Rename it and see what happens... > > steve d. > --00504502afbab760930472aa6de7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It could work now, your help are great.
Thanks again.

On Thu, Sep 3, 2009 at 5:18 PM, steve donovan <steve.j.do= novan@gmail.com> wrote:
On Thu, Sep 3, 2009 at 11:08 AM, sagasw<sagasw@gmail.com> wrote:
> lua -e "io.stdout:setvbuf 'no'" &q= uot;luanet.lua"
> lua: .\luanet.lua:1: loop or previous error lo= ading module 'luanet'

Ah, the problem is that you have= named your file 'luanet.lua', so then
the require 'luanet' inside tries to load luanet.lua as a module.
Rename it and see what happens...

steve d.

--00504502afbab760930472aa6de7-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 09:23:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83CNa6g015528; Thu, 3 Sep 2009 09:23:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBD49192E7; Thu, 3 Sep 2009 09:23:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E61D191EE for ; Thu, 3 Sep 2009 09:22:58 -0300 (BRT) Received: by ewy26 with SMTP id 26so1716706ewy.5 for ; Thu, 03 Sep 2009 05:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Q2Rym12a/HJyqg/913Tq6sQCtgLYO5bEpfDRvQHYTK4=; b=WkzSvAX3jOtvkCbMOFjghNjZM3tK55SD1hJtxxSp6cIpVAt3N2jEBa19+rdvBHOxZk glxV3rhK8yKKVlUfmlBlWsCivOmbdMy4EwazFTg63xEEiTMDoeR7/km4Xq5K2QSaAH4Q UEu2DFjxl/29nqFw0xd/KzWcR//u+2Fhvqh6I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FWZJZBhp3jIaQiR1m24cIbw3Fj/c/RJHxrxdnO3Dv4rAEJcVDuDQ4oxcfQAB9r6LCj sUO9NS4rRLN1TGnu5EmYxYtD9RMjbcIEptB6Ai2fSKbmEQMXCyXaJMX7Vqpe+oNpTCe8 /bNCdaz5Zz7sg/ycNhrg0SFEberTOhRCGUX5I= MIME-Version: 1.0 Received: by 10.216.87.79 with SMTP id x57mr1840744wee.83.1251980577073; Thu, 03 Sep 2009 05:22:57 -0700 (PDT) In-Reply-To: <4551270139902020718@unknownmsgid> References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> From: Jerome Vuarand Date: Thu, 3 Sep 2009 14:22:36 +0200 Message-ID: <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/3 John Hind : > Or like this: > > #include "LuaJHcomlib.h" > static const luaL_Reg gpreloads[] = { > // {"name", luaopen_name}, > {"com", luaopen_com}, > {NULL, NULL} > }; > > // When setting up the environment ... > const luaL_Reg * lib = gpreloads; > lua_getglobal(L, "package"); > lua_getfield(L, -1, "preload"); > for (; lib->func; lib++) { > lua_pushcfunction(L, lib->func); > lua_setfield(L, -2, lib->name); > }; > lua_pop(L, 2); You can also write some helper functions: void luaL_preload(lua_State* L, const char* modname, lua_CFunction luaopen) { lua_getglobal(L, "package"); lua_getfield(L, -1, "preload"); lua_pushcfunction(L, luaopen); lua_setfield(L, -2, modname); lua_pop(L, 2); } void luaL_require(lua_State* L, const char* modname, lua_CFunction luaopen) { luaL_preload(L, modname, luaopen); lua_getglobal(L, "require"); lua_pushstring(L, modname); lua_call(L, 1, 0); } int main() { lua_State* L = luaL_newstate(L); luaL_openlibs(L); luaL_preload(L, "name", luaopen_name); luaL_require(L, "com", luaopen_com); ... lua_close(L); return 0; } From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 10:31:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83DV6HH030153; Thu, 3 Sep 2009 10:31:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAEBD19320; Thu, 3 Sep 2009 10:30:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99E17192E8 for ; Thu, 3 Sep 2009 10:30:17 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjCOA-0006lj-EW for lua@bazar2.conectiva.com.br; Thu, 03 Sep 2009 13:30:10 +0000 From: "John Hind" To: "'Lua list'" References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> In-Reply-To: <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Thu, 3 Sep 2009 14:29:23 +0100 Message-ID: <008201ca2c9a$8d2246e0$a766d4a0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoskWIHXEME98A/SoKmEBIkHxS2GwAB1Qyg Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n83DV6HH030153 But why bother putting it in the preload table if you then immediately load it using C code? The idea of the preload table is so you can have C libraries compiled into the runtime but which only get loaded into the Lua environment if called for by the script. If you load it right off, you should load it like any of the standard libraries i.e. by just executing its loader function. I use another loop: const luaL_Reg *lib = gloads; for (; lib->func; lib++) { lua_pushcfunction(L, lib->func); lua_pushstring(L, lib->name); lua_call(L, 1, 0); }; For the stuff I want to be available without a require statement in Lua. The advantage of this is it is "data driven" - you manage your libraries just by changing the two luaL_Reg tables. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand > Sent: 03 September 2009 13:23 > To: Lua list > Subject: Re: Wishlists and Modules (was [ANN] libmc) > > 2009/9/3 John Hind : > > Or like this: > > > > #include "LuaJHcomlib.h" > > static const luaL_Reg gpreloads[] = { > > // {"name", luaopen_name}, > > {"com", luaopen_com}, > > {NULL, NULL} > > }; > > > > // When setting up the environment ... > > const luaL_Reg * lib = gpreloads; > > lua_getglobal(L, "package"); > > lua_getfield(L, -1, "preload"); > > for (; lib->func; lib++) { > > lua_pushcfunction(L, lib->func); > > lua_setfield(L, -2, lib->name); > > }; > > lua_pop(L, 2); > > You can also write some helper functions: > > void luaL_preload(lua_State* L, const char* modname, lua_CFunction > luaopen) > { > lua_getglobal(L, "package"); > lua_getfield(L, -1, "preload"); > lua_pushcfunction(L, luaopen); > lua_setfield(L, -2, modname); > lua_pop(L, 2); > } > > void luaL_require(lua_State* L, const char* modname, lua_CFunction > luaopen) > { > luaL_preload(L, modname, luaopen); > lua_getglobal(L, "require"); > lua_pushstring(L, modname); > lua_call(L, 1, 0); > } > > int main() > { > lua_State* L = luaL_newstate(L); > luaL_openlibs(L); > luaL_preload(L, "name", luaopen_name); > luaL_require(L, "com", luaopen_com); > ... > lua_close(L); > return 0; > } From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 11:02:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83E24N3006471; Thu, 3 Sep 2009 11:02:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 640DA19345; Thu, 3 Sep 2009 11:01:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D7221931E for ; Thu, 3 Sep 2009 11:01:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so1817022ewy.5 for ; Thu, 03 Sep 2009 07:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=9KEcD6wWghABLJGu6f8zUx95MhKuDYc17pi67RQFhKg=; b=tcLEuS50DdhE+MIDCDSbuTtNxmJ8lvjk0fUxHdEZ62t+KKBDEScko37x9BDVzQl8lz CJht26gN8/Rdsqn0lyqWVi/Nj5uFWJtMAxG5VYOOmLOuqyB4IGmLP7ZxzORKK3cY07p0 TI2nL5f+yMOZil22zp/WiZ5aZZ0ynqp6KUSuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=BK9RMri020wLeQDAOaKMsrpW6X01ogd/jyiQ7m1yBun+g25vSpH6TSmaUtVHXpyELd bhLtUGWukfjZVxLz6jUyrRyLXMhE80UBXnbYnQvB1ZTsUEYn0cZgWIOjFZ8omSHbHYbW 1yUNqD3+jeOZnYxWQcVGwXPkWzjywVS5DsxIM= MIME-Version: 1.0 Received: by 10.216.39.85 with SMTP id c63mr506066web.103.1251986480168; Thu, 03 Sep 2009 07:01:20 -0700 (PDT) In-Reply-To: <4188134676190480523@unknownmsgid> References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> <4188134676190480523@unknownmsgid> From: Jerome Vuarand Date: Thu, 3 Sep 2009 16:01:00 +0200 Message-ID: <89d273ba0909030701j34c121f3vc0a16ba00521bb02@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/3 John Hind : > But why bother putting it in the preload table if you then immediately load it > using C code? The idea of the preload table is so you can have C libraries compiled into > the runtime but which only get loaded into the Lua environment if called for by > the script. If you load it right off, you should load it like any of the standard > libraries i.e. by just executing its loader function. Loaders of the standard libraries are designed to be just executed. Modules that are designed to be loaded through require may rely on the extra features of require to work properly (ie. setting package.loaded[modname] to the return value of the loader). From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 11:02:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83E2gtn006649; Thu, 3 Sep 2009 11:02:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 805CB1941C; Thu, 3 Sep 2009 11:01:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42D72193FB for ; Thu, 3 Sep 2009 11:01:53 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83E1pOF006438 for ; Thu, 3 Sep 2009 11:01:51 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n83E1oh00723; Thu, 3 Sep 2009 11:01:50 -0300 Date: Thu, 3 Sep 2009 11:01:50 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090903110150.A720@lua.tecgraf.puc-rio.br> References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> <008201ca2c9a$8d2246e0$a766d4a0$@hind@zen.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <008201ca2c9a$8d2246e0$a766d4a0$@hind@zen.co.uk>; from john.hind@zen.co.uk on Thu, Sep 03, 2009 at 02:29:23PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The advantage of this is it is "data driven" - you manage your libraries just by changing the two luaL_Reg tables. In Lua 5.2, linit.c will be just like that. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 11:59:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83EwuY4019932; Thu, 3 Sep 2009 11:58:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77EEB19338; Thu, 3 Sep 2009 11:58:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E54F619323 for ; Thu, 3 Sep 2009 11:58:17 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so399020eye.39 for ; Thu, 03 Sep 2009 07:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=2qHg6BUThiA+5I2iQctOcxkBL/8LOkeDDNAFza04gRw=; b=BhJUOAXLVF8JOjr38QXLRCAifAeP9BZv/hkhTCgI0wTTYVvMb1rB84AztPTKp4olkG KqaaPtCXJWuoGh2TIVOI6xHAkZUUcEnGAmfg1PieABNjcwE7P1xsvKgimnuCB9qFYMfq sUqfYrZXo39Fl3yVdZHz0RTdLWyenoW7tI+uY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=mWZ8EJs4ZFuuwB7n4LRjGXYKetkS+CbwMWqiD/9kmRX9EKmj4kauiSQedpkkBHCk+z JiFrWNOAD3sTvHJHUmwbS5dOCDQ/X4rhi0If2V7gjY5tqWrhVNbhRkvHFiwbPjBaL3rq eim2A/R0ROwAf11qbcOtOiLbSzKdXuDijQsQ8= MIME-Version: 1.0 Received: by 10.216.49.209 with SMTP id x59mr1783228web.195.1251989895719; Thu, 03 Sep 2009 07:58:15 -0700 (PDT) In-Reply-To: <20090903102446.GA3781@mike.de> References: <6cf7c3110909022242n6c460514p74939ffeb20408a2@mail.gmail.com> <20090903102446.GA3781@mike.de> Date: Thu, 3 Sep 2009 10:58:15 -0400 Message-ID: Subject: Re: Coco gcc inline asm and C++ From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 3, 2009 at 6:24 AM, Mike Pall wrote: > > Actually I have a couple more pending changes for Coco 1.1.5 > (nothing critical). But a new release is still on hold -- I'm > waiting for the eventual release of Lua 5.1.5 (to avoid doing yet > another patch to get back in sync). Dunno when or if that will > happen, though. :-| > > --Mike > Does anyone know if && when Lua-5.1.5 will happen? Will it have anything beyond bug fixes from http://www.lua.org/bugs.html ?? --Leo-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 12:40:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83FeP9Q029690; Thu, 3 Sep 2009 12:40:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0145819323; Thu, 3 Sep 2009 12:39:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC2C719219 for ; Thu, 3 Sep 2009 12:39:47 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjEPX-0005qf-NM for lua@bazar2.conectiva.com.br; Thu, 03 Sep 2009 15:39:43 +0000 From: "John Hind" To: "'Lua list'" References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> <4188134676190480523@unknownmsgid> <89d273ba0909030701j34c121f3vc0a16ba00521bb02@mail.gmail.com> In-Reply-To: <89d273ba0909030701j34c121f3vc0a16ba00521bb02@mail.gmail.com> Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Thu, 3 Sep 2009 16:38:56 +0100 Message-ID: <008a01ca2cac$a6667510$f3335f30$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcosnySpe66bPNm9RJmDQcZo7ejJ2gADDOKw Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n83FeP9Q029690 OK, I can see that if you are actually loading libraries written for the require system into the Lua environment from C, it will be safer to do so through the require function. However you would still not put such libraries into the preload table. The other alternative is just to put the library loader function into the preload table. Then the library gets loaded correctly by the require function when that is executed from the Lua script. This allows you to compile the library in, but only load it into Lua if required by the scripter. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand > Sent: 03 September 2009 15:01 > To: Lua list > Subject: Re: Wishlists and Modules (was [ANN] libmc) > > 2009/9/3 John Hind : > > But why bother putting it in the preload table if you then > immediately load it > > using C code? The idea of the preload table is so you can have C > libraries compiled into > > the runtime but which only get loaded into the Lua environment if > called for by > > the script. If you load it right off, you should load it like any of > the standard > > libraries i.e. by just executing its loader function. > > Loaders of the standard libraries are designed to be just executed. > Modules that are designed to be loaded through require may rely on the > extra features of require to work properly (ie. setting > package.loaded[modname] to the return value of the loader). From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 13:03:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83G3I1V001594; Thu, 3 Sep 2009 13:03:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C08221928C; Thu, 3 Sep 2009 13:02:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C753B18C57 for ; Thu, 3 Sep 2009 13:02:46 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n83G2kVm016774 for ; Thu, 3 Sep 2009 13:02:46 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 41E1054C1D7; Thu, 3 Sep 2009 13:02:46 -0300 (BRT) Date: Thu, 3 Sep 2009 13:02:46 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090903160246.GA27060@inf.puc-rio.br> References: <4A9EEC51.1090209@sct.microlink.com.br> <4551270139902020718@unknownmsgid> <89d273ba0909030522m36bd1d54gea82ebcbb750bbdc@mail.gmail.com> <4188134676190480523@unknownmsgid> <89d273ba0909030701j34c121f3vc0a16ba00521bb02@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89d273ba0909030701j34c121f3vc0a16ba00521bb02@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Loaders of the standard libraries are designed to be just executed. > Modules that are designed to be loaded through require may rely on the > extra features of require to work properly (ie. setting > package.loaded[modname] to the return value of the loader). The standard libraries do that too: > print(io) --> table: 0x806ce40 > print(package.loaded.io) --> table: 0x806ce40 > print(require("io")) --> table: 0x806ce40 -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 13:03:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83G3pHw001764; Thu, 3 Sep 2009 13:03:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1DF319326; Thu, 3 Sep 2009 13:02:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C081819219 for ; Thu, 3 Sep 2009 13:02:52 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83G2m0i001282 for ; Thu, 3 Sep 2009 13:02:49 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n83G2lm00930; Thu, 3 Sep 2009 13:02:47 -0300 Date: Thu, 3 Sep 2009 13:02:47 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Coco gcc inline asm and C++ Message-ID: <20090903130247.A927@lua.tecgraf.puc-rio.br> References: <6cf7c3110909022242n6c460514p74939ffeb20408a2@mail.gmail.com> <20090903102446.GA3781@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from slonik.az@gmail.com on Thu, Sep 03, 2009 at 10:58:15AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Does anyone know if && when Lua-5.1.5 will happen? > Will it have anything beyond bug fixes from http://www.lua.org/bugs.html ?? Minor releases never include new features, only bug fixes. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 20:22:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83NMYBq001731; Thu, 3 Sep 2009 20:22:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC6651928D; Thu, 3 Sep 2009 20:21:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56FA718F75 for ; Thu, 3 Sep 2009 20:21:52 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MjLcl-0004Mu-78 for lua@bazar2.conectiva.com.br; Thu, 03 Sep 2009 20:21:51 -0300 Message-ID: <4AA04FA5.5030304@sct.microlink.com.br> Date: Thu, 03 Sep 2009 20:22:13 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Wishlists and Modules (was [ANN] libmc) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Date: Thu, 3 Sep 2009 00:16:45 +0200 > From: Petite Abeille > > On Sep 3, 2009, at 12:06 AM, Andre de Leiradella wrote: > >> I really miss the times when Lua was just an embeddable script >> language. I could just compile all Lua libraries I wanted, make a >> host application or change lua.c to open the additional libraries, >> link everything and be happy. > > No reason to miss anything, jut ignore the "Architecture Astronauts" > and be merry :)) Haha, yeah, I think you're right. > Date: Wed, 2 Sep 2009 23:51:03 +0100 > From: Duncan Cross > > Leiradella wrote: >> (...) Or I'm completely missing an >> obvious way to require modules that are compiled into the application >> without hacks... In which case everyone is free to punch, ignore or >> enlighten me. > > You should be able to make modules compiled into the application > available to "require" by adding them into the "package.preload" table > (the key is the module name as passed to require, and the value is the > luaopen_... function). Thanks, I'll try it though I still miss the libraries the way they were before. I don't like the whole package idea. LUA_PATH sounds so weird in a language which can be run on systems without any file system! Though I know it's not part of neither the language nor the VM. And even after reading your message, I still don't know how to statically compile LuaSocket (for example) into an application, with all its Lua files also included in the application in order to avoid dependencies outside the executable. > Date: Wed, 2 Sep 2009 22:44:36 -0300 > From: Luiz Henrique de Figueiredo > >> I really miss the times when Lua was just an embeddable script language. >> I could just compile all Lua libraries I wanted, make a host application >> or change lua.c to open the additional libraries, link everything and be >> happy. > > You can do just that today: just edit linit.c to suit your needs. Sure, but as I said above how to deal with complex packages like LuaSocket? > Date: Thu, 03 Sep 2009 16:51:28 +0900 > From: Miles Bader > > Andre de Leiradella writes: >> I really miss the times when Lua was just an embeddable script >> language. I could just compile all Lua libraries I wanted, make a host >> application or change lua.c to open the additional libraries, link >> everything and be happy. > > hmm, I must be a bit confused, 'cause lua still seems like that today... Or the confusion is mine :-) > Date: Thu, 3 Sep 2009 11:43:11 +0100 > From: "John Hind" > > Or like this: > > snip... Thanks, I'll try that also. > Date: Thu, 3 Sep 2009 08:02:56 -0300 > From: Luiz Henrique de Figueiredo > >> It's sad to see Lua move away from its niche. > > Just for the record, Lua is not moving away from its goals. > In particular, being easy to embed remains a major goal. > We're not pushing Lua in a different direction. Sure, but the libraries we need to use with it appear to be. A language without libraries is of little usage. One has to be able to open files, write to the console, or do more complex things like popping a wxWidgets window. People in the community share libraries and bindings that do this stuff so it doesn't make sense to write them from scratch. But to use them I must use packages (or so I thought, I'll try the suggestions later) so I think the packages are pulling Lua from its niche. > Date: Thu, 3 Sep 2009 14:22:36 +0200 > From: Jerome Vuarand > > 2009/9/3 John Hind : >> snip... >> > > You can also write some helper functions: > > snip... Thanks, but how do I handle packages that include Lua files? > Date: Thu, 3 Sep 2009 14:29:23 +0100 > From: "John Hind" > > But why bother putting it in the preload table if you then immediately load it > using C code? The idea of the preload table is so you can have C libraries compiled into > the runtime but which only get loaded into the Lua environment if called for by > the script. If you load it right off, you should load it like any of the standard > libraries i.e. by just executing its loader function. Take a look at http.lua from LuaSocket: ----------------------------------------------------------------------------- -- Declare module and import dependencies ------------------------------------------------------------------------------- local socket = require("socket") local url = require("socket.url") local ltn12 = require("ltn12") local mime = require("mime") local string = require("string") local base = _G local table = require("table") module("socket.http") ... I simply don't know how to "internalize" LuaSocket into an executable. It doesn't seem that executing its loader function is enough. Please don't get me wrong, LuaSocket is a great library, it's just that I don't seem to find a way to make it into my application the way I want it to. > Date: Thu, 3 Sep 2009 16:01:00 +0200 > From: Jerome Vuarand > > 2009/9/3 John Hind : >> But why bother putting it in the preload table if you then immediately load it >> using C code? The idea of the preload table is so you can have C libraries compiled into >> the runtime but which only get loaded into the Lua environment if called for by >> the script. If you load it right off, you should load it like any of the standard >> libraries i.e. by just executing its loader function. > > Loaders of the standard libraries are designed to be just executed. > Modules that are designed to be loaded through require may rely on the > extra features of require to work properly (ie. setting > package.loaded[modname] to the return value of the loader). So it involves some voodoo to get it done! Thanks everyone, I have somethings to try now though I'm still full of doubts. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 20:28:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n83NSSsU002416; Thu, 3 Sep 2009 20:28:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D5EC192A4; Thu, 3 Sep 2009 20:28:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52B1918FEB for ; Thu, 3 Sep 2009 20:28:04 -0300 (BRT) Received: by ewy26 with SMTP id 26so438008ewy.5 for ; Thu, 03 Sep 2009 16:28:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.45.65 with SMTP id o43mr1935226web.4.1252020480775; Thu, 03 Sep 2009 16:28:00 -0700 (PDT) In-Reply-To: <4AA04FA5.5030304@sct.microlink.com.br> References: <4AA04FA5.5030304@sct.microlink.com.br> Date: Fri, 4 Sep 2009 00:28:00 +0100 X-Google-Sender-Auth: d39b647ad500b2ce Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 12:22 AM, Andre de Leiradella wrote: > Thanks, but how do I handle packages that include Lua files? Some some bin2c variant to convert the Lua source files to C byte arrays, embed said arrays in C application, then call luaL_loadbuffer for each one and store in in package.preload. It shouldn't be too hard to write a script which converts a directory of Lua files into a C file which contains the arrays and code to load them. From lua-bounces@bazar2.conectiva.com.br Thu Sep 3 22:17:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n841HtQp014774; Thu, 3 Sep 2009 22:17:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 601E419323; Thu, 3 Sep 2009 22:17:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id 15E9619315 for ; Thu, 3 Sep 2009 22:17:20 -0300 (BRT) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 03 Sep 2009 20:05:20 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Sep 2009 21:17:16 -0400 Message-ID: <4AA06A9B.3080304@elbitsystems-us.com> Date: Thu, 03 Sep 2009 21:17:15 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) References: <4AA04FA5.5030304@sct.microlink.com.br> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030404020401040207000506" X-OriginalArrivalTime: 04 Sep 2009 01:17:16.0431 (UTC) FILETIME=[70CCF9F0:01CA2CFD] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------030404020401040207000506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Peter Cawley wrote: > On Fri, Sep 4, 2009 at 12:22 AM, Andre de > Leiradella wrote: > >> Thanks, but how do I handle packages that include Lua files? >> > Some some bin2c variant to convert the Lua source files to C byte > arrays, embed said arrays in C application, then call luaL_loadbuffer > for each one and store in in package.preload. It shouldn't be too hard > to write a script which converts a directory of Lua files into a C > file which contains the arrays and code to load them. > I'm like Andre in this regard, remembering fondly the good old days. But even I have started created mixed libraries with the C part just for interfacing to the C library and the Lua code providing the Lua-friendly abstraction layer. bin2c does indeed work for simple files; I've used that technique many times. The tendency these days, though, is to do more and more in Lua and push only the essentials into C. That's a good thing in many ways. But it also makes it harder to retarget each library as an all-in-one, statically compiled, sans file system binary. Each library has to be combed over to find which Lua files in the hierarchy are truly part of the install base and then the proper load order has to be determined. I'm not convinced (yet) that this can be an automatic process. Doing so with LuaSocket would be a good test. It was very easy for me to do so with luaproc (the diff is tiny enough to attach). I compiled the luaproc objects separately, ran bin2c on luaproc.lua, then made the attached mods to the standard lua-5.1.4 source tree. Only when I finished the whole exercise did I notice that luaproc.lua did nothing but load the shared object - which isn't needed and doesn't exist - and the preload wasn't getting called. Easy enough to fix for test purposes, but I'm outa time today. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. --------------030404020401040207000506 Content-Type: text/x-diff; name="luaproc-static.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="luaproc-static.diff" diff -r -u lua-5.1.4-orig/src/linit.c lua-5.1.4/src/linit.c --- lua-5.1.4-orig/src/linit.c 2007-12-27 08:02:25.000000000 -0500 +++ lua-5.1.4/src/linit.c 2009-09-03 21:02:04.000000000 -0400 @@ -8,11 +8,16 @@ #define linit_c #define LUA_LIB +#include + #include "lua.h" #include "lualib.h" #include "lauxlib.h" +extern char file_luaproc_lua[]; + +extern int luaopen_luaproc(lua_State* L); static const luaL_Reg lualibs[] = { {"", luaopen_base}, @@ -23,6 +28,7 @@ {LUA_STRLIBNAME, luaopen_string}, {LUA_MATHLIBNAME, luaopen_math}, {LUA_DBLIBNAME, luaopen_debug}, + {"luaproc", luaopen_luaproc}, {NULL, NULL} }; @@ -34,5 +40,18 @@ lua_pushstring(L, lib->name); lua_call(L, 1, 0); } + + if (luaL_loadbuffer(L, file_luaproc_lua, strlen(file_luaproc_lua), + "luaproc.lua") != 0) + { + luaL_error(L, "could not load luaproc.lua"); + return; + } + + lua_getglobal(L, "package"); + lua_getfield(L, -1, "preload"); + lua_pushvalue(L, -3); /* Get the loaded buffer. */ + lua_setfield(L, -2, "luaproc"); + lua_pop(L, 3); /* preload, package, and original luaproc.lua. */ } diff -r -u lua-5.1.4-orig/src/Makefile lua-5.1.4/src/Makefile --- lua-5.1.4-orig/src/Makefile 2008-01-19 14:37:58.000000000 -0500 +++ lua-5.1.4/src/Makefile 2009-09-03 20:59:39.000000000 -0400 @@ -51,8 +51,12 @@ $(AR) $@ $? $(RANLIB) $@ +LUAPROC_O = channel.o list.o sched.o luaproc.o file_luaproc_lua.o +LUAPROC_DIR = ../.. +LUAPROC_OBJS = $(addprefix $(LUAPROC_DIR)/,$(LUAPROC_O)) + $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LUAPROC_OBJS) $(LIBS) -lpthread $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) --------------030404020401040207000506-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 00:38:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n843cuq7029741; Fri, 4 Sep 2009 00:38:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 404D919176; Fri, 4 Sep 2009 00:38:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EF2118F98 for ; Fri, 4 Sep 2009 00:38:21 -0300 (BRT) Received: by ewy26 with SMTP id 26so552875ewy.5 for ; Thu, 03 Sep 2009 20:38:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.152.15 with SMTP id e15mr177809ebo.30.1252035497154; Thu, 03 Sep 2009 20:38:17 -0700 (PDT) In-Reply-To: <4AA06A9B.3080304@elbitsystems-us.com> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> Date: Thu, 3 Sep 2009 23:38:17 -0400 X-Google-Sender-Auth: d17cf9f27902bb88 Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 3, 2009 at 9:17 PM, Doug Rogers wrote: > Each library has to be combed over to > find which Lua files in the hierarchy are truly part of the install base This is a problem that LuaRocks is intended to help solve. It can help even on a sans-filesystem, static-linking embedded target unsupported by LuaRocks (LuaRocks and LuaDist have generally been designed with dynamic linking in mind, but it is not necessarily inherent). Say the library you're interested in is LOOP. Looking, in you see than LOOP has this rockspec file: http://luarocks.luaforge.net/rocks/loop-2.3beta-1.rockspec The rockspec file tells you in a consistent format (1) Which files create which modules and what module names they correspond to (e.g. "lua/loop/base.lua" creates module "loop.base"). (2) Which files are not modules (e.g. precompiler.lua and preloader.lua are applications). (3) and other things (e.g. licensing, Lua version compatibility, etc.) You don't need to run any LuaRocks software. You may manually compile given that information or you may write your own tool that automatically compiles and statically links a subset of LuaRocks modules into your application via the information in the rockspec files. As Steve said: On Thu, Sep 3, 2009 at 6:02 AM, steve donovan wrote: > A key insight is that using a data format like rockspec does not bind one to using LuaRocks. On Thu, Sep 3, 2009 at 9:17 PM, Doug Rogers wrote: > Doing so with LuaSocket would be a good test. It was very easy for me to do > so with luaproc....Only when I finished the whole exercise > did I notice that luaproc.lua did nothing but load the shared object That luaproc.lua code is unusual, perhaps a pre-5.1 pattern. I think LuaSocket would be a better example. The rockspec for LuaSocket is more complicated to interpret since its author simply calls out to GNU make to build a shared library: http://luarocks.luaforge.net/rocks/luasocket-2.0.2-1.rockspec Nevertheless, the makefile builds into consistent LuaRocks target paths, and the assembling instructions are unambiguous (i.e. less "combing over"). If you prefer CMake over GNU make, instead unzip the dist -- http://www.luadist.org/repo/luadist/LuaModules/luasocket-2.0.2.dist -- and examine the CMakeLists.txt file. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 03:02:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8462Tlo009224; Fri, 4 Sep 2009 03:02:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09100190B7; Fri, 4 Sep 2009 03:01:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65D4318FB7 for ; Fri, 4 Sep 2009 03:01:50 -0300 (BRT) Received: by bwz10 with SMTP id 10so473280bwz.5 for ; Thu, 03 Sep 2009 23:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Q8+B1i9FGUsoj63UJ3jVkCbQAsJXxriy/DgVQHBZBSA=; b=LWFOlFVz4n68ALcgxF7+aGmmuPWcWt4Pr4GkzMt2/bDExd6HqD+KxDLoq6Doc6Z7Po Yno1P6w/yKnifHoaWENsSmDJ0S2umH4bfqaYb4cZrBntRm7hccg4I8QH1QZwOyIcR6Fb S2OS68B4CIQMTJL25hIr5UJUyOS2nWutbGV4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fbNbLshVCmWc4Vmjpl+2wLlhLbhzour8rV4hSN/LK+s2Xo9FnYBORuerw62InxPVEI sow42vJcajNLY0QrQI0iZx5YpvKgKt3f5xQDCkIoMZNV4Wy1erERoQCY5S6e2Vkou74j KBk0VMiemxSW70Uw4ZtKjla8v5RjrHRKOMG0A= MIME-Version: 1.0 Received: by 10.204.154.203 with SMTP id p11mr8748005bkw.180.1252044106658; Thu, 03 Sep 2009 23:01:46 -0700 (PDT) In-Reply-To: <4AA04FA5.5030304@sct.microlink.com.br> References: <4AA04FA5.5030304@sct.microlink.com.br> Date: Fri, 4 Sep 2009 08:01:46 +0200 Message-ID: <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 1:22 AM, Andre de Leiradella wrote: > And even after reading your message, I still don't know how to statically > compile LuaSocket (for example) into an application, with all its Lua files > also included in the application in order to avoid dependencies outside the > executable. How about looking at how John Murga does it with MurgaLua? http://www.murga-projects.com/murgaLua/ One executable, just about everything steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 03:19:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n846Iv6X010730; Fri, 4 Sep 2009 03:18:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75ACA192BC; Fri, 4 Sep 2009 03:18:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A96CE19176 for ; Fri, 4 Sep 2009 03:18:26 -0300 (BRT) Received: by fxm25 with SMTP id 25so59929fxm.5 for ; Thu, 03 Sep 2009 23:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xG4tle/zxsvCGlzN9I1VDFJcKv0Bwx+AuLqnS2xWVRw=; b=eyUc5xQWGaPsW+9qFhyaFauAMapAWaLDOZbPDMJLu6l+knC+4j1QPIZTVWI7Fj0ApT gtmjWygSPHdrgoTpQeyudF6fW815tKxowecs0Ee0sAdN3pNG3g3NxpIcNG8Q3m60kT5R 8KNqs7Jl6HLbvWWIs5TGE40mDt7Q5zVui5JSU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=upyazz0JZ/VKzROsNQSwFrxqTCmQJAV/mPH6+qHokO02ijfe6SxgX6cO/pKf1PVgBr HQyRliXmVBrFXBPAoPKyGZXkBX6Upf3U3mKJELQsV/FcjVvNhjT50ZbbV8bzRwirQsMx 1U7K01xu6bXjHuE6a6g9eWyAuWDKxX9PrlH3I= MIME-Version: 1.0 Received: by 10.204.26.150 with SMTP id e22mr8795483bkc.68.1252045104130; Thu, 03 Sep 2009 23:18:24 -0700 (PDT) In-Reply-To: <4AA06A9B.3080304@elbitsystems-us.com> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> Date: Fri, 4 Sep 2009 08:18:24 +0200 Message-ID: <560972290909032318j51854a80vb1df13dee30eb9a1@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 3:17 AM, Doug Rogers wrote: > bin2c does indeed work for simple files; I've used that technique many > times. The tendency these days, though, is to do more and more in Lua and > push only the essentials into C. That's a good thing in many ways. But it > also makes it harder to retarget each library as an all-in-one, statically > compiled, sans file system binary. Each library has to be combed over to > find which Lua files in the hierarchy are truly part of the install base and > then the proper load order has to be determined. I'm not convinced (yet) > that this can be an automatic process. Maybe not fully automatic, but most of the shlepp work can be done by parsing the files (various options exist) and finding out the actual dependencies. A semi-automatic option would be best, like the Linux kernel configuration menus. You would choose what libraries you want to embed, and it would generate the appropriate build. On the subject of using LuaRocks, I agree with David that it can be made to do the job, with some tweaking so it builds static libraries. Treat it as a build tool, and copy the resulting libraries to a more sensible place, no require 'luarocks.require' necessary. The version of Lua for Linux I'm working on does this. This is soon going to be moot, because LuaRocks 2.0 is going to use the 'canonical' paths. Automation is on my mind currently, thinking about a 'wizard' for generating rockspecs given a source archive. The hard bit tends to be the impenetrable fog which is the average makefile. Unfortunately this excellent piece of late 70s technology is not a good way to express build rules in a cross-platform way. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 04:55:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n847sx4t020295; Fri, 4 Sep 2009 04:54:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E45B19353; Fri, 4 Sep 2009 04:54:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD726192A5 for ; Fri, 4 Sep 2009 04:54:24 -0300 (BRT) Received: by fxm25 with SMTP id 25so100862fxm.5 for ; Fri, 04 Sep 2009 00:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=JKVbuqjFbbjzUMKv5ntkeSgDpWy31ktShLK0vnJIXMc=; b=CoeXu3Zip1smP/maFqF7OJW6LJbw5VVSHApxeMobi+0MQDYm1o2jvQC2vuXRSh7mWB UYaLUbKrMLrFdC0amUdAwE0yFaVpTcnBrjoZiRyeayBqdmPgwUV/uNNbm4yxsdMOB6Rt x7qwobF4vzjkeuRXIT0Eb2qC/sAVuSZXkBXw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=YUeGFaG79FVlhCeOoLBZlZWVS2y+I+kdizaG+IjUGn0EyEqF4kgHluRqSUT+nVQ2mo aRosTmdgGDd0GtqNb+3K5LMkV7Rfyb9fpZYRZ/PkyLZP8X1ps/iRcDgWT/FTWI5h8SU1 L3ByrXXC1HI66jtEP30YE5lGc9Mo3DfcCOSzk= MIME-Version: 1.0 Received: by 10.204.7.144 with SMTP id d16mr8716884bkd.209.1252050862503; Fri, 04 Sep 2009 00:54:22 -0700 (PDT) Date: Fri, 4 Sep 2009 09:54:22 +0200 Message-ID: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Subject: Lua FAQ has moved to new location! From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks to Patrick, the FAQ has a new permanent home: http://batbytes.com/luafaq This version fixes a few issues, and replaces the table dump example which was completely borked. There are sections which are crying out for attention: 1.33 Embedding Lua in an Application? Lua was designed to embed easily in programs. 3.9 Can Lua be used as a Web scripting language? The Kepler Project is dedicated to making Lua a first-class citizen of the Web development world. Well, true enough! But we do definitely need some flesh on the bones. The section numbers are now autogenerated, so it is easy to reorder items. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 05:11:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n848BWB7022162; Fri, 4 Sep 2009 05:11:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7FC21934B; Fri, 4 Sep 2009 05:11:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3062D18F06 for ; Fri, 4 Sep 2009 05:11:04 -0300 (BRT) Received: by bwz10 with SMTP id 10so528465bwz.5 for ; Fri, 04 Sep 2009 01:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=P0reO7N6MlROJyeerpVAmHTk/riu1o5S/6VIYpgGQ7A=; b=xC2PrCnfzb9DH7oPi2apbQYfCYf3t4f7Cv6Onm89oQOcxgAnuli28MzfBimwn8fFww Fi0D/Cq5coXjycTEYWzE+znLFOmckHAgDWwK3pSBRl6172RTdlMawMH9X3QJYFBmp4zR OVHNWJ4EBlT35xxt1inQBNWLGZb6Ghq4TByq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=FU8tddlyu4UpyxewSVejhUAd8owpKZWAYWiyXWmggyt738Q+/X236ucqq/xfFCUfXe ZWO7qpBA2buMaykHWXQWtJieoDfE0Jk1gjTSASpAK/uh8JcsfZC1La1t3Z8TW/BkhaXI alqyPZL6WQhZk7JVhQ9XtKfnCIzxpwWF9621k= MIME-Version: 1.0 Received: by 10.103.78.7 with SMTP id f7mr4591847mul.95.1252051861871; Fri, 04 Sep 2009 01:11:01 -0700 (PDT) In-Reply-To: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Date: Fri, 4 Sep 2009 03:11:01 -0500 Message-ID: Subject: Re: Lua FAQ has moved to new location! From: Jeff Pohlmeyer To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 4, 2009, steve donovan wrote: > Thanks to Patrick, the FAQ has a new permanent home: > http://batbytes.com/luafaq Nice. I haven't had a chance to finish reading the whole thing, but this reminds me I did find a few typos in what I did get through, shown here in "psuedo-diff" format: - languges + languages - the first step is to use LuaProfiler the program + the first step is to use LuaProfiler on the program - chosing + choosing Also, I'm not sure if the title of section 1.10 accurately describes its content. (Or maybe I'm just too dense.) But otherwise, it looks great! - Jeff From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 05:15:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n848ExLa022533; Fri, 4 Sep 2009 05:14:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 338D51936C; Fri, 4 Sep 2009 05:14:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 069FB19366 for ; Fri, 4 Sep 2009 05:14:35 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjTwG-00025A-Jy for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 08:14:32 +0000 From: "John Hind" To: "'Lua list'" References: <4AA04FA5.5030304@sct.microlink.com.br> <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> In-Reply-To: <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Fri, 4 Sep 2009 09:13:44 +0100 Message-ID: <001801ca2d37$9ebc6b40$dc3541c0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcotJVBvfWs2Hf+1RUu2w26A3wrkWAADy2vQ Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I will have to have a look at murgaLua. I have been working on the next version of my Grunt (Windows only) Lua runtime. It has a resource loader which can load Lua scripts from text resources embedded in the exe file. This approach will do what you are looking for and has the additional advantage that you do not have to recompile to change the Lua (just use a resource editor). However I cannot find any way to merge DLL files into an exe so you do still need to recompile to add modules that have non-Lua components. Of course the other problem is that not all modules are written to compile cleanly to static targets on all platforms using all toolchains, and there may also be C versus C++ issues ... > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: 04 September 2009 07:02 > To: Lua list > Subject: Re: Wishlists and Modules (was [ANN] libmc) > > On Fri, Sep 4, 2009 at 1:22 AM, Andre de > Leiradella wrote: > > And even after reading your message, I still don't know how to > statically > > compile LuaSocket (for example) into an application, with all its Lua > files > > also included in the application in order to avoid dependencies > outside the > > executable. > > How about looking at how John Murga does it with MurgaLua? > > http://www.murga-projects.com/murgaLua/ > > One executable, just about everything > > steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 05:26:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n848QQIX023499; Fri, 4 Sep 2009 05:26:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F16619342; Fri, 4 Sep 2009 05:26:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F75418D78 for ; Fri, 4 Sep 2009 05:25:57 -0300 (BRT) Received: by bwz10 with SMTP id 10so536271bwz.5 for ; Fri, 04 Sep 2009 01:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=scqddyQ17rStX8+CnZUq1Lu2nNl2jVGDvezXOa9MfNw=; b=K5dKWsI0Pyk9ubbzteo1Xrgrr+NzvYbdyCBPwCk/VcCJqQImH+4G3MTPPH0pNp+e9+ JWa10EbfcZ8ThZBkurJoIT9ORerW6VVGBJvE5AosV4iZZFs+lGjR3M27N7KBSoPGtxra 4o+9CzZwObgPi/TrkEH9GFxe1btRdTaea13W4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ej4Qj2IH1yawe6F4UUJ5Xi8TmjNqKBPA+W3f7M8FbFPx5pQHPOYZMz10sxUZvqBfj/ 5iRJNc8W8/zvhTlltuXjian7NM5QEc/COX/qq2uc33u0EtOuhfKp3nOBxkV/tETr3JzR fZKRsIflJaPh4UjNFSDoPlFmGwKh06t92qMYY= MIME-Version: 1.0 Received: by 10.204.7.144 with SMTP id d16mr8743558bkd.209.1252052754500; Fri, 04 Sep 2009 01:25:54 -0700 (PDT) In-Reply-To: <5813009242880828452@unknownmsgid> References: <4AA04FA5.5030304@sct.microlink.com.br> <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> <5813009242880828452@unknownmsgid> Date: Fri, 4 Sep 2009 10:25:51 +0200 Message-ID: <560972290909040125v619ed028vb82b97bb6e7e0b2e@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 10:13 AM, John Hind wrote: > I have been working on the next version of my Grunt (Windows only) Lua > runtime. It has a resource loader which can load Lua scripts from text > resources embedded in the exe file. This approach will do what you are > looking for and has the additional advantage that you do not have to > recompile to change the Lua (just use a resource editor). Always was a cool thing about Win32 exes. But this can also be done semi-elegantly in Linux: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967 The key is the magic command 'objcopy' which turns an arbitrary file into a linkable .o file. OK, would have to relink, but that's usually pretty fast. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 06:57:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n849vlfB030864; Fri, 4 Sep 2009 06:57:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 312E71936F; Fri, 4 Sep 2009 06:57:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB3FC19288 for ; Fri, 4 Sep 2009 06:57:11 -0300 (BRT) Received: by fxm25 with SMTP id 25so167518fxm.5 for ; Fri, 04 Sep 2009 02:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7gSeqS+mS0AC8w8EWvHWi9l9AHQPQ7s6LdKBKELGexU=; b=xe2u6kLokUxQ+q5BNo+32Ef6P4qAuuwgARajw7whFvhpcSqZgFF58ioAKEHxrNF1J3 veCtWul90Jg2cZPoQ3CNp1Z6F8vbu0455Txcl4TYoAAB2II4gFKWZho3i0M5mwmtuQrE KFgzHM05wqx2SZLqOKzgIA75E5DmSXsdrNd0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xtYPKZf3esLEY6Ejor0+0JrvIMEpu9umKF4jzkrQiKixIvi0mj1eM81cjT5t0gEeMU xsCkRju+j+qniDJr1FzuWVaVNm0/o1an+v8mpWWtgQguumusL7iQA6Pg7f4NcPU08tHc cpm/gujUCvXIGBGmIiSzGo3mlHlSiO0bTd9xM= MIME-Version: 1.0 Received: by 10.204.7.197 with SMTP id e5mr8838842bke.184.1252058229309; Fri, 04 Sep 2009 02:57:09 -0700 (PDT) In-Reply-To: References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Date: Fri, 4 Sep 2009 11:57:09 +0200 Message-ID: <560972290909040257u3dce892cpb25c365485742f03@mail.gmail.com> Subject: Re: Lua FAQ has moved to new location! From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 10:11 AM, Jeff Pohlmeyer wrote: > I haven't had a chance to finish reading the whole thing, > but this reminds me I did find a few typos in what I did > get through, shown here in "psuedo-diff" format: Thanks, Jeff. I need to spellcheck at the very least! A lot of the questions we get on the list have to do with the C/C++ API. Would it make sense to split this off as a separate document? steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 07:09:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84A9C1M032255; Fri, 4 Sep 2009 07:09:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC66F19384; Fri, 4 Sep 2009 07:08:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC8C51937D for ; Fri, 4 Sep 2009 07:08:43 -0300 (BRT) Received: by ewy26 with SMTP id 26so731665ewy.5 for ; Fri, 04 Sep 2009 03:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=HUy8nui8uWWwC3dZte9swIXuA9M0qfzQCJrCMAmrF1c=; b=YLZdxDZkzfMg9o7Jfm9LW8te/ml2WR3PBDSfMpsWyRrcIz3l1L0Uss/oyV2J24dXJi LrpyWsiCRTqMyrMX/jgIKZhae83mU6vyr4n0DVLoc1Vg5nM64sO0OPuAYpDxjzRssphS dGHiV8i/71rPH8ztL7t3s98fyZG2VLW9MS2Pk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gxSLeTRbCFwvBji2rbEA5PkTtf0+lUg9U/+mj2fGKt6lcSfOJJDILrSU3nahpyNAOB mJZej1kHOuoVevPCm165wlnFzG5IrjdfBHHDcEVDuS2atjkM4R7D5L89lriEVMDwlNHJ 3JlRTqgQL8uWkGmZOc600b2biS7/gaPLA979w= MIME-Version: 1.0 Received: by 10.216.90.203 with SMTP id e53mr771049wef.28.1252058922142; Fri, 04 Sep 2009 03:08:42 -0700 (PDT) In-Reply-To: <4AA04FA5.5030304@sct.microlink.com.br> References: <4AA04FA5.5030304@sct.microlink.com.br> From: Jerome Vuarand Date: Fri, 4 Sep 2009 12:08:22 +0200 Message-ID: <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/4 Andre de Leiradella : > Take a look at http.lua from LuaSocket: > > ----------------------------------------------------------------------------- > -- Declare module and import dependencies > ------------------------------------------------------------------------------- > local socket = require("socket") > local url = require("socket.url") > local ltn12 = require("ltn12") > local mime = require("mime") > local string = require("string") > local base = _G > local table = require("table") > module("socket.http") > > ... > > I simply don't know how to "internalize" LuaSocket into an executable. It > doesn't seem that executing its loader function is enough. > > Please don't get me wrong, LuaSocket is a great library, it's just that I > don't seem to find a way to make it into my application the way I want it > to. LuaSocket is a perfect example where using package.preload and require is just as simple if not simpler than trying to load everything yourself. Just put all the LuaSocket module loaders in the preload table. For C modules, use the luaL_preload function I gave earlier. For the Lua modules, use luaL_loadbuffer instead of lua_pushcfunction. I don't know how to be more explicit. Tell us if it's still not clear enough. I think this is simple enough. Modules, packages, or whatever you call them have interdependencies. There is now a mechanism to express these dependencies at runtime. All you have to do is to make the modules you may need indirectly (you want socket.http but it needs socket.url) to be available somehow, and between all the existing searchers and the ones you can add there is plenty of freedome to pick what is the simplest for you. You may be used to the old way of doing things, but from the point of view of someone that started using Lua at the release of 5.1, the old way doesn't look any simpler even in embedding contexts. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 07:27:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84AR4nA001129; Fri, 4 Sep 2009 07:27:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C3071938D; Fri, 4 Sep 2009 07:26:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A065E1937F for ; Fri, 4 Sep 2009 07:26:37 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjW01-0003qY-W4 for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 10:26:34 +0000 From: "John Hind" To: "'Lua list'" References: <4AA04FA5.5030304@sct.microlink.com.br> <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> In-Reply-To: <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Fri, 4 Sep 2009 11:25:45 +0100 Message-ID: <002501ca2d4a$104afc60$30e0f520$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcotJVBvfWs2Hf+1RUu2w26A3wrkWAAHVzlw Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Having now looked at the MurgaLua site - and been impressed by the ambition, particularly the multi-platform GUI approach. However it does exemplify the other big problem with modular code re-use particularly in the open source area - discoverability. I'm not getting at John Murga in particular, this is a problem I've noticed at lots of project sites. It is very common for the home page for a project to be a version history - this may be fine for returning visitors who are already invested, but it is hopeless for discoverability! The home page for a software project needs to clearly provide the following minimum information: 1. What is the project *for*: what is its mission, its ambition? 2. What stage is the project at, when was the latest release and how far along the mission line is it? 3. What platforms does the project target? What other dependencies does it have? 4. What is the licence? Is it open source, freeware, if paid for, how much? 5. If open-source, what development platform, language and toolchain is used/supported? I would estimate that on average it takes at least ten minutes per project to gather this essential information just to decide if the project meets your current need. It is just amazing how often I've hunted a full website and am still left having to deduce from indirect clues which major platform the project is for! Lua itself does reasonably well on this checklist if you know to follow the "about" link on the home page, but I still think it would be good to have a basic mission statement on the home page so new users can quickly see if it is for them or not, something like: "Lua is a mature, open source, compact scripting language implemented in pure ANSI C to build and run on virtually any platform. It can be easily embedded in applications as an extension and configuration language. [more]" With [more] being a link to the "about" page. Sorry about the rant, but this is directly pertinent to the topic of what it takes in documentation terms to make practical code re-use feasible. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: 04 September 2009 07:02 > To: Lua list > Subject: Re: Wishlists and Modules (was [ANN] libmc) > > On Fri, Sep 4, 2009 at 1:22 AM, Andre de > Leiradella wrote: > > And even after reading your message, I still don't know how to > statically > > compile LuaSocket (for example) into an application, with all its Lua > files > > also included in the application in order to avoid dependencies > outside the > > executable. > > How about looking at how John Murga does it with MurgaLua? > > http://www.murga-projects.com/murgaLua/ > > One executable, just about everything > > steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 07:42:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Ag0JO002575; Fri, 4 Sep 2009 07:42:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81AA01939A; Fri, 4 Sep 2009 07:41:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 422F119387 for ; Fri, 4 Sep 2009 07:41:28 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjWEO-0002pS-D8 for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 10:41:24 +0000 From: "John Hind" To: "'Lua list'" References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> In-Reply-To: <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> Subject: RE: Wishlists and Modules (was [ANN] libmc) Date: Fri, 4 Sep 2009 11:40:35 +0100 Message-ID: <002601ca2d4c$23062490$69126db0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcotR8hOMwWvloQHQ62qK9mFm41NKAAAsTfQ Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84Ag0JO002575 As you say Jerome, it is easy enough to internalise the "C" parts of the library (as long as you have the source and it is well written). But this is not true of the Lua bits. This is actually why I tend to swim against the stream on this one and implement as much as possible of the "infrastructure" in C leaving Lua for specific application code. The ability to use the Lua API as a kind of C toolkit means it is quite easy to translate a Lua prototype into C. I wonder if it would be possible to make some kind of container file something like a zip where an exe file was executed and presented with a filesystem completely embedded within itself. Then you could put Lua and DLL files into that embedded file system and have them discovered and loaded using the existing Lua mechanisms ... > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand > Sent: 04 September 2009 11:08 > To: Lua list > Subject: Re: Wishlists and Modules (was [ANN] libmc) > > 2009/9/4 Andre de Leiradella : > > Take a look at http.lua from LuaSocket: > > > > --------------------------------------------------------------------- > -------- > > -- Declare module and import dependencies > > --------------------------------------------------------------------- > ---------- > > local socket = require("socket") > > local url = require("socket.url") > > local ltn12 = require("ltn12") > > local mime = require("mime") > > local string = require("string") > > local base = _G > > local table = require("table") > > module("socket.http") > > > > ... > > > > I simply don't know how to "internalize" LuaSocket into an > executable. It > > doesn't seem that executing its loader function is enough. > > > > Please don't get me wrong, LuaSocket is a great library, it's just > that I > > don't seem to find a way to make it into my application the way I > want it > > to. > > LuaSocket is a perfect example where using package.preload and require > is just as simple if not simpler than trying to load everything > yourself. Just put all the LuaSocket module loaders in the preload > table. For C modules, use the luaL_preload function I gave earlier. > For the Lua modules, use luaL_loadbuffer instead of lua_pushcfunction. > I don't know how to be more explicit. Tell us if it's still not clear > enough. > > I think this is simple enough. Modules, packages, or whatever you call > them have interdependencies. There is now a mechanism to express these > dependencies at runtime. All you have to do is to make the modules you > may need indirectly (you want socket.http but it needs socket.url) to > be available somehow, and between all the existing searchers and the > ones you can add there is plenty of freedome to pick what is the > simplest for you. You may be used to the old way of doing things, but > from the point of view of someone that started using Lua at the > release of 5.1, the old way doesn't look any simpler even in embedding > contexts. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 08:21:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84BLLdf008578; Fri, 4 Sep 2009 08:21:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 242E319182; Fri, 4 Sep 2009 08:20:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30DF718EC5 for ; Fri, 4 Sep 2009 08:20:52 -0300 (BRT) Received: by bwz10 with SMTP id 10so633181bwz.5 for ; Fri, 04 Sep 2009 04:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=u9c1NruhPqjoP5C1aH0DGwf3SelCy+9ZxM39ZdNMpro=; b=O1EkpmMEA365Bp3soE4NcvKkDCiwoLtTpUiUVfy1a8b6MHnrN/zDu/lpNNImGETf7s 3NDMzpyKWwiPB3smrt+g5Eb0LHBUBBUQ/qiFPrYDJWG1yVMU+ILYcpG+nKJBDM0GDZOU mjnjvcgfNGbyT8Ld31YUa76DmfAGzmss9d6ss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gMpI9uuXjcL6q+sr4J014NBsmXz8bRZbpX+KcKs4Wrbljls9WnxsdIMJDrB0tzSdZc dG2ji6IDa/uNe2h/u5lHieIRE0cUD40bvNkZsp/MMGMPXNZ2V0KdtRXSTmAiivDiDoIj jhNpAC8H7jdpPAN/n8hefDT9nHpO+fKOdSFzk= MIME-Version: 1.0 Received: by 10.204.0.69 with SMTP id 5mr7777890bka.173.1252063251819; Fri, 04 Sep 2009 04:20:51 -0700 (PDT) In-Reply-To: <-8396091012579866109@unknownmsgid> References: <4AA04FA5.5030304@sct.microlink.com.br> <560972290909032301w206fe489k74e132faaa9c3ddb@mail.gmail.com> <-8396091012579866109@unknownmsgid> Date: Fri, 4 Sep 2009 13:20:51 +0200 Message-ID: <560972290909040420o7ac90fa8ra5b8ac272c51e41@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 12:25 PM, John Hind wrote: > a problem I've noticed at lots of project sites. It is very common for the > home page for a project to be a version history - this may be fine for > returning visitors who are already invested, but it is hopeless for > discoverability! Sad but true. Your list 1 to 5 is basic stuff, but coders are sometimes poor communicators. This is an area where users of a project can contribute very usefully, but only if the maintainer has set up some infrastructure, like a Wiki. I was sufficiently curious to get the source of MurgaLua, and therein found a nice readme. Why not put it on the website? steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 08:28:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84BS03B009278; Fri, 4 Sep 2009 08:28:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0909B1935D; Fri, 4 Sep 2009 08:27:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18A8E1926D for ; Fri, 4 Sep 2009 08:27:35 -0300 (BRT) Received: by fxm25 with SMTP id 25so217957fxm.5 for ; Fri, 04 Sep 2009 04:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=BQQcYPPQENzzdTn9L+J0/m6O38V3BTCSxxOHHbs0oy0=; b=EdiZL0IdpHyj1llCpXW0vvK7ZAlZPi3amT/rQxn7Qk8wlaUODDYeoS7EkKGonYfpo+ 4v9nPsQd9CIkrm+wiibX/UOmAQYrHMSjuemY6or507hH8VeQqfUMgtWV6GUrgB7iBDpC /5u43fh5njmgsRzgRX+U7rqHNdsILMEZV99t8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XIaG7NyMsRvUv1pTXDvh80ftsbS9eT+ZzBnFTUJ/CRr1MX5zGej9MLI8YhCfteCA5A 6ble0/cwo+DYEjOULW+egEWrKjqy8X5IS8f8OLB1rETTeusuwvHJnweJuFZk3rJNUaFy FYZmgmZ2iCa56eNaGoRAUZ6u2OEBRezDNBuxk= MIME-Version: 1.0 Received: by 10.204.24.71 with SMTP id u7mr9062329bkb.35.1252063653301; Fri, 04 Sep 2009 04:27:33 -0700 (PDT) In-Reply-To: <-4648601909267222238@unknownmsgid> References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> Date: Fri, 4 Sep 2009 13:27:31 +0200 Message-ID: <560972290909040427s4e161calf8769340f182b45c@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84BS03B009278 On Fri, Sep 4, 2009 at 12:40 PM, John Hind wrote: > I wonder if it would be possible to make some kind of container file something like a zip where an exe file was executed and presented with a filesystem completely embedded within itself. Then you could put Lua and DLL files into that embedded file system and have them discovered and loaded using the existing Lua mechanisms ... It's probably possible using zlib or something like that, but the loader would have to be modified. The DLL bit is tricky, since the OS loader can't be so easily hacked. Would have to extract DLLs automatically to a temp dir. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 08:32:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84BWdBx010352; Fri, 4 Sep 2009 08:32:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 254D61936E; Fri, 4 Sep 2009 08:32:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9BDF19363 for ; Fri, 4 Sep 2009 08:32:15 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84BWEYa010282 for ; Fri, 4 Sep 2009 08:32:14 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n84BWDD04536; Fri, 4 Sep 2009 08:32:13 -0300 Date: Fri, 4 Sep 2009 08:32:12 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua FAQ has moved to new location! Message-ID: <20090904083212.A4528@lua.tecgraf.puc-rio.br> References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com>; from steve.j.donovan@gmail.com on Fri, Sep 04, 2009 at 09:54:22AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The section numbers are now autogenerated, so it is easy to reorder > items. Reordering makes it difficult to provide permanent links. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:09:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84C9eEd015865; Fri, 4 Sep 2009 09:09:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 665FE19338; Fri, 4 Sep 2009 09:09:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05B3D18E5B for ; Fri, 4 Sep 2009 09:09:08 -0300 (BRT) Received: by bwz10 with SMTP id 10so662342bwz.5 for ; Fri, 04 Sep 2009 05:09:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.26.150 with SMTP id e22mr9090647bkc.68.1252066145738; Fri, 04 Sep 2009 05:09:05 -0700 (PDT) In-Reply-To: References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> Date: Fri, 4 Sep 2009 15:09:05 +0300 X-Google-Sender-Auth: 9e10dee8b29f678a Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84C9eEd015865 > LuaSocket would be a better example.  The rockspec for LuaSocket is > more complicated to interpret since its author simply calls out to GNU > make to build a shared library: I wish module authors would stop using make altogether and build/install only through LuaRocks. Let the build toolchain be controlled by the package manager, not some makefile that I eternally have to tweak between platforms. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:28:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84CSet5018755; Fri, 4 Sep 2009 09:28:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CFA819182; Fri, 4 Sep 2009 09:28:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 412F618F56 for ; Fri, 4 Sep 2009 09:28:15 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84CSDce018675 for ; Fri, 4 Sep 2009 09:28:13 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n84CSCW04865; Fri, 4 Sep 2009 09:28:12 -0300 Date: Fri, 4 Sep 2009 09:28:12 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090904092812.A4857@lua.tecgraf.puc-rio.br> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from cosmin.apreutesei@gmail.com on Fri, Sep 04, 2009 at 03:09:05PM +0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I wish module authors would stop using make altogether and > build/install only through LuaRocks. Let the build toolchain be > controlled by the package manager, not some makefile that I eternally > have to tweak between platforms. Look at it this way: the Makefile is an executable documentation of how to build the module, one that works in the author's platform if not in several others. Downstream packagers can then copy/adapt/use whatever they can and need from the Makefile. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:33:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84CX2Z5019512; Fri, 4 Sep 2009 09:33:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9BC4192BC; Fri, 4 Sep 2009 09:32:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99E321928C for ; Fri, 4 Sep 2009 09:32:37 -0300 (BRT) Received: by fxm25 with SMTP id 25so257901fxm.5 for ; Fri, 04 Sep 2009 05:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=D15iOm0hJBu3nz4jzBBvAJmQypErLcAPZk44klrDqRQ=; b=gt/GITInQDUSHTJGslRN/kL784pZEjqaYZ68hU0MDGWF3lWA4fBo2qUuEpyMl+/vc6 AQTcC6URw/rrK4wSgWB/0abnzd7R5uflqUzGDBosNg1e5AmnFfPb5oQd5BKMG35/rmJu qrATGQ1UvQX/++3OadfFZk+Imz+KORu14xDnU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NkL44rU+CbrKgZySN5eAxQN/kSE53xRhIHxi2l1MWehY8sTYJ2JbrL0pH2T/GD+i2g 6EY8sTRUjywR2eynhANuDDYjG+BlcHrIhilvndp6AItdc0kMbs3E78CjW/8mzsSbc6a/ dPO8DMf3OsQGWk4PSjkGKCK6MqgDc373ui02c= MIME-Version: 1.0 Received: by 10.204.160.86 with SMTP id m22mr9043570bkx.82.1252067555119; Fri, 04 Sep 2009 05:32:35 -0700 (PDT) In-Reply-To: References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> Date: Fri, 4 Sep 2009 14:32:35 +0200 Message-ID: <560972290909040532m2f64168cy502ef5afc3bcaff3@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 2:09 PM, Cosmin Apreutesei wrote: > I wish module authors would stop using make altogether and > build/install only through LuaRocks. Let the build toolchain be > controlled by the package manager, not some makefile that I eternally > have to tweak between platforms. I totally agree, but it remains the quickest way to get a rock going. A pity, because it's a very capable little build engine that could probably cope with this case. (Obviously not for more complicated scenarios, e.g Alien has to build libffi). Yet authors still want to deliver their packages in a standard way, which is a makefile, naturally enough. Then as an afterthought a rockspec is written which takes the easy way. LR is picky about this, too; as you will find when you try to bring in such packages on Windows, and get the 'makefile.win not found' error. This is why I'm starting to work on Rockspeculator, which is an interactive script which generates rockspecs. Should take a lot of the hard work out of packaging for LuaRocks. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:37:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84CbmOC020172; Fri, 4 Sep 2009 09:37:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6015E1934B; Fri, 4 Sep 2009 09:37:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D064C18FCD for ; Fri, 4 Sep 2009 09:37:23 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MjY2T-00041Q-OE for ; Fri, 04 Sep 2009 13:37:13 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MjY2c-0003od-8S for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 13:37:22 +0100 Date: Fri, 4 Sep 2009 13:37:21 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 4 Sep 2009 15:09:05 +0300 Cosmin Apreutesei wrote: > I wish module authors would stop using make altogether and > build/install only through LuaRocks. Let the build toolchain be > controlled by the package manager, not some makefile that I eternally > have to tweak between platforms. Please, no. LuaRocks makes me a sad panda. Not to mention that it hardly ever works correctly for me, getting it to spit out things suitable for integration into other products is a pain. I think I'd be happier if what LuaRocks was was a system for converting a description of a Lua module into a package; so RPM, DEB, tar.gz, Windows MSI, etc. B. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:38:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Cckil020388; Fri, 4 Sep 2009 09:38:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA8111935D; Fri, 4 Sep 2009 09:38:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8819B1928C for ; Fri, 4 Sep 2009 09:38:23 -0300 (BRT) Received: by bwz10 with SMTP id 10so680724bwz.5 for ; Fri, 04 Sep 2009 05:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=uG7iM+P9yZufT+t5+B/xx8CKn29bXDKeLG1r7IYxX54=; b=YhiQ9ZL7kgZvVuVV7te5RJIxkl53V749RpuZDcr/U8qzHvNOIkVs6ZOe86KOph0LNM 8FBOzgoV7UyK6StlTuqnjjDdpu4Oe6bdr4HMPzS1xwAqhsbmf3apy68LbKPsDejMt7dP /dzOAgcAPQrycHr7Z9Bc89ve8mE+5i0RxqjXk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z7sgHvefYhDZrx/KCk4Y9JL1lyzXHyAncliN6uSGalonHPa8tuCZLgQ86YDlMalfW+ qgOSgWZe8sBklhpoaxtmaUzvYRS3rqCuQZyPqoAdo9oeTZY1j5zdHvmHabMB2bfAyi5W pF1SFArU5VVW7zMdQ6uDKZdlEdQIQbiM7alXM= MIME-Version: 1.0 Received: by 10.204.13.68 with SMTP id b4mr9045276bka.177.1252067901076; Fri, 04 Sep 2009 05:38:21 -0700 (PDT) In-Reply-To: <20090904092812.A4857@lua.tecgraf.puc-rio.br> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904092812.A4857@lua.tecgraf.puc-rio.br> Date: Fri, 4 Sep 2009 14:38:20 +0200 Message-ID: <560972290909040538t23a1203aubd2fd4cb3d9822b6@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 2:28 PM, Luiz Henrique de Figueiredo wrote: > Look at it this way: the Makefile is an executable documentation of how > to build the module, one that works in the author's platform if not in > several others. This is true, except for the word 'documentation' ;) I do wish the alternatives were not so complex and requiring a special install (of several _megabytes_, in the case of CMake) tolua++ is built with Scons, which is tolerable on Debian (just ask the package manager) but would require a Windows user to grab Python. So Windows people tend to build it by hand! (http://lua-users.org/wiki/CompilingToluappWithoutScons) From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:43:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84ChJh8021236; Fri, 4 Sep 2009 09:43:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 802AA1935D; Fri, 4 Sep 2009 09:42:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EE351928C for ; Fri, 4 Sep 2009 09:42:46 -0300 (BRT) Received: by ewy26 with SMTP id 26so827484ewy.5 for ; Fri, 04 Sep 2009 05:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=L6AnHHTNltlZBWb+uu+9WkwVsD1sCdoANKrUHZHLicU=; b=LA4nNNdP/0mlXOiwBVTjZxMSOTNNVkcSZ5eBKKhduwr3eUSOl5vywNAdAi69qONhjd ZfsQ7PkRctf1eUZFCW8lJAzSo7+Fit3nf3k+H+l1P6VSiDObb4n2GqWiMKo1z7cDajGk caTItaTDh9GzhV9D8YjH4TboAHUlTQPklCBz4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=f3PCO8HWACK/xqVf7qbgNbC6jd4oIKmAjw38gzB4wgV4e1oI+yOEcSVv/VfAfTRoe+ yKNkwI0lZko7mN3tLlN+w+wRlJEVfKvqWl3fFgMM7jobYsh520nlizYZ/RsFbRNdDwdx zHoALLsOQ2Q69E7+BmnPnjicCkz2d4bCVmc48= MIME-Version: 1.0 Received: by 10.216.5.2 with SMTP id 2mr786272wek.36.1252068165140; Fri, 04 Sep 2009 05:42:45 -0700 (PDT) In-Reply-To: <-4648601909267222238@unknownmsgid> References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> From: Jerome Vuarand Date: Fri, 4 Sep 2009 14:42:25 +0200 Message-ID: <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84ChJh8021236 2009/9/4 John Hind : > As you say Jerome, it is easy enough to internalise the "C" parts of the library (as long as you have the source and it is well written). But this is not true of the Lua bits. > > This is actually why I tend to swim against the stream on this one and implement as much as possible of the "infrastructure" in C leaving Lua for specific application code. The ability to use the Lua API as a kind of C toolkit means it is quite easy to translate a Lua prototype into C. This all comes down to the fact that C don't allow embedding large text files in programs easily, or that some people write Lua modules. It's very nice that some people (like the Lua authors) take time to write C modules when they could take less time to do the same in pure Lua or a C/Lua hybrid, but as the language becomes popular and the "level" of modules gets higher, doing it all in C is just too much work. Feel free to rewrite socket.http or socket.url in C, and send it to the LuaSocket maintainer, he will probably include it in the next release. But some people don't even know C and can only write Lua modules. Are you going to ignore those people open source work just because your application build system (your C compiler) is too limited ? From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 09:44:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Cib9k021566; Fri, 4 Sep 2009 09:44:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB8CD19338; Fri, 4 Sep 2009 09:44:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B05A18D78 for ; Fri, 4 Sep 2009 09:44:11 -0300 (BRT) Received: (qmail 23478 invoked by uid 399); 4 Sep 2009 06:44:03 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 4 Sep 2009 06:44:03 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AA10B93.2030601@workspacewhiz.com> Date: Fri, 04 Sep 2009 06:44:03 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> <560972290909040427s4e161calf8769340f182b45c@mail.gmail.com> In-Reply-To: <560972290909040427s4e161calf8769340f182b45c@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------070706070701090801090209" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------070706070701090801090209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: steve donovan Date: 9/4/2009 5:27 AM > On Fri, Sep 4, 2009 at 12:40 PM, John Hind wrote: > >> I wonder if it would be possible to make some kind of container file something like a zip where an exe file was executed and presented with a filesystem completely embedded within itself. Then you could put Lua and DLL files into that embedded file system and have them discovered and loaded using the existing Lua mechanisms ... >> > It's probably possible using zlib or something like that, but the > loader would have to be modified. The DLL bit is tricky, since the OS > loader can't be so easily hacked. Would have to extract DLLs > automatically to a temp dir. > It is not an ideal solution, although I have used it for a number of things, but EEE seems to work reasonably well: http://www.erikveen.dds.nl/eee/ Josh --------------070706070701090801090209 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: steve donovan
Date: 9/4/2009 5:27 AM
On Fri, Sep 4, 2009 at 12:40 PM, John Hind<john.hind@zen.co.uk> wrote:
  
I wonder if it would be possible to make some kind of container file something like a zip where an exe file was executed and presented with a filesystem completely embedded within itself. Then you could put Lua and DLL files into that embedded file system and have them discovered and loaded using the existing Lua mechanisms ...
    
It's probably possible using zlib or something like that, but the
loader would have to be modified.  The DLL bit is tricky, since the OS
loader can't be so easily hacked. Would have to extract DLLs
automatically to a temp dir.
  
It is not an ideal solution, although I have used it for a number of things, but EEE seems to work reasonably well:

http://www.erikveen.dds.nl/eee/

Josh
--------------070706070701090801090209-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 10:22:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84DMK1J028904; Fri, 4 Sep 2009 10:22:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 311D2192B5; Fri, 4 Sep 2009 10:21:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B8F918EC5 for ; Fri, 4 Sep 2009 10:21:41 -0300 (BRT) Received: (qmail 13584 invoked by uid 399); 4 Sep 2009 07:21:38 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 4 Sep 2009 07:21:38 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AA11462.90500@workspacewhiz.com> Date: Fri, 04 Sep 2009 07:21:38 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> In-Reply-To: <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Jerome Vuarand Date: 9/4/2009 6:42 AM > This all comes down to the fact that C don't allow embedding large > text files in programs easily, or that some people write Lua modules. > It's very nice that some people (like the Lua authors) take time to > write C modules when they could take less time to do the same in pure > Lua or a C/Lua hybrid, but as the language becomes popular and the > "level" of modules gets higher, doing it all in C is just too much > work. > This reminds me of a gripe that has been brought up before, but it bit me again the other day. Someone, please tell me I am doing it wrong. I have a module that has a mymodule.lua file and a mymodule.dll. I want to require 'mymodule' and have it load both mymodule.lua and mymodule.dll. Instead, I have to have mymodule.lua require 'mymodule.core' (or something similar) and change the exported symbol to luaopen_mymodule_core, so that mymodule.dll can be loaded. This was a pain, because initially, there was only a mymodule.dll with the export luaopen_mymodule, and when I added mymodule.lua, I had to find the code for and recompile mymodule.dll with a changed export. Is there a better way? Josh From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 10:23:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84DN8GM029128; Fri, 4 Sep 2009 10:23:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0334C192E6; Fri, 4 Sep 2009 10:22:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A0B318EC5 for ; Fri, 4 Sep 2009 10:22:12 -0300 (BRT) Received: by bwz10 with SMTP id 10so710945bwz.5 for ; Fri, 04 Sep 2009 06:22:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.143.151 with SMTP id v23mr9109380bku.169.1252070529636; Fri, 04 Sep 2009 06:22:09 -0700 (PDT) In-Reply-To: <20090904092812.A4857@lua.tecgraf.puc-rio.br> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904092812.A4857@lua.tecgraf.puc-rio.br> Date: Fri, 4 Sep 2009 16:22:09 +0300 X-Google-Sender-Auth: e0a70346f795529d Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Look at it this way: the Makefile is an executable documentation of how > to build the module, one that works in the author's platform if not in > several others. Downstream packagers can then copy/adapt/use whatever they > can and need from the Makefile. Ahem.. Is only when a makefile fails to do its job (that is, building the program) that the user gets enlightened by this second, previously unknown meaning of the makefile, that is, as a documentation on how to build the program yourself by hand :) From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 10:25:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84DPB5e029467; Fri, 4 Sep 2009 10:25:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39D91192E6; Fri, 4 Sep 2009 10:24:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9C7618FEB for ; Fri, 4 Sep 2009 10:24:47 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84DOhkr029349 for ; Fri, 4 Sep 2009 10:24:45 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n84DOcE05457; Fri, 4 Sep 2009 10:24:38 -0300 Date: Fri, 4 Sep 2009 10:24:37 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090904102437.B5430@lua.tecgraf.puc-rio.br> References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> <4AA11462.90500@workspacewhiz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AA11462.90500@workspacewhiz.com>; from jjensen@workspacewhiz.com on Fri, Sep 04, 2009 at 07:21:38AM -0600 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I have a module that has a mymodule.lua file and a mymodule.dll. I want > to require 'mymodule' and have it load both mymodule.lua and > mymodule.dll. Instead, I have to have mymodule.lua require > 'mymodule.core' (or something similar) and change the exported symbol to > luaopen_mymodule_core, so that mymodule.dll can be loaded. > > Is there a better way? Write your own loader and add it to package.loaders before everything. In this loader, you call the C loader and then the Lua loader. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 10:36:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84DaVQv032159; Fri, 4 Sep 2009 10:36:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7739619342; Fri, 4 Sep 2009 10:36:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A03DC18E5B for ; Fri, 4 Sep 2009 10:35:59 -0300 (BRT) Received: by ewy26 with SMTP id 26so870692ewy.5 for ; Fri, 04 Sep 2009 06:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=RmSD6pqWX9K9XX/j0UIasAhzjJH+DM2oLh0/Ryp3Do8=; b=uY3iSBDobcICigPmI41cJRHc9w0/xcEZfu7uw82MEgJWCUdtpFB9leB3lncRZnhZfT QNiY5eyXP759HRXx2qJLD+mh0hL524vxuuoviFLhDaZAGLmL3ucnMiKESnVzUqeQ/nfE 15NSgduJuO1A2Sw1BQPlMdy9QAZk+vBCIEScw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=HBgAz9w7frp2VZPphc2YfDm94WQs0czifzZTmZguyp2nznzDyeSJhHUg8/AdduWNtw qoW7j8PyweMGWUv8xmxM23F0GF+czUzRN20LfCrMOu3XutdkXC4WBQwIyW2EV1dHeHru 0JQtFL4bBhsB5ZyeNfLsW81w39J5KUdYj3WkM= MIME-Version: 1.0 Received: by 10.216.39.85 with SMTP id c63mr852512web.103.1252071358135; Fri, 04 Sep 2009 06:35:58 -0700 (PDT) In-Reply-To: <20090904102437.B5430@lua.tecgraf.puc-rio.br> References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> <4AA11462.90500@workspacewhiz.com> <20090904102437.B5430@lua.tecgraf.puc-rio.br> From: Jerome Vuarand Date: Fri, 4 Sep 2009 15:35:38 +0200 Message-ID: <89d273ba0909040635t4bb54159kcfc2c84888e752a0@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/4 Luiz Henrique de Figueiredo : >> I have a module that has a mymodule.lua file and a mymodule.dll. I want >> to require 'mymodule' and have it load both mymodule.lua and >> mymodule.dll. Instead, I have to have mymodule.lua require >> 'mymodule.core' (or something similar) and change the exported symbol to >> luaopen_mymodule_core, so that mymodule.dll can be loaded. >> >> Is there a better way? > > Write your own loader and add it to package.loaders before everything. > In this loader, you call the C loader and then the Lua loader. To do that you can combine [1] and [2]. If you need more help on that matter maybe you should create another topic in the mailing list. [1] http://lua-users.org/wiki/BinaryModulesLoader [2] http://lua-users.org/wiki/LuaModulesLoader From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 10:45:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Dixw7001255; Fri, 4 Sep 2009 10:44:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE09E1936C; Fri, 4 Sep 2009 10:44:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCB0319342 for ; Fri, 4 Sep 2009 10:44:32 -0300 (BRT) Received: by ewy26 with SMTP id 26so878882ewy.5 for ; Fri, 04 Sep 2009 06:44:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.66 with SMTP id x44mr852736wee.96.1252071871035; Fri, 04 Sep 2009 06:44:31 -0700 (PDT) In-Reply-To: <4AA11462.90500@workspacewhiz.com> References: <4AA04FA5.5030304@sct.microlink.com.br> <89d273ba0909040308o569059f9i9d7acb54251485a5@mail.gmail.com> <-4648601909267222238@unknownmsgid> <89d273ba0909040542w310d959dy514ffb0c106b1331@mail.gmail.com> <4AA11462.90500@workspacewhiz.com> Date: Fri, 4 Sep 2009 14:44:30 +0100 X-Google-Sender-Auth: 8f13562f12c4e6e1 Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84Dixw7001255 If the Lua file is mymodule.lua, then it might work if you rename the dll to c-mymodule.dll (or any other prefix followed by a hyphen). require "mymodule" should load the Lua file, and require "c-mymodule" should load the DLL, calling luaopen_mymodule On Fri, Sep 4, 2009 at 2:21 PM, Joshua Jensen wrote: > ----- Original Message ----- > From: Jerome Vuarand > Date: 9/4/2009 6:42 AM >> >> This all comes down to the fact that C don't allow embedding large >> text files in programs easily, or that some people write Lua modules. >> It's very nice that some people (like the Lua authors) take time to >> write C modules when they could take less time to do the same in pure >> Lua or a C/Lua hybrid, but as the language becomes popular and the >> "level" of modules gets higher, doing it all in C is just too much >> work. >> > > This reminds me of a gripe that has been brought up before, but it bit me > again the other day.  Someone, please tell me I am doing it wrong. > > I have a module that has a mymodule.lua file and a mymodule.dll.  I want to > require 'mymodule' and have it load both mymodule.lua and mymodule.dll. >  Instead, I have to have mymodule.lua require 'mymodule.core' (or something > similar) and change the exported symbol to luaopen_mymodule_core, so that > mymodule.dll can be loaded.  This was a pain, because initially, there was > only a mymodule.dll with the export luaopen_mymodule, and when I added > mymodule.lua, I had to find the code for and recompile mymodule.dll with a > changed export. > > Is there a better way? From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 11:01:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84E0kAS004550; Fri, 4 Sep 2009 11:00:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 349AC18FEB; Fri, 4 Sep 2009 11:00:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2400E18E78 for ; Fri, 4 Sep 2009 11:00:12 -0300 (BRT) Received: by fxm25 with SMTP id 25so321135fxm.5 for ; Fri, 04 Sep 2009 07:00:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.26.150 with SMTP id e22mr9186581bkc.68.1252072809213; Fri, 04 Sep 2009 07:00:09 -0700 (PDT) In-Reply-To: <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> Date: Fri, 4 Sep 2009 17:00:08 +0300 X-Google-Sender-Auth: 0082d1f61cb3e192 Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84E0kAS004550 >> I wish module authors would stop using make altogether and >> build/install only through LuaRocks. Let the build toolchain be >> controlled by the package manager, not some makefile that I eternally >> have to tweak between platforms. > > Please, no.  LuaRocks makes me a sad panda.  Not to mention that it > hardly ever works correctly for me, getting it to spit out things > suitable for integration into other products is a pain. On the other hand makefiles, more often than not, contain hardcoded paths to toolchain executables, random unix commands, some of which can wipe out your entire hard drive if some variable is missing, some only available on the authors's machine, and so on. You would call all that upon the author of course, but that's a blind alley -- it doesn't solve anything. The programmer will always take the easiest route available- it's only natural. With a declarative makefile like the rockspec (it goes for any packager tool, not just LuaRocks) all this trouble is bound to go. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 12:07:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84F6vvF020743; Fri, 4 Sep 2009 12:06:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53C01190D1; Fri, 4 Sep 2009 12:06:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 470AA18D31 for ; Fri, 4 Sep 2009 12:06:23 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MjaMf-0002R5-6r for ; Fri, 04 Sep 2009 16:06:13 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MjaMo-0001p9-0E for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 16:06:22 +0100 Date: Fri, 4 Sep 2009 16:06:21 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Wishlists and Modules (was [ANN] libmc) Message-ID: <20090904160621.61bd7141@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84F6vvF020743 On Fri, 4 Sep 2009 17:00:08 +0300 Cosmin Apreutesei wrote: > >> I wish module authors would stop using make altogether and > >> build/install only through LuaRocks. Let the build toolchain be > >> controlled by the package manager, not some makefile that I > >> eternally have to tweak between platforms. > > > > Please, no.  LuaRocks makes me a sad panda.  Not to mention that it > > hardly ever works correctly for me, getting it to spit out things > > suitable for integration into other products is a pain. > > On the other hand makefiles, more often than not, contain hardcoded > paths to toolchain executables, People who do this, of course, should be educated. With socks containing bricks. > random unix commands, some of which can wipe out your entire hard > drive if some variable is missing Yes, but why would you be running this as root? And again, this is the fault of the author, not make. What I don't look forward to is being forced to either use LuaRocks, or write my own Makefile for something. B. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 12:17:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84FH8A1023523; Fri, 4 Sep 2009 12:17:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E12518B6F; Fri, 4 Sep 2009 12:16:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9726918A4B for ; Fri, 4 Sep 2009 12:16:40 -0300 (BRT) Received: by fxm25 with SMTP id 25so379562fxm.5 for ; Fri, 04 Sep 2009 08:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=m15EAe+Vt+vBAVU8Nio/tG+nt9wmV1lcF7p6CAWULDc=; b=WPAEFbK5jxtyAfwPZVNqSbDSVrz4MrCSXfxKzmmtYQZYLHsprCcBjmnS3qn1zm4Aq9 Llq8jFb9h7Xj9DUsp8oN3Mjv1KEgivCqgP5QNq86lJHl6GFZwCIzzWxn2JgaJ0wkVTqm qVS6anaTqCY8HAvgTVtUvFDMQ1NoSZT6n+4tk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=szmGVmRlXUvaOz02tCxxCIngwitlG5gl/Tf2usF/bk8AtLH2FXHpjsj5lgouPbnf/+ bEx+5+O7pyzE2dixjUb/AF8B6RwzFsYVxviaQkLe9kMajt7Ew7KaZaqbDDprRR8viFLp UdF8gx+zfL3E8U1XYVzk4p23pudJeHKZ23e3o= Received: by 10.86.221.25 with SMTP id t25mr5081740fgg.19.1252077397989; Fri, 04 Sep 2009 08:16:37 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.85.242]) by mx.google.com with ESMTPS id l19sm1681763fgb.16.2009.09.04.08.16.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 08:16:36 -0700 (PDT) Message-Id: <6688E7C6-69A2-428F-A01F-28A7E91BCADE@verse.org> From: Jacob Jay To: Lua list In-Reply-To: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Lua FAQ has moved to new location! Date: Fri, 4 Sep 2009 20:46:30 +0530 References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84FH8A1023523 I'm cross-posting this to the Kepler list, in case anyone there wants to add to this all-important question for Steve's Lua FAQ. http://batbytes.com/luafaq On 4 Sep 2009, at 1:24 PM, steve donovan wrote: > 3.9 Can Lua be used as a Web scripting language? > > The Kepler Project is dedicated to making Lua a first-class citizen of > the Web development world. I've tweaked the question, for what I think is a more useful one, as the subject could do with some positive reinforcement! (You could distinguish between web-development and web-scripting, but I think promoting Lua for 'web scripting' will only do it a dis-service…) -- 3.9 Is Lua a good web development environment? Web applications built in Lua customarily perform better than their more common PHP and ROR brethren. Historically Lua has lacked good web development support with only basic CGI execution, however Lua now benefits from the broad functionality developed as the Kepler Project, including a MVC framework, SQL database drivers, templating, XML parsing, etc. Serving Lua web applications can be done through FastCGI or vanilla CGI, with most web servers including Lighttpd, Apache, and Kepler's own Lua server, Xavante. For something simpler to get started with you could instead try Haserl, a standalone CGI- based dynamic Lua page parser that you can just drop into the cgi-bin of any webhost (after you've asked them to install Lua). -- I'll have something further to add to this at some point :) If anyone has some positive web-server stats we could amortise, it would be really good to include them to hit home performance benefits. As this is my first post to the lists, I'll hide an introduction down here. I have a background in web-development and have been dabbling in sw-development for the past few years. But I'm no programmer and ever since the demise of HyperTalk, I've been looking for something powerful, portable and syntactically easy on the eye. Lua is just that -- and I'm now building a large-scale web-app using it, thanks to a jump start from Kepler. Hopefully in future I shall contribute back to Lua, but for now I'm still 'dabbling'! =Jacob From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 13:42:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84GgEfd008456; Fri, 4 Sep 2009 13:42:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A67D018C79; Fri, 4 Sep 2009 13:41:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0846A1896F for ; Fri, 4 Sep 2009 13:41:42 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mjbqw-0005As-OR for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 18:41:34 +0200 Received: from beer.modeemi.cs.tut.fi ([130.230.72.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Sep 2009 18:41:34 +0200 Received: from tuomov by beer.modeemi.cs.tut.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Sep 2009 18:41:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Tuomo Valkonen Subject: LuaFileSystem on Windows and character sets Date: Fri, 4 Sep 2009 16:41:12 +0000 (UTC) Lines: 10 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: beer.modeemi.cs.tut.fi User-Agent: slrn/pre1.0.0-2 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there some way to make LuaFileSystem to use UTF-8 on Windows? Currently it seems to use some character set (winlatin1?) that can not represent all the characters in use: string.len of lfs.dir results equals the length of the string printed on the console, which is full of question marks for characters not covered by a single byte. So the results of lfs.dir seem to be full of non-existent files. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 14:50:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84HotSV023163; Fri, 4 Sep 2009 14:50:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB1BB18D90; Fri, 4 Sep 2009 14:50:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from wolverine01.qualcomm.com (wolverine01.qualcomm.com [199.106.114.254]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 748F618BD4 for ; Fri, 4 Sep 2009 14:50:06 -0300 (BRT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qualcomm.com; i=jackp@qualcomm.com; q=dns/txt; s=qcdkim; t=1252086606; x=1283622606; h=message-id:date:from:user-agent:mime-version:to:subject: content-type:content-transfer-encoding:x-ironport-av; z=Message-ID:=20<4AA15347.5070409@qualcomm.com>|Date:=20Fr i,=2004=20Sep=202009=2010:49:59=20-0700|From:=20Jack=20Ph am=20|User-Agent:=20Thunderbird=202.0 .0.22=20(Windows/20090605)|MIME-Version:=201.0|To:=20Lua =20list=20|Subject:=20bug=20 in=20loadlib.c?|Content-Type:=20text/plain=3B=20charset =3DUTF-8=3B=20format=3Dflowed|Content-Transfer-Encoding: =207bit|X-IronPort-AV:=20E=3DMcAfee=3Bi=3D"5300,2777,5731 "=3B=20a=3D"23104770"; bh=1JTvcRBVzHZvAJdULVbK/VjlE0WzVdt8NF56vY3kV/k=; b=PE2+os6LUJddmGDQ5gZNy/yVURsRSw1LCob+kZ3vDJMfs7izkFv1f/C3 SWY3EtXjQRUSj0NsRS/ezbHGpV0HBl6KSw8AQ9SSYm1FqKgl4WiLdpSK5 1pIlrcgwwF2Y2HN2DWTmrGWGPYFy6P9Q4rgrX1VQAdRQlCaCxLpqNDLWu I=; X-IronPort-AV: E=McAfee;i="5300,2777,5731"; a="23104770" Received: from pdmz-ns-mip.qualcomm.com (HELO ithilien.qualcomm.com) ([199.106.114.10]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Sep 2009 10:50:00 -0700 Received: from msgtransport05.qualcomm.com (msgtransport05.qualcomm.com [129.46.61.150]) by ithilien.qualcomm.com (8.14.2/8.14.2/1.0) with ESMTP id n84HnxSl021507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 4 Sep 2009 10:50:00 -0700 Received: from [10.52.125.99] (jpham.qualcomm.com [10.52.125.99]) by msgtransport05.qualcomm.com (8.14.2/8.14.2/1.0) with ESMTP id n84HnxD0001239 for ; Fri, 4 Sep 2009 10:49:59 -0700 Message-ID: <4AA15347.5070409@qualcomm.com> Date: Fri, 04 Sep 2009 10:49:59 -0700 From: Jack Pham User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Lua list Subject: bug in loadlib.c? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, This doesn't cause any errors but it looks like the creation of the "package.loaders" table in luaopen_package() is calling lua_createtable() incorrectly, with the "narr" and "nrec" parameters swapped, perhaps leading to some unnecessary reallocation at load time? --- loadlib.c 2008-08-06 06:29:28.000000000 -0700 +++ loadlib.c.new 2009-09-04 10:36:47.616920300 -0700 @@ -638,9 +638,9 @@ #endif lua_pushvalue(L, -1); lua_replace(L, LUA_ENVIRONINDEX); /* create `loaders' table */ - lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); + lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0); /* fill it with pre-defined loaders */ for (i=0; loaders[i] != NULL; i++) { lua_pushcfunction(L, loaders[i]); lua_rawseti(L, -2, i+1); In other words the table is initially constructed as a hash of predetermined size but is best suited as an array as evidenced by the calls to lua_rawseti(). Thanks, Jack From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 15:00:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84I07np025326; Fri, 4 Sep 2009 15:00:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69D0F189E1; Fri, 4 Sep 2009 14:59:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 024A91888F for ; Fri, 4 Sep 2009 14:59:39 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjd4T-0004E2-O1 for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 14:59:38 -0300 Message-ID: <4AA155A3.4000303@sct.microlink.com.br> Date: Fri, 04 Sep 2009 15:00:03 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean After reading all the discussion about how to statically compile Lua modules into an executable, I can only think that the amount of work required to build a Lua system (an application with Lua VM and a set of embedded libraries) is becoming too great. In the good-old days all I had to do is read the README file of each library to check its dependencies, statically link everything, open the libraries in the correct order, maybe execute Lua code also embedded in the executable and call my main Lua script. This is not a hard thing for developers to do. Nowadays it looks like I have to fight against the established way of doing things. While there seem to be ways of doing the above, everything sounds like a hack, which makes me feel very uncomfortable with the result. Lua is simple, so its libraries should be. It's much more in line with Lua's philosophy to have simple libraries and make a module system *if* required than the other way around. It also saves memory. In the game industry people count bytes. Why have a module system only to have to hack it to make it behave as if it wasn't there? I don't seem to remember the necessity that brought Lua modules to life. Was it to make life easier for the language users? Who are the language users? For me they are the ones embedding Lua inside routers, game engines or making up great batteries-included applications meant to be used for people not so versed in the world of C and make. Lua has always been simple and easily embeddable. It still is. But its libraries aren't anymore. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 15:18:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84II7X5029592; Fri, 4 Sep 2009 15:18:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D5AB18D75; Fri, 4 Sep 2009 15:17:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BD8918C1B for ; Fri, 4 Sep 2009 15:17:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so1114835ewy.5 for ; Fri, 04 Sep 2009 11:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=fWyZeY4utkr9Q9USDvXxarwSDR5Wi9Df4gXuySROj7E=; b=aAgOhvfeC+ejtq3UNNyS/LgYIpW26LXNMuH/wyC083yB73bkipT6LhVsvmd3ZXWVyI XIqbWTMtCUIkzPwk6gHw57BQpzuvO2ULz+3AFRg8T9lQM7W5CLWEPtrgW5Bbe8Sa53HF H+WIWM9bRy0+K7+amBnMowRDJQ+Koej0NWia0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=DpU15MFWK1KulackaLp703KEgpALIpzn8bGCq2IOt6By1z73w+UsgEXmuO5BlvmxDI Q/R+K66GsTy5BIMdxY8QFuIvX+zoPbWkcNLioLqj2Jc5CgZ6A+MXRxufZj+kvp4QCRlJ z3WasHGD4I4jf78HJgZKyaA9ISaRUiKbxEkD4= Received: by 10.216.88.200 with SMTP id a50mr940117wef.77.1252088259455; Fri, 04 Sep 2009 11:17:39 -0700 (PDT) Received: from ?95.78.85.159? ([95.78.85.159]) by mx.google.com with ESMTPS id i34sm4044185gve.24.2009.09.04.11.17.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Sep 2009 11:17:38 -0700 (PDT) Date: Fri, 4 Sep 2009 22:13:07 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1636730055.20090904221307@gmail.com> To: Andre de Leiradella Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) In-Reply-To: <4AA155A3.4000303@sct.microlink.com.br> References: <4AA155A3.4000303@sct.microlink.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Andre, Friday, September 4, 2009, 10:00:03 PM, you wrote: > In the game industry people count bytes. i heard that they've started counting second billion :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 15:38:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84IboCs001489; Fri, 4 Sep 2009 15:37:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41921192A8; Fri, 4 Sep 2009 15:37:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8109B18BA1 for ; Fri, 4 Sep 2009 15:37:19 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjdex-0005To-3W for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 15:37:19 -0300 Message-ID: <4AA15E78.8030901@sct.microlink.com.br> Date: Fri, 04 Sep 2009 15:37:44 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <1636730055.20090904221307@gmail.com> In-Reply-To: <1636730055.20090904221307@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm not sure what you mean. If you mean they've started counting 2Gb then yeah, PC developers act like system resources are unlimited :-) But I was talking about the console developers. Cheers, Andre Bulat Ziganshin wrote: > Hello Andre, > > Friday, September 4, 2009, 10:00:03 PM, you wrote: > >> In the game industry people count bytes. > > i heard that they've started counting second billion :) > > From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:00:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84J0Jku006664; Fri, 4 Sep 2009 16:00:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E8321936F; Fri, 4 Sep 2009 15:59:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B50AD19342 for ; Fri, 4 Sep 2009 15:59:47 -0300 (BRT) Received: by yxe36 with SMTP id 36so3002991yxe.11 for ; Fri, 04 Sep 2009 11:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=4x8OhL30o+B9Yfhkm1iI4MiNKaWALse9eW6TqDCI9wQ=; b=FNViLGZQ77ikJZTerNcIXHADiajITWE4bJayQW5RLVTvJc9nRQ07s6a3inRcEPejv6 1lsnau2/5rJIG03Z9NVMB4VoLn8lIwIVroO8VB1lI8JthCoXlQLLwoQVr0cEhTh8+luU x0R8peD/CP/uKr1+eM3e+tsGcjAdeqFNyG4l0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oKhhkWtQEapCioWXKXicqTXu9aB7YiYV9dYdpEQHLw3ppuUVqVIcyS0+2JZByIoSLd fT+mT4TA71ZH8+7clKqvt/iAZGmeT89joBNAPFlnoNDFKB9mIh2zIm2NxKxR4dX8O5qQ AbynzEsGzzElTkIdQBq256s8+J5PuAxcqYyw0= MIME-Version: 1.0 Received: by 10.101.145.22 with SMTP id x22mr12827244ann.154.1252090782580; Fri, 04 Sep 2009 11:59:42 -0700 (PDT) Date: Fri, 4 Sep 2009 14:59:42 -0400 Message-ID: Subject: Getting lua to travel on .NET and the like From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016e6d386fe5280c20472c51a1a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d386fe5280c20472c51a1a Content-Type: text/plain; charset=ISO-8859-1 Greetings all, I'm currently developing a write-once-run-anywhere game authoring tool, which uses lua for scripting. Our main 'VM' is in C++/Win32/DirectX, but we have strong aspirations for: Flash10 Silverlight XNA So far, I've found very little in the way of getting Lua to run on these platforms. The closest I have come, is using lua-alchemy for Flash/Flex; but they lack the C-API which we rely on. I've found various C#/.NET lua implementations however, due to the 'lockdown' of silverlight and XNA it doesn't seem they will work. So the questions are; Is there any concern among the Lua group about the difficulties of spreading Lua to these new and popular technologies? Are we simply waiting for a 'native' Lua VM Library to be written by an industrious fellow, in C# or the like? What are some basic difficulties in writing/porting a lua compiler/vm with the C-API present? Am I mistaken in any of my assertions, maybe I'm just missing something? Any feedback i can get on this would be excellent, Thanks, Raymond Jacobs Owner, Ethereal Darkness Interactive www.edigames.com --0016e6d386fe5280c20472c51a1a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Greetings all,

I'm currently developing a write-once-run-anywher= e game authoring tool, which uses lua for scripting.

Our main 'V= M' is in C++/Win32/DirectX, but we have strong aspirations for:

Flash10
Silverlight
XNA

So far, I've found very little in = the way of getting Lua to run on these platforms.

The closest I have= come, is using lua-alchemy for Flash/Flex; but they lack the C-API which w= e rely on.

I've found various C#/.NET lua implementations however, due to the = 'lockdown' of silverlight and XNA it doesn't seem they will wor= k.

So the questions are;

Is there any concern among the Lua g= roup about the difficulties of spreading Lua to these new and popular techn= ologies?

Are we simply waiting for a 'native' Lua VM Library to be writt= en by an industrious fellow, in C# or the like?

What are some basic = difficulties in writing/porting a lua compiler/vm with the C-API present?
Am I mistaken in any of my assertions, maybe I'm just missing somet= hing?


Any feedback i can get on this would be excellent,
Thanks,

Raymond Jacobs
Owner,
Ethereal Darkness Interactive www.edigames.com



--0016e6d386fe5280c20472c51a1a-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:20:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84JJwVc011096; Fri, 4 Sep 2009 16:19:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9BE019357; Fri, 4 Sep 2009 16:19:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7585B18FEB for ; Fri, 4 Sep 2009 16:19:27 -0300 (BRT) Received: by yxe36 with SMTP id 36so3028773yxe.11 for ; Fri, 04 Sep 2009 12:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=yqXquUNqiAsKNeQwwVU2vnoLrg2u1ppsrpksp+pzld0=; b=ax8eYtC5v054dSQBeZA3xVguPFaIlE3/ZPNLJjmep6XF0fBwHjgT/GDfgnQFTnSywh eWbwUdjL0AuIxHHMv4lziWtpKkWCL3FB3plx8FlrYo8eAP87+JttGOcvcnv7VM57vtKX /qAwzoB/DGflqXgUOI8tskvDX8cfZjq1jo/sg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=EJ81IkarFDEK/26XZA2Bo8uoEAIptS+AlnyugwShcdkGy6q/1P+dSZZWmu9YbQ4NPS 6azZLrRtOGkJbkHgWElkbdNPjhHu7XP4qU46yS+KOt6h8iJAjdmWtno2I3PC+v5ig0wk W6nHyMHL/K75lxylBiheuqx2fEW6GQ9+LxG/Q= Received: by 10.90.18.33 with SMTP id 33mr8412766agr.113.1252091965082; Fri, 04 Sep 2009 12:19:25 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.232.190]) by mx.google.com with ESMTPS id 20sm155914agd.23.2009.09.04.12.19.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 12:19:24 -0700 (PDT) Message-ID: <4AA16831.9020204@gmail.com> Date: Sat, 05 Sep 2009 03:19:13 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> In-Reply-To: <4AA155A3.4000303@sct.microlink.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella wrote: > After reading all the discussion about how to statically compile Lua > modules into an executable, I can only think that the amount of work > required to build a Lua system (an application with Lua VM and a set of > embedded libraries) is becoming too great. > [snip] > Lua has always been simple and easily embeddable. It still is. But its > libraries aren't anymore. What! We're starting over again? This is a lot of pointless complaining... I don't see what the problem is. Different users have different needs. Why don't you write your own set of libraries just the way you want it? Settles everything once and for all. If you are so particular about your specific linking needs, why do you keep depending on other peoples' libraries? Besides, people often write libraries for their own needs first, then share it with the rest of the world. You didn't pay for them, so don't use them if you don't like them. If you want libraries to offer multiple linking options, why don't you contribute patches? Reasonable solutions were offered. To say something like "Why have a module system only to have to hack it to make it behave as if it wasn't there?" is just pointless whingening. What do you mean by "count bytes"? Which console, what specific constraints? What kind of application? Executable file size? Memory usage? Expanded file size? Seriously, how much space is Lua+libraries going to take? Specifics or examples, please. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:21:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84JLPRe011459; Fri, 4 Sep 2009 16:21:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3345719384; Fri, 4 Sep 2009 16:21:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19DF5192EE for ; Fri, 4 Sep 2009 16:20:57 -0300 (BRT) Received: from 218.191.187.81.in-addr.arpa ([81.187.191.218] helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MjeL4-0001CL-Jp for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 20:20:50 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 823461B597 for ; Fri, 4 Sep 2009 20:20:49 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:38750 with envelope Message-ID: <4AA176A3.7090901@cowlark.com> Date: Fri, 04 Sep 2009 21:20:51 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> In-Reply-To: <4AA155A3.4000303@sct.microlink.com.br> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84JLPRe011459 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andre de Leiradella wrote: [...] > I don't seem to remember the necessity that brought Lua modules to life. > Was it to make life easier for the language users? Who are the language > users? Yup. Lua means two things, and it's all too easy to confuse them. The first Lua is the *language*. This is the tiny core of the system that's been there for years (long may it not grow). The second Lua is the *platform*. This is the complete programming environment based around the Lua language. This consists of the language, of course, but also the complete set of libraries to actually get work done; and, most crucially, it also consists of the specifications and processes in place to allow Lua to be extended orthogonally. It sounds like what you're after is the Lua *language*, with very little *platform*. The thing is, they're both utterly vital things to have. Back in the Old Days the platform was really just an afterthought to the language, without proper modules, and everything was just hacked into the interpreter on an ad-hoc basis. Writing standalone scripts was a nightmare! If you tended to work solely in the embedded world, you may not have noticed this, but trying to deploy an actual Lua *application* was basically impossible --- there was no workable means of adding all the necessary functionality to the user's Lua interpreter beyond shipping a complete customised interpreter. The New Way really is an improvement. It's made life vastly easier for desktop people. It's also made life easier for embedded people, because the module system is useful for them, too --- and if you don't need it, you can still do things the old way and that still works fine. (I work in both the embedded and desktop worlds, and in fact I would like the distinction between the language and the environment to be widened --- core Lua still has a number of dependency on things like stdio that some embedded devices don't have, and it would be rather nice to have a core CPU-only Lua library that had *no* I/O at all, with even stuff like print, io, and loadfile() abstracted out.) [...] > Lua has always been simple and easily embeddable. It still is. But its > libraries aren't anymore. Weeelll... I think you're having problems because you're wanting to have your cake and eat it, too; you're wanting to use complex modules like luasocket without having the complexity. That's not going to work, more or less by definition. If you want to have mixed Lua/C modules, you need the framework for managing mixed Lua/C modules. (And if you don't, you don't - --- you can still load C-only modules in precisely the same way that we used to.) What you want is a set of custom loaders that provide access to C modules via direct linkage and Lua modules via embedded chunks of Lua code. It's not a lot of code, and would give you the ability to dynamically load modules as needed on your filesystem-less embedded device in precisely the same way that you would on the desktop. This has huge implications for testing and debugging; doesn't the idea of being able to run scripts on the desktop before running 'make' and directly producing a firmware image for your SoC appeal to you? It does to me! That said, I *am* surprised that nobody's come up with a harness to make this stuff easier yet. It should be nearly trivial to write a set of loaders in C that use a big lookup table to find modules, and almost as trivial to write a command-line tool (in Lua, naturally) that would parse a rockspec file and automatically populate said table, complete with turning the Lua scripts into embedded data. Am I wrong? Does someone have such a thing? It would be dead handy --- I could have used it for Wordgrinder. (In fact, it would be very easy to do with Prime Mover, which supports dynamically generated code really well. Hmm...) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKoXaff9E0noFvlzgRApeqAKDK2O9tOI96gewdCrGV0G/pDO5tUACfd/jZ fyoY+ryWBmVJTq9BSLpiHTc= =ssXg -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:26:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84JQlBK012313; Fri, 4 Sep 2009 16:26:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0A921937B; Fri, 4 Sep 2009 16:26:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FF8B1936C for ; Fri, 4 Sep 2009 16:26:23 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 12713 invoked from network); 4 Sep 2009 21:26:19 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 4 Sep 2009 21:26:19 +0200 Message-ID: <4AA169DA.5070800@wp.pl> Date: Fri, 04 Sep 2009 21:26:18 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: Lua FAQ has moved to new location! References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> In-Reply-To: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [8bO0] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > Thanks to Patrick, the FAQ has a new permanent home: > > http://batbytes.com/luafaq I miss some answers about this FAQ ;) Is it "Lua FAQ" or "Lua and (some of) its libraries FAQ"? Some questions assume there are lua libraries (like luafilesystem in #3.4), and some do not (like in #3.6 - no lualanes, luaproc etc mentioned). I think every such answer could start with "In standard lua..." followed by "But with external libraries..." - or something like that. But then: which of those external libraries to include? How is luafilesystem different from lualanes? Seems like a hard question... :( Regards, miko From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:47:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Jl304017007; Fri, 4 Sep 2009 16:47:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F4751938D; Fri, 4 Sep 2009 16:46:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31BFE19355 for ; Fri, 4 Sep 2009 16:46:35 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjejx-00080M-QL for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 16:46:33 -0300 Message-ID: <4AA16EB3.1030208@sct.microlink.com.br> Date: Fri, 04 Sep 2009 16:46:59 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> In-Reply-To: <4AA16831.9020204@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > Andre de Leiradella wrote: >> After reading all the discussion about how to statically compile Lua >> modules into an executable, I can only think that the amount of work >> required to build a Lua system (an application with Lua VM and a set >> of embedded libraries) is becoming too great. >> [snip] >> Lua has always been simple and easily embeddable. It still is. But its >> libraries aren't anymore. > > What! We're starting over again? This is a lot of pointless complaining... Hehehe, I knew the discussion would turn into this... > I don't see what the problem is. Different users have different needs. > Why don't you write your own set of libraries just the way you want it? Because I don't want to waste resources writing things that were already written? > Settles everything once and for all. If you are so particular about your > specific linking needs, why do you keep depending on other peoples' > libraries? There's is nothing particular in my needs. I want to embed the Lua VM plus a set of libraries in a host application, all statically linked. > Besides, people often write libraries for their own needs first, then > share it with the rest of the world. You didn't pay for them, so don't > use them if you don't like them. If you want libraries to offer multiple > linking options, why don't you contribute patches? Yeah, those people are great. Their libraries are a huge time saver. The problem is not with them or their work, just with the way Lua as a platform is turning into Perl. > Reasonable solutions were offered. To say something like "Why have a > module system only to have to hack it to make it behave as if it wasn't > there?" is just pointless whingening. For me whining is demanding automatic download, build and dynamic linking of libraries. For the record, I could just follow the advices and make what I want despite of the existence of modules. But it just don't feel like the right thing to do. To closely follow Lua's philosophy, I think that libraries should stay the way they were before this module thing. Then Lua's module repository maintainers :-O should be able to turn them into "proper" modules and make people that people who don't know how/want to put together a Lua platform by their own can just "require" things. > What do you mean by "count bytes"? Which console, what specific > constraints? What kind of application? Executable file size? Memory > usage? Expanded file size? Seriously, how much space is Lua+libraries > going to take? Specifics or examples, please. Counting bytes like "we have to decrease this heap by 64K." PS3, memory. A game. Cannot say. Cannot say. Cannot say. But again, this is not about specific examples. This is all about the philosophy behind the language. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 16:51:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84JpSPM017991; Fri, 4 Sep 2009 16:51:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2DDE19398; Fri, 4 Sep 2009 16:51:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61F451936C for ; Fri, 4 Sep 2009 16:51:00 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Jow9Q017950 for ; Fri, 4 Sep 2009 16:50:58 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n84Jovf07025; Fri, 4 Sep 2009 16:50:57 -0300 Date: Fri, 4 Sep 2009 16:50:57 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) Message-ID: <20090904165057.A7019@lua.tecgraf.puc-rio.br> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AA16EB3.1030208@sct.microlink.com.br>; from aleirade@sct.microlink.com.br on Fri, Sep 04, 2009 at 04:46:59PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > To closely follow Lua's philosophy, I think that libraries should stay > the way they were before this module thing. How have they become different, except that the protocol for C libraries is now that they are called via lua_call instead of calling luaopen_xxx directly? (However, this is just for some libraries that need environments.) From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:07:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84K7acL021799; Fri, 4 Sep 2009 17:07:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBC59193A5; Fri, 4 Sep 2009 17:07:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE51D1939D for ; Fri, 4 Sep 2009 17:07:07 -0300 (BRT) Received: by yxe36 with SMTP id 36so3089730yxe.11 for ; Fri, 04 Sep 2009 13:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vfG5aLXe7jfr3iWDilNZK+Z8QBIHFffu3YR/LO1hFwk=; b=wuZYzc2s4lQtyoynVrdAwgyEC4D/1ubo9KD41H66OCqylqT5amCBLe6HyWFpWJXyAQ K7+UHUh57NqXutC/QxLtkLdk0khu8iWwizO5f9Qgj+QlxttHUMd1uLCN30CKyhY1+/jM 4iXYHqQK2hcLeEzmL8ZFXcF44r9UP3CM93L3E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=alBGdvs/KRJE87HFXPRz16ptbpTVrIENw1TFsW7W7nOCz3HGEz7yipceQ5YU1amDLd PAunF4OGp5DZcfwCBefr4gOgO413Yo9QY1zo9leYdEpb4vPcQqWV0TFsQO3a4/nH65Mf D4mY3jiq6HwOvRUk+QEEskLjcR4Wyhpi6JLwE= Received: by 10.90.10.1 with SMTP id 1mr8474149agj.62.1252094825873; Fri, 04 Sep 2009 13:07:05 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.232.190]) by mx.google.com with ESMTPS id 39sm492295aga.61.2009.09.04.13.07.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 13:07:05 -0700 (PDT) Message-ID: <4AA1735D.3000909@gmail.com> Date: Sat, 05 Sep 2009 04:06:53 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> In-Reply-To: <4AA16EB3.1030208@sct.microlink.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella wrote: > KHMan wrote: >> Andre de Leiradella wrote: >>> [snip] >> [snip] > [snip] >> What do you mean by "count bytes"? Which console, what specific >> constraints? What kind of application? Executable file size? Memory >> usage? Expanded file size? Seriously, how much space is Lua+libraries >> going to take? Specifics or examples, please. > > Counting bytes like "we have to decrease this heap by 64K." PS3, memory. > A game. Cannot say. Cannot say. Cannot say. Not even an example? I don't think in this instance that there are development practices or methods that is so secret that it entails an NDA. Smells like hand-waving. > But again, this is not about specific examples. This is all about the > philosophy behind the language. Like David said in the other post, there is nothing wrong with the language. Those who use old style modules can continue to do so. So you disagree with the platform and the package management scheme. Well, I'll let market forces decide. Those who write the code makes the rules. Good luck to your lobbying. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:09:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84K9Bag022128; Fri, 4 Sep 2009 17:09:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09916193B0; Fri, 4 Sep 2009 17:08:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FDFC193A0 for ; Fri, 4 Sep 2009 17:08:43 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjf5O-0000IL-Si for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 17:08:43 -0300 Message-ID: <4AA173E4.5050404@sct.microlink.com.br> Date: Fri, 04 Sep 2009 17:09:08 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA176A3.7090901@cowlark.com> In-Reply-To: <4AA176A3.7090901@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Andre de Leiradella wrote: > [...] >> I don't seem to remember the necessity that brought Lua modules to life. >> Was it to make life easier for the language users? Who are the language >> users? > > Yup. > > Lua means two things, and it's all too easy to confuse them. > > The first Lua is the *language*. This is the tiny core of the system > that's been there for years (long may it not grow). > > The second Lua is the *platform*. This is the complete programming > environment based around the Lua language. This consists of the > language, of course, but also the complete set of libraries to actually > get work done; and, most crucially, it also consists of the > specifications and processes in place to allow Lua to be extended > orthogonally. > > It sounds like what you're after is the Lua *language*, with very little > *platform*. What I'm after is a Lua based platform I can shape and build. If there is the need of making a platform for people with little knowledge of C and make to use, I don't think this should make it harder to me or prevent me from building my own. > The thing is, they're both utterly vital things to have. Back in the Old > Days the platform was really just an afterthought to the language, > without proper modules, and everything was just hacked into the > interpreter on an ad-hoc basis. Writing standalone scripts was a > nightmare! If you tended to work solely in the embedded world, you may > not have noticed this, but trying to deploy an actual Lua *application* > was basically impossible --- there was no workable means of adding all > the necessary functionality to the user's Lua interpreter beyond > shipping a complete customised interpreter. Which is how it's supposed to be. The Lua interpreter shipped with Lua sources is just, IMHO, an example application of how to write a host application which embeds Lua. > The New Way really is an improvement. It's made life vastly easier for > desktop people. It's also made life easier for embedded people, because > the module system is useful for them, too --- and if you don't need it, > you can still do things the old way and that still works fine. > > (I work in both the embedded and desktop worlds, and in fact I would > like the distinction between the language and the environment to be > widened --- core Lua still has a number of dependency on things like > stdio that some embedded devices don't have, and it would be rather nice > to have a core CPU-only Lua library that had *no* I/O at all, with even > stuff like print, io, and loadfile() abstracted out.) > > [...] >> Lua has always been simple and easily embeddable. It still is. But its >> libraries aren't anymore. > > Weeelll... > > I think you're having problems because you're wanting to have your cake > and eat it, too; you're wanting to use complex modules like luasocket > without having the complexity. That's not going to work, more or less by > definition. If you want to have mixed Lua/C modules, you need the > framework for managing mixed Lua/C modules. (And if you don't, you don't > - --- you can still load C-only modules in precisely the same way that we > used to.) I have developed mixed libraries, and it was just a matter of registering the C functions and executing Lua code to setup the environment so that scripts could be run. I used them together with other libraries and it was just a matter of initializing things in the right order. > What you want is a set of custom loaders that provide access to C > modules via direct linkage and Lua modules via embedded chunks of Lua > code. It's not a lot of code, and would give you the ability to > dynamically load modules as needed on your filesystem-less embedded > device in precisely the same way that you would on the desktop. This has > huge implications for testing and debugging; doesn't the idea of being > able to run scripts on the desktop before running 'make' and directly > producing a firmware image for your SoC appeal to you? It does to me! It does, but things should be made the other way around. Take the libraries and build upon them to make modules. Start simple and make more complex things. Do not start complex and try to remove that complexity, it's sometimes very hard to do it. Cheers, Andre > That said, I *am* surprised that nobody's come up with a harness to make > this stuff easier yet. It should be nearly trivial to write a set of > loaders in C that use a big lookup table to find modules, and almost as > trivial to write a command-line tool (in Lua, naturally) that would > parse a rockspec file and automatically populate said table, complete > with turning the Lua scripts into embedded data. Am I wrong? Does > someone have such a thing? It would be dead handy --- I could have used > it for Wordgrinder. > > (In fact, it would be very easy to do with Prime Mover, which supports > dynamically generated code really well. Hmm...) > > - -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "People who think they know everything really annoy those of us who > │ know we don't." --- Bjarne Stroustrup > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFKoXaff9E0noFvlzgRApeqAKDK2O9tOI96gewdCrGV0G/pDO5tUACfd/jZ > fyoY+ryWBmVJTq9BSLpiHTc= > =ssXg > -----END PGP SIGNATURE----- > > From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:16:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84KGWU6023956; Fri, 4 Sep 2009 17:16:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE40C193BA; Fri, 4 Sep 2009 17:16:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 621331938E for ; Fri, 4 Sep 2009 17:16:08 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MjfCZ-0000So-U5 for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 17:16:07 -0300 Message-ID: <4AA175A2.9050505@sct.microlink.com.br> Date: Fri, 04 Sep 2009 17:16:34 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> In-Reply-To: <20090904165057.A7019@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> To closely follow Lua's philosophy, I think that libraries should stay >> the way they were before this module thing. > > How have they become different, except that the protocol for C libraries is > now that they are called via lua_call instead of calling luaopen_xxx directly? > (However, this is just for some libraries that need environments.) Based on what people said about how to statically link modules, I have to say things do have changed. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:20:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84KKe2o024877; Fri, 4 Sep 2009 17:20:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB54B193C1; Fri, 4 Sep 2009 17:20:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92171193B8 for ; Fri, 4 Sep 2009 17:20:17 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MjfGa-0000Ye-L1 for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 17:20:16 -0300 Message-ID: <4AA1769B.2070209@sct.microlink.com.br> Date: Fri, 04 Sep 2009 17:20:43 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <4AA1735D.3000909@gmail.com> In-Reply-To: <4AA1735D.3000909@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > Andre de Leiradella wrote: >> KHMan wrote: >>> Andre de Leiradella wrote: >>>> [snip] >>> [snip] >> [snip] >>> What do you mean by "count bytes"? Which console, what specific >>> constraints? What kind of application? Executable file size? Memory >>> usage? Expanded file size? Seriously, how much space is Lua+libraries >>> going to take? Specifics or examples, please. >> >> Counting bytes like "we have to decrease this heap by 64K." PS3, >> memory. A game. Cannot say. Cannot say. Cannot say. > > Not even an example? I don't think in this instance that there are > development practices or methods that is so secret that it entails an > NDA. Smells like hand-waving. You're free to believe in what you want. >> But again, this is not about specific examples. This is all about the >> philosophy behind the language. > > Like David said in the other post, there is nothing wrong with the > language. Those who use old style modules can continue to do so. So you > disagree with the platform and the package management scheme. Well, I'll > let market forces decide. Those who write the code makes the rules. Good > luck to your lobbying. Market forces never played a role in the design of the language. But unfortunately Lua authors are not in charge of the development of Lua as a platform. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:26:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84KQqZr026213; Fri, 4 Sep 2009 17:26:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09414193C6; Fri, 4 Sep 2009 17:26:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90FFB193B8 for ; Fri, 4 Sep 2009 17:26:25 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84KQNJV026143 for ; Fri, 4 Sep 2009 17:26:23 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n84KQMm07167; Fri, 4 Sep 2009 17:26:22 -0300 Date: Fri, 4 Sep 2009 17:26:22 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) Message-ID: <20090904172622.A7140@lua.tecgraf.puc-rio.br> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AA175A2.9050505@sct.microlink.com.br>; from aleirade@sct.microlink.com.br on Fri, Sep 04, 2009 at 05:16:34PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Based on what people said about how to statically link modules, I have > to say things do have changed. Perhaps I'm missing something but for instance my libraries work both as statically linked modules and as dynamically linked modules. In the static case, they work even if you don't require them (but they also work if you do require them). The magic is in luaL_register. From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:39:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84KdkQN029701; Fri, 4 Sep 2009 17:39:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75373193D0; Fri, 4 Sep 2009 17:39:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.223.182]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F13ED193AD for ; Fri, 4 Sep 2009 17:39:22 -0300 (BRT) Received: by iwn12 with SMTP id 12so367484iwn.11 for ; Fri, 04 Sep 2009 13:39:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.5.79 with SMTP id 15mr10158821ibu.7.1252096760125; Fri, 04 Sep 2009 13:39:20 -0700 (PDT) In-Reply-To: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> Date: Fri, 4 Sep 2009 16:39:20 -0400 Message-ID: <790db3550909041339r5d2bbe2fia025ade008c1357c@mail.gmail.com> Subject: Re: Lua FAQ has moved to new location! From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 3:54 AM, steve donovan wrote: > Thanks to Patrick, the FAQ has a new permanent home: > > http://batbytes.com/luafaq There is also anonymous checkout available via subversion (if you want to help improve it): svn://batbytes.com/luafaq -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 17:58:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84Kw1X0032742; Fri, 4 Sep 2009 17:58:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A90CB193D4; Fri, 4 Sep 2009 17:57:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C46C193C5 for ; Fri, 4 Sep 2009 17:57:32 -0300 (BRT) Received: by vws33 with SMTP id 33so921317vws.33 for ; Fri, 04 Sep 2009 13:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7Sv1eqznWa1lShJkRih9uFPOf3zv3ectNP8B6l1jrrk=; b=eNMtsmgyDD7IITWwBu0afjHrbKM5W6ZkbZF7tjMCIvx0in1HV9XnpYeFyw6YzX9650 fcast9+0BGh9WcxRotdf/7NYHWCeX+2otSFV3vxWFfb7qW4R+bTPWCFO/qp13Mn4zCNS zmln/d2RZvoaWf2HpsQAxZehODrS31LHwyXtw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OqhytfgEHEReqkBJ8ILFZKuWNBoo0TVqbELfFir6Zd+z5UgyOjuo0LXEmwJ0hy8Bf1 O+6V9ld/KjxKOHsGZJC/8ViE7PEBRGo5VrqAdYZMsOSyPd3ChRrCAtYBbzG40CknMU1D npOUONNxedGEDUTrN8EDcxx0RxXMitM+06I8g= MIME-Version: 1.0 Received: by 10.220.108.39 with SMTP id d39mr15895794vcp.12.1252097848738; Fri, 04 Sep 2009 13:57:28 -0700 (PDT) In-Reply-To: References: Date: Fri, 4 Sep 2009 15:57:28 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Timothy Baldridge To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84Kw1X0032742 Well, there is this: http://www.xnua.com/xna_lua_xnua XNua takes C# code and translates it to .Net bytecode. This is fine, but I would like to see a bit higher level abstract of this. I've been digging into this lately, and it doesn't seem all that hard to do a port of Lua to C#, where the lua execution loop is a C# loop. This is a project I may start on soon, but haven't yet. So I'm interested in hearing other people's thoughts about the whole issue. Timothy Baldridge On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs wrote: > Greetings all, > > I'm currently developing a write-once-run-anywhere game authoring tool, > which uses lua for scripting. > > Our main 'VM' is in C++/Win32/DirectX, but we have strong aspirations for: > > Flash10 > Silverlight > XNA > > So far, I've found very little in the way of getting Lua to run on these > platforms. > > The closest I have come, is using lua-alchemy for Flash/Flex; but they lack > the C-API which we rely on. > > I've found various C#/.NET lua implementations however, due to the > 'lockdown' of silverlight and XNA it doesn't seem they will work. > > So the questions are; > > Is there any concern among the Lua group about the difficulties of spreading > Lua to these new and popular technologies? > > Are we simply waiting for a 'native' Lua VM Library to be written by an > industrious fellow, in C# or the like? > > What are some basic difficulties in writing/porting a lua compiler/vm with > the C-API present? > > Am I mistaken in any of my assertions, maybe I'm just missing something? > > > Any feedback i can get on this would be excellent, > > Thanks, > > Raymond Jacobs > Owner, > Ethereal Darkness Interactive > www.edigames.com > > > > > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 18:20:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84LK9Ig004278; Fri, 4 Sep 2009 18:20:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 154C61839D; Fri, 4 Sep 2009 18:19:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42398193C7 for ; Fri, 4 Sep 2009 18:19:29 -0300 (BRT) Received: from papaya.tek (dslb-088-075-201-249.pools.arcor-ip.net [88.75.201.249]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id 02DC750533 for ; Fri, 4 Sep 2009 23:19:27 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id DF3D626B9C for ; Fri, 4 Sep 2009 23:19:25 +0200 (CEST) Date: Fri, 4 Sep 2009 23:19:25 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) Message-Id: <20090904231925.a04d5df4.tmueller@schulze-mueller.de> In-Reply-To: <4AA175A2.9050505@sct.microlink.com.br> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 04 Sep 2009 17:16:34 -0300 Andre de Leiradella wrote: > Luiz Henrique de Figueiredo wrote: > >> To closely follow Lua's philosophy, I think that libraries should stay > >> the way they were before this module thing. > > > > How have they become different, except that the protocol for C libraries is > > now that they are called via lua_call instead of calling luaopen_xxx directly? > > (However, this is just for some libraries that need environments.) > > Based on what people said about how to statically link modules, I have > to say things do have changed. Static vs. dynamic linking is just a platform-specific peculiarity. I know next to nothing about the PS3, but based on what people say, it's a whimsical, half-assed, overpriced, environmentally hazardous thing that few people are using. Judging from the various idiosyncrasies and turnarounds of its manufacturer, it is probably a revenant of Perl in Hardware. I have to say things do have changed. I have written a small RTOS for games and demos on the PS2 (which was a beautiful piece of hardware), including a Lua interpreter, Lua 5.0 first, 5.1 later. 5.1 performed a lot better. Back in the days (when there were no operating systems, just real programmers and only the strongest prevailed), you had to write everything yourself, memory and threads management as well as dynamic linking. And so I replaced loadlib.c with something so crude... well, can't say, can't say. But if I can do, you can too. Lua shines in that environment, because the interpreter is free of global variables and platform-specific assumptions, and concentrates on the things I am not good in: language and virtual machine design, garbage collection, reference counting, etc. Now thanks to the package system Lua just scales in more ways than before. Of course it still shines on ... exotic systems, better in fact than before it had a package management. - Timm -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 18:24:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84LOcax004978; Fri, 4 Sep 2009 18:24:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25C5A193D5; Fri, 4 Sep 2009 18:24:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49E821936E for ; Fri, 4 Sep 2009 18:24:15 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MjgGQ-0002GQ-2b for lua@bazar2.conectiva.com.br; Fri, 04 Sep 2009 18:24:12 -0300 Message-ID: <4AA18594.3090704@sct.microlink.com.br> Date: Fri, 04 Sep 2009 18:24:36 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <20090904231925.a04d5df4.tmueller@schulze-mueller.de> In-Reply-To: <20090904231925.a04d5df4.tmueller@schulze-mueller.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Timm S. Mueller wrote: > Static vs. dynamic linking is just a platform-specific peculiarity. I > know next to nothing about the PS3, but based on what people say, it's > a whimsical, half-assed, overpriced, environmentally hazardous thing > that few people are using. Judging from the various idiosyncrasies and > turnarounds of its manufacturer, it is probably a revenant of Perl in > Hardware. Hahaha, that's what Microsoft wants you to think! :-D Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 19:28:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n84MRxMG014197; Fri, 4 Sep 2009 19:27:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63A53193D3; Fri, 4 Sep 2009 19:27:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2BE5193BF for ; Fri, 4 Sep 2009 19:27:18 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so652647eye.39 for ; Fri, 04 Sep 2009 15:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5k4IuiEsqG0zU8aqFrnjKFXQxIWI/I62D9Axt45l9i0=; b=tep4aZlTyJO5VzxroBkaVWTTo7neoAlXQQxVOXqb513F94l9DgPC0O58KQfOAGsVep SOZ5/d5krnUCSPrufZJZLMTICm5VwE+EQQrtvQtN46tLc8m8pNytBnBfbiLNtajj8PVS NQBFU7jPp5HROK6fLzh+Q+CUKxCsva1o8FeVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=TgsAY8dU4BSLKK3uqLoGETAodP0G+LCxneu1QYnDF0G0wv1TyZKsaHeHzxlNs259gq vpuEFua8OIhDrmpk6kEIkz+cKpx5BnoHmHFTri69YjO246FW5KJVfxamjckdpj9QSjq1 l3gAigNIc425wooqwJvN8yux2MZwfMzizhl2Y= MIME-Version: 1.0 Received: by 10.216.87.79 with SMTP id x57mr2358830wee.83.1252103235839; Fri, 04 Sep 2009 15:27:15 -0700 (PDT) In-Reply-To: <4AA15347.5070409@qualcomm.com> References: <4AA15347.5070409@qualcomm.com> Date: Fri, 4 Sep 2009 18:27:15 -0400 Message-ID: Subject: Re: bug in loadlib.c? From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n84MRxMG014197 On Fri, Sep 4, 2009 at 1:49 PM, Jack Pham wrote: > Hi, > > This doesn't cause any errors but it looks like the creation of the > "package.loaders" table in luaopen_package() is calling lua_createtable() > incorrectly, with the "narr" and "nrec" parameters swapped, perhaps leading > to some unnecessary reallocation at load time? > > --- loadlib.c   2008-08-06 06:29:28.000000000 -0700 > +++ loadlib.c.new       2009-09-04 10:36:47.616920300 -0700 > @@ -638,9 +638,9 @@ > #endif >  lua_pushvalue(L, -1); >  lua_replace(L, LUA_ENVIRONINDEX); >  /* create `loaders' table */ > -  lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); > +  lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0); >  /* fill it with pre-defined loaders */ >  for (i=0; loaders[i] != NULL; i++) { >    lua_pushcfunction(L, loaders[i]); >    lua_rawseti(L, -2, i+1); > > In other words the table is initially constructed as a hash of predetermined > size but is best suited as an array as evidenced by the calls to > lua_rawseti(). > > Thanks, > Jack > I think you are right. --Leo-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 4 23:53:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n852r08l009135; Fri, 4 Sep 2009 23:53:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E140C192A7; Fri, 4 Sep 2009 23:52:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f193.google.com (mail-yw0-f193.google.com [209.85.211.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E42D519289 for ; Fri, 4 Sep 2009 23:52:08 -0300 (BRT) Received: by ywh32 with SMTP id 32so2311343ywh.11 for ; Fri, 04 Sep 2009 19:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gu/Gh2UZIM65ZrTWUBGmm/C4YVIs0LCSbbH3/nwVWRM=; b=Pwxc85ctodmWV7zRuPCr4aEp3Ra6DtjX2etEb0xKR3YHuH/nwKXCRrCb8ueT2499CP HNJxAkSzMlNWgvsfmTEz8TZ6trpFKML/4z1szmr+rpgP38qdZtTJCzPrbVtBMVpuYFCd N/mfNdxjeskaQT6yLziz0Cdu34jCXySEU+14U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TM/XneXzbNnUH87H4kkGxIvoABUOxwxkHRUaG4T+kF6sh3j2u3gCTvgxOF34Q2jDHG /27LNhf26HU6e9NygsEWb+tNjHtEnPmjx5IKlwWC8DjJTHriWsoNIU+kRkL7dL8zFSFs gLTT6+6vcqwoSU/XdgSm69n5FoIpOfdRXXGfI= MIME-Version: 1.0 Received: by 10.101.53.9 with SMTP id f9mr13331853ank.46.1252119125577; Fri, 04 Sep 2009 19:52:05 -0700 (PDT) In-Reply-To: References: Date: Fri, 4 Sep 2009 21:52:05 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=001636ed73ddb24f720472cbb3d2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed73ddb24f720472cbb3d2 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable We looked briefly at XNua; notably it said coroutine support was untested and potentially broken; http://www.xnua.com/xna_lua_docs_limitiations coroutines are a major feature for us, so this was a bit disturbing, but we haven't confirmed it yet. it also *seems* XNua hasn't been updated since 2007, which bodes well for any further work being done on it (should there be major features missing). As for using .NET bytecode at runtime, I dunno if Silverlight or XNA allow that, might seem like a security risk *shrug* -Raymond On Fri, Sep 4, 2009 at 3:57 PM, Timothy Baldridge wro= te: > Well, there is this: http://www.xnua.com/xna_lua_xnua > > XNua takes C# code and translates it to .Net bytecode. This is fine, > but I would like to see a bit higher level abstract of this. > > I've been digging into this lately, and it doesn't seem all that hard > to do a port of Lua to C#, where the lua execution loop is a C# loop. > This is a project I may start on soon, but haven't yet. So I'm > interested in hearing other people's thoughts about the whole issue. > > Timothy Baldridge > > On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs wrote: > > Greetings all, > > > > I'm currently developing a write-once-run-anywhere game authoring tool, > > which uses lua for scripting. > > > > Our main 'VM' is in C++/Win32/DirectX, but we have strong aspirations > for: > > > > Flash10 > > Silverlight > > XNA > > > > So far, I've found very little in the way of getting Lua to run on thes= e > > platforms. > > > > The closest I have come, is using lua-alchemy for Flash/Flex; but they > lack > > the C-API which we rely on. > > > > I've found various C#/.NET lua implementations however, due to the > > 'lockdown' of silverlight and XNA it doesn't seem they will work. > > > > So the questions are; > > > > Is there any concern among the Lua group about the difficulties of > spreading > > Lua to these new and popular technologies? > > > > Are we simply waiting for a 'native' Lua VM Library to be written by an > > industrious fellow, in C# or the like? > > > > What are some basic difficulties in writing/porting a lua compiler/vm > with > > the C-API present? > > > > Am I mistaken in any of my assertions, maybe I'm just missing something= ? > > > > > > Any feedback i can get on this would be excellent, > > > > Thanks, > > > > Raymond Jacobs > > Owner, > > Ethereal Darkness Interactive > > www.edigames.com > > > > > > > > > > > > > > -- > =93One of the main causes of the fall of the Roman Empire was > that=96lacking zero=96they had no way to indicate successful termination > of their C programs.=94 > (Robert Firth) > --001636ed73ddb24f720472cbb3d2 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable We looked briefly at XNua; notably it said coroutine support was untested a= nd potentially broken;

http://www.xnua.com/xna_lua_docs_limitiations

corou= tines are a major feature for us, so this was a bit disturbing, but we have= n't confirmed it yet.

it also *seems* XNua hasn't been updated since 2007, which bodes we= ll for any further work being done on it (should there be major features mi= ssing).

As for using .NET bytecode at runtime, I dunno if Silverligh= t or XNA allow that, might seem like a security risk *shrug*

-Raymond

On Fri, Sep 4, 2009 at 3:57 = PM, Timothy Baldridge <tbaldridge@gmail.com> wrote:
Well, there is this: http://www.xnua.com/xna_lua_xnua

XNua takes C# code and translates it to .Net bytecode. This is fine,
but I would like to see a bit higher level abstract of this.

I've been digging into this lately, and it doesn't seem all that ha= rd
to do a port of Lua to C#, where the lua execution loop is a C# loop.
This is a project I may start on soon, but haven't yet. So I'm
interested in hearing other people's thoughts about the whole issue.
Timothy Baldridge

On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs<raymondj@gmail.com> wrote:
> Greetings all,
>
> I'm currently developing a write-once-run-anywhere game authoring = tool,
> which uses lua for scripting.
>
> Our main 'VM' is in C++/Win32/DirectX, but we have strong aspi= rations for:
>
> Flash10
> Silverlight
> XNA
>
> So far, I've found very little in the way of getting Lua to run on= these
> platforms.
>
> The closest I have come, is using lua-alchemy for Flash/Flex; but they= lack
> the C-API which we rely on.
>
> I've found various C#/.NET lua implementations however, due to the=
> 'lockdown' of silverlight and XNA it doesn't seem they wil= l work.
>
> So the questions are;
>
> Is there any concern among the Lua group about the difficulties of spr= eading
> Lua to these new and popular technologies?
>
> Are we simply waiting for a 'native' Lua VM Library to be writ= ten by an
> industrious fellow, in C# or the like?
>
> What are some basic difficulties in writing/porting a lua compiler/vm = with
> the C-API present?
>
> Am I mistaken in any of my assertions, maybe I'm just missing some= thing?
>
>
> Any feedback i can get on this would be excellent,
>
> Thanks,
>
> Raymond Jacobs
> Owner,
> Ethereal Darkness Interactive
> www.edigames.com=
>
>
>
>
>



--
=93One of the main causes of the fall of the Roman Empire was
that=96lacking zero=96they had no way to indicate successful termination of their C programs.=94
(Robert Firth)

--001636ed73ddb24f720472cbb3d2-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 00:11:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n853BIT9011268; Sat, 5 Sep 2009 00:11:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1438E19297; Sat, 5 Sep 2009 00:10:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78CD919107 for ; Sat, 5 Sep 2009 00:10:36 -0300 (BRT) Received: by vws33 with SMTP id 33so1034519vws.33 for ; Fri, 04 Sep 2009 20:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=QwJy2PZpIBl0z+ZORfYPhL5/IENLkH/nlxnpx6HDevI=; b=uyWvMdLlTDCInE1ZNFN0MUvONtXhaU47x29DHzJ6HaLUTmT157YI2BbMA7ZquIF9vu q81X9SHubRZut2dnZCsa3gGej2Qs94SBS4ZQybivHUrpjsEppmgTEWyN3hUcjSjuscfg J8CzXX+atiWQEIxfda7npKIIN/Osznhb5QR9A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TJLWY4OSnMeYolJ6sd7OFL9dto6SftFST4gYjmSw664RBSy1ci6HU2UitILFcrwbBy MTdMKZe1gL9NR2/5/d3GR3A2BQb/gROI/Sq1Q2+J1ImnmHudvE2VON6XsZOsaMKwbpPQ wezICKXZ1roYnxjQJOdk5b7lGtZrK8YQdLdKQ= MIME-Version: 1.0 Received: by 10.220.88.209 with SMTP id b17mr5360353vcm.98.1252120234248; Fri, 04 Sep 2009 20:10:34 -0700 (PDT) In-Reply-To: References: Date: Fri, 4 Sep 2009 22:10:34 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Timothy Baldridge To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n853BIT9011268 No you can't use Reflection.Emit in XNA (and I assume Silverlight as well). That's why I think we need a 1:1 conversion of the existing C routines to C#. That way we use C# to interpret the Lua code. It shouldn't be all that slow. Timothy On Fri, Sep 4, 2009 at 9:52 PM, Raymond Jacobs wrote: > We looked briefly at XNua; notably it said coroutine support was untested > and potentially broken; > > http://www.xnua.com/xna_lua_docs_limitiations > > coroutines are a major feature for us, so this was a bit disturbing, but we > haven't confirmed it yet. > > it also *seems* XNua hasn't been updated since 2007, which bodes well for > any further work being done on it (should there be major features missing). > > As for using .NET bytecode at runtime, I dunno if Silverlight or XNA allow > that, might seem like a security risk *shrug* > > -Raymond > > On Fri, Sep 4, 2009 at 3:57 PM, Timothy Baldridge > wrote: >> >> Well, there is this: http://www.xnua.com/xna_lua_xnua >> >> XNua takes C# code and translates it to .Net bytecode. This is fine, >> but I would like to see a bit higher level abstract of this. >> >> I've been digging into this lately, and it doesn't seem all that hard >> to do a port of Lua to C#, where the lua execution loop is a C# loop. >> This is a project I may start on soon, but haven't yet. So I'm >> interested in hearing other people's thoughts about the whole issue. >> >> Timothy Baldridge >> >> On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs wrote: >> > Greetings all, >> > >> > I'm currently developing a write-once-run-anywhere game authoring tool, >> > which uses lua for scripting. >> > >> > Our main 'VM' is in C++/Win32/DirectX, but we have strong aspirations >> > for: >> > >> > Flash10 >> > Silverlight >> > XNA >> > >> > So far, I've found very little in the way of getting Lua to run on these >> > platforms. >> > >> > The closest I have come, is using lua-alchemy for Flash/Flex; but they >> > lack >> > the C-API which we rely on. >> > >> > I've found various C#/.NET lua implementations however, due to the >> > 'lockdown' of silverlight and XNA it doesn't seem they will work. >> > >> > So the questions are; >> > >> > Is there any concern among the Lua group about the difficulties of >> > spreading >> > Lua to these new and popular technologies? >> > >> > Are we simply waiting for a 'native' Lua VM Library to be written by an >> > industrious fellow, in C# or the like? >> > >> > What are some basic difficulties in writing/porting a lua compiler/vm >> > with >> > the C-API present? >> > >> > Am I mistaken in any of my assertions, maybe I'm just missing something? >> > >> > >> > Any feedback i can get on this would be excellent, >> > >> > Thanks, >> > >> > Raymond Jacobs >> > Owner, >> > Ethereal Darkness Interactive >> > www.edigames.com >> > >> > >> > >> > >> > >> >> >> >> -- >> “One of the main causes of the fall of the Roman Empire was >> that–lacking zero–they had no way to indicate successful termination >> of their C programs.” >> (Robert Firth) > > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 03:15:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n856FdeF027835; Sat, 5 Sep 2009 03:15:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E3D4192B4; Sat, 5 Sep 2009 03:15:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0B7918890 for ; Sat, 5 Sep 2009 03:14:59 -0300 (BRT) Received: by ewy26 with SMTP id 26so1411550ewy.5 for ; Fri, 04 Sep 2009 23:14:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.15.14 with SMTP id 14mr1406720ebo.49.1252131298246; Fri, 04 Sep 2009 23:14:58 -0700 (PDT) In-Reply-To: <20090904160621.61bd7141@trite.i.flarn.net.i.flarn.net> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> <20090904160621.61bd7141@trite.i.flarn.net.i.flarn.net> Date: Sat, 5 Sep 2009 02:14:58 -0400 X-Google-Sender-Auth: 1dd0ad477e2ad426 Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 11:06 AM, Rob Kendrick wrote: > What I don't look forward to is being forced to either use LuaRocks, or > write my own Makefile for something. Here's a prototype of a rockspec-to-Makefile converter: http://lists.luaforge.net/pipermail/luarocks-developers/2009-September/001181.html From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 03:45:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n856jVXu030221; Sat, 5 Sep 2009 03:45:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6022C192D0; Sat, 5 Sep 2009 03:45:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8FEA19169 for ; Sat, 5 Sep 2009 03:44:54 -0300 (BRT) Received: by yxe36 with SMTP id 36so3560316yxe.11 for ; Fri, 04 Sep 2009 23:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=enKJn8caN5jbO5zMms2A9PjxIai1pTF+9Kwb3Jnqfo8=; b=wEDcLl7/5k81W01v9R5rqxKC0T0b+vd4DNLu14ELH8wEovU57WIfnuNBMc4/gmMUKO 8j2XA5VwbKnclweU75gGY1vun02DHT1AfzphEH1o9rgH+X+FR0PIhazQ+zk1OanLdBM4 05VoqEPDyaa9SFPlGyRiz21CdaUU2WEQUYGqE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=n6jaRJLg/MEFhyuxb1UvvPCtT+rfSZq2PrjptDCG/LUplC8UgmC7JHLIWqhc52E3vw z1FB6H1OGpaZRsDNAG0Un4BLLIe6OC7ziMIgZ8O6I3itG8OAkjFaHGUBF3rP2pEnpdAk kRZQ9h4tbEbvsSL1Tr09jm4cuJ4dgFnZ7c3vY= MIME-Version: 1.0 Received: by 10.101.196.13 with SMTP id y13mr10288538anp.148.1252133092575; Fri, 04 Sep 2009 23:44:52 -0700 (PDT) In-Reply-To: References: Date: Sat, 5 Sep 2009 01:44:52 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016e68ee0b531e95f0472cef49e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68ee0b531e95f0472cef49e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I agree, just seems no one has undertaken this yet, I wonder why. Though as awesome as lua is, the C code is very daunting :) -Raymond On Fri, Sep 4, 2009 at 10:10 PM, Timothy Baldridge wr= ote: > No you can't use Reflection.Emit in XNA (and I assume Silverlight as > well). That's why I think we need a 1:1 conversion of the existing C > routines to C#. That way we use C# to interpret the Lua code. It > shouldn't be all that slow. > > Timothy > > On Fri, Sep 4, 2009 at 9:52 PM, Raymond Jacobs wrote: > > We looked briefly at XNua; notably it said coroutine support was untest= ed > > and potentially broken; > > > > http://www.xnua.com/xna_lua_docs_limitiations > > > > coroutines are a major feature for us, so this was a bit disturbing, bu= t > we > > haven't confirmed it yet. > > > > it also *seems* XNua hasn't been updated since 2007, which bodes well f= or > > any further work being done on it (should there be major features > missing). > > > > As for using .NET bytecode at runtime, I dunno if Silverlight or XNA > allow > > that, might seem like a security risk *shrug* > > > > -Raymond > > > > On Fri, Sep 4, 2009 at 3:57 PM, Timothy Baldridge > > wrote: > >> > >> Well, there is this: http://www.xnua.com/xna_lua_xnua > >> > >> XNua takes C# code and translates it to .Net bytecode. This is fine, > >> but I would like to see a bit higher level abstract of this. > >> > >> I've been digging into this lately, and it doesn't seem all that hard > >> to do a port of Lua to C#, where the lua execution loop is a C# loop. > >> This is a project I may start on soon, but haven't yet. So I'm > >> interested in hearing other people's thoughts about the whole issue. > >> > >> Timothy Baldridge > >> > >> On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs > wrote: > >> > Greetings all, > >> > > >> > I'm currently developing a write-once-run-anywhere game authoring > tool, > >> > which uses lua for scripting. > >> > > >> > Our main 'VM' is in C++/Win32/DirectX, but we have strong aspiration= s > >> > for: > >> > > >> > Flash10 > >> > Silverlight > >> > XNA > >> > > >> > So far, I've found very little in the way of getting Lua to run on > these > >> > platforms. > >> > > >> > The closest I have come, is using lua-alchemy for Flash/Flex; but th= ey > >> > lack > >> > the C-API which we rely on. > >> > > >> > I've found various C#/.NET lua implementations however, due to the > >> > 'lockdown' of silverlight and XNA it doesn't seem they will work. > >> > > >> > So the questions are; > >> > > >> > Is there any concern among the Lua group about the difficulties of > >> > spreading > >> > Lua to these new and popular technologies? > >> > > >> > Are we simply waiting for a 'native' Lua VM Library to be written by > an > >> > industrious fellow, in C# or the like? > >> > > >> > What are some basic difficulties in writing/porting a lua compiler/v= m > >> > with > >> > the C-API present? > >> > > >> > Am I mistaken in any of my assertions, maybe I'm just missing > something? > >> > > >> > > >> > Any feedback i can get on this would be excellent, > >> > > >> > Thanks, > >> > > >> > Raymond Jacobs > >> > Owner, > >> > Ethereal Darkness Interactive > >> > www.edigames.com > >> > > >> > > >> > > >> > > >> > > >> > >> > >> > >> -- > >> =93One of the main causes of the fall of the Roman Empire was > >> that=96lacking zero=96they had no way to indicate successful terminati= on > >> of their C programs.=94 > >> (Robert Firth) > > > > > > > > -- > =93One of the main causes of the fall of the Roman Empire was > that=96lacking zero=96they had no way to indicate successful termination > of their C programs.=94 > (Robert Firth) > --0016e68ee0b531e95f0472cef49e Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I agree, just seems no one has undertaken this yet, I wonder why.

Th= ough as awesome as lua is, the C code is very daunting :)

-Raymond
On Fri, Sep 4, 2009 at 10:10 PM, Timothy B= aldridge <tbal= dridge@gmail.com> wrote:
No you can't = use Reflection.Emit in XNA (and I assume Silverlight as
well). That's why I think we need a 1:1 conversion of the existing C routines to C#. That way we use C# to interpret the Lua code. It
shouldn't be all that slow.

Timothy

On Fri, Sep 4, 2009 at 9:52 PM, Raymond Jacobs<raymondj@gmail.com> wrote:
> We looked briefly at XNua; notably it said coroutine support was untes= ted
> and potentially broken;
>
> http://www.xnua.com/xna_lua_docs_limitiations
>
> coroutines are a major feature for us, so this was a bit disturbing, b= ut we
> haven't confirmed it yet.
>
> it also *seems* XNua hasn't been updated since 2007, which bodes w= ell for
> any further work being done on it (should there be major features miss= ing).
>
> As for using .NET bytecode at runtime, I dunno if Silverlight or XNA a= llow
> that, might seem like a security risk *shrug*
>
> -Raymond
>
> On Fri, Sep 4, 2009 at 3:57 PM, Timothy Baldridge <tbaldridge@gmail.com>
> wrote:
>>
>> Well, there is this: http://www.xnua.com/xna_lua_xnua
>>
>> XNua takes C# code and translates it to .Net bytecode. This is fin= e,
>> but I would like to see a bit higher level abstract of this.
>>
>> I've been digging into this lately, and it doesn't seem al= l that hard
>> to do a port of Lua to C#, where the lua execution loop is a C# lo= op.
>> This is a project I may start on soon, but haven't yet. So I&#= 39;m
>> interested in hearing other people's thoughts about the whole = issue.
>>
>> Timothy Baldridge
>>
>> On Fri, Sep 4, 2009 at 1:59 PM, Raymond Jacobs<raymondj@gmail.com> wrote:
>> > Greetings all,
>> >
>> > I'm currently developing a write-once-run-anywhere game a= uthoring tool,
>> > which uses lua for scripting.
>> >
>> > Our main 'VM' is in C++/Win32/DirectX, but we have st= rong aspirations
>> > for:
>> >
>> > Flash10
>> > Silverlight
>> > XNA
>> >
>> > So far, I've found very little in the way of getting Lua = to run on these
>> > platforms.
>> >
>> > The closest I have come, is using lua-alchemy for Flash/Flex;= but they
>> > lack
>> > the C-API which we rely on.
>> >
>> > I've found various C#/.NET lua implementations however, d= ue to the
>> > 'lockdown' of silverlight and XNA it doesn't seem= they will work.
>> >
>> > So the questions are;
>> >
>> > Is there any concern among the Lua group about the difficulti= es of
>> > spreading
>> > Lua to these new and popular technologies?
>> >
>> > Are we simply waiting for a 'native' Lua VM Library t= o be written by an
>> > industrious fellow, in C# or the like?
>> >
>> > What are some basic difficulties in writing/porting a lua com= piler/vm
>> > with
>> > the C-API present?
>> >
>> > Am I mistaken in any of my assertions, maybe I'm just mis= sing something?
>> >
>> >
>> > Any feedback i can get on this would be excellent,
>> >
>> > Thanks,
>> >
>> > Raymond Jacobs
>> > Owner,
>> > Ethereal Darkness Interactive
>> > www.edi= games.com
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> =93One of the main causes of the fall of the Roman Empire was
>> that=96lacking zero=96they had no way to indicate successful termi= nation
>> of their C programs.=94
>> (Robert Firth)
>
>



--
=93One of the main causes of the fall of = the Roman Empire was
that=96lacking zero=96they had no way to indicate successful termination of their C programs.=94
(Robert Firth)

--0016e68ee0b531e95f0472cef49e-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 04:14:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n857EMOS001790; Sat, 5 Sep 2009 04:14:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A74FE18B4E; Sat, 5 Sep 2009 04:13:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9B5518AAD for ; Sat, 5 Sep 2009 04:13:49 -0300 (BRT) Received: by bwz10 with SMTP id 10so24635bwz.5 for ; Sat, 05 Sep 2009 00:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FHfCI2QEqzMZ3Nrd/HTup8cLh8HSpfNitWezOF7Jg4s=; b=bsQglE4XAcflaouOunJoIo4tDA08Y2vh3lVX4ucePJcqBBh2nG9D5RESI7dTcqfWmL YRXoY+2LJHweXkaL1+Lw0eKquwe+Vtf8eji7X8JduSeK51vaHyq8ZTRhUbvSOxPHq24M bDN4iunV9SYjaQg+fTGiYGkOwcvlo/Wr6uADQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=th2Zek5505/BfEqacb8xh8bYY1SohLSCIplKkWga4OJqwOf/Nwiida53p8euJ/idGh /AgfGs+J6EY1lwoWx+s8qGeYYqaiPcrrICbQm48EzzmO4RpizPzWYPb4PiVDtNOETtu7 fdjdKlr80LZ4faU4q6exgwtOXii2MMo6GAlTE= MIME-Version: 1.0 Received: by 10.204.160.73 with SMTP id m9mr9882987bkx.214.1252134828489; Sat, 05 Sep 2009 00:13:48 -0700 (PDT) In-Reply-To: References: Date: Sat, 5 Sep 2009 09:13:48 +0200 Message-ID: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> Subject: Re: Getting lua to travel on .NET and the like From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs wrote: > I agree, just seems no one has undertaken this yet, I wonder why. Because it's hard ? ;) Here's a suggestion for someone with the need and some time: work with a pure-Java implementation of Lua like Kahlua and translate that to C#. A much more natural fit, given the (intended) simularities of the languages. steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 05:13:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n858Djo9007276; Sat, 5 Sep 2009 05:13:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35BCC191D5; Sat, 5 Sep 2009 05:13:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39A3E1911A for ; Sat, 5 Sep 2009 05:13:15 -0300 (BRT) Received: by bwz10 with SMTP id 10so39751bwz.5 for ; Sat, 05 Sep 2009 01:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+Mi//bOThLd0FZVXMgVVxuljmukrNwymSBC22h6kW8Q=; b=pi0a9PFB0tAk/HmJvo0s0Pcs6J4oEEG3vtd+zufl5+bQWdhWV8K3Mx1GmUf/P82s6t OjU2w3ALD+7v/ov7Ncn7MhtE+MouQ1ZdvZH0Im9c4ywNcuR/N6qkvCbx4aCwhr82VZBt JMImnY29Fv0nxgVGwdi5REfZwtKimskYrel7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QrOAzfb9pk0kWkayXsqsYSHjffzm/HbWZzskETm25aazPRqbghItdCtAdgYQL1UV+j h23VDvHIm6ec9b/Nv/NsUDsjfTgZgooRBe2aOF8ZEJx50WoSwGfyg+ath9Gb2fgAFsXc Caj+WDy1+YpNnrIiSI6La+Oj61/Kow5D8Cqj8= MIME-Version: 1.0 Received: by 10.204.34.194 with SMTP id m2mr9857941bkd.53.1252138392833; Sat, 05 Sep 2009 01:13:12 -0700 (PDT) In-Reply-To: <4AA169DA.5070800@wp.pl> References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> <4AA169DA.5070800@wp.pl> Date: Sat, 5 Sep 2009 10:13:12 +0200 Message-ID: <560972290909050113j267a88f9g30796364c91c929c@mail.gmail.com> Subject: Re: Lua FAQ has moved to new location! From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/4 Michal Kolodziejczyk : > Some questions assume there are lua libraries (like luafilesystem in > #3.4), and some do not (like in #3.6 - no lualanes, luaproc etc mentioned). At the end of 3.6, there is a link to the wiki on multitasking options, plus Asko's excellent summary. But I think I did not clearly indicate (as you say) that now we are talking about extensions to Lua. Most of 3.6 is about coroutines, and right at the end it talks about the other options, which is not clearly indicated. It's hard to know how much detail to include, i.e. whether to explicitly mention (some of) the possibilities explicitly in 3.6. And then it's easy to leave someone out! As a self-criticism, I think there is probably too much detail in sections which I'm particularly interested in, like GUI toolkits. Not worried about length, but consistency! > I think every such answer could start with "In standard lua..." followed > by "But with external libraries..." - or something like that. I agree that these things should be 'signposted' more clearly. steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 06:21:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n859LmJY013196; Sat, 5 Sep 2009 06:21:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBB7E1926C; Sat, 5 Sep 2009 06:21:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0638A190B5 for ; Sat, 5 Sep 2009 06:21:13 -0300 (BRT) Received: by yxe36 with SMTP id 36so3619878yxe.11 for ; Sat, 05 Sep 2009 02:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2NSErN57UqniHOv80L8sQZFC6Cy4NtUDIwYNrZlEs0E=; b=BJio1c43j9rj8FwzgRammu3UaoJbbuOWvllEkMvA2X4pvHLOIqopgVAEr5d7hHDchM uygkik6ioo+25sud+gE87ayr/G845vy/Iyy7JHaz7HPQY+mNlzTPyVAf6Q6F+FxuGhhp fXAhjejzZQ+QdrIQXHsD7udhBcH+P1bdF9K0w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QNdsJQzyupsnOxfLVSqk6kFQIa1qW5HRs90refd+Ga3Ibys8nG5MAYp31osC4oO69Z +gZI8a8Hc4N6HNC0I2aLBPTL1daVZruNlpsFAWUhjQRAAMDXi/+8wFSEVkPqE66GpobY nfa0CsOB2xqxyWW7bTKqd4cmX/hR7LJl4boJQ= MIME-Version: 1.0 Received: by 10.150.114.14 with SMTP id m14mr20191284ybc.162.1252142471140; Sat, 05 Sep 2009 02:21:11 -0700 (PDT) In-Reply-To: References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> <20090904160621.61bd7141@trite.i.flarn.net.i.flarn.net> Date: Sat, 5 Sep 2009 02:21:11 -0700 Message-ID: <1079b050909050221m3ec3e3fexbefa71c831f37435@mail.gmail.com> Subject: Re: Wishlists and Modules (was [ANN] libmc) From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n859LmJY013196 On Fri, Sep 4, 2009 at 11:14 PM, David Manura wrote: > On Fri, Sep 4, 2009 at 11:06 AM, Rob Kendrick wrote: >> What I don't look forward to is being forced to either use LuaRocks, or >> write my own Makefile for something. > > Here's a prototype of a rockspec-to-Makefile converter: > >  http://lists.luaforge.net/pipermail/luarocks-developers/2009-September/001181.html Along these lines, I've been working on a project to configure and build C/C++/Lua projects that I'm about to release once I'm able to get back on my Linux machine and make sure everything still works there. Here's a look at a configuration file example for luatask: http://www.mat.ucsb.edu/projects/luaAV/browser/luamake/examples/projects/luatask.lua The svn module: svn co https://svn.mat.ucsb.edu/svn/luaAV/luamake The actual script that executes the build process is about 50 lines of setup code and 5 lines to load the project, build it, and install it: http://www.mat.ucsb.edu/projects/luaAV/browser/luamake/build.lua We're using this make system for our LuaAV project on Linux, which as a large number of modules and shared library dependencies and other custom behavior on installation such as copying resources to the install location and the icon to a folder in /usr/share etc. wes From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 07:21:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85ALKBY017801; Sat, 5 Sep 2009 07:21:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44D6319290; Sat, 5 Sep 2009 07:20:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A67D31926C for ; Sat, 5 Sep 2009 07:20:52 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjsO0-0007iV-2O for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 10:20:48 +0000 From: "John Hind" To: "'Lua list'" References: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> In-Reply-To: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> Subject: RE: Getting lua to travel on .NET and the like Date: Sat, 5 Sep 2009 11:19:58 +0100 Message-ID: <001801ca2e12$6b9f9530$42debf90$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acot+IPOH/MOxRTSRqabb0dFosntCAAGSzUw Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm missing something here ... If what you want is .NET Managed Code, the Microsoft compilers will generate that from C++ (and therefore from the standard Lua sources which are C++ compatible C). Why do you need to translate to C#? > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: 05 September 2009 08:14 > To: Lua list > Subject: Re: Getting lua to travel on .NET and the like > > On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs > wrote: > > I agree, just seems no one has undertaken this yet, I wonder why. > > Because it's hard ? ;) > > Here's a suggestion for someone with the need and some time: work with > a pure-Java implementation of Lua like Kahlua and translate that to > C#. A much more natural fit, given the (intended) simularities of the > languages. > > steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 07:48:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85AmB6K019828; Sat, 5 Sep 2009 07:48:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63997192D1; Sat, 5 Sep 2009 07:47:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 474641929D for ; Sat, 5 Sep 2009 07:47:48 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mjso4-00087T-82 for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 12:47:44 +0200 Received: from 218.45.67.12.eo.eaccess.ne.jp ([218.45.67.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Sep 2009 12:47:44 +0200 Received: from miles by 218.45.67.12.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Sep 2009 12:47:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Miles Bader Subject: Re: Is a Lua system easily embeddable? Date: Sat, 05 Sep 2009 19:47:21 +0900 Lines: 17 Message-ID: <8763bxhdmu.fsf@catnip.gol.com> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.45.67.12.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:MYdEmqArYv2pHUrz1gbQynS5aYo= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella writes: >> How have they become different, except that the protocol for C libraries is >> now that they are called via lua_call instead of calling luaopen_xxx directly? >> (However, this is just for some libraries that need environments.) > > Based on what people said about how to statically link modules, I have > to say things do have changed. Which "things," exactly? Be precise. In my experience, Lua is _extremely_ simple to use with static libraries... -Miles -- If you can't beat them, arrange to have them beaten. [George Carlin] From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 07:55:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85AtVGD020364; Sat, 5 Sep 2009 07:55:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6066192DF; Sat, 5 Sep 2009 07:55:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DC17192B4 for ; Sat, 5 Sep 2009 07:55:05 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mjsv9-0001HB-Dg for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 12:55:03 +0200 Received: from 218.45.67.12.eo.eaccess.ne.jp ([218.45.67.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Sep 2009 12:55:03 +0200 Received: from miles by 218.45.67.12.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Sep 2009 12:55:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Miles Bader Subject: Re: Is a Lua system easily embeddable? Date: Sat, 05 Sep 2009 19:50:26 +0900 Lines: 17 Message-ID: <87ws4dfyx9.fsf@catnip.gol.com> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <4AA1735D.3000909@gmail.com> <4AA1769B.2070209@sct.microlink.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.45.67.12.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:qmsdgJK+gtAs6JHq7vWp4Mrr7xQ= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella writes: >> Not even an example? I don't think in this instance that there are >> development practices or methods that is so secret that it entails an >> NDA. Smells like hand-waving. > > You're free to believe in what you want. Er, given that you're making unsupported and vague negative claims about Lua, I think it's up to you to provide examples of what you mean. How can we judge your argument or assist you if we don't even know what you're talking about? -Miles -- Friendship, n. A ship big enough to carry two in fair weather, but only one in foul. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 07:58:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85AwCoO020681; Sat, 5 Sep 2009 07:58:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D184C192EE; Sat, 5 Sep 2009 07:57:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77AB6192C5 for ; Sat, 5 Sep 2009 07:57:50 -0300 (BRT) Received: by ewy26 with SMTP id 26so1490157ewy.5 for ; Sat, 05 Sep 2009 03:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Xxe+f6uZZllD410VS6yIrDQt1ahfwNIkNM5jbCa+UCI=; b=nI7rmQ4qxKGyGedJOKY18sC6AfOjbdwr1hBOKzXMQVjN7fUMHNzKmwZ8ZqSC2bKS4l UCddw7XHXvyqRYbUwCZllfBdHoNzwZBstmXooualmsEQ7Ys2aVXS/jU3ZlFUcaGw4iD3 924hdUHkPaoxu6Eohk/F8EDn9d9R24pz3/zrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=A7m1f4d05bjV6Vjqnq02JiJjHGryU04Xp2ucymOPEI+ayghSCx6rmcNMttMbQoKfWR fhvrSeCvXvAHJGKA2IWq2f/46Yn183t2BmGFHACOMozn9VBjHCclzg9KnOq1SfBqR95Y FR1auUU+yZEIJ4pMhRLl00aQQXWqnfoqf3Z7o= Received: by 10.216.29.73 with SMTP id h51mr2451712wea.16.1252148267771; Sat, 05 Sep 2009 03:57:47 -0700 (PDT) Received: from ?95.78.78.170? ([95.78.78.170]) by mx.google.com with ESMTPS id f13sm1578111gvd.8.2009.09.05.03.57.45 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Sep 2009 03:57:46 -0700 (PDT) Date: Sat, 5 Sep 2009 14:57:13 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1144263885.20090905145713@gmail.com> To: John Hind Subject: Re: Scriptable Shell Extension In-Reply-To: <89728016.20090506145737@gmail.com> References: <89728016.20090506145737@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Bulat, in the May i've asked the list about Explorer extension scriptable using Lua now i have developed it and it serves needs of my program. you may find its sources in ArcShellExt directory at the http://freearc.svn.sourceforge.net/ SVN repository. Screenshot: http://freearc.org/screenshots/freearc-explorer.png you may run it by yourself by installing FreeArc using http://freearc.org/download/testing/FreeArc-0.52-win32.exe installer -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 08:22:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85BMkxT023034; Sat, 5 Sep 2009 08:22:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02D87191DC; Sat, 5 Sep 2009 08:22:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9747418FF3 for ; Sat, 5 Sep 2009 08:22:16 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjtLQ-00031F-7Y for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 11:22:12 +0000 From: "John Hind" To: "'Lua list'" References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> In-Reply-To: <8763bxhdmu.fsf@catnip.gol.com> Subject: RE: Is a Lua system easily embeddable? Date: Sat, 5 Sep 2009 12:21:22 +0100 Message-ID: <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcouFmTfZLpUx5SvTxaZaxotqsggHAAAX6Hw Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think perhaps the issue here is that the Module system has encouraged a move to writing libraries in Lua or in composites of Lua and C rather than in pure C. This introduces an implicit assumption that the target architecture will present a file system in which to store the Lua code, an assumption that is not made by the Lua core or standard libraries. This is easily fixed on the Windows environment because Windows executables have support for embedded resources and it is straightforward to provide a loader so Lua "require" looks for Lua code in resources. Unfortunately, this is not portable to other platforms. Also unfortunately you cannot load dll files from resources, so you still must statically link the C parts of composite libraries (not usually any problem, but it would be nice ...) This problem is not unique to Lua and it afflicts all "scripting" languages (just look at how many files the Firefox browser tips into your file system!). What's needed is a generic "meta-executable" format that embeds a virtual file system and makes it available to a normal executable (in this case a Lua runtime) stored in the same file. Any examples of such systems I can find extract content out to temporary files, which rather spoils the point! > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Miles Bader > Sent: 05 September 2009 11:47 > To: lua@bazar2.conectiva.com.br > Subject: Re: Is a Lua system easily embeddable? > > Andre de Leiradella writes: > >> How have they become different, except that the protocol for C > libraries is > >> now that they are called via lua_call instead of calling luaopen_xxx > directly? > >> (However, this is just for some libraries that need environments.) > > > > Based on what people said about how to statically link modules, I > have > > to say things do have changed. > > Which "things," exactly? Be precise. > > In my experience, Lua is _extremely_ simple to use with static > libraries... > > -Miles > > -- > If you can't beat them, arrange to have them beaten. [George Carlin] From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 09:09:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85C9iuB027497; Sat, 5 Sep 2009 09:09:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8F2B1921E; Sat, 5 Sep 2009 09:09:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22B351914C for ; Sat, 5 Sep 2009 09:09:10 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e12so311543fga.17 for ; Sat, 05 Sep 2009 05:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bUCMO8rzLAjWVidHn/QLWqTT44k/chMDXbx5nv5j/t4=; b=LNpvNka+6my8imd0Lm2YhBoan561Usv8zVkxTpZoxiLKXQZia2p5hKgeV4Xsd1qtFl 7kiuF26sea4+NSYo7a/2JYHlF75/AIjoYbz06P6aAM07hmIWGlf/CGIEHRu6UvCU612F GxT9Wp/3WBlJiysk8ahAoCfzaElritaLvfYk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KzwpeiZzvXP5SdWlUlaiaKEImUBJ0ORH4PVVLEDYswImScW0yu7j6FDYqNUZdaui7V CuOugcKYBKVooM2bsQms02RGa2jKgAcG3QpyixbVyMRgAuihwpwshfRJ3UjsDsNRUxMG mJUaq/8BWiBhhZBqpP5kDHEmsHdyO3k/GP2eA= MIME-Version: 1.0 Received: by 10.86.243.15 with SMTP id q15mr5974003fgh.21.1252152548817; Sat, 05 Sep 2009 05:09:08 -0700 (PDT) In-Reply-To: <2656446617943241256@unknownmsgid> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> Date: Sat, 5 Sep 2009 13:09:08 +0100 Message-ID: <79990c6b0909050509o2b2e9ad6pef4fb2ebf9714fee@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? From: Paul Moore To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/5 John Hind : > What's needed is a generic "meta-executable" format that embeds a > virtual file system and makes it available to a normal executable (in this > case a Lua runtime) stored in the same file. Any examples of such systems I > can find extract content out to temporary files, which rather spoils the > point! Shared libraries (DLLs, .so files, etc) have to be loaded from a place the OS can locate them. So without some level of OS support, the type of container you describe isn't possible (other than, as you say, by extracting to temporary files). I don't know of any OS support for loading DLLs from custom container types (short of writing a user-level filesystem driver!) I would be tremendously happy to be proved wrong, but I'd have expected the technique to be better known if it existed. Paul. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 09:38:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85CcM0M030184; Sat, 5 Sep 2009 09:38:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DA621914C; Sat, 5 Sep 2009 09:37:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8B0F18C79 for ; Sat, 5 Sep 2009 09:37:53 -0300 (BRT) Received: by vws33 with SMTP id 33so1145766vws.33 for ; Sat, 05 Sep 2009 05:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=NVzdiYITXsMpSh5i0pkmfsoPDNhV0XkCJ7Sn9jJwCcI=; b=yFAWiAcvf+YHdsFZ0KmCPBkI7tnMoaO6eeiLGjndFn/MDyaksLyogi/BROrNLs1IsR hCqMX6APoLtHoZ2C8VLhE0mEIWyKMdLU/qsy0z92OHMI5NrZI70PcKHrQMgB9BK/NlOG RHYAQS+lldDA9P0Hn/4DnQ/6EnAu13nEdq8BY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=auB+Z9Xnwi10crcmtAnZQXr4hxRBJr75F5Sl89h8F2b3XaWp9EXyiXPZT/SYPmyd5L 2nGi8L1EyRYLwy/KXLe4s4NXUzpnnmAu8c4wDg5fWCk59FVq9EbuxrEPPl3/rt/nYYhw Qfqjk7eJrLX/mdiplPXNPPOoWeFBlw9qqZagw= MIME-Version: 1.0 Received: by 10.220.20.67 with SMTP id e3mr11181156vcb.75.1252154271398; Sat, 05 Sep 2009 05:37:51 -0700 (PDT) In-Reply-To: <-2321131548438645074@unknownmsgid> References: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> <-2321131548438645074@unknownmsgid> Date: Sat, 5 Sep 2009 07:37:51 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Timothy Baldridge To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n85CcM0M030184 Because several frameworks like XNA and Silverlight only allow 100% managed code. I think the C++ to CLR compilation would make the use of unmanager pointers wouldn't it? But using the Java version sounds good. I just glanced at the code, and it doesn't look that hard to translate. The two languages are very similar in syntax. Timothy On Sat, Sep 5, 2009 at 5:19 AM, John Hind wrote: > I'm missing something here ... > > If what you want is .NET Managed Code, the Microsoft compilers will generate > that from C++ (and therefore from the standard Lua sources which are C++ > compatible C). Why do you need to translate to C#? > >> -----Original Message----- >> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- >> bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan >> Sent: 05 September 2009 08:14 >> To: Lua list >> Subject: Re: Getting lua to travel on .NET and the like >> >> On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs >> wrote: >> > I agree, just seems no one has undertaken this yet, I wonder why. >> >> Because it's hard ? ;) >> >> Here's a suggestion for someone with the need and some time: work with >> a pure-Java implementation of Lua like Kahlua and translate that to >> C#.  A much more natural fit, given the (intended) simularities of the >> languages. >> >> steve d. > > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 10:56:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85DuocM005443; Sat, 5 Sep 2009 10:56:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FA89192C3; Sat, 5 Sep 2009 10:56:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E38F190F9 for ; Sat, 5 Sep 2009 10:56:12 -0300 (BRT) Received: (qmail 7243 invoked by uid 399); 5 Sep 2009 07:56:09 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 5 Sep 2009 07:56:09 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AA26DF8.5070308@workspacewhiz.com> Date: Sat, 05 Sep 2009 07:56:08 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Getting lua to travel on .NET and the like References: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> In-Reply-To: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------030700090107030108020905" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------030700090107030108020905 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: steve donovan Date: 9/5/2009 1:13 AM > On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs wrote: > >> I agree, just seems no one has undertaken this yet, I wonder why. >> > Because it's hard ? ;) > > Here's a suggestion for someone with the need and some time: work with > a pure-Java implementation of Lua like Kahlua and translate that to > C#. A much more natural fit, given the (intended) simularities of the > languages. > I'm going to show my complete ignorance here, but I have a /clr:pure assembly of Lua that seems to work fine for me. How does this not fit the idea of Lua on .NET? Josh --------------030700090107030108020905 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: steve donovan
Date: 9/5/2009 1:13 AM
On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs<raymondj@gmail.com> wrote:
  
I agree, just seems no one has undertaken this yet, I wonder why.
    
Because it's hard ? ;)

Here's a suggestion for someone with the need and some time: work with
a pure-Java implementation of Lua like Kahlua and translate that to
C#.  A much more natural fit, given the (intended) simularities of the
languages.
  
I'm going to show my complete ignorance here, but I have a /clr:pure assembly of Lua that seems to work fine for me.  How does this not fit the idea of Lua on .NET?

Josh
--------------030700090107030108020905-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 11:46:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85EkDAk010498; Sat, 5 Sep 2009 11:46:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A8FD192E8; Sat, 5 Sep 2009 11:45:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.211.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65E65192DC for ; Sat, 5 Sep 2009 11:45:39 -0300 (BRT) Received: by ywh32 with SMTP id 32so2583538ywh.11 for ; Sat, 05 Sep 2009 07:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0BeXxcuDzMM850y115vIrgYJbJXcv1PiXjVDSApEkZE=; b=EGtciMvxiffRrEYw8Q5AVAMjBkblb1sjvd4PC+AhPCjCeJraGfmn9ChYbJFt0VT7Gj exFdtLZBqQpvCvxT+rVl6UOfw6IEvg2Tc3H6E3ajiap354kofgxOVRMBJMG5E1JG/g2x cpJNNPhh2dC4EzjCiYeHDl3/tkXBdiM8AOH1g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NDYAWTAPmL++xaMqDaRU0WVqTDkWYpanTuBbpExBurYBVaU4bR6lkweH2VLvJLN16D Pz4OIX5Oig783MzSyha1LLutjIK9UcgbU2WfmMdfAvLRYsWKpe6U8N9V0LL3DJHKtzY3 wUzbogMfpMNpGtmsJAgplQnleRoCfBKWKTGj0= MIME-Version: 1.0 Received: by 10.100.24.37 with SMTP id 37mr13723136anx.45.1252161937522; Sat, 05 Sep 2009 07:45:37 -0700 (PDT) In-Reply-To: <4AA26DF8.5070308@workspacewhiz.com> References: <560972290909050013m3f04ff6bkef6f6e99222373ac@mail.gmail.com> <4AA26DF8.5070308@workspacewhiz.com> Date: Sat, 5 Sep 2009 09:45:37 -0500 Message-ID: Subject: Re: Getting lua to travel on .NET and the like From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016e646916a7cc0f00472d5ab95 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e646916a7cc0f00472d5ab95 Content-Type: text/plain; charset=ISO-8859-1 In talking with one of my developers we think that a c++/CLR implementation would work (under silverlight and XNA(XBOX360)); I've never used c++/CLR though so I can't comment is lua would 'just work' under it. -Raymond On Sat, Sep 5, 2009 at 8:56 AM, Joshua Jensen wrote: > ----- Original Message ----- > From: steve donovan > Date: 9/5/2009 1:13 AM > > On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs wrote: > > > I agree, just seems no one has undertaken this yet, I wonder why. > > > Because it's hard ? ;) > > Here's a suggestion for someone with the need and some time: work with > a pure-Java implementation of Lua like Kahlua and translate that to > C#. A much more natural fit, given the (intended) simularities of the > languages. > > > I'm going to show my complete ignorance here, but I have a /clr:pure > assembly of Lua that seems to work fine for me. How does this not fit the > idea of Lua on .NET? > > Josh > --0016e646916a7cc0f00472d5ab95 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In talking with one of my developers we think that a c++/CLR implementation= would work (under silverlight and XNA(XBOX360));
I've never used c+= +/CLR though so I can't comment is lua would 'just work' under = it.

-Raymond

On Sat, Sep 5, 2009 at 8:56 = AM, Joshua Jensen <jjensen@workspacewhiz.com> wrote:
=20
----- Original Message -----
From: steve donovan
Date: 9/5/2009 1:13 AM
On Sat, Sep 5, 2009 at 8:44 AM, Raymond Jacobs<raymondj@gmail.com> wrote:
  
I agree, just seems no one has undertaken this yet, I wonder why.
    
Because it's hard ? ;)

Here's a suggestion for someone with the need and some time: work with
a pure-Java implementation of Lua like Kahlua and translate that to
C#.  A much more natural fit, given the (intended) simularities of the
languages.
  
I'm going to show my complete ignorance here, but I have a /clr:pure assembly of Lua that seems to work fine for me.=A0 How does this not fit the idea of Lua on .NET?

Josh

--0016e646916a7cc0f00472d5ab95-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 13:27:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85GREZM020709; Sat, 5 Sep 2009 13:27:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F01DC19306; Sat, 5 Sep 2009 13:26:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 925C2192E9 for ; Sat, 5 Sep 2009 13:26:32 -0300 (BRT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Mjy5w-00051H-1P for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 09:26:32 -0700 Message-ID: <25310072.post@talk.nabble.com> Date: Sat, 5 Sep 2009 09:26:32 -0700 (PDT) From: JazCook To: lua@bazar2.conectiva.com.br Subject: problem - Writing to SQLite3 from a form in a Lua Page MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: jazcook@gmail.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Good day I am trying to learn Lua and friends. Trying to test a simple, little browser app, I took subset of test.lp (the one that comes with Kepler). It works fine as a form, returning POST values ok. So, as a next step, I included code to load the returned POST values into a little SQLite3 database. Now, the Lua script loads values into the SQLite3 just fine as a standalone script, but once I included the database code in to the Luapage, the following is reported: // SQlite3browser.lp:33: attempt to index global 'luasql' (a nil value) stack traceback: SQlite3browser.lp:33: in function 'prog' C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua\lp.lua:132: in function 'include' C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:282: in function (tail call): ? (tail call): ? stack traceback: C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:161: in function 'err' ...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in function <...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22> (tail call): ? (tail call): ? C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:169: in function 'pcall' C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:629: in function 'main' C:\LuaRocks/rocks//wsapi/1.1-2/lua/wsapi\sapi.lua:49: in function (tail call): ? // I suspect all the messages following the first line will not appear if I can solve that 'index global 'luasql' issue. The script follows: // #!/usr/bin/env cgilua.cgi CGILua Test Updating SQLite3

Form Handling

Entering values on this form should display them as values in the first submission

User name :

The values should show the previous POST

Values: Username = <%= cgilua.POST.name or "(not set)"%>, Age = <%= cgilua.POST.age or "(not set)"%>

<% require ("luasql.sqlite3") --<----<------<----<--- THIS IS LINE 33 local env = (luasql.sqlite3()) conn = env:connect("luasql-test") nm = cgilua.POST.name ag = cgilua.POST.age assert(conn:execute("insert into people values('" ..nm .."', '" ..ag .."')"))%>

Date

Today is: <%= os.date() %>

// Could someone please explain what I am doing wrong here? Also, I thought of pointing to a separate database script by supplying an "action" and script name to the form, but am unsure how to pass the POST values to the script in such a case. Regards Jasper Cook -- View this message in context: http://www.nabble.com/problem---Writing-to-SQLite3-from-a-form-in-a-Lua-Page-tp25310072p25310072.html Sent from the Lua - General mailing list archive at Nabble.com. From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 13:49:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85GnZOv023460; Sat, 5 Sep 2009 13:49:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD93F19355; Sat, 5 Sep 2009 13:49:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 084E819322 for ; Sat, 5 Sep 2009 13:49:04 -0300 (BRT) Received: by pxi13 with SMTP id 13so1549361pxi.10 for ; Sat, 05 Sep 2009 09:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Z6TQDaBTzUXpmQ6olq5AX6hN83j8kT05EsEW41MB03g=; b=q3QoQbcWFNgLBVPfemhR/4X1fFdpgM9wcfTYCa1eEW/QTz5aOlpSrZH9vVtneL5h3v isv852Xu7CG7cckwon+lYrEX9PiqlXk/+1oNch142YVLpQ7HzKo7J4iiT5WTsKqM2NNV oQ5t2Mjyd/hcgz7QWcIJRDRwQHRKj8WH9q1BY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WMaGbHZYCpx2E6hNDbXvFE5ZGf4Po4QkzPKoRX/cGRqX1iLTFvDiY6nej5G7uf6Mcs qDsfrNyQ/Q+CYdljbel1YVH5SukoqJLMkcvilFEb/1403tyqNC8t/dGZkO/TvTTfdUee 5iCHphHK49I9+SWwWm1THxKBGOgm5NsgEypd8= Received: by 10.114.164.17 with SMTP id m17mr12063771wae.3.1252169342743; Sat, 05 Sep 2009 09:49:02 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.58.172]) by mx.google.com with ESMTPS id 20sm1096677pzk.9.2009.09.05.09.49.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Sep 2009 09:49:02 -0700 (PDT) Message-ID: <4AA2967A.5010008@gmail.com> Date: Sun, 06 Sep 2009 00:48:58 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> In-Reply-To: <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean John Hind wrote: > I think perhaps the issue here is that the Module system has encouraged a > move to writing libraries in Lua or in composites of Lua and C rather than > in pure C. This introduces an implicit assumption that the target > architecture will present a file system in which to store the Lua code, an > assumption that is not made by the Lua core or standard libraries. > [snip] The way I see it, there are different fundamental approaches to modules and integration of modules into an application. Each has its advantages and disadvantages, each is appropriate for different applications. If there are three ways of doing things, A, B and C, right now it is next to impossible to satisfy all users of A, B and C perfectly and simultaneously. A large and complex module is more amenable to some sort of organizational rules; if it is statically linked, then it is usually the integrator who has to enforce constraints among submodules. > [snip] > This problem is not unique to Lua and it afflicts all "scripting" languages > (just look at how many files the Firefox browser tips into your file > system!). What's needed is a generic "meta-executable" format that embeds a > virtual file system and makes it available to a normal executable (in this > case a Lua runtime) stored in the same file. Any examples of such systems I > can find extract content out to temporary files, which rather spoils the > point! The problem with finely-tuned solutions is that it may be perfect for say party P, but not for party Q. There are so many ways of statically linking or bundling complex modules. Now if party P and party Q are both Type A Alpha Male personalities, they might end up strangling each other... Also, the more tightly targeted it is, the less likely module writers will want to maintain any custom build code. In the resource-scarce FLOSS development environment that we are in, ultimately I think it is not very reasonable to be demanding of too many things, especially for stuff we treat as free-as-in-beer. Its not like module developers are obliged to treat module users like paying customers, unless they are really paying customers. That's why lately I've followed David Given lead and wrote in the stuff I put up on LuaForge that they are "experimental software", nothing more. Ultimately, those who want static linking or bundling of complex modules should take the lead. Talk is cheap, unless it is backed up with working code. I'm glad that there are solutions being offered like the Makefile converter, instead of just yakking and yakking like what I am doing. :-) What would be really useful right now is some sample implementation of bundling complex modules that integrates nicely into the original module's codebase. Then again, the sample solution might be perfect for party X but party Y might jump up and vehemently disagree. And we'll be back to square one... :-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 14:02:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85H2QsG024945; Sat, 5 Sep 2009 14:02:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1C8119388; Sat, 5 Sep 2009 14:02:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A7CB1936F for ; Sat, 5 Sep 2009 14:01:55 -0300 (BRT) Received: by ewy26 with SMTP id 26so1617367ewy.5 for ; Sat, 05 Sep 2009 10:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=06VUeTgYVbiz5CWHFCKOTdocSjg1JEDLUe+cLULba5U=; b=wKKEVng2a1I6H1yp9lZnhVr4nLxG5uQDSmGSaPEHKTM4l2BLSdddmDOi8UCeW3B1S5 KyIRgZUIZTZZ82fdLJU5+e88oAVCI/nCyt9dG3I8CJ9TTf9ASNDfGT3V4XQ0lTKi0rfD ITsVWIPylShCq3l24+63xyexIjAmOSHmA3VuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bH0XHbQ65pafIfs35B6jKLNHWLJCvrEcxbIVGn0oY4CCavKhc9ckxG1YRsvkf8YFi5 rdjcW88M4nI3zQKQ07pq/z8oxMwCWeJlPrLSGwHOu5ORQ++3VjErHYRNpY4E1xgndOxX b3oq9auQhQFLYd2bLMHTTAE89Ahaa7c/kx9vg= MIME-Version: 1.0 Received: by 10.216.90.82 with SMTP id d60mr1074864wef.79.1252170112710; Sat, 05 Sep 2009 10:01:52 -0700 (PDT) Date: Sat, 5 Sep 2009 21:01:52 +0400 Message-ID: Subject: Cloning "preforked" Lua state From: Pavel Shevaev To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Folks, is there a way to clone a Lua state? I tried to google around but found nothing really meaningful(correct me if I'm wrong, please). In my game application the initialization procedure of the Lua virtual machine is pretty heavy(about 1 sec, since many scripts are loaded at once). I have a separate Lua vm for each autonomous agent and once the agent is created its Lua initialization affects FPS pretty badly. I'm thinking about the following schema: what about keeping "preforked" Lua state which is then simply cloned for each agent? Is it possible? Thanks in advance -- Best regards, Pavel From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 15:00:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85I0sAe030819; Sat, 5 Sep 2009 15:00:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0A1D19349; Sat, 5 Sep 2009 15:00:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9006A18B6F for ; Sat, 5 Sep 2009 15:00:16 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 56379C7EAA for ; Sat, 5 Sep 2009 21:00:13 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A0688D5159B; Sat, 05 Sep 2009 21:00:13 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 41AFB158A63 for ; Sat, 5 Sep 2009 21:00:10 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Cloning "preforked" Lua state Date: Sat, 5 Sep 2009 21:00:10 +0300 References: X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This would be a welcome feature, if possible and fast. It could be used i.e. with servers, where currently Lua states need either to be recreated from scratch for each query, or carefully restored to known "clean" state after finishing a query. This sounds like a simpler way to me. Maybe code from Lanes can be used to copy the entries of the template state. I should do some speed tests on that (or do the code and let _you_ run the speed tests). ;) -asko Pavel Shevaev kirjoitti 5.9.2009 kello 20:01: > Folks, is there a way to clone a Lua state? I tried to google around > but found nothing really meaningful(correct me if I'm wrong, please). > > In my game application the initialization procedure of the Lua virtual > machine is pretty heavy(about 1 sec, since many scripts are loaded at > once). I have a separate Lua vm for each autonomous agent and once the > agent is created its Lua initialization affects FPS pretty badly. > > I'm thinking about the following schema: what about keeping > "preforked" Lua state which is then simply cloned for each agent? Is > it possible? > > Thanks in advance > > -- > Best regards, Pavel From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 15:08:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85I8IL9031518; Sat, 5 Sep 2009 15:08:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08CAE1939A; Sat, 5 Sep 2009 15:07:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D3971937F for ; Sat, 5 Sep 2009 15:07:52 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjzfz-0002s9-09 for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 15:07:51 -0300 Message-ID: <4AA2A8FE.2090004@sct.microlink.com.br> Date: Sat, 05 Sep 2009 15:07:58 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <4AA1735D.3000909@gmail.com> <4AA1769B.2070209@sct.microlink.com.br> <87ws4dfyx9.fsf@catnip.gol.com> In-Reply-To: <87ws4dfyx9.fsf@catnip.gol.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Miles Bader wrote: > Andre de Leiradella writes: >>> Not even an example? I don't think in this instance that there are >>> development practices or methods that is so secret that it entails an >>> NDA. Smells like hand-waving. >> You're free to believe in what you want. > > Er, given that you're making unsupported and vague negative claims about They are not vague: Lua as a platform is evolving in a different direction of Lua as a language. Again, the module system prevents or makes it more difficult to use Lua with a set of libraries to build a Lua platform for targets that are currently supported by the language. The recent discussion on how one can statically link LuaSocket proves that my claim is not unsupported. And there is the overhead of having the module support code linked in. In my Windows box, it's 10,6Kb. I wish I could leave it out of my host app, but then how can I load modules? And even after I can see how to load them, I still think the Lua platform is heading in a different direction than the language. The Lua language is simple, we build complex things on top of it. Modules should be easy to embed, and people could build dynamic loading, automatic dependency checking and whatnot on top of them. Cheers, Andre > Lua, I think it's up to you to provide examples of what you mean. How > can we judge your argument or assist you if we don't even know what > you're talking about? > > -Miles > From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 15:13:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85IDBWD032002; Sat, 5 Sep 2009 15:13:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7298193A0; Sat, 5 Sep 2009 15:12:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 062C319305 for ; Sat, 5 Sep 2009 15:12:46 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mjzki-00033r-M6 for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 15:12:44 -0300 Message-ID: <4AA2AA24.6090405@sct.microlink.com.br> Date: Sat, 05 Sep 2009 15:12:52 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> In-Reply-To: <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean John Hind wrote: > I think perhaps the issue here is that the Module system has encouraged a > move to writing libraries in Lua or in composites of Lua and C rather than > in pure C. This introduces an implicit assumption that the target > architecture will present a file system in which to store the Lua code, an > assumption that is not made by the Lua core or standard libraries. I think it's ok to have Lua code in a library. And I think each platform has a best way to handle the loading of this code. > This problem is not unique to Lua and it afflicts all "scripting" languages > (just look at how many files the Firefox browser tips into your file > system!). What's needed is a generic "meta-executable" format that embeds a > virtual file system and makes it available to a normal executable (in this > case a Lua runtime) stored in the same file. Any examples of such systems I > can find extract content out to temporary files, which rather spoils the > point! Although there is somewhere in the Internet some code to load a DLL from memory (which could had been loaded from anywhere), I doubt anyone would want to use except as a toy or for better understanding the PE file format. I'll post the link if I can find it again. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 15:27:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85IRqgR000795; Sat, 5 Sep 2009 15:27:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 498A3191F2; Sat, 5 Sep 2009 15:27:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C50919143 for ; Sat, 5 Sep 2009 15:27:27 -0300 (BRT) Received: by ewy26 with SMTP id 26so1647747ewy.5 for ; Sat, 05 Sep 2009 11:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=64Qh85duCrR/vXZiJDy4cfxoMbFOaalyqVfTCbLz4FU=; b=b9DExqQGVj4c9Xt0cDoVcxfKVQS2wPhhJCVB6h9f+gn0XHjIY1fBJflWbehyKuDceZ KY8nOAQIOAukdB7XQQJPlOL0jyF/oGk47QRTd5AsSlgSCLM5tewVWQOeM5N8gmDkU5Wv sCFMWYiVs+EgUs/Bgioc8RLaT2NlkszEPwvbE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rZeJ7GexWHgtG7smPmrwLIOtEP0T1uLWgbmghJ90v4ctf/mkxTDIAfjfJ8hBEhxMBG T2fqwL58W+iOlhsYitKtITQXdA/ZvGAwH12hTrBNOl5nMU1qrcwC6Wqt+DSFFQR/nreW VwHofBARJI8hwTWKj5rf8LstVBivtxbDzhcz4= MIME-Version: 1.0 Received: by 10.216.88.65 with SMTP id z43mr1120346wee.5.1252175243310; Sat, 05 Sep 2009 11:27:23 -0700 (PDT) In-Reply-To: References: Date: Sat, 5 Sep 2009 22:27:23 +0400 Message-ID: Subject: Re: Cloning "preforked" Lua state From: Pavel Shevaev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n85IRqgR000795 > It could be used i.e. with servers, where currently Lua states need either > to be recreated from scratch for each query, or carefully restored to known > "clean" state after finishing a query. Yep, exactly what I need > Maybe code from Lanes can be used to copy the entries of the template state. > I should do some speed tests on that (or do the code and let _you_ run the > speed tests).  ;) Sure, I would happily test it :) P.S. I also asked the same question on the stackoverflow [1] and got an interesting reply where the user "ijprest" recommended me to have a look at LuaJIT(for faster startups) and Rings(for cloning states from within Lua) [1] http://stackoverflow.com/questions/1383768/cloning-lua-state/1383847 -- Best regards, Pavel From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 15:44:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85IiNOX002210; Sat, 5 Sep 2009 15:44:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8F55193A4; Sat, 5 Sep 2009 15:43:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E48019305 for ; Sat, 5 Sep 2009 15:43:51 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mk0En-0005kq-58 for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 15:43:50 -0300 Message-ID: <4AA2B16C.50703@sct.microlink.com.br> Date: Sat, 05 Sep 2009 15:43:56 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> <4AA2967A.5010008@gmail.com> In-Reply-To: <4AA2967A.5010008@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > [snip] > I'm glad that there are solutions being offered like the Makefile > converter, instead of just yakking and yakking like what I am doing. :-) > What would be really useful right now is some sample implementation of > bundling complex modules that integrates nicely into the original > module's codebase. Then again, the sample solution might be perfect for > party X but party Y might jump up and vehemently disagree. And we'll be > back to square one... :-) I agree with you in that it's impossible to satisfy everyone. But we shouldn't make things hard for any party. I think we can all agree that evolving software is easier then the other way around. Taking a complex piece of software and trying to make it simpler is hard because things get too intricate so removing things without breaking the software requires a great amount of work. Lua is simple, and great and complex things are built on top of it, like i.e. Lua for Windows. Lua modules are complex, and the discussions here in the list proves it's hard to make it simple again. I believe libraries should be simple again. They should compile to static libraries and have a clear indication of its dependencies on both other libraries and additional Lua code required to use it. The developer could then just initialize everything in the proper order to have the final product. On top of that, there could be a build system (LuaRocks?) that can take a library and, by using information provided by it, compile it to a dynamic library that could just be required to be used in the host application. That way, both parties (people that builds monolithic Lua platforms i.e. for embedded devices and people on desktops) will be allowed in the, huh, party. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 16:09:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85J9EGe004518; Sat, 5 Sep 2009 16:09:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2910C193D2; Sat, 5 Sep 2009 16:08:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B9D4193C0 for ; Sat, 5 Sep 2009 16:08:43 -0300 (BRT) Received: by pxi13 with SMTP id 13so1594132pxi.10 for ; Sat, 05 Sep 2009 12:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=TrarJZaSBcUa0AKJ+6x4yDMUQASD8jFHyamx5i6QnzE=; b=kEhZAuKiFEgHoDN2Rg3cQ7vE06hmciUrU9YzdhitlRljMnUEV3l5lkasUIqf0qzU3+ nwbUin9s6GAyxIm4Y5feoYGMgY2fXrJ76DFgUaWX792tDQVadQMFjVkZaJZscaNeh5/A 7m0zaZhGrHmpQkJ1xdm5ofmN3YOVbEqAjVedk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=jkX/nVRztvVLfVglxxyTadbi9rDikLtQUkZZDPwtjzItV0Fe7b7js6ZMNRyGkW/1t5 2ZZP44JN9pInwy3rEzIXFChM1UAWQkPL8/KcAgUKbZCg9KE+0zjLERfekSQqqIXXiilZ 2Tog8HIx8QW5vBHkhPHjMYu9wiy33S/3Wgnzg= Received: by 10.114.165.20 with SMTP id n20mr12245438wae.6.1252177721003; Sat, 05 Sep 2009 12:08:41 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.58.172]) by mx.google.com with ESMTPS id 22sm1153791pzk.10.2009.09.05.12.08.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Sep 2009 12:08:40 -0700 (PDT) Message-ID: <4AA2B734.5090908@gmail.com> Date: Sun, 06 Sep 2009 03:08:36 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> <4AA2967A.5010008@gmail.com> <4AA2B16C.50703@sct.microlink.com.br> In-Reply-To: <4AA2B16C.50703@sct.microlink.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre de Leiradella wrote: > KHMan wrote: >> [snip] >> I'm glad that there are solutions being offered like the Makefile >> converter, instead of just yakking and yakking like what I am doing. >> :-) What would be really useful right now is some sample >> implementation of bundling complex modules that integrates nicely into >> the original module's codebase. Then again, the sample solution might >> be perfect for party X but party Y might jump up and vehemently >> disagree. And we'll be back to square one... :-) > > [snip] > That way, both parties (people that builds monolithic Lua platforms i.e. > for embedded devices and people on desktops) will be allowed in the, > huh, party. Arf, don't mind me, my talk is very cheap. Since my position in this is roughly neutral, I'm just here in this thread for the kicks. :-) I believe most people would agree that more flexible build options is a plus. The much harder problem is getting it done. Who's going to do it? What you really need now is a cunning plan[1]... Good luck. . . . [1] Not trying to be disrespectful, this is a rather obvious reference to a British BBC series, for those who did not get it -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 17:35:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85KZL7b012966; Sat, 5 Sep 2009 17:35:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 276E0193D5; Sat, 5 Sep 2009 17:34:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A660E193B9 for ; Sat, 5 Sep 2009 17:34:46 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mk1y9-0002Nn-Nq for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 17:34:45 -0300 Message-ID: <4AA2CB6C.3030308@sct.microlink.com.br> Date: Sat, 05 Sep 2009 17:34:52 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <001901ca2e1a$ff92f950$feb8ebf0$@hind@zen.co.uk> <4AA2967A.5010008@gmail.com> <4AA2B16C.50703@sct.microlink.com.br> <4AA2B734.5090908@gmail.com> In-Reply-To: <4AA2B734.5090908@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > [snip] > Arf, don't mind me, my talk is very cheap. Since my position in this is > roughly neutral, I'm just here in this thread for the kicks. :-) Don't worry. I don't think there are many others who think like me so I'm here also just for the kicks. > I believe most people would agree that more flexible build options is a > plus. The much harder problem is getting it done. Who's going to do it? > What you really need now is a cunning plan[1]... I'd love to give it a try, but I don't know exactly where to start. I'll study the whole package library more deeply and maybe I can come up with some way to replace it with minimum code to make modules think it's still there. Yes, I already know of package.preload, but there are Lua code that must be handled. > Good luck. Thanks. > . . . > > [1] Not trying to be disrespectful, this is a rather obvious reference > to a British BBC series, for those who did not get it > From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 17:36:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85KasA8013164; Sat, 5 Sep 2009 17:36:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73AE4193E3; Sat, 5 Sep 2009 17:36:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 229F2193DC for ; Sat, 5 Sep 2009 17:36:27 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 5so448936qwi.11 for ; Sat, 05 Sep 2009 13:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=lVpuaBYSXp9U3DRHN/rvKvKrTlff703BlATH5HBwmRE=; b=sc4YqcN2PonaLZ02j6KUAKND6UvV4eMp6YIZ6sa6N/Aq+N8UH9E7Xvh5BI03XsEOAA Vdeo8V9LgvHL6VA/N04gvZIMbhZb+sANHmJs72sfVzySeV7bF+g/dKxNRgHtm/CKe5nj rI5kBZteVCFLjQWirJWuaH3Wpf2fk2yrU/A30= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=k0CaK4BpjhAhwuE6t7WbEpiVzKTY3oQgB4SOvUYjOdzuJ++LkBB8S0ngH3YhxXsbwW x/06h9qeQVaQb8tHNZWAsMuN5vWPwHQ3dGG0NO/4tWG96BjhRrbIiV+Uky6w7qOSPD1D 6GpvPkMrfEjCI+CFauElQHrJx/3uHHWbLpFG8= MIME-Version: 1.0 Received: by 10.224.43.70 with SMTP id v6mr6200258qae.375.1252182986696; Sat, 05 Sep 2009 13:36:26 -0700 (PDT) In-Reply-To: <4AA2B16C.50703@sct.microlink.com.br> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <4AA2967A.5010008@gmail.com> <4AA2B16C.50703@sct.microlink.com.br> Date: Sat, 5 Sep 2009 17:36:26 -0300 X-Google-Sender-Auth: 945df493bfa5fdbf Message-ID: <7913df4d0909051336l6e3dc349ife0224ec7312a78e@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On the other hand, you could compile, let's say, LuaSocket, link the .o files in your application, then embed the .lua files along with wrapper code that mimicks require'ing them (with lua2c, for example, or via resources). Compiling .o files and generating the wrapper code could even be somewhat automated from information provided by a rockspec that uses the "builtin" LuaRocks build system. If there are utilities to extract object files from .o files you can even make your utility work on installed rocks, so you do a "luarocks install foo" to install foo and all its dependencies in a rocks tree and then run your tool to "staticify" them. The bottom line is that I think it is easier to go from dynamic modules and require, even if it is not perfect, to static embedding way than the reverse, specially if you want to have a thriving ecosystem of third-party libraries. -- Fabio Mascarenhas On Sat, Sep 5, 2009 at 3:43 PM, Andre de Leiradella wrote: > > > KHMan wrote: >> >> [snip] >> I'm glad that there are solutions being offered like the Makefile >> converter, instead of just yakking and yakking like what I am doing. :-) >> What would be really useful right now is some sample implementation of >> bundling complex modules that integrates nicely into the original module's >> codebase. Then again, the sample solution might be perfect for party X but >> party Y might jump up and vehemently disagree. And we'll be back to square >> one... :-) > > I agree with you in that it's impossible to satisfy everyone. But we > shouldn't make things hard for any party. > > I think we can all agree that evolving software is easier then the other way > around. Taking a complex piece of software and trying to make it simpler is > hard because things get too intricate so removing things without breaking > the software requires a great amount of work. > > Lua is simple, and great and complex things are built on top of it, like > i.e. Lua for Windows. > > Lua modules are complex, and the discussions here in the list proves it's > hard to make it simple again. > > I believe libraries should be simple again. They should compile to static > libraries and have a clear indication of its dependencies on both other > libraries and additional Lua code required to use it. The developer could > then just initialize everything in the proper order to have the final > product. > > On top of that, there could be a build system (LuaRocks?) that can take a > library and, by using information provided by it, compile it to a dynamic > library that could just be required to be used in the host application. > > That way, both parties (people that builds monolithic Lua platforms i.e. for > embedded devices and people on desktops) will be allowed in the, huh, party. > > Cheers, > > Andre > From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 20:36:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n85NZv9M028699; Sat, 5 Sep 2009 20:35:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AE38193B1; Sat, 5 Sep 2009 20:35:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0d.pop-rio.com.br [200.239.251.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B132719398 for ; Sat, 5 Sep 2009 20:35:20 -0300 (BRT) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Mk4mt-0006qW-Iv for lua@bazar2.conectiva.com.br; Sat, 05 Sep 2009 20:35:19 -0300 Message-ID: <4AA2F5BE.7000606@sct.microlink.com.br> Date: Sat, 05 Sep 2009 20:35:26 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <4AA2967A.5010008@gmail.com> <4AA2B16C.50703@sct.microlink.com.br> <7913df4d0909051336l6e3dc349ife0224ec7312a78e@mail.gmail.com> In-Reply-To: <7913df4d0909051336l6e3dc349ife0224ec7312a78e@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabio Mascarenhas wrote: > On the other hand, you could compile, let's say, LuaSocket, link the > .o files in your application, then embed the .lua files along with > wrapper code that mimicks require'ing them (with lua2c, for example, > or via resources). Compiling .o files and generating the wrapper code > could even be somewhat automated from information provided by a > rockspec that uses the "builtin" LuaRocks build system. This looks promising. > If there are utilities to extract object files from .o files you can > even make your utility work on installed rocks, so you do a "luarocks > install foo" to install foo and all its dependencies in a rocks tree > and then run your tool to "staticify" them. > > The bottom line is that I think it is easier to go from dynamic > modules and require, even if it is not perfect, to static embedding > way than the reverse, specially if you want to have a thriving > ecosystem of third-party libraries. Maybe LuaRocks can handle both? You select weather you want a dynamic or a static library, and LuaRocks build it for you. In the case of additional Lua code, LuaRocks could just tell the user that they must be handled manually? Cheers, Andre > -- > Fabio Mascarenhas > > > On Sat, Sep 5, 2009 at 3:43 PM, Andre de > Leiradella wrote: >> >> KHMan wrote: >>> [snip] >>> I'm glad that there are solutions being offered like the Makefile >>> converter, instead of just yakking and yakking like what I am doing. :-) >>> What would be really useful right now is some sample implementation of >>> bundling complex modules that integrates nicely into the original module's >>> codebase. Then again, the sample solution might be perfect for party X but >>> party Y might jump up and vehemently disagree. And we'll be back to square >>> one... :-) >> I agree with you in that it's impossible to satisfy everyone. But we >> shouldn't make things hard for any party. >> >> I think we can all agree that evolving software is easier then the other way >> around. Taking a complex piece of software and trying to make it simpler is >> hard because things get too intricate so removing things without breaking >> the software requires a great amount of work. >> >> Lua is simple, and great and complex things are built on top of it, like >> i.e. Lua for Windows. >> >> Lua modules are complex, and the discussions here in the list proves it's >> hard to make it simple again. >> >> I believe libraries should be simple again. They should compile to static >> libraries and have a clear indication of its dependencies on both other >> libraries and additional Lua code required to use it. The developer could >> then just initialize everything in the proper order to have the final >> product. >> >> On top of that, there could be a build system (LuaRocks?) that can take a >> library and, by using information provided by it, compile it to a dynamic >> library that could just be required to be used in the host application. >> >> That way, both parties (people that builds monolithic Lua platforms i.e. for >> embedded devices and people on desktops) will be allowed in the, huh, party. >> >> Cheers, >> >> Andre >> > > From lua-bounces@bazar2.conectiva.com.br Sat Sep 5 21:57:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n860vJZ4003471; Sat, 5 Sep 2009 21:57:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C801218B6D; Sat, 5 Sep 2009 21:56:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC21E18A5F for ; Sat, 5 Sep 2009 21:56:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so1785531ewy.5 for ; Sat, 05 Sep 2009 17:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZQMG7Q7De15wILAdotyY00RPXDB1NHOJz8QfDAeJfyc=; b=vfX94boC9haaZsWqZQgBRbdhIzdh5lgyU874kqaP1VYgLjGxNUMrkn/qACMBZkZroQ qKRIBQ1ezKhqkvreKWE/rEKD4kQPZyCSTfZFzEFr27ETth5iaE2S9N0QAHgtUVIsZhwH I2i9AbQO0ZBNzewa7vNCuQxoG5b3AC7t+okXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XLEANSZ1Bb+Rxi3s0d025sWpCArtcM8RZkA1NPC6LrLT9G3+B0YhfvqzV/vKCIn7Jj gbV/XIhilaAPyhC0UXwrdem2ISf3Pr08fupaCxON9Ndz385oAqslWnPAyXqBBRcVTCgj RVFUji4VewMV/I2EO+m+J8q9anSIAOynycvZg= MIME-Version: 1.0 Received: by 10.216.8.78 with SMTP id 56mr1217671weq.210.1252198599499; Sat, 05 Sep 2009 17:56:39 -0700 (PDT) In-Reply-To: References: Date: Sat, 5 Sep 2009 20:56:39 -0400 Message-ID: Subject: Re: LuaFileSystem on Windows and character sets From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Tuomo, It seems you need to set current console code page to 65001 using chcp command, see following email discussion. http://www.digitalmars.com/d/archives/digitalmars/D/13971.html Regards Andrew On Fri, Sep 4, 2009 at 12:41 PM, Tuomo Valkonen wrote: > > Is there some way to make LuaFileSystem to use UTF-8 on > Windows? Currently it seems to use some character set > (winlatin1?) that can not represent all the characters > in use: string.len of lfs.dir results equals the length > of the string printed on the console, which is full of > question marks for characters not covered by a single > byte. So the results of lfs.dir seem to be full of > non-existent files. > > > From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 00:32:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n863WDgN017150; Sun, 6 Sep 2009 00:32:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66C311928D; Sun, 6 Sep 2009 00:31:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AF5D19107 for ; Sun, 6 Sep 2009 00:31:35 -0300 (BRT) Received: by ewy11 with SMTP id 11so1607301ewy.35 for ; Sat, 05 Sep 2009 20:31:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.2.19 with SMTP id 19mr14426645ebb.94.1252206074704; Sat, 05 Sep 2009 20:01:14 -0700 (PDT) In-Reply-To: <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> References: <4AA04FA5.5030304@sct.microlink.com.br> <4AA06A9B.3080304@elbitsystems-us.com> <20090904133721.5c5ba79a@trite.i.flarn.net.i.flarn.net> Date: Sat, 5 Sep 2009 23:01:14 -0400 X-Google-Sender-Auth: 00edf7f6cc6e16eb Message-ID: Subject: Re: Wishlists and Modules (was [ANN] libmc) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 8:37 AM, Rob Kendrick wrote: > I think I'd be happier if what LuaRocks was was a system for converting > a description of a Lua module into a package; so RPM, DEB, tar.gz, > Windows MSI, etc. The LuaDist [1-2] project is creating CMake build files (CMakeLists.txt) + rockspec-like files (dist.info) for many modules (>100 so far). The CMakeLists.txt files can used in LuaDist, LuaRocks, or standalone in CMake. Now, CMake has a "cpack" [3-4] utility that can transform those into packages (RPM, DEB, tar.gz, etc., though not currently MSI). Just add this to a CMakeLists.txt file before building: SET(CPACK_GENERATOR "DEB") SET(CPACK_PACKAGE_CONTACT "me") SET(CPACK_PACKAGE_MAINTAINER "me") ..... and add any other CPACK variables derived from the dist.info. .... It may be better if luadist passed them as variables to cmake INCLUDE(CPack) As an initial test, I generated luabitop .deb, .tar.gz, and .rpm packages now just by running cpack directly in the LuaDist "tmp/luabitop-1.0.0.build.cmake" folder (with cleanup=false in config.lua). In practice, this would need much more study, such as [5-6] concerns. [1] http://luadist.org [2] http://lua-users.org/wiki/LuaDist [3] http://www.cmake.org/Wiki/CMake:Packaging_With_CPack [4] http://www.cmake.org/Wiki/CMake:CPackPackageGenerators [5] http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-February/022774.html [6] http://lists.kde.org/?l=kde-buildsystem&m=122065459413486&w=2 From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 02:33:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n865X1mK026984; Sun, 6 Sep 2009 02:33:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBC69192AF; Sun, 6 Sep 2009 02:32:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f184.google.com (mail-pz0-f184.google.com [209.85.222.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E682F19292 for ; Sun, 6 Sep 2009 02:32:23 -0300 (BRT) Received: by pzk14 with SMTP id 14so689735pzk.11 for ; Sat, 05 Sep 2009 22:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=+ga1eeIbBo239bAcyadvdiywP2Y/IUiysHlxnFnbtEw=; b=vtbWhdF0WO9u4AceCs+/9jPI/KRtbfxmnhFrN2VjpmovjbQxVR/GFOlam7Nas7l7Vh +4hDBOvcBvqlM1BJ++KDHj8Du4iPHnqLMcT/Va5Rbr9w5O3iGrp+d381Ops7Zuh/Ld1f pTRzWirJ01eITpDIikSHv6apXBnvDDR4zhH/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=x2QKlF4hxFhf/BaZO94UHqnL8IouNf+QusuMTMx1uhUsviWu9FzkuOvITdBy9nbfL6 DQwp9C71LLvmk1FMbcXmeCUk+DviqNjWl4plErdIEI4k9MXJQj26QRuFMZw+6hjWGsSh vGJ7xwXWGiG2M6YE6pxbS5Nrh4wOA7aYZ0G1w= Received: by 10.114.119.6 with SMTP id r6mr13029092wac.45.1252215141529; Sat, 05 Sep 2009 22:32:21 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.58.172]) by mx.google.com with ESMTPS id 23sm1666320pzk.4.2009.09.05.22.32.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Sep 2009 22:32:21 -0700 (PDT) Message-ID: <4AA34961.90609@gmail.com> Date: Sun, 06 Sep 2009 13:32:17 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: LuaFileSystem on Windows and character sets References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andrew Wilson wrote: > It seems you need to set current console code page to 65001 using chcp > command, see following email discussion. > > http://www.digitalmars.com/d/archives/digitalmars/D/13971.html Not really IIRC. With "chcp 65001", the console works fine in displaying UTF-8, but lfs.dll does not use widechar calls, so it won't work with UTF-8 filenames and directory names. The Apache Portable Runtime on Win32, for example, has to explicitly use the widechar API calls. Are you sure your suggestion works? > On Fri, Sep 4, 2009 at 12:41 PM, Tuomo Valkonen wrote: >> Is there some way to make LuaFileSystem to use UTF-8 on >> Windows? Currently it seems to use some character set >> (winlatin1?) that can not represent all the characters >> in use: string.len of lfs.dir results equals the length >> of the string printed on the console, which is full of >> question marks for characters not covered by a single >> byte. So the results of lfs.dir seem to be full of >> non-existent files. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 07:59:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86Ax18V001841; Sun, 6 Sep 2009 07:59:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDF8E190E0; Sun, 6 Sep 2009 07:58:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4F3F19049 for ; Sun, 6 Sep 2009 07:58:26 -0300 (BRT) Received: by fxm25 with SMTP id 25so1163692fxm.5 for ; Sun, 06 Sep 2009 03:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=eklRR7//bsNo8UyXjmE57SjeHQU4P5NqVPqO11rHq60=; b=ks47EePpsOWDGu5sS9qQbrjL17YXubAsgGW4AH0uyXLQQvCFwudtf34q7nCeIepuhp WqlHuDphKCKT4PXzHPwUOzwqa9qaaMSap/t4J09n8DR1txA4YctXWfmKMZvGyL5uPXzC 2fpMhy74A1NxYHmjS6GGTbX6oXA8lInTWW7Mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sB2w+XrKk4N0sXAo1ZWPWzHsw2/UB/aB3HyoXH54zEEpPZ9gAoqo74Lt+3M+xLjkLS 7AwhlbJeNuHNMC29Z8Ccq+8fjuso4pmeGxugvTjIlYsERTl9L1ilx4VzYNnYdZCvIZSy N4VWe8LH9EnHCd+jRXtqX623IXl9GuZADzcL0= MIME-Version: 1.0 Received: by 10.204.163.5 with SMTP id y5mr10910050bkx.37.1252234704303; Sun, 06 Sep 2009 03:58:24 -0700 (PDT) In-Reply-To: <6688E7C6-69A2-428F-A01F-28A7E91BCADE@verse.org> References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> <6688E7C6-69A2-428F-A01F-28A7E91BCADE@verse.org> Date: Sun, 6 Sep 2009 12:58:24 +0200 Message-ID: <560972290909060358l45724c2bsb887d2f4b26edd79@mail.gmail.com> Subject: Re: Lua FAQ has moved to new location! From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 4, 2009 at 5:16 PM, Jacob Jay wrote: > I'm cross-posting this to the Kepler list, in case anyone there wants to add > to this all-important question for Steve's Lua FAQ. > http://batbytes.com/luafaq Thanks, Jacob! That's exactly the kind of detailed contribution I'm looking for. Any suggestions for 1.33? steve d. From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 10:22:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86DMilc014102; Sun, 6 Sep 2009 10:22:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D02B318EBE; Sun, 6 Sep 2009 10:22:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2831F18C94 for ; Sun, 6 Sep 2009 10:22:04 -0300 (BRT) Received: by ewy26 with SMTP id 26so1987985ewy.5 for ; Sun, 06 Sep 2009 06:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fQzC1VfiVnBBc44piKLN6OeoNbPZrGHHfStYmpn6Z+E=; b=K/ZtLU41Y3Q6Xvupu9m5A0761n5ulQWOJD+0nv4UxqwaVpYy0PfWuYFf+njRbS4vCF oiDTMzhn+mENxHgrMUq+/OUZRg5Bu1m3YFB8xK3YoyqUKCs+/JyNm2/Kmi3wxoRW/Rlh jSz09BzeknIwkZXjUh0BzHOXG7zQwB+/LOj90= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=k2W1Par8YapNisb+TbTMbyb3n9SheLGpAJnGNUpcfv5OzIeDLx4f+iyoSMV2PWKRwn FI/XuynhkRWZgsl70s4pqBsseu7Br/gNRROXCR+aZUr8QAZSZOZJ1LeHOubmsVO+oKki rPVvYhEWOQG/hQdfN+EDldAA3+UKF23kPO/Zc= MIME-Version: 1.0 Received: by 10.216.48.195 with SMTP id v45mr1308652web.123.1252243322772; Sun, 06 Sep 2009 06:22:02 -0700 (PDT) In-Reply-To: <4AA34961.90609@gmail.com> References: <4AA34961.90609@gmail.com> Date: Sun, 6 Sep 2009 09:22:02 -0400 Message-ID: Subject: Re: LuaFileSystem on Windows and character sets From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean To display try chcp 65001, to use UTF-8 you with lfs you probably have to convert UTF-8 to UTF-16 and then use lfs calls. And nope I haven't tried any of this. AGRW On Sun, Sep 6, 2009 at 1:32 AM, KHMan wrote: > Andrew Wilson wrote: >> >> It seems you need to set current console code page to 65001 using chcp >> command, see following email discussion. >> >> http://www.digitalmars.com/d/archives/digitalmars/D/13971.html > > Not really IIRC. With "chcp 65001", the console works fine in displaying > UTF-8, but lfs.dll does not use widechar calls, so it won't work with UTF-8 > filenames and directory names. The Apache Portable Runtime on Win32, for > example, has to explicitly use the widechar API calls. Are you sure your > suggestion works? > >> On Fri, Sep 4, 2009 at 12:41 PM, Tuomo Valkonen wrote: >>> >>> Is there some way to make LuaFileSystem to use UTF-8 on >>> Windows? Currently it seems to use some character set >>> (winlatin1?) that can not represent all the characters >>> in use: string.len of lfs.dir results equals the length >>> of the string printed on the console, which is full of >>> question marks for characters not covered by a single >>> byte. So the results of lfs.dir seem to be full of >>> non-existent files. > > -- > Cheers, > Kein-Hong Man (esq.) > Kuala Lumpur, Malaysia > From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 11:54:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86EsTnF023244; Sun, 6 Sep 2009 11:54:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91FD9192D1; Sun, 6 Sep 2009 11:53:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFBC4192C3 for ; Sun, 6 Sep 2009 11:53:50 -0300 (BRT) Received: by pzk38 with SMTP id 38so1924614pzk.5 for ; Sun, 06 Sep 2009 07:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=DsCI5x6/ybWVNAZNf1UZqQlJ2i8I23wSJykHZaLc+Ro=; b=U9sL4S1kfuZnScfeamuLZ95jsCRFVVxHKqK+WveBM5/24zRXEf03dhpzpLyB2nZJkS vkSI0WOOm4LAgjDP8s6BPcI6DfwFn4kPojQgpf1FUYyEakT+12/cEFG3dNFI1QWSj5+K s4jHSEuLEIrx/IZ6SXNxq8ss4k4PxZPtJQFh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=NeycZmDDTCXA8Ye0NrKKJCBo+On6QuAn8iwXGFPMKgrVN91NCkG9GTKEW7DYvNmctS mCwEMQCvJZP9g3bzqdJllFto4DwYvH8Lt3Z+/Ps/Ce1rzapTLV4W2unR2E+Uz1JXrlbF 8PttKts3GV7NRKgRnlVfVqp2vzT6WS3g7EoMs= Received: by 10.114.243.14 with SMTP id q14mr13729864wah.79.1252248827595; Sun, 06 Sep 2009 07:53:47 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 21sm2031109pzk.7.2009.09.06.07.53.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Sep 2009 07:53:47 -0700 (PDT) Message-ID: <4AA3CCF6.1080305@gmail.com> Date: Sun, 06 Sep 2009 22:53:42 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: LuaFileSystem on Windows and character sets References: <4AA34961.90609@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andrew Wilson wrote: > To display try chcp 65001, to use UTF-8 you with lfs you probably have > to convert UTF-8 to UTF-16 and then use lfs calls. And nope I haven't > tried any of this. AGRW lfs can't use UTF-8 or UTF-16. > On Sun, Sep 6, 2009 at 1:32 AM, KHMan wrote: >> Andrew Wilson wrote: >>> It seems you need to set current console code page to 65001 using chcp >>> command, see following email discussion. >>> >>> http://www.digitalmars.com/d/archives/digitalmars/D/13971.html >> Not really IIRC. With "chcp 65001", the console works fine in displaying >> UTF-8, but lfs.dll does not use widechar calls, so it won't work with UTF-8 >> filenames and directory names. The Apache Portable Runtime on Win32, for >> example, has to explicitly use the widechar API calls. Are you sure your >> suggestion works? >> >>> On Fri, Sep 4, 2009 at 12:41 PM, Tuomo Valkonen wrote: >>>> Is there some way to make LuaFileSystem to use UTF-8 on >>>> Windows? Currently it seems to use some character set >>>> (winlatin1?) that can not represent all the characters >>>> in use: string.len of lfs.dir results equals the length >>>> of the string printed on the console, which is full of >>>> question marks for characters not covered by a single >>>> byte. So the results of lfs.dir seem to be full of >>>> non-existent files. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 12:04:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86F4O3o024316; Sun, 6 Sep 2009 12:04:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 957D118BB2; Sun, 6 Sep 2009 12:03:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E68A218490 for ; Sun, 6 Sep 2009 12:03:53 -0300 (BRT) Received: by ewy26 with SMTP id 26so2022025ewy.5 for ; Sun, 06 Sep 2009 08:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rFSFm01s8GJp2ks5pqxcWWyN9CQqLX+kxB+8szdXRaw=; b=oywGNuhfxuWEKzX8oZ6jBbnee/BpD+2YWLeowT+Y2JHJ7s7m5eFgvi9eMuUlTP6Cwt /RMD0HQmiV+rwPVWrE3WjGC+p2rBxuK9AqgC0bkMTDZ+xf+9FtphJfLnlzqe+WZ0P+8G wY4L/T3mhDd3Vc/ZbRXJYt9Z8UbNHzy1yVmUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=NBFVzv9gFjy9ZkSXzlto0Wi0J7EJn3ZTrPlx0KXzviLn6OTol9DeWAPplmE73Y6CIt y5zaz8JN3/oaldDJzgGhfs0wFfdNXHz0EPuHZQuhaQohiwu/yGkUxYk67f6WZZ3Vp4et k3TJbLKgb5O2pwb72QIEB6TdIUyb9qymH9DfU= MIME-Version: 1.0 Received: by 10.216.26.77 with SMTP id b55mr1374372wea.101.1252249432380; Sun, 06 Sep 2009 08:03:52 -0700 (PDT) In-Reply-To: <4AA3CCF6.1080305@gmail.com> References: <4AA34961.90609@gmail.com> <4AA3CCF6.1080305@gmail.com> Date: Sun, 6 Sep 2009 11:03:52 -0400 Message-ID: Subject: Re: LuaFileSystem on Windows and character sets From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n86F4O3o024316 OK, lfs uses code page character set in Windows OS. So you'll have to do some figuring. Good luck. AGRW On Sun, Sep 6, 2009 at 10:53 AM, KHMan wrote: > Andrew Wilson wrote: >> >> To display try chcp 65001, to use UTF-8 you with lfs you probably have >> to convert UTF-8 to UTF-16 and then use lfs calls. And nope I haven't >> tried any of this.   AGRW > > lfs can't use UTF-8 or UTF-16. > >> On Sun, Sep 6, 2009 at 1:32 AM, KHMan wrote: >>> >>> Andrew Wilson wrote: >>>> >>>> It seems you need to set current console code page to 65001 using chcp >>>> command, see following email discussion. >>>> >>>> http://www.digitalmars.com/d/archives/digitalmars/D/13971.html >>> >>> Not really IIRC. With "chcp 65001", the console works fine in displaying >>> UTF-8, but lfs.dll does not use widechar calls, so it won't work with >>> UTF-8 >>> filenames and directory names. The Apache Portable Runtime on Win32, for >>> example, has to explicitly use the widechar API calls. Are you sure your >>> suggestion works? >>> >>>> On Fri, Sep 4, 2009 at 12:41 PM, Tuomo Valkonen wrote: >>>>> >>>>> Is there some way to make LuaFileSystem to use UTF-8 on >>>>> Windows? Currently it seems to use some character set >>>>> (winlatin1?) that can not represent all the characters >>>>> in use: string.len of lfs.dir results equals the length >>>>> of the string printed on the console, which is full of >>>>> question marks for characters not covered by a single >>>>> byte. So the results of lfs.dir seem to be full of >>>>> non-existent files. > > -- > Cheers, > Kein-Hong Man (esq.) > Kuala Lumpur, Malaysia > > From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 12:07:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86F75VO024619; Sun, 6 Sep 2009 12:07:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 003B7192E9; Sun, 6 Sep 2009 12:06:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F541184EF for ; Sun, 6 Sep 2009 12:06:40 -0300 (BRT) Received: from [93.172.58.122] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KPK00G781Z0GH30@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Sun, 06 Sep 2009 18:06:36 +0300 (IDT) Date: Sun, 06 Sep 2009 18:06:32 +0300 From: Shmuel Zeigerman Subject: Re: LuaFileSystem on Windows and character sets In-reply-to: <4AA3CCF6.1080305@gmail.com> To: Lua list Message-id: <4AA3CFF8.6030407@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4AA34961.90609@gmail.com> <4AA3CCF6.1080305@gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean KHMan wrote: > Andrew Wilson wrote: >> To display try chcp 65001, to use UTF-8 you with lfs you probably have >> to convert UTF-8 to UTF-16 and then use lfs calls. And nope I haven't >> tried any of this. AGRW > > lfs can't use UTF-8 or UTF-16. On Windows, Quylthulg [1] has all the functionality of lfs and supports UTF-8 / UTF16. [1] http://luaforge.net/projects/quylthulg/ -- Shmuel From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 12:18:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86FIEHs025744; Sun, 6 Sep 2009 12:18:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC36A188A4; Sun, 6 Sep 2009 12:17:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 666B318822 for ; Sun, 6 Sep 2009 12:17:48 -0300 (BRT) Received: by vws33 with SMTP id 33so1439732vws.33 for ; Sun, 06 Sep 2009 08:17:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.218 with SMTP id m26mr4859166vck.30.1252250266260; Sun, 06 Sep 2009 08:17:46 -0700 (PDT) In-Reply-To: References: From: Phoenix Sol Date: Sun, 6 Sep 2009 10:17:26 -0500 Message-ID: <8a25d01b0909060817s9fdb4a1gf1ce8022de4fec55@mail.gmail.com> Subject: Re: Cloning "preforked" Lua state To: Lua list Content-Type: multipart/alternative; boundary=001636284fd84a54c00472ea3c9c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636284fd84a54c00472ea3c9c Content-Type: text/plain; charset=ISO-8859-1 > > From http://stackoverflow.com/questions/1383768/cloning-lua-state/1383847 > I was thinking about using coroutines however I'm afraid a fatal error in > one coroutine will affect others that's why it's not option atm. Thanks for > the links! I'm currently looking at LuaJIT and Rings. Rings seems to be a > possible solution for my problem. > > What can an error do inside a coroutine (a lua_State created with lua_newthread), that it could not do inside a lua_State created with lua_newstate? lua_newthread gives you a garbage collected lua_State with all the globals of your original state. Is this not what you want? Asko, why would a server want to call lua_newstate or luaL_newstate for each request, instead of lua_newthread? Please tell me what I'm missing here. --001636284fd84a54c00472ea3c9c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>From http://stackoverflow.com/questions/1383768/clo= ning-lua-state/1383847
=20
I was thinking about using coroutines however I'm afraid a fatal error in one coroutine will affect others that's why it's not option atm. Thanks= for the links! I'm currently looking at LuaJIT and Rings. Rings seems to be a possible solution for my problem.=A0



What can an error do inside a coroutine (a lua_State created wi= th lua_newthread), that it could not do inside a lua_State created with lua= _newstate?

lua_newthread gives you a garbage collected lua_State with all the glob= als of your original state. Is this not what you want?

Asko, why wou= ld a server want to call lua_newstate or luaL_newstate for each request, in= stead of lua_newthread?

Please tell me what I'm missing here.

--001636284fd84a54c00472ea3c9c-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 12:21:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86FLjhP026121; Sun, 6 Sep 2009 12:21:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAFAF1890C; Sun, 6 Sep 2009 12:21:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1495D1883D for ; Sun, 6 Sep 2009 12:21:17 -0300 (BRT) Received: by pzk38 with SMTP id 38so1933231pzk.5 for ; Sun, 06 Sep 2009 08:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=7njelw1N//lVzGNDW/bGrmbryCtuFXngY1D9aWfy1YE=; b=tTWKy46icjkk0Mjexxv0QfyEfnpIVkkIWIkco0vlbGjiL62RcMdPNJ7LNR9wxFEMV3 C+VlVNoWn1JrGG0nM7XQ864qQA/6OgV/eKqhDq/jlroXZTWI8w4MHolJfQaTmGM75/Bq bQOZZ/96RaidmE7ijZz3IUOpEA5SkLoIMJmwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=xkPI7olGCZDAI/r2q8cYSyeZnNUu6+N4mQmKUJQxn1imGT5rVAk0YqUxqB/zw8xPH/ qTBYb7cjqjphDRSmWAmwuIGytqoim/zsPXJ7VWOP33xOYTWm+4ui5lym7SsdHVilUbwd Ckl2uzxpocsmWS+H3+ImrSlpCFFNi5fDJ0+Rc= Received: by 10.141.43.18 with SMTP id v18mr753893rvj.289.1252250475739; Sun, 06 Sep 2009 08:21:15 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 23sm2033034pzk.12.2009.09.06.08.21.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Sep 2009 08:21:15 -0700 (PDT) Message-ID: <4AA3D367.9070303@gmail.com> Date: Sun, 06 Sep 2009 23:21:11 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: LuaFileSystem on Windows and character sets References: <4AA34961.90609@gmail.com> <4AA3CCF6.1080305@gmail.com> <4AA3CFF8.6030407@013net.net> In-Reply-To: <4AA3CFF8.6030407@013net.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman wrote: > KHMan wrote: >> Andrew Wilson wrote: >>> To display try chcp 65001, to use UTF-8 you with lfs you probably have >>> to convert UTF-8 to UTF-16 and then use lfs calls. And nope I haven't >>> tried any of this. AGRW >> >> lfs can't use UTF-8 or UTF-16. > > On Windows, Quylthulg [1] has all the functionality of lfs and supports > UTF-8 / UTF16. > > [1] http://luaforge.net/projects/quylthulg/ UTF-8 only, also it's rather hastily hacked together and may be overhauled at any time... there are stuff I don't fully trust in there, but I have been using it to synchronize to Flash drives and external HDDs for several months now. I would rather a more mainstream module like LuaFileSystem pick up support for Unicode; this would ensure at least some level of long-term support or dependability. Another way would be to run Lua on Cygwin 1.7... it should work I suppose but I haven't gotten around installing Cygwin 1.7 yet. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 12:27:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86FRV74026609; Sun, 6 Sep 2009 12:27:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F96118959; Sun, 6 Sep 2009 12:27:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from eastrmmtao104.cox.net (eastrmmtao104.cox.net [68.230.240.46]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A2AC188CE for ; Sun, 6 Sep 2009 12:27:03 -0300 (BRT) Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao104.cox.net (InterMail vM.8.00.01.00 201-2244-105-20090324) with ESMTP id <20090906152702.ESKZ11036.eastrmmtao104.cox.net@eastrmimpo02.cox.net> for ; Sun, 6 Sep 2009 11:27:02 -0400 Received: from [127.0.0.1] ([98.169.61.33]) by eastrmimpo02.cox.net with bizsmtp id dTT11c0080j1tfm02TT12Q; Sun, 06 Sep 2009 11:27:02 -0400 X-VR-Score: -30.00 X-Authority-Analysis: v=1.0 c=1 a=lxvdRO3VAAAA:8 a=IioiCX30u6UI_KEd8i4A:9 a=rQzwkh70Ll1xDZSFyx6-wN5kIOgA:4 X-CM-Score: 0.00 Message-ID: <4AA3D4C0.4000005@cox.net> Date: Sun, 06 Sep 2009 11:26:56 -0400 From: Olivier Hamel User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: LuaJIT - Bitwise Operators References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> In-Reply-To: <20090809150322.GA14154@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Idly browsing the internet I found a Lua module which said LuaJIT2 would have built in bitwise ops: http://git.exherbo.org/summer/packages/dev-lua/LuaBitOp/index.html Does anyone know if they're still planned and if there are metaoperators for them as well, or if they've been cut in favour of vanilla Lua? Or was this page entirely incorrect to begin with? From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 13:14:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86GEWkW031190; Sun, 6 Sep 2009 13:14:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89CA518A0C; Sun, 6 Sep 2009 13:14:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id CB36B189F4 for ; Sun, 6 Sep 2009 13:13:59 -0300 (BRT) Received: (qmail invoked by alias); 06 Sep 2009 16:13:57 -0000 Received: from f053081111.adsl.alicedsl.de (EHLO [192.168.1.103]) [78.53.81.111] by mail.gmx.net (mp009) with SMTP; 06 Sep 2009 18:13:57 +0200 X-Authenticated: #3468078 X-Provags-ID: V01U2FsdGVkX19nZClVKApniD4ctXXti4bOzp7wwDiXD2j1hiqTQN iIPc0yqeNNzQrU Message-ID: <4AA3DFF4.5070706@gmx.de> Date: Sun, 06 Sep 2009 18:14:44 +0200 From: Andreas Krinke User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: [ANN] Scrupp v0.4 released X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello list! I'm pleased to announce the release of Scrupp v0.4. Scrupp is a cross-platform 2D engine written in C which uses SDL and OpenGL for visualization and is controlled by external Lua scripts. The core supports various image, sound, music and font formats. Plug-ins written in Lua create support for more complex stuff like animations and timers. Scrupp is free software and is available under the same terms and conditions as the Lua language, the MIT license. It is available for Windows, Linux and Mac OS X (32 Bit universal binary). The main new features in this release are: 1. The inclusion of the cairo binding lua-oocairo by Geoff Richards. The original website of this binding is no longer available, but Scrupp includes the complete source and documentation. This binding enables runtime image creation. 2. The inclusion of LuaSocket by Diego Nehab. 3. The support of MPEG-1 videos. Further changes: - using autotools for easier compilation and installation on Linux - text interface supports UTF8 strings (Michal Kolodziejczyk) - Lua commands 'dofile' and 'require' support the virtual filesystem - new functions to manipulate the OpenGL state: translate, scale, rotate, save, restore and reset the state - support for image loading from strings (e.g. received via network) Homepage: http://scrupp.sourceforge.net -- Regards, Andreas From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 13:27:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86GRFOj000775; Sun, 6 Sep 2009 13:27:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 721D818B6F; Sun, 6 Sep 2009 13:26:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1E20318B1F for ; Sun, 6 Sep 2009 13:26:45 -0300 (BRT) Received: (qmail 19211 invoked by uid 0); 6 Sep 2009 16:26:41 -0000 Received: from -unknown- by www-us009.v300.gmx.net with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary5591252254400605134" Date: Sun, 06 Sep 2009 11:39:15 -0400 From: Michael Surette Message-ID: <20090906162640.5590@gmx.com> MIME-Version: 1.0 Subject: Re: Cloning "preforked" Lua state To: "Lua list" X-Authenticated: #45466942 X-Flags: 0001 X-Mailer: GMX.com Web Mailer X-GMX-UID: oY7IImZX6ECzI1agwmprWgxOU2poZdkr X-FuHaFi: 0.64 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --========GMXBoundary5591252254400605134 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary5591252254400605134 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

----- Original Message -----

Fro= m: Phoenix Sol

Sent: 09/06/09 11:17 am

To: Lua list

Subje= ct: Re: Cloning "preforked" Lua state

 

>>From http://stackoverflow.com/ques= tions/1383768/cloning-lua-state/1383847
= I was thinking about using coroutines however I'm afraid a fatal error in o= ne coroutine will affect others that's why it's not option atm. Thanks for = the links! I'm currently looking at LuaJIT and Rings. Rings seems to be a p= ossible solution for my problem. 



What can an = error do inside a coroutine (a lua_State created with lua_newthread), that = it could not do inside a lua_State created with lua_newstate?

lua_ne= wthread gives you a garbage collected lua_State with all the globals of you= r original state. Is this not what you want?

Asko, why would a serve= r want to call lua_newstate or luaL_newstate for each request, instead of l= ua_newthread?

Please tell me what I'm missing here.

<= /div>

 

All threads would use the same ***inst= ance*** of all globals, so if you save something in a global variable in on= e thread, it affects all threads.  This is a very undesirable trait in= server threads.  If you forget to make a variable local and write to = it you have a problem.  This then gives us the the problem of context,= that is saving state from one subroutine call to another in a given thread= .  You can't use globals.  In the past I've used per-thread table= s that I pass to all subroutines, which works, but this idea of cloning thr= eads sounds like it might be a more natural feeling solution to this proble= m.


Mike


--========GMXBoundary5591252254400605134-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 13:54:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86GsDoP003569; Sun, 6 Sep 2009 13:54:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DF24189F8; Sun, 6 Sep 2009 13:53:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B3D11897E for ; Sun, 6 Sep 2009 13:53:42 -0300 (BRT) Received: by vws33 with SMTP id 33so1460005vws.33 for ; Sun, 06 Sep 2009 09:53:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.107.163 with SMTP id b35mr2510283vcp.74.1252256020163; Sun, 06 Sep 2009 09:53:40 -0700 (PDT) In-Reply-To: <20090906162640.5590@gmx.com> References: <20090906162640.5590@gmx.com> From: Phoenix Sol Date: Sun, 6 Sep 2009 11:53:20 -0500 Message-ID: <8a25d01b0909060953n127361fat97b7730fb7316fe0@mail.gmail.com> Subject: Re: Cloning "preforked" Lua state To: Lua list Content-Type: multipart/alternative; boundary=00c09f905ab33feeab0472eb93ef X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f905ab33feeab0472eb93ef Content-Type: text/plain; charset=ISO-8859-1 All threads would use the same ***instance*** of all globals, so if you save > something in a global variable in one thread, it affects all threads. This > is a very undesirable trait in server threads. If you forget to make a > variable local and write to it you have a problem. > I hate to say it, but I think that this is a flaw with Lua. Most of the time you want to declare locals, and that should be the default. Compare the usage frequency of Lua's 'local' keyword to Python's 'global' keyword; the difference is very significant. > This then gives us the the problem of context, that is saving state from > one subroutine call to another in a given thread. You can't use globals. > In the past I've used per-thread tables that I pass to all subroutines, > which works, but this idea of cloning threads sounds like it might be a more > natural feeling solution to this problem. > Sorry, by "thread" do you mean kernel thread or Lua coroutine. This is another thing that irks me, the confusion of terminalogy surrounding Lua's coroutine support; A coroutine is alternately described as a coroutine or a thread, and is of type lua_State. This is confusing to sort out at first, and impedes communication in the case where there is even a slight ambiguity of context. And then you said, "cloning threads". I thought we were discussing cloning lua_States (sigh) which are not coroutines. --00c09f905ab33feeab0472eb93ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

All threads would use the sam= e ***instance*** of all globals, so if you save something in a global varia= ble in one thread, it affects all threads.=A0 This is a very undesirable tr= ait in server threads.=A0 If you forget to make a variable local and write = to it you have a problem.

I hate to say it, but I think that this is a flaw wit= h Lua. Most of the time you want to declare locals, and that should be the = default. Compare the usage frequency of Lua's 'local' keyword t= o Python's 'global' keyword; the difference is very significant= .
=A0
Thi= s then gives us the the problem of context, that is saving state from one s= ubroutine call to another in a given thread.=A0 You can't use globals.= =A0 In the past I've used per-thread tables that I pass to all subrouti= nes, which works, but this idea of cloning threads sounds like it might be = a more natural feeling solution to this problem.

Sorry, by "thread" do you mean kernel thre= ad or Lua coroutine. This is another thing that irks me, the confusion of t= erminalogy surrounding Lua's coroutine support; A coroutine is alternat= ely described as a coroutine or a thread, and is of type lua_State. This is= confusing to sort out at first, and impedes communication in the case wher= e there is even a slight ambiguity of context.

And then you said, "cloning threads". I thought we were discu= ssing cloning lua_States (sigh) which are not coroutines.

--00c09f905ab33feeab0472eb93ef-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 14:10:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86HAVg2005222; Sun, 6 Sep 2009 14:10:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18A6118C79; Sun, 6 Sep 2009 14:10:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9799018BCD for ; Sun, 6 Sep 2009 14:10:03 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id A7A81EF4F0 for ; Sun, 6 Sep 2009 20:10:00 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A01A709CD72; Sun, 06 Sep 2009 20:10:00 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 229564045 for ; Sun, 6 Sep 2009 20:09:54 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <8a25d01b0909060817s9fdb4a1gf1ce8022de4fec55@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Cloning "preforked" Lua state Date: Sun, 6 Sep 2009 20:09:52 +0300 References: <8a25d01b0909060817s9fdb4a1gf1ce8022de4fec55@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Maybe this comes to myself not being so at ease with coroutine coding. Maybe the best way to do the server I've been involved with is using coroutines. Or a combination of the two, so that each core of a multicore processor gets its share of the workload. That -at least- is something a coroutine approach by itself cannot do. -asko Phoenix Sol kirjoitti 6.9.2009 kello 18:17: > >From http://stackoverflow.com/questions/1383768/cloning-lua-state/1383847 > I was thinking about using coroutines however I'm afraid a fatal > error in one coroutine will affect others that's why it's not option > atm. Thanks for the links! I'm currently looking at LuaJIT and > Rings. Rings seems to be a possible solution for my problem. > > > > What can an error do inside a coroutine (a lua_State created with > lua_newthread), that it could not do inside a lua_State created with > lua_newstate? > > lua_newthread gives you a garbage collected lua_State with all the > globals of your original state. Is this not what you want? > > Asko, why would a server want to call lua_newstate or luaL_newstate > for each request, instead of lua_newthread? > > Please tell me what I'm missing here. > From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 14:39:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86HdmWx008024; Sun, 6 Sep 2009 14:39:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31C9118CD2; Sun, 6 Sep 2009 14:39:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F229E18B12 for ; Sun, 6 Sep 2009 14:39:14 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e12so495100fga.17 for ; Sun, 06 Sep 2009 10:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=qm1eDhWeq3SVQwHfGNtNl6OuOGCEXHoEJ4lAdnhRpb4=; b=ODH0d6RxIPlHOepb7A+ZsMlx6bmXuvaivKNqMt2+Co4l+SrNMGAe6RHH56nb7U2AIm UgzB+x7hy78pLEC8ugHeYqowyAHRdRFE4XETcbk43f5lC7QP4uDjKs8hEFfu8A1wxQtz X/oKTGUZrMHQDiLKVwvXegQBQEq6EaW4MQfPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=FrekBn60Wspd/cE1qj7p23nI+p2suRdZkamVcrtLYGe0l2BrLMoLNNBNSQbi41k0Z7 XwhSWhV41NEi3s0g7UnD0nRgJzNQjlh+0G8+7nGylUNwQtWf+Rr80WBdRW5s8dpjbqDo N6IjsYWk5HY9HnVrmt0SA4yBrFvuw4VmERQzA= Received: by 10.86.240.9 with SMTP id n9mr7105834fgh.70.1252258751769; Sun, 06 Sep 2009 10:39:11 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.84.201]) by mx.google.com with ESMTPS id e20sm7010448fga.20.2009.09.06.10.39.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Sep 2009 10:39:10 -0700 (PDT) Message-Id: <20EFC3CF-8F13-4F68-A2A4-5FC7D7F57AFA@verse.org> From: Jacob Jay To: Lua list In-Reply-To: <560972290909060358l45724c2bsb887d2f4b26edd79@mail.gmail.com> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Lua FAQ has moved to new location! Date: Sun, 6 Sep 2009 23:09:04 +0530 References: <560972290909040054p4b7f50c0h46ba7fcead332a9c@mail.gmail.com> <6688E7C6-69A2-428F-A01F-28A7E91BCADE@verse.org> <560972290909060358l45724c2bsb887d2f4b26edd79@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n86HdmWx008024 On 6 Sep 2009, at 4:28 PM, steve donovan wrote: > Any suggestions for 1.33? I have no experience on that point, but can propose the following… -- 1.33 Is Lua suitable for embedding in a program? One of Lua's most appreciated uses is in exposing select internal routines through Lua's efficient interpreter, such that users and developers may extend and customise an application's functionality. Lua is also an ideal candidate for modular cross-platform code within an application, or across its components. Applications that use Lua in these ways include Adobe Lightroom, World-of-Warcraft, VLC, Lighttpd, and more. Integrating with C/C++ is especially easy (see 4.4 or Simple API Example), whilst bi-directional bindings for many popular languages and frameworks are also available (see Binding Code To Lua). -- I've cited app examples because I believe it's worthwhile establishing credentials. Incidentally shouldn't this FAQ eventually be merged with / replace the lua-users.org FAQ? From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 14:40:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86HecWm008148; Sun, 6 Sep 2009 14:40:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADDCD18D1B; Sun, 6 Sep 2009 14:40:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id D2F7618CE2 for ; Sun, 6 Sep 2009 14:40:09 -0300 (BRT) Received: (qmail 30424 invoked by uid 0); 6 Sep 2009 17:40:06 -0000 Received: from -unknown- by www-us009.v300.gmx.net with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary5581252258804944304" Date: Sun, 06 Sep 2009 13:12:28 -0400 From: Michael Surette Message-ID: <20090906174004.5580@gmx.com> MIME-Version: 1.0 Subject: Re: Cloning "preforked" Lua state To: "Lua list" X-Authenticated: #45466942 X-Flags: 0001 X-Mailer: GMX.com Web Mailer X-GMX-UID: kILKJVw6lTXuDGmQ32hlUzJjaGRhZpoc X-FuHaFi: 0.65 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --========GMXBoundary5581252258804944304 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary5581252258804944304 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

----- Original Message -----

From: Phoenix Sol

=

Sent: 09/06/09 12:53 pm

To: Lua list

Subject: Re: Cloning "p= reforked" Lua state

 

All threads would use the same ***instanc= e*** of all globals, so if you save something in a global variable in one t= hread, it affects all threads.  This is a very undesirable trait in se= rver threads.  If you forget to make a variable local and write to it = you have a problem.

I hate to say it, but I= think that this is a flaw with Lua. Most of the time you want to declare l= ocals, and that should be the default. Compare the usage frequency of Lua's= 'local' keyword to Python's 'global' keyword; the difference is very signi= ficant.

 

This then gives us the the problem of con= text, that is saving state from one subroutine call to another in a given t= hread.  You can't use globals.  In the past I've used per-thread = tables that I pass to all subroutines, which works, but this idea of clonin= g threads sounds like it might be a more natural feeling solution to this p= roblem.

Sorry, by "thread" do= you mean kernel thread or Lua coroutine. This is another thing that irks m= e, the confusion of terminalogy surrounding Lua's coroutine support; A coro= utine is alternately described as a coroutine or a thread, and is of type l= ua_State. This is confusing to sort out at first, and impedes communication= in the case where there is even a slight ambiguity of context.

And = then you said, "cloning threads". I thought we were discussing cloning lua_= States (sigh) which are not coroutines.

<= p> 

The local/global default issue has been discussed before and is= n't likely to change.

Sorry for the confusion about threads.  I= did use the word in different contexts.  I was speaking mainly of pro= cessor threads, which Lua doesn't support, but it can work if you're carefu= l.  Having an easy way around the issues surrounding processor threads= has also been discussed before, with some interesting ideas thrown around.=

Yes, cloning threads, which meant cloning lua_States, is another on= e of those interesting ideas.  Somehow I've never looked at Rings, whi= ch seems to do what's needed.


Mike=


--========GMXBoundary5581252258804944304-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 14:43:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86HhTXL008432; Sun, 6 Sep 2009 14:43:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2452918D02; Sun, 6 Sep 2009 14:43:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A8D818C83 for ; Sun, 6 Sep 2009 14:43:03 -0300 (BRT) Received: by ewy26 with SMTP id 26so2078068ewy.5 for ; Sun, 06 Sep 2009 10:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GuVKJBLWZrM6T0a9q7yJbzNB1JmVZr5snESY2k0XI9Q=; b=BXLvC20PtUz/ynLcFuIK5aCmU+dCGBG82GPTeSJ3ydL7Yf/KgfcJmavFgbkWZB140G w8FKLymbJswAZnwtY6V+yke9wy0CwyExZZRy2v33XJppNovYQOJZ13exu7QhNQo/kklW 9UZW+0yaoYjmRGLPkFL6Nxgu2XV5qxS23i+1g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Vd0M2LeUe54EDuAQO1YeNzvItwG6qiDsRDsQh5w8yHcvs5y0m0nwl+NpqBYx1bu+Ym cX0SC+Hnptbs6csHosvjuTVOFol9OGbbwpl54C1T4LPNl8IbSMiUXlhs29j5ukm6Vmc0 YAfL6XaR3yN+ZthdSvPS152R2FzXq8hUtfDLk= MIME-Version: 1.0 Received: by 10.216.8.83 with SMTP id 61mr1289750weq.156.1252258982379; Sun, 06 Sep 2009 10:43:02 -0700 (PDT) In-Reply-To: <8a25d01b0909060953n127361fat97b7730fb7316fe0@mail.gmail.com> References: <20090906162640.5590@gmx.com> <8a25d01b0909060953n127361fat97b7730fb7316fe0@mail.gmail.com> Date: Sun, 6 Sep 2009 18:43:02 +0100 Message-ID: Subject: Re: Cloning "preforked" Lua state From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n86HhTXL008432 On Sun, Sep 6, 2009 at 5:53 PM, Phoenix Sol wrote: >> All threads would use the same ***instance*** of all globals, so if you >> save something in a global variable in one thread, it affects all threads. >> This is a very undesirable trait in server threads.  If you forget to make a >> variable local and write to it you have a problem. > > I hate to say it, but I think that this is a flaw with Lua. Most of the time > you want to declare locals, and that should be the default. Unfortunately, it turns out local-by-default would cause more problems than it would solve, due to Lua's scoping. Mike Pall's post about it here is probably the best summary: http://lua-users.org/lists/lua-l/2005-08/msg00139.html There's also a page on the Lua Users' Wiki: http://lua-users.org/wiki/LocalByDefault -Duncan From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 15:10:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86IA21E011035; Sun, 6 Sep 2009 15:10:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21C0518BF7; Sun, 6 Sep 2009 15:09:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61396187C4 for ; Sun, 6 Sep 2009 15:09:32 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MkMB8-00031Y-6L for lua@bazar2.conectiva.com.br; Sun, 06 Sep 2009 20:09:30 +0200 Received: from p5b2c1eb4.dip.t-dialin.net ([91.44.30.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Sep 2009 20:09:30 +0200 Received: from dak by p5b2c1eb4.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Sep 2009 20:09:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Cloning "preforked" Lua state Date: Sun, 06 Sep 2009 20:09:08 +0200 Organization: Organization?!? Lines: 14 Message-ID: <87zl98rlmj.fsf@lola.goethe.zz> References: <8a25d01b0909060817s9fdb4a1gf1ce8022de4fec55@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c1eb4.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:ZEMIgadTL//3WNZsqyFI42StZEw= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Asko Kauppi writes: > Maybe this comes to myself not being so at ease with coroutine > coding. Maybe the best way to do the server I've been involved with is > using coroutines. Consider coroutines as pretty much the same as subroutines. The principal difference is that they don't give up stack, instruction pointer and local variables (the dynamic execution context) while returning execution control and return values. They pass the buck without passing away. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 15:50:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86Io8Q3015494; Sun, 6 Sep 2009 15:50:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28BBF18C94; Sun, 6 Sep 2009 15:49:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f193.google.com (mail-yw0-f193.google.com [209.85.211.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51BEE18C14 for ; Sun, 6 Sep 2009 15:49:36 -0300 (BRT) Received: by ywh32 with SMTP id 32so435591ywh.11 for ; Sun, 06 Sep 2009 11:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Wp6HFDUnelYSi5KPqH62e5TsdpievNS7fEAlfMGoLUg=; b=CQ0/46qRl2FcVp8DBNUkJTnAbh3k7TyeSJ5k1Ngt7d4pVOMp9XILp19ij0Dpk6DzQj RV4d+Y2vAnHcQDQe1rwZoQUBiRfOq15Ta65xKlrF5GrZi6whHmzCm19iKL9ig3CK0h+i ktrtVM6hCgqIBKcHoe8pjUBdo1LCWxlMp4S5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=d224rLPGH09Ns5hjG+cU5AOQa2mslEC6FcEC5eQnXO0wA1OiVvDQZO1QjMQHYuWIVd QAl5FYEiDbXtdumSbZZfaOQisZVepvxD4MrYCdn9JD0hcjGpw5+zcGYkh5+gDkBtVR4y Siyqlwjdpawu7pQcObxTw3p9XJbCHlr2YM07M= MIME-Version: 1.0 Received: by 10.150.164.4 with SMTP id m4mr22377149ybe.140.1252262974310; Sun, 06 Sep 2009 11:49:34 -0700 (PDT) In-Reply-To: <87zl98rlmj.fsf@lola.goethe.zz> References: <8a25d01b0909060817s9fdb4a1gf1ce8022de4fec55@mail.gmail.com> <87zl98rlmj.fsf@lola.goethe.zz> Date: Sun, 6 Sep 2009 14:49:34 -0400 Message-ID: Subject: Re: Cloning "preforked" Lua state From: Scott Vokes To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n86Io8Q3015494 On Sun, Sep 6, 2009 at 2:09 PM, David Kastrup wrote: > Consider coroutines as pretty much the same as subroutines.  The > principal difference is that they don't give up stack, instruction > pointer and local variables (the dynamic execution context) while > returning execution control and return values.  They pass the buck > without passing away. There's also a VM patch from Mike Pall that adds a coroutine.clone[1] function. (Any chance that will ever become part of the core language?) I haven't used it for anything very serious yet, but it could potentially be very useful. [1]: http://lua-users.org/lists/lua-l/2006-01/msg00652.html , and note the minor correction in the followup e-mail. -- Scott From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 18:31:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86LVOov030014; Sun, 6 Sep 2009 18:31:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2DB21897E; Sun, 6 Sep 2009 18:30:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72EBC1892D for ; Sun, 6 Sep 2009 18:30:48 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id BAC69089; Sun, 6 Sep 2009 17:30:46 -0400 (EDT) Received: (from mymail.erau.edu [70.119.100.122]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id APN62123 (AUTH delbu9c1); Sun, 6 Sep 2009 17:30:46 -0400 (EDT) From: Matthew Paul Del Buono Subject: [PATCH] Lua Leak in OS Library To: lua@bazar2.conectiva.com.br X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090906173046.APN62123@mymail.erau.edu> Date: Sun, 6 Sep 2009 17:30:46 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi list, During discussion on IRC today we clarified a (relatively benign) memory leak I've been noticing for a while, bug ignoring. While the leak is simply due to a direct call to the exit() function during os.exit(), I feel that the leak should still be handled because it is unclean and is trivial to correct. Is it necessary? It's debatable. The leak is not one that would be impacted by prolonged execution. It only shows itself because the Lua state is not closed when os.exit() is called. To reproduce this issue: $ valgrind lua -e 't = {} for x=1,1000 do t[x] = {} end os.exit()' ==27928== LEAK SUMMARY: ==27928== still reachable: 61,796 bytes in 1,397 blocks. We can see that this is due to Lua's state and not something else like the command line being longer because adding a single character produces a dramatically changed result: $ valgrind lua -e 't = {} for x=1,10000 do t[x] = {} end os.exit()' ==27937== LEAK SUMMARY: ==27937== still reachable: 534,116 bytes in 10,397 blocks. As discussed earlier, the issue is due to os.exit() immediately terminating the program without cleaning up. An obvious solution is to allow it to clean up. I developed the following patch for this situation: $ diff -u ./lua-5.1.4/src/loslib.c ./lua-5.1.4- corrected/src/loslib.c --- ./lua-5.1.4/src/loslib.c 2008-01-18 11:38:18.000000000 -0500 +++ ./lua-5.1.4-corrected/src/loslib.c 2009-09-06 16:55:16.000000000 -0400 @@ -214,7 +214,9 @@ static int os_exit (lua_State *L) { - exit(luaL_optint(L, 1, EXIT_SUCCESS)); + int code = luaL_optint(L, 1, EXIT_SUCCESS); + lua_close(L); + exit(code); } static const luaL_Reg syslib[] = { We see that the issue is corrected: $ valgrind ./lua -e 't = {} for x=1,10000 do t[x] = {} end os.exit()' ==29175== All heap blocks were freed -- no leaks are possible. However, there is valid concern regarding this patch. Is it safe for Lua to close its own state during a call? Naturally, if this function were to exit, the system would become unstable as it would begin executing in a closed state, but ANSI C defines exit() as never returning, so this should be a non-issue. An alternative approach is to assume that it is not Lua's job to do this, but rather the enclosing application's. As such, this means it's not Lua's fault for failing to clean up, but rather the interpreter's. An alternative solution would be to have the interpreter write its own os.exit() to close the state and then exit. While this puts the control in the application developers' hands, I feel it's a less suitable solution because it would mean duplicated code for everyone that wishes to handle this situation. I would like to think that, while this is a benign issue, it's one that should be corrected. Does anyone see any problems with the patch above? Regards, -- Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 18:40:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86LeqSu030892; Sun, 6 Sep 2009 18:40:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB53E18CD5; Sun, 6 Sep 2009 18:40:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D41C818994 for ; Sun, 6 Sep 2009 18:40:23 -0300 (BRT) Received: by ewy26 with SMTP id 26so2162103ewy.5 for ; Sun, 06 Sep 2009 14:40:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.26.206 with SMTP id c56mr1334802wea.45.1252273221635; Sun, 06 Sep 2009 14:40:21 -0700 (PDT) In-Reply-To: <20090906173046.APN62123@mymail.erau.edu> References: <20090906173046.APN62123@mymail.erau.edu> Date: Sun, 6 Sep 2009 22:40:21 +0100 X-Google-Sender-Auth: a8f911bce489b38a Message-ID: Subject: Re: [PATCH] Lua Leak in OS Library From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n86LeqSu030892 In my opinion, os.exit() is for exiting quickly and letting the OS worry about cleaning up. I was under the impression that the OS will free any resources still held by a terminating application, thus meaning that nothing is really leaked. If a Lua script wants to exit cleanly, it should return from its main chunk. If it wants to exit quickly, it should call os.exit(). My 2c, Peter On Sun, Sep 6, 2009 at 10:30 PM, Matthew Paul Del Buono wrote: > Hi list, > > During discussion on IRC today we clarified a (relatively > benign) memory leak I've been noticing for a while, bug > ignoring. While the leak is simply due to a direct call to the > exit() function during os.exit(), I feel that the leak should > still be handled because it is unclean and is trivial to > correct. > > Is it necessary? It's debatable. The leak is not one that > would be impacted by prolonged execution. It only shows itself > because the Lua state is not closed when os.exit() is called. > > To reproduce this issue: > > $ valgrind lua -e 't = {} for x=1,1000 do t[x] = {} end > os.exit()' > ==27928== LEAK SUMMARY: > ==27928== still reachable: 61,796 bytes in 1,397 blocks. > > We can see that this is due to Lua's state and not something > else like the command line being longer because adding a > single character produces a dramatically changed result: > > $ valgrind lua -e 't = {} for x=1,10000 do t[x] = {} end > os.exit()' > ==27937== LEAK SUMMARY: > ==27937== still reachable: 534,116 bytes in 10,397 blocks. > > As discussed earlier, the issue is due to os.exit() > immediately terminating the program without cleaning up. An > obvious solution is to allow it to clean up. I developed the > following patch for this situation: > > > $ diff -u ./lua-5.1.4/src/loslib.c ./lua-5.1.4- > corrected/src/loslib.c > --- ./lua-5.1.4/src/loslib.c    2008-01-18 11:38:18.000000000 > -0500 > +++ ./lua-5.1.4-corrected/src/loslib.c  2009-09-06 > 16:55:16.000000000 -0400 > @@ -214,7 +214,9 @@ > > >  static int os_exit (lua_State *L) { > -  exit(luaL_optint(L, 1, EXIT_SUCCESS)); > +  int code = luaL_optint(L, 1, EXIT_SUCCESS); > +  lua_close(L); > +  exit(code); >  } > >  static const luaL_Reg syslib[] = { > > > We see that the issue is corrected: > > $ valgrind ./lua -e 't = {} for x=1,10000 do t[x] = {} end > os.exit()' > ==29175== All heap blocks were freed -- no leaks are possible. > > However, there is valid concern regarding this patch. Is it > safe for Lua to close its own state during a call? Naturally, > if this function were to exit, the system would become > unstable as it would begin executing in a closed state, but > ANSI C defines exit() as never returning, so this should be a > non-issue. > > An alternative approach is to assume that it is not Lua's job > to do this, but rather the enclosing application's. As such, > this means it's not Lua's fault for failing to clean up, but > rather the interpreter's. An alternative solution would be to > have the interpreter write its own os.exit() to close the > state and then exit. While this puts the control in the > application developers' hands, I feel it's a less suitable > solution because it would mean duplicated code for everyone > that wishes to handle this situation. > > I would like to think that, while this is a benign issue, it's > one that should be corrected. Does anyone see any problems > with the patch above? > > Regards, > -- Matthew P. Del Buono > From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 18:46:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86LjxEj031481; Sun, 6 Sep 2009 18:45:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ED4518E5B; Sun, 6 Sep 2009 18:45:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6703318A58 for ; Sun, 6 Sep 2009 18:45:35 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86LjTXn031423 for ; Sun, 6 Sep 2009 18:45:30 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n86LjR023137; Sun, 6 Sep 2009 18:45:27 -0300 Date: Sun, 6 Sep 2009 18:45:27 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [PATCH] Lua Leak in OS Library Message-ID: <20090906184527.A23131@lua.tecgraf.puc-rio.br> References: <20090906173046.APN62123@mymail.erau.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from lua@corsix.org on Sun, Sep 06, 2009 at 10:40:21PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > In my opinion, os.exit() is for exiting quickly and letting the OS > worry about cleaning up. Exactly. Nevertheless, in Lua 5.2, os.exit will accept a flag that tells whether to close the Lua state. From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 19:43:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86MhHJq004106; Sun, 6 Sep 2009 19:43:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72E6718EC5; Sun, 6 Sep 2009 19:42:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 549F318A58 for ; Sun, 6 Sep 2009 19:42:44 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id BAC70862; Sun, 6 Sep 2009 18:42:42 -0400 (EDT) Received: (from mymail.erau.edu [70.119.100.122]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id APN63276 (AUTH delbu9c1); Sun, 6 Sep 2009 18:42:40 -0400 (EDT) From: Matthew Paul Del Buono Subject: Re: [PATCH] Lua Leak in OS Library To: "Lua list" X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 In-Reply-To: <20090906184527.A23131@lua.tecgraf.puc-rio.br> References: <20090906173046.APN62123@mymail.erau.edu> <20090906184527.A23131@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090906184240.APN63276@mymail.erau.edu> Date: Sun, 6 Sep 2009 18:42:40 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks :) -- Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 19:47:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86MlNER004562; Sun, 6 Sep 2009 19:47:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7E3B18F98; Sun, 6 Sep 2009 19:47:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80D2618B2B for ; Sun, 6 Sep 2009 19:47:00 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id BAC70959; Sun, 6 Sep 2009 18:46:59 -0400 (EDT) Received: (from mymail.erau.edu [70.119.100.122]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id APN63341 (AUTH delbu9c1); Sun, 6 Sep 2009 18:46:59 -0400 (EDT) From: Matthew Paul Del Buono Subject: Re: [PATCH] Lua Leak in OS Library To: lua@bazar2.conectiva.com.br X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090906184659.APN63341@mymail.erau.edu> Date: Sun, 6 Sep 2009 18:46:59 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >If a Lua script wants to exit >cleanly, it should return from its main chunk. If it wants to exit >quickly, it should call os.exit(). Unfortunately, this is not always a suitable situation. For example, one place where I use Lua scripts a lot is in SVN post- commit hooks where I need the ability to have the Lua interpreter return a non-zero status code. I use os.exit() to do this; the only other way to get a non-zero status at exit would be to throw an uncaught error, which results in messages appearing client-side which looks like a server error instead of a user error. From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 20:04:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86N4c3Z006179; Sun, 6 Sep 2009 20:04:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB17618FAA; Sun, 6 Sep 2009 20:04:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 425DF18EF0 for ; Sun, 6 Sep 2009 20:04:11 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MkQmH-00084L-00; Mon, 07 Sep 2009 01:04:09 +0200 Date: Mon, 7 Sep 2009 01:03:47 +0200 From: Mike Pall To: Lua list Subject: Re: LuaJIT - Bitwise Operators Message-ID: <20090906230347.GA6008@mike.de> References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <4AA3D4C0.4000005@cox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA3D4C0.4000005@cox.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Olivier Hamel wrote: > Idly browsing the internet I found a Lua module which said LuaJIT2 would > have built in bitwise ops: > [URL deleted] The official URL is: http://bitop.luajit.org/ > Does anyone know if they're still planned and if there are metaoperators > for them as well, or if they've been cut in favour of vanilla Lua? > Or was this page entirely incorrect to begin with? Yes, LuaJIT 2.x will have them built-in and will happily compile and optimize all bitwise operations. Note that it says "bitwise operations" everywhere, i.e. functions like bit.band(). Nowhere does it say "operators", so of course there's no overloading. Consider using descriptive method names. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 20:27:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n86NRXjY008107; Sun, 6 Sep 2009 20:27:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48A591914F; Sun, 6 Sep 2009 20:27:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96C4118F75 for ; Sun, 6 Sep 2009 20:27:01 -0300 (BRT) Received: by pzk38 with SMTP id 38so2071071pzk.5 for ; Sun, 06 Sep 2009 16:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=jiyTCZUlz9MZs7CneS1RQdeBY1YVTZjveiqtzqCOMIY=; b=c0QBTJUegDQ2Womg2sum7F1GxTh3qtKjXWRL8SUZN5fMGUhkIYyXgy6SDGazZyAOir k/XplC8ILZUNLuNB9lLAUXmM0gpf0CMpxOhq2wCEd6Z1mHXa4HHWVN8BOE7+lo9sY4ym bJaJvdc3p+ivXZmWCc8eucvdAD6Ps3MNdbj8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=auZmoboOTRS7yDEjG9TVcbHPPK7T05ocfGRADqG4rJ72v9aaU2drVsmnWTgRBb0phC 3pWufcH/IxVx8ZX+lo8Pr6tcKIhXipSyciAqszLwEg6FYpY1fZae2ePTdfAPEtF4J+re kL9/vYm+R+Irvr5WkfixH5PZLGpCW6nDD9ucc= MIME-Version: 1.0 Received: by 10.143.25.39 with SMTP id c39mr478252wfj.249.1252279619313; Sun, 06 Sep 2009 16:26:59 -0700 (PDT) In-Reply-To: <20090906184659.APN63341@mymail.erau.edu> References: <20090906184659.APN63341@mymail.erau.edu> Date: Sun, 6 Sep 2009 16:26:59 -0700 Message-ID: <17eac67c0909061626h714f8c52yfd216b2560fee50d@mail.gmail.com> Subject: Re: [PATCH] Lua Leak in OS Library From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 6, 2009 at 3:46 PM, Matthew Paul Del Buono wrote: >>If a Lua script wants to exit >>cleanly, it should return from its main chunk. If it wants to > exit >>quickly, it should call os.exit(). > > Unfortunately, this is not always a suitable situation. For > example, one place where I use Lua scripts a lot is in SVN post- > commit hooks where I need the ability to have the Lua > interpreter return a non-zero status code. I use os.exit() to do > this; the only other way to get a non-zero status at exit would > be to throw an uncaught error, which results in messages > appearing client-side which looks like a server error instead of > a user error. A common way to deal with this is reopening stderr so it can go to a log file and not pollute the interaction with the user through the svnserver. Unfortunately, it doesn't appear to be possible with lua's simple io library, or am I missing something in the docs? Anyhow, as has been pointed out, there _are_ no memory leaks with os.exit(), the process ceases to exist, thus has no memory (or open descriptors, sockets, etc.). It might be useful for os.exit() to close the lua state, not to clean up OS-managed resources that will be released anyway, but for causing userdata to be finalized by calling __gc. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 21:37:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n870bqi6014395; Sun, 6 Sep 2009 21:37:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C9E918A58; Sun, 6 Sep 2009 21:37:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5C961892B for ; Sun, 6 Sep 2009 21:37:15 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MkSEI-0005iG-Ud for lua@bazar2.conectiva.com.br; Sun, 06 Sep 2009 17:37:11 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: [PATCH] Lua Leak in OS Library. os.atexit()? Date: Sun, 6 Sep 2009 17:37:04 -0700 User-Agent: KMail/1.9.10 References: <20090906173046.APN62123@mymail.erau.edu> <20090906184527.A23131@lua.tecgraf.puc-rio.br> In-Reply-To: <20090906184527.A23131@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_xWFpKBnQWS4SrCX" Message-Id: <200909061737.05124.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_xWFpKBnQWS4SrCX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 06, Luiz Henrique de Figueiredo wrote: > > In my opinion, os.exit() is for exiting quickly and letting the OS > > worry about cleaning up. > > Exactly. Nevertheless, in Lua 5.2, os.exit will accept a flag that tells > whether to close the Lua state. How about an os.atexit(func) function to register Lua functions to called when os.exit() or a normal exit happens. This way Lua scripts can still do resource cleanup if they need/want to. Attached 'atexit.lua' is a simple pure Lua os.atexit() function, it catches both 'os.exit()' and normal exit. Personally I am in the camp of people that like to have all memory/resources released by the application/daemon before it exit's back to the OS. But for simple shell type scripts this is overkill. P.S Yay for money-patching. ;) -- Robert G. Jakabosky --Boundary-00=_xWFpKBnQWS4SrCX Content-Type: text/plain; charset="iso 8859-15"; name="atexit.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atexit.lua" local exit_list={} local exit=os.exit local function cleanup() -- call atexit functions in reverse order for x=#exit_list,1,-1 do local func = exit_list[x] func() end end -- catch normal exit. local t=newproxy(true) t=getmetatable(t) t.__gc = cleanup os.exit = function(...) cleanup() exit(...) end os.atexit = function(func) table.insert(exit_list, func) end --Boundary-00=_xWFpKBnQWS4SrCX Content-Type: text/plain; charset="iso 8859-15"; name="atexit_test.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atexit_test.lua" require("atexit") print("call atexit") os.atexit(function() print "atexit function number 1" end) os.atexit(function() print "atexit function number 2" end) os.atexit(function() print "atexit function number 3" end) os.atexit(function() print "atexit function number 4" end) rc=arg[1] or nil if rc ~= nil then print "call os.exit()" os.exit(rc) print "error error shouldn't get here." end print "normal exit no 'os.exit()' call" --Boundary-00=_xWFpKBnQWS4SrCX-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 21:52:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n870pxj4015659; Sun, 6 Sep 2009 21:51:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF1FD18EF2; Sun, 6 Sep 2009 21:51:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57FA818B30 for ; Sun, 6 Sep 2009 21:51:31 -0300 (BRT) Received: by ewy26 with SMTP id 26so2214588ewy.5 for ; Sun, 06 Sep 2009 17:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=kQ8Hz12seOsCyILgpCC0uIY5f8Ow4avW9xqcz8YLQTY=; b=U7IZX4vcdBM2vmGhj+K0N4dLr8W5t3L/RA6dyhphckuIMMVy1PgAoDzAe/NsHJlL30 j+Xs8j3pIWHsEvAZlOScjv+WrFsUhO8rr4+gDdii+LdRoD8cU386rwxTeZ16rA4fvaZA 6ZPXHVfdvurqDlvkgpaRG4ASTQBnUZgZpaEIg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FFi7IQdkEeio+sE9bpdGHP8stAD0/2vw7pzven6B9On7cOWWAX8kVxiJQeQaZOcWZc mF75kFfSFAqY6wjp6MKp/ppkkZCDyr4xGmiTM/DLRD8yCTL5hFUB3CbqGjvXEbh6wL4y 6PtInngD7aFt/LtIJjrZszaD/Pmj+9JeddtNQ= MIME-Version: 1.0 Received: by 10.216.46.194 with SMTP id r44mr1519189web.20.1252284689081; Sun, 06 Sep 2009 17:51:29 -0700 (PDT) In-Reply-To: <20090906184527.A23131@lua.tecgraf.puc-rio.br> References: <20090906173046.APN62123@mymail.erau.edu> <20090906184527.A23131@lua.tecgraf.puc-rio.br> From: Jerome Vuarand Date: Mon, 7 Sep 2009 02:51:09 +0200 Message-ID: <89d273ba0909061751j21756654h5dc28e6ce22415f3@mail.gmail.com> Subject: Re: [PATCH] Lua Leak in OS Library To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/6 Luiz Henrique de Figueiredo : >> In my opinion, os.exit() is for exiting quickly and letting the OS >> worry about cleaning up. > > Exactly. Nevertheless, in Lua 5.2, os.exit will accept a flag that tells > whether to close the Lua state. This sounds to me like a hack. Why not simply have the stock interpreter convert the return value of the script to an integer and return that integer from the 'main' C function ? From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 21:53:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n870r8x4015799; Sun, 6 Sep 2009 21:53:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 968C11A519; Sun, 6 Sep 2009 21:52:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06FD0321B3 for ; Sun, 6 Sep 2009 21:52:42 -0300 (BRT) Received: by bwz10 with SMTP id 10so706780bwz.5 for ; Sun, 06 Sep 2009 17:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=sJfiKzUe3TuEucsn7GC/7jzTL7IDYfq+eKD8Qy8Gbcg=; b=EeLMmzRbOc5i+RBpMyabiolGf16KorJOPZe/TelMPpH351njYBd80zS/wTW2tlpg9f uJEn6IkWILs0+Mf5coK8sX5KYVhKWy7La6N2QpYQgLkdR4tW7d90qSc+fGbQXsS+CYR5 Y+QsR67liU34uOz7ULpKaNvkLhqY4L95Ry6lk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=QG/7gXX7WNh4VNafKzLQsNNmAqpMPD6Zs9n06byF2Hg/Ly0F9idtj1IBf7zctCt2Jt 4+3vHUqOjYaLq5MSRIM6UTMmgt36EWmn92qRZ7vamwUItDVCycZM7r3cCu22pot/FEEX /VdR7KjNybdF0MlNhOPv82oZpdx2PC9MqmkEo= MIME-Version: 1.0 Received: by 10.223.5.18 with SMTP id 18mr5122532fat.58.1252284760178; Sun, 06 Sep 2009 17:52:40 -0700 (PDT) Date: Sun, 6 Sep 2009 20:52:40 -0400 X-Google-Sender-Auth: 4a061d5e394c745a Message-ID: Subject: Announce: Darwin module system From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean A few weeks ago, I mentioned on this list that I was working on an enhanced module system for Lua that would provide strong isolation between modules, namespace control, and other attributes. And it provides a declarative syntax for dependencies between modules. A key design goal was to be compatible with Lua's current module system, so Darwin should be easy to try out. You should be able to load it and not even notice it until you want to use it. When you want to take a module you already have, e.g. {{modname}}, and define a Darwin structure for it, you can create a structure definition and load it. Then, when other code does {{require "modname"}}, Darwin will open the structure for you, i.e. load the module. The source (including a basic test suite to verify that Darwin is working) and documentation are attached to this page: http://lua-users.org/wiki/JimJennings To use Darwin, download darwin.tgz and extract it in a directory that 'require' will find. Then: require "darwin" To test the system: require "darwin.test.regression" If everything is working, the output will end with " ** ALL TESTS PASSED ** ". There are examples in the documentation, and more in darwin/test/regression.lua (although those examples are not as useful). Those that are interested in exploring ideas for module system enhancements should take a look or even try it out. I welcome feedback, and I do intend to fix bugs and make enhancements. Jim From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 22:04:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87149A3016998; Sun, 6 Sep 2009 22:04:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E0DE1896F; Sun, 6 Sep 2009 22:03:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 069CB187E4 for ; Sun, 6 Sep 2009 22:03:38 -0300 (BRT) Received: by ewy26 with SMTP id 26so2217940ewy.5 for ; Sun, 06 Sep 2009 18:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=SuxaewUShmn/KHgrKrvW6/e3LJ1JAgLKCsNLl1cKbwg=; b=qiaqqDKs2bPq1NFwHRAv/9kOxtZO5/CN7iGRJwRbO38+mOcevsBduKJz/WpgQg46vJ S0f4/qQ51iptU8TsU0oto9DYVBm1WU0GeMBT0MOsfLg93UGTkAP1ZY749eLNf451Ovog x0IM83r/3kUWLWJ3NIwPN0V3mQavYkL9NAQvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=iyq8ULuiPWdpZuuKpkt/WfURQ0E/ff828EKWO1/fU6OmGMx6l8zP/ynUEaZ2OLEEih SilOvOS3KVPETnDIyvUAriRmAlqG3fZLZ975/z62oV/mEt+eP5yiIdq587uR2mZvNBbe bjGbIfDod4T+Uz3IAJdkvQ1A8M2HMkzAngE5k= MIME-Version: 1.0 Received: by 10.216.85.147 with SMTP id u19mr1440284wee.88.1252285416737; Sun, 06 Sep 2009 18:03:36 -0700 (PDT) In-Reply-To: <2656446617943241256@unknownmsgid> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> From: Jerome Vuarand Date: Mon, 7 Sep 2009 03:03:16 +0200 Message-ID: <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/5 John Hind : > This is easily fixed on the Windows environment because Windows executables > have support for embedded resources and it is straightforward to provide a > loader so Lua "require" looks for Lua code in resources. Unfortunately, this > is not portable to other platforms. Also unfortunately you cannot load dll > files from resources, so you still must statically link the C parts of > composite libraries (not usually any problem, but it would be nice ...) > > This problem is not unique to Lua and it afflicts all "scripting" languages > (just look at how many files the Firefox browser tips into your file > system!). What's needed is a generic "meta-executable" format that embeds a > virtual file system and makes it available to a normal executable (in this > case a Lua runtime) stored in the same file. Any examples of such systems I > can find extract content out to temporary files, which rather spoils the > point! Just for the sake of precision, I'd like to point that while the standard Windows DLL loader is not capable of loading DLLs from another DLL resource, afaik all its features are reproducible in user code (it's not using kernel black magic). Therefore it's possible to load DLLs from anywhere. Some libraries out there allow loading DLLs from in-memory buffers with the exact same capabilities and interface as the standard win32 LoadLibrary+GetProcAddress. From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 22:16:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n871GdxA018023; Sun, 6 Sep 2009 22:16:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE24D18CF8; Sun, 6 Sep 2009 22:16:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD571897E for ; Sun, 6 Sep 2009 22:16:02 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MkSpt-0005mC-Iq for lua@bazar2.conectiva.com.br; Sun, 06 Sep 2009 18:16:01 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: [PATCH] Lua Leak in OS Library. os.atexit()? Date: Sun, 6 Sep 2009 18:16:00 -0700 User-Agent: KMail/1.9.10 References: <20090906173046.APN62123@mymail.erau.edu> <20090906184527.A23131@lua.tecgraf.puc-rio.br> <200909061737.05124.bobby@sharedrealm.com> In-Reply-To: <200909061737.05124.bobby@sharedrealm.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Q7FpKqrIUSpJcAa" Message-Id: <200909061816.00723.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_Q7FpKqrIUSpJcAa Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46ixed a bug. =C2=A0The os.atexit() functions where being called after a f= ull GC. =2D-=20 Robert G. Jakabosky --Boundary-00=_Q7FpKqrIUSpJcAa Content-Type: text/plain; charset="iso 8859-15"; name="atexit.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atexit.lua" local exit_list={} local exit=os.exit local function cleanup() -- call atexit functions in reverse order for x=#exit_list,1,-1 do local func = exit_list[x] func() exit_list[x] = nil end end -- catch normal exit. local gc=newproxy(true) exit_list.gc = gc gc=getmetatable(gc) gc.__gc = cleanup os.exit = function(...) cleanup() exit(...) end os.atexit = function(func) table.insert(exit_list, func) end --Boundary-00=_Q7FpKqrIUSpJcAa-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 22:40:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n871ebY6020012; Sun, 6 Sep 2009 22:40:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C9D918BB1; Sun, 6 Sep 2009 22:40:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from eastrmmtao104.cox.net (eastrmmtao104.cox.net [68.230.240.46]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD24A18A0C for ; Sun, 6 Sep 2009 22:40:08 -0300 (BRT) Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao104.cox.net (InterMail vM.8.00.01.00 201-2244-105-20090324) with ESMTP id <20090907014006.PXVM11036.eastrmmtao104.cox.net@eastrmimpo02.cox.net> for ; Sun, 6 Sep 2009 21:40:06 -0400 Received: from [127.0.0.1] ([98.169.61.33]) by eastrmimpo02.cox.net with bizsmtp id ddg41c0090j1tfm02dg4wX; Sun, 06 Sep 2009 21:40:05 -0400 X-VR-Score: -100.00 X-Authority-Analysis: v=1.0 c=1 a=U_kPIZEn_IJsg29u8oQA:9 a=V12xP2-g20DKrD7PTrRiBcl3xjwA:4 X-CM-Score: 0.00 Message-ID: <4AA4646D.9020404@cox.net> Date: Sun, 06 Sep 2009 21:39:57 -0400 From: Olivier Hamel User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT - Bitwise Operators References: <00e101ca175b$5b618160$12248420$@com.au> <20090807152339.GA6283@mike.de> <00530750997A40B1B4FB24C937A50C5E@Mania> <4A7D62D1.4080302@falcom.de> <4A7D62D1.4080302@falcom.de> <20090809150322.GA14154@mike.de> <4AA3D4C0.4000005@cox.net> <20090906230347.GA6008@mike.de> In-Reply-To: <20090906230347.GA6008@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Yes, LuaJIT 2.x will have them built-in and will happily compile > and optimize all bitwise operations. > > Note that it says "bitwise operations" everywhere, i.e. functions > like bit.band(). Nowhere does it say "operators", so of course > there's no overloading. Consider using descriptive method names. > > --Mike > Thanks for clarifying that. Hummm, time to learn assembly I guess... From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 23:25:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n872PPp7024148; Sun, 6 Sep 2009 23:25:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C484186C9; Sun, 6 Sep 2009 23:25:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.223.182]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29DF0186C1 for ; Sun, 6 Sep 2009 23:24:53 -0300 (BRT) Received: by iwn12 with SMTP id 12so732761iwn.11 for ; Sun, 06 Sep 2009 19:24:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.27 with SMTP id n27mr4437395ibr.48.1252290291918; Sun, 06 Sep 2009 19:24:51 -0700 (PDT) In-Reply-To: <17eac67c0909061626h714f8c52yfd216b2560fee50d@mail.gmail.com> References: <20090906184659.APN63341@mymail.erau.edu> <17eac67c0909061626h714f8c52yfd216b2560fee50d@mail.gmail.com> Date: Sun, 6 Sep 2009 22:24:50 -0400 Message-ID: <790db3550909061924l38e92eb1p899fc716ceb20a1f@mail.gmail.com> Subject: Re: [PATCH] Lua Leak in OS Library From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 6, 2009 at 7:26 PM, Sam Roberts wrote: > It might be useful for os.exit() to close the lua state, not to clean > up OS-managed > resources that will be released anyway, but for causing userdata to be > finalized by calling __gc. I was going to also bring this up. os.exit() should probably close the Lua state if for no better reason than to allow gc metamethods to run. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 23:27:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n872RdOK024345; Sun, 6 Sep 2009 23:27:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31CB4186F1; Sun, 6 Sep 2009 23:27:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.223.182]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85C60186DA for ; Sun, 6 Sep 2009 23:27:05 -0300 (BRT) Received: by iwn12 with SMTP id 12so733057iwn.11 for ; Sun, 06 Sep 2009 19:27:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.227 with SMTP id v35mr11144216ibr.18.1252290423374; Sun, 06 Sep 2009 19:27:03 -0700 (PDT) In-Reply-To: References: Date: Sun, 6 Sep 2009 22:27:03 -0400 Message-ID: <790db3550909061927m2ac1a9aen71b4497c9d0fa5c2@mail.gmail.com> Subject: Re: Announce: Darwin module system From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n872RdOK024345 Hi Jim, On Sun, Sep 6, 2009 at 8:52 PM, Jim Jennings wrote: > A few weeks ago, I mentioned on this list that I was working on an > enhanced module system for Lua that would provide strong isolation > between modules, namespace control, and other attributes.  And it > provides a declarative syntax for dependencies between modules. Can you elaborate on key problems you are trying to solve and how you solve them? -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sun Sep 6 23:29:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n872T2Nw024549; Sun, 6 Sep 2009 23:29:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2914418742; Sun, 6 Sep 2009 23:28:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.223.182]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C75818709 for ; Sun, 6 Sep 2009 23:28:38 -0300 (BRT) Received: by iwn12 with SMTP id 12so733256iwn.11 for ; Sun, 06 Sep 2009 19:28:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.5.79 with SMTP id 15mr11149232ibu.7.1252290516068; Sun, 06 Sep 2009 19:28:36 -0700 (PDT) In-Reply-To: <200909061737.05124.bobby@sharedrealm.com> References: <20090906173046.APN62123@mymail.erau.edu> <20090906184527.A23131@lua.tecgraf.puc-rio.br> <200909061737.05124.bobby@sharedrealm.com> Date: Sun, 6 Sep 2009 22:28:35 -0400 Message-ID: <790db3550909061928u39786c44lee571397cde12a8b@mail.gmail.com> Subject: Re: [PATCH] Lua Leak in OS Library. os.atexit()? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n872T2Nw024549 Hi Robert, On Sun, Sep 6, 2009 at 8:37 PM, Robert G. Jakabosky wrote: > On Sunday 06, Luiz Henrique de Figueiredo wrote: >> > In my opinion, os.exit() is for exiting quickly and letting the OS >> > worry about cleaning up. >> >> Exactly. Nevertheless, in Lua 5.2, os.exit will accept a flag that tells >> whether to close the Lua state. > > How about an os.atexit(func) function to register Lua functions to called when > os.exit() or a normal exit happens.  This way Lua scripts can still do > resource cleanup if they need/want to.  Attached 'atexit.lua' is a simple > pure Lua os.atexit() function, it catches both 'os.exit()' and normal exit. > > Personally I am in the camp of people that like to have all memory/resources > released by the application/daemon before it exit's back to the OS.  But for > simple shell type scripts this is overkill. > > P.S Yay for money-patching. ;) Since this can be done in Lua (as you show), why does this need to be supported in C? -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 00:18:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n873IcbX029455; Mon, 7 Sep 2009 00:18:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A33318A87; Mon, 7 Sep 2009 00:18:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6321718A5B for ; Mon, 7 Sep 2009 00:17:59 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MkUjs-0006c2-6p for lua@bazar2.conectiva.com.br; Sun, 06 Sep 2009 20:17:56 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: [PATCH] Lua Leak in OS Library. os.atexit()? Date: Sun, 6 Sep 2009 20:17:54 -0700 User-Agent: KMail/1.9.10 References: <20090906173046.APN62123@mymail.erau.edu> <200909061737.05124.bobby@sharedrealm.com> <790db3550909061928u39786c44lee571397cde12a8b@mail.gmail.com> In-Reply-To: <790db3550909061928u39786c44lee571397cde12a8b@mail.gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_itHpK9BW+6JvM12" Message-Id: <200909062017.54844.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_itHpK9BW+6JvM12 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 06, Patrick Donnelly wrote: > Hi Robert, > > On Sun, Sep 6, 2009 at 8:37 PM, Robert G. > > Jakabosky wrote: > > On Sunday 06, Luiz Henrique de Figueiredo wrote: > >> > In my opinion, os.exit() is for exiting quickly and letting the OS > >> > worry about cleaning up. > >> > >> Exactly. Nevertheless, in Lua 5.2, os.exit will accept a flag that tel= ls > >> whether to close the Lua state. > > > > How about an os.atexit(func) function to register Lua functions to call= ed > > when os.exit() or a normal exit happens. =C2=A0This way Lua scripts can= still > > do resource cleanup if they need/want to. =C2=A0Attached 'atexit.lua' i= s a > > simple pure Lua os.atexit() function, it catches both 'os.exit()' and > > normal exit. > > > > Personally I am in the camp of people that like to have all > > memory/resources released by the application/daemon before it exit's ba= ck > > to the OS. =C2=A0But for simple shell type scripts this is overkill. > > > > P.S Yay for money-patching. ;) > > Since this can be done in Lua (as you show), why does this need to be > supported in C? I think closing the lua_State is the less error prone method of cleanup. =20 Since any object that needs to cleanup some complex resource should already= =20 have a "__gc" method. I would like to see both the Lua 5.2 os.exit() flag= =20 and os.atexit(). One use of the os.atexit() function that I can think of is a daemon written= in=20 pure Lua which creates a pid file when it starts then deletes that file whe= n=20 it exits. Or to just log the error code passed to os.exit(code). The new version of atexit.lua attached now passes the error code from=20 os.exit() to the atexit functions. =2D-=20 Robert G. Jakabosky --Boundary-00=_itHpK9BW+6JvM12 Content-Type: text/plain; charset="iso 8859-15"; name="atexit.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atexit.lua" local exit_list={} local exit=os.exit local function cleanup(rc) -- call atexit functions in reverse order for x=#exit_list,1,-1 do local func = exit_list[x] func(rc) exit_list[x] = nil end end -- catch normal exit. local gc=newproxy(true) exit_list.gc = gc gc=getmetatable(gc) gc.__gc = function() cleanup(0) end os.exit = function(rc) rc = rc or 0 cleanup(rc) exit(rc) end os.atexit = function(func) table.insert(exit_list, func) end --Boundary-00=_itHpK9BW+6JvM12 Content-Type: text/plain; charset="iso 8859-15"; name="atexit_test.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atexit_test.lua" require("atexit") print("call atexit") os.atexit(function(rc) print("atexit function number 1, rc=" .. rc) end) os.atexit(function(rc) print("atexit function number 2, rc=" .. rc) end) os.atexit(function(rc) print("atexit function number 3, rc=" .. rc) end) os.atexit(function(rc) print("atexit function number 4, rc=" .. rc) end) -- GC test. print "start full GC" collectgarbage("collect") collectgarbage("collect") collectgarbage("collect") -- hehe can't be to sure. ;) collectgarbage("collect") print("finished full GC") rc=arg[1] or nil if rc ~= nil then if rc == '0' then print "call os.exit()" os.exit() -- test default error code else print "call os.exit(rc)" os.exit(rc) -- test passing error code. end print "error error shouldn't get here." end print "normal exit no 'os.exit()' call" --Boundary-00=_itHpK9BW+6JvM12-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 02:26:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n875Q2O6008081; Mon, 7 Sep 2009 02:26:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB57A1839A; Mon, 7 Sep 2009 02:25:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A34C31A661 for ; Mon, 7 Sep 2009 02:25:26 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8BAJQ1pEp8qXV+/2dsb2JhbAAI106EGAWCOA X-IronPort-AV: E=Sophos;i="4.44,344,1249228800"; d="scan'208";a="559950938" Received: from unknown (HELO [10.1.1.2]) ([124.169.117.126]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 07 Sep 2009 13:25:11 +0800 Message-Id: <26ED870D-3D5E-4E17-9B79-A242CFAA11A2@chester.id.au> From: Jacques Chester To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Announce: Darwin module system Date: Mon, 7 Sep 2009 13:25:08 +0800 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 07/09/2009, at 8:52 AM, Jim Jennings wrote: > A few weeks ago, I mentioned on this list that I was working on an > enhanced module system for Lua that would provide strong isolation > between modules, namespace control, and other attributes. And it > provides a declarative syntax for dependencies between modules. Very nifty. However I would caution against using "Darwin" as a project name. You will be competing on Google with three much-better known Darwins: Charles Darwin, Australia's northernmost capital city Darwin, and the Darwin OS project. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 03:09:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8769QPr011568; Mon, 7 Sep 2009 03:09:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AFDE1860A; Mon, 7 Sep 2009 03:09:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DC4D185DF for ; Mon, 7 Sep 2009 03:08:57 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id AA619B1E61 for ; Mon, 7 Sep 2009 09:08:51 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: userdata environment References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> Date: Mon, 07 Sep 2009 09:07:32 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> User-Agent: Opera Mail/10.00 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 01 Sep 2009 17:20:48 +0300, Jerome Vuarand wrote: > When I first used userdata environment I assumed it was the case and > was quite disappointed to discover it's not. > > However you have other methods to associate metadata to a userdata. > For example you can use a weak table in the registry, with the > userdata as a weak key and the string as value. Thanks. This indeed is probably the best one can do now. But doing this spoils the "convenience feature for programmers" part. And it is MUCH slower than accessing value through a direct pointer. Basically my question is whether any code other than the lua_setfenv and lua_getfenv depend on Udata->env being a (Table *)? If adding dozen lines to the core means I don't have to create extra table, and it doesn't break anything, I think it's worth doing. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 05:52:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n878qFmw027542; Mon, 7 Sep 2009 05:52:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B502192A0; Mon, 7 Sep 2009 05:51:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06CCE1874C for ; Mon, 7 Sep 2009 05:51:41 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MkZwo-0002Ub-LY for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 08:51:38 +0000 From: "John Hind" To: "'Lua list'" References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> In-Reply-To: <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> Subject: RE: Is a Lua system easily embeddable? Date: Mon, 7 Sep 2009 09:50:47 +0100 Message-ID: <001701ca2f98$4b524de0$e1f6e9a0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcovVyMK8lJ0KD1PSAOn3BBGs24fUgAPe0cQ Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n878qFmw027542 Of course, another approach is to use virtual file systems (such as FUSE or Windows 7 VHD). The "EXE" would actually be a VFS with code to mount it and then start a secondary EXE within the VFS. The secondary EXE then transparently sees the VFS and can load DLL files (and Lua scripts) without even knowing the file system is virtual. The outer process would need to monitor the inner one and automatically dismount the VFS when the inner process terminates. However the approach you suggest might be more efficient or more easily implemented. Can you point me to this code ("some libraries out there") as I have not come across it in my searches. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Jerome Vuarand > Sent: 07 September 2009 02:03 > To: Lua list > Subject: Re: Is a Lua system easily embeddable? > > 2009/9/5 John Hind : > > This is easily fixed on the Windows environment because Windows > executables > > have support for embedded resources and it is straightforward to > provide a > > loader so Lua "require" looks for Lua code in resources. > Unfortunately, this > > is not portable to other platforms. Also unfortunately you cannot > load dll > > files from resources, so you still must statically link the C parts > of > > composite libraries (not usually any problem, but it would be nice > ...) > > > > This problem is not unique to Lua and it afflicts all "scripting" > languages > > (just look at how many files the Firefox browser tips into your file > > system!). What's needed is a generic "meta-executable" format that > embeds a > > virtual file system and makes it available to a normal executable (in > this > > case a Lua runtime) stored in the same file. Any examples of such > systems I > > can find extract content out to temporary files, which rather spoils > the > > point! > > Just for the sake of precision, I'd like to point that while the > standard Windows DLL loader is not capable of loading DLLs from > another DLL resource, afaik all its features are reproducible in user > code (it's not using kernel black magic). Therefore it's possible to > load DLLs from anywhere. Some libraries out there allow loading DLLs > from in-memory buffers with the exact same capabilities and interface > as the standard win32 LoadLibrary+GetProcAddress. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 07:15:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87AFs4v002305; Mon, 7 Sep 2009 07:15:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6A0C192BC; Mon, 7 Sep 2009 07:15:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69791192B7 for ; Mon, 7 Sep 2009 07:15:19 -0300 (BRT) Received: by bwz10 with SMTP id 10so901900bwz.5 for ; Mon, 07 Sep 2009 03:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Odlx5MYz3OceN8cpbL24Y+29AsGYBITBiGpsctLCiGQ=; b=AxQp8Y7DvWwF7UZpQu2PG6XwH3MaR+hG37UHAK25YjdW0N7g5bNj41SFvgG2CU0et9 HR+nE4jikuaNNZzLgoS8SgOcsVznB2ZlQFPIndFyZtKfsCSh1rmlv5iWUPnm/bZbVKUy 6ddLzjpZEnkXT+ZjFbd2edEbCZ24g/OkqZSvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HTQsrUiZwUrm6qSrGOqm0IbLAdOQE1n8OGNh1184zIjJC6oUaNeTq/LD8u5Ef2rs2W rdPIQA/FNpt8t4nIx/FecfyT4Ryc/ZZcA7VTItre4Z2iOJ6y/EMTsXjfahKlU9PaQq+1 aOFEEdqdIOCf1g/nY0WCJQtsxDak499KZQKSU= MIME-Version: 1.0 Received: by 10.204.154.86 with SMTP id n22mr1407915bkw.110.1252318516577; Mon, 07 Sep 2009 03:15:16 -0700 (PDT) In-Reply-To: <4AA18594.3090704@sct.microlink.com.br> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <20090904231925.a04d5df4.tmueller@schulze-mueller.de> <4AA18594.3090704@sct.microlink.com.br> Date: Mon, 7 Sep 2009 11:15:16 +0100 Message-ID: <6a3ae47e0909070315i247456aanc519a4ac39d66a8b@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=0015175d03965384e50472fa20b7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d03965384e50472fa20b7 Content-Type: text/plain; charset=UTF-8 For me, having libraries that build by default as shared is a pain, because I then have to figure out how to compile them statically (if that isn't already part of the build instructions, makefile, etc., which it usually isn't these days). Mind you, it's a minor pain, but it is definitely a pain of the "same damn spot" kind. Why not just go with the shared library approach to minimise my pain, I hear you ask. Because sorting out issues that revolve around shared libraries in the field is an even bigger pain. Just the other day, my app (a non Lua one) wouldn't run on a machine I installed it on. It took me half a day to figure out that the reason was that an outdated DLL was hiding in C:/Windows/system32 and it was getting loaded through a sequence of interdependent DLLs. If you do not have access to the installation machine itself, and have to talk a user through various trial and error scenarios, then this has some serious consequences in how you are perceived by the customer. Building statically linked applications removes a lot of this problem. And since my example was for Windows, please do not even attempt to get me sold on "side by side". Phew, feels good to get that off my chest ;-) Robby --0015175d03965384e50472fa20b7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable For me, having libraries that build by default as shared is a pain, because= I then have to figure out how to compile them statically (if that isn'= t already part of the build instructions, makefile, etc., which it usually = isn't these days).

Mind you, it's a minor pain, but it is definitely a pain of the &qu= ot;same damn spot" kind.

Why not just go with the shared librar= y approach to minimise my pain, I hear you ask.

Because sorting out = issues that revolve around shared libraries in the field is an even bigger = pain.

Just the other day, my app (a non Lua one) wouldn't run on a machin= e I installed it on. It took me half a day to figure out that the reason wa= s that an outdated DLL was hiding in C:/Windows/system32 and it was getting= loaded through a sequence of interdependent DLLs.

If you do not have access to the installation machine itself, and have = to talk a user through various trial and error scenarios, then this has som= e serious consequences in how you are perceived by the customer.

Building statically linked applications removes a lot of this problem.
<= br>And since my example was for Windows, please do not even attempt to get = me sold on "side by side".

Phew, feels good to get that of= f my chest ;-)

Robby

--0015175d03965384e50472fa20b7-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 07:30:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87ATxmA003565; Mon, 7 Sep 2009 07:29:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F13D7192D5; Mon, 7 Sep 2009 07:29:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A041191AE for ; Mon, 7 Sep 2009 07:29:31 -0300 (BRT) Received: by fxm25 with SMTP id 25so1623754fxm.5 for ; Mon, 07 Sep 2009 03:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ctWlavSng5E8tRTisC603vOF/yMJwevg6E/L6h4k6wE=; b=FDIbRuMToMegfK0Of97NiBGJqMy+2dOhA8D968+fLbdS4xYJvGwOU8LnKdLPqgvAI5 yCRvwzYOpozkpm2x7SdtL6JE9QffWA6kIzgFVsE+14N/Shn9QZB+o0QDmkGlSqVfFpxh UZEtGVoJ2PkXIjkRMrIT8kDXWNdDDqmD0L3+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ktnQRpKW4sgmwaxS6sr2LqXLt/H89/Nw93o2szARVFctCOxDeO/f/JE0NhkKoBkj4I O8mcB1PpuidjmxL39lLXvl62Q+2kilsvVc80NAm3doUTpxQInYsqYTW+pSMTCa6+fh3q EWvhEt0yMf0Y835SKXH8b76RvklIHQZJyh4kA= MIME-Version: 1.0 Received: by 10.86.12.2 with SMTP id 2mr7714798fgl.12.1252319368812; Mon, 07 Sep 2009 03:29:28 -0700 (PDT) In-Reply-To: <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> Date: Mon, 7 Sep 2009 11:29:28 +0100 Message-ID: <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? From: Paul Moore To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/7 Jerome Vuarand : > Just for the sake of precision, I'd like to point that while the > standard Windows DLL loader is not capable of loading DLLs from > another DLL resource, afaik all its features are reproducible in user > code (it's not using kernel black magic). Therefore it's possible to > load DLLs from anywhere. Some libraries out there allow loading DLLs > from in-memory buffers with the exact same capabilities and interface > as the standard win32 LoadLibrary+GetProcAddress. Ooh! Can you provide pointers? Or at least suitable phrases to Google for? I've been interested in this for ages, but never found anything usable... Paul From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 08:50:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87BoX2Q011623; Mon, 7 Sep 2009 08:50:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4D3D187A4; Mon, 7 Sep 2009 08:50:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3410518883 for ; Mon, 7 Sep 2009 08:50:02 -0300 (BRT) Received: from source ([209.85.220.221]) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKSqTzZ8ms3axgC6LSHfgQg0zqRdHvPeO6@postini.com; Mon, 07 Sep 2009 04:50:02 PDT Received: by fxm21 with SMTP id 21so1926315fxm.3 for ; Mon, 07 Sep 2009 04:49:58 -0700 (PDT) Received: by 10.102.160.15 with SMTP id i15mr6069129mue.130.1252324198384; Mon, 07 Sep 2009 04:49:58 -0700 (PDT) Received: from canta (78-105-4-25.zone3.bethere.co.uk [78.105.4.25]) by mx.google.com with ESMTPS id y6sm10808717mug.10.2009.09.07.04.49.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 04:49:57 -0700 (PDT) To: lua@bazar2.conectiva.com.br Subject: [ANN] bitlib release 26 released Date: Mon, 7 Sep 2009 12:49:57 +0100 From: rrt@sc3d.org Message-Id: <1252324197.599272.3196@canta> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am happy to announce the release of bitlib release 26, library for bitwise operations. This is merely a "final" maintenance release which tidies up the build system; specifically, it contains no code changes. Get it from http://luaforge.net/projects/bitlib From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 09:00:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87C0Qef012616; Mon, 7 Sep 2009 09:00:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B45C192C0; Mon, 7 Sep 2009 09:00:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og120.obsmtp.com (exprod7og120.obsmtp.com [64.18.2.18]) by bazar2.conectiva.com.br (Postfix) with SMTP id D3C2118C94 for ; Mon, 7 Sep 2009 08:59:57 -0300 (BRT) Received: from source ([209.85.220.205]) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKSqT1vCceGLbql+GdI3uuh/OJhYoepD4V@postini.com; Mon, 07 Sep 2009 04:59:58 PDT Received: by fxm1 with SMTP id 1so2588282fxm.31 for ; Mon, 07 Sep 2009 04:59:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.4.216 with SMTP id 24mr5285769fas.67.1252324794709; Mon, 07 Sep 2009 04:59:54 -0700 (PDT) Date: Mon, 7 Sep 2009 12:59:54 +0100 Message-ID: Subject: [ANN] bitlib deprecated in favour of bitop From: Reuben Thomas To: Lua mailing list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n87C0Qef012616 I hereby deprecate bitlib (http://luaforge.net/projects/bitlib). Please use bitop (http://bitop.luajit.org/) instead. I have shut down all features of the LuaForge site except for the file releases and SCM (and of course I will leave those indefinitely, so that existing users can still get at the code). I have also made a final release, announced separately, which cleans up the build system. Since bitop is pretty much backwards compatible with bitlib, and is now in Debian and Ubuntu, at least, it's a recommended upgrade from bitlib as well as a replacement. Thanks to bitop's authors for making my labours redundant. It's such a good feeling! -- http://rrt.sc3d.org L’art des vers est de transformer en beautés les faiblesses (Aragon) From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:20:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87DKI9H020090; Mon, 7 Sep 2009 10:20:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F085119180; Mon, 7 Sep 2009 10:19:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 459E6190B5 for ; Mon, 7 Sep 2009 10:19:41 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so919934eye.39 for ; Mon, 07 Sep 2009 06:19:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.70.204 with SMTP id p54mr2841074wed.87.1252329579063; Mon, 07 Sep 2009 06:19:39 -0700 (PDT) In-Reply-To: <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> Date: Mon, 7 Sep 2009 14:19:39 +0100 X-Google-Sender-Auth: 40d881e8847cb3a6 Message-ID: Subject: Re: Is a Lua system easily embeddable? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Googling for "dll from memory" (without quotes) turns up http://www.joachim-bauch.de/tutorials/load_dll_memory.html which starts by describing the appropriate structures and methods, and then has an MPL licensed library to load DLLs from memory. On Mon, Sep 7, 2009 at 11:29 AM, Paul Moore wrote: > 2009/9/7 Jerome Vuarand : >> Just for the sake of precision, I'd like to point that while the >> standard Windows DLL loader is not capable of loading DLLs from >> another DLL resource, afaik all its features are reproducible in user >> code (it's not using kernel black magic). Therefore it's possible to >> load DLLs from anywhere. Some libraries out there allow loading DLLs >> from in-memory buffers with the exact same capabilities and interface >> as the standard win32 LoadLibrary+GetProcAddress. > > Ooh! Can you provide pointers? Or at least suitable phrases to Google > for? I've been interested in this for ages, but never found anything > usable... > > Paul > From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:28:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87DSleF021054; Mon, 7 Sep 2009 10:28:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA7E71A51A; Mon, 7 Sep 2009 10:28:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C97F191B7 for ; Mon, 7 Sep 2009 10:28:17 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id CB80A69291 for ; Mon, 7 Sep 2009 09:28:15 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 07 Sep 2009 09:28:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:mime-version:content-type; s=smtpout; bh=qHG+QGZ2dOVwj7scz/URkKnv78g=; b=hxY28nokwNv6T/EVip8dbEiROa8M9SgPbvDZ7NM7dH+XRsgDsifHp66hsFYQ5QZzb96ntaGDVYtwDfhSCJSs91MvL+yladwP7dLnyo17XouTJoZFDR9kdusm7ieLxvS+d83D1iHmidIisJCnisBKUHHVJAqwYL85f2AxT6dy3Rk= X-Sasl-enc: uDFkYL3Fnqaz7FBOjZYmZCHw8WYXuMs0vqGx9sxF1cYL 1252330095 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2E75F67505 for ; Mon, 7 Sep 2009 09:28:15 -0400 (EDT) Date: Mon, 7 Sep 2009 09:28:06 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: sizeof function closures in lua 5.1? Message-ID: <20090907132806.GB9175@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have lots of experience with Python, and am just beginning to use Lua in earnest. I'm trying to get some benchmarks on the sizes of function closures vs tables. Not to optimize anything specific, just to know which coding style to default to as I go forward. I realize that Lua handles both pretty efficiently already. >From what I can tell, using a function closure and accessing the variables you need as "upvalues" is faster, but takes more memory, than wrapping the variables you need in a table and accessing them there. But how much more memory? This WoW wiki page: http://www.wowwiki.com/Lua_object_memory_sizes says that closures take 20 bytes + 4 bytes per upvalue + 32 bytes per upvalue that ever changes (whether in the closure or outside it). That is, if I understand rightly, the return value of this would be 24 bytes: function make_closure1(x) return function(y) return x+y end end and the return values of these would be 56 bytes: function make_closure2(x) x = x==nil and 0 or x return function(y) return x+y end end function make_closure3(x) return function(y) x = x+1 return x+y end end Aha! I thought. Some functions I'm writing for my personal collection of utility libraries would benefit from being as lean as possible. (I know, I know, premature optimization. But humor me.) Some of them are currently in the make_closure2 style but I could rewrite them like this: function make_closure4(x) local function static_closure(x) -- this is in make_closure1 style return function(y) return x+y end end x = x==nil and 0 or x return static_closure(x) end there's an extra tail call in make_closure4 as opposed to make_closure2, but we end up returning a "static" closure in the style of make_closure1, which---if the WoW page is right, will in general take up less heap space. (With these trivial examples the difference may be minuscule, but in real cases it might be worthwhile.) But I thought to check myself about these size claims. Here's the function I'm using to do that: function sizeof(maker, ...) local siz=0 local ret if type(maker) == "string" then maker=assert(loadstring(maker), "couldn't compile maker") end collectgarbage("collect") siz=collectgarbage("count")*1024 ret=maker(...) return collectgarbage("count")*1024-siz end Here are the sizes I expect to see, if the size figures from the WoW page are accurate. Now, if Lua allocates heap space in blocks then my sizeof function may be less fine-grained than I'd like. But the results are still unexpected. I expected to see: make_closure1 = 20+4 = 24 bytes make_closure2 = 20+4+32 = 56 bytes make_closure3 = 20+4+32 = 56 bytes make_closure4 = 20+4 = 24 bytes Here's what I'm actually seeing: > return sizeof(function() return function(y) return 10+y end end, 10) 40 > return sizeof(make_closure1,10) 88 > return sizeof(make_closure2,10) 88 > return sizeof(make_closure3,10) 88 > return sizeof(make_closure4,10) 128 >From the first line, it looks like a simple function (no upvalues) is taking 40 bytes not 20. Unless as I said, heap space is being allocated in blocks and that's affecting our results. But for make_closure1, I expected to see 24 bytes, which should still fit in the 40 byte block. Why 88 bytes? Or is what's going on that a simple function value is 40 bytes, and the 24,56,56,24 figures are what we should expect _in addition_, the additional overhead of tracking upvalues? In that case, I'd expect the result of make_closure1 to be 40+24 bytes = 66 bytes, which may be enough to prompt an 88 byte allocation. But then we'd also expect the results of make_closure2 and make_closure3 to be 96 bytes, which exceeds what we're actually seeing. So I don't think this is the explanation. It's unclear to me then that there is any size advantage to doing a make_closure1-type closure. It's also unclear why our first three closures are taking up the sizes they do (88 bytes allocated) and how to reconcile that with what's reported on the WoW wiki page. Furthermore, I'd expect the make_closure4 call to be the same as the make_closure1 call, but in fact it's the worst of the four! This really puzzles me. The make_* functions were all defined before calling the sizeof function on any of them. So if heap space is needed to hold code? that shouldn't be affecting the results. Can anyone illuminate? -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:38:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87DcKKM022074; Mon, 7 Sep 2009 10:38:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAF531A2E7; Mon, 7 Sep 2009 10:37:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B76CB18858 for ; Mon, 7 Sep 2009 10:37:52 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 682E56926F for ; Mon, 7 Sep 2009 09:37:50 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 07 Sep 2009 09:37:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=HHq2XsMTS38nMfQeD0WIx4f00jI=; b=NPfxUrIjdbLAxEnE/FYk8YYcEkbvj840MgK4Ve0BSk2FEGxOvp2gRjE/fUO08b8SD4oQrzJ+9bfquCwCE6fjrObKqu8hKaRfmzsWoX0Ww2vIALlU//VC3LpSZKRmRiXU5ZO5UpVB6/mBdthi1Ib5bUwVadiWvFBtroqGyNH/Ou8= X-Sasl-enc: 2EjSLKKd0iaFvGHbKrAQ8KbjAYWTotxz1mApicLEB+UP 1252330669 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id E9444674AF for ; Mon, 7 Sep 2009 09:37:49 -0400 (EDT) Date: Mon, 7 Sep 2009 09:37:41 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Re: sizeof function closures in lua 5.1? Message-ID: <20090907133741.GA23555@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20090907132806.GB9175@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090907132806.GB9175@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I should note I'm using a 64-bit Linux kernel. That may affect some of the sizes. (Perhaps that's why I'm seeing functions as 40 bytes overhead rather than 20 bytes.) Also I notice this comment in the discussion on that WoW wiki page, in case it helps: > Description of upvalues is a bit flawed > Just a note, the way upvalue memory use is described is somewhat flawed, as > it's not separating the memory for the upvalue reference (4 bytes per closure) > from the memory for the value (28 bytes, IIRC). Lua doesn't care if the upvalue > changes or not (contrary to the wording here), the difference is that in the > 'constant' case there's only one VALUE and a reference in each closure, but in > the 'variable' example, there's a value for each instance, plus the 4 bytes on > each closure. But I still need someone to talk me through what's going on here...? -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:44:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Di1RE022598; Mon, 7 Sep 2009 10:44:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B2BA1A578; Mon, 7 Sep 2009 10:43:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88B01A51B for ; Mon, 7 Sep 2009 10:43:31 -0300 (BRT) Received: by fxm25 with SMTP id 25so1735076fxm.5 for ; Mon, 07 Sep 2009 06:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=bFBA0CDAMajEKmpbvNSrEeCHQg+mEQiTkiNA0RjHBaA=; b=SRcktavdGZrqmIDVL5VUXlEfVjCmndycKYVhFZuXvzrF5nME7VC8pjeeaWYQHZkmHM rvZV7EN8CzxYxBdM4FpXtQLcIlmd5OD+Xnp9XvcIq4xLplgD35yJI47Qgi0ObnuJKwzo 35VYKVeiauV2TtzyVEVC1R24OiIaU/OGcJKaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Jgi7RfXc3Y7BfsVlfNZRHq6+cu6JMTSxcdULQXmyH4Wk1hcCF7gFGQtkK43yTAs+vW Xu7hoaWOWL4uiw8/sV6Pn/+Hg1kSYLCu/g7SFPx+HjDkNSjVI3KhMmoQkHRNsAV0m0Re 5m0/98wai3/X2ZaIx4h7iLB/Y6qtmw4YeFhdk= MIME-Version: 1.0 Received: by 10.223.24.151 with SMTP id v23mr5405128fab.44.1252331010113; Mon, 07 Sep 2009 06:43:30 -0700 (PDT) In-Reply-To: <20090907133741.GA23555@vaio.jimpryor.net> References: <20090907132806.GB9175@vaio.jimpryor.net> <20090907133741.GA23555@vaio.jimpryor.net> From: Jim Whitehead II Date: Mon, 7 Sep 2009 14:43:10 +0100 Message-ID: <5fe281d40909070643k349a58d5je5a185c381029cd6@mail.gmail.com> Subject: Re: sizeof function closures in lua 5.1? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 7, 2009 at 2:37 PM, Jim Pryor wrote: > I should note I'm using a 64-bit Linux kernel. That may affect some of the sizes. (Perhaps that's why I'm seeing functions as 40 bytes overhead rather than 20 bytes.) > > Also I notice this comment in the discussion on that WoW wiki page, in case it helps: Keep in mind that the specific measurements on the WoW wiki page have to do with the implementation of Lua in World of Warcraft which is not precisely stock Lua 5.1. The relative measures should still be valid, however. >> Description of upvalues is a bit flawed > >> Just a note, the way upvalue memory use is described is somewhat flawed, as >> it's not separating the memory for the upvalue reference (4 bytes per closure) >> from the memory for the value (28 bytes, IIRC). Lua doesn't care if the upvalue >> changes or not (contrary to the wording here), the difference is that in the >> 'constant' case there's only one VALUE and a reference in each closure, but in >> the 'variable' example, there's a value for each instance, plus the 4 bytes on >> each closure. I just wanted to throw that out there, hopefully someone else is able to come along and help answer the request of your questions =). - Jim From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:45:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Djkto022835; Mon, 7 Sep 2009 10:45:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D107A1A51B; Mon, 7 Sep 2009 10:45:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9C4A8192DD for ; Mon, 7 Sep 2009 10:45:18 -0300 (BRT) Received: from source ([209.85.218.224]) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKSqUOawTqTZw8LlxY+HCEqEqDegmIexcR@postini.com; Mon, 07 Sep 2009 06:45:19 PDT Received: by bwz24 with SMTP id 24so1836362bwz.14 for ; Mon, 07 Sep 2009 06:45:15 -0700 (PDT) Received: by 10.102.13.19 with SMTP id 19mr6030684mum.13.1252331114507; Mon, 07 Sep 2009 06:45:14 -0700 (PDT) Received: from canta (78-105-4-25.zone3.bethere.co.uk [78.105.4.25]) by mx.google.com with ESMTPS id t10sm11591053muh.51.2009.09.07.06.45.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 06:45:12 -0700 (PDT) To: lua@bazar2.conectiva.com.br Subject: [ANN] stdlib release 12 released Date: Mon, 7 Sep 2009 14:45:12 +0100 From: rrt@sc3d.org Message-Id: <1252331112.710073.6428@canta> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am happy to announce the release of stdlib release 12, General Lua libraries. This release removes io.basename and io.dirname, which are now available in lposix, and the little-used functions addSuffix and changeSuffix which dependend on them. io.pathConcat is renamed to io.catdir and io.pathSplit to io.splitdir, making them behave the same as the corresponding Perl functions. The dependency on lrexlib has been removed along with the rex wrapper module. Some of the more esoteric and special-purpose modules (mbox, xml, parser) are no longer loaded by 'require "std"'. This leaves stdlib with no external dependencies, and a rather more coherent set of basic modules. Get it from http://luaforge.net/projects/stdlib From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 10:59:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87DxfpO024210; Mon, 7 Sep 2009 10:59:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D77BD1A600; Mon, 7 Sep 2009 10:59:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44FED1A5E7 for ; Mon, 7 Sep 2009 10:59:05 -0300 (BRT) Received: by ewy26 with SMTP id 26so2575643ewy.5 for ; Mon, 07 Sep 2009 06:59:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.66 with SMTP id x44mr1524679wee.96.1252331942720; Mon, 07 Sep 2009 06:59:02 -0700 (PDT) In-Reply-To: <20090907133741.GA23555@vaio.jimpryor.net> References: <20090907132806.GB9175@vaio.jimpryor.net> <20090907133741.GA23555@vaio.jimpryor.net> Date: Mon, 7 Sep 2009 14:59:02 +0100 X-Google-Sender-Auth: ebe46bf16c638a71 Message-ID: Subject: Re: sizeof function closures in lua 5.1? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >From lobject.h, the definition of LClosure (the structure for Lua closures): typedef struct LClosure { GCObject *next; lu_byte tt; lu_byte marked; lu_byte isC; lu_byte nupvalues; GCObject *gclist; struct Table *env struct Proto *p; UpVal *upvals[1]; } LClosure; >From the above, you can see that a Lua closure, in memory, takes 4 pointers, plus 4 bytes, plus maybe some padding bytes between nupvalues and gclist (i.e. 4 padding bytes on x64 to align gclist on an 8 byte boundary), and then one extra pointer (UpVal*) for each upvalue which it references. If two or more closures share an upvalue, then just one UpVal structure will be allocated for that upvalue. Otherwise, an UpVal structure is allocated for each upvalue. An UpVal structure looks something like: typedef struct UpVal { GCObject *next; lu_byte tt; lu_byte marked; TValue *v; /* points to stack or to its own value */ union { struct /* TValue */ { /* the value (when closed) */ union { GCObject *gc; void *p; lua_Number /* double */ n; int b; } Value; int tt; } value; struct { /* double linked list (when open) */ struct UpVal *prev; struct UpVal *next; } l; } u; } UpVal; Thus each upvalue structure has a pointer, two bytes, maybe some padding, another pointer, and then about 16 bytes for the value / linked list union (might only be 12 bytes on 32 bit architectures if there is no padding after int tt;). If upvalues are not shared, then for a closure with N upvalues, the required memory will probably be: sizeof(void*) * (5 + N) + N * (sizeof(void*) * 3 + 16) where sizeof(void*) == 4 on x86 and sizeof(void*) == 8 on x64. On Mon, Sep 7, 2009 at 2:37 PM, Jim Pryor wrote: > I should note I'm using a 64-bit Linux kernel. That may affect some of the sizes. (Perhaps that's why I'm seeing functions as 40 bytes overhead rather than 20 bytes.) > > Also I notice this comment in the discussion on that WoW wiki page, in case it helps: > >> Description of upvalues is a bit flawed > >> Just a note, the way upvalue memory use is described is somewhat flawed, as >> it's not separating the memory for the upvalue reference (4 bytes per closure) >> from the memory for the value (28 bytes, IIRC). Lua doesn't care if the upvalue >> changes or not (contrary to the wording here), the difference is that in the >> 'constant' case there's only one VALUE and a reference in each closure, but in >> the 'variable' example, there's a value for each instance, plus the 4 bytes on >> each closure. > > But I still need someone to talk me through what's going on here...? > > -- > Jim Pryor > jim@jimpryor.net > From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 11:04:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87E4lHF024878; Mon, 7 Sep 2009 11:04:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F112E18641; Mon, 7 Sep 2009 11:04:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA623185D1 for ; Mon, 7 Sep 2009 11:04:17 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MkepM-0000nP-MA for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 16:04:16 +0200 Received: from adsl233-96.kln.forthnet.gr ([79.103.46.96]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 16:04:16 +0200 Received: from petsagouris by adsl233-96.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 16:04:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: problem - Writing to SQLite3 from a form in a Lua Page Date: Mon, 7 Sep 2009 14:03:31 +0000 (UTC) Lines: 71 Message-ID: References: <25310072.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 79.103.46.96 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Give a try at this one, this should work, I noticed that you had the form tag not closed properly maybe that was your problem. --- // code START // CGILua Test Updating SQLite3

Form Handling

Entering values on this form should display them as values in the first submission

The values should show the previous POST

Values: Username = <%= cgilua.POST.name or "(not set)"%>, Age = <%=cgilua.POST.age or "(not set)"%>

<% require("luasql.sqlite3") local env = (luasql.sqlite3()) conn = env:connect("luasql-test") query = [[ CREATE TABLE IF NOT EXISTS people ( id INTEGER PRIMARY KEY ASC, name VARCHAR NOT NULL, age INTEGER NOT NULL ) ]] conn:execute(query); nm = cgilua.POST.name ag = cgilua.POST.age assert( conn:execute([[ INSERT INTO people(name, age) VALUES('" ..nm .."', '" ..ag.."') ]])) %>

Date

Today is: <%= os.date() %>

<% cur = assert( conn:execute("SELECT * FROM people") ) row = cur:fetch({},"a") while row do %> <% row = cur:fetch(row, "a") end cur:close(); conn:close(); env:close(); %>
NameAge
<% print(row.name) %> <% print(row.age) %>
--- // code END // From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 12:02:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87F26fR031545; Mon, 7 Sep 2009 12:02:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 315A41A674; Mon, 7 Sep 2009 12:00:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B81C91A668 for ; Mon, 7 Sep 2009 12:00:43 -0300 (BRT) Received: by bwz10 with SMTP id 10so1068246bwz.5 for ; Mon, 07 Sep 2009 08:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=95AWmWW5xhkf0B195ZLhuV4sKLx75KpaP0W7BzgTZEg=; b=BSJuoBe6kxsPCY4u/gd3C3ESbSX1S1/sRD72ledZV9jo6+UO+kcGczNi+fEMpnbu6q CNcXCT9IIaPJdSLDAwtWwrdnvO4GIwAS6svkx10He7hJlKHjJMNxF+avzLRLGBfS7sGE g6Bb5oJ7RRDHc6D+nAfdIuP4ktIcAL44ihuUw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=XqaEiMuhWii905KDgO8YyVz+SjSNqAQ1VhD4DpZr2944kyLx4kPhU6K7AEmIikiUmH 4eZW7yOVZEcXBmwbs7loRtJlT6KHDk1vSQPUwsNPqtUjHHItqR2XSQaASNmgDhQahygo cZzTyAu5a5gMFTSromk1kRY3C7e83OfcUuBYA= MIME-Version: 1.0 Received: by 10.223.14.140 with SMTP id g12mr1067983faa.50.1252335641200; Mon, 07 Sep 2009 08:00:41 -0700 (PDT) Date: Mon, 7 Sep 2009 11:00:41 -0400 X-Google-Sender-Auth: caeae2861ecb092b Message-ID: Subject: Re: Announce: Darwin module system From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001517503d740887570472fe1d3d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517503d740887570472fe1d3d Content-Type: text/plain; charset=ISO-8859-1 On Sun, 6 Sep 2009 22:27:03 -0400, Patrick Donnelly wrote: > Can you elaborate on key problems you are trying to solve and how you > solve them? Sure. The documentation at http://lua-users.org/wiki/JimJennings describes the design, but does not answer your question about the problem I'm trying to solve. And regarding the "how" question, the doc needs some pictures to make clear how it works. So I'll give it a go here, but without pictures. In this discussion, I'm talking about Lua code, although some of the issues apply to native (C) libraries also, because library functions are exposed as entries in a Lua table, just like Lua modules. I'll start with an example of the one Darwin function that you need to use if you want to use Darwin: structure.declare. structure.declare { name="pair"; signature={"cons", "car", "cdr", "isnull", "null"}; open={"_G"}; objects={"null"}; files="list.lua"; } The example above declares a module, which in Darwin is called a structure. It gives a name, "pair", which might be different from the module name used in the source code file. That file is "list.lua". There can be multiple files, by the way. The "open" clause lists the modules needed by "pair", of which there is only one: _G. (Darwin turns _G and the other standard libraries into structures.) If you don't specify a signature, then when you open "pair", you will get every global definition from "list.lua", which might be a lot of stuff. In this example, an explicit signature is provided, so any code that uses "pair" will only see cons, car, cdr, isnull, and null. Other modules use "pair" by listing "pair" in their own "open" clauses. For interactive use, you can call ' structure.open "pair" '. Or, you can simply issue ' require "pair" '. (The enhancement to the behavior of "require" is configurable.) The "objects" clause is not often needed. It's described in the documentation. See if you can figure out what it does before you look. Problems that Darwin tries to solve: (1) Isolation between modules Suppose I load Lua modules A and B, where B uses the functions of A. If my code modifies A, I can easily break B. I could redefine a function in A that B needs, for example. The scenario is more difficult to debug and recover from if it's not my code that changes A, but instead it's the code of another module, C, that does so. The modification to A might be intentional or accidental. When someone wrote B, they made a decision to use module A, and they wrote B with the expectation that A would behave the same way all the time. We can engineer an environment in which that assumption is true. When we load B and it requires A, we can provide B with a *copy* of A. Now, we don't want to copy the code of A, just the bindings to A's functions. If you think of a binding as being like a pointer, we are giving B pointers directly to A's functions. Darwin does this for every module that uses A. So when module C requires A, C gets a copy of the bindings to A's functions. Suppose A is the math module. C can redefine a math function, e.g. executing "math.cos = function(theta) ...", but the redefinition only affects the binding that C has. In other words, C now has a binding for math.cos that refers to its own cosine function. But the other modules, like B (as well as the "main" non-module code) have their own math.cos binding that continues to point to the original math.cos function. Naturally, the copies bindings take up some space, but not too much. They are "pointers" into the heap, not copies of the functions themselves. (I think that a few changes to the Lua implementation could enable a more space-efficient implementation, but I need to give this more thought.) There are other issues around isolation as well, including some that were recently pointed out on this list. One that springs to mind is that if module D uses "strict.lua" and module E is defined the using the module function and package.seeall, then E is also subject to the restrictions of "strict.lua", which may break E. David Manura pointed this out on this list on 13 Aug 2009. One more example: It is well-known that package.seeall exposes a "hole" in a module namespace, making it possible to access (read and write) the global environment through a module's table. (2a) Namespace control: Imports There are many ways to write Lua modules. I like the ones that return the module table, so that I can choose the name for the table of functions provided by the module, e.g. rtype = require "recordtype" Unfortunately, not too many modules are written this way, because it can be awkward to do so. A lot of modules create a table with a name that is fixed in the source code for the module. In fact, modules that use the Lua module function do this. I could write a loader that loads Lua modules wherever I want them to show up, so that I could re-use existing module code without having to edit its source. Darwin includes exactly such a feature, so that the same module source code can be used by different people with their functions appearing in different tables. E.g. person P might load the lfs library into a tabled called "luafilesystem" because P has already written a module called "lfs". Meanwhile, person Q accepts the default location for lfs functions. With the isolation described above, two modules in the same Lua state can use lfs in both of those ways at once. I.e. we can have one copy of lfs loaded, as well as modules P and Q loaded, where P uses lfs but sees its functions in a table called "luafilesystem", while Q sees the same functions in a table called "lfs". No one had to modify lfs to do this. (2b) Namespace control: Exports Several of the common ways to write Lua modules, including the way that uses the Lua "module" function, expose all of the non-local definitions to the user of the module. If I am the module author, I have to be careful not to accidentally leave a private function exposed. Darwin let's you specify an explicit list of exports if you want to. Otherwise, all the globals are exported. But catching accidental globals is not too hard to do. What's hard to do with the current module system is to provide multiple ways of using the same module. For example, I might write an object system that has two kinds of functions: (i) the set of functions that all users need almost all the time; and (ii) a set of functions that alter the behavior of the object system itself. The functions in (ii) are only needed by a few users, and furthermore are only needed when setting up the object system. Darwin allows you to declare multiple "views" on the same code. My object system can be written in the "normal way", i.e. so that it can be used with plain Lua. All the functions will be available. But I can make a Darwin structure declaration that contains two distinct sets of exported functions: (i) the normal-use functions, and (ii) the customization functions. Each set has its own module name, e.g. "LuaObjectSystemEnhancedRuntime" and "LOSER_customization". When someone uses my object system (LOSER), they can open one or both modules. Using either one will cause the code for LOSER to be loaded. If you open LuaObjectSystemEnhancedRuntime, you will only see the normal-use functions. If you open LOSER_customization, you will see only the customization functions. You can now open the latter module in the code that sets up your run-time environment, and you can open the former module in code that creates and uses LOSER objects. The benefit is the knowledge that your "regular code" has no access to the customization functions, so you know you cannot accidentally alter the behavior of LOSER in your code (or in code loaded by your code, or in code written by others, etc.). (3) Declarative dependency specification Once you have more than a handful of modules, some questions become both important and also hard to answer. One is: Which modules does module R require? As users of Lua Rocks know, it's useful to have a declarative specification for dependencies. The module systems that I like (from other languages) force the module author to list the dependencies of her/his module. Darwin does the same thing, but it also enforces it. When Darwin loads the source code for module S, it loads S into an environment that contains all of the declared dependencies of S, and nothing else. If you forget to list a dependency, S will fail (while loading, while testing, or while running, depending). What you cannot do is be tripped up by load order. Suppose I always load modules T, U, and V when I start Lua. With Lua Rocks, as far as I know, I could forget to list some dependency (such as T, U, or V) for my module S. I can use S through Rocks successfully, as can anyone else who happens to have the missing dependency, say T, already loaded. Eventually, someone may load S before T (or use S without T) and get an error. With Darwin, that error happens as soon as you declare the dependencies for S and then try to use S, because S is not loaded into the global environment (where T may or may not exist). Darwin loads S into its own private environment containing exactly the modules that S depends on, and no others. By the way, Darwin converts _G and the other standard libraries (coroutine, debug, io, etc.) into modules (which Darwin calls "structures"). A uniform treatment of all libraries/modules, whether standard or not, is a good thing. (4) Backwards compatibility Ok, this is not a problem I'm trying to solve, but it is a design goal. I don't want to replace the dynamic and flexible module system that Lua has today. I just want to add a new way of using existing and new modules -- a way that achieves the goals I've discussed here, as well as some others. With Darwin, the Lua package library continues to work as it always has [1]. Your "main" code and the modules that you load can all use "require" and the features in the Lua package table. If you do not declare any structures, everything will continue to be dynamic and you might fall into any of the traps discussed here as "problems I want to solve". When you want to isolate a module to protect it from intentional or accidental modification by other code, simply declare a structure that names the module and tells Darwin what file to load. (You can even use "require" to specify what Darwin should load -- you don't need to provide an absolute file name.) Suppose we make a declaration for module X. The next time your code (or the code of another module) issues ' require "X" ', Darwin will automatically provide X to whoever called "require". But the X will be a copy of the bindings for X. In other words, by declaring that X is a structure, we have enabled Darwin to make X available by creating a fresh table of the bindings for X for whoever calls ' require "X" '. Now no one can accidentally modify X or interfere with another module that uses X. Because of the backwards compatibility with existing code, you can make structure declarations for some or all of the modules you use. The module authors can release new versions, and you can use those new versions in most cases without changing your structure declarations. So you can have the benefits of run-time isolation and namespace control (etc.), even though the module authors know nothing of Darwin. Of course, if module authors use Darwin, they can include a structure declaration with their code. (The data in a declaration is just a Lua table.) That way, users can accept the default declaration if they wish to use the module with Darwin. Or, the user can alter the declaration to suit their needs. Since the declaration is separate from the code that implements the module, this is easy. Despite the length of this email, I'm sure there are things I am forgetting. The recent discussion on lua-l about the complexity of using modules is another example of something that Darwin can help with. If you take a set of dynamically-loadable modules that you want to use, and declare them as Darwin structures, you will have declared the dependencies (which you'd also do if you wrote a Rock spec). But you've also done more than that. You now have a set of declarations that will work (in Darwin) regardless of load order, regardless of the mix of Lua and C functions, and regardless of the module table and function names chosen by the module writers. If you are embedding a "complete Lua system", you can tell Darwin to set up the user environment (for user code) in any way you want. Maybe your platform initialization code needs access to some low-level configuration modules, but the user code should not see those modules at all. That is trivial to do with Darwin, because you get to declare the "user" structure (where user code runs) in the same way that you declare any other structure. Let me know if this has answered your question. At least I've now produced some more text for the documentation. :-) Jim [1] Except for a cross-platform issue regarding the naming of exports from native libraries... see the documentation under "Limitations". I can't fix this without one of: (i) a change to the Lua implementation, (ii) writing a trivial C library that will have to be part of Darwin, or (iii) adding a work-around that checks the os type at run-time. --001517503d740887570472fe1d3d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, 6 Sep 2009 22:27:03 -0400, Patrick Donnelly <batrick@batbytes.com> wrote:
> Can you el= aborate on key problems you are trying to solve and how you
> solve t= hem?

Sure. =A0The documentation at http://lua-users.org/wiki/JimJennings describes the design, bu= t does not answer your question about the problem I'm trying to solve. = =A0And regarding the "how" question, the doc needs some pictures = to make clear how it works. =A0So I'll give it a go here, but without p= ictures.=A0

In this discussion, I'm talking about Lua code, although some of th= e issues apply to native (C) libraries also, because library functions are = exposed as entries in a Lua table, just like Lua modules.

I'll s= tart with an example of the one Darwin function that you need to use if you= want to use Darwin: =A0structure.declare.

structure.declare {= name=3D"pair";
=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0=A0=A0 signature=3D{"cons", "car", &= quot;cdr", "isnull", "null"};
=A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 open=3D{"_G"};
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 objects=3D{"null"};
=A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 files=3D"list.lua";
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 }

The example above declares a module, which in Darwin is called a struct= ure.=A0 It gives a name, "pair", which might be different from th= e module name used in the source code file.=A0 That file is "list.lua&= quot;.=A0 There can be multiple files, by the way.=A0 The "open" = clause lists the modules needed by "pair", of which there is only= one: _G.=A0 (Darwin turns _G and the other standard libraries into structu= res.)=A0 If you don't specify a signature, then when you open "pai= r", you will get every global definition from "list.lua", wh= ich might be a lot of stuff.=A0 In this example, an explicit signature is p= rovided, so any code that uses "pair" will only see cons, car, cd= r, isnull, and null.

Other modules use "pair" by listing "pair" in their= own "open" clauses.=A0 For interactive use, you can call ' s= tructure.open "pair" '.=A0 Or, you can simply issue ' req= uire "pair" '.=A0 (The enhancement to the behavior of "r= equire" is configurable.)

The "objects" clause is not often needed.=A0 It's describ= ed in the documentation.=A0 See if you can figure out what it does before y= ou look.

Problems that Darwin tries to solve:

(1) Isolation b= etween modules

Suppose I load Lua modules A and B, where B uses the functions of A. = =A0If my code modifies A, I can easily break B. =A0I could redefine a funct= ion in A that B needs, for example. =A0The scenario is more difficult to de= bug and recover from if it's not my code that changes A, but instead it= 's the code of another module, C, that does so. =A0The modification to = A might be intentional or accidental.

When someone wrote B, they made a decision to use module A, and they wr= ote B with the expectation that A would behave the same way all the time. = =A0We can engineer an environment in which that assumption is true. =A0When= we load B and it requires A, we can provide B with a *copy* of A. =A0Now, = we don't want to copy the code of A, just the bindings to A's funct= ions. =A0If you think of a binding as being like a pointer, we are giving B= pointers directly to A's functions.

Darwin does this for every module that uses A. =A0So when module C requ= ires A, C gets a copy of the bindings to A's functions. =A0Suppose A is= the math module. =A0C can redefine a math function, e.g. executing "m= ath.cos =3D function(theta) ...", but the redefinition only affects th= e binding that C has. =A0In other words, C now has a binding for math.cos t= hat refers to its own cosine function. =A0But the other modules, like B (as= well as the "main" non-module code) have their own math.cos bind= ing that continues to point to the original math.cos function.

Naturally, the copies bindings take up some space, but not too much. = =A0They are "pointers" into the heap, not copies of the functions= themselves. =A0(I think that a few changes to the Lua implementation could= enable a more space-efficient implementation, but I need to give this more= thought.)

There are other issues around isolation as well, including some that we= re recently pointed out on this list. =A0One that springs to mind is that i= f module D uses "strict.lua" and module E is defined the using th= e module function and package.seeall, then E is also subject to the restric= tions of "strict.lua", which may break E. =A0David Manura pointed= this out on this list on 13 Aug 2009.

One more example: It is well-known that package.seeall exposes a "= hole" in a module namespace, making it possible to access (read and wr= ite) the global environment through a module's table.

(2a) Names= pace control: Imports

There are many ways to write Lua modules. =A0I like the ones that retur= n the module table, so that I can choose the name for the table of function= s provided by the module, e.g.

rtype =3D require "recordtype&qu= ot;

Unfortunately, not too many modules are written this way, because it ca= n be awkward to do so. =A0A lot of modules create a table with a name that = is fixed in the source code for the module. =A0In fact, modules that use th= e Lua module function do this.

I could write a loader that loads Lua modules wherever I want them to s= how up, so that I could re-use existing module code without having to edit = its source. =A0Darwin includes exactly such a feature, so that the same mod= ule source code can be used by different people with their functions appear= ing in different tables. =A0E.g. person P might load the lfs library into a= tabled called "luafilesystem" because P has already written a mo= dule called "lfs". =A0Meanwhile, person Q accepts the default loc= ation for lfs functions.

With the isolation described above, two modules in the same Lua state c= an use lfs in both of those ways at once. =A0I.e. we can have one copy of l= fs loaded, as well as modules P and Q loaded, where P uses lfs but sees its= functions in a table called "luafilesystem", while Q sees the sa= me functions in a table called "lfs". =A0No one had to modify lfs= to do this.

(2b) Namespace control: Exports

Several of the common ways to wr= ite Lua modules, including the way that uses the Lua "module" fun= ction, expose all of the non-local definitions to the user of the module. = =A0If I am the module author, I have to be careful not to accidentally leav= e a private function exposed. =A0Darwin let's you specify an explicit l= ist of exports if you want to. =A0Otherwise, all the globals are exported.<= br>
But catching accidental globals is not too hard to do. =A0What's ha= rd to do with the current module system is to provide multiple ways of usin= g the same module. =A0For example, I might write an object system that has = two kinds of functions: (i) the set of functions that all users need almost= all the time; and (ii) a set of functions that alter the behavior of the o= bject system itself. =A0The functions in (ii) are only needed by a few user= s, and furthermore are only needed when setting up the object system.

Darwin allows you to declare multiple "views" on the same cod= e. =A0My object system can be written in the "normal way", i.e. s= o that it can be used with plain Lua. =A0All the functions will be availabl= e. =A0But I can make a Darwin structure declaration that contains two disti= nct sets of exported functions: (i) the normal-use functions, and (ii) the = customization functions. =A0Each set has its own module name, e.g. "Lu= aObjectSystemEnhancedRuntime" and "LOSER_customization". =A0= When someone uses my object system (LOSER), they can open one or both modul= es. =A0Using either one will cause the code for LOSER to be loaded. =A0If y= ou open LuaObjectSystemEnhancedRuntime, you will only see the normal-use fu= nctions. =A0If you open LOSER_customization, you will see only the customiz= ation functions. =A0You can now open the latter module in the code that set= s up your run-time environment, and you can open the former module in code = that creates and uses LOSER objects. =A0The benefit is the knowledge that y= our "regular code" has no access to the customization functions, = so you know you cannot accidentally alter the behavior of LOSER in your cod= e (or in code loaded by your code, or in code written by others, etc.).

(3) Declarative dependency specification

Once you have more than= a handful of modules, some questions become both important and also hard t= o answer. =A0One is: =A0Which modules does module R require? =A0As users of= Lua Rocks know, it's useful to have a declarative specification for de= pendencies. =A0The module systems that I like (from other languages) force = the module author to list the dependencies of her/his module. =A0Darwin doe= s the same thing, but it also enforces it.

When Darwin loads the source code for module S, it loads S into an envi= ronment that contains all of the declared dependencies of S, and nothing el= se. =A0If you forget to list a dependency, S will fail (while loading, whil= e testing, or while running, depending).

What you cannot do is be tripped up by load order. =A0Suppose I always = load modules T, U, and V when I start Lua. =A0With Lua Rocks, as far as I k= now, I could forget to list some dependency (such as T, U, or V) for my mod= ule S. =A0I can use S through Rocks successfully, as can anyone else who ha= ppens to have the missing dependency, say T, already loaded. =A0Eventually,= someone may load S before T (or use S without T) and get an error.

With Darwin, that error happens as soon as you declare the dependencies= for S and then try to use S, because S is not loaded into the global envir= onment (where T may or may not exist). =A0Darwin loads S into its own priva= te environment containing exactly the modules that S depends on, and no oth= ers.

By the way, Darwin converts _G and the other standard libraries (corout= ine, debug, io, etc.) into modules (which Darwin calls "structures&quo= t;). =A0 A uniform treatment of all libraries/modules, whether standard or = not, is a good thing.

(4) Backwards compatibility

Ok, this is not a problem I'm tr= ying to solve, but it is a design goal. =A0I don't want to replace the = dynamic and flexible module system that Lua has today. =A0I just want to ad= d a new way of using existing and new modules -- a way that achieves the go= als I've discussed here, as well as some others.

With Darwin, the Lua package library continues to work as it always has= [1]. =A0Your "main" code and the modules that you load can all u= se "require" and the features in the Lua package table. =A0If you= do not declare any structures, everything will continue to be dynamic and = you might fall into any of the traps discussed here as "problems I wan= t to solve".

When you want to isolate a module to protect it from intentional or acc= idental modification by other code, simply declare a structure that names t= he module and tells Darwin what file to load. =A0(You can even use "re= quire" to specify what Darwin should load -- you don't need to pro= vide an absolute file name.) =A0Suppose we make a declaration for module X.=

The next time your code (or the code of another module) issues ' re= quire "X" ', Darwin will automatically provide X to whoever c= alled "require". =A0But the X will be a copy of the bindings for = X. =A0In other words, by declaring that X is a structure, we have enabled D= arwin to make X available by creating a fresh table of the bindings for X f= or whoever calls ' require "X" '. =A0Now no one can accid= entally modify X or interfere with another module that uses X.

Because of the backwards compatibility with existing code, you can make= structure declarations for some or all of the modules you use. =A0The modu= le authors can release new versions, and you can use those new versions in = most cases without changing your structure declarations. =A0So you can have= the benefits of run-time isolation and namespace control (etc.), even thou= gh the module authors know nothing of Darwin.

Of course, if module authors use Darwin, they can include a structure d= eclaration with their code. =A0(The data in a declaration is just a Lua tab= le.) =A0That way, users can accept the default declaration if they wish to = use the module with Darwin. =A0Or, the user can alter the declaration to su= it their needs. =A0Since the declaration is separate from the code that imp= lements the module, this is easy.

Despite the length of this email, I'm sure there are things I am fo= rgetting. =A0The recent discussion on lua-l about the complexity of using m= odules is another example of something that Darwin can help with. =A0If you= take a set of dynamically-loadable modules that you want to use, and decla= re them as Darwin structures, you will have declared the dependencies (whic= h you'd also do if you wrote a Rock spec). =A0But you've also done = more than that.

You now have a set of declarations that will work (in Darwin) regardles= s of load order, regardless of the mix of Lua and C functions, and regardle= ss of the module table and function names chosen by the module writers. =A0= If you are embedding a "complete Lua system", you can tell Darwin= to set up the user environment (for user code) in any way you want. =A0May= be your platform initialization code needs access to some low-level configu= ration modules, but the user code should not see those modules at all. =A0T= hat is trivial to do with Darwin, because you get to declare the "user= " structure (where user code runs) in the same way that you declare an= y other structure.

Let me know if this has answered your question.=A0 At least I've no= w produced some more text for the documentation.=A0 :-)

Jim

[= 1] Except for a cross-platform issue regarding the naming of exports from n= ative libraries... see the documentation under "Limitations". =A0= I can't fix this without one of: (i) a change to the Lua implementation= , (ii) writing a trivial C library that will have to be part of Darwin, or = (iii) adding a work-around that checks the os type at run-time.



--001517503d740887570472fe1d3d-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 12:39:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87FdVuw002412; Mon, 7 Sep 2009 12:39:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA3DB18858; Mon, 7 Sep 2009 12:38:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECA411883D for ; Mon, 7 Sep 2009 12:38:50 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MkgIo-0002RJ-Ry for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 15:38:47 +0000 From: "John Hind" To: "'Lua list'" References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> In-Reply-To: Subject: RE: Is a Lua system easily embeddable? Date: Mon, 7 Sep 2009 16:37:56 +0100 Message-ID: <003801ca2fd1$2bcc7390$83655ab0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acovvfpp/O1ojHC6SvqgWZhm8xHO1QAErC9w Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks Paul! I will give this technique a try in Grunt as it does look easier (and more efficient) than a VFS solution. If we can put DLLs as well as Lua scripts in resources this would be a self-contained solution to packaging Lua applications in executable form. Sadly though, Windows only - but you cannot have everything! > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley > Sent: 07 September 2009 14:20 > To: Lua list > Subject: Re: Is a Lua system easily embeddable? > > Googling for "dll from memory" (without quotes) turns up > http://www.joachim-bauch.de/tutorials/load_dll_memory.html which > starts by describing the appropriate structures and methods, and then > has an MPL licensed library to load DLLs from memory. > > On Mon, Sep 7, 2009 at 11:29 AM, Paul Moore wrote: > > 2009/9/7 Jerome Vuarand : > >> Just for the sake of precision, I'd like to point that while the > >> standard Windows DLL loader is not capable of loading DLLs from > >> another DLL resource, afaik all its features are reproducible in > user > >> code (it's not using kernel black magic). Therefore it's possible to > >> load DLLs from anywhere. Some libraries out there allow loading DLLs > >> from in-memory buffers with the exact same capabilities and > interface > >> as the standard win32 LoadLibrary+GetProcAddress. > > > > Ooh! Can you provide pointers? Or at least suitable phrases to Google > > for? I've been interested in this for ages, but never found anything > > usable... > > > > Paul > > From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:05:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87H5sgq010400; Mon, 7 Sep 2009 14:05:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B67C21A67A; Mon, 7 Sep 2009 14:05:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28E101A676 for ; Mon, 7 Sep 2009 14:05:16 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MkheR-0006F1-3o for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 19:05:11 +0200 Received: from athedsl-4487258.home.otenet.gr ([94.71.68.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 19:05:11 +0200 Received: from petsagouris by athedsl-4487258.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 19:05:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: The source file culture Date: Mon, 7 Sep 2009 17:04:46 +0000 (UTC) Lines: 24 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.71.68.98 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I really appreciate the efforts of all authors that contribute C modules for Lua. It really makes it clear that Lua community is very much alive and kicking. As much as I love Lua, I am a Windows guy and that as a fact is making hard for me to appreciate the functionality of such modules. I am pretty sure that there are even more people that hit a full stop when they encounter the need to compile a specific Lua extension that they have found. The lack of C knowledge is a severe hit to the common Lua scripter, although the module authoring in its entirety (only some few commentable efforts are excluded) is ignoring the windows operating system and doesn't release compiled binaries for the win32. I would like to know why such culture exists. Is there something I am missing on how to easily obtain compiled binaries (apart from the Lua-aio, Lua4win, and the rest)? Best regards, George Petsagourakis From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:21:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HKwo9012063; Mon, 7 Sep 2009 14:20:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24D41186F2; Mon, 7 Sep 2009 14:20:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3666B186DA for ; Mon, 7 Sep 2009 14:20:28 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mkht5-0000gv-CF for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 18:20:19 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 2BB5E80428 for ; Mon, 7 Sep 2009 18:20:18 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:39908 with envelope Message-ID: <4AA540CA.2080004@cowlark.com> Date: Mon, 07 Sep 2009 18:20:10 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n87HKwo9012063 George Petsagourakis wrote: [...] > The lack of C knowledge is a severe hit to the common > Lua scripter, although the module authoring in its > entirety (only some few commentable efforts are excluded) > is ignoring the windows operating system and doesn't > release compiled binaries for the win32. > > I would like to know why such culture exists. Because the world is bigger than Windows, and Lua is fundamentally an *embeddable* language for which source code is the most useful thing to have. Distributing binaries is hard, and there's no real point when most users are going to need to recompile everything anyway. That said, there is a fairly small group of people like you who want Windows binaries, and this is precisely what Lua For Windows is for: http://luaforwindows.luaforge.net/ It's the *official* unofficial Windows binary distribution. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:22:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HMlfc012239; Mon, 7 Sep 2009 14:22:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28D631A614; Mon, 7 Sep 2009 14:22:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9058A1A59E for ; Mon, 7 Sep 2009 14:22:22 -0300 (BRT) Received: by fxm25 with SMTP id 25so1867794fxm.5 for ; Mon, 07 Sep 2009 10:22:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.126.3 with SMTP id d3mr6234282mun.101.1252344140131; Mon, 07 Sep 2009 10:22:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Sep 2009 12:22:20 -0500 Message-ID: <90eb1dc70909071022u3117814bqcd9b0e2c55fd8362@mail.gmail.com> Subject: Re: The source file culture From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 7, 2009 at 12:04 PM, George Petsagourakis wrote: > I would like to know why such culture exists. i know it wasn't your intention; but i had to read the whole message several times to stop finding this line offensive. note that nobody is specifically ignoring any demographics; it's just that it might just not be what we want when we release code. note that it's always 'code' what's released from enthusiasts like us. code is what we breathe, inhale and exhale. it's the natural product of just being, and the main means of communications. 'modules' OTOH, are work, done when you want to have something done. personally i'm flattered when somebody takes the effort to transform some of my code into something usable by other people; but i seldom have the motivation to do it myself. so there you go, my personal view of what you call 'such a culture'. i'm honestly glad to see my code go where i didn't thought, but it's not my goal. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:36:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HaLNH013557; Mon, 7 Sep 2009 14:36:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA356187D5; Mon, 7 Sep 2009 14:35:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23CF8187A6 for ; Mon, 7 Sep 2009 14:35:44 -0300 (BRT) Received: from [192.168.254.14] (os-dsl-0230.bmts.com [216.183.152.231]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n87HZVcV011701 for ; Mon, 7 Sep 2009 13:35:39 -0400 Message-ID: <4AA54463.9030201@hempeldesigngroup.com> Date: Mon, 07 Sep 2009 13:35:31 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <90eb1dc70909071022u3117814bqcd9b0e2c55fd8362@mail.gmail.com> In-Reply-To: <90eb1dc70909071022u3117814bqcd9b0e2c55fd8362@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Javier Guerra wrote: > On Mon, Sep 7, 2009 at 12:04 PM, George > Petsagourakis wrote: >> I would like to know why such culture exists. > > i know it wasn't your intention; but i had to read the whole message > several times to stop finding this line offensive. After editing a number of tech books by non-native (or just awkward) english speakers, I read most text now assuming that the writer's intent is to not offend. Most writers that try to offend put more than one such line in a messgage :-) I read that line as: I am curious why it seems that most Lua modules come in source code form. Ralph From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:51:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HplfQ014906; Mon, 7 Sep 2009 14:51:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1A7318C79; Mon, 7 Sep 2009 14:51:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74DF618BB2 for ; Mon, 7 Sep 2009 14:51:18 -0300 (BRT) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090907175116.LGCJ6611.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Mon, 7 Sep 2009 18:51:16 +0100 Received: from [192.168.1.10] (really [80.6.1.228]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090907175116.EJBT2093.aamtaout03-winn.ispmail.ntl.com@[192.168.1.10]> for ; Mon, 7 Sep 2009 18:51:16 +0100 Message-ID: <4AA54811.8000307@ntlworld.com> Date: Mon, 07 Sep 2009 18:51:13 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=iTf9igl2obZ00giwOLEA:9 a=6Z326tIkXksA1jSGLUoA:7 a=fclGtH2WFPy4t1TzHpwJStKQnL4A:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I would like to know why such culture exists. > I'd love to be able to understand the reverse, why do people insist on downloading binaries? There could be any manner of virus or back door in binary, at least if its source code I can audit it myself, better yet I can fix it too. I've been able to teach a number of people basic programming and compiling skills, even people who have left school without qualifications, its just not as difficult as it looks. In many cases a developer is only too glad to help out someone who is struggling with their beloved creation... Best Chris -- Disclaimer: By sending an email to ANY of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:52:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HqfiG015003; Mon, 7 Sep 2009 14:52:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1154018EF2; Mon, 7 Sep 2009 14:52:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1828A18CD2 for ; Mon, 7 Sep 2009 14:52:15 -0300 (BRT) Received: by bwz10 with SMTP id 10so1166177bwz.5 for ; Mon, 07 Sep 2009 10:52:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.80.25 with SMTP id h25mr6288159mul.15.1252345933553; Mon, 07 Sep 2009 10:52:13 -0700 (PDT) In-Reply-To: <4AA54463.9030201@hempeldesigngroup.com> References: <90eb1dc70909071022u3117814bqcd9b0e2c55fd8362@mail.gmail.com> <4AA54463.9030201@hempeldesigngroup.com> Date: Mon, 7 Sep 2009 12:52:11 -0500 Message-ID: <90eb1dc70909071052m1652aeabu2f40f2a5fcb8d455@mail.gmail.com> Subject: Re: The source file culture From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n87HqfiG015003 On Mon, Sep 7, 2009 at 12:35 PM, Ralph Hempel wrote: > Most writers that try to offend put more than one such > line in a messgage :-) totally right. that's why i took the effort to read it until i could understand the writer's point of view. > I read that line as: > >  I am curious why it seems that most Lua modules come >  in source code form. and that's what David and I answered. :-) i'd like to add that even if the Lua community, being more 'source code oriented' and therefore targeted at developers; here everybody is welcomed and encouraged to ask for help and insights, Just like Petsagourakis did. If somebody needs help compiling, somebody else will offer advice. if the task is seen as needlessly complicated, odds are that somebody else make it simpler. and if somebody just wants to know why we are like we are... it's because we're like that! :-) -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:57:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HuwEk015462; Mon, 7 Sep 2009 14:56:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32C88192B3; Mon, 7 Sep 2009 14:56:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 416D019297 for ; Mon, 7 Sep 2009 14:56:24 -0300 (BRT) Received: by bwz10 with SMTP id 10so1168173bwz.5 for ; Mon, 07 Sep 2009 10:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=hrFqudxLDIYWACtye+L4Tu3E9U6G2xZE9nvLDM3dfCQ=; b=RX3v7cbb1CDgjUaMawyyJVivNbUOcq4Re3yKx3Z8eeu722XGZ5UrgpvAXaW3cR6iV9 w4r/iFheVZPOZv3SrsOwJ5hu+Ry2zyL/l/urFpy4N3fh08Vqj1tL41qD1UaWvCR0uHXW uBhRbwg+l7aqfRvNuEn4JcjwsigrqkUGziaJM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rC/ElRA5ibamgsoS5UuitwNnsp96x0fqwA9tViP/05oAPzSGKVMh5K2iE3Ql6XPKvj KOdTJ33tz/DafMS2oNWLtGSyZ0XEDuh4/pCih14ifIZhrJ57OziZW+CXGHG3jDRbOezA cqERvx1PgZYn/Gx8z4CwaNpAO3jVKZl9EI9PE= MIME-Version: 1.0 Received: by 10.204.25.152 with SMTP id z24mr12280724bkb.44.1252346181899; Mon, 07 Sep 2009 10:56:21 -0700 (PDT) Date: Mon, 7 Sep 2009 20:56:21 +0300 Message-ID: Subject: Re: The source file culture From: Georgios Petsagourakis To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00032555d43e4ed50c04730091f6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555d43e4ed50c04730091f6 Content-Type: text/plain; charset=UTF-8 Indeed my intention was not to irritate/get flamed/annoy or degrade any of the module/extension authors. Thanks Ralph Hempel for the clarification. My comment stems from the fact that there are quite a lot of people who are using Windows, and really there is nothing we can do other than open the code with a text editor and look at it unless we are into C programming. Taking this as a fact implies that in order to script Lua, you need to be able to program in C which blows away all the simple to use syntax concept of Lua, that is the main selling point to non programmers. I do realize that Lua isn't about getting it out and that it is meant to be embedded in another host program but it has gotten beyond that scope, for quite some years now, especially since the release of the Kepler project. I feel the need to express that the community should be ready, for example, when the Apache includes Lua support with their next release. Best Regards,... George Petsagourakis --00032555d43e4ed50c04730091f6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Indeed my intention was not to irritate/get flamed/annoy or degrade any of = the module/extension authors. Thanks Ralph Hempel for the clarification.
My comment stems from the fact that there are quite a lot of people wh= o are using Windows, and really there is nothing we can do other than open = the code with a text editor and look at it unless we are into C programming= . Taking this as a fact implies that in order to script Lua, you need to be= able to program in C which blows away all the simple to use syntax concept= of Lua, that is the main selling point to non programmers.
I do realize that Lua isn't about getting it out and that it is meant t= o be embedded in another host program but it has gotten beyond that scope, = for quite some years now, especially since the release of the Kepler projec= t. I feel the need to express that the community should be ready, for examp= le, when the Apache includes Lua support with their next release.

Best Regards,...
George Petsagourakis
--00032555d43e4ed50c04730091f6-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 14:57:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87HvUCo015542; Mon, 7 Sep 2009 14:57:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFCD11926F; Mon, 7 Sep 2009 14:56:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-6.csi.cam.ac.uk (ppsw-6.csi.cam.ac.uk [131.111.8.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1291E19297 for ; Mon, 7 Sep 2009 14:56:43 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:44590) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpa (EXTERNAL:fanf2) id 1MkiSF-00026n-Jv (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Mon, 07 Sep 2009 18:56:39 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MkiSF-0003fy-59 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Mon, 07 Sep 2009 18:56:39 +0100 Date: Mon, 7 Sep 2009 18:56:39 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua-L Subject: LPEG span() Message-ID: User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Why does LPEG's span() function use strspn() in its implementation instead of the ISpan instruction? Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:06:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87I65cd016479; Mon, 7 Sep 2009 15:06:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EAE219343; Mon, 7 Sep 2009 15:05:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f189.google.com (mail-pz0-f189.google.com [209.85.222.189]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FE0A192A1 for ; Mon, 7 Sep 2009 15:05:32 -0300 (BRT) Received: by pzk27 with SMTP id 27so2664175pzk.9 for ; Mon, 07 Sep 2009 11:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=IHwNC3lGbKjnG70cFnkcSUZzoOc0Sc9lhby9vB1fLoI=; b=q//ulmNMFiyB3aUpnf22a1+AraPC7cwZp8InGl5PYk3N0IvCUEmsHSVPSdxaXK4cAl /4nZMOaKBSuHtWI8sfamv1CFuhYovQAD8ewn5a4UQ7UkfTFm48S3lZgyErI07tCRTEf0 v5pewTqUTzqtpbi3jgANwGSjpeYGf3yl1HT+8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=kIOusTrgKad+xKSLKv9vNWM95YV1Znbhvn1y2m+i2XpMdVMiz62yzPKHsgQoDezelL LdCQtEoK8wQfu2TdUNpBPR509LJof3Vv/7VLKM/2Xaq8e4MWgEelUqEaK861+iUUMTF8 ZB09CvvkV/6fhk6Bt38KXCbCHSl5LBamtuswU= Received: by 10.114.45.13 with SMTP id s13mr4904295was.167.1252346730580; Mon, 07 Sep 2009 11:05:30 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 23sm31017pzk.0.2009.09.07.11.05.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 11:05:30 -0700 (PDT) Message-ID: <4AA54B66.4040601@gmail.com> Date: Tue, 08 Sep 2009 02:05:26 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean George Petsagourakis wrote: > [snip] > The lack of C knowledge is a severe hit to the common > Lua scripter, although the module authoring in its > entirety (only some few commentable efforts are excluded) > is ignoring the windows operating system and doesn't > release compiled binaries for the win32. > > I would like to know why such culture exists. In my case, I dump a lot of quirky stuff on LuaForge; supporting them is a time sink. Too many time sinks that have no benefit to me means they are a waste of time, or time and effort donated. So, I think preparing executables that support very few users is a waste of my time. Now, if we are talking about a major piece of work like a popular FLOSS editor, then that's a different story. We have to triage our time. That's why for Quylthulg I used a project name that I cannot even spell... :-) Time and effort are very limited resources. Developer resources are very limited resources. There is always too little to go around in FLOSS projects. Most of us don't have a one-click-to-create-binaries-for-multiple-platforms set up. Most minor projects get nothing in return for all the hours and effort put in, no contributed code, no feedback. It's not like in LKML where they can afford to routinely diss people. Now, if you were paying good money for the modules, I would agree that you should get good support. But hey, as I have said, it's mostly used as all free-as-in-beer, and if there are few users or few downloads, the case for preparing all sorts of executables in a reliable manner isn't very good. I don't even try because I don't want people to depend on me for those executables at all. I agree with the other posting that those who want to use modules in executable form should look to the aggregators who package modules, such as Lua for Windows. Or rather, look at Perl, IIRC when a module gets into the main codebase, it gets supported by Perl itself. I think a mature platform will have to subsume codebases of most modules in this manner. Yeah, to some users, it sucks, but I think we're making do to the best of our interests here. If this was a billion-dollar market, then of course, things would be different... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:13:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87IDWGC017176; Mon, 7 Sep 2009 15:13:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EAEA19369; Mon, 7 Sep 2009 15:13:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dottedmag.net (burger.dottedmag.net [212.75.37.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 743D0187D2 for ; Mon, 7 Sep 2009 15:13:04 -0300 (BRT) Received: from vertex (unknown [91.197.127.125]) by dottedmag.net (Postfix) with ESMTPSA id 5368F8C06C for ; Mon, 7 Sep 2009 20:12:59 +0200 (CEST) Received: from dottedmag by vertex with local (Exim 4.69) (envelope-from ) id 1Mkii0-000460-Iy for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 01:12:56 +0700 From: Mikhail Gusarov To: Lua list Subject: Re: The source file culture References: <4AA54B66.4040601@gmail.com> Date: Tue, 08 Sep 2009 01:12:55 +0700 In-Reply-To: <4AA54B66.4040601@gmail.com> (KHMan's message of "Tue, 08 Sep 2009 02:05:26 +0800") Message-ID: <8763bu62u0.fsf@vertex.dottedmag.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-=-= Content-Transfer-Encoding: quoted-printable Twas brillig at 02:05:26 08.09.2009 UTC+08 when keinhong@gmail.com did gyre= and gimble: K> Time and effort are very limited resources. Developer resources are K> very limited resources. There is always too little to go around in K> FLOSS projects. In addition it's always beneficial to make efforts concentrated: makers of Linux distributions can package a lot of Lua modules much more efficiently than authors of modules, and the same applies to Lua-on-Windows, already mentioned in this thread. =2D-=20 http://fossarchy.blogspot.com/ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAEBCgAGBQJKpU0oAAoJEJ0g9lA+M4iIDegQAInmfzExevWhgaJaRXXKIbAo XzOmJTVad8X5ZO+qKfvohZEB6S3beEl4MJ87KkduvDSWtOpV1B9fJyzJ2Kf8ms7l VqVlLb1ieyml0kJQWtHULYv/vDceXh03ZrtYMiPUzucP0iwEnTz8HCsa61bvhM5G Vdu5tDgpC28dW/TWEKAXol4ErABv5RburB2Q6Kp0k/r8721nZ7NFQSW0d1WmlPUn 3uAYTbGWw75tvVSTh5zy05Hn8IJ9IP/kk1E/BgDk1XW104xhGxJMeEYVvH3l6wSq CWPqjbTJmLNv+Kzefv7kJ72rD8PnHPwvVAXnFegeret0YDmy6e4v+P3zmMJwpB4/ tGi0wdWPIPDDsoNZGF4Kig7WcLrfvUKlbhAccapCUOXe5oO6+rQhoy8BuHiNyIfN zfhyHHb6d1+KS7l+cbxQN8DXXKgzKnPsXnmnK32KVgZNfpqgA5jKXc0DtDgKd2gj j6Wj2JfFOhp3i9fJd5pXr/Tubsr+o2ryD2Z+ZV4bdE1hS8z3Y7DDkIxdVnsT1wul /vf0pKe674Tcj6Mmt1yO7lZAx2IlwbMQZ/qrYFdjhDJtr4xYqn5gl5CWm2O1EKFo poTM/92NIGXpMeepzErDPN6lKMQmbcsifeGslzyO0W64ay5ebFEru5GAX0VnaNxV o32z1X2pngtauYXg6n4W =CcxZ -----END PGP SIGNATURE----- --=-=-=-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:24:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87IOVfC018196; Mon, 7 Sep 2009 15:24:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D886119377; Mon, 7 Sep 2009 15:24:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6B5B19366 for ; Mon, 7 Sep 2009 15:23:57 -0300 (BRT) Received: by vws33 with SMTP id 33so1871420vws.33 for ; Mon, 07 Sep 2009 11:23:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.3.213 with SMTP id 21mr1523217vco.8.1252347835080; Mon, 07 Sep 2009 11:23:55 -0700 (PDT) In-Reply-To: <8763bu62u0.fsf@vertex.dottedmag.net> References: <4AA54B66.4040601@gmail.com> <8763bu62u0.fsf@vertex.dottedmag.net> From: Phoenix Sol Date: Mon, 7 Sep 2009 13:23:35 -0500 Message-ID: <8a25d01b0909071123g32837fu4cb00bc0e218c86f@mail.gmail.com> Subject: Re: The source file culture To: Lua list Content-Type: multipart/alternative; boundary=00151757437cd86268047300f377 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151757437cd86268047300f377 Content-Type: text/plain; charset=ISO-8859-1 CODE GOOD ( WANT ) BINAREES BAD ( DO NOT WANT ) --00151757437cd86268047300f377 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
CODE GOOD=A0 ( WANT )
BINAREES BAD=A0 ( DO NOT WANT )



--00151757437cd86268047300f377-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:29:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87ITAYd018626; Mon, 7 Sep 2009 15:29:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF0B31937E; Mon, 7 Sep 2009 15:28:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f202.google.com (mail-px0-f202.google.com [209.85.216.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2424019375 for ; Mon, 7 Sep 2009 15:28:39 -0300 (BRT) Received: by pxi40 with SMTP id 40so2831061pxi.5 for ; Mon, 07 Sep 2009 11:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=VYISEBTc9Qq3cYN+wjKWuA0oIyTbMa9q8ouAgQ8O5nc=; b=rrHu8hr4lrYGwHh8v4B2teQdyIpI6+I0ocrsiHwPeOsMKnR6/zDVrxJAxl3IJlCVJz BL5aB/Nl0jOz9kApZ2VSz9lRaacglQWMBjamzFsT72BWWslES6iYoZKX+YzT7AVAWS1V QKl1awyXUqS8kPhg0IfUMSxLw9uZzGMdnaurQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=k2WtOW/RszPpwKfHasHSxPZl+mrgsx4ezp2O+aojcOpS7mzBdgYLdL/rhRJuTvfqxJ GFA0HrAWQh4M8uFEVUHGMSKxrbfk5e04cZI2qIRq92KUfP0gOaJbXOUD+a0c834gcxKF Xg5n4GDoBAvUhEi0wDT5K8Yn3ygj15Z01R0nE= Received: by 10.114.55.7 with SMTP id d7mr15879910waa.129.1252348116421; Mon, 07 Sep 2009 11:28:36 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 20sm38309pzk.9.2009.09.07.11.28.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 11:28:34 -0700 (PDT) Message-ID: <4AA550CF.7000104@gmail.com> Date: Tue, 08 Sep 2009 02:28:31 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA54B66.4040601@gmail.com> <8763bu62u0.fsf@vertex.dottedmag.net> In-Reply-To: <8763bu62u0.fsf@vertex.dottedmag.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mikhail Gusarov wrote: > Twas brillig at 02:05:26 08.09.2009 UTC+08 when keinhong@gmail.com did gyre and gimble: > > K> Time and effort are very limited resources. Developer resources are > K> very limited resources. There is always too little to go around in > K> FLOSS projects. > > In addition it's always beneficial to make efforts concentrated: makers > of Linux distributions can package a lot of Lua modules much more > efficiently than authors of modules, and the same applies to > Lua-on-Windows, already mentioned in this thread. Yeah, I think pure end users should go for a reliable platform, one where effort is put in by a group of people. If a pure end user go for single-author modules, that can be risky. The Lua ecosystem is still small compared to Perl or Python, given limited resources, a Lua platform will take a longer time to form and mature. Large FLOSS projects tend to be more self-sustaining and are able to attract more developers. Small or obscure FLOSS projects need very strong-willed developers to sustain the project over multiple years -- which can be a rare thing. I think pure end users who want something that they can rely on for multiple years, who want a certain level of peace-of-mind that the kaboodle will usually always work, should strongly support the Lua platform initiatives. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:34:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87IY6wY019150; Mon, 7 Sep 2009 15:34:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D8B219338; Mon, 7 Sep 2009 15:33:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og113.obsmtp.com (exprod7og113.obsmtp.com [64.18.2.179]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5545B19329 for ; Mon, 7 Sep 2009 15:33:35 -0300 (BRT) Received: from source ([209.85.218.212]) by exprod7ob113.postini.com ([64.18.6.12]) with SMTP ID DSNKSqVR/UJ6qBPUwCUOXm+zWIp0vNLl9qmy@postini.com; Mon, 07 Sep 2009 11:33:35 PDT Received: by bwz8 with SMTP id 8so2356314bwz.4 for ; Mon, 07 Sep 2009 11:33:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.98.19 with SMTP id o19mr5566216fan.82.1252348410805; Mon, 07 Sep 2009 11:33:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Sep 2009 19:33:30 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/7 George Petsagourakis : > I really appreciate the efforts of all authors that > contribute C modules for Lua. It really makes it clear > that Lua community is very much alive and kicking. > As much as I love Lua, I am a Windows guy and that > as a fact is making hard for me to appreciate the > functionality of such modules. I am pretty sure that > there are even more people that hit a full stop when > they encounter the need to compile a specific Lua > extension that they have found. To those who live in a Windows world, the non-distribution of binaries can be mystifying or infuriating. Equally, to those of us who live in a standards-based world, life is simply too short. The project to which I devote most time, GNU Zile, runs on over 20 platforms. I don't distribute binaries for any of them, even the one I use, as it's not easy. There are at least two things to consider: first, distributing compiled Cprograms. I could cross-compile for Windows, but it turns out that even Windows users can't agree on what C runtime to use, so I'd have to ship 2 or 3 flavours. Secondly, there's platform-specific packaging. I don't have time to learn how to package for Windows, Cygwin, Ubuntu, Debian, RedHat, FreeBSD, NetBSD, OpenBSD &c., and there's no tool I'm aware of that lets me automatically package for all of them. (This is not a surprise, as Linux distributions at least tend to have quite complex packaging rules.) In any case, for most of the programs I work on, there are already people packaging them for most platforms. Perhaps a more cogent question to ask is why people still use C, when they could at least solve the executable side by languages which are either interpreted or compiled to a platform-neutral format, such as the JVM or CLR. But again, the answer is obvious: we still use a lot of software written in C, so we want to bind to it. One might also plead specially in favour of the few platforms with the most users, Windows chief amongst them, and indeed many programs, Lua included, have binary distributions for Windows, GNU/Linux and Mac OS. But as contributors to this thread have already said, we don't all have the time or motivation for that. Personally, most of my C programs are distributed in source form with a GNU autotools build system. This is the best I can do for the largest number of users: my end of the deal is simply to write to various standards, mostly POSIX, and autotools takes care of the platform (including Cygwin and MingW on Windows, but sadly, as far as I know, not the Microsoft toolchain). If something as easy to use as autotools with the same range of support came along tomorrow, I might well consider using it; in the mean time, I write as little C as I can (most of the code I write these days is in Lua or Perl). > The lack of C knowledge is a severe hit to the common > Lua scripter, Not really. With distribution systems like gems or even good old autotools, you don't need to know anything about programming, you just need a toolchain installed and be able to read a README and issue a command or two. Unfortunately, Windows does not make this an attractive option; I'm glad to see that these days at least Mac OS does. > although the module authoring in its > entirety (only some few commentable efforts are excluded) > is ignoring the windows operating system and doesn't > release compiled binaries for the win32. That's not "ignoring the Windows operating system", that's "not making special allowance for the Windows operating system". Most of my C programs run on Windows (though its standards support, unless you go to third parties, is not what it should be). The points that other contributors have made about the ability to read and fix source code are of more minority interest: trojans are just as easy to insert into source as into binary code, while being able to fix or improve code, a freedom I exercise and value highly, is not of interest to many users per se (though its existence is important). -- http://rrt.sc3d.org Music is sweetest when it almost stops From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:40:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87IeJpu019822; Mon, 7 Sep 2009 15:40:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2CA2319387; Mon, 7 Sep 2009 15:39:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og127.obsmtp.com (exprod7og127.obsmtp.com [64.18.2.210]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4ECE719382 for ; Mon, 7 Sep 2009 15:39:49 -0300 (BRT) Received: from source ([209.85.218.213]) by exprod7ob127.postini.com ([64.18.6.12]) with SMTP ID DSNKSqVTcy7l+1genM/t0xEcpNAjeefcVGrw@postini.com; Mon, 07 Sep 2009 11:39:49 PDT Received: by bwz9 with SMTP id 9so2267767bwz.41 for ; Mon, 07 Sep 2009 11:39:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.7.90 with SMTP id c26mr5623612fac.73.1252348786584; Mon, 07 Sep 2009 11:39:46 -0700 (PDT) In-Reply-To: <4AA550CF.7000104@gmail.com> References: <4AA54B66.4040601@gmail.com> <8763bu62u0.fsf@vertex.dottedmag.net> <4AA550CF.7000104@gmail.com> Date: Mon, 7 Sep 2009 19:39:46 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n87IeJpu019822 2009/9/7 KHMan : > > Yeah, I think pure end users should go for a reliable platform, one where > effort is put in by a group of people. If a pure end user go for > single-author modules, that can be risky. The Lua ecosystem is still small > compared to Perl or Python, given limited resources, a Lua platform will > take a longer time to form and mature. Being "reliable" has nothing to do with number of contributors, nor whether a program is distributed as source or binary. In general, source will last longer before rotting, and is easier to fix when it does rot, but the most important thing is the quality of the code (in particular, how portably it is written) and the commitment of the maintainers. > I think pure end users who want something that they can rely on for multiple > years, who want a certain level of peace-of-mind that the kaboodle will > usually always work, should strongly support the Lua platform initiatives. Amongst programmers there is no such thing as a "pure end user". When as a programmer one is choosing what languages and libraries to use, there are a number of trade-offs, including the future development of such code. How one makes those trade-offs depends critically on the expected life-cycle of one's own software; consider for example the differences between a game, a throwaway hack, an enterprise dataprocessing utility and an open source cross-platform long-term project. Backwards compatibillity, forwards compatibility, performance, code quality and licensing are factors which assume different importances in different scenarios. -- http://rrt.sc3d.org Il ne vaut pas la peine de peigner l’eau From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:51:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87IpXoO020793; Mon, 7 Sep 2009 15:51:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8724419397; Mon, 7 Sep 2009 15:51:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f189.google.com (mail-pz0-f189.google.com [209.85.222.189]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECB3219379 for ; Mon, 7 Sep 2009 15:51:03 -0300 (BRT) Received: by pzk27 with SMTP id 27so2681195pzk.9 for ; Mon, 07 Sep 2009 11:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Uze91TPxx0MXDDhpDGnhu8RtpWcdKqh9zwGa6pzSXoQ=; b=a32M0gynpo0VD3PkJMhIXj6JZIasne6t6Mw4fedDo0W1owwaBWZI1qBz0TmHathHvh FaCYUvGh208BAK/sn1n7EI6T4B3+NK4q9bFb/fXHEPTHI9j7WvKZkPoiHYbpHW0s/fft dULhVnCnbYrGUpOYB3rpjn4L4mXRAXJwI6aGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=GFyGys1eJXuO835pFmvm+83ylTtW/4UoNpv/kmTuhYL/TsxDPfjQag/Oh/TJFWr2Xz haCu7G9V5dAYI3eNOHUH3Qnlgz5JiK3GL2xEIs5ZceUv5S0rzfwP/oSskeS0jn2vLvO1 Nmxb7XkrLoLpjqH0HEygPD1fnhX4kjfVOTsuw= Received: by 10.114.29.15 with SMTP id c15mr15881866wac.148.1252349461769; Mon, 07 Sep 2009 11:51:01 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 22sm49045pzk.10.2009.09.07.11.51.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 11:51:01 -0700 (PDT) Message-ID: <4AA55611.20105@gmail.com> Date: Tue, 08 Sep 2009 02:50:57 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA54B66.4040601@gmail.com> <8763bu62u0.fsf@vertex.dottedmag.net> <4AA550CF.7000104@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Reuben Thomas wrote: > 2009/9/7 KHMan: >> [snip] > Being "reliable" has nothing to do with number of contributors, nor > whether a program is distributed as source or binary. :-) Arf, I was typing quickly and chose a less than perfect adjective. It is more of a sustainability of a FLOSS project thingy. >> [snip] > Amongst programmers there is no such thing as a "pure end user". [snip] :-) Woof, another less than perfect choice of phrasing. I mean it like the way I use Perl -- I just script in Perl and have never seriously written modules for a general audience. So there. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:54:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Is0nR021037; Mon, 7 Sep 2009 15:54:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCA67193A1; Mon, 7 Sep 2009 15:53:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og114.obsmtp.com (exprod7og114.obsmtp.com [64.18.2.215]) by bazar2.conectiva.com.br (Postfix) with SMTP id 43EC91939C for ; Mon, 7 Sep 2009 15:53:36 -0300 (BRT) Received: from source ([209.85.218.217]) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKSqVWrim9N0IfBEh+MGEbVvuBwAmM1IjY@postini.com; Mon, 07 Sep 2009 11:53:36 PDT Received: by bwz17 with SMTP id 17so2309360bwz.21 for ; Mon, 07 Sep 2009 11:53:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.2.217 with SMTP id 25mr5315022fak.41.1252349613431; Mon, 07 Sep 2009 11:53:33 -0700 (PDT) In-Reply-To: <4AA55611.20105@gmail.com> References: <4AA54B66.4040601@gmail.com> <8763bu62u0.fsf@vertex.dottedmag.net> <4AA550CF.7000104@gmail.com> <4AA55611.20105@gmail.com> Date: Mon, 7 Sep 2009 19:53:33 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/7 KHMan : > Reuben Thomas wrote: >> >> 2009/9/7 KHMan: >>> >>> [snip] >> >> Being "reliable" has nothing to do with number of contributors, nor >> whether a program is distributed as source or binary. > > :-) Arf, I was typing quickly and chose a less than perfect adjective. It is > more of a sustainability of a FLOSS project thingy. That's how I understood what you wrote. >> Amongst programmers there is no such thing as a "pure end user". [snip] > > :-) Woof, another less than perfect choice of phrasing. I mean it like the > way I use Perl -- I just script in Perl and have never seriously written > modules for a general audience. That one is scripting for one's own use tends to give one much more freedom about what libraries and languages to use, not less. -- http://rrt.sc3d.org Every act of belief is an act of unbelief (Carse) From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 15:59:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Iwxh4021543; Mon, 7 Sep 2009 15:58:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59C00193AF; Mon, 7 Sep 2009 15:58:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EC6A1939B for ; Mon, 7 Sep 2009 15:58:34 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n87IwXep031337 for ; Mon, 7 Sep 2009 15:58:33 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 0423154C1D7; Mon, 7 Sep 2009 15:58:34 -0300 (BRT) Date: Mon, 7 Sep 2009 15:58:33 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: LPEG span() Message-ID: <20090907185833.GA11040@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Why does LPEG's span() function use strspn() in its implementation instead > of the ISpan instruction? 'span' is not an "official" function; it is only an illustration on how to use external C functions. (Although it does not illustrate how to implement external C functions in a separate module, which seems to be the most difficult part...) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 16:00:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87J0Y58021895; Mon, 7 Sep 2009 16:00:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83D9C193C2; Mon, 7 Sep 2009 16:00:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 232A3193BD for ; Mon, 7 Sep 2009 16:00:10 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n87J09A8031443 for ; Mon, 7 Sep 2009 16:00:09 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id DCA1054C1D7; Mon, 7 Sep 2009 16:00:09 -0300 (BRT) Date: Mon, 7 Sep 2009 16:00:09 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: bug in loadlib.c? Message-ID: <20090907190009.GB11040@inf.puc-rio.br> References: <4AA15347.5070409@qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA15347.5070409@qualcomm.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > This doesn't cause any errors but it looks like the creation of the > "package.loaders" table in luaopen_package() is calling > lua_createtable() incorrectly, with the "narr" and "nrec" parameters > swapped, perhaps leading to some unnecessary reallocation at load time? > > [...] You are right. Many thanks for the feedback. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 16:08:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87J8f1N022618; Mon, 7 Sep 2009 16:08:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FA8619389; Mon, 7 Sep 2009 16:08:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-6.csi.cam.ac.uk (ppsw-6.csi.cam.ac.uk [131.111.8.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BE4D1937B for ; Mon, 7 Sep 2009 16:08:11 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:59967) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpa (EXTERNAL:fanf2) id 1MkjZS-0001d7-Jr (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Mon, 07 Sep 2009 20:08:10 +0100 Received: from fanf2 (helo=localhost) by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MkjZS-00049h-4I (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Mon, 07 Sep 2009 20:08:10 +0100 Date: Mon, 7 Sep 2009 20:08:10 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk To: Lua list Subject: Re: LPEG span() In-Reply-To: <20090907185833.GA11040@inf.puc-rio.br> Message-ID: References: <20090907185833.GA11040@inf.puc-rio.br> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 7 Sep 2009, Roberto Ierusalimschy wrote: > > 'span' is not an "official" function; it is only an illustration on how > to use external C functions. Ah right, I thought it looked a bit stubby. Thanks. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 16:21:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87JLJE7024078; Mon, 7 Sep 2009 16:21:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55428193B9; Mon, 7 Sep 2009 16:20:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh04.mail.saunalahti.fi (emh04.mail.saunalahti.fi [62.142.5.110]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61F31193A6 for ; Mon, 7 Sep 2009 16:20:52 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 5AF4C13B8DC for ; Mon, 7 Sep 2009 22:20:47 +0300 (EEST) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A0116E5C119; Mon, 07 Sep 2009 22:20:47 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 4B3181C6384 for ; Mon, 7 Sep 2009 22:20:42 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: The source file culture Date: Mon, 7 Sep 2009 22:20:42 +0300 References: X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You mentioned Lua for Windows in the beginning. Have you really tried it? http://luaforwindows.luaforge.net/ -asko Georgios Petsagourakis kirjoitti 7.9.2009 kello 20:56: > Indeed my intention was not to irritate/get flamed/annoy or degrade > any of the module/extension authors. Thanks Ralph Hempel for the > clarification. > > My comment stems from the fact that there are quite a lot of people > who are using Windows, and really there is nothing we can do other > than open the code with a text editor and look at it unless we are > into C programming. Taking this as a fact implies that in order to > script Lua, you need to be able to program in C which blows away all > the simple to use syntax concept of Lua, that is the main selling > point to non programmers. > I do realize that Lua isn't about getting it out and that it is > meant to be embedded in another host program but it has gotten > beyond that scope, for quite some years now, especially since the > release of the Kepler project. I feel the need to express that the > community should be ready, for example, when the Apache includes Lua > support with their next release. > > Best Regards,... > George Petsagourakis From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 16:41:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Jf1dt025876; Mon, 7 Sep 2009 16:41:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8FAC193B2; Mon, 7 Sep 2009 16:40:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B60B91938F for ; Mon, 7 Sep 2009 16:40:18 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mkk4V-00060l-3l for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 21:40:15 +0200 Received: from adsl233-96.kln.forthnet.gr ([79.103.46.96]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 21:40:15 +0200 Received: from petsagouris by adsl233-96.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Sep 2009 21:40:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: The source file culture Date: Mon, 7 Sep 2009 19:39:52 +0000 (UTC) Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 79.103.46.96 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Asko Kauppi dnainternet.net> writes: > > > You mentioned Lua for Windows in the beginning. Have you really tried > it? > > http://luaforwindows.luaforge.net/ > > -asko > Yes, this is what I am using at the moment. I'd like to thank the Lua for Windows team for the work put on this. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 17:29:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87KTi6p030275; Mon, 7 Sep 2009 17:29:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8844B193C8; Mon, 7 Sep 2009 17:29:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tetrinetsucht.de (tetrinetsucht.de [88.80.200.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F0531939D for ; Mon, 7 Sep 2009 17:29:13 -0300 (BRT) Received: from e176106093.adsl.alicedsl.de ([85.176.106.93] helo=[192.168.1.2]) by tetrinetsucht.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Mkkpf-0003Ai-6U for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 22:28:59 +0200 Message-ID: <4AA56D0D.3050306@zbh.uni-hamburg.de> Date: Mon, 07 Sep 2009 22:29:01 +0200 From: Sascha Steinbiss Organization: Zentrum fuer Bioinformatik, Universitaet Hamburg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090906 Lightning/1.0pre Shredder/3.0b4pre MIME-Version: 1.0 To: Lua list X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 85.176.106.93 X-SA-Exim-Mail-From: steinbiss@zbh.uni-hamburg.de X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on tetrinetsucht.de X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Subject: all.c failing to build with newer glibc X-SA-Exim-Version: 4.2.1 (built Sat, 01 Aug 2009 12:09:26 +0000) X-SA-Exim-Scanned: Yes (on tetrinetsucht.de) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi everyone, we use Lua as an embedded scripting language in a bioinformatics toolkit (http://genometools.org). However, after a recent glibc update (2.10.1 here) all.c fails to build due to a name clash of the 'getline' macro and a POSIX 2008 function of the same name: [~/lua-5.1.4/etc] $ make one gcc -O2 -Wall -I../src all.c -lm In file included from ../src/lobject.c:9, from all.c:16: /usr/include/stdio.h:653:33: error: macro "getline" passed 3 arguments, but takes just 2 make: *** [one] Error 1 A simple workaround was to rename each occurence of the getline macro in the Lua source to 'lgetline' or something like that. A similar issue came up a few months ago (http://lua-users.org/lists/lua-l/2009-05/msg00385.html) but I do not see it being addressed up to now. Is there anything you can do to fix this? We would prefer not to patch around in our copy of the Lua source code, but rather have a clean copy identical to the currently available release code. Using 'gcc --std=c99' makes it compile again, but then again, --std seems to be a GCC-specific option with portability implications... Thanks in advance, Sascha -- Sascha Steinbiss Center for Bioinformatics University of Hamburg Bundesstr. 43 20146 Hamburg Germany Email: steinbiss@zbh.uni-hamburg.de URL: http://www.zbh.uni-hamburg.de/steinbiss Phone: +49 (40) 42838 7322 FAX: +49 (40) 42838 7312 From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 17:31:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87KVJYd031062; Mon, 7 Sep 2009 17:31:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6E08193D6; Mon, 7 Sep 2009 17:30:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C9321939D for ; Mon, 7 Sep 2009 17:30:53 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 892686932E for ; Mon, 7 Sep 2009 16:30:49 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 07 Sep 2009 16:30:49 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=UoEOH4gKY7VNZUU5fuKVlLbTtec=; b=Mn50IOjnyurCdrlg3NbTeZF5Zb2JcJ1PIEZCVcwkOx7WIKB1ZzTkxX95f/LEH44ZqJiflaFEVL/cLKgRw46xdvGCorojCH0+L2lsyxoaRDercTnI+WZiY0oXjZ5W97odAVa0AuA0UkQ3xMdv95Uwk7qGGiHnkDiZ6L6jmnWCWGg= X-Sasl-enc: J2FVYojkucV3e5xcKJ4yye93KRuNoX2NhYibVGn8Z0Sg 1252355412 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id B619C677F3 for ; Mon, 7 Sep 2009 16:30:12 -0400 (EDT) Date: Mon, 7 Sep 2009 16:30:04 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Re: sizeof function closures in lua 5.1? Message-ID: <20090907203004.GA27729@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20090907132806.GB9175@vaio.jimpryor.net> <20090907133741.GA23555@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks for your quick replies. And Peter, thanks for pointing me to those declarations, this is exactly the info I was seeking but I don't yet know my way around the Lua source. Comments below... On Mon, Sep 07, 2009 at 02:59:02PM +0100, Peter Cawley wrote: > >From lobject.h, the definition of LClosure (the structure for Lua closures): > typedef struct LClosure { > GCObject *next; > lu_byte tt; > lu_byte marked; > lu_byte isC; > lu_byte nupvalues; > GCObject *gclist; > struct Table *env > struct Proto *p; > UpVal *upvals[1]; > } LClosure; > > >From the above, you can see that a Lua closure, in memory, takes 4 > pointers, plus 4 bytes, plus maybe some padding bytes between > nupvalues and gclist (i.e. 4 padding bytes on x64 to align gclist on > an 8 byte boundary), and then one extra pointer (UpVal*) for each > upvalue which it references. If two or more closures share an upvalue, > then just one UpVal structure will be allocated for that upvalue. > Otherwise, an UpVal structure is allocated for each upvalue. If a closure has multiple upvalues, then just one LClosure record is created, with the upvals array having additional entries? Right? > If upvalues are not shared, then for a closure with N upvalues, the > required memory will probably be: > sizeof(void*) * (5 + N) + N * (sizeof(void*) * 3 + 16) > where sizeof(void*) == 4 on x86 and sizeof(void*) == 8 on x64. This estimation exactly predicts the results I was seeing: 88 bytes for any closure with 1 upvalue on a x64 machine. It matters not whether the upvalue in question is ever "changed"---the report on the WoW wiki page must be confused. I think what happened was they had an example where the upvalues were local to a for block, so everytime the for block executed they created a closure with a new upvalue. Whereas in the case they were contrasting, they were creating multiple closures that shared a single upvalue. In that case, there would be mutiple LClosure records, but all pointing to a single UpVal record, correct? I was still puzzled why my example... function make_closure4(x) local function static_closure(x) -- this is in make_closure1 style return function(y) return x+y end end x = x==nil and 0 or x return static_closure(x) end was being report as taking 128 bytes. Then in the process of writing up this email I realized that my sizeof function was only doing a garbage collect before executing make_closure4. We also need to do one _after_ executing, to get an accurate estimate of the size of make_closure4's return value. Once I did that, I got 88 bytes here too. So my puzzlement is all solved. Thanks for the help. -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 17:59:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Kx0ia001049; Mon, 7 Sep 2009 17:59:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47C1E193DE; Mon, 7 Sep 2009 17:58:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD67193C0 for ; Mon, 7 Sep 2009 17:58:33 -0300 (BRT) Received: by iwn42 with SMTP id 42so1023311iwn.33 for ; Mon, 07 Sep 2009 13:58:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.93 with SMTP id g29mr1077697ibr.13.1252357111224; Mon, 07 Sep 2009 13:58:31 -0700 (PDT) In-Reply-To: <4AA56D0D.3050306@zbh.uni-hamburg.de> References: <4AA56D0D.3050306@zbh.uni-hamburg.de> Date: Mon, 7 Sep 2009 16:58:31 -0400 Message-ID: <790db3550909071358j66e79c54x68469596a4509bf@mail.gmail.com> Subject: Re: all.c failing to build with newer glibc From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 7, 2009 at 4:29 PM, Sascha Steinbiss wrote: > Hi everyone, > > we use Lua as an embedded scripting language in a bioinformatics toolkit > (http://genometools.org). However, after a recent glibc update (2.10.1 > here) all.c fails to build due to a name clash of the 'getline' macro > and a POSIX 2008 function of the same name: This is also reported here [1]. [1] http://lua-users.org/lists/lua-l/2009-05/msg00385.html -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 18:39:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87LdohN005331; Mon, 7 Sep 2009 18:39:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A5F0193E2; Mon, 7 Sep 2009 18:39:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tetrinetsucht.de (tetrinetsucht.de [88.80.200.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02ED3193D1 for ; Mon, 7 Sep 2009 18:39:13 -0300 (BRT) Received: from e176108006.adsl.alicedsl.de ([85.176.108.6] helo=[192.168.1.2]) by tetrinetsucht.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MklvT-0004Y6-Ap for lua@bazar2.conectiva.com.br; Mon, 07 Sep 2009 23:39:03 +0200 Message-ID: <4AA57D7A.8020107@zbh.uni-hamburg.de> Date: Mon, 07 Sep 2009 23:39:06 +0200 From: Sascha Steinbiss Organization: Zentrum fuer Bioinformatik, Universitaet Hamburg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090906 Lightning/1.0pre Shredder/3.0b4pre MIME-Version: 1.0 To: Lua list References: <4AA56D0D.3050306@zbh.uni-hamburg.de> <790db3550909071358j66e79c54x68469596a4509bf@mail.gmail.com> In-Reply-To: <790db3550909071358j66e79c54x68469596a4509bf@mail.gmail.com> X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 85.176.108.6 X-SA-Exim-Mail-From: steinbiss@zbh.uni-hamburg.de X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on tetrinetsucht.de X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Subject: Re: all.c failing to build with newer glibc X-SA-Exim-Version: 4.2.1 (built Sat, 01 Aug 2009 12:09:26 +0000) X-SA-Exim-Scanned: Yes (on tetrinetsucht.de) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 09/07/2009 10:58 PM, Patrick Donnelly wrote: > This is also reported here [1]. > [1] http://lua-users.org/lists/lua-l/2009-05/msg00385.html Actually, I referred to this archive entry in my original post... The error reported in this post originated somewhere else, but the underlying problem seems to be the same. Sascha -- Sascha Steinbiss Center for Bioinformatics University of Hamburg Bundesstr. 43 20146 Hamburg Germany Email: steinbiss@zbh.uni-hamburg.de URL: http://www.zbh.uni-hamburg.de/steinbiss Phone: +49 (40) 42838 7322 FAX: +49 (40) 42838 7312 From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 18:51:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87LpKoG006457; Mon, 7 Sep 2009 18:51:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 931D01935E; Mon, 7 Sep 2009 18:51:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dspnet.fr.eu.org (dspnet.fr.eu.org [213.186.44.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D5231934A for ; Mon, 7 Sep 2009 18:50:57 -0300 (BRT) Received: by dspnet.fr.eu.org (Postfix, from userid 1007) id CD016A4999; Mon, 7 Sep 2009 23:50:50 +0200 (CEST) Date: Mon, 7 Sep 2009 23:50:50 +0200 From: Olivier Galibert To: Lua list Subject: Re: The source file culture Message-ID: <20090907215050.GA16268@dspnet.fr.eu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 07, 2009 at 08:56:21PM +0300, Georgios Petsagourakis wrote: > My comment stems from the fact that there are quite a lot of people who are > using Windows, and really there is nothing we can do other than open the > code with a text editor and look at it unless we are into C programming. > Taking this as a fact implies that in order to script Lua, you need to be > able to program in C which blows away all the simple to use syntax concept > of Lua, that is the main selling point to non programmers. Oh please, you don't need to know C to compile a program. OG. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 19:51:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87Mpg5A012837; Mon, 7 Sep 2009 19:51:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1EDE19327; Mon, 7 Sep 2009 19:51:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6352192C9 for ; Mon, 7 Sep 2009 19:51:06 -0300 (BRT) Received: by yxe5 with SMTP id 5so5273639yxe.33 for ; Mon, 07 Sep 2009 15:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Z4TBNuJdhMG79Pop0iomkwOUq8OVShFrDYR5tKpTlvg=; b=I/zvAUal/PLC99G0pdHCBSp0ZCXZbd206japtLRDQfag01o2BN6KJctj6LkUCrBzkr ejgBk6VqnXwoUAfc0SgFGPUD8Tw5KshI3mDX8YFlHkNk5dRgKv5CZRJl4RC79XW8PWeB aom7fy1D2MsA1IF86HvyV+pZl8cV26SKH3EV0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Ok8SVa1LOVMTAS37sOF1d8zs2bd4rBdUqvPAnpUau05Pwyu3B+ucuVFhdEl5Wfntal qZoxRQ6LXkoVwA3gOAAOl5oNF7o0hc+a5N2PR/a5R5aE5ayiDD0pcMURPFVgWXCSdHjH xFwmxPguJT8dqM8dqaAvNzmpye/44ryV5WEiw= Received: by 10.91.74.11 with SMTP id b11mr11619079agl.39.1252363864445; Mon, 07 Sep 2009 15:51:04 -0700 (PDT) Received: from Powerbook-2.local (cpe-098-026-086-247.nc.res.rr.com [98.26.86.247]) by mx.google.com with ESMTPS id 18sm4966485agb.72.2009.09.07.15.51.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Sep 2009 15:51:03 -0700 (PDT) Message-ID: <4AA58E56.5000403@gmail.com> Date: Mon, 07 Sep 2009 18:51:02 -0400 From: Timothy Hunter User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Georgios Petsagourakis wrote: > My comment stems from the fact that there are quite a lot of people who are > using Windows, and really there is nothing we can do other than open the > code with a text editor and look at it unless we are into C programming. > Taking this as a fact implies that in order to script Lua, you need to be > able to program in C which blows away all the simple to use syntax concept > of Lua, that is the main selling point to non programmers I think that's overstating the case a bit. Lua is quite usable out-of-the-box. Now, there may be some extensions that you'd like to use but not distributed in a pre-compiled form for Windows. If so, you can get yourself a compiler and learn how to compile them, or if nothing else you could pay somebody to do this for you. In either case, after you've done so, consider making them available for other Windows users. That's what "community" is about, after all. From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 20:00:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87N0dqN013917; Mon, 7 Sep 2009 20:00:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D41C1937F; Mon, 7 Sep 2009 20:00:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D84D21936D for ; Mon, 7 Sep 2009 20:00:08 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 401FE6904B; Mon, 7 Sep 2009 19:00:05 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 07 Sep 2009 19:00:05 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:cc:subject:message-id:mime-version:content-type; s=smtpout; bh=ODqULhZ6mMoyLx4mTSvgESSg4wM=; b=nUijvYF/JuKDDiSTEXmB5wITfFS5s4+o6Ee3s4oqSG70vE1CtbzbA6vlhG7l0dV5XnvWVDmr/BDBakBxLeuht3XVuGUcrXBUjDGcfgwprQae4SgULOGxwuv6Fqsx5NkZ4hXOJQShNotPLKf2EiUcopsfmGclcqD4tjyvfRUitOc= X-Sasl-enc: 1JgrSCQG27C8tuKxXQ+BX6FFqjknzTbRW/3S9FP+cYFj 1252364404 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id A2C9567A04; Mon, 7 Sep 2009 19:00:04 -0400 (EDT) Date: Mon, 7 Sep 2009 18:59:55 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Difficulties building Coco and liblua.so Message-ID: <20090907225955.GB27729@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br, Juergen Hoetzel MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Juergen Hoetzel X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi I'm having some difficulties building Coco 1.1.5 against Lua 5.1.4 on an x86_64 Linux machine, using gcc 4.4.1. Actually, I _am_ able to get it to build and pass all the tests with the stock Makefile + Coco patch. But my distribution (ArchLinux) changes the Makefile as follows: ------- start of patch --------- diff -ur lua-5.1.orig/src/Makefile lua-5.1/src/Makefile --- lua-5.1.orig/src/Makefile 2006-03-21 11:51:53.000000000 +0100 +++ lua-5.1/src/Makefile 2006-03-21 11:52:09.000000000 +0100 @@ -23,6 +23,7 @@ PLATS= aix ansi bsd generic linux macosx mingw posix solaris LUA_A= liblua.a +LUA_SO= liblua.so CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \ lundump.o lvm.o lzio.o @@ -36,7 +37,7 @@ LUAC_O= luac.o print.o ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T) ALL_A= $(LUA_A) default: $(PLAT) @@ -51,6 +52,10 @@ $(AR) $@ $? $(RANLIB) $@ +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -shared -ldl -Wl,-soname,liblua.so -o $@.5.1 $? $(MYLDFLAGS) + ln -s $@.5.1 $@ + $(LUA_T): $(LUA_O) $(LUA_A) $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) ----- end of patch ---- and adds -fPIC to the CFLAGS. This is needed to be able to build liblua.so on x86_64. Now, if I build with those changes plus the Coco patch, then compilation is successful _but_ the lua executable I get gives a Segmentation Fault for all of the Coco tests. If I disable the building of liblua.so and remove -fPIC from the CFLAGS, then the lua executable I get passes all the Coco tests. I didn't set any COCCFLAGS, and building with a new GCC, so I'm guessing Coco is using the gccasm method. I'm in over my head here. Is it possible to build a Lua shared library with Coco and x86_64? If so, how should I do it? Do I need to change some more compilation flags? Here's the build line my distro uses (this is the version that tries to build liblua.so): make INSTALL_DATA="cp -d" TO_LIB="liblua.a" LUA_SO=liblua.so INSTALL_TOP=$startdir/pkg/usr INSTALL_MAN=$startdir/pkg/usr/share/man/man1 linux install and here's the result if I change "make...linux install" to "make...echo": > These are the parameters currently set in src/Makefile to build Lua > 5.1.4: > PLAT = none > CC = gcc > CFLAGS = -march=native -mtune=generic -O2 -pipe -fPIC > AR = ar rcu > RANLIB = ranlib > RM = rm -f > MYCFLAGS = > MYLDFLAGS = > MYLIBS = > These are the parameters currently set in Makefile to install Lua 5.1.4: > PLAT = none > INSTALL_TOP = /var/cache/build/makepkg-tmp-jim/lua/pkg/usr > INSTALL_BIN = /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/bin > INSTALL_INC = /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/include > INSTALL_LIB = /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/lib > INSTALL_MAN = > /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/share/man/man1 > INSTALL_LMOD = > /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/share/lua/5.1 > INSTALL_CMOD = /var/cache/build/makepkg-tmp-jim/lua/pkg/usr/lib/lua/5.1 > INSTALL_EXEC = install -p -m 0755 > INSTALL_DATA = cp -d I'd be glad for any help. -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 20:45:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n87NjjmF018769; Mon, 7 Sep 2009 20:45:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF5911936F; Mon, 7 Sep 2009 20:45:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2E0219344 for ; Mon, 7 Sep 2009 20:45:11 -0300 (BRT) Received: by yxe5 with SMTP id 5so5306888yxe.33 for ; Mon, 07 Sep 2009 16:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hW7A8QV/eUWezwnOBZ4efA7mfZN0aQ6nfrbrCikHdtk=; b=SoG2HCeG7H9xSMcXPeI8C0/z84iMl2Kb50StH1psMgnomTnD+doSQbtV25/WQtjB+y BXg/82BUU2CmW7c1ggxaUzjUDOAdI5ZnktQRSChfpegK6PFEyNUGhjYIaPLbKov0EGPE 1lEojsHx+YCc9UTDhOwGkYGSnFPGQfYB8sipw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xuV2D+IFMclr4iXwdSLXZvTnooE0VlizIrzIR4XCIzNA7eikO02Xd9KrwmvsJP357f HASnUdvAGOVFBuX3bzgcfdjZyJHzglMLz0rIbpZU1uKuEyJSEPcJqwlkM74CfzHMI9xG NB9gIiny4XS+sJ4H1OTYMhFT587w5rcI44cyM= MIME-Version: 1.0 Received: by 10.150.74.6 with SMTP id w6mr23558490yba.317.1252367109876; Mon, 07 Sep 2009 16:45:09 -0700 (PDT) In-Reply-To: <4AA58E56.5000403@gmail.com> References: <4AA58E56.5000403@gmail.com> Date: Tue, 8 Sep 2009 09:45:09 +1000 Message-ID: <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> Subject: Re: The source file culture From: Vaughan McAlley To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n87NjjmF018769 I can see where George is coming from. Personally, I have good Lua skills, and enough C to get my data into my Lua program (though I pretty much have to relearn C every time I try it). What is way harder for me is the compiling stage. I just can't get my head around dependencies, object files, headers, makefiles and (most annoyingly) error messages that might as well be written in Sumerian cuneform, even if I follow the author’s instructions to the letter. This is why I use an OSX binary if it's available. From what people have said above, I promise to appreciate binaries more from now on. Vaughan From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 21:09:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8809sCQ021608; Mon, 7 Sep 2009 21:09:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7D6219392; Mon, 7 Sep 2009 21:09:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AD551934C for ; Mon, 7 Sep 2009 21:09:26 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MkoGy-0004bw-00; Tue, 08 Sep 2009 02:09:24 +0200 Date: Tue, 8 Sep 2009 02:09:08 +0200 From: Mike Pall To: Lua list Subject: Re: Difficulties building Coco and liblua.so Message-ID: <20090908000908.GA3736@mike.de> References: <20090907225955.GB27729@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090907225955.GB27729@vaio.jimpryor.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Pryor wrote: > [...] and adds -fPIC to the CFLAGS. This is needed to be able to build > liblua.so on x86_64. Looks like GCC treats references to assembler functions and static C functions differently in PIC mode. Here's the fix: Edit lcoco.c and replace the definition of coco_wrap_main plus the assembler stuff immediately below it with this code: static void coco_wrap_main(void) { __asm__ __volatile__ ("\tmovq %r13, %rdi\n\tjmpq *%r12\n"); } I'll release an update to Coco ASAP. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Sep 7 22:19:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n881JW1O028437; Mon, 7 Sep 2009 22:19:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F29419324; Mon, 7 Sep 2009 22:18:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D20519318 for ; Mon, 7 Sep 2009 22:18:52 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id B57A063731 for ; Mon, 7 Sep 2009 21:18:50 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 07 Sep 2009 21:18:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=tVo7ojecaROAk9Rh6JPa1cczUV4=; b=p7Ez3c517/rgLsJieCMjq/uR8+1+XLPkBT8Rsqvnze8LTUxkN+4lCVwjSt28NQQ4ktmaD2vwWdQxgDWswXpx4VCOwC1rYKSRe0VhewmJDJYxEWB/P6RJeXzrGDmhpygC0fH1ZfgAlDAfCbsHs2uf5fc+ryxlyLaoCLAs0ef1pMY= X-Sasl-enc: 1XOyokrQIR/9JWNhwZrcnaevqbJk/7y9lOuQ8GzBIzup 1252372730 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 4308727A72 for ; Mon, 7 Sep 2009 21:18:50 -0400 (EDT) Date: Mon, 7 Sep 2009 21:18:41 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Difficulties building Coco and liblua.so (and also RVM) Message-ID: <20090908011841.GE27729@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20090907225955.GB27729@vaio.jimpryor.net> <20090908000908.GA3736@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090908000908.GA3736@mike.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Wow, terrific, thanks for the amazingly quick fix for Coco. I'm also trying to build and try out the RVM patch. It doesn't patch cleanly against the Lua 5.1.4 sources, so I'm going and cleaning it up by hand. Mostly this is straightforward. There are a few spots where I'm stuck though: the Lua 5.1.4 sources have changed from what the RVM patch is trying to replace. I'm not familiar with these sources yet, so don't know what's the right merge. The wiki says that Greg Falcon aka VeLoSo has taken over maintenance of the RVM patch. Is there any version floating around against the current Lua sources? Is noone using this patch anymore? From what I've seen on the mailing list it looks that, though there's no development happening on it, it's still regarded as a solid and viable option? On Tue, Sep 08, 2009 at 02:09:08AM +0200, Mike Pall wrote: > Jim Pryor wrote: > > [...] and adds -fPIC to the CFLAGS. This is needed to be able to build > > liblua.so on x86_64. > > Looks like GCC treats references to assembler functions and static > C functions differently in PIC mode. Here's the fix: > > Edit lcoco.c and replace the definition of coco_wrap_main plus the > assembler stuff immediately below it with this code: > > static void coco_wrap_main(void) > { > __asm__ __volatile__ ("\tmovq %r13, %rdi\n\tjmpq *%r12\n"); > } > > I'll release an update to Coco ASAP. > > --Mike -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 02:06:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8856S4Q019439; Tue, 8 Sep 2009 02:06:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D94118A5F; Tue, 8 Sep 2009 02:06:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C4CB189E1 for ; Tue, 8 Sep 2009 02:05:55 -0300 (BRT) Received: by ewy26 with SMTP id 26so2979344ewy.5 for ; Mon, 07 Sep 2009 22:05:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.94.7 with SMTP id r7mr2540814ebb.36.1252386353671; Mon, 07 Sep 2009 22:05:53 -0700 (PDT) In-Reply-To: <4AA540CA.2080004@cowlark.com> References: <4AA540CA.2080004@cowlark.com> Date: Tue, 8 Sep 2009 01:05:53 -0400 X-Google-Sender-Auth: b2d7fefe1c0a3716 Message-ID: Subject: Re: The source file culture From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 7, 2009 at 1:20 PM, David Given wrote: > That said, there is a fairly small group of people like you who want Windows > binaries, and this is precisely what Lua For Windows is for: The other half of this equation is automating the source code builds of hundreds of modules on many platforms so that distribution maintainers (e.g. Lua for Windows) as well as end users can easily build from source. Currently, Lua for Windows is assembled from binaries contributed by individual authors, which is not desirable IMO for reasons discussed herein. LuaRocks/LuaDist can solve the building problem, though currently there are a handful of Lua for Windows modules its not yet compiling. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 02:57:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n885vmQB023621; Tue, 8 Sep 2009 02:57:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07FF718D5E; Tue, 8 Sep 2009 02:57:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out1.iinet.net.au (outbound.icp-qv1-irony-out1.iinet.net.au [203.59.1.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D68618CAD for ; Tue, 8 Sep 2009 02:57:17 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiwBAJOOpUp8qRvo/2dsb2JhbAAI2TqEGAWCOA X-IronPort-AV: E=Sophos;i="4.44,351,1249228800"; d="scan'208";a="578270837" Received: from unknown (HELO [10.1.1.3]) ([124.169.27.232]) by outbound.icp-qv1-irony-out1.iinet.net.au with ESMTP; 08 Sep 2009 13:57:12 +0800 Message-Id: From: Jacques Chester To: Lua list In-Reply-To: <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: The source file culture Date: Tue, 8 Sep 2009 13:57:12 +0800 References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 08/09/2009, at 7:45 AM, Vaughan McAlley wrote: > error messages that might as well be written in Sumerian cuneform, At the risk of inciting a flamewar, this is really GCC's fault, not Lua's. ICC and Clang/LLVM, for example, give very helpful error messages. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 03:27:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n886Racp025945; Tue, 8 Sep 2009 03:27:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22E8218EA5; Tue, 8 Sep 2009 03:27:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 395CC1899C for ; Tue, 8 Sep 2009 03:27:11 -0300 (BRT) Received: by fxm25 with SMTP id 25so2146049fxm.5 for ; Mon, 07 Sep 2009 23:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7CJOKDJSw5OPbCVL177e9+1c3e3s7KMH97Nd1eTrAHo=; b=ZMymjtOsiwc/HVHJXNlhM6ua5CRhREEHc7bQNPo5g7W3bsx2T10fT6fA01rLrbpAqR ZrkPVYcVWNBT+vCI3KZ9e05n/WFpwe+TYdod2lG5D6VR6Ft1ypkK5gRjxBjuP2WWQOwP 00Cze6PhT4zV6A9QA7o3jVcSq996Yqzyh7XrE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TyTJVZ+Fkw7obgrBW8epPpO8z75a27BUBNMd0zhFZseDzhhWX+xOZ+O3+UhQKJyr0L LxWp5kcy+B0MayJy6wsRJm93tCPmpvros2nJme/8rzMl6olaq+QMFSdRPWEn5ko3fwu8 dCb2Kzs4rQsaHiLt3krKl0rxRUaFM1w8O9/GE= MIME-Version: 1.0 Received: by 10.103.50.21 with SMTP id c21mr6458768muk.27.1252391228954; Mon, 07 Sep 2009 23:27:08 -0700 (PDT) In-Reply-To: References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> Date: Tue, 8 Sep 2009 01:27:08 -0500 Message-ID: Subject: Re: The source file culture From: Jeff Pohlmeyer To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 8, 2009 Jacques Chester wrote: > On 08/09/2009, at 7:45 AM, Vaughan McAlley wrote: >> error messages that might as well be written in Sumerian cuneform, > At the risk of inciting a flamewar, this is really GCC's fault, > not Lua's. ICC and Clang/LLVM, for example, give very helpful > error messages. Actually, the *first* error message printed by gcc is usually quite helpful, the problem is with the 6000 lines of useless garbage it vomits up after that :-) At least that's been my experience. - Jeff From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 04:01:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8870w93028668; Tue, 8 Sep 2009 04:00:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 960871A600; Tue, 8 Sep 2009 04:00:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CEED1A5A0 for ; Tue, 8 Sep 2009 04:00:28 -0300 (BRT) Received: by bwz10 with SMTP id 10so1440593bwz.5 for ; Tue, 08 Sep 2009 00:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=VVtSnmN8U/DCmaWD0eGsUawpnmLe0jMxVT01k0buJ64=; b=K9BvndMjXpJmHEWy9gwGbxa5O/UGgn5dSqMT8IKmcZSMpHFXMHQ40aaZVe3nANsz3a PKr9H2mHUNBuU/RZ3xa1sP2vVzyx1cM4x91uhWqda5fmKY5r6aiMz8JfCm3D2Xj0JFGP dXx+ChFumJQXoAAsckFSUGHhKOpgPDk/UOO+Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=J2pL9y27PMpIL7fvNPiWhG3xBR/axQouplUuJ6Oov9OD/kOEXYjcXM4GwokOLUz+73 0BzqtXaWKahM+dMdLO3Ps9xvA8IBSmwRiTIjr53YaIfk3wS2cTW3Vvp9SbgU0ivEOAKQ I9pwuAlrdZ2Bcb6b5jVBS9f04raRK2vYp+hMs= MIME-Version: 1.0 Received: by 10.204.7.139 with SMTP id d11mr12908947bkd.190.1252393226684; Tue, 08 Sep 2009 00:00:26 -0700 (PDT) In-Reply-To: References: <4AA540CA.2080004@cowlark.com> Date: Tue, 8 Sep 2009 09:00:26 +0200 Message-ID: <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 8, 2009 at 7:05 AM, David Manura wrote: > LuaRocks/LuaDist can solve the building > problem, though currently there are a handful of Lua for Windows > modules its not yet compiling. Yes, LuaRocks makes downloading and building a module as easy as 'luarocks install lpeg'. You do need the Microsoft compiler, but that's a free download and then all you have to do is run the 'vcvars32.bat' to set up the paths, and away you go. I've written a little local web front-end that really makes this a matter of click, wait and go, which I'm currently packaging for LuaRocks. OK, LuaRocks currently puts modules in eccentric places, although this will change for LuaRocks 2 - which will probably become part of Lua for Windows. The current issue that David mentioned is a stumbling block, but this is a technical matter (translation: I'm going to sit down and sort it out, either by doing it myself or badgering rockspec maintainers). This has to happen before LR can be considered as a useful add-on to Lua for Windows. In summary: compilation need not be difficult and can be an automated task, even on Windows. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 04:11:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n887BhWg031173; Tue, 8 Sep 2009 04:11:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A787183CD; Tue, 8 Sep 2009 04:11:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hermes.amplepower.com (dsl254-017-034.sea1.dsl.speakeasy.net [216.254.17.34]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DC0F183A3 for ; Tue, 8 Sep 2009 04:11:02 -0300 (BRT) Received: from [192.168.8.25] (helo=bohr.amplepower.com) by hermes.amplepower.com with esmtp (Exim 4.63) (envelope-from ) id 1Mkuqz-0004NK-4B for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 00:11:01 -0700 Date: Tue, 8 Sep 2009 00:12:47 -0700 (PDT) From: David Smead X-X-Sender: smead@bohr To: Lua list Subject: Re: The source file culture In-Reply-To: Message-ID: References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Gcc will do what you tell it to do. Some people ignore warnings from gcc, but that's ill advised. The first error as you mention is always informative, and the only one you should bother looking at. Here's what I use to treat warnings as errors, and to stop after the first error. For compile only - you probably need some include dirs and libs. gcc -c -ggdb -Wall -Werror -Wfatal-errors To link: gcc -o These are in a Makefile, or course, with all of its beauty! And don't overlook the wonder of pkg-config. David Smead www.amplepower.com On Tue, 8 Sep 2009, Jeff Pohlmeyer wrote: > Date: Tue, 8 Sep 2009 01:27:08 -0500 > From: Jeff Pohlmeyer > Reply-To: Lua list > To: Lua list > Subject: Re: The source file culture > > On Sep 8, 2009 Jacques Chester wrote: >> On 08/09/2009, at 7:45 AM, Vaughan McAlley wrote: > >>> error messages that might as well be written in Sumerian cuneform, > >> At the risk of inciting a flamewar, this is really GCC's fault, >> not Lua's. ICC and Clang/LLVM, for example, give very helpful >> error messages. > > Actually, the *first* error message printed by gcc is usually quite > helpful, the problem is with the 6000 lines of useless garbage it > vomits up after that :-) > > > At least that's been my experience. > > > - Jeff > From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 04:24:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n887OLSj032421; Tue, 8 Sep 2009 04:24:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB09B187E7; Tue, 8 Sep 2009 04:24:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 482B61874C for ; Tue, 8 Sep 2009 04:23:54 -0300 (BRT) Received: by bwz10 with SMTP id 10so1451952bwz.5 for ; Tue, 08 Sep 2009 00:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tjYTkyQ4QOxV0Q+eSWILtdImraIZU+d6bulVnQwFOjM=; b=XzeSP+PPdx2vbL3V30OcFuc9i3oRHZHwi8Q765aP/bB3Yl0GxpkTZShbhhJRfZuiPu P5fu0oZTViKFNl6fBVUeBATnLqgloF4FxcXDKt09YNhLLLdWK3io/rbr6L7uPwGgHVdh 3QJCTLf5hIpOsjPfT7Fx6TOIVqu6xsYaBcUvw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E/XpcwMFIXm42PCRAG0BBZrSrY8NqnIuBNijQD1HNId7bHgRO7Q1uXBLIA5tbQa2kT 3wxRfin8MXTgUbzgWrl4fXW6l56112afi+oe3S99YEEmnA9N2CrO/PpuyNYjjTNc9Xms lE1r1DkDnLIfhAg+DHemrFhjoDMGnMEZhFajY= MIME-Version: 1.0 Received: by 10.102.13.19 with SMTP id 19mr6370021mum.13.1252394628468; Tue, 08 Sep 2009 00:23:48 -0700 (PDT) In-Reply-To: References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> Date: Tue, 8 Sep 2009 02:23:48 -0500 Message-ID: Subject: Re: The source file culture From: Jeff Pohlmeyer To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 8, 2009 David Smead wrote: > -Wfatal-errors Wow, that's just what I wanted! I guess sometimes my mindless rants really do pay off! Thanks, - Jeff From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 04:44:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n887i6Dt001695; Tue, 8 Sep 2009 04:44:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA1E018A02; Tue, 8 Sep 2009 04:43:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86B7A18955 for ; Tue, 8 Sep 2009 04:43:25 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n887hKXB020487; Tue, 8 Sep 2009 16:43:20 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay11.aps.necel.com with ESMTP; Tue, 8 Sep 2009 16:43:20 +0900 Received: from dhlpc061 ([10.114.113.156] [10.114.113.156]) by relay11.aps.necel.com with ESMTP; Tue, 8 Sep 2009 16:43:20 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 04E1352E1E7; Tue, 8 Sep 2009 16:43:19 +0900 (JST) From: Miles Bader To: Jacques Chester Subject: Re: The source file culture References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Tue, 08 Sep 2009 16:43:19 +0900 In-Reply-To: (Jacques Chester's message of "Tue, 8 Sep 2009 13:57:12 +0800") Message-ID: Lines: 20 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jacques Chester writes: >> error messages that might as well be written in Sumerian cuneform, > > At the risk of inciting a flamewar, this is really GCC's fault, > not Lua's. ICC and Clang/LLVM, for example, give very helpful > error messages. That seems a dubious claim... There are always particular cases where any given compiler gives bad errors, but I've not noticed any general difference in clarity between gcc's error messages and other compilers. [and of course, if you're a windows user who's been inculcated into fearing even the _concept_ of a compiler, the mere presence of any error message at all is frightening...] -Miles -- Joy, n. An emotion variously excited, but in its highest degree arising from the contemplation of grief in another. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 04:53:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n887rUrk002605; Tue, 8 Sep 2009 04:53:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 056311A65C; Tue, 8 Sep 2009 04:53:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FBFA1A5FB for ; Tue, 8 Sep 2009 04:53:06 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 13189 invoked from network); 8 Sep 2009 09:53:02 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 8 Sep 2009 09:53:02 +0200 Message-ID: <4AA60D5E.9090304@wp.pl> Date: Tue, 08 Sep 2009 09:53:02 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA540CA.2080004@cowlark.com> <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> In-Reply-To: <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [MaNk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > In summary: compilation need not be difficult and can be an automated > task, even on Windows. This is the most important sentence of this thread ;) I would like to mention the Novell's openSUSE Build Service: https://build.opensuse.org/ With this service, you can make (or Novell will make for you) a binary package for every supported linux distro and cpu. Up to now you could only (easily) compile packages for your distro/cpu (using your own computer), now you can do it for others. So even in the "source culture" this is a useful solution. The difference between linux and windows is that it is really easy for linux users to (re)compile a package, because all needed tools are "built-in". In Windows world, for years you could only get binary files (with all its problems), and you had to pay for a compiler if you wanted to compile a program (so as an ordinary user you never wanted to compile anything). So I would say it is a Microsoft (and also Apple) culture which prevents you from easily compiling any available source code. Ask Microsoft for a service similar to Build Service, and you will get binary packages for any of your Windows version. Or use LuaRocks (I am dreaming of similar "Build Service" for LuaRocks, for different OS/CPUs ;) Regards, miko From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 05:23:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n888Nsnx005359; Tue, 8 Sep 2009 05:23:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D7B4190F7; Tue, 8 Sep 2009 05:23:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F36A418977 for ; Tue, 8 Sep 2009 05:23:22 -0300 (BRT) Received: by bwz10 with SMTP id 10so1486302bwz.5 for ; Tue, 08 Sep 2009 01:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3jjZp/IUi8eM1q1jbmeArB/6QFfLxQ9zA2JPmBLAU5I=; b=cE+7LUlm4lQsruY2xeeMyjiRyPv6nvJGctoZmIoPJ3dLPHxxy27SuOeRfNZgGsU5ym 5fVOPcXVMvQp37/WatNpPNIl76+E0l5jU+A3+m4IO9fFrco5plN411HPWbz0vNPs7TkL cy/wAnmL+IRL6nnVyqrqof3Ayei8OQk26S2JI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xsYVE/BoVyWEKBfXh7XI2FEB7oUrlFixNbBEaWqG+z5WA7caozRVZNEQ8RyeDlj1sc HZ48W8M2CWj8qBzJerrk2Vm0M6AdAmvDG+eThzQUDuE9EdGaIfAdis8qhf36oaOkIaIk C+Y37vtmhinjj7AzMNiYZS0MYzM5hubOe3aoU= MIME-Version: 1.0 Received: by 10.204.2.205 with SMTP id 13mr12818818bkk.205.1252398200607; Tue, 08 Sep 2009 01:23:20 -0700 (PDT) In-Reply-To: <4AA60D5E.9090304@wp.pl> References: <4AA540CA.2080004@cowlark.com> <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> <4AA60D5E.9090304@wp.pl> Date: Tue, 8 Sep 2009 10:23:20 +0200 Message-ID: <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/8 Michal Kolodziejczyk : > So I would say it is a Microsoft (and also Apple) culture which prevents > you from easily compiling any available source code. Well, Unix culture is code-based, and when balancing the needs of developers and users, tends to make life easier for developers. The average Windows/Mac user is scared of command-line tools, and I include many intelligent engineers and scientists in this category; it isn't a sign of lack of intelligence; they just have different piorities. Cygwin is not a solution to a problem they recognize ;) So I have sympathy for Lua programmers who find that C makes their head hurt. Although, man, does Microsoft make compiling more difficult than it need be! The decision to have a compiler-specific runtime and deprecate good old mscvrt.dll makes for life of headaches. (Mingw can actually build against the new runtimes, but not always.) Anyway, at least the MS tools are now free, for the nominal cost of a few hundred megabytes of download. For the end user/scripter, errors are a bug. Something like LuaRocks can handle the Lua dependencies well, but there are packages which have 'special' needs. For example, lgdm can be built for Windows, but you have to go out and hunt for the GDM port first. So the real challenge is to make something like LuaRocks understand how to get and install those external dependencies. This is really non-trivial, if you think of all the varieties of platforms, rpm,deb,darwin-ports, etc. Imagine a module specification which specified all the many possible ways to grab things, and you can see that the module author (or maintainer) has to be an unusually dedicated person! On the subject of 'binaries considered harmful': you need trusted sources, and some check like MD5 (which LuaRocks does support). We are not talking about picking up DLLs from some random shareware site! steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 05:38:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n888c5Ib006551; Tue, 8 Sep 2009 05:38:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA0321923D; Tue, 8 Sep 2009 05:37:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83EBE18FEB for ; Tue, 8 Sep 2009 05:37:39 -0300 (BRT) Received: by ewy26 with SMTP id 26so3064215ewy.5 for ; Tue, 08 Sep 2009 01:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=NYgbVl6exevenY3InOY46Ccu4Ev3fPAEwORmmLHM8HQ=; b=QCNx1vim6O5F9JZ+mOjFcQ/6cUSnCM2g/gXrCAknTQCkZX2rAOKlMBgx43gyjbihDW NxQVk9VqRaEHW9UvKEx8cUjsRn4bzRWWgNnc9Djgz4L4rIMnT/6NvfWheepf4L3ZH1K6 AQW9xcRqoyVmu5gMJEnZH54bhSjyHtwo4M+Zw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=jYXdCJ2BkTsh5sR0zRoanpU6EqbygYn9F8E5C/PsT1wchxEOmf4fS+q6BH3XmHwJd/ 2KhOIvOuTOlkkFIQD+pWT2uvmmljEwi5ARF6F/7dttAh8bm0EUJpGJ15biLHoFwOSjaz nAQFh2/KePPGKW0G9NS4fF3x4FZJuezDudn1M= MIME-Version: 1.0 Received: by 10.216.0.1 with SMTP id 1mr671296wea.195.1252399058109; Tue, 08 Sep 2009 01:37:38 -0700 (PDT) In-Reply-To: References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> From: Jerome Vuarand Date: Tue, 8 Sep 2009 10:37:18 +0200 Message-ID: <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> Subject: Re: userdata environment To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/7 Juris Kalnins : > On Tue, 01 Sep 2009 17:20:48 +0300, Jerome Vuarand > wrote: > >> When I first used userdata environment I assumed it was the case and >> was quite disappointed to discover it's not. >> >> However you have other methods to associate metadata to a userdata. >> For example you can use a weak table in the registry, with the >> userdata as a weak key and the string as value. > > Thanks. This indeed is probably the best one can do now. But doing this > spoils the "convenience feature for programmers" part. And it is MUCH > slower than accessing value through a direct pointer. Feel free to provide the benchmark results next time you talk about performance here, many people will simply ignore your comments otherwise (I assume you benchmarked that thing, otherwise you would have no way to predict it's "MUCH slower"). > Basically my question is whether any code other than the lua_setfenv and > lua_getfenv depend on > Udata->env being a (Table *)? If adding dozen lines to the core means I > don't have to > create extra table, and it doesn't break anything, I think it's worth doing. A dozen lines for every small feature, and in the end you get a multi-gigabyte bloatware. I guess the authors have to plainly ignore some feature request to keep Lua small. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 05:45:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n888j6Oo007101; Tue, 8 Sep 2009 05:45:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D7DA19286; Tue, 8 Sep 2009 05:44:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74B26191F2 for ; Tue, 8 Sep 2009 05:44:41 -0300 (BRT) Received: by fxm25 with SMTP id 25so2218284fxm.5 for ; Tue, 08 Sep 2009 01:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fPrOo4blEUxf/UcbYSnjZd2GflyakG/C+o48LOLd74U=; b=WF0E4KowlPCuTZHYAa6IfEn0MpUi/HUztGz2BCAs2hpFTooyzN0xd/e5uuNT7IQg9n KaCc1gQHLb3xQUbdHDbdMWqZkt7L1gPQRLip5y0iuyqvgkTPxXC9HL5MkelBzdVkLM4m xPBfqtJ7IpZJMahI4bzrGsDYa8O7cCAwyRxE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wx+3Mm0pU0K/nd+cv6NO5DygneYT76cFQIqNHotaAueLmFmjfgIPhTU6RTI5q8TTSv oSMd93xNaqNLN0sfy5MhJkElWV0dj+Hn2JQlFIqycnUxfkEbd8PrT6iiF6/neYVA/15D Cs6/5gEI0Wu5GWDXM2dJVgE/TQrU0xju2jxX8= MIME-Version: 1.0 Received: by 10.204.163.5 with SMTP id y5mr12962125bkx.37.1252399479927; Tue, 08 Sep 2009 01:44:39 -0700 (PDT) In-Reply-To: <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> References: <4AA540CA.2080004@cowlark.com> <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> <4AA60D5E.9090304@wp.pl> <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> Date: Tue, 8 Sep 2009 10:44:39 +0200 Message-ID: <560972290909080144p71831fat8f8711553caf86bb@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n888j6Oo007101 On Tue, Sep 8, 2009 at 10:23 AM, steve donovan wrote: > deprecate good old mscvrt.dll makes for life of headaches.  (Mingw can > actually build against the new runtimes, but not always.) For reference, this is how you can build lfs with mingw for Lua for Windows: http://lua-users.org/lists/lua-l/2008-07/msg00309.html This was an interesting challenge, because of some API renamings detailed in that post. Ralph Hempel on persuading LuaRocks to use mingw: http://lua-users.org/lists/lua-l/2008-08/msg00091.html steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 05:51:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n888plli007651; Tue, 8 Sep 2009 05:51:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4153919294; Tue, 8 Sep 2009 05:51:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 136C619276 for ; Tue, 8 Sep 2009 05:51:23 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MkwQ1-0004jL-S1 for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 09:51:18 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 813A270063 for ; Tue, 8 Sep 2009 09:51:16 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:46331 with envelope Message-ID: <4AA61AFD.2070706@cowlark.com> Date: Tue, 08 Sep 2009 09:51:09 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA58E56.5000403@gmail.com> <305dffcb0909071645sf523050j64d0b3c3206990c4@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n888plli007651 David Smead wrote: [...] > For compile only - you probably need some include dirs and libs. > gcc -c -ggdb -Wall -Werror -Wfatal-errors -Werror is dead handy for development, but may I make a plea to remember to turn it *off* for distribution? The problem is that while the C standard mandates when compilers produce errors, it does not mandate when they produce warnings. So, different compilers produce different warnings. This means that with this option, working, non-broken code that compiles fine on compiler X will fail to compile on compiler Y, because Y is producing a warning in a place where X did not. The gcc maintainers leave -Werror turned on, with the entirely unfunny consequence that building gcc 4.Y on gcc 4.X where certain combinations of X and Y will frequently fail to work out of the box: http://www.cowlark.com/2009-07-04-building-gcc/ -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 06:27:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n889RbQI010876; Tue, 8 Sep 2009 06:27:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55E98192C1; Tue, 8 Sep 2009 06:27:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2AE2192B2 for ; Tue, 8 Sep 2009 06:27:06 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 8FCD666C2 for ; Tue, 8 Sep 2009 12:26:59 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: userdata environment References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> Date: Tue, 08 Sep 2009 12:25:29 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Feel free to provide the benchmark results next time you talk about > performance here, many people will simply ignore your comments > otherwise (I assume you benchmarked that thing, otherwise you would > have no way to predict it's "MUCH slower"). Fair. see below. > A dozen lines for every small feature, and in the end you get a > multi-gigabyte bloatware. I guess the authors have to plainly ignore > some feature request to keep Lua small. I wouldn't want such hacks to be included in core. One of the best things about Lua core is that it is simple enough so that I can understand the code and make required change myself. Most of the time. Putting all the small hacks into core would make it indecipherable. I was asking this question to make sure I've not overlooked something, and to possibly hear if someone has done similar modification previously. Sorry for witing in such a way that my intent was not clear. ==8<======================== require "socket" local N = 1000000 local reg = {} local obj = {} setmetatable(reg, { __mode = "k" }) local setfe = debug.setfenv local getfe = debug.getfenv local t = 0 local function time() local t2 = socket.gettime() print(t2 - t) t = t2 end for i = 1,N do obj[i] = newproxy() end collectgarbage() collectgarbage() t = socket.gettime() for i = 1,N do setfe(obj[i], obj) end time() for i = 1,N do reg[obj[i]] = obj end time() for i = 1,N do local x = getfe(obj[i]) end time() for i = 1,N do local x = reg[obj[i]] end time() ==8<======================== 0.13839292526245 0.3968460559845 0.10384202003479 0.1705310344696 same thing in C, using rawget/rawset: timing 0.095036 sec timing 0.559623 sec timing 0.065464 sec timing 0.205189 sec ... also note that pure lua_setfenv doesn't allocate resources and cannot throw, thus there is no need to put it in try/catch guards at C side. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 06:47:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n889lXDt012507; Tue, 8 Sep 2009 06:47:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A720119143; Tue, 8 Sep 2009 06:47:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61C8419104 for ; Tue, 8 Sep 2009 06:47:05 -0300 (BRT) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090908094703.NLJL6611.mtaout02-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Tue, 8 Sep 2009 10:47:03 +0100 Received: from [92.27.145.76] (helo=taboche) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1MkxHz-00084l-Jc for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 10:47:03 +0100 From: Thomas Lauer To: Lua list Subject: Re: The source file culture Date: Tue, 08 Sep 2009 10:47:06 +0100 Organization: TL Message-ID: <8i9ca5pnmgi8kfc348dq1ln1ep5vgec6mo@thomaslauer.com> References: <4AA540CA.2080004@cowlark.com> <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> <4AA60D5E.9090304@wp.pl> <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> In-Reply-To: <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=SFBYNVl0AAAA:8 a=dk1sARaDjArJi2XB1wgA:9 a=oXNuNQDtYLDvGhTOq-_q9iJQk2sA:4 a=MSl-tDqOz04A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n889lXDt012507 steve donovan wrote: ----original message---- From: steve donovan Date: Tue, 8 Sep 2009 10:23:20 +0200 Subj: Re: The source file culture > 2009/9/8 Michal Kolodziejczyk : > > So I would say it is a Microsoft (and also Apple) culture which prevents > > you from easily compiling any available source code. > > Well, Unix culture is code-based, and when balancing the needs of > developers and users, tends to make life easier for developers. > > The average Windows/Mac user is scared of command-line tools, and I > include many intelligent engineers and scientists in this category; it > isn't a sign of lack of intelligence; they just have different > piorities. Cygwin is not a solution to a problem they recognize ;) So > I have sympathy for Lua programmers who find that C makes their head > hurt. > > Although, man, does Microsoft make compiling more difficult than it > need be! I agree that compiling under Win32 is not as straightforward as it could be. Part of that has historical reasons and part has to do with the fact that hindsight is always easier on the eyes than foresight. A good part of it is sheer MS stupidity though. > The decision to have a compiler-specific runtime and > deprecate good old mscvrt.dll makes for life of headaches. It is possible, even with the newer MS compilers (2005, 2008), to link against MSVCRT.DLL. This is even supported in the sense that MS provides a set of tools to do so and does it for (some of) its products as well. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 06:59:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n889xp8Z013470; Tue, 8 Sep 2009 06:59:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7A96192CF; Tue, 8 Sep 2009 06:59:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A0E119131 for ; Tue, 8 Sep 2009 06:59:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so3106774ewy.5 for ; Tue, 08 Sep 2009 02:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=UxD/qJk0ts4EX88c/ftP3YKGEfAbmfHL3B0O8F2vrTQ=; b=S4M1K4MIF02XDYmeGVj++zmSQfhOjpuo7Yg9ncsUbm8/opzy2XaDC6XF5YVhsJuhky mlMPWhA2UjFNXoaCPxi0Jo88+SG0uNB9bTYESx+gEHhNhwtVNxIJ3gZr7BERzxsoDUTG 20gxMgQCpxR+2QTevRGwubjWtBFqzcxS6X3b8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ZEoKr0jbubmND6VZcZW1jEEPGXDw5jFO2zpJ479c8e+aogN9icPYjhvSYEJf1sm8mo 70S/0euhkQRof3NDlvcDcjmb+33qKogeoBbIaEoyxTmU1X4IaIrOIU29+L08FvNR5m8j wbgbBB8PS5DfjUW80kHUZSHYd/yP8v/iH+W2s= MIME-Version: 1.0 Received: by 10.216.35.76 with SMTP id t54mr1777015wea.181.1252403961144; Tue, 08 Sep 2009 02:59:21 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Tue, 8 Sep 2009 11:59:01 +0200 Message-ID: <89d273ba0909080259w1e1cb6b8k246c58870a91c9b1@mail.gmail.com> Subject: Re: Announce: Darwin module system To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/7 Jim Jennings : > (2a) Namespace control: Imports > > There are many ways to write Lua modules. I like the ones that return the > module table, so that I can choose the name for the table of functions > provided by the module, e.g. > > rtype = require "recordtype" > > Unfortunately, not too many modules are written this way, because it can be > awkward to do so. A lot of modules create a table with a name that is fixed > in the source code for the module. In fact, modules that use the Lua module > function do this. That last point is not accurate. Modules that use the "module" function don't have to use a fixed name when calling it. You can simply forward the name passed to the module loader to the "module" function. Most of my Lua modules start with this line: module(..., package.seeall) Either you knew it and you purposefully omitted to mention it, or you didn't and in that case you may have underestimated the possibilities of the existing Lua module system. In both cases something feels wrong to me. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 07:44:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88AiF1t017791; Tue, 8 Sep 2009 07:44:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33201192C3; Tue, 8 Sep 2009 07:43:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by bazar2.conectiva.com.br (Postfix) with SMTP id BFBE9192A2 for ; Tue, 8 Sep 2009 07:43:45 -0300 (BRT) Received: from source ([209.85.220.207]) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKSqY1TBbGSnRnsPjHoDw0k1zMRq/OCKBO@postini.com; Tue, 08 Sep 2009 03:43:46 PDT Received: by fxm3 with SMTP id 3so2474909fxm.8 for ; Tue, 08 Sep 2009 03:43:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.4.15 with SMTP id 15mr5706610fap.97.1252406604303; Tue, 08 Sep 2009 03:43:24 -0700 (PDT) Date: Tue, 8 Sep 2009 11:43:24 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua mailing list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88AiF1t017791 [Apologies for not replying to this message by reply to a list email; I had delivery turned off at the time.] George Petsagourakis wrote: > My comment stems from the fact that there are quite a lot of people > who are using Windows, and really there is nothing we can do > other than open the code with a text editor and look at it unless we > are into C programming. It has nothing to do with Windows, it applies to any Lua user who is "not into C programming". Equally, the same applies to anyone perusing a Lua script who is not into Lua programming. > Taking this as a fact implies that in order to script Lua, As already pointed out, this is untrue. What is true is that the standard Lua system does not provide much in the way of libraries. However, I often find myself installing extra libraries for Perl programming as I do for Lua. The difference is that CPAN provides a simple uniform system, which hides the C compilation &c. that is needed. > you need to be able to program in C which blows away > all the simple to use syntax concept of Lua, that is the main selling > point to non programmers. Lua programming is, by definition, not for non-programmers! Lua is of interest to non-programmers for data description, configuration, and, potentially, as a way in to programming. Again, there are ways to make it easier, and many distributions, like Lua for Windows, do exactly that. > I do realize that Lua isn't about getting it out and that it is meant to be > embedded in another host program but it has gotten beyond that > scope, for quite some years now, especially since the release of > the Kepler project. And the Kepler project provides the solution too: luarocks (sorry, I referred to "gems" in a previous post, which is of course the Ruby equivalent). > I feel the need to express that the community > should be ready, for example, when the Apache includes Lua > support with their next release. For what is the community not "ready"? Really, your entire argument is a mish-mash of exaggeration ("you can't program in Lua without C"), nonsense ("you can't use Lua on Windows if you're a non-programmer"), personal bias ("I want Windows binaries!") and untruth ("Lua doesn't have a module system"). It's perfectly true that Lua's distribution is not as advanced as its competitors'. This suggests two logical courses of action for you: decide to help, or decide to use a more mature language platform. While I'm sure you're not a troll, this kind of lazy un-thought-out writing is little better than trolling. -- http://rrt.sc3d.org Il ne vaut pas la peine de peigner l’eau From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 07:50:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88AoiJJ018640; Tue, 8 Sep 2009 07:50:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDC89192E6; Tue, 8 Sep 2009 07:50:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6C1F1192AA for ; Tue, 8 Sep 2009 07:50:19 -0300 (BRT) Received: from source ([209.85.218.223]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKSqY26GTroxoLcyJyriLHYMaEoUBafufH@postini.com; Tue, 08 Sep 2009 03:50:19 PDT Received: by bwz23 with SMTP id 23so2827221bwz.1 for ; Tue, 08 Sep 2009 03:50:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.2.217 with SMTP id 25mr5520720fak.41.1252407014803; Tue, 08 Sep 2009 03:50:14 -0700 (PDT) Date: Tue, 8 Sep 2009 11:50:14 +0100 Message-ID: Subject: curses From: Reuben Thomas To: Lua mailing list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88AoiJJ018640 I just looked into the state of support for curses. The best I can find is lcurses 0.2, which seems basically to be abandonware. I'm currently rewriting GNU Zile (a lightweight Emacs clone) in Lua, so I need curses support. Zile does not need particularly advanced curses support; in particular, it doesn't use panels at all. Nonetheless, I'd be happy to adopt lcurses. Is anyone else interested in its development? My default method would be simply to start a LuaForge project, so if anyone else is working on it and already has a home for it, let me know. My personal goals would merely be to package it reasonably (by "reasonably" I mean, adding an autotools build system, so that I can easily call it from Zile's build system), and to try to get it packaged in Debian/Ubuntu, along with fixing any bugs, particularly portability bugs (I very much doubt it is missing any features I need). If anyone else is interested, please reply to this thread and then after a decent interval has elapsed we can take it off-list and work out what to do next. -- http://rrt.sc3d.org L’art des vers est de transformer en beautés les faiblesses (Aragon) From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:10:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BA2QU020879; Tue, 8 Sep 2009 08:10:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B267192E9; Tue, 8 Sep 2009 08:09:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80B5218F43 for ; Tue, 8 Sep 2009 08:09:29 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 1B739B1CDF for ; Tue, 8 Sep 2009 14:09:23 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: curses References: Date: Tue, 08 Sep 2009 14:07:53 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 08 Sep 2009 13:50:14 +0300, Reuben Thomas wrote: > I'm currently rewriting GNU Zile (a lightweight Emacs clone) in Lua, > so I need curses support. You may consider doing it without curses. That library is worthy of it's name. There is big enough subset of ANSI escape sequences that is well supported by all current terminals. Terminal emulation bugs are often easy to work around without adding specific cases to the code. See http://vt100.net and http://www.xfree86.org/current/ctlseqs.html for good reference. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:18:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BIAT0021825; Tue, 8 Sep 2009 08:18:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F227192FB; Tue, 8 Sep 2009 08:17:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F811192EE for ; Tue, 8 Sep 2009 08:17:44 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MkyhY-0000mR-UK for ; Tue, 08 Sep 2009 12:17:32 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mkyhh-0000gE-VE for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 12:17:42 +0100 Date: Tue, 8 Sep 2009 12:17:41 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: curses Message-ID: <20090908121741.504a34c8@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 8 Sep 2009 11:50:14 +0100 Reuben Thomas wrote: > I'm currently rewriting GNU Zile (a lightweight Emacs clone) in Lua, I would just like to say that I love you. I've been meaning to replace the hole in my soul that Zap left with an emacs-clone except with Lua rather than ((LISP)). > so I need curses support. Zile does not need particularly advanced > curses support; in particular, it doesn't use panels at all. > Nonetheless, I'd be happy to adopt lcurses. Is anyone else interested > in its development? My default method would be simply to start a > LuaForge project, so if anyone else is working on it and already has a > home for it, let me know. I'd love a modern, easy-to-use, non-eye-bleed-causing curses binding that is maintained. Consider this a +1. B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:28:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BSAHQ022702; Tue, 8 Sep 2009 08:28:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23F6E192AA; Tue, 8 Sep 2009 08:27:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9C136190F9 for ; Tue, 8 Sep 2009 08:27:43 -0300 (BRT) Received: from source ([209.85.220.208]) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKSqY/rWA50mr/gP4WWHmfDPIj2n/yHmah@postini.com; Tue, 08 Sep 2009 04:27:44 PDT Received: by fxm4 with SMTP id 4so2967864fxm.40 for ; Tue, 08 Sep 2009 04:27:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.75.133 with SMTP id y5mr5823889faj.92.1252409260058; Tue, 08 Sep 2009 04:27:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Sep 2009 12:27:40 +0100 Message-ID: Subject: Re: curses From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/8 Juris Kalnins : > On Tue, 08 Sep 2009 13:50:14 +0300, Reuben Thomas wrote: > > >> I'm currently rewriting GNU Zile (a lightweight Emacs clone) in Lua, >> so I need curses support. > > You may consider doing it without curses. That library is worthy of it's > name. Not in my experience. I've tried with termcap before, but simply ended up hitting problems that curses has already fixed. Curses is also standardized in POSIX-2001. > There is big enough subset of ANSI escape sequences that is well > supported by all current terminals. That's nice in theory, but "a big enough subset" is not a documented standard (though I see that it is documented at least to some degree). > Terminal emulation bugs are often easy to work around without adding > specific cases to the code. And with curses I don't have to. > See http://vt100.net and http://www.xfree86.org/current/ctlseqs.html > for good reference. Thanks, but with curses I can spend my time writing the application rather than the terminal interaction. As far as I'm concerned, this is already a solved problem. (Plus the fact that ncurses's maintainer is responsive helps.) -- http://rrt.sc3d.org Belief marks the line at which our thinking stops (Carse) From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:32:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BWs0f023218; Tue, 8 Sep 2009 08:32:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2A4519329; Tue, 8 Sep 2009 08:32:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og102.obsmtp.com (exprod7og102.obsmtp.com [64.18.2.157]) by bazar2.conectiva.com.br (Postfix) with SMTP id A80AE19176 for ; Tue, 8 Sep 2009 08:32:15 -0300 (BRT) Received: from source ([209.85.220.223]) by exprod7ob102.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZAvu5JzrcP9D0XFLeeT1j26uoSLFcp@postini.com; Tue, 08 Sep 2009 04:32:16 PDT Received: by fxm23 with SMTP id 23so3016942fxm.30 for ; Tue, 08 Sep 2009 04:32:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.98.19 with SMTP id o19mr5811856fan.82.1252409533504; Tue, 08 Sep 2009 04:32:13 -0700 (PDT) In-Reply-To: <20090908121741.504a34c8@trite.i.flarn.net.i.flarn.net> References: <20090908121741.504a34c8@trite.i.flarn.net.i.flarn.net> Date: Tue, 8 Sep 2009 12:32:13 +0100 Message-ID: Subject: Re: curses From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88BWs0f023218 2009/9/8 Rob Kendrick : > On Tue, 8 Sep 2009 11:50:14 +0100 > Reuben Thomas wrote: > >> I'm currently rewriting GNU Zile (a lightweight Emacs clone) in Lua, > > I would just like to say that I love you.  I've been meaning to replace > the hole in my soul that Zap left with an emacs-clone except with Lua > rather than ((LISP)). Hold your horses. Zile is a strict subset of Emacs. It does not now and will not ever expose a Lua interface. Indeed, I hope to retire it altogether in the medium term, if I can get Emacs to build smaller. I am rewriting it in Lua to make it easier to maintain, and easier to experiment with (see e.g. my past experiment, Zee: http://sf.net/projects/zee/) and as an exercise in rewriting legacy C in Lua. > I'd love a modern, easy-to-use, non-eye-bleed-causing curses binding > that is maintained. Consider this a +1. Depending on what makes your eyes bleed, I may not be your friend. Looking at the existing code, I have already ripped out the PDCurses workarounds (they belong in a PDCurses wrapper, not in a language binding; in any case, I believe PDCurses is better these days) and I am looking at the rest of the code umming and ahing about how long it looks. I prefer thin C wrappers; the rest can always be done in Lua. On the other hand, having ripped all that stuff out "maintained" should be easier. -- http://rrt.sc3d.org Belief marks the line at which our thinking stops (Carse) From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:33:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BXh8p023362; Tue, 8 Sep 2009 08:33:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 205C419352; Tue, 8 Sep 2009 08:33:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA47019331 for ; Tue, 8 Sep 2009 08:33:15 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mkywi-0000l1-8B for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 12:33:12 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 23E33433E for ; Tue, 8 Sep 2009 12:33:09 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:42032 with envelope Message-ID: <4AA640EC.9030609@cowlark.com> Date: Tue, 08 Sep 2009 12:33:00 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: curses References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88BXh8p023362 Reuben Thomas wrote: > I just looked into the state of support for curses. The best I can > find is lcurses 0.2, which seems basically to be abandonware. I looked at lcurses a bit for WordGrinder, but eventually decided to roll my own instead --- I only needed a small amount of functionality but what I did need I needed with Unicode (is that grammar?). You're welcome to use it, though --- there's a basic bludgeoned-together-but-useful GUI library with support for things like forms and basic widgetry that you could rip out. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:43:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Bhkxa024522; Tue, 8 Sep 2009 08:43:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 097A2192F9; Tue, 8 Sep 2009 08:43:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 181EC1914F for ; Tue, 8 Sep 2009 08:43:21 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mkz6M-0004rN-Nk for ; Tue, 08 Sep 2009 12:43:10 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mkz6V-0001h1-Ra for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 12:43:19 +0100 Date: Tue, 8 Sep 2009 12:43:19 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: curses Message-ID: <20090908124319.327aecf7@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: <20090908121741.504a34c8@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88Bhkxa024522 On Tue, 8 Sep 2009 12:32:13 +0100 Reuben Thomas wrote: > 2009/9/8 Rob Kendrick : > > On Tue, 8 Sep 2009 11:50:14 +0100 > > Reuben Thomas wrote: > > > >> I'm currently rewriting GNU Zile (a lightweight Emacs clone) in > >> Lua, > > > > I would just like to say that I love you.  I've been meaning to > > replace the hole in my soul that Zap left with an emacs-clone > > except with Lua rather than ((LISP)). > > Hold your horses. Zile is a strict subset of Emacs. It does not now > and will not ever expose a Lua interface. Indeed, I hope to retire it > altogether in the medium term, if I can get Emacs to build smaller. That's a shame; I've used Zile in the past as something that's both small /and/ fast; Emacs is neither. > > I'd love a modern, easy-to-use, non-eye-bleed-causing curses binding > > that is maintained. Consider this a +1. > > Depending on what makes your eyes bleed, I may not be your friend. > Looking at the existing code, I have already ripped out the PDCurses > workarounds (they belong in a PDCurses wrapper, not in a language > binding; in any case, I believe PDCurses is better these days) and I > am looking at the rest of the code umming and ahing about how long it > looks. I prefer thin C wrappers; the rest can always be done in Lua. Oh, I agree entirely. B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:45:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BjGc7024760; Tue, 8 Sep 2009 08:45:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03B2F19344; Tue, 8 Sep 2009 08:44:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F57B1914F for ; Tue, 8 Sep 2009 08:44:50 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mkz7x-0001AC-2U for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 13:44:49 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2009 13:44:49 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2009 13:44:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: The source file culture Date: Tue, 08 Sep 2009 13:44:39 +0200 Lines: 26 Message-ID: References: <4AA54811.8000307@ntlworld.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4AA54811.8000307@ntlworld.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 07/09/2009 19:51, Chris Camacho wrote: > I'd love to be able to understand the reverse, why do people insist on > downloading binaries? > > There could be any manner of virus or back door in binary, at least if its > source code I can audit it myself, better yet I can fix it too. Because it is easier, faster and less prone to break (baring DLL hell issues)? Windows doesn't come with a compiler by default. And make utilities can bring different results (or break) depending if you use Cygwin, MingW, Visual Studio, TCC, Wacom or Borland compiler, etc. Most people will be afraid to use a compiler anyway. And will be totally unable to audit code... Beside, most of the time, supposing you know well the used programming language and the pitfalls it might offer, it is just too long to inspect source code: I want to use Eclipse or Thunderbird immediately, not scrutinize its source in search of some back door... :-) Beside, Windows culture is mostly binary based: commercial products just doesn't come with source (in general) and there are lot of useful freewares which are not open. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 08:56:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88BuqJp026319; Tue, 8 Sep 2009 08:56:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E205519373; Tue, 8 Sep 2009 08:56:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og117.obsmtp.com (exprod7og117.obsmtp.com [64.18.2.6]) by bazar2.conectiva.com.br (Postfix) with SMTP id C7A5E1936B for ; Tue, 8 Sep 2009 08:56:22 -0300 (BRT) Received: from source ([209.85.218.211]) by exprod7ob117.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZGZUJrNLLXg/YKe5N1SS8/8Y7Ma8r5@postini.com; Tue, 08 Sep 2009 04:56:23 PDT Received: by bwz7 with SMTP id 7so11966bwz.35 for ; Tue, 08 Sep 2009 04:56:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.22.4 with SMTP id l4mr5804532fab.37.1252410980304; Tue, 08 Sep 2009 04:56:20 -0700 (PDT) In-Reply-To: <20090908124319.327aecf7@trite.i.flarn.net.i.flarn.net> References: <20090908121741.504a34c8@trite.i.flarn.net.i.flarn.net> <20090908124319.327aecf7@trite.i.flarn.net.i.flarn.net> Date: Tue, 8 Sep 2009 12:56:20 +0100 Message-ID: Subject: Re: curses From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/8 Rob Kendrick : > That's a shame; I've used Zile in the past as something that's both > small /and/ fast; Emacs is neither. The reason I didn't say I wanted to get Emacs to go faster is that it goes quite fast enough. "emacs -Q -nw" starts up in about a second the first time, and just as fast as Zile after that. Adding a small configuration file doesn't make it take any longer. Zile should never really have been written; the effort instead should have been put into making Emacs configurable to run faster and smaller. Recently, most of the work needed to make it go faster has been done; smaller is all that's needed. The sheer amount of wheel-reinventing that goes into reimplementing Emacs in Zile is ridiculous. -- http://rrt.sc3d.org Imagine someone who has only ever heard music once From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 09:24:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88COgUW030858; Tue, 8 Sep 2009 09:24:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32CF61932B; Tue, 8 Sep 2009 09:24:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC1F9192E3 for ; Tue, 8 Sep 2009 09:24:13 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id E27D4B1E61 for ; Tue, 8 Sep 2009 15:24:05 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: curses References: Date: Tue, 08 Sep 2009 15:22:35 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 08 Sep 2009 14:27:40 +0300, Reuben Thomas wrote: > Thanks, but with curses I can spend my time writing the application > rather than the terminal interaction. As far as I'm concerned, this is > already a solved problem. (Plus the fact that ncurses's maintainer is > responsive helps.) > If that is the case, then by al means ignore my mail. Not having to deal with things like broken MacOS X Terminal.app scroll regions or windows telnet antics or rxvt function keys or nonstadard linux terminal escape sequence encoding etc. etc. + having it all to actually work is a big win. On the other hand - printing raw escape sequences is fun. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 09:48:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Cm5js002074; Tue, 8 Sep 2009 09:48:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2EA6192EA; Tue, 8 Sep 2009 09:47:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2E95192D1 for ; Tue, 8 Sep 2009 09:47:34 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Ml06e-00056T-00; Tue, 08 Sep 2009 14:47:32 +0200 Date: Tue, 8 Sep 2009 14:47:24 +0200 From: Mike Pall To: Lua list Subject: Re: Difficulties building Coco and liblua.so (and also RVM) Message-ID: <20090908124724.GA6604@mike.de> References: <20090907225955.GB27729@vaio.jimpryor.net> <20090908000908.GA3736@mike.de> <20090908011841.GE27729@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090908011841.GE27729@vaio.jimpryor.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Pryor wrote: > I'm also trying to build and try out the RVM patch. It doesn't patch > cleanly against the Lua 5.1.4 sources, so I'm going and cleaning it up > by hand. Mostly this is straightforward. There are a few spots where I'm > stuck though: the Lua 5.1.4 sources have changed > from what the RVM patch is trying to replace. I'm not familiar with > these sources yet, so don't know what's the right merge. I think you need to undo some coroutine-related changes introduced in Lua 5.1.3. Have a look at the Coco patch which does the same. > The wiki says that Greg Falcon aka VeLoSo has taken over maintenance of > the RVM patch. Is there any version floating around against the current > Lua sources? Is noone using this patch anymore? From what I've seen on > the mailing list it looks that, though there's no development happening > on it, it's still regarded as a solid and viable option? You'd have to ask Greg about the former. But it looks like RVM will be resurrected (again): the basic concept of RVM will be used to make the Lua 5.2 VM fully resumable: http://lua-users.org/lists/lua-l/2009-08/msg00540.html --Mike From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 09:57:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88CvebE004287; Tue, 8 Sep 2009 09:57:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09AD219349; Tue, 8 Sep 2009 09:57:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 712F2192E2 for ; Tue, 8 Sep 2009 09:57:09 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Ml0Fw-000578-00; Tue, 08 Sep 2009 14:57:08 +0200 Date: Tue, 8 Sep 2009 14:56:29 +0200 From: Mike Pall To: Lua list Subject: [ANN] Coco 1.1.6 released + URL changed Message-ID: <20090908125629.GA6937@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Coco is a small extension to get True C Coroutine semantics for Lua 5.1. True C coroutine semantics mean you can yield from a coroutine across a C call boundary and resume back to it (e.g. across pcall(), metamethods, iterators or callbacks). Coco is free software, released under the same license as Lua. Change list for version 1.1.6: - Fix compilation of the GCC inline assembler code on x64. - Added GCC inline assembler for faster context switching on Sparc. Thanks to Takayuki Usui. Here is a link to the project home page with full docs: http://coco.luajit.org/ And a direct link to the download page: http://coco.luajit.org/download.html *** NOTE: Coco has moved to its own domain! *** *** Please update your links and bookmarks -- thank you! *** --Mike From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 09:58:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88CwG6O004512; Tue, 8 Sep 2009 09:58:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32B8019368; Tue, 8 Sep 2009 09:57:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7424F1934A for ; Tue, 8 Sep 2009 09:57:44 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Ml0GT-00063x-QP for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 14:57:41 +0200 Received: from adsl233-96.kln.forthnet.gr ([79.103.46.96]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2009 14:57:41 +0200 Received: from petsagouris by adsl233-96.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Sep 2009 14:57:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: The source file culture Date: Tue, 8 Sep 2009 12:57:17 +0000 (UTC) Lines: 45 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 79.103.46.96 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Reuben Thomas sc3d.org> writes: > Really, your entire argument is a mish-mash of exaggeration ("you > can't program in Lua without C"), nonsense ("you can't use Lua on > Windows if you're a non-programmer"), personal bias ("I want Windows > binaries!") and untruth ("Lua doesn't have a module system"). It's > perfectly true that Lua's distribution is not as advanced as its > competitors'. This suggests two logical courses of action for you: > decide to help, or decide to use a more mature language platform. > > While I'm sure you're not a troll, this kind of lazy un-thought-out > writing is little better than trolling. > Reuben, snap out of it. I am trying to indicate a possible reality issue that people on Windows (installed on something around the 90% of machines world-wide) are facing as far as Lua's usability is concerned, don't turn it to flaming, I have already mentioned that it was not in my intentions. Reuben Thomas sc3d.org> writes: > > George Petsagourakis wrote: > > > My comment stems from the fact that there are quite a lot of people > > who are using Windows, and really there is nothing we can do > > other than open the code with a text editor and look at it unless we > > are into C programming. > > It has nothing to do with Windows, it applies to any Lua user who is > "not into C programming". Equally, the same applies to anyone perusing > a Lua script who is not into Lua programming. > Taking up Lua _is_ by far easier than taking up C. Full stop. Thanks to all for all your input. I'll show up in the list at some other point in time, since at the present I am being perceived as a troll and this is really not my intention. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 10:04:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88D4ihc005941; Tue, 8 Sep 2009 10:04:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CC5D19372; Tue, 8 Sep 2009 10:03:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BABE619351 for ; Tue, 8 Sep 2009 10:03:21 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 265A467A02 for ; Tue, 8 Sep 2009 09:03:18 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 08 Sep 2009 09:03:18 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=o1RRfozehj27kezDbTEQQUg+Xn8=; b=maNat1Qsh0pCFCUbyo1qMjLNqtr+nBzXO5C/ofKW9sTsoAGpn0uf3Gt5LLCAsdvhg201+y+1k0fDTm3+feXYo4eejPTiO8g190O4JLledBgAsb6EES/Frawv3pi4lG6536/BUtipilUpLE7ihiiSFrhrhoRQAI0yly6VuSp3i+c= X-Sasl-enc: 2f0EaCPOFOhJ/NmbRQz232r+vPoY7miw9uaVfOc58Up6 1252414995 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 00439503FC for ; Tue, 8 Sep 2009 09:03:14 -0400 (EDT) Date: Tue, 8 Sep 2009 09:03:06 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Updated RVM patch against Lua5.1.4---needs review Message-ID: <20090908130306.GH27729@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20090907225955.GB27729@vaio.jimpryor.net> <20090908000908.GA3736@mike.de> <20090908011841.GE27729@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20090908011841.GE27729@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 07, 2009 at 09:18:41PM -0400, Jim Pryor wrote: > Wow, terrific, thanks for the amazingly quick fix for Coco. > > I'm also trying to build and try out the RVM patch. It doesn't patch > cleanly against the Lua 5.1.4 sources, so I'm going and cleaning it up > by hand. Mostly this is straightforward. There are a few spots where I'm > stuck though: the Lua 5.1.4 sources have changed > from what the RVM patch is trying to replace. I'm not familiar with > these sources yet, so don't know what's the right merge. > > The wiki says that Greg Falcon aka VeLoSo has taken over maintenance of > the RVM patch. Is there any version floating around against the current > Lua sources? Is noone using this patch anymore? From what I've seen on > the mailing list it looks that, though there's no development happening > on it, it's still regarded as a solid and viable option? OK, I've done the grunt work of updating the Resumable VM patch against the Lua5.1.4 sources. What I've ended up with compiles and runs the test/ directory in the Lua5.1.4 sources without crashing. But it needs some code review! I'm new to Lua and in some places I had to make an educated guess about how to merge the rvm patch against the Lua5.1->Lua5.1.4 changes. Someone who really understands the source should look this over. I've made it easy for you. Attached are three patches _against the Lua5.1 rvm patch on the wiki_. That's right, they're patches against the patch file at http://lua-users.org/files/wiki_insecure/users/VeLoSo/lua5.1-rvm.patch. The first patch just changes some line numbers. I'm sure this is harmless. The second patch, (*-safe.patch) are changes that I'm pretty sure are fine. Someone should look at this too, but it's probably ok. The third patch are the changes that I feel less certain about. There's one largish patch that I'm least certain of, and the others are probably ok, but I put them here to be sure someone looks at them. Pretty please? -- Jim Pryor jim@jimpryor.net --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lua5.1.4-rvm-renumbering.patch" --- lua5.1-rvm.patch 2009-09-08 08:46:51.974477085 -0400 +++ lua5.1.4-rvm-renumbered 2009-09-08 08:43:38.454503248 -0400 @@ -1,7 +1,7 @@ -diff -ruN oldsrc/lapi.c newsrc/lapi.c ---- oldsrc/lapi.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lapi.c 2006-04-15 23:44:03.000000000 -0500 -@@ -283,7 +283,9 @@ +diff -ruN lua-5.1.4/src/lapi.c lua-5.1.4.new/src/lapi.c +--- lua-5.1.4/src/lapi.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lapi.c 2009-09-08 05:40:44.045591292 -0400 +@@ -290,7 +290,9 @@ lua_lock(L); /* may call tag method */ o1 = index2adr(L, index1); o2 = index2adr(L, index2); @@ -12,7 +12,7 @@ lua_unlock(L); return i; } -@@ -295,8 +297,10 @@ +@@ -302,8 +304,10 @@ lua_lock(L); /* may call tag method */ o1 = index2adr(L, index1); o2 = index2adr(L, index2); @@ -25,7 +25,7 @@ lua_unlock(L); return i; } -@@ -529,7 +533,9 @@ +@@ -536,7 +540,9 @@ lua_lock(L); t = index2adr(L, idx); api_checkvalidindex(L, t); @@ -36,7 +36,7 @@ lua_unlock(L); } -@@ -541,7 +547,9 @@ +@@ -548,7 +554,9 @@ t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); @@ -47,7 +47,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -641,7 +649,9 @@ +@@ -648,7 +656,9 @@ api_checknelems(L, 2); t = index2adr(L, idx); api_checkvalidindex(L, t); @@ -58,7 +58,7 @@ L->top -= 2; /* pop index and value */ lua_unlock(L); } -@@ -655,7 +665,9 @@ +@@ -662,7 +672,9 @@ t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); @@ -69,7 +69,7 @@ L->top--; /* pop value */ lua_unlock(L); } -@@ -758,22 +770,29 @@ +@@ -765,22 +777,29 @@ */ @@ -109,7 +109,7 @@ lua_unlock(L); } -@@ -788,31 +807,36 @@ +@@ -795,31 +814,36 @@ }; @@ -163,7 +163,7 @@ lua_unlock(L); return status; } -@@ -827,7 +851,7 @@ +@@ -834,7 +858,7 @@ }; @@ -172,7 +172,7 @@ struct CCallS *c = cast(struct CCallS *, ud); Closure *cl; cl = luaF_newCclosure(L, 0, getcurrenv(L)); -@@ -836,7 +860,8 @@ +@@ -843,7 +867,8 @@ api_incr_top(L); setpvalue(L->top, c->ud); /* push only argument */ api_incr_top(L); @@ -182,7 +182,7 @@ } -@@ -846,7 +871,7 @@ +@@ -853,7 +878,7 @@ lua_lock(L); c.func = func; c.ud = ud; @@ -191,7 +191,7 @@ lua_unlock(L); return status; } -@@ -954,7 +979,7 @@ +@@ -964,7 +989,7 @@ LUA_API int lua_error (lua_State *L) { lua_lock(L); api_checknelems(L, 1); @@ -200,7 +200,7 @@ lua_unlock(L); return 0; /* to avoid warnings */ } -@@ -982,7 +1007,9 @@ +@@ -992,7 +1017,9 @@ api_checknelems(L, n); if (n >= 2) { luaC_checkGC(L); @@ -211,9 +211,9 @@ L->top -= (n-1); } else if (n == 0) { /* push empty string */ -diff -ruN oldsrc/lbaselib.c newsrc/lbaselib.c ---- oldsrc/lbaselib.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lbaselib.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lbaselib.c lua-5.1.4.new/src/lbaselib.c +--- lua-5.1.4/src/lbaselib.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lbaselib.c 2009-09-08 05:40:44.045591292 -0400 @@ -30,13 +30,18 @@ */ static int luaB_print (lua_State *L) { @@ -253,7 +253,7 @@ } -@@ -369,32 +375,53 @@ +@@ -371,32 +377,53 @@ } @@ -324,7 +324,7 @@ switch (lua_type(L, 1)) { case LUA_TNUMBER: lua_pushstring(L, lua_tostring(L, 1)); -@@ -466,6 +493,7 @@ +@@ -468,6 +495,7 @@ {"tostring", luaB_tostring}, {"type", luaB_type}, {"unpack", luaB_unpack}, @@ -332,7 +332,7 @@ {"xpcall", luaB_xpcall}, {NULL, NULL} }; -@@ -482,6 +510,7 @@ +@@ -520,6 +548,7 @@ if (!lua_checkstack(co, narg)) luaL_error(L, "too many arguments to resume"); if (lua_status(co) == 0 && lua_gettop(co) == 0) { @@ -340,7 +340,7 @@ lua_pushliteral(L, "cannot resume dead coroutine"); return -1; /* error flag */ } -@@ -489,13 +518,16 @@ +@@ -528,13 +557,16 @@ status = lua_resume(co, narg); if (status == 0 || status == LUA_YIELD) { int nres = lua_gettop(co); @@ -358,7 +358,7 @@ return -1; /* error flag */ } } -@@ -506,16 +538,10 @@ +@@ -545,16 +577,10 @@ int r; luaL_argcheck(L, co, 1, "coroutine expected"); r = auxresume(L, co, lua_gettop(L) - 1); @@ -377,7 +377,7 @@ } -@@ -536,8 +562,7 @@ +@@ -575,8 +601,7 @@ static int luaB_cocreate (lua_State *L) { lua_State *NL = lua_newthread(L); @@ -387,9 +387,9 @@ lua_pushvalue(L, 1); /* move function to top */ lua_xmove(L, NL, 1); /* move function from L to NL */ return 1; -diff -ruN oldsrc/ldebug.c newsrc/ldebug.c ---- oldsrc/ldebug.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldebug.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/ldebug.c lua-5.1.4.new/src/ldebug.c +--- lua-5.1.4/src/ldebug.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/ldebug.c 2009-09-08 05:40:44.045591292 -0400 @@ -36,8 +36,8 @@ static int currentpc (lua_State *L, CallInfo *ci) { if (!isLua(ci)) return -1; /* function is not a Lua function? */ @@ -401,7 +401,7 @@ } -@@ -597,24 +597,11 @@ +@@ -615,24 +615,11 @@ } @@ -427,9 +427,9 @@ + luaD_throw(L, LUA_ERRRUN); } -diff -ruN oldsrc/ldebug.h newsrc/ldebug.h ---- oldsrc/ldebug.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldebug.h 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/ldebug.h lua-5.1.4.new/src/ldebug.h +--- lua-5.1.4/src/ldebug.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/ldebug.h 2009-09-08 05:40:44.045591292 -0400 @@ -26,7 +26,6 @@ LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); @@ -438,9 +438,9 @@ LUAI_FUNC int luaG_checkcode (const Proto *pt); LUAI_FUNC int luaG_checkopenop (Instruction i); -diff -ruN oldsrc/ldo.c newsrc/ldo.c ---- oldsrc/ldo.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldo.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/ldo.c lua-5.1.4.new/src/ldo.c +--- lua-5.1.4/src/ldo.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/ldo.c 2009-09-08 05:40:44.045591292 -0400 @@ -58,6 +58,10 @@ setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); break; @@ -493,7 +493,7 @@ } else { L->status = cast_byte(errcode); -@@ -114,12 +134,84 @@ +@@ -114,12 +136,84 @@ lj.previous = L->errorJmp; /* chain new error handler */ L->errorJmp = &lj; LUAI_TRY(L, &lj, @@ -579,7 +579,7 @@ /* }====================================================== */ -@@ -180,10 +272,11 @@ +@@ -180,10 +274,11 @@ void luaD_callhook (lua_State *L, int event, int line) { lua_Hook hook = L->hook; @@ -592,7 +592,7 @@ ar.event = event; ar.currentline = line; if (event == LUA_HOOKTAILRET) -@@ -193,14 +286,22 @@ +@@ -193,14 +288,22 @@ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ L->ci->top = L->top + LUA_MINSTACK; lua_assert(L->ci->top <= L->stack_last); @@ -618,7 +618,7 @@ } } -@@ -262,17 +363,17 @@ +@@ -262,17 +365,17 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { @@ -641,7 +641,7 @@ luaD_checkstack(L, p->maxstacksize); func = restorestack(L, funcr); if (!p->is_vararg) { /* no varargs? */ -@@ -290,16 +391,18 @@ +@@ -290,16 +393,18 @@ L->base = ci->base = base; ci->top = L->base + p->maxstacksize; lua_assert(ci->top <= L->stack_last); @@ -664,7 +664,7 @@ } return PCRLUA; } -@@ -312,11 +415,13 @@ +@@ -312,11 +417,13 @@ L->base = ci->base = ci->func + 1; ci->top = L->top + LUA_MINSTACK; lua_assert(ci->top <= L->stack_last); @@ -680,7 +680,7 @@ lua_lock(L); if (n < 0) /* yielding? */ return PCRYIELD; -@@ -349,7 +454,7 @@ +@@ -349,7 +456,7 @@ res = ci->func; /* res == final position of 1st result */ wanted = ci->nresults; L->base = (ci - 1)->base; /* restore base */ @@ -689,7 +689,7 @@ /* move results to correct place */ for (i = wanted; i != 0 && firstResult < L->top; i--) setobjs2s(L, res++, firstResult++); -@@ -366,41 +471,51 @@ +@@ -366,41 +473,51 @@ ** When returns, all the results are on the stack, starting at the original ** function position. */ @@ -767,7 +767,7 @@ } -@@ -414,67 +529,61 @@ +@@ -415,67 +532,61 @@ LUA_API int lua_resume (lua_State *L, int nargs) { @@ -875,7 +875,7 @@ /* ** Execute a protected parser. */ -@@ -484,12 +593,13 @@ +@@ -487,12 +624,13 @@ const char *name; }; @@ -890,7 +890,7 @@ luaC_checkGC(L); tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, &p->buff, p->name); -@@ -499,6 +609,7 @@ +@@ -502,6 +640,7 @@ cl->l.upvals[i] = luaF_newupval(L); setclvalue(L, L->top, cl); incr_top(L); @@ -898,7 +898,7 @@ } -@@ -507,7 +618,8 @@ +@@ -510,7 +649,8 @@ int status; p.z = z; p.name = name; luaZ_initbuffer(L, &p.buff); @@ -908,9 +908,9 @@ luaZ_freebuffer(L, &p.buff); return status; } -diff -ruN oldsrc/ldo.h newsrc/ldo.h ---- oldsrc/ldo.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldo.h 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/ldo.h lua-5.1.4.new/src/ldo.h +--- lua-5.1.4/src/ldo.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/ldo.h 2009-09-08 05:40:44.048922581 -0400 @@ -31,18 +31,30 @@ /* results from luaD_precall */ #define PCRLUA 0 /* initiated a call to a Lua function */ @@ -962,10 +962,10 @@ LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); -diff -ruN oldsrc/lgc.c newsrc/lgc.c ---- oldsrc/lgc.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lgc.c 2006-04-15 23:44:03.000000000 -0500 -@@ -455,15 +455,12 @@ +diff -ruN lua-5.1.4/src/lgc.c lua-5.1.4.new/src/lgc.c +--- lua-5.1.4/src/lgc.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lgc.c 2009-09-08 05:40:44.048922581 -0400 +@@ -457,15 +457,12 @@ makewhite(g, o); tm = fasttm(L, udata->uv.metatable, TM_GC); if (tm != NULL) { @@ -982,9 +982,9 @@ g->GCthreshold = oldt; /* restore threshold */ } } -diff -ruN oldsrc/lstate.c newsrc/lstate.c ---- oldsrc/lstate.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lstate.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lstate.c lua-5.1.4.new/src/lstate.c +--- lua-5.1.4/src/lstate.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lstate.c 2009-09-08 05:40:44.048922581 -0400 @@ -55,6 +55,7 @@ setnilvalue(L1->top++); /* `function' entry for this `ci' */ L1->base = L1->ci->base = L1->top; @@ -1028,7 +1028,7 @@ setnilvalue(gt(L)); } -@@ -190,9 +190,10 @@ +@@ -190,9 +193,10 @@ } @@ -1040,7 +1040,7 @@ } -@@ -202,9 +203,9 @@ +@@ -201,9 +205,9 @@ lua_lock(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ @@ -1051,9 +1051,9 @@ L->base = L->top = L->ci->base; L->nCcalls = 0; } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); -diff -ruN oldsrc/lstate.h newsrc/lstate.h ---- oldsrc/lstate.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lstate.h 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lstate.h lua-5.1.4.new/src/lstate.h +--- lua-5.1.4/src/lstate.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lstate.h 2009-09-08 05:40:44.048922581 -0400 @@ -48,10 +48,12 @@ typedef struct CallInfo { StkId base; /* base for this function */ @@ -1096,7 +1096,7 @@ int hookcount; lua_Hook hook; TValue l_gt; /* table of globals */ -@@ -122,7 +122,7 @@ +@@ -123,7 +123,7 @@ GCObject *openupval; /* list of open upvalues in this stack */ GCObject *gclist; struct lua_longjmp *errorJmp; /* current error recover point */ @@ -1105,9 +1105,9 @@ }; -diff -ruN oldsrc/ltablib.c newsrc/ltablib.c ---- oldsrc/ltablib.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ltablib.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/ltablib.c lua-5.1.4.new/src/ltablib.c +--- lua-5.1.4/src/ltablib.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/ltablib.c 2009-09-08 05:40:44.048922581 -0400 @@ -20,14 +20,22 @@ @@ -1152,10 +1152,10 @@ if (!lua_isnil(L, -1)) return 1; lua_pop(L, 2); /* remove value and result */ -diff -ruN oldsrc/luaconf.h newsrc/luaconf.h ---- oldsrc/luaconf.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/luaconf.h 2006-04-15 23:44:03.000000000 -0500 -@@ -580,7 +580,7 @@ +diff -ruN lua-5.1.4/src/luaconf.h lua-5.1.4.new/src/luaconf.h +--- lua-5.1.4/src/luaconf.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/luaconf.h 2009-09-08 05:40:44.048922581 -0400 +@@ -607,7 +607,7 @@ /* C++ exceptions */ #define LUAI_THROW(L,c) throw(c) #define LUAI_TRY(L,c,a) try { a } catch(...) \ @@ -1164,9 +1164,9 @@ #define luai_jmpbuf int /* dummy variable */ #elif defined(LUA_USE_ULONGJMP) -diff -ruN oldsrc/lua.h newsrc/lua.h ---- oldsrc/lua.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lua.h 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lua.h lua-5.1.4.new/src/lua.h +--- lua-5.1.4/src/lua.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lua.h 2009-09-08 05:40:44.048922581 -0400 @@ -16,7 +16,7 @@ #include "luaconf.h" @@ -1176,7 +1176,7 @@ #define LUA_VERSION_NUM 501 #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" -@@ -44,6 +44,7 @@ +@@ -45,6 +45,7 @@ #define LUA_ERRSYNTAX 3 #define LUA_ERRMEM 4 #define LUA_ERRERR 5 @@ -1184,7 +1184,7 @@ typedef struct lua_State lua_State; -@@ -197,22 +198,37 @@ +@@ -198,22 +199,37 @@ /* ** `load' and `call' functions (load and run Lua code) */ @@ -1225,9 +1225,9 @@ /* ** garbage-collection function and options */ -diff -ruN oldsrc/lvm.c newsrc/lvm.c ---- oldsrc/lvm.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lvm.c 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lvm.c lua-5.1.4.new/src/lvm.c +--- lua-5.1.4/src/lvm.c 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lvm.c 2009-09-08 05:40:44.052255477 -0400 @@ -57,10 +57,10 @@ } @@ -1242,7 +1242,7 @@ if (mask > LUA_MASKLINE) { /* instruction-hook set? */ if (L->hookcount == 0) { resethookcount(L); -@@ -76,6 +76,7 @@ +@@ -74,6 +74,7 @@ if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) luaD_callhook(L, LUA_HOOKLINE, newline); } @@ -1250,7 +1250,7 @@ } -@@ -87,7 +88,7 @@ +@@ -85,7 +86,7 @@ setobj2s(L, L->top+2, p2); /* 2nd argument */ luaD_checkstack(L, 3); L->top += 3; @@ -1259,7 +1259,7 @@ res = restorestack(L, result); L->top--; setobjs2s(L, res, L->top); -@@ -103,7 +104,7 @@ +@@ -101,7 +102,7 @@ setobj2s(L, L->top+3, p3); /* 3th argument */ luaD_checkstack(L, 4); L->top += 4; @@ -1268,7 +1268,7 @@ } -@@ -282,8 +283,11 @@ +@@ -280,8 +281,11 @@ StkId top = L->base + last + 1; int n = 2; /* number of elements handled in this pass (at least 2) */ if (!tostring(L, top-2) || !tostring(L, top-1)) { @@ -1306,7 +1306,7 @@ cl = &clvalue(L->ci->func)->l; base = L->base; k = cl->p->k; -@@ -385,14 +390,8 @@ +@@ -386,14 +391,8 @@ const Instruction i = *pc++; StkId ra; if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && @@ -1323,7 +1323,7 @@ /* warning!! several calls may realloc the stack and invalidate `ra' */ ra = RA(i); lua_assert(base == L->base && L->base == L->ci->base); -@@ -582,7 +581,7 @@ +@@ -583,7 +582,7 @@ int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ @@ -1332,7 +1332,7 @@ switch (luaD_precall(L, ra, nresults)) { case PCRLUA: { nexeccalls++; -@@ -595,14 +594,14 @@ +@@ -596,14 +595,14 @@ continue; } default: { @@ -1349,7 +1349,7 @@ lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); switch (luaD_precall(L, ra, LUA_MULTRET)) { case PCRLUA: { -@@ -617,7 +616,7 @@ +@@ -618,7 +617,7 @@ setobjs2s(L, func+aux, pfunc+aux); ci->top = L->top = func+aux; /* correct top */ lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); @@ -1358,7 +1358,7 @@ ci->tailcalls++; /* one more call lost */ L->ci--; /* remove new frame */ goto reentry; -@@ -627,7 +626,7 @@ +@@ -628,7 +627,7 @@ continue; } default: { @@ -1367,7 +1367,7 @@ } } } -@@ -635,14 +634,13 @@ +@@ -636,14 +635,13 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); @@ -1385,7 +1385,7 @@ goto reentry; } } -@@ -662,7 +660,7 @@ +@@ -663,7 +661,7 @@ const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; @@ -1394,7 +1394,7 @@ if (!tonumber(init, ra)) luaG_runerror(L, LUA_QL("for") " initial value must be a number"); else if (!tonumber(plimit, ra+1)) -@@ -679,7 +677,7 @@ +@@ -680,7 +678,7 @@ setobjs2s(L, cb+1, ra+1); setobjs2s(L, cb, ra); L->top = cb+3; /* func. + 2 args (state and index) */ @@ -1403,7 +1403,7 @@ L->top = L->ci->top; cb = RA(i) + 3; /* previous call may change the stack */ if (!ttisnil(cb)) { /* continue loop? */ -@@ -760,3 +758,56 @@ +@@ -761,3 +759,56 @@ } } @@ -1460,9 +1460,9 @@ + GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL); +} + -diff -ruN oldsrc/lvm.h newsrc/lvm.h ---- oldsrc/lvm.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lvm.h 2006-04-15 23:44:03.000000000 -0500 +diff -ruN lua-5.1.4/src/lvm.h lua-5.1.4.new/src/lvm.h +--- lua-5.1.4/src/lvm.h 2009-09-08 05:41:29.245553574 -0400 ++++ lua-5.1.4.new/src/lvm.h 2009-09-08 05:40:44.052255477 -0400 @@ -21,6 +21,9 @@ #define equalobj(L,o1,o2) \ (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lua5.1.4-rvm-safe.patch" --- lua5.1-rvm.patch 2009-09-08 08:43:38.454503248 -0400 +++ lua5.1.4-rvm-safe 2009-09-08 08:43:38.464950526 -0400 @@ -335,17 +335,14 @@ @@ -520,6 +548,7 @@ if (!lua_checkstack(co, narg)) luaL_error(L, "too many arguments to resume"); - if (lua_status(co) == 0 && lua_gettop(co) == 0) { + if (status != CO_SUS) { + lua_pushboolean(L, 0); - lua_pushliteral(L, "cannot resume dead coroutine"); + lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); return -1; /* error flag */ } -@@ -528,13 +557,16 @@ - status = lua_resume(co, narg); - if (status == 0 || status == LUA_YIELD) { +@@ -530,11 +559,14 @@ int nres = lua_gettop(co); -- if (!lua_checkstack(L, nres)) -+ if (!lua_checkstack(L, nres+1)) + if (!lua_checkstack(L, nres + 1)) luaL_error(L, "too many results to resume"); + lua_pushboolean(L, 1); lua_xmove(co, L, nres); /* move yielded values */ @@ -689,7 +686,7 @@ /* move results to correct place */ for (i = wanted; i != 0 && firstResult < L->top; i--) setobjs2s(L, res++, firstResult++); -@@ -366,41 +473,51 @@ +@@ -366,42 +473,51 @@ ** When returns, all the results are on the stack, starting at the original ** function position. */ @@ -727,6 +724,7 @@ - return; - } - else { /* resuming from previous yield */ +- lua_assert(L->status == LUA_YIELD); - if (!f_isLua(ci)) { /* `common' yield? */ - /* finish interrupted execution of `OP_CALL' */ - lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || @@ -767,7 +765,7 @@ } -@@ -415,67 +532,61 @@ +@@ -415,69 +532,61 @@ LUA_API int lua_resume (lua_State *L, int nargs) { @@ -816,8 +814,10 @@ - luaD_seterrorobj(L, status, L->top); - L->ci->top = L->top; - } -- else +- else { +- lua_assert(L->nCcalls == L->baseCcalls); - status = L->status; +- } + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; + L->status = status; lua_unlock(L); @@ -1010,7 +1010,7 @@ } -@@ -89,15 +91,13 @@ +@@ -89,15 +91,14 @@ L->hook = NULL; L->hookmask = 0; L->basehookcount = 0; @@ -1018,7 +1018,8 @@ resethookcount(L); L->openupval = NULL; L->size_ci = 0; -- L->nCcalls = 0; +- L->nCcalls = L->baseCcalls = 0; ++ L->baseCcalls = 0; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; L->status = 0; L->base_ci = L->ci = NULL; @@ -1049,7 +1050,7 @@ L->ci = L->base_ci; + L->ci->errfunc = 0; /* no error function during GC metamethods */ L->base = L->top = L->ci->base; - L->nCcalls = 0; + L->nCcalls = L->baseCcalls = 0; } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); diff -ruN lua-5.1.4/src/lstate.h lua-5.1.4.new/src/lstate.h --- lua-5.1.4/src/lstate.h 2009-09-08 05:41:29.245553574 -0400 @@ -1070,7 +1071,7 @@ } CallInfo; -@@ -100,21 +102,19 @@ +@@ -100,22 +102,20 @@ struct lua_State { CommonHeader; lu_byte status; @@ -1089,10 +1090,11 @@ - int stacksize; int size_ci; /* size of array `base_ci' */ - unsigned short nCcalls; /* number of nested C calls */ ++ unsigned short nCcalls; /* number of nested C calls + callflags */ + unsigned short baseCcalls; /* nested C calls when resuming coroutine */ - lu_byte hookmask; - lu_byte allowhook; - int basehookcount; -+ unsigned short nCcalls; /* number of nested C calls + callflags */ int hookcount; lua_Hook hook; TValue l_gt; /* table of globals */ @@ -1167,14 +1169,16 @@ diff -ruN lua-5.1.4/src/lua.h lua-5.1.4.new/src/lua.h --- lua-5.1.4/src/lua.h 2009-09-08 05:41:29.245553574 -0400 +++ lua-5.1.4.new/src/lua.h 2009-09-08 05:40:44.048922581 -0400 -@@ -16,7 +16,7 @@ +@@ -16,8 +16,8 @@ #include "luaconf.h" -#define LUA_VERSION "Lua 5.1" +-#define LUA_RELEASE "Lua 5.1.4" +#define LUA_VERSION "Lua 5.1+rvm" ++#define LUA_RELEASE "Lua 5.1.4+rvm" #define LUA_VERSION_NUM 501 - #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" + #define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" @@ -45,6 +45,7 @@ #define LUA_ERRSYNTAX 3 @@ -1271,7 +1275,7 @@ @@ -280,8 +281,11 @@ StkId top = L->base + last + 1; int n = 2; /* number of elements handled in this pass (at least 2) */ - if (!tostring(L, top-2) || !tostring(L, top-1)) { + if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { + setpvalue(L->top, (void *)(ptrdiff_t)(last - 1)); /* for luaV_resume */ + L->top++; if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) @@ -1289,7 +1293,7 @@ #define arith_op(op,tm) { \ -@@ -370,13 +374,14 @@ +@@ -370,14 +374,15 @@ @@ -1301,6 +1305,7 @@ const Instruction *pc; + int nexeccalls = 1; reentry: /* entry point */ + lua_assert(isLua(L->ci)); - pc = L->savedpc; + pc = GETPC(L); cl = &clvalue(L->ci->func)->l; --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lua5.1.4-rvm-unsure.patch" --- lua5.1-rvm.patch 2009-09-08 08:43:38.464950526 -0400 +++ lua5.1.4-rvm-unsure 2009-09-08 08:45:57.617817088 -0400 @@ -453,7 +453,7 @@ L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); -- L->nCcalls = 0; +- L->nCcalls = L->baseCcalls; - L->allowhook = 1; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; restore_stack_limit(L); @@ -718,13 +718,14 @@ -static void resume (lua_State *L, void *ud) { - StkId firstArg = cast(StkId, ud); - CallInfo *ci = L->ci; -- if (L->status != LUA_YIELD) { /* start coroutine */ +- if (L->status == 0) { /* start coroutine? */ - lua_assert(ci == L->base_ci && firstArg > L->base); - if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) - return; - } - else { /* resuming from previous yield */ - lua_assert(L->status == LUA_YIELD); +- L->status = 0; - if (!f_isLua(ci)) { /* `common' yield? */ - /* finish interrupted execution of `OP_CALL' */ - lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || @@ -750,7 +751,6 @@ - L->base = L->ci->base; + L->base = L->ci->base; /* restore invariant */ } -- L->status = 0; - luaV_execute(L, cast_int(L->ci - L->base_ci)); + return f_continue(L, (void *)(ptrdiff_t)0); /* resume remaining frames */ +} @@ -765,7 +765,7 @@ } -@@ -415,69 +532,61 @@ +@@ -415,69 +532,64 @@ LUA_API int lua_resume (lua_State *L, int nargs) { @@ -773,10 +773,7 @@ + void *ud; int status; lua_lock(L); -- if (L->status != LUA_YIELD) { -- if (L->status != 0) -- return resume_error(L, "cannot resume dead coroutine"); -- else if (L->ci != L->base_ci) +- if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) + switch (L->status) { + case LUA_YIELD: + pf = f_coresume; @@ -792,6 +789,9 @@ + default: + return resume_error(L, "cannot resume dead coroutine"); + } + if (L->nCcalls >= LUAI_MAXCCALLS) + return resume_error(L, "C stack overflow"); ++ L->baseCcalls = ++L->nCcalls; + lua_assert(cast(StkId, ud) >= L->base); + for (;;) { + L->nCcalls = 0; @@ -805,9 +805,10 @@ + } + pf = f_continue; + ud = (void *)(ptrdiff_t)0; /* (void *)saveci(L, L->base_ci); */ - } ++ } - luai_userstateresume(L, nargs); -- lua_assert(L->errfunc == 0 && L->nCcalls == 0); +- lua_assert(L->errfunc == 0); +- L->baseCcalls = ++L->nCcalls; - status = luaD_rawrunprotected(L, resume, L->top - nargs); - if (status != 0) { /* error? */ - L->status = cast_byte(status); /* mark thread as `dead' */ @@ -818,6 +819,7 @@ - lua_assert(L->nCcalls == L->baseCcalls); - status = L->status; - } +- --L->nCcalls; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; + L->status = status; lua_unlock(L); @@ -829,7 +831,7 @@ - luai_userstateyield(L, nresults); +LUA_API int lua_vyield (lua_State *L, int nresults, void *ctx) { lua_lock(L); -- if (L->nCcalls > 0) +- if (L->nCcalls > L->baseCcalls) - luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); - L->base = L->top - nresults; /* protect stack slots below */ - L->status = LUA_YIELD; @@ -1243,9 +1245,9 @@ - L->savedpc = pc; + const Instruction *oldpc = GETPC(L); + SAVEPC(L, pc); - if (mask > LUA_MASKLINE) { /* instruction-hook set? */ - if (L->hookcount == 0) { - resethookcount(L); + if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { + resethookcount(L); + luaD_callhook(L, LUA_HOOKCOUNT, -1); @@ -74,6 +74,7 @@ if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) luaD_callhook(L, LUA_HOOKLINE, newline); @@ -1281,9 +1283,9 @@ if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) luaG_concaterror(L, top-2, top-1); + L->top--; - } else if (tsvalue(top-1)->len > 0) { /* if len=0, do nothing */ - /* at least two string values; get as many as possible */ - size_t tl = tsvalue(top-1)->len; + } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ + (void)tostring(L, top - 2); /* result is first op (as string) */ + else { @@ -354,7 +358,7 @@ #define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} --+QahgC5+KEYLbs62-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 10:13:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88DDkQI007509; Tue, 8 Sep 2009 10:13:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B759719386; Tue, 8 Sep 2009 10:13:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og108.obsmtp.com (exprod7og108.obsmtp.com [64.18.2.169]) by bazar2.conectiva.com.br (Postfix) with SMTP id E73231937C for ; Tue, 8 Sep 2009 10:13:18 -0300 (BRT) Received: from source ([209.85.218.228]) by exprod7ob108.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZYbJwNEVLTNarSMo1IXp3i3xQI59MN@postini.com; Tue, 08 Sep 2009 06:13:19 PDT Received: by mail-bw0-f228.google.com with SMTP id 28so2631620bwz.6 for ; Tue, 08 Sep 2009 06:13:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.54.152 with SMTP id q24mr5745959fag.19.1252415596132; Tue, 08 Sep 2009 06:13:16 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Sep 2009 14:13:16 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/8 George Petsagourakis : > Reuben Thomas sc3d.org> writes: >> While I'm sure you're not a troll, this kind of lazy un-thought-out >> writing is little better than trolling. I'm not sure how the above leads to the following. > I'll show up in the list at some other point in time, > since at the present I am being perceived as a troll > and this is really not my intention. > I am trying to indicate a possible reality > issue that people on Windows (installed on something around the 90% > of machines world-wide) are facing as far as Lua's usability is > concerned, This is an issue of which everyone was already well aware, and which no contributor to this thread has disputed. > don't turn it to flaming, I have already mentioned that > it was not in my intentions. No-one's flaming. I was trying to explain in what ways your original post was confused and unhelpful, and to lay out the real problems we face, to which I should add the perceptions that lead to posts like yours. Indeed, perhaps the most valuable lesson one can learn from it is that marketing counts, and that the Lua community, if it wants Lua to become more popular (and that is not a given) may need to work on the language's image as much as anything else. Alternatively, one can take the view that it's no big deal, and that image always tends to lag reality in any case (something that seems to be true even of the most widely-used and well-known languages and systems). > Taking up Lua _is_ by far easier than taking up C. Full stop. Of course (again, I didn't say anything to the contrary). -- http://rrt.sc3d.org Matthew 5:37: tri-state logic considered harmful From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 10:16:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88DG9mQ008067; Tue, 8 Sep 2009 10:16:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E75F81939A; Tue, 8 Sep 2009 10:15:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og117.obsmtp.com (exprod7og117.obsmtp.com [64.18.2.6]) by bazar2.conectiva.com.br (Postfix) with SMTP id A207119389 for ; Tue, 8 Sep 2009 10:15:43 -0300 (BRT) Received: from source ([209.85.220.208]) by exprod7ob117.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZY/cQyqx++ybTyY2piB7TewSoQTCsu@postini.com; Tue, 08 Sep 2009 06:15:44 PDT Received: by fxm4 with SMTP id 4so2584237fxm.16 for ; Tue, 08 Sep 2009 06:15:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.75.133 with SMTP id y5mr5883212faj.92.1252415740384; Tue, 08 Sep 2009 06:15:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Sep 2009 14:15:40 +0100 Message-ID: Subject: Re: curses From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88DG9mQ008067 2009/9/8 Juris Kalnins : > On Tue, 08 Sep 2009 14:27:40 +0300, Reuben Thomas wrote: > >> Thanks, but with curses I can spend my time writing the application >> rather than the terminal interaction. As far as I'm concerned, this is >> already a solved problem. (Plus the fact that ncurses's maintainer is >> responsive helps.) >> > > If that is the case, then by al means ignore my mail. Not having to deal > with > things like broken MacOS X Terminal.app scroll regions or windows telnet > antics or rxvt function keys or nonstadard linux terminal escape sequence > encoding etc. etc. + having it all to actually work is a big win. > > On the other hand - printing raw escape sequences is fun. I agree it can be fun, but for those of us who don't find it so, it's surely better to contribute to cross-platform libraries that hide the gory details than to code terminal support into individual apps. (As you can see, my preference is to improve ncurses, but I understand that some people consider curses an abomination and there's certainly room for alternative APIs.) -- http://rrt.sc3d.org Too late: it’s like sticking plasters on a coffin From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 10:36:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Daacu013183; Tue, 8 Sep 2009 10:36:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81681193A5; Tue, 8 Sep 2009 10:36:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71C6A1936B for ; Tue, 8 Sep 2009 10:35:54 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Ml0rN-0000PJ-Qz for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 14:35:49 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id EA27D50061 for ; Tue, 8 Sep 2009 14:35:46 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:44306 with envelope Message-ID: <4AA65DA4.2090109@cowlark.com> Date: Tue, 08 Sep 2009 14:35:32 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88Daacu013183 Reuben Thomas wrote: [...] > Indeed, perhaps the most valuable lesson one can learn from it is that > marketing counts, and that the Lua community, if it wants Lua to > become more popular (and that is not a given) may need to work on the > language's image as much as anything else. Alternatively, one can take > the view that it's no big deal, and that image always tends to lag > reality in any case (something that seems to be true even of the most > widely-used and well-known languages and systems). I remember one rather interesting conversation here a while back; someone was asking about using Lua for some purpose... enterprise data processing, I think. I was rather struck by the difference in attitude between the people here and the kind of community you get in, say, Ruby or Python: Q. Why should I use [Language] for X? Python community: It's great that you're considering Python, because it's the best language for the job! Python is really good at doing A, B and C, and if you were to change your architecture you could do D, E and F as well! Lua community: I don't know. Why *should* you use Lua? I think most people here see Lua as a component, intended to be customised and bolted into another product, rather than being used on its own. I write Lua scripts for doing quick hacks --- but they nearly always get a customised interpreter if they ever turn into anything more than a quick hack. Here's some rather interesting statistics from the Debian Popularity Contest: http://qa.debian.org/popcon.php?package=lua5.1 35% of (participating) users have liblua5.1 installed (the shared library). 1% have lua5.1 installed (the command line interpreter). If you compare to ruby, 34% have ruby1.8 installed while 27% have libruby1.8 --- most ruby users use the interpreter. And if you check Python, most versions don't even *have* a separate library package! (Also, check out that growth curve for liblua5.1...) I think what I'm trying to say is that Lua users are weird and don't necessarily fall into the same demographic as with other scripting languages. I could be wrong, though --- I know *I'm* weird... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 10:46:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88DkZXD016261; Tue, 8 Sep 2009 10:46:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B1A319388; Tue, 8 Sep 2009 10:46:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8BB2E19375 for ; Tue, 8 Sep 2009 10:46:05 -0300 (BRT) Received: from source ([209.85.218.215]) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZgHKvff6vIBwYdWCzCiLiliwAS/Ngz@postini.com; Tue, 08 Sep 2009 06:46:05 PDT Received: by bwz11 with SMTP id 11so1912418bwz.39 for ; Tue, 08 Sep 2009 06:46:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.4.149 with SMTP id 21mr5836856far.28.1252417560968; Tue, 08 Sep 2009 06:46:00 -0700 (PDT) In-Reply-To: <4AA65DA4.2090109@cowlark.com> References: <4AA65DA4.2090109@cowlark.com> Date: Tue, 8 Sep 2009 14:46:00 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88DkZXD016261 2009/9/8 David Given : > Lua community: I don't know. Why *should* you use Lua? The Lua maintainers, at least, are both reticent and cautious, compared to other language maintainers. > I think most people here see Lua as a component, intended to be customised > and bolted into another product, rather than being used on its own. I write > Lua scripts for doing quick hacks --- but they nearly always get a > customised interpreter if they ever turn into anything more than a quick > hack. I agree: I used to use Lua for general-purpose scripting, but found that its lack of libraries, whether built-in or available in language or OS distributions, was too much of a headache. I use it now precisely where its small size and lack of dependencies make it easy to integrate. -- http://rrt.sc3d.org Il ne vaut pas la peine de peigner l’eau From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 11:03:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88E3hU1020793; Tue, 8 Sep 2009 11:03:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05D26193CF; Tue, 8 Sep 2009 11:03:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 984D5193AE for ; Tue, 8 Sep 2009 11:03:10 -0300 (BRT) Received: by bwz10 with SMTP id 10so1720780bwz.5 for ; Tue, 08 Sep 2009 07:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=zRtvoguvJ/rYQ6PJMRuXgBMtUOBoNZ5N2mRVw4E5494=; b=cgpnM5JqexTgHC0HsJBG0LpL3tpWX3FsFfG0oL1qcQ/EChlexX33tuj3KbVXJMy57c Nv0kkusn0CkHmmfyyIURNUbDNY1Ruh7BHZYhix+ugRxRg0FklZridwymea/buI4MH+RN JxA/oi0pqSl8xE9Yx4B1zmjf4qC0+kps4L5iU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QTw9y2hiDiOs4P0XSr+mdp6T4X4MYflgjiyorlw09UP9k3FHoOoXMJFsRXygtRJjDG cEyJq0no7me++YgOOI6qYzEcdK6EGudSPd+uer3tuMC1HsLJDwB8L3z7JxslFsOn8cUR Vd+3P+rRyYB5om4bJZ2Kb+Av3cGVV15YNgROs= MIME-Version: 1.0 Received: by 10.204.2.205 with SMTP id 13mr13118152bkk.205.1252418589262; Tue, 08 Sep 2009 07:03:09 -0700 (PDT) In-Reply-To: <4AA65DA4.2090109@cowlark.com> References: <4AA65DA4.2090109@cowlark.com> Date: Tue, 8 Sep 2009 16:03:09 +0200 Message-ID: <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 8, 2009 at 3:35 PM, David Given wrote: > I remember one rather interesting conversation here a while back; someone > was asking about using Lua for some purpose... enterprise data processing, I > think. I was rather struck by the difference in attitude between the people > here and the kind of community you get in, say, Ruby or Python: Well, I think we've experienced two users with very different laments, Andre de Leiradella talking about the good old days when you could 'just' knock some C together with Lua and have an app, and George talking about the difficulties of doing Lua without having to do C. Both were not very coherent complaints, but that is the nature of a lament, and attacking incoherence does not advance the cause. OK, so what is the cause? Most of us are embedded Lua people, and have forgotten our frustrations with command-line tools, forgiven C, and often content to use 30-year old technology (e.g emacs/vi, make). >From that perspective, not wanting to go that path seems like a sign of not being serious. Then there are people who are attracted to a fast, sane little programming language and want to use it in wider applications, maybe even as an application library. I'm in both camps, I like Lua because it reduces the amount of C++ I need write; the headaches I get with C++ are not related to my skill level, just a recognition that most C++ is probably premature optimization in the Knuth sense. There are initiatives to make Lua a better all-purpose scripting language, and mostly these don't worry the embedders, unless like Andre they think it is complicating that simple idylic C + Lua life. So maybe when a scripter complains, then the embedders should remember their own frustrations, just a little? Otherwise, we do come across as elitist and snotty, and that does us no favours in the long term. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 11:06:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88E6MTD021295; Tue, 8 Sep 2009 11:06:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8AC6193DE; Tue, 8 Sep 2009 11:05:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82F54193D7 for ; Tue, 8 Sep 2009 11:05:54 -0300 (BRT) Received: by pzk29 with SMTP id 29so179433pzk.14 for ; Tue, 08 Sep 2009 07:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=EP2NXZYzF+kP0Kli47LCXel6EANvWTQSnvLPxvI9h+g=; b=tccJ9kyOeolHYjXgp46KwzK/TRL0YxUz1t/jTFbtSdF11UcmO72/ko5Ap0P5gxgGgx VY/K9h7UFWAU092PojW1+8Vv14giZHr1WaYF6ein61bdldGE98hraZHwu8UhyN4sN22B 8qAmTzjIbr2qDwkst87ZGqvPQdSypD4qKNndM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=YDDKf3fIb5da+Vivv30P9FfNBa2zN3pr4yJQBHQxN5Z4H+ROJKMFZoEN1HeWuwIdCV IjeM1mVP/Ye+jqbyLwoDAkf3Z27qjSAeAFXhj8bcCH8rmdk72UC4lOM01Ps6Sv/FXSpg SXHR3UvrL2sCSZhfHTBMeHu6msv2oLQeBqYHg= Received: by 10.140.161.18 with SMTP id j18mr3474467rve.71.1252418750825; Tue, 08 Sep 2009 07:05:50 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 20sm554756pzk.9.2009.09.08.07.05.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 07:05:50 -0700 (PDT) Message-ID: <4AA664B8.8000908@gmail.com> Date: Tue, 08 Sep 2009 22:05:44 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Reuben Thomas wrote: > 2009/9/8 George Petsagourakis : >> Reuben Thomas sc3d.org> writes: >>> [snip] >> don't turn it to flaming, I have already mentioned that >> it was not in my intentions. > > No-one's flaming. I was trying to explain in what ways your original > post was confused and unhelpful, and to lay out the real problems we > face, to which I should add the perceptions that lead to posts like > yours. Can we shut this part of the thread down for now? It's not really going anywhere useful now. If anyone wants to discuss further, let's start afresh with a new thread and a clean slate. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 11:14:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88EEBg1022968; Tue, 8 Sep 2009 11:14:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08507192D9; Tue, 8 Sep 2009 11:13:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jenni1.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B2B1190F9 for ; Tue, 8 Sep 2009 11:13:37 -0300 (BRT) Received: from [93.106.142.202] (93.106.142.202) by jenni1.inet.fi (8.5.014) id 4A776AE6013E344E for lua@bazar2.conectiva.com.br; Tue, 8 Sep 2009 17:13:35 +0300 Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: The source file culture Date: Tue, 8 Sep 2009 17:12:19 +0300 References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean LuaRocks should really have taken care of this by now. Has it not? Would adding something like Hamster to do the builds help? In other words, does LR allow defining build rules in a platform independent way? I thought it does. - asko On 8.9.2009, at 17.03, steve donovan wrote: > On Tue, Sep 8, 2009 at 3:35 PM, David Given wrote: >> I remember one rather interesting conversation here a while back; >> someone >> was asking about using Lua for some purpose... enterprise data >> processing, I >> think. I was rather struck by the difference in attitude between >> the people >> here and the kind of community you get in, say, Ruby or Python: > > Well, I think we've experienced two users with very different laments, > Andre de Leiradella talking about the good old days when you could > 'just' knock some C together with Lua and have an app, and George > talking about the difficulties of doing Lua without having to do C. > Both were not very coherent complaints, but that is the nature of a > lament, and attacking incoherence does not advance the cause. > > OK, so what is the cause? Most of us are embedded Lua people, and > have forgotten our frustrations with command-line tools, forgiven C, > and often content to use 30-year old technology (e.g emacs/vi, make). >> From that perspective, not wanting to go that path seems like a sign > of not being serious. Then there are people who are attracted to a > fast, sane little programming language and want to use it in wider > applications, maybe even as an application library. I'm in both > camps, I like Lua because it reduces the amount of C++ I need write; > the headaches I get with C++ are not related to my skill level, just a > recognition that most C++ is probably premature optimization in the > Knuth sense. > > There are initiatives to make Lua a better all-purpose scripting > language, and mostly these don't worry the embedders, unless like > Andre they think it is complicating that simple idylic C + Lua life. > So maybe when a scripter complains, then the embedders should remember > their own frustrations, just a little? > > Otherwise, we do come across as elitist and snotty, and that does us > no favours in the long term. > > steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 11:31:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88EVr1o027416; Tue, 8 Sep 2009 11:31:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC94D19155; Tue, 8 Sep 2009 11:31:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f200.google.com (mail-yw0-f200.google.com [209.85.211.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B85B19109 for ; Tue, 8 Sep 2009 11:31:22 -0300 (BRT) Received: by ywh38 with SMTP id 38so4605010ywh.16 for ; Tue, 08 Sep 2009 07:31:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.102.6 with SMTP id e6mr12029940agm.99.1252420279676; Tue, 08 Sep 2009 07:31:19 -0700 (PDT) In-Reply-To: <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> References: <4AA540CA.2080004@cowlark.com> <560972290909080000l693a9a5cufc3357f349da997c@mail.gmail.com> <4AA60D5E.9090304@wp.pl> <560972290909080123h577ca8bcu5e9c5beba3410074@mail.gmail.com> Date: Tue, 8 Sep 2009 17:31:19 +0300 X-Google-Sender-Auth: 808c7be968b91f1c Message-ID: Subject: Re: The source file culture From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > [...] So the real > challenge is to make something like LuaRocks understand how to get and > install those external dependencies. [...] and you can see that the module author > (or maintainer) has to be an unusually dedicated person! However, there's really no other way. The infrastructure people (LuaRocks authors, Lua authors, etc.) are the only ones who can make auto-building happen. Shifting this responsibility to other developer groups won't make it happen because of the simple fact that - in this free market as it is - they pursue different objectives - they represent different groups of interests that are only _marginally_ intersecting. Those developer groups are 1a) application developers/standalone, 1b) application developers/embedded, 2) library developers, 3) Lua language and platform developers. With this perspective in mind, it's easy to observe why people in different groups whine about what they perceive as being someone else's responsibility. They are all right of course. Standalone app developersare right that compilation and C knowledge is not their primary goal and should not be inflicted upon them -- be they afraid, lazy or unknowlegeable -- it simply doesn't serve their best interest to build modules by hand, so it's futile to continue calling them names. They will simply move away to other more integrated platforms. Not sure why embedded devs complain about the module system and distribution of binaries -these things weren't made for them in the first place :) API developers are right that (the portability part of) building process is not their primary goal and should not be inflicted upon them -- bad Makefiles reflect that very clearly (they also reflect that Make doesn't by itself provide any facilities to help with the portability goal, unlike LuaRocks or autotools). They are happy if an automated build system helps the widespread of their libraries, but they won't produce one unless the effort pays off in _their_ currency (that is, adoption of their libraries). I think it's what made LuaRocks possible. Finally, the language/platform people are like the government, they provide the infrastructure for all other to do their business, except they are not _invested_ by other people to do so, they don't tax other people and don't produce inflation :) They have their own reasons for doing what they do as does everyone else in the ecosystem. But however those are, the pressure to make an appealing app. platform out of Lua is on them and there's little that the other groups can do about that. Some people from other groups might jump in and help, but again, only if the effort pays off in _their_ own currency. Good or bad as it is, it's a fact of the market. Just another point and and then I kick myself out of this long rant. It's about the binaries vs sources issue. Windows app devs don't have anything against sources _because_ of cultural reasons, it's the other way around. As long as the build process is fully automated and _works_, they wouldn't care less how the modules are installed and found at runtime. my2c. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:00:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Exu8W001805; Tue, 8 Sep 2009 11:59:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6D97193A0; Tue, 8 Sep 2009 11:59:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F03C419395 for ; Tue, 8 Sep 2009 11:59:24 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88ExNI5001708 for ; Tue, 8 Sep 2009 11:59:23 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n88ExMf29828; Tue, 8 Sep 2009 11:59:22 -0300 Date: Tue, 8 Sep 2009 11:59:22 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: The source file culture Message-ID: <20090908115922.B29733@lua.tecgraf.puc-rio.br> References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com>; from steve.j.donovan@gmail.com on Tue, Sep 08, 2009 at 04:03:09PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I like Lua because it reduces the amount of C++ I need write; That's most probably the case when Lua can replace C++ object hierarquies or just plain glue application code (ie, the calling of libraries). For any tasks that need performance you still need enough C or C++ libraries that you can bind to Lua. This is also true for many tasks for which there are mature C libraries, even if you don't need raw performance -- you just don't want to reinvent the wheel in pure Lua just to have less C in your app. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:11:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88FBSvM004838; Tue, 8 Sep 2009 12:11:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F8A919330; Tue, 8 Sep 2009 12:11:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f197.google.com (mail-px0-f197.google.com [209.85.216.197]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B7B8192E4 for ; Tue, 8 Sep 2009 12:10:55 -0300 (BRT) Received: by pxi35 with SMTP id 35so67048pxi.10 for ; Tue, 08 Sep 2009 08:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=lmgs/gcqZ+z3dPrBtnbxHT6PoEjFdS9JFKH2vyF/JzE=; b=uC/9saOxGxBi2Vj6n5OxHqvogFnnA7EzgnrYXt8Yh1RCoyJa9aoxCu0JUCZdWHyG4j lfb8z6Sg1EpD+nOpbQdHR4RPF2+2wZl0OZLXxnnK+DP3sui9YK35yP9BswHlYDSaP+F9 6HHgRtMtn+0CQ2ZpUfIsYtVlitg1miil4qupI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=dqGFRHO+I5qQrzGKHBxquJrqRoIAedaWYofcF1N6AHHvHupTN6zUT/Z35wmYjf1mgb dcn0QaOq70nPDq+odrD/Mitk3m6Q8F0RCYHmsvNQChjWv6yRlAweGU2a5sjoXfb+Ie71 2ckwOaN1Hnmwhzb85+U1vTpbXQz3pu+iCzYBY= MIME-Version: 1.0 Received: by 10.142.249.37 with SMTP id w37mr633253wfh.271.1252422653090; Tue, 08 Sep 2009 08:10:53 -0700 (PDT) From: Anurag Sharma Date: Tue, 8 Sep 2009 20:40:33 +0530 Message-ID: Subject: How to Load extended Lua Library at the launch of Lua Console To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636ed6834589ac10473125f5f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed6834589ac10473125f5f Content-Type: text/plain; charset=ISO-8859-1 Hi I am writing an application that will support Lua scripting. In addition, I am also writing some Lua extensions which will compile into a myApp_Lua.dll On the installation of my application, this dll will be copied in this location C:/program files/my app/myApp_Lua.dll I want to launch Lua console with "myApp_Lua.dll" loaded. How can I do so? Just to clarify the question I am providing an analogy with Perl where I have to run the following at Start->"Run" to launch perl console with myApp_Perl.dll loaded cmd.exe /K perl5.10.0.exe myApp_Perl.dll Thanks Anurag Sharma --001636ed6834589ac10473125f5f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi
I am writing an application that will support Lua<= /span> scripting. In addition, I am also writing some Lu= a extensions which will compile into a myApp_Lua.dll

On the = installation of my application, this dll will be copied in this location C:= /program files/my app/myApp_Lua.dll

I want to launch Lua console with "myApp_Lua.dll" loaded. How= can I do so?

Just to clarify the question I am providing an analogy= with Perl where I have to run the following at Start->"Run"= =A0 to launch perl console with myApp_Perl.dll loaded

cmd.exe /K perl5.10.0.exe=A0 myApp_Perl.dll



Thanks
Anurag Sharma --001636ed6834589ac10473125f5f-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:12:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88FCDq9004991; Tue, 8 Sep 2009 12:12:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5FA0193C7; Tue, 8 Sep 2009 12:11:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og122.obsmtp.com (exprod7og122.obsmtp.com [64.18.2.22]) by bazar2.conectiva.com.br (Postfix) with SMTP id C9E0C192E4 for ; Tue, 8 Sep 2009 12:11:41 -0300 (BRT) Received: from source ([209.85.218.218]) by exprod7ob122.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZ0KyDuCBTefvi71UMWCdf5HFLhyR1T@postini.com; Tue, 08 Sep 2009 08:11:42 PDT Received: by mail-bw0-f218.google.com with SMTP id 18so3066714bwz.7 for ; Tue, 08 Sep 2009 08:11:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.79 with SMTP id t15mr5882230fau.13.1252422698977; Tue, 08 Sep 2009 08:11:38 -0700 (PDT) In-Reply-To: <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> Date: Tue, 8 Sep 2009 16:11:38 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n88FCDq9004991 2009/9/8 steve donovan : > Both were not very coherent complaints, but that is the nature of a > lament No! Laments can be coherent and precise, and certainly should be in a forum such as this. That was my principle criticism; I have nothing against well-thought-out laments and complaints. > Most of us are embedded Lua people, and > have forgotten our frustrations with command-line tools, forgiven C, > and often content to use 30-year old technology (e.g emacs/vi, make). > From that perspective, not wanting to go that path seems like a sign > of not being serious.  Then there are people who are attracted to a > fast, sane little programming language and want to use it in wider > applications, maybe even as an application library.  I'm in both > camps, I like Lua because it reduces the amount of C++ I need write; > the headaches I get with C++ are not related to my skill level, just a > recognition that most C++ is probably premature optimization in the > Knuth sense. This looks like stereotyping to me. "Command-line tools, C, emacs and make" have all evolved considerably in the last 30 years; equally, there are other development environment styles which have come along in that time. Using Visual Studio isn't "not being serious" any more than using GNU is being stuck in the stone age. Worse, this sort of dichotomy implies an unavoidable trade-off. > There are initiatives to make Lua a better all-purpose scripting > language, and mostly these don't worry the embedders, unless like > Andre they think it is complicating that simple idylic C + Lua life. This is more like it: it's only when one use is advanced at the expense of another that there's a problem. What we need more of is the sort of ingenuity that gets around these problems; far more often than one might imagine, it's possible. The way that Emacs wraps batch tools for interactive use, and the way that Visual Studio now exposes its internals programmably are two obvious examples, as, more generally, is the way that Mac OS X allows a far wider range of interactions (both at the user and the API levels) than its predecessors. > So maybe when a scripter complains, then the embedders should remember > their own frustrations, just a little? (I'm still a bit of both, as although I don't use Lua for writing new scripts much, I still maintain old ones, and use it in certain situations, like build systems for programs in which I already embed Lua.) > Otherwise, we do come across as elitist and snotty, and that does us > no favours in the long term. I'm not sure where the impression of elitism (which is to say, exclusivity) is coming from. I've not seen anyone, at least in this thread, who wouldn't like Lua to be easier to use for everyone. Having fallen into the heffalump trap next to which I was trying to erect a "BEWARE OF THE HEFFALUMP TRAP" sign, I shall now find something more worthwhile to do. -- http://rrt.sc3d.org L’art des vers est de transformer en beautés les faiblesses (Aragon) From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:16:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88FGAW4006183; Tue, 8 Sep 2009 12:16:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 231DA193E4; Tue, 8 Sep 2009 12:15:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C24A4193C2 for ; Tue, 8 Sep 2009 12:15:38 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Ml2Pn-0004vx-SR for ; Tue, 08 Sep 2009 16:15:27 +0100 Received: from petitemort.i.flarn.net ([10.19.3.101] helo=petitemort) by master with esmtp (Exim 4.69) (envelope-from ) id 1Ml2Pr-00028d-Vw for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 16:15:32 +0100 Received: from dsilvers by petitemort with local (Exim 4.69) (envelope-from ) id 1Ml2Pr-0000YQ-T6 for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 16:15:31 +0100 Date: Tue, 8 Sep 2009 16:15:31 +0100 From: Daniel Silverstone To: Lua list Subject: Re: The source file culture Message-ID: <20090908151531.GB25716@digital-scurf.org> References: <4AA65DA4.2090109@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA65DA4.2090109@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 08, 2009 at 02:35:32PM +0100, David Given wrote: > 35% of (participating) users have liblua5.1 installed (the shared > library). 1% have lua5.1 installed (the command line interpreter). ion3, wireshark, vlc-nox. Those are three things which use Lua in library form which may contribute towards it. It seems ion3 is fairly negligible, but 20% of popcon users have vlc-nox installed, and about 12% have wireshark-common. While there will be some overlap, I imagine that counts for the vast majority of the installed userbase. I have repeatedly told Debian and other free-software developers to "Just add Lua" when asked "How do I make this more easily configured / customised" so it's nice to see that some of them are taking note of the evangelism from the Lua community. D. -- Daniel Silverstone http://www.digital-scurf.org/ PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69 From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:44:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Finqm011758; Tue, 8 Sep 2009 12:44:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C3A419370; Tue, 8 Sep 2009 12:44:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3BCF192FD for ; Tue, 8 Sep 2009 12:44:10 -0300 (BRT) Received: by pzk29 with SMTP id 29so248453pzk.14 for ; Tue, 08 Sep 2009 08:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=8PTNcKKqjGDHKHx0CrKKSGqZUaVkfDrouEHSt0DoxSU=; b=bdEQ/au6LGk9Jd7VdcZtdnF5KNOWLbLiQLawfWb6mv2NhE6MQZtlZ+0Ny2DyIQmXkc 2lFind+nJz4GaBcOlXSPu0hLi3Ki3aXaPJdFvKGtTzJp1rDz4vYeaMd6/RS3Ihn8sjRg HfmaTtP5JrQKC5K7dRpd2DTM3HdCbMxA0AHro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=ZN3kEkNktG7BRGpvAjtqD7FePpEBsL4GuxwsAMukLBLXnQ15Y/9DtP9XYx0QGQ52qa CHoKfJgI4EpIXFGkZ16XhBSxit9wq8Uk8U6dJQqtVh7c+V+Jl/6nqghD1+qlpQOwSHHK kdOVYt9t2/l0qYWAVqG2jzlmTfLIAdtzhocDM= Received: by 10.115.66.28 with SMTP id t28mr17874339wak.177.1252424649398; Tue, 08 Sep 2009 08:44:09 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 20sm603718pzk.1.2009.09.08.08.44.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 08:44:07 -0700 (PDT) Message-ID: <4AA67BC1.4050607@gmail.com> Date: Tue, 08 Sep 2009 23:44:01 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Reuben Thomas wrote: > 2009/9/8 steve donovan : >> Both were not very coherent complaints, but that is the nature of a >> lament > > No! Laments can be coherent and precise, and certainly should be in a > forum such as this. That was my principle criticism; I have nothing > against well-thought-out laments and complaints. Okay, I'm breaking my own suggestion... principle -> principal, some precision missing there... ;-) Let's be a bit more tolerant in a diverse community. Remember, it's a bell curve. Other people do not always operate at your level, and this kind of communication medium is notorious for misunderstandings, etc. You said "marketing counts", but you're not helping here... We're not all IT professionals here; 'we' could be high school students, etc. Please be a bit more patient with the slow people like us, you know... :-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 12:50:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88For7T013038; Tue, 8 Sep 2009 12:50:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BBED193D3; Tue, 8 Sep 2009 12:50:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6EF719326 for ; Tue, 8 Sep 2009 12:50:24 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Ml2xS-00028h-4N for ; Tue, 08 Sep 2009 16:50:14 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Ml2xb-0003Yt-4c for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 16:50:23 +0100 Date: Tue, 8 Sep 2009 16:50:22 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: How to Load extended Lua Library at the launch of Lua Console Message-ID: <20090908165022.384634de@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 8 Sep 2009 20:40:33 +0530 Anurag Sharma wrote: > I want to launch Lua console with "myApp_Lua.dll" loaded. How can I > do so? Assuming it is a standard Lua module; rjek@trite:~$ lua -h usage: lua [options] [script [args]]. Available options are: -e stat execute string 'stat' -l name require library 'name' <-- this one -i enter interactive mode after executing 'script' -v show version information -- stop handling options - execute stdin and stop handling options rjek@trite:~$ lua -l socket Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio > =package.loaded.socket table: 0x20c9990 B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 13:01:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88G10T8015077; Tue, 8 Sep 2009 13:01:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC9C7193DC; Tue, 8 Sep 2009 13:00:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og123.obsmtp.com (exprod7og123.obsmtp.com [64.18.2.24]) by bazar2.conectiva.com.br (Postfix) with SMTP id DB412193C2 for ; Tue, 8 Sep 2009 13:00:29 -0300 (BRT) Received: from source ([209.85.218.212]) by exprod7ob123.postini.com ([64.18.6.12]) with SMTP ID DSNKSqZ/m5rnswHfjLBFJIjWDjkP+fMcLuUx@postini.com; Tue, 08 Sep 2009 09:00:30 PDT Received: by mail-bw0-f212.google.com with SMTP id 8so2775784bwz.28 for ; Tue, 08 Sep 2009 09:00:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.54.152 with SMTP id q24mr5872837fag.19.1252425626338; Tue, 08 Sep 2009 09:00:26 -0700 (PDT) In-Reply-To: <4AA67BC1.4050607@gmail.com> References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> <4AA67BC1.4050607@gmail.com> Date: Tue, 8 Sep 2009 17:00:26 +0100 Message-ID: Subject: Re: The source file culture From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tuesday, September 8, 2009, KHMan wrote: > principle -> principal, some precision missing there... ;-) D'oh. And I read the word twice as I typed it. > We're not all IT professionals here; e.g. me, I'm a church singer. -- http://rrt.sc3d.org From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 13:25:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88GPqVB019803; Tue, 8 Sep 2009 13:25:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F9D6193F9; Tue, 8 Sep 2009 13:25:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF8A119395 for ; Tue, 8 Sep 2009 13:25:14 -0300 (BRT) Received: by pzk29 with SMTP id 29so287503pzk.14 for ; Tue, 08 Sep 2009 09:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=JOHZtvKIRmpZX6Nng1Ic0xRgNbtpBjRn479p0xObDGE=; b=okUxkNlkVwlu6yiZdvb02vHSaUCwhvca35YdaxgfxVoXqcfWwGsg5UHY7cKL0zsluv W0t8oogBQBqeXPauJowioAgKBKjD4f9+eY1Ltt24Uao7wCWs6e5/B9OVQVwGlGVE61Dm zdpc5c41xLhUk1zq10tPZZk0GyGoxHE6zOlcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=V01uG/9+wvLAb+87bn6XDldr1PfR7e6kVvTzHONpNhNkCHlUKO9U7fH5z7nh8nNInj jxuoLYDRXwRxOEKFG3Yj1n2j1B3Jt3CFuR5HDDhc8szv2NtU5i1qPtK9OFYJh4kcHnsT VHwdstZ69jMM7ewZZ64iK1e3Z+l/TgyMNAjxM= Received: by 10.115.103.27 with SMTP id f27mr17973162wam.227.1252427111834; Tue, 08 Sep 2009 09:25:11 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.228.195]) by mx.google.com with ESMTPS id 21sm618594pzk.11.2009.09.08.09.25.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 09:25:11 -0700 (PDT) Message-ID: <4AA68561.6020305@gmail.com> Date: Wed, 09 Sep 2009 00:25:05 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The source file culture References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> <4AA67BC1.4050607@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Reuben Thomas wrote: > On Tuesday, September 8, 2009, KHMan wrote: >> principle -> principal, some precision missing there... ;-) > > D'oh. And I read the word twice as I typed it. > >> We're not all IT professionals here; > > e.g. me, I'm a church singer. Quite. Also, there are developers whose first language isn't English. If there is a possibility that there are high school students whose first language isn't English who want to ask questions in a forum like this, I say that we need to make allowances for that, focus on the positives, and facilitate the discussion. I will take leave of this thread now, been talking too much. :-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 13:32:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88GWraA021154; Tue, 8 Sep 2009 13:32:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52538193F3; Tue, 8 Sep 2009 13:32:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A16C7193E2 for ; Tue, 8 Sep 2009 13:32:23 -0300 (BRT) Received: by fxm18 with SMTP id 18so162479fxm.5 for ; Tue, 08 Sep 2009 09:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=atBYw/zmpMkA7NL39f5QgxXDY5CA2zmGaMYPtC71y2I=; b=pUxOE0y1KfxMesqTsBK9MNMqDHEmo37GjQXmSxUZpEZ0f9l/2Wm3LI9beZsHQr9hqd UBCsOPL43VPqEZZ94No0Rc8TqTSmadSr+49j6RcQd4JULzf530+TX8eu4Sh261BEyQBI wIFamvDmjDG4L/g65xMqVJxP2a3nsZp8b9bAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wT9K8JWk9a1lNNw7BBUwZotQZ3VdpfpfFibtzSuCMBISA4lcTO9NV+/2hLTVW52CGo 3LSIdBEhM0JM4lBEaFKuiMzW8vBuXoOfgHEwnSup2v0oO9dB5bdV5CfvOdyjaYyRLqKc sAUaRvynE4DtsQ7B/eVJiY3qjDmi0v7BU/cGY= MIME-Version: 1.0 Received: by 10.204.141.26 with SMTP id k26mr13409571bku.130.1252427535272; Tue, 08 Sep 2009 09:32:15 -0700 (PDT) In-Reply-To: <20090908115922.B29733@lua.tecgraf.puc-rio.br> References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> <20090908115922.B29733@lua.tecgraf.puc-rio.br> Date: Tue, 8 Sep 2009 18:32:15 +0200 Message-ID: <560972290909080932l1e092565qfd26b8e8b07cccb5@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 8, 2009 at 4:59 PM, Luiz Henrique de Figueiredo wrote: > For any tasks that need performance you still need enough C or C++ libraries > that you can bind to Lua. There's a sweet spot where the fast stuff is in C and the rest can be done in Lua without much change in overall performance. Where that point lies depends on the application, and ultimately is a semi-empirical engineering question. > This is also true for many tasks for which there > are mature C libraries, even if you don't need raw performance -- you just > don't want to reinvent the wheel in pure Lua just to have less C in your app. This is true; there is so much code to borrow or steal out there. An exception however is if the library suffers from bloat and excessive scope, in which case I'd write 100 lines of Lua any day ;) steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 14:00:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88H0rLE028013; Tue, 8 Sep 2009 14:00:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52D9D1929E; Tue, 8 Sep 2009 14:00:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 982EB19104 for ; Tue, 8 Sep 2009 14:00:14 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88H0B7p027787 for ; Tue, 8 Sep 2009 14:00:11 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n88H0BG30054; Tue, 8 Sep 2009 14:00:11 -0300 Date: Tue, 8 Sep 2009 14:00:11 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: How to Load extended Lua Library at the launch of Lua Console Message-ID: <20090908140010.C30026@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from anurag.sharma.101@gmail.com on Tue, Sep 08, 2009 at 08:40:33PM +0530 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On the installation of my application, this dll will be copied in this > location C:/program files/my app/myApp_Lua.dll > > I want to launch Lua console with "myApp_Lua.dll" loaded. How can I do so? > > Just to clarify the question I am providing an analogy with Perl where I > have to run the following at Start->"Run" to launch perl console with > myApp_Perl.dll loaded > > cmd.exe /K perl5.10.0.exe myApp_Perl.dll In an ideal world, with correct paths sets, this would be cmd.exe /K lua.exe -lmyApp_Lua However, "C:/program files/my app/myApp_Lua.dll" is probably not in the default LUA_CPATH and so you may need to adapt this to eg. cmd.exe /K lua.exe -e'LUA_CPATH="C:/program files/my app/?.dll;" -lmyApp_Lua From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 14:11:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88HBqNH030350; Tue, 8 Sep 2009 14:11:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6174219309; Tue, 8 Sep 2009 14:11:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2378192E3 for ; Tue, 8 Sep 2009 14:11:16 -0300 (BRT) Received: by fxm18 with SMTP id 18so195567fxm.5 for ; Tue, 08 Sep 2009 10:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fGRAIfsixdO0CVtDmK8MbAeDrZwjk4msh/nonColm5Q=; b=PlUwRgnBGX0bQdhYpUV2AsVvTVlDM0Ta4Pbtc0+JYEmz6T5avxL+JUSCQUWao6wzFZ cEzLFlKK5BjRHH9qZH9BHMq1igQbo/i4e1ORBcE5ESFjW7b8G4CPiPrAu90/Yay9ETny YZC+onHzZNTYI4a4OniQDQPXR51yyBw7SbRrU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GJHsFEidV2SNa6JyqiR/7WTpkLqT/7x1j/eDvMCLSplfM+CMTKQpg9Qm0noVuTMDJc z/IFYnXJGGoQxzr6pBM/1GY4rIVME1qOa3GFmqYo+ZnwS+p8XodGhsOn72QokFqF78uw VOV1YIsfLgol9gNXkfCICC5YN296XnxYglpyw= MIME-Version: 1.0 Received: by 10.204.154.203 with SMTP id p11mr13476701bkw.180.1252429875325; Tue, 08 Sep 2009 10:11:15 -0700 (PDT) In-Reply-To: References: <4AA65DA4.2090109@cowlark.com> <560972290909080703i535eb580y895a07cce187764a@mail.gmail.com> Date: Tue, 8 Sep 2009 19:11:15 +0200 Message-ID: <560972290909081011n3d87aad4s13f1d6c7f24d88e2@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 8, 2009 at 5:11 PM, Reuben Thomas wrote: > This looks like stereotyping to me. "Command-line tools, C, emacs and > make" have all evolved considerably in the last 30 years; equally, > there are other development environment styles which have come along > in that time. Yeah, sorry, that was a cheap shot. After all, I was trying to make a plea for tolerance ;) steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 14:52:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88HqIYP009598; Tue, 8 Sep 2009 14:52:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CF3419292; Tue, 8 Sep 2009 14:51:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout016.mac.com (asmtpout016.mac.com [17.148.16.91]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5DC3191EE for ; Tue, 8 Sep 2009 14:51:37 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([85.4.4.213]) by asmtp016.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KPN00AKXYXPF870@asmtp016.mac.com> for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 10:51:27 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <4AA65DA4.2090109@cowlark.com> Subject: Re: The source file culture Date: Tue, 08 Sep 2009 19:50:49 +0200 References: <4AA65DA4.2090109@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 8, 2009, at 3:35 PM, David Given wrote: > I think what I'm trying to say is that Lua users are weird and don't > necessarily fall into the same demographic as with other scripting > languages. I could be wrong, though --- I know *I'm* weird... To paraphrase the Austin Independent Business Alliance's slogan: Keep Lua Weird! Cheers, -- PA. alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 15:04:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Hs98X010163; Tue, 8 Sep 2009 14:54:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 823BB192A9; Tue, 8 Sep 2009 14:53:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B360191EE for ; Tue, 8 Sep 2009 14:53:42 -0300 (BRT) Received: by bwz10 with SMTP id 10so1920960bwz.5 for ; Tue, 08 Sep 2009 10:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=pp5q+mkX7UJb9S8wgus3mQfMarWSF9Y8d+4KZcIZRjI=; b=uYa+dzCciGA7/bUZgUrst+xhb9yAnFsj8CJH0SedLdYcK09furVDo0ovDHSFExtsOn 1q16nEQmg1KNrAGyY268hylulHSkg3SI+6tzr6XboZvIDE/NHVLHx/uJHxBQPGmrqK9P GVsmxPISG0ekPVgrPl+uYQ6MdNmnmuxtOG1RE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=IfFIfhcY6hN31k1JDyQeVzT/FwEuIMp/OMvTpsFart428kAw7nf9kGMJwaR/7lNPfy nveaywo8tJQaoo04pwZTAYuYLGNwyDj2I7pEc98FXqgrUUyQKk1ypTL1wtZezKsOMENR 98s1DF40J4d3dkCIsZ1Ps+3VpcV8ClhyNAHzk= Received: by 10.103.126.33 with SMTP id d33mr6843658mun.109.1252432418778; Tue, 08 Sep 2009 10:53:38 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id j9sm65842mue.38.2009.09.08.10.53.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 10:53:38 -0700 (PDT) Message-Id: <540E6A28-A007-416A-B834-1382C826B779@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4AA65DA4.2090109@cowlark.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: The source file culture Date: Tue, 8 Sep 2009 19:53:06 +0200 References: <4AA65DA4.2090109@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 8, 2009, at 3:35 PM, David Given wrote: > I think most people here see Lua as a component, intended to be > customised and bolted into another product, rather than being used > on its own. I take offense of your use of "most people" :D I, for one, use Lua on its own :) Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 18:17:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88LHo5s024602; Tue, 8 Sep 2009 18:17:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADBD81909A; Tue, 8 Sep 2009 18:17:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 676B818FEB for ; Tue, 8 Sep 2009 18:17:08 -0300 (BRT) Received: by pzk29 with SMTP id 29so525568pzk.14 for ; Tue, 08 Sep 2009 14:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=3YH//lhBJEvAccsuWhSxiQatT3I7sFS1o3DCsMSRNVk=; b=SV7iGKCUZjeRFm1BgOajb/fBjiqk6W4OOdIvmUVRWinyUdhneHfFPOAndIcH1wjQoe iqZKuh1NCx1GclIGJ+mrfXOqPu0tsEQiLrd2IW4k/uKfZufh4KXhsfd57EMtCchH3MMc 5sd77+ptKQtp3Mnaq1WyUSU8C4/SKqmm4udkc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=tUtvLc9N76Yy/X5E1AXeT1ab4q5G4/Dny/FegdAkYTrgymIQzx764c6QmW2/EmoJNx ajQ5KfrU3DLHTftjCEKW+u1hZ9ibS4XSAxKFHcSu9Uihc74IUQ0twcNRB31JNVL5FRNT XHj2W9drM7brWMAlQDPYakE7xEDQFkIpMTK4k= MIME-Version: 1.0 Received: by 10.142.9.39 with SMTP id 39mr638190wfi.115.1252444625091; Tue, 08 Sep 2009 14:17:05 -0700 (PDT) In-Reply-To: References: From: Tiago Dionizio Date: Tue, 8 Sep 2009 22:16:45 +0100 Message-ID: <14e1a7260909081416i7d8f1a89kf54ae256c6990e80@mail.gmail.com> Subject: Re: curses To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I just looked into the state of support for curses. The best I can > find is lcurses 0.2, which seems basically to be abandonware. lcurses was more of a hobby of mine and not a project to serve everyone's needs. It started as binding to most ncurses api, including panels, but later I began take a different route trying to actually implement a high level api in Lua using a subset of the curses api. For that purpose, lua cui was a work in progress - more of a proof of concept, since it was somewhat hard to work with but the plan was to improve the api (for cui) once things were in an advanced stage. http://lua-cui.sourceforge.net/ There (in the svn repository) I included a more recent version of lcurses.c but I don't remember how much it was improved. But whatever workarounds existed for PDCurses were removed since the author of PDCurses fixed them. The main reason I eventually stopped working on it was because I wanted to make it work with an easy to use interface without having to worry about encodings whenever cui/lcurses was used. Meaning that the same program would work the same in different platforms / configurations. With PDCurses it was possible to work with system encoding or in utf-8, but with ncurses it depended on a lot of things... system configuration, terminal support (system, screen application, client), if using ssh/telnet the client had to be properly configured... lots of things to take into account and some of them would have to be handled by the (experienced?) user. Of course, if you only use ASCII then you won't have much problems with it, but for drawing special characters like boxes or accented characters it would lead to problems most of the time. Maybe I was too ambitious, but since it was more of an academic project it was somewhat abandoned - at least until the next time I felt like working on it again :) Feel free to reuse lcurses and make it into something useful. Regards, Tiago From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 18:30:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88LUTcG027110; Tue, 8 Sep 2009 18:30:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE05719289; Tue, 8 Sep 2009 18:30:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og114.obsmtp.com (exprod7og114.obsmtp.com [64.18.2.215]) by bazar2.conectiva.com.br (Postfix) with SMTP id DBE8119109 for ; Tue, 8 Sep 2009 18:29:57 -0300 (BRT) Received: from source ([209.85.220.217]) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKSqbM01DXeEzeJyjwK4CwO4IsOp+SAc8l@postini.com; Tue, 08 Sep 2009 14:29:58 PDT Received: by fxm17 with SMTP id 17so2965631fxm.37 for ; Tue, 08 Sep 2009 14:29:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.74.91 with SMTP id t27mr6136302faj.62.1252445394609; Tue, 08 Sep 2009 14:29:54 -0700 (PDT) In-Reply-To: <14e1a7260909081416i7d8f1a89kf54ae256c6990e80@mail.gmail.com> References: <14e1a7260909081416i7d8f1a89kf54ae256c6990e80@mail.gmail.com> Date: Tue, 8 Sep 2009 22:29:54 +0100 Message-ID: Subject: Re: curses From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/8 Tiago Dionizio : > Feel free to reuse lcurses and make it into something useful. Thanks. I plan to make a near-minimal curses binding along the same lines as my other projects (bitlib and lrexlib), but I probably won't remove much that is already there. At least to start with I'll probably not include the panels stuff, as I have no use for it. -- http://rrt.sc3d.org Psalms 19:12: tagline for the guilty From lua-bounces@bazar2.conectiva.com.br Tue Sep 8 19:48:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n88Mm0qx007932; Tue, 8 Sep 2009 19:48:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C517D19342; Tue, 8 Sep 2009 19:47:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-112.bluehost.com (outbound-mail-112.bluehost.com [69.89.24.2]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3974C18FDF for ; Tue, 8 Sep 2009 19:47:20 -0300 (BRT) Received: (qmail 22976 invoked by uid 0); 8 Sep 2009 22:47:17 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy3.bluehost.com with SMTP; 8 Sep 2009 22:47:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=P/FyxFereMFUn/pVs3BNB3CU71DseM9gzKvUdkLLG4tNNX4JIhoUsJLw+l8xElDEpwnbJQ0rLoi7+tHO/5krFAYyhtAYNvpyYvFIbhwJW4bS8iKM/9ho/QPsUWFmrsXX; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Ml9T3-0001Ys-BH for lua@bazar2.conectiva.com.br; Tue, 08 Sep 2009 16:47:17 -0600 Date: Tue, 8 Sep 2009 18:47:08 -0400 From: TNHarris To: Lua-l Subject: Regarding the name 'pairs' Message-ID: <20090908184708.3e680459@egeria.whoopdedo.org> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean At the moment, the functions pairs and ipairs do just what they're named. But the metamethods __pairs and __ipairs will generalize this so any table or userdata will be iterable in a standard way. Except, there's no reason why an iterator should be returning a "pair", is there? A relational DB cursor, when iterated, would return the columns for each row. That could be any number of values, depending on the query. If the names remain "pairs" and "ipairs" in 5.2, it would be an anachronism, wouldn't it? Could a more appropriate name be adopted when the new metamethods are added? So future code will be more readable. Possible alternatives are "iter", "iterator", "each", "items", "enumerate" (for ipairs). -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 01:55:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n894trUx015172; Wed, 9 Sep 2009 01:55:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B6B419303; Wed, 9 Sep 2009 01:55:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f195.google.com (mail-px0-f195.google.com [209.85.216.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C253D1903D for ; Wed, 9 Sep 2009 01:55:15 -0300 (BRT) Received: by pxi33 with SMTP id 33so3906432pxi.11 for ; Tue, 08 Sep 2009 21:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=5ib2m+5U+ix7BcL1g8aLNzPqBEa5yujHvavANoRW0zA=; b=rEyWLS+LNVye8q3d3BeRxa15UUXivxyNvNofNXv0UPxTtua4vF8d0zXd1SiqXWDD81 AOuQAlEliNHHpVq2PqcfP3bnZQo/93p71i3NZyyh/bDce6OT836jz44d46qwH224v3k7 EuQQe86mh+vw5kZv+kNqZiZkvAu31F0qK4lWM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VBLUsfUKfrONf5v3D1X6ed8iEqVpqCi6DSgP5qrqTHCn7gQODIWRmAGQSkb7WvfstT NdZVdlibMq9HE9/GhKm8Hhkae+oy/U6lnScqjTScW12y2PZtFNsdcYeie2CidEIcSIDY mhFf3yGNOq/5Mj/3n/caYPIRxnl2HgJzQfTdE= MIME-Version: 1.0 Received: by 10.142.121.3 with SMTP id t3mr665486wfc.6.1252472114083; Tue, 08 Sep 2009 21:55:14 -0700 (PDT) In-Reply-To: <20090908140010.C30026@lua.tecgraf.puc-rio.br> References: <20090908140010.C30026@lua.tecgraf.puc-rio.br> From: Anurag Sharma Date: Wed, 9 Sep 2009 10:24:54 +0530 Message-ID: Subject: Re: How to Load extended Lua Library at the launch of Lua Console To: Lua list Content-Type: multipart/alternative; boundary=001636e9087b73769b04731de3a5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e9087b73769b04731de3a5 Content-Type: text/plain; charset=ISO-8859-1 Hi Luiz and Rob , Thank you for replying. the problem was that I had set the env var LUA_CPATH="C:/program files/my app" After changing it to LUA_CPATH="C:/program files/my app/myapp_lua.dll" when I try cmd.exe /K lua.exe -l myApp_Lua it works Strangely though, before changing the env var., when I tried cmd.exe /K lua.exe -l "C:/program files/my app/myapp_lua.dll" It showed me this error msg. lua.exe: module 'myapp_Lua' not found: no field package.preload['myapp_Lua'] no file '.\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua\init.lua' no file 'C:\Program Files\Lua\5.1\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\myapp_Lua\init.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.luac' no file 'C:\Program Files\AMD\myapp\' stack traceback: [C]: ? [C]: ? But it is Working fine now after setting the LUA_CPATH environment variable to the actual dll instead of the containing directory. thanks again for replying. Anurag On Tue, Sep 8, 2009 at 10:30 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > On the installation of my application, this dll will be copied in this > > location C:/program files/my app/myApp_Lua.dll > > > > I want to launch Lua console with "myApp_Lua.dll" loaded. How can I do > so? > > > > Just to clarify the question I am providing an analogy with Perl where I > > have to run the following at Start->"Run" to launch perl console with > > myApp_Perl.dll loaded > > > > cmd.exe /K perl5.10.0.exe myApp_Perl.dll > > In an ideal world, with correct paths sets, this would be > > cmd.exe /K lua.exe -lmyApp_Lua > > However, "C:/program files/my app/myApp_Lua.dll" is probably not in > the default LUA_CPATH and so you may need to adapt this to eg. > > cmd.exe /K lua.exe -e'LUA_CPATH="C:/program files/my app/?.dll;" > -lmyApp_Lua > --001636e9087b73769b04731de3a5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi
Luiz and Rob , Thank you for replying.

the problem was that I= had set the env var
LUA_CPATH=3D"C:/program files/my app"
=
After changing it to
LUA_CPATH=3D"C:/program files/my app/myap= p_lua.dll"

when I try
cmd.exe /K lua.exe -l myApp_Lua

it works

Strangely though, before changing the env var., when I tried

cmd.= exe /K lua.exe=A0 -l "C:/program files/my app/myapp_lua.dll"=A0 =

It showed me this error msg.
lua.exe: module 'myapp_Lua' no= t found:
=A0=A0=A0=A0=A0=A0=A0 no field package.preload['myapp_Lua&#= 39;]
=A0=A0=A0=A0=A0=A0=A0 no file '.\myapp_Lua.lua'
=A0=A0= =A0=A0=A0=A0=A0 no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua'= ;
=A0=A0=A0=A0=A0=A0=A0 no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua\i= nit.lua'
=A0=A0=A0=A0=A0=A0=A0 no file 'C:\Program Files\Lua\5.1= \myapp_Lua.lua'
=A0=A0=A0=A0=A0=A0=A0 no file 'C:\Program Files\= Lua\5.1\myapp_Lua\init.lua'
=A0=A0=A0=A0=A0=A0=A0 no file 'C:\Pr= ogram Files\Lua\5.1\lua\myapp_Lua.luac'
=A0=A0=A0=A0=A0=A0=A0 no file 'C:\Program Files\AMD\myapp\'
stac= k traceback:
=A0=A0=A0=A0=A0=A0=A0 [C]: ?
=A0=A0=A0=A0=A0=A0=A0 [C]: = ?


But it is Working fine now after setting the LUA_CPATH environ= ment variable to the actual dll instead of the containing directory.


thanks again for replying.

Anurag


On Tue, Sep 8, = 2009 at 10:30 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wr= ote:
> On the installation of my application, thi= s dll will be copied in this
> location C:/program files/my app/myApp_Lua.dll
>
> I want to launch Lua console with "myApp_Lua.dll" loaded. Ho= w can I do so?
>
> Just to clarify the question I am providing an analogy with Perl where= I
> have to run the following at Start->"Run" =A0to launch pe= rl console with
> myApp_Perl.dll loaded
>
> cmd.exe /K perl5.10.0.exe =A0myApp_Perl.dll

In an ideal world, with correct paths sets, this would be

cmd.exe /K lua.exe -lmyApp_Lua

However, "C:/program files/my app/myApp_Lua.dll" is probably not = in
the default LUA_CPATH and so you may need to adapt this to eg.

cmd.exe /K lua.exe -e'LUA_CPATH=3D"C:/program files/my app/?.dll;&= quot; -lmyApp_Lua

--001636e9087b73769b04731de3a5-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 04:37:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n897b0fB031119; Wed, 9 Sep 2009 04:37:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CCDF1937E; Wed, 9 Sep 2009 04:36:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DB5B19376 for ; Wed, 9 Sep 2009 04:36:21 -0300 (BRT) Received: by pzk29 with SMTP id 29so945161pzk.14 for ; Wed, 09 Sep 2009 00:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=PihxA5vruuPsy22pxG6/oAPx9OqisecOw8NCjc+R9v8=; b=jDLN4Z4VESzwkaVsel51bv200ka3TASw424zdWN8rLbesR8i5IdtEsSEgFTCKvpJ14 tGGD9UgE5WLdTVoONR1/K4G0Zrb6brlbuow88aALET16U8ssS5YMue/IOzb2iWcL/JLi fvemSJuJ2wcelnGWxIs3HLoFAbHWxz8VvSQEY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=tkYRDzi1oJVcScAsGilccx7618Tux7zE1ISbbHqXNmj8fOaX88/Gq/LaZ0RHp4RuEr PaeTk3YUJ+4Q6jcnmibbji+gIvjqrwmEJj3e/Iflxjvy6DK27FLNgFZq9A0yHnobs0px PLxSmF786xq/RkLF+8f9JaQuNzIRI4N5eLwZ0= MIME-Version: 1.0 Received: by 10.142.7.2 with SMTP id 2mr653235wfg.104.1252481778141; Wed, 09 Sep 2009 00:36:18 -0700 (PDT) From: Anurag Sharma Date: Wed, 9 Sep 2009 13:05:58 +0530 Message-ID: Subject: Running Lua script file from Lua Console To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502b08c794ba70473202310 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b08c794ba70473202310 Content-Type: text/plain; charset=ISO-8859-1 Hi Here is what i am doing I am launching Lua console from Start-Run using this command cmd.exe /K lua.exe The console shows up as follows Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > Then I run the Lua script file as follow > C:\a\ScriptingLanguageSupport\Lua2.lua It gives me this error message stdin:1: '' expected near '\' > could you please help thanks Anurag --00504502b08c794ba70473202310 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

Here is what i am doing

I am launching Lua console from St= art-Run using this command
cmd.exe /K lua.exe

The console shows up as follows
Lua 5.1.4=A0 Copyright (C) 1994-2008= Lua.org, PUC-Rio
>

Then I run the Lua script file as follow<= br>
> C:\a\ScriptingLanguageSupport\
Lua2.lua=

It gives me this error message

stdin:1: '<name>' e= xpected near '\'
>

could you please help

thanks
Anurag
--00504502b08c794ba70473202310-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 04:46:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n897kHtu031945; Wed, 9 Sep 2009 04:46:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48D1119389; Wed, 9 Sep 2009 04:46:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D2D2191DC for ; Wed, 9 Sep 2009 04:45:50 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MlHsD-0001FP-8j for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 00:45:49 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: Running Lua script file from Lua Console Date: Wed, 9 Sep 2009 00:45:45 -0700 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909090045.45978.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wednesday 09, Anurag Sharma wrote: > The console shows up as follows > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > > Then I run the Lua script file as follow > > > C:\a\ScriptingLanguageSupport\Lua2.lua > > It gives me this error message > > stdin:1: '' expected near '\' That is the Lua interpreter and it expects Lua code not files to execute. Type this Lua code to execute that Lua script: dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") Note the double backslashes. One backslash is used to escape some control characters like newline "\n", tab "\t". -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 04:56:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n897uAHR000440; Wed, 9 Sep 2009 04:56:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDF2A193A6; Wed, 9 Sep 2009 04:55:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4406319391 for ; Wed, 9 Sep 2009 04:55:47 -0300 (BRT) Received: by ewy26 with SMTP id 26so3962466ewy.5 for ; Wed, 09 Sep 2009 00:55:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.66 with SMTP id x44mr2062270wee.96.1252482944460; Wed, 09 Sep 2009 00:55:44 -0700 (PDT) In-Reply-To: <200909090045.45978.bobby@sharedrealm.com> References: <200909090045.45978.bobby@sharedrealm.com> Date: Wed, 9 Sep 2009 08:55:44 +0100 X-Google-Sender-Auth: 5092de193302f3c4 Message-ID: Subject: Re: Running Lua script file from Lua Console From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If you're entering "cmd.exe /K lua.exe" into Start-.Run, then entering just "lua.exe" should also work. On Wed, Sep 9, 2009 at 8:45 AM, Robert G. Jakabosky wrote: > Type this Lua code to execute that Lua script: > dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") Alternatively: dofile[[C:\a\ScriptingLanguageSupport\Lua2.lua]] From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 05:37:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n898bJQT004455; Wed, 9 Sep 2009 05:37:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D31C3193AF; Wed, 9 Sep 2009 05:36:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37D5C19392 for ; Wed, 9 Sep 2009 05:36:48 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MlIfQ-0002UC-UA for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 10:36:41 +0200 Received: from athedsl-4468072.home.otenet.gr ([94.71.109.88]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:36:40 +0200 Received: from petsagouris by athedsl-4468072.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:36:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: Running Lua script file from Lua Console Date: Wed, 9 Sep 2009 08:36:16 +0000 (UTC) Lines: 15 Message-ID: References: <200909090045.45978.bobby@sharedrealm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.71.109.88 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Robert G. Jakabosky sharedrealm.com> writes: > > Type this Lua code to execute that Lua script: > dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") > > Note the double backslashes. One backslash is used to escape some control > characters like newline "\n", tab "\t". > Also you can try : dofile("C:/a/ScriptingLanguageSupport/Lua2.lua") As far as I know, Windows accepts both '/' and '\' for directory separators. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 05:37:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n898bo17004552; Wed, 9 Sep 2009 05:37:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0308193C1; Wed, 9 Sep 2009 05:37:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E4E0193BB for ; Wed, 9 Sep 2009 05:37:14 -0300 (BRT) Received: by bwz10 with SMTP id 10so2358427bwz.5 for ; Wed, 09 Sep 2009 01:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=dcbZO1ATHzDQucTZfCTxkuYYXseEWKvO4z5cBnlW2ak=; b=XrPn1p7jWL2h1C3OdbfpiA2hgb5xrbRJYJ2A9VxouLwfLPqR6qd1DdcwW/q41r6mem QpbiMcKiguDsH7QfQogyVXif4Io5jlj9O+UB0nA01oGw6M7n9f4gqs1mRnVULz8FQez0 /0OZEUnOxgEM3MhRnhnO7MgHxeKT0zxmo6/wU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RTJlrkT3vyqyl1mDPBXkmTb6e0tUIeDdt/R89MmQd10EtOkaSflCLCDp42hUTOvX6q pi9kXRbfdvjmMDIeLt/UvTP0d48I5EEN2RRALdCpUYs8NzhlwK+E0TUwK3P+/HMlfh9G QD8/hj+TkQCYPWbVW3SI+L7UMBkwDC2eVt9lM= MIME-Version: 1.0 Received: by 10.223.14.131 with SMTP id g3mr823660faa.68.1252485432509; Wed, 09 Sep 2009 01:37:12 -0700 (PDT) In-Reply-To: References: <200909090045.45978.bobby@sharedrealm.com> Date: Wed, 9 Sep 2009 09:37:12 +0100 Message-ID: <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> Subject: Re: Running Lua script file from Lua Console From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=00151747af9a4a85b6047320fdc1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151747af9a4a85b6047320fdc1 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 9, 2009 at 8:55 AM, Peter Cawley wrote: > If you're entering "cmd.exe /K lua.exe" into Start-.Run, then entering > just "lua.exe" should also work. > > On Wed, Sep 9, 2009 at 8:45 AM, Robert G. > Jakabosky wrote: > > Type this Lua code to execute that Lua script: > > dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") > > Alternatively: > > dofile[[C:\a\ScriptingLanguageSupport\Lua2.lua]] > The Windows backslashes are a vestige that is on it's way out. Just use forward slashes everywhere in Lua! Everything apart from the Command Prompt (cmd.exe) understand proper file names these days. dofile "C:/a/ScriptingLanguageSupport/Lua2.lua" Robby PS The only place I ever have to use backslashes for pathnames in Windows is when constructing a command line for os.execute(). But there you also have the lovely task of getting your quoting right and everything is suddenly difficult. --00151747af9a4a85b6047320fdc1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Wed, Sep 9, 2009 at 8:55 AM, Peter Ca= wley <lua@corsix.org= > wrote:
If you're entering "cmd.exe /K lua.exe" into Start-.Run, then= entering
just "lua.exe" should also work.

On Wed, Sep 9, 2009 at 8:45 AM, Robert G.
Jakabosky<bobby@sharedrealm.com= > wrote:
> Type this Lua code to execute that Lua script:
> dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua")

Alternatively:

dofile[[C:\a\ScriptingLanguageSupport\Lua2.lua]]

The Windows backslashes are a vestige that is on it&= #39;s way out.
Just use forward slashes everywhere in Lua! Everything ap= art from the Command Prompt (cmd.exe) understand proper file names these da= ys.

dofile "C:/a/ScriptingLanguageSupport/Lua2.lua"

Robby<= br>
PS The only place I ever have to use backslashes for pathnames in Wi= ndows is when constructing a command line for os.execute(). But there you a= lso have the lovely task of getting your quoting right and everything is su= ddenly difficult.

--00151747af9a4a85b6047320fdc1-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 05:45:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n898jX9u005133; Wed, 9 Sep 2009 05:45:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC354193C0; Wed, 9 Sep 2009 05:45:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC6F2193AD for ; Wed, 9 Sep 2009 05:45:06 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MlInW-00053x-AX for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 10:45:02 +0200 Received: from p5b2c2443.dip.t-dialin.net ([91.44.36.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:45:02 +0200 Received: from dak by p5b2c2443.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:45:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Running Lua script file from Lua Console Date: Wed, 09 Sep 2009 10:44:40 +0200 Organization: Organization?!? Lines: 23 Message-ID: <87zl94ik1z.fsf@lola.goethe.zz> References: <200909090045.45978.bobby@sharedrealm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2443.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:p5u7aCKEdtxyTbNmWT0jeHK9bF4= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean George Petsagourakis writes: > Robert G. Jakabosky sharedrealm.com> writes: > >> >> Type this Lua code to execute that Lua script: >> dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") >> >> Note the double backslashes. One backslash is used to escape some control >> characters like newline "\n", tab "\t". >> > > Also you can try : > > dofile("C:/a/ScriptingLanguageSupport/Lua2.lua") > > As far as I know, Windows accepts both '/' and '\' for directory separators. No, it doesn't. The C library does, though. Which means that slashes work, except where they don't. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 05:52:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n898qoXq005808; Wed, 9 Sep 2009 05:52:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA873193BF; Wed, 9 Sep 2009 05:52:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E0D219384 for ; Wed, 9 Sep 2009 05:52:25 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MlIuH-0007Mv-UO for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 10:52:01 +0200 Received: from athedsl-4468072.home.otenet.gr ([94.71.109.88]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:52:01 +0200 Received: from petsagouris by athedsl-4468072.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Sep 2009 10:52:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: Running Lua script file from Lua Console Date: Wed, 9 Sep 2009 08:51:42 +0000 (UTC) Lines: 17 Message-ID: References: <200909090045.45978.bobby@sharedrealm.com> <87zl94ik1z.fsf@lola.goethe.zz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.71.109.88 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Kastrup gnu.org> writes: > > George Petsagourakis gmail.com> writes: > > > > > As far as I know, Windows accepts both '/' and '\' for directory separators. > > No, it doesn't. The C library does, though. Which means that slashes > work, except where they don't. > It works on the cmd.exe so there is support for both back-slash and forward-slash on windows. Check the image grab : http://img32.imageshack.us/img32/7820/croppercapture1.png From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 05:56:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n898uAmn006108; Wed, 9 Sep 2009 05:56:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54631193DB; Wed, 9 Sep 2009 05:55:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exprod7og110.obsmtp.com (exprod7og110.obsmtp.com [64.18.2.173]) by bazar2.conectiva.com.br (Postfix) with SMTP id B9F2D193CD for ; Wed, 9 Sep 2009 05:55:42 -0300 (BRT) Received: from source ([209.85.218.208]) by exprod7ob110.postini.com ([64.18.6.12]) with SMTP ID DSNKSqdtjDah9+qwPIlpF+ZK+HnbhRrDhjre@postini.com; Wed, 09 Sep 2009 01:55:43 PDT Received: by bwz4 with SMTP id 4so3436294bwz.0 for ; Wed, 09 Sep 2009 01:55:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.22.81 with SMTP id m17mr1068788fab.28.1252486539629; Wed, 09 Sep 2009 01:55:39 -0700 (PDT) In-Reply-To: References: <200909090045.45978.bobby@sharedrealm.com> <87zl94ik1z.fsf@lola.goethe.zz> Date: Wed, 9 Sep 2009 09:55:39 +0100 Message-ID: Subject: Re: Running Lua script file from Lua Console From: Reuben Thomas To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n898uAmn006108 2009/9/9 George Petsagourakis : > David Kastrup gnu.org> writes: > >> >> George Petsagourakis gmail.com> writes: >> >> > >> > As far as I know, Windows accepts both '/' and '\' for directory separators. >> >> No, it doesn't.  The C library does, though.  Which means that slashes >> work, except where they don't. >> > > It works on the cmd.exe so there is support for both back-slash and > forward-slash on windows. This has worked since DOS 2.0, except where it would be ambiguous, e.g. you can't say cd /foo because that looks like you're trying to pass the "/foo" option to cd. -- http://rrt.sc3d.org Belief marks the line at which our thinking stops (Carse) From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 06:06:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8996cVr007236; Wed, 9 Sep 2009 06:06:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC94C193E8; Wed, 9 Sep 2009 06:06:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E009193A5 for ; Wed, 9 Sep 2009 06:06:06 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MlJ7q-0003WT-5H for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 09:06:02 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> In-Reply-To: <20090908184708.3e680459@egeria.whoopdedo.org> Subject: RE: Regarding the name 'pairs' Date: Wed, 9 Sep 2009 10:05:08 +0100 Message-ID: <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acow1nGRSSITgBwgQ0e6Z6RIrZiDKQAU33Mw Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I could not agree more - I think this proposal is a very bad one and I am dismayed it is going forward. Pairs and ipairs only makes sense for the generalised tables of base Lua. If you are specialising tables (or userdata) with metamethods, it is very unlikely these will still be relevant: you might want one or many iterators and "pairs" or "ipairs" might, but probably will not, be relevant names. I would prefer a single __iter metamethod with deeper language integration so we can write: for v in myobject do print(v) end If you want more than one alternative iterators, implement these as methods: for v in myobject:myiterator do print(v) end I can see that __pairs and __ipairs is seen as a minimal innovation which can be implemented at the "library" level (similar to __tostring) rather than in the core language. However I agree that these simply do not make any sense in expressive terms. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of TNHarris > Sent: 08 September 2009 23:47 > To: Lua-l > Subject: Regarding the name 'pairs' > > At the moment, the functions pairs and ipairs do just what they're > named. But the metamethods __pairs and __ipairs will generalize this so > any table or userdata will be iterable in a standard way. Except, > there's no reason why an iterator should be returning a "pair", is > there? A relational DB cursor, when iterated, would return the > columns for each row. That could be any number of values, depending on > the query. > > If the names remain "pairs" and "ipairs" in 5.2, it would be an > anachronism, wouldn't it? Could a more appropriate name be adopted when > the new metamethods are added? So future code will be more readable. > > Possible alternatives are "iter", "iterator", "each", "items", > "enumerate" (for ipairs). > > -- tom > telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 06:17:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n899HdnS008320; Wed, 9 Sep 2009 06:17:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1541193EA; Wed, 9 Sep 2009 06:17:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D18EE193C2 for ; Wed, 9 Sep 2009 06:17:07 -0300 (BRT) Received: by bwz10 with SMTP id 10so2382358bwz.5 for ; Wed, 09 Sep 2009 02:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=SdzMrCffoIHmLwfJzab5+C0YkmrVje3ow1U8eO/XRSI=; b=qp+GMhMei3mkjkxcnr0shReXiAYfKwE0SZT3DBfK0zLeq5st/1l5Bg9L2m+7KqfXKd zHcjqFB5spoo4K/dzp01VGo1WMlN9tr5uolpWuTkEF+ds4hyHH+d9n5WwiwLjgh+o/+Q BwPZUKWl/1p9rT1m5O4ddKvFgum7chBenhPas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=yB0av/70oUKxX7UfrWIcyHvmyf8R5XztuN1VVwfBlPQdZDWHIEtOtdT2/1rPp5Xhvy mtm5KGoX843Y36ezmDn7RxygFfNaB4ls2ZucFzF4WcRVzJ/7c11pMU9d9fCHP+knKcfY nFAnoy2VSQSVH6ua7zlQYYBsOGzt3mOCzyF1k= MIME-Version: 1.0 Received: by 10.223.14.215 with SMTP id h23mr7083394faa.59.1252487826040; Wed, 09 Sep 2009 02:17:06 -0700 (PDT) In-Reply-To: <-3213164461981420685@unknownmsgid> References: <20090908184708.3e680459@egeria.whoopdedo.org> <-3213164461981420685@unknownmsgid> Date: Wed, 9 Sep 2009 11:17:06 +0200 Message-ID: <560972290909090217k62cf38fbm74aceee0b3df1ed7@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 9, 2009 at 11:05 AM, John Hind wrote: > I would prefer a single __iter metamethod with deeper language integration > so we can write: > > for v in myobject do print(v) end That does make more sense than generalized ipairs and pairs. I always liked how this used to happen 'magically' in 5.0, although the reason for the change was clear enough. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 06:32:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n899WYAP009494; Wed, 9 Sep 2009 06:32:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9A78193FC; Wed, 9 Sep 2009 06:32:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 654B5193F4 for ; Wed, 9 Sep 2009 06:32:01 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MlJWu-0004gT-QO for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 09:31:57 +0000 From: "John Hind" To: "'Lua list'" References: <200909090045.45978.bobby@sharedrealm.com> <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> In-Reply-To: <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> Subject: RE: Running Lua script file from Lua Console Date: Wed, 9 Sep 2009 10:31:03 +0100 Message-ID: <002901ca3130$3fdefcd0$bf9cf670$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002A_01CA3138.A1A364D0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoxKNen/FaH9w6ZSAGJaJ8EelPa7AABSAow Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_002A_01CA3138.A1A364D0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable =E2=80=9Cproper file names=E2=80=9D? =20 What is it about operating systems that gets everyone so theological and = partisan? Forward slashes or back slashes are just arbitrary conventions = and neither is =E2=80=9Cright=E2=80=9D or =E2=80=9Cwrong=E2=80=9D. If = anything is =E2=80=9Cwrong=E2=80=9D here it is the ugly and error-prone = =E2=80=9CC=E2=80=9D language use of escape sequences in strings which = unfortunately was inherited by Lua. =20 A few messages back someone talked about the =E2=80=9Cstandards based = world=E2=80=9D as opposed to Windows. A few lines further on he was = lamenting the need to support four different package managers for = different Linux distros! Reminded me of the famous quip: =20 =E2=80=9CThe great thing about standards is there are so many to choose = from.=E2=80=9D =20 From: lua-bounces@bazar2.conectiva.com.br = [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Robert Raschke Sent: 09 September 2009 09:37 To: Lua list Subject: Re: Running Lua script file from Lua Console =20 =20 On Wed, Sep 9, 2009 at 8:55 AM, Peter Cawley wrote: If you're entering "cmd.exe /K lua.exe" into Start-.Run, then entering just "lua.exe" should also work. On Wed, Sep 9, 2009 at 8:45 AM, Robert G. Jakabosky wrote: > Type this Lua code to execute that Lua script: > dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua") Alternatively: dofile[[C:\a\ScriptingLanguageSupport\Lua2.lua]] The Windows backslashes are a vestige that is on it's way out. Just use forward slashes everywhere in Lua! Everything apart from the = Command Prompt (cmd.exe) understand proper file names these days. dofile "C:/a/ScriptingLanguageSupport/Lua2.lua" Robby PS The only place I ever have to use backslashes for pathnames in = Windows is when constructing a command line for os.execute(). But there = you also have the lovely task of getting your quoting right and = everything is suddenly difficult. ------=_NextPart_000_002A_01CA3138.A1A364D0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

=E2=80=9Cproper file = names=E2=80=9D?

 

What is it about operating systems that gets everyone so theological and partisan? Forward slashes or back slashes are just = arbitrary conventions and neither is =E2=80=9Cright=E2=80=9D or = =E2=80=9Cwrong=E2=80=9D. If anything is =E2=80=9Cwrong=E2=80=9D here it is the ugly and error-prone =E2=80=9CC=E2=80=9D language use of escape = sequences in strings which unfortunately was inherited by Lua.

 

A few messages back someone talked about the = =E2=80=9Cstandards based world=E2=80=9D as opposed to Windows. A few lines further on he was = lamenting the need to support four different package managers for different Linux distros! = Reminded me of the famous quip:

 

=E2=80=9CThe great thing about standards is there are so = many to choose from.=E2=80=9D

 

From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Robert = Raschke
Sent: 09 September 2009 09:37
To: Lua list
Subject: Re: Running Lua script file from Lua = Console

 

 

On Wed, Sep 9, 2009 at 8:55 AM, Peter Cawley <lua@corsix.org> = wrote:

If you're entering "cmd.exe /K lua.exe" = into Start-.Run, then entering
just "lua.exe" should also work.


On Wed, Sep 9, 2009 at 8:45 AM, Robert G.
Jakabosky<bobby@sharedrealm.com> wrote:
> Type this Lua code to execute that Lua script:
> = dofile("C:\\a\\ScriptingLanguageSupport\\Lua2.lua")<= /p>

Alternatively:

dofile[[C:\a\ScriptingLanguageSupport\Lua2.lua]]


The Windows backslashes are a vestige that is on it's way out.
Just use forward slashes everywhere in Lua! Everything apart from the = Command Prompt (cmd.exe) understand proper file names these days.

dofile "C:/a/ScriptingLanguageSupport/Lua2.lua"

Robby

PS The only place I ever have to use backslashes for pathnames in = Windows is when constructing a command line for os.execute(). But there you also = have the lovely task of getting your quoting right and everything is suddenly = difficult.

------=_NextPart_000_002A_01CA3138.A1A364D0-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 07:09:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89A9Jt0012703; Wed, 9 Sep 2009 07:09:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E00619409; Wed, 9 Sep 2009 07:08:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71144193E2 for ; Wed, 9 Sep 2009 07:08:33 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MlK68-0001Ui-VQ for ; Wed, 09 Sep 2009 11:08:21 +0100 Received: from [192.168.3.116] (helo=necrosis.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MlK6I-0005Kf-0Z for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 11:08:30 +0100 Date: Wed, 9 Sep 2009 11:07:54 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Running Lua script file from Lua Console Message-ID: <20090909110754.36c07eeb@necrosis.i.flarn.net> In-Reply-To: <002901ca3130$3fdefcd0$bf9cf670$@hind@zen.co.uk> References: <200909090045.45978.bobby@sharedrealm.com> <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> <002901ca3130$3fdefcd0$bf9cf670$@hind@zen.co.uk> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n89A9Jt0012703 On Wed, 9 Sep 2009 10:31:03 +0100 "John Hind" wrote: > What is it about operating systems that gets everyone so theological > and partisan? Forward slashes or back slashes are just arbitrary > conventions and neither is “right†or “wrongâ€. If anything is “wrong†> here it is the ugly and error-prone “C†language use of escape > sequences in strings which unfortunately was inherited by Lua. Sorry? There is nothing wrong with C's escape sequences if you use the directory separator of the OS it was designed for use with :) B. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 08:03:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89B3QEZ018843; Wed, 9 Sep 2009 08:03:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19A4619413; Wed, 9 Sep 2009 08:02:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17B0119402 for ; Wed, 9 Sep 2009 08:02:48 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89B2jtS018752 for ; Wed, 9 Sep 2009 08:02:46 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n89B2ie00741; Wed, 9 Sep 2009 08:02:44 -0300 Date: Wed, 9 Sep 2009 08:02:43 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090909080243.A727@lua.tecgraf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk>; from john.hind@zen.co.uk on Wed, Sep 09, 2009 at 10:05:08AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I would prefer a single __iter metamethod with deeper language integration > so we can write: > > for v in myobject do print(v) end You can do that already: http://lua-users.org/lists/lua-l/2009-06/msg00221.html > for v in myobject:myiterator do print(v) end This is a syntax error. These would work: for v in myobject:myiterator() do print(v) end for v in myobject.myiterator do print(v) end From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 08:14:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89BEokR020213; Wed, 9 Sep 2009 08:14:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DA3D1941C; Wed, 9 Sep 2009 08:14:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6117719416 for ; Wed, 9 Sep 2009 08:14:16 -0300 (BRT) Received: by fxm18 with SMTP id 18so760634fxm.5 for ; Wed, 09 Sep 2009 04:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UiYhXCq3EIvjwbUIGfHiAD5ieejrNtWGnyvNswIMoo4=; b=L5KFIK/NvfSpaUBNI2MlzAtGCGGGXziIRdDSfHpdAR8TzzEnVj2VK6kb+TzuPlKLjy OIJcnU+HKNIFmdXymp2ld9ADZPLxfME42mRbaqwfrHGDDdrT+MojnpJ+aK8fX6i3cio5 L04nH9LHHH0qUEurVa9lXs55hwc8uWq5az7pA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dxKk6Sh6TvH0OSW/xGc8NlKZRMUqyv7j7yHev020oY2N/X2LA7KE+2pvd997YiQkTg iQfDE9qI0xnV+yZCY8DjuW7FUrBRfme+arMHVgEXMUluX61TxY6F8bsljBmXZeS3zzwJ PknnTvpfA5uLZP//uX6YA12rf1FAUjSWA5RZQ= MIME-Version: 1.0 Received: by 10.223.5.87 with SMTP id 23mr14200fau.87.1252494853157; Wed, 09 Sep 2009 04:14:13 -0700 (PDT) In-Reply-To: <20090909080243.A727@lua.tecgraf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090909080243.A727@lua.tecgraf.puc-rio.br> Date: Wed, 9 Sep 2009 13:14:13 +0200 Message-ID: <560972290909090414k54395b15j702162e4782bf59e@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n89BEokR020213 On Wed, Sep 9, 2009 at 1:02 PM, Luiz Henrique de Figueiredo wrote: > You can do that already: >        http://lua-users.org/lists/lua-l/2009-06/msg00221.html I was toying with this for the Penlight list class, and indeed you can get for i,v in ls do ... end going nicely. But I did not succeed in getting a Python-style default iterator, that is, just over the values; this needs an iterator with state. The problem is that then your lists (whatever) need to be callable for that particular use. This can make for confusion, in the case you pass a list by mistake to a function expecting a 'callable'. I used to enjoy making strings callable (so str(i,j) would work like str:sub(i,j)) but it did cause interesting and obscure error messages ;) (The string case is doubly dubious, because the string metatable is shared by all. So all it takes is two people with the same bright idea, and things fall apart!) From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 08:25:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89BPQ6R021300; Wed, 9 Sep 2009 08:25:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4017019393; Wed, 9 Sep 2009 08:24:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 539E8193DE for ; Wed, 9 Sep 2009 08:24:39 -0300 (BRT) Received: by bwz10 with SMTP id 10so2457207bwz.5 for ; Wed, 09 Sep 2009 04:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CWxt9BRlzDCxMvica5Ww4HSJNs3P0+MlR8+rFwx2R1E=; b=a5uwIG4y8kQvLCjWsj3Q6zopBLWu5O6zKJ5WVknOPSTFqp7wc55MKvHvadTdPONepo LL3/CuT6GxZIhHj8DZp/Gz4hCCAMgwVfjbeGZYAxwJrl87Jy6L9mVCZGmKJjuNBJ5LLd BL0IeG8onZzsrHh+f+liCXGEuJhuHf9RfAFHk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=an3KRQYnypFcHj7cRFSQI0osRH5JHA7V8spVexeYRFwDlTut+CDxRhANDCM4zIsdGL 8etN22D76LqKBDGO5xzCW7ugO8ChTgwh0WANYGNXEJwrfuPsHSEO0iJsXsBoSn19kpoS xzfWS2XV37L5m5z9taSD2x/zL2vuk+Vt41JmY= MIME-Version: 1.0 Received: by 10.223.6.23 with SMTP id 23mr27652fax.89.1252495476632; Wed, 09 Sep 2009 04:24:36 -0700 (PDT) In-Reply-To: <20090909110754.36c07eeb@necrosis.i.flarn.net> References: <200909090045.45978.bobby@sharedrealm.com> <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> <20090909110754.36c07eeb@necrosis.i.flarn.net> Date: Wed, 9 Sep 2009 13:24:36 +0200 Message-ID: <560972290909090424q8508907l15535c9ac6a35d7c@mail.gmail.com> Subject: Re: Running Lua script file from Lua Console From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n89BPQ6R021300 On Wed, Sep 9, 2009 at 12:07 PM, Rob Kendrick wrote: > Sorry?  There is nothing wrong with C's escape sequences if you use the > directory separator of the OS it was designed for use with :) Hehe, it really is Grumpy Week on the Lua list ;) Best approach: define some functions like join() etc which do the Right Thing. Respect package.config:sub(1,1), which gives the directory delimiter on the platform. join(dir,file) is not also more general than dir..'/'..file but more self-documenting. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 08:29:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89BTYYU021657; Wed, 9 Sep 2009 08:29:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E539719422; Wed, 9 Sep 2009 08:29:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CE0F193E1 for ; Wed, 9 Sep 2009 08:28:58 -0300 (BRT) Received: by pzk38 with SMTP id 38so4018825pzk.5 for ; Wed, 09 Sep 2009 04:28:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=FdQYUi9zxP9N8Ld85izjslh9OW8ENlMjzFv2Y+Lmwgs=; b=A0ya+aV9mmokAxG0AwH3Y8tKjYrizYNE+V4qqPaKe5I68ZDfCVGmOxC3UMJpyx6Wnu si2Y57JuI8QZZOC40V+dqbjbguoN7D/u0bt6sDvbQNrRo8zVhhg/VrdqoA8jlOS+aj4t lPLKKXeLXMZo0ftf7hE8J0Xjhe/TewXJEbIyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=b132flSwxXwNU5G2NTnEkIMDMYRPE6h5TK2+jG5CIIFkQFgyxVvlGtFSyEskVlEQXY hUucI9YFd4p5AowV0vyvZSsCqy4IG60QqSZZOx5/otsPx5X7LUMrw2lIOGfZaJV7ljCN 3d4j7Qcc3YAwrJ9ofsbXGs95JJt+7iufjrgT8= MIME-Version: 1.0 Received: by 10.142.3.37 with SMTP id 37mr3035wfc.146.1252495736430; Wed, 09 Sep 2009 04:28:56 -0700 (PDT) In-Reply-To: <20090909110754.36c07eeb@necrosis.i.flarn.net> References: <200909090045.45978.bobby@sharedrealm.com> <6a3ae47e0909090137g30e28e93v948d5dadb0a19581@mail.gmail.com> <20090909110754.36c07eeb@necrosis.i.flarn.net> From: Anurag Sharma Date: Wed, 9 Sep 2009 16:58:36 +0530 Message-ID: Subject: Re: Running Lua script file from Lua Console To: Lua list Content-Type: multipart/alternative; boundary=00504502c14d73e10704732363e3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502c14d73e10704732363e3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thank you all for responding.. It work with command "dofile". I do have some other questions too... will post in a different thread as they are not related to this topic On Wed, Sep 9, 2009 at 3:37 PM, Rob Kendrick wrote: > On Wed, 9 Sep 2009 10:31:03 +0100 > "John Hind" wrote: > > > What is it about operating systems that gets everyone so theological > > and partisan? Forward slashes or back slashes are just arbitrary > > conventions and neither is =93right=94 or =93wrong=94. If anything is = =93wrong=94 > > here it is the ugly and error-prone =93C=94 language use of escape > > sequences in strings which unfortunately was inherited by Lua. > > Sorry? There is nothing wrong with C's escape sequences if you use the > directory separator of the OS it was designed for use with :) > > B. > --00504502c14d73e10704732363e3 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thank you all for responding..

It work with command "dofile&quo= t;.

I do have some other questions too... will post in a different t= hread as they are not related to this topic


On Wed, Sep 9, 2009 at 3:37 PM, Rob Kendrick <lua-l@nun.org.uk> wrote:
On Wed, 9 Sep 2009 10:31:03 +0100
"John Hind" <john.hind@= zen.co.uk> wrote:

> What is it about operating systems that gets everyone so theological > and partisan? Forward slashes or back slashes are just arbitrary
> conventions and neither is =93right=94 or =93wrong=94. If anything is = =93wrong=94
> here it is the ugly and error-prone =93C=94 language use of escape
> sequences in strings which unfortunately was inherited by Lua.

Sorry? =A0There is nothing wrong with C's escape sequences if you= use the
directory separator of the OS it was designed for use with :)

B.

--00504502c14d73e10704732363e3-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 08:45:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89BjUKN023438; Wed, 9 Sep 2009 08:45:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A30FF193FA; Wed, 9 Sep 2009 08:45:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17697193C2 for ; Wed, 9 Sep 2009 08:44:57 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MlLbb-0005KO-11 for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 11:44:55 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090909080243.A727@lua.tecgraf.puc-rio.br> In-Reply-To: <20090909080243.A727@lua.tecgraf.puc-rio.br> Subject: RE: Regarding the name 'pairs' Date: Wed, 9 Sep 2009 12:44:01 +0100 Message-ID: <003f01ca3142$d34a60b0$79df2210$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoxPTLjlOd/Dgw+RhenqIi9EhVsTAAA9MmA Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yes indeed - I contributed to that thread! The __call trick is one I have used many times and it is fine until you do a delegate class and want both a function call metamethod and a custom iterator for the same class! I am puzzled as to why it is OK to drop the empty parenthesis when doing a "pseudo" function call but not when doing a "real" method call? The difficulties (but not showstoppers) of the __iter approach have been addressed in the earlier thread, but the survival of the (IMHO pointless) "__pairs" and "__ipairs" approach has not. These are just bloat and buy us next to nothing: the alternatives available to anyone who wants these are even easier than those available to the "__iter" camp! > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique de > Figueiredo > Sent: 09 September 2009 12:03 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > > I would prefer a single __iter metamethod with deeper language > integration > > so we can write: > > > > for v in myobject do print(v) end > > You can do that already: > http://lua-users.org/lists/lua-l/2009-06/msg00221.html > > > for v in myobject:myiterator do print(v) end > > This is a syntax error. These would work: > for v in myobject:myiterator() do print(v) end > for v in myobject.myiterator do print(v) end > From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 09:05:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89C5HJd025986; Wed, 9 Sep 2009 09:05:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CD2219385; Wed, 9 Sep 2009 09:04:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6CFE19271 for ; Wed, 9 Sep 2009 09:04:41 -0300 (BRT) Received: by bwz10 with SMTP id 10so2482549bwz.5 for ; Wed, 09 Sep 2009 05:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8cXRoYI0zyus31sUiPaVj7sQc4eDeGb69CvOUfKo/3I=; b=EFJXJJdxIlM6AUbNuJ+yCqfKJhrV22sEnCYepwC7PqHeajMi0sHrUuUSaNGEtycQap +YXD687+w4vWgncBAQtphX7/sNvDoCa+ivNTfRTzxOe9GX326LJjoG7HkplhSen4GuCJ mzz3DULlSkDN/K+t4DTQm5H7Zjc+epRiT+I18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=G2xu+eiBC8zIAj4WPRNAmX7V2fxGBPHCO0nEDHIiZnCPFEGs5dT8iGvpMCcZw1/58y IzHTZz/qwhnwFqbr1pir+Befk99fSOZa85WTOKJ86oRXLwidmtAX+vutMrP+JWt9o7LW bc3tX8Kjf3A0U8/AQFU0NHvCXoH33/0e20Lyo= MIME-Version: 1.0 Received: by 10.223.92.153 with SMTP id r25mr88517fam.99.1252497878432; Wed, 09 Sep 2009 05:04:38 -0700 (PDT) In-Reply-To: <-7802153186795763464@unknownmsgid> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090909080243.A727@lua.tecgraf.puc-rio.br> <-7802153186795763464@unknownmsgid> Date: Wed, 9 Sep 2009 14:04:38 +0200 Message-ID: <560972290909090504k4edaa2a6k5e8c5d99cd9e698d@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 9, 2009 at 1:44 PM, John Hind wrote: > I am puzzled as to why it is OK to drop the empty parenthesis when doing a > "pseudo" function call but not when doing a "real" method call? Well, e.g. the style I tend to use these days is for val in list:iter() do .. end Where iter is a method which _returns_ a function, which is what the for statement is expecting. (It will call it repeatedly until it returns nil) If list had a __call metamethod, then it is callable, and the for statement just goes with that. And that's it, as you've discovered: __call is a hack here because what we're really trying to express the concept of 'iterable', not 'callable', which are quite distinct. Hence __iter ;) steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 09:28:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89CSEMg029714; Wed, 9 Sep 2009 09:28:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29CC7192D0; Wed, 9 Sep 2009 09:27:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB87819049 for ; Wed, 9 Sep 2009 09:27:38 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MlMGv-0003Li-31 for lua@bazar2.conectiva.com.br; Wed, 09 Sep 2009 12:27:37 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090909080243.A727@lua.tecgraf.puc-rio.br> <-7802153186795763464@unknownmsgid> <560972290909090504k4edaa2a6k5e8c5d99cd9e698d@mail.gmail.com> In-Reply-To: <560972290909090504k4edaa2a6k5e8c5d99cd9e698d@mail.gmail.com> Subject: RE: Regarding the name 'pairs' Date: Wed, 9 Sep 2009 13:26:43 +0100 Message-ID: <004601ca3148$ca6a2240$5f3e66c0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoxRdKkFgElJHgJQoaBSAaCnGaXcQAAfEEw Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I agree entirely ... I guess the reason why the method call does not work with an empty parenthesis is that it is not parsed directly but translated to list.iter(list) before parsing and the textual translation requires the empty parenthesis. Pity - if it is syntactically unambiguous in one case it should be in the other too - as you say, both are "really" just function calls. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: 09 September 2009 13:05 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > On Wed, Sep 9, 2009 at 1:44 PM, John Hind wrote: > > I am puzzled as to why it is OK to drop the empty parenthesis when > doing a > > "pseudo" function call but not when doing a "real" method call? > > Well, e.g. the style I tend to use these days is > > for val in list:iter() do .. end > > Where iter is a method which _returns_ a function, which is what the > for statement is expecting. (It will call it repeatedly until it > returns nil) > > If list had a __call metamethod, then it is callable, and the for > statement just goes with that. > > And that's it, as you've discovered: __call is a hack here because > what we're really trying to express the concept of 'iterable', not > 'callable', which are quite distinct. Hence __iter ;) > > steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 15:12:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89ICeaW015288; Wed, 9 Sep 2009 15:12:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 002E4193C4; Wed, 9 Sep 2009 15:12:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87ED8192B6 for ; Wed, 9 Sep 2009 15:11:58 -0300 (BRT) Received: by bwz10 with SMTP id 10so2778209bwz.5 for ; Wed, 09 Sep 2009 11:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=SxJmc1kRn3NCWr+dlHtRGWky4d5QVGypIjLq8ryBGbU=; b=NBVMAqo9ps//h/rg7VTvNDQk0JqZMvBeg9u2IdgGZOFXv0MovwX8xrNqB5eA6IYUQ3 Z7aeJie60sw+df4LlIzndXNu70Lona7PWUj591PJHK5db4f43RQ2saYC5syDz18pGGk7 r5ioRhG2F9vVgHpnPMYtNqB0Sx7cmyCFH7Y7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bpglSo8TsXXz/UbXwh+N809B0NO5rT8yV3Nc3c3VOXAgYD2Awqep3IxhvI5nOeCL6f f3E5FFSbBsRRu7gGYk7DPcJveBAMctEmrUjVaRDDaAtCSiVTl9DGYdwsq5G9dNl0Kxb6 kS0eBTEHzS49kbWJptYNmIwHUqypZr0CljPU4= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr34724bkw.154.1252519916841; Wed, 09 Sep 2009 11:11:56 -0700 (PDT) Date: Wed, 9 Sep 2009 21:11:56 +0300 Message-ID: Subject: Apache mailing list on using Lua. From: Georgios Petsagourakis To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0015175cf772b7ac3904732904b4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf772b7ac3904732904b4 Content-Type: text/plain; charset=UTF-8 I would to point the community's attention to this conversation, entitled "Some ramblings on httpd config", on the Apache-dev mailing list in which there is serious consideration of using Lua for driving the whole Apache configuration. The conversation took place about 2 months ago. This will be a great success for Lua, if it becomes a reality. mod_lua will receive a more solid support and there will be a great rise on the use of Lua Best Regards,... George Petsagourakis --0015175cf772b7ac3904732904b4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I would to point the community's attention to this conversation,
entitle= d "Some ramblings on httpd config", on the Apache-dev
mailing= list in which there is serious consideration of using Lua
for driving the whole Apache configuration.

The conversation took p= lace about 2 months ago.

This will be a great success for Lua, if it= becomes a reality.
mod_lua will receive a more solid support and there = will be
a great rise on the use of Lua

Best Regards,...
Geo= rge Petsagourakis
--0015175cf772b7ac3904732904b4-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 16:08:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89J8NiV030067; Wed, 9 Sep 2009 16:08:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1E85192B1; Wed, 9 Sep 2009 16:07:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69A581924D for ; Wed, 9 Sep 2009 16:07:47 -0300 (BRT) Received: from magritte (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89J7jrY029884 for ; Wed, 9 Sep 2009 16:07:45 -0300 Date: Wed, 9 Sep 2009 16:07:45 -0300 (BRT) From: Tomas Guisasola Gorham To: Lua list Subject: Re: Apache mailing list on using Lua. In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="678920-124647408-1252523265=:1810" X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --678920-124647408-1252523265=:1810 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 9 Sep 2009, Georgios Petsagourakis wrote: > I would to point the community's attention to this > conversation, > > entitled "Some ramblings on httpd config", on the Apache-dev > mailing list in which there is serious consideration of using Lua > for driving the whole Apache configuration. > > The conversation took place about 2 months ago. > > This will be a great success for Lua, if it becomes a reality. > mod_lua will receive a more solid support and there will be > a great rise on the use of Lua It seems that most of them don't really understand how Lua could be used as a declarative language, but I hope Bertrand Mansion has clarified this point with his post :-) It will be great for Lua but I think it would be even better for Apache :-) Regards, Tomás --678920-124647408-1252523265=:1810-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 16:52:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89JqNOc009840; Wed, 9 Sep 2009 16:52:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A1B6193BD; Wed, 9 Sep 2009 16:51:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.peterodding.com (mailinghelper.nl [79.99.133.60]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75FA8192B5 for ; Wed, 9 Sep 2009 16:51:48 -0300 (BRT) Received: from [192.168.1.3] (82-136-228-62.ip.telfort.nl [82.136.228.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.peterodding.com (Postfix) with ESMTPSA id BA312202A447 for ; Wed, 9 Sep 2009 19:55:20 +0000 (UTC) Message-ID: <4AA8074E.3080806@peterodding.com> Date: Wed, 09 Sep 2009 21:51:42 +0200 From: Peter Odding User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Apache mailing list on using Lua. References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Georgios Petsagourakis wrote: > I would to point the community's attention to this > conversation, > > entitled "Some ramblings on httpd config", on the Apache-dev mailing > list in which there is serious consideration of using Lua for driving > the whole Apache configuration. Thanks for posting a link to that thread. I'd missed it completely and I'm quite interested in the topic of integrating Lua and Apache. This reminds me that I should publish my half finished Lua binding to the Apache Portable Runtime. I don't know how much duplicate code has been written for mod_wombat, LuaSVN, my binding and similar projects but it seems silly to duplicate all of the effort of that goes into testing and debugging the code, writing documentation, supporting users, etc. I'm hoping that the Apache developers decide to further integrate Lua, because I'd love to script Apache's request handling using Lua code. It would also enable me to define my most used Apache configuration snippets as Lua functions that can be reused between my different virtual hosts. Of course such functions can then be grouped into modules and shared between people. This seems to me like a good thing... - Peter Odding From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 16:58:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89JwlEG011358; Wed, 9 Sep 2009 16:58:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C7721937A; Wed, 9 Sep 2009 16:58:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6506190B7 for ; Wed, 9 Sep 2009 16:58:20 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1351259eye.39 for ; Wed, 09 Sep 2009 12:58:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.11.211 with SMTP id 61mr137843wex.68.1252526298505; Wed, 09 Sep 2009 12:58:18 -0700 (PDT) In-Reply-To: <4AA8074E.3080806@peterodding.com> References: <4AA8074E.3080806@peterodding.com> Date: Wed, 9 Sep 2009 20:58:18 +0100 X-Google-Sender-Auth: 16dbca32a62465a8 Message-ID: Subject: Re: Apache mailing list on using Lua. From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 9, 2009 at 8:51 PM, Peter Odding wrote: > This reminds me that I should publish my half finished Lua binding to > the Apache Portable Runtime. I don't know how much duplicate code has > been written for mod_wombat, LuaSVN, my binding and similar projects but > it seems silly to duplicate all of the effort of that goes into testing > and debugging the code, writing documentation, supporting users, etc. As far as I know, mod_lua (aka. mod_wombat) contains very little APR binding. I was going to write a Lua binding for the APR as a Google Summer of Code project, but I got little to no response on Lua related patches I submitted to httpd prior to the summer, so I ended up writing wxWidgets code instead. There is also a project on Google Code (http://code.google.com/p/lua-apr/) which is unrelated to myself, but may also be of interest. From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 17:53:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89KrZYQ025018; Wed, 9 Sep 2009 17:53:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E04F193E7; Wed, 9 Sep 2009 17:53:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F274193A5 for ; Wed, 9 Sep 2009 17:52:54 -0300 (BRT) Received: by bwz10 with SMTP id 10so2902979bwz.5 for ; Wed, 09 Sep 2009 13:52:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.11.23 with SMTP id r23mr170113bkr.158.1252529569585; Wed, 09 Sep 2009 13:52:49 -0700 (PDT) In-Reply-To: References: Date: Wed, 9 Sep 2009 22:52:49 +0200 X-Google-Sender-Auth: 32f16d50b010b452 Message-ID: Subject: Re: Apache mailing list on using Lua. From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n89KrZYQ025018 On Wed, Sep 9, 2009 at 9:07 PM, Tomas Guisasola Gorham wrote: > On Wed, 9 Sep 2009, Georgios Petsagourakis wrote: >> >> I would to point the community's attention to this >> conversation, >> >> entitled "Some ramblings on httpd config", on the Apache-dev >> mailing list in which there is serious consideration of using Lua >> for driving the whole Apache configuration. >> >> The conversation took place about 2 months ago. >> >> This will be a great success for Lua, if it becomes a reality. >> mod_lua will receive a more solid support and there will be >> a great rise on the use of Lua > >        It seems that most of them don't really understand how Lua > could be used as a declarative language, but I hope Bertrand Mansion > has clarified this point with his post :-) >        It will be great for Lua but I think it would be even better > for Apache :-) You are absolutely right. In my opinion, the Apache HTTP developers community is dying, the ones still hanging around are not very interested in new ideas and I don't think anything interesting or innovative will happen there before a long time. It seems Apache has reached the point where a project becomes too mature to change without risking to compromise its userbase and its stability. So I wouldn't bet on having Lua in Apache. I wouldn't bet on mod_lua neither because in my opinion, it has some bad design problems. I am also quite sad nobody in the Apache dev community took care of applications for the GSoC this year, but I guess it is just another sign that this is a dying community. Today, I find projects like Nginx and Lighttpd more interesting. I wish there was a Lua module for Nginx (I found one on the net some time ago but it is not available anymore. I still have the sources on my HD though if anyone is interested as well :) On Wed, Sep 9, 2009 at 9:51 PM, Peter Odding wrote: > This reminds me that I should publish my half finished Lua binding to > the Apache Portable Runtime. I don't know how much duplicate code has > been written for mod_wombat, LuaSVN, my binding and similar projects but > it seems silly to duplicate all of the effort of that goes into testing > and debugging the code, writing documentation, supporting users, etc. If you are interested in APR and Lua, check out this project : http://code.google.com/p/lua-apr/ Regards, -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 18:36:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n89LaJfA001048; Wed, 9 Sep 2009 18:36:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50468193C3; Wed, 9 Sep 2009 18:35:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C76B919379 for ; Wed, 9 Sep 2009 18:35:47 -0300 (BRT) Received: by yxe5 with SMTP id 5so7892693yxe.33 for ; Wed, 09 Sep 2009 14:35:46 -0700 (PDT) Received: by 10.90.188.17 with SMTP id l17mr414916agf.30.1252532146688; Wed, 09 Sep 2009 14:35:46 -0700 (PDT) Received: from ?192.168.2.2? ([71.21.67.37]) by mx.google.com with ESMTPS id 36sm465066agc.60.2009.09.09.14.35.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Sep 2009 14:35:46 -0700 (PDT) Message-Id: <9228073B-9485-4BF6-AA24-81E74108D38D@burninglabs.com> From: Phoenix Sol To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: Apache mailing list on using Lua. Date: Wed, 9 Sep 2009 16:34:16 -0500 References: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Today, I find projects like Nginx and Lighttpd more interesting. > I wish there was a Lua module for Nginx ... Right on. Personally, I'm very interested in the basic design of Nginx, and in building a very minimalist, Lua WSAPI-focused implementation of that basic style of architecture. But sadly, my C skill level is slowing me down on the path to realizing it. (I'm not content with using FCGI or an Nginx module, and it's this same obsessiveness, btw, that drew me into Lua.) From lua-bounces@bazar2.conectiva.com.br Wed Sep 9 21:05:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A05Jbv020951; Wed, 9 Sep 2009 21:05:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40A081942B; Wed, 9 Sep 2009 21:04:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D706019399 for ; Wed, 9 Sep 2009 21:04:39 -0300 (BRT) Received: by bwz10 with SMTP id 10so3006701bwz.5 for ; Wed, 09 Sep 2009 17:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=DB+QgFaMPAOTPN0LqvgruoHm0BO3xqUJCMAD6edeNd0=; b=PwNxfTaI63m4TBaL7Wgn6iZDYUYTyWjyPtTlwM/BMc+XhQJ+pKZC0QvVO81cXsOAtZ eeE6OtR7OaDuwdC2t0C7tiOdnPSrYYCHYM2zFsSIQAtSjSMAV6+ENNPFhH/azvP03Zo7 RpNALLVGQEdb3iYDJwExwfNlLBxMjJwmph4YE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=kKDxNdDDtkLhNS6CktvqI0T+WAXLgdDZ9R/Ya0AUB3oSmD8ke6oJq7pQ+A6Fmsxof8 1z+zUKBDAdofuRWl9DgewEF+rxkhzo/C2IINdzm/81trhYEGIaz3uY5hvhxDPLYL5hgK 074tz/mXbv6uU42TNcr2KeLxGLLIDOVk8d0tY= MIME-Version: 1.0 Received: by 10.223.4.144 with SMTP id 16mr814963far.36.1252541077730; Wed, 09 Sep 2009 17:04:37 -0700 (PDT) Date: Wed, 9 Sep 2009 20:04:37 -0400 X-Google-Sender-Auth: 57e1052a05de48c6 Message-ID: Subject: Re: Announce: Darwin module system From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000e0ce0099601390b04732df293 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0ce0099601390b04732df293 Content-Type: text/plain; charset=ISO-8859-1 > On Tue, 8 Sep 2009 11:59:01 +0200, Jerome Vuarand < > jerome.vuarand@gmail.com> wrote: > > > Unfortunately, not too many modules are written this way, because it can > be > > awkward to do so. A lot of modules create a table with a name that is > fixed > > in the source code for the module. In fact, modules that use the Lua > module > > function do this. > > That last point is not accurate. Modules that use the "module" > function don't have to use a fixed name when calling it. You can > simply forward the name passed to the module loader to the "module" > function. Most of my Lua modules start with this line: > > module(..., package.seeall) > > Yes, you make a good point. The Lua module system is quite flexible and this is a good demonstration. I forgot about this technique when I wrote my last post to this list. As I did say in that post, I like it when a module lets me assign the table name that will contain the module functions. > Either you knew it and you purposefully omitted to mention it, or you > didn't and in that case you may have underestimated the possibilities > of the existing Lua module system. In both cases something feels wrong > to me. > > It's certainly not polite to imply that I purposefully omitted this point. Do you realize that by suggesting it, you are assaulting the integrity of a person that you do not even know? Perhaps you were in a foul mood, or feeling needlessly defensive. In my omission, I did imply a lesser degree of flexibility in the Lua module system than actually exists. I regret the error. Nevertheless, I do not believe the omission undermines the rationale for creating an enhancement to the current module system. The reasons are many and deep, while the omission was singular and shallow. Jim --000e0ce0099601390b04732df293 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, 8 Sep 2009 11:59:01 +0200,=A0 Jerome Vuarand <jerome.vuarand@gmail.com> w= rote:
> Unfortunately, not too many modules are written this way, because it c= an be
> awkward to do so. =A0A lot of modules create a table with a name that = is fixed
> in the source code for the module. =A0In fact, modules that use the Lu= a module
> function do this.

That last point is not accurate. Modules that use the "module" function don't have to use a fixed name when calling it. You can
simply forward the name passed to the module loader to the "module&quo= t;
function. Most of my Lua modules start with this line:

module(..., package.seeall)
Yes, you make= a good point.=A0 The Lua module system is quite flexible=A0and this is a g= ood demonstration.=A0 I forgot about this technique when I wrote my last po= st to this list.=A0 As I did say in that post, I like it when a module lets= me assign the table name that will contain the module functions.
Either you knew it and you purposefully omitted to mention it, or you
didn't and in that case you may have underestimated the possibilities of the existing Lua module system. In both cases something feels wrong
to me.
It's certainly not polite to i= mply that I purposefully omitted this point. =A0Do you realize that by sugg= esting it, you are assaulting the integrity of a person that you do not eve= n know? =A0Perhaps you were in a foul mood, or feeling needlessly defensive= .

In my omission, I did imply a lesser degree of flexibility in the Lua m= odule system than actually exists. =A0I regret the error. =A0

Nevert= heless, I do not believe the omission undermines the rationale for creating= an enhancement to the current module system. =A0The reasons are many and d= eep, while the omission=A0was singular and shallow.

Jim

--000e0ce0099601390b04732df293-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 00:10:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A3ARdW008108; Thu, 10 Sep 2009 00:10:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7949E18EBE; Thu, 10 Sep 2009 00:09:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.210.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAF2E18D5E for ; Thu, 10 Sep 2009 00:09:51 -0300 (BRT) Received: by yxe5 with SMTP id 5so8169056yxe.33 for ; Wed, 09 Sep 2009 20:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=WvdVrWuG6047zVib6CWgqRx7PLLSAP6kLk6gejb8Spg=; b=YIQ8X1shwujQCwHE4NOv087IqKF5qBkpbSpO2Lf6lJ5B+BgEMzp6RMAYTqbc3eC8y/ QR9pjNgffkEQcZrhFqFNJ5RszyLMdZJVdAhOWikizqPmoE6ktBH1uk+ypyANtlniZufm DlqMoeBopjhtAzwgbPC6nvz0PbB/Whu2JTZ04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Cqfyosyt261uZ6GZYyUPXN3rMograLodpY0STCmE16lVhqGnQv4/Vv7+ZTKXYZ+LSk DDPlERZn/qsLIbXV2bKErrYti56n7m9T/D5Zao7rOmTKxkDR1e9O+sYQP95Hw+4c8slp HRq8sXffPtDIpp+m6mutJs57hWTT9DfPBNPW0= MIME-Version: 1.0 Received: by 10.150.165.7 with SMTP id n7mr1797829ybe.72.1252552190250; Wed, 09 Sep 2009 20:09:50 -0700 (PDT) Date: Wed, 9 Sep 2009 23:09:50 -0400 Message-ID: <2984a1fb0909092009g4a08f902o28f1d8e18c288ed7@mail.gmail.com> Subject: trying to make sense of debugging lua on chdk From: Matt Kime To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean i'm having a fair amount of trouble getting started debugging lua on chdk. (the canon hack development kit) chdk prints error codes and messages when errors are found. however, i've managed to find another class of errors which, after running a loop of code a random number of times (approx 100-1000 times) return an apparently random number and no error text. i'd like to examine the lua stack to see which function was executing. i'm certain that other info may be useful for debugging which i'm not even sure to ask for. i have done a fair amount of searching the relevant debug tools but i've found few examples and they leave me with more questions than they answer. can someone point me toward the "hello world" of lua debugging? thanks for any advice. --matt From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 02:01:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A51Dps019260; Thu, 10 Sep 2009 02:01:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7AB4192B1; Thu, 10 Sep 2009 02:00:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E34819178 for ; Thu, 10 Sep 2009 02:00:38 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1415104eye.39 for ; Wed, 09 Sep 2009 22:00:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.128.9 with SMTP id f9mr1108287ebn.93.1252558836604; Wed, 09 Sep 2009 22:00:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Sep 2009 01:00:36 -0400 X-Google-Sender-Auth: f17185056e03850d Message-ID: Subject: Re: Announce: Darwin module system From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 7, 2009 at 11:00 AM, Jim Jennings wrote: > I'll start with an example of the one Darwin function... > structure.declare { .... } The documentation for struct.declare defines these code fields: 1. open={m1, ...} 2. pre="..." 3. files=f1 or files={f1, ...} 4. post="..." 5. environment="..." When first seeing the examples, it was not obvious to me when fields #2-5 were appropriate and how they interacted. As I see, each of these represents code and they are executed in sequence. They differ, perhaps arbitrarily, in that #3 accepts file names, but the others accept code strings (though you could specify file names in the others via a dofile or require, as some examples do), and only #5 handles a return value. Lacking #3, you can arbitrarily choose to place your code inside #2, #4, or #5. Would something like the following make the model simpler and more general? structure.declare { name="test"; open={"_G", "os"}; environment = [[ pre..... dofile '.....' ..... post.... return t -- optional (return may be omitted) ]] } or using e.g. environment = {[[pre.....]], '@pre2.lua', '@file1.lua', [[post....; return t]]} The typical purpose of #2-4 seems to be to define a module that wraps another module, whereas the name/signature/location fields define how that wrapped module is bound into the local namespace tree. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 03:51:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A6pDeo028011; Thu, 10 Sep 2009 03:51:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F374618FF3; Thu, 10 Sep 2009 03:50:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ABDB18FB7 for ; Thu, 10 Sep 2009 03:50:42 -0300 (BRT) Received: by fxm18 with SMTP id 18so1464259fxm.5 for ; Wed, 09 Sep 2009 23:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hENcMLGMJkGM81Oot/v8T3MCl7ThJZZQ3+l3HmuROFE=; b=BKlTepdNoPsYg5jVoqSBEUjS45KtKSPKfjHEThvhX49DRk2m+91sVMzvl5Bj2Cs++P ep8RJZYBPtwPMcv3qpq+spvExT3i4d16x0KZtkvZnB0SwqDCfEjpKt7mHhq98vlUDKhP Flwnxug0TafMG3wUEG8GjgBaGRDpTs34mD6fw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DDuvjSFjqiT07f3R9ZJVHC9i4IEcMjLYWk6X640WYqY5nKsl1LcIbVjxztFn29lEsG xe6i3orS8e9iYwvAHbv3fSfjuEoHqlC8nEfpOPun8PVkwUZFXsBvCVQRHev5cT412f/0 rTOgO+EBlQwd47vIf6zyfhTrKWqTcvfp8XnMU= MIME-Version: 1.0 Received: by 10.204.154.209 with SMTP id p17mr605785bkw.104.1252565441159; Wed, 09 Sep 2009 23:50:41 -0700 (PDT) In-Reply-To: <2984a1fb0909092009g4a08f902o28f1d8e18c288ed7@mail.gmail.com> References: <2984a1fb0909092009g4a08f902o28f1d8e18c288ed7@mail.gmail.com> Date: Thu, 10 Sep 2009 08:50:40 +0200 Message-ID: <560972290909092350k4f2ab055s83eceeb93f96e305@mail.gmail.com> Subject: Re: trying to make sense of debugging lua on chdk From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 10, 2009 at 5:09 AM, Matt Kime wrote: > can someone point me toward the "hello world" of lua debugging? I'm assuming that the Lua code is running on the camera, so one option there is RemDebug. This uses sockets to do remote debugging. Does chdk provide something like this? A derived project is http://luaforge.net/projects/clidebugger/ which doesn't use sockets, runs remotely. So if you have a basic interactive mode, that could also be your best friend. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 04:14:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A7E43Q031464; Thu, 10 Sep 2009 04:14:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82EC019076; Thu, 10 Sep 2009 04:13:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id B0D4918FC9 for ; Thu, 10 Sep 2009 04:13:30 -0300 (BRT) Received: (qmail 7362 invoked by uid 0); 10 Sep 2009 07:13:28 -0000 Received: from -unknown- by www-us014.v300.gmx.net with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary5571252566806279586" Date: Thu, 10 Sep 2009 03:08:55 -0400 From: Michael Surette Message-ID: <20090910071326.5570@gmx.com> MIME-Version: 1.0 Subject: Re: trying to make sense of debugging lua on chdk To: "Lua list" X-Authenticated: #45466942 X-Flags: 0001 X-Mailer: GMX.com Web Mailer X-GMX-UID: d8vDImRX6ECzI1agwmpruotOU2poZVn6 X-FuHaFi: 0.66 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --========GMXBoundary5571252566806279586 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary5571252566806279586 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

----- Original Message -----

From: Matt Kime

Sent: 09/09/09 11:09 pm

To: lua@bazar2.conectiva.com.br

Subjec= t: trying to make sense of debugging lua on chdk

 

i'm having= a fair amount of trouble getting started debugging lua on
chdk. (the ca= non hack development kit)

chdk prints error codes and messages when = errors are found. however,
i've managed to find another class of errors = which, after running a
loop of code a random number of times (approx 100= -1000 times) return
an apparently random number and no error text. i'd l= ike to examine the
lua stack to see which function was executing. i'm ce= rtain that other
info may be useful for debugging which i'm not even sur= e to ask for.

i have done a fair amount of searching the relevant de= bug tools but
i've found few examples and they leave me with more questi= ons than
they answer.

can someone point me toward the "hello worl= d" of lua debugging?

thanks for any advice.

--matt

 

Thanks for mentioning this.  I have a lis= ted Canon camera and this looks quite interesting.

<= p id=3D"__paragraph__1252566436000" style=3D"">
=

From t= he chdk wiki "vxworks reports errno, but no text description"  = Perhaps you're experiencing a vxworks error.  You may be reduced to pr= int('functionname') for tracing through the functions.


Mike


--========GMXBoundary5571252566806279586-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 04:19:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A7JEK5031930; Thu, 10 Sep 2009 04:19:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C02B719049; Thu, 10 Sep 2009 04:18:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f195.google.com (mail-px0-f195.google.com [209.85.216.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21FA418FC9 for ; Thu, 10 Sep 2009 04:18:42 -0300 (BRT) Received: by pxi33 with SMTP id 33so4916770pxi.11 for ; Thu, 10 Sep 2009 00:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=D3TJ0rYA6fWj6eyXV6sQ9/PAY+8RbdlIYcseD8v8pl4=; b=tpEDIE29hSRYlquBwZmKF42VW+SqRlkRHL7oJdg0JWIc8xrpM1X6DYx9VA8AbWdG0D s6NyaYA+AetRXw732gjE+A649b6blGOCcqLbMq6a0hq+hlmNxSLuSkFEkbMpXKkbBY4T V6VMCVYYYwKvwG7BGVPpWOCoxIJDybDJ3OfjY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=YotZafrMy+7B/1Zco3E9mFKliaD6bqGQdmj0iMTcGobNb0KFfTWpu2Q/oVr0bCUx2f ZKxGXifjJYWMQI3fVnX3dwJj2rMqbaXRNwSvZkgYfiItqVGC2x6iep+Knk7SmIwpb3dy 02TT07AX1CT7WUqnf0KaDa6utEdwyYEib8DLI= MIME-Version: 1.0 Received: by 10.142.61.37 with SMTP id j37mr140915wfa.35.1252567121137; Thu, 10 Sep 2009 00:18:41 -0700 (PDT) From: Anurag Sharma Date: Thu, 10 Sep 2009 12:48:21 +0530 Message-ID: Subject: Where is the third argument????? To: Lua list Content-Type: multipart/alternative; boundary=001636e0aef25010d50473340212 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e0aef25010d50473340212 Content-Type: text/plain; charset=ISO-8859-1 Hi, I wrote an extension of Lua. Now I am writing a Lua script which makes a call to a function in that extension. signature of the function is as follows get_version(char* a, int b) My Lua script is as follows SUCCESS = 1 Version = ' ' -- # Create a 10 character buffer to store the version string status = extLua:get_version(Version,10) if (status != SUCCESS) then die ("Returned bad status: $status") end print("\nCurrent Version: " Version "\n") print("\nEnd of example\n") When I run the script file this is what I get > dofile("C:\\a\\ScriptingLanguageSupport\\Lua1.lua") Error in get_version expected 2..2 args, got 3 stack traceback: [C]: in function 'get_version' C:\a\ScriptingLanguageSupport\Lua1.lua:14: in main chunk [C]: in function 'dofile' stdin:1: in main chunk [C]: ? > It shows the error message that it is getting 3 arguments in function call. But I am passing only 2 arguments. Where is it getting the third argument from ?? Thanks Anurag --001636e0aef25010d50473340212 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
I wrote an extension of Lua. Now I am writing a Lua script which mak= es a call to a function in that extension.

signature of the function= is as follows
get_version(char* a, int b)


My Lua script is a= s follows

SUCCESS =3D 1
Version =3D '=A0=A0=A0=A0=A0=A0=A0=A0=A0 '=A0 = --=A0 # Create a 10 character buffer to store the version string
status = =3D extLua:get_version(Version,10)
if (status !=3D SUCCESS) then die (&q= uot;Returned bad status: $status") end
print("\nCurrent Version: " Version "\n")
print(&q= uot;\nEnd of example\n")

When I run the script file this is wha= t I get

> dofile("C:\\a\\ScriptingLanguageSupport\\Lua1.lua&= quot;)
Error in get_version expected 2..2 args, got 3
stack traceback:
=A0= =A0=A0=A0=A0=A0=A0 [C]: in function 'get_version'
=A0=A0=A0=A0= =A0=A0=A0 C:\a\ScriptingLanguageSupport\Lua1.lua:14: in main chunk
=A0= =A0=A0=A0=A0=A0=A0 [C]: in function 'dofile'
=A0=A0=A0=A0=A0=A0=A0 stdin:1: in main chunk
=A0=A0=A0=A0=A0=A0=A0 [C]: = ?
>

It shows the error message that it is getting 3 arguments = in function call. But I am passing only 2 arguments. Where is it getting th= e third argument from ??

Thanks
Anurag
--001636e0aef25010d50473340212-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 04:26:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A7QKEt032517; Thu, 10 Sep 2009 04:26:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD77C190B5; Thu, 10 Sep 2009 04:26:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F296718F13 for ; Thu, 10 Sep 2009 04:25:49 -0300 (BRT) Received: by bwz10 with SMTP id 10so3176730bwz.5 for ; Thu, 10 Sep 2009 00:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bcG+gTWHnfxgeqyS5hvyqkOfxicJEupo0CBm80/4CQ8=; b=uZAddrGvpTBVMcd/5PneRwsC/fKgPSkybpE5kJzt5suUX6/nLcnmQq5cIGQ1L+H9wH jA4wVgapQO7FLv9FJixnmI+w3wFdEYWrXmSLtaaqpDgze8tvVOL+6v6yDEZIVpgMnk11 y8q4EPeEPyKlZWQqu5tQgYf7VdvlTmti/FDjc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pKtyxQ/AUd9QcEyNBiFU/IU9FxHISRGfUxyB1QJxasaq9rHFUqsXg8MHJWkixGFQHQ jFMGwgpg+dUs68ED5conRv6+V96N8+7VDDk7Jr3ZQXx7m9NEWvVaoX5zV20BAX07ix/u 71B7GVK6LkO/fCSgHh1C6MMpOGo3EdguotplA= MIME-Version: 1.0 Received: by 10.204.151.209 with SMTP id d17mr638882bkw.120.1252567547961; Thu, 10 Sep 2009 00:25:47 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Sep 2009 09:25:47 +0200 Message-ID: <560972290909100025n47fe181dk757e7815ff8f04a1@mail.gmail.com> Subject: Re: Where is the third argument????? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 10, 2009 at 9:18 AM, Anurag Sharma wrote: > signature of the function is as follows > get_version(char* a, int b) > status = extLua:get_version(Version,10) Using the colon here causes the trouble; that line is exactly equivalent to status = extLua.get_version(extLua,Version,10) So you are passing 3 parameters! Just use a dot and see what happens steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 04:31:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A7VTLe000662; Thu, 10 Sep 2009 04:31:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C94A619182; Thu, 10 Sep 2009 04:31:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4095318F13 for ; Thu, 10 Sep 2009 04:30:58 -0300 (BRT) Received: by ewy26 with SMTP id 26so4928600ewy.5 for ; Thu, 10 Sep 2009 00:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=WvXpaVoCZjBJnfIrvbE1IVhwHi/nVxkCze2XWqCcQ/8=; b=AdZQYMj+cXGWHSgh/jpNFYxFqhgDwEgKDSLcQpXOgJfcfP0IE+etma/+GJCyKuUe4X PDChO8ywhEv+LuB4UCa22dk9XrMN67Hpn4tE/ErSdRMPX6miJQniyVGpqrnBJfTHAWoW cXK9B+bVscgbc9R66KlM4pzi8wp5WYrqWCebw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=sPPD2lOq2SjIHYKzCOKDLG0Mp0A9mtpAJO2r9VPCQLnkMWwvXDuAiZF+7mK78ZchzR nLutyh2E7Wx7TyPZZADrweTwgBXnEfRgH3YrkO2/pd6+kJBzodukJzY3ewrez6/PoNnB WvOu7cBIH1iEW4hrrETQK8cLFFnO18xVfucjI= Received: by 10.211.158.15 with SMTP id k15mr1338219ebo.25.1252567856268; Thu, 10 Sep 2009 00:30:56 -0700 (PDT) Received: from ?95.78.70.81? ([95.78.70.81]) by mx.google.com with ESMTPS id 28sm4696870eyg.27.2009.09.10.00.30.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Sep 2009 00:30:55 -0700 (PDT) Date: Thu, 10 Sep 2009 11:30:51 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1844816080.20090910113051@gmail.com> To: Anurag Sharma Subject: Re: Where is the third argument????? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Anurag, Thursday, September 10, 2009, 11:18:21 AM, you wrote: > status = extLua:get_version(Version,10) > It shows the error message that it is getting 3 arguments in > function call. But I am passing only 2 arguments. Where is it > getting the third argument from ?? it is equivalent to status = extLua.get_version(extLua,Version,10) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 05:07:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A87FKd003831; Thu, 10 Sep 2009 05:07:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D8050191B7; Thu, 10 Sep 2009 05:06:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f195.google.com (mail-px0-f195.google.com [209.85.216.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 189F719027 for ; Thu, 10 Sep 2009 05:06:34 -0300 (BRT) Received: by pxi33 with SMTP id 33so4940463pxi.11 for ; Thu, 10 Sep 2009 01:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=TPaPesZK1q3vCKsPHMZaz/8h2E9oJ7GP77UpDfmao3U=; b=joPpXHEju9NyFmBR2xHbR0bPmxOyNL1L+D74SJ2HcZP7c1zz4/1WEiSoZ7tWcOpiwS Vh0A5z8KMM5+ApMCZvpE38Lyy5Wnxugp55SkHOf3GDgTBfQE5A+edLOCaLORSU4nSM6/ hhiK9f/69CCte3wx5X5selsyWfyVGcmqqt38A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=vqFA9m6c8tbXHE3qQmob2HUN0GF5FymCsj5zx2Z0GYKyFKlY/ucGUNkE64LLjUHi// VbcC7u5Y1l4M7UH5Qhi3f7h+DoDDhRSTJeRjyqPQv3xE5UKZ1iqKOjRx4e0r5k0XoMdO myeFDvuqFAfUmYW4eBYiIPFqH12atpPRwAEDs= MIME-Version: 1.0 Received: by 10.143.138.7 with SMTP id q7mr149320wfn.314.1252569994137; Thu, 10 Sep 2009 01:06:34 -0700 (PDT) In-Reply-To: <560972290909100025n47fe181dk757e7815ff8f04a1@mail.gmail.com> References: <560972290909100025n47fe181dk757e7815ff8f04a1@mail.gmail.com> From: Anurag Sharma Date: Thu, 10 Sep 2009 13:36:14 +0530 Message-ID: Subject: Re: Where is the third argument????? To: Lua list Content-Type: multipart/alternative; boundary=000e0cd5f6fa8e93e6047334ad20 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd5f6fa8e93e6047334ad20 Content-Type: text/plain; charset=ISO-8859-1 Thank you Steve and Bhulat for relying. I replaced : with a . it works Thanks again Anurag On Thu, Sep 10, 2009 at 12:55 PM, steve donovan wrote: > On Thu, Sep 10, 2009 at 9:18 AM, Anurag Sharma > wrote: > > signature of the function is as follows > > get_version(char* a, int b) > > > status = extLua:get_version(Version,10) > > Using the colon here causes the trouble; that line is exactly equivalent to > > status = extLua.get_version(extLua,Version,10) > > So you are passing 3 parameters! > > Just use a dot and see what happens > > steve d. > --000e0cd5f6fa8e93e6047334ad20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you Steve and Bhulat for relying.
I replaced : with a .

it = works

Thanks again

Anurag
On T= hu, Sep 10, 2009 at 12:55 PM, steve donovan <steve.j.donovan@gmail.com> wrote:
On Thu, Sep 10, 2009 at 9:18 AM, Anurag Sharma
<anurag.sharma.101@gmail.= com> wrote:
> signature of the function is as follows
> get_version(char* a, int b)

> status =3D extLua:get_version(Version,10)

Using the colon here causes the trouble; that line is exactly equival= ent to

status =3D extLua.get_version(extLua,Version,10)

So you are passing 3 parameters!

Just use a dot and see what happens

steve d.

--000e0cd5f6fa8e93e6047334ad20-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 06:01:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A913Z2008077; Thu, 10 Sep 2009 06:01:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C783F18E5E; Thu, 10 Sep 2009 06:00:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0723018D64 for ; Thu, 10 Sep 2009 06:00:29 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 4so871009eyf.5 for ; Thu, 10 Sep 2009 02:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=7ZGfRKM/y4c3Klgl3Cp2soOeA+8JniclsEE9R4Jf8sM=; b=GGVwhtwRQ4GFH1sFoRSK9V5ZasiSwszNDig76oD5Mqmc+bQM8UR1LhbpbFgqqoq51M zi9qc3ybZZxqtrC7XXHrUT9N00hPBEh8gNCYgpWnaBTc/XW2shlt0Rkpu2Qiafhgip+R pp/kCcW6dLXqCG5oWLlKOLQnX58fWjTsAOIZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=byMaW/uNj1E4GO2QZXQ0fIpUGcLR23c+vkALLhkqQ9yP8ozhcBlTIBSUg+eUrvQUCj bZ3h/2gBPtDmO8WOCFeBp1vJrbB+KiAQXmgzVWTW449QOVt8c1RqNU+Jkd/JFI9LYRWh IOp1IMceVzOJ7IEfffM3gHN6PRaL5GqDbB7hI= MIME-Version: 1.0 Received: by 10.216.88.209 with SMTP id a59mr296101wef.50.1252573228202; Thu, 10 Sep 2009 02:00:28 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Thu, 10 Sep 2009 11:00:08 +0200 Message-ID: <89d273ba0909100200w7f27f5d9j60c83acc5884512b@mail.gmail.com> Subject: Re: Announce: Darwin module system To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/10 Jim Jennings : > >> On Tue, 8 Sep 2009 11:59:01 +0200, Jerome Vuarand > >> Either you knew it and you purposefully omitted to mention it, or you >> didn't and in that case you may have underestimated the possibilities >> of the existing Lua module system. In both cases something feels wrong >> to me. > > It's certainly not polite to imply that I purposefully omitted this point. > Do you realize that by suggesting it, you are assaulting the integrity of a > person that you do not even know? Perhaps you were in a foul mood, or > feeling needlessly defensive. I didn't imply you did it on purpose, I just stated that it was a possibility. As you say I don't know you, and I have no way to know to what extent you may want to deliberately (and publicly) despise existing competitors of your new product (and I do realize you've stated it's not a direct competitor of the Lua module system). I'm glad to know it was not intentional, and I'm sorry you took it as an assault. People (not you, obviously) often don't understand the Lua module system very well. It's simple yet flexible and powerful. Not that long ago we had yet another verbose discussion on this mailing list because someone didn't want to take the 5 minutes necessary to understand how to preload LuaSocket in a transparent way. I'm just trying to correct any misrepresentation of that system, because I like it and I'd be sorry if it changed because some people who didn't get it did some lobbying against it. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 06:09:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A99fMG008786; Thu, 10 Sep 2009 06:09:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E93C418EF2; Thu, 10 Sep 2009 06:09:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24F3918E5B for ; Thu, 10 Sep 2009 06:09:12 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1439308eye.39 for ; Thu, 10 Sep 2009 02:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=NGOHIvX8oqswxSoYuyTq111Yj+1JiuBp1cqA7mNTvGQ=; b=flupnwjtTBf3hbvFSvd8X10Lc+Ho3wdo1X1dDmnYF8wi78Tv5XGKyAIQZLGtMzuHZq x4uFcVTxz3ovZm1Fhw5Q7qi2NUPJl8+cZrVqrKrhXW/lX7tWYYcCvK5TEZNBWBgulrcb LfB/IlgNUUwFyXm5JuzjgInLR3zrvWf93T5Rs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=KG1DFRhZMOVayR8KF7XZmxNmZxiRlobjlhEu5Y9fMWd46DMKQEg+SJmBix7F4yV4p8 +NBIZaRRQFPEj+EXvzrUQ2VuDHfEVEfc/CyYEJzsSW8HmOC9quWzUGckASbS3c7yPF5+ FL4BJuSgEAE+uKe7Q58y4LDNRhHXJzmfomhUo= MIME-Version: 1.0 Received: by 10.216.88.3 with SMTP id z3mr283526wee.94.1252573751443; Thu, 10 Sep 2009 02:09:11 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Thu, 10 Sep 2009 11:08:51 +0200 Message-ID: <89d273ba0909100208g5900c123kc9453d9bcae88ea0@mail.gmail.com> Subject: Re: Where is the third argument????? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/10 Anurag Sharma : > I wrote an extension of Lua. Now I am writing a Lua script which makes a > call to a function in that extension. > > signature of the function is as follows > get_version(char* a, int b) > > > My Lua script is as follows > > SUCCESS = 1 > Version = ' ' -- # Create a 10 character buffer to store the version string > status = extLua:get_version(Version,10) > if (status != SUCCESS) then die ("Returned bad status: $status") end > print("\nCurrent Version: " Version "\n") > print("\nEnd of example\n") Strings in Lua are immutable. You probably noticed that lua_tostring returns a "const char*", not a "char*". It's wrong to overwrite the content of an existing Lua string. So either your get_version function don't work (ie. Version don't get changed), or you're overwriting a Lua string. A common way to return a value and signal success at the same time is to return nil on error (with an error/status message as second return value), and the value otherwise. You would then write your Lua code as follows: local Version = assert(extLua.get_version()) print("Current Version:", Version) From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 06:16:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8A9GXGe009423; Thu, 10 Sep 2009 06:16:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B80B2190AC; Thu, 10 Sep 2009 06:16:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D45E918EF0 for ; Thu, 10 Sep 2009 06:16:07 -0300 (BRT) Received: by ewy26 with SMTP id 26so4991690ewy.5 for ; Thu, 10 Sep 2009 02:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=UZBk2zNfZltFYuNXgdzHfyqFPB7s0l7sq+JKtgHDY5E=; b=t/HsS3gTEaRuemEHsyRaJKQuND+/jOi41skU90iuH77Vo1BIVxsG3b8cU2ySTQgnZE SPkDL90Fl91rQ5DO3WXJtisSkZ8gc5jzw14OH9ALuE8327i1YTb2pya/JprYFKEc142j OpifqYi+55Wlb+JK1Fk7FkMoGQwlKFV9cxYzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=Ls9Z04UgYW2G4KLqoRFK/A8UM5oJMFasAFVAXTi+zUGUdOy7S7VBPW6TO2MBQrwn23 LAKW5QAcAvo+VHGHZEkgB+uSil3pKv+07JANN+gtDQIFqbXutWU2GBa8uphThL6PJGyy 9oFq/AKsFSlRxhD40ajKAe+1QOGUezwAmhmjU= Received: by 10.210.7.21 with SMTP id 21mr1358759ebg.75.1252574166579; Thu, 10 Sep 2009 02:16:06 -0700 (PDT) Received: from ?95.78.70.81? ([95.78.70.81]) by mx.google.com with ESMTPS id 24sm386276eyx.4.2009.09.10.02.16.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Sep 2009 02:16:05 -0700 (PDT) Date: Thu, 10 Sep 2009 13:16:01 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <16910119690.20090910131601@gmail.com> To: Anurag Sharma Subject: Re: Where is the third argument????? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Anurag, Thursday, September 10, 2009, 11:18:21 AM, you wrote: > get_version(char* a, int b) > status = extLua:get_version(Version,10) well, the whole problem is that Lua and C calling conventions are quite different. so i wonder whether you have read PIL. may be this extLua is a package that provides some convenience, but passing Version by reference shouldn't work anyway -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 08:55:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ABtNqw024983; Thu, 10 Sep 2009 08:55:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9071D1911E; Thu, 10 Sep 2009 08:54:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A23018D5E for ; Thu, 10 Sep 2009 08:54:47 -0300 (BRT) Received: by pzk29 with SMTP id 29so23430pzk.14 for ; Thu, 10 Sep 2009 04:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=vosfJyi+HxaeF0HfCwuUhodLuMU3ds+c2/g4uQYoXv8=; b=lDa0tTxni4Jx8XBargLg2KLp0aYdxK79k44NjfvHkWiEOCyiPrFBcqH9KxTYQzMBkx e87WdtgroB7a0GT5mRFjhtry3M3iEw83nV7yB1ku8GzOPFWLjZUq1k2b0h3De5sOk4fU PMCb4D3bTC584EuCRWzRxKNnDkGdYOnowF3N4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=klBJD0lbvr/9x8Cw8KG+wwaEMXEDNLaSOw12uMBQMKH3rfFBRq9wOtB/XVv0qyJt0j 7GRSRyfUaCMuy/UnTYP1XhoguyzJn9jx7N7LQkAYmdfOebp0yMHZRYx2PkIZJ151BkyQ wpQxXSRHLcxFo4wHkrr2hhtg53gqIN/EZnTZI= MIME-Version: 1.0 Received: by 10.142.5.27 with SMTP id 27mr163454wfe.59.1252583686153; Thu, 10 Sep 2009 04:54:46 -0700 (PDT) From: Anurag Sharma Date: Thu, 10 Sep 2009 17:24:26 +0530 Message-ID: Subject: What is the equivalent of die() command of perl To: Lua list Content-Type: multipart/alternative; boundary=00504502b619aa2463047337dd0f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b619aa2463047337dd0f Content-Type: text/plain; charset=ISO-8859-1 There is a Die command in perl which terminates the program immediately and prints the message Die("Message"); Is there any equivalent in Lua.. If yes, what is it? Also, is there any tutorial or guide that teaches Lua to perl programmers. thanks Anurag --00504502b619aa2463047337dd0f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable There is a Die command in perl which terminates the program immediately and= prints the message

Die("Message");

Is there any eq= uivalent in Lua.. If yes, what is it?

Also, is there any tutorial or= guide that teaches Lua to perl programmers.

thanks
Anurag
--00504502b619aa2463047337dd0f-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 09:01:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AC1XvH025996; Thu, 10 Sep 2009 09:01:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99E0719276; Thu, 10 Sep 2009 09:01:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout3.freenet.de (mout3.freenet.de [195.4.92.93]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 690D618D5E for ; Thu, 10 Sep 2009 09:01:08 -0300 (BRT) Received: from [195.4.92.22] (helo=12.mx.freenet.de) by mout3.freenet.de with esmtpa (ID lunoxos@freenet.de) (port 25) (Exim 4.69 #92) id 1MliKm-00037k-Az for lua@bazar2.conectiva.com.br; Thu, 10 Sep 2009 14:01:04 +0200 Received: from ip-vlan-obckunde-02-217-66-60-14.pixelpark.net ([217.66.60.14]:40560 helo=[192.168.12.93]) by 12.mx.freenet.de with esmtpa (ID lunoxos@freenet.de) (port 25) (Exim 4.69 #94) id 1MliKl-0000Tr-Ti for lua@bazar2.conectiva.com.br; Thu, 10 Sep 2009 14:01:04 +0200 Message-ID: <4AA8EA77.4050405@dracoblue.de> Date: Thu, 10 Sep 2009 14:00:55 +0200 From: =?ISO-8859-1?Q?Jan_Sch=FCtze?= User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: What is the equivalent of die() command of perl References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, you can actually do the following: print("Message") os.exit() to receive the same result. Actually if I also want a stacktrace I usually use: error("Message") whats more like an "exception". - Jan Anurag Sharma schrieb: > There is a Die command in perl which terminates the program > immediately and prints the message > > Die("Message"); > > Is there any equivalent in Lua.. If yes, what is it? > > Also, is there any tutorial or guide that teaches Lua to perl programmers. > > thanks > Anurag From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 09:09:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AC9KtG026854; Thu, 10 Sep 2009 09:09:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C656192A7; Thu, 10 Sep 2009 09:09:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32EE919051 for ; Thu, 10 Sep 2009 09:08:54 -0300 (BRT) Received: by fxm18 with SMTP id 18so41058fxm.5 for ; Thu, 10 Sep 2009 05:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=J8MqyYCBIhcILBiHcrzyRIob7AxkUfTWlPsVr+XmJeQ=; b=Sl0Ah31rwvbHNkdFNuHKs9MFhv2kzJOI1r8Ax/mZq0WcxwsBB+iOq787bZvaVhFBz/ DDIA4BgcFADyXRv4sj/3wgbMxiqRNeeboFmM2wVhAvdVoKvMAgo2pCr+f863GsvepOW0 afwTkk+oOeL/Hg6qQ3kUatZAXyjUYW9aNe0ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Q0OYq9ccJEwGbba8woA55+AdvHjaMSx/wKhjmR8zezWfkL3r4AAh9ny9qX2hVK+E8w Lzu8bssKx/d/+u/GSeJvu+vk9U+kipV3BJY0NgoKHVXDek5WclOBRrLzCP4iruTaON/G w1LXSFFVohEW5T4YUPBGFwBCxOLpL+S2///q0= MIME-Version: 1.0 Received: by 10.204.141.18 with SMTP id k18mr735546bku.139.1252584053782; Thu, 10 Sep 2009 05:00:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Sep 2009 14:00:53 +0200 Message-ID: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com> Subject: Re: What is the equivalent of die() command of perl From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 10, 2009 at 1:54 PM, Anurag Sharma wrote: > There is a Die command in perl which terminates the program immediately and > prints the message > > Die("Message"); > > Is there any equivalent in Lua.. If yes, what is it? Well error("message") would work, but you would also get a stack trace, which is not always so friendly for your users. So people will often do this, which gives a message and no stacktrace. function die (msg) io.stderr:write(msg,'\n') os.exit(1) end You can say things like this: a = myfunction() or die 'myfunction failed!' (note that the () is not necessary for functions with single string arguments) But you can't do this myfunction() or die 'finished!' Because expressions in Lua cannot be statements. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 09:10:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ACAOfA027041; Thu, 10 Sep 2009 09:10:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADEBB192C9; Thu, 10 Sep 2009 09:10:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FF2F19051 for ; Thu, 10 Sep 2009 09:09:55 -0300 (BRT) Received: by bwz10 with SMTP id 10so40351bwz.5 for ; Thu, 10 Sep 2009 05:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4JJEaWHP4uyGlqnaMDg001ddaYFF1pRY1Vugg3waAJ4=; b=dZ7Zy3DBp43cc+ljHLpZOgWRaeAqXLXFWjd4RzRziRkd+sayOOx00ahYwDu45ODvP7 czC+quY4/jCK3mh8x4CiJsoxdD7Puxyerw2bpXdgp2lNC+dwdAGN8qQq2D+SA9AzcA+z PqICLoYy82W0cLZElEAyvsDMDbS00NlQCmOew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lMfmlDyl2hfKBZ+q0R+CD7uzU9Jp6U9qBpwjm+fQQLmbQUg/A3isDLFLm6LNVwXrx3 EOpqOJ7x4LD83FCQyqkSUW54AfOEa3IRaDwmiO2yLj/D+tvo+ZECLytAHEchZoB9F4xT Zb94X5K06Z3L3pueC9OZhS6AOirJR7e4QrE/c= MIME-Version: 1.0 Received: by 10.204.7.197 with SMTP id e5mr878715bke.184.1252584595115; Thu, 10 Sep 2009 05:09:55 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Sep 2009 14:09:55 +0200 Message-ID: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> Subject: Re: What is the equivalent of die() command of perl From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 10, 2009 at 1:54 PM, Anurag Sharma wrote: > Is there any equivalent in Lua.. If yes, what is it? Lua also uses assert() a lot. For instance, assert(Myfunction(),"we failed") More interesting is this: f = assert(io.open(file)) ... This actually gives a sensible error trace, because if io.open fails it returns two values, nil and an error message. The second parameter of assert() is the message string, so it works as expected. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 09:47:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AClGv6000775; Thu, 10 Sep 2009 09:47:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38BFC19317; Thu, 10 Sep 2009 09:46:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A54E192A0 for ; Thu, 10 Sep 2009 09:46:45 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ACki2x000673 for ; Thu, 10 Sep 2009 09:46:44 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8ACkhd06791; Thu, 10 Sep 2009 09:46:43 -0300 Date: Thu, 10 Sep 2009 09:46:43 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: What is the equivalent of die() command of perl Message-ID: <20090910094643.A6783@lua.tecgraf.puc-rio.br> References: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com>; from steve.j.donovan@gmail.com on Thu, Sep 10, 2009 at 02:00:53PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Well error("message") would work, but you would also get a stack > trace, which is not always so friendly for your users. You could do this: debug.traceback=nil error("message") From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 10:06:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AD5uoK004054; Thu, 10 Sep 2009 10:05:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4957D19363; Thu, 10 Sep 2009 10:05:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26313191C8 for ; Thu, 10 Sep 2009 10:05:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so88921ewy.5 for ; Thu, 10 Sep 2009 06:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=RzqnmJbEVxQ5ZKEqAkM41GgMyMlBtLOqwkm1ARKmfO0=; b=Ch8LAxP8HPg4py/Yue7JK2z/dbKg+kBfMLUIKaR84k8Zvz+Rt7Ty0wYzuDnO6gXpST eXnCq41wLpugTn9Dq1qzwz/fLBxO4gpD6+Mr+HNA1JKk1xRq2f7y8WoNauMoAkzH3fr/ 3MEjR8c8hEc0fYY2OLRQTqOMhrVPOsysR9CkI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ov0n1LhkUt7YW6pHReiKflJZrSZzzhQhuErPLWCHTPAXrRl35foQjqB7TzMB9H5EMa 7jFm3vfRgVIKFIClni+3Hury3eB+5tH4Wnt5ZBhwmW6KLTUGaVQhjmxiVYDA+jHq7kdG bDuEDKqCG88tSatEpkoX3akukTMxJNL+6hM3g= MIME-Version: 1.0 Received: by 10.216.52.78 with SMTP id d56mr373414wec.143.1252587903173; Thu, 10 Sep 2009 06:05:03 -0700 (PDT) In-Reply-To: <20090910094643.A6783@lua.tecgraf.puc-rio.br> References: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com> <20090910094643.A6783@lua.tecgraf.puc-rio.br> From: Jerome Vuarand Date: Thu, 10 Sep 2009 15:04:43 +0200 Message-ID: <89d273ba0909100604s40425a52ha98fb3370bcc8e16@mail.gmail.com> Subject: Re: What is the equivalent of die() command of perl To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/10 Luiz Henrique de Figueiredo : >> Well error("message") would work, but you would also get a stack >> trace, which is not always so friendly for your users. > > You could do this: > debug.traceback=nil > error("message") Also if the script is embedded in a host application and run through lua_pcall you don't get the stack trace unless an errfunc is explictly provided. From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 12:58:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AFwoOI012911; Thu, 10 Sep 2009 12:58:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EFAA1936C; Thu, 10 Sep 2009 12:58:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3871619327 for ; Thu, 10 Sep 2009 12:58:11 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mlm27-0008VS-1J for lua@bazar2.conectiva.com.br; Thu, 10 Sep 2009 17:58:03 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Sep 2009 17:58:03 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Sep 2009 17:58:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Running Lua script file from Lua Console Date: Thu, 10 Sep 2009 17:57:40 +0200 Lines: 16 Message-ID: References: <200909090045.45978.bobby@sharedrealm.com> <87zl94ik1z.fsf@lola.goethe.zz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 09/09/2009 10:51, George Petsagourakis wrote: > It works on the cmd.exe so there is support for both back-slash and > forward-slash on windows. Yes, I use forward slashes a lot on the command line, because on a French keyboard, they are easier to type... And I use them even more in various languages, as we don't have to double them! The only culprit is that auto-completion (tab to complete the half-typed name) doesn't work with forward slashes... :-( -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Thu Sep 10 17:25:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8AKP36V018293; Thu, 10 Sep 2009 17:25:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC8B6192B2; Thu, 10 Sep 2009 17:24:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-125.bluehost.com (outbound-mail-125.bluehost.com [67.222.38.25]) by bazar2.conectiva.com.br (Postfix) with SMTP id 585691928F for ; Thu, 10 Sep 2009 17:24:18 -0300 (BRT) Received: (qmail 20801 invoked by uid 0); 10 Sep 2009 20:24:15 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy4.bluehost.com with SMTP; 10 Sep 2009 20:24:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=gagoqfJAROcxwEnssc09XENja7u2GJLFD4vvzd/wF8oqoKkUc4zwhD+i1s3EsEQ4BF48lPkH+h6KdmYEQb7+wpU3uOffdIvLKsfjw3+sorkB3TxQmjaBisSTNb7hfNC+; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MlqBj-0006SA-CB for lua@bazar2.conectiva.com.br; Thu, 10 Sep 2009 14:24:15 -0600 Date: Thu, 10 Sep 2009 16:24:12 -0400 From: TNHarris To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090910162412.1043e325@egeria.whoopdedo.org> In-Reply-To: <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 9 Sep 2009 10:05:08 +0100 "John Hind" wrote: > > I could not agree more - I think this proposal is a very bad one and I > am dismayed it is going forward. Pairs and ipairs only makes sense for > the generalised tables of base Lua. If you are specialising tables (or > userdata) with metamethods, it is very unlikely these will still be > relevant: you might want one or many iterators and "pairs" or "ipairs" > might, but probably will not, be relevant names. > Well, I'm only concerned about the names, not the form of the metamethods. And I concur with the reasoning for doing away with the implicit iterator. It's better to be explicit than to have hidden magic. I don't consider it bloat. I just anticipate someone expecting that "pairs" can only be used when the data is arranged as keys and values. With that confusion the metamethods are likely to be misused or ignored when they shouldn't be. Whatever it's called, though, I think the protocol is fine. Also, it occurs to me, could "pairs" take extra arguments that are passed to the metamethod? Although I can't think of a concrete example where it would be needed, so maybe that's a misfeature after all. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 00:11:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B3BsdW005659; Fri, 11 Sep 2009 00:11:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FD5D18C57; Fri, 11 Sep 2009 00:11:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2794518B7A for ; Fri, 11 Sep 2009 00:11:13 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8B3B8rl012110; Fri, 11 Sep 2009 12:11:08 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay11.aps.necel.com with ESMTP; Fri, 11 Sep 2009 12:11:08 +0900 Received: from dhlpc061 ([10.114.112.76] [10.114.112.76]) by relay11.aps.necel.com with ESMTP; Fri, 11 Sep 2009 12:11:08 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id A1E4952E1FA; Fri, 11 Sep 2009 12:11:08 +0900 (JST) From: Miles Bader To: steve donovan Subject: Re: What is the equivalent of die() command of perl References: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 11 Sep 2009 12:11:08 +0900 In-Reply-To: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> (steve donovan's message of "Thu, 10 Sep 2009 14:09:55 +0200") Message-ID: Lines: 15 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > f = assert(io.open(file)) > ... > This actually gives a sensible error trace, because if io.open fails > it returns two values, nil and an error message. The second parameter > of assert() is the message string, so it works as expected. Gee, never noticed that before... and lots of lua functions have exactly the right return profile to do this! -Miles -- Genealogy, n. An account of one's descent from an ancestor who did not particularly care to trace his own. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 02:28:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B5S4me016778; Fri, 11 Sep 2009 02:28:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 820FC18CE2; Fri, 11 Sep 2009 02:27:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CCF018BD4 for ; Fri, 11 Sep 2009 02:27:27 -0300 (BRT) Received: by vws33 with SMTP id 33so549069vws.33 for ; Thu, 10 Sep 2009 22:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GS4hvZRQF3rq5bx8NxXMeKHsmPsl4rrAPgGQieID1jI=; b=SmqOMrTtJe7b0e5IbrOyL2kQsBvr0JN9b9Am6dE6UXeq5y/cB+kkh5BoSO5AsgR+Ob wK9bsNwrRgxAJIgUsHch/Xppudv94rZSTrDbWFIIXm8tmVIN5Zbkc8wkfsYdUXWNJdJD ZwyfGnxTR0QTIclAmvUdKYbYEWLLHMmXnidJA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PtI2WGrk+YAFiPfAp1dVRCjqA2kFDvsD0FohpUsI3zDpNlRNEGyvZZVrdMCFJfIOyA yKsA4DMabhXNqohJCyQRoabqkkYgApTXDD0nztEapxgXZzAEmft6FI3IvpHWCFehH6hx +agRAlXLEjDgFpMt1wJHoF0OcCwPiyUmhPAgY= MIME-Version: 1.0 Received: by 10.220.112.204 with SMTP id x12mr2912716vcp.19.1252646845268; Thu, 10 Sep 2009 22:27:25 -0700 (PDT) In-Reply-To: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com> References: <560972290909100500h6d304b8bs4d14c31ca0eba064@mail.gmail.com> Date: Fri, 11 Sep 2009 13:27:25 +0800 Message-ID: <438c11350909102227i3cc51d9eu7b9dbd29b4a25de4@mail.gmail.com> Subject: Re: What is the equivalent of die() command of perl From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You will get a stack backtrace only when you have not catch the lua exception (use lua_pcall() in your C program to call your lua script and all exception catched, or use pcall() in your lua program). In fact you should always catch the lua exception in your host program since many lua functions may call error() and you should at least catch them in your main(). On Thu, Sep 10, 2009 at 8:00 PM, steve donovan wrote: > Well error("message") would work, but you would also get a stack > trace, which is not always so friendly for your users. So people will > often do this, which gives a message and no stacktrace. > From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 02:35:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B5Zb5B017289; Fri, 11 Sep 2009 02:35:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49FDA18D1B; Fri, 11 Sep 2009 02:35:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A99118BD6 for ; Fri, 11 Sep 2009 02:35:11 -0300 (BRT) Received: by vws33 with SMTP id 33so551353vws.33 for ; Thu, 10 Sep 2009 22:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0kwrwhMdNLx2g5C4wON7ily5dQdASXyBFoxqnyOgj7E=; b=fK//tVkIMPnClL8qWyk/LYBgmWW6J9kcNX5e9xHFgLxmmgO62tPBviiiS3DPAg5rP8 TI+1s6UlDtyoMDQv3TGe7Cccmw8JwPnjZAQZwsrW7sIuds5wtINkhmcDYGgZmv69Y5wQ xADDB0QOjXJReBI0gzL6m6ZTkSU7uMH7ECXX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UalUXM3gvScIBSBq8iN/lVV1VMjQEJqv3a4IqpS1s76WCb4wXSzaTAfSIng9JyRQJc S/9Cp7j4OADHw7mVTM/VHGREsEUBfQR1tEVy45JvvDpD0zkM1lcz9gZ2nwkb1HLXkTuB Vd4JkdLOGWkxcPWr7A4slMPDZhh5meEXkIJj0= MIME-Version: 1.0 Received: by 10.220.108.102 with SMTP id e38mr2911218vcp.71.1252647311314; Thu, 10 Sep 2009 22:35:11 -0700 (PDT) In-Reply-To: <4AA155A3.4000303@sct.microlink.com.br> References: <4AA155A3.4000303@sct.microlink.com.br> Date: Fri, 11 Sep 2009 13:35:11 +0800 Message-ID: <438c11350909102235se48038bq937511e5b090b350@mail.gmail.com> Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I don't know what you're talking about, statically compiling lua is as easy as including all lua sources into your project, statically compiling lua library is as easy as including all library sources into your project, if that isn't simple and easy, what is? On Sat, Sep 5, 2009 at 2:00 AM, Andre de Leiradella wrote: > Lua has always been simple and easily embeddable. It still is. But its > libraries aren't anymore. > > Cheers, > > Andre > From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 02:54:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B5sqQm018496; Fri, 11 Sep 2009 02:54:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B36CE18E58; Fri, 11 Sep 2009 02:54:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f200.google.com (mail-yx0-f200.google.com [209.85.210.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E18018BB2 for ; Fri, 11 Sep 2009 02:54:24 -0300 (BRT) Received: by yxe38 with SMTP id 38so1048340yxe.6 for ; Thu, 10 Sep 2009 22:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=I2XYGD3ZbdOJ3kLgqZRcjbLiGKTiMR1hC75wXuNeLCA=; b=BBpC2ksj5jYum8vT1L4Z+R6T34rBMvAzPjoa5PpTU/9hOjk4ORsiUNsonvjpndqpd+ lJ5UbcqJjS7o/UrlHQePe0Ims+EuhCfkeSgHzaZsbC0HQcX87pSEdWUDKh2mkqGA6qvr Z4O0jZEf+TxDYvmeKufXq3tAhGlQRddZnycYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=PyUJnw8FARiczEWQr8p6conN6sLW0YDyLL961Qip05ouclScaFQ1d//ObqfvjEdW2D k8+sErIzzCwpYs1di8Equ+1su9kWIFrxN9T/6rALH3prit765jnqOYg/lP0QF7eFagu9 34Z4FeogLiHBZCcOxCDsuZWr50kBhFXUzAVCU= Received: by 10.151.92.9 with SMTP id u9mr4240156ybl.158.1252648463250; Thu, 10 Sep 2009 22:54:23 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.54.151]) by mx.google.com with ESMTPS id 23sm904168ywh.7.2009.09.10.22.54.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 10 Sep 2009 22:54:22 -0700 (PDT) Message-ID: <4AA9E602.5080407@gmail.com> Date: Fri, 11 Sep 2009 13:54:10 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? (was Wishlists and Modules (was [ANN] libmc)) References: <4AA155A3.4000303@sct.microlink.com.br> <438c11350909102235se48038bq937511e5b090b350@mail.gmail.com> In-Reply-To: <438c11350909102235se48038bq937511e5b090b350@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean pan shizhu wrote: > I don't know what you're talking about, statically compiling lua is as > easy as including all lua sources into your project, statically > compiling lua library is as easy as including all library sources into > your project, if that isn't simple and easy, what is? Please, stop prolonging this thread, pretty pretty please. Andre was discussing something else. Please, please read more of the thread before jumping to conclusions and shooting away. Let's not start unnecessary back-and-forths again. If someone has something constructive to contribute, by all means start a new thread. But let this one die already... > On Sat, Sep 5, 2009 at 2:00 AM, Andre de Leiradella > wrote: >> Lua has always been simple and easily embeddable. It still is. But its >> libraries aren't anymore. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 04:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B7uMsS030278; Fri, 11 Sep 2009 04:56:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16A5818D75; Fri, 11 Sep 2009 04:55:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 283AA18B72 for ; Fri, 11 Sep 2009 04:55:48 -0300 (BRT) Received: by vws33 with SMTP id 33so590436vws.33 for ; Fri, 11 Sep 2009 00:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pZflo5KqISBXyL/WtdTDDdhtyReWTpHpuUhC+E/4pdQ=; b=xWL/g3IsZoVw3WlaKPwrJ32QbesWwsWFRvOUjJEXd6KkvPdfD1oikhrsrAmxaEkzbk JLjbcF4ItQtrLZtW8/X0S2Y8/9lABAEbdDTsfslGwM1B9lusfx+TL422COXQnP2CPQy6 upuJomHEEym62tqtmYCziMbdpoJCC2F2SlI8Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Psp2Jyb1f/FDtU21DZ258WgrHYLntnLPFSNA+3iDW8ZCtVVJJ/3vEcnumaq9mtwG7t uNc9QGkjoeqqhAiIUvSNrtPajN5Tepath+Ev1gAQjkeTN/VFQK0TcWTh3IhFc4QsutMF gBrGJeT8IzU1ElUsznTCcppxdkB9B7b7CRZ/Y= MIME-Version: 1.0 Received: by 10.220.78.213 with SMTP id m21mr2819522vck.99.1252655747690; Fri, 11 Sep 2009 00:55:47 -0700 (PDT) In-Reply-To: <540E6A28-A007-416A-B834-1382C826B779@gmail.com> References: <4AA65DA4.2090109@cowlark.com> <540E6A28-A007-416A-B834-1382C826B779@gmail.com> Date: Fri, 11 Sep 2009 15:55:47 +0800 Message-ID: <438c11350909110055yc189096wb998e349cad2ebf8@mail.gmail.com> Subject: Re: The source file culture From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lua is designed as a language to be embbeded. AFAIK it has two typical use: 1. to be embbeded in a product, and the users are end-users of the product, i.e. non-programmers who should *not* add library to the lua script. I usually design programms like this: if user can write the lua script, I will restrict the use of "import". The libraries are executed in the same thread of the hosting program instead of a sandbox, we should not let end-users to add libraries. 2. to be used by the programmer himself, I embbed lua into my C program because I use it, end-user of my program cannot see or change the lua scripts. In this case I compile all library and statically link with my program and release with my program. For this use, I definetly need the C source. Yes, there may be users who use lua as a general-purpose stand-alone scripting language, but IMHO the vast majority of lua use, is to be used within another product, for which, only the original programmers should be able to add libraries, end-user are not expected to add libraries. IMO release windows-based binraries to the relatively small amount of users doesn't seem to help a lot. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 05:20:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B8KW5X032479; Fri, 11 Sep 2009 05:20:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84B2718D35; Fri, 11 Sep 2009 05:20:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B19F818A5B for ; Fri, 11 Sep 2009 05:20:04 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mm1MM-0001pF-Df for lua@bazar2.conectiva.com.br; Fri, 11 Sep 2009 08:19:58 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090910162412.1043e325@egeria.whoopdedo.org> In-Reply-To: <20090910162412.1043e325@egeria.whoopdedo.org> Subject: RE: Regarding the name 'pairs' Date: Fri, 11 Sep 2009 09:19:01 +0100 Message-ID: <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoyVM9MqJBYE+7GT8Obx9sZt0u7+wAXwP5A Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean But how would you have a generalised name that would be appropriate in diverse cases? If there was only one iterator, this would work, call it something generic like "iter", but if you have two (as at present) you need to distinguish them by function and this raises the question, why not three or four? The other problem is that it is the name of the library function ("pairs" or "ipairs") that the "user" sees, not the name of the corresponding (proposed) metamethods. On the "__iter" proposal this would work exactly like the "__call" trick except that "__iter" would apply in the context of generic for only, while "__call" would continue to apply in all other cases. So you would be able to pass parameters to the iterator (more formally the "iterator factory") just as you can now with the "__call" trick. It is important to realise that the "__pairs" and "__ipairs" proposal is not just the "__iter" proposal with a different name. The latter requires core language changes while the former is a very shallow and minor change which effects only the "pairs" and "ipairs" functions in the base library - they would delegate to the like-named metamethods if present or do what they do now if not. This is similar to the way the "__tostring" metamethod works with the "print" library function. I am coming round to the attractions of the "method" proposal for multiple iterators - the one where you can write: for v in myobject:myiterator do print(v) end All this requires is a change to the parser so it does not require the empty parenthesis for a method call when the only passed parameter is the "hidden" object reference. This approach has the advantage of allowing us to define as many iterators (iterator factories) as we want and call them whatever we want. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of TNHarris > Sent: 10 September 2009 21:24 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > On Wed, 9 Sep 2009 10:05:08 +0100 > "John Hind" wrote: > > > > I could not agree more - I think this proposal is a very bad one and > I > > am dismayed it is going forward. Pairs and ipairs only makes sense > for > > the generalised tables of base Lua. If you are specialising tables > (or > > userdata) with metamethods, it is very unlikely these will still be > > relevant: you might want one or many iterators and "pairs" or > "ipairs" > > might, but probably will not, be relevant names. > > > > Well, I'm only concerned about the names, not the form of the > metamethods. And I concur with the reasoning for doing away with the > implicit iterator. It's better to be explicit than to have hidden > magic. > I don't consider it bloat. > > I just anticipate someone expecting that "pairs" can only be used when > the data is arranged as keys and values. With that confusion the > metamethods are likely to be misused or ignored when they shouldn't be. > Whatever it's called, though, I think the protocol is fine. > > Also, it occurs to me, could "pairs" take extra arguments that are > passed to the metamethod? Although I can't think of a concrete example > where it would be needed, so maybe that's a misfeature after all. > > -- tom > telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 05:25:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B8PojN000432; Fri, 11 Sep 2009 05:25:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1034B18D64; Fri, 11 Sep 2009 05:25:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF9E118B51 for ; Fri, 11 Sep 2009 05:25:22 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mm1RY-00061y-3I for lua@bazar2.conectiva.com.br; Fri, 11 Sep 2009 08:25:20 +0000 From: "John Hind" To: "'Lua list'" References: <4AA65DA4.2090109@cowlark.com> <540E6A28-A007-416A-B834-1382C826B779@gmail.com> <438c11350909110055yc189096wb998e349cad2ebf8@mail.gmail.com> In-Reply-To: <438c11350909110055yc189096wb998e349cad2ebf8@mail.gmail.com> Subject: RE: The source file culture Date: Fri, 11 Sep 2009 09:24:23 +0100 Message-ID: <001b01ca32b9$44df8bc0$ce9ea340$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoytV+6dQiTAVxbSdC1h8wqNneABwAA11oA Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think you have hit the nail on the head here. If we want to take Lua in the direction of a general scripting language we need a more comprehensive and standardised runtime implementation and the module system should be part of the runtime not part of the language itself. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of pan shizhu > Sent: 11 September 2009 08:56 > To: Lua list > Subject: Re: The source file culture > > Lua is designed as a language to be embbeded. AFAIK it has two typical > use: > > 1. to be embbeded in a product, and the users are end-users of the > product, i.e. non-programmers who should *not* add library to the lua > script. I usually design programms like this: if user can write the > lua script, I will restrict the use of "import". The libraries are > executed in the same thread of the hosting program instead of a > sandbox, we should not let end-users to add libraries. > > 2. to be used by the programmer himself, I embbed lua into my C > program because I use it, end-user of my program cannot see or change > the lua scripts. In this case I compile all library and statically > link with my program and release with my program. For this use, I > definetly need the C source. > > > Yes, there may be users who use lua as a general-purpose stand-alone > scripting language, but IMHO the vast majority of lua use, is to be > used within another product, for which, only the original programmers > should be able to add libraries, end-user are not expected to add > libraries. > > IMO release windows-based binraries to the relatively small amount of > users doesn't seem to help a lot. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 06:05:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B950rs004002; Fri, 11 Sep 2009 06:05:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E117118ED1; Fri, 11 Sep 2009 06:04:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD30718D5E for ; Fri, 11 Sep 2009 06:04:23 -0300 (BRT) Received: by fxm18 with SMTP id 18so779736fxm.5 for ; Fri, 11 Sep 2009 02:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=K5CU+My7FDlOuDIW/xHh1wrLnLDSxw6+c97CzEyOde8=; b=WiTDwuv9fyK0MYpgBn9Xg9RvdiLmKPDiZn9bclcB2xTllGS1TpvUisWqCrRmZMugSC ZHnoyJiadtP+fRVSE6J82IPgTSBl6qJ96eu4zcIaFo3No8v1IfVJtdOf8Vg7F8Y0wED5 4In/JbX8Qx2Bf3GI4Ig3JqtEXTk3f9rrX7IAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JhFe/WNnXKeMYQ3Na1G+/arLJy78+2IImcY4PXKkacIEJ1WNYomB4BQJe2zIHWhXjA 90reRIRYd+krxgDBqP9wwGT8UlPuP79dN2wxCxRy76v5WXerQLXqFvAIaFPIBFKFXwUi T/LM1dte5qmvunL3SiLjsdFvb33ANu3fOkNZQ= MIME-Version: 1.0 Received: by 10.204.160.66 with SMTP id m2mr1848320bkx.156.1252659863319; Fri, 11 Sep 2009 02:04:23 -0700 (PDT) In-Reply-To: <1997517301161778048@unknownmsgid> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> Date: Fri, 11 Sep 2009 11:04:23 +0200 Message-ID: <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 11, 2009 at 10:19 AM, John Hind wrote: > I am coming round to the attractions of the "method" proposal for multiple > iterators - the one where you can write: > > for v in myobject:myiterator do print(v) end So one doesn't have to say? for v in myobject:myiterator() do print(v) end This seems a wee bit odd, to make a core change so that we save two characters and end up confusing people anyway. Currently obj:method has no meaning without the parentheses. There has been a proposal from Mark Hamburg that it should mean a closure that works like this: function (...) return obj:method(...) end This would be a useful shortcut for functional styles where you would be passing functions for 'bulk' operations on tables, although again there are possibilities for confusion which may make this not desirable. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 06:20:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8B9KcaW005396; Fri, 11 Sep 2009 06:20:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F34819107; Fri, 11 Sep 2009 06:20:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E813D190E0 for ; Fri, 11 Sep 2009 06:20:10 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8B9K7N8024794; Fri, 11 Sep 2009 18:20:07 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay21.aps.necel.com with ESMTP; Fri, 11 Sep 2009 18:20:07 +0900 Received: from dhlpc061 ([10.114.112.76] [10.114.112.76]) by relay21.aps.necel.com with ESMTP; Fri, 11 Sep 2009 18:20:07 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 99F1B52E1FA; Fri, 11 Sep 2009 18:20:07 +0900 (JST) From: Miles Bader To: steve donovan Subject: Re: Regarding the name 'pairs' References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 11 Sep 2009 18:20:06 +0900 In-Reply-To: <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> (steve donovan's message of "Fri, 11 Sep 2009 11:04:23 +0200") Message-ID: Lines: 17 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: >> for v in myobject:myiterator do print(v) end > > This seems a wee bit odd, to make a core change so that we save two > characters and end up confusing people anyway. Yup, this proposal doesn't make much sense to me... [Whereas the alternate proposal, to just make foo:bar without parens do the "obvious" thing, and return a closure that captures foo, makes quite a lot of sense -- on the surface at least, it seems to be very natural behavior.] -Miles -- Year, n. A period of three hundred and sixty-five disappointments. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 07:04:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BA4cE0008924; Fri, 11 Sep 2009 07:04:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A56B1911E; Fri, 11 Sep 2009 07:04:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4C9B190B5 for ; Fri, 11 Sep 2009 07:04:07 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mm2z7-0003SB-9A for lua@bazar2.conectiva.com.br; Fri, 11 Sep 2009 10:04:05 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> In-Reply-To: Subject: RE: Regarding the name 'pairs' Date: Fri, 11 Sep 2009 11:03:08 +0100 Message-ID: <001f01ca32c7$10974430$31c5cc90$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoywSVWlfJB2dYWSlWQWYFL5WAFlgAA74Yw Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You only get one disappointment a day? Lucky boy! I guess "obvious" is in the eye of the beholder - this is not at all obvious to me! On the other hand, using the "__call" metamethod you CAN write: for v in myobject do print(v) end without the empty parenthesis, which seems inconsistent since both cases are ultimately just function calls. The generic for is an easily distinguished "special" context, so it would not be unreasonable for behaviour to be different between "in" and "do" from other contexts. The annoying thing here is I keep getting "but you can do that anyway if you make a few compromises" type answers. But "__pairs" and "__ipairs" seems to be going forward, and this really is a trivial change that anyone interested can easily do themselves with the current version (just replace the global pairs and ipairs functions with your own). > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Miles Bader > Sent: 11 September 2009 10:20 > To: steve donovan > Cc: Lua list > Subject: Re: Regarding the name 'pairs' > > steve donovan writes: > >> for v in myobject:myiterator do print(v) end > > > > This seems a wee bit odd, to make a core change so that we save two > > characters and end up confusing people anyway. > > Yup, this proposal doesn't make much sense to me... > > [Whereas the alternate proposal, to just make foo:bar without parens do > the "obvious" thing, and return a closure that captures foo, makes > quite > a lot of sense -- on the surface at least, it seems to be very natural > behavior.] > > -Miles > > -- > Year, n. A period of three hundred and sixty-five disappointments. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 07:10:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BAAVVm009367; Fri, 11 Sep 2009 07:10:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7C751926C; Fri, 11 Sep 2009 07:10:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DA2619180 for ; Fri, 11 Sep 2009 07:10:00 -0300 (BRT) Received: by fxm18 with SMTP id 18so818805fxm.5 for ; Fri, 11 Sep 2009 03:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=o98Ozwf+UYayhOqi1qnrC27VlSlKN/yE8t749T79NxE=; b=sscqBodAOtkU7q7DRAo831dDBYJw5R6yNaymIpSfS3l0OK4cFvZcVqymGIHWFaqqGb ubTx0lXTsvZjh7gybXIG9+PBzWLDYc60Ecb2ZJE03msqfhi1GtoeNcj+5mVDsuRBtzlh n8iNLFgDGWiK/RlGzhOMDDXVyAL2zYp+R1yqg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IbWLuuILqep+MNh3u3apq7Lg6lgvlAek0Wed6aomdSkm14Cxwpi0v9QLisxNLiyXHc AhTuNtpX9ld1503U6tZ0rXCwei0sWf65t0fpmR2xPd7+IeeplPUisULwmkGPJ8EG+i2a Bo8SmlAOPcnS+ZUvhCwtOqKXksyjycCuCOp1I= MIME-Version: 1.0 Received: by 10.204.152.204 with SMTP id h12mr1900032bkw.97.1252663799794; Fri, 11 Sep 2009 03:09:59 -0700 (PDT) In-Reply-To: <3443661759085753372@unknownmsgid> References: <4AA65DA4.2090109@cowlark.com> <540E6A28-A007-416A-B834-1382C826B779@gmail.com> <438c11350909110055yc189096wb998e349cad2ebf8@mail.gmail.com> <3443661759085753372@unknownmsgid> Date: Fri, 11 Sep 2009 12:09:59 +0200 Message-ID: <560972290909110309q6041ccccu8187cc1e75c054a5@mail.gmail.com> Subject: Re: The source file culture From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 11, 2009 at 10:24 AM, John Hind wrote: > If we want to take Lua in the direction of a general scripting language we > need a more comprehensive and standardised runtime implementation Well, I think the community has certainly provided all the bits necessary for general scripting, but the trouble is of course when we talk about 'standardized', given that this will involve getting cats to self-herd. Standardization involves a lot of work, mostly on the level of 'what is the signature of the optional function os.sleep?' and 'should access() be in the io or osex namespace?'. It will then require buy-in, and an inevitable time of confusion when the same facilities are available from two locations, the old and the new. It's the latter step which is awkward. > and the module system should be part of the runtime not part of the language itself. Well, technically the module system is a library and was for a time implemented in Lua. pan shizhu says: > IMO release windows-based binraries to the relatively small amount of users doesn't seem to help a lot. Fortunately, it's already happening and should not cause problems for those who don't like the idea ;) Restricting the language and its libraries because it goes beyond some common uses seems ... well, restrictive. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 07:13:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BADjKJ009653; Fri, 11 Sep 2009 07:13:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 962C81928D; Fri, 11 Sep 2009 07:13:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20FE419180 for ; Fri, 11 Sep 2009 07:13:19 -0300 (BRT) Received: by bwz10 with SMTP id 10so829332bwz.5 for ; Fri, 11 Sep 2009 03:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mCoAlqpOi3B9r8bWXc5BQijul9Pxe4yvK+H++OR5wFQ=; b=JoTc8/ez9Hmyo1UgkaYpedTY5QvlqP65yBIMAtIfqUbsiAvjAHCHgov2inaeT7ykOl llwAqdlDubietC85yAzfviBO4yYLhbqWcqS5QzQ1c+7Z3rPWhcSQBsJX2MbOoywF7GXJ 7+YXUxq64ahcRfEkAhSfXFtalNadc2TK4ZdCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KqRkhyw/0V27+/BhvurCSY7vEfHx/5XOaBJu7aBxoUupXQGOFXT6LngQUHCUTP8Nbd 2Gy7HIWMkTB3gZ7s8S/9RR/tvoeH5GF/wDeLmr0BRwwA+1Y/jLtL91WcnIOMBUbk/RIa qjy3Er9hJ/ZllLm3Zx3SH0Q1kuaxU56FjpyYQ= MIME-Version: 1.0 Received: by 10.204.7.144 with SMTP id d16mr1887198bkd.209.1252663999545; Fri, 11 Sep 2009 03:13:19 -0700 (PDT) In-Reply-To: <-6066606879044904753@unknownmsgid> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> <-6066606879044904753@unknownmsgid> Date: Fri, 11 Sep 2009 12:13:19 +0200 Message-ID: <560972290909110313x702b750cm3872120fd0fe055b@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 11, 2009 at 12:03 PM, John Hind wrote: > On the other hand, using the "__call" metamethod you CAN write: > > for v in myobject do print(v) end > > without the empty parenthesis, which seems inconsistent since both cases are > ultimately just function calls. Yes, because myobject is callable. But myobject:iter() _returns_ a callable, usually a closure that contains iterator state. That's the difference. PS, I do agree that __ipairs and __pairs seems silly. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 10:11:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BDAwbk000584; Fri, 11 Sep 2009 10:10:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65CCA192AD; Fri, 11 Sep 2009 10:10:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90C571926D for ; Fri, 11 Sep 2009 10:10:18 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mm5tI-0005OQ-5M for lua@bazar2.conectiva.com.br; Fri, 11 Sep 2009 13:10:16 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> <560972290909110204p27d0f507qe06c89da9986dac3@mail.gmail.com> <-6066606879044904753@unknownmsgid> <560972290909110313x702b750cm3872120fd0fe055b@mail.gmail.com> In-Reply-To: <560972290909110313x702b750cm3872120fd0fe055b@mail.gmail.com> Subject: RE: Regarding the name 'pairs' Date: Fri, 11 Sep 2009 14:09:19 +0100 Message-ID: <002c01ca32e1$1303d890$390b89b0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoyyJIhp2JGyw/5RsuX7OmVdAsXYAAFmJ1w Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks for the support on "__pairs" and "__ipairs". But is your other point really true? With "__call", the parser resolves a call of the function in the metatable under the index "__call" passing the iterable object. With the method approach, the parser resolves a call of the function in the metatable under the index of the method name, again passing the iterable object. In both cases, the function call must return the same values the pairs or ipairs functions would return, i.e. a function to do the iteration, the object to be iterated and nil. It seems to me that the only difference is the "syntactic sugar": the method call is transformed by a pre-processor before being parsed while the call via the metamethod is parsed directly. The pre-processor and the parser seem to be using different rules to recognise a call. Of course I cannot test this, since once the "syntactic sugar" is expanded out, there is a parameter and so you need the parenthesis! > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of steve donovan > Sent: 11 September 2009 11:13 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > Yes, because myobject is callable. But myobject:iter() _returns_ a > callable, usually a closure that contains iterator state. > > That's the difference. > > PS, I do agree that __ipairs and __pairs seems silly. > > steve d. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 14:59:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BHsQUo008250; Fri, 11 Sep 2009 14:54:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03DF11A59E; Fri, 11 Sep 2009 14:53:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bitdojo.org (bitdojo.org [200.46.204.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38231A54F for ; Fri, 11 Sep 2009 14:53:47 -0300 (BRT) Received: from maia.hub.org (unknown [200.46.204.183]) by bitdojo.org (Postfix) with ESMTP id 8B7B6E0A30F for ; Fri, 11 Sep 2009 17:53:44 +0000 (UTC) Received: from bitdojo.org ([200.46.204.210]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 49589-07 for ; Fri, 11 Sep 2009 17:53:44 +0000 (UTC) Received: from Haiku.local (unknown [128.164.156.224]) by bitdojo.org (Postfix) with ESMTPA id 266FCE0A30E for ; Fri, 11 Sep 2009 17:53:44 +0000 (UTC) Message-ID: <4AAA8EA7.1040806@bluedino.net> Date: Fri, 11 Sep 2009 13:53:43 -0400 From: "Matthew M. Burke" User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is a Lua system easily embeddable? References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> <003801ca2fd1$2bcc7390$83655ab0$@hind@zen.co.uk> In-Reply-To: <003801ca2fd1$2bcc7390$83655ab0$@hind@zen.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ok, I know I'm a little late coming to this party, but... You might want to take a look at Starkits (http://www.equi4.com/starkit/) which is a system for distributing self-contained Tcl applications. It includes a VFS approach and some other goodies. On a related note, Daniel Hans, as part of Tcl's 2008 Google Summer of Code effort worked on a project to enable loading shared libraries from memory. I don't have a URL to point you to off the top of my head, but if you are interested, and if you can't find anything, let me know and I can dig something up. Matt From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 15:00:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BI0MPG009674; Fri, 11 Sep 2009 15:00:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEE6B188DB; Fri, 11 Sep 2009 14:59:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bitdojo.org (bitdojo.org [200.46.204.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C0C218850 for ; Fri, 11 Sep 2009 14:59:53 -0300 (BRT) Received: from maia.hub.org (unknown [200.46.204.183]) by bitdojo.org (Postfix) with ESMTP id 1B96AE0A641 for ; Fri, 11 Sep 2009 17:59:53 +0000 (UTC) Received: from bitdojo.org ([200.46.204.210]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50485-03 for ; Fri, 11 Sep 2009 17:59:52 +0000 (UTC) Received: from Haiku.local (unknown [128.164.156.224]) by bitdojo.org (Postfix) with ESMTPA id A8385E0A639 for ; Fri, 11 Sep 2009 17:59:52 +0000 (UTC) Message-ID: <4AAA9018.7020304@bluedino.net> Date: Fri, 11 Sep 2009 13:59:52 -0400 From: "Matthew M. Burke" User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: What is the equivalent of die() command of perl References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Anurag Sharma wrote: > Also, is there any tutorial or guide that teaches Lua to perl programmers. > > > http://vtatila.kapsi.fi/luatut.html And don't take this as a personal criticism, just a general rant :) ---- this is the first link returned by a google search for "lua for perl programmers" Matt From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 15:30:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BIUZRH017328; Fri, 11 Sep 2009 15:30:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9EF418A9B; Fri, 11 Sep 2009 15:30:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4944118A58 for ; Fri, 11 Sep 2009 15:29:52 -0300 (BRT) Received: by ewy4 with SMTP id 4so1355040ewy.36 for ; Fri, 11 Sep 2009 11:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=l8B8PXh8gZnngb3Zo9qrmmGwWNDuNaK5eqUjhYON4KI=; b=Kav2tszsV532E5WBom2WBdNegu4eao3cC/QWiIuJZQ1qUbn4UabxXXyhxY8ra9pJVd MrhoXogssutXnGHCObKcGPfMeR2/tMIlexD3vHTEMNRaqQvVP6W68G/KtlMz6Hr8oClp kV7gC54RQ7A33MiRQNoaXp6CFzLnjm3+o/bu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=SyjcDDm6wtHkb8h6tDslZUW7956l1/az9RN59f2Mfhe+V0f9MgKIH4gyUIgmWLNd3P phVwIDcwm4VYsGi0xMNm2v82YQzPUZ9Ejw+JSlLpcJdzVRF6woqiWkCa8nvf9h0vONmF 7MBDRTxm5oyhpgP0tQKZOz4m0zxs9YPcaUrZk= Received: by 10.211.184.18 with SMTP id l18mr943555ebp.26.1252693791060; Fri, 11 Sep 2009 11:29:51 -0700 (PDT) Received: from ?95.78.70.81? ([95.78.70.81]) by mx.google.com with ESMTPS id 28sm398795eye.16.2009.09.11.11.29.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Sep 2009 11:29:49 -0700 (PDT) Date: Fri, 11 Sep 2009 22:22:14 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <437986671.20090911222214@gmail.com> To: "Matthew M. Burke" Subject: Re[2]: Is a Lua system easily embeddable? In-Reply-To: <4AAA8EA7.1040806@bluedino.net> References: <4AA155A3.4000303@sct.microlink.com.br> <4AA16831.9020204@gmail.com> <4AA16EB3.1030208@sct.microlink.com.br> <20090904165057.A7019@lua.tecgraf.puc-rio.br> <4AA175A2.9050505@sct.microlink.com.br> <8763bxhdmu.fsf@catnip.gol.com> <2656446617943241256@unknownmsgid> <89d273ba0909061803n6635801ajd09832efee319825@mail.gmail.com> <79990c6b0909070329t3dcb49bcg60d7c3a433478538@mail.gmail.com> <003801ca2fd1$2bcc7390$83655ab0$@hind@zen.co.uk> <4AAA8EA7.1040806@bluedino.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Matthew, Friday, September 11, 2009, 9:53:43 PM, you wrote: > On a related note, Daniel Hans, as part of Tcl's 2008 Google Summer of > Code effort worked on a project to enable loading shared libraries from > memory http://www.google.ru/search?q=Loading+Shared+Libraries+from+Memory+and%2For+Tcl+Channels&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ru:official&client=firefox returns some links but it seems that he implemented only ELF-specific code -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 16:13:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BJDMpo028413; Fri, 11 Sep 2009 16:13:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1821E192EA; Fri, 11 Sep 2009 16:12:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from web111416.mail.gq1.yahoo.com (web111416.mail.gq1.yahoo.com [67.195.15.222]) by bazar2.conectiva.com.br (Postfix) with SMTP id 318731839A for ; Fri, 11 Sep 2009 16:12:41 -0300 (BRT) Received: (qmail 83595 invoked by uid 60001); 11 Sep 2009 19:12:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1252696359; bh=LkTuRjLg8PBZgEBB7iJObSGdBmqRVD19iYHqkqyOg9U=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ShPVfx3Z5hleVpAgIGm59JEYRQ27gb77QXD0qTg0Tkg7+TCnEHjhWPU8v+FAHrDhIEo90Fll1ZpvKD/NsEIVZDWoDgt8vVyLECdDf0ki+rR5WWvkciQgxbULVptM+QYFp2nudEyCM2azTKtj6ZBDjI/kydi1agnoKuf+uRmBU3E= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=mvW+oIxtT3Y5xwcDMBCOkMp5hEpwEfjkDLxcFk47NQXGCSv4ghwR0er6iHMnvXf7eQCFAt13zz1kwzA+pd8OUvS0PWsxs0FWCJ+Sm7rIC4MXkewdjo1woWcrwBeOIt+9JofnpItD88a6AVUW4fCtsc53+zBoCewefNJyrGlq4FA=; Message-ID: <544024.82067.qm@web111416.mail.gq1.yahoo.com> X-YMail-OSG: Cm916UMVM1nrP8Iuk8fT1Zzez4NFdBOsz9qslHxPhO8RZEFqMK3SYCkLWcsLeeAvdWCtEMIL2yFOrkPKjedxeQQRZJF3JaZahtJT9kzibCZJ46rF8N5SnkU5D4SQzyXmryxPXu_ryeZu.rOEq6I99ilYZHJpEFyZN3ART9Ez0PnkoB1yyFTzZJvx_60X6_xs7voZbZjgiekRpg.cunlIgTVFCVFyjgD9RITk8ssgoV7sd4b4Vb8HxDLuF7hBU_L65IK9N2mTh1mKouVVROZkayFU8bGXI6EY5AaTVauBfb9oDfq121IffSgfw4qJt_Y3ugL57HY59ypJPsLBh7KhGPcbAw-- Received: from [139.82.100.25] by web111416.mail.gq1.yahoo.com via HTTP; Fri, 11 Sep 2009 12:12:39 PDT X-Mailer: YahooMailRC/1358.27 YahooMailWebService/0.7.347.2 Date: Fri, 11 Sep 2009 12:12:39 -0700 (PDT) From: =?iso-8859-1?Q?S=E9rgio_Medeiros?= Subject: The real Mike Pall? To: Lista lua MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8BJDMpo028413 http://www.facebook.com/people/Mike-Pall/761670346 :-) Sérgio ____________________________________________________________________________________ Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 16:15:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BJFlQb029032; Fri, 11 Sep 2009 16:15:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B344F192FD; Fri, 11 Sep 2009 16:15:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BFC2192BF for ; Fri, 11 Sep 2009 16:15:18 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MmBaX-0003cQ-00; Fri, 11 Sep 2009 21:15:17 +0200 Date: Fri, 11 Sep 2009 21:15:11 +0200 From: Mike Pall To: Lua list Subject: Re: The real Mike Pall? Message-ID: <20090911191511.GA13815@mike.de> References: <544024.82067.qm@web111416.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <544024.82067.qm@web111416.mail.gq1.yahoo.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sérgio Medeiros wrote: > [URL deleted] No. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 17:30:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BKUN9f013774; Fri, 11 Sep 2009 17:30:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E8671932B; Fri, 11 Sep 2009 17:29:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94FD8192F7 for ; Fri, 11 Sep 2009 17:29:43 -0300 (BRT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh03-2.mail.saunalahti.fi (Postfix) with SMTP id EA5B3EBB2B for ; Fri, 11 Sep 2009 23:29:41 +0300 (EEST) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A04D3DE5389; Fri, 11 Sep 2009 23:29:41 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 8DBFD41BE8 for ; Fri, 11 Sep 2009 23:29:38 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Does anyone know Francesco Abbate? Date: Fri, 11 Sep 2009 23:29:38 +0300 X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I got a bug report on LNUM patch, but without the sender's email address. Might this be a general trouble with LuaForge bug reporting? Anyways, if anyone knows him (or he sees this), please send a private reply to me. Thanks. - asko From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 17:34:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BKYfTn014760; Fri, 11 Sep 2009 17:34:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FCA1192E3; Fri, 11 Sep 2009 17:34:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-160.bluehost.com (outbound-mail-160.bluehost.com [67.222.39.40]) by bazar2.conectiva.com.br (Postfix) with SMTP id ED9F4192D5 for ; Fri, 11 Sep 2009 17:34:11 -0300 (BRT) Received: (qmail 31065 invoked by uid 0); 11 Sep 2009 20:34:10 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy5.bluehost.com with SMTP; 11 Sep 2009 20:34:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=hyaX3zOokrYDQYFC4kZ3oLBJlUTF4dnHmM9Yk2IWkH2Mfz7AtfmUhUh1p6hRQpHHFyK4HZ7nghQjBBltbg/3HMC8RL3F7jSW5Z9IKQHxAD+zS6xl3NRZqsh2+r9GjBKc; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MmCor-0000KX-QJ for lua@bazar2.conectiva.com.br; Fri, 11 Sep 2009 14:34:10 -0600 Date: Fri, 11 Sep 2009 16:34:00 -0400 From: TNHarris To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090911163400.22b594fe@egeria.whoopdedo.org> In-Reply-To: <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090910162412.1043e325@egeria.whoopdedo.org> <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 11 Sep 2009 09:19:01 +0100 "John Hind" wrote: > > But how would you have a generalised name that would be appropriate in > diverse cases? If there was only one iterator, this would work, call > it something generic like "iter", but if you have two (as at present) > you need to distinguish them by function and this raises the question, > why not three or four? The other problem is that it is the name of the > library function ("pairs" or "ipairs") that the "user" sees, not the > name of the corresponding (proposed) metamethods. > Yes, my proposal also includes deprecating the old library function names in favor of new names. There are two generic protocols for iterating any dataset: ordered ("ipairs") and unordered ("pairs"). Anything else would likely be specific to the data and not generalisable. In that case you'd just have to provide your own method the same as you do now. If there were only one protocol, then it would be reasonable to invoke it implicitly, but there are two so it's better to be explicit. > It is important to realise that the "__pairs" and "__ipairs" proposal > is not just the "__iter" proposal with a different name. The latter > requires core language changes while the former is a very shallow and > minor change which effects only the "pairs" and "ipairs" functions in > the base library > Which is why I support the first option. I prefer simpler changes that are less likely to have unintended consequences. Unless the benefits of a more significant change can be justified. I'm not convinced in this case. > I am coming round to the attractions of the "method" proposal for > multiple iterators - the one where you can write: > > for v in myobject:myiterator do print(v) end > You'd get this for free if method currying were adopted. (Hopefully it will someday.) For the record, the forms I'm most in favor of are: -- unordered for values in each(set) do ... end -- ordered for number,values in enumerate(set) do ... end For convenience sake, in the absence of an __enumerate metamethod, the enumerate function could call __each but provide its own number sequence. So you don't have provide your own counter, even when the sequence isn't guaranteed to be stable. It's "each" instead of "iterate" simply for being shorter. I don't particularly care for "iter" and "enum" because they're abbreviations. And "enum" already has a meaning in C. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 18:06:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BL6KBY020851; Fri, 11 Sep 2009 18:06:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D60C19326; Fri, 11 Sep 2009 18:05:51 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CA37192E6 for ; Fri, 11 Sep 2009 18:05:39 -0300 (BRT) Received: by ywh29 with SMTP id 29so2205931ywh.23 for ; Fri, 11 Sep 2009 14:05:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.104.2 with SMTP id b2mr5781200ybc.19.1252703138227; Fri, 11 Sep 2009 14:05:38 -0700 (PDT) From: Phoenix Sol Date: Fri, 11 Sep 2009 16:05:18 -0500 Message-ID: <8a25d01b0909111405v7eaefde6t7124cc7a016988d3@mail.gmail.com> Subject: [ANN] lua-epoll To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean http://github.com/phoenixsol/lua-epoll Just a thin Lua wrapper around the epoll API. I'd appreciate feedback. require 'epoll' epoll_size = 4092 --approximate number of fds to be monitored num_events = 4092 --max number of events to be gathered per poll ep = epoll.init(epoll_size, num_events) ep:add(somefileno, epoll.EPOLLOUT) ep:mod(somefileno, epoll.EPOLLIN) ep:del(somefileno) evtable = epoll:poll(timeout) returned evtable looks like this: { {fd = event_bitmask}, ... } From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 18:31:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BLVXfD025015; Fri, 11 Sep 2009 18:31:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC939192EE; Fri, 11 Sep 2009 18:31:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 032EB19144 for ; Fri, 11 Sep 2009 18:31:06 -0300 (BRT) Received: from [93.173.211.100] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KPT004AMT3R1X00@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Sat, 12 Sep 2009 00:31:04 +0300 (IDT) Date: Sat, 12 Sep 2009 00:31:03 +0300 From: Shmuel Zeigerman Subject: Re: Does anyone know Francesco Abbate? In-reply-to: To: Lua list Message-id: <4AAAC197.7010600@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Asko Kauppi wrote: > > I got a bug report on LNUM patch, but without the sender's email address. > > Might this be a general trouble with LuaForge bug reporting? Either add a comment in reply, or click on the reporter's nickname (in the field "Submitted by"), then you'll be able to see his email address. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 18:52:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BLq5aU028601; Fri, 11 Sep 2009 18:52:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0EFC19331; Fri, 11 Sep 2009 18:51:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.bytecamp.net (mail.bytecamp.net [212.204.60.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D320619329 for ; Fri, 11 Sep 2009 18:50:51 -0300 (BRT) Received: (qmail 4199 invoked by uid 89); 11 Sep 2009 23:50:50 +0200 Received: from unknown (HELO ?10.11.12.33?) (jo%wwsnet.net@95.89.242.204) by mail.bytecamp.net with AES256-SHA encrypted SMTP; 11 Sep 2009 23:50:49 +0200 Message-ID: <4AAAC638.3090100@subsignal.org> Date: Fri, 11 Sep 2009 23:50:48 +0200 From: Jo-Philipp Wich User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Strange luac segmentation fault X-Enigmail-Version: 0.96.0 OpenPGP: id=834F4CF3 Content-Type: multipart/mixed; boundary="------------020006010303040604070101" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------020006010303040604070101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi list. A user reported a segmentation fault in luac when trying to byte-compile some Lua source files. This happened for him on both Fedora 12/rawhide x86_64 and Fedora 11 i586. I couldn't reproduce the issue on my Ubuntu system here, neither could the user reproduce it when executing the offending command manually. The segmentation fault does not happen when invoking luac -s -o foo.lua foo.lua manually on the command line but he was able to reliably trigger it when run within a "for file in $(find some/dir -name '*.lua'); do ...; done" loop. Below is a gdb backtrace from the debug enabled Lua and the produced core dump. I also attached the offending source file which triggers the segfault. What could I do to debug this further? GDB backtrace: Core was generated by `luac -s -o dist/usr/lib/lua/luci/util.lua.b dist/usr/lib/lua/luci/util.lua'. Program terminated with signal 11, Segmentation fault. #0 0x08054042 in newkey (L=, t=, key=0xbfbbe984) at ltable.c:420 420 gnext(n) = gnext(mp); /* chain new position */ (gdb) thread apply all bt full Thread 1 (Thread 30099): #0 0x08054042 in newkey (L=, t=, key=0xbfbbe984) at ltable.c:420 othern = 0x0 n = 0x860d3a8 mp = 0x860d4f8 #1 0x0805433d in resize (L=, t=, nasize=, nhsize=140488712) at ltable.c:314 i = oldasize = 134562621 oldhsize = 140488712 nold = 0xbfbbf304 #2 0x0805b9b3 in llex (ls=0x4, seminfo=) at llex.c:347 sep = #3 0x0805ca6c in ?? () No symbol table info available. #4 0xbfbbf304 in ?? () No symbol table info available. #5 0x08600ae0 in ?? () No symbol table info available. #6 0x00000009 in ?? () No symbol table info available. #7 0xbfbbed44 in ?? () No symbol table info available. #8 0xbfbbeaac in ?? () No symbol table info available. #9 0x00000002 in ?? () No symbol table info available. #10 0xbfbbea38 in ?? () No symbol table info available. #11 0xbfbbf314 in ?? () No symbol table info available. #12 0xbfbbed44 in ?? () No symbol table info available. #13 0x00000001 in ?? () No symbol table info available. #14 0xbfbbea18 in ?? () No symbol table info available. #15 0xbfbbf304 in ?? () No symbol table info available. #16 0xbfbbeaac in ?? () No symbol table info available. #17 0x00000002 in ?? () No symbol table info available. #18 0xbfbbea18 in ?? () No symbol table info available. #19 0x0805cb82 in ?? () No symbol table info available. #20 0xbfbbed44 in ?? () No symbol table info available. #21 0xbfbbf304 in ?? () No symbol table info available. #22 0xbfbbea38 in ?? () No symbol table info available. #23 0x08050180 in open_func (ls=0xbfbbf304, fs=0x63) at lparser.c:350 L = 0xb7f5068c f = Backtrace stopped: previous frame inner to this frame (corrupt stack?) Regards, JoW -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqqxjQACgkQdputYINPTPOAUACdEVdNplr0TzxgXgaNyLHcwKvw EVsAnRwf9fUxUkjA3HxtOHuPRvY4MmIE =tGoV -----END PGP SIGNATURE----- --------------020006010303040604070101 Content-Type: text/x-lua; name="util.lua" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="util.lua" --[[ LuCI - Utility library Description: Several common useful Lua functions FileId: $Id$ License: Copyright 2008 Steven Barth Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]]-- local io = require "io" local math = require "math" local table = require "table" local debug = require "debug" local ldebug = require "luci.debug" local string = require "string" local coroutine = require "coroutine" local getmetatable, setmetatable = getmetatable, setmetatable local rawget, rawset, unpack = rawget, rawset, unpack local tostring, type, assert = tostring, type, assert local ipairs, pairs, loadstring = ipairs, pairs, loadstring local require, pcall, xpcall = require, pcall, xpcall local collectgarbage, get_memory_limit = collectgarbage, get_memory_limit --- LuCI utility functions. module "luci.util" -- -- Pythonic string formatting extension -- getmetatable("").__mod = function(a, b) if not b then return a elseif type(b) == "table" then return a:format(unpack(b)) else return a:format(b) end end -- -- Class helper routines -- -- Instantiates a class local function _instantiate(class, ...) local inst = setmetatable({}, {__index = class}) if inst.__init__ then inst:__init__(...) end return inst end --- Create a Class object (Python-style object model). -- The class object can be instantiated by calling itself. -- Any class functions or shared parameters can be attached to this object. -- Attaching a table to the class object makes this table shared between -- all instances of this class. For object parameters use the __init__ function. -- Classes can inherit member functions and values from a base class. -- Class can be instantiated by calling them. All parameters will be passed -- to the __init__ function of this class - if such a function exists. -- The __init__ function must be used to set any object parameters that are not shared -- with other objects of this class. Any return values will be ignored. -- @param base The base class to inherit from (optional) -- @return A class object -- @see instanceof -- @see clone function class(base) return setmetatable({}, { __call = _instantiate, __index = base }) end --- Test whether the given object is an instance of the given class. -- @param object Object instance -- @param class Class object to test against -- @return Boolean indicating whether the object is an instance -- @see class -- @see clone function instanceof(object, class) local meta = getmetatable(object) while meta and meta.__index do if meta.__index == class then return true end meta = getmetatable(meta.__index) end return false end -- -- Scope manipulation routines -- local tl_meta = { __mode = "k", __index = function(self, key) local t = rawget(self, coxpt[coroutine.running()] or coroutine.running() or 0) return t and t[key] end, __newindex = function(self, key, value) local c = coxpt[coroutine.running()] or coroutine.running() or 0 if not rawget(self, c) then rawset(self, c, { [key] = value }) else rawget(self, c)[key] = value end end } --- Create a new or get an already existing thread local store associated with -- the current active coroutine. A thread local store is private a table object -- whose values can't be accessed from outside of the running coroutine. -- @return Table value representing the corresponding thread local store function threadlocal(tbl) return setmetatable(tbl or {}, tl_meta) end -- -- Debugging routines -- --- Write given object to stderr. -- @param obj Value to write to stderr -- @return Boolean indicating whether the write operation was successful function perror(obj) return io.stderr:write(tostring(obj) .. "\n") end --- Recursively dumps a table to stdout, useful for testing and debugging. -- @param t Table value to dump -- @param maxdepth Maximum depth -- @return Always nil function dumptable(t, maxdepth, i, seen) i = i or 0 seen = seen or setmetatable({}, {__mode="k"}) for k,v in pairs(t) do perror(string.rep("\t", i) .. tostring(k) .. "\t" .. tostring(v)) if type(v) == "table" and (not maxdepth or i < maxdepth) then if not seen[v] then seen[v] = true dumptable(v, maxdepth, i+1, seen) else perror(string.rep("\t", i) .. "*** RECURSION ***") end end end end -- -- String and data manipulation routines -- --- Escapes all occurrences of the given character in given string. -- @param s String value containing unescaped characters -- @param c String value with character to escape (optional, defaults to "\") -- @return String value with each occurrence of character escaped with "\" function escape(s, c) c = c or "\\" return s:gsub(c, "\\" .. c) end --- Create valid XML PCDATA from given string. -- @param value String value containing the data to escape -- @return String value containing the escaped data local function _pcdata_repl(c) local i = string.byte(c) if ( i >= 0x00 and i <= 0x08 ) or ( i >= 0x0B and i <= 0x0C ) or ( i >= 0x0E and i <= 0x1F ) or ( i == 0x7F ) then return "" elseif ( i == 0x26 ) or ( i == 0x27 ) or ( i == 0x22 ) or ( i == 0x3C ) or ( i == 0x3E ) then return string.format("&#%i;", i) end return c end function pcdata(value) return value and tostring(value):gsub("[&\"'<>%c]", _pcdata_repl) end --- Strip HTML tags from given string. -- @param value String containing the HTML text -- @return String with HTML tags stripped of function striptags(s) return pcdata(s:gsub("]*>", " "):gsub("%s+", " ")) end --- Splits given string on a defined separator sequence and return a table -- containing the resulting substrings. The optional max parameter specifies -- the number of bytes to process, regardless of the actual length of the given -- string. The optional last parameter, regex, specifies whether the separator -- sequence is interpreted as regular expression. -- @param str String value containing the data to split up -- @param pat String with separator pattern (optional, defaults to "\n") -- @param max Maximum times to split (optional) -- @param regex Boolean indicating whether to interpret the separator -- pattern as regular expression (optional, default is false) -- @return Table containing the resulting substrings function split(str, pat, max, regex) pat = pat or "\n" max = max or #str local t = {} local c = 1 if #str == 0 then return {""} end if #pat == 0 then return nil end if max == 0 then return str end repeat local s, e = str:find(pat, c, not regex) max = max - 1 if s and max < 0 then t[#t+1] = str:sub(c) else t[#t+1] = str:sub(c, s and s - 1) end c = e and e + 1 or #str + 1 until not s or max < 0 return t end --- Remove leading and trailing whitespace from given string value. -- @param str String value containing whitespace padded data -- @return String value with leading and trailing space removed function trim(str) return (str:gsub("^%s*(.-)%s*$", "%1")) end --- Count the occurences of given substring in given string. -- @param str String to search in -- @param pattern String containing pattern to find -- @return Number of found occurences function cmatch(str, pat) local count = 0 for _ in str:gmatch(pat) do count = count + 1 end return count end --- Parse certain units from the given string and return the canonical integer -- value or 0 if the unit is unknown. Upper- or lower case is irrelevant. -- Recognized units are: -- o "y" - one year (60*60*24*366) -- o "m" - one month (60*60*24*31) -- o "w" - one week (60*60*24*7) -- o "d" - one day (60*60*24) -- o "h" - one hour (60*60) -- o "min" - one minute (60) -- o "kb" - one kilobyte (1024) -- o "mb" - one megabyte (1024*1024) -- o "gb" - one gigabyte (1024*1024*1024) -- o "kib" - one si kilobyte (1000) -- o "mib" - one si megabyte (1000*1000) -- o "gib" - one si gigabyte (1000*1000*1000) -- @param ustr String containing a numerical value with trailing unit -- @return Number containing the canonical value function parse_units(ustr) local val = 0 -- unit map local map = { -- date stuff y = 60 * 60 * 24 * 366, m = 60 * 60 * 24 * 31, w = 60 * 60 * 24 * 7, d = 60 * 60 * 24, h = 60 * 60, min = 60, -- storage sizes kb = 1024, mb = 1024 * 1024, gb = 1024 * 1024 * 1024, -- storage sizes (si) kib = 1000, mib = 1000 * 1000, gib = 1000 * 1000 * 1000 } -- parse input string for spec in ustr:lower():gmatch("[0-9%.]+[a-zA-Z]*") do local num = spec:gsub("[^0-9%.]+$","") local spn = spec:gsub("^[0-9%.]+", "") if map[spn] or map[spn:sub(1,1)] then val = val + num * ( map[spn] or map[spn:sub(1,1)] ) else val = val + num end end return val end -- also register functions above in the central string class for convenience string.escape = escape string.pcdata = pcdata string.striptags = striptags string.split = split string.trim = trim string.cmatch = cmatch string.parse_units = parse_units --- Appends numerically indexed tables or single objects to a given table. -- @param src Target table -- @param ... Objects to insert -- @return Target table function append(src, ...) for i, a in ipairs({...}) do if type(a) == "table" then for j, v in ipairs(a) do src[#src+1] = v end else src[#src+1] = a end end return src end --- Combines two or more numerically indexed tables and single objects into one table. -- @param tbl1 Table value to combine -- @param tbl2 Table value to combine -- @param ... More tables to combine -- @return Table value containing all values of given tables function combine(...) return append({}, ...) end --- Checks whether the given table contains the given value. -- @param table Table value -- @param value Value to search within the given table -- @return Boolean indicating whether the given value occurs within table function contains(table, value) for k, v in pairs(table) do if value == v then return k end end return false end --- Update values in given table with the values from the second given table. -- Both table are - in fact - merged together. -- @param t Table which should be updated -- @param updates Table containing the values to update -- @return Always nil function update(t, updates) for k, v in pairs(updates) do t[k] = v end end --- Retrieve all keys of given associative table. -- @param t Table to extract keys from -- @return Sorted table containing the keys function keys(t) local keys = { } if t then for k, _ in kspairs(t) do keys[#keys+1] = k end end return keys end --- Clones the given object and return it's copy. -- @param object Table value to clone -- @param deep Boolean indicating whether to do recursive cloning -- @return Cloned table value function clone(object, deep) local copy = {} for k, v in pairs(object) do if deep and type(v) == "table" then v = clone(v, deep) end copy[k] = v end return setmetatable(copy, getmetatable(object)) end --- Create a dynamic table which automatically creates subtables. -- @return Dynamic Table function dtable() return setmetatable({}, { __index = function(tbl, key) return rawget(tbl, key) or rawget(rawset(tbl, key, dtable()), key) end }) end -- Serialize the contents of a table value. function _serialize_table(t, seen) assert(not seen[t], "Recursion detected.") seen[t] = true local data = "" local idata = "" local ilen = 0 for k, v in pairs(t) do if type(k) ~= "number" or k < 1 or math.floor(k) ~= k or ( k - #t ) > 3 then k = serialize_data(k, seen) v = serialize_data(v, seen) data = data .. ( #data > 0 and ", " or "" ) .. '[' .. k .. '] = ' .. v elseif k > ilen then ilen = k end end for i = 1, ilen do local v = serialize_data(t[i], seen) idata = idata .. ( #idata > 0 and ", " or "" ) .. v end return idata .. ( #data > 0 and #idata > 0 and ", " or "" ) .. data end --- Recursively serialize given data to lua code, suitable for restoring -- with loadstring(). -- @param val Value containing the data to serialize -- @return String value containing the serialized code -- @see restore_data -- @see get_bytecode function serialize_data(val, seen) seen = seen or setmetatable({}, {__mode="k"}) if val == nil then return "nil" elseif type(val) == "number" then return val elseif type(val) == "string" then return "%q" % val elseif type(val) == "boolean" then return val and "true" or "false" elseif type(val) == "function" then return "loadstring(%q)" % get_bytecode(val) elseif type(val) == "table" then return "{ " .. _serialize_table(val, seen) .. " }" else return '"[unhandled data type:' .. type(val) .. ']"' end end --- Restore data previously serialized with serialize_data(). -- @param str String containing the data to restore -- @return Value containing the restored data structure -- @see serialize_data -- @see get_bytecode function restore_data(str) return loadstring("return " .. str)() end -- -- Byte code manipulation routines -- --- Return the current runtime bytecode of the given data. The byte code -- will be stripped before it is returned. -- @param val Value to return as bytecode -- @return String value containing the bytecode of the given data function get_bytecode(val) local code if type(val) == "function" then code = string.dump(val) else code = string.dump( loadstring( "return " .. serialize_data(val) ) ) end return code and strip_bytecode(code) end --- Strips unnescessary lua bytecode from given string. Information like line -- numbers and debugging numbers will be discarded. Original version by -- Peter Cawley (http://lua-users.org/lists/lua-l/2008-02/msg01158.html) -- @param code String value containing the original lua byte code -- @return String value containing the stripped lua byte code function strip_bytecode(code) local version, format, endian, int, size, ins, num, lnum = code:byte(5, 12) local subint if endian == 1 then subint = function(code, i, l) local val = 0 for n = l, 1, -1 do val = val * 256 + code:byte(i + n - 1) end return val, i + l end else subint = function(code, i, l) local val = 0 for n = 1, l, 1 do val = val * 256 + code:byte(i + n - 1) end return val, i + l end end local function strip_function(code) local count, offset = subint(code, 1, size) local stripped = { string.rep("\0", size) } local dirty = offset + count offset = offset + count + int * 2 + 4 offset = offset + int + subint(code, offset, int) * ins count, offset = subint(code, offset, int) for n = 1, count do local t t, offset = subint(code, offset, 1) if t == 1 then offset = offset + 1 elseif t == 4 then offset = offset + size + subint(code, offset, size) elseif t == 3 then offset = offset + num elseif t == 254 or t == 9 then offset = offset + lnum end end count, offset = subint(code, offset, int) stripped[#stripped+1] = code:sub(dirty, offset - 1) for n = 1, count do local proto, off = strip_function(code:sub(offset, -1)) stripped[#stripped+1] = proto offset = offset + off - 1 end offset = offset + subint(code, offset, int) * int + int count, offset = subint(code, offset, int) for n = 1, count do offset = offset + subint(code, offset, size) + size + int * 2 end count, offset = subint(code, offset, int) for n = 1, count do offset = offset + subint(code, offset, size) + size end stripped[#stripped+1] = string.rep("\0", int * 3) return table.concat(stripped), offset end return code:sub(1,12) .. strip_function(code:sub(13,-1)) end -- -- Sorting iterator functions -- function _sortiter( t, f ) local keys = { } for k, v in pairs(t) do keys[#keys+1] = k end local _pos = 0 table.sort( keys, f ) return function() _pos = _pos + 1 if _pos <= #keys then return keys[_pos], t[keys[_pos]] end end end --- Return a key, value iterator which returns the values sorted according to -- the provided callback function. -- @param t The table to iterate -- @param f A callback function to decide the order of elements -- @return Function value containing the corresponding iterator function spairs(t,f) return _sortiter( t, f ) end --- Return a key, value iterator for the given table. -- The table pairs are sorted by key. -- @param t The table to iterate -- @return Function value containing the corresponding iterator function kspairs(t) return _sortiter( t ) end --- Return a key, value iterator for the given table. -- The table pairs are sorted by value. -- @param t The table to iterate -- @return Function value containing the corresponding iterator function vspairs(t) return _sortiter( t, function (a,b) return t[a] < t[b] end ) end -- -- System utility functions -- --- Test whether the current system is operating in big endian mode. -- @return Boolean value indicating whether system is big endian function bigendian() return string.byte(string.dump(function() end), 7) == 0 end --- Execute given commandline and gather stdout. -- @param command String containing command to execute -- @return String containing the command's stdout function exec(command) local pp = io.popen(command) local data = pp:read("*a") pp:close() return data end --- Return a line-buffered iterator over the output of given command. -- @param command String containing the command to execute -- @return Iterator function execi(command) local pp = io.popen(command) return pp and function() local line = pp:read() if not line then pp:close() end return line end end -- Deprecated function execl(command) local pp = io.popen(command) local line = "" local data = {} while true do line = pp:read() if (line == nil) then break end data[#data+1] = line end pp:close() return data end --- Returns the absolute path to LuCI base directory. -- @return String containing the directory path function libpath() return require "nixio.fs".dirname(ldebug.__file__) end -- -- Coroutine safe xpcall and pcall versions modified for Luci -- original version: -- coxpcall 1.13 - Copyright 2005 - Kepler Project (www.keplerproject.org) -- -- Copyright © 2005 Kepler Project. -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be -- included in all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local performResume, handleReturnValue local oldpcall, oldxpcall = pcall, xpcall coxpt = {} setmetatable(coxpt, {__mode = "kv"}) -- Identity function for copcall local function copcall_id(trace, ...) return ... end --- This is a coroutine-safe drop-in replacement for Lua's "xpcall"-function -- @param f Lua function to be called protected -- @param err Custom error handler -- @param ... Parameters passed to the function -- @return A boolean whether the function call succeeded and the return -- values of either the function or the error handler function coxpcall(f, err, ...) local res, co = oldpcall(coroutine.create, f) if not res then local params = {...} local newf = function() return f(unpack(params)) end co = coroutine.create(newf) end local c = coroutine.running() coxpt[co] = coxpt[c] or c or 0 return performResume(err, co, ...) end --- This is a coroutine-safe drop-in replacement for Lua's "pcall"-function -- @param f Lua function to be called protected -- @param ... Parameters passed to the function -- @return A boolean whether the function call succeeded and the returns -- values of the function or the error object function copcall(f, ...) return coxpcall(f, copcall_id, ...) end -- Handle return value of protected call function handleReturnValue(err, co, status, ...) if not status then return false, err(debug.traceback(co, (...)), ...) end if coroutine.status(co) == 'suspended' then return performResume(err, co, coroutine.yield(...)) else return true, ... end end -- Resume execution of protected function call function performResume(err, co, ...) if get_memory_limit and get_memory_limit() > 0 and collectgarbage("count") > (get_memory_limit() * 0.8) then collectgarbage("collect") end return handleReturnValue(err, co, coroutine.resume(co, ...)) end --------------020006010303040604070101-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 20:23:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BNNqQx010556; Fri, 11 Sep 2009 20:23:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DBAD19330; Fri, 11 Sep 2009 20:23:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BEDF192B1 for ; Fri, 11 Sep 2009 20:23:14 -0300 (BRT) Received: from lakeland.eecs.harvard.edu (lakeland.eecs.harvard.edu [140.247.62.173]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 1931B25601C for ; Fri, 11 Sep 2009 19:23:11 -0400 (EDT) Received: by lakeland.eecs.harvard.edu (Postfix, from userid 32074) id EC5ECB130F; Fri, 11 Sep 2009 19:23:10 -0400 (EDT) To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? In-reply-to: <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> (sfid-H-20090806-132709-+87.86-1@multi.osbf.lua) References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> (sfid-H-20090806-132709-+87.86-1@multi.osbf.lua) Comments: In-reply-to Luiz Henrique de Figueiredo message dated "Thu, 06 Aug 2009 14:18:51 -0300." Date: Fri, 11 Sep 2009 19:23:06 -0400 From: Norman Ramsey Message-Id: <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > I'm accustomed to use Lua to store persistent data structures on disk. > > Unfortunately, in my latest venture, I run out of string space. I did > > a little investigation in the source, and it appears that only 2^18 > > literal constants may appear in any one source file, and this appears > > to be a hard limit built into the bytecode format. > > The usual solution for this is to divide your data into functions because > the limit is per function. This has been discussed before: > http://lua-users.org/lists/lua-l/2008-02/msg00298.html Thanks Luiz for this pointer. I wish I had your memory. I have some generic code that writes any tree-like Lua table containing only strings, numbers, Booleans, and other tables. I will have to see if I can adapt it to this purpose without disrupting things too much. I would prefer to write large table literals than to populate tables by individual assignment, since I don't want to pay the costs for growth. If I get any decent code, I will post it. Norman P.S. Am I thinking that the table literal { name = 'Ramsey', age = 47 } contains *four* constants that count against the limit? From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 20:30:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8BNUqR2011431; Fri, 11 Sep 2009 20:30:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 471DD19352; Fri, 11 Sep 2009 20:30:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FE8E192EF for ; Fri, 11 Sep 2009 20:30:26 -0300 (BRT) Received: by iwn1 with SMTP id 1so643311iwn.11 for ; Fri, 11 Sep 2009 16:30:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.164 with SMTP id h36mr6745463ibr.9.1252711825960; Fri, 11 Sep 2009 16:30:25 -0700 (PDT) In-Reply-To: <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> Date: Fri, 11 Sep 2009 19:30:25 -0400 Message-ID: <790db3550909111630u3dd69093k750db8469a2c2ed4@mail.gmail.com> Subject: Re: how to load a very large table with more than 2^18 literal strings? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8BNUqR2011431 On Fri, Sep 11, 2009 at 7:23 PM, Norman Ramsey wrote: > P.S. Am I thinking that the table literal > >  { name = 'Ramsey', age = 47 } > > contains *four* constants that count against the limit? Yes. luac will tell you the exact number of contents. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 22:26:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C1Pu3w022137; Fri, 11 Sep 2009 22:25:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C5531937C; Fri, 11 Sep 2009 22:25:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3366519375 for ; Fri, 11 Sep 2009 22:25:23 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C1PNXK022089 for ; Fri, 11 Sep 2009 22:25:23 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8C1PKn13045; Fri, 11 Sep 2009 22:25:20 -0300 Date: Fri, 11 Sep 2009 22:25:19 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? Message-ID: <20090911222519.C13015@lua.tecgraf.puc-rio.br> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <790db3550909111630u3dd69093k750db8469a2c2ed4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <790db3550909111630u3dd69093k750db8469a2c2ed4@mail.gmail.com>; from batrick@batbytes.com on Fri, Sep 11, 2009 at 07:30:25PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > P.S. Am I thinking that the table literal > > > >  { name = 'Ramsey', age = 47 } > > > > contains *four* constants that count against the limit? > > Yes. luac will tell you the exact number of contents. And you want "luac -l -l" for that. From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 22:39:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C1d7vF023417; Fri, 11 Sep 2009 22:39:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEF1E19382; Fri, 11 Sep 2009 22:38:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FFEE19378 for ; Fri, 11 Sep 2009 22:38:42 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C1cg5A023387 for ; Fri, 11 Sep 2009 22:38:42 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8C1cgP13093; Fri, 11 Sep 2009 22:38:42 -0300 Date: Fri, 11 Sep 2009 22:38:41 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? Message-ID: <20090911223841.D13015@lua.tecgraf.puc-rio.br> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu>; from nr@cs.tufts.edu on Fri, Sep 11, 2009 at 07:23:06PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I would prefer to write large table literals than to populate tables > by individual assignment, since I don't want to pay the costs for growth. One thing that I wish I had a nice solution for is that the bytecode for table literals actually does not care that the table is a new table: it only requires a table at the correct register. So, in principle, you could "merge" a table literal into an existing table very efficiently, if only we could say it in the program. (If you're generating bytecode, then like I said you don't need to do anything special.) One possible syntax would be t<<{ ... } but that requires a new token. Other possibilities that do not require a new token are t#{ ... } t:{ ... } One not so nice point is that this would be a *statement*, not an expression. Also, this needs to be a syntactical construct, not a run-time metamethod. Oh well, I don't think there's a nice solution, which is a pity because no change would be needed in the VM. --lhf From lua-bounces@bazar2.conectiva.com.br Fri Sep 11 23:15:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C2ExJS026719; Fri, 11 Sep 2009 23:15:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9566118C30; Fri, 11 Sep 2009 23:14:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55ED318A87 for ; Fri, 11 Sep 2009 23:14:27 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MmI89-0007t2-00; Sat, 12 Sep 2009 04:14:25 +0200 Date: Sat, 12 Sep 2009 04:14:04 +0200 From: Mike Pall To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? Message-ID: <20090912021404.GA30313@mike.de> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090911223841.D13015@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > > I would prefer to write large table literals than to populate tables > > by individual assignment, since I don't want to pay the costs for growth. > > Oh well, I don't think there's a nice solution [...] But there is. I'm not sure whether I've mentioned this, but LJ2 puts no limit (other than memory size) on the number of constant keys/values of a table constructor. The parser stores all constant key/value pairs into a lazily allocated template table. It only emits store instructions for variable keys or values. If a template table has been created, it's put into the constant section. The table creation instruction TNEW is then patched to the table duplication instruction TDUP. $ lj2 -jbc -e 'local x = {}' 0001 TNEW 0 0 $ lj2 -jbc -e 'local v = 1; local x = {v}' 0001 KSHORT 0 1 0002 TNEW 1 3 0003 TSETB 0 1 1 $ lj2 -jbc -e 'local x = {1,2,3}' 0001 TDUP 0 0 ; {1,2,3} $ lj2 -jbc -e 'local v = "var"; local x = {"x","y",v,foo=true,bar=v,[v]=v}' 0001 KSTR 0 0 ; "var" 0002 TDUP 1 1 ; {"x","y",foo=true} 0003 TSETB 0 1 3 0004 TSETS 0 1 2 ; "bar" 0005 TSETV 0 1 0 Note that neither "x", "y", nor "foo" appear in the bytecode or the constants, because they are only part of the template table. Ah, before I forget: duplicating a large table of constants is of course a lot faster than filling it by executing tons of bytecodes. --Mike From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 02:39:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C5dMqQ012421; Sat, 12 Sep 2009 02:39:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADCCF192AA; Sat, 12 Sep 2009 02:38:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59D23191D5 for ; Sat, 12 Sep 2009 02:38:48 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 1A2EC38492CD3 for ; Sat, 12 Sep 2009 12:38:48 +0700 (NOVST) Message-ID: <009201ca336b$4c3e29a0$6600a8c0@sat3> From: "GrayFace" To: "Lua" Subject: Suggestion: Default error handler Date: Sat, 12 Sep 2009 12:38:46 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sat, 12 Sep 2009 12:38:48 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Hi all, I have stumbled upon the fact that there's no way to assign an error handler to a coroutine. I want all errors reported with call stack and variables trace. This seems impossible in coroutines and inconvenient in pcall either, due to xpcall not taking any argments to the function. So, my suggestion is a default error handler that would be called if there's no error handler supplied. I can send a patch with my implementation if you're interested. ___________________________________________ Best regards, Sergey Rozhenko mailto:sergroj@mail.ru From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 04:13:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C7DpdG020912; Sat, 12 Sep 2009 04:13:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 676571932D; Sat, 12 Sep 2009 04:13:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31B1F192FB for ; Sat, 12 Sep 2009 04:13:14 -0300 (BRT) Received: by iwn1 with SMTP id 1so717657iwn.11 for ; Sat, 12 Sep 2009 00:13:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.22 with SMTP id s22mr7508531ibr.33.1252739593883; Sat, 12 Sep 2009 00:13:13 -0700 (PDT) In-Reply-To: <009201ca336b$4c3e29a0$6600a8c0@sat3> References: <009201ca336b$4c3e29a0$6600a8c0@sat3> Date: Sat, 12 Sep 2009 03:13:13 -0400 Message-ID: <790db3550909120013u5173cff5m3933a3f018b6a5c8@mail.gmail.com> Subject: Re: Suggestion: Default error handler From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/12 GrayFace : > Hi all, > > I have stumbled upon the fact that there's no way to assign an error handler > to a coroutine. I want all errors reported with call stack and variables > trace. This seems impossible in coroutines and inconvenient in pcall either, > due to xpcall not taking any argments to the function. So, my suggestion is > a default error handler that would be called if there's no error handler > supplied. > > I can send a patch with my implementation if you're interested. You don't need an error handler because the stack is not unwound when a coroutine dies due to an error. This code will append the standard traceback you're used to. do local function aux_resume (co, status, ...) if status == false then return false, debug.traceback(co, (...)); else return status, ...; end end local resume = coroutine.resume; function coroutine.resume (...) return aux_resume(co, resume(...)); end end -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 05:46:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8C8kqEq028519; Sat, 12 Sep 2009 05:46:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F1FB183B4; Sat, 12 Sep 2009 05:46:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh05.mail.saunalahti.fi (emh05.mail.saunalahti.fi [62.142.5.111]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B991192CB for ; Sat, 12 Sep 2009 05:46:14 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh05-2.mail.saunalahti.fi (Postfix) with SMTP id CA7F88BD16 for ; Sat, 12 Sep 2009 11:46:08 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A044ABC53D4; Sat, 12 Sep 2009 11:46:08 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 44FA0158A63 for ; Sat, 12 Sep 2009 11:46:06 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <4AAAC197.7010600@013net.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Does anyone know Francesco Abbate? Date: Sat, 12 Sep 2009 11:46:05 +0300 References: <4AAAC197.7010600@013net.net> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman kirjoitti 12.9.2009 kello 0:31: > Asko Kauppi wrote: >> I got a bug report on LNUM patch, but without the sender's email >> address. >> Might this be a general trouble with LuaForge bug reporting? > > Either add a comment in reply, or click on the reporter's nickname > (in the field "Submitted by"), then you'll be able to see his email > address. Ah, it said that in the header-like section that I of course skipped.... Mea culpa. Thanks. -asko > > -- > Shmuel From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 11:09:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CE946B021324; Sat, 12 Sep 2009 11:09:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E2B319368; Sat, 12 Sep 2009 11:08:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31548192DC for ; Sat, 12 Sep 2009 11:08:25 -0300 (BRT) Received: (qmail 18610 invoked by uid 399); 12 Sep 2009 08:08:24 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 12 Sep 2009 08:08:24 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AABAB57.9030702@workspacewhiz.com> Date: Sat, 12 Sep 2009 08:08:23 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> <20090912021404.GA30313@mike.de> In-Reply-To: <20090912021404.GA30313@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Mike Pall Date: 9/11/2009 8:14 PM > But there is. I'm not sure whether I've mentioned this, but LJ2 > puts no limit (other than memory size) on the number of constant > keys/values of a table constructor. > > The parser stores all constant key/value pairs into a lazily > allocated template table. It only emits store instructions for > variable keys or values. If a template table has been created, > it's put into the constant section. The table creation instruction > TNEW is then patched to the table duplication instruction TDUP. > > Note that neither "x", "y", nor "foo" appear in the bytecode or > the constants, because they are only part of the template table. > > Ah, before I forget: duplicating a large table of constants is of > course a lot faster than filling it by executing tons of bytecodes. > I run into the table size problem often enough to be annoying. Is it possible to apply your work in LJ2 as a standard Lua 5.1 patch? Thanks! Josh From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 11:19:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CEJ775022240; Sat, 12 Sep 2009 11:19:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34B0D1938E; Sat, 12 Sep 2009 11:18:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BC2219376 for ; Sat, 12 Sep 2009 11:18:41 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MmTR4-0008SV-00; Sat, 12 Sep 2009 16:18:42 +0200 Date: Sat, 12 Sep 2009 16:18:37 +0200 From: Mike Pall To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? Message-ID: <20090912141837.GA9261@mike.de> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> <20090912021404.GA30313@mike.de> <4AABAB57.9030702@workspacewhiz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AABAB57.9030702@workspacewhiz.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: >> The parser stores all constant key/value pairs into a lazily >> allocated template table. It only emits store instructions for >> variable keys or values. If a template table has been created, >> it's put into the constant section. The table creation instruction >> TNEW is then patched to the table duplication instruction TDUP. >> > I run into the table size problem often enough to be annoying. Is it > possible to apply your work in LJ2 as a standard Lua 5.1 patch? Not easily. You'd first need to modify the whole parser and code generator to add lazy constifying of string literals (VKSTR, like VKNUM). Otherwise all parsed strings end up in the constant pool which sort of defeats the whole idea. --Mike From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 14:53:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CHr1Ag008631; Sat, 12 Sep 2009 14:53:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3F8219320; Sat, 12 Sep 2009 14:52:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out1.berkeley.edu (smtp-out1.Berkeley.EDU [128.32.61.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B68118BB3 for ; Sat, 12 Sep 2009 14:52:19 -0300 (BRT) Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by fe5.calmail with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (auth plain:jgm@berkeley.edu) (envelope-from ) id 1MmWle-0007Qs-IP for lua@bazar2.conectiva.com.br; Sat, 12 Sep 2009 10:52:12 -0700 Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id 1216E1322F5; Sat, 12 Sep 2009 10:51:36 -0700 (PDT) Date: Sat, 12 Sep 2009 10:51:36 -0700 From: John MacFarlane To: Lua list Subject: ANNOUNCE: lunamark - PEG-based markdown conversion library Message-ID: <20090912175135.GA7476@protagoras.phil.berkeley.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I just started messing with lua and couldn't resist using the lpeg library to write a markdown parser (more or less a port of my C library, peg-markdown). Here's the result: http://github.com/jgm/lunamark/tree/master lunamark currently converts standard markdown to either HTML or LaTeX. In my tests, it is faster than markdown.lua, though still considerably slower than the lua binding to discount. Its main advantages over the discount binding are portability and extensibility. (Adding a LaTeX writer took about 20 minutes; it should also be possible to add parsers for new input formats.) It's my first attempt at lua, so if you spot something unidiomatic, inefficient, or just stupid, let me know. John From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 15:31:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CIVACv011641; Sat, 12 Sep 2009 15:31:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8722E19290; Sat, 12 Sep 2009 15:30:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-09.prod.phx3.secureserver.net (p3plsmtpa01-09.prod.phx3.secureserver.net [72.167.82.89]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8FEE3191D9 for ; Sat, 12 Sep 2009 15:30:36 -0300 (BRT) Received: (qmail 14847 invoked from network); 12 Sep 2009 18:30:31 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-09.prod.phx3.secureserver.net (72.167.82.89) with ESMTP; 12 Sep 2009 18:30:31 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: userdata environment From: Mark Hamburg In-Reply-To: Date: Sat, 12 Sep 2009 11:30:30 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The garbage collector may also expect that the environment is a table rather than an arbitrary object. That would be the other place to check when making changes. Benchmarks are of course the "right" thing to do. The problem is figuring out what to measure that will be meaningful in a general context. if you need to create lots of userdata with an associated string, for example, then the intermediate table represents more memory, more steps on access, and more material for the GC to trace. That's all bad. On the other hand, there may be other parts of the system that benefit from the simplification of having environments always be tables and if you only occasionally need the non-table case, those cases might win out. So meaningful benchmarks need to know how to hit both sides of the case and how to compare them. Sorry, I can't offer any guidance there. Personally, on Lightroom, I wished for the ability to store nil in the userdata environment table. For proxies for Objective-C objects, Lightroom uses the userdata environment to store links to other Lua values. That works well, but it takes special work to make sure the proxy stays alive even if the only references to the underlying value are to the native Objective-C object. We only want to do that special work when necessary and hence it would be convenient to have an easy way to tell whether or not a proxy has a custom environment. As it is, I forget whether I ended up assigning a special default environment and testing for equality or whether I encoded some flags into the proxy value. Neither solution was as attractive as simply storing nil in the environment. Mark From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 18:24:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CLO6ZQ024284; Sat, 12 Sep 2009 18:24:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3002191C8; Sat, 12 Sep 2009 18:23:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC8B41909C for ; Sat, 12 Sep 2009 18:23:28 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so690175ana.26 for ; Sat, 12 Sep 2009 14:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=d3XBcps5PI5ZGF7eSKAHqzi81RhRsCg8/JWRmAxsXto=; b=C0tSyYgraj8uhBRRGNBR4mQDtyD+JswfDSONlP7YjPeoQVoICrpxQd31Hzsw2K1JDa Pk8OjKCfRkjWGrob/9ocEd+KI3v4QRLBAxhVQzwKdBR6n0iW1V2iI4SqAYqLGFK/P/Kz vmHaKZABgiflpZ5taW7EGcTeKtZiU3etVnkFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=BhPlsZEB5hphiEq4N+ByrQzA7ojjGqKpQ5kgE8jtnbGlaXk1Gd9j7jNCVDEiO757kL GlUwHlb+ZLMQmF9D3m6YvX+dwrlBGny0HLsemSIUtdg/GJJ9XcLMe6rgjRlLXZr8QXlR kvQ3V9kAAa5NLNkgfWnsRGt+rftAJpxMyEa24= MIME-Version: 1.0 Received: by 10.101.85.10 with SMTP id n10mr4863597anl.156.1252790609366; Sat, 12 Sep 2009 14:23:29 -0700 (PDT) In-Reply-To: <20090912175135.GA7476@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> Date: Sat, 12 Sep 2009 17:23:29 -0400 X-Google-Sender-Auth: 942c4807e8db647d Message-ID: Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > lunamark currently converts standard markdown to either HTML or > LaTeX. In my tests, it is faster than markdown.lua, though still > considerably slower than the lua binding to discount. On the tests I did last night (after John announced this on the markdown list), lunamark was 5-6 times faster than markdown.lua and 12-13 times slower than discount on a 500-word input file. The difference in speed from markdown.lua seemed to increase for larger files. John: will there be a release and a submission to a luarocks repository? I would like to ask people to try it with Sputnik, but without a rock this would be a little harder. > Its main > advantages over the discount binding are portability and extensibility. Some documentation on how to extend it would be really helpful. In particular, if I wanted to extend it in such a way as to get a callback when a particular pattern (let's say "[[...]]") occurs in contexts other than code blocks, can this be done from outside the module? - yuri From lua-bounces@bazar2.conectiva.com.br Sat Sep 12 18:27:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8CLRERt024524; Sat, 12 Sep 2009 18:27:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BAAB19322; Sat, 12 Sep 2009 18:25:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BABF19107 for ; Sat, 12 Sep 2009 18:25:39 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 83B3169189 for ; Sat, 12 Sep 2009 17:25:39 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 12 Sep 2009 17:25:40 -0400 X-Sasl-enc: i4hoZXOn8aU6X9e8za2q0y++UtOxvwhdaNnKwK9P73Xx 1252790736 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 34D8236297 for ; Sat, 12 Sep 2009 17:25:36 -0400 (EDT) Date: Sat, 12 Sep 2009 17:25:34 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Re: Updated RVM patch against Lua5.1.4---needs review Message-ID: <20090912212534.GB19944@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20090907225955.GB27729@vaio.jimpryor.net> <20090908000908.GA3736@mike.de> <20090908011841.GE27729@vaio.jimpryor.net> <20090908130306.GH27729@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: <20090908130306.GH27729@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Here's an update. iFollowing a suggestion from Mike Pall, I changed the patch so that now it reverts, rather than tries to merge, the L->baseCcalls related changes introduced in Lua 5.1.3. Attached now are _two_ patches against the original patch file: http://lua-users.org/files/wiki_insecure/users/VeLoSo/lua5.1-rvm.patch. The first just changes line numberings in the original patch, so can be relied on to be harmless. The second contains all the other changes needed. I think these are all straightforward, except for the L->baseCcalls stuff. That still needs review. Also, there was a if (L->nCcalls >= LUAI_MAXCCALLS) return resume_error(L, "C stack overflow"); introduced to ldo.c: resume_error in the changes between 5.1 and 5.1.4. Following the lead of the Coco patch, I removed this too. But I'm really not sure whether that's right. On Tue, Sep 08, 2009 at 09:03:06AM -0400, Jim Pryor wrote: > > I'm also trying to build and try out the RVM patch. It doesn't patch > > cleanly against the Lua 5.1.4 sources, so I'm going and cleaning it up > > by hand. Mostly this is straightforward. There are a few spots where I'm > > stuck though: the Lua 5.1.4 sources have changed > > from what the RVM patch is trying to replace. I'm not familiar with > > these sources yet, so don't know what's the right merge. > > > > The wiki says that Greg Falcon aka VeLoSo has taken over maintenance of > > the RVM patch. Is there any version floating around against the current > > Lua sources? Is noone using this patch anymore? From what I've seen on > > the mailing list it looks that, though there's no development happening > > on it, it's still regarded as a solid and viable option? > > OK, I've done the grunt work of updating the Resumable VM patch against the > Lua5.1.4 sources. What I've ended up with compiles and runs the test/ > directory in the Lua5.1.4 sources without crashing. But it needs some > code review! I'm new to Lua and in some places I had to make an educated > guess about how to merge the rvm patch against the Lua5.1->Lua5.1.4 > changes. Someone who really understands the source should look this > over. > > I've made it easy for you. Attached are three patches _against the > Lua5.1 rvm patch on the wiki_. That's right, they're patches against the > patch file at > http://lua-users.org/files/wiki_insecure/users/VeLoSo/lua5.1-rvm.patch. > > The first patch just changes some line numbers. I'm sure this is > harmless. > > The second patch... -- Jim Pryor jim@jimpryor.net --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lua5.1.4-rvm-renumbering.patch" --- lua5.1-rvm.patch 2009-09-12 14:46:47.526451362 -0400 +++ lua5.1-rvm-renumbered 2009-09-12 14:12:00.296260931 -0400 @@ -1,7 +1,7 @@ -diff -ruN oldsrc/lapi.c newsrc/lapi.c ---- oldsrc/lapi.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lapi.c 2006-04-15 23:44:03.000000000 -0500 -@@ -283,7 +283,9 @@ +diff -Naurp lua-5.1.4/src/lapi.c lua-5.1.4-rvm/src/lapi.c +--- lua-5.1.4/src/lapi.c 2008-07-04 14:41:18.000000000 -0400 ++++ lua-5.1.4-rvm/src/lapi.c 2009-09-12 13:43:55.216447167 -0400 +@@ -290,7 +290,9 @@ LUA_API int lua_equal (lua_State *L, int lua_lock(L); /* may call tag method */ o1 = index2adr(L, index1); o2 = index2adr(L, index2); @@ -12,7 +12,7 @@ lua_unlock(L); return i; } -@@ -295,8 +297,10 @@ +@@ -302,8 +304,10 @@ LUA_API int lua_lessthan (lua_State *L, lua_lock(L); /* may call tag method */ o1 = index2adr(L, index1); o2 = index2adr(L, index2); @@ -25,7 +25,7 @@ lua_unlock(L); return i; } -@@ -529,7 +533,9 @@ +@@ -536,7 +540,9 @@ LUA_API void lua_gettable (lua_State *L, lua_lock(L); t = index2adr(L, idx); api_checkvalidindex(L, t); @@ -36,7 +36,7 @@ lua_unlock(L); } -@@ -541,7 +547,9 @@ +@@ -548,7 +554,9 @@ LUA_API void lua_getfield (lua_State *L, t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); @@ -47,7 +47,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -641,7 +649,9 @@ +@@ -648,7 +656,9 @@ LUA_API void lua_settable (lua_State *L, api_checknelems(L, 2); t = index2adr(L, idx); api_checkvalidindex(L, t); @@ -58,7 +58,7 @@ L->top -= 2; /* pop index and value */ lua_unlock(L); } -@@ -655,7 +665,9 @@ +@@ -662,7 +672,9 @@ LUA_API void lua_setfield (lua_State *L, t = index2adr(L, idx); api_checkvalidindex(L, t); setsvalue(L, &key, luaS_new(L, k)); @@ -69,7 +69,7 @@ L->top--; /* pop value */ lua_unlock(L); } -@@ -758,22 +770,29 @@ +@@ -765,22 +777,29 @@ LUA_API int lua_setfenv (lua_State *L, i */ @@ -109,7 +109,7 @@ lua_unlock(L); } -@@ -788,31 +807,36 @@ +@@ -795,31 +814,36 @@ struct CallS { /* data to `f_call' */ }; @@ -163,7 +163,7 @@ lua_unlock(L); return status; } -@@ -827,7 +851,7 @@ +@@ -834,7 +858,7 @@ struct CCallS { /* data to `f_Ccall' */ }; @@ -172,7 +172,7 @@ struct CCallS *c = cast(struct CCallS *, ud); Closure *cl; cl = luaF_newCclosure(L, 0, getcurrenv(L)); -@@ -836,7 +860,8 @@ +@@ -843,7 +867,8 @@ static void f_Ccall (lua_State *L, void api_incr_top(L); setpvalue(L->top, c->ud); /* push only argument */ api_incr_top(L); @@ -182,7 +182,7 @@ } -@@ -846,7 +871,7 @@ +@@ -853,7 +878,7 @@ LUA_API int lua_cpcall (lua_State *L, lu lua_lock(L); c.func = func; c.ud = ud; @@ -191,7 +191,7 @@ lua_unlock(L); return status; } -@@ -954,7 +979,7 @@ +@@ -964,7 +989,7 @@ LUA_API int lua_gc (lua_State *L, int wh LUA_API int lua_error (lua_State *L) { lua_lock(L); api_checknelems(L, 1); @@ -200,7 +200,7 @@ lua_unlock(L); return 0; /* to avoid warnings */ } -@@ -982,7 +1007,9 @@ +@@ -992,7 +1017,9 @@ LUA_API void lua_concat (lua_State *L, i api_checknelems(L, n); if (n >= 2) { luaC_checkGC(L); @@ -211,9 +211,9 @@ L->top -= (n-1); } else if (n == 0) { /* push empty string */ -diff -ruN oldsrc/lbaselib.c newsrc/lbaselib.c ---- oldsrc/lbaselib.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lbaselib.c 2006-04-15 23:44:03.000000000 -0500 +diff -Naurp lua-5.1.4/src/lbaselib.c lua-5.1.4-rvm/src/lbaselib.c +--- lua-5.1.4/src/lbaselib.c 2008-02-14 11:46:22.000000000 -0500 ++++ lua-5.1.4-rvm/src/lbaselib.c 2009-09-12 13:43:55.223113658 -0400 @@ -30,13 +30,18 @@ */ static int luaB_print (lua_State *L) { @@ -235,7 +235,7 @@ s = lua_tostring(L, -1); /* get result */ if (s == NULL) return luaL_error(L, LUA_QL("tostring") " must return a string to " -@@ -323,11 +328,12 @@ +@@ -323,11 +328,12 @@ static int luaB_load (lua_State *L) { static int luaB_dofile (lua_State *L) { @@ -253,7 +253,7 @@ } -@@ -369,32 +375,53 @@ +@@ -371,32 +377,53 @@ static int luaB_select (lua_State *L) { } @@ -324,7 +324,7 @@ switch (lua_type(L, 1)) { case LUA_TNUMBER: lua_pushstring(L, lua_tostring(L, 1)); -@@ -466,6 +493,7 @@ +@@ -468,6 +495,7 @@ static const luaL_Reg base_funcs[] = { {"tostring", luaB_tostring}, {"type", luaB_type}, {"unpack", luaB_unpack}, @@ -332,7 +332,7 @@ {"xpcall", luaB_xpcall}, {NULL, NULL} }; -@@ -482,6 +510,7 @@ +@@ -520,6 +548,7 @@ static int auxresume (lua_State *L, lua_ if (!lua_checkstack(co, narg)) luaL_error(L, "too many arguments to resume"); if (lua_status(co) == 0 && lua_gettop(co) == 0) { @@ -340,7 +340,7 @@ lua_pushliteral(L, "cannot resume dead coroutine"); return -1; /* error flag */ } -@@ -489,13 +518,16 @@ +@@ -528,13 +557,16 @@ static int auxresume (lua_State *L, lua_ status = lua_resume(co, narg); if (status == 0 || status == LUA_YIELD) { int nres = lua_gettop(co); @@ -358,7 +358,7 @@ return -1; /* error flag */ } } -@@ -506,16 +538,10 @@ +@@ -545,16 +577,10 @@ static int luaB_coresume (lua_State *L) int r; luaL_argcheck(L, co, 1, "coroutine expected"); r = auxresume(L, co, lua_gettop(L) - 1); @@ -377,7 +377,7 @@ } -@@ -536,8 +562,7 @@ +@@ -575,8 +601,7 @@ static int luaB_auxwrap (lua_State *L) { static int luaB_cocreate (lua_State *L) { lua_State *NL = lua_newthread(L); @@ -387,10 +387,10 @@ lua_pushvalue(L, 1); /* move function to top */ lua_xmove(L, NL, 1); /* move function from L to NL */ return 1; -diff -ruN oldsrc/ldebug.c newsrc/ldebug.c ---- oldsrc/ldebug.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldebug.c 2006-04-15 23:44:03.000000000 -0500 -@@ -36,8 +36,8 @@ +diff -Naurp lua-5.1.4/src/ldebug.c lua-5.1.4-rvm/src/ldebug.c +--- lua-5.1.4/src/ldebug.c 2008-05-08 12:56:26.000000000 -0400 ++++ lua-5.1.4-rvm/src/ldebug.c 2009-09-12 13:43:55.226829075 -0400 +@@ -36,8 +36,8 @@ static const char *getfuncname (lua_Stat static int currentpc (lua_State *L, CallInfo *ci) { if (!isLua(ci)) return -1; /* function is not a Lua function? */ if (ci == L->ci) @@ -401,7 +401,7 @@ } -@@ -597,24 +597,11 @@ +@@ -615,24 +615,11 @@ static void addinfo (lua_State *L, const } @@ -427,10 +427,10 @@ + luaD_throw(L, LUA_ERRRUN); } -diff -ruN oldsrc/ldebug.h newsrc/ldebug.h ---- oldsrc/ldebug.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldebug.h 2006-04-15 23:44:03.000000000 -0500 -@@ -26,7 +26,6 @@ +diff -Naurp lua-5.1.4/src/ldebug.h lua-5.1.4-rvm/src/ldebug.h +--- lua-5.1.4/src/ldebug.h 2007-12-27 08:02:25.000000000 -0500 ++++ lua-5.1.4-rvm/src/ldebug.h 2009-09-12 13:43:55.230162251 -0400 +@@ -26,7 +26,6 @@ LUAI_FUNC void luaG_aritherror (lua_Stat LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); @@ -438,10 +438,10 @@ LUAI_FUNC int luaG_checkcode (const Proto *pt); LUAI_FUNC int luaG_checkopenop (Instruction i); -diff -ruN oldsrc/ldo.c newsrc/ldo.c ---- oldsrc/ldo.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldo.c 2006-04-15 23:44:03.000000000 -0500 -@@ -58,6 +58,10 @@ +diff -Naurp lua-5.1.4/src/ldo.c lua-5.1.4-rvm/src/ldo.c +--- lua-5.1.4/src/ldo.c 2008-01-18 17:31:22.000000000 -0500 ++++ lua-5.1.4-rvm/src/ldo.c 2009-09-12 13:43:55.236828601 -0400 +@@ -58,6 +58,10 @@ void luaD_seterrorobj (lua_State *L, int setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); break; } @@ -452,7 +452,7 @@ case LUA_ERRSYNTAX: case LUA_ERRRUN: { setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ -@@ -83,18 +87,34 @@ +@@ -83,18 +87,34 @@ static void resetstack (lua_State *L, in L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); @@ -493,7 +493,7 @@ } else { L->status = cast_byte(errcode); -@@ -114,12 +134,84 @@ +@@ -114,12 +134,84 @@ int luaD_rawrunprotected (lua_State *L, lj.previous = L->errorJmp; /* chain new error handler */ L->errorJmp = &lj; LUAI_TRY(L, &lj, @@ -579,7 +579,7 @@ /* }====================================================== */ -@@ -180,10 +272,11 @@ +@@ -180,10 +272,11 @@ static CallInfo *growCI (lua_State *L) { void luaD_callhook (lua_State *L, int event, int line) { lua_Hook hook = L->hook; @@ -592,7 +592,7 @@ ar.event = event; ar.currentline = line; if (event == LUA_HOOKTAILRET) -@@ -193,14 +286,22 @@ +@@ -193,14 +286,22 @@ void luaD_callhook (lua_State *L, int ev luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ L->ci->top = L->top + LUA_MINSTACK; lua_assert(L->ci->top <= L->stack_last); @@ -618,7 +618,7 @@ } } -@@ -262,17 +363,17 @@ +@@ -262,17 +363,17 @@ static StkId tryfuncTM (lua_State *L, St int luaD_precall (lua_State *L, StkId func, int nresults) { @@ -641,7 +641,7 @@ luaD_checkstack(L, p->maxstacksize); func = restorestack(L, funcr); if (!p->is_vararg) { /* no varargs? */ -@@ -290,16 +391,18 @@ +@@ -290,16 +391,18 @@ int luaD_precall (lua_State *L, StkId fu L->base = ci->base = base; ci->top = L->base + p->maxstacksize; lua_assert(ci->top <= L->stack_last); @@ -664,7 +664,7 @@ } return PCRLUA; } -@@ -312,11 +415,13 @@ +@@ -312,11 +415,13 @@ int luaD_precall (lua_State *L, StkId fu L->base = ci->base = ci->func + 1; ci->top = L->top + LUA_MINSTACK; lua_assert(ci->top <= L->stack_last); @@ -680,7 +680,7 @@ lua_lock(L); if (n < 0) /* yielding? */ return PCRYIELD; -@@ -349,7 +454,7 @@ +@@ -349,7 +454,7 @@ int luaD_poscall (lua_State *L, StkId fi res = ci->func; /* res == final position of 1st result */ wanted = ci->nresults; L->base = (ci - 1)->base; /* restore base */ @@ -689,7 +689,7 @@ /* move results to correct place */ for (i = wanted; i != 0 && firstResult < L->top; i--) setobjs2s(L, res++, firstResult++); -@@ -366,41 +471,51 @@ +@@ -366,41 +471,51 @@ int luaD_poscall (lua_State *L, StkId fi ** When returns, all the results are on the stack, starting at the original ** function position. */ @@ -767,7 +767,7 @@ } -@@ -414,67 +529,61 @@ +@@ -415,67 +529,61 @@ static int resume_error (lua_State *L, c LUA_API int lua_resume (lua_State *L, int nargs) { @@ -875,7 +875,7 @@ /* ** Execute a protected parser. */ -@@ -484,12 +593,13 @@ +@@ -487,12 +593,13 @@ struct SParser { /* data to `f_parser' const char *name; }; @@ -890,7 +890,7 @@ luaC_checkGC(L); tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, &p->buff, p->name); -@@ -499,6 +609,7 @@ +@@ -502,6 +609,7 @@ static void f_parser (lua_State *L, void cl->l.upvals[i] = luaF_newupval(L); setclvalue(L, L->top, cl); incr_top(L); @@ -898,7 +898,7 @@ } -@@ -507,7 +618,8 @@ +@@ -510,7 +618,8 @@ int luaD_protectedparser (lua_State *L, int status; p.z = z; p.name = name; luaZ_initbuffer(L, &p.buff); @@ -908,9 +908,9 @@ luaZ_freebuffer(L, &p.buff); return status; } -diff -ruN oldsrc/ldo.h newsrc/ldo.h ---- oldsrc/ldo.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ldo.h 2006-04-15 23:44:03.000000000 -0500 +diff -Naurp lua-5.1.4/src/ldo.h lua-5.1.4-rvm/src/ldo.h +--- lua-5.1.4/src/ldo.h 2007-12-27 08:02:25.000000000 -0500 ++++ lua-5.1.4-rvm/src/ldo.h 2009-09-12 13:43:55.240162196 -0400 @@ -31,18 +31,30 @@ /* results from luaD_precall */ #define PCRLUA 0 /* initiated a call to a Lua function */ @@ -948,7 +948,7 @@ LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); -@@ -50,6 +62,13 @@ +@@ -50,6 +62,13 @@ LUAI_FUNC void luaD_growstack (lua_State LUAI_FUNC void luaD_throw (lua_State *L, int errcode); LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); @@ -962,10 +962,10 @@ LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); -diff -ruN oldsrc/lgc.c newsrc/lgc.c ---- oldsrc/lgc.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lgc.c 2006-04-15 23:44:03.000000000 -0500 -@@ -455,15 +455,12 @@ +diff -Naurp lua-5.1.4/src/lgc.c lua-5.1.4-rvm/src/lgc.c +--- lua-5.1.4/src/lgc.c 2007-12-27 08:02:25.000000000 -0500 ++++ lua-5.1.4-rvm/src/lgc.c 2009-09-12 13:43:55.243495581 -0400 +@@ -457,15 +457,12 @@ static void GCTM (lua_State *L) { makewhite(g, o); tm = fasttm(L, udata->uv.metatable, TM_GC); if (tm != NULL) { @@ -982,10 +982,10 @@ g->GCthreshold = oldt; /* restore threshold */ } } -diff -ruN oldsrc/lstate.c newsrc/lstate.c ---- oldsrc/lstate.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lstate.c 2006-04-15 23:44:03.000000000 -0500 -@@ -55,6 +55,7 @@ +diff -Naurp lua-5.1.4/src/lstate.c lua-5.1.4-rvm/src/lstate.c +--- lua-5.1.4/src/lstate.c 2008-01-03 10:20:39.000000000 -0500 ++++ lua-5.1.4-rvm/src/lstate.c 2009-09-12 13:43:55.246828966 -0400 +@@ -55,6 +55,7 @@ static void stack_init (lua_State *L1, l setnilvalue(L1->top++); /* `function' entry for this `ci' */ L1->base = L1->ci->base = L1->top; L1->ci->top = L1->top + LUA_MINSTACK; @@ -993,7 +993,7 @@ } -@@ -67,7 +68,7 @@ +@@ -67,7 +68,7 @@ static void freestack (lua_State *L, lua /* ** open parts that may cause memory-allocation errors */ @@ -1002,7 +1002,7 @@ global_State *g = G(L); UNUSED(ud); stack_init(L, L); /* init stack */ -@@ -78,6 +79,7 @@ +@@ -78,6 +79,7 @@ static void f_luaopen (lua_State *L, voi luaX_init(L); luaS_fix(luaS_newliteral(L, MEMERRMSG)); g->GCthreshold = 4*g->totalbytes; @@ -1010,7 +1010,7 @@ } -@@ -89,15 +91,13 @@ +@@ -89,15 +91,13 @@ static void preinit_state (lua_State *L, L->hook = NULL; L->hookmask = 0; L->basehookcount = 0; @@ -1028,7 +1028,7 @@ setnilvalue(gt(L)); } -@@ -190,9 +190,10 @@ +@@ -190,9 +190,10 @@ LUA_API lua_State *lua_newstate (lua_All } @@ -1040,7 +1040,7 @@ } -@@ -202,9 +203,9 @@ +@@ -201,11 +202,11 @@ LUA_API void lua_close (lua_State *L) { lua_lock(L); luaF_close(L, L->stack); /* close all upvalues for this thread */ luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ @@ -1051,10 +1051,12 @@ L->base = L->top = L->ci->base; L->nCcalls = 0; } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); -diff -ruN oldsrc/lstate.h newsrc/lstate.h ---- oldsrc/lstate.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lstate.h 2006-04-15 23:44:03.000000000 -0500 -@@ -48,10 +48,12 @@ + lua_assert(G(L)->tmudata == NULL); + luai_userstateclose(L); +diff -Naurp lua-5.1.4/src/lstate.h lua-5.1.4-rvm/src/lstate.h +--- lua-5.1.4/src/lstate.h 2008-01-03 10:20:39.000000000 -0500 ++++ lua-5.1.4-rvm/src/lstate.h 2009-09-12 13:43:55.250162141 -0400 +@@ -48,10 +48,12 @@ typedef struct stringtable { typedef struct CallInfo { StkId base; /* base for this function */ StkId func; /* function index in the stack */ @@ -1070,7 +1072,7 @@ } CallInfo; -@@ -100,21 +102,19 @@ +@@ -100,21 +102,19 @@ typedef struct global_State { struct lua_State { CommonHeader; lu_byte status; @@ -1096,7 +1098,7 @@ int hookcount; lua_Hook hook; TValue l_gt; /* table of globals */ -@@ -122,7 +122,7 @@ +@@ -123,7 +122,7 @@ struct lua_State { GCObject *openupval; /* list of open upvalues in this stack */ GCObject *gclist; struct lua_longjmp *errorJmp; /* current error recover point */ @@ -1105,9 +1107,9 @@ }; -diff -ruN oldsrc/ltablib.c newsrc/ltablib.c ---- oldsrc/ltablib.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/ltablib.c 2006-04-15 23:44:03.000000000 -0500 +diff -Naurp lua-5.1.4/src/ltablib.c lua-5.1.4-rvm/src/ltablib.c +--- lua-5.1.4/src/ltablib.c 2008-02-14 11:46:58.000000000 -0500 ++++ lua-5.1.4-rvm/src/ltablib.c 2009-09-12 13:43:55.253495596 -0400 @@ -20,14 +20,22 @@ @@ -1134,7 +1136,7 @@ if (!lua_isnil(L, -1)) return 1; lua_pop(L, 1); /* remove nil result */ -@@ -37,6 +45,7 @@ +@@ -37,6 +45,7 @@ static int foreachi (lua_State *L) { static int foreach (lua_State *L) { @@ -1142,7 +1144,7 @@ luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushnil(L); /* first key */ -@@ -44,7 +53,8 @@ +@@ -44,7 +53,8 @@ static int foreach (lua_State *L) { lua_pushvalue(L, 2); /* function */ lua_pushvalue(L, -3); /* key */ lua_pushvalue(L, -3); /* value */ @@ -1152,10 +1154,10 @@ if (!lua_isnil(L, -1)) return 1; lua_pop(L, 2); /* remove value and result */ -diff -ruN oldsrc/luaconf.h newsrc/luaconf.h ---- oldsrc/luaconf.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/luaconf.h 2006-04-15 23:44:03.000000000 -0500 -@@ -580,7 +580,7 @@ +diff -Naurp lua-5.1.4/src/luaconf.h lua-5.1.4-rvm/src/luaconf.h +--- lua-5.1.4/src/luaconf.h 2008-02-11 11:25:08.000000000 -0500 ++++ lua-5.1.4-rvm/src/luaconf.h 2009-09-12 13:43:55.256828841 -0400 +@@ -607,7 +607,7 @@ union luai_Cast { double l_d; long l_l; /* C++ exceptions */ #define LUAI_THROW(L,c) throw(c) #define LUAI_TRY(L,c,a) try { a } catch(...) \ @@ -1164,9 +1166,9 @@ #define luai_jmpbuf int /* dummy variable */ #elif defined(LUA_USE_ULONGJMP) -diff -ruN oldsrc/lua.h newsrc/lua.h ---- oldsrc/lua.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lua.h 2006-04-15 23:44:03.000000000 -0500 +diff -Naurp lua-5.1.4/src/lua.h lua-5.1.4-rvm/src/lua.h +--- lua-5.1.4/src/lua.h 2008-08-06 09:30:12.000000000 -0400 ++++ lua-5.1.4-rvm/src/lua.h 2009-09-12 13:43:55.260162296 -0400 @@ -16,7 +16,7 @@ #include "luaconf.h" @@ -1176,7 +1178,7 @@ #define LUA_VERSION_NUM 501 #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" -@@ -44,6 +44,7 @@ +@@ -45,6 +45,7 @@ #define LUA_ERRSYNTAX 3 #define LUA_ERRMEM 4 #define LUA_ERRERR 5 @@ -1184,7 +1186,7 @@ typedef struct lua_State lua_State; -@@ -197,22 +198,37 @@ +@@ -198,22 +199,37 @@ LUA_API int (lua_setfenv) (lua_State * /* ** `load' and `call' functions (load and run Lua code) */ @@ -1225,10 +1227,10 @@ /* ** garbage-collection function and options */ -diff -ruN oldsrc/lvm.c newsrc/lvm.c ---- oldsrc/lvm.c 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lvm.c 2006-04-15 23:44:03.000000000 -0500 -@@ -57,10 +57,10 @@ +diff -Naurp lua-5.1.4/src/lvm.c lua-5.1.4-rvm/src/lvm.c +--- lua-5.1.4/src/lvm.c 2007-12-28 10:32:23.000000000 -0500 ++++ lua-5.1.4-rvm/src/lvm.c 2009-09-12 13:43:55.263495541 -0400 +@@ -57,10 +57,10 @@ int luaV_tostring (lua_State *L, StkId o } @@ -1242,7 +1244,7 @@ if (mask > LUA_MASKLINE) { /* instruction-hook set? */ if (L->hookcount == 0) { resethookcount(L); -@@ -76,6 +76,7 @@ +@@ -74,6 +74,7 @@ static void traceexec (lua_State *L, con if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) luaD_callhook(L, LUA_HOOKLINE, newline); } @@ -1250,7 +1252,7 @@ } -@@ -87,7 +88,7 @@ +@@ -85,7 +86,7 @@ static void callTMres (lua_State *L, Stk setobj2s(L, L->top+2, p2); /* 2nd argument */ luaD_checkstack(L, 3); L->top += 3; @@ -1259,7 +1261,7 @@ res = restorestack(L, result); L->top--; setobjs2s(L, res, L->top); -@@ -103,7 +104,7 @@ +@@ -101,7 +102,7 @@ static void callTM (lua_State *L, const setobj2s(L, L->top+3, p3); /* 3th argument */ luaD_checkstack(L, 4); L->top += 4; @@ -1268,7 +1270,7 @@ } -@@ -282,8 +283,11 @@ +@@ -280,8 +281,11 @@ void luaV_concat (lua_State *L, int tota StkId top = L->base + last + 1; int n = 2; /* number of elements handled in this pass (at least 2) */ if (!tostring(L, top-2) || !tostring(L, top-1)) { @@ -1280,7 +1282,7 @@ } else if (tsvalue(top-1)->len > 0) { /* if len=0, do nothing */ /* at least two string values; get as many as possible */ size_t tl = tsvalue(top-1)->len; -@@ -354,7 +358,7 @@ +@@ -354,7 +358,7 @@ static void Arith (lua_State *L, StkId r #define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} @@ -1289,7 +1291,7 @@ #define arith_op(op,tm) { \ -@@ -370,13 +374,14 @@ +@@ -370,13 +374,14 @@ static void Arith (lua_State *L, StkId r @@ -1306,7 +1308,7 @@ cl = &clvalue(L->ci->func)->l; base = L->base; k = cl->p->k; -@@ -385,14 +390,8 @@ +@@ -386,14 +391,8 @@ void luaV_execute (lua_State *L, int nex const Instruction i = *pc++; StkId ra; if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && @@ -1323,7 +1325,7 @@ /* warning!! several calls may realloc the stack and invalidate `ra' */ ra = RA(i); lua_assert(base == L->base && L->base == L->ci->base); -@@ -582,7 +581,7 @@ +@@ -583,7 +582,7 @@ void luaV_execute (lua_State *L, int nex int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ @@ -1332,7 +1334,7 @@ switch (luaD_precall(L, ra, nresults)) { case PCRLUA: { nexeccalls++; -@@ -595,14 +594,14 @@ +@@ -596,14 +595,14 @@ void luaV_execute (lua_State *L, int nex continue; } default: { @@ -1349,7 +1351,7 @@ lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); switch (luaD_precall(L, ra, LUA_MULTRET)) { case PCRLUA: { -@@ -617,7 +616,7 @@ +@@ -618,7 +617,7 @@ void luaV_execute (lua_State *L, int nex setobjs2s(L, func+aux, pfunc+aux); ci->top = L->top = func+aux; /* correct top */ lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); @@ -1358,7 +1360,7 @@ ci->tailcalls++; /* one more call lost */ L->ci--; /* remove new frame */ goto reentry; -@@ -627,7 +626,7 @@ +@@ -628,7 +627,7 @@ void luaV_execute (lua_State *L, int nex continue; } default: { @@ -1367,7 +1369,7 @@ } } } -@@ -635,14 +634,13 @@ +@@ -636,14 +635,13 @@ void luaV_execute (lua_State *L, int nex int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); @@ -1385,7 +1387,7 @@ goto reentry; } } -@@ -662,7 +660,7 @@ +@@ -663,7 +661,7 @@ void luaV_execute (lua_State *L, int nex const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; @@ -1394,7 +1396,7 @@ if (!tonumber(init, ra)) luaG_runerror(L, LUA_QL("for") " initial value must be a number"); else if (!tonumber(plimit, ra+1)) -@@ -679,7 +677,7 @@ +@@ -680,7 +678,7 @@ void luaV_execute (lua_State *L, int nex setobjs2s(L, cb+1, ra+1); setobjs2s(L, cb, ra); L->top = cb+3; /* func. + 2 args (state and index) */ @@ -1403,7 +1405,7 @@ L->top = L->ci->top; cb = RA(i) + 3; /* previous call may change the stack */ if (!ttisnil(cb)) { /* continue loop? */ -@@ -760,3 +758,56 @@ +@@ -761,3 +759,56 @@ void luaV_execute (lua_State *L, int nex } } @@ -1460,9 +1462,9 @@ + GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL); +} + -diff -ruN oldsrc/lvm.h newsrc/lvm.h ---- oldsrc/lvm.h 2006-04-15 23:40:17.000000000 -0500 -+++ newsrc/lvm.h 2006-04-15 23:44:03.000000000 -0500 +diff -Naurp lua-5.1.4/src/lvm.h lua-5.1.4-rvm/src/lvm.h +--- lua-5.1.4/src/lvm.h 2007-12-27 08:02:25.000000000 -0500 ++++ lua-5.1.4-rvm/src/lvm.h 2009-09-12 13:43:55.266828996 -0400 @@ -21,6 +21,9 @@ #define equalobj(L,o1,o2) \ (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) @@ -1473,7 +1475,7 @@ LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); -@@ -30,7 +33,8 @@ +@@ -30,7 +33,8 @@ LUAI_FUNC void luaV_gettable (lua_State StkId val); LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val); --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lua5.1.4-rvm-changes.patch" --- lua5.1-rvm.patch 2009-09-12 14:47:33.206030054 -0400 +++ lua5.1-rvm-unsure 2009-09-12 14:37:04.103228089 -0400 @@ -335,17 +335,14 @@ @@ -520,6 +548,7 @@ static int auxresume (lua_State *L, lua_ if (!lua_checkstack(co, narg)) luaL_error(L, "too many arguments to resume"); - if (lua_status(co) == 0 && lua_gettop(co) == 0) { + if (status != CO_SUS) { + lua_pushboolean(L, 0); - lua_pushliteral(L, "cannot resume dead coroutine"); + lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); return -1; /* error flag */ } -@@ -528,13 +557,16 @@ static int auxresume (lua_State *L, lua_ - status = lua_resume(co, narg); - if (status == 0 || status == LUA_YIELD) { +@@ -530,11 +559,14 @@ static int auxresume (lua_State *L, lua_ int nres = lua_gettop(co); -- if (!lua_checkstack(L, nres)) -+ if (!lua_checkstack(L, nres+1)) + if (!lua_checkstack(L, nres + 1)) luaL_error(L, "too many results to resume"); + lua_pushboolean(L, 1); lua_xmove(co, L, nres); /* move yielded values */ @@ -456,7 +453,7 @@ L->base = L->ci->base; luaF_close(L, L->base); /* close eventual pending closures */ luaD_seterrorobj(L, status, L->base); -- L->nCcalls = 0; +- L->nCcalls = L->baseCcalls; - L->allowhook = 1; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; restore_stack_limit(L); @@ -689,7 +686,7 @@ /* move results to correct place */ for (i = wanted; i != 0 && firstResult < L->top; i--) setobjs2s(L, res++, firstResult++); -@@ -366,41 +471,51 @@ int luaD_poscall (lua_State *L, StkId fi +@@ -366,42 +471,51 @@ int luaD_poscall (lua_State *L, StkId fi ** When returns, all the results are on the stack, starting at the original ** function position. */ @@ -721,12 +718,14 @@ -static void resume (lua_State *L, void *ud) { - StkId firstArg = cast(StkId, ud); - CallInfo *ci = L->ci; -- if (L->status != LUA_YIELD) { /* start coroutine */ +- if (L->status == 0) { /* start coroutine? */ - lua_assert(ci == L->base_ci && firstArg > L->base); - if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) - return; - } - else { /* resuming from previous yield */ +- lua_assert(L->status == LUA_YIELD); +- L->status = 0; - if (!f_isLua(ci)) { /* `common' yield? */ - /* finish interrupted execution of `OP_CALL' */ - lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || @@ -752,7 +751,6 @@ - L->base = L->ci->base; + L->base = L->ci->base; /* restore invariant */ } -- L->status = 0; - luaV_execute(L, cast_int(L->ci - L->base_ci)); + return f_continue(L, (void *)(ptrdiff_t)0); /* resume remaining frames */ +} @@ -767,7 +765,7 @@ } -@@ -415,67 +529,61 @@ static int resume_error (lua_State *L, c +@@ -415,69 +529,61 @@ static int resume_error (lua_State *L, c LUA_API int lua_resume (lua_State *L, int nargs) { @@ -775,10 +773,7 @@ + void *ud; int status; lua_lock(L); -- if (L->status != LUA_YIELD) { -- if (L->status != 0) -- return resume_error(L, "cannot resume dead coroutine"); -- else if (L->ci != L->base_ci) +- if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) + switch (L->status) { + case LUA_YIELD: + pf = f_coresume; @@ -794,6 +789,8 @@ + default: + return resume_error(L, "cannot resume dead coroutine"); + } +- if (L->nCcalls >= LUAI_MAXCCALLS) +- return resume_error(L, "C stack overflow"); + lua_assert(cast(StkId, ud) >= L->base); + for (;;) { + L->nCcalls = 0; @@ -807,17 +804,21 @@ + } + pf = f_continue; + ud = (void *)(ptrdiff_t)0; /* (void *)saveci(L, L->base_ci); */ - } ++ } - luai_userstateresume(L, nargs); -- lua_assert(L->errfunc == 0 && L->nCcalls == 0); +- lua_assert(L->errfunc == 0); +- L->baseCcalls = ++L->nCcalls; - status = luaD_rawrunprotected(L, resume, L->top - nargs); - if (status != 0) { /* error? */ - L->status = cast_byte(status); /* mark thread as `dead' */ - luaD_seterrorobj(L, status, L->top); - L->ci->top = L->top; - } -- else +- else { +- lua_assert(L->nCcalls == L->baseCcalls); - status = L->status; +- } +- --L->nCcalls; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; + L->status = status; lua_unlock(L); @@ -829,7 +830,7 @@ - luai_userstateyield(L, nresults); +LUA_API int lua_vyield (lua_State *L, int nresults, void *ctx) { lua_lock(L); -- if (L->nCcalls > 0) +- if (L->nCcalls > L->baseCcalls) - luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); - L->base = L->top - nresults; /* protect stack slots below */ - L->status = LUA_YIELD; @@ -1018,7 +1019,7 @@ resethookcount(L); L->openupval = NULL; L->size_ci = 0; -- L->nCcalls = 0; +- L->nCcalls = L->baseCcalls = 0; + L->nCcalls = LUA_NOYIELD | LUA_NOVPCALL; L->status = 0; L->base_ci = L->ci = NULL; @@ -1049,7 +1050,8 @@ L->ci = L->base_ci; + L->ci->errfunc = 0; /* no error function during GC metamethods */ L->base = L->top = L->ci->base; - L->nCcalls = 0; +- L->nCcalls = L->baseCcalls = 0; ++ L->nCcalls = 0; } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); lua_assert(G(L)->tmudata == NULL); luai_userstateclose(L); @@ -1072,7 +1074,7 @@ } CallInfo; -@@ -100,21 +102,19 @@ typedef struct global_State { +@@ -100,22 +102,19 @@ typedef struct global_State { struct lua_State { CommonHeader; lu_byte status; @@ -1091,10 +1093,11 @@ - int stacksize; int size_ci; /* size of array `base_ci' */ - unsigned short nCcalls; /* number of nested C calls */ ++ unsigned short nCcalls; /* number of nested C calls + callflags */ +- unsigned short baseCcalls; /* nested C calls when resuming coroutine */ - lu_byte hookmask; - lu_byte allowhook; - int basehookcount; -+ unsigned short nCcalls; /* number of nested C calls + callflags */ int hookcount; lua_Hook hook; TValue l_gt; /* table of globals */ @@ -1169,14 +1172,16 @@ diff -Naurp lua-5.1.4/src/lua.h lua-5.1.4-rvm/src/lua.h --- lua-5.1.4/src/lua.h 2008-08-06 09:30:12.000000000 -0400 +++ lua-5.1.4-rvm/src/lua.h 2009-09-12 13:43:55.260162296 -0400 -@@ -16,7 +16,7 @@ +@@ -16,8 +16,8 @@ #include "luaconf.h" -#define LUA_VERSION "Lua 5.1" +-#define LUA_RELEASE "Lua 5.1.4" +#define LUA_VERSION "Lua 5.1+rvm" ++#define LUA_RELEASE "Lua 5.1.4+rvm" #define LUA_VERSION_NUM 501 - #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" + #define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" @@ -45,6 +45,7 @@ #define LUA_ERRSYNTAX 3 @@ -1241,9 +1246,9 @@ - L->savedpc = pc; + const Instruction *oldpc = GETPC(L); + SAVEPC(L, pc); - if (mask > LUA_MASKLINE) { /* instruction-hook set? */ - if (L->hookcount == 0) { - resethookcount(L); + if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { + resethookcount(L); + luaD_callhook(L, LUA_HOOKCOUNT, -1); @@ -74,6 +74,7 @@ static void traceexec (lua_State *L, con if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) luaD_callhook(L, LUA_HOOKLINE, newline); @@ -1273,15 +1278,15 @@ @@ -280,8 +281,11 @@ void luaV_concat (lua_State *L, int tota StkId top = L->base + last + 1; int n = 2; /* number of elements handled in this pass (at least 2) */ - if (!tostring(L, top-2) || !tostring(L, top-1)) { + if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { + setpvalue(L->top, (void *)(ptrdiff_t)(last - 1)); /* for luaV_resume */ + L->top++; if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) luaG_concaterror(L, top-2, top-1); + L->top--; - } else if (tsvalue(top-1)->len > 0) { /* if len=0, do nothing */ - /* at least two string values; get as many as possible */ - size_t tl = tsvalue(top-1)->len; + } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ + (void)tostring(L, top - 2); /* result is first op (as string) */ + else { @@ -354,7 +358,7 @@ static void Arith (lua_State *L, StkId r #define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} @@ -1291,7 +1296,7 @@ #define arith_op(op,tm) { \ -@@ -370,13 +374,14 @@ static void Arith (lua_State *L, StkId r +@@ -370,14 +374,15 @@ static void Arith (lua_State *L, StkId r @@ -1303,6 +1308,7 @@ const Instruction *pc; + int nexeccalls = 1; reentry: /* entry point */ + lua_assert(isLua(L->ci)); - pc = L->savedpc; + pc = GETPC(L); cl = &clvalue(L->ci->func)->l; --Dxnq1zWXvFF0Q93v-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 13 04:11:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8D7BLBr004169; Sun, 13 Sep 2009 04:11:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 601C718C23; Sun, 13 Sep 2009 04:10:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out1.berkeley.edu (smtp-out1.Berkeley.EDU [128.32.61.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ADB918B12 for ; Sun, 13 Sep 2009 04:10:44 -0300 (BRT) Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by fe1.calmail with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (auth plain:jgm@berkeley.edu) (envelope-from ) id 1MmjER-0007TC-4v for lua@bazar2.conectiva.com.br; Sun, 13 Sep 2009 00:10:44 -0700 Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id AE15A1322F5; Sun, 13 Sep 2009 00:10:08 -0700 (PDT) Date: Sun, 13 Sep 2009 00:10:08 -0700 From: John MacFarlane To: Lua list Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library Message-ID: <20090913071008.GA15326@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean +++ Yuri Takhteyev [Sep 12 09 17:23 ]: > > lunamark currently converts standard markdown to either HTML or > > LaTeX. In my tests, it is faster than markdown.lua, though still > > considerably slower than the lua binding to discount. > > On the tests I did last night (after John announced this on the > markdown list), lunamark was 5-6 times faster than markdown.lua and > 12-13 times slower than discount on a 500-word input file. The > difference in speed from markdown.lua seemed to increase for larger > files. > > John: will there be a release and a submission to a luarocks > repository? I would like to ask people to try it with Sputnik, but > without a rock this would be a little harder. I'll look into releasing on luaforge. The project needs some polishing first, e.g. better error handling and documentation. > > Its main > > advantages over the discount binding are portability and extensibility. > > Some documentation on how to extend it would be really helpful. > > In particular, if I wanted to extend it in such a way as to get a > callback when a particular pattern (let's say "[[...]]") occurs in > contexts other than code blocks, can this be done from outside the > module? No, currently you'd have to modify the module code. In the definition of 'parser' in markdown_parser.lua, you'd add a clause for your new pattern: something like MyPattern = p"[[" * lpeg.Ct((_"Inline" - p"]]")^0) * p"]]" / writer.mypattern (Note: p is a local abbreviation for lpeg.P, _ for lpeg.V.) You'd add this to the list of Inline elements, before Link and Image. Then you'd add a mypattern function to the table returned by 'writer' in html_writer.lua (and any other writers you plan to use). This is your callback. If you wanted the [[..]] to put a list of inline elements inside tags, you could do this: mypattern = function(s) return {"", s, ""} end The details really depend on what you want the [[...]] construct to mean. Hope that's enough to get you going... I want to think more about how to set things up so that custom parsers and callbacks can be inserted without modifying the module code. That would probably be a good feature. John From lua-bounces@bazar2.conectiva.com.br Sun Sep 13 04:22:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8D7LxV5005022; Sun, 13 Sep 2009 04:22:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAF6918CAD; Sun, 13 Sep 2009 04:21:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f227.google.com (mail-ew0-f227.google.com [209.85.219.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E93DB18B72 for ; Sun, 13 Sep 2009 04:21:33 -0300 (BRT) Received: by ewy27 with SMTP id 27so2410796ewy.40 for ; Sun, 13 Sep 2009 00:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=7YYvPFIeCVKtJqGO2vwCoaVt+eESEaliQV0/SKQsitw=; b=fuymZmHJLKUlyBx1T2HE742z1EU09sYR6av3+00LuNbebMRFOSVrnx7FY1Ex78HpVg CFunJnNcbwbNp8/Kw28Itty9MQ23vzo2bPjzU2C6cYj43vHQo6fHJJEvbucEox7E0VCA Fe0qGdrSyYsM20awFZHSblM5DXToT+TKgactU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=nxrNFISLN1z450rqmUzJKG8WFeNKH4MpMMZ8gL2T1K4T90niJpWovMD3Atnt9aQ/AW z8BCiPwvektf/Pkc1GS9I4sYOus8yWRFf5+fd6QAgoLFCR6/tcH3S2sl6wo3sTIK5UsV NQnZGeZjnn8Y6Qlwy2qcf7Oukou/ee4sfCKzE= Received: by 10.211.143.9 with SMTP id v9mr5326319ebn.53.1252826493305; Sun, 13 Sep 2009 00:21:33 -0700 (PDT) Received: from ?95.78.70.81? ([95.78.70.81]) by mx.google.com with ESMTPS id 28sm3903807eye.40.2009.09.13.00.21.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Sep 2009 00:21:32 -0700 (PDT) Date: Sun, 13 Sep 2009 11:21:27 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <154214737.20090913112127@gmail.com> To: John MacFarlane Subject: Re[2]: ANNOUNCE: lunamark - PEG-based markdown conversion library In-Reply-To: <20090913071008.GA15326@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> <20090913071008.GA15326@protagoras.phil.berkeley.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello John, Sunday, September 13, 2009, 11:10:08 AM, you wrote: > I want to think more about how to set things up so that custom parsers and > callbacks can be inserted without modifying the module code. That would > probably be a good feature. the way i implement it is to provide function register_xxx that should be called by user with callback and all other required parameters: register_callback ("", function (tag) ... end) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sun Sep 13 13:00:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8DFxuNS021636; Sun, 13 Sep 2009 12:59:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27F9418AAD; Sun, 13 Sep 2009 12:59:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C91C7188DB for ; Sun, 13 Sep 2009 12:59:18 -0300 (BRT) Received: from lakeland.eecs.harvard.edu (lakeland.eecs.harvard.edu [140.247.62.173]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 849E3256041 for ; Sun, 13 Sep 2009 11:59:16 -0400 (EDT) Received: by lakeland.eecs.harvard.edu (Postfix, from userid 32074) id 655EFB130F; Sun, 13 Sep 2009 11:59:16 -0400 (EDT) To: Lua list Subject: Re: how to load a very large table with more than 2^18 literal strings? In-reply-to: <20090911223841.D13015@lua.tecgraf.puc-rio.br> (sfid-H-20090911-214705-+85.11-1@multi.osbf.lua) References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> (sfid-H-20090911-214705-+85.11-1@multi.osbf.lua) Comments: In-reply-to Luiz Henrique de Figueiredo message dated "Fri, 11 Sep 2009 22:38:41 -0300." Date: Sun, 13 Sep 2009 11:59:14 -0400 From: Norman Ramsey Message-Id: <20090913155916.655EFB130F@lakeland.eecs.harvard.edu> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > I would prefer to write large table literals than to populate tables > > by individual assignment, since I don't want to pay the costs for growth. > > One thing that I wish I had a nice solution for is that the bytecode for > table literals actually does not care that the table is a new table: it > only requires a table at the correct register. So, in principle, you could > "merge" a table literal into an existing table very efficiently, if only we > could say it in the program. (If you're generating bytecode, then like I > said you don't need to do anything special.) Haven't you guys written a whole compiler that generates bytecode? :-) It might be a little tricky given the slick nature of your one-pass compiler, but it would be fabulous if the next minor version of Lua could handle arbitrarily large table literals by spawning off preceding statements as needed. (This is a place where you could actually exploit Roberto's famous insistence of having no defined order of evaluation.) I did something like this once when I had to translate a language with structure literals into ANSI C, which has only statements assigning to structures. It is a little messy but really just another form of backpatching. I wish I had time to take a swing at this and send you a patch. But maybe somebody else will! If not, there's always next summer... Norman From lua-bounces@bazar2.conectiva.com.br Sun Sep 13 19:18:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8DMI0Tl019651; Sun, 13 Sep 2009 19:18:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8944A18959; Sun, 13 Sep 2009 19:17:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5583D188E9 for ; Sun, 13 Sep 2009 19:17:19 -0300 (BRT) Received: by ywh29 with SMTP id 29so3915191ywh.23 for ; Sun, 13 Sep 2009 15:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Ii6NswusffDhke3OHqgYzw01R6m1g6trhcIPzhOAgTI=; b=pOinsstck5bP0zRNnXOJCs7tGn+9+uB9VONa+zjgRSywgwqmlaYuUd509Dw5ITGvA7 RInZNuPbDPU8DxYXA50kWVVSOCDIlRyF4VpkUiq2HuLBy1Bbyp2bRumPV2AqPdqyDx0H PlZ1DGH81yIQ5Dk4X1HP+p9X4w3pN4UeRCemc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=O7MWcB5uhucY6NZ64lTTIs6JcbgWEob23+cKRhzX0f3iyOhP+D8GFZ5SdXzHf4JWe9 SBU4AEv3hqw5Qs0aCLAveKeukaiuGgQ2XDQMUeqGaN4FZ2IA8KSebeLrBpNrYvPddT6g sLsS9lBzWkh0q16QMXx46qJub/fLWRyDGPCSM= MIME-Version: 1.0 Received: by 10.150.32.1 with SMTP id f1mr8783869ybf.96.1252880240318; Sun, 13 Sep 2009 15:17:20 -0700 (PDT) Date: Mon, 14 Sep 2009 00:17:20 +0200 Message-ID: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> Subject: [ANN] luamake From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hi list, I'm releasing luamake, a purely Lua build tool (except for the LuaFileSystem dependency, which is included). This is an OSX and Linux only system as of now. If you're on Windows, all I can say is sorry, but I have no plans of adding windows. Submissions welcome however. I've been using luamake for Linux development of a fairly involved Lua application (LuaAV) for a few months now and it has been extremely useful. From the README: Luamake is a platform independent configuration and build system that using the standard Lua command-line interpreter. Only one binary has to be built before it can be used: LuaFileSystem (lfs). Otherwise, Luamake is entirely made of Lua scripts. The goal is to develop a straightforward data description format for cross-platform configuration and compilation of Lua modules, shared and static libraries, as well as applications. Luamake consists of the following modules: - for configuration: autoconf.lua - high-level interface: luamake.lua - for data description: project.lua path.lua config.lua dependency.lua src.lua - for platform independence (the only platform-specific module): platform.lua - general utilities: buildutils.lua I've provided a vanilla build script to start from and a few example project files for LuaTask (simple) and LuaSocket (more complicated) You can get a flavor of the data description format here: http://www.mat.ucsb.edu/projects/luaAV/browser/luamake/examples/projects/luatask.lua http://www.mat.ucsb.edu/projects/luaAV/browser/luamake/examples/projects/luasocket.lua A common idiom used in project files for the luamake system when choices between specific platforms are required is as follows: ({OSX = "osx data", LINUX = "linux data"})[OS] where OS is a variable derived from the autoconf module. The autoconf module compiles small snippets of C/C++ code and runs the resulting binary to get configuration variables such as platform and 32/64 bit-ness. Instructions are in the README for how to start. It's basically: cd luamake/src make cd .. lua build.lua examples/build.settings.lua -------------------------------------------------------------------------------------------- Download: http://lua-av.mat.ucsb.edu/downloads/luamake.zip Source: svn co https://svn.mat.ucsb.edu/svn/luaAV/luamake wes From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 01:59:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E4x1gv020365; Mon, 14 Sep 2009 01:59:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C631518813; Mon, 14 Sep 2009 01:58:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f195.google.com (mail-vw0-f195.google.com [209.85.212.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6390918782 for ; Mon, 14 Sep 2009 01:58:23 -0300 (BRT) Received: by vws33 with SMTP id 33so182215vws.33 for ; Sun, 13 Sep 2009 21:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=UPBwYluDVyEgOnZAUn3M1mw2A7iVGnv5h2ae+YCZ+NQ=; b=Q1CsXvhb9/ZfVrZeHCYWsISDDywXgHUk5pPH6mlYTRsZWPUwGuHmWr8hrWRIAnTeDv sm8ZH8wQysSiRiBOKra5GZiwryVAjCO4wtYbXqS2qtDk8VcXPk3MSSfzob0Gps1Cx4VT Tvuhc9hOqfVCH+2vtceSuYw43YKicCUKqHzJQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xWN8WZmI2CBApEUMvAOu5fxfQkPNdltKmDKhUB+xX5b9efks5dwGXgcR9X7XgcOSlI rCnJI4PSvAdydlftbVgfe6HswNzhBLtPbwanDoJQKaKVtENLJbmCRF4Ev8Fz15099/3R Axra6+/n6jMtZO0g2DLB1s0X31TeAv/txHUAA= MIME-Version: 1.0 Received: by 10.220.108.41 with SMTP id d41mr7443005vcp.28.1252904304129; Sun, 13 Sep 2009 21:58:24 -0700 (PDT) In-Reply-To: <560972290909110309q6041ccccu8187cc1e75c054a5@mail.gmail.com> References: <4AA65DA4.2090109@cowlark.com> <540E6A28-A007-416A-B834-1382C826B779@gmail.com> <438c11350909110055yc189096wb998e349cad2ebf8@mail.gmail.com> <3443661759085753372@unknownmsgid> <560972290909110309q6041ccccu8187cc1e75c054a5@mail.gmail.com> Date: Mon, 14 Sep 2009 12:58:24 +0800 Message-ID: <438c11350909132158k555947abi13d3f579116d5296@mail.gmail.com> Subject: Re: The source file culture From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 11, 2009 at 6:09 PM, steve donovan wrote: > pan shizhu says: >> IMO release windows-based binraries to the relatively small amount of > users doesn't seem to help a lot. > Fortunately, it's already happening and should not cause problems for > those who don't like the idea ;) Yes, providing windows-binary doesn't hurt, but I'm just explaining why "the source file culture" is important for lua . From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:08:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E67xmk025635; Mon, 14 Sep 2009 03:07:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D39218850; Mon, 14 Sep 2009 03:07:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa013msr.fastwebnet.it (aa013msr.fastwebnet.it [85.18.95.73]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2F0218838 for ; Mon, 14 Sep 2009 03:07:26 -0300 (BRT) Received: from [192.168.0.16] (39.254.73.45) by aa013msr.fastwebnet.it (8.5.016.6) id 4A9CF8A8018A2C4A for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 08:07:25 +0200 Message-Id: From: "Andrea D'Amore" To: Lua list In-Reply-To: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What is the equivalent of die() command of perl Date: Mon, 14 Sep 2009 08:07:24 +0200 References: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/set/09, at 14:09, steve donovan wrote: > f = assert(io.open(file)) > This actually gives a sensible error trace, because if io.open fails > it returns two values, nil and an error message. The second parameter > of assert() is the message string, so it works as expected. Doesn't this apply when assert is used as a statement too? -- Andrea From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:11:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E6BQ87025927; Mon, 14 Sep 2009 03:11:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6E1318890; Mon, 14 Sep 2009 03:11:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A5631883F for ; Mon, 14 Sep 2009 03:10:59 -0300 (BRT) Received: by ywh29 with SMTP id 29so4277968ywh.23 for ; Sun, 13 Sep 2009 23:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=+m7r3svMj3eC8I2YVZKeRK8No5wALwuD/1XU+qrZRgI=; b=ueod53aAtDgI0mz9qyWrNvvTrjrDQazLr3aB043obMXJ9u4LSkqtIFeQ5QbuaLwSlm 46+EXK4sKBv2VU3Z/AvpQtulufXpEPhrSwYRwcQY58zEtECDaz/+rTBMRsdsHXVMZWsV /cECq5QPwDOEbyU3yWi2UWjPN8E7e1sJAK+wo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=hdUyoXzqZxkImEhN4+ZwtcD77oYXtS70oml5RtxgEI7V3yZC+TgRd5vUG3Yq+O2l5n U3RRTlMF+NsO0pDBT8+08JndTAJPLqDQDCkm5KvJv9OpjTPws9lw+T/3k2bRzvX/k74k gWDaZqCykvvnp8wB00YINQVzNwnlOIPKfW3K0= Received: by 10.91.49.1 with SMTP id b1mr3649387agk.55.1252908659728; Sun, 13 Sep 2009 23:10:59 -0700 (PDT) Received: from ?127.0.0.1? ([125.70.72.222]) by mx.google.com with ESMTPS id 20sm7738539agd.64.2009.09.13.23.10.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 13 Sep 2009 23:10:58 -0700 (PDT) Message-ID: <4AADDE6D.10301@gmail.com> Date: Mon, 14 Sep 2009 14:10:53 +0800 From: cometwk User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] Coco 1.1.6 released + URL changed (Mike Pall) Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I find a Segmentation fault (core dumped) in Coco 1.1.6 release. OS: x86_64 GNU/Linux lua script: ''' local resume, yield = coroutine.resume, coroutine.yield function pcall_and_yield() error "here , when -g in linux x86_64 , will Segmentation fault" print ("ok") end local cx = coroutine.create(pcall_and_yield) print(resume(cx)) ''' Coco 1.1.6 with Makefile -g ( not -O2) . but with -O2 work fine ! with -g -DCOCO_USE_UCONTEXT work fine too. or I am wrong ? wukun (cometwk@gmai.com) From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:22:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E6MfY0026746; Mon, 14 Sep 2009 03:22:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EACB6189E9; Mon, 14 Sep 2009 03:22:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa012msr.fastwebnet.it (aa012msr.fastwebnet.it [85.18.95.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A38291883D for ; Mon, 14 Sep 2009 03:22:15 -0300 (BRT) Received: from [192.168.0.16] (39.254.73.45) by aa012msr.fastwebnet.it (8.5.016.6) id 4AA013210143D21C for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 08:22:15 +0200 Message-Id: From: "Andrea D'Amore" To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Apache mailing list on using Lua. Date: Mon, 14 Sep 2009 08:22:14 +0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 09/set/09, at 20:11, Georgios Petsagourakis wrote: > This will be a great success for Lua, if it becomes a reality. > mod_lua will receive a more solid support and there will be > a great rise on the use of Lua Isn't mod_wombat the active lua module for apache? -- Andrea From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:40:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E6eDeb028130; Mon, 14 Sep 2009 03:40:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F94318A35; Mon, 14 Sep 2009 03:39:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70CA318861 for ; Mon, 14 Sep 2009 03:39:42 -0300 (BRT) Received: by bwz10 with SMTP id 10so2200989bwz.5 for ; Sun, 13 Sep 2009 23:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Q+MhJvOHWBMof/hq3ncorEruonxGl6wZB/kMSuND9Xg=; b=px9Icq4z64GBw4T5SZxnTDLkJsFtD94Nv1htL2v+rA4t9AZLGebu2iR5BQ+hz5qSvd k1axV8h1q+HwSLSeAH7TlzcU2bZ8MDES1X9r9tlLM5Fbw+5sDOUJYS5OTcfXFem0jXpH cIHpwM2zwypQ4ko81d+5A0d+02PX/SE9FD76A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=relzbFfqJROnxH+JH8QsPwr9U7XDDc7M5kv6pb9H2rhpMsk8sBmKmhqqZmJiMjFOF6 lJ1c5imusS/I2gMqMiauzQEhRsXZG1fGlFz46SXQhHVPFzXQfYi0dU6Cq2PXDoQQJeNj GWVPNurIGm6QdVn3d1P74j8lZKpIBMTqM/go4= MIME-Version: 1.0 Received: by 10.204.162.143 with SMTP id v15mr4807108bkx.50.1252910381956; Sun, 13 Sep 2009 23:39:41 -0700 (PDT) In-Reply-To: References: <560972290909100509q625c3778v828bca78e0042691@mail.gmail.com> Date: Mon, 14 Sep 2009 08:39:41 +0200 Message-ID: <560972290909132339m50436f72q16e6220ba361166a@mail.gmail.com> Subject: Re: What is the equivalent of die() command of perl From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 8:07 AM, Andrea D'Amore wrote: > Doesn't this apply when assert is used as a statement too? Sure. Function calls are allowed to be statements. The cool thing about Lua's assert is that it can be used as a function. You could say something Perlish like this: f = io.open(file) or die 'cannot open' But AFAIK there's no way then to use the actual error message returned. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:41:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E6fdWZ028266; Mon, 14 Sep 2009 03:41:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A281018D75; Mon, 14 Sep 2009 03:41:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa012msr.fastwebnet.it (aa012msr.fastwebnet.it [85.18.95.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 332E318885 for ; Mon, 14 Sep 2009 03:41:17 -0300 (BRT) Received: from [192.168.0.16] (39.254.73.45) by aa012msr.fastwebnet.it (8.5.016.6) id 4AA01321014431A1 for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 08:41:19 +0200 Message-Id: From: "Andrea D'Amore" To: Lua list In-Reply-To: <89d273ba0909100200w7f27f5d9j60c83acc5884512b@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Announce: Darwin module system Date: Mon, 14 Sep 2009 08:41:17 +0200 References: <89d273ba0909100200w7f27f5d9j60c83acc5884512b@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/set/09, at 11:00, Jerome Vuarand wrote: > People (not you, obviously) often don't understand the Lua module > system very well. I don't, for instance. But I'd like to understand it more. > Not that long ago we had yet another verbose discussion on this > mailing list I'm gonna search in ml archive but can you point me to a further reference? Is it the "Packages" chapter of PiL? -- Andrea From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 03:55:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E6trAr029379; Mon, 14 Sep 2009 03:55:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9416718BD6; Mon, 14 Sep 2009 03:55:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEAFB1886D for ; Mon, 14 Sep 2009 03:55:25 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 02719B1C7F for ; Mon, 14 Sep 2009 09:55:23 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> Subject: Re: userdata environment To: "Lua list" Date: Mon, 14 Sep 2009 09:55:24 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 12 Sep 2009 21:30:30 +0300, Mark Hamburg wrote: > The garbage collector may also expect that the environment is a table > rather than an arbitrary object. That would be the other place to check > when making changes. It looks like it doesn't... > Benchmarks are of course the "right" thing to do. The problem is > figuring out what to measure that will be meaningful in a general > context. Important criteria for me is size and complexity of C code. And memory usage. > Personally, on Lightroom, I wished for the ability to store nil in the > userdata environment table. That's harder. Currently it's a pointer to something that can be put in GC list, which excludes nil, bools, numbers and lightuserdata. Changing that would be a much bigger patch, and would increase size of userdata header. However, your comment made me think about what is the default value for that environment ... and it (obviously) is the currently active environment. I don't like that. It means that every userdata captures a reference to environment, even if I will not use it. If there is a code that overrides environment with a temporary table (e.g. to plug some names into global namespace, or to do something like 'module' does), that table will live as long as any userdata created by the code that use it. Even if it is not needed anymore. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 04:08:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E78EgK031796; Mon, 14 Sep 2009 04:08:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BC6C18EA5; Mon, 14 Sep 2009 04:07:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9E9618C2F for ; Mon, 14 Sep 2009 04:07:37 -0300 (BRT) Received: by fxm18 with SMTP id 18so2208466fxm.5 for ; Mon, 14 Sep 2009 00:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=cz/RiHMuNRU6mGhtLmq33Bd6cUMiv/i6hl1lOCN6B7s=; b=hAp1cnShmksL/8jafu90F3zSV+Qn5JtuI2YIRnBW+IcR/3uGXillLOyu0jgniAWxO2 xSl5InW/0bEiIqP+VLX2VmFzkJcab9+KLClcwO7suRshI4m3OztSeaJEtKJTasNE4+Cl /z9j/a69bmsl/otJHwOEIOV3PE/gXvQ4BiPbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PP6J+LXBTY1RoIVQczWiUm8jkftNCnGovG+L0YdGzbyUF6AolUhrigGvmd+j8xfVOR 848sk/Wn5AeuFXYaKxGNBttH5KCBIvBhADhxF4iVUlYADGyMVr0lpKXe/ooVsY74Yt4/ B6BhtHaVKc9/xf5Wr1qBjcUWiFRr6Snclonq4= MIME-Version: 1.0 Received: by 10.204.34.197 with SMTP id m5mr4808254bkd.106.1252912058149; Mon, 14 Sep 2009 00:07:38 -0700 (PDT) In-Reply-To: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> Date: Mon, 14 Sep 2009 09:07:38 +0200 Message-ID: <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> Subject: Re: [ANN] luamake From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8E78EgK031796 On Mon, Sep 14, 2009 at 12:17 AM, Wesley Smith wrote: > hi list, > I'm releasing luamake, a purely Lua build tool (except for the > LuaFileSystem dependency, which is included).  This is an OSX and > Linux only system as of now.  If you're on Windows, all I can say is > sorry, but I have no plans of adding windows. This is obviously an idea that wants to happen (and keep happening!). The autoconfig part of luamake is particularly interesting. http://lua-users.org/wiki/LuaBuildSystems The distinctions are: - does not require make (i.e. does dependencies in-house) like Bou and PrimeMover - generates make files (like Hamster and premake) - integrated into a package manager (LuaRocks, LuaDist) But the main difference of interest is declarative versus imperative. Luamake seems to be declarative, like LuaRocks, whereas something like Hamster (basically Lua SCons) is mostly declarative but can be used imperatively. The trouble with purely declarative schemes is handling those odd little cases where a bit of programming makes life easier. How does luamake handle the awkward cases? What I like about the LuaRocks build system is that it has flexible backends (currently, builtin, make and CMake) - and it understands that different animal, the Microsoft C compiler. If a new build system is available as a rock, then LuaRocks can handle the extra dependency transparently. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 04:18:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E7I3qL032709; Mon, 14 Sep 2009 04:18:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEB8918E5B; Mon, 14 Sep 2009 04:17:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f197.google.com (mail-pz0-f197.google.com [209.85.222.197]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C05418BFD for ; Mon, 14 Sep 2009 04:17:26 -0300 (BRT) Received: by pzk35 with SMTP id 35so2370697pzk.11 for ; Mon, 14 Sep 2009 00:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rvW1/fxxp6TnlKki9Ho7oz84VhoAqIpDpvtjQI9Nng0=; b=siH9TbyvzU0H6fA24nhNvLaaQ5Ay4Dsqww/TLa9nxB7sNq9e/AT8Dy+ji+jGIGnS4+ biCE/QervhWCx8rOHc0EK/pvmry52b40kngMhIaIJLoaUP4GTaYbo6FwoH10J1z7KhYy QjSrk5TyoDS5o0X6Tc9lWOMv/g90jAhb0MAi8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jp+oim5kYcG523lCMlLW44vcJfTJdxWcQiZo5GpgV8fDj1T/4yeOpHBkU8DVKVwVRh Kqi8ocYZ19P6jo8djPXLAo+FGD+wOs/grJOvbPwMDshEaHPIy3LD1wmYUrJ+Y7vxOe5P bd6/ud3ovjAkJ2xz56rAgsyHmTUJx8Jecyk/g= MIME-Version: 1.0 Received: by 10.142.2.36 with SMTP id 36mr477704wfb.139.1252912647492; Mon, 14 Sep 2009 00:17:27 -0700 (PDT) In-Reply-To: <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> Date: Mon, 14 Sep 2009 15:17:27 +0800 Message-ID: Subject: Re: [ANN] luamake From: Linker To: Lua list Content-Type: multipart/alternative; boundary=00504502ad2349d410047384759e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502ad2349d410047384759e Content-Type: text/plain; charset=UTF-8 Do you know the Premake? It's a lua-based make system,too. On Mon, Sep 14, 2009 at 15:07, steve donovan wrote: > On Mon, Sep 14, 2009 at 12:17 AM, Wesley Smith > wrote: > > hi list, > > I'm releasing luamake, a purely Lua build tool (except for the > > LuaFileSystem dependency, which is included). This is an OSX and > > Linux only system as of now. If you're on Windows, all I can say is > > sorry, but I have no plans of adding windows. > > This is obviously an idea that wants to happen (and keep happening!). > The autoconfig part of luamake is particularly interesting. > > http://lua-users.org/wiki/LuaBuildSystems > > The distinctions are: > - does not require make (i.e. does dependencies in-house) like Bou > and PrimeMover > - generates make files (like Hamster and premake) > - integrated into a package manager (LuaRocks, LuaDist) > > But the main difference of interest is declarative versus imperative. > Luamake seems to be declarative, like LuaRocks, whereas something like > Hamster (basically Lua SCons) is mostly declarative but can be used > imperatively. > > The trouble with purely declarative schemes is handling those odd > little cases where a bit of programming makes life easier. > > How does luamake handle the awkward cases? > > What I like about the LuaRocks build system is that it has flexible > backends (currently, builtin, make and CMake) - and it understands > that different animal, the Microsoft C compiler. > > If a new build system is available as a rock, then LuaRocks can handle > the extra dependency transparently. > > steve d. > -- Regards, Linker Lin linker.m.lin@gmail.com --00504502ad2349d410047384759e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Do you know the Premake? It's a lua-based make system,too.

On Mon, Sep 14, 2009 at 15:07, steve donovan <steve.j.donovan@= gmail.com> wrote:
On Mon, Sep 14, 2009 at 1= 2:17 AM, Wesley Smith <wesley.h= oke@gmail.com> wrote:
> hi list,
> I'm releasing luamake, a purely Lua build tool (except for the
> LuaFileSystem dependency, which is included). =C2=A0This is an OSX and=
> Linux only system as of now. =C2=A0If you're on Windows, all I can= say is
> sorry, but I have no plans of adding windows.

This is obviously an idea that wants to happen (and keep happening!).=
The autoconfig part of luamake is particularly interesting.

htt= p://lua-users.org/wiki/LuaBuildSystems

The distinctions are:
=C2=A0- does not require make (i.e. does dependencies in-house) like Bou and PrimeMover
=C2=A0- generates make files (like Hamster and premake)
=C2=A0- integrated into a package manager (LuaRocks, LuaDist)

But the main difference of interest is declarative versus imperative.
Luamake seems to be declarative, like LuaRocks, whereas something like
Hamster (basically Lua SCons) is mostly declarative but can be used
imperatively.

The trouble with purely declarative schemes is handling those odd
little cases where a bit of programming makes life easier.

How does luamake handle the awkward cases?

What I like about the LuaRocks build system is that it has flexible
backends (currently, builtin, make and CMake) - and it understands
that different animal, the Microsoft C compiler.

If a new build system is available as a rock, then LuaRocks can handle
the extra dependency transparently.

steve d.



--
Regards,
Linker Lin<= br>linker.m.lin@gmail.com
--00504502ad2349d410047384759e-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 04:45:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E7jSMB002771; Mon, 14 Sep 2009 04:45:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0F4918ED1; Mon, 14 Sep 2009 04:45:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88DC187E6 for ; Mon, 14 Sep 2009 04:44:51 -0300 (BRT) Received: by bwz10 with SMTP id 10so2228734bwz.5 for ; Mon, 14 Sep 2009 00:44:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.24.2 with SMTP id t2mr4871637bkb.65.1252914292673; Mon, 14 Sep 2009 00:44:52 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Sep 2009 09:44:52 +0200 X-Google-Sender-Auth: 4555ff0f39c56f84 Message-ID: Subject: Re: Apache mailing list on using Lua. From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 8:22 AM, Andrea D'Amore wrote: > On 09/set/09, at 20:11, Georgios Petsagourakis wrote: > >> This will be a great success for Lua, if it becomes a reality. >> mod_lua will receive a more solid support and there will be >> a great rise on the use of Lua > > Isn't mod_wombat the active lua module for apache? Mod_wombat is renamed mod_lua in Apache 2.4 : http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/ -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 05:01:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E80vtw004252; Mon, 14 Sep 2009 05:00:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F76118D64; Mon, 14 Sep 2009 05:00:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF66A1882C for ; Mon, 14 Sep 2009 05:00:22 -0300 (BRT) Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8E80KOC011228; Mon, 14 Sep 2009 17:00:20 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay31.aps.necel.com with ESMTP; Mon, 14 Sep 2009 17:00:20 +0900 Received: from dhlpc061 ([10.114.113.123] [10.114.113.123]) by relay11.aps.necel.com with ESMTP; Mon, 14 Sep 2009 17:00:20 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 2F27152E1E7; Mon, 14 Sep 2009 17:00:20 +0900 (JST) From: Miles Bader To: TNHarris Subject: Re: Regarding the name 'pairs' References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090910162412.1043e325@egeria.whoopdedo.org> <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> <20090911163400.22b594fe@egeria.whoopdedo.org> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 14 Sep 2009 17:00:20 +0900 In-Reply-To: <20090911163400.22b594fe@egeria.whoopdedo.org> (TNHarris's message of "Fri, 11 Sep 2009 16:34:00 -0400") Message-ID: Lines: 13 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean TNHarris writes: > It's "each" instead of "iterate" simply for being shorter. I don't > particularly care for "iter" and "enum" because they're abbreviations. > And "enum" already has a meaning in C. Hmm, I'd use "values(set)" rather than "each": for v in values(set) do ... end -miles -- Fast, small, soon; pick any 2. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 05:26:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E8Q25n006214; Mon, 14 Sep 2009 05:26:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3DA518EDB; Mon, 14 Sep 2009 05:25:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AD7B188DA for ; Mon, 14 Sep 2009 05:25:32 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mn6sP-0004og-EC for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 08:25:33 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090910162412.1043e325@egeria.whoopdedo.org> <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> <20090911163400.22b594fe@egeria.whoopdedo.org> In-Reply-To: Subject: RE: Regarding the name 'pairs' Date: Mon, 14 Sep 2009 09:24:33 +0100 Message-ID: <000d01ca3514$c9c995d0$5d5cc170$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco1EYSrPW0vySOASYSmEmCIGlipIgAAq0ag Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is good, but trouble is you get lots of global iterator factories with ill-defined behaviour if applied to the wrong class. The method approach solves this, so: for v in set:values() do ... end But the need for that empty parenthesis still rankles ... > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Miles Bader > Sent: 14 September 2009 09:00 > To: TNHarris > Cc: Lua list > Subject: Re: Regarding the name 'pairs' > > TNHarris writes: > > It's "each" instead of "iterate" simply for being shorter. I don't > > particularly care for "iter" and "enum" because they're > abbreviations. > > And "enum" already has a meaning in C. > > Hmm, I'd use "values(set)" rather than "each": > > for v in values(set) do ... end > > -miles > > -- > Fast, small, soon; pick any 2. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 05:44:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E8iJF3007579; Mon, 14 Sep 2009 05:44:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9826418FF3; Mon, 14 Sep 2009 05:43:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF7101881C for ; Mon, 14 Sep 2009 05:43:48 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mn7A1-0004Kw-PK for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 10:43:45 +0200 Received: from p5b2c28ce.dip.t-dialin.net ([91.44.40.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 10:43:45 +0200 Received: from dak by p5b2c28ce.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2009 10:43:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: [ANN] luamake Date: Mon, 14 Sep 2009 10:43:15 +0200 Organization: Organization?!? Lines: 14 Message-ID: <87y6oh5330.fsf@lola.goethe.zz> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c28ce.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:1xKLj2aP6Y24WtyEfZHW0Q9d3xI= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Wesley Smith writes: > This is an OSX and Linux only system as of now. If you're on Windows, > all I can say is sorry, but I have no plans of adding windows. [...] > Luamake is a platform independent configuration and build system [...] Could you explain the meaning of "platform independent" that you are employing here? -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 05:50:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E8oovM008150; Mon, 14 Sep 2009 05:50:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FAFA18FF0; Mon, 14 Sep 2009 05:50:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7A9118F98 for ; Mon, 14 Sep 2009 05:50:22 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8E8oH0D023604; Mon, 14 Sep 2009 17:50:22 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Mon, 14 Sep 2009 17:50:22 +0900 Received: from dhlpc061 ([10.114.113.123] [10.114.113.123]) by relay21.aps.necel.com with ESMTP; Mon, 14 Sep 2009 17:50:21 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id A8AB752E1E7; Mon, 14 Sep 2009 17:50:21 +0900 (JST) From: Miles Bader To: David Kastrup Subject: Re: [ANN] luamake References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 14 Sep 2009 17:50:21 +0900 In-Reply-To: <87y6oh5330.fsf@lola.goethe.zz> (David Kastrup's message of "Mon, 14 Sep 2009 10:43:15 +0200") Message-ID: Lines: 20 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Kastrup writes: >> This is an OSX and Linux only system as of now. If you're on Windows, >> all I can say is sorry, but I have no plans of adding windows. > >> Luamake is a platform independent configuration and build system [...] > > Could you explain the meaning of "platform independent" that you are > employing here? Well, in the end, _nothing_ is "platform independent" -- you have to code to _some_ interface or set of interfaces. He may simply mean that he's coded to an interface generally considered "standard" (e.g., Posix something or another) which OSX and Linux support well, but Windows does not. -Miles -- Non-combatant, n. A dead Quaker. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 05:58:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E8wAKr008732; Mon, 14 Sep 2009 05:58:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A804C190AC; Mon, 14 Sep 2009 05:57:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF16318F98 for ; Mon, 14 Sep 2009 05:57:44 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so567331eye.39 for ; Mon, 14 Sep 2009 01:57:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.70.11 with SMTP id o11mr1012238wed.204.1252918665262; Mon, 14 Sep 2009 01:57:45 -0700 (PDT) In-Reply-To: References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> Date: Mon, 14 Sep 2009 09:57:44 +0100 X-Google-Sender-Auth: 9230ea169d53c46f Message-ID: Subject: Re: userdata environment From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 7:55 AM, Juris Kalnins wrote: > That's harder. Currently it's a pointer to something that can be put in GC > list, which excludes nil, bools, numbers and lightuserdata. Changing that > would be a much bigger patch, and would increase size of userdata header. You could use a C NULL pointer to represent Lua nil, but I'm not sure how much that would increase the complexity (or not). From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 06:06:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E96HjN009541; Mon, 14 Sep 2009 06:06:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 364FB190E0; Mon, 14 Sep 2009 06:05:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DE6D19092 for ; Mon, 14 Sep 2009 06:05:49 -0300 (BRT) Received: by fxm18 with SMTP id 18so2268880fxm.5 for ; Mon, 14 Sep 2009 02:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=1vdKd+V6LrlzQHhA0YlLFKh0XhtiAA8LueGGGlxYE8w=; b=mGfOWgLt8KDgb4/J2lAhlhGJ5Q0jRmaHbKUB6QdN7BZ47g2Yht27LNeC4JEDPkjvm2 hFbirQZIB6hwSadMOx4JCn4y8snK979WEKFuvNYJ73nsTAYg2NY6QI7HIEgbH9s+EAnU vh4QYUiU1XEMD0pWg0r9n6beR8O+GzV6ekFqw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nxHLClwUbApVXYTFUVEew4zunwx56uLy472YCX5/Xf4eJCZ/9LNyihdj6s13sOGlgY c0Jc8lt71o5iEE2xHolhznAILai+CdDkpiYKFNRqCOsiDOXNk8iDnxKg4JmkRW/yGn7U JqJtVk6/4xJYu8e9N/T8UmlAO/V0ZKRBs2ysY= MIME-Version: 1.0 Received: by 10.204.10.135 with SMTP id p7mr4949608bkp.69.1252919151242; Mon, 14 Sep 2009 02:05:51 -0700 (PDT) In-Reply-To: <87y6oh5330.fsf@lola.goethe.zz> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> Date: Mon, 14 Sep 2009 11:05:51 +0200 Message-ID: <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> Subject: Re: [ANN] luamake From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 10:43 AM, David Kastrup wrote: >> Luamake is a platform independent configuration and build system [...] > > Could you explain the meaning of "platform independent" that you are > employing here? It's like the old Unix sense of the word 'portable', meaning 'builds on anything that looks like Unix' From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 06:18:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8E9IabU011148; Mon, 14 Sep 2009 06:18:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F12A118F56; Mon, 14 Sep 2009 06:18:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED43318BD6 for ; Mon, 14 Sep 2009 06:18:07 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mn7hA-0001zc-96 for ; Mon, 14 Sep 2009 10:18:00 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mn7hJ-00035c-KJ for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 10:18:09 +0100 Date: Mon, 14 Sep 2009 10:18:09 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] luamake Message-ID: <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> In-Reply-To: <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 14 Sep 2009 11:05:51 +0200 steve donovan wrote: > On Mon, Sep 14, 2009 at 10:43 AM, David Kastrup wrote: > >> Luamake is a platform independent configuration and build system > >> [...] > > > > Could you explain the meaning of "platform independent" that you are > > employing here? > > It's like the old Unix sense of the word 'portable', meaning 'builds > on anything that looks like Unix' After all, POSIX is the portable operating system interface; it *is* the abstraction to use if you want your software to be portable. And it makes sense; it's by far the most common portability layer shared between OSes, even non-UNIXes. Windows has two POSIX layers available for it! B. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 07:13:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EADDdS015363; Mon, 14 Sep 2009 07:13:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEABA18B2B; Mon, 14 Sep 2009 07:12:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCB8C188A1 for ; Mon, 14 Sep 2009 07:12:38 -0300 (BRT) Received: by ewy26 with SMTP id 26so2714268ewy.5 for ; Mon, 14 Sep 2009 03:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=YF/m5kexsEgTffyCRQgubHF0E+mzEP4zMuC67BYxcYU=; b=jBkfHQADdTWUrL0HfLabKCN6h/c50kttz8jHWH+GG6dkAi4D+t9ZiO5HLvPJ7XPHC5 8CPBIyEpsEU8SPzYSfTTHSyJDxkwIx9mE9D8nx58gC2mwduH9Vp77UMxAZizyE4uG1mm VZLxI5UtitfC+4xQFhJForcsXTpir81PduikA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=tOzXFWn6fRJPi02gDNl5L5A6eRpm69qN9OlG/hdyZs1f6Onft9CqTldZiUkzEjqfLs E3E2uLiohQbnm4YwiuYoqi4z5ZCX6FbUUe6qaMQE49LjLfslyL2Qm4PRR16boWRNVVKy ZRWDxiFOZquP5jDf5UPpqa1guWW3uUxRYjf4s= Received: by 10.211.154.10 with SMTP id g10mr6698405ebo.49.1252923159690; Mon, 14 Sep 2009 03:12:39 -0700 (PDT) Received: from ?95.78.70.81? ([95.78.70.81]) by mx.google.com with ESMTPS id 28sm2255948eyg.36.2009.09.14.03.12.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Sep 2009 03:12:39 -0700 (PDT) Date: Mon, 14 Sep 2009 14:12:20 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1582354582.20090914141220@gmail.com> To: Rob Kendrick Subject: Re[2]: [ANN] luamake In-Reply-To: <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Rob, Monday, September 14, 2009, 1:18:09 PM, you wrote: > between OSes, even non-UNIXes. Windows has two POSIX layers available > for it! not 3? built-in, cygwin and mingw -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 07:27:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EARXLl017126; Mon, 14 Sep 2009 07:27:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E5B118E5B; Mon, 14 Sep 2009 07:27:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D3C5183A8 for ; Mon, 14 Sep 2009 07:27:05 -0300 (BRT) Received: from cpc1-asht1-0-0-cust688.manc.cable.ntl.com ([80.5.50.177] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mn8ls-0007RV-EU for ; Mon, 14 Sep 2009 11:26:56 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mn8m1-0005z4-U6 for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 11:27:06 +0100 Date: Mon, 14 Sep 2009 11:27:05 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] luamake Message-ID: <20090914112705.36a26796@trite.i.flarn.net.i.flarn.net> In-Reply-To: <1582354582.20090914141220@gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> <1582354582.20090914141220@gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 14 Sep 2009 14:12:20 +0400 Bulat Ziganshin wrote: > Hello Rob, > > Monday, September 14, 2009, 1:18:09 PM, you wrote: > > > between OSes, even non-UNIXes. Windows has two POSIX layers > > available for it! > > not 3? built-in, cygwin and mingw At the risk of getting dangerously off-topic, Windows's built-in POSIX layer isn't enough to get even the most simple POSIX applications running, you always need to add something. Interix/Services For Unix is one, and the other is Cygwin. MinGW is a special case, but is essentially the same as Cygwin. B. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 07:28:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EAS13H017203; Mon, 14 Sep 2009 07:28:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8601318EDB; Mon, 14 Sep 2009 07:27:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B000518E9D for ; Mon, 14 Sep 2009 07:27:22 -0300 (BRT) Received: by bwz10 with SMTP id 10so2314599bwz.5 for ; Mon, 14 Sep 2009 03:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XKiwi5Z12WQ1H6VV5WbfOxqKJfunHooJ/lycONrHWW4=; b=seC2XMZER8ADO8gxU9BQ8X+5vzyZ7AHVsmzCYT8FRCU6b2+ktX1R1eUDSleGA5fN3m fXZtKNz2sr+EfazB4t5Znpi8u9hf5TcdxZPeSXbWeu07AgTjL/Tz9W5k4TzGny3lGza5 CfqFqnEQqXGYhJ34zNHRGqelrG77htpfmlHE0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=efFUFeN+jo1z63XwjvpFi8iTOWnJNCLFNCfq1GXLSC599khCyjW6D5Y5gZznru8Vr5 TPEvX3De8sZALsClz7OtT4HwoEVBrCDoqbQdG6WWmk47L/gsh1H9d9cR/yFeNo213jg/ 2fRW1zdO9gO5rxbbsoQKVBpH1m0IdZ3FMTQ7A= MIME-Version: 1.0 Received: by 10.204.151.210 with SMTP id d18mr5017128bkw.203.1252924043166; Mon, 14 Sep 2009 03:27:23 -0700 (PDT) In-Reply-To: <1582354582.20090914141220@gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> <1582354582.20090914141220@gmail.com> Date: Mon, 14 Sep 2009 12:27:23 +0200 Message-ID: <560972290909140327g698f894bqf69aecf3a700d1e2@mail.gmail.com> Subject: Re: Re[2]: [ANN] luamake From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 12:12 PM, Bulat Ziganshin wrote: > not 3? built-in, cygwin and mingw mingw is definitely not posix. It is a native Win32 port of GCC, with libraries for using the Win32 API as well as the usual C runtime. No fork() there! Yeah, well: you can make Windows do unix http://www.microsoft.com/downloads/details.aspx?familyid=896c9688-601b-44f1-81a4-02878ff11778&displaylang=en But it's 216 meg. (There are useful Linux distros with less of a footprint) Although the Windows API is not a standard in the usual open sense, it is de facto the most popular API for desktop computers. (Although it isn't 'popular' necessarily for us poor souls who have to programming using it) Part of the issue is this: unfamiliar toolchain. 'cl.exe' is (a) very different and (b) spawn of the evil empire (c) perceived as bound to big clumsy IDEs. Which is where mingw comes in, it's quite possible to do Lua extensions with it built against various kinds of Lua binaries. Ryan has lost patience for the MS toolchain because of the manifest/side-by-side nonsense. So he aims to build Lua for Windows using mingw. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 08:25:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EBPiMG023106; Mon, 14 Sep 2009 08:25:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 485FB18EC5; Mon, 14 Sep 2009 08:25:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2729189E9 for ; Mon, 14 Sep 2009 08:25:04 -0300 (BRT) Received: by fxm18 with SMTP id 18so2344969fxm.5 for ; Mon, 14 Sep 2009 04:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=wTXIU6fog5JqoRaHYWyGm7lzyrV+s45IXZk5dbX2+T8=; b=VCey4wELL3R1zPwdBFQIx0FbTWcMFLUyaCVmI0YCY4Hmcue+/68a91hKm5um63jGcm JBDAvwE+z93yMfIxGq0AoFLsvzJoRkylg1KuKZgoERnHuOGZCTJUamd5Kug2dTZqSk1f StXe6dKqeVWxqdb9Cil9yELwaBkTnHfURLHcE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=vV3RAsucY19qpj8KxnwUMYMpKy2Ie4mcsOqcg5WrLjsqgcfhIfwTYV2iNb2tR5OeIB dqtWFlxrBnHZ1J6CnVd4fob2P5amn/9BNMUoYicfUlvDOGpgcrcTrrM5lsnBnUHll4vH 8A8zkn2NDtOXboB+tkqjZkYO88VSRx5iiMXxQ= MIME-Version: 1.0 Received: by 10.223.4.23 with SMTP id 23mr2016827fap.91.1252927504696; Mon, 14 Sep 2009 04:25:04 -0700 (PDT) Date: Mon, 14 Sep 2009 07:25:04 -0400 X-Google-Sender-Auth: 3915ad338a86b77f Message-ID: Subject: Re: Announce: Darwin module system From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001517402aa4d8c4cd047387ead9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517402aa4d8c4cd047387ead9 Content-Type: text/plain; charset=ISO-8859-1 > > On Thu, 10 Sep 2009 01:00:36 -0400, David Manura wrote: > > The documentation for struct.declare defines these code fields: > > 1. open={m1, ...} > 2. pre="..." > 3. files=f1 or files={f1, ...} > 4. post="..." > 5. environment="..." > > When first seeing the examples, it was not obvious to me when fields > #2-5 were appropriate and how they interacted. As I see, each of > these represents code and they are executed in sequence. They differ, > perhaps arbitrarily, in that #3 accepts file names, but the others > accept code strings (though you could specify file names in the others > via a dofile or require, as some examples do), and only #5 handles a > return value. Lacking #3, you can arbitrarily choose to place your > code inside #2, #4, or #5. Would something like the following make > the model simpler and more general? > > structure.declare { > name="test"; > open={"_G", "os"}; > environment = [[ > pre..... > dofile '.....' ..... > post.... > return t -- optional (return may be omitted) > ]] > } > > or using e.g. > > environment = {[[pre.....]], '@pre2.lua', '@file1.lua', > [[post....; return t]]} > > The typical purpose of #2-4 seems to be to define a module that wraps > another module, whereas the name/signature/location fields define how > that wrapped module is bound into the local namespace tree. > Yes, the name/signature/location fields do define how the structure is used, and there can be several such fields in one structure definition, allowing the same code to be used in multiple ways. Your suggestion that 'environment' alone suffices is accurate. I considered two usage models explicitly, although, looking back, it appears that I wrote almost entirely about just one: wrapping an existing module with a structure declaration. The other usage model is simply writing code (or re-using code) where, at some point in its development, a decision is made to make it a module. In the latter case, structure declarations will ideally contain only 'open' and 'files' clauses (out of the 5 clauses that process code). When this pattern is followed, there are two small benefits: (1) the file names are declared, so they can be extracted programatically when analyzing the modules in a particular system; and (2) a search path for code loaded by Darwin can be distinct from the path(s) used by the native Lua module system. Darwin supports a customizable search path for file names listed in the 'files' clause. When loading files of code, especially those written by other people, the 'pre' and 'post' clauses let you wrap those files with additional code without having to edit the file -- this is merely a convenience, of course. In my opinion, this makes a very good usage pattern: Use 'open' to declare dependencies on other modules and 'files' to load code. When you do not want to (or cannot) edit the files, use 'pre' and 'post' to wrap the files with your own customizations. However, I wanted to facilitate the re-use of existing modules, and that requires the "full expressiveness" of the 'environment' clause. As you have observed, you can do everything with the 'environment' clause and, therefore, 'files', 'pre', and 'post' are unnecessary. The 'files' clause (with 'pre' and 'post' as needed) represents a usage pattern that I would like to encourage. Of course, one has no control over how one's inventions are used. :-) Jim --001517402aa4d8c4cd047387ead9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Thu, 10 Sep 2009 01:00:36 -0400, David Manura <dm.lua@math2.org> wrote:

The documentation for struct.declare defines these code fields:

=A0 1. open=3D{m1, ...}
=A0 2. pre=3D"..."
=A0 3. files=3Df1 or files=3D{f1, ...}
=A0 4. post=3D"..."
=A0 5. environment=3D"..."

When first seeing the examples, it was not obvious to me when fields
#2-5 were appropriate and how they interacted. =A0As I see, each of
these represents code and they are executed in sequence. =A0They differ, perhaps arbitrarily, in that #3 accepts file names, but the others
accept code strings (though you could specify file names in the others
via a dofile or require, as some examples do), and only #5 handles a
return value. =A0Lacking #3, you can arbitrarily choose to place your
code inside #2, #4, or #5. =A0Would something like the following make
the model simpler and more general?

=A0structure.declare {
=A0 =A0name=3D"test";
=A0 =A0open=3D{"_G", "os"};
=A0 =A0environment =3D [[
=A0 =A0 =A0pre.....
=A0 =A0 =A0dofile '.....' .....
=A0 =A0 =A0post....
=A0 =A0 =A0return t =A0-- optional (return may be omitted)
=A0 =A0]]
=A0}

or using e.g.

=A0 =A0environment =3D {[[pre.....]], '@pre2.lua', '@file1.lua= ',
[[post....; return t]]}

The typical purpose of #2-4 seems to be to define a module that wraps
another module, whereas the name/signature/location fields define how
that wrapped module is bound into the local namespace tree.

Yes, the name/signature/location fields do define how the structu= re is used, and there can be several such fields in one structure definitio= n, allowing the same code to be used in multiple ways.

Your suggestion that 'environment' alone suffices is accurate.= =A0 I considered two usage models explicitly, although, looking back, it ap= pears that I wrote almost entirely about just one:=A0 wrapping an existing = module with a structure declaration.=A0 The other usage model is simply wri= ting code (or re-using code) where, at some point in its development, a dec= ision is made to make it a module.

In the latter case, structure declarations will ideally contain only &#= 39;open' and 'files' clauses (out of the 5 clauses that process= code).=A0 When this pattern is followed, there are two small benefits:=A0 = (1) the file names are declared, so they can be extracted programatically w= hen analyzing the modules in a particular system; and (2) a search path for= code loaded by Darwin can be distinct from the path(s) used by the native = Lua module system.=A0 Darwin supports a customizable search path for file n= ames listed in the 'files' clause.

When loading files of code, especially those written by other people, t= he 'pre' and 'post' clauses let you wrap those files with a= dditional code without having to edit the file -- this is merely a convenie= nce, of course.

In my opinion, this makes a very good usage pattern:=A0
Use 'op= en' to declare dependencies on other modules and 'files' to loa= d code.=A0 When you do not want to (or cannot) edit the files, use 'pre= ' and 'post' to wrap the files with your own customizations.
However, I wanted to facilitate the re-use of existing modules, and tha= t requires the "full expressiveness" of the 'environment'= clause.=A0 As you have observed, you can do everything with the 'envir= onment' clause and, therefore, 'files', 'pre', and '= ;post' are unnecessary.=A0 The 'files' clause (with 'pre= 9; and 'post' as needed) represents a usage pattern that I would li= ke to encourage.=A0 Of course, one has no control over how one's invent= ions are used.=A0 :-)

Jim

--001517402aa4d8c4cd047387ead9-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 08:40:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EBeift024649; Mon, 14 Sep 2009 08:40:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5733518FDF; Mon, 14 Sep 2009 08:40:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A748818EDB for ; Mon, 14 Sep 2009 08:40:14 -0300 (BRT) Received: by ywh29 with SMTP id 29so4503335ywh.23 for ; Mon, 14 Sep 2009 04:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Zg1mDxqXzS2CcSi6vDeD35hwEpktF7af/BW6MtkKLH4=; b=FKhACFe710Bl9MC3Gnu+OBHvTVh/tBBgCAueo/OcyKzHz+0a+rZI+g5PP94RsIHD+J uI04gJHmzo7prr9QSlSPrY4czRc5mfiB8LEAx5gJbdUoSPn2TopIvLqOCsQ0hJ1gIFyi 5H3RU+6WJPXtS3SZ7Wnfehp5w5WWSu3jc1wJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UeiylJZ0Vy/9myVzK5tvfBQXAXdvTF/SPGFjlMGunwfOqKSqddvHHLsTWFmg1Y3kZi T1SndaUZKCpoHkNrRbnXRV70M9ZH2TM3Ylyzl5mAqh4ZuJROhchXsLAbXfh/5XjaoZFl miOQqj2w5dIRdv+T3ZXYytoKegYSaqjXwidHA= MIME-Version: 1.0 Received: by 10.150.8.10 with SMTP id 10mr9988055ybh.179.1252928414370; Mon, 14 Sep 2009 04:40:14 -0700 (PDT) In-Reply-To: References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> Date: Mon, 14 Sep 2009 13:40:14 +0200 Message-ID: <1079b050909140440s62d8d359tc6a505725b78a646@mail.gmail.com> Subject: Re: [ANN] luamake From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I do know of Premake. Hadn't looked at it in a while. The differences are: - Premake is for generating build files like Makefile, xcode project or visual studio and not to build the projects. luamake is aiming to actually build the code. - Premake is GPL. I didn't mention it, sorry for the oversight, but like most Lua projects, this one is BSD license, Funny enough, Premake uses a very similar data description format as I do. but we diverge after the gross similarities as in the end we have different goals. In luamake project files, there are event callbacks for handling tricky parts of the build process like installation as well as a range of global variables a functions to aid in massaging the data. There are some good ideas in the reference section that I might translate into luamake though. wes From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 08:45:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EBjEZg025284; Mon, 14 Sep 2009 08:45:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C35CA19051; Mon, 14 Sep 2009 08:44:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C83FB18FCD for ; Mon, 14 Sep 2009 08:44:45 -0300 (BRT) Received: by yxe11 with SMTP id 11so4007354yxe.15 for ; Mon, 14 Sep 2009 04:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=en7tvm1fy9JO9zzYc0miVCzX+fELDnznmjKO2lVe91E=; b=OdxIE4xAIGs4wHMfOLnTwNzou07AnPaV4rVxFnW3MlTzosyoi5YOy8LTse2FGr7fgC yOie34IbCppVIHO+2vq5sgtxP8Be7mbP1qOQX+cLQdv3BjR5u78hxkzx1YHggY8dA4GE UNN57c+A/IibnGHIdi0yxbY+5LJPSit6NAJwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZbxaKgsk7RCons1lnCybxYir//wYxoHn8COTfkzrL+al038BtJtblAHZwQwDL1I6mq EnQTwzcUHowI/gCXFviCFOtkNcQljxVq7rCpTu53c1laBI/+E8lBQB3RNXCWkPRCBAzH tFmRRWQwJJ2clnHUEV4HbAe+eeAT1DRF6+IjE= MIME-Version: 1.0 Received: by 10.150.103.1 with SMTP id a1mr9891272ybc.198.1252928686898; Mon, 14 Sep 2009 04:44:46 -0700 (PDT) In-Reply-To: <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> Date: Mon, 14 Sep 2009 13:44:46 +0200 Message-ID: <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> Subject: Re: [ANN] luamake From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > How does luamake handle the awkward cases? Do you have an example? From my perspective, I feel that Lua itself is flexible enough to elegantly handle awkward cases. Since I've mostly worked with luamake on my own projects, some of which do have awkward points, I can only say that so far so good. I'm sure there are some projects that at this point will be difficult to implement in a luamake project, but with a little finesse -- either a snippet of Lua or an alteration to the luamake system -- I'm sure it can be handled. > What I like about the LuaRocks build system is that it has flexible > backends (currently, builtin, make and CMake) - and it understands > that different animal, the Microsoft C compiler. I'm planning on adding support for existing Makefiles and xcode projects so having different backends is certainly on the agenda. wes From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:04:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EC4YbA027354; Mon, 14 Sep 2009 09:04:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7820B190D3; Mon, 14 Sep 2009 09:04:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FF2118A74 for ; Mon, 14 Sep 2009 09:04:02 -0300 (BRT) Received: by fxm18 with SMTP id 18so2367985fxm.5 for ; Mon, 14 Sep 2009 05:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Pa3OpVI86dcLGZ3N6tRWOC7uf2sm4Eb4288bYN9T/ZY=; b=TN2uKgcMopQUt75JVKguS+bmVj75GPlsLXDBEi4NatqllnZV2DDOUWQb7LU7mA4P1m F4djTk6Od+8f+yDKgzUxH6XiqBUaOjgWbbvH+mOIrBlQvw3mZmhhokVBC7iWGIW1IPkZ TI5/goyBTAj8cKHT/0owr64rpvkEbN3XkUz4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LaUW/z/64eJdnxTScnuv0H5YUfQI7A0/JEyGWqUzW1MP4VLv7H5BLGNqNm4v4lE685 wqRLoHJYR+pfccG6AF3/zBSdlItEEj3p8NPmlq8qfP58bm7PVSrcTSDwjwpuP4JrSmd8 ac4tYBi5CMZIGy5SA+76cmSO/j8TFu2Tmu+a8= MIME-Version: 1.0 Received: by 10.204.151.210 with SMTP id d18mr5099891bkw.203.1252929843696; Mon, 14 Sep 2009 05:04:03 -0700 (PDT) In-Reply-To: <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> Date: Mon, 14 Sep 2009 14:04:02 +0200 Message-ID: <560972290909140504p7f0f7939y634d692f71fad71a@mail.gmail.com> Subject: Re: [ANN] luamake From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8EC4YbA027354 On Mon, Sep 14, 2009 at 1:44 PM, Wesley Smith wrote: >> > Do you have an example?  From my perspective, I feel that Lua itself > is flexible enough to elegantly handle awkward cases. I was probably thinking of my attempts to do LuaSocket using the builtin LuaRocks builder. You end up with two .sos that have to be copied to different places (socket/core etc). But then this mode of LuaRocks is purely declarative, so this is awkward. If you have callbacks & the ability to integrate procedural Lua code, well then you _can_ do anything ;) GNU make is a remarkably feature-full program with some truly ugly syntax. Anything that lets us use more Lua is to be welcomed. A critical thing for a new build engine is size. If it's nice & compact, then one can package it with a larger application without bothering the poor downloader to go hunt for the build engine first. 120K for Luamake is a good size. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:06:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EC6NTu027560; Mon, 14 Sep 2009 09:06:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49272190FC; Mon, 14 Sep 2009 09:06:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2DA4190D3 for ; Mon, 14 Sep 2009 09:05:56 -0300 (BRT) Received: by bwz10 with SMTP id 10so2369432bwz.5 for ; Mon, 14 Sep 2009 05:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2gs9i2FOsTIK2+zg9KsHgrZMivGkww5ni4pwpgiolVY=; b=fkRb/i4sS4C5QtI+5T16tVala1DeoMwYA0caZXb3s5uRppxKkxhmnSaaSvUF/Q/LY6 4csYhVRPmR3+4AqLXi+i2ZPR7LD8EOKO3Frxp+YLrI53/k0GSIkEpFAIaQo8P3fbC/lH P7ez4Z/Py/NJQx6siaa4r9eL+uwPFra6rSOHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qVE7PGH8HpZ3m6+/wjY04EZ8XHcSUSKc8IMYQLiJn56xYNY5UFsneak0UhP9v3/KJ4 X3tYd8xSKwE6HYm1AHF/UmfC0fI2mh9hpCuG4XwIo6AYd2yJhohJuFVMSzRpIi2MGRoI GUXgwrQzVWGaanHj8fyeWoUM2Le2wAj4belgQ= MIME-Version: 1.0 Received: by 10.204.10.135 with SMTP id p7mr5104860bkp.69.1252929955969; Mon, 14 Sep 2009 05:05:55 -0700 (PDT) In-Reply-To: <560972290909140504p7f0f7939y634d692f71fad71a@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> <560972290909140504p7f0f7939y634d692f71fad71a@mail.gmail.com> Date: Mon, 14 Sep 2009 14:05:55 +0200 Message-ID: <560972290909140505q387948c9m610dd8986f7ac86f@mail.gmail.com> Subject: Re: [ANN] luamake From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 2:04 PM, steve donovan wrote: > I was probably thinking of my attempts to do LuaSocket using the > builtin LuaRocks builder. And there I see in the tarball, LuaSocket is one of your examples! From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:09:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EC9ZYf028007; Mon, 14 Sep 2009 09:09:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3CDF1912F; Mon, 14 Sep 2009 09:09:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8588E18ED1 for ; Mon, 14 Sep 2009 09:09:09 -0300 (BRT) Received: by ywh29 with SMTP id 29so4531579ywh.23 for ; Mon, 14 Sep 2009 05:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=sT+0dS2k++TIno/t8XsAeuUt3lsM3003elN+BjriP3U=; b=GXumlkIL413jORAgBk5S5VSh2C6+cV7B64tncdR69ZCDkSZLdYqAmiChR9CGPvNtKB MYvya1B7h7Z4o/ldrNI2SBV+KrVFz3gsKf+1Yqf/mfKi2ALRyIDCscYXnFUN/rOk2rdT rnQA0p4m810/yxWkXMP8HghbIpfCkdPUdChGs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=L4jAM1AvxXVMH08oI06+2sZhy08/S++hj4b87meAOZ+epfa1vAz5NQwVDoqPn4BI32 9tq2pgUdXh2S3pveDqp7ObYGWKzcZCtWnEZWmDsTMdf92j+TDIZfykAi+Nqyc8nfdhUc j7ZjrRtnqArqP/RxuTqdJF9TltlxW9nPTsBn0= MIME-Version: 1.0 Received: by 10.150.16.1 with SMTP id 1mr9813994ybp.284.1252930151394; Mon, 14 Sep 2009 05:09:11 -0700 (PDT) In-Reply-To: <560972290909140505q387948c9m610dd8986f7ac86f@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> <560972290909140504p7f0f7939y634d692f71fad71a@mail.gmail.com> <560972290909140505q387948c9m610dd8986f7ac86f@mail.gmail.com> Date: Mon, 14 Sep 2009 14:09:11 +0200 Message-ID: <1079b050909140509i15246d4ence113232731dd977@mail.gmail.com> Subject: Re: [ANN] luamake From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > And there I see in the tarball, LuaSocket is one of your examples! Indeed! I thought it was a tricky one. Notice that I've split it according to binaries. thus there are the luasocket.lua and luamime.lua examples. wes From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:10:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECAflP028218; Mon, 14 Sep 2009 09:10:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6638F19027; Mon, 14 Sep 2009 09:10:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D688218F70 for ; Mon, 14 Sep 2009 09:10:15 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1MnANl-0001RS-00; Mon, 14 Sep 2009 14:10:09 +0200 Date: Mon, 14 Sep 2009 14:09:51 +0200 From: Mike Pall To: Lua list Subject: Re: [ANN] Coco 1.1.6 released + URL changed Message-ID: <20090914120951.GA6138@mike.de> References: <4AADDE6D.10301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AADDE6D.10301@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean cometwk wrote: > I find a Segmentation fault (core dumped) in Coco 1.1.6 release. > OS: x86_64 GNU/Linux > Coco 1.1.6 with Makefile -g ( not -O2) . > but with -O2 work fine ! Ok, I can reproduce this here. Looks like GCC emits some pointless frame-pointer saves on x64 if optimization is turned off. Even though frame-pointers are not needed for debugging on x64. Solution: compile with "-g -fomit-frame-pointer" or with "-g -O2". Don't forget to add "-g" to MYLDFLAGS, too. [Note that optimization and debugging are not exclusive options in GCC. But some optimizations may spoil your debugging experience. I usually use "-g -Os".] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:17:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECHGmW029121; Mon, 14 Sep 2009 09:17:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A28B190AC; Mon, 14 Sep 2009 09:16:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96B6018FF3 for ; Mon, 14 Sep 2009 09:16:48 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECGoHO029075 for ; Mon, 14 Sep 2009 09:16:50 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8ECGnT30276; Mon, 14 Sep 2009 09:16:49 -0300 Date: Mon, 14 Sep 2009 09:16:48 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090914091648.B30247@lua.tecgraf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <002801ca312c$a133d090$e39b71b0$@hind@zen.co.uk> <20090910162412.1043e325@egeria.whoopdedo.org> <001a01ca32b8$85242430$8f6c6c90$@hind@zen.co.uk> <20090911163400.22b594fe@egeria.whoopdedo.org> <000d01ca3514$c9c995d0$5d5cc170$@hind@zen.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <000d01ca3514$c9c995d0$5d5cc170$@hind@zen.co.uk>; from john.hind@zen.co.uk on Mon, Sep 14, 2009 at 09:24:33AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > for v in set:values() do ... end > > But the need for that empty parenthesis still rankles ... One important reason for not having "set:values" is that it'd be sugar for "function (...) return set:values(...) end" and this would imply the creation of a hidden closure. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:26:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECQgxX030291; Mon, 14 Sep 2009 09:26:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FE8519178; Mon, 14 Sep 2009 09:26:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DCFA190DD for ; Mon, 14 Sep 2009 09:26:02 -0300 (BRT) Received: by fxm18 with SMTP id 18so2381856fxm.5 for ; Mon, 14 Sep 2009 05:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WZ+FQ9V4lDSl7WoboUCnUdxZR6iHtlZTbTk7myTi3NU=; b=phaVKQtfoLlE2rMcWStcQbOz4mrVVgHQXCfwuMbH08mfi2aLljtmMy5jNNX2T3k1tK NctWoiLsd0lYJfwvG/cd9c5YSOcKZ3cSRAO5UOAm7WqTHkcy2CruDxeJpDx54G/H09yH Sjytxsnrhhb1p7lpdqx0rwQusQo2worfSppuY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dXlQArM1262m6Us/CnfPZcINk4zXaDH4Q9vUVgwym7umXyF0EyKuFNsr+/ZO0ezTa/ NkMmzPx+3V41S4gTotR3xN3Et83iS3RjcWye0AIbCKq2L/b5edx3SgimfZq6P5NxYpot hhoa6djnVe8hOMgUFmF/yMnMCkz6wMO+azgSc= MIME-Version: 1.0 Received: by 10.204.155.88 with SMTP id r24mr5095760bkw.132.1252931162025; Mon, 14 Sep 2009 05:26:02 -0700 (PDT) In-Reply-To: <20090914091648.B30247@lua.tecgraf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> Date: Mon, 14 Sep 2009 14:26:01 +0200 Message-ID: <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 2:16 PM, Luiz Henrique de Figueiredo wrote: > One important reason for not having "set:values" is that it'd be sugar > for "function (...) return set:values(...) end" and this would imply > the creation of a hidden closure. Yes, it did feel like an incompatible proposal. So, is there some support for Mark Hamburg's closure sugar in Rio ;) ? steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:35:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECZbHp031769; Mon, 14 Sep 2009 09:35:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B9A9191B7; Mon, 14 Sep 2009 09:35:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBD5E191B7 for ; Mon, 14 Sep 2009 09:35:04 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8ECZ6SZ006348 for ; Mon, 14 Sep 2009 09:35:07 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 5B05954C07E; Mon, 14 Sep 2009 09:35:07 -0300 (BRT) Date: Mon, 14 Sep 2009 09:35:07 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090914123507.GC4414@inf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > So, is there some support for Mark Hamburg's closure sugar in Rio ;) ? Yes. Here we would write C(set, "values") for C:values and define C as C = function (obj, met) met = obj[met] return function (...) return met(obj, ...) end end (I guess it works in other cities too ;) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 09:48:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ECmHg8001277; Mon, 14 Sep 2009 09:48:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3945190AC; Mon, 14 Sep 2009 09:47:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5AF919027 for ; Mon, 14 Sep 2009 09:47:42 -0300 (BRT) Received: by bwz10 with SMTP id 10so2396222bwz.5 for ; Mon, 14 Sep 2009 05:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Ng7nbxn+WqcENHztOzbj56ucbpNY+2x6gpuOYMSBOd0=; b=oifBWMwSg5vkB3ECR5xkMHRTaa1UYvSDkSbf0XDzLqNd0cVwWtCbB+7pt39ir0mZwc Nb+9wT4mJvEPrpOYq+V2dqVPgLEMZIF8QMIedmGpNTbyWeFYrUBpRHNgd2iMXUgc5Bul 0VBEwHuAbVtlE4haYEDAKMsT/EWy34tXH8Dh4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rG5dWWIxtxeNRLoXB+5gOHk+sRlhqxnXwa5o7WCDDNXCloAp8VFxdrrBNIJ9Cx08Qu ua5yXvH6ubHvc8Va7iQlyPmy9egAWMfEUrakM3nw8kixdAcObioApkW0zA22p8FV1F63 E55Ev2o/pKXtWp4utEryqZLwW7e4nO0qKjN0k= MIME-Version: 1.0 Received: by 10.223.70.13 with SMTP id b13mr2153279faj.31.1252932463763; Mon, 14 Sep 2009 05:47:43 -0700 (PDT) In-Reply-To: <1079b050909140509i15246d4ence113232731dd977@mail.gmail.com> References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> <560972290909140504p7f0f7939y634d692f71fad71a@mail.gmail.com> <560972290909140505q387948c9m610dd8986f7ac86f@mail.gmail.com> <1079b050909140509i15246d4ence113232731dd977@mail.gmail.com> Date: Mon, 14 Sep 2009 13:47:40 +0100 Message-ID: <5fe281d40909140547r31e4f40el2761e37ee36e3c62@mail.gmail.com> Subject: Re: [ANN] luamake From: Jim Whitehead II To: Lua list Content-Type: multipart/alternative; boundary=0015174be39a6e224d0473891213 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174be39a6e224d0473891213 Content-Type: text/plain; charset=ISO-8859-1 I continue my search for a 'pleasant' build experience with LaTeX documents. Perhaps luamake can get me closer. On Sep 14, 2009 1:09 PM, "Wesley Smith" wrote: > And there I see in the tarball, LuaSocket is one of your examples! Indeed! I thought it was a tricky one. Notice that I've split it according to binaries. thus there are the luasocket.lua and luamime.lua examples. wes --0015174be39a6e224d0473891213 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I continue my search for a 'pleasant' build experience with LaTe= X documents. Perhaps luamake can get me closer.

On Sep 14, 2009 1:09 PM, "Wesley Smith&qu= ot; <wesley.hoke@gmail.com&= gt; wrote:

> And there I see in the ta= rball, LuaSocket is one of your examples!

Indeed! =A0I thought it was a tricky one. =A0Notice that I'v= e split it
according to binaries. =A0thus there are the luasocket.lua and
luamime.lua examples.
wes

--0015174be39a6e224d0473891213-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 11:29:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EESlMU026876; Mon, 14 Sep 2009 11:28:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63DA0188E9; Mon, 14 Sep 2009 11:28:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost01.mail.zen.net.uk (smarthost01.mail.zen.net.uk [212.23.3.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B114187FE for ; Mon, 14 Sep 2009 11:28:06 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MnCXE-0006L7-CU for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 14:28:04 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> In-Reply-To: <20090914123507.GC4414@inf.puc-rio.br> Subject: RE: Regarding the name 'pairs' Date: Mon, 14 Sep 2009 15:27:04 +0100 Message-ID: <002101ca3547$6e7c9910$4b75cb30$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco1N+ODV7hmTrtqTAO7AA29qfHXcwAC0SoQ Content-Language: en-gb X-Originating-Smarthost01-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I just realised that, to quote the late GW Bush, I missunderestimated the __call trick. I have been using this for some time: meta = {__call=function(o) return pairs(o) end} tab = {"Rio", "London", "Berlin"} setmetatable(tab, meta) for _,v in tab() do print(v) end And I understood from earlier postings that I could leave out the empty parenthesis in this case. I just tried that for the first time, but it does not work - gives an infinite loop. I now see the case is different with and without the iteration but both do a valid call. Without the parenthesis, the object will be "called" repeatedly during the iteration rather than once to set it up. I tried modifying it like this: meta = {__call=function(o,i) return next(o,i) end} tab = {"Rio", "London", "Berlin"} setmetatable(tab, meta) for _,v in tab do print(v) end But now it prints "Rio" endlessly and the iteration does not advance. Can someone please show me the code to make this second case work? I do now understand that Lua currently only recognises a function (or method) call if the empty parenthesis is present (or a string or table literal is used in its place) and that this behaviour is consistent. I understand that the empty parenthesis case can only mean one thing and if it is already earmarked for something else it cannot mean "call with no parameters". I guess I am back to favouring this one: meta = {pairs=function(o) return pairs(o) end; ipairs=function(o) return ipairs(o) end} meta.__index = meta tab = {"Rio", "London", "Berlin"} setmetatable(tab, meta) for _,v in tab:pairs() do print(v) end for _,v in tab:ipairs() do print(v) end Which lets you decide what iterator(s) to provide for each class and what to name them, but requires the empty parenthesis. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Roberto Ierusalimschy > Sent: 14 September 2009 13:35 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > > So, is there some support for Mark Hamburg's closure sugar in Rio ;) > ? > > Yes. Here we would write C(set, "values") for C:values and define C > as > > C = function (obj, met) > met = obj[met] > return function (...) return met(obj, ...) end > end > > (I guess it works in other cities too ;) > > -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 11:35:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EEZ6Z5028617; Mon, 14 Sep 2009 11:35:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E65E918E58; Mon, 14 Sep 2009 11:34:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29E5D18884 for ; Mon, 14 Sep 2009 11:34:34 -0300 (BRT) Received: by iwn1 with SMTP id 1so1243508iwn.11 for ; Mon, 14 Sep 2009 07:34:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.22 with SMTP id s22mr13304957ibr.33.1252938876375; Mon, 14 Sep 2009 07:34:36 -0700 (PDT) In-Reply-To: <1997517301161778048@unknownmsgid> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> Date: Mon, 14 Sep 2009 10:34:36 -0400 Message-ID: <790db3550909140734m5987d6d9pe3237d230716d95b@mail.gmail.com> Subject: Re: Regarding the name 'pairs' From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 11, 2009 at 4:19 AM, John Hind wrote: > But how would you have a generalised name that would be appropriate in > diverse cases? If there was only one iterator, this would work, call it > something generic like "iter", but if you have two (as at present) you need > to distinguish them by function and this raises the question, why not three > or four? The other problem is that it is the name of the library function > ("pairs" or "ipairs") that the "user" sees, not the name of the > corresponding (proposed) metamethods. > > On the "__iter" proposal this would work exactly like the "__call" trick > except that "__iter" would apply in the context of generic for only, while > "__call" would continue to apply in all other cases. So you would be able to > pass parameters to the iterator (more formally the "iterator factory") just > as you can now with the "__call" trick. > > It is important to realise that the "__pairs" and "__ipairs" proposal is not > just the "__iter" proposal with a different name. The latter requires core > language changes while the former is a very shallow and minor change which > effects only the "pairs" and "ipairs" functions in the base library - they > would delegate to the like-named metamethods if present or do what they do > now if not. This is similar to the way the "__tostring" metamethod works > with the "print" library function. As John Hind suggested above, it seems that __iter metamethod is the most sensible solution here. The __iter metamethod would be the "fallback" for the expected function in the generic for explist. We expect most metamethods to work as fallbacks but __pairs and __ipairs instead define the behavior of those functions, not how Lua should fallback when trying to iterate over the given object. pairs and ipairs would still be useful with this __iter metamethod as tables have no __iter metamethod by default (naturally). We can also set the __iter metamethod of our metatables to next or (ipairs{}) to alleviate the need for calling pairs or ipairs manually. As noted earlier, this frees up __call for its (apparent) intended purpose. Finally, it is very easy now to setup an iterator for a proxy table that correctly iterates over our "hidden" table without exposing the hidden table (sandboxing). As an example: local read_only (t) return setmetatable({}, { __index = t, __newindex = function (t, k, v) error("attempt to modify a read-only table", 2); end, __iter = function (proxy, key) return next(t, key); end __metatable = {}, }); end -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 12:13:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EFDAra005302; Mon, 14 Sep 2009 12:13:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7700418B12; Mon, 14 Sep 2009 12:12:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07AD91886D for ; Mon, 14 Sep 2009 12:12:27 -0300 (BRT) Received: by ywh29 with SMTP id 29so4772585ywh.23 for ; Mon, 14 Sep 2009 08:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=StY2CKe8s4dNaXykyJIdYYTdLX2bzMUH8OASjAvMgkY=; b=fldOY6J3IescSdaI/UUGKHhuMuGel7lr26iCt4ijcxwk+iteABf6ZKh+pFUyE4/5K3 L3vk4RPxkYGeLM3CPDOleo+zMKyA//bQP/4qqtY3iBlvrvRfHY91DZ5aXNqpABApgdFy 6pgULygJ3boHtm6mBMwUhZ9tEbncVKNQfh3iQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=ZfnqjBHeYaDR0P+ptgqFRCeaalADBJCEoZ9Fwg7bOqJSGhgPkVNGgT9JqKpyI1h1VA zQdJieBPMH4Wzcib6p5hd7LhBv6SXI5mFtfuKc/c0xXhqt/frktcoxxCMLmIwRQ+POp0 22TrIRyBBBDTuHImx0TlsgehEioZENfTKaZWI= MIME-Version: 1.0 Received: by 10.101.180.33 with SMTP id h33mr6317600anp.155.1252941147956; Mon, 14 Sep 2009 08:12:27 -0700 (PDT) In-Reply-To: <20090913071008.GA15326@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> <20090913071008.GA15326@protagoras.phil.berkeley.edu> Date: Mon, 14 Sep 2009 11:12:27 -0400 X-Google-Sender-Auth: c956e795743962e6 Message-ID: Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8EFDAra005302 > I'll look into releasing on luaforge.  The project needs some polishing > first, e.g. better error handling and documentation. It can always be made better, but please don't let this stop you from making a release. > No, currently you'd have to modify the module code. In the definition > of 'parser' in markdown_parser.lua, you'd add a clause for your new > pattern: something like > > MyPattern = p"[[" * lpeg.Ct((_"Inline" - p"]]")^0) * p"]]" / writer.mypattern If this is the only thing that needs to be done, shouldn't it be easy to expose the table that is used to create the parser, to allow adding a pattern by simply setting a field? Perhaps something like: require("lunamark") require("lpeg") local wikilink_handler = function(s) return {"", s, ""} end my_parser = lunamark.parsers.markdown() -- or something similar my_parser.WikiLink = lpeg.P"[[" * lpeg.Ct((_"Inline" - lpeg.P"]]")^0) * lpeg.P"]]" / wikilink_handler local converter = lunamark.converter(my_parser, "html") > Then you'd add a mypattern function to the table returned by 'writer' in > html_writer.lua (and any other writers you plan to use). This is your > callback. Is there any reason why this function should be inserted into the module? It seems to work fine with just adding a local handler function to the pattern. - yuri From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 13:13:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EGDB9K020856; Mon, 14 Sep 2009 13:13:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB21318E9D; Mon, 14 Sep 2009 13:12:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BF4718C83 for ; Mon, 14 Sep 2009 13:12:31 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EGCWE0020745 for ; Mon, 14 Sep 2009 13:12:32 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8EGCV931237; Mon, 14 Sep 2009 13:12:31 -0300 Date: Mon, 14 Sep 2009 13:12:31 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090914131230.A31229@lua.tecgraf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <002101ca3547$6e7c9910$4b75cb30$@hind@zen.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <002101ca3547$6e7c9910$4b75cb30$@hind@zen.co.uk>; from john.hind@zen.co.uk on Mon, Sep 14, 2009 at 03:27:04PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > meta = {__call=function(o,i) return next(o,i) end} > tab = {"Rio", "London", "Berlin"} > setmetatable(tab, meta) > for _,v in tab do print(v) end > > But now it prints "Rio" endlessly and the iteration does not advance. Can > someone please show me the code to make this second case work? meta = {__call=function(o,x,i) return next(o,i) end} From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 17:08:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EK87Hk022387; Mon, 14 Sep 2009 17:08:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B693B1909C; Mon, 14 Sep 2009 17:07:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07C6A188A1 for ; Mon, 14 Sep 2009 17:07:30 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MnHpb-0005HW-QG for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 21:07:23 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 291624A44C for ; Mon, 14 Sep 2009 21:07:21 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:34593 with envelope Message-ID: <4AAEB08B.5070602@cowlark.com> Date: Mon, 14 Sep 2009 22:07:23 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] luamake References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <560972290909140007n6b39b54bicbc3c43688e9a13@mail.gmail.com> <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> In-Reply-To: <1079b050909140444s2008fe31vb99dc85d35a9528d@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8EK87Hk022387 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wesley Smith wrote: [...] > Do you have an example? From my perspective, I feel that Lua itself > is flexible enough to elegantly handle awkward cases. Since I've > mostly worked with luamake on my own projects, some of which do have > awkward points, I can only say that so far so good. Well, I wrote Prime Mover for precisely the same reason... The awkward case I wrote PM for was: I have a program made up of n source files, where n is a big number; I wish to build m of these with the -fnord flag, where m is also a big number, but smaller than n; some of those n files are dynamically generated; and I wish to build the whole program four times, for each combination of debugging on/off and ARM/ix86 code. make basically gives up and dies if you try to do this sort of thing (although GNU make's ability to attach variable declarations to certain file patterns helps hugely). - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKrrCLf9E0noFvlzgRAtThAJ9fq2EPmqN96kNEbuiSv/g26J/keQCg3vkd n9vWBMQlM3/+h8PKEbhbzjs= =2Ppy -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 17:08:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EK4Q0P021559; Mon, 14 Sep 2009 17:04:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C7DB18FF3; Mon, 14 Sep 2009 17:03:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (unknown [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 820EF18F5F for ; Mon, 14 Sep 2009 17:03:28 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MnHlg-0007ZK-PW for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 21:03:20 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 927B24602A for ; Mon, 14 Sep 2009 21:03:17 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:38754 with envelope Message-ID: <4AAEAF97.5030100@cowlark.com> Date: Mon, 14 Sep 2009 22:03:19 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] luamake References: <1079b050909131517p481a7f5dgd81f54f7c54fedf3@mail.gmail.com> <87y6oh5330.fsf@lola.goethe.zz> <560972290909140205xdc09e2fpa9d333583602602e@mail.gmail.com> <20090914101809.0ab82700@trite.i.flarn.net.i.flarn.net> <1582354582.20090914141220@gmail.com> <560972290909140327g698f894bqf69aecf3a700d1e2@mail.gmail.com> In-Reply-To: <560972290909140327g698f894bqf69aecf3a700d1e2@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8EK4Q0P021559 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 steve donovan wrote: [...] > Yeah, well: you can make Windows do unix > > http://www.microsoft.com/downloads/details.aspx?familyid=896c9688-601b-44f1-81a4-02878ff11778&displaylang=en > > But it's 216 meg. (There are useful Linux distros with less of a footprint) That's Interix, which I've used --- it's actually rather good, although acheingly archaic. The default shell is ksh. (SunOS 4 users will find it hauntingly familiar.) And interestingly, most versions Windows 7 has it built in, although you need to install the front-end tools to make use for it. (Just tick the appropriate box in the 'Install Windows Components' dialogue to get it all.) The version you linked to is for XP. You get gcc and all the X libraries (but no server) and a case sensitive file system and the ability to make filenames called 'aux.c' and everything. It's much faster than Cygwin and integrates nicely into the NT security model. Lua builds and runs happily on it, too. If you're stuck being a Unix user in a Windows-only shop, Interix is definitely worth a look --- much less sanity-destroying than Cygwin and it scripts well. OTOH as it's rather exotic a lot of tools don't get on well with it. It won't interoperate with Cygwin binaries without work, for example, as the hack Cygwin uses to figure out whether it's being run from cmd.exe or a Cygwin shell gets confused on it. Lots of stuff including add-on packs of more modern tools (ssh, yay) available here: http://www.suacommunity.com/ Note that those links all assume you've installed the Microsoft part of things. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKrq+Uf9E0noFvlzgRAjp+AJ90zgouFea108tboz+9JNui3F6fAgCeP0Sn OA073gzfUFFaSBTzWjkfdlM= =PKpO -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 18:01:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8EL0xdv002643; Mon, 14 Sep 2009 18:01:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D01EC190D8; Mon, 14 Sep 2009 18:00:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id 021251909A for ; Mon, 14 Sep 2009 18:00:13 -0300 (BRT) Received: (qmail invoked by alias); 14 Sep 2009 21:00:10 -0000 Received: from p5B0130BA.dip0.t-ipconnect.de (EHLO dialup) [91.1.48.186] by mail.gmx.net (mp057) with SMTP; 14 Sep 2009 23:00:10 +0200 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX19fkTJEAeBfHYTeRfwU3zVfZH1Ntj16XQUX9q3naR BWGbf7Kngf/dAH Date: Mon, 14 Sep 2009 23:00:07 +0200 From: froese@gmx.de To: Lua list Subject: Re: first class ':' Message-Id: <20090914230007.4b90f45d.froese@gmx.de> In-Reply-To: <20090914123507.GC4414@inf.puc-rio.br> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.58 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > So, is there some support for Mark Hamburg's closure sugar in Rio ;) ? > > Yes. Here we would write C(set, "values") for C:values and define C as > > C = function (obj, met) > met = obj[met] > return function (...) return met(obj, ...) end > end A proposal for Lua 5.2: Make ':' an operator which creates a function with a bound first parameter. Like your definition of C above. That way, the colon operator is no longer syntactic sugar, it's a real operator which makes stuff like this possible: a=foo:bar a() Of course, if every method call would create such an object, perfor- mance would suffer badly. But: a simple direct method call (the only valid usage of the colon operator at the moment) can easily be detected in the code generator (or even in the parser) and the creation of the object can be avoided (BIND,CALL -> SELF,CALL). That way, simple method calls stay as fast as they are now and won't create garbage for each call. Open details: a) Wrap the binding in a CFunction or make it a new low-level type (i.e. BClosure along CClosure and LClosure). Wrapping it in a CFunction costs one redundant pointer per binding and suffers one call indirection. But implementation is easy. A new low-level type requires more changes but needs less space and requires no indirection when called. b) Early or late binding? Iow: fetch the method when binding or when calling. Iow: is the tuple or . I would prefer early binding - faster (fetch method only once) and ... hmm ... late binding is so unpredictable ;-) Ciao, ET. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 18:12:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ELCNLt004952; Mon, 14 Sep 2009 18:12:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43E071914F; Mon, 14 Sep 2009 18:11:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E1AD19109 for ; Mon, 14 Sep 2009 18:11:29 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MnIpT-0007Rh-Ub for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 21:11:20 +0000 From: "John Hind" To: "'Lua list'" References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <002101ca3547$6e7c9910$4b75cb30$@hind@zen.co.uk> <20090914131230.A31229@lua.tecgraf.puc-rio.br> In-Reply-To: <20090914131230.A31229@lua.tecgraf.puc-rio.br> Subject: RE: Regarding the name 'pairs' Date: Mon, 14 Sep 2009 22:10:20 +0100 Message-ID: <000001ca357f$c44f71e0$4cee55a0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco1Vkl//LjPkDX3RGGjBO5/Yllr5gAILIKQ Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ah, of course, thanks! Regarding the competing proposals for the no-arguments case, why not go the "give us the tools" route and have a metamethod for cases were the "function arguments expected" error would otherwise result. Call this "__reference" for the sake of argument. 1) Hamburg enthusiasts could use this metamethod on the function type to implement their closure syntax. 2) "__iter" partisans could use this on table-based classes to implement class-specific default iterator factories without consuming the "__call" metamethod or requiring empty parenthesis. 3) Multiple-iterator-as-methods fans could again use this metamethod on the function type to remove the need for empty parenthesis on parameterless function calls. (Not ideal as it's global, but some of us might like this behaviour generally anyway.) Clearly 1 and 3 are still mutually exclusive, but we do get the choice which behaviour we prefer (and many other possibilities would also be enabled that we've not even thought of). > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique de > Figueiredo > Sent: 14 September 2009 17:13 > To: Lua list > Subject: Re: Regarding the name 'pairs' > > meta = {__call=function(o,x,i) return next(o,i) end} From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 21:46:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F0k0FB001588; Mon, 14 Sep 2009 21:46:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EB7219235; Mon, 14 Sep 2009 21:45:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29FC5191D9 for ; Mon, 14 Sep 2009 21:45:17 -0300 (BRT) Received: by iwn1 with SMTP id 1so1467720iwn.11 for ; Mon, 14 Sep 2009 17:45:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.6.79 with SMTP id 15mr14451241iby.36.1252975519443; Mon, 14 Sep 2009 17:45:19 -0700 (PDT) In-Reply-To: <20090914230007.4b90f45d.froese@gmx.de> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> Date: Mon, 14 Sep 2009 20:45:19 -0400 X-Google-Sender-Auth: 3039d5a3d02732e2 Message-ID: Subject: Re: first class ':' From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 5:00 PM, wrote: > A proposal for Lua 5.2: Make ':' an operator which creates a function > with a bound first parameter. We should decide how stack level behaves under this proposal. Consider: local o = {} function o:test() return debug.getinfo(1, 'f').func, debug.getinfo(2, 'f').func, debug.getinfo(3, 'f').func end -- [1] local a,b = o.test(o) assert(a == o.test) assert(b == debug.getinfo(1,'f').func) -- [2] local a,b = o:test() assert(a == o.test) assert(b == debug.getinfo(1,'f').func) -- [3] local a,b,c = (function(...) return o.test(o, ...) end)() assert(a == o.test) assert(b == nil) -- tail call in anonymous function assert(c == debug.getinfo(1,'f').func) print 'done' -- passes under Lua 5.1 In Lua 5.1, [1] and [2] execute at the same stack level, but [3] executes at a deeper stack level. To preserve the equivalence of [1] and [2] under the proposal, we would need to make [2] like [3] but not introduce a new stack level. Currently, Lua lacks a documented way to express that type of currying operation. From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 21:54:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F0s5Nn002611; Mon, 14 Sep 2009 21:54:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDFB419271; Mon, 14 Sep 2009 21:53:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-31.bluehost.com (outbound-mail-31.bluehost.com [69.89.18.151]) by bazar2.conectiva.com.br (Postfix) with SMTP id E7FA8191D9 for ; Mon, 14 Sep 2009 21:53:35 -0300 (BRT) Received: (qmail 31486 invoked by uid 0); 15 Sep 2009 00:53:37 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy2.bluehost.com with SMTP; 15 Sep 2009 00:53:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=5F4BKx7hy7I/AFwPEWrKkOobSqoyoQ2C1Ey8wQloFOUSBen0cI9gWw36yIVMscTJIfaiMZxm3H9meA7HjjMuL+KHjarAGVoZe4eqpYk9TPxZHmpi2LY3H5tUv6ttDLcu; Received: from 64-203-156-199.dmt.ntelos.net ([64.203.156.199] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MnMIa-0005YY-EO for lua@bazar2.conectiva.com.br; Mon, 14 Sep 2009 18:53:36 -0600 Date: Mon, 14 Sep 2009 20:53:33 -0400 From: TNHarris To: Lua list Subject: Re: Regarding the name 'pairs' Message-ID: <20090914205333.2ab1af9a@egeria.whoopdedo.org> In-Reply-To: <790db3550909140734m5987d6d9pe3237d230716d95b@mail.gmail.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <1997517301161778048@unknownmsgid> <790db3550909140734m5987d6d9pe3237d230716d95b@mail.gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.203.156.199 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 14 Sep 2009 10:34:36 -0400 Patrick Donnelly wrote: > > pairs and ipairs would still be useful with this __iter metamethod as > tables have no __iter metamethod by default (naturally). We can also > set the __iter metamethod of our metatables to next or (ipairs{}) to > alleviate the need for calling pairs or ipairs manually. > This requires the object to be used as the state invariant for the iterator function. This may not always be the case and would require objects that need to use a different value for state to use a non-standard iterator. The point of a metamethod is to increase use of standard protocols. If the metamethod has the same form as "pairs" then it works in all cases. I don't think the extra function call is too high a price. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Mon Sep 14 22:44:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F1icqU008833; Mon, 14 Sep 2009 22:44:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C73A1929F; Mon, 14 Sep 2009 22:44:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C41E919276 for ; Mon, 14 Sep 2009 22:44:02 -0300 (BRT) Received: by iwn1 with SMTP id 1so1485172iwn.11 for ; Mon, 14 Sep 2009 18:44:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.95 with SMTP id g31mr12968044ibr.24.1252979043025; Mon, 14 Sep 2009 18:44:03 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Sep 2009 21:44:02 -0400 X-Google-Sender-Auth: 946545ab9c5a2e21 Message-ID: Subject: Re: Announce: Darwin module system From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8F1icqU008833 On Mon, Sep 14, 2009 at 7:25 AM, Jim Jennings wrote: > In the latter case, structure declarations will ideally contain only 'open' > and 'files' clauses (out of the 5 clauses that process code).  When this > pattern is followed, there are two small benefits:  (1) the file names are > declared, so they can be extracted programatically when analyzing the > modules in a particular system; I suspected such a reason, but on the other hand there was the prevalence of things like environment=[[ require("lanes"); return lanes ]] (not that this is that hard to parse). > and (2) a search path for code loaded by > Darwin can be distinct from the path(s) used by the native Lua module > system.  Darwin supports a customizable search path for file names listed in > the 'files' clause. Why isn't the native Lua search path sufficient? From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 02:25:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F5P1av030279; Tue, 15 Sep 2009 02:25:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA6B192D0; Tue, 15 Sep 2009 02:24:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94649192A8 for ; Tue, 15 Sep 2009 02:24:24 -0300 (BRT) Received: by iwn1 with SMTP id 1so1538829iwn.11 for ; Mon, 14 Sep 2009 22:24:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.4.149 with SMTP id 21mr14935421ibr.26.1252992265225; Mon, 14 Sep 2009 22:24:25 -0700 (PDT) Date: Tue, 15 Sep 2009 01:24:25 -0400 X-Google-Sender-Auth: 71b1503553409ade Message-ID: Subject: improving the module function - package.clean From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm surprised I haven't thought of this sooner (nor seen this posted elsewhere). Here are two "module" function options that in a simple way avoid the problem of a module's private namespace being polluted to its public namespace. function package.clean(module) local privenv = {_PACKAGE_CLEAN = true} setfenv(3, setmetatable(privenv, {__index=_G, __newindex=function(_,k,v) rawset(privenv,k,v); module[k]=v end})) end function package.veryclean(module) local privenv = {M=module, _PACKAGE_VERYCLEAN = true} setfenv(3, setmetatable(privenv, {__index=_G})) end Examples: -- baz.lua module(..., package.clean) function foo() print 'test' end function bar() foo() end -- baz.lua (alternative) module(..., package.veryclean) function M.foo() print 'test' end function M.bar() M.foo() end -- test.lua require "baz" assert(not baz.print) -- globals not exposed (unlike package.seeall) baz.bar() -- ok This can also be combined with a reimplementation of strict.lua. See [1] for further details. Still, my other complaints about the module function [2] still hold. Mainly, the module function writes the module's external API to the shared global environment (via the "luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1)" call in loadlib.c:ll_module) rather than to the individual private namespaces of its clients. Secondly, the rules for merging the external APIs of two modules with a common prefix (e.g. foo and foo.bar), as also defined in luaL_findtable, break the isolation between foo and bar. That is, bar is written inside the foo table, and any other module subsequently doing only require "foo" automatically gets foo.bar. These two problems are easily addressed by importing external APIs of modules only into local variables of the clients (e.g. local bar = require "foo.bar"), but there are also ways to address these by importing them into the private environment of the clients via an import mechanism like Perl/Python: import "foo" -- instead of require "foo" where "import" is roughly defined as function import(name) local env = getfenv(2) env[name] = require(name) -- warning: the above line is similar to luaL_findtable, but this simple implementation -- does not handle dots "." in name. end Unfortunately, we are still left with some possible conflicts when the module function writes to the shared global environment. The only way I see around that is to redefine or avoid the module function. I think a suitable resolution along the former lines is to remove the luaL_findtable call in ll_module and optionally move it into an import statement like the above. I'd argue that luaL_findtable is not a module definition concern but an importation concern. This also has the added benefit that clients could define more than one type of import statement for different types of importation behavior given a single definition of module. [1] http://lua-users.org/wiki/ModuleDefinition [2] http://lua-users.org/wiki/LuaModuleFunctionCritiqued From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 02:35:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F5ZoUC031063; Tue, 15 Sep 2009 02:35:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95C2D192DD; Tue, 15 Sep 2009 02:35:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth23.prod.mesa1.secureserver.net (smtpauth23.prod.mesa1.secureserver.net [64.202.165.47]) by bazar2.conectiva.com.br (Postfix) with SMTP id 10F42192A8 for ; Tue, 15 Sep 2009 02:35:22 -0300 (BRT) Received: (qmail 24057 invoked from network); 15 Sep 2009 05:35:23 -0000 Received: from unknown (98.117.140.83) by smtpauth23.prod.mesa1.secureserver.net (64.202.165.47) with ESMTP; 15 Sep 2009 05:35:23 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: userdata environment From: Mark Hamburg In-Reply-To: Date: Mon, 14 Sep 2009 22:35:21 -0700 Content-Transfer-Encoding: 7bit Message-Id: <9947AD81-EDC0-4BA5-943F-625CFC1A9BB1@grubmah.com> References: <89d273ba0909010720i1f90d61dl136c0546f77b2f03@mail.gmail.com> <89d273ba0909080137u6464bca6w9f428c60fe00ba78@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 13, 2009, at 11:55 PM, Juris Kalnins wrote: > On Sat, 12 Sep 2009 21:30:30 +0300, Mark Hamburg > wrote: > >> Personally, on Lightroom, I wished for the ability to store nil in >> the userdata environment table. > > That's harder. Currently it's a pointer to something that can be put > in GC > list, which excludes nil, bools, numbers and lightuserdata. Changing > that > would be a much bigger patch, and would increase size of userdata > header. Nil doesn't require an expansion of the data structures since a NULL pointer will do. It does require an expansion in the C code to deal with that case but possibly not much more than the expansion needed to handle types other than a table. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 02:44:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F5ilNU031856; Tue, 15 Sep 2009 02:44:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80C8419298; Tue, 15 Sep 2009 02:44:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-08.prod.phx3.secureserver.net (p3plsmtpa01-08.prod.phx3.secureserver.net [72.167.82.88]) by bazar2.conectiva.com.br (Postfix) with SMTP id A2F78191E8 for ; Tue, 15 Sep 2009 02:44:19 -0300 (BRT) Received: (qmail 23374 invoked from network); 15 Sep 2009 05:44:21 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-08.prod.phx3.secureserver.net (72.167.82.88) with ESMTP; 15 Sep 2009 05:44:20 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: First class : (was Re: Regarding the name 'pairs') From: Mark Hamburg In-Reply-To: <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> Date: Mon, 14 Sep 2009 22:44:19 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 14, 2009, at 5:26 AM, steve donovan wrote: > On Mon, Sep 14, 2009 at 2:16 PM, Luiz Henrique de Figueiredo > wrote: >> One important reason for not having "set:values" is that it'd be >> sugar >> for "function (...) return set:values(...) end" and this would imply >> the creation of a hidden closure. > > Yes, it did feel like an incompatible proposal. > > So, is there some support for Mark Hamburg's closure sugar in Rio ;) ? To be fair, though I'm not sure to whom, I think someone promoted it before I did. ;-) But the full details of my proposal included: 1. Binds early. 2. Binds strongly. (Weak closures are a separate implementation problem.) 3. Only generates a closure when not used at a call site though this should be purely an optimization. The piece of syntax I will take credit for promoting since I don't think I'd seen it elsewhere before is: obj:[method](...) and in this case: obj:[method] Thereby allowing the method name to be an expression while at the same time not forcing the repetition of obj in an expansion of the colon operator. I believe this is actually moderately easy to implement as a patch on the current Lua implementation. (I'd have to go find my notes on how to do so.) Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 02:59:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F5xDmf000654; Tue, 15 Sep 2009 02:59:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A32F5192AD; Tue, 15 Sep 2009 02:58:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-05.prod.phx3.secureserver.net (p3plsmtpa01-05.prod.phx3.secureserver.net [72.167.82.85]) by bazar2.conectiva.com.br (Postfix) with SMTP id 967E7191E8 for ; Tue, 15 Sep 2009 02:58:39 -0300 (BRT) Received: (qmail 21601 invoked from network); 15 Sep 2009 05:58:40 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-05.prod.phx3.secureserver.net (72.167.82.85) with ESMTP; 15 Sep 2009 05:58:39 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: First class : (was Re: Regarding the name 'pairs') From: Mark Hamburg In-Reply-To: Date: Mon, 14 Sep 2009 22:58:38 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 14, 2009, at 10:44 PM, Mark Hamburg wrote: > On Sep 14, 2009, at 5:26 AM, steve donovan wrote: > >> On Mon, Sep 14, 2009 at 2:16 PM, Luiz Henrique de Figueiredo >> wrote: >>> One important reason for not having "set:values" is that it'd be >>> sugar >>> for "function (...) return set:values(...) end" and this would imply >>> the creation of a hidden closure. >> >> Yes, it did feel like an incompatible proposal. >> >> So, is there some support for Mark Hamburg's closure sugar in >> Rio ;) ? > > To be fair, though I'm not sure to whom, I think someone promoted it > before I did. ;-) > > But the full details of my proposal included: > > 1. Binds early. > 2. Binds strongly. (Weak closures are a separate implementation > problem.) > 3. Only generates a closure when not used at a call site though this > should be purely an optimization. > > The piece of syntax I will take credit for promoting since I don't > think I'd seen it elsewhere before is: > > obj:[method](...) > > and in this case: > > obj:[method] > > Thereby allowing the method name to be an expression while at the > same time not forcing the repetition of obj in an expansion of the > colon operator. > > I believe this is actually moderately easy to implement as a patch > on the current Lua implementation. (I'd have to go find my notes on > how to do so.) In primaryexp (lparser.c), the colon operator case becomes: case ':': { /* `:' NAME funcargs */ expdesc key; luaX_next(ls); /* PATCH: Add support for obj:[ exp ] syntax for calling methods. */ if (ls->t.token == '[') { yindex(ls, &key); } else { checkname(ls, &key); } luaK_self(fs, v, &key); /* Compiles each expression evaluating them into a sequence of registers. */ switch (ls->t.token) { /* PATCH: Check for a call before going to the funcargs case, otherwise curry. */ case '(': case TK_STRING: case '{': { /* funcargs */ funcargs(ls, v); break; } default: { currymethod(ls, v); return; } } break; } I'm afraid I don't have an implementation for currymethod. Without that support, the inner switch just becomes a call to funcargs(ls,v). But to get the rest of obj:[ method ] working one also needs to revise luaK_self in lcode.c: void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { int func; luaK_exp2anyreg(fs, e); freeexp(fs, e); func = fs->freereg; luaK_reserveregs(fs, 2); luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); freeexp(fs, key); fs->freereg = func + 2; /* PATCH: Make sure that freeing the key won't have just cost us a register. Why??? */ e->u.s.info = func; e->k = VNONRELOC; } As the comments, suggest it would be good to have someone who knows the register behavior in the Lua code generator better than I review this code. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 03:13:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F6DZr8001982; Tue, 15 Sep 2009 03:13:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64E601928F; Tue, 15 Sep 2009 03:13:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth16.prod.mesa1.secureserver.net (smtpauth16.prod.mesa1.secureserver.net [64.202.165.22]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7A6341892B for ; Tue, 15 Sep 2009 03:13:08 -0300 (BRT) Received: (qmail 30779 invoked from network); 15 Sep 2009 06:13:05 -0000 Received: from unknown (98.117.140.83) by smtpauth16.prod.mesa1.secureserver.net (64.202.165.22) with ESMTP; 15 Sep 2009 06:13:05 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: First class : (was Re: Regarding the name 'pairs') From: Mark Hamburg In-Reply-To: Date: Mon, 14 Sep 2009 23:13:04 -0700 Content-Transfer-Encoding: 7bit Message-Id: <601FD1BF-DE16-4E8F-B6B5-F89CA1716859@grubmah.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Of course, this all leads to the ulterior motive of making obj:method (...) more than just sugar for obj.method( obj, ... ). The semantics of how to do that remain fuzzy and depend to some extent on the goals. The simplest option is introducing a separate metatable entry which parallels __index but which will be used in preference to __index when doing method lookup. This alone makes it easier to implement properties/attributes on objects and catches many accidental uses of period rather than colon. But that then leads to questions such as whether there needs to be a corresponding method assignment metamethod and just how much complexity is warranted. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 05:02:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F82lP3013039; Tue, 15 Sep 2009 05:02:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FAFA192D5; Tue, 15 Sep 2009 05:02:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECC5E1928E for ; Tue, 15 Sep 2009 05:02:03 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MnSyV-0008ID-Qc for lua@bazar2.conectiva.com.br; Tue, 15 Sep 2009 10:01:19 +0200 Received: from p5b2c2adb.dip.t-dialin.net ([91.44.42.219]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 10:01:19 +0200 Received: from dak by p5b2c2adb.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 10:01:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: first class ':' Date: Tue, 15 Sep 2009 10:00:38 +0200 Organization: Organization?!? Lines: 24 Message-ID: <873a6o1vtl.fsf@lola.goethe.zz> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2adb.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:AWjCyF+sd0ZdGWigyOdsTmx9WGc= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean froese@gmx.de writes: >> > So, is there some support for Mark Hamburg's closure sugar in Rio ;) ? >> >> Yes. Here we would write C(set, "values") for C:values and define C as >> >> C = function (obj, met) >> met = obj[met] >> return function (...) return met(obj, ...) end >> end > > A proposal for Lua 5.2: > > Make ':' an operator which creates a function with a bound first > parameter. Like your definition of C above. > That way, the colon operator is no longer syntactic sugar, [...] But I like the things that are just syntactic sugar in Lua: it means that you can exhaustively explain them in more basic terms in one sentence. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 05:17:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8F8HcdI014361; Tue, 15 Sep 2009 05:17:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2F61192A8; Tue, 15 Sep 2009 05:17:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C596192A0 for ; Tue, 15 Sep 2009 05:17:05 -0300 (BRT) Received: by bwz10 with SMTP id 10so3012646bwz.5 for ; Tue, 15 Sep 2009 01:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=F01/99G/NIIInOf7xW95zw9m0DPo4hy5hbo7AoLVpCE=; b=GdmvzbRIcekID+v48X0tPvxpC6N+Pb/20CZ7pB/5+kDT3qmJhXF+/q49RzT2Q3T22M H0kMqcJjz+Nxdb32dZXGT0kl310EMw/finHD0J9lZ6lK0AxA45KEE9xlRhkGiRK3dPpN gF/Cv8R8MiIExoPCEx5cpXPHHNdLGc7VrWmyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bojO/ISyINRkmUTZMvg74zKLnhVpIwh65K4f0ohE8q9a9utEsPx8Q9SZQit98hgsnx c8Ujtp46Ys2ClkOytfWY8hnZHzF6UtyvBtLsgeRTDjxfI+fVMufY4A5QmAVOzpto9UPL DaxrcK8k++Jpx7ciGtOdIAWDo8Ao6AnPpOpgQ= MIME-Version: 1.0 Received: by 10.204.150.65 with SMTP id x1mr5920808bkv.6.1253002627822; Tue, 15 Sep 2009 01:17:07 -0700 (PDT) In-Reply-To: <873a6o1vtl.fsf@lola.goethe.zz> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> Date: Tue, 15 Sep 2009 10:17:07 +0200 Message-ID: <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> Subject: Re: first class ':' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 15, 2009 at 10:00 AM, David Kastrup wrote: > But I like the things that are just syntactic sugar in Lua: it means > that you can exhaustively explain them in more basic terms in one > sentence. OK, this is sugar we know so well: - obj:method() becomes obj.method(obj) But in the case of a obj:method _without_ parentheses, then there is a somewhat more elaborate expansion as a closure. That feels manageable. First-class ':' has some cute advantages, it is an operator and presumably has a metamethod, so that we can finally distinguish between method and table lookup, _if needed_. But I worry about the complexity of the change, possible performance implications, and more semantics that, yes, have to be explained ... steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 08:58:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FBwjFF003713; Tue, 15 Sep 2009 08:58:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EEF719109; Tue, 15 Sep 2009 08:57:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75ECC1909A for ; Tue, 15 Sep 2009 08:57:44 -0300 (BRT) Received: by bwz10 with SMTP id 10so3140601bwz.5 for ; Tue, 15 Sep 2009 04:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5kJ358t0dqeoqmjDRiF1Gwv5f6HuMlSM0a7p9nVKA2Q=; b=Me1AR4ERqXGvVrpR2F3W8hht2VC6rlXhVRjEqpvSu7nG6KsyykKjjXjWP01l5bTgdk 1YvHQ+8bupCz7q9VD1/oViBT4e7A3VfHGkDTIK2j14s/vCPUCL35KCPNT6XHIDLlLKEa QHnmX3xHscmpKmmJ0giE4RpPWgLQ7cN8xnXO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uEZJmr23QhYS/LSaLb3kNOJ3ur+QRcefXOV72oB1bapGNN4YlbQ98tOWptq7/RVpzK +gjxgJndOei0O+B+TrSrDZ4neuXjRpQ5mfPU9Xhnhzxw9hpwvgBKY21h7yX2lAHMOptm 7KkzOS7/61zx+1e+n4uAG+0waev6k4UVPBpio= MIME-Version: 1.0 Received: by 10.204.7.195 with SMTP id e3mr6202659bke.118.1253015861193; Tue, 15 Sep 2009 04:57:41 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 Sep 2009 12:57:41 +0100 Message-ID: <4db9cacb0909150457r6587b012kde88e980b4148e51@mail.gmail.com> Subject: Re: improving the module function - package.clean From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8FBwjFF003713 2009/9/15 David Manura : > I'm surprised I haven't thought of this sooner (nor seen this posted > elsewhere).  Here are two "module" function options that in a simple > way avoid the problem of a module's private namespace being polluted > to its public namespace. > >  function package.clean(module) >    local privenv = {_PACKAGE_CLEAN = true} >    setfenv(3, setmetatable(privenv, {__index=_G, > __newindex=function(_,k,v) rawset(privenv,k,v); module[k]=v end})) >  end >  function package.veryclean(module) >    local privenv = {M=module, _PACKAGE_VERYCLEAN = true} >    setfenv(3, setmetatable(privenv, {__index=_G})) >  end Nice trick, I'll keep this one handy, though I must say I've never really been bothered by mymodule.print (except it being bad in a sandbox). > Still, my other complaints about the module function [2] still hold. > Mainly, the module function writes the module's external API to the > shared global environment (via the "luaL_findtable(L, > LUA_GLOBALSINDEX, modname, 1)" call in loadlib.c:ll_module) rather > than to the individual private namespaces of its clients. Now *this* problem is quite easily the most annoying thing about the module system, and Lua as a whole in fact. In a sandbox it causes modules to load outside the current environment, and hence inaccessible. module() is fairly easy to override in Lua, however luaL_register() in the C API is not. I think the solution is to shift the responsibility of setting _G[modulename] to require(), rather than the modules. Then we are free to re-implement require(), or add import(), or anything we would rather, and existing scripts would be minimally affected. But right now this is practically impossible to do without modifying the Lua core. I don't think I've heard much about changes to the package system in 5.2, I think I'd be being too hopeful if this was actually fixed for that :) Matthew From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 09:49:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FCnQx9011051; Tue, 15 Sep 2009 09:49:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 501351917B; Tue, 15 Sep 2009 09:48:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f179.google.com (mail-px0-f179.google.com [209.85.216.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E09C81909A for ; Tue, 15 Sep 2009 09:48:49 -0300 (BRT) Received: by pxi9 with SMTP id 9so3526509pxi.14 for ; Tue, 15 Sep 2009 05:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=NE7ffYxWv7kHNCvagHJL8q4LlT+vvIjvf+QQV5JgaaQ=; b=lhrl4h/NLaI9VcaPmTOlGuACIeDhGHTFhD9mpP9qJ95AQzZxxnwEryGJ99zsZTQib1 smkNZ0fug1UhQiIGPs+ucEoITRT9OJAfjxXvDq1QflQc/cqTGZo76OKHqsMNEVtoHTEy z3IcpyHvkxxYfFUjNOKmsC+iHBAVe4FSWtga4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=G4/IQj4BQcmt/OqUTeqNE4RH7rke0dOj/eLB+5nqp+QrBxXHm7AUbT86nfFjJZIrBy VzkSlDNQwY2SDOVaNVoMoshgtTIj3N+x/1U1Fonz0n8ejA9qX6IWY436IEsI1lmb9+TT igz4F1hw388XVRjRqcHI56IeJx9eQzThz+a0I= MIME-Version: 1.0 Received: by 10.142.201.21 with SMTP id y21mr587860wff.341.1253018931171; Tue, 15 Sep 2009 05:48:51 -0700 (PDT) From: Anurag Sharma Date: Tue, 15 Sep 2009 18:18:31 +0530 Message-ID: Subject: How to run a Lua script file To: Lua list Content-Type: multipart/alternative; boundary=000e0cd328124a13a504739d34e9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd328124a13a504739d34e9 Content-Type: text/plain; charset=ISO-8859-1 Hi I have created extensions for Lua. I have written a script file that uses the extention dll I want to know if there is a way to execute the script file at the launch of command prompt itself by passing some arguments to cmd.exe In other words, I have a function that excecutues script files (perl, lua, ruby). It looks as follows private runscript(string args) { Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.Arguments = String.Format("/K {0}", cmdArgs); process.Start(); } we set the args based on type of interpreter and file path for eg. in case of Perl, we have args = "perl5.10.0.exe " + pathToFile; what should be the equivalent in Lua ? Thanks Anurag --000e0cd328124a13a504739d34e9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

I have created extensions for Lua. I have written a s= cript file that uses the extention dll

I want to k= now if there is a way to execute the script file at the launch of =A0comman= d prompt itself by passing some arguments to cmd.exe

In other words, I have a function that excecutues scrip= t files (perl, lua, ruby). It looks as follows

pri= vate runscript(string args)
{
Process process =3D new Process();
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0process.StartInfo.Fil= eName =3D "cmd.exe";

=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0process.StartInfo.Arg= uments =3D String.Format("/K {0}", cmdArgs);=A0
process.Start();

}
<= br>
we set the args based on type of interpreter and file path=A0=

for eg. in case of Perl, we have
args = =3D "perl5.10.0.exe " + pathToFile;

what should be the equivalent in Lua ?

Thanks
Anurag
--000e0cd328124a13a504739d34e9-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 10:01:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FD1ASr013593; Tue, 15 Sep 2009 10:01:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA8151926D; Tue, 15 Sep 2009 10:00:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FFC618BCD for ; Tue, 15 Sep 2009 10:00:34 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MnXe5-0001zB-5E for lua@bazar2.conectiva.com.br; Tue, 15 Sep 2009 15:00:33 +0200 Received: from adsl77-195.kln.forthnet.gr ([77.49.124.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 15:00:33 +0200 Received: from petsagouris by adsl77-195.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 15:00:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: How to run a Lua script file Date: Tue, 15 Sep 2009 13:00:09 +0000 (UTC) Lines: 6 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 77.49.124.195 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean What you need to know about the lua.exe and other stuff is found in the manual[1] [1] http://www.lua.org/manual/5.1/manual.html#6 From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 10:25:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FDPA9D018084; Tue, 15 Sep 2009 10:25:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA987191B7; Tue, 15 Sep 2009 10:24:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f182.google.com (mail-pz0-f182.google.com [209.85.222.182]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3C3D19049 for ; Tue, 15 Sep 2009 10:24:30 -0300 (BRT) Received: by pzk12 with SMTP id 12so3199478pzk.10 for ; Tue, 15 Sep 2009 06:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=NJ/VRAOYaC7UnaYv/lAwwgkqtrf67JrtLzmkXylusm8=; b=fINmnlWt+vqDE+qh8KLW2zvI0Rfyr+dX2m1RSJMDwP+qEvptQNg6XBGb/E4EO9JuFz XIHc1vM1tp7GTYn7JnDTfyaOwptz9YLFhtpdEWWac0LJT8b/aUA7X1OTI+6OVrmwviOj 8/rjcbSGrOxE55b+cbXHdbrQL3Ar7mRquRuTQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=LH4CT2MC+g9qKARhyfE0nSSdK/05OmVGLCnDjxjwxYz5jmvlAFki3SxMAp56VfaJCQ iQIPh8DVVlFBOnHD6EeDMPNPdJaOkK0/qtsK76g12oZHFa60H1HXIC4aTfdut2u9sbtx KQZXi2ac0udKNxe2Oakud7ufwLWsCbxeq96RY= MIME-Version: 1.0 Received: by 10.142.6.8 with SMTP id 8mr542162wff.326.1253021069170; Tue, 15 Sep 2009 06:24:29 -0700 (PDT) In-Reply-To: References: From: Anurag Sharma Date: Tue, 15 Sep 2009 18:54:09 +0530 Message-ID: Subject: Re: How to run a Lua script file To: Lua list Content-Type: multipart/alternative; boundary=00504502b0ecb9585304739db3e4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b0ecb9585304739db3e4 Content-Type: text/plain; charset=ISO-8859-1 Hi I have tried the commands mentioned there. But it gives me error. Here is what I tried cmd.exe /K lua.exe -lmyapp_Lua 'C:\\a\\ScriptingLanguageSupport\\Lua1.lua' It opened a command prompt with the following error message. lua.exe: module 'myapp_Lua' not found: no field package.preload['myapp_Lua'] no file '.\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua\init.lua' no file 'C:\Program Files\Lua\5.1\myapp_Lua.lua' no file 'C:\Program Files\Lua\5.1\myapp_Lua\init.lua' no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.luac' no file '.\myapp_Lua.dll' no file '.\myapp_Lua51.dll' no file 'C:\Program Files\Lua\5.1\myapp_Lua.dll' no file 'C:\Program Files\Lua\5.1\myapp_Lua51.dll' no file 'C:\Program Files\Lua\5.1\clibs\myapp_Lua.dll' no file 'C:\Program Files\Lua\5.1\clibs\myapp_Lua51.dll' no file 'C:\Program Files\Lua\5.1\loadall.dll' no file 'C:\Program Files\Lua\5.1\clibs\loadall.dll' stack traceback: [C]: ? [C]: ? Thanks Anurag On Tue, Sep 15, 2009 at 6:30 PM, George Petsagourakis wrote: > What you need to know about the lua.exe and other stuff is found in the > manual[1] > > [1] http://www.lua.org/manual/5.1/manual.html#6 > > > > > --00504502b0ecb9585304739db3e4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi=A0
I have tried the commands mentioned there. But it gives me error.= =A0
Here is what I tried

cmd.exe /K lua.= exe -lmyapp_Lua 'C:\\a\\ScriptingLanguageSupport\\Lua1.lua'

It opened a command prompt with the following error message.=

lua.exe: module 'myapp_Lua' not foun= d:
=A0=A0 =A0 =A0 =A0no field package.preload['myapp_Lua'= ]
=A0=A0 =A0 =A0 =A0no file '.\myapp_Lua.lua'
=A0=A0 = =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\lua\myapp_Lu= a\init.lua'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\myapp_Lua.lua'<= /div>
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\myapp_Lua\init= .lua'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1= \lua\myapp_Lua.luac'
=A0=A0 =A0 =A0 =A0no file '.\myapp_L= ua.dll'
=A0=A0 =A0 =A0 =A0no file '.\myapp_Lua51.dll'=
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\myapp_Lua.dll&= #39;
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\myap= p_Lua51.dll'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\= Lua\5.1\clibs\myapp_Lua.dll'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\clibs\myapp_Lu= a51.dll'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\= 5.1\loadall.dll'
=A0=A0 =A0 =A0 =A0no file 'C:\Program Fi= les\Lua\5.1\clibs\loadall.dll'
stack traceback:
=A0=A0 =A0 =A0 =A0[C]: ?
=A0=A0 = =A0 =A0 =A0[C]: ?


Thanks
= Anurag

On Tue, Sep 15, 2009 at 6:30 PM,= George Petsagourakis <petsagouris@gmail.com> wrote:
What you need to know about the lua.exe and= other stuff is found in the manual[1]

=A0[1] http://www.lua.org/manual/5.1/manual.html#6





--00504502b0ecb9585304739db3e4-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 10:31:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FDVXwD019331; Tue, 15 Sep 2009 10:31:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 673F01926F; Tue, 15 Sep 2009 10:31:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6357E19049 for ; Tue, 15 Sep 2009 10:31:01 -0300 (BRT) Received: by bwz10 with SMTP id 10so3208024bwz.5 for ; Tue, 15 Sep 2009 06:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=T1t9gzs3frs+H1ssNRl8zAewscbZ3DTZbLNZPYMK0/M=; b=MWrzQB9bjSEihpvqmTsGGIdD0ptCMgdFpeWqWYmTWdQS8C/3oDNP9DawibDjVecEf8 5JlKh75F/e+snzzmv1UktIS3Ha7PeNfLNTzwmweX9vryT20W8lHgcpPRmg+dU+U03iQ9 O1zeEnWV542iDCN1IPN+38Pj0DwnagX6ccPT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gbJR1rVGP4su9e3Bde5a+/aIYSy6P3fCyvoNhsAVNchd5R8DqwxR58Zaea0QfhK0go 6KJ4TTISwNN/gpd1J3KKOmUvbHTZpG9Dg40MrofHlx4D2e9kFHV9tGMzi7scQVwApG0k MTHC4VaieS88c+DwXsq+syCzI9PrEbhOayLKc= MIME-Version: 1.0 Received: by 10.204.162.143 with SMTP id v15mr6272487bkx.50.1253021463347; Tue, 15 Sep 2009 06:31:03 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 Sep 2009 15:31:03 +0200 Message-ID: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> Subject: Re: How to run a Lua script file From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8FDVXwD019331 On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma wrote: > lua.exe: module 'myapp_Lua' not found: >         no field package.preload['myapp_Lua'] >         no file '.\myapp_Lua.lua' >         no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua' .. This error message is instructive; Lua is just telling you that your myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua in one of the these standard places? If not, either move it there, or read up about the LUA_PATH environment variable. Another approach is something like: lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... This works because Lua uses the value of package.path to match modules. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 10:50:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FDo7Xw024073; Tue, 15 Sep 2009 10:50:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A68D1929A; Tue, 15 Sep 2009 10:49:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f179.google.com (mail-px0-f179.google.com [209.85.216.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6F62191F0 for ; Tue, 15 Sep 2009 10:49:25 -0300 (BRT) Received: by pxi9 with SMTP id 9so3563563pxi.14 for ; Tue, 15 Sep 2009 06:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=mvwp9t6F4O0P2y2/DLdqaznAIUXE+4OW+fpc16k9FNo=; b=xdy0EqpQHt/r5xv2uWWOav4jX7P5BWDdVvySlL1C9ZbBvsp0UHmoaVgloAkpRH3Tpo cwgYlYA40cJiHqbrve2FcNK4w6u1VYBAJdOLt7w5ywlr+9Jb89R5geoi8fH6Ug+qUtUz qklUbFJwkmCfh48Q+vHWJXfTEN7msmwIuLJBw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=UQW8ZBWNagBIUvFjwU+NQWpKwTQv/lhnDAYBugP3is4h0ZVYvE7tN8A5dkSAaS5lZa 3IUs123c3rO94jmv83cueNHp1puBo3cQM6B+Xf0yamBvczSMjysHggK2djSrcnC92Rcv sidnUtSkvON0nMU1ik6LECAIZqrxYjBbhdJwM= MIME-Version: 1.0 Received: by 10.142.210.13 with SMTP id i13mr577418wfg.147.1253022210116; Tue, 15 Sep 2009 06:43:30 -0700 (PDT) In-Reply-To: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> References: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> From: Anurag Sharma Date: Tue, 15 Sep 2009 19:13:10 +0530 Message-ID: Subject: Re: How to run a Lua script file To: Lua list Content-Type: multipart/alternative; boundary=000e0cd32eaabace0104739df73e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd32eaabace0104739df73e Content-Type: text/plain; charset=ISO-8859-1 I tried when I try the following, I get error message lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... error message is as follows lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global 'myapp_Lua' (a nil value) stack traceback: C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main chunk [C]: ? [C]: ? Some background information, I have alerady set the following enviroment variables, Path, Lua_dev, Lua_path, Lua_CPath Also the same script works when I run it from Lua console by using a dofile command. In that case I launch Lua console using cmd /K lua -lmyapp_Lua.. Thanks Anurag On Tue, Sep 15, 2009 at 7:01 PM, steve donovan wrote: > On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma > wrote: > > lua.exe: module 'myapp_Lua' not found: > > no field package.preload['myapp_Lua'] > > no file '.\myapp_Lua.lua' > > no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua' > .. > > This error message is instructive; Lua is just telling you that your > myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua > in one of the these standard places? If not, either move it there, or > read up about the LUA_PATH environment variable. > > Another approach is something like: > > lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... > > This works because Lua uses the value of package.path to match modules. > > steve d. > --000e0cd32eaabace0104739df73e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried=A0
when I try the following, I get error message

=
lua -e "package.path=3D'\\mypath\?.lua;'..package.p= ath" -lmyapp_Lua ...

error message is as follows

lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: att= empt to index global 'myapp_Lua'
(a nil value)
= stack traceback:
=A0=A0 =A0 =A0 =A0C:\a\ScriptingLanguageSupport\= Lua1.lua:5: in main chunk
=A0=A0 =A0 =A0 =A0[C]: ?
=A0=A0 =A0 =A0 =A0[C]: ?
=


Some background information,
I have alerady set the following enviroment variables,
P= ath, Lua_dev, Lua_path, Lua_CPath
Also the same script works when I run it from Lua console by using a d= ofile command. In that case I launch Lua console using =A0cmd /K lua -lmyap= p_Lua..


Thanks
Anurag
On Tue, Sep 15, 2009 at 7:01 PM, stev= e donovan <steve.j.donovan@gmail.com> wrote:
On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma
<anurag.sharma.101@gmail.= com> wrote:
> lua.exe: module 'myapp_Lua' not found:
> =A0=A0 =A0 =A0 =A0no field package.preload['myapp_Lua']
> =A0=A0 =A0 =A0 =A0no file '.\myapp_Lua.lua'
> =A0=A0 =A0 =A0 =A0no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.= lua'
..

This error message is instructive; Lua is just telling you that your
myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua
in one of the these standard places? =A0If not, either move it there, or read up about the LUA_PATH environment variable.

Another approach is something like:

lua -e "package.path=3D'\\mypath\?.lua;'..package.path" -= lmyapp_Lua ...

This works because Lua uses the value of package.path to match modules.

steve d.

--000e0cd32eaabace0104739df73e-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 11:35:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FEZEwV002967; Tue, 15 Sep 2009 11:35:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A93C518C94; Tue, 15 Sep 2009 11:34:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9B1918AF1 for ; Tue, 15 Sep 2009 11:34:35 -0300 (BRT) Received: by ewy26 with SMTP id 26so3910633ewy.5 for ; Tue, 15 Sep 2009 07:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Il7wszXECpRy6TjWqDuful73QQu4Yg4CIqvBEUiEKys=; b=Idu2bIof4MwcELJaHYZBtLqYJJEL3NJ2+vBSA53l1qAHWID6XIokD8A+2MgoCOUc2F ED+RzQXFO/eW6jbhgtGnP4+Ua4kJCmD2tLli7Hk4U1bvxx0YO4WuPvUm0VEpciDe12SS L1jZ/YwjUKIUrtmEzLOWj3earcmuRulJKcD8Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=xd4c41d6cGwjHEEeeHrTPOMOxE+1RlcAvF/M6U5kdP1EkpcHSSr9ndcFd1Wo7RMVz4 v0M/The1+9iX5iuweerEYmVnR75uEIMYPuz6dT9E82xhjZKZdy1Z4p1UQZr0fzJHNqLI /g5slcSEKjL5umpkP+AjTEixFVnI9fpBB27vU= MIME-Version: 1.0 Received: by 10.216.87.69 with SMTP id x47mr1994034wee.97.1253025278156; Tue, 15 Sep 2009 07:34:38 -0700 (PDT) In-Reply-To: References: <89d273ba0909100200w7f27f5d9j60c83acc5884512b@mail.gmail.com> From: Jerome Vuarand Date: Tue, 15 Sep 2009 16:34:18 +0200 Message-ID: <89d273ba0909150734u5cb9ccb8xc26de5e508377214@mail.gmail.com> Subject: Re: Announce: Darwin module system To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/14 Andrea D'Amore : > On 10/set/09, at 11:00, Jerome Vuarand wrote: >> People (not you, obviously) often don't understand the Lua module >> system very well. > > I don't, for instance. But I'd like to understand it more. > >> Not that long ago we had yet another verbose discussion on this >> mailing list > > I'm gonna search in ml archive but can you point me to a further reference? > Is it the "Packages" chapter of PiL? The second edition has a chapter about it (and that chapter is available online at http://www.inf.puc-rio.br/~roberto/pil2/). Also the Lua Programming Gems book contains information about the package system. For example the last gem (I wrote it) is about searchers and how to add new ones. All the information is in the manual in a condensed form, feel free to ask questions on this mailing list. From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 12:27:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FFRdjh016929; Tue, 15 Sep 2009 12:27:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CA1C192A7; Tue, 15 Sep 2009 12:27:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth23.prod.mesa1.secureserver.net (smtpauth23.prod.mesa1.secureserver.net [64.202.165.47]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6FCB1190F9 for ; Tue, 15 Sep 2009 12:27:02 -0300 (BRT) Received: (qmail 3210 invoked from network); 15 Sep 2009 15:27:03 -0000 Received: from unknown (98.117.140.83) by smtpauth23.prod.mesa1.secureserver.net (64.202.165.47) with ESMTP; 15 Sep 2009 15:27:03 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: first class ':' From: Mark Hamburg In-Reply-To: <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> Date: Tue, 15 Sep 2009 08:27:01 -0700 Content-Transfer-Encoding: 7bit Message-Id: <4C97C91E-B4E8-4C93-8087-B23FEF9B2BE7@grubmah.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Here's a subtlety regard method currying: Does obj:method == obj:method -- i.e., do the results of currying get cached? I'm inclined to say no because it would considerably complicate the implementation, but then I wonder about how to enable it for cases where it's needed. Here is a use case for caching: observed:addObserver( observer:callback ) ... later ... observed:removeObserver( observer:callback ) Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 12:42:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FFgTla020517; Tue, 15 Sep 2009 12:42:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A7FB192E3; Tue, 15 Sep 2009 12:41:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-39.bluehost.com (outbound-mail-39.bluehost.com [69.89.20.193]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7ABAE18D60 for ; Tue, 15 Sep 2009 12:41:53 -0300 (BRT) Received: (qmail 23896 invoked by uid 0); 15 Sep 2009 15:41:55 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy2.bluehost.com with SMTP; 15 Sep 2009 15:41:55 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=XnSvqAcqyrtkU8xMCyydv/89tsQMs886i8ZQ80GNj5kxEKIWHrvKFZp3P9EfXtE/d9zFnXPiaRKGZlgY0NcjFrGuOaGSxjbGKCHasEFlrN8/jbbFT53k+ZkUwGdXQq/w; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MnaAE-0005P1-Q5; Tue, 15 Sep 2009 09:41:55 -0600 Date: Tue, 15 Sep 2009 10:41:43 -0500 From: Rob Hoelz To: Lua list Subject: Re: first class ':' Message-ID: <20090915104143.024b5b02@hoelzro.net> In-Reply-To: <4C97C91E-B4E8-4C93-8087-B23FEF9B2BE7@grubmah.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> <4C97C91E-B4E8-4C93-8087-B23FEF9B2BE7@grubmah.com> Organization: N/A X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.5; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/YqquCuQEUCHvtMO5JZ8H38x"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/YqquCuQEUCHvtMO5JZ8H38x Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 15 Sep 2009 08:27:01 -0700 Mark Hamburg wrote: > Here's a subtlety regard method currying: Does obj:method =3D=3D =20 > obj:method -- i.e., do the results of currying get cached? I'm =20 > inclined to say no because it would considerably complicate the =20 > implementation, but then I wonder about how to enable it for cases =20 > where it's needed. Here is a use case for caching: >=20 > observed:addObserver( observer:callback ) > ... later ... > observed:removeObserver( observer:callback ) >=20 > Mark >=20 Along that same line: setfenv(object:method, {foo =3D 'bar'}) -Rob --Sig_/YqquCuQEUCHvtMO5JZ8H38x Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkqvtbsACgkQUoGaR6SGEapRwwCbBk1ayn1enSB/Kax5ZhXdnOge KLsAoMQrDcfczts1XUTOD7oCeQr4AVwV =7sD7 -----END PGP SIGNATURE----- --Sig_/YqquCuQEUCHvtMO5JZ8H38x-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 13:41:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FGfRi0001832; Tue, 15 Sep 2009 13:41:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E62B18F06; Tue, 15 Sep 2009 13:40:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth18.prod.mesa1.secureserver.net (smtpauth18.prod.mesa1.secureserver.net [64.202.165.31]) by bazar2.conectiva.com.br (Postfix) with SMTP id 15FA018D90 for ; Tue, 15 Sep 2009 13:40:44 -0300 (BRT) Received: (qmail 31417 invoked from network); 15 Sep 2009 16:40:44 -0000 Received: from unknown (98.117.140.83) by smtpauth18.prod.mesa1.secureserver.net (64.202.165.31) with ESMTP; 15 Sep 2009 16:40:44 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: first class ':' From: Mark Hamburg In-Reply-To: <20090915104143.024b5b02@hoelzro.net> Date: Tue, 15 Sep 2009 09:40:43 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> <4C97C91E-B4E8-4C93-8087-B23FEF9B2BE7@grubmah.com> <20090915104143.024b5b02@hoelzro.net> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 15, 2009, at 8:41 AM, Rob Hoelz wrote: > On Tue, 15 Sep 2009 08:27:01 -0700 > Mark Hamburg wrote: > >> Here's a subtlety regard method currying: Does obj:method == >> obj:method -- i.e., do the results of currying get cached? I'm >> inclined to say no because it would considerably complicate the >> implementation, but then I wonder about how to enable it for cases >> where it's needed. Here is a use case for caching: >> >> observed:addObserver( observer:callback ) >> ... later ... >> observed:removeObserver( observer:callback ) >> >> Mark >> > > Along that same line: > > setfenv(object:method, {foo = 'bar'}) Either these are special types and setfenv probably isn't allowed or it is allowed and doesn't matter since the closure that does the method invocation never looks at its globals. Still, an interesting point. It's all in the details. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 14:09:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FH9XY8008748; Tue, 15 Sep 2009 14:09:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88CD18E78; Tue, 15 Sep 2009 14:09:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f179.google.com (mail-px0-f179.google.com [209.85.216.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82D8118D1B for ; Tue, 15 Sep 2009 14:08:57 -0300 (BRT) Received: by pxi9 with SMTP id 9so3705678pxi.14 for ; Tue, 15 Sep 2009 10:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LM93evExaJk2Ub/AKuE1fspdv9NLdxFIrj6Q+wjGZ6A=; b=lZFUD6CECuovnN8Hy4O1lttfT2sWpGlphozTCa6WATdE24cTvYPAf5REwS9QfQQG0Q CX2ebz/oWmacn2sIDwMaZb19OwDqSuXXJbWlKEQ85f7+rf3NV85LEfcqJReXXOVy8h/E 8Kw5fdTmmxjiaCBNbAg2u05jIsPjm9C9LKyDg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QrjMb/Rb9E9mrxYdP7wKaRjjqxyU+Mhbxn8ZLqCGGldmyrdLC6vQfgLHf4ObvIaDaJ pKbYT7ePvkvO9rK/M67Ua3EQm2WnAc7gMRnOBfj5m4TYljpQ5LeEK7XP/43aqIN7CQ7D EIJ88KzDJoB8gZGhgJiPEj5gv1wpwJvCyh+bU= MIME-Version: 1.0 Received: by 10.142.9.31 with SMTP id 31mr596332wfi.96.1253034539940; Tue, 15 Sep 2009 10:08:59 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 Sep 2009 10:08:59 -0700 Message-ID: <17eac67c0909151008s33f4180bxde92c224b746a30f@mail.gmail.com> Subject: Re: improving the module function - package.clean From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 10:24 PM, David Manura wrote: > I'm surprised I haven't thought of this sooner (nor seen this posted > elsewhere). Here are two "module" function options that in a simple > way avoid the problem of a module's private namespace being polluted > to its public namespace. That modules go into a global package table doesn't bother me, maybe I'm just used to it... even languages like Java/C++/Ruby that support namespacing don't allow completely private namespaces, everything does have a one, true (possibly very long!) global name. There are lots of cool things that can be done with the module system, though in the spirit of Lua, you have to build it yourself. Me, I want my modules to see the names in their enclosing modules, so I do this: function package.seepackage(m) -- print("seepackage for", m) local mt = getmetatable(m) or {} local package = m._PACKAGE:sub(1, -2) -- strip trailing "." mt.__index = require(package) setmetatable(m, mt) return m end -- foo/something.lua module(..., package.seepackage) function do_something() some_support() end -- foo/support.lua module(..., package.seepackage) function some_support() end function _kindof_internal() end -- foo.lua module(..., package.seeall) require(_NAME..".support") -- import support.* to top-level package for k,v in pairs(support) do if type(k) == "string" and not k:match"^_" then _M[k] = v end end require(_NAME.."something") -- require"foo" foo.some_support() foo.something.do_something() Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 15:32:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FIWcMa000784; Tue, 15 Sep 2009 15:32:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8B2318B06; Tue, 15 Sep 2009 15:31:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f194.google.com (mail-yx0-f194.google.com [209.85.210.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 518FB18955 for ; Tue, 15 Sep 2009 15:31:48 -0300 (BRT) Received: by yxe32 with SMTP id 32so121405yxe.5 for ; Tue, 15 Sep 2009 11:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=FvLzRt4Wob15h1luUsLpouP+7/6KdlNSLfIXXh3UaP0=; b=S3Fg3fY0nRYtQV9u6iahgEQy+GUcslMerfphKUEpP1vQDTvTS9wWreA+UA9pBvSdkH tHDvRDWMfWqEV3rKc+hIKiKg42Mvym99tvEIz4XNvlgpAYFLbKLqlwJxZujT+2eiualx FIWBwsYP1oNmLUoOY7a8HLWt2rK9aXEaYSQt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=C7Il2cF/yDX1Fge/mQbIhU8vQp7YPagytKiaUmcN4SJVOO0Be0By5DT5c5CyjOE+/e eGFyRjZQfqmfi4fPsCMimNhqUDGnVZGRnXN9J7D7ZvOVxSRbE7DJTtfxwqP5dDEhUqoA N6b9MR/J0Z/4+VqzrDR5IimvXN/RTtCI5YZqo= MIME-Version: 1.0 Received: by 10.150.101.5 with SMTP id y5mr12991233ybb.85.1253039506109; Tue, 15 Sep 2009 11:31:46 -0700 (PDT) From: RJP Computing Date: Tue, 15 Sep 2009 14:31:26 -0400 X-Google-Sender-Auth: de376cd5bcb675fc Message-ID: Subject: [ANN] Lua for Windows v5.1.4-30 Released To: Lua list Content-Type: multipart/alternative; boundary=000e0cd68d20a6b5e20473a1fe09 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd68d20a6b5e20473a1fe09 Content-Type: text/plain; charset=ISO-8859-1 We are proud to announce the next release of Lua for Windows (LfW). Read the changelog for more information. Enjoy. Homepage: http://luaforwindows.luaforge.net/ Description: Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows. Lua for Windows combines Lua binaries, Lua libraries with a Lua-capable editor in a single install package for the Microsoft Windows operating system. Lua for Windows contains everything you need to write, run and debug Lua scripts on Windows. A wide variety of libraries and examples are included that are ready to use with Microsoft Windows. Lua for Windows runs on Windows 2000 and newer versions of Windows. Lua and its associated libraries are also available for other operating systems, so most scripts will be automatically cross-platform. Changelog: 5.1.4-30 [15/Sept/2009] 17th release + Added lbase64 module. + Added gzio module ^ Updated stdlib to Release 12. -- Regards, Ryan --000e0cd68d20a6b5e20473a1fe09 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We are proud to announce the next release of Lua for Windows (LfW). Read th= e changelog for more information. Enjoy.

Homepage:

Description:

Lua for Win= dows is a 'batteries included environment' for the Lua scripting la= nguage on Windows.

Lua for Windows combines Lua binaries, Lua librar= ies with a Lua-capable editor in a single install package for the Microsoft= Windows operating system. Lua for Windows contains everything you need to = write, run and debug Lua scripts on Windows. A wide variety of libraries an= d examples are included that are ready to use with Microsoft Windows. Lua f= or Windows runs on Windows 2000 and newer versions of Windows. Lua and its = associated libraries are also available for other operating systems, so mos= t scripts will be automatically cross-platform.

Changelog:

5.1.4-30 [15/= Sept/2009] 17th release
+ Added lbase64 module.
+ Added gzio module^ Updated stdlib to Release 12.
--
Regards,
Ryan
--000e0cd68d20a6b5e20473a1fe09-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 16:01:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FJ17C8009359; Tue, 15 Sep 2009 16:01:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DA5118CE6; Tue, 15 Sep 2009 16:00:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 195E318C6A for ; Tue, 15 Sep 2009 16:00:26 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MndGM-0002Ea-8X for lua@bazar2.conectiva.com.br; Tue, 15 Sep 2009 21:00:26 +0200 Received: from adsl77-195.kln.forthnet.gr ([77.49.124.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 21:00:26 +0200 Received: from petsagouris by adsl77-195.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Sep 2009 21:00:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: [ANN] Lua for Windows v5.1.4-30 Released Date: Tue, 15 Sep 2009 19:00:04 +0000 (UTC) Lines: 5 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 77.49.124.195 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Great release, gzip access finally ! :) Thanks for all your work! From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 16:05:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FJ5XLf010306; Tue, 15 Sep 2009 16:05:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40311192A7; Tue, 15 Sep 2009 16:04:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f198.google.com (mail-yw0-f198.google.com [209.85.211.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 078EB18C94 for ; Tue, 15 Sep 2009 16:04:50 -0300 (BRT) Received: by ywh36 with SMTP id 36so6597228ywh.21 for ; Tue, 15 Sep 2009 12:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=BphLexGxa+GwjuiCNZi6QOSk/BBz2YK4YLburg5w+OU=; b=m8Gqzp99Qy+OaPCyETttRnspZtblEpVLnbOsCJbTuqKsXXFZ8biBavvBKxNXkoGi4V ERWwn/jvND1oNjha0l63NuKGVUcw2X085nYZIMo1KQXjx71fsLU2JDzTeUnLVrClJ+tM tbsmnGs1gHvrlpMLTA0P+o4Tr4SeolGCzDW6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=hABwsgQ4Wdrpeq4QPDOSGOOc/luwEoZVYwq2hDF/OEDPivoJPbL5dP3noupPlY+hQF lvZpYgjSzeMoUlzvC5p7Irko2Kt2YQSHZNLthw86b1evbKq7XKwns5Bn7YAVSY7Ubwtk 5njSf9EFVcC/KVAsft/e4MIjrivop+c2/5RcI= MIME-Version: 1.0 Received: by 10.150.56.28 with SMTP id e28mr12915814yba.197.1253041490145; Tue, 15 Sep 2009 12:04:50 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Tue, 15 Sep 2009 15:04:30 -0400 X-Google-Sender-Auth: b9e17492e2633419 Message-ID: Subject: Re: [ANN] Lua for Windows v5.1.4-30 Released To: Lua list Content-Type: multipart/alternative; boundary=000e0cd70ca6e8b2430473a2740c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd70ca6e8b2430473a2740c Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 15, 2009 at 3:00 PM, George Petsagourakis wrote: > Great release, gzip access finally ! :) > > Thanks for all your work! > Thanks and sorry it took so long. -- Regards, Ryan --000e0cd70ca6e8b2430473a2740c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Sep 15, 2009 at 3:00 PM, George Petsagourakis <= ;petsagouris@gmail.com> wrote:
Great release, gzip access finally ! :)

Thanks for all your work!
=A0
Thanks and sor= ry it took so long.
--
Regards,
Ryan
--000e0cd70ca6e8b2430473a2740c-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 17:36:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FKa35e004845; Tue, 15 Sep 2009 17:36:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6472419320; Tue, 15 Sep 2009 17:35:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B356192BC for ; Tue, 15 Sep 2009 17:35:20 -0300 (BRT) Received: by bwz10 with SMTP id 10so3528269bwz.5 for ; Tue, 15 Sep 2009 13:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=d354inzvCwfwjX5iwM8nqhr/f42CluN5L4pm4I3sXSI=; b=TGIBIwu1eD+E5sGrsDbiEZKpzAJm1K0ppM2cysRQfgySeiUdoed7UJEf/647iqeWCW RB6Vz+RZj80+R3hNTRzhDmgX0+5XHL8Yk9uATP2Tq+tFTGcwbKqwhN9yptLdl2ZWDYlM eEXYa7ZBoqBJSP7mkXmzPAl22pT0oWyqbzNAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fCpG6gFkLQzTTH4TkCJyDWJWSn8eskSP3m3qXIJ0DTCWnvX5EHnNoeCGW1luS0eNCb SYlKtkkjsuZDYAvpl2WLd8fp2cYggGwV9fFjf+KNvW7ruRwjLe2gWCFhEWb7U0sj+spM WH5bxTWoNEFk1ob73aIXA3hRdTCFk2t+CvdCE= MIME-Version: 1.0 Received: by 10.223.1.10 with SMTP id 10mr2806760fad.94.1253046921650; Tue, 15 Sep 2009 13:35:21 -0700 (PDT) In-Reply-To: <4AABAB57.9030702@workspacewhiz.com> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> <20090912021404.GA30313@mike.de> <4AABAB57.9030702@workspacewhiz.com> Date: Wed, 16 Sep 2009 00:35:20 +0400 Message-ID: Subject: Re: how to load a very large table with more than 2^18 literal strings? From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 12, 2009 at 18:08, Joshua Jensen wrote: > I run into the table size problem often enough to be annoying. Just for the user voice statistics: Table size problem is annoying for me as well. It would be great to have it solved in future. Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Sep 15 17:40:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8FKe7Lp005788; Tue, 15 Sep 2009 17:40:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4305F184C6; Tue, 15 Sep 2009 17:39:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6DCC192BC for ; Tue, 15 Sep 2009 17:39:31 -0300 (BRT) Received: by bwz10 with SMTP id 10so3531029bwz.5 for ; Tue, 15 Sep 2009 13:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ObVcrzwzLLMHb27PWPyAb8MBz1y2Qs1nZWdR8RN08+w=; b=rL77qMEHXMzNX+NxNXICJJ9DgBSKcaI63Eaa3ZzKtd3Oyymoa8B4DR4YDgxNZA1lA0 +jjP3V18L8gC+w/ybF8C3iW5L8gB3/FoNSPiF2BVip3YQckyJHaOPyA4uEPN+pdFNPEk 206jAfiRxxgyukx6LyijO9eo0J27TF/555D6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QoSSH00pOgmQawwXJXBCokfqaiJe58u+xnrp/NbKp7J3ST6phwOa2Pe2VU37rLFMNX MU9p7wapTNSXhadE7YCyMJ/Nhloj96FQW1rqSkFCHsqcM5+IG4Nll6AWzhryTWb+9wGl t71zudb2A6S8al7AIm5jel31mH7VZLF5qaW/I= MIME-Version: 1.0 Received: by 10.223.4.209 with SMTP id 17mr2732932fas.85.1253047172677; Tue, 15 Sep 2009 13:39:32 -0700 (PDT) In-Reply-To: <20090911223841.D13015@lua.tecgraf.puc-rio.br> References: <20090805013655.D28245004DA0B@homedog.cs.tufts.edu> <20090806171851.GA15953@magritte.tecgraf.puc-rio.br> <20090911232310.EC5ECB130F@lakeland.eecs.harvard.edu> <20090911223841.D13015@lua.tecgraf.puc-rio.br> Date: Wed, 16 Sep 2009 00:39:30 +0400 Message-ID: Subject: Re: how to load a very large table with more than 2^18 literal strings? From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8FKe7Lp005788 On Sat, Sep 12, 2009 at 05:38, Luiz Henrique de Figueiredo wrote: <...> > So, in principle, you could > "merge" a table literal into an existing table very efficiently, if only we > could say it in the program. <...> > Other possibilities that do not require a new token are <...> >        t:{ ... } I'd be happy to see this syntax in future Lua versions. I see a good few places in my code, where such syntax would help. Alexander. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 03:05:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8G64wtB029888; Wed, 16 Sep 2009 03:04:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B9DA19330; Wed, 16 Sep 2009 03:04:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A6AC1929E for ; Wed, 16 Sep 2009 03:04:16 -0300 (BRT) Received: by iwn1 with SMTP id 1so1998573iwn.11 for ; Tue, 15 Sep 2009 23:04:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.40.227 with SMTP id l35mr17779938ibe.28.1253081058295; Tue, 15 Sep 2009 23:04:18 -0700 (PDT) In-Reply-To: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> Date: Wed, 16 Sep 2009 02:04:18 -0400 X-Google-Sender-Auth: 71fbd3e21eb4b81f Message-ID: Subject: Re: first class ':' From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 14, 2009 at 8:45 PM, David Manura wrote: > we would need to make [2] like [3] but not introduce a new stack level. > Currently, Lua lacks a documented way to express that type of currying > operation. Related to this, sometimes I'd like to be able to call a function without increasing the stack level. For example, let f be a function that internally deals with stack levels: function f() error("opps", 2) end -- or setfenv, debug.getinfo, etc. Now say I want to wrap f inside another function: -- a function decorator that adds trace statements. function trace(f) return function(...) print('starting', f) f(...) print('stopping', f) end end f = trace(f) This is not possible to do correctly because the wrapper increases the stack level. Maybe some special "call" function (in the form of pcall) could be implemented to call a given function within the current stack level. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 03:37:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8G6bMhS000570; Wed, 16 Sep 2009 03:37:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA95B18FD6; Wed, 16 Sep 2009 03:36:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out1.berkeley.edu (smtp-out1.Berkeley.EDU [128.32.61.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D23518A5B for ; Wed, 16 Sep 2009 03:36:46 -0300 (BRT) Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by fe2.calmail with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (auth plain:jgm@berkeley.edu) (envelope-from ) id 1Mno8D-0001jo-8g for lua@bazar2.conectiva.com.br; Tue, 15 Sep 2009 23:36:47 -0700 Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id 3A97F1316D9; Tue, 15 Sep 2009 23:36:09 -0700 (PDT) Date: Tue, 15 Sep 2009 23:36:09 -0700 From: John MacFarlane To: Lua list Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library Message-ID: <20090916063609.GA6960@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> <20090913071008.GA15326@protagoras.phil.berkeley.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8G6bMhS000570 +++ Yuri Takhteyev [Sep 14 09 11:12 ]: > > I'll look into releasing on luaforge.  The project needs some polishing > > first, e.g. better error handling and documentation. > > It can always be made better, but please don't let this stop you from > making a release. Okay, I've tagged 0.1 and made a rock available on github: you should now be able to install the library using luarocks --from=http://github.com/jgm/rocks/raw/master install lunamark > > No, currently you'd have to modify the module code. In the definition > > of 'parser' in markdown_parser.lua, you'd add a clause for your new > > pattern: something like > > > > MyPattern = p"[[" * lpeg.Ct((_"Inline" - p"]]")^0) * p"]]" / writer.mypattern > > If this is the only thing that needs to be done, shouldn't it be easy > to expose the table that is used to create the parser, to allow adding > a pattern by simply setting a field? Perhaps something like: > > require("lunamark") > require("lpeg") > local wikilink_handler = function(s) return {"", s, ""} end > my_parser = lunamark.parsers.markdown() -- or something similar > my_parser.WikiLink = lpeg.P"[[" * lpeg.Ct((_"Inline" - > lpeg.P"]]")^0) * lpeg.P"]]" / wikilink_handler > local converter = lunamark.converter(my_parser, "html") Good thought. I've done something similar. You can now pass in a modify_syntax function as an option. This is a function from a table to a table, so you can perform arbitrary transformations on the input format grammar. A simple example: function capify(t) t.Str = t.Str / string.upper return t end markdown2htmlCAPS = lunamark.converter("markdown", "html", { modify_syntax = capify }) This gives you a markdown variant in which all strings are capitalized. Adding a handler for, say, wikilinks would be slightly more complicated. You'd have to do two things to the grammar table: (1) insert an entry for WikiLink (2) register WikiLink as an Inline element by modifying Inline So, something like this: function add_wikilink(t) t.WikiLink = --[[ whatever... ]] / write_wikilink t.Inline = lpeg.V("WikiLink") + t.Inline return t end function write_wikilink(s) -- code to write the wikilink as HTML end I hope this is flexible enough. John From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 07:59:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GAxDNi029711; Wed, 16 Sep 2009 07:59:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A36AB18FAA; Wed, 16 Sep 2009 07:58:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF97B18858 for ; Wed, 16 Sep 2009 07:58:33 -0300 (BRT) Received: by bwz10 with SMTP id 10so3883032bwz.5 for ; Wed, 16 Sep 2009 03:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Lm1I95IJMMrNs0djD+4bpEFX3gsvGWBrJjGrx9czbas=; b=PpLNRT2r5deqgZtP/M5ncmb86bnR27u9JHQ96KuS8scuQDyj7/W1thF3BsmaDSDl/r HyIMFRouXKCiq+zk5vqfgn82QvyawiYJ1x3tMC9pe4RgeWH81WARR6WSR5kTgpTPO2XD RK0NwYGUhdCDmoqVjE7Lc7LF5iqCUnXYwhGPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=oadQsE7Yf4ERD/y+/f3oFB/1kvW1LQ373gtzhvnVWzwslmGKFaulutBDoUBELirRgy CnrMw8gCYhTqfvn6qgs8VgHrFUdBirYt3a+SLsCv5h0cFLxpMnyzSnp6Mgfpd663Jx1T He1xtwS4zFZieNrD6Sc2S54NATWFG5F7knIc0= MIME-Version: 1.0 Received: by 10.223.15.86 with SMTP id j22mr2985552faa.47.1253098714689; Wed, 16 Sep 2009 03:58:34 -0700 (PDT) Date: Wed, 16 Sep 2009 06:58:34 -0400 X-Google-Sender-Auth: 4e5c465bec9e9596 Message-ID: Subject: Re: Announce: Darwin module system From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8GAxDNi029711 On Mon, 14 Sep 2009 21:44:02 -0400, David Manura wrote: >  environment=[[ require("lanes"); return lanes ]] If anyone (other than I) starts using Darwin, the pattern above will probably be a common one because it not only allows the re-use of an existing Lua module, contained in a file of code, but the structure definition uses 'require' to find that file. 'require' is (a re-implementation of) the standard Lua 'require' function, so if ' require("lanes") ' works in your code today, then it will work when used as in the example above. > Why isn't the native Lua search path sufficient? It is sufficient, but I was going for 'distinct', in order to accommodate the scenario in which the Darwin structure writer is setting up a user environment for a population of users. Let me explain. My own plans for using Lua are to embed it (no surprise) and to allow users to write their own scripts (again, no surprise). But how much power should I give my users? On the "low power" end of the spectrum, I could prevent them from doing io and from interacting with the os. At the other end of the spectrum, "full power" would give the user the power to write Lua scripts that did anything, including loading modules from arbitrary places in the file system (and running os.execute("luarocks ...") -- a scary thought!). In my project, I need to set up the environment in which user scripts run. I can precisely define the user environment using Darwin (in darwin/initialstructures.lua). I plan to allow my users to load modules. When I create the user environment, I may want my own search path for loading files that is distinct from the Lua package.path. That gives me the opportunity to write structure declarations that load code from anywhere in the file system, according to how I've set the Darwin path. (The Darwin path applies only to files listed in the 'files' clause.) I'll load "special" code from a non-standard place to avoid polluting the namespace of modules that can be loaded from the standard places on the Lua path. "Special" code could be, e.g. code that wraps the io package to restrict the kinds of io that users can do. But in reality, it just lets me separate the code that I wrote to "set up the system" from the code that user scripts will load using 'require' (really: package.loaders). My thoughts on this part of the design are still evolving. I considered giving Darwin a mirror of Lua's package table (which has a wonderfully flexible design) in order to provide the full power of loaders, preload, etc. In the end, I opted for 'keep it simple' instead, and just implemented a search path, mainly because my desire was only to have my "set up the system" code live in a directory that is not on the Lua search path. Jim From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 08:08:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GB8Rur031038; Wed, 16 Sep 2009 08:08:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADA9D18C43; Wed, 16 Sep 2009 08:08:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9159318A02 for ; Wed, 16 Sep 2009 08:07:58 -0300 (BRT) Received: by fxm18 with SMTP id 18so3935654fxm.5 for ; Wed, 16 Sep 2009 04:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=uYMrAcaN0ivcenYxpyB8tYbJUP0nN3kFuIgATidYDjI=; b=XBFiTr4gzGzTrqaz+ks110Gk1ygzfbFjoI3AstbGdRgBplR+QU3yWD7u1HTAagNr7B r9YtmhzoxlIpuq7fYX0pRhzU3Pd8zo///RIkOprBW4qv4tND2cMbw3HjW630wCmBQ9kt WUVSwYS2NI8YpZjiQ0b5ZdufdBsXGItvVYrdE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=Ezku5f6kNf+aIaiv1PaThL60Gr7FJllLtD5neSlkGWkC9RkMb0KrPop5DrbIdIkx5O rL96amxKIzBUAvTYY4ayaGuLh241ac+ahjJoJ9nV9HsR0PTuS5scYwI4ZjQwNfxfyRbz fSdG/D09zDHxcP48cWoQsRoeEQUWfwhmwdM/Y= MIME-Version: 1.0 Received: by 10.223.4.23 with SMTP id 23mr2934240fap.91.1253099279704; Wed, 16 Sep 2009 04:07:59 -0700 (PDT) Date: Wed, 16 Sep 2009 07:07:59 -0400 X-Google-Sender-Auth: 843493fca7ead7cd Message-ID: Subject: Re: improving the module function - package.clean From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 15 Sep 2009 12:57:41 +0100, Matthew Wild wrote: > module() is fairly easy to override in Lua, however > luaL_register() in the C API is not. > > I think the solution is to shift the responsibility of setting > _G[modulename] to require(), rather than the modules. Then we are free > to re-implement require(), or add import(), or anything I agree. I wrote the Darwin module system (http://lua-users.org/wiki/JimJennings) in part to achieve the same effect -- I want to load a module into a sandbox. I would love to see Lua 5.2 adopt your suggestion of having 'require' place the loaded module table into the right place. Jim From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 08:26:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GBQrDj001150; Wed, 16 Sep 2009 08:26:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83AE318F06; Wed, 16 Sep 2009 08:26:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8891618D78 for ; Wed, 16 Sep 2009 08:26:22 -0300 (BRT) Received: by fxm18 with SMTP id 18so3947082fxm.5 for ; Wed, 16 Sep 2009 04:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=l1tvCqBA+eoe85u3pM6FSXr730HMBZkHRmnOeI3Lz/4=; b=jEkjn96bm7YBACvctu4/8uv9rWvm1u2haE+qgZr/l1te5s0PWWVU/JoIvOjJI+OOmE a8QFEu5vGLOxkb2ABpwV5rWiFu2Tnyefv4FgQDN5RPtpER+uaQXrXpPUPx8XuXqU1YlA u9K5ZxG5Mw06j8bfBFY1h/eUpce02anqdyZH4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=wo8rnjoc+5VFUSAiA6cI9iAUDT41JP0brKCxsBA3QQb0de/xHOR7+oigFGKhc3C5XZ 641lU2bBEizwPlH/shN8NAjh1TlY6sTaBA4P+ZPGeScuEZGbj72D4Id4yuPabx8nAc4h NZPNsyiFST2dxz9bL9fnUAcs0VDTWteDpy4xQ= MIME-Version: 1.0 Received: by 10.223.58.139 with SMTP id g11mr3078891fah.43.1253100383821; Wed, 16 Sep 2009 04:26:23 -0700 (PDT) Date: Wed, 16 Sep 2009 07:26:23 -0400 X-Google-Sender-Auth: 81b4effd5029c6be Message-ID: Subject: Re: First class : (was Re: Regarding the name 'pairs') From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm also confused about the need for pairs/ipairs metamethods. Has anyone considered going in the other direction (design-wise), which is to: (1) acknowledge that pairs/ipairs pertain only to tables (several people have done this already); and (2) as a result of this observation, move pairs/ipairs into the table library. The generic 'for' loop in Lua is so elegant that I would encourage its use by highlighting the fact that pairs/ipairs are just two iterators for tables. Tables can have other iterators over keys and values, and other objects can have their own iterators over whatever is appropriate. The iterator expression in the 'for' loop should return a stateful iterator function. If you are using an OO style, you will probably call a method to create and return a stateful iterator. (Note that the parentheses are required and good. It should be clear that a method is being called.) Anyone can add a function ("each" and "values" have been proposed) that accepts an object and calls the object's __iter metamethod by convention. The name "values" and the name "__iter" do not have to be fixed in the Lua language. Neither do "pairs"/"ipairs" (which could belong to the table library) or "__pairs"/"__ipairs" (which I think are not needed). Jim From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 08:44:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GBiWk3003978; Wed, 16 Sep 2009 08:44:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE8D0192A7; Wed, 16 Sep 2009 08:44:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85B0318C2F for ; Wed, 16 Sep 2009 08:43:58 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GBi0Yb003904 for ; Wed, 16 Sep 2009 08:44:01 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8GBhvV07278; Wed, 16 Sep 2009 08:43:57 -0300 Date: Wed, 16 Sep 2009 08:43:56 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: First class : (was Re: Regarding the name 'pairs') Message-ID: <20090916084356.A7265@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from jennings.durham.nc+lua@gmail.com on Wed, Sep 16, 2009 at 07:26:23AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm also confused about the need for pairs/ipairs metamethods. There is no *need* for pairs/ipairs metamethods just as there is no need for pairs/ipairs functions. (But there is a need for next and # so that pairs/ipairs can be implemented.) > (1) acknowledge that pairs/ipairs pertain only to tables (several > people have done this already); and But tables are used to implement objects and those may want different behaviors. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 10:15:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GDFHpS025870; Wed, 16 Sep 2009 10:15:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E36B19352; Wed, 16 Sep 2009 10:14:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37ADF18FAA for ; Wed, 16 Sep 2009 10:14:33 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:56716) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1MnuL5-0000zZ-5m (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Wed, 16 Sep 2009 14:14:27 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MnuL5-0005Hy-P8 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Wed, 16 Sep 2009 14:14:27 +0100 Date: Wed, 16 Sep 2009 14:14:27 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: first class ':' In-Reply-To: Message-ID: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 16 Sep 2009, David Manura wrote: > > This is not possible to do correctly because the wrapper increases the > stack level. Maybe some special "call" function (in the form of > pcall) could be implemented to call a given function within the > current stack level. That isn't possible. You have to increase the stack level to save the nested return addresses. If the wrapper can do everything it needs before calling the wrapped function, then you can do a tail call so you don't need to save an extra return address and the stack level can remain the same. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 10:19:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GDJ7ri026664; Wed, 16 Sep 2009 10:19:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81B0319359; Wed, 16 Sep 2009 10:18:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 934581935D for ; Wed, 16 Sep 2009 10:18:26 -0300 (BRT) Received: by ewy26 with SMTP id 26so4810463ewy.5 for ; Wed, 16 Sep 2009 06:18:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.52.145 with SMTP id e17mr2020813wec.151.1253107107866; Wed, 16 Sep 2009 06:18:27 -0700 (PDT) In-Reply-To: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> Date: Wed, 16 Sep 2009 14:18:27 +0100 X-Google-Sender-Auth: 7814763e28e7a972 Message-ID: Subject: Re: first class ':' From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You do need to increase the stack level, but I think that David meant some method to make the extra stack level(s) invisible to the debug API. On Wed, Sep 16, 2009 at 2:14 PM, Tony Finch wrote: > That isn't possible. You have to increase the stack level to save the > nested return addresses. If the wrapper can do everything it needs before > calling the wrapped function, then you can do a tail call so you don't > need to save an extra return address and the stack level can remain the > same. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 10:22:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GDMnUs027502; Wed, 16 Sep 2009 10:22:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 558B01A519; Wed, 16 Sep 2009 10:22:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AA8418644 for ; Wed, 16 Sep 2009 10:22:14 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GDMGGW027413 for ; Wed, 16 Sep 2009 10:22:16 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 855A11F1160; Wed, 16 Sep 2009 10:22:16 -0300 (BRT) Date: Wed, 16 Sep 2009 10:22:16 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: first class ':' Message-ID: <20090916132216.GA28442@magritte.tecgraf.puc-rio.br> References: <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > You do need to increase the stack level, but I think that David meant > some method to make the extra stack level(s) invisible to the debug > API. This can be done in the traceback function itself, can't it? I mean, just scan backward and skip your "hidden" functions. Of course, you'll need a way to mark those: add them to a table or name them with a predefined prefix. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 11:15:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GEF7bE007659; Wed, 16 Sep 2009 11:15:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01BE518D78; Wed, 16 Sep 2009 11:14:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2005B18C6A for ; Wed, 16 Sep 2009 11:14:24 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MnvH4-0003Ru-32 for lua@bazar2.conectiva.com.br; Wed, 16 Sep 2009 14:14:22 +0000 From: "John Hind" To: "'Lua list'" References: In-Reply-To: Subject: RE: First class : (was Re: Regarding the name 'pairs') Date: Wed, 16 Sep 2009 15:13:19 +0100 Message-ID: <003301ca36d7$d7b48140$871d83c0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 thread-index: Aco2wJ0N96+/wR7XSWm03AMUdspVuAAFECZw Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a "knarly" area of Lua. Strictly speaking only 'next' and 'pairs' apply to tables. 'ipairs' and the entire contents of the 'table' library apply to a specialised form of 'table' which would be better called 'array' or 'list'. Because Lua does is not object oriented (but provides the tools for users to make it object oriented) this specialisation is done informally by just having rules about how the table indexes are handled. In my view, while the generic for is very flexible, it does not read well: for v in something do ... end Just from the ordinary meaning of the keywords (let alone expectations from other languages with similar constructs) most beginners would expect 'something' to be the table itself, not a function call which returns a function, a table and nil! Your own use of language (and my own long-standing misunderstanding of the exact operation of the '__call' trick) illustrates the counter-intuitive nature of this very subtle system: 'pairs' and 'ipairs' are not iterators, 'next' is the iterator. 'pairs' and 'ipairs' are 'iterator factories'. You can write '__call' as an iterator factory (in which case it has to be called with empty parenthesis) or you can make it an iterator (in which case the parenthesis must be omitted)! > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Jim Jennings > Sent: 16 September 2009 12:26 > To: lua@bazar2.conectiva.com.br > Subject: Re: First class : (was Re: Regarding the name 'pairs') > > I'm also confused about the need for pairs/ipairs metamethods. Has > anyone considered going in the other direction (design-wise), which is > to: > > (1) acknowledge that pairs/ipairs pertain only to tables (several > people have done this already); and > (2) as a result of this observation, move pairs/ipairs into the table > library. > > The generic 'for' loop in Lua is so elegant that I would encourage its > use by highlighting the fact that pairs/ipairs are just two iterators > for tables. Tables can have other iterators over keys and values, and > other objects can have their own iterators over whatever is > appropriate. > > The iterator expression in the 'for' loop should return a stateful > iterator function. If you are using an OO style, you will probably > call a method to create and return a stateful iterator. (Note that > the parentheses are required and good. It should be clear that a > method is being called.) > > Anyone can add a function ("each" and "values" have been proposed) > that accepts an object and calls the object's __iter metamethod by > convention. The name "values" and the name "__iter" do not have to be > fixed in the Lua language. Neither do "pairs"/"ipairs" (which could > belong to the table library) or "__pairs"/"__ipairs" (which I think > are not needed). > > Jim From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 12:21:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GFLI50023831; Wed, 16 Sep 2009 12:21:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 439A6189AD; Wed, 16 Sep 2009 12:20:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f195.google.com (mail-px0-f195.google.com [209.85.216.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8027B1897E for ; Wed, 16 Sep 2009 12:20:27 -0300 (BRT) Received: by pxi33 with SMTP id 33so4233772pxi.11 for ; Wed, 16 Sep 2009 08:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=ufSZyrfPh/5GzHcG4/Z54n4KO1SCLoWpvH028LgGTXs=; b=LvFywjzKA3suirA5TexbbjKtVo7gfh8MbY6Kpx0VwqcVjspa1G5qsSc0tX9R5Yrd4B wAA01D48DuuxoYzl9Aw3tijTSgSaGgiS/pwzqPrnmGeiTUthJi7sWMDB0mFddJ6l9J0Q VLUSx0teP0vDlG7s8PA4K1kfB72eDF7FXuUYw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=WvmglYHJHeVfOV2NxVpsZpq/GoyiJVmz156PXh2YI76p8tBvEV+3DQfeaGPQGI3vBs ZocgKLST7JNq9MIxU0EkxM88CoDMOr6opnoqU8nYvpcFQujGh/5cPQK7TmaPIFao33Fc 8EHYZX7b8v4tjaIsRYo3Vfzg3BnJMP+nxm6hA= MIME-Version: 1.0 Received: by 10.142.151.14 with SMTP id y14mr581307wfd.125.1253114430171; Wed, 16 Sep 2009 08:20:30 -0700 (PDT) In-Reply-To: References: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> From: Anurag Sharma Date: Wed, 16 Sep 2009 20:50:10 +0530 Message-ID: Subject: Re: How to run a Lua script file To: Lua list Content-Type: multipart/alternative; boundary=000e0cd312c67929030473b370bb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd312c67929030473b370bb Content-Type: text/plain; charset=ISO-8859-1 Did not get response, so clarifying the question by rephrasing How to execute a lua script from Start->Run-> in windows The lua script uses Lua extensions written by me. And it executes fine using dofile in Lua console which I open using following command cmd /K lua.exe -lmyapp_Lua Thanks Anurag On Tue, Sep 15, 2009 at 7:13 PM, Anurag Sharma wrote: > I tried when I try the following, I get error message > > lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... > > error message is as follows > > lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global > 'myapp_Lua' > (a nil value) > stack traceback: > C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main chunk > [C]: ? > [C]: ? > > > > Some background information, > I have alerady set the following enviroment variables, > Path, Lua_dev, Lua_path, Lua_CPath > Also the same script works when I run it from Lua console by using a dofile > command. In that case I launch Lua console using cmd /K lua -lmyapp_Lua.. > > > Thanks > Anurag > On Tue, Sep 15, 2009 at 7:01 PM, steve donovan < > steve.j.donovan@gmail.com> wrote: > >> On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma >> wrote: >> > lua.exe: module 'myapp_Lua' not found: >> > no field package.preload['myapp_Lua'] >> > no file '.\myapp_Lua.lua' >> > no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua' >> .. >> >> This error message is instructive; Lua is just telling you that your >> myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua >> in one of the these standard places? If not, either move it there, or >> read up about the LUA_PATH environment variable. >> >> Another approach is something like: >> >> lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... >> >> This works because Lua uses the value of package.path to match modules. >> >> steve d. >> > > --000e0cd312c67929030473b370bb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Did not get response, so clarifying the question by rephrasing
=A0
How to execute a lua script from Start->Run->=A0=A0=A0 in window= s
=A0
=A0
The lua script uses Lua extensions written by me. And it executes fine= using dofile in Lua console which I open using following command
cmd /K lua.exe -lmyapp_Lua
=A0
Thanks
Anurag

On Tue, Sep 15, 2009 at 7:13 PM, Anurag Sharma <= span dir=3D"ltr"><anurag.= sharma.101@gmail.com> wrote:
I tried=A0=20
when I try the following, I get error message

lua -e "package.path=3D'\\mypath\?.lua;'..package.path&qu= ot; -lmyapp_Lua ...

error message is as follows

lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global= 'myapp_Lua'
(a nil value)
stack traceback:
=A0=A0 =A0 =A0 =A0C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main ch= unk
=A0=A0 =A0 =A0 =A0[C]: ?
=A0=A0 =A0 =A0 =A0[C]: ?



Some background information,
I have alerady set the following enviroment variables,
Path, Lua_dev, Lua_path, Lua_CPath
Also the same script works when I run it from Lua console by using a d= ofile command. In that case I launch Lua console using =A0cmd /K lua -lmyap= p_Lua..


Thanks
Anurag
On Tue, Sep 15, 2009 at 7:01 PM, steve donovan <= span dir=3D"ltr"><steve.j.donovan@gmail.com> wrote:
On Tue, Sep 15, 2009 at 3:24 PM, Anurag Sharma
<anurag.sharma.101@gmail.co= m> wrote:
> lua.exe: module 'myapp_Lua' not found:
> =A0=A0 =A0 =A0 =A0no field package.preload['myapp_Lua']
>= ; =A0=A0 =A0 =A0 =A0no file '.\myapp_Lua.lua'
> =A0=A0 =A0 = =A0 =A0no file 'C:\Program Files\Lua\5.1\lua\myapp_Lua.lua'
..

This error message is instructive; Lua is just telling you that= your
myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua
i= n one of the these standard places? =A0If not, either move it there, or
= read up about the LUA_PATH environment variable.

Another approach is= something like:

lua -e "package.path=3D'\\mypath\?.lua;'..package.path&quo= t; -lmyapp_Lua ...

This works because Lua uses the value of package.= path to match modules.

steve d.


--000e0cd312c67929030473b370bb-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 12:55:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GFtEeL031071; Wed, 16 Sep 2009 12:55:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40D57191C8; Wed, 16 Sep 2009 12:54:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [76.96.30.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8532E18BF7 for ; Wed, 16 Sep 2009 12:54:31 -0300 (BRT) Received: from OMTA01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by QMTA01.emeryville.ca.mail.comcast.net with comcast id hRFD1c0040EPchoA1Tu3ql; Wed, 16 Sep 2009 15:54:03 +0000 Received: from [130.157.100.72] ([130.157.100.72]) by OMTA01.emeryville.ca.mail.comcast.net with comcast id hTuS1c0011Zivxu8MTuUdC; Wed, 16 Sep 2009 15:54:32 +0000 Subject: integration with C. Segfault whenever I do anything outside of my lua_state initializer function. From: Max To: lua@bazar2.conectiva.com.br Content-Type: text/plain Date: Wed, 16 Sep 2009 07:55:10 -0700 Message-Id: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi everyone! I originally posted this to the forum but I was told I'd be more likely to get help here, so here I am. I'm trying to modify an existing game engine by adding Lua support. This is the first real Lua project I've ever done and I'm not exactly a C expert either, but I'm pretty sure I've gone by the book here. I started having problems with the Lua integration as soon as I moved everything to its own file, so I took that file somewhere else and wrote some simple code to test that file. Here is the file, lua.c, which I was trying to add to the game engine (with game-engine specific components commented out and replaced with OS shell calls.) http://pastebin.com/m1c949623 Here is the file which I wrote in order to test lua.c: http://pastebin.com/m1068b850 Here is the lua script I'm using: http://pastebin.com/mbdce379 Here is the command-line output of me compiling the program, running it, and a gdb session as well. http://pastebin.com/m50429f96 Essentially, I've got two major functions in lua.c. I have lua_initVM which sets up the lua_State instance, loads the script into it, and calls the "init" function from the script. That's working fine. Then I have the lua_frameVM function which is simply supposed to call the "frame" function from the script. However, ANY operation on my lua_State instance which occurs outside the lua_initVM function is causing a segfault. Even though the lua_State instance is declared as a global. What am I doing wrong here? Thanks! -Max. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:02:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GG2R8m032596; Wed, 16 Sep 2009 13:02:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E3301936F; Wed, 16 Sep 2009 13:01:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30D401936A for ; Wed, 16 Sep 2009 13:01:51 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GG1rvE032489 for ; Wed, 16 Sep 2009 13:01:53 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8GG1rl08224; Wed, 16 Sep 2009 13:01:53 -0300 Date: Wed, 16 Sep 2009 13:01:52 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: integration with C. Segfault whenever I do anything outside of my lua_state initializer function. Message-ID: <20090916130152.A8216@lua.tecgraf.puc-rio.br> References: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian>; from maxxedout@comcast.net on Wed, Sep 16, 2009 at 07:55:10AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > What am I doing wrong here? luaVM is left undefined (ie it remains NULL). From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:08:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GG87Oc001497; Wed, 16 Sep 2009 13:08:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B43E18F75; Wed, 16 Sep 2009 13:07:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F2D518CA1 for ; Wed, 16 Sep 2009 13:07:33 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mnx2d-0000Cf-P9 for lua@bazar2.conectiva.com.br; Wed, 16 Sep 2009 18:07:35 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 18:07:35 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 18:07:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: How to run a Lua script file Date: Wed, 16 Sep 2009 18:07:21 +0200 Lines: 25 Message-ID: References: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 15/09/2009 15:43, Anurag Sharma wrote: > I tried > when I try the following, I get error message > > lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... The "mypath" needed to be replaced by to your real path. > On Tue, Sep 15, 2009 at 7:01 PM, steve donovan > > wrote: > This error message is instructive; Lua is just telling you that your > myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua > in one of the these standard places? If not, either move it there, or > read up about the LUA_PATH environment variable. To re-iterate Steve's question, where is your myapp_Lua.lua (or .dll) file? Is it in one of the listed places? Perhaps you need to specify a "current directory" to your process object. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:10:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGAfs8002335; Wed, 16 Sep 2009 13:10:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D3AA19381; Wed, 16 Sep 2009 13:10:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [76.96.27.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 027D519379 for ; Wed, 16 Sep 2009 13:10:10 -0300 (BRT) Received: from OMTA13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by QMTA12.emeryville.ca.mail.comcast.net with comcast id hSAa1c00517UAYkACUAFLt; Wed, 16 Sep 2009 16:10:15 +0000 Received: from [130.157.100.72] ([130.157.100.72]) by OMTA13.emeryville.ca.mail.comcast.net with comcast id hUA61c0021Zivxu8ZUA8cX; Wed, 16 Sep 2009 16:10:12 +0000 Subject: Re: integration with C. Segfault whenever I do anything outside of my lua_state initializer function. From: Max To: Lua list In-Reply-To: <20090916130152.A8216@lua.tecgraf.puc-rio.br> References: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian> <20090916130152.A8216@lua.tecgraf.puc-rio.br> Content-Type: text/plain Date: Wed, 16 Sep 2009 08:10:55 -0700 Message-Id: <1253113855.16025.9.camel@MaxToTheMax-Lappy-Debian> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 2009-09-16 at 13:01 -0300, Luiz Henrique de Figueiredo wrote: > > What am I doing wrong here? > > luaVM is left undefined (ie it remains NULL). Hi LHF! Thanks for being one of the people to reply to my forum post! And thanks for replying here. Actually if you check that forum post you'll see I changed all the names of the parameters and local variables to luaVM_local, and it didn't fix anything. That version of the code (different pastebin) is what I sent out to the mailing-list. Since I'm passing everything by reference the changes ought to be applied globally, right? From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:19:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGJ0Ut004040; Wed, 16 Sep 2009 13:19:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA3F519391; Wed, 16 Sep 2009 13:18:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A71881938A for ; Wed, 16 Sep 2009 13:18:26 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGITWT003963 for ; Wed, 16 Sep 2009 13:18:29 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8GGISP08333; Wed, 16 Sep 2009 13:18:28 -0300 Date: Wed, 16 Sep 2009 13:18:28 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: integration with C. Segfault whenever I do anything outside of my lua_state initializer function. Message-ID: <20090916131828.A8328@lua.tecgraf.puc-rio.br> References: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian> <20090916130152.A8216@lua.tecgraf.puc-rio.br> <1253113855.16025.9.camel@MaxToTheMax-Lappy-Debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1253113855.16025.9.camel@MaxToTheMax-Lappy-Debian>; from maxxedout@comcast.net on Wed, Sep 16, 2009 at 08:10:55AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Actually if you check that forum post you'll see I changed all the names > of the parameters and local variables to luaVM_local, and it didn't fix > anything. That version of the code (different pastebin) is what I sent > out to the mailing-list. Check my second reply there. > Since I'm passing everything by reference the changes ought to be > applied globally, right? You're not passing a pointer to the pointer to the Lua state, just a pointer to the Lua state. Check your C... From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:24:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGOWDr005069; Wed, 16 Sep 2009 13:24:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CED771914C; Wed, 16 Sep 2009 13:24:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f195.google.com (mail-px0-f195.google.com [209.85.216.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9F6918C94 for ; Wed, 16 Sep 2009 13:23:55 -0300 (BRT) Received: by pxi33 with SMTP id 33so4279254pxi.11 for ; Wed, 16 Sep 2009 09:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=9Bt2Nid/hxsxrHWyR85hXpNVqaxIZlOPprjWU29CniY=; b=qZD/51iM0jylw2FS7L7Z5Vc3t4j8mx1J7f9gAvQvdN1ZUnTZdrXdqoeCKq2GHPG1Ls V9E5mXr60SFQTkH80VM/0fD7zDNK1gOHxBXzWJiElYT0A8HYacaQHXpUcnRHg1v5tJtL 7woQ97NCSvXRMiKZ3FNz0Mkaiw34snorAqp9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=q6via+YSpcdIh6v958W5yOEA5cwU0yES34Tk/hE/7ZfiBWUd9lLX9e5FYCXjLLyTC9 wNLRZ4wuAhodyhvh/NAs5Cd3X+wb/u4Jakd2o/eMJaLZOIyyHFKiHqyFYHQiyMPLq9tt sNTXL9oKQhju3DNe6dqMrLxIzWMlvc286YydA= MIME-Version: 1.0 Received: by 10.142.201.21 with SMTP id y21mr707623wff.341.1253118238094; Wed, 16 Sep 2009 09:23:58 -0700 (PDT) In-Reply-To: References: <560972290909150631k1702e0a1r41e793c7b342ec74@mail.gmail.com> From: Anurag Sharma Date: Wed, 16 Sep 2009 21:53:38 +0530 Message-ID: Subject: Re: How to run a Lua script file To: Lua list Content-Type: multipart/alternative; boundary=000e0cd3281271754c0473b4536d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd3281271754c0473b4536d Content-Type: text/plain; charset=ISO-8859-1 HI Philippe I tried that ..It gave me this eerrror lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global 'myapp_Lua' (a nil value) stack traceback: C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main chunk [C]: ? [C]: ? On Wed, Sep 16, 2009 at 9:37 PM, Philippe Lhoste wrote: > On 15/09/2009 15:43, Anurag Sharma wrote: > >> I tried when I try the following, I get error message >> >> lua -e "package.path='\\mypath\?.lua;'..package.path" -lmyapp_Lua ... >> > > The "mypath" needed to be replaced by to your real path. > > On Tue, Sep 15, 2009 at 7:01 PM, steve donovan > steve.j.donovan@gmail.com>> wrote: >> This error message is instructive; Lua is just telling you that your >> myapp_Lua module is not found on the Lua module path. Is myapp_Lua.lua >> in one of the these standard places? If not, either move it there, or >> read up about the LUA_PATH environment variable. >> > > To re-iterate Steve's question, where is your myapp_Lua.lua (or .dll) file? > Is it in one of the listed places? > > Perhaps you need to specify a "current directory" to your process object. > > -- > Philippe Lhoste > -- (near) Paris -- France > -- http://Phi.Lho.free.fr > -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > --000e0cd3281271754c0473b4536d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
HI Philippe
I tried that ..It gave me this eerrror
=A0
lua: C:\a\ScriptingLanguageSupport\Lua1.lua:5: attempt to index global= 'myapp_Lua'
(a nil value)
stack traceback:
=A0=A0=A0=A0= =A0=A0=A0 C:\a\ScriptingLanguageSupport\Lua1.lua:5: in main chunk
=A0=A0= =A0=A0=A0=A0=A0 [C]: ?
=A0=A0=A0=A0=A0=A0=A0 [C]: ?

On Wed, Sep 16, 2009 at 9:37 PM, Philippe Lhoste= <PhiLho@gmx.net= > wrote:
On 15/09/2009 15:43, Anurag Sharma wrote:
I tried when I try the following= , I get error message

lua -e "package.path=3D'\\mypath\?.lu= a;'..package.path" -lmyapp_Lua ...

The "mypath" needed to be replaced by to y= our real path.=20


On Tue, Sep 15, 2009 at 7:01 PM,= steve donovan <steve.j.donovan@gmail.com <mailto:steve.j.donovan@gmail.com>> w= rote:
=A0 =A0This error message is instructive; Lua is just telling you that your=
=A0 =A0myapp_Lua module is not found on the Lua module path. Is myapp_L= ua.lua
=A0 =A0in one of the these standard places? =A0If not, either mov= e it there, or
=A0 =A0read up about the LUA_PATH environment variable.
To re-iterate Steve's question, where is your myapp_Lua.lua (or = .dll) file? Is it in one of the listed places?

Perhaps you need to s= pecify a "current directory" to your process object.

--
Philippe Lhoste
-- =A0(near) Paris --= France
-- =A0http= ://Phi.Lho.free.fr
-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-- =A0-= - =A0-- =A0-- =A0-- =A0-- =A0--


--000e0cd3281271754c0473b4536d-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:31:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGVdMb006669; Wed, 16 Sep 2009 13:31:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8D5919365; Wed, 16 Sep 2009 13:31:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA13.westchester.pa.mail.comcast.net (qmta13.westchester.pa.mail.comcast.net [76.96.59.243]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19CEB19076 for ; Wed, 16 Sep 2009 13:31:02 -0300 (BRT) Received: from OMTA22.westchester.pa.mail.comcast.net ([76.96.62.73]) by QMTA13.westchester.pa.mail.comcast.net with comcast id hS491c0971ap0As5DUX7di; Wed, 16 Sep 2009 16:31:07 +0000 Received: from [130.157.100.72] ([130.157.100.72]) by OMTA22.westchester.pa.mail.comcast.net with comcast id hUag1c0041Zivxu3iUail6; Wed, 16 Sep 2009 16:34:47 +0000 Subject: Re: integration with C. Segfault whenever I do anything outside of my lua_state initializer function. From: Max To: Lua list In-Reply-To: <20090916131828.A8328@lua.tecgraf.puc-rio.br> References: <1253112910.16025.4.camel@MaxToTheMax-Lappy-Debian> <20090916130152.A8216@lua.tecgraf.puc-rio.br> <1253113855.16025.9.camel@MaxToTheMax-Lappy-Debian> <20090916131828.A8328@lua.tecgraf.puc-rio.br> Content-Type: text/plain Date: Wed, 16 Sep 2009 08:31:47 -0700 Message-Id: <1253115107.16025.12.camel@MaxToTheMax-Lappy-Debian> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 2009-09-16 at 13:18 -0300, Luiz Henrique de Figueiredo wrote: > > Actually if you check that forum post you'll see I changed all the names > > of the parameters and local variables to luaVM_local, and it didn't fix > > anything. That version of the code (different pastebin) is what I sent > > out to the mailing-list. > > Check my second reply there. > > > Since I'm passing everything by reference the changes ought to be > > applied globally, right? > > You're not passing a pointer to the pointer to the Lua state, just a > pointer to the Lua state. Check your C... Oh, whoa. It hadn't occurred to me that the value of the pointer itself might change. It works now, THANKS!!! From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 13:42:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GGg4dA009013; Wed, 16 Sep 2009 13:42:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 656F61897B; Wed, 16 Sep 2009 13:41:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f202.google.com (mail-qy0-f202.google.com [209.85.221.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E84CF1892B for ; Wed, 16 Sep 2009 13:41:17 -0300 (BRT) Received: by qyk40 with SMTP id 40so4263012qyk.8 for ; Wed, 16 Sep 2009 09:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=JVRdP5LqsL1iAtJv/b/v3kz+nk7RqNSZk+y0gjP5HOA=; b=hWhLUsmXhoPN0jPGrJztqYGyMIyX5OHyuMIkQei0Mal1cIB93yn0vSMJc6YV7PCN+z QNnbdHp6QKaVLSsFlqOQGTwHCC9qI+AD9+LIRF+rpdhrlCB3YXnkks3uLEaPJFzyoOrO ClHNqi4JbgDWf0kWOS4HyXqHwFDn6CLyDVGCg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UvBZtuQBynXSvXlplqM+Mh7l09m8v5/NncBuy/fruXgXyjyOMUxWlBpptqRgsf//AS SjwTQASwNP1cs1AVTEBzQNtrQkxzTQ/2gzxzcEZ544iZE4vzi55E++gf8dIgCl1o7NbE l5FexmtuZgqPGf1SIt9j+44HkD77nT1DOZ7xE= MIME-Version: 1.0 Received: by 10.229.119.131 with SMTP id z3mr2275325qcq.37.1253119280465; Wed, 16 Sep 2009 09:41:20 -0700 (PDT) In-Reply-To: <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> Date: Wed, 16 Sep 2009 13:41:20 -0300 Message-ID: Subject: Re: first class ':' From: Eduardo Ochs To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8GGg4dA009013 On Tue, Sep 15, 2009 at 5:17 AM, steve donovan wrote: > On Tue, Sep 15, 2009 at 10:00 AM, David Kastrup wrote: >> But I like the things that are just syntactic sugar in Lua: it means >> that you can exhaustively explain them in more basic terms in one >> sentence. > > OK, this is sugar we know so well: >   - obj:method() becomes obj.method(obj) > > But in the case of a obj:method _without_ parentheses, then there is a > somewhat more elaborate expansion as a closure. > > That feels manageable. > > First-class ':' has some cute advantages, it is an operator and > presumably has a metamethod, so that we can finally distinguish > between method and table lookup, _if needed_. > > But I worry about the complexity of the change, possible performance > implications, and more semantics that, yes, have to be explained ... What about this idea? When functions have a metatable and when that metatable has a field "__colon", then the expression f:method without an argument list, of course, would just return the result of: getmetatable(f).__colon(f, "method") Cheers, Eduardo Ochs eduardoochs@gmail.com http://angg.twu.net/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 14:10:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GHAhMT015741; Wed, 16 Sep 2009 14:10:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE26319369; Wed, 16 Sep 2009 14:09:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C94119076 for ; Wed, 16 Sep 2009 14:09:50 -0300 (BRT) Received: by bwz10 with SMTP id 10so4152696bwz.5 for ; Wed, 16 Sep 2009 10:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=cQMUOdXpJlr6oPXjyg3mRMebNnIHAHkjbk7UvtrCUlI=; b=uQxB3q3wh1uVk0snFTQoRH7i6sd6ZpMykBq4fadoRwpS2s2tyKbqii/yqdy+7Y+Xc3 fve4CClTsfODU+TnAHWSGjUdqyJTBASsyP1Eng/GKT9ngBxtCIIJWGDF8HU5eNHz3BNC jgDGehdfxF9JNEFyeWpLlT8dsi2HDLL4aOmgc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P/nMhAH9Nqm0JbCyQG4LSjcqVXnknz2HEWgm7kbqCd2upan1lb9QSqAySk03Dtzva/ 7AMextMjVt0sFH5L84JiyCfZGo+FxceCcePFQUk/IEvJy0BSQQ36uXtFqz07eF/GPrhl fOypVQUI/7tnDfUDX8zvw+h40NC+hzWfE9tlk= MIME-Version: 1.0 Received: by 10.204.34.197 with SMTP id m5mr7569885bkd.106.1253120991248; Wed, 16 Sep 2009 10:09:51 -0700 (PDT) In-Reply-To: References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> <20090914123507.GC4414@inf.puc-rio.br> <20090914230007.4b90f45d.froese@gmx.de> <873a6o1vtl.fsf@lola.goethe.zz> <560972290909150117sda02cbcob91930533d0facbe@mail.gmail.com> Date: Wed, 16 Sep 2009 19:09:51 +0200 Message-ID: <560972290909161009l2319a36fy29316ee856ad7b90@mail.gmail.com> Subject: Re: first class ':' From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8GHAhMT015741 On Wed, Sep 16, 2009 at 6:41 PM, Eduardo Ochs wrote: > When functions have a metatable and when that metatable has a field > "__colon", then the expression > >  f:method > > without an argument list, of course, would just return the result of: > >  getmetatable(f).__colon(f, "method") But this would be a runtime thing, not a compile-time transformation. So there would have to be some bytecode representation of 'f:method' (without parens) whereas 'f:method()' has been simply transformed into a table lookup and a function call. Man, I can see many opportunities for confusion! steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 15:16:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GIGlYk002056; Wed, 16 Sep 2009 15:16:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F002C191C8; Wed, 16 Sep 2009 15:15:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA88218D78 for ; Wed, 16 Sep 2009 15:15:53 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mnz2k-0002nc-Vo for lua@bazar2.conectiva.com.br; Wed, 16 Sep 2009 20:15:50 +0200 Received: from ppp91-77-232-127.pppoe.mtu-net.ru ([91.77.232.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 20:15:50 +0200 Received: from andrew_zhilin by ppp91-77-232-127.pppoe.mtu-net.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 20:15:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: zOOn Subject: [ANN] Pretty Printer for Lua Date: Wed, 16 Sep 2009 18:15:27 +0000 (UTC) Lines: 65 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 91.77.232.127 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.21 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! Here is new self-sufficient library for pretty printing Lua structures. Project page: http://github.com/zoon/luapp/ Library files: http://luaforge.net/projects/luapp/ It's rather advanced - it lets adjust width and maximum number of non-indentation characters that should appear on a line. Also, it removes artificial `[]' in keys, sort keys lexicographically etc. Motivation example: -- test.lua local pp = require'luapp'.pp local data = {"Call",{"Id","print"},{"Add",{"Num", 1}, {"Mul",{"Num", 2},{"Div",{"Num",4},{"Num",2}}}}, {"Add",{"Num", 1},{"Mul",{"Num", 2}, {"Div",{"Num",4},{"Num",2}}}}} print("=== 78 col ribbon=0,6 ==========") print(pp(data)) print("") print("==== 120 col ribbon=1.0 ========") print(pp(data,'TREE',120,1)) -- output [luapp51]$ lua test.lua === 78 col ribbon=0,6 ========== {"Call", {"Id", "print"}, {"Add", {"Num", 1}, {"Mul", {"Num", 2}, {"Div", {"Num", 4}, {"Num", 2}}}}, {"Add", {"Num", 1}, {"Mul", {"Num", 2}, {"Div", {"Num", 4}, {"Num", 2}}}}} ==== 120 col ribbon=1.0 ======== {"Call", {"Id", "print"}, {"Add", {"Num", 1}, {"Mul", {"Num", 2}, {"Div", {"Num", 4}, {"Num", 2}}}}, {"Add", {"Num", 1}, {"Mul", {"Num", 2}, {"Div", {"Num", 4}, {"Num", 2}}}}} PS. Library is a derivative of: 1. Philip Wadler. (April 1997) A prettier printer. Draft paper. http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf 2. Daan Leijen (Oct 2001) PPrint, a prettier printer. http://research.microsoft.com/users/daan/download/pprint/pprint.html 3. Christian Lindig (March 2000) Strictly Pretty. http://www.citeulike.org/group/8/article/828964 http://www.st.cs.uni-sb.de/~lindig/#quest Cheers, Andrew From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 15:31:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GIVOXm007092; Wed, 16 Sep 2009 15:31:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE40B19375; Wed, 16 Sep 2009 15:30:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52FBF19369 for ; Wed, 16 Sep 2009 15:30:45 -0300 (BRT) Received: by fxm18 with SMTP id 18so4265142fxm.5 for ; Wed, 16 Sep 2009 11:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=+JP6bmSpSm+cDgF37Kl6JaVoDqyPKSpFAhjnoudEmZs=; b=W30jAwGqotGUJLloQVM+v/kSsIOIqMO1SV+jSf4gy66ytwapink6STlbzJ1iHOJQ3/ c+oCACL48dopv+XJj15yUh82MSfWnqYjw7Q+aFirUNiKlf1FCAIjS3Ge871AP5e+z/QQ OicOPJV/m1aH9AMOzWoD68yUncCwcElWsfoDc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=PyGheQlj+V9+bY1+HbgacYmS5vHNm0T2BQ7CEL7QseMo2wQ8zC9D9KY7a1OcYIQqME Z1sP3UfXjfbEtbLYHaWCSBfFnMGNrlHgAPWeDSkBHYmhglSEGvBoCXkt9CcN/yg1cAh+ AD7E3qdYNso5Oat7JRCm/VcwDC0HGe/5T09gQ= Received: by 10.86.228.16 with SMTP id a16mr3370297fgh.49.1253125847677; Wed, 16 Sep 2009 11:30:47 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id 3sm82862fge.19.2009.09.16.11.30.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 16 Sep 2009 11:30:46 -0700 (PDT) Message-Id: <5915048C-CAF5-4387-B9A8-BCDF5F022C0B@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] Pretty Printer for Lua Date: Wed, 16 Sep 2009 20:30:15 +0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 16, 2009, at 8:15 PM, zOOn wrote: > Here is new self-sufficient library for pretty printing Lua > structures. -- --------------------------------------------------------------------------- -- This file has been generated from: -- <.\zpp.hlua> -- on Wednesday, September 16, 2009 at 11:32:24 AM by -- HyperLua compiler version 0.87 beta -- (C) 2007-2009 Andrew Zhilin. -- Edit at you own risk. -- --------------------------------------------------------------------------- Hmmm... HyperLua compiler? What's that? Inquisitive mind want to know! :D From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 15:54:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GIsERX014645; Wed, 16 Sep 2009 15:54:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A7E319359; Wed, 16 Sep 2009 15:53:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4AF33192A7 for ; Wed, 16 Sep 2009 15:53:30 -0300 (BRT) Received: by ywh4 with SMTP id 4so7697860ywh.5 for ; Wed, 16 Sep 2009 11:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=YlCxIBKunpK3pybqnTnSX40O3MbMgF/WewfTyjU+Vow=; b=dZdkGX1wyw+EIGyEAacSTXSMtlUggs6Wy1xG+slPkUoOkhvEMhF7NtvIVoccKY67Z+ 16xD1dWS9pUEZpGoZlTRSN09ls42LnoT59vEprym7z58E3knf0OMpoakJf9esbIDsH9N c4r8uhGriR23raT2l9z7BzlW0YnIit3n/Zavg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fLjTCZaIjPwaC7pe5sSh8Og8+DMWd2OeazFMAbXeNQ+AttGh8YDO0wEoKUN/0/yLg+ /ZMEOsuZn7V+5c0QSWrcfFESxqQj2lNn0tMnf5+vsxGAxexuOwIgnHZwgi0CruV+U6MR znnLuFj1ossC3Vozx89IzbEjFsHRESfZ5zkiM= MIME-Version: 1.0 Received: by 10.100.236.21 with SMTP id j21mr9276241anh.75.1253127212805; Wed, 16 Sep 2009 11:53:32 -0700 (PDT) Date: Wed, 16 Sep 2009 14:53:32 -0400 Message-ID: Subject: Lua Bytecode Reference? From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=001636b2b5ea60affc0473b66a2a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b5ea60affc0473b66a2a Content-Type: text/plain; charset=ISO-8859-1 Greetings All, Is there a good reference on what the lua compiler outputs for bytecode; I'm interested in knowing what codes there are and their general mode of operation. Any info would be great, thanks. Raymond Jacobs Owner, Ethereal Darkness Interactive www.edigames.com --001636b2b5ea60affc0473b66a2a Content-Type: text/html; charset=ISO-8859-1 Greetings All,

Is there a good reference on what the lua compiler outputs for bytecode;
I'm interested in knowing what codes there are and their general mode of operation.

Any info would be great, thanks.

Raymond Jacobs
Owner,
Ethereal Darkness Interactive
www.edigames.com
--001636b2b5ea60affc0473b66a2a-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 15:59:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GIxPIW015909; Wed, 16 Sep 2009 15:59:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E3271938E; Wed, 16 Sep 2009 15:58:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE21E19386 for ; Wed, 16 Sep 2009 15:58:49 -0300 (BRT) Received: by ewy4 with SMTP id 4so5364258ewy.36 for ; Wed, 16 Sep 2009 11:58:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.74.10 with SMTP id w10mr303974wed.99.1253127530294; Wed, 16 Sep 2009 11:58:50 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Sep 2009 19:58:50 +0100 X-Google-Sender-Auth: f28a50741734dedb Message-ID: Subject: Re: Lua Bytecode Reference? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf is generally regarded as the best reference document on Lua bytecode and VM instructions. On Wed, Sep 16, 2009 at 7:53 PM, Raymond Jacobs wrote: > Greetings All, > > Is there a good reference on what the lua compiler outputs for bytecode; > I'm interested in knowing what codes there are and their general mode of > operation. > > Any info would be great, thanks. > > Raymond Jacobs > Owner, > Ethereal Darkness Interactive > www.edigames.com > From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 16:29:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GJTJAT023576; Wed, 16 Sep 2009 16:29:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3880218B6F; Wed, 16 Sep 2009 16:28:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f194.google.com (mail-yx0-f194.google.com [209.85.210.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D3D418977 for ; Wed, 16 Sep 2009 16:28:33 -0300 (BRT) Received: by yxe32 with SMTP id 32so379326yxe.5 for ; Wed, 16 Sep 2009 12:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=RECB5l6jvJWAhAIjeA0exBFxwP7gbCZun/HYs0FQ7eM=; b=RWe8iLAAAFqq5SC9lQU51atjnMW1zWkkYm0RPWlbv3D2FpNIOZf1Me+mX+lCirZyep 4w7OAWaCDx/3VaCpJkzg7Hhecra3ZJ9xmtDcNITf+Tzaz/qYsrnQH9FsWe73fryf8OMv 1Kh3AvjSMluYyewiCV0PFWhXDE29WNrQULL5U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Exbz4tNPDiGq6A7MeP8TzSCj2QdXfo4u6wfOByygOyEm8DBv+SdLfGYDa8/LESza/U 3YYt20Q3w8tbCX6Cf/RRHvzNe9auPomQd78esrhZUL2UTh8Iw7cqHaNax4WVw7X5DcDw LoSbaMWcbrdJleendSewmYC4WuyROY7HSq3Sg= MIME-Version: 1.0 Received: by 10.101.196.13 with SMTP id y13mr9394309anp.148.1253127618469; Wed, 16 Sep 2009 12:00:18 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Sep 2009 15:00:18 -0400 Message-ID: Subject: Re: Lua Bytecode Reference? From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016e68ee0b58e9e6b0473b682ff X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68ee0b58e9e6b0473b682ff Content-Type: text/plain; charset=ISO-8859-1 Thanks, I'll give it a look-see :) -Raymond On Wed, Sep 16, 2009 at 2:58 PM, Peter Cawley wrote: > > http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf > is generally regarded as the best reference document on Lua bytecode > and VM instructions. > > On Wed, Sep 16, 2009 at 7:53 PM, Raymond Jacobs > wrote: > > Greetings All, > > > > Is there a good reference on what the lua compiler outputs for bytecode; > > I'm interested in knowing what codes there are and their general mode of > > operation. > > > > Any info would be great, thanks. > > > > Raymond Jacobs > > Owner, > > Ethereal Darkness Interactive > > www.edigames.com > > > --0016e68ee0b58e9e6b0473b682ff Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, I'll give it a look-see :)

-Raymond

On Wed, Sep 16, 2009 at 2:58 PM, Peter Cawley <lua@corsix.org> wrot= e:
http://luaforge.net/docman/view.php/83/98/ANoFrillsIntr= oToLua51VMInstructions.pdf
is generally regarded as the best reference document on Lua bytecode
and VM instructions.

On Wed, Sep 16, 2009 at 7:53 PM, Raymond Jacobs <raymondj@gmail.com> wrote:
> Greetings All,
>
> Is there a good reference on what the lua compiler outputs for bytecod= e;
> I'm interested in knowing what codes there are and their general m= ode of
> operation.
>
> Any info would be great, thanks.
>
> Raymond Jacobs
> Owner,
> Ethereal Darkness Interactive
> www.edigames.com=
>

--0016e68ee0b58e9e6b0473b682ff-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 17:23:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GKN5fd007910; Wed, 16 Sep 2009 17:23:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54EA718E9D; Wed, 16 Sep 2009 17:22:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36A5818BFD for ; Wed, 16 Sep 2009 17:22:25 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mo11H-0001dO-LJ for lua@bazar2.conectiva.com.br; Wed, 16 Sep 2009 22:22:27 +0200 Received: from ppp91-77-232-127.pppoe.mtu-net.ru ([91.77.232.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 22:22:27 +0200 Received: from andrew_zhilin by ppp91-77-232-127.pppoe.mtu-net.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 22:22:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: zOOn Subject: Re: [ANN] Pretty Printer for Lua Date: Wed, 16 Sep 2009 20:22:03 +0000 (UTC) Lines: 31 Message-ID: References: <5915048C-CAF5-4387-B9A8-BCDF5F022C0B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 91.77.232.127 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.21 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille gmail.com> writes: > Hmmm... HyperLua compiler? What's that? Inquisitive mind want to > know! :D I have uploaded complete sources to luaforge (it looks like github is under DDoS attack right now). You can take a look at *.hlua sources and attempt to play with hluac.jar - but it is totally undocumented. In brief, Hyperlua is a source-to-source translator from some "enriched" Lua to a "plain" Lua. Resulted plain lua files require no runtime support at all. Hyperlua is 100% back compatible to Lua 5.1. Main feature of Hyperlua is an optimizing pattern matching compiler, heavily influenced by Sestoft's "ML pattern match compilation and partial evaluation" (http://www.itu.dk/~sestoft/papers/match.ps.gz). Also it adds syntax for cons-list (x::[] [1,2,3]), thunks, can introduce infix and prefix operators, combined assignments (+=, or=) etc. You can get some notion about it from zpp.hlua and luapp.hlua. Compiler requires Scala's and Rat's runtimes (included). Cheers, Andrew http://luaforge.net/frs/download.php/4249/luapp-src-0.7.zip From lua-bounces@bazar2.conectiva.com.br Wed Sep 16 17:36:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GKaXWD012663; Wed, 16 Sep 2009 17:36:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9C3918FCD; Wed, 16 Sep 2009 17:36:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D51CA18C43 for ; Wed, 16 Sep 2009 17:35:59 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8GKa2Jw012582 for ; Wed, 16 Sep 2009 17:36:02 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8GKa2408793; Wed, 16 Sep 2009 17:36:02 -0300 Date: Wed, 16 Sep 2009 17:36:01 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Bytecode Reference? Message-ID: <20090916173601.A8782@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from raymondj@gmail.com on Wed, Sep 16, 2009 at 02:53:32PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Is there a good reference on what the lua compiler outputs for bytecode; > I'm interested in knowing what codes there are and their general mode of > operation. See a summary in http://www.lua.org/source/5.1/lopcodes.h.html#OP_MOVE Also, use luac -l to see bytecode listings. From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 01:50:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8H4one3010683; Thu, 17 Sep 2009 01:50:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 316BF192AF; Thu, 17 Sep 2009 01:49:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28A33192A1 for ; Thu, 17 Sep 2009 01:49:50 -0300 (BRT) Received: by iwn1 with SMTP id 1so70604iwn.11 for ; Wed, 16 Sep 2009 21:49:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.95 with SMTP id g31mr18594625ibr.24.1253162993109; Wed, 16 Sep 2009 21:49:53 -0700 (PDT) Date: Thu, 17 Sep 2009 00:49:53 -0400 X-Google-Sender-Auth: 477ac1b3ec36197f Message-ID: Subject: stack level abstraction [was Re: first class ':'] From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 16, 2009 at 9:22 AM, Luiz Henrique de Figueiredo wrote: >> You do need to increase the stack level, but I think that David meant >> some method to make the extra stack level(s) invisible to the debug API. > > This can be done in the traceback function itself, can't it? > I mean, just scan backward and skip your "hidden" functions. > Of course, you'll need a way to mark those: add them to a table or > name them with a predefined prefix. The problems with level in the error function have been described earlier [1]. However, the concern more generally affects the use of any stack manipulation function (e.g. getfenv, setfenv, error, debug.getinfo, etc.) We may redefine these functions in the way you suggest: -- Utility function: identity local function identity(...) return ... end -- Tells getlevel() to ignore function f. local ignore = setmetatable({}, {__mode='k'}) function ignorelevel(f) f = f or debug.getinfo(2,'f').func ignore[f] = true return f end -- Calls f with given parameters in a way that getlevel() -- ignores it. function ignorecall(f, ...) return identity(f(...)) -- prevent tail call end ignorelevel(ignorecall) -- Like debug.getinfo(n,'f').func, but skips ignored functions. function getlevel(n) local fc local j=1 for i=1,n do repeat fc = debug.getinfo(1+j,'f').func if fc == ignorecall then j=j+1 end -- ignore caller too j=j+1 until not ignore[fc] end return fc end -- Redefine getfenv with getlevel behavior. local getfenv_old = getfenv function getfenv(f) if type(f) == 'number' and f > 0 then f = getlevel(f+1) end return getfenv_old(f) end ---- Test -- Some arbitrary function that deals with stack levels. local function import(x) getfenv(2)[x] = {} end -- Some code wrap the above function (two alternate ways) local function tuple(...) return {n=select('#',...), ...} end local function trace1(f) return ignorelevel(function(...) print'begin' local t = tuple(f(...)) print'end' return unpack(t, 1, t.n) end) end local function trace2(f) return function(...) print'begin' local t = tuple(ignorecall(f,...)) print'end' return unpack(t, 1, t.n) end end local import1 = trace1(import) local import2 = trace2(import) -- Use it. setfenv(1,{_G=_G}) import1 'x' import2 'y' _G.assert(x) _G.assert(y) _G.print 'done' [1] http://lua-users.org/wiki/LuaCarp From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 02:52:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8H5qPch016565; Thu, 17 Sep 2009 02:52:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10DF3192A5; Thu, 17 Sep 2009 02:51:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67CA818A5F for ; Thu, 17 Sep 2009 02:51:40 -0300 (BRT) Received: by yxe36 with SMTP id 36so7278114yxe.11 for ; Wed, 16 Sep 2009 22:51:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.142.8 with SMTP id u8mr136954agn.102.1253166703429; Wed, 16 Sep 2009 22:51:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Sep 2009 01:51:43 -0400 X-Google-Sender-Auth: d161e63655c7a0bc Message-ID: Subject: Re: improving the module function - package.clean From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 16, 2009 at 7:07 AM, Jim Jennings wrote: > I would love to see Lua 5.2 adopt your suggestion of having 'require' > place the loaded module table into the right place. In some module systems, certain modules utilize the import mechanism to apply a special side-effect into the caller. A Perl style way of writing module(..., package.strict) would be module(...) import "strict" -- i.e. require "strict" : __import() Here, *every* instance of "import 'strict'" would apply a side-effect into its caller environment, unlike "require 'strict'" in Lua 5.1 which permits no side-effects after its first call. From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 03:11:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8H6BWEL018346; Thu, 17 Sep 2009 03:11:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FB67192C1; Thu, 17 Sep 2009 03:10:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2077D192A2 for ; Thu, 17 Sep 2009 03:10:51 -0300 (BRT) Received: by ywh28 with SMTP id 28so878680ywh.11 for ; Wed, 16 Sep 2009 23:10:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.166.2 with SMTP id o2mr144141age.93.1253167853883; Wed, 16 Sep 2009 23:10:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Sep 2009 02:10:53 -0400 X-Google-Sender-Auth: 15e9730df373c6cb Message-ID: Subject: Re: Announce: Darwin module system From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8H6BWEL018346 On Wed, Sep 16, 2009 at 6:58 AM, Jim Jennings wrote: >> Why isn't the native Lua search path sufficient? >... > When I create the user environment, I may want my own search path for > loading files that is distinct from the Lua package.path.   That gives > me the opportunity to write structure declarations that load code from > anywhere in the file system, according to how I've set the Darwin > path.... > I considered giving Darwin a mirror of Lua's package table (which has a > wonderfully flexible design) in order to provide the full power of > loaders, preload, etc.  In the end, I opted for 'keep it simple' > instead, and just implemented a search path, mainly because my desire > was only to have my "set up the system" code live in a directory that > is not on the Lua search path. True, appending to package.path or loaders is currently a global change. Allowing for multiple private, independent instances of package.path/loaders to co-exist would involve rewriting require. From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 13:26:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8HGQZwv016550; Thu, 17 Sep 2009 13:26:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 485DB1938F; Thu, 17 Sep 2009 13:25:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from queueout02-winn.ispmail.ntl.com (queueout02-winn.ispmail.ntl.com [81.103.221.56]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB9AD19299 for ; Thu, 17 Sep 2009 13:25:49 -0300 (BRT) Received: from know-smtpout-2.server.virginmedia.net ([62.254.123.2]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090917160723.BPSB6742.mtaout01-winn.ispmail.ntl.com@know-smtpout-2.server.virginmedia.net> for ; Thu, 17 Sep 2009 17:07:23 +0100 Received: from [78.147.225.172] (helo=taboche) by know-smtpout-2.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1MoJVj-0006cN-UG for lua@bazar2.conectiva.com.br; Thu, 17 Sep 2009 17:07:08 +0100 From: Thomas Lauer To: Lua list Subject: [ANN] Idle 1.0 RC1 Date: Thu, 17 Sep 2009 17:07:09 +0100 Organization: TL Message-ID: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=SFBYNVl0AAAA:8 a=Q7QnIW2TN9KKkjz_t7UA:9 a=FgegXEy8sGSbR2dEzVIgL8K_8-YA:4 a=I-Q4fQThMMMA:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8HGQZwv016550 RC1 for Idle v 1.0 is out. See http://idle.thomaslauer.com for details about Idle and http://idle.thomaslauer.com/IdleDownload.html for downloads. Barring major upsets, the final 1.0 version will be released within the next two weeks. I will release a source code archive later, hopefully within a couple of months. Idle is a compact, powerful scripting language based on Lua. It is available for Windows 2000 and later systems. Idle is released under the MIT licence. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 17:38:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8HKcWYV016630; Thu, 17 Sep 2009 17:38:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18EEC192A5; Thu, 17 Sep 2009 17:37:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3830218977 for ; Thu, 17 Sep 2009 17:37:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so808032ewy.5 for ; Thu, 17 Sep 2009 13:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=wC0HIY3StyoJbdNeYX5JAQ6lw+cE2Wz8JUJHHGd7mSw=; b=dXHXBTVpHMYGHsazP98dfr/gYrH+1N5ygTMS5WRfHPWVP390f7g/jVs2cTV3c3qC7b r1Q+hjhgFw9naNK0TFcsEedPwdQC9DnLshOFAPe/8tjxFohvbNWzQY5I7tWf1vZylKRr D7GbzCRA1h0GMew216gqM+rdBFq8Q3fLN2L0E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=K4BY0PV+kevR4iQlpW03WBLKUvS1GQx1b0lYo2oUE2l0fAFhL0ekmmFaaW6IZOT3EY HLDnvgQi6cKPUFVTkuX0NlyqGk+5Jexmff+1dhe1p3u1zmMAHh5pLFRfN23FzAUlXYai 8J0PXZBI9TD6eYbfgA9ViJYLEIYDe+lZz2R0E= MIME-Version: 1.0 Received: by 10.211.184.8 with SMTP id l8mr1180158ebp.16.1253219511222; Thu, 17 Sep 2009 13:31:51 -0700 (PDT) In-Reply-To: References: <5915048C-CAF5-4387-B9A8-BCDF5F022C0B@gmail.com> Date: Thu, 17 Sep 2009 22:31:51 +0200 X-Google-Sender-Auth: 1a9717178a0a45a8 Message-ID: <956373d40909171331k4482b16eh5ae74ab05bf19408@mail.gmail.com> Subject: Re: [ANN] Pretty Printer for Lua From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=000e0cdff5f4cac3d40473cbe74e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cdff5f4cac3d40473cbe74e Content-Type: text/plain; charset=ISO-8859-1 > In brief, Hyperlua is a source-to-source translator from some > "enriched" Lua to a "plain" Lua. Resulted plain lua files require no > runtime support at all. Hyperlua is 100% back compatible to Lua 5.1. > It sort-of sounds like metalua without the bytecode generator, including the AST bits you're using as samples. Was there a reason not to start from Metalua's "match" extension, other than the fun to redo everything from scratch for the sake of it? --000e0cdff5f4cac3d40473cbe74e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
In brief, Hyperlua is a source-to-source translator from some
"enriched" Lua to a "plain" Lua. Resulted plain lua fil= es require no
runtime support at all. Hyperlua is 100% back compatible to Lua 5.1.

It sort-of sounds like metalua without the bytecode gene= rator, including the AST bits you're using as samples. Was there a reas= on not to start from Metalua's "match" extension, other than = the fun to redo everything from scratch for the sake of it?
--000e0cdff5f4cac3d40473cbe74e-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 18:00:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8HL0Wt3022286; Thu, 17 Sep 2009 18:00:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4FD4190F9; Thu, 17 Sep 2009 17:59:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0B691897B for ; Thu, 17 Sep 2009 17:59:53 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 3AC606B4DF for ; Thu, 17 Sep 2009 16:59:57 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 17 Sep 2009 16:59:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date; s=smtpout; bh=r/6KI3FbHfNn0G+itpBQmHWiZbw=; b=Jwapagb2rLNU1fP0Uvr/OZgKPR2DPTPtHibdepw7UQYsXsgjWwNx2QI7dxPcUlsWnZR/WK9xiLk9gFrEc/C6IiQYFM6r2nV0mJfEtJDEZTonvhCv96msnqJLNucIBygadB3I5Wxhka4f9j8MI0gZ58xB/ly0CNwTiz1+aRxWEDM= X-Sasl-enc: 9H66nPXHinKHPCXEYl4hR43FftQZnn5Cr6E0AU+unBt6 1253221196 Received: from [10.1.1.6] (222-152-23-11.jetstream.xtra.co.nz [222.152.23.11]) by mail.messagingengine.com (Postfix) with ESMTPSA id 765C54C1D3 for ; Thu, 17 Sep 2009 16:59:56 -0400 (EDT) Message-Id: From: Geoff Leyland To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Pure lua kd-tree Date: Fri, 18 Sep 2009 08:59:31 +1200 X-Mailer: Apple Mail (2.935.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I've been working on a project that involves displaying and querying road maps, and needed to be able to work out quickly what to draw and what the mouse was over. I didn't find much that helped by googling "lua rtree", so I ended up writing something that turned out to be fairly primitive a kd-tree. I still haven't found much googling "lua kdtree", so I've stuck it where you can find it. It's read-only - you tell it the bounding boxes of all your objects once and it chugs a while building the tree, and then you can ask it which objects lie in a box. I'm sure it could be improved both in code and the algorithm it uses. (for example the query returns a coroutine iterator, which uses about 4k for every query. Perhaps a callback interface would be better?) If anyone's interested it's at http://www.incremental.co.nz/download/kdtree.lua.gz . By the way is there a good place to put snippets of code like this? It seems a little insignificant for Luaforge or the like. Paste it into the wiki? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 18:13:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8HLDhxk025194; Thu, 17 Sep 2009 18:13:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9ED09192DC; Thu, 17 Sep 2009 18:13:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99F101897B for ; Thu, 17 Sep 2009 18:12:55 -0300 (BRT) Received: from [93.173.244.129] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQ400LQXW9K9L50@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 00:12:57 +0300 (IDT) Date: Fri, 18 Sep 2009 00:12:59 +0300 From: Shmuel Zeigerman Subject: console.dll To: Lua list Message-id: <4AB2A65B.9040308@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean After creating a library named console.dll, I encountered a problem that was discussed once on the list (see thread [1]). The source file for my console.dll is: > #include "lua.h" > int luaopen_console (lua_State *L) { return 0; } I run > lua -lconsole from the directory, where console.dll resides, and get the following: > lua: error loading module 'console' from file './console.dll': > The specified procedure could not be found. > > > stack traceback: > [C]: ? > [C]: ? > [C]: ? According to the message, Lua fails to find the procedure in './console.dll', but that is not true, as in fact it fails on C:\Windows\system32\console.dll (see [1]). BTW, my package.cpath begins with "./?.dll;" So it seems that even if the problem itself is hard to resolve, then at least the error message should be corrected, since it is misleading. [1] http://lua-users.org/lists/lua-l/2006-12/threads.html#00047 -- Shmuel From lua-bounces@bazar2.conectiva.com.br Thu Sep 17 18:41:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8HLexWc030229; Thu, 17 Sep 2009 18:40:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 580AE190F9; Thu, 17 Sep 2009 18:40:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07F801891C for ; Thu, 17 Sep 2009 18:40:18 -0300 (BRT) Received: by fxm18 with SMTP id 18so387905fxm.5 for ; Thu, 17 Sep 2009 14:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=49uGCBR8T4HMfac2BnXE3Q+Dqgn+iQgIrH7I506vuik=; b=KmRI3x26CCRLR2r57AAguCrvtSd03+Ylk0TiRTAIb39nByFAhS98CiiexWzbgfDnae fCHlglzL2HTTvbpGV7saB0zUbNoc0rXFzzZWkuW8Xqwq5jkYaftCvf0uLrjy4D8tPXdE WIogwwDyN5Fork8cXVQUlt/uHKwwqMZ9XfOD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=hUCi/1mlWgJk5YM/KWna47JbJKyt40oZQP7IChTY5vs9RSyuoOG5jziZA+M/oCzp52 6FmQ2nwaw9P352/8BSlrYQF2cBPLhetpk6kM4U6D9zR/xS7vES8/mt1SbR4kv2ucrOz7 qXJauVqIvC/U67HAHE+IOrfWd9GR3f9Tsk0MA= Received: by 10.86.208.2 with SMTP id f2mr1104871fgg.16.1253223621128; Thu, 17 Sep 2009 14:40:21 -0700 (PDT) Received: from ?192.168.0.26? (c210-49-209-95.sunsh5.vic.optusnet.com.au [210.49.209.95]) by mx.google.com with ESMTPS id e11sm771684fga.14.2009.09.17.14.40.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 17 Sep 2009 14:40:20 -0700 (PDT) Message-ID: <4AB2ACC1.6080003@gmail.com> Date: Fri, 18 Sep 2009 07:40:17 +1000 From: David Burgess User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: console.dll References: <4AB2A65B.9040308@013net.net> In-Reply-To: <4AB2A65B.9040308@013net.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If you set the package.cpath to !\\?.lua (or someyhing similar) which I had previously argued should be the default then there would be no problem. d burgess Shmuel Zeigerman wrote: > After creating a library named console.dll, I encountered a problem that > was discussed once on the list (see thread [1]). > > The source file for my console.dll is: >> #include "lua.h" >> int luaopen_console (lua_State *L) { return 0; } > > I run >> lua -lconsole > from the directory, where console.dll resides, and get the following: > >> lua: error loading module 'console' from file './console.dll': >> The specified procedure could not be found. >> >> >> stack traceback: >> [C]: ? >> [C]: ? >> [C]: ? > > According to the message, Lua fails to find the procedure in > './console.dll', but that is not true, as in fact it fails on > C:\Windows\system32\console.dll (see [1]). > > BTW, my package.cpath begins with "./?.dll;" > > So it seems that even if the problem itself is hard to resolve, then at > least the error message should be corrected, since it is misleading. > > [1] http://lua-users.org/lists/lua-l/2006-12/threads.html#00047 > From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:03:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IB3Ta6015398; Fri, 18 Sep 2009 08:03:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50F7D19353; Fri, 18 Sep 2009 08:02:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE591192BC for ; Fri, 18 Sep 2009 08:02:46 -0300 (BRT) Received: by bwz10 with SMTP id 10so671858bwz.5 for ; Fri, 18 Sep 2009 04:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Hi4s2JVcrQosCxeDmsPv8IoIxQNIPOxqHCu9yJiP3eo=; b=wxli9yqYmeprg/Mkj3m+0nfFha3cc3DmUxA7Mam+R7F2jXIdcKOcbUxTDewXokIX9t 1UyA8mhKh5elzvcBj9r0f0sWBrLiGB8UTpTj3tWxypj/lhj5TmvNeDpLnZSA/8s6k7KS fK4TZBiV1iu+OaEwt/mO0zH7CMWDZO0TEdKog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kZJYPSho7hFxRWRKF2v/C7MH2gzJS254cBpFIukpm+jmwMu19zwaiylXE1k9xQmIZS wwxNSgIltGawSEJlsSz13q/CK40AFH1uFu2t1vuEVmQkdlInc59r2yDyEkdvEYjG0wSu 3eOf1Nwydzl3HlsiuEnsuB6d9xeU0s8RVoLBg= MIME-Version: 1.0 Received: by 10.204.8.155 with SMTP id h27mr1388171bkh.55.1253271769579; Fri, 18 Sep 2009 04:02:49 -0700 (PDT) In-Reply-To: <20090916173601.A8782@lua.tecgraf.puc-rio.br> References: <20090916173601.A8782@lua.tecgraf.puc-rio.br> Date: Fri, 18 Sep 2009 13:02:49 +0200 Message-ID: <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> Subject: Re: Lua Bytecode Reference? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8IB3Ta6015398 2009/9/16 Luiz Henrique de Figueiredo : >> Is there a good reference on what the lua compiler outputs for bytecode; >> I'm interested in knowing what codes there are and their general mode of >> operation. > > See a summary in >        http://www.lua.org/source/5.1/lopcodes.h.html#OP_MOVE > > Also, use luac -l to see bytecode listings. > I've not looked into it(as i dont have a lot of free time), so i'll just ask here; would it be possible to make a processor which executes those lua-bytecodes, for example in vhdl? =) From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:14:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBEoLn016684; Fri, 18 Sep 2009 08:14:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73843193DE; Fri, 18 Sep 2009 08:14:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94B9419343 for ; Fri, 18 Sep 2009 08:14:20 -0300 (BRT) Received: by fxm18 with SMTP id 18so699642fxm.5 for ; Fri, 18 Sep 2009 04:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DezS0giFPIU9ZLJQ4tZGP7vPraUXH7Nw/b8FeCJceMs=; b=BIb8M2MRmdTQPr3GRyxcelM5PAI0PBUBa2qcl1AUokJA0MEiGA4l77+iBoipKIDjLW N1k4BJod3pccLID7id5hBSaV/bELCXxufl6P3A9LUXCqFBEgbhcJASzvICtshr8G1LnB XOt5e8G5OfpM8Bx2ugl15X+D006kfPF10Ygzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=begac0GMnyLxhliSunYoC0u+Xi0iVDlsLQ4ixhV4Wj4+TSI2lee/QDHjYVa1SzKIcY 02EkunxXnDtE8L0r+ZRFLU95mW+dKIzviGMuxlS/9QCH2BmV6x6uMvnJuU6F4/grTUZf oIf9o9SwazU+nJpz8QKgVH2rHQIyXSoq1PJ5s= MIME-Version: 1.0 Received: by 10.204.29.24 with SMTP id o24mr1383902bkc.85.1253272462549; Fri, 18 Sep 2009 04:14:22 -0700 (PDT) In-Reply-To: <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> References: <20090916173601.A8782@lua.tecgraf.puc-rio.br> <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> Date: Fri, 18 Sep 2009 13:14:22 +0200 Message-ID: <560972290909180414y2a7ad72cnfbbc0a6287149931@mail.gmail.com> Subject: Re: Lua Bytecode Reference? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 18, 2009 at 1:02 PM, Pierre LeMoine wrote: > I've not looked into it(as i dont have a lot of free time), so i'll > just ask here; would it be possible to make a processor which executes > those lua-bytecodes, for example in vhdl? =) All things are possible, given enough free time ;) From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:27:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBRXbH018073; Fri, 18 Sep 2009 08:27:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F2CD192C9; Fri, 18 Sep 2009 08:26:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D00318D5E for ; Fri, 18 Sep 2009 08:26:52 -0300 (BRT) Received: by ewy26 with SMTP id 26so1270189ewy.5 for ; Fri, 18 Sep 2009 04:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=SXoXd3lAgXZne7pXwx1XQmdW3LfAraaA7DvEE3biZ5w=; b=t0FZkg2q182v57Q2DPdugEi84zLQ6zsMGdjAN+A4UBLjvmbEu7zc/qF0U9YnTqTmK9 ZyHvti8k/V6zqTeXofvrUKzfAv/zaUT+DkFLAadH2HNG66WmnjWdjeLCJ+nOzJM3p4z7 UlxfS662HwuqksEJqJT8kJAsdx4A2dCSCSwiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gp6eaw1LmpWNpiZfxKimC2hYpsOTPtsHP/wKFlL6Ept8Ig6rTYa5kU5zZr4EKHore+ oy9xvf213e9rvs5rYqSgrLFaZi5H0m39P5Ja9eYGS3zBJLMtw+mAHW1eoewx5PxVX9Xm Zcf5vtnUfO5WbZDjdd67WP+kRg5D/z+fBXdfM= MIME-Version: 1.0 Received: by 10.211.146.5 with SMTP id y5mr1921163ebn.41.1253273216210; Fri, 18 Sep 2009 04:26:56 -0700 (PDT) In-Reply-To: <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> References: <20090916173601.A8782@lua.tecgraf.puc-rio.br> <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> From: Bogdan Marinescu Date: Fri, 18 Sep 2009 14:26:36 +0300 Message-ID: <81fbe47d0909180426v7ee30a35y30fb4c1c094d0131@mail.gmail.com> Subject: Re: Lua Bytecode Reference? To: Lua list Content-Type: multipart/alternative; boundary=001636c5bfbddbd6c30473d86848 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5bfbddbd6c30473d86848 Content-Type: text/plain; charset=ISO-8859-1 Possible? Definitely. Practical? I don't know ... Unless you can find a way to do other things in hardware too, like floating point operations (OK, this one isn't that hard), garbage collection, fast table accesses and others, the whole thing won't probably do much in terms of speed. Best, Bogdan On Fri, Sep 18, 2009 at 2:02 PM, Pierre LeMoine wrote: > 2009/9/16 Luiz Henrique de Figueiredo : > >> Is there a good reference on what the lua compiler outputs for bytecode; > >> I'm interested in knowing what codes there are and their general mode of > >> operation. > > > > See a summary in > > http://www.lua.org/source/5.1/lopcodes.h.html#OP_MOVE > > > > Also, use luac -l to see bytecode listings. > > > > I've not looked into it(as i dont have a lot of free time), so i'll > just ask here; would it be possible to make a processor which executes > those lua-bytecodes, for example in vhdl? =) > --001636c5bfbddbd6c30473d86848 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Possible? Definitely. Practical? I don't know ... Unless you can find a= way to do other things in hardware too, like floating point operations (OK= , this one isn't that hard), garbage collection, fast table accesses an= d others, the whole thing won't probably do much in terms of speed.

Best,
Bogdan

On Fri, Sep 18, 2009 = at 2:02 PM, Pierre LeMoine <yarr.luben@gmail.com> wrote:
2009/9/16 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> Is there a good reference on wha= t the lua compiler outputs for bytecode;
>> I'm interested in knowing what codes there are and their gener= al mode of
>> operation.
>
> See a summary in
> =A0 =A0 =A0 =A0http://www.lua.org/source/5.1/lopcodes.h.html#= OP_MOVE
>
> Also, use luac -l to see bytecode listings.
>

I've not looked into it(as i dont have a lot of free time),= so i'll
just ask here; would it be possible to make a processor which executes
those lua-bytecodes, for example in vhdl? =3D)

--001636c5bfbddbd6c30473d86848-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:44:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBicVU020679; Fri, 18 Sep 2009 08:44:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D87E319289; Fri, 18 Sep 2009 08:44:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from xserver.gls.co.za (unknown [196.44.38.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D39CC18FCC for ; Fri, 18 Sep 2009 08:44:00 -0300 (BRT) Received: from XSERVER.gls.co.za ([192.168.1.26]) by xserver.gls.co.za ([192.168.1.26]) with mapi; Fri, 18 Sep 2009 13:43:58 +0200 From: Ben Harper To: "lua@bazar2.conectiva.com.br" Date: Fri, 18 Sep 2009 13:43:49 +0200 Subject: LPEG for C++ Thread-Topic: LPEG for C++ Thread-Index: Aco4VUmv7cPTsJBAQdmcnQkDtveETw== Message-ID: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_27BA4145191C1849903386A90FE16D6518E7FA6D21xserverglscoz_" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_27BA4145191C1849903386A90FE16D6518E7FA6D21xserverglscoz_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I want to parse C++ header files (not for classes, just Plain Old C functio= ns), and automatically generate entry points for another language. Has anybody created an LPEG grammar capable of parsing a reasonable subset = of C++? Thanks, Ben --_000_27BA4145191C1849903386A90FE16D6518E7FA6D21xserverglscoz_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I want to parse C++ header files (not for classes, jus= t Plain Old C functions), and automatically generate entry points for another language.

 

Has anybody created an LPEG grammar capable of parsing= a reasonable subset of C++?

 

Thanks,

Ben

--_000_27BA4145191C1849903386A90FE16D6518E7FA6D21xserverglscoz_-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:48:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBmrMK021247; Fri, 18 Sep 2009 08:48:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A28D6193F1; Fri, 18 Sep 2009 08:48:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kirsi1.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A482E1929A for ; Fri, 18 Sep 2009 08:48:22 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by kirsi1.inet.fi (8.5.014) (authenticated as forske-1) id 4A77672B01AD20F8 for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 14:48:26 +0300 Message-ID: <4AB3738A.4050903@pp.inet.fi> Date: Fri, 18 Sep 2009 14:48:26 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Broken logic? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Howcome this doesn't work in lua? if !(x>y) then // same as x>=y ... end --> unexpected symbol near '!' From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:50:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBoJKr021430; Fri, 18 Sep 2009 08:50:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94CD0193F9; Fri, 18 Sep 2009 08:49:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kirsi2.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBB851929A for ; Fri, 18 Sep 2009 08:49:53 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by kirsi2.inet.fi (8.5.014) (authenticated as forske-1) id 4A77692A01B048F0 for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 14:49:58 +0300 Message-ID: <4AB373E6.9070102@pp.inet.fi> Date: Fri, 18 Sep 2009 14:49:58 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Broken logic? References: <4AB3738A.4050903@pp.inet.fi> In-Reply-To: <4AB3738A.4050903@pp.inet.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Whoops! Naturally I meant it's the same as x<=y... Kenneth Forsbäck wrote: > Howcome this doesn't work in lua? > > if !(x>y) then // same as x>=y > ... > end > > --> unexpected symbol near '!' > From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:52:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBq917021652; Fri, 18 Sep 2009 08:52:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4548193FF; Fri, 18 Sep 2009 08:51:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.hougaard.com (unknown [195.184.111.19]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F25B192C0 for ; Fri, 18 Sep 2009 08:51:43 -0300 (BRT) Received: from [10.45.10.54] (mail.efoqus.dk [195.184.111.23]) by mail.hougaard.com (Postfix) with ESMTP id 53EA763C007 for ; Fri, 18 Sep 2009 13:51:41 +0200 (CEST) Message-ID: <4AB3744C.2040605@hougaard.com> Date: Fri, 18 Sep 2009 13:51:40 +0200 From: Erik Hougaard User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Broken logic? References: <4AB3738A.4050903@pp.inet.fi> <4AB373E6.9070102@pp.inet.fi> In-Reply-To: <4AB373E6.9070102@pp.inet.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-hougaard.com-MailScanner: Found to be clean X-hougaard.com-MailScanner-From: erik@hougaard.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Kenneth Forsbäck wrote: >> Howcome this doesn't work in lua? >> >> if !(x>y) then // same as x>=y Because "!" is C not Lua, "~" is :) /Erik From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:52:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBqb4t021743; Fri, 18 Sep 2009 08:52:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D8E919406; Fri, 18 Sep 2009 08:51:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17B3F19400 for ; Fri, 18 Sep 2009 08:51:50 -0300 (BRT) Received: by bwz10 with SMTP id 10so699192bwz.5 for ; Fri, 18 Sep 2009 04:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=900DCh5VHE2NCcqRnN1KwUNvtySVw5WNI0RYifto5LI=; b=Sd67rtqRkhmV1kaURLQWTDawlGIiFi/ncYqDEhKkgXG+n9trI+PUVR1CsHey3f7EjH RL2bWlfnG5A7Dr/qFoXqXdYquJA+xQJF8H1zzw7SwXBmCOlN3DHmIR2ypTNXCVroLhjd P497xWDyWlha5tL/ZXwxessULGhZEJLKA5sBs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P6fPKBz2QVjJE1tL7wxrDbEbOgZrPgc8+jX6ZRGc3uNYwAaCNoO2JF6fFLerIjSArb N112tBh/aNBSMHzqc3lmGg2QZiR3gavFCMxp2g9d7Y5edNg/Jbd5sPIUcO9Cmxs7pzOl kq329C0MG6cjfUE39rlMHfM6YM16DooLwLoIE= MIME-Version: 1.0 Received: by 10.204.155.67 with SMTP id r3mr1433323bkw.94.1253274714834; Fri, 18 Sep 2009 04:51:54 -0700 (PDT) In-Reply-To: <4AB3738A.4050903@pp.inet.fi> References: <4AB3738A.4050903@pp.inet.fi> Date: Fri, 18 Sep 2009 13:51:54 +0200 Message-ID: <560972290909180451p3ec477bga7162c0afa3f2789@mail.gmail.com> Subject: Re: Broken logic? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8IBqb4t021743 On Fri, Sep 18, 2009 at 1:48 PM, Kenneth Forsbäck wrote: > if !(x>y) then // same as x>=y The operator you're looking for is the word 'not'. (Lua also says not-equal with ~=, no exclamation marks!) From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 08:54:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IBsX9K021969; Fri, 18 Sep 2009 08:54:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE9261940D; Fri, 18 Sep 2009 08:54:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jenni1.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BF0C19409 for ; Fri, 18 Sep 2009 08:54:07 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by jenni1.inet.fi (8.5.014) (authenticated as forske-1) id 4A776AE6019FAFA9 for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 14:54:12 +0300 Message-ID: <4AB374E4.5090903@pp.inet.fi> Date: Fri, 18 Sep 2009 14:54:12 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Broken logic? References: <4AB3738A.4050903@pp.inet.fi> <4AB373E6.9070102@pp.inet.fi> <4AB3744C.2040605@hougaard.com> In-Reply-To: <4AB3744C.2040605@hougaard.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Double whoops! LMAO ^^ Silly me... How I still get this wrong all the time...*sigh* Thanks for the help. Erik Hougaard wrote: > Kenneth Forsbäck wrote: >>> Howcome this doesn't work in lua? >>> >>> if !(x>y) then // same as x>=y > Because "!" is C not Lua, "~" is :) > > /Erik > > > > From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 09:48:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ICmkDM030828; Fri, 18 Sep 2009 09:48:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41A8F19410; Fri, 18 Sep 2009 09:48:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3EC31940A for ; Fri, 18 Sep 2009 09:48:05 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so296856eye.39 for ; Fri, 18 Sep 2009 05:48:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.0.198 with SMTP id 48mr493362web.84.1253278089743; Fri, 18 Sep 2009 05:48:09 -0700 (PDT) In-Reply-To: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> Date: Fri, 18 Sep 2009 13:48:09 +0100 X-Google-Sender-Auth: 5eac937986bff8f2 Message-ID: Subject: Re: LPEG for C++ From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You might be interested in reusing some code I wrote recently. It is a Lua/LPEG creation to parse C++ source files, extract information, and then output it in wiki markup. For example, given a C++ file looking something along the lines of: static int l_map_getsize(lua_State *L) { THMap* pMap = luaT_testuserdata(L); lua_pushinteger(L, pMap->getWidth()); lua_pushinteger(L, pMap->getHeight()); return 2; } // // Then later on: // luaT_class(THMap, l_map_new, "map", iMapMT); luaT_setfunction(l_map_getsize, "size"); // ... luaT_endclass(); The Lua/LPEG script can parse the above, and work out that the Lua class "map" wraps the C++ class "THMap", and that the "size" method on a Lua "map" class calls the "l_map_getsize" glue function, which in turn calls THMap::getWidth and THMap::getHeight. The final output would be the following Google Code wiki markup: === TH.map === Wraps the C++ class *{{{THMap}}}*. || *Lua method* || *C++ function(s)* || *Glue function* || || *{{{size}}}* || *{{{THMap::getWidth}}}*, *{{{THMap::getHeight}}}* || *{{{l_map_getsize}}}* || You can find the source code at http://code.google.com/p/corsix-th/source/browse/trunk/LDocGen/ - there are three Lua files there: c_tokenise.lua - The LPEG grammar for turning a C/C++ file into an array of tokens. Also has code for pretty printing a token array as HTML, but that code can be ignored. helpers.lua - A collection of helper functions. The most important of these is tokens_gfind, which provides functionality similar to string.gmatch - it finds a string of tokens in an array of tokens, ignoring whitespace tokens. main.lua - The actual application logic Let me know if it proves useful, Peter On Fri, Sep 18, 2009 at 12:43 PM, Ben Harper wrote: > I want to parse C++ header files (not for classes, just Plain Old C > functions), and automatically generate entry points for another language. > > > > Has anybody created an LPEG grammar capable of parsing a reasonable subset > of C++? > > > > Thanks, > > Ben From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 10:44:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IDiaBo008598; Fri, 18 Sep 2009 10:44:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F8C4193EC; Fri, 18 Sep 2009 10:44:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16AF8193C7 for ; Fri, 18 Sep 2009 10:43:58 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Modkm-0007GY-Tc for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 15:44:00 +0200 Received: from ppp91-78-247-73.pppoe.mtu-net.ru ([ppp91-78-247-73.pppoe.mtu-net.ru]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Sep 2009 15:44:00 +0200 Received: from andrew_zhilin by ppp91-78-247-73.pppoe.mtu-net.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Sep 2009 15:44:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: zOOn Subject: Re: [ANN] Pretty Printer for Lua Date: Fri, 18 Sep 2009 13:43:38 +0000 (UTC) Lines: 25 Message-ID: References: <5915048C-CAF5-4387-B9A8-BCDF5F022C0B@gmail.com> <956373d40909171331k4482b16eh5ae74ab05bf19408@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 91.78.247.73 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.21 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabien gmail.com> writes: > Was there a reason not to start from Metalua's "match" extension, > other than the fun to redo everything from scratch for the sake of it? I do not think that metalua fits better than XTC Rats! + Scala for compiler writing :) I checked metalua in 2007 (version 0.2 alpha, if I recall it right) before I began my work - and didn't find anything vital for my purposes. Front-end was hand-written, pattern-matching algorithm was naive. Most of all I disliked compilation to bytecode only - because of the lack of compatibilty with 5.0.x and LuaPlus (compatibility was essential for me) and tricky debugging (AST dump only). Also, I didn't like that even bytecode had runtime dependencies. BTW, why metalua compiles to bytecode - because of goto? Cheers, Andrew From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 11:50:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IEoYnG025823; Fri, 18 Sep 2009 11:50:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB8ED193D2; Fri, 18 Sep 2009 11:49:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f179.google.com (mail-pz0-f179.google.com [209.85.222.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 828C718FCD for ; Fri, 18 Sep 2009 11:49:48 -0300 (BRT) Received: by pzk9 with SMTP id 9so35608pzk.33 for ; Fri, 18 Sep 2009 07:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=z9bYiKx7MAbPx5IyZoBfiOJ5z+2ug2slpt/bnkUwp28=; b=mXFBMEcszV0jC5KibswNMWf9MYjeLVe10upAiy8guqe/N2s8kjPywcZIW+0sQaZMGR wfDVnA9ShWbavhpXhaSMrwi1R/EFMl9K2X/ciUaoT2xhCU9Pr03pCFpeNpdVseW5HpVq 3Z9gl/GwHCEZhBBt7vmaQu0d/PUV+knsI0sJE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=sE5WC27z4EpNd/WfQGO68cn6i4fdu86/g9VEjmM5A7UyZMEiS1iMEGAEjrEnCk/LII WrhR5OEJOcyaJ87Kq86qSveJxfLwMcD6xmxIajovcrGE9oBMsfDXZN40OaDnRAeC/mej kJXoNq902v/iGd8ENwjnJKjqwKEMoTTeXbFH4= Received: by 10.115.101.25 with SMTP id d25mr2592265wam.46.1253285391215; Fri, 18 Sep 2009 07:49:51 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.23.211]) by mx.google.com with ESMTPS id 23sm555608pzk.4.2009.09.18.07.49.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 18 Sep 2009 07:49:49 -0700 (PDT) Message-ID: <4AB39E06.5080400@gmail.com> Date: Fri, 18 Sep 2009 22:49:42 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Bytecode Reference? References: <20090916173601.A8782@lua.tecgraf.puc-rio.br> <9386fb2d0909180402p1129e722i85a89b8cef0506ae@mail.gmail.com> <81fbe47d0909180426v7ee30a35y30fb4c1c094d0131@mail.gmail.com> In-Reply-To: <81fbe47d0909180426v7ee30a35y30fb4c1c094d0131@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bogdan Marinescu wrote: > Possible? Definitely. Practical? I don't know ... Unless you can find a > way to do other things in hardware too, like floating point operations > (OK, this one isn't that hard), garbage collection, fast table accesses > and others, the whole thing won't probably do much in terms of speed. Yeah, a bit hard to justify stuffing something like that into an FPGA... it's neither here nor there. Many opcodes will have to be trapped and run as short routines. There was picoJava and friends though, but all the stand-alone implementations of Java on silicon have been wiped out and assimilated by ARM+Jazelle. If it was an FPGA, I'd rather grab an ARM soft core, add a fast memory interface and go about porting LuaJIT into the system... :-) > On Fri, Sep 18, 2009 at 2:02 PM, Pierre LeMoine wrote: > > 2009/9/16 Luiz Henrique de Figueiredo: > >> Is there a good reference on what the lua compiler outputs for > bytecode; > >> I'm interested in knowing what codes there are and their general > mode of > >> operation. > > > > See a summary in > > http://www.lua.org/source/5.1/lopcodes.h.html#OP_MOVE > > > > Also, use luac -l to see bytecode listings. > > I've not looked into it(as i dont have a lot of free time), so i'll > just ask here; would it be possible to make a processor which executes > those lua-bytecodes, for example in vhdl? =) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 12:04:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IF4rZA028977; Fri, 18 Sep 2009 12:04:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AACBB192B5; Fri, 18 Sep 2009 12:04:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from xserver.gls.co.za (unknown [196.44.38.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08B0F1929E for ; Fri, 18 Sep 2009 12:04:19 -0300 (BRT) Received: from XSERVER.gls.co.za ([192.168.1.26]) by xserver.gls.co.za ([192.168.1.26]) with mapi; Fri, 18 Sep 2009 17:04:17 +0200 From: Ben Harper To: Lua list Date: Fri, 18 Sep 2009 17:04:07 +0200 Subject: RE: LPEG for C++ Thread-Topic: LPEG for C++ Thread-Index: Aco4Xlnsj2z+7XAZSBaeWSCZsXk+hwAEqMVQ Message-ID: <27BA4145191C1849903386A90FE16D6518E7FA6DA6@xserver.gls.co.za> References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8IF4rZA028977 Thanks! That's exactly what I was looking for. Looks like it parses my existing (small) sources correctly. I'll post further as applicable... -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Peter Cawley Sent: Friday, September 18, 2009 2:48 PM To: Lua list Subject: Re: LPEG for C++ You might be interested in reusing some code I wrote recently. It is a Lua/LPEG creation to parse C++ source files, extract information, and then output it in wiki markup. For example, given a C++ file looking something along the lines of: static int l_map_getsize(lua_State *L) { THMap* pMap = luaT_testuserdata(L); lua_pushinteger(L, pMap->getWidth()); lua_pushinteger(L, pMap->getHeight()); return 2; } // // Then later on: // luaT_class(THMap, l_map_new, "map", iMapMT); luaT_setfunction(l_map_getsize, "size"); // ... luaT_endclass(); The Lua/LPEG script can parse the above, and work out that the Lua class "map" wraps the C++ class "THMap", and that the "size" method on a Lua "map" class calls the "l_map_getsize" glue function, which in turn calls THMap::getWidth and THMap::getHeight. The final output would be the following Google Code wiki markup: === TH.map === Wraps the C++ class *{{{THMap}}}*. || *Lua method* || *C++ function(s)* || *Glue function* || || *{{{size}}}* || *{{{THMap::getWidth}}}*, *{{{THMap::getHeight}}}* || *{{{l_map_getsize}}}* || You can find the source code at http://code.google.com/p/corsix-th/source/browse/trunk/LDocGen/ - there are three Lua files there: c_tokenise.lua - The LPEG grammar for turning a C/C++ file into an array of tokens. Also has code for pretty printing a token array as HTML, but that code can be ignored. helpers.lua - A collection of helper functions. The most important of these is tokens_gfind, which provides functionality similar to string.gmatch - it finds a string of tokens in an array of tokens, ignoring whitespace tokens. main.lua - The actual application logic Let me know if it proves useful, Peter On Fri, Sep 18, 2009 at 12:43 PM, Ben Harper wrote: > I want to parse C++ header files (not for classes, just Plain Old C > functions), and automatically generate entry points for another language. > > > > Has anybody created an LPEG grammar capable of parsing a reasonable subset > of C++? > > > > Thanks, > > Ben From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 12:22:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IFMOH2000428; Fri, 18 Sep 2009 12:22:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4838F19403; Fri, 18 Sep 2009 12:21:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-s01.adinet.com.uy (smtp-s01.adinet.com.uy [200.40.30.61]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F965193FA for ; Fri, 18 Sep 2009 12:21:44 -0300 (BRT) Received: from [192.168.1.10] (190.134.68.253) by smtp-s01.adinet.com.uy (8.5.016.1) (authenticated as fapenia) id 49D1022608765E09 for lua@bazar2.conectiva.com.br; Fri, 18 Sep 2009 12:21:37 -0300 Message-ID: <4AB3A595.9030104@adinet.com.uy> Date: Fri, 18 Sep 2009 12:21:57 -0300 From: =?ISO-8859-1?Q?Fabian_Pe=F1a?= User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: console.dll References: <4AB2A65B.9040308@013net.net> In-Reply-To: <4AB2A65B.9040308@013net.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean if you use c++ , you need #ifdef __cplus_plus extern "C" { #endif #include "lua.h" int luaopen_console (lua_State *L); #ifdef __cplus_plus } #endif int luaopen_console (lua_State *L) { return 0; } and you may need .DEF file EXPORTS luaopen_console Shmuel Zeigerman escribió: > After creating a library named console.dll, I encountered a problem > that was discussed once on the list (see thread [1]). > > The source file for my console.dll is: >> #include "lua.h" >> int luaopen_console (lua_State *L) { return 0; } > > I run >> lua -lconsole > from the directory, where console.dll resides, and get the following: > >> lua: error loading module 'console' from file './console.dll': >> The specified procedure could not be found. >> >> >> stack traceback: >> [C]: ? >> [C]: ? >> [C]: ? > > According to the message, Lua fails to find the procedure in > './console.dll', but that is not true, as in fact it fails on > C:\Windows\system32\console.dll (see [1]). > > BTW, my package.cpath begins with "./?.dll;" > > So it seems that even if the problem itself is hard to resolve, then > at least the error message should be corrected, since it is misleading. > > [1] http://lua-users.org/lists/lua-l/2006-12/threads.html#00047 > From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 12:57:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IFv6t6007466; Fri, 18 Sep 2009 12:57:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E5D1193F7; Fri, 18 Sep 2009 12:56:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BE4219358 for ; Fri, 18 Sep 2009 12:56:20 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so534299ana.26 for ; Fri, 18 Sep 2009 08:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=QS4qs351erQCaWg6SR/ngFqhWGypsCvoP+RcFLxsnAc=; b=cBZsh7l0AutRH1HyMniKHPNfMNL+lOqCTJ8OOQYyGjxQVzyx/UDEaaAqKw8NFE8rtS AHib6p1kP3iqMlLf/ErNdduoclIhPkor8nIMmSsvz09aQLDnKhJ5cqu7OJ7ds/xhnF7o YKdk9+EBXQScakjLZjG0Mwl2eUYkWM9Or5Fb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oon/CvsgSA9tl3/5VLhfNkmObdaMEE3H9Qnyw+AbNVNI1B/VomejCqKi1s5rveEUUJ Xt0IYp1P5TLJKVAXGTl9NPJst9B1QlfUwiPY1H2Ee4agb29k/EKpkeeHCp/tFvOLsV87 1cuGvKCbVLOIozo2zeRypCoEf/msylVjnYiQU= MIME-Version: 1.0 Received: by 10.100.80.7 with SMTP id d7mr1656960anb.43.1253289382335; Fri, 18 Sep 2009 08:56:22 -0700 (PDT) Date: Fri, 18 Sep 2009 10:56:22 -0500 Message-ID: <6f2f15350909180856y62665413i9bc211a0156cda76@mail.gmail.com> Subject: [LuaInterface] Calling lua functions from c# From: Jason Murdick To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I recently started trying to port an older c++ project into c# and I am using LuaInterface 2.x and Lua 5.1. In my c++ project I passed all of my script calls through a single lua function (executeScript) that performed some tasks and error tracking/traceback. The c++ side looked like this: ----------------------------------------------------- luaL_loadfile (ScriptMgr->GetState(), path.c_str()); retcode = lua_pcall(ScriptMgr->GetState(), 0, 1, 0); lua_getglobal(ScriptMgr->GetState(), "executeScript"); lua_pushstring(ScriptMgr->GetState(), script.c_str()); lua_pushboolean(ScriptMgr->GetState(), isFile); retcode = lua_pcall(ScriptMgr->GetState(), 2, 1, 0); ----------------------------------------------------- I am attempting to duplicate this in C#, but I can't figure out how to call the executeScript global using LuaInterface. I have the following: -------------------------------------- pLuaVM.LoadFile(path) LuaFunction lf = (LuaFunction)pLuaVM["executeScript"]; pLuaVM.Push(script); pLuaVM.Push(isFile); lf.Call(); --------------------------------------- LuaFunction lf = (LuaFunction)pLuaVM.GetFunction("executeScript"); Both times I get null for LuaFunction. I'm at a loss and any assistance would be greatly appreciated. Jason From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 13:04:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IG4ktV008850; Fri, 18 Sep 2009 13:04:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 605BB19412; Fri, 18 Sep 2009 13:04:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD230193B1 for ; Fri, 18 Sep 2009 13:04:08 -0300 (BRT) Received: by bwz10 with SMTP id 10so875529bwz.5 for ; Fri, 18 Sep 2009 09:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=ZATob36WoD6vgKeXtELYJ0nr7DM22IoBUkd8+G+MFK4=; b=lzh6qdGLgzPriHZ8vtq194avmwpZhsADmBf2lRZ9NKPu6b0ftCS3tzCGCYAchf53r4 WNXO7WlZtI3s1RI4+pAbenng7Z2ICWZmGF/KsokMelQz8vDXxr5d0END70wa4S9NQkah NL+RUvuXHy4z/uuCIHPCLaFcQGsfmOY3+fvmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=tq/tSCa12aJM1uZ/Hzbszyg51oOvxCOhDcOl1XHZPqj1kJmyq8FE2APTD2/ah9rhiA y/RJFRtFSn6g5YcbOoAIu/22SDtxhSVjNFY/+2PhIuSWl9NnurivH7xS4vOcfulrlpkK L7bZyhNOyWzitf+wDx3uGtwwW60HgDme9GUyo= MIME-Version: 1.0 Received: by 10.223.58.208 with SMTP id i16mr459037fah.22.1253289852565; Fri, 18 Sep 2009 09:04:12 -0700 (PDT) Date: Fri, 18 Sep 2009 12:04:12 -0400 X-Google-Sender-Auth: ee9bb3c547d8445c Message-ID: Subject: Re: First class : (was Re: Regarding the name 'pairs') From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 16 Sep 2009 08:43:56 -0300, Luiz Henrique de Figueiredo wrote: > But tables are used to implement objects and those may want different behaviors. I understand, and I'm suggesting that the object designer provide his own iterator, even if that iterator is just an existing table iterator. This approach hides the implementation of the object a little better. E.g. function makeVector(...) . . . end elements = ipairs v = makeVector(1,2,3,4) for e in elements(v) do print(e) end Once you give your users pairs or ipairs as iterators for your object, you are stuck forever with a particular implementation in which all of the enumerable attributes correspond exactly to the table entries. Since tables are intrinsic in Lua, it's essential to have the basic table functions in the base language (including # and next). And it's easy to make the same case for pairs as well. But perhaps the right "convenience" feature for objects should be an iterator factory named 'values' or 'each' (as already suggested), where the factory function runs the __iter metamethod on whatever object it is given? At least, then, everyone knows how to use the "default iterator" for any object. Objects can have other iterators, but you have to name them yourself when you design your object. If your object's implementation is a table, then setting __iter=pairs or __iter=ipairs in the object's metatable will let you use your choice of the built-in table iterators (via the proposed 'values' or 'each' iterator factory function) without having to expose the (current) implementation of the object. Just my USD$0.02. Jim From lua-bounces@bazar2.conectiva.com.br Fri Sep 18 15:38:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8IIbxCJ010814; Fri, 18 Sep 2009 15:38:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A66E6193F5; Fri, 18 Sep 2009 15:37:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0165A1929A for ; Fri, 18 Sep 2009 15:37:08 -0300 (BRT) Received: by bwz10 with SMTP id 10so970739bwz.5 for ; Fri, 18 Sep 2009 11:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=t6isikTuUrLGoLmizPwVDI7xIMYp9xa+Izvgpycw7o4=; b=qqDo+Noazbl7vgdZM06HXSQgkDZ5jOnEgxbviJ0LXYAI7a/rEU13gb2NNVHIyu+SD5 3nhlYngmEBzYMznHPPvKLM13PqDsrmzwg6F9rNP0KYuXvjehiNA7IjVbCyb1AC2S/jID PsgJqPwyo4FvJk7a5tbWr53MuXl3ITf6A2dwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LwB0s+vXqqsCwXtAMM3b9T3VQiM7h/yDpXLGW7zyT3hdE7kmg4tTR+R+kC8ljDgtar DOvVdjpiv9F+yNUbSVr+ypC6uu9/7JFBhYnUP+zP48p83hFjZeiv63SO1TjrLfZVJ8fM B0htVF+De1hj8kOIybXTtKU88+x1t1gc9A2F0= MIME-Version: 1.0 Received: by 10.204.3.211 with SMTP id 19mr529421bko.36.1253299032870; Fri, 18 Sep 2009 11:37:12 -0700 (PDT) In-Reply-To: <27BA4145191C1849903386A90FE16D6518E7FA6DA6@xserver.gls.co.za> References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> <27BA4145191C1849903386A90FE16D6518E7FA6DA6@xserver.gls.co.za> Date: Fri, 18 Sep 2009 20:37:12 +0200 Message-ID: <9386fb2d0909181137r1cc96a5fva3fc02cf67dafbed@mail.gmail.com> Subject: Re: LPEG for C++ From: Pierre LeMoine To: Lua list Content-Type: multipart/mixed; boundary=0015174be73ca6d4590473de6bef X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174be73ca6d4590473de6bef Content-Type: text/plain; charset=ISO-8859-1 2009/9/18 Ben Harper : > Thanks! > > That's exactly what I was looking for. Looks like it parses my existing (small) sources correctly. > > I'll post further as applicable... I've also made something that parses things... I use popen and gcc to handle #defines and such, then i parse the data it outputs. Actually, i only resolve symbols, sortof. I use my script to do automagic structure/definitions/function loading with Alien, though one could use the output of an earlier stage. A short sample of it's usage is attached. I've also used it to parse a (by me in the script specified) list of functions and create declarations, definitions etc, ie automating some ~50 redirection functions =d If anyone's interested i'd be happy to share. --0015174be73ca6d4590473de6bef Content-Type: application/octet-stream; name="ex.lua" Content-Disposition: attachment; filename="ex.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fzr9r7gb0 DQoNCmdsdWUgPSByZXF1aXJlICJsdWJlbi5wYXJzZXIucGVnLmdsdWUiDQoNCndpbiA9IGdsdWUu R2x1ZSgiQCNpbmNsdWRlIDx3aW5kb3dzLmg+IiwgeyJrZXJuZWwzMiIsICJ1c2VyMzIiLCAiZ2Rp MzIifSwgIi1EIFdJTlZFUj0weDA1MDAgLURfV0lOMzJfV0lORE9XUz0weDA1MDAiKQ0KDQoNCmRv DQoJbG9jYWwgSU5QVVQgPSB3aW4uSU5QVVQNCglsb2NhbCBJbnB1dCA9IElOUFVULm5ldygpDQoJ bG9jYWwgU2VuZElucHV0ID0gd2luLlNlbmRJbnB1dA0KDQoJQ2xpY2tMZWZ0TW91c2UgPSBmdW5j dGlvbigpDQoJCUlucHV0LnR5cGUgPSB3aW4uSU5QVVRfTU9VU0UNCgkJSW5wdXQubWkuZHggPSAw DQoJCUlucHV0Lm1pLmR5ID0gMA0KCQlJbnB1dC5taS5kd0ZsYWdzID0gd2luLk1PVVNFRVZFTlRG X0xFRlRET1dODQoJCUlucHV0Lm1pLnRpbWUgPSAwDQoJCUlucHV0Lm1pLmR3RXh0cmFJbmZvID0g MA0KCQlTZW5kSW5wdXQoMSwgSW5wdXQoKSwgSU5QVVQuc2l6ZW9mKCkpDQoJCUlucHV0Lm1pLmR3 RmxhZ3MgPSB3aW4uTU9VU0VFVkVOVEZfTEVGVFVQDQoJCVNlbmRJbnB1dCgxLCBJbnB1dCgpLCBJ TlBVVC5zaXplb2YoKSkNCgllbmQJDQoNCmVuZA0KDQp3aW4uU2xlZXAoMjAwMCkNCg0Kd2hpbGUg MD09d2luLkdldEFzeW5jS2V5U3RhdGUod2luLlZLX1NQQUNFKSBkbw0KCXdpbi5TbGVlcCg1MDAp DQoJQ2xpY2tMZWZ0TW91c2UoKQ0KZW5kDQo= --0015174be73ca6d4590473de6bef-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 05:24:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8J8O5ci011370; Sat, 19 Sep 2009 05:24:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 889FA18FCC; Sat, 19 Sep 2009 05:23:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59C0C18C55 for ; Sat, 19 Sep 2009 05:23:21 -0300 (BRT) Received: by fxm18 with SMTP id 18so1273614fxm.5 for ; Sat, 19 Sep 2009 01:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=j+5dL9wKFDXF8YeQzH1k7ZJdBB3rlEjK1Yfwha2eRsY=; b=YP58XcZWP4fguTMDot+H5RNEM//pkdtjnw8SyA76TdUssmPrrEAGevUJOklNvP8mmU ZiH6vmxsuDRKHMYBoCD6cU4QOnmlub14ImfEuRFaRodUsNG2o9zKyeaqnpNCdL/oz6PC Z6rePhSI2fCmuJc5+wZt5dbtf31A0pEthZbZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SHc5eWdtiWQvMTSJtL+ftUdrfa6XMtnx0RI4iYaxycwXnpUc4wHylImzN8QUPgBq3L GvHW6MBtrCGNKD9irP/OZYHqtKMafkjQWBpilJMRC6/OV+9Fw9Ep+5ZezCfFviVZquPA ZvkRek3WQDAGE5vf4kANnSmS/WoK1DgJZnc18= MIME-Version: 1.0 Received: by 10.223.24.151 with SMTP id v23mr614313fab.44.1253348605526; Sat, 19 Sep 2009 01:23:25 -0700 (PDT) Date: Sat, 19 Sep 2009 12:23:25 +0400 Message-ID: Subject: [ANN] Luabins 0.1.1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, list! I've released version 0.1.1 of Luabins library. This is a bugfix release to fix handling of holes in the array part of tables. Luabins is a small and simple library called "luabins" to serialize and unserialize trivial Lua values (including tables) into arbitrary binary data format. Luabins is hosted at GitHub: http://github.com/agladysh/luabins/ You may download release 0.1.1 here: http://github.com/agladysh/luabins/raw/tarball-0.1.1/luabins-0.1.1.tar.gz Or you may browse sources online: http://github.com/agladysh/luabins/tree/v0.1.1 Questions and critique are welcome! Alexander. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 05:25:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8J8PVG1011500; Sat, 19 Sep 2009 05:25:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1452919068; Sat, 19 Sep 2009 05:25:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4815B18F56 for ; Sat, 19 Sep 2009 05:25:03 -0300 (BRT) Received: by bwz10 with SMTP id 10so1229264bwz.5 for ; Sat, 19 Sep 2009 01:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=T0RUZq2Hm1/kMCF3S4z+99txxUkfcp+VvwBPh0HCHAk=; b=j/D+TsdrSmbFyS6XBOpeOSsRdf989Zefjo5AdanB/B/6dnnyZiWw+cl2wh39WdjlGt lqPlWz5aU0cwSAGbDl7PYLcdO7bmNBNeX80jzoHk3CZw0d8GLOl8kNQAEbW1n9UiFUXu h9S+y4OlVWot9okNFOW5gse/7KyhvsPNFR/9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OnK/xJ+vqmUg7TS1HCuFLKn2JXKUf73f89XogQafM0ye9TMHL3JPZPOQ95jxS7SBN5 XAWs+QzTNk9lD9AKhiUcy663FyuwS35nvpn73j4KohZBwmSGrzV/Q2KBpjMnP8TMG0Jd mUSftp5I/KqUHEo8OE+I8bEM5uDpkVr+vUsTg= MIME-Version: 1.0 Received: by 10.223.102.130 with SMTP id g2mr281497fao.52.1253348707774; Sat, 19 Sep 2009 01:25:07 -0700 (PDT) In-Reply-To: References: Date: Sat, 19 Sep 2009 12:25:07 +0400 Message-ID: Subject: Re: [ANN] Luabins 0.1.1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I've released version 0.1.1 of Luabins library. This is a bugfix > release to fix handling of holes in the array part of tables. Addendum: I'd like to thank Alexander Fedora and Dmitry Potapov for pinning down this bug. Thank you! Alexander. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:17:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JAHFjH020138; Sat, 19 Sep 2009 07:17:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB87D190D1; Sat, 19 Sep 2009 07:16:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9633018C2F for ; Sat, 19 Sep 2009 07:16:36 -0300 (BRT) Received: by bwz10 with SMTP id 10so1258073bwz.5 for ; Sat, 19 Sep 2009 03:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=3Hh3sTbwJn8koNosuz9uPlk6spr3ORf9yP73crhckNU=; b=lTFHe7HUX1vxgGfzM1tQaXP8HIHtKPXj0K1BEgGYU92z6h2GhY+dRE9fuhp8LCkeaU DD8B1oLNmCEuUt/zN0jiSlnpnnqMPviyACvs/w6r4BEx3smBCaQpOOjMDI46ylab8YDg rQrb02gAzRDuYDQlqYBw6WJ76e8nrWzwsAIbM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=X0JuJIYj2F/VV3t+Fm/OpJEKfS75UOrEhzN2dwlv1ZqEKRImEwdajexC05FiOz58Sj RWWev8mWAFtT2ySGPkICICQL7YzwTcF6cB+QfPKCyk9cXFn6gno7j/f+lW5D4vIwXdcG lIFJle54mlwq89PCYVhUWvb/PHB446BEDOC+0= MIME-Version: 1.0 Received: by 10.204.15.22 with SMTP id i22mr2364007bka.13.1253355400908; Sat, 19 Sep 2009 03:16:40 -0700 (PDT) Date: Sat, 19 Sep 2009 12:16:40 +0200 Message-ID: <560972290909190316r79a98259ncb3a3efe213b2064@mail.gmail.com> Subject: [ANN] Lua FAQ updated From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, http://batbytes.com/luafaq Thanks particularly this time to Jacob Jay for contributing and Jeff Pohlmeyer for proofreading, and of course to Patrick Donnelly for hosting this document. A change in the layout is now that you may directly refer to the sections, so that http://batbytes.com/luafaq/#T1.18 will take you to the section on variable scoping (where I now mention the 'local by default' question.) The item numbering is now expected to remain stable. The C API section could do with more entries, since it appears that most of the questions here on the list are about it. E.g. the question 'What is Userdata?' could do with a good answer. steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:25:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JAPVeu020697; Sat, 19 Sep 2009 07:25:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A178F1917B; Sat, 19 Sep 2009 07:25:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C984819104 for ; Sat, 19 Sep 2009 07:24:57 -0300 (BRT) Received: by bwz10 with SMTP id 10so1260255bwz.5 for ; Sat, 19 Sep 2009 03:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=4k3F+JSb5USIh0yCPqFxuZ4/s/VeG1LDHBQN4wuvV+k=; b=CcGuRLZO0f54Mp5jtxoGbQfZMHMiDnfueJ0E5B2TwftocRO7ZQcR11/2YrUqB7H1eh caYM81IxIy0PbKt9eeB7QQljPk6FW+k4dCMIDMGxQy6MlbF6eot/QzznWCASyBTnhqrH yBkXqq3daYHsv/G8LYJWrFlMGtoBVnZ+rh0Hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nbZTR4L/49Q1YEckfH+jZS6+iHqhmvbK9XJR94S/wJFuUSoJEHEtCSoHiYaXzYPxsk vlGi1yiQ+tH0N6VDDtpZX+JUi698cYSxErUj7cwOKLQYw8zwQXayshMxmDr1lvJg2v76 /jX0K870B7KSOEjExKQYdx1p5pVBGYa5/OyEw= MIME-Version: 1.0 Received: by 10.204.155.67 with SMTP id r3mr2380298bkw.94.1253355900878; Sat, 19 Sep 2009 03:25:00 -0700 (PDT) Date: Sat, 19 Sep 2009 12:25:00 +0200 Message-ID: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Subject: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've been chatting to Yuri (of Sputnik fame) about the mechanics of putting up a searchable 'Lua recipes' site. (Originally the word was 'snippets' but 'recipe' seems more friendly and the former term has a specialized meaning in the MS dev universe) So far the conversation has been about tagging, searching and some idea of user interface, but the question here is this: would this be a useful resource that people would be motivated to _contribute_ to? The usefulness of such a thing depends strongly on the quantity (and quality) of the recipes. So, what's the thinking? These are some links of sites we were looking at: [1] http://www.delphidabbler.com/codesnip [2] http://code.activestate.com/recipes/576901/ steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:28:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JASOYB021072; Sat, 19 Sep 2009 07:28:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62D1E191F2; Sat, 19 Sep 2009 07:27:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F85419169 for ; Sat, 19 Sep 2009 07:27:52 -0300 (BRT) Received: by fxm18 with SMTP id 18so1309956fxm.5 for ; Sat, 19 Sep 2009 03:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=6uuLfR2xXhu5My4R7GFhqHDJr7/bKdN9+7i1d9uphWY=; b=l0hOsXcnGrpYcuJCzjWJGI3pBemEQTLc/3cS7u4HVG6SmMI5oZZkBisux9l81VJWX0 Y1cn0AUp7dKRijvsW+ix/e5/zyXS8BDrkt9N9fb9Vj+f8df1JIsjmH9vH2yNS/n0yB9Q ngjAwVQPKoGWRhNzwd4m7Te4uSbPFjsnv53Cc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=RG8PAnTIKQ5adKxPNLo1uGs8NufPoPCP36QFvkN20aqE7sBYbcMGK/rEHw+OA36iD8 hFVegukEinKlPamTfzF3T6RF92Rn7iVmdlIHPYG0WU+LLS491WwNJ8ceN8uLa3wfcYTv qxtpEN44KmV4bZwA5KUyXoPrJraXKLMo1Kc7I= MIME-Version: 1.0 Received: by 10.223.58.208 with SMTP id i16mr616372fah.22.1253356076109; Sat, 19 Sep 2009 03:27:56 -0700 (PDT) In-Reply-To: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> From: Jim Whitehead II Date: Sat, 19 Sep 2009 11:27:36 +0100 Message-ID: <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JASOYB021072 On Sat, Sep 19, 2009 at 11:25 AM, steve donovan wrote: > I've been chatting to Yuri (of Sputnik fame) about the mechanics of > putting up a searchable 'Lua recipes' site. (Originally the word was > 'snippets' but 'recipe' seems more friendly and the former term has a > specialized meaning in the MS dev universe) > > So far the conversation has been about tagging, searching and some > idea of user interface, but the question here is this:  would this be > a useful resource that people would be motivated to _contribute_ to? > The usefulness of such a thing depends strongly on the quantity (and > quality) of the recipes. It would take me a very small amount of time to put up a system for snippets (even with the few enhancements), given that I already have a basic site up for wowprogramming [1]. Additionally, I could also host the site in the longer term. The question is, does this detract from LuaWiki at all? [1]: http://wowprogramming.com/snippets From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:37:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JAb3U4021699; Sat, 19 Sep 2009 07:37:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 182501928F; Sat, 19 Sep 2009 07:36:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8E8E1926C for ; Sat, 19 Sep 2009 07:36:32 -0300 (BRT) Received: by bwz10 with SMTP id 10so1263172bwz.5 for ; Sat, 19 Sep 2009 03:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TOBI5ZJTeoCNVoRnKsuuQHXrz1/VUC4EsNLfMut36yQ=; b=nz1ts49kjnE5+BbvCRtVVhB8STaw0VOmJ+uBQnLyHm8xndM3nbGVlxfkNd9i+5zMp+ hsB1ZBxaKekgxJAPzzeWMDDHb3tPUDOtwPzOPgjwIJJDIquiGpuhQsCJqSoXZzQWXDcD KukrkIbPXMalPeorMsxun7oRTOUQateaHZYpI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IO1ICYi7PHYrmDAN6r0yhQ39JbZdIJ64Rxxbl0HfO5x81ZUJO9C/PCPuXVzAJ0iZIj zvsIBAL5kXZxiDGXwGOCoCM3IhaXzvqtmrV2GpeLiqlgFOFVk+0G3YhwCc/mTmRpNBRc ceKJQXbLzoVw9FAzovo1l8rsh/eyYDdRMOHqw= MIME-Version: 1.0 Received: by 10.204.8.79 with SMTP id g15mr2345238bkg.202.1253356595824; Sat, 19 Sep 2009 03:36:35 -0700 (PDT) In-Reply-To: <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> Date: Sat, 19 Sep 2009 12:36:35 +0200 Message-ID: <560972290909190336o2f2dba74j2af250820707602a@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JAb3U4021699 On Sat, Sep 19, 2009 at 12:27 PM, Jim Whitehead II wrote: > Additionally, I could also host the site in the longer term.  The > question is, does this detract from LuaWiki at all? The Wiki is very good at being a repository of articles, since it's so easy to create a page. But it is not auto-structuring ;) It was hard (for instance) to push the Wiki Lua FAQ further because the wiki engine cannot generate ToCs automatically. It remains an excellent general resource, whereas a snippets database is more specialized, optimized towards finding code. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:40:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JAe3ek022337; Sat, 19 Sep 2009 07:40:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D37C31929A; Sat, 19 Sep 2009 07:39:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F4781926C for ; Sat, 19 Sep 2009 07:39:35 -0300 (BRT) Received: by bwz10 with SMTP id 10so1263874bwz.5 for ; Sat, 19 Sep 2009 03:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=uYmvLg+bZDPYaRY7EdDo0ruxajhhHtEUDulQdpqNoT0=; b=BEXXJ5rspctVv52lZeDZC2HJmwEZLl8lmMjSCGaFkx3hleDJMR65rYw/IybWRnOhC3 DswS9bgj2fEgD1bVFrD10apIU/stvYVDFqOghxwRRXK2yb2NPpGpNeZW3e7sbPpDT4+6 KngsTCenXtEltAYZkdY/Iu3ZvndgYxlv8TKbw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=FJAC5QrZweDTgJPSdhC69qlJZEnm8ExKwgBId9ioyVUF0VS++tSciymQ8OVZrwiBB6 8Bn+grgdGIsi2Rl/XJRXF0/x77Hu0KVvDZS5g8DLt1ndAWeybb4DwlDnJcRZCJJmMAH7 9YNTxkT+gJgLlEUR5/L/GNTw0IS4bSquAKS8g= MIME-Version: 1.0 Received: by 10.223.57.210 with SMTP id d18mr603625fah.106.1253356779143; Sat, 19 Sep 2009 03:39:39 -0700 (PDT) In-Reply-To: <560972290909190336o2f2dba74j2af250820707602a@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> <560972290909190336o2f2dba74j2af250820707602a@mail.gmail.com> From: Jim Whitehead II Date: Sat, 19 Sep 2009 11:39:19 +0100 Message-ID: <5fe281d40909190339l1a656d2dj35013222372807aa@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JAe3ek022337 On Sat, Sep 19, 2009 at 11:36 AM, steve donovan wrote: > On Sat, Sep 19, 2009 at 12:27 PM, Jim Whitehead II wrote: >> Additionally, I could also host the site in the longer term.  The >> question is, does this detract from LuaWiki at all? > > The Wiki is very good at being a repository of articles, since it's so > easy to create a page. But it is not auto-structuring ;)  It was hard > (for instance) to push the Wiki Lua FAQ further because the wiki > engine cannot generate ToCs automatically. > >  It remains an excellent general resource, whereas a snippets database > is more specialized, optimized towards finding code. I happen to agree, I just wanted to raise the question ;-) - Jim From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 07:51:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JAp4k1023529; Sat, 19 Sep 2009 07:51:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 212D419297; Sat, 19 Sep 2009 07:50:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36AA719131 for ; Sat, 19 Sep 2009 07:50:30 -0300 (BRT) Received: by fxm18 with SMTP id 18so1316316fxm.5 for ; Sat, 19 Sep 2009 03:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=l/kzoc9SzI8gjUvyzHfg6QL92cElzCvMsAahKwt47F0=; b=kvoimUlDYxT0mT3j7TyXMATdSEA7vRqM18AwOlK9X8RJeb0RM+uDxdkQp33iBHr8jK rWSiHS4vcII0pCESl/3hkD3WI7p383AClhJ7Sl1V7aHwdEdl0CeNbZaLU+pXPc1jvIRt /wMq/8wCntpdLQBkbVaE0/BwDocMTk8GaHh+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rPejPs053ev4cPOn5JYbPFM4o8T9uGNA2xiP4nyTFcXX/BZaQWpvnsWo6nYc8pzLpw zrb1QwjOaG9rXVAtTYEI0uoEz+zdV/pJl90/AZKihPbpCELLfo8/HhhGnwj4UaRcY54P dd+1URSYWXVJswQzA798iT+wcEDb/Rg38J6WY= MIME-Version: 1.0 Received: by 10.204.34.73 with SMTP id k9mr2412314bkd.45.1253357434852; Sat, 19 Sep 2009 03:50:34 -0700 (PDT) In-Reply-To: <5fe281d40909190339l1a656d2dj35013222372807aa@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> <560972290909190336o2f2dba74j2af250820707602a@mail.gmail.com> <5fe281d40909190339l1a656d2dj35013222372807aa@mail.gmail.com> Date: Sat, 19 Sep 2009 11:50:34 +0100 Message-ID: <4db9cacb0909190350x33958f40o6a0aa5613a686537@mail.gmail.com> Subject: Re: Lua Recipes Site? From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JAp4k1023529 2009/9/19 Jim Whitehead II : > On Sat, Sep 19, 2009 at 11:36 AM, steve donovan > wrote: >> On Sat, Sep 19, 2009 at 12:27 PM, Jim Whitehead II wrote: >>> Additionally, I could also host the site in the longer term.  The >>> question is, does this detract from LuaWiki at all? >> >> The Wiki is very good at being a repository of articles, since it's so >> easy to create a page. But it is not auto-structuring ;)  It was hard >> (for instance) to push the Wiki Lua FAQ further because the wiki >> engine cannot generate ToCs automatically. >> >>  It remains an excellent general resource, whereas a snippets database >> is more specialized, optimized towards finding code. > > I happen to agree, I just wanted to raise the question ;-) > I have dozens to hundreds of snippets which would be useful to me and probably others hosted on a site somewhere. Many are too insignificant for the wiki, I feel. Also the system would be a total success or failure on the search system (indexing code isn't easy, and tags can grow out of hand). But no harm in throwing something up to see how people use it. Matthew From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 08:25:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JBPFN3026808; Sat, 19 Sep 2009 08:25:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5228B1929D; Sat, 19 Sep 2009 08:24:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7BA818A5F for ; Sat, 19 Sep 2009 08:24:40 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Moy3X-0007uL-2x for lua@bazar2.conectiva.com.br; Sat, 19 Sep 2009 13:24:43 +0200 Received: from adsl87-47.kln.forthnet.gr ([77.49.54.47]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Sep 2009 13:24:43 +0200 Received: from petsagouris by adsl87-47.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Sep 2009 13:24:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: Lua Recipes Site? Date: Sat, 19 Sep 2009 11:24:22 +0000 (UTC) Lines: 14 Message-ID: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 77.49.54.47 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan gmail.com> writes: > > So far the conversation has been about tagging, searching and some > idea of user interface, but the question here is this: would this be > a useful resource that people would be motivated to _contribute_ to? > The usefulness of such a thing depends strongly on the quantity (and > quality) of the recipes. > That would be a really nice idea. I would love to see the ability to get statistics on visits for the recipes, comments, additions, alternative versions and voting aside from the searching functionality. That way this can get quite engaging as far as the contribution is concerned. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 11:06:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JE6lYd007683; Sat, 19 Sep 2009 11:06:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B610618FCD; Sat, 19 Sep 2009 11:06:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F29DD18D88 for ; Sat, 19 Sep 2009 11:06:03 -0300 (BRT) Received: by bwz10 with SMTP id 10so1321574bwz.5 for ; Sat, 19 Sep 2009 07:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=iwCLdGSmxUels+BWaJogC9WnounE0f61xl23BDqLwMI=; b=QPGCE77NmN1cLBsdEnNh+DzaqyVd/NhdHQgIX2jhM+WmBycqZinur80OxAgf7kgR0W wAKsoVLLrtvlYMU25tyuOjlSG8FLnQ6/LJhplldkRleGZCntsWqfVC7B0PuHLgDK8XeO P8IyVzTAI1YR2++hoFyxE3flRNu6wrW0pwfTg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NUYvorCEvMgVyPhQ7V90Y3OYyjWqInkB1+1uwT+K+MEC5nTHgEeN6KOB7v+OemGXYP po1i4JkiE/o/ybs4mUPD86DRH28QQ0gHBeWWkLzFjGH42qOcgdrh8oKLOa/H3VIub6Pf aWr+GOzNNGArCYma1X2A7r3haHZ0UpiVd//Jo= MIME-Version: 1.0 Received: by 10.204.29.24 with SMTP id o24mr2483066bkc.85.1253369167906; Sat, 19 Sep 2009 07:06:07 -0700 (PDT) In-Reply-To: <4db9cacb0909190350x33958f40o6a0aa5613a686537@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> <560972290909190336o2f2dba74j2af250820707602a@mail.gmail.com> <5fe281d40909190339l1a656d2dj35013222372807aa@mail.gmail.com> <4db9cacb0909190350x33958f40o6a0aa5613a686537@mail.gmail.com> Date: Sat, 19 Sep 2009 16:06:07 +0200 Message-ID: <560972290909190706m229953b4wf19744632ff7ce9e@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 19, 2009 at 12:50 PM, Matthew Wild wrote: > for the wiki, I feel. Also the system would be a total success or > failure on the search system (indexing code isn't easy, and tags can > grow out of hand). This is the crucial point, useful tagging. After a while, you get one of those unmanageable tag clouds, where some recipes are tagged 'fles', others 'file', and so forth. > But no harm in throwing something up to see how people use it. No harm, yes, but something that looks like it was thrown up might not give a good impression ;) steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 11:55:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JEt1SF012361; Sat, 19 Sep 2009 11:55:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78EE7192A1; Sat, 19 Sep 2009 11:54:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9447818FF0 for ; Sat, 19 Sep 2009 11:54:19 -0300 (BRT) Received: by ywh28 with SMTP id 28so2197417ywh.11 for ; Sat, 19 Sep 2009 07:54:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.148.16 with SMTP id a16mr1869307ago.119.1253372064590; Sat, 19 Sep 2009 07:54:24 -0700 (PDT) In-Reply-To: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sat, 19 Sep 2009 17:54:24 +0300 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > So, what's the thinking? Neat! I was thinking about the exact same thing, but also for full libraries and even applications. Ideally it will integrate the best ideas of all the code repos out there, none of which seem to close the circle (that's why some projects have the project homepage on lua wiki, sources on github or luaforge, rockspec on luarocks main repo, etc.). About the motivation for contribution: I think the greatest obstacle for contribution is not internal motivation, it's the interface -- that is, the lengths you have to go to finally contribute something -- It's never easy and ever boring and distracting from your goals. Make contribution easy and you're guaranteed to have it flowing. Most wikis flourish because of that. I started a discussion about this topic on a different community some time ago[1]. That being said, here's my list of ingredients: 1) for small code snippets: - sections on a snippet page: description, snippet itself, comments, unit testing, usage examples, tags, cross-categories. - have any section edited like any wiki page by anyone without login - but keep changelog and provide a diff tool. - online lua interpreter for testing snippets and running usage examples/unit tests. - mark snippets according to success/failure of unit tests. - any text section (description, comments) is wiki-markup so it can reference other snippets, etc. 2) for one-file pure-lua libraries: - extract luadoc, globals, etc. and make an editable API doc. section. 3) for bigger, multi-file projects: - project wiki (entire wiki, not just a wiki page -- other projects will be referenced to as interwiki links) -- most important, as questions, requests, reviews and changes of any part of the project will be localized and worked out only between interested parties, unlike in a mailing list. - git repo with as many frontends as possible (sftp, html code browsing, etc.) or just leave it all to github in the first phase. - ... a lot more, to make it easier to join bigger projects and start contributing. Finally, the whole website will be a pure-lua project, self-hosted so that people can add more features easily and see the results immediately. That means a pluginable architecture like [2] and a sandbox version into which people can try out their plugins. [1] http://tech.groups.yahoo.com/group/Firebird-general/message/10089 [2] http://docs.wikkawiki.org/ExtensibleInfo From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 12:19:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JFJ9cn014622; Sat, 19 Sep 2009 12:19:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1450192B2; Sat, 19 Sep 2009 12:18:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78A2D188F8 for ; Sat, 19 Sep 2009 12:18:34 -0300 (BRT) Received: by ywh28 with SMTP id 28so2211163ywh.11 for ; Sat, 19 Sep 2009 08:18:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.154.4 with SMTP id g4mr1905934ago.60.1253373519330; Sat, 19 Sep 2009 08:18:39 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sat, 19 Sep 2009 18:18:39 +0300 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My previews thoughts apply to LuaFAQ too, as I can see no easy way to contribute to it, except mailing the contributor. IMHO a wiki page would had been much better, and ToC generation is a non-issue. I think it's way easier to copy-paste the section's title lower in the text than to write an email to the maintainer explaining where/what I want changed. Not to mention the futility of the work of the maintainer in such case, which could be fully automated. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 12:23:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JFNRgr015082; Sat, 19 Sep 2009 12:23:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64DEE192C1; Sat, 19 Sep 2009 12:23:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.bytecamp.net (mail.bytecamp.net [212.204.60.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B10C8189C7 for ; Sat, 19 Sep 2009 12:22:54 -0300 (BRT) Received: (qmail 38288 invoked by uid 89); 19 Sep 2009 17:22:59 +0200 Received: from unknown (HELO ?10.11.12.33?) (jo%wwsnet.net@95.89.242.204) by mail.bytecamp.net with AES256-SHA encrypted SMTP; 19 Sep 2009 17:22:59 +0200 Message-ID: <4AB4F752.5040608@subsignal.org> Date: Sat, 19 Sep 2009 17:22:58 +0200 From: Jo-Philipp Wich User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Strange luac segmentation fault References: <4AAAC638.3090100@subsignal.org> In-Reply-To: <4AAAC638.3090100@subsignal.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=834F4CF3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Looks like recompiling Lua with -O1 fixes the issue. Regards, JoW -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq091IACgkQdputYINPTPMFcwCeNODF6+D3G08OyCyhZe+hhiUF 1LYAni1IR5UHqnnjXJEjbfyWr3uGdINN =0e7S -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 12:41:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JFfsDW016735; Sat, 19 Sep 2009 12:41:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD25D192C7; Sat, 19 Sep 2009 12:41:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3033192B4 for ; Sat, 19 Sep 2009 12:41:15 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so779808ana.26 for ; Sat, 19 Sep 2009 08:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=sykVDR1LievOre9tsYZJuZ1NSdrAJdFCOseJppZ0pgs=; b=Zgu6Xa7MMG/SH1ThEr0JsP9y+CTMhCSfGBUlstbPpY0oYLnBk0OtDQOyytnHl0lV4g sUOXt5gG6xnDGolC0+ShN1zjeHTveAxA+wH/FwLoiGhRzICVyw5y3XJ+IxlDoSlrPJ9L 6Ehv0aBzUfDAWyqjxxs6iTlSt6fRafYJzT6Hk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JDWdjhGQrJh27DtjL7KUMCZTSJvY//EHzmMu1gxWh28Phu/oXJOyxysst1Acd1UN63 XYMpM7SryCKt7nt5ZqaP2IFB/mHWY6CCGZi79JbqdAoKanEz9mgehbgmJ5HC7ZB/J00i tXv30ip619R3pCwde1kVS4GkYI4M3EKR2Oxq0= MIME-Version: 1.0 Received: by 10.101.81.8 with SMTP id i8mr2804474anl.185.1253374880677; Sat, 19 Sep 2009 08:41:20 -0700 (PDT) Date: Sat, 19 Sep 2009 12:41:20 -0300 Message-ID: Subject: Lua Performance questions From: zweifel To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636ed73d0887ff10473f014b8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed73d0887ff10473f014b8 Content-Type: text/plain; charset=ISO-8859-1 Hello Guys! In my game project I decided to execute actions in Lua by calling other functions in C to interact with the physics and other core systems. The Problem: the Lua actions are executed every frame or so by all characters, these I read in http://www.citengineering.com/LuaVIEW/performance.html that could be expensive. The question: Would it be reasonable to create a hash table with the Chunks already read instead of doing luaL_dofile? Or does Lua already does these inside of it in some implicit way? Thanks, zweifel --001636ed73d0887ff10473f014b8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Guys!

In my game project I decided to execute actions in Lua b= y calling other functions in C to interact with the physics and other core = systems.

The Problem: the Lua actions are executed every frame or s= o by all characters, these I read in http://www.citengineering.com/LuaVIEW/performa= nce.html that could be expensive.

The question: Would it be reasonable to create a hash table with the Ch= unks already read instead of doing luaL_dofile? Or does Lua already does th= ese inside of it in some implicit way?

Thanks,
zweifel
--001636ed73d0887ff10473f014b8-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 12:53:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JFr66a018014; Sat, 19 Sep 2009 12:53:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 828FA192CF; Sat, 19 Sep 2009 12:52:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F42C191EE for ; Sat, 19 Sep 2009 12:52:34 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JFqdH1017972 for ; Sat, 19 Sep 2009 12:52:39 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8JFqco21856; Sat, 19 Sep 2009 12:52:38 -0300 Date: Sat, 19 Sep 2009 12:52:37 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Performance questions Message-ID: <20090919125237.A21848@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from zweifel@gmail.com on Sat, Sep 19, 2009 at 12:41:20PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The question: Would it be reasonable to create a hash table with the Chunks > already read instead of doing luaL_dofile? Or does Lua already does these > inside of it in some implicit way? require dfoes caching but you can do it manually as well. See http://stackoverflow.com/questions/1369646/do-file-only-once-in-lua/1371085#1371085 From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 13:16:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JGGnJF020356; Sat, 19 Sep 2009 13:16:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B707A19319; Sat, 19 Sep 2009 13:16:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2874B192C8 for ; Sat, 19 Sep 2009 13:16:11 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so785552ana.26 for ; Sat, 19 Sep 2009 09:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=saPDxVnucOsxEp4yKmfdYUN9ClOlHO/aZC7yZyXmOf8=; b=Ooju3F5gY0C9sx5Wh+JCC3IFnurbP1Cd6NArd5AGN88YZlS2KDqLiyNWFOpx9zR26D m2t8wql+Vbqo8nuItiHuibgUcKfWRNiKt6oNjZL59570CjgE8kKNoI29FcyLSX7hwmwW yw7izq6F64496rGfz1or4lu9W63dmoq9fXnnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bBHyDuCnOnr2E4yD4JICQygfMfaMKyaqZoUiXdUkH7cyCI3Bzj0CjjiwxhkcWj4Ecm eNIeW/2rPpgtSyEu8PmUCv53xYvBkq69lHfZQUswzbiEyjXcpOon8AgUUUchq8Spf7No PYAi3f1lE7BByjiyF9w32Z/yVyCb7z/O/buFU= MIME-Version: 1.0 Received: by 10.101.49.11 with SMTP id b11mr2863446ank.121.1253376974749; Sat, 19 Sep 2009 09:16:14 -0700 (PDT) In-Reply-To: <20090919125237.A21848@lua.tecgraf.puc-rio.br> References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> Date: Sat, 19 Sep 2009 13:16:14 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636ed6a3659805a0473f09101 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed6a3659805a0473f09101 Content-Type: text/plain; charset=ISO-8859-1 hmm, these are a good solution when I just want to run the script once. But in my case I do want to run the Lua script every frame. I just wanted to know if I should bother with a hash_table and luaL_loadbuffer or just use luaL_dofile because Lua already does some caching of files that was already read before. 2009/9/19 Luiz Henrique de Figueiredo > > The question: Would it be reasonable to create a hash table with the > Chunks > > already read instead of doing luaL_dofile? Or does Lua already does these > > inside of it in some implicit way? > > require dfoes caching but you can do it manually as well. See > > http://stackoverflow.com/questions/1369646/do-file-only-once-in-lua/1371085#1371085 > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636ed6a3659805a0473f09101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hmm, these are a good solution when I just want to run the script once.
But in my case I do want to run the Lua script every frame. I just wan= ted to know if I should bother with a hash_table and luaL_loadbuffer or jus= t use luaL_dofile because Lua already does some caching of files that was a= lready read before.


2009/9/19 Luiz Henrique de Figueiredo <lhf@tecgraf.p= uc-rio.br>
> The question: Would it be reasonable to create a has= h table with the Chunks
> already read instead of doing luaL_dofile? Or does Lua already does th= ese
> inside of it in some implicit way?

require dfoes caching but you can do it manually as well. See
=A0 =A0 =A0 =A0http://stackoverflow= .com/questions/1369646/do-file-only-once-in-lua/1371085#1371085



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636ed6a3659805a0473f09101-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 13:25:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JGPJbU021566; Sat, 19 Sep 2009 13:25:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B49F5192D1; Sat, 19 Sep 2009 13:24:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57DAE192B9 for ; Sat, 19 Sep 2009 13:24:46 -0300 (BRT) Received: by ewy26 with SMTP id 26so2155266ewy.5 for ; Sat, 19 Sep 2009 09:24:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.53.205 with SMTP id g55mr746464wec.160.1253377490351; Sat, 19 Sep 2009 09:24:50 -0700 (PDT) In-Reply-To: References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> Date: Sat, 19 Sep 2009 17:24:50 +0100 X-Google-Sender-Auth: 96766480ef9b3bc6 Message-ID: Subject: Re: Lua Performance questions From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 19, 2009 at 5:16 PM, zweifel wrote: > hmm, these are a good solution when I just want to run the script once. > > But in my case I do want to run the Lua script every frame. I just wanted to > know if I should bother with a hash_table and luaL_loadbuffer or just use > luaL_dofile because Lua already does some caching of files that was already > read before. If you want to run a script multiple times, then load it once (lua_load, luaL_loadbuffer, luaL_loadfile, etc.), save the result (a Lua function) somewhere, and then run it (lua_call / lua_pcall) multiple times. You should assume that reading a file is expensive, and that the parsing done by lua_load (and other load functions which all call lua_load) is also expensive - avoid calling any load function per frame, and avoid even more load functions which read files. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 13:32:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JGWN21022153; Sat, 19 Sep 2009 13:32:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 613EE192E8; Sat, 19 Sep 2009 13:31:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70DFF192C5 for ; Sat, 19 Sep 2009 13:31:49 -0300 (BRT) Received: by bwz10 with SMTP id 10so1368445bwz.5 for ; Sat, 19 Sep 2009 09:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8RaQlVCo3t8JZunYXA6gHiLUkXq64eSkmdw+uCJNn/A=; b=FIZABrjAZfwI4rzfAI6s0fjsfYNN6oNDY54HBS5uvocraVrRzKOkzZ9wNhSLuHkspU 2L1r7/Hes1mXCEIaSVGGfNtLH8pJTs2DnEmzhV1NuHyEunEO8tfdhzKmj5V4+BN3DRnM 8py0/eQc6BPKzn9XT0TIF4kpSjc+HyypPKRP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iUFu6vqtAPRuPkCz1H6zStxJdf+tMbXn4Ix6mHbgO7iOLfPv+98mIj1QqqHMVuRknh ZVxcV56NqliprNTIdVDNUvbqC5QxJ6kuJAs6Ydp9Dfo+xbZ2QxOaZPfGDW+9Wu+2P0m+ cVAQQiF4BsFSCEaaLivo7YvOSuX2CdFqohNzY= MIME-Version: 1.0 Received: by 10.223.58.208 with SMTP id i16mr659991fah.22.1253377912539; Sat, 19 Sep 2009 09:31:52 -0700 (PDT) In-Reply-To: <5fe281d40909190921p42e341fev60a85e19bf5951d9@mail.gmail.com> References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> <5fe281d40909190921p42e341fev60a85e19bf5951d9@mail.gmail.com> Date: Sat, 19 Sep 2009 17:31:52 +0100 Message-ID: <5fe281d40909190931k3f6e1294q90ab969406c9da75@mail.gmail.com> Subject: Re: Lua Performance questions From: Jim Whitehead II To: Lua list Content-Type: multipart/alternative; boundary=0015174760aa3f101f0473f0c9a2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174760aa3f101f0473f0c9a2 Content-Type: text/plain; charset=ISO-8859-1 Do you need changes to the script to be picked up immediately, or can you watch for changes to the filesystem and on change, recompile the script? In this way, you could avoid doing something costly each frame. On Sep 19, 2009 5:16 PM, "zweifel" wrote: hmm, these are a good solution when I just want to run the script once. But in my case I do want to run the Lua script every frame. I just wanted to know if I should bother with a hash_table and luaL_loadbuffer or just use luaL_dofile because Lua already does some caching of files that was already read before. 2009/9/19 Luiz Henrique de Figueiredo > > > The question: Would it be reasonable to create a hash table with the Chunks > > already read ... -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --0015174760aa3f101f0473f0c9a2 Content-Type: text/html; charset=ISO-8859-1

Do you need changes to the script to be picked up immediately, or can you watch for changes to the filesystem and on change, recompile the script? In this way, you could avoid doing something costly each frame.

On Sep 19, 2009 5:16 PM, "zweifel" <zweifel@gmail.com> wrote:

hmm, these are a good solution when I just want to run the script once.

But in my case I do want to run the Lua script every frame. I just wanted to know if I should bother with a hash_table and luaL_loadbuffer or just use luaL_dofile because Lua already does some caching of files that was already read before.


2009/9/19 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>

> > > The question: Would it be reasonable to create a hash table with the Chunks > > already read ...




--
God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/

--0015174760aa3f101f0473f0c9a2-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 13:50:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JGojYG023727; Sat, 19 Sep 2009 13:50:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71DC21935D; Sat, 19 Sep 2009 13:50:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3939219351 for ; Sat, 19 Sep 2009 13:50:08 -0300 (BRT) Received: by yxe37 with SMTP id 37so1886054yxe.33 for ; Sat, 19 Sep 2009 09:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=A4YwIKVbIEMh5rFXEY2P5Liw9A8vWa5UqMVPlrwj4x4=; b=KRLEBS7g0khRPpUpAKouJ3+J5zHofYU49Zgtg5QrLt8P5LpvfVIu/2iiX+wge1w0fG 1t2hh3sFHhF4t5qxiawhl8xLojo5vkHJjAYTKr6bhzZEsUJlbFBzzc3iIDyPrWI2wxLB myKhwlazjQdusC/lOecEQlFudBKymhYFe08DY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Mo1ba+q4ZWoPcOtS6z/tD0w12XHDeBwi4nKM6MWZjCKtbFa6/F6SIZX63iqWnB2x8+ c3BJBP7NUnDtutvfqRSzzbEheD+0x0cWI2uLCDVlkJKdD2PzIL6PVfdFrSESwluwSEcd Z1UqegOf+wDYPTDp/LOme92qSXU9xsf2Vmu+A= MIME-Version: 1.0 Received: by 10.101.63.5 with SMTP id q5mr2838965ank.82.1253379010507; Sat, 19 Sep 2009 09:50:10 -0700 (PDT) In-Reply-To: References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> Date: Sat, 19 Sep 2009 13:50:10 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636eee26db0b2550473f10a55 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636eee26db0b2550473f10a55 Content-Type: text/plain; charset=ISO-8859-1 Ok, so I wil create a Hash with the name and the function loaded in the stack by the luaL_load. I know there is some functions called readChunck or something similar that only reads the chunck and return it, so that I do not need to read from the stack. Thanks! 2009/9/19 Peter Cawley > On Sat, Sep 19, 2009 at 5:16 PM, zweifel wrote: > > hmm, these are a good solution when I just want to run the script once. > > > > But in my case I do want to run the Lua script every frame. I just wanted > to > > know if I should bother with a hash_table and luaL_loadbuffer or just use > > luaL_dofile because Lua already does some caching of files that was > already > > read before. > > If you want to run a script multiple times, then load it once > (lua_load, luaL_loadbuffer, luaL_loadfile, etc.), save the result (a > Lua function) somewhere, and then run it (lua_call / lua_pcall) > multiple times. You should assume that reading a file is expensive, > and that the parsing done by lua_load (and other load functions which > all call lua_load) is also expensive - avoid calling any load function > per frame, and avoid even more load functions which read files. > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636eee26db0b2550473f10a55 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok, so I wil create a Hash with the name and the function loaded in the sta= ck by the luaL_load. I know there is some functions called readChunck or so= mething similar that only reads the chunck and return it, so that I do not = need to read from the stack.

Thanks!

2009/9/19 Peter Cawley <lua@corsix.org>
On Sat, Sep 19, 2009 at 5:16 PM, zweifel <zweifel@gmail.com> wrote:
> hmm, these are a good solution when I just want to run the script once= .
>
> But in my case I do want to run the Lua script every frame. I just wan= ted to
> know if I should bother with a hash_table and luaL_loadbuffer or just = use
> luaL_dofile because Lua already does some caching of files that was al= ready
> read before.

If you want to run a script multiple times, then load it once
(lua_load, luaL_loadbuffer, luaL_loadfile, etc.), save the result (a
Lua function) somewhere, and then run it (lua_call / lua_pcall)
multiple times. You should assume that reading a file is expensive,
and that the parsing done by lua_load (and other load functions which
all call lua_load) is also expensive - avoid calling any load function
per frame, and avoid even more load functions which read files.



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636eee26db0b2550473f10a55-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 13:53:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JGrseQ024041; Sat, 19 Sep 2009 13:53:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 006921891C; Sat, 19 Sep 2009 13:53:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB8A818866 for ; Sat, 19 Sep 2009 13:53:18 -0300 (BRT) Received: by yxe37 with SMTP id 37so1887651yxe.33 for ; Sat, 19 Sep 2009 09:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Y91+9KK4pQVEYBXI+dHeh0vk9XQizhz7rLp5xx9ALX4=; b=Urlnb1Z9sTRQwkb2ccYa84hZmyskuVvHp1GHlXOG2qocdXoH9faJXRcSh8gdrw1m+F tAHoxC3WSNhrmwYSEQDqPoJiXHCjiRIjKT8PmlipK9bw8b8ZK1RF3TMvT1SxOfDEJkZs CujX3CO21/uOVwk+2476LYy+DFNjXptkC9X08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NZTNts5/QFsyj6lGyPuh6MMhcn26fdjoTZAynIO/N0KkGxZ6HhzIzzY3Jx2ZqXCXgH hXQw2snOH5eTh3drp/eQc8b5jmSzMrmlfU3U4qgYB0TP/ZBfPBxi8Ub0tAnXwl4PN4p5 JEASBLu/XkKe7Dhrg6C1hLEM2Xfy+hsw41eXw= MIME-Version: 1.0 Received: by 10.100.233.19 with SMTP id f19mr2923257anh.72.1253379201516; Sat, 19 Sep 2009 09:53:21 -0700 (PDT) In-Reply-To: <5fe281d40909190931k3f6e1294q90ab969406c9da75@mail.gmail.com> References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> <5fe281d40909190921p42e341fev60a85e19bf5951d9@mail.gmail.com> <5fe281d40909190931k3f6e1294q90ab969406c9da75@mail.gmail.com> Date: Sat, 19 Sep 2009 13:53:21 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636b2b48e1347100473f11623 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b48e1347100473f11623 Content-Type: text/plain; charset=ISO-8859-1 @Jim Whitehead II I am actually not expecting changes to occur in the script, but only executing a script procedure every frame. It would be commonly coded in C/C++ (as it is now), but in Lua I would have more flexibility for tweaking things and if I am able to make it not so expensive, I could have both advantages. 2009/9/19 Jim Whitehead II > Do you need changes to the script to be picked up immediately, or can you > watch for changes to the filesystem and on change, recompile the script? In > this way, you could avoid doing something costly each frame. > > On Sep 19, 2009 5:16 PM, "zweifel" wrote: > > hmm, these are a good solution when I just want to run the script once. > > But in my case I do want to run the Lua script every frame. I just wanted > to know if I should bother with a hash_table and luaL_loadbuffer or just use > luaL_dofile because Lua already does some caching of files that was already > read before. > > > 2009/9/19 Luiz Henrique de Figueiredo > > > > > The question: Would it be reasonable to create a hash table with the > Chunks > > already read ... > > > > -- > God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus > > http://fog.neopages.org/ > > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636b2b48e1347100473f11623 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable @Jim Whitehead II

I am actually not expecting changes to occur in t= he script, but only executing a script procedure every frame. It would be c= ommonly coded in C/C++ (as it is now), but in Lua I would have more flexibi= lity for tweaking things and if I am able to make it not so expensive, I co= uld have both advantages.

2009/9/19 Jim Whitehead II <jnwhiteh@gmail.com>

Do you need changes to the script to be picked up immediately, or can yo= u watch for changes to the filesystem and on change, recompile the script? = In this way, you could avoid doing something costly each frame.

On Sep 19, 2009 5:16 PM,= "zweifel" <zweifel@gmail.com> wrote:

hmm, these are a good solution= when I just want to run the script once.

But in my case I do want to run the Lua script every frame. I just want= ed to know if I should bother with a hash_table and luaL_loadbuffer or just= use luaL_dofile because Lua already does some caching of files that was al= ready read before.


2009/9/19 Luiz H= enrique de Figueiredo <lhf@tecgraf.puc-rio.br>

= > > > The question: Would it be reasonable to create a hash table with = the Chunks > > already read ...




--
God$ g++ -o earth earth.cpp -O3 = -lanimals -lplants -lvirus

http://fog.neopages.org/



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636b2b48e1347100473f11623-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 14:01:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JH150e024826; Sat, 19 Sep 2009 14:01:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2BEA192F7; Sat, 19 Sep 2009 14:00:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FBD9188AE for ; Sat, 19 Sep 2009 14:00:30 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so792100ana.26 for ; Sat, 19 Sep 2009 10:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=WRfRJOWvCKMbFIK/8KPdRThBs+srTI5qEU79EBTJOpg=; b=dF8jv10gFpvYIWJ8x8UtQiDLB5R4oRrmARNRVDTlbU9AJRWQImODIaKMhmL3CSh7VM GYH7p5sjIa51MKkgHDldDMumsKWgxWk42tBl9Y0JNl0hq+XguezaofFGKcLxSnTxfPid v46HpxmdoL3RCUqg2l1XUiSyPLe216dBKqpEc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HzNfPvXXvtXXtNt2mV2AsVADpm+7lOiFZ1qQmaCmZV10Ne0g0Fxga+MCIxEZ2+IHPt K+hzfBFLuS3+dp4U5dl/RJ5PNnBw74es2st68X8sjYW7+JilE3TrnWcP5p6+5UfIBFrD cCkW4Ue9dt21AKEYiFKuIWdroFFXI42E8fBpQ= MIME-Version: 1.0 Received: by 10.101.57.4 with SMTP id j4mr2900396ank.104.1253379635411; Sat, 19 Sep 2009 10:00:35 -0700 (PDT) Date: Sat, 19 Sep 2009 18:00:35 +0100 Message-ID: <86a6bb870909191000sd8b04f1rab22462ae6872cc7@mail.gmail.com> Subject: Passing table as vararg ( newbie question ) From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=001636ed7421effadd0473f12f3b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed7421effadd0473f12f3b Content-Type: text/plain; charset=ISO-8859-1 I just want to get access to var2 and var3. Foo ( var1, { var2, "var3" } ) function Foo( firstvar, ... ) local v1, v2 = ... -- says that v1 (var2) is a table :( -- test to see how deep this table goes -- causes infinite loop local table1 = ... while ( type( table1 ) == "table" ) do local x, y = table1 table1 = x print( "\nanother table" ) end end What's going on here? Why can't I access var2 and var3? I'm sure I'm making some simple mistake. I tried {{table1}} but that made no difference. Any ideas? --001636ed7421effadd0473f12f3b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I just want to get access to var2 and var3.

F= oo ( var1,= =A0
{ var2, "var3" }
)

function Foo( firstvar, ... )
local v1, v2 =3D .= .. -- says that v1 (var2) is a table :(

-- test to see how deep this table goes
-- causes infinite= loop
local table1 =3D ...
while ( type( table1 ) =3D=3D "table" ) d= o
local x, = y =3D table1
table1 =3D x=A0
print( "\nanother table" )
end
end

What's going on here? Why can'= ;t I access var2 and var3? I'm sure I'm making some simple mistake.= I tried {{table1}} but that made no difference. Any ideas?
--001636ed7421effadd0473f12f3b-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 14:04:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JH4JgT025186; Sat, 19 Sep 2009 14:04:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7ED0019357; Sat, 19 Sep 2009 14:03:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DC33189E1 for ; Sat, 19 Sep 2009 14:03:47 -0300 (BRT) Received: by fxm18 with SMTP id 18so1437992fxm.5 for ; Sat, 19 Sep 2009 10:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xqSG+tvg0NouAx/cjHxfqGsVZfeeoa6uHotC3w0A+PY=; b=Lh4ef2S2lH69PLN/ualBfpYZQiLf1/9VptD80amQnpZGTImLrlExh6MuJueL2gGX4T LXWX/RdTCVpxDMmW1jL/6fd6Ut5f16/hCoMBsJjjo4ig+BSStNRxzoseIk6KBEFHA+Ue fpTMb0Q0dlhfiuLWCaT9o7O7qHolPpbvKae/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KSBW5BxB6Q7a5jWma6KiVVdN50vTs0qRTbuV1t9Vnf9jBmi81mCK1iEQW9RObnitLu RG+2TQ7ONnzkfx95NHd/IOPYmJR6aHho8EHR+96IvVV3K6H/9Pe21qQdaQmdCZblDhd3 9YF9TgtAnwoRbdcfkcVyoWj2WOMK+h5otZTA8= MIME-Version: 1.0 Received: by 10.223.144.70 with SMTP id y6mr670103fau.21.1253379832293; Sat, 19 Sep 2009 10:03:52 -0700 (PDT) In-Reply-To: <86a6bb870909191000sd8b04f1rab22462ae6872cc7@mail.gmail.com> References: <86a6bb870909191000sd8b04f1rab22462ae6872cc7@mail.gmail.com> Date: Sat, 19 Sep 2009 18:03:52 +0100 Message-ID: <65dfa39c0909191003w5bab651ck3075c80174f938e8@mail.gmail.com> Subject: Re: Passing table as vararg ( newbie question ) From: Shaun McVey To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean How about changing: local x,y = table1 to local x,y = unpack(table1) When you do local x, y = table1, all you're doing is assigning x the first expression on the right side of the assignment (the table) and y to nil. On Sat, Sep 19, 2009 at 6:00 PM, Colm Sloan wrote: > I just want to get access to var2 and var3. > Foo ( var1, > { var2, "var3" } > ) > function Foo( firstvar, ... ) > local v1, v2 = ... -- says that v1 (var2) is a table :( > -- test to see how deep this table goes > -- causes infinite loop > local table1 = ... > while ( type( table1 ) == "table" ) do > local x, y = table1 > table1 = x > print( "\nanother table" ) > end > end > What's going on here? Why can't I access var2 and var3? I'm sure I'm making > some simple mistake. I tried {{table1}} but that made no difference. Any > ideas? From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 14:08:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JH8B2o025565; Sat, 19 Sep 2009 14:08:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCBB91936F; Sat, 19 Sep 2009 14:07:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48E6E1932D for ; Sat, 19 Sep 2009 14:07:41 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id C340F38494DDE for ; Sun, 20 Sep 2009 00:07:44 +0700 (NOVST) Message-ID: <007f01ca394b$b444ab10$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <86a6bb870909191000sd8b04f1rab22462ae6872cc7@mail.gmail.com> Subject: Re: Passing table as vararg ( newbie question ) Date: Sun, 20 Sep 2009 00:07:41 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 20 Sep 2009 00:07:44 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Use call Foo (var1, unpack({var2, "var3"})) or use function Foo( firstvar, tablevar) local v1, v2 = tablevar[1], tablevar[2] ----- Original Message ----- From: Colm Sloan To: Lua list Sent: Sunday, September 20, 2009 12:00 AM Subject: Passing table as vararg ( newbie question ) I just want to get access to var2 and var3. Foo ( var1, { var2, "var3" } ) function Foo( firstvar, ... ) local v1, v2 = ... -- says that v1 (var2) is a table :( -- test to see how deep this table goes -- causes infinite loop local table1 = ... while ( type( table1 ) == "table" ) do local x, y = table1 table1 = x print( "\nanother table" ) end end What's going on here? Why can't I access var2 and var3? I'm sure I'm making some simple mistake. I tried {{table1}} but that made no difference. Any ideas? From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 14:12:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JHCcXr026066; Sat, 19 Sep 2009 14:12:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC465192AA; Sat, 19 Sep 2009 14:12:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA2D718BB1 for ; Sat, 19 Sep 2009 14:12:05 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id E24C738494ABF for ; Sun, 20 Sep 2009 00:12:10 +0700 (NOVST) Message-ID: <008001ca394c$53629db0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <20090919125237.A21848@lua.tecgraf.puc-rio.br> Subject: Re: Lua Performance questions Date: Sun, 20 Sep 2009 00:12:11 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 20 Sep 2009 00:12:10 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Also, consider a more usual solution. Here is a rough example just to illustrate it: 1) Use dofile for all Lua scripts in Scripts directory when your program loads 2) In scripts declare event handlers, like function OnFrame() ... end (if there can be only one OnFrame function) or table.insert(OnFrame, funciton() ... end) (to have many OnFrame event handlers) 3) Call OnFrame from your program This way you can put many functions in one script, scripts can have initialization code and you can change event handlers under some circumstances (like, setting OnFrame = MoveHandler when a charecter is about to move). ----- Original Message ----- From: Peter Cawley To: Lua list Sent: Saturday, September 19, 2009 11:24 PM Subject: Re: Lua Performance questions On Sat, Sep 19, 2009 at 5:16 PM, zweifel wrote: > hmm, these are a good solution when I just want to run the script once. > > But in my case I do want to run the Lua script every frame. I just wanted > to > know if I should bother with a hash_table and luaL_loadbuffer or just use > luaL_dofile because Lua already does some caching of files that was > already > read before. If you want to run a script multiple times, then load it once (lua_load, luaL_loadbuffer, luaL_loadfile, etc.), save the result (a Lua function) somewhere, and then run it (lua_call / lua_pcall) multiple times. You should assume that reading a file is expensive, and that the parsing done by lua_load (and other load functions which all call lua_load) is also expensive - avoid calling any load function per frame, and avoid even more load functions which read files. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 15:32:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JIWY79001816; Sat, 19 Sep 2009 15:32:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4282E19351; Sat, 19 Sep 2009 15:32:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 783A3192C8 for ; Sat, 19 Sep 2009 15:31:54 -0300 (BRT) Received: by iwn1 with SMTP id 1so1061807iwn.11 for ; Sat, 19 Sep 2009 11:31:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.126.8 with SMTP id a8mr2301887ibs.15.1253385117279; Sat, 19 Sep 2009 11:31:57 -0700 (PDT) In-Reply-To: References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> Date: Sat, 19 Sep 2009 14:31:57 -0400 X-Google-Sender-Auth: a43af5136c2c8c5b Message-ID: Subject: Re: LPEG for C++ From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 18, 2009 at 8:48 AM, Peter Cawley wrote: > You might be interested in reusing some code I wrote recently. It is a > Lua/LPEG creation to parse C++ source files, extract information, and > then output it in wiki markup. For comparison, there's another LPeg-based C tokenizer at [1]. There may be some issues using a C tokenizer as is on C++. For example, '::' is a C++ only token. Peter's supports that (mine doesn't) though doesn't appear to specially mark C++ keywords like 'try' and 'class' for example. Reliably parsing, not just lexing, C++ is no small feat. gccxml was discussed previously on this list [3]. See also [4]. Using the xml output option from Doxygen may be a fairly accessible solution that's good enough. [1] http://lua-users.org/wiki/LpegRecipes [2] http://www.gccxml.org/ [3] http://lua-users.org/lists/lua-l/ [4] http://stackoverflow.com/questions/526797/good-tools-for-creating-a-c-c-parser-analyzer From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 15:46:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JIktns003223; Sat, 19 Sep 2009 15:46:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C92919372; Sat, 19 Sep 2009 15:46:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68D1C18BB2 for ; Sat, 19 Sep 2009 15:46:20 -0300 (BRT) Received: by yxe37 with SMTP id 37so1939932yxe.33 for ; Sat, 19 Sep 2009 11:46:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=95Mj6Bm7xnRVdGwVx0oMmtK1mqNtGftozd6gXHTuKp4=; b=VchDWFBW9dH0qBa/9q6CnPL0nF9iUjyzTPGClHxarSjHdtGoKZewzjDmO1tpvtk4ph 5Jy4niaXxfiqmKDJbb7gpVSsvVWV9EHQcjv9SRFO9dYkxEs6B6WWZKm2jPWXF2wS7O/U wZ97CAbCq3x8htLddFnan5eVOfU4yJjQYWR0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=S79LuNZDQsbp0LPsJHDDGsxaCwcLjloJ3GA9XQejli1+KrocEkLwPmlynedumDZ+T8 pFcwH7DhEWRKDra54Bi+VS/+7O1gHHjKBdRm7kIzzyqjxBH05EgqYYRGcwxlySErHS4P XmUNNaGfCqCbC23+NtETsgNti1bHxJBCkZ6S8= MIME-Version: 1.0 Received: by 10.150.235.8 with SMTP id i8mr5473018ybh.329.1253385985659; Sat, 19 Sep 2009 11:46:25 -0700 (PDT) In-Reply-To: References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> Date: Sat, 19 Sep 2009 11:46:25 -0700 Message-ID: <1079b050909191146s66c070c4u101ba7776c397f12@mail.gmail.com> Subject: Re: LPEG for C++ From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JIktns003223 Here's a start on a C parser. Mostly useful for lists of expression statements without things like structs, or branching/looping code: http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/matrixfx/parser.lua wes On Sat, Sep 19, 2009 at 11:31 AM, David Manura wrote: > On Fri, Sep 18, 2009 at 8:48 AM, Peter Cawley wrote: >> You might be interested in reusing some code I wrote recently. It is a >> Lua/LPEG creation to parse C++ source files, extract information, and >> then output it in wiki markup. > > For comparison, there's another LPeg-based C tokenizer at [1].  There > may be some issues using a C tokenizer as is on C++.  For example, > '::' is a C++ only token.  Peter's supports that (mine doesn't) though > doesn't appear to specially mark C++ keywords like 'try' and 'class' > for example. > > Reliably parsing, not just lexing, C++ is no small feat.  gccxml was > discussed previously on this list [3].  See also [4].  Using the xml > output option from Doxygen may be a fairly accessible solution that's > good enough. > > [1] http://lua-users.org/wiki/LpegRecipes > [2] http://www.gccxml.org/ > [3] http://lua-users.org/lists/lua-l/ > [4] http://stackoverflow.com/questions/526797/good-tools-for-creating-a-c-c-parser-analyzer > From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 15:47:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JIladG003355; Sat, 19 Sep 2009 15:47:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA3401937F; Sat, 19 Sep 2009 15:47:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A265219379 for ; Sat, 19 Sep 2009 15:47:07 -0300 (BRT) Received: by ywh28 with SMTP id 28so2322332ywh.11 for ; Sat, 19 Sep 2009 11:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=USNQ2Fi1M6XoRD90Sc1OPHJwqThj2qzRb6OSVhrxw80=; b=ZKKNlecDXNfmDtxsvFI0nJp76SWLFKHIzEFoY9rWdpAsyFVh1gj2sLB61uPDQN67U+ SYfhguyuPvtzKjE+m6UyFVuADi43HT0zpzGEaTkv6gCrEPyje079Tlgwf0IpNWv21CMc 3XSKFXibsbuQjGwfVWfXoKesXgAP3NebL3HN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=M2/Xpu4QaGhX/fVeE22oEBJl1MwyHL0H+eVaIJ0WiAollhbA8l/ANQJj/BN0n2b+yG FRcJwdth8BMPioRMuDKc6Yl0mOojYaFOpPNqy9nsyPSi4RzlBVvRA5ywfI7JnUsiWY3W LLNLmcg5RYhp5p5d2mjte0o+XaVTyrpTAQ3HA= MIME-Version: 1.0 Received: by 10.150.193.13 with SMTP id q13mr5528756ybf.153.1253386031229; Sat, 19 Sep 2009 11:47:11 -0700 (PDT) In-Reply-To: <1079b050909191146s66c070c4u101ba7776c397f12@mail.gmail.com> References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> <1079b050909191146s66c070c4u101ba7776c397f12@mail.gmail.com> Date: Sat, 19 Sep 2009 11:47:11 -0700 Message-ID: <1079b050909191147p71bd792i5bb2480b7fc4b16@mail.gmail.com> Subject: Re: LPEG for C++ From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean PS, what would be amazing is an Antlr -> LPEG grammar conversion tool. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 16:01:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JJ1o6H004624; Sat, 19 Sep 2009 16:01:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4DA90192FB; Sat, 19 Sep 2009 16:01:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3AE5192D9 for ; Sat, 19 Sep 2009 16:01:17 -0300 (BRT) Received: by yxe37 with SMTP id 37so1946375yxe.33 for ; Sat, 19 Sep 2009 12:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=t8tHqENQnHjX2fDG1dVHzlX6cSqnQSpa4+poJRdCaFQ=; b=Rsr4w94ElzHCXvbhPE70yK6ScBpVGWvwAigR3piROqnQh0tJwxWa9e5CBh1Gim7kEy yWzbSXld3a0mCN1BjXcbd27XMdUUpZdYFIZOJxEyjsyiQFTlClIWXSTwGgWpE7qaE0fC BxNHBpp5YcXCGGUy+vLjht+4F2EEjSkxNuJoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PBiJu2iGBu5RrfZwX8QhYeI2szVcw3oPc9UZXLc7Yb24tNQMw7JaubCCRoUPNmc46J xg/3qelwqdB64GbfECvSWCgztDtT2S9B5HiE5ORRTkc8q+MSomSidcdeizBk57sUEu6s dVlmpqDgpm+nHaZMzj/Sg765KAB/cj7I/2efs= MIME-Version: 1.0 Received: by 10.101.33.8 with SMTP id l8mr2931276anj.167.1253386882409; Sat, 19 Sep 2009 12:01:22 -0700 (PDT) In-Reply-To: <007f01ca394b$b444ab10$6600a8c0@sat3> References: <86a6bb870909191000sd8b04f1rab22462ae6872cc7@mail.gmail.com> <007f01ca394b$b444ab10$6600a8c0@sat3> Date: Sat, 19 Sep 2009 20:01:22 +0100 Message-ID: <86a6bb870909191201m32babe05yea2d777a944767ae@mail.gmail.com> Subject: Re: Passing table as vararg ( newbie question ) From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=0016367b6280e467aa0473f2dfcf X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016367b6280e467aa0473f2dfcf Content-Type: text/plain; charset=ISO-8859-1 Oh, I hadn't come across that function. I'm surprised I've gotten this far without knowing it. Thanks to both of you for the quick reply :) --0016367b6280e467aa0473f2dfcf Content-Type: text/html; charset=ISO-8859-1 Oh, I hadn't come across that function. I'm surprised I've gotten this far without knowing it. Thanks to both of you for the quick reply :) --0016367b6280e467aa0473f2dfcf-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 16:03:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JJ3Jfn004820; Sat, 19 Sep 2009 16:03:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66F9419383; Sat, 19 Sep 2009 16:02:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A57A5192D9 for ; Sat, 19 Sep 2009 16:02:46 -0300 (BRT) Received: by fxm18 with SMTP id 18so1475795fxm.5 for ; Sat, 19 Sep 2009 12:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=aA/mGUpsR0fg/66L9Jnv+rujsSOUte48fuC1ml/UP2I=; b=Ot5kDWqUQoLIzQqW3nl7ow/O5sJdOqKZZpvDijegPJszIUyXKbO4HHJBSeP8JEyOzZ 8kYU8HpxCb3auh5YGZ6g8xFDc9nOAzQk06kKWA+ii3j3GKgTEvdjvyFHH06SnojQZNlc YVBurBkvcu98xsPJujv+zQ3/QFhvdb0PK9YF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kleR/ql+r9ZNqM2WVISQnYLLEPHJNyAcQ8lf03RnYI828nxaZHxKq874vmc4BL49wS miuAZDzg2JAT4d/c7duLtlU++t3oO8uAkGlAoFPSxaPqUGJ+2o0KoBCkKEFVHSODtrFm EYnxYOemHEd3UXki6d8qxpFI4fcmzUfl6qfK8= MIME-Version: 1.0 Received: by 10.204.5.75 with SMTP id 11mr2697516bku.20.1253386971391; Sat, 19 Sep 2009 12:02:51 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sat, 19 Sep 2009 21:02:51 +0200 Message-ID: <560972290909191202x72cc9f61n8073763147c2e3ae@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 19, 2009 at 1:24 PM, George Petsagourakis wrote: > That would be a really nice idea. I would love to see the ability to > get statistics on visits for the recipes, comments, additions, alternative > versions and voting aside from the searching functionality. > That way this can get quite engaging as far as the contribution is concerned. I think it's best to start simple, because it has to be easy for a contributor to add a new recipe without too much bureaucracy. A comments section (see the ActiveState recipes site for an example) is a must From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 16:12:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JJC1ML005635; Sat, 19 Sep 2009 16:12:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A504019374; Sat, 19 Sep 2009 16:11:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 500F319363 for ; Sat, 19 Sep 2009 16:11:28 -0300 (BRT) Received: by bwz10 with SMTP id 10so1415192bwz.5 for ; Sat, 19 Sep 2009 12:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=D3V2O6/i3/2LqVv0YDPhxPdvCegw+Nk3zbcycFLzElE=; b=ix4cftKQLKxBlMq0M+DRZaX1EgbMY/x/ONFWFun7J97rvbZ6duztYa9R+LA3Mil8mi UJ1zknoth5RoWX9l1dBXL+qBpmlpL7TCVyoBfmVFjKhYSQdJ+r0ULH08M4SuzH6eSqYz sJO+M7jGzKPIpfuGLKbHYovS0RSro5Vgg08Tg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wnBkz3guFWVKj+cpr1UkOZsMjOeUxWw9mFKAWYF9WIDAgnegsZEchLQgns4FlaPNqI Hsp1Moef2PGrazkxYsz2pv0ww3M6onI9AyKe5YW0xNO44j7daS9/Z3cS8OnN38Xam4qy +JXPJytO9lDiOQOXchZYkLcnrSEGTD4/w2fFI= MIME-Version: 1.0 Received: by 10.204.160.85 with SMTP id m21mr2690704bkx.175.1253387493360; Sat, 19 Sep 2009 12:11:33 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sat, 19 Sep 2009 21:11:33 +0200 Message-ID: <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 19, 2009 at 4:54 PM, Cosmin Apreutesei > Neat! I was thinking about the exact same thing, but also for full > libraries and even applications. Ideally it will integrate the best > ideas of all the code repos out there, none of which seem to close the > circle (that's why some projects have the project homepage on lua > wiki, sources on github or luaforge, rockspec on luarocks main repo, > etc.). I know when I want to get out a small contribution I won't go through the luaforge route, but will put up the tarball somewhere and just use the wiki for the homepage. It's appropriate for small projects. > About the motivation for contribution: I think the greatest obstacle > for contribution is not internal motivation, it's the interface -- > that is, the lengths you have to go to finally contribute something -- It can be suprisingly awkward! So, if you had a hundred lines of code that did one thing well, then releasing it as a recipe will make sense if it is as simple as editing a wiki, and maybe adding some tags. Small chunks of code have better reuse potential than large frameworks. > 1) for small code snippets: > - sections on a snippet page: description, snippet itself, comments, > unit testing, usage examples, tags, cross-categories. These are fine, but when they become compulsory, it becomes bureaucracy again. > - have any section edited like any wiki page by anyone without login - > but keep changelog and provide a diff tool. That seems the best thing (don't know about 'without login'?) People will choose various options for their 'flagship' projects, Luaforge, Google code, etc. But we need a home for the little examples which illuminate the code landscape for the rest of us. steve d. From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 17:02:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JK29SU009811; Sat, 19 Sep 2009 17:02:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 728831938E; Sat, 19 Sep 2009 17:01:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8323419385 for ; Sat, 19 Sep 2009 17:01:29 -0300 (BRT) Received: by iwn1 with SMTP id 1so1076019iwn.11 for ; Sat, 19 Sep 2009 13:01:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.9.33 with SMTP id j33mr5146037ibj.37.1253390493531; Sat, 19 Sep 2009 13:01:33 -0700 (PDT) In-Reply-To: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sat, 19 Sep 2009 16:01:33 -0400 X-Google-Sender-Auth: 3a1e6107c46467a8 Message-ID: Subject: Re: Lua Recipes Site? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8JK29SU009811 On Sat, Sep 19, 2009 at 6:25 AM, steve donovan wrote: > I've been chatting to Yuri (of Sputnik fame) about the mechanics of > putting up a searchable 'Lua recipes' site.... > [1]  http://www.delphidabbler.com/codesnip A lot of us have been advocating package management practices for modules (e.g. LuaRocks). But what should we do about single isolated functions (e.g. a string split function [1])? Like modules, these functions can benefit, in terms of reusability, from unit tests, metadata, versioning, and a unique versioned URI for citation. For convenience, we usually deploy these entities differently via manual copy/paste + a citation comment rather than via luarocks install + require. It's also preferable for these functions to be published easily and rapidly via the web, not distracting users with the package management tasks like building and extracting tarballs and setting up tools. The Lua wiki indeed serves some of the above purpose. It does lack strong versioning and traceability (the wiki in fact eventually throws away history). The embedding of code in a wiki page is somewhat unstructured too. Given a Lua Recipes site, wiki pages remain useful and could cite the recipes via some structured tag, e.g. [LuaRecipe:12345], and the wiki might even download and display that snippet in-line. The Lua recipes site could translate recipes to LuaRocks packages that can be loaded via "foo = require 'luarecipes.id12345'", it could expose them in an svn repository, and it could index LuaRocks repositories to cross-reference modules that cite the recipes (which also can be used for ranking popularity). These services can be transparent to web users and don't need to be implemented immediately. A fundamental question is what is a recipe. The rockspec format [2] may provide a starting point. For example, a recipe has a unique identifier, an author/maintainer, a license, and a description (or external URL). A recipe may be immutable. A recipe may supersede or provide an alternative to another recipe, and these relationships may be navigated. A recipe may have unit tests that can be executed in a standard way (e.g. automatically by the Lua Recipes site in a sandbox). The code may depend on other recipes or LuaRocks modules. A recipe may be tagged with categories. Some recipes may be pure Lua, while others may involve C, some may be single functions, while others may be multiple files, and the user might want to filter results based on these qualities. [1] http://lua-users.org/wiki/StringRecipes [2] http://www.luarocks.org/en/Rockspec_format From lua-bounces@bazar2.conectiva.com.br Sat Sep 19 19:43:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8JMhEbh023048; Sat, 19 Sep 2009 19:43:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4011718CA1; Sat, 19 Sep 2009 19:42:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0192618C30 for ; Sat, 19 Sep 2009 19:42:28 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so839088ana.26 for ; Sat, 19 Sep 2009 15:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=OlfOMxONKKXGIRBmT1stKQOKga2t7a1QLCF/oUjTHj4=; b=XF4DFhU2t6YtIc7YcNlb06JsmTucZIh0wCKG57/ydToGAYYyskC3cQJge8+2puawDw kqmIZWU1TzX+BCFgaHeXTTtwldaNvajdvW19rLomv1VOZRxkhv+3YvNsnzXc6ziGsIY2 +fEKJ4AF1tmsovjPKwNqtNcAA/iss7teyBFQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=VxXimfk2ES4CZKSPFc6wP5Fzk3Jh3crXSftf14PNIMRM7hRDW+kfr9I6RGPivCdklR tYAw38bhPM4LXS331dMZn8u7LSMhS9UyrAzquOeMd32xanhYkAOO46+tqhvoT0WfdWr8 foTNWgSeRz+qFUNwVrqEZ9SCGMqjbSWFlEmG4= MIME-Version: 1.0 Received: by 10.101.111.14 with SMTP id o14mr3066264anm.83.1253400153226; Sat, 19 Sep 2009 15:42:33 -0700 (PDT) In-Reply-To: <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> Date: Sat, 19 Sep 2009 18:42:33 -0400 X-Google-Sender-Auth: 27e9028866700f40 Message-ID: Subject: Re: Lua Recipes Site? From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > It would take me a very small amount of time to put up a system for > snippets (even with the few enhancements), given that I already have a > basic site up for wowprogramming [1]. > > [1]: http://wowprogramming.com/snippets Perhaps the thing to do is to start with a clone of this, adding a field for tags (as a comma-separated list) and appending a forum-style discussion each snippet's page (which should be easy now). We could also add syntax highlighting, since this is now available. We can then spend some time thinking about what enhancements are really needed while actually trying to use the system. We can start with a fairly open setup and then think, for example, if it's necessary to introduce additional controls, for example making the recipes immutable or only editable by the original author. - yuri From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 01:15:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8K4FeU5018191; Sun, 20 Sep 2009 01:15:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6734F191E8; Sun, 20 Sep 2009 01:15:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6254519172 for ; Sun, 20 Sep 2009 01:15:00 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoBACJJtUp8qXsd/2dsb2JhbAAIzRKEGwWCPQ X-IronPort-AV: E=Sophos;i="4.44,417,1249228800"; d="scan'208";a="504532727" Received: from unknown (HELO [10.1.1.2]) ([124.169.123.29]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 20 Sep 2009 12:15:01 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: Lua Performance questions From: Jacques Chester In-Reply-To: Date: Sun, 20 Sep 2009 12:14:59 +0800 Content-Transfer-Encoding: 7bit Message-Id: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> References: To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 19/09/2009, at 11:41 PM, zweifel wrote: > The Problem: the Lua actions are executed every frame or so by all > characters, these I read in http://www.citengineering.com/LuaVIEW/performance.html > that could be expensive. Have you profiled your code? That's the first step to knowing if it matters or not. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 03:24:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8K6Od3P027769; Sun, 20 Sep 2009 03:24:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4DDD818A25; Sun, 20 Sep 2009 03:24:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D984C18959 for ; Sun, 20 Sep 2009 03:23:59 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MpFq3-00026m-LR for lua@bazar2.conectiva.com.br; Sun, 20 Sep 2009 07:23:59 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 9C7A772117 for ; Sun, 20 Sep 2009 07:23:58 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:38791 with envelope Message-ID: <4AB5D88C.4050900@cowlark.com> Date: Sun, 20 Sep 2009 08:23:56 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: LPEG for C++ References: <27BA4145191C1849903386A90FE16D6518E7FA6D21@xserver.gls.co.za> <1079b050909191146s66c070c4u101ba7776c397f12@mail.gmail.com> In-Reply-To: <1079b050909191146s66c070c4u101ba7776c397f12@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8K6Od3P027769 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wesley Smith wrote: > Here's a start on a C parser. Mostly useful for lists of expression > statements without things like structs, or branching/looping code: I'm not fluent enough with LPEG to be able to tell at a glance whether you've done it or not in this, but C/C++ is notoriously hard to parse because the parse type of a symbol depends on the semantic type. In other words, you have to actually *understand* a large amount of the C before you can generate the parse tree. Here's the canonical example: T(*b)[4]; If T is a type name, this declares an array of function pointers, each of which returns a T. If T is not a type name, this calls a function called T with parameter *b, and then dereferences the result. Here's a lengthy discussion of Why C Grammar is Bad: http://groups.google.com/group/comp.compilers/msg/c0797b5b668605b4 (And let's not even get started on C++ and the one-argument-constructor problem...) (Yes, I've been burnt by this several times in the past. Turns out that writing a simple C mutator by parsing the C, modifying the AST and writing it out again is actually deceptively difficult.) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKtdiJf9E0noFvlzgRAnUtAJ9mOQc7gzacPxqpCDDqksN+qxc2iQCfehDa WFI6KtF8cKfE27jce85H4rs= =cH0W -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 04:10:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8K7AkqW032328; Sun, 20 Sep 2009 04:10:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A89B18B91; Sun, 20 Sep 2009 04:10:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0520F189E3 for ; Sun, 20 Sep 2009 04:10:08 -0300 (BRT) Received: by fxm18 with SMTP id 18so1626171fxm.5 for ; Sun, 20 Sep 2009 00:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lNnbThi2eHyxVardMF+/UpiEa2eRvEZUCld/C43KZ+w=; b=tC+L2rc0ieKuBpdvnfdCgit3TNTBRoQII6JVncBREwUIcwlLmrXLNAtJitOYc9XdbZ wevtu+jLr2ZabTvPhV1HsbHQgNi37JUDRQoowaL0ncybiRV0bWO1vGhXDsjTMJmlV2Cj dqfRdGKN1RsFNHfDMUGwg1cHrF3NmlPT70hgM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=djOHuMjKTXYgHK27r34t/9aihG8YpggSEbnl6TgqMXjDrAa/zxUvdMHSJXKK1WOpE0 cLsCQLXw4rKZw3aRMwRk57UCTiID0D2Q4zdhoTRhrPqtzTejqFTuLfF0Ir0FfIUcFBWp ZjmpPdltqcJVXDZ1+giiOAIdisRTX+HK4uKm0= MIME-Version: 1.0 Received: by 10.204.3.85 with SMTP id 21mr3054928bkm.198.1253430612463; Sun, 20 Sep 2009 00:10:12 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <5fe281d40909190327p324b8594od8ed320009c4338c@mail.gmail.com> Date: Sun, 20 Sep 2009 09:10:12 +0200 Message-ID: <560972290909200010s390f4bbctd71f655a4f207d74@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 20, 2009 at 12:42 AM, Yuri Takhteyev wrote: > We can then spend some time thinking about what enhancements are > really needed while actually trying to use the system. We can start > with a fairly open setup and then think, for example, if it's > necessary to introduce additional controls, for example making the > recipes immutable or only editable by the original author. That seems sensible, to start with something straightforward. The more metadata associated with a recipe, the more unwieldly the interface becomes, so we need to know what the 'minimum' extra associated attributes of recipes are. E.g, licence is important, but can be put into a code comment or a comment field. steve d. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 08:19:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KBJW4H030807; Sun, 20 Sep 2009 08:19:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76FCB18BA2; Sun, 20 Sep 2009 08:18:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F303F1888B for ; Sun, 20 Sep 2009 08:18:52 -0300 (BRT) Received: by ywh4 with SMTP id 4so2870885ywh.6 for ; Sun, 20 Sep 2009 04:18:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.1.17 with SMTP id d17mr2509216agi.46.1253445537834; Sun, 20 Sep 2009 04:18:57 -0700 (PDT) In-Reply-To: <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> Date: Sun, 20 Sep 2009 14:18:57 +0300 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> 1) for small code snippets: >> - sections on a snippet page: description, snippet itself, comments, >> unit testing, usage examples, tags, cross-categories. > > These are fine, but when they become compulsory, it becomes bureaucracy again. Right, the snippet and title should be the only mandatory fields. Not even the category or tags or author name should be mandatory (Anonymous Coward is a good default). It should be entirely up to the author to make his snippets popular - the repo should just provide the tools. Trying to achieve order by compliance is an utopia - all you get is more "asdf" entries and frustrated users. >> - have any section edited like any wiki page by anyone without login - >> but keep changelog and provide a diff tool. > > That seems the best thing (don't know about 'without login'?) For me, it's not a week that passes without making a new account on some site, most of which I forget and have to make a new account again. What's the point? Testing my motivation by torturing me with these signup forms? I mean if I really care about authorship, it will be in my own interest to signup, have an author profile onto which to accumulate feedback points, etc. But maybe I don't care for authorship, or I just found a typo somewhere or I just want to thumb-down some comment. How many times have you found yourself in this situation? Login is just another pointless obstacle here -- bureaucracy as you call it. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 08:25:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KBPGWi031155; Sun, 20 Sep 2009 08:25:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A975E18EA5; Sun, 20 Sep 2009 08:24:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A87D418F13 for ; Sun, 20 Sep 2009 08:24:43 -0300 (BRT) Received: by bwz10 with SMTP id 10so1608564bwz.5 for ; Sun, 20 Sep 2009 04:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Il7sSp4TIa3jV/ODy3eDaFDYzpaPhq37bE6Zh1PzhNA=; b=BE8TXhxs/6W5SlnOWGpTi0+HcRjGJelkAgNrk/9tkbSIT2y2FDMbRl/Ixb4EpEOKs5 ds8UlT2+7VHjK5bvP7TcblB9z3LnyKyiM55CkcCklmKcwkSetADwo16SALt3rtsMEE+g ThqYJw9bStH2i0mJaTn7hlc6BpaaAV9QEkh5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=siTw833ndvxQaxwmvHz0tRRTaGShOVug33nrQVAyd4FFZvxHEAODgURPFrTOV8P64q HLv5TT0NXto6ZwRt5X9zNh7WZt3zQg50npFi4BJZhkY5XEpu2RHyDShdGlIjOELOrhLH iVISad16dpSWxwjxvIysR623pw5ZYDXuwXpXw= MIME-Version: 1.0 Received: by 10.204.5.75 with SMTP id 11mr3240020bku.20.1253445887966; Sun, 20 Sep 2009 04:24:47 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> Date: Sun, 20 Sep 2009 13:24:47 +0200 Message-ID: <560972290909200424v277f57bcn7c921933a15c15d3@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 20, 2009 at 1:18 PM, Cosmin Apreutesei > For me, it's not a week that passes without making a new account on > some site, most of which I forget and have to make a new account > again. What's the point? Testing my motivation by torturing me with > these signup forms? Mostly these days sites want to know if you're a bot or not ;) I am amazed at the determination of spammers, that they will start attacking the most obscure forums. The Lua Wiki manages nicely. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 08:35:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KBZ9fj031787; Sun, 20 Sep 2009 08:35:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4748D190AC; Sun, 20 Sep 2009 08:34:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4556218941 for ; Sun, 20 Sep 2009 08:34:35 -0300 (BRT) Received: by bwz10 with SMTP id 10so1610692bwz.5 for ; Sun, 20 Sep 2009 04:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=ctb3jYwjX9sgsjkYt8XxhK6WpZH5VCM/txPr63AG1us=; b=Omnkq169QNjXID3ZyeSXRcsKMd6zdkZMmI47JK5VKaC+RY7EHhk+u3KknomvPKvP+O 3/PSyyvAWf6J+0D3ic5VRcM6sOM7EaEKPlgl7EdWGiWrs66JcC6gezrJDEUOBHXyfOF8 n+w61pmMfvStuAUIIwEoltUgF+JcP59UOxQa0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=iwwS5E7guvmQ7HgeHiVa37htzu2hV6/w2WFXTDo+5XhF5dFUBQOcJLY6MMmX/j36iQ qnGEjvTSYzZjIblxx9NkvF5H3RGMrdPrXdeCJ1sw78c8feKB3K+npXL7WxczTADsMG7V neLNVKD8yMnoEoVNHOJTHQAuFAMfB/Vw+azB0= MIME-Version: 1.0 Received: by 10.223.4.23 with SMTP id 23mr726177fap.91.1253446476072; Sun, 20 Sep 2009 04:34:36 -0700 (PDT) In-Reply-To: <560972290909200424v277f57bcn7c921933a15c15d3@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <560972290909200424v277f57bcn7c921933a15c15d3@mail.gmail.com> From: Jim Whitehead II Date: Sun, 20 Sep 2009 12:34:16 +0100 Message-ID: <5fe281d40909200434u11d7674dne38ba15334793125@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 20, 2009 at 12:24 PM, steve donovan wrote: > On Sun, Sep 20, 2009 at 1:18 PM, Cosmin Apreutesei > > For me, it's not a week that passes > without making a new account on >> some site, most of which I forget and have to make a new account >> again. What's the point? Testing my motivation by torturing me with >> these signup forms? > > Mostly these days sites want to know if you're a bot or not ;) > > I am amazed at the determination of spammers, that they will start > attacking the most obscure forums. > > The Lua Wiki manages nicely. The combined honeypots and re-captcha for anonymous edits seems to keep all of the spam away from WowProgramming [1], and I've considered adding a Mollom [2] plugin to Sputnik as well. Whether or not we require a login is really a detail to be considered before 'launch', so we have a bit of time to think about it. When I get back home today, I'll work on setting up a development git repository. The way I develop is by creating a repository that is used to run the software directly on the web server, with a small 'install' script that lets you launch a development version of the site on your machine without configuration. This should allow for really nice collaboration on the site as a whole. In short, we'll see what we can come up with. - Jim [1]: http://wowprogramming.com [2]: http://mollom.com From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 09:04:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KC4TC1001626; Sun, 20 Sep 2009 09:04:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1FE918B06; Sun, 20 Sep 2009 09:03:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E8A518993 for ; Sun, 20 Sep 2009 09:03:52 -0300 (BRT) Received: by ewy26 with SMTP id 26so2502307ewy.5 for ; Sun, 20 Sep 2009 05:03:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.7.23 with SMTP id 23mr1752733ebg.38.1253448236627; Sun, 20 Sep 2009 05:03:56 -0700 (PDT) Date: Sun, 20 Sep 2009 14:03:56 +0200 X-Google-Sender-Auth: 8ac22c8d3cfe153f Message-ID: Subject: [ANN] a Test Suite for Lua 5.1 From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KC4TC1001626 Few years ago, when I started Lua on Parrot VM, I need a Test Suite, so I wrote one. Now, I rewrite this Test Suite in pure Lua as an independent project, which is the port of the Perl5 module Test::More. The module Test.More is still in development, but the Test Suite is already usable. The homepage is at http://testmore.luaforge.net/, and the sources are hosted at http://github.com/fperrad/lua-TestMore/. The coverage is available at http://testmore.luaforge.net/cover_lua514/src/index.html Now, I need your contribution : upload your results from various platform. The collected results are available at : http://smolder.plusthree.com/app/public_projects/smoke_reports/12 Patch or pull request (git) are welcome. Thanks. François Perrad. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 09:16:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KCGpTk002452; Sun, 20 Sep 2009 09:16:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 376DB19092; Sun, 20 Sep 2009 09:16:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28C92189AD for ; Sun, 20 Sep 2009 09:16:06 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MpLKp-0008V7-RO for lua@bazar2.conectiva.com.br; Sun, 20 Sep 2009 13:16:07 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 9803E1C25D for ; Sun, 20 Sep 2009 13:16:06 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:33161 with envelope Message-ID: <4AB62B14.7090308@cowlark.com> Date: Sun, 20 Sep 2009 14:16:04 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Recipes Site? References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KCGpTk002452 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Cosmin Apreutesei wrote: [...] > Right, the snippet and title should be the only mandatory fields. And license. Unless there's a license attached to the code, it can't be used for *anything*. Yes, it's annoyingly bureaucratic, but if you're in any kind of commercial environment getting this sort of thing right is utterly mandatory. I've seen and had to pass up on all sorts of useful bits of code that I wanted to use, simply because they had no license. [...] > For me, it's not a week that passes without making a new account on > some site, most of which I forget and have to make a new account > again. What's the point? I agree completely. Signing up for stuff is a pain in the arse. That said, if it's *absolutely* necessary to keep track of people for accountability reasons, OpenID is your friend. Most people already have an account with an OpenID provider (Google, Yahoo, LiveJournal...); plus it makes the implementation easier. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKtisSf9E0noFvlzgRAv8MAJwMeRJu2d86TcE0df6aZLO/zdqxugCgto09 cki6Y8iVxut79rotAmqMQzc= =2pzQ -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 11:34:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KEYgEB011140; Sun, 20 Sep 2009 11:34:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94C12191D6; Sun, 20 Sep 2009 11:34:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2956618F13 for ; Sun, 20 Sep 2009 11:34:04 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MpNUL-0003kW-Ug for lua@bazar2.conectiva.com.br; Sun, 20 Sep 2009 16:34:05 +0200 Received: from aaubervilliers-155-1-87-119.w90-61.abo.wanadoo.fr ([90.61.6.119]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Sep 2009 16:34:05 +0200 Received: from PhiLho by aaubervilliers-155-1-87-119.w90-61.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Sep 2009 16:34:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Lua Recipes Site? Date: Sun, 20 Sep 2009 16:33:44 +0200 Lines: 14 Message-ID: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-87-119.w90-61.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <4AB62B14.7090308@cowlark.com> X-Antivirus: avast! (VPS 090919-0, 19/09/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 20/09/2009 15:16, David Given wrote: > And license. Unless there's a license attached to the code, it can't be > used for *anything*. I understand, but perhaps there might be a clause like: unless you fill in the license field, the snippets to leave on the site will be considered to be public domain. If people are sloppy enough to skip the rule page, their loss... -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 11:38:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KEcXI5011466; Sun, 20 Sep 2009 11:38:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 551181926D; Sun, 20 Sep 2009 11:38:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC96C1914F for ; Sun, 20 Sep 2009 11:38:02 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MpNYF-0004by-ON for lua@bazar2.conectiva.com.br; Sun, 20 Sep 2009 16:38:07 +0200 Received: from adsl87-47.kln.forthnet.gr ([77.49.54.47]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Sep 2009 16:38:07 +0200 Received: from petsagouris by adsl87-47.kln.forthnet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Sep 2009 16:38:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: George Petsagourakis Subject: Re: Lua Recipes Site? Date: Sun, 20 Sep 2009 14:37:45 +0000 (UTC) Lines: 10 Message-ID: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 77.49.54.47 (Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I would like to throw http://github.com in the conversation. It can provide a good way to manage code in a so distributed environment we are talking about (much non coherent code, many users, etc). We can setup a LuaRecipes account and have the repository managed by a single (or group of persons) to deal with pull requests, others can fork the repository too. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 12:10:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KF9w8e014075; Sun, 20 Sep 2009 12:09:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 390E519286; Sun, 20 Sep 2009 12:09:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FE5A191EE for ; Sun, 20 Sep 2009 12:09:18 -0300 (BRT) Received: by fxm18 with SMTP id 18so1750050fxm.5 for ; Sun, 20 Sep 2009 08:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fSDTmBeoTu74SBpChXegwWFkGVEXGD0iMO82RRqWQVw=; b=hCGPgNW5/ciGlqCNosuJj/MZUpr4o+KRnQiPRLSrTSztYUB9byPjiyyR3FtqFZWJGS 2x+YHdFeY/28yQ+L/5a6sXr1Z6uv/R0SqM3OaeMzPvAtgM9yBGLheHdslxSbjuMgqerl EsdaRFT73DvUu5HY5w/tEbVrezUawMWIyBiJc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HkTzZ9J0huw0Emoa+sPNPnK1JHd8MQmzG9IhxGgc2JwhHZNdr5bcApqRcwm9av/t5w uyxM9odI4LcYEOhQz9Qh7QGYpXbFSuS102LLWhaKlUq6foXCbleO+xyI8W8f/Wa49Y6m aiApbEFRXyF5obIc5c+9avA1ZrYhOlpejWVgI= MIME-Version: 1.0 Received: by 10.204.8.145 with SMTP id h17mr587899bkh.156.1253459362778; Sun, 20 Sep 2009 08:09:22 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> Date: Sun, 20 Sep 2009 17:09:22 +0200 Message-ID: <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 20, 2009 at 4:37 PM, George Petsagourakis wrote: > I would like to throw http://github.com in the conversation. It can provide a > good way to manage code in a so distributed environment we are talking about > (much non coherent code, many users, etc). Gosh, this is getting complicated. I like Web+copy/paste myself. OK, I'll obviously have to get Git at some point in my life, but remember that the main issue is not how to store the recipes, but how to tag them and search them intelligently, by a combination of classification, tags and keyword search. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 12:27:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KFRn2o015703; Sun, 20 Sep 2009 12:27:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77963192A0; Sun, 20 Sep 2009 12:27:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1CF418A02 for ; Sun, 20 Sep 2009 12:27:17 -0300 (BRT) Received: by bwz10 with SMTP id 10so1668204bwz.5 for ; Sun, 20 Sep 2009 08:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=q7U3QFOlviLzSmE7++bOp/tyQyw8w8XQmH/e5l/uSJk=; b=j3aro5I+1blOuOLVT4KydqEQPG1ixJmrJfhfUAsH+zqe3Vb+3+aSZmH490SM9nGSXN j7ibuKfJvk7bHgasFbv0PjQMAKaNs2o8Zs5tpOrngc+fsRbZvYq36f6us9JSOKIL4onY vg8YRpyaSCAME2Jq2qFQJ044WvSKI02WisL1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oPyP3Fve7INoAc0rr/pgw05OQrjVRVNrFbXZfeXrPSs+SLaxvCT8cgDz5RZqh2uHxT 0v9FGQ4CnTHbgscJwhwIEwPTraOPoABulr+3NELy4tvR3j2Thby5ajZHScjXEDuiQQAE Nskdc2gxcBtWzMdw81/fwV3lHn+OUAtD0DFXs= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr789514fau.40.1253460441735; Sun, 20 Sep 2009 08:27:21 -0700 (PDT) In-Reply-To: References: Date: Sun, 20 Sep 2009 19:27:21 +0400 Message-ID: Subject: Re: [ANN] a Test Suite for Lua 5.1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KFRn2o015703 On Sun, Sep 20, 2009 at 16:03, François Perrad wrote: > Few years ago, when I started Lua on Parrot VM, I need a Test Suite, > so I wrote one. Out of pure interest: have you seen the Official Lua Test Suite? http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 12:34:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KFXvv7016134; Sun, 20 Sep 2009 12:33:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2AF0192B1; Sun, 20 Sep 2009 12:33:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E88C218A0C for ; Sun, 20 Sep 2009 12:33:27 -0300 (BRT) Received: by ywh4 with SMTP id 4so2969203ywh.6 for ; Sun, 20 Sep 2009 08:33:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.122.11 with SMTP id z11mr2615281agm.111.1253460813681; Sun, 20 Sep 2009 08:33:33 -0700 (PDT) In-Reply-To: <560972290909200424v277f57bcn7c921933a15c15d3@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <560972290909200424v277f57bcn7c921933a15c15d3@mail.gmail.com> Date: Sun, 20 Sep 2009 18:33:33 +0300 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Mostly these days sites want to know if you're a bot or not ;) A captcha entered once per day and/or per browser session will suffice -- but I'd only enable it in times of attack. > The Lua Wiki manages nicely. Delayed google indexing - it is the only protection of c2.com - it didn't even had a captcha last time I edited a page there. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 12:40:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KFeMse016590; Sun, 20 Sep 2009 12:40:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C09918D31; Sun, 20 Sep 2009 12:39:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4426F188E9 for ; Sun, 20 Sep 2009 12:39:47 -0300 (BRT) Received: by ywh4 with SMTP id 4so2972070ywh.6 for ; Sun, 20 Sep 2009 08:39:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.13.15 with SMTP id 15mr2636074agm.74.1253461193092; Sun, 20 Sep 2009 08:39:53 -0700 (PDT) In-Reply-To: <4AB62B14.7090308@cowlark.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> Date: Sun, 20 Sep 2009 18:39:53 +0300 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > And license. Unless there's a license attached to the code, it can't be > used for *anything*. You can default that field to BSD or MIT. And if the author doesn't bother to enter his name, then the organization behind the repo website gets full copyright -- you can put that in the Terms of Use. From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:11:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGBIqR019164; Sun, 20 Sep 2009 13:11:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AB60190F9; Sun, 20 Sep 2009 13:10:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA7F118A02 for ; Sun, 20 Sep 2009 13:10:38 -0300 (BRT) Received: by fxm18 with SMTP id 18so1770796fxm.5 for ; Sun, 20 Sep 2009 09:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=i23XVFBNtCVLdfjIxLyI5lufo3sbqtF2qkr384OgaYk=; b=YS+xBR5bdhnbdjJGRMmZw85f+zvzGg3RtijqfeRe0Xv9KiO+xk8IdW51HOFU7MzaGZ tkzl7uGvxEzF6MLeJwrQl7nIYqZpCsGsXNA+HuT9GudlzWnKgzTwU1vCvfwduADuGPch 9a9p4l2jHe2KgzNdGdwtHgAkzBUXjww35fleo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=N1DPTS47LARPNCDN1Q4F+/uSxLYL07Oc20ZaR1KNzYJulI0GQIimV6+yY5dZy77aET GpjTU7W8aXlJgiOfQ1esdTeCda1uyJEsA2yONSX8JygdxTCHWLg6uqB6Z50+udCc6+Q9 OufB+wLgUw30ES+U5hcFlC6m0SvY3qxblcVyc= MIME-Version: 1.0 Received: by 10.223.4.209 with SMTP id 17mr793606fas.85.1253463043428; Sun, 20 Sep 2009 09:10:43 -0700 (PDT) In-Reply-To: References: Date: Sun, 20 Sep 2009 20:10:43 +0400 Message-ID: Subject: Re: [ANN] a Test Suite for Lua 5.1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KGBIqR019164 > Now, I need your contribution : >        upload your results from various platform. I can't get it to work (at least with current git HEAD). See log below. Also I've tried to add metalua as a target, and found that my prove does not support --exec option: $ prove --exec Unknown option: exec $ prove --version prove v1.04, using Test::Harness v2.56 and Perl v5.8.8 I'm on OS X 10.5.8 Alexander. lua-TestMore $ git status # On branch master nothing to commit (working directory clean) lua-TestMore $ git rev-parse HEAD 20de99fda573e5ac65834acdeb1ed8ad24fe6222 lua-TestMore $ cd test_lua51/ test_lua51 $ make smolder Unknown option: archive Unknown option: exec make: [smolder] Error 1 (ignored) perl -e 'use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->env_proxy(); my $server = q{http://smolder.plusthree.com}; my $project_id = 12; my $url = $server . q{/app/developer_projects/process_add_report/} . $project_id; my $response = $ua->post( $url, Content_Type => q{form-data}, Content => [ architecture => q{darwin-2level}, platform => q{darwin}, tags => q{darwin, darwin-2level, lua, Lua 5.1}, comments => q{lua}, username => q{parrot-autobot}, password => q{squ@wk}, project_id => $project_id, report_file => [q{test_lua51.tar.gz}], ] ); if ($response->code == 302) { my ($report_id) = $response->content =~ /Reported .(\d+) added/i; my $report_url = $server . q{/app/public_projects/report_details/} . $report_id; my $project_url = $server . q{/app/public_projects/smoke_reports/} . $project_id; print qq{Test report successfully sent to Smolder at\n$report_url} . qq{\nYou can see other recent reports at\n$project_url .\n\n}; } else { die qq{Could not upload report to Smolder at $server} . qq{\nHTTP CODE: } . $response->code . q{ (} . $response->message . qq{)\n}; }' Can't open file test_lua51.tar.gz: No such file or directory at /opt/local/lib/perl5/vendor_perl/5.8.8/LWP/UserAgent.pm line 399 make: *** [smolder] Error 2 From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:33:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGXdXo020745; Sun, 20 Sep 2009 13:33:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2508419180; Sun, 20 Sep 2009 13:32:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 686BB18F13 for ; Sun, 20 Sep 2009 13:32:53 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 36EA06CDA0 for ; Sun, 20 Sep 2009 12:32:59 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 20 Sep 2009 12:33:01 -0400 X-Sasl-enc: QeBqJus4sABZ/NwbxZaLHq1Lg852gnTQESwENMlgvq+a 1253464378 Received: from [192.168.1.102] (97-120-107-17.ptld.qwest.net [97.120.107.17]) by mail.messagingengine.com (Postfix) with ESMTPSA id 537863D682 for ; Sun, 20 Sep 2009 12:32:58 -0400 (EDT) Message-ID: <4AB65997.5040106@eykamp.com> Date: Sun, 20 Sep 2009 09:34:31 -0700 From: Christopher Eykamp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Unexpected error Content-Type: multipart/alternative; boundary="------------080401020900080907060606" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------080401020900080907060606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm trying to run some pretty basic code, and am getting an unexpected and confusing error. I'm hoping that more experienced eyes can tell me what's wrong. This is standard code that was previously published, which I have not modified in any way. I am running the latest version of Lua. Here is the error: C:\>lua listtest.lua lua: listtest.lua:46: attempt to call method 'pushright' (a nil value) stack traceback: listtest.lua:46: in function 'test' listtest.lua:72: in main chunk [C]: ? C:\> Here is the code: -- $Id: lists.lua,v 1.6 2001/01/13 22:04:18 doug Exp $ -- http://www.bagley.org/~doug/shootout/ -- implemented by: Roberto Ierusalimschy -------------------------------------------------------------- -- List module -- defines a prototipe for lists -------------------------------------------------------------- List = {first = 0, last = -1} *function* List:new () *local* n = {} *for* k,v *in* self *do* n[k] = v *end* *return* n *end* *function* List:length () *return* self.last - self.first + 1 *end* *function* List:pushleft (value) *local* first = self.first - 1 self.first = first self[first] = value *end* *function* List:pushright (value) *local* last = self.last + 1 self.last = last self[last] = value *end* *function* List:popleft () *local* first = self.first *if* first > self.last *then* *error*"list is empty" *end* *local* value = self[first] self[first] = *nil* -- to allow collection self.first = first+1 *return* value *end* *function* List:popright () *local* last = self.last *if* self.first > last *then* *error*"list is empty" *end* *local* value = self[last] self[last] = *nil* -- to allow collection self.last = last-1 *return* value *end* *function* List:reverse () *local* i, j = self.first, self.last *while* i 0 *do* l3:pushright(l2:popleft()) *end* -- remove each individual item from right side of l3 and -- append to right side of l2 (reversing list) *while* l3:length() > 0 *do* l2:pushright(l3:popright()) *end* -- reverse l1 in place l1:reverse() -- compare Li1 and Li2 for equality -- and return length of the list *if* *not* l1:equal(l2) *then* *return* *nil* *else* *return* l1:length() *end* *end* N = *tonumber*((arg *and* arg[1])) *or* 1 *for* i=1, N *do* result = test() *end* *print*(result) --------------080401020900080907060606 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm trying to run some pretty basic code, and am getting an unexpected and confusing error.  I'm hoping that more experienced eyes can tell me what's wrong.  This is standard code that was previously published, which I have not modified in any way.  I am running the latest version of Lua.

Here is the error:
C:\>lua listtest.lua
lua: listtest.lua:46: attempt to call method 'pushright' (a nil value)
stack traceback:
        listtest.lua:46: in function 'test'
        listtest.lua:72: in main chunk
        [C]: ?

C:\>

Here is the code:
-- $Id: lists.lua,v 1.6 2001/01/13 22:04:18 doug Exp $
-- http://www.bagley.org/~doug/shootout/
-- implemented by: Roberto Ierusalimschy

--------------------------------------------------------------
-- List module
-- defines a prototipe for lists
--------------------------------------------------------------

List = {first = 0, last = -1}

function List:new ()
  local n = {}
  for k,v in self do n[k] = v end
  return n
end

function List:length ()
  return self.last - self.first + 1
end

function List:pushleft (value)
  local first = self.first - 1
  self.first = first
  self[first] = value
end

function List:pushright (value)
  local last = self.last + 1
  self.last = last
  self[last] = value
end

function List:popleft ()
  local first = self.first
  if first > self.last then error"list is empty" end
  local value = self[first]
  self[first] = nil  -- to allow collection
  self.first = first+1
  return value
end

function List:popright ()
  local last = self.last
  if self.first > last then error"list is empty" end
  local value = self[last]
  self[last] = nil  -- to allow collection
  self.last = last-1
  return value
end

function List:reverse ()
  local i, j = self.first, self.last
  while i<j do
    self[i], self[j] = self[j], self[i]
    i = i+1
    j = j-1
  end
end

function List:equal (otherlist)
  if self:length() ~= otherlist:length() then return nil end
  local diff = otherlist.first - self.first
  for i1=self.first,self.last do
    if self[i1] ~= otherlist[i1+diff] then return nil end
  end
  return 1
end

-----------------------------------------------------------
-----------------------------------------------------------

-- Some tests

function test ()
  local SIZE = 10000
  -- create a list with elements 1..SIZE
  local l1 = List:new()
  for i=1,SIZE do
    l1:pushright(i)
  end
  -- creates a copy of l1
  local l2 = l1:new()
  -- remove each individual item from left side of l2 and
  -- append to right side of l3 (preserving order)
  local l3 = List:new()
  while l2:length() > 0 do
    l3:pushright(l2:popleft())  
  end
  -- remove each individual item from right side of l3 and
  -- append to right side of l2 (reversing list)
  while l3:length() > 0 do
    l2:pushright(l3:popright())
  end
  -- reverse l1 in place
  l1:reverse()
  -- compare Li1 and Li2 for equality
  -- and return length of the list
  if not l1:equal(l2) then return nil
  else return l1:length()
  end
end

N = tonumber((arg and arg[1])) or 1
for i=1, N do
  result = test()
end
print(result)

--------------080401020900080907060606-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:42:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGgFFt021286; Sun, 20 Sep 2009 13:42:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A868819295; Sun, 20 Sep 2009 13:41:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F39BD19131 for ; Sun, 20 Sep 2009 13:41:37 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so564983eye.39 for ; Sun, 20 Sep 2009 09:41:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.129.20 with SMTP id g20mr1859726ebn.14.1253464902535; Sun, 20 Sep 2009 09:41:42 -0700 (PDT) In-Reply-To: References: Date: Sun, 20 Sep 2009 18:41:42 +0200 X-Google-Sender-Auth: c7377122c449ef37 Message-ID: Subject: Re: [ANN] a Test Suite for Lua 5.1 From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KGgFFt021286 2009/9/20 Alexander Gladysh : >> Now, I need your contribution : >>        upload your results from various platform. > > I can't get it to work (at least with current git HEAD). See log below. > > Also I've tried to add metalua as a target, and found that my prove > does not support --exec option: > > $ prove --exec > Unknown option: exec > This option is available with the version of Test::Harness shipped with Perl 5.10. If you don't want upgrade your box, just remove this option in Makefile. The shebang in each *.t file is used by default (currently /usr/bin/lua). If the option --archive is not available, use the default target of the Makefile. That runs the Test Suite, but don't upload the result on Smolder server. François. > $ prove --version > prove v1.04, using Test::Harness v2.56 and Perl v5.8.8 > > I'm on OS X 10.5.8 > > Alexander. > > lua-TestMore $ git status > # On branch master > nothing to commit (working directory clean) > > lua-TestMore $ git rev-parse HEAD > 20de99fda573e5ac65834acdeb1ed8ad24fe6222 > > lua-TestMore $ cd test_lua51/ > test_lua51 $ make smolder > Unknown option: archive > Unknown option: exec > make: [smolder] Error 1 (ignored) > perl -e 'use strict; use warnings; use LWP::UserAgent; my $ua = > LWP::UserAgent->new(); $ua->env_proxy(); my $server = > q{http://smolder.plusthree.com}; my $project_id = 12; my $url = > $server . q{/app/developer_projects/process_add_report/} . > $project_id; my $response = $ua->post( $url, Content_Type => > q{form-data}, Content      => [ architecture => q{darwin-2level}, > platform     => q{darwin}, tags         => q{darwin, darwin-2level, > lua, Lua 5.1}, comments     => q{lua}, username     => > q{parrot-autobot}, password     => q{squ@wk}, project_id   => > $project_id, report_file  => [q{test_lua51.tar.gz}], ] ); if > ($response->code == 302) { my ($report_id) = $response->content =~ > /Reported .(\d+) added/i; my $report_url = $server . > q{/app/public_projects/report_details/} . $report_id; my $project_url > = $server . q{/app/public_projects/smoke_reports/} . $project_id; > print qq{Test report successfully sent to Smolder at\n$report_url} . > qq{\nYou can see other recent reports at\n$project_url .\n\n}; } else > { die qq{Could not upload report to Smolder at $server} . qq{\nHTTP > CODE: } . $response->code . q{ (} . $response->message . qq{)\n}; }' > Can't open file test_lua51.tar.gz: No such file or directory at > /opt/local/lib/perl5/vendor_perl/5.8.8/LWP/UserAgent.pm line 399 > make: *** [smolder] Error 2 > > From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:45:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGjFZi021832; Sun, 20 Sep 2009 13:45:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DF35192AD; Sun, 20 Sep 2009 13:44:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE1C81928E for ; Sun, 20 Sep 2009 13:44:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so2610282ewy.5 for ; Sun, 20 Sep 2009 09:44:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.39.141 with SMTP id d13mr995184web.183.1253465085262; Sun, 20 Sep 2009 09:44:45 -0700 (PDT) In-Reply-To: <4AB65997.5040106@eykamp.com> References: <4AB65997.5040106@eykamp.com> Date: Sun, 20 Sep 2009 17:44:45 +0100 X-Google-Sender-Auth: ca688e0526be07ce Message-ID: Subject: Re: Unexpected error From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KGjFZi021832 That code shouldn't work with the latest version of Lua (5.1). Specifically, the line: for k,v in self do n[k] = v end Uses a feature which was deprecated in 5.0, and has been removed in 5.1, and hence when executed, that line should be giving you this error: line 14: attempt to call a table value A version of that line changed to be compatible with Lua 5.1 is: for k,v in pairs(self) do n[k] = v end If instead of changing it, you commented out that line, then you would get the error message which you stated: line 80: attempt to call method 'pushright' (a nil value) Also, the line numbers in your error message do not correlate with the source file which you included - line 46 does not call pushright, nor is it part of the test function. On Sun, Sep 20, 2009 at 5:34 PM, Christopher Eykamp wrote: > I'm trying to run some pretty basic code, and am getting an unexpected and > confusing error.  I'm hoping that more experienced eyes can tell me what's > wrong.  This is standard code that was previously published, which I have > not modified in any way.  I am running the latest version of Lua. > > Here is the error: > C:\>lua listtest.lua > lua: listtest.lua:46: attempt to call method 'pushright' (a nil value) > stack traceback: >         listtest.lua:46: in function 'test' >         listtest.lua:72: in main chunk >         [C]: ? > > C:\> > > Here is the code: > > -- $Id: lists.lua,v 1.6 2001/01/13 22:04:18 doug Exp $ > -- http://www.bagley.org/~doug/shootout/ > -- implemented by: Roberto Ierusalimschy > > -------------------------------------------------------------- > -- List module > -- defines a prototipe for lists > -------------------------------------------------------------- > > List = {first = 0, last = -1} > > function List:new () > local n = {} > for k,v in self do n[k] = v end > return n > end > > function List:length () > return self.last - self.first + 1 > end > > function List:pushleft (value) > local first = self.first - 1 > self.first = first > self[first] = value > end > > function List:pushright (value) > local last = self.last + 1 > self.last = last > self[last] = value > end > > function List:popleft () > local first = self.first > if first > self.last then error"list is empty" end > local value = self[first] > self[first] = nil -- to allow collection > self.first = first+1 > return value > end > > function List:popright () > local last = self.last > if self.first > last then error"list is empty" end > local value = self[last] > self[last] = nil -- to allow collection > self.last = last-1 > return value > end > > function List:reverse () > local i, j = self.first, self.last > while i self[i], self[j] = self[j], self[i] > i = i+1 > j = j-1 > end > end > > function List:equal (otherlist) > if self:length() ~= otherlist:length() then return nil end > local diff = otherlist.first - self.first > for i1=self.first,self.last do > if self[i1] ~= otherlist[i1+diff] then return nil end > end > return 1 > end > > ----------------------------------------------------------- > ----------------------------------------------------------- > > -- Some tests > > function test () > local SIZE = 10000 > -- create a list with elements 1..SIZE > local l1 = List:new() > for i=1,SIZE do > l1:pushright(i) > end > -- creates a copy of l1 > local l2 = l1:new() > -- remove each individual item from left side of l2 and > -- append to right side of l3 (preserving order) > local l3 = List:new() > while l2:length() > 0 do > l3:pushright(l2:popleft()) > end > -- remove each individual item from right side of l3 and > -- append to right side of l2 (reversing list) > while l3:length() > 0 do > l2:pushright(l3:popright()) > end > -- reverse l1 in place > l1:reverse() > -- compare Li1 and Li2 for equality > -- and return length of the list > if not l1:equal(l2) then return nil > else return l1:length() > end > end > > N = tonumber((arg and arg[1])) or 1 > for i=1, N do > result = test() > end > print(result) > > From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:55:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGtGDX022531; Sun, 20 Sep 2009 13:55:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6649D18F5F; Sun, 20 Sep 2009 13:54:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77DF3187FF for ; Sun, 20 Sep 2009 13:54:44 -0300 (BRT) Received: from [93.172.85.55] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQA002RO4BASA00@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Sun, 20 Sep 2009 19:54:47 +0300 (IDT) Date: Sun, 20 Sep 2009 19:54:47 +0300 From: Shmuel Zeigerman Subject: Re: Lua Recipes Site? In-reply-to: To: Lua list Message-id: <4AB65E57.1080309@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7BIT References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei wrote: >> And license. Unless there's a license attached to the code, it can't be >> used for *anything*. > > You can default that field to BSD or MIT. And if the author doesn't > bother to enter his name, then the organization behind the repo > website gets full copyright -- you can put that in the Terms of Use. And what if the person submits code that doesn't belong him and is licensed elsewhere? Is there a way to cope with such cases? -- Shmuel From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 13:59:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KGxjFX022890; Sun, 20 Sep 2009 13:59:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41EB0192A8; Sun, 20 Sep 2009 13:59:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 518C4187FF for ; Sun, 20 Sep 2009 13:59:16 -0300 (BRT) Received: by ywh4 with SMTP id 4so3009200ywh.6 for ; Sun, 20 Sep 2009 09:59:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.114.19 with SMTP id m19mr6859654ybc.4.1253465962164; Sun, 20 Sep 2009 09:59:22 -0700 (PDT) In-Reply-To: <4AB65E57.1080309@013net.net> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> From: Phoenix Sol Date: Sun, 20 Sep 2009 11:59:02 -0500 Message-ID: <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 20, 2009 at 11:54 AM, Shmuel Zeigerman wrote: > Cosmin Apreutesei wrote: >>> >>> And license. Unless there's a license attached to the code, it can't be >>> used for *anything*. >> >> You can default that field to BSD or MIT. And if the author doesn't >> bother to enter his name, then the organization behind the repo >> website gets full copyright -- you can put that in the Terms of Use. > > And what if the person submits code that doesn't belong him and is licensed > elsewhere? Is there a way to cope with such cases? > > -- > Shmuel > I think that such cases can be provided for via caveats in the language of the Usage Terms. Oh no, queue the IP Attorneys... From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 15:44:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KIiCfm030810; Sun, 20 Sep 2009 15:44:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F11218444; Sun, 20 Sep 2009 15:43:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-08.prod.phx3.secureserver.net (p3plsmtpa01-08.prod.phx3.secureserver.net [72.167.82.88]) by bazar2.conectiva.com.br (Postfix) with SMTP id DD928183AE for ; Sun, 20 Sep 2009 15:43:27 -0300 (BRT) Received: (qmail 27729 invoked from network); 20 Sep 2009 18:43:30 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-08.prod.phx3.secureserver.net (72.167.82.88) with ESMTP; 20 Sep 2009 18:43:30 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: First class : (was Re: Regarding the name 'pairs') From: Mark Hamburg In-Reply-To: Date: Sun, 20 Sep 2009 11:43:29 -0700 Content-Transfer-Encoding: 7bit Message-Id: <5B164445-85C6-4779-B868-0FBF677E06E7@grubmah.com> References: <20090908184708.3e680459@egeria.whoopdedo.org> <20090910162412.1043e325@egeria.whoopdedo.org> <20090911163400.22b594fe@egeria.whoopdedo.org> <20090914091648.B30247@lua.tecgraf.puc-rio.br> <560972290909140526j25ea43begb8c8633f1031f2de@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 14, 2009, at 10:58 PM, Mark Hamburg wrote: > In primaryexp (lparser.c), the colon operator case becomes: > > case ':': { /* `:' NAME funcargs */ > expdesc key; > luaX_next(ls); > /* PATCH: Add support for obj:[ exp ] syntax for calling methods. */ > if (ls->t.token == '[') { > yindex(ls, &key); > } > else { > checkname(ls, &key); > } > luaK_self(fs, v, &key); > /* Compiles each expression evaluating them into a sequence of > registers. */ > switch (ls->t.token) { /* PATCH: Check for a call before > going to the funcargs case, otherwise curry. */ > case '(': case TK_STRING: case '{': { /* funcargs */ > funcargs(ls, v); > break; > } > default: { > currymethod(ls, v); > return; > } > } > break; > } > > > I'm afraid I don't have an implementation for currymethod. Without > that support, the inner switch just becomes a call to funcargs(ls,v). > > But to get the rest of obj:[ method ] working one also needs to > revise luaK_self in lcode.c: > > void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { > int func; > luaK_exp2anyreg(fs, e); > freeexp(fs, e); > func = fs->freereg; > luaK_reserveregs(fs, 2); > luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); > freeexp(fs, key); > fs->freereg = func + 2; /* PATCH: Make sure that freeing the key > won't have just cost us a register. Why??? */ > e->u.s.info = func; > e->k = VNONRELOC; > } > > As the comments, suggest it would be good to have someone who knows > the register behavior in the Lua code generator better than I review > this code. Negative testing reveals that I probably need to refine getobjname in ldebug.c as well for the OP_SELF case. Other places that could matter (because they reference OP_SELF): PrintCode in print.c luaP_opmodes in lopcodes.c (the comment in lopcodes.h may also need a tweak) symbexec in ldebug.c The issue being that OP_SELF no longer gets to assume that the method argument is a constant string. I need to study the Lua implementation further to resolve what if anything needs to be done for these cases. Mark From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 16:55:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KJt8LM003843; Sun, 20 Sep 2009 16:55:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39ACF192B5; Sun, 20 Sep 2009 16:54:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63AC01926C for ; Sun, 20 Sep 2009 16:54:27 -0300 (BRT) Received: by yxe37 with SMTP id 37so2468662yxe.33 for ; Sun, 20 Sep 2009 12:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=0x+MSvAooyytqhVifNIj8mClUtzA1vdsf3v0UjLP9wI=; b=rqua6Y8x6Bgz0bKoMBuIM/OXr0Pq7T1pIzyXmd226NbIQpSoPxjqPLzQoFCfuS95Sb HCP6FnsqCPDtll4i2U5dfjWudr7oeeDj+ldQ009bF9K47K8rzXTFqT9jS4GtvsdSNy6C OmMr3gLNEgfKJVKzQrEA+JWTgUDQ3Xgay6iIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=WE5q6VdJUvz3g5TVdk8y35mEJzLvroNtJ63Dv55EoEJEVExyKjGxjUf0xaih320BGk GbNxRTNzcDu0HkwK7GqlDp8h6h+IkqqOhgfNU2OW/ESRW9PqU2ZuQy4fQZncFTjJjLB3 9Zu9QPvX+/mTargkhVf4Qgmx2sSlldUQbw6XY= MIME-Version: 1.0 Received: by 10.150.175.1 with SMTP id x1mr7031105ybe.45.1253476472390; Sun, 20 Sep 2009 12:54:32 -0700 (PDT) Date: Sun, 20 Sep 2009 12:54:32 -0700 Message-ID: <1079b050909201254n7e0c981dj6931d0a60b86f80b@mail.gmail.com> Subject: table constructor and array length bug?? From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2 identical tables, 2 different lengths: res = {nil, "x"} res2 = {} res2[1] = nil res2[2]= "x" print(#res, #res2) ---->> 2, 0 I would expect both to have length 0, but the former has length 2. This smells like a bug to me. wes From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 16:59:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KJwvqb004777; Sun, 20 Sep 2009 16:58:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5DD2192C6; Sun, 20 Sep 2009 16:58:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1074B1929E for ; Sun, 20 Sep 2009 16:58:25 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so583174eye.39 for ; Sun, 20 Sep 2009 12:58:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.138 with SMTP id c10mr1073354wef.47.1253476710756; Sun, 20 Sep 2009 12:58:30 -0700 (PDT) In-Reply-To: <1079b050909201254n7e0c981dj6931d0a60b86f80b@mail.gmail.com> References: <1079b050909201254n7e0c981dj6931d0a60b86f80b@mail.gmail.com> Date: Sun, 20 Sep 2009 20:58:30 +0100 X-Google-Sender-Auth: affcdfb52034c9f6 Message-ID: Subject: Re: table constructor and array length bug?? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8KJwvqb004777 >From the Lua 5.1 manual, section 2.5.5: "The length of a table t is defined to be any integer index n such that t[n] is not nil and t[n+1] is nil; moreover, if t[1] is nil, n can be zero". For the table {nil, "x"}, the length operator can return 0 or 2, and it is left unspecified as to when or why which will be returned. The manual does not state that tables with identical contents will have the same length. On Sun, Sep 20, 2009 at 8:54 PM, Wesley Smith wrote: > 2 identical tables, 2 different lengths: > > res = {nil, "x"} > res2 = {} > res2[1] = nil > res2[2]=  "x" > > print(#res, #res2)  ---->>   2, 0 > > I would expect both to have length 0, but the former has length 2. > This smells like a bug to me. > > wes > From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 16:59:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8KJxRq1004845; Sun, 20 Sep 2009 16:59:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8C96192D9; Sun, 20 Sep 2009 16:58:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BDEC192C8 for ; Sun, 20 Sep 2009 16:58:33 -0300 (BRT) Received: by bwz10 with SMTP id 10so1755226bwz.5 for ; Sun, 20 Sep 2009 12:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=9K3QHniCJtTinEjyKC4bVCECnH/ZpkH+2Cel7DezfAY=; b=if5g4t0mkjDlYp6mhXjLp0FhZ4ibCdinTsn9VDmxhIasrmrsMaIOHJ4yMlo3cjm6S+ MUj2Xoa4mgzmsHFoX5VkhECPyWmvX3AYSXDwhXZnmLL5dSG48HO7CTDM00Ywg/cZht5D Krk5BE+kye2F24EO8Ei8BkI6qUOgMfi9mDLeY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=I5xkesH6t7jxk07Hxe90R9OdFSviOGc03wcmwH1jm1QKIwQJMfc3opObFs+hsMOLsj iDQnX5RizBmqoR4x/ITYmJYa2kdq0UMEA3MkaYqt4sKBrm3EOPacFBSl90vGk9NqqItg VTiiK+qGUNog2MjHl0NZC72Kdru42kPLbQNUI= MIME-Version: 1.0 Received: by 10.223.1.6 with SMTP id 6mr826815fad.103.1253476718072; Sun, 20 Sep 2009 12:58:38 -0700 (PDT) In-Reply-To: <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> From: Jim Whitehead II Date: Sun, 20 Sep 2009 20:58:18 +0100 Message-ID: <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've set up a GitHub project [1] in order to allow for easy collaboration on this project. Right now the setup script/environment will almost certainly only work on unix machines, as that is where I expect primary development to occur. Some thoughts about everything that's been discussed so far in this thread: * We need someone to take control of this project and lead it in a particular direction. This could be a small group of people, or a benevolent dictator. What won't work is design by committee, as one day of this thread has already shown. * Nothing we are doing or discussing right now is 'Lua' sanctioned, and I'm sure that is as it should be. If, in time, we develop an application that works well for the community and becomes more widely used, then we can become as 'official' as we can be. * There are a lot of details that need to be considered, but in the short term we should focus on how the project will be developed. This means that people need to be become familiar with the existing 'recipes' rock that is included in the main repository. Any changes will be made to this code base, so it's a very good place to start. There have been a lot of good ideas, and we have plenty we can talk about. For now, we need to see who is willing to help develop the project. We will certainly not be lacking on people willing to share their opinions on how the project should work, and that's a good thing. It's good to see such enthusiasm. I think having a single place for this sort of support/community/discussion/material would be a great thing for our community. - Jim [1]: http://github.com/jnwhiteh/LuaRecipes From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 21:06:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L06RES023687; Sun, 20 Sep 2009 21:06:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3D1A19235; Sun, 20 Sep 2009 21:05:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAE2F18EC5 for ; Sun, 20 Sep 2009 21:05:42 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 27E636F6BA for ; Sun, 20 Sep 2009 20:05:47 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 20 Sep 2009 20:05:49 -0400 X-Sasl-enc: AXfLoqoIED0M/nmFfzGF267AvVeVCnMfG5pJqtEkFZyJ 1253491546 Received: from [192.168.1.101] (97-120-107-17.ptld.qwest.net [97.120.107.17]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8E1A51096D for ; Sun, 20 Sep 2009 20:05:46 -0400 (EDT) Message-ID: <4AB6C353.80501@eykamp.com> Date: Sun, 20 Sep 2009 17:05:39 -0700 From: Christopher Eykamp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Unexpected error References: <4AB65997.5040106@eykamp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mea culpa! First, thank you for your response. Second, your diagnosis was exactly correct -- making the change you suggested fixed the problem immediately. Third, you were also right that the code I sent was not the code that generated the problem I was asking about -- I had two versions I was working with, and I sent the wrong one. However, your suggestion did resolve the issue, and now the test method runs just fine. Hopefully, this will resolve the problem I am experiencing in my production code. Thank you again, Chris Peter Cawley wrote: > That code shouldn't work with the latest version of Lua (5.1). > Specifically, the line: > for k,v in self do n[k] = v end > Uses a feature which was deprecated in 5.0, and has been removed in > 5.1, and hence when executed, that line should be giving you this > error: > line 14: attempt to call a table value > A version of that line changed to be compatible with Lua 5.1 is: > for k,v in pairs(self) do n[k] = v end > If instead of changing it, you commented out that line, then you would > get the error message which you stated: > line 80: attempt to call method 'pushright' (a nil value) > > Also, the line numbers in your error message do not correlate with the > source file which you included - line 46 does not call pushright, nor > is it part of the test function. > > On Sun, Sep 20, 2009 at 5:34 PM, Christopher Eykamp wrote: > >> I'm trying to run some pretty basic code, and am getting an unexpected and >> confusing error. I'm hoping that more experienced eyes can tell me what's >> wrong. This is standard code that was previously published, which I have >> not modified in any way. I am running the latest version of Lua. >> >> Here is the error: >> C:\>lua listtest.lua >> lua: listtest.lua:46: attempt to call method 'pushright' (a nil value) >> stack traceback: >> listtest.lua:46: in function 'test' >> listtest.lua:72: in main chunk >> [C]: ? >> >> C:\> >> >> Here is the code: >> >> -- $Id: lists.lua,v 1.6 2001/01/13 22:04:18 doug Exp $ >> -- http://www.bagley.org/~doug/shootout/ >> -- implemented by: Roberto Ierusalimschy >> >> -------------------------------------------------------------- >> -- List module >> -- defines a prototipe for lists >> -------------------------------------------------------------- >> >> List = {first = 0, last = -1} >> >> function List:new () >> local n = {} >> for k,v in self do n[k] = v end >> return n >> end >> >> function List:length () >> return self.last - self.first + 1 >> end >> >> function List:pushleft (value) >> local first = self.first - 1 >> self.first = first >> self[first] = value >> end >> >> function List:pushright (value) >> local last = self.last + 1 >> self.last = last >> self[last] = value >> end >> >> function List:popleft () >> local first = self.first >> if first > self.last then error"list is empty" end >> local value = self[first] >> self[first] = nil -- to allow collection >> self.first = first+1 >> return value >> end >> >> function List:popright () >> local last = self.last >> if self.first > last then error"list is empty" end >> local value = self[last] >> self[last] = nil -- to allow collection >> self.last = last-1 >> return value >> end >> >> function List:reverse () >> local i, j = self.first, self.last >> while i> self[i], self[j] = self[j], self[i] >> i = i+1 >> j = j-1 >> end >> end >> >> function List:equal (otherlist) >> if self:length() ~= otherlist:length() then return nil end >> local diff = otherlist.first - self.first >> for i1=self.first,self.last do >> if self[i1] ~= otherlist[i1+diff] then return nil end >> end >> return 1 >> end >> >> ----------------------------------------------------------- >> ----------------------------------------------------------- >> >> -- Some tests >> >> function test () >> local SIZE = 10000 >> -- create a list with elements 1..SIZE >> local l1 = List:new() >> for i=1,SIZE do >> l1:pushright(i) >> end >> -- creates a copy of l1 >> local l2 = l1:new() >> -- remove each individual item from left side of l2 and >> -- append to right side of l3 (preserving order) >> local l3 = List:new() >> while l2:length() > 0 do >> l3:pushright(l2:popleft()) >> end >> -- remove each individual item from right side of l3 and >> -- append to right side of l2 (reversing list) >> while l3:length() > 0 do >> l2:pushright(l3:popright()) >> end >> -- reverse l1 in place >> l1:reverse() >> -- compare Li1 and Li2 for equality >> -- and return length of the list >> if not l1:equal(l2) then return nil >> else return l1:length() >> end >> end >> >> N = tonumber((arg and arg[1])) or 1 >> for i=1, N do >> result = test() >> end >> print(result) >> >> >> From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 22:29:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L1TEpV028899; Sun, 20 Sep 2009 22:29:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E53619131; Sun, 20 Sep 2009 22:28:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s5.bay0.hotmail.com (bay0-omc1-s5.bay0.hotmail.com [65.54.246.77]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A6C318899 for ; Sun, 20 Sep 2009 22:28:35 -0300 (BRT) Received: from BAY119-W15 ([207.46.9.50]) by bay0-omc1-s5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 20 Sep 2009 18:28:29 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_ade65323-b404-4d31-9ec8-30d0d9b085f4_" X-Originating-IP: [24.195.243.80] From: Saurabh T To: LuaUsers Subject: unpack, pcall, nil Date: Mon, 21 Sep 2009 01:28:29 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 21 Sep 2009 01:28:29.0804 (UTC) FILETIME=[D32F4AC0:01CA3A5A] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_ade65323-b404-4d31-9ec8-30d0d9b085f4_ Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable I'm working with Lua scripts driving C code and trying to write a wrapper a= round functions like so function doit() local status=2C err =3D pcall(unpack(arg)) -- do something with status and err end and doit(x=2C arg1=2C arg2=2C ...) Now the problem is arg1=2C arg2 etc can genuinely be nil=2C and unpack stop= s at nil. Is there any way I can get unpack to get all the entries in the t= able=2C whether or not they are nil? Thanks=2C saurabh _________________________________________________________________ With Windows Live=2C you can organize=2C edit=2C and share your photos. http://www.microsoft.com/middleeast/windows/windowslive/products/photo-gall= ery-edit.aspx= --_ade65323-b404-4d31-9ec8-30d0d9b085f4_ Content-Type: text/html; charset="windows-1251" Content-Transfer-Encoding: quoted-printable I'm working with Lua scripts driving C code and trying to write a wrapper a= round functions like so

function doit()
 =3B local status=2C = err =3D pcall(unpack(arg))
 =3B -- do something with status and err<= br>end

and

doit(x=2C arg1=2C arg2=2C ...)

Now the prob= lem is arg1=2C arg2 etc can genuinely be nil=2C and unpack stops at nil. Is= there any way I can get unpack to get all the entries in the table=2C whet= her or not they are nil? Thanks=2C
saurabh



With Windo= ws Live=2C you can organize=2C edit=2C and share your photos. = --_ade65323-b404-4d31-9ec8-30d0d9b085f4_-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 22:38:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L1cIHK029554; Sun, 20 Sep 2009 22:38:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A49B51929E; Sun, 20 Sep 2009 22:37:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1414518EC5 for ; Sun, 20 Sep 2009 22:37:48 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L1brE1029519 for ; Sun, 20 Sep 2009 22:37:53 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8L1bqC01878; Sun, 20 Sep 2009 22:37:52 -0300 Date: Sun, 20 Sep 2009 22:37:51 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: unpack, pcall, nil Message-ID: <20090920223751.A1870@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from saurabh@hotmail.com on Mon, Sep 21, 2009 at 01:28:29AM +0000 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > function doit() > local status, err = pcall(unpack(arg)) > -- do something with status and err > end > > and > > doit(x, arg1, arg2, ...) > > Now the problem is arg1, arg2 etc can genuinely be nil, and unpack stops at nil. Is there any way I can get unpack to get all the entries in the table, whether or not they are nil? Thanks, use "..." instead of arg: function doit(...) local status, err = pcall(unpack(...)) -- do something with status and err end From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 22:40:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L1eMSv029717; Sun, 20 Sep 2009 22:40:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 026371897B; Sun, 20 Sep 2009 22:39:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3FA918955 for ; Sun, 20 Sep 2009 22:39:51 -0300 (BRT) Received: by fxm18 with SMTP id 18so1954624fxm.5 for ; Sun, 20 Sep 2009 18:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=kU3yG1Bz6Jzj0id7z+tKLSUMRHNonCbUEZ/P5ksA740=; b=cR1gYU0feKKmUC+Y3OtJqXVnaCRatTjGpYChjMw72UBpaRmlL2ivNlY9qOO3Qdvfge zD89VQfoz4t3ED4OX52heZ8E4NlbqDn44k+bciYLjBjScJInDD66+4IHHlovIAS3YAqI 5lI6m2SKzaqQak/uSRszYzudRAint9Dc3aR2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KMokXtZEKdar/c5HejnDGAtUpYBohIsj8JM/bYj2MURKIvVrxxwXuOZK9eV98JywIu 5KmjeS5FVebysTvqSIZSY1idE9c0cOTG99z7JgvQo4jdd8lQ4LXJkcJbEIfOSZtDVfcl LyNOQjiFi922PJHWanAJPC4qJ39MySGw8fh5w= MIME-Version: 1.0 Received: by 10.223.98.19 with SMTP id o19mr849608fan.82.1253497197254; Sun, 20 Sep 2009 18:39:57 -0700 (PDT) In-Reply-To: <20090920223751.A1870@lua.tecgraf.puc-rio.br> References: <20090920223751.A1870@lua.tecgraf.puc-rio.br> Date: Mon, 21 Sep 2009 02:39:57 +0100 Message-ID: <65dfa39c0909201839q3429b3acq2cd9fbc35e222aba@mail.gmail.com> Subject: Re: unpack, pcall, nil From: Shaun McVey To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L1eMSv029717 You probably want to drop the unpack: function doit(...) local status, err = pcall(...) -- do something with status and err end On Mon, Sep 21, 2009 at 2:37 AM, Luiz Henrique de Figueiredo wrote: >> function doit() >>   local status, err = pcall(unpack(arg)) >>   -- do something with status and err >> end >> >> and >> >> doit(x, arg1, arg2, ...) >> >> Now the problem is arg1, arg2 etc can genuinely be nil, and unpack stops at nil. Is there any way I can get unpack to get all the entries in the table, whether or not they are nil? Thanks, > > use "..." instead of arg: > > function doit(...) >  local status, err = pcall(unpack(...)) >  -- do something with status and err > end > From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 23:05:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L25gxp032501; Sun, 20 Sep 2009 23:05:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7E7F192AF; Sun, 20 Sep 2009 23:05:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4C1119076 for ; Sun, 20 Sep 2009 23:05:03 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c3so1035321ana.26 for ; Sun, 20 Sep 2009 19:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ll0uX8qIfgtjyFZk+N4re4M/D3cvI6cGSIh/vgXKD5c=; b=vWkVswS07Fss/BY7s/xSiRMNvbr9DiBaQ+B16PhfKaFuXdM4WWDS4BmK1Bx0cTlUkf FPLyqJpVLz2w2qh5TYME2Zi3Ea8UpF+qBn/OK40JtJh+9ZHYdzC/NxeNVxI8pIc3xzDE eWWiCJxNAUBxwAz04ojMNne97pFRFK/t468pY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=unyyn63++h2TlbhL/RbHh2mki6C0Ae6AETxwLaD/0n5M6teQ7I8jTDm+qx91YHSoLU //UC38wQ8NjCjO1sjQnM1S5oRuk+C7BPEoLWQVOJYrX+Xet0np63VU8IXU8ejV5Avgxg 0trr+yfndpeqmtDGtrWtkcCUzsOM0FIPhPv8w= MIME-Version: 1.0 Received: by 10.101.17.6 with SMTP id u6mr3696306ani.78.1253498709735; Sun, 20 Sep 2009 19:05:09 -0700 (PDT) In-Reply-To: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> Date: Sun, 20 Sep 2009 23:05:09 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=00504501753151fa2b04740ce990 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504501753151fa2b04740ce990 Content-Type: text/plain; charset=ISO-8859-1 I guess you are right JC, maybe I will just do a simple "dofile" and worry with performance after. But knowing that it has some way around to increase performance in a easy way is very important. I had already faced problems that were easier to start allover again than to optimize in the way things were implemented. GrayFace, I do not get it... do you mean one script with a table where every script would register its own function? And would it really solve the problem? What do you all think of the following solution: int luaL_ref (lua_State *L, int t) the last function could be used to get the script that was read and loaded by lua_loadfile(), and after that I can insert the reference returned by luaL_ref in a hash table where I can late access to retrieve the reference and pass to the function lua_rawgeti(L, t, r), so that my function get inserted into the stack again and that I can call it again with pcall without the need to load! What do you think of that? --00504501753151fa2b04740ce990 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I guess you are right JC, maybe I will just do a simple "dofile" = and worry with performance after. But knowing that it has some way around t= o increase performance in a easy way is very important.=A0 I had already fa= ced problems that were easier to start allover again than to optimize in th= e way things were implemented.

GrayFace, I do not get it... do you mean one script with a table where = every script would register its own function? And would it really solve the= problem?=A0

What do you all think of the following solution:
int luaL_ref (lua_State *L, int t)
the last function could be used to g= et the script that was read and loaded by lua_loadfile(), and after that I = can insert the reference returned by luaL_ref in a hash table where I can l= ate access to retrieve the reference and pass to the function lua_raw= geti(L, t, r), so that my function get inserted into the stack again= and that I can call it again with pcall without the need to load!

What do you think of that?

--00504501753151fa2b04740ce990-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 20 23:31:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L2V6To001884; Sun, 20 Sep 2009 23:31:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 625A818E78; Sun, 20 Sep 2009 23:30:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D97FC18807 for ; Sun, 20 Sep 2009 23:30:32 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L2Ucc4001860 for ; Sun, 20 Sep 2009 23:30:38 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8L2UbU01988; Sun, 20 Sep 2009 23:30:37 -0300 Date: Sun, 20 Sep 2009 23:30:37 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: unpack, pcall, nil Message-ID: <20090920233037.A1985@lua.tecgraf.puc-rio.br> References: <20090920223751.A1870@lua.tecgraf.puc-rio.br> <65dfa39c0909201839q3429b3acq2cd9fbc35e222aba@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <65dfa39c0909201839q3429b3acq2cd9fbc35e222aba@mail.gmail.com>; from shaun.mcvey@gmail.com on Mon, Sep 21, 2009 at 02:39:57AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > You probably want to drop the unpack: yes, sorry, my bad. From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 00:07:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L377uX004693; Mon, 21 Sep 2009 00:07:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8880618EC5; Mon, 21 Sep 2009 00:06:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E92FB18CD2 for ; Mon, 21 Sep 2009 00:06:28 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so616368eye.39 for ; Sun, 20 Sep 2009 20:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=SmMFrDs/sNng11jfbmfGs6WeKC6NJfLjzRu9cZeMQs4=; b=aHcRcMDrfaZnOBCya7QRVbY5Jww5gLtns1jF4jb5ke8wbdLZmn/cLb7QCOhb2iBnK0 LpKlbJxWncCa8RQReATYq1IBJwSl+aCbJ9C+x6IKMrQTX6LB42sMkWiRwNvI3WYhfmVQ mj8iS+oTcnSFJTOsnZnnbCnbb2ueYqyFbUCfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uOLwfrLOLHfc2lhMYq+WuHBIxy+loAH6hvGWCeVFqndYCrVQqWEm6NENGBsWrbB9Mx hyUfnnISKKpVQ48CXH3A1DNT5/4Yhxi2cmSFQCXZSDWBJ49Iw25nixH89g74hzdOoWGi 0TISfzDTeLQhyF6batX8ZnUeqHJQtdkEg0pCM= MIME-Version: 1.0 Received: by 10.216.72.199 with SMTP id t49mr1134770wed.219.1253502394734; Sun, 20 Sep 2009 20:06:34 -0700 (PDT) In-Reply-To: References: Date: Mon, 21 Sep 2009 04:06:34 +0100 Message-ID: Subject: Re: unpack, pcall, nil From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L377uX004693 2009/9/21 Saurabh T : > I'm working with Lua scripts driving C code and trying to write a wrapper > around functions like so > > function doit() >   local status, err = pcall(unpack(arg)) >   -- do something with status and err > end > > and > > doit(x, arg1, arg2, ...) > > Now the problem is arg1, arg2 etc can genuinely be nil, and unpack stops at > nil. Is there any way I can get unpack to get all the entries in the table, > whether or not they are nil? Thanks, > saurabh As Luiz and Shaun have already pointed out, what you want here is pcall(...), instead. However, to directly answer your question as well anyway, there *is* a way to get unpack to get all the entries in a table, using optional extra parameters of unpack(): local a = {} a[5] = 'x' print(unpack(a)) --> (nothing) print(unpack(a, 1, table.maxn(a))) --> nil, nil, nil, nil, 'x' ...if you can improve on the performance of table.maxn() by knowing the number of elements in advance, so much the better. For a vararg list you can use select('#', ...) to get this. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 03:36:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L6a9XD019177; Mon, 21 Sep 2009 03:36:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CD3319143; Mon, 21 Sep 2009 03:35:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E312B190A3 for ; Mon, 21 Sep 2009 03:35:25 -0300 (BRT) Received: by fxm18 with SMTP id 18so2027605fxm.5 for ; Sun, 20 Sep 2009 23:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=sNjt13nJDxajDNHRnn+uKj7tTODdpTz1QhfmI8pCObY=; b=dSxlWNgHhpwy1tUXc2rb5nX5o1Mrbi+lrqF3oO0z0nYPNBsORA5XrE73gZraNsFn6q ewYirmT3NpP6mGDvJw3A3jSlz2Q8tJWNSX5hwklR47ap1GHQOeNFNzG4Kc5z2V57zyA+ p8OJjw0dSxozmuMDQMOIFAQ+rE/fzQYe6oWso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=F9CRzN8xm1+y7gxYg3r8LB1mX0jpytfUqbWjBp0M92osSwgs6khguw7TGepYN1iNvs 83u2zoDbR51yjWR8jJJoItZd0nfwuE2buR4GB5mA5FFMdoj/XRNtoZey66qZLMJ1u5Kw AyK07SVPWVoY5dAZv+W6Z6nKWImzkor/nYJdQ= MIME-Version: 1.0 Received: by 10.204.33.193 with SMTP id i1mr3947938bkd.75.1253514931658; Sun, 20 Sep 2009 23:35:31 -0700 (PDT) In-Reply-To: <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> Date: Mon, 21 Sep 2009 08:35:31 +0200 Message-ID: <560972290909202335s41843261k1b899c0c88a9e638@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L6a9XD019177 On Sun, Sep 20, 2009 at 9:58 PM, Jim Whitehead II wrote: >  * We need someone to take control of this project and lead it in a > particular direction.  This could be a small group of people, or a > benevolent dictator.  What won't work is design by committee, as one > day of this thread has already shown. Yes. Although emergent behavour can happen in a herd of cats, it can't be guaranteed to go in a sensible direction ;) I'm in, although my web development skills are probably dangerous. > There have been a lot of good ideas, and we have plenty we can talk > about.  For now, we need to see who is willing to help develop the > project.  We will certainly not be lacking on people willing to share > their opinions on how the project should work, and that's a good > thing. If I could suggest a parallel track - get an online basic version going asap so people can start 'seeding' the database with their favourite recipes. > It's good to see such enthusiasm.  I think having a single place for > this sort of support/community/discussion/material would be a great > thing for our community. Yes, I particularly liked the ActiveState site particularly because one could have structured discussions about recipes, another thing that wikis just don't do very well. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 04:05:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L75hf5022801; Mon, 21 Sep 2009 04:05:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE59A19144; Mon, 21 Sep 2009 04:05:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F41411902A for ; Mon, 21 Sep 2009 04:04:51 -0300 (BRT) Received: by fxm18 with SMTP id 18so2040509fxm.5 for ; Mon, 21 Sep 2009 00:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=V7PWHlDqQmLRTj8swbU8LYnKeZmOSV/16XBmBNHiLBI=; b=Mh++p6sH4qSx5wwE8vuBavBOidkT9Ln/9rHaYtZmpD4abJNN48+NsqKyczvndEFVLt wibjTPcmyacSS5mb0C+s1mtI6xbKJx8xeRBtKgGRGjkrvEWlzNbKOMHoD+ieFqyxSiW/ TeGu3XNslE7cssJ8uDytBPZWo8T1I3dsP34pI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cnkrj+ahq0LW3Dcu/UsLABlIsGrU5Lz3jxdAq2kG10qDOu4AulcoRVQMmFRA3XfOpj D5/XJmE2A3ZE7pdK/LEavSCWZOpT+Hrk78kLS9VTRoXf53sa4HqGSg0MCgLAGkpK2PDN /e4jDt0FpYlPCsfQ3Zh1v7bJX5t6Qdt4OQzks= MIME-Version: 1.0 Received: by 10.204.36.210 with SMTP id u18mr4000181bkd.19.1253516696303; Mon, 21 Sep 2009 00:04:56 -0700 (PDT) In-Reply-To: <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> Date: Mon, 21 Sep 2009 09:04:56 +0200 Message-ID: <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L75hf5022801 On Sun, Sep 20, 2009 at 9:58 PM, Jim Whitehead II wrote: > I've set up a GitHub project [1] in order to allow for easy > collaboration on this project.  Right now the setup script/environment > will almost certainly only work on unix machines, as that is where I > expect primary development to occur. That was rather painless! Only gotcha is that you are using curl instead of wget in the setup.h, replaced that and all worked as advertised. (OS X/Linux diff I guess) I shall start putting in recipes - but how do I get them back to you? steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 04:26:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L7Qfxf024944; Mon, 21 Sep 2009 04:26:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57AFF191D5; Mon, 21 Sep 2009 04:26:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FBC4190B5 for ; Mon, 21 Sep 2009 04:25:55 -0300 (BRT) Received: by bwz10 with SMTP id 10so1933611bwz.5 for ; Mon, 21 Sep 2009 00:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=BuAEtufK80b/Sj2outf3K/Ch1Iy3IsY9sjAOVKfPWoM=; b=M3uS7XmMMGSzImxUMcANevSBtrw0FTRU5HzQHW84SnizdQf89AsSfDp26k9ErRpEIQ 5oPFtxwwc2PmSsDVadyo2sCmyc+KYE0h7eTJzqz+x8jjFpiei/Y5EYt/8BsJXmtTglMQ /gKRtg7WCBjaL28RJj8VA3eUFJQrRfZNPbr1k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=rxMZasbAKFBvMs0YltM39PXRBDomdSIkht2elDKBpLx/t2bJYZGhy7t2h3I5NFcnAB WuRVtP9TnX0cl+yN0ot8Qut7snf5hnmpOOUBQLbvjjwg+mnlDemEihYDXR0o9JC8xu2w gocuTmmAcg9FlJUQOt5LanpyDiBQ2z/+Kz2JQ= MIME-Version: 1.0 Received: by 10.223.58.139 with SMTP id g11mr870845fah.43.1253517961123; Mon, 21 Sep 2009 00:26:01 -0700 (PDT) In-Reply-To: <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> From: Jim Whitehead II Date: Mon, 21 Sep 2009 08:25:41 +0100 Message-ID: <5fe281d40909210025l78022a26ke3a6868f87801268@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L7Qfxf024944 On Mon, Sep 21, 2009 at 8:04 AM, steve donovan wrote: > On Sun, Sep 20, 2009 at 9:58 PM, Jim Whitehead II wrote: >> I've set up a GitHub project [1] in order to allow for easy >> collaboration on this project.  Right now the setup script/environment >> will almost certainly only work on unix machines, as that is where I >> expect primary development to occur. > > That was rather painless!  Only gotcha is that you are using curl > instead of wget in the setup.h, replaced that and all worked as > advertised.  (OS X/Linux diff I guess) > > I shall start putting in recipes - but how do I get them back to you? That wasn't really my focus right now, we need a bit of work before we can start accepting recipes. Most likely, I'll set up a git repository for the wiki data. The snippets system that I'm using is a bit too primitive and raw.. it needs to be altered to work a bit better before we start flooding it =) From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 04:40:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L7e7eK026119; Mon, 21 Sep 2009 04:40:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 688D919299; Mon, 21 Sep 2009 04:39:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0D3C1912F for ; Mon, 21 Sep 2009 04:39:28 -0300 (BRT) Received: by fxm18 with SMTP id 18so2058307fxm.5 for ; Mon, 21 Sep 2009 00:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6dWkUJzBz+RWFHh6M9cOepPsEjPH1htsCIcupkzevV0=; b=S/9w0IjCMlUS/xRnueIsG3DgGyQKZJJ1Mol1oq9OStW85Vn2ToaQat34s6CmJoWmZd NtAri6NhAAFprQwnILBEMd0SbYEzo0ZzB0LTrkAAN0FR5E/6teA9UXPnAxTzHr+RPQIP IpPYH/BXP5xmyNUF3aXbdMPrrMMRj1dUd4xK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZcBuFknVTVeDo3lsdUgNrl2R7rY2qQBzkUdUDJgZU+x/f2tBye54PUN1ZHItZjS/oD sFL+9q1z3iKxOBMAgTVhpRrqk+rZMLuJz3HRkqeIxc44ofKFQT5oW2xjIsi/Bl7t+8kJ JH+Tsnr/7+ZBTaBHRMgQl5O4A+rqBfQuArtlg= MIME-Version: 1.0 Received: by 10.204.162.204 with SMTP id w12mr3998122bkx.18.1253518774541; Mon, 21 Sep 2009 00:39:34 -0700 (PDT) In-Reply-To: <5fe281d40909210025l78022a26ke3a6868f87801268@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909191211le4c1f1eyf1d88438b0ef3a81@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> <5fe281d40909210025l78022a26ke3a6868f87801268@mail.gmail.com> Date: Mon, 21 Sep 2009 09:39:34 +0200 Message-ID: <560972290909210039wdb2637bj9cdee9932c24e6e0@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 21, 2009 at 9:25 AM, Jim Whitehead II wrote: > That wasn't really my focus right now, we need a bit of work before we >t needs to be altered to work a bit > better before we start flooding it =) The basic add-a-snippet is working fine (maybe we need a remark to the effect that the markup is Markdown) but the preview is somewhat broken. Also, after entering a recipe, there is no obvious way to go back to the snippets page, I'm having to manually go back to http://localhost:8080/snippets. But these are early days... From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 04:43:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8L7hHVW026363; Mon, 21 Sep 2009 04:43:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FC0C192C4; Mon, 21 Sep 2009 04:42:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90714192AE for ; Mon, 21 Sep 2009 04:42:28 -0300 (BRT) Received: by bwz10 with SMTP id 10so1939881bwz.5 for ; Mon, 21 Sep 2009 00:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=TRFkut9/WoLFr+y8ccCnfgUfSfhyV7Ot9bYLC9A5JhY=; b=QZlzH/1Uzq3qZajQWzqbh7y8eDmYck90yp9gTbMQqqKWmfZgXkm9QK0n4Luu9NQjUy uhyjU8nacbpOfZrqPytHO9/TAqx+dW834/0l35PwjCtCCSUGvgAp9SeVMahuQo12TZ6Z T5QP0WQSjkYlGnzq/EdgTh1f0ZRHVkTfwrpxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=AuLPhHugva7BkFS6gF6kRpD9jzPulL+HJomZDt9EcunvVmeHEWSMpcGqGFkJWyh4sZ sD7GFR1ZpFsPkg4TAQdCftRH2jC4Oy9hxXHZYj4+ALfV6faUCKTuao+jAZlwa3Rbh7rx 1fd1zu/PKCqZwGjYl+RjkqHaVwSczYuUYxoXI= MIME-Version: 1.0 Received: by 10.223.58.139 with SMTP id g11mr873537fah.43.1253518953176; Mon, 21 Sep 2009 00:42:33 -0700 (PDT) In-Reply-To: <560972290909210039wdb2637bj9cdee9932c24e6e0@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> <5fe281d40909210025l78022a26ke3a6868f87801268@mail.gmail.com> <560972290909210039wdb2637bj9cdee9932c24e6e0@mail.gmail.com> From: Jim Whitehead II Date: Mon, 21 Sep 2009 08:42:13 +0100 Message-ID: <5fe281d40909210042l54c775a3jc0e3703e559f04d3@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8L7hHVW026363 On Mon, Sep 21, 2009 at 8:39 AM, steve donovan wrote: > On Mon, Sep 21, 2009 at 9:25 AM, Jim Whitehead II wrote: >> That wasn't really my focus right now, we need a bit of work before we >>t needs to be altered to work a bit >> better before we start flooding it =) > > The basic add-a-snippet is working fine (maybe we need a remark to the > effect that the markup is Markdown) but the preview is somewhat > broken.  Also, after entering a recipe, there is no obvious way to go > back to the snippets page, I'm having to manually go back to > http://localhost:8080/snippets. > > But these are early days... Indeed, the project was put up to have something (code-wise) that people could look at and elaborate on. Also, we should probably find a better place to hold this discussion, as I suspect the mailing list will get quite sick of our daily drivel. - Jim From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 07:31:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LAVl7s007304; Mon, 21 Sep 2009 07:31:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31A0718977; Mon, 21 Sep 2009 07:31:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FADF188EF for ; Mon, 21 Sep 2009 07:31:04 -0300 (BRT) Received: by fxm18 with SMTP id 18so2158412fxm.5 for ; Mon, 21 Sep 2009 03:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+3rRe7nW3DJvvVo+SBjh64t/RkMp8jgRyyPkoEkOBCk=; b=DkgZlYyWkZJR3kW/ugtmebYLpOftEvPRgqG5k3CJYrY691Uhm/LuE+FLRpqNXGNpAU LDotFGD8DpZfC5vhZBPHG2WSSgi6ZpceBnni5IA1/75OLk8+KWYL9BWFG4C6YnNehBiA RyxovuM0O59RVsoYsdZh38c8gsewF3fm5k4Zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uuVfoqBCLwHkQoKFeGo3veDpgw/VLZVAw/UNHCG2PHLTllz29Cg32A9oIz6HkjkkGg KW+c0QuPOe4aaQQd7+VM7zSxF1p16WlVYFezONK+W0aB1StEwAlWsD3YtBPjySdwC8Va uC3o41BG2z64FOEb2lZvVCMFJLHRFtTNb3f3Q= MIME-Version: 1.0 Received: by 10.204.0.69 with SMTP id 5mr4175945bka.173.1253529070124; Mon, 21 Sep 2009 03:31:10 -0700 (PDT) In-Reply-To: <5fe281d40909210042l54c775a3jc0e3703e559f04d3@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <4AB62B14.7090308@cowlark.com> <4AB65E57.1080309@013net.net> <8a25d01b0909200959v71841a9m40799fb7de078748@mail.gmail.com> <5fe281d40909201258y5ab85e88g42d73afa257e399@mail.gmail.com> <560972290909210004n5adc5c38jc31c4356e6255dfd@mail.gmail.com> <5fe281d40909210025l78022a26ke3a6868f87801268@mail.gmail.com> <560972290909210039wdb2637bj9cdee9932c24e6e0@mail.gmail.com> <5fe281d40909210042l54c775a3jc0e3703e559f04d3@mail.gmail.com> Date: Mon, 21 Sep 2009 12:31:10 +0200 Message-ID: <560972290909210331n2fa4ba90p9876814a20ef8cfc@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8LAVl7s007304 On Mon, Sep 21, 2009 at 9:42 AM, Jim Whitehead II wrote: > Indeed, the project was put up to have something (code-wise) that > people could look at and elaborate on.  Also, we should probably find > a better place to hold this discussion, as I suspect the mailing list > will get quite sick of our daily drivel. So I propose that any interested party write to you, and then you CC the interested parties. The technical part of this discussion is going underground ;) steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 07:37:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LAbZ7U007716; Mon, 21 Sep 2009 07:37:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FBC9189C4; Mon, 21 Sep 2009 07:37:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F2361888A for ; Mon, 21 Sep 2009 07:37:02 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MpgGU-0005RA-MK for lua@bazar2.conectiva.com.br; Mon, 21 Sep 2009 11:37:02 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id A7FF35005A for ; Mon, 21 Sep 2009 11:36:58 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:52921 with envelope Message-ID: <4AB75742.2060907@cowlark.com> Date: Mon, 21 Sep 2009 11:36:50 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Performance questions References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8LAbZ7U007716 zweifel wrote: > I guess you are right JC, maybe I will just do a simple "dofile" and > worry with performance after. But knowing that it has some way around to > increase performance in a easy way is very important. I had already > faced problems that were easier to start allover again than to optimize > in the way things were implemented. You're analyzing this way too hard --- this is much easier than you think! When you load a Lua script it turns into a compiled chunk. Then you run the chunk. A script like this: function foo() print("foo!") end ...turns into a chunk which, *when run*, will add a function foo() to the Lua VM. This function will remain there until the VM is destroyed (or more Lua code changes it). One a function is in the VM, you can easily and efficiently look it up and run it at any time. So all you need to do is to structure your AI code so that all the scripts get loaded once, on startup, and then all you need to do every frame is: lua_getglobal(L, "foo"); lua_pcall(L, ...); > GrayFace, I do not get it... do you mean one script with a table where > every script would register its own function? Almost. The Lua VM will keep track of functions for you (all globals are stored in a table called _G). So you don't actually need to go to any extra effort to do so yourself. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 08:55:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LBtpQI016058; Mon, 21 Sep 2009 08:55:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A54118B06; Mon, 21 Sep 2009 08:54:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92D3518A4B for ; Mon, 21 Sep 2009 08:54:06 -0300 (BRT) Received: by fxm18 with SMTP id 18so2207834fxm.5 for ; Mon, 21 Sep 2009 04:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=EUnDEEKCx99OSTBVq7HVY431VehJzh3WgAkRZv+ATUk=; b=uG3tgFeQOFiF45NgVKA2W04oGUBCxqd5FXLUFxfdOPjsy7Tt2DVdLuX8GWwpKKGSFV 3/2YBHvif1ELAVhfRFQFsCNPgsa97f1cioIkRR6HXr9fcoLcqa72p64N93llmYqJTZa2 LSI0ziOkLZlWd1IAPoFAVfmckGPsDV/gEotjk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rJGRdcKKUntBsplBQDl7RVln0HNTOVu0tPwS8MRPs4hbW5Y/2wKF3sbh5RgVV/CksP fKdRNBABGVy2a0DtXfQZyoKIgCzd91oPQJMXIt6wd/GMYWA20VHHKOzr9ozIbLxRTrPq 92EnS913fqfGLK3vbG83vrWcJVnn0BiAklago= MIME-Version: 1.0 Received: by 10.204.8.155 with SMTP id h27mr4213002bkh.55.1253534048829; Mon, 21 Sep 2009 04:54:08 -0700 (PDT) Date: Mon, 21 Sep 2009 13:54:08 +0200 Message-ID: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> Subject: Ftp server in lua? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all! I'm wondering if anyone has implemented a ftp server in lua, or if there is such a project somewhere? /Pierre From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 13:08:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LG8q8M031519; Mon, 21 Sep 2009 13:08:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6059A18822; Mon, 21 Sep 2009 13:08:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6730E187CD for ; Mon, 21 Sep 2009 13:07:59 -0300 (BRT) Received: by bwz10 with SMTP id 10so2243786bwz.5 for ; Mon, 21 Sep 2009 09:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=4STqSXt/V4xy2U3Nba+H1onjD86sY0n8KdOfXHgdCh4=; b=IvXG4AXvg8kfYj2yUXxXZbNgJkt+H5yFb1UIR0zXmrfBr64DRtnSZXEf08BUXgL9iY U+iUIdFwh6sFp7BkKhoaGUyi7PR4pKNGI7wTdFy7xbaEQP78//aBj72o7Beme337ibbR NJeXEkk7poreWCnG4au/AfDzI7cQ0jVchClu0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Q3bJlgKHJMXCmly1wpL3qrpLgEWByniqUIioPGZ6OUZnz+A1ZGMAC2ZFLqK+WBdr3f 9FOLF/hkghdoaff/lUZXXekTzHq97VzzQeahrynVpK0NEjfllI7sjDXgJ45I5GnAn3UH 2Z7PAn1cUTI3BmZez8PhPEEeUouSfk0NjutQg= Received: by 10.204.161.197 with SMTP id s5mr4448279bkx.8.1253549284018; Mon, 21 Sep 2009 09:08:04 -0700 (PDT) Received: from ?192.168.1.34? ([85.4.4.213]) by mx.google.com with ESMTPS id y15sm301075fkd.27.2009.09.21.09.08.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Sep 2009 09:08:02 -0700 (PDT) Message-Id: <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Ftp server in lua? Date: Mon, 21 Sep 2009 18:07:30 +0200 References: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 21, 2009, at 1:54 PM, Pierre LeMoine wrote: > I'm wondering if anyone has implemented a ftp server in lua, or if > there is such a project somewhere? Not that I know of, but... out of curiosity... what do you use FTP for in 2009? xFTPd appears to be scriptable: "Scripting capability provided by Lua xFTPd's central FTP server is entirely driven by Lua to control the user's interaction with the file system, the file servers, the configuration, the IRC client, and also to extend its capabilities without going through the process of compiling the sources for every modification. Lua also reduce the server's down-time by allowing the system administrator to add, remove, modify and reload any Lua script in real time without shutting down the FTP access to users." http://www.xftpd.org/wiki.php?Features From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 17:36:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LKZZvv026797; Mon, 21 Sep 2009 17:35:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE8FC18FD6; Mon, 21 Sep 2009 17:34:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B1B318866 for ; Mon, 21 Sep 2009 17:34:44 -0300 (BRT) Received: by fxm12 with SMTP id 12so370920fxm.5 for ; Mon, 21 Sep 2009 13:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fGjFQ07x+f909FxTSVcceZuDxslGwIEgcXceQB87VU4=; b=O+DNvRjZfyf9oIFC8VbQUpVm4Zsz5M09YIO0NMQ0tbuiVu8DDcsE2uPccGe+T40J8t vtNmYmGqOBZrl+goNJg+vK2vW2IhtIo814ptWFN50+4Dl3+yy5Xf0jb+ZRlMYVftsJru EcaZKUP3FY2lW1ZESbadQ4Ki13/BEv13i/tho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mB4eC5FN3NGM7q0dmw5pCldfB121C2nB3naNpe0l2PipwVlzH4206oeaGyxsyMUlOl pmQbRWZDIusrXntxLnPnN+2D5F+NCY/d0lIDsM527tJZRyJzgynz3yGESRuz2Y9Nf/hJ tr3u08/tLsFyVzY/lmSPbHrIPvbT25PpqjxhM= MIME-Version: 1.0 Received: by 10.204.10.143 with SMTP id p15mr12729bkp.167.1253565289635; Mon, 21 Sep 2009 13:34:49 -0700 (PDT) In-Reply-To: <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> References: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> Date: Mon, 21 Sep 2009 22:34:49 +0200 Message-ID: <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> Subject: Re: Ftp server in lua? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Not that I know of, but... out of curiosity... what do you use FTP for in > 2009? remote file storage of course =p do you have any superior alternative to recommend? > > xFTPd appears to be scriptable: > Thanks for the suggestion, i'll check this out. It may be enough for my needs =) /Pierre From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 17:51:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LKokv0030226; Mon, 21 Sep 2009 17:51:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBCD3189E3; Mon, 21 Sep 2009 17:50:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 381E4188A1 for ; Mon, 21 Sep 2009 17:50:06 -0300 (BRT) Received: by ewy26 with SMTP id 26so3589456ewy.5 for ; Mon, 21 Sep 2009 13:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:reply-to:to:subject :message-id:user-agent:mime-version:content-type; bh=0LGGgO/ppXimxxoQtM3/EjgxwQx+rrOi+NM27bT5Ywc=; b=P+cdrS94wk9O0j/o0r+cp9pfHFstEv3ihYRyXHnNFsjG1uSZTNANiHflLSBJZtI3VJ jMPDvPRyoAJpIIUphmRFuQPReCQ2G4Wbal5a+EBVnS4A1oiC+pmFynyOC9YY7qsHOGtd AccqjgkoLio0vKMC5GPYQWZt9Wkf+WM8QALWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:reply-to:to:subject:message-id:user-agent:mime-version :content-type; b=QpIQ4jSpG/bbxaQlfMg232NuvQBOBjXP2O6foFkmqki1PcbxekKXwXikVRgOwLuAZ8 SwcMgCR8DiMun+2d0kiV6fgVV5dzJlubyEVv3abd5Vxa8S8598xWhBjouQZ6ZHBeHRc3 lbqtyfrWwEw1V/wUNh6N4Ai32HajjagFEJ3DE= Received: by 10.211.129.20 with SMTP id g20mr88930ebn.12.1253566211929; Mon, 21 Sep 2009 13:50:11 -0700 (PDT) Received: from muon.home (pool-96-232-54-67.nycmny.east.verizon.net [96.232.54.67]) by mx.google.com with ESMTPS id 5sm39157eyh.43.2009.09.21.13.50.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Sep 2009 13:50:11 -0700 (PDT) Date: Mon, 21 Sep 2009 16:50:05 -0400 (EDT) From: Leo Razoumov To: Lua list Subject: length operator # for tables with metatables Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Everyone, Lua manual defines length operator "#" for tables as follows: "The length of a table t is defined to be any integer index n such that t[n] is not nil and t[n+1] is nil; moreover, if t[1] is nil, n can be zero. For a regular array, with non-nil values from 1 to a given n, its length is exactly that n, the index of its last value. If the array has "holes" (that is, nil values between other non-nil values), then #t can be any of the indices that directly precedes a nil value (that is, it may consider any such nil value as the end of the array)." As one can see from the definition above tbl[#tbl+1] must always be nil. Unfortunately, it is not the case when table has a metatable as the following example illustrates: a={11,22,33} t= setmetatable({}, {__index=a}) print("#a = "..#a) print("#t = "..#t) print("t[#t+1]= "..t[#t+1]) The output: #a = 3 #t = 0 t[#t+1]= 11 #t is zero while t[1], t[2] and t[3] are non-nil. Apparently, this behavior contradicts just mentioned paragraph from the manual. The situation can be made even more bizarre if one sets __newindex as well. a={11,22,33} t= setmetatable({}, {__index=a,__newindex=a}) print("#a = "..#a) print("#t = "..#t) t[#t+1] = "AA" print("a[1] = ".. a[1]) The output: #a = 3 #t = 0 a[1] = AA Now, instead of appending a new table entry, t[#t+1] = "AA" overrides the value of a[1]. Of course, I can always redefine __len meta-method to bring some sanity to the table. What worries me, though, is that the default behavior is so messy. Am I missing something? --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 18:08:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LL857s001680; Mon, 21 Sep 2009 18:08:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E0A819182; Mon, 21 Sep 2009 18:07:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE93718EC5 for ; Mon, 21 Sep 2009 18:07:22 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so768185eye.39 for ; Mon, 21 Sep 2009 14:07:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.155.2 with SMTP id c2mr3554543ebe.23.1253567247957; Mon, 21 Sep 2009 14:07:27 -0700 (PDT) In-Reply-To: <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> References: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> Date: Mon, 21 Sep 2009 16:07:27 -0500 Message-ID: <90eb1dc70909211407x640c7cb6qcbc736911686a426@mail.gmail.com> Subject: Re: Ftp server in lua? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 21, 2009 at 3:34 PM, Pierre LeMoine wrote: >> Not that I know of, but... out of curiosity... what do you use FTP for in >> 2009? > remote file storage of course =p do you have any superior alternative > to recommend? WebDAV is the only thing that comes close. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 18:18:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LLHXTJ003468; Mon, 21 Sep 2009 18:17:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F03F3191F2; Mon, 21 Sep 2009 18:17:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6882518EC5 for ; Mon, 21 Sep 2009 18:16:57 -0300 (BRT) Received: by ewy26 with SMTP id 26so3610685ewy.5 for ; Mon, 21 Sep 2009 14:17:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.13.7 with SMTP id a7mr34719wea.0.1253567822756; Mon, 21 Sep 2009 14:17:02 -0700 (PDT) In-Reply-To: <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> References: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> Date: Mon, 21 Sep 2009 22:17:02 +0100 X-Google-Sender-Auth: e04dd4cbcfac6b29 Message-ID: Subject: Re: Ftp server in lua? From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 21, 2009 at 9:34 PM, Pierre LeMoine wrote: >> Not that I know of, but... out of curiosity... what do you use FTP for in >> 2009? > remote file storage of course =p do you have any superior alternative > to recommend? SFTP From lua-bounces@bazar2.conectiva.com.br Mon Sep 21 19:25:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8LMPOAj014041; Mon, 21 Sep 2009 19:25:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BA1319180; Mon, 21 Sep 2009 19:24:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8432818959 for ; Mon, 21 Sep 2009 19:24:39 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 85C88384958BE for ; Tue, 22 Sep 2009 05:24:21 +0700 (NOVST) Message-ID: <003e01ca3b0a$437e41a0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: Subject: Re: length operator # for tables with metatables Date: Tue, 22 Sep 2009 05:24:16 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Tue, 22 Sep 2009 05:24:21 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Length operator ignores __index metamethod. This way it is fast and predictable. It also ignores __len metamethod of tables and strings, again, this makes it predictable and faster - for tables and strings it has a definite meaning which cannot be altered. The same logic is used in other operators. Here is how # operator works, from the Manual: function len_event (op) if type(op) == "string" then return strlen(op) -- primitive string length elseif type(op) == "table" then return #op -- primitive table length else local h = metatable(op).__len if h then -- call the handler with the operand return (h(op)) else -- no handler available: default behavior error(···) end end end ----- Original Message ----- From: Leo Razoumov To: Lua list Sent: Tuesday, September 22, 2009 3:50 AM Subject: length operator # for tables with metatables Hi Everyone, Lua manual defines length operator "#" for tables as follows: "The length of a table t is defined to be any integer index n such that t[n] is not nil and t[n+1] is nil; moreover, if t[1] is nil, n can be zero. For a regular array, with non-nil values from 1 to a given n, its length is exactly that n, the index of its last value. If the array has "holes" (that is, nil values between other non-nil values), then #t can be any of the indices that directly precedes a nil value (that is, it may consider any such nil value as the end of the array)." As one can see from the definition above tbl[#tbl+1] must always be nil. Unfortunately, it is not the case when table has a metatable as the following example illustrates: a={11,22,33} t= setmetatable({}, {__index=a}) print("#a = "..#a) print("#t = "..#t) print("t[#t+1]= "..t[#t+1]) The output: #a = 3 #t = 0 t[#t+1]= 11 #t is zero while t[1], t[2] and t[3] are non-nil. Apparently, this behavior contradicts just mentioned paragraph from the manual. The situation can be made even more bizarre if one sets __newindex as well. a={11,22,33} t= setmetatable({}, {__index=a,__newindex=a}) print("#a = "..#a) print("#t = "..#t) t[#t+1] = "AA" print("a[1] = ".. a[1]) The output: #a = 3 #t = 0 a[1] = AA Now, instead of appending a new table entry, t[#t+1] = "AA" overrides the value of a[1]. Of course, I can always redefine __len meta-method to bring some sanity to the table. What worries me, though, is that the default behavior is so messy. Am I missing something? --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 04:39:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M7dier007020; Tue, 22 Sep 2009 04:39:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23A28192E9; Tue, 22 Sep 2009 04:39:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA436192D8 for ; Tue, 22 Sep 2009 04:38:54 -0300 (BRT) Received: by bwz10 with SMTP id 10so2674088bwz.5 for ; Tue, 22 Sep 2009 00:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=e0DG/0m+lclMm+YQmzJBp1+N+wHN+zXxkdrvvJX1Xvc=; b=NRXgTbFVWrVQgLjA4TF0ZJyLrIv/x9bsPC87yeqZhaA9xU3YR/sBR8MS1gGBeQuzjf r37ZaHM4vlgQJLdlqzhI29AGarnujffvtfaEaqKxanaQNK0yJy7+7vNILl8mbY7tuqTg Oh30LZXuiFrfBUbDv5d9YWwbNLOCI88BQN1E0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nR4bxIc7ua3vLoM+W2DGISLi+gLf40QvtM+UrcrHWewqyTo6G7q2yugpAA+KF/vd5h wbctnG5uEac5ooQxuV+x5AMbXAW44nNy21xylM+ctNLHS4NzmO7xfaXfPqskumYF8+rh HlzZ+sJ7wRzXCh9eK3uq8oplviBBw0lVEjrIU= MIME-Version: 1.0 Received: by 10.204.18.137 with SMTP id w9mr535368bka.56.1253605140518; Tue, 22 Sep 2009 00:39:00 -0700 (PDT) Date: Tue, 22 Sep 2009 09:39:00 +0200 Message-ID: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Subject: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, David M and myself were discussing the second question of the FAQ: http://batbytes.com/luafaq/#T1.2 He thought that Lua is not that commonly used as a general purpose language, but rather as an embedded scripting language. This is probably true. But the question du jour is more whether Lua can be used as a good introduction to programming, not necessarily as a 'trade skill'. In the same way, CS departments have variously used Pascal or Scheme for this purpose. Although Pascal was a rather frustrating language at the time (Brian Kernighan has an interesting essay on the subject) it was very good when I was a recovering FORTRAN programmer. (And Scheme is definitely not a 'trade skill') So, in other words, does it teach the basic concepts well? Your answers will help #T1.2 have a less idiosyncratic answer ;) steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 05:28:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M8SFWt010833; Tue, 22 Sep 2009 05:28:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 349D9192EA; Tue, 22 Sep 2009 05:27:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F212C192D5 for ; Tue, 22 Sep 2009 05:27:29 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 4so645765eyf.5 for ; Tue, 22 Sep 2009 01:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=smWXyCDYYzlRcDq6B+3cD2+u8orjlafkmRuhVzqx1Uk=; b=D0WkEr3WgoMF5aLqc8dhjxYn9If0sJA8EwtrifOt9O08Oof2qYWAqlDJAlsSKn3UXl MDkH62tyXWDnvB8NLSP0TrujEk3iZ44UBav39+7VwJkH7SJ+RH/2LUmq3NTneot0q8ma inNRq/qnewt9O6x8iCT8+BonqZYkVcCPu+A3U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=RHVIJc/SmlTfQ83jEYf767J8T4nnSFJhmw5h0zeOJcrAIcc21ikAk5c79Mf8FjxrOl yL3t5GhkmiWZ/06Kro9p7/XlHXcG7YaFi7k1BiOY+6r0bPB8A9uWF2OdVks3t01JpR7y XK/UXM2o5nuPB/PKRIQXZQKzvqc6rss9BOcvs= MIME-Version: 1.0 Received: by 10.216.17.136 with SMTP id j8mr159869wej.226.1253608055216; Tue, 22 Sep 2009 01:27:35 -0700 (PDT) In-Reply-To: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> From: Jerome Vuarand Date: Tue, 22 Sep 2009 10:27:15 +0200 Message-ID: <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/22 steve donovan : > David M and myself were discussing the second question of the FAQ: > > http://batbytes.com/luafaq/#T1.2 > > He thought that Lua is not that commonly used as a general purpose > language, but rather as an embedded scripting language. This is > probably true. > > But the question du jour is more whether Lua can be used as a good > introduction to programming, not necessarily as a 'trade skill'. In > the same way, CS departments have variously used Pascal or Scheme for > this purpose. Although Pascal was a rather frustrating language at > the time (Brian Kernighan has an interesting essay on the subject) it > was very good when I was a recovering FORTRAN programmer. (And Scheme > is definitely not a 'trade skill') > > So, in other words, does it teach the basic concepts well? Your > answers will help #T1.2 have a less idiosyncratic answer ;) I think Lua would be a very good first programming language, it can teach most procedural languages features. However teaching some of its advanced features (like coroutines or tail calls) might make the transition to real world languages (ie. C++ and Java) harder. But hopefully raising programmer expectation might help the market improve by itself. Another point that could be problematic is that, still compared to C++ and Java, Lua is fully imperative, while these former two are part imperative, part declarative. However most Lua programs and libraries are written in a pseudo-declarative style anyway, so that might not be a concern. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 06:40:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M9erXA016211; Tue, 22 Sep 2009 06:40:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBB19192F2; Tue, 22 Sep 2009 06:40:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A5711912F for ; Tue, 22 Sep 2009 06:40:04 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mq1qs-0005Lv-Hb for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 11:40:02 +0200 Received: from p5b2c2f43.dip.t-dialin.net ([91.44.47.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 11:40:02 +0200 Received: from dak by p5b2c2f43.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 11:40:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 11:39:36 +0200 Organization: Organization?!? Lines: 84 Message-ID: <87fxaftj1j.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2f43.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:vBknpeM1WsT1s8CgS58ETZuG+xc= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > Hi all, > > David M and myself were discussing the second question of the FAQ: > > http://batbytes.com/luafaq/#T1.2 > > He thought that Lua is not that commonly used as a general purpose > language, but rather as an embedded scripting language. This is > probably true. > > But the question du jour is more whether Lua can be used as a good > introduction to programming, not necessarily as a 'trade skill'. In > the same way, CS departments have variously used Pascal or Scheme for > this purpose. Although Pascal was a rather frustrating language at > the time (Brian Kernighan has an interesting essay on the subject) it > was very good when I was a recovering FORTRAN programmer. (And Scheme > is definitely not a 'trade skill') > > So, in other words, does it teach the basic concepts well? Your > answers will help #T1.2 have a less idiosyncratic answer ;) Lua's data structures are not that of the underlying computer. It does not teach you what is computationally expensive, and what not. And since it has only one, it does not teach you how to pick. For that, C is a rather good fit (the seminal "Art of Computer Programming" restricts itself to assembly language), with exceptions in the area of arithmetic, where accessing the carry flag and mixed precision operations are not practical. C++ (also Java) build large complex languages over a C foundation. Those buildings don't add anything of value that Lua does not also provide. C++ is designed like the button layout of a typical bandonion: there is a small specialized regular area left and right that is just like its earliest predecessors, the diatonic accordion where you had to change bellows direction on each note for a scale, and had simple accompaniment on the left side. Around that, layers of irregular help buttons have grown in order to have more and more notes available, like on other instruments. And the thing has become so heavy that changing bellows direction became less feasible, and so more buttons are added to be able to avoid changing directions. The thing nowadays has a mostly feature-complete collection of notes left, right, and for push and pull, and all of those four are completely different due to historical reasons. Now look at a typical Argentinian playing tango: he never even _pushes_ the thing (because then he would have to double the notes and layouts he has to learn by heart, and on push the thing reaches further, but is not as complete), so you could just glue half of the reeds shut and improve the air balance for those reeds that are actually used. There is historical sense and reason behind the layout, but unless he actually learnt playing on one of the smaller predecessors of his instrument, that's totally lost to him. Which brings us to chromatic accordions. You don't get to carefully select whether to play a phrase or a part of the phrase on the push or pull (like true masters would), because you get the same sound, anyway: it is unisonoric. And the notes are arranged sort of linearly with regard to pitch. Oh, by the way: anybody want to buy a Hohner Morino Club N accordion? Perfectly in tune, and quite more coherent than a bandonion, even though it is diatonic/bisonoric. Uh, I digress. For the FAQ answer: Lua provides a rather well-sorted toolbox of excellent tools for solving programming problems. While it severely limits your ways of tailoring data structures to make the best fit between problem and machine, the available possibilities are typically fine. "Serious" programming nowadays heavily relies on frameworks and libraries, and those are quite more limiting usually and also shield you from data structure choices of your own. When the difference effectively boils down to "you don't want to know" vs "there is nothing more to know", the latter choice will let you focus on your work and provides safety against fighting with strange side effects. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 06:46:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M9kNQU016541; Tue, 22 Sep 2009 06:46:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 307E419319; Tue, 22 Sep 2009 06:45:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout02.plus.net (relay.pcl-ipout02.plus.net [212.159.7.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3F5319306 for ; Tue, 22 Sep 2009 06:45:50 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEk5uErUnw6R/2dsb2JhbADWJQmEEgU Received: from ptb-relay01.plus.net ([212.159.14.145]) by relay.pcl-ipout02.plus.net with ESMTP; 22 Sep 2009 10:45:52 +0100 Received: from [80.229.242.93] (helo=iyonix) by ptb-relay01.plus.net with esmtp (Exim) id 1Mq1wV-00085U-Ii for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 10:45:51 +0100 Date: Tue, 22 Sep 2009 10:45:43 +0100 From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> In-Reply-To: <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: 6912ece6aff84c10bf6bcdd681668014 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> you wrote: > > But the question du jour is more whether Lua can be used as a good > > introduction to programming, not necessarily as a 'trade skill'. > I think Lua would be a very good first programming language, I can only speak for myself, but I never really understood object-oriented programming until I encountered Lua. The reason for this, I think, is that Lua lets you maintain a reasonably accurate mental picture of how data is structured in memory. Tables may be implemented in a subtle way, but one can employ oversimplifications (such as blocks of pointers) that help imagination. The fact that dot (.) and colon (:) in Lua are syntactic sugar expressible in terms of table-lookup I found enlightening. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 06:55:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M9tLXn017329; Tue, 22 Sep 2009 06:55:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 580EF192C1; Tue, 22 Sep 2009 06:54:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37D6518E58 for ; Tue, 22 Sep 2009 06:54:49 -0300 (BRT) Received: by fxm12 with SMTP id 12so704603fxm.5 for ; Tue, 22 Sep 2009 02:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/x8f7ixFKTJuLK94aQQAs8ZT5lYl/N+U7Eh8Gg54m0Q=; b=IyN2ZEwFtzORROMY2+X4RIRvU2JHibpX+/uxukcOxBYBB8OtSU3U2G4cbQatjmX5eO UcO/7JUDviaUEhSJFU2XHowZlB74v78A/XH+Q2UuUDMYltIs3mxPfOT6Zl7D3bEb/S4I D6gdsDWvTDozSOsIG6kDXo9V72YS94D3F/a8E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rwAfzPK9NJM5sHQ37Z2hPWewB1C6h1TbfjinVyZboYws9FVbAsekqH7OvcojTgfRRy TdsOT5yvE+cSuMyHZpVGJK5688H/ptNGTmk56vO5YbczP13H3X0TK6+TgS0TCfpsjhOJ 2qXOhejCD//OIzfCyGLAxFi8WBaSSpoDPbPg8= MIME-Version: 1.0 Received: by 10.204.161.197 with SMTP id s5mr658228bkx.8.1253613295415; Tue, 22 Sep 2009 02:54:55 -0700 (PDT) In-Reply-To: <87fxaftj1j.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87fxaftj1j.fsf@lola.goethe.zz> Date: Tue, 22 Sep 2009 11:54:55 +0200 Message-ID: <560972290909220254s2cb0b1b5w5121c2677666eda9@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8M9tLXn017329 On Tue, Sep 22, 2009 at 11:39 AM, David Kastrup wrote: > Lua's data structures are not that of the underlying computer.  It does > not teach you what is computationally expensive, and what not.  And > since it has only one, it does not teach you how to pick.  For that, C > is a rather good fit Yes, if you were teaching how computers actually work, which makes it a good _second_ language. > Uh, I digress. But an entertaining comparison! Has C++ _ever_ been compared to an accordion before? By comparison, C is one of those little squeeze boxes that is an essential part of Afrikaans folk music. > Lua provides a rather well-sorted toolbox of excellent tools for solving > programming problems.  While it severely limits your ways of tailoring > data structures to make the best fit between problem and machine, the > available possibilities are typically fine. Creativity flourishes through limitation ;) >  "Serious" programming > nowadays heavily relies on frameworks and libraries, and those are quite > more limiting usually and also shield you from data structure choices of > your own. Java frameworks always remind me of filling in forms in triplicate. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 06:57:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8M9vO0a017504; Tue, 22 Sep 2009 06:57:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39AD219326; Tue, 22 Sep 2009 06:56:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BB6618E58 for ; Tue, 22 Sep 2009 06:56:53 -0300 (BRT) Received: by bwz10 with SMTP id 10so2740706bwz.5 for ; Tue, 22 Sep 2009 02:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=T2VdJflSM/flsmLfwX1tfCmJNgYf9bOY0T3lAdHTJuc=; b=vCRj1mfmV26Ok1evdNZ5SIf/HhLJqNSBpgBmMfCfjFt470j+f/Z/X2N1Zb/N+8bP+A sIwWCN8qBJ1jnVtQLjE6tAdQqxPwySbpezoQRAazp/q/YHc4YsrYQCH+x6TUvfhiCpLF oiP22OJqCS7AJk9pjBiTciryq2FmAe293rHRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=a7ZWs0SXf7YccNULRwRTG8bh145iDoPVDqWfVOrCdflxQTHqGTBn/W0Es2BenYoxCl xIcPqTiUcoAZWtoT2pp3KL3yS00vyPY+bQWuU2GNnEr+5q3hyHGyEyXd6ALRo1hl6ZxY YCC/O39tmAWkSkRXrfGx9urxYU1CRqhhlZtF8= MIME-Version: 1.0 Received: by 10.204.153.24 with SMTP id i24mr648207bkw.114.1253613419131; Tue, 22 Sep 2009 02:56:59 -0700 (PDT) In-Reply-To: <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> Date: Tue, 22 Sep 2009 11:56:58 +0200 Message-ID: <560972290909220256x6c109972y70f328e979f93bb2@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 10:27 AM, Jerome Vuarand wrote: > I think Lua would be a very good first programming language, it can > teach most procedural languages features. However teaching some of its > advanced features (like coroutines or tail calls) might make the > transition to real world languages (ie. C++ and Java) harder. A little feature envy never hurt anyone ;) Another such feature is having proper closures, which opens up the way for the functional style of programming. Indeed, a lot of C++/Java class use is compensating for lack of closures. > Another point that could be problematic is that, still compared to C++ > and Java, Lua is fully imperative, while these former two are part > imperative, part declarative. However most Lua programs and libraries > are written in a pseudo-declarative style anyway, so that might not be > a concern. In those languages, declaration is essential, in Lua a matter of style. Whether this is considered a good thing, is itself a matter of style. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 07:20:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MAKH8J019240; Tue, 22 Sep 2009 07:20:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5DA81934C; Tue, 22 Sep 2009 07:19:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BC9C1931F for ; Tue, 22 Sep 2009 07:19:39 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mq2TG-0001AA-Nl for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 12:19:42 +0200 Received: from p5b2c2f43.dip.t-dialin.net ([91.44.47.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 12:19:42 +0200 Received: from dak by p5b2c2f43.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 12:19:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 12:19:12 +0200 Organization: Organization?!? Lines: 27 Message-ID: <877hvrth7j.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87fxaftj1j.fsf@lola.goethe.zz> <560972290909220254s2cb0b1b5w5121c2677666eda9@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2f43.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:tSaDR8dpsqBRWfPBnHz/CEDmqIU= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > On Tue, Sep 22, 2009 at 11:39 AM, David Kastrup wrote: >> Lua's data structures are not that of the underlying computer.  It does >> not teach you what is computationally expensive, and what not.  And >> since it has only one, it does not teach you how to pick.  For that, C >> is a rather good fit > > Yes, if you were teaching how computers actually work, which makes it > a good _second_ language. > >> Uh, I digress. > But an entertaining comparison! Has C++ _ever_ been compared to an > accordion before? A bandonion. > By comparison, C is one of those little squeeze boxes that is an > essential part of Afrikaans folk music. Actually, my main instrument is like Ada. Regular layout left and right, five addressable octaves on each side, and you have a slider for specifying the location of the octave break in the chord section (which is not changeable for sane instruments). -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 07:28:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MASovI019985; Tue, 22 Sep 2009 07:28:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 768681934E; Tue, 22 Sep 2009 07:28:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFC5C19331 for ; Tue, 22 Sep 2009 07:28:15 -0300 (BRT) Received: by ewy26 with SMTP id 26so4027487ewy.5 for ; Tue, 22 Sep 2009 03:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=ck/LnuzAJh1icgO2h6HEcTf5CX0Em+Mn6wMgDo/1Asg=; b=k9SRp+6qf0Gga1/Z+4ZChTM/J9BxdnEl5Tmg9uqjySiqGiuMoXdpmMKjj5SsHrS6s8 hvT+7ibXGSTP/naoXc3XDwzyauNDnGMFz9BJySZ0LFoyFrsAp/7RiAYnQPaYHdSwEITO sGfO8ki2xLfiSXZpSu8uO/GdgBq1xYL8TTsN4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=F5C1d8G28Hqaoqz5kdxqvRhU+IXF4eCeD+Yvhl9vUSXiG1nezMghiN9rTbc1+380kl PAK+DTOCqQMPnJjbIVTGwGHt10mbnGWKisVltKgfbENMT9gfue2S1g6+fGakedbBQ0KF Q/WGI6jmeyZYtZvfw4v+wZEZXky4hKuud5Y1c= MIME-Version: 1.0 Received: by 10.216.70.209 with SMTP id p59mr180528wed.120.1253615301799; Tue, 22 Sep 2009 03:28:21 -0700 (PDT) In-Reply-To: <003e01ca3b0a$437e41a0$6600a8c0@sat3> References: <003e01ca3b0a$437e41a0$6600a8c0@sat3> Date: Tue, 22 Sep 2009 06:28:21 -0400 Message-ID: Subject: Re: length operator # for tables with metatables From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 9/21/09, GrayFace wrote: > Length operator ignores __index metamethod. This way it is fast and > predictable. It also ignores __len metamethod of tables and strings, again, > this makes it predictable and faster - for tables and strings it has a > definite meaning which cannot be altered. > [..snip..] "Programming in Lua" book (PiL) strongly encourages idiom t[#t+1]=v to append new value to a table. In this idiom t[i] uses meta-methods for index resolution while #t ignores them entirely. This could cause very hard to find bugs. function foo(tbl, val) tbl[#tbl+1]= val return tbl end If tbl is a regular table without meta-methods foo works as expecting and appends val to the end of tbl. If, on another hand, as a tbl one passes a table that has metatable with __index and __newindex set as follows a={11,22,33} tbl= setmetatable({}, {__index=a,__newindex=a}) foo(tbl, "AA") will override the value a[1] instead of appending. I do not see how can one remedy the situation. As you rightfully pointed out, __len meta-method is ignored for tables. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 07:56:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MAubvk022291; Tue, 22 Sep 2009 07:56:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33A441934B; Tue, 22 Sep 2009 07:55:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87A1519315 for ; Tue, 22 Sep 2009 07:55:54 -0300 (BRT) Received: by bwz10 with SMTP id 10so2772353bwz.5 for ; Tue, 22 Sep 2009 03:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=YJFUoJvrpcqnTMFrAjJ2cUvBlh/8/bMuNUBpDMEHZL0=; b=m7fYNI0kwexOzQMmiM/G8CgwE84Wzf6G7ihNHNPfBTFBre8tU0hCOJYX2sZG4xDqYG 5o20bE4vkZsddJL5mDOUU7bKSc0mo3BqofTBGed1LZOwbC2xbPXlTvkicKnQoWUZxfxk IWfyoB2UFVo5Rz2hS1a0JGoWGQPyqVQFwXJgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Nu54dWACrbOkA06Y7UHzGBDjc+tYklXLZ79zc0TgNoGZhKw/85VIDv2WdBlE7XpUem ZFPB+dQcpuH1oYG7crv/ppGCBa8muVxIfTP53T/jvl8+BS1Q1FI+4AArewad7N1voVEE z2EIBP/9zPQXULpjwszJOxrP4zMRZus3zPYWw= MIME-Version: 1.0 Received: by 10.223.60.68 with SMTP id o4mr167883fah.102.1253616956611; Tue, 22 Sep 2009 03:55:56 -0700 (PDT) In-Reply-To: References: <003e01ca3b0a$437e41a0$6600a8c0@sat3> Date: Tue, 22 Sep 2009 11:55:56 +0100 Message-ID: Subject: Re: length operator # for tables with metatables From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MAubvk022291 On Tue, Sep 22, 2009 at 11:28 AM, Leo Razoumov wrote: > On 9/21/09, GrayFace wrote: >> Length operator ignores __index metamethod. This way it is fast and >> predictable. It also ignores __len metamethod of tables and strings, again, >> this makes it predictable and faster - for tables and strings it has a >> definite meaning which cannot be altered. >> [..snip..] > > "Programming in Lua" book (PiL) strongly encourages idiom t[#t+1]=v to > append new value to a table. In this idiom  t[i] uses meta-methods for > index resolution while #t ignores them entirely. This could cause very > hard to find bugs. > > function foo(tbl, val) >  tbl[#tbl+1]= val >  return tbl > end > > If tbl is a regular table without meta-methods foo works as expecting > and appends val to the end of tbl. If, on another hand, as a tbl one > passes a table that has metatable with __index and __newindex set as > follows > a={11,22,33} > tbl= setmetatable({}, {__index=a,__newindex=a}) > > foo(tbl, "AA") will override the value a[1] instead of appending. > > I do not see how can one remedy the situation. > As you rightfully pointed out, __len meta-method is ignored for tables. This has been recognised as an oversight, and is expected to change in 5.2 - Roberto posted a list of things early last year that had already been implemented for it [1] that included: - tables and strings respect __len metamethod [1] http://lua-users.org/lists/lua-l/2008-02/msg00720.html -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 08:28:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MBSLjU025693; Tue, 22 Sep 2009 08:28:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBE7F19324; Tue, 22 Sep 2009 08:27:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07FF118D90 for ; Tue, 22 Sep 2009 08:27:24 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:49228) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1Mq3Wq-0007ip-3M (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Tue, 22 Sep 2009 12:27:28 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mq3Wq-0005mN-0y (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Tue, 22 Sep 2009 12:27:28 +0100 Date: Tue, 22 Sep 2009 12:27:28 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? In-Reply-To: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Message-ID: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 22 Sep 2009, steve donovan wrote: > > But the question du jour is more whether Lua can be used as a good > introduction to programming, not necessarily as a 'trade skill'. I think a first language needs quite a lot of batteries included, so that the teacher can provide fun motivating exercises. Graphics, sound, networking, hooks into the OS and/or apps (like AppleScript), etc. As a bare programming language I think Lua is great for teaching, but it needs a load of addons to provide a fun environment. What I would like is something a bit like BBC BASIC on the Master (i.e. with a full-screen editor as well as old-school line-by-line input). Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 08:48:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MBmpaQ028119; Tue, 22 Sep 2009 08:48:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFDCF1934F; Tue, 22 Sep 2009 08:47:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E36219338 for ; Tue, 22 Sep 2009 08:47:48 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mq3qW-0007Ls-K9 for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 12:47:48 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 9ED488545F for ; Tue, 22 Sep 2009 12:47:44 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:48413 with envelope Message-ID: <4AB8B958.8070600@cowlark.com> Date: Tue, 22 Sep 2009 12:47:36 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MBmpaQ028119 Tony Finch wrote: [...] > As a bare programming language I think Lua is great for teaching, but it > needs a load of addons to provide a fun environment. What I would like is > something a bit like BBC BASIC on the Master (i.e. with a full-screen > editor as well as old-school line-by-line input). I still think Logo is an excellent teaching language. It's got a lot of instant gratification (type in a word, press RETURN, something happens!) while also being a real language underneath (it's pretty much a Lisp-lite, without the scary parentheses). Unfortunately it *is* rather dated, with things like not having any strings (instead there are lists of 'words'), rather peculiar variable syntax, and you have to build your own OO system if you want one. Luckily, modern Logos are substantially faster than Acornsoft Logo --- I remember those five-second garbage collection pauses... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 08:57:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MBv6fm029107; Tue, 22 Sep 2009 08:57:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91239192E9; Tue, 22 Sep 2009 08:56:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26B2C1929E for ; Tue, 22 Sep 2009 08:56:21 -0300 (BRT) Received: by fxm12 with SMTP id 12so784058fxm.5 for ; Tue, 22 Sep 2009 04:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=m33Vn0r5IBbierDIZxMz8z2MD5eJ80bHSDy/3xlvMNw=; b=FgSOUg/s4ibndm6e1nXtfR2HswFfZLXegp7QWcCBOSbABTlNYAoTX/SYepbtQtbL0v jXTzDgYI10BubEC/2AoQLgFiADSCGO3uqca2GFNRFtnY5GrlfHlYwXltvtakKGq1KNfO q2FwE9NLNq1sw2vwGcbmeLPXEmBD+dL6wVZ4k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mtXWb0c90MGFX7UMJpTLDsdPdfbBMlvD+KlgXaNugv1lvzrkChNukzPT2tic+Bsv/T H0B8akIlZ2ISrA6xTrXIRENGsTcYocQ8fgv+wqJp8lyyr2q41I1QeJayvBZyVoYID3Sn yAsXy8CaYRR5SC5CfffCeohMaf23GRyeI8H2Q= MIME-Version: 1.0 Received: by 10.204.34.3 with SMTP id j3mr782423bkd.23.1253620586601; Tue, 22 Sep 2009 04:56:26 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 13:56:26 +0200 Message-ID: <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 1:27 PM, Tony Finch wrote: > As a bare programming language I think Lua is great for teaching, but it > needs a load of addons to provide a fun environment. What I would like is > something a bit like BBC BASIC on the Master (i.e. with a full-screen > editor as well as old-school line-by-line input). I remember BBC BASIC too, on the Archimedes. Fun machines. LOGO was cool, ahead of its time, especially with Seymour Papert's idea of 'a dignified mathematics for children'. It would not BTW be too difficult to do a Turtle Graphics environment for Lua. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:03:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MC3Nc5030104; Tue, 22 Sep 2009 09:03:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F5FD19353; Tue, 22 Sep 2009 09:02:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A16921932B for ; Tue, 22 Sep 2009 09:02:43 -0300 (BRT) Received: by bwz10 with SMTP id 10so2813009bwz.5 for ; Tue, 22 Sep 2009 05:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=z/ATF3oxYoK+u41dz5fiZI4GTpFzRH/M8qwx3P32EAY=; b=EUwGpHV+z7PntvxqGKktVyydZw1V8hZWZuU5DmuOgXOw2gP4FuxJZjI+T3u8FBV1yz TQ3tZIkt32f2TniSbUNS1uLIa43bX0SFRpr4Crj3vtf4vwcazhuPkRpdh9xo4DrJXQ05 ONzRyxSinS3/RuEezPFBzcZjIIwmBM8TjgyGQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=F4vlmh4F7r5fiC8MT4SONJYMdOdurjtwwz1rC51YBlJQ8KWqNt51HkAzwjAkvyUtU3 IqxMESst6/f/H/39x6HYMKo/eMKCUj1qnMKhchoiaixavvsRVogrIOsM54Xnq82ytdkj qYFsY1gHRqHNtRs5Xp1RmxLNttUwG8CrEWeys= MIME-Version: 1.0 Received: by 10.204.7.195 with SMTP id e3mr753681bke.118.1253620969432; Tue, 22 Sep 2009 05:02:49 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 14:02:49 +0200 Message-ID: <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I think a first language needs quite a lot of batteries included, so that > the teacher can provide fun motivating exercises. Graphics, sound, > networking, hooks into the OS and/or apps (like AppleScript), etc. > Our first programming course on my university teached Lisp. The second one Ada. Graphics and fun functions didn't come until a whole year had passed, when we started playing with Java, but the focus of that course was OO and not graphics etc. I think Lua could very well be a first language, it does have console input/output, just as Lisp and Ada ;D From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:12:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MCCrUh031574; Tue, 22 Sep 2009 09:12:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBDED192CF; Tue, 22 Sep 2009 09:12:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77E4218E78 for ; Tue, 22 Sep 2009 09:12:18 -0300 (BRT) Received: by bwz10 with SMTP id 10so2819495bwz.5 for ; Tue, 22 Sep 2009 05:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/tFwpAk7WVarcWJ0ulQN6HiXsDD2iyM2jTMavdnW+mo=; b=Fjn9j+zgcuthOhKoQs6Xhm4YOGNuS1i+SUq6EKILRs0X7k7CQxJLPlaLK5D/zWcf1C Pxp7fyoN68vV3+YXD/+9HnPif5fsLmItvnQXdByz8+WlcE9dEwEzvJDORoXv31vW7j5m bfD0Wrons+W7i7XsUy66+YruD3YItIoElpgdw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=klPIsSdnnUg2L76Bq+OrYfoFERL975/dLxrWeNSqjcARcW2PDFLD35JhSG2teT2ws/ FM+aOcqh7Ds3CXB/K2TGErCSLelr+eggVNWknpuNNP8AvlPYgIb0z9GBhdBOFmZMIAg2 YlaZ6Cy+IrOJGHoWq7gys86NRguFIJk0SvII0= MIME-Version: 1.0 Received: by 10.204.161.197 with SMTP id s5mr775450bkx.8.1253621543999; Tue, 22 Sep 2009 05:12:23 -0700 (PDT) In-Reply-To: <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> Date: Tue, 22 Sep 2009 14:12:23 +0200 Message-ID: <560972290909220512i1dfa17f9he4ab08d8fb98437d@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 2:02 PM, Pierre LeMoine wrote: > one Ada. Graphics and fun functions didn't come until a whole year had > passed, when we started playing with Java, but the focus of that > course was OO and not graphics etc. I think Lua could very well be a > first language, it does have console input/output, just as Lisp and > Ada ;D It's just such _fun_ to do graphics, even if you have to use Java to get there! Java standard graphics/Swing works very nicely with LuaJava, with a few helper classes. Nice tool to learn the Java platform, as opposed to the language. E.g. it's not too difficult to have a proper GUI-hosted interactive interpreter (not just a 'enter and click' interface) and then you can really boss around Swing windows. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:15:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MCFLXs031968; Tue, 22 Sep 2009 09:15:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4BCF119326; Tue, 22 Sep 2009 09:14:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 931A618E78 for ; Tue, 22 Sep 2009 09:14:48 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:51270) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1Mq4Gi-00029q-Mz (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Tue, 22 Sep 2009 13:14:52 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mq4Gi-0002gp-3e (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Tue, 22 Sep 2009 13:14:52 +0100 Date: Tue, 22 Sep 2009 13:14:52 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? In-Reply-To: <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> Message-ID: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 22 Sep 2009, Pierre LeMoine wrote: > > Our first programming course on my university teached Lisp. I was thinking of pre-university teaching or self-discovery. It's nice that you can now get cheap and robust computers that you can give to children without worrying too much about breakages. (Not nearly as simple as the computers of 20-30 years ago, though...) Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:18:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MCIKqc032523; Tue, 22 Sep 2009 09:18:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E305E19358; Tue, 22 Sep 2009 09:17:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout02.plus.net (relay.pcl-ipout02.plus.net [212.159.7.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD7118E78 for ; Tue, 22 Sep 2009 09:17:43 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKJduErUnw4S/2dsb2JhbADXCAmEEgU Received: from pih-relay05.plus.net ([212.159.14.18]) by relay.pcl-ipout02.plus.net with ESMTP; 22 Sep 2009 13:17:47 +0100 Received: from [80.229.242.93] (helo=iyonix) by pih-relay05.plus.net with esmtp (Exim) id 1Mq4Hu-0002XU-6x for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 13:16:06 +0100 Date: Tue, 22 Sep 2009 13:15:54 +0100 From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> In-Reply-To: X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: cf541613d7c7571892aef431d3452f7c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message you wrote: > I think a first language needs quite a lot of batteries included, so that > the teacher can provide fun motivating exercises. Graphics, sound, > networking, hooks into the OS and/or apps (like AppleScript), etc. > > As a bare programming language I think Lua is great for teaching, but it > needs a load of addons to provide a fun environment. What I would like is > something a bit like BBC BASIC on the Master (i.e. with a full-screen > editor as well as old-school line-by-line input). You should try RiscLua 5.0 on a RISC OS machine. Its access to the OS resembles that of BBC Basic on purpose, to make it easier for those weaned on BBC Basic. The 'riscos' library in RiscLua has !,?,$,dim,sys corresponding to BBC Basic's !,?,$,DIM,SYS, though the syntax in RiscLua is rather cleaner. This makes a naive conversion from Basic programs to RiscLua straightforward. The StrongED editor provides an easy development environment, in which it is possible to write a Lua program in one window and have it modify text in another - by dragging onto an icon in the window's toolbar. The (imaginary) file containing the text accessed as arg[1] and the new text is obtained from stdout. For example #! lua for line in io.lines(arg[1]) do if not line:match "Basingstoke" then print(line) end -- if end -- for will remove all lines containing "Basingstoke". So not much effort is needed to produce programs that do things in the desktop. The access to the OS makes RiscLua as usable on the Master's descendent's as BBC Basic. It also has facilities such as iteration over objects in a directory that Basic needed but never had. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:21:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MCLh7O000529; Tue, 22 Sep 2009 09:21:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FD5E1936A; Tue, 22 Sep 2009 09:21:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A459419365 for ; Tue, 22 Sep 2009 09:21:07 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mq4Mq-0002MB-1l for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 13:21:12 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 886BE72168 for ; Tue, 22 Sep 2009 13:21:08 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:55152 with envelope Message-ID: <4AB8C12C.6060202@cowlark.com> Date: Tue, 22 Sep 2009 13:21:00 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> In-Reply-To: <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MCLh7O000529 steve donovan wrote: [...] > I remember BBC BASIC too, on the Archimedes. Fun machines. I've still got one! Er, anyone want a very battered RISC PC? > LOGO was cool, ahead of its time, especially with Seymour Papert's > idea of 'a dignified mathematics for children'. I suspect that being ahead of its time is what killed it --- it was fundamentally too heavyweight for the day's 8-bit micros. LOGO on the BBC was painful. Acornsoft LOGO came with some extremely cool demos, including a Prolog-light written in LOGO that I was way too young to appreciate at the time, but it took about five minutes to run! So I think it got a reputation for being a toy suitable for fiddling around with turtles but not capable of anything more, which is a shame, as it's vastly more powerful than that. (It has list management primitives copied intact from LISP, which pretty much invented list processing. And, like LISP, code and data are interchangeable, which gave it really good introspection abilities.) > It would not BTW be too difficult to do a Turtle Graphics environment for Lua. I'm actually wondering whether it would be possible to do a LOGO pseudo-JIT in Lua, which converted code into Lua for execution on-the-fly. You'd need to know more about LOGO's detailed execution semantics than I do; if I have a sequence [FUNCTION1 arg FUNCTION2 arg arg] where FUNCTION1 redefines FUNCTION2 to only take one argument, what happens, for example? But with that all figured out it might not be particularly hard, and ought to really fly... Lua is *good* at this sort of thing! -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 09:49:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MCnLYS005661; Tue, 22 Sep 2009 09:49:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C22E1935D; Tue, 22 Sep 2009 09:48:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9F8319353 for ; Tue, 22 Sep 2009 09:48:31 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 8so973359qwh.11 for ; Tue, 22 Sep 2009 05:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=nr7eDftXav/5tStInG2um9Oz1SOPq4NaIpbNg1RA/BA=; b=peHTQw4Nx2yCkud4dGyuFF2zpJlLZNOJz+gs8VTF/fHQiTe0TjSIYpUx1ReLPuC8+9 ssordC2sutfMm8iYwAX9LDXPjsnfxPwQvBD+iV22+9RiKcRyhokI/RlhTNZn9me7AF0w 0i6JvsRLQFp7oxfMNSmEcpRw+skp558iE59gQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=AmKAMIuZqc4riPnt0i8tc6vRW409Y5RjKE3olm77rqpMCvIWpVNbbuHmRlg5PmPam3 uqqe/K+9TcI/O3w//zOd2U8CUY4nARG1LCDDTEEMcH3v5piezZbaSv/loveWkjVq3q/k HTtDixuhN9j5MtJZL5I5qJfPEcwhpE2U0xWxk= MIME-Version: 1.0 Received: by 10.224.73.37 with SMTP id o37mr580920qaj.252.1253623715833; Tue, 22 Sep 2009 05:48:35 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 09:48:35 -0300 X-Google-Sender-Auth: acbf66b2ddce968c Message-ID: <7913df4d0909220548g5c499473y73b930f1f7d73525@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MCnLYS005661 On Tue, Sep 22, 2009 at 8:27 AM, Tony Finch wrote: > I think a first language needs quite a lot of batteries included, so that > the teacher can provide fun motivating exercises. Graphics, sound, > networking, hooks into the OS and/or apps (like AppleScript), etc. > > As a bare programming language I think Lua is great for teaching, but it > needs a load of addons to provide a fun environment. What I would like is > something a bit like BBC BASIC on the Master (i.e. with a full-screen > editor as well as old-school line-by-line input). There is always the more specialized embeddings of Lua like Löve2D (http://www.love2d.org/) if you want better visuals, I think something like this would do just fine for a first semester "Introduction to Programming" course. It would probably be enough to do the computer graphics examples of SICP, for example. Diego Nehab also built a nice game where you control prospecting robots under the ocean, each robot has a few sensors to probe the ocean floor, and you can set prospecting probes to tap oil and increase your score. It was used at PUC-Rio in a very introductory course on computer programming (http://www.inf.puc-rio.br/~mascarenhas/robots/), which now uses real robots with pbLua. :-) Last year Roberto taught an "Introduction to Lua" course at PUC-Rio that I think had some complete programming newbies, as it was not intended solely for CS students. He can give his two cents on that when he reads this thread. > Tony. > -- > f.anthony.n.finch    http://dotat.at/ -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:13:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDDNvk010537; Tue, 22 Sep 2009 10:13:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5381B321B5; Tue, 22 Sep 2009 10:12:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 065D31936C for ; Tue, 22 Sep 2009 10:12:38 -0300 (BRT) Received: by yxe37 with SMTP id 37so4205068yxe.33 for ; Tue, 22 Sep 2009 06:12:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.41.29 with SMTP id o29mr397700ago.101.1253625165181; Tue, 22 Sep 2009 06:12:45 -0700 (PDT) In-Reply-To: <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> Date: Tue, 22 Sep 2009 16:12:45 +0300 X-Google-Sender-Auth: 0878e0f9bba77d6a Message-ID: Subject: Re: Suitability of Lua as a First Programming Language? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 15:02, Pierre LeMoine wrote: >> I think a first language needs quite a lot of batteries included, so that >> the teacher can provide fun motivating exercises. Graphics, sound, >> networking, hooks into the OS and/or apps (like AppleScript), etc. >> > Our first programming course on my university teached Lisp. The second > one Ada. Graphics and fun functions didn't come until a whole year had > passed, when we started playing with Java, but the focus of that > course was OO and not graphics etc. I think Lua could very well be a > first language, it does have console input/output, just as Lisp and > Ada ;D > Yea, but that's how school is, boring first, fun later. Only after the school is over you get interested (even educated) in what you had (just mechanically) learned in school. But unlike other disciplines, computers allow us to teach ourselves when everything else fails - so you even get a chance to get interested in computers while _in_ school. Back in the 9th grade, we were taught Turbo Pascal, and I put a text-mode colored Matrix screensaver with rolling letters in one of my first homework programs (The Matrix was screening in our town then). It was my first outburst of programming creativity, the success of which (measured both in terms of personal satisfaction and social affirmation of potential) could well be one of the reasons I set myself up for programming. The program itself was was some boring backtracking stuff I had no interest in. Lucky for me I never let my schooling get in the way of my education :) But I digress. I think Lua is a wonderful first language because it gets you hooked quickly (by instant gratification), and after that you are bound to get way down to C and implicitly to the PC architecture itself - no blackboxes in the path either. By contrast, Delphi or Java can keep you ignorant for years :) Also, one's professional "tool belt" should better not hold programming languages. If you can't educate the industry, cheat it. My resume is full of acronyms I can only talk about on an interview. No, I don't care if my employer reads this message - I already fooled him :) From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:19:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDJYPV012643; Tue, 22 Sep 2009 10:19:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6A32192FD; Tue, 22 Sep 2009 10:19:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF94218EF2 for ; Tue, 22 Sep 2009 10:18:55 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id BDC393849553D for ; Tue, 22 Sep 2009 20:19:01 +0700 (NOVST) Message-ID: <004001ca3b87$3fa8c7d0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <003e01ca3b0a$437e41a0$6600a8c0@sat3> Subject: Re: length operator # for tables with metatables Date: Tue, 22 Sep 2009 20:18:57 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Tue, 22 Sep 2009 20:19:01 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br - "metamethods" __pairs & __ipairs - tables and strings respect __len metamethod Bad news IMO :( ----- Original Message ----- From: Duncan Cross To: Lua list Sent: Tuesday, September 22, 2009 5:55 PM Subject: Re: length operator # for tables with metatables This has been recognised as an oversight, and is expected to change in 5.2 - Roberto posted a list of things early last year that had already been implemented for it [1] that included: - tables and strings respect __len metamethod [1] http://lua-users.org/lists/lua-l/2008-02/msg00720.html -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:35:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDZUvM016594; Tue, 22 Sep 2009 10:35:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66D901854E; Tue, 22 Sep 2009 10:34:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0EC518528 for ; Tue, 22 Sep 2009 10:34:49 -0300 (BRT) Received: by vws32 with SMTP id 32so2759001vws.11 for ; Tue, 22 Sep 2009 06:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5eOM/d8DrtyJIsrwXCWdT5S6B9EUCEUi6ehSBljweBs=; b=v/lgNrh8rCGJb4xSievqhtPXh6ArUxPbyGIKz/EVchPjrDOtJtVIuXtUwrU1o8KYzC dRV6XxjJ+L7pD8Md0LojDIYDVmIxmJ2yZtMp/0B3DW2SBoAy9QE8Iork+u34wNSiXDbV JY2aENl8xwKzkkEDjurgxpdFO1ZmIn2ZzpcZw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YMGUufKD9bvL1wXBExFo/ywMqL97LLJBI86DYU+/OclVnuUPR0gWpZzJwrMzMTtv+t sSYSo9zbXhRWmRN7TJl9gssdk9mfvfXj8TUXBCActLuyxFBjmhl6SkBvMhP/T8it1h+h BJDU9sBzEKaYbfwaSvRdwhwb3qouo5PGewfos= MIME-Version: 1.0 Received: by 10.220.112.204 with SMTP id x12mr1506472vcp.19.1253626495013; Tue, 22 Sep 2009 06:34:55 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> Date: Tue, 22 Sep 2009 21:34:54 +0800 Message-ID: <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean IMO python is by far the better language for "first programming language" than Lua. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:42:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDgqWB018348; Tue, 22 Sep 2009 10:42:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA0D185E4; Tue, 22 Sep 2009 10:42:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B979F18537 for ; Tue, 22 Sep 2009 10:42:07 -0300 (BRT) Received: from cpc1-asht1-0-0-cust922.manc.cable.ntl.com ([80.5.51.155] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mq5d5-0007vh-R7 for ; Tue, 22 Sep 2009 14:42:04 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mq5dF-0003dT-RN for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 14:42:13 +0100 Date: Tue, 22 Sep 2009 14:42:13 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> In-Reply-To: <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 22 Sep 2009 21:34:54 +0800 pan shizhu wrote: > IMO python is by far the better language for "first programming > language" than Lua. If you're going to make an audacious assertion, please back it up with justification :) B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:43:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDhS6F018505; Tue, 22 Sep 2009 10:43:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3F7018869; Tue, 22 Sep 2009 10:42:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AACE218869 for ; Tue, 22 Sep 2009 10:42:33 -0300 (BRT) Received: by fxm12 with SMTP id 12so867816fxm.5 for ; Tue, 22 Sep 2009 06:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3GTM25jiY9C3h36nRhUPsxVYCAp4QxV4SWciI7PsY+8=; b=N8I3jD/WcZX0DWQ3jNfutxKz6W8v9y7E4fhIYYV/FXrVoNgH7FkBXvdi2Cxwur6nkj S7IQ82I1LQJLB24I/SNdMWIS1+NSpTQuXCWlj90UFi4OnCjnkSiR3A31UAktFAWxeHhP rzmY35ZAG0VPfMsWhCV7dPbyAQM5xeco3b7DQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wWqILTk+66NwU+qaBbfuff2DQ19LTCaZ43GDI8vdFgPQQbWpl6hbZzk5zwn2k2grQA BL2WlShoYrsiNVqK0KD1Oye3vCPfCI1RE71jKESroBs7wjGOOo4+qqNmK3PvnMc9cyXI UYyO/iKGyAa26tpoWgosWg8Bo3ObK3j6nahps= MIME-Version: 1.0 Received: by 10.204.11.9 with SMTP id r9mr846216bkr.34.1253626959593; Tue, 22 Sep 2009 06:42:39 -0700 (PDT) In-Reply-To: <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> Date: Tue, 22 Sep 2009 15:42:39 +0200 Message-ID: <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 3:34 PM, pan shizhu wrote: > IMO python is by far the better language for "first programming > language" than Lua. That may be true, but why? Is it because it has more 'out of the box'? I like Python, and I use it because my colleagues like it, but the whitespace thing may confuse newbies. Plus, you have to learn about lists and dicts (with an awkward syntax), whereas we just have tables. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 10:46:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MDkDC4019142; Tue, 22 Sep 2009 10:46:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4614119355; Tue, 22 Sep 2009 10:45:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F05319315 for ; Tue, 22 Sep 2009 10:45:09 -0300 (BRT) Received: from cpc1-asht1-0-0-cust922.manc.cable.ntl.com ([80.5.51.155] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mq5g1-00006x-4j for ; Tue, 22 Sep 2009 14:45:05 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mq5gA-0003pF-On for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 14:45:15 +0100 Date: Tue, 22 Sep 2009 14:45:14 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090922144514.4cac7f11@trite.i.flarn.net.i.flarn.net> In-Reply-To: <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 22 Sep 2009 15:42:39 +0200 steve donovan wrote: > Plus, you have to learn about lists and dicts (with an awkward > syntax), whereas we just have tables. The only thing I fear about using Lua as a first language to teach people is that they may not be able to function using other languages, as they'll be pulling their hair out wondering why everything's so bloody complicated compared to what the learnt first :) B. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 11:39:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MEd0BR002466; Tue, 22 Sep 2009 11:39:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25FDD18C83; Tue, 22 Sep 2009 11:38:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E2FD18CE6 for ; Tue, 22 Sep 2009 11:38:07 -0300 (BRT) Received: from [192.168.1.3] (p5B0DA90A.dip.t-dialin.net [91.13.169.10]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MKsym-1Mq6VM38Bo-000QZy; Tue, 22 Sep 2009 16:38:10 +0200 Message-ID: <4AB8E14B.10709@ghulbus-inc.de> Date: Tue, 22 Sep 2009 16:38:03 +0200 From: Andreas Weis User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> In-Reply-To: <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18THLHCgfTw284Hri9Zus83zzlV/WrFTzVrBcJ FeZyT8ktRpTbnwgDbMs1R8Ayzw7xckobIeL000L6wBYZ0OVfIb HCKrzB18+W/sEDLW1BkFgUalYhgUiqqJKrniWnjTA4= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > It would not BTW be too difficult to do a Turtle Graphics environment for Lua. I actually built a simple Lua turtle plotter for Windows some time ago: http://ghulbus-inc.de/projects/luaturtle/index.html The underlying graphics system has meanwhile been ported to Linux and MacOS, which reminds me I should finish this project someday soon and release the sources *rolleyes* Regards, Andreas From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 12:30:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MFUpGP015539; Tue, 22 Sep 2009 12:30:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 550F719374; Tue, 22 Sep 2009 12:30:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1692019365 for ; Tue, 22 Sep 2009 12:30:04 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mq7JW-00012h-E0 for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 17:29:58 +0200 Received: from p5b2c2f43.dip.t-dialin.net ([91.44.47.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 17:29:58 +0200 Received: from dak by p5b2c2f43.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Sep 2009 17:29:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 17:29:37 +0200 Organization: Organization?!? Lines: 15 Message-ID: <87eipzro9q.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2f43.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:6ZwdvKWOlhzn5S96kCUXfw+7Gx0= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick writes: > On Tue, 22 Sep 2009 21:34:54 +0800 > pan shizhu wrote: > >> IMO python is by far the better language for "first programming >> language" than Lua. > > If you're going to make an audacious assertion, please back it up with > justification :) Justification changes the syntax. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 13:30:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MGUkFP028533; Tue, 22 Sep 2009 13:30:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24FE519382; Tue, 22 Sep 2009 13:30:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 935AF19368 for ; Tue, 22 Sep 2009 13:29:48 -0300 (BRT) Received: by qyk26 with SMTP id 26so807211qyk.5 for ; Tue, 22 Sep 2009 09:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WBC5Il5mLqnlUDzQyWUNccAm1odgYxyWXVRz13BU8IE=; b=GjSfsppqBzfL/GNViuROvY8acRTZwuiZW+CAythSGA1w+twLNCMyS8Pr36Yt+S2qx7 Gc6SrkVVYg6SaKpwkDLyI1zaobE3dt5SUHFmF4FFUrVypA1VO7xytYdjICU5FYajuPig PLqc5sf+QEVE6mCgC7y+WGPp4A6WQMvols3Rc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=g+ggqUMorTrAfq9VPKF5DHtO7M+skN7gV8sUuqkhdW00C2af0swtEGhy8s0iTJnLis iU68vEuHfN1uGRQ6sXCUBMrk4LBUHEyif6MUph/dqy4z8I8dgmcfx0LaS+miItO+D3+O 3J9P3Daa/9HClY70xMVO31Ik9dMj1p25iLufA= MIME-Version: 1.0 Received: by 10.229.33.15 with SMTP id f15mr479572qcd.59.1253636995435; Tue, 22 Sep 2009 09:29:55 -0700 (PDT) In-Reply-To: <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Date: Tue, 22 Sep 2009 13:29:54 -0300 Message-ID: Subject: Re: Suitability of Lua as a First Programming Language? From: Eduardo Ochs To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 10:42 AM, steve donovan wrote: > On Tue, Sep 22, 2009 at 3:34 PM, pan shizhu wrote: >> IMO python is by far the better language for "first programming >> language" than Lua. > > That may be true, but why? Is it because it has more 'out of the box'? > > I like Python, and I use it because my colleagues like it, but the > whitespace thing may confuse newbies. > > Plus, you have to learn about lists and dicts (with an awkward > syntax), whereas we just have tables. Python may be much better - for the people who will never ask "what is an object" and "what is a class"... (*) My impression is that there are several kinds of newbies, not just one kind... I started programming more than 20 years ago, and I still can't understand Python - and the whitespace/indentation thing is not the problem. Lua at least is extremely honest - it is relatively easy to explain tables to newbies as lists of pairs (plus a slot for the metatable), and functions and closures are not much harder... Cheers, Eduardo Ochs eduardoochs@gmail.com http://angg.twu.net/ (*) Well, there are the standard answers for those questions, that we all know... "everything is an object! A car is an object! A pizza is an object! A window is an object! And every object has a class, and a class is also an object"... I am still trying to understand why some people seem to feel perfectly at ease with these kinds of ideas, while I don't... Links? From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 14:16:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MHGhW5008016; Tue, 22 Sep 2009 14:16:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A3B319383; Tue, 22 Sep 2009 14:16:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B5C41936C for ; Tue, 22 Sep 2009 14:16:01 -0300 (BRT) Received: from [192.168.1.3] (p5B0DA90A.dip.t-dialin.net [91.13.169.10]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MKt72-1Mq8yC2CfO-000hak; Tue, 22 Sep 2009 19:16:06 +0200 Message-ID: <4AB9064F.8030503@ghulbus-inc.de> Date: Tue, 22 Sep 2009 19:15:59 +0200 From: Andreas Weis User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <560972290909220456p74ce82e4l3350290347098f84@mail.gmail.com> <4AB8E14B.10709@ghulbus-inc.de> In-Reply-To: <4AB8E14B.10709@ghulbus-inc.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19mrPU0hn52oQcFyHL/Gmgg/KG80XDF0I8eRdj rGfGml6OmHx8jPILA3FY0XNImpCONaLUhNQxnOf/SQIz5PP/Rp Ygt0SSMcffxk/V3LqsGUImzueE8BV7hc7J9uxkeKOc= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andreas Weis wrote: > I actually built a simple Lua turtle plotter for Windows some time ago: > http://ghulbus-inc.de/projects/luaturtle/index.html > I just dug up the old source code and it seems to work under Linux. I'll attach a Makefile and upload it. The code is over three years old though and was one of my very first C++-with-Lua projects, so don't judge it too harsh ;) Regards, Andreas Andreas Weis wrote: > steve donovan wrote: > >> It would not BTW be too difficult to do a Turtle Graphics environment for Lua. >> > I actually built a simple Lua turtle plotter for Windows some time ago: > http://ghulbus-inc.de/projects/luaturtle/index.html > > The underlying graphics system has meanwhile been ported to Linux and > MacOS, which reminds me I should finish this project someday soon and > release the sources *rolleyes* > > Regards, > Andreas > From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 14:37:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MHbj8u014148; Tue, 22 Sep 2009 14:37:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2F8A1938D; Tue, 22 Sep 2009 14:37:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EE9C19379 for ; Tue, 22 Sep 2009 14:36:59 -0300 (BRT) Received: by yxe36 with SMTP id 36so5344244yxe.11 for ; Tue, 22 Sep 2009 10:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=E5+1dU87dUt/vAyse2A2oogDv3ZePP5loqyKqDAky/s=; b=FYZE/KpuHq/WhRDSvmjh9+q/cQ/K3Okp41n24tJ2yf+j3FCg4aYuiyPaNIoX+p+YLR irCi51FhV+2ffcLeNHqvWp9p9U5CXEDopOz3Yd+0HMOKjjE9eLLy2vfet5bg3TgjeOdW VoSvv82+4OREtku5y1lQ/NtHsDJrI7kR2iY7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=gS+jsa14VdS7Q7X1l5C63EmiHrgzdDM9tXVWCKlhglMiuOirHqqrGeym5b+VmqstAq 7cZ2k9l4l/7VRDHGG3fHwLvGFjLYJ8zFW2VvsTLdsVE7shzyrkX4GfkZZTRkqKpw1bUD jiP/ECuswxUjBALEfMBf5ApXYUx271DXyyYeU= MIME-Version: 1.0 Received: by 10.150.110.4 with SMTP id i4mr2257435ybc.255.1253641025066; Tue, 22 Sep 2009 10:37:05 -0700 (PDT) Date: Tue, 22 Sep 2009 10:37:04 -0700 Message-ID: <935fb28e0909221037h2ea25046we5921e613374636b@mail.gmail.com> Subject: ANN: Dao 1.1 is released From: Limin Fu To: Lua list Content-Type: multipart/alternative; boundary=000e0cd5c076f998bf04742e0b13 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd5c076f998bf04742e0b13 Content-Type: text/plain; charset=UTF-8 Hi, I am pleased to announce the release of Dao 1.1. Dao was influenced by Lua in several aspects, such as coroutine, string pattern matching etc., and even the principle of simplicity is also taken by Dao. More importantly, the implementation of Dao virtual machine was largely inspired by the Lua virtual machine. I hope this announcement could be interesting to somebody. The original announcement text can be found here: http://www.daovm.net/space/dao/thread/167 The changes are listed here: http://www.daovm.net/space/dao/page/dao_whats_new Documentation: http://www.daovm.net/dao/document_en Download: http://www.daovm.net/dao/download_en Thank you! Limin Fu --000e0cd5c076f998bf04742e0b13 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,

I am pleased to announce the release of Dao 1.1. Dao= was influenced by Lua in several aspects, such as coroutine, string patter= n matching etc., and even the principle of simplicity is also taken by Dao.= More importantly, the implementation of Dao virtual machine was largely in= spired by the Lua virtual machine.

I hope this announcement could be interesting to somebo= dy. The original announcement text can be found here:

The changes are listed here:


Thank you!

Limin Fu
--000e0cd5c076f998bf04742e0b13-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 14:46:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MHklMF017020; Tue, 22 Sep 2009 14:46:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 069DC19377; Tue, 22 Sep 2009 14:46:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 694121935E for ; Tue, 22 Sep 2009 14:46:06 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1Mq9RM-0001ol-5r for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 19:46:12 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1Mq9RL-000666-NS for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 17:46:11 +0000 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Date: Tue, 22 Sep 2009 17:46:11 +0000 In-Reply-To: (Eduardo Ochs's message of "Tue, 22 Sep 2009 13:29:54 -0300") Message-ID: <87y6o6an4s.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Eduardo Ochs: > (*) Well, there are the standard answers for those questions, that we > all know... "everything is an object! A car is an object! A pizza is > an object! A window is an object! And every object has a class, and a > class is also an object"... I am still trying to understand why some > people seem to feel perfectly at ease with these kinds of ideas, while > I don't... Links? If you grok the distinction (or the lack thereof) between tables and metatables, why can't you apply this concept to to objects and classes? Method lookup is a different beast, however. I understand the method lookup rules for Java and C++ (the dynamic/run-time part, not the finer points of compile-time overload resolution). But for Perl and Python, I don't. So maybe you're confused by that? From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:37:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIbfW8031806; Tue, 22 Sep 2009 15:37:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85D2919378; Tue, 22 Sep 2009 15:37:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dspnet.fr.eu.org (dspnet.fr.eu.org [213.186.44.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63A591931E for ; Tue, 22 Sep 2009 15:36:58 -0300 (BRT) Received: by dspnet.fr.eu.org (Postfix, from userid 1007) id 5949EA497D; Tue, 22 Sep 2009 20:37:03 +0200 (CEST) Date: Tue, 22 Sep 2009 20:37:03 +0200 From: Olivier Galibert To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090922183703.GA28827@dspnet.fr.eu.org> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 01:29:54PM -0300, Eduardo Ochs wrote: > (*) Well, there are the standard answers for those questions, that we > all know... "everything is an object! A car is an object! A pizza is > an object! A window is an object! And every object has a class, and a > class is also an object"... I am still trying to understand why some > people seem to feel perfectly at ease with these kinds of ideas, while > I don't... Perhaps because these "standard answers" are high-grade bullshit? A pizza, a car or a (physical) window has never been part of a program[1]. Equating structuration primitives with physical unrelated objects is not going to tell you how to use them or even what they're useful for in the first place. OG. [1] Or is must have been a very Rude Goldberg-y one From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:38:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIcTkU032028; Tue, 22 Sep 2009 15:38:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E869019386; Tue, 22 Sep 2009 15:37:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E28E31931E for ; Tue, 22 Sep 2009 15:37:49 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1MqAFQ-0004VZ-Mh for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 20:37:56 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1MqAFQ-0006Ps-5X for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 18:37:56 +0000 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Date: Tue, 22 Sep 2009 18:37:56 +0000 In-Reply-To: <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> (steve donovan's message of "Tue, 22 Sep 2009 15:42:39 +0200") Message-ID: <87bpl2akqj.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * steve donovan: > I like Python, and I use it because my colleagues like it, but the > whitespace thing may confuse newbies. That would apply to Lua, too, wouldn't it? 8-) Surprisingly, the few people I've talked to about their learning experience when they had barely begun, all complained about pointless error messages about missing semicolons. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:42:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIgZDp000341; Tue, 22 Sep 2009 15:42:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EB891938E; Tue, 22 Sep 2009 15:42:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D7181929E for ; Tue, 22 Sep 2009 15:42:00 -0300 (BRT) Received: by ewy26 with SMTP id 26so11444ewy.5 for ; Tue, 22 Sep 2009 11:42:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.93.27 with SMTP id q27mr1484556ebb.9.1253644925883; Tue, 22 Sep 2009 11:42:05 -0700 (PDT) In-Reply-To: <935fb28e0909221037h2ea25046we5921e613374636b@mail.gmail.com> References: <935fb28e0909221037h2ea25046we5921e613374636b@mail.gmail.com> Date: Tue, 22 Sep 2009 13:42:05 -0500 Message-ID: <90eb1dc70909221142t6a1faf70sb6ff332b03fd835e@mail.gmail.com> Subject: Re: ANN: Dao 1.1 is released From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 12:37 PM, Limin Fu wrote: > I am pleased to announce the release of Dao 1.1. Dao was influenced by Lua > in several aspects, such as coroutine, string pattern matching etc., and > even the principle of simplicity is also taken by Dao. More importantly, the > implementation of Dao virtual machine was largely inspired by the Lua > virtual machine. i'm always interested in new languages, can you summarize what makes Dao unique? -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:44:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIiN4c000662; Tue, 22 Sep 2009 15:44:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E51F19395; Tue, 22 Sep 2009 15:43:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B06F21929E for ; Tue, 22 Sep 2009 15:43:50 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1MqALF-0004ar-OI for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 20:43:57 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1MqALF-0006SO-7Z for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 18:43:57 +0000 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 18:43:57 +0000 In-Reply-To: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> (steve donovan's message of "Tue, 22 Sep 2009 09:39:00 +0200") Message-ID: <87ab0makgi.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * steve donovan: > But the question du jour is more whether Lua can be used as a good > introduction to programming, not necessarily as a 'trade skill'. In > the same way, CS departments have variously used Pascal or Scheme for > this purpose. I think the main criterion is availability of introductory texts. Without that, creating a course will be a lot of work. (I found Programming in Lua an extremely inspiring read, but it's probably not that helpful to absolute beginners.) The language itself is fit for the purpose, I think. The syntax error messages are not too bad, either (bad mesages can be very off-putting when you're struggling with a programming language for the first time). But the default, non-strict mode would be unnecessarily confusing, I fear. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:49:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MInsnu002020; Tue, 22 Sep 2009 15:49:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B21861939E; Tue, 22 Sep 2009 15:49:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BB5C1932B for ; Tue, 22 Sep 2009 15:49:18 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id E180E187D3 for ; Tue, 22 Sep 2009 18:49:18 +0000 (GMT) Message-ID: <4AB91C22.8020709@objmedia.demon.co.uk> Date: Tue, 22 Sep 2009 19:49:06 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> <87eipzro9q.fsf@lola.goethe.zz> In-Reply-To: <87eipzro9q.fsf@lola.goethe.zz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Kastrup wrote: > Rob Kendrick writes: > > >> On Tue, 22 Sep 2009 21:34:54 +0800 >> pan shizhu wrote: >> >> >>> IMO python is by far the better language for "first programming >>> language" than Lua. >>> >> If you're going to make an audacious assertion, please back it up with >> justification :) >> > > Justification changes the syntax. > > As does any form of refactoring - Python is very poor for that because its whitespace issues. I think Python, although powerful, is not a good language to use, the number of times I've wasted time because of the whitespace indentation issues just make it a none-starter. Does anyone on this list know folks that teach CS or related topics - perhaps they'd have some useful feedback on which things the "average" (whatever that is) person struggles with when learning a language. Then from that you could make suitable choices for a first language. Python would not be my choice as a first language. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:51:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIp6gU002359; Tue, 22 Sep 2009 15:51:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BF20193AE; Tue, 22 Sep 2009 15:50:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47973193A5 for ; Tue, 22 Sep 2009 15:50:31 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 24D6C1873E for ; Tue, 22 Sep 2009 18:50:37 +0000 (GMT) Message-ID: <4AB91C72.4080502@objmedia.demon.co.uk> Date: Tue, 22 Sep 2009 19:50:26 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Eduardo Ochs wrote: > (*) Well, there are the standard answers for those questions, that we > all know... "everything is an object! A car is an object! A pizza is > > What about fog? Is fog an object or millions of tiny objects? Discuss :-) From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:53:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIrnsp003141; Tue, 22 Sep 2009 15:53:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22567193B9; Tue, 22 Sep 2009 15:53:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (unknown [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8957193A8 for ; Tue, 22 Sep 2009 15:53:08 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MqAUA-0000xM-Pk for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 19:53:10 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 0683A4A006 for ; Tue, 22 Sep 2009 19:53:07 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:35111 with envelope Message-ID: <4AB92B22.8030409@cowlark.com> Date: Tue, 22 Sep 2009 20:53:06 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> <20090922183703.GA28827@dspnet.fr.eu.org> In-Reply-To: <20090922183703.GA28827@dspnet.fr.eu.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MIrnsp003141 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Olivier Galibert wrote: [...] > Perhaps because these "standard answers" are high-grade bullshit? A > pizza, a car or a (physical) window has never been part of a > program[1]. Equating structuration primitives with physical unrelated > objects is not going to tell you how to use them or even what they're > useful for in the first place. The C++ FAQ Lite contains essential reading on this subject, and explains clearly why the intuitive sense of inheritance doesn't actually help. See 21.6 to 21.11 here: http://www.parashift.com/c++-faq-lite/proper-inheritance.html#faq-21.6 The short summary is: Q. Does Circle subclass Ellipse? A. Fish. (Doesn't require detailed C++ knowledge!) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKuSsff9E0noFvlzgRAvg/AKDgEmRQvzDp8gQ2UB6JBPQMXUdFMwCaAh2B mnikhkMiFAybyEn5aMAz5rk= =wjeH -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 15:54:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MIspNd003409; Tue, 22 Sep 2009 15:54:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC93E193C0; Tue, 22 Sep 2009 15:54:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31E8F193B5 for ; Tue, 22 Sep 2009 15:54:15 -0300 (BRT) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1MqAVK-0004i7-8h for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 20:54:22 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1MqAVJ-0006Vm-Qp for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 18:54:21 +0000 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> <20090922183703.GA28827@dspnet.fr.eu.org> Date: Tue, 22 Sep 2009 18:54:21 +0000 In-Reply-To: <20090922183703.GA28827@dspnet.fr.eu.org> (Olivier Galibert's message of "Tue, 22 Sep 2009 20:37:03 +0200") Message-ID: <873a6eajz6.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Olivier Galibert: > On Tue, Sep 22, 2009 at 01:29:54PM -0300, Eduardo Ochs wrote: >> (*) Well, there are the standard answers for those questions, that we >> all know... "everything is an object! A car is an object! A pizza is >> an object! A window is an object! And every object has a class, and a >> class is also an object"... I am still trying to understand why some >> people seem to feel perfectly at ease with these kinds of ideas, while >> I don't... > > Perhaps because these "standard answers" are high-grade bullshit? I don't think so. They're are appropriate for a certain type of object model. > A pizza, a car or a (physical) window has never been part of a > program[1]. Equating structuration primitives with physical > unrelated objects is not going to tell you how to use them or even > what they're useful for in the first place. But that's not the point of the statement, is it? You are probably confusing this with subtype polymorphism/inheritance, which is very problematic to explain using examples from mathematics or biology. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:01:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJ1lRY005740; Tue, 22 Sep 2009 16:01:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6166A193C1; Tue, 22 Sep 2009 16:01:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8EC11939B for ; Tue, 22 Sep 2009 16:00:59 -0300 (BRT) Received: by vws32 with SMTP id 32so22912vws.11 for ; Tue, 22 Sep 2009 12:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=sYitEyoyj+5GnPQ0hwI4/ba+6A+AbXmPhDGWPZRl1nk=; b=IrqOxqkz4Wm9S6P8aAvhKrBA3FWWzmYOfdcfc45PqoZE+Em/JhzPsR/KdbLtSW2Thq R2Tq1JNW6BzCHYjr+J4mqY0EtwPwaoHkmG1uafAb7bboxXc4VcdzI1YUf7K3yHV9Ws8u t/yo6CiHWzw0IN7xpE9qOCT9nf4V0TxT0loZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Xy120YM7xJtUdyufyiOfyEgD8jLPu1XaqHXWrKBPwcmUcyQAfu8T/jKGoIQTscIR8l RvELqqeo753Tjbkq7H4O/BsVWXRfllfG3J3tqEcp+jEZqx3QKw5v9otKqxgu67ow/h3h 2qN2eRlERBcxhPKbXaVjmwUhhHRKudNty/wtc= MIME-Version: 1.0 Received: by 10.150.237.3 with SMTP id k3mr2464189ybh.70.1253646063147; Tue, 22 Sep 2009 12:01:03 -0700 (PDT) In-Reply-To: <90eb1dc70909221142t6a1faf70sb6ff332b03fd835e@mail.gmail.com> References: <935fb28e0909221037h2ea25046we5921e613374636b@mail.gmail.com> <90eb1dc70909221142t6a1faf70sb6ff332b03fd835e@mail.gmail.com> Date: Tue, 22 Sep 2009 12:01:03 -0700 Message-ID: <935fb28e0909221201h6378534dl5d927cc419fa8d77@mail.gmail.com> Subject: Re: ANN: Dao 1.1 is released From: Limin Fu To: Lua list Content-Type: multipart/alternative; boundary=000e0cd356c8449b3404742f38d1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd356c8449b3404742f38d1 Content-Type: text/plain; charset=UTF-8 If you talk about features that are not seen in any other language, the BNF-like macro in Dao is one such feature. However if you mean something rarely seen in popular languages, there could be more, such as soft typing, typed generator and coroutine, parallelized regular expression pattern matching, functional methods etc. Like Lua, Dao also tries to address the simplicity and usability of C interfaces. What is different in Dao is that, the typing system is used to eliminate the necessity to perform parameter type checking manually in C wrapping functions. On Tue, Sep 22, 2009 at 11:42 AM, Javier Guerra wrote: > On Tue, Sep 22, 2009 at 12:37 PM, Limin Fu wrote: > > I am pleased to announce the release of Dao 1.1. Dao was influenced by > Lua > > in several aspects, such as coroutine, string pattern matching etc., and > > even the principle of simplicity is also taken by Dao. More importantly, > the > > implementation of Dao virtual machine was largely inspired by the Lua > > virtual machine. > > i'm always interested in new languages, can you summarize what makes Dao > unique? > > -- > Javier > --000e0cd356c8449b3404742f38d1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable If you talk about features that are not seen in any other language, the BNF= -like macro in Dao is one such feature. However if you mean something rarel= y seen in popular languages, there could be more, such as soft typing, type= d generator and coroutine, parallelized regular expression pattern matching= , functional methods etc.

Like Lua, Dao also tries to address the simplicity and usabi= lity of C interfaces. What is different in Dao is that, the typing system i= s used to eliminate the necessity to perform parameter type checking manual= ly in C wrapping functions.



On Tue, Sep 22, 2009 at 11= :42 AM, Javier Guerra <javier@guerrag.com> wrote:
On Tue, Sep 22, 2009 at 12:37 PM, Limin Fu <phoolimin@gmail.com> wrote:
> I am pleased to announce the release of Dao 1.1. Dao was influenced by= Lua
> in several aspects, such as coroutine, string pattern matching etc., a= nd
> even the principle of simplicity is also taken by Dao. More importantl= y, the
> implementation of Dao virtual machine was largely inspired by the Lua<= br> > virtual machine.

i'm always interested in new languages, can you summarize what ma= kes Dao unique?

--
Javier

--000e0cd356c8449b3404742f38d1-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:09:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJ95dp007486; Tue, 22 Sep 2009 16:09:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D633419384; Tue, 22 Sep 2009 16:08:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp108.rog.mail.re2.yahoo.com (smtp108.rog.mail.re2.yahoo.com [68.142.225.206]) by bazar2.conectiva.com.br (Postfix) with SMTP id 0150719375 for ; Tue, 22 Sep 2009 16:08:22 -0300 (BRT) Received: (qmail 68639 invoked from network); 22 Sep 2009 19:08:29 -0000 Received: from unknown (HELO ?192.168.1.110?) (spell_gooder_now@173.32.14.83 with plain) by smtp108.rog.mail.re2.yahoo.com with SMTP; 22 Sep 2009 19:08:29 -0000 X-YMail-OSG: g2cu0oQVM1mseDgt_050pr0gjuTA1cMDJCS1uKzaFQ5kBxnLT0MdEm38JNsxJ_ppjg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4AB92082.2000706@spellingbeewinnars.org> Date: Tue, 22 Sep 2009 15:07:46 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> In-Reply-To: <87ab0makgi.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Don't make the mistake that I have. I have spent the past couple years learning several languages(part time) but I still don't think I am a good programmer. If your grammar is perfect and you spell well, are you all set to write a novel? probably not. Please don't forget to study programming strategies. I am having a hard time finding books myself but I just ordered "Software System Development" Learning to program in a somewhat language agnostic manner might be something to start with earlier then I did. I still don't know how to put a complex application together I just know lots of little pieces. One more thing.... Ignoring languages such as assembly and so on, I wonder if it is safe to say that one should learn THE programming language and a few of it's dialects. The difference between not knowing any programming language and learning your first well, is much further then picking up your second and third language. I am in Canada, I might sometimes have a bit of trouble catching Jamaican English or some British accent but it's still English and I can manage, not so with Mongolian. The difference between the most common languages is the difference between Australian English and US English not the difference between Thai and Spanish. Please don't become too obsessed with learning the perfect language as I did myself when I started, if you choose the wrong one you can switch dialects later. Not to hijack this thread but if anyone has any links to books related designing desktop applications I would love to receive such a link. There are plenty of GUI design books but not much on backend side other then pure DB stuff. I assume everything still uses MVC but I still useless here I don't really know how to divide up the logic and lay the App out. -Patrick From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:15:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJFQKP008965; Tue, 22 Sep 2009 16:15:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6D69193C5; Tue, 22 Sep 2009 16:14:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87BE019378 for ; Tue, 22 Sep 2009 16:14:48 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 4266E1873E for ; Tue, 22 Sep 2009 18:53:40 +0000 (GMT) Message-ID: <4AB91D27.7040208@objmedia.demon.co.uk> Date: Tue, 22 Sep 2009 19:53:27 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> <87bpl2akqj.fsf@mid.deneb.enyo.de> In-Reply-To: <87bpl2akqj.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Florian Weimer wrote: > Surprisingly, the few people I've talked to about their learning > experience when they had barely begun, all complained about pointless > error messages about missing semicolons. > I noticed that one of the reasons that came up a lot on the Ruby groups for folks liking Ruby was not having to type semi-colons. I thought that a weird and rather weak reason for liking Ruby, given what you can do with it, but whatever, its what folks were saying a few years ago. Stephen > -- > Stephen Kellett > Computer Consultancy, Software Development, Windows, C++, JavaScript, > Ruby, Java, Assembler, Performance Analysis, Troubleshooting > > Object Media Limited > Reg Office: 24 Windmill Walk, Sutton, Ely, Cambs CB6 2NH. > Registered in England and Wales: Company Number: 02979036 > http://www.objmedia.demon.co.uk > From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:20:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJKV9h010533; Tue, 22 Sep 2009 16:20:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E4ED1939A; Tue, 22 Sep 2009 16:19:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tweak.unx.csupomona.edu (tweak.unx.csupomona.edu [134.71.247.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C0DE1938C for ; Tue, 22 Sep 2009 16:19:51 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by tweak.unx.csupomona.edu (Postfix) with ESMTP id 40C20134072; Tue, 22 Sep 2009 12:19:55 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at csupomona.edu Received: from tweak.unx.csupomona.edu ([127.0.0.1]) by localhost (tweak.unx.csupomona.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mLiaAUJUmYQy; Tue, 22 Sep 2009 12:19:55 -0700 (PDT) Received: from localhost (grey.iitsystems.csupomona.edu [134.71.248.26]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: hncaldwell) by tweak.unx.csupomona.edu (Postfix) with ESMTPSA id 0F29113406E; Tue, 22 Sep 2009 12:19:53 -0700 (PDT) Date: Tue, 22 Sep 2009 12:19:53 -0700 From: "Heath N. Caldwell" To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090922191953.GB4954@grey.iitsystems.csupomona.edu> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AB92082.2000706@spellingbeewinnars.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean On 2009-09-22 15:07, Patrick wrote: > Not to hijack this thread but if anyone has any links to books related > designing desktop applications I would love to receive such a link. > There are plenty of GUI design books but not much on backend side other > then pure DB stuff. I assume everything still uses MVC but I still > useless here I don't really know how to divide up the logic and lay the > App out. I have recently started reading Thinking Forth [1], which I think is pretty awesome and you might like. http://thinking-forth.sourceforge.net/ -- Heath Caldwell - hncaldwell@csupomona.edu Operating Systems Analyst - California State Polytechnic University, Pomona From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:21:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJLA70010762; Tue, 22 Sep 2009 16:21:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCC79193D2; Tue, 22 Sep 2009 16:20:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEF6B193CB for ; Tue, 22 Sep 2009 16:20:23 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1143406fgg.17 for ; Tue, 22 Sep 2009 12:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=30rZEb093mR2hdWSS4Wy20K79J8yz1/bv3T3wwEPrdw=; b=nLM932IESC6AwIjNH6eUGxBMY7NAda7shudXDvcMwR8EcvvFeFOJDUjozoS4G2gcLh vxOitYtGRssLDJa/UoxDL5UMZRZeu2zs8AwMLaWauHyBcBtKhXox8IqJhVT02PCsEk0P HmckX2HwO1LNhU8KALup1QcirOwkovWcTSnos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=ElQ3GOPaa/F5chM/oLlE4NzovTQyEfDgmnfnEbNuItqZMFTLCh40D2dnH0U8ud6MKz 7a/GM6wB2XbiW3TRV+T3vXu/m5v2L8HbyoWjFQ9rEYbirdeRGxxaPrG18GLkYL9O6udw auOq8cTGTwflUhiZtbX+sor640Bz1mO26AGfA= Received: by 10.86.208.2 with SMTP id f2mr1210986fgg.16.1253647230351; Tue, 22 Sep 2009 12:20:30 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id e20sm40785fga.7.2009.09.22.12.20.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Sep 2009 12:20:28 -0700 (PDT) Message-Id: <4EDC73AA-FE4D-41D4-9133-94F5463E4967@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Ftp server in lua? Date: Tue, 22 Sep 2009 21:19:56 +0200 References: <9386fb2d0909210454l799e87a2t5921f44a54d425a@mail.gmail.com> <472AD7E7-895B-4351-AA4E-9D4F570FF335@gmail.com> <9386fb2d0909211334y4ba1c993oe0e557ddd755bf71@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 21, 2009, at 10:34 PM, Pierre LeMoine wrote: > remote file storage of course =p do you have any superior > alternative to recommend? "Superiority" is in the eyes of the beholder, but more contemporary alternatives would include WebDAV and SFTP (not to be confused with FTPS) as mentioned by Javier and Peter. WebDAV is rather straightforward to get going. For illustration purpose, here is a pure Lua implementation, part of Nanoki, a little wiki engine implemented in Lua: http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua http://dev.alt.textdrive.com/browser/HTTP/WikiDAV.lua http://dev.alt.textdrive.com/browser/HTTP/WikiDAV.txt Online demo: http://svr225.stepx.com:3388/ Most modern OSs support WebDAV directly (e.g. davfs, "Web Folder", etc). For example, in Mac OS X, the above URL is mounted directly in the Finder as a shared drive. Xavante sports a WebDAV handler as well: http://luaforge.net/plugins/scmcvs/cvsweb.php/xavante/src/webdav/?cvsroot=xavante HTH. Cheers, -- PA. http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:21:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJLfNt010975; Tue, 22 Sep 2009 16:21:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DE19193DA; Tue, 22 Sep 2009 16:20:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD5CA193D6 for ; Tue, 22 Sep 2009 16:20:50 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id C22071873E for ; Tue, 22 Sep 2009 19:20:50 +0000 (GMT) Message-ID: <4AB92386.1080502@objmedia.demon.co.uk> Date: Tue, 22 Sep 2009 20:20:38 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> In-Reply-To: <4AB92082.2000706@spellingbeewinnars.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick wrote: > Ignoring languages such as assembly and so on, I wonder if it is safe to > I've found during my career (which is now well into its 3rd decade) that the folks that understand assembly language (for any processor, real or virtual) tend to understand word-size issues, truncations, pointer issues much better than those people that only work in high level languages. I can't put it any better than that, sorry, its just something you pick up when describing and working through issues with folks. A similar trait also appears with relation to understanding how memory works - those with low level machine knowledge seem to understand the pitfalls of memory management and possible solutions so much better than those that assume having a garbage collector means they can never suffer from memory leaks (you wish!). So, ignore assembly if you wish. In most cases it won't do you any harm. But if you do take the time to understand things at that level, you'll probably have some problems disolve before you later in life that would leave you puzzled without the slightly greater depth of your knowledge. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:30:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJTiat013275; Tue, 22 Sep 2009 16:29:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61E0B193EC; Tue, 22 Sep 2009 16:29:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF7BF193E2 for ; Tue, 22 Sep 2009 16:29:03 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MqB2w-0004GV-2D for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 20:29:06 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id BA2054E012 for ; Tue, 22 Sep 2009 20:29:04 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:59132 with envelope Message-ID: <4AB9338F.2040602@cowlark.com> Date: Tue, 22 Sep 2009 21:29:03 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> <87eipzro9q.fsf@lola.goethe.zz> <4AB91C22.8020709@objmedia.demon.co.uk> In-Reply-To: <4AB91C22.8020709@objmedia.demon.co.uk> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MJTiat013275 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stephen Kellett wrote: [...] > I think Python, although powerful, is not a good language to use, the > number of times I've wasted time because of the whitespace indentation > issues just make it a none-starter. Many years ago I wrote my own mail client in Python. It was a pretty chunky program, and I used it for a decent amount of time and even got some users and another developer before I found something better. (SQmaiL: http://sqmail.cvs.sourceforge.net/viewvc/sqmail/sqmail/src. Its main claim to fame is that it stores all mail in a MySQL database, so it can do blazing fast searches of everything.) What I learnt from this is: - - the whitespace issue is pretty much a non-starter. Basically, Python requires you to format the code the way you would format the code anyway. You *do* end up with issues when you need to move code from one location to another, but any editor worth using will fix that for you automatically. But multiline statements in Python have to be escaped with \; and that's a pain in the arse. Also, the 'pass' keyword (used to indicate an empty block) is a foul excrescence. - - Python libraries *rock*. They are utterly awesome. There is a library for *everything*. The application mainly consisted of glue to plug libraries together. MIME message decoding? Yep, that's there. MySQL interface? Uh-huh. POP3/SMTP abstraction? Sure. MBox parsers? Also there. About the only bit of pure functionality I had to write was the picon parser, and that's getting *really* exotic. Lua's libraries can't match Python's, I'm afraid. - - Python *scales* more nicely than Lua. Every time I write a big app in Lua I find myself fighting the module system; but with Python, doing it that way feels completely natural. Partly, of course, it's just that all variables in Python are table lookups, so you don't feel guilty about doing foo.bar.baz.boo(7), where a Lua programmer would want to cache that heavily in locals. - - . notation for methods. Yeah, yeah, I know... but it *does* feel cleaner that Lua, where you'd need to say something like foo.bar.baz:boo(7). - - Local-by-default. Aaargh. Please no. (Of course, Lua's global-by-default is almost as bad, but in a different direction.) - - Exceptions. Yes, Lua's got exceptions... but Python has the sugar to make them useful in everyday programming, and the standards in place so that everybody *uses* them. A try...catch in Lua is a bit of a mess, unfortunately. - - Keyword parameters: dead handy. Yes, Lua can do them with tables, but Python's approach is cleaner. - - Pickle. It's incredibly handy to be able to stash an arbitrary Python structure into a string and pull it out again. Yes, it's easy to do in Lua... but Python's pickles are already there, and are blazing fast. - - Closures. Looking at this code, I cannot believe I managed to write it without closures. These days I would never voluntarily write a GUI program that did not have closures, they are just so awesome. There's quite a lot of code I wrote for messily delegating callbacks from the Glade UI description file to the classes responsible for doing the work that would just vanish. - - Threads. Python has threads (but no coroutines). Lua has coroutines (but no threads). For some things you want one, for some you want the other... and for this app, I wanted threads. Doing the same thing in pure Lua would have hard; I'd have probably have gone with a third-party Lua threading implementation such as Lanes. I think I can summarise by saying that Python's killer feature is that it provides the sugar to make common tasks convenient. It's slow, it's big, it's unorthogonal and some things make me want to scream... but it's undoubtedly hugely *effective*. Little things, like the % operator for formatting strings, or try...catch, or the built in class system, or a dozen other things that make life easier. Alas for theoretical elegance, really. If I wanted to write a complex app these days... what would I pick? Well, I've already done WordGrinder, so I know it's possible... but I did end up fighting the module system all the way, and I did end up having to bolt stuff into a custom interpreter because the libraries I wanted weren't available. So it's hard to say. I suppose what would be really great is a kind of half-way house. I'm still fascinated by the idea of producing a HLL that compiles into Lua. Maybe I should revisit that idea... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKuTOPf9E0noFvlzgRAltdAKCOqMiYQ9WKh1/WHwCDj+puKTKzlwCZAUV/ EkTzdB/PSmueYQDkHvBWKrU= =9q1G -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:33:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJXN5T014589; Tue, 22 Sep 2009 16:33:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D65F193F5; Tue, 22 Sep 2009 16:32:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32CF2193E7 for ; Tue, 22 Sep 2009 16:32:50 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQE00GTR0XKGS20@asmtp017.mac.com> for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 12:32:42 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 21:32:08 +0200 References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 22, 2009, at 9:39 AM, steve donovan wrote: > He thought that Lua is not that commonly used as a general purpose > language, but rather as an embedded scripting language. This is > probably true. I, for one, totally disagree with that characterization. And I will leave it at that. Cheers, PA. "No, I don't have any formal theory, any actual code, and much less benchmarks to prove this, I'm just waving my hands to keep warm." -- Jarkko Hietaniemi From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:40:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJatJ1015839; Tue, 22 Sep 2009 16:36:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 694FF1A5DE; Tue, 22 Sep 2009 16:36:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D398193FB for ; Tue, 22 Sep 2009 16:36:13 -0300 (BRT) Received: by fxm12 with SMTP id 12so60869fxm.5 for ; Tue, 22 Sep 2009 12:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3H3eG4uCUVXK3UOtCLoIDdMt+vSzs+BiXy3U97kzb0k=; b=GqV9y3Z6YfEojfgZrmTHluBSmAJN0yktdOP72M1zmGxHVtqrkma3UYBpgKHeglDPY6 fhiRL0/iiPDNBNr720D3sZm7dgScIxDKSv95fg8alBhyxyjP4ocWbiUSkayke4mnJUXp mmt3YnY4Q7acbEJO/JmjfweuW1LlJCfiQbuuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IJrxEvwtqh4cVXp4hIExx+is+rhAP4fxkg8bNMwSJRYle15HA9q9TG63bxmCgy7n68 MQGkvT7PXYoMUd5CyybYRpXHM5uOcUgJDym8CFV/IYymd7JlQa379ACeF6ZRUh1ScxnR 7bl1eT4oMTgAQzA7PpQO/kxDEo9Quq8kpzTfo= MIME-Version: 1.0 Received: by 10.86.8.36 with SMTP id 36mr1247658fgh.7.1253648179416; Tue, 22 Sep 2009 12:36:19 -0700 (PDT) In-Reply-To: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 15:36:19 -0400 Message-ID: <347397800909221236r6c11303anbc4c92f10e4afaab@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Chris To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MJatJ1015839 On Tue, Sep 22, 2009 at 3:39 AM, steve donovan wrote: > But the question du jour is more whether Lua can be used as a good > introduction to programming, not necessarily as a 'trade skill'.  In > the same way, CS departments have variously used Pascal or Scheme for > this purpose.  Although Pascal was a rather frustrating language at > the time (Brian Kernighan has an interesting essay on the subject) it > was very good when I was a recovering FORTRAN programmer. (And Scheme > is definitely not a 'trade skill') > > So, in other words, does it teach the basic concepts well?  Your > answers will help #T1.2 have a less idiosyncratic answer ;) Personally I think the path a programmer takes depends on what their goals are. Business majors and such should learn Visual Basic or similar (VBA) to start with whereas Computer Science majors should learn C, machine language (ie. build their own CPU), and some sort of functional language (probably in that order). In my opinion Lua doesn't fit any of those categories. It doesn't have enough standard libraries (GUI, etc) for the Visual Basic-types and it isn't low level enough for career programmers. Lua fits in the "other stuff" to learn after you have cut your programming teeth (along with Perl, Python, Java, whatever). I can't imagine using Lua without knowing how to extend it in C. IMHO of course. ;) CR From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:41:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJfKvu017550; Tue, 22 Sep 2009 16:41:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A5B318B1F; Tue, 22 Sep 2009 16:40:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6916218648 for ; Tue, 22 Sep 2009 16:40:37 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MqBE8-0007oX-9x for lua@bazar2.conectiva.com.br; Tue, 22 Sep 2009 20:40:40 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id C07F44F029 for ; Tue, 22 Sep 2009 20:40:37 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:41565 with envelope Message-ID: <4AB93644.6080408@cowlark.com> Date: Tue, 22 Sep 2009 21:40:36 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> In-Reply-To: <4AB92082.2000706@spellingbeewinnars.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MJfKvu017550 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Patrick wrote: > The difference between not knowing any programming language > and learning your first well, is much further then picking up your > second and third language. Learning Forth taught me how to program in C. Learning Smalltalk taught me how to program in Java. Learning Java taught me the importance of pragmatism. Learning C taught me the importance of elegance. Learning machine code taught me how computers think. Learning Intercal taught me how programmers think. Learning BASIC taught me what I could do. Learning C++ taught me what not to do. Learning Javascript taught me that good ideas can still go wrong. Learning Lua taught me that getting things wrong can't stop a good idea. Learning Haskell taught me how much I still didn't know. I still haven't learnt Cobol. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKuTZEf9E0noFvlzgRAo54AKCHQHX1c/hrd7cl9ply4NqJBcfb+gCfcEOy RRZxBAf8bPt/xjoA4yxso2o= =u4pE -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 16:47:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MJlbhx019174; Tue, 22 Sep 2009 16:47:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2F7B19049; Tue, 22 Sep 2009 16:47:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35F8F18648 for ; Tue, 22 Sep 2009 16:46:56 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1150390fgg.17 for ; Tue, 22 Sep 2009 12:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=e/UTUfMUoBfvHmHxfaueMHuvbcxFKBGrJXnySkq1cd4=; b=qs/3QiLmn3xoXNylq7Xg/2meTlgVLKfqLoWH12PJAJE46CSChh85jbZkHdXq1buHyb 95VWotklE+yRM+lCaPqAVS4Dd7lZt62BymPfdzcU9MPgezhxAdAC5Puvc8MPll3OkW6e +bQ4EfqquRqMYvoU7F9AZEiqR7fHEWVdK/fvo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Eqpi4bpqfmCeR0MY7PGQUGLiu/ODvY6nBWw6+ubeUeYGKKq+PELoZkikdC5HvDqMLd KGzTjO4uwDFrVL1B4BQ2eGu+wLKvYH46cHRVseqSgBPZKmOWMSEhva0+op4iufGUefdU bR0ntVzSuos5JthL6R0AvRPgJStdqwL0hsmN0= Received: by 10.86.187.27 with SMTP id k27mr1244394fgf.11.1253648822010; Tue, 22 Sep 2009 12:47:02 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id d6sm3895731fga.16.2009.09.22.12.47.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Sep 2009 12:47:00 -0700 (PDT) Message-Id: <3F907D37-708C-4F98-B75A-A0B5F0D4FBF3@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4AB93644.6080408@cowlark.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 21:46:29 +0200 References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <4AB93644.6080408@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 22, 2009, at 10:40 PM, David Given wrote: > Learning Forth taught me how to program in C. > Learning Smalltalk taught me how to program in Java. > Learning Java taught me the importance of pragmatism. > Learning C taught me the importance of elegance. > Learning machine code taught me how computers think. > Learning Intercal taught me how programmers think. > Learning BASIC taught me what I could do. > Learning C++ taught me what not to do. > Learning Javascript taught me that good ideas can still go wrong. > Learning Lua taught me that getting things wrong can't stop a good > idea. > Learning Haskell taught me how much I still didn't know. > > I still haven't learnt Cobol. Nice :) In the same vein: Algol: Assembly language is too low-level. Pascal: Algol doesn't have enough data types. Modula: Pascal is too wimpy for systems programming. Simula: Algol isn't good enough at simulations. Smalltalk: Not everything in Simula is an object. Fortran: Assembly language is too low-level. Cobol: Fortran is scary. PL/1: Fortran doesn't have enough data types. Ada: Every existing language is missing something. Basic: Fortran is scary. APL: Fortran isn't good enough at manipulating arrays. J: APL requires its own character set. C: Assemby language is too low-level. C++: C is too low-level. Java: C++ is a kludge. And Microsoft is going to crush us. C#: Java is controlled by Sun. Lisp: Turing Machines are an awkward way to describe computation. Scheme: MacLisp is a kludge. T: Scheme has no libraries. Common Lisp: There are too many dialects of Lisp. Dylan: Scheme has no libraries, and Lisp syntax is scary. Perl: Shell scripts/awk/sed are not enough like programming languages. Python: Perl is a kludge. Ruby: Perl is a kludge, and Lisp syntax is scary. Prolog: Programming is not enough like logic. What Languages Fix http://www.paulgraham.com/fix.html From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 17:18:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MKIijT026664; Tue, 22 Sep 2009 17:18:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22C181852C; Tue, 22 Sep 2009 17:18:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.rockstargames.com (relay.rockstargames.com [69.10.69.6]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E41EB1851D for ; Tue, 22 Sep 2009 17:17:59 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by relay.rockstargames.com (Postfix) with ESMTP id C4789AD404B for ; Tue, 22 Sep 2009 16:18:04 -0400 (EDT) Received: from relay.rockstargames.com ([127.0.0.1]) by localhost (relay.rockstargames.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8P5vzFaCbSX for ; Tue, 22 Sep 2009 16:18:04 -0400 (EDT) Received: from tldnycexg1.t2.corp (unknown [10.253.0.20]) by relay.rockstargames.com (Postfix) with ESMTP id A80BEAD401C for ; Tue, 22 Sep 2009 16:18:04 -0400 (EDT) Received: from 2kgbalexg1.2kgames.t2.corp ([10.6.48.75]) by tldnycexg1.t2.corp with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Sep 2009 16:18:04 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 16:18:03 -0400 Message-ID: In-Reply-To: <3F907D37-708C-4F98-B75A-A0B5F0D4FBF3@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Suitability of Lua as a First Programming Language? Thread-Index: Aco7vYq200KMkA6DT6KmxBBzcAbPcQAA0fCQ References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de><4AB92082.2000706@spellingbeewinnars.org><4AB93644.6080408@cowlark.com> <3F907D37-708C-4F98-B75A-A0B5F0D4FBF3@gmail.com> From: "Shaun Seckman (Firaxis)" To: "Lua list" X-OriginalArrivalTime: 22 Sep 2009 20:18:04.0319 (UTC) FILETIME=[CA5B52F0:01CA3BC1] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MKIijT026664 Those are amazing lists :) Lua has grown very popular in the games industry and is used as a scripting language for games such as World of Warcraft, Farcry and Neverwinter Nights. I've met many people who learned Lua as their first programming language merely to create nifty mods for these games. They enjoy the immediate visual feedback from seeing their mod in action. In this sense, Lua served as a gateway drug to their interest in programming and now many I know have started to learn C++ or Python. -----Original Message----- From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Petite Abeille Sent: Tuesday, September 22, 2009 3:46 PM To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? On Sep 22, 2009, at 10:40 PM, David Given wrote: > Learning Forth taught me how to program in C. > Learning Smalltalk taught me how to program in Java. > Learning Java taught me the importance of pragmatism. > Learning C taught me the importance of elegance. > Learning machine code taught me how computers think. > Learning Intercal taught me how programmers think. > Learning BASIC taught me what I could do. > Learning C++ taught me what not to do. > Learning Javascript taught me that good ideas can still go wrong. > Learning Lua taught me that getting things wrong can't stop a good > idea. > Learning Haskell taught me how much I still didn't know. > > I still haven't learnt Cobol. Nice :) In the same vein: Algol: Assembly language is too low-level. Pascal: Algol doesn't have enough data types. Modula: Pascal is too wimpy for systems programming. Simula: Algol isn't good enough at simulations. Smalltalk: Not everything in Simula is an object. Fortran: Assembly language is too low-level. Cobol: Fortran is scary. PL/1: Fortran doesn't have enough data types. Ada: Every existing language is missing something. Basic: Fortran is scary. APL: Fortran isn't good enough at manipulating arrays. J: APL requires its own character set. C: Assemby language is too low-level. C++: C is too low-level. Java: C++ is a kludge. And Microsoft is going to crush us. C#: Java is controlled by Sun. Lisp: Turing Machines are an awkward way to describe computation. Scheme: MacLisp is a kludge. T: Scheme has no libraries. Common Lisp: There are too many dialects of Lisp. Dylan: Scheme has no libraries, and Lisp syntax is scary. Perl: Shell scripts/awk/sed are not enough like programming languages. Python: Perl is a kludge. Ruby: Perl is a kludge, and Lisp syntax is scary. Prolog: Programming is not enough like logic. What Languages Fix http://www.paulgraham.com/fix.html From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 17:23:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MKNfgu027677; Tue, 22 Sep 2009 17:23:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6ECB1A65A; Tue, 22 Sep 2009 17:23:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64E5E18537 for ; Tue, 22 Sep 2009 17:23:06 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8MKNDxi002602 for ; Tue, 22 Sep 2009 17:23:13 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 1CF7254C11D; Tue, 22 Sep 2009 17:23:14 -0300 (BRT) Date: Tue, 22 Sep 2009 17:23:14 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: length operator # for tables with metatables Message-ID: <20090922202314.GB14358@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Lua manual defines length operator "#" for tables as follows: > [...] > > As one can see from the definition above tbl[#tbl+1] must always be nil. > > Unfortunately, it is not the case when table has a metatable as the > following example illustrates: > > [...] > > Of course, I can always redefine __len meta-method to bring some > sanity to the table. What worries me, though, is that the default > behavior is so messy. Probably the manual should mention that all operations in the explanation refer to the raw operations, but most people somehow seem to understand that. > Am I missing something? Goodwill? -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 17:26:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MKQrp7028694; Tue, 22 Sep 2009 17:26:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12B2A1A662; Tue, 22 Sep 2009 17:26:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F15BC1A65D for ; Tue, 22 Sep 2009 17:26:13 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8MKQLvf002954 for ; Tue, 22 Sep 2009 17:26:21 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 0F40454C11D; Tue, 22 Sep 2009 17:26:22 -0300 (BRT) Date: Tue, 22 Sep 2009 17:26:22 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090922202622.GC14358@inf.puc-rio.br> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <3F907D37-708C-4F98-B75A-A0B5F0D4FBF3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Lua has grown very popular in the games industry and is used as a > scripting language for games such as World of Warcraft, Farcry and > Neverwinter Nights. I've met many people who learned Lua as their first > programming language merely to create nifty mods for these games. They > enjoy the immediate visual feedback from seeing their mod in action. > > In this sense, Lua served as a gateway drug to their interest in > programming and now many I know have started to learn C++ or Python. So they can become real programmers? ;) (A related question: are Lua programmers quiche eaters?) -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 17:30:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MKU9Ci029622; Tue, 22 Sep 2009 17:30:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C63601A666; Tue, 22 Sep 2009 17:29:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC7351A663 for ; Tue, 22 Sep 2009 17:29:31 -0300 (BRT) Received: by fxm12 with SMTP id 12so104879fxm.5 for ; Tue, 22 Sep 2009 13:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=O+8v1h9C60NhrEkzyAza8fAdYSkOrJjOErORucNs0Xk=; b=HtDw1ajXT4FY7gwjT+NUuQiZz7Nio/vEfMtAep+MlbzW1Y4yrQ7/ANM4FVqKnmDrb/ 91LIHlIAKBTWnclDDJGLvBdgkCrZL4bXnBGPv8Ci6davUqegj6kKWbZE/34pSVGbxFMA z1sXlmSfRa3U8BhNwRE4cGpmKbKAVc/U2Ge54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=vCZZUR17AeV2EXEEyhYPr9wuDAcjrXqm39lXiJUE+LuFryhiOmgMjQZf6/G+SZmMeW OQ6TcEctw48KAB3MBTCP3ruZyWiW8+ofq8Hf8bBd+VVkBLIuBsqnAaGryz1PQ+PqTHqn 703LJt3Trm6Sbae0ENAo3g5nhQW//bOLYbS/E= Received: by 10.86.208.2 with SMTP id f2mr1274705fgg.16.1253651376987; Tue, 22 Sep 2009 13:29:36 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id d6sm114638fga.21.2009.09.22.13.29.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Sep 2009 13:29:36 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <20090922202622.GC14358@inf.puc-rio.br> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Suitability of Lua as a First Programming Language? Date: Tue, 22 Sep 2009 22:29:05 +0200 References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <3F907D37-708C-4F98-B75A-A0B5F0D4FBF3@gmail.com> <20090922202622.GC14358@inf.puc-rio.br> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 22, 2009, at 10:26 PM, Roberto Ierusalimschy wrote: > (A related question: are Lua programmers quiche eaters?) Yes, it has been statistically proven that most Lua programmers exhales. From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 18:06:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ML5juC005885; Tue, 22 Sep 2009 18:05:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A80B1A66E; Tue, 22 Sep 2009 18:05:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 763B91A665 for ; Tue, 22 Sep 2009 18:04:50 -0300 (BRT) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090922210453.RUBN6611.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Tue, 22 Sep 2009 22:04:53 +0100 Received: from [192.168.1.10] (really [80.6.12.233]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090922210453.YGBX13254.aamtaout01-winn.ispmail.ntl.com@[192.168.1.10]> for ; Tue, 22 Sep 2009 22:04:53 +0100 Message-ID: <4AB93BF2.7060102@ntlworld.com> Date: Tue, 22 Sep 2009 22:04:50 +0100 From: Chris Camacho User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <4AB93644.6080408@cowlark.com> In-Reply-To: <4AB93644.6080408@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=yHmVK2EnpsgA:10 a=xF0OoPwmytvNRxrs0l8A:9 a=_doVRU44YqjWyMeXa9Xct59VyioA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The fact there are just so many languages proves one thing There is no such thing as an ideal language... From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 18:54:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8MLsiHj016426; Tue, 22 Sep 2009 18:54:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46BB81A66A; Tue, 22 Sep 2009 18:53:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDE09321B3 for ; Tue, 22 Sep 2009 18:53:44 -0300 (BRT) Received: by ewy5 with SMTP id 5so170607ewy.36 for ; Tue, 22 Sep 2009 14:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2P6/YmxdgGZj4Zpkbpiq+P2k6AQH79jpUovpRVZ6ejg=; b=DihWx+FHlmQjDsVpAdHtRCZQMI5szqAv8rgEECY236RVs8YTmjJmCi73cBI/Zru6ks /Dvmd8OGhv73PSP5SE1VWj2bPiwfIfqLcQBIuEOWxB6y/fd6oltoPfhDPxx3DV1LZWCH vHEXzkDHc5l6R7S5MxeyL4SCZX5dt7U/Pmxz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=cVWnTAOw763T+DvBEzPEQSHvE975Ufx+QepVVi5Oz8w1J3M7Nes/6HxBhmB5qoYdZR 7uDLp21crnEc0YU18i4bUTDeM7uJszwb4cCwISed4Q6NKOdtWt8R1ervwYmwcBqajqdW MmlfvH2Qcrh4yYX05WdMBN6jIm1N9WPEk1VeM= MIME-Version: 1.0 Received: by 10.211.147.10 with SMTP id z10mr1652450ebn.61.1253656429568; Tue, 22 Sep 2009 14:53:49 -0700 (PDT) In-Reply-To: <20090922202314.GB14358@inf.puc-rio.br> References: <20090922202314.GB14358@inf.puc-rio.br> Date: Tue, 22 Sep 2009 17:53:49 -0400 Message-ID: Subject: Re: length operator # for tables with metatables From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8MLsiHj016426 On Tue, Sep 22, 2009 at 4:23 PM, Roberto Ierusalimschy wrote: >> Lua manual defines length operator "#" for tables as follows: >> [...] >> >> As one can see from the definition above tbl[#tbl+1] must always be nil. >> >> Unfortunately, it is not the case when table has a metatable as the >> following example illustrates: >> >> [...] >> >> Of course, I can always redefine __len meta-method to bring some >> sanity to the table.  What worries me, though, is that the default >> behavior is so messy. > > Probably the manual should mention that all operations in the > explanation refer to the raw operations, but most people somehow seem to > understand that. > > >> Am I missing something? > > Goodwill? > > -- Roberto The real problem is that in a common idiom "t[#t+1]=v" t[i] obeys meta-method resolution while #t ignores metatable altogether. I think that the manual should be more precise when defining # for tables and use rawget(t,n) in place of t[n] "The length of a table t is defined to be any integer index n such that rawget(t, n) is not nil and rawget(t, n+1) is nil; moreover, if rawget(t, 1) is nil, n can be zero. For a regular array, with non-nil values from 1 to a given n, its length is exactly that n, the index of its last value. If the array has "holes" (that is, nil values between other non-nil values), then #t can be any of the indices that directly precedes a nil value (that is, it may consider any such nil value as the end of the array)." --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 21:41:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N0fvbI003792; Tue, 22 Sep 2009 21:41:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B23E1A67D; Tue, 22 Sep 2009 21:41:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 238E41A5ED for ; Tue, 22 Sep 2009 21:41:12 -0300 (BRT) Received: from [93.172.145.227] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQE007Q2F8RJA00@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 03:41:16 +0300 (IDT) Date: Wed, 23 Sep 2009 03:41:18 +0300 From: Shmuel Zeigerman Subject: Separate groups of scripts To: Lua list Message-id: <4AB96EAE.9060700@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean There is a Lua program that allows users to add their scripts in such a way that them will be callable via the program's menu (or via hot keys). Every user usually organizes his scripts and modules in a separate subdirectory (subtree, in fact) of the main Lua program, and adds this subdirectory in front of package.path. This is not elegant, but moreover, is not safe, since different users may have identically named modules. I thought of a solution, where the program assigns each user (that is, each group of scripts) a separate environment and calls those scripts within that environment. But AFAIK, there is no way to have a package.path per an environment, there is only one package.path. There is one simple solution: the program modifies package.path every time it is about to run a user script. But though it would work, it looks inelegant in comparison to imaginary "package.path per environment". Are there some other solutions? -- Shmuel From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 22:11:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N1BIox006534; Tue, 22 Sep 2009 22:11:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C97B1A689; Tue, 22 Sep 2009 22:10:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3E2F1A685 for ; Tue, 22 Sep 2009 22:10:43 -0300 (BRT) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N1Ao0k006493 for ; Tue, 22 Sep 2009 22:10:50 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 7ABE31F1160; Tue, 22 Sep 2009 22:10:50 -0300 (BRT) Date: Tue, 22 Sep 2009 22:10:50 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Separate groups of scripts Message-ID: <20090923011050.GA22414@magritte.tecgraf.puc-rio.br> References: <4AB96EAE.9060700@013net.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AB96EAE.9060700@013net.net> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I thought of a solution, where the program assigns each user (that is, > each group of scripts) a separate environment and calls those scripts > within that environment. But AFAIK, there is no way to have a > package.path per an environment, there is only one package.path. Why not a separate Lua state for each user? From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 23:12:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N2CkVI012963; Tue, 22 Sep 2009 23:12:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D46AD190F7; Tue, 22 Sep 2009 23:12:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f196.google.com (mail-iw0-f196.google.com [209.85.223.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E07C18F13 for ; Tue, 22 Sep 2009 23:11:56 -0300 (BRT) Received: by iwn34 with SMTP id 34so200642iwn.12 for ; Tue, 22 Sep 2009 19:12:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.42.150 with SMTP id s22mr3415089ibe.22.1253671921521; Tue, 22 Sep 2009 19:12:01 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Tue, 22 Sep 2009 22:12:01 -0400 X-Google-Sender-Auth: 19ce82c3fb09cd42 Message-ID: Subject: Re: Suitability of Lua as a First Programming Language? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8N2CkVI012963 On Tue, Sep 22, 2009 at 3:32 PM, Petite Abeille wrote: > On Sep 22, 2009, at 9:39 AM, steve donovan wrote: >> He thought that Lua is not that commonly used as a general purpose >> language, but rather as an embedded scripting language.  This is >> probably true. > I, for one, totally disagree with that characterization. Just to clarify :) I actually said "I'm not aware of that many people using Lua as a first general purpose language, except maybe when its embedded in an application for a special purpose" (with emphasis on first). I'd suspect a fair number of people using Lua standalone for general purposes use it because they have experience in the other obvious choices of languages but know they instead want something lean, fast, robust, having closures/coroutines/incremental-gc, redistributable, sandboxable, and interfaceable to C and can accept hacking and recompiling some C code, etc. That's not to say that Lua is unsuitable for a newcomer though, as there are some strong (and some weaker) points in acm.org - What is a Good First Programming Language? http://www.acm.org/crossroads/xrds10-4/firstlang.html From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 23:31:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N2VOVG014928; Tue, 22 Sep 2009 23:31:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3633F1A672; Tue, 22 Sep 2009 23:30:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20B951A5D9 for ; Tue, 22 Sep 2009 23:30:42 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0194.bmts.com [209.240.125.194]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n8N2UYh5031765 for ; Tue, 22 Sep 2009 22:30:46 -0400 Message-ID: <4AB9884A.1090702@hempeldesigngroup.com> Date: Tue, 22 Sep 2009 22:30:34 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Gavin Wraith wrote: > In message <89d273ba0909220127g7c1c3696k656c9e2721c4deec@mail.gmail.com> > you wrote: > >>> But the question du jour is more whether Lua can be used as a good >>> introduction to programming, not necessarily as a 'trade skill'. > >> I think Lua would be a very good first programming language, > > I can only speak for myself, but I never really understood object-oriented > programming until I encountered Lua. The reason for this, I think, is > that Lua lets you maintain a reasonably accurate mental picture of > how data is structured in memory. Bing! I agree completely here. And I'll add that since it's an interpreter, you can experiment very painlessly. Ralph From lua-bounces@bazar2.conectiva.com.br Tue Sep 22 23:46:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N2kTOd016647; Tue, 22 Sep 2009 23:46:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8DF81A68E; Tue, 22 Sep 2009 23:45:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f196.google.com (mail-iw0-f196.google.com [209.85.223.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46FE71A686 for ; Tue, 22 Sep 2009 23:45:46 -0300 (BRT) Received: by iwn34 with SMTP id 34so212345iwn.12 for ; Tue, 22 Sep 2009 19:45:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.61.195 with SMTP id u3mr3514228ibh.12.1253673953195; Tue, 22 Sep 2009 19:45:53 -0700 (PDT) In-Reply-To: <4AB9338F.2040602@cowlark.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> <87eipzro9q.fsf@lola.goethe.zz> <4AB91C22.8020709@objmedia.demon.co.uk> <4AB9338F.2040602@cowlark.com> Date: Tue, 22 Sep 2009 22:45:53 -0400 X-Google-Sender-Auth: 3b2b8b15199d114d Message-ID: Subject: Re: Suitability of Lua as a First Programming Language? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 4:29 PM, David Given wrote: > - - Python libraries *rock*....Lua's libraries can't match Python's, I'm afraid. > .. > - - Python *scales* more nicely than Lua. Every time I write a big app in > Lua I find myself fighting the module system; > ... > Well, I've already done WordGrinder, so I know it's possible... but I > did end up fighting the module system all the way, and I did end up > having to bolt stuff into a custom interpreter because the libraries I > wanted weren't available. So it's hard to say. Would you see any value in http://labix.org/lunatic-python ? I've tried it out but haven't much used it for real work. I'd also prefer if the licensing was simplified to MIT (and even considered rewriting it because of that since since the potential for bringing Python modules into Lua and distributing it as a single package seems huge). On the module system, you replied [1]: > > Errm, maybe I'm missing something here, but couldn't you just say: > > module( ..., package.seeall ) > That's a very good question. When I come up with an answer > I'll let you know... Is there any update on that? (I've had my own thoughts [2].) [1] http://lua-users.org/lists/lua-l/2008-09/msg00296.html [2] http://lua-users.org/lists/lua-l/2009-09/msg00387.html From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 04:04:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N74a94005700; Wed, 23 Sep 2009 04:04:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFCAF185DD; Wed, 23 Sep 2009 04:04:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1838C185BE for ; Wed, 23 Sep 2009 04:03:36 -0300 (BRT) Received: by bwz10 with SMTP id 10so346508bwz.5 for ; Wed, 23 Sep 2009 00:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=soyXGDeidv4u7CXCMvb5YMS00Y2e/RjlgPsJJKmg3u4=; b=TV2a/wUpv6ruzrSEg2Nktsbe994E3MwdW/oRuSu5xi/EYQzi0XQgUsD71RafMBrSgd eSm+/XAAE8cbVXgdArOUDA2G1S92DHc7UXzjIdYzhoMmU7jAsuMcSheLvuktx7tlyks5 3PO+55VvuCeWWdzAUBKJywFULfcv6uF1yArjs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ry3nwKMgZHTGKkKaxlgZnFs2ddUnIwhn+5dgcGO16IU/9n3Dtx45Jrg/Fq+foBCNxB tySCBkX0f+KM01bcY6MrLVuqpY4FYeD8WuDHd4CmolZIp+285LFm7FR0GNS027PDKo38 074oLD3+15yJWAPYrOUAkTZenyogLlTIbQmRs= MIME-Version: 1.0 Received: by 10.204.34.73 with SMTP id k9mr1567383bkd.45.1253689423519; Wed, 23 Sep 2009 00:03:43 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> Date: Wed, 23 Sep 2009 09:03:42 +0200 Message-ID: <560972290909230003h114ed827xe2a8348418d70d93@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 4:12 AM, David Manura wrote: > Just to clarify :) I actually said "I'm not aware of that many people > using Lua as a first > general purpose language, except maybe when its embedded in an > application for a special purpose" (with emphasis on first). Sorry, David, I should know better than to try to simplify a simple quote ;) > I'd suspect a fair number of people using Lua standalone for general > purposes use it because they have experience in the other obvious > choices of languages In my case, the iniitial fix came from writing Lua macros for SciTE, and finally getting that 'scriptable editors are cool' rush that other people seem to have got from Emacs. At the time, my alternative language was Boo, by the inestimable Rodrigo "Bamboo" de Oliveira which is a statically-typed Python-like language with type inference. But the compiler was so slow, and the name so silly. And Python itself was not elegant, felt 'noisy', and too big and slow. This curiousity-about-programming-languages is common here, but not so common in the so-called 'real world' - so I don't consider myself a typical data point. That paper is a good summary of PL issues with newcomers, and Lua ticks many of the good boxes. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 04:13:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N7Cx7C007015; Wed, 23 Sep 2009 04:12:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8BC618629; Wed, 23 Sep 2009 04:12:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 525AF185F9 for ; Wed, 23 Sep 2009 04:12:22 -0300 (BRT) Received: by fxm12 with SMTP id 12so374187fxm.5 for ; Wed, 23 Sep 2009 00:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=WyN8WrlFGi8RJPax1zYTZevEKLh2djdrdE1rrqcgldw=; b=PHZi1O4HJBT16k9JuXRRshsh2noKS2VxRfnygCOeRLx0z2Z6wzAezZGBQZngHRPFxF Rix5HSEzVia38HnrrehMuQs+YpW+LlSUbvNi9HRlxD+A5gzEe/vJQC8yl42LR9R0YkiL xKJYYvF5itp1cTLtoJzExncRdbzVFYHU6RqjQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ctOLuT3A6hAH/A+QYIEUbjNckwsJ7hEnSots9gspHsSJu25Hq4HgPxSyrx1AxH1PE9 wMJwVRkWh5FNCMy7m9oGdDS/urMUYoeFVtqSj13p0Hi2kwxVvg9JZpj5FJGCOovoC2Ex DScqX6UbLK7TRCVMun2PhWqIAAJHXqFnLKdik= MIME-Version: 1.0 Received: by 10.204.156.203 with SMTP id y11mr1572853bkw.200.1253689948862; Wed, 23 Sep 2009 00:12:28 -0700 (PDT) Date: Wed, 23 Sep 2009 09:12:28 +0200 Message-ID: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> Subject: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8N7Cx7C007015 On Tue, Sep 22, 2009 at 8:43 PM, Florian Weimer wrote: > I think the main criterion is availability of introductory texts. > Without that, creating a course will be a lot of work.  (I found > Programming in Lua an extremely inspiring read, but it's probably not > that helpful to absolute beginners.) Yes, I would put it on my bookshelf next to K & R, in terms of clarity. But K & R is not an introductory text either ;) There are other Lua books (often in the games context); are they better at introductions? Is there a niche here for a good introduction? I've written & published a book, it was a great experience, but there would have to be readers ;) >  But the default, non-strict mode would be unnecessarily > confusing, I fear. You mean misspellings being new global variables? Yes, strict.lua is a great little tool. Interactivity is a big, big plus, because it allows for an almost conversational mode of language learning. Whether all people learn PLs better in conversational mode I don't know, but it certainly works for a lot of people. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 04:24:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N7Ojjk008080; Wed, 23 Sep 2009 04:24:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EDFF1A698; Wed, 23 Sep 2009 04:24:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E4A01A698 for ; Wed, 23 Sep 2009 04:24:00 -0300 (BRT) Received: by fxm12 with SMTP id 12so380323fxm.5 for ; Wed, 23 Sep 2009 00:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=KqeJehGjTrlBWJjVl8k3oTfwCKKt7mqxVPcXH4C7GBA=; b=pGaMBd2wNYEYupKMQSrIC/VYXOGgPW8VEjgFE1Inl+Jtg7RJdMCfSJYWnpOTemkm8Y 5OIG9czDLiOJvuQx4YAWRqOq9xVCWWHSCNAq6Pfo1Xd5Ggbkt57C9vdAhbMwfryIad/E EQlAS+uVzveZuSe0gBFcb4U+tKNCkDM3qnfZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=E2EpF/EZfneiatOwOFf+av11rShRBL6IwFUKZ/SgJNmxwM0Xz3cQnRcIDxPYP4Q/AS 8ax5C2PvmGJBLZHLjPQ4Ksw2rqLRTR49D3Agwdr3EMXPI/DpuM0bIZkpM0/87JDYgGlJ yaKcyIgxkRSCi8fe87slpy2335QAqMf97nGjA= MIME-Version: 1.0 Received: by 10.204.18.145 with SMTP id w17mr1605846bka.42.1253690646667; Wed, 23 Sep 2009 00:24:06 -0700 (PDT) In-Reply-To: <347397800909221236r6c11303anbc4c92f10e4afaab@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <347397800909221236r6c11303anbc4c92f10e4afaab@mail.gmail.com> Date: Wed, 23 Sep 2009 09:24:06 +0200 Message-ID: <560972290909230024n1cc7a77bh1498d5a26428ffc9@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8N7Ojjk008080 On Tue, Sep 22, 2009 at 9:36 PM, Chris wrote: > Personally I think the path a programmer takes depends on what their > goals are.  Business majors and such should learn Visual Basic or > similar (VBA) to start with It's time for that old dog to die, I fear. Java is better for them. Getting overdependent on IDEs too early is bad, because then Everything is a Form, the program becomes the Interface, and may look good but inside is a mess of spaghetti. > whereas Computer Science majors should > learn C, machine language (ie. build their own CPU), and some sort of > functional language (probably in that order). There is debate about that. This is why there was a trend to use Scheme, basically because it was _differerent_ and forced people to think about programming, even if they had been spending their adolescence writing games in BASIC. Higher-level approaches to solving problems, that sort of thing. Some CS departments are not into engineering ;) > In my opinion Lua doesn't fit any of those categories.  It doesn't > have enough standard libraries (GUI, etc) for the Visual Basic-types wxLua is mature, and Lua can run on the JVM - plenty of libraries, just pick an appropriate one. (Too many choices, perhaps?) > I can't imagine using Lua without knowing how to extend it in C. It's not difficult to imagine that, surely? The WoW or SciTE scripter uses the interface as presented. But I do think that C makes an excellent _companion_ language for Lua (much as inline assembly for C programmers) ;) steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 04:29:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N7TL5N008426; Wed, 23 Sep 2009 04:29:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91F001A6A3; Wed, 23 Sep 2009 04:28:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas06p.mx.bigpond.com (nschwmtas06p.mx.bigpond.com [61.9.189.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1ACF01A69E for ; Wed, 23 Sep 2009 04:28:40 -0300 (BRT) Received: from nschwotgx03p.mx.bigpond.com ([143.238.91.39]) by nschwmtas06p.mx.bigpond.com with ESMTP id <20090923072846.XINN22839.nschwmtas06p.mx.bigpond.com@nschwotgx03p.mx.bigpond.com>; Wed, 23 Sep 2009 07:28:46 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx03p.mx.bigpond.com with ESMTP id <20090923072845.OBQF10433.nschwotgx03p.mx.bigpond.com@[10.0.0.8]>; Wed, 23 Sep 2009 07:28:45 +0000 Message-ID: <4AB9CC04.9070403@bigpond.net.au> Date: Wed, 23 Sep 2009 17:19:32 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> In-Reply-To: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx03p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Wed, 23 Sep 2009 07:28:45 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.4AB9CE2E.0017,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > Yes, I would put it on my bookshelf next to K & R, in terms of > clarity. But K & R is not an introductory text either ;) > > There are other Lua books (often in the games context); are they > better at introductions? Is there a niche here for a good > introduction? I've written & published a book, it was a great > experience, but there would have to be readers ;) > I've found the game development focus books that deal with Lua to be a tad on the "recipe but no explanation" side. For the record, I have the following on the bookshelf for Lua: * Lua Reference Manual, because I like having it around * Programming in Lua, not really introductory but not an advanced text either * Lua Programming Gems, which has some very good nuggets I would be oblivious to otherwise > You mean misspellings being new global variables? Yes, strict.lua is a > great little tool. > Personally, "strict.lua" works well for me alone, but I am currently thinking of using LuaStrict (http://thomaslauer.com/comp/LuaStrict) and seeing how it works out because I will be allowing artist-type colleagues to add Lua code to the project and would prefer as much protection as I can get! -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 04:37:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N7beNO009266; Wed, 23 Sep 2009 04:37:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 697511A6AB; Wed, 23 Sep 2009 04:37:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout4.netvision.net.il (mxout4.netvision.net.il [194.90.9.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC7AA1A691 for ; Wed, 23 Sep 2009 04:37:01 -0300 (BRT) Received: from [93.173.57.116] by mxout4.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQE00CE3YHT8S70@mxout4.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 10:37:05 +0300 (IDT) Date: Wed, 23 Sep 2009 10:37:08 +0300 From: Shmuel Zeigerman Subject: Re: Separate groups of scripts In-reply-to: <20090923011050.GA22414@magritte.tecgraf.puc-rio.br> To: Lua list Message-id: <4AB9D024.5070205@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4AB96EAE.9060700@013net.net> <20090923011050.GA22414@magritte.tecgraf.puc-rio.br> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> I thought of a solution, where the program assigns each user (that is, >> each group of scripts) a separate environment and calls those scripts >> within that environment. But AFAIK, there is no way to have a >> package.path per an environment, there is only one package.path. > > Why not a separate Lua state for each user? My program is pure Lua. To assign users separate Lua states, it must use some external library, e.g. Rings. Thanks for the advice, this is certainly an option worth to be considered. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 05:20:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N8KDPQ013402; Wed, 23 Sep 2009 05:20:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C6911A6A8; Wed, 23 Sep 2009 05:19:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost03.mail.zen.net.uk (smarthost03.mail.zen.net.uk [212.23.3.142]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AC48321B3 for ; Wed, 23 Sep 2009 05:19:30 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MqN4Z-0005lr-2G for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 08:19:35 +0000 From: "John Hind" To: "'Lua list'" References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> In-Reply-To: <20090922191953.GB4954@grey.iitsystems.csupomona.edu> Subject: RE: Suitability of Lua as a First Programming Language? Date: Wed, 23 Sep 2009 09:18:25 +0100 Message-ID: <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco7udmlgyGUfmvpQ8SDb4BJWBAAHQAaq1Qw Content-Language: en-gb X-Originating-Smarthost03-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Argg! I am not normally a language bigot, but if there is one programming language that ought to be banned it is Forth. It would certainly be a disastrously awful teaching language. I had to do a project in this language some years ago and I would not be exaggerating when I say it nearly drove me to a nervous breakdown! A colleague on the project described Forth as "the write once, read never language" and certainly it was a major challenge to understand code you had written a few hours ago let alone what anyone else had written. Reading Forth code is like trying to translate a book written in a foreign language armed only with a dictionary itself written in that language - you look up a word, then you look up a word in the definition, then a word in that definition, six stack levels down you've completely lost track of where you started! One thing I agree with on the web site you reference, Forth is certainly a "unique programming language", but that alone surely makes it a poor choice for teaching? > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Heath N. Caldwell > Sent: 22 September 2009 20:20 > To: Lua list > Subject: Re: Suitability of Lua as a First Programming Language? > > On 2009-09-22 15:07, Patrick wrote: > > Not to hijack this thread but if anyone has any links to books > related > > designing desktop applications I would love to receive such a link. > > There are plenty of GUI design books but not much on backend side > other > > then pure DB stuff. I assume everything still uses MVC but I still > > useless here I don't really know how to divide up the logic and lay > the > > App out. > > I have recently started reading Thinking Forth [1], which I think is > pretty awesome and you might like. > > http://thinking-forth.sourceforge.net/ > > -- > Heath Caldwell - hncaldwell@csupomona.edu > Operating Systems Analyst - California State Polytechnic University, > Pomona From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 05:40:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N8eVkx015128; Wed, 23 Sep 2009 05:40:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 875BB1A6B0; Wed, 23 Sep 2009 05:40:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC7901A66B for ; Wed, 23 Sep 2009 05:39:56 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 5297318741 for ; Wed, 23 Sep 2009 08:40:02 +0000 (GMT) Message-ID: <4AB9DEE2.6090000@objmedia.demon.co.uk> Date: Wed, 23 Sep 2009 09:40:02 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> In-Reply-To: <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean John Hind wrote: > Argg! I am not normally a language bigot, but if there is one programming > language that ought to be banned it is Forth. It would certainly be a > Likewise, I was quite surprised at the interest in Factor, which is a Forth inspired language. I do wonder if some of the more recent scripting/on-the-fly languages of the last few years, I've wondered if they get their following as some sort of "look at me, I'm using the latest shiny language" rather than the language is any good in the first place. Forth was abandoned because it was too hard to use. Why go back there? I'm sure a die-hard calculator user will be able to tell me :-) From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 05:56:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N8ujNO016367; Wed, 23 Sep 2009 05:56:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01B231A6B3; Wed, 23 Sep 2009 05:56:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0BB61A682 for ; Wed, 23 Sep 2009 05:56:05 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id n8N8uC3Q016494 for ; Wed, 23 Sep 2009 10:56:12 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALp/uUrDbohb/2dsb2JhbADWD4QbBQ Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 23 Sep 2009 10:56:12 +0200 Received: from [192.168.127.128] (host237-32-dynamic.31-79-r.retail.telecomitalia.it [79.31.32.237]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n8N8uAMk082243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Sep 2009 10:56:12 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4AB9E2A6.5000307@erix.it> Date: Wed, 23 Sep 2009 10:56:06 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> In-Reply-To: <4AB9DEE2.6090000@objmedia.demon.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stephen Kellett wrote: > Forth was abandoned because it was too hard to use. I'd correct that to "hard to learn and get used to". Lua has a very smooth access ramp. Forth hasn't. > Why go back there? > I'm sure a die-hard calculator user will be able to tell me :-) I guess I qualify as die-hard RPN user: for a pocket calculator I find it faster to use, more intuitive ;-) and much easier for undo/corrections. I didn't use Forth in practice, but I know people who did with good results. I guess it's just a question of habit, convenience and discipline, as with any language. Enrico From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 06:04:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N942Wo017162; Wed, 23 Sep 2009 06:04:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0B821A6B8; Wed, 23 Sep 2009 06:03:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E5161A682 for ; Wed, 23 Sep 2009 06:03:22 -0300 (BRT) Received: by fxm12 with SMTP id 12so443085fxm.5 for ; Wed, 23 Sep 2009 02:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bAlOT4tH8wwX9nROR8oCE4WczIU/2sOZvW69vkBXlZA=; b=tmukfFQ7mHTmqxKPNCve4ScZhUwV957tpP8CXQIWIJraqKuvXhQoNOxRACeC6SSS9C fAQ4MxBsvOZ596/TWL4M7mHIcEVUIIe2Y7XMFcIF6hT8/TOhbW+SKd7tBEnQ07WXZ07Q H7dw3Xx13B3tcaGUY0msOmEbeLLAbTXqFs01c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GYXhQ+3blZVhtSdOqorqJpdORDV6dNpRhzxSHmj1SeOdpkfJLQ8jrVlgS8YW0oRuBb p0at5yC7la2OVTBLKIRHedLrRAoKS0f+XcPJPZEDUHIrRWK5E6rKJnTh92NgnUOJ1Zu2 CZahcJCaWVTsV3SQgmHrmSKjAaDc82vb4Z44A= MIME-Version: 1.0 Received: by 10.223.14.22 with SMTP id e22mr631767faa.42.1253696608441; Wed, 23 Sep 2009 02:03:28 -0700 (PDT) In-Reply-To: <305164774130183090@unknownmsgid> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <305164774130183090@unknownmsgid> Date: Wed, 23 Sep 2009 10:03:28 +0100 Message-ID: <6a3ae47e0909230203g3ff2c7fcya8777df329e97f8f@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=0015173fe52a00941a04743afd98 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015173fe52a00941a04743afd98 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 23, 2009 at 9:18 AM, John Hind wrote: > Argg! I am not normally a language bigot, but if there is one programming > language that ought to be banned it is Forth. It would certainly be a > disastrously awful teaching language. I had to do a project in this > language > some years ago and I would not be exaggerating when I say it nearly drove > me > to a nervous breakdown! A colleague on the project described Forth as "the > write once, read never language" and certainly it was a major challenge to > understand code you had written a few hours ago let alone what anyone else > had written. Reading Forth code is like trying to translate a book written > in a foreign language armed only with a dictionary itself written in that > language - you look up a word, then you look up a word in the definition, > then a word in that definition, six stack levels down you've completely > lost > track of where you started! > > One thing I agree with on the web site you reference, Forth is certainly a > "unique programming language", but that alone surely makes it a poor choice > for teaching? > > It's certainly a shame that you were exposed to poorly written Forth. As in all languages it is possible to write poorly. Most of the Java I'm exposed to falls into that category, actually. Well written Forth is an exercise in elegance. And I would guess you weren't exposed to any of the ideas set forth in Thinking Forth (just to repeat the reference to an extremely great book: http://thinking-forth.sourceforge.net/ ). Robby --0015173fe52a00941a04743afd98 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Sep 23, 2009 at 9:18 AM, John Hind <= span dir=3D"ltr"><john.hind@zen.c= o.uk> wrote:
Argg! I am not normally a language bigot, but if there is one programming language that ought to be banned it is Forth. It would certainly be a
disastrously awful teaching language. I had to do a project in this languag= e
some years ago and I would not be exaggerating when I say it nearly drove m= e
to a nervous breakdown! A colleague on the project described Forth as "= ;the
write once, read never language" and certainly it was a major challeng= e to
understand code you had written a few hours ago let alone what anyone else<= br> had written. Reading Forth code is like trying to translate a book written<= br> in a foreign language armed only with a dictionary itself written in that language - you look up a word, then you look up a word in the definition, then a word in that definition, six stack levels down you've completely= lost
track of where you started!

One thing I agree with on the web site you reference, Forth is certainly a<= br> "unique programming language", but that alone surely makes it a p= oor choice
for teaching?


It's certainly a sham= e that you were exposed to poorly written Forth. As in all languages it is = possible to write poorly. Most of the Java I'm exposed to falls into th= at category, actually.

Well written Forth is an exercise in elegance. And I would guess you we= ren't exposed to any of the ideas set forth in Thinking Forth (just to = repeat the reference to an extremely great book: http://thinking-forth.sourceforge.net/).

Robby

--0015173fe52a00941a04743afd98-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 06:05:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N95eY4017417; Wed, 23 Sep 2009 06:05:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C48821A6BD; Wed, 23 Sep 2009 06:05:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED8D21A6B9 for ; Wed, 23 Sep 2009 06:05:08 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqNmk-000205-Ms for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 11:05:14 +0200 Received: from p5b2c24ab.dip.t-dialin.net ([91.44.36.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 11:05:14 +0200 Received: from dak by p5b2c24ab.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 11:05:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Wed, 23 Sep 2009 11:04:50 +0200 Organization: Organization?!? Lines: 24 Message-ID: <87ws3qqbf1.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24ab.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:YWtCn1/wgqjunCFgWoIc4ZknbG8= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Enrico Colombini writes: > Stephen Kellett wrote: >> Forth was abandoned because it was too hard to use. > > I'd correct that to "hard to learn and get used to". > Lua has a very smooth access ramp. Forth hasn't. I disagree here. Leo Brodie's "Starting Forth" is one of the best beginner's instructions to programming I know, and Forth's interactivity and straightforward "syntax" make it also easy to get footed. > I didn't use Forth in practice, but I know people who did with good > results. I guess it's just a question of habit, convenience and > discipline, as with any language. Forth is the only language I know that has a smaller memory footprint than handwritten assembly language. That, coupled with its interactivity and its capability to run split-host (compile to target, interpret on host) make it quite a good choice for developing for absolute minimal systems like microcontrollers with on-chip memory. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 06:12:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N9CCZL018068; Wed, 23 Sep 2009 06:12:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F40AC1A6C3; Wed, 23 Sep 2009 06:11:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 398601A683 for ; Wed, 23 Sep 2009 06:11:38 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MqNsz-0000Vg-H7 for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 10:11:41 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id BAF0179957 for ; Wed, 23 Sep 2009 10:11:38 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:36692 with envelope Message-ID: <4AB9F45A.50102@cowlark.com> Date: Wed, 23 Sep 2009 11:11:38 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> In-Reply-To: <4AB9E2A6.5000307@erix.it> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8N9CCZL018068 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Enrico Colombini wrote: [...] > I'd correct that to "hard to learn and get used to". > Lua has a very smooth access ramp. Forth hasn't. Indeed --- a lot of Forth's much vaunted maintainability and readability (yes, really!) is that if you don't have absolute discipline with documentation and design, you end up shooting your own foot off with a nuclear hand grenade. The only programs that ever work are the maintainable and readable ones. That said, it's apparently incredibly effective if you *do* have that degree of discipline. (It's also the only language I know where you can fit an entire development shell, including compiler, in 6kB of machine code.) In addition, it *is* a fantastic teaching language --- not for teaching programming, but for teaching language and compiler design. I'd encourage anyone with an interest in the subject to go and design a Forth threaded interpreter for your favourite architecture. It is a thing of beauty, and utterly unlike any other modern language today. I wasn't kidding when I said that learning Forth taught me how to write C; you will suddenly realise that that everything you've ever learnt is merely one way of doing things, and there are many others, all equally valid... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFKufRaf9E0noFvlzgRAuT4AJ0YmsovVfvl/ucykjqMWyEkGBWRcACdGmSA HUsbF4KFYLhTWFhfN7OGphU= =2TPN -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 06:22:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N9MhkV018996; Wed, 23 Sep 2009 06:22:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65E361866F; Wed, 23 Sep 2009 06:22:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EFA918658 for ; Wed, 23 Sep 2009 06:22:08 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqO3A-0000WF-3o for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 11:22:12 +0200 Received: from p5b2c24ab.dip.t-dialin.net ([91.44.36.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 11:22:12 +0200 Received: from dak by p5b2c24ab.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 11:22:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Wed, 23 Sep 2009 11:21:44 +0200 Organization: Organization?!? Lines: 26 Message-ID: <87skeeqamv.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24ab.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:qifdnexjD7tsXehKjEKc+t7Y2AM= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given writes: > In addition, it *is* a fantastic teaching language --- not for > teaching programming, but for teaching language and compiler > design. I'd encourage anyone with an interest in the subject to go and > design a Forth threaded interpreter for your favourite architecture. For every language, there are "hello, world"-like toy problems which express the gist of a problem and are immediately obvious and understandable. "Programming in Lua" has a lot of those beauties. Forth is unique in that the compiler itself is such a small entity, and quite logical and accessable to a new user. There is no magic which is the realm of wizards for getting something up and working. "I can write and bootstrap and understand my own system starting from paper instructions" is indeed reasonably easy with Forth. I did my implementation on a weekend with a friend, just working from specs without code. And we were still quite more complicated than reference implementations (which I got to see later). -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 06:23:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8N9NLR7019094; Wed, 23 Sep 2009 06:23:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC048186A0; Wed, 23 Sep 2009 06:22:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E7FF18648 for ; Wed, 23 Sep 2009 06:22:46 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id n8N9MrLp040332 for ; Wed, 23 Sep 2009 11:22:53 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJiFuUrDbohc/2dsb2JhbADWA4QbBQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 23 Sep 2009 11:22:53 +0200 Received: from [192.168.127.128] (host237-32-dynamic.31-79-r.retail.telecomitalia.it [79.31.32.237]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id n8N9Mrxj016102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Sep 2009 11:22:53 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4AB9E8E8.9040501@erix.it> Date: Wed, 23 Sep 2009 11:22:48 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> In-Reply-To: <4AB9F45A.50102@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > The only programs that ever work are the maintainable and readable ones. Hmm... if that's so, maybe it should be imposed as standard language. We'd save ourselves and the world a lot of trouble ;-) > you will suddenly realise that that everything you've ever learnt is > merely one way of doing things, and there are many others, all equally > valid... Yes, that experience (whatever the language) is a real eye opener. It is almost impossible to be a language bigot after that. Enrico From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 07:26:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NAQVxr024291; Wed, 23 Sep 2009 07:26:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B29D61A69E; Wed, 23 Sep 2009 07:25:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smarthost02.mail.zen.net.uk (smarthost02.mail.zen.net.uk [212.23.3.141]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90708187E6 for ; Wed, 23 Sep 2009 07:25:49 -0300 (BRT) Received: from [212.23.15.98] (helo=Cruncher) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MqP2p-0000Ld-UU for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 10:25:56 +0000 From: "John Hind" To: "'Lua list'" References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> In-Reply-To: <4AB9F45A.50102@cowlark.com> Subject: RE: Suitability of Lua as a First Programming Language? Date: Wed, 23 Sep 2009 11:24:46 +0100 Message-ID: <003101ca3c38$12e62bf0$38b283d0$@hind@zen.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco8Lfl2qLXMj+CAQoCLP8quSBBTngAB2EKw Content-Language: en-gb X-Originating-Smarthost02-IP: [212.23.15.98] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8NAQVxr024291 I agree that Forth is very efficient and I believe its philosophy has heavily influenced the design of virtual machines and "byte-code" intermediate systems. However the cost of this efficiency is to make the programmer think like a (very simplistic) computer while the purpose of a programming language is surely to produce computer code from an input language suited to human beings? I have done a lot of programming in assembly language particularly for microcontrollers and to be frank, I would choose assembly over Forth any day of the week and assembly has no runtime overhead at all! Hell, I'd even choose writing the machine code directly in hex! I was also very impressed at first by the elegance, efficiency and minimalism of Forth, but quickly fell out of love when I actually had to do something non-trivial with it. I suspect its enthusiasts have never tried to deliver anything requiring more than a page of code or anything requiring long-term maintenance. Lua makes a good teaching language because it uses the same conceptual framework as the vast majority of other "mainstream" languages out there while being minimalist, regular and flexible. Forth is certainly very minimalist, but its very difference makes it a poor choice as a grounding for training working programmers. > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of David Given > Sent: 23 September 2009 11:12 > To: Lua list > Subject: Re: Suitability of Lua as a First Programming Language? > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Enrico Colombini wrote: > [...] > > I'd correct that to "hard to learn and get used to". > > Lua has a very smooth access ramp. Forth hasn't. > > Indeed --- a lot of Forth's much vaunted maintainability and > readability > (yes, really!) is that if you don't have absolute discipline with > documentation and design, you end up shooting your own foot off with a > nuclear hand grenade. The only programs that ever work are the > maintainable and readable ones. > > That said, it's apparently incredibly effective if you *do* have that > degree of discipline. (It's also the only language I know where you can > fit an entire development shell, including compiler, in 6kB of machine > code.) > > In addition, it *is* a fantastic teaching language --- not for teaching > programming, but for teaching language and compiler design. I'd > encourage anyone with an interest in the subject to go and design a > Forth threaded interpreter for your favourite architecture. It is a > thing of beauty, and utterly unlike any other modern language today. I > wasn't kidding when I said that learning Forth taught me how to write > C; > you will suddenly realise that that everything you've ever learnt is > merely one way of doing things, and there are many others, all equally > valid... > > - -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "People who think they know everything really annoy those of us who > │ know we don't." --- Bjarne Stroustrup > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFKufRaf9E0noFvlzgRAuT4AJ0YmsovVfvl/ucykjqMWyEkGBWRcACdGmSA > HUsbF4KFYLhTWFhfN7OGphU= > =2TPN > -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 07:37:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NAbPTh025242; Wed, 23 Sep 2009 07:37:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42B4A1A5D9; Wed, 23 Sep 2009 07:36:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C979D18807 for ; Wed, 23 Sep 2009 07:36:51 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c37so207917anc.26 for ; Wed, 23 Sep 2009 03:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=zml/ucMRTlRhBjF+6XIMUgR9tsDCZ6XysM/LgII3mRE=; b=ds1qTEKmhXLzUbntZXi9VueAKrCSfuqNkI6xc1fN/LpYnFSP8bu2yS8Uh7MppHab0H ePatxjExLOfMwYzsZ/OwePv/QJpnb+BFnzq2zd5hAJrPPTVl79IMFZWlZ1Y2CQnPjd10 5bRNMgqy9mcCaRNXgeZij7UwUSFE/YrM30t44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Xl8zSHMQXRhyVugjtP2Eu7lS9f77EJJdT077XmW2Q4CBqeyiGU/+GxabjOCfoDbfNV XQnfL3UxJZROCR4Mjh+jxKdzynzRxsw41R566Hqbb75IZQWA/FsgpmAXYWLvpCCOpU7e OWAjx9N1CLBAQHutqZ+1dv3dDZGQNspT6cTFY= MIME-Version: 1.0 Received: by 10.100.55.17 with SMTP id d17mr2303406ana.118.1253702219549; Wed, 23 Sep 2009 03:36:59 -0700 (PDT) In-Reply-To: <4AB75742.2060907@cowlark.com> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> Date: Wed, 23 Sep 2009 07:36:59 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001485f4b2ca734d5c04743c4b9c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f4b2ca734d5c04743c4b9c Content-Type: text/plain; charset=ISO-8859-1 I see.. so I can load all scripts at the beginning or at least be sure to load at least one time before calling the function. But I have to be sure that every script has a different function_name, otherwise I would be unable to call it. Is not it? This is not big problem though... --001485f4b2ca734d5c04743c4b9c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I see.. so I can load all scripts at the beginning or at least be sure = to load at least one time before calling the function.

But I have to= be sure that every script has a different function_name, otherwise I would= be unable to call it. Is not it? This is not big problem though...
--001485f4b2ca734d5c04743c4b9c-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 07:54:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NArvCF026902; Wed, 23 Sep 2009 07:53:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 640411A671; Wed, 23 Sep 2009 07:53:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D54D518C57 for ; Wed, 23 Sep 2009 07:53:22 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqPTV-0000X6-GP for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 12:53:29 +0200 Received: from p5b2c24ab.dip.t-dialin.net ([91.44.36.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 12:53:29 +0200 Received: from dak by p5b2c24ab.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 12:53:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Suitability of Lua as a First Programming Language? Date: Wed, 23 Sep 2009 12:53:07 +0200 Organization: Organization?!? Lines: 46 Message-ID: <87fxaeq6ek.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <43235.9301405542$1253701581@news.gmane.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24ab.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:PRkyP8Y14A4cBG2YkpYOlKAtq9M= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "John Hind" writes: > I agree that Forth is very efficient and I believe its philosophy has > heavily influenced the design of virtual machines and "byte-code" > intermediate systems. However the cost of this efficiency is to make > the programmer think like a (very simplistic) computer while the > purpose of a programming language is surely to produce computer code > from an input language suited to human beings? I have done a lot of > programming in assembly language particularly for microcontrollers and > to be frank, I would choose assembly over Forth any day of the week > and assembly has no runtime overhead at all! Under the premise that the capacity of the human mind is unlimited. Which is not realistic with regard to programming. High level languages allow to employ your wits better focused, more strategically. Forth is not much more than glue and boxes for assembly. > I was also very impressed at first by the elegance, efficiency and > minimalism of Forth, but quickly fell out of love when I actually had > to do something non-trivial with it. I suspect its enthusiasts have > never tried to deliver anything requiring more than a page of code or > anything requiring long-term maintenance. Cross-compiled and bootstrapped a complete industrial spring measurement station with logs, printing, menu system, keyboard interface, device controllers. It fit into something like 8kB after throwing out the basic+system interpreter of the Z80 system. > Lua makes a good teaching language because it uses the same conceptual > framework as the vast majority of other "mainstream" languages out > there while being minimalist, regular and flexible. Forth is certainly > very minimalist, but its very difference makes it a poor choice as a > grounding for training working programmers. Forth is the only system where I'd feel comfortable making a student assignment to bootstrap a complete system. Pretty much everything else has components "above student level" or taking longer than a term to come to terms with. In the "that's all one need?" department, it is pretty unique, and that accounts for something. Not necessarily everything, but something that you can get nowhere else is a justification for mindshare. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 07:57:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NAvQfI027245; Wed, 23 Sep 2009 07:57:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F26A51A683; Wed, 23 Sep 2009 07:56:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F8F818807 for ; Wed, 23 Sep 2009 07:56:46 -0300 (BRT) Received: by bwz10 with SMTP id 10so473301bwz.5 for ; Wed, 23 Sep 2009 03:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=VvT85nu1igpR9+aQcMX+dc5TcQJ20b/Fo7mt3Obz+es=; b=DiJim/EX86medrmtiwZH5w3IRZUNmgo5fQv3h1sj2kEPbOmh+b025IEm8a2lYL7+Ld FMfXRareTP+9Mu0AecfOexvqtOSlO/npQJrfevVPgmiAYH+eIVD7KzHcjEnf0SgBOmsr x8PArfh2LASKRTjHbnDhqU48blYHeaHgF4DEg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CH8c6s5FLutJ5qu2VnYEONxcxeicA5Q5k9E1jHOK/DbqV2r1B9OVC6oofA4IngGIj6 ej1/W/Bfku9OFNV5HTAXsNu3Cb0W0rQv3FlrLil+/AqOw+6A0GPT/bY/RjIZGVQBwvbF PKZBAFxM96BOWoc/avWSuJW9sW1xsI+blbFmg= MIME-Version: 1.0 Received: by 10.223.5.77 with SMTP id 13mr662298fau.86.1253703412197; Wed, 23 Sep 2009 03:56:52 -0700 (PDT) In-Reply-To: <-8457921134243631267@unknownmsgid> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <-8457921134243631267@unknownmsgid> Date: Wed, 23 Sep 2009 11:56:52 +0100 Message-ID: <6a3ae47e0909230356i17daa557i932cd301926fd629@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=001517478d8089ab1104743c927b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517478d8089ab1104743c927b Content-Type: text/plain; charset=UTF-8 This is getting very off topic. On Wed, Sep 23, 2009 at 11:24 AM, John Hind wrote: > I was also very impressed at first by the elegance, efficiency and > minimalism of Forth, but quickly fell out of love when I actually had to do > something non-trivial with it. I suspect its enthusiasts have never tried to > deliver anything requiring more than a page of code or anything requiring > long-term maintenance. > But I can't let this stand as it is. Forth is in use at NASA for various space related missions (http://forth.gsfc.nasa.gov/). It is also in use as construction planning SW (http://www.mpeltd.demon.co.uk/forth.htm, half way down the page). And there's an airport baggage handling system written in Forth (it's one that works, and therefore not in the news), but I can't find references online at the moment. None of these will be one-pagers. Forth requires large amounts of discipline and is usually used to essentially build a DSL from the ground up. Alright, back to Lua ... Robby --001517478d8089ab1104743c927b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is getting very off topic.

On Wed, S= ep 23, 2009 at 11:24 AM, John Hind <john.hind@zen.co.uk> wrote:
I was also very impressed at first by the elegance, efficiency and minimali= sm of Forth, but quickly fell out of love when I actually had to do somethi= ng non-trivial with it. I suspect its enthusiasts have never tried to deliv= er anything requiring more than a page of code or anything requiring long-t= erm maintenance.

But I can't let this stand as it is. Forth is in = use at NASA for various space related missions (http://forth.gsfc.nasa.gov/). It is also in use as constru= ction planning SW (http= ://www.mpeltd.demon.co.uk/forth.htm, half way down the page). And there= 's an airport baggage handling system written in Forth (it's one th= at works, and therefore not in the news), but I can't find references o= nline at the moment.

None of these will be one-pagers. Forth requires large amounts of disci= pline and is usually used to essentially build a DSL from the ground up.
Alright, back to Lua ...

Robby

--001517478d8089ab1104743c927b-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:00:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NC0AI0002793; Wed, 23 Sep 2009 09:00:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B9DB19414; Wed, 23 Sep 2009 08:58:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A108F1940C for ; Wed, 23 Sep 2009 08:58:43 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NBwn5W002507 for ; Wed, 23 Sep 2009 08:58:49 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8NBwkw12903; Wed, 23 Sep 2009 08:58:46 -0300 Date: Wed, 23 Sep 2009 08:58:45 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Performance questions Message-ID: <20090923085845.A12895@lua.tecgraf.puc-rio.br> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from zweifel@gmail.com on Wed, Sep 23, 2009 at 07:36:59AM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I see.. so I can load all scripts at the beginning or at least be sure to > load at least one time before calling the function. > > But I have to be sure that every script has a different function_name, > otherwise I would be unable to call it. Is not it? The script itself is an anonymous function. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:04:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NC3txX003334; Wed, 23 Sep 2009 09:03:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EA221940D; Wed, 23 Sep 2009 09:02:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1143A192E2 for ; Wed, 23 Sep 2009 09:02:46 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 29768 invoked from network); 23 Sep 2009 14:02:49 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 23 Sep 2009 14:02:49 +0200 Message-ID: <4ABA0E68.60902@wp.pl> Date: Wed, 23 Sep 2009 14:02:48 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: Separate groups of scripts References: <4AB96EAE.9060700@013net.net> In-Reply-To: <4AB96EAE.9060700@013net.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [8SMU] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman wrote: > There is a Lua program that allows users to add their scripts in such a > way that them will be callable via the program's menu (or via hot keys). > > Every user usually organizes his scripts and modules in a separate > subdirectory (subtree, in fact) of the main Lua program, and adds this > subdirectory in front of package.path. This is not elegant, but > moreover, is not safe, since different users may have identically named > modules. > > I thought of a solution, where the program assigns each user (that is, > each group of scripts) a separate environment and calls those scripts > within that environment. But AFAIK, there is no way to have a > package.path per an environment, there is only one package.path. > > There is one simple solution: the program modifies package.path every > time it is about to run a user script. But though it would work, it > looks inelegant in comparison to imaginary "package.path per environment". > > Are there some other solutions? There are similar problems in unix-based OSes, and are solved by environment variables ($HOME, $PATH, etc). So you can try something like this: /etc/rc.local: LUA_INIT=/etc/luaenv.lua /etc/luaenv.lua: package.path=os.getenv('HOME')..'/lua;'..package.path -- or: -- package.path='/opt/common/lua/'..os.getenv('USER')..';'..package.path and ask every user to put their modules in their home directories, in ~/lua or /opt/common/lua/. Regards, miko From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:07:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NC780u003801; Wed, 23 Sep 2009 09:07:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 036991941D; Wed, 23 Sep 2009 09:06:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0A4C192E2 for ; Wed, 23 Sep 2009 09:06:09 -0300 (BRT) Received: by bwz10 with SMTP id 10so516344bwz.5 for ; Wed, 23 Sep 2009 05:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Wa21r4N7h1VPd51W2HoJj6QrGzlC9VTrQ4I18gC3CkA=; b=jflFgOphH3C4fAasLRLsFU4Ed+ThxvPdr+weyzTbFTzD6GRRiDUhguePf1oAuuctNk 7/vPb8jb/HEvax0Z9sWPEL8wfU30uStqeiW5EMuZrxjc0q9WqadCBd5HCXOfWTZZl5+F 65AqfvushYH5aopT5ulcNspGkHYhWamlqklJc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qcKylqCsPIBcwA59oYPhhe+5Q9T6U8GiIfDhZ8jULyh0UcAOVwOfaOU/GgoCNhvi7b oT02WLp9CJhd8oRL2mKXWew5Olw+JVzd49mBIrT2hxfvsuHhREygOcxRimmaC1biDQrZ 8ll9dhwXIdBJHeMBJfxWeUcdp/KY47AXYz9CE= MIME-Version: 1.0 Received: by 10.204.18.145 with SMTP id w17mr1846253bka.42.1253707569436; Wed, 23 Sep 2009 05:06:09 -0700 (PDT) In-Reply-To: <4ABA0E68.60902@wp.pl> References: <4AB96EAE.9060700@013net.net> <4ABA0E68.60902@wp.pl> Date: Wed, 23 Sep 2009 14:06:09 +0200 Message-ID: <560972290909230506q637534d7t13ea5a98d3439d9d@mail.gmail.com> Subject: Re: Separate groups of scripts From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/23 Michal Kolodziejczyk : > /etc/luaenv.lua: > package.path=os.getenv('HOME')..'/lua;'..package.path Cool solution, but it should be: package.path=os.getenv('HOME')..'/?.lua;'..package.path From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:08:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NC8oXT004022; Wed, 23 Sep 2009 09:08:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A08DB19424; Wed, 23 Sep 2009 09:07:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4EC11941E for ; Wed, 23 Sep 2009 09:07:41 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NC7mi8003910 for ; Wed, 23 Sep 2009 09:07:48 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8NC7lu12938; Wed, 23 Sep 2009 09:07:47 -0300 Date: Wed, 23 Sep 2009 09:07:47 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? Message-ID: <20090923090746.B12895@lua.tecgraf.puc-rio.br> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AB9F45A.50102@cowlark.com>; from dg@cowlark.com on Wed, Sep 23, 2009 at 11:11:38AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'd > encourage anyone with an interest in the subject to go and design a > Forth threaded interpreter for your favourite architecture. It is a > thing of beauty, and utterly unlike any other modern language today. See "Bootstrapping a Forth in 40 Lines of Lua Code" by Eduardo Ochs in Lua Programming Gems. Also here: http://angg.twu.net/miniforth-article.html From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:11:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCBQ77004450; Wed, 23 Sep 2009 09:11:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5343D19429; Wed, 23 Sep 2009 09:10:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp104.rog.mail.re2.yahoo.com (smtp104.rog.mail.re2.yahoo.com [206.190.36.82]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4887D19426 for ; Wed, 23 Sep 2009 09:10:22 -0300 (BRT) Received: (qmail 90485 invoked from network); 23 Sep 2009 12:10:13 -0000 Received: from unknown (HELO ?192.168.1.110?) (spell_gooder_now@173.32.14.83 with plain) by smtp104.rog.mail.re2.yahoo.com with SMTP; 23 Sep 2009 12:10:13 -0000 X-YMail-OSG: gzTz1QQVM1n560DB3cksTB3CVONt2K7nQLggEASJsqJXfkOGkBHY3b9xiCwk8fPATQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4ABA0FF8.80405@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 08:09:28 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Lua for GUI toolkit wrapping? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am just learning Lua. One thing I thought might be a good application of it would be to use it for the GUI code rather then pure C/C++. Lua is fast and light weight and although it can be used for general uses it's my understanding that it is at it's heart an extension language and as so, a wrapper language? Having said this, toolkit support does not look so good. GTK has one hard working developer, QT is not so great. There is some TK support but do people write medium to large applications in TK? WxLua is not bad. Is Lua not much more expressive and pleasant to work with then C/C++ ? wouldn't replacing all that C code for the GUI be a good thing? Wouldn't using a fast scripting language make it easier to edit later? Is there a reason the Toolkit support is not a little better? Is this not an ideal use of Lua? Thanks in advance-Patrick From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:15:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCF2ev005059; Wed, 23 Sep 2009 09:15:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 688F11942E; Wed, 23 Sep 2009 09:14:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83E8D19426 for ; Wed, 23 Sep 2009 09:14:03 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0194.bmts.com [209.240.125.194]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n8NCDrvP004132 for ; Wed, 23 Sep 2009 08:14:04 -0400 Message-ID: <4ABA1101.7050806@hempeldesigngroup.com> Date: Wed, 23 Sep 2009 08:13:53 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> In-Reply-To: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > Interactivity is a big, big plus, because it allows for an almost > conversational mode of language learning. Whether all people learn > PLs better in conversational mode I don't know, but it certainly works > for a lot of people. I'm sure some of you may remember reading "Starting FORTH" by Leo Brodie. It's a classic example of learnnig to program using a conversational style text... Whenever I demonstrate programming the LEGO MINDSTORMS NXT (sorry, the capitalization is mandatory) using pbLua running on the NXT, people are amazed at how interactive and iterative the process is. Try this, see what happens, add that, change a setting. They ask about the IDE, and where is the compiler. The fact that my typical development environment is an editor and a terminal emulator is baffling to them. So yes, Lua is a great first language. The problem is the incredible inertia involved in getting it into a high school or university curriculum. I've got a lot of interest in pbLua from engineering schools that use the LEGO MINDSTORMS in first year classes, but they almost all use Robot-C because the course description says it's an introductory programming course that uses C with robotics.... Ralph From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:22:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCME4p006039; Wed, 23 Sep 2009 09:22:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1E5919427; Wed, 23 Sep 2009 09:20:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E246A193FB for ; Wed, 23 Sep 2009 09:20:50 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0194.bmts.com [209.240.125.194]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n8NCKpMg014279 for ; Wed, 23 Sep 2009 08:20:51 -0400 Message-ID: <4ABA12A2.5060202@hempeldesigngroup.com> Date: Wed, 23 Sep 2009 08:20:50 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> In-Reply-To: <4AB9F45A.50102@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > In addition, it *is* a fantastic teaching language --- not for teaching > programming, but for teaching language and compiler design. I'd > encourage anyone with an interest in the subject to go and design a > Forth threaded interpreter for your favourite architecture. It is a > thing of beauty, and utterly unlike any other modern language today. I > wasn't kidding when I said that learning Forth taught me how to write C; > you will suddenly realise that that everything you've ever learnt is > merely one way of doing things, and there are many others, all equally > valid... Obviously, I had not read this Forth tangent before my other response :-) The thing that broguth me to Lua was looking for a small interpreted language that could fit into 256K of FLASH, run in 64K of RAM, and was not FORTH ;-) I wrote pbForth for the old LEGO MINDSTORMS RCX - it was about 12K and included an included an inline H8/300 assembler! The lowest level words were all written in assembler, and the higher level stuff was done with a Tcl based macro language. I'd use ua for that today, of course. Ralph From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:38:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCc3jQ008985; Wed, 23 Sep 2009 09:38:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03B8919414; Wed, 23 Sep 2009 09:37:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B9DA192EE for ; Wed, 23 Sep 2009 09:37:25 -0300 (BRT) Received: by bwz10 with SMTP id 10so537857bwz.5 for ; Wed, 23 Sep 2009 05:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=AyemIQgQj5nNb9Rn6tY9Wecc5nGzHuNwbKO4gO1x1qk=; b=DC6iVUW0NtBIgI8h7aNIZRFcAhp6G/ihGIlQuaBsTDQjsSHmUp3EAceExUM1Z4gOXx Ca8LW8J9ZXByc0aZdfe9Af5M54TLMxRQ3TcAS5pHIUYUwWTSWyoG1C22gUbRth9SfjyO XUVtX5C7WY35uks3wUjkrItd2hqojstalB9fc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Koepl5+tEaPQdoPsdi+eIgtT7dO+6QjEcPVoTepymxH3aepzvz66WYB4j66L4LKd+/ eMU9n4SRAaSPVURn3Ti9cblY4dIvS/1AIeKQUxQjCmgTt5VmemwTZcCVTbyYCWKCGyqS ld37zhWNVEj8Os6Biyzyqd1DbfXP+9+3pgYGs= MIME-Version: 1.0 Received: by 10.204.15.22 with SMTP id i22mr1924727bka.13.1253709450647; Wed, 23 Sep 2009 05:37:30 -0700 (PDT) In-Reply-To: <20090923090746.B12895@lua.tecgraf.puc-rio.br> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <20090923090746.B12895@lua.tecgraf.puc-rio.br> Date: Wed, 23 Sep 2009 14:37:30 +0200 Message-ID: <560972290909230537v7413b1cfm3d114d8f1c8282d2@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8NCc3jQ008985 On Wed, Sep 23, 2009 at 2:07 PM, Luiz Henrique de Figueiredo wrote: > See "Bootstrapping a Forth in 40 Lines of Lua Code" by Eduardo Ochs > in Lua Programming Gems. Also here: >        http://angg.twu.net/miniforth-article.html Very clever! But (to bring us slowly back to Lua) creating an application in Lua also involves bootstrapping. Tables feel a little low level, admire Python lists, write a module, and Lua has slicing and list concatenation. Until you are writing code which fits the problem domain better - classic embedded DSL strategy. Obviously, Python takes you initially further along that path, but relative to the task of doing a big program, it's not much more work (and easily reuseable). On the subject of embedded DSLs, Ruby makes a virtue of allowing you to invent new syntax. But we have enough syntax already ;) From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:42:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCgAQ7010146; Wed, 23 Sep 2009 09:42:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA681A583; Wed, 23 Sep 2009 09:41:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1515C1940D for ; Wed, 23 Sep 2009 09:41:33 -0300 (BRT) Received: by bwz10 with SMTP id 10so540930bwz.5 for ; Wed, 23 Sep 2009 05:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=iir+tLIPyx5Be7HNJSMelYeb6myABqeFCIchpiiwSwc=; b=YZX2R45W78QHwFJYed8Y+QrCNah0gii7+tmkJw6Pe9UdsU8xVUlQXOC/fKWX2/QUgu OHmm4DUf11Djem4WC741OQi1eke0k++QHfTKAEvXlZb7Rz9tgt2qNdRlQckoQ7P+Ph6z irrCIVrH71llMugwhPIc2rZZb+yeQaw/1b79U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JsVWgkAB6KeFrvRTY3wUr5vVUY8+nVBz+5xAuc6vPQsj7/WeKPj9upFeT/TQNhsTNr DZWxFySjz4iYtJlERZJ7NG7FelWtR3p7IoIIOGDopr4nH1/8yA2xgduljFQo4axzAqjE qrxIV986ufUt3vSKhrvkgIReSWyt4YFNRuqYQ= MIME-Version: 1.0 Received: by 10.204.151.208 with SMTP id d16mr1871889bkw.115.1253709699926; Wed, 23 Sep 2009 05:41:39 -0700 (PDT) In-Reply-To: <4ABA1101.7050806@hempeldesigngroup.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <4ABA1101.7050806@hempeldesigngroup.com> Date: Wed, 23 Sep 2009 14:41:39 +0200 Message-ID: <560972290909230541s27dcb884t3963d64ec0dfedc6@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 2:13 PM, Ralph Hempel wrote: > They ask about the IDE, and where is the compiler. The fact that > my typical development environment is an editor and a terminal > emulator is baffling to them. The 'conversational' style is foreign to the IDE generation, which is a pity. Issuing commands and getting gratifying responses is the essence of the imperative style. > The problem is the incredible inertia involved in getting it into > a high school or university curriculum. I've got a lot of interest > in pbLua from engineering schools that use the LEGO MINDSTORMS > in first year classes, but they almost all use Robot-C because > the course description says it's an introductory programming > course that uses C with robotics.... Yes, they would have to sneak it in, maybe as an API training wheel. People are too quick to tick off the buzzwords. Of course, you could always try interactive C/C++ ;) I tried that, wrote a book about it, and realized that most people did not see the point. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:42:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCgfCm010248; Wed, 23 Sep 2009 09:42:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE3941941E; Wed, 23 Sep 2009 09:42:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 150E61940D for ; Wed, 23 Sep 2009 09:42:06 -0300 (BRT) Received: by vws32 with SMTP id 32so483434vws.11 for ; Wed, 23 Sep 2009 05:42:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.108.163 with SMTP id f35mr3429903vcp.86.1253709734143; Wed, 23 Sep 2009 05:42:14 -0700 (PDT) In-Reply-To: References: <20090922202314.GB14358@inf.puc-rio.br> From: Greg Falcon Date: Wed, 23 Sep 2009 08:41:54 -0400 Message-ID: <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> Subject: Re: length operator # for tables with metatables To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8NCgfCm010248 On Tue, Sep 22, 2009 at 5:53 PM, Leo Razoumov wrote: > The real problem is that in a common idiom "t[#t+1]=v"  t[i] obeys > meta-method resolution while #t ignores metatable altogether. But it's been mentioned on this thread already that in 5.2, #t will respect a __len metamethod. So what you are calling "the real problem" has already been addressed. Greg F From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:55:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCthJJ013044; Wed, 23 Sep 2009 09:55:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 869FC1939D; Wed, 23 Sep 2009 09:55:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 627EF19398 for ; Wed, 23 Sep 2009 09:55:08 -0300 (BRT) Received: from [89.139.8.58] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQF00KJWD82JD00@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 15:55:14 +0300 (IDT) Date: Wed, 23 Sep 2009 15:55:17 +0300 From: Shmuel Zeigerman Subject: Re: Separate groups of scripts In-reply-to: <4ABA0E68.60902@wp.pl> To: Lua list Message-id: <4ABA1AB5.10408@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-2; format=flowed Content-transfer-encoding: 7BIT References: <4AB96EAE.9060700@013net.net> <4ABA0E68.60902@wp.pl> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Michal Kolodziejczyk wrote: > There are similar problems in unix-based OSes, and are solved by > environment variables ($HOME, $PATH, etc). > > So you can try something like this: > > /etc/rc.local: > LUA_INIT=/etc/luaenv.lua > > /etc/luaenv.lua: > package.path=os.getenv('HOME')..'/lua;'..package.path > -- or: > -- package.path='/opt/common/lua/'..os.getenv('USER')..';'..package.path > > and ask every user to put their modules in their home directories, in > ~/lua or /opt/common/lua/. There seems to be misunderstanding (probably because I was using the word 'user' in a confusing way). What happens in fact is: -- assuming the program directory is somepath/plugin -- programmer John adds a bunch of his scripts and modules, that must be installed in a subtree somepath/plugin/John. His initialization script adds somepath/plugin/John/?.lua in front of package.path, and adds a bunch of menu items to the main program's menu. -- programmer Ann adds a bunch of her scripts and modules, that must be installed in a subtree somepath/plugin/Ann. Her initialization script adds somepath/plugin/Ann/?.lua in front of (already modified) package.path, and adds another bunch of menu items to the main program's menu. -- there can be quite a few "programmers" -- user Jim installs: the main program + John's scripts + Ann's scripts -- user Jim can at any moment invoke *any* script, via the program menu or a hot key -- in the invoked script, require 'somelib' could access a wrong module, if both John and Ann happened to have a module named 'somelib'. Hopefully, it is more clear now. Sorry for verbosity. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 09:57:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NCvW6P013488; Wed, 23 Sep 2009 09:57:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CE9D19359; Wed, 23 Sep 2009 09:57:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BCD21A5DE for ; Wed, 23 Sep 2009 09:56:45 -0300 (BRT) Received: by yxe37 with SMTP id 37so612042yxe.33 for ; Wed, 23 Sep 2009 05:56:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.81.20 with SMTP id e20mr4222613ybb.132.1253710611398; Wed, 23 Sep 2009 05:56:51 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Date: Wed, 23 Sep 2009 07:56:51 -0500 Message-ID: <75cc17ac0909230556i1ee9525eq26cbf471a57fbaac@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=000e0cd4b0cea4bebc04743e3fa2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd4b0cea4bebc04743e3fa2 Content-Type: text/plain; charset=UTF-8 On Tue, Sep 22, 2009 at 11:29 AM, Eduardo Ochs wrote: > > (*) Well, there are the standard answers for those questions, that we > all know... "everything is an object! A car is an object! A pizza is > an object! A window is an object! And every object has a class, and a > class is also an object"... I am still trying to understand why some > people seem to feel perfectly at ease with these kinds of ideas, while > I don't... Links? > Everything is not an object<%20http://www.j-paine.org/objects/objects/objects.html>. Old but good. --000e0cd4b0cea4bebc04743e3fa2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Sep 22, 2009 at 11:29 AM, Eduardo Oc= hs <eduardooc= hs@gmail.com> wrote:

(*) Well, there are the standard answers for those questions, that we
all know... "everything is an object! A car is an object! A pizza is an object! A window is an object! And every object has a class, and a
class is also an object"... I am still trying to understand why some people seem to feel perfectly at ease with these kinds of ideas, while
I don't... Links?
=C2=A0
Everything is not an o= bject.=C2=A0 Old but good.
--000e0cd4b0cea4bebc04743e3fa2-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:11:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDB1oS016659; Wed, 23 Sep 2009 10:11:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FC521939F; Wed, 23 Sep 2009 10:09:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E58D192EE for ; Wed, 23 Sep 2009 10:09:41 -0300 (BRT) Received: by pzk38 with SMTP id 38so612789pzk.11 for ; Wed, 23 Sep 2009 06:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5TxW/IC5lPzn/I4/d+9SXySVv1TcmTYD+ypIbhOJcng=; b=DgeYuOUBki9aWA9ZIqdpBMYlQ13Dmd16szOVH+L8wJhgB4OEMkntg/7Z+gb0BK9o8D DyrxNzxmleAaRfrydrGJ8xkgL9o+bhxuLNHCHt/NGfZxZLgtsxjZXQ/TeMW9P4XTAVej BoKLlcoYkQ4SQ7fgTUKhRC9EbC1HGUo94QVPc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ISJ7TY/aUw4Ytu4fJ/9EKTDdV8bjJbP8o13BHOubiagrKBSQq1BD7aWM17pf6AOESr +GNpAx/oysafn/CY1M8xlX/gzM86j1hYMzx9L8o+nLQx9Xfa7olLBFCwn1eiosdShtm5 IpyQ9myx2uYUKtHXbCgts8FPdK2j2/+iteizc= MIME-Version: 1.0 Received: by 10.142.5.27 with SMTP id 27mr162964wfe.59.1253711386834; Wed, 23 Sep 2009 06:09:46 -0700 (PDT) In-Reply-To: <4ABA0FF8.80405@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 10:09:46 -0300 Message-ID: Subject: Re: Lua for GUI toolkit wrapping? From: Lucas Hermann Negri To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Actually there's a lot of bindings to GUI libraries. There are lgob.gtk, lua-gtk, wxLua, IUP, luaqt, among others, and I think that they are pretty good. What problems have you experienced? On Wed, Sep 23, 2009 at 9:09 AM, Patrick wrote: > I am just learning Lua. > > One thing I thought might be a good application of it would be to use it > for the GUI code rather then pure C/C++. Lua is fast and light weight > and although it can be used for general uses it's my understanding that > it is at it's heart an extension language and as so, a wrapper language? > > Having said this, toolkit support does not look so good. GTK has one > hard working developer, QT is not so great. There is some TK support but > do people write medium to large applications in TK? WxLua is not bad. > > Is Lua not much more expressive and pleasant to work with then C/C++ ? > wouldn't replacing all that C code for the GUI be a good thing? Wouldn't > using a fast scripting language make it easier to edit later? Is there a > reason the Toolkit support is not a little better? Is this not an ideal > use of Lua? > > Thanks in advance-Patrick > > > -- http://oproj.tuxfamily.org From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:12:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDCBR4017014; Wed, 23 Sep 2009 10:12:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63AA71A583; Wed, 23 Sep 2009 10:10:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E2F9193A3 for ; Wed, 23 Sep 2009 10:09:55 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c37so240442anc.26 for ; Wed, 23 Sep 2009 06:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pL0tZ98IIcOnWuZKOTQDgTmfpH1m87hETHL+YtD6fsw=; b=VWOk05L+0BJjhv25a8UukdfVzth1YsvK+DTFfhIwTr2Yyeq0dZevNVyKmaDwWQfAnn pw5mXdm6WAPfB9oJ7OeSgwt33NiSwRkSxBmjBrRyYKSt3BdpcU3YDLOWawbawkkERQky RsiSt3I3FxY9JyjSlNPIvXX/9cQkxJxw8ce1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z13pl29UzXpKsQ6DX1x5nQPcaM+zjMQ0UJW34vuOY7XLQ93iH529D06lwG99px700y qK0Qkvywou234xiKEQyGiExH/kcs2DbNVpqNATl7ShMQDDIln9bCW/kOvD3xlTN3mtCd CosPPVn5wSk2mJKZffK4hMZkIuwgGaSi+4Psc= MIME-Version: 1.0 Received: by 10.100.27.12 with SMTP id a12mr2519150ana.110.1253711402307; Wed, 23 Sep 2009 06:10:02 -0700 (PDT) In-Reply-To: <20090923085845.A12895@lua.tecgraf.puc-rio.br> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> Date: Wed, 23 Sep 2009 10:10:02 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001485f80d6ac9108e04743e6ec5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f80d6ac9108e04743e6ec5 Content-Type: text/plain; charset=ISO-8859-1 do you mean I can load a script called "melee.lua" and then call lua_getglobal(L, "melee.lua"); lua_pcall(L, ...); is that it? 2009/9/23 Luiz Henrique de Figueiredo > > I see.. so I can load all scripts at the beginning or at least be sure to > > load at least one time before calling the function. > > > > But I have to be sure that every script has a different function_name, > > otherwise I would be unable to call it. Is not it? > > The script itself is an anonymous function. > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001485f80d6ac9108e04743e6ec5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable do you mean I can load a script called "melee.lua" and then call<= br>
lua_getglobal(L, "melee.lua");
lua_pcall(L, ...);

is that it?


2009/9/23 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
> I see.. so I can load all scripts at the beginning o= r at least be sure to
> load at least one time before calling the function.
>
> But I have to be sure that every script has a different function_name,=
> otherwise I would be unable to call it. Is not it?

The script itself is an anonymous function.



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001485f80d6ac9108e04743e6ec5-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:13:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDDjZH017365; Wed, 23 Sep 2009 10:13:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE5A3193B2; Wed, 23 Sep 2009 10:12:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4375193A8 for ; Wed, 23 Sep 2009 10:12:28 -0300 (BRT) Received: by ywh4 with SMTP id 4so790601ywh.33 for ; Wed, 23 Sep 2009 06:12:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.169.6 with SMTP id r6mr4240002ybe.95.1253711553449; Wed, 23 Sep 2009 06:12:33 -0700 (PDT) In-Reply-To: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> Date: Wed, 23 Sep 2009 08:12:33 -0500 Message-ID: <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=000e0cd56518cb500004743e7747 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd56518cb500004743e7747 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 23, 2009 at 2:12 AM, steve donovan wrote: > On Tue, Sep 22, 2009 at 8:43 PM, Florian Weimer wrote: > > I think the main criterion is availability of introductory texts. > > Interactivity is a big, big plus, because it allows for an almost > conversational mode of language learning. Whether all people learn > PLs better in conversational mode I don't know, but it certainly works > for a lot of people. > > Scheme remains without peer for learning programming. Not only is SICP freely available online (you can skip the math stuff and still learn an enormous amount about programming), but there are a variety of fancy interactive GUI whizbang environments, PLT scheme in particular. My recommended learning path: first learn Scheme - computation as lambda calculus, ignore the machine then Assembler - register-based Turing model of computation - learn the machine then C - abstract a little bit from the machine then Lua - Scheme-like, but supporting easy integration with the machine view via C then (maybe) Forth/Postscript - combinator model of computation After that everything is easy. ;) --000e0cd56518cb500004743e7747 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Sep 23, 2009 at 2:12 AM, steve donov= an <steve= .j.donovan@gmail.com> wrote:
On Tue, Sep 22, 2009 at 8:43 PM, Florian Weimer <fw@deneb.enyo.de> wrote:
> I think the main criterion is availability of introductory texts.

Interactivity is a big, big plus, because it allows for an almost
conversational mode of language learning. =C2=A0Whether all people learn PLs better in conversational mode I don't know, but it certainly works<= br> for a lot of people.

Scheme remains without peer for learning programming.=C2= =A0 Not only is SICP freely available online (you can skip the math stuff a= nd still learn an enormous amount about programming), but there are a varie= ty of fancy interactive GUI whizbang environments, PLT scheme in particular= .=C2=A0 My recommended learning path:

=C2=A0 first learn Scheme - computation as lambda calculus, ignore the = machine
=C2=A0 then Assembler - register-based Turing model of computati= on - learn the machine
=C2=A0 then C - abstract a little bit from the ma= chine
=C2=A0 then Lua - Scheme-like, but supporting easy integration wit= h the machine view via C
=C2=A0 then (maybe) Forth/Postscript - combinator model of computation
<= br>After that everything is easy.

;)


--000e0cd56518cb500004743e7747-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:16:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDGcZG018066; Wed, 23 Sep 2009 10:16:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4A99193BC; Wed, 23 Sep 2009 10:15:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80AE9193B7 for ; Wed, 23 Sep 2009 10:15:19 -0300 (BRT) Received: by fxm12 with SMTP id 12so631347fxm.5 for ; Wed, 23 Sep 2009 06:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Ncd3C4KTxmBWa8foGUI4y/N1YO7MPsOPYbeh5lnueA4=; b=yG5BiglmYlVam8Vd+NtLS46gu7lIupGL+pKV0TcbkjmEAXhbyPic/UMrGLVZuzscGr Ph7SvGyZBKU4vRq2DjuPHcTiFbddFgvjo7aCF3FN/fo+krNP86C/1TMcGjsWsDNK3Hel Hjsp4bmfQE0MaZ5EnnMrcJC8r+VbKpM5V9E0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kakNjrozrLZMl+nbl3y6SNLAGar6aM/pEOPKQwtw+HQlcsnh/waQ+9LMyGjg13A7OJ t2s5Q2tY/FdcS61hzGHLmFQrTelgXg8J1pZItUE6HSSz/Fk8+9sL50VYA2lsN0i7dlGw 3XO4LawZe3WKPztET96YD3MFpS7IJ4K47QsBk= MIME-Version: 1.0 Received: by 10.204.19.142 with SMTP id a14mr1933040bkb.1.1253711724946; Wed, 23 Sep 2009 06:15:24 -0700 (PDT) In-Reply-To: <4ABA0FF8.80405@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 15:15:24 +0200 Message-ID: <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> Subject: Re: Lua for GUI toolkit wrapping? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 2:09 PM, Patrick wrote: > Having said this, toolkit support does not look so good. GTK has one > hard working developer, QT is not so great. There is some TK support but > do people write medium to large applications in TK? Used to be very popular, showing its age now. (tkinter was always the default option for Python and it was pleasant to work with, just didn't look so polished - which is fine by me) > WxLua is not bad. And, in a Windows world (I don't know about their Mono support) LuaInterface wraps .NET nicely. I'm writing such an app at the moment, and callbacks are such a pleasure: ps.MouseMove:Add(function(sender,e) local coord = get_coordinate(ps,Point(e.X,e.Y)) coordPanel.Text = ('(%5.1f,%5.1f)'):format(coord.X,coord.Y) end) (One can also do Swing apps with LuaJava) > Is Lua not much more expressive and pleasant to work with then C/C++ ? > wouldn't replacing all that C code for the GUI be a good thing? There is a sense in which C/C++ is premature optimization for many tasks, including user interface code. But I try to leave working applications alone ;) > using a fast scripting language make it easier to edit later? Is there a > reason the Toolkit support is not a little better? OK, the problem can be if you have something larger than a few hundred lines. Then you have to be more disciplined with Lua. You do not have the excellent tool support combination that (say) Java + Eclipse provides. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:19:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDJMrR018591; Wed, 23 Sep 2009 10:19:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0F551A5E7; Wed, 23 Sep 2009 10:18:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D76CB193BF for ; Wed, 23 Sep 2009 10:18:36 -0300 (BRT) Received: by fxm12 with SMTP id 12so634559fxm.5 for ; Wed, 23 Sep 2009 06:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4rZnTA7coniLqBJ2pO2McPJy+1B/Ve+RZG/nEuCmVpg=; b=xk+ep7KxMeiPeKP64wcHBy1p4PUrxGoYT8/X2dMD21hVfYo5s+0cJ8rPGt2wtMVW9I opFveE840XTbVIeR2bjHu6dH++T+gIZLlEpcYf9CH9IyU5syg4MlqmzauJw6PyrfuEoV /YWYa1IzKcnX3jMVaIiWWLsv+gpMLMed1v79M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GGCNRPYLI/wOF95GFaoEam/XnIuxwlnba9/BfAbmqkxOTZ3d+JShuiUV7gmiAhOPni OvP9uHAqP6xYs1a0tysseJ0NgSg1bNKkJ+fnzNZyZK/MHfWcJFZZPHlRPbwTk6CCQEvo FlLHuojKM1aS2OQxyvRDS2ZhUqoQ6QDHuSNFM= MIME-Version: 1.0 Received: by 10.204.157.21 with SMTP id z21mr1912838bkw.160.1253711923902; Wed, 23 Sep 2009 06:18:43 -0700 (PDT) In-Reply-To: <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> Date: Wed, 23 Sep 2009 15:18:43 +0200 Message-ID: <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 3:12 PM, Gregg Reynolds wrote: > Scheme remains without peer for learning programming. This is a common notion. What can Scheme do that cannot be expressed in Lua? (Note, this is an actual question) (Speaking as someone who neglected his girlfriend at college because he discovered a LISP interpreter on the mainframe) From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:22:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDM4Pk019097; Wed, 23 Sep 2009 10:22:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 277CE1A67C; Wed, 23 Sep 2009 10:21:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24903193BF for ; Wed, 23 Sep 2009 10:21:26 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDLXoY019029 for ; Wed, 23 Sep 2009 10:21:33 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8NDLW813395; Wed, 23 Sep 2009 10:21:32 -0300 Date: Wed, 23 Sep 2009 10:21:32 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Performance questions Message-ID: <20090923102132.A13392@lua.tecgraf.puc-rio.br> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from zweifel@gmail.com on Wed, Sep 23, 2009 at 10:10:02AM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > do you mean I can load a script called "melee.lua" and then call > > lua_getglobal(L, "melee.lua"); > lua_pcall(L, ...); luaL_loadfile(L, "melee.lua"); lua_pcall(L, ...); From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:24:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDOSoj019619; Wed, 23 Sep 2009 10:24:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1E261A68D; Wed, 23 Sep 2009 10:23:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16C3718A61 for ; Wed, 23 Sep 2009 10:23:53 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 18524 invoked from network); 23 Sep 2009 15:23:58 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 23 Sep 2009 15:23:58 +0200 Message-ID: <4ABA216E.3070009@wp.pl> Date: Wed, 23 Sep 2009 15:23:58 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: Separate groups of scripts References: <4AB96EAE.9060700@013net.net> <4ABA0E68.60902@wp.pl> <4ABA1AB5.10408@013net.net> In-Reply-To: <4ABA1AB5.10408@013net.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [AeN0] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman wrote: > Michal Kolodziejczyk wrote: >> /etc/luaenv.lua: >> package.path=os.getenv('HOME')..'/lua;'..package.path Steve: thanks for the correction! (it should be "?.lua") > There seems to be misunderstanding (probably because I was using the > word 'user' in a confusing way). What happens in fact is: So you should use word "subdirectory" or "module author" I think. [...] > -- there can be quite a few "programmers" > > -- user Jim installs: the main program + John's scripts + Ann's scripts > > -- user Jim can at any moment invoke *any* script, via the program menu > or a hot key So don't bother with package.path (don't allow users change that!), use full module names: module1=require "plugin.Ann.module1" module2=require "plugin.John.module2" > -- in the invoked script, require 'somelib' could access a wrong module, > if both John and Ann happened to have a module named 'somelib'. This is another problem, solved in Java by using full module names beginning with reversed domain name of the module author, so: org.lua.module1, com.john.module2 etc. Regards, miko From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:27:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDR29Y020084; Wed, 23 Sep 2009 10:27:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DC451A691; Wed, 23 Sep 2009 10:26:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1E7A1880A for ; Wed, 23 Sep 2009 10:26:24 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDQVFi019982 for ; Wed, 23 Sep 2009 10:26:31 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8NDQVr13415; Wed, 23 Sep 2009 10:26:31 -0300 Date: Wed, 23 Sep 2009 10:26:30 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua Performance questions Message-ID: <20090923102630.A13399@lua.tecgraf.puc-rio.br> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> <20090923102132.A13392@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20090923102132.A13392@lua.tecgraf.puc-rio.br>; from lhf@tecgraf.puc-rio.br on Wed, Sep 23, 2009 at 10:21:32AM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > do you mean I can load a script called "melee.lua" and then call > > > > lua_getglobal(L, "melee.lua"); > > lua_pcall(L, ...); > > luaL_loadfile(L, "melee.lua"); > lua_pcall(L, ...); And you can also do this to cache: luaL_loadfile(L, "melee.lua"); lua_pushvalue(L,-1); lua_setglobal(L, "melee.lua"); then later lua_getglobal(L, "melee.lua"); lua_pcall(L, ...); These can be combined into: int run_script(const char* name) { int rc; lua_getglobal(L,name); if (lua_isnil(L,-1)) { rc=luaL_loadfile(L,name); if (rc!=0) return rc; lua_pushvalue(L,-1); lua_setglobal(L,name); } rc=lua_pcall(L,...); return rc; } From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:31:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDV0Hj020920; Wed, 23 Sep 2009 10:31:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 946791A69E; Wed, 23 Sep 2009 10:30:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 128821A662 for ; Wed, 23 Sep 2009 10:30:04 -0300 (BRT) Received: by ewy26 with SMTP id 26so684571ewy.5 for ; Wed, 23 Sep 2009 06:30:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.9 with SMTP id b9mr506235wef.61.1253712606257; Wed, 23 Sep 2009 06:30:06 -0700 (PDT) In-Reply-To: References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> Date: Wed, 23 Sep 2009 14:30:06 +0100 X-Google-Sender-Auth: 136613526a07736d Message-ID: Subject: Re: Lua Performance questions From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 2:10 PM, zweifel wrote: > do you mean I can load a script called "melee.lua" and then call > > lua_getglobal(L, "melee.lua"); > lua_pcall(L, ...); > > is that it? no. luaL_loadbuffer takes a string of source code, and produces a function on the stack as a result. This function has no name, it exists only as an index on the stack. If you want to give it a name, then you can call lua_setglobal to assign to a Lua global, or luaL_ref to give a C++ int name, or do anything else that you can do with a stack index. The other lua[L]_load* functions operate similarly. The important point to understand is that the load functions all produce a function as output. For example, if you luaL_loadstring the following snippit: --- print("Hello World") print("From Lua") --- The result is that a function similar to the following is placed on the Lua stack: --- function(...) print("Hello World") print("From Lua") end --- To execute the file multiple times, you call the resulting function multiple times. To do so easily, it is advisable to give the resulting function some kind of name so that you can remove it from the stack and retrieve it again later. As previously mentioned, lua_setglobal is one method of giving it a name, though if you're using C/C++, then using luaL_ref might be easier, as then you have an int value which you can use to retrieve the function. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:31:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDVbNU021142; Wed, 23 Sep 2009 10:31:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B47D1A6AF; Wed, 23 Sep 2009 10:30:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D9D61A69F for ; Wed, 23 Sep 2009 10:30:44 -0300 (BRT) Received: from papaya.tek (dslb-088-075-215-206.pools.arcor-ip.net [88.75.215.206]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id 08ED7500B6 for ; Wed, 23 Sep 2009 15:30:50 +0200 (CEST) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id 7BACCEE43A for ; Wed, 23 Sep 2009 15:30:48 +0200 (CEST) Date: Wed, 23 Sep 2009 15:30:47 +0200 From: "Timm S. Mueller" To: Lua list Subject: Re: Lua for GUI toolkit wrapping? Message-Id: <20090923153047.b7fe8799.tmueller@schulze-mueller.de> In-Reply-To: <4ABA0FF8.80405@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 23 Sep 2009 08:09:28 -0400 Patrick wrote: > Is Lua not much more expressive and pleasant to work with then C/C++ ? > wouldn't replacing all that C code for the GUI be a good thing? Wouldn't > using a fast scripting language make it easier to edit later? Is there a > reason the Toolkit support is not a little better? Is this not an ideal > use of Lua? this seems to contradict the subject of your post, but these were exactly my thoughts when I started tekUI, a GUI toolkit almost entirely written in Lua itself [1]. I believe that, in the long run, large and arcane GUI libraries written in compiled languages will be gradually replaced by small, flexible and transparent frameworks, which reside only on a miniscule native code footprint and adhere to similar design principles as Lua. And Lua is not just a language, its virtual machine is a small common denominator that can be agreed on in a wide range of environments. The amount of work is considerable, but we hope to come out with a beta version this year. We are currently in the process of refactoring large and complicated classes like the text input widget, including multiline and text editor support. Next will be improved listviews with adjustable column widths. Graphics support is also lacking. These and other major gaps need to be filled before we can recommend it to everyone. Any help would be appreciated. Most useful would it be if some individuals accounted for the development or quality assurance of some complex widgets. But then again, the programming interfaces are not fully stable, and this would be a rollercoaster ride for yet some time to come. - Timm [1] http://tekui.teklib.org/ -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:33:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDXiHx022153; Wed, 23 Sep 2009 10:33:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A4131936C; Wed, 23 Sep 2009 10:33:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-5.csi.cam.ac.uk (ppsw-5.csi.cam.ac.uk [131.111.8.135]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 684ED18A61 for ; Wed, 23 Sep 2009 10:33:09 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:42469) by ppsw-5.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.155]:25) with esmtpa (EXTERNAL:fanf2) id 1MqRy8-0001N3-GO (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Wed, 23 Sep 2009 14:33:16 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MqRy8-0002JM-2J (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Wed, 23 Sep 2009 14:33:16 +0100 Date: Wed, 23 Sep 2009 14:33:16 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) In-Reply-To: <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> Message-ID: References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 23 Sep 2009, steve donovan wrote: > > This is a common notion. What can Scheme do that cannot be expressed > in Lua? (Note, this is an actual question) The two biggies are continuations and macros. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:35:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDZWCO022529; Wed, 23 Sep 2009 10:35:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B0EC1A6A9; Wed, 23 Sep 2009 10:35:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BAA71A662 for ; Wed, 23 Sep 2009 10:34:58 -0300 (BRT) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgcBAPK/uUpXQBj7/2dsb2JhbAAI1nqEGwU Received: from 251.24-64-87.adsl-dyn.isp.belgacom.be (HELO [192.168.1.12]) ([87.64.24.251]) by relay.skynet.be with ESMTP; 23 Sep 2009 15:35:05 +0200 Message-ID: <4ABA240A.5000101@skynet.be> Date: Wed, 23 Sep 2009 15:35:06 +0200 From: noel frankinet User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for GUI toolkit wrapping? References: <4ABA0FF8.80405@spellingbeewinnars.org> <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> In-Reply-To: <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > And, in a Windows world (I don't know about their Mono support) > LuaInterface wraps .NET nicely. I'm writing such an app at the moment, > and callbacks are such a pleasure: > > ps.MouseMove:Add(function(sender,e) > local coord = get_coordinate(ps,Point(e.X,e.Y)) > coordPanel.Text = ('(%5.1f,%5.1f)'):format(coord.X,coord.Y) > end) > > (One can also do Swing apps with LuaJava) > > > steve d. > > Hello Steve, I think you are writing a GPS application, no ? on pda or full windows ? Noël From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:36:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDa6c5022714; Wed, 23 Sep 2009 10:36:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21E0C1A6B9; Wed, 23 Sep 2009 10:35:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD61E1A6B1 for ; Wed, 23 Sep 2009 10:35:17 -0300 (BRT) Received: by yxe37 with SMTP id 37so648778yxe.33 for ; Wed, 23 Sep 2009 06:35:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.45.12 with SMTP id s12mr2592201ybs.104.1253712925694; Wed, 23 Sep 2009 06:35:25 -0700 (PDT) In-Reply-To: <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> Date: Wed, 23 Sep 2009 08:35:25 -0500 Message-ID: <75cc17ac0909230635k1d3cd121v4cc101bd36007964@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=000e0cd37202961c4c04743ec974 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd37202961c4c04743ec974 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 23, 2009 at 8:18 AM, steve donovan wrote: > On Wed, Sep 23, 2009 at 3:12 PM, Gregg Reynolds wrote: > > Scheme remains without peer for learning programming. > > This is a common notion. What can Scheme do that cannot be expressed > in Lua? (Note, this is an actual question) > > Teach you computation. When somebody has written an introductory text as good as SICP using Lua, and Lua has a pedagogical implementation as sophisticated as PLTScheme (and HTDP , by the same team, deserves mention as well), then I'll agree that Lua is as good for learning. Actually even then I think Scheme's simplicity and purity would win out; the fact that it is pretty close to a straighforward transcription of Lambda calculus is not a minor point. And the SICP Lectures are even available online! What more could one ask for? The basic flaw in the standard "which language is best for learning programming" is that the language is largely irrelevant. In fact one could teach everything you need to know without using a "real" programming language; a little lambda notation and something like Knuth's invented assembler language would do just fine, and might even be a better way to go. After that it's just a question of the practicalities of learning how to use a programmer's editor and deal with source code, compiler messages, etc. For that obviously Emacs is the One True solution. -gregg --000e0cd37202961c4c04743ec974 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Sep 23, 2009 at 8:18 AM, steve donov= an <steve= .j.donovan@gmail.com> wrote:
On Wed, Sep 23, 2009 at 3:12 PM, Gregg Reynolds <dev@mobileink.com> wrote:
> Scheme remains without peer for learning programming.

This is a common notion. What can Scheme do that cannot be expressed<= br> in Lua? =C2=A0(Note, this is an actual question)

T= each you computation.=C2=A0 When somebody has written an introductory text = as good as SICP using Lua, an= d Lua has a pedagogical implementation as sophisticated as PLT Scheme (and HTDP, by the same team, deserves mention as well), then I'll agree= that Lua is as good for learning.=C2=A0 Actually even then I think Scheme&= #39;s simplicity and purity would win out; the fact that it is pretty close= to a straighforward transcription of Lambda calculus is not a minor point.= =C2=A0 And the SICP Lectures are even available online!=C2=A0 = What more could one ask for?

The basic flaw in the standard "which language is best for learnin= g programming" is that the language is largely irrelevant.=C2=A0 In fa= ct one could teach everything you need to know without using a "real&q= uot; programming language; a little lambda notation and something like Knut= h's invented assembler language would do just fine, and might even be a= better way to go.=C2=A0 After that it's just a question of the practic= alities of learning how to use a programmer's editor and deal with sour= ce code, compiler messages, etc.=C2=A0 For that obviously Emacs is the One = True solution.

-gregg
--000e0cd37202961c4c04743ec974-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:40:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDeHSQ024045; Wed, 23 Sep 2009 10:40:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66FDE18399; Wed, 23 Sep 2009 10:39:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 065111A662 for ; Wed, 23 Sep 2009 10:39:30 -0300 (BRT) Received: by bwz10 with SMTP id 10so585674bwz.5 for ; Wed, 23 Sep 2009 06:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+Q/8SYOMna68BuBP6ElitZWp2oAN9mkMIh1JSXtbiTk=; b=j82F6YpNIWFUDITemQEdhNQnq56tcbJU6Y4YiK/jXklm8b+B2vMMs+B5/GrxooramT 0i/NWusnr7uCV6XT/R8Yd+KGhVPomAuIJfgJJSpyOTUgpEhdMzAn3IaFRfpcuMCd9a/6 TKpMcdF+9/jjYleZjOjVg0Uz+RZD/HaJTVoog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=laG5D7xi97zmNG52wA2q5JkgD2sMyR/l7i6p/WQifXqytccdubpZePVLep1k8mzbxz w43VFyO5j22xHTMul3rvxWI1CJ0m3UyZnkn466FlkAvpdV13IJhFICvjaNV4IJA0f9J7 dcS57yDIAU4WyIz8H8/6+3KU2nML8geFmA8F8= MIME-Version: 1.0 Received: by 10.204.11.22 with SMTP id r22mr1939181bkr.30.1253713176936; Wed, 23 Sep 2009 06:39:36 -0700 (PDT) In-Reply-To: <4ABA240A.5000101@skynet.be> References: <4ABA0FF8.80405@spellingbeewinnars.org> <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> <4ABA240A.5000101@skynet.be> Date: Wed, 23 Sep 2009 15:39:36 +0200 Message-ID: <560972290909230639tb7cab00k4a30ffb2052fb51f@mail.gmail.com> Subject: Re: Lua for GUI toolkit wrapping? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8NDeHSQ024045 On Wed, Sep 23, 2009 at 3:35 PM, noel frankinet wrote: >> ps.MouseMove:Add(function(sender,e) >>    local coord = get_coordinate(ps,Point(e.X,e.Y)) >>    coordPanel.Text = ('(%5.1f,%5.1f)'):format(coord.X,coord.Y) >> end) > I think you are writing a GPS application, no ? on pda or full windows ? Nothing so sophisticated ;) get_coordiate() just translates the mouse point in pixel units into physical units. And, plain Windows. There are issues with LuaInterface on the Compact framework From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:41:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDfDPe024242; Wed, 23 Sep 2009 10:41:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 891E918FCC; Wed, 23 Sep 2009 10:40:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A477B18D31 for ; Wed, 23 Sep 2009 10:40:29 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 78870384962A4 for ; Wed, 23 Sep 2009 20:40:35 +0700 (NOVST) Message-ID: <003f01ca3c53$6ce46520$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au><4AB75742.2060907@cowlark.com> Subject: Re: Lua Performance questions Date: Wed, 23 Sep 2009 20:40:30 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Wed, 23 Sep 2009 20:40:35 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br So, you want all scripts to play the same role? Otherwise they would have different function names naturally. Then, you can create a table with functions corresponding to that role / event, as I proposed. function_name = function_name or {} table.insert(function_name, funciton() ... end) Then, you'll have to call each function in that table from your application. A more convenient way is to make special support for that kind of things, like I did. In my case you can write functions as usually, but many functions may have the same name: function events.function_name() ... end And call them as usually: lua_getglobal(L, "events"); lua_getfield(L, -1, "function_name"); lua_pcall(L, 0, 0, 0); lua_pop(L, 1); events table keeps all functions of the same name in a table and makes them easy to call and assign. Below is the part of code from my project that creates the events table. Note that I've put some functions into local variables. Like "debug_getinfo" that is set to "debug.getinfo". It also uses two functions specific to my projects. They are pcall2 and coroutine_resume2. They work the same as pcall and coroutine.resume, but show an error message if the call failed. --------- events local function FunctionFile(f) if type(f) == "number" then f = f + 1 end return debug_getinfo(f, "S").short_src end debug.FunctionFile = FunctionFile local function make_events(table) local t = {} local function index(_, a) local function docall(kind, ...) local f = t[a] if f then local ok = true local tmp, ret if type(f) == "table" then for i = 1, #f do local v = f[i] if f ~= nil then if kind == 2 then ok, tmp = coroutine_resume2(coroutine_create(v), ...) elseif kind == 1 then ok, tmp = pcall2(v, ...) else tmp = v(...) end if ok and tmp ~= nil then ret = tmp end end end else ret = f(...) end return ret end end local function call(...) return docall(...) end local function _pcalls(...) return docall(1, ...) end local function _pcall(...) local ok, ret = pcall2(docall, 0, ...) if ok then return ret end end local function _cocalls(...) return docall(2, ...) end local function _cocall(...) local ok, ret = coroutine_resume2(coroutine_create(docall), 0, ...) if ok then return ret end end local function add(func) local f = t[a] if f == nil then t[a] = func elseif type(f) == "table" then table_insert(f, func) else t[a] = {f, func} end end local function remove(func) local f = t[a] if f == func then t[a] = nil elseif f and type(f) == "table" then local i = 1 local v = f[1] while v do if v == func then if i == 1 and f[2] == nil then t[a] = nil else table_remove(f, i) end return v end i = i+1 v = f[i] end end end local function exists(func) local f = t[a] if func then if f == func then return true elseif f and type(f) == "table" then for _, v in ipairs(f) do if v == func then return true end end end return false else return f ~= nil end end return setmetatable({add = add, Add = add, remove = remove, Remove = remove, exists = exists, Exists = exists, pcall = _pcall, cocall = _cocall, cocalls = _cocalls}, {__call = call}) end local function newindex(_, a, v) f = t[a] if f then if type(f) == "table" then table_insert(f, v) else t[a] = {f, v} end else t[a] = v end end table = table or {} function table.RemoveFile(f) f = f or FunctionFile(2) for k, v in pairs(t) do if type(v) == "table" then local n = 0 for i = #v, 1, -1 do if FunctionFile(v[i]) == f then table_remove(v, i) else n = n + 1 end end if n == 0 then t[k] = nil end elseif FunctionFile(v) == f then t[k] = nil end end end function table.RemoveAll() t = {} end return setmetatable(table, {__index = index, __newindex = newindex}) end events = make_events{new = make_events} ----- Original Message ----- From: zweifel To: Lua list Sent: Wednesday, September 23, 2009 5:36 PM Subject: Re: Lua Performance questions I see.. so I can load all scripts at the beginning or at least be sure to load at least one time before calling the function. But I have to be sure that every script has a different function_name, otherwise I would be unable to call it. Is not it? This is not big problem though... From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:44:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDiRik024911; Wed, 23 Sep 2009 10:44:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7112193C0; Wed, 23 Sep 2009 10:43:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7470A18D31 for ; Wed, 23 Sep 2009 10:43:51 -0300 (BRT) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgcBAA/CuUpXQBj7/2dsb2JhbAAI1weEGwWBWA Received: from 251.24-64-87.adsl-dyn.isp.belgacom.be (HELO [192.168.1.12]) ([87.64.24.251]) by relay.skynet.be with ESMTP; 23 Sep 2009 15:43:58 +0200 Message-ID: <4ABA2620.1060909@skynet.be> Date: Wed, 23 Sep 2009 15:44:00 +0200 From: noel frankinet User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for GUI toolkit wrapping? References: <4ABA0FF8.80405@spellingbeewinnars.org> <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> <4ABA240A.5000101@skynet.be> <560972290909230639tb7cab00k4a30ffb2052fb51f@mail.gmail.com> In-Reply-To: <560972290909230639tb7cab00k4a30ffb2052fb51f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Nothing so sophisticated ;) get_coordiate() just translates the mouse > point in pixel units into physical units. > > And, plain Windows. There are issues with LuaInterface on the Compact framework > > Ah, I've done a lua to native win32 binding (and sold it), I was wondering if there's still demand for that ? I was well below 1Mb, with xml parser, sqlite, lua and the binding, on a pda it's important Noël From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:52:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDq4uk026729; Wed, 23 Sep 2009 10:52:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17428193CB; Wed, 23 Sep 2009 10:51:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E169A18D31 for ; Wed, 23 Sep 2009 10:51:29 -0300 (BRT) Received: by fxm12 with SMTP id 12so664387fxm.5 for ; Wed, 23 Sep 2009 06:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=6QExpgPvFE02z+8rdFGfksSTBXM1xRoKBBF7PKwAXr0=; b=KJXUAi6Jbhwj/GD52OwPmou5sLTHJv4bja/0YQKpAVvtqVbtsoAFYckHcElvkMUHue MNzBd8D903xBhowjTUgeLFS2tnzedwpGo3J5qKezIFQRwtu5yfl/JKckPCQ0uF+C3LkP K6YEY3ONumopzLkn4aLA49MccxQ13/0eaYLK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=Ag+IYfRTVX5/BmPkFihJXjXazDMVuNPkGUMlg6ZYjAjf0pioojxzgPnbkIS8m++iL+ V3t0OyDPd1SMwiBfnQd2wUf5/+1O3oAiLiH9l5/q27I3G0+/q7it3X9bNw5bha2auzJf bUe0bo8mLMZ9kbU/v8m/6rp/dUn2Mgy+/PNUE= Received: by 10.204.34.73 with SMTP id k9mr1913698bkd.45.1253713897240; Wed, 23 Sep 2009 06:51:37 -0700 (PDT) Received: from ?95.78.91.82? ([95.78.91.82]) by mx.google.com with ESMTPS id e17sm1479346fke.32.2009.09.23.06.51.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Sep 2009 06:51:36 -0700 (PDT) Date: Wed, 23 Sep 2009 17:51:29 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1614769898.20090923175129@gmail.com> To: noel frankinet Subject: win32 binding Re[2]: Lua for GUI toolkit wrapping? In-Reply-To: <4ABA2620.1060909@skynet.be> References: <4ABA0FF8.80405@spellingbeewinnars.org> <560972290909230615g2a887e61n9f76cbcc6c28d15f@mail.gmail.com> <4ABA240A.5000101@skynet.be> <560972290909230639tb7cab00k4a30ffb2052fb51f@mail.gmail.com> <4ABA2620.1060909@skynet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello noel, Wednesday, September 23, 2009, 5:44:00 PM, you wrote: > I've done a lua to native win32 binding (and sold it), I was wondering > if there's still demand for that ? i was asked about this, and answers were that such thing doesn't exist :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 10:53:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NDrV3U027014; Wed, 23 Sep 2009 10:53:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E180193D8; Wed, 23 Sep 2009 10:53:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E925318D31 for ; Wed, 23 Sep 2009 10:53:00 -0300 (BRT) Received: from [89.139.8.58] by mxout1.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KQF00784FWI3P10@mxout1.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 16:53:06 +0300 (IDT) Date: Wed, 23 Sep 2009 16:53:09 +0300 From: Shmuel Zeigerman Subject: Re: Separate groups of scripts In-reply-to: <4ABA216E.3070009@wp.pl> To: Lua list Message-id: <4ABA2845.8040707@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-2; format=flowed Content-transfer-encoding: 7BIT References: <4AB96EAE.9060700@013net.net> <4ABA0E68.60902@wp.pl> <4ABA1AB5.10408@013net.net> <4ABA216E.3070009@wp.pl> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Michal Kolodziejczyk wrote: > So don't bother with package.path (don't allow users change that!), use > full module names: > module1=require "plugin.Ann.module1" > module2=require "plugin.John.module2" If module authors were that disciplined, the question wouldn't arise. They just prefer to modify package.path and say "require 'module1'". And I'm not in a position to dictate them not to do that. Therefore, I'm seeking a way for the program to isolate groups of scripts (package.path's at the least) from each other. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:05:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NE5s5c029976; Wed, 23 Sep 2009 11:05:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9A00193FA; Wed, 23 Sep 2009 11:05:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8474193F4 for ; Wed, 23 Sep 2009 11:05:10 -0300 (BRT) Received: by yxe37 with SMTP id 37so679107yxe.33 for ; Wed, 23 Sep 2009 07:05:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.86.13 with SMTP id o13mr2563473anl.184.1253714718060; Wed, 23 Sep 2009 07:05:18 -0700 (PDT) In-Reply-To: <935fb28e0909221201h6378534dl5d927cc419fa8d77@mail.gmail.com> References: <935fb28e0909221037h2ea25046we5921e613374636b@mail.gmail.com> <90eb1dc70909221142t6a1faf70sb6ff332b03fd835e@mail.gmail.com> <935fb28e0909221201h6378534dl5d927cc419fa8d77@mail.gmail.com> Date: Wed, 23 Sep 2009 10:05:17 -0400 X-Google-Sender-Auth: 53a25c4f5b0e1f09 Message-ID: <932071120909230705m43362eevbce82a3320653b71@mail.gmail.com> Subject: Re: ANN: Dao 1.1 is released From: Louis-Philippe To: Lua list Content-Type: multipart/alternative; boundary=001636eee1f56b7c4004743f34a9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636eee1f56b7c4004743f34a9 Content-Type: text/plain; charset=ISO-8859-1 Anybody has performance and memory footprint data on this new language?Its OO, macro and threading systems sure make it interresting! 2009/9/22 Limin Fu > If you talk about features that are not seen in any other language, the > BNF-like macro in Dao is one such feature. However if you mean something > rarely seen in popular languages, there could be more, such as soft typing, > typed generator and coroutine, parallelized regular expression pattern > matching, functional methods etc. > Like Lua, Dao also tries to address the simplicity and usability of C > interfaces. What is different in Dao is that, the typing system is used to > eliminate the necessity to perform parameter type checking manually in C > wrapping functions. > > > > On Tue, Sep 22, 2009 at 11:42 AM, Javier Guerra wrote: > >> On Tue, Sep 22, 2009 at 12:37 PM, Limin Fu wrote: >> > I am pleased to announce the release of Dao 1.1. Dao was influenced by >> Lua >> > in several aspects, such as coroutine, string pattern matching etc., and >> > even the principle of simplicity is also taken by Dao. More importantly, >> the >> > implementation of Dao virtual machine was largely inspired by the Lua >> > virtual machine. >> >> i'm always interested in new languages, can you summarize what makes Dao >> unique? >> >> -- >> Javier >> > > --001636eee1f56b7c4004743f34a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Anybody has performance and memory footprint data on this new language?Its OO, macro and threading systems sure make it interresting!

2009/9/22 Limin Fu <phoolimin@gmail.com>
If you talk about features that are not see= n in any other language, the BNF-like macro in Dao is one such feature. How= ever if you mean something rarely seen in popular languages, there could be= more, such as soft typing, typed generator and coroutine, parallelized reg= ular expression pattern matching, functional methods etc.

Like Lua, Dao also tries to address the simplicity and usabi= lity of C interfaces. What is different in Dao is that, the typing system i= s used to eliminate the necessity to perform parameter type checking manual= ly in C wrapping functions.



On Tue, Sep 22, 2009 at 11= :42 AM, Javier Guerra <javier@guerrag.com> wrote:
On Tue, Sep 22, 2009 at 12:37 PM, Limin Fu <phoolimin@gmail.com> wrote:
> I am pleased to announce the release of Dao 1.1. Dao was influenced by= Lua
> in several aspects, such as coroutine, string pattern matching etc., a= nd
> even the principle of simplicity is also taken by Dao. More importantl= y, the
> implementation of Dao virtual machine was largely inspired by the Lua<= br> > virtual machine.

i'm always interested in new languages, can you summarize what ma= kes Dao unique?

--
Javier


--001636eee1f56b7c4004743f34a9-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:11:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEB35g031238; Wed, 23 Sep 2009 11:11:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E163B19402; Wed, 23 Sep 2009 11:10:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF10D193FD for ; Wed, 23 Sep 2009 11:10:24 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqSXR-00009p-7D for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 16:09:45 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 16:09:45 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 16:09:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Lua for GUI toolkit wrapping? Date: Wed, 23 Sep 2009 16:09:13 +0200 Lines: 14 Message-ID: References: <4ABA0FF8.80405@spellingbeewinnars.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4ABA0FF8.80405@spellingbeewinnars.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23/09/2009 14:09, Patrick wrote: > QT is not so great. Just curious, how is it not so great? I am not a Qt programmer, but I use daily a fairly complex Qt application (Perforce's GUI manager) and I find it quite well done. Idem in some applications I use more casually (like Bazaar Qt GUI interface). Is it problematic in the resulting products? In the way of programming it? -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:19:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEJbcA001169; Wed, 23 Sep 2009 11:19:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B124192E9; Wed, 23 Sep 2009 11:19:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99A7E190E0 for ; Wed, 23 Sep 2009 11:18:58 -0300 (BRT) Received: by ywh4 with SMTP id 4so856951ywh.33 for ; Wed, 23 Sep 2009 07:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pbyD+pXRBxbQBzZ3qdq0zBqpSEItHLsyOcmaf/QF2zM=; b=EaVXbc1wU9y7Pa5OAvTe0WCoEJqfJBTOd9WeExosFD7L8oL9I0OfVbx2t18RIdRDWD AW4yJ5R3eMO+eaWkqu1JzBZEHMaIipPueBobnJvgdVfc1fHQxaijSsmg5KFtRzzheT6Z DmbrcNxTa6HfCsqquKvZgQTBIj4rzDEwSLvXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XWiKDoqgrClSisnsqcxk2ELMVqx6pthMsl9JbZZNiEtUjpAvyXZJv2T2V1onAMbMMS bvBr5CbTzJVLKeI/eYQibLi1F767wirZz4DWBaRrhkVJQYhgeyneqxtVXF7zxbyxwidX pPc/ETVZtZpq45xBVFb8/UgCOZVfg9sbNmOIc= MIME-Version: 1.0 Received: by 10.90.38.31 with SMTP id l31mr1367696agl.9.1253715545053; Wed, 23 Sep 2009 07:19:05 -0700 (PDT) In-Reply-To: References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> Date: Wed, 23 Sep 2009 14:19:05 +0000 Message-ID: <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 9/23/09, Tony Finch wrote: > On Wed, 23 Sep 2009, steve donovan wrote: > > > > This is a common notion. What can Scheme do that cannot be expressed > > in Lua? (Note, this is an actual question) > > > The two biggies are continuations and macros. > I would add that there are no statements, everything is an expression. -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:30:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEUhGN004101; Wed, 23 Sep 2009 11:30:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 868171931E; Wed, 23 Sep 2009 11:30:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 971E21880B for ; Wed, 23 Sep 2009 11:30:03 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqSrA-0008Iu-P5 for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 16:30:08 +0200 Received: from p5b2c24ab.dip.t-dialin.net ([91.44.36.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 16:30:08 +0200 Received: from dak by p5b2c24ab.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 16:30:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Good introductory texts ? Date: Wed, 23 Sep 2009 16:29:44 +0200 Organization: Organization?!? Lines: 22 Message-ID: <871vlxraxz.fsf@lola.goethe.zz> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24ab.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:jQabigdWFcmwm+nkjJ8xuwsKS58= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alex Queiroz writes: > Hallo, > > On 9/23/09, Tony Finch wrote: >> On Wed, 23 Sep 2009, steve donovan wrote: >> > >> > This is a common notion. What can Scheme do that cannot be expressed >> > in Lua? (Note, this is an actual question) >> >> >> The two biggies are continuations and macros. >> > > I would add that there are no statements, everything is an > expression. (set! ... ) is not really an expression. It has no value and only side effects. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:33:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEXase004871; Wed, 23 Sep 2009 11:33:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78B0019352; Wed, 23 Sep 2009 11:33:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6113192E2 for ; Wed, 23 Sep 2009 11:32:56 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e21so236351fga.17 for ; Wed, 23 Sep 2009 07:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=pxvYOfijTQaS4mK/uN3aG6UNi7cPFWN8eeTBJ3q4TSQ=; b=PfLYOkgTvjUt2jwf2msgVeI92nv4StTuPWIKQcyxE1owW/r6ke+xiXzVUnMhsTqAfb sOaqhTqv3bh/J8lckHHVzi1ziQtYz67Mzqxs49KzoLPZn5vhNHhrNCYbrGH0CUtbwpT8 TUV5FXCIDQZPIXdPwOMYDx1Ts2GN9xs7Sadr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=YG5ncCScBKIHPad1tX9EXETcq6vC3nL0i+hAHxAZ2jxysNhAt2/tFS9o4iqKQ3qk/5 eR8xbHc1RDZ0rH2yALJ3QXggIWXrN1mj2brvh9+P9fJqn81boXdx03pROM4BHbW8FFBy u5y93agXidlKaB3tSCmiKdtPGTYRQ2V8go+2Y= Received: by 10.86.232.5 with SMTP id e5mr2080505fgh.27.1253716076964; Wed, 23 Sep 2009 07:27:56 -0700 (PDT) Received: from cl-t066-141cl.privatedns.com.gmail.com ([67.205.85.241]) by mx.google.com with ESMTPS id l19sm1714277fgb.0.2009.09.23.07.27.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Sep 2009 07:27:56 -0700 (PDT) From: Mario Domenech Goulart To: Lua list Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> Date: Wed, 23 Sep 2009 10:27:44 -0400 In-Reply-To: <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> (Alex Queiroz's message of "Wed, 23 Sep 2009 14:19:05 +0000") Message-ID: <85ljk5lorj.fsf@cl-t066-141cl.privatedns.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Alex On Wed, 23 Sep 2009 14:19:05 +0000 Alex Queiroz wrote: > On 9/23/09, Tony Finch wrote: >> On Wed, 23 Sep 2009, steve donovan wrote: >> > >> > This is a common notion. What can Scheme do that cannot be expressed >> > in Lua? (Note, this is an actual question) >> >> >> The two biggies are continuations and macros. >> > > I would add that there are no statements, everything is an > expression. Strictly speaking, not everything, in fact. Definitions and syntax definitions are not expressions, according to R5RS: http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_chap_5 Best wishes. Mario From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:40:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEeT7L006491; Wed, 23 Sep 2009 11:40:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BEF21A669; Wed, 23 Sep 2009 11:39:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3E851934D for ; Wed, 23 Sep 2009 11:39:41 -0300 (BRT) Received: by yxe37 with SMTP id 37so715765yxe.33 for ; Wed, 23 Sep 2009 07:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=R/k3wuLlHTIDkIsxIfQ1wR9IlvbAKzUBY3LdCBO3pio=; b=PvhfNWEsPL/wNwSXHtjq9KZsneznwCFpiO/S8VmSZOvRI+U5hts3sMx0e2Q1i3NzgW YdqphVN41ruzwm1y5ajqin3Bs8L9GWDvt3g1hQTqsU9v1IchZ7+uByqF63ql680snKk/ r3ypnwXEUfRHkj3NWIJJObjpombbbzrGFN6kw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bb90IAwCURI5uQ5wnCswem/Fd14ykTjpkpzGC6CEvR2ncze/zQiVgGzIQ8t+O8veK5 rMoBC3hp1FDXtqAEwB1rigYYti7gAmW/kC5hxjMepxFWcJvRrVc2SlcAgqSmRBIVttFb SOtGWyCoxRlX3RkGXsTBQlZerzJ7mwlLCXSy4= MIME-Version: 1.0 Received: by 10.91.214.17 with SMTP id r17mr1372270agq.34.1253716788404; Wed, 23 Sep 2009 07:39:48 -0700 (PDT) In-Reply-To: <85ljk5lorj.fsf@cl-t066-141cl.privatedns.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> <85ljk5lorj.fsf@cl-t066-141cl.privatedns.com> Date: Wed, 23 Sep 2009 14:39:48 +0000 Message-ID: <54e12800909230739q193feb24ofc2568bcca45316f@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo Mario, On 9/23/09, Mario Domenech Goulart wrote: > Hi Alex > > Strictly speaking, not everything, in fact. Definitions and syntax > definitions are not expressions, according to R5RS: > http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_chap_5 > I didn't know you were a subscriber to this list. :) Anyway, I know Scheme is not as pure as Haskell (for instance set! is also problematic, its return value is unspecified), but it's halfway there. -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 11:44:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NEiAaO007375; Wed, 23 Sep 2009 11:44:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA64619357; Wed, 23 Sep 2009 11:43:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C838419357 for ; Wed, 23 Sep 2009 11:43:24 -0300 (BRT) Received: by fxm12 with SMTP id 12so714068fxm.5 for ; Wed, 23 Sep 2009 07:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=X/e4Wj3tS0FzDNZCBQAhb98pH/5/O7X7QKAt/fwM+Es=; b=U+yaHeDyh68GZjU87duOagqaljPFpX7WkIwNhdCSt5f6h7oIDx2a36V6dbbpa84qix CJRbzn8/dAqskot3gnIpmfoxvDL/FsOAtsJuz8UsUHcROiY1wkEATxXzbxwx06/c7WL9 cm89PyXLijGEZuHBdzztiMh0KnMuCvDaYKfU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=hyMxeihH7PKIo/N4R8YWTkjzvaS3W9uYHLZZrOCLTAZjbhVdCVbiHE2KDN8YYBVFGc nIWRcwpLCqXVs3shGSu1izVzgiuikQukzQlPCsYQ/FHQXjc/miEPxQYbevQqSHrmLT66 gV1pHu3rnAmp3fBdDJavmlxZ2SVaspiWDu7L8= Received: by 10.86.230.27 with SMTP id c27mr2093975fgh.63.1253717008919; Wed, 23 Sep 2009 07:43:28 -0700 (PDT) Received: from cl-t066-141cl.privatedns.com.gmail.com ([67.205.85.241]) by mx.google.com with ESMTPS id e20sm387847fga.12.2009.09.23.07.43.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Sep 2009 07:43:28 -0700 (PDT) From: Mario Domenech Goulart To: Lua list Subject: Re: Good introductory texts ? References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> <871vlxraxz.fsf@lola.goethe.zz> Date: Wed, 23 Sep 2009 10:43:17 -0400 In-Reply-To: <871vlxraxz.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 23 Sep 2009 16:29:44 +0200") Message-ID: <85eipxlo1m.fsf@cl-t066-141cl.privatedns.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi David On Wed, 23 Sep 2009 16:29:44 +0200 David Kastrup wrote: > Alex Queiroz writes: >> >> On 9/23/09, Tony Finch wrote: >>> On Wed, 23 Sep 2009, steve donovan wrote: >>> > >>> > This is a common notion. What can Scheme do that cannot be >>> > expressed >>> > in Lua? (Note, this is an actual question) >>> >>> >>> The two biggies are continuations and macros. >>> >> >> I would add that there are no statements, everything is an >> expression. > > (set! ... ) is not really an expression. It has no value and only > side effects. According to R5RS, `set!' is an assignment expression (http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.6). Best wishes. Mario From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 12:06:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NF6o5Y012988; Wed, 23 Sep 2009 12:06:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C18519298; Wed, 23 Sep 2009 12:05:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B483B1911E for ; Wed, 23 Sep 2009 12:05:17 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqTPB-0004WR-Ol for lua@bazar2.conectiva.com.br; Wed, 23 Sep 2009 17:05:17 +0200 Received: from p5b2c24ab.dip.t-dialin.net ([91.44.36.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 17:05:17 +0200 Received: from dak by p5b2c24ab.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Sep 2009 17:05:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Good introductory texts ? Date: Wed, 23 Sep 2009 17:04:47 +0200 Organization: Organization?!? Lines: 19 Message-ID: <87ws3ppur4.fsf@lola.goethe.zz> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> <871vlxraxz.fsf@lola.goethe.zz> <85eipxlo1m.fsf@cl-t066-141cl.privatedns.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24ab.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:B9mJewol/NqRoUM2aUtf5BZ1lU8= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mario Domenech Goulart writes: > On Wed, 23 Sep 2009 16:29:44 +0200 David Kastrup wrote: > >> Alex Queiroz writes: >>> >>> I would add that there are no statements, everything is an >>> expression. >> >> (set! ... ) is not really an expression. It has no value and only >> side effects. > > According to R5RS, `set!' is an assignment expression Where is the point in calling a language "functional" when you make its assignments merely look like expressions, but act as statements? -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 12:12:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NFC3Ba014243; Wed, 23 Sep 2009 12:12:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 112141A6C4; Wed, 23 Sep 2009 12:10:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79A061A69F for ; Wed, 23 Sep 2009 12:10:51 -0300 (BRT) Received: by ywh4 with SMTP id 4so910387ywh.33 for ; Wed, 23 Sep 2009 08:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mWknNbWuvdcIKJE1OjWvusTGz/uczU9y0AcGYFFRqO4=; b=FVskV8cQbQMHBvpBcxq8V2VIhyYq6kU5TElKj4gz5oK8bNsYX3/1AX4fO6FivKZgMx qEql56Zla2W5btLLa101bmWg6ari2mZNSOhExA5n9wS3ZE+/Hdt2BgtYNolYItzDVOI0 Dyv9Fnrrv2LoAScBcqE9FjqObISJZA/RxjCgU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MExg6mOjMGPIZdqpy9W3yc/DiyeaSjMZbuMpukMpX8Nhd/bf7wYA2z/DVV1mJgJAiD A04/ngmBgcHZWhWjGXTQc5eODsnD28bgBYntoWWy+sGbX2iuqKeT2Ti7elU1TWJqqsme D5AopDHUJzQgTNHT7oKasDNNdHlr1m87Wig0o= MIME-Version: 1.0 Received: by 10.91.27.6 with SMTP id e6mr1382069agj.27.1253718649176; Wed, 23 Sep 2009 08:10:49 -0700 (PDT) In-Reply-To: <87ws3ppur4.fsf@lola.goethe.zz> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <75cc17ac0909230612u5ee3411ax6f73ec0d6e255422@mail.gmail.com> <560972290909230618o2a04a20cg6b30dd753184b046@mail.gmail.com> <54e12800909230719g110802cdw338faa0f09122e61@mail.gmail.com> <871vlxraxz.fsf@lola.goethe.zz> <85eipxlo1m.fsf@cl-t066-141cl.privatedns.com> <87ws3ppur4.fsf@lola.goethe.zz> Date: Wed, 23 Sep 2009 15:10:49 +0000 Message-ID: <54e12800909230810i1d9a0b27h644b34c811fec5a0@mail.gmail.com> Subject: Re: Good introductory texts ? From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 9/23/09, David Kastrup wrote: > > Where is the point in calling a language "functional" when you make its > assignments merely look like expressions, but act as statements? > That's why the Report does not call it functional. -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 13:32:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NGWHK2030180; Wed, 23 Sep 2009 13:32:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A82A21A6B4; Wed, 23 Sep 2009 13:31:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89E521A662 for ; Wed, 23 Sep 2009 13:31:24 -0300 (BRT) Received: by bwz10 with SMTP id 10so731484bwz.5 for ; Wed, 23 Sep 2009 09:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=HX9V4G/aFQff0EeE71gTgE63gXn8ZjjElKxbWp+Rbt0=; b=daJa8a0N8Ni6PKJwEIDU2Z6EniEMzOw6pdoEeaGN53dRHPvBd7/fT9/9u6IH71pWgt 19LhoWC2I+4f7LOLjL+AjCsujrN+sUb+waEhHrh66ewrWyY9DOnlsyCgAYCgofHSjqX1 8MajTFHO5/niaOn/z9PpNeevvfzKCEU8ZtIXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bbUAH06Ba2V1OHSuan1yyhcWcjvl2chAg7h+fUZj3kLKOg/Fj0NE3GJ2j5+DKQbKlT 9YukwxPHCuxo7JRCvzwzB6PWp7WOU/nVdhRbUxBccfq9sddK5VdTWKbMb/BE5JlGBnXy JowGc4vGlJyXZw53bvLlOze0nuD9ey4oKoy0s= MIME-Version: 1.0 Received: by 10.223.127.195 with SMTP id h3mr884756fas.57.1253723490457; Wed, 23 Sep 2009 09:31:30 -0700 (PDT) Date: Wed, 23 Sep 2009 18:31:30 +0200 Message-ID: Subject: Lua as first language From: Jasper Cook To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00235407f0064b983a0474413fd3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00235407f0064b983a0474413fd3 Content-Type: text/plain; charset=ISO-8859-1 My 2c I do Q&Ds daily, mostly in VBA-Excel, like: Excel VBA - sort 100,001 lines text file - oops, can only manage 65536, sorry ============================ Sub do_sort() Dim start, finish, elapsed start = Now() ActiveSheet.Range("A1:N65536").Sort Key1:=Sheets(1).Range("A1"), Header:=xlYes finish = Now() elapsed = finish - start MsgBox "sorted in " & Format(elapsed, "##.#####") & " secs" End Sub ' do_sort Lua - sort 100,001 lines text file ======================= io.input("DuppInfo_both.txt") io.output("DuppSorted.txt") local x = os.clock() local lines = {} for line in io.lines() do lines[#lines + 1] = line end table.sort(lines) for _, l in ipairs(lines) do io.write(l, "\n") end print(string.format("Sorted %d lines in = %.2f seconds\n", #lines, os.clock() -x)) Lua sorted the whole file in 0.55 seconds. In an admin situation, we seldom come across files with more than 10000 rows. So, am I going to learn Lua to do this? Well, yes, at least a bit of it, if I need to sort big files, and don't want to pay for Office 2007, and OO Calc also cannot import this whole file. In this instance Lua was a lifesaver, but I could just as easily have used Ruby. As for Excel and VBA, the code above was not used - this was a legacy file with line feeds that Excel could not import no matter what I tried. So I have to say Lua won hands down here - sheer simple usefulness. Having said this, and despite that I believe I could handle nearly every admin "funny" that comes my way using just Lua and Penlight, the thought of figuring out what went wrong after "require" (again) has me wondering about Assembler, which its adherents say (don't they all) has fewer gotchas than C. When all is said and done, though, looking at the code above, VBA just looks "pidgin" to me. Jasper Cook --00235407f0064b983a0474413fd3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My 2c

I do Q&Ds daily, mostly in VBA-Excel, like:
Excel VBA -= sort 100,001 lines text file - oops, can only manage 65536, sorry
=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
Sub do_sort()
=A0=A0=A0 Dim start, finish, elapsed
=A0=A0=A0 start =3D Now()
=A0=A0=A0=A0 ActiveSheet.Range("A1:N65536= ").Sort Key1:=3DSheets(1).Range("A1"), Header:=3DxlYes
= =A0=A0=A0 finish =3D Now()
=A0=A0=A0 elapsed =3D finish - start
=A0= =A0=A0 MsgBox "sorted in " & Format(elapsed, "##.#####&q= uot;) & " secs"
End Sub ' do_sort

Lua - sort 100,001 lines text file
=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
io.input= ("DuppInfo_both.txt")=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0
= io.output("DuppSorted.txt")=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0= =A0
local x =3D os.clock()=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0= =A0=A0
local lines =3D {}=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0= =A0
for line in io.lines() do lines[#lines + 1] =3D line end=A0=A0=A0 = =A0=A0=A0
table.sort(lines)=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0= =A0=A0 =A0=A0=A0
for _, l in ipairs(lines) do io.write(l, "\n"= ;) end=A0=A0=A0 =A0=A0=A0
print(string.format("Sorted %d lines in =3D=A0 %.2f seconds\n", #= lines, os.clock() -x))

Lua sorted the whole file in 0.55 seconds. In= an admin situation, we seldom come across files with more than 10000 rows.= So, am I going to learn Lua to do this?=A0 Well, yes, at least a bit of it= , if I need to sort big files, and don't want to pay for Office 2007, a= nd OO Calc also cannot import this whole file.

In this instance Lua was a lifesaver, but I could just as easily have u= sed Ruby.=A0 As for Excel and VBA, the code above was not used - this was a= legacy file with line feeds that Excel could not import no matter what I t= ried.=A0 So I have to say Lua won hands down here - sheer simple usefulness= .

Having said this, and despite that I believe I could handle nearly ever= y admin "funny" that comes my way using just Lua and Penlight, th= e thought of figuring out what went wrong after "require" (again)= has me wondering about Assembler, which its adherents say (don't they = all) has fewer gotchas than C.=A0

When all is said and done, though, looking at the code above, VBA just = looks "pidgin" to me.

Jasper Cook

--00235407f0064b983a0474413fd3-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 13:51:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NGpQLv001680; Wed, 23 Sep 2009 13:51:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2DD718994; Wed, 23 Sep 2009 13:50:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF30718959 for ; Wed, 23 Sep 2009 13:50:45 -0300 (BRT) Received: by qyk4 with SMTP id 4so654155qyk.33 for ; Wed, 23 Sep 2009 09:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=GQL4IgMStVucSB934KfIBRysQ3n507jYYJPDws1LovU=; b=GQUWmoHeXaj6lfYIgIKaP0DAKWD3CuEZ/A/OSD9cFzgE2l3DBctZjgiegh4OZrnpNm GgujkGm+7BJMGIVnxyEAovutVANubDPJwpfsQ+MgoL9fbkjR26epyTJY8tqCmuwqRvgi BWxGLXjJR+sGzw2gdHScNpf7a3i+hl9WF07H8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=GJbzAtwpGpfZc801zXv0pOTJKaGaYF9TRRPL8ddCMa0pJ59ljC6USKS2N4PlXIvMgK tMzlCN/kx4IRR5EFMgci+Ec/PNHdG730pvlT83HPqQyxLyYoYUjMq+I4ZL5CKu2eq4li fYeFzhOaduy9ojKCIc/Y9+0fw+MXAeo/BEz/Q= MIME-Version: 1.0 Received: by 10.224.108.210 with SMTP id g18mr2129594qap.353.1253724653071; Wed, 23 Sep 2009 09:50:53 -0700 (PDT) Date: Wed, 23 Sep 2009 13:50:53 -0300 X-Google-Sender-Auth: 0c9dd7e3b595f76a Message-ID: <7913df4d0909230950x483bc0e1r997ef44ef6c7a389@mail.gmail.com> Subject: [ANN] Cosmo 9.09.22 From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmo is a "safe templates" engine. It allows you to fill nested templates, providing many of the advantages of Turing-complete template engines, without without the downside of allowing arbitrary code in the templates unless you wish to provide it. Cosmo is implemented as an LPEG grammar, mostly using LPEG's "re" language. The current version of Cosmo is 9.09.22. This version extends the template language with arbitrary expressions in selector applications, and adds better error detection when compiling templates Cosmo is installed as a rock. To install the most recent release do `luarocks install cosmo`. No C compiler is necessary, as Cosmo is 100% Lua code. See http://cosmo.luaforge.net for a tutorial. Source control and issue tracking is at http://github.com/mascarenhas/cosmo. -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 14:22:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NHMG8Y008691; Wed, 23 Sep 2009 14:22:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D36E81A6C7; Wed, 23 Sep 2009 14:21:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5C3A1A670 for ; Wed, 23 Sep 2009 14:21:24 -0300 (BRT) Received: by vws32 with SMTP id 32so675374vws.11 for ; Wed, 23 Sep 2009 10:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=jfG4FAw0yKAdhTuKyEyXtRobCWXj0DxJvwkUIpj3sQc=; b=tGrfSK7gJ/V9X0YEHFtefdam33qjfHiuk0+hw6o+tn58od1+TJ/sZxRUREXODMbVQj EoKhIqxaIj+VKYaPiByonqhiXJ+mowfgZN/uN6l9WOmEUmDtGMyA7j+ZRINSKFmYANg1 1/AFIEeGY8tkN429kjtIKawGUBooy11JPfD6o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=eK0/rmIcC5Pq9dHlXhfEFmBUlp9DPClf1gJ+85RFKHB87jxK7UAsYcusUHjkyb9Zn3 UK2nnp902IG+fplqKesf4GyQLpxD+F9bCe/5jpwqJJtqsPzIyelMCU3ua/v1hVBUK2ni 49LWNRe2KWB0c1B5+C2bkcqzuKzkArKTYjYYk= MIME-Version: 1.0 Received: by 10.220.108.39 with SMTP id d39mr4043927vcp.12.1253726491137; Wed, 23 Sep 2009 10:21:31 -0700 (PDT) From: Marco Antonio Abreu Date: Wed, 23 Sep 2009 14:21:11 -0300 Message-ID: <31ca41400909231021i6ef4ec37rf7ce3cdfe99e3db6@mail.gmail.com> Subject: start and receive return To: Lua list Content-Type: multipart/alternative; boundary=00c09f971e1c2659ed047441f201 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f971e1c2659ed047441f201 Content-Type: text/plain; charset=ISO-8859-1 Hello guys. I have a script that accesses a central database, extracts data and sends it to other databases, depending on the data obtained, replicating the content to small databases, for local access. I'm looking to something to help me do this: I have a main script that identifies what have to be done and another one that would be started by the first to make the copy of the data. By this way I release the first script to perform another query and, if necessary, start another instance of the second script, doing a parallel process with the other. I can do this process with no difficulty using the command *os.execute( "cmd /b lua.exe script2.lua param1 param2" )* on windows or *os.execute( "/usr/bin/lua script2.lua param1 param2 &" )* on Linux. However I'm do not know how to identify if the script had completed its execution. Does anyone know or have any ideas? Tthanks. [] 's, -- Marco Antonio Abreu mabreu.ti@gmail.com System Analist/Developer --00c09f971e1c2659ed047441f201 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello guys.=20

I have a script that accesses a central database, extracts data and sends it to other databases, depending on the data obtained, replicatin= g the content to small databases, for local access.

I'm looking to something to help me do this: I=A0 have a main scri= pt that identifies what have to be done and another one that would be started by the first to make the copy of the data. By this way I release the first scr= ipt to perform another query and, if necessary, start another instance of the second script, doing a parallel process with the other.

I can do this process with no difficulty using the command os.execute( "cmd /b lua.exe script2.lua param1 param2" ) o= n windows or os.execute( "/usr/bin/lua script2.lua param1 param2 &" ) on Linux. However I'm do not know how to identify if the script had comple= ted its execution.

Does anyone know or have any ideas?=20

Tthanks.=20

[] 's,

--
Marco Antonio Abreu
mabreu.ti@gmail.com
System Analist/D= eveloper
--00c09f971e1c2659ed047441f201-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 14:33:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NHXcKX011466; Wed, 23 Sep 2009 14:33:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1754E1A6D4; Wed, 23 Sep 2009 14:32:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8D821A6CE for ; Wed, 23 Sep 2009 14:32:48 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id B6D8D735DF for ; Wed, 23 Sep 2009 13:32:54 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 23 Sep 2009 13:32:57 -0400 X-Sasl-enc: zZClcwwEii7ctkFNG35MskR9Ejz/p6WIB1fozkGb0sp+ 1253727174 Received: from [192.168.1.101] (71-20-61-185.war.clearwire-wmx.net [71.20.61.185]) by mail.messagingengine.com (Postfix) with ESMTPSA id EFDF671B58 for ; Wed, 23 Sep 2009 13:32:53 -0400 (EDT) Message-ID: <4ABA5BC4.3030804@eykamp.com> Date: Wed, 23 Sep 2009 10:32:52 -0700 From: Christopher Eykamp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Performance questions References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Essentially, yes. Here's a snippet from Bitfighter, a game I'm developing that uses Lua scripted robot players. To get a robot's name, I call a function in the script called getName(). Here is the code I use: // Run the getName() function in the bot (will default to the one in robot_helper_functions if it's not overwritten by the bot) lua_getglobal(L, "getName"); if (!lua_isfunction(L, -1) || lua_pcall(L, 0, 1, 0)) // Passing 0 params, getting one back { mPlayerName = "Nancy"; logError("Robot error retrieving name (%s). Using \"%s\".", lua_tostring(L, -1), mPlayerName.getString()); } else { mPlayerName = lua_tostring(L, -1); lua_pop(L, 1); } I do not claim to be a master at integrating Lua with C++, but there are several working examples of working integration in my codebase. You can access it via Sourceforge, and the files of most interest will likely be robot.cpp and luaLevelGenerator.cpp. Chris zweifel wrote: > do you mean I can load a script called "melee.lua" and then call > > lua_getglobal(L, "melee.lua"); > lua_pcall(L, ...); > > is that it? > > > 2009/9/23 Luiz Henrique de Figueiredo > > > > I see.. so I can load all scripts at the beginning or at least > be sure to > > load at least one time before calling the function. > > > > But I have to be sure that every script has a different > function_name, > > otherwise I would be unable to call it. Is not it? > > The script itself is an anonymous function. > > > > > -- > God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus > > http://fog.neopages.org/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 14:52:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NHqd3t016221; Wed, 23 Sep 2009 14:52:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7701E192FD; Wed, 23 Sep 2009 14:51:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA653192E7 for ; Wed, 23 Sep 2009 14:51:52 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 0E40C730A7 for ; Wed, 23 Sep 2009 13:52:00 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 23 Sep 2009 13:52:02 -0400 X-Sasl-enc: EBDq04TmIzTeCSAPIsHK77KzgLkkj22SYp/CgGJX8+dQ 1253728319 Received: from [192.168.1.101] (71-20-61-185.war.clearwire-wmx.net [71.20.61.185]) by mail.messagingengine.com (Postfix) with ESMTPSA id 733AF30DED for ; Wed, 23 Sep 2009 13:51:59 -0400 (EDT) Message-ID: <4ABA603D.1030106@eykamp.com> Date: Wed, 23 Sep 2009 10:51:57 -0700 From: Christopher Eykamp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Performance questions References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> <4ABA5BC4.3030804@eykamp.com> In-Reply-To: <4ABA5BC4.3030804@eykamp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Actually, having read others' responses, I now see you were trying to run an entire script, not just a function, as I initially supposed. Christopher Eykamp wrote: > Essentially, yes. Here's a snippet from Bitfighter, a game I'm > developing that uses Lua scripted robot players. To get a robot's > name, I call a function in the script called getName(). Here is the > code I use: > > // Run the getName() function in the bot (will default to the one in > robot_helper_functions if it's not overwritten by the bot) > lua_getglobal(L, "getName"); > > if (!lua_isfunction(L, -1) || lua_pcall(L, 0, 1, 0)) // Passing > 0 params, getting one back > { > mPlayerName = "Nancy"; > logError("Robot error retrieving name (%s). Using \"%s\".", > lua_tostring(L, -1), mPlayerName.getString()); > } > else > { > mPlayerName = lua_tostring(L, -1); > lua_pop(L, 1); > } > > I do not claim to be a master at integrating Lua with C++, but there > are several working examples of working integration in my codebase. > You can access it via Sourceforge, and the files of most interest will > likely be robot.cpp and luaLevelGenerator.cpp. > > Chris > > > zweifel wrote: >> do you mean I can load a script called "melee.lua" and then call >> >> lua_getglobal(L, "melee.lua"); >> lua_pcall(L, ...); >> >> is that it? >> >> >> 2009/9/23 Luiz Henrique de Figueiredo > > >> >> > I see.. so I can load all scripts at the beginning or at least >> be sure to >> > load at least one time before calling the function. >> > >> > But I have to be sure that every script has a different >> function_name, >> > otherwise I would be unable to call it. Is not it? >> >> The script itself is an anonymous function. >> >> >> >> >> -- >> God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus >> >> http://fog.neopages.org/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 16:11:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NJ9J8I004351; Wed, 23 Sep 2009 16:09:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CE2A19383; Wed, 23 Sep 2009 16:08:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp108.rog.mail.re2.yahoo.com (smtp108.rog.mail.re2.yahoo.com [68.142.225.206]) by bazar2.conectiva.com.br (Postfix) with SMTP id 848E1190E0 for ; Wed, 23 Sep 2009 16:08:34 -0300 (BRT) Received: (qmail 91996 invoked from network); 23 Sep 2009 19:08:38 -0000 Received: from unknown (HELO ?192.168.1.110?) (spell_gooder_now@173.32.14.83 with plain) by smtp108.rog.mail.re2.yahoo.com with SMTP; 23 Sep 2009 19:08:38 -0000 X-YMail-OSG: OpZYKvAVM1k.Poc4bEi8WzKL9zays9vU8BYMBp9u7zVjvQfMuQmv.Pioe96_17YcYw-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4ABA7209.5060904@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 15:07:53 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for GUI toolkit wrapping? References: <4ABA0FF8.80405@spellingbeewinnars.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Philippe Lhoste wrote: > On 23/09/2009 14:09, Patrick wrote: >> QT is not so great. > > Just curious, how is it not so great? > I am not a Qt programmer, but I use daily a fairly complex Qt > application (Perforce's GUI manager) and I find it quite well done. > Idem in some applications I use more casually (like Bazaar Qt GUI > interface). > Is it problematic in the resulting products? In the way of programming > it? > Maybe this was not a fair statement. It just seemed poorly supported. It is not listed on Qt(Nokia's)website as a binding and just looked pretty beta on sourceforge. I have not used it, I probably should have been more careful about making such a statement. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 16:13:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NJDD8h005358; Wed, 23 Sep 2009 16:13:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECD4D19391; Wed, 23 Sep 2009 16:12:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC3BC190E0 for ; Wed, 23 Sep 2009 16:12:34 -0300 (BRT) Received: by bwz10 with SMTP id 10so854551bwz.5 for ; Wed, 23 Sep 2009 12:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=iyhMrDb+vKW1VMVx8Hd7+3Qj5tvcBbvEjmIsIczaYY0=; b=tqZ/JJ1f9JZnriBwc8xaa2mdLyhiz9GK+ucqsNcU/eqn9qJieaKQt9Lo50iN65H5Z/ 23r7rbwGnrqdRBfLdV7SJ426O1Q+pyOUZ5Jbi48N9ufiDeHDvVKN5H481Kq0vpVwC1Qe 4bK+gLJbtS9wwON4nQ0zeFvEXCHDbbzWqMetw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=MB1I6ywnw6K7e1aCym5KnNUFPA5sx1pihDc0scRYYAlQ29Wq4A62qxflnTqCnKgpM9 cf13FPG1YpCNSsm4Lt2BJEXo2DfIfeNPME4bjOP0krlKk1Yp6gyKUciAIe2cy6n//3Ez ETXF7dMjWWmlyzq6x0N64FaKfhMrL1ug7An10= Received: by 10.204.162.130 with SMTP id v2mr2225178bkx.70.1253733159225; Wed, 23 Sep 2009 12:12:39 -0700 (PDT) Received: from ?95.78.91.82? ([95.78.91.82]) by mx.google.com with ESMTPS id f31sm1861286fkf.35.2009.09.23.12.12.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Sep 2009 12:12:36 -0700 (PDT) Date: Wed, 23 Sep 2009 23:12:25 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <175419923.20090923231225@gmail.com> To: Patrick Subject: Re[2]: Lua for GUI toolkit wrapping? In-Reply-To: <4ABA7209.5060904@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Patrick, Wednesday, September 23, 2009, 11:07:53 PM, you wrote: >>> QT is not so great. >> >> application (Perforce's GUI manager) and I find it quite well done. > is not listed on Qt(Nokia's)website as a binding and just looked pretty probably you are saying about different things - Qt itself and Qt/Lua binding -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 17:51:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NKptwg031627; Wed, 23 Sep 2009 17:51:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14B4A187A6; Wed, 23 Sep 2009 17:51:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp107.rog.mail.re2.yahoo.com (smtp107.rog.mail.re2.yahoo.com [68.142.225.205]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7852C18648 for ; Wed, 23 Sep 2009 17:51:05 -0300 (BRT) Received: (qmail 66360 invoked from network); 23 Sep 2009 20:51:12 -0000 Received: from unknown (HELO ?192.168.1.110?) (spell_gooder_now@173.32.14.83 with plain) by smtp107.rog.mail.re2.yahoo.com with SMTP; 23 Sep 2009 20:51:12 -0000 X-YMail-OSG: OxSqcTAVM1nrxMKQAI6SVprK_Jp4sJzjd82C8TFy3mHkrCp6__fl9oTG04PFnQrrxA-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4ABA8A13.2050202@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 16:50:27 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for GUI toolkit wrapping? References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com> In-Reply-To: <175419923.20090923231225@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > probably you are saying about different things - Qt itself and Qt/Lua > binding Absolutely. I am not criticizing QT or any other toolkit, I am just wondering if I am going in the wrong direction. I would like to use Lua with GTK in particular but I am second guessing myself because there seems like quite a small community around it. I can't understand why? Why would anyone want to code a GUI in C/C++ if they had something like Lua? From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 19:44:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NMiCM1017908; Wed, 23 Sep 2009 19:44:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A81EE1A6A2; Wed, 23 Sep 2009 19:43:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85F271A69B for ; Wed, 23 Sep 2009 19:43:21 -0300 (BRT) Received: by ewy26 with SMTP id 26so1164121ewy.5 for ; Wed, 23 Sep 2009 15:43:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.159.3 with SMTP id l3mr6729228ebo.37.1253745808490; Wed, 23 Sep 2009 15:43:28 -0700 (PDT) In-Reply-To: <4ABA8A13.2050202@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com> <4ABA8A13.2050202@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 17:43:28 -0500 Message-ID: <90eb1dc70909231543m5eee929fib8f48506afa35cf0@mail.gmail.com> Subject: Re: Lua for GUI toolkit wrapping? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 23, 2009 at 3:50 PM, Patrick wrote: > Why would anyone want to code a GUI in C/C++ if they had something like Lua? for me, it's because Qt is great, but only on a C++ mindframe. when using a Lua/C++ binding, or even a more mature binding, like PyQt, my code looks like C with a different syntax. very little gain from using a better language :-( it seems the only solution would be a GUI framework designed with a dynamic language in mind... would be great, but a LOT of work. -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 19:49:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NMnHCX018601; Wed, 23 Sep 2009 19:49:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9355818AAD; Wed, 23 Sep 2009 19:48:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B19CD18A74 for ; Wed, 23 Sep 2009 19:48:39 -0300 (BRT) Received: by fxm12 with SMTP id 12so1116000fxm.5 for ; Wed, 23 Sep 2009 15:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yCxo/Oxxs8+Iw3BELIvYx0N55b9ErpMKJaAvxXJxgWY=; b=QnY/5v4ZqcSLjKiG1Y44zknS9COzNAn8bBIOJ82+a5htS4BhOrAAOVVJi38HlDNPQl /wxfm77LiiB9asR2OIqtyEXHkn5OmaRfrIZR9eU99v/PN6SvNYo8lChxbKhG/6LHf+Ys Ud4fQzzVQd/iKu+6SVnabJhl51PgZkSAYwerA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vUX0f6xW1qe04W4PqELJ2PrrpwIPAzINTF/Ka7pps9+Eyctvk2NSy2dog7Nb1njqmg /q320wSAoJnZSCqz77HAIBx//f4VvNXjRqVWACevn0UH4yNFFVmiQOMAuXFtH1SIdy+B 2po3FBUIYFC3VHYWDtcDsmNu212mgYyUT11Y4= MIME-Version: 1.0 Received: by 10.204.19.145 with SMTP id a17mr2399788bkb.64.1253746125899; Wed, 23 Sep 2009 15:48:45 -0700 (PDT) In-Reply-To: <4ABA8A13.2050202@spellingbeewinnars.org> References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com> <4ABA8A13.2050202@spellingbeewinnars.org> Date: Thu, 24 Sep 2009 00:48:45 +0200 Message-ID: Subject: Re: Lua for GUI toolkit wrapping? From: Mauro Iazzi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/23 Patrick : > >> probably you are saying about different things - Qt itself and Qt/Lua >> binding > > Absolutely. I am not criticizing QT or any other toolkit, I am just > wondering if I am going in the wrong direction. I would like to use Lua > with GTK in particular but I am second guessing myself because there > seems like quite a small community around it. I can't understand why? > Why would anyone want to code a GUI in C/C++ if they had something like Lua? several reasons: - they know C/C++ and not Lua - the native language of the toolkit is C/C++ so the API may fit better - the bindings are usually supported by a third party, so there are likely more bugs, moreover, they come after the toolkit becomes widespread and are usually less mature - it adds dependencies to the application - since less people uses it there are less docs/tutorials/examples around - they may simply like C/C++ more than Lua :) that said, I'd like to shamelessly plug my Qt binding for Lua. It suffers all of the above, in particular "not mature", but is slowly improving: http://code.google.com/p/lqt http://repo.or.cz/w/lqt.git mauro From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 19:54:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NMscRR019186; Wed, 23 Sep 2009 19:54:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0B9E18B91; Wed, 23 Sep 2009 19:54:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBED418993 for ; Wed, 23 Sep 2009 19:53:58 -0300 (BRT) Received: by ywh4 with SMTP id 4so1338729ywh.33 for ; Wed, 23 Sep 2009 15:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=3hvSVhsSmYxyiOE3Yq1qPCxFFGrdWB2sZVv2O3PIS1Q=; b=cXngXKSB9nI9u/Qam4clvNdTcgyVeOVgkQCxEA5oyvh/jBfse0lhpbLoVz1SR075di RdTWO3BAFqmYr8bGEW5Ouh2Bi7cfQ/bB/3rewt8Fcd7GSmaA9MGAA0z1/P3tb/ScKfO5 zH0K69rWJrBxZqmVyLkqRD2aL36kXyPer/mXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=i+oy2wqpnzld859jwJ4NFsCO6ByAIFippcfLjFo1HAStrqt4B5dy6iXbx3ZlbJTsIf Q/AWE01VEImzy845bg8XAecW0Zt3DGiHRlH7+nEDtL0JcVlHv1kvtPHe+V/RV+Yx4hTs NR3j80RmnMdcAhDaOIOxuH3gpl9NyYK7M0xcc= MIME-Version: 1.0 Received: by 10.150.163.5 with SMTP id l5mr5052346ybe.315.1253746444120; Wed, 23 Sep 2009 15:54:04 -0700 (PDT) In-Reply-To: References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com> <4ABA8A13.2050202@spellingbeewinnars.org> From: Luis Felipe Strano Moraes Date: Wed, 23 Sep 2009 19:53:44 -0300 Message-ID: Subject: Re: Lua for GUI toolkit wrapping? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8NMscRR019186 Perhaps not directly what you want, but recently there has been activity on the Enlightenment libraries to add support for Lua as a scripting language. You'd still need to work with C/C++, but a bunch of scripting stuff could be done with Lua. Here's a link to the specific thread on the mailing list concerning that: http://www.mail-archive.com/enlightenment-devel@lists.sourceforge.net/msg22382.html --lf On Wed, Sep 23, 2009 at 7:48 PM, Mauro Iazzi wrote: > 2009/9/23 Patrick : >> >>> probably you are saying about different things - Qt itself and Qt/Lua >>> binding >> >> Absolutely. I am not criticizing QT or any other toolkit, I am just >> wondering if I am going in the wrong direction. I would like to use Lua >> with GTK in particular but I am second guessing myself because there >> seems like quite a small community around it. I can't understand why? >> Why would anyone want to code a GUI in C/C++ if they had something like Lua? > > several reasons: >  - they know C/C++ and not Lua >  - the native language of the toolkit is C/C++ so the API may fit better >  - the bindings are usually supported by a third party, so there are > likely more bugs, moreover, they come after the toolkit becomes > widespread and are usually less mature >  - it adds dependencies to the application >  - since less people uses it there are less docs/tutorials/examples around >  - they may simply like C/C++ more than Lua :) > > that said, I'd like to shamelessly plug my Qt binding for Lua. It > suffers all of the above, in particular "not mature", but is slowly > improving: > > http://code.google.com/p/lqt > http://repo.or.cz/w/lqt.git > > mauro > -- "Sometimes you gotta look reality in the face and say no!" -- Benjamin Gonzalez From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 20:11:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NNAj6J021105; Wed, 23 Sep 2009 20:10:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF5AF1A6AB; Wed, 23 Sep 2009 20:10:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas02p.mx.bigpond.com (nschwmtas02p.mx.bigpond.com [61.9.189.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 635661A69B for ; Wed, 23 Sep 2009 20:09:59 -0300 (BRT) Received: from nschwotgx03p.mx.bigpond.com ([143.238.91.39]) by nschwmtas02p.mx.bigpond.com with ESMTP id <20090923231002.EMKL2264.nschwmtas02p.mx.bigpond.com@nschwotgx03p.mx.bigpond.com> for ; Wed, 23 Sep 2009 23:10:02 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx03p.mx.bigpond.com with ESMTP id <20090923231001.ILRZ10433.nschwotgx03p.mx.bigpond.com@[10.0.0.8]> for ; Wed, 23 Sep 2009 23:10:01 +0000 Message-ID: <4ABAA8B3.3060306@bigpond.net.au> Date: Thu, 24 Sep 2009 09:01:07 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <4ABA12A2.5060202@hempeldesigngroup.com> In-Reply-To: <4ABA12A2.5060202@hempeldesigngroup.com> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx03p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Wed, 23 Sep 2009 23:10:01 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.4ABAAAC9.00F3,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ralph Hempel wrote:
The thing that broguth me to Lua...

I might just have to steal that word, it still sounds right :)

-- 
Regards,

Benjamin Tolputt
Analyst Programmer
Mob:   0417 456 505
Email: btolputt@bigpond.net.au

This email and any files transmitted with it are confidential to the
intended recipient and may be privileged. If you have received this
email inadvertently or you are not the intended recipient, you may not
disseminate, distribute, copy or in any way rely on it. Further, you
should notify the sender immediately and delete the email from your
computer. Whilst we have taken precautions to alert us to the presence
of computer viruses, we cannot guarantee that this email and any files
transmitted with it are free from such viruses.


From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 20:22:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NNMPOX022576; Wed, 23 Sep 2009 20:22:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED6431A6B7; Wed, 23 Sep 2009 20:21:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas04p.mx.bigpond.com (nschwmtas04p.mx.bigpond.com [61.9.189.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59EFC1A69B for ; Wed, 23 Sep 2009 20:21:41 -0300 (BRT) Received: from nschwotgx02p.mx.bigpond.com ([143.238.91.39]) by nschwmtas04p.mx.bigpond.com with ESMTP id <20090923232140.GDMD3986.nschwmtas04p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com> for ; Wed, 23 Sep 2009 23:21:40 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20090923232139.QHGE4842.nschwotgx02p.mx.bigpond.com@[10.0.0.8]> for ; Wed, 23 Sep 2009 23:21:39 +0000 Message-ID: <4ABAAB65.6030405@bigpond.net.au> Date: Thu, 24 Sep 2009 09:12:37 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: length operator # for tables with metatables References: <20090922202314.GB14358@inf.puc-rio.br> <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> In-Reply-To: <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx02p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Wed, 23 Sep 2009 23:21:39 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150201.4ABAAD83.0106,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Greg Falcon wrote: > But it's been mentioned on this thread already that in 5.2, #t will > respect a __len metamethod. So what you are calling "the real > problem" has already been addressed. > Not quite, I say it "will soon be addressed" for a given definition of "soon". For example, do we have any timeline on the Lua 5.2 release? How long before LuaJIT complies with the Lua 5.2 features? How long before other libraries work with Lua 5.2? And so on. I'm not trying to belittle the fact it is being addressed by the core Lua developers at all (I think that shows they do listen, even if they haven't let anyone know about their plans concerning hexadecimals in strings). But these are all questions that need to be asked by developers in the middle of a project using Lua. Some fix at an undefined date in the future with yet more time needed for support libraries is not something we can rely on given commercial requirements and deadlines. -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 20:57:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8NNupTs026807; Wed, 23 Sep 2009 20:56:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92B7B18AF1; Wed, 23 Sep 2009 20:56:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 756CE18A02 for ; Wed, 23 Sep 2009 20:56:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so1142261fxm.5 for ; Wed, 23 Sep 2009 16:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=O2aJtO8I8Fvi3EEuAkadgdR4zdwGVh4oa7WHxIEopmo=; b=ZQOOuRDsEZ0JqinJzaUIoyvpTpu40pSxFF12e4TdgeWGZXeH1GtCUGz8fcwhWJYesi MalG6GysFxCsmXJ4nXiblfmw9S1z2WuBTJSIEQXe2H4TfvC36B7L2b1pjzF/oSETkdxi 2ymM0R3vw2URc1rb8hJnPC9wuTY5WB6y/yZM0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RpqdKoO+w9OG22iW1UvFvrFcqiFTUdLvgyxnMPffFnsMNLFAPqGyvkcHAd6IvQhInB n7xEPZTq12O53mF92zdLSaMqeryyJtwzhRzg7Wf8qtFyAjPGG+PhKG2F9ohm3w/6Qu2q T3lu4xWLntLociVhjxAycNfnyqI660PLUDiCQ= MIME-Version: 1.0 Received: by 10.223.2.69 with SMTP id 5mr975441fai.88.1253750171837; Wed, 23 Sep 2009 16:56:11 -0700 (PDT) In-Reply-To: <4ABAAB65.6030405@bigpond.net.au> References: <20090922202314.GB14358@inf.puc-rio.br> <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> <4ABAAB65.6030405@bigpond.net.au> Date: Thu, 24 Sep 2009 00:56:11 +0100 Message-ID: Subject: Re: length operator # for tables with metatables From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Sep 24, 2009 at 12:12 AM, Benjamin Tolputt wrote: (snip) > I'm not trying to belittle the fact it is being addressed by the core > Lua developers at all (I think that shows they do listen, even if they > haven't let anyone know about their plans concerning hexadecimals in > strings). It was easy to miss, but Luiz did say at one point the feature was "likely" to be added (for 5.2, presumably): http://lua-users.org/lists/lua-l/2009-06/msg00219.html -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 21:12:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O0CopC028837; Wed, 23 Sep 2009 21:12:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17DE18F56; Wed, 23 Sep 2009 21:12:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17CD218EA5 for ; Wed, 23 Sep 2009 21:12:12 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0194.bmts.com [209.240.125.194]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n8O0C9hG001012 for ; Wed, 23 Sep 2009 20:12:17 -0400 Message-ID: <4ABAB959.5000305@hempeldesigngroup.com> Date: Wed, 23 Sep 2009 20:12:09 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <002a01ca3c26$6c49f350$44ddd9f0$@hind@zen.co.uk> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <4ABA12A2.5060202@hempeldesigngroup.com> <4ABAA8B3.3060306@bigpond.net.au> In-Reply-To: <4ABAA8B3.3060306@bigpond.net.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Benjamin Tolputt wrote: > Ralph Hempel wrote: >> The thing that /*broguth*/ me to Lua... > > I might just have to steal that word, it still /sounds/ right :) Argh. I don't think I'm typing faster than my keyboard can read, but I'm certainly typing faster than I can think. At least all the letters are there, even if they're not in the right place... Ralph From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 21:13:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O0DaQR028938; Wed, 23 Sep 2009 21:13:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1AB0D188A4; Wed, 23 Sep 2009 21:12:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas04p.mx.bigpond.com (nschwmtas04p.mx.bigpond.com [61.9.189.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98AC418EA5 for ; Wed, 23 Sep 2009 21:12:52 -0300 (BRT) Received: from nschwotgx03p.mx.bigpond.com ([143.238.91.39]) by nschwmtas04p.mx.bigpond.com with ESMTP id <20090924001251.KIZJ3986.nschwmtas04p.mx.bigpond.com@nschwotgx03p.mx.bigpond.com> for ; Thu, 24 Sep 2009 00:12:51 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx03p.mx.bigpond.com with ESMTP id <20090924001251.MAUI10433.nschwotgx03p.mx.bigpond.com@[10.0.0.8]> for ; Thu, 24 Sep 2009 00:12:51 +0000 Message-ID: <4ABAB743.2040904@bigpond.net.au> Date: Thu, 24 Sep 2009 10:03:15 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: length operator # for tables with metatables References: <20090922202314.GB14358@inf.puc-rio.br> <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> <4ABAAB65.6030405@bigpond.net.au> In-Reply-To: Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx03p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Thu, 24 Sep 2009 00:12:51 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150202.4ABAB983.00C5,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Duncan Cross wrote:
Benjamin Tolputt wrote:
  
I'm not trying to belittle the fact it is being addressed by the core
Lua developers at all (I think that shows they do listen, even if they
haven't let anyone know about their plans concerning hexadecimals in
strings).
    

It was easy to miss, but Luiz did say at one point the feature was
"likely" to be added (for 5.2, presumably):

http://lua-users.org/lists/lua-l/2009-06/msg00219.html
  

Thanks for that. While I did indeed miss that, it doesn't really fill me with confidence. Given the small size of the patch, the strong show of support for the feature, and the reticence in stating anything in regards to it being officially supported - the word "likely" comes across as less than solid.

It does go to point out my issue with relying on Lua 5.2 to fix problems though. Until such time as the Lua core developers release something showing Lua 5.2 (be it alpha, beta, or release candidate) - we cannot really rely on anything being implemented / fixed / changed. At the very least, we don't know when it will be released and at the other end of the scale, we cannot even be sure if certain features will be implemented at all.

-- 
Regards,

Benjamin Tolputt
Analyst Programmer
From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 22:54:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O1s9HF006620; Wed, 23 Sep 2009 22:54:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F8A31A688; Wed, 23 Sep 2009 22:53:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 175BA1A670 for ; Wed, 23 Sep 2009 22:53:25 -0300 (BRT) Received: by vws32 with SMTP id 32so953767vws.11 for ; Wed, 23 Sep 2009 18:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=S8JGDAH9A2ROtopSqI1DtZzXaa6LenCUAxiFkbUuLtg=; b=wzGW8m4bLqtLmX67oTGTz+znUl2ND/mUCcdTfTi9+yWnjnlWuqXyTx+noEUhkLAnxI Cm3NN18WidOVrpjQx3D/ZakmKB4ICGY+1kSBcoZrGsMdw2JNi3DaayNMcMorvj6G8Ruw 2/n6TWdPcduMH4kVxGe0leBs0nTcYSqthG2Y8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Qdjw4N0yVT65uHU0xwLK710/Y70ziFk7BpJGnn/JyRqEiLFSvYZ8b2TC8uW7OX5vPY jMtfHW42rTex8ankA3KJday6v1aEJK1RaPqIjtLk2GeyXB2zR8Sw4QY1DaQTALNYkl/w dh1i316JYpdHk16gCkPsAqypI64lfX1MbS/DQ= MIME-Version: 1.0 Received: by 10.220.79.131 with SMTP id p3mr4906479vck.22.1253757212411; Wed, 23 Sep 2009 18:53:32 -0700 (PDT) In-Reply-To: <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> Date: Thu, 24 Sep 2009 09:53:32 +0800 Message-ID: <438c11350909231853t6f419b77g91a60147b78bb5d6@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 22, 2009 at 9:42 PM, steve donovan wrote: > On Tue, Sep 22, 2009 at 3:34 PM, pan shizhu wrote: >> IMO python is by far the better language for "first programming >> language" than Lua. > > That may be true, but why? Is it because it has more 'out of the box'? > Yes, python has much more 'out of the box', and has more standard modules (pygtk, pyqt, socket, d-bus, etc.) Python standard libraries are very well documented. In fact, I use lua more than python, but I think python is a better language for "first programming language" because a new programmer should form a good programming habit: correct indent, correct identifier name. From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 23:11:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O2Awd5008507; Wed, 23 Sep 2009 23:10:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C2C01A69B; Wed, 23 Sep 2009 23:10:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA05.emeryville.ca.mail.comcast.net (qmta05.emeryville.ca.mail.comcast.net [76.96.30.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3174191C8 for ; Wed, 23 Sep 2009 23:10:22 -0300 (BRT) Received: from OMTA15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by QMTA05.emeryville.ca.mail.comcast.net with comcast id kRta1c00A1Y3wxoA5SAXLA; Thu, 24 Sep 2009 02:10:31 +0000 Received: from [69.180.134.142] ([69.180.134.142]) by OMTA15.emeryville.ca.mail.comcast.net with comcast id kSAU1c00P34WLAl8bSAVxG; Thu, 24 Sep 2009 02:10:30 +0000 Message-ID: <4ABAD518.4050904@comcast.net> Date: Wed, 23 Sep 2009 21:10:32 -0500 From: Merick User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for GUI toolkit wrapping? References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com> <4ABA8A13.2050202@spellingbeewinnars.org> In-Reply-To: <4ABA8A13.2050202@spellingbeewinnars.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick wrote: >> probably you are saying about different things - Qt itself and Qt/Lua >> binding >> > > Absolutely. I am not criticizing QT or any other toolkit, I am just > wondering if I am going in the wrong direction. I would like to use Lua > with GTK in particular but I am second guessing myself because there > seems like quite a small community around it. I can't understand why? > Why would anyone want to code a GUI in C/C++ if they had something like Lua? > > > IUP uses GTK, and was practically built for Lua: http://www.tecgraf.puc-rio.br/iup/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 23:16:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O2GNpb009104; Wed, 23 Sep 2009 23:16:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55A6D191F2; Wed, 23 Sep 2009 23:15:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp115.rog.mail.re2.yahoo.com (smtp115.rog.mail.re2.yahoo.com [68.142.225.231]) by bazar2.conectiva.com.br (Postfix) with SMTP id C7EA1191E8 for ; Wed, 23 Sep 2009 23:15:48 -0300 (BRT) Received: (qmail 72362 invoked from network); 24 Sep 2009 02:15:55 -0000 Received: from unknown (HELO ?192.168.1.110?) (spell_gooder_now@173.32.14.83 with plain) by smtp115.rog.mail.re2.yahoo.com with SMTP; 24 Sep 2009 02:15:55 -0000 X-YMail-OSG: ryPwYswVM1lM8orUbaS60uZL_q0KKwDpH7AwVx08VklzaUIne_jt_lWIMTlBkCJLNw-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4ABAD62E.4030108@spellingbeewinnars.org> Date: Wed, 23 Sep 2009 22:15:10 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> <438c11350909231853t6f419b77g91a60147b78bb5d6@mail.gmail.com> In-Reply-To: <438c11350909231853t6f419b77g91a60147b78bb5d6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It seems that this thread is mostly focused on what a very motivated would-be-programmer should learn but I think there is something missing, level of fun. My Wife was forced to learn programming in university but she does not know what language they taught her! She hated every second of it but memorized enough to pass each test. She does not even like to see me code now. What would be a good first language that would actually make a reluctant student WANT to learn more? Learning assembly or something might help but it would not be fun. What about learning Lua, then C? or learning PHP, C then Lua etc, etc.. Probably a new student would like: Good documentation Lots of sample code Lots of libraries and they would like to actually have something to show for their efforts in a short time frame. Python was my first. I think it is a great language with lots of offer but after doing a project in PHP for a month it just did not seem like as much fun when I came back to it. It seems a bit ridged to me now. I am actually learning Lua to replace my Python needs. I think that OOP without classes is going to be more fun. Just my 2 cents, be warned I am on the lower level of experience on this list I From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 23:43:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O2hnxE012165; Wed, 23 Sep 2009 23:43:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35F0D18D90; Wed, 23 Sep 2009 23:43:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 504FE18CF4 for ; Wed, 23 Sep 2009 23:43:08 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MqeIb-0001n0-F2 for lua@bazar2.conectiva.com.br; Thu, 24 Sep 2009 04:43:13 +0200 Received: from 66-192-186-101.static.twtelecom.net ([66.192.186.101]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Sep 2009 04:43:13 +0200 Received: from stuart by 66-192-186-101.static.twtelecom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Sep 2009 04:43:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: os.date("%x",2^35) crashing on Windows Date: Wed, 23 Sep 2009 19:42:27 -0700 Lines: 1 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 66-192-186-101.static.twtelecom.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This might make sense as a 32-bit int overflow, but 2^34 works... From lua-bounces@bazar2.conectiva.com.br Wed Sep 23 23:54:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O2sDs5013300; Wed, 23 Sep 2009 23:54:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 133561929D; Wed, 23 Sep 2009 23:53:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E91491926D for ; Wed, 23 Sep 2009 23:53:37 -0300 (BRT) Received: from Stucomet (66-192-186-101.static.twtelecom.net [66.192.186.101]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1MqeSm0zAV-000df5; Wed, 23 Sep 2009 22:53:45 -0400 Message-ID: <7CE11B00E03D40E794AAA218B4407C80@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: os.date("%x",2^35) crashing on Windows Date: Wed, 23 Sep 2009 19:53:17 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-Provags-ID: V01U2FsdGVkX1/qGkGORFFhu/wrzZ7iEi40ptQeGA3sVfo5Wcx 1krTcBHHVkiZopl3oi6KxK4xsY5DDjxTJqK+2eMLoEsNappo3a iANsMsU+wsHBJWeQqAv5rxO79iULOXt X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It starts returning nil around 2^63, but for some range between 2^34 and 2^63-2^9 the Lua for Windows interpreter just crashes (at least on my Windows XP laptop from 2004). -------------------------------------------------- From: "Stuart P.Bentley" Sent: Wednesday, September 23, 2009 P7:42 Newsgroups: gmane.comp.lang.lua.general To: Subject: os.date("%x",2^35) crashing on Windows > This might make sense as a 32-bit int overflow, but 2^34 works... > From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 00:19:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8O3JD1Y016209; Thu, 24 Sep 2009 00:19:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8492192A0; Thu, 24 Sep 2009 00:18:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F0D719295 for ; Thu, 24 Sep 2009 00:18:30 -0300 (BRT) Received: by ewy26 with SMTP id 26so1306705ewy.5 for ; Wed, 23 Sep 2009 20:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=uWHh8T86vS7zmBg3ba1Wp+SUInKspOyaX5e564nfge0=; b=Sl/XusCH1HZKVXC99afY+Dkr639ddY6HzwrLNSZUlQiySmH8vwJHkctzPZ1uUHqkeG SJ5+4puqD7IQlm+sagQmvBRqX5auVeb0RXBY4feJOo+zUNEp+nIfpardjz39VfMc5RM/ Mv1O/m8mFJPuF4XXRkkYOXNz4cqb1P7jjkJM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=m6Gkq3edwSTIFduv8Rim3FBvJ4sdOYNwm+HioNqYvoTPFIq4uP2lLZBZxHmPRHehpZ BwFWDjln0xm/5LMIwAqpKrpQzq2wKpc1Oy1vBPSnjXxUqfP8q5oLRXcuVD/lUrOVqU53 cpY8n8dJRJnrqhTIDNGHv/h3mviFPy/F0aloU= Received: by 10.211.173.11 with SMTP id a11mr3575345ebp.42.1253762317249; Wed, 23 Sep 2009 20:18:37 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.88.107]) by mx.google.com with ESMTPS id 7sm1023509eyb.16.2009.09.23.20.18.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 23 Sep 2009 20:18:36 -0700 (PDT) Message-ID: <4ABAE500.9000505@gmail.com> Date: Thu, 24 Sep 2009 11:18:24 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: os.date("%x",2^35) crashing on Windows References: <7CE11B00E03D40E794AAA218B4407C80@Stucomet> In-Reply-To: <7CE11B00E03D40E794AAA218B4407C80@Stucomet> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stuart P. Bentley wrote: > It starts returning nil around 2^63, but for some range between 2^34 and > 2^63-2^9 the Lua for Windows interpreter just crashes (at least on my > Windows XP laptop from 2004). > > -------------------------------------------------- > From: "Stuart P.Bentley" > Sent: Wednesday, September 23, 2009 P7:42 > Newsgroups: gmane.comp.lang.lua.general > To: > Subject: os.date("%x",2^35) crashing on Windows > >> This might make sense as a 32-bit int overflow, but 2^34 works... Sounds like the Thomas Edison way, 99% perspiration... :-) loslib.c[126]: time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); On MinGW, it's a long, I think. That would be 32 bits. IIRC, the MSVCRT strftime is seriously nutty. For the format string, stick to the primitive ones, you should avoid the fancy ones like %G. You didn't specify exactly how the thingy was compiled, but normally, do assume that Win32 does not follow POSIX. I always stick to a safe or conservative subset of POSIX. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 08:36:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OBaPE8007753; Thu, 24 Sep 2009 08:36:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FEB11A6D3; Thu, 24 Sep 2009 07:34:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D8A4719068 for ; Thu, 24 Sep 2009 07:34:26 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIjnukrUnw6R/2dsb2JhbADWBQmEEgU Received: from ptb-relay01.plus.net ([212.159.14.145]) by relay.pcl-ipout01.plus.net with ESMTP; 24 Sep 2009 11:34:33 +0100 Received: from [80.229.242.93] (helo=iyonix) by ptb-relay01.plus.net with esmtp (Exim) id 1Mqlei-0004ym-Qq for lua@bazar2.conectiva.com.br; Thu, 24 Sep 2009 11:34:33 +0100 Date: Thu, 24 Sep 2009 11:34:28 +0100 From: Gavin Wraith Message-ID: <87cac29f50.wra1th@wra1th.plus.com> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 To: lua@bazar2.conectiva.com.br Subject: Alignment and the Lua VM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: 21c24cfa702387f421c7e0bdcc372c68 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Although the Lua VM instruction codes are 32-bit, they are not word-aligned. On ARM architectures this is regrettable, because VMs with word-aligned 32-bit instructions can be implemented much more efficiently, with one fetch per instruction. I suspect that amending the Lua VM to ensure that the VM instructions are aligned to word boundaries would be a simple matter. Is there any likelihood of such an amendment being incorporated into a future version of Lua? It would be no skin off the noses of other CPU architectures, and it would be nice to think of Lua being yet more efficient on all those embedded devices that use ARM chips. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:05:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OC5gi6013745; Thu, 24 Sep 2009 09:05:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84C6E1A6A8; Thu, 24 Sep 2009 09:04:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout02.plus.net (relay.pcl-ipout02.plus.net [212.159.7.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7F001A674 for ; Thu, 24 Sep 2009 09:04:52 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEABP9ukrUnw6U/2dsb2JhbADWLgmEEgU Received: from fhw-relay07.plus.net ([212.159.14.148]) by relay.pcl-ipout02.plus.net with ESMTP; 24 Sep 2009 13:04:59 +0100 Received: from [80.229.242.93] (helo=iyonix) by fhw-relay07.plus.net with esmtp (Exim) id 1Mqn4F-0002Ye-4X for lua@bazar2.conectiva.com.br; Thu, 24 Sep 2009 13:04:59 +0100 Date: Thu, 24 Sep 2009 13:04:49 +0100 From: Gavin Wraith To: lua@bazar2.conectiva.com.br Message-ID: <3110cb9f50.wra1th@wra1th.plus.com> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 Subject: Re: Alignment and the Lua VM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: b152d0e966c0be75344b7f6257b5994b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Now that I look more carefully, I see that the VM instructions are word-aligned - once they are loaded. It was just that the code dumper hides this, so that inspection of files containing dumped bytecode do not show word-aligned instructions in editors. Sorry for the unnecessary noise. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:10:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OC9lXH015385; Thu, 24 Sep 2009 09:09:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D34AA190DD; Thu, 24 Sep 2009 07:43:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B024019076 for ; Thu, 24 Sep 2009 07:43:13 -0300 (BRT) Received: by ewy26 with SMTP id 26so1544145ewy.5 for ; Thu, 24 Sep 2009 03:43:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.142 with SMTP id 14mr738050weh.188.1253789000347; Thu, 24 Sep 2009 03:43:20 -0700 (PDT) In-Reply-To: <87cac29f50.wra1th@wra1th.plus.com> References: <87cac29f50.wra1th@wra1th.plus.com> Date: Thu, 24 Sep 2009 11:43:20 +0100 X-Google-Sender-Auth: 02900310faebe3d5 Message-ID: Subject: Re: Alignment and the Lua VM From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean As far as I can tell, the prototype code array (where VM instructions are stored) is allocated at whatever alignment the underlying memory allocator gives it. Can you not just pass an allocator to lua_newstate (or lua_setallocf) which returns blocks which are word aligned? On Thu, Sep 24, 2009 at 11:34 AM, Gavin Wraith wrote: > Although the Lua VM instruction codes are 32-bit, they are not > word-aligned. On ARM architectures this is regrettable, because > VMs with word-aligned 32-bit instructions can be implemented > much more efficiently, with one fetch per instruction. I suspect > that amending the Lua VM to ensure that the VM instructions are > aligned to word boundaries would be a simple matter. Is there any > likelihood of such an amendment being incorporated into a future > version of Lua? It would be no skin off the noses of other CPU > architectures, and it would be nice to think of Lua being yet > more efficient on all those embedded devices that use ARM chips. > > -- > Gavin Wraith (gavin@wra1th.plus.com) > Home page: http://www.wra1th.plus.com/ > From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:13:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OCDZx7016284; Thu, 24 Sep 2009 09:13:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94F3C187A1; Thu, 24 Sep 2009 09:13:03 -0300 (BRT) X-Original-To: Lua@bazar2.conectiva.com.br Delivered-To: Lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1313018742 for ; Thu, 24 Sep 2009 09:12:57 -0300 (BRT) Received: by ywh4 with SMTP id 4so1816718ywh.33 for ; Thu, 24 Sep 2009 05:13:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.253.17 with SMTP id a17mr6505790ybi.256.1253794385323; Thu, 24 Sep 2009 05:13:05 -0700 (PDT) From: Phoenix Sol Date: Thu, 24 Sep 2009 07:12:45 -0500 Message-ID: <8a25d01b0909240512x6f267db9qf80e241a9aca39ec@mail.gmail.com> Subject: coxpcall from C API To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Can anyone please explain how to run a coroutine in protected mode from the C API ? This came up on IRC this morning, and has yet to be answered; and I would also like to know how to do it. Thanks. From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:26:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OCQDR8019530; Thu, 24 Sep 2009 09:26:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 358F31A6DC; Thu, 24 Sep 2009 09:25:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF7CA1A6B6 for ; Thu, 24 Sep 2009 09:25:36 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 44C7838496428 for ; Thu, 24 Sep 2009 19:25:44 +0700 (NOVST) Message-ID: <004a01ca3d12$22e29220$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <8a25d01b0909240512x6f267db9qf80e241a9aca39ec@mail.gmail.com> Subject: Re: coxpcall from C API Date: Thu, 24 Sep 2009 19:25:40 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Thu, 24 Sep 2009 19:25:44 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Use lua_resume. ----- Original Message ----- From: "Phoenix Sol" To: "Lua list" Sent: Thursday, September 24, 2009 7:12 PM Subject: coxpcall from C API > Can anyone please explain how to run a coroutine in protected mode > from the C API ? > > This came up on IRC this morning, and has yet to be answered; and I > would also like to know how to do it. > > Thanks. > > From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:38:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OCcOjw022428; Thu, 24 Sep 2009 09:38:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F63418FD6; Thu, 24 Sep 2009 09:37:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3204F18EF0 for ; Thu, 24 Sep 2009 09:37:19 -0300 (BRT) Received: by yxe36 with SMTP id 36so2119213yxe.11 for ; Thu, 24 Sep 2009 05:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=NMnJM+iJWNWTlgUWJYHTITt7eRdeVE8Ig6Pwtgd3B+c=; b=hzX0kxDAu5XZfytvDH8HcVVwDTfsDfB29IQu3QSTkPgjo/XjN/MGxjjQluTCslq7Vv X5pCAuvgqryD93q3Om1nwsqjvV/IFNqxaXGgzxRIiQRTtVWsm6DJft/MTI0LPrWK8wi8 iVF6Dbj3tVcb+5ZQvCb+S3PcDjOhxk3A+zmgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=s3GotAXiyj7v1xy9a8nW6vhjFCdhuIa/qAtFJpRYzw2Z3HKNJIBZWQkoFxg/EujKvn YzHy+D09vxwbF1SyJVt3Bos8Y7yI+zeoV5/KzU5ITgWdtjsFhv5tMGg8vMBYDsJUneIZ 3iHlqx5VeKJOWBARZicGfFiMovV7WNBvZ07Ss= MIME-Version: 1.0 Received: by 10.101.39.6 with SMTP id r6mr4183136anj.166.1253795845810; Thu, 24 Sep 2009 05:37:25 -0700 (PDT) In-Reply-To: <4ABA603D.1030106@eykamp.com> References: <4ED827BE-4288-4751-B401-B8BDFD958620@chester.id.au> <4AB75742.2060907@cowlark.com> <20090923085845.A12895@lua.tecgraf.puc-rio.br> <4ABA5BC4.3030804@eykamp.com> <4ABA603D.1030106@eykamp.com> Date: Thu, 24 Sep 2009 09:37:25 -0300 Message-ID: Subject: Re: Lua Performance questions From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636ed6f8902a8fd047452184a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed6f8902a8fd047452184a Content-Type: text/plain; charset=ISO-8859-1 thanks a lot everybody! It is really nice to get a broad view of these possibilities. I hope all this information could help someone looking for a similar problem. As for me, I will be using the Luiz Henrique de Figueiredo answer, which lets me load and run without even minding about loading everything at the beginning. As posted by Luiz, the solution is the following: int run_script(const char* name) { int rc; lua_getglobal(L,name); if (lua_isnil(L,-1)) { rc=luaL_loadfile(L,name); if (rc!=0) return rc; lua_pushvalue(L,-1); lua_setglobal(L,name); } rc=lua_pcall(L,...); return rc; } 2009/9/23 Christopher Eykamp > Actually, having read others' responses, I now see you were trying to run > an entire script, not just a function, as I initially supposed. > > > Christopher Eykamp wrote: > >> Essentially, yes. Here's a snippet from Bitfighter, a game I'm developing >> that uses Lua scripted robot players. To get a robot's name, I call a >> function in the script called getName(). Here is the code I use: >> >> // Run the getName() function in the bot (will default to the one in >> robot_helper_functions if it's not overwritten by the bot) >> lua_getglobal(L, "getName"); >> >> if (!lua_isfunction(L, -1) || lua_pcall(L, 0, 1, 0)) // Passing 0 >> params, getting one back >> { >> mPlayerName = "Nancy"; >> logError("Robot error retrieving name (%s). Using \"%s\".", >> lua_tostring(L, -1), mPlayerName.getString()); >> } >> else >> { >> mPlayerName = lua_tostring(L, -1); >> lua_pop(L, 1); >> } >> >> I do not claim to be a master at integrating Lua with C++, but there are >> several working examples of working integration in my codebase. You can >> access it via Sourceforge, and the files of most interest will likely be >> robot.cpp and luaLevelGenerator.cpp. >> >> Chris >> >> >> zweifel wrote: >> >>> do you mean I can load a script called "melee.lua" and then call >>> >>> lua_getglobal(L, "melee.lua"); >>> lua_pcall(L, ...); >>> >>> is that it? >>> >>> >>> 2009/9/23 Luiz Henrique de Figueiredo >> lhf@tecgraf.puc-rio.br>> >>> >>> > I see.. so I can load all scripts at the beginning or at least >>> be sure to >>> > load at least one time before calling the function. >>> > >>> > But I have to be sure that every script has a different >>> function_name, >>> > otherwise I would be unable to call it. Is not it? >>> >>> The script itself is an anonymous function. >>> >>> >>> >>> >>> -- >>> God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus >>> >>> http://fog.neopages.org/ >>> >> -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636ed6f8902a8fd047452184a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable thanks a lot everybody! It is really nice to get a broad view of these poss= ibilities. I hope all this information could help someone looking for a sim= ilar problem.

As for me, I will be using the Luiz Henrique de Figue= iredo answer, which lets me load and run without even minding about loading= everything at the beginning.

As posted by Luiz, the solution is the following:

int run_script(const char* name)
{
=A0 =A0 =A0 =A0int rc;
=A0 =A0 =A0 =A0lua_getglobal(L,name);
=A0 =A0 =A0 =A0if (lua_isnil(L,-1))
=A0 =A0 =A0 =A0{
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rc=3DluaL_loadfile(L,name);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (rc!=3D0) return rc;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lua_pushvalue(L,-1);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lua_setglobal(L,name);
=A0 =A0 =A0 =A0}
=A0 =A0 =A0 =A0rc=3Dlua_pcall(L,...);
=A0 =A0 =A0 =A0return rc;
}


2009/9/23 Christopher Eykamp <chris@eykamp.com>= ;
Actually, having read others' responses, I now see you were trying to r= un an entire script, not just a function, as I initially supposed.


Christopher Eykamp wrote:
Essentially, yes. =A0Here's a snippet from Bitfighter, a game I'm d= eveloping that uses Lua scripted robot players. =A0To get a robot's nam= e, I call a function in the script called getName(). =A0Here is the code I = use:

=A0// Run the getName() function in the bot (will default to the one in ro= bot_helper_functions if it's not overwritten by the bot)
=A0lua_getglobal(L, "getName");

=A0if (!lua_isfunction(L, -1) || lua_pcall(L, 0, 1, 0)) =A0 =A0 // Passing= 0 params, getting one back
=A0{
=A0 =A0 mPlayerName =3D "Nancy";
=A0 =A0 logError("Robot error retrieving name (%s). =A0Using \"%= s\".", lua_tostring(L, -1), mPlayerName.getString());
=A0}
=A0else
=A0{
=A0 =A0 mPlayerName =3D lua_tostring(L, -1);
=A0 =A0 lua_pop(L, 1);
=A0}

I do not claim to be a master at integrating Lua with C++, but there are se= veral working examples of working integration in my codebase. =A0You can ac= cess it via Sourceforge, and the files of most interest will likely be robo= t.cpp and luaLevelGenerator.cpp.

Chris


zweifel wrote:
do you mean I can load a script called "melee.lua" and then call<= br>
lua_getglobal(L, "melee.lua");
lua_pcall(L, ...);

is that it?


2009/9/23 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br <mailto:lhf@tecgraf.puc-rio.br>>

=A0 =A0> I see.. so I can load all scripts at the beginning or at least=
=A0 =A0be sure to
=A0 =A0> load at least one time before calling the function.
=A0 =A0>
=A0 =A0> But I have to be sure that every script has a different
=A0 =A0function_name,
=A0 =A0> otherwise I would be unable to call it. Is not it?

=A0 =A0The script itself is an anonymous function.




--
God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.= org/



--
God$ g++ -o= earth earth.cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636ed6f8902a8fd047452184a-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 09:47:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OCktkB024571; Thu, 24 Sep 2009 09:46:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1538D190F9; Thu, 24 Sep 2009 09:46:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53BA21909C for ; Thu, 24 Sep 2009 09:46:18 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 0478F38494BFC for ; Thu, 24 Sep 2009 19:46:26 +0700 (NOVST) Message-ID: <005d01ca3d15$072e68d0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: Subject: Re: os.date("%x",2^35) crashing on Windows Date: Thu, 24 Sep 2009 19:46:25 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Thu, 24 Sep 2009 19:46:26 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Here's what I got: Assertion failed. File: loctim64.c Line: 78 (*ptime <= _MAX__TIME64_T) ----- Original Message ----- From: Stuart P.Bentley To: lua@bazar2.conectiva.com.br Sent: Thursday, September 24, 2009 9:42 AM Subject: os.date("%x",2^35) crashing on Windows This might make sense as a 32-bit int overflow, but 2^34 works... From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 10:34:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ODYiNc001169; Thu, 24 Sep 2009 10:34:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A62E1192D0; Thu, 24 Sep 2009 10:33:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8975192C5 for ; Thu, 24 Sep 2009 10:33:50 -0300 (BRT) Received: by fxm12 with SMTP id 12so1553135fxm.5 for ; Thu, 24 Sep 2009 06:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=TYrqxdoIC4GpGwEx5Z8X+6ajjtzK+m+nF6lQEuh877U=; b=HJ7wZeBG3No0Iai0vpaQYhnspnf6OHHoWZLj+ipEDL/opwE+RwQ4DBtkjy9i7sh2l6 ykEkyj2G1U3zQuEBaHA0lUxajXFaqvER15uQt1Gq2Gzxmr85fN+nva9Z6bE0qkr2W2tp 9iBhaeThnkyw2fLpVLSnCahmqaml6Uny4IxaY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=o2TN4L3e6i9ppcuLPPZi6dKy2g2MhwbzBng0ykkpFmDrfZhYgv172L3/xnoiz1JWm4 Lk0MJUvEFe7Qt+ieMvVl9wExr9Vvn1WMt8SyHhCLYItWptOJKRESqTbKdxgGWAKQmvCd WEkptiISy6e3O2SWiqyW5MzaAP1qIouHWKXBw= MIME-Version: 1.0 Received: by 10.223.144.70 with SMTP id y6mr1284972fau.21.1253799237243; Thu, 24 Sep 2009 06:33:57 -0700 (PDT) From: Jerome Vuarand Date: Thu, 24 Sep 2009 15:33:37 +0200 Message-ID: <89d273ba0909240633m709f7bf7r1d773c7e1021ecc9@mail.gmail.com> Subject: Feature request: allow NULL as last luaL_register parameter To: Lua Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8ODYiNc001169 Hi list, The luaL_register function has two distinct features. One is creating a module like the Lua "module" function (ie. dealing with the global tables and package.loaded). One is registering a set of functions into a table. It is possible to use the second feature without the first by passing NULL as the libname parameter. However it is not possible to have the first feature without the second, ie. creating an empty module. I have a need for that because I'd like to have the module itself be the environment of all the C functions I put in it. To do that I create an empty module, set is as the current environment, and then register all its functions. But to create the empty module I have to pass a pointer to an array with just a terminator in it: static struct luaL_Reg empty[] = { {0, 0}, }; static struct luaL_Reg functions[] = { /* actual module functions */ {0, 0}, }; luaL_register(L, "modname", empty); lua_pushvalue(L, -1); lua_replace(L, LUA_ENVIRONINDEX); luaL_register(L, 0, functions); I don't mind having to call luaL_register twice in that situation. But it would be nice to have luaL_register accept NULL as its last parameter (named "l"). Can I expect something like that in 5.2 ? Or will the module system C API change more significatively ? Jérôme. From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 14:00:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OH0X13017372; Thu, 24 Sep 2009 14:00:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B0C11888A; Thu, 24 Sep 2009 13:59:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A61918866 for ; Thu, 24 Sep 2009 13:59:35 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e21so591682fga.17 for ; Thu, 24 Sep 2009 09:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=OS+CHL76UkVqZNvbvUU4xV0vXf3mVj5ZVoiJuSjaDBU=; b=jyk3gzvE2OUd89cWqd7OkqY5fhpmQpQhfNB/eAMF25SVhWne1i0lTAy67iem8A4nvR +GlrG1nAYHaENgWSfjMjegnMJxmGyg271NC9TJgml6L/cbPQImTemwQDLYGZ2mAfczXI Lso2H9p5y9XEsYG7M3PayvCevTuvCk0ua7ECo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=xaZhgydAjOPoRgZYSWDblU6T3wn5AGXqMPEpzmOpuSfiAYdOFdo3XdRmwYolg6z2eR HJX9FeJzbdfRuNyiRZGArk/sb1gPBhTUIR09IfFsehe/ptVFoolBokuKRQdndgXEB6ao C72SyU9fMsGiBb2ALoBn1+gIYyWUyJ/jMpl1w= Received: by 10.86.195.26 with SMTP id s26mr201853fgf.23.1253811581706; Thu, 24 Sep 2009 09:59:41 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id l19sm286748fgb.10.2009.09.24.09.59.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Sep 2009 09:59:41 -0700 (PDT) Message-Id: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> From: Petite Abeille To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: HTTP q values parser? Date: Thu, 24 Sep 2009 18:59:09 +0200 X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, Does anyone have a parser for HTTP q values (aka RFC 2616 3.9 Quality Values) [1]? E.g.: image/gif, image/jpeg, text/html image/gif;q=1.0, image/jpeg;q=0.8, image/png; q=1.0,*;q=0.1 gzip;q=1.0, identity; q=0.5, *;q=0 Something functionally equivalent to that ListParser: http://svn.sourceforge.net/viewvc/simpleweb/trunk/src/main/java/org/simpleframework/http/parse/ListParser.java?view=markup Thanks in advance. Cheers, PA. [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9 From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 17:48:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OKmRSJ007211; Thu, 24 Sep 2009 17:48:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 924761899C; Thu, 24 Sep 2009 17:47:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDD9D188DA for ; Thu, 24 Sep 2009 17:47:40 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 4BF9F74A53 for ; Thu, 24 Sep 2009 16:47:45 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 24 Sep 2009 16:47:45 -0400 X-Sasl-enc: OFYJn1VnHfOXfCBiPZRmSPY9DOLqns2MGyciayFjOkUT 1253825264 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id E201959F8B for ; Thu, 24 Sep 2009 16:47:44 -0400 (EDT) Date: Thu, 24 Sep 2009 16:47:45 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: next == pairs({})? Message-ID: <20090924204745.GG15957@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In my lua interpreter, the first value returned by pairs({}) is not the same function as is assigned to next. At first I thought this might be because some library I have installed, but I see this behavior also if I uninstall all my lua add-on packages, and also if I start lua with LUA_PATH set to the empty string. > return next function: 0x1x52c600 > return (pairs({})) function: 0x1x52c0e0 Why is that? Is one of these a wrapper around the other? Which wraps the other and what is the wrapper doing? >From a casual inspection of lbaselib.c in the lua sources, I can't figure out why it's happening, either. Even the source looks like the first return value of pairs({}) should be next. I'm using my own build of lua on x86_64 linux, in case that matters. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 17:53:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OKrgrE008263; Thu, 24 Sep 2009 17:53:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C6E81A6C4; Thu, 24 Sep 2009 17:53:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from rzg1.erau.edu (rzg1.erau.edu [155.31.204.38]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83597321B3 for ; Thu, 24 Sep 2009 17:53:06 -0300 (BRT) Received: from mymail.erau.edu (mymail.erau.edu [155.31.204.40]) by rzg1.erau.edu (MOS 3.8.4-GA) with ESMTP id BAX00418; Thu, 24 Sep 2009 16:53:13 -0400 (EDT) Received: (from mymail.erau.edu [70.119.100.122]) by mymail.erau.edu (MOS 3.10.4-GA) with HTTPS/1.1 id APY75504 (AUTH delbu9c1); Thu, 24 Sep 2009 16:53:13 -0400 (EDT) From: Matthew Paul Del Buono Subject: Re: next == pairs({})? To: lua@bazar2.conectiva.com.br X-Mailer: Mirapoint Webmail Direct 3.10.4-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090924165313.APY75504@mymail.erau.edu> Date: Thu, 24 Sep 2009 16:53:13 -0400 (EDT) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >In my lua interpreter, the first value returned by pairs({}) is not the >same function as is assigned to next. Not quite true. >From memory, this is caused by duplicate Lua functions. First, next() is created which is a pushed C function. When you call pairs(), pairs() does not actually query the value of 'next' - - instead, it pushes the C function lua_next, which causes a new Lua function to be created. In essence, we have two distinct Lua values which point to the same C function. -- Matthew P. Del Buono EcoEagles, Embry-Riddle Aeronautical University From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 17:56:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OKuGd1008681; Thu, 24 Sep 2009 17:56:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D250A18A5B; Thu, 24 Sep 2009 17:55:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-311.bluehost.com (outbound-mail-311.bluehost.com [67.222.54.4]) by bazar2.conectiva.com.br (Postfix) with SMTP id A17E418A35 for ; Thu, 24 Sep 2009 17:55:34 -0300 (BRT) Received: (qmail 8456 invoked by uid 0); 24 Sep 2009 20:55:41 -0000 Received: from unknown (HELO host176.hostmonster.com) (74.220.207.176) by outboundproxy6.bluehost.com with SMTP; 24 Sep 2009 20:55:41 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=hoelzro.net; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:X-Identified-User; b=nhWwZy9Uu2vDaXjVaffOPglMeZWxt6gkWQsnI/uyLJJ+prvW1FAD99OgQNQ+sAWb5aqum4myCD/lipqzOR5KSXD8iweoeiTFLVjE4/WBrrSxZy1+Nt3SM07GRjdFHaZR; Received: from [208.70.82.92] (helo=localhost.localdomain) by host176.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MqvLp-0001XK-5X; Thu, 24 Sep 2009 14:55:41 -0600 Date: Thu, 24 Sep 2009 15:55:30 -0500 From: Rob Hoelz To: Lua list Subject: Re: next == pairs({})? Message-ID: <20090924155530.7e53efdb@hoelzro.net> In-Reply-To: <20090924204745.GG15957@vaio.jimpryor.net> References: <20090924204745.GG15957@vaio.jimpryor.net> Organization: N/A X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; i586-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/bE=f_qVcu_mP/PrQ=s=Hh3p"; protocol="application/pgp-signature" X-Identified-User: {2470:host176.hostmonster.com:hoelzron:hoelzro.net} {sentby:smtp auth 208.70.82.92 authed with rob+hoelzro.net} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Sig_/bE=f_qVcu_mP/PrQ=s=Hh3p Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable This is how pairs and next get registered (not verbatim): lua_pushcfunction(L, luaB_next); lua_pushcclosure(L, luaB_pairs, 1); lua_setglobal(L, "pairs"); lua_pushcfunction(L, luaB_next); lua_setglobal(L, "next"); luaB_pairs returns its first upvalue, which is a TValue wrapping luaB_next. _G.next is another TValue, distinct from pairs' upvalue, that also wraps luaB_next. If there were a function tocfunction(f)... tocfunction(pairs) =3D=3D tocfunction(next) would be true. -Rob Am Thu, 24 Sep 2009 16:47:45 -0400 schrieb Jim Pryor : > In my lua interpreter, the first value returned by pairs({}) is not > the same function as is assigned to next. At first I thought this > might be because some library I have installed, but I see this > behavior also if I uninstall all my lua add-on packages, and also if > I start lua with LUA_PATH set to the empty string. >=20 > > return next > function: 0x1x52c600 > > return (pairs({})) > function: 0x1x52c0e0 >=20 > Why is that? Is one of these a wrapper around the other? Which wraps > the other and what is the wrapper doing? >=20 > >From a casual inspection of lbaselib.c in the lua sources, I can't > figure out why it's happening, either. Even the source looks like the > first return value of pairs({}) should be next. >=20 > I'm using my own build of lua on x86_64 linux, in case that matters. >=20 --Sig_/bE=f_qVcu_mP/PrQ=s=Hh3p Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkq73MUACgkQUoGaR6SGEao09gCg0j72Fl8V8UJk/XMbHg2JFwRU JwoAn0G1PsOWQqAYpL3rj4ZFFyFH2Z8m =LFuu -----END PGP SIGNATURE----- --Sig_/bE=f_qVcu_mP/PrQ=s=Hh3p-- From lua-bounces@bazar2.conectiva.com.br Thu Sep 24 18:20:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8OLK6wB012735; Thu, 24 Sep 2009 18:20:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30EAA1A6D1; Thu, 24 Sep 2009 18:19:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDC6F1A666 for ; Thu, 24 Sep 2009 18:19:07 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id DA2E074E7A for ; Thu, 24 Sep 2009 17:19:11 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 24 Sep 2009 17:19:11 -0400 X-Sasl-enc: /fo/Fvu0i6lI6Bkdvn5XY/4yDYzFbtCsUEuIfvDIEzEz 1253827151 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6606559FFE for ; Thu, 24 Sep 2009 17:19:11 -0400 (EDT) Date: Thu, 24 Sep 2009 17:19:11 -0400 From: Jim Pryor To: Lua list Subject: Re: next == pairs({})? Message-ID: <20090924211911.GH15957@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20090924204745.GG15957@vaio.jimpryor.net> <20090924155530.7e53efdb@hoelzro.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090924155530.7e53efdb@hoelzro.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ah I see. Thanks for the quick responses. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 04:53:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8P7rGaL013118; Fri, 25 Sep 2009 04:53:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA7DA18C30; Fri, 25 Sep 2009 04:52:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B50918BED for ; Fri, 25 Sep 2009 04:52:27 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mr5bS-0001Ic-SU for lua@bazar2.conectiva.com.br; Fri, 25 Sep 2009 09:52:30 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Sep 2009 09:52:30 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Sep 2009 09:52:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: HTTP q values parser? Date: Fri, 25 Sep 2009 09:52:44 +0200 Lines: 32 Message-ID: References: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 24/09/2009 18:59, Petite Abeille wrote: > Does anyone have a parser for HTTP q values (aka RFC 2616 3.9 Quality > Values) [1]? > > E.g.: > > image/gif, image/jpeg, text/html > image/gif;q=1.0, image/jpeg;q=0.8, image/png; q=1.0,*;q=0.1 > gzip;q=1.0, identity; q=0.5, *;q=0 > > [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9 I always wondered what is the real usage of these. The reference, which you are kind enough to provide, isn't very helpful. Is that fuzzy logic? :-) My understanding is that it expresses preferences of client about content the server can send, eg. in your example gzip content is preferred, uncompressed is fine, anything else is a no-no. Relatively simple. But the image formats is a bit more perplexing, I never saw a site offering to send Gif OR PNG image depending on browser preferences! :-) I was wondering about the meaning of 0.8 with regard to simple binary 0 vs. 1.0, but I realize these values can be used for sorting. I suppose using simple integers within defined bound would have been too simple... :-D Anyway, I fear I have no direct answer to your question; should I do the job, I suppose I would turn to Lpeg... REs can be OK too, but perhaps it might be hard to handle all cases. Or just a good old finite state machine... -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 05:31:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8P8VdpF016170; Fri, 25 Sep 2009 05:31:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E27591A694; Fri, 25 Sep 2009 05:30:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F2701A684 for ; Fri, 25 Sep 2009 05:30:52 -0300 (BRT) Received: by bwz10 with SMTP id 10so1981679bwz.5 for ; Fri, 25 Sep 2009 01:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XAxDF6A+jQFC5I00yfDJ8rXCuAK1OTJtDKXLxc0NKK0=; b=vWbmZXTZm1s6BZqjifeTfZWOrdJMIBBml0idMc2vbbh4ybJA2sA9uaPvEiVF5CuO/b QjeLtsej+9ynNCJTYjYKysHYo931LHjf1b1x7lfgFRWdsL6p3GmKBiPqNA8akW44hQuY +/Gs71lTXmRRR5d03aGUCS0I9fHyhonOaj2gU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=SriP/egH7ZgAYSD+KwdFjSqQD7N6AUJDwgxeWMFwwuoAVpDQK2ldastEySbUYet+CA Tnd4U2aZOrgRKKHQ4oBvRj7Pv9eOVJOWwXv+ri6vfm2gCTawfTVMK78WjcR1AyDGMV/g EHEG493LnvZgXKJ/7/7uqFmqVBljKRBq51IKY= MIME-Version: 1.0 Received: by 10.204.13.207 with SMTP id d15mr1097757bka.157.1253867459015; Fri, 25 Sep 2009 01:30:59 -0700 (PDT) In-Reply-To: References: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> Date: Fri, 25 Sep 2009 10:30:58 +0200 Message-ID: <98b8086f0909250130r416e0771xa47ad2e53beb2d83@mail.gmail.com> Subject: Re: HTTP q values parser? From: troels knak-nielsen To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Sep 25, 2009 at 9:52 AM, Philippe Lhoste wrote: > On 24/09/2009 18:59, Petite Abeille wrote: >> >> Does anyone have a parser for HTTP q values (aka RFC 2616 3.9 Quality >> Values) [1]? >> >> E.g.: >> >> image/gif, image/jpeg, text/html >> image/gif;q=1.0, image/jpeg;q=0.8, image/png; q=1.0,*;q=0.1 >> gzip;q=1.0, identity; q=0.5, *;q=0 >> >> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9 > > I always wondered what is the real usage of these. The reference, which you > are kind enough to provide, isn't very helpful. Is that fuzzy logic? :-) > > My understanding is that it expresses preferences of client about content > the server can send, eg. in your example gzip content is preferred, That is correct. > uncompressed is fine, anything else is a no-no. Relatively simple. But the > image formats is a bit more perplexing, I never saw a site offering to send > Gif OR PNG image depending on browser preferences! :-) The standard (http) permits this. It's rarely supported though. In fact, you can't even rely on browsers to use it properly - IE is really finicky about which headers it sends and when. Anyway, the general idea is that if a resource (url) can respond with different formats - say text/html and text/plain - the server can compare the Accept header to the list of available formats and pick the best match. The q value is used to weigh the candidates. If two candidates have the same q value, their position in the list is used instead. I don't have a Lua library at hqand, but if you need a reference implementation, I have implemented it for php, here: http://code.google.com/p/konstrukt/source/browse/trunk/lib/konstrukt/konstrukt.inc.php#611 -- troels From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 13:13:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8PGDebx025586; Fri, 25 Sep 2009 13:13:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E67A11A6DE; Fri, 25 Sep 2009 13:12:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DFD11A695 for ; Fri, 25 Sep 2009 13:12:42 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQJ006FOBOGUM40@asmtp013.mac.com> for lua@bazar2.conectiva.com.br; Fri, 25 Sep 2009 09:12:49 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: Subject: Re: HTTP q values parser? Date: Fri, 25 Sep 2009 18:12:16 +0200 References: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 25, 2009, at 9:52 AM, Philippe Lhoste wrote: > I always wondered what is the real usage of these. The reference, > which you are kind enough to provide, isn't very helpful. Is that > fuzzy logic? :-) This is related to the so-called "content negotiation": http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html For example, a browser could send a language preference, e.g.: Accept-Language: en-us,en;q=0.5,fr;q=0.1 In other words, give the content in American English, English, or French, in that order of preference. The "quality" value (e.g. q=0.5) provides a mean to sort the preferences. Another common example would be encoding: Accept-Encoding: gzip,deflate This tell the server that the content can be compressed when sending a response, and that gzip would be preferred over deflate. In any case, will hack something with the string library :D Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 13:14:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8PGESR2025776; Fri, 25 Sep 2009 13:14:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1762C1A6E0; Fri, 25 Sep 2009 13:13:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4067D1A695 for ; Fri, 25 Sep 2009 13:13:50 -0300 (BRT) Received: by bwz10 with SMTP id 10so2277625bwz.5 for ; Fri, 25 Sep 2009 09:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=DBQuZf4JQlCqQMjit/VKBwG0J21zgbgcdDS5NGuTdTs=; b=RY2bjHO03bEfwmlBMVmLuNYUrGxCb80jCSJCPHhUl4NRDxVkC3M8v06bzU+hs8OidH 1/nAdzDixD8j0prdj33HWE3t0QKBWun6O7ejiv8PGeBj3aW8YmKi6z6NqkXzFKBvZQig ANS1HfjqxbOvL2TZPn9ggMID7TGUMH2t5YWgg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=wS/AXU6SArW/6WKuyQcQEbA15ASLWGzf6gQnIFPm0lik6MxNMMcRM/XMcfPhoOtSUo /nb0dk4OXFS0Y3kUgrL2TaOHEwI7Pv5T2OIlZlOf82zRq/M9bUvP8ZAaGfq8tcY422Kf 6EY5JpWHQP/1Q0f7IN4DBDfjw1tuM2FN0U91c= Received: by 10.204.36.210 with SMTP id u18mr286318bkd.19.1253895237771; Fri, 25 Sep 2009 09:13:57 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 13sm1941fks.20.2009.09.25.09.13.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Sep 2009 09:13:56 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <98b8086f0909250130r416e0771xa47ad2e53beb2d83@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: HTTP q values parser? Date: Fri, 25 Sep 2009 18:13:25 +0200 References: <9C167AC1-F6A4-4475-9AF7-25035B50B2EB@gmail.com> <98b8086f0909250130r416e0771xa47ad2e53beb2d83@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 25, 2009, at 10:30 AM, troels knak-nielsen wrote: > I don't have a Lua library at hqand, but if you need a reference > implementation, I have implemented it for php, here: > > http://code.google.com/p/konstrukt/source/browse/trunk/lib/konstrukt/konstrukt.inc.php#611 Thanks for the example. Will take a look. Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 20:39:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8PNdL5F014007; Fri, 25 Sep 2009 20:39:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CC1A187A1; Fri, 25 Sep 2009 20:38:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E56F18743 for ; Fri, 25 Sep 2009 20:38:31 -0300 (BRT) Received: by pxi2 with SMTP id 2so3891381pxi.11 for ; Fri, 25 Sep 2009 16:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=erHRkMYeGInsnbWQ72f9Ix6gWolyW0oWmNqQZVVozzM=; b=b90zVnUT2Hnm0ORQm90mvvYx2NEb7iV6qf+XTBVCBS1NOom0EoBkFZQZXGZyPCZXWo nNYG2IxYeoPw5qx+WhLx8fYNCPJFJi2YNvXwBnhNksPDy7FoItlUmJBfOwglgoIEATHj apGlzBKPWk9z1J0oECTSnGprWk9+qk5QkmzN8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=A78pZKUCHevzMRLTMRTP/PFh5W3C3WNtODWt25HVgZZi87akshoxfafZQYcdK+nUOv uTCuzSo4VOaNn8Gp558OMNVUQjUy7hk8uVIlbxpSSOxbXIUFcByE1rMmkKoUX4q+xrTz D/oYc10SPVhaH48hyRLvvlwR0DBkW2xDwznyg= MIME-Version: 1.0 Received: by 10.142.7.3 with SMTP id 3mr48803wfg.126.1253921918626; Fri, 25 Sep 2009 16:38:38 -0700 (PDT) Date: Fri, 25 Sep 2009 16:38:38 -0700 Message-ID: Subject: The LuaVM implemented in languages other than C From: Anthony Fairchild To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502b089892b1204746f7214 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b089892b1204746f7214 Content-Type: text/plain; charset=ISO-8859-1 Hello All, I've been playing around with the idea of implementing a Lisp-like language that targets the LuaVM. The reasons why I chose the Lua VM are 1) It seems to be faster than several other VMs and 2) The VM has a very minimalistic approach, which makes it very easy to implement. I want my language to run on several platforms that do not support C code, including rich web clients like Flash and Silverlight and game development environments like XNA. I really like the idea of a language being built up from a small core which can be easily implemented anywhere it is not supported. I have started a VM implementation in C#, and it passes many lua unit tests at this point. I can compile lua files using luac and run them in both Silverlight and XNA. I have really only spent a couple of days doing this and I'm surprised at how straightforward this is. Setting my Lisp language idea aside, I was wondering if this VM might be of any value to others, as an alternative way to run Lua code in .NET? I see there is LuaInterface but that doesnt seem to support my requirements because it is a bridge to Lua's C VM. I will probably end up writing a native action script Lua VM as well so I can easily develop games that work in both silverlight and flash. Either that or I could use Lua-Alchemy but I am curious about how a native action script VM would perform against the c->llvm solution that alchemy is using. Any thoughts on this are appreciated. Anthony --00504502b089892b1204746f7214 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello All,

I've been playing around with the idea of implementin= g a Lisp-like language that targets the LuaVM.=A0=A0 The reasons why I chos= e the Lua VM are 1) It seems to be faster than several other VMs and 2) The= VM has a very minimalistic approach, which makes it very easy to implement= . =A0 I want my language to run on several platforms that do not support C = code, including rich web clients like Flash and Silverlight and game develo= pment environments like XNA.=A0=A0 I really like the idea of a language bei= ng built up from a small core which can be easily implemented anywhere it i= s not supported.

I have started a VM implementation in C#, and it passes many lua unit t= ests at this point.=A0 I can compile lua files using luac and run them in b= oth Silverlight and XNA. =A0 I have really only spent a couple of days doin= g this and I'm surprised at how straightforward this is.=A0 Setting my = Lisp language idea aside, I was wondering if this VM might be of any value = to others, as an alternative way to run Lua code in .NET?=A0 I see there is= LuaInterface but that doesnt seem to support my requirements because it is= a bridge to Lua's C VM.

I will probably end up writing a native action script Lua VM as well so= I can easily develop games that work in both silverlight and flash.=A0 Eit= her that or I could use Lua-Alchemy but I am curious about how a native act= ion script VM would perform against the c->llvm solution that alchemy is= using.

Any thoughts on this are appreciated.

Anthony
--00504502b089892b1204746f7214-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 21:02:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q020c8015970; Fri, 25 Sep 2009 21:02:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0792818BCD; Fri, 25 Sep 2009 21:01:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7ACF818BA1 for ; Fri, 25 Sep 2009 21:01:20 -0300 (BRT) Received: from pd5ml2no-ssvc.prod.shaw.ca ([10.0.153.164]) by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 25 Sep 2009 18:01:27 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=jfGbfwL1VLMA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=SdSvEMVhv5My0RkRCqUA:9 a=C8ePuByMUBHuS6J7qTWJh4pZPPwA:4 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd5ml2no-dmz.prod.shaw.ca with SMTP; 25 Sep 2009 18:01:27 -0600 From: Casey Hawthorne To: Lua list Subject: Re: The LuaVM implemented in languages other than C Date: Fri, 25 Sep 2009 17:01:18 -0700 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8Q020c8015970 Hi: You might want to try implementing the LUA VM in Haskell, since Haskell was used to implement Perl 6. Parsers have a lot of abstraction levels which a pure functional language excels at. If you insist on using the .NET platform, you might want to chose F# over C#. Oh! On re-reading your post, it seems like you want to write a language that runs on the LUA VM. Hmmm! >I really like the idea of a language being built up from a small core which >can be easily implemented anywhere it is not supported. You are asking for a small as possible VM and as small as possible language kernel, I believe. Just recently there was an O/S written for embedded applications that was proven correct. Written in a functional style? Implemented in a functional language? You might want to look into that. On Fri, 25 Sep 2009 16:38:38 -0700, you wrote: >Hello All, > >I've been playing around with the idea of implementing a Lisp-like language >that targets the LuaVM. The reasons why I chose the Lua VM are 1) It seems >to be faster than several other VMs and 2) The VM has a very minimalistic >approach, which makes it very easy to implement. I want my language to run >on several platforms that do not support C code, including rich web clients >like Flash and Silverlight and game development environments like XNA. I >really like the idea of a language being built up from a small core which >can be easily implemented anywhere it is not supported. > >I have started a VM implementation in C#, and it passes many lua unit tests >at this point. I can compile lua files using luac and run them in both >Silverlight and XNA. I have really only spent a couple of days doing this >and I'm surprised at how straightforward this is. Setting my Lisp language >idea aside, I was wondering if this VM might be of any value to others, as >an alternative way to run Lua code in .NET? I see there is LuaInterface but >that doesnt seem to support my requirements because it is a bridge to Lua's >C VM. > >I will probably end up writing a native action script Lua VM as well so I >can easily develop games that work in both silverlight and flash. Either >that or I could use Lua-Alchemy but I am curious about how a native action >script VM would perform against the c->llvm solution that alchemy is using. > >Any thoughts on this are appreciated. > >Anthony -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 23:01:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q21sEl026451; Fri, 25 Sep 2009 23:01:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13D3A18687; Fri, 25 Sep 2009 23:01:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C04D18660 for ; Fri, 25 Sep 2009 23:01:02 -0300 (BRT) Received: by pzk38 with SMTP id 38so1153242pzk.11 for ; Fri, 25 Sep 2009 19:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=cYTY8oEKPRQCp6eZjT0zpsjO3bjt7+d1i0dav2VJSJE=; b=TV4ew7tEmqGz4IZlrDz1jG+bQablnqKSRWsMJHZFm6kFB5Ba02v62RV+Z5QF4wVy2G hR9+cu/UkusQKM1rSWdEV8omBP4c3c6ac4k5+c2xiKviuUkFUaZA+UZ59t7YFnGvVj+Q rIOas9xCEI8RL4E3hHqNg/rL9bSW0t+0He0Ag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dbUyuzZmDkMqmNrvIS3vvhQSMjCiaH6WIh+Y/Y+Cht2FeZ4MkboTXaqBq83vpE+4MP VzCBfnWoDVVRN9o9eeEoQ9xJHxSjgSVJyZJ/53KRsS8Aub5x1GOIKH7IZA0tgY9Ux3y0 bsBAw5LRZnMxhPkfDtXnm87oh9cs8+D7SkR9Q= MIME-Version: 1.0 Received: by 10.143.21.41 with SMTP id y41mr58385wfi.209.1253930468028; Fri, 25 Sep 2009 19:01:08 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Sep 2009 19:01:07 -0700 Message-ID: Subject: Re: The LuaVM implemented in languages other than C From: Anthony Fairchild To: Lua list Content-Type: multipart/alternative; boundary=00504502cb241eb3a30474717017 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502cb241eb3a30474717017 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 25, 2009 at 5:01 PM, Casey Hawthorne wrote: > Hi: > > You might want to try implementing the LUA VM in Haskell, since > Haskell was used to implement Perl 6. > > My main goal is to implement a Lua VM where C is unavailable. Right now my main areas of focus are browsers and XNA (for xbox community games). > Parsers have a lot of abstraction levels which a pure functional > language excels at. > > If you insist on using the .NET platform, you might want to chose F# > over C#. > > I wouldn't mind doing it in F# if I had more time to learn the language. The VM as it stands now is about 1200 lines of code and C# 3 is good/functional enough for me to write clean code. > Oh! > > On re-reading your post, it seems like you want to write a language > that runs on the LUA VM. > > Yes, ultimately I want my language to target the Lua VM and I will have portability to any platform that supports it. There are many VMs out there but none of them truly run everywhere and depend on their vendors of a large open source effort to port. I can't run Java on the XNA platform and I can't run C# in Flash. I am looking at the LuaVM as a way for me to make my code portable at only a small cost of reimplementing the Lua VM and the standard library on whatever platform I need. So far the effort to do this in C# is only a couple of days. > Hmmm! > > > >I really like the idea of a language being built up from a small core > which > >can be easily implemented anywhere it is not supported. > > You are asking for a small as possible VM and as small as possible > language kernel, I believe. > > Just recently there was an O/S written for embedded applications that > was proven correct. > Written in a functional style? > Implemented in a functional language? > > You might want to look into that. > > > > On Fri, 25 Sep 2009 16:38:38 -0700, you wrote: > > >Hello All, > > > >I've been playing around with the idea of implementing a Lisp-like > language > >that targets the LuaVM. The reasons why I chose the Lua VM are 1) It > seems > >to be faster than several other VMs and 2) The VM has a very minimalistic > >approach, which makes it very easy to implement. I want my language to > run > >on several platforms that do not support C code, including rich web > clients > >like Flash and Silverlight and game development environments like XNA. I > >really like the idea of a language being built up from a small core which > >can be easily implemented anywhere it is not supported. > > > >I have started a VM implementation in C#, and it passes many lua unit > tests > >at this point. I can compile lua files using luac and run them in both > >Silverlight and XNA. I have really only spent a couple of days doing > this > >and I'm surprised at how straightforward this is. Setting my Lisp > language > >idea aside, I was wondering if this VM might be of any value to others, as > >an alternative way to run Lua code in .NET? I see there is LuaInterface > but > >that doesnt seem to support my requirements because it is a bridge to > Lua's > >C VM. > > > >I will probably end up writing a native action script Lua VM as well so I > >can easily develop games that work in both silverlight and flash. Either > >that or I could use Lua-Alchemy but I am curious about how a native action > >script VM would perform against the c->llvm solution that alchemy is > using. > > > >Any thoughts on this are appreciated. > > > >Anthony > -- > Regards, > Casey > --00504502cb241eb3a30474717017 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Sep 25, 2009 at 5:01 PM, Casey H= awthorne <caseyh@is= tar.ca> wrote:
Hi:

You might want to try implementing the LUA VM in Haskell, since
Haskell was used to implement Perl 6.


My main goal is to implement a Lua VM where C is = unavailable.=A0 Right now my main areas of focus are browsers and XNA (for = xbox community games).
=A0
Parsers have a lot of abstraction levels which a pure functional
language excels at.

If you insist on using the .NET platform, you might want to chose F#
over C#.


I wouldn't mind doing it in F# if I had more = time to learn the language.=A0 The VM as it stands now is about 1200 lines = of code and C# 3 is good/functional enough for me to write clean code.
=A0
Oh!

On re-reading your post, it seems like you want to write a language
that runs on the LUA VM.


Yes, ultimately I want my language to target the = Lua VM and I will have portability to any platform that supports it.=A0 The= re are many VMs out there but none of them truly run everywhere and depend = on their vendors of a large open source effort to port.=A0 I can't run = Java on the XNA platform and I can't run C# in Flash.=A0 I am looking a= t the LuaVM as a way for me to make my code portable at only a small cost o= f reimplementing the Lua VM and the standard library on whatever platform I= need.=A0 So far the effort to do this in C# is only a couple of days.
=A0
Hmmm!


>I really like the idea of a language being built up from a small core w= hich
>can be easily implemented anywhere it is not supported.

You are asking for a small as possible VM and as small as possible language kernel, I believe.

Just recently there was an O/S written for embedded applications that
was proven correct.
Written in a functional style?
Implemented in a functional language?

You might want to look into that.



On Fri, 25 Sep 2009 16:38:38 -0700, you wrote:

>Hello All,
>
>I've been playing around with the idea of implementing a Lisp-like = language
>that targets the LuaVM. =A0 The reasons why I chose the Lua VM are 1) I= t seems
>to be faster than several other VMs and 2) The VM has a very minimalist= ic
>approach, which makes it very easy to implement. =A0 I want my language= to run
>on several platforms that do not support C code, including rich web cli= ents
>like Flash and Silverlight and game development environments like XNA. = =A0 I
>really like the idea of a language being built up from a small core whi= ch
>can be easily implemented anywhere it is not supported.
>
>I have started a VM implementation in C#, and it passes many lua unit t= ests
>at this point. =A0I can compile lua files using luac and run them in bo= th
>Silverlight and XNA. =A0 I have really only spent a couple of days doin= g this
>and I'm surprised at how straightforward this is. =A0Setting my Lis= p language
>idea aside, I was wondering if this VM might be of any value to others,= as
>an alternative way to run Lua code in .NET? =A0I see there is LuaInterf= ace but
>that doesnt seem to support my requirements because it is a bridge to L= ua's
>C VM.
>
>I will probably end up writing a native action script Lua VM as well so= I
>can easily develop games that work in both silverlight and flash. =A0Ei= ther
>that or I could use Lua-Alchemy but I am curious about how a native act= ion
>script VM would perform against the c->llvm solution that alchemy is= using.
>
>Any thoughts on this are appreciated.
>
>Anthony
--
Regards,
Casey

--00504502cb241eb3a30474717017-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 23:09:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q290jM027109; Fri, 25 Sep 2009 23:09:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AA631A685; Fri, 25 Sep 2009 23:08:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 425191866F for ; Fri, 25 Sep 2009 23:08:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so3111719ewy.5 for ; Fri, 25 Sep 2009 19:08:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.12 with SMTP id b12mr185706wef.93.1253930913572; Fri, 25 Sep 2009 19:08:33 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Sep 2009 03:08:33 +0100 X-Google-Sender-Auth: ff3e9a45dd06f389 Message-ID: Subject: Re: The LuaVM implemented in languages other than C From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Sep 26, 2009 at 12:38 AM, Anthony Fairchild wrote: > Setting my Lisp language > idea aside, I was wondering if this VM might be of any value to others, as > an alternative way to run Lua code in .NET? I'm sure that there would be many people who would appreciate a Lua VM in .NET as a simple way of adding Lua to .NET applications without having to call native code. The parser / code generator would also be useful, though I expect that somebody has written a Lua parser / code generator in pure Lua which could be compiled to bytecode and used to give the VM functions like loadstring. From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 23:18:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q2ISvD027964; Fri, 25 Sep 2009 23:18:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 739F318822; Fri, 25 Sep 2009 23:17:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f200.google.com (mail-pz0-f200.google.com [209.85.222.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12F271880B for ; Fri, 25 Sep 2009 23:17:50 -0300 (BRT) Received: by pzk38 with SMTP id 38so1160184pzk.11 for ; Fri, 25 Sep 2009 19:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LXTVBcnY8iFhBwovFZlfXFLPqHMV38fyBRTey9kjfDA=; b=EH0xhPlbs5mm2qM5TLsGZiS+43GLmBNQaVcXIozdQ1k1hP/HpytozRiiHsuTb/pYbk w8DmA+0pMziQlNUh19SxNLTS8voWhwSOphAzMhVVzTmad8Hgck7rb3v8EKcDZ41kcXKp a+U2rQPkaSAVuog/EqPQjH9s2dciqg9YRBXaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=U0JO7bkycM++1tPuHPm8q2s/6pp5Py7qzSbVeTncwWQBwnAVR255gSp4Gurg/j62uQ 8FII/xCqHf8rWFP0ZYBlYLce9S5jwQE0oZhHOzwliZ8+FdIaOFsI6AegRLUS8qhBE7SE 5N2rANzdQCR+E2B6AS6+L7knZ6my34p4uCVYQ= MIME-Version: 1.0 Received: by 10.142.5.29 with SMTP id 29mr65852wfe.75.1253931479955; Fri, 25 Sep 2009 19:17:59 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Sep 2009 19:17:59 -0700 Message-ID: Subject: Re: The LuaVM implemented in languages other than C From: Anthony Fairchild To: Lua list Content-Type: multipart/alternative; boundary=00504502b18f6f7928047471ace3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b18f6f7928047471ace3 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 25, 2009 at 7:08 PM, Peter Cawley wrote: > On Sat, Sep 26, 2009 at 12:38 AM, Anthony Fairchild > wrote: > > Setting my Lisp language > > idea aside, I was wondering if this VM might be of any value to others, > as > > an alternative way to run Lua code in .NET? > > I'm sure that there would be many people who would appreciate a Lua VM > in .NET as a simple way of adding Lua to .NET applications without > having to call native code. The parser / code generator would also be > useful, though I expect that somebody has written a Lua parser / code > generator in pure Lua which could be compiled to bytecode and used to > give the VM functions like loadstring. > Actually, I found this the other day, which is exactly that, Lua in Lua: http://yueliang.luaforge.net/ So in theory I can have a full Lua system in .Net if I can get this code to run in my VM. After I get all of the lua unit tests working I'll give it a try. --00504502b18f6f7928047471ace3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Sep 25, 2009 at 7:08 PM, Peter C= awley <lua@corsix.or= g> wrote:
On Sat, Sep 26, 2009 at 12:38 AM, Anthony Fairchild
<fairchild.anthony@gmail.= com> wrote:
> Setting my Lisp language
> idea aside, I was wondering if this VM might be of any value to others= , as
> an alternative way to run Lua code in .NET?

I'm sure that there would be many people who would appreciate a L= ua VM
in .NET as a simple way of adding Lua to .NET applications without
having to call native code. The parser / code generator would also be
useful, though I expect that somebody has written a Lua parser / code
generator in pure Lua which could be compiled to bytecode and used to
give the VM functions like loadstring.

Actually, I found this the other day, which is exact= ly that, Lua in Lua:

http:= //yueliang.luaforge.net/

So in theory I can have a full Lua syst= em in .Net if I can get this code to run in my VM.=A0 After I get all of th= e lua unit tests working I'll give it a try.


--00504502b18f6f7928047471ace3-- From lua-bounces@bazar2.conectiva.com.br Fri Sep 25 23:44:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q2iNJB029984; Fri, 25 Sep 2009 23:44:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE6EE18A25; Fri, 25 Sep 2009 23:43:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DFC51897B for ; Fri, 25 Sep 2009 23:43:41 -0300 (BRT) Received: (qmail 7749 invoked by uid 399); 25 Sep 2009 20:43:48 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 25 Sep 2009 20:43:48 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4ABD7FE1.8090906@workspacewhiz.com> Date: Fri, 25 Sep 2009 20:43:45 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The LuaVM implemented in languages other than C References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Anthony Fairchild Date: 9/25/2009 8:01 PM > My main goal is to implement a Lua VM where C is unavailable. Right > now my main areas of focus are browsers and XNA (for xbox community > games). Why can't you compile Lua as C code using the /clr switch? It works for me... Josh From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 00:01:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q31RZP032325; Sat, 26 Sep 2009 00:01:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C53A1A6A1; Sat, 26 Sep 2009 00:00:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 010EB1845D for ; Sat, 26 Sep 2009 00:00:52 -0300 (BRT) Received: from pd6ml2no-ssvc.prod.shaw.ca ([10.0.153.163]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 25 Sep 2009 21:01:00 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=jfGbfwL1VLMA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=4_hgMoTe5FIYFoOft4wA:9 a=BQHl047LEqnqF31BsyUt8-00o58A:4 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd6ml2no-dmz.prod.shaw.ca with SMTP; 25 Sep 2009 21:01:00 -0600 From: Casey Hawthorne To: Lua list Subject: Re: The LuaVM implemented in languages other than C Date: Fri, 25 Sep 2009 20:01:12 -0700 Message-ID: <7t0rb51vehe8ojdqvjbk6ks6ogrjucvvo4@4ax.com> References: <4ABD7FE1.8090906@workspacewhiz.com> In-Reply-To: <4ABD7FE1.8090906@workspacewhiz.com> X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8Q31RZP032325 I imagine he means that no C compiler is available for the platform(s) he is thinking of. I wonder what C cross-compilers there are. On Fri, 25 Sep 2009 20:43:45 -0600, you wrote: >----- Original Message ----- >From: Anthony Fairchild >Date: 9/25/2009 8:01 PM >> My main goal is to implement a Lua VM where C is unavailable. Right >> now my main areas of focus are browsers and XNA (for xbox community >> games). >Why can't you compile Lua as C code using the /clr switch? It works for >me... > >Josh -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 00:31:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q3V2jL002343; Sat, 26 Sep 2009 00:31:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7993618644; Sat, 26 Sep 2009 00:30:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 101BF1860A for ; Sat, 26 Sep 2009 00:30:17 -0300 (BRT) Received: by qyk4 with SMTP id 4so2443254qyk.33 for ; Fri, 25 Sep 2009 20:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=W5LnaOG/BbvTguTKJwXdcKUDqDAfQ5Tw21EpvMsJObo=; b=E2JgJveLkax4ftZvr5ETM0ThktvyIkMjGZuZMQk6f6sTlfzGVpSDfbaRgdei1ZUhZt hExFGsQsynV0CkArWRZWE598k3mnffbiQ+dTepUdluV97ZeXHUvprfHOs/g6JyUCKXsC 8AZqjvAruXKdVlNs+vwjs5e2BOmtdebsJ66B4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=P/Ag3bJK7nVvvbM0drZJ96V3NCY21HqPE8DCssCGgU7KQO1sRuBZ1fnD0zHn10IBQa uB/4JsZiegjt6fxxvC8/Zgv0ntSSwYe5ayKzHLnYkLHalDlBUrcTWyJTe4r903w1dY1T vOsymKNW4JVd3m0MIUWXqCeDwIAf9uyP2CBQ0= MIME-Version: 1.0 Received: by 10.224.5.135 with SMTP id 7mr1025536qav.148.1253935827334; Fri, 25 Sep 2009 20:30:27 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Sep 2009 00:30:27 -0300 X-Google-Sender-Auth: 04bb51d4ad02d669 Message-ID: <7913df4d0909252030l54883dd0q6e2e77c42df92b5d@mail.gmail.com> Subject: Re: The LuaVM implemented in languages other than C From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8Q3V2jL002343 Hi, Anthony, On Fri, Sep 25, 2009 at 8:38 PM, Anthony Fairchild wrote: > Hello All, > > I've been playing around with the idea of implementing a Lisp-like language > that targets the LuaVM.   The reasons why I chose the Lua VM are 1) It seems > to be faster than several other VMs and 2) The VM has a very minimalistic > approach, which makes it very easy to implement.   I want my language to run > on several platforms that do not support C code, including rich web clients > like Flash and Silverlight and game development environments like XNA.   I > really like the idea of a language being built up from a small core which > can be easily implemented anywhere it is not supported. > > I have started a VM implementation in C#, and it passes many lua unit tests > at this point. I can compile lua files using luac and run them in both > Silverlight and XNA. I have really only spent a couple of days doing this > and I'm surprised at how straightforward this is. Setting my Lisp language > idea aside, I was wondering if this VM might be of any value to others, as > an alternative way to run Lua code in .NET? I see there is LuaInterface but > that doesnt seem to support my requirements because it is a bridge to Lua's > C VM. > The core of the VM itself is very straightforward, and the binary Lua bytecode format is very easy to parse. And the source of the interpreter is such a joy to read. :-) I am curious on how much of the support code, like the implementation of tables, have you already implemented; have you done a C# port of the C implementation (like I did for Lua tables) or are you just using a CLR hashtable? You should be able to reuse several parts of LuaInterface's code if you wish to let Lua code running in your interpreter access other parts of the CLR. Most of the work (not hard, but a quite a lot of work) in doing a Lua interpreter in another language is in porting the "extended" standard library, which kind of includes third-party C libraries like LuaSocket, LuaFileSystem, LPEG etc. It won't definitely be as fast as the native Lua interpreter, but I guess that goes without saying. :-) Should be enough for a lot of uses, though, as there are people using interpreted Lua in J2ME in much more constrained environments than an XBox 360. Straightforward compilation of Lua code to the CLR (using the same optimizations for tables that Lua has) is about as fast as the Lua interpreter, if you are curious. -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 00:35:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q3ZKOT002764; Sat, 26 Sep 2009 00:35:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B974186A9; Sat, 26 Sep 2009 00:34:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0810F1860A for ; Sat, 26 Sep 2009 00:34:42 -0300 (BRT) Received: by pzk29 with SMTP id 29so1080653pzk.33 for ; Fri, 25 Sep 2009 20:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=o7GQ3FbvCremym49bLGI4n+qxwuz/RI2ddvFVQ1olU8=; b=w7VY02/ztbMewavtA0dUPGDQ5hStbKubYoKSJMTgdj/Q9WwhPrV8x+c5Cf+mYGThnF kMuk4sZZSGFMukr8t2wV5nFPl/tlSgQAV9a5i62Oe9KorUbjiln2NiC1FazWJAyrQxEW 57AK8D4Pg3nFJen2ITNNI3MqMFz8/fjpZOI78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Bgq7o6HddKpDNje9g5gjeiKN8mMcA0OwO55tUetM6I90AYRh77Ho8ILLNDi2YcwHe6 kzltGxpEzSu3/hsEsxlunqIwfALjwQY8Nyc2KoPNtqugHz42vy33PMebNGgLp3m/XZXf n5KxpLECR8W1fdl6Vw1R26v585GaKPrl/d8GM= MIME-Version: 1.0 Received: by 10.143.21.41 with SMTP id y41mr63179wfi.209.1253936091487; Fri, 25 Sep 2009 20:34:51 -0700 (PDT) In-Reply-To: <4ABD7FE1.8090906@workspacewhiz.com> References: <4ABD7FE1.8090906@workspacewhiz.com> Date: Fri, 25 Sep 2009 20:34:51 -0700 Message-ID: Subject: Re: The LuaVM implemented in languages other than C From: Anthony Fairchild To: Lua list Content-Type: multipart/alternative; boundary=00504502cb244ddf25047472bf06 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502cb244ddf25047472bf06 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 25, 2009 at 7:43 PM, Joshua Jensen wrote: > ----- Original Message ----- > From: Anthony Fairchild > Date: 9/25/2009 8:01 PM > >> My main goal is to implement a Lua VM where C is unavailable. Right now >> my main areas of focus are browsers and XNA (for xbox community games). >> > Why can't you compile Lua as C code using the /clr switch? It works for > me... > > I'm not sure that will work for Silverlight or XNA because /clr still accesses unmanaged c libraries underneath. Have you been able to get it to work on Silverlight or XNA? --00504502cb244ddf25047472bf06 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Sep 25, 2009 at 7:43 PM, Joshua Jensen <jjensen@workspacewhiz.com> wrote:
----- Original Message -----
From: Anthony Fairchild
Date: 9/25/2009 8:01 PM
My main goal is to implement a Lua VM where C is unavailable. =A0Right now = my main areas of focus are browsers and XNA (for xbox community games).
Why can't you compile Lua as C code using the /clr switch? =A0It works = for me...


I'm not sure that will work for S= ilverlight or XNA because /clr still accesses unmanaged c libraries underne= ath.=A0 Have you been able to get it to work on Silverlight or XNA?


--00504502cb244ddf25047472bf06-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 00:54:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q3rxcp004374; Sat, 26 Sep 2009 00:54:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14C041A697; Sat, 26 Sep 2009 00:53:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36EFB1A5E7 for ; Sat, 26 Sep 2009 00:53:22 -0300 (BRT) Received: by ywh4 with SMTP id 4so3413634ywh.33 for ; Fri, 25 Sep 2009 20:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=aEdO1JSkrM5M5Y8pXAMszw4gBkjskarxINPf42YNqZ4=; b=K8QJR7XYetQmGMlMw9cF/PdChfXrZ4I1X7ewPyY1UDtWpw6QDXdQNFqfs51WCcEROP UasS0I61abI0jGT7/HpVDkGSx6O6Cg9EOEM3giIsTP6qPpJ4qJIQ/I5NGKBficqaUNnx qiPG8PoicxYWzKr93I/Z7M6NsbjLTkRqinVgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=nfbN61bEztRPZuKU4I9lJBuAXo0e4JGaakRgu7LIMDQgecBma8uGHRrza2pGTyX+VM u4q5t8u8TqFN5xXtWeMmHI3jU7ahOJx72essLcDMdQynhH7lyjfH3+8dPBUIwgkRSyy5 6jJoFmuzdik2F1zKukIJ/PgHlQ/WrCELG2ZDw= Received: by 10.150.100.9 with SMTP id x9mr3743208ybb.203.1253937210401; Fri, 25 Sep 2009 20:53:30 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.232.242]) by mx.google.com with ESMTPS id 23sm1911172ywh.7.2009.09.25.20.53.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Sep 2009 20:53:29 -0700 (PDT) Message-ID: <4ABD902C.4070801@gmail.com> Date: Sat, 26 Sep 2009 11:53:16 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: The LuaVM implemented in languages other than C References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Anthony Fairchild wrote: > On Fri, Sep 25, 2009 at 7:08 PM, Peter Cawley wrote: > > On Sat, Sep 26, 2009 at 12:38 AM, Anthony Fairchild wrote: > > Setting my Lisp language > > idea aside, I was wondering if this VM might be of any value to > others, as > > an alternative way to run Lua code in .NET? > > I'm sure that there would be many people who would appreciate a Lua VM > in .NET as a simple way of adding Lua to .NET applications without > having to call native code. The parser / code generator would also be > useful, though I expect that somebody has written a Lua parser / code > generator in pure Lua which could be compiled to bytecode and used to > give the VM functions like loadstring. > > Actually, I found this the other day, which is exactly that, Lua in Lua: > > http://yueliang.luaforge.net/ W.r.t. to Yueliang, I haven't done the runtime/backend, but there is a Lua runtime by a Japanese developer. (The project name escapes me a.t.m. but it's in the mail archives.) > So in theory I can have a full Lua system in .Net if I can get this code > to run in my VM. After I get all of the lua unit tests working I'll > give it a try. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 01:07:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q47igK005589; Sat, 26 Sep 2009 01:07:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7999D1A6B3; Sat, 26 Sep 2009 01:07:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f191.google.com (mail-pz0-f191.google.com [209.85.222.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 807101A5E7 for ; Sat, 26 Sep 2009 01:06:55 -0300 (BRT) Received: by pzk29 with SMTP id 29so1093232pzk.33 for ; Fri, 25 Sep 2009 21:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BylENtjm+EnoafEjlDpN3diZbCClkdFMIUBthPbjTNg=; b=eUVwhYaaHOhoz4DFQGRjNRaOHdwV2Cn3sf7FFct2cn2qGlxrVl8xhRYR3+VZ3BmjsI MYK2xOww726ib78TIFNJeB1OnpmyXkkaWubLG87mddtg/RJMeaTRNWpoCXddOMWbbuyQ ZWNrM6brBLFEcVeAVi2yrBRBVu2XpMeHtb/FM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ss6NGYZOrvfJ0A6D3QFnEoo51oCWncw3twEJYGvNpNk4H3j2qpcQAiMGQQzvMEwKi+ XUI7UTuqpivxQZzRbcf5lcUUwz9PDpqJtd5HXAZYP0OjiR+jG+5v/TBItQIosRCZrjM8 HBCP1SW+CLlGjDw4FA37u5FazOgzMGyUWwcZU= MIME-Version: 1.0 Received: by 10.142.2.38 with SMTP id 38mr64655wfb.94.1253938023389; Fri, 25 Sep 2009 21:07:03 -0700 (PDT) In-Reply-To: <7913df4d0909252030l54883dd0q6e2e77c42df92b5d@mail.gmail.com> References: <7913df4d0909252030l54883dd0q6e2e77c42df92b5d@mail.gmail.com> Date: Fri, 25 Sep 2009 21:07:03 -0700 Message-ID: Subject: Re: The LuaVM implemented in languages other than C From: Anthony Fairchild To: Lua list Content-Type: multipart/alternative; boundary=001636b2bbfe745a8804747332bc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2bbfe745a8804747332bc Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 25, 2009 at 8:30 PM, Fabio Mascarenhas wrote: > Hi, Anthony, > > On Fri, Sep 25, 2009 at 8:38 PM, Anthony Fairchild > wrote: > > Hello All, > > > > I've been playing around with the idea of implementing a Lisp-like > language > > that targets the LuaVM. The reasons why I chose the Lua VM are 1) It > seems > > to be faster than several other VMs and 2) The VM has a very minimalistic > > approach, which makes it very easy to implement. I want my language to > run > > on several platforms that do not support C code, including rich web > clients > > like Flash and Silverlight and game development environments like XNA. > I > > really like the idea of a language being built up from a small core which > > can be easily implemented anywhere it is not supported. > > > > I have started a VM implementation in C#, and it passes many lua unit > tests > > at this point. I can compile lua files using luac and run them in both > > Silverlight and XNA. I have really only spent a couple of days doing > this > > and I'm surprised at how straightforward this is. Setting my Lisp > language > > idea aside, I was wondering if this VM might be of any value to others, > as > > an alternative way to run Lua code in .NET? I see there is LuaInterface > but > > that doesnt seem to support my requirements because it is a bridge to > Lua's > > C VM. > > > > The core of the VM itself is very straightforward, and the binary Lua > bytecode format is very easy to parse. And the source of the > interpreter is such a joy to read. :-) The lua source is very well written. Some of the best C code I've seen in a while. Even the heavily optimized parts are easy to read. > I am curious on how much of the > support code, like the implementation of tables, have you already > implemented; have you done a C# port of the C implementation (like I > did for Lua tables) or are you just using a CLR hashtable? > > I was planning on only implementing the standard library, or at least the parts I need, like i/o. I have not implemented the Lua-style tables. Just using hashtables but I do support metatables. This is really a placeholder tho for the real thing. I'll have to take a look at your Lua tables implementation. > You should be able to reuse several parts of LuaInterface's code if > you wish to let Lua code running in your interpreter access other > parts of the CLR. > > I'll take a look at the LuaInterface code. At the moment the library functions are implemented using a simple delegate Func _function; So the print library function looks like this: public static TValue[] Print(TValue[] parms) { // TODO: probably not a proper print, but it works for now! Console.Out.WriteLine(String.Join("\t", parms.Select(o => o.ToString()).ToArray())); return null; } I'm sure there are better ways to do this, like using reflection. > Most of the work (not hard, but a quite a lot of work) in doing a Lua > interpreter in another language is in porting the "extended" standard > library, which kind of includes third-party C libraries like > LuaSocket, LuaFileSystem, LPEG etc. > > I'm not that concerned about the extended libraries. For example, I have a sprite library that works in both Silverlight and XNA. I would just write my own lua library around this for doing the rendering and then write the game logic in Lua. I would implement libraries like this as needed. > It won't definitely be as fast as the native Lua interpreter, but I > guess that goes without saying. :-) Should be enough for a lot of > uses, though, as there are people using interpreted Lua in J2ME in > much more constrained environments than an XBox 360. Straightforward > compilation of Lua code to the CLR (using the same optimizations for > tables that Lua has) is about as fast as the Lua interpreter, if you > are curious. > I am less concerned about speed and more interested in portability. Maybe I am a little too optimistic about the speed but I can always implement the bottlenecks in the native language. A LuaVM byte code to CIL is not a bad idea either and can be done if speed ever becomes a real issue. Thanks for your comments! > > -- > Fabio Mascarenhas, Lablua > http://www.lua.inf.puc-rio.br > --001636b2bbfe745a8804747332bc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Sep 25, 2009 at 8:30 PM, Fabio M= ascarenhas <mas= carenhas@acm.org> wrote:
Hi, Anthony,

On Fri, Sep 25, 2009 at 8:38 PM, Anthony Fairchild
> Hello All,
>
> I've been playing around with the idea of implementing a Lisp-like= language
> that targets the LuaVM.=A0=A0 The reasons why I chose the Lua VM are 1= ) It seems
> to be faster than several other VMs and 2) The VM has a very minimalis= tic
> approach, which makes it very easy to implement. =A0 I want my languag= e to run
> on several platforms that do not support C code, including rich web cl= ients
> like Flash and Silverlight and game development environments like XNA.= =A0=A0 I
> really like the idea of a language being built up from a small core wh= ich
> can be easily implemented anywhere it is not supported.
>
> I have started a VM implementation in C#, and it passes many lua unit = tests
> at this point. =A0I can compile lua files using luac and run them in b= oth
> Silverlight and XNA. =A0 I have really only spent a couple of days doi= ng this
> and I'm surprised at how straightforward this is. =A0Setting my Li= sp language
> idea aside, I was wondering if this VM might be of any value to others= , as
> an alternative way to run Lua code in .NET? =A0I see there is LuaInter= face but
> that doesnt seem to support my requirements because it is a bridge to = Lua's
> C VM.
>

The core of the VM itself is very straightforward, and the binary Lua=
bytecode format is very easy to parse. And the source of the
interpreter is such a joy to read. :-)

The lua source= is very well written.=A0 Some of the best C code I've seen in a while.= =A0 Even the heavily optimized parts are easy to read.
=A0
I am cu= rious on how much of the
support code, like the implementation of tables, have you already
implemented; have you done a C# port of the C implementation (like I
did for Lua tables) or are you just using a CLR hashtable?


I was planning on only implementing the standard = library, or at least the parts I need, like i/o.=A0 I have not implemented = the Lua-style tables.=A0 Just using hashtables but I do support metatables.= =A0 This is really a placeholder tho for the real thing.=A0=A0 I'll hav= e to take a look at your Lua tables implementation.
=A0
You should be able to reuse several parts of LuaInterface's code if
you wish to let Lua code running in your interpreter access other
parts of the CLR.


I'll take a look at the LuaInterface code.=A0= At the moment the library functions are implemented using a simple delegat= e

=A0=A0=A0=A0=A0=A0=A0 Func<TValue[], TValue[]> _function;
So the print library function looks like this:

=A0=A0=A0=A0=A0=A0=A0 public static TValue[] Print(TValue[] parms)
= =A0=A0=A0=A0=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 // TODO: proba= bly not a proper print, but it works for now!
=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 Console.Out.WriteLine(String.Join("\t", parms.Select(o = =3D> o.ToString()).ToArray()));
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return null;
=A0=A0=A0=A0=A0=A0=A0 }
I'm sure there are better ways to do this, like using reflection.=
=A0
Most of the work (not hard, but a quite a lot of work) in doing a Lua
interpreter in another language is in porting the "extended" stan= dard
library, which kind of includes third-party C libraries like
LuaSocket, LuaFileSystem, LPEG etc.


I'm not that concerned about the extended lib= raries. For example, I have a sprite library that works in both Silverlight= and XNA.=A0 I would just write my own lua library around this for doing th= e rendering and then write the game logic in Lua.=A0=A0 I would implement l= ibraries like this as needed.
=A0
It won't definitely be as fast as the native Lua interpreter, but I
guess that goes without saying. :-) Should be enough for a lot of
uses, though, as there are people using interpreted Lua in J2ME in
much more constrained environments than an XBox 360. Straightforward
compilation of Lua code to the CLR (using the same optimizations for
tables that Lua has) is about as fast as the Lua interpreter, if you
are curious.

I am less concerned about speed and m= ore interested in portability.=A0=A0 Maybe I am a little too optimistic abo= ut the speed but I can always implement the bottlenecks in the native langu= age.=A0 A LuaVM byte code to CIL is not a bad idea either and can be done i= f speed ever becomes a real issue.

Thanks for your comments!
=A0

--
Fabio Mascarenhas, Lablua
http://www.lua.= inf.puc-rio.br

--001636b2bbfe745a8804747332bc-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 05:08:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8Q87sWF023270; Sat, 26 Sep 2009 05:07:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA3418846; Sat, 26 Sep 2009 05:07:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAF0A1881C for ; Sat, 26 Sep 2009 05:07:08 -0300 (BRT) Received: by fxm12 with SMTP id 12so2982919fxm.5 for ; Sat, 26 Sep 2009 01:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Dk+/YeXMBgWmH495Ye3UIepwnXZQCe6ci4pXJyM7rVI=; b=OxSsoxOqXFBU64ZyNBA2UOjMTHkBwwyZvs4ElW3JgUm+jVYDKbaXF+nws19iYs0tah //TZmVQAOUX41ahFqlDKpiEs78FvMGP04hK6TEvioR3xxyuGYNWymQ+iyJDm3H2eQPIk 7foZtHqUURoMwyJfEik80uhvBU/Wwn2TN3hDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iTNa2nhzwVY6PfrETPsPqVInBalLwU/+s6pacQhzs2XYVrlsL9EupKU2owZjSN/bQa sZsKLg8c26H2AVhy/zoasPEgys0t3YdmILU4q7Jnte3NWK+t6G83LlWNAiNwgLMBgWmK AvBPk66dAOa+IfER70YykV4KIlDkr/fLbXBI0= MIME-Version: 1.0 Received: by 10.204.34.205 with SMTP id m13mr928243bkd.80.1253952436268; Sat, 26 Sep 2009 01:07:16 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Sep 2009 10:07:16 +0200 Message-ID: <13af99c70909260107x2845c479k9e149ccaa9d09cc6@mail.gmail.com> Subject: Re: The LuaVM implemented in languages other than C From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=00032555472a87709c0474768d76 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555472a87709c0474768d76 Content-Type: text/plain; charset=ISO-8859-1 Since C# is fairly similar to Java, you may want to take a look at either LuaJ or Kahlua. I have a feeling they would be fairly simple to port to C# As a side note, I also spent a few days getting a working VM together (which was surprisingly easy) and then spent a few more months getting all the small details and standard libraries right. On Sat, Sep 26, 2009 at 1:38 AM, Anthony Fairchild < fairchild.anthony@gmail.com> wrote: > Hello All, > > I've been playing around with the idea of implementing a Lisp-like language > that targets the LuaVM. The reasons why I chose the Lua VM are 1) It seems > to be faster than several other VMs and 2) The VM has a very minimalistic > approach, which makes it very easy to implement. I want my language to run > on several platforms that do not support C code, including rich web clients > like Flash and Silverlight and game development environments like XNA. I > really like the idea of a language being built up from a small core which > can be easily implemented anywhere it is not supported. > > I have started a VM implementation in C#, and it passes many lua unit tests > at this point. I can compile lua files using luac and run them in both > Silverlight and XNA. I have really only spent a couple of days doing this > and I'm surprised at how straightforward this is. Setting my Lisp language > idea aside, I was wondering if this VM might be of any value to others, as > an alternative way to run Lua code in .NET? I see there is LuaInterface but > that doesnt seem to support my requirements because it is a bridge to Lua's > C VM. > > I will probably end up writing a native action script Lua VM as well so I > can easily develop games that work in both silverlight and flash. Either > that or I could use Lua-Alchemy but I am curious about how a native action > script VM would perform against the c->llvm solution that alchemy is using. > > Any thoughts on this are appreciated. > > Anthony > --00032555472a87709c0474768d76 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Since C# is fairly similar to Java, you may want to take a look at either L= uaJ or Kahlua. I have a feeling they would be fairly simple to port to C#
As a side note, I also spent a few days getting a working VM together= (which was surprisingly easy) and then spent a few more months getting all= the small details and standard libraries right.

On Sat, Sep 26, 2009 at 1:38 AM, Anthony Fai= rchild <fairchild.anthony@gmail.com> wrote:
Hello All,

I've been playing around with the idea of implementin= g a Lisp-like language that targets the LuaVM.=A0=A0 The reasons why I chos= e the Lua VM are 1) It seems to be faster than several other VMs and 2) The= VM has a very minimalistic approach, which makes it very easy to implement= . =A0 I want my language to run on several platforms that do not support C = code, including rich web clients like Flash and Silverlight and game develo= pment environments like XNA.=A0=A0 I really like the idea of a language bei= ng built up from a small core which can be easily implemented anywhere it i= s not supported.

I have started a VM implementation in C#, and it passes many lua unit t= ests at this point.=A0 I can compile lua files using luac and run them in b= oth Silverlight and XNA. =A0 I have really only spent a couple of days doin= g this and I'm surprised at how straightforward this is.=A0 Setting my = Lisp language idea aside, I was wondering if this VM might be of any value = to others, as an alternative way to run Lua code in .NET?=A0 I see there is= LuaInterface but that doesnt seem to support my requirements because it is= a bridge to Lua's C VM.

I will probably end up writing a native action script Lua VM as well so= I can easily develop games that work in both silverlight and flash.=A0 Eit= her that or I could use Lua-Alchemy but I am curious about how a native act= ion script VM would perform against the c->llvm solution that alchemy is= using.

Any thoughts on this are appreciated.

An= thony

--00032555472a87709c0474768d76-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 11:48:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QEm0Ch022016; Sat, 26 Sep 2009 11:48:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABE3F18CAD; Sat, 26 Sep 2009 11:47:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7247118C2F for ; Sat, 26 Sep 2009 11:47:11 -0300 (BRT) Received: (qmail 14073 invoked by uid 399); 26 Sep 2009 08:47:17 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 26 Sep 2009 08:47:17 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4ABE2974.3070808@workspacewhiz.com> Date: Sat, 26 Sep 2009 08:47:16 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The LuaVM implemented in languages other than C References: <4ABD7FE1.8090906@workspacewhiz.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050308000000020201080002" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------050308000000020201080002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: Anthony Fairchild Date: 9/25/2009 9:34 PM > On Fri, Sep 25, 2009 at 7:43 PM, Joshua Jensen > > wrote: > > ----- Original Message ----- > From: Anthony Fairchild > Date: 9/25/2009 8:01 PM > > My main goal is to implement a Lua VM where C is unavailable. > Right now my main areas of focus are browsers and XNA (for > xbox community games). > > Why can't you compile Lua as C code using the /clr switch? It > works for me... > > > I'm not sure that will work for Silverlight or XNA because /clr still > accesses unmanaged c libraries underneath. Have you been able to get > it to work on Silverlight or XNA? A year ago, I remember getting LuaPlus running under XNA on Xbox 360. I initially tried /clr:pure, but I realized that didn't work due to the unmanaged libraries. I tried /clr:safe, found it had problems with unmanaged functions, so I copied the C runtime code and shoved it right into the /clr:safe capable code. For the life of me, I can't find my work on that. I can only find the /clr:pure version. I'll keep looking. Josh --------------050308000000020201080002 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: Anthony Fairchild
Date: 9/25/2009 9:34 PM
On Fri, Sep 25, 2009 at 7:43 PM, Joshua Jensen <jjensen@workspacewhiz.com> wrote:
----- Original Message -----
From: Anthony Fairchild
Date: 9/25/2009 8:01 PM
My main goal is to implement a Lua VM where C is unavailable.  Right now my main areas of focus are browsers and XNA (for xbox community games).
Why can't you compile Lua as C code using the /clr switch?  It works for me...


I'm not sure that will work for Silverlight or XNA because /clr still accesses unmanaged c libraries underneath.  Have you been able to get it to work on Silverlight or XNA?
A year ago, I remember getting LuaPlus running under XNA on Xbox 360.  I initially tried /clr:pure, but I realized that didn't work due to the unmanaged libraries.  I tried /clr:safe, found it had problems with unmanaged functions, so I copied the C runtime code and shoved it right into the /clr:safe capable code.

For the life of me, I can't find my work on that.  I can only find the /clr:pure version.  I'll keep looking.

Josh
--------------050308000000020201080002-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 13:54:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QGsWTf001365; Sat, 26 Sep 2009 13:54:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0F3818F98; Sat, 26 Sep 2009 13:53:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62D4B18D88 for ; Sat, 26 Sep 2009 13:53:42 -0300 (BRT) Received: from cdptpa-web19-z02 ([10.127.132.170]) by cdptpa-smta02.mail.rr.com with ESMTP id <20090926165348832.DNFA10304@cdptpa-smta02.mail.rr.com> for ; Sat, 26 Sep 2009 16:53:48 +0000 Message-ID: <20090926165348.I9UHL.154166.root@cdptpa-web19-z02> Date: Sat, 26 Sep 2009 16:53:48 +0000 From: To: lua@bazar2.conectiva.com.br Subject: Re: Lua for GUI toolkit wrapping? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) Sensitivity: Normal X-Originating-IP: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ---- Mauro Iazzi wrote: > 2009/9/23 Patrick : > > Why would anyone want to code a GUI in C/C++ if they had something like Lua? > > several reasons: > - they know C/C++ and not Lua > - the native language of the toolkit is C/C++ so the API may fit better > - the bindings are usually supported by a third party, so there are > likely more bugs, moreover, they come after the toolkit becomes > widespread and are usually less mature > - it adds dependencies to the application > - since less people uses it there are less docs/tutorials/examples around > - they may simply like C/C++ more than Lua :) > And another reason: Our GUI application contains 100,000+ lines of non-comment/non-blank C++ code, with about 140 or so screens, and its own built-in GUI widget editor for construction of custom screens. I'd be worried about writing an application that large in a dynamic language. That said, we have incorporated Lua selectively within the app; e.g., custom screens built with our widget editor are saved as Lua tables. Mason Deaver From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 13:59:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QGxKLs001758; Sat, 26 Sep 2009 13:59:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7711B18FDF; Sat, 26 Sep 2009 13:58:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A20AD18D88 for ; Sat, 26 Sep 2009 13:58:44 -0300 (BRT) Received: by yxe37 with SMTP id 37so4115382yxe.33 for ; Sat, 26 Sep 2009 09:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0/pVdDHMqfCFWgREl3l7mMAy3IEpS2XLLzn56cGUVc8=; b=cA4xbXkae/RRCMpTxUGctOqHy7ZDawcsm44Lka0gCsgDHcCj/pQnFZs+nrKpHq2J2B OLYLTLKCUmTM45Ull+Js5uYfeabDJXT2cpeuLUwPbXYFysxmUw+bVV/k2w6WkfmcK3jK lFw6Lhlx6haG4LqqUqYGyACWqbtGCclFpVdgM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uzbIoyerDyKmRQ7pL6uOC/+8HpP7KU1V4zFeVpze+S3RXG05ICDb9ynoHGReeCNceD KGm2K+diX0O8Ruyghzvew3ACHlKfYnuqgtKxmA8F0eKtDHP56JuKzhP/y15KbBf1AmAF 7/xcEmSbyJvAe80WBvQXBv+8lQNJx/UCA463k= MIME-Version: 1.0 Received: by 10.150.210.8 with SMTP id i8mr4621951ybg.41.1253984334017; Sat, 26 Sep 2009 09:58:54 -0700 (PDT) In-Reply-To: <20090926165348.I9UHL.154166.root@cdptpa-web19-z02> References: <20090926165348.I9UHL.154166.root@cdptpa-web19-z02> Date: Sat, 26 Sep 2009 09:58:53 -0700 Message-ID: <1079b050909260958o2f493c84o5641f9d1e7af5642@mail.gmail.com> Subject: Re: Lua for GUI toolkit wrapping? From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8QGxKLs001758 > I'd be worried about writing an application that large in a dynamic language.  That said, we have incorporated Lua selectively within the app; e.g., custom screens built with our widget editor are saved as Lua tables. Is this for performance reasons? For maintainability reasons? wes From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 14:18:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QHIb4l003582; Sat, 26 Sep 2009 14:18:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 741A218F02; Sat, 26 Sep 2009 14:18:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9ABB18861 for ; Sat, 26 Sep 2009 14:17:58 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MrauN-0000LI-26 for lua@bazar2.conectiva.com.br; Sat, 26 Sep 2009 19:18:07 +0200 Received: from aaubervilliers-155-1-18-120.w83-199.abo.wanadoo.fr ([83.199.189.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Sep 2009 19:18:07 +0200 Received: from PhiLho by aaubervilliers-155-1-18-120.w83-199.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Sep 2009 19:18:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: The LuaVM implemented in languages other than C Date: Sat, 26 Sep 2009 19:17:46 +0200 Lines: 8 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-18-120.w83-199.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-Antivirus: avast! (VPS 090926-0, 26/09/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean To answer the title of the thread, Kahlua is a pure Java implementation of Lua. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 14:19:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QHJ8AU003666; Sat, 26 Sep 2009 14:19:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 126B419076; Sat, 26 Sep 2009 14:18:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B36618F98 for ; Sat, 26 Sep 2009 14:18:30 -0300 (BRT) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 26 Sep 2009 11:18:36 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=yHmVK2EnpsgA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=IoMXcexUHTiXnrAWBtkA:9 a=dlkaaEW87A9KR2JNPfda2cV2cCUA:4 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd2ml1so-dmz.prod.shaw.ca with SMTP; 26 Sep 2009 11:18:36 -0600 From: Casey Hawthorne To: Lua list Subject: Re: Suitability of Lua as a First Programming Language? Date: Sat, 26 Sep 2009 10:18:45 -0700 Message-ID: <91jsb5lp8hst7mbrd8brsmp2f3esm0goui@4ax.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> In-Reply-To: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8QHJ8AU003666 I'm a fan of students learning both functional and imperative programming in a first course. If Lua has functional aspects, then I think it would be a good choice as a first programming language. I'm thinking along the lines of JavaScript, which has functional aspects and a lot of bad constructs as well. So, if Lua or some other language could be a cleaned up JavaScript that also runs outside the browser, that would be superb. :) -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 14:23:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QHNumg004037; Sat, 26 Sep 2009 14:23:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 940C1190AC; Sat, 26 Sep 2009 14:23:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A795518D88 for ; Sat, 26 Sep 2009 14:23:20 -0300 (BRT) Received: from pd4ml2so-ssvc.prod.shaw.ca ([10.0.141.136]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 26 Sep 2009 11:23:29 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=jfGbfwL1VLMA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=u8Rg0g8lQNi_3MTtkqMA:9 a=tz6Coc_OtY1EQM-MaZ1lBdNw9TcA:4 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd4ml2so-dmz.prod.shaw.ca with SMTP; 26 Sep 2009 11:23:28 -0600 From: Casey Hawthorne To: Lua list Subject: Re: The LuaVM implemented in languages other than C Date: Sat, 26 Sep 2009 10:23:38 -0700 Message-ID: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8QHNumg004037 On Sat, 26 Sep 2009 19:17:46 +0200, you wrote: >To answer the title of the thread, Kahlua is a pure Java implementation >of Lua. That's what's confusing about this whole discussion. The title of the thread is " The LuaVM implemented in languages other than C", which immediately brought to mind Haskell for implementing parsers, since Haskell implemented Perl 6, first I beleive. When the title would have been better as "Implementing other languages to run on the LuaVM". -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 14:25:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QHP29Q004158; Sat, 26 Sep 2009 14:25:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 845E9190D3; Sat, 26 Sep 2009 14:24:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.123]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF586190B7 for ; Sat, 26 Sep 2009 14:24:14 -0300 (BRT) Received: from cdptpa-web19-z02 ([10.127.132.170]) by cdptpa-smta01.mail.rr.com with ESMTP id <20090926172420466.POXS4754@cdptpa-smta01.mail.rr.com> for ; Sat, 26 Sep 2009 17:24:20 +0000 Message-ID: <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> Date: Sat, 26 Sep 2009 17:24:20 +0000 From: To: Lua list Subject: Re: Lua for GUI toolkit wrapping? In-Reply-To: <1079b050909260958o2f493c84o5641f9d1e7af5642@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) Sensitivity: Normal X-Originating-IP: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ---- Wesley Smith wrote: > > I'd be worried about writing an application that large in a dynamic language. That said, we have incorporated Lua selectively within the app; e.g., custom screens built with our widget editor are saved as Lua tables. > > Is this for performance reasons? For maintainability reasons? > wes I'd say the primary reason is maintainability. I've never felt entirely comfortable when scripts I write start growing past several thousand lines or so. E.g., for our C++ code we've purchased tools that allow us to visualize function calling hierarchies, class hierarchies, data structure layouts, etc: Helps with understanding and maintaining the code. With that much code, there is something to be said for static compilation helping to find errors in the code. We can test the app within a debugger, which catches some errors for us. Don't get me wrong, I'm a big fan of scripting languages and of Lua: I introduced Lua into my organization and continue to push its use. But I remain reluctant to use Lua for really large apps. Is my reluctance misplaced? Have others successfully developed and maintained large 100,000+ line apps in Lua? Mason Deaver From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 14:25:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QHPUUq004222; Sat, 26 Sep 2009 14:25:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17F601A674; Sat, 26 Sep 2009 14:24:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CB31190D8 for ; Sat, 26 Sep 2009 14:24:33 -0300 (BRT) Received: from pd2ml2so-ssvc.prod.shaw.ca ([10.0.141.134]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 26 Sep 2009 11:24:42 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=rDsuBEtXhAAA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=MoqUBKJ2aIi-bMywP7oA:9 a=We24GaDAqNqp3tVb3sEedd27EZUA:4 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd2ml2so-dmz.prod.shaw.ca with SMTP; 26 Sep 2009 11:24:42 -0600 From: Casey Hawthorne To: Lua list Subject: "Implementing other languages to run on the LuaVM" Date: Sat, 26 Sep 2009 10:24:51 -0700 Message-ID: <5hjsb5tt6tsjb5kpk3i4cg79g0lcq627ll@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8QHPUUq004222 Is this "Implementing other languages to run on the LuaVM", actually what the original poster had in mind. -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 16:22:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QJMR1Q013961; Sat, 26 Sep 2009 16:22:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FECC190F7; Sat, 26 Sep 2009 16:21:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D742190AC for ; Sat, 26 Sep 2009 16:21:36 -0300 (BRT) Received: by pxi2 with SMTP id 2so4364913pxi.11 for ; Sat, 26 Sep 2009 12:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=jHS8PTm4FBGv/lYJytQh/2PuBAA7/mUvDP1c9yMc6bU=; b=kxKDa7q0Fu0fcmuArz/J3dmoyJGOLE+fwxd9b6VjJjS8Y7WUNiWF98JDXd54fi09iw HP3Xda3drnuGDaR10we/l3s19/6ML4UVgcezs2HLieg3t6swnhbA22RIjcAjISHCcehh IbTUyDSp8cLmIOPtBvCVLEbEywwwxzSus0Qkc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YsNfp5OiIUKdkucEUfEpWG9FyTpExhTjB8yWqHGvTLuWK3t2h6AF6mrJS30HRcYQ8e S5C8/1LN18+thFhZ70dbqxwSiZePRNUZEluqbgKSc0152+NwG9fTvrvIm/0NjWU5ikXP kk1hRhQD6b9mRGhg6qywN+2SnIKAaXFM26W1A= MIME-Version: 1.0 Received: by 10.143.131.6 with SMTP id i6mr104423wfn.338.1253992904797; Sat, 26 Sep 2009 12:21:44 -0700 (PDT) In-Reply-To: <0016e648f6764ec4cf04747fef8a@google.com> References: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> <0016e648f6764ec4cf04747fef8a@google.com> Date: Sat, 26 Sep 2009 12:21:44 -0700 Message-ID: Subject: Re: Re: The LuaVM implemented in languages other than C From: Anthony Fairchild To: Lua list Content-Type: multipart/alternative; boundary=000e0cd17f7aa4311c04747ff92f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd17f7aa4311c04747ff92f Content-Type: text/plain; charset=ISO-8859-1 On Sep 26, 2009 10:23am, Casey Hawthorne wrote: > > When the title would have been better as "Implementing other languages > > to run on the LuaVM". > > Sorry, my title didn't communicate everything that I wanted to talk about. My goals: 1) Create a language that targets the Lua VM 2) Make my language (and Lua) run in places where Lua cannot currently run, i.e XNA and Silverlight by implementing the Lua VM in C#. #1 is more of a long term learning/toy project and lead me to Lua in the first place. Somewhere along the way I discovered that Lua the language is quite nice and that got me thinking about #2. I have projects in both XNA and Silverlight which could benefit from the Lua language but I found no way of running Lua in these platforms. So I thought I'd take a crack at implementing the VM in C# and so far it has been a fairly successful project. This post was mainly to talk about what I was doing and get feedback on it. So far it seems a pure .Net Lua VM may be worthwhile, so, I'll continue working on it. Thanks for the feedback! Anthony --000e0cd17f7aa4311c04747ff92f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Sep 26, 2009 10:23am,= Casey Hawthorne <c= aseyh@istar.ca> wrote:
>
> When the title would have be= en better as "Implementing other languages
>
> to run on the LuaVM".
>
>

Sor= ry, my title didn't communicate everything that I wanted to talk about.=

My goals:
1) Create a language that targets the Lua VM
2) Make my language (and Lua) run in places where Lua cannot currently run, i.e XNA and Silverlight by implementing the Lua VM in C#.

#1 is more of a long term learning/toy project and lead me to Lua in the first place. Somewhere along the way I discovered that Lua the language is quite nice and that got me thinking about #2. I have projects in both XNA and Silverlight which could benefit from the Lua language but I found no way of running Lua in these platforms. So I thought I'd take a crack at implementing the VM in C# and so far it has been a fairly successful project. This post was mainly to talk about what I was doing and get feedback on it.

So far it seems a pure .Net Lua VM may be wo= rthwhile, so, I'll continue working on it.

Thanks for the fee= dback!

Anthony
--000e0cd17f7aa4311c04747ff92f-- From lua-bounces@bazar2.conectiva.com.br Sat Sep 26 20:39:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8QNdTOW000672; Sat, 26 Sep 2009 20:39:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F9DC1A6A0; Sat, 26 Sep 2009 20:38:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E7ED1A67C for ; Sat, 26 Sep 2009 20:38:40 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so710954eye.39 for ; Sat, 26 Sep 2009 16:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=YkRQ1T+UWvdUcHxc8dAFL8COBGN458J1+aOa1/DoI0c=; b=lMCYtq2jAikSPZ2M5AnxTk1SlazwsgUCK4RCw3ZwlKa1NPJCG6qdnx97ufjPCPsqdc gm7EeC1YaKo5KMPRWIpvH9UgjVESpGgbvWUsTLIqZZ8niejPnBaeKOnrhjDnaVzQXRgd Xxbu/Ux977Z4HMXJF3YZWLovWLbF+7eA1YzUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=vnjHpdVj/MrOvBTifVV3ipykyqbRyyNuOVCNVVhLZtGKBguujeca2Mf4/98vDjyhlw I1Nv4VoZztV5mDinf05djLb3GnLml+pEsJWFBbA5lA1zYc3q/ImfQ1n0wt38/omF9/4o LrrZhNwGs9E21xAOesaCMPkXAvDh8yBsZCSyU= MIME-Version: 1.0 Received: by 10.211.128.11 with SMTP id f11mr1395365ebn.62.1254008328084; Sat, 26 Sep 2009 16:38:48 -0700 (PDT) In-Reply-To: <4ABAD62E.4030108@spellingbeewinnars.org> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <560972290909220642w64345f61h4162092d8a352728@mail.gmail.com> <438c11350909231853t6f419b77g91a60147b78bb5d6@mail.gmail.com> <4ABAD62E.4030108@spellingbeewinnars.org> Date: Sun, 27 Sep 2009 01:38:48 +0200 X-Google-Sender-Auth: c002272716420f2b Message-ID: <68c491a60909261638j5f1dc15dqcba32b2446116481@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: =?ISO-8859-1?Q?Martin_Schr=F6der?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/24 Patrick : > What would be a good first language that would actually make a reluctant > student WANT to learn more? Learning assembly or something might help squeak. Smalltalk was designed as a first language for children. :-) Best Martin From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 09:45:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RCj5QA004957; Sun, 27 Sep 2009 09:45:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E9E518E9D; Sun, 27 Sep 2009 09:44:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87C9B18994 for ; Sun, 27 Sep 2009 09:44:13 -0300 (BRT) Received: by bwz10 with SMTP id 10so3083080bwz.5 for ; Sun, 27 Sep 2009 05:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=/7+anZYd6HxLRf8g8eh5haUaTHMIC5k2D3FzOWogRv4=; b=oypN6CkDeF4g2LWLJ70V3VjsPKmZNPzRJ0gghNEVfeJuh4qPhdfeuRtIYrww4PRZP+ 7lZqxxZISZAOCjd900+UNa/yit+9h/luU/pFxAh1aYtIPpMdnW6upNiKv5VZ1WJcsl/X szUPsEmXJWMKJvF9OcoZbka1tDGmofu4pjNDI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=AQ8O99FISBtR/5Slxl+glv7Bl6ejKfREgQqc6yG7+gBPulLxPz5bZpcHPTt4QT2egI JI22a5+ixn8HJWVrHHBS6MZNrw5UR9yxiJe7tUAdSr70OOyVRfiO9P0eCs+x8VworZF9 H1P0/8bYZ2z1dblML1rz26Rfov9ToFVG27lbI= MIME-Version: 1.0 Received: by 10.223.2.200 with SMTP id 8mr482857fak.60.1254055461399; Sun, 27 Sep 2009 05:44:21 -0700 (PDT) Date: Sun, 27 Sep 2009 14:44:21 +0200 X-Google-Sender-Auth: 73616ec688381f04 Message-ID: Subject: Re: Separate groups of scripts From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 23 Sep 2009 03:41:18 +0300, Shmuel Zeigerman wrote: > I thought of a solution, where the program assigns each user (that is, > each group of scripts) a separate environment and calls those scripts > within that environment. But AFAIK, there is no way to have a > package.path per an environment, there is only one package.path. On the lua-users.org wiki (http://lua-users.org/wiki/JimJennings), I have posted an implementation of a module system extension (called Darwin) that supports separate environments and has a package.path for each environment. Your request sounds similar to the intended use for Darwin, which is to aggregate scripts (libraries/modules/programs/whatever) from many sources but expose them in a controlled way to the programmer (your users). I'm not sure Darwin is the right solution for your problem, but you might get some insight from looking at the documentation, which contains examples. --Jim From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 12:26:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RFQf72018467; Sun, 27 Sep 2009 12:26:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F0BE1A667; Sun, 27 Sep 2009 12:26:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 890B01A5FB for ; Sun, 27 Sep 2009 12:25:56 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RFQ6hu018410 for ; Sun, 27 Sep 2009 12:26:06 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8RFQ3S04318; Sun, 27 Sep 2009 12:26:03 -0300 Date: Sun, 27 Sep 2009 12:26:02 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: Lua Workshop 2009 -- programa preliminar Message-ID: <20090927122602.A4310@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Uma versão preliminar do programa está disponível em http://www.lua.org/wshop09.html#programacao O programa final será anunciado aqui em breve. -- A preliminary program is avaliable at http://www.lua.org/wshop09.html#programacao The final program will be announced soon. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 12:48:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RFmSIQ020349; Sun, 27 Sep 2009 12:48:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D8F0C18822; Sun, 27 Sep 2009 12:47:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth11.prod.mesa1.secureserver.net (smtpauth11.prod.mesa1.secureserver.net [64.202.165.33]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9F54218807 for ; Sun, 27 Sep 2009 12:47:49 -0300 (BRT) Received: (qmail 10679 invoked from network); 27 Sep 2009 15:47:55 -0000 Received: from unknown (98.117.140.83) by smtpauth11.prod.mesa1.secureserver.net (64.202.165.33) with ESMTP; 27 Sep 2009 15:47:54 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Suitability of Lua as a First Programming Language? From: Mark Hamburg In-Reply-To: <91jsb5lp8hst7mbrd8brsmp2f3esm0goui@4ax.com> Date: Sun, 27 Sep 2009 08:47:53 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <91jsb5lp8hst7mbrd8brsmp2f3esm0goui@4ax.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 26, 2009, at 10:18 AM, Casey Hawthorne wrote: > I'm a fan of students learning both functional and imperative > programming in a first course. > > If Lua has functional aspects, then I think it would be a good choice > as a first programming language. > > I'm thinking along the lines of JavaScript, which has functional > aspects and a lot of bad constructs as well. > > So, if Lua or some other language could be a cleaned up JavaScript > that also runs outside the browser, that would be superb. Lua has most of the good parts (Crockford's term) of JavaScript without most of the bad parts. It has a few controversial items such as counting from 1 rather than 0 but that doesn't matter in a first programming language and probably makes more sense to people without a programming background. (Even a lot of mathematical material numbers sequences from 1 rather than 0.) I've been wondering whether Corona (http://anscamobile.com/corona/) would be a good way to do introductory game programming and it's Lua based. Mark From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 13:00:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RG0afi021632; Sun, 27 Sep 2009 13:00:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5861E1897E; Sun, 27 Sep 2009 12:59:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-05.prod.phx3.secureserver.net (p3plsmtpa01-05.prod.phx3.secureserver.net [72.167.82.85]) by bazar2.conectiva.com.br (Postfix) with SMTP id C1DB5188E9 for ; Sun, 27 Sep 2009 12:59:45 -0300 (BRT) Received: (qmail 25454 invoked from network); 27 Sep 2009 15:59:52 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-05.prod.phx3.secureserver.net (72.167.82.85) with ESMTP; 27 Sep 2009 15:59:52 -0000 Subject: Re: Lua for GUI toolkit wrapping? Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Mark Hamburg X-Priority: 3 (Normal) In-Reply-To: <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> Date: Sun, 27 Sep 2009 08:59:50 -0700 Content-Transfer-Encoding: 7bit Message-Id: <070935F4-2558-4A3B-829D-0625C1357925@grubmah.com> References: <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lua makes up the majority of Lightroom's code -- particularly on single platforms since the Objective-C and MFC C++ pieces are platform specific. http://troygaul.com/LrExposedC4.html The biggest problem with dynamic languages and big projects seems to be refactoring since one cannot simply change a declaration and then fix things until it all compiles again. It's also a bit harder to trace dependencies in object-oriented code since one can send a message to an object without importing anything which defines the message. The work around for those issues is being more disciplined about naming and using search and replace. Mark On Sep 26, 2009, at 10:24 AM, wrote: > > ---- Wesley Smith wrote: >>> I'd be worried about writing an application that large in a >>> dynamic language. That said, we have incorporated Lua selectively >>> within the app; e.g., custom screens built with our widget editor >>> are saved as Lua tables. >> >> Is this for performance reasons? For maintainability reasons? >> wes > > I'd say the primary reason is maintainability. I've never felt > entirely comfortable when scripts I write start growing past several > thousand lines or so. E.g., for our C++ code we've purchased tools > that allow us to visualize function calling hierarchies, class > hierarchies, data structure layouts, etc: Helps with understanding > and maintaining the code. > > With that much code, there is something to be said for static > compilation helping to find errors in the code. We can test the app > within a debugger, which catches some errors for us. > > Don't get me wrong, I'm a big fan of scripting languages and of > Lua: I introduced Lua into my organization and continue to push its > use. But I remain reluctant to use Lua for really large apps. Is > my reluctance misplaced? Have others successfully developed and > maintained large 100,000+ line apps in Lua? > > Mason Deaver > From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 14:02:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RH2BMl027054; Sun, 27 Sep 2009 14:02:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAB4C18E73; Sun, 27 Sep 2009 14:01:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s802.sureserver.com (s802.sureserver.com [195.8.222.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0223E18CE6 for ; Sun, 27 Sep 2009 14:01:18 -0300 (BRT) Received: (qmail 30103 invoked by uid 1003); 27 Sep 2009 17:01:26 -0000 Received: from unknown (HELO ?192.168.1.101?) (ikolev@91.92.152.6) by s802.sureserver.com with ESMTPA; 27 Sep 2009 17:01:26 -0000 Message-ID: <4ABF9A59.3010401@gmail.com> Date: Sun, 27 Sep 2009 20:01:13 +0300 From: Ivan Kolev User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Lua for large apps (was: Lua for GUI toolkit wrapping?) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean mdeaver@tx.rr.com wrote: > Don't get me wrong, I'm a big fan of scripting languages and of Lua: I introduced Lua into my organization and continue to push its use. But I remain reluctant to use Lua for really large apps. Is my reluctance misplaced? Have others successfully developed and maintained large 100,000+ line apps in Lua? I think you are quite right. I'm a big fan of Lua too, but I've failed with the first larger project I tried writing completely in Lua (less than 10K lines). Of course, I made mistakes, but I still think that large projects need every possible tool to remain reasonably maintainable and bug-free. Static typing and compile-time checks (including warnings to the max) are indispensable. The alternative for dynamically typed languages are tests. A lot of them, as close to 100% coverage as possible. And you still can't be sure that your tests will catch any typo, or any misplaced function argument... something a compiler would always catch (OK, almost). Of course, tests are needed just as much in static-typed languages, so you might decide that if you are certain to cover near 100% of your code with tests, then you as well might go with a scripting language... But I still don't know a large project which managed to do that. I don't say it's impossible, I hope it is, I even hope to try it some day. Of course, tools like a powerful debugger, IDE, code explorer, etc. are also important and AFAIK Lua is a bit lacking there. Regards, Ivan From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 14:12:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RHCYfC027768; Sun, 27 Sep 2009 14:12:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDE8618A74; Sun, 27 Sep 2009 14:11:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD75A18890 for ; Sun, 27 Sep 2009 14:11:53 -0300 (BRT) Received: by fxm12 with SMTP id 12so3610294fxm.5 for ; Sun, 27 Sep 2009 10:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Sj8uagFdmTgkE7tieVkiWwCJcRFECAMLFK6j4YdHNw8=; b=vqp8QBdEeqaFm37bSk3wDlzXPJDgbB7cb9422FRT3KFZ9Hmz05EGEburSBiq80uKqI IC0pjDqLr1SJ/Zstj3LbyBhM6IN1W6if63MpF8OROLepeyATuQWhtHPOYXT21K+Yxb4W eQzxRQTedCbyfdukfKvbWJUKcHsAkfu16cvzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KA2Tack/ls80EzoZjbCGRSjWMYKvpbKFObrUKn/yX6ZX2oyRMqnatADcL4eOxZocDv qyfnxghuHEUsG+GffLPs2HbzRbdQuiDWDvkmjdrTG9orE9dgZtJZMartgN2z288zIsqq Ud7iFnxuMJqDn0sr2nCNI2BQmiWCviZwGJneU= MIME-Version: 1.0 Received: by 10.204.15.3 with SMTP id i3mr2187793bka.71.1254071523460; Sun, 27 Sep 2009 10:12:03 -0700 (PDT) In-Reply-To: <4ABF9A59.3010401@gmail.com> References: <4ABF9A59.3010401@gmail.com> Date: Sun, 27 Sep 2009 19:12:03 +0200 Message-ID: <560972290909271012k5ce4c78fr6ab69031b9cf9471@mail.gmail.com> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 27, 2009 at 7:01 PM, Ivan Kolev wrote: > Static typing and compile-time checks (including warnings to the max) are > indispensable. In the absence of static typing, then dynamic type checking is the best we get: http://lua-users.org/wiki/LuaTypeChecking Further down that page is 'Solution: Function Decorators' which is an interesting idea of David Manura. Here I'm using a later notation that he introduces in his article about decorators: sum = typecheck("number", "number", "->", "number") .. function(a,b) return a + b end Now, this technique makes it possible to switch actual assertions on and off at compile time, but it also gives a structured way to specify function signatures. Of course, it's a bit more work, but some extra work seems essential. Given how fast a person can write Lua, we have to slow that person down a little bit and force them to give some more clues ;) steve d. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 14:22:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RHMQAf028603; Sun, 27 Sep 2009 14:22:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BE1618F75; Sun, 27 Sep 2009 14:21:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49548188C8 for ; Sun, 27 Sep 2009 14:21:46 -0300 (BRT) Received: by fxm12 with SMTP id 12so3614428fxm.5 for ; Sun, 27 Sep 2009 10:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=eBgK7Ey+9aDRUDQJFVUfINgW+K4uVX7zbBTDBE/VXfU=; b=n/x1cPlyOQz8ycDc8sZtlRNVuuQmz7pE6v4O22qP2afBdM4GQFE3etWchmnxFOL50u X43rX7GT3Pp1R6gc1xnFcpG7LHpOG3wYiWHipYeItslXZPr3NYrZ/sTV+4ezzlAN4U4I Gtq5n/MVj/W7A/W6lV2tsKucsGR9bXV5WIvjI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=VYc6Euxv/XGRKyuEQKRCHWqK3j/lloSdkLLEBtDVBkuC4jvANx8mDxzNUfXw7wJEbu Rh3f+DY/LvTUAdb7AVliYsjKMNkJY5EnL+3K4ubu0SysHKuepVK/joAK0bLXS7iO4nKr wy3cBnkt8j5KaOaylZq1IYE2SO4egDmElPxVs= Received: by 10.86.227.26 with SMTP id z26mr2602536fgg.76.1254072116168; Sun, 27 Sep 2009 10:21:56 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id d6sm4252214fga.6.2009.09.27.10.21.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 27 Sep 2009 10:21:54 -0700 (PDT) Message-Id: <3FE4CB9E-FCB4-4BDA-8199-4FD52EF5487F@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4ABF9A59.3010401@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) Date: Sun, 27 Sep 2009 19:21:23 +0200 References: <4ABF9A59.3010401@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8RHMQAf028603 On Sep 27, 2009, at 7:01 PM, Ivan Kolev wrote: > I think you are quite right. I'm a big fan of Lua too, but I've > failed with the first larger project I tried writing completely in > Lua (less than 10K lines). As a counter example, Nanoki, a wiki engine in pure Lua, clocks over 10K lines of Lua code and is no more -nor less- buggy than any other piece of software of that size. Clutches such a static typing only catch the most trivial of typos. Anything else is solely on your lap. And no amount of paraphernalia is going to save you there. Just my 2¢. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 14:24:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RHOuA6028762; Sun, 27 Sep 2009 14:24:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FA651A5E5; Sun, 27 Sep 2009 14:24:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C80218FF3 for ; Sun, 27 Sep 2009 14:24:21 -0300 (BRT) Received: by bwz10 with SMTP id 10so3167682bwz.5 for ; Sun, 27 Sep 2009 10:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=iaWlv45UhfTh9xq6SMY8Z+ais3NH6VPYIMki9RuxslU=; b=vdvFju/ksjl/sNfcccF6ikqKeBEGy8p9rosUQziGWwbHp0tGzTQ8CwOuZndJ53Qroy IVo0qmxYv62bvNYxnxMWHyjsnbhcCYHnQsA5+/b1fNosH8eZuy+N5z+AK45seoP8lncS ZoD6KijEJqbKOkdNXrRs7KXDiiX0mpO0ETorc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=L1RO89n2P/CCEIVhn+SRbn0AO62yopZVX0QpcObrVJJs72eRdWXl5YonwGJKTnn6Tb Zo6LmPgDdFO9ofcWUqEYNkU/319x8b6EEPSy2GmSaJbq6htiCEF3DnI/GIghbNUu/zOD QJ+VtbVYgBE8/JVWyFob1UxxBs9/97o61521w= Received: by 10.204.8.13 with SMTP id f13mr2144558bkf.150.1254072269176; Sun, 27 Sep 2009 10:24:29 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id p9sm2336962fkb.37.2009.09.27.10.24.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 27 Sep 2009 10:24:27 -0700 (PDT) Message-Id: <0580E199-64E1-4ABC-A9C0-C699A21C97BA@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <560972290909271012k5ce4c78fr6ab69031b9cf9471@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) Date: Sun, 27 Sep 2009 19:23:56 +0200 References: <4ABF9A59.3010401@gmail.com> <560972290909271012k5ce4c78fr6ab69031b9cf9471@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 27, 2009, at 7:12 PM, steve donovan wrote: > Further down that page is 'Solution: Function Decorators' which is an > interesting idea of David Manura. "Interesting"? As in the chinese curse? From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 14:46:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RHk4Rm030247; Sun, 27 Sep 2009 14:46:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF7431A66F; Sun, 27 Sep 2009 14:45:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sunfire05.eecs.tufts.edu (sunfire05.eecs.tufts.edu [130.64.23.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D89F3321B5 for ; Sun, 27 Sep 2009 14:45:18 -0300 (BRT) Received: from pmx.eecs.tufts.edu (pmx.eecs.tufts.edu [130.64.23.79]) by sunfire05.eecs.tufts.edu (Postfix) with ESMTP id 4EE121EAD for ; Sun, 27 Sep 2009 13:45:28 -0400 (EDT) Received: from pmx.eecs.tufts.edu (localhost [127.0.0.1]) by localhost.eecs.tufts.edu (Postfix) with SMTP id 2207C206B3 for ; Sun, 27 Sep 2009 13:45:28 -0400 (EDT) Received: from labrador.cs.tufts.edu (labrador.eecs.tufts.edu [130.64.22.16]) by pmx.eecs.tufts.edu (Postfix) with ESMTP id 67A4A206B0 for ; Sun, 27 Sep 2009 13:45:27 -0400 (EDT) Received: by labrador.cs.tufts.edu (Postfix, from userid 32074) id EAB8E600166C6; Sun, 27 Sep 2009 13:45:26 -0400 (EDT) To: Lua list Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) In-reply-to: <4ABF9A59.3010401@gmail.com> (sfid-H-20090927-132928-+80.60-1@multi.osbf.lua) References: <4ABF9A59.3010401@gmail.com> (sfid-H-20090927-132928-+80.60-1@multi.osbf.lua) Comments: In-reply-to Ivan Kolev message dated "Sun, 27 Sep 2009 20:01:13 +0300." Date: Sun, 27 Sep 2009 13:45:26 -0400 From: Norman Ramsey Message-Id: <20090927174526.EAB8E600166C6@labrador.cs.tufts.edu> X-PMX-Version: 5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.9.27.173320 X-PerlMx-Spam: Gauge=X, Probability=10%, Report=' TO_IN_SUBJECT 0.5, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_500_599 0, BODY_SIZE_7000_LESS 0, __BOUNCE_CHALLENGE_SUBJ 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0' X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Static typing and compile-time checks (including warnings to the max) are > indispensable. The alternative for dynamically typed languages are > tests. Actually another quite respectable alternative is program analysis. I ran into Kostis Sagonas at the airport and it seems he has had some very good results using something he calls 'success types' for Erlang programs. I would love to see similar technology applied to Lua. A paper is at http://user.it.uu.se/~kostis/Papers/contracts.pdf Norman From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 15:00:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RI0K9e031318; Sun, 27 Sep 2009 15:00:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 772EC1A676; Sun, 27 Sep 2009 14:59:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB8C018BA1 for ; Sun, 27 Sep 2009 14:59:39 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 32E493849648B for ; Mon, 28 Sep 2009 00:59:48 +0700 (NOVST) Message-ID: <004001ca3f9c$4e5dab10$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4ABF9A59.3010401@gmail.com> <3FE4CB9E-FCB4-4BDA-8199-4FD52EF5487F@gmail.com> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) Date: Mon, 28 Sep 2009 00:59:46 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Mon, 28 Sep 2009 00:59:48 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Another example is King's Bounty game. Armored Princess has 1 MB of lua scripts in it, which is more than 30K lines of code. ----- Original Message ----- From: Petite Abeille To: Lua list Sent: Monday, September 28, 2009 12:21 AM Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) On Sep 27, 2009, at 7:01 PM, Ivan Kolev wrote: > I think you are quite right. I'm a big fan of Lua too, but I've failed > with the first larger project I tried writing completely in Lua (less > than 10K lines). As a counter example, Nanoki, a wiki engine in pure Lua, clocks over 10K lines of Lua code and is no more -nor less- buggy than any other piece of software of that size. Clutches such a static typing only catch the most trivial of typos. Anything else is solely on your lap. And no amount of paraphernalia is going to save you there. Just my 2¢. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 15:39:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RIdCx1001386; Sun, 27 Sep 2009 15:39:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 917751A66C; Sun, 27 Sep 2009 15:38:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout1.mclink.it (smtpout1.mclink.it [195.110.128.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38091A65B for ; Sun, 27 Sep 2009 15:38:21 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout1.mclink.it (8.13.6/8.13.6) with ESMTP id n8RIcUxf011173 for ; Sun, 27 Sep 2009 20:38:30 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOdNv0rDbohc/2dsb2JhbADSQYQeBQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 27 Sep 2009 20:38:30 +0200 Received: from [192.168.127.128] (host212-99-dynamic.45-79-r.retail.telecomitalia.it [79.45.99.212]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id n8RIcRFv099856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 27 Sep 2009 20:38:30 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4ABFB124.3080806@erix.it> Date: Sun, 27 Sep 2009 20:38:28 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for large apps References: <4ABF9A59.3010401@gmail.com> <3FE4CB9E-FCB4-4BDA-8199-4FD52EF5487F@gmail.com> <004001ca3f9c$4e5dab10$6600a8c0@sat3> In-Reply-To: <004001ca3f9c$4e5dab10$6600a8c0@sat3> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean GrayFace wrote: > Another example is King's Bounty game. Armored Princess has 1 MB of lua > scripts in it, which is more than 30K lines of code. I had no problems at all with ~12K LOC and 3 people working on them. I wrote the engine (4K LOC on the Lua side), my co-workers 8K LOC of scripts. Putting a lot of effort into planning, design and organization is of course a good idea. As is thorough piece-by-piece testing. But that's not Lua-specific :-) Enrico From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 15:49:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RInWTV002153; Sun, 27 Sep 2009 15:49:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66EBE1A66F; Sun, 27 Sep 2009 15:48:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5077118A87 for ; Sun, 27 Sep 2009 15:48:52 -0300 (BRT) Received: by qyk4 with SMTP id 4so2938098qyk.33 for ; Sun, 27 Sep 2009 11:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=x97AWneJSYTiF1Y+UzqLa+oxO7NjybMeiX7Hx8oqU1Y=; b=iDFhPVfM3TfjWZpLEhtrfZGUGXkWM3gG/QOHEcvCHeTH142mbSHAzIH4g7LO/GxQhg oqVIXqG4jYYRGtTei2qwTNCPFDQ2flBw24qUXoeu9oHsBGYUa7eU4dWM4gdnh4cCDWC3 WCs/HrXbu9aMSVxhJ+eRLHs1DkIwNwJq4loPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bA2Ibf4wIqdzhb7WvbRJJFWiiZgHLfj6oy/N6yPPzNwId9fhjOLivd5Ij4OrJ1Btin ER7JkIAap+IXHlbBfDUu2VN7rzKS2jA39OXr7dqs/ssZwD9BLcqWzTSdjjSqKT/NK5+q t2Zg9HLVqwccjOgVdtXhol3MRjQ+c7x7D7X9g= MIME-Version: 1.0 Received: by 10.224.38.40 with SMTP id z40mr2035909qad.0.1254077341846; Sun, 27 Sep 2009 11:49:01 -0700 (PDT) In-Reply-To: <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> References: <1079b050909260958o2f493c84o5641f9d1e7af5642@mail.gmail.com> <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> Date: Sun, 27 Sep 2009 22:49:01 +0400 Message-ID: Subject: Re: Lua for GUI toolkit wrapping? From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8RInWTV002153 > Don't get me wrong, I'm a big fan of scripting languages and of Lua:  I introduced Lua into my organization and continue to push its use.  But I remain reluctant to use Lua for really large apps.  Is my reluctance misplaced?  Have others successfully developed and maintained large 100,000+ line apps in Lua? On my previous job, we had 160+ KLOC of Lua and 100+ KLOC of C++ in our (server) application. We are quite happy with our choice. To be happy, of course, one need to use global environment protection, write enough unit tests and have some coding discipline. Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 16:28:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RJS0Du004797; Sun, 27 Sep 2009 16:28:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D822718977; Sun, 27 Sep 2009 16:27:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15CD8184C5 for ; Sun, 27 Sep 2009 16:27:16 -0300 (BRT) Received: by fxm12 with SMTP id 12so3670860fxm.5 for ; Sun, 27 Sep 2009 12:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=JiKmL1wbrK86E5PZN5I6jaxnGy69k0YrEV5R0jl7eig=; b=Rwyru0EkMA3dMz0odBdjm3guHzle+7mFlvGem1Xbk6lw8/ZgWenT8XC/gJygUHC7eo J3PVcGBfqocaSgdT8jexlb03eXTfXCUL8pz2f7ea7ZRe2NRsGU9KU9Aylj59nUp9FTCA g8VL6sJN1Wfgm2fxO/KtFpGdyM8ZzVSaRN/sE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=UJGd4plGZJrTXGIGmrerufuqU2LaN2gBE1HuzOPRBqkyFabPrg9DUTSYsupJT2q8hJ Q943ZNQf23LimY0S0/nx0MtL6BmEq/R3WvY+W2hjL6E6gbTZzL46sskWW3xjHrpW6TqJ V0kCY6M7cbSXfnSzT1MglxAdM4JkQmUxjIpVY= Received: by 10.204.154.213 with SMTP id p21mr2117094bkw.163.1254079646694; Sun, 27 Sep 2009 12:27:26 -0700 (PDT) Received: from ?95.78.69.94? ([95.78.69.94]) by mx.google.com with ESMTPS id e17sm2651012fke.32.2009.09.27.12.27.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Sep 2009 12:27:26 -0700 (PDT) Date: Sun, 27 Sep 2009 23:26:41 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <189659471.20090927232641@gmail.com> To: Alexander Gladysh Subject: Re[2]: Lua for GUI toolkit wrapping? In-Reply-To: References: <1079b050909260958o2f493c84o5641f9d1e7af5642@mail.gmail.com> <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Alexander, Sunday, September 27, 2009, 10:49:01 PM, you wrote: > On my previous job, we had 160+ KLOC of Lua and 100+ KLOC of C++ in > our (server) application. We are quite happy with our choice. btw, are you used IDE for this? we have rather interesting (russian) discussion on this topic now: http://rsdn.ru/forum/decl/3549550.flat.aspx :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 17:04:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RK4qmZ008007; Sun, 27 Sep 2009 17:04:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD2EF18AE7; Sun, 27 Sep 2009 17:04:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C5C518A35 for ; Sun, 27 Sep 2009 17:04:02 -0300 (BRT) Received: by bwz10 with SMTP id 10so3222570bwz.5 for ; Sun, 27 Sep 2009 13:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=NICuwQBdoGHm8ESSnZ1fv53+e36h2OIYIvKigqPtL2s=; b=uULBQQmVatPUHnq3VH9uW7hZkVH4cZEzexAbHUIPcWnYH4+XtVsQwyU03QgAEM+j2q MHUxxkzVDAFYwFQcWtLHDfGDgmLxgKWuITiCm87IIlfuyrWwWx8ggmKTSHyy2AbzxEWB r3+pvameg5pawXoFkELtURjLUvthMhmQDYZb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=oEdJ7sjmbSNYAcR3GkEe/qW9ZirBQ1q3OBoPgn+UIAO+cOjoLaEMNzK2QXW2z7JMpK c6KYjnpnP4maPSgcqjdqnRr49IhHIgfnvINW1j0t6gb5P5b31BsNSLqd9sYxvG3kIYgr Kf5NYOrM4GscQrAXYM84SHDFZ9sc+uQuAf0aY= MIME-Version: 1.0 Received: by 10.204.25.152 with SMTP id z24mr2390039bkb.44.1254081849805; Sun, 27 Sep 2009 13:04:09 -0700 (PDT) Date: Sun, 27 Sep 2009 22:04:09 +0200 X-Google-Sender-Auth: 9773ba9c102ba8ff Message-ID: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> Subject: What would _you_ like in a Lua CMS? From: =?UTF-8?Q?Linus_Sj=C3=B6gren?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00032555d43e2d4c32047494af0b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555d43e2d4c32047494af0b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello lua-l! I've recently started developing a Lua CMS running on Xavante and it's shaping up nicely. It has a big number of features on the back-end and for the noobier users I have "templates", basically functions that generates a full featured blog for you. Now, I have a question for you: *What would you like for this project?* Thanks in advance! // Linus Sj=C3=B6gren (thelinx@unreliablepollution.net) --00032555d43e2d4c32047494af0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello lua-l!

I've recently started developing a Lua = CMS running on Xavante and it's shaping up nicely.

=
It has a big number of features on the back-end and for the noobier us= ers I have "templates", basically functions that generates a full= featured blog for you.

Now, I have a question for you:

What would you like for this project?

Tha= nks in advance!
--00032555d43e2d4c32047494af0b-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 17:50:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RKoU0v011397; Sun, 27 Sep 2009 17:50:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BAD21A66C; Sun, 27 Sep 2009 17:49:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B288321B5 for ; Sun, 27 Sep 2009 17:49:44 -0300 (BRT) Received: by bwz10 with SMTP id 10so3238539bwz.5 for ; Sun, 27 Sep 2009 13:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=VwNp6OOZczfnkOppCPdNUC6jNkGF9F3LYgHYBexw7PM=; b=h6TXIluBUZOdXDf9BiPZGGWbgMoPPlbtRoda6vl8huPXLwhh/5DeJ0tNNrGuelzO05 S+XXB4cysWD6vBVdtAa9NrT3gX3gqGT56GttVg67z/MYod0JJBwbwOK+aeRUWQ2RYQV9 DrQ70ghMCalvKpwtmiKIeXVy8TeYCEeasVkIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=ZRIQPc5udhcQs12Hx7TzBUe9kHanXUgPG2EiXivX6qwMHS9rzyBmlJViLQelHa817k x55fcTEW2yNvnwq3soTZYtABcd3R6O+rSXPC4ulXWk/U2BX388A+Qa+I/bsEYYRGZDXL fy9BWUdWlUnVLXWPOwCLXYMKVXxK9mhudu8YQ= MIME-Version: 1.0 Received: by 10.223.24.87 with SMTP id u23mr534254fab.81.1254084594231; Sun, 27 Sep 2009 13:49:54 -0700 (PDT) In-Reply-To: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> From: Leaf Storm Date: Sun, 27 Sep 2009 16:49:34 -0400 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8RKoU0v011397 I wouldn't recommend developing "for Xavante." Instead, develop for WSAPI - I would rather use a server like Apache or Lighty and run a CMS using CGI or FastCGI, than have to run an Xavante and then proxy it in. As for what I would like in it, that depends on what the CMS really does. Some more information would be nice. Is it like a blog, just a tool for running "normal" Web sites dynamically, or a portal? This sounds like a great idea, and if you put the code on Bitbucket or somewhere I might contribute a few lines. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." On Sun, Sep 27, 2009 at 4:04 PM, Linus Sjögren wrote: > Hello lua-l! > I've recently started developing a Lua CMS running on Xavante and it's > shaping up nicely. > It has a big number of features on the back-end and for the noobier users I > have "templates", basically functions that generates a full featured blog > for you. > Now, I have a question for you: > What would you like for this project? > Thanks in advance! > // Linus Sjögren (thelinx@unreliablepollution.net) From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 19:19:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RMJNlG016984; Sun, 27 Sep 2009 19:19:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0112319169; Sun, 27 Sep 2009 19:18:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE275190F7 for ; Sun, 27 Sep 2009 19:18:28 -0300 (BRT) Received: by fxm12 with SMTP id 12so3738243fxm.5 for ; Sun, 27 Sep 2009 15:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=wvM/d7E3bDxUJXm0VF9D2wggZjoxwum3ds/Nzvg60j8=; b=FEU6tcZHJwHmCl4FrdOjGAFqqk8iKZvf860WnpCMo2fh/AS67nfCHabhA9xhLwAqn4 cTMNu2jM9Ma4f+rT/T04NuRhbnFEVEpt1JVxIiYk4WJo5502Q+ytNCngHNTxtnZ6YgcG 5+fCdxVhjhaFA6tyhK2s+RW4APhGlwVTUKiW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=QND68LzZSx5nah318jCJ9qEndo3UoRkG2/mERSLGaw70ioLMRlSqNccmHWxjZjujPP dgdUOawIkMsuwSFyHkpJQ8xUV0nyFYnjaifwAt5A6bCEBIGUraEPnpp/sERdLQXRzXKk L3RI3cLJTTtGuUhhsICI+ED8+9HGjNb3VFEdo= Received: by 10.86.247.18 with SMTP id u18mr2794194fgh.43.1254089917973; Sun, 27 Sep 2009 15:18:37 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 12sm1092210fgg.17.2009.09.27.15.18.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 27 Sep 2009 15:18:36 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-1-904776275 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Mon, 28 Sep 2009 00:18:03 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1-904776275 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sep 27, 2009, at 10:49 PM, Leaf Storm wrote: > Instead, develop for > WSAPI - I would rather use a server like Apache or Lighty and run a > CMS using CGI or FastCGI, than have to run an Xavante and then proxy > it in. Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff... what about HTTP -> stuff instead? --Apple-Mail-1-904776275 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: 7bit
On Sep 27, 2009, at 10:49 PM, Leaf Storm wrote:

Instead, develop for
WSAPI - I would rather use a server like Apache or Lighty and run a
CMS using CGI or FastCGI, than have to run an Xavante and then proxy
it in.

Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff... what about HTTP -> stuff instead? 

--Apple-Mail-1-904776275-- From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 20:19:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8RNJUdM021643; Sun, 27 Sep 2009 20:19:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F8E31A676; Sun, 27 Sep 2009 20:18:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4254321B5 for ; Sun, 27 Sep 2009 20:18:44 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Ms30y-0002v6-Q1 for lua@bazar2.conectiva.com.br; Mon, 28 Sep 2009 00:18:48 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 434CF6147 for ; Mon, 28 Sep 2009 00:18:44 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:15845 with envelope Message-ID: <4ABFF2CD.8060006@cowlark.com> Date: Mon, 28 Sep 2009 00:18:37 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: What would _you_ like in a Lua CMS? References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8RNJUdM021643 Petite Abeille wrote: [...] > Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff... what > about HTTP -> stuff instead? You mean, do an HTTP mini-server in the CMS app itself? There are four major problems with this approach: - doesn't play nicely with a third-party web server; you either end up having to run two outward-facing servers on a single box, or else have your main web server proxy to the CMS server, which is usually a pain; - HTTP ain't as simple as at looks, particularly when dealing with stuff like multipart, transfer encoding, negotiating compression and so on; targeting something like WSAPI makes all these problems go away, as the main web server does it for you; - having two HTTP servers means that you've double the chances of exposing a security flaw to the outside world; WSAPI nicely isolates you from the web server proper, making it very easy to run your client code at reduced privileges; - Javascript security policies mean that it's a pain in the arse to split a complex site between two web servers; this means that it can become rather hard to, for example, server static content from lighttpd and dynamic content from your CMS server; life becomes much easier when you can serve everything from a single server. I have actually in the past implemented a web app using my own mini HTTP server. This was before I knew about Lua, so I actually did it in LambdaMOO code. It *worked*, but if I'd known in advance what a pain it would be, I wouldn't have done it like that... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 21:36:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S0aXCM026616; Sun, 27 Sep 2009 21:36:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 569EA1A66F; Sun, 27 Sep 2009 21:35:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.211.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B65451883F for ; Sun, 27 Sep 2009 21:35:42 -0300 (BRT) Received: by ywh4 with SMTP id 4so4290185ywh.33 for ; Sun, 27 Sep 2009 17:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=+dBeDMW30prQv3Mtgy6fgH7U/LEgdzyr+9QFpu2r1WA=; b=SHiHT2dy1SI1sU5UxxyJyxW6qJNJlMALXsedlo9f+accLz9q1qryEAuXY9/MhrLVNy XoR1EP5K5N2X5POvt5GCdBoqaYMJS0SAGNn2Lz0XcCBV6Hfa+1ewy4jl25IWB4s6sBzi dg6VoLpmiJQ/aFuCBdaGaUECtR0pvkDYCd6LY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=rTUCEY3iHnYhx1U5CKb6zY9J+p8QNyhScqS1ihK21w60sIp/8SLL1RnhhQ8neMz/9N pO/QpGxWE7lRIugRnfHtxex+nmmfG7pFq0UzRhexelPEck95YPubNrMNWdF37lIBPfQV alzb68Yk+6xU6QpKqKcjSVQFzTOth+oHtCY8Q= MIME-Version: 1.0 Received: by 10.101.62.18 with SMTP id p18mr2322155ank.183.1254098152143; Sun, 27 Sep 2009 17:35:52 -0700 (PDT) In-Reply-To: <4ABF9A59.3010401@gmail.com> References: <4ABF9A59.3010401@gmail.com> From: "Thomas Harning Jr." Date: Sun, 27 Sep 2009 20:35:32 -0400 Message-ID: Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 27, 2009 at 1:01 PM, Ivan Kolev wrote: >... > The alternative for dynamically typed languages are tests. A lot of them, as > close to 100% coverage as possible. And you still can't be sure that your > tests will catch any typo, or any misplaced function argument... something a > compiler would always catch (OK, almost). As for typos, there is a reasonable mechanism for catching this present in Lua: For each script/module you have: luac -l | less Then grep through *TGLOBAL to catch sets and gets. Ideally these should be at the very beginning of a module and/or managed through accessors. Now... if you have a typo when accessing members of tables, that can be problematic.. though it's less likely than typos when accessing items you intend to be in local-scope. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 21:39:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S0dWm0026842; Sun, 27 Sep 2009 21:39:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6C161A679; Sun, 27 Sep 2009 21:39:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC0481A5E5 for ; Sun, 27 Sep 2009 21:38:57 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S0d8G2026806 for ; Sun, 27 Sep 2009 21:39:08 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8S0d1k06086; Sun, 27 Sep 2009 21:39:01 -0300 Date: Sun, 27 Sep 2009 21:39:01 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) Message-ID: <20090927213901.A6083@lua.tecgraf.puc-rio.br> References: <4ABF9A59.3010401@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from harningt@gmail.com on Sun, Sep 27, 2009 at 08:35:32PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > luac -l | less > > Then grep through *TGLOBAL to catch sets and gets. See test/globals.lua in the Lua tarball. From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 22:52:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S1pskN000699; Sun, 27 Sep 2009 22:51:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FDF519068; Sun, 27 Sep 2009 22:51:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 902E918E73 for ; Sun, 27 Sep 2009 22:51:06 -0300 (BRT) Received: by bwz10 with SMTP id 10so3329811bwz.5 for ; Sun, 27 Sep 2009 18:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=21LsJST2mbP8qtFia9Ee0qiRFRxjTAUn+JWv7zI75nI=; b=R4uUI31UXKSLMSpTRQyioZQ7WyAg/+FZD1Y+LVbyZ2yhUbq9xorFH8Njue6IKMgb0W 98M3II2RTSpmb/MTuQUUdY2dZ0Xe58AcPbbNch77pT57/UaDoDZ19ghnswHtkSbmisEX vcC3Q5syzivC5pi0KBaqedSV3T1EVS9QET0c4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Zrqln/O9zPzQjwBw6Sh9vjeIlnRo4FQEMv9BLZ1QjTJ7oP8J1RnDmGapLR3J43nThY dt689j9gRxwbtuFpo2VPeJBC+wIL8hFgsxQJaHuN/sj6uNsd6vQLLoZ//FmeuzDuJs+v Iwcdi63/fsQ5zdckbHm6/5FpLUxWHt4HSLvc4= MIME-Version: 1.0 Received: by 10.204.13.201 with SMTP id d9mr2529313bka.12.1254102674815; Sun, 27 Sep 2009 18:51:14 -0700 (PDT) In-Reply-To: <3FE4CB9E-FCB4-4BDA-8199-4FD52EF5487F@gmail.com> References: <4ABF9A59.3010401@gmail.com> <3FE4CB9E-FCB4-4BDA-8199-4FD52EF5487F@gmail.com> Date: Mon, 28 Sep 2009 02:51:14 +0100 Message-ID: <4db9cacb0909271851l590dd492ifd1b5f79ca3a748e@mail.gmail.com> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8S1pskN000699 2009/9/27 Petite Abeille : > > On Sep 27, 2009, at 7:01 PM, Ivan Kolev wrote: > >> I think you are quite right. I'm a big fan of Lua too, but I've failed >> with the first larger project I tried writing completely in Lua (less than >> 10K lines). > > As a counter example, Nanoki, a wiki engine in pure Lua, clocks over 10K > lines of Lua code and is no more -nor less- buggy than any other piece of > software of that size. > > Clutches such a static typing only catch the most trivial of typos. Anything > else is solely on your lap. And no amount of paraphernalia is going to save > you there. > > Just my 2¢. Prosody[1] is almost pure Lua, and I think we clock at about 12K lines at a simple count excluding blanks. We have no issues with dynamic typing. In fact I don't see why anyone ever would... it's usually common sense what kind of value a function expects, and should be passed. It should also be noted that similarly-featured XMPP servers in other languages are at least 5 times the size, Lua makes it really easy to write neat compact and easy-to-follow code. The power of this in developing large applications can't be underestimated[2]. We aim to have no single file longer than 200 lines[3], a few of the complex ones make it up to 400 lines, and 450 is practically a hard limit for us which indicates something needs breaking up. More than any of the above, it's a joy to spend my time working in Lua, on Prosody. Which is more than I can say for e.g. *any* C++ application I have ever worked on. Matthew [1] http://prosody.im/ [2] http://www.paulgraham.com/power.html [3] http://catb.org/esr/writings/taoup/html/ch04s01.html From lua-bounces@bazar2.conectiva.com.br Sun Sep 27 23:57:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S2vOqr006211; Sun, 27 Sep 2009 23:57:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0308E1A5E5; Sun, 27 Sep 2009 23:56:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88D56186C3 for ; Sun, 27 Sep 2009 23:56:35 -0300 (BRT) Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8S2uPtN010818; Mon, 28 Sep 2009 11:56:40 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay31.aps.necel.com with ESMTP; Mon, 28 Sep 2009 11:56:40 +0900 Received: from dhlpc061 ([10.114.114.32] [10.114.114.32]) by relay31.aps.necel.com with ESMTP; Mon, 28 Sep 2009 11:56:40 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 703EA52E1E3; Mon, 28 Sep 2009 11:56:40 +0900 (JST) From: Miles Bader To: Casey Hawthorne Subject: Re: The LuaVM implemented in languages other than C References: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 28 Sep 2009 11:56:40 +0900 In-Reply-To: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> (Casey Hawthorne's message of "Sat, 26 Sep 2009 10:23:38 -0700") Message-ID: Lines: 4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -- "Whatever you do will be insignificant, but it is very important that you do it." Mahatma Gandhi From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 00:04:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S34ctD007301; Mon, 28 Sep 2009 00:04:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53B2B18704; Mon, 28 Sep 2009 00:04:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56A1F186C3 for ; Mon, 28 Sep 2009 00:04:01 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n8S348ga017576; Mon, 28 Sep 2009 12:04:08 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Mon, 28 Sep 2009 12:04:08 +0900 Received: from dhlpc061 ([10.114.114.32] [10.114.114.32]) by relay21.aps.necel.com with ESMTP; Mon, 28 Sep 2009 12:04:08 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 752C052E1E3; Mon, 28 Sep 2009 12:04:08 +0900 (JST) From: Miles Bader To: Casey Hawthorne Subject: Re: The LuaVM implemented in languages other than C References: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 28 Sep 2009 12:04:08 +0900 In-Reply-To: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> (Casey Hawthorne's message of "Sat, 26 Sep 2009 10:23:38 -0700") Message-ID: Lines: 30 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Casey Hawthorne writes: >>To answer the title of the thread, Kahlua is a pure Java implementation >>of Lua. > > That's what's confusing about this whole discussion. ... > When the title would have been better as "Implementing other languages > to run on the LuaVM". No, the subject is accurate. The original post _starts out_ talking what you say, but quickly changes topic to that of the subject line (implementation of the Lua VM in non-C languages); the ensuing thread the follows in discussing that topic. > The title of the thread is " The LuaVM implemented in languages other > than C", which immediately brought to mind Haskell for implementing > parsers, since Haskell implemented Perl 6, first I beleive. Is that of any interest besides historical? What advantages does a haskell implementation offer? [The main reason people seem to discuss in the thread for various non-C implementations is better integration with existing systems that aren't so friendly to C code.] -Miles -- Monday, n. In Christian countries, the day after the baseball game. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 00:05:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S35ktu007409; Mon, 28 Sep 2009 00:05:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3944C1874C; Mon, 28 Sep 2009 00:05:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49DFE1873F for ; Mon, 28 Sep 2009 00:05:14 -0300 (BRT) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 27 Sep 2009 21:05:22 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=jfGbfwL1VLMA:10 a=cmOuFlkGSQ6xa4SYGBxHhw==:17 a=mDV3o1hIAAAA:8 a=JCIiC6F5Zv_RA9J8nC8A:9 a=q134TTNeFLzT8z4WhveVJ-V1hEQA:4 a=ii61gXl28gQA:10 Received: from unknown (HELO Casey-P4) ([96.49.42.78]) by pd2ml1so-dmz.prod.shaw.ca with SMTP; 27 Sep 2009 21:05:22 -0600 From: Casey Hawthorne To: Subject: Re: The LuaVM implemented in languages other than C Date: Sun, 27 Sep 2009 20:05:19 -0700 Message-ID: References: <5bjsb5l4hu01g3otkrub633ckoe405r0fm@4ax.com> In-Reply-To: X-Mailer: Forte Agent 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8S35ktu007409 >Miles Bader >On Mon, 28 Sep 2009 11:56:40 +0900, you wrote: >"Whatever you do will be insignificant, but it is very important that you do it." Mahatma Gandhi I miss the point. I admire Mahatma Gandhi, but I don't respect him. :) -- Regards, Casey From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 03:11:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S6BsSg020641; Mon, 28 Sep 2009 03:11:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 691A7187DB; Mon, 28 Sep 2009 03:11:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3171A187A4 for ; Mon, 28 Sep 2009 03:11:07 -0300 (BRT) Received: by qyk4 with SMTP id 4so3119671qyk.33 for ; Sun, 27 Sep 2009 23:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=CvUDaL3TWmMMVE/V/C9jcKx9XCHGtcqs0kRvt7AqMg8=; b=S26RIB+fNSD8fSZub6+bdtADAJIK9INlm8E3MALjpfnssL2XG5iblaFGtJoQQefHxV c9EL839bR5rTCAepJOITa9/NOr/hQ5mv4TDFiOHD/QxyZEwHJ/tbDHcTbontkHBpslTY XK2ukGqCBJSrb5+xjHysGhj+/ehFIrLasNQwg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=UPKxQOQzYOscfWR+v1YEPQeAEMwoLco4jtKfC6o1b1V7CPEkt7zY2mkt5ueBIWmOP6 Xcy04ZLXxgTXXAs3fPOUPfMsrxZ2VPlS1p9lJT4SIkNvQbpMMVXG88LBBUAsHGIGHQyg MzY0gbBWTWvfmCrfgzYGg2QjpA3WRNgyLf6R8= MIME-Version: 1.0 Received: by 10.224.87.6 with SMTP id u6mr2294732qal.135.1254118276781; Sun, 27 Sep 2009 23:11:16 -0700 (PDT) In-Reply-To: <189659471.20090927232641@gmail.com> References: <1079b050909260958o2f493c84o5641f9d1e7af5642@mail.gmail.com> <20090926172420.ZUTA4.154452.root@cdptpa-web19-z02> <189659471.20090927232641@gmail.com> Date: Mon, 28 Sep 2009 10:11:16 +0400 Message-ID: Subject: Re: Re[2]: Lua for GUI toolkit wrapping? From: Alexander Gladysh To: Bulat Ziganshin Content-Type: text/plain; charset=ISO-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> On my previous job, we had 160+ KLOC of Lua and 100+ KLOC of C++ in >> our (server) application. We are quite happy with our choice. > btw, are you used IDE for this? we have rather interesting (russian) > discussion on this topic now: http://rsdn.ru/forum/decl/3549550.flat.aspx :) We used LuaEclipse, KDE and vim... Actually, whatever editor / IDE each developer liked most, no corporate standards for that. Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 05:13:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8S8DR9g030864; Mon, 28 Sep 2009 05:13:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC2C91A687; Mon, 28 Sep 2009 05:12:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9771F1A673 for ; Mon, 28 Sep 2009 05:12:40 -0300 (BRT) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id JRO02648 for ; Mon, 28 Sep 2009 18:12:48 +1000 Message-ID: <4AC06FFC.7010702@infinite-interactive.com> Date: Mon, 28 Sep 2009 18:12:44 +1000 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Lua Test Code Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I ported the entire Lua code base over to C# recently (including the parser and libraries) and apart from a few remaining bugs in the GC it's getting close to the point where I'll be wanting to release it. What would be the best code to test against before I do? I vaguely remember someone mentioning something about "test vectors" or something, is there a standard set of samples that each release of the Lua source code is tested against before release? Cheers, Mark Feldman This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 07:14:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SAErnb007113; Mon, 28 Sep 2009 07:14:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDF981A6A0; Mon, 28 Sep 2009 07:14:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f222.google.com (mail-fx0-f222.google.com [209.85.220.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 334EB1A698 for ; Mon, 28 Sep 2009 07:14:03 -0300 (BRT) Received: by fxm22 with SMTP id 22so3876073fxm.36 for ; Mon, 28 Sep 2009 03:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=l9itr/vLvq4lnN4JaAPyHOA1xTiBoaxBJNJzj+n9/zQ=; b=hQeUSQ4iuxV/wgPqwDSLmd4FBhPMt0LJW8H0L0U78NKBkJTkBV6JkRcwV6VHdvhcwx Ohs+jfR9+S8YLxSKu8EAoWYMc8cl+1aTnQNhl13xbxBfy91j/uPbQM8NGHozxhXMElQN LBYr6KL/37rqGZxzq/8qdQlwHLH98Ogqf0VpY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=BK20vOj4o+TQuxNkvfUDC/H25d4WD0gkghMhzmvipQs2+GBnQmuAM9SAZsmOGRUgER eJjvvbzS9cfuQPN0muBylKaPurKJZp896bWbaDIoa5XAF1uf0ZTEpfp9c11/598AHcTG 7A43QYegbwYyDEF/nX83QUCQOO73vm8nFM23Y= MIME-Version: 1.0 Received: by 10.204.8.79 with SMTP id g15mr2823911bkg.202.1254132851514; Mon, 28 Sep 2009 03:14:11 -0700 (PDT) In-Reply-To: <4ABFF2CD.8060006@cowlark.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> Date: Mon, 28 Sep 2009 12:14:11 +0200 X-Google-Sender-Auth: 32cbbd558990c9e2 Message-ID: <48b7e23a0909280314g18cdc73du1764f345a067fcd2@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: =?UTF-8?Q?Linus_Sj=C3=B6gren?= To: Lua list Content-Type: multipart/alternative; boundary=0015174c36481d9cb10474a08f3f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174c36481d9cb10474a08f3f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xavante is a web server, is it not? 2009/9/28 David Given > Petite Abeille wrote: > [...] > >> Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff... what abo= ut >> HTTP -> stuff instead? >> > > You mean, do an HTTP mini-server in the CMS app itself? > > There are four major problems with this approach: > > - doesn't play nicely with a third-party web server; you either end up > having to run two outward-facing servers on a single box, or else have yo= ur > main web server proxy to the CMS server, which is usually a pain; > > - HTTP ain't as simple as at looks, particularly when dealing with stuff > like multipart, transfer encoding, negotiating compression and so on; > targeting something like WSAPI makes all these problems go away, as the m= ain > web server does it for you; > > - having two HTTP servers means that you've double the chances of exposin= g > a security flaw to the outside world; WSAPI nicely isolates you from the = web > server proper, making it very easy to run your client code at reduced > privileges; > > - Javascript security policies mean that it's a pain in the arse to split= a > complex site between two web servers; this means that it can become rathe= r > hard to, for example, server static content from lighttpd and dynamic > content from your CMS server; life becomes much easier when you can serve > everything from a single server. > > I have actually in the past implemented a web app using my own mini HTTP > server. This was before I knew about Lua, so I actually did it in LambdaM= OO > code. It *worked*, but if I'd known in advance what a pain it would be, I > wouldn't have done it like that... > > -- > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80 =EF=BD=84=EF=BD=87=EF=BC=A0=EF=BD=83= =EF=BD=8F=EF=BD=97=EF=BD=8C=EF=BD=81=EF=BD=92=EF=BD=8B=EF=BC=8E=EF=BD=83=EF= =BD=8F=EF=BD=8D =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 http://www.co= wlark.com =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 > =E2=94=82 "They laughed at Newton. They laughed at Einstein. Of course, t= hey > =E2=94=82 also laughed at Bozo the Clown." --- Carl Sagan > --0015174c36481d9cb10474a08f3f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xavante is a web server, is it not?

2009/= 9/28 David Given <dg= @cowlark.com>
Petite Abeille wrote:
[...]

Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff...= what about HTTP -> stuff instead?

You mean, do an HTTP mini-server in the CMS app itself?

There are four major problems with this approach:

- doesn't play nicely with a third-party web server; you either end up = having to run two outward-facing servers on a single box, or else have your= main web server proxy to the CMS server, which is usually a pain;

- HTTP ain't as simple as at looks, particularly when dealing with stuf= f like multipart, transfer encoding, negotiating compression and so on; tar= geting something like WSAPI makes all these problems go away, as the main w= eb server does it for you;

- having two HTTP servers means that you've double the chances of expos= ing a security flaw to the outside world; WSAPI nicely isolates you from th= e web server proper, making it very easy to run your client code at reduced= privileges;

- Javascript security policies mean that it's a pain in the arse to spl= it a complex site between two web servers; this means that it can become ra= ther hard to, for example, server static content from lighttpd and dynamic = content from your CMS server; life becomes much easier when you can serve e= verything from a single server.

I have actually in the past implemented a web app using my own mini HTTP se= rver. This was before I knew about Lua, so I actually did it in LambdaMOO c= ode. It *worked*, but if I'd known in advance what a pain it would be, = I wouldn't have done it like that...

--
=E2=94=8C=E2=94=80=E2=94=80=E2=94=80 =EF=BD=84=EF=BD=87=EF=BC=A0=EF=BD=83= =EF=BD=8F=EF=BD=97=EF=BD=8C=EF=BD=81=EF=BD=92=EF=BD=8B=EF=BC=8E=EF=BD=83=EF= =BD=8F=EF=BD=8D =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 http://www.cowlark.com =E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
=E2=94=82
=E2=94=82 "They laughed at Newton. They laughed at Einstein. Of course= , they
=E2=94=82 also laughed at Bozo the Clown." --- Carl Sagan

--0015174c36481d9cb10474a08f3f-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 07:23:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SAN7Oo007828; Mon, 28 Sep 2009 07:23:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D01611A6A6; Mon, 28 Sep 2009 07:22:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DD551A677 for ; Mon, 28 Sep 2009 07:22:28 -0300 (BRT) Received: by ewy26 with SMTP id 26so4436812ewy.5 for ; Mon, 28 Sep 2009 03:22:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.171.12 with SMTP id y12mr2922549ebo.51.1254133358415; Mon, 28 Sep 2009 03:22:38 -0700 (PDT) In-Reply-To: <4AC06FFC.7010702@infinite-interactive.com> References: <4AC06FFC.7010702@infinite-interactive.com> Date: Mon, 28 Sep 2009 12:22:38 +0200 X-Google-Sender-Auth: 7e9e551bfd7a20ad Message-ID: Subject: Re: Lua Test Code From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8SAN7Oo007828 2009/9/28 Mark Feldman : > I ported the entire Lua code base over to C# recently (including the parser > and libraries) and apart from a few remaining bugs in the GC it's getting > close to the point where I'll be wanting to release it. What would be the > best code to test against before I do? I vaguely remember someone mentioning > something about "test vectors" or something, is there a standard set of > samples that each release of the Lua source code is tested against before > release? > See my recent announcement : http://lua-users.org/lists/lua-l/2009-09/msg00500.html I hope that helps you. François. > Cheers, > > Mark Feldman > From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 07:51:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SAowm9009988; Mon, 28 Sep 2009 07:50:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23B9418615; Mon, 28 Sep 2009 07:50:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97F04185DF for ; Mon, 28 Sep 2009 07:50:18 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MsDoH-00034L-9v for lua@bazar2.conectiva.com.br; Mon, 28 Sep 2009 12:50:25 +0200 Received: from c-24-18-207-118.hsd1.wa.comcast.net ([24.18.207.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Sep 2009 12:50:25 +0200 Received: from stuart by c-24-18-207-118.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Sep 2009 12:50:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Transparent shallow copy of tables Date: Mon, 28 Sep 2009 03:49:56 -0700 Lines: 11 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-18-207-118.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean How can I do a shallow copy of a table that operates identically to the original? Currently I'm setting tables to be empty tables with metatables that save deletions and create similar shallow copies on index access, but this is causing problems with functions like table.concat(). I'd prefer to avoid a deep copy if possible, since that would take a long time regardless of access depth. My current approach is online at http://bazaar.launchpad.net/~stuart/sandpad/stuart/annotate/head%3A/sandpad.wlua. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 07:51:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SApTrn010066; Mon, 28 Sep 2009 07:51:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EBE01A5E5; Mon, 28 Sep 2009 07:50:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 008B41863A for ; Mon, 28 Sep 2009 07:50:49 -0300 (BRT) Received: by bwz10 with SMTP id 10so3527655bwz.5 for ; Mon, 28 Sep 2009 03:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rVPbqootmNcjzAsOeZeew2pYcez5UcrE7rodGQasfTg=; b=KuhUrJ19+hZNaY7iKtjcMaJTpd6So7ilxRuiK6g5rv51EBnrxFV6bt6OVV3c5+6aW9 qKvALmec9LYB53q1XzsNtdF+6asUkbJvPNbjRGTchQXYZnzkEbIbTvDRIuPPUqtgZbE6 GWlHCOFbJSeETmbOxMEuHTrNBO/9jB9xcqbNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rG0lbSGqQNETpGToq0QVK2cOmz7iHWiO4ob01oh/sbTpnZQ4DBmBpSJx5TCNMz0Z+A ADiYsM4pKcSQQa1j/L9XYV92FW4LTUtxYRejcdfg7RClYPNtq3AgUOAQd9qlGX34wWz4 chj7N5Ns8fJwIVQ1MWU3Wzaz0teS5BOGUF6Go= MIME-Version: 1.0 Received: by 10.239.190.207 with SMTP id y15mr251909hbh.151.1254135059266; Mon, 28 Sep 2009 03:50:59 -0700 (PDT) In-Reply-To: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> Date: Mon, 28 Sep 2009 12:50:59 +0200 Message-ID: <560972290909280350u4cefc304m1c9e41864adfe8f4@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8SApTrn010066 On Sun, Sep 27, 2009 at 10:04 PM, Linus Sjögren wrote: > Now, I have a question for you: > What would you like for this project? Now the question back would be: what would it offer, that is not offered by Sputnik or Nanoki? What kind of web application would it make easier? From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 07:57:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SAv68a010512; Mon, 28 Sep 2009 07:57:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 756DE1A673; Mon, 28 Sep 2009 07:56:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D13B11A5DD for ; Mon, 28 Sep 2009 07:56:28 -0300 (BRT) Received: by bwz10 with SMTP id 10so3531042bwz.5 for ; Mon, 28 Sep 2009 03:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Qcyo86ydJzRPYkc7LY/l0MozK+aJk7d9LW6CSkrjAY4=; b=YrSxqEw1FsuDoZj0U77fPrX7jAZdiUPMJsu4Cy6aqzxnPmecjo8/XaxJaH1ivpveX1 trg+oCtgtdI7U4RsN8nBOQlLvw7P0qZ9hPDjSVXQGIBq59Lo1BlM2QZDPFw/3FpHnTpA nVLrcYn6Y+z0WL9sGutmX2vJNpKhew8uJm3EI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YTFct/DTua9XJO7pDX6rG8D8Cf+gr04FrGZxucD0GmOWGYUjjbcPuQJE401bVxSav4 9Oyj2JqihvZV1ccgWWALlLkJu9RjcyeX4CfOz3vmOhFEow+bPI/puC+Q3zFP5Vpxz8H4 Uhp2NYsjPjMQuIvPvQcOsQhSVgdXfVdA3XOBU= MIME-Version: 1.0 Received: by 10.239.190.207 with SMTP id y15mr252257hbh.151.1254135398115; Mon, 28 Sep 2009 03:56:38 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Sep 2009 12:56:38 +0200 Message-ID: <560972290909280356v773e6011q5e82f8f5d507e839@mail.gmail.com> Subject: Re: Transparent shallow copy of tables From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 28, 2009 at 12:49 PM, Stuart P.Bentley wrote: > How can I do a shallow copy of a table that operates identically to the > original? OK, I'm trying to understand the application here; it is a copy, not a proxy (i.e. the modifications apply to the original object)? I suppose an object is identical when it behaves exactly like the original, but then a low-level function like table.concat() cannot be expected to work, unless it's a true copy. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 08:02:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SB2crT011243; Mon, 28 Sep 2009 08:02:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 379DA186E7; Mon, 28 Sep 2009 08:02:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBAE9185DF for ; Mon, 28 Sep 2009 08:01:59 -0300 (BRT) Received: by bwz10 with SMTP id 10so3534412bwz.5 for ; Mon, 28 Sep 2009 04:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ROWRl1cpgxp6+G3IsAbQ4vvqB0+2ddPCrIzQcohBjSc=; b=Frch6RnD5IBoznlBgFbCHYMwrJwL4uozwhA00jrfzW6ya8O44zJOUhhhFZYrQ2xb2N pnEHd1P8DMuo5uCNP5aUnx9PZT5pH0aPrHGf6siN6tUeKSJS+V4J9QfNswp18aQIP5// 93Ml78Z96PeoeHsMSo+69F9Ghc5dIsnGL/3UI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=MLTCvwS487Ya5i63wLxe9uJRwEqbeqoP3N5ZhVRBPRsSQwzjiHVLrTXTYlp/IGO9tL 7z/1lbhoqFZWFYbUzijnIEjKGlF7+KYPA0/CInWzJf6yZKgvo2Z+BcmVOkAtceduXSF/ KWaPNaeb3/MIa6JN2efPCdsxGcPq9m0nibv+s= MIME-Version: 1.0 Received: by 10.223.6.196 with SMTP id a4mr665924faa.94.1254135729160; Mon, 28 Sep 2009 04:02:09 -0700 (PDT) In-Reply-To: <48b7e23a0909280314g18cdc73du1764f345a067fcd2@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <48b7e23a0909280314g18cdc73du1764f345a067fcd2@mail.gmail.com> From: Leaf Storm Date: Mon, 28 Sep 2009 07:01:49 -0400 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8SB2crT011243 On Mon, Sep 28, 2009 at 6:14 AM, Linus Sjögren wrote: > Xavante is a web server, is it not? Yes, Xavante is a web server. The problem with developing just for Xavante is that, while it's *possible* to deploy using anything, it adds another layer on top of the original server if you want to use something besides Xavante as your world-viewable server. And no offense to Xavante, but most people (myself included) would probably prefer something like Apache, Lighty, or Nginx on the front lines. WSAPI still lets you deploy using just Xavante, and embed Xavante in the CMS for testing, but it also makes it easier to deploy to all those other servers out there. If you're serious about this project, you'll want to make sure that people can deploy it with less pain than having to set up a proxy. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 08:48:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SBmm3c015696; Mon, 28 Sep 2009 08:48:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A199D1A66A; Mon, 28 Sep 2009 08:47:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 120D118C83 for ; Mon, 28 Sep 2009 08:47:51 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8SBm2Ma026814 for ; Mon, 28 Sep 2009 08:48:02 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 94AD054C11D; Mon, 28 Sep 2009 08:48:02 -0300 (BRT) Date: Mon, 28 Sep 2009 08:48:02 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua Test Code Message-ID: <20090928114802.GA4963@inf.puc-rio.br> References: <4AC06FFC.7010702@infinite-interactive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC06FFC.7010702@infinite-interactive.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > [...] is there > a standard set of samples that each release of the Lua source code is > tested against before release? See http://lua-users.org/lists/lua-l/2008-06/msg00124.html -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 09:23:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SCNTdi019732; Mon, 28 Sep 2009 09:23:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 410B118CF8; Mon, 28 Sep 2009 09:22:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73D461891C for ; Mon, 28 Sep 2009 09:22:38 -0300 (BRT) Received: by bwz10 with SMTP id 10so3582044bwz.5 for ; Mon, 28 Sep 2009 05:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=T4U49U1qpIe0b8vc8YYCIAtHyX5edrT+po7S5vcm4XE=; b=gqBCmb6HqyhaAc2JLX8f4fVrw9d+U1Yrk6DZEXu+hMV3Glt7SkI21iJD4wNbCpb1NU JN4VMzUxBQ3WDsIfFHdWDM4fNZY38/CAJ0RdgmgHyQav6MjXwOX8k2NsdfK+Hh+hq1v3 uF0EZCGraeq3N9XJSUNn9yDBKfOFjtbEO+IO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=okOv2hVZB0uiTklylYeCSfiwGiQ2JrUqyWcyErt7P7wnvGGRGqpmyZJorZQfv+ER/w roGXzqI2zc+iRn8qPCw06SM+OUtCTN/aMs3rEg894LRQnChzGSI8QGy0GTL+9pu5SP15 qOpdTS9zFhstowcCCSfyhjJrW8Xwo48gUWcbU= MIME-Version: 1.0 Received: by 10.239.184.157 with SMTP id y29mr278880hbg.54.1254140563241; Mon, 28 Sep 2009 05:22:43 -0700 (PDT) In-Reply-To: References: <4ABF9A59.3010401@gmail.com> Date: Mon, 28 Sep 2009 14:22:42 +0200 Message-ID: <560972290909280522p1d43a8bq7d7f4b54ad1d3541@mail.gmail.com> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8SCNTdi019732 On Mon, Sep 28, 2009 at 2:35 AM, Thomas Harning Jr. wrote: > managed through accessors.  Now... if you have a typo when accessing > members of tables, that can be problematic.. though it's less likely > than typos when accessing items you intend to be in local-scope. With a little discipline, field name typos can be caught usefully: http://lua-users.org/wiki/StrictStructs e.g. struct.Point {X = 0, Y = 0} p1 = Point() -- defaults to {X=0,Y=0} p2 = Point {X=2,Y=10} print(p1.x) ---> oops! No such field! The other advantage is that it encourages developers to name all those anonymous data structures which we create so happily and then struggle to document. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 12:00:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SF0254021697; Mon, 28 Sep 2009 12:00:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5714A1A6A9; Mon, 28 Sep 2009 11:59:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD05F321B3 for ; Mon, 28 Sep 2009 11:59:08 -0300 (BRT) Received: by ewy26 with SMTP id 26so4674845ewy.5 for ; Mon, 28 Sep 2009 07:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=x7RDeaYs0gw9gzPBjGEkL5lyyhPPDMtr8gX2Ug5jU0k=; b=CrSXJMlF7DMrzTs28LTxN4Hn88ecIPsni5bcRuh2g0xHqlF2sMClN/cpHJpvMKoEGb A2ACNpw4M6CcfgdQ/ly3Y68tKRRCcHT5Qk+Je3S5uF6ZBNZX30ioVzsDTxEaOloK53VO /cocAFx5aJmhbIqquFT1R2E1a+dnO4OqWX0Ak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XLaZH3bi95gt0m0n5iMcFRQ8EmfbkcvkZjjba1ks4qOLlU1L/AEiD1Bpj6zJOGGb5I 6ir0D/ERAA5VV4t3MTKa+tRZVVAgBfNl8ESEfUecilw+2pjGcI3U1SE2DnRHwE7lpOpg yw/Io5AeF6zTEaTRCH1kskO5oc9kb9fHdnWa0= MIME-Version: 1.0 Received: by 10.211.147.25 with SMTP id z25mr3149637ebn.84.1254149957445; Mon, 28 Sep 2009 07:59:17 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Sep 2009 10:59:17 -0400 Message-ID: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> Subject: Re: Lua Digest, Vol 174, Issue 1 From: Mike Zraly To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636c5b8d8b56abd0474a48a2e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5b8d8b56abd0474a48a2e Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 28, 2009 at 7:47 AM, wrote: > Date: Sun, 27 Sep 2009 13:45:26 -0400 > From: Norman Ramsey > Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) > To: Lua list > Message-ID: <20090927174526.EAB8E600166C6@labrador.cs.tufts.edu> > > > Static typing and compile-time checks (including warnings to the max) > are > > indispensable. The alternative for dynamically typed languages are > > tests. > > Actually another quite respectable alternative is program analysis. > I ran into Kostis Sagonas at the airport and it seems he has had some > very good results using something he calls 'success types' for Erlang > programs. I would love to see similar technology applied to Lua. > > A paper is at > > http://user.it.uu.se/~kostis/Papers/contracts.pdf > > Norman > Actually, it might be an interesting idea to provide an interface to set (some) and get (all) information about a function object within the lua language itself. One might use this to expose annotations like type assertions, comment strings, and perhaps even more low-level information like the function's name and source location and whether or not the function calls yield directly. Couple with access to the calling function object, and transitively to the entire call stack, one might be able to do some interesting things at runtime. - Mike --001636c5b8d8b56abd0474a48a2e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Sep 28, 2009 at 7:47 AM, <lua-request@bazar2.conectiva.com.br= > wrote:
Date: Sun, 27 Sep 2009 13:45:26 -0400
From: Norman Ramsey <nr@cs.tufts.edu<= /a>>
Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?)
To: Lua list <
lua@bazar2.= conectiva.com.br>
Message-ID: <20090927174526.EAB8E600166C6@labrador.cs.tufts.edu>

=A0> Static typing and compile-time checks (including warnings to the ma= x) are
=A0> indispensable. The alternative for dynamically typed languages are<= br> =A0> tests.

Actually another quite respectable alternative is program analysis.
I ran into Kostis Sagonas at the airport and it seems he has had some
very good results using something he calls 'success types' for Erla= ng
programs. =A0I would love to see similar technology applied to Lua.

A paper is at

=A0 http://user.it.uu.se/~kostis/Papers/contracts.pdf

Norman

Actually, it might be an interesting idea t= o provide an interface to set (some) and get (all)
information about a f= unction object within the lua language itself.=A0 One might use this to
expose annotations like type assertions, comment strings, and perhaps even = more low-level
information like the function's name and source locat= ion and whether or not the function calls
yield directly.

Couple = with access to the calling function object, and transitively to the entire = call stack,
one might be able to do some interesting things at runtime.

- Mike


--001636c5b8d8b56abd0474a48a2e-- From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 12:34:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SFYYKS028752; Mon, 28 Sep 2009 12:34:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B01551891C; Mon, 28 Sep 2009 12:33:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07241186C1 for ; Mon, 28 Sep 2009 12:33:41 -0300 (BRT) Received: by ewy26 with SMTP id 26so4710546ewy.5 for ; Mon, 28 Sep 2009 08:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=6ghcyjf+vu3zFSoyCHlcl8D/WbPBjnyIXrQKYh0iefs=; b=XEWFealDNKChSCOk6XJi3r6y41nnkVxSzwUo8REB+9w35v/G6Iu71oXn+2gURipwID 1U5RofEEyRG5wsa1X9JOD/Uwz+L8CYh0eww4sS3qscBx/8Z/IsJy0VArdfDAhiJElzn/ ceFs3Wdewi2OAhSRFNHZFfchCUro8OSxkUFPQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Qa/7EsnoJ2BlghVaLiLaJFKNj7ITHh4BTEahaRCSQpDXl1V66EMMMlEMJtJiPLfPU7 mJxukQCQQVTt6zixlymw0N2scCOvzRbclnCwp7G+F0rduv0JSGICnoto7JwcuUVvK9Za MhRlCMXPuvucPr9niqopMUSeJF4wc1+nu0/eE= MIME-Version: 1.0 Received: by 10.216.87.68 with SMTP id x46mr919611wee.2.1254152032141; Mon, 28 Sep 2009 08:33:52 -0700 (PDT) In-Reply-To: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> References: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> From: Jerome Vuarand Date: Mon, 28 Sep 2009 17:33:32 +0200 Message-ID: <89d273ba0909280833t346a1a98r1b958fa3e1084baa@mail.gmail.com> Subject: Re: Lua Digest, Vol 174, Issue 1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/28 Mike Zraly : > On Mon, Sep 28, 2009 at 7:47 AM, > wrote: >> >> Date: Sun, 27 Sep 2009 13:45:26 -0400 >> From: Norman Ramsey >> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) >> To: Lua list >> Message-ID: <20090927174526.EAB8E600166C6@labrador.cs.tufts.edu> >> >> > Static typing and compile-time checks (including warnings to the max) >> are >> > indispensable. The alternative for dynamically typed languages are >> > tests. >> >> Actually another quite respectable alternative is program analysis. >> I ran into Kostis Sagonas at the airport and it seems he has had some >> very good results using something he calls 'success types' for Erlang >> programs. I would love to see similar technology applied to Lua. >> >> A paper is at >> >> http://user.it.uu.se/~kostis/Papers/contracts.pdf >> >> Norman > > Actually, it might be an interesting idea to provide an interface to set > (some) and get (all) > information about a function object within the lua language itself. One > might use this to > expose annotations like type assertions, comment strings, and perhaps even > more low-level > information like the function's name and source location and whether or not > the function calls > yield directly. You can already associate any kind of information to a function by using it as a weak key in a Lua table. However you need access to the debug library to access built-in informations, or simply to allow a function to get a reference to itself to use as a key in the weak tables I mentioned. > Couple with access to the calling function object, and transitively to the > entire call stack, > one might be able to do some interesting things at runtime. Still with debug.getinfo you can get access to the whole stack. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 12:46:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SFkNV0030864; Mon, 28 Sep 2009 12:46:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6922D1A6A0; Mon, 28 Sep 2009 12:45:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4F011A5DE for ; Mon, 28 Sep 2009 12:45:44 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8SFjuMd020953 for ; Mon, 28 Sep 2009 12:45:56 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 79D6554C11D; Mon, 28 Sep 2009 12:45:56 -0300 (BRT) Date: Mon, 28 Sep 2009 12:45:56 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua Digest, Vol 174, Issue 1 Message-ID: <20090928154556.GA7583@inf.puc-rio.br> References: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> <89d273ba0909280833t346a1a98r1b958fa3e1084baa@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89d273ba0909280833t346a1a98r1b958fa3e1084baa@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > You can already associate any kind of information to a function by > using it as a weak key in a Lua table. However you need access to the > debug library to access built-in informations, or simply to allow a > function to get a reference to itself to use as a key in the weak > tables I mentioned. You do not need any reference; the function itself can be the key. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 12:53:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SFrd8n032655; Mon, 28 Sep 2009 12:53:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D90FC1A6A2; Mon, 28 Sep 2009 12:53:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2FAE1840A for ; Mon, 28 Sep 2009 12:52:57 -0300 (BRT) Received: by ewy26 with SMTP id 26so4729489ewy.5 for ; Mon, 28 Sep 2009 08:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=+pUV6s4jO1bqwBbRIpcxAC3id9/wh4a3mZpLtyjidEw=; b=UJr9+cJJkixitVF5aucto5ecsSznpFT8ujUk3VoHrU5TzIandBDnS0wIPr8/uxfAW0 MaYbeZVcyu2L6sBZh3Hz0p2eJ0qKWLiLRrbjzNceg8Fo9gDVV9Q0dSlqLohh8z5JoFxF xmlxEE7m8ADbaqR3G4iPPJdDVphPLMeftO6rs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=PkrgFOHRUzoptsB6hV3vY4O8scLCXH+zbJGAn8fjb9fTfe3pZHW2/80av3A1tfLTCx Jr3rUFNGhYtVohWXyH2an/5OERL2bdB6s6jLypHjBdTam0M6FGKfF/+DiS8PoGfbPlEr boKeygXs05v8+eRxCAGKdQ4bG2cagGjpnFPCo= MIME-Version: 1.0 Received: by 10.216.9.81 with SMTP id 59mr823207wes.34.1254153187301; Mon, 28 Sep 2009 08:53:07 -0700 (PDT) In-Reply-To: <20090928154556.GA7583@inf.puc-rio.br> References: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> <89d273ba0909280833t346a1a98r1b958fa3e1084baa@mail.gmail.com> <20090928154556.GA7583@inf.puc-rio.br> From: Jerome Vuarand Date: Mon, 28 Sep 2009 17:52:47 +0200 Message-ID: <89d273ba0909280852g4fa5e24dye3fa4ed4e6a13122@mail.gmail.com> Subject: Re: Lua Digest, Vol 174, Issue 1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/28 Roberto Ierusalimschy : >> You can already associate any kind of information to a function by >> using it as a weak key in a Lua table. However you need access to the >> debug library to access built-in informations, or simply to allow a >> function to get a reference to itself to use as a key in the weak >> tables I mentioned. > > You do not need any reference; the function itself can be the key. I meant something like that: local ptypes = {} function foo(a) assert(type(a)==ptypes[debug.getinfo(1, 'f').func][1], "invalid parameter type") return a + 42 end ptypes[foo] = {'number'} Is there any other way to use the currently executing function as a key ? From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 13:06:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SG6HOt003824; Mon, 28 Sep 2009 13:06:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 067061A6A4; Mon, 28 Sep 2009 13:05:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DE181A5DD for ; Mon, 28 Sep 2009 13:05:32 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n8SG5hY9022753 for ; Mon, 28 Sep 2009 13:05:43 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id C6EF354C11D; Mon, 28 Sep 2009 13:05:43 -0300 (BRT) Date: Mon, 28 Sep 2009 13:05:43 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua Digest, Vol 174, Issue 1 Message-ID: <20090928160543.GA7843@inf.puc-rio.br> References: <2a5649da0909280759u2782b9f3i267be0bae1018be6@mail.gmail.com> <89d273ba0909280833t346a1a98r1b958fa3e1084baa@mail.gmail.com> <20090928154556.GA7583@inf.puc-rio.br> <89d273ba0909280852g4fa5e24dye3fa4ed4e6a13122@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89d273ba0909280852g4fa5e24dye3fa4ed4e6a13122@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > 2009/9/28 Roberto Ierusalimschy : > >> You can already associate any kind of information to a function by > >> using it as a weak key in a Lua table. However you need access to the > >> debug library to access built-in informations, or simply to allow a > >> function to get a reference to itself to use as a key in the weak > >> tables I mentioned. > > > > You do not need any reference; the function itself can be the key. > > I meant something like that: > > local ptypes = {} > > function foo(a) > assert(type(a)==ptypes[debug.getinfo(1, 'f').func][1], "invalid > parameter type") > return a + 42 > end > ptypes[foo] = {'number'} > > Is there any other way to use the currently executing function as a key ? No; you are right. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 14:11:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SHBsaJ018867; Mon, 28 Sep 2009 14:11:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA031A6AC; Mon, 28 Sep 2009 14:10:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB9561A676 for ; Mon, 28 Sep 2009 14:10:42 -0300 (BRT) Received: by bwz10 with SMTP id 10so3809405bwz.5 for ; Mon, 28 Sep 2009 10:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=4l5qMo2ZejHv8ieRwnl5ib8PwxfiC1YCRCLKVWzYurA=; b=HVzeSgyr13qdyP9laCHW7v9IjcSJnFKTU6LUGHo+luMUcP3Ifl3SAHsDmude8A/FLH alsDXPqw6SFRuGromSeTY3jlHfI1Sy4q/1Mxi8HNfN0818AjtbiFqMFPlal8fUsDvSwv gmuLVmrVOXm42BXvry3GLtYEoCIprMseRIr9s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=A11zkn6XI2H9TuT1VOUaXCfiTrtuNLMOrs7Y62zn9Cmi5CyOyp0m6sMwsVyiSJJE92 IcNdNSDYoCSSrx6MyQbgOsg7LxP+AvQbGXvoo0qqOCse5nKSjCTSm9MHUYH5ld3geTsk vjaXuLVemWYj1ImG8m3eAko1ee8oe3vcNUZoM= Received: by 10.204.155.65 with SMTP id r1mr3223969bkw.143.1254157851982; Mon, 28 Sep 2009 10:10:51 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 21sm4162168fks.39.2009.09.28.10.10.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Sep 2009 10:10:50 -0700 (PDT) Message-Id: <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4ABFF2CD.8060006@cowlark.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Mon, 28 Sep 2009 19:10:19 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 28, 2009, at 1:18 AM, David Given wrote: > Petite Abeille wrote: > [...] >> Hmmm... so... HTTP -> Apache -> (Fast?)GCI -> WSAPI -> stuff... >> what about HTTP -> stuff instead? > > You mean, do an HTTP mini-server in the CMS app itself? Yes, the application "speaks" HTTP natively. > There are four major problems with this approach: > > - doesn't play nicely with a third-party web server; you either end > up having to run two outward-facing servers on a single box, or else > have your main web server proxy to the CMS server, which is usually > a pain; Always been under the impression that HTTP is meant to be proxy'ed. That apparently some common web servers make it difficult is, well, unfortunate... for those web servers that is :) > - HTTP ain't as simple as at looks, particularly when dealing with > stuff like multipart, transfer encoding, negotiating compression and > so on; targeting something like WSAPI makes all these problems go > away, as the main web server does it for you; Ditto with proxies, you can leave each proxy to specialize in whatever it does well. Very similar to the basic concept of stdin/stdout in Unix. Not every tool needs to implement everything. Instead, one can pipeline processing from one to the other. The lingua franca being HTTP. > - having two HTTP servers means that you've double the chances of > exposing a security flaw to the outside world; WSAPI nicely isolates > you from the web server proper, I always wonder why people want to be "isolated" from HTTP: what's the benefit of ignoring the most fundamental protocol a web application is supposed to deal with? A bit like wanting to access a relational database, but not wanting to bother with SQL. > making it very easy to run your client code at reduced privileges; One could argue the other way around: "Complexity is insecurity" http://www.daemonology.net/blog/2009-09-04-complexity-is-insecurity.html > - Javascript security policies mean that it's a pain in the arse to > split a complex site between two web servers; this means that it can > become rather hard to, for example, server static content from > lighttpd and dynamic content from your CMS server; life becomes much > easier when you can serve everything from a single server. One doesn't have to expose implementation/deployment details to the outside word. How one system is setup internally is one system private business. > I have actually in the past implemented a web app using my own mini > HTTP server. This was before I knew about Lua, so I actually did it > in LambdaMOO code. It *worked*, but if I'd known in advance what a > pain it would be, I wouldn't have done it like that... Fair enough :) Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 16:32:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SJWA8K020544; Mon, 28 Sep 2009 16:32:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A394918AF1; Mon, 28 Sep 2009 16:31:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 854FF18A61 for ; Mon, 28 Sep 2009 16:31:16 -0300 (BRT) Received: by fxm12 with SMTP id 12so4487678fxm.5 for ; Mon, 28 Sep 2009 12:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=A1fCHshjlmplkfUv/fWkWmwZOi0+v3epmEqTMyTsIes=; b=LzZEFL26Byt+aYORvEXzzcOrJi/fSEw3DWbJwIGWn0+kt7LySsmW0q/l2ySt+CXOts EwR0C8EnN3z1vBpg1od3jAJgUxpUry7E2Im6er/T0DvGFRrWUrJ8z+Bv8J0XYPXQJAZD /nEhM3RTHVFnnuPISvOIozFjtz3tvezGIcV+Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qMNLwVhrkm1hQr0RBGJ6TNbREAJ3ppkn2MZpywSi0Nh/zRhe8g4udOjW5UO6rCXUIm gr+9kT4r1q1Hyuz4N+66N8c4FuLlLQn3IyD7MisktIk93za/GmpY497gZ3tUEH1XnwH3 m4ZrjHLJZElYracc6wNXwzi81WNBIPBuit+OA= MIME-Version: 1.0 Received: by 10.204.10.143 with SMTP id p15mr3287062bkp.167.1254166286388; Mon, 28 Sep 2009 12:31:26 -0700 (PDT) In-Reply-To: <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Mon, 28 Sep 2009 21:31:26 +0200 Message-ID: <9386fb2d0909281231w451e9a93kf9c388726a1fdf37@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I always wonder why people want to be "isolated" from HTTP: what's the > benefit of ignoring the most fundamental protocol a web application is > supposed to deal with? A bit like wanting to access a relational database, > but not wanting to bother with SQL. I think it's kinda the other way around, where HTTP represents a specific database api, with SQL 'isolating' the implementation specifics from the programmer, and lets him use SQL anyway. As databases & SQL is not something i find interesting, this may be incorrect, but it's how i've understood it =p From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 18:52:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SLqDE1016317; Mon, 28 Sep 2009 18:52:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2ACA1A6BB; Mon, 28 Sep 2009 18:51:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9467D1A683 for ; Mon, 28 Sep 2009 18:51:15 -0300 (BRT) Received: by ewy26 with SMTP id 26so5041535ewy.5 for ; Mon, 28 Sep 2009 14:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=3UmMuAZzc9wB70h81LMWor32HJlp7XNzwhDce4ZMjPE=; b=h1o7yfhFBPtsl6/uLDNCbbRe1QH1EKVg1eYGf/KWAMWLehiOs24TwEo5E6P6sMy0Bz tF+i9uUgoHQ3yFpg6MYj/TlNOGrP7A3vugE56+jHbdQfL7guV9BACAG3nfQWLT451SYL Jhi4R7nqh7OZTQREney2yTZM+QL8PH09typ2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=v09JqIjTF33hOZdvHVgw+eZKCY6qXkSwki1jSLMg5FbWSz852NgvCxtKxGgjGjPEk5 v2G8qym5rNxxABgrs6pdyQ0yFlrz7zAdleJjzkNEwqKxBcbD6rj+390ScL4yt0++pxWt irjLwF0DkNz7A6U7CTmFiv1YhxBv5J0qBt1Os= MIME-Version: 1.0 Received: by 10.216.54.79 with SMTP id h57mr976412wec.164.1254174683410; Mon, 28 Sep 2009 14:51:23 -0700 (PDT) In-Reply-To: <4ABF9A59.3010401@gmail.com> References: <4ABF9A59.3010401@gmail.com> Date: Mon, 28 Sep 2009 23:51:23 +0200 Message-ID: Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: Eike Decker To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I think you are quite right. I'm a big fan of Lua too, but I've failed with > the first larger project I tried writing completely in Lua (less than 10K > lines). Of course, I made mistakes, but I still think that large projects > need every possible tool to remain reasonably maintainable and bug-free. > Static typing and compile-time checks (including warnings to the max) are > indispensable. I don't agree on that - like other posters on this topic, I believe that static type checking is catching only the easy bugs. If I write a piece of code (any language) I have to test if it works, either manually or automatically with a test. And my experience is that most typos are caught in that process anyway. Also, if you run into a typo of your code later on, you will notice that you haven't tested that piece of code at all - and this alarm is actually a good and not a bad thing ;). If there's a typo error left, a logic error is not unlikely as well because this code path obviously hasn't been tested at all - so you are warned about the next possible error source... which is not going to happen in a static language but it will eventually fail with a much different report that will make you waste your time on finding the real source (the untested code). With a static language you will run into such problems in a deterministic manner where you believe that the used code is working. In my experience, untested code is rarely bugfree (real bugs, not typing / spelling bugs). My personal list of time waste during programming looks different (not only Lua specific) (in descending time wasteness - the ones that waste most time are on top): - missing documentations - bad error reports on runtime errors (seg faults, no stack trace, mindless error messages) - catchalls, e.g. try {...} catch(e) {} - code duplicates (copy paste code that is buggy) - logic errors (e.g. x*x+y*z+z*z) - compiler / linker problems with unforeseen version incompatibilities - lack of code optimization - mindless documentation of functions that is useless because it doesn't tell me more on a method/function than I can read from its name anyway, but that is cluttering the source files (e.g. javadoc for method "addItem" doc-> "adds an Item") - and this is in my opinion a phenomenon of IDE driven development This is my subjective list of bad code symptoms that is causing me to waste my time. I don't list "wrong types" - It scarcely happens to me and is in my opinion trivial - most often at least. So what is static typechecking really helping here? Discipline! Every time you get lazy, your compiler is throwing you an error message on your head. If you do mad stuff in Lua (and you can do), and you don't doc it, you are lost. But that's also bad if you do it in C++. Static type checking is only helping you so far that the least amount of documentation, that is totally required, exists. And as written above, it might prevent you later on from discovering that you are using untested code as well. Also, in my opinion, my problem list is worse in static checked languages and better in dynamic languages (mostly, some points are worse with dynamic languages). For example, the debug library in Lua allows me a much finer debug control than I am getting with Java. I don't have to rely on an IDE to do debugging, I can do it myself with a simple texteditor. And that grants me flexibility. Another point for me is that my Lua code tends to be shorter than other code. Not unreadable shorter but meaningful shorter. Closures that I am using like macros are helping here a big deal. There is something that I call syntax-information-ratio: Syntax is what the language needs to run, information is logic or simply data like strings. Repetitive patterns don't contain information. If I need initializers and I notice I am writing something like that (made up thing but I hope you get the point): foo.bar.vec.x = 1 foo.bar.vec.y = 2 foo.bar.vec.z = 3 I am replacing it with something like that set(foo.bar.vec) .x (1) .y (2) .z (3) where set is function set(tab) local proxy = {} local function kset (t,key) return function (val) tab[key] = val return proxy end end setmetatable(proxy,{__index = kset}) return proxy end I am normally trying to reduce repetitive patterns in my code and I find this more fun to do in Lua or Javascript than using macros in C. But in my experience, the programming language is not as important as experience in the team so I consider these arguments as weak anyway. No language will come to your help if your team is doing a bad job. The sooner this real problem shows up, the better. So languages that don't delay this fact are in my opinion "better". cheers, Eike From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 18:55:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8SLt0Tg016693; Mon, 28 Sep 2009 18:55:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 396A11A6BE; Mon, 28 Sep 2009 18:54:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas01p.mx.bigpond.com (nschwmtas01p.mx.bigpond.com [61.9.189.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 452381A6B8 for ; Mon, 28 Sep 2009 18:54:23 -0300 (BRT) Received: from nschwotgx02p.mx.bigpond.com ([143.238.91.39]) by nschwmtas01p.mx.bigpond.com with ESMTP id <20090928215428.XOXV3375.nschwmtas01p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com> for ; Mon, 28 Sep 2009 21:54:28 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20090928215428.XYSL4842.nschwotgx02p.mx.bigpond.com@[10.0.0.8]> for ; Mon, 28 Sep 2009 21:54:28 +0000 Message-ID: <4AC12E8C.6040201@bigpond.net.au> Date: Tue, 29 Sep 2009 07:45:48 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Transparent shallow copy of tables References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx02p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Mon, 28 Sep 2009 21:54:28 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150205.4AC13094.00AC,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stuart P.Bentley wrote: > How can I do a shallow copy of a table that operates identically to > the original? Currently I'm setting tables to be empty tables with > metatables that save deletions and create similar shallow copies on > index access, but this is causing problems with functions like > table.concat(). > > I'd prefer to avoid a deep copy if possible, since that would take a > long time regardless of access depth. This sounds like an idea I had for the capability to commit or roll-back changes to process state as a form of transactional memory. The issue is that this would need to be applied to all tables Lua constructed, which would necessarily slow down the system (too much?). What is the use case for this? -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Mon Sep 28 21:00:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8T00FEf030843; Mon, 28 Sep 2009 21:00:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A41DF1A6B7; Mon, 28 Sep 2009 20:59:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56F921A669 for ; Mon, 28 Sep 2009 20:59:25 -0300 (BRT) Received: by fxm12 with SMTP id 12so4657481fxm.5 for ; Mon, 28 Sep 2009 16:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Xr7GLuEJwt6WeydI093RmKaEhN1J3HMeL84flfjSrKg=; b=uIeujhULSJ6L5VAzh+u2SuTTr69/sbRP5wGAtRaPO8/mVzgJPf+DZeJVaXamnvcYwY lZHnsW5REJulLMKLnDOeIFro6JnSsS8PnlBC4GMc/pwNxiNPVF+8aNE1EEs2KLgGnGWW nuFHsy4oA91NCRfdAJRhDf7CK7wBk+YK+EwMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gp5xNuhJ0JFMNN/AfIXaO3oV1zBFibUtFMHoAnVrW6NhQ/NR+aDT/204GC4Vt3gA6n ZgqdbWfV88g/aWcAJKyHt8faLIbyBFVtbB+eDEZbqAHxFkthd1YEoggq5hSX+KYddgs9 DiBukfB970qIsfMHOAnmdz2J0j9OVyog8Be8k= MIME-Version: 1.0 Received: by 10.223.98.19 with SMTP id o19mr1010827fan.82.1254182374181; Mon, 28 Sep 2009 16:59:34 -0700 (PDT) In-Reply-To: <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> From: Leaf Storm Date: Mon, 28 Sep 2009 19:59:14 -0400 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 28, 2009 at 1:10 PM, Petite Abeille wrote: > Always been under the impression that HTTP is meant to be proxy'ed. That > apparently some common web servers make it difficult is, well, > unfortunate... for those web servers that is :) HTTP wasn't meant to be proxied at all. Tim Berners-Lee created HTTP to serve static documents and provide simple interactive services. And the main problems with proxying are that (a) it takes more system resources to run multiple servers (especially if one is written in an interpreted language like Lua [although it isn't as bad as a Ruby server in terms of resources]), and (b) it turns one HTTP request into two, which is much more overhead than communicating over FastCGI or running a script inside the server. > Very similar to the basic concept of stdin/stdout in Unix. Not every tool > needs to implement everything. Instead, one can pipeline processing from > one to the other. The lingua franca being HTTP. Though I admire the Unix philosophy, you are misapplying it here. In Unix, the tools have highly non-overlapping *functionality* - 'grep' filters lines that match a pattern, 'cut' selects different parts of a line. "Do one thing and do it well" works well here, because the interface between 'grep' and 'cut' is very simple - plain text only, in a sequential, ordered stream, and they have differing enough functionality that it is practical to split them instead of combining the two. But with HTTP, there are *many* things that each server has to do that overlap related to parsing the request, like handling encodings correctly, validating headers, etc. In addition, they have similar enough functions - 'respond to a user's request for a Web page' - that this kind of code is not worth repeating across various different programs. Also, programs like 'grep' and 'cut' spawn, do their job, and close quickly, in non-time-critical settings (for the most part [I still think writing initscripts in sh is a mistake]). But for a reasonably big Web site, your arrangement would have several different server processes all using sockets, files, RAM, and other resources for long periods of time, to do the same jobs multiple times per request. > I always wonder why people want to be "isolated" from HTTP: what's the > benefit of ignoring the most fundamental protocol a web application is > supposed to deal with? Do you write your programs directly invoking POSIX system calls and using primitive types? No, because while this may be the more "pure" method, it is more complicated and puts more work on you, the programmer. That's why Lua has the 'os' and 'io' tables instead of a 'syscalls' table - or tables at all. The reason WSAPI, WSGI, [Fast]CGI, etc. all exist is so that people don't have to try getting everything about HTTP right themselves. They have a layer that does it for them, and a layer that is guaranteed to do it well, so they can focus on the *application*, rather than the infrastructure. > A bit like wanting to access a relational database, > but not wanting to bother with SQL. As Pierre said, that is a faulty analogy. SQL is more like a layer on top of the low-level transport protocol (HTTP) - but it's not like WSAPI either (an API that "wraps" the transport protocol). Instead, it's more like XML-RPC - a common method for making requests over the transport protocol. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 01:20:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8T4KFUm023786; Tue, 29 Sep 2009 01:20:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3F4B18899; Tue, 29 Sep 2009 01:19:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64A1A18883 for ; Tue, 29 Sep 2009 01:19:27 -0300 (BRT) Received: by iwn8 with SMTP id 8so2923611iwn.33 for ; Mon, 28 Sep 2009 21:19:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.120.88 with SMTP id c24mr7613528ibr.49.1254197978419; Mon, 28 Sep 2009 21:19:38 -0700 (PDT) Date: Tue, 29 Sep 2009 00:19:38 -0400 X-Google-Sender-Auth: 4809f2e2d000c52f Message-ID: Subject: static analysis in lua [was Re: Lua Digest, Vol 174, Issue 1] From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8T4KFUm023786 On Mon, Sep 28, 2009 at 10:59 AM, Mike Zraly wrote: > > http://user.it.uu.se/~kostis/Papers/contracts.pdf > Actually, it might be an interesting idea to provide an interface to set > (some) and get (all) > information about a function object within the lua language itself.  One > might use this to > expose annotations like type assertions, comment strings, and perhaps even > more low-level > information like the function's name and source location and whether or not > the function calls > yield directly. I've experimented with some things like that in luaanalyze [1]. The basic concept and implementation is rather simple (< 300 lines in luaanalyze/tools.lua:process_comments and luaanalyze/walk.lua). Lua code embedded inside specially formatted Lua comments (i.e. prefixed by "!") can be executed prior to run-time by an external static checker tool. The embedded code has access to the AST and the lexical location in which its containing comment exists within the AST. The embedded code can query and decorate the AST. Users can write their own functions for doing this, or they can use predefined functions, the latter of which includes things like decorating objects with type and contract information and performing rudimentary inferences and checking on that information. Unfortunately, I haven't spent the time to make this production grade, and I haven't gotten into the practice of using this much (rather, my static analysis practices in Lua have largely remained limited to "luac -p -l file.lua | grep ETGLOBAL" or "checkglobals()"). As said, after removing the optional stuff, the basic code is rather simple though and could be reused as a basis for work by others. Most of the heavy-lifting of generating the AST is provided for us by the Metalua libraries (currently bundled with the distribution). [1] http://lua-users.org/lists/lua-l/2009-08/msg00260.html From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 01:47:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8T4lmMm026153; Tue, 29 Sep 2009 01:47:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6C6D1A6CA; Tue, 29 Sep 2009 01:47:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 855A41A6C6 for ; Tue, 29 Sep 2009 01:47:11 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBACwuwUrLzkiT/2dsb2JhbAAI1wuEHgWCPQ X-IronPort-AV: E=Sophos;i="4.44,470,1249228800"; d="scan'208";a="507160718" Received: from unknown (HELO [10.1.1.2]) ([203.206.72.147]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 29 Sep 2009 12:47:19 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: Jacques Chester In-Reply-To: Date: Tue, 29 Sep 2009 12:47:18 +0800 Content-Transfer-Encoding: 7bit Message-Id: <0860B5AF-D4D5-4149-B652-08B3C9111DB0@chester.id.au> References: <4ABF9A59.3010401@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 29/09/2009, at 5:51 AM, Eike Decker wrote: > I don't agree on that - like other posters on this topic, I believe > that static type checking is catching only the easy bugs. If I write a > piece of code (any language) I have to test if it works, either > manually or automatically with a test. And my experience is that most > typos are caught in that process anyway. It depends a lot on what we're talking about in terms of 'static typing'. If we're talking about C++ and Java, for example, then it only lends so much. If, on the other hand, we're talking about later schemes, then it gives you an awful lot of help. I've done a little F# this year (it's an ocaml spinoff) and I was surprised at how much the compiler could deduce from my definitions. It spotted potential errors I'd never have thought of -- and wouldn't have tested for. But I don't think testing is mutually exclusive with static typing. There are things that are easier to express as tests than types and vice versa. As for Lua, it's a marvellous language and dynamic typing is part of its DNA. But this fact detracts nothing from statically typed languages IMO. They're just different. /2c Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 03:38:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8T6cWSZ001936; Tue, 29 Sep 2009 03:38:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 827511A6CE; Tue, 29 Sep 2009 03:37:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out6.iinet.net.au (outbound.icp-qv1-irony-out6.iinet.net.au [203.59.1.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E41E9321B3 for ; Tue, 29 Sep 2009 03:37:45 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBAK9HwUrLzkiT/2dsb2JhbAAI1y6EHgWCPQ X-IronPort-AV: E=Sophos;i="4.44,471,1249228800"; d="scan'208";a="10895230" Received: from unknown (HELO [10.1.1.2]) ([203.206.72.147]) by outbound.icp-qv1-irony-out6.iinet.net.au with ESMTP; 29 Sep 2009 14:37:52 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: What would _you_ like in a Lua CMS? From: Jacques Chester In-Reply-To: <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 14:37:51 +0800 Content-Transfer-Encoding: 7bit Message-Id: <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 29/09/2009, at 1:10 AM, Petite Abeille wrote: > > I always wonder why people want to be "isolated" from HTTP: what's > the benefit of ignoring the most fundamental protocol a web > application is supposed to deal with? A bit like wanting to access a > relational database, but not wanting to bother with SQL. We want to be isolated from high costs of changing site architecture, not from HTTP per se. There's also performance considerations. Lighttpd is faster at serving static files than Lua. A *lot* faster. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 04:38:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8T7cYfh008643; Tue, 29 Sep 2009 04:38:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C984B1A6D6; Tue, 29 Sep 2009 04:37:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from www55.your-server.de (www55.your-server.de [213.133.104.55]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A56501A672 for ; Tue, 29 Sep 2009 04:37:42 -0300 (BRT) Received: from [24.68.159.14] (helo=mir) by www55.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MsXHF-0007AB-Mc for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 09:37:38 +0200 Date: Tue, 29 Sep 2009 00:37:11 -0700 From: Tobias Kieslich To: Lua list Subject: Re: What would _you_ like in a Lua CMS? Message-ID: <20090929073711.GA23098@mir> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ABFF2CD.8060006@cowlark.com> Priority: normal User-Agent: Mutt/1.5.20 (2009-06-14) X-Authenticated-Sender: tobias@justdreams.de X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Clear (ClamAV 0.95.1/9848/Tue Sep 29 05:48:16 2009) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean On Mon, 28 Sep 2009, David Given wrote: > Petite Abeille wrote: > > - doesn't play nicely with a third-party web server; you either end > up having to run two outward-facing servers on a single box, or else > have your main web server proxy to the CMS server, which is usually > a pain; Most setups don't work this way, instead one server is negotiating if it is static and serves the file or dynamic and pipes it through to the application server it proxies on some other port. That aaplication server itself speaks HTTP of cause and does the actual parsing and routing(url to entry point) etc. There are lots of benefits to have a tightly coupled Http server with your application. Most APIs require to copy requests in memory which creates overhead. A tightly coupled server can pass references instead. While the proxying behind some well proven server, be it nginx or Apache creates some complexity for a single machine setup it also has a few great advantages: - Basic scaling is a as simple as setting up another machine with just one application server proxied through the main machine - For development people don't have to resemble production environments with apache and module configuration, the embedded httpserver is sufficient for application development - applications with embedded servers are in many cases well encapsulated and can live in a single directory, without any dependencies to the system they are deployed on. That means it's simple to pack them up and mov'em to another machine. The more self contained an application is the simpler and less error prone the deployment process is. Sysadmins will love it. > - HTTP ain't as simple as at looks, particularly when dealing with > stuff like multipart, transfer encoding, negotiating compression and > so on; targeting something like WSAPI makes all these problems go > away, as the main web server does it for you; Yes, writing your own HTTP engine, which is evidently what the op wants to do is not trivial, but it has the advantage of potentially tight coupling to the application at lower costs. > - having two HTTP servers means that you've double the chances of > exposing a security flaw to the outside world; WSAPI nicely isolates > you from the web server proper, making it very easy to run your > client code at reduced privileges; As written to the first point, in many cases only one server will face the outside world. The embedded server will listen to localhost only(if deployed onto the same machine). Client code can run as a dedicated user, there is no privelidge isssue since all communication happens across a socket via HTTP. > I have actually in the past implemented a web app using my own mini > HTTP server. This was before I knew about Lua, so I actually did it > in LambdaMOO code. It *worked*, but if I'd known in advance what a > pain it would be, I wouldn't have done it like that... Sounds like a fun project though and you learnt a lot from it. Regards, -T From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 07:41:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TAev9O024751; Tue, 29 Sep 2009 07:41:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23AC61A6B7; Tue, 29 Sep 2009 07:40:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE9371A65D for ; Tue, 29 Sep 2009 07:40:06 -0300 (BRT) Received: by yxe37 with SMTP id 37so5969321yxe.33 for ; Tue, 29 Sep 2009 03:40:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.58.2 with SMTP id g2mr3608822aga.73.1254220816041; Tue, 29 Sep 2009 03:40:16 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 13:40:15 +0300 X-Google-Sender-Auth: 938a06f11155bf1b Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> I always wonder why people want to be "isolated" from HTTP: what's the >> benefit of ignoring the most fundamental protocol a web application is >> supposed to deal with? > > Do you write your programs directly invoking POSIX system calls and > using primitive types? No, because while this may be the more "pure" > method, it is more complicated and puts more work on you, the > programmer. That's why Lua has the 'os' and 'io' tables instead of a > 'syscalls' table - or tables at all. The reason WSAPI, WSGI, > [Fast]CGI, etc. all exist is so that people don't have to try getting > everything about HTTP right themselves. They have a layer that does it > for them, and a layer that is guaranteed to do it well, so they can > focus on the *application*, rather than the infrastructure. It's incredible how we can fool ourselves that these so-called abstraction layers are made to provide simpler/easier APIs to their users. Lua's os and io libraries aren't made so that people don't have to get _files_ right themselves :) Same with WSAPI, LuaSQL, etc. The only reason to have those layers is so you can interchange the backends. In exchange of that you get a library of limited functionality, that sooner or later you'll have to bypass with ridiculous hacks to access the functionality they abstract away. Examples: - lua io: hack it to get OS error codes - WSAPI: send pseudo-http headers that only apache understands to control compression. WSAPI cannot put one bit of functionality in its API that isn't supported (or can't be easily emulated) by all of it's supported backends. This is the main force that drives the design of those APIs. >From the user pov, these are totally arbitrary choices, not deliberate exercises in elegance and simplicity. If the primary reason to abstract http away would be simplification, you'd have this put on a library instead. A library you can use if you like when you like, and you can also _not_ use when you need not to (you could even use two libraries on the same http stream). You'd have both abstraction and control at the same time. That being said, I acknowledge the bad feeling of isolation from http that you get with these layers, both practically and theoretically. > A bit like wanting to access a relational database, but not wanting to bother with SQL. I think this analogy is accurate if you think about what O/R mappers have done to poor people around the world :) At the same time, only someone who has _implemented_ an O/R mapper can tell you how delusional is the SQL-as-abstraction-layer view of SQL :) In all RDBMSs that I've worked with, almost everything that's available in the procedural API is also available in SQL form. Let's not confuse abstracting functionality with merely abstracting the access method. Ironically, dumbing down your use of SQL to the common set of functionality available on all compliant servers goes against many criteria for choosing a server in the first place :) but I diverge. The unix way (chaining pipes) approach is as valid a model for http as for any other protocol. IMHO the problem is merely cultural - very few people code this way nowadays. Although complex programs, like postfix for instance, work amazingly well using this awkward model (I admit it though I hate postfix). From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 07:55:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TAtEU9026137; Tue, 29 Sep 2009 07:55:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 059D518B12; Tue, 29 Sep 2009 07:54:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F16818A74 for ; Tue, 29 Sep 2009 07:54:35 -0300 (BRT) Received: by bwz10 with SMTP id 10so4321217bwz.5 for ; Tue, 29 Sep 2009 03:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=D8wHaXY+mSddS7P/9pT3Jb9WCF0LwPSoF57UI1UEgJE=; b=oxjJXVSh2RIAI5YbN6Ql0XFV8DiaJkThMyOPoItCdaHILPvKZBI+rDoi6EgvVg1zhv oX58kNS/a5AtQjDIJpEly52cK0tJbj5xyiC8FwXdkwaoXPlqbiilx/2tKwRyX4y2IFU2 CLqSb8z/Usuq2xZvUNoPnPQNlEnAeVXHchoGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ilpnr5evvBESzg6FYcPFYRxn9WNsFYYI1TMwva/bsKhZ5zXHU0LzxadTnQYgbHv0u/ qT78OEs9UY1PdoxROlXarhJGBLurdTILSPcDei7Hs7CUyPwGtmZXjJn5A1fkqe/oNggU sg8n7Q0CEM18B2AKrApFjpXMf258gZ/CxqAU8= MIME-Version: 1.0 Received: by 10.239.182.150 with SMTP id q22mr351016hbg.73.1254221685476; Tue, 29 Sep 2009 03:54:45 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 12:54:45 +0200 Message-ID: <560972290909290354i2e54c29ei5e9971059cf8d6ab@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 12:40 PM, Cosmin Apreutesei wrote: > The unix way (chaining pipes) approach is as valid a model for http as > for any other protocol. IMHO the problem is merely cultural - very few > people code this way nowadays Part of the problem is that for a significant period, spawning processes on Windows was expensive. I rather like the idea of a system being a bunch of scripts because you get nice module isolation, deliberately restrictive interfaces. But (a) no need for the scripts to all run in their own process and (b) it helps if the stream isn't just text. Windows PowerShell has some really cool concepts, pity it is such an odd dog. I've done experiments with a command shell integrated with Lua, and it is a pleasure to have something so easily extended. But shell development is not a fashionable 21st century activity. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 07:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TAuMY7026313; Tue, 29 Sep 2009 07:56:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72ECD18BB2; Tue, 29 Sep 2009 07:55:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DABF18A74 for ; Tue, 29 Sep 2009 07:55:49 -0300 (BRT) Received: by ywh28 with SMTP id 28so7302179ywh.11 for ; Tue, 29 Sep 2009 03:56:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.10.9 with SMTP id 9mr324831agj.69.1254221760706; Tue, 29 Sep 2009 03:56:00 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 13:56:00 +0300 X-Google-Sender-Auth: cc7b5a310de72fce Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In reply to my own long post (sorry), I'd love to see (maybe even do someday) a pure-lua full http server so I can once and for all get rid of all those http servers and server interfaces. Something like Nanoki[1] but with OS threads. [1] http://alt.textdrive.com/nanoki/ From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 08:02:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TB2Tr8027136; Tue, 29 Sep 2009 08:02:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A57918C14; Tue, 29 Sep 2009 08:01:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D445218AE7 for ; Tue, 29 Sep 2009 08:01:49 -0300 (BRT) Received: by bwz10 with SMTP id 10so4325379bwz.5 for ; Tue, 29 Sep 2009 04:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=t+b+38jk+98JOeCuxHY3OBUsmN2rC80yL4haYEkwYZU=; b=tkzbKLPiX2wYBYd1XMmjEoLMOcmWGT16eM/2U0w7Ov2B+I/nVT9RrqlKgfBXpzpGAY pixsh9HKlBjlCO2S4n8sJP8v8qRY2zEWRgHAldti2mQQro207AySuzsMEhoSR9y2peT0 kF5GhMsLo0hfSIKqDPhxExXfgUFPyBuEvnuhc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BoUToQhomSw6YtthK+OL9v2CWJ69tOurFthfGL8jRU1+m4rUgSwTQ3waDo5kYRZ3NP wZp8pBMm8Wh0wsXRxr9xrsGE5MuJznVdtcJ0BBVHDCl8UlWKYo1T8CXIE30gNmixq/6x H5ecUAvmOGRqvYcmD4m0dR+h00BPUYipQu6EU= MIME-Version: 1.0 Received: by 10.239.179.97 with SMTP id c33mr368036hbg.157.1254222120186; Tue, 29 Sep 2009 04:02:00 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 13:02:00 +0200 Message-ID: <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 12:56 PM, Cosmin Apreutesei wrote: > In reply to my own long post (sorry), I'd love to see (maybe even do > someday) a pure-lua full http server so I can once and for all get rid > of all those http servers and server interfaces. Like Xavante ;) ? From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 08:04:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TB4s8a027367; Tue, 29 Sep 2009 08:04:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9796B18C57; Tue, 29 Sep 2009 08:04:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A832018C2F for ; Tue, 29 Sep 2009 08:04:16 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MsaVO-0004KX-Hu for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 12:04:26 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 41325121C4 for ; Tue, 29 Sep 2009 12:04:22 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:20933 with envelope Message-ID: <4AC1E9AF.1060400@cowlark.com> Date: Tue, 29 Sep 2009 12:04:15 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: What would _you_ like in a Lua CMS? References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <20090929073711.GA23098@mir> In-Reply-To: <20090929073711.GA23098@mir> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8TB4s8a027367 Tobias Kieslich wrote: [...] > That aaplication > server itself speaks HTTP of cause and does the actual parsing and > routing(url to entry point) etc. There are lots of benefits to have a > tightly coupled Http server with your application. Well, you say so, but I've very rarely seen such a thing --- while high level application protocols for efficient communication between the app server and the web server are becoming more and more common. JK for servlets, LiteSpeed for Ruby, WSGI for Python, our very own WSAPI for Lua, and about a *dozen* of the things in Perl... I recently did a project using Java, GWT and servlets (a very nice programming environment for web apps, BTW). The servlet container I eventually used is called Winstone, and it's connected to my web server, lighttpd, via proxying. It all works fine. However... both the Winstone documentation *and* the lighttpd documentation recommended using mod_jk rather than proxying, because it's got less overhead, is faster, allows the servlet engine to be *more* tightly coupled to the web server, and is easier to set up! (Alas, I had to go for a traditional proxied approach because lighttpd's mod_jk hasn't reached Debian yet. But that's another complaint.) -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 08:05:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TB5RjG027439; Tue, 29 Sep 2009 08:05:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2647E18CE2; Tue, 29 Sep 2009 08:04:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91B5218BFD for ; Tue, 29 Sep 2009 08:04:47 -0300 (BRT) Received: by gxk4 with SMTP id 4so3692505gxk.8 for ; Tue, 29 Sep 2009 04:04:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.8.15 with SMTP id 15mr3610324agh.88.1254222296271; Tue, 29 Sep 2009 04:04:56 -0700 (PDT) In-Reply-To: <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> Date: Tue, 29 Sep 2009 14:04:56 +0300 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> In reply to my own long post (sorry), I'd love to see (maybe even do >> someday) a pure-lua full http server so I can once and for all get rid >> of all those http servers and server interfaces. > > Like Xavante ;) ? Like a non-blocking version of Xavante :) From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 09:36:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TCa4ou007845; Tue, 29 Sep 2009 09:36:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45A701A6D9; Tue, 29 Sep 2009 09:35:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f194.google.com (mail-vw0-f194.google.com [209.85.212.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 266831A66A for ; Tue, 29 Sep 2009 09:35:16 -0300 (BRT) Received: by vws32 with SMTP id 32so3760793vws.11 for ; Tue, 29 Sep 2009 05:35:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.103 with SMTP id j39mr7726890vck.78.1254227727403; Tue, 29 Sep 2009 05:35:27 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> From: Phoenix Sol Date: Tue, 29 Sep 2009 07:35:07 -0500 Message-ID: <8a25d01b0909290535x35c5ef82k50c92b5757addbfc@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 6:04 AM, Cosmin Apreutesei wrote: >>> In reply to my own long post (sorry), I'd love to see (maybe even do >>> someday) a pure-lua full http server so I can once and for all get rid >>> of all those http servers and server interfaces. >> >> Like Xavante ;) ? > > Like a non-blocking version of Xavante :) > Yes. And while we are at it, how about one that uses all available processor cores; one lua_State per core. I would prefer a server framework that does nothing but serve dynamic content. Static material goes in the CDN (except for tiny bits of HTML and Javascript which get cached in memory). I don't even want it do do any logging by default; I want logging to be done in an application specific way, for instance, I may send log messages to another application on another server. I'm working on it. I just completed, and am testing, a binding to Ryan Dahl's http-parser, which is based on Zed Shaw's Mongrel. As noted above, decent compliance to the HTTP specification is not altogether uncomplicated ;) From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 10:33:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TDWucM019409; Tue, 29 Sep 2009 10:32:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3CB718C94; Tue, 29 Sep 2009 10:32:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D2EC18BCD for ; Tue, 29 Sep 2009 10:32:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so5079849fxm.5 for ; Tue, 29 Sep 2009 06:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ex8P2PHWbKZARLIzfDWw1U3u07Ov1ojisdwmElpSPLY=; b=ZJPtW4HwZ4wmqXpftDsku7jyK4dieKNhFhpaWqDF/mWIcnc/tKc8qgefwfNW0aE4sL 3Noa703xg32pqMYMf42nZF9j0Wflrr46RxQhZwPFG7tLc4mwO6Yvk/4NnWFwiZ4kUosA 1Gx7YHWvlM6fTQlRMgkoVcHQZvWb4uRlMC+a4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=ejH86yIF30+ga1fiq7iHRI9eTUi+HV3ACwQVuH/KiUAiW6WO3SYlyd59QwK8k5+e2C NMSJIHnDM+sMUcrfGjqqdRTtjy0WcWZuoTDvHwt8OfqQLX6PlHrHgMSbdja/lf4q89wB Y7vH3BCzJR89pv+Yud4gTvZvpgeMp1llMfK2M= MIME-Version: 1.0 Received: by 10.223.18.145 with SMTP id w17mr1181093faa.66.1254231133634; Tue, 29 Sep 2009 06:32:13 -0700 (PDT) In-Reply-To: <87skeeqamv.fsf@lola.goethe.zz> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <87ab0makgi.fsf@mid.deneb.enyo.de> <4AB92082.2000706@spellingbeewinnars.org> <20090922191953.GB4954@grey.iitsystems.csupomona.edu> <4AB9DEE2.6090000@objmedia.demon.co.uk> <4AB9E2A6.5000307@erix.it> <4AB9F45A.50102@cowlark.com> <87skeeqamv.fsf@lola.goethe.zz> Date: Tue, 29 Sep 2009 15:32:13 +0200 Message-ID: Subject: Re: Suitability of Lua as a First Programming Language? From: Michael Pruemm To: Lua list Content-Type: text/plain; charset=ISO-8859-1 Cc: David Kastrup X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8TDWucM019409 (Catching up on the Lua mailing list.) On Wed, Sep 23, 2009 at 11:21 AM, David Kastrup wrote: > I did my implementation on a weekend with a friend, just working from > specs without code.  And we were still quite more complicated than > reference implementations (which I got to see later). Yes, I remember that implementation. And part of its complexity was due to the very bad description of Forth in a German book. - Michael From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 10:55:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TDthNf025390; Tue, 29 Sep 2009 10:55:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4B0F191EE; Tue, 29 Sep 2009 10:55:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 678C7191D6 for ; Tue, 29 Sep 2009 10:54:58 -0300 (BRT) Received: by bwz10 with SMTP id 10so4446238bwz.5 for ; Tue, 29 Sep 2009 06:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=C2yUZsyVnLXvjryXFwCpL0MU5kFjACSU/mEW8uulBNw=; b=ZAJVpIDeSiBgAarzp1ZGxy9IxJIj9CgrHS6Xu503b0NDYrT9DdLbNGSO3NyKn68n2C o8L9AeZG6oPXqmZn66O9WPhfZqyfeRaM5mNTWL1orIzhRPtOR4eV+e7PQ5HdZTQHP6j5 iYAMsj2IsbwHuuesHokyLSZxTJYavnFfLcGzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dAV8KunMbCEYKSTmkPPex+j+g2+pgjTBWCWOWepbE7J1lpbwkaj4AywRKG7vTF2H0/ 7R77KSwCeNIdeiGkx4/fIYpCDIvPzpmfQGDIGHZogV49OBADEIp1XejD4VMQPtAitpTm VBzwDTxLWAJy70Jil+NBUYMSdgAyCnbOtKWk0= MIME-Version: 1.0 Received: by 10.239.139.204 with SMTP id u12mr484253hbu.81.1254232509027; Tue, 29 Sep 2009 06:55:09 -0700 (PDT) In-Reply-To: References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <91jsb5lp8hst7mbrd8brsmp2f3esm0goui@4ax.com> Date: Tue, 29 Sep 2009 15:55:08 +0200 Message-ID: <560972290909290655o78b8e8cane5fa77b368b3ab33@mail.gmail.com> Subject: Re: Suitability of Lua as a First Programming Language? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Sep 27, 2009 at 5:47 PM, Mark Hamburg wrote: > Lua has most of the good parts (Crockford's term) of JavaScript without most > of the bad parts. Peter Norvig's essay [1] on "Teach Yourself Programming in Ten Years" has a appendix on 'Language Choice'. He comes up with (1) Use your friends (2) Keep it Simple (3) Play (i.e. insist on an interactive mode). The actual choice is not that important, initially. He quotes Alan Perlis: "A language that doesn't affect the way you think about programming, is not worth knowing" Lua is definitely more fun and interactive than JavaScript. And it definitely is good for recovering C++ junkies. steve d. [1] http://norvig.com/21-days.html From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 11:53:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TErjjX010141; Tue, 29 Sep 2009 11:53:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DA7A191AE; Tue, 29 Sep 2009 11:53:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E566C18EDB for ; Tue, 29 Sep 2009 11:52:58 -0300 (BRT) Received: by ewy26 with SMTP id 26so5671461ewy.5 for ; Tue, 29 Sep 2009 07:53:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.160.14 with SMTP id m14mr4786490ebo.30.1254235988934; Tue, 29 Sep 2009 07:53:08 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> Date: Tue, 29 Sep 2009 09:53:08 -0500 Message-ID: <90eb1dc70909290753h2cab7449y356b66cef16a475@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 6:04 AM, Cosmin Apreutesei wrote: >>> In reply to my own long post (sorry), I'd love to see (maybe even do >>> someday) a pure-lua full http server so I can once and for all get rid >>> of all those http servers and server interfaces. >> >> Like Xavante ;) ? > > Like a non-blocking version of Xavante :) i have one somewhere, built with HTT, which provide a simplistic non-blocking TCP API. -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 12:50:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TFofL2020900; Tue, 29 Sep 2009 12:50:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA5D719182; Tue, 29 Sep 2009 12:49:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6169190B7 for ; Tue, 29 Sep 2009 12:49:51 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQQ00FY7P9UFB60@asmtp014.mac.com> for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 08:49:40 -0700 (PDT) Message-id: <9E3BFE58-8F26-4A20-B58C-3D989E92D18F@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 17:49:05 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 1:59 AM, Leaf Storm wrote: > HTTP wasn't meant to be proxied at all. Let me rephrase that: HTTP leads itself quite nicely to proxying. HTTP/1.1 was spec out with proxy in minds, among other things. From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 12:56:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TFuLwq021984; Tue, 29 Sep 2009 12:56:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1A64191E8; Tue, 29 Sep 2009 12:55:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FD97190B7 for ; Tue, 29 Sep 2009 12:55:35 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQQ00G9JPK0A260@asmtp014.mac.com> for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 08:55:46 -0700 (PDT) Message-id: <9FB540D1-B35F-48D6-88CA-55878F2C6437@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 17:55:11 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 12:40 PM, Cosmin Apreutesei wrote: > If the primary reason to abstract http away would be simplification, > you'd have this put on a library instead. A library you can use if you > like when you like, and you can also _not_ use when you need not to > (you could even use two libraries on the same http stream). You'd have > both abstraction and control at the same time. Right on, this is how Nanoki is setup. Nanoki itself is an application [1], which happen to use an HTTP library [2] that provides an HTTP server [3]. > I think this analogy is accurate if you think about what O/R mappers > have done to poor people around the world :) Finally, someone got the analogy... great minds and all that... :) > Ironically, dumbing down your use of SQL to the common set of > functionality available on all compliant servers goes against many > criteria for choosing a server in the first place :) but I diverge. Ah, yes, the curse of the lowest common denominator :D [1] http://dev.alt.textdrive.com/browser/HTTP/Nanoki.lua [2] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua [3] http://dev.alt.textdrive.com/browser/HTTP/TCPServer.lua From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 13:07:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TG7ELj024393; Tue, 29 Sep 2009 13:07:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BA831A6C7; Tue, 29 Sep 2009 13:06:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B68F51A5E5 for ; Tue, 29 Sep 2009 13:06:34 -0300 (BRT) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQQ004X4Q23G510@asmtp013.mac.com> for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 09:06:36 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 18:06:02 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8TG7ELj024393 On Sep 29, 2009, at 12:56 PM, Cosmin Apreutesei wrote: > In reply to my own long post (sorry), I'd love to see (maybe even do > someday) a pure-lua full http server so I can once and for all get rid > of all those http servers and server interfaces. Right, Nanoki sports a pure Lua HTTP module: http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua That module provides HTTP handling in pure Lua. It's only external dependency being Lua's own io API (e.g. file:read, etc ). The TCP/IP handling is done at another level altogether, either internally using LuaSocket, with something like TCPServer: http://dev.alt.textdrive.com/browser/HTTP/TCPServer.lua Or externally, with something like D. J. Bernstein's tcpserver http://cr.yp.to/ucspi-tcp/tcpserver.html Or... anything that can provide an io API really... > Something like Nanoki[1] but with OS threads. More or less relevant quote: "... we did not (and still do not) believe in the standard multithreading model, which is preemptive concurrency with shared memory: we still think that no one can write correct programs in a language where ‘a=a+1’ is not deterministic." -- R. Ierusalimschy, L. H. de Figueiredo, W. Celes, "The Evolution of Lua", 2007 http://www.lua.org/doc/hopl.pdf From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 13:10:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TGAZPd025156; Tue, 29 Sep 2009 13:10:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 422AC1A6EC; Tue, 29 Sep 2009 13:10:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFC611A66A for ; Tue, 29 Sep 2009 13:09:56 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQQ00CS7Q7QAI60@asmtp017.mac.com> for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 09:09:59 -0700 (PDT) Message-id: <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> From: Petite Abeille To: Lua list In-reply-to: <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 18:09:25 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 1:02 PM, steve donovan wrote: > Like Xavante ;) ? Hmmm... well... Xavante, in its current shape at least, is more of an application (i.e. a standalone HTTP server) than a library (i.e. an embedded HTTP engine). From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 13:17:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TGHiGr026478; Tue, 29 Sep 2009 13:17:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFFEF1A6F0; Tue, 29 Sep 2009 13:17:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 610C11A66A for ; Tue, 29 Sep 2009 13:17:04 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQQ000E8QJUYP50@asmtp011.mac.com> for lua@bazar2.conectiva.com.br; Tue, 29 Sep 2009 09:17:15 -0700 (PDT) Message-id: <108E1F6D-40AC-4B2B-81CC-177C9DB28248@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 18:16:41 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 1:04 PM, Cosmin Apreutesei wrote: >> Like Xavante ;) ? > > Like a non-blocking version of Xavante :) Right, and that points out one of the main issue with using coroutine (e.g. Copas) as a substitute for multi threading/processing: it just doesn't pan out. "A long time ago in a galaxy far, far away..." I went down that road of implementing a coroutine based HTTP engine: http://dev.alt.textdrive.com/browser/LW http://dev.alt.textdrive.com/browser/lu/SocketRunLoop.lua To make a long story short... as long as any of the coroutine doesn't do anything meaningful, it's very fast :P From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 13:29:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TGTNs0029290; Tue, 29 Sep 2009 13:29:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CC3F18AAD; Tue, 29 Sep 2009 13:28:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51CD318A02 for ; Tue, 29 Sep 2009 13:28:24 -0300 (BRT) Received: by fxm12 with SMTP id 12so5250561fxm.5 for ; Tue, 29 Sep 2009 09:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=9ql7pThNI5SwP+9epSkN1Vyz4SPs8WfAzpOMvmQylP0=; b=Ckda0iHOxW1GptlgtdhRcp4U/in2PFXTHtS6W4hgLdap3DkFRhM7EiqlAHOGKvpGA0 rdjvehBhFONTrXsg6Wgj8BQPn0uXSwy22sBzcWT3jpNsuAsq6EXox7r9CJvpEp1s2bAG 2DoZ58ZdntyGpONfa5KCa/FQ7HkmOMw+g1k3A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=VcXAU3Pg7XY0cZPazzHeS1hql/4piAJiP+PdXQlIpldeX8IL/LT1k34H4sSVVxYkGt LH1glMlp7nYdUtEXaRfF+Jc95BovOIc/VFguVonN7FWrd1zzt0GacNYrXa251hGA1yfx nqQWGdvzVQS00K/EcPROURxT2kSUeGcXa+aGA= Received: by 10.86.184.35 with SMTP id h35mr4521913fgf.18.1254241714273; Tue, 29 Sep 2009 09:28:34 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 12sm35151fgg.21.2009.09.29.09.28.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 09:28:33 -0700 (PDT) Message-Id: <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 18:28:01 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 8:37 AM, Jacques Chester wrote: There's also performance considerations. Lighttpd is faster > at serving static files than Lua. A *lot* faster. And nginx is even faster, simpler, leaner, meaner than lighttpd :) With makes using any of those nice servers much more straightforward if you application itself speak HTTP natively. Just my opinion though :) I do realize that this argument is going against nearly 15 years of Common Gateway Interface indoctrination :D From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:01:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TH1bnH003883; Tue, 29 Sep 2009 14:01:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30D941A666; Tue, 29 Sep 2009 14:00:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3F0718B12 for ; Tue, 29 Sep 2009 14:00:40 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 9so922938qwb.11 for ; Tue, 29 Sep 2009 10:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Pnyw8r0vKdRyWLRrqFnMGoLYdrwhPj3T7LZJgyYc7G4=; b=apo2lbHh8KHDufBqlHB95UwgwDkuwad+0jHI++N7aVtXu06HwCX9aVSWmYHz6V62Nv OqWl4iQM7tVzEJ23mwaMLhbTXRWxc+s+KFzXcaYmQGrvVyJEmwadKPn3DtnksuGVaNij xIhWiHikxjELZAIXc+JP3R4SRVqsRDOEkhUdo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=jjKTcgGe5jk4yh2S6uoRDysngVwhR5BpKl07jwcsi2TDsxPHVNfnjBhTThg6aZ+BUZ qefbstQIMmdpBH2Qa8hCJEPnvumL0NK9C2GRtExOCpQ/VNsF/sWrDKY/Al8qjWnxkg7I Q0hNqCkAkHYqjA5CIas4bmJkbErqyKceLg2gI= MIME-Version: 1.0 Received: by 10.224.93.16 with SMTP id t16mr4119581qam.250.1254243652272; Tue, 29 Sep 2009 10:00:52 -0700 (PDT) In-Reply-To: <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> Date: Tue, 29 Sep 2009 14:00:52 -0300 X-Google-Sender-Auth: dceb9a737b18e111 Message-ID: <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 1:09 PM, Petite Abeille wrote: > > On Sep 29, 2009, at 1:02 PM, steve donovan wrote: > >> Like Xavante ;) ? > > Hmmm... well... Xavante, in its current shape at least, is more of an > application (i.e. a standalone HTTP server) than a library (i.e. an embedded > HTTP engine). > > Technically Xavante is a library. :-) I attached a script that launchers orbit apps using just Xavante, without the need for the whole Kepler stack and configuration. You are correct that it is not as well-factored as HTTP.lua, but the changes to abstract away the I/O to use either files or sockets wouldn't be difficult. Repurposing Xavante to use a threading library instead of Copas is not hard, either. I did it once to use a cooperative threading library that I wrote using Alien and libevent as an experiment, and Bruno Silvestre did it to use a m+n threading library that he wrote. I want to rip the guts out of Xavante and make it "speak" WSAPI natively instead of its own internal API, and make the front-end more modular, too, but I never seem to get around and do it. :-) But it is a very stable web server; http://luarocks.org is a Sputnik running under Xavante, with Apache proxying to it, and the uptime of Xavante is measured in *months*. -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:07:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TH7XPt005148; Tue, 29 Sep 2009 14:07:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 327B91A6E8; Tue, 29 Sep 2009 14:06:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1148F1A66A for ; Tue, 29 Sep 2009 14:06:43 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 9so924889qwb.11 for ; Tue, 29 Sep 2009 10:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=cwKGQ0pdMbaiLTXol4SEwqtWjXA4QOk0DBJ4mYzFdt4=; b=ZCQ9v1MixOEBbSfrjTQ4ayXQOzqV49s9rRohuQHFz16DQiMi3uuTRL79On6Jek8gBC hujgnUgGU0MmKAYPd2+dIo5fNROqt8jEsVaTPnHO2rFgwcSJWRYE40JW+h9Ski5n2eun GmKbRkG6lNWmwHqpqd6BOZnSAd7r7Gf7nxyMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=XTFvNU5YKxn7gAffnYLSd5yWJl3z20+opINUDzYbNG/pkynoTpnIgZdhTi25p6sKlx 5UH9fZJ0rqQuHu/el9oEA4EQpx/U0thIuZgUATIPr8VMe2RfMdyNOMn4ENeEh9hrvPEg BCSRF4gfDQZG4bqbmYrJTQXAz0zHrj9NgPsyQ= MIME-Version: 1.0 Received: by 10.224.6.10 with SMTP id 10mr4133242qax.60.1254243693399; Tue, 29 Sep 2009 10:01:33 -0700 (PDT) In-Reply-To: <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> Date: Tue, 29 Sep 2009 14:01:32 -0300 X-Google-Sender-Auth: 158a80244cfb8e07 Message-ID: <7913df4d0909291001n1e5fa5aehb613682aa3d09b86@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: Fabio Mascarenhas To: Lua list Content-Type: multipart/mixed; boundary=000feaf209eacead8a0474ba5da7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000feaf209eacead8a0474ba5da7 Content-Type: text/plain; charset=UTF-8 Oops, forgot the attachment. :-) -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br On Tue, Sep 29, 2009 at 2:00 PM, Fabio Mascarenhas wrote: > On Tue, Sep 29, 2009 at 1:09 PM, Petite Abeille wrote: >> >> On Sep 29, 2009, at 1:02 PM, steve donovan wrote: >> >>> Like Xavante ;) ? >> >> Hmmm... well... Xavante, in its current shape at least, is more of an >> application (i.e. a standalone HTTP server) than a library (i.e. an embedded >> HTTP engine). >> >> > > Technically Xavante is a library. :-) I attached a script that > launchers orbit apps using just Xavante, without the need for the > whole Kepler stack and configuration. > > You are correct that it is not as well-factored as HTTP.lua, but the > changes to abstract away the I/O to use either files or sockets > wouldn't be difficult. Repurposing Xavante to use a threading library > instead of Copas is not hard, either. I did it once to use a > cooperative threading library that I wrote using Alien and libevent as > an experiment, and Bruno Silvestre did it to use a m+n threading > library that he wrote. > > I want to rip the guts out of Xavante and make it "speak" WSAPI > natively instead of its own internal API, and make the front-end more > modular, too, but I never seem to get around and do it. :-) But it is > a very stable web server; http://luarocks.org is a Sputnik running > under Xavante, with Apache proxying to it, and the uptime of Xavante > is measured in *months*. > > -- > Fabio Mascarenhas, Lablua > http://www.lua.inf.puc-rio.br > --000feaf209eacead8a0474ba5da7 Content-Type: application/octet-stream; name=orbit Content-Disposition: attachment; filename=orbit Content-Transfer-Encoding: base64 X-Attachment-Id: f_g06w91530 IyEvdXNyL2Jpbi9lbnYgbHVhNTEKCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLS0KLS0gU3RhcnRz IHRoZSBvcmJpdCBzZXJ2ZXIKLS0KLS0gb3JiaXQgYXBwLnJiIFtwb3J0XQotLQotLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tCgpsb2NhbCBhcHAgPSBzZWxlY3QoMSwgLi4uKQoKaWYgbm90IGFwcCB0aGVu CiAgcHJpbnQoIlVzYWdlOiBvcmJpdCBhcHAubHVhIFtwb3J0XSIpCiAgb3MuZXhpdCgxKQplbmQK CmxvY2FsIGFwcF9uYW1lID0gc3RyaW5nLm1hdGNoKGFwcCwgIihbJXdfLV0rKS5sdWEiKQpsb2Nh bCBhcHBfcGF0aCA9IHN0cmluZy5tYXRjaChhcHAsICIoLiopLyIpIG9yICIuIgoKcGFja2FnZS5w YXRoID0gcGFja2FnZS5wYXRoIC4uICI7IiAuLiBhcHBfcGF0aCAuLiAiLz8ubHVhOyIgLi4gYXBw X3BhdGggLi4gIi8/Lz8ubHVhIgoKbG9jYWwgcG9ydCA9IHRvbnVtYmVyKHNlbGVjdCgyLCAuLi4p IG9yIDgwODApCgpyZXF1aXJlICJ4YXZhbnRlIgpyZXF1aXJlICJ4YXZhbnRlLmh0dHBkIgpyZXF1 aXJlICJ4YXZhbnRlLnZob3N0c2hhbmRsZXIiCnJlcXVpcmUgInhhdmFudGUudXJsaGFuZGxlciIK cmVxdWlyZSAid3NhcGkueGF2YW50ZSIKCmxvY2FsIGFwcCA9IHJlcXVpcmUoYXBwX25hbWUpCgpp ZiB0eXBlKGFwcCkgPT0gInRhYmxlIiB0aGVuIGFwcCA9IGFwcC5ydW4gZW5kCgp4YXZhbnRlLmh0 dHBkLmhhbmRsZV9yZXF1ZXN0ID0geGF2YW50ZS52aG9zdHNoYW5kbGVyIHsKCVsiIl0gPSB4YXZh bnRlLnVybGhhbmRsZXIgewogICAgICAgICAgICAgICAgWyIvIl0gPSB3c2FwaS54YXZhbnRlLm1h a2VIYW5kbGVyIChhcHAsIG5pbCwgYXBwX3BhdGgsIGFwcF9wYXRoKSwKCX0KfQoKeGF2YW50ZS5o dHRwZC5yZWdpc3RlciAoIioiLCBwb3J0LCAiWGF2YW50ZSAyLjAiKQoKeGF2YW50ZS5zdGFydF9t ZXNzYWdlKGZ1bmN0aW9uIChwb3J0cykKCQkJICAgICAgICBwcmludChzdHJpbmcuZm9ybWF0KCJT dGFydGluZyBPcmJpdCBzZXJ2ZXIgYXQgcG9ydCAlcyIsCgkJCQkgdGFibGUuY29uY2F0KHBvcnRz LCAiLCAiKSkpIAoJICAgIAkgICAgICBlbmQpCgp4YXZhbnRlLnN0YXJ0KCkKCgo= --000feaf209eacead8a0474ba5da7-- From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:19:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8THJiuE007967; Tue, 29 Sep 2009 14:19:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06DF7190C7; Tue, 29 Sep 2009 14:19:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EC4319051 for ; Tue, 29 Sep 2009 14:18:56 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c37so1861620anc.26 for ; Tue, 29 Sep 2009 10:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=60Ibp1SqCKv9L/fbmRMCRCinp1XYe6HwmO5SLa1H93M=; b=OV89cYl40XjPAf+i3SyoorVk0ocxLE9nCWptdLSJFbQOjkj2xhY09s0RoFOw5aYLb+ xBs0XY3F4JhH/8a+9W8pS0FCu2XcDZ9gmwNqOEvZA+DKf9ODXUolgJoaa54uyLrZXwY8 c0AqJU+ilBkCfBJuKLld4xHJQKSr6/DDZa+TM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=iKi7zeSzuyFLf8uVGewRN8xMF6BZIqgt6TypAdylEeaqjyJdWabUSwGpkcLfY/IHwy 9CMevVEeYYZSM6QWGtzHwDp1M0DYTbq8y1tp+U6oTqnYKVnC1uj0Agu50Y7PBONciySB ya3VfADQLkCidt9nZeqRaguSjb6q+GvOtMGXM= MIME-Version: 1.0 Received: by 10.101.57.4 with SMTP id j4mr4813535ank.104.1254244747271; Tue, 29 Sep 2009 10:19:07 -0700 (PDT) In-Reply-To: <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> Date: Tue, 29 Sep 2009 13:19:07 -0400 X-Google-Sender-Auth: 1e517d38dafbc8b3 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Technically Xavante is a library. :-) I attached a script that > launchers orbit apps using just Xavante, without the need for the > whole Kepler stack and configuration. Sputnik does the same when running on Xavante. We call xavante.start(), passing it a table that maps all paths to the same handler function. The handler function then does the rest. Alternatively, the exact same handler function can be trivially called from a CGI script, which means you can run Sputnik on bare-bones shared hosting providers like Dreamhost. Moving from Xavante to CGI or FastCGI involves nothing more than changing an extension on a file. - yuri From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:39:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8THdCBg012967; Tue, 29 Sep 2009 14:39:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82D861A6EA; Tue, 29 Sep 2009 14:38:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6D5B1A59E for ; Tue, 29 Sep 2009 14:38:26 -0300 (BRT) Received: by gxk4 with SMTP id 4so4030907gxk.8 for ; Tue, 29 Sep 2009 10:38:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.10.1 with SMTP id 1mr3805972agj.62.1254245917278; Tue, 29 Sep 2009 10:38:37 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 20:38:37 +0300 X-Google-Sender-Auth: ade966d0652dad02 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8THdCBg012967 >> Something like Nanoki[1] but with OS threads. > >  More or less relevant quote: > > "... we did not (and still do not) believe in the standard multithreading > model, which is preemptive concurrency with shared memory: we still think > that no one can write correct programs in a language where ‘a=a+1’ is not > deterministic." I've read that doc- funny quote :) But I didn't mean OS threads exposed to lua as per LuaThread, but a model with a separate lua state per thread, like LuaLanes, and each thread corresponding to a Xavante handler. What's missing to Xavante is an OS thread pool/manager, and you get yourself lighttpd. For now, I am happy with WSAPI + mod_fcgid + apache, which is similar to tcpserver + nanoki's http library except for: 1) there's a process pool => great speed advantage; 2) apache does a few things like keepalive and on-the-fly compression (no biggie- could be easily done in lua). From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:51:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8THpKFK015995; Tue, 29 Sep 2009 14:51:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D4111A6EE; Tue, 29 Sep 2009 14:50:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B1431A59E for ; Tue, 29 Sep 2009 14:50:25 -0300 (BRT) Received: by fxm12 with SMTP id 12so5324706fxm.5 for ; Tue, 29 Sep 2009 10:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=rZwuNPlp/8/MRFN7LEyG+YeNl+ZBcMHfFXHtdDpcayU=; b=iYJa57Os2arp7Jmbe97oAG3mdfYaE4XeJayzJZFhmKyRkNt1TmLbMGrShsVmKPXg1J 4N1NRfluDpx+MYarNL9kv/bwCB01e7W4ApSMUtTIJxN5ETWjwSuaqUrG47F3xA1JexoL hpRyLEA7AG37BIJuHSz/V2FSaczA5pMK6XR+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=i9lLRMNGPZLJ9lXGWWDy79RkY26uuVqBew0wFIUZDtx3TSIl4f/oIV3aSdAh3OVgn5 nlajRqO51+SWQ0avUKHoMT1t+Q1NfiVk3pOegMZpgT6305c5xRIkFz1pHcysQkoMzR4k xfKoOqZR90rZUqJ5bSAdUOTe7wTEZ+jgFZ8mQ= Received: by 10.204.34.22 with SMTP id j22mr4451758bkd.43.1254246635192; Tue, 29 Sep 2009 10:50:35 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 13sm1521953fks.50.2009.09.29.10.50.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 10:50:34 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 19:50:03 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 7:38 PM, Cosmin Apreutesei wrote: > For now, I am happy with WSAPI + mod_fcgid + apache, which is similar > to tcpserver + nanoki's http library except for: > 1) there's a process pool => great speed advantage; You can setup Nanoki that way, more or less, by using a reverse proxy and a process pool, e.g. with nginx: http { upstream cluster { server 127.0.0.1:2081; server 127.0.0.1:2082; server 127.0.0.1:2083; server 127.0.0.1:2084; server 127.0.0.1:2085; server 127.0.0.1:2086; server 127.0.0.1:2087; server 127.0.0.1:2088; } server { listen 3388; location / { proxy_pass http://cluster; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } } > 2) apache does a few things like keepalive and on-the-fly > compression (no biggie- could be easily done in lua). Permanent connection are handled by HTTP.lua out-of-the-box, see ConnectionFilter: http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua#L278 Ditto for compression, assuming one has the proper library binding available, see GZIPFilter: http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua#L194 From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 14:52:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8THpwkB016157; Tue, 29 Sep 2009 14:51:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C59311A6F6; Tue, 29 Sep 2009 14:50:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BBC11A6EF for ; Tue, 29 Sep 2009 14:50:53 -0300 (BRT) Received: by bwz10 with SMTP id 10so4644584bwz.5 for ; Tue, 29 Sep 2009 10:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=q17bxh9MRXCz3EnsIBQRib8LvUIUYd9+Y7gj76cWPkc=; b=Bj6xe52I1deiAEsKfJYKIOwj+/NYaxCogzSE+lFXUIWn+ptv8M/jGWaEe9zl+ih6KN 4j69REL1u2dVPIwOSN4nXvnsozl2Q7HUFnbHDEJDVYnX7PvsxX/LkObaJ+e+dw01+PHl TZh2NY1yzrQZem2tz7tiQJKLt0gN/uLwFTFIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=oTzWbjj7DqrPQo5bxllTW2fOI0BgHBHs/73xt1kaiyxKxo0BC4MqrQzWFWvlf9G8RW 8TMn9M4QeJeZLipRQnVTniGBaAQd8f3CMRI/oAXEkqmS+SzIeDLDDzJlh5Wrhb3DPzWw vqpNUdWc/tbsVFdpafhCUadsyR9Z9OsVRJb1k= Received: by 10.204.34.23 with SMTP id j23mr4484222bkd.31.1254246660058; Tue, 29 Sep 2009 10:51:00 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 13sm1521953fks.50.2009.09.29.10.50.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 10:50:58 -0700 (PDT) Message-Id: <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 19:50:57 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 7:00 PM, Fabio Mascarenhas wrote: > modular, too, but I never seem to get around and do it. :-) But it is > a very stable web server; http://luarocks.org is a Sputnik running > under Xavante, with Apache proxying to it, and the uptime of Xavante > is measured in *months*. So... Apache -> Xavante -> Sputnik. As an example, Nanoki's demo site used to be setup similarly: nginx -> TCPServer -> Nanoki But that was overkill, so now it's down to: tcpserver -> Nanoki As a random statistic, Nanoki demo site now sports around 255,518 pages and counting: http://svr225.stepx.com:3388/ Lua, the little language that could :) From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 15:10:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TIAGlt020684; Tue, 29 Sep 2009 15:10:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1AA819104; Tue, 29 Sep 2009 15:09:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDC3A19051 for ; Tue, 29 Sep 2009 15:09:28 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c37so1871112anc.26 for ; Tue, 29 Sep 2009 11:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=PuE0593Hc42ijRQJnCJzmj1L+ZoDVb/j2ikU7uYS3Xs=; b=qcxlhdelAfQbebSE8wokNGqbq1g2QPFhJEEMh71UvzykJ14AoUT99tqHPF6wQ1fRCE hzp14WXgK6OdLfS244Tjy/yufgr5diO9hmiIDdTIuxBiq0vDbLVVK+Lng5/X+XbK6QBD 3jbFLn4QZ4jBtPQU+Xb1cBF4Evs0+OHDhN3js= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=qHsDv9oywvtjM/Un9FQbDLhsbrkzts6YCvdrtODO4dqr9DkVshY7EQ6G9A6cIobIu2 hGl+wDQfzUhKjO/f2o0AxEW+YJBJR742cel4j+MyGhyzDahmJnATrdtow0Y16lNvEqsB UhH3wDwS7f5qksW5LVxOfYoEMazJP2j2i7QXw= MIME-Version: 1.0 Received: by 10.101.57.4 with SMTP id j4mr4875013ank.104.1254247780303; Tue, 29 Sep 2009 11:09:40 -0700 (PDT) In-Reply-To: <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> Date: Tue, 29 Sep 2009 14:09:40 -0400 X-Google-Sender-Auth: cb3df3c6871915c2 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > So... Apache -> Xavante -> Sputnik. Since the current version of Sputnik users Xavante as a library, following your logic this really is just: Apache -> Sputnik. However, if you think Apache is an overkill, you can eliminate it and get just: Sputnik Which, you must agree, is nothing less than perfection. - yuri From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 15:20:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TIK6B3022985; Tue, 29 Sep 2009 15:20:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E6F41A6EB; Tue, 29 Sep 2009 15:19:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8499F1A678 for ; Tue, 29 Sep 2009 15:19:22 -0300 (BRT) Received: by fxm12 with SMTP id 12so5351132fxm.5 for ; Tue, 29 Sep 2009 11:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=e0DYTr8XPeXyM7f+NvWtuIMl1QT9DkHhtc7bvgvQQ/I=; b=rEDz+xJXYVsj0gvY380JlgHKAX5ZhzXFL9c9TYaMlg83tkdiRxDy/niiGEZdYDmYfv HBbFJOv52OfnV7AnId9XYRBZvWQaruiytCuRbr2qVqJjURuaDD8C10nDU/HHBiknIHAS 7rs4w460f0P6su/LQwfjw4Uh8QCLU75UCPbhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=XWvVpo6ZG0nN+jNGPRa99y90Mu1a5IaS+UUl+RegMsjgH1O+P3RpPfvjpcJM05p6RB D9DIZils1I80Zzzo68MrlOovXpjfX6avdrMLG3oLj3yx0hp+XHMbV4cV6PUBP8r+CY6w SK2QDR8HBIpalG9osPewvN7C9Nnpmn54a8NPE= Received: by 10.204.160.85 with SMTP id m21mr4425520bkx.175.1254248371878; Tue, 29 Sep 2009 11:19:31 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 28sm361428fkx.28.2009.09.29.11.19.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 11:19:31 -0700 (PDT) Message-Id: <980B1C85-3802-439D-BF2B-47D509AD07E8@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Tue, 29 Sep 2009 20:18:59 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 8:09 PM, Yuri Takhteyev wrote: > However, if you think Apache is an overkill, you can eliminate it > and get just: > > Sputnik > > Which, you must agree, is nothing less than perfection. Yes, I would concur :) Ditto for Nanoki. One can simply use the build-in TCPServer and be done, e.g.: lua Nanoki.lua . localhost 1080 In other words, start Nanoki on localhost, port 1080, using the current directory. Not much configuration either :) http://svr225.stepx.com:3388/nanoki From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 18:15:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TLFVuv002293; Tue, 29 Sep 2009 18:15:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90DAD191D5; Tue, 29 Sep 2009 18:14:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D43F21917B for ; Tue, 29 Sep 2009 18:14:36 -0300 (BRT) Received: by an-out-0708.google.com with SMTP id c37so1905109anc.26 for ; Tue, 29 Sep 2009 14:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=sJ0IHFoHWSIqe4RcOtOygCCX8PE/F/TTsOyXwyFmHnM=; b=DNd6szQuBaRAaxq8Sr1EJBCnEKILR7+3PaECgzqq3PbkzcZkACsvIGuK3aVFajBRjY wHUUtfVfT7Kekpm3ZCZ67XllkR4adNGDdyjyawTHllqJbAciN3B7JXrWMAZnwgk7k+5l TQ5LgzdgvWpFxd0qggHPH1H6Om7ddIiLHOsXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=UZmmX2VwfWjumAelS1+rA6jmvepxWWEFs9lDaFMpmMSWuMw/V6L9ucfgAzsbl4ruN6 8yb/XSLr7TvpRMx1vRgJL69//qRtDfgFeI7V41YesWRF9B9mne8Wloqd2xCQyofzISvO ddtid5vZQ6H9cgL1VVbs9JXMtHfBSUD8pBWOA= MIME-Version: 1.0 Received: by 10.101.113.16 with SMTP id q16mr5113128anm.47.1254258888241; Tue, 29 Sep 2009 14:14:48 -0700 (PDT) In-Reply-To: <980B1C85-3802-439D-BF2B-47D509AD07E8@gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> <980B1C85-3802-439D-BF2B-47D509AD07E8@gmail.com> Date: Tue, 29 Sep 2009 17:14:48 -0400 X-Google-Sender-Auth: d9021f852f84f48a Message-ID: Subject: Re: What would _you_ like in a Lua CMS? From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Ditto for Nanoki. One can simply use the build-in TCPServer and be done, > e.g.: > > lua Nanoki.lua . localhost 1080 And on hosts that do not allow you to run your own process, use your own port, or configure the server? The nice thing about WSAPI is that you can _trivially_ switch between Xavante, proxied Xavante, CGI, FastCGI, etc. depending on what you have and what makes sense. If HTTP.lua+TCPServer is actually better than Xavante, then perhaps we should write an HTTP.lua launcher for WSAPI. It would take 20-100 lines of code, and all the WSAPI-based apps can enjoy the benefits of HTTP.lua+TCPServer without any modifications. - yuri From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 19:06:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TM6MUu010254; Tue, 29 Sep 2009 19:06:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 549041A6DD; Tue, 29 Sep 2009 19:05:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 141D71A5ED for ; Tue, 29 Sep 2009 19:05:31 -0300 (BRT) Received: by fxm12 with SMTP id 12so5540133fxm.5 for ; Tue, 29 Sep 2009 15:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=GDUtmRd1kVpt4AfaZQNSoy0BAkM79HG0m9XRZWglK9w=; b=xECfld+/gW+tnHNz8tTUn9JPRvopbsU6AWunocsKemVqDBcmZmrEwMqWQPaqdVEDtj 3SfC8lGaN5qZKrZCq3S/FjZbGfJ0yOOyScsnAAffzteJbTjkqBMkr1SE7Hwh5GnKKzC4 jbqNUXh4BMJS3DpzNfP3kaGOaNe4zQ151OLcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=KkqmIfYtgqFhbaeeKtERfstgws4K+IAtp8i1K84hnL5iuLyuudD0eryoBD/80pNw0X tI3c7qrH0g3m0OJKg6DokutPwtQO0GuzpNB5n9hGQ+0s/z+sYSH/0WjX6zboN+WbM3iD oDsBL19Oqv/CGXm4R8f1b5zfWwg/YPtVfixcc= MIME-Version: 1.0 Received: by 10.223.60.134 with SMTP id p6mr1493325fah.95.1254261943223; Tue, 29 Sep 2009 15:05:43 -0700 (PDT) In-Reply-To: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> <980B1C85-3802-439D-BF2B-47D509AD07E8@gmail.com> From: Leaf Storm Date: Tue, 29 Sep 2009 18:05:23 -0400 Message-ID: Subject: Re: What would _you_ like in a Lua CMS? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 5:14 PM, Yuri Takhteyev wrote: > The nice thing about WSAPI is that you can _trivially_ switch between > Xavante, proxied Xavante, CGI, FastCGI, etc. depending on what you > have and what makes sense. That is almost exactly one of the things I was trying to say earlier. > If HTTP.lua+TCPServer is actually better than Xavante, then perhaps we > should write an HTTP.lua launcher for WSAPI. It would take 20-100 > lines of code, and all the WSAPI-based apps can enjoy the benefits of > HTTP.lua+TCPServer without any modifications. I've used Nanoki before just for fun, and I do like its server. A WSAPI launcher would be nice. On a side note, I love how simple announcements and questions about products on lua-l can turn into gigantic discussions on core philosophies of language and application design. I also love how people avoid flaming. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 20:04:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TN4lSl016680; Tue, 29 Sep 2009 20:04:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43D141A6EC; Tue, 29 Sep 2009 20:04:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB3081A5A9 for ; Tue, 29 Sep 2009 20:03:56 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1120104fgg.17 for ; Tue, 29 Sep 2009 16:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=PtjCi6vnEmKfXfGYaDEh47Va4DKHd3fMmfxnOqWzeyI=; b=LCrxWVI3/oZHThT2LBRfS6oJSaX0tZYWiYXvr7P0M0+vTYaiRaFCso8n15B09u5AD9 iQ6dRGVKvmKBAPzlKQBW7jfJXslWk3KyNpwIGHdPdST38/BN2Pnd0ISnUXgANv/EOzQj 7YHN/ObycnkIOePuNxiJ8L1ymbNtZtV4gj7B0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=B2SETnKyC9d2Qq3GX8HRI3QM0W751m9SD5C877gg3fpe6G3eaSw+2woedxZT+jfR6x eiQ9GaHGltWXQvTi/0gA2VU9hMH8Y4ddVgVQvbG+gkiegTgmba5kSgvd/nRBXWlZmMaW GiEMkY/Ky/iBeT6ZqXtUmfVhc7tbZi4EaFFGM= Received: by 10.86.234.9 with SMTP id g9mr4747104fgh.39.1254265447306; Tue, 29 Sep 2009 16:04:07 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id l12sm217611fgb.15.2009.09.29.16.04.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 16:04:06 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: What would _you_ like in a Lua CMS? Date: Wed, 30 Sep 2009 01:03:34 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <560972290909290402l7299482k5268f6f9dca4f59@mail.gmail.com> <2FB662FA-5590-42EB-9273-743A2B8D242E@mac.com> <7913df4d0909291000l64495375s279c3be7669a28ce@mail.gmail.com> <9144C142-21B2-4144-A11E-8F1D183B5CB8@gmail.com> <980B1C85-3802-439D-BF2B-47D509AD07E8@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8TN4lSl016680 On Sep 29, 2009, at 11:14 PM, Yuri Takhteyev wrote: > And on hosts that do not allow you to run your own process, use your > own port, or configure the server? Not my demographic :) > The nice thing about WSAPI is that you can _trivially_ switch between > Xavante, proxied Xavante, CGI, FastCGI, etc. depending on what you > have and what makes sense. In another thread, not so long time ago, David Given wrote, among other things: "Learning Java taught me the importance of pragmatism" http://article.gmane.org/gmane.comp.lang.lua.general/57481 Michael Coté wrote something along the same lines a while back: "JavaÂ’s Fear of Commitment" http://www.redmonk.com/cote/2007/07/25/javas-fear-of-commitment/ So, yes, "All problems in computer science can be solved by another level of indirection" :)) From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 20:40:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TNeleG020639; Tue, 29 Sep 2009 20:40:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0A581A6EF; Tue, 29 Sep 2009 20:40:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth03.prod.mesa1.secureserver.net (smtpauth03.prod.mesa1.secureserver.net [64.202.165.183]) by bazar2.conectiva.com.br (Postfix) with SMTP id D562B1A5ED for ; Tue, 29 Sep 2009 20:39:59 -0300 (BRT) Received: (qmail 18318 invoked from network); 29 Sep 2009 23:40:08 -0000 Received: from unknown (98.117.140.83) by smtpauth03.prod.mesa1.secureserver.net (64.202.165.183) with ESMTP; 29 Sep 2009 23:40:07 -0000 From: Mark Hamburg Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: luaproc thought Date: Tue, 29 Sep 2009 16:40:06 -0700 Message-Id: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Having written the multithreading logic for Lightroom and reading through the luaproc examples, a thought occurs to me about a potentially useful syntactic extension to Lua for these cases. It would be nice to have a way to say essentially "the following portion of the program text should form a syntactically valid Lua chunk which should be encoded as a loadable string". For example, let's look at the example from the luaproc article (http://www.inf.puc-rio.br/~roberto/docs/ry08-05.pdf ): luaproc.newproc( [==[ -- create a new channel luaproc.newchannel( "achannel" ) -- create a new Lua process luaproc.newproc( [=[ -- send a message to the channel luaproc.send( "achannel", "hello world" ) ]=] ) -- create a new Lua process luaproc.newproc( [=[ -- receive a message from the channel msg = luaproc.receive( "achannel" ) -- print the received message print( msg ) ]=] ) ]==] ) This requires careful use of the string nesting markers and none of the code can be syntax checked until execution. Furthermore, when we do execute it, we have to compile code for every new Lua process. Presumably we could get around the last point by caching the results of a loadstring somewhere. We could get around the lack of a syntax check by using special marker characters for the string and having an IDE pull them out and check them separately, but that requires an IDE doing a separate syntax check. We might really prefer to check it all in the initial load. In particular, consider the fact that if the inner calls to newproc are handed invalid code the error happens in the outer process with no good way to communicate with the root environment. We could get around this by passing functions and dumping them to bytecode strings. That, in fact, is what Lightroom does. However, we have to be careful to ensure that the functions so used do not have any upvalues even as they are being created in the midst of code that values upvalues for performance. One could copy the upvalues over but that requires a more sophisticated copying mechanism and if it can't copy everything we're back to potentially not checking inner process creations until it's awkward to report failure. But imagine a chunk keyword (anathema I know to add a keyword, but imagine it none the less). This keyword basically works just like "function" but it returns the bytecode for the chunk and does not capture upvalues. Now we write: luaproc.newproc( chunk() -- create a new channel luaproc.newchannel( "achannel" ) -- create a new Lua process luaproc.newproc( chunk() -- send a message to the channel luaproc.send( "achannel", "hello world" ) end ) -- create a new Lua process luaproc.newproc( chunk() -- receive a message from the channel msg = luaproc.receive( "achannel" ) -- print the received message print( msg ) end ) end ) The differences are subtle, but the problems cited above are resolved. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 20:54:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8TNs1GE022395; Tue, 29 Sep 2009 20:54:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2003C1A6F8; Tue, 29 Sep 2009 20:53:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77E901A6F4 for ; Tue, 29 Sep 2009 20:53:20 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e21so1804193fga.17 for ; Tue, 29 Sep 2009 16:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=gVNqFbDF/IBfJEUjwWg5iPT4VaBAtkjHcBBpEuoM8QU=; b=pdRuetLPqzr0WmjH5yc/vH0wsC1IPq3ZSvct/DDGpLi0oSV1waOAo0KIfrzlTlgp8u qcgpXWhmQmNLMw38Egu157ZMlrRY9TbU80AGREX9QijbTxDHFWKjfcOGRdp0BlYTFPRf tlDigCiX5dEKslfCmti//e7ila9r9UDAoExy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=x1L54dAx7AEV/IRH7SNaFHqTAW+SQq6nwGdipyVbUcgoQAmsQqG3iunmJ68skafMAH GM9WmV7ejf44raGyuFl7gY1cfM89Y1XQSPHYHou4SWUER3EYbuVP2Ay7G1cQgKepcodZ OLmIOMAWGUFTuK5oO3RBYmljCGJMor4C2efBY= Received: by 10.86.184.35 with SMTP id h35mr4846770fgf.18.1254268410961; Tue, 29 Sep 2009 16:53:30 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id l19sm310731fgb.12.2009.09.29.16.53.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 16:53:30 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: luaproc thought Date: Wed, 30 Sep 2009 01:52:58 +0200 References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 30, 2009, at 1:40 AM, Mark Hamburg wrote: > The differences are subtle, but the problems cited above are resolved. What about something like the following, i.e. avoid inline in the first place: local function chunk( aFile ) local aContent = assert( aFile:read( '*a' ) ) assert( loadstring( aContent ) ) return aContent end luaproc.newproc( chunk( aFile ) ) From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 21:27:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U0Rrsx027423; Tue, 29 Sep 2009 21:27:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E66EA1A6FC; Tue, 29 Sep 2009 21:27:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth18.prod.mesa1.secureserver.net (smtpauth18.prod.mesa1.secureserver.net [64.202.165.31]) by bazar2.conectiva.com.br (Postfix) with SMTP id 36A831A5ED for ; Tue, 29 Sep 2009 21:27:05 -0300 (BRT) Received: (qmail 10879 invoked from network); 30 Sep 2009 00:27:10 -0000 Received: from unknown (98.117.140.83) by smtpauth18.prod.mesa1.secureserver.net (64.202.165.31) with ESMTP; 30 Sep 2009 00:27:10 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: luaproc thought From: Mark Hamburg In-Reply-To: Date: Tue, 29 Sep 2009 17:27:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 29, 2009, at 4:52 PM, Petite Abeille wrote: > > On Sep 30, 2009, at 1:40 AM, Mark Hamburg wrote: > >> The differences are subtle, but the problems cited above are >> resolved. > > What about something like the following, i.e. avoid inline in the > first place: > > local function chunk( aFile ) > local aContent = assert( aFile:read( '*a' ) ) > > assert( loadstring( aContent ) ) > > return aContent > end > > luaproc.newproc( chunk( aFile ) ) That requires storing the code for the chunk in a separate file which is fine for complex processes but is a pain for lightweight processes. Mark From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 21:52:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U0qJm7030677; Tue, 29 Sep 2009 21:52:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4402818487; Tue, 29 Sep 2009 21:51:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF6FC18487 for ; Tue, 29 Sep 2009 21:51:37 -0300 (BRT) Received: by bwz10 with SMTP id 10so4905456bwz.5 for ; Tue, 29 Sep 2009 17:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=N6GtEk2/8x3fkwTPTg4D94nl9o2D0B2hjN5n/klATdc=; b=oPYIqibYwRWlb8SZ+hAkPGBv50JNzPIWAFgxGhCGRmCRm3humYj90pGIsv4KHi0cNk MP/msb7rLLsEiOSzU/re2cYbmy4mTQ4J6TJd595qpqXddlrCRmmOLEy3L4v1yywD/sM8 3QeNku1PQe5PztSm1lktpis1KSQa5DTI45gxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FB7omVi4kNWYKZjYKfe8AQXet1uSfX06P+tGYyxu8l3mJOh5qlt/jiXDa+tPplYUAl MRsi3vSGZPVLL/VpisoXuDFcDiP1BAb5DMRx5Y7CEJgRP2qMuj0SmP5PlK1Be5xpQlmw Kh9AxkFpNOl+cs7PMMYZ6c5Ho6H0+c0iYrkc4= MIME-Version: 1.0 Received: by 10.223.103.25 with SMTP id i25mr1407624fao.64.1254271908051; Tue, 29 Sep 2009 17:51:48 -0700 (PDT) In-Reply-To: References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> From: Leaf Storm Date: Tue, 29 Sep 2009 20:51:28 -0400 Message-ID: Subject: Re: luaproc thought To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I had an idea like this once, but instead of the intent being to create bytecode without upvalues, mine was a simple way to create isolated chunks. For example, begin do something end Would be equivalent to: function () do something end The main advantages of this are for using Lua as a DSL, where the 'function ()' syntax is awkward looking and confusing to people who might not really be familiar with programming. (It would also be passable as the sole argument to function calls without parens, like string and table literals are now.) For example: -- choose your own adventure game intro = page begin write 'It is pitch dark. You are likely to be eaten by a grue.' choice 'grue' 'North' -- using currying here, by the way choice 'grue' 'South' choice 'grue' 'East' choice 'grue' 'West' end grue = page begin write 'You walk right into the slavering fangs of a lurking grue.' return false -- Game Over end I was just sharing that. Your idea is pretty good, too. Maybe they could both be in, except that would be too many keywords. :-) -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Tue Sep 29 23:31:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U2VNoE008979; Tue, 29 Sep 2009 23:31:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B9441A704; Tue, 29 Sep 2009 23:30:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F4361A6EE for ; Tue, 29 Sep 2009 23:30:31 -0300 (BRT) Received: by iwn8 with SMTP id 8so3468155iwn.33 for ; Tue, 29 Sep 2009 19:30:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.9.33 with SMTP id j33mr10209001ibj.37.1254277842239; Tue, 29 Sep 2009 19:30:42 -0700 (PDT) In-Reply-To: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> Date: Tue, 29 Sep 2009 22:30:42 -0400 X-Google-Sender-Auth: 9857ac10975616ff Message-ID: Subject: Re: luaproc thought From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 7:40 PM, Mark Hamburg wrote: > It would be nice to have a way > to say essentially "the following portion of the program text should form a > syntactically valid Lua chunk which should be encoded as a loadable string".... > We could get around this by passing functions and dumping them to bytecode > strings....However, we have to be > careful to ensure that the functions so used do not have any upvalues... > But imagine a chunk keyword (anathema I know to add a keyword, but imagine > it none the less). This keyword basically works just like "function" but it > returns the bytecode for the chunk and does not capture upvalues. You can check at run-time whether a given function has upvalues via "debug.getupvalue(f,1) == nil", which is basically bytecode inspection. Analogously, you can also detect access to globals (checkglobals [1]). Would that be enough? As with [1], it wouldn't be that much work to write a tool to also statically verify the absence of upvalues (e.g. with luac -p -l, Metalua, patched luac, etc.) provided the given functions are annotated in some way. For example, in luaanalyze it could be function() --! noupvalues() -- this will error at compile time if the current function has upvalues msg = luaproc.receive("achannel") print(msg) end or inversely, --! luacode() -- this will error at compile time if the subsequent string is not valid Lua [[ msg = luaproc.receive("achannel") print(msg) ]] or more transparently luacode [[ msg = luaproc.receive("achannel") print(msg) ]] where luacode is the identity function at runtime but assumes the meaning of "--! luacode()" in the lint tool. That said, there have been occasions where I wanted something like you suggest, except that the called function wants the original source, not just the bytecode. Use cases might involve code generation [2], metaprogramming, debugging, or serializing a data structure back to disk in original source code form. There have been proposals to allow the source code for a function to be obtained [3], which would address this. A more extensive approach is Metalua, which provides you full access to the AST. [1] http://lua-users.org/wiki/LuaTypeChecking [2] http://lua-users.org/wiki/CodeGeneration [3] http://lua-users.org/lists/lua-l/2008-09/msg00345.html From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 00:23:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U3NKKO014518; Wed, 30 Sep 2009 00:23:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94EF71A70D; Wed, 30 Sep 2009 00:22:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 085161A708 for ; Wed, 30 Sep 2009 00:22:28 -0300 (BRT) Received: by pxi2 with SMTP id 2so7104872pxi.11 for ; Tue, 29 Sep 2009 20:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=y0fA6WcRAn20UIy6rpxehgAVIHLHEEsN8Z9rN3u66RI=; b=kS3Oh2aeOo/B6yv8B2/RW/R85SGCFNEz+tId/VpgghoD4972XL0vnTkEAIyIt2pFYl dG3dErkIKo2Hl5FgHw1C2UDOd1iRRBpMSpF3jN+AlG0GeE7APz3WAYDVa4sUNKEGOe/8 JsJGP+wWJIc4sTF1akVRscMbFJLJPdYjY/3m4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tH1D6qT9s7//PJvl2tcEl7rtvzzbyro8Yc8iRt1N3pv0OEyE5e6tpEhpr6Rr7jdcKS If3kgLu8vVwIiPmJrisSK85D2fmDIIbs3xVl/OGz3T92KHrClPR9PITC7mZSb6Q3pJ/x A6mqA6SqsriKjwE1mbB21HFs0nGYQZTUHduYU= MIME-Version: 1.0 Received: by 10.142.75.5 with SMTP id x5mr421759wfa.197.1254280959658; Tue, 29 Sep 2009 20:22:39 -0700 (PDT) In-Reply-To: <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> Date: Tue, 29 Sep 2009 20:22:39 -0700 Message-ID: <17eac67c0909292022m4be23275oe9783f7803f7fb03@mail.gmail.com> Subject: Re: What would _you_ like in a Lua CMS? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Sep 28, 2009 at 10:10 AM, Petite Abeille wrote:>> - HTTP ain't as simple as at looks, particularly when dealing with stuff >> like multipart, transfer encoding, negotiating compression and so on; >> targeting something like WSAPI makes all these problems go away, as the main >> web server does it for you; > > Ditto with proxies, you can leave each proxy to specialize in whatever it > does well. Very similar to the basic concept of stdin/stdout in Unix. Not > every tool needs to implement everything. Instead, one can pipeline > processing from one to the other. The lingua franca being HTTP. > >> - having two HTTP servers means that you've double the chances of exposing >> a security flaw to the outside world; WSAPI nicely isolates you from the web >> server proper, > > I always wonder why people want to be "isolated" from HTTP: what's the > benefit of ignoring the most fundamental protocol a web application is > supposed to deal with? A bit like wanting to access a relational database, > but not wanting to bother with SQL. WSAPI (in its various forms in python, lua, and ruby, that I know of) has nothing to do with isolating from HTTP, its about decoupling the implementation of the HTTP protocol, from the implementation of the behaviour. This allows an HTTP aware app to not be tied to a particular server. It neither encourages or discourages proxying, in fact, it allows you to set up an arbitrarily complex set of http servers, proxied between other, each implementation perhaps specialized for a particular purpose, and distribute your apps into the server of choice. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 01:33:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U4XDnu021086; Wed, 30 Sep 2009 01:33:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2EA51A714; Wed, 30 Sep 2009 01:32:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE8F91A70E for ; Wed, 30 Sep 2009 01:32:23 -0300 (BRT) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id LNK82129 for ; Wed, 30 Sep 2009 14:32:29 +1000 Message-ID: <4AC2DF5C.60208@infinite-interactive.com> Date: Wed, 30 Sep 2009 14:32:28 +1000 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Test Code (and a C# porting question) References: <4AC06FFC.7010702@infinite-interactive.com> <20090928114802.GA4963@inf.puc-rio.br> In-Reply-To: <20090928114802.GA4963@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: >> a standard set of samples that each release of the Lua source code is > See http://lua-users.org/lists/lua-l/2008-06/msg00124.html Perfect, thanks! My port currently runs the majority of those tests properly but I still have some work to do. (I haven't tried your code yet François but thanks for the pointer to it.) One of the things I would like some feedback on is what people think the priorities should be when porting Lua to other languages. When I started my port it quickly became apparent that there were going to have to be some compromises between behaviour, code maintainability and performance. Behaviour is a tricky one, I don't think it's possible to do an exact C# port given the disparities even across existing compiler environments. As an example, I've had to port the garbage collector code as well in order for things like weak tables to behave as closely as possible to the way they do with the original code (although the actual disposing is still handled by the .NET CLR). The Lua GC needs to be able to calculate the size of various structures in order to keep track of memory allocation, but it's difficult/impossible to obtain those in managed C#. I got around it by simply hard-coding the size of all the counterpart Win32 C++ structures and setting the VM's memory management routines to use those for its bookeeping. It works, but can potentially change the behaviour of other parts of the code e.g. global_State.totalbytes is now more of a hueristic for the GC rather than a true indication of current memory allocation. After behaviour, my secondary objective has been code maintainability...I've generally kept the port line-by-line as close to the original code as possible so that future patches and upgrades can be easily applied. Unfortunately this strategy seriously affects performance, even with full optimizations enabled. The original code makes judiscious use of the template processor and since C# doesn't have a preprocessor these have had to be replaced with static internal/private member functions, which is exactly what you don't want in the type of performance-critical code that it's being used for. Sometimes the C# optimizer performs well, often it doesn't! Lua's performance is arguably one of its main attractions, but my philosophy so far has been to get the behaviour to match the original code as closely as possible and try to deal with performance optimization later. Is this the preferable strategy to take with Lua ports in general, or should duplicating the exact behaviour of the VM take more of a back seat? Mark Feldman This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 03:26:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U6QTFZ031103; Wed, 30 Sep 2009 03:26:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 317301880B; Wed, 30 Sep 2009 03:25:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s802.sureserver.com (s802.sureserver.com [195.8.222.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21D43187D5 for ; Wed, 30 Sep 2009 03:25:44 -0300 (BRT) Received: (qmail 8669 invoked by uid 1003); 30 Sep 2009 06:25:54 -0000 Received: from unknown (HELO ?192.168.1.101?) (ikolev@91.92.152.6) by s802.sureserver.com with ESMTPA; 30 Sep 2009 06:25:54 -0000 Message-ID: <4AC2F9EB.1050807@gmail.com> Date: Wed, 30 Sep 2009 09:25:47 +0300 From: Ivan Kolev User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm not going to argue about the benefits of C++ vs Lua for large applications. I have enough experience with C++ to realize how much its ideology is oriented to catching errors at compile time (though at the price of long compile times), and I've learned to use it. I've learned to design code so that it is hard to use incorrectly and easy to use correctly - C++ gives you tools for that. Maybe I'm not experienced enough with Lua to do the same. --Ivan From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 03:46:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U6kp0J000459; Wed, 30 Sep 2009 03:46:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98DEC1A715; Wed, 30 Sep 2009 03:46:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E41201A6F8 for ; Wed, 30 Sep 2009 03:46:06 -0300 (BRT) Received: by bwz10 with SMTP id 10so5013184bwz.5 for ; Tue, 29 Sep 2009 23:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=u8CrhjhJTjsRbcafYEfqcThYYA+0Z81D57iSWXo7JPc=; b=jGFEIyC99/FLGHdyq8YGw3hDvQeiy2esH4zUYpWNNeBWomdPpJQdjMdJaeQTxZ5Bq8 03naTI9blV107JLKu/b5HB5Mku2+61ILczKpHVUx7QlJTJTM6AJBUR4zVhmz28zvUg/r XH0zX2Y4/pz3/7dYgk2K9DaA79kHF6OdyFVyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fx19QRFbOqmg7bfJPho5cOnwR3q9/FGmXFMYlYbaZaAHgeuBgQPQ31onkubTC8kwo5 PKWcy9rcMZNO0e3e6bkMfayhWViq8xPffFfVVCzB4MpLZhRMQwfqtwfbzoRX5iUNOpHo RCL4xHF4RM2vDfSVfUgJGmXYDrDkHNoWWmrHk= MIME-Version: 1.0 Received: by 10.239.182.150 with SMTP id q22mr443800hbg.73.1254293176756; Tue, 29 Sep 2009 23:46:16 -0700 (PDT) In-Reply-To: <4AC2F9EB.1050807@gmail.com> References: <4AC2F9EB.1050807@gmail.com> Date: Wed, 30 Sep 2009 08:46:16 +0200 Message-ID: <560972290909292346j1b5db5d6t307e41ab8752617b@mail.gmail.com> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 8:25 AM, Ivan Kolev wrote: > I have enough experience with C++ to realize how much its ideology is > oriented to catching errors at compile time (though at the price of long > compile times), and I've learned to use it. I've learned to design code so > that it is hard to use incorrectly and easy to use correctly - C++ gives you > tools for that. The Lua/C++ mixture can be tuned to fit the application; one can lay down the foundation with C++, and use (semi) automated bindings to add disciplined access to Lua internally. It is a different mindset, but there are opportunities. It is not difficult to add an interactive Lua console (even to a GUI app) and then have a powerful mode for exploratory programming; you are then _within_ the system. Since Lua can be reloaded easily, the core doesn't have to be rebuilt for each feature - in fact, with care this can be done while keeping the process alive. Rebuilding is an obvious overhead to the development cycle, but getting to the area where you are working can also take time, especially with GUI applications. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 04:57:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U7vYP6008642; Wed, 30 Sep 2009 04:57:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 626051A6F0; Wed, 30 Sep 2009 04:56:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 395D51A5A9 for ; Wed, 30 Sep 2009 04:56:40 -0300 (BRT) Received: by qyk4 with SMTP id 4so4702775qyk.33 for ; Wed, 30 Sep 2009 00:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Nt9PHGj1v5K/uG+o1/HDuTIfJvzhwSTsUPKNflzf+rs=; b=UFMTbvMUYmK76xELlQQb6XWhbEC4C8x2Vf710bYkSm3wim393VXXfaS3/r2VaYIpbp aL3FEKSe/OfmE41dAJYn0lUnphOBaRAhCIsL6iWmXCZXSXTaJRqPhY3MKN6IoXpdJpiu FrUN8ToqIqDe6yOxIlTaJSHMFZQM7eXe1QEwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=scDqsaka4JHidZ+D0aOM23x9d+vFJ6+KF4AnyUAJwBpJByzqv1HLrenxPcr/RWg07A r1RTki+X3YIsHJuAIbZ3V1E7d0KwkT+S2pILIqZCtlg1r+zD0OVgwGOKAnwKghqQ6iY0 KVMBiByr7YL7rNXT52OrsUciAimk1x3Yh0lAA= MIME-Version: 1.0 Received: by 10.224.52.221 with SMTP id j29mr5273380qag.347.1254297411935; Wed, 30 Sep 2009 00:56:51 -0700 (PDT) In-Reply-To: <4AC2F9EB.1050807@gmail.com> References: <4AC2F9EB.1050807@gmail.com> Date: Wed, 30 Sep 2009 11:56:51 +0400 Message-ID: Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8U7vYP6008642 On Wed, Sep 30, 2009 at 10:25, Ivan Kolev wrote: > I'm not going to argue about the benefits of C++ vs Lua for large > applications. > I have enough experience with C++ to realize how much its ideology is > oriented to catching errors at compile time (though at the price of long > compile times), and I've learned to use it. I've learned to design code so > that it is hard to use incorrectly and easy to use correctly - C++ gives you > tools for that. > Maybe I'm not experienced enough with Lua to do the same. Several years before, when I came to Lua, my professional programming experience was almost all C++, without much of dynamic languages experience. I agree, that, indeed, in C++, with careful design, compile-time validation can give very good correctness guarantees. At first it was quite hard to write code in Lua — without compile time validation, without static types, it felt as if I try to stand on a blob of wobbly jelly instead of a good solid rock. The price of such validation is quite high. Not to mention longer compile times. You need to spend much time on the design itself. Sometimes much more time than you'd spend solving the problem that you write code for. You need highly skilled and disciplined architector paying constant attention to the each part of the project all the time. You need highly-qualified programmers. If you have a hammer, try to avoid looking on everything as a nail. I quite understand if that amount of effort is spent on the low-level "foundation" code in the system (application, library etc.). It is usually written once, must be of high quality and work fast. But to waste it on the business logic, that mutate every day to the whim of the high command? You want to be able write cheap business logic code. Okay, it should be reliable enough and fast enough. But it is usually comes in huge quantities, and you should be able to change it quick. You should not need extra skilled programmers to write it — or your budget will bust. Lua is perfect here — it is reliable, fast and easy to grasp. Compile-time guarantees are not possible to achieve with pure Lua. As we know, Lua compiler is dumb (and this is a good thing — since it is also fast and simple). I do hope that, in time, we would get Metalua-based static code validation tool, powerful enough to do something like that. But now there is no such tool now. However, there is a simple solution — that you, of course, know. Write tests. Any static analysis tool may only catch generic errors, that it has heuristics for. Even C++ compile-time validation will catch only so much of wrong logic — and the more it may catch, the greater the price of the code. As I said in this thread earlier, we have 160+ KLOC of Lua code. 80 KLOC of it are tests for our Lua and C++ code (we have 90+ KLOC of C++). Most of our tests are declarative and consist of table-structured input / expected output data, they are significantly sparser than the usual code, so the price per LOC is lower. Tests catch more (you may tune them exactly to the behaviour you expect), they cost less (you may employ less sophisticated programmers), they help refactoring at least as much as the static compile checks. If we compare Lua with "test-time" validation and C++ with its compile-time checks, to me Lua is the winner (for the business logic at least). Alexander. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 05:48:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U8mu9l012639; Wed, 30 Sep 2009 05:48:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6CE21A6DE; Wed, 30 Sep 2009 05:48:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 128571A67A for ; Wed, 30 Sep 2009 05:48:10 -0300 (BRT) Received: by fxm12 with SMTP id 12so5803612fxm.5 for ; Wed, 30 Sep 2009 01:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=YK3l7gD+L9HBWmZUTBW3nDXRdf4kJH455tIuYUYLsOE=; b=xyWCMeRITP3wwSbGJDoXmAoxleqvZf7GaUAf80vR7GkjND/Wo13cEaBlfWiAsP+JSm mrlA/w7TC5auK6GCpXlF/zOzIHeKbdtOjSUkePNFtxnORGIgpnox3JvOBCYF1rji9Shs lqWV365hGOz1cRPN/81WHtPknmJfXAy+ELa3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UYuUx0qcacdJlAa3QYJBJBacWaNWtwYSpt0Vi87Oprb7EaXQGljsBEumATjkVqAciJ 2G9IB1TVQNF2ZRJdc4hyM2O+6fSPvSFZNR6R4sYrtz1u2d2vG4keNXSIkcDqQeQHN27X BrbVFvEYGsQR/8dW9YGWdrCWdNvqXI3XZAHlY= MIME-Version: 1.0 Received: by 10.204.48.212 with SMTP id s20mr2372156bkf.101.1254300501568; Wed, 30 Sep 2009 01:48:21 -0700 (PDT) Date: Wed, 30 Sep 2009 10:48:21 +0200 Message-ID: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> Subject: GSL Shell software announcement From: Francesco Abbate To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00032555691ed66c450474c79735 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555691ed66c450474c79735 Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm proud to announce the first developer release of GSL Shell, an interactive interface that gives access to the GNU Scientific Library (GSL). The project is hosted at Savannah at https://savannah.nongnu.org/projects/gsl-shell/. The webpage with the documentation is at http://www.nongnu.org/gsl-shell/. GSL Shell is based on the LUA scripting language gives you all the flexibility and richness of the LUA programming language. The combination of LUA and the GSL library open the possibility of developing complicated routines without the burden of writing a real C application. This is the first public release of GSL shell and it is not intended for the casual user but a lot of work have been already done and many modules are already functional. The module that are currently usable are: - matrix linear algebra - Fast Fourier Transform of real data => not yet documented - Nonlinear least squares fit for *real* and *complex* data - Numerical integration - Ordinary Differential Equation (ODE) system solving for *real* and * complex* data There is also a draft of the documentation but still a lot of work has to be done. I hope you will give a try to the software and may be help in the development if you are interested. Best regards, Francesco --00032555691ed66c450474c79735 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I'm proud to=A0announce=A0= the first developer release of GSL Shell, an interactive interface that giv= es access to the GNU Scientific Library (GSL).

The project is hosted at Savannah at=A0https://savannah.nongnu.org/projects/gsl-= shell/. The webpage with the documentation is at=A0http://www.nongnu.org/gsl-shell/.

GSL Shell is based on the LUA scripting language gives you all the flex= ibility and richness of the LUA programming language. The
combination of= LUA and the GSL library open the=A0possibility=A0of developing= complicated routines without the burden of writing a real C application.
This is the first public release of GSL shell and it is not intended fo= r the casual user but a lot of work have been already done and many modules= are already functional. The module that are currently usable are:
- mat= rix linear algebra
- Fast Fourier Transform of real data =3D> not yet documented
- Nonli= near least squares fit for=A0real=A0and=A0complex=A0data
-= Numerical integration
- Ordinary Differential Equation (ODE) system sol= ving for=A0real=A0and=A0complex=A0data

There is also a draft of the documentation but still a lot of work has = to be done. I hope you will give a try to the software and may be help in t= he development if you are interested.

Best regards,
Francesco --00032555691ed66c450474c79735-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 06:12:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U9CFER014521; Wed, 30 Sep 2009 06:12:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB34B1A702; Wed, 30 Sep 2009 06:11:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 598DF1A6C7 for ; Wed, 30 Sep 2009 06:11:36 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1201420fgg.17 for ; Wed, 30 Sep 2009 02:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7KVHG8yeypE9m2MinBwXww01khCwDUKYzYj54YzyCkQ=; b=V7dWjVNGWkxf1+6DuV+WV8ogGNgGD2jQzdqJklE+KFgkf0njMDM/EBv8sSYVaUcbYW 8Mthpe8iiNJeRbwtdGrTFCZ+kWJPrzWbmBs78DV1wtu78XfttGpLmUEK+YOQStbfkIeF 4NNM36Jxxa7OmvfPhjvRWpabDqUew8j9BJ9Kc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=aa3WWlT3qo4FP0UkkUZ0w9N4ny/yOf9dLDhXP9j7QxmZ4QFnvobzfEuxL/uLsTNKVJ rG1kHSktHA/fDjRp6eZGizN/eUad5vQ4Y3tjGXpZRa2WrB17825Q+KQRAJpl2EP38ovx retXIyzIBFJ12rhXeMUQsU/bAlLx55ztdvJkc= MIME-Version: 1.0 Received: by 10.239.141.143 with SMTP id c15mr512974hba.47.1254301906973; Wed, 30 Sep 2009 02:11:46 -0700 (PDT) In-Reply-To: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> Date: Wed, 30 Sep 2009 11:11:46 +0200 Message-ID: <560972290909300211s2dcd2e4dk754d7955c2f5ad46@mail.gmail.com> Subject: Re: GSL Shell software announcement From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8U9CFER014521 On Wed, Sep 30, 2009 at 10:48 AM, Francesco Abbate wrote: > I'm proud to announce the first developer release of GSL Shell, an > interactive interface that gives access to the GNU Scientific Library (GSL). Very cool! Definitely a good use of Lua. What would be extra cool is some integration with GnuPlot, so one can have a look at generated curves, inspect data. E.g. if you were doing non-linear curve fitting. > GSL Shell is based on the LUA scripting language gives you all the > flexibility and richness of the LUA programming language. It's Lua, not LUA; not an acronym, but a word meaning Moon. (Besides, LUA as an acronym has some Windows meaning) This may be pedantic but it really does look better as a word ;) steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 06:52:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8U9pwpK018239; Wed, 30 Sep 2009 06:51:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAB281A5A9; Wed, 30 Sep 2009 06:51:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s802.sureserver.com (s802.sureserver.com [195.8.222.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 141601928F for ; Wed, 30 Sep 2009 06:51:13 -0300 (BRT) Received: (qmail 32237 invoked by uid 1003); 30 Sep 2009 09:51:24 -0000 Received: from unknown (HELO ?192.168.1.101?) (ikolev@91.92.152.6) by s802.sureserver.com with ESMTPA; 30 Sep 2009 09:51:24 -0000 Message-ID: <4AC32A15.50908@gmail.com> Date: Wed, 30 Sep 2009 12:51:17 +0300 From: Ivan Kolev User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > The Lua/C++ mixture can be tuned to fit the application; one can lay > down the foundation with C++, and use (semi) automated bindings to add > disciplined access to Lua internally. Alexander Gladysh wrote: > I quite understand if that amount of effort is spent on the low-level > "foundation" code in the system (application, library etc.). It is > usually written once, must be of high quality and work fast. But to > waste it on the business logic, that mutate every day to the whim of > the high command? Exactly. Lua is the perfect complement to C++ when a fast and easy way to code business logic is needed as another layer on top of the foundation. For me C++/Lua (along with all their libraries and tools) is the most powerful software development tool combo. One should just correctly recognize where to draw the line between them, depending on the nature of the project. For most of the projects I've worked on so far, the Lua part was the smaller one. As for the level of qualification of the programmers - I think that should be a secondary factor when deciding on the tools for the project. If the project clearly needs C++, better hire or train the needed engineers, rather than switch to a tool less suited for the task but easier to use. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 07:47:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UAlRE9023065; Wed, 30 Sep 2009 07:47:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F0F2190FC; Wed, 30 Sep 2009 07:46:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CD06185D7 for ; Wed, 30 Sep 2009 07:46:44 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mswhx-0005HE-2U for lua@bazar2.conectiva.com.br; Wed, 30 Sep 2009 11:46:53 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 8EC2A80FC for ; Wed, 30 Sep 2009 11:46:49 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:16403 with envelope Message-ID: <4AC33713.50203@cowlark.com> Date: Wed, 30 Sep 2009 11:46:43 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: luaproc thought References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> In-Reply-To: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8UAlRE9023065 Mark Hamburg wrote: [...] > But imagine a chunk keyword (anathema I know to add a keyword, but > imagine it none the less). This sounds like perfect fodder for something like metalua. The string could be hoisted out of the expression where it's used, compiled to bytecode at the top level, assertion checked for upvalues, etc, all quite easily: fn(chunk print("Hello, world!") end) ==> local __chunk1 = function() print("Hello, world!") end checkNoUpvalues(__chunk1) ... fn(__chunk1) Metalua might be a bit heavyweight for just this, though --- I have vague recollections that there's a more lightweight form of syntax extension available, but can't for the life of me remember what it is. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 08:07:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UB7DkX024997; Wed, 30 Sep 2009 08:07:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEEC41A67A; Wed, 30 Sep 2009 08:06:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B42F718398 for ; Wed, 30 Sep 2009 08:06:32 -0300 (BRT) Received: by bwz10 with SMTP id 10so5146806bwz.5 for ; Wed, 30 Sep 2009 04:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BUuDyChpmAIK4gAs0vEGuzJ+oyvdLhMMCzHecBAtUWI=; b=xgBeksYzKzl/3jlU42ggvlLzDJ61BbKBkOjyAsuS01dCFGx4vQZ8MrEVpejdkI0Wvj QNt1iGJt6yMWlwrI+wsZXdkSVjw7GIq0Q0ho5ZJMZ7bKhv4mDgp3/jnut7ifH0w5eN1r 1Juh4TGOSUy+OMoyenSv6AQYCfXtGNukY11Qg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uSyUhbB6HVlrRM4SQgPpzWuB72ik2ytISn4Yc0BTrC0rMxzrcq7DlfGhKbrjkjGbaK z4kPM3VsSt/GItIahUxnhMr8tdr1NSzfZ6KLEKXG6F5+/dEjRW4aJL6KMtgF/58YjRDe FBmjWfRPCoawFBD7GR0iCWdcVw043c2FPts3w= MIME-Version: 1.0 Received: by 10.239.143.216 with SMTP id l24mr527588hba.166.1254308801581; Wed, 30 Sep 2009 04:06:41 -0700 (PDT) In-Reply-To: <4AC33713.50203@cowlark.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <4AC33713.50203@cowlark.com> Date: Wed, 30 Sep 2009 13:06:41 +0200 Message-ID: <560972290909300406i343cfef3nae00893074c56f2@mail.gmail.com> Subject: Re: luaproc thought From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 12:46 PM, David Given wrote: > Metalua might be a bit heavyweight for just this, though --- I have > vague recollections that there's a more lightweight form of syntax > extension available, but can't for the life of me remember what it is. Well, one option is simple lexical macros (http://lua-users.org/wiki/LuaMacros) The advantage of this that the macro substitution takes place as an extension of the usual Lua lexical analysis, so no separate preprocess/compile step is required. The two disadvantages are (1) does require lhf's token filter patch to Lua and (2) lexical substitution is often too stupid. But clever enough for this, I'd wager. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 09:22:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UCMfhr003809; Wed, 30 Sep 2009 09:22:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD240192C0; Wed, 30 Sep 2009 09:21:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99C33192B7 for ; Wed, 30 Sep 2009 09:21:49 -0300 (BRT) Received: by ewy26 with SMTP id 26so6560913ewy.5 for ; Wed, 30 Sep 2009 05:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=8oiqMlrqJj9NWyaZJ+WBkP+chRVWeT0DOHtvo11L2Zw=; b=KgOFSptP6WLU2ABWyC0BTgZiUmpjV04mb635a6B8lf/CZ/M4go7/5lkLhRnFoc5yR8 EmvMgGbrdtqWtFi0He1xQXGM4oH0lD0Pt0UxjLHHq2wkvMsnZBWVnx9L87Md23fzhJ27 g173PlVRkg+/ZPPbAGcepXORg1sc+7chbQuIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=OCEqHIdg3ti+7tAJJPxfghW7lrXYjYDzs/XSHgKVkK8NsC838Ik7kzmvX/xzaXYU7R OCi4LcXD1NZun+wgK9YIVl03lFRdfCGQVtVSuhxfcNfDgy0R72qXmDz9Zv/ZiOMTrkZk hXL3QbVh3H3cKeaY9mU1w9podITvL33XKe+Kg= MIME-Version: 1.0 Received: by 10.216.16.139 with SMTP id h11mr1298075weh.83.1254313320200; Wed, 30 Sep 2009 05:22:00 -0700 (PDT) In-Reply-To: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> From: Jerome Vuarand Date: Wed, 30 Sep 2009 14:21:40 +0200 Message-ID: <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> Subject: Re: luaproc thought To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/9/30 Mark Hamburg : > Having written the multithreading logic for Lightroom and reading through > the luaproc examples, a thought occurs to me about a potentially useful > syntactic extension to Lua for these cases. It would be nice to have a way > to say essentially "the following portion of the program text should form a > syntactically valid Lua chunk which should be encoded as a loadable string". > For example, let's look at the example from the luaproc article > (http://www.inf.puc-rio.br/~roberto/docs/ry08-05.pdf): > > luaproc.newproc( [==[ > -- create a new channel > luaproc.newchannel( "achannel" ) > -- create a new Lua process > luaproc.newproc( [=[ > -- send a message to the channel > luaproc.send( "achannel", "hello world" ) > ]=] ) > -- create a new Lua process > luaproc.newproc( [=[ > -- receive a message from the channel > msg = luaproc.receive( "achannel" ) > -- print the received message > print( msg ) > ]=] ) > ]==] ) > > This requires careful use of the string nesting markers and none of the code > can be syntax checked until execution. Furthermore, when we do execute it, > we have to compile code for every new Lua process. Presumably we could get > around the last point by caching the results of a loadstring somewhere. > > We could get around the lack of a syntax check by using special marker > characters for the string and having an IDE pull them out and check them > separately, but that requires an IDE doing a separate syntax check. We might > really prefer to check it all in the initial load. In particular, consider > the fact that if the inner calls to newproc are handed invalid code the > error happens in the outer process with no good way to communicate with the > root environment. > > We could get around this by passing functions and dumping them to bytecode > strings. That, in fact, is what Lightroom does. However, we have to be > careful to ensure that the functions so used do not have any upvalues even > as they are being created in the midst of code that values upvalues for > performance. One could copy the upvalues over but that requires a more > sophisticated copying mechanism and if it can't copy everything we're back > to potentially not checking inner process creations until it's awkward to > report failure. > > But imagine a chunk keyword (anathema I know to add a keyword, but imagine > it none the less). This keyword basically works just like "function" but it > returns the bytecode for the chunk and does not capture upvalues. Now we > write: > > luaproc.newproc( chunk() > -- create a new channel > luaproc.newchannel( "achannel" ) > -- create a new Lua process > luaproc.newproc( chunk() > -- send a message to the channel > luaproc.send( "achannel", "hello world" ) > end ) > -- create a new Lua process > luaproc.newproc( chunk() > -- receive a message from the channel > msg = luaproc.receive( "achannel" ) > -- print the received message > print( msg ) > end ) > end ) > > The differences are subtle, but the problems cited above are resolved. Don't you think that it would be very confusing that some code bits have upvalues, but others do not, all mixed up in the same file ? That is amplified by the fact that the 'chunk' code of the example could try to access outer variables, but instead of upvalues you would get perfectly legal global variable access, and thus no way to report that as an error at compile time. I'm not agains the proposal, but I think the limit should be something more visible than a keyword. A new type of pseudo-string quote pair would be more appropriate imho. For example it could be a derivative of [=[ ]=], with the = character replace with something else. For example [=[return 42]=] is a simple string, but [x[return 42]x] is string whose content must be a valid Lua script. This would still allow nesting just like long strings by duplicating the middle character. Besides that, there may be a technical limitation that would make that addition (with your syntax or mine) difficult. For the moment, a Lua script is always parsed entirely in one step (a single call to lua_load). Allowing "embedded but independent" scripts would imply that the parser of the current script could instanciate another clean parser to parse the substring, eventually forward the syntax errors, or otherwise continue with the outer script parsing. I don't know the Lua source code, but depending on the precise Lua implementation, that might be complicated to do. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 09:27:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UCRtTf004623; Wed, 30 Sep 2009 09:27:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAACA192E0; Wed, 30 Sep 2009 09:27:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68A61192D5 for ; Wed, 30 Sep 2009 09:27:15 -0300 (BRT) Received: by bwz10 with SMTP id 10so5197013bwz.5 for ; Wed, 30 Sep 2009 05:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8Mu+LwnPpmMMeNvKBivWGRVo1Qf7Nvwq9qgU3skIfYg=; b=b+AVV176L2m8z1B0+j0vKV37aLWbZBugl+3bhrCBim7dXTC72dY9zEE3M4ALanJju3 99XH/IrptghH/5ukR/aGSOW6q0tKYkEVK+REkE6itrkdFNs/Nt5ex/V6SIyRVNXDrJcE gSET5HQJwLdlHmZkMG6zNp0K7+ggnRHp0hn+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RkZGOdwStfZT5/4AtuYIhPykor9LLq+r1ntLuc1p4eMrJYphraoj7jdFhUd10Glj1O MmeeA+odzRsCrU1bxNfaKn1R8SJF9CP0b3i7owuEI3VOYmYgD0abcT2GbmOq9aMgto0J Q7J+K1byRBJ3qLaO6d5TwczZ/G4DjzFa0tICw= MIME-Version: 1.0 Received: by 10.239.145.163 with SMTP id s35mr508331hba.42.1254313645931; Wed, 30 Sep 2009 05:27:25 -0700 (PDT) In-Reply-To: <560972290909300406i343cfef3nae00893074c56f2@mail.gmail.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <4AC33713.50203@cowlark.com> <560972290909300406i343cfef3nae00893074c56f2@mail.gmail.com> Date: Wed, 30 Sep 2009 14:27:25 +0200 Message-ID: <560972290909300527i6103f0d5tf333c958c7ac9b4f@mail.gmail.com> Subject: Re: luaproc thought From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 1:06 PM, steve donovan wrote: > (2) lexical > substitution is often too stupid. In this case, this is probably true ;) With a suitable definition of checkNoUpvalues, one can do this: macro.define('chunk',nil,'checkNoUpdates(function()') macro.define('endchunk,nil,'end)') Which is less than elegant. Accounting for matching ends and nested chunks would be nasty. However, it is probably better API design for the consumer of such chunks to do the upvalues test itself, in which case chunk is trivial: macro.define('chunk',nil,'function()') BTW, I rather like Mr Storm's 'begin' token and begin-blocks being allowed to be the argument of the preceding function without parentheses. Nice for DSLs. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 09:36:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UCalgO005707; Wed, 30 Sep 2009 09:36:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 682DF192F7; Wed, 30 Sep 2009 09:36:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9171192E6 for ; Wed, 30 Sep 2009 09:36:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so5962896fxm.5 for ; Wed, 30 Sep 2009 05:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xW5KgcYA9l7PxjTqOES4GgtdR6VBTIYq24vOKGNz4bQ=; b=wqzYkmXfdAOhYGB9FsRhTXsCjxZji04rQWDDGxainbDdHVxvfWSDbKc4s3MFzCix6G 27zf6HkJ712chpzZW0oEwa+RaxzzpuF996pcVO+z7QqHGaZYbLW//HfM9gyZHXDQtiu7 Q9I3ESZ7WQQyAICm+BEN0Bld/sHvi4Aw5d6+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MBHYqae8hyTpXViOPR2AUr29z1PDbnzRXpSY0fgbaYn7J9arOWnDesbm0hBmkeFwAc Dv6RbArEWPOW1g6PN1bLt1bovxUeuDDOJBiBv6bCm7tqROtusneD09beUb8l+9pjuBLM Agv93+VaZcmaku4kjx48O5kkMswPwWKDoeP3A= MIME-Version: 1.0 Received: by 10.239.184.157 with SMTP id y29mr525795hbg.54.1254314174056; Wed, 30 Sep 2009 05:36:14 -0700 (PDT) In-Reply-To: <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> Date: Wed, 30 Sep 2009 14:36:14 +0200 Message-ID: <560972290909300536wecfe28fxab782001ed65262c@mail.gmail.com> Subject: Re: luaproc thought From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 2:21 PM, Jerome Vuarand wrote: > Don't you think that it would be very confusing that some code bits > have upvalues, but others do not, all mixed up in the same file ? That > is amplified by the fact that the 'chunk' code of the example could > try to access outer variables, but instead of upvalues you would get > perfectly legal global variable access, and thus no way to report that > as an error at compile time. Ah, but Lua does know whether a function does in fact have upvalues once it is compiled. The bigger problem is that the destination context where the chunk will be run has to be compatible, so global discipline is required. Like, explicit requires as in LuaLanes. E.g. you may have lfs globally available, cannot assume the chunk knows about this! The Lua parsing issue is not an issue; the chunk is just an anonymous function, compiled with the rest. From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 10:23:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UDNTIl015365; Wed, 30 Sep 2009 10:23:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E79EF19331; Wed, 30 Sep 2009 10:22:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D7A1192EE for ; Wed, 30 Sep 2009 10:22:29 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 71394D425C for ; Wed, 30 Sep 2009 16:22:32 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: luaproc thought References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <4AC33713.50203@cowlark.com> <560972290909300406i343cfef3nae00893074c56f2@mail.gmail.com> Date: Wed, 30 Sep 2009 16:22:35 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <560972290909300406i343cfef3nae00893074c56f2@mail.gmail.com> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 30 Sep 2009 14:06:41 +0300, steve donovan wrote: > Well, one option is simple lexical macros Hmm, turning off upvalues sounds like a nice useful feature. What about this (intentionally ugly syntax, so that nobody would use it :-) ): Test: a = "global a" b = "global b" local a = "local a" function x() local b = "local b" local function f#() return a, b end local function g() return a, b end print(f()) print(g()) end x() -->global a global b -->local a local b Patch: --- lua-5.1.4/src/lparser.c 2007-12-28 17:32:23.000000000 +0200 +++ lua-5.1.4-namelid/src/lparser.c 2009-09-30 16:11:44.000000000 +0300 @@ -235,7 +235,7 @@ return VLOCAL; } else { /* not found at current level; try upper one */ - if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL) + if (singlevaraux(fs->namelid ? 0 : fs->prev, n, var, 0) == VGLOBAL) return VGLOBAL; var->u.s.info = indexupvalue(fs, n, var); /* else was LOCAL or UPVAL */ var->k = VUPVAL; /* upvalue in this level */ @@ -578,6 +578,7 @@ FuncState new_fs; open_func(ls, &new_fs); new_fs.f->linedefined = line; + new_fs.namelid = testnext(ls, '#'); checknext(ls, '('); if (needself) { new_localvarliteral(ls, "self", 0); diff -BubNrd lua-5.1.4/src/lparser.h lua-5.1.4-namelid/src/lparser.h --- lua-5.1.4/src/lparser.h 2007-12-27 15:02:25.000000000 +0200 +++ lua-5.1.4-namelid/src/lparser.h 2009-09-30 16:12:02.000000000 +0300 @@ -70,6 +70,7 @@ int np; /* number of elements in `p' */ short nlocvars; /* number of elements in `locvars' */ lu_byte nactvar; /* number of active local variables */ + lu_byte namelid; /* name lookup cannot proceed above this function */ upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ } FuncState; From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 11:41:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UEeqiq003839; Wed, 30 Sep 2009 11:40:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02EE6190B5; Wed, 30 Sep 2009 11:40:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth02.prod.mesa1.secureserver.net (smtpauth02.prod.mesa1.secureserver.net [64.202.165.182]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6591D19092 for ; Wed, 30 Sep 2009 11:39:59 -0300 (BRT) Received: (qmail 11899 invoked from network); 30 Sep 2009 14:40:05 -0000 Received: from unknown (98.117.140.83) by smtpauth02.prod.mesa1.secureserver.net (64.202.165.182) with ESMTP; 30 Sep 2009 14:40:05 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: luaproc thought From: Mark Hamburg In-Reply-To: <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> Date: Wed, 30 Sep 2009 07:40:03 -0700 Content-Transfer-Encoding: 7bit Message-Id: <7306A7F6-61BE-4CEB-9F10-2B8ED335BD34@grubmah.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean There are already have ways to detect global variable accesses at compile time, so the chunk construct gets you both syntax checking and inadvertent upvalue detection (since the upvalues turn into globals). We use the runtime absence of upvalue checks in Lightroom, but the point was to have a construct that could generate warnings at compile time. The notion of simply having an option to turn off upvalues is intriguing. Mark From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 11:43:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UEhXwY004475; Wed, 30 Sep 2009 11:43:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 656AC1A693; Wed, 30 Sep 2009 11:42:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1D201A682 for ; Wed, 30 Sep 2009 11:42:47 -0300 (BRT) Received: by bwz10 with SMTP id 10so5311736bwz.5 for ; Wed, 30 Sep 2009 07:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=BfA434bgPJ2BFlfdI1gD7DfTjExSVa9gMI9ArmmUnuc=; b=F9l7Rp6VlTAiO+7jXrXFQ2caYFCql9GSO1AfjI0yjzbu5WybqNRRa3MNQ2iVUeTTuw lGThMK41U7GEs7jUPyKDlLlmQ8Z4IAVgX8Gc4zQTi0mALBluC4wwMeUzMzi/VAfOO/ro G83DLXkxHlVPVT32G87jqkbgGq3ahHBMBcCpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Al9M2F1mmcUaWgE52WgZkJ+TkrwuE/vT0/qL53GREBxwvemkmxJvHzYp/dVkHboSIP pHJW1Io9M7P1Japi6ZnuXzOnfFztb1Haq/yfOkl0riZJV/xqO0psjPivLASvm6gq2rQK cppzDTGQLVhqDcE+d0bVF0G10cxyJqUPnp6xk= MIME-Version: 1.0 Received: by 10.103.125.28 with SMTP id c28mr2244063mun.64.1254321778524; Wed, 30 Sep 2009 07:42:58 -0700 (PDT) In-Reply-To: <4AC33713.50203@cowlark.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <4AC33713.50203@cowlark.com> Date: Wed, 30 Sep 2009 16:42:58 +0200 X-Google-Sender-Auth: 07b1dc0a76f47bb1 Message-ID: <956373d40909300742s5b7b2dbfm51e5784899f80fa@mail.gmail.com> Subject: Re: luaproc thought From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=0016363ba4b60b045f0474cc8c31 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016363ba4b60b045f0474cc8c31 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 30, 2009 at 12:46 PM, David Given wrote: > This sounds like perfect fodder for something like metalua. -- The extension itself: -- -{ block: mlp.lexer:add "chunk" mlp.expr:add{ "chunk", mlp.block, "end", builder = |x|`String {mlc.ast_to_luacstring(x[1])} } } -- simple test case: -- local ch = chunk return 123 end assert (ch :match "^\027Lua") assert (dostring(ch) == 123) print "Test passed" --0016363ba4b60b045f0474cc8c31 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 30, 2009 at 12:46 PM, David Given <dg@cowlark.com> wrote:
-- The extension = itself: --
-{ block:
=A0=A0 mlp.lexer:add &q= uot;chunk"
=A0=A0 mlp.expr:add{ "= ;chunk", mlp.block, "end",
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 builder =3D |x|`String {mlc.ast_to_luacstring(x= [1])} } }

-- simple test case: --=
local ch =3D chunk return 123 end<= br style=3D"font-family: courier new,monospace;"> assert (ch :match "= ;^\027Lua")
assert (dostring(ch) =3D= =3D 123)
print=A0 "Test pas= sed"
--0016363ba4b60b045f0474cc8c31-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 11:52:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UEqHTU006413; Wed, 30 Sep 2009 11:52:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AD0A191E8; Wed, 30 Sep 2009 11:51:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BA5C185C5 for ; Wed, 30 Sep 2009 11:51:34 -0300 (BRT) Received: by fxm12 with SMTP id 12so6094019fxm.5 for ; Wed, 30 Sep 2009 07:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=EerM3xqMVi74stwnLzwufePZLupaNg5vyfd2+VP+8j8=; b=pIJ8L0ygPSK0A2d6xyYHLrNNAvtORc0i1iH3jeBF2LduVMibE02CYQK0GZw3qZwTlu jA37zavLqpIrD1xVXdKUV9x0Wy0gMDVwiaHaRQI0Zq+vFqlneuB0+pnnpsxOvEOKxYAN bECsKdo+2s9ICYKAfeKRETgVlIN6Z29/3DVtY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Lv5FXGneIxB8bXofs7XLE9JSojbsebTD8QJlG+Igxl7xEwQzy+o7lZiGPqA/BbqAdk k1L0v9KSH6zXo+OVF9LjpXR0u4FeT+vRBFZNi+3G4WKvZZHfg5g+oeRZN6LXwQV65NQo PbnG46CvSPyUDrofVGhX/EY+Aka1/EYe8qtNo= MIME-Version: 1.0 Received: by 10.102.235.5 with SMTP id i5mr2292109muh.36.1254322305344; Wed, 30 Sep 2009 07:51:45 -0700 (PDT) In-Reply-To: <7306A7F6-61BE-4CEB-9F10-2B8ED335BD34@grubmah.com> References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <89d273ba0909300521ye830a4j6e034e59152827b1@mail.gmail.com> <7306A7F6-61BE-4CEB-9F10-2B8ED335BD34@grubmah.com> Date: Wed, 30 Sep 2009 16:51:45 +0200 X-Google-Sender-Auth: c1de8a900a1dd57d Message-ID: <956373d40909300751sc953529n18fed17f87548325@mail.gmail.com> Subject: Re: luaproc thought From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=00163642668171a34f0474ccab61 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163642668171a34f0474ccab61 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 30, 2009 at 4:40 PM, Mark Hamburg wrote: > There are already have ways to detect global variable accesses at compile > time Notice that current tools won't help you here:your chunk is embedded as a bytecode string (or maybe a source string), and therefore contains no variable, global or local. You could probably modify an existing tool to recursively check strings constants starting with "\027Lua", though. --00163642668171a34f0474ccab61 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 30, 2009 at 4:40 PM, Mark Hamburg <mark@grubmah.com> wrote:
There are already have ways to detect global variable accesses at compile t= ime

Notice that current tools won't help you here:= your chunk is embedded as a bytecode string (or maybe a source string), and= therefore contains no variable, global or local. You could probably modify= an existing tool to recursively check strings constants starting with &quo= t;\027Lua", though.
--00163642668171a34f0474ccab61-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 12:04:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UF4Hpg009083; Wed, 30 Sep 2009 12:04:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B948B1A6A5; Wed, 30 Sep 2009 12:03:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 338021A682 for ; Wed, 30 Sep 2009 12:03:34 -0300 (BRT) Received: (qmail 11245 invoked by uid 399); 30 Sep 2009 09:03:44 -0600 Received: from unknown (HELO ?192.168.1.2?) (jjensen@workspacewhiz.com@70.192.249.31) by hsmail.qwknetllc.com with ESMTPAM; 30 Sep 2009 09:03:44 -0600 X-Originating-IP: 70.192.249.31 Message-ID: <4AC3734C.4010101@workspacewhiz.com> Date: Wed, 30 Sep 2009 09:03:40 -0600 From: Joshua Jensen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: luaproc thought References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> In-Reply-To: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Mark Hamburg Date: 9/29/2009 5:40 PM > But imagine a chunk keyword (anathema I know to add a keyword, but > imagine it none the less). This keyword basically works just like > "function" but it returns the bytecode for the chunk and does not > capture upvalues. Now we write: I've been using Lua Lanes with great success, and it appears it handles upvalues properly. Short of luaproc's scheduler, does anyone know what advantages luaproc has over Lua Lanes? Josh From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 12:58:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UFvwij020152; Wed, 30 Sep 2009 12:57:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA3AC187A1; Wed, 30 Sep 2009 12:57:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-04.prod.phx3.secureserver.net (p3plsmtpa01-04.prod.phx3.secureserver.net [72.167.82.84]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1269F18742 for ; Wed, 30 Sep 2009 12:57:00 -0300 (BRT) Received: (qmail 17915 invoked from network); 30 Sep 2009 15:57:04 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-04.prod.phx3.secureserver.net (72.167.82.84) with ESMTP; 30 Sep 2009 15:57:03 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?) From: Mark Hamburg In-Reply-To: <4AC32A15.50908@gmail.com> Date: Wed, 30 Sep 2009 08:57:01 -0700 Content-Transfer-Encoding: 7bit Message-Id: <7D232920-FB06-429B-BEBF-DAAD05010E30@grubmah.com> References: <4AC32A15.50908@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean See the Scala discussion in http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html Note that Yegge is deliberately being provocative. Mark From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 13:37:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UGb1EE027899; Wed, 30 Sep 2009 13:37:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 144111928D; Wed, 30 Sep 2009 13:36:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (davinci.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B0761924D for ; Wed, 30 Sep 2009 13:36:06 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n8UGaBi5028651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 30 Sep 2009 13:36:14 -0300 (UYT) Subject: Tracking number of pairs in a dictionary From: Jorge To: Lua list Content-Type: text/plain Date: Wed, 30 Sep 2009 13:36:13 -0300 Message-Id: <1254328573.21568.13.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Wed, 30 Sep 2009 13:36:14 -0300 (UYT) X-Spam-Score: -0.368 () AWL,BAYES_50,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi to all. I have the following scenario, a pretty usual one i suppose, and was wondering for the cleanest solution. I have a dictionary, keyed by strings and value-d with pretty involved tables. I will iterate all the entries frequently (so no proxying tables) and in addition i want to enforce a maximum number of entries. The pseudo pseudo code goes something like "if there's space in the table add the entry, else search for one entry to be replaced". So i would like to have a way for knowing how many entries are already in the dictionary without having to iterate everything. The best idea i have is pretty ad-hoc, to lazily count the entries in some iteration i already have to perform (i have certain latitude with numbers). Thanks in advance, Jorge From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 14:04:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UH4250001871; Wed, 30 Sep 2009 14:04:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 294A71A67A; Wed, 30 Sep 2009 14:03:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63E3B1A661 for ; Wed, 30 Sep 2009 14:03:15 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1335409eye.39 for ; Wed, 30 Sep 2009 10:03:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.173.11 with SMTP id a11mr27913ebp.42.1254330206745; Wed, 30 Sep 2009 10:03:26 -0700 (PDT) In-Reply-To: <1254328573.21568.13.camel@matroskin> References: <1254328573.21568.13.camel@matroskin> Date: Wed, 30 Sep 2009 12:03:26 -0500 Message-ID: <90eb1dc70909301003u8475cf2m74ae097b4b2a0667@mail.gmail.com> Subject: Re: Tracking number of pairs in a dictionary From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 11:36 AM, Jorge wrote: > > The pseudo pseudo code goes something like "if there's space in the > table add the entry, else search for one entry to be replaced". any reason why you can't just use a weak table and let the garbage collector deal with it? -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 14:50:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UHoTOu013128; Wed, 30 Sep 2009 14:50:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56B4A1A69F; Wed, 30 Sep 2009 14:49:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (smtp.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4BF8D1A661 for ; Wed, 30 Sep 2009 14:49:24 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n8UHnQUF005067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 30 Sep 2009 14:49:28 -0300 (UYT) Subject: Re: Tracking number of pairs in a dictionary From: Jorge To: Lua list In-Reply-To: <90eb1dc70909301003u8475cf2m74ae097b4b2a0667@mail.gmail.com> References: <1254328573.21568.13.camel@matroskin> <90eb1dc70909301003u8475cf2m74ae097b4b2a0667@mail.gmail.com> Content-Type: text/plain Date: Wed, 30 Sep 2009 14:49:28 -0300 Message-Id: <1254332968.21568.34.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Wed, 30 Sep 2009 14:49:28 -0300 (UYT) X-Spam-Score: -0.362 () AWL,BAYES_50,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 2009-09-30 at 12:03 -0500, Javier Guerra wrote: > On Wed, Sep 30, 2009 at 11:36 AM, Jorge wrote: > > > > The pseudo pseudo code goes something like "if there's space in the > > table add the entry, else search for one entry to be replaced". > > any reason why you can't just use a weak table and let the garbage > collector deal with it? This dictionary is the structure that actually holds my data, which isn't available anywhere else. I thought of having two tables pointing to the same data, an array and a weak dictionary, but it looks a bit cumbersome. Jorge From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 15:25:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UIPiN0024474; Wed, 30 Sep 2009 15:25:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB636186A1; Wed, 30 Sep 2009 15:24:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F408B185F9 for ; Wed, 30 Sep 2009 15:24:49 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1365246fgg.17 for ; Wed, 30 Sep 2009 11:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=zizQxKybMRwIB1t2aqtzZtIZ6agBrM7xM3GaRkTHv+8=; b=EWwKIy3/e/r7Qbxr7Q4gOK5UYZunU17J4RvXI9sz9BZRNDQLAGmpUwQD1oWKdP/Iju x9pHX3GaCERT7fnaxQwxDXxR2HMeunzSTKHpE9BysyiZAE9/ALZib8G4vuit3xmRXAHG kgumdBWB5fsPD3vpsSvdK9GdOk84Yh9XfcBW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=rd/mNwd7VC8jGgvNTdtxy3fcgBm1sh6gYrrhMEH+zqzD/FvrLvZ+zcpxQzgfVDNwli peMuh2lDZHuciRKjkhVFqb8EctjGGY+2KPSgJrv5/Ghr52msKONvOyF5zwPUYsyaYeSo hwd15E0sn/qS/7TEA4+HdSw+pi0WrH8aijrfA= Received: by 10.86.226.5 with SMTP id y5mr270651fgg.36.1254335100026; Wed, 30 Sep 2009 11:25:00 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id e20sm69797fga.10.2009.09.30.11.24.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Sep 2009 11:24:59 -0700 (PDT) Message-Id: <1F185070-5D56-4012-AD55-C3342EC85AAA@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: luaproc thought Date: Wed, 30 Sep 2009 20:24:27 +0200 References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 30, 2009, at 2:27 AM, Mark Hamburg wrote: > That requires storing the code for the chunk in a separate file > which is fine for complex processes but is a pain for lightweight > processes. It doesn't necessarily have to be a file, a table of code snippets would do just fine. The crux of it being not to mix code and strings which happen to represent code. No need to change the entire language for that. A bit of organization would usually suffice. For example, instead of writing 'foreign' code directly inline as a string, one could simply refer to it, e.g: aDB( ' select name,extract from hit order by name limit %s', ... ) vs. aDB( DML[ 'SelectHit' ], ... ) http://dev.alt.textdrive.com/browser/HTTP/Finder.dml#L100 Alternatively, in the specific case of luaproc, what about using an a serialized function? Assuming that luaproc.newproc is implemented in terms of loadstring, one could string.dump a function and pass it to luaproc.newproc, e.g.: luaproc.newproc( string.dump( function() msg = luaproc.receive( "achannel" ) print( msg ) end ) ) From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 15:42:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UIgS5X029042; Wed, 30 Sep 2009 15:42:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D5951903D; Wed, 30 Sep 2009 15:41:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E76CF18FDF for ; Wed, 30 Sep 2009 15:41:44 -0300 (BRT) Received: by vws15 with SMTP id 15so669235vws.5 for ; Wed, 30 Sep 2009 11:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Se4HcinRomabcrgxWQfGVSt9m4CHhG6jD6miAWdoFV4=; b=F4WWnKDIE7D9fd0aoqJeP/YO7QqcaCM0dbiCLt0yvYX4aDpWIP3fL8loMTbsf86X5K U9j07QH4VFlXgKycCG579uja2ALQag2UorWj3zLQyPegLjf51sUWRE70s80UjJyN/pgW fdbjC3chi8EY0vSfzQeJBqBcmZKCgtQwssAC4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=emySoZ3b5OvbNlGzaUamQR+JG5hZ0q/2rZokWGH3cf7lk10W7vhAYYnTLwI5+bcEmM hzrrzv8zCrfDJLmxHfA1JL4UMvfuHvqeOxaz3uCLNha3OVRKoMFH/P84jcjbicLRNsTE VNPLrD/D/eGLT6xiFLM1Hnr/2A0pGRaodOBiQ= MIME-Version: 1.0 Received: by 10.220.89.93 with SMTP id d29mr292178vcm.26.1254336116602; Wed, 30 Sep 2009 11:41:56 -0700 (PDT) Date: Wed, 30 Sep 2009 15:41:56 -0300 X-Google-Sender-Auth: 5503d9b1c9ffa6e4 Message-ID: <92ab989c0909301141g50824f0ej655378673eead90b@mail.gmail.com> Subject: LuaForge maintenance From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8UIgS5X029042 Hi, LuaForge will be offline for a few hours later today (from 7PM GMT-3) due to services on our ISP, the servers will be up but not the internet connection. This will affect not only all LuaForge services but also LuaRocks and the Kepler site. If anything does not work after the connection is reestablished please let me know. André From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 16:02:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UJ2IVu000818; Wed, 30 Sep 2009 16:02:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B7B51A67E; Wed, 30 Sep 2009 16:01:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABCAA1A5DE for ; Wed, 30 Sep 2009 16:01:30 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQS00A1YSTV0B10@asmtp014.mac.com> for lua@bazar2.conectiva.com.br; Wed, 30 Sep 2009 12:01:39 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <1F185070-5D56-4012-AD55-C3342EC85AAA@gmail.com> Subject: Re: luaproc thought Date: Wed, 30 Sep 2009 21:01:07 +0200 References: <3F3657F5-3804-4317-9766-47259337A1F2@grubmah.com> <1F185070-5D56-4012-AD55-C3342EC85AAA@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sep 30, 2009, at 8:24 PM, Petite Abeille wrote: > Alternatively, in the specific case of luaproc, what about using an > a serialized function? Duh. That's what you wrote in the first place. Oh, well :) From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 17:10:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UK9wDH018150; Wed, 30 Sep 2009 17:10:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82253188C8; Wed, 30 Sep 2009 17:09:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F24A18890 for ; Wed, 30 Sep 2009 17:09:02 -0300 (BRT) Received: by bwz10 with SMTP id 10so5585241bwz.5 for ; Wed, 30 Sep 2009 13:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8o7IvvWBO3PW7wYKILhzYVRnS9xCEK3NJS3Gd9zazB4=; b=oNsdy0vQyBSCOqB65Nho+gd2zqWBc7sH7bQAUQbzJB2w1vrQlzdTLXWQ8XiFiKP6RU o76KTpMf4bp3zXWSU9FzPOupVJKmakuSYLrYJ2k05Ubd2/H7f5kg5T1rUrfGX9oCEDwK L7MnPUm6CmRjB2zUs8eNKNslJAyNrOjWPcnJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Nq4500BRUNS6YgTHhuZWr79avIF7w2E055tw9AUOFEs0CYPotIdSAiTOOV5BSzNU+K yKlb6BmoJUg+FIQ+SOLIQR8CbDEGT//Iu1ZXrC0sdCjMGX5SydGrchW/LBtoebT557KP XMAjL9chy0KRafvc70hK316YyXepeiNdnbJa4= MIME-Version: 1.0 Received: by 10.204.152.204 with SMTP id h12mr193945bkw.97.1254341354727; Wed, 30 Sep 2009 13:09:14 -0700 (PDT) Date: Wed, 30 Sep 2009 22:09:14 +0200 Message-ID: <4ff79edb0909301309k5a4105eegfbb12b8a80a81d0e@mail.gmail.com> Subject: Re: GSL Shell software announcement From: Francesco Abbate To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0015175cac9ce02b130474d11a6b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cac9ce02b130474d11a6b Content-Type: text/plain; charset=ISO-8859-1 Hi all, thank you for your remarks, Steve. I've made a lot of work to bring GSL Shell to the current level but I was strongly motivated because I think that Lua offers a wonderful opportunity to bring an interactive, easy to use interface on top of GSL. Also, the more I'm using Lua, the more I feel that I've made a good choice by choosing this language. It is really amazing how a small language like Lua can be powerful and elegant. I'm also pleased to observe how the language and the implementation is well designed to bring a maximum in productivity with a minimum of costs. Talking about the graphical interface to plot function, yes it is definitely the missing feature. I'm planning to implement it but I'm lacking cruelly of time. My hope is that by publishing GSL shell in the web someone will be motivated to help me in this project. Thank you very much for your comments. Best regards, Francesco > On Wed, Sep 30, 2009 at 10:48 AM, Francesco Abbate > wrote: > > I'm proud to?announce?the first developer release of GSL Shell, an > > interactive interface that gives access to the GNU Scientific Library > (GSL). > > Very cool! Definitely a good use of Lua. > > What would be extra cool is some integration with GnuPlot, so one can > have a look at generated curves, inspect data. E.g. if you were doing > non-linear curve fitting. > > > GSL Shell is based on the LUA scripting language gives you all the > > flexibility and richness of the LUA programming language. > > It's Lua, not LUA; not an acronym, but a word meaning Moon. (Besides, > LUA as an acronym has some Windows meaning) This may be pedantic but > it really does look better as a word ;) > > steve d. > --0015175cac9ce02b130474d11a6b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all,

thank you = for your remarks, Steve. I've made a lot of work to bring GSL Shell to = the current level but I was strongly motivated because I think that Lua off= ers a=A0wonderful=A0opportunity to bring an interactive, easy to use interf= ace on top of GSL.

Also, the more I'm using Lua, the more I feel that = I've made a good choice by choosing this language. It is really amazing= how a small language like Lua can be powerful and elegant. I'm also pl= eased to observe how the language and the implementation is well designed t= o bring a maximum in productivity with a minimum of costs.

Talking about the graphical interface to plot function,= yes it is=A0definitely=A0the missing feature. I'm planning to implemen= t it but I'm lacking cruelly of time. My hope is that by publishing GSL= shell in the web someone will be motivated to help me in this project.

Thank you very much for your comments.

Best regards,
Francesco
=A0
On Wed, Sep 30, 2009 at 10:48 AM, Francesco Abbate
<francesco.bbt@gmail.com&= gt; wrote:
> I'm proud to?announce?the first developer release of GSL Shell, an=
> interactive interface that gives access to the GNU Scientific Library = (GSL).

Very cool! =A0Definitely a good use of Lua.

What would be extra cool is some integration with GnuPlot, so one can
have a look at generated curves, inspect data. =A0E.g. if you were doing non-linear curve fitting.

> GSL Shell is based on the LUA scripting language gives you all the
> flexibility and richness of the LUA programming language.

It's Lua, not LUA; not an acronym, but a word meaning Moon. =A0(Besides= ,
LUA as an acronym has some Windows meaning) =A0This may be pedantic but
it really does look better as a word ;)

steve d.
--0015175cac9ce02b130474d11a6b-- From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 18:35:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8ULZSbe003789; Wed, 30 Sep 2009 18:35:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E9DF1A6B4; Wed, 30 Sep 2009 18:34:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48E961A67C for ; Wed, 30 Sep 2009 18:34:39 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 26966 invoked from network); 30 Sep 2009 23:34:47 +0200 Received: from miko.ras.wp-sa.pl (HELO [192.168.254.110]) (miko@[212.77.97.9]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 30 Sep 2009 23:34:47 +0200 Message-ID: <4AC3CEF6.7060107@wp.pl> Date: Wed, 30 Sep 2009 23:34:46 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.22 (X11/20090719) MIME-Version: 1.0 To: Lua list Subject: Re: Tracking number of pairs in a dictionary References: <1254328573.21568.13.camel@matroskin> In-Reply-To: <1254328573.21568.13.camel@matroskin> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [0VPE] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jorge wrote: [...] > So i would like to have a way for knowing how many entries are already > in the dictionary without having to iterate everything. > > The best idea i have is pretty ad-hoc, to lazily count the entries in > some iteration i already have to perform (i have certain latitude with > numbers). Or you could keep a counter within the table (so you will not iterate the table at all). Here is an example implementation (you can overide removeOne() to what you need): MT={ add=function(self, key, value) if not rawget(self, key) then if self._n>=self._limit then self:removeOne() end self._n=self._n+1 end rawset(self, key, value) end, removeOne=function(self) self[next(self)]=nil self._n=self._n-1 print('Removed entry') end, del=function(self, key) if rawget(self, key) and self._n>0 then self._n=self._n-1 end rawset(self, key, nil) end } MT.__index=MT LimitedTable={ new=function(limit) return setmetatable({_n=0, _limit=limit}, MT) end, } T=LimitedTable.new(2) T:add('one',{}) T:add('two',{}) T:add('three',{}) Regards, miko From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 20:12:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UNBu24018289; Wed, 30 Sep 2009 20:11:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B03A51A67E; Wed, 30 Sep 2009 20:11:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB59B1A5DE for ; Wed, 30 Sep 2009 20:11:07 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4BAGOCw0p8qfG6/2dsb2JhbAAI13CEJwSCIw X-IronPort-AV: E=Sophos;i="4.44,482,1249228800"; d="scan'208";a="567076320" Received: from unknown (HELO [10.1.1.2]) ([124.169.241.186]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 01 Oct 2009 07:11:12 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) From: Jacques Chester In-Reply-To: <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> Date: Thu, 1 Oct 2009 07:11:11 +0800 Content-Transfer-Encoding: 7bit Message-Id: <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 30/09/2009, at 12:28 AM, Petite Abeille wrote: > And nginx is even faster, simpler, leaner, meaner than lighttpd :) So the cool Ruby kids say! Personally Lighty has been a winner for the sites I manage. I also like that you can embed Lua scripts in the server. > I do realize that this argument is going against nearly 15 years of > Common Gateway Interface indoctrination :D I've argued similar things before in other forums (that apps in future might embed their own HTTP handling). But I didn't see it being a case of using a pure Lua, pure Ruby, pure Python etc solution. Rather I expected folk would settle on some fast, easily wrapped C library. One that looks nice is Libebb[1]. But as I pointed out, (F|S)CGI isn't a performance tool. Its purpose is to abstract the web server away from the application. For a lot of people, that matters. I am happy in this case to agree to (partly) disagree. Cheers, JC. [1] http://tinyclouds.org/libebb/ From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 20:37:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UNbpsa022585; Wed, 30 Sep 2009 20:37:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E8DB1A6B9; Wed, 30 Sep 2009 20:37:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC62D1A6AA for ; Wed, 30 Sep 2009 20:37:09 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UNbL0t022544 for ; Wed, 30 Sep 2009 20:37:21 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n8UNbKd18401; Wed, 30 Sep 2009 20:37:20 -0300 Date: Wed, 30 Sep 2009 20:37:19 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) Message-ID: <20090930203719.A18371@lua.tecgraf.puc-rio.br> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au>; from jacques@chester.id.au on Thu, Oct 01, 2009 at 07:11:11AM +0800 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Rather I expected folk would settle on some fast, easily wrapped C library. > One that looks nice is Libebb[1]. See http://lists.luaforge.net/pipermail/kepler-project/2008-October/003004.html From lua-bounces@bazar2.conectiva.com.br Wed Sep 30 20:48:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n8UNmeld023920; Wed, 30 Sep 2009 20:48:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F1CE18782; Wed, 30 Sep 2009 20:48:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (unknown [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9100B1873F for ; Wed, 30 Sep 2009 20:47:54 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mt8tt-0001rx-SN for lua@bazar2.conectiva.com.br; Thu, 01 Oct 2009 00:48:02 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id D70FA1E07E for ; Thu, 1 Oct 2009 00:47:59 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:29367 with envelope Message-ID: <4AC3EDFE.4070802@cowlark.com> Date: Thu, 01 Oct 2009 00:47:10 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua for large apps References: <4AC2F9EB.1050807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n8UNmeld023920 Alexander Gladysh wrote: [...] > At first it was quite hard to write code in Lua — without compile time > validation, without static types, it felt as if I try to stand on a > blob of wobbly jelly instead of a good solid rock. I like dynamic languages. I also like static languages. They're good at different things --- some problems that are hard in static languages are very easy in dynamic languages, while some problems that are hard in dynamic languages are very easy in static languages. So I was fascinated to discover this recently: http://www.strongtalk.org/ It's a Smalltalk with optional strong typing. What this means is that if you want it to behave like a dynamic language with duck typing ('if it quacks like a duck, let's just assume it is one'), you can --- and if you want strong typing ('only DNA checked ducks are allowed in the bulding') you can. You can write code like: | o | o := self getSomeObjectOfUnknownType. o callMethodOnObject ...and it will work, regardless of what class o is. OTOH, if you know in advance that o is going to conform to a particular interface, you can say: | o | o := self getSomeObjectOfUnknownType. o callMethodOnObject ...and now the compiler will produce an error if callMethodOnObject isn't applicable to a MyInterface object, or if getSomeObjectOfUnknownType returns an object of an incompatible type. Here's an introduction to how the type system works: http://www.bracha.org/nwst.html The type system is rich and supports things like parameterised types. For example, there's a Smalltalk method collect: which runs a callback for every item in a Collection and produces a new Collection of the values the callback returns. In Strongtalk this is typed like this: collect: <[T, ^X]> ^ That is, the first parameter to the method is a block (callback) that takes as argument an object of type T and returns an object of type X; the result of the method is a Collection of X. Since a string is a Collection, I can do: 'abcde' collect: [ :c | c asciiValue ] ...which returns a Collection. Or I can do: 'abcde' collect: [ :c | (c asciiValue + 1) toCharacter ] ...which returns a Collection (which, if I remember my Smalltalk correctly, is equivalent to a String). And of course you get to use all of Smalltalk's excellent dynamic features. The type system is orthogonal to the actual implementations of the methods. In Smalltalk it's trivial to create proxy objects, for example, where I can intercept any method send in code and do what I like with them. So I can, for example, create a proxy object that is an implementation of MyInterface that actually does RPC calls to a remote MyInterface, and it's a drop-in replacement without needing any of the factory framework that, say, Java needs. Not to mention all of Smalltalk's traditional incremental development goodness. But since the type system is *optional*, you don't have to worry about it if you don't want to. The compiler will seamlessly integrate untyped code into typed code. If you like, you can write an untyped library and bolt on a trivial typed API definition and your users will get type checking... or if you don't want to, it'll still work. And if that's not enough, Strongtalk has a truly excellent JIT, producing some of the fastest code ever seen in a Smalltalk; most of the Strongtalk team went on to make V8, of which I'm sure you've heard! Alas, Strongtalk is largely unknown because it was stalled in legal hell for a long time, and was only recently open sourced. But it's now all available under a BSD license, both the VM and the class library. Alas, because development has been so slow it's decidedly Old School and mostly only works on ix86 Win32. There is some support for Linux, and I believe you can run the VM headless on it, but if you're not an ix86 user I suspect you're out of luck. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 03:14:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n916DwYJ029554; Thu, 1 Oct 2009 03:13:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D6521A677; Thu, 1 Oct 2009 03:13:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02A8418537 for ; Thu, 1 Oct 2009 03:13:07 -0300 (BRT) Received: by bwz10 with SMTP id 10so5849432bwz.5 for ; Wed, 30 Sep 2009 23:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rta72hqF4RcIAk7UojoIAva6XHVkIV3g4NDOwwVFVqc=; b=GGzftY4XYslM+CRDYJpulDMvlZmFDm6t0v4q0/citCSPgA7W46YRozF1ynalKp4svZ NR/ucwUwePrs/Qty8Jfs0qEFTYQXzBt4JalJ5oyAJ9GMFDqcGVqQWoB3/ukjh3ir2fxY vPNV+SGpY15CKVHSgLnFj74fdLj49VQVLmm/0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kASPXqHH8zavLK/MMV0Zi6zYnKJumcJSbsi6TBU2FlAi1ZPe/E5PlvbeyDhXLHKXv3 FyUBIHImgUPiVE131B+G1ZnK2dyPsHO2jldCIyoP8tx9JOqXxx7js86bsO+csZxLEr5T eQ6aHK8zxi6rubD14eqOeqJzSddGH6qEa1JEM= MIME-Version: 1.0 Received: by 10.239.184.168 with SMTP id y40mr71956hbg.194.1254377599020; Wed, 30 Sep 2009 23:13:19 -0700 (PDT) In-Reply-To: <4ff79edb0909301309k5a4105eegfbb12b8a80a81d0e@mail.gmail.com> References: <4ff79edb0909301309k5a4105eegfbb12b8a80a81d0e@mail.gmail.com> Date: Thu, 1 Oct 2009 08:13:19 +0200 Message-ID: <560972290909302313n2bb88cb1xcf49c2b97e71e3b5@mail.gmail.com> Subject: Re: GSL Shell software announcement From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> On Wed, Sep 30, 2009 at 10:48 AM, Francesco Abbate > Talking about the graphical interface to plot function, yes it > is definitely the missing feature. I'm planning to implement it but I'm > lacking cruelly of time. My hope is that by publishing GSL shell in the web > someone will be motivated to help me in this project. It does not have to be complicated, nor does it require a full GUI shell. For instance, here's a pure Lua wrapper for GnuPlot: http://luaforge.net/projects/gnuplot/ (I believe there are others, with various levels of abstraction) So the point is that you would hardly have to write any code, and definitely won't have to write any C ! 'lacking cruelly of time' is unfortunately so true for all of us! steve d. From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 13:10:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91GAZGe022052; Thu, 1 Oct 2009 13:10:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70DE3192F2; Thu, 1 Oct 2009 13:09:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (smtp.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37416191F0 for ; Thu, 1 Oct 2009 13:09:27 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n91G9TBs023513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 1 Oct 2009 13:09:33 -0300 (UYT) Subject: Re: Tracking number of pairs in a dictionary From: Jorge To: Lua list In-Reply-To: <4AC3CEF6.7060107@wp.pl> References: <1254328573.21568.13.camel@matroskin> <4AC3CEF6.7060107@wp.pl> Content-Type: text/plain Date: Thu, 01 Oct 2009 13:09:28 -0300 Message-Id: <1254413368.21568.75.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Thu, 01 Oct 2009 13:09:33 -0300 (UYT) X-Spam-Score: -0.728 () AWL,BAYES_20,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 2009-09-30 at 23:34 +0200, Michal Kolodziejczyk wrote: > Or you could keep a counter within the table (so you will not iterate > the table at all). Here is an example implementation (you can overide > removeOne() to what you need): > > MT={ > add=function(self, key, value) Wow... Never seen metatables used like that. Had to look it twice to get why it works :) Is there a way for keeping _n and _limit out of the table? With some upvalue magic or something? Otherwise you have to explicitly skip them while iterating (as the RemoveOne as is does not :) ) Jorge From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 13:23:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91GNUPu024629; Thu, 1 Oct 2009 13:23:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F40321934F; Thu, 1 Oct 2009 13:22:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f199.google.com (mail-qy0-f199.google.com [209.85.221.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42483192FD for ; Thu, 1 Oct 2009 13:22:41 -0300 (BRT) Received: by qyk37 with SMTP id 37so232874qyk.11 for ; Thu, 01 Oct 2009 09:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=v17hccPv6SLGR19Mcn7HtrWophXxKOdTXQr6Em69QIU=; b=Wxo5KYXlqwWPeu5CBWo6j8b7wyj3XzP8NTipmozJlcdicFheu+p5qNdYoOExmuGbA7 m9YvfP1etJ7MhcNVYLHJnjg7hSA8x63kNN0nzpVcqRru/GloIcq3TVpaMZT/oTAb3/Qc Z5sdQz0+WQFPw5ONLtLI+3e+OgX0cKre7IHMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=tSqCJWN3xqnRuyLFLEXjHBLBP14ewVU8EHQC78iuDm84fUtYOVn/Bg0B8zCU0lK9rc L0kef6TrcXmS4TDcxJ2xoOn1hJPyAj9IpZCbO49ywWFDzExgMSZXTT1C43WOV0Kqp6+Y EOI8C2u+aErXfirzasEzo/2lCvemxrJoR1S98= MIME-Version: 1.0 Received: by 10.229.116.140 with SMTP id m12mr1810982qcq.54.1254414173916; Thu, 01 Oct 2009 09:22:53 -0700 (PDT) In-Reply-To: <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> Date: Thu, 1 Oct 2009 13:22:53 -0300 X-Google-Sender-Auth: 532c4f713b20a84b Message-ID: <7913df4d0910010922m50d86743k2153c4173011b2db@mail.gmail.com> Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Sep 30, 2009 at 8:11 PM, Jacques Chester wrote: > I've argued similar things before in other forums (that > apps in future might embed their own HTTP handling). But > I didn't see it being a case of using a pure Lua, pure > Ruby, pure Python etc solution. Rather I expected folk > would settle on some fast, easily wrapped C library. > One that looks nice is Libebb[1]. Libevent, used in memcached, also provides an HTTP library that looks pretty easy to bind to Lua. But for both libevent and libebb you also have to put some kind of load balancer in front to distribute the requests among your cores, as these event-based HTTP libraries are single-threaded. Lighty+FCGI is fast enough in practice, though. There was a thread at the Kepler list a few months ago with benchmarks (startup times only) of Lighty+FCGI+WSAPI vs Lighty+FCGI+PHP: http://lists.luaforge.net/pipermail/kepler-project/2009-June/003412.html -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 13:28:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91GSj0I025503; Thu, 1 Oct 2009 13:28:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 930D91935D; Thu, 1 Oct 2009 13:28:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 354ED19356 for ; Thu, 1 Oct 2009 13:27:58 -0300 (BRT) Received: by fxm12 with SMTP id 12so347062fxm.5 for ; Thu, 01 Oct 2009 09:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Jn6bNfq//aPZLR2W8oBDSdNF+E5lb8qypnbJx5cJcWI=; b=qF+5dOL/h2qFuAOk+p1CiVo0G5D4QDypOtljWV6R2uT2Lhu2lKmq8BwHszmPMzt5mr YwcqYJoTwG7KlEW+AOI2qLhXU1ADKIXwh3MVzWN0SliaXyfHNrjQorKXx67wEV9q1urB MvP2jyUFeMqzfxr8ONi1H70mZhh4u5CMFPzDk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=u6vrmcxjxiho7tjmSRMmwR2H8EcS1gV32GWugsN941woo32/+IDB8ryLKJtgIXblHc o5O0CTmPhTuikSYWFldl6VxCh5zb3tJt3y7tdYb8efsuKXJBSrJVoH8SwB/PJNfjBxCm qv7BnFHFeMsVJw+ptSGvR69iJd9nrjGzjwCPc= Received: by 10.204.11.5 with SMTP id r5mr184426bkr.1.1254414491195; Thu, 01 Oct 2009 09:28:11 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id p17sm427339fka.42.2009.10.01.09.28.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 09:28:09 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) Date: Thu, 1 Oct 2009 18:27:38 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 1, 2009, at 1:11 AM, Jacques Chester wrote: >> I do realize that this argument is going against nearly 15 years of >> Common Gateway Interface indoctrination :D > > I've argued similar things before in other forums (that > apps in future might embed their own HTTP handling). But > I didn't see it being a case of using a pure Lua, pure > Ruby, pure Python etc solution. HTTP handling is not very resource consuming. It's what you do with it which takes time. Irrespectively of implementation details. > Rather I expected folk > would settle on some fast, easily wrapped C library. > One that looks nice is Libebb[1]. I would settle on a simple, battle proof library for MIME handling. Not very interested in a full stack network run loop though. > But as I pointed out, (F|S)CGI isn't a performance tool. > Its purpose is to abstract the web server away from the > application. For a lot of people, that matters. More power to them! > I am happy in this case to agree to (partly) disagree. Hmmm... right... ok :)) From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 13:50:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91GojjG030235; Thu, 1 Oct 2009 13:50:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7881E192DA; Thu, 1 Oct 2009 13:50:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out6.iinet.net.au (outbound.icp-qv1-irony-out6.iinet.net.au [203.59.1.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6095192CB for ; Thu, 1 Oct 2009 13:49:54 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag0BAJd6xErLO8He/2dsb2JhbAAI2A2EKQSCJYFu X-IronPort-AV: E=Sophos;i="4.44,488,1249228800"; d="scan'208";a="11939471" Received: from unknown (HELO [10.1.1.2]) ([203.59.193.222]) by outbound.icp-qv1-irony-out6.iinet.net.au with ESMTP; 02 Oct 2009 00:50:01 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) From: Jacques Chester In-Reply-To: <7913df4d0910010922m50d86743k2153c4173011b2db@mail.gmail.com> Date: Fri, 2 Oct 2009 00:50:00 +0800 Content-Transfer-Encoding: 7bit Message-Id: <0017A563-50D0-4E75-88B0-05D1F0AE16EE@chester.id.au> References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> <7913df4d0910010922m50d86743k2153c4173011b2db@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 02/10/2009, at 12:22 AM, Fabio Mascarenhas wrote: > Lighty+FCGI is fast enough in practice, though. There was a thread at > the Kepler list a few months ago with benchmarks (startup times only) > of Lighty+FCGI+WSAPI vs Lighty+FCGI+PHP: > > http://lists.luaforge.net/pipermail/kepler-project/2009-June/003412.html Hmmm, those look familiar ;) Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 14:01:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91H1gEI032626; Thu, 1 Oct 2009 14:01:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3874019323; Thu, 1 Oct 2009 14:01:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFD33192D8 for ; Thu, 1 Oct 2009 14:00:54 -0300 (BRT) Received: by bwz22 with SMTP id 22so245783bwz.5 for ; Thu, 01 Oct 2009 10:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0MrU6H7NOnsiRhQT+Nt/ALVJ6PM7zpmREn7xsSE9gdM=; b=v1Jjv2oK8qFGMhdxvJLWr6CLIrIdG9LtF/DgLBbAMJzP0ckNTsNIpyea9TKOxQpiP5 Tl2rCtoGVQKzhho1RwrOz3vDCiGQuzqzzE7ZEI+Kr1MbUqp651shStDt7c7AgLdQkN31 ErUU3fUQ6Wit8TlfbyNSuhkD6XwtVTqcMn+5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=S41Y/TTz9fKMbYYs9OteyULxlan6ePx33SGS8y9FUZeZBcM/8lzYWjRJRNwI6byBw7 QOwqcxYUwMFIHhB/uMGIILjxqOYgxoBU5gUavFoUwcgyK2chztf3frmYzv5KBHJUjx4X +L/OPdFVHURRnTbX9O0Q0hgsK/5fSFeMSiRos= MIME-Version: 1.0 Received: by 10.223.21.3 with SMTP id h3mr432707fab.39.1254416466072; Thu, 01 Oct 2009 10:01:06 -0700 (PDT) In-Reply-To: <1254413368.21568.75.camel@matroskin> References: <1254328573.21568.13.camel@matroskin> <4AC3CEF6.7060107@wp.pl> <1254413368.21568.75.camel@matroskin> Date: Thu, 1 Oct 2009 18:01:06 +0100 Message-ID: Subject: Re: Tracking number of pairs in a dictionary From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n91H1gEI032626 On Thu, Oct 1, 2009 at 5:09 PM, Jorge wrote: > On Wed, 2009-09-30 at 23:34 +0200, Michal Kolodziejczyk wrote: >> Or you could keep a counter within the table (so you will not iterate >> the table at all). Here is an example implementation (you can overide >> removeOne() to what you need): >> >> MT={ >>   add=function(self, key, value) > > Wow... Never seen metatables used like that. Had to look it twice to get > why it works :) > > Is there a way for keeping _n and _limit out of the table? With some > upvalue magic or something? Otherwise you have to explicitly skip them > while iterating (as the RemoveOne as is does not :) ) > > Jorge > > You could try using weak-valued tables to store the values of _n and _limit instead of fields. Modified version of Miko's code follows: local _ns = setmetatable({}, {__mode = 'k'}) local _limits = setmetatable({}, {__mode = 'k'}) MT={ add=function(self, key, value) if not rawget(self, key) then if _ns[self]>=_limits[self] then self:removeOne() end _ns[self]=_ns[self]+1 end rawset(self, key, value) end, removeOne=function(self) self[next(self)]=nil _ns[self]=_ns[self]-1 print('Removed entry') end, del=function(self, key) if rawget(self, key) and _ns[self]>0 then _ns[self]=_ns[self]-1 end rawset(self, key, nil) end } MT.__index=MT LimitedTable={ new=function(limit) local t = {} _ns[t] = 0 _limits[t] = limit return setmetatable(t, MT) end, } -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 14:10:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91HAnfZ002258; Thu, 1 Oct 2009 14:10:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 709D519359; Thu, 1 Oct 2009 14:10:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2760819320 for ; Thu, 1 Oct 2009 14:10:00 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so1678557fgg.17 for ; Thu, 01 Oct 2009 10:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=BrsceSLRRud7nEfS9qmzod584vQQXfhSJrHEFCtg8Xw=; b=nULHhKhC2EsRTAlDPIKi+zT369tOQxOEjl6o8c06BF8fVWSg8kCmXqSzpeRjvwTtFC wa5hDPmOU3k9c60lxyEw/PlNqCxp91BYNB2ZfkkV/eQZheJiwk9xdsILlqnNLCZ3WxVA i3GsCDWLCJv3TYa8RuHyEbhVz3/3wPmDr6AEs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=gaV1vwGMVDcDzn+R2nMuJWztfHqnSpFGImDQKzmqsqk8bjSiXgFA9E5rD4umodHg8X u/3fvQvSPQz9wWHLGIDVXzlfabOZscahINlT2CM6QklaxF5osTLb8G8WaXAI5bQ/SATb P1B4VgNuBzTs6QonZRuOZY/5i1mX3wvqa/vcE= Received: by 10.86.12.2 with SMTP id 2mr1456649fgl.12.1254417012226; Thu, 01 Oct 2009 10:10:12 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id e20sm97358fga.0.2009.10.01.10.10.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 10:10:11 -0700 (PDT) Message-Id: <357A5CD8-A0A0-4970-956A-6E4D838651FB@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <0017A563-50D0-4E75-88B0-05D1F0AE16EE@chester.id.au> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) Date: Thu, 1 Oct 2009 19:09:40 +0200 References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> <7913df4d0910010922m50d86743k2153c4173011b2db@mail.gmail.com> <0017A563-50D0-4E75-88B0-05D1F0AE16EE@chester.id.au> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 1, 2009, at 6:50 PM, Jacques Chester wrote: > Hmmm, those look familiar ;) How are the exams coming along? :D From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 14:25:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91HPYX1006061; Thu, 1 Oct 2009 14:25:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECD731937A; Thu, 1 Oct 2009 14:24:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f177.google.com (mail-pz0-f177.google.com [209.85.222.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E7E619320 for ; Thu, 1 Oct 2009 14:24:43 -0300 (BRT) Received: by pzk7 with SMTP id 7so267025pzk.33 for ; Thu, 01 Oct 2009 10:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=M89KTd6WKKuRQ4HTI6Tb2+MZ9FJT36s9qmPZD92urBQ=; b=nNEqJ7dcdTaJjvPxL+Xj4FwxnGk9U2llIJrcsaZwpRHNv3hMTPw0WCrCuaArF3m7DD Yv4sFt0avWR6G2kxn6iS6lrDh3oQqO6+L0DjPPZZCSMKAHpHBuEQ10MYQPEJyQE9SnwE lpXwhsk7KAFmRjcR5B4ZWQFsToDcdTO/3+lxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=NhPl68zhvBo6bNS2lqefVBJp3WJg0rEdRidzeidCfBxL0HOcivp+GxligqK5uTy+N0 6wRHi8c1Da8ToZ6/RcF+vIvk+Les8i8ArQ/iawlecifGJaQRkHR97IYPb9twuJcVclub yu6GdD+Vgsxs/viYKo5M8N5Qof0S5bOrXKOlg= Received: by 10.114.252.14 with SMTP id z14mr2455901wah.84.1254417894355; Thu, 01 Oct 2009 10:24:54 -0700 (PDT) Received: from ?128.130.5.100? (WPIS-64-140-206-242.worldpath.net [64.140.206.242]) by mx.google.com with ESMTPS id 20sm145435pxi.12.2009.10.01.10.24.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 10:24:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Tracking number of pairs in a dictionary From: Doug Currie In-Reply-To: Date: Thu, 1 Oct 2009 13:24:49 -0400 Content-Transfer-Encoding: 7bit Message-Id: <96A8FF07-CCAA-45EA-BA69-CD08B166A909@gmail.com> References: <1254328573.21568.13.camel@matroskin> <4AC3CEF6.7060107@wp.pl> <1254413368.21568.75.camel@matroskin> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 1, 2009, at 1:01 PM, Duncan Cross wrote: > On Thu, Oct 1, 2009 at 5:09 PM, Jorge wrote: >> On Wed, 2009-09-30 at 23:34 +0200, Michal Kolodziejczyk wrote: >>> Or you could keep a counter within the table (so you will not >>> iterate >>> the table at all). Or you can use closures function make_LimitedTable (limit) local function make_LimitedTable_MT () local n = 0 local MT={ add=function(self, key, value) if not rawget(self, key) then if n >= limit then self:removeOne() end n = n + 1 end rawset(self, key, value) end, removeOne=function(self) self[next(self)]=nil n = n - 1 print('Removed entry') end, del=function(self, key) if rawget(self, key) and n > 0 then n = n - 1 end rawset(self, key, nil) end } MT.__index=MT return MT end return setmetatable({},make_LimitedTable_MT()) end > t = make_LimitedTable(2) > t:add('a',{}) > t:add('b',{}) > t:add('c',{}) Removed entry > for k,v in pairs(t) do print(k,v) end c table: 0x10b370 b table: 0x101b90 e From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 15:20:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91IKEYJ021491; Thu, 1 Oct 2009 15:20:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C21F18EA0; Thu, 1 Oct 2009 15:19:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9F7A189E9 for ; Thu, 1 Oct 2009 15:19:24 -0300 (BRT) Received: by fxm12 with SMTP id 12so451775fxm.5 for ; Thu, 01 Oct 2009 11:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Zcoa/4coGF2Gpzw0fQkn68ZE1ip55LnN9gJfaXFMnnc=; b=VM06CsATbAOflt4Oh5Hb/dtvzJYquqxp66v3zkFdpcELWwgqtMx9V5mktW486whKw2 yRFQ+gMVNY9s8/fHT+Zy1kDWxlmF5B5JABPdZw+kG12cZ2LhfU/LnLUOli78U7FRYTsE 78ImloxOfFjbw7fgyL0M7KjDeCe9nBG9KC8ro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=NBh21ACsUkzr24SHCEfUn7Easo54jHccxK8iP/c5dS4+2Og5QiBp6lfzcdCBL/9ZyW SjZvsEqXp2Os03VCFf+GbEMA70ePMdognG2ZJikDLlZmcKJ5zwV/HJOuof0DKyCHsm+O UUK1253E21hiDZ9ngSoSeWuEAXQ4Pl6DF1DlY= Received: by 10.204.156.212 with SMTP id y20mr251445bkw.126.1254421177064; Thu, 01 Oct 2009 11:19:37 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 31sm580423fkt.48.2009.10.01.11.19.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 11:19:36 -0700 (PDT) Message-Id: <14A34C18-C3BE-4052-8A0C-09F3D36F4665@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <1254420419.21568.76.camel@matroskin> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Tracking number of pairs in a dictionary Date: Thu, 1 Oct 2009 20:19:05 +0200 References: <1254328573.21568.13.camel@matroskin> <4AC3CEF6.7060107@wp.pl> <1254413368.21568.75.camel@matroskin> <96A8FF07-CCAA-45EA-BA69-CD08B166A909@gmail.com> <1254420419.21568.76.camel@matroskin> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 1, 2009, at 8:06 PM, Jorge wrote: > So, THAT is what closures are for! :) Among other things, e.g.: local function counter() local aCount = 0 return function() aCount = aCount + 1 return aCount end end local aCounter = counter() local anotherCounter = counter() print( 'aCounter', aCounter() ) print( 'aCounter', aCounter() ) print( 'anotherCounter', anotherCounter() ) > aCounter 1 > aCounter 2 > anotherCounter 1 From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 15:36:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91IaToW025585; Thu, 1 Oct 2009 15:36:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3306918D78; Thu, 1 Oct 2009 15:07:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from davinci.fing.edu.uy (smtp.fing.edu.uy [164.73.32.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D7A1189E9 for ; Thu, 1 Oct 2009 15:06:54 -0300 (BRT) Received: from [164.73.36.250] (laptop-inco-05.fing.edu.uy [164.73.36.250]) (authenticated bits=0) by davinci.fing.edu.uy with ESMTP id n91I70PV009766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 1 Oct 2009 15:07:03 -0300 (UYT) Subject: Re: Tracking number of pairs in a dictionary From: Jorge To: Lua list In-Reply-To: <96A8FF07-CCAA-45EA-BA69-CD08B166A909@gmail.com> References: <1254328573.21568.13.camel@matroskin> <4AC3CEF6.7060107@wp.pl> <1254413368.21568.75.camel@matroskin> <96A8FF07-CCAA-45EA-BA69-CD08B166A909@gmail.com> Content-Type: text/plain Date: Thu, 01 Oct 2009 15:06:59 -0300 Message-Id: <1254420419.21568.76.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (davinci.fing.edu.uy [164.73.32.2]); Thu, 01 Oct 2009 15:07:03 -0300 (UYT) X-Spam-Score: -1.654 () AWL,BAYES_00,SPF_NEUTRAL X-Scanned-By: MIMEDefang 2.63 on 164.73.32.2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 2009-10-01 at 13:24 -0400, Doug Currie wrote: > Or you can use closures So, THAT is what closures are for! :) Thanks for al the input, Jorge From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 17:44:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91KiS0G004107; Thu, 1 Oct 2009 17:44:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3587418C1B; Thu, 1 Oct 2009 17:43:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EEC618BA2 for ; Thu, 1 Oct 2009 17:43:30 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91Khgam003963 for ; Thu, 1 Oct 2009 17:43:42 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n91KhfN22887; Thu, 1 Oct 2009 17:43:41 -0300 Date: Thu, 1 Oct 2009 17:43:40 -0300 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: IPhone Wax Message-ID: <20091001174340.A22884@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br IPhone Wax is another tool for developing IPhone apps in Lua: http://www.mobileorchard.com/announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 17:57:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91KvV5U007036; Thu, 1 Oct 2009 17:57:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A15B1A6C9; Thu, 1 Oct 2009 17:56:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7930B1A65D for ; Thu, 1 Oct 2009 17:56:50 -0300 (BRT) Received: by iwn8 with SMTP id 8so304103iwn.33 for ; Thu, 01 Oct 2009 13:57:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.93 with SMTP id g29mr3257693ibr.13.1254430622676; Thu, 01 Oct 2009 13:57:02 -0700 (PDT) In-Reply-To: <20091001174340.A22884@lua.tecgraf.puc-rio.br> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> Date: Thu, 1 Oct 2009 15:57:02 -0500 Message-ID: <75cc17ac0910011357h64c46f59ha24eac1b70886d14@mail.gmail.com> Subject: Re: IPhone Wax From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=0016e646926aa99b350474e5e3a4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e646926aa99b350474e5e3a4 Content-Type: text/plain; charset=UTF-8 On Thu, Oct 1, 2009 at 3:43 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > IPhone Wax is another tool for developing IPhone apps in Lua: > > > http://www.mobileorchard.com/announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua > 20 minutes to get it running - now that's a marketable statistic! Anything for us lonely Android suckers? -gregg --0016e646926aa99b350474e5e3a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Oct 1, 2009 at 3:43 PM, Luiz Henriqu= e de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
IPhone Wax is another tool for developing IPhone apps in Lua:

http://www.mobileorchard.com/= announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua

20 minutes to get it running - now that's a mark= etable statistic!

Anything for us lonely Android suckers?

-gr= egg
--0016e646926aa99b350474e5e3a4-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 18:11:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91LBnTu010194; Thu, 1 Oct 2009 18:11:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6C8A1A6CD; Thu, 1 Oct 2009 18:11:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 208CD1A65D for ; Thu, 1 Oct 2009 18:11:04 -0300 (BRT) Received: by iwn8 with SMTP id 8so310188iwn.33 for ; Thu, 01 Oct 2009 14:11:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.4.75 with SMTP id 11mr3204565ibq.25.1254431477929; Thu, 01 Oct 2009 14:11:17 -0700 (PDT) In-Reply-To: <75cc17ac0910011357h64c46f59ha24eac1b70886d14@mail.gmail.com> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <75cc17ac0910011357h64c46f59ha24eac1b70886d14@mail.gmail.com> Date: Thu, 1 Oct 2009 17:11:17 -0400 Message-ID: <790db3550910011411t4d984655r8bfa9cccb6744891@mail.gmail.com> Subject: Re: IPhone Wax From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 1, 2009 at 4:57 PM, Gregg Reynolds wrote: > > On Thu, Oct 1, 2009 at 3:43 PM, Luiz Henrique de Figueiredo > wrote: >> >> IPhone Wax is another tool for developing IPhone apps in Lua: >> >> >> http://www.mobileorchard.com/announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua > > 20 minutes to get it running - now that's a marketable statistic! > > Anything for us lonely Android suckers? Yup!! http://code.google.com/p/android-scripting/wiki/LuaAndroidAPI -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 18:31:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91LVBKr013930; Thu, 1 Oct 2009 18:31:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 042FB1A6D0; Thu, 1 Oct 2009 18:30:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 479251A65D for ; Thu, 1 Oct 2009 18:30:23 -0300 (BRT) Received: by ewy26 with SMTP id 26so703565ewy.5 for ; Thu, 01 Oct 2009 14:30:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.84.10 with SMTP id h10mr8512947ebb.70.1254432635756; Thu, 01 Oct 2009 14:30:35 -0700 (PDT) In-Reply-To: <20091001174340.A22884@lua.tecgraf.puc-rio.br> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> Date: Thu, 1 Oct 2009 16:30:35 -0500 Message-ID: <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> Subject: Re: IPhone Wax From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 1, 2009 at 3:43 PM, Luiz Henrique de Figueiredo wrote: > IPhone Wax is another tool for developing IPhone apps in Lua: > > http://www.mobileorchard.com/announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua interesting, how does it goes around the 'no VM' policy? -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 18:36:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91LaNwo014497; Thu, 1 Oct 2009 18:36:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E389A1A6D4; Thu, 1 Oct 2009 18:35:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38AA1A65D for ; Thu, 1 Oct 2009 18:35:43 -0300 (BRT) Received: by ewy26 with SMTP id 26so707674ewy.5 for ; Thu, 01 Oct 2009 14:35:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.20.77 with SMTP id o55mr387598weo.19.1254432956275; Thu, 01 Oct 2009 14:35:56 -0700 (PDT) In-Reply-To: <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> Date: Thu, 1 Oct 2009 22:35:56 +0100 X-Google-Sender-Auth: 5273e3197faac8d2 Message-ID: Subject: Re: IPhone Wax From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 1, 2009 at 10:30 PM, Javier Guerra wrote: > interesting, how does it goes around the 'no VM' policy? I'm not an iPhone user or developer (Android for me), but I was under the impression that Apple had no problems with a VM, as long as the end-user couldn't write applications for the VM, and thus sidestep their application approval process. From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 18:56:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91Lumav017267; Thu, 1 Oct 2009 18:56:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 221691A6CB; Thu, 1 Oct 2009 18:56:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas03p.mx.bigpond.com (nskntmtas03p.mx.bigpond.com [61.9.168.143]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB6A818682 for ; Thu, 1 Oct 2009 18:55:56 -0300 (BRT) Received: from nskntotgx02p.mx.bigpond.com ([143.238.91.39]) by nskntmtas03p.mx.bigpond.com with ESMTP id <20091001215601.JMMG1310.nskntmtas03p.mx.bigpond.com@nskntotgx02p.mx.bigpond.com> for ; Thu, 1 Oct 2009 21:56:01 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nskntotgx02p.mx.bigpond.com with ESMTP id <20091001215601.EQKR6148.nskntotgx02p.mx.bigpond.com@[10.0.0.8]> for ; Thu, 1 Oct 2009 21:56:01 +0000 Message-ID: <4AC52334.8060005@bigpond.net.au> Date: Fri, 02 Oct 2009 07:46:28 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nskntotgx02p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Thu, 1 Oct 2009 21:56:01 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150202.4AC52571.0062,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Peter Cawley wrote: > I'm not an iPhone user or developer (Android for me), but I was under > the impression that Apple had no problems with a VM, as long as the > end-user couldn't write applications for the VM, and thus sidestep > their application approval process. > Actually, that's correct. The issue Apple has is that they have such strict (draconian!) control over their App Store application approvals that adding a VM accessible to the public could mean that people could run applications on their phone that violated their safety (and public relations) standards. If the application could download & run scripts from the net (or otherwise be installed onto the standard iPhone), an entire suite of unsafe, unsavoury, and (more importantly) uncontrolled by Apple functionality could be made available to the public. So long as the application is not extendable by script, it appears Apple is OK with Lua (I believe there are already some Lua-based apps in the App Store). It's not VM's Apple has issues with, it is the capability of an application to skirt around the central control Apple has over what can & can't make it onto the iPhone. -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 19:28:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91MSQr0022629; Thu, 1 Oct 2009 19:28:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DF251A6CD; Thu, 1 Oct 2009 19:27:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ADFA1A678 for ; Thu, 1 Oct 2009 19:27:37 -0300 (BRT) Received: by vws15 with SMTP id 15so308201vws.5 for ; Thu, 01 Oct 2009 15:27:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.18.69 with SMTP id v5mr3173442vca.113.1254436068530; Thu, 01 Oct 2009 15:27:48 -0700 (PDT) In-Reply-To: <4AC52334.8060005@bigpond.net.au> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> From: Phoenix Sol Date: Thu, 1 Oct 2009 17:27:28 -0500 Message-ID: <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> Subject: Re: IPhone Wax To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >It's not VM's Apple has issues with, it is the capability of > an application to skirt around the central control Apple has over what > can & can't make it onto the iPhone. I, for one, am indignant toward Apple for this AND their policy requiring that all iPhone apps must be developed on Cupertino Metal. I will switch to Android as soon as possible. From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 20:16:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91NGO8Y029228; Thu, 1 Oct 2009 20:16:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E51E71A6D4; Thu, 1 Oct 2009 20:15:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas06p.mx.bigpond.com (nschwmtas06p.mx.bigpond.com [61.9.189.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 096631A678 for ; Thu, 1 Oct 2009 20:15:31 -0300 (BRT) Received: from nschwotgx02p.mx.bigpond.com ([143.238.91.39]) by nschwmtas06p.mx.bigpond.com with ESMTP id <20091001231537.WBAK22839.nschwmtas06p.mx.bigpond.com@nschwotgx02p.mx.bigpond.com> for ; Thu, 1 Oct 2009 23:15:37 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx02p.mx.bigpond.com with ESMTP id <20091001231536.QJBR4842.nschwotgx02p.mx.bigpond.com@[10.0.0.8]> for ; Thu, 1 Oct 2009 23:15:36 +0000 Message-ID: <4AC535F3.90506@bigpond.net.au> Date: Fri, 02 Oct 2009 09:06:27 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> In-Reply-To: <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx02p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Thu, 1 Oct 2009 23:15:36 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.4AC53819.0046,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Phoenix Sol wrote:
It's not VM's Apple has issues with, it is the capability of
an application to skirt around the central control Apple has over what
can & can't make it onto the iPhone.
    

I, for one, am indignant toward Apple for this AND their policy
requiring that all iPhone apps must be developed on Cupertino Metal.

I will switch to Android as soon as possible.
  

Not that I blame you, but until the iPhone craze is actually affected by the Android platform - it's not going to change. Like Windows in the desktop arena, the iPhone platform is currently where a majority of the mobile application money is (for us contract developers anyhow). Much as I hate the App Store rules, the iPhone is a pretty good device with alot of potential (though at a price point I wouldn't pay personally).

The commercial reality is that application development for the iPhone is a decent niche for contract developers with the skills. Having Lua as a language one can use is a good thing, especially when you can update on the fly to the device without the delay of a complete recompile/resign/redeploy pipeline. So long as the end product is not capable of such development trickery - Apple doesn't care so long as it doesn't harm their control of the platform.


-- 
Regards,

Benjamin Tolputt
Analyst Programmer
From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 20:30:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91NU15w030826; Thu, 1 Oct 2009 20:30:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 935691A6D6; Thu, 1 Oct 2009 20:29:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s0-postfix.allcaps.org (s0-postfix.allcaps.org [206.71.184.59]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA41F1854E for ; Thu, 1 Oct 2009 20:29:21 -0300 (BRT) Received: from Andrew-Lentvorskis-MacBook-Pro.local (adsl-64-163-13-49.dsl.sndg02.pacbell.net [64.163.13.49]) by s0-postfix.allcaps.org (Postfix) with ESMTPSA id BAFB214122 for ; Thu, 1 Oct 2009 16:17:49 -0700 (PDT) Message-ID: <4AC53B58.2010100@allcaps.org> Date: Thu, 01 Oct 2009 16:29:28 -0700 From: Andrew Lentvorski User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> In-Reply-To: <4AC535F3.90506@bigpond.net.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Benjamin Tolputt wrote: > Not that I blame you, but until the iPhone craze is actually affected > by the Android platform - it's not going to change. Like Windows in > the desktop arena, the iPhone platform is currently where a majority > of the mobile application money is (for us contract developers anyhow). Is that still true? I expected that iPhone apps are like Flash apps. A few people get very lucky at the beginning and make money, and then it quickly becomes a development ghetto. Is there something nonobvious preventing that? -a From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 20:41:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n91Nf1x5031931; Thu, 1 Oct 2009 20:41:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C12E1A6D7; Thu, 1 Oct 2009 20:40:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8DA21A667 for ; Thu, 1 Oct 2009 20:40:15 -0300 (BRT) Received: by vws15 with SMTP id 15so334122vws.5 for ; Thu, 01 Oct 2009 16:40:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.218 with SMTP id m26mr3392673vck.30.1254439983175; Thu, 01 Oct 2009 16:33:03 -0700 (PDT) In-Reply-To: <4AC535F3.90506@bigpond.net.au> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> From: Phoenix Sol Date: Thu, 1 Oct 2009 18:32:43 -0500 Message-ID: <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> Subject: Re: IPhone Wax To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I, for one, am indignant toward Apple for this AND their policy > requiring that all iPhone apps must be developed on Cupertino Metal. > > I will switch to Android as soon as possible. > > > Not that I blame you, but until the iPhone craze is actually affected by the > Android platform - it's not going to change. Like Windows in the desktop > arena, the iPhone platform is currently where a majority of the mobile > application money is (for us contract developers anyhow). Much as I hate the > App Store rules, the iPhone is a pretty good device with alot of potential > (though at a price point I wouldn't pay personally). > > The commercial reality is that application development for the iPhone is a > decent niche for contract developers with the skills. Having Lua as a > language one can use is a good thing, especially when you can update on the > fly to the device without the delay of a complete recompile/resign/redeploy > pipeline. So long as the end product is not capable of such development > trickery - Apple doesn't care so long as it doesn't harm their control of > the platform. Well said. I have to agree with all of that, but just let me qualify that a good deal of my frustration is because I'd like to run code on my phone that only makes sense for me personally; private stuff that I would not want to offer commercially. I wouldn't mind jumping in on the iPhone app market, if I didn't have to buy an Apple computer to do so. I prefer Linux and commodity hardware. From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 21:34:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n920YSTD005506; Thu, 1 Oct 2009 21:34:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66F111A71F; Thu, 1 Oct 2009 21:33:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDB611A65E for ; Thu, 1 Oct 2009 21:33:37 -0300 (BRT) Received: by pxi2 with SMTP id 2so758001pxi.11 for ; Thu, 01 Oct 2009 17:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GwHx/bRvuRgpBOEzonfIpybx8jr80DMCg+ZhIh92rf8=; b=JJDfDkgmnZTDVL56pjdltj5URCLiKW12CRdAknwyDp2gczQYxoPfyjAT+sLU2NHcTx 1UBPw5O6kNWe1uLv5nknIiW/RmhbYb6GhEzSOLYKcHwehU7qnXaw8G4XfO3vJYQOnN4V tSAlaha8XsGHwNMk71bTTjg/zMQjfI8wBni+8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YUfLkDGPgZClDkk/OqkG7qJQtE5WJ+mhHLYuzJcX1oedg8Kk4FzmB2h4uSvWsC1AWC 3/FNO12pS9f4Hyj/7lb34gHRrLxyScG+p5VXa6ACaKAwuMQZfntWNrD6bwAMzXtg3HiY jTaH9Yxjy+m1Cfeg4wqv3VdgiPJ49Zn0Dnd6o= MIME-Version: 1.0 Received: by 10.142.2.10 with SMTP id 10mr269806wfb.99.1254443630456; Thu, 01 Oct 2009 17:33:50 -0700 (PDT) In-Reply-To: <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> Date: Thu, 1 Oct 2009 17:33:50 -0700 Message-ID: <17eac67c0910011733y2996d481m14df6eb77883dd17@mail.gmail.com> Subject: Re: IPhone Wax From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 1, 2009 at 4:32 PM, Phoenix Sol wrote: > Well said. I have to agree with all of that, but just let me qualify > that a good deal of my frustration is because I'd like to run code on > my phone that only makes sense for me personally; private stuff that I > would not want to offer commercially. You can do that, developers can run their code on their phones. > I wouldn't mind jumping in on the iPhone app market, if I didn't have > to buy an Apple computer to do so. I prefer Linux and commodity > hardware. Developing on non-apple hardware though, that you can't do. I might look at Wax. I tried using lua (and ruby) obj-c bindings before I knew how to use the Cocoa toolkit. I found them unusable without a good knowledge of obj-c and the cocoa class library, which dampened my enthusiasm a lot. Obj-c is reasonably concise within its domain, and so much of a iPhone apps (I'm working on one now), are just about wiring bits of cocoa to other bits, that its not clear to me there is enough non-cocoa logic to make it worth using lua. Games have always seemed a corner case, though a large profitable corner. They really need the performance of low-level C-based languages (C, C++, obj-c), but also have very large amounts of application logic (board game rules, making monsters walk down corridors, whatever). If there isn't a sufficiently large amount of that high-level code, its not clear that lua is a big win. I don't use lua because I can save a few semicolons: [nstable add:something]; nstable:add(something) I use it where I can cut my code size by magnitudes, and modify it quickly for ever-changing goals. The app I'm building for the iPhone, for example, is mostly about allowing cascading table views to navigate a database of rock climbing routes. Very little app logic, lots of binding gui to sqlite calls. The code would look much the same no matter the language, it is all tied to the UIKit MVC APIs. Still, I'll take a look some time. Recent adventures in working around the lack of a map() method for arrays and dictionaries has been making me roll my eyes in impatience with obj-c's... Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 22:15:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n921F5Ai011906; Thu, 1 Oct 2009 22:15:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF9F11A720; Thu, 1 Oct 2009 22:14:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas03p.mx.bigpond.com (nschwmtas03p.mx.bigpond.com [61.9.189.143]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C19481A6FA for ; Thu, 1 Oct 2009 22:14:16 -0300 (BRT) Received: from nschwotgx03p.mx.bigpond.com ([143.238.91.39]) by nschwmtas03p.mx.bigpond.com with ESMTP id <20091002011421.WQMJ4789.nschwmtas03p.mx.bigpond.com@nschwotgx03p.mx.bigpond.com> for ; Fri, 2 Oct 2009 01:14:21 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx03p.mx.bigpond.com with ESMTP id <20091002011421.LELY10433.nschwotgx03p.mx.bigpond.com@[10.0.0.8]> for ; Fri, 2 Oct 2009 01:14:21 +0000 Message-ID: <4AC551C7.1070203@bigpond.net.au> Date: Fri, 02 Oct 2009 11:05:11 +1000 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> <4AC53B58.2010100@allcaps.org> In-Reply-To: <4AC53B58.2010100@allcaps.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx03p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Fri, 2 Oct 2009 01:14:21 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150205.4AC553ED.0082,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andrew Lentvorski wrote: > Is that still true? I expected that iPhone apps are like Flash apps. > A few people get very lucky at the beginning and make money, and then > it quickly becomes a development ghetto. > > Is there something nonobvious preventing that? Yes. Being a contractor, I get paid regardless of the success of an application. I take risks on my own projects, but try to avoid taking on the risks of others. I've been burned in the past by this and don't wish to repeat it. The two types of clients I know of in the App Store market are those that think their idea is a money maker and those that cannot afford not to be on the iPhone regardless of the loss they are prepared to make. In the first case, you need something unique to make money in the iPhone market, be it a game or a utility. If it is something unoriginal (such as another Tetris clone) or something anyone can implement (yet another calculator) - it's not going to make much money (if any). The gold rush is over and you must have something unique to make your money back, let alone a decent profit from the App Store. In the second case, there are companies (generally web-based ones) that cannot allow their competitors to be on the App Store without a similar application available. These clients tend to release their application for free in order to spread their brand, service, and (generally) advertising to anyone willing to download their app. A typical example would be Domain (not a client - so I can talk about them). They have an iPhone application for the searching & viewing of real-estate on the property market. They release this application for free because they cannot allow their competitors to gain market-share by ignoring the iPhone. These are my favourite clients :) In either case, we've strayed from purpose of this list, being about Lua the language & platform. To which I can only repeat myself in stating that a Lua framework for app development is a good thing and I will be closely watching it's progress. -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 23:07:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9227GsR017541; Thu, 1 Oct 2009 23:07:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94D6918507; Thu, 1 Oct 2009 23:06:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f177.google.com (mail-pz0-f177.google.com [209.85.222.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E87C184EF for ; Thu, 1 Oct 2009 23:06:26 -0300 (BRT) Received: by pzk7 with SMTP id 7so645423pzk.33 for ; Thu, 01 Oct 2009 19:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=21S5Ib6mW0Xa2fMOfmq/VedSlJ5Maz5SkAmElWESsrw=; b=HxhEHJC15jJkxG/x90tjXE1tSQ4J7hc75HwSdA5+sfHUFz1S5jtcBonNhN1k7aWb4c o+Jt5M7K3dpTAKPbIx3D1pRHyY/IA9w5b2/IVVVUfKFeP3XWDTU98CdO4qYybgyYGcqX zhSdQ+ZOCqJ94IQBj/21u48Yd0y+9O0ZRfP0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=itQ+4GFCp0CNrOIHJSXW/IiyJQu4UXJPizGdELAiALp83O+HNdp6AvxVh54lneymkF NGwMEXNJh/vVUcEQaOIIfEw2dc0wZVfm+IofAR1I2r5+MXLuY7keeu+fNs/Bmle3a5uD wd/lyh0tOqsTVvlL3K3/AWC2ImwkywVts4yvo= MIME-Version: 1.0 Received: by 10.142.196.7 with SMTP id t7mr302217wff.33.1254449197318; Thu, 01 Oct 2009 19:06:37 -0700 (PDT) In-Reply-To: <4AC52334.8060005@bigpond.net.au> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> Date: Thu, 1 Oct 2009 19:06:37 -0700 Message-ID: <3c7e3c8a0910011906t7350f630n4b75f2432b329946@mail.gmail.com> Subject: Re: IPhone Wax From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/1/09, Benjamin Tolputt wrote: > Peter Cawley wrote: >> I'm not an iPhone user or developer (Android for me), but I was under >> the impression that Apple had no problems with a VM, as long as the >> end-user couldn't write applications for the VM, and thus sidestep >> their application approval process. >> > > Actually, that's correct. The issue Apple has is that they have such > strict (draconian!) control over their App Store application approvals > that adding a VM accessible to the public could mean that people could > run applications on their phone that violated their safety (and public > relations) standards. If the application could download & run scripts > from the net (or otherwise be installed onto the standard iPhone), an > entire suite of unsafe, unsavoury, and (more importantly) uncontrolled > by Apple functionality could be made available to the public. > > So long as the application is not extendable by script, it appears Apple > is OK with Lua (I believe there are already some Lua-based apps in the > App Store). It's not VM's Apple has issues with, it is the capability of > an application to skirt around the central control Apple has over what > can & can't make it onto the iPhone. > Yes, there are some apps already on the store that use Lua. However, there are general documented cases where Apple is inconsistent about applying the rules. And the rules laid out in the SDK license terms are ambiguous at best with the respect to VMs. So for the paranoid, I've been working with Robert Jakabosky to get llvm-lua working on iPhone to precompile down lua scripts into native code. We actually got it working a few weeks ago, but I need to document it, put some examples together, and think about how to clean up the process a bit to make it easier to use. I've been side tracked recently and haven't had time to do this. I'm hoping maybe next week I'll get something preliminary posted. Meanwhile, anybody know how Wax does it's bridging? Building a new/updated LuaObjCBridge has been sitting in my todo pile forever. For Mac, the plan was to copy MacRuby and use libffi and Apple's BridgeSupport. I don't think iPhone has either of these available, so I was wondering what the trick is. And would Wax work for Mac? Thanks, Eric From lua-bounces@bazar2.conectiva.com.br Thu Oct 1 23:57:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n922vLBV021485; Thu, 1 Oct 2009 23:57:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9908E1A700; Thu, 1 Oct 2009 23:56:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 088231A6E6 for ; Thu, 1 Oct 2009 23:56:35 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MtYK5-0005U9-At for lua@bazar2.conectiva.com.br; Thu, 01 Oct 2009 19:56:45 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: IPhone Wax Date: Thu, 1 Oct 2009 19:56:37 -0700 User-Agent: KMail/1.9.10 References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <4AC52334.8060005@bigpond.net.au> <3c7e3c8a0910011906t7350f630n4b75f2432b329946@mail.gmail.com> In-Reply-To: <3c7e3c8a0910011906t7350f630n4b75f2432b329946@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910011956.37699.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thursday 01, E. Wing wrote: > On 10/1/09, Benjamin Tolputt wrote: > > Peter Cawley wrote: > >> I'm not an iPhone user or developer (Android for me), but I was under > >> the impression that Apple had no problems with a VM, as long as the > >> end-user couldn't write applications for the VM, and thus sidestep > >> their application approval process. > > > > Actually, that's correct. The issue Apple has is that they have such > > strict (draconian!) control over their App Store application approvals > > that adding a VM accessible to the public could mean that people could > > run applications on their phone that violated their safety (and public > > relations) standards. If the application could download & run scripts > > from the net (or otherwise be installed onto the standard iPhone), an > > entire suite of unsafe, unsavoury, and (more importantly) uncontrolled > > by Apple functionality could be made available to the public. > > > > So long as the application is not extendable by script, it appears Apple > > is OK with Lua (I believe there are already some Lua-based apps in the > > App Store). It's not VM's Apple has issues with, it is the capability of > > an application to skirt around the central control Apple has over what > > can & can't make it onto the iPhone. > > Yes, there are some apps already on the store that use Lua. However, > there are general documented cases where Apple is inconsistent about > applying the rules. And the rules laid out in the SDK license terms > are ambiguous at best with the respect to VMs. > > > So for the paranoid, I've been working with Robert Jakabosky to get > llvm-lua working on iPhone to precompile down lua scripts into native > code. We actually got it working a few weeks ago, but I need to > document it, put some examples together, and think about how to clean > up the process a bit to make it easier to use. I've been side tracked > recently and haven't had time to do this. I'm hoping maybe next week > I'll get something preliminary posted. For anyone that is interested in try to use llvm-lua to static compile Lua script for the iPhone checkout the latest SVN trunk revision of llvm-lua (you will also need LLVM 2.6 which is still in pre-release stage). I was going to roll a new release of llvm-lua once LLVM 2.6 was officially released but they keep bumping the release date (new date is now "TBD"), atleast the 2.6 API is frozen so I don't have to worry about incompatible changes, so I might just release anyways. Also the current revision of llvm-lua now has CMake build files as an alternative to the old Makefiles. > Meanwhile, anybody know how Wax does it's bridging? Building a > new/updated LuaObjCBridge has been sitting in my todo pile forever. > For Mac, the plan was to copy MacRuby and use libffi and Apple's > BridgeSupport. I don't think iPhone has either of these available, so > I was wondering what the trick is. And would Wax work for Mac? I looked over the wax code really quickly at: http://github.com/probablycorey/wax It looks like it would be possible to swap out the normal Lua vm core with the modified version from llvm-lua. Maybe the wax author would be interested in using llvm-lua. We can atleast clone the git repository for now. I might not have much time to work on this until after Oct. 7. -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 00:07:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9237SQY022883; Fri, 2 Oct 2009 00:07:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 215C41A70C; Fri, 2 Oct 2009 00:06:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BE171A5DD for ; Fri, 2 Oct 2009 00:06:43 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MtYTv-0005VI-A8 for lua@bazar2.conectiva.com.br; Thu, 01 Oct 2009 20:06:55 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: CMake build files for Lua 5.1.x Date: Thu, 1 Oct 2009 20:06:53 -0700 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_O5WxKxQG2i1t4eU" Message-Id: <200910012006.54022.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_O5WxKxQG2i1t4eU Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Attached is a patch to add CMake build files to Lua 5.1. I have only tested them on Linux, but they should work for atleast Macs & Windows systems. Also some of the LUA_USE_* CMake options don't do anything right now, but they can still be changed in src/luaconf.h The patch doesn't change any of the existing files in Lua, it only adds about 3 files. The old Makefiles will still be there. If you use CMake in the same folder as the source, then it will overwrite some of the old Makefiles. I would recommend this usage (for Linux type systems): cd lua-5.1.4/ patch -p1 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n926C8vE006809; Fri, 2 Oct 2009 03:12:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F63E1A5ED; Fri, 2 Oct 2009 03:11:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa013msr.fastwebnet.it (aa013msr.fastwebnet.it [85.18.95.73]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 717F218552 for ; Fri, 2 Oct 2009 03:11:17 -0300 (BRT) Received: from [192.168.0.16] (39.254.73.45) by aa013msr.fastwebnet.it (8.5.016.6) id 4A9CF8A803F72CFB for lua@bazar2.conectiva.com.br; Fri, 2 Oct 2009 08:11:28 +0200 Message-Id: <152212C6-A0BF-47BD-B026-AA33E686DDE0@gmail.com> From: "Andrea D'Amore" To: Lua list In-Reply-To: <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: IPhone Wax Date: Fri, 2 Oct 2009 08:11:27 +0200 References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 02/ott/09, at 01:32, Phoenix Sol wrote: > I wouldn't mind jumping in on the iPhone app market, if I didn't have > to buy an Apple computer to do so. I prefer Linux and commodity > hardware. Iirc Jay Freeman, author of Cydia, uses open source toolchains. The real point is that not using XCode will make you miss a lot of facilities. I read about an IBM tutorial about iphone development with Eclipse on non-OS X platform, can't say what it really is though. -- Andrea From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 03:13:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n926DWwV006948; Fri, 2 Oct 2009 03:13:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12AD81A717; Fri, 2 Oct 2009 03:13:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa012msr.fastwebnet.it (aa012msr.fastwebnet.it [85.18.95.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FD491A600 for ; Fri, 2 Oct 2009 03:12:57 -0300 (BRT) Received: from [192.168.0.16] (39.254.73.45) by aa012msr.fastwebnet.it (8.5.016.6) id 4AA0132103D453F2 for lua@bazar2.conectiva.com.br; Fri, 2 Oct 2009 08:13:07 +0200 Message-Id: <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> From: "Andrea D'Amore" To: Lua list In-Reply-To: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: GSL Shell software announcement Date: Fri, 2 Oct 2009 08:13:06 +0200 References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 30/set/09, at 10:48, Francesco Abbate wrote: > I'm proud to announce the first developer release of GSL Shell, an > interactive interface that gives access to the GNU Scientific > Library (GSL). > There is also a draft of the documentation but still a lot of work > has to be > done. This is definitely interesting and I'll have a look. Does your plans involve completing and maintaining documentation? This'd be a huge pro and something that numlua is actually missing. -- Andrea From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 03:17:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n926HZcV007291; Fri, 2 Oct 2009 03:17:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2023A1A720; Fri, 2 Oct 2009 03:17:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56D4F1A600 for ; Fri, 2 Oct 2009 03:16:55 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtAAAAY3xUrLO8He/2dsb2JhbAAI1x6EKQSCJQ X-IronPort-AV: E=Sophos;i="4.44,492,1249228800"; d="scan'208";a="508618491" Received: from unknown (HELO [10.1.1.2]) ([203.59.193.222]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 02 Oct 2009 14:17:06 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: HTTP app architecture (was Re: What would _you_ like in a Lua CMS?) From: Jacques Chester In-Reply-To: <357A5CD8-A0A0-4970-956A-6E4D838651FB@gmail.com> Date: Fri, 2 Oct 2009 14:17:04 +0800 Content-Transfer-Encoding: 7bit Message-Id: References: <48b7e23a0909271304w3d628329t8f77788f629bbf18@mail.gmail.com> <4ABFF2CD.8060006@cowlark.com> <7FF560A4-42E3-4868-9907-E8A56630013E@gmail.com> <1B8D0F4D-09EA-4932-A922-321F03268FCF@chester.id.au> <9329F258-030C-4856-9075-CF973A7C4E52@gmail.com> <968FC46E-569D-4244-AC1E-2A0BCEC181D0@chester.id.au> <7913df4d0910010922m50d86743k2153c4173011b2db@mail.gmail.com> <0017A563-50D0-4E75-88B0-05D1F0AE16EE@chester.id.au> <357A5CD8-A0A0-4970-956A-6E4D838651FB@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 02/10/2009, at 1:09 AM, Petite Abeille wrote: > How are the exams coming along? :D I vanquished them, but apparently they just keep coming back. I expect to see 3 of them in November. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 03:34:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n926XxFJ008460; Fri, 2 Oct 2009 03:33:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 455CE1A710; Fri, 2 Oct 2009 03:33:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 271921A6CC for ; Fri, 2 Oct 2009 03:33:14 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n926XB2o022310; Fri, 2 Oct 2009 15:33:23 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay21.aps.necel.com with ESMTP; Fri, 2 Oct 2009 15:33:23 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay11.aps.necel.com with ESMTP; Fri, 2 Oct 2009 15:33:23 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id C627252E1F0; Fri, 2 Oct 2009 15:33:23 +0900 (JST) From: Miles Bader To: "Andrea D'Amore" Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> <8a25d01b0910011632k939536cp100cf33b3f5f934a@mail.gmail.com> <152212C6-A0BF-47BD-B026-AA33E686DDE0@gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 02 Oct 2009 15:33:23 +0900 In-Reply-To: <152212C6-A0BF-47BD-B026-AA33E686DDE0@gmail.com> (Andrea D'Amore's message of "Fri, 2 Oct 2009 08:11:27 +0200") Message-ID: Lines: 14 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andrea D'Amore writes: > Iirc Jay Freeman, author of Cydia, uses open source toolchains. The real > point is that not using XCode will make you miss a lot of facilities. Which ones? -Miles -- Mad, adj. Affected with a high degree of intellectual independence; not conforming to standards of thought, speech, and action derived by the conformants [sic] from study of themselves; at odds with the majority; in short, unusual. It is noteworthy that persons are pronounced mad by officials destitute of evidence that they themselves are sane. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 03:54:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n926s1hP009847; Fri, 2 Oct 2009 03:54:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F9421A675; Fri, 2 Oct 2009 03:53:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82D131A70F for ; Fri, 2 Oct 2009 03:53:17 -0300 (BRT) Received: by fxm12 with SMTP id 12so895948fxm.5 for ; Thu, 01 Oct 2009 23:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=n3qEppshzFku6LP/g5pO30lhnYyVjbJx0b/7rupPji0=; b=wGClUkaN/01hs8phaW4olFYjFMvxsKFuJm4ElrFRG/N/hJJBI2rzRrBS8v8UkOhrn3 EjDLAKTLP6mPYGQfLtlnLYsoK8dnt5mVB52zLOCBioW4U3J5Gi2WqEq+1js9y8ICpdug Tntj6ZHjpcyftqATzyes6Zwh0Gqo8LAhRRxFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NSdsRxa/nuDwN2Rlv9LESc8/qw3P/b+ysYVOQpOfFk9mpL01ofnVQ5jaF1e1iwqjnt yXK3SYheUid+kA5OCl3c8O4r2y94Z8xG+/mwqjMkLOviPgEgy8nBZihN+B0+mzYb4lqs nokLh0uqVN2jd2kzydsiO4Ku0MMte9vj5ilQU= MIME-Version: 1.0 Received: by 10.239.190.216 with SMTP id y24mr203866hbh.185.1254466409845; Thu, 01 Oct 2009 23:53:29 -0700 (PDT) In-Reply-To: <790db3550910011411t4d984655r8bfa9cccb6744891@mail.gmail.com> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <75cc17ac0910011357h64c46f59ha24eac1b70886d14@mail.gmail.com> <790db3550910011411t4d984655r8bfa9cccb6744891@mail.gmail.com> Date: Fri, 2 Oct 2009 08:53:29 +0200 Message-ID: <560972290910012353t498b4b00idc86bd611fce9c7d@mail.gmail.com> Subject: Re: IPhone Wax From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 1, 2009 at 11:11 PM, Patrick Donnelly wrote: > Yup!! http://code.google.com/p/android-scripting/wiki/LuaAndroidAPI I've seen this, and it does script common things. But then the question would be: Lua for doing interfaces? Android runs on a kind of Java, and there is JNI: http://android.wooyd.org/JNIExample/ So the quickest route would be something like LuaJava. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 07:04:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92A426c027922; Fri, 2 Oct 2009 07:04:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5991B1A6E2; Fri, 2 Oct 2009 07:03:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EEA6186C9 for ; Fri, 2 Oct 2009 07:03:03 -0300 (BRT) Received: by fxm12 with SMTP id 12so1029256fxm.5 for ; Fri, 02 Oct 2009 03:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kB5cUlgED4efOnJNayCL1/B9wXBipeuC1PNOhPpGrh4=; b=ErD7WMdTKLtflXkuzfjmtIr5W+q+PNvy0tkPAbFCz6wx4p349IFUK1uTlBwwVvoWM5 dl9YlJQQud8al98TYNtK4Yrxh9BIQQh6uCRUv1Y1OEiyaKa+2d7eVu8R7rMEpL9Z7ZZ9 r1sT/ynhUxtq4YFU9A6HSftv1cfi9q/OY/orc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=j2bNEisBOTqTHbTBznMbmSgjgv0CgqT5gZGtVGvo+uOVv2C47IUX9o5VI5nRT7cJPr SaOXU1TZ4oEVTz6zkVoRDxnK0a7FoUTI57JK4taLw34THcTZOjKufQP8FSXumB70uw3u TZ/n9gQKyAZ+Xq/Jh4Ds06E7ceb5bys68KoEk= MIME-Version: 1.0 Received: by 10.239.179.95 with SMTP id c31mr225323hbg.160.1254477796246; Fri, 02 Oct 2009 03:03:16 -0700 (PDT) In-Reply-To: <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> Date: Fri, 2 Oct 2009 12:03:16 +0200 Message-ID: <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> Subject: Re: GSL Shell software announcement From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 2, 2009 at 8:13 AM, Andrea D'Amore wrote: > Does your plans involve completing and maintaining documentation? This'd be > a huge pro and something that numlua is actually missing. Yes, I've held off playing with numlua for this very reason. There are lots of interesting goodies in the GSL, like polynomial fitting. I had to use numpy this morning to do this, and it was irritating. A suggestion: a wiki (perhaps not open for all to edit) might be a good idea to get documentation collaboration going. I am happy to do some proof-reading (such as replacing the string 'LUA' with the string 'Lua' ;)) but it's not clear how that could work. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 07:39:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92AdPKV030885; Fri, 2 Oct 2009 07:39:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EC451A6E6; Fri, 2 Oct 2009 07:38:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D1DD1A6DD for ; Fri, 2 Oct 2009 07:38:36 -0300 (BRT) Received: by fxm12 with SMTP id 12so1057550fxm.5 for ; Fri, 02 Oct 2009 03:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=NWG4yAuqrLcJp3OYWbaUSd10hhPLJ9IHwt1A7y4mBjI=; b=PJk/PgLErudPOylUWn3fw0hepa3wZg6e3bFpnW1x2sic1fGdUsnus/rpJV14/1VEN5 hFUA3WUNoVesLPTyCUkNioLpQxV0vLaL/aayDTWGE/jCKuVB7mCXsqSSiLp06Xp6w6dO AdQhSTEgH2JIpGNWJMv/jYcKp3l7ozaZ6ojOo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Rxt1x6ienZBIOoYpPtOpFQe/+GLz8IoMxo9nZwLfPc9gfYukSdvi2sGlw1Mndw2p/u h15iMD4zU/Tj2O0Tqk7Y1bI0u2K7PXNUDNWLo7doFQLYjPcb3NYOv2EgsZj1lbE85Gqv yKmJEuqcw1O0Hrlk/3rHQLv7bzglsOhODwD4A= MIME-Version: 1.0 Received: by 10.204.154.142 with SMTP id o14mr1044898bkw.125.1254479928941; Fri, 02 Oct 2009 03:38:48 -0700 (PDT) In-Reply-To: <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> Date: Fri, 2 Oct 2009 12:38:48 +0200 Message-ID: <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> Subject: Re: GSL Shell software announcement From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=0015175cae188aded10474f15e5e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cae188aded10474f15e5e Content-Type: text/plain; charset=ISO-8859-1 Hi all, talking about the documentation, of course I'm willing to extend and maintain it. It is one of my top priorities: I know that the documentation is *very* important for this kind of projects and this is the reason why I've made a lot of efforts to bring something from the beginning. The documentation system I'm using is with the reStructured Text and Sphinx. These are two excellent piece of software coming from the python guys. The format of the documentation is textual and it is very easy to read and maintain. There are a few conventions to follows but it is very easy to grasp. The wiki could be a good idea but I don't know how to set it up. Otherwise I still think that interested people can do a little effort and commit to the SVN repository a properly formatted .txt files. It is very easy for everyone to get in and it will assure an higher level of quality for the documentation. Francesco Yes, I've held off playing with numlua for this very reason. > > There are lots of interesting goodies in the GSL, like polynomial > fitting. I had to use numpy this morning to do this, and it was > irritating. > > A suggestion: a wiki (perhaps not open for all to edit) might be a > good idea to get documentation collaboration going. I am happy to do > some proof-reading (such as replacing the string 'LUA' with the string > 'Lua' ;)) but it's not clear how that could work. > > steve d. > --0015175cae188aded10474f15e5e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

talking about the documentation, of course I'm willing t= o extend and maintain it. It is one of my top priorities:
I know that th= e documentation is *very* important for this kind of projects and this is t= he reason why I've made a lot of efforts to bring something from the be= ginning.

The documentation system I'm using is with the reStructured Text an= d Sphinx. These are two excellent piece of software coming from the python = guys. The format of the documentation is textual and it is very easy to rea= d and maintain. There are a few conventions to follows but it is very easy = to grasp.

The wiki could be a good idea but I don't know how to set it up. Ot= herwise I still think that interested people can do a little effort and com= mit to the SVN repository a properly formatted .txt files. It is very easy = for everyone to get in and it will assure an higher level of quality for th= e documentation.

Francesco


Yes, I've held off playing with numlua for this very reason.

There are lots of interesting goodies in the GSL, like polynomial
fitting. =A0I had to use numpy this morning to do this, and it was
irritating.

A suggestion: a wiki (perhaps not open for all to edit) might be a
good idea to get documentation collaboration going. =A0I am happy to do
some proof-reading (such as replacing the string 'LUA' with the str= ing
'Lua' ;)) but it's not clear how that could work.

steve d.

--0015175cae188aded10474f15e5e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 08:35:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92BZmdK005173; Fri, 2 Oct 2009 08:35:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DFC718899; Fri, 2 Oct 2009 08:34:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03B1B18885 for ; Fri, 2 Oct 2009 08:34:51 -0300 (BRT) Received: by bwz22 with SMTP id 22so870905bwz.5 for ; Fri, 02 Oct 2009 04:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rqPHMl/k99qqzBbTB3ggmrSqB0S9cys4g1NyE4/WyNw=; b=bLn3H/DVgwGLwZf51I3FT08hMDrByTBvgiy84ckUZszHdUYAgxgPcysqoJxr7QiOF3 hV4WYnFfEAY5jlJZxeHh3rQXIhJUntcSG3+6yp+NBmBE75sf5W4MbqNQ4akofDQOS5Qo LubwNO7Mxyvhv7WHS34b9dIpY/XvCRu7f5QdE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=j5VmgKzVklemME4hTAqTB8BFV9xqYuxH2A3vwhpHedyRSar+hoHCJHwHzH0XMEAoJC JWIT7iw/11e58Vv0bvoXIScx6YgYd9G6jjKGpUzZPumCSrLS1s1X+TeImWT11VR3TYtd 6NEWuNHFry6bVkSvST2MaV7O23KOyN53GXLXM= MIME-Version: 1.0 Received: by 10.239.130.150 with SMTP id 22mr235564hbj.59.1254483301872; Fri, 02 Oct 2009 04:35:01 -0700 (PDT) In-Reply-To: <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> Date: Fri, 2 Oct 2009 13:35:01 +0200 Message-ID: <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> Subject: Re: GSL Shell software announcement From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 2, 2009 at 12:38 PM, Francesco Abbate wrote: > The wiki could be a good idea but I don't know how to set it up. Otherwise I > still think that interested people can do a little effort and commit to the > SVN repository a properly formatted .txt files. It is very easy for everyone > to get in and it will assure an higher level of quality for the > documentation. The doc source seems to be easy to edit. It's easy to build from source, but (as I said) you have to use the Lua includes packaged in the contained Lua source distribution, because of the LNUM patch. A few first impressions: 1) It would be cool if lgsl were available as a regular Lua module, but it does require a LNUM-complex patched Lua. Perhaps if it used something like lhf's lcomplex, it could be more generally used? 2) The contents of the math table are all made global (there is in fact no 'math' table anymore). OK, I can see the temptation, but most Lua users are now used to bringing in math functions they need from math. This will also bite you if you decide to override functions like exp() to work on vectors/matrices. (A fast map function would be useful, otherwise) 3) A general remark about namespaces; everything is in the global namespace, except when it isn't (like fft). Again, it is probably good practice to put global things like new() into a table like lgsl 4) Matrices are indexed beginning at zero, which was a little suprise! I know there are fierce wars about this, but having two conventions hanging around is not good. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 12:16:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92FGkoW017161; Fri, 2 Oct 2009 12:16:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA6581A697; Fri, 2 Oct 2009 12:15:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail14-a-ab.linkedin.com (mail14-a-ab.linkedin.com [64.74.98.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD54C1A67F for ; Fri, 2 Oct 2009 12:15:49 -0300 (BRT) DomainKey-Signature: s=prod; d=linkedin.com; c=nofws; q=dns; h=Sender:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type:X-LinkedIn-fbl; b=LUgKia9dWAko73n5HjjGKbAnc2YctapDNsj30uTvOKhm4OTsUl0/WqWR /lHBjhnvAFW+3qRAxQr/coWCVEkM0bowxQWnCF3JS1hz5PFHDezFjYqo2 oSUQ42pNCpm+4t5; Date: Fri, 2 Oct 2009 08:15:58 -0700 (PDT) From: Ivan Gagis To: Lua list Message-ID: <1830477561.1989745.1254496558641.JavaMail.app@ech3-cdn05.prod> Subject: Invitation to connect on LinkedIn MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1989744_1544375429.1254496558640" X-LinkedIn-fbl: vgBl6s0U3CZi8CkFmKbNRbiWA6ZLqhO-29_fYP5aWGZMqp8DX2dE1C X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_1989744_1544375429.1254496558640 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit LinkedIn ------------ Lua, I'd like to add you to my professional network on LinkedIn. - Ivan Accept Ivan Gagis's invite: https://www.linkedin.com/e/isd/774947001/UAyD-Zyz/ ------ (c) 2009, LinkedIn Corporation ------=_Part_1989744_1544375429.1254496558640 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

LinkedIn

Lua,

I'd like to add you to my professional network on LinkedIn.

- Ivan

Accept Ivan Gagis's invite:
https://www.linkedin.com/e/isd/774947001/UAyD-Zyz/

© 2009, LinkedIn Corporation

------=_Part_1989744_1544375429.1254496558640-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 12:34:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92FY6DF020259; Fri, 2 Oct 2009 12:34:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B592319183; Fri, 2 Oct 2009 12:33:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E56E019169 for ; Fri, 2 Oct 2009 12:33:15 -0300 (BRT) Received: by yxe37 with SMTP id 37so1269931yxe.33 for ; Fri, 02 Oct 2009 08:33:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.213.6 with SMTP id p6mr2938371anq.102.1254497605953; Fri, 02 Oct 2009 08:33:25 -0700 (PDT) In-Reply-To: <560972290910012353t498b4b00idc86bd611fce9c7d@mail.gmail.com> References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <75cc17ac0910011357h64c46f59ha24eac1b70886d14@mail.gmail.com> <790db3550910011411t4d984655r8bfa9cccb6744891@mail.gmail.com> <560972290910012353t498b4b00idc86bd611fce9c7d@mail.gmail.com> Date: Fri, 2 Oct 2009 11:33:25 -0400 X-Google-Sender-Auth: 665cf3ff7cec7590 Message-ID: <932071120910020833y66881164jeff36fbf8eebbe17@mail.gmail.com> Subject: Re: IPhone Wax From: Louis-Philippe To: Lua list Content-Type: multipart/alternative; boundary=001636c92fce2cab120474f57cbb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c92fce2cab120474f57cbb Content-Type: text/plain; charset=ISO-8859-1 What version of XCODE does Wax require?Development done on Intel only or Universal? L-P 2009/10/2 steve donovan > On Thu, Oct 1, 2009 at 11:11 PM, Patrick Donnelly > wrote: > > Yup!! http://code.google.com/p/android-scripting/wiki/LuaAndroidAPI > > I've seen this, and it does script common things. But then the > question would be: Lua for doing interfaces? Android runs on a kind of > Java, and there is JNI: > > http://android.wooyd.org/JNIExample/ > > So the quickest route would be something like LuaJava. > > > steve d. > --001636c92fce2cab120474f57cbb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What version of XCODE does Wax require?
Development done on Intel only = or Universal?

L-P

2009/10/2 steve donovan <steve.j.donovan@gmail.com>
On Thu, Oct 1, 2009 at 11= :11 PM, Patrick Donnelly <batric= k@batbytes.com> wrote:
> Yup!! http://code.google.com/p/android-scripting/wiki= /LuaAndroidAPI

I've seen this, and it does script common things. But then the question would be: Lua for doing interfaces? Android runs on a kind of
Java, and there is JNI:

http://a= ndroid.wooyd.org/JNIExample/

So the quickest route would be something like LuaJava.


steve d.

--001636c92fce2cab120474f57cbb-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 12:43:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92FhIhe021898; Fri, 2 Oct 2009 12:43:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D1E6191D6; Fri, 2 Oct 2009 12:42:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from webmail.f9e.com (webmail.f9e.com [207.170.252.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CD4219169 for ; Fri, 2 Oct 2009 12:42:27 -0300 (BRT) Received: from npbmail01.F9.internal ([10.8.0.25]) by webmail.f9e.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 2 Oct 2009 08:42:35 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA4376.F6C303B5" Subject: RE: Invitation to connect on LinkedIn Date: Fri, 2 Oct 2009 08:42:36 -0700 Message-ID: <586133FEA1374B4CBD88BE56C0D0DE3007C56E74@npbmail01.f9.internal> In-Reply-To: <1830477561.1989745.1254496558641.JavaMail.app@ech3-cdn05.prod> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Invitation to connect on LinkedIn Thread-Index: AcpDc0vfDsIvqcYHTHGEoAhUvosJRQAA5yHw References: <1830477561.1989745.1254496558641.JavaMail.app@ech3-cdn05.prod> From: "Brian Weed" To: "Lua list" X-OriginalArrivalTime: 02 Oct 2009 15:42:35.0904 (UTC) FILETIME=[F6C8D800:01CA4376] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA4376.F6C303B5 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable LOL =20 Brian =20 ________________________________ From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Ivan Gagis Sent: Friday, October 02, 2009 11:16 AM To: Lua list Subject: Invitation to connect on LinkedIn =20 LinkedIn Lua, I'd like to add you to my professional network on LinkedIn. - Ivan=20 Accept Ivan Gagis's invite: https://www.linkedin.com/e/isd/774947001/UAyD-Zyz/=20 (c) 2009, LinkedIn Corporation=20 =20 ------_=_NextPart_001_01CA4376.F6C303B5 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

LOL

 

Brian

 


From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Ivan Gagis
Sent: Friday, October 02, = 2009 11:16 AM
To: Lua list
Subject: Invitation to = connect on LinkedIn

 

LinkedIn

Lua,

I'd like to add you to my professional network on LinkedIn.

- Ivan

Accept Ivan Gagis's invite:
https://www.l= inkedin.com/e/isd/774947001/UAyD-Zyz/

© 2009, = LinkedIn Corporation

 

------_=_NextPart_001_01CA4376.F6C303B5-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 13:18:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92GIFps028154; Fri, 2 Oct 2009 13:18:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F7FE1A6DB; Fri, 2 Oct 2009 13:17:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 690BE1A697 for ; Fri, 2 Oct 2009 13:17:12 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id n92GHLeO011003 for ; Fri, 2 Oct 2009 18:17:21 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJfExUrDbohb/2dsb2JhbADYV4QsBA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 02 Oct 2009 18:17:21 +0200 Received: from [192.168.127.128] (host68-44-dynamic.41-79-r.retail.telecomitalia.it [79.41.44.68]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n92GHI2n076941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Oct 2009 18:17:21 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4AC6278C.5010304@erix.it> Date: Fri, 02 Oct 2009 18:17:16 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: IPhone Wax References: <20091001174340.A22884@lua.tecgraf.puc-rio.br> <90eb1dc70910011430t7a61e885ub8cf83b6c2a27997@mail.gmail.com> <4AC52334.8060005@bigpond.net.au> <8a25d01b0910011527o1338280fqd9ff2b2c64b1d393@mail.gmail.com> <4AC535F3.90506@bigpond.net.au> In-Reply-To: <4AC535F3.90506@bigpond.net.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Benjamin Tolputt wrote: > The commercial reality is that application development for the iPhone is a > decent niche for contract developers with the skills. Also, it looks to me like this could be the first real opportunity for an author to get paid royalties (meaning: something for each copy sold) since the tech publishing industry near-collapse at the end of the past century. I'm considering iPhone development, but I haven't reached a conclusion yet. The early "easy money" phase is clearly over, but there could be space for independent authors with original ideas. > Having Lua as a language one can use is a good thing, especially > when you can update on the fly to the device without the delay > of a complete recompile/resign/redeploy pipeline. It also depends on the license and on the degree of control given by the tool's maker. Should I start developing for iPhone, I'd probably write my own bindings just to be in full control of all code, but time-saving tools like iPhone Wax may be useful, as you said, for contract developers that are paid a fixed amount. As for Apple keeping strict control of the whole process, I think it may have some value: without this, the entire business model could collapse (for the authors, at least). On the other hand, I may be dead wrong here. We'll probably see by watching Android. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 13:53:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92GrVvr002542; Fri, 2 Oct 2009 13:53:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E043C1A6CD; Fri, 2 Oct 2009 13:52:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from csmail.ucc.ie (csmail.ucc.ie [143.239.75.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4117318A74 for ; Fri, 2 Oct 2009 13:52:44 -0300 (BRT) Received: from cs.ucc.ie (omega.ucc.ie [143.239.74.183]) by csmail.ucc.ie (Postfix) with SMTP id 8206D5C003; Fri, 2 Oct 2009 17:52:53 +0100 (BST) Received: by cs.ucc.ie (sSMTP sendmail emulation); Fri, 02 Oct 2009 17:52:52 +0100 From: "Joseph Manning" Date: Fri, 2 Oct 2009 17:52:52 +0100 To: lua@bazar2.conectiva.com.br Subject: 2016 Message-ID: <20091002165252.GE2363@cs.ucc.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Congratulations to Lua de Janeiro !!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 13:55:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92Gtcev002966; Fri, 2 Oct 2009 13:55:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45D961A6EE; Fri, 2 Oct 2009 13:55:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from spn-hub.lam-bull.com (mail.bull.com.br [200.245.144.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6C381A6DA; Fri, 2 Oct 2009 13:54:56 -0300 (BRT) To: Lua list Cc: lua@bazar2.conectiva.com.br, lua-bounces@bazar2.conectiva.com.br Subject: Re: 2016 MIME-Version: 1.0 X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 From: edson.mattos@lam-bull.com Message-ID: Date: Fri, 2 Oct 2009 13:58:26 -0300 X-MIMETrack: Serialize by Router on SPN-HUB/LAM/BULL(Release 5.0.13a |April 8, 2004) at 10/02/2009 01:59:16 PM, Serialize complete at 10/02/2009 01:59:16 PM Content-Type: multipart/alternative; boundary="=_alternative 005CFE3083257643_=" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multipart message in MIME format. --=_alternative 005CFE3083257643_= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable "N=F3s Ganhamos" "Joseph Manning" Sent by: lua-bounces@bazar2.conectiva.com.br 02/10/2009 13:52 Please respond to Lua list =20 To: lua@bazar2.conectiva.com.br cc:=20 Subject: 2016 Congratulations to Lua de Janeiro !!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --=_alternative 005CFE3083257643_= Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
"N=F3s Ganhamos"



"Joseph Manning" <ma= nning@cs.ucc.ie>
Sent by: lua-bounces@bazar2.conectiv= a.com.br

02/10/2009 13:52
Please respond to Lua list

       
        To: &nbs= p;      lua@bazar2.conectiva.com.br
        cc: &nbs= p;      
        Subject:=        2016



Congratulations to Lua de Janeiro != !!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--=_alternative 005CFE3083257643_=-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 13:59:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92Gx5d5003765; Fri, 2 Oct 2009 13:59:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 777951A6EF; Fri, 2 Oct 2009 13:58:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E5111A697 for ; Fri, 2 Oct 2009 13:58:23 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n92GwaQd027812 for ; Fri, 2 Oct 2009 13:58:36 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 083FD54C11D; Fri, 2 Oct 2009 13:58:37 -0300 (BRT) Date: Fri, 2 Oct 2009 13:58:37 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: 2016 Message-ID: <20091002165837.GA9445@inf.puc-rio.br> References: <20091002165252.GE2363@cs.ucc.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091002165252.GE2363@cs.ucc.ie> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Congratulations to Lua de Janeiro !!! Thanks! :) -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 14:01:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92H157S004496; Fri, 2 Oct 2009 14:01:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41A8A1A6F8; Fri, 2 Oct 2009 14:00:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f201.google.com (mail-yw0-f201.google.com [209.85.211.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC1C51A697 for ; Fri, 2 Oct 2009 14:00:22 -0300 (BRT) Received: by ywh40 with SMTP id 40so762221ywh.11 for ; Fri, 02 Oct 2009 10:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=8yHeiyfFzQlXGFRQt3VFEekBO46Elnt1eAbUe7hXNdE=; b=DoJjA4pDEQ9f3DGH+w2Z0PknA2Y5aOuYNvDhqvtXlCVOQLANLOO7n98sh1NoyyBFok hp9jgnnNrf2rWL8LlkvTid+1KQnRBStEChIv0+JxqhGnLu+1rRORBTeVUNs2H7DYclNy P/3OHtw0+gKstW2BbNbGk5Llikox8fFfEWIdI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SRKGw0rD24HnjO0vWD9UFlqW++rm850auB3Q3Fv9vG+7sycqGzLx5tBfSxmlFgyfyn ap54F5lWRPasi/c6Abrj+rn2j/Pm+004ecM3GpyBm1tWznmWKxO2ATCok51g1t2tk/+0 2wMI4+qRahluAFvat7Ih06Qqzkg+Eysb5RiBM= MIME-Version: 1.0 Received: by 10.90.11.30 with SMTP id 30mr1585185agk.42.1254502835623; Fri, 02 Oct 2009 10:00:35 -0700 (PDT) In-Reply-To: <20091002165837.GA9445@inf.puc-rio.br> References: <20091002165252.GE2363@cs.ucc.ie> <20091002165837.GA9445@inf.puc-rio.br> Date: Fri, 2 Oct 2009 14:00:35 -0300 Message-ID: <5d1dc4bb0910021000t3dad9283h185ad719796f4db4@mail.gmail.com> Subject: Re: 2016 From: Marinho Brandao To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n92H157S004496 gratz to Rio! :P 2009/10/2 Roberto Ierusalimschy : >> Congratulations to Lua de Janeiro !!! > > Thanks! :) > > -- Roberto > -- Marinho Brandão (José Mário) http://marinhobrandao.com/ From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 14:10:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92HAcmj006471; Fri, 2 Oct 2009 14:10:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BFA918D90; Fri, 2 Oct 2009 14:10:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f177.google.com (mail-pz0-f177.google.com [209.85.222.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE2A418D5E for ; Fri, 2 Oct 2009 14:09:51 -0300 (BRT) Received: by pzk7 with SMTP id 7so1175782pzk.33 for ; Fri, 02 Oct 2009 10:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tpk1vF+tc2x4L0khxksn5zG6SQaM7lW/q5tJdhPk3ag=; b=F0fnH59GCkK2K15CzT4kiRwO3PxXhSvWOTOUGwqeBZkoiYV3lQQj7WRXb0tjkYOSSF KWDUjSmWJQD7Rmaq16KzMgHXJMRk52AyMuFZB0WbQkm0+6tKU3t687esTaDY9kuzJgRX dDyeN+k7jLBrMwfRB/oPeXo/pMfhKDfgPMnxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hPZhyfiakyE8xxI9rhIYaSC9iiCCWyVF4lmszb3hf5KHeQXCULv8gN1OunraDgwyui DrjtJ5xoHt+ibVl4uhmn+eOjDxpz2fWKoZNqHr5S2TQXcKq3U26mXYj2tRqwb6xyclc7 NFKWyzU1rlV60EIPYDBQ/fMwAyofP3Is1/Npg= MIME-Version: 1.0 Received: by 10.142.5.25 with SMTP id 25mr378683wfe.80.1254503404640; Fri, 02 Oct 2009 10:10:04 -0700 (PDT) In-Reply-To: <4AC2DF5C.60208@infinite-interactive.com> References: <4AC06FFC.7010702@infinite-interactive.com> <20090928114802.GA4963@inf.puc-rio.br> <4AC2DF5C.60208@infinite-interactive.com> Date: Fri, 2 Oct 2009 10:10:04 -0700 Message-ID: <17eac67c0910021010q403b8e4dtb54a1edc12a2fd2f@mail.gmail.com> Subject: Re: Lua Test Code (and a C# porting question) From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Sep 29, 2009 at 9:32 PM, Mark Feldman wrote: > After behaviour, my secondary objective has been code maintainability...I've > generally kept the port line-by-line as close to the original code as > possible so that future patches and upgrades can be easily applied. > Unfortunately this strategy seriously affects performance, even with full > optimizations enabled. The original code makes judiscious use of the > template processor and since C# doesn't have a preprocessor these have had > to be replaced with static internal/private member functions, which is > exactly what you don't want in the type of performance-critical code that > it's being used for. Sometimes the C# optimizer performs well, often it > doesn't! Have you considered preprocessing the code with a macro processor? You keep the maintainability of the original source being close to final, and if avoiding function call overhead helps that much, you get the performance improvement. Sam From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 14:28:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92HSS7u010349; Fri, 2 Oct 2009 14:28:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D72B19109; Fri, 2 Oct 2009 14:27:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57AC7190F7 for ; Fri, 2 Oct 2009 14:27:32 -0300 (BRT) Received: by bwz22 with SMTP id 22so1202849bwz.5 for ; Fri, 02 Oct 2009 10:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=eSrMdnqzsOkDq+zyjuNHJLJYGwFMQDM2t/px0T4kyaI=; b=sAXxA3QXipnehyQezu/sdlqE+/pF+Lgy4PoClyLley7MYSmFBNWzHmJH7gYr4oNBkR 3tvfJjmGpFDvOLKZGRZJk8OqsAtujYPLQbLVfCyscwYknFrZO/ev1IupBnIAiwF7sowr BoA4e7VTpjeU+c/W4QlCDSsKC2H4dpCAr4Ts0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YdnehLxHqpCo9ovaa1QTLS3z2LX+EqZHtV188lEH5KWQrPIIxIXUKFLBUFCIvRYetG aSOv880fCzYHXgFun1W3BkLdpTbbBaCssd9eapTdfYCtIJKgfyQZqk9+EhtBHUO+Ljk+ hIv1Zpi34fy5SRlJ3zhqTBNU4BzNn2BuZXNOE= MIME-Version: 1.0 Received: by 10.239.139.32 with SMTP id r32mr278788hbr.86.1254504463945; Fri, 02 Oct 2009 10:27:43 -0700 (PDT) In-Reply-To: <5d1dc4bb0910021000t3dad9283h185ad719796f4db4@mail.gmail.com> References: <20091002165252.GE2363@cs.ucc.ie> <20091002165837.GA9445@inf.puc-rio.br> <5d1dc4bb0910021000t3dad9283h185ad719796f4db4@mail.gmail.com> Date: Fri, 2 Oct 2009 13:27:43 -0400 Message-ID: Subject: Re: 2016 From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n92HSS7u010349 Rio Wins Bid for 2016 Olympic Games! 2009/10/2 Marinho Brandao : > gratz to Rio! :P > > 2009/10/2 Roberto Ierusalimschy : >>> Congratulations to Lua de Janeiro !!! >> >> Thanks! :) >> >> -- Roberto >> > > > > -- > Marinho Brandão (José Mário) > http://marinhobrandao.com/ > From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 15:21:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92IL4Bl024048; Fri, 2 Oct 2009 15:21:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BE20191D6; Fri, 2 Oct 2009 15:20:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from n4a.bullet.mail.ac4.yahoo.com (n4a.bullet.mail.ac4.yahoo.com [76.13.13.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id 0CA3319109 for ; Fri, 2 Oct 2009 15:20:10 -0300 (BRT) Received: from [76.13.13.26] by n4.bullet.mail.ac4.yahoo.com with NNFMP; 02 Oct 2009 18:20:23 -0000 Received: from [67.195.9.82] by t3.bullet.mail.ac4.yahoo.com with NNFMP; 02 Oct 2009 18:20:22 -0000 Received: from [98.137.27.220] by t2.bullet.mail.gq1.yahoo.com with NNFMP; 02 Oct 2009 18:20:22 -0000 Received: from [127.0.0.1] by omp130.mail.gq1.yahoo.com with NNFMP; 02 Oct 2009 18:20:22 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 799098.6303.bm@omp130.mail.gq1.yahoo.com Received: (qmail 36256 invoked by uid 60001); 2 Oct 2009 18:20:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.br; s=s1024; t=1254507622; bh=M8+Gig8QAIyF4z2aYeqqW6Y0EFtCcRH0lwPGHOlGFp4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1w8RVT46j3UgHkeJDoGioNLds+8RgaTwTDw/ntUSNx9hZP6fOd2ck5H3XD1wBVzdwtIChd847QqVXVwE4bTbNlULDjQ+rzZdqaJtkadwG3anB0Q1rPOBiOUbJ1WZ3HRNMmNeVobwogX7f74KgxoHzle81jrmjs1wt5/vkwS0J7c= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=DnTwoE+/hU2kUfQLB9mr9S0dniVX5B1X2meeRmJ3lgghMRkaeFTQS+WOuNyvNxjr/FaiGGiSqr6dTExSI/JOP8Wz9phiC/Mw+ePOneMDz4Wt3YR5QRtQ9x324JUiqZsRR2oClxhHAoaTzoRPqNEyfVScBXwjaoyhf/j29Ps4f4c=; Message-ID: <522773.33023.qm@web112502.mail.gq1.yahoo.com> X-YMail-OSG: sT1226UVM1kRGLFwKsYhW87SHhsjnoQdlkK3MAU5yHGx8WhreJUCH5wNZyo7VMj3w45CIu9nhq2v4eUFVFNSymR5ym2GHssEg3dGKTzp7eQX4izEIkBcNfM6tTIpYV27ZZ8gMVJqkKtGSMZKFzihRyYB.ffJHGFvZtVgV6m8lv1Vexa1KDQhKAIauFFS7kTGBXfRkm.xRPngIFIBeTI1HJ9PewlHuuz.qN1vI5S.navNKwAr6u6uNcwZU7ePQCC0RtnHCKNCWFex5YhKoi89TIMQx10L6J0U.OC5O_iRmiOPHhzne177qXayEUT91QWugbTpk1UfLgaai7g_VFFom1_VaPj5Qr.hSIsjbRfNC1ISmJb6IImIWaFX7MwT5oFw1RRfOpau Received: from [128.221.197.53] by web112502.mail.gq1.yahoo.com via HTTP; Fri, 02 Oct 2009 11:20:22 PDT X-Mailer: YahooMailClassic/7.0.14 YahooMailWebService/0.7.347.3 Date: Fri, 2 Oct 2009 11:20:22 -0700 (PDT) From: Jose Marin Subject: Re: 2016 To: Lua list In-Reply-To: <20091002165837.GA9445@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n92IL4Bl024048 Please, I don't have the intent to make politics here, and this will be my only e-mail on this subject, but I would like to say my opinion: This could be an event to joy, but everybody that knows the reality of Brazil should be sad and worried, because this is another huge opportunity (like in the Pan American games) for bad politicians and contractors to make even more money, in a country with so many more important needs. This will be no good for the country. --- Em sex, 2/10/09, Roberto Ierusalimschy escreveu: > De: Roberto Ierusalimschy > Assunto: Re: 2016 > Para: "Lua list" > Data: Sexta-feira, 2 de Outubro de 2009, 13:58 > > Congratulations to Lua de > Janeiro !!! > > Thanks! :) > > -- Roberto > ____________________________________________________________________________________ Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 15:38:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92IcR4C027820; Fri, 2 Oct 2009 15:38:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2519619182; Fri, 2 Oct 2009 15:37:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E44818D35 for ; Fri, 2 Oct 2009 15:37:45 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n92Ibw7v027729 for ; Fri, 2 Oct 2009 15:37:58 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n92Ibvv27379; Fri, 2 Oct 2009 15:37:57 -0300 Date: Fri, 2 Oct 2009 15:37:57 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: 2016 Message-ID: <20091002153757.A27376@lua.tecgraf.puc-rio.br> References: <20091002165837.GA9445@inf.puc-rio.br> <522773.33023.qm@web112502.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <522773.33023.qm@web112502.mail.gq1.yahoo.com>; from jose_marin2@yahoo.com.br on Fri, Oct 02, 2009 at 11:20:22AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Please, I don't have the intent to make politics here So, please, let's drop this subject. From lua-bounces@bazar2.conectiva.com.br Fri Oct 2 23:45:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n932jeuQ031510; Fri, 2 Oct 2009 23:45:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 645A518CA1; Fri, 2 Oct 2009 23:44:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78DE918BD6 for ; Fri, 2 Oct 2009 23:44:22 -0300 (BRT) Received: by fxm12 with SMTP id 12so1788148fxm.5 for ; Fri, 02 Oct 2009 19:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=z9z4iXlnX71G0tmjSndPY6jN0nox8EJnveiDfetxzvE=; b=QZFRiogD43P8kOjuxnyakbPRYmO7/N7tsWbmBNCgobGaiI9hm6CD/fCOPF/R3rvw4W FHGjW8ctEIrDqygH7vN6V+1IbBKYXamIMlNFrnEXHZ7POHbwrA9lgB83Ug2GdfnvRBR6 qYpZwv2gOjTbXw/6QjRWaRL1n3Bfpsxgn2SMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=OIF1+WWBoC8ky13yjTlLYZTL940yDz22uWTCZUk5HKpDFkg3gonhAfggVxP8aGqrzr for+XXXmGWSOPsJKnHqe2y8z1znUmeUvOBVWhX9KiG8S5rqJU9s7hrcurO3iB41yB7Pw SWUsji8cTqYkci2FGxqb/tuPk1cFG+QfQLiWc= MIME-Version: 1.0 Received: by 10.223.14.215 with SMTP id h23mr1294707faa.59.1254537897163; Fri, 02 Oct 2009 19:44:57 -0700 (PDT) From: Leaf Storm Date: Fri, 2 Oct 2009 22:44:37 -0400 Message-ID: Subject: Begin/End Proposal To: Lua List Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In a recent thread [1], I brought up the concept of a 'begin' keyword that can be used to create anonymous, argument-less functions. I refined the idea a bit, and wrote a proposal. You can check it out on the wiki at http://lua-users.org/wiki/BeginEndProposal - feel free to comment and share your concerns. [1] http://lua-users.org/lists/lua-l/2009-09/msg00793.html -- Regards, Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 00:04:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9334bWJ001077; Sat, 3 Oct 2009 00:04:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B29019172; Sat, 3 Oct 2009 00:03:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21EC4190FC for ; Sat, 3 Oct 2009 00:03:33 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93349oj001046 for ; Sat, 3 Oct 2009 00:04:09 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93348u28830; Sat, 3 Oct 2009 00:04:08 -0300 Date: Sat, 3 Oct 2009 00:04:07 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Begin/End Proposal Message-ID: <20091003000407.A28827@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from leafstormrush@gmail.com on Fri, Oct 02, 2009 at 10:44:37PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > In a recent thread [1], I brought up the concept of a 'begin' keyword > that can be used to create anonymous, argument-less functions. Here a token filter in C that does that. Enjoy. /* * proxy.c * lexer proxy for Lua parser -- implements 'begin' as sugar for 'function ()'. * Luiz Henrique de Figueiredo * 02 Oct 2009 23:59:54 * This code is hereby placed in the public domain. * Add <<#include "proxy.c">> just before the definition of luaX_next in llex.c */ #include static int nexttoken(LexState *ls, SemInfo *seminfo) { static int state=0; int t; if (state==1) { state=2; return '('; } else if (state==2) { state=0; return ')'; } t=llex(ls,seminfo); if (t==TK_NAME && strcmp(getstr(seminfo->ts),"begin")==0) { t=TK_FUNCTION; state=1; } return t; } #define llex nexttoken From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 00:14:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n933EpF5001791; Sat, 3 Oct 2009 00:14:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0ED29192B7; Sat, 3 Oct 2009 00:13:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A9FA191F2 for ; Sat, 3 Oct 2009 00:13:50 -0300 (BRT) Received: by iwn8 with SMTP id 8so911285iwn.33 for ; Fri, 02 Oct 2009 20:14:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.26.131 with SMTP id e3mr6686312ibc.0.1254539666378; Fri, 02 Oct 2009 20:14:26 -0700 (PDT) Date: Fri, 2 Oct 2009 23:14:26 -0400 X-Google-Sender-Auth: 35908115963050d0 Message-ID: Subject: haxe -> lua compiler From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just want to bring this to attention. caffeine-hx [1] contains what appears to be an experimental version of haXe [2] supporting compiling haXe sources to Lua. It is under /trunk/projects/compiler . In particular, the translator for Lua is implemented in genhllua.ml [3], an OCaml file. There's some brief notes by the author [4] stating that he resorted to patching [5] Lua 5.1.3 (a.k.a. "halelua") to support bitwise opcodes. On examination, the patch also contains a try/catch/finally extension [6]. (Sidenote: there have been serious proposals for similar functionality in Lua 5.2.) Although halelua builds fine, I didn't get their customized haXe to compile here. There was some error about common.ml being missing. That file does exist in the haXe mainline, but even after adding it, I then get an error about File "parser.ml", line 302, characters 27-28: Parse error: [stream_patt_comp_err_list] expected after ";" (in [stream_patt]). As said [3], the project is currently dormant unless others have interest in it. I brought this up due to some of the recent discussions of porting Lua to other languages (e.g. C# and Java). Machine translating the Lua C sources to other languages is likely not practical without introducing a lot of cruft due to the explicitness of C (e.g. what does this void pointer represent?). However, I think it's more achievable if one first manually translates to some intermediate form X that is more amenable to machine translation. Something like haXe might be that intermediate form. One one occasion, I used m4 for X, so that, for example, METHOD_CALL(object, name) would expand to object.name() when generating C++ and $object->name() when generating Perl. Lisp may have been more suitable. [1] http://code.google.com/p/caffeine-hx [2] http://haxe.org/doc/intro [3] http://code.google.com/p/caffeine-hx/source/browse/trunk/projects/compiler/haxe/genhllua.ml [4] http://lists.motion-twin.com/pipermail/haxe/2009-March/023386.html [5] http://code.google.com/p/caffeine-hx/source/browse/#svn/trunk/projects/halelua [6] http://code.google.com/p/caffeine-hx/source/browse/trunk/projects/halelua/stdlib/HLLString.lua#81 From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 00:48:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n933m28m005387; Sat, 3 Oct 2009 00:48:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91E53192C8; Sat, 3 Oct 2009 00:46:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64FA5192A6 for ; Sat, 3 Oct 2009 00:46:53 -0300 (BRT) Received: by iwn8 with SMTP id 8so917989iwn.33 for ; Fri, 02 Oct 2009 20:47:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.4.149 with SMTP id 21mr6701250ibr.26.1254541648500; Fri, 02 Oct 2009 20:47:28 -0700 (PDT) In-Reply-To: <20091003000407.A28827@lua.tecgraf.puc-rio.br> References: <20091003000407.A28827@lua.tecgraf.puc-rio.br> Date: Fri, 2 Oct 2009 23:47:28 -0400 X-Google-Sender-Auth: afe37198d610017e Message-ID: Subject: Re: Begin/End Proposal From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 2, 2009 at 11:04 PM, Luiz Henrique de Figueiredo wrote: >> In a recent thread [1], I brought up the concept of a 'begin' keyword >> that can be used to create anonymous, argument-less functions. > > Here a token filter in C that does that. Enjoy. ...except for adding the parenthesis, which likely requires keeping track of the nesting levels to know when to inject the terminal ")" : prefixexp begin ..... end --> prefixexp ( function() ..... end ) prefixexp : Name begin ..... end --> prefixexp : Name ( function() ..... end ) This is related to the "do patch" [2], which is one solution to the short anonymous functions problem [2]. However, using "do" for your keyword leads to an ambiguity if you also allow omission of parenthesis: "f () do end" could be one statement or two. [1] http://lua-users.org/wiki/LuaPowerPatches [2] http://lua-users.org/wiki/ShortAnonymousFunctions From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 01:30:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n934UkNn008617; Sat, 3 Oct 2009 01:30:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3F911191D6; Sat, 3 Oct 2009 01:29:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1D50183AC for ; Sat, 3 Oct 2009 01:29:35 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4AACZwxkrLO8He/2dsb2JhbAAI1AiELASCKA X-IronPort-AV: E=Sophos;i="4.44,498,1249228800"; d="scan'208";a="508811854" Received: from unknown (HELO [10.1.1.2]) ([203.59.193.222]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 03 Oct 2009 12:30:08 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: Begin/End Proposal From: Jacques Chester In-Reply-To: Date: Sat, 3 Oct 2009 12:30:07 +0800 Content-Transfer-Encoding: 7bit Message-Id: <3A74D393-3446-4178-A5AF-3330521520B6@chester.id.au> References: To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 03/10/2009, at 10:44 AM, Leaf Storm wrote: > In a recent thread [1], I brought up the concept of a 'begin' keyword > that can be used to create anonymous, argument-less functions. How does it capture the environment? Basically, is it a proper closure? Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 04:34:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n937YMKS022646; Sat, 3 Oct 2009 04:34:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90B9818D03; Sat, 3 Oct 2009 04:33:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4684C187DB for ; Sat, 3 Oct 2009 04:33:06 -0300 (BRT) Received: by iwn8 with SMTP id 8so956681iwn.33 for ; Sat, 03 Oct 2009 00:33:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.24.210 with SMTP id w18mr3969053ibb.34.1254555220751; Sat, 03 Oct 2009 00:33:40 -0700 (PDT) In-Reply-To: <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> Date: Sat, 3 Oct 2009 03:33:40 -0400 X-Google-Sender-Auth: f5a97cea8d72d182 Message-ID: Subject: Re: GSL Shell software announcement From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n937YMKS022646 On Fri, Oct 2, 2009 at 7:35 AM, steve donovan wrote: > 1) It would be cool if lgsl were available as a regular Lua module, > but it does require a LNUM-complex patched Lua.  Perhaps if it used > something like lhf's lcomplex, it could be more generally used? The LNUM stuff is causing some deployment hurdles on LuaDist. We can probably handle the patched Lua, but then we run into the issue that while MinGW provides complex.h, Cygwin and MSVC do not. It would be nice to have a switch to turn that off. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 07:31:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93AVaUv003201; Sat, 3 Oct 2009 07:31:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7A0719051; Sat, 3 Oct 2009 07:30:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78C2B18FC9 for ; Sat, 3 Oct 2009 07:30:21 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93AUvqc003162 for ; Sat, 3 Oct 2009 07:30:57 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93AUuV30227; Sat, 3 Oct 2009 07:30:56 -0300 Date: Sat, 3 Oct 2009 07:30:55 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Begin/End Proposal Message-ID: <20091003073055.A30219@lua.tecgraf.puc-rio.br> References: <20091003000407.A28827@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Fri, Oct 02, 2009 at 11:47:28PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > ...except for adding the parenthesis, which likely requires keeping > track of the nesting levels to know when to inject the terminal ")" : The OP said "anonymous, argument-less functions". Anyway, I don't see how "begin --> function ()" needs keeping track of nesting. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 07:32:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93AW0Gx003274; Sat, 3 Oct 2009 07:32:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 326BA190D1; Sat, 3 Oct 2009 07:30:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B10B1908D for ; Sat, 3 Oct 2009 07:30:48 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93AVOOd003188 for ; Sat, 3 Oct 2009 07:31:24 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93AVNX30233; Sat, 3 Oct 2009 07:31:23 -0300 Date: Sat, 3 Oct 2009 07:31:23 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Begin/End Proposal Message-ID: <20091003073123.B30219@lua.tecgraf.puc-rio.br> References: <3A74D393-3446-4178-A5AF-3330521520B6@chester.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3A74D393-3446-4178-A5AF-3330521520B6@chester.id.au>; from jacques@chester.id.au on Sat, Oct 03, 2009 at 12:30:07PM +0800 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > How does it capture the environment? Basically, is it a proper closure? With token filtering, sure. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 07:53:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93ArvlS004911; Sat, 3 Oct 2009 07:53:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A672018A0C; Sat, 3 Oct 2009 07:52:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A09721903D for ; Sat, 3 Oct 2009 07:52:53 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so335806eye.39 for ; Sat, 03 Oct 2009 03:53:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.30.72 with SMTP id j50mr588111wea.5.1254567209406; Sat, 03 Oct 2009 03:53:29 -0700 (PDT) In-Reply-To: <20091003073055.A30219@lua.tecgraf.puc-rio.br> References: <20091003000407.A28827@lua.tecgraf.puc-rio.br> <20091003073055.A30219@lua.tecgraf.puc-rio.br> Date: Sat, 3 Oct 2009 11:53:29 +0100 X-Google-Sender-Auth: c092f2ec53383be9 Message-ID: Subject: Re: Begin/End Proposal From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 3, 2009 at 11:30 AM, Luiz Henrique de Figueiredo wrote: > The OP said "anonymous, argument-less functions". > Anyway, I don't see how "begin --> function ()" needs keeping track of nesting. The proposal has two main components (IMO): 1) The transformation of "begin" to "function()" (though I'd argue that a transformation to "function(...)" would be more useful (and wouldn't break anything), as then argument(s) can be accessed if so desired). 2) An extension of the parenthesis-less function call mechanic currently applicable to string and table arguments, to make it also work with functions arguments. Doing this with a token filter requires knowledge of when to inject parenthesis. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 08:19:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93BJqct006978; Sat, 3 Oct 2009 08:19:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF4D019178; Sat, 3 Oct 2009 08:18:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64A21190A3 for ; Sat, 3 Oct 2009 08:18:48 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LdGzR-1MTTFj0V8r-00iGqe; Sat, 03 Oct 2009 07:19:24 -0400 Message-ID: <8824D6B7DB1C423381E06C94D2D81A42@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <4AC12E8C.6040201@bigpond.net.au> In-Reply-To: <4AC12E8C.6040201@bigpond.net.au> Subject: Re: Transparent shallow copy of tables Date: Sat, 3 Oct 2009 04:19:02 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19erT9i+0ZwUutub66O/yBKf5sabHTy1xDz1tZ 9e8aKob48naTuhy1cH43N/7dHS97s51xSSDzlvlEWuz19B4swA qvDQO8zLVO4+3Yul1zgI/4GBDpf/DpU X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The use case is to have a hierarchical series of sandbox environments, each deriving from the last. -------------------------------------------------- From: "Benjamin Tolputt" Sent: Monday, September 28, 2009 P2:45 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Transparent shallow copy of tables > Stuart P.Bentley wrote: >> How can I do a shallow copy of a table that operates identically to >> the original? Currently I'm setting tables to be empty tables with >> metatables that save deletions and create similar shallow copies on >> index access, but this is causing problems with functions like >> table.concat(). >> >> I'd prefer to avoid a deep copy if possible, since that would take a >> long time regardless of access depth. > > This sounds like an idea I had for the capability to commit or roll-back > changes to process state as a form of transactional memory. The issue is > that this would need to be applied to all tables Lua constructed, which > would necessarily slow down the system (too much?). > > What is the use case for this? > > -- > Regards, > > Benjamin Tolputt > Analyst Programmer > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 08:20:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93BKSDJ007089; Sat, 3 Oct 2009 08:20:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68802192B7; Sat, 3 Oct 2009 08:19:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f201.google.com (mail-yw0-f201.google.com [209.85.211.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C555190A3 for ; Sat, 3 Oct 2009 08:19:26 -0300 (BRT) Received: by ywh40 with SMTP id 40so1457666ywh.11 for ; Sat, 03 Oct 2009 04:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=VQ82oEm8GJsvsz474jAwfr5fpoLWtrQRFbZHExNpA0E=; b=nqNH5PiwdFmcgQvBXczE4vW68wFji7dtHhGEqCMt3oabAbt/HcjPSun+cAnjPnjD51 sMeiGJe0IQ4P1jIS8ofcXW3ROew2wjE+F0JXvKUBr5L79Khx2MApBLgbB5WOmG1cHJa5 p47/llRvN9hr8wXVIeALgEvIS/BGfK+NLodug= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=LtoJIeFy8cvqUgHfHm4AR1KvbvHBlJPRJuzNIeCOssgzAp+3c9dlyFl2fZQp6CtLmh w/Jn/ITTGDs4Bv7H6Z7G0LakPGq8yQlaAGX/OxNz0xSuEfECPkFmyU/exl30Y6+T4j6j LtBw8HJtyaL8K4QdaPwc5C87soXvkTXai+WyQ= MIME-Version: 1.0 Received: by 10.101.166.10 with SMTP id t10mr3810527ano.143.1254568801629; Sat, 03 Oct 2009 04:20:01 -0700 (PDT) Date: Sat, 3 Oct 2009 12:20:01 +0100 Message-ID: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> Subject: xavante and mercury From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, All. Just wanted to share something I recently found -- Mercury, a Sinatra like framework for Lua [http://github.com/nrk/mercury] I am using it with Xavante (without everything else from Kepler) and using the script from Fabio Mascarenhas [http://lua-users.org/lists/lua-l/2009-09/msg00780.html] to launch the web application. I think it is minimal and nice. I have my own webapp (a single Lua file), mercury.lua and the launcher script from the above email in a directory and using the script to launch the app. I hope, Daniele, includes the launcher script as it is a great script for quick start and for use during development. Great stuff from every one! Thank you. Ashish From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 09:37:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93Cbfeo012940; Sat, 3 Oct 2009 09:37:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26EBB190A3; Sat, 3 Oct 2009 09:36:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03C4E18FC9 for ; Sat, 3 Oct 2009 09:36:32 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0LoWW2-1MR4xe05xy-00g0GX; Sat, 03 Oct 2009 08:37:06 -0400 Message-ID: <957BC3EF44E34B24A1907F8B0C13701A@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com><4ABA8A13.2050202@spellingbeewinnars.org> <4ABAD518.4050904@comcast.net> In-Reply-To: <4ABAD518.4050904@comcast.net> Subject: Re: Lua for GUI toolkit wrapping? Date: Sat, 3 Oct 2009 05:36:45 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+73ldq9JoS+HdkDsDM9h2BnmMe1AUrg1Z4wTw m5EneupXiOtqcoYOo1U0eavojd9dBw9E6lmVutzw/QsDf+hoGv HhMojl5jI2rEbcJ/5rNrPlRfTfPWvdM X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm personally a huge fan of IUP. As stated, it's practically made for Lua (it's a Tecgraf project that was hosted on LuaForge for years). It's also hugely platform-independent (it's implemented natively on Windows, then in GTK for GNOME, KDE, and OS X, then in Motif for pretty much anything else), and very simple and flexible (a virtue of its Lua-paralleling design). http://www.tecgraf.puc-rio.br/iup/ -------------------------------------------------- From: "Merick" Sent: Wednesday, September 23, 2009 P7:10 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua for GUI toolkit wrapping? > Patrick wrote: >>> probably you are saying about different things - Qt itself and Qt/Lua >>> binding >>> >> >> Absolutely. I am not criticizing QT or any other toolkit, I am just >> wondering if I am going in the wrong direction. I would like to use Lua >> with GTK in particular but I am second guessing myself because there >> seems like quite a small community around it. I can't understand why? >> Why would anyone want to code a GUI in C/C++ if they had something like >> Lua? >> >> >> > IUP uses GTK, and was practically built for Lua: > http://www.tecgraf.puc-rio.br/iup/ > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 09:45:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93Cj8Vb013502; Sat, 3 Oct 2009 09:45:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C275192C0; Sat, 3 Oct 2009 09:44:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3338519198 for ; Sat, 3 Oct 2009 09:44:08 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mu3yb-0002S2-JN for lua@bazar2.conectiva.com.br; Sat, 03 Oct 2009 14:44:41 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Oct 2009 14:44:41 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Oct 2009 14:44:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Lua t-shirts Date: Sat, 3 Oct 2009 05:43:36 -0700 Lines: 6 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My dad is going down to Rio in November for a project with Petrobras and has stated that he'll see if he can score a Tecgraf t-shirt while he's down there. I was wondering, are there any T-shirts or the like for Lua? From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 09:56:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93Cuacp014389; Sat, 3 Oct 2009 09:56:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A32D192C5; Sat, 3 Oct 2009 09:55:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C3C91909A for ; Sat, 3 Oct 2009 09:55:33 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93Cu9pZ014354 for ; Sat, 3 Oct 2009 09:56:09 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93Cu8C30576; Sat, 3 Oct 2009 09:56:08 -0300 Date: Sat, 3 Oct 2009 09:56:08 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091003095608.A30565@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from stuart@testtrack4.com on Sat, Oct 03, 2009 at 05:43:36AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > My dad is going down to Rio in November for a project with Petrobras and has > stated that he'll see if he can score a Tecgraf t-shirt while he's down > there. I'm actually wearing a Tecgraf t-shirt right now :-) but I don't think there are any left. I'll ask around.` > I was wondering, are there any T-shirts or the like for Lua? The Lua store seems to be still open: http://www.cafepress.com/lualang/ From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 10:01:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93D1cRL014915; Sat, 3 Oct 2009 10:01:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17FA9192DC; Sat, 3 Oct 2009 10:00:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF9551909A for ; Sat, 3 Oct 2009 10:00:32 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93D15mO014836 for ; Sat, 3 Oct 2009 10:01:08 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93D15R30597; Sat, 3 Oct 2009 10:01:05 -0300 Date: Sat, 3 Oct 2009 10:01:04 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua for GUI toolkit wrapping? Message-ID: <20091003100104.B30565@lua.tecgraf.puc-rio.br> References: <4ABA0FF8.80405@spellingbeewinnars.org> <4ABA7209.5060904@spellingbeewinnars.org> <175419923.20090923231225@gmail.com><4ABA8A13.2050202@spellingbeewinnars.org> <4ABAD518.4050904@comcast.net> <957BC3EF44E34B24A1907F8B0C13701A@Stucomet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <957BC3EF44E34B24A1907F8B0C13701A@Stucomet>; from stuart@testtrack4.com on Sat, Oct 03, 2009 at 05:36:45AM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm personally a huge fan of IUP. As stated, it's practically made for Lua Too bad Lua was created one year after IUP and LED. There would be no LED and IUP would probably be simpler. From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 10:04:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93D4PLo015179; Sat, 3 Oct 2009 10:04:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD78F192E9; Sat, 3 Oct 2009 10:03:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bitdojo.org (bitdojo.org [200.46.204.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2F721909A for ; Sat, 3 Oct 2009 10:03:22 -0300 (BRT) Received: from localhost (unknown [200.46.208.211]) by bitdojo.org (Postfix) with ESMTP id A74E7E0AA1C for ; Sat, 3 Oct 2009 13:03:57 +0000 (UTC) Received: from bitdojo.org ([200.46.204.210]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 39982-06 for ; Sat, 3 Oct 2009 13:03:49 +0000 (UTC) Received: from localhost (wm.hub.org [200.46.204.128]) by bitdojo.org (Postfix) with ESMTP id 25765E0A5C5 for ; Sat, 3 Oct 2009 13:03:57 +0000 (UTC) Received: from ip70-187-236-17.dc.dc.cox.net (ip70-187-236-17.dc.dc.cox.net [70.187.236.17]) by webmail.bluedino.net (Horde Framework) with HTTP; Sat, 03 Oct 2009 13:03:57 +0000 Message-ID: <20091003130357.91631zn9rwmnvoal@webmail.bluedino.net> Date: Sat, 03 Oct 2009 13:03:57 +0000 From: matthew@bluedino.net To: lua@bazar2.conectiva.com.br Subject: Re: Lua t-shirts References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-7.1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Quoting "Stuart P.Bentley" : > I was wondering, are there any T-shirts or the like for Lua? http://shop.cafepress.com/sk/lualang/s_lua_666 And for the discerning Lua enthisiast who also uses Second Life, I have designed a virtual version for your avatar (although I am embarrassed to admit it). Matt From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 10:11:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93DBLq1016172; Sat, 3 Oct 2009 10:11:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18742192F7; Sat, 3 Oct 2009 10:10:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F142719288 for ; Sat, 3 Oct 2009 10:10:06 -0300 (BRT) Received: by fxm12 with SMTP id 12so1974699fxm.5 for ; Sat, 03 Oct 2009 06:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qLqbQ9ZydBMrBPwd2PUpmNXUcRnuUSRv8aaN7kXNv4M=; b=Aw/qMkh2dJAQH1Fl2k6Alk8Parp/BZwFZqev5Fgn9ZPJVh+LoNaaheWifD4xFZLVK3 5fCw+IZOXdCq2sTGKdFmNuSPVn7WkE93O+DsARkO4IXNGJXohWQnL3EvpfzW8zHPvnqf MmunLcCL2W4vNxi5OcLh81e7y4Mx1i5IDjkXU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=F7+rlB8tjBLUZ12J5TXGZIuLt/m5XXFD5sXEJzfMbRjC+ivpap1qaU3DuWCb72Eiz9 DAEBV8NPPWLxM9otO1dcivDddJUKGmcfB2I7SejhNMoRzy8xHqRc9Fjvxnou1DKjUzPf uO5oKnJtJ/fiDsc7h34ZezSf4k5wtHkwwt/R0= MIME-Version: 1.0 Received: by 10.204.153.220 with SMTP id l28mr2108862bkw.86.1254575442779; Sat, 03 Oct 2009 06:10:42 -0700 (PDT) In-Reply-To: <20091003095608.A30565@lua.tecgraf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> Date: Sat, 3 Oct 2009 15:10:42 +0200 Message-ID: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> Subject: Re: Lua t-shirts From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n93DBLq1016172 > The Lua store seems to be still open: >        http://www.cafepress.com/lualang/ > Cool, now i know what i want for christmas =D Still open? Is it going to close anytime soon? In that case i'd have to buy one myself and not wait for xmas..? =) /Pierre From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 10:18:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93DIDNN016598; Sat, 3 Oct 2009 10:18:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD7FB19319; Sat, 3 Oct 2009 10:17:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B9EB19288 for ; Sat, 3 Oct 2009 10:17:13 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n93DHnXb010968 for ; Sat, 3 Oct 2009 10:17:49 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 40D4854C11D; Sat, 3 Oct 2009 10:17:50 -0300 (BRT) Date: Sat, 3 Oct 2009 10:17:50 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091003131750.GA13263@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > The Lua store seems to be still open: > >        http://www.cafepress.com/lualang/ > > > Cool, now i know what i want for christmas =D > Still open? Is it going to close anytime soon? In that case i'd have > to buy one myself and not wait for xmas..? =) No, I do not think it is going to close. "Still open" means "still open since the last time we checked. We set that store many years ago and collect no money from the sales (all stuff is sold by the basic price), so we seldom log in. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 10:52:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93DqFEe019544; Sat, 3 Oct 2009 10:52:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6855119317; Sat, 3 Oct 2009 10:51:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76FC6192E0 for ; Sat, 3 Oct 2009 10:51:05 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0LxhcB-1MHwxd1PND-016e1o; Sat, 03 Oct 2009 09:51:41 -0400 Message-ID: <4FFE63AF1D984E1DA4BBE0B94780B624@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> In-Reply-To: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> Subject: Re: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) Date: Sat, 3 Oct 2009 06:50:50 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1/M4f0l4fVLcQYj5hwweikBA6BXcgWQbHTiMGj MOhtbCvUNE+EXQPWlnLEgjx/LLvbUAc6IbEQY1Mbj6OuJlnhnN eyuK3wP4s5Rl3HcxSed4cs/oDEi1PWI X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Funny you should say that- Programming in Lua actually *is* next to K&R on my bookshelf. Personally, I don't see what Programming in Lua lacks as an introduction for beginners to programming. It doesn't spend pages explaining what "functions" and "variables" are, but they aren't very difficult concepts to grasp (especially if you've already got algebra experience). -------------------------------------------------- From: "steve donovan" Sent: Wednesday, September 23, 2009 A12:12 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) > On Tue, Sep 22, 2009 at 8:43 PM, Florian Weimer wrote: >> I think the main criterion is availability of introductory texts. >> Without that, creating a course will be a lot of work. (I found >> Programming in Lua an extremely inspiring read, but it's probably not >> that helpful to absolute beginners.) > > Yes, I would put it on my bookshelf next to K & R, in terms of > clarity. But K & R is not an introductory text either ;) > > There are other Lua books (often in the games context); are they > better at introductions? Is there a niche here for a good > introduction? I've written & published a book, it was a great > experience, but there would have to be readers ;) > >> But the default, non-strict mode would be unnecessarily >> confusing, I fear. > > You mean misspellings being new global variables? Yes, strict.lua is a > great little tool. > > Interactivity is a big, big plus, because it allows for an almost > conversational mode of language learning. Whether all people learn > PLs better in conversational mode I don't know, but it certainly works > for a lot of people. > > steve d. > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 11:18:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93EICdX021740; Sat, 3 Oct 2009 11:18:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECC031916D; Sat, 3 Oct 2009 11:17:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A865618F02 for ; Sat, 3 Oct 2009 11:17:08 -0300 (BRT) Received: by ewy26 with SMTP id 26so1777664ewy.5 for ; Sat, 03 Oct 2009 07:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=IDRZto8Uc9ujCRXZmuxpZsBd/un496YgzXJ9WhOD9eA=; b=MX1MijkXcj5xZNTR7Rf8N/VATqKqxAC+FdfDP2xn06rwTFlfLCxSiyocPW7tqxlDEk UHdGOZeTrwJC/9Xdwsgnu67aqoKUgGiiblL4I2/nZUGlryslLJK8ZH3s0RP+n4f274ay yxioDmB98i5TVOVpti78w0GO3NmnLc7WyLzpk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=d6JC3p82YWqMQbJ3bHr59OcT6Hi0NIrgZfU3hrMBzvtSRs1LRMr8gkkw6gpM4KzNlz In72yYH4YNmmW8PLun1h0ONCZH/bL//jwlS5Fs6Bwrs/eVztdY5e8rfOF6x8MXhHfR0X xtxybjv/fhbY8MOiw8JOdrVXcPjdi9SfbDln0= Received: by 10.210.95.26 with SMTP id s26mr1068891ebb.7.1254579463329; Sat, 03 Oct 2009 07:17:43 -0700 (PDT) Received: from ?95.78.122.128? ([95.78.122.128]) by mx.google.com with ESMTPS id 7sm2588367eyg.19.2009.10.03.07.17.41 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Oct 2009 07:17:42 -0700 (PDT) Date: Sat, 3 Oct 2009 18:17:35 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <726977703.20091003181735@gmail.com> To: "Stuart P. Bentley" Subject: Re[2]: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) In-Reply-To: <4FFE63AF1D984E1DA4BBE0B94780B624@Stucomet> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <4FFE63AF1D984E1DA4BBE0B94780B624@Stucomet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Stuart, Saturday, October 3, 2009, 5:50:50 PM, you wrote: > Personally, I don't see what Programming in Lua lacks as an introduction for > beginners to programming. It doesn't spend pages explaining what "functions" > and "variables" are, but they aren't very difficult concepts to grasp > (especially if you've already got algebra experience). there are no variables in algebra, only (immutable) values -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 12:10:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93FA2OM025796; Sat, 3 Oct 2009 12:10:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 067D0192E6; Sat, 3 Oct 2009 12:08:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f203.google.com (mail-iw0-f203.google.com [209.85.223.203]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46F2D190A3 for ; Sat, 3 Oct 2009 12:08:51 -0300 (BRT) Received: by iwn41 with SMTP id 41so1037070iwn.6 for ; Sat, 03 Oct 2009 08:09:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.1.22 with SMTP id 22mr7613055ibd.56.1254582565869; Sat, 03 Oct 2009 08:09:25 -0700 (PDT) In-Reply-To: <20091003131750.GA13263@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> Date: Sat, 3 Oct 2009 11:09:25 -0400 Message-ID: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> Subject: Re: Lua t-shirts From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n93FA2OM025796 On Sat, Oct 3, 2009 at 9:17 AM, Roberto Ierusalimschy wrote: >> > The Lua store seems to be still open: >> >        http://www.cafepress.com/lualang/ >> > >> Cool, now i know what i want for christmas =D >> Still open? Is it going to close anytime soon? In that case i'd have >> to buy one myself and not wait for xmas..? =) > > No, I do not think it is going to close. "Still open" means "still open > since the last time we checked. We set that store many years ago and > collect no money from the sales (all stuff is sold by the basic price), > so we seldom log in. I'd buy a shirt from the Lua website to help financially support the project if they were available. *hint hint*! -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 12:16:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93FGAXh026315; Sat, 3 Oct 2009 12:16:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A9831931E; Sat, 3 Oct 2009 12:15:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0502192E3 for ; Sat, 3 Oct 2009 12:15:07 -0300 (BRT) Received: by vws15 with SMTP id 15so984299vws.5 for ; Sat, 03 Oct 2009 08:15:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.218 with SMTP id m26mr6854212vck.30.1254582944366; Sat, 03 Oct 2009 08:15:44 -0700 (PDT) In-Reply-To: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> From: Phoenix Sol Date: Sat, 3 Oct 2009 10:15:23 -0500 Message-ID: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> Subject: Re: Lua t-shirts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'd buy a shirt from the Lua website to help financially support the > project if they were available. *hint hint*! Me, too; but only if available in black ;) From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 13:29:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93GSvFj031781; Sat, 3 Oct 2009 13:28:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 610FF1916D; Sat, 3 Oct 2009 13:27:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D065718D1B for ; Sat, 3 Oct 2009 13:27:46 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 02E09E20A9 for ; Sat, 3 Oct 2009 18:28:20 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l+c3q9aG94Ll for ; Sat, 3 Oct 2009 18:28:17 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 48FFCE20B9; Sat, 3 Oct 2009 18:28:17 +0200 (CEST) Date: Sat, 3 Oct 2009 18:28:17 +0200 From: Ico To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091003162817.GF9789@pruts.nl> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-03 Patrick Donnelly wrote : > On Sat, Oct 3, 2009 at 9:17 AM, Roberto Ierusalimschy > wrote: > >> > The Lua store seems to be still open: > >> >        http://www.cafepress.com/lualang/ > >> > > >> Cool, now i know what i want for christmas =D > >> Still open? Is it going to close anytime soon? In that case i'd have > >> to buy one myself and not wait for xmas..? =) > > > > No, I do not think it is going to close. "Still open" means "still open > > since the last time we checked. We set that store many years ago and > > collect no money from the sales (all stuff is sold by the basic price), > > so we seldom log in. > > I'd buy a shirt from the Lua website to help financially support the > project if they were available. *hint hint*! Save one for me! Too bad white doesn't suit me... -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 14:09:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93H9e4f002356; Sat, 3 Oct 2009 14:09:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7C9218E5E; Sat, 3 Oct 2009 14:08:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87F0E18D5E for ; Sat, 3 Oct 2009 14:08:29 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so136954fgg.17 for ; Sat, 03 Oct 2009 10:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=1f3r8ppyo2oWNTORhLWxB2tWPCbfZK3yAVC6udcc+gA=; b=j8M7zmCwN0HPsCeNkdV+WjwQswn0sZzCalRyi25BSc+2Zv4XkBmtb4ed7y+qYHtXJJ Ohl7umLPvBMP86CSPIcCPeYaG/dDAPPuJMJltevoC0JpiqrbGY7VaURe19tAxRUKglkU H+d0oARMNXjDRBo5KuEFF82sIKM4fy0Eux+7k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=UXFYY4RdAM0TpF4RKuUOSCap78WrMDewJjSjkexkCC1BKPk0+lP4o0tmpz+Zalinbf Updb7XdlPq+znKrT+L3izrLIQPox02DCsIP0XCZdC3VUjymJC4VS5Wqp1FybMsS5cn0+ /+4+MYSxO7OzQ7sKAqcs+m05V9D3fXPL1zjXM= Received: by 10.86.235.14 with SMTP id i14mr3539755fgh.52.1254589744590; Sat, 03 Oct 2009 10:09:04 -0700 (PDT) Received: from ?192.168.123.101? ([81.13.157.83]) by mx.google.com with ESMTPS id 3sm2573647fge.17.2009.10.03.10.09.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 03 Oct 2009 10:09:03 -0700 (PDT) Message-Id: <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: xavante and mercury Date: Sat, 3 Oct 2009 19:09:02 +0200 References: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 3, 2009, at 1:20 PM, Ashish Shrestha wrote: > Just wanted to share something I recently found -- Mercury, a Sinatra > like framework for Lua [http://github.com/nrk/mercury] > > I am using it with Xavante (without everything else from Kepler) and > using the script from Fabio Mascarenhas > [http://lua-users.org/lists/lua-l/2009-09/msg00780.html] to launch the > web application. Here is an example on how to run Mercury with Nanoki's HTTP engine [1], using it's build in TCPServer [2] and a WSAPI handler [3]: local HTTP = require( 'HTTP' ) local TCPServer = require( 'TCPServer' ) local WSAPI = require( 'WSAPI' ) HTTP[ '.*' ] = WSAPI( require( 'greetings' ).run ) TCPServer( '127.0.0.1', 1080 )( HTTP ) While this "work", none of this necessarily make any sense :) [1] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua [2] http://dev.alt.textdrive.com/browser/HTTP/TCPServer.lua [3] http://dev.alt.textdrive.com/browser/HTTP/WSAPI.lua From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 14:20:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93HK1Zi004190; Sat, 3 Oct 2009 14:20:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE72218EDB; Sat, 3 Oct 2009 14:19:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A898118C43 for ; Sat, 3 Oct 2009 14:18:57 -0300 (BRT) Received: by fxm12 with SMTP id 12so2075753fxm.5 for ; Sat, 03 Oct 2009 10:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=piETmisuY7j74sxToIdw10oMGKg1yN7+y+Ewv2daD10=; b=Kp6smbdQYn34mjUiHZj2bh2slSxGBFoV1BHMgDKm1SoStDoRWohv6MOA9XMHjE1vvY 8nNF7qEYQ+JCkANk0JNNAPgpWi9zg923QNCJ54D6XZMCTW0yP6cOYq4dywxGQKhYYh+h u/GuPPTQl3BNd2Cu8SvLivgXwYryESdWG60QE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=M7x9fqjuNDqW5t/UEh7QA6orwKkEKGqSQ/qEaXOuBs4oLDMarUdwio7sWVXGZ0QKgg cE3j9qEAxha07uuBjV1crNrdOchoo9jjhgQG1slU4Gejs+rgzIxG/APJCStVQdM5JLqv 8SHja0CdET7kidI1qJkWymEPTFdXEL6fzs1Z0= MIME-Version: 1.0 Received: by 10.204.34.9 with SMTP id j9mr2387785bkd.10.1254590372684; Sat, 03 Oct 2009 10:19:32 -0700 (PDT) In-Reply-To: <726977703.20091003181735@gmail.com> References: <560972290909230012k277d6d50j6d3fae1ebf2de6a9@mail.gmail.com> <4FFE63AF1D984E1DA4BBE0B94780B624@Stucomet> <726977703.20091003181735@gmail.com> Date: Sat, 3 Oct 2009 19:19:32 +0200 Message-ID: <9386fb2d0910031019w6e2119a8k47052d6852df5cbc@mail.gmail.com> Subject: Re: Re[2]: Good introductory texts ? (was Re: Suitability of Lua as a First Programming Language?) From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > there are no variables in algebra, only (immutable) values Perhaps not, but i don't think he said that variables <=> algebraic values Showing people some simple algebra, the showing them how to do the same with variables and functions (in lua, actually) has been helpful for me when demystifying programming for my non-programmer-friends. /Pierre From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 14:26:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93HQRFk004721; Sat, 3 Oct 2009 14:26:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F62318FCD; Sat, 3 Oct 2009 14:25:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F03D18ED1 for ; Sat, 3 Oct 2009 14:25:21 -0300 (BRT) Received: by yxe37 with SMTP id 37so1984321yxe.33 for ; Sat, 03 Oct 2009 10:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=9pqz+h5hXCFxnIb9J4RD0fNrefGYbNpBfGET1mMwWww=; b=YqgzkMkN7E1/nyaEP4aqHV+kwCVGoK+2zzQ/kYEvNEnRtsaaS24uf7ayCyKTZ1SL2O OJs2i7zTyw2iZ751zwYaNwEla0PTDuvr1MsxYQ8X93qnq78bllFfKA+bjJKSF9njlFK1 HfReGirAVucJa40dNzl5/+1hk1mioJSrZQt0U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hbd0JfH68mEnSrWDonmdhuC+b6GSOEZrdGwD3d25wvpN3XfVZqWVtarQms9RYSgFR6 ycLQsKOWoK9P9cE4jjGwZAeLwxjL0g2w2AhAy4nyb8gQVQRY/mVOvcET6LkbQGEHhlrO h7yd6e2DgY7ZZrwRyaILDFDGF5oGXqPSgG17I= MIME-Version: 1.0 Received: by 10.101.180.33 with SMTP id h33mr4132734anp.155.1254590756064; Sat, 03 Oct 2009 10:25:56 -0700 (PDT) In-Reply-To: <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> References: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> Date: Sat, 3 Oct 2009 18:25:55 +0100 Message-ID: <379686bd0910031025k6b894313mb9d687c86ddbc1c1@mail.gmail.com> Subject: Re: xavante and mercury From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Petite. This is fantastic. I was thinking of using the TCPServer and had been going over the source to understand how it all works. I am new to Lua and was figuring out [at least trying to] all the metatable magic in HTTP.lua Thank you for such a wonderful contribution. Ashish On Sat, Oct 3, 2009 at 6:09 PM, Petite Abeille wrote: > > On Oct 3, 2009, at 1:20 PM, Ashish Shrestha wrote: > >> Just wanted to share something I recently found -- Mercury, a Sinatra >> like framework for Lua [http://github.com/nrk/mercury] >> >> I am using it with Xavante (without everything else from Kepler) and >> using the script from Fabio Mascarenhas >> [http://lua-users.org/lists/lua-l/2009-09/msg00780.html] to launch the >> web application. > > Here is an example on how to run Mercury with Nanoki's HTTP engine [1], > using it's build in TCPServer [2] and a WSAPI handler [3]: > > local HTTP = require( 'HTTP' ) > local TCPServer = require( 'TCPServer' ) > local WSAPI = require( 'WSAPI' ) > > HTTP[ '.*' ] = WSAPI( require( 'greetings' ).run ) > TCPServer( '127.0.0.1', 1080 )( HTTP ) > > While this "work", none of this necessarily make any sense :) > > [1] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua > [2] http://dev.alt.textdrive.com/browser/HTTP/TCPServer.lua > [3] http://dev.alt.textdrive.com/browser/HTTP/WSAPI.lua > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 15:55:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93ItDTf011371; Sat, 3 Oct 2009 15:55:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D94BC18EDB; Sat, 3 Oct 2009 15:54:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f203.google.com (mail-iw0-f203.google.com [209.85.223.203]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0757A18E58 for ; Sat, 3 Oct 2009 15:53:58 -0300 (BRT) Received: by iwn41 with SMTP id 41so1087090iwn.6 for ; Sat, 03 Oct 2009 11:54:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.24.208 with SMTP id w16mr8383735ibb.38.1254596073064; Sat, 03 Oct 2009 11:54:33 -0700 (PDT) In-Reply-To: <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> Date: Sat, 3 Oct 2009 14:54:33 -0400 X-Google-Sender-Auth: 5f70e0439e20a081 Message-ID: Subject: Re: GSL Shell software announcement From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 2, 2009 at 7:35 AM, steve donovan wrote: > 2) The contents of the math table are all made global (there is in > fact no 'math' table anymore). OK, I can see the temptation, but most > Lua users are now used to bringing in math functions they need from > math. This will also bite you if you decide to override functions like > exp() to work on vectors/matrices. (A fast map function would be > useful, otherwise) If this is done, I request moving it out of the Lua patch and into the gsl-shell.c so that gsl-shell can be deployed on a vanilla LNUM-patched Lua (which LuaDist now supports). Basically, you may do for k,v in pairs(math) do _G[k] = v end gsl-shell.c could in fact be written entirely as a shell script wrapper around Lua. Another request: have gsl-shell load igsl.lua via require rather than via luaL_loadfile. Currently, igsl.lua only gets loaded if it exists in the current directory. > 4) Matrices are indexed beginning at zero, which was a little suprise! > I know there are fierce wars about this, but having two conventions > hanging around is not good. LuaMatrix [1] in comparison uses 1-indexing, but a major reason for this is that it implements matrices as Lua tables. Last time I checked, Mathcad by default 0-indexes (though it can be changed), while Matlab, Maple, and Mathematica 1-index. Regardless, the gsl-shell behavior here probably will be determined by GSL. [1] http://lua-users.org/wiki/LuaMatrix From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 16:00:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93J0UIg011871; Sat, 3 Oct 2009 16:00:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FD6118EF2; Sat, 3 Oct 2009 15:59:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B6A018E5E for ; Sat, 3 Oct 2009 15:59:27 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mu9pr-0008EQ-JK for lua@bazar2.conectiva.com.br; Sat, 03 Oct 2009 21:00:03 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Oct 2009 21:00:03 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Oct 2009 21:00:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Lua t-shirts Date: Sat, 03 Oct 2009 11:54:48 -0700 Lines: 14 Message-ID: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Like so? http://i33.tinypic.com/2r2lq2p.jpg http://i37.tinypic.com/10o0c3r.jpg I would be happy to send the artwork to someone so they could upload it to the cafepress store... Phoenix Sol wrote: >> I'd buy a shirt from the Lua website to help financially support the >> project if they were available. *hint hint*! > > Me, too; but only if available in black ;) > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 16:02:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93J2731012069; Sat, 3 Oct 2009 16:02:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58FDC18FC9; Sat, 3 Oct 2009 16:01:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A1FD18E5E for ; Sat, 3 Oct 2009 16:01:06 -0300 (BRT) Received: by vws15 with SMTP id 15so1030579vws.5 for ; Sat, 03 Oct 2009 12:01:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.89.2 with SMTP id c2mr7214426vcm.16.1254596502235; Sat, 03 Oct 2009 12:01:42 -0700 (PDT) In-Reply-To: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> From: Phoenix Sol Date: Sat, 3 Oct 2009 14:01:22 -0500 Message-ID: <8a25d01b0910031201p6d76c43anbf3c82616d66bbe6@mail.gmail.com> Subject: Re: Lua t-shirts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean WANT! On Sat, Oct 3, 2009 at 1:54 PM, Stefan wrote: > Like so? > > http://i33.tinypic.com/2r2lq2p.jpg > http://i37.tinypic.com/10o0c3r.jpg > > I would be happy to send the artwork to someone so they could upload it to > the cafepress store... > > Phoenix Sol wrote: >>> >>> I'd buy a shirt from the Lua website to help financially support the >>> project if they were available. *hint hint*! >> >> Me, too; but only if available in black ;) >> > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 18:15:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93LFoch020956; Sat, 3 Oct 2009 18:15:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6292C18CAD; Sat, 3 Oct 2009 18:14:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F02E718C1B for ; Sat, 3 Oct 2009 18:14:30 -0300 (BRT) Received: by fxm12 with SMTP id 12so2161690fxm.5 for ; Sat, 03 Oct 2009 14:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=0hpIGkc+l1UG7bx86Ao8hzRdHeeGN2CUiRv7my6SgLo=; b=wLm9nEtoHa6+XZHBExSN/2iSqQr0oaeFy00g4xKQ8RZV7+o5jorMItDGzUDyqn6XYb 4nQAvFQb/UoDFEeyha3tIO1u+FMw+dfuj1OeZScNNkAgT9wNzcNuyJELcuMl/kjPFs/r VOY8EPftNEulBasQzq1J8R4Ui9V/csOnKkklc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DtFsGFSvDxaxIHq9ot8bosNtKtHcckIxKaavzVHR3y42eq2YKEe+irjkGj+oBtddQH q0LJXVlQQbIr8aatOy58WPC9Vo6JYoa6zQtHOJxAy4o3UZxpo2ftIJHfhqy3kQ3NwFux QATZkl30Nl0CaLjU5oIlJaWd+IHmKPuVyLreA= MIME-Version: 1.0 Received: by 10.204.8.145 with SMTP id h17mr2470298bkh.156.1254604505628; Sat, 03 Oct 2009 14:15:05 -0700 (PDT) In-Reply-To: <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> Date: Sat, 3 Oct 2009 23:15:05 +0200 Message-ID: <4ff79edb0910031415i64c880b3j21b5af70afe3226c@mail.gmail.com> Subject: Re: GSL Shell software announcement From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=00151758ac46e43ff404750e5f57 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151758ac46e43ff404750e5f57 Content-Type: text/plain; charset=ISO-8859-1 Hi Steve, everyone, thank you very much to all of you, guys, for the feedback, I really appreciate that. I'm sorry for the delay of my response but I've a little baby of just ten jours and it takes time to take care of him :-) I feel that Steve have pointed out many of the major problems. I've updated the SVN archive with a new version and when the download directory will be updated you will find a file 'gsl-shell-v0.2.tgz' that integrates the modifications. So I'm going to answer to all the remarks: - building problem => I've simplified and improved the Makefile, now it does not require the lua51.pc file. there is still some room to improvements, for example -fpic flags is not needed if building a stand-alone gsl-shell executable. I've added a "shared" target to build just the shared library lua-gsl.so - no, I'm not going to use lhf's complex number implementation because it is very important in my point of view to have native support for complex numbers. Even C have, with C99 standard, support for complex numbers. From a mathematical point of view I want to consider the complex number as a first class type just like real numbers - I've added a flag USE_SEPARATE_NAMESPACE in defs.h => if it is enabled the functions are added in the 'gsl' namespace. In this case you can load the shared library from Lua and load 'igsl.lua' like that > setmetatable(gsl, [={__index = _G}) > loadf = loadfile('igsl.lua') > setfenv(loadf, gsl) > loadf() I think that in this way people that want to use GSL shell from Lua will be more happy :-) - I've added the LUA_INDEX_CONVENTION flag in defs.h and it is activated by default. When it is activated it does change the indexing conventions for the matrices and we adopt the Lua convention (i.e. first element is 1). I feel that Steve is right, it is better like that. Please note that now all the files in examples and tests are broken !! And that's all guys. Just another thing, I've filed a bug for the LNUM patch (http://luaforge.net/projects/lnum/) but Asko, the owner, told me that he cannot fix it because he does not have time. Someone feels brave enough to try to fix it. You need to know a little bit the lua internals. Bye everyone, Francesco 2009/10/2 steve donovan > On Fri, Oct 2, 2009 at 12:38 PM, Francesco Abbate > wrote: > > The wiki could be a good idea but I don't know how to set it up. > Otherwise I > > still think that interested people can do a little effort and commit to > the > > SVN repository a properly formatted .txt files. It is very easy for > everyone > > to get in and it will assure an higher level of quality for the > > documentation. > > The doc source seems to be easy to edit. It's easy to build from > source, but (as I said) you have to use the Lua includes packaged in > the contained Lua source distribution, because of the LNUM patch. > > A few first impressions: > > 1) It would be cool if lgsl were available as a regular Lua module, > but it does require a LNUM-complex patched Lua. Perhaps if it used > something like lhf's lcomplex, it could be more generally used? > > 2) The contents of the math table are all made global (there is in > fact no 'math' table anymore). OK, I can see the temptation, but most > Lua users are now used to bringing in math functions they need from > math. This will also bite you if you decide to override functions like > exp() to work on vectors/matrices. (A fast map function would be > useful, otherwise) > > 3) A general remark about namespaces; everything is in the global > namespace, except when it isn't (like fft). Again, it is probably > good practice to put global things like new() into a table like lgsl > > 4) Matrices are indexed beginning at zero, which was a little suprise! > I know there are fierce wars about this, but having two conventions > hanging around is not good. > > steve d. > --00151758ac46e43ff404750e5f57 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Steve, everyone,

thank you very much to all of you, g= uys, for the feedback, I really appreciate that.=A0I'm sorry for the de= lay of my response but I've a little baby of just ten jours and it take= s time to take care of him :-)

I feel that Steve have pointed out many of the major pr= oblems. I've updated the SVN archive with a new version and when the do= wnload directory will be updated you will find a file 'gsl-shell-v0.2.t= gz' that integrates the modifications.

So I'm going to answer to all the remarks:

- building problem =3D> I've simplified and improve= d the Makefile, now it does not require the lua51.pc file.
=A0=A0= there is still some room to improvements, for example -fpic flags is not ne= eded if building a stand-alone
=A0=A0gsl-shell executable.
=A0=A0I've added a "sha= red" target to build just the shared library lua-gsl.so
- no= , I'm not going to use lhf's complex number implementation because = it is very important in my point of
=A0=A0view to have native support for complex numbers. Even C have, wi= th C99 standard, support for complex
=A0=A0numbers. From a mathem= atical point of view I want to consider the complex number as a first class= type
=A0=A0just like real numbers
- I've added a flag USE_SEP= ARATE_NAMESPACE in defs.h =3D> if it is enabled the functions are added = in the
=A0=A0'gsl' namespace.
=A0=A0In this cas= e you can load the shared library from Lua and load 'igsl.lua' like= that
=A0=A0> setmetatable(gsl, [=3D{__index =3D _G})
=A0=A0>= ; loadf =3D loadfile('igsl.lua')
=A0=A0> setfenv(loadf= , gsl)
=A0=A0> loadf()
=A0=A0I think that in this wa= y people that want to use GSL shell from Lua will be more happy :-)
- I've added the LUA_INDEX_CONVENTION flag in defs.h and it is act= ivated by default.
=A0=A0When it is activated it does change the = indexing conventions for the matrices and we adopt
=A0=A0the Lua = convention (i.e. first element is 1). I feel that Steve is right, it is bet= ter like that.
=A0=A0Please note that now all the files in examples and tests are bro= ken !!

And that's all guys. Just another thing= , I've filed a bug for the LNUM patch (http://luaforge.net/projects/lnum/)
but Asko, the owner, told me that he cannot fix it because he does not= have time. Someone feels brave enough to try to fix it. You need to know a= little bit the lua internals.

Bye everyone,
Francesco

2009/10/2 steve don= ovan <ste= ve.j.donovan@gmail.com>
On Fri, Oct 2, 2009 at 12:38 PM, Francesco Abbate
> The wiki could be a good idea but I don't = know how to set it up. Otherwise I
> still think that interested people can do a little effort and commit t= o the
> SVN repository a properly formatted .txt files. It is very easy for ev= eryone
> to get in and it will assure an higher level of quality for the
> documentation.

The doc source seems to be easy to edit. It's easy to build from<= br> source, but (as I said) you have to use the Lua includes packaged in
the contained Lua source distribution, because of the LNUM patch.

A few first impressions:

1) It would be cool if lgsl were available as a regular Lua module,
but it does require a LNUM-complex patched Lua. =A0Perhaps if it used
something like lhf's lcomplex, it could be more generally used?

2) The contents of the math table are all made global (there is in
fact no 'math' table anymore). OK, I can see the temptation, but mo= st
Lua users are now used to bringing in math functions they need from
math. This will also bite you if you decide to override functions like
exp() to work on vectors/matrices. (A fast map function would be
useful, otherwise)

3) A general remark about namespaces; everything is in the global
namespace, except when it isn't (like fft). =A0Again, it is probably good practice to put global things like new() into a table like lgsl

4) Matrices are indexed beginning at zero, which was a little suprise!
=A0I know there are fierce wars about this, but having two conventions
hanging around is not good.

steve d.

--00151758ac46e43ff404750e5f57-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 18:39:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93LdGXP022402; Sat, 3 Oct 2009 18:39:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79BDB18E5E; Sat, 3 Oct 2009 18:38:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76D1818CA1 for ; Sat, 3 Oct 2009 18:38:11 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93LclrG022388 for ; Sat, 3 Oct 2009 18:38:47 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n93LcjP32024; Sat, 3 Oct 2009 18:38:45 -0300 Date: Sat, 3 Oct 2009 18:38:44 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: GSL Shell software announcement Message-ID: <20091003183844.A32021@lua.tecgraf.puc-rio.br> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Sat, Oct 03, 2009 at 02:54:33PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Basically, you may do > > for k,v in pairs(math) do _G[k] = v end In C that could be simpler: lua_pushvalue(L,LUA_GLOBALSINDEX); /* open math in global scope */ lua_setglobal(L,LUA_MATHLIBNAME); luaopen_math(L); lua_pushnil(L); /* remove math */ lua_setglobal(L,LUA_MATHLIBNAME); This is what my ae does: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#ae From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 18:51:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93LppZI023268; Sat, 3 Oct 2009 18:51:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C928919027; Sat, 3 Oct 2009 18:50:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9568518E5B for ; Sat, 3 Oct 2009 18:50:44 -0300 (BRT) Received: by bwz22 with SMTP id 22so1810799bwz.5 for ; Sat, 03 Oct 2009 14:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Ava5JGubntIAbBYeYdfupY9AaL3gxtqN87v3qgZaIwk=; b=CM0YIE7IjnyLdTl77gets33qbX41ZHOyM63H0cr/CTEJA9R/Em9ZxYAKLeS6mzuxoQ ZoRHO6ea3n9Ty0npcHdmYeJoo5kwSyl53LlHaWPJgnACBWfB4pzYEnEsC8J1VI02cu10 ZyTjIxRoB75LnfRc2kkJPkixKkeSMMio03yL0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=rwIzLnD6GPotABd87eFhRwj0pOKLP8d73vHMEynP7FTVoVgJvdNiNelfwboDFdL8AS gOd5xqyJRT3sC+JnmAkq2gSBfmVrVkU9qWulODuS8pQhOeInXn8S2QYGScdyx3ukCfj9 I+khoiNwDpSHZQBUQwS4y8PqDKbgwR3SBGVgE= MIME-Version: 1.0 Received: by 10.204.153.215 with SMTP id l23mr2528545bkw.135.1254606679541; Sat, 03 Oct 2009 14:51:19 -0700 (PDT) In-Reply-To: <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> References: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> Date: Sat, 3 Oct 2009 17:51:18 -0400 X-Google-Sender-Auth: 0a5728ddbe1782b4 Message-ID: Subject: Re: xavante and mercury From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Here is an example on how to run Mercury with Nanoki's HTTP engine [1], > using it's build in TCPServer [2] and a WSAPI handler [3]: > > local HTTP = require( 'HTTP' ) > local TCPServer = require( 'TCPServer' ) > local WSAPI = require( 'WSAPI' ) > > HTTP[ '.*' ] = WSAPI( require( 'greetings' ).run ) > TCPServer( '127.0.0.1', 1080 )( HTTP ) This of course applies to other WSAPI apps as well. The following code will run Sputnik on top of Nanoki's HTTP engine: local HTTP = require( 'HTTP' ) local TCPServer = require( 'TCPServer' ) local WSAPI = require( 'WSAPI' ) HTTP[ '.*' ] = WSAPI( loadfile("sputnik.ws")() ) TCPServer( '127.0.0.1', 1080 )( HTTP ) There is something to be said for standardization! - yuri From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 19:23:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93MNhq7025467; Sat, 3 Oct 2009 19:23:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F71B18CF8; Sat, 3 Oct 2009 19:22:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8D7B18B12 for ; Sat, 3 Oct 2009 19:22:33 -0300 (BRT) Received: by fxm12 with SMTP id 12so2182523fxm.5 for ; Sat, 03 Oct 2009 15:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=ASct7HojqkK1eVP1S20XJKOc59wWdLICOamBEVw1duY=; b=tWe1Wu7VCNDXbP9x70AnlfwRQtKLH9g2ZN/O3u4OmG5gMS1DD9qz917IDcWItbUmxZ 3qzqeTgOhIxHHQZEFnmd2+s0WD3dcztyQnuFu4mLe3w0RL91UlHLx9WyLgieJPQ02K9p VgJjlrjl8UfRmZ8XGAKwFIUqCX1532eS4N21g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=xHwelFbiIj0OQN5rBZ5h9fZpPAeMyqEJEAxag9dj6X4VHH4pQ70dxfU0MwS+bX07SF g5hfpOgV9qQol8UM7j6ryWLYSOUCcSK9rIdQdGOqstI5TA816Wvvl99nS12n9zetVJ+R wJFe7CIod4Z9hug39CjHI6hOb1R5IoJ/Gnlzk= Received: by 10.86.220.11 with SMTP id s11mr3739203fgg.47.1254608589390; Sat, 03 Oct 2009 15:23:09 -0700 (PDT) Received: from ?192.168.123.101? ([81.13.157.83]) by mx.google.com with ESMTPS id 3sm3201964fge.27.2009.10.03.15.23.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 03 Oct 2009 15:23:08 -0700 (PDT) Message-Id: <8C3CC5D0-1073-47B6-BBE1-D6E66A424994@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: xavante and mercury Date: Sun, 4 Oct 2009 00:23:07 +0200 References: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> <4FFE6D14-57E7-4393-B1A9-27AE01CA8EB1@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 3, 2009, at 11:51 PM, Yuri Takhteyev wrote: > There is something to be said for standardization! http://www.dilbert.com/strips/comic/2008-09-03/ From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 20:52:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n93Nq0to031354; Sat, 3 Oct 2009 20:52:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B818C18E5B; Sat, 3 Oct 2009 20:50:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 111C218BCD for ; Sat, 3 Oct 2009 20:50:51 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MuENn-0008VZ-NI for lua@bazar2.conectiva.com.br; Sun, 04 Oct 2009 01:51:23 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 Oct 2009 01:51:23 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 Oct 2009 01:51:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Lua t-shirts Date: Sat, 03 Oct 2009 16:51:17 -0700 Lines: 37 Message-ID: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <8a25d01b0910031201p6d76c43anbf3c82616d66bbe6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <8a25d01b0910031201p6d76c43anbf3c82616d66bbe6@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Phoenix Sol wrote: > WANT! > > On Sat, Oct 3, 2009 at 1:54 PM, Stefan wrote: >> Like so? >> >> http://i33.tinypic.com/2r2lq2p.jpg >> http://i37.tinypic.com/10o0c3r.jpg >> >> I would be happy to send the artwork to someone so they could upload it to >> the cafepress store... >> >> Phoenix Sol wrote: >>>> I'd buy a shirt from the Lua website to help financially support the >>>> project if they were available. *hint hint*! >>> Me, too; but only if available in black ;) >>> >> > Ask, and you shall receive: http://www.sendspace.com/file/i110ii This contains a 6, 8, and ten inch PNG file @ 200 DPI for uploading to cafepress. Included is the standard blue logo with all white regions converted to transparent, and the previously linked "see-thru white & silver" logo. I also threw in the SVG source file (based on the official PS files) that I used to create the images. It comes in mighty handy for making website logos and whatnot with Inkscape or Adobe. All files provided are hereby placed into public domain as derived works. Use as you wish pursuant to the original artwork license and it's treatment of derived works... (sorry for the top post last time) :/ From lua-bounces@bazar2.conectiva.com.br Sat Oct 3 21:28:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n940S3vG001345; Sat, 3 Oct 2009 21:28:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45E5718EA0; Sat, 3 Oct 2009 21:26:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA4918BD6 for ; Sat, 3 Oct 2009 21:26:52 -0300 (BRT) Received: by vws15 with SMTP id 15so1089229vws.5 for ; Sat, 03 Oct 2009 17:27:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.218 with SMTP id m26mr7354024vck.30.1254616048066; Sat, 03 Oct 2009 17:27:28 -0700 (PDT) In-Reply-To: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <8a25d01b0910031201p6d76c43anbf3c82616d66bbe6@mail.gmail.com> From: Phoenix Sol Date: Sat, 3 Oct 2009 19:27:08 -0500 Message-ID: <8a25d01b0910031727y3657bdbbm2975459ee907932d@mail.gmail.com> Subject: Re: Lua t-shirts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks, Stefan. Gasp; it's another 'top post' ;) On Sat, Oct 3, 2009 at 6:51 PM, Stefan wrote: > Phoenix Sol wrote: >> >> WANT! >> >> On Sat, Oct 3, 2009 at 1:54 PM, Stefan wrote: >>> >>> Like so? >>> >>> http://i33.tinypic.com/2r2lq2p.jpg >>> http://i37.tinypic.com/10o0c3r.jpg >>> >>> I would be happy to send the artwork to someone so they could upload it >>> to >>> the cafepress store... >>> >>> Phoenix Sol wrote: >>>>> >>>>> I'd buy a shirt from the Lua website to help financially support the >>>>> project if they were available. *hint hint*! >>>> >>>> Me, too; but only if available in black ;) >>>> >>> >> > > Ask, and you shall receive: > > http://www.sendspace.com/file/i110ii > > This contains a 6, 8, and ten inch PNG file @ 200 DPI for uploading to > cafepress. Included is the standard blue logo with all white regions > converted to transparent, and the previously linked "see-thru white & > silver" logo. I also threw in the SVG source file (based on the official PS > files) that I used to create the images. It comes in mighty handy for making > website logos and whatnot with Inkscape or Adobe. > > All files provided are hereby placed into public domain as derived works. > Use as you wish pursuant to the original artwork license and it's treatment > of derived works... > > (sorry for the top post last time) :/ > > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 00:56:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n943ubnP017435; Sun, 4 Oct 2009 00:56:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69CC618F56; Sun, 4 Oct 2009 00:55:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f188.google.com (mail-iw0-f188.google.com [209.85.223.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C987118A87 for ; Sun, 4 Oct 2009 00:54:59 -0300 (BRT) Received: by iwn26 with SMTP id 26so1203117iwn.5 for ; Sat, 03 Oct 2009 20:55:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.61.195 with SMTP id u3mr9298571ibh.12.1254628535278; Sat, 03 Oct 2009 20:55:35 -0700 (PDT) In-Reply-To: <200910012006.54022.bobby@sharedrealm.com> References: <200910012006.54022.bobby@sharedrealm.com> Date: Sat, 3 Oct 2009 23:55:35 -0400 X-Google-Sender-Auth: 7d8b228f008af660 Message-ID: Subject: Re: CMake build files for Lua 5.1.x From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n943ubnP017435 On Thu, Oct 1, 2009 at 11:06 PM, Robert G. Jakabosky wrote: > Attached is a patch to add CMake build files to Lua 5.1.  I have only tested > them on Linux, but they should work for atleast Macs & Windows systems.  Also > some of the LUA_USE_* CMake options don't do anything right now, but they can > still be changed in src/luaconf.h With some further adjustments, I would also suggest considering adding this to the Lua 5.1 distributions because it handles most platforms relatively painlessly, including shared library builds which are partially lacking in the existing build files. A few comments: BUILD_STATIC had to be forced to OFF when applying the flag -DLUA_BUILD_AS_DLL to avoid "undefined reference to `__imp__lua_sethook'" linker errors. In the CMAKE_SYSTEM_NAME, swap the UNIX and WIN32 tests, I think. Cygwin is both UNIX and WIN32, but its more UNIX. At least that was required to load a lfs.so shared library module built from LuaDist. Under gcc 3.4.6/Linux I got an 'error: unrecognized command line option "-fgnu89-inline"' This had warnings though. For comparison, see our CMakeLists.txt [1] for Lua 5.1.4 used in LuaDist [2], which has been tested on Linux, Cygwin, MinGW, MSVC, Mac, and maybe others. Ours is a single file and simpler, but it's currently less configurable and doesn't yet handle CPack. Maybe we can converge to a single version of the CMakeLists.txt. [1] http://luadist.svn.sourceforge.net/viewvc/luadist/trunk/dists/lua-5.1.4/CMakeLists.txt?view=log [2] http://lua-users.org/wiki/LuaDist From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 03:02:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9462CiL026758; Sun, 4 Oct 2009 03:02:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49CDB18CD2; Sun, 4 Oct 2009 03:00:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1B3D18A87 for ; Sun, 4 Oct 2009 03:00:49 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MuK9r-0002Vg-8W for lua@bazar2.conectiva.com.br; Sat, 03 Oct 2009 23:01:23 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: CMake build files for Lua 5.1.x Date: Sat, 3 Oct 2009 23:01:19 -0700 User-Agent: KMail/1.9.10 References: <200910012006.54022.bobby@sharedrealm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_voDyK1gjBLAWYhm" Message-Id: <200910032301.19806.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_voDyK1gjBLAWYhm Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 03, David Manura wrote: > On Thu, Oct 1, 2009 at 11:06 PM, Robert G. Jakabosky wrote: > > Attached is a patch to add CMake build files to Lua 5.1. =A0I have only > > tested them on Linux, but they should work for atleast Macs & Windows > > systems. =A0Also some of the LUA_USE_* CMake options don't do anything > > right now, but they can still be changed in src/luaconf.h > > With some further adjustments, I would also suggest considering adding > this to the Lua 5.1 distributions because it handles most platforms > relatively painlessly, including shared library builds which are > partially lacking in the existing build files. Thanks for the feedback. I have updated the patch to include those changes= =2E =20 Now all the LUA_USE_* options work. > A few comments: > > BUILD_STATIC had to be forced to OFF when applying the flag > -DLUA_BUILD_AS_DLL to avoid "undefined reference to > `__imp__lua_sethook'" linker errors. Now BUILD_STATIC is forced OFF on WIN32 and is not provided as an option. > In the CMAKE_SYSTEM_NAME, swap the UNIX and WIN32 tests, I think. > Cygwin is both UNIX and WIN32, but its more UNIX. At least that was > required to load a lfs.so shared library module built from LuaDist. I have added a CYGWIN section, it is just the same as the UNIX one right no= w. =20 Also I re-worked the system detection and applied different default values = to=20 all the options based on the system type. > Under gcc 3.4.6/Linux I got an 'error: unrecognized command line > option "-fgnu89-inline"' This had warnings though. I just removed that flag for now. > For comparison, see our CMakeLists.txt [1] for Lua 5.1.4 used in > LuaDist [2], which has been tested on Linux, Cygwin, MinGW, MSVC, Mac, > and maybe others. Ours is a single file and simpler, but it's > currently less configurable and doesn't yet handle CPack. Maybe we > can converge to a single version of the CMakeLists.txt. I am used to using one CMakeLists.txt files for each sub-folder to keep thi= ngs=20 a bit more organized, and so the build file doesn't grow to be massive. This new patch includes some of the features from LuaDist CMakeLists.txt fi= le. =2D-=20 Robert G. Jakabosky --Boundary-00=_voDyK1gjBLAWYhm Content-Type: text/x-diff; charset="iso 8859-15"; name="lua_CMake2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="lua_CMake2.patch" diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..22037e0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,197 @@ +# +# Lua 5.1.x +# +cmake_minimum_required(VERSION 2.4 FATAL_ERROR) + +project(lua C) + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +include(CustomMacros) + +enable_testing() + +set(COMMON_CFLAGS) +set(COMMON_LDFLAGS) +set(LIBS) +# +# Detect system type +# +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(DEFAULT_POSIX TRUE) + set(DEFAULT_DLOPEN ON) + set(DEFAULT_READLINE ON) + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -Wl,-E") +else(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(APPLE) + set(DEFAULT_POSIX TRUE) + set(DEFAULT_DLOPEN ON) + # use this on Mac OS X 10.3- + option(LUA_USE_MACOSX "Mac OS X 10.3-" OFF) + elseif(CYGWIN) + set(DEFAULT_POSIX TRUE) + elseif(UNIX) + set(DEFAULT_POSIX TRUE) + elseif(WIN32) + set(LUA_WIN TRUE) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_BUILD_AS_DLL") + else(APPLE) + set(DEFAULT_ANSI TRUE) + endif(APPLE) +endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +# +# setup config options with default values. +# +if(WIN32) + set(BUILD_STATIC OFF) +else(WIN32) + option(BUILD_STATIC "build static library" ON) +endif(WIN32) + +if(DEFAULT_DLOPEN) + option(LUA_USE_DLOPEN "Enable dlopen support." ON) +else(DEFAULT_DLOPEN) + option(LUA_USE_DLOPEN "Enable dlopen support." OFF) +endif(DEFAULT_DLOPEN) + +if(DEFAULT_POSIX) + option(LUA_USE_CURSES "Enable Curses support." ON) + option(LUA_USE_MKSTEMP "Use mkstemp." ON) + option(LUA_USE_ISATTY "Enable isatty support." ON) + option(LUA_USE_POPEN "Enable lua_popen support." ON) + option(LUA_USE_ULONGJMP "Try using _longjmp/_setjmp (more efficient)" ON) +else(DEFAULT_POSIX) + option(LUA_USE_CURSES "Enable Curses support." OFF) + option(LUA_USE_MKSTEMP "Use mkstemp." OFF) + option(LUA_USE_ISATTY "Enable isatty support." OFF) + option(LUA_USE_POPEN "Enable lua_popen support." OFF) + option(LUA_USE_ULONGJMP "Try using _longjmp/_setjmp (more efficient)" OFF) +endif(DEFAULT_POSIX) + +if(DEFAULT_READLINE) + option(LUA_USE_READLINE "Enable readline support." ON) +else(DEFAULT_READLINE) + option(LUA_USE_READLINE "Enable readline support." OFF) +endif(DEFAULT_READLINE) + +if(DEFAULT_ANSI) + option(LUA_ANSI "Disable non-ansi features." ON) +else(DEFAULT_ANSI) + option(LUA_ANSI "Disable non-ansi features." OFF) +endif(DEFAULT_ANSI) + +option(LUA_USE_APICHECK "Enable API checks." OFF) + +# +# Lua version +# +set(LUA_VERSION_MAJOR 5) +set(LUA_VERSION_MINOR 1) +set(LUA_VERSION_PATCH 4) +set(LUA_VERSION + "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") +set(LUA_SOVERSION + "${LUA_VERSION_MAJOR}") +# +# Lua package info. +# +set(CPACK_PACKAGE_VERSION_MAJOR ${LUA_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LUA_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${LUA_VERSION_PATCH}) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYRIGHT") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") +set(CPACK_PACKAGE_VENDOR "Lua.org, PUC-Rio.") +set(CPACK_SOURCE_GENERATOR "TGZ") +set(CPACK_SOURCE_IGNORE_FILES +"/\\\\.;/\\\\.git.*/;~$;build/;CMakeFiles/;CMakeCache;Testing/;cmake_install;CPack;Dart;Makefile$") +set(CPACK_SOURCE_PACKAGE_FILE_NAME + "${CMAKE_PROJECT_NAME}-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") +# MUST be after CPACK_* variables. +include(CPack) + +# +# libs & cflags +# +set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -lm ") + +# For "Mac OS X 10.3-" +if(LUA_USE_MACOSX) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_MACOSX") + set(LUA_USE_DLOPEN FALSE) +endif(LUA_USE_MACOSX) + +# enable options +if(LUA_USE_DLOPEN) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_DLOPEN") + if(NOT APPLE) + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -ldl ") + endif(NOT APPLE) +endif(LUA_USE_DLOPEN) +if(LUA_USE_MKSTEMP) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_MKSTEMP") +endif(LUA_USE_MKSTEMP) +if(LUA_USE_ISATTY) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_ISATTY") +endif(LUA_USE_ISATTY) +if(LUA_USE_POPEN) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_POPEN") +endif(LUA_USE_POPEN) +if(LUA_USE_ULONGJMP) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_ULONGJMP") +endif(LUA_USE_ULONGJMP) +if(LUA_USE_APICHECK) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_APICHECK") +endif(LUA_USE_APICHECK) +if(LUA_ANSI) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_ANSI") +endif(LUA_ANSI) + +# readline support +if(LUA_USE_READLINE) + FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h) + FIND_LIBRARY(READLINE_LIBRARY NAMES readline) + if(READLINE_LIBRARY) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_READLINE") + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -lreadline -lhistory") + include_directories(${READLINE_INCLUDE_DIR}) + endif(READLINE_LIBRARY) +endif(LUA_USE_READLINE) + +# curses +if(LUA_USE_CURSES) + include(FindCurses) + if(CURSES_LIBRARY) + include_directories(${CURSES_INCLUDE_DIR}) + set(LIBS ${LIBS} ${CURSES_LIBRARY}) + endif(CURSES_LIBRARY) +endif(LUA_USE_CURSES) + +# +# standard flags to use for each build type. +# +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wextra -Wshadow -W -pedantic -std=gnu99") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") + set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -O1 -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 -g") +endif(CMAKE_COMPILER_IS_GNUCC) + +# +# Install extra header files & manpages +# +install(FILES + etc/lua.hpp + DESTINATION include) +install(FILES + doc/lua.1 + doc/luac.1 + DESTINATION man/man1) + +# +# sub-folders +# +ADD_SUBDIRECTORY(src build) +ADD_SUBDIRECTORY(test) + diff --git a/cmake/CustomMacros.cmake b/cmake/CustomMacros.cmake new file mode 100644 index 0000000..9318ea4 --- /dev/null +++ b/cmake/CustomMacros.cmake @@ -0,0 +1,14 @@ + +macro(add_target_properties _target _name) + set(_properties) + foreach(_prop ${ARGN}) + set(_properties "${_properties} ${_prop}") + endforeach(_prop) + get_target_property(_old_properties ${_target} ${_name}) + if(NOT _old_properties) + # in case it's NOTFOUND + set(_old_properties) + endif(NOT _old_properties) + set_target_properties(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}") +endmacro(add_target_properties) + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..47fba6c --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,103 @@ + +# Lua core source files. +set(LUA_CORE_SRC + lapi.c + lauxlib.c + lbaselib.c + lcode.c + ldblib.c + ldebug.c + ldo.c + ldump.c + lfunc.c + lgc.c + linit.c + liolib.c + llex.c + lmathlib.c + lmem.c + loadlib.c + lobject.c + lopcodes.c + loslib.c + lparser.c + lstate.c + lstring.c + lstrlib.c + ltable.c + ltablib.c + ltm.c + lundump.c + lvm.c + lzio.c +) +set(LUA_LIB_HEADERS + lua.h + lualib.h + lauxlib.h + luaconf.h +) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}) + +# +# Lua library. +# +if(BUILD_STATIC) + add_library(lua STATIC ${LUA_CORE_SRC}) + add_target_properties(lua COMPILE_FLAGS "${COMMON_CFLAGS}") + add_target_properties(lua LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") + target_link_libraries(lua ${LIBS}) + set(LUA_STATIC_LIB lua) + set(LUA_LIBS lua) +else(BUILD_STATIC) + add_library(lua_static STATIC ${LUA_CORE_SRC}) + add_target_properties(lua_static COMPILE_FLAGS "${COMMON_CFLAGS}") + add_target_properties(lua_static LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") + target_link_libraries(lua_static ${LIBS}) + set(LUA_STATIC_LIB lua_static) + + add_library(lua SHARED ${LUA_CORE_SRC}) + add_target_properties(lua COMPILE_FLAGS "${COMMON_CFLAGS}") + add_target_properties(lua LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") + target_link_libraries(lua ${LIBS}) + + set(LUA_LIBS lua_static lua) +endif(BUILD_STATIC) +set_target_properties(${LUA_LIBS} PROPERTIES + VERSION ${LUA_VERSION} + SOVERSION ${LUA_SOVERSION} + CLEAN_DIRECT_OUTPUT 1 +) + +# +# Lua compiler +# +add_executable(luac luac.c print.c) +add_target_properties(luac COMPILE_FLAGS "${COMMON_CFLAGS}") +add_target_properties(luac LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") +target_link_libraries(luac ${LUA_STATIC_LIB} ${LIBS}) + +# +# Lua stand-alone interpreter +# +add_executable(lua.bin lua.c) +add_target_properties(lua.bin COMPILE_FLAGS "${COMMON_CFLAGS}") +add_target_properties(lua.bin LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") +target_link_libraries(lua.bin lua ${LIBS}) +# rename lub.bin to lua +set_target_properties(lua.bin PROPERTIES OUTPUT_NAME lua) + +# +# install lua/luac & library. +# +install(TARGETS luac lua.bin ${LUA_LIBS} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +install(FILES + ${LUA_LIB_HEADERS} + DESTINATION include) + --Boundary-00=_voDyK1gjBLAWYhm-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 06:57:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n949vdH9024612; Sun, 4 Oct 2009 06:57:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 695A018BED; Sun, 4 Oct 2009 06:56:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D69E18A02 for ; Sun, 4 Oct 2009 06:56:25 -0300 (BRT) Received: by fxm12 with SMTP id 12so2349314fxm.5 for ; Sun, 04 Oct 2009 02:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=mcigh4tCDniwTlJl06QqSx84X4ll3IGaod/8jtDbKtc=; b=cSGxUfHNA7FGC162qIyO/MOYRoJd463XesWhrpp/MmwbBP7aDm6rPcM3Ye0LiUkG70 kuWeQdu5f8cB3Ida+7dCLpQzoZDZL56kcOFemMw2IWrCmBVT7HmSW2r3eLP1Mm9cvV6/ K+hQnMuwDBQev8OSDnYgOtsEoUTss3otTrbUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=pOXSVe74KL5Rao6naGHbri/qil713qWgfZn8NifxcUQY4NWZ6ocSjm+uFSJm5T3UQV B74wtUqQrTSYXUWBY/2IUtHx9AP4qB9ngfIAL082gWN1hF19OoupYBpoGbnRuLzU6Unc hOxB6WzbRaLm6bHkcyWxF3idVbulLdjCn2vLU= MIME-Version: 1.0 Received: by 10.103.81.20 with SMTP id i20mr1729543mul.127.1254650220117; Sun, 04 Oct 2009 02:57:00 -0700 (PDT) In-Reply-To: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> References: <379686bd0910030420i4deff4c8v76fe8bf2e4736cf0@mail.gmail.com> From: Daniele Alessandri Date: Sun, 4 Oct 2009 11:56:40 +0200 Message-ID: <3bf20550910040256x1c1884b9mc9fc0f2d86a9dca5@mail.gmail.com> Subject: Re: xavante and mercury To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 3, 2009 at 13:20, Ashish Shrestha wrote: > I have my own webapp (a single Lua file), mercury.lua and the launcher > script from the above email in a directory and using the script to > launch the app. I hope, Daniele, includes the launcher script as it is > a great script for quick start and for use during development. I actually prepared a few more tiny examples last month, and the latest one ships with a runner script for Xavante and uses lua-haml [1] as a templating engine: http://gist.github.com/184844 Yeah I know, I usually tend to hide useful bits where people won't find them ;-) Now seriously speaking: daytime work mixed with random stuff that is filling up my free time are currently keeping me away from Mercury, but I hope to get back on track with its development as soon as possible as it really needs more work (and a test suite). Mercury is, right now, nothing more than a hacked toy that happens to work to some extent :-) [1] http://github.com/norman/lua-haml -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 11:13:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n94ED1rl011873; Sun, 4 Oct 2009 11:13:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2440619327; Sun, 4 Oct 2009 11:11:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F155A19317 for ; Sun, 4 Oct 2009 11:11:45 -0300 (BRT) Received: by bwz22 with SMTP id 22so2033286bwz.5 for ; Sun, 04 Oct 2009 07:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EnBzEP9zcKGJwPTFTUZFPpKVj6TruLLZY4G/erpRiHc=; b=jV2nLY+LTTENB3nmQRac9ipvTTIab/LggvH/mpHpk69cFgrzVwyKsI4/6UWr2jmOap W0iN9PDp3qS70TvW2nf7Baxh2P2+RDDWXYteSA61CJpZKr8XkuAjr5QkjwljOl7gJ8HF mehRG7QSYP1pWn48nq0W3dce3Y9Q4ryVp/Ab8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aitIxZRt5PnRzYPqpOg7ekU+X+rdkghYTQdL5BI3FfQF0O5O+e5p8yKqybFU1Gv6fa l/ZMtvoNTyi3R10hTGeZsqDZiiEAvYCxnuGwL1c2JTFEtikYuuRM8CEUEEJOQTRV5310 6Fye1BOiQyR5V9UcGGgprroIdhMjj7UGz8qQY= MIME-Version: 1.0 Received: by 10.204.10.130 with SMTP id p2mr3059282bkp.56.1254665542196; Sun, 04 Oct 2009 07:12:22 -0700 (PDT) In-Reply-To: <20091003183844.A32021@lua.tecgraf.puc-rio.br> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> <20091003183844.A32021@lua.tecgraf.puc-rio.br> Date: Sun, 4 Oct 2009 16:12:22 +0200 Message-ID: <4ff79edb0910040712q6e9ccbdfx8ddbca5a40e459ba@mail.gmail.com> Subject: Re: GSL Shell software announcement From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=00032555b346f45f9a04751c9550 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555b346f45f9a04751c9550 Content-Type: text/plain; charset=ISO-8859-1 Hi Luiz, all, I've done like you suggested, now the Lua file 'lmathlib.c' is unchanged. I've changed only my top-level file, gsl-shell.c in order to charge the math library as you suggested, thank you very much. So, now GSL shell just use a vanilla copy of Lua 5.1.4 with LNUM patch, I don't know if this help in order to put it LuaDist. For me there are two possible utilisation of GSL shell: - as a stand-alone program => in this case a top-level program charges all the needed library. In this case we can collapse the math and gsl functions in the common namespace - as a normal lua library => in this case a separate namespace is used for gsl and math functions. I've already integrated this possibility in the software with the FLAG USE_SEPARATE_NAMESPACE in defs.h For me it would be nice if GSL Shell can be made available as a library to Lua users even in my main goal in the stand-alone program. Francesco 2009/10/3 Luiz Henrique de Figueiredo > > Basically, you may do > > > > for k,v in pairs(math) do _G[k] = v end > > In C that could be simpler: > > lua_pushvalue(L,LUA_GLOBALSINDEX); /* open math in global scope */ > lua_setglobal(L,LUA_MATHLIBNAME); > luaopen_math(L); > lua_pushnil(L); /* remove math */ > lua_setglobal(L,LUA_MATHLIBNAME); > > This is what my ae does: > http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#ae > --00032555b346f45f9a04751c9550 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Luiz, all,

I've done like you suggested, now the = Lua file 'lmathlib.c' is unchanged. I've changed only my top-le= vel file, gsl-shell.c in order to charge the math library as you suggested,= thank you very much.

So, now GSL shell just use a vanilla copy of Lua 5.1.4 = with LNUM patch, I don't know if this help in order to put it LuaDist. = For me there are two possible utilisation of GSL shell:
- as a st= and-alone program =3D> in this case a top-level program charges all the = needed
=A0=A0library. In this case we can collapse the math and gsl functions= in the common namespace
- as a normal lua library =3D> in thi= s case a separate namespace is used for gsl and math
=A0=A0 funct= ions. I've already integrated this possibility in the software with the= FLAG
=A0=A0 USE_SEPARATE_NAMESPACE in defs.h

For m= e it would be nice if GSL Shell can be made available as a library to Lua u= sers even in my main goal in the stand-alone program.

<= div> Francesco

2009/10/3 Luiz Henrique de Figu= eiredo <lhf@= tecgraf.puc-rio.br>
> Basically, you may do
>
> =A0 for k,v in pairs(math) do _G[k] =3D v end

In C that could be simpler:

=A0 lua_pushvalue(L,LUA_GLOBALSINDEX); =A0 /* open math in global scope */=
=A0 lua_setglobal(L,LUA_MATHLIBNAME);
=A0 luaopen_math(L);
=A0 lua_pushnil(L); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* remove m= ath */
=A0 lua_setglobal(L,LUA_MATHLIBNAME);

This is what my ae does:
=A0 =A0 =A0 =A0http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#ae

--00032555b346f45f9a04751c9550-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 12:15:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n94FFYDo016948; Sun, 4 Oct 2009 12:15:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4CAB192E5; Sun, 4 Oct 2009 12:14:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00BC718FD6 for ; Sun, 4 Oct 2009 12:14:21 -0300 (BRT) Received: by ewy26 with SMTP id 26so2344560ewy.5 for ; Sun, 04 Oct 2009 08:14:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.77 with SMTP id x55mr800852wee.85.1254669298352; Sun, 04 Oct 2009 08:14:58 -0700 (PDT) In-Reply-To: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> Date: Sun, 4 Oct 2009 16:14:58 +0100 X-Google-Sender-Auth: a133f5f0f1b49872 Message-ID: Subject: Re: Lua t-shirts From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I am probably rather strange, but I'd quite like to see a shirt incorporating the Lua logo, as well as a Lua program. Even better would be if the logo *was* a Lua program, perhaps along the lines of http://codepad.org/cmQIjdzI On Sat, Oct 3, 2009 at 7:54 PM, Stefan wrote: > Like so? > > http://i33.tinypic.com/2r2lq2p.jpg > http://i37.tinypic.com/10o0c3r.jpg > > I would be happy to send the artwork to someone so they could upload it to > the cafepress store... > > Phoenix Sol wrote: >>> >>> I'd buy a shirt from the Lua website to help financially support the >>> project if they were available. *hint hint*! >> >> Me, too; but only if available in black ;) >> > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 12:44:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n94FhwAR019573; Sun, 4 Oct 2009 12:43:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C7441931E; Sun, 4 Oct 2009 12:43:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 552BF18B15 for ; Sun, 4 Oct 2009 12:42:54 -0300 (BRT) Received: by vws15 with SMTP id 15so1233400vws.5 for ; Sun, 04 Oct 2009 08:43:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.79.140 with SMTP id p12mr8328534vck.57.1254671010078; Sun, 04 Oct 2009 08:43:30 -0700 (PDT) In-Reply-To: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> From: Phoenix Sol Date: Sun, 4 Oct 2009 10:43:10 -0500 Message-ID: <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> Subject: Re: Lua t-shirts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 4, 2009 at 10:14 AM, Peter Cawley wrote: > I am probably rather strange, but I'd quite like to see a shirt > incorporating the Lua logo, as well as a Lua program. Even better > would be if the logo *was* a Lua program, perhaps along the lines of > http://codepad.org/cmQIjdzI Hey, that's cool. Do you craft those things by hand?! I recently bought the thinkgeek t-shirt that says, " while ( ! ( succeed = try() ) ); ". I think it would be kinda cool to make a Lua variant (but one that actually says "Lua" on it). Something like: #!/usr/bin/lua ... while not succeed do try() end From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 14:05:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n94H5X2P026678; Sun, 4 Oct 2009 14:05:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79E5018A9B; Sun, 4 Oct 2009 14:04:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 646AC18A4B for ; Sun, 4 Oct 2009 14:04:19 -0300 (BRT) Received: by yxe37 with SMTP id 37so2428840yxe.33 for ; Sun, 04 Oct 2009 10:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vGSq2zHHZCy98p/PZrRCB1VeG9wOAGjjcfF+cplbnTA=; b=h9nMPGg24/1uvNW6OWIqBFJAyz1tCde+ecTN1l3QezSYH9Q8Nk68CILotvsG/ff33V lM8ZThwSD/c/jgYA0NQmxRoA2K3bXsyidb8uqWEFjqLu8pT5/UTD2fNSzDqBOdDetUkx NrK52T+f04/RyV4t1bsR+qzTG4ObppKrPegUE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PDsT2D2GyQ5zrwyGYXI3sniohch3ndKeDq91Fwg/ZNiocXpeYS2nCm0wTUj/2qiDiM GlrsU44c4zptri/ASvGSokD7UIx7mzf+GeGcq2yuFunNHRW1ipCIZ30dnsEwJawS0aLP PXiotqc71QL1v09kKHKAa+O8HIvqNBZ4ZTFmU= MIME-Version: 1.0 Received: by 10.150.244.4 with SMTP id r4mr8297680ybh.127.1254675896314; Sun, 04 Oct 2009 10:04:56 -0700 (PDT) In-Reply-To: <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> Date: Sun, 4 Oct 2009 10:04:56 -0700 Message-ID: <1079b050910041004l792b543uf0a5f8f18b7b62c9@mail.gmail.com> Subject: Re: Lua t-shirts From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I recently bought the thinkgeek t-shirt that says, " while ( ! ( > succeed = try() ) ); ". > I think it would be kinda cool to make a Lua variant (but one that > actually says "Lua" on it). Something like: > > #!/usr/bin/lua > ... > while not succeed do try() end > Some perl microcodes for inspiration: http://pallit.lhi.is/microcodes/ wes From lua-bounces@bazar2.conectiva.com.br Sun Oct 4 15:40:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n94IejNB002550; Sun, 4 Oct 2009 15:40:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB0CC18D1B; Sun, 4 Oct 2009 15:39:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E0EB18B15 for ; Sun, 4 Oct 2009 15:39:30 -0300 (BRT) Received: from [192.168.254.14] (cheetah-tiv-ve3000-125-0194.bmts.com [209.240.125.194]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n94IdoTg011000 for ; Sun, 4 Oct 2009 14:40:02 -0400 Message-ID: <4AC8EBF5.7010504@hempeldesigngroup.com> Date: Sun, 04 Oct 2009 14:39:49 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Lua t-shirts References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> In-Reply-To: <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Phoenix Sol wrote: > On Sun, Oct 4, 2009 at 10:14 AM, Peter Cawley wrote: >> I am probably rather strange, but I'd quite like to see a shirt >> incorporating the Lua logo, as well as a Lua program. Even better >> would be if the logo *was* a Lua program, perhaps along the lines of >> http://codepad.org/cmQIjdzI > > Hey, that's cool. Do you craft those things by hand?! > > I recently bought the thinkgeek t-shirt that says, " while ( ! ( > succeed = try() ) ); ". > I think it would be kinda cool to make a Lua variant (but one that > actually says "Lua" on it). Something like: > > #!/usr/bin/lua > ... > while not succeed do try() end Speaking of silly programmer humour, I saw this one: A programmer started to cuss Because getting to sleep was a fuss As he tossed in his bed Looping 'round in his head Was "while( !asleep ) sheep++" From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 03:29:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n956TIkU027991; Mon, 5 Oct 2009 03:29:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E7A01A664; Mon, 5 Oct 2009 03:28:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF4FC1A5FB for ; Mon, 5 Oct 2009 03:27:59 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id 19so348638fgg.17 for ; Sun, 04 Oct 2009 23:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4uyQSHr+o3vzP0g67QkhgzWgwm1NMbf3m2DD5Wv/ox8=; b=SDgPlxwYY+ADAlDet7IurJS01cpzUxQXZCjDkUar+VfWpzwQJFFRpMWctt+7IB3XSS 7LNsX2UQ8477/iSw5D8B0Y+P0r1rMtdVXLsOPrDRJdQZorOdOn45SX+MW5uGNNV+4L65 pCrdFvGjwWwVvGF+o3532ORImYwE8etq0uRsQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gXOhmsHt3ubUi60dm8l2oE9eWyNY/msIdFZIUeHQoZ8zn++SH0p40F6bFDg+xoZUQ3 JpFYoQEaOqmoWL4+VM0gD51qZ4fH/ugTWJ9NsMJiZHcvAEcjqt2Maqp3KOvNXNM0nRGu HMclFc3RSfbpqtNLrhSEk8t8Iq0erOFj5nQwc= MIME-Version: 1.0 Received: by 10.239.190.216 with SMTP id y24mr506368hbh.185.1254724115481; Sun, 04 Oct 2009 23:28:35 -0700 (PDT) In-Reply-To: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> Date: Mon, 5 Oct 2009 08:28:35 +0200 Message-ID: <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> Subject: Re: Lua t-shirts From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 4, 2009 at 5:14 PM, Peter Cawley wrote: > I am probably rather strange, but I'd quite like to see a shirt > incorporating the Lua logo, as well as a Lua program. Even better > would be if the logo *was* a Lua program, perhaps along the lines of > http://codepad.org/cmQIjdzI Definitely the winner of two contests (a) typographic ingenuity and (b) obfuscation. Although if seen in public, might give the idea that Lua is a Brazillian variant of Brainf**k :) From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 05:40:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n958e9a3006685; Mon, 5 Oct 2009 05:40:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D71D191F2; Mon, 5 Oct 2009 05:39:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97D1F190FC for ; Mon, 5 Oct 2009 05:38:55 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Muj6P-0005X4-6D for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 09:39:29 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id BAB592E68D for ; Mon, 5 Oct 2009 09:39:25 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:24129 with envelope Message-ID: <4AC9B03F.9050404@cowlark.com> Date: Mon, 05 Oct 2009 09:37:19 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua t-shirts References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> In-Reply-To: <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 steve donovan wrote: [...] > Definitely the winner of two contests (a) typographic ingenuity and > (b) obfuscation. I'm still pushing for my proposal to allow all characters with codes in the range 128-255 to be considered valid in names. This would allow identifiers contain UTF-8 sequences. Apart from being friendly to non-English speaking programmers, this would also allow obfuscated programs the likes of which would be beyond our wildest nightmares. - -- David Given dg@cowlark.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrJsD8ACgkQf9E0noFvlzjquACgiBtzIlkuvUmJkmS4mOT0w8+g SiwAnjtxyiJ6Buw/vfW8rRNLA1tmEyYL =/qUN -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:20:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959KZ4I010090; Mon, 5 Oct 2009 06:20:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6237191D9; Mon, 5 Oct 2009 06:19:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC60C190F7 for ; Mon, 5 Oct 2009 06:19:22 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 1FEDCE20A9 for ; Mon, 5 Oct 2009 11:19:57 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JIBK-IaOVui9 for ; Mon, 5 Oct 2009 11:19:55 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 002FDE20B6; Mon, 5 Oct 2009 11:19:54 +0200 (CEST) Date: Mon, 5 Oct 2009 11:19:54 +0200 From: Ico To: Lua list Subject: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005091954.GJ9789@pruts.nl> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC9B03F.9050404@cowlark.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-05 David Given wrote : > I'm still pushing for my proposal to allow all characters with codes > in the range 128-255 to be considered valid in names. This would > allow identifiers contain UTF-8 sequences. Interesting idea. What's the catch, if there is one ? -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:28:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959S9XA010579; Mon, 5 Oct 2009 06:28:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09A1719276; Mon, 5 Oct 2009 06:27:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA654191AE for ; Mon, 5 Oct 2009 06:27:03 -0300 (BRT) Received: by bwz22 with SMTP id 22so2428761bwz.5 for ; Mon, 05 Oct 2009 02:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=C8AwTKbrV8fDkDoFkKueVQmlgOcIJfv7pIB5FFUOtas=; b=es1UWxjk6bmJnGxh9zWCnR9hnk0EIKQjnWJ2Ge8VEBdjdBkfk87DxbkTB8OlAjj7CV zjhs64gMTGpYBtyv0xU6bk4Ll7zkb1I83/WAeZEbeOcRoJCXY2h/5JZeBw5wDNjrnKF3 DNR6/tojq330a2xcC0L6ITFvX1yMGK6mLEBRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MNB1Bpiq2uvaz6YBj23YM1WjMj09ghRhYmmzpVlLySyy+ReUrM/f9Uof0UXpmrAQ1H AF1E3Vj0dmeqXryA+U4DiLq7MfOePimDuKnC7ip95ETSTMgBJRICrmv4//vcPr5NvpNq CGTX/Syj4ZnSRsE0unm3T30G20XlHLPe8WrEE= MIME-Version: 1.0 Received: by 10.204.11.18 with SMTP id r18mr3781755bkr.15.1254734859669; Mon, 05 Oct 2009 02:27:39 -0700 (PDT) In-Reply-To: <20091005091954.GJ9789@pruts.nl> References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> Date: Mon, 5 Oct 2009 10:27:39 +0100 Message-ID: <4db9cacb0910050227y34960fefm192cc410ddc1e0d1@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Matthew Wild To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n959S9XA010579 2009/10/5 Ico : > > * On 2009-10-05 David Given wrote  : > >> I'm still pushing for my proposal to allow all characters with codes >> in the range 128-255 to be considered valid in names.  This would >> allow identifiers contain UTF-8 sequences. > > Interesting idea. What's the catch, if there is one ? > I don't know of one, I'm also in favour of this, though I mainly just want some extra characters such as '!' that Ruby has (I've never written a line of Ruby, so I'm envious) for marking methods which mutate an object, and _ is over-used in Lua :) Matthew From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:29:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959TNLB010703; Mon, 5 Oct 2009 06:29:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E837C1928C; Mon, 5 Oct 2009 06:28:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 338FB191AE for ; Mon, 5 Oct 2009 06:28:22 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MujrY-0000wQ-22 for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 11:28:12 +0200 Received: from p5b2c214a.dip.t-dialin.net ([91.44.33.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Oct 2009 11:28:12 +0200 Received: from dak by p5b2c214a.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Oct 2009 11:28:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Lua t-shirts Date: Mon, 05 Oct 2009 11:25:57 +0200 Organization: Organization?!? Lines: 22 Message-ID: <871vlip4yi.fsf@lola.goethe.zz> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c214a.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:OsVQS4PXr0GSFhUsCvsa+IvpxeE= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given writes: > steve donovan wrote: > [...] >> Definitely the winner of two contests (a) typographic ingenuity and >> (b) obfuscation. > > I'm still pushing for my proposal to allow all characters with codes in > the range 128-255 to be considered valid in names. This would allow > identifiers contain UTF-8 sequences. Apart from being friendly to > non-English speaking programmers, this would also allow obfuscated > programs the likes of which would be beyond our wildest nightmares. One problem is that a lot of that UTF-8 stuff is punctuation. And some are even combining characters/diacritics. If you write such a combining character before an ASCII non-character, the resulting glyph is partly identifier, partly non-identifier. Is it Lua's problem? Perhaps not. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:30:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959UUo5010866; Mon, 5 Oct 2009 06:30:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB76F19294; Mon, 5 Oct 2009 06:29:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out6.iinet.net.au (outbound.icp-qv1-irony-out6.iinet.net.au [203.59.1.109]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C107191AE for ; Mon, 5 Oct 2009 06:29:29 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYAAHZZyUp8qYIQ/2dsb2JhbAAI0HCEKgSCKA X-IronPort-AV: E=Sophos;i="4.44,505,1249228800"; d="scan'208";a="12881720" Received: from unknown (HELO [10.1.1.2]) ([124.169.130.16]) by outbound.icp-qv1-irony-out6.iinet.net.au with ESMTP; 05 Oct 2009 17:30:05 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Jacques Chester In-Reply-To: <20091005091954.GJ9789@pruts.nl> Date: Mon, 5 Oct 2009 17:30:03 +0800 Content-Transfer-Encoding: 7bit Message-Id: <99065B6B-48DB-4A84-ACD9-8E05A60C62DA@chester.id.au> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 05/10/2009, at 5:19 PM, Ico wrote: > Interesting idea. What's the catch, if there is one ? Unicode contains a lot of characters which are distinct but visually identical or difficult to distinguish. This means, for instance, that you could have two different variables with the "same" name. For this reason DNS is still basically in ASCII, because it would make it too easy for phishers and squatters. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:32:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959WWmQ011053; Mon, 5 Oct 2009 06:32:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B6D719299; Mon, 5 Oct 2009 06:31:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA02E1924D for ; Mon, 5 Oct 2009 06:31:32 -0300 (BRT) Received: from cpc2-asht6-2-0-cust185.10-1.cable.virginmedia.com ([80.0.181.186] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MujvD-0003FU-AE for ; Mon, 05 Oct 2009 10:31:59 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MujvN-00055W-4V for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 10:32:09 +0100 Date: Mon, 5 Oct 2009 10:32:08 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005103208.487acb69@trite.i.flarn.net.i.flarn.net> In-Reply-To: <99065B6B-48DB-4A84-ACD9-8E05A60C62DA@chester.id.au> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <99065B6B-48DB-4A84-ACD9-8E05A60C62DA@chester.id.au> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 5 Oct 2009 17:30:03 +0800 Jacques Chester wrote: > On 05/10/2009, at 5:19 PM, Ico wrote: > > Interesting idea. What's the catch, if there is one ? > > Unicode contains a lot of characters which are distinct > but visually identical or difficult to distinguish. This > means, for instance, that you could have two different > variables with the "same" name. You can always shoot yourself in the foot. Like when somebody chooses a font where i and l are indistinguishable :) B. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:40:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959epCS011533; Mon, 5 Oct 2009 06:40:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8BF1192A0; Mon, 5 Oct 2009 06:39:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8117218BB1 for ; Mon, 5 Oct 2009 06:39:41 -0300 (BRT) Received: by bwz22 with SMTP id 22so2435810bwz.5 for ; Mon, 05 Oct 2009 02:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Xnbsn3OqaiWf3uiWvQgu4r7IlM/Tfq6nAxRVtpEtQ2E=; b=GJw90yt8X25qMK5qGhLrH5JFQ0sGLVO8bjADCth/ytxi2kH/cf7j3jwBAQm7g0DJxZ 8bnwGD0+QPR4EfuwTjYpm3XE67CzTk+3oJk/juW9VgENIz2Wm34SDFN/8//jVkkn7C+D WFj9OuOb4v4FoeX2L+pmQw28XMj4G0jiGAMTE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OFrhPiL5VLkydfIXfi8OrbTILN+pEGCT3XViLgIbUng66JFuAyoDEomTD1ARrCyriq AcWfrZUZ1XSfY0pN3MTkB5fELPKLkjrYzDamDNJXc5Lzplkm2i6iJktZgA7YlWUszpJr w7u56mR9R0U44xaYCUPoL9V19Zkur1ZId2AVw= MIME-Version: 1.0 Received: by 10.103.86.34 with SMTP id o34mr1611396mul.118.1254735615926; Mon, 05 Oct 2009 02:40:15 -0700 (PDT) In-Reply-To: <20091005091954.GJ9789@pruts.nl> References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> Date: Mon, 5 Oct 2009 11:40:15 +0200 Message-ID: Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Mauro Iazzi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n959epCS011533 2009/10/5 Ico : > > * On 2009-10-05 David Given wrote  : > >> I'm still pushing for my proposal to allow all characters with codes >> in the range 128-255 to be considered valid in names.  This would >> allow identifiers contain UTF-8 sequences. > > Interesting idea. What's the catch, if there is one ? And conversely, what is the advantage? ;) The only language I know that is doing this is Falcon ( http://falconpl.org/ ). If there are stats for how many people use this feature it would be interesting. mauro From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:41:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959fTLo011616; Mon, 5 Oct 2009 06:41:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 234E4192A7; Mon, 5 Oct 2009 06:40:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8304E192A1 for ; Mon, 5 Oct 2009 06:40:09 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so561940eye.39 for ; Mon, 05 Oct 2009 02:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=OWH0iMjgS9moeLFdUN7ZGo8XAMo3DQsKQzYUmsgyrXw=; b=CEKy3PiWhZmwmXkBEgdeVGXJEN06YhiCubLry1ejK3//PR9iIBIByOJ/TpTyAaVkaS pwLz8lGlRMJGntYVZP1idfeiZJ0WdFNo3ewlTnit7uLfBl9bi21Qo0+frBRqkQ+3Uf/x /TwuhcySUAphR74+dcq8yzJEOdIZt7QdA13ic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=wDIDVHvgpk6sZ6+PzmKXB6tIqQx5Jf8HamHtRyVMPPmsN7eFPAQVH30fwt6MckNmzY VkLWbu6EvWPfpgWQv14fhAq7XqzQArLK8WUM5L1D6UVoUxORLv1NZddaRcmpv+biAqNk DEbQyzwaNScBVeNJ2AYINJGl9sjnsm1ctuCfM= MIME-Version: 1.0 Received: by 10.216.90.208 with SMTP id e58mr944883wef.57.1254735646332; Mon, 05 Oct 2009 02:40:46 -0700 (PDT) In-Reply-To: <20091005091954.GJ9789@pruts.nl> References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> From: Jerome Vuarand Date: Mon, 5 Oct 2009 11:40:26 +0200 Message-ID: <89d273ba0910050240x62c856b8t1385f0345d2e4304@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/5 Ico : > > * On 2009-10-05 David Given wrote : > >> I'm still pushing for my proposal to allow all characters with codes >> in the range 128-255 to be considered valid in names. This would >> allow identifiers contain UTF-8 sequences. > > Interesting idea. What's the catch, if there is one ? Lua lexer uses isalpha C function, therefore depending on the locale some of the characters in 128-255 are already valid. You could change it to allow all characters in 128-255 in addition to 'alpha' class and underscore, but that would be a hack imho. On the other hand, as far as I can tell making the lexer unicode-aware (so that you can use iwalpha) would require a major overhaul, especially since Lua strings are not strings of characters but string of bytes (and are often used to hold non-textual binary data). From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 06:46:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n959kCt9012001; Mon, 5 Oct 2009 06:46:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9705192A8; Mon, 5 Oct 2009 06:45:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C27119292 for ; Mon, 5 Oct 2009 06:45:02 -0300 (BRT) Received: by ewy26 with SMTP id 26so2859856ewy.5 for ; Mon, 05 Oct 2009 02:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=XpUhLyq+X7ZmH7p0QNQ50hABBMEOMMwGGyM9hqYtmWk=; b=ESzoZf6vH28EkYYaomaj4kf9WiFzA+Vd/9Le5rawMRIWv6IsA/Vvj8/cnFBT6k4aEj hKI8DHwG6B+MboZpspHm3YQKRf5tcjZvM11IW3zEGDOvyCP7Vylhyt+qfwibW9LGDKh6 44G/dBJW25BWpqPiaU25zcpZLQz5Oj0cQARYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ND0WpHKguzMky5f1EXq7cdn/eEIepYDEjhRf6ZbttmO03R8nRL1neuuuolKNbdS5T6 9m5EfzyO79eWcSI+hLquHQN986NQNwI56iJnKxkbMsqxLHPxrVtMrWQTD4Rpr2STmSLe pQts/FhXXPum4t6OKehPYvHtbqXNweJNSJUrY= MIME-Version: 1.0 Received: by 10.216.48.85 with SMTP id u63mr964478web.117.1254735938187; Mon, 05 Oct 2009 02:45:38 -0700 (PDT) In-Reply-To: References: <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> From: Jerome Vuarand Date: Mon, 5 Oct 2009 11:45:18 +0200 Message-ID: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/5 Mauro Iazzi : > 2009/10/5 Ico : >> >> * On 2009-10-05 David Given wrote : >> >>> I'm still pushing for my proposal to allow all characters with codes >>> in the range 128-255 to be considered valid in names. This would >>> allow identifiers contain UTF-8 sequences. >> >> Interesting idea. What's the catch, if there is one ? > > And conversely, what is the advantage? ;) Being able to use accented letters or even non-roman characters would be a useful tool to teach programming to people not speaking english. Ideally you would need to translate keywords, libraries and built-in error messages, but given Lua's size that seems reasonnable to do. > The only language I know that is doing this is Falcon ( > http://falconpl.org/ ). If there are stats for how many people use > this feature it would be interesting. > > mauro > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 07:06:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95A6cwI013512; Mon, 5 Oct 2009 07:06:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55BC119235; Mon, 5 Oct 2009 07:05:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B47771917B for ; Mon, 5 Oct 2009 07:05:29 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MukSC-0007jc-3G for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 11:06:04 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B680F8C1A6 for ; Mon, 5 Oct 2009 11:06:00 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:21965 with envelope Message-ID: <4AC9C502.1050103@cowlark.com> Date: Mon, 05 Oct 2009 11:05:54 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050240x62c856b8t1385f0345d2e4304@mail.gmail.com> In-Reply-To: <89d273ba0910050240x62c856b8t1385f0345d2e4304@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95A6cwI013512 Jerome Vuarand wrote: [...] > Lua lexer uses isalpha C function, therefore depending on the locale > some of the characters in 128-255 are already valid. It shouldn't be! It should be using the C locale for all code-related parsing --- languages should never, ever, under *any* circumstances, change their behaviour depending on locale! That way lies madness, with a perfectly valid program on one computer failing to run on another simply due to some user configuration setting. I've been burnt by this before. It's decidedly not fun. > You could change > it to allow all characters in 128-255 in addition to 'alpha' class and > underscore, but that would be a hack imho. Of course! But it's a *useful* hack. We lose nothing by it, but gain functionality in other areas --- there are other ASCII-compatible encodings that this would work with, for example. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 07:26:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95AQA8U015040; Mon, 5 Oct 2009 07:26:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F5E119155; Mon, 5 Oct 2009 07:25:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29BE118FCC for ; Mon, 5 Oct 2009 07:25:02 -0300 (BRT) Received: by bwz22 with SMTP id 22so2462279bwz.5 for ; Mon, 05 Oct 2009 03:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=WDOPdQhOjB4Z1MBN7UTaRoh02q78N6pMfg9uSue1hDA=; b=HOSRqex7LDetdiPeKVst9geUmMzQzf07esxl7fGiiK+7Xe5V1/3ua3SM930+auHWq2 MSMMOD+sM0V2XOL6Q5a5IEgETwFrQT4esWweQY5JX6YYD+AlMcgmrZltS3YFHXIy5por ERQLnOvnepKZ01TLg9vgB+3RARytFoR0e2xWU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kXyUJ8cdlSJ0/gVhCZQD8KJ9NfxPMYxIcGwHDRFuHCIBUyOHW7EEjzb6O5HrumDgYe xyMJorppAhjLA+K6kGgJlU30OsEJyOS+6buCprRkgkqkq4umU9X5s9FBktW+NdCe/iS9 S6wDYCitjVCG63f2FzF5uqIsLhxCCA1m32bfE= MIME-Version: 1.0 Received: by 10.103.86.8 with SMTP id o8mr2163974mul.19.1254738339252; Mon, 05 Oct 2009 03:25:39 -0700 (PDT) In-Reply-To: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> References: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> Date: Mon, 5 Oct 2009 12:25:39 +0200 Message-ID: Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Mauro Iazzi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95AQA8U015040 2009/10/5 Rob Kendrick : > On Mon, 5 Oct 2009 17:30:03 +0800 > Jacques Chester wrote: > >> On 05/10/2009, at 5:19 PM, Ico wrote: >> > Interesting idea. What's the catch, if there is one ? >> >> Unicode contains a lot of characters which are distinct >> but visually identical or difficult to distinguish. This >> means, for instance, that you could have two different >> variables with the "same" name. > > You can always shoot yourself in the foot. Like when somebody chooses > a font where i and l are indistinguishable :) In Unicode there are character sequences that are defined to correspond to the same glyph. Whether you get the correct identifier or not may depend on your editor saving the "accented character" sequence or character+accent sequence, for example. Of course, you can ignore this problem if you use the same editor (and likely input method) or some other tool to normalize the identifiers. 2009/10/5 Jerome Vuarand : > 2009/10/5 Mauro Iazzi : >> 2009/10/5 Ico : >>> >>> * On 2009-10-05 David Given wrote  : >>> >>>> I'm still pushing for my proposal to allow all characters with codes >>>> in the range 128-255 to be considered valid in names.  This would >>>> allow identifiers contain UTF-8 sequences. >>> >>> Interesting idea. What's the catch, if there is one ? >> >> And conversely, what is the advantage? ;) > > Being able to use accented letters or even non-roman characters would > be a useful tool to teach programming to people not speaking english. > Ideally you would need to translate keywords, libraries and built-in > error messages, but given Lua's size that seems reasonnable to do. I guess this is a widely debated topic, I stay skeptical of any opinion until there is evidence :) Anyway the question was more about the merit of including the support in the language itself with respect to mantaining some PowerPatch. And also, if this feature were to be included, how many people would patch it out? mauro From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 07:40:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95AeiAm018620; Mon, 5 Oct 2009 07:40:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C950190F7; Mon, 5 Oct 2009 07:39:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57DAD1902A for ; Mon, 5 Oct 2009 07:39:32 -0300 (BRT) Received: from localhost by maia.amarino.de with local id 1Mukz9-0007Mg-00; Mon, 05 Oct 2009 12:40:07 +0200 Date: Mon, 5 Oct 2009 12:39:59 +0200 From: Mike Pall To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005103959.GA5909@mike.de> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AC9B03F.9050404@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > I'm still pushing for my proposal to allow all characters with codes in > the range 128-255 to be considered valid in names. This would allow > identifiers contain UTF-8 sequences. http://lua-users.org/lists/lua-l/2009-05/msg00414.html --Mike From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 07:41:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95AfD2M018708; Mon, 5 Oct 2009 07:41:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E85FA1A5DD; Mon, 5 Oct 2009 07:39:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CF5B1888F for ; Mon, 5 Oct 2009 07:39:37 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id n95AeDHx019423 for ; Mon, 5 Oct 2009 12:40:13 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHRpyUrDbohb/2dsb2JhbADQXIQqBA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 05 Oct 2009 12:40:13 +0200 Received: from [192.168.127.128] (host130-103-dynamic.45-79-r.retail.telecomitalia.it [79.45.103.130]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n95AeAM3048217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 5 Oct 2009 12:40:12 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4AC9CD05.4000507@erix.it> Date: Mon, 05 Oct 2009 12:40:05 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> In-Reply-To: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jerome Vuarand wrote: > Being able to use accented letters or even non-roman characters would > be a useful tool to teach programming to people not speaking english. ...or just contribute to their confusion. You don't probably know how many Italians type the wrong accent on the letter 'e' while just writing. Many don't even know that there are two different accents. I found no difficulty in teaching programming to non-english people using ASCII... and I suspect the Lua authors didn't either :-) Enrico From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 08:04:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95B4n43020825; Mon, 5 Oct 2009 08:04:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9AEF01A5E5; Mon, 5 Oct 2009 08:03:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from uhweb12247.united-hoster.com (toolslave.net [85.88.12.247]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B35AE192D0 for ; Mon, 5 Oct 2009 08:03:44 -0300 (BRT) Received: from soft83.vub.ac.be ([134.184.43.183]) by uhweb12247.united-hoster.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1MulMH-0004dG-F8; Mon, 05 Oct 2009 13:04:18 +0200 From: Stefan Marr Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: LuaLanes and Snow Leopard OSX 10.6 Date: Mon, 5 Oct 2009 13:03:56 +0200 Message-Id: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> To: akauppi@gmail.com, Lua list Mime-Version: 1.0 (Apple Message framework v1074) X-Mailer: Apple Mail (2.1074) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Asko, Hi list: I tried to experiment with LuaLanes, but have some problems on my Snow Leopard installation. Every time I try to run one of the test I get an malloc error like this: lanes-2.0.3$ LUA_CPATH=./src/?.so LUA_PATH="src/?.lua;./tests/?.lua" lua tests/recursive.lua depth: 0 1 2 3 4 5 6 7 8 9 10 11 lua(61739,0x7fff71085be0) malloc: *** error for object 0x1000ad1a0: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug I tried to use luarocks from MacPorts to install lanes, but there is no rock spec. for the latest version, and for the 2.0 version, the download is gone, so it just failed installing. Furthermore, I followed the hints in the README to compile Lua with LUA_USE_DLOPEN and LUA_USE_POSIX as well as using a dylib for the core and library code, as described. However, I am still ending up with the error given above. Any thoughts how this could be fixed? Many thanks and best regards Stefan BTW: On an Ubuntu, it works fine... -- Stefan Marr Software Languages Lab Former Programming Technology Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://prog.vub.ac.be/~smarr Phone: +32 2 629 3956 Fax: +32 2 629 3525 From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 08:27:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95BRfVu023322; Mon, 5 Oct 2009 08:27:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6406C321B3; Mon, 5 Oct 2009 08:26:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B79118A0C for ; Mon, 5 Oct 2009 08:26:25 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MuliW-0004Jf-Pp for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 13:27:00 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Oct 2009 13:27:00 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Oct 2009 13:27:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Mon, 05 Oct 2009 13:26:38 +0200 Lines: 31 Message-ID: References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050240x62c856b8t1385f0345d2e4304@mail.gmail.com> <4AC9C502.1050103@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4AC9C502.1050103@cowlark.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 05/10/2009 12:05, David Given wrote: > It shouldn't be! It is here from the start, and documented: "Lexical Conventions: (The definition of letter depends on the current locale: any character considered alphabetic by the current locale can be used in an identifier.)" > It should be using the C locale for all code-related > parsing --- languages should never, ever, under *any* circumstances, > change their behaviour depending on locale! It has always been a controversial point, but in practice most users discipline themselves and stick to Ascii... I believe the historical reason for this choice goes back when Lua was used as data metalanguage: it allows to use locale names as keys for tables: a = { Roméo = "Juliette", César = "Brutus" } Although I cannot test that because it seems that on Windows it defaults to C locale and refuses to change (unless I am doing something wrong). I tried with Web Lua but it doesn't expose os table (I can understand why...). Ah, I can do that in Lua.org live demo but I still can't change the locale. Perhaps I am doing something wrong? -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 08:41:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95Bf7Z9024735; Mon, 5 Oct 2009 08:41:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAD4619290; Mon, 5 Oct 2009 08:40:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52B84191B7 for ; Mon, 5 Oct 2009 08:40:00 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95BeaTS024707 for ; Mon, 5 Oct 2009 08:40:37 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n95Bea613857; Mon, 5 Oct 2009 08:40:36 -0300 Date: Mon, 5 Oct 2009 08:40:35 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005084035.B13818@lua.tecgraf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005103959.GA5909@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091005103959.GA5909@mike.de>; from mikelu-0910@mike.de on Mon, Oct 05, 2009 at 12:39:59PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > David Given wrote: > > I'm still pushing for my proposal to allow all characters with codes in > > the range 128-255 to be considered valid in names. This would allow > > identifiers contain UTF-8 sequences. > > http://lua-users.org/lists/lua-l/2009-05/msg00414.html Lua 5.2 will have a small, separate lctype.c. You could simply edit it at will and add it to your app without even rebuilding Lua. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:11:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CBErx028512; Mon, 5 Oct 2009 09:11:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F43518FAA; Mon, 5 Oct 2009 09:10:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1592C18D90 for ; Mon, 5 Oct 2009 09:09:54 -0300 (BRT) Received: by ewy26 with SMTP id 26so2963625ewy.5 for ; Mon, 05 Oct 2009 05:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=PzE9Oa4NelSIXMRfsn1PB5IBVSX4BQ0BpvsYEiMOvxE=; b=hZ0aVA2VZdwTjy3lnBr79SInTKY/u9fLcGjNSWL8b0M0dijc/CmdK1aE9tAyltscvc rcm+cDDhys5mcKfmIgPYjIMeD3tDxhDC7gol5x246Ry47V3619spZaDLhKRivhXX4Pd9 s/ROwc+FSutud+0DqfoVc2G3dbLbTk4I24vtY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=wURW5cGD8gar+C6hzpQv3+EE5p0KGxdxKo0J5gKXddH5F+BOuYz585QFAktQjyPdJv DQJY0qzxRDwyZKnnt8E+CsOVBRbOipb4Hjy+MlznuBQHWtVPEDKQ5Y8vlcvnWWlY27+C F/SVlk9q1HPUVCg5qBvyHHW9JqRLkXz1ILluE= MIME-Version: 1.0 Received: by 10.216.90.7 with SMTP id d7mr1013603wef.81.1254744631466; Mon, 05 Oct 2009 05:10:31 -0700 (PDT) In-Reply-To: <4AC9CD05.4000507@erix.it> References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> From: Jerome Vuarand Date: Mon, 5 Oct 2009 14:10:11 +0200 Message-ID: <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/5 Enrico Colombini : > Jerome Vuarand wrote: >> >> Being able to use accented letters or even non-roman characters would >> be a useful tool to teach programming to people not speaking english. > > ...or just contribute to their confusion. You don't probably know how many > Italians type the wrong accent on the letter 'e' while just writing. Many > don't even know that there are two different accents. > > I found no difficulty in teaching programming to non-english people using > ASCII... and I suspect the Lua authors didn't either :-) Italian and portuguese use alphabets based on the latin one, as do most european languages, and most of these alphabets letters have a very similar cousin in ASCII. But think about Russian, Chinese or Japanese people. While most can use a roman alphabet, many (especially the young) may be more comfortable with their local characters. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:31:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CVie9031631; Mon, 5 Oct 2009 09:31:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CF9E1A667; Mon, 5 Oct 2009 09:30:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kirsi2.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABDBD190DD for ; Mon, 5 Oct 2009 09:30:30 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by kirsi2.inet.fi (8.5.014) (authenticated as forske-1) id 4A77692A02557045 for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 15:31:07 +0300 Message-ID: <4AC9E708.5070507@pp.inet.fi> Date: Mon, 05 Oct 2009 15:31:04 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> In-Reply-To: <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If these would-be programmers are so young they have problems using Latin/ASCII, then they shouldn't be learning Lua, or any other programming language for that matter. I strongly doubt this is of any serious concern. Possible useful for someone, but I would strongly recommend AGAINST it. To me there are exactly 63 literal characters (damn it, I need one more!), 26 lowercase, 26 uppercase, 10 numbers, underscore (and I want one more, damn it!). Preferrably no dinstinction between case. If you cannot program using these 63 (64 *sigh*) characters (not including operators or other special characters), either your mind, or the programming language you are using is broken. Period. Simple, clean, regular, strict. No trouble, no confusion, no fuss, no shit, no nothing. Using UTF in strings or comments is ok (although preferrably comments should be in english to be more accessible), but if UTF is allowed in names, you could just as well let lose the demons of hell, a big sign on your arse that says, "free entry for demons" ^~^ No offence, but I think this is pretty pointless. "Everything should be made as simple as possible, but not simpler." -- Einstein This is akin to the GOTO problem. If you can't deal with/don't want the trouble associated with GOTO, don't include it in your language. Simply put, don't paint the devil on the wall. Only my personal opinion. Kenneth Jerome Vuarand wrote: > 2009/10/5 Enrico Colombini : >> Jerome Vuarand wrote: >>> Being able to use accented letters or even non-roman characters would >>> be a useful tool to teach programming to people not speaking english. >> ...or just contribute to their confusion. You don't probably know how many >> Italians type the wrong accent on the letter 'e' while just writing. Many >> don't even know that there are two different accents. >> >> I found no difficulty in teaching programming to non-english people using >> ASCII... and I suspect the Lua authors didn't either :-) > > Italian and portuguese use alphabets based on the latin one, as do > most european languages, and most of these alphabets letters have a > very similar cousin in ASCII. But think about Russian, Chinese or > Japanese people. While most can use a roman alphabet, many (especially > the young) may be more comfortable with their local characters. > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:33:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CXn1P032073; Mon, 5 Oct 2009 09:33:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F1CF1A66E; Mon, 5 Oct 2009 09:32:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 414C81A668 for ; Mon, 5 Oct 2009 09:32:41 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n95CXI9Z010017 for ; Mon, 5 Oct 2009 09:33:18 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 3154554C11D; Mon, 5 Oct 2009 09:33:19 -0300 (BRT) Date: Mon, 5 Oct 2009 09:33:19 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005123319.GC20292@inf.puc-rio.br> References: <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <99065B6B-48DB-4A84-ACD9-8E05A60C62DA@chester.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <99065B6B-48DB-4A84-ACD9-8E05A60C62DA@chester.id.au> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Unicode contains a lot of characters which are distinct > but visually identical or difficult to distinguish. This > means, for instance, that you could have two different > variables with the "same" name. Not to mention the same character encoded differently in two different files (e.g., one in Unicode the other in Latin1). Of course you can always shoot your own foot, but some shots are harder to heal than others. (But that would be a funny fragment to write: if ≺ < ≺ then ∗ = ∗ * ∗ end ) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:40:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CeNnU000800; Mon, 5 Oct 2009 09:40:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 641C41A66F; Mon, 5 Oct 2009 09:39:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dottedmag.net (burger.dottedmag.net [212.75.37.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 305C118815 for ; Mon, 5 Oct 2009 09:39:06 -0300 (BRT) Received: from vertex (unknown [91.197.127.125]) by dottedmag.net (Postfix) with ESMTPSA id 37E898C06C for ; Mon, 5 Oct 2009 14:39:40 +0200 (CEST) Received: from dottedmag by vertex with local (Exim 4.69) (envelope-from ) id 1Mumqm-0001rP-BQ for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 19:39:36 +0700 From: Mikhail Gusarov To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> Date: Mon, 05 Oct 2009 19:39:35 +0700 In-Reply-To: <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> (Jerome Vuarand's message of "Mon, 5 Oct 2009 14:10:11 +0200") Message-ID: <87my46qak8.fsf@vertex.dottedmag.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Twas brillig at 14:10:11 05.10.2009 UTC+02 when jerome.vuarand@gmail.com di= d gyre and gimble: JV> Italian and portuguese use alphabets based on the latin one, as do JV> most european languages, and most of these alphabets letters have a JV> very similar cousin in ASCII. c and =C4=8D, z and =C5=BE are quite different in, e.g. Czech. And think ab= out an Icelandic =C3=BE. JV> But think about Russian, Chinese or Japanese people. While most can JV> use a roman alphabet, many (especially the young) may be more JV> comfortable with their local characters. JFYI: there is special "School algorithmic language" succesfully used in schools in Russia, which recently has been revived and started to be used again (after years of darkness^Wteaching "how to write letters in Word"), now as a free software running under all major OSes. This kind of language has been designed with the single purpose: to teach algorithmics, by reducing all unnecessary distractions to minimum, so all the components: IDE, debugger and runtime environment have been written with this goal in mind. And of course it's fully Cyrillic. Note that it is designed to be a school language, universities don't need or use it. =2D-=20 http://fossarchy.blogspot.com/ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAEBCgAGBQJKyekIAAoJEJ0g9lA+M4iInlcP/RIi/hJKUH5TF4JkEkeAh7gj cqnnwrCk3ldUZCd6UWsA9r2HGFrTT/BZuPfYuVLJxiFq3JyEJOvb+MfhtgWvD2Sh Ty7cGOSblM8fI1YIy9mJ60V8S57KHaKgE8dQEUuIRWu/5YRMnodL/1cvrG+7S0ON T3VAe3H5SFY8z+qKjRskFqqWr9x8cq8+12aefbuMxjqLo6rd2PACNI0BZj74ew7R VDaKBpFjOajTbBc8YnwuY8yGoWRNzRbOqU5ZmocjWkKsP0m6ytYmW3eJ3ZZw+o0C s+If4ruU589neDgOPjBxBloOipP7iBqzQaUO4uB/ScfgdvVOYfDT23av/K0WImHu 21PuzmuPN/q/X9Ms2pLKj+YdHxvBCLogHUa3u6g6wudiwsjA/SVJ2kdL5H6zVYJI B9EdwVtuiG6gRwy9oCaWgva68EL282eHA/MQ1GlVxk0Cxfn4hMG2q0gNoBJw1WIq e/muXqoCVX6XUw5LNvvZle4PRtfKFirvSRPHCkEOQX68wGTzI2e9irfRcEiUgHAx 2DQbqz7LJP02+rGxU5JqbDH+xUc1X3P7RaaVOLtybfQt+8FKEEO2wWQ8K7znm0tG 1K68g1jbnl/bHFoQjyDmDEXYNliGkWlEFW3SYdP4bkOtt1cA9rtTb3IPOFoXJQjM X9fXAkNJwdn9eu/AjS16 =spjs -----END PGP SIGNATURE----- --=-=-=-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:43:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95ChITU001442; Mon, 5 Oct 2009 09:43:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A94BC1A677; Mon, 5 Oct 2009 09:42:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCD641A671 for ; Mon, 5 Oct 2009 09:41:57 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id n95CgW41087762 for ; Mon, 5 Oct 2009 14:42:32 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALOGyUrDbohb/2dsb2JhbADRA4QqBA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 05 Oct 2009 14:42:29 +0200 Received: from [192.168.127.128] (host179-231-dynamic.44-79-r.retail.telecomitalia.it [79.44.231.179]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n95CGtM3069493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 5 Oct 2009 14:16:56 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4AC9E3B2.2050106@erix.it> Date: Mon, 05 Oct 2009 14:16:50 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> In-Reply-To: <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jerome Vuarand wrote: > Italian and portuguese use alphabets based on the latin one, as do > most european languages, and most of these alphabets letters have a > very similar cousin in ASCII. But think about Russian, Chinese or > Japanese people. While most can use a roman alphabet, many (especially > the young) may be more comfortable with their local characters. True. On the other hand, this would make cross-border communication harder and so increase programming culture fragmentation (no, I don't claim to have a solution). Enrico From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:52:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CqJ5X003563; Mon, 5 Oct 2009 09:52:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84AF31A67D; Mon, 5 Oct 2009 09:51:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4EAF1A679 for ; Mon, 5 Oct 2009 09:51:03 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mun2M-00053o-Ft for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 13:51:34 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B6C6B527E2 for ; Mon, 5 Oct 2009 13:51:31 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:16632 with envelope Message-ID: <4AC9EBC6.6060800@cowlark.com> Date: Mon, 05 Oct 2009 13:51:18 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E708.5070507@pp.inet.fi> In-Reply-To: <4AC9E708.5070507@pp.inet.fi> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95CqJ5X003563 Kenneth Forsbäck wrote: > If these would-be programmers are so young they have problems using > Latin/ASCII, then they shouldn't be learning Lua, or any other > programming language for that matter. You're assuming that they speak a language with an easily latinised form. That's not necessarily the case. You look like you're Finnish --- Finnish uses accented characters, but you can easily force it into ASCII and produce comprehensible approximations of Finnish words that you can use in identifiers. But the same doesn't apply to Chinese, for example. Chinese latinisations are notoriously horrible; there are several conflicting versions (did you know that Beijing and Peking are *the same word*?). And besides, why should they have to? Why shouldn't they use their native language to write their code in? Why force them to use an alien alphabet just so that they can use Lua? Why make them do things *our* way, when such a tiny change would let them do things *their* way, in the way they find most comfortable? -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 09:53:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95CqxKK003745; Mon, 5 Oct 2009 09:53:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EF0F1A683; Mon, 5 Oct 2009 09:51:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 107291A67F for ; Mon, 5 Oct 2009 09:51:41 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mun33-0000ZW-Sc for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 13:52:18 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id AB984527E2 for ; Mon, 5 Oct 2009 13:52:14 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:6838 with envelope Message-ID: <4AC9EBF8.8010901@cowlark.com> Date: Mon, 05 Oct 2009 13:52:08 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> In-Reply-To: <4AC9E3B2.2050106@erix.it> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95CqxKK003745 Enrico Colombini wrote: [...] > True. On the other hand, this would make cross-border communication > harder and so increase programming culture fragmentation (no, I don't > claim to have a solution). Right now I'm working on site in Korea. Trust me, forcing identifiers to be ASCII *in no way helps* cross-border communication. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 10:04:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95D4c3F005809; Mon, 5 Oct 2009 10:04:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B9F11A688; Mon, 5 Oct 2009 10:03:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jenni1.inet.fi (mta-out.inet.fi [195.156.147.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE7D01A681 for ; Mon, 5 Oct 2009 10:03:22 -0300 (BRT) Received: from [84.251.98.199] (84.251.98.199) by jenni1.inet.fi (8.5.014) (authenticated as forske-1) id 4A776AE6023E896B for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 16:03:59 +0300 Message-ID: <4AC9EEBC.9040903@pp.inet.fi> Date: Mon, 05 Oct 2009 16:03:56 +0300 From: =?UTF-8?B?S2VubmV0aCBGb3JzYsOkY2s=?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E708.5070507@pp.inet.fi> <4AC9EBC6.6060800@cowlark.com> In-Reply-To: <4AC9EBC6.6060800@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yes, I am familiar with the problems of chinese transliteration, although I don't speak chinese. Japanese is my thing ^^ I guess you could call it the least-common-denominator or something. Not that I want to force them into something that for them is very inconvenient. With 1330 million cizitens, I guess programming with hanji names wouldn't be too bad, but I am still worried about "accessibility" and "shareability". As I said, keep it as simple as possible. If UTF-8 becomes valid for names, how are those who don't speak chinese going to use the code? How about rules for what is valid and what is not? Will there be a auxiliary program that can easily convert from hanji to latin characters? What about readability? Even though I'm Finnish (with Swedish mothertongue, but also fluent in Finnish) I have *never* used neither Finnish nor Swedish identifiers. Even back in primary school when I first started with my 386 and qbasic, it was always English. In my oppinion, the first and foremost important aspect of programming is sharing. Sure, if it's closed source I couldn't care less. However, if you allow UTF-8 you need to be prepared to deal with all the problems it is going to present. If you do so, then great, it might not be a total failure after all. HOWEVER, if you go into this half-arsedly, without proper understanding of the scale of such a project, it is only going to cause more trouble than solve anything. Kenneth David Given wrote: > Kenneth Forsbäck wrote: >> If these would-be programmers are so young they have problems using >> Latin/ASCII, then they shouldn't be learning Lua, or any other >> programming language for that matter. > > You're assuming that they speak a language with an easily latinised > form. That's not necessarily the case. You look like you're Finnish --- > Finnish uses accented characters, but you can easily force it into ASCII > and produce comprehensible approximations of Finnish words that you can > use in identifiers. > > But the same doesn't apply to Chinese, for example. Chinese > latinisations are notoriously horrible; there are several conflicting > versions (did you know that Beijing and Peking are *the same word*?). > > And besides, why should they have to? Why shouldn't they use their > native language to write their code in? Why force them to use an alien > alphabet just so that they can use Lua? Why make them do things *our* > way, when such a tiny change would let them do things *their* way, in > the way they find most comfortable? > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 10:55:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95DtoT6016074; Mon, 5 Oct 2009 10:55:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2494F1A674; Mon, 5 Oct 2009 10:54:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8062318941 for ; Mon, 5 Oct 2009 10:54:21 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id 5BD7FE0116 for ; Mon, 5 Oct 2009 16:54:48 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> Date: Mon, 05 Oct 2009 16:54:53 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091005091954.GJ9789@pruts.nl> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > * On 2009-10-05 David Given wrote : > >> I'm still pushing for my proposal to allow all characters with codes >> in the range 128-255 to be considered valid in names. This would >> allow identifiers contain UTF-8 sequences. > > Interesting idea. What's the catch, if there is one ? > It would also allow UTF-8 whitespace (http://en.wikipedia.org/wiki/Whitespace_(computer_science)) and Latin-1 control characters (C1, the 80-9F range) in names. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 10:56:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95Duili016359; Mon, 5 Oct 2009 10:56:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A03F1A67A; Mon, 5 Oct 2009 10:55:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8F8F1A678 for ; Mon, 5 Oct 2009 10:55:20 -0300 (BRT) Received: from inga-1.microlink.com.br ([200.239.245.44] helo=200.159.251.20) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1Muo2d-00074h-NW for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 10:55:56 -0300 Date: Mon, 5 Oct 2009 10:55:55 -0300 To: Lua list From: Aleirade Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <988ad2704d15d0e66154c16bc68d5152@200.159.251.20> X-Priority: 3 X-Mailer: PHPMailer [version 1.72] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean AFAIK, Java also allows Unicode characters in identifiers. Note: I've never seen a Java program using non-ASCII characters in their identifiers. Cheers, Andre --------- Mensagem Original -------- De: Lua list Para: Lua list Assunto: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Data: 05/10/09 06:40 > 2009/10/5 Ico <lua@zevv.nl>: > > > > * On 2009-10-05 David Given <dg@cowlark.com> wrote  : > > > >> I'm still pushing for my proposal to allow all characters with codes > >> in the range 128-255 to be considered valid in names.  This would > >> allow identifiers contain UTF-8 sequences. > > > > Interesting idea. What's the catch, if there is one ? > > And conversely, what is the advantage? ;) > > The only language I know that is doing this is Falcon ( > http://falconpl.org/ ). If there are stats for how many people use > this feature it would be interesting. > > mauro > > ________________________________________________________________ Mensagem enviada pelo Microlink Webmail 12.7.8p3 From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 11:09:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95E9ExU019841; Mon, 5 Oct 2009 11:09:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3091C187E6; Mon, 5 Oct 2009 11:07:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25D52187A6 for ; Mon, 5 Oct 2009 11:07:48 -0300 (BRT) Received: from inga-1.microlink.com.br ([200.239.245.44] helo=200.159.251.20) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MuoEj-0007FY-Tg for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 11:08:25 -0300 Date: Mon, 5 Oct 2009 11:08:25 -0300 To: Lua list From: Aleirade Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: X-Priority: 3 X-Mailer: PHPMailer [version 1.72] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Talking about sharing, right now the only true way of sharing Lua programs is in source code since compiled Lua scripts are not endian-aware. Having locale-dependent or user-defined-charset identifiers means problems to share scripts in source code too. IMHO, the only way out of the basic ASCII charset for identifiers is Unicode, but for that to work one has to know in which encoding his editor saves the files, and the Lua interpreter/compiler has to be configured to run/compile scripts in that same encoding by converting the identifiers to Unicode first. Maybe that's the reason why there aren't Java programs using non-ASCII characters in their identifiers :-) Cheers, Andre --------- Mensagem Original -------- De: Lua list Para: Lua list Assunto: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Data: 05/10/09 10:04 > Yes, I am familiar with the problems of chinese transliteration, > although I don't speak chinese. Japanese is my thing ^^ > > I guess you could call it the least-common-denominator or something. Not > that I want to force them into something that for them is very > inconvenient. With 1330 million cizitens, I guess programming with hanji > names wouldn't be too bad, but I am still worried about "accessibility" > and "shareability". > > As I said, keep it as simple as possible. If UTF-8 becomes valid for > names, how are those who don't speak chinese going to use the code? How > about rules for what is valid and what is not? Will there be a auxiliary > program that can easily convert from hanji to latin characters? What > about readability? > > Even though I'm Finnish (with Swedish mothertongue, but also fluent in > Finnish) I have *never* used neither Finnish nor Swedish identifiers. > Even back in primary school when I first started with my 386 and qbasic, > it was always English. In my oppinion, the first and foremost important > aspect of programming is sharing. > > Sure, if it's closed source I couldn't care less. > > However, if you allow UTF-8 you need to be prepared to deal with all the > problems it is going to present. If you do so, then great, it might not > be a total failure after all. HOWEVER, if you go into this half-arsedly, > without proper understanding of the scale of such a project, it is only > going to cause more trouble than solve anything. > > Kenneth > > David Given wrote: > > Kenneth Forsbäck wrote: > >> If these would-be programmers are so young they have problems using > >> Latin/ASCII, then they shouldn't be learning Lua, or any other > >> programming language for that matter. > > > > You're assuming that they speak a language with an easily latinised > > form. That's not necessarily the case. You look like you're Finnish --- > > Finnish uses accented characters, but you can easily force it into ASCII > > and produce comprehensible approximations of Finnish words that you can > > use in identifiers. > > > > But the same doesn't apply to Chinese, for example. Chinese > > latinisations are notoriously horrible; there are several conflicting > > versions (did you know that Beijing and Peking are *the same word*?). > > > > And besides, why should they have to? Why shouldn't they use their > > native language to write their code in? Why force them to use an alien > > alphabet just so that they can use Lua? Why make them do things *our* > > way, when such a tiny change would let them do things *their* way, in > > the way they find most comfortable? > > > > ________________________________________________________________ Mensagem enviada pelo Microlink Webmail 12.7.8p3 From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 12:01:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95F1km7001332; Mon, 5 Oct 2009 12:01:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF288190DD; Mon, 5 Oct 2009 12:00:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61911191E8 for ; Mon, 5 Oct 2009 12:00:21 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mup3U-00044e-63 for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 16:00:52 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 2601A527E2 for ; Mon, 5 Oct 2009 16:00:49 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:7713 with envelope Message-ID: <4ACA0A1C.80805@cowlark.com> Date: Mon, 05 Oct 2009 16:00:44 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: [ANNOUNCE] Objective Lua Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95F1km7001332 Yes, really! http://www.cowlark.com/objective-lua @interface Point : Object @end @implementation MyClass - init [super init] self.x = 0 self.y = 0 return self end - initX: x Y: y self.x = x self.y = y return self end - x return self.x end - y return self.y end - moveToX: x Y: y self.x = x self.y = y end - moveByX: x Y: y self.x = self.x + x self.y = self.y + y end @end local point = [[Point alloc] init] [point moveToX: 4 Y: 9] -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 12:17:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95FHd09004305; Mon, 5 Oct 2009 12:17:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A030519109; Mon, 5 Oct 2009 12:16:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04ED619027 for ; Mon, 5 Oct 2009 12:16:21 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 48333187C0 for ; Mon, 5 Oct 2009 15:16:54 +0000 (GMT) Message-ID: <4ACA0DE5.6070609@objmedia.demon.co.uk> Date: Mon, 05 Oct 2009 16:16:53 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE] Objective Lua References: <4ACA0A1C.80805@cowlark.com> In-Reply-To: <4ACA0A1C.80805@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > http://www.cowlark.com/objective-lua Nice. Humourous web page too! Stephen From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 12:52:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95FqnoU011028; Mon, 5 Oct 2009 12:52:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D313D189C4; Mon, 5 Oct 2009 12:51:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AE3D188AA for ; Mon, 5 Oct 2009 12:51:30 -0300 (BRT) Received: by gxk4 with SMTP id 4so3922958gxk.8 for ; Mon, 05 Oct 2009 08:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=d9ZDG3DVn6buMbUMolbITw58kfAZWOdBfHdzardV58Y=; b=tgnf+e7nIZ7juAtLeeLgcoAFmC3fJcYG5gb9j+TUKyE7IBQFcX9bFWmTYH4Qfuk4RR ur8EeoCPVvNGfnc4V6H9irDd5K2QPXbSoXqyn0oszBH/FuT5KpX0XMiXOtPZPdUBxgsL 8fDKEygRL3LHZbgjEDUW8+h8B/Q4hkuJw4YYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E6I7KWtT3/rq1oHBeDi22gnRtLKVUrXZPKNT9WjNTXaoYDqH61QJtJC7eaaO8H+AoD YqE2y9k9a5GU1214rcsboKa/TXhipPlvSkkbFlgD7whG2C6rRzVItpFRGJZwJ3SnBYDD cSf1snNSPW48mAFzlU+k7CS3gbrxVfulQTc+I= MIME-Version: 1.0 Received: by 10.101.5.22 with SMTP id h22mr158474ani.186.1254757926128; Mon, 05 Oct 2009 08:52:06 -0700 (PDT) In-Reply-To: References: <4ACA0A1C.80805@cowlark.com> Date: Mon, 5 Oct 2009 11:52:06 -0400 Message-ID: Subject: Re: [ANNOUNCE] Objective Lua From: "Thomas Harning Jr." To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/5/09, Bertrand Mansion wrote: > You should post this on the Cocoa-dev mailing list. I think it is > about time for Apple to include Lua in OSX, just like they do with > Ruby, Python and PHP :) ...and make it hard to upgrade to a new Lua version without breaking all sorts of things? Packaging things like this in the OS is nice to have something to be able to depend on, but it locks things in. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 12:56:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95Fustj011931; Mon, 5 Oct 2009 12:56:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 981311A5A9; Mon, 5 Oct 2009 12:22:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA42E19027 for ; Mon, 5 Oct 2009 12:22:11 -0300 (BRT) Received: by fxm12 with SMTP id 12so3178640fxm.5 for ; Mon, 05 Oct 2009 08:22:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.3.22 with SMTP id 22mr3990078bkl.181.1254756167628; Mon, 05 Oct 2009 08:22:47 -0700 (PDT) In-Reply-To: <4ACA0A1C.80805@cowlark.com> References: <4ACA0A1C.80805@cowlark.com> Date: Mon, 5 Oct 2009 17:22:47 +0200 X-Google-Sender-Auth: fb0a73a38596b26f Message-ID: Subject: Re: [ANNOUNCE] Objective Lua From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95Fustj011931 On Mon, Oct 5, 2009 at 5:00 PM, David Given wrote: > Yes, really! > > http://www.cowlark.com/objective-lua > > @interface Point : Object > @end > > @implementation MyClass >  - init >    [super init] >    self.x = 0 >    self.y = 0 >    return self >  end > >  - initX: x Y: y >    self.x = x >    self.y = y >    return self >  end > >  - x >    return self.x >  end > >  - y >    return self.y >  end > >  - moveToX: x Y: y >    self.x = x >    self.y = y >  end > >  - moveByX: x Y: y >    self.x = self.x + x >    self.y = self.y + y >  end > @end > > local point = [[Point alloc] init] > [point moveToX: 4 Y: 9] You should post this on the Cocoa-dev mailing list. I think it is about time for Apple to include Lua in OSX, just like they do with Ruby, Python and PHP :) -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 13:24:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95GOjnn017424; Mon, 5 Oct 2009 13:24:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 601E318993; Mon, 5 Oct 2009 13:23:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFD3E18959 for ; Mon, 5 Oct 2009 13:23:25 -0300 (BRT) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95GO061017299 for ; Mon, 5 Oct 2009 13:24:00 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n95GO0XG017297 for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 13:24:00 -0300 Date: Mon, 5 Oct 2009 13:24:00 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANNOUNCE] Objective Lua Message-ID: <20091005162400.GA16659@duchamp.tecgraf.puc-rio.br> References: <4ACA0A1C.80805@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ACA0A1C.80805@cowlark.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > http://www.cowlark.com/objective-lua Instead of batch conversion via oluac.lua, you could write a lua_Reader function that loads olua files and converts them on the fly to be loaded as Lua programs. I'm not sure whether Lpeg allows you to generate the output in pieces, though. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 14:13:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95HDoeh031556; Mon, 5 Oct 2009 14:13:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA8AA321B3; Mon, 5 Oct 2009 14:12:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-5.csi.cam.ac.uk (ppsw-5.csi.cam.ac.uk [131.111.8.135]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D51E18959 for ; Mon, 5 Oct 2009 14:12:25 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:53176) by ppsw-5.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.155]:25) with esmtpa (EXTERNAL:fanf2) id 1Mur7D-00063w-J1 (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Mon, 05 Oct 2009 18:12:51 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mur7D-0003Lw-SR (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Mon, 05 Oct 2009 18:12:51 +0100 Date: Mon, 5 Oct 2009 18:12:51 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] In-Reply-To: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> Message-ID: References: <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 5 Oct 2009, Jerome Vuarand wrote: > > Being able to use accented letters or even non-roman characters would > be a useful tool to teach programming to people not speaking english. > Ideally you would need to translate keywords, libraries and built-in > error messages, but given Lua's size that seems reasonnable to do. I have heard that programmers perfer to use English because their native language is highly inflected, so (for example) Russian identifiers and keywords would be painfully illiterate because of the lack of parts of speech. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 14:19:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95HJKAn000880; Mon, 5 Oct 2009 14:19:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 864221A677; Mon, 5 Oct 2009 14:18:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dottedmag.net (burger.dottedmag.net [212.75.37.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB9981A66F for ; Mon, 5 Oct 2009 14:18:05 -0300 (BRT) Received: from vertex (unknown [91.197.127.125]) by dottedmag.net (Postfix) with ESMTPSA id EA4CE8C03E for ; Mon, 5 Oct 2009 19:18:39 +0200 (CEST) Received: from dottedmag by vertex with local (Exim 4.69) (envelope-from ) id 1MurCl-0003LZ-Kt for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 00:18:35 +0700 From: Mikhail Gusarov To: Lua list Subject: Re: UTF-8 identifiers References: <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> Date: Tue, 06 Oct 2009 00:18:35 +0700 In-Reply-To: (Tony Finch's message of "Mon, 5 Oct 2009 18:12:51 +0100") Message-ID: <87eiphrc7o.fsf@vertex.dottedmag.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-=-= Content-Transfer-Encoding: quoted-printable Twas brillig at 18:12:51 05.10.2009 UTC+01 when dot@dotat.at did gyre and gimble: TF> I have heard that programmers perfer to use English because their TF> native language is highly inflected, so (for example) Russian TF> identifiers and keywords would be painfully illiterate because of TF> the lack of parts of speech. One widely used accounting system in Russia uses Cyrillic-based scripting language. There are tons of code written in this language, all grammatically incorrect. Nobody cares. Shareability of the code is much more important. =2D-=20 http://fossarchy.blogspot.com/ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAEBCgAGBQJKyiprAAoJEJ0g9lA+M4iIdegP/RvoMUlpoDcthnkDvSlMJmix 4ghP2WUD3FkbFtu6l/5vMQm/Zv/YXNjVqx+8i7UUOEPURwcKNAU6H5jSov139B74 WmL+OH9FrIjqBhdAJjfFbL/briHARZAwTkmJTLIsGkw5pLWzIRSxtT4iJ8Nh7+P6 SfDFJ4XwXYe3JHFFRlMw7LebG0AAEi2CpTQyi4uCtGHpAd93z4nUpL7F7yEKLZpY qwiKJVhStQhQVKKW1v+RCyX+Ng1ist2SIDZ9IwekxJaPTAyRoBju+pPZHPwSev1V vDzgkQpPApF5kuSZdNFSpMfNM3SUv+XtpIcd8i9EDVVO/bqv2CTgI6ZDnUcsXlLy TRD4TMWPCLuOV8G73tcoNVBosWpaL+U3TGTIefrQrx78PBPw55tIY+visck+kjEA YZpLolxnUCvFMDiVANOkA7Me6npK8bGFLq+XjZHQRFN4GlVbLfWbqZm5/hJpGFQF eOUBNBO7Ku9xQ4JZ7r5e9RDLY6ucD03OJLoRpENlZ8dOp/+t8EntWOijMHnXI1pY Dpl2gCmNGBl1lQEgq/UAntnM1YW8q5pUzs4DVJhUL7s71mxWyfndcFeTWD9a3it4 TNKxh145Asb0ihyM8dwiye2Xip3bMqE2N9lvGgMFmiRcHWSnMkPpsOqUnOfhZ4VF xPCjnkTtUm8a9YHA3Kds =MHIF -----END PGP SIGNATURE----- --=-=-=-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 14:38:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95Hco9O006755; Mon, 5 Oct 2009 14:38:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7982F1888B; Mon, 5 Oct 2009 14:37:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A7E618850 for ; Mon, 5 Oct 2009 14:37:37 -0300 (BRT) Received: by bwz22 with SMTP id 22so2799287bwz.5 for ; Mon, 05 Oct 2009 10:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=9qHtPk6rL3FiTvOecSe54WT72Dt/KpFvPgRcuT5J+oI=; b=UTT0bOcLJbXruEhbA+KLE+6+jZqxT1+XOkoLxaTkXTrVBhP+4gamU+HvDkV1YheWfI jw1WhVe88hJ0qLug9/YSH3srF53/wi0yLL7j6GSls1w/bnV/DOH2RSbPcKoRNwSuH01O RtZYRXbvZwrh7lyLiDPhGH700F/VmJXDSTNPI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=inYlTjKbiLlZLEz+Xxjqa0CKaK7yPkaW4Twwa3MvIN09f9ooD51viTzsAVm9HnvbCk EjKaQhYrKcMAvJ98xOXzHFojJE4chnviotMdjgmWSKHJBD7ZVmYGFaLwGjAfdCXr/aj4 vGkStLZSj7bTu8bO/kutc5Ixfjlqm+BUypguA= Received: by 10.204.151.210 with SMTP id d18mr4233077bkw.203.1254764293006; Mon, 05 Oct 2009 10:38:13 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 35sm345841fkt.46.2009.10.05.10.38.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 10:38:11 -0700 (PDT) Message-Id: <1DE33770-22C3-4471-9E12-9548D6BBDB7A@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4ACA0A1C.80805@cowlark.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANNOUNCE] Objective Lua Date: Mon, 5 Oct 2009 19:37:41 +0200 References: <4ACA0A1C.80805@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 5, 2009, at 5:00 PM, David Given wrote: > Yes, really! > > http://www.cowlark.com/objective-lua Wicked :D From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 14:41:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95Hf9pu007444; Mon, 5 Oct 2009 14:41:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36FA4321B3; Mon, 5 Oct 2009 14:40:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDBFF18CE2 for ; Mon, 5 Oct 2009 14:40:01 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucAAIvMyUp8qYIQ/2dsb2JhbAAI0nOEKgSCKA X-IronPort-AV: E=Sophos;i="4.44,507,1249228800"; d="scan'208";a="568359187" Received: from unknown (HELO [10.1.1.2]) ([124.169.130.16]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 06 Oct 2009 01:40:36 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: [ANNOUNCE] Objective Lua From: Jacques Chester In-Reply-To: <4ACA0A1C.80805@cowlark.com> Date: Tue, 6 Oct 2009 01:40:35 +0800 Content-Transfer-Encoding: 7bit Message-Id: <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> References: <4ACA0A1C.80805@cowlark.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 05/10/2009, at 11:00 PM, David Given wrote: > Yes, really! > > http://www.cowlark.com/objective-lua Reddited: http://www.reddit.com/r/programming/comments/9r1r3/objective_lua_now_you_can_mix_lua_and_smalltalk/ Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 14:51:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95HpT9M010207; Mon, 5 Oct 2009 14:51:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A0CC1A671; Mon, 5 Oct 2009 14:50:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B854818CE2 for ; Mon, 5 Oct 2009 14:50:13 -0300 (BRT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KR100LDRYVNFB00@asmtp020.mac.com> for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 10:50:45 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <4AC9EBF8.8010901@cowlark.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Mon, 05 Oct 2009 19:50:11 +0200 References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 5, 2009, at 2:52 PM, David Given wrote: > Right now I'm working on site in Korea. > > Trust me, forcing identifiers to be ASCII *in no way helps* cross- > border communication. So... how is your Korean coming along? Ironically, looking at, hmmm, a typical Korean site such as the one from the Blue House, every single link seems to be in plain, old US- ASCII: http://www.president.go.kr/kr/index.php Ditto for the Japanese, e.g. the Imperial Household Agency: http://sankan.kunaicho.go.jp/ Ditto for the Chinese: http://www.gov.cn/ Ditto for the Javascript code code associated with the above site: http://203.192.2.21/webdig.js?z=1 Go figure. Perhaps US-ASCII is the lingua franca of programming. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:01:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95I11n0012457; Mon, 5 Oct 2009 15:01:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC54B1A67C; Mon, 5 Oct 2009 14:59:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from orthanc.ca (orthanc.ca [208.86.224.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C58061A674 for ; Mon, 5 Oct 2009 14:59:43 -0300 (BRT) Received: from orthanc.ca (localhost [127.0.0.1]) by orthanc.ca (8.14.3/8.14.3) with ESMTP id n95I0IYZ040706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 5 Oct 2009 12:00:18 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: (from uucp@localhost) by orthanc.ca (8.14.3/8.14.3/Submit) with UUCP id n95I0Id1040705 for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 12:00:18 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: from yyc.orthanc.ca (neo.yyc.orthanc.ca [192.168.0.10]) by legolas.yyc.orthanc.ca (8.14.3/8.14.3) with ESMTP id n95I07rY011423 for ; Mon, 5 Oct 2009 12:00:14 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Message-ID: <869aef32e90ea59bdb31fe6b99f7d219@yyc.orthanc.ca> To: lua@bazar2.conectiva.com.br Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Lyndon Nerenberg - VE6BBM/VE7TFX Organization: The Frobozz Magic Homing Pigeon Company Date: Mon, 5 Oct 2009 12:00:07 -0600 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The only language I know that is doing this is Falcon ( > http://falconpl.org/ ). If there are stats for how many people use > this feature it would be interesting. Plan 9 has had native Unicode support pretty much since day one (circa 1989). E.g.: int Δt = time(0) - αÏχη; is valid C. There have been no issues with people using visually similar characters in a way that causes confusion. Mind you, Plan 9 users tend to be militant minimalists, so nobody uses this feature just because they can. Sun's Fortress language also fully integrates Unicode into its grammar. Refs: http://plan9.bell-labs.com/sys/doc/utf.html http://research.sun.com/projects/plrg/ --lyndon From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:17:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95IHWNV017305; Mon, 5 Oct 2009 15:17:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40C9A1A67E; Mon, 5 Oct 2009 15:16:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh05.mail.saunalahti.fi (emh05.mail.saunalahti.fi [62.142.5.111]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7555321B3 for ; Mon, 5 Oct 2009 15:16:17 -0300 (BRT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh05-2.mail.saunalahti.fi (Postfix) with SMTP id 383CB8BD89 for ; Mon, 5 Oct 2009 21:16:50 +0300 (EEST) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A03BF431FD7; Mon, 05 Oct 2009 21:16:50 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 1D3D31C638C for ; Mon, 5 Oct 2009 21:16:45 +0300 (EEST) Message-Id: <2EB3A31D-229B-4B5F-8B79-B2CED1167328@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaLanes and Snow Leopard OSX 10.6 Date: Mon, 5 Oct 2009 21:16:46 +0300 References: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My by-now standard disclaimer to why Lanes via LuaRocks is not working (it's actually great, this way I know people tried >:): << I've essentially cleaned away my web sites since Lanes came out. That explains the missing links, though does not justify them. Sorry. I'm not going to change anything, though. People who really need to reach me will - as you have. :) As to LuaRocks, I only intended to make the rock as a test on how easy/ hard making a rock feels. I did not and do not intend to be maintaining the rock as well as the library itself. Rocks, and other distributions, require a "second tier" view on the product and in my opinion are best done by someone else than the author. << The error you got is indeed the same as I had with Fink Lua (which I'm the maintainer of) prior to tuning it for safe multithreading. I'll send you the Fink building rules, maybe there is something in there that will help. Thanks for sending the bug report. -asko Stefan Marr kirjoitti 5.10.2009 kello 14:03: > Hi Asko, > Hi list: > > I tried to experiment with LuaLanes, but have some problems on my > Snow Leopard installation. > > Every time I try to run one of the test I get an malloc error like > this: > > lanes-2.0.3$ LUA_CPATH=./src/?.so LUA_PATH="src/?.lua;./tests/?.lua" > lua tests/recursive.lua > depth: 0 1 2 3 4 5 6 7 8 9 10 11 > lua(61739,0x7fff71085be0) malloc: *** error for object 0x1000ad1a0: > pointer being freed was not allocated > *** set a breakpoint in malloc_error_break to debug > > > I tried to use luarocks from MacPorts to install lanes, but there is > no rock spec. for the latest version, and for the 2.0 version, the > download is gone, so it just failed installing. > > Furthermore, I followed the hints in the README to compile Lua with > LUA_USE_DLOPEN and LUA_USE_POSIX as well as using a dylib for the > core and library code, as described. > However, I am still ending up with the error given above. > > Any thoughts how this could be fixed? > > Many thanks and best regards > Stefan > > BTW: On an Ubuntu, it works fine... > > > > > -- > Stefan Marr > Software Languages Lab > Former Programming Technology Lab > Vrije Universiteit Brussel > Pleinlaan 2 / B-1050 Brussels / Belgium > http://prog.vub.ac.be/~smarr > Phone: +32 2 629 3956 > Fax: +32 2 629 3525 > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:25:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95IOubH019433; Mon, 5 Oct 2009 15:24:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82CEC1A687; Mon, 5 Oct 2009 15:23:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 677861A669 for ; Mon, 5 Oct 2009 15:23:38 -0300 (BRT) Received: by ewy11 with SMTP id 11so2867503ewy.35 for ; Mon, 05 Oct 2009 11:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=8HninKCl3QVfDFazPHIflXNFcRRaY6Gb4uKALIl2/WE=; b=BkqxlOQyRZf9A/vDDzcydHk1yZa48abMKiCStVhiFJLPM+0qRPOONlC7S0GFTmkJWR lxdmwr7cukaoJmBwYb7uZyaBJ70K36WfTlf227L0TXmCt5PUo3DIOT2WErJJFpAJldD6 RVklHfDIsyP+9W20uFyD9MY7+hALPKjSOFNb8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=q4Op36CUCe728nbGG9FV7BTzeoL9CLasLz6yGlp/YOVO8nRduJB7kqkOMpaHypDQjy UoQ6kf4Gv8NxzDvcwYYmHD9aioxadEMwRvwjqx02phgWy529xwT6WTEybqPfIq1yfscL +YCd+WZrcMNqKJLLh3VcR/ZBR8bVAUjFTOqmY= MIME-Version: 1.0 Received: by 10.216.7.139 with SMTP id 11mr79104wep.212.1254767054093; Mon, 05 Oct 2009 11:24:14 -0700 (PDT) In-Reply-To: References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> From: Jerome Vuarand Date: Mon, 5 Oct 2009 20:23:53 +0200 Message-ID: <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/5 Petite Abeille : > > On Oct 5, 2009, at 2:52 PM, David Given wrote: > >> Right now I'm working on site in Korea. >> >> Trust me, forcing identifiers to be ASCII *in no way helps* cross-border >> communication. > > So... how is your Korean coming along? > > Ironically, looking at, hmmm, a typical Korean site such as the one from the > Blue House, every single link seems to be in plain, old US-ASCII: > > http://www.president.go.kr/kr/index.php > > Ditto for the Japanese, e.g. the Imperial Household Agency: > > http://sankan.kunaicho.go.jp/ > > Ditto for the Chinese: > > http://www.gov.cn/ > > Ditto for the Javascript code code associated with the above site: > > http://203.192.2.21/webdig.js?z=1 > > Go figure. Perhaps US-ASCII is the lingua franca of programming. I think the real reason is poor support for non-ascii URLs, especially in some western browsers. As you may have noticed most of these sites have an english version, and they probably don't want to confuse too much old english-only browsers, proxies, or even their server software stack. On the other hand if you know that your target audience all have a common mother-language and may be less than fluent in english, localizing everything may make more sense. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:26:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95IQ6vt019846; Mon, 5 Oct 2009 15:26:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 879F11A68B; Mon, 5 Oct 2009 15:25:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03CAF1A669 for ; Mon, 5 Oct 2009 15:24:55 -0300 (BRT) Received: by bwz22 with SMTP id 22so2835179bwz.5 for ; Mon, 05 Oct 2009 11:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=UwmzI9njl+gyEJ3uNG0yqUxI1p0M4hnlRG5Qiw625uM=; b=lI7CjBeZxrEspBKq4jgcWSUUfwHozxJ1yzdbbra0ucpqgc1jH92FxkwHqzmwe7wx+a R5TnZ35RAfIyWErzgVa5JgSPnOZGOIgaf+k9GlyxaMp90R9ksxnp0uFvSGrJCz1WngZ3 bg9NujdDk8pCKfbkUb4xrEecNCa4dAkdLoSbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=PGp1K8SzaiZH8TkWcL2oROgR3elOIQP0AfxzO/Wh+YxrC/sCqTE5fJhmi+ouEZikxA bRKteKYua8oNZsq/NmUHRGU0nBa12Z2QpfOh9cmNhlYzSSCr8FNaforTDgwI8z0tYAtj yffCU/mLg5OYYqUlDDDHsqiDSvRYVkzeQ8pAE= Received: by 10.204.34.194 with SMTP id m2mr4263917bkd.53.1254767129585; Mon, 05 Oct 2009 11:25:29 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.227.115]) by mx.google.com with ESMTPS id p17sm39929fka.12.2009.10.05.11.25.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 11:25:28 -0700 (PDT) Message-ID: <4ACA3A0F.70304@gmail.com> Date: Tue, 06 Oct 2009 02:25:19 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <869aef32e90ea59bdb31fe6b99f7d219@yyc.orthanc.ca> In-Reply-To: <869aef32e90ea59bdb31fe6b99f7d219@yyc.orthanc.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lyndon Nerenberg - VE6BBM/VE7TFX wrote: >> The only language I know that is doing this is Falcon ( >> http://falconpl.org/ ). If there are stats for how many people use >> this feature it would be interesting. > > Plan 9 has had native Unicode support pretty much since day one (circa > 1989). E.g.: > > int Δt = time(0) - αÏχη; > > is valid C. There have been no issues with people using visually > similar characters in a way that causes confusion. Mind you, Plan 9 > users tend to be militant minimalists, so nobody uses this feature > just because they can. > > Sun's Fortress language also fully integrates Unicode into its > grammar. Ah, but have you seen the size of a proper Unicode integration? The more vocal the "militant minimalists" are, the less I trust them. Too much fashion, branding and PR in IT and CompSci these days. I'll wait for someone to turn out some working code first, else it's all talk... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:37:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95IaxpS023462; Mon, 5 Oct 2009 15:37:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF8A918BB1; Mon, 5 Oct 2009 15:35:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A0E1188DB for ; Mon, 5 Oct 2009 15:35:49 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n95IaRVe015632 for ; Mon, 5 Oct 2009 15:36:27 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 06A2E54C23A; Mon, 5 Oct 2009 15:36:28 -0300 (BRT) Date: Mon, 5 Oct 2009 15:36:28 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005183627.GA30228@inf.puc-rio.br> References: <869aef32e90ea59bdb31fe6b99f7d219@yyc.orthanc.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <869aef32e90ea59bdb31fe6b99f7d219@yyc.orthanc.ca> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Sun's Fortress language also fully integrates Unicode into its > grammar. There is a world of difference between fully integrating Unicode into a grammar and making a patch to accept just any sequence of non-ascii bytes as an identifier. The discution here is not (or at least was not) about the former, but the latter. It would help to keep that in mind. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 15:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95IuMZU028687; Mon, 5 Oct 2009 15:56:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5340018F13; Mon, 5 Oct 2009 15:55:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from orthanc.ca (orthanc.ca [208.86.224.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC5B818EA0 for ; Mon, 5 Oct 2009 15:55:01 -0300 (BRT) Received: from orthanc.ca (localhost [127.0.0.1]) by orthanc.ca (8.14.3/8.14.3) with ESMTP id n95ItasH041958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Oct 2009 12:55:37 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: (from uucp@localhost) by orthanc.ca (8.14.3/8.14.3/Submit) with UUCP id n95ItarC041957; Mon, 5 Oct 2009 12:55:36 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: from yyc.orthanc.ca (neo.yyc.orthanc.ca [192.168.0.10]) by legolas.yyc.orthanc.ca (8.14.3/8.14.3) with ESMTP id n95ItVnF012784; Mon, 5 Oct 2009 12:55:31 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Message-ID: <106583306b3ef740e663c79bd8f63ac7@yyc.orthanc.ca> To: keinhong@gmail.com, lua@bazar2.conectiva.com.br Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Lyndon Nerenberg - VE6BBM/VE7TFX Organization: The Frobozz Magic Homing Pigeon Company Date: Mon, 5 Oct 2009 12:55:30 -0600 In-Reply-To: <4ACA3A0F.70304@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'll wait for someone to turn out some working code first, else > it's all talk... Then I suggest you read the Plan 9 paper I provided the link to. The code has been working for two decades. I'll also note that the UTF8 encoding itself came directly from Plan 9. And the implementation is far from complex. You can peruse the source code at http://plan9.bell-labs.com/sources/plan9/sys/src. The grep implementation is particularly elegant. Note that Plan 9 does not have any notion of locales. That's where the complexity (and madness) lies. --lyndon From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:01:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95J1SGv030828; Mon, 5 Oct 2009 16:01:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEA211A687; Mon, 5 Oct 2009 16:00:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from orthanc.ca (orthanc.ca [208.86.224.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 704B51A674 for ; Mon, 5 Oct 2009 16:00:05 -0300 (BRT) Received: from orthanc.ca (localhost [127.0.0.1]) by orthanc.ca (8.14.3/8.14.3) with ESMTP id n95J0fTG042077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Oct 2009 13:00:41 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: (from uucp@localhost) by orthanc.ca (8.14.3/8.14.3/Submit) with UUCP id n95J0fhB042076; Mon, 5 Oct 2009 13:00:41 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Received: from yyc.orthanc.ca (neo.yyc.orthanc.ca [192.168.0.10]) by legolas.yyc.orthanc.ca (8.14.3/8.14.3) with ESMTP id n95J0Yc5013010; Mon, 5 Oct 2009 13:00:34 -0600 (MDT) (envelope-from lyndon@yyc.orthanc.ca) Message-ID: <07c87fb01f55c18c57e2de0c5f56ef59@yyc.orthanc.ca> To: roberto@inf.puc-rio.br, lua@bazar2.conectiva.com.br Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Lyndon Nerenberg - VE6BBM/VE7TFX Organization: The Frobozz Magic Homing Pigeon Company Date: Mon, 5 Oct 2009 13:00:34 -0600 In-Reply-To: <20091005183627.GA30228@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > There is a world of difference between fully integrating Unicode into > a grammar and making a patch to accept just any sequence of non-ascii > bytes as an identifier. > > The discution here is not (or at least was not) about the former, but > the latter. It would help to keep that in mind. I saw two points being discussed: 1) how to do it, and 2) surely this leads to madness through glyph obfuscation. The refs I posted were intended to show that (2) does not have to be the problem people are making it out to be, with one example of it working in the real world for two decades. It would be foolish to ignore real-world implementation experience in a discussion like this, don't you think? --lyndon From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:05:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95J5shE032319; Mon, 5 Oct 2009 16:05:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F1111A691; Mon, 5 Oct 2009 16:04:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7B6A1A671 for ; Mon, 5 Oct 2009 16:04:44 -0300 (BRT) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KR200K9L2BVKC70@asmtp020.mac.com> for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 12:05:18 -0700 (PDT) Message-id: <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> From: Petite Abeille To: Lua list In-reply-to: <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Mon, 05 Oct 2009 21:04:43 +0200 References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95J5shE032319 On Oct 5, 2009, at 8:23 PM, Jerome Vuarand wrote: > On the other hand if you know that your target audience all have a > common mother-language and may be less than fluent in english, > localizing everything may make more sense. Hmmm... but at that rate, shouldn't even the keywords be localized then? begin for aKey, aValue in pairs( aTable ) do print( aKey, aValue ) end end vs. debut pour uneClé, uneValue dans paires( uneTable ) faire imprimer( uneClé, uneValue ) fin fin Or something. This could get tiring :D If I'm not mistaken, AppleScript used to offer localized dialects. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:06:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95J3bmY031656; Mon, 5 Oct 2009 16:03:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07AC61A68E; Mon, 5 Oct 2009 16:02:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 462E21A682 for ; Mon, 5 Oct 2009 16:02:23 -0300 (BRT) Received: by bwz22 with SMTP id 22so2863412bwz.5 for ; Mon, 05 Oct 2009 12:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vtsEDLw4Mf4zB9skyD1fAqFM1s5MwpU/DYbSbiqf7Nk=; b=OWQl3hMhx/O1ixlQE5MfjNUF2DZfn0MYkhuI07BrjwyOjDdwGv2AsxvqSqS5lyZ7lR tQ70R4SNR3JxIz5KUbE7QVwXM2uL5LrT02p0BjAnjhFQQwEbqk+lPX2RcDT5x+8P6EJh uBBxXIXFfY21OFP6wd2uxCsr6UoIJSSP0RzdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Z0Fn2HgUI6su7Mu717iUFuMHZVmtopexd6kfQXsoxLDd6LjVhPynCUT/sNsoBh3e0v Ta/TY51u6a6gpGGJl1ddcBhxpQRIKi5ZFHuLSUW7+t/SXcpiYgbcMbGokY29A1M03MjG aI9NzdUmERK34/ray+4MZZ1Wnhq167ifKnyBY= Received: by 10.204.154.211 with SMTP id p19mr4303710bkw.3.1254769380406; Mon, 05 Oct 2009 12:03:00 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.227.115]) by mx.google.com with ESMTPS id 18sm245887fks.10.2009.10.05.12.02.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 12:02:59 -0700 (PDT) Message-ID: <4ACA42DB.7090503@gmail.com> Date: Tue, 06 Oct 2009 03:02:51 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <106583306b3ef740e663c79bd8f63ac7@yyc.orthanc.ca> In-Reply-To: <106583306b3ef740e663c79bd8f63ac7@yyc.orthanc.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lyndon Nerenberg - VE6BBM/VE7TFX wrote: >> I'll wait for someone to turn out some working code first, else >> it's all talk... > > Then I suggest you read the Plan 9 paper I provided the link to. > The code has been working for two decades. I'll also note that > the UTF8 encoding itself came directly from Plan 9. > [snip] Wrong wavelength, impedance not matched. I'm dropping out of this thread. -- Cheers, khman KL, MY From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:08:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95J8lYK000663; Mon, 5 Oct 2009 16:08:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 921231A697; Mon, 5 Oct 2009 16:07:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1419C1A68F for ; Mon, 5 Oct 2009 16:07:38 -0300 (BRT) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp021.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KR20012Q2G4W500@asmtp021.mac.com> for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 12:07:48 -0700 (PDT) Message-id: <4E732552-A472-4958-AE76-C3C8BE9325F0@mac.com> From: Petite Abeille To: Lua list In-reply-to: <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Mon, 05 Oct 2009 21:07:15 +0200 References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95J8lYK000663 On Oct 5, 2009, at 9:04 PM, Petite Abeille wrote: > pour uneClé, uneValue dans paires( uneTable ) faire Ooops... uneValeur I guess :D From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:10:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95J9x8n001012; Mon, 5 Oct 2009 16:10:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDF4E1A69D; Mon, 5 Oct 2009 16:08:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A9481A698 for ; Mon, 5 Oct 2009 16:08:45 -0300 (BRT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 8D76CC7D1E for ; Mon, 5 Oct 2009 22:09:21 +0300 (EEST) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A037386FB90; Mon, 05 Oct 2009 22:09:21 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 7FD4941BE8 for ; Mon, 5 Oct 2009 22:09:16 +0300 (EEST) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaLanes and Snow Leopard OSX 10.6 Date: Mon, 5 Oct 2009 22:09:17 +0300 References: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Your problems should be due to having two separate copies of Lua core in the system. Try to make sure lua the command line executable is really dynamically linked to the lua shared library that extension modules use. There may also be other ways to guarantee this singularity of the Lua core. If you have two cores and you do multiple threads, OS X gets confused like you showed. For users of Lua via the fink distribution, make sure your package is >= 5.1.1-14. That has the necessary changes. Unstable has a recent one but stable still lags behind in 5.1.1-4 or so. Lanes does not work fine with that. - Asko Stefan Marr kirjoitti 5.10.2009 kello 14:03: > Hi Asko, > Hi list: > > I tried to experiment with LuaLanes, but have some problems on my > Snow Leopard installation. > > Every time I try to run one of the test I get an malloc error like > this: > > lanes-2.0.3$ LUA_CPATH=./src/?.so LUA_PATH="src/?.lua;./tests/?.lua" > lua tests/recursive.lua > depth: 0 1 2 3 4 5 6 7 8 9 10 11 > lua(61739,0x7fff71085be0) malloc: *** error for object 0x1000ad1a0: > pointer being freed was not allocated > *** set a breakpoint in malloc_error_break to debug > > > I tried to use luarocks from MacPorts to install lanes, but there is > no rock spec. for the latest version, and for the 2.0 version, the > download is gone, so it just failed installing. > > Furthermore, I followed the hints in the README to compile Lua with > LUA_USE_DLOPEN and LUA_USE_POSIX as well as using a dylib for the > core and library code, as described. > However, I am still ending up with the error given above. > > Any thoughts how this could be fixed? > > Many thanks and best regards > Stefan > > BTW: On an Ubuntu, it works fine... > > > > > -- > Stefan Marr > Software Languages Lab > Former Programming Technology Lab > Vrije Universiteit Brussel > Pleinlaan 2 / B-1050 Brussels / Belgium > http://prog.vub.ac.be/~smarr > Phone: +32 2 629 3956 > Fax: +32 2 629 3525 > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 16:59:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95JwxMr014741; Mon, 5 Oct 2009 16:59:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07B4C1A6A3; Mon, 5 Oct 2009 16:57:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 453C31A693 for ; Mon, 5 Oct 2009 16:57:28 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id EDDDB170C577 for ; Mon, 5 Oct 2009 15:58:04 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n95Jw4Uh031824 for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 15:58:04 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Mon, 5 Oct 2009 15:58:04 -0400 From: Sean Conner To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005195804.GA17882@brevard.conman.org> References: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050240x62c856b8t1385f0345d2e4304@mail.gmail.com> <4AC9C502.1050103@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Philippe Lhoste once stated: > > I believe the historical reason for this choice goes back when Lua was used > as data metalanguage: it allows to use locale names as keys for tables: > > a = { Roméo = "Juliette", César = "Brutus" } > > Although I cannot test that because it seems that on Windows it defaults to > C locale and refuses to change (unless I am doing something wrong). > I tried with Web Lua but it doesn't expose os table (I can understand > why...). > Ah, I can do that in Lua.org live demo but I still can't change the locale. > Perhaps I am doing something wrong? I can't do it, and my locale is currently set for "en_US.UTF-8". I then tried the following: > os.setlocale("es.UTF-8") > a = { Roméo = "Juliette", César = "Brutus" } stdin:1: '}' expected near '� > os.setlocale("es") > a = { Roméo = "Juliette", César = "Brutus" } stdin:1: '}' expected near '� > os.setlocale("br") > a = { Roméo = "Juliette", César = "Brutus" } stdin:1: '}' expected near '� I too, would like to know what I'm doing wrong ... -spc (looks like glibc isn't picking up on the locale properly?) From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 17:02:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95K2psR015739; Mon, 5 Oct 2009 17:02:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 019FB1A6A8; Mon, 5 Oct 2009 17:01:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 421571A6A4 for ; Mon, 5 Oct 2009 17:01:41 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n95K2IIu023802 for ; Mon, 5 Oct 2009 17:02:18 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 597FB54C23A; Mon, 5 Oct 2009 17:01:54 -0300 (BRT) Date: Mon, 5 Oct 2009 17:01:54 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091005200154.GA30950@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'd buy a shirt from the Lua website to help financially support the > project if they were available. *hint hint*! We are not sure about the quality of the products sold by that site and we do not want complains like "you recommended that lousy shirt to us"... (I am not saying those products do not have quality, only that we actually do not know about it.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 17:10:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95KAcBW017745; Mon, 5 Oct 2009 17:10:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3ED21A6A4; Mon, 5 Oct 2009 17:09:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EE461A680 for ; Mon, 5 Oct 2009 17:09:28 -0300 (BRT) Received: by iwn8 with SMTP id 8so1905317iwn.33 for ; Mon, 05 Oct 2009 13:10:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.122.162 with SMTP id l34mr805294ibr.20.1254773405328; Mon, 05 Oct 2009 13:10:05 -0700 (PDT) In-Reply-To: <20091005200154.GA30950@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> Date: Mon, 5 Oct 2009 15:10:05 -0500 Message-ID: <75cc17ac0910051310s4d1f015dhae01c46bbbd583d9@mail.gmail.com> Subject: Re: Lua t-shirts From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=0016e64608e4192681047535b3e1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64608e4192681047535b3e1 Content-Type: text/plain; charset=UTF-8 On Mon, Oct 5, 2009 at 3:01 PM, Roberto Ierusalimschy < roberto@inf.puc-rio.br> wrote: > > I'd buy a shirt from the Lua website to help financially support the > > project if they were available. *hint hint*! > > We are not sure about the quality of the products sold by that site > and we do not want complains like "you recommended that lousy shirt to > us"... (I am not saying those products do not have quality, only that > we actually do not know about it.) > > When can I order my "Lua - Official Programming Language of the 2016 Olympics" Tshirt? -gregg (writing from Chicago) --0016e64608e4192681047535b3e1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Oct 5, 2009 at 3:01 PM, Roberto Ierusalimschy <= ;roberto@inf.puc-rio.br> wrote:
> I'd buy a shirt from the Lua website to help fin= ancially support the
> project if they were available. *hint hint*!

We are not sure about the quality of the products sold by that site and we do not want complains like "you recommended that lousy shirt to=
us"... =C2=A0(I am not saying those products do not have quality, only= that
we actually do not know about it.)

When can I order my "Lua - Official Programming = Language of the 2016 Olympics" Tshirt?

-gregg (writing from Chi= cago)
--0016e64608e4192681047535b3e1-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 17:14:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95KEqBI018576; Mon, 5 Oct 2009 17:14:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D6461A6AC; Mon, 5 Oct 2009 17:13:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B1151A680 for ; Mon, 5 Oct 2009 17:13:42 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 9891F170C577 for ; Mon, 5 Oct 2009 16:14:20 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n95KEK1m006030 for lua@bazar2.conectiva.com.br; Mon, 5 Oct 2009 16:14:20 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Mon, 5 Oct 2009 16:14:20 -0400 From: Sean Conner To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Message-ID: <20091005201420.GB17882@brevard.conman.org> References: <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E708.5070507@pp.inet.fi> <4AC9EBC6.6060800@cowlark.com> <4AC9EEBC.9040903@pp.inet.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4AC9EEBC.9040903@pp.inet.fi> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Kenneth Forsbäck once stated: > > As I said, keep it as simple as possible. If UTF-8 becomes valid for > names, how are those who don't speak chinese going to use the code? How > about rules for what is valid and what is not? Will there be a auxiliary > program that can easily convert from hanji to latin characters? What > about readability? I might ask how are those who don't speak English going to use the code? Or (to turn things completely around) say I find some useful code in Håstad [1]: medan not_done börja för x:= 1 till 5 gör börja om person^.age = 120 så too_old(person); om person^.age > 130 så gåtill person_should_be_dead; slut; slut; I've seen my share of code written in other langauges, and while I never ended up using such code, if I did find it useful and needed to include it, I would have just treated the codebase as obfuscated (or a black box) and go from there. Heck, there are even people that claim to understand Perl, so I think it's safe to say that programmers can get used to just about anything if the need is there. -spc (heck, I used to program BASIC ... ) [1] A made-up language for a blog entry I did a year ago: http://boston.conman.org/2008/01/04.1 which is somewhat related to this, but not really. From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 17:24:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95KO130020704; Mon, 5 Oct 2009 17:24:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C8A71A6B1; Mon, 5 Oct 2009 17:22:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7F761A6A9 for ; Mon, 5 Oct 2009 17:22:45 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 9so1079390qwb.11 for ; Mon, 05 Oct 2009 13:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=DDWtaeYtQl8rOaiI2Pz3AhhoHW7bjkDJb8cURVFIMBE=; b=LnvlBu9IlH3H/YcwoKcFZeV1Kev+Gm69dOyCw9thX8x8HuX2334CHREmBJR6D+Yly6 LUQ0DQndypsFCtG674rO+OtImT9COod9LGq2iMi3DXXf1ZZ6KAWqd6F6eMp5+fYLd9B5 GObuxZvePEyBo8On0kyjiebMzMkIIWawxDYtk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=vqrdvFLN9rf+NM0GC264dRKS0V+BgTGu0iwvkYS5yvzTGVYuAt9z+JB+6uB26c5t1Q PEUsdnHAb0f7T3q3AjE2u1UgEC37fhFkQdrCFWxK5d6pJMXLpjD0k81SoF8bkKHgIMDX 0o0YXlUlLHvu4nkL7AscUhA1yKv/pGvm/qMnI= MIME-Version: 1.0 Received: by 10.224.39.71 with SMTP id f7mr555000qae.373.1254774202908; Mon, 05 Oct 2009 13:23:22 -0700 (PDT) In-Reply-To: <20091005200154.GA30950@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> Date: Mon, 5 Oct 2009 17:23:22 -0300 X-Google-Sender-Auth: 02ee510bf9b67716 Message-ID: <7913df4d0910051323k242b7da2t39c9d11dff6bd83f@mail.gmail.com> Subject: Re: Lua t-shirts From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n95KO130020704 On Mon, Oct 5, 2009 at 5:01 PM, Roberto Ierusalimschy wrote: >> I'd buy a shirt from the Lua website to help financially support the >> project if they were available. *hint hint*! > > We are not sure about the quality of the products sold by that site > and we do not want complains like "you recommended that lousy shirt to > us"...  (I am not saying those products do not have quality, only that > we actually do not know about it.) I have a Lua sweatshirt from Cafepress and the quality is very good, but I have an OLPC shirt from them and the fabric does not look very good after just a few washes. The fit of the t-shirt is not very good, either. But my t-shirt is two years old, they might have changed things since them... maybe someone from the US can try to order one and report (cheaper shipping :-) ). -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br > -- Roberto > From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 18:02:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95L2V26029821; Mon, 5 Oct 2009 18:02:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71BA019051; Mon, 5 Oct 2009 18:01:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-148.bluehost.com (outbound-mail-148.bluehost.com [67.222.38.38]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5663D18FC9 for ; Mon, 5 Oct 2009 18:01:10 -0300 (BRT) Received: (qmail 28269 invoked by uid 0); 5 Oct 2009 21:01:38 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy5.bluehost.com with SMTP; 5 Oct 2009 21:01:38 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=J5JxOKKbtRbGpGeU/7R+JkOvXRdRpILd4VgZ531NfxRW+FKuPkv9cNBI/08Vg9ogMMNVzIps/zDpJMZnFodct4noz/QAi+X1zegqi1j9W7edXgpuE7ZCJlM+P+kNc0GJ; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Muugc-0002XS-GB for lua@bazar2.conectiva.com.br; Mon, 05 Oct 2009 15:01:38 -0600 Date: Mon, 5 Oct 2009 17:01:32 -0400 From: TNHarris To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091005170132.1eaf68f6@egeria.whoopdedo.org> In-Reply-To: <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <8a25d01b0910040843x676d306fu562bca568acd92d0@mail.gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 4 Oct 2009 10:43:10 -0500 Phoenix Sol wrote: > > #!/usr/bin/lua > ... > while not succeed do try() end function try(at_first) at_first() if not succeed then return try(again) end end Better? -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 18:20:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95LJxMl000734; Mon, 5 Oct 2009 18:19:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0BB41A6B3; Mon, 5 Oct 2009 18:18:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B04831A6A9 for ; Mon, 5 Oct 2009 18:18:48 -0300 (BRT) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 08F883849488F for ; Mon, 5 Oct 2009 23:31:33 +0700 (NOVST) Message-ID: <009901ca45d9$4c2abed0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <8a25d01b0910030815l4c476743hca558f842931a28d@mail.gmail.com> <560972290910042328p290b892aua874283bacfb8718@mail.gmail.com> <4AC9B03F.9050404@cowlark.com><20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com><4AC9E708.5070507@pp.inet.fi> <4AC9EBC6.6060800@cowlark.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Mon, 5 Oct 2009 23:31:22 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Mon, 05 Oct 2009 23:31:33 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br I'm Russian. IMO, there's no way for a programmer to escape learning English at least on a basic level. There's much documentation in English, 'big bosses' are usually from a foreign country. Writing identifiers in English is the very least you can learn. Not to mention we all study English at school. ----- Original Message ----- From: David Given To: Lua list Sent: Monday, October 05, 2009 7:51 PM Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Kenneth Forsbäck wrote: > If these would-be programmers are so young they have problems using > Latin/ASCII, then they shouldn't be learning Lua, or any other programming > language for that matter. You're assuming that they speak a language with an easily latinised form. That's not necessarily the case. You look like you're Finnish --- Finnish uses accented characters, but you can easily force it into ASCII and produce comprehensible approximations of Finnish words that you can use in identifiers. But the same doesn't apply to Chinese, for example. Chinese latinisations are notoriously horrible; there are several conflicting versions (did you know that Beijing and Peking are *the same word*?). And besides, why should they have to? Why shouldn't they use their native language to write their code in? Why force them to use an alien alphabet just so that they can use Lua? Why make them do things *our* way, when such a tiny change would let them do things *their* way, in the way they find most comfortable? -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 18:44:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95LikOS004929; Mon, 5 Oct 2009 18:44:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5909819155; Mon, 5 Oct 2009 18:43:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D510B1911A for ; Mon, 5 Oct 2009 18:43:34 -0300 (BRT) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id A7395187C0 for ; Mon, 5 Oct 2009 21:44:08 +0000 (GMT) Message-ID: <4ACA68A8.5030500@objmedia.demon.co.uk> Date: Mon, 05 Oct 2009 22:44:08 +0100 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua t-shirts References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> In-Reply-To: <20091005200154.GA30950@inf.puc-rio.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: >> I'd buy a shirt from the Lua website to help financially support the >> project if they were available. *hint hint*! >> > > We are not sure about the quality of the products sold by that site > and we do not want complains like "you recommended that lousy shirt to > us"... (I am not saying those products do not have quality, only that > we actually do not know about it.) > > Hi, Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about what he chooses to use, so take a look. http://www.zazzle.com/successfulsoftware If you buy one of those, the proceeds go to charity, take a look at http://successfulsoftware.net/2009/01/19/charity-t-shirts-update/ to see more. Stephen From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 19:37:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n95MbOYh012362; Mon, 5 Oct 2009 19:37:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 583981A6A7; Mon, 5 Oct 2009 19:36:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from uhweb12247.united-hoster.com (toolslave.net [85.88.12.247]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C48B1A66D for ; Mon, 5 Oct 2009 19:36:07 -0300 (BRT) Received: from cust194-138.dsl.versadsl.be ([62.166.194.138] helo=[192.168.0.24]) by uhweb12247.united-hoster.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1MuwAT-00020H-8z; Tue, 06 Oct 2009 00:36:39 +0200 Subject: Re: LuaLanes and Snow Leopard OSX 10.6 Mime-Version: 1.0 (Apple Message framework v1074) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Stefan Marr In-Reply-To: Date: Tue, 6 Oct 2009 00:36:28 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> To: Lua list X-Mailer: Apple Mail (2.1074) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi: On 05 Oct 2009, at 21:09, Asko Kauppi wrote: > Your problems should be due to having two separate copies of Lua > core in the system. Try to make sure lua the command line > executable is really dynamically linked to the lua shared library > that extension modules use. > > There may also be other ways to guarantee this singularity of the > Lua core. If you have two cores and you do multiple threads, OS X > gets confused like you showed. Well, looks like OS X tries to out-smart me... After getting ride of all my different lua libs and executables I got it work. I used adapted Makefiles as follows below. Thanks and best regards Stefan === modified file 'Makefile' --- Makefile 2009-02-27 15:35:13 +0000 +++ Makefile 2009-10-05 21:59:46 +0000 @@ -43,7 +43,7 @@ # What to install. TO_BIN= lua luac TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp -TO_LIB= liblua.a +TO_LIB= liblua.5.1.4.dylib TO_MAN= lua.1 luac.1 # Lua version and release. @@ -64,6 +64,7 @@ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) + sudo ln -s $(INSTALL_LIB)/liblua.5.1.4.dylib $(INSTALL_LIB)/liblua. 5.1.dylib ranlib: cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB) === modified file 'src/Makefile' --- src/Makefile 2009-02-27 15:35:13 +0000 +++ src/Makefile 2009-10-05 21:44:27 +0000 @@ -22,7 +22,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris -LUA_A= liblua.a +LUA_A= liblua.5.1.4.dylib CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \ lundump.o lvm.o lzio.o @@ -48,11 +48,17 @@ a: $(ALL_A) $(LUA_A): $(CORE_O) $(LIB_O) - $(AR) $@ $? - $(RANLIB) $@ + $(CC) -dynamiclib -install_name /usr/local/lib/liblua.5.1.dylib \ + -compatibility_version 5.1 -current_version 5.1.4 \ + -o liblua.5.1.4.dylib $^ $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + $(CC) -fno-common -DLUA_USE_LINUX -lreadline -L. -llua.5.1.4 lua.c - o lua $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) @@ -99,7 +105,7 @@ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" macosx: - $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline" + $(MAKE) all MYCFLAGS="-fno-common -DLUA_USE_LINUX" MYLIBS="-lreadline" # use this on Mac OS X 10.3- # $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX > > For users of Lua via the fink distribution, make sure your package > is >= 5.1.1-14. That has the necessary changes. Unstable has a > recent one but stable still lags behind in 5.1.1-4 or so. Lanes does > not work fine with that. > > - Asko > > > > Stefan Marr kirjoitti 5.10.2009 kello 14:03: > >> Hi Asko, >> Hi list: >> >> I tried to experiment with LuaLanes, but have some problems on my >> Snow Leopard installation. >> >> Every time I try to run one of the test I get an malloc error like >> this: >> >> lanes-2.0.3$ LUA_CPATH=./src/?.so LUA_PATH="src/?.lua;./ >> tests/?.lua" lua tests/recursive.lua >> depth: 0 1 2 3 4 5 6 7 8 9 10 11 >> lua(61739,0x7fff71085be0) malloc: *** error for object 0x1000ad1a0: >> pointer being freed was not allocated >> *** set a breakpoint in malloc_error_break to debug >> >> >> I tried to use luarocks from MacPorts to install lanes, but there >> is no rock spec. for the latest version, and for the 2.0 version, >> the download is gone, so it just failed installing. >> >> Furthermore, I followed the hints in the README to compile Lua >> with LUA_USE_DLOPEN and LUA_USE_POSIX as well as using a dylib for >> the core and library code, as described. >> However, I am still ending up with the error given above. >> >> Any thoughts how this could be fixed? >> >> Many thanks and best regards >> Stefan >> >> BTW: On an Ubuntu, it works fine... >> >> >> >> >> -- >> Stefan Marr >> Software Languages Lab >> Former Programming Technology Lab >> Vrije Universiteit Brussel >> Pleinlaan 2 / B-1050 Brussels / Belgium >> http://prog.vub.ac.be/~smarr >> Phone: +32 2 629 3956 >> Fax: +32 2 629 3525 >> > -- Stefan Marr Software Languages Lab Former Programming Technology Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://prog.vub.ac.be/~smarr Phone: +32 2 629 3956 Fax: +32 2 629 3525 From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 21:31:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n960VbMv024133; Mon, 5 Oct 2009 21:31:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B2741A67B; Mon, 5 Oct 2009 21:30:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C22D18F02 for ; Mon, 5 Oct 2009 21:30:17 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Muxx1-0006Yn-4U for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 01:30:47 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 7728B467D2 for ; Tue, 6 Oct 2009 01:30:45 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:32758 with envelope Message-ID: <4ACA8FB0.7040907@cowlark.com> Date: Tue, 06 Oct 2009 01:30:40 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE] Objective Lua References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> In-Reply-To: <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n960VbMv024133 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jacques Chester wrote: [...] > Reddited: > > http://www.reddit.com/r/programming/comments/9r1r3/objective_lua_now_you_can_mix_lua_and_smalltalk/ My poor, poor web server... I've already had more hits to that one page in the last twelve hours than I got all last month! But thanks. I find tsfn46290's comment particularly apropos. I wrote the web page very late last night, and forgot to mention Objective C bridging (I've just added a bit on that). What's the state of LuaObjC? Does it work these days? I was actually really surprised with how elegantly the ObjC syntax fitted into the Lua syntax. It might actually be worth turning this into a real project; I don't know yet. It'd be a lot of work, as it would need a complete Lua AST serialiser/deserialiser. Can anyone suggest a decently robust one with proper error handling? Most of the Lua grammars I've found seem to be part of some larger framework and not really suitable for standalone use. I picked Leg for this because it was dead simple, but alas it was so dead simple it's actually getting some grammar cases wrong... and the error handling isn't brilliant (give it the wrong syntax and it will usually silently truncate the output file!). (Personally I'm used to yacc-like grammars. Is there a similar tool for Lua?) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrKj68ACgkQf9E0noFvlzgeBQCg2yTjDJYVxoHgegf1YvGJVWcM 2QAAn1/YVkkqcJgga2NdEd9cUgFnmoJU =wEjQ -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Oct 5 22:16:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n961GJju028685; Mon, 5 Oct 2009 22:16:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC4321A69E; Mon, 5 Oct 2009 22:15:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 338D51A68F for ; Mon, 5 Oct 2009 22:14:55 -0300 (BRT) Received: by pxi2 with SMTP id 2so3807671pxi.11 for ; Mon, 05 Oct 2009 18:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=scXb8lHz1Bj5awKvHc4dXbt8y9nRorxq8Pg3iHQQ0DE=; b=PD4rXMpWmHgkwoy5Dq4iHyTs+xNxWUcQJqxHk1YPtw/6qP2NyCR9Jlp85ZeynUlrpm DXVFsPLhyG5qu0z75DNRo4Nld3fcwL44ZGS4gomLuPnc/TWUu+U7Oy3JzSWQiBkao3Id gDp0KPSWyFTsxNSMFQThYuWr1wYAKwFZoQHb8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GvuXvaRsNYS0ZFhLZJ4T7rcKYf8DDOZC9FBG1K2x2yr5UPuUXis6BE1D2vVVS8IzP/ DPc+V5V78kBJsIyvCxa72PJFgzemQMyhvEIhY+dm1i9jU5iNdOkw+ZI5eIDgiO3SXz7I fjIjwFkmzDS8WPPU72Tyz65hxfc2Tx8t90kkE= MIME-Version: 1.0 Received: by 10.142.2.14 with SMTP id 14mr58069wfb.93.1254791732758; Mon, 05 Oct 2009 18:15:32 -0700 (PDT) In-Reply-To: <4ACA8FB0.7040907@cowlark.com> References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> Date: Mon, 5 Oct 2009 18:15:32 -0700 Message-ID: <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> Subject: Re: [ANNOUNCE] Objective Lua From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I wrote the web page very late last night, and forgot to mention > Objective C bridging (I've just added a bit on that). What's the state > of LuaObjC? Does it work these days? It still works, but badly needs to be rewritten. It depends on Obj-C 1.0 runtime functions which are now deprecated and don't exist in 64-bit. I spoke to the MacRuby engineer a year ago and got a basic idea of how MacRuby does its bridging. There is a key piece of code that can be reused for other bridges. I jotted down a bunch of notes but haven't had time to pursue it. Meanwhile, I patched the existing legacy bridge to be garbage collection aware and fixed up some major memory leaks. I also have been working with pieces from Gus Mueller's LuaCore and added some hand-crafted bindings for the C-parts of Core Animation, though this is all intended as a temporary layer on the bridge. The next-gen bridge at least on Mac should be using Bridge Support (like MacRuby and PyObjC). We still lack a good object model. From the one minute I've seen of Objective Lua, it is very compelling. Is the translation done all through Lua (no C)? If so, this reminds me a lot of Objective-J and what the 280 North folks did to Javascript for their web based application framework called Cappuccino. There are two other technologies also of potential interest to a new Lua/Obj-C bridge. First is llvm-lua. The other is Lua Wax which was mentioned on this list last week. -Eric From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 00:06:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9636soQ006860; Tue, 6 Oct 2009 00:06:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E93781A6B0; Tue, 6 Oct 2009 00:05:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 608151A69B for ; Tue, 6 Oct 2009 00:05:40 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mv0NT-0000wk-IQ for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 05:06:15 +0200 Received: from ppp91-76-144-153.pppoe.mtu-net.ru ([91.76.144.153]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 05:06:15 +0200 Received: from andrew_zhilin by ppp91-76-144-153.pppoe.mtu-net.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 05:06:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: zOOn Subject: Re: [ANNOUNCE] Objective Lua Date: Tue, 6 Oct 2009 03:05:50 +0000 (UTC) Lines: 16 Message-ID: References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 91.76.144.153 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.0) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given cowlark.com> writes: > ... > It'd be a lot of work, as it would need a complete > Lua AST serialiser/deserialiser. Hi. I have lua unparser, but in Scala (you can see result of unparsing here: http://luaforge.net/frs/download.php/4248/luapp51-0.7.zip). I will be able to rewrite for you it in lua with my zpp library, but you will have to manage some sort of AST first ;) . Cheers, Andrew From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 02:52:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n965q545021509; Tue, 6 Oct 2009 02:52:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E0A01A6AF; Tue, 6 Oct 2009 02:51:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2ECB51A69B for ; Tue, 6 Oct 2009 02:50:53 -0300 (BRT) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n965pSGO024633; Tue, 6 Oct 2009 14:51:28 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Tue, 6 Oct 2009 14:51:28 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay21.aps.necel.com with ESMTP; Tue, 6 Oct 2009 14:51:28 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 9F8C052E1E4; Tue, 6 Oct 2009 14:51:28 +0900 (JST) From: Miles Bader To: Lyndon Nerenberg - VE6BBM/VE7TFX Subject: Re: UTF-8 identifiers References: <20091005183627.GA30228@inf.puc-rio.br> <07c87fb01f55c18c57e2de0c5f56ef59@yyc.orthanc.ca> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Tue, 06 Oct 2009 14:51:28 +0900 In-Reply-To: <07c87fb01f55c18c57e2de0c5f56ef59@yyc.orthanc.ca> (Lyndon Nerenberg's message of "Mon, 5 Oct 2009 13:00:34 -0600") Message-ID: Lines: 20 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lyndon Nerenberg - VE6BBM/VE7TFX writes: >> There is a world of difference between fully integrating Unicode into >> a grammar and making a patch to accept just any sequence of non-ascii >> bytes as an identifier. > > I saw two points being discussed: > > 1) how to do it, and > 2) surely this leads to madness through glyph obfuscation. (1) is obvious, and (2) is a strawman ("Don't do that"). Anyway, I think Roberto's point is that the discussion about alternate keywords etc, is not relevant. -Miles -- "Most attacks seem to take place at night, during a rainstorm, uphill, where four map sheets join." -- Anon. British Officer in WW I From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 03:48:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n966msGI025837; Tue, 6 Oct 2009 03:48:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 963EB18815; Tue, 6 Oct 2009 03:47:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hpelbers.org (hpelbers.org [74.54.162.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D27B187EE for ; Tue, 6 Oct 2009 03:47:44 -0300 (BRT) Received: from dsl-087-195-191-025.solcon.nl ([87.195.191.25] helo=[10.10.200.105]) by gauri.webserversystems.com with esmtpa (Exim 4.69) (envelope-from ) id 1Mv3qP-0002vQ-7z for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 01:48:21 -0500 Subject: ioctl and Lua From: Hans Elbers To: Lua list Content-Type: text/plain Date: Tue, 06 Oct 2009 08:48:17 +0200 Message-Id: <1254811697.3773.6.camel@laphel> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gauri.webserversystems.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hpelbers.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there a Lua module somewhere that has a binding for ioctl()? I Googled around and didn't find anything useful. I would like to get a bit closer to my hardware... From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 03:54:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n966rvOH026200; Tue, 6 Oct 2009 03:53:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE3CD1A6BA; Tue, 6 Oct 2009 03:52:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B27A187EE for ; Tue, 6 Oct 2009 03:52:54 -0300 (BRT) Received: by bwz22 with SMTP id 22so3180967bwz.5 for ; Mon, 05 Oct 2009 23:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=9QZehsfGhQ6K5nMj8YwLcgrSHBo0UNVL+rp4i7RiXOs=; b=VLIhBxk2msxJ/uughYfy9EHTnJZOB/QGbCsF0p6ZgPc5A/WcMyndnq0HkjTKXSqYBR xhzAjeuqn6WazeEVNsoZlpLrUCule34SK0jwqxF4qhgDU2ucCNcDAohH107jcayDVJIB 7VacVJ/ycpDpo7NxuJZ1H/PGZXbcAbO3SiG0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vw23PL05Ol5lmVKxC0to8MFKVUlXgqHvWC0ZU/vpBR3YvcD8pDT+8H0CQq/PPr5iyK wShAO+L9TdX1DfSOwEctTlOrfbKyBfN8f8ub0R1DARMG4oxaEzDxkC2jLfokhwQESDr+ ADh+GMqthiQkOtjQvBX5JlM+fydf5IX9tJhEg= MIME-Version: 1.0 Received: by 10.239.139.211 with SMTP id u19mr97419hbu.97.1254812011085; Mon, 05 Oct 2009 23:53:31 -0700 (PDT) In-Reply-To: <1254811697.3773.6.camel@laphel> References: <1254811697.3773.6.camel@laphel> Date: Tue, 6 Oct 2009 08:53:31 +0200 Message-ID: <560972290910052353i6e08f8bfmc2589f9f3c500492@mail.gmail.com> Subject: Re: ioctl and Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 6, 2009 at 8:48 AM, Hans Elbers wrote: > Is there a Lua module somewhere that has a binding for ioctl()? I > Googled around and didn't find anything useful. Alien would probably be sufficient for the job. From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 05:14:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n968EZAj002607; Tue, 6 Oct 2009 05:14:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C96621A6CB; Tue, 6 Oct 2009 05:13:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BF361A6C3 for ; Tue, 6 Oct 2009 05:13:25 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mv5BG-0006qM-UP for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 10:13:58 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 10:13:58 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 10:13:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Tue, 06 Oct 2009 10:13:38 +0200 Lines: 30 Message-ID: References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 05/10/2009 21:04, Petite Abeille wrote: > debut > pour uneClé, uneValue dans paires( uneTable ) faire > imprimer( uneClé, uneValue ) > fin > fin Aah, even if it is in my native language, I find it odd! Too used to English keywords... Note: at the time 8-bit computers were flourishing, there were French dialects of Basic, eg. for Thomson's TO-7. There is also Microsoft translating VBA (Visual Basic for Applications) in some selected languages (French, German, perhaps Spanish...). Hey, I even wrote a rather large VBA program using French identifiers, with accents and al., and of course French comments. I think I wouldn't do that again now... :-D Unless asked, of course, eg. in case of planned maintenance by clueless people (although quite rare in my IT world)... ;-) Now, on the other hand, I am vaguely thinking by teach programming to my daughter, if she wants, of course. She is 11 and just started to learn English this year, so she doesn't have the base vocabulary. Hence a lower learning curve if the language is in French. But, on the other hand, there is only a handful of keywords to know (and some library words, although not necessarily in real English, see gsub!) and she learns quickly. So English is probably less an obstacle than the programming concepts themselves. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 06:54:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n969sNZF011639; Tue, 6 Oct 2009 06:54:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1170619178; Tue, 6 Oct 2009 06:53:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACB7A19143 for ; Tue, 6 Oct 2009 06:53:09 -0300 (BRT) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id n969rkTH098327 for ; Tue, 6 Oct 2009 11:53:46 +0200 (CEST) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJawykrDbohb/2dsb2JhbADTRIQqBA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 06 Oct 2009 11:53:46 +0200 Received: from [192.168.127.128] (host179-231-dynamic.44-79-r.retail.telecomitalia.it [79.44.231.179]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id n969riM3034865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 6 Oct 2009 11:53:46 +0200 (CEST) (envelope-from erix@erix.it) Message-ID: <4ACB13A3.2060602@erix.it> Date: Tue, 06 Oct 2009 11:53:39 +0200 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Philippe Lhoste wrote: > Aah, even if it is in my native language, I find it odd! > Too used to English keywords... > Note: at the time 8-bit computers were flourishing, there were French > dialects of Basic, eg. for Thomson's TO-7. Je me souviens... er, I remember :-) There was something in Italian too. I think the only survivor is probably Logo. > But, on the other hand, there is only a handful of keywords to know > (and some library words, although not necessarily in real English, > see gsub!) and she learns quickly. So English is probably less an > obstacle than the programming concepts themselves. My Meccano had booklets in English and French, so before I was 6 I had learned just enough of both languages to follow instructions and build models (ah, the power of motivation...). With a programming language it's even simpler: no grammar or syntax in a literary sense, just a very small set of words to recognize and know the (technical) meaning of. Enrico From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:12:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96ACf2u013344; Tue, 6 Oct 2009 07:12:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B4A019104; Tue, 6 Oct 2009 07:11:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6B75186E8 for ; Tue, 6 Oct 2009 07:11:35 -0300 (BRT) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n96ABX4U013243; Tue, 6 Oct 2009 19:12:11 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay11.aps.necel.com with ESMTP; Tue, 6 Oct 2009 19:12:11 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay11.aps.necel.com with ESMTP; Tue, 6 Oct 2009 19:12:10 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id CE77652E1E4; Tue, 6 Oct 2009 19:12:10 +0900 (JST) From: Miles Bader To: Philippe Lhoste Subject: Re: UTF-8 identifiers References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Tue, 06 Oct 2009 19:12:10 +0900 In-Reply-To: (Philippe Lhoste's message of "Tue, 06 Oct 2009 10:13:38 +0200") Message-ID: Lines: 15 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lua@bazar2.conectiva.com.br X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Philippe Lhoste writes: > She is 11 and just started to learn English this year, so she doesn't > have the base vocabulary. Hence a lower learning curve if the language > is in French. But, on the other hand, there is only a handful of > keywords to know Helpful to learn more English too! Though people will wonder why she asks "if I miss the train then is there a penalty? end". -Miles -- Do not taunt Happy Fun Ball. From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:26:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96AQ8eB014668; Tue, 6 Oct 2009 07:26:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC76E1A6D1; Tue, 6 Oct 2009 07:25:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9B011A6C9 for ; Tue, 6 Oct 2009 07:25:02 -0300 (BRT) Received: from mail-in-06-z2.arcor-online.net (mail-in-06-z2.arcor-online.net [151.189.8.18]) by mx.arcor.de (Postfix) with ESMTP id 1EF1D2C2AC1 for ; Tue, 6 Oct 2009 12:25:39 +0200 (CEST) Received: from mail-in-02.arcor-online.net (mail-in-02.arcor-online.net [151.189.21.42]) by mail-in-06-z2.arcor-online.net (Postfix) with ESMTP id 151E15BD7A for ; Tue, 6 Oct 2009 12:25:39 +0200 (CEST) Received: from standalone. (dslb-084-061-101-001.pools.arcor-ip.net [84.61.101.1]) by mail-in-02.arcor-online.net (Postfix) with ESMTP id C8A0F3FE1E4 for ; Tue, 6 Oct 2009 12:25:38 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-02.arcor-online.net C8A0F3FE1E4 MIME-Version: 1.0 From: Michael Gerbracht To: lua@bazar2.conectiva.com.br Date: Tue, 06 Oct 2009 12:12:35 +0200 Subject: Generate multidimensional tables Message-ID: <50a5eed1a5smartmails@arcor.de> User-Agent: Pluto/3.04c (RISC-OS/4.39) Content-Type: text/plain X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I would like to create a multidimensional table with a lua fuction containing a predefined value[1] instead of nil which should work like this: example = table.dim(10,10,10) print(example[2][4][3]) output --> 0 My problem is that the table may have n dimensions. I tried to program this in lua: do function table.dim(...) local d = {...} result = {} local function adddim(res,dim) dim = dim or 1 if dim == #d then for i = 1,d[dim] do loadstring(res.."["..i.."] = 0")() end else for i = 1,d[dim] do loadstring(res.."["..i.."] = {}")() adddim(res.."["..i.."]",dim+1) end end end -- function adddim("result") return result end local example = table.dim(10,10,10) print(example[2][4][3]) end I do not like that the table "result" is a global table. Is there a more clever way to do what I want? Thank you very much! Michael [1] I know that you can change the default value using metatables. But in this case it is important that the multidimensional table is created. From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:31:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96AUwQa015098; Tue, 6 Oct 2009 07:30:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54D6D1A6D7; Tue, 6 Oct 2009 07:30:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05BE11A6D2 for ; Tue, 6 Oct 2009 07:29:57 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mv7JM-00023X-G5 for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 12:30:28 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 12:30:28 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 12:30:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Tue, 06 Oct 2009 12:30:02 +0200 Lines: 16 Message-ID: References: <4AC9B03F.9050404@cowlark.com> <20091005091954.GJ9789@pruts.nl> <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> <4ACB13A3.2060602@erix.it> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4ACB13A3.2060602@erix.it> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 06/10/2009 11:53, Enrico Colombini wrote: > My Meccano had booklets in English and French, so before I was 6 I had > learned just enough of both languages to follow instructions and build > models (ah, the power of motivation...). Lol! I was mediocre at English until I discovered role playing games... After reading the several hundred of pages (with medieval vocabulary) of the Advanced Dungeon & Dragons rules, appendices and supplements (plus scenarii, etc.), I made some progress. Motivation is indeed important! :-D -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:37:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96Ab8L6015702; Tue, 6 Oct 2009 07:37:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 651E2192A2; Tue, 6 Oct 2009 07:36:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFF191929A for ; Tue, 6 Oct 2009 07:36:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so3840356fxm.5 for ; Tue, 06 Oct 2009 03:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IGymlpEZA82lD3S9w1uXbnNd37P9DWL14968uC712bA=; b=mqKZs7DyoQ9E+c97Lw2S+YrUwr8l4xEw8Fx0JOsW+G7NmAa6+l0cSpnNjD97Mmq1UM frqVUR1BMwJpAAYNAKVmOXJlAFJWYOdgqGdMK8z6NtJTEwEgyNVCl/XJFYohbVVJlL4T SaIB5Yu668DeJRk6sK/lmfBLBwDzDOGwzRi2M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sVIO7g9phrfJ/yppv9+Z1Cb69gdPecXYwUftBLIEoFYA4thu062zPMQcUgol8D+dFD w0oFpJS8aQf7esUstOQ1DlJKxsrgbmASdQwCPeAHRNVFp7Bo2Dnr67obQS+30I3qR3f3 gN6/PlCEKOXPVf9TGbW57tZrXDjiyvLxQ4150= MIME-Version: 1.0 Received: by 10.239.145.2 with SMTP id q2mr114506hba.123.1254825401563; Tue, 06 Oct 2009 03:36:41 -0700 (PDT) In-Reply-To: <50a5eed1a5smartmails@arcor.de> References: <50a5eed1a5smartmails@arcor.de> Date: Tue, 6 Oct 2009 12:36:41 +0200 Message-ID: <560972290910060336u2de9544djd811d9faedfab2f0@mail.gmail.com> Subject: Re: Generate multidimensional tables From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 6, 2009 at 12:12 PM, Michael Gerbracht wrote: > I would like to create a multidimensional table with a lua fuction containing > a predefined value[1] instead of nil which should work like this: > > example = table.dim(10,10,10) > print(example[2][4][3]) > > output --> 0 OK, for the 2D case we just have function dim(n,m) local function set(tbl,size,val) for i = 1,size do tbl[i] = val end end for i = 1,n do From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:40:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96AdvfA015970; Tue, 6 Oct 2009 07:39:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90E981A6C9; Tue, 6 Oct 2009 07:39:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A666E1929A for ; Tue, 6 Oct 2009 07:38:56 -0300 (BRT) Received: by fxm12 with SMTP id 12so3841974fxm.5 for ; Tue, 06 Oct 2009 03:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1llwMNvEKxS+A+EJ94fsBn5pfHOMWOPqkAsI3d/STTM=; b=g8bRy6ZeOPFJKHj/8mQcZg+Zr/bw4GSIc0fPAri2gyA16dKHSXg9HOSD/M5JRZDcsb K6JKRnoXqFd0ZN2ehm1ExzYrbGwGFMnUbVj+LIxpDAONmc5egKsz/I72tNs6YbtgDYh2 OZDuTEQpenfGHoeUJ9nhzAouLlHXI3r0vUkm4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=njK/dpiWVj2uaxC44aS8aiaAbXD6pgoT0AoHj/lIuJTCpFwoDQx7NYOAvNhQvw75KN smIrgNPHiBOScRGbJZ8qaJZFiHhH4uAcq8QM7n+6Or6mZhX7nLHahckpAzyvTn5ritdp XfquEpq8sL8JCx2oJCptHMskdMWYFoS2WySaw= MIME-Version: 1.0 Received: by 10.239.141.168 with SMTP id c40mr108114hba.146.1254825573514; Tue, 06 Oct 2009 03:39:33 -0700 (PDT) In-Reply-To: <560972290910060336u2de9544djd811d9faedfab2f0@mail.gmail.com> References: <50a5eed1a5smartmails@arcor.de> <560972290910060336u2de9544djd811d9faedfab2f0@mail.gmail.com> Date: Tue, 6 Oct 2009 12:39:33 +0200 Message-ID: <560972290910060339u2b684ab1hfa567c39190ea7b2@mail.gmail.com> Subject: Re: Generate multidimensional tables From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n96AdvfA015970 On Tue, Oct 6, 2009 at 12:36 PM, steve donovan wrote: Sorry, one of those damn GMail shortcuts ... OK, for the 2D case we just have a table of row tables function dim(n,m) local res = {}   for i = 1,n do local row = {} res[i] = row for j = 1,m do row[j] = 0 end end return res end So, no clever dostring tricks, and the result is returned directly. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 07:41:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96Af4LX016105; Tue, 6 Oct 2009 07:41:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67D6F1A6DB; Tue, 6 Oct 2009 07:40:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44B051A6D5 for ; Tue, 6 Oct 2009 07:40:01 -0300 (BRT) Received: by ewy11 with SMTP id 11so3502296ewy.35 for ; Tue, 06 Oct 2009 03:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=PA0mKrTmVwOIqUGXzXcDiiAhu/OTVymjSeRUsfnM2b4=; b=vOPXJoSsvLawi+sIJdpNKsENPGDW2NUmWmqHiTE2JAuAjsFX+E78JS9ftn35sZJjI/ JWKhm6JK7GSjYhr5/CZ1MvMLb3cwWyOEmiqCY5dDPdziqNU3bTd9r8QXTfzTArf5+ma2 V9dhASCfksfAXNohaXF6yimcIKBNZ5p61aDqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=jSZ/Rgy7XrrRBifDgs/Is/lULV18eAeBNoXjGayC8S2Ah/lSo5whBurj64YJMzArq5 bgYNQsnsscmmKb2ans0cxglPo8ijb/N2YdrqYnB83pjkyL4E+JjcT2uOhz02g3kAvG7q Moggp8hQTJebByderxsNNI4DY/fAgFPzzibaI= MIME-Version: 1.0 Received: by 10.216.50.76 with SMTP id y54mr272716web.189.1254825637100; Tue, 06 Oct 2009 03:40:37 -0700 (PDT) In-Reply-To: <50a5eed1a5smartmails@arcor.de> References: <50a5eed1a5smartmails@arcor.de> From: Jerome Vuarand Date: Tue, 6 Oct 2009 12:40:17 +0200 Message-ID: <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> Subject: Re: Generate multidimensional tables To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/6 Michael Gerbracht : > I would like to create a multidimensional table with a lua fuction containing > a predefined value[1] instead of nil which should work like this: > > example = table.dim(10,10,10) > print(example[2][4][3]) > > output --> 0 > > My problem is that the table may have n dimensions. I tried to program this > in lua: > > do > > function table.dim(...) > local d = {...} > result = {} > local function adddim(res,dim) > dim = dim or 1 > if dim == #d then > for i = 1,d[dim] do > loadstring(res.."["..i.."] = 0")() > end > else > for i = 1,d[dim] do > loadstring(res.."["..i.."] = {}")() > adddim(res.."["..i.."]",dim+1) > end > end > end -- function > adddim("result") > return result > end > > local example = table.dim(10,10,10) > print(example[2][4][3]) > > end > > I do not like that the table "result" is a global table. Is there a more > clever way to do what I want? > > Thank you very much! > Michael > > [1] I know that you can change the default value using metatables. But in > this case it is important that the multidimensional table is created. You can do it recursively : function table.dim(size, ...) assert(type(size)=='number') local lastlevel = select('#', ...)==0 local t = {} for i=1,size do if lastlevel then t[i] = 0 else t[i] = table.dim(...) end end return t end From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 08:04:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96B4brQ018802; Tue, 6 Oct 2009 08:04:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADE5618959; Tue, 6 Oct 2009 08:03:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id D10E8183A8 for ; Tue, 6 Oct 2009 08:03:27 -0300 (BRT) Received: (qmail invoked by alias); 06 Oct 2009 11:04:04 -0000 Received: from unknown (EHLO [192.168.0.4]) [213.143.120.213] by mail.gmx.net (mp008) with SMTP; 06 Oct 2009 13:04:04 +0200 X-Authenticated: #3640078 X-Provags-ID: V01U2FsdGVkX1/DzJ5VUyXDXOG5I0vKCKqdAtr7kA4AdHqyY+OCHz NRf1+BchY873W5 Message-ID: <4ACB2427.2050000@gmx.at> Date: Tue, 06 Oct 2009 13:04:07 +0200 From: Michael Wolf User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Generate multidimensional tables References: <50a5eed1a5smartmails@arcor.de> In-Reply-To: <50a5eed1a5smartmails@arcor.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.71 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Michael Gerbracht schrieb: > I would like to create a multidimensional table with a lua fuction containing > a predefined value[1] instead of nil which should work like this: > > example = table.dim(10,10,10) > print(example[2][4][3]) > > output --> 0 > > Hi Michael, i would do it with a recursive function instead of loadstrings which are slow and "ugly". For example: function table.dim(...) local ret={} if select("#",...)==1 then for i=1,select(1,...) or 1 do ret[i]=0 end else for i=1,(select(1,...)) or 1 do ret[i]=table.dim(select(2,...)) end end return ret end local tbl=table.dim(10,20,30) print (tbl[1][2][3]) print (#tbl,#tbl[1],#tbl[1][2]) Best Regards, Michael From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 08:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96BkjHh022898; Tue, 6 Oct 2009 08:46:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9B9919109; Tue, 6 Oct 2009 08:45:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-in-16.arcor-online.net (mail-in-16.arcor-online.net [151.189.21.56]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 636A719092 for ; Tue, 6 Oct 2009 08:45:36 -0300 (BRT) Received: from mail-in-09-z2.arcor-online.net (mail-in-09-z2.arcor-online.net [151.189.8.21]) by mx.arcor.de (Postfix) with ESMTP id BD061256F7B for ; Tue, 6 Oct 2009 13:46:12 +0200 (CEST) Received: from mail-in-13.arcor-online.net (mail-in-13.arcor-online.net [151.189.21.53]) by mail-in-09-z2.arcor-online.net (Postfix) with ESMTP id 8ED4928EE9C for ; Tue, 6 Oct 2009 13:46:12 +0200 (CEST) Received: from standalone. (dslb-084-061-012-091.pools.arcor-ip.net [84.61.12.91]) by mail-in-13.arcor-online.net (Postfix) with ESMTP id 317EB2BAB68 for ; Tue, 6 Oct 2009 13:46:12 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-13.arcor-online.net 317EB2BAB68 MIME-Version: 1.0 From: Michael Gerbracht To: Lua list Date: Tue, 06 Oct 2009 13:33:29 +0200 Subject: Re: Generate multidimensional tables Message-ID: <50a5f63998smartmails@arcor.de> In-Reply-To: <4ACB2427.2050000@gmx.at> References: <50a5eed1a5smartmails@arcor.de> <4ACB2427.2050000@gmx.at> User-Agent: Pluto/3.04c (RISC-OS/4.39) Content-Type: text/plain X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Michael In article <4ACB2427.2050000@gmx.at>, Michael Wolf wrote: > Michael Gerbracht schrieb: > > I would like to create a multidimensional table with a lua fuction > i would do it with a recursive function instead of loadstrings which are > slow and "ugly". That's true, I did not like my solution, either. Thank you very much, Michael From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 08:49:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96Bn9GK023254; Tue, 6 Oct 2009 08:49:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B743A1A6E0; Tue, 6 Oct 2009 08:48:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B04E1A6D0 for ; Tue, 6 Oct 2009 08:48:07 -0300 (BRT) Received: from mail-in-20-z2.arcor-online.net (mail-in-20-z2.arcor-online.net [151.189.8.85]) by mx.arcor.de (Postfix) with ESMTP id 0813AE397D for ; Tue, 6 Oct 2009 13:48:43 +0200 (CEST) Received: from mail-in-13.arcor-online.net (mail-in-13.arcor-online.net [151.189.21.53]) by mail-in-20-z2.arcor-online.net (Postfix) with ESMTP id A12CD108484 for ; Tue, 6 Oct 2009 13:48:42 +0200 (CEST) Received: from standalone. (dslb-084-061-012-091.pools.arcor-ip.net [84.61.12.91]) by mail-in-13.arcor-online.net (Postfix) with ESMTP id 2E2962BABB2 for ; Tue, 6 Oct 2009 13:48:41 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-13.arcor-online.net 2E2962BABB2 MIME-Version: 1.0 From: Michael Gerbracht To: Lua list Date: Tue, 06 Oct 2009 13:35:58 +0200 Subject: Re: Generate multidimensional tables Message-ID: <50a5f673f0smartmails@arcor.de> In-Reply-To: <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> References: <50a5eed1a5smartmails@arcor.de> <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> User-Agent: Pluto/3.04c (RISC-OS/4.39) Content-Type: text/plain X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Jerome, In article <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com>, Jerome Vuarand wrote: > 2009/10/6 Michael Gerbracht : > > I would like to create a multidimensional table with a lua fuction > > containing a predefined value[1] instead of nil which should work like > > this: > You can do it recursively : > function table.dim(size, ...) > assert(type(size)=='number') > local lastlevel = select('#', ...)==0 > local t = {} > for i=1,size do > if lastlevel then > t[i] = 0 > else > t[i] = table.dim(...) > end > end > return t > end Thank you very much, this looks much better! Michael From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 10:24:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96DOSov006734; Tue, 6 Oct 2009 10:24:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79A041A6E8; Tue, 6 Oct 2009 10:23:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 335171A6E5 for ; Tue, 6 Oct 2009 10:23:04 -0300 (BRT) Received: by bwz22 with SMTP id 22so3397258bwz.5 for ; Tue, 06 Oct 2009 06:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kQumWYDYEQ5cN0uVlZv35p6R7s32xYs/D7nmo56cHMw=; b=TemI0z4tTc4esGzccZYug0xUDzq3/te8dzCxyDVSnFXtP72VLQ207pcH5z3Z5pdLud QD+XWYPovgaw+HvB+o+wOjvEPwkDcUh4r+daqHt2FWrTxXSzqgfIxCKDH9rZ3KgvEfS+ 5Llx6OApDAkARU6VxYF154ckeOzpzOYde7PAg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aQQ6stWB+eUrYtlUQ8w/vw9PhaWOrB23BBavpxOsO1MpFHzAE3SkTp3KmzKEWm1u/w BleHA4SxeroY3qIzqQjibk2d8xPv1/bk8RX4eJ+Gc3s1aeHxRmB7r/uwD24PwlFvkeug JlG8VzF+7xZIJ7J9mjHMZNyM7h9PhZqs88u10= MIME-Version: 1.0 Received: by 10.204.157.24 with SMTP id z24mr601052bkw.208.1254835421870; Tue, 06 Oct 2009 06:23:41 -0700 (PDT) In-Reply-To: <50a5f673f0smartmails@arcor.de> References: <50a5eed1a5smartmails@arcor.de> <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> <50a5f673f0smartmails@arcor.de> Date: Tue, 6 Oct 2009 15:23:41 +0200 Message-ID: <4ff79edb0910060623q5a5d54a0y5fe66aa28c3c7de8@mail.gmail.com> Subject: Re: Generate multidimensional tables From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=0015175d0640927c880475442301 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d0640927c880475442301 Content-Type: text/plain; charset=ISO-8859-1 Hi all, as far as I know is better to use unidimensional table to implement multidimensional array (like in C). Here an example that should do the affair: local function tmul(ls) local p = 1 for i, v in ipairs(ls) do p = p*v end return p end function init_multi_table() local mt = {} local default_value = 0 local get_index = function(argls) local t = table.remove(argls, 1) local dt = tmul(t.dims) local index = 1 for i, d in ipairs(t.dims) do dt = dt / d index = index + dt * (argls[i] - 1) end return t, index end local get = function(...) local t, i = get_index(arg); return t[i] end local set = function(...) local v = table.remove(arg) local t, i = get_index(arg) t[i] = v end local function create(...) local dt = tmul(arg) local t = {} setmetatable(t, mt) mt.__index = mt t.dims = arg for i=1,dt do t[i] = default_value end return t end mt.get = get mt.set = set mt.create = create return mt end MultiTable = init_multi_table() mytb = MultiTable.create(3,7,5) -- create a 3-dimensional array 3x7x5 mytb:set(2,5,1, 3.14) x = mytb:get(2,5,1) -- 3.14 x = mytb:get(3,5,1) -- 0 Francesco 2009/10/6 Michael Gerbracht > Hello Jerome, > > In article <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com>, > Jerome Vuarand wrote: > > 2009/10/6 Michael Gerbracht : > > > I would like to create a multidimensional table with a lua fuction > > > containing a predefined value[1] instead of nil which should work like > > > this: > > > You can do it recursively : > > > function table.dim(size, ...) > > assert(type(size)=='number') > > local lastlevel = select('#', ...)==0 > > local t = {} > > for i=1,size do > > if lastlevel then > > t[i] = 0 > > else > > t[i] = table.dim(...) > > end > > end > > return t > > end > > Thank you very much, this looks much better! > > Michael > > --0015175d0640927c880475442301 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

as far as I know is better to use unidimensional= table to implement multidimensional array (like in C). Here an example tha= t should do the affair:

local function tmul(ls)
=A0=A0 local p =3D 1
=A0=A0 for i, v in ipairs(ls) do p =3D = p*v end
=A0=A0 return p
end

fu= nction init_multi_table()
=A0=A0 local mt =3D {}
=A0=A0= local default_value =3D 0

=A0=A0 local get_index =3D function(argls)
local t = =3D table.remove(argls, 1)
local dt =3D tmul(t.dims)
loc= al index =3D 1
for i, d in ipairs(t.dims) do
=A0 dt =3D dt / d
= =A0 index =3D index + dt * (argls[i] - 1)
end
return t, index
=A0= =A0 end

=A0=A0 local get =3D function(...) local = t, i =3D get_index(arg); return t[i] end

=A0=A0 lo= cal set =3D function(...)=A0
=A0= local v =3D table.remove(arg)
=A0local t, i =3D get_index(arg)
= =A0t[i] = =3D v
=A0 = =A0 =A0 end

=A0=A0 local function create(...)
=A0=A0 =A0 =A0local dt =3D tmul(arg)
=A0=A0 =A0 =A0
=A0=A0 =A0 =A0local t =3D {}
=A0=A0 =A0 =A0setmetatable(t, mt)
=A0=A0 =A0 =A0mt.__index =3D mt=

=A0=A0 =A0 =A0t.dims =3D arg
=A0=A0 =A0= =A0for i=3D1,dt do t[i] =3D default_value end
=A0=A0 =A0 =A0retu= rn t
=A0=A0 end

=A0=A0 mt.get =3D get
=A0=A0 mt.set =3D set
=A0=A0 mt.c= reate =3D create

=A0=A0 return mt
end

MultiTable =3D init_multi_table()

mytb =3D MultiTable.create(3,7,5) -- create a 3-dimensional array 3x= 7x5
mytb:set(2,5,1, 3.14)
x =3D mytb:get(2,5,1) -- 3.14
x =3D mytb:get(3,5,1) -- 0

Francesco
<= /div>

2009/10/6 Michael Gerbracht = <smartmails@arc= or.de>
Hello Jerome,

In article <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.= com>,
=A0 Jerome Vuarand <jerome.vuarand@gmail.com> wrote:
> 2009/10/6 Michael Gerbracht <smartmails@arcor.de>:
> > I would like to create a multidimensional table with a lua fuctio= n
> > containing a predefined value[1] instead of nil which should work= like
> > this:

> You can do it recursively :

> function table.dim(size, ...)
> =A0 =A0 assert(type(size)=3D=3D'number')
> =A0 =A0 local lastlevel =3D select('#', ...)=3D=3D0
> =A0 =A0 local t =3D {}
> =A0 =A0 for i=3D1,size do
> =A0 =A0 =A0 =A0 if lastlevel then
> =A0 =A0 =A0 =A0 =A0 =A0 t[i] =3D 0
> =A0 =A0 =A0 =A0 else
> =A0 =A0 =A0 =A0 =A0 =A0 t[i] =3D table.dim(...)
> =A0 =A0 =A0 =A0 end
> =A0 =A0 end
> =A0 =A0 return t
> end

Thank you very much, this looks much better!

Michael


--0015175d0640927c880475442301-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 10:32:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96DWGWp008619; Tue, 6 Oct 2009 10:32:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08E541A6EF; Tue, 6 Oct 2009 10:31:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 725E71A6E5 for ; Tue, 6 Oct 2009 10:31:10 -0300 (BRT) Received: by bwz22 with SMTP id 22so3404402bwz.5 for ; Tue, 06 Oct 2009 06:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BLCh6oqJZb4DeSv6jDgHh6FpMhUcfBanPu1Ws+dSKnA=; b=rkfHZZB33QpwHD/OFitPpxC34tQLmwdGBHPgNUpbiq+xIRlPT4kOeErZ4vTxrf8Yg+ KtZLt8pTRAFw4px57j1mj9dqRxv3HWDLhjIvq+CGIq00gnY/wmCB/y+ddJ6S8/GAKA3t cg8Dbpv2wlwROiYnUrBJDXqSbgkZMIaqzUCbY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=N5ke7xfeYAxhFZ5VrX4rwNvPJ/CBUSiB964VLuc9IlnNQICLVKUBKciHoaaQFcPUW2 C9Wa3CZxGIoS60p+lAUcidv4iAFO5843LgY6pKEo5TY3/88qzv+AclJlwjmYybKMxgw7 pUKFN9tBvdoIr3xfNRFzwBQLrk25hyuwsnITI= MIME-Version: 1.0 Received: by 10.239.134.226 with SMTP id a34mr127303hba.7.1254835907211; Tue, 06 Oct 2009 06:31:47 -0700 (PDT) In-Reply-To: <4ff79edb0910060623q5a5d54a0y5fe66aa28c3c7de8@mail.gmail.com> References: <50a5eed1a5smartmails@arcor.de> <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> <50a5f673f0smartmails@arcor.de> <4ff79edb0910060623q5a5d54a0y5fe66aa28c3c7de8@mail.gmail.com> Date: Tue, 6 Oct 2009 15:31:47 +0200 Message-ID: <560972290910060631idd9c8afi5e8bf7423f582643@mail.gmail.com> Subject: Re: Generate multidimensional tables From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 6, 2009 at 3:23 PM, Francesco Abbate wrote: > Hi all, > as far as I know is better to use unidimensional table to implement > multidimensional array (like in C). Here an example that should do the > affair: I seriously doubt that all these function calls & arithmetic would beat a few table lookups! From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 10:59:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96Dxm0h014523; Tue, 6 Oct 2009 10:59:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98F6A185CF; Tue, 6 Oct 2009 10:58:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21D44184EF for ; Tue, 6 Oct 2009 10:58:31 -0300 (BRT) Received: by ewy11 with SMTP id 11so3685166ewy.35 for ; Tue, 06 Oct 2009 06:59:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.11.67 with SMTP id 45mr332660wew.44.1254837548784; Tue, 06 Oct 2009 06:59:08 -0700 (PDT) In-Reply-To: <560972290910060631idd9c8afi5e8bf7423f582643@mail.gmail.com> References: <50a5eed1a5smartmails@arcor.de> <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> <50a5f673f0smartmails@arcor.de> <4ff79edb0910060623q5a5d54a0y5fe66aa28c3c7de8@mail.gmail.com> <560972290910060631idd9c8afi5e8bf7423f582643@mail.gmail.com> Date: Tue, 6 Oct 2009 14:59:08 +0100 X-Google-Sender-Auth: ef3502971e7cc88f Message-ID: Subject: Re: Generate multidimensional tables From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I recently needed to implement a 3 dimensional table to store game map data. The map is 128x128 tiles in size, and has 8 layers per tile. Initially I used a naive implementation like map[x][y][layer]=value, but this requires in excess of 2^14 tables, which eats a considerable amount of memory, and takes a very noticeable amount of time to garbage collect. A revised implementation along the lines of map[x * 1024 + y * 8 + layer]=value eliminated the long GC pause when the map was unloaded (sure, incremental garbage collection helps, but when the app is closed by the user, the GC has to run fully, and the end result was a long lag between the user pressing the close button, and the app actually closing). On Tue, Oct 6, 2009 at 2:31 PM, steve donovan wrote: > On Tue, Oct 6, 2009 at 3:23 PM, Francesco Abbate > wrote: >> Hi all, >> as far as I know is better to use unidimensional table to implement >> multidimensional array (like in C). Here an example that should do the >> affair: > > I seriously doubt that all these function calls & arithmetic would > beat a few table lookups! > From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 11:12:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96EC0Pj017776; Tue, 6 Oct 2009 11:12:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83CEC1A6E7; Tue, 6 Oct 2009 11:10:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-04.prod.phx3.secureserver.net (p3plsmtpa01-04.prod.phx3.secureserver.net [72.167.82.84]) by bazar2.conectiva.com.br (Postfix) with SMTP id D0F611881C for ; Tue, 6 Oct 2009 11:10:50 -0300 (BRT) Received: (qmail 8974 invoked from network); 6 Oct 2009 14:11:23 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-04.prod.phx3.secureserver.net (72.167.82.84) with ESMTP; 06 Oct 2009 14:11:22 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANNOUNCE] Objective Lua From: Mark Hamburg In-Reply-To: <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> Date: Tue, 6 Oct 2009 07:11:21 -0700 Content-Transfer-Encoding: 7bit Message-Id: <9CFAB263-A1E6-455E-A58A-0F50BCE104BB@grubmah.com> References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 5, 2009, at 6:15 PM, E. Wing wrote: > Meanwhile, I patched the existing legacy bridge to be garbage > collection aware and fixed up some major memory leaks. Dueling garbage collectors are generally a pain. On Lightroom, we found it advantageous to be using the reference counted version of Objective-C with Lua's garbage collector. Did you actually come up with a reasonable way to handle the Lua object A points to Objective-C object B which points to Lua object A case? In a simple dual GC implementation (e.g., using refs or the equivalent to refer to Lua objects), the objects end up as roots because of the foreign references and the collectors end up waiting for the other to go first in breaking the cycle. Lightroom uses the reference count information to detect when the only reference to an Objective-C object is from the Lua side and change its handling at that point. Mark From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 11:17:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96EHVuX019178; Tue, 6 Oct 2009 11:17:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33712188A4; Tue, 6 Oct 2009 11:16:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6252C1881C for ; Tue, 6 Oct 2009 11:16:18 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MvAqN-00033N-8F for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 16:16:47 +0200 Received: from p5b2c260d.dip.t-dialin.net ([91.44.38.13]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 16:16:47 +0200 Received: from dak by p5b2c260d.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 16:16:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Generate multidimensional tables Date: Tue, 06 Oct 2009 16:16:10 +0200 Organization: Organization?!? Lines: 44 Message-ID: <87my44liad.fsf@lola.goethe.zz> References: <50a5eed1a5smartmails@arcor.de> <89d273ba0910060340q1b43e7e3y22afa986a4290557@mail.gmail.com> <50a5f673f0smartmails@arcor.de> <4ff79edb0910060623q5a5d54a0y5fe66aa28c3c7de8@mail.gmail.com> <560972290910060631idd9c8afi5e8bf7423f582643@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c260d.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:D//vxIiR11dwqG9Axn0QZD89hMY= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > On Tue, Oct 6, 2009 at 3:23 PM, Francesco Abbate > wrote: >> Hi all, >> as far as I know is better to use unidimensional table to implement >> multidimensional array (like in C). Here an example that should do the >> affair: > > I seriously doubt that all these function calls & arithmetic would > beat a few table lookups! "Numerical algorithms in C" is a translation of the original "Numerical algorithms" written with Fortran. Instead of Fortran's multidimensional variable-size arrays something else had to be done. The people doing that decided a) to stay with index numbering with 1, and rather allocate additional space in the arrays b) to deal with the problem of passing runtime-sizes multidimensional arrays into functions by having a be an array of pointers such that a[i] points into one row in a contiguous array. The result is that the allocation is a terrible mess incompatible with any other library, that memory is wasted a lot, that stuff gets allocated on the _heap_ rather than on the stack (which means garbage collection costs), and most importantly, that the inner loops can't be optimized. When writing out everything in terms of explicit index arithmetic, the compiler can use loop reversal, strength unfolding, static overlap analysis and other things. With the "row pointer" "trick", all optimizations fail. In addition, even without strength reduction, on current computers about 10 complete index calculations can be performed in the time that it takes to do a single memory access. And of course, the row pointer accesses cause cache poisoning as well. Now we are talking about Lua rather than C here, but the assumption for Lua is that floating point arithmetic is fast compared to the alternatives, and with fixed expected times. Table accesses are more complex in contrast. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 11:46:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96EkJoF026691; Tue, 6 Oct 2009 11:46:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D215718BA1; Tue, 6 Oct 2009 11:45:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 224E918B15 for ; Tue, 6 Oct 2009 11:45:05 -0300 (BRT) Received: by ewy11 with SMTP id 11so3738054ewy.35 for ; Tue, 06 Oct 2009 07:45:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.156.13 with SMTP id i13mr1733441ebo.22.1254840343139; Tue, 06 Oct 2009 07:45:43 -0700 (PDT) In-Reply-To: References: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> Date: Tue, 6 Oct 2009 09:45:43 -0500 Message-ID: <90eb1dc70910060745k383430aev98c3fb596dbee993@mail.gmail.com> Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 6, 2009 at 3:13 AM, Philippe Lhoste wrote: > There is also Microsoft translating VBA (Visual Basic for Applications) in > some selected languages (French, German, perhaps Spanish...). yeah, there's a basic in spanish. one of the most disgusting things i've ever read. -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 11:56:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96Etv5A029441; Tue, 6 Oct 2009 11:55:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D57B018CE6; Tue, 6 Oct 2009 11:54:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D09A618C1B for ; Tue, 6 Oct 2009 11:54:45 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MvBRa-0006op-Lw for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 15:55:14 +0100 Received: from [192.168.2.57] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B1CD117047 for ; Tue, 6 Oct 2009 15:55:12 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:20696 with envelope Message-ID: <4ACB5A39.2020107@cowlark.com> Date: Tue, 06 Oct 2009 15:54:49 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE] Objective Lua References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> In-Reply-To: <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n96Etv5A029441 E. Wing wrote: [...] > Meanwhile, I patched the existing legacy bridge to be garbage > collection aware and fixed up some major memory leaks. I also have > been working with pieces from Gus Mueller's LuaCore and added some > hand-crafted bindings for the C-parts of Core Animation, though this > is all intended as a temporary layer on the bridge. The next-gen > bridge at least on Mac should be using Bridge Support (like MacRuby > and PyObjC). How much of this is OSX-specific? Will it work with GNUstep, for example (since I don't have a Mac handy...) Also, how much introspection can you do on a bridged object? Do you see them simply as opaque Lua objects with method calls peered over to Objective C, or does the full Objective C class hierarchy appear in Lua, which you can then add classes to, etc? > We still lack a good object model. From the one minute I've seen of > Objective Lua, it is very compelling. Is the translation done all > through Lua (no C)? If so, this reminds me a lot of Objective-J and > what the 280 North folks did to Javascript for their web based > application framework called Cappuccino. About a minute is all it's worth; right now the Objective Lua 'compiler' is an almost trivial syntax hack. The object model is a traditional metatable-based Lua OO system. The only thing slightly interesting about it is that it supports class methods. In fact, it's currently all wrong, and I need to rewrite it. I think I've got a fairly simple design that can support categories. I didn't know about Objective J; it's rather interesting, and very much the same sort of thing. In fact, I might steal some of their syntax. There's been a surprising amount of interest. (The reddit link didn't help...) In the past 24 hours that one page alone has had 3300 hits. I usually get about 2000 hits a month *on my entire website*! Admittedly, only 36 actual code downloads, but it's certainly striking a chord with people. Maybe it *would* be worth doing properly... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 12:30:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n96FUBhK004613; Tue, 6 Oct 2009 12:30:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B91018E5E; Tue, 6 Oct 2009 12:29:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DC0318D31 for ; Tue, 6 Oct 2009 12:28:54 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MvByh-0005v0-VW for lua@bazar2.conectiva.com.br; Tue, 06 Oct 2009 17:29:27 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 17:29:27 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Oct 2009 17:29:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts] Date: Tue, 06 Oct 2009 17:29:03 +0200 Lines: 14 Message-ID: References: <89d273ba0910050245i6e46d52fwa4f21c87ffb8d283@mail.gmail.com> <4AC9CD05.4000507@erix.it> <89d273ba0910050510v10a27a45s7cc549937397508f@mail.gmail.com> <4AC9E3B2.2050106@erix.it> <4AC9EBF8.8010901@cowlark.com> <89d273ba0910051123y4b2208deo267d472b747ef6c7@mail.gmail.com> <9A937F1C-310F-40B6-BF8B-8D377DAC07ED@mac.com> <90eb1dc70910060745k383430aev98c3fb596dbee993@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <90eb1dc70910060745k383430aev98c3fb596dbee993@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 06/10/2009 16:45, Javier Guerra wrote: > yeah, there's a basic in spanish. one of the most disgusting things > i've ever read. And a major pain when you search usage of a function without knowing the English name (where you have much more data). Not to mention different separators (; instead of , because the latter is decimal separator in French) and so on... -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 21:20:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n970KF5O016355; Tue, 6 Oct 2009 21:20:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BC361A6D3; Tue, 6 Oct 2009 21:19:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2E911A668 for ; Tue, 6 Oct 2009 21:18:59 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so946576eye.39 for ; Tue, 06 Oct 2009 17:19:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.85.194 with SMTP id u44mr464904wee.65.1254874776153; Tue, 06 Oct 2009 17:19:36 -0700 (PDT) From: Chris Gagnon Date: Tue, 6 Oct 2009 17:19:16 -0700 Message-ID: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> Subject: Anchoring co-routines and properly dropping references to allow GC to clean them up To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e6d7e74445306d04754d4d21 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d7e74445306d04754d4d21 Content-Type: text/plain; charset=ISO-8859-1 Lets assume we have a MainState, and a "ThreadTable" in the global table lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); lua_State *thread = lua_newthread(MainState); luaL_ref(MainState, -2); lua_pop(MainState,1); --0016e6d7e74445306d04754d4d21 Content-Type: text/html; charset=ISO-8859-1 Lets assume we have a MainState, and a "ThreadTable" in the global table

lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
lua_State *thread = lua_newthread(MainState);
luaL_ref(MainState, -2);
lua_pop(MainState,1);




--0016e6d7e74445306d04754d4d21-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 21:47:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n970kx33019127; Tue, 6 Oct 2009 21:46:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E4171A67C; Tue, 6 Oct 2009 21:45:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8492F19288 for ; Tue, 6 Oct 2009 21:45:51 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MvKfk-0003Gp-DV for lua@bazar2.conectiva.com.br; Wed, 07 Oct 2009 02:46:28 +0200 Received: from 66-192-186-101.static.twtelecom.net ([66.192.186.101]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Oct 2009 02:46:28 +0200 Received: from stuart by 66-192-186-101.static.twtelecom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Oct 2009 02:46:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: LuaForge down. Again. Date: Tue, 6 Oct 2009 17:39:17 -0700 Lines: 1 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 66-192-186-101.static.twtelecom.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean LuaForge Could Not Connect To Database: From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 21:49:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n970n4Z1019471; Tue, 6 Oct 2009 21:49:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC58C19294; Tue, 6 Oct 2009 21:48:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDEE519288 for ; Tue, 6 Oct 2009 21:47:58 -0300 (BRT) Received: by ewy11 with SMTP id 11so4298478ewy.35 for ; Tue, 06 Oct 2009 17:48:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.91.13 with SMTP id g13mr448497wef.36.1254876516194; Tue, 06 Oct 2009 17:48:36 -0700 (PDT) In-Reply-To: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> References: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> From: Chris Gagnon Date: Tue, 6 Oct 2009 17:48:16 -0700 Message-ID: <826d5c730910061748p10bcce78n552955cb5c33c74f@mail.gmail.com> Subject: Re: Anchoring co-routines and properly dropping references to allow GC to clean them up To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e6d975e1fc1c3d04754db456 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d975e1fc1c3d04754db456 Content-Type: text/plain; charset=ISO-8859-1 Apologizes for the partial email, what a way to introduce myself ;o) Lets assume we have a MainState, and a "ThreadTable" in the global table lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); lua_State *thread = lua_newthread(MainState); int refID = luaL_ref(MainState, -2); lua_pop(MainState,1); we now have a new thread ready to go essentially that is anchored in our thread table and we balanced the stack. Consider: lua_load(thread, ...); lua_pcall(thread, 0, 0, 0); we have kicked of our coroutine now, presumably it can call c functions other lua functions yield itself be resumed and so on. If say i need to kill off my co routines i can empty out the thread table and those co routines should be GC at some point. The problem i'm running into is how do I remove my reference/anchor, when the coroutine is simply done. I have a work around in which I simply wrap all my function calls in another lua function like: function StartInternal(func, refID, ...) func(unpack(arg)); -- Unregister coroutine ThreadTable[refID] = nil; end but i would really like to do away with this. Any suggestions would be greatly appreciated, i feel like there must be some reasonably obvious way to do this I'm overlooking. I think it's important to note that performance is very important, which is one of the main reasons i want this wrapper gone. -Chris --0016e6d975e1fc1c3d04754db456 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Apologizes for the partial email, what a way to introduce myself ;o)
Lets assume we have a MainState, and a "ThreadTable" in the glob= al table

lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable= ");
lua_State *thread =3D lua_newthread(MainState);
int refID =3D luaL_ref(M= ainState, -2);
lua_pop(MainState,1);

we now have a new thread rea= dy to go essentially that is anchored in our thread table and we balanced t= he stack.
Consider:
lua_load(thread, ...);
lua_pcall(thread, 0, 0, 0);

w= e have kicked of our coroutine now, presumably it can call c functions othe= r lua functions yield itself be resumed and so on.
If say i need to kill= off my co routines i can empty out the thread table and those co routines = should be GC at some point.

The problem i'm running into is how do I remove my reference/anchor= , when the coroutine is simply done.

I have a work around in which I= simply wrap all my function calls in another lua function like:
=A0=A0= =A0 function StartInternal(func, refID, ...)
=A0=A0=A0 =A0=A0=A0 func(unpack(arg));
=A0=A0=A0 =A0=A0=A0 -- Unregister= coroutine
=A0=A0=A0 =A0=A0=A0 ThreadTable[refID] =3D nil;
=A0=A0=A0 = end

but i would really like to do away with this.

Any suggest= ions would be greatly appreciated, i feel like there must be some reasonabl= y obvious way to do this I'm overlooking.
I think it's important to note that performance is very important, whic= h is one of the main reasons i want this wrapper gone.

-Chris
--0016e6d975e1fc1c3d04754db456-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 22:09:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97192SP021779; Tue, 6 Oct 2009 22:09:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B72A81A67E; Tue, 6 Oct 2009 22:08:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8865192A2 for ; Tue, 6 Oct 2009 22:07:52 -0300 (BRT) Received: by iwn8 with SMTP id 8so2593170iwn.33 for ; Tue, 06 Oct 2009 18:08:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.122.162 with SMTP id l34mr4088298ibr.20.1254877710251; Tue, 06 Oct 2009 18:08:30 -0700 (PDT) In-Reply-To: <826d5c730910061748p10bcce78n552955cb5c33c74f@mail.gmail.com> References: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> <826d5c730910061748p10bcce78n552955cb5c33c74f@mail.gmail.com> Date: Tue, 6 Oct 2009 22:08:30 -0300 Message-ID: <790db3550910061808k4b67fbf2gd9abf852bec518b4@mail.gmail.com> Subject: Re: Anchoring co-routines and properly dropping references to allow GC to clean them up From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 6, 2009 at 9:48 PM, Chris Gagnon wrote: > Apologizes for the partial email, what a way to introduce myself ;o) > > Lets assume we have a MainState, and a "ThreadTable" in the global table > > lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); > lua_State *thread = lua_newthread(MainState); > int refID = luaL_ref(MainState, -2); > lua_pop(MainState,1); [...] > The problem i'm running into is how do I remove my reference/anchor, when > the coroutine is simply done. Sorry if I misunderstand, but isn't this all you want? lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); lua_pushnil(MainState); lua_rawseti(MainState, -2, refID); lua_pop(MainState, 1); /* ThreadTable */ -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 22:57:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n971vJCm026850; Tue, 6 Oct 2009 22:57:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1861C1A6E0; Tue, 6 Oct 2009 22:56:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f177.google.com (mail-pz0-f177.google.com [209.85.222.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F8751A688 for ; Tue, 6 Oct 2009 22:56:02 -0300 (BRT) Received: by pzk7 with SMTP id 7so4411208pzk.33 for ; Tue, 06 Oct 2009 18:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yQBU4a7oKeSDeXuyielNykCzK0IdUGPDcTkCLbKrkvQ=; b=qTrX5cb7mau6zjMLzLN6au4KD40lCfu7IJceSzB2YzaeHaE5WPXHDk60wiHh0zrVuc MuluqiXxZLXls0zewxQ4dT5uqRWdWrJ+pFUWaBsZXX61gk6iyf8J/I2nO/xd+R9MgfJC 4jgkpfG5nYwdOLWx+LIoXR0W3VEJhf+kngG7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=b62XlnHi4dTo8EVUh2ENMV2I4bpDJW6cXf5HCheLDJef9hCKxX48J1qSusJAPwIv+w ro/c771ulcZ4QwmUiaQsmC6u5r3xp/wFAiJQFeH1iXifXbWIJzrBo6t+cRkHvqEbcC6m VU0yvwnT726XHFXprA0HyBdH/FV6DV2MMlCrU= MIME-Version: 1.0 Received: by 10.142.8.3 with SMTP id 3mr161539wfh.72.1254880600657; Tue, 06 Oct 2009 18:56:40 -0700 (PDT) In-Reply-To: <9CFAB263-A1E6-455E-A58A-0F50BCE104BB@grubmah.com> References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> <9CFAB263-A1E6-455E-A58A-0F50BCE104BB@grubmah.com> Date: Tue, 6 Oct 2009 18:56:40 -0700 Message-ID: <3c7e3c8a0910061856p5aca10cfp78f87b8a5b95fad0@mail.gmail.com> Subject: Re: [ANNOUNCE] Objective Lua From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/6/09, Mark Hamburg wrote: > On Oct 5, 2009, at 6:15 PM, E. Wing wrote: > >> Meanwhile, I patched the existing legacy bridge to be garbage >> collection aware and fixed up some major memory leaks. > > Dueling garbage collectors are generally a pain. On Lightroom, we > found it advantageous to be using the reference counted version of > Objective-C with Lua's garbage collector. Did you actually come up > with a reasonable way to handle the Lua object A points to Objective-C > object B which points to Lua object A case? In a simple dual GC > implementation (e.g., using refs or the equivalent to refer to Lua > objects), the objects end up as roots because of the foreign > references and the collectors end up waiting for the other to go first > in breaking the cycle. Lightroom uses the reference count information > to detect when the only reference to an Objective-C object is from the > Lua side and change its handling at that point. > No, sorry, I didn't mean to misrepresent it. it's the most naive thing you can imagine. It's not well tested and I wouldn't be surprised if there are still problems like the one you describe. Basically, I just place CFRetain's/CFRelease's in critical spots in the bridge to make sure created lua objects don't get collected from underneath you. I made all these changes at the same time I was fixing normal non-gc code. There was a bug in the bridge that expected metamethods to be called for light user data so things were leaking. I basically moved things over to use full userdata in a way that made the least resistance with the current code. One thing I have been thinking about is some kind of global map to hold all and easily retrieve bridge objects in C before crossing the bridge. This was not for memory management, but to avoid a uniqueness and equality problem. I think as it is, if an object goes through the bridge multiple times, the bridge creates a new userdata wrapper so simple lua equality checks don't work the way you expect. And I don't think I got the __eq metamethod working due to the peculiar way it was implemented in the specific bridge implementation. (As I said, my changes picked the path of least resistance.) But now you got me thinking that I may want to expand on this idea for dealing with memory management. -Eric From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 23:10:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n972AnJr028349; Tue, 6 Oct 2009 23:10:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEE1E191C8; Tue, 6 Oct 2009 23:09:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f177.google.com (mail-pz0-f177.google.com [209.85.222.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D425E19144 for ; Tue, 6 Oct 2009 23:09:39 -0300 (BRT) Received: by pzk7 with SMTP id 7so4419353pzk.33 for ; Tue, 06 Oct 2009 19:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Vmme78za5sURYAdKReBV0IvSM43ZT3JJZkBtlJWIZyI=; b=fVv5O7UBjaZwvPZEd5zQh/RbV3vUebU0zvKGH2m+xUHkKJapg5FIwy0sNh2vm4TrCz XJ+JdrUDo/cChSHQ1pTjx7L0nlagxjaQtjyZeAW3OCc6dUEo76IczQsfg8x+RMJbWhUM YNyyjKFYu+0pQ8MXiatiKjKWo2LufxqwKfxTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ESEI+wFRQtDgkmt6++mU1noE+d1HAAtEqjx/VRQkgGGcrjCcyDnpYqzmHPbzmz5o13 Sleyr5QQxigh737Dlv+7r4HkMG6RklrWErS+xIgLCYVZcRAhecuOLQpOsDD/1DkddhB+ zlJCHCbMnT6GnkwLF8dJ3e4dbD37VwTs0Bjuc= MIME-Version: 1.0 Received: by 10.143.131.6 with SMTP id i6mr155738wfn.338.1254881418010; Tue, 06 Oct 2009 19:10:18 -0700 (PDT) In-Reply-To: <4ACB5A39.2020107@cowlark.com> References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> <4ACB5A39.2020107@cowlark.com> Date: Tue, 6 Oct 2009 19:10:17 -0700 Message-ID: <3c7e3c8a0910061910p7d2f6484pbbbeeeb992fa9a70@mail.gmail.com> Subject: Re: [ANNOUNCE] Objective Lua From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/6/09, David Given wrote: > E. Wing wrote: > [...] >> Meanwhile, I patched the existing legacy bridge to be garbage >> collection aware and fixed up some major memory leaks. I also have >> been working with pieces from Gus Mueller's LuaCore and added some >> hand-crafted bindings for the C-parts of Core Animation, though this >> is all intended as a temporary layer on the bridge. The next-gen >> bridge at least on Mac should be using Bridge Support (like MacRuby >> and PyObjC). > > How much of this is OSX-specific? Will it work with GNUstep, for example > (since I don't have a Mac handy...) > The actual LuaObjCBridge at one point had #defines for both GNUStep and OS X. However, I don't think the GNUStep side was tested well. And since then, in order to squash serious bugs (like the ones in my last post), I crossed the #define barriers in several occasions and may have broke things. (The CFRetains and CFReleases would be one of those places.) LuaCore is more OS X specific as it provides mostly manual bindings for C functions and structs. The ones like NSRect/NSPoint/NSSize might be salvageable though I may have been too clever and may have tried to do some toll-free like bridging with CGRect/CGPoint/CGSize which would need to be removed. You would also need to remove bindings for things like Core Graphics and Core Animation. But LuaCore is not required to use LuaObjCBridge. > Also, how much introspection can you do on a bridged object? Do you see > them simply as opaque Lua objects with method calls peered over to > Objective C, or does the full Objective C class hierarchy appear in Lua, > which you can then add classes to, etc? I think they are opaque. This is more of an implementation detail more than anything else. The original bridge used actual tables and user lightdata for objects instead of full user data. When I switched things over, it really became a hybrid of things so it was hard to peer into anything. My intent would be to completely fix this in the next-gen bridge. >> We still lack a good object model. From the one minute I've seen of >> Objective Lua, it is very compelling. Is the translation done all >> through Lua (no C)? If so, this reminds me a lot of Objective-J and >> what the 280 North folks did to Javascript for their web based >> application framework called Cappuccino. > > About a minute is all it's worth; right now the Objective Lua 'compiler' > is an almost trivial syntax hack. The object model is a traditional > metatable-based Lua OO system. The only thing slightly interesting about > it is that it supports class methods. In fact, it's currently all wrong, > and I need to rewrite it. I think I've got a fairly simple design that > can support categories. Simple (and elegant) is great. That's what Lua is about, right? I'm probably the wrong person to be maintaining the bridge, so simple is perfect for me :) > I didn't know about Objective J; it's rather interesting, and very much > the same sort of thing. In fact, I might steal some of their syntax. > > There's been a surprising amount of interest. (The reddit link didn't > help...) In the past 24 hours that one page alone has had 3300 hits. I > usually get about 2000 hits a month *on my entire website*! Admittedly, > only 36 actual code downloads, but it's certainly striking a chord with > people. Maybe it *would* be worth doing properly... I've attended a couple talks given by the folks from 280 North (who did Objective-J) since they are local to me. It's very interesting stuff and it's interesting to hear the feedback they hear from Javascript users. I think your Objective Lua idea is terrific. And borrowing ideas from Obj-J would be smart since they've already been down this road. I would really like to see Objective Lua adopted into a Lua/Obj-C bridge (assuming that it is a pure superset of Lua is you can still use normal Lua syntax with it). -Eric From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 23:13:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n972DQ8c028627; Tue, 6 Oct 2009 23:13:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F43C191EF; Tue, 6 Oct 2009 23:12:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 909F319144 for ; Tue, 6 Oct 2009 23:12:22 -0300 (BRT) Received: by pxi2 with SMTP id 2so599493pxi.11 for ; Tue, 06 Oct 2009 19:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5f5A54nh2N/ukHUjJCSQw8L8SNtoSd2XR+bx1ZcY2pw=; b=vfwIaqFJEKSDeTD559gXCpPIO9GlQxCfRG4dbXNvsUeP2bMcGmL5B+fH3Fa73N1Jo3 TEokzCCDzyp/gNm/J7gM3g4pyAX6gC27LQiA7TecMI+5UUU/v8YWFLS0Le9G5tcAbHRL apw5QykSdkKv7RALprC8SaTgExuh6hk/sE+YQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=p+inlh378SmDEpeT2ps0/pxQjvH5Y4gnLCYfglaOiFmUB5T95/VXL899Jzq0fUsuDq VxaDzOT0BOJWIjymGr5ZRsogDJWtVte4JM8mbSDR3eVigAQv3Q8RLmbI9VpFrMA7KjPA 9uyPXOb7tu1yX7ZXHOWjvENwOnpJ5IzSFMkGU= MIME-Version: 1.0 Received: by 10.142.59.18 with SMTP id h18mr169569wfa.121.1254881579135; Tue, 06 Oct 2009 19:12:59 -0700 (PDT) In-Reply-To: <200910012006.54022.bobby@sharedrealm.com> References: <200910012006.54022.bobby@sharedrealm.com> Date: Tue, 6 Oct 2009 19:12:59 -0700 Message-ID: <3c7e3c8a0910061912l18a70db7w6afa2eea5164a670@mail.gmail.com> Subject: Re: CMake build files for Lua 5.1.x From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/1/09, Robert G. Jakabosky wrote: > > Attached is a patch to add CMake build files to Lua 5.1. I have only tested > them on Linux, but they should work for atleast Macs & Windows systems. > Also > some of the LUA_USE_* CMake options don't do anything right now, but they > can > still be changed in src/luaconf.h > > The patch doesn't change any of the existing files in Lua, it only adds > about > 3 files. The old Makefiles will still be there. > > If you use CMake in the same folder as the source, then it will overwrite > some > of the old Makefiles. > > I would recommend this usage (for Linux type systems): > cd lua-5.1.4/ > patch -p1 mkdir build > cd build > cmake .. > make > make install > > -- Hi Robert, I've also have a CMake build system for Lua. Would you take a look at it and maybe incorporate some of the ideas with yours? Mine covers a lot of Mac-isms (like OS X style frameworks and Universal Binaries) which generally people don't remember to put into their build systems. http://www.assembla.com/wiki/show/lua Thanks, Eric From lua-bounces@bazar2.conectiva.com.br Tue Oct 6 23:37:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n972bthg031220; Tue, 6 Oct 2009 23:37:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A12D192A9; Tue, 6 Oct 2009 23:36:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f185.google.com (mail-vw0-f185.google.com [209.85.212.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B56C619290 for ; Tue, 6 Oct 2009 23:36:47 -0300 (BRT) Received: by vws15 with SMTP id 15so2433753vws.5 for ; Tue, 06 Oct 2009 19:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jOdQoYEoP1PG3jtPSbrrpHSUKf63Sg38RbabvCev+tw=; b=VGqS87qeN8X5R63l0MXIFLc2eBPqjz0GFfshBkOg4+pzlzeulAHweTMIF7Ctrr9SeD dJkGTanuQ5xb/KUXeEvU1M0LI/Dj9CUOe+BfBWHeokLSt+nQ67eR+znDd5V4AP/IK5Ag eWtnyMQwBv/SqXwwiWRT+Q++V5i9jav6tKzpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=oM8LOKF9/BadnLg1d5MtCHEsr/mpFwTKk2N2dNTSKyMbH0X8I8QbN+3IHtw4jQtAEL fS9PenEeHDFKJZpH8EGkjkjSZW3tByMDFpCtRsG/ipyS9bOi1rV74IzfJ8wcbZ87KfRy N8OMEc96NYJEPGVYjsomLsAmdyxX+jP7wlgfY= MIME-Version: 1.0 Received: by 10.220.107.226 with SMTP id c34mr3564421vcp.69.1254883045244; Tue, 06 Oct 2009 19:37:25 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Oct 2009 23:37:25 -0300 X-Google-Sender-Auth: 01207efb572bd2ae Message-ID: <92ab989c0910061937x40675a42t441e3093ca565844@mail.gmail.com> Subject: Re: LuaForge down. Again. From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n972bthg031220 On Tue, Oct 6, 2009 at 9:39 PM, Stuart P.Bentley wrote: > LuaForge Could Not Connect To Database: Apparently a power problem impacted the server behavior. Unfortunately we will have to wait until tomorrow to check the damage. Meanwhile LuaForge services will be out of reach. Sorry for the inconvenience. André From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 00:56:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n973usdL006530; Wed, 7 Oct 2009 00:56:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7BA81A6E7; Wed, 7 Oct 2009 00:55:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15FFE1A65A for ; Wed, 7 Oct 2009 00:55:38 -0300 (BRT) Received: by iwn8 with SMTP id 8so2652500iwn.33 for ; Tue, 06 Oct 2009 20:56:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.120.90 with SMTP id c26mr4461948ibr.1.1254887776633; Tue, 06 Oct 2009 20:56:16 -0700 (PDT) In-Reply-To: <4ff79edb0910040712q6e9ccbdfx8ddbca5a40e459ba@mail.gmail.com> References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> <20091003183844.A32021@lua.tecgraf.puc-rio.br> <4ff79edb0910040712q6e9ccbdfx8ddbca5a40e459ba@mail.gmail.com> Date: Tue, 6 Oct 2009 23:56:16 -0400 X-Google-Sender-Auth: 8fa4b20feee1b1b4 Message-ID: Subject: Re: GSL Shell software announcement From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n973usdL006530 On Sun, Oct 4, 2009 at 10:12 AM, Francesco Abbate wrote: > I've done like you suggested, now the Lua file 'lmathlib.c' is unchanged. > I've changed only my top-level file, gsl-shell.c in order to charge the math > library as you suggested, thank you very much. > So, now GSL shell just use a vanilla copy of Lua 5.1.4 with LNUM patch, I > don't know if this help in order to put it LuaDist. For me there are two > possible utilisation of GSL shell: > - as a stand-alone program => in this case a top-level program charges all > the needed >   library. In this case we can collapse the math and gsl functions in the > common namespace > - as a normal lua library => in this case a separate namespace is used for > gsl and math >    functions. I've already integrated this possibility in the software with > the FLAG >    USE_SEPARATE_NAMESPACE in defs.h > For me it would be nice if GSL Shell can be made available as a library to > Lua users even in my main goal in the stand-alone program. > Francesco Thanks. Here's some more comments: - gslshell builds from LuaDist now [1], as least under Linux and MinGW: "luadist ~/gsl install gslshell". This in turn builds the dependencies gsl and lualnum. (Side-note: It's better to install into some alternate location, e.g. "~/gsl" as above, since gslshell installs lualnum, which would otherwise overwrite the standard version of lua that LuaDist is running under.) - gslshell doesn't currently build under MSVC, Cygwin, and maybe others due gslshell's dependency on complex.h. If you allow that dependency to be selectively disabled, we can make it work on these platforms too. A lot of applications under standard Lua that might want to use gslshell as a library don't require complex numbers. - The gsl-shell application currently statically links to the gsl-shell module code instead of dynamically linking to the gsl-shell module. This is made necessary because the gsl-shell module defines USE_SEPARATE_NAMESPACE, while the gsl-shell application expects this to be undefined. I think the better way to do this is to always enable USE_SEPARATE_NAMESPACE. Then in gsl-shell call some function that moves or copies the members of the "gsl" and "math" tables into the global table as a convenience. In gsl-shell, I see no reason not to have both math.sqrt and sqrt defined and both cnew and gsl.cnew defined. This would allow a user to run standard Lua code inside gsl-shell. - The gsl Lua module is named lua-gsl.so. This implies that the Lua gsl module is loaded by require "lua-gsl", which in turn creates the table "gsl". It would be more consistent to name this gsl.so so that the user can do require "gsl". (This gsl.so is not to be confused with libgsl.so, which is GSL itself.) - I think reStructuredText/Sphinx is solid stuff and would recommend other Lua module authors consider using it, despite perhaps (like me) an initial hesitation with the superficial ".. :: _" syntax. [1] http://lua-users.org/wiki/LuaDist From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 03:15:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n976FKl4018913; Wed, 7 Oct 2009 03:15:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85D8A1A6EF; Wed, 7 Oct 2009 03:14:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBCA41A666 for ; Wed, 7 Oct 2009 03:14:08 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 38D42170C577 for ; Wed, 7 Oct 2009 02:14:47 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n976EjWD015454 for lua@bazar2.conectiva.com.br; Wed, 7 Oct 2009 02:14:46 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 7 Oct 2009 02:14:45 -0400 From: Sean Conner To: lua@bazar2.conectiva.com.br Subject: LUA missing lua_pushuserdata()? Message-ID: <20091007061445.GA5450@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm currently working on a proof-of-concept and I've come across a rather odd ommision in the Lua API: there exists no lua_pushuserdata(). I've created the structure using lua_newuserdata() and it exists on the Lua stack at that point, but there seems to be no way, short of storing it in some table, to *get* that structure back on the Lua stack (I'm trying to resume a coroutine which takes as a parameter, the userdata I've constructed). I'd rather not have to go through blob = lua_newuserdata(...); lua_setglobal(L,"dummy"); ... lua_getglobal(L,"dummy"); since the project is creating multiple Lua threads (and keeping track of all the blobs I'm creating through Lua would complicate things, as I'm already keeping track of all the blobs via the C code). I can easily add the lua_pushuserdata() function myself, but I just find it odd that it's missing from the published API. -spc (Oversight maybe?) From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 03:23:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n976NVo6019601; Wed, 7 Oct 2009 03:23:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D24E1A701; Wed, 7 Oct 2009 03:22:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 316EE1A666 for ; Wed, 7 Oct 2009 03:22:24 -0300 (BRT) Received: by bwz22 with SMTP id 22so4059865bwz.5 for ; Tue, 06 Oct 2009 23:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rERHIg2vPJgyL4lW3Id3gkNXf1Jo8Qa1OKOTgWh/ghc=; b=LVLQXhE3AnXKx3fspWXrodLt4lMGbDnoF4LnvPA5oHx5Tly1LwiMsCDAKr/sUFJeyN 6imsQX2Lpv08u8PrHGtQJRVac8kU/kzHhKRINHDwrGZTHwT4Oz9FrvhHh+RiGdUYPKt7 BsiuWpRMcHz0O/9VA4kj/DC60PhFaqmfgxp6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jwLFvnscPlJrNXIb21WUmDa3aBjSpbfd5w+XtFjFg1sPLJmiGZNjkALzsOCWr/xT9t qmVVP0IHZZGU40MHDUppWCzh2wx/10l7IIZBXpwE0oaZRCeeHCBs2Re/0Vvt4HvUZzwR FME5y10ATmSzuOhprA8jP5i2MyhegAoKVNbbE= MIME-Version: 1.0 Received: by 10.239.134.226 with SMTP id a34mr217892hba.7.1254896581988; Tue, 06 Oct 2009 23:23:01 -0700 (PDT) In-Reply-To: <20091007061445.GA5450@brevard.conman.org> References: <20091007061445.GA5450@brevard.conman.org> Date: Wed, 7 Oct 2009 08:23:01 +0200 Message-ID: <560972290910062323s32745321s89d603f910ada991@mail.gmail.com> Subject: Re: LUA missing lua_pushuserdata()? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n976NVo6019601 On Wed, Oct 7, 2009 at 8:14 AM, Sean Conner wrote: >  I can easily add the lua_pushuserdata() function myself, but I just find > it odd that it's missing from the published API. The solution of choice would be to save the userdata in the registry (similar to saving functions and tables) and keep the reference. Much better than an actual global, as you observe. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 03:31:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n976Va9R020448; Wed, 7 Oct 2009 03:31:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F4591A705; Wed, 7 Oct 2009 03:30:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E993A1A666 for ; Wed, 7 Oct 2009 03:30:30 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id F36FFE0EB6 for ; Wed, 7 Oct 2009 09:31:05 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: LUA missing lua_pushuserdata()? References: <20091007061445.GA5450@brevard.conman.org> Date: Wed, 07 Oct 2009 09:31:07 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091007061445.GA5450@brevard.conman.org> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 07 Oct 2009 09:14:45 +0300, Sean Conner wrote: > I can easily add the lua_pushuserdata() function myself I'd like to see that, honestly. How will you check that your userdata has not been garbage collected yet? From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 03:37:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n976bgSo020922; Wed, 7 Oct 2009 03:37:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26E931A708; Wed, 7 Oct 2009 03:36:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F20AA1A666 for ; Wed, 7 Oct 2009 03:36:39 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 042D6170C577 for ; Wed, 7 Oct 2009 02:37:19 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n976bInq019731 for lua@bazar2.conectiva.com.br; Wed, 7 Oct 2009 02:37:18 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 7 Oct 2009 02:37:18 -0400 From: Sean Conner To: Lua list Subject: Re: LUA missing lua_pushuserdata()? Message-ID: <20091007063718.GD5450@brevard.conman.org> References: <20091007061445.GA5450@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Juris Kalnins once stated: > On Wed, 07 Oct 2009 09:14:45 +0300, Sean Conner wrote: > > I can easily add the lua_pushuserdata() function myself > > I'd like to see that, honestly. > How will you check that your userdata has not been garbage collected yet? I didn't think of that (which may explain why lua_pushuserdata() doesn't exist). But in the usage pattern I have going, the userdata is created, passed to the coroutine for processing, and once the coroutine is done, I'm done with the userdata. The reason I'm using the userdata and not a lightuserdata is the former I can attach a metatable to, which would simplify the Lua code a bit. -spc From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 03:48:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n976m4mv021877; Wed, 7 Oct 2009 03:48:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 023CE1A70C; Wed, 7 Oct 2009 03:47:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F27A8183A2 for ; Wed, 7 Oct 2009 03:46:55 -0300 (BRT) Received: from juris-desktop (unknown [10.0.0.70]) by bute.mt.lv (Postfix) with ESMTP id E2310E0E62 for ; Wed, 7 Oct 2009 09:47:32 +0300 (EEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: LUA missing lua_pushuserdata()? References: <20091007061445.GA5450@brevard.conman.org> <20091007063718.GD5450@brevard.conman.org> Date: Wed, 07 Oct 2009 09:47:34 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091007063718.GD5450@brevard.conman.org> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 07 Oct 2009 09:37:18 +0300, Sean Conner wrote: > The reason I'm using the userdata and not a lightuserdata is the > former I > can attach a metatable to, which would simplify the Lua code a bit. you _can_ set global metatable for all lightuserdata. and use some logic in C code to detect what kind of data pointer points to, and call appropriate functions depending on that. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 04:31:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n977VcQu027117; Wed, 7 Oct 2009 04:31:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 638FA1A711; Wed, 7 Oct 2009 04:30:29 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A53A1A666 for ; Wed, 7 Oct 2009 04:30:20 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 8F157170C577 for ; Wed, 7 Oct 2009 03:30:58 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n977Uvit030472 for lua@bazar2.conectiva.com.br; Wed, 7 Oct 2009 03:30:57 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 7 Oct 2009 03:30:57 -0400 From: Sean Conner To: Lua list Subject: Re: LUA missing lua_pushuserdata()? Message-ID: <20091007073057.GE5450@brevard.conman.org> References: <20091007061445.GA5450@brevard.conman.org> <20091007063718.GD5450@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Juris Kalnins once stated: > On Wed, 07 Oct 2009 09:37:18 +0300, Sean Conner wrote: > > The reason I'm using the userdata and not a lightuserdata is the > >former I > >can attach a metatable to, which would simplify the Lua code a bit. > > you _can_ set global metatable for all lightuserdata. and use > some logic in C code to detect what kind of data pointer points to, and > call appropriate functions depending on that. Maybe an explanation of what I'm doing is in order. I have a Unix daemon that listens in on a TCP port, accepts connections, and processes requests. The main logic is already there, in C, in a large epoll() driven loop. In fact, here's the main loop: static void mainloop(void) { struct epoll_event *list; int events; int i; PollNode node; list = malloc(sizeof(struct epoll_event) * c_pollqueue); while(1) { check_signals(); events = epoll_wait(g_queue,list,c_pollqueue,60); if (events == -1) continue; for (i = 0 ; i < events ; i++) { node = list[i].data.ptr; (*node->fn)(&list[i]); } } } What (*node->fn)() does depends upon the type of node---for listening sockets, it does an accept(), set the connection socket to nonblocking, create a socket node (derived off of PollNode, and yes, this is straight C here) and adds the connection socket to the epoll queue looking for read, write or disconnect, edge triggered events. (*node->fn)() for connection sockets will either read the data, or write the data, depending upon the event (read, write, or disconnect). This exists and it works. Only I'd like to handle input and output via Lua (like I said, it's a proof-of-concept). And to make it easy, I'd like the Lua code to look something like: function main(socket) while true do local x = socket:read("*l") if x == "SHOW" then io.stdout:write(string.format("SHOW ME THE TABLE!\n")) table.show(socket,_G) elseif x == "QUIT" then io.stdout:write(string.format("Quitting the thread\n")) thread.exit(0) elseif x == nil then io.stdout:write(string.format("Quitting the thread because no input\n")) thread.exit(0) else io.stdout:write(string.format("%s\n",x)) socket:write(x) socket:write("\n") end end end socket is the userdata I'm trying to pass around (and this may be a hack, but this is exploratory for me) and the functions socket:read(), socket:write and thread:exit() are all functions that yield (and are written in C). I'm not using the built-in io routines to handle the sockets because, well, I want to run one Lua thread per connection, and at any point where the lua thread could block is where I want to switch threads. Another thing to keep in mind---the C code wants to push data, the Lua code wants to pull data and that's where the disconnect is happening. There may very well be a better way of dealing with this, but like I said, this is my way to learn the Lua internals. -spc (Although I may have bitten off more than I should have ... ) From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 04:35:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n977ZXVq027426; Wed, 7 Oct 2009 04:35:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56A631A715; Wed, 7 Oct 2009 04:34:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 105881A666 for ; Wed, 7 Oct 2009 04:34:25 -0300 (BRT) Received: by ywh15 with SMTP id 15so4383223ywh.5 for ; Wed, 07 Oct 2009 00:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=cyaF480VIDpZFNQ6Bc6GPnVR8jLPX5rtvOcRB7w6UZI=; b=HxON2MVPi0AJTcBoWRMhdsWW8stVBKyBsUQByJqcgZu4l5jxA7zbqjbGVCpEc0gfr/ H/QU5SD17jBsJOWmPvSWyBMg/nyLSguxevbQemeyIpTQsV767REapOqOfy9NqVQejXqy gfAXd21HwAaYAaKxrEIg6+HEqxqAHFgZ+oG7Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mmy2qYQhfQLArbwMguxwfAhVNdQPVNwrcOV4UoHSbih/l5yO5cX6NGkqHo3tnPf9Cf Ai2tIvFX7i2Ct0RGCYlFNs18HJmA7IooqFPxV7SYNbI0l+HH94alQKMKb8qgXHg7f1j7 xNyHrjTdcRKFdLc4qdSFhSnSrJN7JJBk4CDv0= MIME-Version: 1.0 Received: by 10.150.118.36 with SMTP id q36mr4083412ybc.277.1254900904406; Wed, 07 Oct 2009 00:35:04 -0700 (PDT) In-Reply-To: <20091007073057.GE5450@brevard.conman.org> References: <20091007061445.GA5450@brevard.conman.org> <20091007063718.GD5450@brevard.conman.org> <20091007073057.GE5450@brevard.conman.org> Date: Wed, 7 Oct 2009 00:35:04 -0700 Message-ID: <1079b050910070035r38ecee85v88756140d58f53ad@mail.gmail.com> Subject: Re: LUA missing lua_pushuserdata()? From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Use coroutines for this. It's a much better model for handling event driven scripting situations where you need to maintain state and calculations between events. wes From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 05:02:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9782aIn029703; Wed, 7 Oct 2009 05:02:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F7311A717; Wed, 7 Oct 2009 05:01:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35FEA1A709 for ; Wed, 7 Oct 2009 05:01:18 -0300 (BRT) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 0F2EE170C577 for ; Wed, 7 Oct 2009 04:01:57 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9781tG5007186 for lua@bazar2.conectiva.com.br; Wed, 7 Oct 2009 04:01:55 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 7 Oct 2009 04:01:55 -0400 From: Sean Conner To: Lua list Subject: Re: LUA missing lua_pushuserdata()? Message-ID: <20091007080155.GA4002@brevard.conman.org> References: <20091007061445.GA5450@brevard.conman.org> <20091007063718.GD5450@brevard.conman.org> <20091007073057.GE5450@brevard.conman.org> <1079b050910070035r38ecee85v88756140d58f53ad@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1079b050910070035r38ecee85v88756140d58f53ad@mail.gmail.com> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Wesley Smith once stated: > Use coroutines for this. It's a much better model for handling event > driven scripting situations where you need to maintain state and > calculations between events. That's what I'm trying to use. Sorry if I didn't make that clear. The logic so far (which I haven't tested yet) is: C code Lua code accept() lua_resume() blah blah blah socket:read() (which calls coroutine.yield()) epoll_add(socket) ev = epoll_wait() if (ev.read) collect data if (enough data) lua_resume() blah blah socket:write() (coroutine.yield()) ev = epoll_wait() if (can-write-data) { write data if no more data lua_resume() } ... thread.exit() (coroutine.yield()) epoll_remove(socket) close(socket) free(luathread) -spc (Hope that makes some sense ... ) From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 05:03:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9783UV6029806; Wed, 7 Oct 2009 05:03:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AF541A71A; Wed, 7 Oct 2009 05:02:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5149F1A709 for ; Wed, 7 Oct 2009 05:02:14 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id B059F839BF for ; Wed, 7 Oct 2009 04:02:52 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 Oct 2009 04:02:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:content-type:content-transfer-encoding:subject:date:message-id:to:mime-version; s=smtpout; bh=qOigL/FC+tAhXSI+Vpg/4rKe2fs=; b=DSgeNUmfKI1IXwEZKRygHmo2OIK/88LF07lwBa8Eoh55+BqfT6UMADQOE+tjkrUlDgqramMUo7jiLPxw6E+LSAaS9NFHZIIedy04CWiMWcWJUugFhlc8nLFg+/kLSB+Hpf1tvCWJZUgtRK0UOZY9dkaizVeCo+MTBmzh/OxVmxI= X-Sasl-enc: by9MgGjW17R643/iewLmSJ0dwFD5WNShnz5c62AXVrbp 1254902572 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id EADB747E7 for ; Wed, 7 Oct 2009 04:02:51 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Return an exit code without os.exit()? Date: Wed, 7 Oct 2009 21:02:17 +1300 Message-Id: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Is there a way to return an exit code from a Lua script without calling os.exit()? I'm using luacov, and if you call os.exit(), it doesn't write any statistics. I'd also like my script to return 1 or 0. As far as I can tell, the return value from a top-level script does not seem to be used for an exit code, but hopefully someone can tell me I'm wrong. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 05:19:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n978JPxN031090; Wed, 7 Oct 2009 05:19:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB7B21A720; Wed, 7 Oct 2009 05:18:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 584101A71C for ; Wed, 7 Oct 2009 05:18:19 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgABABLsy0rLzmfn/2dsb2JhbAAI1DaEKgSCLA X-IronPort-AV: E=Sophos;i="4.44,518,1249228800"; d="scan'208";a="510046573" Received: from unknown (HELO [10.1.1.2]) ([203.206.103.231]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 07 Oct 2009 16:18:55 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: [ANNOUNCE] Objective Lua From: Jacques Chester In-Reply-To: <4ACB5A39.2020107@cowlark.com> Date: Wed, 7 Oct 2009 16:18:55 +0800 Content-Transfer-Encoding: 7bit Message-Id: <7AC770F4-E3E9-431F-B7BD-FB1C493C0054@chester.id.au> References: <4ACA0A1C.80805@cowlark.com> <1847978A-E74D-4A61-B572-65D64FA5E1E8@chester.id.au> <4ACA8FB0.7040907@cowlark.com> <3c7e3c8a0910051815p7fd88f5ar94463e85be90f00f@mail.gmail.com> <4ACB5A39.2020107@cowlark.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 06/10/2009, at 10:54 PM, David Given wrote: > > There's been a surprising amount of interest. (The reddit link > didn't help...) In the past 24 hours that one page alone has had > 3300 hits. I usually get about 2000 hits a month *on my entire > website*! Admittedly, only 36 actual code downloads, but it's > certainly striking a chord with people. Maybe it *would* be worth > doing properly... Redditors love clever little hacks like yours. It makes a nice break from "OMG TDD Suxors!" "Nuh uh, it roxors!" Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 06:25:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n979PAuQ004586; Wed, 7 Oct 2009 06:25:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04B711A709; Wed, 7 Oct 2009 06:24:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F76B1859E for ; Wed, 7 Oct 2009 06:23:58 -0300 (BRT) Received: by ewy11 with SMTP id 11so4572227ewy.35 for ; Wed, 07 Oct 2009 02:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=3tEsnvrn7qTB9/FwSASEJJ9gSexXoN/gD37XtM+febs=; b=HxomQ8aSG1o199AxlanjuE6hmW+Lh+7xzLItzYCdJfKbgyPxMIaFcx1bzKltcTAhIQ A0kLQzH8a1WyJT0qjetXn9jrxgUfZoSMJP/gcE1Gnw9qGE0UgCX/5dgXp4SZDsO0QjW7 eYC/PD9IQNcLvRWzq9cmvexkQaUl0SWapwwwc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=AlU1Kj+q1k+lXEiQ6H/N8xB2UHg4zRkkp6HGIUD9H5fqy3E+ahxjCBlnkpCujinCiA /27R9p7JfANyDG9hHJto8778rfU9rEjb2i7R1vSWQlO6UHehU5K7j/GwuRaEwUvCkm4b Mz25fjwcj1ngeex4/HwsQTRxcKvdb67ITrPVE= MIME-Version: 1.0 Received: by 10.216.85.130 with SMTP id u2mr15926wee.135.1254907477110; Wed, 07 Oct 2009 02:24:37 -0700 (PDT) In-Reply-To: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> From: Jerome Vuarand Date: Wed, 7 Oct 2009 11:24:17 +0200 Message-ID: <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> Subject: Re: Return an exit code without os.exit()? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/7 Geoff Leyland : > Is there a way to return an exit code from a Lua script without calling > os.exit()? > > I'm using luacov, and if you call os.exit(), it doesn't write any > statistics. I'd also like my script to return 1 or 0. As far as I can > tell, the return value from a top-level script does not seem to be used for > an exit code, but hopefully someone can tell me I'm wrong. Looking at the code in lua.c, it seems the return value of the script is ignored. It should be easy to patch if a custom Lua executable is an option to you. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:03:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97A33c1007923; Wed, 7 Oct 2009 07:03:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B5C718A5B; Wed, 7 Oct 2009 07:02:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57B24189D4 for ; Wed, 7 Oct 2009 07:01:44 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 0FAB989820 for ; Wed, 7 Oct 2009 06:02:23 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 07 Oct 2009 06:02:23 -0400 X-Sasl-enc: HarKJP5EeGRgdfP/0TzvLQSLhMhPkjMww7Nk/95V19rY 1254909742 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id 516154841 for ; Wed, 7 Oct 2009 06:02:21 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> Date: Wed, 7 Oct 2009 23:01:47 +1300 Content-Transfer-Encoding: 7bit Message-Id: <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: > 2009/10/7 Geoff Leyland : >> Is there a way to return an exit code from a Lua script without >> calling >> os.exit()? >> >> I'm using luacov, and if you call os.exit(), it doesn't write any >> statistics. I'd also like my script to return 1 or 0. As far as I >> can >> tell, the return value from a top-level script does not seem to be >> used for >> an exit code, but hopefully someone can tell me I'm wrong. > > Looking at the code in lua.c, it seems the return value of the script > is ignored. It should be easy to patch if a custom Lua executable is > an option to you. Thanks, I thought someone might say that. Shame really, it'd be a nice feature to have in standard Lua (mind you this is the first time it's come up in a good few years of using Lua) Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:08:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97A8VlZ008373; Wed, 7 Oct 2009 07:08:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17E901A65C; Wed, 7 Oct 2009 07:07:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BE6B18A02 for ; Wed, 7 Oct 2009 07:07:28 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MvTRG-0000cc-Po for lua@bazar2.conectiva.com.br; Wed, 07 Oct 2009 03:08:06 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: Return an exit code without os.exit()? Date: Wed, 7 Oct 2009 03:08:05 -0700 User-Agent: KMail/1.9.10 References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> In-Reply-To: <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910070308.05491.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wednesday 07, Geoff Leyland wrote: > On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: > > 2009/10/7 Geoff Leyland : > >> Is there a way to return an exit code from a Lua script without > >> calling > >> os.exit()? > >> > >> I'm using luacov, and if you call os.exit(), it doesn't write any > >> statistics. I'd also like my script to return 1 or 0. As far as I > >> can > >> tell, the return value from a top-level script does not seem to be > >> used for > >> an exit code, but hopefully someone can tell me I'm wrong. > > > > Looking at the code in lua.c, it seems the return value of the script > > is ignored. It should be easy to patch if a custom Lua executable is > > an option to you. > > Thanks, I thought someone might say that. Shame really, it'd be a > nice feature to have in standard Lua (mind you this is the first time > it's come up in a good few years of using Lua) luacov should wrap os.exit() and dump that stats before calling the normal os.exit(). I don't know much about how luacov is implemented, but if they have a function that can be called from Lua to dump the stats, then you can write a custom os.exit() wrapper: local exit=os.exit os.exit = function(...) luacov.dumpstats() -- I don't know if a funciton like this exists. exit(...) end -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:14:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97AE9Ui008780; Wed, 7 Oct 2009 07:14:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B3F51A713; Wed, 7 Oct 2009 07:12:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16AAF18C55 for ; Wed, 7 Oct 2009 07:12:39 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MvTWH-0000dN-Na for lua@bazar2.conectiva.com.br; Wed, 07 Oct 2009 03:13:18 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: CMake build files for Lua 5.1.x Date: Wed, 7 Oct 2009 03:13:16 -0700 User-Agent: KMail/1.9.10 References: <200910012006.54022.bobby@sharedrealm.com> <3c7e3c8a0910061912l18a70db7w6afa2eea5164a670@mail.gmail.com> In-Reply-To: <3c7e3c8a0910061912l18a70db7w6afa2eea5164a670@mail.gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_8mGzKhrEdYFQLJn" Message-Id: <200910070313.16879.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_8mGzKhrEdYFQLJn Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 06, E. Wing wrote: > On 10/1/09, Robert G. Jakabosky wrote: > > Attached is a patch to add CMake build files to Lua 5.1. I have only > > tested them on Linux, but they should work for atleast Macs & Windows > > systems. Also > > some of the LUA_USE_* CMake options don't do anything right now, but they > > can > > still be changed in src/luaconf.h > > > > The patch doesn't change any of the existing files in Lua, it only adds > > about > > 3 files. The old Makefiles will still be there. > > > > If you use CMake in the same folder as the source, then it will overwrite > > some > > of the old Makefiles. > > > > I would recommend this usage (for Linux type systems): > > cd lua-5.1.4/ > > patch -p1 > mkdir build > > cd build > > cmake .. > > make > > make install > > > > -- > > Hi Robert, > I've also have a CMake build system for Lua. Would you take a look at > it and maybe incorporate some of the ideas with yours? Mine covers a > lot of Mac-isms (like OS X style frameworks and Universal Binaries) > which generally people don't remember to put into their build systems. > > http://www.assembla.com/wiki/show/lua I have merged the OS X frameworks code from your CMakeLists.txt file. Please test it and report any problem or send patches. -- Robert G. Jakabosky --Boundary-00=_8mGzKhrEdYFQLJn Content-Type: text/x-diff; charset="iso 8859-15"; name="lua_CMake3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="lua_CMake3.patch" diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..616a562 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,229 @@ +# +# Lua 5.1.x +# +cmake_minimum_required(VERSION 2.4 FATAL_ERROR) + +project(lua C) + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +include(CustomMacros) +include(CMakeDependentOption) + +enable_testing() + +# +# Lua version +# +set(LUA_VERSION_MAJOR 5) +set(LUA_VERSION_MINOR 1) +set(LUA_VERSION_PATCH 4) +set(LUA_VERSION + "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") +set(LUA_SOVERSION + "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") +# +# Lua package info. +# +set(CPACK_PACKAGE_VERSION_MAJOR ${LUA_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LUA_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${LUA_VERSION_PATCH}) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYRIGHT") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") +set(CPACK_PACKAGE_VENDOR "Lua.org, PUC-Rio.") +set(CPACK_SOURCE_GENERATOR "TGZ") +set(CPACK_SOURCE_IGNORE_FILES +"/\\\\.;/\\\\.git.*/;~$;build/;CMakeFiles/;CMakeCache;Testing/;cmake_install;CPack;Dart;Makefile$") +set(CPACK_SOURCE_PACKAGE_FILE_NAME + "${CMAKE_PROJECT_NAME}-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") +# MUST be after CPACK_* variables. +include(CPack) + +set(COMMON_CFLAGS) +set(COMMON_LDFLAGS) +set(LIBS) +# +# Detect system type +# +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(DEFAULT_POSIX TRUE) + set(DEFAULT_DLOPEN ON) + set(DEFAULT_READLINE ON) + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -Wl,-E") + set(USE_RPATH TRUE) +elseif(APPLE) + set(DEFAULT_POSIX TRUE) + set(DEFAULT_DLOPEN ON) + # use this on Mac OS X 10.3- + option(LUA_USE_MACOSX "Mac OS X 10.3-" OFF) + set(OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX") + CMAKE_DEPENDENT_OPTION(WANT_FRAMEWORK + "Set to ON to build framework instead of dylib." ON + "WANT_SHARED_LIBRARY" ON + ) + CMAKE_DEPENDENT_OPTION(LUA_FRAMEWORK_SYMLINKS + "Set to ON to create symlinks to lua & luac to CMAKE_PREFIX_PATH/bin." ON + "WANT_FRAMEWORK;WANT_SHARED_LIBRARY" ON + ) + set(CMAKE_FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING "Directory to install frameworks to.") + set(CMAKE_FRAMEWORK_INSTALL_NAME_DIR "@executable_path/../Frameworks" CACHE STRING "install_name path for framework.") + set(CMAKE_DYLIB_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "install_name path for dylib.") + set(LUA_FRAMEWORK_NAME "lua.framework") + set(LUA_FRAMEWORK_VERSION_NUMBER "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + set(LUA_FRAMEWORK_VERSIONED_EXECUTABLE_DIR "Versions/${LUA_FRAMEWORK_VERSION_NUMBER}/MacOS") + set(LUA_FRAMEWORK_VERSIONED_LIB_DIR "Versions/${LUA_FRAMEWORK_VERSION_NUMBER}/lib") + set(LUA_FRAMEWORK_CURRENT_EXECUTABLE_DIR "Versions/Current/MacOS") + + # For Apple install_name, is it better to detect if Xcode vs Makefile? + # Xcode default=1, Makefile=0? Or detect if Framework vs. dylib, + # Framework=1, dylib=0? + option(CMAKE_BUILD_WITH_INSTALL_RPATH "Set to YES to set the rpath or install_name on build instead of install." ON) + + set(LUA_SOVERSION + "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.0") +elseif(CYGWIN) + set(DEFAULT_POSIX TRUE) + set(USE_RPATH TRUE) +elseif(UNIX) + set(DEFAULT_POSIX TRUE) + set(USE_RPATH TRUE) +elseif(WIN32) + set(LUA_WIN TRUE) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_BUILD_AS_DLL") +else(APPLE) + set(DEFAULT_ANSI TRUE) +endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +# +# setup config options with default values. +# +option(WANT_SHARED_LIBRARY "Set to ON to build dynamic library." ON) +if(WIN32) + set(WANT_STATIC_LIBRARY OFF) +else(WIN32) + option(WANT_STATIC_LIBRARY "Set to ON to build static library." ON) +endif(WIN32) + +if(USE_RPATH) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "rpaths separated by semicolons.") + option(CMAKE_BUILD_WITH_INSTALL_RPATH "Set to YES to set the rpath or install_name on build instead of install." OFF) +endif(USE_RPATH) + +if(DEFAULT_DLOPEN) + option(LUA_USE_DLOPEN "Enable dlopen support." ON) +else(DEFAULT_DLOPEN) + option(LUA_USE_DLOPEN "Enable dlopen support." OFF) +endif(DEFAULT_DLOPEN) + +if(DEFAULT_POSIX) + option(LUA_USE_CURSES "Enable Curses support." ON) + option(LUA_USE_MKSTEMP "Use mkstemp." ON) + option(LUA_USE_ISATTY "Enable isatty support." ON) + option(LUA_USE_POPEN "Enable lua_popen support." ON) + option(LUA_USE_ULONGJMP "Try using _longjmp/_setjmp (more efficient)" ON) +else(DEFAULT_POSIX) + option(LUA_USE_CURSES "Enable Curses support." OFF) + option(LUA_USE_MKSTEMP "Use mkstemp." OFF) + option(LUA_USE_ISATTY "Enable isatty support." OFF) + option(LUA_USE_POPEN "Enable lua_popen support." OFF) + option(LUA_USE_ULONGJMP "Try using _longjmp/_setjmp (more efficient)" OFF) +endif(DEFAULT_POSIX) + +if(DEFAULT_READLINE) + option(LUA_USE_READLINE "Enable readline support." ON) +else(DEFAULT_READLINE) + option(LUA_USE_READLINE "Enable readline support." OFF) +endif(DEFAULT_READLINE) + +if(DEFAULT_ANSI) + option(LUA_ANSI "Disable non-ansi features." ON) +else(DEFAULT_ANSI) + option(LUA_ANSI "Disable non-ansi features." OFF) +endif(DEFAULT_ANSI) + +option(LUA_USE_APICHECK "Enable API checks." OFF) + +# +# libs & cflags +# +set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -lm ") + +# For "Mac OS X 10.3-" +if(LUA_USE_MACOSX) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_MACOSX") + set(LUA_USE_DLOPEN FALSE) +endif(LUA_USE_MACOSX) + +# enable options +if(LUA_USE_DLOPEN) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_DLOPEN") + if(NOT APPLE) + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -ldl ") + endif(NOT APPLE) +endif(LUA_USE_DLOPEN) +if(LUA_USE_MKSTEMP) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_MKSTEMP") +endif(LUA_USE_MKSTEMP) +if(LUA_USE_ISATTY) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_ISATTY") +endif(LUA_USE_ISATTY) +if(LUA_USE_POPEN) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_POPEN") +endif(LUA_USE_POPEN) +if(LUA_USE_ULONGJMP) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_ULONGJMP") +endif(LUA_USE_ULONGJMP) +if(LUA_USE_APICHECK) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_APICHECK") +endif(LUA_USE_APICHECK) +if(LUA_ANSI) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_ANSI") +endif(LUA_ANSI) + +# readline support +if(LUA_USE_READLINE) + FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h) + FIND_LIBRARY(READLINE_LIBRARY NAMES readline) + if(READLINE_LIBRARY) + set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_READLINE") + set(COMMON_LDFLAGS "${COMMON_LDFLAGS} -lreadline -lhistory") + include_directories(${READLINE_INCLUDE_DIR}) + endif(READLINE_LIBRARY) +endif(LUA_USE_READLINE) + +# curses +if(LUA_USE_CURSES) + include(FindCurses) + if(CURSES_LIBRARY) + include_directories(${CURSES_INCLUDE_DIR}) + set(LIBS ${LIBS} ${CURSES_LIBRARY}) + endif(CURSES_LIBRARY) +endif(LUA_USE_CURSES) + +# +# standard flags to use for each build type. +# +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wextra -Wshadow -W -pedantic -std=gnu99") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") + set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -O1 -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 -g") +endif(CMAKE_COMPILER_IS_GNUCC) + +# +# For uninstall (needs cmake_uninstall.cmake.in in the top-level directory) +# +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) +ADD_CUSTOM_TARGET(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + +# +# sub-folders +# +ADD_SUBDIRECTORY(src build) +ADD_SUBDIRECTORY(test) + diff --git a/cmake/CustomMacros.cmake b/cmake/CustomMacros.cmake new file mode 100644 index 0000000..9318ea4 --- /dev/null +++ b/cmake/CustomMacros.cmake @@ -0,0 +1,14 @@ + +macro(add_target_properties _target _name) + set(_properties) + foreach(_prop ${ARGN}) + set(_properties "${_properties} ${_prop}") + endforeach(_prop) + get_target_property(_old_properties ${_target} ${_name}) + if(NOT _old_properties) + # in case it's NOTFOUND + set(_old_properties) + endif(NOT _old_properties) + set_target_properties(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}") +endmacro(add_target_properties) + diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in new file mode 100644 index 0000000..4897440 --- /dev/null +++ b/cmake_uninstall.cmake.in @@ -0,0 +1,18 @@ +IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) +ENDFOREACH(file) + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..e88bcac --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,229 @@ + +# Lua core source files. +set(LUA_CORE_SRC + lapi.c + lauxlib.c + lbaselib.c + lcode.c + ldblib.c + ldebug.c + ldo.c + ldump.c + lfunc.c + lgc.c + linit.c + liolib.c + llex.c + lmathlib.c + lmem.c + loadlib.c + lobject.c + lopcodes.c + loslib.c + lparser.c + lstate.c + lstring.c + lstrlib.c + ltable.c + ltablib.c + ltm.c + lundump.c + lvm.c + lzio.c +) +set(LUA_LIB_HEADERS + lua.h + lualib.h + lauxlib.h + luaconf.h + ../etc/lua.hpp +) +set(RESOURCE_FILES + ../etc/strict.lua + ../etc/lua.ico +) +set(DOC_FILES + ../doc/lua.1 + ../doc/luac.1 +) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}) + +# +# Lua library. +# +set(LUA_LIBS) +# lua static library. +add_library(lua_static STATIC ${LUA_CORE_SRC}) +add_target_properties(lua_static COMPILE_FLAGS "${COMMON_CFLAGS}") +add_target_properties(lua_static LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") +target_link_libraries(lua_static ${LIBS}) +set(LUA_MAIN_LIB lua_static) +if(WANT_STATIC_LIBRARY) + set(LUA_LIBS lua_static) +endif(WANT_STATIC_LIBRARY) +# lua dynamic library +if(WANT_SHARED_LIBRARY) + add_library(lua_dynamic SHARED ${LUA_CORE_SRC}) + add_target_properties(lua_dynamic COMPILE_FLAGS "${COMMON_CFLAGS}") + add_target_properties(lua_dynamic LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") + target_link_libraries(lua_dynamic ${LIBS}) + set_target_properties(lua_dynamic PROPERTIES OUTPUT_NAME lua) + + # link lua interpreter with dynamic library + set(LUA_MAIN_LIB lua_dynamic) + set(LUA_LIBS ${LUA_LIBS} lua_dynamic) +endif(WANT_SHARED_LIBRARY) + +# set library version & soversion +if(LUA_LIBS) + set_target_properties(${LUA_LIBS} PROPERTIES + VERSION ${LUA_VERSION} + SOVERSION ${LUA_SOVERSION} + CLEAN_DIRECT_OUTPUT 1 + ) +endif(LUA_LIBS) + +if(APPLE) + set(INSTALL_NAME_DIR) + # Set Dynamic Library and Framework properties + if(WANT_FRAMEWORK) + set_target_properties(lua_dynamic PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION "${LUA_FRAMEWORK_VERSION_NUMBER}" + PUBLIC_HEADER "${LUA_LIB_HEADERS}" + RESOURCE "${RESOURCE_FILES}" + ) + set(INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}) + + # Short Version is the "marketing version". It is the version + # the user sees in an information panel. + set(MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") + # Bundle version is the version the OS looks at. + set(MACOSX_FRAMEWORK_BUNDLE_VERSION "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") + set(MACOSX_FRAMEWORK_IDENTIFIER "org.lua.lua") + elseif(WANT_SHARED_LIBRARY) + set_target_properties(lua_dynamic PROPERTIES + FRAMEWORK FALSE + ) + set(INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR}) + endif(WANT_FRAMEWORK) + + if(INSTALL_NAME_DIR) + set_target_properties(lua_dynamic PROPERTIES + INSTALL_NAME_DIR ${INSTALL_NAME_DIR} + BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} + ) + else(INSTALL_NAME_DIR) + # no install_name folder force BUILD_WITH_INSTALL_RPATH to OFF + set_property(TARGET lua_dynamic PROPERTY BUILD_WITH_INSTALL_RPATH OFF) + endif(INSTALL_NAME_DIR) + + set(CMAKE_OSX_ARCHITECTURES ${OSX_ARCHITECTURES}) +elseif(WANT_SHARED_LIBRARY) + set_target_properties(lua_dynamic PROPERTIES + INSTALL_RPATH ${CMAKE_INSTALL_RPATH} + BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} + ) +endif(APPLE) + +# +# Lua compiler +# +add_executable(luac luac.c print.c) +add_target_properties(luac COMPILE_FLAGS "${COMMON_CFLAGS}") +add_target_properties(luac LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") +target_link_libraries(luac lua_static ${LIBS}) + +# +# Lua stand-alone interpreter +# +add_executable(lua_binary lua.c) +add_target_properties(lua_binary COMPILE_FLAGS "${COMMON_CFLAGS}") +add_target_properties(lua_binary LINK_FLAGS "${LD_FLAGS} ${COMMON_LDFLAGS}") +target_link_libraries(lua_binary ${LUA_MAIN_LIB} ${LIBS}) +# rename lub.bin to lua +set_target_properties(lua_binary PROPERTIES OUTPUT_NAME lua) + +# +# install lua/luac & library. +# +if(APPLE AND WANT_SHARED_LIBRARY AND WANT_FRAMEWORK) + # Make directory: lua.framework/Versions/5.1/MacOS + add_custom_command( + TARGET lua_dynamic + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E make_directory "${Lua_BINARY_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_VERSIONED_EXECUTABLE_DIR}" + COMMENT "Command line tools") + + # Make directory: lua.framework/Versions/5.1/lib + add_custom_command( + TARGET lua_dynamic + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E make_directory "${Lua_BINARY_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_VERSIONED_LIB_DIR}" + COMMENT "Static lib") + + # Copy lua to: lua.framework/Versions/5.1/MacOS/lua + add_custom_command( + TARGET lua_dynamic lua_binary + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy "${Lua_BINARY_DIR}/lua" "${Lua_BINARY_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_VERSIONED_EXECUTABLE_DIR}/lua" + COMMENT "Command line tools") + + # Copy luac to: lua.framework/Versions/5.1/MacOS/luac + add_custom_command( + TARGET lua_dynamic luac + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${Lua_BINARY_DIR}/luac ${Lua_BINARY_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_VERSIONED_EXECUTABLE_DIR}/luac + COMMENT "Command line tools") + + # Copy liblua.a to: lua.framework/Versions/5.1/lib/liblua.a + add_custom_command( + TARGET lua_dynamic lua_static + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy "${Lua_BINARY_DIR}/liblua.a" "${Lua_BINARY_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_VERSIONED_LIB_DIR}/liblua.a" + COMMENT "Static lib") + + # Will install framework to /Library/Frameworks directory or user specified + install(TARGETS lua + FRAMEWORK DESTINATION ${CMAKE_FRAMEWORK_INSTALL_DIR} + ) + + if(LUA_FRAMEWORK_INSTALL_SYMLINKS_FOR_EXECUTABLES_TO_CMAKE_INSTALL_PREFIX_BIN_DIR) + install(CODE "EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E make_directory \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin\")") + + # create a symbolic link for lua + # and add it to the install manifest + install(CODE "EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E create_symlink \"${CMAKE_FRAMEWORK_INSTALL_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_CURRENT_EXECUTABLE_DIR}/lua\" \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/lua\") + list(APPEND CMAKE_INSTALL_MANIFEST_FILES \"${CMAKE_INSTALL_PREFIX}/bin/lua\") + ") + + # create a symbolic link for luac + # and add it to the install manifest + install(CODE "EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E create_symlink \"${CMAKE_FRAMEWORK_INSTALL_DIR}/${LUA_FRAMEWORK_NAME}/${LUA_FRAMEWORK_CURRENT_EXECUTABLE_DIR}/luac\" \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/luac\") + list(APPEND CMAKE_INSTALL_MANIFEST_FILES \"${CMAKE_INSTALL_PREFIX}/bin/luac\") + ") + endif(LUA_FRAMEWORK_INSTALL_SYMLINKS_FOR_EXECUTABLES_TO_CMAKE_INSTALL_PREFIX_BIN_DIR) + +else(APPLE AND WANT_SHARED_LIBRARY AND WANT_FRAMEWORK) + install(TARGETS lua_binary luac + RUNTIME DESTINATION bin + ) + install(FILES ${DOC_FILES} DESTINATION man/man1) + + if(LUA_LIBS) + install(TARGETS ${LUA_LIBS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + install(FILES ${LUA_LIB_HEADERS} DESTINATION include) + endif(LUA_LIBS) + +endif(APPLE AND WANT_SHARED_LIBRARY AND WANT_FRAMEWORK) + --Boundary-00=_8mGzKhrEdYFQLJn-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:18:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97AISff009304; Wed, 7 Oct 2009 07:18:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B69221A72A; Wed, 7 Oct 2009 07:17:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AEDE1A726 for ; Wed, 7 Oct 2009 07:17:19 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1014198eye.39 for ; Wed, 07 Oct 2009 03:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=xVW9n1MKld7Ewe1j4CXxmvpJ/L9Z9Gi/HHueODOxErQ=; b=p0SaGg9RDrfhuZhOEBfk32erNJOr93qoWgPXJtQvKzxA4tjcI9asrnl8rPpExpSpLd EDlOGd4IyiCE10+yNxE2egaICn0oCTkGQGnGnahYuCX6h2maLsfXyqrTXjRa/RWuz7x4 7Dd2Gf5egIY+f6L3ev1u3pHlicBMGqH0Nycgo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VRp15rwrIbpt7ua0J64hZE/TOG82py+wDnz6b0pyph3COOUxZGdSSVOuIWqD/Zj52u 7JbSu12F3p2GAO583QEwS8BBrjA8vnSKKtSErRXCmGpeb1LdRis1Rif2llxY87CDHfIo hQZRlmN1qw5IEVI8QgyIL289EEv6qWMQWv/UU= MIME-Version: 1.0 Received: by 10.216.87.9 with SMTP id x9mr626152wee.0.1254910677262; Wed, 07 Oct 2009 03:17:57 -0700 (PDT) In-Reply-To: <200910070308.05491.bobby@sharedrealm.com> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> From: Jerome Vuarand Date: Wed, 7 Oct 2009 12:17:37 +0200 Message-ID: <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> Subject: Re: Return an exit code without os.exit()? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/7 Robert G. Jakabosky : > On Wednesday 07, Geoff Leyland wrote: >> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: >> > 2009/10/7 Geoff Leyland : >> >> Is there a way to return an exit code from a Lua script without >> >> calling >> >> os.exit()? >> >> >> >> I'm using luacov, and if you call os.exit(), it doesn't write any >> >> statistics. I'd also like my script to return 1 or 0. As far as I >> >> can >> >> tell, the return value from a top-level script does not seem to be >> >> used for >> >> an exit code, but hopefully someone can tell me I'm wrong. >> > >> > Looking at the code in lua.c, it seems the return value of the script >> > is ignored. It should be easy to patch if a custom Lua executable is >> > an option to you. >> >> Thanks, I thought someone might say that. Shame really, it'd be a >> nice feature to have in standard Lua (mind you this is the first time >> it's come up in a good few years of using Lua) > > luacov should wrap os.exit() and dump that stats before calling the normal > os.exit(). The very same issue has been discussed recently on the list, and iirc Lua 5.2 will have a kind of atexit facility to handle that (or maybe that was just a request?). But being able to return a value to the OS without os.exit woulf be nice though. Since you're not limited to return a single integer in your Lua scripts (and actually you can return anything and have it passed out by dofile for example), finding what value to to pass to the OS might be tricky. As non-zero return values are error codes, we could use the nil+msg error reporting mechanism often used in Lua: if the first return value is true (ie. non-nil and non-false) we return 0, and otherwise if the first return value is false (ie. nil or false), we try to convert the second return value to an integer and return that (or 1 if the second value is not convertible to an integer). That's just an idea though. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:51:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97Apc4N012002; Wed, 7 Oct 2009 07:51:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 561C51A736; Wed, 7 Oct 2009 07:50:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69A621A730 for ; Wed, 7 Oct 2009 07:50:16 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2B74F8B40B for ; Wed, 7 Oct 2009 06:50:55 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 07 Oct 2009 06:50:55 -0400 X-Sasl-enc: jXt9jEfq8/q+Mah7vqjofgaLXDn8oLdea+ciMlFXVRqx 1254912654 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id 18BF342CE for ; Wed, 7 Oct 2009 06:50:53 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <200910070308.05491.bobby@sharedrealm.com> Date: Wed, 7 Oct 2009 23:50:21 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 7/10/2009, at 11:08 PM, Robert G. Jakabosky wrote: > On Wednesday 07, Geoff Leyland wrote: >> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: >>> 2009/10/7 Geoff Leyland : >>>> Is there a way to return an exit code from a Lua script without >>>> calling >>>> os.exit()? >>>> >>>> I'm using luacov, and if you call os.exit(), it doesn't write any >>>> statistics. I'd also like my script to return 1 or 0. As far as I >>>> can >>>> tell, the return value from a top-level script does not seem to be >>>> used for >>>> an exit code, but hopefully someone can tell me I'm wrong. >>> >>> Looking at the code in lua.c, it seems the return value of the >>> script >>> is ignored. It should be easy to patch if a custom Lua executable is >>> an option to you. >> >> Thanks, I thought someone might say that. Shame really, it'd be a >> nice feature to have in standard Lua (mind you this is the first time >> it's come up in a good few years of using Lua) > > luacov should wrap os.exit() and dump that stats before calling the > normal > os.exit(). > > I don't know much about how luacov is implemented, but if they have > a function > that can be called from Lua to dump the stats, then you can write a > custom > os.exit() wrapper: > > local exit=os.exit > os.exit = function(...) > luacov.dumpstats() -- I don't know if a funciton like this exists. > exit(...) > end luacov does a trick with gc and a temporary file to get its save_stats called on exit: local luacovlock = os.tmpname() function on_exit() os.remove(luacovlock) stats.save_stats(data, statsfile) stats.stop_stats(statsfile) end on_exit_trick = io.open(luacovlock, "w") debug.setmetatable(on_exit_trick, { __gc = on_exit } ) This doesn't seem to happen on os.exit() - I guess os.exit() forces shutdown without gc? I could call luacov's save_stats directly or I could use luacov's tick facility, but I only use luacov sometimes, as lua -lluacov on the command line, so it would be nice to have my script know nothing about luacov, and still be able to return a 0 or 1. And it so nearly works. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:55:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97AtLsW012474; Wed, 7 Oct 2009 07:55:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C44091A738; Wed, 7 Oct 2009 07:54:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9274D1A72B for ; Wed, 7 Oct 2009 07:54:13 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97AsqZ0012436 for ; Wed, 7 Oct 2009 07:54:52 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n97AsoE23195; Wed, 7 Oct 2009 07:54:50 -0300 Date: Wed, 7 Oct 2009 07:54:49 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Return an exit code without os.exit()? Message-ID: <20091007075449.A23170@lua.tecgraf.puc-rio.br> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from geoff_leyland@fastmail.fm on Wed, Oct 07, 2009 at 11:50:21PM +1300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > luacov does a trick with gc and a temporary file to get its save_stats > called on exit: ... > This doesn't seem to happen on os.exit() - I guess os.exit() forces > shutdown without gc? This will be addressed in Lua 5.2: os.exit will have an option to close the state (thus calling gc). From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 07:57:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97Avcx7012748; Wed, 7 Oct 2009 07:57:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C9D71A73E; Wed, 7 Oct 2009 07:56:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 210CD1A72B for ; Wed, 7 Oct 2009 07:56:36 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97AvEOB012660 for ; Wed, 7 Oct 2009 07:57:14 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n97AvED23212; Wed, 7 Oct 2009 07:57:14 -0300 Date: Wed, 7 Oct 2009 07:57:13 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: LUA missing lua_pushuserdata()? Message-ID: <20091007075713.B23170@lua.tecgraf.puc-rio.br> References: <20091007061445.GA5450@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091007061445.GA5450@brevard.conman.org>; from sean@conman.org on Wed, Oct 07, 2009 at 02:14:45AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'd rather not have to go through > > blob = lua_newuserdata(...); > lua_setglobal(L,"dummy"); > ... > lua_getglobal(L,"dummy"); If that's your code, then you can use lua_pushvalue(L,-1) just before lua_setglobal to leave another instance of the same udata on the stack. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 08:00:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97B0AYg013144; Wed, 7 Oct 2009 08:00:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 385A01A741; Wed, 7 Oct 2009 07:59:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB1161A72B for ; Wed, 7 Oct 2009 07:59:04 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id EBCA08B761 for ; Wed, 7 Oct 2009 06:59:43 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 07 Oct 2009 06:59:43 -0400 X-Sasl-enc: yU8lVzZ7kOyOByg7wS5JgLd/rPzgy7EG46NRO9Q/Idt2 1254913183 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id EA7A94845 for ; Wed, 7 Oct 2009 06:59:42 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> Date: Wed, 7 Oct 2009 23:59:10 +1300 Content-Transfer-Encoding: 7bit Message-Id: <0BA58F76-8B2E-4094-9029-045B73B1CF61@fastmail.fm> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 7/10/2009, at 11:17 PM, Jerome Vuarand wrote: > 2009/10/7 Robert G. Jakabosky : >> On Wednesday 07, Geoff Leyland wrote: >>> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: >>>> 2009/10/7 Geoff Leyland : >>>>> Is there a way to return an exit code from a Lua script without >>>>> calling >>>>> os.exit()? >>>>> >>>>> I'm using luacov, and if you call os.exit(), it doesn't write any >>>>> statistics. I'd also like my script to return 1 or 0. As far >>>>> as I >>>>> can >>>>> tell, the return value from a top-level script does not seem to be >>>>> used for >>>>> an exit code, but hopefully someone can tell me I'm wrong. >>>> >>>> Looking at the code in lua.c, it seems the return value of the >>>> script >>>> is ignored. It should be easy to patch if a custom Lua executable >>>> is >>>> an option to you. >>> >>> Thanks, I thought someone might say that. Shame really, it'd be a >>> nice feature to have in standard Lua (mind you this is the first >>> time >>> it's come up in a good few years of using Lua) >> >> luacov should wrap os.exit() and dump that stats before calling the >> normal >> os.exit(). > > The very same issue has been discussed recently on the list, and iirc > Lua 5.2 will have a kind of atexit facility to handle that (or maybe > that was just a request?). > > But being able to return a value to the OS without os.exit woulf be > nice though. Since you're not limited to return a single integer in > your Lua scripts (and actually you can return anything and have it > passed out by dofile for example), finding what value to to pass to > the OS might be tricky. As non-zero return values are error codes, we > could use the nil+msg error reporting mechanism often used in Lua: if > the first return value is true (ie. non-nil and non-false) we return > 0, and otherwise if the first return value is false (ie. nil or > false), we try to convert the second return value to an integer and > return that (or 1 if the second value is not convertible to an > integer). That's just an idea though. I think it'd be safer to break that convention and return 0 on nil and 0, a number on a number some tortured logic for true and false 1 on any other value That way, if you didn't return anything, the os would get 0 - success, and if you returned 1 or a string, the os would get 1 - failure. The logic's contorted either way, but I don't think that returning nil (which most scripts would do by not having a return statement) should mean failure, and I don't think (nil) and (nil, message) should mean different things. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 08:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97B2Oln013495; Wed, 7 Oct 2009 08:02:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 393541A74D; Wed, 7 Oct 2009 08:01:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5D6F1A749 for ; Wed, 7 Oct 2009 08:01:20 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id D1A798B483 for ; Wed, 7 Oct 2009 07:01:56 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 07 Oct 2009 07:01:56 -0400 X-Sasl-enc: GqviP9heMmhAjkpkxLqidhbhBdkctRMIr4k2lzmRUIQM 1254913316 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id 268974877 for ; Wed, 7 Oct 2009 07:01:55 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <20091007075449.A23170@lua.tecgraf.puc-rio.br> Date: Thu, 8 Oct 2009 00:01:23 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <20091007075449.A23170@lua.tecgraf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> luacov does a trick with gc and a temporary file to get its >> save_stats >> called on exit: > ... >> This doesn't seem to happen on os.exit() - I guess os.exit() forces >> shutdown without gc? > > This will be addressed in Lua 5.2: os.exit will have an option to > close the state (thus calling gc). Thanks. Can I gently propose that the return value from the top-level script gets turned into an exit code? As you'll see from my message to Jerome, I don't know to turn a return value into an exit code in the general case, but I'm happy to stick to 0 and 1. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 09:51:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97Cplp4032520; Wed, 7 Oct 2009 09:51:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FF101891C; Wed, 7 Oct 2009 09:50:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f217.google.com (mail-ew0-f217.google.com [209.85.219.217]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDC67188C8 for ; Wed, 7 Oct 2009 09:50:20 -0300 (BRT) Received: by ewy17 with SMTP id 17so545521ewy.39 for ; Wed, 07 Oct 2009 05:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=7hB6/n1sKXGUX8kjGMOqmdlLohowAP9XM5iP+FmhDd8=; b=eyQxMCQCXEkpBh00GJEQ/PAiG7ugUP/u1Ax/KVpWw9ed+itMXEm58mHdy8GhP3uoOm XPd4glmytHIWKNOR9ueRx86PO7iP7AKhkafsh2xWou9UOUcwj/tqbe2fD2roE5XrC+fe qXdVtuTBknMP7sQfaAkzaW0cXTUkll+pEOUjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Vq7UAdGZh9xiPcwgZRPcu5koytSSsD4ATvALvZnmrNnLiVAQpGj+l+NcFyFwT7p7DC otpYHrGgfIUpVi/cMJJrsZhCDVWM102TPxAJAcJMhGbyISF/523oIThb7+SsAE0VFLjk tnIbqpyGhSe9+2wyfdLdZpT9bcUk4vG87DEKc= MIME-Version: 1.0 Received: by 10.216.87.9 with SMTP id x9mr668630wee.0.1254919857104; Wed, 07 Oct 2009 05:50:57 -0700 (PDT) In-Reply-To: <0BA58F76-8B2E-4094-9029-045B73B1CF61@fastmail.fm> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> <0BA58F76-8B2E-4094-9029-045B73B1CF61@fastmail.fm> From: Jerome Vuarand Date: Wed, 7 Oct 2009 14:50:37 +0200 Message-ID: <89d273ba0910070550w1c9af41em63d0339d63a4e6a1@mail.gmail.com> Subject: Re: Return an exit code without os.exit()? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/7 Geoff Leyland : > On 7/10/2009, at 11:17 PM, Jerome Vuarand wrote: >> >> 2009/10/7 Robert G. Jakabosky : >>> >>> On Wednesday 07, Geoff Leyland wrote: >>>> >>>> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: >>>>> >>>>> 2009/10/7 Geoff Leyland : >>>>>> >>>>>> Is there a way to return an exit code from a Lua script without >>>>>> calling >>>>>> os.exit()? >>>>>> >>>>>> I'm using luacov, and if you call os.exit(), it doesn't write any >>>>>> statistics. I'd also like my script to return 1 or 0. As far as I >>>>>> can >>>>>> tell, the return value from a top-level script does not seem to be >>>>>> used for >>>>>> an exit code, but hopefully someone can tell me I'm wrong. >>>>> >>>>> Looking at the code in lua.c, it seems the return value of the script >>>>> is ignored. It should be easy to patch if a custom Lua executable is >>>>> an option to you. >>>> >>>> Thanks, I thought someone might say that. Shame really, it'd be a >>>> nice feature to have in standard Lua (mind you this is the first time >>>> it's come up in a good few years of using Lua) >>> >>> luacov should wrap os.exit() and dump that stats before calling the >>> normal >>> os.exit(). >> >> The very same issue has been discussed recently on the list, and iirc >> Lua 5.2 will have a kind of atexit facility to handle that (or maybe >> that was just a request?). >> >> But being able to return a value to the OS without os.exit woulf be >> nice though. Since you're not limited to return a single integer in >> your Lua scripts (and actually you can return anything and have it >> passed out by dofile for example), finding what value to to pass to >> the OS might be tricky. As non-zero return values are error codes, we >> could use the nil+msg error reporting mechanism often used in Lua: if >> the first return value is true (ie. non-nil and non-false) we return >> 0, and otherwise if the first return value is false (ie. nil or >> false), we try to convert the second return value to an integer and >> return that (or 1 if the second value is not convertible to an >> integer). That's just an idea though. > > I think it'd be safer to break that convention and return > 0 on nil and 0, > a number on a number > some tortured logic for true and false > 1 on any other value > That way, if you didn't return anything, the os would get 0 - success, and > if you returned 1 or a string, the os would get 1 - failure. > The logic's contorted either way, but I don't think that returning nil > (which most scripts would do by not having a return statement) should mean > failure, and I don't think (nil) and (nil, message) should mean different > things. You can differentiate between a nil return value and no return value. That way you can continue to treat (nil) or (nil,msg) as an error (and return 1), and treat no return value as success (and return 0). From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 13:21:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97GLCov016105; Wed, 7 Oct 2009 13:21:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 630B0190D3; Wed, 7 Oct 2009 13:19:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 100B118B2B for ; Wed, 7 Oct 2009 13:19:46 -0300 (BRT) Received: by ewy26 with SMTP id 26so5507491ewy.5 for ; Wed, 07 Oct 2009 09:20:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.82 with SMTP id d60mr41400wef.79.1254932425193; Wed, 07 Oct 2009 09:20:25 -0700 (PDT) In-Reply-To: <790db3550910061808k4b67fbf2gd9abf852bec518b4@mail.gmail.com> References: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> <826d5c730910061748p10bcce78n552955cb5c33c74f@mail.gmail.com> <790db3550910061808k4b67fbf2gd9abf852bec518b4@mail.gmail.com> From: Chris Gagnon Date: Wed, 7 Oct 2009 09:20:05 -0700 Message-ID: <826d5c730910070920x4bb95047x83bf799c54855519@mail.gmail.com> Subject: Re: Anchoring co-routines and properly dropping references to allow GC to clean them up To: Lua list Content-Type: multipart/alternative; boundary=0016e6d7e3626bc2f004755ab999 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d7e3626bc2f004755ab999 Content-Type: text/plain; charset=ISO-8859-1 > Sorry if I misunderstand, but isn't this all you want? > > lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); > lua_pushnil(MainState); > lua_rawseti(MainState, -2, refID); > lua_pop(MainState, 1); /* ThreadTable */ > I asked the question poorly, the code to release the coroutine isn't the problem. The placement of that code is, i have multiple entry point back to my co routines from different systems that utilize yeild/resume to implement functionality. Do you need to check the state of the thread after ever lua_resume call? and then do code like you suggest? Or is there a way to do it more generically then that, I'm leaning towards the latter. Sorry for the confusing question, and thank you for the replies. On Tue, Oct 6, 2009 at 6:08 PM, Patrick Donnelly wrote: > On Tue, Oct 6, 2009 at 9:48 PM, Chris Gagnon > wrote: > > Apologizes for the partial email, what a way to introduce myself ;o) > > > > Lets assume we have a MainState, and a "ThreadTable" in the global table > > > > lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); > > lua_State *thread = lua_newthread(MainState); > > int refID = luaL_ref(MainState, -2); > > lua_pop(MainState,1); > [...] > > The problem i'm running into is how do I remove my reference/anchor, when > > the coroutine is simply done. > > Sorry if I misunderstand, but isn't this all you want? > > lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); > lua_pushnil(MainState); > lua_rawseti(MainState, -2, refID); > lua_pop(MainState, 1); /* ThreadTable */ > > -- > -Patrick Donnelly > > "Let all men know thee, but no man know thee thoroughly: Men freely > ford that see the shallows." > > - Benjamin Franklin > --0016e6d7e3626bc2f004755ab999 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Sorry if I misund= erstand, but isn't this all you want?

lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
lua_pushnil(MainState);
lua_rawseti(MainState, -2, refID);
lua_pop(MainState, 1); /* ThreadTable */

I asked t= he question poorly, the code to release the coroutine isn't the problem= .
The placement of that code is, i have multiple entry point back to my = co routines from different systems that utilize yeild/resume to implement f= unctionality.
Do you need to check the state of the thread after ever lua_resume call? an= d then do code like you suggest?
Or is there a way to do it more generic= ally then that, I'm leaning towards the latter.

Sorry for the co= nfusing question, and thank you for the replies.

On Tue, Oct 6, 2009 at 6:08 PM, Patrick Donn= elly <batrick@= batbytes.com> wrote:
On Tue, Oct 6, 2009 at 9:48 PM, Chris Gagnon <cgagnon@zindagigames.com> wrote= :
> Apologizes for the partial email, what a way to introduce myself ;o) >
> Lets assume we have a MainState, and a "ThreadTable" in the = global table
>
> lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); > lua_State *thread =3D lua_newthread(MainState);
> int refID =3D luaL_ref(MainState, -2);
> lua_pop(MainState,1);
[...]
> The problem i'm running into is how do I remove = my reference/anchor, when
> the coroutine is simply done.

Sorry if I misunderstand, but isn't this all you want?

lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable");
lua_pushnil(MainState);
lua_rawseti(MainState, -2, refID);
lua_pop(MainState, 1); /* ThreadTable */

--
-Patrick Donnelly

"Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows."

- Benjamin Franklin

--0016e6d7e3626bc2f004755ab999-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 13:29:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97GTeiQ017878; Wed, 7 Oct 2009 13:29:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1570C192C1; Wed, 7 Oct 2009 13:28:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36A68192B2 for ; Wed, 7 Oct 2009 13:28:25 -0300 (BRT) Received: by ewy26 with SMTP id 26so5516533ewy.5 for ; Wed, 07 Oct 2009 09:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Fk+P96Oz4e5nlp0uHKkJX83mVT+QeW0huDnl7YIeAzI=; b=upRqxdNwkZGe24zg2Tah2DmmwrHvK/5RQoZwvr1aAtuuGQuLDZz5Y3alLNtxE7lvBh A7siHAyNXGRSZiPoSiGgdn16TkXNEAae9XaxaEaYmQ8biVHiE7J9AOgT7ZXHFz+gFQRz l0FCg6G+jMsuHJgHh6moP2KTmkxh6eg4qyoSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=i4/uuJpfh5pijztN8rN+90T2UPRk3ElgMwWxxuB8BlZjNJbiUYLU7jdc30k4OWeKvx E+EJQMuuZaQ+ByOyesRMfK7oethoy5dD12y5qaWoygcNl4qLpsXAN4RpDHX0gbNalZQL B+KGRIZRqJpQcSaIyeU1sqecm+1R78J6z78M4= MIME-Version: 1.0 Received: by 10.216.86.80 with SMTP id v58mr42139wee.40.1254932942133; Wed, 07 Oct 2009 09:29:02 -0700 (PDT) In-Reply-To: <826d5c730910070920x4bb95047x83bf799c54855519@mail.gmail.com> References: <826d5c730910061719hdbcdf7ci80503e9d91eb90d6@mail.gmail.com> <826d5c730910061748p10bcce78n552955cb5c33c74f@mail.gmail.com> <790db3550910061808k4b67fbf2gd9abf852bec518b4@mail.gmail.com> <826d5c730910070920x4bb95047x83bf799c54855519@mail.gmail.com> From: Jerome Vuarand Date: Wed, 7 Oct 2009 18:28:42 +0200 Message-ID: <89d273ba0910070928p4b0d1020s3e92dee53ac1a755@mail.gmail.com> Subject: Re: Anchoring co-routines and properly dropping references to allow GC to clean them up To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/7 Chris Gagnon : > >> Sorry if I misunderstand, but isn't this all you want? >> >> lua_getfield(MainState, LUA_GLOBALSINDEX, "ThreadTable"); >> lua_pushnil(MainState); >> lua_rawseti(MainState, -2, refID); >> lua_pop(MainState, 1); /* ThreadTable */ > > I asked the question poorly, the code to release the coroutine isn't the > problem. > The placement of that code is, i have multiple entry point back to my co > routines from different systems that utilize yeild/resume to implement > functionality. > Do you need to check the state of the thread after ever lua_resume call? and > then do code like you suggest? > Or is there a way to do it more generically then that, I'm leaning towards > the latter. > > Sorry for the confusing question, and thank you for the replies. You have to check for the return value of lua_resume. If it's anything other than LUA_YIELD, the coroutine is no longer resumable. Anyway you need to check that value to make sure you don't call lua_resume on it anymore, so in that check you can also remove the reference you have in your ThreadTable (and actually if you only resume coroutines from that table, that's the only thing you need to do). From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 14:16:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97HGY6Y028255; Wed, 7 Oct 2009 14:16:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73A82192C4; Wed, 7 Oct 2009 14:15:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C5FD192C5 for ; Wed, 7 Oct 2009 14:15:14 -0300 (BRT) Received: by vws9 with SMTP id 9so2806088vws.11 for ; Wed, 07 Oct 2009 10:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tCsyazkrhLonI0SEOWHovFNO0qAUIdccD4H+4wC8No4=; b=vVcVDIt7iagYBTUz8zxSQ4PluvMYeqpUV+iJkgDGgSISm7OhsHEh9p5NzuNO5Bd5La BymnP5NcqKMb8vuFMq7xHNWMAu3qMRUkJwyCi52JYEFURCJ5pmtYghadYSfJcyszgfVi 01MUWoHtHiP8BLCkuDi76caO50OWrZAGg3HM0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=bRl0OyzErQiYShhg5HrcUZvLMtiR/2ssl5AX7u8djeyC27TopFwuPA0FY7REz4RVS4 BdbacWq4Idh4UT6xF6AuPqfVgdbJMdnPOiNUIPwTYIL8kZO7Ww8DKBNhphcB8uwqKNrL zk/FzCPphFFpTfNKhQiG7rq8eIRDo55Mto/NA= MIME-Version: 1.0 Received: by 10.220.107.227 with SMTP id c35mr293617vcp.0.1254935753151; Wed, 07 Oct 2009 10:15:53 -0700 (PDT) Date: Wed, 7 Oct 2009 14:15:53 -0300 X-Google-Sender-Auth: e46722b9811ea9ad Message-ID: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Subject: LuaForge is down and will be for some time From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n97HGY6Y028255 I have bad news about LuaForge, the damage on LuaForge might take some time to recover. We have data backups for everything, but redoing a GForge installation is going to take a while. To make things harder, we are all involved today in the Lua Workshop so this may impact the recovery time too. The current plan is to create a new GForge setup and import the data. If there is anyone on the list with GForge knowledge, please contact me off list. I'll keep the list informed about the progress on this operation but our expectations are that this will certainly take a few days. Unfortunately, until them we are out of luck with these services: luaforge.net main site (catalog, project info, files downloads, CVS, issue tracker, forums) projects mailing lists projects FTP (the project_name.luaforge.net sites are up) I'm really sorry for the trouble this have caused for everyone using LuaForge services and I hope we can have everything back asap. Meanwhile, I'd like to know what you think about eventually moving from this setup based on GForge to one based on something else. One option would be to recommend that projects moved their SCM to sites like github or Google Code and then leave luaforge.net as just a catalog and news site. Of course this eventual migration would be possible only after LuaForge is back up (still using GForge). Thanks in advance for your patience. André From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 14:29:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97HTB6c031648; Wed, 7 Oct 2009 14:29:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4803F1A73C; Wed, 7 Oct 2009 14:28:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B67F1A673 for ; Wed, 7 Oct 2009 14:27:59 -0300 (BRT) Received: by bwz22 with SMTP id 22so4586223bwz.5 for ; Wed, 07 Oct 2009 10:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tKJ4BMbfkXUwBGs4vNSPRrNGNfHs82egxVYSXU4ZuuQ=; b=I7bErs/pGWfdm8KiLN0+3wxDZF0fUB8ZQCy9FtOioQC1YLMmrN/XcOkYmT1TFG0Vdy uSwDLmBqSBJaoiSir7rlymjUI03Sf/9lOpaOXKWvVnlfl+5WtFjVfoZlH0FBZXbSheiY 2JBxCosGKa2zYXRjshH3auBulGYky84q0L/q4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IxeGfIJl1vhRijCv+IwYpWsC267mA/EZDwBbBgGW7kMQAI9UozUYQU6ixLeW5vuAK9 cCcKmZYAP70xWTMMFr5sG8eK+LnonVu7eYc/6d2vFZ/1Ha+DFRso7DJqSQOzZ79+h1Jm P+UU6I4IJALsLS776MDYqBwDlLwl1jSQvGeT4= MIME-Version: 1.0 Received: by 10.239.179.91 with SMTP id c27mr16530hbg.51.1254936517476; Wed, 07 Oct 2009 10:28:37 -0700 (PDT) In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Wed, 7 Oct 2009 19:28:37 +0200 Message-ID: <560972290910071028r4db365acm32c5aee40e595179@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n97HTB6c031648 On Wed, Oct 7, 2009 at 7:15 PM, Andre Carregal wrote: > Meanwhile,  I'd like to know what you think about eventually moving > from this setup based on GForge to one based on something else. One > option would be to recommend that projects moved their SCM to sites > like github or Google Code and then leave luaforge.net as just a > catalog and news site. I think that just about anything would look better than GForge. It has always felt 'noisy' to me, too many features enabled by default. Google Code feels clean in comparison. As for project hosting, it's become less of a pain now that I use lexpect scripts to update LuaForge websites - at least then I can actually go make tea while my FTP client is negotiating. seve d. From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 15:35:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97IZAFM015076; Wed, 7 Oct 2009 15:35:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF01E1A715; Wed, 7 Oct 2009 15:33:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7277F1A704 for ; Wed, 7 Oct 2009 15:33:36 -0300 (BRT) Received: by iwn8 with SMTP id 8so2981267iwn.33 for ; Wed, 07 Oct 2009 11:34:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.126.69 with SMTP id b5mr307260ibs.54.1254940453323; Wed, 07 Oct 2009 11:34:13 -0700 (PDT) In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Wed, 7 Oct 2009 14:34:13 -0400 X-Google-Sender-Auth: ac0322204d762d4d Message-ID: Subject: Re: LuaForge is down and will be for some time From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > One option would be to recommend that projects moved > their SCM to sites like github or Google Code and then > leave luaforge.net as just a catalog and news site I think these other sites are sufficient and in some ways better (e.g. SCM) alternatives to LuaForge. However, I do continue to advocate creating some type of global catalog site for Lua [1] along the lines of Perl's search.cpan.org and cpantesters.org but indexing LuaRocks repositories and possibly other Lua code sources. Furthermore, last month there was the discussion of a Lua snippet site [2]. Neither of these two are well handled by the existing SCM sites. [1] http://lua-users.org/lists/lua-l/2009-09/msg00019.html [2] http://lua-users.org/lists/lua-l/2009-09/msg00465.html From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 15:38:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97Ic4vk016061; Wed, 7 Oct 2009 15:38:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9284D1A72A; Wed, 7 Oct 2009 15:36:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87C881A717 for ; Wed, 7 Oct 2009 15:36:49 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 06D598BFD6 for ; Wed, 7 Oct 2009 14:37:27 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 07 Oct 2009 14:37:27 -0400 X-Sasl-enc: 6uzGfIXtb/iTXwWEypD5gXdq+VcC/0xVmmg6oapYYyS2 1254940646 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id F165C4A3B for ; Wed, 7 Oct 2009 14:37:25 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <89d273ba0910070550w1c9af41em63d0339d63a4e6a1@mail.gmail.com> Date: Thu, 8 Oct 2009 07:36:52 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> <0BA58F76-8B2E-4094-9029-045B73B1CF61@fastmail.fm> <89d273ba0910070550w1c9af41em63d0339d63a4e6a1@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/10/2009, at 1:50 AM, Jerome Vuarand wrote: > 2009/10/7 Geoff Leyland : >> On 7/10/2009, at 11:17 PM, Jerome Vuarand wrote: >>> >>> 2009/10/7 Robert G. Jakabosky : >>>> >>>> On Wednesday 07, Geoff Leyland wrote: >>>>> >>>>> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: >>>>>> >>>>>> 2009/10/7 Geoff Leyland : >>>>>>> >>>>>>> Is there a way to return an exit code from a Lua script without >>>>>>> calling >>>>>>> os.exit()? >>>>>>> >>>>>>> I'm using luacov, and if you call os.exit(), it doesn't write >>>>>>> any >>>>>>> statistics. I'd also like my script to return 1 or 0. As far >>>>>>> as I >>>>>>> can >>>>>>> tell, the return value from a top-level script does not seem >>>>>>> to be >>>>>>> used for >>>>>>> an exit code, but hopefully someone can tell me I'm wrong. >>>>>> >>>>>> Looking at the code in lua.c, it seems the return value of the >>>>>> script >>>>>> is ignored. It should be easy to patch if a custom Lua >>>>>> executable is >>>>>> an option to you. >>>>> >>>>> Thanks, I thought someone might say that. Shame really, it'd be a >>>>> nice feature to have in standard Lua (mind you this is the first >>>>> time >>>>> it's come up in a good few years of using Lua) >>>> >>>> luacov should wrap os.exit() and dump that stats before calling the >>>> normal >>>> os.exit(). >>> >>> The very same issue has been discussed recently on the list, and >>> iirc >>> Lua 5.2 will have a kind of atexit facility to handle that (or maybe >>> that was just a request?). >>> >>> But being able to return a value to the OS without os.exit woulf be >>> nice though. Since you're not limited to return a single integer in >>> your Lua scripts (and actually you can return anything and have it >>> passed out by dofile for example), finding what value to to pass to >>> the OS might be tricky. As non-zero return values are error codes, >>> we >>> could use the nil+msg error reporting mechanism often used in Lua: >>> if >>> the first return value is true (ie. non-nil and non-false) we return >>> 0, and otherwise if the first return value is false (ie. nil or >>> false), we try to convert the second return value to an integer and >>> return that (or 1 if the second value is not convertible to an >>> integer). That's just an idea though. >> >> I think it'd be safer to break that convention and return >> 0 on nil and 0, >> a number on a number >> some tortured logic for true and false >> 1 on any other value >> That way, if you didn't return anything, the os would get 0 - >> success, and >> if you returned 1 or a string, the os would get 1 - failure. >> The logic's contorted either way, but I don't think that returning >> nil >> (which most scripts would do by not having a return statement) >> should mean >> failure, and I don't think (nil) and (nil, message) should mean >> different >> things. > > You can differentiate between a nil return value and no return value. > That way you can continue to treat (nil) or (nil,msg) as an error (and > return 1), and treat no return value as success (and return 0). I didn't know that! You mean like this? > function a() end > function b() return nil end > =select("#", a()) 0 > =select("#", b()) 1 Or is there another way? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 15:44:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97IhtYi017313; Wed, 7 Oct 2009 15:43:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 848A01A738; Wed, 7 Oct 2009 15:42:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.ethernet-mp3.de (static.88-198-132-202.clients.your-server.de [88.198.132.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEFD71A72B for ; Wed, 7 Oct 2009 15:42:41 -0300 (BRT) Received: from [192.168.192.211] (dslb-084-062-220-213.pools.arcor-ip.net [84.62.220.213]) (Authenticated sender: harald.kipp@egnite.de) by mail.ethernet-mp3.de (Postfix) with ESMTPA id 8BB5119C4AE for ; Wed, 7 Oct 2009 20:43:21 +0200 (CEST) Message-ID: <4ACCE141.904@egnite.de> Date: Wed, 07 Oct 2009 20:43:13 +0200 From: Harald Kipp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Lua on 8-bit AVR Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, Some time ago Laszlo Parrag ported Lua to Nut/OS, initially running on an ARM7 CPU: http://www.ethernut.de/en/firmware/nutlua.html To demonstrate its capabilities, I squeezed it into an ATmega128, an 8-bit CPU with 128k Flash, using 32k external RAM. And, because there was some room left, I added a TCP/IP stack and put the thing online. You can visit this tiny node at ethernut.microweb.org using a Telnet client. Please do not rush out now to try it immediately. Due to limited resources, only one concurrent connection is accepted. To avoid complete blocking, you will be thrown out after 600 seconds. The tricky part is the Telnet client. While the default Windows Telnet seems to be broken (can't switch off echo), I'd recommend to use TeraTerm on this platform. The Lua shell will echo all input characters and send carriage return plus linefeed. When using Linux, you must properly configure your Telnet client. When loading the right keyboard translation (ibmkeyb with TeraTerm) you can even use the history and edit functions with your input. Finally note, that I had to disable almost all libraries to make room for the TCP/IP stack. The target board is an Ethernut 1.3 Rev-H. More details about this hardware are available at http://www.ethernut.de/en/hardware/enut1/ Enjoy, Harald From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 15:58:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97IvuXM020272; Wed, 7 Oct 2009 15:57:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF38D1A742; Wed, 7 Oct 2009 15:56:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 270871A737 for ; Wed, 7 Oct 2009 15:56:44 -0300 (BRT) Received: by iwn8 with SMTP id 8so2992836iwn.33 for ; Wed, 07 Oct 2009 11:57:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.27 with SMTP id n27mr392866ibr.48.1254941841387; Wed, 07 Oct 2009 11:57:21 -0700 (PDT) In-Reply-To: References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <89d273ba0910070224y43413967l7273e831a0c606f3@mail.gmail.com> <20A12D3D-D16A-4B5F-B1CF-CD2E5ADB0A52@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <89d273ba0910070317m15850c73lc2bd4a68f1ab1e7d@mail.gmail.com> <0BA58F76-8B2E-4094-9029-045B73B1CF61@fastmail.fm> <89d273ba0910070550w1c9af41em63d0339d63a4e6a1@mail.gmail.com> Date: Wed, 7 Oct 2009 15:57:21 -0300 Message-ID: <790db3550910071157h6605cffcy11019a2ee1d965dc@mail.gmail.com> Subject: Re: Return an exit code without os.exit()? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n97IvuXM020272 On Wed, Oct 7, 2009 at 3:36 PM, Geoff Leyland wrote: > I didn't know that!  You mean like this? > >> function a() end >> function b() return nil end >> =select("#", a()) > 0 >> =select("#", b()) > 1 > > Or is there another way? select is the only way to count the number of values in an expression list (either, varargs ... or the return values from a function). -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 15:59:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97IxdfC020647; Wed, 7 Oct 2009 15:59:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 676321A74D; Wed, 7 Oct 2009 15:58:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 240201A744 for ; Wed, 7 Oct 2009 15:58:31 -0300 (BRT) Received: by fxm12 with SMTP id 12so5355377fxm.5 for ; Wed, 07 Oct 2009 11:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=MUOW/yW0kA1Q73Qcn1IgvCSE8sz11UP6tsXNpoklPeU=; b=GtbSMmISgbD81WtLMRIaoObBJc1i9XmMl/5oBDYp3Hi7XUz3aHrf2tzVEI1A1ys41D oX3LsBcg3OuOizKmGjUb3U0KRMcc4xRttlyKb5FM9KFgG3D15XbQb9uXFsiXldKUwKJh 1rRKNsEZvaasxb6XKi9vDfzGk9b4F+fWupdlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=kPmvgSs3vlzSTWy3PDAPNBKU6T2dmm1Xgc5dDiR8ykYcGsIfeXZFroNR4syJJNcRT5 ABZgZM6MtU2fa3r1mj5j9VobFIkH0rlBFIMUxq6m6uSQ5w2hha9cedKdwCKSn+3ckwCo x6GY/pAj64MIKtL+6eBlGb+o0xrrg90G6scxc= Received: by 10.103.78.35 with SMTP id f35mr102109mul.89.1254941948543; Wed, 07 Oct 2009 11:59:08 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id j10sm67905muh.30.2009.10.07.11.59.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Oct 2009 11:59:07 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Wed, 7 Oct 2009 20:58:36 +0200 References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 7, 2009, at 8:34 PM, David Manura wrote: > However, I do continue to advocate creating Why not do it then? From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 16:25:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97JPiwD027688; Wed, 7 Oct 2009 16:25:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD5C1892D; Wed, 7 Oct 2009 16:24:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E113A188AE for ; Wed, 7 Oct 2009 16:24:23 -0300 (BRT) Received: by bwz22 with SMTP id 22so4694847bwz.5 for ; Wed, 07 Oct 2009 12:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=7AnRISituHgdnL0jt1qjsmOup9/NFafrde48plbdCQ0=; b=HM+qEQPFHYEjT1yhbWs40TP7oGJN48Te4Dl0FbzuqgRNz9NI1F7ZUzFD920OBzOmDq eeemrc1WuRKgrhukwrqwQjIoN/o995Tpteu4rnDjGZW7d7DY+KoDNlQ+MUFbBDcrDBPN K/eevhoz/wzVH9ZXRtJqvImPdHjuKkx/q8W3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=s1Y8vKEera6kizcH4jpp3Ql6ebz/+DJTZJ2jtl/QToZUy+0T/H5X9+h2CeuDdXPQdx GSTAhzHEjgdOivs+L2NUV33X+hz+xJRW8Gs5pYZfpcykEK3fufzMHrjowLTnCS3D1wTH /FWYnZR1UN0JnfEeVWWccWDJCVHGz06tYFCbg= MIME-Version: 1.0 Received: by 10.223.3.85 with SMTP id 21mr93842fam.98.1254943500052; Wed, 07 Oct 2009 12:25:00 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> From: Jim Whitehead II Date: Wed, 7 Oct 2009 20:24:40 +0100 Message-ID: <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Oct 7, 2009 at 7:58 PM, Petite Abeille wrote: > > On Oct 7, 2009, at 8:34 PM, David Manura wrote: > >> However, I do continue to advocate creating > > Why not do it then? Are you volunteering? I think that's precisely the point! - Jim From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 16:29:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97JTJJx028560; Wed, 7 Oct 2009 16:29:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B9C31A5A0; Wed, 7 Oct 2009 16:28:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CD20188E9 for ; Wed, 7 Oct 2009 16:28:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so5385078fxm.5 for ; Wed, 07 Oct 2009 12:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=WVTXuqLtHwHc1XqswIUayJNS5XDMtQA+Wp4tmJSzKVc=; b=IWmmdRLGyFzSoZELJ8NqD77Gp0bmIC36Lf/0EX2sdCO+8uCnaBQKvPaMKEcJStWVF5 IR26rFjctbfnyxJbx4YrfJzyLwuzPzjiCFRUUDoFXqkG4uliKwW8lPJDr1Q5Srd/9Q5s Dupd2F5Ti46j/2RnLQUpci+U8faKWPfZ9cNLw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=afqbKAicx337/9JehZdASaR5M0ZOnr5L+wlHQ2rfhevidaj78lDZT/5FfpBBqIG0AM 8e4FtTldlPdzYonIv+O3OvUcLUETs/UouFcltGVkTT3kUQfdBlV0dZU6wgjTROYYHgya X/mT1Fyk0pMa6M7kLBKDKoq0Z+W8YdfUQ/Lng= Received: by 10.86.231.15 with SMTP id d15mr313014fgh.74.1254943722576; Wed, 07 Oct 2009 12:28:42 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 4sm121998fgg.28.2009.10.07.12.28.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Oct 2009 12:28:41 -0700 (PDT) Message-Id: <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Wed, 7 Oct 2009 21:28:10 +0200 References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 7, 2009, at 9:24 PM, Jim Whitehead II wrote: > On Wed, Oct 7, 2009 at 7:58 PM, Petite Abeille > wrote: >> >> On Oct 7, 2009, at 8:34 PM, David Manura wrote: >> >>> However, I do continue to advocate creating >> >> Why not do it then? > > Are you volunteering? I think that's precisely the point! No, not personally, not much interest in that specific domain. I was more wondering why David is not doing it giving all his advocacy :) From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 16:47:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97JlfEW000846; Wed, 7 Oct 2009 16:47:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F9A418C30; Wed, 7 Oct 2009 16:46:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A070018B7A for ; Wed, 7 Oct 2009 16:46:29 -0300 (BRT) Received: by fg-out-1718.google.com with SMTP id e21so1513191fga.17 for ; Wed, 07 Oct 2009 12:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=YVESN2aL0IxQ4EFTn+WWjKKsw91PnXH+mUDhXvXgbk4=; b=rFXmMhyvFNleqsU9PxeMcJHw5HnSfKYuON7rH205xPy4R+HS+pXgDufZyH88Pdu8R6 dAMXf5dKY+oOg8K2Gj1lu4RqQeAmbQCfhDJSplNPuelHbXthR7XrT6iqM+1u0EtOaydi AzzE04qHJ9V7RjGQB8qa9FY0JDUCJpj2yrq0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=jPFtCghUBEoPb/XAQlUvydbSe5bwnFjLBEYzQ2MXxDK8dWr6uw/l+p55mddFsDOacF chCHHfh+8IDhWyF3QSDRm3z/y85BVqZB4VLzmoR4AiVO2xRzoKcli5jiXCO4i3rGQZnx w0LBg9KQC/JZtZK+xB6vjnFjRVmGYcOuafoG8= Received: by 10.86.231.13 with SMTP id d13mr330516fgh.41.1254944827742; Wed, 07 Oct 2009 12:47:07 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 4sm414094fge.7.2009.10.07.12.47.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Oct 2009 12:47:07 -0700 (PDT) Message-Id: <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Wed, 7 Oct 2009 21:46:35 +0200 References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 7, 2009, at 7:15 PM, Andre Carregal wrote: > leave luaforge.net as just a catalog and news site. This would make sense. Something more along the lines of freshmeat rather than sourceforge. If one would want to attempt such feat, would it be possible to get a data dump of the current luaforge content? From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 18:36:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97La4Hx023561; Wed, 7 Oct 2009 18:36:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0D161A686; Wed, 7 Oct 2009 18:34:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A387A1A679 for ; Wed, 7 Oct 2009 18:34:44 -0300 (BRT) Received: by vws9 with SMTP id 9so2953986vws.11 for ; Wed, 07 Oct 2009 14:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=RGtp1OecntS4O858//Vc94MCcxz0VItF44J4IaE/lJg=; b=RQEWXeNbHibDqITAGpQ+NoH3dZthAABj+PSTaoDt/GLzVwSWP4W9N/BPtVvFaw6V5+ pbBkDT1ZEZJTR02fdmb+ut/RLALmKLeqYNL1AL2FRZOZB+Laxh0x2LaNLtQ8VRtUe95Q 6L80G/XZPVGGIJNZ7in0hK4FcIKvMOHKAkubg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=WCSTSWVg2nU4rzb2YLwsq/wKKrCj8GpcJ4QL0NXmz95FDXfZ/28+gURIOvQ+TG05+l Zb2IgOTe2CCAyOP3YwB5EkvDqKFNaZ+kfhVa45ihMwkX+28wtrgsKjDmXwc03zgoyyYz bIE4HhTfQhcAz7bIha2rEuASkUVoBsfFCyC8k= MIME-Version: 1.0 Received: by 10.220.14.33 with SMTP id e33mr741261vca.39.1254951323270; Wed, 07 Oct 2009 14:35:23 -0700 (PDT) In-Reply-To: <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> Date: Wed, 7 Oct 2009 18:35:23 -0300 X-Google-Sender-Auth: 1fda9c09239375bc Message-ID: <92ab989c0910071435j1c5be712t80843b3f7fc6762@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n97La4Hx023561 On Wed, Oct 7, 2009 at 4:46 PM, Petite Abeille wrote: >> leave luaforge.net as just a catalog and news site. > > This would make sense. Something more along the lines of freshmeat rather > than sourceforge. > > If one would want to attempt such feat, would it be possible to get a data > dump of the current luaforge content? Sure, we could export things directly from postgres. But we are working now on restoring a GForge based site so everything is back asap. André From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 19:25:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97MOvch031075; Wed, 7 Oct 2009 19:24:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F8401A6A2; Wed, 7 Oct 2009 19:23:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F10771A69A for ; Wed, 7 Oct 2009 19:23:44 -0300 (BRT) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1Mvevk-0002Zc-MC for lua@bazar2.conectiva.com.br; Wed, 07 Oct 2009 15:24:20 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: Return an exit code without os.exit()? Date: Wed, 7 Oct 2009 15:24:14 -0700 User-Agent: KMail/1.9.10 References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200910071524.14934.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n97MOvch031075 On Wednesday 07, Geoff Leyland wrote: > On 7/10/2009, at 11:08 PM, Robert G. Jakabosky wrote: > > On Wednesday 07, Geoff Leyland wrote: > >> On 7/10/2009, at 10:24 PM, Jerome Vuarand wrote: > >>> 2009/10/7 Geoff Leyland : > >>>> Is there a way to return an exit code from a Lua script without > >>>> calling > >>>> os.exit()? > >>>> > >>>> I'm using luacov, and if you call os.exit(), it doesn't write any > >>>> statistics. I'd also like my script to return 1 or 0. As far as I > >>>> can > >>>> tell, the return value from a top-level script does not seem to be > >>>> used for > >>>> an exit code, but hopefully someone can tell me I'm wrong. > >>> > >>> Looking at the code in lua.c, it seems the return value of the > >>> script > >>> is ignored. It should be easy to patch if a custom Lua executable is > >>> an option to you. > >> > >> Thanks, I thought someone might say that. Shame really, it'd be a > >> nice feature to have in standard Lua (mind you this is the first time > >> it's come up in a good few years of using Lua) > > > > luacov should wrap os.exit() and dump that stats before calling the > > normal > > os.exit(). > > > > I don't know much about how luacov is implemented, but if they have > > a function > > that can be called from Lua to dump the stats, then you can write a > > custom > > os.exit() wrapper: > > > > local exit=os.exit > > os.exit = function(...) > > luacov.dumpstats() -- I don't know if a funciton like this exists. > > exit(...) > > end > > luacov does a trick with gc and a temporary file to get its save_stats > called on exit: > > local luacovlock = os.tmpname() > > function on_exit() > os.remove(luacovlock) > stats.save_stats(data, statsfile) > stats.stop_stats(statsfile) > end > > on_exit_trick = io.open(luacovlock, "w") > debug.setmetatable(on_exit_trick, { __gc = on_exit } ) > > This doesn't seem to happen on os.exit() - I guess os.exit() forces > shutdown without gc? > > I could call luacov's save_stats directly or I could use luacov's tick > facility, but I only use luacov sometimes, as lua -lluacov on the > command line, so it would be nice to have my script know nothing about > luacov, and still be able to return a 0 or 1. And it so nearly works. Put this in "luacov_on_exit.lua": --- start require('luacov') local luacovlock = os.tmpname() function on_exit() os.remove(luacovlock) stats.save_stats(data, statsfile) stats.stop_stats(statsfile) end on_exit_trick = io.open(luacovlock, "w") debug.setmetatable(on_exit_trick, { __gc = on_exit } ) local exit=os.exit os.exit = function(...)   on_exit()   exit(...) end --- end Then run your program with: lua -lluacov_on_exit script.lua -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Wed Oct 7 20:13:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n97NDgbv004824; Wed, 7 Oct 2009 20:13:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35E421A693; Wed, 7 Oct 2009 20:12:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A92131A5E7 for ; Wed, 7 Oct 2009 20:12:26 -0300 (BRT) Received: by fxm12 with SMTP id 12so5556580fxm.5 for ; Wed, 07 Oct 2009 16:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=RWANArIWEqLhLDW+ORLGd5LB0tHshgbOhEzCmJjhjoM=; b=CXNTUp271UNBTMjrFTq5UyRlQi+i393uDUivpLKeZIicWEKhauDxiU9dqop9el0yJy iUVFKJWJXbe/CULfRfqT7G4LAkDoMrMVpfOo0ZZghoHfRSuXWo9OC8V92yAByQYu4yt2 dJQLiiMKxpBWq8AOeQHrS9HYXy09lhCiSgQZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=q11cgRgffbXFlO6xRl77vyWC/FCNmvkVvwM5Qi5zEtGBp4Yt8IQO5FVBGk2v4KaztU V4O19iB/Zf0d3cpnDJeXpOTLROZ/MJRrLoLRWxVnwdqN4g0oiF8OBhb9BCgTDIWpR+bz gXuNGGL28e1mpg7ezcIw6OZzomDujKQZgv8Bw= MIME-Version: 1.0 Received: by 10.223.59.148 with SMTP id l20mr164081fah.75.1254957184541; Wed, 07 Oct 2009 16:13:04 -0700 (PDT) Date: Thu, 8 Oct 2009 00:13:04 +0100 Message-ID: Subject: Complexities of Pluto From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I believe Pluto is one of the most important general-purpose additions to Lua we have. I am currently trying to understand it a little better for what I'm trying to do. It feels to me like Pluto's basic operation is widely known and accepted, but subtleties and customisations are not often discussed, which is a shame. For example, one thing that I've noticed is that if you serialize a Lua function and its environment table is the current global scope (which is the majority of the time) Pluto will not serialize its environment - instead, it will set its environment as nil, and then when it is being unpersisted later, its environment table is set to the current global scope at the time of unpersistance. Now, this makes sense when you only want to serialize a function - otherwise, it would always drag the entire global variable scope along with it - but it can really screw things up when what you want to do is serialize the entire global variable scope, and then after deserialization, use lua_replace() to replace LUA_GLOBALSINDEX. All your Lua functions will still be getting and setting variables from the *old* global variable scope. The only way I can see to work around this is to deliberately replace the global scope with an empty table just before serialization, then restore it immediately after. That way none of the function environments will match the current global scope. Is there a better way that I have missed? It will only work for using Pluto from the API side, not the Lua interface. Secondly, I am very interested in finding a way to have a custom serialization behaviour for specific tables. I want to be able to have tables that are serialized only as the *changes* between the current version of the table, and a "pristine" version stored in the registry. (The pristine version only contains functions, so sub-tables would always be considered "changes" and get serialized, even if they existed when the pristine version was made.) I was hoping to be able to implement this using a custom __persist() metamethod that generates a table which contains only the fields that have changed from the "pristine" version (using a placeholder for nil), and then returns a closure that merges the changes table back into the pristine version to get the final restored table. And this *almost* works - except where a key or value in the "changes" table must refer directly or indirectly to the table that I am trying to serialize. For example, if I try to use this to persist the global variable scope, when it gets unpersisted again the _G field has been set to nil, and every function has lost its function environment. (By which I mean, it has been set to the global scope from before deserialization, rather than set to the new global variable scope.) I have not been able to find any workaround for this second problem. I can see why it is happening - I'm indirectly telling Pluto to serialize a table from inside its own __persist() metamethod, I suppose I'm lucky that it's just setting it to nil instead of going into an infinite loop. But I can't see any way to fix it. Has anyone had any success with doing similar things with Pluto? -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 01:55:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n984tsNN005938; Thu, 8 Oct 2009 01:55:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9E6B1A6A6; Thu, 8 Oct 2009 01:54:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81A3C1A677 for ; Thu, 8 Oct 2009 01:54:35 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 3so986qwe.11 for ; Wed, 07 Oct 2009 21:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qPsQuF5Dqeh/5YL27doc8ijEPkJzUK60YDuvUkNj68M=; b=A7YUWHI3G7tPDIM3nLYilpVrySrHXMiGPSRX3ctgBAZ3za7+A1kWcwibsmiMxz703h lSr5ut832EY1cYxauJR9sHgdRg/LOY22yRACgBfgmTKJT3J4cG45pqHrHpawFWXXVi91 gDgXyyBOJYExIs038Wexqjh+EI7rSfoxBLDQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Ofs2z7PxeIDO6XVT5NDSUu0ARcYHxofMjIiXFRHjzYNCj6RoMPMlBlbG/hlHXgSHhH uI+9WKEwtAYJFsXeugD/tujDQk6Prz1cdjXkiBtqU51DKa0JHib6N2Zsb1PBiY+ssxbJ 7bz8OhaJbSSD1CHgWdRuqoq6mfvsh1frJvUV0= MIME-Version: 1.0 Received: by 10.224.36.89 with SMTP id s25mr771481qad.5.1254977713707; Wed, 07 Oct 2009 21:55:13 -0700 (PDT) In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 08:55:13 +0400 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n984tsNN005938 > I'm really sorry for the trouble this have caused for everyone using > LuaForge services and I hope we can have everything back asap. > Meanwhile,  I'd like to know what you think about eventually moving > from this setup based on GForge to one based on something else. One > option would be to recommend that projects moved their SCM to sites > like github or Google Code and then leave luaforge.net as just a > catalog and news site. I do not have any projects hosted on LuaForge, so I do consider my opinion should have much weight in this issue. But here it is anyway. :-) I'm very sorry to say so, but current situation with LuaForge stability looks truly horrible. In my opinion, it really hurts Lua community reputation. Besides stability issues, LuaForge is seriously outdated as a service. GitHub, Google Code, Sourceforge all have much superior features (and they do not force users to use CVS). It is hard to see why anyone would use LuaForge to host their project, except maybe to emphasise that "this project belongs to Lua world". I would (partially) understand that situation, if LuaForge itself was written in Lua (which some people do assume). Then there would be sense to develop it, to bring it up to date. It'd grow a framework of libraries (or a bunch of code anyway), that would be highly useful for the community. I think, that, given the lack of resources, it would be impossible to bring LuaForge up to current project hosting de-facto standards. It would be even harder to keep it up-to date with them over the time. Unless someone is willing to give a grant on this, this would not work. It is an option to leave Lua forge as it is after restoring it. But, I think, more and more projects would leave it over time. We can see this happening already. Even Kepler is on GitHub now (http://github.com/keplerproject). Such drain is not healthy. There are a lot of great non-specialized project hosting sites. It is hard to beat them with features. It is hard to have features that would suit anyone. Some people prefer to host source code themselves even now. I'd say, LuaForge needs to be converted to aggregator for Lua-related projects. Ohloh (ohloh.com) seems to be a good model for such aggregator. Add Lua snippets, LuaRocks support, and you're almost there... My 2c. Alexander. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 01:59:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n984x1ih006177; Thu, 8 Oct 2009 01:59:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E27A1A6AE; Thu, 8 Oct 2009 01:58:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5296C1A6A7 for ; Thu, 8 Oct 2009 01:57:56 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 3so1475qwe.11 for ; Wed, 07 Oct 2009 21:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2cUjqJTkXm+TidcQ8m7re6KwZncHEhrwUGPLILQqwmI=; b=pmTBK7lvkYrI88lpFZt1K9deEwKXSlZt+HsQduEfYLbAhVtecMZFMKipuyBo4AOfjw dYTTSHSnoWKdFEF8y+69K3HzSYlU3+Z+t+PxZa7ok5gae9pwsnvg8ccCWjhMGrmxaktI rXo8atvdxsY5PmpLHvHtM0ijl0ooOjzbxJCzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fQ0ukE9GUTjNMXwXI0IqYjO7M4ZlvRLomfKJphFcvXWe4yqbTmsn+NxzXUH/V+avqs h5+ACbOITleCF0gXcs3J/JfTQJ/+rxWtY8NZCAZp/sz7NqBH/F7ilZRQ/GgCxHuXrbv7 b+jFl5XehTQ6PpQfdZ0JTFN7HDHG6W2pbiNxI= MIME-Version: 1.0 Received: by 10.224.88.146 with SMTP id a18mr712704qam.257.1254977915428; Wed, 07 Oct 2009 21:58:35 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 08:58:35 +0400 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I do not have any projects hosted on LuaForge, so I do consider my > opinion should have much weight in this issue. But here it is anyway. > :-) This should be read as "I do *not* consider". Sorry. :-) Alexander. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 02:08:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9858L2h007036; Thu, 8 Oct 2009 02:08:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 271FC18FCC; Thu, 8 Oct 2009 02:07:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E58EF18F70 for ; Thu, 8 Oct 2009 02:07:16 -0300 (BRT) Received: by iwn8 with SMTP id 8so3236784iwn.33 for ; Wed, 07 Oct 2009 22:07:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.147 with SMTP id u19mr1603828ibr.27.1254978475050; Wed, 07 Oct 2009 22:07:55 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 02:07:55 -0300 Message-ID: <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 1:55 AM, Alexander Gladysh wrote: > There are a lot of great non-specialized project hosting sites. It is > hard to beat them with features. It is hard to have features that > would suit anyone. Some people prefer to host source code themselves > even now. I'd say, LuaForge needs to be converted to aggregator for > Lua-related projects. Ohloh (ohloh.com) seems to be a good model for > such aggregator. Add Lua snippets, LuaRocks support, and you're almost > there... I agree that luaforge must work with LuaRocks and support Lua snippets. Having Google Code or similar do most of the hosting while luaforge acts as an "official" index would be a great push in the direction of standardization of our libraries (even if the Lua authors do not officially recognize them). Also, we should officially discourage duplication of libraries. It's confusing for the user. As an example, there were at least two signal handler libraries written and distributed on luaforge (disclaimer: I was one of those authors). This is necessary if we want to work with LuaRocks; it makes no sense to have multiple libraries that do the same thing (with some minor variations that could be concatenated into a single library). Thanks Andre for all your hard work on this! -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 02:28:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n985SPEq008592; Thu, 8 Oct 2009 02:28:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C34D11A6B4; Thu, 8 Oct 2009 02:27:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BA451A6AA for ; Thu, 8 Oct 2009 02:27:13 -0300 (BRT) Received: by iwn8 with SMTP id 8so3242332iwn.33 for ; Wed, 07 Oct 2009 22:27:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.5.90 with SMTP id 26mr1591397ibu.42.1254979670168; Wed, 07 Oct 2009 22:27:50 -0700 (PDT) In-Reply-To: <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> Date: Thu, 8 Oct 2009 01:27:50 -0400 X-Google-Sender-Auth: c14c50a1026ebfd1 Message-ID: Subject: Re: LuaForge is down and will be for some time From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Oct 7, 2009 at 3:28 PM, Petite Abeille wrote: > On Wed, Oct 7, 2009 at 2:34 PM, David Manura wrote: >> However, I do continue to advocate creating some >> type of global catalog site for Lua [1] along the lines >> of Perl's search.cpan.org and cpantesters.org but >> indexing LuaRocks repositories and possibly other >> Lua code sources. > I was more wondering why David is not doing it giving > all his advocacy :) Here's a rough draft (crawler + front-end), after a few hours of Perl coding: http://math2.org/luasearch-2/ "LuaSearch version 2" The basic idea is that it would index these Lua source repositories: - http://luadist.org/dists/ (LuaDist/CMake) - http://luarocks.luaforge.net/rocks/ (LuaRocks/rock) - svn://svn.debian.org/pkg-lua/packages/ (debian/dpkg) - possibly others, including plain tarballs and modules on the wiki Preferably it would also render the docs nicely and interlink them, like the Perl/Python/Ruby/Java docs, and report on automated test runs and other interesting things. The www.ohloh.net site mentioned by Alexander offers some ideas. However, some of these things would be more easily be achieved if there were more standardization in package structure (e.g. documentation conventions, automated test suites, and a standard way of mapping module names to file names). The packaging efforts above are slowly pushing in that direction, but it will take time. The above is just a proof of concept. There's many things that should be done to make this more production grade, such as add a search engine as was done on LuaSearch version 1. I'm not necessarily offering to maintain the above since I'm occupied on some other Lua projects, so I'm hoping others would take the lead. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 02:28:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n985StOY008757; Thu, 8 Oct 2009 02:28:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB7531A6EF; Thu, 8 Oct 2009 02:27:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 500A71A6AA for ; Thu, 8 Oct 2009 02:27:48 -0300 (BRT) Received: by fxm12 with SMTP id 12so5690122fxm.5 for ; Wed, 07 Oct 2009 22:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=4TVaQowamWnYiAIMf9p+SO7rrdQBZmJsIl6j43/X+Nw=; b=m7Dm/1b3coTD6IBnOhb/g8j/IIayyok6TlPOYOzYCI/qGR6O58Po2iOAmCYXliJuIH nA/EkYgolqtnxG+PUp24e0+htc72CJzljhtvJ2lCM07MSHvpfoOK27iNAuS5lngLyr/Z VuXDYgGhPJe7SqfboqK/Dc61ecozbcJ676YxM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=KukLFm+ELctSP8UDSIdIitxqKpFkG3Tcv7E9HUrLhw1vlZD5ZdZNM5U5VtrHbhxGN+ PC/aBnza0wKGjvx1bSxYuh2ZV7arLtx5njmLnPlBUiPpd4FP6IDj/1lWie0a4pvqlFgW YTNyrZrCO+Yh+0xLFvWmIe77o/IRz1xQ6KdRY= MIME-Version: 1.0 Received: by 10.204.156.28 with SMTP id u28mr664780bkw.74.1254979706461; Wed, 07 Oct 2009 22:28:26 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 01:28:26 -0400 X-Google-Sender-Auth: 63a915c0b2cf07f4 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > even now. I'd say, LuaForge needs to be converted to aggregator for > Lua-related projects. Ohloh (ohloh.com) seems to be a good model for > such aggregator. I think this is what Andre meant when he suggested to "leave luaforge.net as just a catalog and news site". Though we were talking of something more like Freshmeat / Python Cheese Shop in mind - without so much of Ohloh's focus on ranking and evaluating. Under this plan, LuaForge would be a place to learn what modules are available, to check what's new, and to get the code. Those interested in getting involved with a particular project, file bugs, etc. will then follow a link to the project's website. I would also suggest that subdomains of luaforge.net remain available for the projects, including new ones, but on a "bring your own hosting" basis. - yuri From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 02:42:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n985gbUA009959; Thu, 8 Oct 2009 02:42:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 552CB1A6E0; Thu, 8 Oct 2009 02:41:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh07.mail.saunalahti.fi (emh07.mail.saunalahti.fi [62.142.5.117]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7A9F1A677 for ; Thu, 8 Oct 2009 02:41:29 -0300 (BRT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 7AE8118D2B3 for ; Thu, 8 Oct 2009 08:42:06 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A0028C5EDEE; Thu, 08 Oct 2009 08:42:06 +0300 Received: from [192.168.1.3] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 6CFD6158A6C for ; Thu, 8 Oct 2009 08:42:03 +0300 (EEST) Message-Id: <0B0CF551-CA9E-4F22-B0DC-A466C6B5424B@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaLanes and Snow Leopard OSX 10.6 Date: Thu, 8 Oct 2009 08:42:03 +0300 References: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The fink Lua packages (lua51 and lua51-dev) are now up-to-date also in "stable". http://pdb.finkproject.org/pdb/package.php/lua51 This means they are good for multithreading. -asko Asko Kauppi kirjoitti 5.10.2009 kello 22:09: > > Your problems should be due to having two separate copies of Lua > core in the system. Try to make sure lua the command line > executable is really dynamically linked to the lua shared library > that extension modules use. > > There may also be other ways to guarantee this singularity of the > Lua core. If you have two cores and you do multiple threads, OS X > gets confused like you showed. > > For users of Lua via the fink distribution, make sure your package > is >= 5.1.1-14. That has the necessary changes. Unstable has a > recent one but stable still lags behind in 5.1.1-4 or so. Lanes does > not work fine with that. > > - Asko > > > > Stefan Marr kirjoitti 5.10.2009 kello 14:03: > >> Hi Asko, >> Hi list: >> >> I tried to experiment with LuaLanes, but have some problems on my >> Snow Leopard installation. >> >> Every time I try to run one of the test I get an malloc error like >> this: >> >> lanes-2.0.3$ LUA_CPATH=./src/?.so LUA_PATH="src/?.lua;./ >> tests/?.lua" lua tests/recursive.lua >> depth: 0 1 2 3 4 5 6 7 8 9 10 11 >> lua(61739,0x7fff71085be0) malloc: *** error for object 0x1000ad1a0: >> pointer being freed was not allocated >> *** set a breakpoint in malloc_error_break to debug >> >> >> I tried to use luarocks from MacPorts to install lanes, but there >> is no rock spec. for the latest version, and for the 2.0 version, >> the download is gone, so it just failed installing. >> >> Furthermore, I followed the hints in the README to compile Lua >> with LUA_USE_DLOPEN and LUA_USE_POSIX as well as using a dylib for >> the core and library code, as described. >> However, I am still ending up with the error given above. >> >> Any thoughts how this could be fixed? >> >> Many thanks and best regards >> Stefan >> >> BTW: On an Ubuntu, it works fine... >> >> >> >> >> -- >> Stefan Marr >> Software Languages Lab >> Former Programming Technology Lab >> Vrije Universiteit Brussel >> Pleinlaan 2 / B-1050 Brussels / Belgium >> http://prog.vub.ac.be/~smarr >> Phone: +32 2 629 3956 >> Fax: +32 2 629 3525 >> > From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 03:24:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n986O1tv013815; Thu, 8 Oct 2009 03:24:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F422A1A6B2; Thu, 8 Oct 2009 03:22:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2039B1A664 for ; Thu, 8 Oct 2009 03:22:46 -0300 (BRT) Received: by qyk14 with SMTP id 14so514725qyk.11 for ; Wed, 07 Oct 2009 23:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Q4FElAtyxsWfBFPEJ3mYQO/1LpUkQoVeYhKG3FAZYYo=; b=pDqWoGamPA4TxtdPWZ0et00BPfU6ixw7G67gexUVFkPaDZySv8zZ+CUe8HhPCj8wTU Qf+Msq2hJfRGl3f0X7tn7GYF4FpIXzEK05ZzzxMWXrXWM+GQtfDcu4Ju9mrg9yjLwSTl zkV1/jjg/dPnNgNf8OkXzlQxAgKcPIA4DxvTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=O/Yb6XBddT/WO9G2AWXhu5BeIsvi5kBQBiwItSxqLRwp93IlejETf49j8VaziE0oRt ONmrxEkOXhDZJdJTMze26VHUk7fIWI4ZtWn+rE7UmLEoiboFg7+nO6fIaUfygfOkJ1VG +IHN5H7UrJnYOBDhR7hsbs4hjRdO4QOGDyHlw= MIME-Version: 1.0 Received: by 10.224.60.9 with SMTP id n9mr803710qah.31.1254983005300; Wed, 07 Oct 2009 23:23:25 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 03:23:25 -0300 X-Google-Sender-Auth: 3a67fd5a400e942a Message-ID: <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n986O1tv013815 I just want to mention that moving Kepler to github was not a renunciation of LuaForge, I think having a central index of Lua libraries is very important, and I am not the only one that thinks this can be done with a much simpler platform than Gforge. More importantly, I think it can be done with a Lua-based platform, probably something based on Sputnik. André has been warning for some time that LuaForge was pretty much on life support, and this crisis is a good time for the community to move on; there are plenty of options for online SCM repositories, issue trackers, mailing lists... after LuaForge gets back online I am infavor of setting a grace period for anyone to move those parts of their projects elsewhere, and bootstrap a new site with the catalog part. I also spoke with Hisham that now is a great time to move the main LuaRocks repository to luarocks.org, with the release of LuaRocks 2.0 imminent. He agrees and assured me that he was going to do that. -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br On Thu, Oct 8, 2009 at 1:55 AM, Alexander Gladysh wrote: >> I'm really sorry for the trouble this have caused for everyone using >> LuaForge services and I hope we can have everything back asap. > >> Meanwhile,  I'd like to know what you think about eventually moving >> from this setup based on GForge to one based on something else. One >> option would be to recommend that projects moved their SCM to sites >> like github or Google Code and then leave luaforge.net as just a >> catalog and news site. > > I do not have any projects hosted on LuaForge, so I do consider my > opinion should have much weight in this issue. But here it is anyway. > :-) > > I'm very sorry to say so, but current situation with LuaForge > stability looks truly horrible. In my opinion, it really hurts Lua > community reputation. > > Besides stability issues, LuaForge is seriously outdated as a service. > GitHub, Google Code, Sourceforge all have much superior features (and > they do not force users to use CVS). It is hard to see why anyone > would use LuaForge to host their project, except maybe to emphasise > that "this project belongs to Lua world". > > I would (partially) understand that situation, if LuaForge itself was > written in Lua (which some people do assume). Then there would be > sense to develop it, to bring it up to date. It'd grow a framework of > libraries (or a bunch of code anyway), that would be highly useful for > the community. > > I think, that, given the lack of resources, it would be impossible to > bring LuaForge up to current project hosting de-facto standards. It > would be even harder to keep it up-to date with them over the time. > Unless someone is willing to give a grant on this, this would not > work. > > It is an option to leave Lua forge as it is after restoring it. But, I > think, more and more projects would leave it over time. We can see > this happening already. Even Kepler is on GitHub now > (http://github.com/keplerproject). Such drain is not healthy. > > There are a lot of great non-specialized project hosting sites. It is > hard to beat them with features. It is hard to have features that > would suit anyone. Some people prefer to host source code themselves > even now. I'd say, LuaForge needs to be converted to aggregator for > Lua-related projects. Ohloh (ohloh.com) seems to be a good model for > such aggregator. Add Lua snippets, LuaRocks support, and you're almost > there... > > My 2c. > Alexander. > From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 03:35:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n986ZC8c014814; Thu, 8 Oct 2009 03:35:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15DB71A701; Thu, 8 Oct 2009 03:34:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (unknown [203.59.1.104]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F09CD1A6B1 for ; Thu, 8 Oct 2009 03:34:07 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai8BALckzUrLO616/2dsb2JhbAAI2EeEKgSCLg X-IronPort-AV: E=Sophos;i="4.44,524,1249228800"; d="scan'208";a="471775752" Received: from unknown (HELO [10.1.1.2]) ([203.59.173.122]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 08 Oct 2009 14:34:44 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1075.2) Subject: Re: LuaForge is down and will be for some time From: Jacques Chester In-Reply-To: <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> Date: Thu, 8 Oct 2009 14:34:43 +0800 Content-Transfer-Encoding: 7bit Message-Id: <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1075.2) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 08/10/2009, at 2:23 PM, Fabio Mascarenhas wrote: > I just want to mention that moving Kepler to github was not a > renunciation of LuaForge, I think having a central index of Lua > libraries is very important, and I am not the only one that thinks > this can be done with a much simpler platform than Gforge. More > importantly, I think it can be done with a Lua-based platform, > probably something based on Sputnik. For contrast-and-compare purposes, you may be interested to look at how the Lisperati do it. The de facto packaging system for Common Lisp is ASDF. I vaguely recall it finding download URLs by looking at wiki pages, or something like that. In any case it would be possible to embed "current download" information in a wiki page with meta tags, or using plain HTML with an agreed CSS 'microformat'. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 04:08:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9878plr018983; Thu, 8 Oct 2009 04:08:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F23D1A704; Thu, 8 Oct 2009 04:07:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8755D186C1 for ; Thu, 8 Oct 2009 04:07:36 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id AA30E997B9 for ; Thu, 8 Oct 2009 03:08:14 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 08 Oct 2009 03:08:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=lTTQH2sw/Ue0XejjA2jgufPyRtY=; b=anP4spJJTIJPhRT9aJ9b1i7SrYlAR/goIPA6swQxEDqE6epFMf7e89FVwppiEdD99Aeoxa4mCn3PgmqC19vMHD2Bmm005SYt0rOL2lvnUrGCcpi6OF6/BlyuQoeqC/4KgjEJ1utv1mAeA2H9DIqo8WCqMWBopXu6cCmyf9Tpkjc= X-Sasl-enc: EAH6OuhoDkEr2itxj73tqaQnwblBEqf8Z7Wm4+7XaJVI 1254985694 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id EAE794DD9 for ; Thu, 8 Oct 2009 03:08:13 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Return an exit code without os.exit()? From: Geoff Leyland In-Reply-To: <200910071524.14934.bobby@sharedrealm.com> Date: Thu, 8 Oct 2009 20:07:39 +1300 Content-Transfer-Encoding: 7bit Message-Id: <7B7C084C-25BD-4CBD-B699-8AFD231BDC95@fastmail.fm> References: <360BD8D8-19D3-4F28-B967-846B87C4F1B1@fastmail.fm> <200910070308.05491.bobby@sharedrealm.com> <200910071524.14934.bobby@sharedrealm.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/10/2009, at 11:24 AM, Robert G. Jakabosky wrote: > Put this in "luacov_on_exit.lua": > --- start > require('luacov') > local luacovlock = os.tmpname() > function on_exit() > os.remove(luacovlock) > stats.save_stats(data, statsfile) > stats.stop_stats(statsfile) > end > on_exit_trick = io.open(luacovlock, "w") > debug.setmetatable(on_exit_trick, { __gc = on_exit } ) > local exit=os.exit > os.exit = function(...) > on_exit() > exit(...) > end > --- end > > Then run your program with: > lua -lluacov_on_exit script.lua Yeah, that's right. For some reason I was stuck thinking I didn't want to change lua, but I've already made lots of changes to luacov. Thanks for pointing that out. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 04:43:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n987hEV8022672; Thu, 8 Oct 2009 04:43:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 942AD1A70C; Thu, 8 Oct 2009 04:42:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 337ED1A6B6 for ; Thu, 8 Oct 2009 04:41:58 -0300 (BRT) Received: by yxe36 with SMTP id 36so6803139yxe.11 for ; Thu, 08 Oct 2009 00:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ZjlACxrwKv96ie8RiHTWwPwtRung/MLz/ErBBieorP8=; b=w+ON+0W0aIeLo0ExJem2Cvmd26/wKBLu1RH3jmS3QGSsoouj9mOtEaqYWN6TcsHwtZ 7zPGkHSTXIzQ2PwCPTDID/vjWqL77n+Oacv8WHnTZFdxZO7JOdemYWojDAxnIlo+QwcO J5aro+14JoChoClnjOmfpWC6QG69bjpu41oxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Xftrqg31NDfipjYjh2BbW0C9+GjsRPphIpop652RBIwCG63kw/D785B7H57RWiIu0s HmNEvxpJ22Gna1YNmmLhkqcpBCfOHDOEWY+W3KlOkBfPg2XInhZO+mr1Ox00WoeToX/U bakEE5+k03cQ+KPug7TGsr7VYapgg1AGXogyU= MIME-Version: 1.0 Received: by 10.150.43.17 with SMTP id q17mr1760748ybq.197.1254987755731; Thu, 08 Oct 2009 00:42:35 -0700 (PDT) Date: Thu, 8 Oct 2009 00:42:35 -0700 Message-ID: <1079b050910080042m38c212e4l92896862ba76b2b2@mail.gmail.com> Subject: lua-cairo From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean since lua forge is down ... anyone have a recent copy of lua cairo handy? thanks, wes From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 05:05:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9885KNg024485; Thu, 8 Oct 2009 05:05:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD97E186C1; Thu, 8 Oct 2009 05:04:18 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E21C6186A1 for ; Thu, 8 Oct 2009 05:04:07 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MvnzR-0002fV-UL for lua@bazar2.conectiva.com.br; Thu, 08 Oct 2009 10:04:45 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Oct 2009 10:04:45 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Oct 2009 10:04:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: lua-cairo Date: Thu, 08 Oct 2009 10:03:09 +0200 Lines: 12 Message-ID: References: <1079b050910080042m38c212e4l92896862ba76b2b2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <1079b050910080042m38c212e4l92896862ba76b2b2@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 08/10/2009 09:42, Wesley Smith wrote: > since lua forge is down ... anyone have a recent copy of lua cairo handy? Recent, I don't know, I have 1.8.4.10 (src and win32), dated December 2008. Resp. 67 and 558KB. I will send it by private mail. Tell me if you need the Win32 version. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 10:07:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98D7Rp5027476; Thu, 8 Oct 2009 10:07:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A838A1902A; Thu, 8 Oct 2009 10:06:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4EBC18FAA for ; Thu, 8 Oct 2009 10:06:07 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 3D5CFE20B6 for ; Thu, 8 Oct 2009 15:06:45 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wPVvOQHMsJ1g for ; Thu, 8 Oct 2009 15:06:42 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 90A90E20B9; Thu, 8 Oct 2009 15:06:42 +0200 (CEST) Date: Thu, 8 Oct 2009 15:06:42 +0200 From: Ico To: lua@bazar2.conectiva.com.br Subject: Request: luamatrix Message-ID: <20091008130642.GR23010@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi, With LuaForge down: does anybody here have a copy of luamatrix lying around which he/she can mail to me ? Thanks, Ico -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 10:53:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98DrVZZ004657; Thu, 8 Oct 2009 10:53:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EF6F19235; Thu, 8 Oct 2009 10:52:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59A2819198 for ; Thu, 8 Oct 2009 10:52:06 -0300 (BRT) Received: by bwz22 with SMTP id 22so5279062bwz.5 for ; Thu, 08 Oct 2009 06:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3qTl00jgXo/HJb64HHI8hGFeEVLt1n+2azbspKTA7lo=; b=GfK9e0o50s5CP6ajnG0FYNP0qaU7PIWpII5KIn45jp1qCr2xxcSSDP9goMcMWCI5nB G0SniRKVTy0Mp7FoD1FYhebW5w8iMCdTkQ0FXYilz8QbX7OVJ8nNoYO/wdJb/cSe2NOW HdVjzMsWmzQjIhzt7lK1IrzcbOEh+/kzvHxfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tmOzTyD6UYBdoJezWHgF1qPTGKOaq2WNNXSRD/aDR3/JKlnl2rikVtIPU6DsW5KXvt kW8XsOSkFMM6MSMMdF6CXaPfws2c6JcJeBlRTwaACh5OK1dL5p13Rt7GTkfzuoWCUxmt b36uOspbCAZWawypkbDf+jO2AXdtO4/GY+38s= MIME-Version: 1.0 Received: by 10.223.4.27 with SMTP id 27mr159283fap.48.1255009963447; Thu, 08 Oct 2009 06:52:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Oct 2009 14:52:43 +0100 Message-ID: Subject: Re: Complexities of Pluto From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 12:13 AM, Duncan Cross wrote: >(feels like bad form to quote myself, so - entirely snipped) Another subtle thing to watch out for is that, if you want to serialize the global variable scope, it is easy to forget about the string metatable which will still have its __index field set to the *old* string table - so if you add custom functions to string, and want to call them as methods, they seem to disappear after serialization and deserializatin. The solution is to serialize not the global variable scope itself but a temporary table that contains it, as well as the string metatable, and possibly other base-type metatables if you have set them. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 10:54:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98DsQRd004977; Thu, 8 Oct 2009 10:54:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FFFE1929D; Thu, 8 Oct 2009 10:52:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD3B219294 for ; Thu, 8 Oct 2009 10:52:20 -0300 (BRT) Received: by iwn5 with SMTP id 5so3174532iwn.11 for ; Thu, 08 Oct 2009 06:52:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.227 with SMTP id v35mr45818ibr.18.1255009978298; Thu, 08 Oct 2009 06:52:58 -0700 (PDT) In-Reply-To: <20091008130642.GR23010@pruts.nl> References: <20091008130642.GR23010@pruts.nl> Date: Thu, 8 Oct 2009 09:52:58 -0400 X-Google-Sender-Auth: 0e2e1bd0e6a06fe0 Message-ID: Subject: Re: Request: luamatrix From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 9:06 AM, Ico wrote: > With LuaForge down: does anybody here have a copy of luamatrix lying > around which he/she can mail to me ? Download and unzip the "luamatrix-0.2.8.dist" file on http://luadist.org/dists/LuaModules/ or http://math2.org/luasearch-2/ . From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 10:57:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Dv3Mr005623; Thu, 8 Oct 2009 10:57:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 519DD1A6C0; Thu, 8 Oct 2009 10:56:00 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 836CE1A6AB for ; Thu, 8 Oct 2009 10:55:55 -0300 (BRT) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 8608FE20A9 for ; Thu, 8 Oct 2009 15:56:34 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PxWibIHpvq4O for ; Thu, 8 Oct 2009 15:56:31 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 90935E20B9; Thu, 8 Oct 2009 15:56:31 +0200 (CEST) Date: Thu, 8 Oct 2009 15:56:31 +0200 From: Ico To: Lua list Subject: Re: Request: luamatrix Message-ID: <20091008135631.GT23010@pruts.nl> References: <20091008130642.GR23010@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-08 David Manura wrote : > On Thu, Oct 8, 2009 at 9:06 AM, Ico wrote: > > With LuaForge down: does anybody here have a copy of luamatrix lying > > around which he/she can mail to me ? > > Download and unzip the "luamatrix-0.2.8.dist" file on > http://luadist.org/dists/LuaModules/ or http://math2.org/luasearch-2/ Works, thanks for the tip! -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 11:32:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98EWmjB015961; Thu, 8 Oct 2009 11:32:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3F3E1A6DC; Thu, 8 Oct 2009 11:31:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD7F01A6BC for ; Thu, 8 Oct 2009 11:31:32 -0300 (BRT) Received: by ywh15 with SMTP id 15so5753597ywh.5 for ; Thu, 08 Oct 2009 07:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=85JVNNP135El8dhFbDkkkufysgmQjN+55KavZOyul0k=; b=gvr/iItmPmEsPvuGCKGDXjffdEEBfsBpINRrXww1co/76o7MPZXW9oTdImqooJvooW KuECmcTCVGZxyTuYFhZZll2qSNUmWIJHV/3Z0DQhf1ZeC8aKPNLPwDn9iXt37JMX3BQ2 /VjJNVpfODT41PP0w0VuG10Xze+5EgA57VKWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=TQ9fU+ep1iHSipwosv3RIfoVreBwLcGKaAmH8ctDtBxbNhkLON8Ti9RpbQuyXLOw6K VF1zpLn8eSR5ld+6+oxYn+nHgga0Xdea2v5KG+LAhSeVOMQvW3NmLo/0WEKmrknAnYDM Hju7mFhL0SV/49MixJwjpYN6Q9/B1lwNbTY8I= MIME-Version: 1.0 Received: by 10.150.22.2 with SMTP id 2mr2429671ybv.293.1255012332045; Thu, 08 Oct 2009 07:32:12 -0700 (PDT) From: RJP Computing Date: Thu, 8 Oct 2009 10:31:51 -0400 X-Google-Sender-Auth: 8ceb9aa921da2804 Message-ID: Subject: Penlight docs To: Lua list Content-Type: multipart/alternative; boundary=000e0cd62c903d880104756d543c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd62c903d880104756d543c Content-Type: text/plain; charset=ISO-8859-1 Steve and all, I am using penlight a bunch in my current application and with LuaForge down is there another location I can get the docs. Thanks. -- Regards, Ryan --000e0cd62c903d880104756d543c Content-Type: text/html; charset=ISO-8859-1 Steve and all,

I am using penlight a bunch in my current application and with LuaForge down is there another location I can get the docs. Thanks.
--
Regards,
Ryan
--000e0cd62c903d880104756d543c-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 11:37:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Eb2Mq016764; Thu, 8 Oct 2009 11:37:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 268081A6DF; Thu, 8 Oct 2009 11:35:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C11C1A6BC for ; Thu, 8 Oct 2009 11:35:47 -0300 (BRT) Received: by yxe37 with SMTP id 37so6141354yxe.33 for ; Thu, 08 Oct 2009 07:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=W9ySylqpvMXmarJ1Ew8wvMOkyN5lOQbbR29XDxwjDhA=; b=nrVivFucy1bu9AwhrjCASBPDXA/YWhTHD++YP44JBwhVvPUXvMtxcr4IeT/TXMty7O laEa+WhQe4wbYR7ly2xOsdHIGexEigwP9H3Y/AJwYx1haj/5WxaGvse5Wzex6rlgp2vS MFvMx0IIZyR+auMXtRVY5dAS5kVPK5gBl+m9c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=V1Ipi8AKldTTBsq+Mvgn2RHtQVQnJPxT8VW+tBb129yygpLaRGz95uPtuqpqGYDD99 YLJRyoBTDyUIo7FZ9CjPmzeIGihgVrPtvVq8sbf3N5JkqGMpDYPO84zOFAA5TNOhMabz 1jvrGaWb9BrJvIMLG/YGTV0JrQdTY0G95cD1U= MIME-Version: 1.0 Received: by 10.150.163.1 with SMTP id l1mr2440361ybe.204.1255012586123; Thu, 08 Oct 2009 07:36:26 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Thu, 8 Oct 2009 10:36:06 -0400 X-Google-Sender-Auth: 0073d1ecf922b78f Message-ID: Subject: [Kepler] Using Orbit to start a download To: Lua list Content-Type: multipart/alternative; boundary=000e0cd4d3226272c304756d63f4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd4d3226272c304756d63f4 Content-Type: text/plain; charset=ISO-8859-1 Since LuaForge is down I hope it is ok for me to ask Kepler and Orbit questions here. Hi, I am using Orbit in an application and I want to create a URL map to download files, like this "http://somesite.com/download/filename.zip". How do I make the browser think that it is time to download the file. I Googled and found a PHP article where it was using header(). How can I do this in Orbit. Thanks. -- Regards, Ryan --000e0cd4d3226272c304756d63f4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Since LuaForge is down I hope it is ok for me to ask Kepler and Orbit quest= ions here.

Hi,

I am = using Orbit in an application and I want to create a URL map to download fi= les, like this "http://somesite.com/download/filename.zip". How = do I make the browser think that it is time to download the file. I Googled= and found a PHP article where it was using header(). How can I do this in = Orbit. Thanks.
--
Regards,
Ryan
--000e0cd4d3226272c304756d63f4-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 11:37:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Ebgca016920; Thu, 8 Oct 2009 11:37:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B20B1A6EC; Thu, 8 Oct 2009 11:36:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D065E1A6E2 for ; Thu, 8 Oct 2009 11:36:22 -0300 (BRT) Received: by gxk4 with SMTP id 4so6987997gxk.8 for ; Thu, 08 Oct 2009 07:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=t4A/9xfNaq+bDBjWGIL+ro2HhGTSekdgONqZ4xd+tDA=; b=cQlL5QALiPDziWdzGZvgG3tYt/TL4LsAz/V/LLx7PSadML/GTV7dRiBUg+qEV+nY0M 9iY1+Xaj1KZRfGIOPW8AZ6XMWqJXdN+nrDWrLBpt3//pV1yv3HghC66cFv85b364fXdg 0a28GPQ2TQxExGPn+x/86401nmlWPBjeWhlPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=IcnoiGpjuFwp7a7X9uP8JyrBEBeci1cGFUL4njzHnIipycR9UNFb2XF1DnTcoudnBj aCg6UoZO14j1Pg3Z/OwegiEjgGBq6ns36EPi5tfe4u5/oLDuKbdRO60Lk9QSmbpsLCB4 uiJ8wMRecQb0OopMSuR6pzwKzvk7xiAKqq3r8= MIME-Version: 1.0 Received: by 10.150.44.27 with SMTP id r27mr2460572ybr.263.1255012622133; Thu, 08 Oct 2009 07:37:02 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Thu, 8 Oct 2009 10:36:42 -0400 X-Google-Sender-Auth: 066b02462bc10688 Message-ID: Subject: [Kepler] Orbit htmlify() beautification To: Lua list Content-Type: multipart/alternative; boundary=000e0cd59c9687e9f604756d65ae X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd59c9687e9f604756d65ae Content-Type: text/plain; charset=ISO-8859-1 Since LuaForge is down I hope people don't mind me asking Kepler questions here. Hi, I was wondering if there is a way to beautify the html output from orbit.htmlify(). I am reviewing the HTML as I debug and it would be really helpful if it could be a little better. P.S. I searched and found a piece of Lua code that beautifies html so if that would be handy let me know. I made the code work and made it into a module. It is licensed under MIT. -- Regards, Ryan --000e0cd59c9687e9f604756d65ae Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Since LuaForge is down I hope people don't mind me asking Kepler questi= ons here.

Hi,

I was = wondering if there is a way to beautify the html output from orbit.htmlify(= ). I am reviewing the HTML as I debug and it would be really helpful if it = could be a little better.

P.S. I searched and found a piece of Lua code that beautifies html so i= f that would be handy let me know. I made the code work and made it into a = module. It is licensed under MIT.


--
Regards,
Ryan
--000e0cd59c9687e9f604756d65ae-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 11:42:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98EgWMu018118; Thu, 8 Oct 2009 11:42:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DADF91A713; Thu, 8 Oct 2009 11:41:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32E8E1A6E2 for ; Thu, 8 Oct 2009 11:41:21 -0300 (BRT) Received: by qyk26 with SMTP id 26so5292113qyk.5 for ; Thu, 08 Oct 2009 07:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=BSLtjU68DDLEQr5Fml5J8m2LZsW+uyIV3cdF7MBlqt0=; b=Li6eBjyNEdQUNMcwHiwdFx+Upx4OFglTYZ1lRhJO67lJOMOlTUfkVxcNZys+CCc0vA 6e0jQ4N8/Bk3nBTuEeAioF+3dIOmonDDpe0YAxKgUb2wWREVnYa9KwYJs9E2PSMKbpFv uz8aKV1VXcfbB2vFTzuswe64D3XAAr8r0PzvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=GqR1YSN8vzPhje/FofzYzTSjbLXdS+ZSdOBBVS+4hR2HEu7oXIBbeYBwykGRhUJ/G6 hkBvfUAkCyJFfbYS6Yr4XU/eEp2oZ4i6YU/R+iInoLXOAsLr1Hl1f1iOtMyIySI/oI7P SE4SBI6zf6Fbjht4DhDBPZkn/6aG0I+FYt+9Y= MIME-Version: 1.0 Received: by 10.224.89.135 with SMTP id e7mr1228309qam.116.1255012918410; Thu, 08 Oct 2009 07:41:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Oct 2009 11:41:58 -0300 X-Google-Sender-Auth: 2947c084702ab219 Message-ID: <7913df4d0910080741p1a5c12f8qfe7d686740669d2e@mail.gmail.com> Subject: Re: [Kepler] Using Orbit to start a download From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi RJP, You can use the serve_static method of your application object to send a file to the client. It sets the content-type based on the extension of the file you are sending. The syntax is orbit_app:serve_static(web, path_to_file) It returns the contents of the file, so just tail-call it in your handler. serve_static also supports X-SendFile, if you set use_xsendfile to true in your application object. -- Fabio Mascarenhas, Lablua http://www.lua.inf.puc-rio.br On Thu, Oct 8, 2009 at 11:36 AM, RJP Computing wrote: > Since LuaForge is down I hope it is ok for me to ask Kepler and Orbit > questions here. > > Hi, > > I am using Orbit in an application and I want to create a URL map to > download files, like this "http://somesite.com/download/filename.zip". How > do I make the browser think that it is time to download the file. I Googled > and found a PHP article where it was using header(). How can I do this in > Orbit. Thanks. > -- > Regards, > Ryan > From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 11:49:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98EnnF8019702; Thu, 8 Oct 2009 11:49:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E53B0188DA; Thu, 8 Oct 2009 11:48:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51C64188AE for ; Thu, 8 Oct 2009 11:48:40 -0300 (BRT) Received: by iwn5 with SMTP id 5so3206688iwn.11 for ; Thu, 08 Oct 2009 07:49:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.75 with SMTP id o11mr2593880ibr.55.1255013358893; Thu, 08 Oct 2009 07:49:18 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Oct 2009 10:49:18 -0400 X-Google-Sender-Auth: c6e85087ec0c81a4 Message-ID: Subject: Re: Penlight docs From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 10:31 AM, RJP Computing wrote: > I am using penlight a bunch in my current application and with LuaForge down > is there another location I can get the docs. In http://math2.org/luasearch-2/ click penlight and browse into the docs folder. This is 0.7.2 (is that the latest?) From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 12:17:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98FHGaB025735; Thu, 8 Oct 2009 12:17:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68BF518B06; Thu, 8 Oct 2009 12:16:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19A7318A54 for ; Thu, 8 Oct 2009 12:15:54 -0300 (BRT) Received: by ywh15 with SMTP id 15so5792759ywh.5 for ; Thu, 08 Oct 2009 08:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=ynWUddGGDvmSYdSpH57bGkgfoR5D02hp4gs+CLqTSJw=; b=bAnGNAsG/YkpD0+NDyYRhDGNpAMobzM1JNPZD8JLQR1AQiAQH1YHokA9OMMJzxG6M/ UWFDCMOk1zdr7+Wr5JKcbAr5DXje9EaRfl8wPhdeCzwk66G7/X3FwECZhwolcu+3caB7 ioMBIBPkOEAp1DDD2+7AZCAgKM6RwPp7dK0n4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=F07kYHH9dmL1rcZot1JT7njpc5d5Y7PEYOY+P/KNRWDnLe5kUqwnz2D01ITMUNAf+S Dgh4gi/8Tsu2KBeZK0RDhvp2nbMaWCoZwJaeX7DhxGuTVfI/JyY/COIiaaGcJmsk27JA 3wPQ+SL/Dfgi5T3eyqy+YeYQmS15TqmSBcweE= MIME-Version: 1.0 Received: by 10.150.115.17 with SMTP id n17mr2577752ybc.99.1255014993087; Thu, 08 Oct 2009 08:16:33 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Thu, 8 Oct 2009 11:16:13 -0400 X-Google-Sender-Auth: 81271b1628426c9b Message-ID: Subject: Re: Penlight docs To: Lua list Content-Type: multipart/alternative; boundary=000e0cd5c44cd9cec004756df2f1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd5c44cd9cec004756df2f1 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Oct 8, 2009 at 10:49 AM, David Manura wrote: > On Thu, Oct 8, 2009 at 10:31 AM, RJP Computing wrote: > > I am using penlight a bunch in my current application and with LuaForge > down > > is there another location I can get the docs. > > In http://math2.org/luasearch-2/ click penlight and browse into the > docs folder. This is 0.7.2 (is that the latest?) > Thanks. That will work. That is the version I am using. -- Regards, Ryan --000e0cd5c44cd9cec004756df2f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Oct 8, 2009 at 10:49 AM, David M= anura <dm.lua@math= 2.org> wrote:
On Thu, Oct 8, 2009 at 10:31 AM, RJP Computing wrote:
> I am using penlight a bunch in my current application and with LuaForg= e down
> is there another location I can get the docs.

In http:/= /math2.org/luasearch-2/ click penlight and browse into the
docs folder. =A0This is 0.7.2 (is that the latest?)

Thanks. That will work. That is the version I am usi= ng.
--
Regards,
Ryan
--000e0cd5c44cd9cec004756df2f1-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 12:21:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98FLKIr026948; Thu, 8 Oct 2009 12:21:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C25F9190F7; Thu, 8 Oct 2009 12:20:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f199.google.com (mail-yx0-f199.google.com [209.85.210.199]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C83CE190B5 for ; Thu, 8 Oct 2009 12:20:05 -0300 (BRT) Received: by yxe37 with SMTP id 37so6178308yxe.33 for ; Thu, 08 Oct 2009 08:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=J7BorDE0hetVFek/09/e+8ajlR4RhWGn4q3IUfUQ+sI=; b=tm1HzS+HW8O0lulA96IJSp6jrR2gQbI2Fw7bwWqLUjy4l+yEKcwaKvP8oBzVZM8A74 MZkJVr7ysd40bl2dgdUMN4gBypt3N7SaLFNHszimigD0Fp8sAet5MUgL9YMErGCB+n4r VwMPfx8lM6YotXqy5vq5eDS7KxEkwV+FjAOLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=ViCwnIHqPQg98GkT/l6ThWVTWBqI08x2Aj1r0XRbT+fafRDGOxv7mB+5HbYAzzijet herRDlbzWJd3M+SdTXaDazxS9Z8nFUoliYDpsu+qa3jLqyz5kDgeOf6kfmovlWUcv3y/ KhpQOsEZcFai3AIms6atsrihJGtQGGPpa7vaQ= MIME-Version: 1.0 Received: by 10.151.16.2 with SMTP id t2mr2556918ybi.176.1255015243090; Thu, 08 Oct 2009 08:20:43 -0700 (PDT) In-Reply-To: <7913df4d0910080741p1a5c12f8qfe7d686740669d2e@mail.gmail.com> References: <7913df4d0910080741p1a5c12f8qfe7d686740669d2e@mail.gmail.com> From: RJP Computing Date: Thu, 8 Oct 2009 11:20:23 -0400 X-Google-Sender-Auth: 5189d320495a876d Message-ID: Subject: Re: [Kepler] Using Orbit to start a download To: Lua list Content-Type: multipart/alternative; boundary=000e0cd618f2c08a6904756e01a9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd618f2c08a6904756e01a9 Content-Type: text/plain; charset=ISO-8859-1 Hi Fabio, On Thu, Oct 8, 2009 at 10:41 AM, Fabio Mascarenhas wrote: > Hi RJP, > > You can use the serve_static method of your application object to send > a file to the client. It sets the content-type based on the extension > of the file you are sending. The syntax is > > orbit_app:serve_static(web, path_to_file) > > It returns the contents of the file, so just tail-call it in your > handler. This is probably a stupid question, but what does it mean to tail-call it? > serve_static also supports X-SendFile, if you set > use_xsendfile to true in your application object. > What are the reasons to use X-SendFile versus the default? -- Regards, Ryan --000e0cd618f2c08a6904756e01a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Fabio,

On Thu, Oct 8, 2009 at 10:41 AM= , Fabio Mascarenhas <mascarenhas@acm.org> wrote:
Hi RJP,

You can use the serve_static method of your application object to send
a file to the client. It sets the content-type based on the extension
of the file you are sending. The syntax is

orbit_app:serve_static(web, path_to_file)

It returns the contents of the file, so just tail-call it in your
handler.

This is probably a stupid question, but what= does it mean to tail-call it?
=A0
serve_static also supports X-SendFile, if you set
use_xsendfile to true in your application object.

= What are the reasons to use X-SendFile versus the default?
-= -
Regards,
Ryan
--000e0cd618f2c08a6904756e01a9-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 12:26:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98FQH2C027887; Thu, 8 Oct 2009 12:26:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9146E19144; Thu, 8 Oct 2009 12:25:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3195E1911A for ; Thu, 8 Oct 2009 12:25:03 -0300 (BRT) Received: by fxm12 with SMTP id 12so6138833fxm.5 for ; Thu, 08 Oct 2009 08:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=1Zey6qtBp2oG8N/E+/tejDpfu4hluf+w9Fy+Hdvo7Ro=; b=x00U8c5zd7krSfMnwwgiZdMy8zwN/ZdfE/Nvx0VNyq+KscWGbiQjZdawk6w7OK5wsc ODjvJ4Zv5WhBbjdbbqMhndphbPyc1s7ZuOSQbW8lBja6g+4B+zWsn95LIHWlXtoSdBBH EK7jF6GV6cM2krZCI3zSWWDS4hw2NKnxebRO4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=bmSbga2t+EGX4gybajathBiJhFdljFkn7tCuMTSawapaiJc2jAqmB80pns4MhVFoIP J21pLscgpd7LzP/rgQO7xkQcf+Ou5NrO7bIp+KZphh7TPNRIpQ3eJgNdguBrr/sP+QgG 0iAA+q/Br+ZesBVrEynZwo2/VTiavsHW8D14E= MIME-Version: 1.0 Received: by 10.204.152.204 with SMTP id h12mr1165136bkw.97.1255015543102; Thu, 08 Oct 2009 08:25:43 -0700 (PDT) In-Reply-To: References: <7913df4d0910080741p1a5c12f8qfe7d686740669d2e@mail.gmail.com> Date: Thu, 8 Oct 2009 11:25:43 -0400 X-Google-Sender-Auth: 71ab53975676ab63 Message-ID: Subject: Re: [Kepler] Using Orbit to start a download From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > This is probably a stupid question, but what does it mean to tail-call it? http://www.lua.org/pil/6.3.html - yuri From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 13:32:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98GW79g010479; Thu, 8 Oct 2009 13:32:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65C9A1A6DD; Thu, 8 Oct 2009 13:30:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9A111A6CA for ; Thu, 8 Oct 2009 13:30:44 -0300 (BRT) Received: by fxm12 with SMTP id 12so26884fxm.5 for ; Thu, 08 Oct 2009 09:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=TOHajCVolrfYwwFSHtynnu8ECYiTAMyyCzTLS4GpZIY=; b=AlnJ8CG4GXFa0r8mB94FK2DynjpMHFReD1q2QVsO/44yK+FcRxRcm3H5wfgCn06YrE C18ulMihzt5BA62APAmO4spU8QfDymasVf8FIAJ89XYWT7RI+ZT7gY+WdyzUDALBSJjF tJzPgRanJ23AG3o8w5HchdjsciTaMYMUjKvfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=eMm/1gTkBa8Mir7ajcwldk0TG6KxJXa+2nQlejz8krRJY8kl5UL/u9jcj5MaYDRUHA 06CGz2n6R6ondCSsag6UF225fkgEYUc634wmeRwVC7ZcQEFOuYBzSMZsXVRtQd5fXaZM obJGuaRN5I0pT6/KUdFihkO7Sabav463V7FnQ= Received: by 10.103.125.38 with SMTP id c38mr585973mun.119.1255019483971; Thu, 08 Oct 2009 09:31:23 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id y37sm143780mug.4.2009.10.08.09.31.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Oct 2009 09:31:22 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Thu, 8 Oct 2009 18:30:51 +0200 References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 8, 2009, at 8:34 AM, Jacques Chester wrote: > using plain HTML with an agreed CSS 'microformat'. Ah, good thinking, a package microformat [1]. That would be interesting :) [1] http://microformats.org/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 13:59:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Gxm1h016582; Thu, 8 Oct 2009 13:59:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9239B18BB2; Thu, 8 Oct 2009 13:58:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f191.google.com (mail-yx0-f191.google.com [209.85.210.191]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25D4F18A87 for ; Thu, 8 Oct 2009 13:58:30 -0300 (BRT) Received: by yxe29 with SMTP id 29so47712yxe.14 for ; Thu, 08 Oct 2009 09:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0XLvNYhgjlV5PMWSdJ2HnQF94hQl4pWTjwEe97KQsEw=; b=hTOB7ljVLkNPplPqHueC4+XBdvL/ecjRc1l3dUZLd2Mbv2RymNT80S+rvSF/EN0G7j cMBFXplwXYG6z7CsuPrpYNA4aXBIxaGjVjOqLsm0kINaSn8A+uN2aI4zX4zJf4F/v515 xc7g8TqsD2O6ClcPl0MFBR1YkFHeuHpLCSQKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tuNvqLONqdOmx2MdDwoVOV0pOP2d//hUK2W74Qb9QmtRiKzDky4D+ZcS5Muem6lYmk FwHAJ4LdUeRXkWSi7MQojTJuklDZD6yDkaAChrMuuTsy5sQF0fwLOsmvcKaaYWmf7C7m cw5v5FBaWHFYR+8yl/hehuaLi1J48tHb6xdv4= MIME-Version: 1.0 Received: by 10.150.7.17 with SMTP id 17mr2794800ybg.47.1255021149497; Thu, 08 Oct 2009 09:59:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Oct 2009 12:59:09 -0400 Message-ID: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com> Subject: Re: Complexities of Pluto From: Ben Sunshine-Hill To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean A bit of historical perspective: When I originally designed Pluto, although I considered the possibility of serializing the globals table, it was my feeling that people wouldn't normally do it. This was partially because my preferred coding style with Lua tended to keep things out of the global scope, and partially because I felt that if one was serializing such a huge amount of the Lua space, a solution like lper (which, BTW, is awesome and deserves to be updated and used more) would be a better fit. My "solution" for persisting the global table, then, was a lazy one: Someone who wished to persist the globals table would do so by putting a whole bunch of stuff in the permanents table... basically, every library and global function that shouldn't be messed with. The globals table would then be serialized, either directly or in a location directly accessible from the serialized object. Then on reload, the reloaded table (not yet the globals table) would be reintegrated into the real globals table through a simple "for k,v in pairs(t) do _G[k]=v end". This isn't a perfect approach, as _G itself could be held as a reference by an object, and on unserialize this would then point to the not-the-global-table result. Normally one would deal with this by keeping such an object in the permanents table, but in this instance of course that wouldn't work, as _G needs specifically to NOT be a permanent object. Other than that caveat, however, this approach should work fine. If you want, it shouldn't be too hard to mung Pluto up a bit to make it write its rebuilt data directly into the REAL globals table, rather than into a nwely crated table. That would fix the caveat above, and remove the need for the shallow copy. (You'd still have to shove a bunch of stuff into a permanents table, to keep Pluto away from your C-functions.) Of course, this would only work if you were specifically serializing the globals table as the primary object. For your second need, it seems like the laziest solution would be to put the onus on maintaining changes from the pristine to the maculate table on the table itself. This is a common thing to do with Pluto, with __index and __newindex metamethods capable of delegating to the pristine table for unchanged values, and the table itself for changes (including, and this is an important problem, values which have been set to nil). Then there's nothing special about serializing it, not even a need for a __persist metamethod -- just stick the pristine table in the permanents. On Thu, Oct 8, 2009 at 9:52 AM, Duncan Cross wrote: > Another subtle thing to watch out for is that, if you want to > serialize the global variable scope, it is easy to forget about the > string metatable which will still have its __index field set to the > *old* string table - so if you add custom functions to string, and > want to call them as methods, they seem to disappear after > serialization and deserializatin. The solution is to serialize not the > global variable scope itself but a temporary table that contains it, > as well as the string metatable, and possibly other base-type > metatables if you have set them. Huh, yikes. Ben From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 14:07:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98H7bYT018401; Thu, 8 Oct 2009 14:07:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7771C19176; Thu, 8 Oct 2009 14:06:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBA9019131 for ; Thu, 8 Oct 2009 14:06:22 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98H71Cf018302 for ; Thu, 8 Oct 2009 14:07:01 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n98H70k28929; Thu, 8 Oct 2009 14:07:00 -0300 Date: Thu, 8 Oct 2009 14:07:00 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Complexities of Pluto Message-ID: <20091008140700.C28887@lua.tecgraf.puc-rio.br> References: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com>; from sneftel@gmail.com on Thu, Oct 08, 2009 at 12:59:09PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > partially because I felt that if one was serializing such a huge > amount of the Lua space, a solution like lper (which, BTW, is awesome > and deserves to be updated and used more) would be a better fit. What updates did you have in mind? lper still has problems with C functions and userdata, but for plain data it works fine. OTOH it's Linux-only. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 14:21:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98HLSEG022560; Thu, 8 Oct 2009 14:21:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF5B21A5DD; Thu, 8 Oct 2009 14:20:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41FCA1926F for ; Thu, 8 Oct 2009 14:20:14 -0300 (BRT) Received: by ywh15 with SMTP id 15so5901285ywh.5 for ; Thu, 08 Oct 2009 10:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WJHTOoFBqqRgAGOKYGBZ1lOcQeFnVEg5YDlpAfmJOes=; b=oszoNVUb4Mll/PTT/5xqip2f7d8I1cCPjzBHL8VMaDfJhFyiub8ZXALOKeekX/uxXl kf2cUOZNCuYYFozl37ohfoKSxMSpyzS9src8YjUd+n6c6LsuzHaMGnolAicp3GCv4LFR OlYt+0Jce85xfNNFf1+BjP8nrdD94YQKctbKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=SoMIoU2aMlmXU/suU+7UOm21cjWDMdtIcrXPegl2k1kdXEz5+hW4SuuFL+UJdLTTjB 43/LCL0oiN4dqKzrJzr+cUphpsnwYB1F4xkwrXsDuG0Gi9cLN3dQ+p9pk1fSIcL+Zqyr WONMYRKRTWEUpEof7trCccD26YZyVRPC66V5o= MIME-Version: 1.0 Received: by 10.150.100.9 with SMTP id x9mr2745678ybb.203.1255022452063; Thu, 08 Oct 2009 10:20:52 -0700 (PDT) In-Reply-To: <20091008140700.C28887@lua.tecgraf.puc-rio.br> References: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com> <20091008140700.C28887@lua.tecgraf.puc-rio.br> Date: Thu, 8 Oct 2009 13:20:52 -0400 Message-ID: <411299900910081020h4a82e0e0t63666c85264fecd8@mail.gmail.com> Subject: Re: Complexities of Pluto From: Ben Sunshine-Hill To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 1:07 PM, Luiz Henrique de Figueiredo wrote: >> partially because I felt that if one was serializing such a huge >> amount of the Lua space, a solution like lper (which, BTW, is awesome >> and deserves to be updated and used more) would be a better fit. > > What updates did you have in mind? lper still has problems with C functions > and userdata, but for plain data it works fine. OTOH it's Linux-only. The last bit. :-) I understand that rewriting LPSM to be cross-platform is non-trivial, of course. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 14:27:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98HRAgB023864; Thu, 8 Oct 2009 14:27:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FF3F1A6E2; Thu, 8 Oct 2009 14:26:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C48B519287 for ; Thu, 8 Oct 2009 14:25:56 -0300 (BRT) Received: by bwz22 with SMTP id 22so5486907bwz.5 for ; Thu, 08 Oct 2009 10:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kzYF+chkOM+oh+efDSds/kavKwVwXYCw7sOV9gzBEHM=; b=GgS/7LEFkHbPEkXm+DLF4SZ+/0B4ZoIkqhG1x3mrjL0k0PjANAVhJ5GGlcpcIgGlXV 0Haz6DHufPvZgVS2nblZg6i10bLnsFEfQdsj3XDVyr3BhL5sRes+ViQMGEcUt5PLNheG 9v9c2Owzc0ATq7YvRLf4HxZxvUq4btYeUMrbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aZbcBmne2CxCoxmVrKonokvufLYLAdgED64/Bg7Kg8I7Rkc+hTXwdunYnw9UDJUa9N 9Oq+ZQBcWWYBKJokold0B6fOLuj4b1tP2+KG9XrIH9/wgdT3GDeI22VABKjyeefyGMgD wEZVmL+lKrJfYC/UWhiQckHCEN1gu0liaboUo= MIME-Version: 1.0 Received: by 10.223.5.90 with SMTP id 26mr278426fau.59.1255022793753; Thu, 08 Oct 2009 10:26:33 -0700 (PDT) In-Reply-To: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com> References: <411299900910080959u2fe4c1feva4a514f570091061@mail.gmail.com> Date: Thu, 8 Oct 2009 18:26:33 +0100 Message-ID: Subject: Re: Complexities of Pluto From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 5:59 PM, Ben Sunshine-Hill wrote: > A bit of historical perspective: > > When I originally designed Pluto, although I considered the > possibility of serializing the globals table, it was my feeling that > people wouldn't normally do it. This was partially because my > preferred coding style with Lua tended to keep things out of the > global scope, and partially because I felt that if one was serializing > such a huge amount of the Lua space, a solution like lper (which, BTW, > is awesome and deserves to be updated and used more) would be a better > fit. lper is great, but unfortunately as Luiz pointed out, it is Linux-only and that's a bit of a deal-breaker for what I'm doing at the moment. > My "solution" for persisting the global table, then, was a lazy one: > Someone who wished to persist the globals table would do so by putting > a whole bunch of stuff in the permanents table... basically, every > library and global function that shouldn't be messed with. The globals > table would then be serialized, either directly or in a location > directly accessible from the serialized object. Then on reload, the > reloaded table (not yet the globals table) would be reintegrated into > the real globals table through a simple "for k,v in pairs(t) do > _G[k]=v end". This isn't a perfect approach, as _G itself could be > held as a reference by an object, and on unserialize this would then > point to the not-the-global-table result. Normally one would deal with > this by keeping such an object in the permanents table, but in this > instance of course that wouldn't work, as _G needs specifically to NOT > be a permanent object. Other than that caveat, however, this approach > should work fine. I'd probably be happy with that approach if the only Lua code that I was going to be dealing with would be my own, but I'm planning to use Pluto transparently for Lua code written by other people, and I'm sure they would find odd ways to sneak references to _G all over the place. (I suppose I could remove the _G global variable, but then there's getfenv(), and I really don't want to mess with what's available as standard in the Lua "universe" unless I really have to.) > For your second need, it seems like the laziest solution would be to > put the onus on maintaining changes from the pristine to the maculate > table on the table itself. This is a common thing to do with Pluto, > with __index and __newindex metamethods capable of delegating to the > pristine table for unchanged values, and the table itself for changes > (including, and this is an important problem, values which have been > set to nil). Then there's nothing special about serializing it, not > even a need for a __persist metamethod -- just stick the pristine > table in the permanents. Yeah, that works - I hadn't considered other forms of "magic" than __persist(). Thanks! > On Thu, Oct 8, 2009 at 9:52 AM, Duncan Cross wrote: >> Another subtle thing to watch out for is that, if you want to >> serialize the global variable scope, it is easy to forget about the >> string metatable which will still have its __index field set to the >> *old* string table - so if you add custom functions to string, and >> want to call them as methods, they seem to disappear after >> serialization and deserializatin. The solution is to serialize not the >> global variable scope itself but a temporary table that contains it, >> as well as the string metatable, and possibly other base-type >> metatables if you have set them. > > Huh, yikes. Yikes at the problem, or my solution? :) Another thing I've realised is that coroutine.wrap() returns a C-function that you cannot put into the permanents table ahead of time as it is allocated each time with an upvalue. I think the solution there is to reimplement it as a Lua function: do local select, assert, cocreate, coresume = select, assert, coroutine.create, coroutine.resume function coroutine.wrap(f) local th = cocreate(f) return function(...) return select(2, assert(coresume(th, ...))) end end end (Anyone have any criticism of that implementation?) Of course once you go down that road, there is also the iterators returned by ipairs(), pairs(), io.lines() and string.gmatch() that could potentially be on the stack of a suspended coroutine, so they would need to be reimplemented as well... -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 14:35:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98HZcpE025994; Thu, 8 Oct 2009 14:35:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 915451A6ED; Thu, 8 Oct 2009 14:34:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6ABD1A6DE for ; Thu, 8 Oct 2009 14:34:04 -0300 (BRT) Received: by bwz22 with SMTP id 22so5493818bwz.5 for ; Thu, 08 Oct 2009 10:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=n1F8NgCC+HuX44q0QA2h9oBzanhGYNoWjaYv1P/rB1w=; b=qGblTLXSe85Lt5mjc3LXbViDuyWwHjzzOqByKxfFcl34l/uCWj8Sm0DWzfJmzqb3pP q6fZH1WU1JTPpLZNnXHxsN2U8QaCMlc6MpP1ncpcjIORBtfJrWNzw8Sr7IS8e+KVJpHG QefEiziwSfk/vg6zHEj54bqXtcY5WhBSZUjkM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Yu74E/g037FAvBQqhgIMr+uCW7Rx0SZOgPP5CFLoNlk4Ks4W5AOH5a1t0aIIfzikxK f4mLsF9fqChyf+40l/xIkz13YWTQhrN+Sg1mTZEwQpwNwXhBXuRzqUkRda3Vk/nmArTO sbgEUP1n6cybLY/mEMNxKTIcMByf6M2i8K7/k= MIME-Version: 1.0 Received: by 10.204.160.76 with SMTP id m12mr1229014bkx.140.1255023281028; Thu, 08 Oct 2009 10:34:41 -0700 (PDT) In-Reply-To: <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> Date: Thu, 8 Oct 2009 12:34:41 -0500 X-Google-Sender-Auth: d281364254f75d47 Message-ID: <5ba75e2f0910081034x32c265a7o250818e0ccee52fe@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175caca8d9c0d504756fe092 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175caca8d9c0d504756fe092 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I'm a peruvian Web Developer with some ideas, just my 2 cents: This problem with LuaForge is the tip of the iceberg. But the crisis is an opportunity to impact so deeply in Lua's community. Why? luarocks!, this awesoness productivity tool to compile+install "rocks", we *really* need it to be RELIABLE, remark it. It is an start point to analize the real status of Lua's community in general. PROBLEMS - We lack of infrastructure to support Lua's community: LuaForge and Lua-users - We are not showing the best face of Lua: simple, extensible, easy to lear= n - We are not meeting frequently, nor phisically (we =3D community members) - We are not doing *something* to make Lua's community as good as the software (we =3D those you would like to help, me included) - Blah, Blah, Blah Compare the look+feel of lua.org vs. lua-users.org, the last one is claimin= g for the help of a designer! Why? because it looks as *too* non-serious stuff, when it is so nice resource, just need to look as good as it is. What about activity? It is nice to have one workshop a year, a cool mailing list and a friendly IRC channel, what's next?... *Local Events* people need= s to meet each other more *frequendly*, People networks need the "I've *meet* him" factor. Those who do the hard/nice/cool/awesome work *should* be recognized. OK, I don't want to do critisims all day and depress you, we can overcome problems, and be better! SOLUTIONS Short term plan - LuaForge v1.1: read-only, patched, just-works, we are working in somethin= g better, version of the current one - Brand new lua-users wiki, it's done in Perl?! I claim for something like: http://www.wikidot.com/learnmore:community is free(hosting, software, support!) and looks pretty - Calendar(on-line whiteboard) of Lua events: Camps, Conferences, Workshops= , Trainings, Meetups. Middle term plan - LuaForge v2.0: A HUB of Lua projects, hosted anywhere(trusted sites like: github, gitorious?, sourceforge, etc.) - [someproject].luaforge.net ... do we really need it? please see http://drupal.org/project/og :) - Home made LuaWiki, for showing the world that we eat our own dog food for useful stuff - LuaConference/Summit, something big, to show the world the real size of community! - Official(in the whole meaning of this term) Mailing lists: xxxx@lists.lua.org GOOD NEWS *We* can do it! you don't have to be a "the smartest hacker", just decide t= o help, now! SUBSCRIBERS Following persons support all or some of the ideas listed before: (order is irrelevant) 1. Fernando Paredes Garc=C3=ADa 2. You :) DISCLAIMER I'm just a beginner in Lua an her(right?) community, but I have the sense o= f a successful platform+community from Drupal (a CMS). Blessings! On Thu, Oct 8, 2009 at 1:34 AM, Jacques Chester wrot= e: > > On 08/10/2009, at 2:23 PM, Fabio Mascarenhas wrote: > > I just want to mention that moving Kepler to github was not a >> renunciation of LuaForge, I think having a central index of Lua >> libraries is very important, and I am not the only one that thinks >> this can be done with a much simpler platform than Gforge. More >> importantly, I think it can be done with a Lua-based platform, >> probably something based on Sputnik. >> > > For contrast-and-compare purposes, you may be interested to look > at how the Lisperati do it. The de facto packaging system for > Common Lisp is ASDF. I vaguely recall it finding download URLs > by looking at wiki pages, or something like that. > > In any case it would be possible to embed "current download" > information in a wiki page with meta tags, or using plain > HTML with an agreed CSS 'microformat'. > > Cheers, > > JC. > > > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175caca8d9c0d504756fe092 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I'm a peruvian Web Developer with some ideas, just my 2 cents:
This problem with LuaForge is the tip of the iceberg. But the crisis is an = opportunity to impact so deeply in Lua's community. Why? luarocks!, thi= s awesoness productivity tool to compile+install "rocks", we *rea= lly* need it to be RELIABLE, remark it. It is an start point to analize the= real status of Lua's community in general.

PROBLEMS
- We lack of infrastructure to support Lua's community:= LuaForge and Lua-users
- We are not showing the best face of Lua: simpl= e, extensible, easy to learn
- We are not meeting frequently, nor phisic= ally (we =3D community members)
- We are not doing *something* to make Lua's community as good as the s= oftware (we =3D those you would like to help, me included)
- Blah, Blah,= Blah

Compare the look+feel of lua.org vs. lua-users.org, the last one is c= laiming for the help of a designer! Why? because it looks as *too* non-seri= ous stuff, when it is so nice resource, just need to look as good as it is.=
What about activity? It is nice to have one workshop a year, a cool mailing= list and a friendly IRC channel, what's next?... *Local Events* people= needs to meet each other more *frequendly*, People networks need the "= ;I've *meet* him" factor. Those who do the hard/nice/cool/awesome = work *should* be recognized.

OK, I don't want to do critisims all day and depress you, we can ov= ercome problems, and be better!

SOLUTIONS

Short term plan
= - LuaForge v1.1: read-only, patched, just-works, we are working in somethin= g better, version of the current one
- Brand new lua-users wiki, it's done in Perl?! I claim for something l= ike: http://www.wiki= dot.com/learnmore:community is free(hosting, software, support!) and lo= oks pretty
- Calendar(on-line whiteboard) of Lua events: Camps, Conferences, Workshops= , Trainings, Meetups.

Middle term plan
- LuaForge v2.0: A HUB of = Lua projects, hosted anywhere(trusted sites like: github, gitorious?, sourc= eforge, etc.)
- [someproject].luaforge.net ... do we = really need it? please see http://= drupal.org/project/og :)
- Home made LuaWiki, for showing the world = that we eat our own dog food for useful stuff
- LuaConference/Summit, something big, to show the world the real size of c= ommunity!
- Official(in the whole meaning of this term) Mailing lists: <= a href=3D"mailto:xxxx@lists.lua.org">xxxx@lists.lua.org

GOOD NEW= S
*We* can do it! you don't have to be a "the smartest hacker",= just decide to help, now!

SUBSCRIBERS
Following persons support = all or some of the ideas listed before:
(order is irrelevant)
1. Fern= ando Paredes Garc=C3=ADa
2. You :)

DISCLAIMER
I'm just a beginner in Lua an her(right?= ) community, but I have the sense of a successful platform+community from D= rupal (a CMS).

Blessings!

On Thu,= Oct 8, 2009 at 1:34 AM, Jacques Chester <jacques@chester.id.au> wrote:

On 08/10/2009, at 2:23 PM, Fabio Mascarenhas wrote:

I just want to mention that moving Kepler to github was not a
renunciation of LuaForge, I think having a central index of Lua
libraries is very important, and I am not the only one that thinks
this can be done with a much simpler platform than Gforge. More
importantly, I think it can be done with a Lua-based platform,
probably something based on Sputnik.

For contrast-and-compare purposes, you may be interested to look
at how the Lisperati do it. The de facto packaging system for
Common Lisp is ASDF. I vaguely recall it finding download URLs
by looking at wiki pages, or something like that.

In any case it would be possible to embed "current download"
information in a wiki page with meta tags, or using plain
HTML with an agreed CSS 'microformat'.

Cheers,

JC.






--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175caca8d9c0d504756fe092-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 15:24:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98IOoTL006569; Thu, 8 Oct 2009 15:24:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE3481A6EB; Thu, 8 Oct 2009 15:23:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-5.csi.cam.ac.uk (ppsw-5.csi.cam.ac.uk [131.111.8.135]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63C3B321B3 for ; Thu, 8 Oct 2009 15:23:31 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:41197) by ppsw-5.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.155]:25) with esmtpa (EXTERNAL:fanf2) id 1Mvxem-0004fk-Ix (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Thu, 08 Oct 2009 19:24:04 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1Mvxem-0002Zn-Rx (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Thu, 08 Oct 2009 19:24:04 +0100 Date: Thu, 8 Oct 2009 19:24:04 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: lua@bazar2.conectiva.com.br Subject: lpeg/re.lua suggestion Message-ID: User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Below is a little patch that allows you to use bare non-terminal names on the right-hand-side of a grammar production. This makes LPEG's "re" syntax a lot lighter and more similar to IETF ABNF or W3C EBNF. For non-recursive grammars it's currently tempting to write code like the following for greater brevity... local parse = {} local function p(pattern) return re.compile(pattern, parse) end parse.ws = p[[ [ ]+ ]] parse.num = p[[ {%d+} ]] / tonumber parse.time = p[[ %num ":" %num ":" %num ]] / function (H,M,S) return H*3600 + M*60 + S end -- etc. Patch follows: --- re.lua~ 2008-10-11 20:21:05.000000000 +0000 +++ re.lua 2009-10-08 17:55:37.000000000 +0000 @@ -128,7 +128,8 @@ + "{~" * m.V"Exp" * "~}" / m.Cs + "{" * m.V"Exp" * "}" / m.C + m.P"." * m.Cc(any) - + "<" * name * ">" / m.V; + + "<" * name * ">" / m.V + + (name / m.V) * ("" - S * "<-"); Definition = Identifier * S * '<-' * m.V"Exp"; Grammar = m.Cf(m.V"Definition" / firstdef * m.Cg(m.V"Definition")^0, adddef) / m.P Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 16:05:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98J5lbv017517; Thu, 8 Oct 2009 16:05:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA7B519143; Thu, 8 Oct 2009 16:04:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F10819107 for ; Thu, 8 Oct 2009 16:04:17 -0300 (BRT) Received: by bwz22 with SMTP id 22so5568982bwz.5 for ; Thu, 08 Oct 2009 12:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=b04ASvvh9ez0WpodbBo/+dzZPT068TwU7MjMEO+ZTdU=; b=NhtSFsx8ocZK8nP9dEjeMVRPvspXr84lrZrGlJUwxFw88C0yvXsQCtraHy8nyT33wb s07Y0KUA003vBRVsgp4G6+C61DhNR1utLdHFmN9S/+z5UtpzQYH3eapXY4v3KnUYz/Pj mOiGbyb3yswBUsNQA0c+B4VaHyn49FKddoppE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eSc5Dz12tuj4Tv3e+jPQzaZmJHMiU4usC0S2/1GxxyqSuYoGlop+w2plT6btfdbGfh 0xFeP91t2DQi3fG0JAeR3V5163MFvhV00lV5fNzmfWlp4tHYl5VnLbAqCKzADMO8cqnt 0DJF8FVfD0Bi2R/iB+fC8CxGqWb5QceWa6iD8= MIME-Version: 1.0 Received: by 10.223.22.4 with SMTP id l4mr529615fab.37.1255028695349; Thu, 08 Oct 2009 12:04:55 -0700 (PDT) Date: Thu, 8 Oct 2009 20:04:55 +0100 Message-ID: Subject: [ANN] Lua for Adventure Game Studio From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Adventure Game Studio [1], or AGS, is an IDE for creating 2D point-and-click adventure games in the mould of 1980s-90s Sierra/LucasArts titles like Monkey Island and the Space Quest series. It is available at no cost but is closed-source, and can be used to create freeware games, or shareware/commercial games subject to some considerations [2]. The AGS Editor is itself only officially developed for Windows - while there are third-party projects around that allow games created with AGS to be played on MacOS [3] and Linux [4], they do not currently support plugins. AGS has its own statically-typed, C-like language for scripting game functionality, which I refer to as "AGS-Script" (that's not an official name, I don't think there is one). Lua For AGS [3] is an experimental AGS plugin I have been developing. I'd say it's just about at beta status by now. It allows AGS-Script code to run Lua scripts, call Lua functions and get/set Lua variables, and allows Lua code to call AGS functions and methods on AGS objects. It also provides a Scintilla based Lua script editor, and basic script management, integrated into the AGS IDE. The Lua state is automatically serialized and deserialized in AGS save game files. The API presented to manipulate Lua from AGS-Script is not the full, low-level C API, but a much simplified abstraction. For example, calling a Lua global function is achieved like this: { LuaValueList* lparams = Lua.NewValueList(); lparams.Add(Lua.StringValue("Hxllo, and wxlcomx")); lparams.Add(Lua.StringValue("x")); lparams.Add(Lua.StringValue("e")); LuaValueList* lresults = Lua.Call("string.gsub", lparams); String result = lresults.AsStrings[1]; } Internally, "LuaValueList*" objects are just specially-managed tables. (I am not opposed to providing the low-level API as well, eventually, but it is not a high priority at the moment.) Any comments and feedback appreciated. I probably won't bring this up again here but I thought I'd post about it in case anyone is interested. -Duncan [1] http://www.adventuregamestudio.co.uk/ [2] http://www.adventuregamestudio.co.uk/aclegal.htm [3] http://www.bigbluecup.com/yabb/index.php?topic=37968.0 [4] http://www.bigbluecup.com/yabb/index.php?topic=30021.0 [5] http://lua-for-ags.wikispaces.com/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 16:29:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98JTHbh023407; Thu, 8 Oct 2009 16:29:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45FF0192B6; Thu, 8 Oct 2009 16:28:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40246192A2 for ; Thu, 8 Oct 2009 16:28:03 -0300 (BRT) Received: by fxm12 with SMTP id 12so203902fxm.5 for ; Thu, 08 Oct 2009 12:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=FdS7nohq6y0G84Dw7epuSrq49PlbM1N2G0HgQCwNl9s=; b=CNSTyXUjVC9BNuipK0gjLCPB7SJaFzxYTWe0lKnKAgZmZnRjHFXh5MgOtTjluFBw+N Dpz/8NtJeYj8Nh7gQmfwYV4tK92vGxsq9Xn1VsSXzjxxVjit8TzH2+l6qOCGnDG2ABpv pnsRsaqsJd72DH1pm0qNdqRyJJm+p9MZoPM/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=pvKolyrjvoaWZ9snIaWhSCgXNK1tBV/QdwNtBqw3tfMUjOz2bUs6yAIUloP3RAnr52 OHWNnTdjTCz8udX302mGv0G02h8s+3iF43KQCDLY+HgiDThZNug3fEXoy3uGJbJVdz0d MJVNhYCnkr1W3M/snRRd4sGLL4f74oTS3oQ4s= MIME-Version: 1.0 Received: by 10.102.170.12 with SMTP id s12mr694847mue.12.1255030120059; Thu, 08 Oct 2009 12:28:40 -0700 (PDT) From: Bogdan Marinescu Date: Thu, 8 Oct 2009 22:28:20 +0300 Message-ID: <81fbe47d0910081228q65afdf06ucd575b0921f6887c@mail.gmail.com> Subject: [ANN] eLua 0.6 released To: Lua list Content-Type: multipart/alternative; boundary=0016364c77c37d12e104757178c7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364c77c37d12e104757178c7 Content-Type: text/plain; charset=ISO-8859-1 eLua is an effort to bring the Lua programming language in the embedded world (MCUs). It is meant to be a complete MCU development environment. It currently runs on a number of ARM variants, as well as Cortex, AVR32 (and i386 as a proof of concept). Version 0.6 was released, this is the changelog: * License changed to MIT * Web page and documentation completely redesigned * Documentation available offline * Added documentation in portuguese * Added support for AVR32 CPUs * Added support for STM32 Cortex-M3 CPUs * Added ADC module with support for moving average filters * Added support for multiple toolchains * Added an ls (or dir) shell command * Added new examples: pong, tetrives, spaceship (games), logo (graphics), adcpoll, adcscope (ADC operations) * Added the LTR (Lua Tiny RAM) patch * ROM FS content can be specified per board now * API semantic revisions (old code might not be compatible) We made this new release public on the same day the Lua workshop started (and eLua was presented as part of the workshop), so we're naturally very excited about this :) Thank you for all your support. You can find all the project documentation at http://www.eluaproject.net Thanks, Bogdan and Dado --0016364c77c37d12e104757178c7 Content-Type: text/html; charset=ISO-8859-1 eLua is an effort to bring the Lua programming language in the embedded world (MCUs). It is meant to be a complete MCU development environment. It currently runs on a number of ARM variants, as well as Cortex, AVR32 (and i386 as a proof of concept). Version 0.6 was released, this is the changelog:

* License changed to MIT
* Web page and documentation completely redesigned
* Documentation available offline
* Added documentation in portuguese
* Added support for AVR32 CPUs
* Added support for STM32 Cortex-M3 CPUs
* Added ADC module with support for moving average filters
* Added support for multiple toolchains
* Added an ls (or dir) shell command
* Added new examples: pong, tetrives, spaceship (games), logo (graphics), adcpoll, adcscope (ADC operations)
* Added the LTR (Lua Tiny RAM) patch
* ROM FS content can be specified per board now
* API semantic revisions (old code might not be compatible)

We made this new release public on the same day the Lua workshop started (and eLua was presented as part of the workshop), so we're naturally very excited about this :) Thank you for all your support.
You can find all the project documentation at http://www.eluaproject.net

Thanks,
Bogdan and Dado

--0016364c77c37d12e104757178c7-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 16:45:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Jj4ik027866; Thu, 8 Oct 2009 16:45:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 695021A6D6; Thu, 8 Oct 2009 16:43:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FC79321B3 for ; Thu, 8 Oct 2009 16:43:33 -0300 (BRT) Received: by fxm12 with SMTP id 12so218860fxm.5 for ; Thu, 08 Oct 2009 12:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=dVv1kZGRERlQM++CXJ2F6WfMth2NmekIklvv9q2KWew=; b=T1CHv8JGLwW3ndEkLjktwFhtNlQaQoUIBa1eBUyyQzolO9Za0B2BGgYI9BcdeES3kx HPVOr1yct+ho4ohH2TGhw0rgU8jDNNVuTL8IplSv9VGyKgieXHHlHbr8sgP0+O9d2P3/ m6Zp6rF3hbW0LQmInQjqHoKjCxH49quNzumy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=DE3QVg5S8tI77fzKX2D2YKmm6OKSRbQPg8eFb+wiezChOQFfI7bSnWyzqGwLYWkjEY VkT1ktEynjjlskNkw7mEm/qKJAuAQuR/n/DWyceaxxUM6Ds44uc2Kg00ADFZiJs3AU0v XnvlqLTZUsghvxWsT7bIgyTEHdnma3beVlP2k= MIME-Version: 1.0 Received: by 10.204.35.12 with SMTP id n12mr1372197bkd.147.1255031051553; Thu, 08 Oct 2009 12:44:11 -0700 (PDT) In-Reply-To: <5ba75e2f0910081034x32c265a7o250818e0ccee52fe@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910072323x3b63f5d5w14078bf0f24e7df7@mail.gmail.com> <551927F7-3FA1-4585-A568-3F9E74FB5611@chester.id.au> <5ba75e2f0910081034x32c265a7o250818e0ccee52fe@mail.gmail.com> Date: Thu, 8 Oct 2009 14:44:11 -0500 X-Google-Sender-Auth: 4c7b8eb4e45235ec Message-ID: <5ba75e2f0910081244l45297645o8be6535616028b0e@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=00032555735202949e047571b0a3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555735202949e047571b0a3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have started a wiki page to collect more ideas about community infrastructure: http://lua-users.org/wiki/NewCommunityInfrastructure Blessings! 2009/10/8 Fernando P. Garc=C3=ADa > Hello, I'm a peruvian Web Developer with some ideas, just my 2 cents: > > This problem with LuaForge is the tip of the iceberg. But the crisis is a= n > opportunity to impact so deeply in Lua's community. Why? luarocks!, this > awesoness productivity tool to compile+install "rocks", we *really* need = it > to be RELIABLE, remark it. It is an start point to analize the real statu= s > of Lua's community in general. > > PROBLEMS > - We lack of infrastructure to support Lua's community: LuaForge and > Lua-users > - We are not showing the best face of Lua: simple, extensible, easy to > learn > - We are not meeting frequently, nor phisically (we =3D community members= ) > - We are not doing *something* to make Lua's community as good as the > software (we =3D those you would like to help, me included) > - Blah, Blah, Blah > > Compare the look+feel of lua.org vs. lua-users.org, the last one is > claiming for the help of a designer! Why? because it looks as *too* > non-serious stuff, when it is so nice resource, just need to look as good= as > it is. > What about activity? It is nice to have one workshop a year, a cool maili= ng > list and a friendly IRC channel, what's next?... *Local Events* people ne= eds > to meet each other more *frequendly*, People networks need the "I've *mee= t* > him" factor. Those who do the hard/nice/cool/awesome work *should* be > recognized. > > OK, I don't want to do critisims all day and depress you, we can overcome > problems, and be better! > > SOLUTIONS > > Short term plan > - LuaForge v1.1: read-only, patched, just-works, we are working in > something better, version of the current one > - Brand new lua-users wiki, it's done in Perl?! I claim for something lik= e: > http://www.wikidot.com/learnmore:community is free(hosting, software, > support!) and looks pretty > - Calendar(on-line whiteboard) of Lua events: Camps, Conferences, > Workshops, Trainings, Meetups. > > Middle term plan > - LuaForge v2.0: A HUB of Lua projects, hosted anywhere(trusted sites lik= e: > github, gitorious?, sourceforge, etc.) > - [someproject].luaforge.net ... do we really need it? please see > http://drupal.org/project/og :) > - Home made LuaWiki, for showing the world that we eat our own dog food f= or > useful stuff > - LuaConference/Summit, something big, to show the world the real size of > community! > - Official(in the whole meaning of this term) Mailing lists: > xxxx@lists.lua.org > > GOOD NEWS > *We* can do it! you don't have to be a "the smartest hacker", just decide > to help, now! > > SUBSCRIBERS > Following persons support all or some of the ideas listed before: > (order is irrelevant) > 1. Fernando Paredes Garc=C3=ADa > 2. You :) > > DISCLAIMER > I'm just a beginner in Lua an her(right?) community, but I have the sense > of a successful platform+community from Drupal (a CMS). > > Blessings! > > > On Thu, Oct 8, 2009 at 1:34 AM, Jacques Chester wr= ote: > >> >> On 08/10/2009, at 2:23 PM, Fabio Mascarenhas wrote: >> >> I just want to mention that moving Kepler to github was not a >>> renunciation of LuaForge, I think having a central index of Lua >>> libraries is very important, and I am not the only one that thinks >>> this can be done with a much simpler platform than Gforge. More >>> importantly, I think it can be done with a Lua-based platform, >>> probably something based on Sputnik. >>> >> >> For contrast-and-compare purposes, you may be interested to look >> at how the Lisperati do it. The de facto packaging system for >> Common Lisp is ASDF. I vaguely recall it finding download URLs >> by looking at wiki pages, or something like that. >> >> In any case it would be possible to embed "current download" >> information in a wiki page with meta tags, or using plain >> HTML with an agreed CSS 'microformat'. >> >> Cheers, >> >> JC. >> >> >> >> > > > -- > Fernando P. Garc=C3=ADa, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de t=C3=AD. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --00032555735202949e047571b0a3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have started a wiki page to collect more ideas about community infrastruc= ture: http= ://lua-users.org/wiki/NewCommunityInfrastructure

Blessings!

2009/10/8 Fernando P. Garc=C3=ADa <fernando@develcuy.com= >
lua.org vs. = lua-users.org, the last one is claiming for the help of a designer! Why= ? because it looks as *too* non-serious stuff, when it is so nice resource,= just need to look as good as it is.
What about activity? It is nice to have one workshop a year, a cool mailing= list and a friendly IRC channel, what's next?... *Local Events* people= needs to meet each other more *frequendly*, People networks need the "= ;I've *meet* him" factor. Those who do the hard/nice/cool/awesome = work *should* be recognized.

OK, I don't want to do critisims all day and depress you, we can ov= ercome problems, and be better!

SOLUTIONS

Short term plan
= - LuaForge v1.1: read-only, patched, just-works, we are working in somethin= g better, version of the current one
- Brand new lua-users wiki, it's done in Perl?! I claim for something l= ike: http://www.wikidot.com/learnmore:community is free(hosting, software= , support!) and looks pretty
- Calendar(on-line whiteboard) of Lua events: Camps, Conferences, Workshops= , Trainings, Meetups.

Middle term plan
- LuaForge v2.0: A HUB of = Lua projects, hosted anywhere(trusted sites like: github, gitorious?, sourc= eforge, etc.)
- [someproject].luaforge.= net ... do we really need it? please see http://drupal.org/project/og :)
- Home = made LuaWiki, for showing the world that we eat our own dog food for useful= stuff
- LuaConference/Summit, something big, to show the world the real size of c= ommunity!
- Official(in the whole meaning of this term) Mailing lists: <= a href=3D"mailto:xxxx@lists.lua.org" target=3D"_blank">xxxx@lists.lua.org

GOOD NEWS
*We* can do it! you don't have to be a "the smartest hacker",= just decide to help, now!

SUBSCRIBERS
Following persons support = all or some of the ideas listed before:
(order is irrelevant)
1. Fern= ando Paredes Garc=C3=ADa
2. You :)

DISCLAIMER
I'm just a beginner in Lua an her(right?= ) community, but I have the sense of a successful platform+community from D= rupal (a CMS).

Blessings!


On Thu, Oct 8, 2009 at 1:34 AM, Jacques Chester = <jacques@chester.id.au> wrote:

On 08/10/2009, at 2:23 PM, Fabio Mascarenhas wrote:

I just want to mention that moving Kepler to github was not a
renunciation of LuaForge, I think having a central index of Lua
libraries is very important, and I am not the only one that thinks
this can be done with a much simpler platform than Gforge. More
importantly, I think it can be done with a Lua-based platform,
probably something based on Sputnik.

For contrast-and-compare purposes, you may be interested to look
at how the Lisperati do it. The de facto packaging system for
Common Lisp is ASDF. I vaguely recall it finding download URLs
by looking at wiki pages, or something like that.

In any case it would be possible to embed "current download"
information in a wiki page with meta tags, or using plain
HTML with an agreed CSS 'microformat'.

Cheers,

JC.






--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Analista= de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--00032555735202949e047571b0a3-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 16:56:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98JuNqX030385; Thu, 8 Oct 2009 16:56:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDAA41A6F1; Thu, 8 Oct 2009 16:55:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32FF8321B3 for ; Thu, 8 Oct 2009 16:55:08 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n98JtmdV010787 for ; Thu, 8 Oct 2009 16:55:48 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 2F3F754C23A; Thu, 8 Oct 2009 16:55:48 -0300 (BRT) Date: Thu, 8 Oct 2009 16:55:48 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: [ANN] eLua 0.6 released Message-ID: <20091008195548.GB14135@inf.puc-rio.br> References: <81fbe47d0910081228q65afdf06ucd575b0921f6887c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81fbe47d0910081228q65afdf06ucd575b0921f6887c@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > eLua is an effort to bring the Lua programming language in the embedded > world (MCUs). [...] This goal suggests that Lua has no presence in the embedded world, which is not true. Maybe something like "an effort to spread Lua" (or "to expand presence") would be more accurate. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 17:10:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98KAYSM000781; Thu, 8 Oct 2009 17:10:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D64EF1A6F7; Thu, 8 Oct 2009 17:09:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E1DF1A6E9 for ; Thu, 8 Oct 2009 17:09:19 -0300 (BRT) Received: by bwz22 with SMTP id 22so5622952bwz.5 for ; Thu, 08 Oct 2009 13:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=wL8KaJ3QK4MNe1Rk+Va3rSc+VNRXRe+XSEgVw4ujeFw=; b=qFdsB4K9g37gZyJ4WOfUzCWpU83rkGj8StOSxEi3rTSqfKbyj1bAQuQ8ZRsvOn99tE gmLa4zwZihsEy+VjIlLAxyZsMmz9tT44PZu12I2pMPEhNJKXkdCaNvTh2gV5bq1O4OnN KKGK3r/LAytDEd1NINn/1sV3oifCmeJEXHZX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=UAiTieDVxotmnZ/I5oylfiuEbLt8xzkLG7wyizhF39V4qS+mqzShF55g4j7h9OTLoI JwseNI0SgdMeB65SCDNoLoNZ5nMHglAPJWcWqCskN8o6CBP/yuMn7iw8r824t/h/Hli9 JDlOnWL+47MszGwmO0/fcZD0LEsD0IXatGuj4= MIME-Version: 1.0 Received: by 10.103.126.32 with SMTP id d32mr715692mun.0.1255032599068; Thu, 08 Oct 2009 13:09:59 -0700 (PDT) In-Reply-To: <20091008195548.GB14135@inf.puc-rio.br> References: <81fbe47d0910081228q65afdf06ucd575b0921f6887c@mail.gmail.com> <20091008195548.GB14135@inf.puc-rio.br> From: Bogdan Marinescu Date: Thu, 8 Oct 2009 23:09:39 +0300 Message-ID: <81fbe47d0910081309i64e850d4v16211a2b86cc90e6@mail.gmail.com> Subject: Re: [ANN] eLua 0.6 released To: Lua list Content-Type: multipart/alternative; boundary=0016364999073fc25a0475720ce8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364999073fc25a0475720ce8 Content-Type: text/plain; charset=ISO-8859-1 Thanks, we'll modify this on our next release :) Best, Bogdan On Thu, Oct 8, 2009 at 10:55 PM, Roberto Ierusalimschy < roberto@inf.puc-rio.br> wrote: > > eLua is an effort to bring the Lua programming language in the embedded > > world (MCUs). [...] > > This goal suggests that Lua has no presence in the embedded world, which > is not true. Maybe something like "an effort to spread Lua" (or "to > expand presence") would be more accurate. > > -- Roberto > --0016364999073fc25a0475720ce8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, we'll modify this on our next release :)

Best,
Bogdan=

On Thu, Oct 8, 2009 at 10:55 PM, Roberto= Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> eLua is an effort to bring the Lua programming language in the embedd= ed
> world (MCUs). [...]

This goal suggests that Lua has no presence in the embedded world, which is not true. Maybe something like "an effort to spread Lua" (or &= quot;to
expand presence") would be more accurate.

-- Roberto

--0016364999073fc25a0475720ce8-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 17:55:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98KtQ2N010864; Thu, 8 Oct 2009 17:55:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC83A1A5E7; Thu, 8 Oct 2009 17:54:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1C6C1899C for ; Thu, 8 Oct 2009 17:54:07 -0300 (BRT) Received: by ywh15 with SMTP id 15so6064399ywh.5 for ; Thu, 08 Oct 2009 13:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=ewxs9NXcPASUKDJeOgRyiGv9trWuEJKjp15lasK9NtY=; b=ea0gKXmRu5ijetd4mt/7zY73SKafwek1t1kxaQ/wkWZ4NRa8S1XUCBY+1IFdCtOA9J t9bSKsekSK5ru+Hm9scR3vXwnLGdXZxP97dEmsCW09VIXUlLdHNiboDdYW4FEnS/vynv nNUFAMMjo+t1bHGawumkqJnlN/RnyFuSbk+D8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=wJgsPOrcwRXNW/bEZw4M94I1gTZfcrstg443RT8uA9wxy0pnVjbCvO3jrWE46EaAW9 FsE0W4+rxk+5g0etyN1EEUzYhDzxeyhorY/YH2H3NZxKgTMlRiHTxVe+pJuKWx3VryM7 Vq1X0qNOP4jDsknDwcebkODvQJ2HCmM3A8WX4= MIME-Version: 1.0 Received: by 10.151.87.1 with SMTP id p1mr3145469ybl.116.1255035287166; Thu, 08 Oct 2009 13:54:47 -0700 (PDT) In-Reply-To: References: <7913df4d0910080741p1a5c12f8qfe7d686740669d2e@mail.gmail.com> From: RJP Computing Date: Thu, 8 Oct 2009 16:54:27 -0400 X-Google-Sender-Auth: 61b94845d0eca2bf Message-ID: Subject: Re: [Kepler] Using Orbit to start a download To: Lua list Content-Type: multipart/alternative; boundary=000e0cd34c0678dd74047572accf X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd34c0678dd74047572accf Content-Type: text/plain; charset=ISO-8859-1 Yuri, On Thu, Oct 8, 2009 at 11:25 AM, Yuri Takhteyev wrote: > > This is probably a stupid question, but what does it mean to tail-call > it? > > http://www.lua.org/pil/6.3.html > Got it thanks. -- Regards, Ryan --000e0cd34c0678dd74047572accf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yuri,

On Thu, Oct 8, 2009 at 11:25 AM, Yu= ri Takhteyev <yuri@sims.berkeley.edu> wrote:
> This is probably a stupid question, but what does it= mean to tail-call it?

http://= www.lua.org/pil/6.3.html

Got it thanks.
--
Regards,
Ryan
--000e0cd34c0678dd74047572accf-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 18:23:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98LNZSl016052; Thu, 8 Oct 2009 18:23:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A9351A6FD; Thu, 8 Oct 2009 18:22:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sirppi.helsinki.fi (sirppi.helsinki.fi [128.214.205.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 603841A614 for ; Thu, 8 Oct 2009 18:22:13 -0300 (BRT) Received: from sirppi.helsinki.fi (localhost [127.0.0.1]) by sirppi.helsinki.fi (8.13.7/8.13.7) with ESMTP id n98LMo01066624 for ; Fri, 9 Oct 2009 00:22:50 +0300 (EEST) Received: (from jpihlaja@localhost) by sirppi.helsinki.fi (8.13.7/8.13.7/Submit) id n98LMn1T068849; Fri, 9 Oct 2009 00:22:49 +0300 (EEST) Date: Fri, 9 Oct 2009 00:22:47 +0300 (EEST) From: M Joonas Pihlaja To: Lua list Subject: Re: LuaForge is down and will be for some time In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Message-ID: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi lua-l, Some of you may know that the Berlios hosting facility has had some issues lately. The latest breakdown prompted the GPSd project to look for other hosting services, and in the process the lead dev wrote a really interesting email to the gpsd-users mailing list concerning project hosting providers which is relevant to LuaForge I think: https://lists.berlios.de/pipermail/gpsd-users/2009-October/004000.html The short of it is: project hosting providers could make it easier to get at your own data. As a tangential point, hosting providers like LuaForge could make it easier for third parties to mirror their data as well. For example, as a part of the recovery of the GPSd project it turned out to be quite useful to have mirrors of the SVN repos, so in the end it only took a few days to splice the entire history of the project back together. On the other end of the spectrum, freedesktop.org recently lost its entire set of user repositories and related on-web content due to a disk crash, and it looks like most of what was lost won't be coming back. Back in the FTP days it was easy(ish) to set mirrors up, but now with the various *Forge-wiki-media-web-thingys it's not so obvious anymore. So for a future LuaForge it would be awesome if mirroring of it would be an easy thing to do. I'm certain people would mirror it if it could be done easily. Concerning the hub-of-links idea, I think this might work for LuaForge, but also want to remind that links on the internet are by nature pretty ephemeral. As some sort of protection against the primary sites going down, it would be great if LuaForge-The-Hub would also provide for caching/mirroring of the actual downloadable goods in case upstream disappears (which it probably will in a link driven site.) As a salient example, consider how often the mirroring of papers done by sites like citeseer is a lifesaver when the authors' sites go away. Quite often citeseer is now the primary web source for some of these articles! Best Regards, Joonas From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 18:44:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Lhw2M020002; Thu, 8 Oct 2009 18:44:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 621161A6FB; Thu, 8 Oct 2009 18:42:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2FC318FF0 for ; Thu, 8 Oct 2009 18:42:33 -0300 (BRT) Received: by bwz22 with SMTP id 22so5689693bwz.5 for ; Thu, 08 Oct 2009 14:43:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.13.210 with SMTP id d18mr1430838bka.211.1255038188975; Thu, 08 Oct 2009 14:43:08 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 23:43:08 +0200 X-Google-Sender-Auth: 5a92bf82a0b79777 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It looks like there are (at least) 2 different needs : #1. A library of Lua libraries where one can download .zip/.tgz and browse libraries by category, #2. A "forge" where one can work on one's projects using Git, Mercurial, SVN, have a ticket system, a wiki, etc #1 could link to #2, as well as link to Github, Bitbucket, Luarocks, whatever. #1 is probably easier to implement it ourselves, maybe in Lua, maybe in some other languages. It needs to handle file uploads correctly. For #2, it's bigger, so it is probably better to use an existing package. I personally use Indefero, a very nice PHP project, LGPLed. I have installed it on a Mac-mini in our office with a Git backend, it works very well : http://www.indefero.net . You might want to try it, it looks a lot like Google Code. At the moment, #1 might be more urgent because LuaForge is down. ---- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 19:03:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98M3QNJ023237; Thu, 8 Oct 2009 19:03:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 312FD192F7; Thu, 8 Oct 2009 19:02:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A568619051 for ; Thu, 8 Oct 2009 19:02:08 -0300 (BRT) Received: by fxm12 with SMTP id 12so329325fxm.5 for ; Thu, 08 Oct 2009 15:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=2c2EVyubJkbnjF8KyFeAJ1vGLbFA44AwywN3U4VEys4=; b=wazyCaJJDRMw92S2l6U32othb0aBhAlXM6ATiOqN5+QavlQcr30gRwr53z9Nmm9dax wyVA7H5hyO1NX+MUapJ2bL/mgsla9pjHLtE6oUPZzvhjN1y5oJxEJEO95PYCSrhhWyN+ ZxqpWvUvl+55A0cXQXWWHmVOtjhSuA8OnPAjY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZX1oTwCNcl+j/mlo8dGSYYGqov8FyjoQ98t7FUqcFKek6L1qzuNNLdP60agDV4lniG wxszCMCfwvvUy3nbxiZoOerf8A5PfBvH9NNapVa/fkFw+gzpMzO7BIWaKVpGCBTF0uQ7 PsZt+YL5azTnysgbkab+64HM9xwjvS89ynCXo= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr1452677bkw.154.1255039366974; Thu, 08 Oct 2009 15:02:46 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 17:02:46 -0500 X-Google-Sender-Auth: c90c606bbd5b764d Message-ID: <5ba75e2f0910081502r284e415bm56ac1835729d2686@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf772a5cdcc0475739f05 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf772a5cdcc0475739f05 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Betrand, just added your observations to http://lua-users.org/wiki/NewCommunityInfrastructure Blessings! On Thu, Oct 8, 2009 at 4:43 PM, Bertrand Mansion wrote: > It looks like there are (at least) 2 different needs : > > #1. A library of Lua libraries where one can download .zip/.tgz and > browse libraries by category, > #2. A "forge" where one can work on one's projects using Git, > Mercurial, SVN, have a ticket system, a wiki, etc > > #1 could link to #2, as well as link to Github, Bitbucket, Luarocks, > whatever. > #1 is probably easier to implement it ourselves, maybe in Lua, maybe > in some other languages. It needs to handle file uploads correctly. > > For #2, it's bigger, so it is probably better to use an existing > package. I personally use Indefero, a very nice PHP project, LGPLed. I > have installed it on a Mac-mini in our office with a Git backend, it > works very well : http://www.indefero.net . You might want to try it, > it looks a lot like Google Code. > > At the moment, #1 might be more urgent because LuaForge is down. > > ---- > Bertrand Mansion > Mamasam > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf772a5cdcc0475739f05 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Betrand, just added your observations to http://lua-users.org/wiki/NewCommunity= Infrastructure

Blessings!

On T= hu, Oct 8, 2009 at 4:43 PM, Bertrand Mansion <lua@mamasam.net> wrote:
It looks like the= re are (at least) 2 different needs :

#1. A library of Lua libraries where one can download .zip/.tgz and
browse libraries by category,
#2. A "forge" where one can work on one's projects using Git,=
Mercurial, SVN, have a ticket system, a wiki, etc

#1 could link to #2, as well as link to Github, Bitbucket, Luarocks, whatev= er.
#1 is probably easier to implement it ourselves, maybe in Lua, maybe
in some other languages. It needs to handle file uploads correctly.

For #2, it's bigger, so it is probably better to use an existing
package. I personally use Indefero, a very nice PHP project, LGPLed. I
have installed it on a Mac-mini in our office with a Git backend, it
works very well : htt= p://www.indefero.net . You might want to try it,
it looks a lot like Google Code.

At the moment, #1 might be more urgent because LuaForge is down.

----
Bertrand Mansion
Mamasam



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf772a5cdcc0475739f05-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 19:17:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98MHexW025196; Thu, 8 Oct 2009 19:17:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77BE1183AC; Thu, 8 Oct 2009 19:16:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6050E19051 for ; Thu, 8 Oct 2009 19:16:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so337589fxm.5 for ; Thu, 08 Oct 2009 15:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=drH7V1/qpazLf1r1UTvepLIkTcZcT3/k3h40T//63k4=; b=UdrI36QV7QO10xn7tHiKFCPuziCZDP/IJeBRpxpCnYt62wAocb9SfiUJ0JrLBEsf6y +187d2NW2kCSQHE7b8OiOCUXmsWbmu/aAWmdbtYcnppDJtrC2SMnu/T6kGdYlCRIqpcg VCgX4LRGzhAelp1j83TuE2jX6XEZKi4t7o+pk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ij3OOTfKSw1ejRiTvf/bu6GlC1hwSmMp53xFvlisPjds6z1VpBkU34rzO6+VVnywx6 tRuFkdfl5YqpRePwe7pt7nJabho8dtS2PmewAwfzQFB9NZVlBJUCvczlQWXjPM7X/sro h45gL0i+7CAUSdNrO9Z+DYU5GNsCYIIRD3RlM= MIME-Version: 1.0 Received: by 10.204.20.82 with SMTP id e18mr1486814bkb.168.1255040202657; Thu, 08 Oct 2009 15:16:42 -0700 (PDT) In-Reply-To: References: <4ff79edb0909300148g13016819r67bab991e0bee764@mail.gmail.com> <1EFA5AEA-8F94-411F-870A-947E28116ABD@gmail.com> <560972290910020303h57f2d641r5d57b31c166191d1@mail.gmail.com> <4ff79edb0910020338k6b0601efnf2c91d3344a3a5bd@mail.gmail.com> <560972290910020435h1493debbybd77ecd0da5208dc@mail.gmail.com> <20091003183844.A32021@lua.tecgraf.puc-rio.br> <4ff79edb0910040712q6e9ccbdfx8ddbca5a40e459ba@mail.gmail.com> Date: Fri, 9 Oct 2009 00:16:42 +0200 Message-ID: <4ff79edb0910081516t39c54e5y2c7f071610e53166@mail.gmail.com> Subject: Re: GSL Shell software announcement From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=000325559f56754f2d047573d145 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559f56754f2d047573d145 Content-Type: text/plain; charset=ISO-8859-1 Hi David, thank you very much for you feedback and your help with LuaDist. I've integrated your suggestions, now the file 'makeconfig' allow you to - disable the support for complex numbers => GSL shell can be loaded as a library with a standard Lua binary, you will only miss complex numbers and related functions - if you enable 'enable-shared' only the shared library will be builded and gsl and math functions will be in a separate namespaces. Please note that in this case you cannot load 'igsl.lua' and 'integ.lua' as it is but this is probably a minor problem I've also improved/simplified the makefile. I've also completed the support for the integration routines: http://www.nongnu.org/gsl-shell/integ.html now integrating a function with an algebraic-logarithmic singularity or calculating a Fourier integral is like eating a piece of cake :-) More seriously, now GSL shell features a more that complete interface to the numerical integration routines of GSL and the documentation is also more beautiful. I will appreciate any feedback. Best regards, Francesco 2009/10/7 David Manura > On Sun, Oct 4, 2009 at 10:12 AM, Francesco Abbate wrote: > > I've done like you suggested, now the Lua file 'lmathlib.c' is unchanged. > > I've changed only my top-level file, gsl-shell.c in order to charge the > math > > library as you suggested, thank you very much. > > So, now GSL shell just use a vanilla copy of Lua 5.1.4 with LNUM patch, I > > don't know if this help in order to put it LuaDist. For me there are two > > possible utilisation of GSL shell: > > - as a stand-alone program => in this case a top-level program charges > all > > the needed > > library. In this case we can collapse the math and gsl functions in the > > common namespace > > - as a normal lua library => in this case a separate namespace is used > for > > gsl and math > > functions. I've already integrated this possibility in the software > with > > the FLAG > > USE_SEPARATE_NAMESPACE in defs.h > > For me it would be nice if GSL Shell can be made available as a library > to > > Lua users even in my main goal in the stand-alone program. > > Francesco > > Thanks. Here's some more comments: > > - gslshell builds from LuaDist now [1], as least under Linux and > MinGW: "luadist ~/gsl install gslshell". This in turn builds the > dependencies gsl and lualnum. (Side-note: It's better to install into > some alternate location, e.g. "~/gsl" as above, since gslshell > installs lualnum, which would otherwise overwrite the standard version > of lua that LuaDist is running under.) > > - gslshell doesn't currently build under MSVC, Cygwin, and maybe > others due gslshell's dependency on complex.h. If you allow that > dependency to be selectively disabled, we can make it work on these > platforms too. A lot of applications under standard Lua that might > want to use gslshell as a library don't require complex numbers. > > - The gsl-shell application currently statically links to the > gsl-shell module code instead of dynamically linking to the gsl-shell > module. This is made necessary because the gsl-shell module defines > USE_SEPARATE_NAMESPACE, while the gsl-shell application expects this > to be undefined. I think the better way to do this is to always > enable USE_SEPARATE_NAMESPACE. Then in gsl-shell call some function > that moves or copies the members of the "gsl" and "math" tables into > the global table as a convenience. In gsl-shell, I see no reason not > to have both math.sqrt and sqrt defined and both cnew and gsl.cnew > defined. This would allow a user to run standard Lua code inside > gsl-shell. > > - The gsl Lua module is named lua-gsl.so. This implies that the Lua > gsl module is loaded by require "lua-gsl", which in turn creates the > table "gsl". It would be more consistent to name this gsl.so so that > the user can do require "gsl". (This gsl.so is not to be confused > with libgsl.so, which is GSL itself.) > > - I think reStructuredText/Sphinx is solid stuff and would recommend > other Lua module authors consider using it, despite perhaps (like me) > an initial hesitation with the superficial ".. :: _" syntax. > > [1] http://lua-users.org/wiki/LuaDist > --000325559f56754f2d047573d145 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi David,

thank you very much for you feedback and your = help with LuaDist. I've integrated your suggestions, now the file '= makeconfig' allow you to
- disable the support for complex nu= mbers =3D> GSL shell can be loaded as a library
=A0=A0with a standard Lua binary, you will only miss complex numbers a= nd related functions
- if you enable 'enable-shared' only= the shared library will be builded and gsl and math
=A0=A0functi= ons will be in a separate namespaces. Please note that in this case you can= not
=A0=A0load 'igsl.lua' and 'integ.lua' as it is but thi= s is probably a minor problem

I've also improv= ed/simplified the makefile. I've also completed the support for the int= egration
now integrating a fun= ction with an algebraic-logarithmic singularity or calculating a Fourier in= tegral is like eating a piece of cake :-)
More seriously, now GSL shell features a more that complete interface = to the numerical integration routines of GSL and the documentation is also = more beautiful.

I will appreciate any feedback.

Best regards,
Francesco

2009/10/7 David Manura <dm.lua@math2.org>
On Sun, Oct 4, 2009 at 10:12 AM, Francesco Abbate wrote:<= br> > I've done like you suggested, now the Lua file 'lmathlib.c'= ; is unchanged.
> I've changed only my top-level file, gsl-shell.c in order to charg= e the math
> library as you suggested, thank you very much.
> So, now GSL shell just use a vanilla copy of Lua 5.1.4 with LNUM patch= , I
> don't know if this help in order to put it LuaDist. For me there a= re two
> possible utilisation of GSL shell:
> - as a stand-alone program =3D> in this case a top-level program ch= arges all
> the needed
> =A0=A0library. In this case we can collapse the math and gsl functions= in the
> common namespace
> - as a normal lua library =3D> in this case a separate namespace is= used for
> gsl and math
> =A0=A0 functions. I've already integrated this possibility in the = software with
> the FLAG
> =A0=A0 USE_SEPARATE_NAMESPACE in defs.h
> For me it would be nice if GSL Shell can be made available as a librar= y to
> Lua users even in my main goal in the stand-alone program.
> Francesco

Thanks. =A0Here's some more comments:

- gslshell builds from LuaDist now [1], as least under Linux and
MinGW: "luadist ~/gsl install gslshell". =A0This in turn builds t= he
dependencies gsl and lualnum. =A0(Side-note: It's better to install int= o
some alternate location, e.g. "~/gsl" as above, since gslshell installs lualnum, which would otherwise overwrite the standard version
of lua that LuaDist is running under.)

- gslshell doesn't currently build under MSVC, Cygwin, and maybe
others due gslshell's dependency on complex.h. =A0If you allow that
dependency to be selectively disabled, we can make it work on these
platforms too. =A0A lot of applications under standard Lua that might
want to use gslshell as a library don't require complex numbers.

- The gsl-shell application currently statically links to the
gsl-shell module code instead of dynamically linking to the gsl-shell
module. =A0This is made necessary because the gsl-shell module defines
USE_SEPARATE_NAMESPACE, while the gsl-shell application expects this
to be undefined. =A0I think the better way to do this is to always
enable USE_SEPARATE_NAMESPACE. =A0Then in gsl-shell call some function
that moves or copies the members of the "gsl" and "math"= ; tables into
the global table as a convenience. =A0In gsl-shell, I see no reason not
to have both math.sqrt and sqrt defined and both cnew and gsl.cnew
defined. =A0This would allow a user to run standard Lua code inside
gsl-shell.

- The gsl Lua module is named lua-gsl.so. =A0This implies that the Lua
gsl module is loaded by require "lua-gsl", which in turn creates = the
table "gsl". =A0It would be more consistent to name this gsl.so s= o that
the user can do require "gsl". =A0(This gsl.so is not to be confu= sed
with libgsl.so, which is GSL itself.)

- I think reStructuredText/Sphinx is solid stuff and would recommend
other Lua module authors consider using it, despite perhaps (like me)
an initial hesitation with the superficial ".. :: _" syntax.

[1] http://= lua-users.org/wiki/LuaDist

--000325559f56754f2d047573d145-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 19:21:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98MLEAf026051; Thu, 8 Oct 2009 19:21:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70B2D1A6B0; Thu, 8 Oct 2009 19:20:13 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 248801844B for ; Thu, 8 Oct 2009 19:20:08 -0300 (BRT) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1Mw1Lr-0001gv-HI for lua@bazar2.conectiva.com.br; Thu, 08 Oct 2009 15:20:47 -0700 Subject: debugging/logging question From: Norbert Kiesel To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset="UTF-8" Date: Thu, 08 Oct 2009 15:20:40 -0700 Message-Id: <1255040440.16503.161.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, is it possible to get the name of a variable within Lua if I only have the variable? I want to write a small helper function logger that basically prints the name and the value of the variable function logger(name, value) print(name, 'has value', value) end foo = 'hello' logger('foo', foo) Now I'd like to just call "logger(foo)" and get the same output. From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 19:45:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98MiwPt028854; Thu, 8 Oct 2009 19:44:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA0CA192FD; Thu, 8 Oct 2009 19:43:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4A5E18D88 for ; Thu, 8 Oct 2009 19:43:44 -0300 (BRT) Received: by bwz22 with SMTP id 22so5722949bwz.5 for ; Thu, 08 Oct 2009 15:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4TFpD+xcqnF2NrwIlfcVqgloPN9t89QtfPNXv//XDd0=; b=rNou1Jer8BLARIUcNLAe3zt2WoPBBc5l6kBPimWJzhP+EHWMWUA5DTapfkqcigENKw 7+10m4S/Q04lXy133ENvrmvK1Cny4JBtQDlmxdogW2flDaDVno8VVKiPXocwLEFqlFaN keF3XCKkjDUr8zSaRz4WGIQXot3ERpleWn1dw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=js/7EvjGKQ6VLiT4RNOEz5jvV3+EWgMIgRQJhnUIqBK1eiJOmgP95CS2GxqGIK7/ai QYPDyFPB2ZH3SZQoJ/mCfUsIRXZz2TMbqHmw7BrcUDR/JnDh9X2Xlpy3OpWQ++im+77i lF+QQG2WFwNdDfg0opPaQ6sYBlhTq/UlbXhhs= MIME-Version: 1.0 Received: by 10.223.14.91 with SMTP id f27mr551290faa.90.1255041863070; Thu, 08 Oct 2009 15:44:23 -0700 (PDT) In-Reply-To: <1255040440.16503.161.camel@defiant.tbdnetworks.com> References: <1255040440.16503.161.camel@defiant.tbdnetworks.com> Date: Thu, 8 Oct 2009 23:44:22 +0100 Message-ID: Subject: Re: debugging/logging question From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n98MiwPt028854 On Thu, Oct 8, 2009 at 11:20 PM, Norbert Kiesel wrote: > Hi, > > is it possible to get the name of a variable within Lua if I only have > the variable?  I want to write a small helper function logger that > basically prints the name and the value of the variable > > function logger(name, value) print(name, 'has value', value) end > foo = 'hello' > logger('foo', foo) > > Now I'd like to just call "logger(foo)" and get the same output. I don't think there is any way for logger() to determine that - all it has is the evaluated value of foo, not some reference to the token 'foo'. If you don't mind it being logger('foo') instead of logger(foo), that's doable: do function logger(varname) local i = 1 while true do local lname,lvalue = debug.getlocal(2,i) if (lname == varname) then print(lname, "has value", lvalue) break elseif (lname == nil) then print(varname, "has value", _G[varname]) break end i = i + 1 end end globalvar = 10 function test() local localvar = 5 logger('localvar') logger('globalvar') end test() end ...though as it is that will only work for local variables inside test(), not "outer" locals. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 20:37:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98NbMsZ002507; Thu, 8 Oct 2009 20:37:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB0D118B12; Thu, 8 Oct 2009 20:36:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f185.google.com (mail-yw0-f185.google.com [209.85.211.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A86518959 for ; Thu, 8 Oct 2009 20:36:07 -0300 (BRT) Received: by ywh15 with SMTP id 15so6168234ywh.5 for ; Thu, 08 Oct 2009 16:36:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.45.22 with SMTP id x22mr1041766agj.120.1255045003729; Thu, 08 Oct 2009 16:36:43 -0700 (PDT) Date: Fri, 9 Oct 2009 02:36:43 +0300 X-Google-Sender-Auth: 4903fe4074229938 Message-ID: Subject: mirror of main luarocks repository? From: Cosmin Apreutesei To: lua Content-Type: multipart/alternative; boundary=001636283f499fdb32047574ef27 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636283f499fdb32047574ef27 Content-Type: text/plain; charset=UTF-8 Hi, Since luarocks.luaforge.org is down, can someone point me to any mirrors of the main luarocks repository ? Thanks. --001636283f499fdb32047574ef27 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,

Since luaro= cks.luaforge.org is down, can someone point me to any mirrors of the ma= in=C2=A0luarocks repository=C2=A0?

Thanks.

--001636283f499fdb32047574ef27-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 20:41:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98NfAls003013; Thu, 8 Oct 2009 20:41:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5BC51A6CB; Thu, 8 Oct 2009 20:40:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BAB91A5D9 for ; Thu, 8 Oct 2009 20:40:02 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 181E38CDCC for ; Thu, 8 Oct 2009 19:40:41 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 08 Oct 2009 19:40:41 -0400 X-Sasl-enc: Vn3j6R8F5ZmwvM3Dxh9iKsuGYLJEgHHH+bLhv5gfKuT2 1255045240 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id 602281FA6A for ; Thu, 8 Oct 2009 19:40:40 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Documentation Markup Date: Fri, 9 Oct 2009 12:40:07 +1300 Message-Id: To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I'm about to start improving the documentation for Rima (a tool for building math models and a binding to LP solvers), and it seems like two tools would be really useful: 1) The documentation is in markdown (is that a good choice?) and has code examples like: [[ You can treat expressions just like variables: x, y = rima.R"x, y" e = x * y =e * x * y --> x*y*x*y ]] What would be really cool would be a tool that read the markdown file, found all the code blocks, ran them and checked that the output matched the comment. It would me even cooler if it syntax-coloured the Lua code (not that there's much to colour in the example above). 2) I have some example files with comments explaining what they do. A tool that ran over the file, and turned it into a markdown document with the lua code embedded in it would be fantastic too. I'm not talking about a doxygen or LuaDoc type thing, I'd want the full text of the example file, just kind of turned inside out. Before I start hacking together a rudimentary implementation, does anyone know if such things already exist? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 20:41:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Nfd9F003091; Thu, 8 Oct 2009 20:41:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7AC11A716; Thu, 8 Oct 2009 20:40:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 773941A6CD for ; Thu, 8 Oct 2009 20:40:21 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n98Nf0tc003005 for ; Thu, 8 Oct 2009 20:41:00 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n98Nf0I30194; Thu, 8 Oct 2009 20:41:00 -0300 Date: Thu, 8 Oct 2009 20:40:59 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: mirror of main luarocks repository? Message-ID: <20091008204059.A30191@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from cosmin.apreutesei@gmail.com on Fri, Oct 09, 2009 at 02:36:43AM +0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Since luarocks.luaforge.org is down, can someone point me to any mirrors of > the main luarocks repository ? http://www.luarocks.org/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 21:03:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9903XFJ005839; Thu, 8 Oct 2009 21:03:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAA5318688; Thu, 8 Oct 2009 21:02:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1467A18660 for ; Thu, 8 Oct 2009 21:02:23 -0300 (BRT) Received: by fxm12 with SMTP id 12so388801fxm.5 for ; Thu, 08 Oct 2009 17:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=0BZANldhaCms+u5PYuvqAwO09228MJXNAA2nno7XZgA=; b=l1zBNGz/+HJCvQqkM6DMV7wSCSjwMBQfpEOdff6nFD7q6XhxRKDqZqaij9KEeJ7wBv K3Fp1Eqn3tQ/3cemIBPuj6m3As3GzJU/2k3spdH1TZvo2STpg7uLKVjywK6yFrw/oFtT dFCSscN1k3AlIPNxtpXVWFws0uz/PdCKfCnAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=WUEpt8pWR5e+ON4z0HsHU4ldqkHvwu7646QSKV9skzSh7HqFxNwTbKcPo2LG71SfXJ vL5pRHPfbxCQpfW4zXYS1D6xUlESlmcx0ZXl7x5OagewzSHGbJcM98JcnP1obZVRx/gv yztoWZJOFyEgXZMrzef+qP92dps2zgmkZuyKQ= MIME-Version: 1.0 Received: by 10.204.8.13 with SMTP id f13mr1571738bkf.150.1255046580426; Thu, 08 Oct 2009 17:03:00 -0700 (PDT) In-Reply-To: References: From: Hisham Date: Thu, 8 Oct 2009 21:02:40 -0300 Message-ID: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> Subject: Re: mirror of main luarocks repository? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9903XFJ005839 On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei wrote: > Hi, > Since luarocks.luaforge.org is down, can someone point me to any mirrors of > the main luarocks repository ? I was just taking care of this, today. Add these to your configuration: rocks_servers = { "http://www.luarocks.org/repositories/rocks/", "http://www.luarocks.org/repositories/rocks-cvs/" } -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 21:04:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9904nox006044; Thu, 8 Oct 2009 21:04:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58B0B186DA; Thu, 8 Oct 2009 21:03:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4B7D18660 for ; Thu, 8 Oct 2009 21:03:45 -0300 (BRT) Received: by yxe17 with SMTP id 17so226306yxe.33 for ; Thu, 08 Oct 2009 17:04:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.125.3 with SMTP id x3mr1075797agc.23.1255046663224; Thu, 08 Oct 2009 17:04:23 -0700 (PDT) In-Reply-To: <20091008204059.A30191@lua.tecgraf.puc-rio.br> References: <20091008204059.A30191@lua.tecgraf.puc-rio.br> Date: Fri, 9 Oct 2009 03:04:23 +0300 X-Google-Sender-Auth: 9b89ed142e1599be Message-ID: Subject: Re: mirror of main luarocks repository? From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=00163630fee589bfae047575522f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163630fee589bfae047575522f Content-Type: text/plain; charset=UTF-8 I can't find the repository manifest file anywhere at this domain. Any hints? On Fri, Oct 9, 2009 at 02:40, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > Since luarocks.luaforge.org is down, can someone point me to any mirrors > of > > the main luarocks repository ? > > http://www.luarocks.org/ > --00163630fee589bfae047575522f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I can't find the repository manifest file anywhere at this domain. Any = hints?

On Fri, Oct 9, 2009 at 02:40, Luiz= Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> Since luarocks.luaforge.org is down, can someone p= oint me to any mirrors of
> the main luarocks repository ?

http://www.luarocks.= org/

--00163630fee589bfae047575522f-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 21:05:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9905Wb1006177; Thu, 8 Oct 2009 21:05:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD3DD1877F; Thu, 8 Oct 2009 21:04:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F0B318660 for ; Thu, 8 Oct 2009 21:04:24 -0300 (BRT) Received: by yxe17 with SMTP id 17so226700yxe.33 for ; Thu, 08 Oct 2009 17:05:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.128.9 with SMTP id a9mr1006610agd.117.1255046703060; Thu, 08 Oct 2009 17:05:03 -0700 (PDT) In-Reply-To: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> References: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> Date: Fri, 9 Oct 2009 03:05:03 +0300 X-Google-Sender-Auth: d315edd1c2865e04 Message-ID: Subject: Re: mirror of main luarocks repository? From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=00163630f885e9972404757554a3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163630f885e9972404757554a3 Content-Type: text/plain; charset=UTF-8 Great, thanks! On Fri, Oct 9, 2009 at 03:02, Hisham wrote: > On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei > wrote: > > Hi, > > Since luarocks.luaforge.org is down, can someone point me to any mirrors > of > > the main luarocks repository ? > > I was just taking care of this, today. Add these to your configuration: > > rocks_servers = { > "http://www.luarocks.org/repositories/rocks/", > "http://www.luarocks.org/repositories/rocks-cvs/" > } > > -- Hisham > --00163630f885e9972404757554a3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Great, thanks!

On Fri, Oct 9, 2009 at 03:= 02, Hisham <hisham.hm= @gmail.com> wrote:
On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei
<cosmin.apreutesei@gmail.= com> wrote:
> Hi,
> Since luarocks.luaforge.org is down, can someone point me to any= mirrors of
> the main=C2=A0luarocks repository=C2=A0?

I was just taking care of this, today. Add these to your configuratio= n:

rocks_servers =3D {
"http://www.luarocks.org/repositories/rocks/",
"http://www.luarocks.org/repositories/rocks-cvs/"
}

-- Hisham

--00163630f885e9972404757554a3-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 21:20:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n990Kobg008152; Thu, 8 Oct 2009 21:20:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 936D91A70B; Thu, 8 Oct 2009 21:19:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D58F1A5D9 for ; Thu, 8 Oct 2009 21:19:34 -0300 (BRT) Received: by fxm12 with SMTP id 12so395487fxm.5 for ; Thu, 08 Oct 2009 17:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Fss/l37myrqOWcpM7PN2faoIbk5qTJCIKmCZAQHncN4=; b=PjDcJ62MTqal0cY03GraMZgDjtIXw2z3JefCC15u2Lp3OjlCuYNW2RN9NROAH+TWT1 S0dYclCox1PToB7VZ+sFdO8nhtcvilXr4GH6++dOiH5HpApcZH4ufBiAtR5wsMngEmYC x0W8Dd1a8kHhcPETnYlz0PkKYqUHr0l2GA0s0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=IAdKIT1ESL2z3BWSkZMxSMkmBFq9AvZr/DRk5rP0kCoZMtsPBZFe4wYDgICHqQ30yt 28n8Q/lWKaXRS+KvfabyXPZNUXWDPkfPttMfUVQT0MJWf5CESRIoyPnombfw+zxsdm3N QGKO/bNas0YMUFY0zF5w4fJaWuZzvk9wgmoVQ= MIME-Version: 1.0 Received: by 10.204.8.155 with SMTP id h27mr1609722bkh.55.1255047612111; Thu, 08 Oct 2009 17:20:12 -0700 (PDT) In-Reply-To: References: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> Date: Thu, 8 Oct 2009 19:20:12 -0500 X-Google-Sender-Auth: 6298b96dbe290a59 Message-ID: <5ba75e2f0910081720v14f8353fm8b83d63c267b3898@mail.gmail.com> Subject: Re: mirror of main luarocks repository? From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1fada189cc80475758b6a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1fada189cc80475758b6a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Awesome!!!! On Thu, Oct 8, 2009 at 7:05 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > Great, thanks! > > > On Fri, Oct 9, 2009 at 03:02, Hisham wrote: > >> On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei >> wrote: >> > Hi, >> > Since luarocks.luaforge.org is down, can someone point me to any >> mirrors of >> > the main luarocks repository ? >> >> I was just taking care of this, today. Add these to your configuration: >> >> rocks_servers =3D { >> "http://www.luarocks.org/repositories/rocks/", >> "http://www.luarocks.org/repositories/rocks-cvs/" >> } >> >> -- Hisham >> > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000e0cd1fada189cc80475758b6a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Awesome!!!!

On Thu, Oct 8, 2009 at 7:05 P= M, Cosmin Apreutesei <cosmin.apreutesei@gmail.com> wrote:
Great, thanks!


On Fri, Oct 9, 2009 at 03:02, Hisham <hisham.hm@gmail.com> wrote:
On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei
<cosmin= .apreutesei@gmail.com> wrote:
> Hi,
> Since = luarocks.luaforge.org is down, can someone point me to any mirrors of > the main=C2=A0luarocks repository=C2=A0?

I was just taking care of this, today. Add these to your configuratio= n:

rocks_servers =3D {
"http://www.luarocks.org/repositories/rocks/",
"http://www.luarocks.org/repositories/rocks-cvs/"
}

-- Hisham




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000e0cd1fada189cc80475758b6a-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 22:18:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n991IciS015228; Thu, 8 Oct 2009 22:18:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02C8C1A717; Thu, 8 Oct 2009 22:17:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 482001A681 for ; Thu, 8 Oct 2009 22:17:23 -0300 (BRT) Received: by bwz22 with SMTP id 22so5781750bwz.5 for ; Thu, 08 Oct 2009 18:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=yhl1h54RA51crYsrOH6Gmr7p9wkn4SR1GdrvPXkrtHQ=; b=El+fh4NMxAH8XlftOzCiQztplblVki9+hq7L/EN8MTFRUad+EINvEH+fJYjrWloWXK QtLfN5S/9PF4L61CcwyVR6xkN05gKGTdjClCfLcHee7Q58RGcSFwsDAVOQn0JiK2YgxD RbgoAClKJyXDQqMFkWqvC9v0AymOxG2YHZK0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=KKkQqn+MhCh9FJyMPEjpCdMDdEuNXLs3gqDtMMADVYAzlz53cyC67VAFiEKfwgTSUM Yykll4jqeX5Zlto0CU03u5pGQ4YYYX19C3fmDrKP5ZSjn50hPnztYM2pJzKQR3mxvKx+ wkjQFtdjgUhoKIEg1ud5cJd80gLQbQzzKo1/s= MIME-Version: 1.0 Received: by 10.204.156.19 with SMTP id u19mr1653401bkw.62.1255051081173; Thu, 08 Oct 2009 18:18:01 -0700 (PDT) In-Reply-To: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> References: <5e7d91620910081702n13696323we54faf6d4c5aafd1@mail.gmail.com> From: Hisham Date: Thu, 8 Oct 2009 22:17:41 -0300 Message-ID: <5e7d91620910081817n7c5cf507sfb65992bfc041127@mail.gmail.com> Subject: Re: mirror of main luarocks repository? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n991IciS015228 On Thu, Oct 8, 2009 at 9:02 PM, Hisham wrote: > On Thu, Oct 8, 2009 at 8:36 PM, Cosmin Apreutesei > wrote: >> Hi, >> Since luarocks.luaforge.org is down, can someone point me to any mirrors of >> the main luarocks repository ? > > I was just taking care of this, today. Add these to your configuration: > > rocks_servers = { > "http://www.luarocks.org/repositories/rocks/", > "http://www.luarocks.org/repositories/rocks-cvs/" > } I should probably add that the rocks-cvs repository should probably not be added in the default list, since "cvs" entries take precedence as more recent than versioned entries, which is not desired in the general case (besides the fact that the LuaForge CVS repos are down). So a better configuration is just: rocks_servers = { "http://www.luarocks.org/repositories/rocks/" } -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 23:06:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9926VVa020367; Thu, 8 Oct 2009 23:06:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BFBE1A730; Thu, 8 Oct 2009 23:05:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E6531A6A3 for ; Thu, 8 Oct 2009 23:05:14 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mw4rh-0002Xb-IR for lua@bazar2.conectiva.com.br; Fri, 09 Oct 2009 04:05:53 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 04:05:53 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 04:05:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: LuaForge is down and will be for some time Date: Thu, 8 Oct 2009 19:05:06 -0700 Lines: 85 Message-ID: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think it would be a good plan to remake LuaForge- in Lua, using the Kepler libraries and what not- as just the things visitors see when they come to the site: a project aggregator, providing hosting only for package downloads and project sites, but listing basic information and links to the relevant pages. Rather than have it auto-aggregate from a number of varied sources, however, I think a better plan would be to have it act as a lightweight hub, which would be used as a single point from which to track where the homepage is hosted, what repositories (LuaDist, LuaRocks, deb-pkg, Synaptic, SourceForge, Launchpad, LuaForge itself if package hosting is supported going forward, etc.) it is distributed/mirrored on and which (if any) is the development focus "main" host. Registration would be automated for both users and projects. It would be primarily used, like the current site, as a destination for discovery of applications and libraries that use Lua, categorized by type (application/game with Lua support, Lua library/module/package, Power Patch, set of Lua scripts), then by field (games, sound, graphics - the same tree LuaForge already has (although there might be a different tree for power patches)). Projects could either be registered by the project's manager/developer, with homepage hosting provided and editing allowed only for them ("hub page" style), or by anybody who knows about the project, editable by anyone and owned by no one, but claimable by the project manager at any time after creation ("wiki entry" style). It would also be useful if it provided homepage hosting for Lua projects (like the current version's .luaforge.net sites), since many of the alternative hubs that have been suggested for code hosting and the like do not provide this service (really, everybody but Sourceforge). The biggest thing LuaForge could non-redundantly provide (assuming this would be possible) would be Kepler Lua Page support in project sites. This could be complimented with a page for adding files for the most common project page setups (such as Sputnik or a set of Lua scripts that generates pages that look like the Kepler manuals whose style 90% of LuaForge projects copy). Hosting Lua Pages would also provide a convenient avenue for library projects to provide a live demo. As stated though, bug tracking and source control are best handled by many other sites that make this their sole purpose. I think a good model to work from would be Launchpad (http://launchpad.net). Once you've registered for an account, you can create a page for your project simply by following a link and choosing a long name and a Unix name for it, at which point you enter your details (project homepage, where the packages are, where the source is, where the bug tracking is), with opt-in choices for each of the details for services that Launchpad provides. "Andre Carregal" wrote in message news:92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com... > I have bad news about LuaForge, the damage on LuaForge might take some > time to recover. We have data backups for everything, but redoing a > GForge installation is going to take a while. To make things harder, > we are all involved today in the Lua Workshop so this may impact the > recovery time too. > > The current plan is to create a new GForge setup and import the data. > If there is anyone on the list with GForge knowledge, please contact > me off list. > > I'll keep the list informed about the progress on this operation but > our expectations are that this will certainly take a few days. > Unfortunately, until them we are out of luck with these services: > > luaforge.net main site (catalog, project info, files downloads, CVS, > issue tracker, forums) > projects mailing lists > projects FTP (the project_name.luaforge.net sites are up) > > I'm really sorry for the trouble this have caused for everyone using > LuaForge services and I hope we can have everything back asap. > > Meanwhile, I'd like to know what you think about eventually moving > from this setup based on GForge to one based on something else. One > option would be to recommend that projects moved their SCM to sites > like github or Google Code and then leave luaforge.net as just a > catalog and news site. > > Of course this eventual migration would be possible only after > LuaForge is back up (still using GForge). > > Thanks in advance for your patience. > > André > From lua-bounces@bazar2.conectiva.com.br Thu Oct 8 23:57:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n992vatq025065; Thu, 8 Oct 2009 23:57:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B722A1A733; Thu, 8 Oct 2009 23:56:12 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D2601A6DA for ; Thu, 8 Oct 2009 23:56:06 -0300 (BRT) Received: by bwz22 with SMTP id 22so5813047bwz.5 for ; Thu, 08 Oct 2009 19:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=QhTORLAFWNujj90l6b6UVJOnKBPvCrVVcGGye1Jx1lg=; b=aMksM0msL2/eJM5NFBR+deazYX4Axxr5GFZcRzgiVb40thkpevbHOTMheTTNLd6/4/ atAB9z3pi8/wiGdN76EsChbhhQJijWLinPkvYGvlwi2BLqUkfFnVrVXFokWhQLENj6Uv fIJwKyWR5PfMD9ivDE7jK2Upo7KhpJzr3k9ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Su8oPIhO8NBh/JjlHFC/8g1z67MvpUyVPUpBGMp9y45llTIQHXAucBaUp851kiRjDQ H6n99PpSADvkCXxCOF6UdEOkpzAL62mjhjUgTy/x7NtAkwprbJ2wjFEnIXzB7hVuCEEs xnGhiait1OwDg/CjXvPhO4x40U471OY9tGC5U= MIME-Version: 1.0 Received: by 10.204.154.85 with SMTP id n21mr1654710bkw.171.1255057004453; Thu, 08 Oct 2009 19:56:44 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Thu, 8 Oct 2009 21:56:44 -0500 X-Google-Sender-Auth: 1517d6b01fc36ff5 Message-ID: <5ba75e2f0910081956s6123ec0fvd6c308d6fafe0a41@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175d0a3cec6014047577ba31 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d0a3cec6014047577ba31 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm a web developer, I do my living remotelly :), In short: a telecommuter= . The fundamental rock for me is communication+reliability, if I don't have this, my projects simply fail and don't talk about bills... I have learned = a lot of this from Drupal and his Community, it is a leading Open Source CMS and Web Development Framework. You can do things like groups.drupal.org or openatrium.com :D So... we can build a new LuaHub with Lua, but when? do we really have all the resources(time+money+volunteers) to make it possible and reliable? The problem is that current LuaForge is unmaintainable right?, so... Why do not temporarily use *working* stuff? My hope on this is to awake participation from community, what about Perl, RoR or Python solutions? I'm sure there are other alternatives which may fi= t what *we*(community) need according to the *available resources*. First question: How much are _exactly_ the available resources for next 12 months? hosting? human resources? Second question: How much is the demand? web stats? downloads? common feature requests? Got it? We need to answer this for a serious project, so we can propose a real solution. Call it sustainable, reliable, cost-effective, viable, ... Blessings! On Thu, Oct 8, 2009 at 9:05 PM, Stuart P.Bentley wro= te: > I think it would be a good plan to remake LuaForge- in Lua, using the > Kepler libraries and what not- as just the things visitors see when they > come to the site: a project aggregator, providing hosting only for packag= e > downloads and project sites, but listing basic information and links to t= he > relevant pages. > > Rather than have it auto-aggregate from a number of varied sources, > however, I think a better plan would be to have it act as a lightweight h= ub, > which would be used as a single point from which to track where the homep= age > is hosted, what repositories (LuaDist, LuaRocks, deb-pkg, Synaptic, > SourceForge, Launchpad, LuaForge itself if package hosting is supported > going forward, etc.) it is distributed/mirrored on and which (if any) is = the > development focus "main" host. Registration would be automated for both > users and projects. > > It would be primarily used, like the current site, as a destination for > discovery of applications and libraries that use Lua, categorized by type > (application/game with Lua support, Lua library/module/package, Power Pat= ch, > set of Lua scripts), then by field (games, sound, graphics - the same tre= e > LuaForge already has (although there might be a different tree for power > patches)). Projects could either be registered by the project's > manager/developer, with homepage hosting provided and editing allowed onl= y > for them ("hub page" style), or by anybody who knows about the project, > editable by anyone and owned by no one, but claimable by the project mana= ger > at any time after creation ("wiki entry" style). > > It would also be useful if it provided homepage hosting for Lua projects > (like the current version's .luaforge.net sites), since many of > the alternative hubs that have been suggested for code hosting and the li= ke > do not provide this service (really, everybody but Sourceforge). The bigg= est > thing LuaForge could non-redundantly provide (assuming this would be > possible) would be Kepler Lua Page support in project sites. This could b= e > complimented with a page for adding files for the most common project pag= e > setups (such as Sputnik or a set of Lua scripts that generates pages that > look like the Kepler manuals whose style 90% of LuaForge projects copy). > Hosting Lua Pages would also provide a convenient avenue for library > projects to provide a live demo. > > As stated though, bug tracking and source control are best handled by man= y > other sites that make this their sole purpose. > > I think a good model to work from would be Launchpad (http://launchpad.ne= t). > Once you've registered for an account, you can create a page for your > project simply by following a link and choosing a long name and a Unix na= me > for it, at which point you enter your details (project homepage, where th= e > packages are, where the source is, where the bug tracking is), with opt-i= n > choices for each of the details for services that Launchpad provides. > > "Andre Carregal" wrote in message > news:92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com... > >> I have bad news about LuaForge, the damage on LuaForge might take some >> time to recover. We have data backups for everything, but redoing a >> GForge installation is going to take a while. To make things harder, >> we are all involved today in the Lua Workshop so this may impact the >> recovery time too. >> >> The current plan is to create a new GForge setup and import the data. >> If there is anyone on the list with GForge knowledge, please contact >> me off list. >> >> I'll keep the list informed about the progress on this operation but >> our expectations are that this will certainly take a few days. >> Unfortunately, until them we are out of luck with these services: >> >> luaforge.net main site (catalog, project info, files downloads, CVS, >> issue tracker, forums) >> projects mailing lists >> projects FTP (the project_name.luaforge.net sites are up) >> >> I'm really sorry for the trouble this have caused for everyone using >> LuaForge services and I hope we can have everything back asap. >> >> Meanwhile, I'd like to know what you think about eventually moving >> from this setup based on GForge to one based on something else. One >> option would be to recommend that projects moved their SCM to sites >> like github or Google Code and then leave luaforge.net as just a >> catalog and news site. >> >> Of course this eventual migration would be possible only after >> LuaForge is back up (still using GForge). >> >> Thanks in advance for your patience. >> >> Andr=C3=A9 >> >> > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175d0a3cec6014047577ba31 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm a web developer, I do my living remotelly :), In short: a telecommuter. The fundamental rock for me is communication+reliability, if I don't have this, my projects simply fail and don't talk about bills... I have learned a lot of this from Drupal and his Community, it is a leading Open Source CMS and Web Development Framework. You can do things like
groups.drupal.org or <= a href=3D"http://openatrium.com">openatrium.com :D
So... we can buil= d a new LuaHub with Lua, but when? do we really have all the resources(time= +money+volunteers) to make it possible and reliable? The problem is that cu= rrent LuaForge is unmaintainable right?, so... Why do not temporarily use *= working* stuff?
My hope on this is to awake participation from community, what about Perl, = RoR or Python solutions? I'm sure there are other alternatives which ma= y fit what *we*(community) need according to the *available resources*.

First question: How much are _exactly_ the available resources for next= 12 months? hosting? human resources?
Second question: How much is the = demand? web stats? downloads? common feature requests?

Got it?

We need to answer this for a serious project, so we can propose a real = solution. Call it sustainable, reliable, cost-effective, viable, ...
Blessings!

On Thu, Oct 8, 2009 at 9:05 P= M, Stuart P.Bentley <stuart@testtrack4.com> wrote:
I think it would = be a good plan to remake LuaForge- in Lua, using the Kepler libraries and w= hat not- as just the things visitors see when they come to the site: a proj= ect aggregator, providing hosting only for package downloads and project si= tes, but listing basic information and links to the relevant pages.

Rather than have it auto-aggregate from a number of varied sources, however= , I think a better plan would be to have it act as a lightweight hub, which= would be used as a single point from which to track where the homepage is = hosted, what repositories (LuaDist, LuaRocks, deb-pkg, Synaptic, SourceForg= e, Launchpad, LuaForge itself if package hosting is supported going forward= , etc.) it is distributed/mirrored on and which (if any) is the development= focus "main" host. Registration would be automated for both user= s and projects.

It would be primarily used, like the current site, as a destination for dis= covery of applications and libraries that use Lua, categorized by type (app= lication/game with Lua support, Lua library/module/package, Power Patch, se= t of Lua scripts), then by field (games, sound, graphics - the same tree Lu= aForge already has (although there might be a different tree for power patc= hes)). Projects could either be registered by the project's manager/dev= eloper, with homepage hosting provided and editing allowed only for them (&= quot;hub page" style), or by anybody who knows about the project, edit= able by anyone and owned by no one, but claimable by the project manager at= any time after creation ("wiki entry" style).

It would also be useful if it provided homepage hosting for Lua projects (l= ike the current version's <project>.luaforge.net sites), since many of the alternative= hubs that have been suggested for code hosting and the like do not provide= this service (really, everybody but Sourceforge). The biggest thing LuaFor= ge could non-redundantly provide (assuming this would be possible) would be= Kepler Lua Page support in project sites. This could be complimented with = a page for adding files for the most common project page setups (such as Sp= utnik or a set of Lua scripts that generates pages that look like the Keple= r manuals whose style 90% of LuaForge projects copy). Hosting Lua Pages wou= ld also provide a convenient avenue for library projects to provide a live = demo.

As stated though, bug tracking and source control are best handled by many = other sites that make this their sole purpose.

I think a good model to work from would be Launchpad (http://launchpad.net). Once you've re= gistered for an account, you can create a page for your project simply by f= ollowing a link and choosing a long name and a Unix name for it, at which p= oint you enter your details (project homepage, where the packages are, wher= e the source is, where the bug tracking is), with opt-in choices for each o= f the details for services that Launchpad provides.

"Andre Carregal" <carregal@fabricadigital.com.br> wrote in mes= sage news:92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com...
I have bad news about LuaForge, the damage on LuaForge might take some
time to recover. We have data backups for everything, but redoing a
GForge installation is going to take a while. To make things harder,
we are all involved today in the Lua Workshop so this may impact the
recovery time too.

The current plan is to create a new GForge setup and import the data.
If there is anyone on the list with GForge knowledge, please contact
me off list.

I'll keep the list informed about the progress on this operation but our expectations are that this will certainly take a few days.
Unfortunately, until them we are out of luck with these services:

luaforge.net main sit= e (catalog, project info, files downloads, CVS,
issue tracker, forums)
projects mailing lists
projects FTP (the project_name.luaforge.net sites are up)


I'm really sorry for the trouble this have caused for everyone using LuaForge services and I hope we can have everything back asap.

Meanwhile, =C2=A0I'd like to know what you think about eventually movin= g
from this setup based on GForge to one based on something else. One
option would be to recommend that projects moved their SCM to sites
like github or Google Code and then leave luaforge.net as just a
catalog and news site.

Of course this eventual migration would be possible only after
LuaForge is back up (still using GForge).

Thanks in advance for your patience.

Andr=C3=A9





--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175d0a3cec6014047577ba31-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 00:28:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n993SIaM028241; Fri, 9 Oct 2009 00:28:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B8171A749; Fri, 9 Oct 2009 00:27:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84AE31A73C for ; Fri, 9 Oct 2009 00:27:07 -0300 (BRT) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1Mw68w-0001xS-Qu for lua@bazar2.conectiva.com.br; Thu, 08 Oct 2009 20:27:46 -0700 Subject: Re: debugging/logging question From: Norbert Kiesel To: Lua list In-Reply-To: References: <1255040440.16503.161.camel@defiant.tbdnetworks.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 08 Oct 2009 20:27:45 -0700 Message-Id: <1255058865.16503.170.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 2009-10-08 at 23:44 +0100, Duncan Cross wrote: > On Thu, Oct 8, 2009 at 11:20 PM, Norbert Kiesel wrote: > > Hi, > > > > is it possible to get the name of a variable within Lua if I only have > > the variable? I want to write a small helper function logger that > > basically prints the name and the value of the variable > > > > function logger(name, value) print(name, 'has value', value) end > > foo = 'hello' > > logger('foo', foo) > > > > Now I'd like to just call "logger(foo)" and get the same output. > > I don't think there is any way for logger() to determine that - all it > has is the evaluated value of foo, not some reference to the token > 'foo'. > > If you don't mind it being logger('foo') instead of logger(foo), that's doable: > > do > > function logger(varname) > local i = 1 > while true do > local lname,lvalue = debug.getlocal(2,i) > if (lname == varname) then > print(lname, "has value", lvalue) > break > elseif (lname == nil) then > print(varname, "has value", _G[varname]) > break > end > i = i + 1 > end > end > > globalvar = 10 > function test() > local localvar = 5 > logger('localvar') > logger('globalvar') > end > > test() > > end Thanks. I'll try to extend it for other vars (e.g. foo.bar) as well. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 00:32:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n993WpKr028674; Fri, 9 Oct 2009 00:32:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D3CE1A751; Fri, 9 Oct 2009 00:31:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A3C11A73C for ; Fri, 9 Oct 2009 00:31:26 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LeehC-1MW53027uY-00qlbC; Thu, 08 Oct 2009 23:32:02 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910081956s6123ec0fvd6c308d6fafe0a41@mail.gmail.com> In-Reply-To: <5ba75e2f0910081956s6123ec0fvd6c308d6fafe0a41@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time Date: Thu, 8 Oct 2009 20:31:44 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00EF_01CA4856.5A0EFF00" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+gT6satfqQaqAW81a7QeUuFx/Iwpa2AHq1O5l SQT52rb2oAmsGUIzwc7lHE7nAZQPHX+54K/et/yz98x7h+y6Sl +QnWE6QbDm4F/tt7YCD2YbefmcArPoY X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00EF_01CA4856.5A0EFF00 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable As an interim solution, Launchpad is open-source. We could use the = source code from that. From: Fernando P. Garc=C3=ADa=20 Sent: Thursday, October 08, 2009 P7:56 Newsgroups: gmane.comp.lang.lua.general To: Lua list=20 Subject: Re: LuaForge is down and will be for some time I'm a web developer, I do my living remotelly :), In short: a = telecommuter. The fundamental rock for me is communication+reliability, = if I don't have this, my projects simply fail and don't talk about = bills... I have learned a lot of this from Drupal and his Community, it = is a leading Open Source CMS and Web Development Framework. You can do = things like groups.drupal.org or openatrium.com :D So... we can build a new LuaHub with Lua, but when? do we really have = all the resources(time+money+volunteers) to make it possible and = reliable? The problem is that current LuaForge is unmaintainable right?, = so... Why do not temporarily use *working* stuff? My hope on this is to awake participation from community, what about = Perl, RoR or Python solutions? I'm sure there are other alternatives = which may fit what *we*(community) need according to the *available = resources*. First question: How much are _exactly_ the available resources for next = 12 months? hosting? human resources?=20 Second question: How much is the demand? web stats? downloads? common = feature requests? Got it? We need to answer this for a serious project, so we can propose a real = solution. Call it sustainable, reliable, cost-effective, viable, ... Blessings! On Thu, Oct 8, 2009 at 9:05 PM, Stuart P.Bentley = wrote: I think it would be a good plan to remake LuaForge- in Lua, using the = Kepler libraries and what not- as just the things visitors see when they = come to the site: a project aggregator, providing hosting only for = package downloads and project sites, but listing basic information and = links to the relevant pages. Rather than have it auto-aggregate from a number of varied sources, = however, I think a better plan would be to have it act as a lightweight = hub, which would be used as a single point from which to track where the = homepage is hosted, what repositories (LuaDist, LuaRocks, deb-pkg, = Synaptic, SourceForge, Launchpad, LuaForge itself if package hosting is = supported going forward, etc.) it is distributed/mirrored on and which = (if any) is the development focus "main" host. Registration would be = automated for both users and projects. It would be primarily used, like the current site, as a destination = for discovery of applications and libraries that use Lua, categorized by = type (application/game with Lua support, Lua library/module/package, = Power Patch, set of Lua scripts), then by field (games, sound, graphics = - the same tree LuaForge already has (although there might be a = different tree for power patches)). Projects could either be registered = by the project's manager/developer, with homepage hosting provided and = editing allowed only for them ("hub page" style), or by anybody who = knows about the project, editable by anyone and owned by no one, but = claimable by the project manager at any time after creation ("wiki = entry" style). It would also be useful if it provided homepage hosting for Lua = projects (like the current version's .luaforge.net sites), = since many of the alternative hubs that have been suggested for code = hosting and the like do not provide this service (really, everybody but = Sourceforge). The biggest thing LuaForge could non-redundantly provide = (assuming this would be possible) would be Kepler Lua Page support in = project sites. This could be complimented with a page for adding files = for the most common project page setups (such as Sputnik or a set of Lua = scripts that generates pages that look like the Kepler manuals whose = style 90% of LuaForge projects copy). Hosting Lua Pages would also = provide a convenient avenue for library projects to provide a live demo. As stated though, bug tracking and source control are best handled by = many other sites that make this their sole purpose. I think a good model to work from would be Launchpad = (http://launchpad.net). Once you've registered for an account, you can = create a page for your project simply by following a link and choosing a = long name and a Unix name for it, at which point you enter your details = (project homepage, where the packages are, where the source is, where = the bug tracking is), with opt-in choices for each of the details for = services that Launchpad provides. "Andre Carregal" wrote in message = news:92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com... I have bad news about LuaForge, the damage on LuaForge might take = some time to recover. We have data backups for everything, but redoing a GForge installation is going to take a while. To make things harder, we are all involved today in the Lua Workshop so this may impact the recovery time too. The current plan is to create a new GForge setup and import the = data. If there is anyone on the list with GForge knowledge, please contact me off list. I'll keep the list informed about the progress on this operation but our expectations are that this will certainly take a few days. Unfortunately, until them we are out of luck with these services: luaforge.net main site (catalog, project info, files downloads, CVS, issue tracker, forums) projects mailing lists projects FTP (the project_name.luaforge.net sites are up)=20 I'm really sorry for the trouble this have caused for everyone using LuaForge services and I hope we can have everything back asap. Meanwhile, I'd like to know what you think about eventually moving from this setup based on GForge to one based on something else. One option would be to recommend that projects moved their SCM to sites like github or Google Code and then leave luaforge.net as just a catalog and news site. Of course this eventual migration would be possible only after LuaForge is back up (still using GForge). Thanks in advance for your patience. Andr=C3=A9 --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.=20 ------=_NextPart_000_00EF_01CA4856.5A0EFF00 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
As an interim solution, Launchpad is open-source. We = could use=20 the source code from that.

Sent: Thursday, October 08, 2009 P7:56
Newsgroups: gmane.comp.lang.lua.general
Subject: Re: LuaForge is down and will be for some=20 time

I'm a web developer, I do my living remotelly :), In = short: a=20 telecommuter. The fundamental rock for me is communication+reliability, = if I=20 don't have this, my projects simply fail and don't talk about bills... I = have=20 learned a lot of this from Drupal and his Community, it is a leading = Open Source=20 CMS and Web Development Framework. You can do things like groups.drupal.org or openatrium.com :D
So... we can = build a new=20 LuaHub with Lua, but when? do we really have all the=20 resources(time+money+volunteers) to make it possible and reliable? The = problem=20 is that current LuaForge is unmaintainable right?, so... Why do not = temporarily=20 use *working* stuff?
My hope on this is to awake participation from=20 community, what about Perl, RoR or Python solutions? I'm sure there are = other=20 alternatives which may fit what *we*(community) need according to the = *available=20 resources*.

First question: How much are _exactly_ the available=20 resources for next 12 months? hosting? human resources?
Second = question: How=20 much is the demand? web stats? downloads? common feature = requests?

Got=20 it?

We need to answer this for a serious project, so we can = propose a=20 real solution. Call it sustainable, reliable, cost-effective, viable,=20 ...

Blessings!

On Thu, Oct 8, 2009 at 9:05 PM, Stuart = P.Bentley <stuart@testtrack4.com>=20 wrote:
I think it would be a good plan to remake LuaForge- = in Lua,=20 using the Kepler libraries and what not- as just the things visitors = see when=20 they come to the site: a project aggregator, providing hosting only = for=20 package downloads and project sites, but listing basic information and = links=20 to the relevant pages.

Rather than have it auto-aggregate from = a number=20 of varied sources, however, I think a better plan would be to have it = act as a=20 lightweight hub, which would be used as a single point from which to = track=20 where the homepage is hosted, what repositories (LuaDist, LuaRocks, = deb-pkg,=20 Synaptic, SourceForge, Launchpad, LuaForge itself if package hosting = is=20 supported going forward, etc.) it is distributed/mirrored on and which = (if=20 any) is the development focus "main" host. Registration would be = automated for=20 both users and projects.

It would be primarily used, like the = current=20 site, as a destination for discovery of applications and libraries = that use=20 Lua, categorized by type (application/game with Lua support, Lua=20 library/module/package, Power Patch, set of Lua scripts), then by = field=20 (games, sound, graphics - the same tree LuaForge already has (although = there=20 might be a different tree for power patches)). Projects could either = be=20 registered by the project's manager/developer, with homepage hosting = provided=20 and editing allowed only for them ("hub page" style), or by anybody = who knows=20 about the project, editable by anyone and owned by no one, but = claimable by=20 the project manager at any time after creation ("wiki entry" = style).

It=20 would also be useful if it provided homepage hosting for Lua projects = (like=20 the current version's <project>.luaforge.net sites), since many of the alternative = hubs that=20 have been suggested for code hosting and the like do not provide this = service=20 (really, everybody but Sourceforge). The biggest thing LuaForge could=20 non-redundantly provide (assuming this would be possible) would be = Kepler Lua=20 Page support in project sites. This could be complimented with a page = for=20 adding files for the most common project page setups (such as Sputnik = or a set=20 of Lua scripts that generates pages that look like the Kepler manuals = whose=20 style 90% of LuaForge projects copy). Hosting Lua Pages would also = provide a=20 convenient avenue for library projects to provide a live = demo.

As=20 stated though, bug tracking and source control are best handled by = many other=20 sites that make this their sole purpose.

I think a good model = to work=20 from would be Launchpad (http://launchpad.net). Once you've registered for = an=20 account, you can create a page for your project simply by following a = link and=20 choosing a long name and a Unix name for it, at which point you enter = your=20 details (project homepage, where the packages are, where the source = is, where=20 the bug tracking is), with opt-in choices for each of the details for = services=20 that Launchpad provides.

"Andre Carregal" <carregal@fabricadigital.com.br> wrote in = message=20 = news:92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com...
I have bad news about LuaForge, the damage on = LuaForge=20 might take some
time to recover. We have data backups for = everything, but=20 redoing a
GForge installation is going to take a while. To make = things=20 harder,
we are all involved today in the Lua Workshop so this may = impact=20 the
recovery time too.

The current plan is to create a new = GForge=20 setup and import the data.
If there is anyone on the list with = GForge=20 knowledge, please contact
me off list.

I'll keep the list = informed=20 about the progress on this operation but
our expectations are = that this=20 will certainly take a few days.
Unfortunately, until them we are = out of=20 luck with these services:

luaforge.net main site (catalog, project info, = files=20 downloads, CVS,
issue tracker, forums)
projects mailing=20 lists
projects FTP (the project_name.luaforge.net sites are up)=20


I'm really sorry for the trouble this have = caused for=20 everyone using
LuaForge services and I hope we can have = everything back=20 asap.

Meanwhile,  I'd like to know what you think about=20 eventually moving
from this setup based on GForge to one based on = something else. One
option would be to recommend that projects = moved=20 their SCM to sites
like github or Google Code and then leave luaforge.net as = just=20 a
catalog and news site.

Of course this eventual = migration=20 would be possible only after
LuaForge is back up (still using=20 GForge).

Thanks in advance for your=20 = patience.

Andr=C3=A9



--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer= -=20 Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha = #377,=20 Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu = compromiso con=20 el medio ambiente, protegerlo depende de t=C3=AD.
------=_NextPart_000_00EF_01CA4856.5A0EFF00-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 00:47:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n993l28v029796; Fri, 9 Oct 2009 00:47:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC2D01A758; Fri, 9 Oct 2009 00:46:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B96631A73C for ; Fri, 9 Oct 2009 00:45:58 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mw6RB-0006zI-BT for lua@bazar2.conectiva.com.br; Fri, 09 Oct 2009 05:46:37 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 05:46:37 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 05:46:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Kepler graph Date: Thu, 8 Oct 2009 20:45:55 -0700 Lines: 6 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Could somebody draw up some sort of flowchart explaining how the different Kepler projects are related? Even when up, the site is a bit of a mess (several pages linked to for explanations are simply blank), and I still can't discern the relationship between WSAPI, CGILua, Orbit, Sputnik, Cosmo, LPeg, Xavante and mod_lua. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 01:01:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9941bPH030985; Fri, 9 Oct 2009 01:01:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05EB71A73C; Fri, 9 Oct 2009 01:00:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A326B1A6D0 for ; Fri, 9 Oct 2009 01:00:29 -0300 (BRT) Received: by iwn5 with SMTP id 5so3579770iwn.11 for ; Thu, 08 Oct 2009 21:01:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.227 with SMTP id v35mr1569292ibr.18.1255060868573; Thu, 08 Oct 2009 21:01:08 -0700 (PDT) In-Reply-To: References: <1255040440.16503.161.camel@defiant.tbdnetworks.com> Date: Fri, 9 Oct 2009 00:01:08 -0400 X-Google-Sender-Auth: b21913899d51659a Message-ID: Subject: Re: debugging/logging question From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9941bPH030985 On Thu, Oct 8, 2009 at 6:44 PM, Duncan Cross wrote: > On Thu, Oct 8, 2009 at 11:20 PM, Norbert Kiesel wrote: >> is it possible to get the name of a variable within Lua if I only have >> the variable?  I want to write a small helper function logger that >> basically prints the name and the value of the variable > I don't think there is any way for logger() to determine that - all it > has is the evaluated value of foo, not some reference to the token > 'foo'. > If you don't mind it being logger('foo') instead of logger(foo), that's doable: With lhf's lbci byte code inspection library [1] and the debug library, we can do this: http://lua-users.org/wiki/GettingVariablesFromValues That leads to some fun things like supporting pass-by-reference calling semantics in Lua :) local a = 10; local b = 11 print(a,b) --> 10,11 swap(a,b) print(a,b) --> 11,10 [1] http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lbci From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 02:10:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n995Aa9D004715; Fri, 9 Oct 2009 02:10:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCD1B192C6; Fri, 9 Oct 2009 02:09:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BFED192B2 for ; Fri, 9 Oct 2009 02:09:21 -0300 (BRT) Received: by fxm12 with SMTP id 12so491755fxm.5 for ; Thu, 08 Oct 2009 22:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=zywF7yMO1fUrBJpPxFO5fVGFtVeNOZILELJSEJGUXD8=; b=flhIF9oII6dKwG/lhfSU5zit+HyMyddV5ixiNLrvEJ1bkREWN9L08w79N1V3xUCzs3 mL9afp9k0q9V1UcxCgWWUUzu2QCm29GVVWFQmEVIatBEe74B1pG2eBjkHqm250LVZ1V3 U4LkpfGUy3VGUUd0AuB2d6z84s9WNTyNfU36E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=gylzrtFKzB8wnz//qKjzCZQiKnKOk6MYel4mQqBLRvp0Z5K1A3fPKIX9oJI3/ubu56 cLrHPdcmRJDMT4RjINIlH86HPLcvLS7go7aeuC1/LDBzJKHUQ0B/JsthWQpyUTaCQ6xE c1/Fsygk8kIqEDjhHvwnSDl9iJOx9FBtoEFYc= MIME-Version: 1.0 Received: by 10.204.151.209 with SMTP id d17mr1792312bkw.120.1255065000734; Thu, 08 Oct 2009 22:10:00 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Oct 2009 01:10:00 -0400 X-Google-Sender-Auth: a15009b0c4f606af Message-ID: Subject: Re: Kepler graph From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Could somebody draw up some sort of flowchart explaining how the different > Kepler projects are related? Even when up, the site is a bit of a mess > (several pages linked to for explanations are simply blank), and I still > can't discern the relationship between WSAPI, CGILua, Orbit, Sputnik, Cosmo, > LPeg, Xavante and mod_lua. Something like this perhaps: http://spu.tnik.org/en/Kepler_Diagram.png Feel free to improve: http://spu.tnik.org/en/Kepler_Diagram.edit (It's a wiki.) - yuri From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 03:04:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9964ICI008595; Fri, 9 Oct 2009 03:04:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F06B1A6F6; Fri, 9 Oct 2009 03:03:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68F1E1A65A for ; Fri, 9 Oct 2009 03:03:01 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 3so322386qwe.11 for ; Thu, 08 Oct 2009 23:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ton/g72zL0t6vdAF/a6dnQSGLAz9ht5zC3gK1IRD6Fo=; b=LESkRpFFEBluyEpFd1x6qj3JRkrTwNXeQl9Q4s1PE0R6lbSSbVo7qZp+3T2grSrCKA cAvOmBR5eH4GkWgbE1wUwszDFufAWW/T9u7juG6Ld3Y+es4xmi2Blj5hj8dAf+8xonce 9pX4iasf4rIip0aAkqJdNwFthBtkYuUMxFNfo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UihiDiiPJVEPFUigu6BMiJ5U19SRlfa44+Ay8Id3ftWnq+Wj0sMPh+HQtT5DDeGEuD dail2qpe9ix6qfOgc9x61szCZTC0CwQ3VJhr6Cy3HICNNMfSJ4xg/YQj4jUbWfGMknMQ jdXWyXLnac3Ffl0y2n2FRAQ3Yr/lJv2Gu0ROg= MIME-Version: 1.0 Received: by 10.224.78.22 with SMTP id i22mr2127293qak.280.1255068221044; Thu, 08 Oct 2009 23:03:41 -0700 (PDT) In-Reply-To: <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> Date: Fri, 9 Oct 2009 10:03:41 +0400 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9964ICI008595 > <...> > Also, we should officially discourage duplication of libraries. It's > confusing for the user. As an example, there were at least two signal > handler libraries written and distributed on luaforge (disclaimer: I > was one of those authors). This is necessary if we want to work with > LuaRocks; it makes no sense to have multiple libraries that do the > same thing (with some minor variations that could be concatenated into > a single library). I disagree. We should not discourage duplication, we would just stop duplicators from using our service. "Not invented here" syndrome is strong in many programmers minds. You often may gather useful insights from the duplicate — why was it written? what is the difference?. After all, who and how would decide that given two libraries are duplicates? Instead of discouraging duplication, we should encourage (but not force) cooperation between authors. Look at GitHub. You may create your own fork of any open-source project, thus creating a duplicate. You develop your fork independently. With Git you may (relatively) easily backport changes from upstream to your fork. If you want to, GitHub makes it easy to tell original author to pick up your changes and consider them for merging (send a "pull request"). Alexander. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 03:18:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n996IjKl009700; Fri, 9 Oct 2009 03:18:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E72111A74E; Fri, 9 Oct 2009 03:17:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70F851A713 for ; Fri, 9 Oct 2009 03:17:32 -0300 (BRT) Received: by fxm12 with SMTP id 12so513411fxm.5 for ; Thu, 08 Oct 2009 23:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=9LadP1OCtIIZDa/4agxdJha9B4A7+r5D/O9IWuAbrug=; b=fScm54s/4IN/Gkt2EK4UPh4wVnWwAbsVrTBahvLK+9sqpDoF6qTHayGcSY0X7Vcz2W 8YrfBk9edx0TW6XLwJG0rUZVu8uuROzsTu3+M4AYgO2+w2nhMx5aiXoHpIDBx5GmG3Yq 6o6Kq+6YEXC/Rao4kuOI/hUFbQx15uicJ04Zc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=dfeJzSBS9lnSx6y0pFGGdfcMzdqX7PLjc0B4rI9sG7MQJZA3xPm+Jrjk2ZcFbEvemX 7PA0jwMl7ECrjnfPcv9Rbmiufl23mBnC1ZwaJgFl4+LuMqky9+Bf3Mrt5BspE4fob6iF aImEqwuYtSCn34PrP5lxMiIFhAnJBSMq42BHg= MIME-Version: 1.0 Received: by 10.204.154.85 with SMTP id n21mr1791458bkw.171.1255069090079; Thu, 08 Oct 2009 23:18:10 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> Date: Fri, 9 Oct 2009 01:18:10 -0500 X-Google-Sender-Auth: d36814fde63716e2 Message-ID: <5ba75e2f0910082318o4ed60edcx17f394d66edbd6e@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175d0a3c4863d604757a8be6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d0a3c4863d604757a8be6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 :) Say by example that you can't guarantee that project X will always be maintained, all we are volunteers, so if somebody wants to fork, nice, but he should explain his reasons. It means that we need guidelines to take decisions. There is also the case when a project is maintained by a group of developers, and there are irresolvable differences of opinions, so some of them decide to do their way, after 6 month the new solution is better and more popular than the original (which now is abandoned) :) Blessings! On Fri, Oct 9, 2009 at 1:03 AM, Alexander Gladysh wrote= : > > <...> > > Also, we should officially discourage duplication of libraries. It's > > confusing for the user. As an example, there were at least two signal > > handler libraries written and distributed on luaforge (disclaimer: I > > was one of those authors). This is necessary if we want to work with > > LuaRocks; it makes no sense to have multiple libraries that do the > > same thing (with some minor variations that could be concatenated into > > a single library). > > I disagree. > > We should not discourage duplication, we would just stop duplicators > from using our service. "Not invented here" syndrome is strong in many > programmers minds. You often may gather useful insights from the > duplicate =E2=80=94 why was it written? what is the difference?. > > After all, who and how would decide that given two libraries are > duplicates? > > Instead of discouraging duplication, we should encourage (but not > force) cooperation between authors. > > Look at GitHub. You may create your own fork of any open-source > project, thus creating a duplicate. You develop your fork > independently. With Git you may (relatively) easily backport changes > from upstream to your fork. If you want to, GitHub makes it easy to > tell original author to pick up your changes and consider them for > merging (send a "pull request"). > > Alexander. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175d0a3c4863d604757a8be6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 :)

Say by example that you can't guarantee that project X wil= l always be maintained, all we are volunteers, so if somebody wants to fork= , nice, but he should explain his reasons. It means that we need guidelines= to take decisions.
There is also the case when a project is maintained by a group of developer= s, and there are irresolvable differences of opinions, so some of them deci= de to do their way, after 6 month the new solution is better and more popul= ar than the original (which now is abandoned) :)

Blessings!

On Fri, Oct 9, 2009 at 1:0= 3 AM, Alexander Gladysh <agladysh@gmail.com> wrote:
> <...>
> Also, we should officially discourage duplication of libraries. It'= ;s
> confusing for the user. As an example, there were at least two signal<= br> > handler libraries written and distributed on luaforge (disclaimer: I > was one of those authors). This is necessary if we want to work with > LuaRocks; it makes no sense to have multiple libraries that do the
> same thing (with some minor variations that could be concatenated into=
> a single library).

I disagree.

We should not discourage duplication, we would just stop duplicators
from using our service. "Not invented here" syndrome is strong in= many
programmers minds. You often may gather useful insights from the
duplicate =E2=80=94 why was it written? what is the difference?.

After all, who and how would decide that given two libraries are duplicates= ?

Instead of discouraging duplication, we should encourage (but not
force) cooperation between authors.

Look at GitHub. You may create your own fork of any open-source
project, thus creating a duplicate. You develop your fork
independently. With Git you may (relatively) easily backport changes
from upstream to your fork. If you want to, GitHub makes it easy to
tell original author to pick up your changes and consider them for
merging (send a "pull request").

Alexander.



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175d0a3c4863d604757a8be6-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 03:20:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n996KP1W009878; Fri, 9 Oct 2009 03:20:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42FA51A75D; Fri, 9 Oct 2009 03:19:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6D1F1A713 for ; Fri, 9 Oct 2009 03:19:11 -0300 (BRT) Received: by fxm12 with SMTP id 12so513969fxm.5 for ; Thu, 08 Oct 2009 23:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tVwktScuMOGlSrQ4CzkaSo0RbJBd6qdNKsUPw2NFKEE=; b=N3gF9kuC5lZQYDjS+cwHz9kcga73bI15BWT5VcGiR3+2fRBMqUiFRoESXc4xJi1gC7 +vwKXDDAKYVEHASox+5iUq5HO9xsv8esnry40lQOXUG+6X9V/VvucvzQh8PC+fRah4jZ QeEMuRxz4CuIOHuIDGqcohi6RnLkXmDWlPKXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E40DmB9lcA2VPbCeYtI2BgQ5UdZPXyPPmYiVj8viA52br82K26ZIXDzQepENBGpsv1 9GEXDi4Vk6S9YjwbCRKLwmSHIyqnvrl8Xhh4Lp9AZvbuAtm32PMvd4jgnYkf/kyCsTSa 5V6339mK6u7yargssirlyy7V0osy+jbBt/X6c= MIME-Version: 1.0 Received: by 10.204.34.18 with SMTP id j18mr1842458bkd.38.1255069190254; Thu, 08 Oct 2009 23:19:50 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> Date: Fri, 9 Oct 2009 08:19:50 +0200 Message-ID: <560972290910082319v5b7b8f79m9f38982e347b9180@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 8:03 AM, Alexander Gladysh wrote: > After all, who and how would decide that given two libraries are duplicates? This is the big question. We have no benevolent dictator, nor would we put up with one, since we are a bunch of cats. The hope is that Darwinian selection would separate the good ones from the bad ones, but natural selection can take time ;) It _does_ confuse the newbies, that's for sure. > Instead of discouraging duplication, we should encourage (but not > force) cooperation between authors. Sometimes there are different needs. E.g. if I have a simple job that just needs sqlite, then I would use luasqlite, not luasql, even though that has a sqlite backend. If I miscalculated the scope, then sure I'd need to 'upgrade' but hopefully I was sensible enough to separate my main app logic from the database side. There's another side to the duplication story. Obviously luafam and linotify are different, because they target different libraries. But they provide the same service, which is file system notification. I've been thinking of doing a similar wrap of the equivalent Win32 functionality, but then the problem gets magnified. A person wanting to write genuinely cross-platform scripts would have to have separate bridging modules to use these different facilities. Writiing a rockspec for such a program reveals the complexity of its dependencies. So in this case there's a case for unified API modules which use whatever provider is available for the particular system, call it LuaFileEvent or whatever. (It's a good argument for luasql as well ;)) steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 03:27:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n996RhVh010384; Fri, 9 Oct 2009 03:27:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A72C518EA0; Fri, 9 Oct 2009 03:26:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED7D818E5B for ; Fri, 9 Oct 2009 03:26:39 -0300 (BRT) Received: by fxm12 with SMTP id 12so516577fxm.5 for ; Thu, 08 Oct 2009 23:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xIGqKFKaDOJ33bCuhKGI5ZwE5LMv8oFc6KlnL2hYGiw=; b=NnZUUQhxM3xTqorg++Gb+DBveYa4DU66i/aFjYSfdTrn8fY07CQjP7DobT7HKkZ64c bQQ8oGtDP0+kpVdua41pbkbt7+uy6NrPyiL/VzdimOcTshbOI9hOALG9S5dTdqG1sGdE nxSyXp/ESnebk1aLl1NyKAc3HRPMxV38NXtQc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IU/hpLLabGFMk1OgCVLbHOkQRyOVIweU17QaiKjqQ4hmX7anvkUpEGnhjERDNZoVqn strV1LH22Z+RD9kp7E1YjJo6tv7gRW0UA41qB/c6wgxXznCR3jl9lp1VU3PMA8O7cEHz Ojxm0UKTy1YCOg3KiAAS7PW5GEymKCmxNNrDo= MIME-Version: 1.0 Received: by 10.204.15.22 with SMTP id i22mr1890702bka.13.1255069637762; Thu, 08 Oct 2009 23:27:17 -0700 (PDT) In-Reply-To: <5ba75e2f0910082318o4ed60edcx17f394d66edbd6e@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <5ba75e2f0910082318o4ed60edcx17f394d66edbd6e@mail.gmail.com> Date: Fri, 9 Oct 2009 08:27:17 +0200 Message-ID: <560972290910082327t3676cfbcl43539e12473a9c68@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n996RhVh010384 2009/10/9 Fernando P. García : > Say by example that you can't guarantee that project X will always be > maintained, all we are volunteers, so if somebody wants to fork, nice, but > he should explain his reasons. It means that we need guidelines to take > decisions. Actually, forking is rarely the issue with Lua modules. (Does anybody know of any high profile cases?) What happens is that different people have the same idea, work in isolation, and come up with different solutions. For example, XML: Lua for Windows has two distinct modules that can parse XML and generate a Lua table representation, and these representations are of course not compatible. In this case, luaexpat is more 'canonical' (a rule of thumb is to pick something from the Kepler stable ;)) but it gets confusing. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 04:30:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n997TuLF016509; Fri, 9 Oct 2009 04:29:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E6C219331; Fri, 9 Oct 2009 04:28:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from xserver.gls.co.za (unknown [196.44.38.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25F0719326 for ; Fri, 9 Oct 2009 04:28:38 -0300 (BRT) Received: from XSERVER.gls.co.za ([192.168.1.26]) by xserver.gls.co.za ([192.168.1.26]) with mapi; Fri, 9 Oct 2009 09:29:11 +0200 From: Ben Harper To: Lua list Date: Fri, 9 Oct 2009 09:29:01 +0200 Subject: Workship talk slides? Thread-Topic: Workship talk slides? Thread-Index: AcpIsiwOLA+IsoHZSV2FJCk6mmyWgQ== Message-ID: <27BA4145191C1849903386A90FE16D6518E7FE7B1B@xserver.gls.co.za> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_27BA4145191C1849903386A90FE16D6518E7FE7B1Bxserverglscoz_" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_27BA4145191C1849903386A90FE16D6518E7FE7B1Bxserverglscoz_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I'd be curious to see slides from the presentations at the recent Lua Works= hop. Post a link to the here? Thanks, Ben --_000_27BA4145191C1849903386A90FE16D6518E7FE7B1Bxserverglscoz_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

I'd be curious to see slides from the presentations at= the recent Lua Workshop. Post a link to the here?

 

Thanks,

Ben

--_000_27BA4145191C1849903386A90FE16D6518E7FE7B1Bxserverglscoz_-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 05:35:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n998ZjwV021964; Fri, 9 Oct 2009 05:35:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 505D41A702; Fri, 9 Oct 2009 05:34:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 479461A6FF for ; Fri, 9 Oct 2009 05:34:33 -0300 (BRT) Received: by bwz22 with SMTP id 22so5922711bwz.5 for ; Fri, 09 Oct 2009 01:35:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.155.65 with SMTP id r1mr1958421bkw.143.1255077312576; Fri, 09 Oct 2009 01:35:12 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910081956s6123ec0fvd6c308d6fafe0a41@mail.gmail.com> Date: Fri, 9 Oct 2009 10:35:12 +0200 X-Google-Sender-Auth: 3a59be298f3ab7e9 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 5:31 AM, Stuart P. Bentley wrote: > As an interim solution, Launchpad is open-source. We could use the source > code from that. But it is GPL3 and only works with Bazaar IIRC ? -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 05:38:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n998cu4Q022175; Fri, 9 Oct 2009 05:38:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81FE51A706; Fri, 9 Oct 2009 05:37:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 198191A600 for ; Fri, 9 Oct 2009 05:37:52 -0300 (BRT) Received: by bwz22 with SMTP id 22so5924374bwz.5 for ; Fri, 09 Oct 2009 01:38:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.3.211 with SMTP id 19mr1978471bko.36.1255077512465; Fri, 09 Oct 2009 01:38:32 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> Date: Fri, 9 Oct 2009 10:38:31 +0200 X-Google-Sender-Auth: 5cc602cbfbe5bca0 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 8:03 AM, Alexander Gladysh wrote: >> <...> >> Also, we should officially discourage duplication of libraries. It's >> confusing for the user. As an example, there were at least two signal >> handler libraries written and distributed on luaforge (disclaimer: I >> was one of those authors). This is necessary if we want to work with >> LuaRocks; it makes no sense to have multiple libraries that do the >> same thing (with some minor variations that could be concatenated into >> a single library). > > I disagree. I disagree too. I have been an active member of PEAR, the PHP equivalent to CPAN, and the rule was to have only one package. It leads to a lot of troubles. Developers could be encouraged to work together to improve an existing package, but it shouldn't be mandatory. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 06:28:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n999SfZU026553; Fri, 9 Oct 2009 06:28:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 083EE1A75E; Fri, 9 Oct 2009 06:27:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DBC31A70E for ; Fri, 9 Oct 2009 06:27:24 -0300 (BRT) Received: by ewy26 with SMTP id 26so7299570ewy.5 for ; Fri, 09 Oct 2009 02:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Gw0SNoK6sEobXntlAWbLNORok4/AZ8IgEK+EuevWUgk=; b=jltjebeZL5jbfkTLue0NYX2zlWleh2HFF7hB5T0u+Rnfg1ktVIlFaRLFwC1Weablkh 5LSJXAxAW9Jd1Amh1f5NDNyTYCKDy4SmALcU6c1xIrrxM2QkVego0+Zv4H/YjO3v1qhL bKj2z3+oruXKEMRhDbe+gIDY3cz1LlkdTM+tY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=nfxRK8kwbvinhqJqMeHjG/dx1DiJEs4366AoVkpWtVeTyOc7mJSCOPoA1iNlz1ZTrS Nu9ra2LJlZarFdoClRgkujWBgYK3oIO+C1wr1cLuN6tM4VrECneMwKyhCWGGNH4Nb8bN 77u+MS4GVko3B2ZOShOTB3mYrEAuAdUqsELCE= Received: by 10.210.152.4 with SMTP id z4mr2930563ebd.7.1255080483575; Fri, 09 Oct 2009 02:28:03 -0700 (PDT) Received: from ?95.78.99.193? ([95.78.99.193]) by mx.google.com with ESMTPS id 10sm338344eyd.46.2009.10.09.02.28.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Oct 2009 02:28:03 -0700 (PDT) Date: Fri, 9 Oct 2009 13:27:35 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1642454582.20091009132735@gmail.com> CC: Lua list Subject: Re[2]: LuaForge is down and will be for some time In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Bertrand, Friday, October 9, 2009, 1:43:08 AM, you wrote: > It looks like there are (at least) 2 different needs : > #2. A "forge" where one can work on one's projects using Git, > Mercurial, SVN, have a ticket system, a wiki, etc i have several OSS projects and spend some time learning good and bad sides of several OSS hostings. shortly said, i found that google code and ms codeplex are best ones. GForge-based hostings got "minimum sufficient" rank in my tests. i can list some advantages of google hosting: home page is just a wiki where you can write formatted presentation of your package using all multimedia features, hyperlinks and so on. there are even widgets that can show, for example, supporting maillist contents next, there are downloads/documentation pages that are formatted using wiki. documentation page can even show tree of contents that is indispensable if you have large docs next is Issue tracker with templates, free-form labels and voting system. well, google tracker is a wonder of its own. btw, downloads and wiki pages also allow free-form labels in order to make searching easier, and every page supports user comments and last is notification system. as administrator, i get notification about any changes in project - be it svn commit, wiki edit or new issue comment ms codeplex have comparable set of features, but somewhat simpler. its best feature is File Release System that tracks versions (including past and planned), allows wiki-formatted version description and user's comments/scores. FRS greatly simplifies releasing process - just upload files, write wikified description and you are done while GForge provides all the required features, these are implemented on basic level and cannot compete with gracefulness of best OSS hostings. so, having LuaForge as database of links would be much better, imho -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 06:45:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n999jO1c027803; Fri, 9 Oct 2009 06:45:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C7811A65A; Fri, 9 Oct 2009 06:44:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75B7B1896F for ; Fri, 9 Oct 2009 06:44:13 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 20041 invoked from network); 9 Oct 2009 11:44:50 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 9 Oct 2009 11:44:50 +0200 Message-ID: <4ACF0612.40403@wp.pl> Date: Fri, 09 Oct 2009 11:44:50 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: LuaForge is down and will be for some time References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> In-Reply-To: <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [4SOk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick Donnelly wrote: > Also, we should officially discourage duplication of libraries. It's > confusing for the user. As an example, there were at least two signal > handler libraries written and distributed on luaforge (disclaimer: I > was one of those authors). This is necessary if we want to work with > LuaRocks; it makes no sense to have multiple libraries that do the > same thing (with some minor variations that could be concatenated into > a single library). > > Thanks Andre for all your hard work on this! > Let me recall similar thread: http://lua-users.org/lists/lua-l/2009-01/msg00211.html This pops up from time to time, so please check archives for more arguments and opinions. Regards, miko From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 07:18:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99AI9ic030370; Fri, 9 Oct 2009 07:18:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D799D1A67F; Fri, 9 Oct 2009 07:17:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C8F1191EF for ; Fri, 9 Oct 2009 07:16:56 -0300 (BRT) Received: by bwz22 with SMTP id 22so5976547bwz.5 for ; Fri, 09 Oct 2009 03:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0e3DGAo7bniuoEZuJFcrlpV8i2FomwjPOjYbd99ppXA=; b=i5m5YLaeFacPkLXDW2sRUh+p5Zb9o+1koQf3yGGto3/Wiz8eJShRMkvY/0nEzZmNxZ gPThX7ImMpHZsRaVyD0V/mVbrh/Y4FbxllIWtYMj50ZOfG74FMNQ0wmIdz3I1/nsXj6D bk+S2gvWoIycl+YWznZY78Jm5cYl/clm27b9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IiUOrcB/SFsQlpZolNmTEz5gPow4T7KK0oGdqEzJkxmU1syhTf0ikl9fDGwxfPwl/F tvqvmwleorkmyVYJ8r01U9EWu2KB80VL2FDQAhRqcMoQhuWp3Fmj+lm4a0wFFm6A/JTD 0XLu34r4CMNn725IYwgD+LWwQOVhuvBrYn+48= MIME-Version: 1.0 Received: by 10.204.6.14 with SMTP id 14mr2068043bkx.46.1255083455676; Fri, 09 Oct 2009 03:17:35 -0700 (PDT) In-Reply-To: <4ACF0612.40403@wp.pl> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> Date: Fri, 9 Oct 2009 12:17:35 +0200 Message-ID: <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/9 Michal Kolodziejczyk : > Let me recall similar thread: > http://lua-users.org/lists/lua-l/2009-01/msg00211.html I like the distinction between LOSR (lua open software repository) and CLAN (like Perl's CPAN). Namespace agreement can be a mission; it will lead to tedious arguments and will break a lot of code in the transition. (E.g., require 'cairo' becomes require 'graphics.cairo', and so forth) The pragmatic solution is to make it easy LuaForge++ for tell you exactly what module(s) a package provides. These are not always obvious, e.g. I know that LuaFileSystem provides 'lfs' but that's because I know the package. Then there will be no module conflicts _by mistake_. This will probably be a feature of the upcoming LuaRocks 2, but there are already things which are for instance only available on LuaDist and not on LuaRocks. In time, equilibrium will be reached. And yes, Google Code _is_ very cool, but I've tried to be loyal ;) steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 07:35:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99AZZxf031736; Fri, 9 Oct 2009 07:35:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADA931A718; Fri, 9 Oct 2009 07:34:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.peterodding.com (mailinghelper.nl [79.99.133.60]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E93C419374 for ; Fri, 9 Oct 2009 07:34:30 -0300 (BRT) Received: from [192.168.1.3] (82-136-228-62.ip.telfort.nl [82.136.228.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.peterodding.com (Postfix) with ESMTPSA id 7C48D207A5D5 for ; Fri, 9 Oct 2009 10:35:09 +0000 (UTC) Message-ID: <4ACF11DC.6030805@peterodding.com> Date: Fri, 09 Oct 2009 12:35:08 +0200 From: Peter Odding User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Documentation Markup References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > What would be really cool would be a tool that read the markdown file, > found all the code blocks, ran them and checked that the output matched > the comment. It would me even cooler if it syntax-coloured the Lua code > (not that there's much to colour in the example above). I've played with this idea as well, but the code was very specific to my project. > 2) I have some example files with comments explaining what they do. A > tool that ran over the file, and turned it into a markdown document with > the lua code embedded in it would be fantastic too. I'm not talking > about a doxygen or LuaDoc type thing, I'd want the full text of the > example file, just kind of turned inside out. Just in case you don't know, this style of programming is called 'literate programming'. Knowing the right keywords makes all the difference on the internet :) - Peter From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 07:47:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99AljfJ000388; Fri, 9 Oct 2009 07:47:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9F291A765; Fri, 9 Oct 2009 07:46:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B25E1937A for ; Fri, 9 Oct 2009 07:46:34 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 3so357794qwe.11 for ; Fri, 09 Oct 2009 03:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1q/QGB3d/oxzBKhnqWx6y2bi+5/Y5YPQ7LIqV0aSqXw=; b=HeSyQ4TS3Zhs/Lsa8myYO0hweZ3+gyJfiZL6uYpQUkCyIUA2RrOEB/WkkBnPhoGOBP SHvyUA1XpqoNUrj68lDnxUqCBDxtg0uMYlAZ/AB8lsHwRbs605W7zs9SxySKrbRok2Uo 2a8bNUZOeGeYRcSralWPhc6es1bbArB+pk2mI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=x0ycvTBS+roTOFmDqd6tvQDzzIl7MohsQ22cwjWYfEwrMKnVGTq9tmclB2g2jOpDkg S3cV/oA1AxmG/HNOsHOdqJPFZ/94TbVdB9CNBkSv2xoycIYTumfkjMDFVn+qJ5/DuOsF dmwXor4KKQw6LbjXyu7yF2g6660Et2yOlLPTs= MIME-Version: 1.0 Received: by 10.224.91.131 with SMTP id n3mr2294550qam.369.1255085233286; Fri, 09 Oct 2009 03:47:13 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> Date: Fri, 9 Oct 2009 14:47:13 +0400 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99AljfJ000388 > The basic idea is that it would index these Lua source repositories: >  - http://luadist.org/dists/ (LuaDist/CMake) >  - http://luarocks.luaforge.net/rocks/ (LuaRocks/rock) >  - svn://svn.debian.org/pkg-lua/packages/ (debian/dpkg) >  - possibly others, including plain tarballs and modules on the wiki Perhaps, to get broader results, you may want to include GitHub and Google Code: http://github.com/search?q=lua&start_value=1&type=Repositories http://code.google.com/hosting/search?q=label:Lua The results would be a bit more vague, and include not only modules, but also generic Lua software, so perhaps you would not want to include in main search results. But there are a lot of stuff there, that is not included into your search criteria above. Alexander. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 07:57:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99Av39T001408; Fri, 9 Oct 2009 07:57:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B1A41A76B; Fri, 9 Oct 2009 07:56:02 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E33911A767 for ; Fri, 9 Oct 2009 07:55:58 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99AuTBq001282 for ; Fri, 9 Oct 2009 07:56:36 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n99AuSr32457; Fri, 9 Oct 2009 07:56:28 -0300 Date: Fri, 9 Oct 2009 07:56:27 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Workship talk slides? Message-ID: <20091009075627.A32432@lua.tecgraf.puc-rio.br> References: <27BA4145191C1849903386A90FE16D6518E7FE7B1B@xserver.gls.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <27BA4145191C1849903386A90FE16D6518E7FE7B1B@xserver.gls.co.za>; from ben@imqs.co.za on Fri, Oct 09, 2009 at 09:29:01AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'd be curious to see slides from the presentations at the recent Lua Workshop. Post a link to the here? We have asked the authors for the slides. Links will appear in the workshop page as they become available. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 08:08:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99B8uKU003013; Fri, 9 Oct 2009 08:08:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0A4C18B1F; Fri, 9 Oct 2009 08:07:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FBE018B1F for ; Fri, 9 Oct 2009 08:07:47 -0300 (BRT) Received: by fxm12 with SMTP id 12so686200fxm.5 for ; Fri, 09 Oct 2009 04:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=HtNqNUHMNoTOSX8Kz3CHqHAGQ7h4oxkMJ/xFcuGGus0=; b=jyGrEtQYCoot3Xt3McHP/GbBJWKIiZHHL9BDD0qgptpVXh0YTgbz1LTtTAF1UWoo0j GExTeL+gawxEN9GNy2oob93Njl51ZqP70Hiw1+fqksJZz1zb7S5+luBivDg0p8L8YOBk 1TSEgQnvWLbO8sNpD/UzNykRg+VfNga7mLf/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=dKansGNTUfCDRBplKYsveCLQaRWDliWXIXfIzlfwodZnZt9glN2I0Z/Yaoc8VyUDDb AFabH3sRXuQ96WdPCg/KLeZp2PvAg+hysyR+DUH9+PCn5Y3vextBqrCW70prmt6a7Xhd YXY7g0LPaXPsTdaxgQTAkdJYc7udQyoPMG5mY= MIME-Version: 1.0 Received: by 10.223.25.27 with SMTP id x27mr804467fab.7.1255086505193; Fri, 09 Oct 2009 04:08:25 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> From: Leaf Storm Date: Fri, 9 Oct 2009 07:08:05 -0400 Message-ID: Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 8, 2009 at 10:05 PM, Stuart P.Bentley wrote: > I think it would be a good plan to remake LuaForge- in Lua, using the Kepler > libraries and what not- as just the things visitors see when they come to > the site: a project aggregator, providing hosting only for package downloads > and project sites, but listing basic information and links to the relevant > pages. This sounds a lot like PyPI (Python Package Index - http://pypi.python.org/). Anyone who writes Python stuff can create an entry on PyPI for their project. They can actually host their tars on PyPI, or just have PyPI point to another, external site where the tars are located. Bug tracking and SCM is handled elsewhere. I think this is better than the "Forge" model because people can use whatever they want for the code-writing infrastructure - for example, LuaForge would be a no-go for me because I have never used CVS before and have no intention of doing so ever when I can use Mercurial or even SVN. It also reduces the strain on the server, and would be easier to re-implement in Lua. > It would also be useful if it provided homepage hosting for Lua projects > (like the current version's .luaforge.net sites), since many of the > alternative hubs that have been suggested for code hosting and the like do > not provide this service (really, everybody but Sourceforge). That is a good idea too. I know I would appreciate that for libmc, as there really isn't a convenient place for me to put the docs online. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 08:24:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99BOeqK004954; Fri, 9 Oct 2009 08:24:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64C641939F; Fri, 9 Oct 2009 08:23:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68AF91939C for ; Fri, 9 Oct 2009 08:23:24 -0300 (BRT) Received: (wp-smtpd smtp.wp.pl 21629 invoked from network); 9 Oct 2009 13:24:00 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 9 Oct 2009 13:24:00 +0200 Message-ID: <4ACF1D50.7040808@wp.pl> Date: Fri, 09 Oct 2009 13:24:00 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: LuaForge is down and will be for some time References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> In-Reply-To: <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [YYNk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > 2009/10/9 Michal Kolodziejczyk : >> Let me recall similar thread: >> http://lua-users.org/lists/lua-l/2009-01/msg00211.html > > I like the distinction between LOSR (lua open software repository) and > CLAN (like Perl's CPAN). > > Namespace agreement can be a mission; it will lead to tedious > arguments and will break a lot of code in the transition. (E.g., > require 'cairo' becomes require 'graphics.cairo', and so forth) The > pragmatic solution is to make it easy LuaForge++ for tell you exactly > what module(s) a package provides. These are not always obvious, e.g. > I know that LuaFileSystem provides 'lfs' but that's because I know the > package. Then there will be no module conflicts _by mistake_. I would propose prepending a module name with its home domain name (in "java way"), so: require 'org.losr.lfs' which could be "imported" by CLAN and published as: require 'org.clan.lfs' or require 'org.clan.luafilesystem' It would by great if it was supported/promoted by luarocks. It would help resolve conflicting module names, and conflicting files within different modules. Regards, miko From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 08:34:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99BYpOe006195; Fri, 9 Oct 2009 08:34:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 096A0193B0; Fri, 9 Oct 2009 08:33:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D584F193A8 for ; Fri, 9 Oct 2009 08:33:41 -0300 (BRT) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id CB3F09A523 for ; Fri, 9 Oct 2009 07:34:21 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 09 Oct 2009 07:34:21 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=jzRf9/HNtEZCKnM2T8CtJJ+CQ5E=; b=jCl7wJsOe4gnnqU/UtuxItiM2XpM/fSvpJpLXiCE0CkLejpvS1Flxx4p/eSNuULJCY5fB+xRBUycvl1kBcLnmCK8EDorh7Iu5pxaSBvoOcLwT6exn4o5fqigqeMyKI1yPysZefatiY5zt3fwbe+53x7ofvqAJiVvU53Om435kJ0= X-Sasl-enc: ee/U2+QKuV7mbCxyvuyEAy6rtPTxHF9nee+ytEdmK9s3 1255088061 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id E2CE268304 for ; Fri, 9 Oct 2009 07:34:20 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: LuaForge is down and will be for some time From: Geoff Leyland In-Reply-To: <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> Date: Sat, 10 Oct 2009 00:33:48 +1300 Content-Transfer-Encoding: 7bit Message-Id: <65D28393-7559-4E7B-A0F8-D0D656692048@fastmail.fm> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 9/10/2009, at 11:17 PM, steve donovan wrote: > 2009/10/9 Michal Kolodziejczyk : >> Let me recall similar thread: >> http://lua-users.org/lists/lua-l/2009-01/msg00211.html > > I like the distinction between LOSR (lua open software repository) and > CLAN (like Perl's CPAN). I realise that this is very peripheral to the conversation, but, while "lua open software repository" sounds nice, I'd think carefully before using LOSR as an acronym. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 08:38:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99BcgvR006591; Fri, 9 Oct 2009 08:38:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33328193B5; Fri, 9 Oct 2009 08:37:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B41BC19386 for ; Fri, 9 Oct 2009 08:37:38 -0300 (BRT) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2AD999B3FA for ; Fri, 9 Oct 2009 07:38:19 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 09 Oct 2009 07:38:19 -0400 X-Sasl-enc: Dx60BfNhZI/B/1ndPemybGThBqhsxa2mNlwH9qgt4bzh 1255088298 Received: from [10.1.1.3] (222-154-89-145.jetstream.xtra.co.nz [222.154.89.145]) by mail.messagingengine.com (Postfix) with ESMTPSA id 63DF167B67 for ; Fri, 9 Oct 2009 07:38:18 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Documentation Markup From: Geoff Leyland In-Reply-To: <4ACF11DC.6030805@peterodding.com> Date: Sat, 10 Oct 2009 00:37:45 +1300 Content-Transfer-Encoding: 7bit Message-Id: <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 9/10/2009, at 11:35 PM, Peter Odding wrote: > Geoff Leyland wrote: >> 2) I have some example files with comments explaining what they >> do. A tool that ran over the file, and turned it into a markdown >> document with the lua code embedded in it would be fantastic too. >> I'm not talking about a doxygen or LuaDoc type thing, I'd want the >> full text of the example file, just kind of turned inside out. > Just in case you don't know, this style of programming is called > 'literate programming'. Knowing the right keywords makes all the > difference on the internet :) Thanks! I did know, but I didn't think of googling "lua literate programming". A quick look didn't find much, but I'll have a better look later. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 09:01:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99C1dg7009299; Fri, 9 Oct 2009 09:01:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 571AA19385; Fri, 9 Oct 2009 09:00:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4588019372 for ; Fri, 9 Oct 2009 09:00:29 -0300 (BRT) Received: by fxm12 with SMTP id 12so722908fxm.5 for ; Fri, 09 Oct 2009 05:01:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.155.65 with SMTP id r1mr2135981bkw.143.1255089667874; Fri, 09 Oct 2009 05:01:07 -0700 (PDT) In-Reply-To: <65D28393-7559-4E7B-A0F8-D0D656692048@fastmail.fm> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <65D28393-7559-4E7B-A0F8-D0D656692048@fastmail.fm> Date: Fri, 9 Oct 2009 14:01:07 +0200 X-Google-Sender-Auth: 7f688a680ef55ca9 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 1:33 PM, Geoff Leyland wrote: > On 9/10/2009, at 11:17 PM, steve donovan wrote: >> >> 2009/10/9 Michal Kolodziejczyk : >>> >>> Let me recall similar thread: >>> http://lua-users.org/lists/lua-l/2009-01/msg00211.html >> >> I like the distinction between LOSR (lua open software repository) and >> CLAN (like Perl's CPAN). > > > I realise that this is very peripheral to the conversation, but, while "lua > open software repository" sounds nice, I'd think carefully before using LOSR > as an acronym. I liked it :) To the point that I bought the domain back then, just in case, so that it is available if this name stays. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 09:12:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99CC8Gf010760; Fri, 9 Oct 2009 09:12:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 691AF193DD; Fri, 9 Oct 2009 09:11:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E4A3193D7 for ; Fri, 9 Oct 2009 09:11:00 -0300 (BRT) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99CBere010720 for ; Fri, 9 Oct 2009 09:11:40 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n99CBeM00471; Fri, 9 Oct 2009 09:11:40 -0300 Date: Fri, 9 Oct 2009 09:11:39 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: LuaForge is down and will be for some time Message-ID: <20091009091139.B454@lua.tecgraf.puc-rio.br> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <65D28393-7559-4E7B-A0F8-D0D656692048@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from lua@mamasam.net on Fri, Oct 09, 2009 at 02:01:07PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > I realise that this is very peripheral to the conversation, but, while "lua > > open software repository" sounds nice, I'd think carefully before using LOSR > > as an acronym. > > I liked it :) I think he meant that "LOSR" reads as "loser". I think he has a point. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 09:26:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99CPn4k012788; Fri, 9 Oct 2009 09:25:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27EE7193EB; Fri, 9 Oct 2009 09:24:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91676193E3 for ; Fri, 9 Oct 2009 09:24:43 -0300 (BRT) Received: by bwz22 with SMTP id 22so6048978bwz.5 for ; Fri, 09 Oct 2009 05:25:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.36.207 with SMTP id u15mr2199097bkd.39.1255091121304; Fri, 09 Oct 2009 05:25:21 -0700 (PDT) In-Reply-To: <20091009091139.B454@lua.tecgraf.puc-rio.br> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <65D28393-7559-4E7B-A0F8-D0D656692048@fastmail.fm> <20091009091139.B454@lua.tecgraf.puc-rio.br> Date: Fri, 9 Oct 2009 14:25:21 +0200 X-Google-Sender-Auth: 7b3710949ccb6b3d Message-ID: Subject: Re: LuaForge is down and will be for some time From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 2:11 PM, Luiz Henrique de Figueiredo wrote: >> > I realise that this is very peripheral to the conversation, but, while "lua >> > open software repository" sounds nice, I'd think carefully before using LOSR >> > as an acronym. >> >> I liked it :) > > I think he meant that "LOSR" reads as "loser". I think he has a point. That's actually why I liked it... On the other hand, I don't think Pypi, CheeseShop or Pear are less ridiculous :) It's better to pick a name that is easy to remember. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 09:54:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99Cs6kf017227; Fri, 9 Oct 2009 09:54:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1B98193F1; Fri, 9 Oct 2009 09:52:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B0AB193E7 for ; Fri, 9 Oct 2009 09:52:50 -0300 (BRT) Received: by fxm12 with SMTP id 12so762499fxm.5 for ; Fri, 09 Oct 2009 05:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mpgwtnmDka7ldo+idQtaSoIFP/rSHMotvm23q+sK5LM=; b=QmbS3obla6l8KN0/hb+vXcPk7MFTQMgeFZFm8R1qSdC7vApmZCywkZrCcxO3pV+cyQ OnMPb32p5ZX6g/awdOItW3w5x9MtjsSUXlG2Uz+13EgnxQyf+NXakyi2+P2gwxgT/mlc p2leUaci6J0z0dTItxae0R4UwB6Qr9Nr3fjCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hlA+G2ds/wXt+0pYoNFKRLp5/RTDqExQ2u1cH3w8SM9b6jdIbxQ/i/47iVMf/Q9/ex Ei0YGGivTkdc7motaBroucQFF0Qdc1lDBzpWruC2sZ3LRybvvWIFe0clps+txtE4nWz6 ovhQcF3cR6ny84ZZjm9NJINEaeJAmqCOlwgLo= MIME-Version: 1.0 Received: by 10.239.139.76 with SMTP id s12mr123318hbs.78.1255092809535; Fri, 09 Oct 2009 05:53:29 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> Date: Fri, 9 Oct 2009 14:53:29 +0200 Message-ID: <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 12:47 PM, Alexander Gladysh wrote: > http://code.google.com/hosting/search?q=label:Lua < > The results would be a bit more vague, and include not only modules, > but also generic Lua software, Yes, very vague ;) Better that people register themselves, and make it easy (like Freshmeat) We would probably need strong AI to search for that kind of information in a coherent way. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:05:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99D5gK8019329; Fri, 9 Oct 2009 10:05:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 153C4193FD; Fri, 9 Oct 2009 10:04:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3095A193F3 for ; Fri, 9 Oct 2009 10:04:29 -0300 (BRT) Received: by yxe17 with SMTP id 17so602695yxe.33 for ; Fri, 09 Oct 2009 06:05:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.222.1 with SMTP id u1mr1410626agg.103.1255093508832; Fri, 09 Oct 2009 06:05:08 -0700 (PDT) In-Reply-To: <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> Date: Fri, 9 Oct 2009 16:05:08 +0300 X-Google-Sender-Auth: 57d9e03a1c92ded3 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001636283e94c0fdf30475803a93 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636283e94c0fdf30475803a93 Content-Type: text/plain; charset=UTF-8 Any place where we can access the sources of the packages in the meantime? I would need ldecnumber now, but maybe some others in the near future and I'd better not spam this list with my requests. Thanks! --001636283e94c0fdf30475803a93 Content-Type: text/html; charset=UTF-8 Any place where we can access the sources of the packages in the meantime? I would need ldecnumber now, but maybe some others in the near future and I'd better not spam this list with my requests.

Thanks!

--001636283e94c0fdf30475803a93-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:06:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99D6g24019528; Fri, 9 Oct 2009 10:06:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED00919405; Fri, 9 Oct 2009 10:05:36 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE220193F3 for ; Fri, 9 Oct 2009 10:05:30 -0300 (BRT) Received: by bwz22 with SMTP id 22so6076600bwz.5 for ; Fri, 09 Oct 2009 06:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=2BN+1POieBz/jM9ekQLt/nkdef8fj3sYDb11Pc/Q5PY=; b=Ox5F89N+SZEdgfigpAHrW5MSSJ0hiqqR6Z+i2XElGiM28WVXWioseO2gM9UwcOMmWq a1zPSaE26GSvsgVxWmQSe46K4kwWVTYA/8wHsMB8W9h5WlQymOHwt6zS8lOf1MWNlYj1 HM2yx1zz1lO1KC8tUTQzQdT1TZAXHIQ+P+LLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=v+XeMQi+73PWprrEmlltxEqIz2kz3RFC9w3NWLP78ihu+Hso/IMurtrQ07JY985sPx 0i1f4GgwiB7UfuiFQYgSSIHYPI5RML4VB4V9mam1IWot4zoMCx/6vDSPsChc7mMaMG2G NtIaoBrXgArQq1NBMt9Ucnj6mxkYkOevdO+D4= MIME-Version: 1.0 Received: by 10.223.5.25 with SMTP id 25mr304249fat.38.1255093569133; Fri, 09 Oct 2009 06:06:09 -0700 (PDT) In-Reply-To: <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> Date: Fri, 9 Oct 2009 14:06:09 +0100 Message-ID: <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> Subject: Re: Documentation Markup From: Robert Raschke To: geoff_leyland@fastmail.fm Content-Type: multipart/alternative; boundary=00151747b488591c4c0475803e74 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151747b488591c4c0475803e74 Content-Type: text/plain; charset=UTF-8 On Fri, Oct 9, 2009 at 12:37 PM, Geoff Leyland wrote: > On 9/10/2009, at 11:35 PM, Peter Odding wrote: > > Geoff Leyland wrote: >> >>> 2) I have some example files with comments explaining what they do. A >>> tool that ran over the file, and turned it into a markdown document with the >>> lua code embedded in it would be fantastic too. I'm not talking about a >>> doxygen or LuaDoc type thing, I'd want the full text of the example file, >>> just kind of turned inside out. >>> >> Just in case you don't know, this style of programming is called 'literate >> programming'. Knowing the right keywords makes all the difference on the >> internet :) >> > > Thanks! I did know, but I didn't think of googling "lua literate > programming". A quick look didn't find much, but I'll have a better look > later. > > Cheers, > Geoff > I just use a modified version of nuweb* and write HTML with embedded Lua code (no pretty-printing of code). It's been ages since I hacked it, so I can't remember the changes. It would probably be pretty trivial to change it to allow markdown. Robby * http://nuweb.sourceforge.net/ (I notice someone put it onto sourceforge, I have no idea anymore where I got my copy from.) --00151747b488591c4c0475803e74 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Oct 9, 2009 at 12:37 PM, Geoff Leyla= nd <geoff= _leyland@fastmail.fm> wrote:
On 9/10/2009, at 11:35 PM, Peter Odding wrote:


Geoff Leyland wrote:
2) I have some example files with comments explaining what they do. =C2=A0A= tool that ran over the file, and turned it into a markdown document with t= he lua code embedded in it would be fantastic too. =C2=A0I'm not talkin= g about a doxygen or LuaDoc type thing, I'd want the full text of the e= xample file, just kind of turned inside out.
Just in case you don't know, this style of programming is called 'l= iterate programming'. Knowing the right keywords makes all the differen= ce on the internet :)

Thanks! =C2=A0I did know, but I didn't think of googling "lua lite= rate programming". =C2=A0A quick look didn't find much, but I'= ll have a better look later.

Cheers,
Geoff

I just use a modified version of nuweb* and w= rite HTML with embedded Lua code (no pretty-printing of code). It's bee= n ages since I hacked it, so I can't remember the changes. It would pro= bably be pretty trivial to change it to allow markdown.

Robby

* http://nuweb.s= ourceforge.net/=C2=A0 (I notice someone put it onto sourceforge, I have= no idea anymore where I got my copy from.)

--00151747b488591c4c0475803e74-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:17:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99DHowe021768; Fri, 9 Oct 2009 10:17:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0D9219363; Fri, 9 Oct 2009 10:16:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F14E619357 for ; Fri, 9 Oct 2009 10:16:36 -0300 (BRT) Received: by vws9 with SMTP id 9so4019033vws.11 for ; Fri, 09 Oct 2009 06:17:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.78.169 with SMTP id l41mr3708379vck.104.1255094236119; Fri, 09 Oct 2009 06:17:16 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> From: Phoenix Sol Date: Fri, 9 Oct 2009 08:16:56 -0500 Message-ID: <8a25d01b0910090616v774ec5eeq9c70a450159e480e@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 8:05 AM, Cosmin Apreutesei wrote: > Any place where we can access the sources of the packages in the meantime? I > would need ldecnumber now, but maybe some others in the near future and I'd > better not spam this list with my requests. > Thanks! Though still a newcomer, I dare say in this case: spam away. I think the situation warrants it. Speak up about whatcha need, man. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:20:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99DK7oA022697; Fri, 9 Oct 2009 10:20:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE3E8193F6; Fri, 9 Oct 2009 10:19:07 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B038191D5 for ; Fri, 9 Oct 2009 10:19:01 -0300 (BRT) Received: by fxm12 with SMTP id 12so785141fxm.5 for ; Fri, 09 Oct 2009 06:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=M0FlsD9y50RuMm/EWUInimYET3yI8e6tMqcocCOgpWU=; b=iwIHmHI1urXFA/oRYfG700pYgT71irjl8UvnliqXnhHP17u/QwC6NujuuvFmbyYp1C oNlU9i2weLlLmjxXHkZWechPzKZqa7HrupOItf0iEGD7WZc32i2IHioBUNgJfG5c8i3+ Bg3fF4CnNL6Vyi51CQFcDBXcaAJ4dn5s4arjM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IpEzYYaQAqw0Qu5VLEw8dgxisyiTAOf8W+l29MZ5jlgomZ7w7FUdK/arNNScVmorvh TDzFg8z+DTxDVB3SqhrZZ2iu2YJsRLfQ3snc9WAXF1+oEE4wdl4Yqey4vWC1fxHXAmwl zXejhhc81bCaUgUdY//yauDEfOfW8xd6vNJwA= MIME-Version: 1.0 Received: by 10.239.181.164 with SMTP id m36mr123297hbg.184.1255094380848; Fri, 09 Oct 2009 06:19:40 -0700 (PDT) In-Reply-To: <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> Date: Fri, 9 Oct 2009 15:19:40 +0200 Message-ID: <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> Subject: Re: Documentation Markup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 3:06 PM, Robert Raschke wrote: > can't remember the changes. It would probably be pretty trivial to change it > to allow markdown. In fact, I bet you that a hundred lines of Lua will do the whole job nicely - pretty-printing can be done as an afterthought, using some styling and client Javascript. One of those satisfying rainy-afternoon jobs. The thing about literate programming is that both the source and the result must look pretty and read well. HTML is not nice in source, although doing anything non-trivial in LuaDoc seems to require it. Traditionally, LP uses tools to extract separate docs and code from the same document, which seems fussy. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:25:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99DPtGJ024009; Fri, 9 Oct 2009 10:25:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6A871941A; Fri, 9 Oct 2009 10:24:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 430DE1940B for ; Fri, 9 Oct 2009 10:24:40 -0300 (BRT) Received: by bwz22 with SMTP id 22so6091391bwz.5 for ; Fri, 09 Oct 2009 06:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XM0G6JDZKlkb1BSnn7Zlp9TC9OP7unuCGMXWdgRQO38=; b=P+TvKQSeDtfphv1hcpT0mxFTBjXL9WjbKAUnKL9aOraNiDuzOccCDLJWq1/8UmTHZ2 5uy8R3EVToSFEstHFD3VuvLdnc+R7Fet9jsoLIQ8Hz3/TST+bNUfj0eRFbJhMG4ZRt3B V3Zbn1qiife4me83jwVYeLFHYbDQbwbN6eZ/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xRVZG+gqcWWGACbho0c2yIRCrCw+h8m0ub5jwlTKLE7XSC4NOaTtLjyKJ/zUTfhmDd zXzl39hpsSe3/ROo5JFDzQlam33YvDIGuvioIMvWi88FMyc6AdQEZfM7nzOqvVnvXwTQ CWUGdUo/VIH95a59IUhkIdnrqClgb+lEMSGBE= MIME-Version: 1.0 Received: by 10.223.14.145 with SMTP id g17mr921343faa.51.1255094719648; Fri, 09 Oct 2009 06:25:19 -0700 (PDT) In-Reply-To: <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> Date: Fri, 9 Oct 2009 14:25:19 +0100 Message-ID: <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> Subject: Re: Documentation Markup From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=00151747360aec92cc0475808285 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151747360aec92cc0475808285 Content-Type: text/plain; charset=UTF-8 On Fri, Oct 9, 2009 at 2:19 PM, steve donovan wrote: > On Fri, Oct 9, 2009 at 3:06 PM, Robert Raschke > wrote: > > can't remember the changes. It would probably be pretty trivial to change > it > > to allow markdown. > > In fact, I bet you that a hundred lines of Lua will do the whole job > nicely - pretty-printing can be done as an afterthought, using some > styling and client Javascript. One of those satisfying > rainy-afternoon jobs. > > The thing about literate programming is that both the source and the > result must look pretty and read well. HTML is not nice in source, > although doing anything non-trivial in LuaDoc seems to require it. > Traditionally, LP uses tools to extract separate docs and code from > the same document, which seems fussy. > > steve d. > LP does that in order to lift the ordering constraints your prog lang imposes. With modern languages this is no longer such a big concern. Although it is nice to be able to write LP code that has holes with neat readable placeholders which you fill in further down your document. It is possible to write nice HTML, but you have to do it by hand (and not get carried away with typography :-). HTML editors create unreadable muck. At least I've not come across any that don't. Robby --00151747360aec92cc0475808285 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Oct 9, 2009 at 2:19 PM, steve donova= n <steve.= j.donovan@gmail.com> wrote:
On Fri, Oct 9, 2009 at 3:06 PM, Robert Raschke <rtrlists@googlemail.com> wrote:=
> can't remember the changes. It would probably be pretty trivial to= change it
> to allow markdown.

In fact, I bet you that a hundred lines of Lua will do the whole job<= br> nicely - pretty-printing can be done as an afterthought, using some
styling and client Javascript. =C2=A0One of those satisfying
rainy-afternoon jobs.

The thing about literate programming is that both the source and the
result must look pretty and read well. HTML is not nice in source,
although doing anything non-trivial in LuaDoc seems to require it.
Traditionally, LP uses tools to extract separate docs and code from
the same document, which seems fussy.

steve d.

LP does that in order to lift the ordering constrain= ts your prog lang imposes. With modern languages this is no longer such a b= ig concern. Although it is nice to be able to write LP code that has holes = with neat readable placeholders which you fill in further down your documen= t.

It is possible to write nice HTML, but you have to do it by hand (and n= ot get carried away with typography :-). HTML editors create unreadable muc= k. At least I've not come across any that don't.

Robby

--00151747360aec92cc0475808285-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:33:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99DX8Wh025513; Fri, 9 Oct 2009 10:33:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90CA519421; Fri, 9 Oct 2009 10:32:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0A5A1941D for ; Fri, 9 Oct 2009 10:31:57 -0300 (BRT) Received: by bwz22 with SMTP id 22so6097172bwz.5 for ; Fri, 09 Oct 2009 06:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pRGx/JvF67XcdCL7JciLqRlSlT0R1It58hjnuFHhQ3Q=; b=ikKTk//0L7L7zqQ62erGz1fHezit29+lbDNf14976BPjP3mUkt/Vx/hTHONOaCWWbS MPVjdNBKAr53dYijT8sDcEhd+HfFykFykdFHwC/VJFBBcLNEjiNeYoY9q8LDLVKk1kjR 70EXXBX3bW4s30MY5GEkD31kT0atrOhVYKCiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qXyjafcUkbJ+g0qTHjkB74cD1eyHaDpCf+RihoxaHOGrbdvixhZbwrwLyrtdx1eTAL kqRySEcuGVcLTpOYy7dnOzqbBCBCsE19N//WPHSSFPhBiSjQbckkBOYzz0QVNm1MTyTG wEvoHuwc17E0+b65a43usqg+RqE1ns9YSrG+w= MIME-Version: 1.0 Received: by 10.239.184.150 with SMTP id y22mr120393hbg.21.1255095157191; Fri, 09 Oct 2009 06:32:37 -0700 (PDT) In-Reply-To: <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> Date: Fri, 9 Oct 2009 15:32:37 +0200 Message-ID: <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> Subject: Re: Documentation Markup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 3:25 PM, Robert Raschke wrote: > LP does that in order to lift the ordering constraints your prog lang > imposes. With modern languages this is no longer such a big concern. > Although it is nice to be able to write LP code that has holes with neat > readable placeholders which you fill in further down your document. Ah, I see the point - the 'order of explanation' is not the same necessarily as the order the language forces. Lua order is pretty flexible, though you do have to declare local functions up front as locals, and use a somewhat awkward 'NAME = function(...' syntax later. But how to do modules? steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 10:46:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99DkYLp028470; Fri, 9 Oct 2009 10:46:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D87D1A6B1; Fri, 9 Oct 2009 10:45:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 884721940F for ; Fri, 9 Oct 2009 10:45:21 -0300 (BRT) Received: by bwz22 with SMTP id 22so6107544bwz.5 for ; Fri, 09 Oct 2009 06:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gY06jOK62mC50SgwoltgDntTcW6KMzOqshUz82KUYIM=; b=u4/PXFD7r5lw4xlvCMkYyKuNQZQqMJKWYnR4SQUYH9lAOFBVVqvfsWfkczsdqRi5a8 a9/kc/qB4OyPJOo4/yPcs3KL+dPnD38RtLODAekUilZn55FxNlmCvHfiHM1E4gue2gUl /3IRWh5vYYRe++IGNHqopMseZRlicPPeipTDw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Xc1VgWJooYLBGeiL1XZYLLt7qH7jFuvXljLasefI8lBxxoi9hnOkE5iM5XRuGl7SCt 7SL1PJvKqZmVqisjab0whnR1F+DMbbd+p+u0/SehiMbJvCUl+WLpRdoDlvmSJK4r1qzN ygN1oIZDRfY2VoygZTP38qcQe1gm7VIJ3+/SM= MIME-Version: 1.0 Received: by 10.223.1.6 with SMTP id 6mr839971fad.103.1255095959850; Fri, 09 Oct 2009 06:45:59 -0700 (PDT) In-Reply-To: <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> Date: Fri, 9 Oct 2009 14:45:59 +0100 Message-ID: <6a3ae47e0910090645m1e7e877u84a5570a9802fd79@mail.gmail.com> Subject: Re: Documentation Markup From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=000e0ce0edb8d89089047580cc96 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0ce0edb8d89089047580cc96 Content-Type: text/plain; charset=UTF-8 On Fri, Oct 9, 2009 at 2:32 PM, steve donovan wrote: > On Fri, Oct 9, 2009 at 3:25 PM, Robert Raschke > wrote: > > LP does that in order to lift the ordering constraints your prog lang > > imposes. With modern languages this is no longer such a big concern. > > Although it is nice to be able to write LP code that has holes with neat > > readable placeholders which you fill in further down your document. > > Ah, I see the point - the 'order of explanation' is not the same > necessarily as the order the language forces. > > Lua order is pretty flexible, though you do have to declare local > functions up front as locals, and use a somewhat awkward 'NAME = > function(...' syntax later. But how to do modules? > > steve d. > One LP source file can produce multiple code files. The biggest downside to LP, and usually a killer, is that any debugging references the code files, not the LP source. Only in languages where something like a #line directive is available, can you get your debug tools to point back to the LP source. And there is very little in terms of IDE support in general. The modern practice of using "intelligent" IDE tools has won over the approach of exposition. As far as I can see LP is now the domain of people whose job is to produce an exposition of some bit of code or algorithm. And they are far and few between. I myself use it in the beginning stages of a project, up until I am ready to ship, or until I have to collaborate. After that, the code rules. It suits my development approach, and I have some neat write up of what I tried to achieve. But once the code escapes my sole grasp, no amount of persuasion (on my part) will help in keeping the Literate Program alive in a project. Robby --000e0ce0edb8d89089047580cc96 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Oct 9, 2009 at 2:32 PM, steve donovan <steve.j.donovan@gmail.com> wrote:
On Fri, Oct 9, 2009 at 3:25 PM, Robert Raschke <rtrlists@googlemail.com> wrote:=
> LP does that in order to lift the ordering constraints your prog lang<= br> > imposes. With modern languages this is no longer such a big concern. > Although it is nice to be able to write LP code that has holes with ne= at
> readable placeholders which you fill in further down your document.
Ah, I see the point - the 'order of explanation' is not the s= ame
necessarily as the order the language forces.

Lua order is pretty flexible, though you do have to declare local
functions up front as locals, and use a somewhat awkward 'NAME =3D
function(...' syntax later. =C2=A0But how to do modules?

steve d.

One LP source file can produce multiple code files.<= br>
The biggest downside to LP, and usually a killer, is that any debugg= ing references the code files, not the LP source. Only in languages where s= omething like a #line directive is available, can you get your debug tools = to point back to the LP source.

And there is very little in terms of IDE support in general. The modern= practice of using "intelligent" IDE tools has won over the appro= ach of exposition. As far as I can see LP is now the domain of people whose= job is to produce an exposition of some bit of code or algorithm. And they= are far and few between.

I myself use it in the beginning stages of a project, up until I am rea= dy to ship, or until I have to collaborate. After that, the code rules. It = suits my development approach, and I have some neat write up of what I trie= d to achieve. But once the code escapes my sole grasp, no amount of persuas= ion (on my part) will help in keeping the Literate Program alive in a proje= ct.

Robby

--000e0ce0edb8d89089047580cc96-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 11:15:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99EFia9002151; Fri, 9 Oct 2009 11:15:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 128851A5DE; Fri, 9 Oct 2009 11:14:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F325719289 for ; Fri, 9 Oct 2009 11:14:25 -0300 (BRT) Received: by qyk26 with SMTP id 26so6097557qyk.5 for ; Fri, 09 Oct 2009 07:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=3l1RNAVGtTGHpQZ4bd0JjmZQUN4AwiQA8WtdfLIHhjs=; b=WEGcCROjtYjPrZGt8Kuu8/MOU0VG8DJXmsGeu6jJoYUWmZXi3bvN2Iuin9Lv6Z1Yh6 R97yYr+auZYQNAYIySD2nLEcI+5fc6WR1uipCuq+dMdwFv9985I7rkSVEX+8wkvOK1In mA8uCH0kezCqjmLEZYZadK9Y9mAbbgicfIDNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=W4sSt8FTRM77aXwAY7G21e9gIZcmOcNeyxIo5Eoz4N09rxt2BUVWDfURSN90bTsnfS VeSRJcZjQ0ioQZuXMT1fa6Aq973jumlGyOY0vmGojQmJhv0vfwNpwP8qSarD5muuXsmF YVMi4XktbeCO3pHzIaAmLjFGBVPl9Jqqlfg78= MIME-Version: 1.0 Received: by 10.224.108.204 with SMTP id g12mr2562290qap.270.1255097705432; Fri, 09 Oct 2009 07:15:05 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> Date: Fri, 9 Oct 2009 11:15:05 -0300 X-Google-Sender-Auth: 4a46ed2c8aff8186 Message-ID: <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin, if the package you want is listed at the LuaRocks repository (http://www.luarocks.org/repositories/rocks) you can grab the .src.rock file, it is a zip with the rockspec and the tarball with the sources. -- Fabio On Fri, Oct 9, 2009 at 10:05 AM, Cosmin Apreutesei wrote: > Any place where we can access the sources of the packages in the meantime? I > would need ldecnumber now, but maybe some others in the near future and I'd > better not spam this list with my requests. > Thanks! > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 12:31:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99FVqoX018791; Fri, 9 Oct 2009 12:31:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3596618C94; Fri, 9 Oct 2009 12:30:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DC7D18C14 for ; Fri, 9 Oct 2009 12:30:34 -0300 (BRT) Received: by gxk4 with SMTP id 4so8021345gxk.8 for ; Fri, 09 Oct 2009 08:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MrWYJJuIANuOHEI0Dun77Jy5AKAHEdk4JJUw6lnTHKM=; b=ILDpczHwWodrhXzsSuWfpXzlkFY+/2Z5RLWasE8Beq3Yot5W1tOyQzHnCQ29TeOaXf EZnl0fsgGAA8JkpZXBdggFeglqa387qD94V/Oh0T27iZI4WQEyVkGWHTszeJYZqy6T98 AGcOlP4u/GTLwkrxtsaCvhvJKEfHBz8Ymh9hk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AcMN0AuBvv1HZdsp4ukegjYH+rWfk9C+NbvEUlcLjrKDYTgnxwpKZe64n7r9Dmch/q ySt8gyXtNpW/tKWsPFCifIZjfKNrBtNmpST9OgcsAg4Um5p+tof8DSJK+FPefH24gIb2 Avs869S3FwlF9Jta2HRXDmU7S9eXltrdUhy/I= MIME-Version: 1.0 Received: by 10.150.14.3 with SMTP id 3mr4932990ybn.288.1255102274320; Fri, 09 Oct 2009 08:31:14 -0700 (PDT) In-Reply-To: <560972290910082327t3676cfbcl43539e12473a9c68@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <5ba75e2f0910082318o4ed60edcx17f394d66edbd6e@mail.gmail.com> <560972290910082327t3676cfbcl43539e12473a9c68@mail.gmail.com> Date: Fri, 9 Oct 2009 08:31:13 -0700 Message-ID: <1079b050910090831t1cd3477blcf5aea8eca8f8eb6@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99FVqoX018791 > Actually, forking is rarely the issue with Lua modules.  (Does anybody > know of any high profile cases?) > I have my own fork of LuaGL. wes From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 12:46:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99FjwZi021567; Fri, 9 Oct 2009 12:45:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2630318D75; Fri, 9 Oct 2009 12:44:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CBB418D02 for ; Fri, 9 Oct 2009 12:44:51 -0300 (BRT) Received: by vws9 with SMTP id 9so4101582vws.11 for ; Fri, 09 Oct 2009 08:45:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.113.134 with SMTP id a6mr4118239vcq.100.1255103130167; Fri, 09 Oct 2009 08:45:30 -0700 (PDT) In-Reply-To: <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> From: Phoenix Sol Date: Fri, 9 Oct 2009 10:45:10 -0500 Message-ID: <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> Subject: Re: Documentation Markup To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 2:32 PM, steve donovan wrote: > Lua order is pretty flexible, though you do have to declare local > functions up front as locals... Global functions, too, I noticed. I'm kinda surprised, since there is always a compilation step before execution. (But I'm still very ignorant of Lua's implementation.) fire() local function fire() print('foo') end lua: test.lua:4: attempt to call global 'fire' (a nil value) stack traceback: test.lua:4: in main chunk [C]: ? fire() function fire() print('foo') end --global lua: test.lua:4: attempt to call global 'fire' (a nil value) stack traceback: test.lua:4: in main chunk [C]: ? Oh well. I'm still digging it. Sorry to stray off topic. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:03:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99G385f024489; Fri, 9 Oct 2009 13:03:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A2CB1929D; Fri, 9 Oct 2009 13:01:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (trick.b-et-a.de [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id BAB5D18D5E for ; Fri, 9 Oct 2009 13:01:53 -0300 (BRT) Received: (qmail 15854 invoked by uid 600); 9 Oct 2009 16:02:30 -0000 Date: Fri, 9 Oct 2009 18:02:29 +0200 From: Klaus Ripke To: Lua list Subject: Re: Documentation Markup Message-ID: <20091009160229.GD24170@fand.local> Mail-Followup-To: Lua list References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 09, 2009 at 10:45:10AM -0500, Phoenix Sol wrote: > On Fri, Oct 9, 2009 at 2:32 PM, steve donovan wrote: > > Lua order is pretty flexible, though you do have to declare local > > functions up front as locals... > > Global functions, too, I noticed. I'm kinda surprised, since there is > always a compilation step before execution. (But I'm still very > ignorant of Lua's implementation.) ... > fire() > function fire() print('foo') end --global compilation creates the function body, but the assignment to the global fire happens at runtime it is really fire = function () print('foo') http://www.lua.org/manual/5.1/manual.html#2.5.9 yet local makes it worse by creating a _new_ local variable cheers From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:18:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GI3id027367; Fri, 9 Oct 2009 13:18:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1F4719365; Fri, 9 Oct 2009 13:16:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA07.westchester.pa.mail.comcast.net (qmta07.westchester.pa.mail.comcast.net [76.96.62.64]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EF3C19355 for ; Fri, 9 Oct 2009 13:16:53 -0300 (BRT) Received: from OMTA17.westchester.pa.mail.comcast.net ([76.96.62.89]) by QMTA07.westchester.pa.mail.comcast.net with comcast id qdNM1c0061vXlb857gHZhR; Fri, 09 Oct 2009 16:17:33 +0000 Received: from sz0036.wc.mail.comcast.net ([76.96.58.86]) by OMTA17.westchester.pa.mail.comcast.net with comcast id qgQF1c00H1rdXlG3dgQFbK; Fri, 09 Oct 2009 16:24:15 +0000 Date: Fri, 9 Oct 2009 16:17:32 +0000 (UTC) From: dcharno@comcast.net To: Lua list Message-ID: <808369495.4452251255105052962.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> In-Reply-To: <20091009091139.B454@lua.tecgraf.puc-rio.br> Subject: LuaSocket download MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_228718_1054504136.1255105052959" X-Originating-IP: [216.17.78.130] X-Mailer: Zimbra 5.0.18_GA_3076.RHEL5_64 (ZimbraWebClient - SAF3 (Win)/5.0.18_GA_3076.RHEL5_64) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_228718_1054504136.1255105052959 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Does anyone know where to get a copy of LuaSocket while LuaForge is down??? ------=_Part_228718_1054504136.1255105052959 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Does anyone know where to get a copy of LuaSocket while LuaForge is down???
------=_Part_228718_1054504136.1255105052959-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:21:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GL3T6027886; Fri, 9 Oct 2009 13:21:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E1C31937C; Fri, 9 Oct 2009 13:19:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 199BA19372 for ; Fri, 9 Oct 2009 13:19:51 -0300 (BRT) Received: by ewy26 with SMTP id 26so7656490ewy.5 for ; Fri, 09 Oct 2009 09:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=L77WxtEB3fSq4wp1S8RmasUT6pVrt8a1K+4ReTx3PdM=; b=Qi5dCKMoByHzd/aecDYKjiGbpjyaBFQbYx61XNAcWaFdd5N4SkI1+qDSWCWPQCqSVh O3TZ8gWG3im4VirTMaQtQeTQwk+nh+STVnkdVzaoc2TUD8Snxl6Fk+k5FcPB3yS+2TH6 jHO0AioQxWf8BAwpKrnr6k+Ch38/Whnb38BAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sAp7iaCpGwg58PvXJJgbeNWLM+vBIPMbSBOeMzHmAaSTn/23C+of2hs8/xGkzjk3tT NSEHz88mY+dPOLs21Nf1lBLivcv3e3O7QYKrDHevyEozkPP2bqoFcdd8+YyA/YBLNwbE 0cCMRrD922bStmavuwzlEjKqsGE6MBBgZa4tM= MIME-Version: 1.0 Received: by 10.210.160.12 with SMTP id i12mr488112ebe.9.1255105230806; Fri, 09 Oct 2009 09:20:30 -0700 (PDT) In-Reply-To: <808369495.4452251255105052962.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> References: <20091009091139.B454@lua.tecgraf.puc-rio.br> <808369495.4452251255105052962.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> Date: Fri, 9 Oct 2009 17:20:30 +0100 Message-ID: <18516c6c0910090920q6fc4cc4ct3d82d07a5d5b41c3@mail.gmail.com> Subject: Re: LuaSocket download From: Colin Thompson To: Lua list Content-Type: multipart/alternative; boundary=001485eb00c970207b047582f59e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485eb00c970207b047582f59e Content-Type: text/plain; charset=ISO-8859-1 I have luasocket-2.0.2.tar.gz that I downloaded a couple of weeks ago. want me to forward it to you? 2009/10/9 > Does anyone know where to get a copy of LuaSocket while LuaForge is down??? > --001485eb00c970207b047582f59e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have luasocket-2.0.2.tar.gz that I downloaded a couple of weeks ago. want= me to forward it to you?

2009/10/9 <dcharno@comcast.ne= t>
Does anyone = know where to get a copy of LuaSocket while LuaForge is down???

--001485eb00c970207b047582f59e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:23:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GNoir028955; Fri, 9 Oct 2009 13:23:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA35B193BF; Fri, 9 Oct 2009 13:22:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBCB2193B8 for ; Fri, 9 Oct 2009 13:22:43 -0300 (BRT) Received: from OMTA17.westchester.pa.mail.comcast.net ([76.96.62.89]) by QMTA01.westchester.pa.mail.comcast.net with comcast id qb4L1c0031vXlb851gPQle; Fri, 09 Oct 2009 16:23:24 +0000 Received: from sz0036.wc.mail.comcast.net ([76.96.58.86]) by OMTA17.westchester.pa.mail.comcast.net with comcast id qgW71c0071rdXlG3dgW72N; Fri, 09 Oct 2009 16:30:07 +0000 Date: Fri, 9 Oct 2009 16:23:24 +0000 (UTC) From: dcharno@comcast.net To: Lua list Message-ID: <374591833.4455331255105404810.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> In-Reply-To: <18516c6c0910090920q6fc4cc4ct3d82d07a5d5b41c3@mail.gmail.com> Subject: Re: LuaSocket download MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_228895_748319349.1255105404809" X-Originating-IP: [216.17.78.130] X-Mailer: Zimbra 5.0.18_GA_3076.RHEL5_64 (ZimbraWebClient - SAF3 (Win)/5.0.18_GA_3076.RHEL5_64) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_228895_748319349.1255105404809 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Yes please. Thanks ... ----- Original Message ----- From: "Colin Thompson" To: "Lua list" Sent: Friday, October 9, 2009 12:20:30 PM GMT -05:00 US/Canada Eastern Subject: Re: LuaSocket download I have luasocket-2.0.2.tar.gz that I downloaded a couple of weeks ago. want me to forward it to you? 2009/10/9 < dcharno@comcast.net > Does anyone know where to get a copy of LuaSocket while LuaForge is down??? ------=_Part_228895_748319349.1255105404809 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Yes please.  Thanks ...

----- Original Message -----
From: "Colin Thompson" <colinthompson286@googlemail.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Friday, October 9, 2009 12:20:30 PM GMT -05:00 US/Canada Eastern
Subject: Re: LuaSocket download

I have luasocket-2.0.2.tar.gz that I downloaded a couple of weeks ago. want me to forward it to you?

2009/10/9 <dcharno@comcast.net>
Does anyone know where to get a copy of LuaSocket while LuaForge is down???

------=_Part_228895_748319349.1255105404809-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:28:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GRwjY029818; Fri, 9 Oct 2009 13:27:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 339B0193C8; Fri, 9 Oct 2009 13:26:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6783193B8 for ; Fri, 9 Oct 2009 13:26:47 -0300 (BRT) Received: by fxm12 with SMTP id 12so978193fxm.5 for ; Fri, 09 Oct 2009 09:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3WO5qoFmN5tGKvNe283mzPt58K4daHe/6y1Lix3yr1I=; b=DDQXXwSrOKceF4xgpOnVetH19KQZbZC6gj1NN48AePckKH7NDhodZv3laOPbTo9om3 sisDtZOzOourtz0npPwngjC8u9xP1hMyaUEVTD1uOIqoD68eucCQXfTAF3jIB+1W2N25 TD/BBvR2w3kBdn47qHq+daSU3EcaR8RvNMGPo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fhvERW+rZ1Yb9DivPsKeWcBObgvPAvw/BTELcg6Ngk7TwoDW/i4NkR8UerLmeMYHY/ DmXBS+jK0bCtdoU8dPRJH6J4VTYPwxKSt5n0Ax+fl1J4/yX1pfC/YhOZQWJtUxpl74bf jBKtSngZBDu0WpSs8+4LibiW9yV3n4MvreOQs= MIME-Version: 1.0 Received: by 10.239.139.80 with SMTP id s16mr139972hbs.111.1255105647295; Fri, 09 Oct 2009 09:27:27 -0700 (PDT) In-Reply-To: <20091009160229.GD24170@fand.local> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> <20091009160229.GD24170@fand.local> Date: Fri, 9 Oct 2009 18:27:27 +0200 Message-ID: <560972290910090927y2c5ac19dwd696e07de00b7aac@mail.gmail.com> Subject: Re: Documentation Markup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 6:02 PM, Klaus Ripke wrote: > compilation creates the function body, > but the assignment to the global fire happens at runtime Yes, exactly. So the only way to get some freedom of ordering n a program is to have a main() call at the very end. Then the definition of main can be at the start. If you want local functions (which are good for several reasons) in arbitrary order then: local fun1,fun2 fun2 = function() fun1() end fun1 = function() print 'fun!' end fun2() There is a temptation to write local function fun1 () .. but as pointed out, that gives you another local! steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:34:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GYDOj030930; Fri, 9 Oct 2009 13:34:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29838193D2; Fri, 9 Oct 2009 13:33:05 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EB50193CB for ; Fri, 9 Oct 2009 13:32:58 -0300 (BRT) Received: by fxm12 with SMTP id 12so983923fxm.5 for ; Fri, 09 Oct 2009 09:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=dEfVfTnI7wN5Djnuc7Y1SydpYz+zfnFVoH1szuypOOw=; b=ZGf0kcT7giKArBSPAx7jMZSDqGaO5sSB2I88Mw+0AO7gtvz7wbs5N5bgRt7uhgragA wi6YD0YJVsVDro/iHb7MkMr1ORYn7ulCNnkcefFwfKjzGJCDEnPiVNFcB7QVPsqLcd3X Vp3C4TfV+Oh6ytOhsWXMqE8+oS7Qu/7pipwuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ltjjQ+Ad+HJG7oKApydjLaQuBIY8Dn6lGFCVlQftStku8Qcb1qr0TTIFoOUiWAo+n5 dqe/s4kN3FoT4c8G/uJsPoRcV8+poxTmA4wqu7f/bqdqLtuoJONYhPtI/B+EI2fbWiju M1Zrb94g3FcrVD+8ekfZl8IRlqiLv7S1NiMOI= MIME-Version: 1.0 Received: by 10.239.168.131 with SMTP id k3mr140062hbe.101.1255106017418; Fri, 09 Oct 2009 09:33:37 -0700 (PDT) In-Reply-To: <374591833.4455331255105404810.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> References: <18516c6c0910090920q6fc4cc4ct3d82d07a5d5b41c3@mail.gmail.com> <374591833.4455331255105404810.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> Date: Fri, 9 Oct 2009 18:33:37 +0200 Message-ID: <560972290910090933o4dabacfbg19fb6ae6789de527@mail.gmail.com> Subject: Re: LuaSocket download From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 6:23 PM, wrote: >> Does anyone know where to get a copy of LuaSocket while LuaForge is >> down??? To reiterate, even if you don't use LuaRocks, you can grab the rock and unpack it (it's just a zip file) The repository has a nice index.html, so if you go to: http://www.luarocks.org/repositories/rocks/ in your browser, you can see in the column down the right-hand side you will see links like ' rockspec, src, win32-x86'; anything that isn't 'rockspec' is the actual rock. Just ask for rock files to be opened with WinZip or the equivalent, and you will see the source/binary tarball inside it. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:46:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GkaId000874; Fri, 9 Oct 2009 13:46:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 423FC19419; Fri, 9 Oct 2009 13:45:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BA4E19409 for ; Fri, 9 Oct 2009 13:45:27 -0300 (BRT) Received: by yxe17 with SMTP id 17so767247yxe.33 for ; Fri, 09 Oct 2009 09:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8YuUlME+uHcIuEPJqd9rnKe8fU94q/AAG7AnxzSfAIw=; b=NTYQxyhiwXK2QTlg+YyNgEZv8jurRuEblnvly5Ca5Z4YQDm6TjopsQKZO9af28FF2S yvFrE3I46htGX8ru9levZxX3bW+yHosnyXGmHee3Sp/B5JaGbpf5XqwRfs+NP7R9mhi2 iHXA2hJceZ3qKjc2IJE5D49a2p40tg14duZTE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=QPQu+aJAQpiXRJb3vhCyTsCM61rhCzTYn/y+HJAWHSCsXQ6ktheQ+WuFkx4d7TPoND 4M3Bg5232J3zhXMSgLIRi+x3hjIXDcFcMFDHB25zGszxIIhUD2VeNsv03gN9SnXSd9nN MKrli7lUiTU+AyB0pkzM/qpgyqV4i4xsDEz/4= MIME-Version: 1.0 Received: by 10.101.107.2 with SMTP id j2mr3330946anm.135.1255106767432; Fri, 09 Oct 2009 09:46:07 -0700 (PDT) Date: Fri, 9 Oct 2009 12:46:07 -0400 Message-ID: Subject: LuaLDAP - sources? From: "Thomas Harning Jr." To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just wondering, where is the current best way to get the latest LuaLDAP sources since LuaForge is down? As a side-note, is there any further maintainence being performed on it, or has it gone stale (for better or worse)? I plan on using it in a project and taking advantage of Windows integrated authentication and use the "default" AD server that the user is connected to... I suspect I'll have to apply a patch. On that note, does anyone here know how to get the "current" user records out of LDAP. Figured I'd put this out there in case anybody knows of a quick-solution. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 13:56:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99GuZuf002998; Fri, 9 Oct 2009 13:56:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DAB31937A; Fri, 9 Oct 2009 13:55:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5830819366 for ; Fri, 9 Oct 2009 13:55:26 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n99Gu7tI032294 for ; Fri, 9 Oct 2009 13:56:07 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 4CD7C54C23A; Fri, 9 Oct 2009 13:56:07 -0300 (BRT) Date: Fri, 9 Oct 2009 13:56:07 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Lua t-shirts Message-ID: <20091009165607.GA19609@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> <4ACA68A8.5030500@objmedia.demon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ACA68A8.5030500@objmedia.demon.co.uk> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Roberto Ierusalimschy wrote: >> >> We are not sure about the quality of the products sold by that site >> and we do not want complains like "you recommended that lousy shirt to >> us"... (I am not saying those products do not have quality, only that >> we actually do not know about it.) >> >> > Hi, > > Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about what > he chooses to use, so take a look. > > http://www.zazzle.com/successfulsoftware Does any one else have an opinion about these products? -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:07:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99H7UHG005795; Fri, 9 Oct 2009 14:07:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A6501A600; Fri, 9 Oct 2009 14:06:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AC6219366 for ; Fri, 9 Oct 2009 14:06:17 -0300 (BRT) Received: by fxm12 with SMTP id 12so1015043fxm.5 for ; Fri, 09 Oct 2009 10:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=TPw2i9UWy06SsRDvwUBCGHTDpueKwtG0r6o04oAyK/s=; b=oOEx0XP2qdEkQKl55EHp3YdHF5rFyLF5IAEnA0Xsvp4fBI4CQlh5LQC3dbGiXEDl4w Qg7pOcc6ppsOy5+RBa/Jaj+ii/8RRuV1fmEiU2McrnXDEME+ZGrvSSuE/LDQ2oRKWUaK dhTcntfQ6WUTPT8Aozjhi6asd4JcmmSedZV4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VJlVZIM/JmPxqaACHG5uAuw0FOAUQUeMG1iEews3t2uBypILNFN+bPp53oa09hXlWB D0sNLvsk3wnocb9Cow2+y8MZ2HX9Ghent7Te9Zzbz2CWmMSMYKXmVdMfRMfUbSeXtMQT u5Z/kCdwq8WXBbunaFUT1rzthg1n7eoEmsnIw= MIME-Version: 1.0 Received: by 10.223.144.82 with SMTP id y18mr957582fau.74.1255108017184; Fri, 09 Oct 2009 10:06:57 -0700 (PDT) In-Reply-To: <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <6a3ae47e0910090625p3bb2baccq39f03e3470ae27dc@mail.gmail.com> <560972290910090632j512a4e8cj54a9f413bc26e598@mail.gmail.com> <8a25d01b0910090845q4bc1631ia01a38cb0a40682b@mail.gmail.com> Date: Fri, 9 Oct 2009 18:06:57 +0100 Message-ID: Subject: Re: Documentation Markup From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 4:45 PM, Phoenix Sol wrote: > On Fri, Oct 9, 2009 at 2:32 PM, steve donovan wrote: >> Lua order is pretty flexible, though you do have to declare local >> functions up front as locals... > > Global functions, too, I noticed. I'm kinda surprised, since there is > always a compilation step before execution. (But I'm still very > ignorant of Lua's implementation.) 'function blah() ... end' definition really is only a variable assignment 'blah = function() ... end'. (Javascript, by contrast, likes to try to pretend otherwise about its function definitions by "hoisting" them - which can potentially lead to some odd effects, at least in IE's implementation [1].) [1] http://nedbatchelder.com/blog/200812/internet_explorer_mystery_1376.html -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:10:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HAmaO006517; Fri, 9 Oct 2009 14:10:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75B861A672; Fri, 9 Oct 2009 14:09:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1AB519366 for ; Fri, 9 Oct 2009 14:09:27 -0300 (BRT) Received: by vws9 with SMTP id 9so4147813vws.11 for ; Fri, 09 Oct 2009 10:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Qjsotdico9OBHcBWo8FSQrby5z88eeWZTyaHIUGzFEI=; b=dWgbrDERXw60eDhefScOuxAUF+kf59PoOMxsk2BhM7DSbb6A/OwilZ+nyAexsdUWsi Uyw52iSvSHsXeZSNMCuTV4eULhSskdxPO8MaLwaOFSeAQUI4n6q2cAGz2iVrlHbV3H35 4IHvYtHmuLsnCQfEHoy/tk36en9ioo5wPYF00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=HrvKIxsNvWXypDMHqhf7V8UbOcPmwHuOhzs6VgDoMAfAo8dbKvfII6ApFtbajZYTfH iWdB81UCYydXodVT6OqAMTBPzgeA45ZVI1VEOcrIYshRgLGkMwEV9iTg+9X7HyiqoglT 3MMyBPadj4EZC79xDbt5JlGcgrP9mlkiUjk94= MIME-Version: 1.0 Received: by 10.220.114.142 with SMTP id e14mr4281011vcq.83.1255108207722; Fri, 09 Oct 2009 10:10:07 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Oct 2009 14:10:07 -0300 X-Google-Sender-Auth: 2181005b2dfed40e Message-ID: <92ab989c0910091010m3a8b56c3va66291315143e0f0@mail.gmail.com> Subject: Re: LuaLDAP - sources? From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99HAmaO006517 On Fri, Oct 9, 2009 at 1:46 PM, Thomas Harning Jr. wrote: > As a side-note, is there any further maintainence being performed on > it, or has it gone stale (for better or worse)? We are working on it over the clock and the initial tests are promising. We already recovered most data and are now figuring out the details. OTOH, I can't define yet an estimate for the full recovery. André From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:14:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HE0kg007168; Fri, 9 Oct 2009 14:14:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FFB21A67C; Fri, 9 Oct 2009 14:12:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FFC9192B2 for ; Fri, 9 Oct 2009 14:12:47 -0300 (BRT) Received: by ywh5 with SMTP id 5so1902946ywh.11 for ; Fri, 09 Oct 2009 10:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6JhQ0ahe1CosbW8Q/VjzL0qRTfGNoAFVasq/fgkaba4=; b=qb56y53IHdkRfMa8jMGK8no9QY8nMG33JC0AMQuxDprj+eUY1xhQH7bbO8GHlPNrvy 6/+10RZHPngJ1ybEPIeSw55sn3ALt4qSkiLBk4tKQZlcPP0JnNCKOoqpP/CE7HEBsaDM z16bNKRvQrqUsHZoDhBkJMkJx/iqF0TLwswgE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MqWemir7mdQftjjp2PssiKiHac22W6RO/6CSPeYJuf5UZsVlG/xTguMCL1wdCjeR5Q t2/RtG+/bhQI45RWL3kyY194lcdodlWf6tomtUGmY6k0HhvgmX9DjGp/EHS94T9Y6U4A X6W621X3ySAwOeEJO6mwC3gkTmesVc8hSv+G8= MIME-Version: 1.0 Received: by 10.100.18.20 with SMTP id 20mr3371047anr.141.1255108407227; Fri, 09 Oct 2009 10:13:27 -0700 (PDT) In-Reply-To: <92ab989c0910091010m3a8b56c3va66291315143e0f0@mail.gmail.com> References: <92ab989c0910091010m3a8b56c3va66291315143e0f0@mail.gmail.com> Date: Fri, 9 Oct 2009 13:13:26 -0400 Message-ID: Subject: Re: LuaLDAP - sources? From: "Thomas Harning Jr." To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/9/09, Andre Carregal wrote: > On Fri, Oct 9, 2009 at 1:46 PM, Thomas Harning Jr. wrote: > > As a side-note, is there any further maintainence being performed on > > it, or has it gone stale (for better or worse)? > > > We are working on it over the clock and the initial tests are > promising. We already recovered most data and are now figuring out the > details. > > OTOH, I can't define yet an estimate for the full recovery. If I understand you right, you're talking about LuaForge... I meant LuaLDAP... from google's page snapshot, the last released update to the project was in 2007. -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:15:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HFBHk007593; Fri, 9 Oct 2009 14:15:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8613B1A6EB; Fri, 9 Oct 2009 14:14:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DE4D1A681 for ; Fri, 9 Oct 2009 14:14:06 -0300 (BRT) Received: by yxe17 with SMTP id 17so788316yxe.33 for ; Fri, 09 Oct 2009 10:14:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.217.3 with SMTP id p3mr1550362agg.22.1255108486289; Fri, 09 Oct 2009 10:14:46 -0700 (PDT) In-Reply-To: <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> Date: Fri, 9 Oct 2009 20:14:46 +0300 X-Google-Sender-Auth: 801f0205db870177 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016362849627adb98047583b74b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016362849627adb98047583b74b Content-Type: text/plain; charset=UTF-8 > Cosmin, if the package you want is listed at the LuaRocks repository > (http://www.luarocks.org/repositories/rocks) you can grab the > .src.rock file, it is a zip with the rockspec and the tarball with the > sources. > > I know, thanks, but not all of them have src rocks -- eg. ldecnumber didn't have one -- I'll make one and post it here- Doug Currie (the author) found me the sources. --0016362849627adb98047583b74b Content-Type: text/html; charset=UTF-8

Cosmin, if the package you want is listed at the LuaRocks repository
(http://www.luarocks.org/repositories/rocks) you can grab the
.src.rock file, it is a zip with the rockspec and the tarball with the
sources.


I know, thanks, but not all of them have src rocks -- eg. ldecnumber didn't have one -- I'll make one and post it here- Doug Currie (the author) found me the sources.

--0016362849627adb98047583b74b-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:15:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HFtAS007758; Fri, 9 Oct 2009 14:15:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E75D1A715; Fri, 9 Oct 2009 14:14:46 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C82F1A6EC for ; Fri, 9 Oct 2009 14:14:41 -0300 (BRT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADcMz0rUnw4R/2dsb2JhbADbaAqEIgQ Received: from pih-relay04.plus.net ([212.159.14.17]) by relay.ptn-ipout02.plus.net with ESMTP; 09 Oct 2009 18:15:20 +0100 Received: from [80.229.242.93] (helo=iyonix) by pih-relay04.plus.net with esmtp (Exim) id 1MwJ3n-0003fI-Pr for lua@bazar2.conectiva.com.br; Fri, 09 Oct 2009 18:15:20 +0100 Date: Fri, 09 Oct 2009 18:15:06 +0100 From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: Lua t-shirts Message-ID: <4f02a1a750.wra1th@wra1th.plus.com> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> <4ACA68A8.5030500@objmedia.demon.co.uk> <20091009165607.GA19609@inf.puc-rio.br> In-Reply-To: <20091009165607.GA19609@inf.puc-rio.br> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: 17a497f3ed1d42af70913df826b39474 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message <20091009165607.GA19609@inf.puc-rio.br> you wrote: > > Roberto Ierusalimschy wrote: > >> > >> We are not sure about the quality of the products sold by that site > >> and we do not want complains like "you recommended that lousy shirt to > >> us"... (I am not saying those products do not have quality, only that > >> we actually do not know about it.) > Does any one else have an opinion about these products? I bought a couple of Lua T-shirts from CafePress, quite a while ago. One I gave away as a present, the other I still wear. Maybe I will buy some more. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:28:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HS3vr010797; Fri, 9 Oct 2009 14:28:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9AE4919326; Fri, 9 Oct 2009 14:26:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 875DC1931E for ; Fri, 9 Oct 2009 14:26:48 -0300 (BRT) Received: by vws9 with SMTP id 9so4157556vws.11 for ; Fri, 09 Oct 2009 10:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=8PKkj9zbhyE+QV+9rqsOVx6lX/+VL7pbcnsRMbhXdHU=; b=lqYAMmsfa5PlyT0yYMEiZdtgaLF54fnbCATmBQwx1qAUs0zhki/3gTzlkHz0V4phJB isfiJJb4VSeQkwqO1rgw4qEe4/dnb6vLdVzdU5ARAoGpHlJXmJSkjTcBSCP2qUtpZ6Wx +xUqzP27c9c232wjTUH5VUCZSdHmFSdmwuzyw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=P+DYFUFLcFxQZSK8QSdlg2YF/V03jCmmFDakroYcW/iB4YoMOQl8qQTn0mgbTjWh6P F5s7wtJRvnXn1+c/loZfmJJc4ky7E6QSRqSNO6GLcC47YplL1bmD3QreV2bHam3ToAVu SgEdis+YzueC8iOE6Ih6BopyAVMsA3aN3Afi4= MIME-Version: 1.0 Received: by 10.220.109.41 with SMTP id h41mr4360303vcp.54.1255109247387; Fri, 09 Oct 2009 10:27:27 -0700 (PDT) In-Reply-To: References: <92ab989c0910091010m3a8b56c3va66291315143e0f0@mail.gmail.com> Date: Fri, 9 Oct 2009 14:27:27 -0300 X-Google-Sender-Auth: 7ec4e887d7f802dd Message-ID: <92ab989c0910091027p7a346f8bh32720be79c2b2940@mail.gmail.com> Subject: Re: LuaLDAP - sources? From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99HS3vr010797 On Fri, Oct 9, 2009 at 2:13 PM, Thomas Harning Jr. wrote: > If I understand you right, you're talking about LuaForge... I meant > LuaLDAP... from google's page snapshot, the last released update to > the project was in 2007. My bad, need to sleep. :o) André From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 14:30:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99HUcSW011347; Fri, 9 Oct 2009 14:30:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C99F41935E; Fri, 9 Oct 2009 14:29:39 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA02.westchester.pa.mail.comcast.net (qmta02.westchester.pa.mail.comcast.net [76.96.62.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CDB91934C for ; Fri, 9 Oct 2009 14:29:29 -0300 (BRT) Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA02.westchester.pa.mail.comcast.net with comcast id qhRr1c0070ldTLk52hWAtT; Fri, 09 Oct 2009 17:30:10 +0000 Received: from sz0036.wc.mail.comcast.net ([76.96.58.86]) by OMTA04.westchester.pa.mail.comcast.net with comcast id qhWA1c0031rdXlG3QhWAne; Fri, 09 Oct 2009 17:30:10 +0000 Date: Fri, 9 Oct 2009 17:30:10 +0000 (UTC) From: dcharno@comcast.net To: Lua list Message-ID: <1273053162.4485401255109410239.JavaMail.root@sz0036a.westchester.pa.mail.comcast.net> In-Reply-To: <20091009165607.GA19609@inf.puc-rio.br> Subject: Re: Lua t-shirts MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_230484_1639149954.1255109410239" X-Originating-IP: [216.17.78.130] X-Mailer: Zimbra 5.0.18_GA_3076.RHEL5_64 (ZimbraWebClient - SAF3 (Win)/5.0.18_GA_3076.RHEL5_64) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_230484_1639149954.1255109410239 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit >> Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about what >> he chooses to use, so take a look. >> >> http://www.zazzle.com/successfulsoftware > > Does any one else have an opinion about these products? I have two shirts from Zazzle. Both the material and lettering have held up well over the years. ------=_Part_230484_1639149954.1255109410239 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
>> Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about what  
>> he chooses to use, so take a look.
>>
>> http://www.zazzle.com/successfulsoftware
>
> Does any one else have an opinion about these products?

I have two shirts from Zazzle.  Both the material and lettering have held up well over the years.
------=_Part_230484_1639149954.1255109410239-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 15:23:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99IN9ou023808; Fri, 9 Oct 2009 15:23:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E90DC1A6D8; Fri, 9 Oct 2009 15:21:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70F141A6D8 for ; Fri, 9 Oct 2009 15:21:46 -0300 (BRT) Received: by fxm12 with SMTP id 12so1077376fxm.5 for ; Fri, 09 Oct 2009 11:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=GhfzmrzEmx9Br/i6zipFB/jx+P06VvRmW3xZvnic5Q0=; b=GqSj0g6XXd7DYLp/AaDfRaUFp7kToXXpCsbYsvA5BYTWV3w/kP/Fnm2t7fwPvVHZOP eI1u8iOnKzfqHJw4390gg54sbXSH6Slmkk0BstPU1h+6W8FkX5pFYtGtUSBychsQyc6W aBxOW//zAiyfviAG/EJBNDuMWfQDO+h5CAsnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=UCgYK2veuWqD1GddWVSs6jbTNKJVfrN5LhgLYCcbV6LWjjtBf70XILF2GEnrT1EcBp QbYVR380LyEXP1jjcAAsKM083bC2+3YMJFEwAW1HlXg0pQ+ldGKCiCpSJSJ0AyvsvCLV twiCPFtiImJ5hjLesNvxUHHnvHg9TeUOgel5Q= Received: by 10.204.153.215 with SMTP id l23mr2436619bkw.135.1255112545289; Fri, 09 Oct 2009 11:22:25 -0700 (PDT) Received: from ?192.168.1.2? ([122.162.196.142]) by mx.google.com with ESMTPS id f31sm2224884fkf.5.2009.10.09.11.22.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 11:22:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua t-shirts From: Jacob Jay In-Reply-To: <20091009165607.GA19609@inf.puc-rio.br> Date: Fri, 9 Oct 2009 23:52:15 +0530 Content-Transfer-Encoding: 7bit Message-Id: <74AD6518-23DA-44A1-A14B-21E46987AED9@verse.org> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> <4ACA68A8.5030500@objmedia.demon.co.uk> <20091009165607.GA19609@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Zazzle are excellent, have a massive range of great products, ship all over (personally tested to India), and the ability for the buyer to customise and choose their preferred style and colours is a big plus. I've never bought from CafePress though. On 9 Oct 2009, at 10:26 PM, Roberto Ierusalimschy wrote: >> Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about >> what >> he chooses to use, so take a look. >> >> http://www.zazzle.com/successfulsoftware > > Does any one else have an opinion about these products? From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 16:43:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99JhqZv010359; Fri, 9 Oct 2009 16:43:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C29F0192E0; Fri, 9 Oct 2009 16:42:41 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5445F192D8 for ; Fri, 9 Oct 2009 16:42:36 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwLMw-0005y3-6I for lua@bazar2.conectiva.com.br; Fri, 09 Oct 2009 21:43:14 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 21:43:14 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Oct 2009 21:43:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: Lua t-shirts Date: Fri, 9 Oct 2009 12:42:35 -0700 Lines: 26 Message-ID: References: <20091003095608.A30565@lua.tecgraf.puc-rio.br><9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com><20091003131750.GA13263@inf.puc-rio.br><790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com><20091005200154.GA30950@inf.puc-rio.br><4ACA68A8.5030500@objmedia.demon.co.uk> <20091009165607.GA19609@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: <20091009165607.GA19609@inf.puc-rio.br> X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think http://www.spreadshirt.com would be a good idea. They only charge for what features you use (leading to shirts that are usually cheaper), and offer several different print methods other than digital printing that look better and last longer. "Roberto Ierusalimschy" wrote in message news:20091009165607.GA19609@inf.puc-rio.br... >> Roberto Ierusalimschy wrote: >>> >>> We are not sure about the quality of the products sold by that site >>> and we do not want complains like "you recommended that lousy shirt to >>> us"... (I am not saying those products do not have quality, only that >>> we actually do not know about it.) >>> >>> >> Hi, >> >> Andy Brice uses Zazzle. Andy is quite picky (in a nice way) about what >> he chooses to use, so take a look. >> >> http://www.zazzle.com/successfulsoftware > > Does any one else have an opinion about these products? > > -- Roberto > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 17:37:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99KbgVI020564; Fri, 9 Oct 2009 17:37:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5171018CE2; Fri, 9 Oct 2009 17:36:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95CE618C43 for ; Fri, 9 Oct 2009 17:36:19 -0300 (BRT) Received: by fxm12 with SMTP id 12so1178922fxm.5 for ; Fri, 09 Oct 2009 13:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Lm092otfc4RRClJBFsL0x5hehdy3fG/wKIRO9Eu4mi0=; b=NDqDNZRLLLbmXlP8N7+qZvWL0ufnyNCFMJX3RWGiLwZE+G3a+cO6DbIU6SOe+CFNAk 6kqKOSXlLITOl6jJp8wEwShixFEEHrs6NQi1X1/lQBsnOq7giMTRkHHuwekprt9QmauB JllCjcjCxPPMsYS2S4DktiGkGlAUUHX8tGcLE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=RNdU6gUoW6AFAL5kuaZDGXWvOxZ8qHVe/wD20XSFDLdVbASGQYukHHIxvP+75M6eYJ IyJ7yFauhb8Y20XT/kjCgPAB0M3AG2s3esUh/CvsDXC2EpERF19GKPyZzhtIrvY/Z+Ts foK5WJo0LyIE87UhPNc4SEG61eiJKpE4lxa/c= MIME-Version: 1.0 Received: by 10.204.154.82 with SMTP id n18mr2537785bkw.128.1255120615984; Fri, 09 Oct 2009 13:36:55 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> Date: Fri, 9 Oct 2009 15:36:55 -0500 X-Google-Sender-Auth: 6bb108a994f9b09a Message-ID: <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cac18774e2a0475868ae8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cac18774e2a0475868ae8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Most of the answers in the thread agree that an Index will do the job. IMHO= , the next step is to choose the right tool, without doing it a big deal, or an interminable project by itself. Incremental improving fits so nice for this. We just need to go one stage at a time. Other considerations are that eating our own dogs food will help us improve it. We want Lua, so which well stablished framework fits better for this UNNAMED project? Blessings! On Fri, Oct 9, 2009 at 12:14 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > > Cosmin, if the package you want is listed at the LuaRocks repository >> (http://www.luarocks.org/repositories/rocks) you can grab the >> .src.rock file, it is a zip with the rockspec and the tarball with the >> sources. >> >> > I know, thanks, but not all of them have src rocks -- eg. ldecnumber didn= 't > have one -- I'll make one and post it here- Doug Currie (the author) foun= d > me the sources. > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cac18774e2a0475868ae8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Most of the answers in the thread agree that an Index will do the job. IMHO= , the next step is to choose the right tool, without doing it a big deal, o= r an interminable project by itself. Incremental improving fits so nice for= this. We just need to go one stage at a time.
Other considerations are that eating our own dogs food will help us improve= it. We want Lua, so which well stablished framework fits better for this U= NNAMED project?

Blessings!

On Fri,= Oct 9, 2009 at 12:14 PM, Cosmin Apreutesei <cosmin.apreutesei@gmail.com>= wrote:

Cosmin, if the package you want is listed at the LuaRocks repository
(h= ttp://www.luarocks.org/repositories/rocks) you can grab the
.src.rock file, it is a zip with the rockspec and the tarball with the
sources.


I know, thanks, but = not all of them have src rocks -- eg. ldecnumber didn't have one -- I&#= 39;ll make one and post it here- Doug Currie (the author) found me the sour= ces.




--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cac18774e2a0475868ae8-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 17:59:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99KxTaJ023846; Fri, 9 Oct 2009 17:59:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0CE801A6C1; Fri, 9 Oct 2009 17:58:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A82F31A683 for ; Fri, 9 Oct 2009 17:58:14 -0300 (BRT) Received: by fxm12 with SMTP id 12so1193317fxm.5 for ; Fri, 09 Oct 2009 13:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=1zv0R4EjiKo9G0KgwFSUeF5H9yff0sAAIRXxBukb6e4=; b=vh1ItGnv3LkaTA/UicpceBrF7DO9Hi2jDqKAUckXeQmUd1c7fBSxK7Ghyw06f0TdJb 9C0yg0anVb7j5n1FOLRJfO0ZxwlCrgC2pMuBOT43mvPdj44L6tmHk3jm40OYHXYSW6nM iQk5AckgKxYP7vxrTGwR5ok6s/wgEXVIwazFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=JFvMQmxDW2ESActh+sXFxXnkQzwPXsNZaJkGhiLHo1zsnSG1UWfbkoTHnJLMe9/lLh G84sGFFovAxS4TUVe/90VJs9h7lG6O5hO5lMzdGe6bMqeETtInGeHNCsNl67A6v0PUnf e+BfdcVWEuOYznixsoyNf+IUJmpsTWrzEvPMs= MIME-Version: 1.0 Received: by 10.223.6.9 with SMTP id 9mr1047122fax.84.1255121933663; Fri, 09 Oct 2009 13:58:53 -0700 (PDT) In-Reply-To: <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> From: Jim Whitehead II Date: Fri, 9 Oct 2009 21:58:33 +0100 Message-ID: <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99KxTaJ023846 2009/10/9 Fernando P. García : > Most of the answers in the thread agree that an Index will do the job. IMHO, > the next step is to choose the right tool, without doing it a big deal, or > an interminable project by itself. Incremental improving fits so nice for > this. We just need to go one stage at a time. > Other considerations are that eating our own dogs food will help us improve > it. We want Lua, so which well stablished framework fits better for this > UNNAMED project? It's already being worked on. If you want to be involved, you can contact me. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 18:06:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99L6BRZ025050; Fri, 9 Oct 2009 18:06:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FC8C1A6EC; Fri, 9 Oct 2009 18:05:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02CA31A683 for ; Fri, 9 Oct 2009 18:04:59 -0300 (BRT) Received: by fxm12 with SMTP id 12so1197957fxm.5 for ; Fri, 09 Oct 2009 14:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=2Ka6i7i4X4mpJ6cIW1OV7xR8qamUgsLdq3cz3YusPgM=; b=mnM23xBo0dUeQYydk77wTOM4lDGBMRAEek7+nn7Rm3W3qjb9gYOrImFync5tI7XBCV IRNJdG6XBI9gzKEbqbIwwn96sFH+L055rf4QbmNk+Md8MxmnGcTbuIBnQW6wdjfts8OX 2XZ6mpGwot2hvaBuLWogCca+2JZdUm78MMddM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=h0yxR1fUuIFxgSANMhqxeY5Ep0fr8uT8w0h/NdzmJI/efELmQBWTYA6CKKZW76ir8s 42O3id2j3aOp3btoWywBjpoM+BH/o4JhjhlQvL7DUWwB/Vc102zUUNB13NmL90S5zwci D4RtU1JMIZNbITFg5nuGbVNOtbLmAOdaLPO4U= MIME-Version: 1.0 Received: by 10.204.24.65 with SMTP id u1mr2266538bkb.176.1255122337989; Fri, 09 Oct 2009 14:05:37 -0700 (PDT) In-Reply-To: <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> Date: Fri, 9 Oct 2009 16:05:37 -0500 X-Google-Sender-Auth: 5a6d90dcd4a85521 Message-ID: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0003255566121b0514047586f173 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255566121b0514047586f173 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I really would like to help making this an open process, is there some issu= e queue or similar way to report feedback? can we announce the community: the next thing after luaforge is: XXXX "help wanted", "feedback welcome", "yes we can" ? Blessings! On Fri, Oct 9, 2009 at 3:58 PM, Jim Whitehead II wrote= : > 2009/10/9 Fernando P. Garc=C3=ADa : > > Most of the answers in the thread agree that an Index will do the job. > IMHO, > > the next step is to choose the right tool, without doing it a big deal, > or > > an interminable project by itself. Incremental improving fits so nice f= or > > this. We just need to go one stage at a time. > > Other considerations are that eating our own dogs food will help us > improve > > it. We want Lua, so which well stablished framework fits better for thi= s > > UNNAMED project? > > It's already being worked on. If you want to be involved, you can contac= t > me. > > - Jim > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0003255566121b0514047586f173 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I really would like to help making this an open process, is there some issu= e queue or similar way to report feedback? can we announce the community: t= he next thing after luaforge is: XXXX "help wanted", "feedba= ck welcome", "yes we=C2=A0 can" ?

Blessings!

On Fri, Oct 9, 2009 at 3:5= 8 PM, Jim Whitehead II <jnwhiteh@gmail.com> wrote:
2009/10/9 Fernando P. Garc=C3=ADa <fernando@develcuy.com>:
> Most of the answers in the thread agree that a= n Index will do the job. IMHO,
> the next step is to choose the right tool, without doing it a big deal= , or
> an interminable project by itself. Incremental improving fits so nice = for
> this. We just need to go one stage at a time.
> Other considerations are that eating our own dogs food will help us im= prove
> it. We want Lua, so which well stablished framework fits better for th= is
> UNNAMED project?

It's already being worked on. =C2=A0If you want to be involved, y= ou can contact me.

- Jim



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0003255566121b0514047586f173-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 18:11:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99LBhUF026208; Fri, 9 Oct 2009 18:11:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC44C1A6F1; Fri, 9 Oct 2009 18:10:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F1FF18489 for ; Fri, 9 Oct 2009 18:10:30 -0300 (BRT) Received: by bwz22 with SMTP id 22so6446166bwz.5 for ; Fri, 09 Oct 2009 14:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=/fCl7JHlXA43kYawZ84xnnbJcqDlkidueJaY2/CnRXA=; b=qZkxU9RIc/vMMy4Ku+NKPbdwrWAEQwSY+ad9fnvFXHAS6M0JEQxyK3cpBxRsTuadL0 9X5MkQ6RKBChMdRgkVo4eOD592bM4UPtTaQQ7HyVIkm9h2cDmc99ctsZOpyZ1nLH4JK6 82gjAycYXeSD2Lj6fw/O6ohzNdR8ifVJvf7OU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=pceU8+ueSSYUJxHN0Y2w4myYWVV1beo+VqcDD1x5aaPRGHDVxmpJHkAm8wlk6ZY4gz ZfoqeMGrhmRjdqaJI7RVOjYNH7iDEuW99Rx3q8yvEckqOb1Pn+RPJMNzEPJPI4oS9fQ2 xALOWjL8gjzSp1Wrq20ef9X0NoFVD1dPcy1cE= MIME-Version: 1.0 Received: by 10.223.21.15 with SMTP id h15mr1059447fab.15.1255122669105; Fri, 09 Oct 2009 14:11:09 -0700 (PDT) In-Reply-To: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> From: Jim Whitehead II Date: Fri, 9 Oct 2009 22:10:49 +0100 Message-ID: <5fe281d40910091410wcdfd5d5r7760ee70f9b4feb@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99LBhUF026208 2009/10/9 Fernando P. García : > I really would like to help making this an open process, is there some issue > queue or similar way to report feedback? can we announce the community: the > next thing after luaforge is: XXXX "help wanted", "feedback welcome", "yes > we  can" ? The plan is to most certainly involve the community and as I said anyone who wants to contact me for more information is welcome to. There is now an incredible amount of feedback in this thread which will help drive the design and development of a tool for the Lua community. Announcements (when appropriate) will be sent here, however the discussion of the design and development are being moved off this list (partly for the people who frankly don't care, and partly so we can actually have a focused group of developers that is manageable). Thanks for all the feedback! - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 18:30:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99LULeW029748; Fri, 9 Oct 2009 18:30:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EED1118FF0; Fri, 9 Oct 2009 18:29:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B824219027 for ; Fri, 9 Oct 2009 18:29:04 -0300 (BRT) Received: by fxm12 with SMTP id 12so1211772fxm.5 for ; Fri, 09 Oct 2009 14:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=9axjhUVnCtneVnqyRk3SXTADWH5p2whBBIAlzN8fpcA=; b=OhafKzIbirH3tOiAU76nsuFr+Jp9vejXEx3gs10efmWdjXSAp2r1/hY4WWinNYw16C WRbvEyj1osRXWn/G9Igc5wLnInRm5GORGP/fBDAsTZCN5TD04RxkfWrglv6h4tXMppwg 0fgVJLLlg7ha60r/lAf02MpqBPcSMx45iVTmE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=JeL9JCC8IVBIzf8yWaGhMmw8s7QDz1GqakfoJ1PpnMKJubjCK1El8kldcg0K877aVg oQIV/Xp0qNiwAq0t/fAbsy8NzRTZuMy8NL48ZsBGYCbOJK8PhF/IY4vW6XiVOiN4ISpi SQJJO2TBS8zC4GTwNwDXm2MncYd/B4zF360XU= MIME-Version: 1.0 Received: by 10.204.151.208 with SMTP id d16mr2569544bkw.115.1255123783630; Fri, 09 Oct 2009 14:29:43 -0700 (PDT) In-Reply-To: <5fe281d40910091410wcdfd5d5r7760ee70f9b4feb@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091410wcdfd5d5r7760ee70f9b4feb@mail.gmail.com> Date: Fri, 9 Oct 2009 16:29:40 -0500 X-Google-Sender-Auth: 13c62a942f754667 Message-ID: <5ba75e2f0910091429m7dbb9292ge2c1509f9a4512f1@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cd19a45beca04758747c7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cd19a45beca04758747c7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm committed to help with the LuaWiki. Please see volunteers list at: http://lua-users.org/cgi-bin/wiki.pl?action=3Dedit&id=3DNewCommunityInfrast= ructure Would like to publish a link or instructions on how to contact the Development Team of "New LuaForge", can you provide that information? If there is another team on charge of new LuaWiki I would like to contact them and let know the other volunteers. Blessings! On Fri, Oct 9, 2009 at 4:10 PM, Jim Whitehead II wrote= : > 2009/10/9 Fernando P. Garc=C3=ADa : > > I really would like to help making this an open process, is there some > issue > > queue or similar way to report feedback? can we announce the community: > the > > next thing after luaforge is: XXXX "help wanted", "feedback welcome", > "yes > > we can" ? > > The plan is to most certainly involve the community and as I said > anyone who wants to contact me for more information is welcome to. > There is now an incredible amount of feedback in this thread which > will help drive the design and development of a tool for the Lua > community. > > Announcements (when appropriate) will be sent here, however the > discussion of the design and development are being moved off this list > (partly for the people who frankly don't care, and partly so we can > actually have a focused group of developers that is manageable). > > Thanks for all the feedback! > > - Jim > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cd19a45beca04758747c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm committed to help with the LuaWiki. Please see volunteers list at: = http://lua-users.org/cgi-bin/wiki.pl?action=3Dedit&= amp;id=3DNewCommunityInfrastructure

Would like to publish a link or instructions on how to contact the Deve= lopment Team of "New LuaForge", can you provide that information?=

If there is another team on charge of new LuaWiki I would like to c= ontact them and let know the other volunteers.

Blessings!

On Fri, Oct 9, 2009 at 4:1= 0 PM, Jim Whitehead II <jnwhiteh@gmail.com> wrote:
2009/10/9 Fernando P. Garc=C3=ADa <fernando@develcuy.com>:
> I really would like to help making this an ope= n process, is there some issue
> queue or similar way to report feedback? can we announce the community= : the
> next thing after luaforge is: XXXX "help wanted", "feed= back welcome", "yes
> we=C2=A0 can" ?

The plan is to most certainly involve the community and as I said
anyone who wants to contact me for more information is welcome to.
There is now an incredible amount of feedback in this thread which
will help drive the design and development of a tool for the Lua
community.

Announcements (when appropriate) will be sent here, however the
discussion of the design and development are being moved off this list
(partly for the people who frankly don't care, and partly so we can
actually have a focused group of developers that is manageable).

Thanks for all the feedback!

- Jim



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cd19a45beca04758747c7-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 19:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99M2NxA002033; Fri, 9 Oct 2009 19:02:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 665F71917B; Fri, 9 Oct 2009 19:01:10 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54CCC1916D for ; Fri, 9 Oct 2009 19:01:04 -0300 (BRT) Received: by bwz22 with SMTP id 22so6471706bwz.5 for ; Fri, 09 Oct 2009 15:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=/Aa9BV8XjdGZcnwTEBlYEwtRyk7JMBDXjm/GfVlpOz8=; b=I6ZT/xmGDtUsBOHg4jl2yA2z603Sp4jIE79PoO87uZGc9ee8KF9qK0ivbfYSM4hsSf IAYDTMWxtYwlJ37HovV7jTjz0sX5zB5Ifq64NI8oesINU+WnhGtjezjFYWL8EnE1hGrq omECtzl/v1fhZ+ZijKPnLlwzyc+dSzERTHu3k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=J/xFdesOuQWkp1Tx5QxxqLBZQtD56FRkFZ2TGLIMfemRO7RxTstBA5QfANtSfimtfc 6F8Vr1Qm9xnc7EnqYS8a1c6kiEne5FJJ36mLIP+HOeb3uPe3xHZlEEXiT6PnZN9rUQOE Z6RzAX0x1Sk/EfEK6FzdLN0rBTnmSifCugTuk= MIME-Version: 1.0 Received: by 10.223.14.91 with SMTP id f27mr985088faa.90.1255125703212; Fri, 09 Oct 2009 15:01:43 -0700 (PDT) In-Reply-To: <5ba75e2f0910091429m7dbb9292ge2c1509f9a4512f1@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091410wcdfd5d5r7760ee70f9b4feb@mail.gmail.com> <5ba75e2f0910091429m7dbb9292ge2c1509f9a4512f1@mail.gmail.com> From: Jim Whitehead II Date: Fri, 9 Oct 2009 23:01:23 +0100 Message-ID: <5fe281d40910091501v3590df55w2e7bbf8f63432a@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99M2NxA002033 2009/10/9 Fernando P. García : > I'm committed to help with the LuaWiki. Please see volunteers list at: > http://lua-users.org/cgi-bin/wiki.pl?action=edit&id=NewCommunityInfrastructure > > Would like to publish a link or instructions on how to contact the > Development Team of "New LuaForge", can you provide that information? > > If there is another team on charge of new LuaWiki I would like to contact > them and let know the other volunteers. Forgive me for saying this, but I can't help but feel that while a lot of these efforts are good intentioned, they don't take the current state of the community into consideration in any way. It's all about revolutionary change, and I think that's more likely to hurt the community more than anything. We have volunteers, that's great, but we don't have any focused group working on anything. That's precisely why I've pulled the development of the snippets site, and now Luaforge offline. I also happen to disagree with a number of the "problems" listed on the wiki, but my time is better spent in other areas. Those that wish to be involved in the discussion about luaforge can contact me directly. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 19:14:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99MEC1V003698; Fri, 9 Oct 2009 19:14:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0CE01192AD; Fri, 9 Oct 2009 19:13:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F5ED192A4 for ; Fri, 9 Oct 2009 19:12:56 -0300 (BRT) Received: by gxk4 with SMTP id 4so8335479gxk.8 for ; Fri, 09 Oct 2009 15:13:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.61.31 with SMTP id j31mr1280537aga.3.1255126416851; Fri, 09 Oct 2009 15:13:36 -0700 (PDT) In-Reply-To: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> Date: Sat, 10 Oct 2009 01:13:36 +0300 X-Google-Sender-Auth: 06933985b7dc4da9 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016361e7b803982ef047587e45e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016361e7b803982ef047587e45e Content-Type: text/plain; charset=UTF-8 > > I really would like to help making this an open process, is there some > issue queue or similar way to report feedback? can we announce the > community: the next thing after luaforge is: XXXX "help wanted", "feedback > welcome", "yes we can" ? > I second that. There needs to be at least a mailing list and a wiki for this project -- this mailing list and one page on l-users wiki is not enough. For Jim - I get it u're assuming leadership on this thing -- if so, kudos -- what do you mean contact you directly? Just make a new project on google code or somewhere else and include us all who say we want to contribute in it. Most of us already have google accounts anyway. Collaborating on a p2p basis is not a good idea IMHO, while setting up a project on a hosting site takes a few minutes. I guess that was Fernando's concern about "making this an open project". --0016361e7b803982ef047587e45e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I really would l= ike to help making this an open process, is there some issue queue or simil= ar way to report feedback? can we announce the community: the next thing af= ter luaforge is: XXXX "help wanted", "feedback welcome"= , "yes we=C2=A0 can" ?

I second that. There needs to be at least = a mailing list and a wiki for this project -- this mailing list and one pag= e on l-users wiki is not enough.

For=C2=A0Jim - I = get it u're assuming leadership on this thing -- if so, kudos -- what d= o you mean contact you directly? Just make a new project on google code or = somewhere else and include us all who say we want to contribute in it. Most= of us already have google accounts anyway. Collaborating on a p2p basis is= not a good idea IMHO, while setting up a project on a hosting site takes a= few minutes. I guess that was Fernando's concern about "making th= is an open project".
--0016361e7b803982ef047587e45e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 19:17:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99MH4gT004217; Fri, 9 Oct 2009 19:17:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DC64192B1; Fri, 9 Oct 2009 19:16:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f196.google.com (mail-iw0-f196.google.com [209.85.223.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 772D1192A6 for ; Fri, 9 Oct 2009 19:15:53 -0300 (BRT) Received: by iwn34 with SMTP id 34so881784iwn.12 for ; Fri, 09 Oct 2009 15:16:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.25.160 with SMTP id z32mr178080ibb.5.1255126592874; Fri, 09 Oct 2009 15:16:32 -0700 (PDT) In-Reply-To: <20091009165607.GA19609@inf.puc-rio.br> References: <20091003095608.A30565@lua.tecgraf.puc-rio.br> <9386fb2d0910030610m5bf7d396o5ecc137461855aa1@mail.gmail.com> <20091003131750.GA13263@inf.puc-rio.br> <790db3550910030809v57e21fbfpeaae2a6e921362f2@mail.gmail.com> <20091005200154.GA30950@inf.puc-rio.br> <4ACA68A8.5030500@objmedia.demon.co.uk> <20091009165607.GA19609@inf.puc-rio.br> Date: Fri, 9 Oct 2009 17:16:32 -0500 Message-ID: <75cc17ac0910091516x737eede9v2e56a6a20775c6e3@mail.gmail.com> Subject: Re: Lua t-shirts From: Gregg Reynolds To: Lua list Content-Type: multipart/alternative; boundary=00151774041cb76753047587ee6c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151774041cb76753047587ee6c Content-Type: text/plain; charset=UTF-8 On Fri, Oct 9, 2009 at 11:56 AM, Roberto Ierusalimschy < roberto@inf.puc-rio.br> wrote: > > Roberto Ierusalimschy wrote: > >> > > > > http://www.zazzle.com/successfulsoftware > > Does any one else have an opinion about these products? > > -- Roberto > Yes. No. --00151774041cb76753047587ee6c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Oct 9, 2009 at 11:56 AM, Roberto Ierusalimschy &l= t;roberto@inf.puc-rio.br><= /span> wrote:
> Roberto Ierusalimschy wrote:
>>
>
> http://www.zazzle.com/successfulsoftware

Does any one else have an opinion about these products?

-- Roberto

Yes.=C2=A0 No.
--00151774041cb76753047587ee6c-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 19:22:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99MMDq5004880; Fri, 9 Oct 2009 19:22:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4A731A667; Fri, 9 Oct 2009 19:21:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05A291A5A0 for ; Fri, 9 Oct 2009 19:20:49 -0300 (BRT) Received: by fxm12 with SMTP id 12so1237746fxm.5 for ; Fri, 09 Oct 2009 15:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=4+ZBochzLGyJQnnW5M9hdDvJcBDDqP1ZF1pi2Xijcsg=; b=vUoeupYIn02UbFLWV7yXxEzMD4Mc+puRUns+p0Shcg6BzC7WI+v06m7BUm46tOJxR2 rUC3R/Qz/F8qrZ9yNyRkFnTgaMzMUCpULXt2QfgM8IaqoN9tb4VvB3gNRJp4OprzESEP +ICt6O9994psi40I6H7HWgto07SOydVYbvwB4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=QOF8+UFRmYPqEIWHZyTI0kYcpjm4KJE0rE/gYSznXxQnXaeMaNlad/AhPE3pr6sMrx 4wV8tM+Z28RxsNncLuagJKiuGpyDJe6MkHe88IVanot/dl0+jt4NihKZxe0qVBg5agzk BeCGHNC4sZ3fqNQJE2W6nePMjICijHVCLYzCw= MIME-Version: 1.0 Received: by 10.204.15.16 with SMTP id i16mr2626015bka.72.1255126889798; Fri, 09 Oct 2009 15:21:29 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> Date: Fri, 9 Oct 2009 17:21:29 -0500 X-Google-Sender-Auth: baee1dd5189c8ca1 Message-ID: <5ba75e2f0910091521p7290eff3h606b0e92bd40d932@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0003255540166a1c4e047588006c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255540166a1c4e047588006c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes Cosmin, you read me quite well, no intentions to hurt :) Blessings! On Fri, Oct 9, 2009 at 5:13 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > I really would like to help making this an open process, is there some >> issue queue or similar way to report feedback? can we announce the >> community: the next thing after luaforge is: XXXX "help wanted", "feedba= ck >> welcome", "yes we can" ? >> > > I second that. There needs to be at least a mailing list and a wiki for > this project -- this mailing list and one page on l-users wiki is not > enough. > > For Jim - I get it u're assuming leadership on this thing -- if so, kudos > -- what do you mean contact you directly? Just make a new project on goog= le > code or somewhere else and include us all who say we want to contribute i= n > it. Most of us already have google accounts anyway. Collaborating on a p2= p > basis is not a good idea IMHO, while setting up a project on a hosting si= te > takes a few minutes. I guess that was Fernando's concern about "making th= is > an open project". > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0003255540166a1c4e047588006c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes Cosmin, you read me quite well, no intentions to hurt :)

Blessin= gs!

On Fri, Oct 9, 2009 at 5:13 PM, Cosmi= n Apreutesei <cosmin.apreutesei@gmail.com> wrote:
I really would like to help making this an open process, is there some issu= e queue or similar way to report feedback? can we announce the community: t= he next thing after luaforge is: XXXX "help wanted", "feedba= ck welcome", "yes we=C2=A0 can" ?

I second that. There needs to be at = least a mailing list and a wiki for this project -- this mailing list and o= ne page on l-users wiki is not enough.

For=C2=A0Ji= m - I get it u're assuming leadership on this thing -- if so, kudos -- = what do you mean contact you directly? Just make a new project on google co= de or somewhere else and include us all who say we want to contribute in it= . Most of us already have google accounts anyway. Collaborating on a p2p ba= sis is not a good idea IMHO, while setting up a project on a hosting site t= akes a few minutes. I guess that was Fernando's concern about "mak= ing this an open project".



--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0003255540166a1c4e047588006c-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 19:46:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99MkcIV008047; Fri, 9 Oct 2009 19:46:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66F891A614; Fri, 9 Oct 2009 19:45:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B7D4192E9 for ; Fri, 9 Oct 2009 19:45:16 -0300 (BRT) Received: by bwz22 with SMTP id 22so6490236bwz.5 for ; Fri, 09 Oct 2009 15:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=xZwmdCUJ6LCdLTtNQYsF0jfXy/DwN1R0IMEbjIi2QR0=; b=gt7WSXDrl0yWZV/FyypC8NaT0GBTPRmjYIaPZd1loKqr2M27+vYqkkCmDKrx7orNk7 2nozzC7Y1+QZd1rhI6ZML//P76kVKgHVGWAzTeV/ORxzZsT9eE0BfZ5TZ+ecG0pOvOxw b8jw3J/LLGXzVTuZ7kOAB02ZnFbyxhMKLf6VA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=vIEWntOEjoz3rlDN62pzvLirRvBPfGcSc2tXjcj/2cadRpXRjivCA1TSfUeqV6SBM5 TeQErnfzadaUHLDNb/zQ/5XwoaeSCoLGUo7E7rt3KigmlcQo+gHDazcTt96fzZk3qMWe Q9niMuOHaXeiTzb7q7P5FSWMSRGLp5S8fEPyg= MIME-Version: 1.0 Received: by 10.223.144.81 with SMTP id y17mr1049480fau.68.1255128355056; Fri, 09 Oct 2009 15:45:55 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> From: Jim Whitehead II Date: Fri, 9 Oct 2009 23:45:35 +0100 Message-ID: <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99MkcIV008047 On Fri, Oct 9, 2009 at 11:13 PM, Cosmin Apreutesei wrote: >> I really would like to help making this an open process, is there some >> issue queue or similar way to report feedback? can we announce the >> community: the next thing after luaforge is: XXXX "help wanted", "feedback >> welcome", "yes we  can" ? > > I second that. There needs to be at least a mailing list and a wiki for this > project -- this mailing list and one page on l-users wiki is not enough. > For Jim - I get it u're assuming leadership on this thing -- if so, kudos -- > what do you mean contact you directly? Just make a new project on google > code or somewhere else and include us all who say we want to contribute in > it. Most of us already have google accounts anyway. Collaborating on a p2p > basis is not a good idea IMHO, while setting up a project on a hosting site > takes a few minutes. I guess that was Fernando's concern about "making this > an open project". I am not suggesting we coordinate on a peer to peer basis. I said, very plainly, to contact me if you are interested. There is of course a mailing list, but I have absolutely no interest in simply moving this thread to the new mailing list. The project will be open source, it will exist on github. But we are in the planning stages, and this is how things are going to be run at this point. Too many cooks in the kitchen will be a death sentence for the project, and I'm not willing to let that happen. I understand your concerns, and I don't think anyone here is asking for something unreasonable. But I'm also very aware that this is not the first time these concerns have been raised, and these types of discussions have happened in the past. What didn't happen in the past was any action. That's something (at least with luaforge/snippets) I'm hoping to change. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:01:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99N1hot009704; Fri, 9 Oct 2009 20:01:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97F9C1A6A7; Fri, 9 Oct 2009 20:00:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nschwmtas02p.mx.bigpond.com (nschwmtas02p.mx.bigpond.com [61.9.189.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B44E4190C7 for ; Fri, 9 Oct 2009 20:00:28 -0300 (BRT) Received: from nschwotgx01p.mx.bigpond.com ([143.238.91.39]) by nschwmtas02p.mx.bigpond.com with ESMTP id <20091009230104.IMII2264.nschwmtas02p.mx.bigpond.com@nschwotgx01p.mx.bigpond.com> for ; Fri, 9 Oct 2009 23:01:04 +0000 Received: from [10.0.0.8] (really [143.238.91.39]) by nschwotgx01p.mx.bigpond.com with ESMTP id <20091009230103.DSTM5339.nschwotgx01p.mx.bigpond.com@[10.0.0.8]> for ; Fri, 9 Oct 2009 23:01:03 +0000 Message-ID: <4ACFC016.90306@bigpond.net.au> Date: Sat, 10 Oct 2009 09:58:30 +1100 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaForge is down and will be for some time References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> In-Reply-To: <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx01p.mx.bigpond.com from [143.238.91.39] using ID btolputt@bigpond.net.au at Fri, 9 Oct 2009 23:01:03 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150204.4ACFC0B0.0001,ss=1,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Whitehead II wrote: > I am not suggesting we coordinate on a peer to peer basis. I said, > very plainly, to contact me if you are interested. There is of course > a mailing list, but I have absolutely no interest in simply moving > this thread to the new mailing list. > > ... > > What didn't happen in the past was any action. That's something (at > least with luaforge/snippets) I'm hoping to change I think what some of the people are concerned about, Jim, is that your project could also wind up going nowhere. No offence, abandoned projects are pretty standard fare in the open source world. Not everyone expressing interest in this project is intending to be a developer or even top have input. However, a large number of us are invested in there being a replacement to LuaForge (in whatever fashion that may be) and the we cannot just keep pinging you on the progress. We're interested in there being action too. You'll notice no-one is worried about you taking leadership or such-like. We're simply worried that we'll be waiting on progress reports or implementations long after you've stopped developing the project. A LuaForge replacement is not like developing a new module to Lua - it affects everyone LOOKING FOR modules & improvements they can use in/with Lua. It affects everyone. As such, a project page where we can see progress (or worst case, lack thereof) will give us confidence to leave you alone. -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:08:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99N8Fiu010250; Fri, 9 Oct 2009 20:08:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBFD419107; Fri, 9 Oct 2009 20:07:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1A20190C7 for ; Fri, 9 Oct 2009 20:07:02 -0300 (BRT) Received: by ywh5 with SMTP id 5so2148874ywh.11 for ; Fri, 09 Oct 2009 16:07:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.189.1 with SMTP id r1mr1712926agp.109.1255129661969; Fri, 09 Oct 2009 16:07:41 -0700 (PDT) In-Reply-To: <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> Date: Sat, 10 Oct 2009 02:07:41 +0300 X-Google-Sender-Auth: 71210661d9e4bf4d Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e64602d6a61838047588a58e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64602d6a61838047588a58e Content-Type: text/plain; charset=UTF-8 > > I am not suggesting we coordinate on a peer to peer basis. I said, > very plainly, to contact me if you are interested. Consider yourself contacted :) > The project will be open source, it will exist on github. But we are > in the planning stages, and this is how things are going to be run at > this point. Who is "we" ? Who does the planning and where can I see this planning going on? I want to be part of it. > Too many cooks in the kitchen will be a death sentence > for the project, and I'm not willing to let that happen. > I agree, and I'm sure that whatever model and rules for development you set it's gonna be just fine, just open'em up so we can see'em and participate to the process. What didn't happen in the past was any action. That's something (at > least with luaforge/snippets) I'm hoping to change. Setup a stage and we'll see. --0016e64602d6a61838047588a58e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am not suggest= ing we coordinate on a peer to peer basis. =C2=A0I said,
very plainly, to contact me if you are interested. =C2=A0
=
Consider yourself contacted :)
=C2=A0
The project will be open source, it will exist on github. =C2=A0But we are<= br> in the planning stages, and this is how things are going to be run at
this point.

Who is "we" ? Who doe= s the planning and where can I see this planning going on? I want to be par= t of it.
=C2=A0
=C2=A0Too many cooks in the kitchen will be a death sentence
for the project, and I'm not willing to let that happen.

I agree, and I'm sure that whatever model and rul= es for development you set it's gonna be just fine, just open'em up= so we can see'em and participate to the process.

What didn't happen in th= e past was any action. =C2=A0That's something (at
least with luaforge/snippets) I'm hoping to change.
Setup a stage and we'll see.
--0016e64602d6a61838047588a58e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:18:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NIAGf011382; Fri, 9 Oct 2009 20:18:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FF801937E; Fri, 9 Oct 2009 20:17:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFFD619376 for ; Fri, 9 Oct 2009 20:16:54 -0300 (BRT) Received: by bwz22 with SMTP id 22so6501665bwz.5 for ; Fri, 09 Oct 2009 16:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=nT2Vgv+ncBMCkYxHtBiHIUJKV6wfoQr9MINSafaEx3A=; b=U39wagSqXW6kd2vlC76HxfXxPKqZ4l0n99ESSMKR0xEW2nzN6d6+OVU4gM/7hT5R2Q i0JypXut0tigrlkbkCrr11WYE1GmB/AX0HBv+LDhHBABxmGvfVaWjHka0z/h6kNP9iJe ncpgthSQV+9Z0X//5/IcgwPUpXppGxgpHmyqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=tVLJ5MPuVAjkbFNPOdesGvQRJKbtnbKYr/qvyhQoyISyuZAqutiFdFMKwx5tCdIBde /lZtZzHVFzlmLMquqomnK6A0g+MHf5rKGHYYCZrlUOCCaTl2gC6//bMU6fQSN3pHmX49 hzQPmhTXNMPIuikPmx0RD1SlOEBRZ43zdXcYQ= MIME-Version: 1.0 Received: by 10.223.14.91 with SMTP id f27mr994600faa.90.1255130253067; Fri, 09 Oct 2009 16:17:33 -0700 (PDT) In-Reply-To: <4ACFC016.90306@bigpond.net.au> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <4ACFC016.90306@bigpond.net.au> From: Jim Whitehead II Date: Sat, 10 Oct 2009 00:17:13 +0100 Message-ID: <5fe281d40910091617u2cf5da6apfa8c2bf7ce41b7c@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99NIAGf011382 On Fri, Oct 9, 2009 at 11:58 PM, Benjamin Tolputt wrote: > Jim Whitehead II wrote: >> I am not suggesting we coordinate on a peer to peer basis.  I said, >> very plainly, to contact me if you are interested.  There is of course >> a mailing list, but I have absolutely no interest in simply moving >> this thread to the new mailing list. >> >> ... >> >> What didn't happen in the past was any action.  That's something (at >> least with luaforge/snippets) I'm hoping to change > > I think what some of the people are concerned about, Jim, is that your > project could also wind up going nowhere. No offence, abandoned projects > are pretty standard fare in the open source world. Not everyone > expressing interest in this project is intending to be a developer or > even top have input. However, a large number of us are invested in there > being a replacement to LuaForge (in whatever fashion that may be) and > the we cannot just keep pinging you on the progress. I understand. I never once meant to imply that you needed to ping me for progress. I stated very clearly that if you are interested in the discussion or development, to contact me. I will then ensure that you are included in the discussion. > We're interested in there being action too. You'll notice no-one is > worried about you taking leadership or such-like. We're simply worried > that we'll be waiting on progress reports or implementations long after > you've stopped developing the project. I don't intend you to wait. I just asked you to contact me to be included in the discussion. Given that at that point (and even now) we had not completely decided on where the discussion was going to take place I think that's reasonable. > A LuaForge replacement is not like developing a new module to Lua - it > affects everyone LOOKING FOR modules & improvements they can use in/with > Lua. It affects everyone. > > As such, a project page where we can see progress (or worst case, lack > thereof) will give us confidence to leave you alone. I don't want you to leave me alone, I want you to be involved in the project. That's precisely why I asked anyone who is interested to contact me. I'm really having difficulty understanding where the communications breakdown has happened here. Given that, it's almost certainly something I've done or said, but now that I am aware of it I'm not sure how I can be much clearer. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:22:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NMGhU011746; Fri, 9 Oct 2009 20:22:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1B6A1938F; Fri, 9 Oct 2009 20:21:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2D9519378 for ; Fri, 9 Oct 2009 20:21:02 -0300 (BRT) Received: by fxm12 with SMTP id 12so1262429fxm.5 for ; Fri, 09 Oct 2009 16:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=KmsYTA7aZiglMCmBE4RuirjYfzEH+qPBugT+O+kW3w8=; b=d1IVDWidZpa3zB8NARwC8Gc1LRiuXrslog5NsgVIkLY1D0cCnAbP0Ow3P5MSa0rtc+ 4F0Z+m74lkLyC9686KvnVTnPodclj0iOkL4Wygio1QQCqHb/0ZF151hSEvHezvN0VVs3 qhCv00zr+VApaehV6td3fc9maVURE5YopQ6Xs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=a+rEN5cmW9g8Te+CTONSp928i8c1S+AO/A0Aci/gKUjNZhX5/UyLLWQSTkQ1oQMMKs FCX/0u5ZRZxSfufMKevgnG9PZhBDGrM3gXRrbNlJUwvW8AJKQRPTunRpzMU3acSMLP4h 2wNX2BTQZZaKc0YvSvzcuRknUFkxBe2H9JTkQ= MIME-Version: 1.0 Received: by 10.223.144.81 with SMTP id y17mr1054265fau.68.1255130501102; Fri, 09 Oct 2009 16:21:41 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> From: Jim Whitehead II Date: Sat, 10 Oct 2009 00:21:21 +0100 Message-ID: <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99NMGhU011746 On Sat, Oct 10, 2009 at 12:07 AM, Cosmin Apreutesei wrote: >> I am not suggesting we coordinate on a peer to peer basis.  I said, >> very plainly, to contact me if you are interested. > > Consider yourself contacted :) > >> >> The project will be open source, it will exist on github.  But we are >> in the planning stages, and this is how things are going to be run at >> this point. > > Who is "we" ? Who does the planning and where can I see this planning going > on? I want to be part of it. Most of the initial discussions happened yesterday following the Lua Workshop. I'm not sure if all the participants wish to be singled out, but it involved two individuals from the Kepler team, myself and two other members of the community. The discussion has just begun, hence why I am requesting people contact me to be involved. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:25:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NP31v012028; Fri, 9 Oct 2009 20:25:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68DAD1A68E; Fri, 9 Oct 2009 20:23:54 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8CB619393 for ; Fri, 9 Oct 2009 20:23:42 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwOow-0008D1-QD for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 01:24:22 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 13:57:46 -0700 Lines: 44 Message-ID: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl><560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <4ACF1D50.7040808@wp.pl> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-2"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: <4ACF1D50.7040808@wp.pl> X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rather than forcing everybody's modules to conform themselves to a naming scheme, I think the way to do this would be to have a "project domain" layout scheme just for finding projects on the new LuaForge (same as the old LuaForge), and then having an extension for Rocks (or similar) that searches within these categorizations hosted as another project on LuaForge. (Another point of the architecture's design: it should have an API that makes this easy, as well as an easy data dumping facility (to satisfy Eric S. Raymond). I recommend something that dumps as a Lua table (formatted similarly to a Rockspec). "Michal Kolodziejczyk" wrote in message news:4ACF1D50.7040808@wp.pl... > steve donovan wrote: >> 2009/10/9 Michal Kolodziejczyk : >>> Let me recall similar thread: >>> http://lua-users.org/lists/lua-l/2009-01/msg00211.html >> >> I like the distinction between LOSR (lua open software repository) and >> CLAN (like Perl's CPAN). >> >> Namespace agreement can be a mission; it will lead to tedious >> arguments and will break a lot of code in the transition. (E.g., >> require 'cairo' becomes require 'graphics.cairo', and so forth) The >> pragmatic solution is to make it easy LuaForge++ for tell you exactly >> what module(s) a package provides. These are not always obvious, e.g. >> I know that LuaFileSystem provides 'lfs' but that's because I know the >> package. Then there will be no module conflicts _by mistake_. > > I would propose prepending a module name with its home domain name (in > "java way"), so: > require 'org.losr.lfs' > which could be "imported" by CLAN and published as: > require 'org.clan.lfs' > or > require 'org.clan.luafilesystem' > > It would by great if it was supported/promoted by luarocks. It would > help resolve conflicting module names, and conflicting files within > different modules. > > Regards, > miko > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:25:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NPWOK012206; Fri, 9 Oct 2009 20:25:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 862481A712; Fri, 9 Oct 2009 20:24:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2EEF19395 for ; Fri, 9 Oct 2009 20:23:44 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwOow-0008D2-Q4 for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 01:24:22 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 13:50:45 -0700 Lines: 21 Message-ID: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com><5ba75e2f0910081956s6123ec0fvd6c308d6fafe0a41@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The GPL thing, yeah probably. Is that really that big of a deal? It doesn't dictate the licenses of projects that are listed on it. As for the Bazaar bit, it's pretty much agreed upon that the next version of LuaForge won't provide code hosting at all, which neatly sidesteps that topic altogether. "Bertrand Mansion" wrote in message news:cadc14930910090135r1e4fbc43o4494f052c0618f96@mail.gmail.com... > On Fri, Oct 9, 2009 at 5:31 AM, Stuart P. Bentley > wrote: >> As an interim solution, Launchpad is open-source. We could use the source >> code from that. > > But it is GPL3 and only works with Bazaar IIRC ? > > > -- > Bertrand Mansion > Mamasam > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:26:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NQ4gU012496; Fri, 9 Oct 2009 20:26:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B50201A726; Fri, 9 Oct 2009 20:24:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE6CF19393 for ; Fri, 9 Oct 2009 20:23:44 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwOow-0008D3-Q5 for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 01:24:22 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 01:24:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 13:43:42 -0700 Lines: 147 Message-ID: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com><5fe281d40910071224n18cd3fbdlf54d514d24fc2755@mail.gmail.com><93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com><560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com><7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_021F_01CA48E6.83E373C0" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_021F_01CA48E6.83E373C0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sputnik? Just as an interim solution until we can make a full site = architecture, we could list projects on a Sputnik wiki (maybe making a = plugin or whatever for it, since I don't know how hard that is). "Fernando P. Garc=C3=ADa" wrote in message = news:5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com... Most of the answers in the thread agree that an Index will do the job. = IMHO, the next step is to choose the right tool, without doing it a big = deal, or an interminable project by itself. Incremental improving fits = so nice for this. We just need to go one stage at a time. Other considerations are that eating our own dogs food will help us = improve it. We want Lua, so which well stablished framework fits better = for this UNNAMED project? Blessings! On Fri, Oct 9, 2009 at 12:14 PM, Cosmin Apreutesei = wrote: Cosmin, if the package you want is listed at the LuaRocks = repository (http://www.luarocks.org/repositories/rocks) you can grab the .src.rock file, it is a zip with the rockspec and the tarball with = the sources. I know, thanks, but not all of them have src rocks -- eg. ldecnumber = didn't have one -- I'll make one and post it here- Doug Currie (the = author) found me the sources. --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.=20 ------=_NextPart_000_021F_01CA48E6.83E373C0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Sputnik? Just as an interim solution until we can make a full site=20 architecture, we could list projects on a Sputnik  wiki (maybe = making a=20 plugin or whatever for it, since I don't know how hard that is).
"Fernando P. Garc=C3=ADa" <fernando@develcuy.com> = wrote in=20 message news:5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com...<= /DIV>Most=20 of the answers in the thread agree that an Index will do the job. = IMHO, the=20 next step is to choose the right tool, without doing it a big deal, or = an=20 interminable project by itself. Incremental improving fits so nice for = this.=20 We just need to go one stage at a time.
Other considerations are = that=20 eating our own dogs food will help us improve it. We want Lua, so = which well=20 stablished framework fits better for this UNNAMED=20 project?

Blessings!

On Fri, Oct 9, 2009 at 12:14 PM, Cosmin = Apreutesei=20 <cosmin.apreutesei@gmail.com>=20 wrote:

Cosmin, if the package you want is listed at the = LuaRocks repository
(http://www.luarocks.org/repositories/rocks) = you can grab=20 the
.src.rock file, it is a zip with the rockspec and the = tarball with=20 the
sources.


I know, thanks, but not all of them have src rocks -- eg. = ldecnumber=20 didn't have one -- I'll make one and post it here- Doug Currie (the = author)=20 found me the sources.




-- =
Fernando=20 P. Garc=C3=ADa, http://www.develcuy.com
Developer= -=20 Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha = #377,=20 Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu = compromiso=20 con el medio ambiente, protegerlo depende de t=C3=AD. =
------=_NextPart_000_021F_01CA48E6.83E373C0-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:29:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NTaYn013044; Fri, 9 Oct 2009 20:29:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6BC1193A0; Fri, 9 Oct 2009 20:28:33 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9972D19397 for ; Fri, 9 Oct 2009 20:28:21 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MbO5E-1Mdd3X3cFY-00JHx9; Fri, 09 Oct 2009 19:29:01 -0400 Message-ID: <0A6432B1F8254A7B93D3458E244B2AFC@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> In-Reply-To: <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 16:28:48 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+MM0pbP1meeOEeTLZemph+l59uEkD5/R4PH3b MoVnZhSWuPHCq3h0uIU+b/mogzO9A9/3L2QEiy0i3m4yamLglw bvnuqnXwXpDe5reDBjKqnO3cMKjKS4W X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It would be more conducive to volunteers and such if there existed the capacity to lurk before actively joining the discussion. -------------------------------------------------- From: "Jim Whitehead II" Sent: Friday, October 09, 2009 P4:21 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: LuaForge is down and will be for some time > On Sat, Oct 10, 2009 at 12:07 AM, Cosmin Apreutesei > wrote: >>> I am not suggesting we coordinate on a peer to peer basis. I said, >>> very plainly, to contact me if you are interested. >> >> Consider yourself contacted :) >> >>> >>> The project will be open source, it will exist on github. But we are >>> in the planning stages, and this is how things are going to be run at >>> this point. >> >> Who is "we" ? Who does the planning and where can I see this planning >> going >> on? I want to be part of it. > > Most of the initial discussions happened yesterday following the Lua > Workshop. I'm not sure if all the participants wish to be singled > out, but it involved two individuals from the Kepler team, myself and > two other members of the community. The discussion has just begun, > hence why I am requesting people contact me to be involved. > > - Jim > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:33:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NX18F013381; Fri, 9 Oct 2009 20:33:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E27FD1A716; Fri, 9 Oct 2009 20:31:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFB9C1A685 for ; Fri, 9 Oct 2009 20:31:49 -0300 (BRT) Received: by fxm12 with SMTP id 12so1266420fxm.5 for ; Fri, 09 Oct 2009 16:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=XOd6VDQL4xyv/W8Q1h+iL7ku0MXoZDDlblo1trxiuLM=; b=vhj8FLej9toaRCcuWQeTPsY9A8vl/IDHIYLO2L7FN2kucF4fonWpigwz1fVVbPg5oc MZ6J74GQTlsJU9aLIuWtf0ajXNeEgwj+S3c0lORSMSHmZRtmHut1JaBIurTNx6bFYVOq u3UDk934Qg1m5AXrukDPfCk66kP+9HywGfkrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ogt6em3VaUAX/vVABek9lnVoHOgR99ogJRUP9l15pH8EiU67/k26YMPCHQKmJm4HYj L1f+2pLTAm4zFVEM4S60W9CbdtTv0cAKHn8WIEET2Hw+dM0Djg9xDtbYkfv6sqA4bTFO xbWJ4o84aDQ1cQMvprcAGSlzNSVX+SFccJ2Gc= MIME-Version: 1.0 Received: by 10.223.144.81 with SMTP id y17mr1055658fau.68.1255131148067; Fri, 09 Oct 2009 16:32:28 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl> <560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <4ACF1D50.7040808@wp.pl> From: Leaf Storm Date: Fri, 9 Oct 2009 19:32:08 -0400 Message-ID: Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/9 Stuart P.Bentley : > (Another point of the architecture's design: it should have an API that > makes this easy, as well as an easy data dumping facility (to satisfy Eric > S. Raymond). I recommend something that dumps as a Lua table (formatted > similarly to a Rockspec). A data API is definitely a must, but you also want to have more than just Lua table output. JSON would be good also, because there might be people writing code in other languages to interface with LuaForge. Lua tables are a good idea, though - it's much better than having to work with JSON when using Lua code. No external libraries, no confusion about whether to dump arrays or maps, and no having to use a function to represent null. -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 20:34:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n99NYPdr013504; Fri, 9 Oct 2009 20:34:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3664190FC; Fri, 9 Oct 2009 20:33:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24FAB183DC for ; Fri, 9 Oct 2009 20:33:15 -0300 (BRT) Received: by bwz22 with SMTP id 22so6506846bwz.5 for ; Fri, 09 Oct 2009 16:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=1WER0/+biLRzAN69RZ8vn6Cm20sHfn78y6/N36PR35E=; b=tcdFMFgC+5LNEAYfnYRXxUKWg8tbqaWH5jQwLOdwxikaf03QmwNbCf50MURoNHR2Ih 3kWVXS3b3u3DD0VRqRm+tQX9vq0kb9v0I9zKY7PdKcTw8oybq14KHKtNtf/ePux34R7U VXItwMIdJSUJrZMjmITJM4WbcmjkGtSdvbbX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=XoXkx8cFZFWc2hdDMZH/CG+i6GTsgjR7JBTViN3+LcKo39qcC/LQTdnHTVZt+5GXN+ WWOO+2I4CPblbWdtaaudu+tF5VtQLOvk7AGqtiXg8lptGbmWpu+QZNp6WxpaZvMdAjrk mPPrPoB5xiIiWYzjbw1JyaV/pQX5lYSLtMDXE= MIME-Version: 1.0 Received: by 10.204.154.213 with SMTP id p21mr2621379bkw.163.1255131235655; Fri, 09 Oct 2009 16:33:55 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <93C70E9A-0FF8-45C4-877F-64FA6DBCB9FB@gmail.com> <560972290910090553yf9042d3n191e6992c50d1067@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> Date: Fri, 9 Oct 2009 19:33:55 -0400 X-Google-Sender-Auth: 8c1a122502c79675 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n99NYPdr013504 > Sputnik? Just as an interim solution until we can make a full site > architecture, we could list projects on a Sputnik  wiki (maybe making a > plugin or whatever for it, since I don't know how hard that is). I am of course all for a Sputnik-based solution, but as far an an interim solutions are concerned, LuaForge is back up. :) - yuri From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 21:26:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A0QXns017744; Fri, 9 Oct 2009 21:26:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A80721909A; Fri, 9 Oct 2009 21:25:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDBEF18FF3 for ; Fri, 9 Oct 2009 21:25:12 -0300 (BRT) Received: by yxe17 with SMTP id 17so1048249yxe.33 for ; Fri, 09 Oct 2009 17:25:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.102.6 with SMTP id e6mr1773772agm.99.1255134351956; Fri, 09 Oct 2009 17:25:51 -0700 (PDT) In-Reply-To: <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Date: Sat, 10 Oct 2009 03:25:51 +0300 X-Google-Sender-Auth: 8aa9437f4f4fb33b Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e645b7a0319a89047589bde4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e645b7a0319a89047589bde4 Content-Type: text/plain; charset=UTF-8 > > > Who is "we" ? Who does the planning and where can I see this planning > going > > on? I want to be part of it. > > Most of the initial discussions happened yesterday following the Lua > Workshop. I'm not sure if all the participants wish to be singled > out, but it involved two individuals from the Kepler team, myself and > two other members of the community. The discussion has just begun, > hence why I am requesting people contact me to be involved. Lol, looks like a secret society with a secret project. Is there a problem on announcing the luaforge google group on this list? For instance, I already took the liberty of creating a project myself here http://code.google.com/p/luaforge/ which lists some incredibly close goals to what I just read on that google group :) --0016e645b7a0319a89047589bde4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> Who is &quo= t;we" ? Who does the planning and where can I see this planning going<= br> > on? I want to be part of it.

Most of the initial discussions happened yesterday following the Lua
Workshop. =C2=A0I'm not sure if all the participants wish to be singled=
out, but it involved two individuals from the Kepler team, myself and
two other members of the community. =C2=A0The discussion has just begun, hence why I am requesting people contact me to be involved.

Lol, looks like a secret society with a secret project. Is= there a problem on announcing the luaforge google group on this list? For = instance, I already took the liberty of creating a project myself here=C2= =A0http://code.google.com/p/= luaforge/=C2=A0which lists some incredibly close goals to what I just r= ead on that google group :)

--0016e645b7a0319a89047589bde4-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 21:41:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A0fR7I018961; Fri, 9 Oct 2009 21:41:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92B971A69F; Fri, 9 Oct 2009 21:40:27 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A45001A689 for ; Fri, 9 Oct 2009 21:40:16 -0300 (BRT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:45448) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1MwQ11-00035J-5D (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Sat, 10 Oct 2009 01:40:55 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MwQ11-0002Rh-JK (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Sat, 10 Oct 2009 01:40:55 +0100 Date: Sat, 10 Oct 2009 01:40:55 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: lua@bazar2.conectiva.com.br Subject: lpeg grammar inefficiency Message-ID: User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean LPEG seems not to be very good at optimising around lpeg.V references. In particular they defeat character set combination. This can be a bit harmful to readability of grammars. For example, require "lpeg" require "re" local p = re.compile local Slow = m.P{ "Scan", TopBit = m.R "\128\255", WS = m.S " \t\r\n", SS = m.V "WS" ^1, Name = p[[ NameStart NameChar* ]], NameChar = p[[ NameStart / [0-9.-] ]], NameStart = p[[ [A-Za-z:_] / TopBit ]], Scan = p[[ ( Name / SS / . )* !. ]] } Slow:print() local WS = m.S " \t\r\n" local SS = WS^1 local NameStart = m.R("\128\255", "AZ", "az") + m.S":_" local NameChar = NameStart + m.R"09" + m.S".-" local Name = NameStart * NameChar^0 local Fast = ( Name + SS + m.P(1) )^0 * m.P(-1) Fast:print() Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:33:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1XRZp022723; Fri, 9 Oct 2009 22:33:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 101061A678; Fri, 9 Oct 2009 22:32:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B710718EA5 for ; Fri, 9 Oct 2009 22:32:12 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwQpI-0006DI-2C for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 03:32:52 +0200 Received: from 218.33.235.139.eo.eaccess.ne.jp ([218.33.235.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:32:52 +0200 Received: from miles by 218.33.235.139.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:32:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Miles Bader Subject: Re: length operator # for tables with metatables Date: Sat, 10 Oct 2009 10:32:24 +0900 Lines: 14 Message-ID: <87ljjk5907.fsf@catnip.gol.com> References: <20090922202314.GB14358@inf.puc-rio.br> <3cdcefb80909230541t21b6eff6md285062968567f74@mail.gmail.com> <4ABAAB65.6030405@bigpond.net.au> <4ABAB743.2040904@bigpond.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.33.235.139.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:qyHH20i3MTV1aliseZWNHNteToo= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Benjamin Tolputt writes: > Thanks for that. While I did indeed miss that, it doesn't really fill me > with confidence. Given the small size of the patch, the strong show of > support for the feature, and the reticence in stating anything in regards > to it being officially supported - the word "likely" comes across as less > than solid. The Lua maintainers are famously reluctant to promise _anything_. "Likely" is pretty strong coming from them... -Miles -- Patience, n. A minor form of despair, disguised as a virtue. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:39:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1dU84023050; Fri, 9 Oct 2009 22:39:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A42D61A698; Fri, 9 Oct 2009 22:38:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2440F18EA5 for ; Fri, 9 Oct 2009 22:38:22 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0LlUFj-1MLAYt3hWp-00aoKO; Fri, 09 Oct 2009 21:39:02 -0400 Message-ID: <9A7E8A273521413EA706557B2F82078A@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <790db3550910072207s155dea10p1e6844bedc6768ad@mail.gmail.com> <4ACF0612.40403@wp.pl><560972290910090317y1e645533x4ebee18f69579c95@mail.gmail.com> <4ACF1D50.7040808@wp.pl> In-Reply-To: Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 18:38:48 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+rheaRNMPLsUV27JwlNJ/oDa8BJwdhzJaLXXM kKhWyYLhVCTpzceIH0LC9WN+PsyTl0d/hmwvvFv0OaCYcDoDa0 zij8h9rdBZO3PlTB1LwVya1mamy0kHE X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean JSON and/or YAML should be provided by the API for communication. The Lua thing was more for users to saveas a backup/ rudimentary Rockspec. -------------------------------------------------- From: "Leaf Storm" Sent: Friday, October 09, 2009 P4:32 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: LuaForge is down and will be for some time > 2009/10/9 Stuart P.Bentley : >> (Another point of the architecture's design: it should have an API that >> makes this easy, as well as an easy data dumping facility (to satisfy >> Eric >> S. Raymond). I recommend something that dumps as a Lua table (formatted >> similarly to a Rockspec). > > A data API is definitely a must, but you also want to have more than > just Lua table output. JSON would be good also, because there might be > people writing code in other languages to interface with LuaForge. Lua > tables are a good idea, though - it's much better than having to work > with JSON when using Lua code. No external libraries, no confusion > about whether to dump arrays or maps, and no having to use a function > to represent null. > > -- Leaf > "There are 10 types of people in the world - those who understand > binary and those who don't." > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:40:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1edux023199; Fri, 9 Oct 2009 22:40:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD20F1A700; Fri, 9 Oct 2009 22:39:43 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2818E1A6A1 for ; Fri, 9 Oct 2009 22:39:35 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MhjfX-1MiMIP10xH-00MYNK; Fri, 09 Oct 2009 21:40:15 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910061937x40675a42t441e3093ca565844@mail.gmail.com> In-Reply-To: <92ab989c0910061937x40675a42t441e3093ca565844@mail.gmail.com> Subject: Re: LuaForge down. Again. Date: Fri, 9 Oct 2009 18:40:02 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX18CoXV8C9V+aShottyvmkgXIh+WUiZXPzXJlRy 5Dqy7KuGpaXf3RHKN4YmvDXZVVrmfpKNFXstQS2KAACEAk7VO9 76pKLBkgl7ttVL6rbU/1zwycteZHFJb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean (message noting that LuaForge is back up) -------------------------------------------------- From: "Andre Carregal" Sent: Tuesday, October 06, 2009 P7:37 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: LuaForge down. Again. > On Tue, Oct 6, 2009 at 9:39 PM, Stuart P.Bentley > wrote: >> LuaForge Could Not Connect To Database: > > Apparently a power problem impacted the server behavior. Unfortunately > we will have to wait until tomorrow to check the damage. Meanwhile > LuaForge services will be out of reach. > > Sorry for the inconvenience. > > André > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:42:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1gNQm023334; Fri, 9 Oct 2009 22:42:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBB041A71F; Fri, 9 Oct 2009 22:41:24 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88B021A67D for ; Fri, 9 Oct 2009 22:41:16 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwQy4-0000Wo-TF for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 03:41:56 +0200 Received: from 218.33.235.139.eo.eaccess.ne.jp ([218.33.235.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:41:56 +0200 Received: from miles by 218.33.235.139.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:41:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Miles Bader Subject: Re: Suitability of Lua as a First Programming Language? Date: Sat, 10 Oct 2009 10:41:28 +0900 Lines: 15 Message-ID: <877hv458l3.fsf@catnip.gol.com> References: <560972290909220039s52f7041aid0f6a393e43eae04@mail.gmail.com> <9386fb2d0909220502g126f957ax30698b908d6c996@mail.gmail.com> <438c11350909220634g6ab9eba2jb2bf7e906e4b53a@mail.gmail.com> <20090922144213.0054eb2c@trite.i.flarn.net.i.flarn.net> <87eipzro9q.fsf@lola.goethe.zz> <4AB91C22.8020709@objmedia.demon.co.uk> <4AB9338F.2040602@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.33.235.139.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:GN6EcLp1KzdH8PK8Qog/NlWxS4Y= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given writes: > I think I can summarise by saying that Python's killer feature is that > it provides the sugar to make common tasks convenient. No, python's killer feature is that everybody else uses python (and they all use it because ... everybody else does). As a language it's not the worst, but it's pretty meh. -Miles -- Alliance, n. In international politics, the union of two thieves who have their hands so deeply inserted in each other's pockets that they cannot separately plunder a third. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:42:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1gq7U023403; Fri, 9 Oct 2009 22:42:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35A981A727; Fri, 9 Oct 2009 22:41:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0B761A725 for ; Fri, 9 Oct 2009 22:41:28 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0LsjXV-1MBjOR2pD7-012oMB; Fri, 09 Oct 2009 21:42:08 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> In-Reply-To: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time Date: Fri, 9 Oct 2009 18:41:54 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19UFbadBf6CRte1GXmW79rmcdTghLO//JtTRg8 Zuolu9B9S9UycuuRctSDjlyov+4M/B7Ac0w8acvSD9KqWpbvL5 BeL35NHmnRn0tSSS3tSgsMWBE74NiI2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Now that it's back up, how recent are these backups? I ask because I notice that Lua For Windows only lists the latest version as 5.1.4-29. -------------------------------------------------- From: "Andre Carregal" Sent: Wednesday, October 07, 2009 A10:15 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: LuaForge is down and will be for some time > I have bad news about LuaForge, the damage on LuaForge might take some > time to recover. We have data backups for everything, but redoing a > GForge installation is going to take a while. To make things harder, > we are all involved today in the Lua Workshop so this may impact the > recovery time too. > > The current plan is to create a new GForge setup and import the data. > If there is anyone on the list with GForge knowledge, please contact > me off list. > > I'll keep the list informed about the progress on this operation but > our expectations are that this will certainly take a few days. > Unfortunately, until them we are out of luck with these services: > > luaforge.net main site (catalog, project info, files downloads, CVS, > issue tracker, forums) > projects mailing lists > projects FTP (the project_name.luaforge.net sites are up) > > I'm really sorry for the trouble this have caused for everyone using > LuaForge services and I hope we can have everything back asap. > > Meanwhile, I'd like to know what you think about eventually moving > from this setup based on GForge to one based on something else. One > option would be to recommend that projects moved their SCM to sites > like github or Google Code and then leave luaforge.net as just a > catalog and news site. > > Of course this eventual migration would be possible only after > LuaForge is back up (still using GForge). > > Thanks in advance for your patience. > > André > From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 22:55:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A1tPr0024311; Fri, 9 Oct 2009 22:55:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E9B019051; Fri, 9 Oct 2009 22:54:25 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90CAB18FDF for ; Fri, 9 Oct 2009 22:54:17 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwRAf-0004IW-Pf for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 03:54:57 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:54:57 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 03:54:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: LuaForge host provider Date: Fri, 9 Oct 2009 18:47:12 -0700 Lines: 3 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is changing hosting providers on the table for LuaForge? Asking because it seems the one it's got right now is pretty draconian and error-prone. From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 23:00:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A2042v024710; Fri, 9 Oct 2009 23:00:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FF051909C; Fri, 9 Oct 2009 22:59:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C90A19027 for ; Fri, 9 Oct 2009 22:58:52 -0300 (BRT) Received: by bwz22 with SMTP id 22so6547411bwz.5 for ; Fri, 09 Oct 2009 18:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=oHzVbP0qf2/ns6/r7up/ic5iUfFsj5KkdTScIQEd19A=; b=mmQdkQ2f7PQGMjy9DWODkseTL2P3bdoBhaUsJsgZUmEHnrQoHfjeuNUY/hmT3O2nIv nvl5AYOEm/OQ8dIW3cPA3P26cQUahxf+SUK3FToZIZEuXaZqvy5r2Gi7yGsP4etj1Kpk fiXak4LAt3c+zjGYVkh47vn3/xGMpZ4pp6pRY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=eMlWHNh/ZO04ijkQy8B5W49BPJ+XIM+CsjUiHBVm3ClDArRCetdiIH8QgoKRw4sLhm ZeQqCYx40Gd/jP5kA7hx/LF0XDKvoXrnyqVgVrSVgiUte2UW2Nn8X4ncBPhpikyTPLwC 2eZJf89nhhl2ZgbJ/ysnPcuY7+XosWWba5+20= MIME-Version: 1.0 Received: by 10.223.143.15 with SMTP id s15mr1065480fau.77.1255139971070; Fri, 09 Oct 2009 18:59:31 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> From: Leaf Storm Date: Fri, 9 Oct 2009 21:59:11 -0400 Message-ID: Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 8:25 PM, Cosmin Apreutesei wrote: > For instance, I > already took the liberty of creating a project myself > here http://code.google.com/p/luaforge/ which lists some incredibly close > goals to what I just read on that google group :) The project looks pretty nice, but I'm a bit wary of using rockspecs as the file format for uploading information. The purposes are different, in that rockspecs are mostly intended just to provide instructions on creating and installing rocks. Because of this, (a) they don't offer fields for things like categories, SCM or bug tracking location, alternative downloads, etc., and (b) the build instructions are present in the rockspec, and I'm not sure those really belong on an index (or even a forge). A similar format could be used, though ("metaspec"?), and I like the idea of auto-polling for specs. (Possibly, we could use metaspecs for storing the information and host rockspecs for projects if they provide one.) I would like to work on LuaForge, but I would prefer it if you [Cosmin], Jim, whoever is in charge of luaforge.net, and the rest of the Lua community could decide first who will be coordinating development. That way, we don't divide the efforts of the community on two different solutions when probably only one will be chosen. Also, an interesting idea I had was to create a prototype of the forge in Django (or some other web framework) to kind of get an idea of what exactly we're doing before we implement it fully in Lua. Admittedly, I'm not sure that anyone else would really (want|be able) to work on it. It's just an idea, as Django has a bunch of stuff included for rapid Web development that (isn't as polished|we would have to implement ourselves) in Lua (and it's the one I have the most experience in). -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 23:19:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A2JACG026179; Fri, 9 Oct 2009 23:19:11 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88D71A6FE; Fri, 9 Oct 2009 23:18:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFC5C1A680 for ; Fri, 9 Oct 2009 23:17:58 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwRXa-00046H-Nu for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 04:18:38 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 04:18:38 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 04:18:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: LuaForge-NG Date: Fri, 9 Oct 2009 19:18:11 -0700 Lines: 8 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean What are the current developments in the "developing the next generation of LuaForge" private e-mail loop thread? (Ulterior motive: I'm posting this to open the discussion on this topic in a new thread, because I read the list in a newsreader and the "LuaForge is down and will be for some time" thread has gone so deep that the titles now start past the edge of the screen.) From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 23:37:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A2brKJ027865; Fri, 9 Oct 2009 23:37:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31C721A66C; Fri, 9 Oct 2009 23:36:52 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBB5019289 for ; Fri, 9 Oct 2009 23:36:43 -0300 (BRT) Received: by bwz22 with SMTP id 22so6557075bwz.5 for ; Fri, 09 Oct 2009 19:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=hoabKxRamClw4xxR1Ig2H8JDt3A/aK9P6sBCoLHyzj4=; b=I9rcNlesiuKM5tpOVl8fKh/yLvZAOritMazNs6OHBsSkuetC8ckOClbZnUbmkEfLC8 F84HCgooLUlH/QdNE7TKVEBlIB17hjBhJ/BHi0Zbf9trLkIKyRPU0uLZg7MxYtnRnNz4 +F1f1nt8QO4fSrAgpYHSBioG2bEe/ZHSLMdu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VQ8cDnNWns72CbJHpR+0QhU7HoTCEmCiSClvuRXXCMGF8lUBZN9izH7PsAp7jy+DRL o41SW7AmwZntDr1BQqPdP2kLJp7YVlMZdfulGHqlBMyw5JK/qoAhRr3FTzRywyMStb9/ hopEwU6p9BSGizb80CJrkn1Ed4ZxmqvTFMlOw= MIME-Version: 1.0 Received: by 10.223.4.84 with SMTP id 20mr1064770faq.97.1255142242097; Fri, 09 Oct 2009 19:37:22 -0700 (PDT) In-Reply-To: References: From: Leaf Storm Date: Fri, 9 Oct 2009 22:37:02 -0400 Message-ID: Subject: Re: LuaForge host provider To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 9:47 PM, Stuart P.Bentley wrote: > Is changing hosting providers on the table for LuaForge? Asking because it > seems the one it's got right now is pretty draconian and error-prone. To be completely honest, I'm not exactly sure who owns luaforge.net and would make that call. I'm thinking it's the Lua team, but a WHOIS on luaforge.net revealed a person that I have never heard of. (Maybe someone at PUC-RIO?) -- Leaf "There are 10 types of people in the world - those who understand binary and those who don't." From lua-bounces@bazar2.conectiva.com.br Fri Oct 9 23:46:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A2kY40028424; Fri, 9 Oct 2009 23:46:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26A0C192C0; Fri, 9 Oct 2009 23:44:37 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A97EC192AE for ; Fri, 9 Oct 2009 23:44:27 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwRxD-0003TI-UA for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 04:45:07 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 04:45:07 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 04:45:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: DigiPen Lua Club Date: Fri, 9 Oct 2009 19:44:28 -0700 Lines: 512 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0357_01CA4918.EA0E2A00" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0357_01CA4918.EA0E2A00 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit The recent initiative over the LuaForge outage spawned a wiki page on the community infrastructure, and one of the items that it mentioned was that there aren't any regular meetings of the Lua community. Well, this gives me an interesting tangent to bring up something I've started recently: Lua Club! I go to DigiPen (http://www.digipen.edu), a school of video game programming and design. Since Lua is the most used programming language (other than C/C++) in the games industry, this is a prime topic for a club (since nearly all of the students have little to no knowledge of Lua, despite some student teams using it in their game projects). So I recently started a Lua Club at Digipen (first official meeting next Monday). I haven't mapped out a schedule/agenda for the class (in a test run, only one guy showed up and me and a friend pretty much just explained the ins and outs of Lua to him over a couple of hours), but I have ordered Lua Programming Gems (which is still on its way- I already have hard copies of Programming in Lua 2nd Edition and the Reference Manual) and created a poster (sources attached). Any presentation ideas / topic suggestions / ways to implement the numerous things I couldn't figure out in window.wlua (passing parameters like Copies to the CanvasDraw print job, saving to an image, shink/stretching the canvas while keeping aspect ratio) are appreciated! (Also, why hasn't anybody implemented the Lua logo as a Lua script using a library like CanvasDraw yet?) ------=_NextPart_000_0357_01CA4918.EA0E2A00 Content-Type: application/octet-stream; name="window.wlua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="window.wlua" --graphics modules require "cdlua" require "imlua" require "cdluaim" --require "cdluacontextplus" --activating GDI+ causes all the Helvetica to not render so don't --activate GDI+ --cd.UseContextPlus(1) --previwing modules require "iuplua" require "iupluacd" --starting window canvas dimensions width=8.5*50 height=11*50 --drawing function require "DrawPoster" --printing code function PrintPoster() local paper=cd.CreateCanvas(cd.PRINTER, "Lua Club Poster -d") --CreateCanvas returns nil if the user presses cancel, among other things if paper then DrawPoster(paper) cd.KillCanvas(paper) --print end end --image saving code function SavePosterImage() local image=cd.CreateCanvas(cd.IMAGERGB, (width*4).."x"..(height*4)) DrawPoster(image) cd.ImageRGBBitmap(image):imImageCreate():Save("fileout.png","PNG") end --windowing code preview=iup.canvas{rastersize=width.."x"..height,expand="NO"} function preview:map_cb() iupcan=cd.CreateCanvas(cd.IUP,self) end function preview:action() iupcan:Activate() iupcan:Clear() DrawPoster(iupcan) end boards=3 copies=iup.text{ value=1; } local window = iup.dialog{title="Preview"; iup.vbox{ iup.hbox{iup.fill{}, iup.vbox{iup.fill{}, preview, iup.fill{}}, iup.fill{}}, iup.hbox{ iup.button{ title="Print...", expand="HORIZONTAL", action=PrintPoster }, --~ copies, --~ iup.button{ --~ title=boards, --~ action=function() --~ copies.value=boards --~ end --~ } --~ iup.button{ --~ title="Save...", --~ expand="HORIZONTAL", --~ action=SavePosterImage --~ }, } } } function window:resize_cb(width, height) if width/8.5 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A3iFLn000428; Sat, 10 Oct 2009 00:44:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB25D1892D; Sat, 10 Oct 2009 00:43:01 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f196.google.com (mail-iw0-f196.google.com [209.85.223.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A3F81936E for ; Sat, 10 Oct 2009 00:42:54 -0300 (BRT) Received: by iwn34 with SMTP id 34so966295iwn.12 for ; Fri, 09 Oct 2009 20:43:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.25.29 with SMTP id x29mr6752423ibb.31.1255145730704; Fri, 09 Oct 2009 20:35:30 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Date: Fri, 9 Oct 2009 23:35:30 -0400 X-Google-Sender-Auth: a9d4c07d5d014973 Message-ID: Subject: Re: LuaForge is down and will be for some time From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 9, 2009 at 9:59 PM, Leaf Storm wrote: > ...I'm a bit wary of using rockspecs > as the file format for uploading information. The purposes are > different, in that rockspecs are mostly intended just to provide > instructions on creating and installing rocks. Because of this, (a) > they don't offer fields for things like categories, SCM or bug > tracking location, alternative downloads, etc., and (b) the build > instructions are present in the rockspec, and I'm not sure those > really belong on an index (or even a forge). A similar format could be > used, though ("metaspec"?), and I like the idea of auto-polling for > specs. (Possibly, we could use metaspecs for storing the information > and host rockspecs for projects if they provide one.) You make an important point. However, a rockspec file is segmented into multiple sections. All the building-from-source info is in the build section. Info for deployment (from source or binaries) are in the source and dependencies sections. The project metadata you talk about, however, is largely concentrated in the description section. If preferred, one may split these into separate files, so it's a small concern IMO. A major apparent difference between a rockspec file and a dist.info file (which is LuaDist's version of a rockspec), as seen for example in comparing [1,2], is that the dist.info file in fact lacks a build section. This is because the build instructions are nearly entirely concentrated in an external build file (CMake CMakeLists.txt file). This, actually, is not that different from a rockspec using a "make" backend with external Makefile, or more-so a "cmake" backend with external CMakeLists.txt file. I've argued [3] for making the dist.info format a proper subset of the rockspec format, and we've taken steps in that direction, or at least to permit automatic translation, but we haven't constrained ourselves to that, and the format is still in flux. I'm interested to see where LuaRocks 2.0 is going with this too. The mention above about DOAP [4,5] is interesting because it takes a more general direction. The recent design of dist.info at least has been directed by deployment concerns and comparison to existing port systems and package managers [3]. But DOAP and the things discussed here can be more about project descriptions. Note also that a project can have multiple release, and the rockspec/dist.info files have generally been descriptions of specific releases (and, for binary versions, specific platform builds), not necessarily a project as a whole. [1] http://luarocks.luaforge.net/rocks/luabitop-1.0.1-1.rockspec [2] http://luadist.org/repo/luadist/LuaModules/luabitop/dist.info [3] http://sourceforge.net/mailarchive/forum.php?thread_name=bc4ed2190909162208s1959b1afnd6ef8640262989%40mail.gmail.com&forum_name=luadist-devel [4] http://trac.usefulinc.com/doap [5] http://trac.usefulinc.com/doap/wiki/Sites From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 00:52:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A3qS3v001037; Sat, 10 Oct 2009 00:52:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1AF51A67D; Sat, 10 Oct 2009 00:51:31 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (unknown [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AC73183B1 for ; Sat, 10 Oct 2009 00:51:24 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MwSzz-0000LQ-9O for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 04:52:03 +0100 Received: from [192.168.2.92] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id C3ADE8FABE for ; Sat, 10 Oct 2009 04:51:59 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:30508 with envelope Message-ID: <4AD004D8.2010605@cowlark.com> Date: Sat, 10 Oct 2009 04:51:52 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Lua parser generator? Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9A3qS3v001037 I'm looking for a Bison or Yacc-like tool that will generate a parser from a BNF or EBNF grammar. Does anyone know of such a thing? Failing that, is there any way of making LPEG parse abstract tokens and not bytes from a string? -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 01:26:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A4Q36R003880; Sat, 10 Oct 2009 01:26:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 031311A6AC; Sat, 10 Oct 2009 01:24:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14A8E1A66F for ; Sat, 10 Oct 2009 01:24:48 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 9so53290qwb.11 for ; Fri, 09 Oct 2009 21:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=/3Yyv3xoFWd1CLKnNzSA1P6sSl4fPPk/CFN+VNAixns=; b=xS1zD4EHe5GTDU6LpWa+B3FzcAVNiDOxtGOhMFVFcncnrc+JX16mhx2Y50CNcCfPph Ta81NWItnD1SXIIvzdyE94462kt72XSEiMoyHa8F9LmBPheHqrLXFgEgs/Kq/jTNO4cf JsnqeDpq9tGjL9QCOFUocRXTuhjh9EGrPhuPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Eo0ctJ4PPQLlAlFoGjRuBVyiDcI2WJIw8OwbuhsKGp7wUYgJ9A9IvTyLMCt2R+JYiN mJSbR4NWl/we1BgLax5nlvLcv7XGgQZk3s0qeX4YTDridIQhp3O8cp1MkQkD5RKoIXvH pnQRP2DOc4h1yJ6HBzPCtLq8ARaDhfAItwfKs= Received: by 10.224.37.198 with SMTP id y6mr3346616qad.198.1255148728541; Fri, 09 Oct 2009 21:25:28 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 22sm427448qyk.10.2009.10.09.21.25.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 21:25:27 -0700 (PDT) Message-ID: <4AD00CAC.9090607@gmail.com> Date: Sat, 10 Oct 2009 12:25:16 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Lua parser generator? References: <4AD004D8.2010605@cowlark.com> In-Reply-To: <4AD004D8.2010605@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > I'm looking for a Bison or Yacc-like tool that will generate a parser > from a BNF or EBNF grammar. Does anyone know of such a thing? > > Failing that, is there any way of making LPEG parse abstract tokens and > not bytes from a string? There's this: LuaYacc -- Yet another yacc clone a LARL Parser Generator for Lua Copyright (c) 2006 Luis E. Garcia Ontanon -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 01:27:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A4ROG0003997; Sat, 10 Oct 2009 01:27:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D7091A6FF; Sat, 10 Oct 2009 01:26:28 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 783071A66F for ; Sat, 10 Oct 2009 01:26:21 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwTXp-0004RZ-IV for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 06:27:01 +0200 Received: from 218.33.235.139.eo.eaccess.ne.jp ([218.33.235.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 06:27:01 +0200 Received: from miles by 218.33.235.139.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 06:27:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Miles Bader Subject: Re: Lua parser generator? Date: Sat, 10 Oct 2009 13:26:03 +0900 Lines: 17 Message-ID: <87vdin50ys.fsf@catnip.gol.com> References: <4AD004D8.2010605@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.33.235.139.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:16ZxOFFektYGJMrt0Pv62tMKCMY= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given writes: > Failing that, is there any way of making LPEG parse abstract tokens and > not bytes from a string? Hmm, write (usually more or less trivial) lpeg descriptions of your tokens and use them in your grammar? Lpeg does the job of both Yacc and Lex. The details depend on the sort of tokens you have and their grammar, but almost every lpeg parser does something like this, so there are lots and lots of examples around. -Miles -- I'd rather be consing. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 01:49:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A4nc48005499; Sat, 10 Oct 2009 01:49:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56CAD1A6F6; Sat, 10 Oct 2009 01:48:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6BAC185D7 for ; Sat, 10 Oct 2009 01:48:25 -0300 (BRT) Received: by bwz22 with SMTP id 22so6586186bwz.5 for ; Fri, 09 Oct 2009 21:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Eu1rHrpI07RHjJCYBHygVA5YSxTJhXygYK0Wa9rLdck=; b=Ur/rSbhMZyNiZlCh0H6OFzVsJ1iFovUa5H5kF4EyOn8HerS12kU+oxRKrl8CGvctua jg/pRBJ1Cigm2Gi7KaDCeELrDr58HfFNqsTgh0NR2vPRpUm0UmFex+yZxzOnVxQ9Nnq1 tOGZOBZ0PRRjYsJuLgIdBPR57/y6NxttRSUaY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=BmasW4++FJt4qQDgf4fuuJa1Y8+jI51hNW0LkmK6Rh+SvCM4GIy5jG+esKwPXaIVk/ VMZTcmF+V4+tNhnHsR9KcyWrMh39qiVuhzmVEUY6EfoAhk43g7tgHG4CljmwCqfkItLy +Y2y+F4TqTAps6JgNJskCRTJ0iJTp9OTclbPI= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr2829227bkw.154.1255150144168; Fri, 09 Oct 2009 21:49:04 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Oct 2009 23:49:03 -0500 X-Google-Sender-Auth: bc6ef02da618993d Message-ID: <5ba75e2f0910092149w28cfb633qdbedb917b1d26e06@mail.gmail.com> Subject: Re: DigiPen Lua Club From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf7727bb03504758d6ac0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf7727bb03504758d6ac0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable These are really good news! Perhaps I can't be presently, but at least in spirit, all the best wishes for the Club. Blessings! On Fri, Oct 9, 2009 at 9:44 PM, Stuart P.Bentley wro= te: > The recent initiative over the LuaForge outage spawned a wiki page on the > community infrastructure, and one of the items that it mentioned was that > there aren't any regular meetings of the Lua community. Well, this gives = me > an interesting tangent to bring up something I've started recently: Lua > Club! > > I go to DigiPen (http://www.digipen.edu), a school of video game > programming and design. Since Lua is the most used programming language > (other than C/C++) in the games industry, this is a prime topic for a clu= b > (since nearly all of the students have little to no knowledge of Lua, > despite some student teams using it in their game projects). > > So I recently started a Lua Club at Digipen (first official meeting next > Monday). I haven't mapped out a schedule/agenda for the class (in a test > run, only one guy showed up and me and a friend pretty much just explaine= d > the ins and outs of Lua to him over a couple of hours), but I have ordere= d > Lua Programming Gems (which is still on its way- I already have hard copi= es > of Programming in Lua 2nd Edition and the Reference Manual) and created a > poster (sources attached). > > Any presentation ideas / topic suggestions / ways to implement the numero= us > things I couldn't figure out in window.wlua (passing parameters like Copi= es > to the CanvasDraw print job, saving to an image, shink/stretching the can= vas > while keeping aspect ratio) are appreciated! > > (Also, why hasn't anybody implemented the Lua logo as a Lua script using = a > library like CanvasDraw yet?) > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf7727bb03504758d6ac0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable These are really good news! Perhaps I can't be presently, but at least = in spirit, all the best wishes for the Club.

Blessings!

On Fri, Oct 9, 2009 at 9:44 PM, Stuart P.Bentley <stuart@testtrack= 4.com> wrote:
The recent initia= tive over the LuaForge outage spawned a wiki page on the community infrastr= ucture, and one of the items that it mentioned was that there aren't an= y regular meetings of the Lua community. Well, this gives me an interesting= tangent to bring up something I've started recently: Lua Club!

I go to DigiPen (http:= //www.digipen.edu), a school of video game programming and design. Sinc= e Lua is the most used programming language (other than C/C++) in the games= industry, this is a prime topic for a club (since nearly all of the studen= ts have little to no knowledge of Lua, despite some student teams using it = in their game projects).

So I recently started a Lua Club at Digipen (first official meeting next Mo= nday). I haven't mapped out a schedule/agenda for the class (in a test = run, only one guy showed up and me and a friend pretty much just explained = the ins and outs of Lua to him over a couple of hours), but I have ordered = Lua Programming Gems (which is still on its way- I already have hard copies= of Programming in Lua 2nd Edition and the Reference Manual) and created a = poster (sources attached).

Any presentation ideas / topic suggestions / ways to implement the numerous= things I couldn't figure out in window.wlua (passing parameters like C= opies to the CanvasDraw print job, saving to an image, shink/stretching the= canvas while keeping aspect ratio) are appreciated!

(Also, why hasn't anybody implemented the Lua logo as a Lua script usin= g a library like CanvasDraw yet?)



--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf7727bb03504758d6ac0-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 02:02:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A52sVH006920; Sat, 10 Oct 2009 02:02:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A72641A70E; Sat, 10 Oct 2009 02:01:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39C841A68B for ; Sat, 10 Oct 2009 02:01:41 -0300 (BRT) Received: by fxm12 with SMTP id 12so1362566fxm.5 for ; Fri, 09 Oct 2009 22:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=QAhNgrN5JHE/B9+ZUPOP7B6YGH3hRO030Z0bVfE3Isk=; b=azdSOkEepzKRl2wXvZPYj83GrW8Ces65oIh0Bf+cmjSp7KV7Kxm24xnqJ3m2bXgKU3 p1PhVD3eIrijfZXouoy/tadzh3vlvAP/dOCrrBM/8wuoVneQf8bLegMUwPjCGbrflUb0 Zg1PyWpsshHowwTrBZ/nC0udXeuoGf2jZOUdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=f3IFgj+pnsIzM8expm7GCzStQxmoRHmQpx+u+VqTbE9wdxHtSjKnHqkg3/jQiYn1HC azWSso6kvbqvG3dhBpbruJt+WFehGTRQ1qeVZYEnPNiaDiad1i4peBKxzDiMi80QcX9k X5P9Aj2sGwLR8ptPz/mMgcANJQvzYOFjcur4s= MIME-Version: 1.0 Received: by 10.204.156.205 with SMTP id y13mr2862435bkw.116.1255150940407; Fri, 09 Oct 2009 22:02:20 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> From: Hisham Date: Sat, 10 Oct 2009 02:01:59 -0300 Message-ID: <5e7d91620910092201h72cff45ao755b47c9911ba9af@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9A52sVH006920 On Sat, Oct 10, 2009 at 12:35 AM, David Manura wrote: > I've argued [3] for making the > dist.info format a proper subset of the rockspec format, and we've > taken steps in that direction, or at least to permit automatic > translation, but we haven't constrained ourselves to that, and the > format is still in flux.  I'm interested to see where LuaRocks 2.0 is > going with this too. LuaRocks 2.0 is almost ready for release. In fact, I planned to release it during the Lua Workshop, but a few last-minute changes have prevented me from doing so -- my plan is to release it during the weekend. In this particular release, the rockspec format and the remote manifest files will remain the same. The local manifest file and the structure of local rock trees will change, and newly packed rocks will include a rock_manifest file (basically a table of contents). Having said that, there's always room for improving the format in the future to provide better interoperability, add extra metadata that may be interesting for use in a catalog site, etc. -- Hisham From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 02:20:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A5K04X008127; Sat, 10 Oct 2009 02:20:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C8D51A6CC; Sat, 10 Oct 2009 02:18:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D9DE1A688 for ; Sat, 10 Oct 2009 02:18:48 -0300 (BRT) Received: by fxm12 with SMTP id 12so1366859fxm.5 for ; Fri, 09 Oct 2009 22:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=mSpgmmvO9oNiqfERcJFJuZsq0QB5qZIrTNJj/vBx07M=; b=pQJJ3wblaPwubjoGFMtpR0V2n8mbbg0tM8d/etlhdr2GicCXWqR91hOQQee5uSwkZY 38HeRUJnqA7cOTXev1/fRH5j0N35cnY745pNYM8A1sEgXkFhFupI7OK1KE6BGaIWBml8 F/j3ZaDln9tuFB8BR8aWy7jMIa96aJ4oOQd1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=HqTB4BhBUngrTeLvWW631Pk0OBnOGU0rM/q+Pu/8sxJgVN3xzpUteW0J1h0eHJsfZL ecLiLf2A/BLXnI8Hx/Evxb0JOEWFdDIlQ3fz/Q8+aHfkt8mgmvrr2KfiZ7hNoye1ue0R TUZEO0ZYmMOYjdF3e5EPYFp+m4srjg8VJT2sA= MIME-Version: 1.0 Received: by 10.204.25.19 with SMTP id x19mr2852517bkb.189.1255151968174; Fri, 09 Oct 2009 22:19:28 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Date: Sat, 10 Oct 2009 00:19:27 -0500 X-Google-Sender-Auth: 0d057d635491f87c Message-ID: <5ba75e2f0910092219j6e4fe19br699bef0304b045f6@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000325559fce33c1af04758dd7a6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559fce33c1af04758dd7a6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cool, I'm gonna add a request to join the project at the issue queue: http://code.google.com/p/luaforge/issues/entry BlessingS! On Fri, Oct 9, 2009 at 7:25 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > > Who is "we" ? Who does the planning and where can I see this planning >> going >> > on? I want to be part of it. >> >> Most of the initial discussions happened yesterday following the Lua >> Workshop. I'm not sure if all the participants wish to be singled >> out, but it involved two individuals from the Kepler team, myself and >> two other members of the community. The discussion has just begun, >> hence why I am requesting people contact me to be involved. > > > Lol, looks like a secret society with a secret project. Is there a proble= m > on announcing the luaforge google group on this list? For instance, I > already took the liberty of creating a project myself here > http://code.google.com/p/luaforge/ which lists some incredibly close goal= s > to what I just read on that google group :) > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000325559fce33c1af04758dd7a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cool, I'm gonna add a request to join the project at the issue queue:http://code.go= ogle.com/p/luaforge/issues/entry

BlessingS!

On Fri, Oct 9, 2009 at 7:25 PM, Cosmin Apreutesei <cosmin.apreutesei@gmail.com= > wrote:
> Who is "we" ? Who does the plann= ing and where can I see this planning going
> on? I want to be part of it.

Most of the initial discussions happened yesterday following the Lua
Workshop. =C2=A0I'm not sure if all the participants wish to be singled=
out, but it involved two individuals from the Kepler team, myself and
two other members of the community. =C2=A0The discussion has just begun, hence why I am requesting people contact me to be involved.

Lol, looks like a secret society with a secret proje= ct. Is there a problem on announcing the luaforge google group on this list= ? For instance, I already took the liberty of creating a project myself her= e=C2=A0htt= p://code.google.com/p/luaforge/=C2=A0which lists some incredibly close = goals to what I just read on that google group :)




--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000325559fce33c1af04758dd7a6-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 02:30:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A5UDKA008875; Sat, 10 Oct 2009 02:30:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F5261A682; Sat, 10 Oct 2009 02:29:08 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9AFAA18846 for ; Sat, 10 Oct 2009 02:28:58 -0300 (BRT) Received: by bwz22 with SMTP id 22so6594402bwz.5 for ; Fri, 09 Oct 2009 22:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=SAMRWshu0ni0G5CvTyxWPPeMfwFXLA/nFf4i2p4lemM=; b=koYKYW7m/vAtQJxkv1PPWsFQRm8ggA6jZEWIKcjRMdkg6ZPGdUpUvttIYb3NGSWnAe kcO+FZxERX28Fl2BLaQgMm5VnrJf/A/+G9a/pbzQ78//9uW9woEqtApxUNZJ8NeqiZFS euuE7CShy4j3TAnyBfeGPl6mhqBBOAMvrvwE8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Nf3YEqLR1XNS3qdrqrUN05yllo73ZC9UfqXVbQpi5IoLLUJHi0pytZOglvRZoM+CBL Um2rWt0RhDyj6zan2YCkHxTfr0lLTFW1Nx4Ipk8RMVlvZUhfgKEv9fedqL0rkVL5jVrg WqbV4++sm2AVTsepSjgx6E8UtR/I+pnq5NoOI= MIME-Version: 1.0 Received: by 10.204.24.65 with SMTP id u1mr2588605bkb.176.1255152577756; Fri, 09 Oct 2009 22:29:37 -0700 (PDT) In-Reply-To: <5ba75e2f0910092219j6e4fe19br699bef0304b045f6@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5ba75e2f0910092219j6e4fe19br699bef0304b045f6@mail.gmail.com> Date: Sat, 10 Oct 2009 00:29:37 -0500 X-Google-Sender-Auth: 4d31f923b6ab8d40 Message-ID: <5ba75e2f0910092229h13316d75s7b4b350bf35a6114@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0003255566128948de04758dfb86 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255566128948de04758dfb86 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable All this feedback is awesome, perhaps we might move this discussion to the new project page(http://code.google.com/p/luaforge), there is an interface for comments and a nice wiki, so the flow of data can rapidly transformed to information and then into a plan with consensus. Blessings! 2009/10/10 Fernando P. Garc=C3=ADa > Cool, I'm gonna add a request to join the project at the issue queue: > http://code.google.com/p/luaforge/issues/entry > > BlessingS! > > > On Fri, Oct 9, 2009 at 7:25 PM, Cosmin Apreutesei < > cosmin.apreutesei@gmail.com> wrote: > >> > Who is "we" ? Who does the planning and where can I see this planning >>> going >>> > on? I want to be part of it. >>> >>> Most of the initial discussions happened yesterday following the Lua >>> Workshop. I'm not sure if all the participants wish to be singled >>> out, but it involved two individuals from the Kepler team, myself and >>> two other members of the community. The discussion has just begun, >>> hence why I am requesting people contact me to be involved. >> >> >> Lol, looks like a secret society with a secret project. Is there a probl= em >> on announcing the luaforge google group on this list? For instance, I >> already took the liberty of creating a project myself here >> http://code.google.com/p/luaforge/ which lists some incredibly close >> goals to what I just read on that google group :) >> >> > > > -- > Fernando P. Garc=C3=ADa, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de t=C3=AD. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0003255566128948de04758dfb86 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable All this feedback is awesome, perhaps we might move this discussion to the = new project page(http://code.google.com/p/luaforge), there is an inte= rface for comments and a nice wiki, so the flow of data can rapidly transfo= rmed to information and then into a plan with consensus.

Blessings!

2009/10/10 Fernando P. Gar= c=C3=ADa <fer= nando@develcuy.com>
Cool, I'm gonna add a request to join the project at the issue queue:http://code.google.com/p/luaforge/issues/entry

BlessingS!


On Fri, Oct 9, 2009 at 7:25 PM, Cosmin Apreutesei <cosmin.apreut= esei@gmail.com> wrote:
> Who is "we" ? Who does the planning and where= can I see this planning going
> on? I want to be part of it.

Most of the initial discussions happened yesterday following the Lua
Workshop. =C2=A0I'm not sure if all the participants wish to be singled=
out, but it involved two individuals from the Kepler team, myself and
two other members of the community. =C2=A0The discussion has just begun, hence why I am requesting people contact me to be involved.

Lol, looks like a secret society with a secret proje= ct. Is there a problem on announcing the luaforge google group on this list= ? For instance, I already took the liberty of creating a project myself her= e=C2=A0htt= p://code.google.com/p/luaforge/=C2=A0which lists some incredibly close = goals to what I just read on that google group :)




--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Anali= sta de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.



--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0003255566128948de04758dfb86-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 02:45:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A5jfKP009839; Sat, 10 Oct 2009 02:45:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAC251A694; Sat, 10 Oct 2009 02:44:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C1DE18994 for ; Sat, 10 Oct 2009 02:44:27 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0M6BzW-1M4E903nLO-00yMYP; Sat, 10 Oct 2009 01:45:07 -0400 Message-ID: <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> In-Reply-To: <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> Subject: Re: Lua Recipes Site? Date: Fri, 9 Oct 2009 22:44:46 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19nVPio5PibOKMGJtbdrH8Uvc91TYVTnI06jSR pVTyNTGmwmDY3II4jg0ET/poJKfG9/JytTlrXeL2JuZeG/1keC +gqI5DOGDFEnVJqwLv1bo6u7TTMdc91 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yeah, a lot of guys are definitely over-thinking this (I haven't read all of the previous comments in the thread yet, but judging from what I've seen). The model for a Lua Recipes site isn't Github or LuaRocks; it's Pastebin / Bitbucket. The way I would layout the main page would be a big search bar at the top (for finding existing recipes) and an empty form at the bottom (for pasting into). If you're looking for a recipe for something, you can enter your query and, if matching a tag, it would present all recipes with that tag, where otherwise it would search descriptions, code comments, and recipe response comments. If you're looking to submit a recipe, you can write/paste it in the large multiline text form at the bottom (or maybe upload a file). You can hit submit and save it (which will also then compile and save its output/errors, if any, to be shown on the page after the code. If the code included an io.read or io.open or require of a module not present in the compilation/demo sandbox, it would simply skip this step altogether). After it's saved and you are taken to the recipe's page, you would be prompted to edit the page and add a title/description (A description that recognizes "titles" as a line (not ending with a full stop) followed by 2 newlines, for the rare situation that a recipe needs a title to summarize its description) and tags (when adding tags, there'd be a Javascript pop-up telling you what tags already exist, and the site administrator could manually lay out a logical tag progression ("os"-> "files" -> "file-read" -> "XML-Parsing") and synonyms (like "file" and "files", as addressed above).) Scripts lacking tags (or descriptions) would be featured in a "Help! Tag these recipes:" sidebar. As stated, comments are a must, and they should be visible while editing so you can copy+paste code suggested in comments. As for making it so that "only the original contributor can edit", I'd say we leave this one more to etiquette (and track IPs/include a "nuke edits from this IP and ban" admin button to handle outright vandalism). Include an "Author" field on the edit page for the contributor credit that's tracked with the code, description, and tag history. I can make an IUP window / SVG image mockup of this design. For simplicity's sake, we should just do what Wikipedia does and say that anything submitted to the site must be licensed under a specific license (most likely MIT). There's no reason to force people into anything else (except public domain): there's not really any danger of anybody getting rich off the hard labor put into a 20-line Lua recipe because it wasn't GPLv3 licensed. If you want to come up with an architecture that lets you manage a module like a project on Github, I'll do you one better: make a project for a module on Github. -------------------------------------------------- From: "steve donovan" Sent: Sunday, September 20, 2009 A8:09 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > On Sun, Sep 20, 2009 at 4:37 PM, George Petsagourakis > wrote: >> I would like to throw http://github.com in the conversation. It can >> provide a >> good way to manage code in a so distributed environment we are talking >> about >> (much non coherent code, many users, etc). > > Gosh, this is getting complicated. I like Web+copy/paste myself. OK, > I'll obviously have to get Git at some point in my life, but remember > that the main issue is not how to store the recipes, but how to tag > them and search them intelligently, by a combination of > classification, tags and keyword search. > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 03:21:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A6LSn7012019; Sat, 10 Oct 2009 03:21:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CEE01A68A; Sat, 10 Oct 2009 03:20:22 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87AD9191E8 for ; Sat, 10 Oct 2009 03:20:15 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1641849eye.39 for ; Fri, 09 Oct 2009 23:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=FfSH+laoLIq/X5sHkrLchSRhHtJd3G+hML5tHAb24QI=; b=EnIE1rXKC1lar8g8GTygYnOx07SjQe/tm9T5qpVwSrGp5DXVS2+vKE8rQfrhU6IppW p4UbY1yfMMWlrOj5GYGExHHrJeB6yuhLv7Uuc2HWeZ+BGeSWkfdIiHR36fpwYx9sF901 qs2BZz5w1chI4mQ4XKlLcZEYkOOaCzo+KylhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=fh6lJK7pbOpJIEiy2MmJZTRBfTyOMtJSeWd9TwVAd/tSJYSq7XF6UCtViZsz7KEBDk jMn/LsFBvTdMqkRTDT+AgI5hya6PWH7Wr9OxULuCl+0OODUfioMNDMCzqOOqzLQEynPC waElX8TCchmx8wy8hLnlwV83E2Qxa6+yosfJ0= Received: by 10.211.173.6 with SMTP id a6mr4309826ebp.13.1255155655610; Fri, 09 Oct 2009 23:20:55 -0700 (PDT) Received: from ?95.78.81.194? ([95.78.81.194]) by mx.google.com with ESMTPS id 5sm2402703eyh.8.2009.10.09.23.20.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Oct 2009 23:20:54 -0700 (PDT) Date: Sat, 10 Oct 2009 10:20:42 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <241050529.20091010102042@gmail.com> To: David Given Subject: Re: Lua parser generator? In-Reply-To: <4AD004D8.2010605@cowlark.com> References: <4AD004D8.2010605@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello David, Saturday, October 10, 2009, 7:51:52 AM, you wrote: > I'm looking for a Bison or Yacc-like tool that will generate a parser > from a BNF or EBNF grammar. Does anyone know of such a thing? metalua contains lua parser written using lua library gg. it's a parser combinators library, i.e. it extends idea of yacc grammar files making them regular lua programs -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 04:08:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A78Y0o016386; Sat, 10 Oct 2009 04:08:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DFBF1A683; Sat, 10 Oct 2009 04:07:26 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69DC71A668 for ; Sat, 10 Oct 2009 04:07:15 -0300 (BRT) Received: by bwz22 with SMTP id 22so6614725bwz.5 for ; Sat, 10 Oct 2009 00:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+9ajq33Y5jNPutugakme5oGE9PLxiKPg4k//qH5Gxn0=; b=XAPK7j50RAssHgP4PAn9R/DN189MU/DUhQDISF0zsYM1BWr4U7r1MMCSxkCg9dh87y vpfnFcr1uNp3cj81l4X4BWiv1faziBX/98ncvxtpLGwwLlUM1Q2HOB3O9yIYiTMn3ZAx LwQjTusHHWEq71178Bi4Z4SDsMXTH2KJpm+sI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mmaA7csJw5SvNQdV/LFi+Xd0rHzG11miM4Hy6hvOiR17oNby8IJlKHAyzsvuD1HVPs SJoFnNbc8OX2oPnOP49pCHOf/0EHQ7x8kEAl8r2obV7Cc4H0D+SQ4qcqePD5rNrQNB78 MW+qxwTEkuOUzTJknF/6TFXjEsjeXQqtHn+n4= MIME-Version: 1.0 Received: by 10.239.182.208 with SMTP id r16mr199580hbg.203.1255158473710; Sat, 10 Oct 2009 00:07:53 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 09:07:53 +0200 Message-ID: <560972290910100007q4e3df58pc00129dc350141e7@mail.gmail.com> Subject: Re: DigiPen Lua Club From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley wrote: > there aren't any regular meetings of the Lua community. Well, this gives me > an interesting tangent to bring up something I've started recently: Lua > Club! Ah, you're lucky in that there's actually a physical gang of people involved. AFAIK, there are two people doing Lua in South Africa, which is myself and Jasper Cooke. (I would love to be corrected on this) And we are 1500 kilometres apart ;) steve d. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 04:28:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A7SpOf017964; Sat, 10 Oct 2009 04:28:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46988189F4; Sat, 10 Oct 2009 04:27:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5C921863A for ; Sat, 10 Oct 2009 04:27:41 -0300 (BRT) Received: by fxm12 with SMTP id 12so1403826fxm.5 for ; Sat, 10 Oct 2009 00:28:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.11.3 with SMTP id r3mr2989673bkr.107.1255159701078; Sat, 10 Oct 2009 00:28:21 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 09:28:21 +0200 X-Google-Sender-Auth: 061189e1996bab7c Message-ID: Subject: Re: LuaForge-NG From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 4:18 AM, Stuart P.Bentley wrote: > What are the current developments in the "developing the next generation of > LuaForge" private e-mail loop thread? > > (Ulterior motive: I'm posting this to open the discussion on this topic in a > new thread, because I read the list in a newsreader and the "LuaForge is > down and will be for some time" thread has gone so deep that the titles now > start past the edge of the screen.) I think I will try to work on a very lightweight site where Lua developers can upload tarballs of their libraries and users can browse the libraries in different categories and download them. If I can, I will also make a web form to help create luarocks.spec files so that libraries can be installed with LuaRocks. A bit like Pypi, but probably not as complex on the metadata/specs side. I will use sqlite for the database, this way the whole site could be rsynced easily. I will probably develop the site with PHP and Lua together. That is of course if nobody else is interested in working on such a site and if I can find the time to do it given that I am also very busy on client projects. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 04:40:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A7emHF018889; Sat, 10 Oct 2009 04:40:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 624A91A6A9; Sat, 10 Oct 2009 04:39:45 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B45571A677 for ; Sat, 10 Oct 2009 04:39:32 -0300 (BRT) Received: by ewy26 with SMTP id 26so8129128ewy.5 for ; Sat, 10 Oct 2009 00:40:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.159.3 with SMTP id l3mr1369974ebo.37.1255160412236; Sat, 10 Oct 2009 00:40:12 -0700 (PDT) Date: Sat, 10 Oct 2009 09:40:12 +0200 X-Google-Sender-Auth: b40c1ba5aa70214e Message-ID: Subject: problems with LuaForge From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9A7emHF018889 The recovery seems not complete. In my page (fperrad), one of my 3 projects (testlongstring, lua-TestLongString) is missing. When I try to release a file, I obtain the following error : File cannot be moved to the permanent location: /var/lib/gforge/download//testmore/testmore/lua-TestMore-0.1.0/lua-testmore-0.1.0.tar.gz I cannot login by ftp on testmore.luaforge.net, lua-coat.luaforge.net, ... François. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 04:54:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A7sr5S019834; Sat, 10 Oct 2009 04:54:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFAB71A668; Sat, 10 Oct 2009 04:53:56 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (unknown [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B29B618AE7 for ; Sat, 10 Oct 2009 04:53:46 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MwWmX-0004WX-Gb for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 08:54:25 +0100 Received: from [192.168.2.92] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id DE6043F02E for ; Sat, 10 Oct 2009 08:54:21 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:50169 with envelope Message-ID: <4AD03DA7.2050907@cowlark.com> Date: Sat, 10 Oct 2009 08:54:15 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua parser generator? References: <4AD004D8.2010605@cowlark.com> <4AD00CAC.9090607@gmail.com> In-Reply-To: <4AD00CAC.9090607@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9A7sr5S019834 KHMan wrote: [...] > LuaYacc -- Yet another yacc clone That looks great! Now I just need to figure out where to get it, given that LuaForge is down... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 05:22:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A8MsKW021780; Sat, 10 Oct 2009 05:22:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF07F1A69B; Sat, 10 Oct 2009 05:21:48 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D87B1A671 for ; Sat, 10 Oct 2009 05:21:41 -0300 (BRT) Received: by bwz22 with SMTP id 22so6632459bwz.5 for ; Sat, 10 Oct 2009 01:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YMga31LP+FoRr4ph735gyaYk6yJFslp7/v3L974JyFQ=; b=JHkCN0igRhzjKiHN02HJ4c1geFvb8MM3PPbcioPQ/fklIteNCaUvlOda+GowLNuary dE5DXRrNhu/+QubUtBy/jEn3grfJi7WDlkyJ/SF5Np2NTnRF4RmoouP+tjQdwLfWpnKe OK9BcJu5pNpJ4/UbqP80Ei3A+uH1s/8JlJMIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rZX2udt64yI0kHuRYhqLNBqQ759mx8FL359ZaHga3KmVh5Ub0lykSCyGNLFWHfgLPy xwQRVEFQ+pFkNEwuVyaAqg4QHyZ6IxE3h68atV8T+gOPFwxAxheNtXsIYxkJ0BX9l3/l SAo3N+1YEBCytcNuX9cIoprLS1IB7SBRkIhzw= MIME-Version: 1.0 Received: by 10.239.139.76 with SMTP id s12mr194510hbs.78.1255162940607; Sat, 10 Oct 2009 01:22:20 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 10:22:20 +0200 Message-ID: <560972290910100122k3d69ba94u825a40ca519a9cc@mail.gmail.com> Subject: Re: LuaForge-NG From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 9:28 AM, Bertrand Mansion wrote: > That is of course if nobody else is interested in working on such a > site and if I can find the time to do it given that I am also very > busy on client projects. There is a ball rolling already at http://groups.google.com/group/luaforge-development, but you will have to ask Jim for an invite. I would agree that simple is best, providing that 'simple' is also extendable. We all agree that GForge is a bastard, both for users and its poor maintainers. I would like to thank Andre for getting the bastard in shape for us! steve d. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 05:23:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A8Nirt021928; Sat, 10 Oct 2009 05:23:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FE171A6B8; Sat, 10 Oct 2009 05:22:44 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1EB31A69E for ; Sat, 10 Oct 2009 05:22:36 -0300 (BRT) Received: by ewy26 with SMTP id 26so8143470ewy.5 for ; Sat, 10 Oct 2009 01:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ir1IgyaZ2H7wQ/c+dEYLu0vHYx+ebFnScXGzvVdnvt8=; b=k7bxJHj6lKEg7evWBOe78P5Lff1c796ggfe3/kNwBSMiv4PUq3hjISInGqLfu1SiFc 5ux6iMW7KJs5zuEGmH3dV+sDbKtC5MqYefhtaIzAPIR0v2MDF0Ej61yHGN7Hpxa4DdoX xAajNVE6ozDDqRbYoicvx9uQw9yR39RyAmu5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CNIgD8rX5es0Pdbsk49qZoVg2nCi0PPz/bMaWQti1BmvTt5vfl2WLPyF8lnFRX6zwx 4kcijYc93Qac3UYLNCr6ZKi1e2jiN92qY4GBRvay8oTNH171/lGesls/W1zeyHGfqe9o 6uiDxhoCM6lXLbP/Jg1XHxQhV4hdvGU9yAiiE= MIME-Version: 1.0 Received: by 10.216.87.71 with SMTP id x49mr1158691wee.11.1255162996374; Sat, 10 Oct 2009 01:23:16 -0700 (PDT) In-Reply-To: <560972290910100007q4e3df58pc00129dc350141e7@mail.gmail.com> References: <560972290910100007q4e3df58pc00129dc350141e7@mail.gmail.com> Date: Sat, 10 Oct 2009 11:23:16 +0300 Message-ID: <317b42db0910100123r2cb2342i8526934d98c9b81@mail.gmail.com> Subject: Re: DigiPen Lua Club From: =?ISO-8859-1?Q?Joseph_Saad=E9?= To: Lua list Content-Type: multipart/alternative; boundary=0016e6d63f8a88c28e04759068f0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d63f8a88c28e04759068f0 Content-Type: text/plain; charset=ISO-8859-1 Hey stuart, You then be happy to know that ProjectFun 2.0 relies on lua for faster compile time where all the engine properties are scripted. I was resposable for porting/modding the engine to add lua support and now you can fully develop 2D games using it :) So I guess being @ Digipen you got access to the Engine/Editor for free so it would be nice to talk about it or study the lua implementation in the Lua Club. Too bad I am not with digipen atm so I can't really be that helpful, else I would have been glad to do some speeches about it and how it reduced the overall engine compile time :) Regards. On Sat, Oct 10, 2009 at 10:07 AM, steve donovan wrote: > On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley > wrote: > > there aren't any regular meetings of the Lua community. Well, this gives > me > > an interesting tangent to bring up something I've started recently: Lua > > Club! > > Ah, you're lucky in that there's actually a physical gang of people > involved. AFAIK, there are two people doing Lua in South Africa, which > is myself and Jasper Cooke. (I would love to be corrected on this) > > And we are 1500 kilometres apart ;) > > steve d. > --0016e6d63f8a88c28e04759068f0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hey stuart,
You then be happy to know that ProjectFun 2= .0 relies on lua for faster compile time where all the engine properties ar= e scripted. I was resposable for porting/modding the engine to add lua supp= ort and now you can fully develop 2D games using it :) So I guess being @ D= igipen you got access
to the Engine/Editor for free so it would be nice to talk about it or study= the lua implementation in the Lua Club. Too bad I am not with digipen atm = so I can't really be that helpful, else I would have been glad to do so= me speeches about it and how it reduced the overall engine compile time :)<= br> Regards.

On Sat, Oct 10, 2009 at 10:07 AM= , steve donovan <steve.j.donovan@gmail.com> wrote:
On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley <stuart@testtrack4.com> wrote:<= br> > there aren't any regular meetings of the Lua community. Well, this= gives me
> an interesting tangent to bring up something I've started recently= : Lua
> Club!

Ah, you're lucky in that there's actually a physical gang of = people
involved. AFAIK, there are two people doing Lua in South Africa, which
is myself and Jasper Cooke. =A0(I would love to be corrected on this)

And we are 1500 kilometres apart ;)

steve d.

--0016e6d63f8a88c28e04759068f0-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 05:27:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A8RspJ022670; Sat, 10 Oct 2009 05:27:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAA1818CA1; Sat, 10 Oct 2009 05:26:53 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE8B518994 for ; Sat, 10 Oct 2009 05:26:45 -0300 (BRT) Received: by bwz22 with SMTP id 22so6633761bwz.5 for ; Sat, 10 Oct 2009 01:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0J485nNK48sYukkeG1XbJEzkYfuUUkrjwwfq2+uz0hI=; b=Dpl1x3ZoIRSNoNop+NUt9Mxdf+hD/KGEENr+Y5MnnojOXo8icpFOxqY37/apC1EG+D 7OFeiexYpDLEO6UO/LVY4wZKTsp2o0OVdoD0bvAHdck2p1AICLPCKb65cIQ5O26Giw0q LJCOhUe52gNH59R1gPDrGpzS9PvVEtYJ46H6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TE5vG/jwf773Zd0uDAnyhQlHg0tVV3dladf7xKwkzVY8pzViIUgpk2GI5/pQ8Mt9o8 T8ewyVo8kf+GpisZ3ZbSd+n7AAyjX9JwSrhO5n1hkPphomi92p0Atdoh1BfhFG+HpvbO oaIRMM3+TednKf6pT6TASMmUITZRE6rLwY9OQ= MIME-Version: 1.0 Received: by 10.239.181.148 with SMTP id m20mr214101hbg.186.1255163245915; Sat, 10 Oct 2009 01:27:25 -0700 (PDT) In-Reply-To: <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> Date: Sat, 10 Oct 2009 10:27:25 +0200 Message-ID: <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley wrote: > Yeah, a lot of guys are definitely over-thinking this (I haven't read all of > the previous comments in the thread yet, but judging from what I've seen). > The model for a Lua Recipes site isn't Github or LuaRocks; it's Pastebin / > Bitbucket. This is totally true. But development hasn't died, it's just gone underground (or underwater). In fact what Yuri, Jim and myself are envisaging is similar to exactly what you are suggesting. However, we did decide to let license information be explicit - it defaults to MIT/X11. steve d. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 06:10:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A9ABDc025784; Sat, 10 Oct 2009 06:10:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E90D1A6C7; Sat, 10 Oct 2009 06:09:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9060D1A697 for ; Sat, 10 Oct 2009 06:08:57 -0300 (BRT) Received: from [93.173.165.179] by mxout2.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KRA004EVK3Z4700@mxout2.netvision.net.il> for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 11:09:36 +0200 (IST) Date: Sat, 10 Oct 2009 11:09:34 +0200 From: Shmuel Zeigerman Subject: Re: LuaForge is down and will be for some time In-reply-to: To: Lua list Message-id: <4AD04F4E.1050300@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stuart P. Bentley wrote: > Now that it's back up, how recent are these backups? I ask because I > notice that Lua For Windows only lists the latest version as 5.1.4-29. It seems that all data since approximately 2009-09-14 is missing. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 06:39:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A9dYA2028433; Sat, 10 Oct 2009 06:39:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 776531A6C4; Sat, 10 Oct 2009 06:38:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F3A71A684 for ; Sat, 10 Oct 2009 06:37:56 -0300 (BRT) Received: by qw-out-2122.google.com with SMTP id 9so77157qwb.11 for ; Sat, 10 Oct 2009 02:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=dq8lEt6OThi2J0eyaSALbUI0td/gZkN9N4BfoHzfRHY=; b=kU/aL5w+m5IYt9aWhbRkP+3rDQxREHT1PJsTJkHhGw23bOQtAmKPTBslj4gwL0k25l 4cRaOQxoc8qtGu/OtW5X+m+BIu/NTLZolYvtr2ENAJU9XcFQNP+MRNnNAb4IkdNGUrrm VTCj/Ot3lFwxV1sgd2SQ4ZNcTq8Qko4TBOecU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=w1ovqRF19cTGTQkRzeiYKwqGg5ac0hwIM+AD4AWAf4o+VjSi9Vgq4VpeZZlFCu4H3o b7kzCzSfTZCVjAA1Wjrj+lezlsC9Wfv2/ljPfJB/FwBerM7Qdkj9JhTB270mR+G+573k AQnpHbQBABDQl+JyC+F7ZevVcxzGs2zrxJ3jA= Received: by 10.224.78.219 with SMTP id m27mr3463481qak.181.1255167517159; Sat, 10 Oct 2009 02:38:37 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 21sm515603qyk.0.2009.10.10.02.38.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Oct 2009 02:38:36 -0700 (PDT) Message-ID: <4AD0560F.8040908@gmail.com> Date: Sat, 10 Oct 2009 17:38:23 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Lua parser generator? References: <4AD004D8.2010605@cowlark.com> <4AD00CAC.9090607@gmail.com> <4AD03DA7.2050907@cowlark.com> In-Reply-To: <4AD03DA7.2050907@cowlark.com> Content-Type: multipart/mixed; boundary="------------090805030206030002060900" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------090805030206030002060900 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit David Given wrote: > KHMan wrote: > [...] >> LuaYacc -- Yet another yacc clone > > That looks great! > > Now I just need to figure out where to get it, given that LuaForge is > down... IIRC it's only one file on LuaForge, it's there [1], but I failed to download the thing. Attached. [1] http://luaforge.net/projects/luayacc/ -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia --------------090805030206030002060900 Content-Type: application/x-zip; name="LuaYacc.zip" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="LuaYacc.zip" UEsDBBQAAAAIAKMFJTUQ1tnxPicAAI2aAAALAAAATHVhWWFjYy5sdWG8GWlPIzf0M/kVT6NK JOqQEnqpB23pjbTdRcCqWu0i5Mw4iWGOrO0E0or+9r4jjieZZBeqthJkxs/vvnzMwUHn4ACe zdQrlWWAr6+0B1XVfqItLAiWFXWlCUnBs5PzZ3CmrMO5X3SlrfK1hVFtiUFHWP1QTxfWjCce ulkPjg4PP8NJ4+CnPvyibGYUvKg8Cqjg6wLh/VpG341LZYp+VpffLBldTpCqMEOr7ALwdWS1 BleP/J2y+itY1DPIVAVW58Z5a4Yzr8GQ7vlHtSUGZZ2b0YJgsypHjdEk8NqWDuoRD355/nJp RgFns2FhMnhmMl05DcoRhykB3UTnMFwwxc+kw4XogKMaGStv6uor0IY9NtfW4RiO+gNiIIIC 1xTQU13lSXcL9ZQoe6jwAgrlI3G/6YCprcdWleSAaGcOpmLGk3qq8UV5svLOFAUMNcycHs2K lFggMvx+evnri5eXcPL8Ffx+cn5+8vzy1VeI7Cc1zuq5FlamnBYGOaNlVlV+gboTh99+Ov/h VyQ5+f702enlK7Lg59PL5z9dXMDPL87hBM5Ozi9Pf3iJqQFnL8/PXlxgoOFCk1qcNbudzIlT 1lZDrj0G3wXDX2FoHWpX5DBRcw1WZ9rMUTcFGWbXe8Mn2YppO2YzwTcc+RWYEWB6p3BnjUct 61ZgmTzGNoXTKuun8OkXcKnRSRrOCpVpOICLGXH4+OPDFL6vnSfU304ADo8Gg8HB4OPDz1N4 eXHCVkk8UZwaIoMxac3MUc1xbVHJ0omtQ03xULf4O7J1CV8S5cmkTtGnaAdyLIpSVX2ss3Jq Cm0dnFlTZQYVcylqmE0q83amHRUCXNZ14aB7evH9czg8ODpEtQ4HX3xy8HlPSrUsdeVdyKas zrV4zOqRtrrK2D9TNdZQzcohCqP4O52R6k6wCMP4vlj44scXHQB8o04hb6byesxoaBPqoiyn xgLuausn3/YES4oBkYJvNCTqoFCJ9KAp9xyHuEDolOI5FOZWL2e6lb731yziejSrWL8eY4sK zmuVU95M4TiQ9L6CaRdJ0rkqwvsRDY5w1O+LRReL8sJb6X5uUQ7rAs1H96JrCPgnuEEK7gj/ P06J6KGzV3ohQkl/Nob962uDbegewQHEEp7ZQzBel8LOzgqdQl77ae2AqXFeOMl7gw2Pmcc5 UjE9qpjiv/M2rbEJX5v8Pp1i+TA1YTGrMFjjxTy4YLFKSmWjPo6ILNpp0U67tDPlVkozr5OT 5ApfEOF18r28BpwqIqmINGwi8a+YKpLFcXHc9FyABdcNWMum00QvJsdpYSXvG54bSHy1XwZX e8hoLTKVwb4x4yIiiPOq8hwhl3LHupuYbAK3eoGMfI2uRvwups1MU1ERI9fgxIWlC82FJsVl cnw3mSoiuemtundyfa3fJpw32ov+rCk26+kMWSgQGuFVzBSXLWnGosaGGno9vMEi7YRSQEGI 2J2nptfZK2oWTdovpro7lzoRaEngsfal9opaFU0HCkqDBBXr7JkRGDg+hsoUJLPq7O2Z5aSu 8g4jkAAEia5JQCMeDjDe+8k+PWS6P3azIWqHwHT/zZtkv7dEQX6F02ZEev3F8qirid6lx4Cy XT2WFGxty4qYZE1gKfqxkVvUe1OxfoYHf+JIbBRA8sYnOCaXc/eg/jlVxjrkj2mIUytOkYAe r+lXNLntEeAq4eljfsgE8kvB9BievqlQEDu1xfIhEVOaMwkwo5iVxCYBiQtFzmo/sxW4Dscp 5gcnWyiQrtO+F3G1Z+w2cqXvtuAHtK5L0TkI37PqDjEIiyGszHYFTOW0ZUwuJTRCO1oTBI6x 5zrEoa9lUb/VehqKjCrY1dbrPAVVFPWd46KwuqznOg1ZPEFfoULjpULJJIklsTHlcaptFpsk BLeNDiDwWCmT17dXK8C0JtAhcqPScJzLsXZWIpSEU2pojzgg1byzTDWT3sRE85JoxC+qcNOD r+F2xXZvaLW6xTfiSA9Rg34/hMFS0CYUAVwTIRY+xRmOWlDT25kOMWynhZpOEbwKYYYqeO2k waL60j05jAi0GiM49WH/Udtc2+XmQOMc89K5zrn/VZnmdZ9Rwy4hl357V1f7HiqdaeeUxU66 iK30X4u82RF50478P4q02eJ882jHS56vHC9DByosBrydDIXyf1RDMIw98PgknlM7b+Z0cF7w jVgWfBO8E9JcfqPT5rs9NlHuOpuoaqxjvgqVY1+DGa0aC+LCEhecwVTkmUI5D96Umo9fhIKN R+fBhTR9TdPXlO/SAnZ7t+3c6NuGqkgo6RPmspm1uvIrGeIl5FyhgyUR13AoKVuqBR+vC2I3 RJe27FnnG73e1He3/yXJr52OHV9Abn3TVI9WFxKIF7t/8KUQwXF7EWm7lNlcy5wkJKXjCtoN GSlMpLQlreJyuNuiQlftTJqEwxMaEo0yVcitJ6XEfewH64HerdT1Ne6uWmqtH6WLiWPf3qEf dFNJnokHU6m9vK1XkdqYrbTFLvrEv1tEqNDi1P2yhDvNENiV62Wy6fpo8n00c4ud5axoZJLX dnlSZSvval4q3tX5HmEWCgplGTOPTJLXzlabBPRHuoitbyIzG73PrPe+P2LvW89IcYw8dntp WzZwVN6ZDEYyoXv3UbwFoE1YqyZpTIdMU6EniOOTe5vAyKfvTODlYcq9t0kHxLBR3Hnc6pH+ 8bTEh7cnab972XvCbo2DLds1aCzxEIP6jppWeWvRap1iY8gkYkPsc1wEO219XBG4kEfvqITo h3nbDyGZ56HGtyEvFbOsVovwfWnf9hitzS2XcabEe+yQSunyBX2Zg7JjMORdGhniyZdyAAfx MN64e0UChyZ4ZFulUFfFIpZNqXw2aeKLHjqPDIPeKxTZU0guh4DS/axypNmMg6uqvFmfLfZU JcavFc7TcuA+JeN7EAPOu5kwqlr7jjCTrS4amIEEzIwQvvXUzqdsPpxs7RhMauAbqJplIxXD JFOtPL4KIkns+tfmqtFHwzH+QxES5SDeweBKYMyvjTurvClEfKP5Fk5HeyQd/n1rxJlz5Eb2 BAvD/QmnVbfRhSRa4fTx3xq/0zph8OEgWvo16hO0iVRiUZT8mP4n9zlczk9LZCfHBiH3PNgt JHj0vXLCpkKrPKWVZ/Xi9JSf9H0jpR++HZOCGJW+t+US6hFM6AxQ0gEm5aeZLJ9u+fTy9Equ iB7NNMGbriSl66p9eqQy2mdQ9YCjeMHHtjYvARkQeFAOMxZJaGFGoIiK2KJXC5lhrE/EDbq3 kIMtDb4tPAEEqxivnSprx3o2L176tde0eAsXzGtfxUX96F0Ma97vrd2HujSgEHbyQZImSdw1 iSjitXXVI076LS/dwbCoS7G+zbQ9IW7SFp5pYSvx1y3adumg8B4IrehCTm6jFT6isVhYZ4dY VKUVpTSlO6U6pTmNvYp303JV7o//fEgn+EP5z5CJwl8hxBehhmNhQQjCh1evB7xoX4Z3FMNL ioYQoxS50BhxQ9gL1eDWmgUcb+0fKWFRyTc6wLb6f9+hNk0unHNJ2Gjubd9gBQnkua334/FI wTiYn+jM2NDjRmtLR0bDXeMbAWu1/c44BlIrWqFS2QSs7SF2byFkwmfNHURwX0ZG7WNB7wd7 2uW7sYa116BAxP1cMq1lLzokygvM3y0U7zgLHURRPDYUCTGuEdaU3GnuW+pee6WswzK5W8m4 B/nPVNy98ahl4/FEzend2tp2k5tZdQvKcbKwF5Lm8hy/pPJeHo4Zr5FjESFWnnwNbX3EojrH KTCSmQGNXRE7OULp0f6CstGoE+DuvNkLRZsuft/sxZpXdvx6cLWt8APrWFoBOw2W9VYew4l+ JXeru0kj3Y57E/mgHHu7PVzzFI5ROv6JF778EnWGgJBPlxhHVwFU6I0qFgaIgWzF6eZ4kBKe eNqMmA3l3QEMgiOaH7T64QNY+zPXijnvHyU+kSPKEH4tdlu+hbWdIsfFOq0kdNXG906ycyCs Vim+VKbGnw+rK2EbuBVeVvfCr0D6rYD025b0fDZF0Tci+mZDNI7hUEQHt/Mnc5KfsvCbh40G XdiUGccOXdio3yDoF5UVuCgZ4S1NB4/XtLM1R5tK4+Pjq4eU+W5WEgOfEpTdUWnzXa+AwUYF DP4m5sp6lAiC8LP+ig4eTOs4YdBE3bgqbGICT8Ynk3VDepHFQQQDeD3w361jeqoPenA94sYD +qiurq7j6+rSoxZQtltAaS3gHxhAGRjAr+q/yIfbcyH48LCMLuHMcDP5Kgd/JjLiCoXkcfDx 262zuOgk7pc5S+mT+e5KCcQSvoJtc3ej2tkpO8HnqmeXtAKmDiIV0sIupiJ45rBubsV7hhLh 6hngKqPSE6yywaoT1kr45gqCvwOLRMMOeO7oCBGhvd+vVUAiIqxB4z9ARSW9jZqVvCbUFUmU p2f9tfEyYW0et9bUUpvrNZs7vq/rb6v3O9u64d7Bm92E3m4XOrvdwS2yShMRWNC/3jPnR6Ep 2n/ZenOENC04l+AN9PRzvgpwOo87gApCBeaBOSVNAsR+RY1AAgXoQLDPThrmBs8nq00+JBAt HhikkHxB8xAxk+jxlQd42CNWsy2dgetR6NYHl7hul369WzV/a3Ykm9NeHiuaRW9WVNh8Qnqs WX/SMZ+ZkThAc0WB8JsfA7y7vV0/oIo0s1RFnvZUGUexEC0S9UfHKs4shzouq0upnLuteQSE JTZQqd8JJXnInucFtQROfX7yCYpTJ5dmO8u059zzjdxD67khnu5kHVvA1NHvdoEUNQ2RLJPM g0YI/JQOQQ79efMC+ibUp71JOIVdCU1iNk2+ctmE/ojJmjHjflmleUNfWq1MyyIw4o9XwYL5 4yut/sZSr4DWLr3GFXW3LxKe7Uq3LLemYq30etT/hwsmTV/MZLvcTKbL9fbLZpbNuS0f4WMR F0D3+w+pLryaF+pR8fChNaSx+Cswk5xTqB2lFPwJv+gbJhnBWMZuyQOQvikpftw3uKqJwZ2P 7buxdRGAWTDBxSMourAbtNdXy69YnY0Im/MSI4IlIUFh3HhJcpE9rbFU+hn8qBcvXqgelQtx PUAiTtCDAJbSq7FXSqMdsD8maSfFPV/v1sB7PsrfuoJ+FMpW24bRVdNimyxpeZ3L0Bc4L1Al zAHXc37n260LTe67eEDa8pYd+p2io7DIXj14rowaqkJdqpsSwdVpIttBy+TT0hbZGA8euaVe hJGEoT6QNBJMinvAgmKOHEYKNWRGpKBglE37fLpeUViQm5PhVo9GV/a0qxO8sZXac90LGnyV NRLEaarRkIVW/hVuvjlxjWWskzZFsQLGsnuGo/aPme0Jzak58jNrTsEi3FZrOCh1rbV7rfeR IY1wP2de8cXb/G3lOJWNOP7GyjBxy4uyXpJSWjuaU22Pdu4a+HNmyx3niaoM10rOAitpdsxV 3vW5CevKw31nmH6r9WheOysDQaFCEqdApP0MyGnTAdhluYWXbvJheUpIStUTzqHtgiVFDVkN WxDC7EWtYHKzAH9I8kfdsJqFSdvdR9GS8slTJZDF97TsYFWHP9WJYZjtmiEQAgAM5rqTTOAN GEP7JmYjRwIkzPQj1gRqJcZXO1pkTqB7RWD7WAUHDr7poXgkw9tF/1xzfosbkGSjZAJmu3e7 7uMPEY7mlVQIMN8Q4jhvFrgQFO8TFRZi0rRxtDYJMl58gaWpuw4wDSlkAfXditGiY1xFrhFu JIxUSWbsNamD9j2csNqu8wwcgL6nT/a8uduzgEFS/+vB54OLdiW0LDYTHJeFJ9Ec58suHrvo 3BqqKoMomq79PFhk5OMkysf5Hkccl0eSVNZ3W+k6TvG07QLj7mGiG/vT+pUP3NhIcXFILfiN ydv5oHI4nW56dJ0fSj9KoFbJuA7CdYITnEkurbA+js1GipzoRwbbGmQ0Su4VDRleuLotc2ig lbJ84L/xgyjDYGKGeB0K31ncu1KuDkhJH3RF+PuIxHHF/yVZpifjpd4PxSuk00IW42SKIlzJ j1xjenxG7YE9tl0OgOJg+FP71QPg+WjBYNhoe6Uei/mEQV+8sA9aDCWRxuE/OajCkpp2vEbR ynrO1+g5AbA9ftDvP8GGwRJB2xOV9TXu1EkJyHeBfYJ1MCbsZpPd5ZK8LkmJmng9dSoDqA9f piuznFCromRbHK5BcJPN7P2X6Qyfm8RvvmkesKApzFBIMBN3SSH0TfQ2/KDyj16ymKu12n6Z fmAjCXJCb7ROwIta8wynCqvc5AthemtcIUA6r+BxfMWA7nMDEcg3urpRLaQgCw9hM9uul19n EzCnq2U13clSwJafuVGjo3rm8oSHh9pGh5gr5pC+7G1kMrnxXb8kJprLLl9ROuDAnBuQCVD5 grGmWAibRx3gYv9zSLopE44Z4bvY7Y5//x64T6G1sgxw6e6trixN20ZSsFtxKQTlU6wFqptg VK6i0+ns825SbSfValIJGAg3cqu4524imiZ3RlarkDBvKWYYQEve+y0FSmmF5KuOH3h83tTo WwuqZWQi+BONEpsRq2ksmwZ0iqIqCkg8F4WBvy/U7HuFNxqz3EB11w8sJSLfv+OK3o3z/w3M VJ2RedGND/X64otPmMK+tRn2onBStl5Bzj5yoqeq8sE0/nk4GAALkhCjXNgNTMiMbPAOsGDF qSsLSR4Ad8W9HL7GxlSxKUnjEBszLQ2GRj10htRQomI0UuZG0mAxnlHDBhzJ+sHFV66wBM8E lF4iPR4l1ts8tWM2CXNmZdbLL3EWqyEnwgS7wADBLk6+jToEXFw3teZn1lLH5iXW4mQaH5d4 vay4pyUFRVt2rdHmjG4etEHZWRhbJFvkatJYt3FuE0WS8evhSSGFIBUkmSA6C3ROmA2K8kij 3l57qRZs+aWM0ffgoSDQI5Rxw5tkjFgdqDfOGXHfmZUYDvK0JEz50IB2bWlJMdkjOJodwh0I 4lNKBZjOyq8Zx/BNRG0PWfBeiOxkbgrZxUBpS2Kd2BDAucp8LsdyJugN03eWDYHCEZhbeLK7 DkIj7ZddnFdRkJE+hkg8n6pRkSH4sOdlQ1oC8w6ErtSo68O9VugMXklgcr8dJ5fIIwyKkXJL jJsGx/Y3BSoQqMRVptkh/FaGQcdwc6b9IMOtdZhx+7gDgxILokm0mfgeLN5TtHiaQq7qV6Ar H7bzzICJtgiGxlQuXZTJUtA6Te60jZxgQJkvU3gnadARY+8BlG8k8GBShoMEGAxNBSdQui60 +fYbcGhGGEWrHP+bICOVYQZfcMTDBdb5s7kjW26kBj4nXyEGXONh5RCbOxwFxVHFA8cDPIDx uryxnRi8M67M2LupYL6dPiS1jhk7JjywFM6M1OpuqVtSq9XSAPDEjZiot7lFlmuy2A3ChxlY MaP9PvINA951daOvCxPjNIR4+0uUDpDFR25oPC/GQn2H/yhL5Or8DDLZ0bMGg3UxZ2NGrfAI e1VjYyHiPmL+DJDKKHmwSgpghzLmHAceSUSJnAGuTb8/WDqYMqGMwqjm29WyofiBw2XJ8Csy y6gg4GZiDINHomBdDeVzrbNtDRY/tTCfIOUG5pPphB9ImlBdRZIi5hNB2Wbh7OnMvTMgJEAK qwBsCMp4a8CtQM4suGl0oms0p6PYKC4mgk1rW1aOZeBstr7PCnEsRWtUahRAOHBVMMLGKBYj W/eKsJNHK5800tk17A7IOjZhmO4By2sbXYa0FnM8x8wSEk2yOI3AC2m7gONP/x3HIsbjLCPi bo591UXIiF+ZjmZ1XTHTNCqvZVQ+hduE3e4mXi+WjSKqq1mz2q2a+2McM8ut7N6dwC6L7kRu 6V7KlN1ulRCGj/PEQX4n8VNWZRs35ITIWk7edFrx81W9Wc/up+sK4qGS0w6pBcZzjLiQr80u nsxULaHINg/RUDPwWHcNFhHl8/VoVDeb8x7noF31akHJPBswzffRHguXR0JNRGIhWSQ0E2Yi Fq9QNMa3FuPG9FkYPZqFkcF1AnkpIqT9Emxu8AWjVAwofTBR0rE9WDgcU1avSgWSwysxq7v5 FaFl8f7h7QWq/rWRrZQPLh7gGPLYJmPYkwOn7HaBhBn6KsjRN8YdRkFe50e98VQIfvyQQW5G pQ4HDTqyRJW0FELDXOoldgiF/35vqOs6dkycZmiPtkXuIaR3CRyhhB+Tkoa3/YWpAoYpaJoe plt2E07JDE0TcGCkpWLf7AvT4467mmv6KzTDkc1Q9onbgnw7XpMDuke1mzvP2NiNDTtmQim7 kqLcyJinApnraQyE9m8McsfdbdUIKOMTUAEGT3eE8vMUY80q1yRdlpNFCGLehvI+3DjlwdZB 5Tilbbr5e2K/dofsCwAOz0Ev7s7PRMdZ93CfEEYlCeNc6Y1UGy2aJIKTbWPu0Rs7Ul9BceeJ qDwMEuGdHISpuKrtNT1z3G/B1HXM/lIvYAFKdXYxxcDlcvWaik+3kG+WvRwjQh2Max1W27RX G5IbudEUC6cDnz/qMX/wS2UBcTT0sTEVxqGbKrsGVWOvzARzHlQeFsw1pGW2iUeooB4/0soR P0wegEMB5DbZ4G47rbTfa6x9jPFIo8c1sRpK5ym5StbyAIIgCxG4T5upINEkcqjbIWrCxnki s10WpQjt+yZxM1R7yvEyvqCMkckAFGEBHYBYpQSwEnPtO1HilPN0d8PetzQVvbGbD2GoCEpb Z88h5rU3n06evZWZ0BCzv2Xqp15u6wbvicFQ+fWiAdr1O+amZyjhHwexjTBGzJGn7ggL6+kk JO8HswsTUDFzp20Ftz9eg+dZQfXzae44OXONww/2rHLIm8sOnK0kkQ7ujQzoj6AUcM4KXVe1 E4t0GZ9QnVBJyQidWojENr+MX7byl2Ym12VH7JWIy+MjDA18lARrEt82EV+36LabTSC6KzNq OAnaOkTyE644x69/ePQF/XGusx4JPOaLvrkTb+jo6LqazZ2NemWmN60yhpzO78CbAyuvI3jn ixfbm0dixyBBXAeeQEVmXvQ9yi6Ow4nCnb1cdJd3pRFM++yKXc7eRQSIo0PZt8nzvEyl3l3D eU6S6cQgo6/ljdSAQNmmL2C4bn5vlERe4/Tg7kCmrqEe2HJT/qTAvPkpmqHcTeVmKeHSPbM2 cdo6mPuymb2eknozkJ9ioWKfduzmZq73DI4WGP+X2SUK13kwIHkoDkrOaeMevYmZNFDmVthX apgX0vxtTYtsWFWkZlVdFBgqxp0uWcZj32WL53MhRw7rphc6+veypheY+M4PD7EIjOV1Jlmx zHyRWZhEKwKlsFCJZAPB+vSuKSTcpzwG6FDkE5za0xs1FH9FgPw1YdsrDCRhj8hVph0Uj7eY nswRlKbATqC3naJsmRTk6g4cU3i0F6KmMtxFg5wkWJhqTKcMKIy9p0ayYGIMNenCH87czCSU NKlnRuigijW6vQlAFgyUN0bNMVQnAiCxY7XvSnPHLjgtbCUpvHi9WVw3FMOcZRK62mjlzYwW MVVWSsgjjjq2itLKqShZc3gOvDLFVyW1LU9zgrKwW/2h/qXBsn4270OKYz2OXmWggA1VlWzd oy6xAa5IPUL2Qu6CeAKmIC3tr5pTMXOcWKYTkQ7sJR/Cv+oASolGARI8UnAZ/UCdZl+0ZPld lREhAynX7Ma7UjcVNgekVHb8y7ThIGA8ighzGjqgJ8oONzt4JLM8xPlTGtQZaDxMsy1+f0AT ZLEyckF4lh0tVj6hRXoAgvwc5tSEmtxPEZ2d9iF3vOCl0nKnwuhti0ECweUIM4/+RtImNx1a KEOqwxXBX1sDuuPhndFEPJS+4He1HuoGYDoCtfFZztR7zdtxBRaNsXR+yoMFKrhygd8R/b5L v+/R7/v0+wH9fki/H9Hvx/Q7vJx4nYufukbAVNOdADWwdFTjVc2eIldqooh4Ww8w7ZtdtPUB zElxHYpanEzIcZOz/edbl54BGN+Q1Bv0DE+ZznM5J3PYguRY2grWBIe9Vy+bX74knRVrGJOc Ib2dBXsiOflttsixtSB+L/ErH26rpJqLcxRKJ66r2DlBr4qKMaPa8iqsmpw95oiCdK4yUBrO AyFn3CWKz1q6WHG+bABcDfohcRNw3Mu+MI6J2LGFbcwDO0AxjISTAkAHvvPzkC+Jb7wsxMVf Syu2ui/EGgRKVIc76n131PsAAfa/It6Cj2qBUO+1QiEdyC6iGGk681z3Cxsn1F0RUftwGZqw gOoGZA6uG2Vb14kVk+QsBO4F2ld7F+GuvQUFlxcgjN+vGgn8TjwTDvt4R1uTO56KDAs29U+v vv6h0Hnd7WmwGPhcaBTUFGaqwTAlgCJazTX+CYgkKsK7ty+rmhTTWcZyEhF3G//2Z5qogAWS zbX4GrjwJpEwyAvAkjCvlAT8to+czGYE7mNLccHxJynstbTAtfFkobhdodXby0krxEUSQcFj p15LlChpNO8rswbLSSASpRwNEvcqJ8V9Ax9NjhxdFlg52Hkgkpg+jkdnkIix44eU4kTu5ZJo ZrjjNCVy/xBlBGOohLwg+BdM1LOd5/fS/ERGxRJ4E3cQDCISY72ku1Gri2oD8coOLn+VmxA0 dgVF6moTcaeCPxvAk2atZtumAgci1mB9732p58W9/c6oVl//qH748Wf1/Y9ff/ftr960vry9 ou8y9sXbxXWIWFcFwUJIOLWqM//AEvj2h8gSwCRnCSxL7zr/EkbBqCm5IaHx9Ebf6qWe6dq1 0439NF0ylWEv47baRP2xfcwG+A19dg27YDcUU5Mrl2MR0MJXeWfunVBuqcAyKrBMCrBxBclL JjGLSsyQh0y+e+Au690pwJHt2TFlAWeOW2dTQPIsnTo5T6NkyGilpXJEug5JF8b7nPsL4LwI 2eBCtc9G5AGqI2YiCGbpsM/Zc8hG20hWv/urcur6UbVtplHnQ6ROq6w7MQfAejVf5DZDbIPQ YyYp7FoKk/jLA1Hi6qas7mxZm/iimt+Tq0g2GF43QYJTp3wweES3Dnv1G4oMamHdPpsFcXZ/ T107s+lOF4UBo0N8069L9QUW560Xr5HDMJN12xdEpGvRSetAflnv4n6dSZCsjyZa56TFdHYB o45E6okfB0Z53HC52S7q2nzcUdnCWWB4xnH7fK9atcHg3j4ZdZovtrBNUDdG+FYl8JUBIY/W 9T7X8Kyzfm/7rMi0d1F+EV5AAiU17+MoJBUb26iseiPrOk8/p6s57loltbDfbKUlJ3m/BFxK 0h6R7XHZFBdakgnPkNRxuoG0a3p3W/fhf2kevqkiaCG8SBKZqCVV7qeOYPhduqcA4AiO5CAR frmN4CHSEUgB3ehh6V79rE/7a9jy4k3eFBb35hOlbM3JOVl0o3zeq9/uXwwK+PNWBhSGmRGT Q7wtkf+5sb76tWa/lzFc8dHRsnanX/xYYdM+aJi34hoMWngxoxXUmfIZX6wZnLWJar2BOl9g jS9sfRnODoDjjdlUxeRIW3nc1A/Z8z7HIJhwTw3ge8YjFaDXtApRBXT5/6uCJ5KuOol6i0cA xffACtV79Qw1qtfHF9rKh3cgEmjDXgM6KZOPn+eTZ3lnOWk1VzCngtn4eTZ5lrUUzFsLCpcv Pv38UeTSmgHMtjxeGQF9HP+5wHaz3IEUmKQxmj35b0LvRg+5jTCQyzxFutmUx8UVJnuLY+z/ 9tgcyFfW1yxsu7zuGlMACgxk/IPOGDV0p5eARHB+iT40qvw1r9vkSta5yQxIM641W+ydIziC XvHehoyrtMEhcdFJHL0dxbV5KBIIHvv5vtdz+f7O8PIy4Q4PUaKzlKRAcwm+mTh95OYYe+kH qgx15fikcb5j9mIXHLlkMbRiitZafw1SaZnMknksmKSwpu2k1WfpJGn2NB6QlCmFoKiVxj7M fqfjR1R5gIpuReWWQCCxJXAO8Hnk+TdzQWjAl+imYdEpp4PnB7nzUSs7twhQoMOcqDNtr+eX OuAfRCI4M9oLj80adiDir5g2kaCWsElc36KkyIgJSXBLQEGDPMWuEc4gP/evhHKiB+PwCdJ3 L8uy+bfi+480KLjSCr2nhCj5oOmujpRj160cBLsjlneiFO3hTDuYbafT3hyj4aS7B7x03Ia1 i0fHXe1rFZEL8Dj0ttHpL3HJzUuRGmZYeHBB/H8eqOsJlWqly3JmKUtbpc7KtGi2dxrMqxjV DgZxmVQt79MUXi0hVdCwtrf1BkJXHOqG3FWko9ipY0rrISotG5OpPS8TK4DGEyuuNmTKBMQi jQflGQQDaxB4E//ATvzRBK/2ToBAMVIkSEEy2t1wpaTb4Z6V+zeLxzY2Hd8W0/ETgY6/Ij2T zMAIFKLQpDKvphOjCidFULWWy+KaRDLsdugbAfEiNY0N9+XnwxZtF/gzylpvCiaf0CS7mK7d 9lDJiIg9uYvgeSt3rv+lVvmJNjkzHC/q65fG5jb+H2uBj/PnuGnKPpg8iIAuxGkELofb+V3+ ieeryVE42kOBjpXDKJYNokC4DhSey+UgIoADRLGDRoB/Lw3qwUCQi8/mCHYABOwC3o1ekLML iZbavC4ICexmNGKHdKAM0OGSAQG4CsgUgAuB2qhhFtLqvYoJlYWya7G4EB6ihELQm6My7OOZ om76Pp98nWsvK0aH+zyn4bs7iK+sSnIenYSy7EYpSzR4pOtnBgXSQcSp1aM6yyXMWAMp0m3Q yMPWdKqRPMr4FeaUEIq6O0l7+3bhICkVmd5rNnuJh6hXvxWpeeoF/iQwLIMWRFIRAqhEaHbK KRgsydwgMzxenM6NjC8SGEzojzKWlmTmbOGopZrTmZORyzwIc0e5C4se466+P1mQ6XDovztW gdRjGjPClaBKWYdfHjlPZjwdab2E01mPsUXv3e3OA/Lp7MsAbp4iho9yLAj4oZtHF6+xXpUY xoC7qfhY+1sCxo4YDExYFnGszbZk/XJM75PCmiHuG9LsrBGLRGAZY7p9gaSt+ZN+BdgzIwVS COmhsRbJq9N+ICXq0nLGdDAwQZefnfyPUZnjWvxSPAUf9meHD1+eiM/raharl/Q03NIVBLmk PRU7a69Byy9PwkerMYOO1ZdSiichRRdBgBMTnoaSzfEAKSc9DS13lwgxJz4VNVsZIWaTRuOC nJdxgQq8NKbtN+40mnVds6B1qKP2+z1y4xul+WEjhzetZfM7CpxoFnVDyN6bvmvG6geVL/C0 Kf3mP+Ua3/dqr5O8n9vzvm9P/jHX+JR/lSvJWlLWDwZ4f06cfGA5yetc0w8Vrqnwfq9d1n7v ygwvu9lvYl6ClIZTXIWWcV6QsjyxLsOhx9eQSQ2x9MjWRMEzpiOvXXn2FfKZIwQVKHi2Ld+R tW/hf2gqkPDvsz9yspBWZQm/QMA4Z9OWI+8v6P236P3HkOSHJyvi9ycpqeR9fSDvmxO0uFvv U4UYjZ7cz1JWjtEcSo+i/GvEeO3EcI2JgEfHadBC1MdkALEDGGHlEK5/AFBLAQIUABQAAAAI AKMFJTUQ1tnxPicAAI2aAAALAAAAAAAAAAAAICAAAAAAAABMdWFZYWNjLmx1YVBLBQYAAAAA AQABADkAAABnJwAAAAA= --------------090805030206030002060900-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 06:44:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A9iNsF028743; Sat, 10 Oct 2009 06:44:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6975E1A6E7; Sat, 10 Oct 2009 06:43:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83D561A684 for ; Sat, 10 Oct 2009 06:43:10 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0M71Cv-1M2mRD3HVd-00wR0V; Sat, 10 Oct 2009 05:43:50 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <560972290910100007q4e3df58pc00129dc350141e7@mail.gmail.com> <317b42db0910100123r2cb2342i8526934d98c9b81@mail.gmail.com> In-Reply-To: <317b42db0910100123r2cb2342i8526934d98c9b81@mail.gmail.com> Subject: Re: DigiPen Lua Club Date: Sat, 10 Oct 2009 02:43:30 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00A7_01CA4953.741EA8C0" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19N/M1ekHi99lxafv771HwxqcbjnNzuDEZS7KO Bnw4L/8p/ta3wsxTFaEz0uuk/FRfWvRrjcqxSZJ9OX6GZ88Rrn /8P9WxzbgwbLSzoUGd+gWYysPkqlJgR X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00A7_01CA4953.741EA8C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Yeah, luckily thanks to ProjectFun a lot more freshmen are being = introduced to Lua (2.0 went into use the year after me). Unfortunately, = many of them don't take advantage of Fun's Lua capabilities and instead = do all of their things-you-should-use-Lua for in C... @_@ From: Joseph Saad=E9=20 Sent: Saturday, October 10, 2009 A1:23 Newsgroups: gmane.comp.lang.lua.general To: Lua list=20 Subject: Re: DigiPen Lua Club Hey stuart, You then be happy to know that ProjectFun 2.0 relies on lua for faster = compile time where all the engine properties are scripted. I was = resposable for porting/modding the engine to add lua support and now you = can fully develop 2D games using it :) So I guess being @ Digipen you = got access to the Engine/Editor for free so it would be nice to talk about it or = study the lua implementation in the Lua Club. Too bad I am not with = digipen atm so I can't really be that helpful, else I would have been = glad to do some speeches about it and how it reduced the overall engine = compile time :) Regards. On Sat, Oct 10, 2009 at 10:07 AM, steve donovan = wrote: On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley = wrote: > there aren't any regular meetings of the Lua community. Well, this = gives me > an interesting tangent to bring up something I've started recently: = Lua > Club! Ah, you're lucky in that there's actually a physical gang of people involved. AFAIK, there are two people doing Lua in South Africa, which is myself and Jasper Cooke. (I would love to be corrected on this) And we are 1500 kilometres apart ;) steve d. ------=_NextPart_000_00A7_01CA4953.741EA8C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Yeah, luckily thanks to ProjectFun a lot more = freshmen are=20 being introduced to Lua (2.0 went into use the year after me). = Unfortunately,=20 many of them don't take advantage of Fun's Lua capabilities and instead = do all=20 of their things-you-should-use-Lua for in C... @_@

Sent: Saturday, October 10, 2009 A1:23
Newsgroups: gmane.comp.lang.lua.general
Subject: Re: DigiPen Lua Club

Hey stuart,
You then be happy to know that ProjectFun = 2.0 relies=20 on lua for faster compile time where all the engine properties are = scripted. I=20 was resposable for porting/modding the engine to add lua support and now = you can=20 fully develop 2D games using it :) So I guess being @ Digipen you got=20 access
to the Engine/Editor for free so it would be nice to talk = about it or=20 study the lua implementation in the Lua Club. Too bad I am not with = digipen atm=20 so I can't really be that helpful, else I would have been glad to do = some=20 speeches about it and how it reduced the overall engine compile time=20 :)
Regards.

On Sat, Oct 10, 2009 at 10:07 AM, steve donovan = <steve.j.donovan@gmail.com&g= t;=20 wrote:
On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley = <stuart@testtrack4.com>=20 wrote:
> there aren't any regular meetings of the Lua community. = Well,=20 this gives me
> an interesting tangent to bring up something = I've=20 started recently: Lua
> Club!

Ah, you're lucky in = that=20 there's actually a physical gang of people
involved. AFAIK, there = are two=20 people doing Lua in South Africa, which
is myself and Jasper Cooke. =  (I would love to be corrected on this)

And we are 1500 = kilometres=20 apart ;)

steve = d.

------=_NextPart_000_00A7_01CA4953.741EA8C0-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 06:47:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A9lOTu029010; Sat, 10 Oct 2009 06:47:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFD801A6F9; Sat, 10 Oct 2009 06:46:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E65001A684 for ; Sat, 10 Oct 2009 06:46:07 -0300 (BRT) Received: by pxi2 with SMTP id 2so3909208pxi.11 for ; Sat, 10 Oct 2009 02:46:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.119.20 with SMTP id r20mr290092wfc.303.1255168007157; Sat, 10 Oct 2009 02:46:47 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 04:46:46 -0500 Message-ID: <576e7620910100246m51d1a189u6caaa37c968d204d@mail.gmail.com> Subject: Re: DigiPen Lua Club From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9A9lOTu029010 > I go to DigiPen (http://www.digipen.edu), a school of video game programming > and design. Since Lua is the most used programming language (other than > C/C++) in the games industry, this is a prime topic for a club (since nearly > all of the students have little to no knowledge of Lua, despite some student > teams using it in their game projects). > > So I recently started a Lua Club at Digipen (first official meeting next > Monday). I haven't mapped out a schedule/agenda for the class (in a test > run, only one guy showed up and me and a friend pretty much just explained > the ins and outs of Lua to him over a couple of hours), but I have ordered > Lua Programming Gems (which is still on its way- I already have hard copies > of Programming in Lua 2nd Edition and the Reference Manual) and created a > poster (sources attached). My associate and I are both alumni. At GDC Austin a few weeks back we spoke with Gordon, from the school's office, and one of my questions to him was how various non-C/C++ languages were faring there, Lua in particular. He suggested that Python seems to be getting popular, with some teachers behind it, and Lua has sort of receded, but his remarks were very off-the-cuff and he didn't seem so sure. Does that sound at all like the reality? (I imagine it's hard to tell much beyond your own circle, but I'm still curious.) Mexico seems to be as Steve describes South Africa elsewhere in this thread, without a lot of Lua presence. And in our case, we hired the other guy. :P I did however make an incredibly lame attempt to shed some light: A long time ago, my above-mentioned associate went to a university in Morelia to give a talk; I got to tag along for free, on the condition that I gave one too. I figured something Lua-based would be a good choice, since it would be new to a lot of the audience and I had a lot of momentum going right then building up a framework on top of it. This was on a week's notice, during which time I basically threw together a poor man's version of Löve2D / Scrupp / et al.; then slapped a side-scroller on top of it, featuring a knife-armed bandit fighting floating cartoon octopi; and then, on all of four minutes of sleep, presented this to a bewildered student body while explaining Lua 5.0 and how I put it to use to make what they were seeing. This is probably not how you should conduct Lua Club, but it was fun all the same. :) From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 06:48:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9A9m9AK029103; Sat, 10 Oct 2009 06:48:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF1221A725; Sat, 10 Oct 2009 06:46:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77F011A705 for ; Sat, 10 Oct 2009 06:46:34 -0300 (BRT) Received: by ewy26 with SMTP id 26so8175221ewy.5 for ; Sat, 10 Oct 2009 02:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Ctzpy9dfTjnRmse3EUUAnjBjXWvGGmWDeTM4K/oeI7Y=; b=wZVa6mb16WkpPYrGk+vByTbSIrSDEsKc1KbpltqA18HzvKMhT5q/ckkhFEu3A+bdV4 aTuYdLEBiWPJkpzsNoyIz4MIOXlrS5qW3j9tABhfalQkga6Nkx8zKfZ1rjLffSv+juT2 v9KgJijgkTIou6BrmtK2s2J/K/a9mWuVvQaHo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E7NzQU3d6GM54nMumQgfKpyL2uNdGle34K/QVuqTWTpqC4t6AguIS1P5nap5V8Aj1f tFamx/VUdrCzuwECHFdGjt4iBI6tqGIzjB4V4aBaLgVspT5az0gPRTzR75nzxz9v5MUV EQY+Brr7aerHrjbcRhyPdWvKnoRah8BQgD9Bs= MIME-Version: 1.0 Received: by 10.216.86.85 with SMTP id v63mr1264316wee.32.1255168034559; Sat, 10 Oct 2009 02:47:14 -0700 (PDT) In-Reply-To: References: <560972290910100007q4e3df58pc00129dc350141e7@mail.gmail.com> <317b42db0910100123r2cb2342i8526934d98c9b81@mail.gmail.com> Date: Sat, 10 Oct 2009 12:47:14 +0300 Message-ID: <317b42db0910100247jd78632fia6a6d790557e2635@mail.gmail.com> Subject: Re: DigiPen Lua Club From: =?ISO-8859-1?Q?Joseph_Saad=E9?= To: Lua list Content-Type: multipart/alternative; boundary=0016e6d9a057d55592047591944f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d9a057d55592047591944f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ah all my work went to waste! Hopefully they will have some classes for Lua soon ;) as scripting languages are the next best thing in game engines. I ll check with the teachers. On Sat, Oct 10, 2009 at 12:43 PM, Stuart P. Bentley wrote: > Yeah, luckily thanks to ProjectFun a lot more freshmen are being > introduced to Lua (2.0 went into use the year after me). Unfortunately, m= any > of them don't take advantage of Fun's Lua capabilities and instead do all= of > their things-you-should-use-Lua for in C... @_@ > > *From:* Joseph Saad=E9 > *Sent:* Saturday, October 10, 2009 A1:23 > *Newsgroups:* gmane.comp.lang.lua.general > *To:* Lua list > *Subject:* Re: DigiPen Lua Club > > Hey stuart, > You then be happy to know that ProjectFun 2.0 relies on lua for faster > compile time where all the engine properties are scripted. I was resposab= le > for porting/modding the engine to add lua support and now you can fully > develop 2D games using it :) So I guess being @ Digipen you got access > to the Engine/Editor for free so it would be nice to talk about it or stu= dy > the lua implementation in the Lua Club. Too bad I am not with digipen atm= so > I can't really be that helpful, else I would have been glad to do some > speeches about it and how it reduced the overall engine compile time :) > Regards. > > On Sat, Oct 10, 2009 at 10:07 AM, steve donovan > wrote: > >> On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley >> wrote: >> > there aren't any regular meetings of the Lua community. Well, this giv= es >> me >> > an interesting tangent to bring up something I've started recently: Lu= a >> > Club! >> >> Ah, you're lucky in that there's actually a physical gang of people >> involved. AFAIK, there are two people doing Lua in South Africa, which >> is myself and Jasper Cooke. (I would love to be corrected on this) >> >> And we are 1500 kilometres apart ;) >> >> steve d. >> > > --0016e6d9a057d55592047591944f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Ah all my work went to waste!
Hopefully they will have = some classes for Lua soon ;)
as scripting languages are the next best th= ing in game engines. I ll check with the teachers.

On Sat, Oct 10, 2009 at 12:43 PM, Stuart P. Bentley <<= a href=3D"mailto:stuart@testtrack4.com">stuart@testtrack4.com> wrote:
Yeah, luckily thanks to ProjectFun a lot more freshme= n are=20 being introduced to Lua (2.0 went into use the year after me). Unfortunatel= y,=20 many of them don't take advantage of Fun's Lua capabilities and ins= tead do all=20 of their things-you-should-use-Lua for in C... @_@

Sent: Saturday, October 10, 2009 A1:23
Newsgroups: gmane.comp.lang.lua.general
Subject: Re: DigiPen Lua Club
=

Hey stuart,
You then be happy to know that ProjectFun 2= .0 relies=20 on lua for faster compile time where all the engine properties are scripted= . I=20 was resposable for porting/modding the engine to add lua support and now yo= u can=20 fully develop 2D games using it :) So I guess being @ Digipen you got=20 access
to the Engine/Editor for free so it would be nice to talk about i= t or=20 study the lua implementation in the Lua Club. Too bad I am not with digipen= atm=20 so I can't really be that helpful, else I would have been glad to do so= me=20 speeches about it and how it reduced the overall engine compile time=20 :)
Regards.

On Sat, Oct 10, 2009 at 10:07 AM, steve donovan = <steve.j.donovan@gmail.com>=20 wrote:
On Sat, Oct 10, 2009 at 4:44 AM, Stuart P.Bentley <stuart@testtrack4.com>= =20 wrote:
> there aren't any regular meetings of the Lua community= . Well,=20 this gives me
> an interesting tangent to bring up something I'= ve=20 started recently: Lua
> Club!

Ah, you're lucky in = that=20 there's actually a physical gang of people
involved. AFAIK, there = are two=20 people doing Lua in South Africa, which
is myself and Jasper Cooke.=20 =A0(I would love to be corrected on this)

And we are 1500 kilometr= es=20 apart ;)

steve d.


--0016e6d9a057d55592047591944f-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:11:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AAB8c4030661; Sat, 10 Oct 2009 07:11:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFCB51A6F2; Sat, 10 Oct 2009 07:10:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B823A1A684 for ; Sat, 10 Oct 2009 07:09:54 -0300 (BRT) Received: by bwz22 with SMTP id 22so6662215bwz.5 for ; Sat, 10 Oct 2009 03:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=DekwZegFYRLGqaH//h7gIC66bIRMJw4dUpDkryqU2pI=; b=Vxey4aTuLg+XLSBXxlJUYLlBpSIgmT7Qcs3Hlw50maM9r4IQfBXqI4V2vPM8jWfUo2 VmeVeI33ohnlnaG+grm8bCH7MYSXa+DDwRBX1S+AupKF+E54GPk8XaUCwfH6umoO2o0D LOI3hSWz84mJLft2lyCAGd3gLbOjmzB6e00kw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=tL8ZtiZ1KUlpOLkrQUJYO5Bh7wx2CA327VOmXCO0p9cRMGnBWPWkG+MByoRdI5P5SI P9cxtght/GKv7+wptvtLxwEhqyDg5H1CowbZmUfGny9Ap+osJNOvPLTonxVQ2GwqgGNj LFGPwOygO4ZXzGpYfdYLaYeI1lD6QKMug+zhk= MIME-Version: 1.0 Received: by 10.223.14.91 with SMTP id f27mr1061549faa.90.1255169433090; Sat, 10 Oct 2009 03:10:33 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> From: Jim Whitehead II Date: Sat, 10 Oct 2009 11:10:13 +0100 Message-ID: <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AAB8c4030661 On Sat, Oct 10, 2009 at 1:25 AM, Cosmin Apreutesei wrote: >> > Who is "we" ? Who does the planning and where can I see this planning >> > going >> > on? I want to be part of it. >> >> Most of the initial discussions happened yesterday following the Lua >> Workshop.  I'm not sure if all the participants wish to be singled >> out, but it involved two individuals from the Kepler team, myself and >> two other members of the community.  The discussion has just begun, >> hence why I am requesting people contact me to be involved. > > Lol, looks like a secret society with a secret project. Is there a problem > on announcing the luaforge google group on this list? For instance, I > already took the liberty of creating a project myself > here http://code.google.com/p/luaforge/ which lists some incredibly close > goals to what I just read on that google group :) I'm incredibly offended by your accusations that this is in any way a secret project with a secret society. I suppose that my 12.5 hours of travel coupled with the fact that we were having the discussion less than 4 hours before I got on the plan, or any of the other myriad of reasons for approaching this the way I have mean nothing, however. As for everything else, I have opinions but I'm not sure anyone really cares about them. - Jim From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:36:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AAa9nd032761; Sat, 10 Oct 2009 07:36:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 041A51A701; Sat, 10 Oct 2009 07:35:06 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F4E41A684 for ; Sat, 10 Oct 2009 07:34:57 -0300 (BRT) Received: by bwz22 with SMTP id 22so6668885bwz.5 for ; Sat, 10 Oct 2009 03:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=kdgq+uhUBqBQNqwIW3m09IFXK+gxtDs0QLWeTSd1/So=; b=kNF6R8IjLaNBBUAZReaGcI6OnqBQfv6VFqtvoU+41qVRBDB0W0Bi7LmGtXQqSxhuU1 C9kq7teKq43t8O1j5NqSB4tpmFGoZANrCX4jMMjZ/kPhSopHs5lNdEkjiuFAv1in9lDd 9s1EcuKz3ClUh/39KwbAu9WpBD83rLWOe8vP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=ZvOkHIsaZbF2RWoTf3tO/nqKjiL4C0y1gegvHtSLSECpVqPoVqkaouiuQxoZ23UyRO nfvwpae0LxI0qFD9wfZrdiF1EIUYZmeb0IccYY2AgPWB443Q4o5NNuBDHRlfbVbrBEmr rxKZV4cOxty06QobkklFwnc7odOfoEV2jUkcQ= MIME-Version: 1.0 Received: by 10.223.21.3 with SMTP id h3mr1123337fab.39.1255170937122; Sat, 10 Oct 2009 03:35:37 -0700 (PDT) From: Jim Whitehead II Date: Sat, 10 Oct 2009 11:35:17 +0100 Message-ID: <5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com> Subject: Luaforge (projects/snippets) development discussion To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean For those people that are interested in the discussion and development regarding an eventual replacement for Luaforge can join the mailing list at Google Groups (http://groups.google.com/group/luaforge-development). Right now any messages from new members will be moderated (to combat spam). The discussion is still relatively new, but we spent plenty of time planning out an overall strategy for the site. The next steps involve working on a version 1.0 (which does not replace Luaforge in any way) to ensure we have the design and development base we need to finish the application. That being said, if anyone has contacts that might be interested in doing professional design work for the site (something I think we agree it most certainly needs), then please send them to the group or to me. Thanks, - Jim From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:43:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AAhZga000685; Sat, 10 Oct 2009 07:43:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E64661A6E3; Sat, 10 Oct 2009 07:42:30 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA55F1A662 for ; Sat, 10 Oct 2009 07:42:23 -0300 (BRT) Received: by gxk4 with SMTP id 4so8664239gxk.8 for ; Sat, 10 Oct 2009 03:43:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.74.11 with SMTP id b11mr2111500agl.39.1255171384402; Sat, 10 Oct 2009 03:43:04 -0700 (PDT) In-Reply-To: <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> Date: Sat, 10 Oct 2009 13:43:04 +0300 X-Google-Sender-Auth: 13ae0e917bd70e35 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e644c6ea7fe2aa0475925ccb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e644c6ea7fe2aa0475925ccb Content-Type: text/plain; charset=UTF-8 > > > Lol, looks like a secret society with a secret project. Is there a > problem > > on announcing the luaforge google group on this list? For instance, I > > already took the liberty of creating a project myself > > here http://code.google.com/p/luaforge/ which lists some incredibly > close > > goals to what I just read on that google group :) > > I'm incredibly offended by your accusations that this is in any way a > secret project with a secret society. I suppose that my 12.5 hours of > travel coupled with the fact that we were having the discussion less > than 4 hours before I got on the plan, or any of the other myriad of > reasons for approaching this the way I have mean nothing, however. > Hey, you missed out the Lol in front :) where did u come up with this word anyway ... "accusations" :) As for everything else, I have opinions but I'm not sure anyone really > cares about them. sure we care, just let them out in the open. --0016e644c6ea7fe2aa0475925ccb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> Lol, looks like a secret society with a secret project. Is there a p= roblem
> on announcing the luaforge google group on this list? For instance, I<= br> > already took the liberty of creating a project myself
> here=C2=A0http://code.google.com/p/luaforge/=C2=A0which lists some incredibl= y close
> goals to what I just read on that google group :)

I'm incredibly offended by your accusations that this is in any w= ay a
secret project with a secret society. =C2=A0I suppose that my 12.5 hours of=
travel coupled with the fact that we were having the discussion less
than 4 hours before I got on the plan, or any of the other myriad of
reasons for approaching this the way I have mean nothing, however.

Hey, you missed out the Lol in front :) where d= id u come up with this word anyway ... "accusations" :)

As for everything else, I have opinions but I'm not sure anyone really<= br>cares about them.

sure we care, just let= them out in the open.

--0016e644c6ea7fe2aa0475925ccb-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:47:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AAlMc2001102; Sat, 10 Oct 2009 07:47:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E2EA1A703; Sat, 10 Oct 2009 07:46:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E61441A662 for ; Sat, 10 Oct 2009 07:46:12 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0M7qcS-1M1Sfs0NUm-00vtkX; Sat, 10 Oct 2009 06:46:53 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <576e7620910100246m51d1a189u6caaa37c968d204d@mail.gmail.com> In-Reply-To: <576e7620910100246m51d1a189u6caaa37c968d204d@mail.gmail.com> Subject: Re: DigiPen Lua Club Date: Sat, 10 Oct 2009 03:46:36 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19YMIMsjaeFyriyL8RAtXKdO5gMtDALuKhxLRs d5R9eUXB95QMUoImvAVAYfwsNIvksISjCFDlBTex0LHaOPeDjh 0G1T4XQwbBh2c9hAz8YZBgpcrsALsX1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Well, all the machines have Python 2.6 and 3.0 installed on them while none have Lua (although hopefully the first 3 rows of Al-K will have LfW installed after I ask IT to do it), but I can name several student games that use Lua, and not one that uses Python. I suppose it's probably the generational gap. ;) Also, Chris Peters (a former student, not sure if he's after your time) is a GAM professor here now (one of a trio of Microsoft employees who quit their jobs to work here full-time), and he's big into Lua, has PiL in his office, is from what I heard writing something fancy using it, and has mentioned things about it when giving talks about architecture (such as how the hash lookup will never be your bottleneck), so it's got at least one faculty member pulling for it. -------------------------------------------------- From: "Steven Johnson" Sent: Saturday, October 10, 2009 A2:46 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: DigiPen Lua Club >> I go to DigiPen (http://www.digipen.edu), a school of video game >> programming >> and design. Since Lua is the most used programming language (other than >> C/C++) in the games industry, this is a prime topic for a club (since >> nearly >> all of the students have little to no knowledge of Lua, despite some >> student >> teams using it in their game projects). >> >> So I recently started a Lua Club at Digipen (first official meeting next >> Monday). I haven't mapped out a schedule/agenda for the class (in a test >> run, only one guy showed up and me and a friend pretty much just >> explained >> the ins and outs of Lua to him over a couple of hours), but I have >> ordered >> Lua Programming Gems (which is still on its way- I already have hard >> copies >> of Programming in Lua 2nd Edition and the Reference Manual) and created a >> poster (sources attached). > > My associate and I are both alumni. At GDC Austin a few weeks back we > spoke > with Gordon, from the school's office, and one of my questions to him was > how > various non-C/C++ languages were faring there, Lua in particular. He > suggested > that Python seems to be getting popular, with some teachers behind it, and > Lua > has sort of receded, but his remarks were very off-the-cuff and he > didn't seem so > sure. Does that sound at all like the reality? (I imagine it's hard to > tell much beyond > your own circle, but I'm still curious.) > > Mexico seems to be as Steve describes South Africa elsewhere in this > thread, > without a lot of Lua presence. And in our case, we hired the other guy. :P > > I did however make an incredibly lame attempt to shed some light: > > A long time ago, my above-mentioned associate went to a university in > Morelia to > give a talk; I got to tag along for free, on the condition that I gave > one too. I figured > something Lua-based would be a good choice, since it would be new to a lot > of > the audience and I had a lot of momentum going right then building up > a framework > on top of it. > > This was on a week's notice, during which time I basically threw > together a poor man's > version of Löve2D / Scrupp / et al.; then slapped a side-scroller on > top of it, featuring > a knife-armed bandit fighting floating cartoon octopi; and then, on > all of four minutes > of sleep, presented this to a bewildered student body while explaining > Lua 5.0 and > how I put it to use to make what they were seeing. > > This is probably not how you should conduct Lua Club, but it was fun > all the same. :) > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:50:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AAoFJ2001302; Sat, 10 Oct 2009 07:50:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9F911A709; Sat, 10 Oct 2009 07:49:17 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C3B61A662 for ; Sat, 10 Oct 2009 07:49:07 -0300 (BRT) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MwZWF-0006eS-Km for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 12:49:47 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 12:49:47 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Oct 2009 12:49:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Re: Luaforge (projects/snippets) development discussion Date: Sat, 10 Oct 2009 03:49:17 -0700 Lines: 23 Message-ID: References: <5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net In-Reply-To: <5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com> X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Professional design as in UX work? Usability analysis? CSS? Branding? "Jim Whitehead II" wrote in message news:5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com... > For those people that are interested in the discussion and development > regarding an eventual replacement for Luaforge can join the mailing > list at Google Groups > (http://groups.google.com/group/luaforge-development). Right now any > messages from new members will be moderated (to combat spam). > > The discussion is still relatively new, but we spent plenty of time > planning out an overall strategy for the site. The next steps involve > working on a version 1.0 (which does not replace Luaforge in any way) > to ensure we have the design and development base we need to finish > the application. That being said, if anyone has contacts that might > be interested in doing professional design work for the site > (something I think we agree it most certainly needs), then please send > them to the group or to me. > > Thanks, > > - Jim > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 07:51:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AApofm001434; Sat, 10 Oct 2009 07:51:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC71F1A72D; Sat, 10 Oct 2009 07:50:51 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5D771A662 for ; Sat, 10 Oct 2009 07:50:45 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MVer9-1MnPgA0gil-00YhCH; Sat, 10 Oct 2009 06:51:26 -0400 Message-ID: <1D99EA267DC948B189409523B6540D1C@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com><560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com><457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> In-Reply-To: <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> Subject: Re: Lua Recipes Site? Date: Sat, 10 Oct 2009 03:51:09 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX18DkRQOm/zlY/gGmYOCNb5UhJkoc3Z4bw4NqAV eR4hMYg9qTgEmYXQi0nXwc2T7kka0HzAg5e1ZUjpLJS2Dtwmm3 Ss+0eHmdm1/LhqVuG7CiL0xDCWX76zm X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I drew a logo for Lua Recipes, but even after I trimmed it to <40k it got bounced, so I'll go upload it somewhere and then post a link. -------------------------------------------------- From: "steve donovan" Sent: Saturday, October 10, 2009 A1:27 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley > wrote: >> Yeah, a lot of guys are definitely over-thinking this (I haven't read all >> of >> the previous comments in the thread yet, but judging from what I've >> seen). >> The model for a Lua Recipes site isn't Github or LuaRocks; it's Pastebin >> / >> Bitbucket. > > This is totally true. But development hasn't died, it's just gone > underground (or underwater). In fact what Yuri, Jim and myself are > envisaging is similar to exactly what you are suggesting. However, we > did decide to let license information be explicit - it defaults to > MIT/X11. > > steve d. > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 08:07:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AB7bjC002771; Sat, 10 Oct 2009 08:07:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97DCB1928C; Sat, 10 Oct 2009 08:06:32 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24A2519235 for ; Sat, 10 Oct 2009 08:06:25 -0300 (BRT) Received: by ywh5 with SMTP id 5so2399449ywh.11 for ; Sat, 10 Oct 2009 04:07:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.19.15 with SMTP id w15mr2095711agi.12.1255172825670; Sat, 10 Oct 2009 04:07:05 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Date: Sat, 10 Oct 2009 14:07:05 +0300 X-Google-Sender-Auth: 5b8c9d4b09dd58a9 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001485f94df067e51d047592b222 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f94df067e51d047592b222 Content-Type: text/plain; charset=UTF-8 > > The project looks pretty nice, but I'm a bit wary of using rockspecs > as the file format for uploading information. The purposes are > different, in that rockspecs are mostly intended just to provide > instructions on creating and installing rocks. Because of this, (a) > they don't offer fields for things like categories, SCM or bug > tracking location, alternative downloads, etc., and (b) the build > instructions are present in the rockspec, and I'm not sure those > really belong on an index (or even a forge). (a) and they shouldn't be -- in my view, rockspecs should only contain cohesive information, with the objective of gluing the pieces of a project together; it should not contain any information that puts the project in relation to other projects -- so no tags, categories etc. another reason for this is that the rockspecs should belong to the project authors only, luaforge should not modify (add sections to) the rockspec in any way -- otherwise rockspec polling (a one way process) wouldn't make sense. (b) I don't see no reason why rockspec shouldn't be an open format, into which you have different sections used by different tools/purposes. so luaforge would just ignore the "build" section, in the same way luarocks ignores fields like "project homepage". --001485f94df067e51d047592b222 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The project look= s pretty nice, but I'm a bit wary of using rockspecs
as the file format for uploading information. The purposes are
different, in that rockspecs are mostly intended just to provide
instructions on creating and installing rocks. Because of this, (a)
they don't offer fields for things like categories, SCM or bug
tracking location, alternative downloads, etc., and (b) the build
instructions are present in the rockspec, and I'm not sure those
really belong on an index (or even a forge).

(a) and they shouldn't be -- in my view, rockspecs should only contai= n cohesive information, with the objective of gluing the pieces of a projec= t together; it should not contain any information that puts the project in = relation to other projects -- so no tags, categories etc. another reason fo= r this is that the rockspecs should belong to the project authors only, lua= forge should not modify (add sections to) the rockspec in any way -- otherw= ise rockspec polling (a one way process) wouldn't make sense.

(b)=C2=A0I don't see no reason why rockspec shouldn= 't be an open format, into which you have different sections used by di= fferent tools/purposes. so luaforge would just ignore the "build"= section, in the same way luarocks ignores fields like "project homepa= ge".

--001485f94df067e51d047592b222-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 08:41:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ABf4vZ005821; Sat, 10 Oct 2009 08:41:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FCA91935D; Sat, 10 Oct 2009 08:39:57 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C69F19356 for ; Sat, 10 Oct 2009 08:39:50 -0300 (BRT) Received: by fxm12 with SMTP id 12so1493945fxm.5 for ; Sat, 10 Oct 2009 04:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=xkd1bH8E4R1R5eSVbK+uqzkX1GmWXlDgDLINOc4n/bs=; b=SRUADz5CT1dlDK1bvP7kKNS5crY4qucO2AkfAkfSAP7RQWwmAgYuifIH8KJvN4Av3T yLH+VFfxIZiTVuYjmWREBfjZc1ARNlmtBqUn0uRRM6Wn4nKTCBEHMcEaSH50Kbp+Sane rpkEcHxDMbCIBtEjLGwp+xpvp03iENMVHyL+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=IDBMWDSVF5603Gc/aXUfyuIy2exjlnR75UGyo9r2cRs3Q/PQln78CsQswa1xf/YslR UBcu37Uwlz6L38F3aPstT7NdNbwos55d1N9gRJd4YTEOY2Pfm3eGgmLvU8SMhc9w+1mx 1NjTeuPF3xx6xQ3D2ihH/vZLFMsjFQEnvbWFY= MIME-Version: 1.0 Received: by 10.223.73.20 with SMTP id o20mr1106434faj.71.1255174831149; Sat, 10 Oct 2009 04:40:31 -0700 (PDT) In-Reply-To: References: <5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com> From: Jim Whitehead II Date: Sat, 10 Oct 2009 12:40:11 +0100 Message-ID: <5fe281d40910100440k1ebfaa66ka9086019a44bb233@mail.gmail.com> Subject: Re: Luaforge (projects/snippets) development discussion To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9ABf4vZ005821 On Sat, Oct 10, 2009 at 11:49 AM, Stuart P.Bentley wrote: > Professional design as in UX work? Usability analysis? CSS? Branding? Any or all of the above. The most pressing work is the actual graphical design and layout of the site, which of course encompasses these points. - Jim > > "Jim Whitehead II" wrote in message > news:5fe281d40910100335p275eeb60k108906c8fa8b803c@mail.gmail.com... >> >> For those people that are interested in the discussion and development >> regarding an eventual replacement for Luaforge can join the mailing >> list at Google Groups >> (http://groups.google.com/group/luaforge-development).  Right now any >> messages from new members will be moderated (to combat spam). >> >> The discussion is still relatively new, but we spent plenty of time >> planning out an overall strategy for the site.  The next steps involve >> working on a version 1.0 (which does not replace Luaforge in any way) >> to ensure we have the design and development base we need to finish >> the application.  That being said, if anyone has contacts that might >> be interested in doing professional design work for the site >> (something I think we agree it most certainly needs), then please send >> them to the group or to me. >> >> Thanks, >> >> - Jim >> > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 08:41:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ABfg91005901; Sat, 10 Oct 2009 08:41:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5696E19375; Sat, 10 Oct 2009 08:40:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 133681936A for ; Sat, 10 Oct 2009 08:40:32 -0300 (BRT) Received: by bwz22 with SMTP id 22so6687632bwz.5 for ; Sat, 10 Oct 2009 04:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=QdbicX24lCGy4a2bY8Kxxavkgidc41V76pyMFH4io/M=; b=eTsaSZh0mhbFq9MKxY1G7CmJOutWISQlKAFkJHbkD+QSbPcX+9bvTSIeHbIi2xggOW sucYhikwejwNWZwZkj442OG9ZyyZdS4+bscwwOE297U4pZqLt4NM2h6PjXaAj0rzcgtx dxPz9/2v7H/NhOLuU1+c7BAcOBS2O/Kdi5e/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=uFilV2ALnuGMQpho7EpEhfCptdGOTY2cFLM/J4mG7joNM9J1HXjMBADNKJVCw32tiP AmSsemnlsbJI8XSpz2JmoU4ldG6VECdVkqGMUIVnWG08hmldXdQZhH39bEgyR561cF+T pzd6e72t5QuMRVLYo54sG/06VE0jJCF1T+pyI= MIME-Version: 1.0 Received: by 10.223.58.208 with SMTP id i16mr1178078fah.22.1255174872305; Sat, 10 Oct 2009 04:41:12 -0700 (PDT) In-Reply-To: <1D99EA267DC948B189409523B6540D1C@Stucomet> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> From: Jim Whitehead II Date: Sat, 10 Oct 2009 12:40:52 +0100 Message-ID: <5fe281d40910100440h9250bc8x3a3c3b9844833a3e@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9ABfg91005901 On Sat, Oct 10, 2009 at 11:51 AM, Stuart P. Bentley wrote: > I drew a logo for Lua Recipes, but even after I trimmed it to <40k it got > bounced, so I'll go upload it somewhere and then post a link. Please move this discussion to the google group for luaforge development. Thanks! - Jim > > -------------------------------------------------- > From: "steve donovan" > Sent: Saturday, October 10, 2009 A1:27 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: Lua Recipes Site? > >> On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley >> wrote: >>> >>> Yeah, a lot of guys are definitely over-thinking this (I haven't read all >>> of >>> the previous comments in the thread yet, but judging from what I've >>> seen). >>> The model for a Lua Recipes site isn't Github or LuaRocks; it's Pastebin >>> / >>> Bitbucket. >> >> This is totally true. But development hasn't died, it's just gone >> underground (or underwater). In fact what Yuri, Jim and myself are >> envisaging is similar to exactly what you are suggesting.  However, we >> did decide to let license information be explicit - it defaults to >> MIT/X11. >> >> steve d. >> > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 08:44:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ABieuK006084; Sat, 10 Oct 2009 08:44:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68FC019386; Sat, 10 Oct 2009 08:43:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFC4D19358 for ; Sat, 10 Oct 2009 08:43:20 -0300 (BRT) Received: by fxm12 with SMTP id 12so1495201fxm.5 for ; Sat, 10 Oct 2009 04:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Q8WChed2BEG6LNSLlCDsDmCYfEJnUfcrM9qvuTFGZUw=; b=oE8j3ajTkB4wEPIVhv1qTAyoouNvVflAdOEIJGtPjg76eY1SLeLLJTjShbjjiNB2Dd Gc48yAYKWCyntwmeTpTovXLFeHT4E2L7hkgsv1SbK89s+YZ4lTgQJNrKGvjnvOnMZ9SQ T6KXv9YM7J13OC6ekKSZmZ4+thXMQzWye8zsI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=NqFrTwMV48sk9CKGEvgs0sIctlk+bIUSa9sH79+5k8ZwuusV4PkBZdtyRLRvx0AHgP sunvfcl9UFE0f3vhc5Pf79AJMIG4Do/+i6k/Nv22P5gU5TNoF2wwOWw5YuqoX20bSEX+ 7XhDlvRRYma4W+nD30J0wOaRNc1hJYHSjJJfU= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr1118586fau.40.1255175041064; Sat, 10 Oct 2009 04:44:01 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> From: Jim Whitehead II Date: Sat, 10 Oct 2009 12:43:41 +0100 Message-ID: <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 11:43 AM, Cosmin Apreutesei wrote: > sure we care, just let them out in the open. Absolutely nothing has been closed in any way. Stop implying that they have been. From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 08:53:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ABrltB006771; Sat, 10 Oct 2009 08:53:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1252193D9; Sat, 10 Oct 2009 08:52:49 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DEA9193C7 for ; Sat, 10 Oct 2009 08:52:43 -0300 (BRT) Received: by ywh5 with SMTP id 5so2415150ywh.11 for ; Sat, 10 Oct 2009 04:53:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.189.1 with SMTP id r1mr2095899agp.109.1255175602650; Sat, 10 Oct 2009 04:53:22 -0700 (PDT) In-Reply-To: <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> Date: Sat, 10 Oct 2009 14:53:22 +0300 X-Google-Sender-Auth: db208d6b0b7906d2 Message-ID: Subject: Re: LuaForge is down and will be for some time From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e64602d6ed3e9704759357b2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64602d6ed3e9704759357b2 Content-Type: text/plain; charset=UTF-8 > > Absolutely nothing has been closed in any way. Stop implying that > they have been. > My message came way too late in the conversation - sorry!! --0016e64602d6ed3e9704759357b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Absolutely nothi= ng has been closed in any way. =C2=A0Stop implying that
they have been.

My message came way too late in the conversatio= n - sorry!!

--0016e64602d6ed3e9704759357b2-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 09:01:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AC1TRR007359; Sat, 10 Oct 2009 09:01:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 160FF193E4; Sat, 10 Oct 2009 09:00:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F32A193C7 for ; Sat, 10 Oct 2009 08:59:50 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MJziv-1MxxX61voD-001CZl; Sat, 10 Oct 2009 08:00:31 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: Kepler graph Date: Sat, 10 Oct 2009 05:00:03 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+iY2mE4nYCZ/RaAvuitMSPC7PdziE2r2S54sB MiFNWkbYtyUxPSVTvHoX1SrT1T5EXLBDA5ve10nRy1o4VEugSk zEH04aZpjjA7w1OGeyjQw5YIM8reuNt X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean At first I thought "edit" meant "upload a new version". Then I went to the edit link. WOAH. That is nuts. Kudos, and thanks for the graph (The CGILua thing really throws me). -------------------------------------------------- From: "Yuri Takhteyev" Sent: Thursday, October 08, 2009 P10:10 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Kepler graph >> Could somebody draw up some sort of flowchart explaining how the >> different >> Kepler projects are related? Even when up, the site is a bit of a mess >> (several pages linked to for explanations are simply blank), and I still >> can't discern the relationship between WSAPI, CGILua, Orbit, Sputnik, >> Cosmo, >> LPeg, Xavante and mod_lua. > > Something like this perhaps: > > http://spu.tnik.org/en/Kepler_Diagram.png > > Feel free to improve: > > http://spu.tnik.org/en/Kepler_Diagram.edit > > (It's a wiki.) > > - yuri > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 10:35:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ADYwec015343; Sat, 10 Oct 2009 10:34:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 671A8193BE; Sat, 10 Oct 2009 10:33:40 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6140819391 for ; Sat, 10 Oct 2009 10:33:31 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9ADYAPR010721 for ; Sat, 10 Oct 2009 10:34:12 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id D78B454C23A; Sat, 10 Oct 2009 10:34:10 -0300 (BRT) Date: Sat, 10 Oct 2009 10:34:10 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: lpeg grammar inefficiency Message-ID: <20091010133410.GC23865@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > LPEG seems not to be very good at optimising around lpeg.V references. In > particular they defeat character set combination. This can be a bit > harmful to readability of grammars. For example, > > [...] LPEG does not even try to optimize references. Usually the best approach is to define the low-level entities outside the grammar (as you did in your "fast" case) and use them inside the grammar. For instance, we used this technique in the "Arithmetic expressions" example in the manual. (The "lexical elements" are all defined outside the grammar.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 10:39:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ADdPBM015736; Sat, 10 Oct 2009 10:39:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A2901A663; Sat, 10 Oct 2009 10:38:23 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43B50193BD for ; Sat, 10 Oct 2009 10:38:14 -0300 (BRT) Received: by vws9 with SMTP id 9so4578151vws.11 for ; Sat, 10 Oct 2009 06:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=j2FEAnrvOrUuuGb6NJVAHxGArrpZwFTD2qCZJcehwf4=; b=OHl0ocOS26E5PPWT632L7IV18kSf2IIm17Z/g2K2bq2xJKkDg8E5sqempRa7fFzm+T 7wwtPgc5tmnuR2GFNF6PF2FG5CJvDNfmekOl1BHgkcenka/1UKqSb9wuAyTWJEwkcNm2 VmOL2I9KL44RbhGPjP1kWUa1v5mB1vWLImFh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=CrprZ38Dn9wBltvLUMo5owRMKw6EGkVWLTrKyMZpG6K/8Ut8T+rRFrUS8+gvSssmEn 9LEoiSlLKg8WOeyzpzsiQtj2gYXy9niF5Xpw7GeLPF1OJqokqh4Yz6eITFi59xBudlmV 6mOdWp1rdA5lZli5Ta2DOtwqYH0okxunux1Pk= MIME-Version: 1.0 Received: by 10.220.88.228 with SMTP id b36mr5776412vcm.85.1255181933875; Sat, 10 Oct 2009 06:38:53 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 10:38:53 -0300 X-Google-Sender-Auth: 1e96dc54f9729612 Message-ID: <92ab989c0910100638w1d73216bvf2ec5668bb9cdc9d@mail.gmail.com> Subject: Re: LuaForge host provider From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9ADdPBM015736 On Fri, Oct 9, 2009 at 11:37 PM, Leaf Storm wrote: > To be completely honest, I'm not exactly sure who owns luaforge.net > and would make that call. I'm thinking it's the Lua team, but a WHOIS > on luaforge.net revealed a person that I have never heard of. (Maybe > someone at PUC-RIO?) luaforge.net is registered in name of one of Fábrica Digital founders. André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 11:07:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AE6wSB018151; Sat, 10 Oct 2009 11:06:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27E3E193D4; Sat, 10 Oct 2009 11:05:47 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E847E19391 for ; Sat, 10 Oct 2009 11:05:37 -0300 (BRT) Received: by vws9 with SMTP id 9so4586425vws.11 for ; Sat, 10 Oct 2009 07:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=swFvYdYJOdSI4hQnXaKUoQ+29M4PY7Cm+n0zOeor+NY=; b=tV9e/V4z7KUW1No7buW1HUMby0bAAomVK7aDFary3ajUS4ZQS7NcEF+CSiyHheCrgh 7NlbkUpAhk4wl2EkHyMEa9ULBQnBk93ajJAbYpF2opixlKJxQxt9lKA4opXZbBzajgVX 20KB/z4yPuiQ5Y7rHHyJc3h1d+R43mhmsextw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=HUaDsDdnzmsXz8gfiEcUWKJ1dkU6wvqs3vkH0SiZdRwoZ/jydAQO6DX6Ms9BQ05OiU uUVApa240BlkRHb0HP1d3y2EzEUCHrMM58Hcz8hkowOa/nDhkEg3L0oItZbSm0u6DxdP T/7OhtDKwrFdH+VJuIxMqyXxcP7kYJoN66yGQ= MIME-Version: 1.0 Received: by 10.220.114.142 with SMTP id e14mr5693689vcq.83.1255183578606; Sat, 10 Oct 2009 07:06:18 -0700 (PDT) Date: Sat, 10 Oct 2009 11:06:18 -0300 X-Google-Sender-Auth: 719bfbd7b55fc2b0 Message-ID: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> Subject: LuaForge is back, but not entirely yet From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AE6wSB018151 Hi, After a delay longer than most would want (but shorter than I was expecting) LuaForge is getting up again. As many have already noticed, the services are being restored one by one and some are not functional yet. We already have the GForge web interface running (which allows for downloads and issue tracking), the project sites (project_name.luaforge.net) and CVS (pserver only). These were the critical services to have back and we will keep restoring the others during the weekend (and the Brazilian holiday), meanwhile let us know about any problems found on LuaForge. Unfortunately the data recover wasn't perfect and we lost some data after Sep-13. This explains why some project are no longer on LuaForge and why some users can't log in. For those impacted by the data loss, my sincere apologies. All I can do is ask the involved to please consider registering again the project and user accounts on LuaForge. I'd like to express my sincere gratitude for Alessandro Hecht for his incredible sprint to bring GForge from the ashes. It was a really hard work done under significant pressure and he deserves most of the credits for the recovey. Big thanks to Paulo Fernando, Daniel Albuquerque and Rosa Ladeira for their help with infraestructure. A special nod to Jim Whitehead, Norman Clarke, Patrick Donnelly, Fabien Fleutot and Fabio Mascarenhas for their help figuring out what, when and how to do things during the crisis. Last, but not least, thanks everyone for the patience and, again, my deep apologies for those that were impacted by the data loss. I'll keep the list informed about the site status. André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 11:11:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AEBKIT018639; Sat, 10 Oct 2009 11:11:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E1CD193E1; Sat, 10 Oct 2009 11:10:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6240E19391 for ; Sat, 10 Oct 2009 11:10:10 -0300 (BRT) Received: by vws9 with SMTP id 9so4587892vws.11 for ; Sat, 10 Oct 2009 07:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=nUgAOolpu/euWD3lkrHtj1tBCO07r3wMag9j9D2ixwM=; b=VS/LKTCv5V2urNsAs0vCCgB58xB0K5SYQM5PhrPM4IMjKVxzMDaBXU/JdlSWSdcwWD VvkpEmyPXgbsa2sEbW6hWOfiuf0xMnu5E/nLgKZS+e8fCEhp2Qz3z3mPS704rrgrXvaE PFoxeBoNWlhcXgykIkh4QGsrp0+NcVw4U6rgU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=QZdzpnQhxWstZ/il+QG5QUlki/V7AebT8Bv6FEQilNlp160GzMmUep68nIwIWtc6tw 2jf/UsUec3mTxax9ZO1U0hDiF4PRR/MlsDZs2DJcy2HflVqBbvyWqZ1Hxl9nRGQMk9PQ nRdaUt6AuYL8KV1IwPqPIwaPeyLdBNEX9VmzI= MIME-Version: 1.0 Received: by 10.220.80.2 with SMTP id r2mr5938914vck.7.1255183848889; Sat, 10 Oct 2009 07:10:48 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 11:10:48 -0300 X-Google-Sender-Auth: e89b21a2df883c79 Message-ID: <92ab989c0910100710g26970ff1w690641fb42513879@mail.gmail.com> Subject: Re: problems with LuaForge From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AEBKIT018639 On Sat, Oct 10, 2009 at 4:40 AM, François Perrad wrote: > The recovery seems not complete. Indeed, please check my previous mail. > In my page (fperrad), one of my 3 projects (testlongstring, > lua-TestLongString) is missing. Unfortunately, this was one of the projects registered after 13-Sep so the registration data was lost. Would you don't mind registering again the project? Let me know if this project had already any files released, issues or CVS commits. Those are recoverable, but the GForge registration data was lost (project name, description, members, issues). > When I try to release a file, I obtain the following error : > File cannot be moved to the permanent location: > /var/lib/gforge/download//testmore/testmore/lua-TestMore-0.1.0/lua-testmore-0.1.0.tar.gz Thanks for the feedback, working on that. > I cannot login by ftp on testmore.luaforge.net, lua-coat.luaforge.net, ... FTP is not active yet. In fact, the whole site authentication system is down so no CVS commits either. André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 11:17:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AEHJgY019117; Sat, 10 Oct 2009 11:17:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4697C1A6DB; Sat, 10 Oct 2009 11:16:11 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5251A1A65C for ; Sat, 10 Oct 2009 11:16:04 -0300 (BRT) Received: by vws9 with SMTP id 9so4589726vws.11 for ; Sat, 10 Oct 2009 07:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=p1tDYiEQ9cPHFBsXoTdXo+CD72EP7CLvZUfWMcslqzI=; b=xZOyaeVRpU7jh1cgNIY/qfITnyGR11JYLiVJu6LIflBqOmb/cBPcU6JbvakKa7mVsC Jld0TLfdxZI2Zr4m6L/hJGNvmmNMNt03VggUz177d6XnkUvtbOQtrKVz8nHFddgD7Vb3 3JYAFEz1BLGxHIX75pG7lF6eiL2p6eFZEjQgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=OwFbYTOe6RLhOXfEut9MvLhPloO0LZVeX2kCjusRzyhC5W1xabeP25v0vMmeVWH1iw qBztv/94BHmJocRBzW0901oMfBxz1tmNKO6TtL+u1SoVu2zZZy7SpN9sfa3THtCv1LsC wxMf82pLKaseRQJLw77j/s7QtRSHMy2SD7o60= MIME-Version: 1.0 Received: by 10.220.114.142 with SMTP id e14mr5705128vcq.83.1255184205171; Sat, 10 Oct 2009 07:16:45 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> Date: Sat, 10 Oct 2009 11:16:45 -0300 X-Google-Sender-Auth: f18345327feeb2e3 Message-ID: <92ab989c0910100716m38ec152cw5f1f3a9f7bc9de2f@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AEHJgY019117 On Fri, Oct 9, 2009 at 10:41 PM, Stuart P. Bentley wrote: > Now that it's back up, how recent are these backups? I ask because I notice > that Lua For Windows only lists the latest version as 5.1.4-29. Sorry about that, would you mind sending me a list of the releases since 13-sep so we can try to register them again in the GForge database? Unfortunately, any download statistics since 13-sep will be lost... André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 11:37:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AEbP9i022043; Sat, 10 Oct 2009 11:37:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88EB21A6F3; Sat, 10 Oct 2009 11:36:16 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5819B1A65C for ; Sat, 10 Oct 2009 11:36:05 -0300 (BRT) Received: by vws9 with SMTP id 9so4596141vws.11 for ; Sat, 10 Oct 2009 07:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Sgj8Yj25UN/kDMOXA+gAVRoF12d07//6ISGPW0ZBgWo=; b=Tc45hjd5PH2HEBdYT8vj6wQ7a/KLfCK734KgVLJ4hKLnFA0Uu9cadrXinkrkfFOJlJ t5DZRUX9Wg45PAZ5FY4Nzkq82BlihrJfVA0O9jpT5fBkq9evE3Ac8IKSvNWV7G/o98u6 R6cOZO/UuD2nREqbuer+/zJu6ZHTBI4s6lghg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=ccugwOOMEpms2eUZi4hxeVz6+mUoBHi2254DDvKdFWu/KDXjzqcPQMEPJKnWqpb8VC TU1pSjxtczrNd20ZWAg5kFf5jBtEjguac+mKVe6xOQincASdCaOu9mIbW7lU8VEfHFE6 fDHEhUqha+W8EJzvHZmlA6kWlKhxrRSyX4GQk= MIME-Version: 1.0 Received: by 10.220.114.203 with SMTP id f11mr659691vcq.115.1255185405028; Sat, 10 Oct 2009 07:36:45 -0700 (PDT) In-Reply-To: <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> Date: Sat, 10 Oct 2009 11:36:44 -0300 X-Google-Sender-Auth: 9873c3ae161f7c4f Message-ID: <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AEbP9i022043 OK... this threads really got hot... :o) On Fri, Oct 9, 2009 at 8:21 PM, Jim Whitehead II wrote: > wrote: >> Who is "we" ? Who does the planning and where can I see this planning going >> on? I want to be part of it. > > Most of the initial discussions happened yesterday following the Lua > Workshop.  I'm not sure if all the participants wish to be singled > out, but it involved two individuals from the Kepler team, myself and > two other members of the community.  The discussion has just begun, > hence why I am requesting people contact me to be involved. As one of the participants of this initial discussion, let me try to add some context to the sequence of events. LuaForge went down on the first day of the workshop. After that I asked everybody present for help recovering the site and starting a discussion about what to do after we got the data back. Jim proactively assumed the discussion/implementation coordination while I coordinated the site recovery. Unfortunately, between the first mention of the idea on the Lua list and Jim's return of the workshop enough time passed to accumulate some noise. I also just got time to check the thread now, but I'm pretty sure all he was doing was gathering interested people, not splitting anything. As the current maintainer of LuaForge, I'm all in for the system revamp and I trust Jim to handle the coordination of this. I'm on the fore mentioned list and will be helping migrate data between the two systems (GForge and whatever we choose for the new site). My (late) 2c André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 12:17:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AFHh98025230; Sat, 10 Oct 2009 12:17:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84D7F1A6BC; Sat, 10 Oct 2009 12:16:35 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07D97193F3 for ; Sat, 10 Oct 2009 12:16:29 -0300 (BRT) Received: from [93.172.24.173] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KRB00JSN14JNI00@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Sat, 10 Oct 2009 17:17:08 +0200 (IST) Date: Sat, 10 Oct 2009 17:17:07 +0200 From: Shmuel Zeigerman Subject: Re: LuaForge is back, but not entirely yet In-reply-to: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> To: Lua list Message-id: <4AD0A573.7050004@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andre Carregal wrote: > We already have the GForge web > interface running (which allows for downloads and issue tracking), the > project sites (project_name.luaforge.net) and CVS (pserver only). Currently, when I'm trying to download files, they have a zero size on the destination machine. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 12:36:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AFaFp7026823; Sat, 10 Oct 2009 12:36:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A3EC193FA; Sat, 10 Oct 2009 12:35:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1052193C3 for ; Sat, 10 Oct 2009 12:35:03 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1688949eye.39 for ; Sat, 10 Oct 2009 08:35:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.161.26 with SMTP id n26mr1709264ebo.74.1255188943142; Sat, 10 Oct 2009 08:35:43 -0700 (PDT) In-Reply-To: <92ab989c0910100710g26970ff1w690641fb42513879@mail.gmail.com> References: <92ab989c0910100710g26970ff1w690641fb42513879@mail.gmail.com> Date: Sat, 10 Oct 2009 17:35:43 +0200 X-Google-Sender-Auth: 568b7174b5f7d966 Message-ID: Subject: Re: problems with LuaForge From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AFaFp7026823 2009/10/10 Andre Carregal : > On Sat, Oct 10, 2009 at 4:40 AM, François Perrad > wrote: >> The recovery seems not complete. > > Indeed, please check my previous mail. > >> In my page (fperrad), one of my 3 projects (testlongstring, >> lua-TestLongString) is missing. > > Unfortunately, this was one of the projects registered after 13-Sep so > the registration data was lost. Would you don't mind registering again > the project? > > Let me know if this project had already any files released, issues or > CVS commits. Those are recoverable, but the GForge registration data > was lost (project name, description, members, issues). > OK, I'll redo the project registration. The source is on Github. So nothing is lost, except the registration. François >> When I try to release a file, I obtain the following error : >> File cannot be moved to the permanent location: >> /var/lib/gforge/download//testmore/testmore/lua-TestMore-0.1.0/lua-testmore-0.1.0.tar.gz > > Thanks for the feedback, working on that. > >> I cannot login by ftp on testmore.luaforge.net, lua-coat.luaforge.net, ... > > FTP is not active yet. In fact, the whole site authentication system > is down so no CVS commits either. > > André > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 12:54:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AFsR3L028230; Sat, 10 Oct 2009 12:54:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A44F193FF; Sat, 10 Oct 2009 12:53:20 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1878819391 for ; Sat, 10 Oct 2009 12:53:12 -0300 (BRT) Received: by ey-out-2122.google.com with SMTP id 22so1690651eye.39 for ; Sat, 10 Oct 2009 08:53:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.130.6 with SMTP id h6mr4743479ebn.97.1255190032278; Sat, 10 Oct 2009 08:53:52 -0700 (PDT) In-Reply-To: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> References: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> Date: Sat, 10 Oct 2009 17:53:52 +0200 X-Google-Sender-Auth: 7d4820a8cea79dfd Message-ID: Subject: Re: LuaForge is back, but not entirely yet From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AFsR3L028230 2009/10/10 Andre Carregal : > Hi, > > After a delay longer than most would want (but shorter than I was > expecting) LuaForge is getting up again. > > As many have already noticed, the services are being restored one by > one and some are not functional yet. We already have the GForge web > interface running (which allows for downloads and issue tracking), the > project sites (project_name.luaforge.net) and CVS (pserver only). > > These were the critical services to have back and we will keep > restoring the others during the weekend (and the Brazilian holiday), > meanwhile let us know about any problems found on LuaForge. > What is the status of mailing lists, especially luarocks-developers@lists.luaforge.net ? François. > Unfortunately the data recover wasn't perfect and we lost some data > after Sep-13. This explains why some project are no longer on LuaForge > and why some users can't log in. For those impacted by the data loss, > my sincere apologies. All I can do is ask the involved to please > consider registering again the project and user accounts on LuaForge. > > I'd like to express my sincere gratitude for Alessandro Hecht for his > incredible sprint to bring GForge from the ashes. It was a really hard > work done under significant pressure and he deserves most of the > credits for the recovey. > > Big thanks to Paulo Fernando, Daniel Albuquerque and Rosa Ladeira for > their help with infraestructure. > > A special nod to Jim Whitehead, Norman Clarke, Patrick Donnelly, > Fabien Fleutot and Fabio Mascarenhas for their help figuring out what, > when and how to do things during the crisis. > > Last, but not least, thanks everyone for the patience and, again, my > deep apologies for those that were impacted by the data loss. > > I'll keep the list informed about the site status. > > André > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 13:05:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AG5LZk029401; Sat, 10 Oct 2009 13:05:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 892AE1A6C3; Sat, 10 Oct 2009 13:04:19 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5182C1A65C for ; Sat, 10 Oct 2009 13:04:11 -0300 (BRT) Received: by vws9 with SMTP id 9so4623440vws.11 for ; Sat, 10 Oct 2009 09:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=cY1GGPaLbISW2qw1WCttz9eoI/kXsqPxkQ65wwWBCkM=; b=ovlelWwp9QzcefEf70kGZS6O3N6A0vOUVBQqeVGxxDu6NcA9WiPIfNj3Br0PqJqpPG M4rxGINk6a3GgrfC52q11eEOXn8NHlqVcAgtum3IgR+m3lO4Fvc/RVJh8UK8uBW4He5q 9/Iw6yocAvX/GYjhbTEAPD/qDbAbtgVobB7uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=FgSMlu3xX/jm/OwO5K3U6mY1cLcPfZeNJ6E3+SOBRtrbhByy/CcdA5q8B5XaA6K5gC IUlrQE6F7sML+CgwKPLjfbIsxgIv3q7RBG65DZoJWnVsDT6ypfg1r0xAZc5RlIFx3dc2 M76x4Xtza0D4ufGomiDEAhxSNJpk4Yi4uRlkE= MIME-Version: 1.0 Received: by 10.220.114.203 with SMTP id f11mr752068vcq.115.1255190690164; Sat, 10 Oct 2009 09:04:50 -0700 (PDT) In-Reply-To: References: <92ab989c0910100706x8380a27k8ef3343347917844@mail.gmail.com> Date: Sat, 10 Oct 2009 13:04:50 -0300 X-Google-Sender-Auth: 16ff4ee8408a5a6c Message-ID: <92ab989c0910100904g574b1deayb6b1bfa0748bfdc5@mail.gmail.com> Subject: Re: LuaForge is back, but not entirely yet From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AG5LZk029401 On Sat, Oct 10, 2009 at 12:53 PM, François Perrad wrote: > What is the status of mailing lists, especially > luarocks-developers@lists.luaforge.net ? Mailman is still down... we are trying to figure out why it's not working yet. André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 13:24:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AGOui8030946; Sat, 10 Oct 2009 13:24:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B609F19406; Sat, 10 Oct 2009 13:23:50 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09317193C3 for ; Sat, 10 Oct 2009 13:23:43 -0300 (BRT) Received: by vws9 with SMTP id 9so4629563vws.11 for ; Sat, 10 Oct 2009 09:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jOwu79JDQqs/4cwWAVnk0cCt59/hjVt6B9q0hA3aaas=; b=bKsXNucC6QjhPgzv6XRpsMzeYsyM2nX5fJB+b2Tal8KAbdw7q94r8SeEMmvP/1Vg1x lvpu0pcUFdsMU2Ml49k/N7Vo2bCY2rDChGdddScHt3uzWCOfCW+UljMsFoV8vddgX/3C DNKpBSi8mIEmqhG5ULre5i6AOhiTbCemcMxzs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=I4cGPmvj+/voqcybv+wjVljLKDZJhSNxsk7/WZlI8O/LYN0oQvgGuSMJvEsTSBl6iD fIwmjQGN8mo71gRyfphQHp++HZVq1NIMCAE+Eicb6nMJ1ruGR3EUkpxmwFDTvMo5rBio s2bdYqYx4OfE5PvqYhNBqF+ERaHFZ49MYYwUI= MIME-Version: 1.0 Received: by 10.220.88.140 with SMTP id a12mr6065527vcm.27.1255191864756; Sat, 10 Oct 2009 09:24:24 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2009 13:24:24 -0300 X-Google-Sender-Auth: 796c8a94f02ddf01 Message-ID: <92ab989c0910100924y41bc8778qe103e242274f5218@mail.gmail.com> Subject: Re: problems with LuaForge From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AGOui8030946 On Sat, Oct 10, 2009 at 4:40 AM, François Perrad wrote: > When I try to release a file, I obtain the following error : > File cannot be moved to the permanent location: > /var/lib/gforge/download//testmore/testmore/lua-TestMore-0.1.0/lua-testmore-0.1.0.tar.gz There was a permission error. Can you please try again? André From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 13:52:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9AGpvfV000531; Sat, 10 Oct 2009 13:51:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 500721A65C; Sat, 10 Oct 2009 13:50:55 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2E4D19369 for ; Sat, 10 Oct 2009 13:50:47 -0300 (BRT) Received: by ewy26 with SMTP id 26so8357625ewy.5 for ; Sat, 10 Oct 2009 09:51:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.153.14 with SMTP id f14mr4760701ebo.36.1255193487208; Sat, 10 Oct 2009 09:51:27 -0700 (PDT) In-Reply-To: <92ab989c0910100924y41bc8778qe103e242274f5218@mail.gmail.com> References: <92ab989c0910100924y41bc8778qe103e242274f5218@mail.gmail.com> Date: Sat, 10 Oct 2009 18:51:27 +0200 X-Google-Sender-Auth: e26ed6ed2edcc1f3 Message-ID: Subject: Re: problems with LuaForge From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9AGpvfV000531 2009/10/10 Andre Carregal : > On Sat, Oct 10, 2009 at 4:40 AM, François Perrad > wrote: >> When I try to release a file, I obtain the following error : >> File cannot be moved to the permanent location: >> /var/lib/gforge/download//testmore/testmore/lua-TestMore-0.1.0/lua-testmore-0.1.0.tar.gz > > There was a permission error. Can you please try again? Upload OK. Thanks. > > André > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 20:10:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ANAsGv026861; Sat, 10 Oct 2009 20:10:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C3E218660; Sat, 10 Oct 2009 20:09:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A39E4183B2 for ; Sat, 10 Oct 2009 20:09:32 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MeQHX-1MeORd3qAx-00PrM6; Sat, 10 Oct 2009 19:10:12 -0400 Message-ID: <44B12A677BB74E2C961183E7008DCC9E@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet><560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5fe281d40910100440h9250bc8x3a3c3b9844833a3e@mail.gmail.com> In-Reply-To: <5fe281d40910100440h9250bc8x3a3c3b9844833a3e@mail.gmail.com> Subject: Re: Lua Recipes Site? Date: Sat, 10 Oct 2009 16:09:46 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+njyTUxbtfwsTmwC8VaTHedA2Bmv3tmuS/Nim xYiD1FnDYaNSZiZY+Fvzi+fV52/TuDl4wGasye7O52inUaptrE O6i276gU/oJTVI+rSYB0kmks2Dt4zKi X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lua Recipes ~= LuaForge... -------------------------------------------------- From: "Jim Whitehead II" Sent: Saturday, October 10, 2009 A4:40 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > On Sat, Oct 10, 2009 at 11:51 AM, Stuart P. Bentley > wrote: >> I drew a logo for Lua Recipes, but even after I trimmed it to <40k it got >> bounced, so I'll go upload it somewhere and then post a link. > > Please move this discussion to the google group for luaforge > development. Thanks! > > - Jim >> >> -------------------------------------------------- >> From: "steve donovan" >> Sent: Saturday, October 10, 2009 A1:27 >> Newsgroups: gmane.comp.lang.lua.general >> To: "Lua list" >> Subject: Re: Lua Recipes Site? >> >>> On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley >>> wrote: >>>> >>>> Yeah, a lot of guys are definitely over-thinking this (I haven't read >>>> all >>>> of >>>> the previous comments in the thread yet, but judging from what I've >>>> seen). >>>> The model for a Lua Recipes site isn't Github or LuaRocks; it's >>>> Pastebin >>>> / >>>> Bitbucket. >>> >>> This is totally true. But development hasn't died, it's just gone >>> underground (or underwater). In fact what Yuri, Jim and myself are >>> envisaging is similar to exactly what you are suggesting. However, we >>> did decide to let license information be explicit - it defaults to >>> MIT/X11. >>> >>> steve d. >>> >> > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 20:15:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ANFEnl027194; Sat, 10 Oct 2009 20:15:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60F6C18B7A; Sat, 10 Oct 2009 20:14:15 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A360B185F9 for ; Sat, 10 Oct 2009 20:14:06 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MTAtC-1Mpi6q0xQk-00RYiT; Sat, 10 Oct 2009 19:14:47 -0400 Message-ID: <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com><560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com><457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet><560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> In-Reply-To: <1D99EA267DC948B189409523B6540D1C@Stucomet> Subject: Re: Lua Recipes Site? Date: Sat, 10 Oct 2009 16:14:21 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+ZmnWrf1gLdqXl0bGyLyDHbHL0EC3g7hIEAD9 HGKarKgS7bTNy4QhBvL9PTBf7onx2J23PdnPAf+kZejBsxyF3y VxY78iivnJn5H5maJkmVQs3cxZa3NdY X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I fell asleep: http://img504.imageshack.us/i/luarecipes.png/ -------------------------------------------------- From: "Stuart P. Bentley" Sent: Saturday, October 10, 2009 A3:51 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > I drew a logo for Lua Recipes, but even after I trimmed it to <40k it got > bounced, so I'll go upload it somewhere and then post a link. > > -------------------------------------------------- > From: "steve donovan" > Sent: Saturday, October 10, 2009 A1:27 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: Lua Recipes Site? > >> On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley >> wrote: >>> Yeah, a lot of guys are definitely over-thinking this (I haven't read >>> all of >>> the previous comments in the thread yet, but judging from what I've >>> seen). >>> The model for a Lua Recipes site isn't Github or LuaRocks; it's Pastebin >>> / >>> Bitbucket. >> >> This is totally true. But development hasn't died, it's just gone >> underground (or underwater). In fact what Yuri, Jim and myself are >> envisaging is similar to exactly what you are suggesting. However, we >> did decide to let license information be explicit - it defaults to >> MIT/X11. >> >> steve d. >> > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 20:21:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ANLipG027631; Sat, 10 Oct 2009 20:21:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFB9C18BD6; Sat, 10 Oct 2009 20:20:42 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4549D18B72 for ; Sat, 10 Oct 2009 20:20:33 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0M8ftr-1M21jX3X5n-00vt8n; Sat, 10 Oct 2009 19:21:14 -0400 Message-ID: <4DD8DB0280DF4983892B30B82B4A1662@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com><7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com><5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com><5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com><5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com><5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com><5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> In-Reply-To: <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time Date: Sat, 10 Oct 2009 16:19:41 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX199Bt/KR99yGR8OTIhFG79yFgf9xmdCIOz/bsg VcDnhzEGSTQ3lPMLtRBpgoWKR5EWMscrXuQPNJT0MEk+wYopND Dc0FGINp9U5Dc0ttFEv/+v6erN66AdC X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think this reply (to the Lua Recipes thread) was supposed to go to this thread. -------------------------------------------------- From: "Jim Whitehead II" Sent: Saturday, October 10, 2009 A4:40 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > On Sat, Oct 10, 2009 at 11:51 AM, Stuart P. Bentley > wrote: >> I drew a logo for Lua Recipes, but even after I trimmed it to <40k it got >> bounced, so I'll go upload it somewhere and then post a link. > > Please move this discussion to the google group for luaforge > development. Thanks! > > - Jim >> >> -------------------------------------------------- >> From: "steve donovan" >> Sent: Saturday, October 10, 2009 A1:27 >> Newsgroups: gmane.comp.lang.lua.general >> To: "Lua list" >> Subject: Re: Lua Recipes Site? >> >>> On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley >>> wrote: >>>> >>>> Yeah, a lot of guys are definitely over-thinking this (I haven't read >>>> all >>>> of >>>> the previous comments in the thread yet, but judging from what I've >>>> seen). >>>> The model for a Lua Recipes site isn't Github or LuaRocks; it's >>>> Pastebin >>>> / >>>> Bitbucket. >>> >>> This is totally true. But development hasn't died, it's just gone >>> underground (or underwater). In fact what Yuri, Jim and myself are >>> envisaging is similar to exactly what you are suggesting. However, we >>> did decide to let license information be explicit - it defaults to >>> MIT/X11. >>> >>> steve d. >>> >> > -------------------------------------------------- From: "Andre Carregal" Sent: Saturday, October 10, 2009 A7:36 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: LuaForge is down and will be for some time > OK... this threads really got hot... :o) > > On Fri, Oct 9, 2009 at 8:21 PM, Jim Whitehead II > wrote: >> wrote: >>> Who is "we" ? Who does the planning and where can I see this planning >>> going >>> on? I want to be part of it. >> >> Most of the initial discussions happened yesterday following the Lua >> Workshop. I'm not sure if all the participants wish to be singled >> out, but it involved two individuals from the Kepler team, myself and >> two other members of the community. The discussion has just begun, >> hence why I am requesting people contact me to be involved. > > As one of the participants of this initial discussion, let me try to > add some context to the sequence of events. > > LuaForge went down on the first day of the workshop. After that I > asked everybody present for help recovering the site and starting a > discussion about what to do after we got the data back. > > Jim proactively assumed the discussion/implementation coordination > while I coordinated the site recovery. Unfortunately, between the > first mention of the idea on the Lua list and Jim's return of the > workshop enough time passed to accumulate some noise. > > I also just got time to check the thread now, but I'm pretty sure all > he was doing was gathering interested people, not splitting anything. > > As the current maintainer of LuaForge, I'm all in for the system > revamp and I trust Jim to handle the coordination of this. I'm on the > fore mentioned list and will be helping migrate data between the two > systems (GForge and whatever we choose for the new site). > > My (late) 2c > > André > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 21:34:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B0YV6q000876; Sat, 10 Oct 2009 21:34:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AB3118FF3; Sat, 10 Oct 2009 21:33:21 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE510187DB for ; Sat, 10 Oct 2009 21:33:12 -0300 (BRT) Received: by ewy26 with SMTP id 26so8534299ewy.5 for ; Sat, 10 Oct 2009 17:33:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.88.136 with SMTP id a8mr1336049wef.77.1255221232843; Sat, 10 Oct 2009 17:33:52 -0700 (PDT) Date: Sat, 10 Oct 2009 19:33:52 -0500 Message-ID: <8848311c0910101733m1d787e3ucba5db541cbb5341@mail.gmail.com> Subject: Infinite Loop Detection From: Travis Baker To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e6d64c23b2bc3104759df799 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d64c23b2bc3104759df799 Content-Type: text/plain; charset=ISO-8859-1 I've seen infinite loop detection used in applications before. (Garry's Mod) Does anyone know how to go about creating something like this. It doesn't have to necessarily check for an infinite as much as hit a threshold limit for how many time a loop can repeat itself. Any Ideas? Thanks --0016e6d64c23b2bc3104759df799 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've seen infinite loop detection used in applications before. (Garry&#= 39;s Mod)

Does anyone know how to go about creating something like t= his. It doesn't have to necessarily check for an infinite as much as hi= t a threshold limit for how many time a loop can repeat itself.

Any Ideas? Thanks
--0016e6d64c23b2bc3104759df799-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 22:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B12Nks004033; Sat, 10 Oct 2009 22:02:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BF09190F7; Sat, 10 Oct 2009 22:01:09 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 586AC190D1 for ; Sat, 10 Oct 2009 22:00:59 -0300 (BRT) Received: by fxm12 with SMTP id 12so1819012fxm.5 for ; Sat, 10 Oct 2009 18:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=5Cv9Wu2rSHVEmT5cXWWGP4C/FzVni3NF2yZmVDztMqg=; b=xEQsZHis2T2z609jvwaCHVS8QGKLVh8mHNB1/Y3T4VWKWS+e+EX1oGcTcOgGmWoa6g e/o0I6Ee+2E2fwpAdxQYnuSMBF2gVyFJ2XJTki7T3u5ZnlgEtjBAsemPrv3l/PFaWf0y F2Aln1szBzA/2VpUW6rN5KLbyltW/1+d09DAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=vm0hkRwSuYGqTgqu96h3mK2+2Pjyl4AJ3MM1Wwh0H3HZx4QKjdyTVUlpZdvCBYcL6H +r3RrgZ+2YMM3pvAw8/R5e7O2OBtlREqEJ7wIyz+MlAN+MOqgTxfe43VfBbU4I4avh8f GD/byWv8M6UEav0bz5LXow2XxV8QRq+mKNb/E= MIME-Version: 1.0 Received: by 10.204.156.18 with SMTP id u18mr3675713bkw.102.1255222898953; Sat, 10 Oct 2009 18:01:38 -0700 (PDT) In-Reply-To: <4DD8DB0280DF4983892B30B82B4A1662@Stucomet> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> <4DD8DB0280DF4983892B30B82B4A1662@Stucomet> Date: Sat, 10 Oct 2009 20:01:38 -0500 X-Google-Sender-Auth: 01e34082b6a8a12f Message-ID: <5ba75e2f0910101801i132ba343md16c060c8c07c499@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cabde01904f04759e5bfb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cabde01904f04759e5bfb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm sorry for all the noise. Really. Just would be fine if you provided the link before, google groups already provides an interface to join private groups. Blessings! On Sat, Oct 10, 2009 at 6:19 PM, Stuart P. Bentley w= rote: > I think this reply (to the Lua Recipes thread) was supposed to go to this > thread. > -------------------------------------------------- > From: "Jim Whitehead II" > Sent: Saturday, October 10, 2009 A4:40 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: Lua Recipes Site? > > On Sat, Oct 10, 2009 at 11:51 AM, Stuart P. Bentley >> wrote: >> >>> I drew a logo for Lua Recipes, but even after I trimmed it to <40k it g= ot >>> bounced, so I'll go upload it somewhere and then post a link. >>> >> >> Please move this discussion to the google group for luaforge >> development. Thanks! >> >> - Jim >> >>> >>> -------------------------------------------------- >>> From: "steve donovan" >>> Sent: Saturday, October 10, 2009 A1:27 >>> Newsgroups: gmane.comp.lang.lua.general >>> To: "Lua list" >>> Subject: Re: Lua Recipes Site? >>> >>> On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley >>>> wrote: >>>> >>>>> >>>>> Yeah, a lot of guys are definitely over-thinking this (I haven't read >>>>> all >>>>> of >>>>> the previous comments in the thread yet, but judging from what I've >>>>> seen). >>>>> The model for a Lua Recipes site isn't Github or LuaRocks; it's >>>>> Pastebin >>>>> / >>>>> Bitbucket. >>>>> >>>> >>>> This is totally true. But development hasn't died, it's just gone >>>> underground (or underwater). In fact what Yuri, Jim and myself are >>>> envisaging is similar to exactly what you are suggesting. However, we >>>> did decide to let license information be explicit - it defaults to >>>> MIT/X11. >>>> >>>> steve d. >>>> >>>> >>> >> > -------------------------------------------------- > From: "Andre Carregal" > Sent: Saturday, October 10, 2009 A7:36 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: LuaForge is down and will be for some time > > > OK... this threads really got hot... :o) >> >> On Fri, Oct 9, 2009 at 8:21 PM, Jim Whitehead II >> wrote: >> >>> wrote: >>> >>>> Who is "we" ? Who does the planning and where can I see this planning >>>> going >>>> on? I want to be part of it. >>>> >>> >>> Most of the initial discussions happened yesterday following the Lua >>> Workshop. I'm not sure if all the participants wish to be singled >>> out, but it involved two individuals from the Kepler team, myself and >>> two other members of the community. The discussion has just begun, >>> hence why I am requesting people contact me to be involved. >>> >> >> As one of the participants of this initial discussion, let me try to >> add some context to the sequence of events. >> >> LuaForge went down on the first day of the workshop. After that I >> asked everybody present for help recovering the site and starting a >> discussion about what to do after we got the data back. >> >> Jim proactively assumed the discussion/implementation coordination >> while I coordinated the site recovery. Unfortunately, between the >> first mention of the idea on the Lua list and Jim's return of the >> workshop enough time passed to accumulate some noise. >> >> I also just got time to check the thread now, but I'm pretty sure all >> he was doing was gathering interested people, not splitting anything. >> >> As the current maintainer of LuaForge, I'm all in for the system >> revamp and I trust Jim to handle the coordination of this. I'm on the >> fore mentioned list and will be helping migrate data between the two >> systems (GForge and whatever we choose for the new site). >> >> My (late) 2c >> >> Andr=C3=A9 >> >> --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cabde01904f04759e5bfb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm sorry for all the noise. Really.

Just would be fine if you p= rovided the link before, google groups already provides an interface to joi= n private groups.

Blessings!

On Sa= t, Oct 10, 2009 at 6:19 PM, Stuart P. Bentley <stuart@testtrack4.com> wrot= e:
I think this repl= y (to the Lua Recipes thread) was supposed to go to this thread.
--------------------------------------------------
From: "Jim Whitehead II" <jnwhiteh@gmail.com>
Sent: Saturday, October 10, 2009 A4:40

Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: Lua Recipes Site?

On Sat, Oct 10, 2009 at 11:51 AM, Stuart P. Bentley
<stuart@testt= rack4.com> wrote:
I drew a logo for Lua Recipes, but even after I trimmed it to <40k it go= t
bounced, so I'll go upload it somewhere and then post a link.

Please move this discussion to the google group for luaforge
development. =C2=A0Thanks!

- Jim

--------------------------------------------------
From: "steve donovan" <steve.j.donovan@gmail.com>
Sent: Saturday, October 10, 2009 A1:27

Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: Lua Recipes Site?

On Sat, Oct 10, 2009 at 7:44 AM, Stuart P. Bentley
<stuart@testt= rack4.com> wrote:

Yeah, a lot of guys are definitely over-thinking this (I haven't read a= ll
of
the previous comments in the thread yet, but judging from what I've
seen).
The model for a Lua Recipes site isn't Github or LuaRocks; it's Pas= tebin
/
Bitbucket.

This is totally true. But development hasn't died, it's just gone underground (or underwater). In fact what Yuri, Jim and myself are
envisaging is similar to exactly what you are suggesting. =C2=A0However, we=
did decide to let license information be explicit - it defaults to
MIT/X11.

steve d.




--------------------------------------------------
From: "Andre Carregal" <carregal@fabricadigital.com.br>
Sent: Saturday, October 10, 2009 A7:36

Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: LuaForge is down and will be for some time


OK... this threads really got hot... :o)

On Fri, Oct 9, 2009 at 8:21 PM, Jim Whitehead II <jnwhiteh@gmail.com> wrote:
<cosmin= .apreutesei@gmail.com> wrote:
Who is "we" ? Who does the planning and where can I see this plan= ning going
on? I want to be part of it.

Most of the initial discussions happened yesterday following the Lua
Workshop. =C2=A0I'm not sure if all the participants wish to be singled=
out, but it involved two individuals from the Kepler team, myself and
two other members of the community. =C2=A0The discussion has just begun, hence why I am requesting people contact me to be involved.

As one of the participants of this initial discussion, let me try to
add some context to the sequence of events.

LuaForge went down on the first day of the workshop. After that I
asked everybody present for help recovering the site and starting a
discussion about what to do after we got the data back.

Jim proactively assumed the discussion/implementation coordination
while I coordinated the site recovery. Unfortunately, between the
first mention of the idea on the Lua list and Jim's return of the
workshop enough time passed to accumulate some noise.

I also just got time to check the thread now, but I'm pretty sure all he was doing was gathering interested people, not splitting anything.

As the current maintainer of LuaForge, I'm all in for the system
revamp and I trust Jim to handle the coordination of this. I'm on the fore mentioned list and will be helping migrate data between the two
systems (GForge and whatever we choose for the new site).

My (late) 2c

Andr=C3=A9




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cabde01904f04759e5bfb-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 22:03:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B135qW004120; Sat, 10 Oct 2009 22:03:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E1261A674; Sat, 10 Oct 2009 22:02:03 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFE2619109 for ; Sat, 10 Oct 2009 22:01:54 -0300 (BRT) Received: by yxe17 with SMTP id 17so1589832yxe.33 for ; Sat, 10 Oct 2009 18:02:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.22.2 with SMTP id 2mr2478895agv.104.1255222955539; Sat, 10 Oct 2009 18:02:35 -0700 (PDT) Date: Sun, 11 Oct 2009 04:02:35 +0300 X-Google-Sender-Auth: 17350afec94667ab Message-ID: Subject: luarocks bug report From: Cosmin Apreutesei To: lua Content-Type: multipart/alternative; boundary=00163616403d60fdfa04759e5e14 Cc: luarocks-developers@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163616403d60fdfa04759e5e14 Content-Type: text/plain; charset=UTF-8 Hi, Sorry for spamming this list but the list on luaforge was down. Anytime I try to $luarocks remove I get the error below in both windows and linux. I have luarocks 1.0.1. Checking stability of dependencies on the absence of alien cvs-1... Error: LuaRocks 1.0.1 bug (please report at luarocks-developers@lists.luaforge.net). ...ms/LuaRocks/1.0.1/share/lua/5.1//luarocks/remove.lua:88: attempt to index local 'remaining' (a number value) stack traceback: ...ms/LuaRocks/1.0.1/share/lua/5.1//luarocks/remove.lua:88: in function 'delete_versions' ...ms/LuaRocks/1.0.1/share/lua/5.1//luarocks/remove.lua:141: in function <...ms/LuaRocks/1.0.1/share/lua/5.1//luarocks/remove.lua:111> (tail call): ? [C]: in function 'xpcall' ...Rocks/1.0.1/share/lua/5.1//luarocks/command_line.lua:120: in function 'run_command' /System/Links/Executables/luarocks:20: in main chunk [C]: ? --00163616403d60fdfa04759e5e14 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
Sorry for spamming this list but the list on luaforge wa= s down.

Anytime I try to $luarocks remove <some= -module> I get the error below in both windows and linux. I have luarock= s 1.0.1.

Checking stability of dependencies on the absence of
alien cvs-1...


...ms/LuaRocks/1.0.1/share/lua/5.1//luarocks/remove.lua:88: attempt to= index local 'remaining' (a number value)
stack traceback= :
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0...ms/LuaRocks/1.0.1/share/lua= /5.1//luarocks/remove.lua:88: in function 'delete_versions'
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0...ms/LuaRocks/1.0.1/share/lua/5.1//l= uarocks/remove.lua:141: in function <...ms/LuaRocks/1.0.1/share/lua/5.1/= /luarocks/remove.lua:111>
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0(ta= il call): ?
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0[C]: in function = 9;xpcall'
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0...Rocks/1.0.1/share/lua/5.1//luarock= s/command_line.lua:120: in function 'run_command'
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0/System/Links/Executables/luarocks:20: in main c= hunk
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0[C]: ?

--00163616403d60fdfa04759e5e14-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 22:03:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B13f8b004217; Sat, 10 Oct 2009 22:03:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3720A1914F; Sat, 10 Oct 2009 22:02:38 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73AE91912F for ; Sat, 10 Oct 2009 22:02:29 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0Lz5GC-1MAZun0lHM-014Ruy; Sat, 10 Oct 2009 21:03:10 -0400 Message-ID: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: Kepler graph Date: Sat, 10 Oct 2009 18:02:47 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1/tbl06xsyF9W/hPGrPBk8cB5O0/xy8IFU0N/a ibkOvwI+UIGINPo9iVmbdqHx+qTHIo81XLq7+tClhkIFB798vI sUx/VQXRvqR+qVl/RkSKUedNZ1Oe4Cz X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think I broke it. I made an edit to clarify how Sputnik handles pages and now it's stopped recognizing subgraphs. -------------------------------------------------- From: "Yuri Takhteyev" Sent: Thursday, October 08, 2009 P10:10 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Kepler graph >> Could somebody draw up some sort of flowchart explaining how the >> different >> Kepler projects are related? Even when up, the site is a bit of a mess >> (several pages linked to for explanations are simply blank), and I still >> can't discern the relationship between WSAPI, CGILua, Orbit, Sputnik, >> Cosmo, >> LPeg, Xavante and mod_lua. > > Something like this perhaps: > > http://spu.tnik.org/en/Kepler_Diagram.png > > Feel free to improve: > > http://spu.tnik.org/en/Kepler_Diagram.edit > > (It's a wiki.) > > - yuri > From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 22:09:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B190ox005081; Sat, 10 Oct 2009 22:09:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7846B19131; Sat, 10 Oct 2009 22:07:58 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08F4A19049 for ; Sat, 10 Oct 2009 22:07:49 -0300 (BRT) Received: by yxe17 with SMTP id 17so1591746yxe.33 for ; Sat, 10 Oct 2009 18:08:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.16.40 with SMTP id 40mr756828agp.7.1255223310179; Sat, 10 Oct 2009 18:08:30 -0700 (PDT) In-Reply-To: <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> Date: Sun, 11 Oct 2009 04:08:29 +0300 X-Google-Sender-Auth: fb650adb865bdd98 Message-ID: Subject: Re: Lua Recipes Site? From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001636283bf6845e3904759e732f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636283bf6845e3904759e732f Content-Type: text/plain; charset=UTF-8 > > http://img504.imageshack.us/i/luarecipes.png/ Cheese cake!! http://i1.ytimg.com/vi/Di8Rwfz-Jr8/hqdefault.jpg --001636283bf6845e3904759e732f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --001636283bf6845e3904759e732f-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 22:53:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B1rBef008345; Sat, 10 Oct 2009 22:53:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57AEA192E9; Sat, 10 Oct 2009 22:52:04 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25E2D192DF for ; Sat, 10 Oct 2009 22:51:55 -0300 (BRT) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LbtXw-1MXbnQ0nn2-00jd76; Sat, 10 Oct 2009 21:52:34 -0400 Message-ID: <8339A9E25A6A44468FFCF285762715D1@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <8848311c0910101733m1d787e3ucba5db541cbb5341@mail.gmail.com> In-Reply-To: <8848311c0910101733m1d787e3ucba5db541cbb5341@mail.gmail.com> Subject: Re: Infinite Loop Detection Date: Sat, 10 Oct 2009 18:52:11 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00D0_01CA49DA.C672A220" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+nGd9+dReWVZ90ePoTcUue6zERdLZkHngH/zC KFfsskvmXF9TNrqgHc8GpgR7aDNxaoSFmHASFFvHFDvqg1vodG hF0fi7gMAJ/2omWspjfXiGfr0CQrba9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00D0_01CA49DA.C672A220 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable debug.sethook will let you count the number of line executions. Of course, perfect infinite loop detection is, in fact, impossible = (http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing = it (probably by a C hook). From: Travis Baker=20 Sent: Saturday, October 10, 2009 P5:33 Newsgroups: gmane.comp.lang.lua.general To: lua@bazar2.conectiva.com.br=20 Subject: Infinite Loop Detection I've seen infinite loop detection used in applications before. (Garry's = Mod) Does anyone know how to go about creating something like this. It = doesn't have to necessarily check for an infinite as much as hit a = threshold limit for how many time a loop can repeat itself. Any Ideas? Thanks ------=_NextPart_000_00D0_01CA49DA.C672A220 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
debug.sethook will let you count the number of line=20 executions.
 
Of course, perfect infinite loop detection is, in = fact,=20 impossible (http://en.wikipedia= .org/wiki/Halting_problem).=20 Ask Garry how he's doing it (probably by a C hook).

Sent: Saturday, October 10, 2009 P5:33
Newsgroups: gmane.comp.lang.lua.general
Subject: Infinite Loop Detection

I've seen infinite loop detection used in applications = before.=20 (Garry's Mod)

Does anyone know how to go about creating something = like=20 this. It doesn't have to necessarily check for an infinite as much as = hit a=20 threshold limit for how many time a loop can repeat itself.

Any = Ideas?=20 Thanks
------=_NextPart_000_00D0_01CA49DA.C672A220-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 23:08:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B27xdA009652; Sat, 10 Oct 2009 23:07:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4745A1A685; Sat, 10 Oct 2009 23:06:59 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F2B51A66F for ; Sat, 10 Oct 2009 23:06:51 -0300 (BRT) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9B27WlX014605 for ; Sat, 10 Oct 2009 23:07:32 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 8577D54C23A; Sat, 10 Oct 2009 23:07:33 -0300 (BRT) Date: Sat, 10 Oct 2009 23:07:33 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: LuaForge is down and will be for some time Message-ID: <20091011020733.GA31819@inf.puc-rio.br> References: <7913df4d0910090715t6d526e60g8f52f8500420b7d@mail.gmail.com> <5ba75e2f0910091336t649060cawf6cf3fc850af6d5b@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92ab989c0910100736v5e87d459u79727ed3ea53aa8@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > As the current maintainer of LuaForge, I'm all in for the system > revamp and I trust Jim to handle the coordination of this. I'm on the > fore mentioned list and will be helping migrate data between the two > systems (GForge and whatever we choose for the new site). You and Jim have our full support on that. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 23:52:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B2qe8p012906; Sat, 10 Oct 2009 23:52:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D768E1A684; Sat, 10 Oct 2009 23:51:34 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 306CD1A662 for ; Sat, 10 Oct 2009 23:51:26 -0300 (BRT) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MwoXR-0003Ok-2y for lua@bazar2.conectiva.com.br; Sun, 11 Oct 2009 03:52:01 +0100 Received: from [192.168.2.92] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id F1DFD29183 for ; Sun, 11 Oct 2009 03:51:58 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:12248 with envelope Message-ID: <4AD1483F.80002@cowlark.com> Date: Sun, 11 Oct 2009 03:51:43 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua parser generator? References: <4AD004D8.2010605@cowlark.com> <4AD00CAC.9090607@gmail.com> <4AD03DA7.2050907@cowlark.com> <4AD0560F.8040908@gmail.com> In-Reply-To: <4AD0560F.8040908@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9B2qe8p012906 KHMan wrote: [...] > IIRC it's only one file on LuaForge, it's there [1], but I failed to > download the thing. Attached. Thanks for that --- I've been playing with it. Unfortunately I can't make it work. When running the example grammar (which came back to life on LuaForge), it either produces errors or goes into infinite loops without producing any result. I don't know if this is a problem with the example grammar or the tool, though. It appears that it particularly doesn't like the rules: ss ::= ss s -- ss ::= s ...although if I take them out it just complains about syntax errors no matter what the input is. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Sat Oct 10 23:53:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B2rDpT013099; Sat, 10 Oct 2009 23:53:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C7A11A691; Sat, 10 Oct 2009 23:52:14 -0300 (BRT) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp119.rog.mail.re2.yahoo.com (smtp119.rog.mail.re2.yahoo.com [68.142.224.74]) by bazar2.conectiva.com.br (Postfix) with SMTP id D667F1A662 for ; Sat, 10 Oct 2009 23:52:05 -0300 (BRT) Received: (qmail 9917 invoked from network); 11 Oct 2009 02:52:45 -0000 Received: from unknown (HELO MobileDev) (kenk@99.236.26.122 with login) by smtp119.rog.mail.re2.yahoo.com with SMTP; 11 Oct 2009 02:52:45 -0000 X-YMail-OSG: qnaut4MVM1lS4d4xmwsUw5VLKTMNt_iqy5.l.fphk9kCMdN0d4zcy1XnJUmT1dDVQw-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> From: "Kenk" To: "Lua list" References: <50AF6FBAB3B54DF8BF1B8799D2C2E32E@VADER><89d273ba0907230543v54603e9av7edb1825a4768a04@mail.gmail.com> <4D6EB001315D4F569D614DFCBF062521@VADER> In-Reply-To: <4D6EB001315D4F569D614DFCBF062521@VADER> Subject: Creating nested tables from C into Lua.. Date: Sat, 10 Oct 2009 22:52:42 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dang, these table things are confusing me. I get how to pass a single table back to lua. How do I pass a table structure back that has nested tables in it? So for example, I call a C method from Lua script which has a table type as a return value that looks something like (and could have multiple nested tables etc. But I'm guessing once I understand how to do one nested, it becomes a repeat): { {name="Scooby",age=45, type="Dog",someusertype=},{name="Shaggy",age=24, type="Human",someusertype=}} (Obviously the example setup is built from some values in C and so on); Thanks for the help! From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 00:44:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B3iQIe017110; Sun, 11 Oct 2009 00:44:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE13B1882C; Sun, 11 Oct 2009 01:43:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05A9418814 for ; Sun, 11 Oct 2009 01:43:12 -0200 (BRST) Received: by bwz22 with SMTP id 22so6962930bwz.5 for ; Sat, 10 Oct 2009 20:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=NkBvhVEbUocXl7m+UgQSuNEuuKUQ/XD1eIiEJxzkEmA=; b=LzgMRQ9iD/lkekuUjntRu1fMNrCNByeQ4xyLCTCKsPd6AzNjE/eL80SiPo/q79TSwa /gHxgdoOnkMkTZ1nyX+d36fEPLqj2jb6ssCD/yN5z5IJTemO9RwPMqQNO4DWwHxAMwMw JBo0AOJHufDQFez03HBY01tlQr1nLgR7uN9Xg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=OHewfBIwa5big51ypk5WVAyggRxH9ARYe/AAMOk/t0iSlEPQ9qa/6pi8si1VJYqoEj 7/8+iQbeFRh8KkBW1g4D/RjL9qKn2OjEzS0ZnpsgUYoADdGxbp1Z8XkvW//bM0En1SE4 +qNdzE2c5xwoi/PmLFA0nqMPQZirc3tUntaa0= MIME-Version: 1.0 Received: by 10.204.34.201 with SMTP id m9mr181586bkd.77.1255232632753; Sat, 10 Oct 2009 20:43:52 -0700 (PDT) In-Reply-To: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> References: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> Date: Sat, 10 Oct 2009 23:43:52 -0400 X-Google-Sender-Auth: 7d3a8b8f669e9592 Message-ID: Subject: Re: Kepler graph From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I think I broke it. I made an edit to clarify how Sputnik handles pages and At the moment, the graph sees to have gotten way more complicated than I planned it to be, but it does seem to generate a png. This particular demo is really nothing more than a loose integration of Sputnik with graphviz. Basically, the node's "show" method is set to a function that assumes that the content of the node is graphviz's "dot" code, so it runs it through graphviz and returns the image. If the graph is not what you expect it to be, see graphviz's "dot" file documentation at http://www.graphviz.org/pdf/dotguide.pdf If anyone is interested, the code for this is in Sputnik's git repository under: sputnik-examples/lua/sputnik/actions/graphviz.lua - yuri From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 00:50:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B3odFV017663; Sun, 11 Oct 2009 00:50:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16E6918850; Sun, 11 Oct 2009 01:49:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 304C718814 for ; Sun, 11 Oct 2009 01:49:29 -0200 (BRST) Received: by ewy26 with SMTP id 26so8583869ewy.5 for ; Sat, 10 Oct 2009 20:50:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.9 with SMTP id b9mr1461610wef.61.1255233010807; Sat, 10 Oct 2009 20:50:10 -0700 (PDT) In-Reply-To: <8339A9E25A6A44468FFCF285762715D1@Stucomet> References: <8848311c0910101733m1d787e3ucba5db541cbb5341@mail.gmail.com> <8339A9E25A6A44468FFCF285762715D1@Stucomet> Date: Sat, 10 Oct 2009 22:50:10 -0500 Message-ID: <8848311c0910102050g315fcf3djb5dd13e69f338e1e@mail.gmail.com> Subject: Re: Infinite Loop Detection From: Travis Baker To: Lua list Content-Type: multipart/alternative; boundary=0016e6d77e71b834d40475a0b549 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d77e71b834d40475a0b549 Content-Type: text/plain; charset=ISO-8859-1 I had thought about that, but I'm not sure how to break out of the loop once a threshold was reached. On Sat, Oct 10, 2009 at 8:52 PM, Stuart P. Bentley wrote: > debug.sethook will let you count the number of line executions. > > Of course, perfect infinite loop detection is, in fact, impossible ( > http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing it > (probably by a C hook). > > *From:* Travis Baker > *Sent:* Saturday, October 10, 2009 P5:33 > *Newsgroups:* gmane.comp.lang.lua.general > *To:* lua@bazar2.conectiva.com.br > *Subject:* Infinite Loop Detection > > I've seen infinite loop detection used in applications before. (Garry's > Mod) > > Does anyone know how to go about creating something like this. It doesn't > have to necessarily check for an infinite as much as hit a threshold limit > for how many time a loop can repeat itself. > > Any Ideas? Thanks > --0016e6d77e71b834d40475a0b549 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I had thought about that, but I'm not sure how to break out of the loop= once a threshold was reached.

On Sat, Oc= t 10, 2009 at 8:52 PM, Stuart P. Bentley <stuart@testtrack4.com> wrote:
debug.sethook will let you count the number of line= =20 executions.
=A0
Of course, perfect infinite loop detection is, in fac= t,=20 impossible (http://en.wikipedia.org/wiki/Halting_problem)= .=20 Ask Garry how he's doing it (probably by a C hook).

Sent: Saturday, October 10, 2009 P5:33
Newsgroups: gmane.comp.lang.lua.general
Subject: Infinite Loop Detection

I've seen infinite loop detection used in applications b= efore.=20 (Garry's Mod)

Does anyone know how to go about creating somethin= g like=20 this. It doesn't have to necessarily check for an infinite as much as h= it a=20 threshold limit for how many time a loop can repeat itself.

Any Idea= s?=20 Thanks

--0016e6d77e71b834d40475a0b549-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 00:58:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B3wFtR018220; Sun, 11 Oct 2009 00:58:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06DFF18994; Sun, 11 Oct 2009 01:57:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E2BB1896F for ; Sun, 11 Oct 2009 01:57:08 -0200 (BRST) Received: by qyk26 with SMTP id 26so6976199qyk.5 for ; Sat, 10 Oct 2009 20:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vZrSkT99zx0VTVUWre3MnuTSXXPcgJjm9pBbwiuCTOk=; b=vbWcl0/e85w6MASp29Wjwrksf02yAf2odPQvAfP6NH6Q6RMSQcZhb3ohuIn05CSj8h qSXafbl63THcw9AwBSZpA162NxzB37PUJ66qDMH8AxZshIhDN3z1mH/t7KuaLtzXUeVF bVriVi0hnL2NvJhyhkMOgE3f8/ucLqdHVfH7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=EqbMNNVBZdiIKj7JVZpjfCBGlPyYCClVMGV/Hf9Sk2s3P2YLCYzw+2jZBFwXnADlPp wohhKcwJFFYgzOO5gExzzReiHFbrdaRJ2zB2RDTqBRcYJ1imWQuPo0B0WrB65xc2H8Zn X0mUenS1Np38q5Agyq8JhFGm7Nyl3h+vTXp9w= Received: by 10.224.24.136 with SMTP id v8mr3909739qab.79.1255233469422; Sat, 10 Oct 2009 20:57:49 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 21sm901169qyk.4.2009.10.10.20.57.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 10 Oct 2009 20:57:48 -0700 (PDT) Message-ID: <4AD157AF.4070508@gmail.com> Date: Sun, 11 Oct 2009 11:57:35 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Lua parser generator? References: <4AD004D8.2010605@cowlark.com> <4AD00CAC.9090607@gmail.com> <4AD03DA7.2050907@cowlark.com> <4AD0560F.8040908@gmail.com> <4AD1483F.80002@cowlark.com> In-Reply-To: <4AD1483F.80002@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > KHMan wrote: > [...] >> IIRC it's only one file on LuaForge, it's there [1], but I failed to >> download the thing. Attached. > > Thanks for that --- I've been playing with it. > > Unfortunately I can't make it work. When running the example grammar > (which came back to life on LuaForge), it either produces errors or goes > into infinite loops without producing any result. I don't know if this > is a problem with the example grammar or the tool, though. I downloaded a copy while doing a wide search for Lua parsers, haven't actually touched it... perhaps you can ping the author. At least now I know where it stands. Guess it's in an experimental state, not a mature state. Might not be a good match if you want to get things implemented asap. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 01:50:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B4obY5022400; Sun, 11 Oct 2009 01:50:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 255391A68B; Sun, 11 Oct 2009 02:49:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 449551A662 for ; Sun, 11 Oct 2009 02:49:25 -0200 (BRST) Received: by bwz22 with SMTP id 22so6974291bwz.5 for ; Sat, 10 Oct 2009 21:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=LHzobY2SVcbgmQ6DdQBcRwWszoPQTgntNLees92dJmE=; b=N4BlafL2zKujPebXGaDnKWqMS2ulWXGV6ev0+tODxv71mxasDRWMvJkPBKIsW70m8l 0oUUzkJMbGLeSvI2EeJ72kH/kFCH1xQTbzYxpfaEHNn7f4POP2VocX3epvM7uYxSKcS8 l0lmm5bD2HI8PmEgNQZozsG2P52vuwhYmO8fc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=jtcN8zpVcdGsjt4eXyTHvqdVu4ehf0sHdZbHdKKz1RqMqa6Bu+RZJjYf809xBNRNxg 9dWOYWSOv/KW+MyB2XdsvBYQktohRpSCYIsMTiYa3bH2gl6/Q2Z/K9bLE2ABZ4pTGlHq uSgmYeoL2w8Nz5PHubB5PruQocTMwlCBusCFk= MIME-Version: 1.0 Received: by 10.204.36.210 with SMTP id u18mr3853211bkd.19.1255236605284; Sat, 10 Oct 2009 21:50:05 -0700 (PDT) In-Reply-To: References: From: Hisham Date: Sun, 11 Oct 2009 01:49:44 -0300 Message-ID: <5e7d91620910102149y10e0b906rbfc3aaa37f08927@mail.gmail.com> Subject: Re: luarocks bug report To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 10, 2009 at 10:02 PM, Cosmin Apreutesei wrote: > Hi, > Sorry for spamming this list but the list on luaforge was down. > Anytime I try to $luarocks remove I get the error below in > both windows and linux. I have luarocks 1.0.1. Hi, I could not reproduce it with current svn. I'm about to make a new release anyway, so please give it a try once I announce the tarball. This issue should be fixed then. Thanks for the feedback! -- Hisham From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 02:03:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B533JE023303; Sun, 11 Oct 2009 02:03:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28939192B5; Sun, 11 Oct 2009 03:02:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jor-el.real.com (jor-el.real.com [207.188.23.6]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1E7419092 for ; Sun, 11 Oct 2009 03:01:53 -0200 (BRST) Received: from [10.0.1.6] ([::ffff:64.38.167.24]) (AUTH: PLAIN ddunham, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jor-el.real.com with esmtp; Sat, 10 Oct 2009 22:02:33 -0700 id 0009802B.4AD166E9.0000250C Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: DigiPen Lua Club From: David Dunham In-Reply-To: Date: Sat, 10 Oct 2009 22:02:33 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 9 Oct 2009, at 19:44, Stuart P.Bentley wrote: > I recently started a Lua Club at Digipen (first official meeting > next Monday). I haven't mapped out a schedule/agenda for the class > (in a test run, only one guy showed up and me and a friend pretty > much just explained the ins and outs of Lua to him over a couple of > hours), but I have ordered Lua Programming Gems (which is still on > its way- I already have hard copies of Programming in Lua 2nd > Edition and the Reference Manual) and created a poster (sources > attached). Sounds great! We're certainly using Lua in our games (across the lake). Though I suspect our framework is so specialized we can't really help you. David Dunham Development Manager +1 206 926 5722 GameHouse Studios From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 05:07:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B87X3t016237; Sun, 11 Oct 2009 05:07:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B25611A6CA; Sun, 11 Oct 2009 06:06:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79B421A6AD for ; Sun, 11 Oct 2009 06:06:12 -0200 (BRST) Received: by fxm12 with SMTP id 12so1941201fxm.5 for ; Sun, 11 Oct 2009 01:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=sQLFi/P0Y6lmLsMr6JVZl4TbJKyC1l7wxWZ8DavF78s=; b=aDsjKWSS5Va2T0D81kkYbmleUMzzoVRmlGGaIDh8S11kFrgl4Bm3pJFucsFo6C8oET Di2n7NXqLQON5kIawSIcE/zsj/bkSfU/jDQ7OnINyFzhOKYu8Y4fvZTEc7JA/uCcAsxb Qn8OyN51O8PGlHny6cQLQ2Aya+UlI+NK2Bd2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=dWXQPlaiyrjXQRH5/589EnRISAr4NOp48rcujsUJVb+5qk+Q+56D07//DNhWy7njdy 7anRVc2crxRshpM+MELnNi5k7XvUU2nZ0W5XExseJm68PuLbWoqfzfB8hRTvS3AcSBQ/ ZGnoKgJMFJdsEBm2IpV35jPmqT+JMDNs2F/n0= MIME-Version: 1.0 Received: by 10.223.6.9 with SMTP id 9mr1306622fax.84.1255248413173; Sun, 11 Oct 2009 01:06:53 -0700 (PDT) In-Reply-To: <44B12A677BB74E2C961183E7008DCC9E@Stucomet> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5fe281d40910100440h9250bc8x3a3c3b9844833a3e@mail.gmail.com> <44B12A677BB74E2C961183E7008DCC9E@Stucomet> From: Jim Whitehead II Date: Sun, 11 Oct 2009 09:06:33 +0100 Message-ID: <5fe281d40910110106m61ed1f15m2302655bbf508ec0@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 11, 2009 at 12:09 AM, Stuart P. Bentley wrote: > Lua Recipes ~= LuaForge... In fact, the snippets project that has been previously discussed will be a portion of the same Luaforge website that we're currently discussing. - Jim From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 06:29:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B9TsU8021445; Sun, 11 Oct 2009 06:29:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 959671A6C6; Sun, 11 Oct 2009 07:28:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92AA21A6A4 for ; Sun, 11 Oct 2009 07:28:35 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id E0A0C1AA92F5 for ; Sun, 11 Oct 2009 05:29:15 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9B9TEOb032198 for lua@bazar2.conectiva.com.br; Sun, 11 Oct 2009 05:29:14 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Sun, 11 Oct 2009 05:29:14 -0400 From: Sean Conner To: Lua list Subject: Re: Creating nested tables from C into Lua.. Message-ID: <20091011092914.GA15608@brevard.conman.org> References: <4D6EB001315D4F569D614DFCBF062521@VADER> <6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Kenk once stated: > Dang, these table things are confusing me. I get how to pass a single table > back to lua. How do I pass a table structure back that has nested tables in > it? So for example, I call a C method from Lua script which has a table > type as a return value that looks something like (and could have multiple > nested tables etc. But I'm guessing once I understand how to do one nested, > it becomes a repeat): > > { {name="Scooby",age=45, > type="Dog",someusertype=},{name="Shaggy",age=24, > type="Human",someusertype=}} > > (Obviously the example setup is built from some values in C and so on); > > Thanks for the help! What follows is a function I wrote (as an exercise to learn the Lua API) that returns a table structured as: { cwd = "/home/spc/source/lua/C" , pid = 864 , loadave = { 0.00, 0.00, 0.00 } } It also sets a metatable on the loadave table to pretty print the results, and to make it read-only. The functions defined are left as an exercise for the reader. -spc (Hope this helps some ... ) static int info(lua_State *L) { lua_newtable(L); lua_pushliteral(L,"pid"); lua_pushnumber(L,getpid()); lua_settable(L,-3); char buffer[FILENAME_MAX]; /* valid C99 syntax here */ getcwd(buffer,FILENAME_MAX); lua_pushliteral(L,"cwd"); lua_pushlstring(L,buffer,strlen(buffer)); lua_settable(L,-3); double load[3]; /* and C99 here as well */ if (getloadavg(load,3) != -1) { /*---------------------------------------------- ; equiv of ; loadave = {} ; loadave[1] = x; ; loadave[2] = y; ; loadave[3] = z; ;----------------------------------------------*/ lua_pushliteral(L,"loadave"); lua_createtable(L,3,0); lua_pushnumber(L,1); lua_pushnumber(L,load[0]); lua_settable(L,-3); lua_pushnumber(L,2); lua_pushnumber(L,load[1]); lua_settable(L,-3); lua_pushnumber(L,3); lua_pushnumber(L,load[2]); lua_settable(L,-3); /*--------------------------------------------- ; mt = {} ; mt.__tostring = silly_loadave__toprint ; mt.__newindex = silly_loadave__newindex ; setmetable(loadave,mt); ;---------------------------------------------*/ lua_createtable(L,0,2); lua_pushliteral(L,"__tostring"); lua_pushcfunction(L,silly_loadave__toprint); lua_settable(L,-3); lua_pushliteral(L,"__newindex"); lua_pushcfunction(L,silly_loadave__newindex); lua_settable(L,-3); lua_setmetatable(L,-2); lua_settable(L,-3); } return 1; } From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 06:41:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9B9fkJW022185; Sun, 11 Oct 2009 06:41:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4CE41A6D0; Sun, 11 Oct 2009 07:40:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49C401A6A4 for ; Sun, 11 Oct 2009 07:40:38 -0200 (BRST) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id 7E165EF55B for ; Sun, 11 Oct 2009 12:41:17 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A02CC4730E6; Sun, 11 Oct 2009 12:41:17 +0300 Received: from [192.168.1.4] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 67E5C4047 for ; Sun, 11 Oct 2009 12:41:15 +0300 (EEST) Message-Id: <41E36E03-93E8-44AA-A5A6-AE79412C6B49@dnainternet.net> From: Asko Kauppi To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: LNUM patch gets slight behavioural change Date: Sun, 11 Oct 2009 12:41:16 +0300 X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Based on request, I've changed the LNUM patch behaviour to be more in- line with standard Lua. << 10-Oct-09 AK: Made hex value handling same as with standard Lua with modes where this is possible without sacrificing bitwise resolution (i.e. ldouble and double+int32 modes). For double+int32 (new): 0xffffffff = 2^32-1 0xdeadbeef > 0 For i.e. float+int32 (like it was): 0xffffffff = -1 0xdeadbeef < 0 In other words, hex integers with topmost bit set are now stored (unsigned) as floating point when doing so would not endanger losing their least significant bit accuracy. << The changed patch is _not_ uploaded to LuaForge or anywhere. To get it you have to do a svn checkout: svn co svn://slugak.dyndns.org/public/2009/LNUM2 The LNUM patch, also known as "integer patch" allows Lua 5.1 to treat pure integer operations with full accuracy and more speed on non-FP platforms, without changing the external interfaces. - asko From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 08:24:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BBOMWP028812; Sun, 11 Oct 2009 08:24:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AAFE1888F; Sun, 11 Oct 2009 09:23:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57EA31877F for ; Sun, 11 Oct 2009 09:22:54 -0200 (BRST) Received: by bwz22 with SMTP id 22so7060149bwz.5 for ; Sun, 11 Oct 2009 04:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:resent-to:from:to:in-reply-to :resent-from:subject:references:message-id:content-type :content-transfer-encoding:resent-date:mime-version:date:x-mailer; bh=ItJHFH1DL+2JLj17Q4gUjtUewF/XPjTy6q2DyhReVjo=; b=x/Uz1cl2P+2aPG2NhFdKXzvKSRGpcaULv2Zr1HIuHNO7ymvIGt1SlLs3TMfUzw8O0d O63bfjNzYTo0xZv9Zel4/tArqH7FnR62BdbdiTtl14Jw5F51i83jqECYY4fbgSD5SnxV NhvqVL2s+grh/aHZtYiYxC/ZTR82eB6xKkDXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=resent-to:from:to:in-reply-to:resent-from:subject:references :message-id:content-type:content-transfer-encoding:resent-date :mime-version:date:x-mailer; b=cXLDyGHJSHzrPNgCDVkIY94j3IV7zhSqRSP5UMWo/paXc3C7NZjVhBZutLK9KFZXoh NaJiDPF+PBJL3VXNevhORPyi9aAzZZrDxyPt99lgI4aSJrowbwsCsVFkMCd6UPOO5Gje 2lcEsJuCLKdH8bCPGIKJkH2Bg9qwJMBBgHm5A= Received: by 10.103.85.28 with SMTP id n28mr1909304mul.66.1255260213922; Sun, 11 Oct 2009 04:23:33 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 23sm6139800mum.36.2009.10.11.04.23.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 04:23:33 -0700 (PDT) Resent-To: Lua list From: Petite Abeille To: luaforge-development@googlegroups.com In-Reply-To: <92ab989c0910071435j1c5be712t80843b3f7fc6762@mail.gmail.com> Resent-From: Petite Abeille Subject: Re: LuaForge is down and will be for some time References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> <92ab989c0910071435j1c5be712t80843b3f7fc6762@mail.gmail.com> Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Resent-Date: Sun, 11 Oct 2009 13:23:02 +0200 Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 11 Oct 2009 13:07:57 +0200 X-Mailer: Apple Mail (2.936) Resent-Message-Id: <20091011112254.57EA31877F@bazar2.conectiva.com.br> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, [The thread seems to have moved here] [luaforge-development@googlegroups.com seems to be moderated, sigh] On Oct 7, 2009, at 11:35 PM, Andre Carregal wrote: >> If one would want to attempt such feat, would it be possible to get >> a data >> dump of the current luaforge content? > > Sure, we could export things directly from postgres. Cool. Could I have an export then? And... best of luck with the new site :) (After perusing the luaforge-development mails, you seems to have decided on the hammer upfront, now you simply need to make everything look like a nail :P) Cheers, PA. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 08:35:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BBZdV6030261; Sun, 11 Oct 2009 08:35:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15DDB190E0; Sun, 11 Oct 2009 09:34:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DE9B18861 for ; Sun, 11 Oct 2009 09:34:31 -0200 (BRST) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BBZCfI030230 for ; Sun, 11 Oct 2009 08:35:12 -0300 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 6B662D7F2; Sun, 11 Oct 2009 08:35:09 -0300 (BRT) Date: Sun, 11 Oct 2009 08:35:09 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Creating nested tables from C into Lua.. Message-ID: <20091011113509.GA11686@magritte.tecgraf.puc-rio.br> References: <4D6EB001315D4F569D614DFCBF062521@VADER> <6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > { {name="Scooby",age=45, > type="Dog",someusertype=},{name="Shaggy",age=24, > type="Human",someusertype=}} My lua2c, which is for Lua 4, still works on this piece of code and generates correct C code for Lua 5.1: /* This C code was generated by lua2c from the Lua code below. return { {name="Scooby",age=45, type="Dog",someusertype="userdata"},{name="Shaggy",age=24, type="Human",someusertype="userdata"}} */ static int MAIN(lua_State *L) { lua_newtable(L); lua_newtable(L); lua_pushliteral(L,"name"); lua_pushliteral(L,"Scooby"); lua_pushliteral(L,"age"); lua_pushnumber(L,45); lua_pushliteral(L,"type"); lua_pushliteral(L,"Dog"); lua_pushliteral(L,"someusertype"); lua_pushliteral(L,"userdata"); lua_settable(L,-9); lua_settable(L,-7); lua_settable(L,-5); lua_settable(L,-3); lua_newtable(L); lua_pushliteral(L,"name"); lua_pushliteral(L,"Shaggy"); lua_pushliteral(L,"age"); lua_pushnumber(L,24); lua_pushliteral(L,"type"); lua_pushliteral(L,"Human"); lua_pushliteral(L,"someusertype"); lua_pushliteral(L,"userdata"); lua_settable(L,-9); lua_settable(L,-7); lua_settable(L,-5); lua_settable(L,-3); lua_rawseti(L,-3,2); lua_rawseti(L,-2,1); return 1; return 0; } From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 08:42:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BBgfCc030723; Sun, 11 Oct 2009 08:42:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD77818AE7; Sun, 11 Oct 2009 09:41:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B897918A22 for ; Sun, 11 Oct 2009 09:41:30 -0200 (BRST) Received: by fxm12 with SMTP id 12so2014342fxm.5 for ; Sun, 11 Oct 2009 04:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8zT77uRJcIeX/cZr6I9DmbHpXca38q3ElsCjVLF9x/o=; b=VNOVSh40vwDMYUYxt8Vx1u45ip7V7d10fXybBNQGq9biEUkO5CNXQHmYKuMJIQO1Ys QJMfEcA17Lyj6mhkizwvvxyeVDE46gp91PqlyBZZG+aIvNcykjyMCKQ+z6vpdPQBoUgB 7iKsWGwTZbZ1+KxZLhIhz2uzEbaKE/fTbHw8c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=H5h7GjfzrbmG8FEISdhmdL0v9Vh8ZP0gZvX5ArykvFxtc70ShjAa3MxpOu+4TF4j9y icE1Z3RRk0xe4XE1gRvU9vUwU3NQtjlVPaBesIvnq14SRVOuACyG3toBLzxXFyM7GLAF KbrWuzvz4yZyc/9+bgeWUzxEhffWBXIfpUDMU= MIME-Version: 1.0 Received: by 10.204.153.24 with SMTP id i24mr4078242bkw.114.1255261331126; Sun, 11 Oct 2009 04:42:11 -0700 (PDT) In-Reply-To: <41E36E03-93E8-44AA-A5A6-AE79412C6B49@dnainternet.net> References: <41E36E03-93E8-44AA-A5A6-AE79412C6B49@dnainternet.net> Date: Sun, 11 Oct 2009 13:42:11 +0200 Message-ID: <4ff79edb0910110442j28d481bag87d5f591eced44cd@mail.gmail.com> Subject: Re: LNUM patch gets slight behavioural change From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=0015175dd9cebdf9da0475a74dfd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175dd9cebdf9da0475a74dfd Content-Type: text/plain; charset=ISO-8859-1 Hi Asko, just a small question, did you fix also the bug with arithmetic operator overload with complex number ? The problem arise, if you remember, in the case: z * t where z is a complex number and t is a table with a '__mul' metamethod. In GSL shell the problem arise when you write somethng like: > print(4i * m) where m is a GSL matrix. Thanks in advance. Francesco 2009/10/11 Asko Kauppi > > Based on request, I've changed the LNUM patch behaviour to be more in-line > with standard Lua. > > << > 10-Oct-09 AK: Made hex value handling same as with standard Lua with modes > where this is > possible without sacrificing bitwise resolution (i.e. ldouble and > double+int32 modes). > > For double+int32 (new): > 0xffffffff = 2^32-1 > 0xdeadbeef > 0 > > For i.e. float+int32 (like it was): > 0xffffffff = -1 > 0xdeadbeef < 0 > > In other words, hex integers with topmost bit set are now stored (unsigned) > as floating point > when doing so would not endanger losing their least significant bit > accuracy. > << > > The changed patch is _not_ uploaded to LuaForge or anywhere. To get it you > have to do a svn checkout: > > svn co svn://slugak.dyndns.org/public/2009/LNUM2 > > The LNUM patch, also known as "integer patch" allows Lua 5.1 to treat pure > integer operations with full accuracy and more speed on non-FP platforms, > without changing the external interfaces. > > - asko > > > --0015175dd9cebdf9da0475a74dfd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Asko,

just a small question, did you fix also the bug with a= rithmetic operator overload with complex number ? The problem arise, if you= remember, in the case:

z * t

where z is a complex number and t is a table with a '__mul' me= tamethod. In GSL shell the problem arise when you write somethng like:

> print(4i * m)

where m is= a GSL matrix.

Thanks in advance.

Francesco


--0015175dd9cebdf9da0475a74dfd-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 09:27:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BCRqqI001033; Sun, 11 Oct 2009 09:27:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CF831912F; Sun, 11 Oct 2009 10:26:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s8.cableone.net (s8.cableone.net [24.116.0.234]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24B6418F02 for ; Sun, 11 Oct 2009 10:26:34 -0200 (BRST) Received: from [192.168.0.128] (unverified [24.117.232.207]) by s8.cableone.net (CableOne SMTP Service s8) with ESMTP id 24780947-1872270 for ; Sun, 11 Oct 2009 05:27:12 -0700 Message-Id: <1E18532C-14EA-4866-8FF1-D2566F66BEFF@irayo.net> From: Irayo To: Lua list In-Reply-To: <8848311c0910102050g315fcf3djb5dd13e69f338e1e@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-1--68559898 Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Infinite Loop Detection Date: Sun, 11 Oct 2009 07:27:10 -0500 References: <8848311c0910101733m1d787e3ucba5db541cbb5341@mail.gmail.com> <8339A9E25A6A44468FFCF285762715D1@Stucomet> <8848311c0910102050g315fcf3djb5dd13e69f338e1e@mail.gmail.com> X-Vpipe: Scanner said ok (av_avast) X-IP-stats: Incoming Outgoing Last 1, First 92, in=37, out=1, spam=0 Known=true ip=24.117.232.207 X-Originating-IP: 24.117.232.207 X-Abuse-Info: Send abuse complaints to abuse@cableone.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1--68559898 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Oct 10, 2009, at 10:50 PM, Travis Baker wrote: > I had thought about that, but I'm not sure how to break out of the > loop once a threshold was reached. In most cases it's easier and more logical just to shutdown the script. Breaking the loop would probably screw something up and you'd have to reset anyway. > > On Sat, Oct 10, 2009 at 8:52 PM, Stuart P. Bentley > wrote: > debug.sethook will let you count the number of line executions. > > Of course, perfect infinite loop detection is, in fact, impossible (http://en.wikipedia.org/wiki/Halting_problem > ). Ask Garry how he's doing it (probably by a C hook). > > From: Travis Baker > Sent: Saturday, October 10, 2009 P5:33 > Newsgroups: gmane.comp.lang.lua.general > To: lua@bazar2.conectiva.com.br > Subject: Infinite Loop Detection > > I've seen infinite loop detection used in applications before. > (Garry's Mod) > > Does anyone know how to go about creating something like this. It > doesn't have to necessarily check for an infinite as much as hit a > threshold limit for how many time a loop can repeat itself. > > Any Ideas? Thanks > --Apple-Mail-1--68559898 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On Oct 10, 2009, at 10:50 PM, Travis Baker <echo1001@ungclan.com> wrote:

I had thought about that, but I'm not sure how to break out of the loop once a threshold was reached.

In most cases it's easier and more logical just to shutdown the script. Breaking the loop would probably screw something up and you'd have to reset anyway.



On Sat, Oct 10, 2009 at 8:52 PM, Stuart P. Bentley <stuart@testtrack4.com> wrote:
debug.sethook will let you count the number of line executions.
 
Of course, perfect infinite loop detection is, in fact, impossible (http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing it (probably by a C hook).

Sent: Saturday, October 10, 2009 P5:33
Newsgroups: gmane.comp.lang.lua.general
Subject: Infinite Loop Detection

I've seen infinite loop detection used in applications before. (Garry's Mod)

Does anyone know how to go about creating something like this. It doesn't have to necessarily check for an infinite as much as hit a threshold limit for how many time a loop can repeat itself.

Any Ideas? Thanks

--Apple-Mail-1--68559898-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 09:34:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BCYIxC001517; Sun, 11 Oct 2009 09:34:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EF38321B3; Sun, 11 Oct 2009 10:33:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D6151911E for ; Sun, 11 Oct 2009 10:33:11 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1775331eye.39 for ; Sun, 11 Oct 2009 05:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=Gk1qp8KA1oqYSM9mihckqFQKAIUjxJwqyHG0/XL8iy8=; b=mw8uxBUHW+i+cWHPHhIPB+oMCNkhwuoZkVmq/nlxyd8N5K9SgoE7h6deXxZR2emcTS Mv6GhnGszkWk17pq1jlDyMygHaKGcY4b8zeUJVyuCyZXJvIuOeES54fivGjCb+MybvlZ GWklwvRNHaA6J3J0lNmVVU7+/Xn1AxV1nsiSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=BeR/rBesML9gQDxkHIYJzbTjmTEhcc65n3WEngflRM+YAegt+WE2zYHRLOrBkNFh/v KBwdGQ00+evWrnjaE786tyYlbq6Res5ayXyWLyLFJ2TSp6bpX2AG0DJzNsMKVPmxhK/g sc4e9f4wCyeC4WBCmP3Rc61mEv64fpAuSEzcc= MIME-Version: 1.0 Received: by 10.216.85.133 with SMTP id u5mr1608787wee.91.1255264432146; Sun, 11 Oct 2009 05:33:52 -0700 (PDT) From: Jerome Vuarand Date: Sun, 11 Oct 2009 14:33:32 +0200 Message-ID: <89d273ba0910110533o16cbb330mf86addd3981e15a2@mail.gmail.com> Subject: Bug in lfs.attributes To: Lua Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi list, I originally sent that email to an address on Luaforge but it bounced back, so here it is (assuming lfs maintainers read that list). While patching lfs on windows to get access to unicode filenames, I found an unrelated bug in lfs.attributes implementation. If the second argument of the function is a table, lfs.attributes is meant to push the output information in that table. But it assumes that the table is the last argument passed to the function. Specifically it calls lua_rawset (L, -3) in the final for loop without having previously made sure the table is on the top of the stack (with pushvalue or settop). So if you pass additionnal parameters to lfs.attributes, lua_rawset is then called on the last value, and if it's not a table it can even segfault (had someone make the test with nil). Since there are many ways to fix it I'll let the lfs authors pick one, I guess they know Lua API enough to find one :-) Doub. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 10:20:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BDK9AV004639; Sun, 11 Oct 2009 10:20:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B0B1192AA; Sun, 11 Oct 2009 11:19:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A72E18A9B for ; Sun, 11 Oct 2009 11:18:56 -0200 (BRST) Received: by fxm12 with SMTP id 12so2050566fxm.5 for ; Sun, 11 Oct 2009 06:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8C853Cb0Gh3DIZAAJAEY7ElJYiB5mQ6JLgtO3RI24rY=; b=N4VIVuwCRBJjovs1KX1GPDhK6cuJkC9tmzK65X4JO06NvpbbStNcpV7Vf369j7Q7u4 quMD861KqTf0e9XJeFK88mnHfv+R6hM1pMy0inK1M/KC7mk+DlYUqb1i+WwsH29d9YqF 3k3OsVRC1XySJ5h2BbQpKybfmZc0vT6Z4eRVg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fTwUwbl3jGdor6vG92rzPkDrLgm/xHrJr32zlMwvltXXS7kMs7rfyOp4YBji4Mx72Y 7Dqk2MT1ADTI5pqSa661nK9UubfOvDnKqwZ6SYWpkD2EXk/IaZouR8MkKDbcVGPDwI6p 8pFhZyCq0+muBAf8x+K+TaIof3zqKEdKlXHSE= MIME-Version: 1.0 Received: by 10.239.181.164 with SMTP id m36mr284499hbg.184.1255267176344; Sun, 11 Oct 2009 06:19:36 -0700 (PDT) In-Reply-To: References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> <92ab989c0910071435j1c5be712t80843b3f7fc6762@mail.gmail.com> Date: Sun, 11 Oct 2009 15:19:36 +0200 Message-ID: <560972290910110619u7d7ef6a3m6a38b9581cfeedb1@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 11, 2009 at 1:07 PM, Petite Abeille wrote: > (After perusing the luaforge-development mails, you seems to have decided on > the hammer upfront, now you simply need to make everything look like a nail > :P) But such a _nice_ hammer! ;) Seriously, the gang is mostly focussing on requirements. I'm doing a LuaRecipes prototype using Sputnik, mostly because I was the person who opened his mouth up first. That might feed into the discussions, but it is too early to say what exactly the nails are, let alone what the hammer is. steve d. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 10:56:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BDum9N007253; Sun, 11 Oct 2009 10:56:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F0C51A660; Sun, 11 Oct 2009 11:55:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2103B1A59E for ; Sun, 11 Oct 2009 11:55:24 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LbcIN-1MYtHm1bPH-00l1Kk; Sun, 11 Oct 2009 09:56:05 -0400 Message-ID: <5BEF5C46AA0E42AEBD5C9F62F08E993A@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> In-Reply-To: Subject: Re: Kepler graph Date: Sun, 11 Oct 2009 06:55:48 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+1UICZbUQynjwK9w1YGfOEd5mpMTqtPRpCP4z 83B1/EMGEMdiizQZo+FLFCCEzUGHAYORdQh0AhlnWVQXBUyWTr RNbmiMy/l02nysgdeffouvdPVgZPPxz X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I mean I broke something dot-wise. The things in subgraphs that were originally in their own private rectangles are now all over the place and the rectangles have disappeared. -------------------------------------------------- From: "Yuri Takhteyev" Sent: Saturday, October 10, 2009 P8:43 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Kepler graph >> I think I broke it. I made an edit to clarify how Sputnik handles pages >> and > > At the moment, the graph sees to have gotten way more complicated than > I planned it to be, but it does seem to generate a png. > > This particular demo is really nothing more than a loose integration > of Sputnik with graphviz. Basically, the node's "show" method is set > to a function that assumes that the content of the node is graphviz's > "dot" code, so it runs it through graphviz and returns the image. If > the graph is not what you expect it to be, see graphviz's "dot" file > documentation at http://www.graphviz.org/pdf/dotguide.pdf > > If anyone is interested, the code for this is in Sputnik's git repository > under: > > sputnik-examples/lua/sputnik/actions/graphviz.lua > > - yuri > From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 11:00:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BE0dbS007610; Sun, 11 Oct 2009 11:00:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77B461A668; Sun, 11 Oct 2009 11:59:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD0C51A59E for ; Sun, 11 Oct 2009 11:59:30 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MGCRL-1N2jrJ1Ern-00Eglu; Sun, 11 Oct 2009 10:00:11 -0400 Message-ID: <8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com><560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com><457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet><560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com><1D99EA267DC948B189409523B6540D1C@Stucomet><5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> In-Reply-To: Subject: Re: Lua Recipes Site? Date: Sun, 11 Oct 2009 06:59:57 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00FC_01CA4A40.7173FE70" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1/rwpnp+HlC01AqB6HBV9X0m7FQTHNXmszYqSi kikxbaxhuQ7qV1DfYSDEZaIfmy3tLGykv2yw+Irc7LL8RgRVT8 6vUYkE1ihfXUQ4BaiWgiaHRktPdOxiM X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00FC_01CA4A40.7173FE70 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It's supposed to be a cookie... From: Cosmin Apreutesei=20 Sent: Saturday, October 10, 2009 P6:08 Newsgroups: gmane.comp.lang.lua.general To: Lua list=20 Subject: Re: Lua Recipes Site? http://img504.imageshack.us/i/luarecipes.png/ Cheese cake!! http://i1.ytimg.com/vi/Di8Rwfz-Jr8/hqdefault.jpg=20 ------=_NextPart_000_00FC_01CA4A40.7173FE70 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It's supposed to be a = cookie...

Sent: Saturday, October 10, 2009 P6:08
Newsgroups: gmane.comp.lang.lua.general
Subject: Re: Lua Recipes Site?

http://img504.imageshack.us/i/luarecipes.png/
 
Cheese cake!! http://i1.ytimg= .com/vi/Di8Rwfz-Jr8/hqdefault.jpg 

------=_NextPart_000_00FC_01CA4A40.7173FE70-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 11:04:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BE4Klp007890; Sun, 11 Oct 2009 11:04:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F388E19292; Sun, 11 Oct 2009 12:03:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B316719287 for ; Sun, 11 Oct 2009 12:03:12 -0200 (BRST) Received: by fxm12 with SMTP id 12so2068798fxm.5 for ; Sun, 11 Oct 2009 07:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GTJ3kKBjBPxx+7Xubi73hpww0pzqLcEcP8lU5adFYcQ=; b=SsN7HnqT3ToljMo9CTG9xH9oaAr/+UOs482cgNBBhWLjLh7+1zHXvyabwReLcLS8dM d/XwxWLcdXWmRx86lJcDcGINNfYlp49lYevllDLT18CaGDYWbUfQCu9yPfXNVakPtvlP jAvxbFQPImf0wG7SPg/xlZVugG+5e/+ni9YT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=e3NERyKiOwMyrYbdY9oFq50+cEenJYIIN97TBEQOA5B6N2WvL81wd9C4i5F7fiI3Qr JP4rQKDbXxqpaYPIKtBgUsUCRn1SSQjSMCiDyAU+X2CPAJjqy05mDHSNV/gX08mJqNMR 8GtRG45VfF5rVKMSqHdPiz09zuUpHo5ClHuw8= MIME-Version: 1.0 Received: by 10.239.168.221 with SMTP id l29mr331409hbe.118.1255269833362; Sun, 11 Oct 2009 07:03:53 -0700 (PDT) In-Reply-To: <8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> <8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> Date: Sun, 11 Oct 2009 16:03:53 +0200 Message-ID: <560972290910110703y66e40566m2df9def3f425e57d@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 11, 2009 at 3:59 PM, Stuart P. Bentley wrote: > It's supposed to be a cookie... OK, but it _is_ a humongous cookie, considering the size of the coffie cup. It's rather cool, the colour coordination with the logo needs a little tweak? From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 12:11:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BFBVSZ013378; Sun, 11 Oct 2009 12:11:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D7181A68A; Sun, 11 Oct 2009 13:10:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29C511A5DE for ; Sun, 11 Oct 2009 13:10:16 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BFAvQR013335 for ; Sun, 11 Oct 2009 12:10:57 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9BFAuR15764; Sun, 11 Oct 2009 12:10:56 -0300 Date: Sun, 11 Oct 2009 12:10:55 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Bug in lfs.attributes Message-ID: <20091011121054.A15734@lua.tecgraf.puc-rio.br> References: <89d273ba0910110533o16cbb330mf86addd3981e15a2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <89d273ba0910110533o16cbb330mf86addd3981e15a2@mail.gmail.com>; from jerome.vuarand@gmail.com on Sun, Oct 11, 2009 at 02:33:32PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > But it assumes that the table is the last argument passed to the > function. Specifically it calls lua_rawset (L, -3) in the final for > loop without having previously made sure the table is on the top of > the stack (with pushvalue or settop). So if you pass additionnal > parameters to lfs.attributes, lua_rawset is then called on the last > value, and if it's not a table it can even segfault (had someone make > the test with nil). I've been bitten by this kind of bug more than twice. This is definitely something to keep in mind when using the C API. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 12:47:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BFl28I016211; Sun, 11 Oct 2009 12:47:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84AAF1A6AB; Sun, 11 Oct 2009 13:45:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh07.mail.saunalahti.fi (emh07.mail.saunalahti.fi [62.142.5.117]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 751091A68E for ; Sun, 11 Oct 2009 13:45:29 -0200 (BRST) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 5EF0518D29F for ; Sun, 11 Oct 2009 18:46:05 +0300 (EEST) Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A0468D5DE55; Sun, 11 Oct 2009 18:46:05 +0300 Received: from [192.168.1.4] (a88-112-248-104.elisa-laajakaista.fi [88.112.248.104]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 58363158A65 for ; Sun, 11 Oct 2009 18:46:02 +0300 (EEST) Message-Id: <7D76BD62-029F-4513-8678-EA062D3509B4@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <4ff79edb0910110442j28d481bag87d5f591eced44cd@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LNUM patch gets slight behavioural change Date: Sun, 11 Oct 2009 18:46:01 +0300 References: <41E36E03-93E8-44AA-A5A6-AE79412C6B49@dnainternet.net> <4ff79edb0910110442j28d481bag87d5f591eced44cd@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean No, I did not. I now added the test case you sent earlier (Sep-13-2009) to svn, so anyone can have a look and suggest a fix. -asko Francesco Abbate kirjoitti 11.10.2009 kello 14:42: > Hi Asko, > > just a small question, did you fix also the bug with arithmetic > operator overload with complex number ? The problem arise, if you > remember, in the case: > > z * t > > where z is a complex number and t is a table with a '__mul' > metamethod. In GSL shell the problem arise when you write somethng > like: > > > print(4i * m) > > where m is a GSL matrix. > > Thanks in advance. > > Francesco > > 2009/10/11 Asko Kauppi > > Based on request, I've changed the LNUM patch behaviour to be more > in-line with standard Lua. > > << > 10-Oct-09 AK: Made hex value handling same as with standard Lua > with modes where this is > possible without sacrificing bitwise resolution (i.e. ldouble and > double+int32 modes). > > For double+int32 (new): > 0xffffffff = 2^32-1 > 0xdeadbeef > 0 > > For i.e. float+int32 (like it was): > 0xffffffff = -1 > 0xdeadbeef < 0 > > In other words, hex integers with topmost bit set are now stored > (unsigned) as floating point > when doing so would not endanger losing their least significant bit > accuracy. > << > > The changed patch is _not_ uploaded to LuaForge or anywhere. To get > it you have to do a svn checkout: > > svn co svn://slugak.dyndns.org/public/2009/LNUM2 > > The LNUM patch, also known as "integer patch" allows Lua 5.1 to > treat pure integer operations with full accuracy and more speed on > non-FP platforms, without changing the external interfaces. > > - asko > > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 12:59:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BFx0N9017024; Sun, 11 Oct 2009 12:59:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16A841A68E; Sun, 11 Oct 2009 13:57:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp110.rog.mail.re2.yahoo.com (smtp110.rog.mail.re2.yahoo.com [206.190.37.120]) by bazar2.conectiva.com.br (Postfix) with SMTP id 840A318710 for ; Sun, 11 Oct 2009 13:57:50 -0200 (BRST) Received: (qmail 95455 invoked from network); 11 Oct 2009 15:58:30 -0000 Received: from unknown (HELO MobileDev) (kenk@99.236.26.122 with login) by smtp110.rog.mail.re2.yahoo.com with SMTP; 11 Oct 2009 15:58:30 -0000 X-YMail-OSG: FVM5cqgVM1nRo3y9YoGxUyARdr89FR7LG9xlo_If8g8Rwy56LfiOzHF7GVk3kRkhvg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <552E7DFA78AA49C7AE70FF1C1BFFC939@MobileDev> From: "Kenk" To: "Lua list" References: <4D6EB001315D4F569D614DFCBF062521@VADER><6617C3E3E08E4E1A8A9F0ED0679F44A0@MobileDev> <20091011113509.GA11686@magritte.tecgraf.puc-rio.br> In-Reply-To: <20091011113509.GA11686@magritte.tecgraf.puc-rio.br> Subject: Re: Creating nested tables from C into Lua.. Date: Sun, 11 Oct 2009 11:58:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks! That did the trick. I'll have to remember to use lua2.c when I need to see how thing's are setup in C when given a senario in script, very handy. From that I just created a few simple helper methods to build a return table. StartMainTable(), StartSubTable(), PushVal(Index),PushVal(Value),EndSubTable(),EndMainTable(). That works nicely for now and helps me understand how the stack is built more too! ----- Original Message ----- From: "Luiz Henrique de Figueiredo" To: "Lua list" Sent: Sunday, October 11, 2009 7:35 AM Subject: Re: Creating nested tables from C into Lua.. >> { {name="Scooby",age=45, >> type="Dog",someusertype=},{name="Shaggy",age=24, >> type="Human",someusertype=}} > > My lua2c, which is for Lua 4, still works on this piece of code and > generates > correct C code for Lua 5.1: > > /* This C code was generated by lua2c from the Lua code below. > > return { {name="Scooby",age=45, > type="Dog",someusertype="userdata"},{name="Shaggy",age=24, > type="Human",someusertype="userdata"}} > > */ > static int MAIN(lua_State *L) > { > lua_newtable(L); > lua_newtable(L); > lua_pushliteral(L,"name"); > lua_pushliteral(L,"Scooby"); > lua_pushliteral(L,"age"); > lua_pushnumber(L,45); > lua_pushliteral(L,"type"); > lua_pushliteral(L,"Dog"); > lua_pushliteral(L,"someusertype"); > lua_pushliteral(L,"userdata"); > lua_settable(L,-9); > lua_settable(L,-7); > lua_settable(L,-5); > lua_settable(L,-3); > lua_newtable(L); > lua_pushliteral(L,"name"); > lua_pushliteral(L,"Shaggy"); > lua_pushliteral(L,"age"); > lua_pushnumber(L,24); > lua_pushliteral(L,"type"); > lua_pushliteral(L,"Human"); > lua_pushliteral(L,"someusertype"); > lua_pushliteral(L,"userdata"); > lua_settable(L,-9); > lua_settable(L,-7); > lua_settable(L,-5); > lua_settable(L,-3); > lua_rawseti(L,-3,2); > lua_rawseti(L,-2,1); > return 1; > return 0; > } > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 14:20:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BHK67X023452; Sun, 11 Oct 2009 14:20:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C03D18993; Sun, 11 Oct 2009 15:18:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00D3618714 for ; Sun, 11 Oct 2009 15:18:47 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 19so653587fgg.17 for ; Sun, 11 Oct 2009 10:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=ErBJbYvNOiMzy9z3ZLI0HoCHpSrwUJgyVyENel5Y3z4=; b=hJLVmFZNRC78u6Oetb/pxq/3qanyS/BGFt34jKrOihPZYHVZPvgLC5rfefCY+MW62I QkLPb4dbXylqTQIL6ZxQnpHl2i4B28RozeUvqv8s1I+2qEBUJEV+FgWMVeKagBvmn4bd XEG7ss2peRSlrD3hkGqM0BDRStbF1DoMBtaWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=XiFtWzk3sSBg/a1paC+FduHF0y7G4EBnoXiE/QjwEBnDIuj0w9VqOHqRzbG784xcej j+o2W4vggfhWgzuI1lwdtWPJXw6d89kCCrCg63F7l4qk4lK4120l04a//EyorN+wVJpv P1gfCitDZsHzRHN8tlySH9CsWajZwoIh/baGI= Received: by 10.86.103.19 with SMTP id a19mr4465313fgc.54.1255281568974; Sun, 11 Oct 2009 10:19:28 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 12sm1997388fgg.26.2009.10.11.10.19.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 10:19:28 -0700 (PDT) Message-Id: <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Sun, 11 Oct 2009 19:18:57 +0200 References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910091358m60e3d7fbs3ca47ebcc6ed325f@mail.gmail.com> <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 10, 2009, at 1:43 PM, Jim Whitehead II wrote: > Absolutely nothing has been closed in any way. Stop implying that > they have been. Well... if you acted less like a jerk, perhaps it would make things a bit easier... in the meantime... good luck. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 14:45:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BHjEVn025687; Sun, 11 Oct 2009 14:45:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45CD7191DC; Sun, 11 Oct 2009 15:44:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E403418D90 for ; Sun, 11 Oct 2009 15:44:02 -0200 (BRST) Received: by bwz22 with SMTP id 22so7184252bwz.5 for ; Sun, 11 Oct 2009 10:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=kcYPXKBQd1ZZk788ih9XysaQs60Q2txFwL3HDPjZmqY=; b=QCoH4af06ow32hkipn/1Q3dUmFZBLrb9U3AKnm0mo1uSadpyc9Q8uzorTuYpGto9VP nUEbfxnPIjbZY5Ej1xpaHFUg361vi3sbKees1qD4WmUCK4LLBIPgXt4mnXwBCCYDRkSc 0hHKHb1rHPVWV5KqobiygxDwDNVLqiTemLaPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=RUb3C3e65DHZtiXs7Nl5nl0psMl44qMt9W0UpaaqB7gJbaaW5jofVEPVQaoUILJXUA IA1C4wPgBR+4Kil1IGupXgQuk4cx2To2sDmIeea4/W3dZYLqys73GQj2YdcMTHhP8VSG uzuqVTIAkZOP9hILv82eDLC5+kjVUtNyyKPcI= MIME-Version: 1.0 Received: by 10.223.144.81 with SMTP id y17mr1349553fau.68.1255283082151; Sun, 11 Oct 2009 10:44:42 -0700 (PDT) In-Reply-To: <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> From: Jim Whitehead II Date: Sun, 11 Oct 2009 18:44:22 +0100 Message-ID: <5fe281d40910111044w68c46c77h9a28ea67c82a7a65@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9BHjEVn025687 On Sun, Oct 11, 2009 at 6:18 PM, Petite Abeille wrote: > > On Oct 10, 2009, at 1:43 PM, Jim Whitehead II wrote: > >> Absolutely nothing has been closed in any way.  Stop implying that >> they have been. > > Well... if you acted less like a jerk, perhaps it would make things a bit > easier... in the meantime... good luck. And now the insults start to fly, fantastic. I am not one to claim that my communications skills are perfect. I'm incredibly critical of myself when I've caused communications issues by reading someone wrong, responding in too terse a fashion, or writing something without thinking about it beforehand. I'm not perfect, and I can't always identify the issues without having someone point them out to me; not that I think personal insults or critiques have a place on this mailing list. I am now going back and reading through this post to try and see where I have 'been a jerk'. My first reply to the thread was sent as soon as I had access to the internet after landing in the UK and seeing how large this thread had become. The group in Rio spent about 4 hours sitting and discussing the site and we made some solid plans and I felt it best to organise the group together and take the discussion where it belongs, off the Lua-L mailing list. In retrospect I should have included a bit more background about the discussion that had happened, but I sent the email from my phone to try and gather the interested individuals together. The first four or five responses are trying to get people to understand why I was asking them to contact me. We (as a group) had not had an opportunity to discuss where we wanted to host our discussion, so I didn't want to prematurely commit to any site/mailing list. I figured that if people contacted me I could then dump the email addresses all in one place once we had everything set up. Next (seemingly out of context given my responses), we're accused of having a 'secret project' with a 'secret society' when nothing could be further from the truth. Cosmin admits that he was joking but in the context of the thread that was less than obvious. But even after reading my responses he continues to state that the project needs to be 'open', which is a direct implication that the project is in some way closed. That's where the response you quoted comes from, and I maintain that the comment was inappropriate given the discussion we had already had. I'm frustrated, because I don't understand why all of this has been blown out of proportion. Why I am being called a 'jerk' for attempting to organise a discussion that prevents the Lua-L mailing list from being inundated with new topics about the subject. I was attempting to merge the discussion that happened in Rio with the discussion that was happening on the mailing list at the same. Did I do it in the best way possible, no, but we've having a very good discussion on the luaforge-development mailing list and then I come here and have to read this? So if you wouldn't mind, Petite, I would really appreciate hearing your personally critical feedback and where it is coming from so I might improve my communications skills in the future. - Jim From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 15:46:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BIkWhg029754; Sun, 11 Oct 2009 15:46:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 050FE188AE; Sun, 11 Oct 2009 16:45:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16A6018899 for ; Sun, 11 Oct 2009 16:45:09 -0200 (BRST) Received: by ywh5 with SMTP id 5so3070329ywh.11 for ; Sun, 11 Oct 2009 11:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6LO4giC9oB+fwUFr/abjynNPbOh6jdAQNifd9F67Dr4=; b=kOioq2Co3G1+YCjNkClDSdE99h1D0RcdFBBOzasFkNpIopa1S8S5OGP+kAmdUIM9kZ h+4FXUFpVpg59j6+XUAZ+IV5UjaMNtWw3BrVSLCUD/g1kyxcCXf0NCfQLUgKuVWN8aOx gwnRTa+VhY2OPgjnJ3ai942MX4mLrXroUEru8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nWzkn9fUsiwwn0Cr54gkp6mDU9qRvzu1G2SnSKpElUaXH8sKhmEMbOBpEJ54oS8QS0 m2qHRNSRRVxbilZgi3ylMAsHDyF097IOHcYzRZddNuwDDZmEVof0MV+pMDXx7yKEJAYF Jwai+up93KIiT2twvZDucoNOCQHkH1uv5CPIg= MIME-Version: 1.0 Received: by 10.101.156.33 with SMTP id i33mr4862166ano.86.1255286749633; Sun, 11 Oct 2009 11:45:49 -0700 (PDT) In-Reply-To: <560972290910110619u7d7ef6a3m6a38b9581cfeedb1@mail.gmail.com> References: <92ab989c0910071015y115ad3c4k9fabfe00d092dc49@mail.gmail.com> <9E03CBC1-3C96-480A-BEF0-1735652E7E65@gmail.com> <92ab989c0910071435j1c5be712t80843b3f7fc6762@mail.gmail.com> <560972290910110619u7d7ef6a3m6a38b9581cfeedb1@mail.gmail.com> Date: Sun, 11 Oct 2009 14:45:49 -0400 Message-ID: Subject: Re: LuaForge is down and will be for some time From: "Bruce O. Benson" To: Lua list Content-Type: multipart/alternative; boundary=0016e6d3e1e2cd9c680475ad38f4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d3e1e2cd9c680475ad38f4 Content-Type: text/plain; charset=ISO-8859-1 One more vote for Sputnik and drinking the Lua kool-aid. Also holler if the hosting location for luaforge doesn't seem completely satisfying. On Sun, Oct 11, 2009 at 9:19 AM, steve donovan wrote: > Seriously, the gang is mostly focussing on requirements. I'm doing a > LuaRecipes prototype using Sputnik, mostly because I was the person > -- Bruce O. Benson, mailto:bbenson@gmail.com | http://www.tux.org Donating spare CPU to science: Folding@home Team Debian (#2019) --0016e6d3e1e2cd9c680475ad38f4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable One more vote for Sputnik and drinking the Lua kool-aid.

Also holler= if the hosting location for luaforge doesn't seem completely satisfyin= g.


On Sun, Oct 11, 2009 at 9:19 AM, s= teve donovan <steve.j.donovan@gmail.com> wrote:
=A0
Ser= iously, the gang is mostly focussing on requirements. I'm doing a
LuaRecipes prototype using Sputnik, mostly because I was the person

=A0
--
Bruce O. Benson, mailto:bbenson@gmail.com | http://www.tux.org
Donating spare CPU to science: Folding@home Team Debian (#2019)

--0016e6d3e1e2cd9c680475ad38f4-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 16:26:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BJQeRK000407; Sun, 11 Oct 2009 16:26:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2CEFA18D88; Sun, 11 Oct 2009 17:25:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D51218D5E for ; Sun, 11 Oct 2009 17:25:27 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9BJQ8bU032725 for ; Sun, 11 Oct 2009 16:26:08 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 2CBA554C23A; Sun, 11 Oct 2009 16:26:09 -0300 (BRT) Date: Sun, 11 Oct 2009 16:26:09 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: LuaForge is down and will be for some time Message-ID: <20091011192609.GA2363@inf.puc-rio.br> References: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> Absolutely nothing has been closed in any way. Stop implying that >> they have been. > > Well... if you acted less like a jerk, perhaps it would make things a > bit easier... in the meantime... good luck. Petite Abeille, Personal insults should have no place in this list, even more so against Jim, who has been working hard to actually solve the problem. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 16:35:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BJZmoT001163; Sun, 11 Oct 2009 16:35:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A49191A59E; Sun, 11 Oct 2009 17:34:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFEA818D75 for ; Sun, 11 Oct 2009 17:34:38 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 19so110457fgg.17 for ; Sun, 11 Oct 2009 12:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=8gSPwBATiKJ2zx1WafJr1HgiVhdYO3pcEsUxrHecrG8=; b=jEzMHoviLmHy/61q9T/NycJQzdpRXIhuN5XwVgfngPaVf5ywXWunJawdtlQi1zQfYT 1/MjI7UtIzByen/0NkGDpoKhn4fUqC5PKhXXq5yVDzXn49QNe0U+O9c76zR4PQMKh0WU gdY6Ti0cuej33nJOuJ5920RKTBMMgtw6iqumI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=bkj1NFphIuMS8hHNopvMNkTpKpm1VNZvAn6+zrUEuZ8mZfKK5Ah8zAggs/i7vwbPgn uAK2E/4C/XFqMUvFKGWfZ4gSSYw4ph3uQl7oC+qeL+KzNPc+GaRPd4S4I0Zyb+2vKvpd dqAJoYDG/qDM1B/dwyrbmNuchwXIw1fpODVsg= Received: by 10.86.214.34 with SMTP id m34mr4548304fgg.6.1255289719509; Sun, 11 Oct 2009 12:35:19 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 4sm2813936fge.22.2009.10.11.12.35.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 12:35:18 -0700 (PDT) Message-Id: <7612B135-849E-4A69-8181-7D2DCF7EC6D6@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <20091011192609.GA2363@inf.puc-rio.br> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: LuaForge is down and will be for some time Date: Sun, 11 Oct 2009 21:34:47 +0200 References: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> <20091011192609.GA2363@inf.puc-rio.br> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 11, 2009, at 9:26 PM, Roberto Ierusalimschy wrote: > Personal insults should have no place in this list, Noted. Apologies. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 17:42:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BKg0NR006516; Sun, 11 Oct 2009 17:42:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E091A1A672; Sun, 11 Oct 2009 18:40:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FD0C1A667 for ; Sun, 11 Oct 2009 18:40:43 -0200 (BRST) Received: by bwz22 with SMTP id 22so7246752bwz.5 for ; Sun, 11 Oct 2009 13:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=CUR4OzjbWgKx28ajRusz1o5pqkcG4pzek25T4VMqzUs=; b=RGpOVfyzMMmk+EW1xv9rAAHTlmjgTVc3t3JkgOfqVQNEBfFR1hVFq2dL2qw4djN2r0 7V7OUn/2RDmOzAN/Rq5znoTORPTOyyjHFCXwV2AFaO33eNvtQl9IMRrHONdo0UJ2fsix oXrJY8XwbyvGS36eyvF1m4bg+1Hb7YS+cRUkY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=rWrCe+0eShYikbEUdAOkCDuMxO4IXAre5atUInzWekgJKaVvdO8tqduCWrsk/cCcwr YZILYLy254DFY68xlsAcT0741Hr4TAhDKyAj5F5ee1wznNngSR4/SW2k4fn0x7fwnNAU NDOuf+tJQ7BxyitJzwM0PECwiFOo7IUTE0P7E= MIME-Version: 1.0 Received: by 10.204.3.220 with SMTP id 28mr4472292bko.4.1255293685196; Sun, 11 Oct 2009 13:41:25 -0700 (PDT) In-Reply-To: <20091011192609.GA2363@inf.puc-rio.br> References: <5ba75e2f0910091405l4ea4c6d6uaa891bb181590f34@mail.gmail.com> <5fe281d40910091545l12a801cdr9f31778c88875a45@mail.gmail.com> <5fe281d40910091621t57a63021h8050b11f303c08c1@mail.gmail.com> <5fe281d40910100310g1f662810k6809d2b77cfcb1d1@mail.gmail.com> <5fe281d40910100443p1dbc8359hdb7fd91658a11a2c@mail.gmail.com> <95F7C1D5-177A-44CE-9D89-9ECD1292B4EA@gmail.com> <20091011192609.GA2363@inf.puc-rio.br> Date: Sun, 11 Oct 2009 15:41:24 -0500 X-Google-Sender-Auth: 1e5fa9c5d6015f90 Message-ID: <5ba75e2f0910111341p6c9e4c9dr73e1be35df72c056@mail.gmail.com> Subject: Re: LuaForge is down and will be for some time From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1e22231e66a0475aed6a1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1e22231e66a0475aed6a1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Perhaps we have some pretty different opinions and mindsets but insults doe= s have nothing to do here, they will not help at all. Jim is practicing a lot of patience with us, he is trying to move forward a project in the middle of a serious crisis, that is remarkable. So, we shoul= d at least let him focus on the project and tell us which are next steps when he is ready. Blessings! On Sun, Oct 11, 2009 at 2:26 PM, Roberto Ierusalimschy < roberto@inf.puc-rio.br> wrote: > >> Absolutely nothing has been closed in any way. Stop implying that > >> they have been. > > > > Well... if you acted less like a jerk, perhaps it would make things a > > bit easier... in the meantime... good luck. > > Petite Abeille, > > Personal insults should have no place in this list, even more so against > Jim, who has been working hard to actually solve the problem. > > -- Roberto > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000e0cd1e22231e66a0475aed6a1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Perhaps we have some pretty different opinions and mindsets but insults doe= s have nothing to do here, they will not help at all.

Jim is practic= ing a lot of patience with us, he is trying to move forward a project in th= e middle of a serious crisis, that is remarkable. So, we should at least le= t him focus on the project and tell us which are next steps when he is read= y.

Blessings!

On Sun, Oct 11, 2009 at 2:= 26 PM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> Absolutely nothing has been closed in any way. = =C2=A0Stop implying that
>> they have been.
>
> Well... if you acted less like a jerk, perhaps it would make things a<= br> > bit easier... in the meantime... good luck.

Petite Abeille,

Personal insults should have no place in this list, even more so against Jim, who has been working hard to actually solve the problem.

-- Roberto



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000e0cd1e22231e66a0475aed6a1-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 18:17:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9BLHJ84009465; Sun, 11 Oct 2009 18:17:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5EBE18D75; Sun, 11 Oct 2009 19:16:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80F7218D31 for ; Sun, 11 Oct 2009 19:16:03 -0200 (BRST) Received: by fxm12 with SMTP id 12so2256059fxm.5 for ; Sun, 11 Oct 2009 14:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=6zTnPAaWqq/JlL3zst5KnBJFJZv6EupxNfZNgUzf3jU=; b=NlgiD+kSCHROTrbl2cRUl69jG1tQ3opqXwdByExLU/gp7JEitXbZOpwSly0NQvmHeP tlLx3odvsM1PsVmn98yC1Pvohh6pRKRKVzCkmr/L/QWkm9SnlyiNdAhfYTHj0+AN1CRg C3t/xE0FfQmx3SQCgtjzZfoK8uhv/5ulWCDoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=wzX61L4bv6Wi/HnURlfoOBbOlRPflmkkKsySKcC2if8wq0FWxYzaDWL7GKT/M17FvD AvuzaIJkW83znS7EvaOPOtF3ke8cwGs4noeZ6EHR4+a7kSl2Vd+iOtQQq6WXV9XKYh7L mF8oXKL2/UOr8jGv3lNHQoyi9w2FzmwuU+jRo= MIME-Version: 1.0 Received: by 10.223.132.207 with SMTP id c15mr1372275fat.56.1255295803069; Sun, 11 Oct 2009 14:16:43 -0700 (PDT) From: Jim Whitehead II Date: Sun, 11 Oct 2009 22:16:23 +0100 Message-ID: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> Subject: Luaforge redesign, data crisis, project management, and a partridge in a pear tree.. To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I sincerely apologize for the new topic, but I want to ensure that anyone who might have muted the otherthread (it's up to 97 responses at this point) gets a chance to read this. Fernando just raised some points in his last response that I wanted to clarify. When the Luaforge server first went down, we entered crisis mode. It was unclear how long it would take to get the site back up and running and it showed the entire community a deficiency in our infrastructure. As a community, we have come to rely quite heavily on the site, as evidenced by the periodic downtime this year and the most recent crash. Thanks to the Andre, Alessandro and everyone else involved, portions of the website have been restored. As far as I am aware the faulty hardware has been replaced and while in the short term we need a better backup solution, I wouldn't consider us to be in crisis mode any longer. We're no more aware of the possibility of a crash than we were the last time Andre warned us, it's just fresher in our minds! Secondly, although my actions over the past four days may have indicated otherwise, I am not (at this point) assuming the role of project manager for our discussion and redesign. I happened to be the one who took notes at our meeting in Rio and when I landed in the U.S, I didn't see any responses from those people, so I took the initiative and tried to corral everyone into a more appropriate location. This long term project is less than a week old, and I think it's a bit premature to be deciding what role everyone will have in the project. There are people who might not have been reading the mailing list this week that might like to be involved, for example. I'm more than happy to act as project manager, but if that prevents other people from being involved in the project due to interpersonal conflicts, I am happy to step aside and let someone else lead while still helping the project in any way I can. For right now, I just ask that we all take a step back and breathe. Whatever the complexity of the solution, it's going to take time and a number of iterations in order to get to a point where it's usable as a replacement for G-Forge. Starting tomorrow (so I have a remote chance of enjoying the remainder of my weekend), I'm going to try and start an architectural/design discussion somewhere. Then we will have a concrete place to list precisely what we want on the site, without getting bogged down with the specific details of implementation. I'd like to (again) extend an invitation for anyone who is interested in the future development of to join the luaforge-development mailing list [1] at Google Groups. Of course any release announcements or preliminary designs may be made here, we should try to restrict active discussion about the site to the mailing list. Thanks for your patience with me, - Jim [1]: http://groups.google.com/group/luaforge-development. From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 21:28:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C0SeVl023346; Sun, 11 Oct 2009 21:28:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B51A1A5A0; Sun, 11 Oct 2009 22:27:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s23.bay0.hotmail.com (bay0-omc1-s23.bay0.hotmail.com [65.54.246.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 664B018D78 for ; Sun, 11 Oct 2009 22:27:25 -0200 (BRST) Received: from BAY121-W35 ([207.46.10.70]) by bay0-omc1-s23.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 11 Oct 2009 17:28:02 -0700 Message-ID: X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: Using LuaSocket with non-blocking sockets Date: Sun, 11 Oct 2009 17:28:01 -0700 Importance: Normal Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginalArrivalTime: 12 Oct 2009 00:28:02.0148 (UTC) FILETIME=[DB9BAA40:01CA4AD2] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9C0SeVl023346 Hello, I'm using non-blocking sockets with LuaSocket under Win32, and I find myself looking for a way to tell if a connect() call failed. I can use socket.select(nil, {sock}, 0) to see if the socket has connected successfully, but I don't see any way to tell if it failed. Looking over the WinSock documentation, I notice an 'exceptfds' parameter that comes after the read and write tables, but LuaSocket doesn't appear to use it at all (its source shows NULL used instead). The WinSock documentation says that if a nonblocking socket failed to connect, passing it in as part of 'exceptfds' would return the socket as part of that list. Does anyone have any suggestions for how to work around this? Or better, can anyone explain why 'exceptfds' is ignored in LuaSocket? I can't use blocking sockets due to the environment I'm writing this script for (as a plugin to a single-threaded process), and I don't want to lock up the rest of the environment with blocking calls. Thank you,~Jonathan Castello _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 23:04:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C244Bu031365; Sun, 11 Oct 2009 23:04:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5781418629; Mon, 12 Oct 2009 00:02:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30726185F9 for ; Mon, 12 Oct 2009 00:02:46 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so299725qwb.11 for ; Sun, 11 Oct 2009 19:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0SXX0Xg4O0wp16xDsetHrox8pU5ZyotcLUrP7bDGG5k=; b=N/ZavJFPkga2WS3AWY/TeKTa88NlbGpcw/QEzqZEgHS70yZyLJXGTDXAtuJYt8Ci/u MwhXW9wMj9pggEfyRvi12xMmdEaARcfwNnWS84hAujTMhG9pM566g8lMr+PHLevmzSZS T/PuWPKCO1iNYt/I/XxesT3CiZbWlqnOggcpw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=HzcXTkgdM539WG0q1m4QBM3wAgisN3Rra6qSO97dUifSSuTj/Cv1UxnX3tKuJnZI9V D/C+Y2grxiLTv8ypU69yxTheaEG5PRgi175f7Zz+8dvSfURc+D8++fPtR2sRxkcPRawG CygWgyqXJgy1g2bVHlL4l4YfIgTvjKPoVU278= MIME-Version: 1.0 Received: by 10.224.30.148 with SMTP id u20mr1303992qac.43.1255313006820; Sun, 11 Oct 2009 19:03:26 -0700 (PDT) In-Reply-To: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> References: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> Date: Sun, 11 Oct 2009 23:03:26 -0300 X-Google-Sender-Auth: dcfec39bcc7ac732 Message-ID: <7913df4d0910111903k1f13e58ct26ed329544067a37@mail.gmail.com> Subject: Re: Luaforge redesign, data crisis, project management, and a partridge in a pear tree.. From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9C244Bu031365 I was one of the five present (counting Jim) on the thursday chat. Far from being a secret meeting, this was just an informal chat in a rainy afternoon, and I am amazed at the level of controversy it has caused, but I guess this is always a risk with communicating online. If we didn't send an email to the list right after our chat it was because Jim was the one taking notes, not for any desire to keep things secret. Now that LuaForge is mostly back up (and I am in favor of not fixing non-anonymous CVS access, as an incentive for everyone that is still keeping source trees there to move it ASAP; git cvsimport is your friend) we can all take a deep breath and take our time. -- Fabio Mascarenhas On Sun, Oct 11, 2009 at 6:16 PM, Jim Whitehead II wrote: > I sincerely apologize for the new topic, but I want to ensure that > anyone who might have muted the otherthread (it's up to 97 responses > at this point) gets a chance to read this.  Fernando just raised some > points in his last response that I wanted to clarify. > > When the Luaforge server first went down, we entered crisis mode.  It > was unclear how long it would take to get the site back up and running > and it showed the entire community a deficiency in our infrastructure. >  As a community, we have come to rely quite heavily on the site, as > evidenced by the periodic downtime this year and the most recent > crash.  Thanks to the Andre, Alessandro and everyone else involved, > portions of the website have been restored.  As far as I am aware the > faulty hardware has been replaced and while in the short term we need > a better backup solution, I wouldn't consider us to be in crisis mode > any longer.  We're no more aware of the possibility of a crash than we > were the last time Andre warned us, it's just fresher in our minds! > > Secondly, although my actions over the past four days may have > indicated otherwise, I am not (at this point) assuming the role of > project manager for our discussion and redesign.  I happened to be the > one who took notes at our meeting in Rio and when I landed in the U.S, > I didn't see any responses from those people, so I took the initiative > and tried to corral everyone into a more appropriate location. > > This long term project is less than a week old, and I think it's a bit > premature to be deciding what role everyone will have in the project. > There are people who might not have been reading the mailing list this > week that might like to be involved, for example.  I'm more than happy > to act as project manager, but if that prevents other people from > being involved in the project due to interpersonal conflicts, I am > happy to step aside and let someone else lead while still helping the > project in any way I can. > > For right now, I just ask that we all take a step back and breathe. > Whatever the complexity of the solution, it's going to take time and a > number of iterations in order to get to a point where it's usable as a > replacement for G-Forge.  Starting tomorrow (so I have a remote chance > of enjoying the remainder of my weekend), I'm going to try and start > an architectural/design discussion somewhere.  Then we will have a > concrete place to list precisely what we want on the site, without > getting bogged down with the specific details of implementation. > > I'd like to (again) extend an invitation for anyone who is interested > in the future development of to join the > luaforge-development mailing list [1] at Google Groups.  Of course any > release announcements or preliminary designs may be made here, we > should try to restrict active discussion about the site to the mailing > list. > > Thanks for your patience with me, > > - Jim > > [1]: http://groups.google.com/group/luaforge-development. > From lua-bounces@bazar2.conectiva.com.br Sun Oct 11 23:56:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C2u6SA002231; Sun, 11 Oct 2009 23:56:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59A5D1A67C; Mon, 12 Oct 2009 00:54:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f181.google.com (mail-pz0-f181.google.com [209.85.222.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51D6D1A65F for ; Mon, 12 Oct 2009 00:54:49 -0200 (BRST) Received: by pzk11 with SMTP id 11so6577418pzk.14 for ; Sun, 11 Oct 2009 19:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:reply-to:from:to :subject:date:mime-version:content-type:x-priority:x-msmail-priority :importance:x-mailer:x-mimeole; bh=AhroVxDHCQSxV7SbimBfqngy90t4r/AKdAnvkD6sijY=; b=rgvNKhMG7UpNrtuX8gHPWnKdLfQvcbeG7y2fQzJXs2+73VCfLzL2ejWP9hZc1d/Bzy T9p5pz6EQ0UBAAohtVE/K82C5M4B+5v+KbxKVyV2WUWBUPjrECbrm1Y/KPxgZrkm5BIU EyP9lMKmFbwbcgSyvDYlNE4gQDDM2WQ9imAb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:reply-to:from:to:subject:date:mime-version:content-type :x-priority:x-msmail-priority:importance:x-mailer:x-mimeole; b=lbrNfIjVvkrCaejR/gJpF1XyIbeK+YuDCgnd/pvZQPf4VRCYqAYESWKhw3X9vkHi57 uNz8A939PJDRp8p2n9Lt8WWeVYRom1IqwSUlRjF1k2l4zew90hFeAcgjNn11qwphHtzT uVLnqm5ne8AwioAu0MpvyacWRE6m7jflBLKDU= Received: by 10.115.114.9 with SMTP id r9mr8952613wam.19.1255316129405; Sun, 11 Oct 2009 19:55:29 -0700 (PDT) Received: from zhaoboqiangnb ([113.106.106.98]) by mx.google.com with ESMTPS id 23sm608853pzk.4.2009.10.11.19.55.26 (version=SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 19:55:28 -0700 (PDT) Message-ID: <4D30D27978E94A858B06081599EC9F5D@zhaoboqiangnb> From: "ZhaoBoqiang" To: Subject: crash in newkey Date: Mon, 12 Oct 2009 10:55:28 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001F_01CA4B2A.82CC57E0" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean UbJGR;7b MIME 8qJ=5D6`7=SJ<~!# ------=_NextPart_000_001F_01CA4B2A.82CC57E0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable My program encounter a crash. >From the dump, they are same. But I don't have a way to recreate this buy. I am using lua 5.1,not the recently version,but I compare the two = version. the ltable.c have only modify one line. static TValue *newkey (lua_State *L, Table *t, const TValue *key) { Node *mp =3D mainposition(t, key); if (!ttisnil(gval(mp)) || mp =3D=3D dummynode) { Node *othern; Node *n =3D getfreepos(t); /* get a free place */ if (n =3D=3D NULL) { /* cannot find a free place? */ rehash(L, t, key); /* grow table */ return luaH_set(L, t, key); /* re-insert key into grown table */ } lua_assert(n !=3D dummynode); othern =3D mainposition(t, key2tval(mp)); if (othern !=3D mp) { /* is colliding node out of its main = position? */ /* yes; move colliding node into free position */ while (gnext(othern) !=3D mp) othern =3D gnext(othern); /* find = previous */ gnext(othern) =3D n; /* redo the chain with `n' in place of `mp' = */ *n =3D *mp; /* copy colliding node into free pos. (mp->next also = goes) */ gnext(mp) =3D NULL; /* now `mp' is free */ setnilvalue(gval(mp)); } else { /* colliding node is in its own main position */ /* new node will go into free position */ gnext(n) =3D gnext(mp); /* chain new position */ gnext(mp) =3D n; mp =3D n; } } gkey(mp)->value =3D key->value; gkey(mp)->tt =3D key->tt; luaC_barriert(L, t, key); lua_assert(ttisnil(gval(mp))); return gval(mp); } crash in the red line. I have analysed the dump file. othern is 88 at this condition. and the call stack is: newkey luaV_settable while luaH_set luaV_execute while OP_MOD Thank you very much. Zwinger beckzar@hotmail.com ------=_NextPart_000_001F_01CA4B2A.82CC57E0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
My program encounter a = crash.
From the dump, they are = same.
But I don't have a way to recreate this = buy.
I am using lua 5.1,not the recently = version,but I compare the=20 two version. the ltable.c have only modify one line.
 
static TValue *newkey (lua_State *L, = Table *t, const TValue=20 *key) {
  Node *mp =3D mainposition(t, key);
  if=20 (!ttisnil(gval(mp)) || mp =3D=3D dummynode) {
    Node = *othern;
    Node *n =3D getfreepos(t);  /* get a = free=20 place */
    if (n =3D=3D NULL) {  /* cannot find = a free=20 place? */
      rehash(L, t, key);  /* = grow=20 table */
      return luaH_set(L, t, = key);  /*=20 re-insert key into grown table */
    = }
   =20 lua_assert(n !=3D dummynode);
    othern =3D = mainposition(t,=20 key2tval(mp));
    if (othern !=3D mp) {  /* is = colliding=20 node out of its main position? */
      /* = yes; move=20 colliding node into free position */
      while (gnext(othern) !=3D = mp) othern=20 =3D gnext(othern);  /* find previous=20 */
      gnext(othern) =3D = n;  /*=20 redo the chain with `n' in place of `mp' = */
      *n=20 =3D *mp;  /* copy colliding node into free pos. (mp->next also = goes)=20 */
      gnext(mp) =3D NULL;  /* now = `mp' is free=20 */
     =20 setnilvalue(gval(mp));
    }
    = else=20 {  /* colliding node is in its own main position=20 */
      /* new node will go into free = position=20 */
      gnext(n) =3D gnext(mp);  /* = chain new=20 position */
      gnext(mp) =3D=20 n;
      mp =3D n;
    = }
 =20 }
  gkey(mp)->value =3D key->value; gkey(mp)->tt =3D=20 key->tt;
  luaC_barriert(L, t, key);
 =20 lua_assert(ttisnil(gval(mp)));
  return = gval(mp);
}
 
crash in the red line.
I have analysed the dump = file.
othern is 88 at this = condition.
 
and the call stack is:
newkey
luaV_settable while luaH_set
luaV_execute while = OP_MOD
 
Thank you very much.
 
Zwinger
beckzar@hotmail.com
 
 
 
------=_NextPart_000_001F_01CA4B2A.82CC57E0-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 01:10:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C4AY3P008138; Mon, 12 Oct 2009 01:10:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04ACA189E3; Mon, 12 Oct 2009 02:09:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD3FD18977 for ; Mon, 12 Oct 2009 02:09:17 -0200 (BRST) Received: by qyk26 with SMTP id 26so7330091qyk.5 for ; Sun, 11 Oct 2009 21:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=/TaIBI9sDG07LPV0BzEXZxakkSzypLfY7pzDb49Brpk=; b=AqXGF2yXmKq/eveK8XzQYaoWAG4BVYuctv+LU5ruqr56GyOEgyMRgZTbKcoM3ExnKH +d/RdtkGSDkAyStd5R5qqJ2N2sjFskGDUm1l7SQ8vobBbAcQzP+vJ/EAeodKsCzIIglE EDZQgt1rwTIlA9if49Uk74hgCP+TuAtMZv60E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=t5rWK7V+InWcIhbGnbjqCdiAySrp1Qcqd97+YeTiW8IXDdD575CDIGvK2tqZVbIiBb wU21ZfsiaWd9pgD7h/0tI4lvj0VeWXzRI7dBhXS5BE5cgA4i8DLfqhH8qX0xcSKI7+Cm RtpRiw+PgYfHb8X16LnQhBhSY6iE0hc4Nex18= Received: by 10.224.110.212 with SMTP id o20mr4484381qap.151.1255320599204; Sun, 11 Oct 2009 21:09:59 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 23sm1398902qyk.3.2009.10.11.21.09.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 21:09:58 -0700 (PDT) Message-ID: <4AD2AC10.8000207@gmail.com> Date: Mon, 12 Oct 2009 12:09:52 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Luaforge redesign, data crisis, project management, and a partridge in a pear tree.. References: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> <7913df4d0910111903k1f13e58ct26ed329544067a37@mail.gmail.com> In-Reply-To: <7913df4d0910111903k1f13e58ct26ed329544067a37@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabio Mascarenhas wrote: > I was one of the five present (counting Jim) on the thursday chat. Far > from being a secret meeting, this was just an informal chat in a rainy > afternoon, and I am amazed at the level of controversy it has caused, > but I guess this is always a risk with communicating online. If we > didn't send an email to the list right after our chat it was because > Jim was the one taking notes, not for any desire to keep things > secret. > > Now that LuaForge is mostly back up (and I am in favor of not fixing > non-anonymous CVS access, as an incentive for everyone that is still > keeping source trees there to move it ASAP; git cvsimport is your > friend) we can all take a deep breath and take our time. Yep, now that the whole community knows that Jim is in the team, there isn't likely to be any more misunderstandings. As a bystander, I think the problem was lack of context. Without being aware of what was happening in the workshop, those not clued in were left surprised. It was legitimate to question Jim's motives, since I believe we lacked essential information about the actual relationships between parties at that time. Based on list postings only, at first I was also wondering what was going on. Of course, it got a bit heated, but I think since both sides were thinking rather different things, it was a communications failure that could also happen to any of us. So I think it's all good now. LuaForge is a primary Lua resource for me, and we take it for granted until it blows up, heh. ;-) To Jim, Andre and everyone taking action and taking charge, two thumbs up from me. > On Sun, Oct 11, 2009 at 6:16 PM, Jim Whitehead II wrote: >> [snip] -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 02:35:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C5Zn3t015027; Mon, 12 Oct 2009 02:35:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B3BD1A68D; Mon, 12 Oct 2009 03:34:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EC4E1A669 for ; Mon, 12 Oct 2009 03:34:34 -0200 (BRST) Received: by fxm12 with SMTP id 12so2405182fxm.5 for ; Sun, 11 Oct 2009 22:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=7h2X4kkxePtYKbq142XxIEHS89rtPM39KTz7l6QIzhI=; b=h64vGpqMl9NKMy9Qdjj/D+tCjLgbVkA0wy0l0BiHYfsN29qL1Cpv86tGGRTMVk0cjV /bBFV8JBLBxVpjjmaPo4EYDKmb9MNSfpXa/74Uv0rP2VQmk3YSA4uCGzsjMW4l9Uzg0K OyKnySZiKyKrx8LZwywQDsYy8rfQrLlfA/Lp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=d8XLWfuzxHmU/w/R1GZo4rZo3wlQy+ANtfCxt6iIrCsbd6sj2OdSLJGzTyWEgvd2KX yUBVp1bmSD7ml6PM36bEREYCuS0z/jrSycID/woHJd1iBqf9kRvyO2EmnjslsWanrjcY ojEEM+R6rm+nNnf1QIgoP5RZVJFQDUoV3rwak= MIME-Version: 1.0 Received: by 10.86.254.17 with SMTP id b17mr4891132fgi.65.1255325714880; Sun, 11 Oct 2009 22:35:14 -0700 (PDT) Date: Mon, 12 Oct 2009 11:05:14 +0530 Message-ID: Subject: Obtain ip address in lua script From: Awadhesh Kumar To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001485eba0b55019530475b64bfa X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485eba0b55019530475b64bfa Content-Type: text/plain; charset=ISO-8859-1 Hi, I have written LUA scripts which dissect proprietary packets from network. I had written the lua scripts as *-- declare our protocol InDirectnip_proto = Proto("INIPD","NIP","NIP Messages") -- create a function to dissect it function InDirectnip_proto.dissector(buffer,pinfo,tree) pinfo.cols.protocol = "INIPD" end -- load the udp.port table udp_table = DissectorTable.get("udp.port") -- register caicd direct mip protocol to handle udp port 50019 udp_table:add(50013,InDirectnip_proto) * I need help to get the following a) How can I get the source ip address of packets in this script file I tried to get the ip address as *print(Field.new("ip.addr")) *but i got the error "A Field extractor must be defined before Taps or Dissectors get called" in wireshark. Please help me how to define extarctor before dissectors gets called. b) is there any way to register multiple udp port in single lua file? Thanks in Advance Awadhesh. --001485eba0b55019530475b64bfa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I have written LUA scripts which dissect proprietary packets fr= om network. I had written the lua scripts as

-- declare our proto= col
InDirectnip_proto =3D Proto("INIPD","NIP","= NIP Messages")

-- create a function to dissect it
function InDirectnip_proto.dissec= tor(buffer,pinfo,tree)
=A0=A0=A0 pinfo.cols.protocol =3D "INIPD&quo= t;
end


-- load the udp.port table
udp_table =3D DissectorT= able.get("udp.port")

-- register caicd direct mip protocol to handle udp port 50019
udp_t= able:add(50013,InDirectnip_proto)

I need help to get the followi= ng

a) How can I get the source ip address of packets in this script = file


I tried to get the ip address as

print(Field.new("ip.addr"))

but i got the error "A Field extractor must be defined before Taps or Dissectors get called" in wireshark. Please help me how to define extarctor before dissectors gets called.

b) is there any way to regi= ster multiple udp port in single lua file?




Thanks in Ad= vance
Awadhesh.
--001485eba0b55019530475b64bfa-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 04:58:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C7wF3W026869; Mon, 12 Oct 2009 04:58:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A32E1A68F; Mon, 12 Oct 2009 05:57:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 269811A669 for ; Mon, 12 Oct 2009 05:56:59 -0200 (BRST) Received: by qyk26 with SMTP id 26so7403911qyk.5 for ; Mon, 12 Oct 2009 00:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=HqhZ8SXEU3bGq/n3bbLgmgiW8EEfnqFRcuavxaXzlJQ=; b=Q4doVQ5q3cuNPVbEff/HDXuSEmdokBQ2nih4z+XchKmsc+AwOIF7lRW33vwSrsU6lr CYl2LCht2gFKISTu0K5wOl1ZmgOkIWp/S3Sp3HWpqsKLzmOLr6m4ibIJpxTun7XbcKCh JGWBrlSQIklOl2hLzGgm7qOj7MHaHC04mc7lM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=j896QRerZ+nVouX9JK5KQ5SUPjh8RgURlp4DLnIkFY8AqU9tttS581faEv6S9v3+QJ 3Wdu/yawucxZyLjl3tbSOCsVV0jPi62BVvo2pawcMRTwckRwvB4K+5mLxVnQBMoy3vkE XiSL7smqv2izrOonUd7gymSTgcpjlAANTtKbA= Received: by 10.224.100.13 with SMTP id w13mr4512358qan.292.1255334261009; Mon, 12 Oct 2009 00:57:41 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 20sm1107507qyk.5.2009.10.12.00.57.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Oct 2009 00:57:40 -0700 (PDT) Message-ID: <4AD2E16C.9020200@gmail.com> Date: Mon, 12 Oct 2009 15:57:32 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: Obtain ip address in lua script References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Awadhesh Kumar wrote: > [snip] > *but i got the error "A Field extractor must be defined before Taps or > Dissectors get called" in wireshark. Please help me how to define > extarctor before dissectors gets called. Shouldn't you ask this on a Wireshark mailing list? -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 06:26:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9C9QJCU001404; Mon, 12 Oct 2009 06:26:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9724E1A692; Mon, 12 Oct 2009 07:25:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from autonomy.com (autnvector.autonomy.com [193.82.52.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53C441A676 for ; Mon, 12 Oct 2009 07:25:01 -0200 (BRST) Received: from jonathantt61 by autonomy.com (Cipher TLSv1:RC4-MD5:128) (MDaemon PRO v9.6.5) with ESMTP id md50013638492.msg for ; Mon, 12 Oct 2009 10:25:39 +0100 X-Spam-Processed: autonomy.com, Mon, 12 Oct 2009 10:25:39 +0100 (not processed: spam filter heuristic analysis disabled) X-MDRemoteIP: 86.159.21.199 X-Return-Path: jonathan.taylor@autonomy.com X-Envelope-From: jonathan.taylor@autonomy.com X-MDaemon-Deliver-To: lua@bazar2.conectiva.com.br From: "Jonathan Taylor" To: Subject: luaplus source code Date: Mon, 12 Oct 2009 10:25:31 +0100 Message-ID: <000f01ca4b1d$f1cd9f80$d568de80$@taylor@autonomy.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0010_01CA4B26.53920780" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpLHfEkVvye9xVDSdK8yFuJPeOxkA== Content-Language: en-gb X-MDAV-Processed: autonomy.com, Mon, 12 Oct 2009 10:25:40 +0100 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0010_01CA4B26.53920780 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Does anybody know where I can get hold of source code for luaplus. The specific functionality I need to include is handling of wide character strings (including reading and writing) and the find file features. Thanks, Jonathan Taylor Technical Specialist Autonomy Systems Limited +44 7771 534519 The information contained in this message is for the intended addressee only and may contain confidential and/or privileged information. If you are not the intended addressee, please delete this message and notify the sender, and do not copy or distribute this message or disclose its contents to anyone. Any views or opinions expressed in this message are those of the author and do not necessarily represent those of Autonomy Systems Limited or of any of its associated companies. No reliance may be placed on this message without written confirmation from an authorised representative of the company. Autonomy Systems Limited, Registered Office: Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, Registered Number 03063054. ------=_NextPart_000_0010_01CA4B26.53920780 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Does anybody know where I can get hold of source = code for luaplus. The specific functionality I need to include is handling of = wide character strings (including reading and writing) and the find file = features.

 

Thanks,

 

Jonathan Taylor

Technical Specialist

Autonomy Systems Limited

+44 7771 534519

 

The information contained in this message is for the intended addressee only = and may contain confidential and/or privileged  information.  If = you are not the intended addressee, please delete this message and notify the = sender, and do not copy or distribute this message or disclose its contents to anyone.  Any views or opinions expressed in this message are those = of the author and do not necessarily represent those of Autonomy Systems = Limited or of any of its associated companies.  No reliance may be placed on this message without written confirmation from an authorised representative = of the company.  Autonomy Systems Limited, Registered Office:  = Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, Registered Number = 03063054.

------=_NextPart_000_0010_01CA4B26.53920780-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 07:22:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CAMeYF005199; Mon, 12 Oct 2009 07:22:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF869189F6; Mon, 12 Oct 2009 08:21:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3575D1899C for ; Mon, 12 Oct 2009 08:21:19 -0200 (BRST) Received: by pzk34 with SMTP id 34so1484232pzk.11 for ; Mon, 12 Oct 2009 03:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:reply-to:from:to :subject:date:mime-version:content-type:content-transfer-encoding :x-priority:x-msmail-priority:importance:x-mailer:x-mimeole; bh=xW5mMBsYe9bGVozKR8z8luyjwqpLcMTbirSzDgD8fJs=; b=GmLp+xCHoP/teG9tPID5aIh8bQ2gw7DhRC6LBFOGPf8jNR0avWFJexTH66ywFbiPcV GsDZTkhNmdeBouKoNtioG6Xx/kiRjS6wjt1IeP+Xu2L33pufAuVX552nQH0faWbanzAv GNWfCKLKuSLlN3VF3a0/yBXVwTmKVZvz9K2EU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:reply-to:from:to:subject:date:mime-version:content-type :content-transfer-encoding:x-priority:x-msmail-priority:importance :x-mailer:x-mimeole; b=NkzXbphb6tjt8W7eAyU5uDoPWf1CUk89vgGk2dHmb0TKCmnhJDsVcxTdHD8i5A0G+w b/anGJXLzUbs/yajqPxJMoWE5ci+/pT6ZomDVPuqsEvYc5IfyRtp3SiQ8WvW+mBeAwT9 /idH6xAm/N1yHO34RoQBFWm07shOmOe0jtwMs= Received: by 10.114.30.7 with SMTP id d7mr9709200wad.30.1255342920742; Mon, 12 Oct 2009 03:22:00 -0700 (PDT) Received: from zhaoboqiangnb ([113.106.106.98]) by mx.google.com with ESMTPS id 21sm92683pxi.15.2009.10.12.03.21.57 (version=SSLv3 cipher=RC4-MD5); Mon, 12 Oct 2009 03:22:00 -0700 (PDT) Message-ID: <99DB62F0DA4441DA9F63FD82847ACCCA@zhaoboqiangnb> From: "ZhaoBoqiang" To: Subject: crash in newkey Date: Mon, 12 Oct 2009 18:11:25 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="gb2312"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks for the remind of Patrick Donnelly. My program encounter a crash. >From the dump, they are same. But I don't have a way to recreate this buy. I am using lua 5.1,not the recently version,but I compare the two version. the ltable.c have only modify one line. static TValue *newkey (lua_State *L, Table *t, const TValue *key) { Node *mp = mainposition(t, key); if (!ttisnil(gval(mp)) || mp == dummynode) { Node *othern; Node *n = getfreepos(t); /* get a free place */ if (n == NULL) { /* cannot find a free place? */ rehash(L, t, key); /* grow table */ return luaH_set(L, t, key); /* re-insert key into grown table */ } lua_assert(n != dummynode); othern = mainposition(t, key2tval(mp)); if (othern != mp) { /* is colliding node out of its main position? */ /* yes; move colliding node into free position */ -> while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ gnext(mp) = NULL; /* now `mp' is free */ setnilvalue(gval(mp)); } else { /* colliding node is in its own main position */ /* new node will go into free position */ gnext(n) = gnext(mp); /* chain new position */ gnext(mp) = n; mp = n; } } gkey(mp)->value = key->value; gkey(mp)->tt = key->tt; luaC_barriert(L, t, key); lua_assert(ttisnil(gval(mp))); return gval(mp); } crash in the "->" line. I have analysed the dump file. othern is 88 at this condition. and the call stack is: newkey luaV_settable while luaH_set luaV_execute while OP_MOD Thank you very much. Zwinger beckzar@hotmail.com From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 09:43:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CChaNs015741; Mon, 12 Oct 2009 09:43:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7F681A5DD; Mon, 12 Oct 2009 10:42:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DBFB18C2F for ; Mon, 12 Oct 2009 10:42:12 -0200 (BRST) Received: by bwz22 with SMTP id 22so7601690bwz.5 for ; Mon, 12 Oct 2009 05:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=DI0lWl95OcnCmKj8B+4+zKHncU67fqQi1SVECqsUqWA=; b=MtE5NqDYBtXDOFogfv/L/Lsw6g/Sks85UKc49wTlNxlQ33L4c6CMpBZZ6ZLeNyG1Yc UuSYbInapMXF+wKcbo+VgCDj+VMKyDs42GWSqWHCa1D0IjmxjtvFVxDMPFQ7KqXuu3GS ZotLgX8k9vCm9ka2DUTSgiVicAjzgnY/W5TFM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=jL6AuHwee89WhnUKbYP/FOihbcWlT7fm0z3buEdbr1mcxnQlxRpNL2DFwxd0XyAslV vTaaRb+EWaQoKYwEWhVnNAJ+QxjHp53V8xKRfBZq5w3Ii7mDplGKp3VYPjUUY4GT7qW7 QRqgweV4B1kMjt5+4pwBR8o/qcxGu7UoXdbzs= MIME-Version: 1.0 Received: by 10.223.4.86 with SMTP id 22mr1496212faq.65.1255351372246; Mon, 12 Oct 2009 05:42:52 -0700 (PDT) From: liam mail Date: Mon, 12 Oct 2009 13:42:32 +0100 Message-ID: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> Subject: LightUserData and metatables To: Lua list Content-Type: multipart/alternative; boundary=000e0ce076ce9c6ece0475bc4418 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0ce076ce9c6ece0475bc4418 Content-Type: text/plain; charset=ISO-8859-1 Whilst integrating C++ with Lua which enables the passing of C++ objects to Lua, calling methods, operators and vice versa I have encountered a problem with my current implementation. I use the method with is described on the wiki entitled Luna and which is also described in many other publications such as Game Programming Gems. The crux of my problem is that a new user data is only created when an object is currently not alive in Lua, when it is the pointer which was returned when the lua_newuserdata was created is pushed onto the stack using lua_pushlightuserdata and has it's metatable attached. This metatable defines the functions to be called for the operators such as __eq and __le; yet a lightuserdata is only equal to itself and does not look at the metatable to see if the operator is defined for the type, whilst it does look at the metatable for methods. Is there a way whilst still using the operators instead of say a le function (obj:le(rhs)) to accomplish this, or is using this type of function for the operator or using a table to represent the data the only method. Ie. is there a way to trick Lua into looking at the metatable of the lightuserdata for the operators without modifying the source of Lua itself? Thanks. --000e0ce076ce9c6ece0475bc4418 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Whilst integrating C++ with Lua which enables the passing of C++ objects to= Lua, calling methods, operators and vice versa I have encountered a proble= m with my current implementation. I use the method with is described on the= wiki entitled Luna and which is also described in many other publications = such as Game Programming Gems.
The crux of my problem is that a new user data is only created when an obje= ct is currently not alive in Lua, when it is the pointer which was returned= when the lua_newuserdata was created is pushed onto the stack using lua_pu= shlightuserdata and has it's metatable attached. This metatable defines= the functions to be called for the operators such as __eq and __le; yet a = lightuserdata is only equal to itself and does not look at the metatable to= see if the operator is defined for the type, whilst it does look at the me= tatable for methods.

Is there a way whilst still using the operators instead of say a le fun= ction (obj:le(rhs)) to accomplish this, or is using this type of function f= or the operator or using a table to represent the data the only method. Ie.= is there a way to trick Lua into looking at the metatable of the lightuser= data for the operators without modifying the source of Lua itself?
Thanks.

--000e0ce076ce9c6ece0475bc4418-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 09:45:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CCjf7N016072; Mon, 12 Oct 2009 09:45:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 688361A660; Mon, 12 Oct 2009 10:44:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4368F18CF4 for ; Mon, 12 Oct 2009 10:44:30 -0200 (BRST) Received: (qmail 21885 invoked by uid 399); 12 Oct 2009 06:45:07 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 12 Oct 2009 06:45:07 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AD324D6.10008@workspacewhiz.com> Date: Mon, 12 Oct 2009 06:45:10 -0600 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: luaplus source code References: <000f01ca4b1d$f1cd9f80$d568de80$@taylor@autonomy.com> In-Reply-To: <000f01ca4b1d$f1cd9f80$d568de80$@taylor@autonomy.com> Content-Type: multipart/alternative; boundary="------------080904080606050405010400" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------080904080606050405010400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ----- Original Message ----- From: Jonathan Taylor Date: 10/12/2009 3:25 AM > > Does anybody know where I can get hold of source code for luaplus. The > specific functionality I need to include is handling of wide character > strings (including reading and writing) and the find file features. > > Methods of obtaining the LuaPlus source code are available on http://luaplus.org/. Specifically, the latest LuaPlus code can be obtained from |svn://svn.luaplus.org/LuaPlus/work51. Josh | --------------080904080606050405010400 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ----- Original Message -----
From: Jonathan Taylor
Date: 10/12/2009 3:25 AM

Does anybody know where I can get hold of source code for luaplus. The specific functionality I need to include is handling of wide character strings (including reading and writing) and the find file features.


Methods of obtaining the LuaPlus source code are available on http://luaplus.org/.  Specifically, the latest LuaPlus code can be obtained from svn://svn.luaplus.org/LuaPlus/work51.

Josh
--------------080904080606050405010400-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:08:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CD8p50018178; Mon, 12 Oct 2009 10:08:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B20F1A671; Mon, 12 Oct 2009 11:07:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6460018955 for ; Mon, 12 Oct 2009 11:07:34 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1922704eye.39 for ; Mon, 12 Oct 2009 06:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=gpT3+ytOkMtw20Ynp7GCPZXdU6MCnBx8F7CCA788VSA=; b=KEDR5DdOfN5ugIXC17TODF067tqhAoBcUtU0eb/f/cGzZoK9IqGqKu0zdN5mQKaceN sUy8hGmLXyyk+ZeBYY0dTs+UGbnVj4RC72ew1b2yOLT10WLRBtyBRvVd/9quEqsBmYv6 3kvOP6HXbsC3ysa/XJdI7f1C32boATaZJR7bQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=GjIf3ncjL52ZIMRnk/rvMMUGxQ6eV6Ye9pGu6SxXWW4rMhtopXtwzlrIuKe8RYAOyR tqexwFVys+El8RwmAbqux0VcAkry0Uj3JAfa6kssR7IAw73mxBomYeY0i8Tz4sU5TI3M oyvx9Xt2LUVoamBaOQGdXxUCvKbyrqiMzh/xU= MIME-Version: 1.0 Received: by 10.216.87.3 with SMTP id x3mr1970689wee.132.1255352895128; Mon, 12 Oct 2009 06:08:15 -0700 (PDT) In-Reply-To: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> From: Jerome Vuarand Date: Mon, 12 Oct 2009 15:07:55 +0200 Message-ID: <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> Subject: Re: LightUserData and metatables To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/12 liam mail : > Whilst integrating C++ with Lua which enables the passing of C++ objects to > Lua, calling methods, operators and vice versa I have encountered a problem > with my current implementation. I use the method with is described on the > wiki entitled Luna and which is also described in many other publications > such as Game Programming Gems. > The crux of my problem is that a new user data is only created when an > object is currently not alive in Lua, when it is the pointer which was > returned when the lua_newuserdata was created is pushed onto the stack using > lua_pushlightuserdata and has it's metatable attached. This metatable > defines the functions to be called for the operators such as __eq and __le; > yet a lightuserdata is only equal to itself and does not look at the > metatable to see if the operator is defined for the type, whilst it does > look at the metatable for methods. > > Is there a way whilst still using the operators instead of say a le function > (obj:le(rhs)) to accomplish this, or is using this type of function for the > operator or using a table to represent the data the only method. Ie. is > there a way to trick Lua into looking at the metatable of the lightuserdata > for the operators without modifying the source of Lua itself? Your first paragraph is a little confusing. I'm not sure what you did exactly, and what userdata is full or light. Light userdata are not meant to represent objects, but rather as a convenience to pass C values around. If you have a C object that you want to manipulate from Lua you should embed them in a full userdata. You cannot push a full userdata. What you can do however is associate a userdata with its address in some table (e.g. the registry), and from the address you can push back the full userdata with a table indexing operation (lua_gettable). From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:18:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDIUCf018972; Mon, 12 Oct 2009 10:18:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EE561A6A1; Mon, 12 Oct 2009 11:17:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CAA01A676 for ; Mon, 12 Oct 2009 11:17:04 -0200 (BRST) Received: by fxm12 with SMTP id 12so2681222fxm.5 for ; Mon, 12 Oct 2009 06:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=nfMPz2qkVKKSlAe+qKRv2Y7+adyKNlFYTgHsd5XwaHM=; b=jAG35VuPh7uAOVvnFy/2a6XXHarxQNfwIY4pn7qdzUkqb2Ah+FuHsEVlffYYmwjhqP Dqh+s/31qjdvVCfW1hCt6m/dhXRxUP0nxamzWx8X5pzwqJLMM8A7EnTPwUjKE8QTf4HB 8bBOf7OJ5aCnLAof0vNeQzTrthb2bdqoLm4m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=QG5HNwEHgfP9BJDHs2dRrV9wnufZAPGYTOGrU0sSrqW7rkT6iNge+I53fveH56+oc3 D6mxYzgV3JA5l53ggn8WCFmkilaTjMGXfP8gl/t5QjbL9qpMdkRiI9O67/6E1sBf+rom lXP3RkhDVe0xAxJ6uySeCYRaIqnsPcdV9cSa0= MIME-Version: 1.0 Received: by 10.204.152.154 with SMTP id g26mr5080300bkw.54.1255353465443; Mon, 12 Oct 2009 06:17:45 -0700 (PDT) Date: Mon, 12 Oct 2009 08:17:45 -0500 X-Google-Sender-Auth: 03687bb7b8af8a11 Message-ID: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Subject: single quotes vs. double quotes From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175d09de6016180475bcc143 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d09de6016180475bcc143 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In most languages (not only scripting) the use of single quotes is faster than double quotes, does it is applicable in Lua? perhaps for the other way= s define strings? Blessings! --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175d09de6016180475bcc143 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In most languages (not only scripting) the use of single quotes is faster t= han double quotes, does it is applicable in Lua? perhaps for the other ways= define strings?

Blessings!

--
Fernando P. = Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina= Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje pien= sa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. <= br> --0015175d09de6016180475bcc143-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:21:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDLGic019216; Mon, 12 Oct 2009 10:21:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFE141A6A8; Mon, 12 Oct 2009 11:20:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C4651A676 for ; Mon, 12 Oct 2009 11:20:09 -0200 (BRST) Received: by fxm12 with SMTP id 12so2683782fxm.5 for ; Mon, 12 Oct 2009 06:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=j90xgrhTNRqRzgA68+KyUqUSA/eticPjHFQaWtNVqN4=; b=nJ2RpUOhg1++Ml0LP5I2JsVu0995v4pvLyXSlBecSz3ov3nvAYH4D4snFzpCQ+iivX Ab8yhHC5AEbnWVf+mBoLEBiR2t+oEouvKEDWtb5j+9so1ZWCMo2hcUUJBA4f8Y39hE4C SaRObRM4ZAcaIXVP1dXYDKjXFXJAetLgcrBwM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eXJlmwb9D0NU2n+02TKNSwyUcTY118e9Gx/LQpYCxFNYuyCbHK5UhlfKKlOUSI90Yi zYKA9d4RTP54MwVMPuRyB9Z0KeypGsQbHPeLJOC6CJMFHaYlfAriXK4clhMmrE337wJA RF47626WtrCpaH6Gv6pwgVLSsYJic/vaOJiAg= MIME-Version: 1.0 Received: by 10.239.141.145 with SMTP id c17mr393977hba.14.1255353650790; Mon, 12 Oct 2009 06:20:50 -0700 (PDT) In-Reply-To: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Date: Mon, 12 Oct 2009 15:20:50 +0200 Message-ID: <560972290910120620w22c993adtcbacacf0d220c3c@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CDLGic019216 2009/10/12 Fernando P. García : > In most languages (not only scripting) the use of single quotes is faster > than double quotes, does it is applicable in Lua? perhaps for the other ways > define strings? No difference at all. Athough it's wise to be consistent ;) Lua has another way of doing strings, [[such as this\n]]. This can be multiline, and that '\n' is not a special escape. Otherwise, however, exactly the same object From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:23:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDN1nv019411; Mon, 12 Oct 2009 10:23:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4AB01A6B1; Mon, 12 Oct 2009 11:22:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BCDF1A676 for ; Mon, 12 Oct 2009 11:21:57 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MxKr5-0005tf-HU for ; Mon, 12 Oct 2009 14:22:27 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MxKrH-0005b8-6w for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 14:22:39 +0100 Date: Mon, 12 Oct 2009 14:22:38 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: single quotes vs. double quotes Message-ID: <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> In-Reply-To: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CDN1nv019411 On Mon, 12 Oct 2009 08:17:45 -0500 Fernando P. García wrote: > In most languages (not only scripting) the use of single quotes is > faster than double quotes, does it is applicable in Lua? perhaps for > the other ways define strings? In some languages, string interpolation happens with one style of quotes, but not the others. Lua does no form of string interpolation on literals; all three types of string delimiters are compiled to identical byte code; there is no performance penalty for favouring one over the other. B. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:33:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDXQ2n020833; Mon, 12 Oct 2009 10:33:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D07191A6A6; Mon, 12 Oct 2009 11:32:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A480C18688 for ; Mon, 12 Oct 2009 11:32:18 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id C10C1E20A5 for ; Mon, 12 Oct 2009 15:32:59 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xaTNsHUMjhs7 for ; Mon, 12 Oct 2009 15:32:57 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id BE2A6E20B6; Mon, 12 Oct 2009 15:32:57 +0200 (CEST) Date: Mon, 12 Oct 2009 15:32:57 +0200 From: Ico To: Lua list Subject: Re: single quotes vs. double quotes Message-ID: <20091012133257.GU13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean > In most languages (not only scripting) the use of single quotes is faster > than double quotes, does it is applicable in Lua? perhaps for the other ways > define strings? When in doubt, just test. code = { double = [[ a = "test 1234\n" ]], single = [[ a = 'test 1234\n' ]], long = [=[ a = [[test 1234\n]] ]=] } for type, line in pairs(code) do t1 = os.time() while t1 == os.time() do end t1 = t1 + 1 count = 0 while t1 == os.time() do chunk = loadstring(line) chunk() count = count + 1 end print(type, count) end (bad example because of the os.time() overhead in each loop, but sure to complete in a few seconds) Result on my intel 2.2Ghz show no sigificant difference: double 257167 long 251103 single 254788 -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:33:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDXsIZ020917; Mon, 12 Oct 2009 10:33:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 258691A6C1; Mon, 12 Oct 2009 11:32:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C89DC1A6B2 for ; Mon, 12 Oct 2009 11:32:40 -0200 (BRST) Received: by bwz22 with SMTP id 22so7635929bwz.5 for ; Mon, 12 Oct 2009 06:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Iqhe1waduxopBYbikvb8UimqqwExDJo9lu+kt15cbS4=; b=Yj1cdNWQ3EYEqgjFr2EhkTqhFuWucDb7UBcPHxF5vCMqTZZSo4jN0R1HoIhylq5IIA ATNh0Ol5eXIa4jLw21jwH/LJoozoQPFBipRBLz+6HOSF/uGGa+tZbf0GlEnLZaJprlFe zTp0dfZvKgX1sUHKvqPIrAACdv9EnAsK8Uk+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v9Qu7sVdoHfiboIwmhtexlygoGBFIqsydOJFXhlNSGXufBZru9gdrjLYVh8Pvm/NHN 3tTjnNsIEbOkiWAdF1LS4Xsbt8iGvJMYZbafQEFLE+WMCQL+w74Ok9IxZeFk7zh5POea JKFoOWK1NnfzJvYElrRZMkI55f3pdNW+gASbU= MIME-Version: 1.0 Received: by 10.223.4.27 with SMTP id 27mr1368333fap.48.1255354402100; Mon, 12 Oct 2009 06:33:22 -0700 (PDT) In-Reply-To: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Date: Mon, 12 Oct 2009 14:33:22 +0100 Message-ID: Subject: Re: single quotes vs. double quotes From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CDXsIZ020917 2009/10/12 Fernando P. García : > In most languages (not only scripting) the use of single quotes is faster > than double quotes, does it is applicable in Lua? perhaps for the other ways > define strings? > > Blessings! I don't know about *most* languages - there are a couple that have variable interpolation in double-quoted strings but not single-quoted, but it does not happen at all in Lua. In non-scripting languages it seems like single characters are mainly used to delimit single character values, not strings, so it's not really comparable. Also, remember that Lua code is always compiled before it runs. As long as you are not compiling your code constantly it would never matter how string literals are defined anyway, they all become the same thing in the bytecode. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:35:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDZYjw021080; Mon, 12 Oct 2009 10:35:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3A261A6CB; Mon, 12 Oct 2009 11:34:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5D181A6B2 for ; Mon, 12 Oct 2009 11:34:28 -0200 (BRST) Received: by fxm12 with SMTP id 12so2695694fxm.5 for ; Mon, 12 Oct 2009 06:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=J0zvneeUNhQdtlLcMIsdsT0HwhmHGei4SjCmO5C2ZgQ=; b=Ise7N0WjmTDt3ntaJsaHKYNvo/fzW54v/7pBAYItP7YJ4jbrw1vFuvf9xsdLS9x0+s Dcr3GnJwhbbTkIjA/Ik388TQ5UZiz1omnmJRPG/QX2ug4Lyhwcxd6feEAeKObuHgV7Yh D8BqXtlUe85oocAtiqDW8NEZEnnwQM+NL61rA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YPLYBHRHTMU1QfQaJwBPLo/Rr0SZetB1wT+q6X0ZVhiLhfsTYeT1xhoTcwLoZkHrwx CLV7p2hRbOzl0LwqNt6zHVebgeOheFpuui5ef/CqfmnVIiHDHTmR6SVQ0oSmqEZiJtno 2oyMmssJ1eyGlS8mNU+lF1WN0UrfLtfSvTwDY= MIME-Version: 1.0 Received: by 10.223.54.15 with SMTP id o15mr1472984fag.96.1255354509788; Mon, 12 Oct 2009 06:35:09 -0700 (PDT) In-Reply-To: References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Date: Mon, 12 Oct 2009 14:35:09 +0100 Message-ID: Subject: Re: single quotes vs. double quotes From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 12, 2009 at 2:33 PM, Duncan Cross wrote: > (...) it seems like single characters are mainly used (...) Sorry, I meant "single quotes" here -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:36:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDaGGm021204; Mon, 12 Oct 2009 10:36:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD22F1A6D0; Mon, 12 Oct 2009 11:35:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 062651A6B2 for ; Mon, 12 Oct 2009 11:35:10 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 3C69CE20B7 for ; Mon, 12 Oct 2009 15:35:52 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zPjzHaCGrMOu for ; Mon, 12 Oct 2009 15:35:50 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id 1CF2AE20B6; Mon, 12 Oct 2009 15:35:50 +0200 (CEST) Date: Mon, 12 Oct 2009 15:35:50 +0200 From: Ico To: Lua list Subject: Re: single quotes vs. double quotes Message-ID: <20091012133550.GV13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-12 Rob Kendrick wrote : > On Mon, 12 Oct 2009 08:17:45 -0500 > Fernando P. García wrote: > > > In most languages (not only scripting) the use of single quotes is > > faster than double quotes, does it is applicable in Lua? perhaps for > > the other ways define strings? > > In some languages, string interpolation happens with one style of > quotes, but not the others. Lua does no form of string interpolation > on literals; all three types of string delimiters are compiled to > identical byte code; there is no performance penalty for favouring one > over the other. There is a difference: in double quotes escape sequences are translated. So a = "one\ntwo" gives a differnet result then a = 'one\ntwo' -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:37:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDbsfs021351; Mon, 12 Oct 2009 10:37:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A6CE1A6D7; Mon, 12 Oct 2009 11:36:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 860021A6B2 for ; Mon, 12 Oct 2009 11:36:39 -0200 (BRST) Received: by bwz22 with SMTP id 22so7638828bwz.5 for ; Mon, 12 Oct 2009 06:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=xJSZKkgiBagdOa81Tq+cbhOvc0IoeDsM2gkA37fD8R8=; b=pxCa9yQAi6MfotdZi+ZPBmFKjCY9ikes6/pFbQYHxpZetd/zotb9eeftstNCCJE7Dx fmJ0DNs+bUOj2LDVrb+D+6QeablMmnDzfnIoErXN7L+/pvBBOdV1lpJVnyPTsaxDi5Ul aF4BDNY4enX/pxaShzxahkAcDx82w2P0bMT08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Atro9rMBzYksEnb1jcNWy3EQxJTKibZpReYTwegoRYptB6giDve7NOAZrUoI2vXjjk DxDdSqhouFclzkuw/QefV93OgHCPlhFlgKceXpzrbDq7DdYZPhV/Sioey5d4v54PJCaN x8Z/HY0UyIRgTtdFXkrC7D4LwL3yL3BQeLaaE= MIME-Version: 1.0 Received: by 10.204.3.220 with SMTP id 28mr5173412bko.4.1255354641213; Mon, 12 Oct 2009 06:37:21 -0700 (PDT) In-Reply-To: <20091012133550.GV13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> Date: Mon, 12 Oct 2009 08:37:21 -0500 X-Google-Sender-Auth: 59d2a172290638e0 Message-ID: <5ba75e2f0910120637kde1eb51od1e67474b2c7a012@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1e22274e93c0475bd076c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1e22274e93c0475bd076c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable '\n' works for me also, or is it a Linux-only exception? Blessings! On Mon, Oct 12, 2009 at 8:35 AM, Ico wrote: > > > * On 2009-10-12 Rob Kendrick wrote : > > > On Mon, 12 Oct 2009 08:17:45 -0500 > > Fernando P. Garc=C3=ADa wrote: > > > > > In most languages (not only scripting) the use of single quotes is > > > faster than double quotes, does it is applicable in Lua? perhaps for > > > the other ways define strings? > > > > In some languages, string interpolation happens with one style of > > quotes, but not the others. Lua does no form of string interpolation > > on literals; all three types of string delimiters are compiled to > > identical byte code; there is no performance penalty for favouring one > > over the other. > > There is a difference: in double quotes escape sequences are > translated. So > > a =3D "one\ntwo" > > gives a differnet result then > > a =3D 'one\ntwo' > > > -- > :wq > ^X^Cy^K^X^C^C^C^C > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000e0cd1e22274e93c0475bd076c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable '\n' works for me also, or is it a Linux-only exception?

Ble= ssings!

On Mon, Oct 12, 2009 at 8:35 AM, = Ico <lua@zevv.nl>= ; wrote:


* On 2009-10-12 Rob Kendrick <lua-l@= nun.org.uk> wrote =C2=A0:

> On Mon, 12 Oct 2009 08:17:45 -0500
> Fernando P. Garc=C3=ADa <f= ernando@develcuy.com> wrote:
>
> > In most languages (not only scripting) the use of single quotes i= s
> > faster than double quotes, does it is applicable in Lua? perhaps = for
> > the other ways define strings?
>
> In some languages, string interpolation happens with one style of
> quotes, but not the others. =C2=A0Lua does no form of string interpola= tion
> on literals; all three types of string delimiters are compiled to
> identical byte code; there is no performance penalty for favouring one=
> over the other.

There is a difference: in double quotes escape sequences are translated. So

=C2=A0a =3D "one\ntwo"

gives a differnet result then

=C2=A0a =3D 'one\ntwo'


--
:wq
^X^Cy^K^X^C^C^C^C



--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000e0cd1e22274e93c0475bd076c-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:40:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDeQtx021621; Mon, 12 Oct 2009 10:40:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 967551A6DA; Mon, 12 Oct 2009 11:39:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DAC51A6B2 for ; Mon, 12 Oct 2009 11:39:17 -0200 (BRST) Received: by fxm12 with SMTP id 12so2699785fxm.5 for ; Mon, 12 Oct 2009 06:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=LG8YfEYQj4LLfzAZqS1I19HG5vxn7eVvVqPcuSCEnMo=; b=Ms+G9s6d/EJb4nVeXSQXPIPiOu3RQAMKpuGieBrwK6kT2zjb0X/4sZBaXtYVXc5Xyj i+4JrNA3q1ht8SggWah8TX5TFCueYJTwod25pyn2FLcNa0FLTAlbXXdxDDAV4pJEtPMA XjX4fq1y3YhlKfGp8TrRk/XB01It6XcKgxOWk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oFUYX4ItpD/5oSU4o+uCJ/TTSBQMtFiFHH1Vq/l4TnhN0ZHxb/Ok8p892A6GmzmUm4 dJKU+wP6HRWACB6xbfG7fSWY563REWpybRxLbg+YxpBvT/4MLacdrY+Av9N+9/Mq9sgI KgV7cNOZrS1My2aGt5HVQMNxCcLZ9PQCHIlhI= MIME-Version: 1.0 Received: by 10.239.143.227 with SMTP id l35mr375106hba.164.1255354798898; Mon, 12 Oct 2009 06:39:58 -0700 (PDT) In-Reply-To: <20091012133550.GV13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> Date: Mon, 12 Oct 2009 15:39:58 +0200 Message-ID: <560972290910120639i73f3689cs3ab5a751c5b139be@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CDeQtx021621 On Mon, Oct 12, 2009 at 3:35 PM, Ico wrote: > There is a difference: in double quotes escape sequences are > translated. So > >  a = "one\ntwo" > > gives a differnet result then > >  a = 'one\ntwo' Surely not! Works the same here in Africa ... From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:41:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDf42Y021731; Mon, 12 Oct 2009 10:41:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADDC81A6E0; Mon, 12 Oct 2009 11:40:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 995BE1A6B2 for ; Mon, 12 Oct 2009 11:39:56 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id CCC3CE20A5 for ; Mon, 12 Oct 2009 15:40:38 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y8LBvYixOuQU for ; Mon, 12 Oct 2009 15:40:36 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id BD329E20B6; Mon, 12 Oct 2009 15:40:36 +0200 (CEST) Date: Mon, 12 Oct 2009 15:40:36 +0200 From: Ico To: Lua list Subject: Re: single quotes vs. double quotes Message-ID: <20091012134036.GW13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> <5ba75e2f0910120637kde1eb51od1e67474b2c7a012@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ba75e2f0910120637kde1eb51od1e67474b2c7a012@mail.gmail.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-12 Fernando P. García wrote : > '\n' works for me also, or is it a Linux-only exception? My bad: you are completely right, and I was completely wrong. -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:43:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDhd7x021940; Mon, 12 Oct 2009 10:43:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B877F1A6DE; Mon, 12 Oct 2009 11:42:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA6D01A6B2 for ; Mon, 12 Oct 2009 11:42:31 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id A3BCBE20A5 for ; Mon, 12 Oct 2009 15:43:13 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ugStVM5tVsIg for ; Mon, 12 Oct 2009 15:43:11 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id DE608E20B6; Mon, 12 Oct 2009 15:43:11 +0200 (CEST) Date: Mon, 12 Oct 2009 15:43:11 +0200 From: Ico To: Lua list Subject: Re: single quotes vs. double quotes Message-ID: <20091012134311.GX13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091012133550.GV13463@pruts.nl> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-12 Ico wrote : > > In some languages, string interpolation happens with one style of > > quotes, but not the others. Lua does no form of string interpolation > > on literals; all three types of string delimiters are compiled to > > identical byte code; there is no performance penalty for favouring one > > over the other. > > There is a difference: in double quotes escape sequences are > translated. So > > a = "one\ntwo" > > gives a differnet result then > > a = 'one\ntwo' Wrong, wrong wrong. I ment the long-bracket string format: a = [[one\ntwo]] -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:49:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDnaAO022506; Mon, 12 Oct 2009 10:49:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A78EF1A6B2; Mon, 12 Oct 2009 11:48:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B9E518743 for ; Mon, 12 Oct 2009 11:48:22 -0200 (BRST) Received: by bwz22 with SMTP id 22so7647388bwz.5 for ; Mon, 12 Oct 2009 06:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=FjT/zzbSZp53Dnn9OqcX2esoYear9LJw9kalfvprfWs=; b=hp2yOVSrS4qUT1bSBPdHmq/jNJXC6AXAQ/A+ArmKxW2EXt/T4bCVErXhi4+iQ8RLzV cp2iJ/pARKSDduIMovOGMOpD/t8IQn7UlxEVmSICyJu+Kj3C4Br6RYK+Sq9GTwdSZk4N wEXRRk2EVUmKMw3rfvXuMRKyhdi59W9JGlGeE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=iuySSgFMwcLGQTSf6idvh9iGEqu7SW/dYi9HQ/BRz5aiM3HJGmO7REIpeiiccTX/L8 1JQ4sXemxNmoqHnd6fufz8TB+XQYuib1DU8yY7ARa6ySoYxMVzznyCXwoQMhVaFq31DD /khtTueyc5+vRudpvfANpTO/9PiiUdf/0ga0c= MIME-Version: 1.0 Received: by 10.204.156.18 with SMTP id u18mr5125311bkw.102.1255355343962; Mon, 12 Oct 2009 06:49:03 -0700 (PDT) In-Reply-To: <20091012133257.GU13463@pruts.nl> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012133257.GU13463@pruts.nl> Date: Mon, 12 Oct 2009 08:49:03 -0500 X-Google-Sender-Auth: 1ad9de2c2edde40d Message-ID: <5ba75e2f0910120649h87e2ea5kd8fc4d002cd9e919@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cabde5801e70475bd3183 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cabde5801e70475bd3183 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable First try (lua cli) double 223750 long 220468 single 226838 Second try (lua cli) double 223459 long 226024 single 229658 Third try (lua test.lua) double 230783 long 226451 single 232939 Forth try (lua test.lua) double 229398 long 225754 single 23042 I guess the test can done other way, perhaps generating 5000 aleatory lines of string for every case and measure which is parsed faster. Blessings! On Mon, Oct 12, 2009 at 8:32 AM, Ico wrote: > > > In most languages (not only scripting) the use of single quotes is fast= er > > than double quotes, does it is applicable in Lua? perhaps for the other > ways > > define strings? > > When in doubt, just test. > > code =3D { > double =3D [[ a =3D "test 1234\n" ]], > single =3D [[ a =3D 'test 1234\n' ]], > long =3D [=3D[ a =3D [[test 1234\n]] ]=3D] > } > > for type, line in pairs(code) do > t1 =3D os.time() > while t1 =3D=3D os.time() do end > t1 =3D t1 + 1 > count =3D 0 > while t1 =3D=3D os.time() do > chunk =3D loadstring(line) > chunk() > count =3D count + 1 > end > print(type, count) > end > > (bad example because of the os.time() overhead in each loop, but sure to > complete in a few seconds) > > Result on my intel 2.2Ghz show no sigificant difference: > > double 257167 > long 251103 > single 254788 > > > -- > :wq > ^X^Cy^K^X^C^C^C^C > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cabde5801e70475bd3183 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable First try (lua cli)
double=C2=A0 223750
long=C2=A0=C2=A0=C2=A0 220468=
single=C2=A0 226838

Second try (lua cli)
double=C2=A0 223459<= br>long=C2=A0=C2=A0=C2=A0 226024
single=C2=A0 229658

Third try (l= ua test.lua)
double=C2=A0 230783
long=C2=A0=C2=A0=C2=A0 226451
single=C2=A0 232939

Forth try (lua test.lua)
double=C2=A0 229398<= br>long=C2=A0=C2=A0=C2=A0 225754
single=C2=A0 23042

I guess the t= est can done other way, perhaps generating 5000 aleatory lines of string fo= r every case and measure which is parsed faster.

Blessings!


On Mon, Oct 12, 2009 a= t 8:32 AM, Ico <lua@zev= v.nl> wrote:

> In most languages (not only scripting) the use of single quotes is fas= ter
> than double quotes, does it is applicable in Lua? perhaps for the othe= r ways
> define strings?

When in doubt, just test.

code =3D {
=C2=A0double =3D [[ a =3D "test 1234\n" ]],
=C2=A0single =3D [[ a =3D 'test 1234\n' ]],
=C2=A0long =C2=A0 =3D [=3D[ a =3D [[test 1234\n]] ]=3D]
}

for type, line in pairs(code) do
=C2=A0 =C2=A0 =C2=A0 =C2=A0t1 =3D os.time()
=C2=A0 =C2=A0 =C2=A0 =C2=A0while t1 =3D=3D os.time() do end
=C2=A0 =C2=A0 =C2=A0 =C2=A0t1 =3D t1 + 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0count =3D 0
=C2=A0 =C2=A0 =C2=A0 =C2=A0while t1 =3D=3D os.time() do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0chunk =3D loadstrin= g(line)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0chunk()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0count =3D count + 1=
=C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0 =C2=A0 =C2=A0print(type, count)
end

(bad example because of the os.time() overhead in each loop, but sure to complete in a few seconds)

Result on my intel 2.2Ghz show no sigificant difference:

double =C2=A0257167
long =C2=A0 =C2=A0251103
single =C2=A0254788


--
:wq
^X^Cy^K^X^C^C^C^C



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cabde5801e70475bd3183-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:51:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDpEsL022691; Mon, 12 Oct 2009 10:51:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA04E1A6E8; Mon, 12 Oct 2009 11:50:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailrelay2.kpn.net (mailrelay2.kpn.net [194.151.226.228]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4AB2218743 for ; Mon, 12 Oct 2009 11:50:10 -0200 (BRST) Received: from boskalis.nl (mail.boskalis.nl [193.173.151.149]) by mailrelay2.kpn.net (8.13.6/8.13.6) with ESMTP id n9CDomwn005086 for ; Mon, 12 Oct 2009 15:50:50 +0200 (CEST) Received: from nlhub002.rbw-nl.boskalis.net ([192.168.7.62]) by mail.boskalis.nl with SMTP id n9CDomPd020751 for ; Mon, 12 Oct 2009 15:50:48 +0200 Received: from nlmbx002.rbw-nl.boskalis.net ([10.10.1.89]) by nlhub002.rbw-nl.boskalis.net with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Oct 2009 15:50:47 +0200 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: tolua++ question Date: Mon, 12 Oct 2009 15:50:47 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: tolua++ question thread-index: AcpLQwBBOhNE2mPnRZ20rGGyjGrvRw== From: "Elbers, H.P." To: X-OriginalArrivalTime: 12 Oct 2009 13:50:48.0127 (UTC) FILETIME=[00C4CCF0:01CA4B43] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CDpEsL022691 Hello, I'm trying to use tolua++ to bind existing C++ code. How to I bind a function like: int readstuff(void *buf, int len) The caller has to supply a buffer where the function stores the data. In this case buf must be able to contain len bytes, and the return values is the actual nr of bytes tored in bug by readstuff. Thanks, Hans PS: if there is a better way to use C++ classes in a Lua script, id' also be interested... From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 10:55:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CDtoWc023367; Mon, 12 Oct 2009 10:55:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96A0F1A6EA; Mon, 12 Oct 2009 11:54:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D32E418743 for ; Mon, 12 Oct 2009 11:54:36 -0200 (BRST) Received: by fxm12 with SMTP id 12so2712936fxm.5 for ; Mon, 12 Oct 2009 06:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=cWivCKgBHndO3svDLrudvacaEVA+DRX77wh+7rzAPeI=; b=DWRsJDjvVy75V88WCt39hhlUI/ZUNGxSjr0++TkPd9eMZdWVdT0QjxsryfWX4rYPDt 87nlQF4NwG4lTiZTT87nHKCZOhdVs5UozWiTdW/hNe1hhyUEGZ/Fojj8Nhcx92Un20oJ 9B+vRhtUr828VCt5Aogb3syIIt4IcmXXfMYtw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=RKEow0WJPCJZipUkVV5hjMAvcGNAUdz+uwUpQJDhi2B/q7GBwwwN0+oWBSKQNY3NVI aY/yunnY75+1q7a5EgQezrxB+6/RtAHH3XMmbqjg02sFjmBLWvS2/UK+PttLYHEaACPz yS40u7XfBu+wky1zSwdk369qajpfVMw8DXOR8= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr5049892bkw.154.1255355718413; Mon, 12 Oct 2009 06:55:18 -0700 (PDT) In-Reply-To: <5ba75e2f0910120649h87e2ea5kd8fc4d002cd9e919@mail.gmail.com> References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012133257.GU13463@pruts.nl> <5ba75e2f0910120649h87e2ea5kd8fc4d002cd9e919@mail.gmail.com> Date: Mon, 12 Oct 2009 08:55:18 -0500 X-Google-Sender-Auth: bfa4030e8c2ba9f6 Message-ID: <5ba75e2f0910120655h610745c0n2e11a17fce83aef1@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf772a9ad170475bd4778 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf772a9ad170475bd4778 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hum... comparing results from Ico, it seems like using the long format is faster, perhaps because the scaped sequences are not translated. Blessings! 2009/10/12 Fernando P. Garc=C3=ADa > First try (lua cli) > double 223750 > long 220468 > single 226838 > > Second try (lua cli) > double 223459 > long 226024 > single 229658 > > Third try (lua test.lua) > double 230783 > long 226451 > single 232939 > > Forth try (lua test.lua) > double 229398 > long 225754 > single 23042 > > I guess the test can done other way, perhaps generating 5000 aleatory lin= es > of string for every case and measure which is parsed faster. > > Blessings! > > > > On Mon, Oct 12, 2009 at 8:32 AM, Ico wrote: > >> >> > In most languages (not only scripting) the use of single quotes is >> faster >> > than double quotes, does it is applicable in Lua? perhaps for the othe= r >> ways >> > define strings? >> >> When in doubt, just test. >> >> code =3D { >> double =3D [[ a =3D "test 1234\n" ]], >> single =3D [[ a =3D 'test 1234\n' ]], >> long =3D [=3D[ a =3D [[test 1234\n]] ]=3D] >> } >> >> for type, line in pairs(code) do >> t1 =3D os.time() >> while t1 =3D=3D os.time() do end >> t1 =3D t1 + 1 >> count =3D 0 >> while t1 =3D=3D os.time() do >> chunk =3D loadstring(line) >> chunk() >> count =3D count + 1 >> end >> print(type, count) >> end >> >> (bad example because of the os.time() overhead in each loop, but sure to >> complete in a few seconds) >> >> Result on my intel 2.2Ghz show no sigificant difference: >> >> double 257167 >> long 251103 >> single 254788 >> >> >> -- >> :wq >> ^X^Cy^K^X^C^C^C^C >> > > > > -- > Fernando P. Garc=C3=ADa, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de t=C3=AD. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf772a9ad170475bd4778 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hum... comparing results from Ico, it seems like using the long format is f= aster, perhaps because the scaped sequences are not translated.

Bles= sings!

2009/10/12 Fernando P. Garc=C3=ADa= <fernando@de= velcuy.com>
First try (lua cl= i)
double=C2=A0 223750
long=C2=A0=C2=A0=C2=A0 220468
single=C2=A0 = 226838

Second try (lua cli)
double=C2=A0 223459
long=C2=A0=C2=A0=C2=A0 226024
single=C2=A0 229658=

Third try (lua test.lua)
double=C2=A0 230783
long=C2=A0=C2=A0= =C2=A0 226451
single=C2=A0 232939

Forth try (lua test.lua)
double=C2=A0 229398<= br>long=C2=A0=C2=A0=C2=A0 225754
single=C2=A0 23042

I guess the t= est can done other way, perhaps generating 5000 aleatory lines of string fo= r every case and measure which is parsed faster.

Blessings!



On Mon, Oct 12, 2009 at 8:32 AM, Ico <lua@zevv.nl> wro= te:

> In most languages (not only scripting) the use of single quotes is fas= ter
> than double quotes, does it is applicable in Lua? perhaps for the othe= r ways
> define strings?

When in doubt, just test.

code =3D {
=C2=A0double =3D [[ a =3D "test 1234\n" ]],
=C2=A0single =3D [[ a =3D 'test 1234\n' ]],
=C2=A0long =C2=A0 =3D [=3D[ a =3D [[test 1234\n]] ]=3D]
}

for type, line in pairs(code) do
=C2=A0 =C2=A0 =C2=A0 =C2=A0t1 =3D os.time()
=C2=A0 =C2=A0 =C2=A0 =C2=A0while t1 =3D=3D os.time() do end
=C2=A0 =C2=A0 =C2=A0 =C2=A0t1 =3D t1 + 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0count =3D 0
=C2=A0 =C2=A0 =C2=A0 =C2=A0while t1 =3D=3D os.time() do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0chunk =3D loadstrin= g(line)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0chunk()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0count =3D count + 1=
=C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0 =C2=A0 =C2=A0print(type, count)
end

(bad example because of the os.time() overhead in each loop, but sure to complete in a few seconds)

Result on my intel 2.2Ghz show no sigificant difference:

double =C2=A0257167
long =C2=A0 =C2=A0251103
single =C2=A0254788


--
:wq
^X^Cy^K^X^C^C^C^C



<= /div>
--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer = - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.



--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf772a9ad170475bd4778-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:04:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CE4ja3024103; Mon, 12 Oct 2009 11:04:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79D5C18A0C; Mon, 12 Oct 2009 12:03:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D98B018993 for ; Mon, 12 Oct 2009 12:03:36 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MxLVW-0008Bj-8h for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 16:04:14 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:04:14 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:04:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: single quotes vs. double quotes Date: Mon, 12 Oct 2009 16:04:04 +0200 Lines: 19 Message-ID: References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 12/10/2009 15:17, Fernando P. García wrote: > In most languages (not only scripting) the use of single quotes is > faster than double quotes Out of curiosity, what are these 'most' languages? In 'most' languages I know, they are either a very different thing (char vs. string in a number of C-like languages: C/C++/probably C#/Java...) or the same (Lua, JavaFX, JavaScript...). From what I know, they have indeed a different behavior in Perl-like languages (Perl, of course, PHP, Ruby...) with regard to variable interpolation and backslash interpretation. Are there many other similar languages with this behavior? -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:06:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CE6q6R024361; Mon, 12 Oct 2009 11:06:52 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A7A618A87; Mon, 12 Oct 2009 12:05:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CE3B18993 for ; Mon, 12 Oct 2009 12:05:38 -0200 (BRST) Received: by fxm12 with SMTP id 12so2722548fxm.5 for ; Mon, 12 Oct 2009 07:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=8tRbqpyiH6TgLE04JTZL1KHaxyTIYmUxKAG5OPV5gdw=; b=bxVaeenFmSYkCMfAp29fMlyVftKEk2Rx2rEVRHLHFOHxGvmpy+TLp3fzlfbMY9kkNq 4NvQ3CLksHPvXefXo2QxUalHlbw9mG7NAddfEElK5ecN+REVD9UEqXx8/scPSa1Q1fhk QEcODPfYywfAHjZPAoZ98ojYDe93SmCLd8eL8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=riJdmq4PWlAESUgoUT1vQy414t8lFCiFSXMDYrDhbEybW6xVwYknpU51HjDmjadCFM DIw34tF+BuFub1RtRDDmrW199NoBOP9d/aFQZoy1GzgwtoBkjg5/2nUFRZXmp9tXaInc fDb5/0Qx7wwCahyacFEbUXv/tTfxfCqd2EtxM= MIME-Version: 1.0 Received: by 10.223.58.139 with SMTP id g11mr1412167fah.43.1255356380186; Mon, 12 Oct 2009 07:06:20 -0700 (PDT) In-Reply-To: <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> From: liam mail Date: Mon, 12 Oct 2009 15:06:00 +0100 Message-ID: <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> Subject: Re: LightUserData and metatables To: Lua list Content-Type: multipart/alternative; boundary=000e0ce0eea81b87450475bd6ffd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0ce0eea81b87450475bd6ffd Content-Type: text/plain; charset=ISO-8859-1 2009/10/12 Jerome Vuarand > 2009/10/12 liam mail : > > Whilst integrating C++ with Lua which enables the passing of C++ objects > to > > Lua, calling methods, operators and vice versa I have encountered a > problem > > with my current implementation. I use the method with is described on the > > wiki entitled Luna and which is also described in many other publications > > such as Game Programming Gems. > > The crux of my problem is that a new user data is only created when an > > object is currently not alive in Lua, when it is the pointer which was > > returned when the lua_newuserdata was created is pushed onto the stack > using > > lua_pushlightuserdata and has it's metatable attached. This metatable > > defines the functions to be called for the operators such as __eq and > __le; > > yet a lightuserdata is only equal to itself and does not look at the > > metatable to see if the operator is defined for the type, whilst it does > > look at the metatable for methods. > > > > Is there a way whilst still using the operators instead of say a le > function > > (obj:le(rhs)) to accomplish this, or is using this type of function for > the > > operator or using a table to represent the data the only method. Ie. is > > there a way to trick Lua into looking at the metatable of the > lightuserdata > > for the operators without modifying the source of Lua itself? > > Your first paragraph is a little confusing. I'm not sure what you did > exactly, and what userdata is full or light. > > Light userdata are not meant to represent objects, but rather as a > convenience to pass C values around. If you have a C object that you > want to manipulate from Lua you should embed them in a full userdata. > You cannot push a full userdata. What you can do however is associate > a userdata with its address in some table (e.g. the registry), and > from the address you can push back the full userdata with a table > indexing operation (lua_gettable). > Sorry for the confusion I will try to explain again :) Say for example a C++ class instance is pushed to Lua twice for a Lua function parameters. The first time it is detected that the instance is not currently valid in Lua and therefore a full userdata is created and the returned pointer is stored to enable the validity check and also to allow it being exchanged again. When the same instance is passed the second time it is detected that the instance is valid in Lua, the pointer instance returned by the creating of the full user data is pushed onto the stack and the types metatable is associated with the light user data. This enables methods to be called on the light user data via a lookup in the metatable yet fails on the operators. Are you suggesting that the second time it is pushed the pointer returned from creating the full user data is pushed onto the stack then lua_gettable is called and this will enable the type to be seen as a full user data? If I do this is there still a need to attach the types metatable to the table pushed onto the stack via lua_gettable or should it be valid? Thanks. --000e0ce0eea81b87450475bd6ffd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/10/12 Jerome Vuarand <jerome.vuarand@gmail.co= m>
2009/10/12 liam mail <liam.l= ist@googlemail.com>:
> Whilst integrating C++ with Lua whic= h enables the passing of C++ objects to
> Lua, calling methods, operators and vice versa I have encountered a pr= oblem
> with my current implementation. I use the method with is described on = the
> wiki entitled Luna and which is also described in many other publicati= ons
> such as Game Programming Gems.
> The crux of my problem is that a new user data is only created when an=
> object is currently not alive in Lua, when it is the pointer which was=
> returned when the lua_newuserdata was created is pushed onto the stack= using
> lua_pushlightuserdata and has it's metatable attached. This metata= ble
> defines the functions to be called for the operators such as __eq and = __le;
> yet a lightuserdata is only equal to itself and does not look at the > metatable to see if the operator is defined for the type, whilst it do= es
> look at the metatable for methods.
>
> Is there a way whilst still using the operators instead of say a le fu= nction
> (obj:le(rhs)) to accomplish this, or is using this type of function fo= r the
> operator or using a table to represent the data the only method. Ie. i= s
> there a way to trick Lua into looking at the metatable of the lightuse= rdata
> for the operators without modifying the source of Lua itself?

Your first paragraph is a little confusing. I'm not sure wh= at you did
exactly, and what userdata is full or light.

Light userdata are not meant to represent objects, but rather as a
convenience to pass C values around. If you have a C object that you
want to manipulate from Lua you should embed them in a full userdata.
You cannot push a full userdata. What you can do however is associate
a userdata with its address in some table (e.g. the registry), and
from the address you can push back the full userdata with a table
indexing operation (lua_gettable).

Sorry for the confusion I will try to explain again = :)
Say for example a C++ class instance is pushed to Lua twice for a Lua= function parameters. The first time it is detected that the instance is no= t currently valid in Lua and therefore a full userdata is created and the r= eturned pointer is stored to enable the validity check and also to allow it= being exchanged again. When the same instance is passed the second time it= is detected that the instance is valid in Lua,=A0 the pointer instance ret= urned by the creating of the full user data is pushed onto the stack and th= e types metatable is associated with the light user data.
This enables methods to be called on the light user data via a lookup in th= e metatable yet fails on the operators.

Are you suggesting that the= second time it is pushed the pointer returned from creating the full user = data is pushed onto the stack then lua_gettable is called and this will ena= ble the type to be seen as a full user data? If I do this is there still a = need to attach the types metatable to the table pushed onto the stack via l= ua_gettable or should it be valid?
Thanks.
--000e0ce0eea81b87450475bd6ffd-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:09:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CE9Xt1024600; Mon, 12 Oct 2009 11:09:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 101D618B6F; Mon, 12 Oct 2009 12:08:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ED8A18993 for ; Mon, 12 Oct 2009 12:08:23 -0200 (BRST) Received: by fxm12 with SMTP id 12so2724922fxm.5 for ; Mon, 12 Oct 2009 07:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=DcSrQwAqHDWiAmHZDdyAlrr/C5iTQpbiU6f4HgHAjGw=; b=I/Gc7433W6ms9gykZgX03IaS9S+ZSRYMRmuzOlW6JlkW09mctes9ztYx48sZ6GBwKR IMowFS1dwTWgDf8EMBOK/y4Upf8SvpA46HX1C3HpD/8Xqa/SF6Gu7s/Z2GWe/bQdXpRT Uzh4albZEO2sEIQMA037l6GYSxeubYNIhtQG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=SMAitbp6j86EZbNHcMBOxc2F24k5644zvSXzNoVruxffVhuQ76vxYmtsCPLeG0YdYI nAtDKFmtdQIPipMJ5iwxbBx57APxn4pE/cSzKMoNs369D3+rcqMMA0wp6Crh/YJLqyYs LRTuPigqRvcHW17dTdtLhXXq2rrubX2FqnAag= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr5061711bkw.154.1255356545083; Mon, 12 Oct 2009 07:09:05 -0700 (PDT) In-Reply-To: References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> Date: Mon, 12 Oct 2009 09:09:04 -0500 X-Google-Sender-Auth: 43d05bd8ea37b164 Message-ID: <5ba75e2f0910120709r2e950e1dh403a6637f61b7bb7@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf772efa8b90475bd7872 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf772efa8b90475bd7872 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You win :) On Mon, Oct 12, 2009 at 9:04 AM, Philippe Lhoste wrote: > On 12/10/2009 15:17, Fernando P. Garc=C3=ADa wrote: > >> In most languages (not only scripting) the use of single quotes is faste= r >> than double quotes >> > > Out of curiosity, what are these 'most' languages? > > In 'most' languages I know, they are either a very different thing (char > vs. string in a number of C-like languages: C/C++/probably C#/Java...) or > the same (Lua, JavaFX, JavaScript...). > > From what I know, they have indeed a different behavior in Perl-like > languages (Perl, of course, PHP, Ruby...) with regard to variable > interpolation and backslash interpretation. Are there many other similar > languages with this behavior? > > -- > Philippe Lhoste > -- (near) Paris -- France > -- http://Phi.Lho.free.fr > -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf772efa8b90475bd7872 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You win :)

On Mon, Oct 12, 2009 at 9:04 A= M, Philippe Lhoste <= PhiLho@gmx.net> wrote:
On 12/10/2009 15:17, Fernando P. Garc=C3=ADa wrote:
In most languages (not only scripting) the use of single quotes is faster t= han double quotes

Out of curiosity, what are these 'most' languages?

In 'most' languages I know, they are either a very different thing = (char vs. string in a number of C-like languages: C/C++/probably C#/Java...= ) or the same (Lua, JavaFX, JavaScript...).

>From what I know, they have indeed a different behavior in Perl-like langua= ges (Perl, of course, PHP, Ruby...) with regard to variable interpolation a= nd backslash interpretation. Are there many other similar languages with th= is behavior?

--
Philippe Lhoste
-- =C2=A0(near) Paris -- France
-- =C2=A0http://Phi.Lh= o.free.fr
-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- = =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0-- =C2=A0--




--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf772efa8b90475bd7872-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:15:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CEFW7q025138; Mon, 12 Oct 2009 11:15:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E992618C2F; Mon, 12 Oct 2009 12:14:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DED5318BB3 for ; Mon, 12 Oct 2009 12:14:24 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MxLfi-00074u-UZ for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 16:14:46 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:14:46 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:14:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Kepler graph Date: Mon, 12 Oct 2009 16:13:36 +0200 Lines: 14 Message-ID: References: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 11/10/2009 03:02, Stuart P. Bentley wrote: > I think I broke it. I made an edit to clarify how Sputnik handles pages > and now it's stopped recognizing subgraphs. Stuart, it is a Wiki, if you click on the table icon (top-right of page), you can see history and go back to a working version. Also using Graphviz, you can play with it locally until it looks like you want... :-) -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:32:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CEWCEY026983; Mon, 12 Oct 2009 11:32:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F27C1909A; Mon, 12 Oct 2009 12:31:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 738511903D for ; Mon, 12 Oct 2009 12:30:55 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MxLw0-0007Jp-N2 for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 16:31:37 +0200 Received: from cpe-24-174-35-8.austin.res.rr.com ([cpe-24-174-35-8.austin.res.rr.com]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:31:36 +0200 Received: from dhawkins by cpe-24-174-35-8.austin.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 16:31:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Dolphin Subject: Re: single quotes vs. double quotes Date: Mon, 12 Oct 2009 14:31:10 +0000 (UTC) Lines: 6 Message-ID: References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> <20091012134311.GX13463@pruts.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 24.174.35.8 (Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In my own code I use them to indicate a semantic difference, namely " means a string that should be localized and ' is an internal string literal. This makes it easy to search through the code. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:35:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CEZOXg027323; Mon, 12 Oct 2009 11:35:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C5B4190F9; Mon, 12 Oct 2009 12:34:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AEEE19051 for ; Mon, 12 Oct 2009 12:34:12 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1938378eye.39 for ; Mon, 12 Oct 2009 07:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=pv5ZQUad3PB/DKJgzSYbTAeOvfoXfVJ7QM+xCLtL8oY=; b=DAi6nxnhIqpi2o9U5ei78oFgHkqkBZ4En+2L0C7ymM37kVTkKW22zw36vt3Zjox61M usxARnfC72UlRw19XzC3kaW5F3VnirHPGS9WHRjFfFud5mfeVyj08BHMbf01YBPCVQL3 TO82vWwRi2lzArreOmz8VsoUp99y3YVvXRw3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=aPLHIueY1VYxfb5ClQlcl3JVFFjUpvwOWgldYqhN28BggRAHR2rcmy/SD92dtNjJgE z4tbvhlpGHigo9v39F7Y45WVdZRDC123nkYH2s+WF/ngQQVxLia27uUBlZC6wORjrkKl NtQkuOh9VtElkTW1Qzeb3eCt/BQSBj8VkPZ9Y= MIME-Version: 1.0 Received: by 10.216.87.71 with SMTP id x49mr1891395wee.11.1255358093159; Mon, 12 Oct 2009 07:34:53 -0700 (PDT) In-Reply-To: <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> From: Jerome Vuarand Date: Mon, 12 Oct 2009 16:34:33 +0200 Message-ID: <89d273ba0910120734x49ce2672o2d021d44695fc13b@mail.gmail.com> Subject: Re: LightUserData and metatables To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/12 liam mail : > > > 2009/10/12 Jerome Vuarand >> >> 2009/10/12 liam mail : >> > Whilst integrating C++ with Lua which enables the passing of C++ objects >> > to >> > Lua, calling methods, operators and vice versa I have encountered a >> > problem >> > with my current implementation. I use the method with is described on >> > the >> > wiki entitled Luna and which is also described in many other >> > publications >> > such as Game Programming Gems. >> > The crux of my problem is that a new user data is only created when an >> > object is currently not alive in Lua, when it is the pointer which was >> > returned when the lua_newuserdata was created is pushed onto the stack >> > using >> > lua_pushlightuserdata and has it's metatable attached. This metatable >> > defines the functions to be called for the operators such as __eq and >> > __le; >> > yet a lightuserdata is only equal to itself and does not look at the >> > metatable to see if the operator is defined for the type, whilst it does >> > look at the metatable for methods. >> > >> > Is there a way whilst still using the operators instead of say a le >> > function >> > (obj:le(rhs)) to accomplish this, or is using this type of function for >> > the >> > operator or using a table to represent the data the only method. Ie. is >> > there a way to trick Lua into looking at the metatable of the >> > lightuserdata >> > for the operators without modifying the source of Lua itself? >> >> Your first paragraph is a little confusing. I'm not sure what you did >> exactly, and what userdata is full or light. >> >> Light userdata are not meant to represent objects, but rather as a >> convenience to pass C values around. If you have a C object that you >> want to manipulate from Lua you should embed them in a full userdata. >> You cannot push a full userdata. What you can do however is associate >> a userdata with its address in some table (e.g. the registry), and >> from the address you can push back the full userdata with a table >> indexing operation (lua_gettable). > > Sorry for the confusion I will try to explain again :) > Say for example a C++ class instance is pushed to Lua twice for a Lua > function parameters. The first time it is detected that the instance is not > currently valid in Lua and therefore a full userdata is created and the > returned pointer is stored to enable the validity check and also to allow it > being exchanged again. When the same instance is passed the second time it > is detected that the instance is valid in Lua, the pointer instance > returned by the creating of the full user data is pushed onto the stack and > the types metatable is associated with the light user data. This still doesn't make much sense (especially since you're almost repeating what was in your first email), but... > This enables methods to be called on the light user data via a lookup in the > metatable yet fails on the operators. ... do you realize that by setting the metatable of a light userdata you are actually setting the metatable of all light userdata at once ? > Are you suggesting that the second time it is pushed the pointer returned > from creating the full user data is pushed onto the stack then lua_gettable > is called and this will enable the type to be seen as a full user data? If I > do this is there still a need to attach the types metatable to the table > pushed onto the stack via lua_gettable or should it be valid? You would call lua_gettable, but you wouldn't have a table on the stack, you would have a full userdata, already configured. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:49:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CEnXTj028447; Mon, 12 Oct 2009 11:49:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F11119198; Mon, 12 Oct 2009 12:48:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95C3C19176 for ; Mon, 12 Oct 2009 12:48:14 -0200 (BRST) Received: by fxm12 with SMTP id 12so2761718fxm.5 for ; Mon, 12 Oct 2009 07:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=jQpVXTDBve5AEvkzhBfQ0CJ2B9G0bmJSUT7i6o8t5S4=; b=fogg3pcFdSvl1ddRTYuS2PLIJeA70z75eWHz11VlGEfhK4P02NQxAt8p/JCrLIZu6Y JdFlyiIpj/acpyRYtxn5l4J8bFWuyDtN//PWggbx/u1zxY4MRrK8g0eiT8z2bDNkp4QT ixf8TQmHMzFjvurQBSy07kDf+cp1qZob45nt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=guc90S+6hy69DZ6DlnOKfMRZbK+GHPj+Dl7P3L3AaxrfKK3Oj9j7hkvsNlp5bFKwcC bY+0VV2bLQfq+rBcEXkNyuPgJl5ngSq2s6LPGNQyk2cOKn0DmPaRKu9L08fcUU+2TW+O YEV77IzcIEkZRDX2wTVeFcA1dqjcrh4YW1VFI= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr1535825fau.40.1255358936208; Mon, 12 Oct 2009 07:48:56 -0700 (PDT) In-Reply-To: <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> Date: Mon, 12 Oct 2009 15:48:56 +0100 Message-ID: Subject: Re: LightUserData and metatables From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CEnXTj028447 On Mon, Oct 12, 2009 at 3:06 PM, liam mail wrote: > > > 2009/10/12 Jerome Vuarand >> >> 2009/10/12 liam mail : >> > Whilst integrating C++ with Lua which enables the passing of C++ objects >> > to >> > Lua, calling methods, operators and vice versa I have encountered a >> > problem >> > with my current implementation. I use the method with is described on >> > the >> > wiki entitled Luna and which is also described in many other >> > publications >> > such as Game Programming Gems. >> > The crux of my problem is that a new user data is only created when an >> > object is currently not alive in Lua, when it is the pointer which was >> > returned when the lua_newuserdata was created is pushed onto the stack >> > using >> > lua_pushlightuserdata and has it's metatable attached. This metatable >> > defines the functions to be called for the operators such as __eq and >> > __le; >> > yet a lightuserdata is only equal to itself and does not look at the >> > metatable to see if the operator is defined for the type, whilst it does >> > look at the metatable for methods. >> > >> > Is there a way whilst still using the operators instead of say a le >> > function >> > (obj:le(rhs)) to accomplish this, or is using this type of function for >> > the >> > operator or using a table to represent the data the only method. Ie. is >> > there a way to trick Lua into looking at the metatable of the >> > lightuserdata >> > for the operators without modifying the source of Lua itself? >> >> Your first paragraph is a little confusing. I'm not sure what you did >> exactly, and what userdata is full or light. >> >> Light userdata are not meant to represent objects, but rather as a >> convenience to pass C values around. If you have a C object that you >> want to manipulate from Lua you should embed them in a full userdata. >> You cannot push a full userdata. What you can do however is associate >> a userdata with its address in some table (e.g. the registry), and >> from the address you can push back the full userdata with a table >> indexing operation (lua_gettable). > > Sorry for the confusion I will try to explain again :) > Say for example a C++ class instance is pushed to Lua twice for a Lua > function parameters. The first time it is detected that the instance is not > currently valid in Lua and therefore a full userdata is created and the > returned pointer is stored to enable the validity check and also to allow it > being exchanged again. When the same instance is passed the second time it > is detected that the instance is valid in Lua,  the pointer instance > returned by the creating of the full user data is pushed onto the stack and > the types metatable is associated with the light user data. > This enables methods to be called on the light user data via a lookup in the > metatable yet fails on the operators. > > Are you suggesting that the second time it is pushed the pointer returned > from creating the full user data is pushed onto the stack then lua_gettable > is called and this will enable the type to be seen as a full user data? If I > do this is there still a need to attach the types metatable to the table > pushed onto the stack via lua_gettable or should it be valid? > Thanks. > Hello liam, I think you may have misunderstood something about the way you should use userdata. This is a simplified example of how you generally want to handle using light and full userdata together: void PushMyObject(lua_State* L, MyObject* myObject) { lua_pushlightuserdata(L, (void*)myObject); lua_gettable(L, LUA_REGISTRYINDEX); if (lua_isnil(L,-1)) { MyObject** new_wrapped_ptr = (MyObject**)lua_newuserdata(L, sizeof(myObject*)); *new_wrapped_ptr = myObject; lua_pushlightuserdata(L, (void*)myObject); lua_pushvalue(L, -2); lua_gettable(L, LUA_REGISTRYINDEX); } } ...i.e. the light userdata value (which should contain the actual pointer to the C++ object you are trying to store itself, *not* the pointer to the full userdata that you are getting back from lua_newuserdata to store that pointer) is only used as a *key* to store the full userdata in the registry. Light userdata values should (usually) not be manipulated by actual Lua code, it is (usually) more of a behind-the-scenes, API tool. (I'm sure there are exceptions to this that people have, but I don't think it is very common.) -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 11:52:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CEq9PB028646; Mon, 12 Oct 2009 11:52:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F272191EE; Mon, 12 Oct 2009 12:51:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 012E6191D5 for ; Mon, 12 Oct 2009 12:51:00 -0200 (BRST) Received: by fxm12 with SMTP id 12so2764352fxm.5 for ; Mon, 12 Oct 2009 07:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=zPvuFZAJVAtQpVr5gjSJAhswgjNJPeGd4wzjyByuypk=; b=GiLEMiN2IxQR4x8s+biUAX7VWecYzrkaHe5FK+7uuYlNmopBeYVJ6h/876d39Mfrb5 2dccuE0QDR3FSyA6YOLFUbphWVANTAzRTl618gX2KjFQCzcE6dnZr35QJvoKlUe94qAg prkSbL/Lgs1wCRGa19wDpLMoezZp2uQAp4HTw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EznieOoTfIi+SuckjN3WHKHhL5tek6bStHKm3eUb+KeSpIxanZaJVxm0inUuqgI+Za 33QAUolAT40uieXOB4CLXTScIoaL4Q1x8msTWB8/QnPJMxjbr6Y/aPbveypcHWGFqCZ7 +5jX03EqRlBnw86h84ArPctuVOUWeYaH6hdbY= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr1536997fau.40.1255359101669; Mon, 12 Oct 2009 07:51:41 -0700 (PDT) In-Reply-To: References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> Date: Mon, 12 Oct 2009 15:51:41 +0100 Message-ID: Subject: Re: LightUserData and metatables From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CEq9PB028646 On Mon, Oct 12, 2009 at 3:48 PM, Duncan Cross wrote: > This is a simplified example of how you generally want > to handle using light and full userdata together: Sorry, I messed this code up a bit, let me try again: void PushMyObject(lua_State* L, MyObject* myObject) {  lua_pushlightuserdata(L, (void*)myObject);  lua_gettable(L, LUA_REGISTRYINDEX);  if (lua_isnil(L,-1)) { lua_pop(L,1);    MyObject** new_wrapped_ptr = (MyObject**)lua_newuserdata(L, sizeof(myObject*));    *new_wrapped_ptr = myObject;    lua_pushlightuserdata(L, (void*)myObject);    lua_pushvalue(L, -2);    lua_settable(L, LUA_REGISTRYINDEX);  } } -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 12:33:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CFXTJH032505; Mon, 12 Oct 2009 12:33:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38631928C; Mon, 12 Oct 2009 13:32:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B096191B7 for ; Mon, 12 Oct 2009 13:32:12 -0200 (BRST) Received: by bwz22 with SMTP id 22so7731637bwz.5 for ; Mon, 12 Oct 2009 08:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=bSTByUKZYxJsPH9Aqve7QZ1w4ULG2wTCFfJlIW02c6o=; b=UUvmm35AFc2V8+J3QJJ4ZQfQ4CjtfCn5uhKsOGr6tTOon+it8MXvvQA32KsjFT3aqC VN+2eW1p1RaPHjINkVCeMt3RVGA0f7Rzywl0aN8IG8p5DMHgF8INySqxhchG4VY2shbB ZiTuRKB0nP9CieXs79ZbSmH3uQtnJC4RRCKYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=uLP3v3P2zwLWMINKddqDJ1tPYObmrLPmVdZyzd0/fX6hMMs6k6jNeqdxv544TdkhJy iLzyMqARx0m+I6UriO40CkrHbvgFhjMrAAM3NwDXQBp7Nybspdx91cXz+c3MyOJIKwRd B9SnKfZG99RYA2Qg3ijFNPAMxlMJFjZc94EUc= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr1557490fau.40.1255361573264; Mon, 12 Oct 2009 08:32:53 -0700 (PDT) In-Reply-To: References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> From: liam mail Date: Mon, 12 Oct 2009 16:32:33 +0100 Message-ID: <173d86e00910120832w4cd5f581s61a3b66f528ef4fe@mail.gmail.com> Subject: Re: LightUserData and metatables To: Lua list Content-Type: multipart/alternative; boundary=0023545bf548a39e1f0475bea4bd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545bf548a39e1f0475bea4bd Content-Type: text/plain; charset=ISO-8859-1 2009/10/12 Duncan Cross > On Mon, Oct 12, 2009 at 3:48 PM, Duncan Cross > wrote: > > This is a simplified example of how you generally want > > to handle using light and full userdata together: > > Sorry, I messed this code up a bit, let me try again: > > void PushMyObject(lua_State* L, MyObject* myObject) { > lua_pushlightuserdata(L, (void*)myObject); > lua_gettable(L, LUA_REGISTRYINDEX); > if (lua_isnil(L,-1)) { > lua_pop(L,1); > MyObject** new_wrapped_ptr = (MyObject**)lua_newuserdata(L, > sizeof(myObject*)); > *new_wrapped_ptr = myObject; > lua_pushlightuserdata(L, (void*)myObject); > lua_pushvalue(L, -2); > lua_settable(L, LUA_REGISTRYINDEX); > } > } > > -Duncan > I thank you both for your responses I now see the error in my ways and how to fix it. :) "... do you realize that by setting the metatable of a light userdata you are actually setting the metatable of all light userdata at once ?" I did not realise this. oops. --0023545bf548a39e1f0475bea4bd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/10/12 Duncan Cross <duncan.cross@gmail.com&= gt;
On Mon, Oct 12, 2009 at 3:48 PM, Duncan Cross <duncan.cross@gmail.com> wrote: > This is a simplified example of how you generally want
> to handle using light and full userdata together:

Sorry, I messed this code up a bit, let me try again:

void PushMyObject(lua_State* L, MyObject* myObject) {
=A0lua_pushlightuserdata(L, (void*)myObject);
=A0lua_gettable(L, LUA_REGISTRYINDEX);
=A0if (lua_isnil(L,-1)) {
=A0 lua_pop(L,1);
=A0 =A0MyObject** new_wrapped_ptr =3D (MyObject**)lua_new= userdata(L,
=A0 =A0 =A0 =A0 =A0 sizeof(myObject*));
=A0 =A0*new_wrapped_ptr =3D myObject;
=A0 =A0lua_pushlightuserdata(L, (void*)myObject);
=A0 =A0lua_pushvalue(L, -2);
=A0 =A0lua_settable(L, LUA_REGISTRYINDEX);
=A0}
}

-Duncan
I thank you both for your responses I now see the= error in my ways and how to fix it. :)

"... do you realize tha= t by setting the metatable of a light userdata
you are actually setting the metatable of all light userdata at once ?"= ;
I did not realise this. oops.
--0023545bf548a39e1f0475bea4bd-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 12:35:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CFZFcK032719; Mon, 12 Oct 2009 12:35:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0A4019299; Mon, 12 Oct 2009 13:34:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78FB2191B7 for ; Mon, 12 Oct 2009 13:34:09 -0200 (BRST) Received: by yxe36 with SMTP id 36so10284578yxe.11 for ; Mon, 12 Oct 2009 08:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ASSg7SUbqtIxhniW68aoE+n7k7/ORxQ5BKmWM1rw9hw=; b=wcJJoQ2Df/mVg0z5qywYpy/+GP8vyOY9gimcM4f1cXbrgIkxkfoSEc1OI5gJTBB5Ys RYCMdTADwSVJmp9wj1U2WR2DHYVM0bvNcspQd7oN6+ZyfvtA6346Ktp9skiZZ44Q/Rlz hFRd+etf/wl3GC4GVXetSRxUySSI1b+Jghn3U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IHE83uJlkOs8Vdomp9B9l/N/7lzktjNwqlM6TBXin36yfJjZ1PPkQUS4/Y2JrdYVOO OouPPqev5VcnBUf4+WzPckmfGiL49a5BcKN4wybsprgctBA+tjQN75y+eEEi4owf6aCS rFrvXD1NjZatJpBjvZteTw0RmUzU/LQ3F/zpo= MIME-Version: 1.0 Received: by 10.91.28.2 with SMTP id f2mr3745323agj.16.1255361690556; Mon, 12 Oct 2009 08:34:50 -0700 (PDT) Date: Mon, 12 Oct 2009 11:34:50 -0400 Message-ID: <2781f020910120834n6f15951fn8966381b364e1773@mail.gmail.com> Subject: Roberto's struct library missing "size" function? From: Joseph Stewart To: Lua list Content-Type: multipart/alternative; boundary=001485f5ea78a15aa10475beab70 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f5ea78a15aa10475beab70 Content-Type: text/plain; charset=ISO-8859-1 Hello colleagues, I've just started using Roberto's struct library and believe I've found a discrepancy. The reference page mentions a function "struct.size" which returns the length in bytes the format will return, however the associated 'C' file (struct.c) doesn't seem to contain this function. I'd be happy to add this functionality if it isn't already written... I just don't want to re-invent the wheel. Warm regards, -joe --001485f5ea78a15aa10475beab70 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello colleagues,

I've just started using Roberto= 9;s struct library and believe I've found a discrepancy.

=
The reference page mentions a function "struct.size" w= hich returns the length in bytes the format will return, however the associ= ated 'C' file (struct.c) doesn't seem to contain this function.=

I'd be happy to add this functionality if it isn= 9;t already written... I just don't want to re-invent the wheel.
<= div>
Warm regards,

-joe
--001485f5ea78a15aa10475beab70-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 12:41:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CFf0uO000645; Mon, 12 Oct 2009 12:41:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AA10192A0; Mon, 12 Oct 2009 13:39:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D66DB191B7 for ; Mon, 12 Oct 2009 13:39:51 -0200 (BRST) Received: by bwz22 with SMTP id 22so7738011bwz.5 for ; Mon, 12 Oct 2009 08:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hZ55FiZR4r/YyxaOzwDsPaUSD9Xa4XXV2Pqn6zPw/LI=; b=SIVKdro7iqtPmUg1kWWxW4zDIvFB0coQrpWtfJFnyUIx3CQl8FQ8YJxfhHM/4FhaR6 0VMsKAyIls7Xh2DPv1Er46tvkhIfRpnI28nF5Agd2OVDRNMvKNjT490Couym4UxaPk1R wgt2kLqmz9ehhtAFc1v774Z0ZmqZrXpjS/dKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Tjoo/L7GH4thScNg7n1d54Nf0Af3HE0/trPZgFi2cKgn0R++ktK+fDmf/p2Pyfx2Et lUtHsPvdII8T9ZPhPJhekGwSTn8B2Oymg3DW7iLDBHewxH+QKCdwCOmh6pYxh8aRAyCa Qybdpm1vUHaXIt865AXF+GMxyGXIg1z6JWe88= MIME-Version: 1.0 Received: by 10.239.145.18 with SMTP id q18mr425531hba.120.1255362029361; Mon, 12 Oct 2009 08:40:29 -0700 (PDT) In-Reply-To: References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> <20091012134311.GX13463@pruts.nl> Date: Mon, 12 Oct 2009 17:40:29 +0200 Message-ID: <560972290910120840x6b8e8aa4pb68c43d95c87ad3a@mail.gmail.com> Subject: Re: single quotes vs. double quotes From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CFf0uO000645 On Mon, Oct 12, 2009 at 4:31 PM, Dolphin wrote: > In my own code I use them to indicate a semantic difference, namely " means a > string that should be localized and ' is an internal string literal.  This > makes it easy to search through the code. That's a good use of consistency. Sometimes you will also see code with localized strings written as L"hello" or _"hello", which works if L or _ is a function returning the localized version at runtime. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 12:47:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CFlVRx001216; Mon, 12 Oct 2009 12:47:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D42121A6D4; Mon, 12 Oct 2009 13:46:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.peterodding.com (mailinghelper.nl [79.99.133.60]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 032641A67D for ; Mon, 12 Oct 2009 13:46:24 -0200 (BRST) Received: from [192.168.1.3] (82-136-228-62.ip.telfort.nl [82.136.228.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.peterodding.com (Postfix) with ESMTPSA id 50AAC200B8AE for ; Mon, 12 Oct 2009 15:47:04 +0000 (UTC) Message-ID: <4AD34F77.8090806@peterodding.com> Date: Mon, 12 Oct 2009 17:47:03 +0200 From: Peter Odding User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: single quotes vs. double quotes References: <5ba75e2f0910120617t5f7b2639k1db4f4fb19bc0b83@mail.gmail.com> <20091012142238.51e0911a@trite.i.flarn.net.i.flarn.net> <20091012133550.GV13463@pruts.nl> <20091012134311.GX13463@pruts.nl> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dolphin schreef: > In my own code I use them to indicate a semantic difference, namely " means a > string that should be localized and ' is an internal string literal. This > makes it easy to search through the code. I use a similar approach. IIRC some of Vim's syntax highlighting scripts enable spell checking for double-quoted strings but disable spell checking for single-quoted strings, which is where I picked up the idea. - Peter From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:02:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CG2DXu002415; Mon, 12 Oct 2009 13:02:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EB111A6E3; Mon, 12 Oct 2009 14:01:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-02.prod.phx3.secureserver.net (p3plsmtpa01-02.prod.phx3.secureserver.net [72.167.82.82]) by bazar2.conectiva.com.br (Postfix) with SMTP id 527471A675 for ; Mon, 12 Oct 2009 14:01:04 -0200 (BRST) Received: (qmail 11136 invoked from network); 12 Oct 2009 16:01:43 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-02.prod.phx3.secureserver.net (72.167.82.82) with ESMTP; 12 Oct 2009 16:01:43 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: LightUserData and metatables From: Mark Hamburg In-Reply-To: Date: Mon, 12 Oct 2009 09:01:42 -0700 Content-Transfer-Encoding: 7bit Message-Id: <86947171-60FC-4D44-B091-370FEF73AFD2@grubmah.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Though note that depending on how you do lifetime management, you may actually want to use a weak table mapping light userdata pointers to full userdata proxies. You could even use a metatable on this mapping table to do the proxy construction thereby allowing one to write: pushMappingTable( L ); /* e.g., fetch it from the registry */ lua_pushlightuserdata( L, p ); lua_gettable( L, -2 ); /* Fetch or construct the proxy. */ lua_remove( L, -2 ); /* Remove the proxy table. */ If you can store the proxy table as the environment to your C code or as an upvalue, then it becomes even simpler. For example: lua_pushlightuserdata( L, p ); lua_gettable( L, LUA_ENVIRONINDEX ); Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:09:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CG9Rku003107; Mon, 12 Oct 2009 13:09:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D00D71A6ED; Mon, 12 Oct 2009 14:08:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF4E91A675 for ; Mon, 12 Oct 2009 14:08:11 -0200 (BRST) Received: by bwz22 with SMTP id 22so7761216bwz.5 for ; Mon, 12 Oct 2009 09:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=WdeDltN5Cvmt2Aip4GVodR3wiQhv9p/r1QqrnPsOgoo=; b=CdXBcUoy2SZ9w2rVbolniHTvuXwAT8C3SZBuzGStJGkV4AUzZxuHrrLIF5UDhln/qG Q8SLOKeNhvYjsTAmcOXWUvRXfDyOM/gZGWBUG+Jr4S6JEsNcHNx4gM+zUFwhmc3TKP6V ZCU/KJVXOIkQCCyuYnP1OLG1HyMx0PspC0APM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=UHTJskY9yPYPFaAkRH3JpWIoMT5smbOE79B8+MtL9c4IECKSli2R5smBUiL5QsrV2B egswrwkcek8/fseAArBFEVxfSb+8SHOM4HlF+jqRHR063Kl6RqkhJGaN5/M7YogeRKhD KmzjUP4FB+dWhAVXh68pfrgcm18p0Gna+Ucww= MIME-Version: 1.0 Received: by 10.204.20.82 with SMTP id e18mr5194111bkb.168.1255363730288; Mon, 12 Oct 2009 09:08:50 -0700 (PDT) Date: Mon, 12 Oct 2009 18:08:50 +0200 Message-ID: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> Subject: how to (slightly) modify the Lua parser From: Francesco Abbate To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000325559f56352f6c0475bf25a3 Cc: gslshell@gmail.com, metalua@gmail.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559f56352f6c0475bf25a3 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I know that in this list there are a lot of clever guys so I guess it is the good place to ask *very* difficult questions about Lua :-) For my project, GSL shell, I would like to slightly modify the Lua parser to add some syntactic sugar. For example I would like to write: |x| sin(x)/x or |x, y| sin(x) * cos(y) as a function literal instead of function(x) return sin(x)/x end or function(x,y) return sin(x) * cos(y) end Incidentally, this syntax is supported by metalua. Otherwise I would like to index object with more comma-separated values because for a matrix is natural to write something like m[i, j] to refer to an element of the matrix. Right now I'm doing m:get(i, j) but I would like to simplify the notation. It seems that metalua can offer all these things but I'm wondering if it is really the good choice. The other alternative could be to hack the Lua code to modify the parser. I'm ready to fiddle my hands in the Lua code but the source code is quite complicated and I didn't find any tutorial on 'hacking Lua' so it is very difficult to start. Thank you in advance for any help. Francesco --000325559f56352f6c0475bf25a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

I know that in this list there are a lot of clev= er guys so I guess it is the good place to ask *very* difficult questions a= bout Lua :-)

For my project, GSL shell, I would li= ke to slightly modify the Lua parser to add some syntactic sugar. For examp= le I would like to write:

|x| sin(x)/x

or

=
|x, y| sin(x) * cos(y)

as a function li= teral instead of

function(x) return sin(x)/x end
or
function(x,y) return sin(x) * cos(y) end

Incidentally, this syntax is supported by metalua.

<= /div>
Otherwise I would like to index object with more comma-separated = values because for a matrix is natural to write something like m[i, j] to r= efer to an element of the matrix. Right now I'm doing m:get(i, j) but I= would like to simplify the notation.

It seems that metalua can offer all these things but I&= #39;m wondering if it is really the good choice. The other alternative coul= d be to hack the Lua code to modify the parser. I'm ready to fiddle my = hands in the Lua code but the source code is quite complicated and I didn&#= 39;t find any tutorial on 'hacking Lua' so it is very difficult to = start.

Thank you in advance for any help.

=
Francesco
--000325559f56352f6c0475bf25a3-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:13:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGDGIm003455; Mon, 12 Oct 2009 13:13:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1F241A6F2; Mon, 12 Oct 2009 14:12:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C9D71A6EB for ; Mon, 12 Oct 2009 14:12:08 -0200 (BRST) Received: by vws9 with SMTP id 9so5387512vws.11 for ; Mon, 12 Oct 2009 09:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=HG4cwuicnqYDYmN2x3Doh4kftnjXcVrjwhiPqMmDzls=; b=Ea0Xr0p9QTV1vsohVglDCuKJGBVlnKYhcUVAdTesgc9sE+GCUVgTaYgitbXkWDprNt yaiSpo2KWnJpq/uWa3ex5vuySpE5vC6cYUMUO3t9qY9hPrQxTqCC3wzW1C/3V0RGZfeI axy98VGs+BKg0holDjlt2TTevvmiaJ0vJYokc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=XKS9J2RlzoXOP5r5jQOaUDKLBejPflKjl9B4FuGDcHGD+P1nalz7kmmADjnSUAqG+3 wHFXwts9Hm+UmZW0FuQ25vo2cDaSHfkx15tVen9U8lEOLvrVXusHor0aK2JyXftB8s2c ztaZc7YTFAn7uHb2jGqxy4dVC9BKThYeGkzU8= MIME-Version: 1.0 Received: by 10.220.16.85 with SMTP id n21mr8745263vca.13.1255363969580; Mon, 12 Oct 2009 09:12:49 -0700 (PDT) Date: Mon, 12 Oct 2009 13:12:49 -0300 X-Google-Sender-Auth: 8dfc3c65aa9f0f02 Message-ID: <92ab989c0910120912v353d47dfm3b9335d3957bbff5@mail.gmail.com> Subject: LuaForge CVS is back From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CGDGIm003455 After another sprint Alessandro got the developer access to CVS fully back up, please help us test if everything is OK with it. As some have already manifested, if you are using CVS on LuaForge this would be a good time to start planning your migration strategy. While we will keep supporting CVS for at least two months, our plan is to stop using it as soon as possible. André From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:17:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGHpUv003904; Mon, 12 Oct 2009 13:17:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D18E118B72; Mon, 12 Oct 2009 14:16:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-08.prod.phx3.secureserver.net (p3plsmtpa01-08.prod.phx3.secureserver.net [72.167.82.88]) by bazar2.conectiva.com.br (Postfix) with SMTP id 0F39618993 for ; Mon, 12 Oct 2009 14:16:44 -0200 (BRST) Received: (qmail 8233 invoked from network); 12 Oct 2009 16:17:25 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-08.prod.phx3.secureserver.net (72.167.82.88) with ESMTP; 12 Oct 2009 16:17:25 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Special indices (was Re: LightUserData and metatables) From: Mark Hamburg In-Reply-To: <86947171-60FC-4D44-B091-370FEF73AFD2@grubmah.com> Date: Mon, 12 Oct 2009 09:17:25 -0700 Content-Transfer-Encoding: 7bit Message-Id: <09AD8A6F-2725-4F27-81B4-C8BC60E8EA20@grubmah.com> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> <86947171-60FC-4D44-B091-370FEF73AFD2@grubmah.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 12, 2009, at 9:01 AM, Mark Hamburg wrote: > Though note that depending on how you do lifetime management, you > may actually want to use a weak table mapping light userdata > pointers to full userdata proxies. > > > You could even use a metatable on this mapping table to do the proxy > construction thereby allowing one to write: > > pushMappingTable( L ); /* e.g., fetch it from the registry */ > lua_pushlightuserdata( L, p ); > lua_gettable( L, -2 ); /* Fetch or construct the proxy. */ > lua_remove( L, -2 ); /* Remove the proxy table. */ > > If you can store the proxy table as the environment to your C code > or as an upvalue, then it becomes even simpler. For example: > > lua_pushlightuserdata( L, p ); > lua_gettable( L, LUA_ENVIRONINDEX ); Which incidentally makes me long a bit for a few more special indices as much for code convenience as performance. For example, when building full userdata objects that use their environment tables to link to other Lua objects, a LUA_SELF_ENVIRONINDEX would save one the trouble of fetching the environment onto the stack and tracking its position. That's obviously not a huge burden, but it makes short method implementations a bit harder to follow. In the example here, a special index for a global weak table would help. That said, I don't have a firm proposal on any of these and its a slippery slope. I'll just note that LUA_ENVIRONINDEX wasn't technically needed given lua_getfenv but it does make using the environment table a lot more natural. Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:18:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGILf7003981; Mon, 12 Oct 2009 13:18:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DC6B18F13; Mon, 12 Oct 2009 14:17:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC6E418C94 for ; Mon, 12 Oct 2009 14:17:07 -0200 (BRST) Received: by bwz22 with SMTP id 22so7768332bwz.5 for ; Mon, 12 Oct 2009 09:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/Dy9I3pRWNlm9o99S9cjvq9jPv2/Ho+uI0Cr2YJvS8k=; b=vOUSZ7GKMCTXmak1ofOzsYtmXKLQa+/rhJUnMNdZn+j5/vKmupBBLaFSeoNV2/fiMv N/eL2HzNrU8C0w4OV4OTVVy5w8md339KPPcotYLA60FG8j9fmpkcqaa7OcLOZRdDRI0v qmteSFlU8EYuDr/xQKnIGA2qAsdEiP9szDSBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Jife+ueqaRQ8dBHEzOJI3+NY31wccqzyv4oCEIpBj9FjbnHLzqY8ZQzdJ7FENdcPmN k1IDBZtGc6Jx8kPUNfClqvtAF7y9BPTxEehLhPZf/krTjY1jaUmzNb7S95UaNigXMp2+ fG1BEYsomMFmY9OagQ5P42tQdy85ZeZwZKnNw= MIME-Version: 1.0 Received: by 10.239.144.97 with SMTP id n33mr397736hba.183.1255364268892; Mon, 12 Oct 2009 09:17:48 -0700 (PDT) In-Reply-To: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> References: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> Date: Mon, 12 Oct 2009 18:17:48 +0200 Message-ID: <560972290910120917w633eaf82n4171dae2dac2873b@mail.gmail.com> Subject: Re: how to (slightly) modify the Lua parser From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 12, 2009 at 6:08 PM, Francesco Abbate wrote: > |x| sin(x)/x > or > |x, y| sin(x) * cos(y) You're not the first to want this ;) http://lua-users.org/wiki/ShortAnonymousFunctions No direct clues there to patch the parser, however. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:29:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGTmjA004746; Mon, 12 Oct 2009 13:29:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5CFF19051; Mon, 12 Oct 2009 14:28:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2.tr.net (smtp2.tr.net [195.155.1.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8E5818C83 for ; Mon, 12 Oct 2009 14:28:37 -0200 (BRST) Received: from [192.100.100.52] (unknown [81.214.28.99]) by smtp2.tr.net (Postfix) with ESMTP id 753532885F2 for ; Mon, 12 Oct 2009 19:29:18 +0300 (EEST) Message-ID: <4AD3595E.8080708@tr.net> Date: Mon, 12 Oct 2009 19:29:18 +0300 From: Hakki Dogusan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: DigiPen Lua Club References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Stuart P.Bentley wrote: > [Club ann snipped] > > (Also, why hasn't anybody implemented the Lua logo as a Lua script using > a library like CanvasDraw yet?) I have following code for Cairo (copied from CairoPad): --8<-------------------------------------------------------------------- local cr = ...; -- Paint context local M_PI = math.pi -- FIXME: coords, sizes should not be const! local xc = 125 local yc = 125 local r = 50 -- canvas cairo.save (cr); do cairo.set_source_rgb (cr, 1.0, 1.0, 1.0); cairo.paint (cr); end cairo.restore (cr); -- planet cairo.save (cr); do cairo.set_source_rgb (cr, 0.0, 0.0, 0.5); cairo.set_line_width (cr, 2.0); cairo.arc (cr, xc, yc, r, 0.0, 2*M_PI); cairo.fill_preserve (cr); cairo.stroke (cr); end cairo.restore (cr); -- hole cairo.save (cr); do cairo.set_source_rgb (cr, 1.0, 1.0, 1.0); cairo.set_line_width (cr, 2.0); cairo.arc (cr, xc+20, yc-20, r/4, 0.0, 2*M_PI); cairo.fill_preserve (cr); cairo.stroke (cr); end cairo.restore (cr); -- orbit cairo.save (cr); do local dashes = {5.0, --/* ink */ 3.0, --/* skip */ 5.0, --/* ink */ 3.0, --/* skip*/ }; local ndash = #dashes; local offset = -50.0; cairo.set_dash (cr, dashes, ndash, offset); cairo.set_source_rgb (cr, 0.5, 0.5, 0.5); cairo.set_line_width (cr, 2.0); cairo.arc (cr, xc, yc, r+20, 0.0, 2*M_PI); cairo.stroke (cr); cairo.set_dash (cr, {}, 0, 0); end cairo.restore (cr); -- moon cairo.save (cr); do cairo.set_source_rgb (cr, 0.0, 0.0, 0.5); cairo.set_line_width (cr, 2.0); cairo.arc (cr, xc+20+30, yc-20-30, r/4, 0.0, 2*M_PI); cairo.fill_preserve (cr); cairo.stroke (cr); end cairo.restore (cr); -- label cairo.save (cr); do cairo.set_source_rgb (cr, 1.0, 1.0, 1.0); cairo.select_font_face (cr, "Helvetica", CAIRO.FONT_SLANT_NORMAL, CAIRO.FONT_WEIGHT_NORMAL); cairo.set_font_size (cr, 40.0); cairo.move_to (cr, xc-35, yc+25); cairo.show_text (cr, "Lua"); end cairo.restore (cr); --8<-------------------------------------------------------------------- -- Regards, Hakki Dogusan From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:41:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGfuFQ005737; Mon, 12 Oct 2009 13:41:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 870D719144; Mon, 12 Oct 2009 14:40:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-05.prod.phx3.secureserver.net (p3plsmtpa01-05.prod.phx3.secureserver.net [72.167.82.85]) by bazar2.conectiva.com.br (Postfix) with SMTP id A748D1911A for ; Mon, 12 Oct 2009 14:40:40 -0200 (BRST) Received: (qmail 23597 invoked from network); 12 Oct 2009 16:41:20 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-05.prod.phx3.secureserver.net (72.167.82.85) with ESMTP; 12 Oct 2009 16:41:20 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: how to (slightly) modify the Lua parser From: Mark Hamburg In-Reply-To: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> Date: Mon, 12 Oct 2009 09:41:19 -0700 Content-Transfer-Encoding: 7bit Message-Id: <61B10B9A-9B34-4314-AB8E-CE764D107247@grubmah.com> References: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 12, 2009, at 9:08 AM, Francesco Abbate wrote: > Hi all, > > I know that in this list there are a lot of clever guys so I guess > it is the good place to ask *very* difficult questions about Lua :-) > > For my project, GSL shell, I would like to slightly modify the Lua > parser to add some syntactic sugar. For example I would like to write: > > |x| sin(x)/x > > or > > |x, y| sin(x) * cos(y) > > as a function literal instead of > > function(x) return sin(x)/x end > or > function(x,y) return sin(x) * cos(y) end > > Incidentally, this syntax is supported by metalua. > > Otherwise I would like to index object with more comma-separated > values because for a matrix is natural to write something like m[i, > j] to refer to an element of the matrix. Right now I'm doing m:get > (i, j) but I would like to simplify the notation. > > It seems that metalua can offer all these things but I'm wondering > if it is really the good choice. The other alternative could be to > hack the Lua code to modify the parser. I'm ready to fiddle my hands > in the Lua code but the source code is quite complicated and I > didn't find any tutorial on 'hacking Lua' so it is very difficult to > start. > > Thank you in advance for any help. I'm afraid I'm not going to answer your question though the general answer probably is of middling difficulty (you need to modify the lexer to recognize the bar token and you'll need to define a new case for expressions -- I would probably look at where the function keyword is accepted). But before you dive in, you probably need to consider a variety of questions: * What sort of precedence does | | have? In particular, how does it relate to commas? For example, is: | x | x + 1, 2 Equivalent to: function( x ) return x + 1 end, 2 Or is it equivalent to: function( x ) return x + 1, 2 end Does this really do what you want in the context of expression lists? In other contexts? * Do you also want to consider a syntax like: | | do end This would allow for more than just expression one liners. * On a similar front, how about: | | For the cases where one has just one statement. That has the problem that you need a way to tell a statement (which won't need an implicit return) from an expression (which will). * Do you want to treat these expression like tables and strings and allow them to be invoked without parentheses? This is probably particularly interesting for method calls: myCollection:map | x | sin( x ) / x If so, should this be allowed for the heavy syntax as well: myCollection:map function( x ) return sin( x ) / x end Of course, the further one pushes on these sort of constructs, the closer one gets to Smalltalk and Ruby blocks but note that those have interesting rules about returns v non-local exits. (A block can either return a value to its caller or can return/exit from the method in which it is created.) Non-local exit is an interesting semantic extension to Lua, but it isn't clear what it would mean for pcall. But pulling back from the semantic question, there are presumably answers to some of these points available in Metalua. One could also resolve some of the questions through alternative syntax choices that provided an explicit end marker for the "syntactically lightweight" closure. This might also make dropping parentheses more appealing: myCollection:map<< | x | sin( x ) / x >> (I'm not particularly attached to the above syntax.) Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:43:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGhdp7005924; Mon, 12 Oct 2009 13:43:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27415191F0; Mon, 12 Oct 2009 14:42:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6AA519176 for ; Mon, 12 Oct 2009 14:42:29 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so441418qwb.11 for ; Mon, 12 Oct 2009 09:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=2eua+BWkzZuYg/5xjgqiP8peri9MU+NkOXcWHSB1eGY=; b=BSapX6b5F/Lis1cHq0phqmraN8XR5En+OdZ+WVejSPasRcJKuPCo00kGbaw5rIcXyc S1J2p3UoG7z6o9O6pkPgztRsdK8LMJ+DFdsg+X8LWulZ3oR5hFNtdo3NQZQq5fDOOUiv nFx1CTtmd7sGGh9WqSAQB4O32SRkkeinvredU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WFH+fejw4lCUrtLNXL7+Q0jygdJkS2Kt6T7zOLJ30IAGRnbvR1zzslykcvDdaFQFxZ KZSL1gKuTMf+43C+i2993I3Qoa26YO7el5xjB6tr8d76a8ET3toel3gp8hjsACEgWt25 2x+wZhlyvnRYOCJhhE83imdo4KF3jf3mkOJnw= Received: by 10.224.70.202 with SMTP id e10mr4971127qaj.16.1255365408550; Mon, 12 Oct 2009 09:36:48 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.238.50]) by mx.google.com with ESMTPS id 23sm1678366qyk.15.2009.10.12.09.36.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Oct 2009 09:36:47 -0700 (PDT) Message-ID: <4AD35B19.8060203@gmail.com> Date: Tue, 13 Oct 2009 00:36:41 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: how to (slightly) modify the Lua parser References: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> <560972290910120917w633eaf82n4171dae2dac2873b@mail.gmail.com> In-Reply-To: <560972290910120917w633eaf82n4171dae2dac2873b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > On Mon, Oct 12, 2009 at 6:08 PM, Francesco Abbate > wrote: >> |x| sin(x)/x >> or >> |x, y| sin(x) * cos(y) > > You're not the first to want this ;) > > http://lua-users.org/wiki/ShortAnonymousFunctions > > No direct clues there to patch the parser, however. If you trace the call tree of the recursive descent parser in lparser.c (starting from luaY_parser), I think it is do-able, the call tree is pretty straightforward. For function definitions: statement() -> funcstat() -> funcname() -> body() body() is where the parameter list is parsed. So for |x,y|, you need to check for the first '|', then call out to its own 'stat' (statement handler) function, where you follow the style of the parameter parsing in body(), but check for '|' instead of a closing ')'. For the body, which is a expression (or can it be a list of expressions?), you can look at the flow of explist1(). The expression handling stuff is pretty compact code, so take your time to follow the call tree. HTH, -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:52:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGqWOo006583; Mon, 12 Oct 2009 13:52:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D49D41A695; Mon, 12 Oct 2009 14:51:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B270A1A675 for ; Mon, 12 Oct 2009 14:51:23 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGq471006563 for ; Mon, 12 Oct 2009 13:52:04 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9CGq3u20780; Mon, 12 Oct 2009 13:52:03 -0300 Date: Mon, 12 Oct 2009 13:52:03 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: DigiPen Lua Club Message-ID: <20091012135203.A20777@lua.tecgraf.puc-rio.br> References: <4AD3595E.8080708@tr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AD3595E.8080708@tr.net>; from dogusanh@tr.net on Mon, Oct 12, 2009 at 07:29:18PM +0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > (Also, why hasn't anybody implemented the Lua logo as a Lua script using > a library like CanvasDraw yet?) Here is the code for my PDFlib binding. -- lua-logo.lua sqrt=math.sqrt PI=math.pi RESOLUTION=512 p:begin_page(RESOLUTION, RESOLUTION) p:translate(RESOLUTION/2, RESOLUTION/2) p:scale(RESOLUTION/2/sqrt(2), RESOLUTION/2/sqrt(2)) -- planet p:setcolor("fill", "rgb", 0, 0, 0.5) p:circle(0, 0, 1) p:fill() -- hole r=1-sqrt(2)/2 p:setcolor("fill", "rgb", 1, 1, 1) p:circle(1-2*r, 1-2*r, r) p:fill() -- moon p:setcolor("fill", "rgb", 0, 0, 0.5) p:circle(1, 1, r) p:fill() -- logo font = p:load_font("Helvetica", "host") p:setfont(font, 0.9) x=p:stringwidth("Lua", font, 0.9) p:setcolor("both", "rgb", 1, 1, 1, 0) p:show_xy("Lua", -x/2, -0.5) -- orbit p:setlinewidth(0.03) x=(1+r)*(PI/180*5) p:setdash(x,x) p:setcolor("stroke", "gray", 0.5) p:arcn(0, 0, 1+r, 32, 57) p:stroke() p:end_page() From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:54:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGs1uG006763; Mon, 12 Oct 2009 13:54:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99F0A1A6BD; Mon, 12 Oct 2009 14:53:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from obatala.inf.puc-rio.br (obatala.inf.puc-rio.br [139.82.20.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20D9A1A675 for ; Mon, 12 Oct 2009 14:52:57 -0200 (BRST) Received: from coleiro.inf.puc-rio.br (coleiro.inf.puc-rio.br [139.82.20.74]) by obatala.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9CGrcoF002123 for ; Mon, 12 Oct 2009 13:53:38 -0300 Message-Id: <56FD8E0E-191D-4568-AAAD-82CC2E710744@inf.puc-rio.br> From: Waldemar Celes To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: tolua++ question Date: Mon, 12 Oct 2009 13:53:40 -0300 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Define a type for your buffer object: int readstuff (MyBuffer* but, int len); You will probably need to bind another function to create or access a buffer object: MyBuffer* createbuffer (); or MyBuffer* getbuffer(); -- Waldemar On Oct 12, 2009, at 10:50 AM, Elbers, H.P. wrote: > Hello, > > I'm trying to use tolua++ to bind existing C++ code. > > How to I bind a function like: > int readstuff(void *buf, int len) > > The caller has to supply a buffer where the function stores the > data. In > this case buf must be able to contain len bytes, and the return values > is the actual nr of bytes tored in bug by readstuff. > > Thanks, Hans > > PS: if there is a better way to use C++ classes in a Lua script, id' > also be interested... From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 13:58:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CGwfli007155; Mon, 12 Oct 2009 13:58:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 034F01A6C4; Mon, 12 Oct 2009 14:57:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46B251A675 for ; Mon, 12 Oct 2009 14:57:30 -0200 (BRST) Received: by yxe36 with SMTP id 36so10346320yxe.11 for ; Mon, 12 Oct 2009 09:58:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.203.38 with SMTP id f38mr2142890agq.60.1255366691519; Mon, 12 Oct 2009 09:58:11 -0700 (PDT) In-Reply-To: <2781f020910120834n6f15951fn8966381b364e1773@mail.gmail.com> References: <2781f020910120834n6f15951fn8966381b364e1773@mail.gmail.com> Date: Mon, 12 Oct 2009 19:58:11 +0300 X-Google-Sender-Auth: 8da3ba1add154029 Message-ID: Subject: Re: Roberto's struct library missing "size" function? From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001636b2b50db5fe370475bfd5fd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b50db5fe370475bfd5fd Content-Type: text/plain; charset=UTF-8 Hm, you're right. Get this instead: http://github.com/mascarenhas/alien/blob/master/src/alien/struct.c On Mon, Oct 12, 2009 at 18:34, Joseph Stewart wrote: > Hello colleagues, > I've just started using Roberto's struct library and believe I've found a > discrepancy. > > The reference page mentions a function "struct.size" which returns the > length in bytes the format will return, however the associated 'C' file > (struct.c) doesn't seem to contain this function. > > I'd be happy to add this functionality if it isn't already written... I > just don't want to re-invent the wheel. > > Warm regards, > > -joe > --001636b2b50db5fe370475bfd5fd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hm, you're right. Get this instead:=C2=A0http://github.com/mascaren= has/alien/blob/master/src/alien/struct.c

On Mon, Oct 12, 2009 at 18:34, Joseph Stewart <joseph.stewart@gmail.com> wrote:
Hello colleagues,

I'= ve just started using Roberto's struct library and believe I've fou= nd a discrepancy.

The reference page mentions a function "struct.siz= e" which returns the length in bytes the format will return, however t= he associated 'C' file (struct.c) doesn't seem to contain this = function.

I'd be happy to add this functionality if it isn= 9;t already written... I just don't want to re-invent the wheel.
<= div>
Warm regards,

-joe

--001636b2b50db5fe370475bfd5fd-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 14:15:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CHFBfZ008925; Mon, 12 Oct 2009 14:15:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 595B518D5E; Mon, 12 Oct 2009 15:14:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF26A18CF4 for ; Mon, 12 Oct 2009 15:13:57 -0200 (BRST) Received: by vws9 with SMTP id 9so5416830vws.11 for ; Mon, 12 Oct 2009 10:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uOkKU5vy5XISKOXaVo9nvq7ORZMZQuNIF+MaX+KQH5A=; b=AarKcJuiNIgaKB/xlkmjPu+J44NfjXL6jqAeuQgdoF2TiF+Yylx31+d3djXrVUMJWX QwSryFw30O0RqL9ZZz4by5fpbKylN+YTJnxPR1cSFSIsspnYsMtHbagiAWUSeBEhvaEx 10mg3oOzs3hFrb14KTXO5LiGm/iovqYWXUDvw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=sumyI3WyBkAtdGXtcOu0iwEKdlVcv0Li7/m8upe3n7xc6MktQWV3tNXULSDfhsHhN/ a4zVC/p3eOU1rabkaeMF5NoHzioj+iX0kHh2SreF+fYsVzoDNSAsqoN+YWXftfXItkco FxnAe9Ed+9dc82qFLbPvy3TwU/wWwuDjB5Pps= MIME-Version: 1.0 Received: by 10.220.78.103 with SMTP id j39mr5367284vck.78.1255367677979; Mon, 12 Oct 2009 10:14:37 -0700 (PDT) Date: Mon, 12 Oct 2009 14:14:37 -0300 X-Google-Sender-Auth: 13a5b9425514e33a Message-ID: <92ab989c0910121014j19f71a5fv146025e33e5c6c04@mail.gmail.com> Subject: LuaForge lists are back (with a vengeance) :o) From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CHFBfZ008925 One more point for Alessandro, mailman is back and sending a LOT of messages for the various mailing lists on LuaForge, please ignore the test messages. André From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 14:28:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CHSGCF010531; Mon, 12 Oct 2009 14:28:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C22281A6A9; Mon, 12 Oct 2009 15:27:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9537B1A663 for ; Mon, 12 Oct 2009 15:27:05 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 19so334485fgg.17 for ; Mon, 12 Oct 2009 10:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hZmCcXbfBe0d61XNbq6815SnltU227tfCa6RH3cAe2c=; b=jWOmnFxft7tTIGuh4oNWZlBt4B9CW78Hn8RjhDrkwSAbgncqaz+EmwNI5LAbWw/mPg 5ybbBmzOfD5RW9c5GfePdbtM32zXpdIIIQa51ynhyfdWXw3GlNXVfTh02qdB+I8D/bTq bhOe0H9+XBZa8skFX4hDTdR9JoTv9re3t5exU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QhwPLuHUwbI94DI/gsUDzwKynAtIT9oReKuSlhjqjbwguvNXYPs+utVkFZ1PUTp9YX 6l5c++w3jSZwsus3IhXoEyGZZFZkjT8B0WrGyc/Aj1jFfi0TUp2PvcT42r0/qwzTRz8E 4NVNJYojt17iQO4IpnPJPb4iWlBQRnhd5Htyw= MIME-Version: 1.0 Received: by 10.239.144.97 with SMTP id n33mr403962hba.183.1255368466332; Mon, 12 Oct 2009 10:27:46 -0700 (PDT) In-Reply-To: References: <2781f020910120834n6f15951fn8966381b364e1773@mail.gmail.com> Date: Mon, 12 Oct 2009 19:27:46 +0200 Message-ID: <560972290910121027x7d584924w9b8a3454233514e@mail.gmail.com> Subject: Re: Roberto's struct library missing "size" function? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 12, 2009 at 6:58 PM, Cosmin Apreutesei wrote: > Hm, you're right. Get this > instead: http://github.com/mascarenhas/alien/blob/master/src/alien/struct.c Remember that Alien's struct is a _subset_ (plus the extension to work with Alien userdata blobs). I got burned trying to do some examples on Roberto's page. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 14:38:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CHc6fU011455; Mon, 12 Oct 2009 14:38:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC5E41A6C2; Mon, 12 Oct 2009 15:36:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from autonomy.com (autnvector.autonomy.com [193.82.52.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DA711A663 for ; Mon, 12 Oct 2009 15:36:39 -0200 (BRST) Received: from jonathantt61 by autonomy.com (Cipher TLSv1:RC4-MD5:128) (MDaemon PRO v9.6.5) with ESMTP id md50013659958.msg for ; Mon, 12 Oct 2009 18:37:17 +0100 X-Spam-Processed: autonomy.com, Mon, 12 Oct 2009 18:37:17 +0100 (not processed: spam filter heuristic analysis disabled) X-MDRemoteIP: 86.159.21.199 X-Return-Path: jonathan.taylor@autonomy.com X-Envelope-From: jonathan.taylor@autonomy.com X-MDaemon-Deliver-To: lua@bazar2.conectiva.com.br From: "Jonathan Taylor" To: Subject: LuaSocket win64 Date: Mon, 12 Oct 2009 18:37:07 +0100 Message-ID: <008301ca4b62$9edd1e50$dc975af0$@taylor@autonomy.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0084_01CA4B6B.00A18650" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpLYp6T6MSppSf2TsSniszPPNRFVg== Content-Language: en-gb X-MDAV-Processed: autonomy.com, Mon, 12 Oct 2009 18:37:19 +0100 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0084_01CA4B6B.00A18650 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Anybody know where I can get LuaSocket for a win64 machine? Thanks Jonathan Taylor Technical Specialist Autonomy Systems Limited +44 7771 534519 The information contained in this message is for the intended addressee only and may contain confidential and/or privileged information. If you are not the intended addressee, please delete this message and notify the sender, and do not copy or distribute this message or disclose its contents to anyone. Any views or opinions expressed in this message are those of the author and do not necessarily represent those of Autonomy Systems Limited or of any of its associated companies. No reliance may be placed on this message without written confirmation from an authorised representative of the company. Autonomy Systems Limited, Registered Office: Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, Registered Number 03063054. ------=_NextPart_000_0084_01CA4B6B.00A18650 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Anybody know where I can get LuaSocket for a win64 = machine?

 

Thanks

 

Jonathan Taylor

Technical Specialist

Autonomy Systems Limited

+44 7771 534519

 

The information contained in this message is for the intended addressee only = and may contain confidential and/or privileged  information.  If = you are not the intended addressee, please delete this message and notify the = sender, and do not copy or distribute this message or disclose its contents to anyone.  Any views or opinions expressed in this message are those = of the author and do not necessarily represent those of Autonomy Systems = Limited or of any of its associated companies.  No reliance may be placed on this message without written confirmation from an authorised representative = of the company.  Autonomy Systems Limited, Registered Office:  = Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, Registered Number = 03063054.

------=_NextPart_000_0084_01CA4B6B.00A18650-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 14:57:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CHvJWB012892; Mon, 12 Oct 2009 14:57:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17AAE1A6DB; Mon, 12 Oct 2009 15:56:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FCB01A676 for ; Mon, 12 Oct 2009 15:55:56 -0200 (BRST) Received: by qyk34 with SMTP id 34so7456883qyk.14 for ; Mon, 12 Oct 2009 10:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=LYZmeukkHwLISb9IA6+rQT7//+WsEFQytIQBgTmafnM=; b=tqAOxUGF29ctC9VM2m6vv7rty5WHlTqc5RvhE5xonizfq+fJKQkKYPq7+ZXtj8fSVS KJ0vFXARUcQ3+O+qIbZ4FgD9Z4twAKnNW099Bp4LScIp0Z7Z4CE8owZNN3sCnruuGrdh vE2mUBAnaffAiSMb0hBGzHpZhslwCzo+1PFsk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=ZH+6WVbnGIO5EPeiNQThIQr3ycK+9sshpV8BV3U6U3SN/S/zpGKcTByiB6O3s+vQdU bolWDjvcHoekJIs7bseUrs0Yiylf0apz2NzCwQEqSfTOobvcftTkjPFY5N6CJorAC4nM 4jD7pyhHtpJQ2WPcMZUXrjcWlz4C2aNeIOTBs= MIME-Version: 1.0 Received: by 10.224.30.148 with SMTP id u20mr1920104qac.43.1255370197103; Mon, 12 Oct 2009 10:56:37 -0700 (PDT) In-Reply-To: <560972290910121027x7d584924w9b8a3454233514e@mail.gmail.com> References: <2781f020910120834n6f15951fn8966381b364e1773@mail.gmail.com> <560972290910121027x7d584924w9b8a3454233514e@mail.gmail.com> Date: Mon, 12 Oct 2009 14:56:37 -0300 X-Google-Sender-Auth: b4b6b75eba53e627 Message-ID: <7913df4d0910121056h7598c94dr95b92bc44b579aa6@mail.gmail.com> Subject: Re: Roberto's struct library missing "size" function? From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CHvJWB012892 Sorry, I didn't know that Roberto had updated this library last year. What is missing in Alien's struct.c, compared to the current implementation from Roberto's, is specifying alignment (Alien's struct.c always assumes native alignment) and having spaces (which are ignored) on the format string. Struct.c is kind of deprecated on Alien 0.5 by alien.defstruct and friends, which give a more structured way of dealing with structs (pardon the pun). -- Fabio Mascarenhas On Mon, Oct 12, 2009 at 2:27 PM, steve donovan wrote: > On Mon, Oct 12, 2009 at 6:58 PM, Cosmin Apreutesei > wrote: >> Hm, you're right. Get this >> instead: http://github.com/mascarenhas/alien/blob/master/src/alien/struct.c > > Remember that Alien's struct is a _subset_ (plus the extension to work > with Alien userdata blobs).  I got burned trying to do some examples > on Roberto's page. > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 15:04:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CI453Q013669; Mon, 12 Oct 2009 15:04:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E38418697; Mon, 12 Oct 2009 16:02:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id 146181867E for ; Mon, 12 Oct 2009 16:02:52 -0200 (BRST) Received: (qmail 21034 invoked by uid 0); 12 Oct 2009 18:03:32 -0000 Received: from 76.10.151.111 by www-us009.v300.gmx.net with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary212821255370611322975" Date: Mon, 12 Oct 2009 14:01:10 -0400 From: "Michael Surette" Message-ID: <20091012180331.212820@gmx.com> MIME-Version: 1.0 Subject: Re: how to (slightly) modify the Lua parser To: "Lua list" , lua@bazar2.conectiva.com.br X-Authenticated: #45466942 X-Flags: 0001 X-Mailer: GMX.com Web Mailer X-GMX-UID: FQu7BxkyymCuLEz9jDY0i88iJihyapD0 X-FuHaFi: 0.63 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --========GMXBoundary212821255370611322975 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary212821255370611322975 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

----- Original Message -----

From: Francesco Abbat= e

Sent: 10/12/09 12:08 pm

To: lua@bazar2.conectiva.com.br

Subject: how to (slightly) modify the Lua parser

 

Hi all,


I kno= w that in this list there are a lot of clever guys so I guess it is the goo= d place to ask *very* difficult questions about Lua :-)

For my project, GSL shell, I would like to slightly modify the Lua = parser to add some syntactic sugar. For example I would like to write:

|x| sin(x)/x

or

|x, y| sin(x) * cos(y)

as a fu= nction literal instead of

function(x) return sin= (x)/x end
or
function(x,y) return sin(x) * cos(y) end=


I've never actually used it= myself, but isn't this the kind of problem token filters ( http://www.tecgraf.puc-rio.br/~lhf/= ftp/lua/ ) are supposed to solve?


Mike


--========GMXBoundary212821255370611322975-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 15:04:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CI4Z18013753; Mon, 12 Oct 2009 15:04:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 378731A6E2; Mon, 12 Oct 2009 16:03:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1849818682 for ; Mon, 12 Oct 2009 16:02:52 -0200 (BRST) Received: (qmail 21034 invoked by uid 0); 12 Oct 2009 18:03:32 -0000 Received: from 76.10.151.111 by www-us009.v300.gmx.net with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary212821255370611322975" Date: Mon, 12 Oct 2009 14:01:10 -0400 From: "Michael Surette" Message-ID: <20091012180331.212820@gmx.com> MIME-Version: 1.0 Subject: Re: how to (slightly) modify the Lua parser To: "Lua list" , lua@bazar2.conectiva.com.br X-Authenticated: #45466942 X-Flags: 0001 X-Mailer: GMX.com Web Mailer X-GMX-UID: FQu7BxkyymCuLEz9jDY0i88iJihyapD0 X-FuHaFi: 0.63 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --========GMXBoundary212821255370611322975 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary212821255370611322975 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

----- Original Message -----

From: Francesco Abbat= e

Sent: 10/12/09 12:08 pm

To: lua@bazar2.conectiva.com.br

Subject: how to (slightly) modify the Lua parser

 

Hi all,


I kno= w that in this list there are a lot of clever guys so I guess it is the goo= d place to ask *very* difficult questions about Lua :-)

For my project, GSL shell, I would like to slightly modify the Lua = parser to add some syntactic sugar. For example I would like to write:

|x| sin(x)/x

or

|x, y| sin(x) * cos(y)

as a fu= nction literal instead of

function(x) return sin= (x)/x end
or
function(x,y) return sin(x) * cos(y) end=


I've never actually used it= myself, but isn't this the kind of problem token filters ( http://www.tecgraf.puc-rio.br/~lhf/= ftp/lua/ ) are supposed to solve?


Mike


--========GMXBoundary212821255370611322975-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 15:19:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CIJXeM014852; Mon, 12 Oct 2009 15:19:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E3B3189C4; Mon, 12 Oct 2009 16:18:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC2281897B for ; Mon, 12 Oct 2009 16:18:23 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRE0074HYUSWG60@asmtp020.mac.com> for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 11:19:01 -0700 (PDT) Message-id: <1E9A4BBB-93F9-4765-9957-5153A81C594C@mac.com> From: Petite Abeille To: Lua list In-reply-to: <20091012180331.212820@gmx.com> Subject: Re: how to (slightly) modify the Lua parser Date: Mon, 12 Oct 2009 20:18:28 +0200 References: <20091012180331.212820@gmx.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 12, 2009, at 8:01 PM, Michael Surette wrote: > Would it be possible to perhaps set your mail agent to produce a proper plain text alternative to your text/html? E.g.: Content-type: multipart/alternative; --========GMXBoundary212821255370611322975 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --========GMXBoundary212821255370611322975 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CIc57f016950; Mon, 12 Oct 2009 15:38:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9767C1914C; Mon, 12 Oct 2009 16:36:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B997119109 for ; Mon, 12 Oct 2009 16:36:45 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1MxPlt-0000VV-00; Mon, 12 Oct 2009 20:37:25 +0200 Date: Mon, 12 Oct 2009 20:37:17 +0200 From: Mike Pall To: Lua list Subject: Re: Special indices (was Re: LightUserData and metatables) Message-ID: <20091012183717.GA18510@mike.de> References: <173d86e00910120542s4b424691n8eab0963fec26e47@mail.gmail.com> <89d273ba0910120607w5b794fd3n61a226a48bb4d41b@mail.gmail.com> <173d86e00910120706q2461d855xfd9927c4ef89d444@mail.gmail.com> <86947171-60FC-4D44-B091-370FEF73AFD2@grubmah.com> <09AD8A6F-2725-4F27-81B4-C8BC60E8EA20@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09AD8A6F-2725-4F27-81B4-C8BC60E8EA20@grubmah.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: > Which incidentally makes me long a bit for a few more special indices as > much for code convenience as performance. I can understand the part about convenience. But you might be mistaken on the performance effects of adding a couple more special indices. Even minor changes to index2adr() can affect the performance of *all* Lua/C API calls. If your app is calling a lot of short-running C functions then index2adr() already shows up near the top of the performance profiles. And quite often it's one of the main causes for branch mispredictions. Adding more (unpredictable) branches to this function is not a good idea. And it's already too big to be profitably inlined. Ok, so GCC -O3 will happily inline it, but this causes excessive code duplication (it doubles the I-cache footprint of lapi.c). [Yes, I know that -O3 is no longer generally recommended for use with GCC 4.x. The better choice is -O2, maybe combined with -fomit-frame-pointer and -march=i686 for x86, since most distros still default to i586 (no cmov, no fucomip). Or even -march=native if the binaries are not distributed.] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:24:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJOFPT021060; Mon, 12 Oct 2009 16:24:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BF811A67D; Mon, 12 Oct 2009 17:22:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBAD5190F7 for ; Mon, 12 Oct 2009 17:22:45 -0200 (BRST) Received: by bwz22 with SMTP id 22so7908815bwz.5 for ; Mon, 12 Oct 2009 12:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=dBOE9EI5J3dQn9AhrGfWPv6X3KU6NH4jAjb4NEEVL4Y=; b=abPodCEVPn2djUEcnC6K7WvSM32J0O0CVrUIP9UWqp6sLO2zYghmr3wHPFfZL0pGNX nfzq+vHzl0Q8wwVsq2QcfMNuako1WVRuAX2KBSY4+jB/ow+qM4RgisijPnSZqUHkj6O9 jVyXdNep9+uXGpIwPW0v6myl5R4fi8AMATXJ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iEk7yTmarIEQzmBt/1Udy76KRZD4cgXDdch6eeiSvOd3CCFaE1vxMHFf4tlDW9dM4y +Wjz15LQkeKLLAkdF+LyfRk8prlwUq4GfO2uxjXyX62+fzRMsMLJnzs+ayRTvPAuWrfV 2ebSpjNHSvagz/+wYYPR0gXj+72Kj2RqpeHSU= MIME-Version: 1.0 Received: by 10.204.8.13 with SMTP id f13mr5416474bkf.150.1255375406399; Mon, 12 Oct 2009 12:23:26 -0700 (PDT) In-Reply-To: <61B10B9A-9B34-4314-AB8E-CE764D107247@grubmah.com> References: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> <61B10B9A-9B34-4314-AB8E-CE764D107247@grubmah.com> Date: Mon, 12 Oct 2009 21:23:26 +0200 Message-ID: <4ff79edb0910121223u56cedc9ftee95212316b48b24@mail.gmail.com> Subject: Re: how to (slightly) modify the Lua parser From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=000e0cd30d762880910475c1dd18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd30d762880910475c1dd18 Content-Type: text/plain; charset=ISO-8859-1 Hi guys, thank you very much for the suggestion. Actually I was able to make a patch for the 'compact function literal' and it works like a charm :-) I was impressed how simple and well written is the Lua parser but that's not a surprise given the general level of quality of Lua. About the priority, my idea was that it should act very much like a classic function literal. In this spirit I've given a priority 0 and I've thus used expr(ls, e) in the parser instead of subexpr(ls, v, priority). Note that the comma is not treated like an operator so the statement: f, g = |x| 2*x, |x| 3*x perform the assignment for f and g as expected. Otherwise I don't want to heavily modify the syntax to support function literals without parenthesis as you suggested. I don't want to make another Ruby implementation :-) I'm sending the patch for the interested ones. I guess it qualifies to be listed among the PowerPatchs. Francesco --- BEGIN OF FILE --- --- lua-5.1.4/src/lparser.c 2007-12-28 16:32:23.000000000 +0100 +++ lua-5.1.4-real-mod/src/lparser.c 2009-10-12 20:08:06.000000000 +0200 @@ -592,8 +592,26 @@ pushclosure(ls, &new_fs, e); } +static void simplebody (LexState *ls, expdesc *e, int line) { + /* simplebody -> parlist `|' expr END */ + FuncState new_fs; + expdesc ebody; + int reg; + open_func(ls, &new_fs); + new_fs.f->linedefined = line; + parlist(ls); + checknext(ls, '|'); + expr(ls, &ebody); + reg = luaK_exp2anyreg(&new_fs, &ebody); + luaK_ret(&new_fs, reg, 1); + new_fs.f->lastlinedefined = ls->linenumber; + close_func(ls); + pushclosure(ls, &new_fs, e); +} + + static int explist1 (LexState *ls, expdesc *v) { /* explist1 -> expr { `,' expr } */ int n = 1; /* at least one expression */ expr(ls, v); @@ -765,8 +783,13 @@ luaX_next(ls); body(ls, v, 0, ls->linenumber); return; } + case '|': { + luaX_next(ls); + simplebody(ls, v, ls->linenumber); + return; + } default: { primaryexp(ls, v); return; } --- END OF FILE --- 2009/10/12 Mark Hamburg > On Oct 12, 2009, at 9:08 AM, Francesco Abbate wrote: > > Hi all, >> >> I know that in this list there are a lot of clever guys so I guess it is >> the good place to ask *very* difficult questions about Lua :-) >> >> For my project, GSL shell, I would like to slightly modify the Lua parser >> to add some syntactic sugar. For example I would like to write: >> >> |x| sin(x)/x >> >> or >> >> |x, y| sin(x) * cos(y) >> >> as a function literal instead of >> >> function(x) return sin(x)/x end >> or >> function(x,y) return sin(x) * cos(y) end >> >> Incidentally, this syntax is supported by metalua. >> >> Otherwise I would like to index object with more comma-separated values >> because for a matrix is natural to write something like m[i, j] to refer to >> an element of the matrix. Right now I'm doing m:get(i, j) but I would like >> to simplify the notation. >> >> It seems that metalua can offer all these things but I'm wondering if it >> is really the good choice. The other alternative could be to hack the Lua >> code to modify the parser. I'm ready to fiddle my hands in the Lua code but >> the source code is quite complicated and I didn't find any tutorial on >> 'hacking Lua' so it is very difficult to start. >> >> Thank you in advance for any help. >> > > I'm afraid I'm not going to answer your question though the general answer > probably is of middling difficulty (you need to modify the lexer to > recognize the bar token and you'll need to define a new case for expressions > -- I would probably look at where the function keyword is accepted). But > before you dive in, you probably need to consider a variety of questions: > > * What sort of precedence does | | have? In particular, > how does it relate to commas? For example, is: > > | x | x + 1, 2 > > Equivalent to: > > function( x ) return x + 1 end, 2 > > Or is it equivalent to: > > function( x ) return x + 1, 2 end > > Does this really do what you want in the context of expression lists? In > other contexts? > > * Do you also want to consider a syntax like: > > | | do end > > This would allow for more than just expression one liners. > > * On a similar front, how about: > > | | > > For the cases where one has just one statement. That has the problem that > you need a way to tell a statement (which won't need an implicit return) > from an expression (which will). > > * Do you want to treat these expression like tables and strings and allow > them to be invoked without parentheses? This is probably particularly > interesting for method calls: > > myCollection:map | x | sin( x ) / x > > If so, should this be allowed for the heavy syntax as well: > > myCollection:map function( x ) return sin( x ) / x end > > Of course, the further one pushes on these sort of constructs, the closer > one gets to Smalltalk and Ruby blocks but note that those have interesting > rules about returns v non-local exits. (A block can either return a value to > its caller or can return/exit from the method in which it is created.) > Non-local exit is an interesting semantic extension to Lua, but it isn't > clear what it would mean for pcall. > > But pulling back from the semantic question, there are presumably answers > to some of these points available in Metalua. One could also resolve some of > the questions through alternative syntax choices that provided an explicit > end marker for the "syntactically lightweight" closure. This might also make > dropping parentheses more appealing: > > myCollection:map<< | x | sin( x ) / x >> > > (I'm not particularly attached to the above syntax.) > > Mark > > --000e0cd30d762880910475c1dd18 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi guys,

thank you very much for the suggestion. Actuall= y I was able to make a patch for the 'compact function literal' and= it works like a charm :-)

I was impressed how sim= ple and well written is the Lua parser but that's not a surprise given = the general level of quality of Lua.

About the priority, my idea was that it should act very= much like a classic function literal. In this spirit I've given a prio= rity 0 and I've thus used expr(ls, e) in the parser instead of subexpr(= ls, v, priority). Note that the comma is not treated like an operator so th= e statement:

f, g =3D |x| 2*x, |x| 3*x
perform the assignm= ent for f and g as expected.

Otherwise I don't= want to heavily modify the syntax to support function literals without par= enthesis as you suggested. I don't want to make another Ruby implementa= tion :-)

I'm sending the patch for the interested ones. I gu= ess it qualifies to be listed among the PowerPatchs.

Francesco

--- BEGIN OF FILE ---
--- lua-5.1.4/src/lparser.c 2007-12-28 16:32:23.000000000 +0100
+++ lua-5.1.= 4-real-mod/src/lparser.c 2009-10-12 20:08:06.000000000 +0200
@@ -592,8 +592,26 @@
=A0=A0 pushclosure(ls, &new_fs, e);=
=A0}
=A0
=A0
+static void simplebo= dy (LexState *ls, expdesc *e, int line) {
+ =A0/* simplebody ->= ; =A0parlist `|' expr END */
+ =A0FuncState new_fs;
+ =A0expdesc ebody;
+ =A0in= t reg;
+ =A0open_func(ls, &new_fs);
+ =A0new_fs.f-&= gt;linedefined =3D line;
+ =A0parlist(ls);
+ =A0checkne= xt(ls, '|');
+ =A0expr(ls, &ebody);
+ =A0reg =3D luaK_exp2anyreg(&= ;new_fs, &ebody);
+ =A0luaK_ret(&new_fs, reg, 1);
+ =A0new_fs.f->lastlinedefined =3D ls->linenumber;
+ =A0= close_func(ls);
+ =A0pushclosure(ls, &new_fs, e);
+}
+
+
=A0static int explist1 (LexState *ls, expdesc *v) {
=A0=A0 /* explist1 -> expr { `,' expr } */
=A0=A0 int n = =3D 1; =A0/* at least one expression */
=A0=A0 expr(ls, v);
@@ -765,8 +783,13 @@
=A0=A0 = =A0 =A0 luaX_next(ls);
=A0=A0 =A0 =A0 body(ls, v, 0, ls->linen= umber);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
+= =A0 =A0case '|': {
+ =A0 =A0 =A0luaX_next(ls);
+ =A0 =A0 =A0simplebody(ls, v, ls->= ;linenumber);
+ =A0 =A0 =A0return;
+ =A0 =A0}
=A0=A0 =A0 default: {
=A0=A0 =A0 =A0 primaryexp(ls, v);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
--- END OF FILE ---

2009/10/12 Mar= k Hamburg <mark@gr= ubmah.com>
On Oct 12, 2009, at 9:08 AM, Francesco Ab= bate wrote:

Hi all,

I know that in this list there are a lot of clever guys so I guess it is th= e good place to ask *very* difficult questions about Lua :-)

For my project, GSL shell, I would like to slightly modify the Lua parser t= o add some syntactic sugar. For example I would like to write:

|x| sin(x)/x

or

|x, y| sin(x) * cos(y)

as a function literal instead of

function(x) return sin(x)/x end
or
function(x,y) return sin(x) * cos(y) end

Incidentally, this syntax is supported by metalua.

Otherwise I would like to index object with more comma-separated values bec= ause for a matrix is natural to write something like m[i, j] to refer to an= element of the matrix. Right now I'm doing m:get(i, j) but I would lik= e to simplify the notation.

It seems that metalua can offer all these things but I'm wondering if i= t is really the good choice. The other alternative could be to hack the Lua= code to modify the parser. I'm ready to fiddle my hands in the Lua cod= e but the source code is quite complicated and I didn't find any tutori= al on 'hacking Lua' so it is very difficult to start.

Thank you in advance for any help.

I'm afraid I'm not going to answer your question though the general= answer probably is of middling difficulty (you need to modify the lexer to= recognize the bar token and you'll need to define a new case for expre= ssions -- I would probably look at where the function keyword is accepted).= But before you dive in, you probably need to consider a variety of questio= ns:

* What sort of precedence does | <args> | <expression> have? In= particular, how does it relate to commas? For example, is:

=A0 =A0 =A0 =A0| x | x + 1, 2

Equivalent to:

=A0 =A0 =A0 =A0function( x ) return x + 1 end, 2

Or is it equivalent to:

=A0 =A0 =A0 =A0function( x ) return x + 1, 2 end

Does this really do what you want in the context of expression lists? In ot= her contexts?

* Do you also want to consider a syntax like:

=A0 =A0 =A0 =A0| <args> | do <statements> end

This would allow for more than just expression one liners.

* On a similar front, how about:

=A0 =A0 =A0 =A0| <args> | <statement>

For the cases where one has just one statement. That has the problem that y= ou need a way to tell a statement (which won't need an implicit return)= from an expression (which will).

* Do you want to treat these expression like tables and strings and allow t= hem to be invoked without parentheses? This is probably particularly intere= sting for method calls:

=A0 =A0 =A0 =A0myCollection:map | x | sin( x ) / x

If so, should this be allowed for the heavy syntax as well:

=A0 =A0 =A0 =A0myCollection:map function( x ) return sin( x ) / x end

Of course, the further one pushes on these sort of constructs, the closer o= ne gets to Smalltalk and Ruby blocks but note that those have interesting r= ules about returns v non-local exits. (A block can either return a value to= its caller or can return/exit from the method in which it is created.) Non= -local exit is an interesting semantic extension to Lua, but it isn't c= lear what it would mean for pcall.

But pulling back from the semantic question, there are presumably answers t= o some of these points available in Metalua. One could also resolve some of= the questions through alternative syntax choices that provided an explicit= end marker for the "syntactically lightweight" closure. This mig= ht also make dropping parentheses more appealing:

=A0 =A0 =A0 =A0myCollection:map<< | x | sin( x ) / x >>

(I'm not particularly attached to the above syntax.)

Mark


--000e0cd30d762880910475c1dd18-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:31:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJVAZY021751; Mon, 12 Oct 2009 16:31:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5CE219286; Mon, 12 Oct 2009 17:30:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89DD8190F7 for ; Mon, 12 Oct 2009 17:30:01 -0200 (BRST) Received: by ewy26 with SMTP id 26so9755012ewy.5 for ; Mon, 12 Oct 2009 12:30:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.86.212 with SMTP id w62mr2110437wee.131.1255375842157; Mon, 12 Oct 2009 12:30:42 -0700 (PDT) From: Chris Gagnon Date: Mon, 12 Oct 2009 12:30:22 -0700 Message-ID: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> Subject: Lua Pre-compiler / Lua side userdata To: Lua list Content-Type: multipart/alternative; boundary=0016e6d9a3a221a43a0475c1f78c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d9a3a221a43a0475c1f78c Content-Type: text/plain; charset=ISO-8859-1 I'm come to a situation, where to maintain readability for script writers but ensure fast code i want to parse lua code before it goes to the compiler. The issue i foresee is that I'll essentially want to create user data in the Lua script. So an example in Lua: PostEvent("ButtonClick") very readable, however strings...yuck I want to create a hash of that string for speed: PostEvent( 0xABC45678 ) All is good you might think, however the gotcha is that that we compile lua using a 32-bit float to represent numbers. Internally that float will lose the precision and hence mess up the 32 bit constant. Basically I'm looking for any suggestions, as i don't have any great ideas that don't add needless run time overhead. Thanks, Chris --0016e6d9a3a221a43a0475c1f78c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm come to a situation, where to maintain readability for script write= rs but ensure fast code i want to parse lua code before it goes to the comp= iler.
The issue i foresee is that I'll essentially want to create us= er data in the Lua script.

So an example in Lua:
PostEvent("ButtonClick")
very rea= dable, however strings...yuck

I want to create a hash of that string= for speed:
PostEvent( 0xABC45678 )

All is good you might think, = however the gotcha is that that we compile lua using a 32-bit float to represent numbers.
Internally that float will lose the precision and hence mess up the 32 bit constant.
Basically I'm looking for any suggestions, as i don't have any gre= at ideas that don't add needless run time overhead.

Thanks,
Chris


--0016e6d9a3a221a43a0475c1f78c-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:38:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJcVFf022342; Mon, 12 Oct 2009 16:38:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 490481A6A0; Mon, 12 Oct 2009 17:37:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6FFC1A685 for ; Mon, 12 Oct 2009 17:37:25 -0200 (BRST) Received: by iwn5 with SMTP id 5so4932013iwn.11 for ; Mon, 12 Oct 2009 12:38:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.5.79 with SMTP id 15mr8030019ibu.7.1255376287870; Mon, 12 Oct 2009 12:38:07 -0700 (PDT) In-Reply-To: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> Date: Mon, 12 Oct 2009 15:38:07 -0400 Message-ID: <790db3550910121238o3fdd2c3fg5d3938d1c8a70ad7@mail.gmail.com> Subject: Re: Lua Pre-compiler / Lua side userdata From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 12, 2009 at 3:30 PM, Chris Gagnon wrote: > I'm come to a situation, where to maintain readability for script writers > but ensure fast code i want to parse lua code before it goes to the > compiler. > The issue i foresee is that I'll essentially want to create user data in the > Lua script. > > So an example in Lua: > PostEvent("ButtonClick") > very readable, however strings...yuck > > I want to create a hash of that string for speed: > PostEvent( 0xABC45678 ) > > All is good you might think, however the gotcha is that that we compile lua > using a 32-bit float to represent numbers. > Internally that float will lose the precision and hence mess up the 32 bit > constant. > > Basically I'm looking for any suggestions, as i don't have any great ideas > that don't add needless run time overhead. Create a table on the C side that maps strings to a C enum. Add a string -> enum mapping for all option strings. Then during runtime, you simply index the option string (passed from Lua) into the table and use the integer (enum) value for whatever (if you get nil, then they passed a bad string). -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:51:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJpRoc023304; Mon, 12 Oct 2009 16:51:27 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 773E11A6C6; Mon, 12 Oct 2009 17:49:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2AB91A685 for ; Mon, 12 Oct 2009 17:49:45 -0200 (BRST) Received: by fxm12 with SMTP id 12so3035898fxm.5 for ; Mon, 12 Oct 2009 12:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lIYqWujeTufrYvtClCLN09gA0vdX4TYTKKNnDsnM8bM=; b=EEDjsnoUiwuON1Yd0uM7f1KHWDaLXBINYQTp5aYjQnrQzkxpIg0NUc3sTgWuQudgV0 j476Wte4ZiMz5nP5QTOzkWJgZxq1NBcs4xOL0Hg10Oq34qx3HQh40KEbe0HKR3ZrJLXv 9xw8+QILWLv4hCSPUXGLlcRW0p5LDqEDFCdXs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=R4o6WHymZFo6PYXYPZM0jZJc4nwg7AupWoYhU5Q7qffqKhfp7p9FM9blmthnJRyt/W +rmZ6GbT74Ml1r8Y8WkLS/+brpGasicWVfA5PingFLUUImWSBe4ac4BK2EkL7bt0//az sWE7u9x7jwjDt25yUVJjqPQdZtYHDrZIGn4so= MIME-Version: 1.0 Received: by 10.204.20.82 with SMTP id e18mr5380447bkb.168.1255377027346; Mon, 12 Oct 2009 12:50:27 -0700 (PDT) In-Reply-To: <4ff79edb0910121223u56cedc9ftee95212316b48b24@mail.gmail.com> References: <4ff79edb0910120908q1a06b0c4o7c8b984a14797c48@mail.gmail.com> <61B10B9A-9B34-4314-AB8E-CE764D107247@grubmah.com> <4ff79edb0910121223u56cedc9ftee95212316b48b24@mail.gmail.com> Date: Mon, 12 Oct 2009 21:50:27 +0200 Message-ID: <4ff79edb0910121250j10b6beceq4c98923d30f613fe@mail.gmail.com> Subject: Re: how to (slightly) modify the Lua parser From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=000325559f56c6301d0475c23da7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559f56c6301d0475c23da7 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I'm proud to announce Lambda Function Power Patch for Lua 2.0 enterprise edition. This new version is mainly a bugfix release of Lambda Function Power Patch for Lua 1.0. :-) Enjoy, Francesco --- BEGIN FILE --- --- lua-5.1.4/src/lparser.c 2007-12-28 16:32:23.000000000 +0100 +++ lua-5.1.4-real-mod/src/lparser.c 2009-10-12 21:39:32.000000000 +0200 @@ -538,16 +538,15 @@ /* }====================================================================== */ - -static void parlist (LexState *ls) { +static void parlist_ext (LexState *ls, int end_token) { /* parlist -> [ param { `,' param } ] */ FuncState *fs = ls->fs; Proto *f = fs->f; int nparams = 0; f->is_vararg = 0; - if (ls->t.token != ')') { /* is `parlist' not empty? */ + if (ls->t.token != end_token) { /* is `parlist' not empty? */ do { switch (ls->t.token) { case TK_NAME: { /* param -> NAME */ new_localvar(ls, str_checkname(ls), nparams++); @@ -571,8 +570,11 @@ f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG)); luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ } +static void parlist (LexState *ls) { + parlist_ext (ls, ')'); +} static void body (LexState *ls, expdesc *e, int needself, int line) { /* body -> `(' parlist `)' chunk END */ FuncState new_fs; @@ -592,8 +594,26 @@ pushclosure(ls, &new_fs, e); } +static void simplebody (LexState *ls, expdesc *e, int line) { + /* simplebody -> parlist `|' expr END */ + FuncState new_fs; + expdesc ebody; + int reg; + open_func(ls, &new_fs); + new_fs.f->linedefined = line; + parlist_ext(ls, '|'); + checknext(ls, '|'); + expr(ls, &ebody); + reg = luaK_exp2anyreg(&new_fs, &ebody); + luaK_ret(&new_fs, reg, 1); + new_fs.f->lastlinedefined = ls->linenumber; + close_func(ls); + pushclosure(ls, &new_fs, e); +} + + static int explist1 (LexState *ls, expdesc *v) { /* explist1 -> expr { `,' expr } */ int n = 1; /* at least one expression */ expr(ls, v); @@ -765,8 +785,13 @@ luaX_next(ls); body(ls, v, 0, ls->linenumber); return; } + case '|': { + luaX_next(ls); + simplebody(ls, v, ls->linenumber); + return; + } default: { primaryexp(ls, v); return; } --- END FILE --- 2009/10/12 Francesco Abbate > Hi guys, > thank you very much for the suggestion. Actually I was able to make a patch > for the 'compact function literal' and it works like a charm :-) > > I was impressed how simple and well written is the Lua parser but that's > not a surprise given the general level of quality of Lua. > > About the priority, my idea was that it should act very much like a classic > function literal. In this spirit I've given a priority 0 and I've thus used > expr(ls, e) in the parser instead of subexpr(ls, v, priority). Note that the > comma is not treated like an operator so the statement: > > f, g = |x| 2*x, |x| 3*x > perform the assignment for f and g as expected. > > Otherwise I don't want to heavily modify the syntax to support function > literals without parenthesis as you suggested. I don't want to make another > Ruby implementation :-) > > I'm sending the patch for the interested ones. I guess it qualifies to be > listed among the PowerPatchs. > > Francesco > > --- BEGIN OF FILE --- > --- lua-5.1.4/src/lparser.c 2007-12-28 16:32:23.000000000 +0100 > +++ lua-5.1.4-real-mod/src/lparser.c 2009-10-12 20:08:06.000000000 +0200 > @@ -592,8 +592,26 @@ > pushclosure(ls, &new_fs, e); > } > > > +static void simplebody (LexState *ls, expdesc *e, int line) { > + /* simplebody -> parlist `|' expr END */ > + FuncState new_fs; > + expdesc ebody; > + int reg; > + open_func(ls, &new_fs); > + new_fs.f->linedefined = line; > + parlist(ls); > + checknext(ls, '|'); > + expr(ls, &ebody); > + reg = luaK_exp2anyreg(&new_fs, &ebody); > + luaK_ret(&new_fs, reg, 1); > + new_fs.f->lastlinedefined = ls->linenumber; > + close_func(ls); > + pushclosure(ls, &new_fs, e); > +} > + > + > static int explist1 (LexState *ls, expdesc *v) { > /* explist1 -> expr { `,' expr } */ > int n = 1; /* at least one expression */ > expr(ls, v); > @@ -765,8 +783,13 @@ > luaX_next(ls); > body(ls, v, 0, ls->linenumber); > return; > } > + case '|': { > + luaX_next(ls); > + simplebody(ls, v, ls->linenumber); > + return; > + } > default: { > primaryexp(ls, v); > return; > } > --- END OF FILE --- > > 2009/10/12 Mark Hamburg > > On Oct 12, 2009, at 9:08 AM, Francesco Abbate wrote: >> >> Hi all, >>> >>> I know that in this list there are a lot of clever guys so I guess it is >>> the good place to ask *very* difficult questions about Lua :-) >>> >>> For my project, GSL shell, I would like to slightly modify the Lua parser >>> to add some syntactic sugar. For example I would like to write: >>> >>> |x| sin(x)/x >>> >>> or >>> >>> |x, y| sin(x) * cos(y) >>> >>> as a function literal instead of >>> >>> function(x) return sin(x)/x end >>> or >>> function(x,y) return sin(x) * cos(y) end >>> >>> Incidentally, this syntax is supported by metalua. >>> >>> Otherwise I would like to index object with more comma-separated values >>> because for a matrix is natural to write something like m[i, j] to refer to >>> an element of the matrix. Right now I'm doing m:get(i, j) but I would like >>> to simplify the notation. >>> >>> It seems that metalua can offer all these things but I'm wondering if it >>> is really the good choice. The other alternative could be to hack the Lua >>> code to modify the parser. I'm ready to fiddle my hands in the Lua code but >>> the source code is quite complicated and I didn't find any tutorial on >>> 'hacking Lua' so it is very difficult to start. >>> >>> Thank you in advance for any help. >>> >> >> I'm afraid I'm not going to answer your question though the general answer >> probably is of middling difficulty (you need to modify the lexer to >> recognize the bar token and you'll need to define a new case for expressions >> -- I would probably look at where the function keyword is accepted). But >> before you dive in, you probably need to consider a variety of questions: >> >> * What sort of precedence does | | have? In >> particular, how does it relate to commas? For example, is: >> >> | x | x + 1, 2 >> >> Equivalent to: >> >> function( x ) return x + 1 end, 2 >> >> Or is it equivalent to: >> >> function( x ) return x + 1, 2 end >> >> Does this really do what you want in the context of expression lists? In >> other contexts? >> >> * Do you also want to consider a syntax like: >> >> | | do end >> >> This would allow for more than just expression one liners. >> >> * On a similar front, how about: >> >> | | >> >> For the cases where one has just one statement. That has the problem that >> you need a way to tell a statement (which won't need an implicit return) >> from an expression (which will). >> >> * Do you want to treat these expression like tables and strings and allow >> them to be invoked without parentheses? This is probably particularly >> interesting for method calls: >> >> myCollection:map | x | sin( x ) / x >> >> If so, should this be allowed for the heavy syntax as well: >> >> myCollection:map function( x ) return sin( x ) / x end >> >> Of course, the further one pushes on these sort of constructs, the closer >> one gets to Smalltalk and Ruby blocks but note that those have interesting >> rules about returns v non-local exits. (A block can either return a value to >> its caller or can return/exit from the method in which it is created.) >> Non-local exit is an interesting semantic extension to Lua, but it isn't >> clear what it would mean for pcall. >> >> But pulling back from the semantic question, there are presumably answers >> to some of these points available in Metalua. One could also resolve some of >> the questions through alternative syntax choices that provided an explicit >> end marker for the "syntactically lightweight" closure. This might also make >> dropping parentheses more appealing: >> >> myCollection:map<< | x | sin( x ) / x >> >> >> (I'm not particularly attached to the above syntax.) >> >> Mark >> >> > --000325559f56c6301d0475c23da7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

I'm proud to announce Lambda Function Power = Patch for Lua 2.0 enterprise edition. This new version is mainly a bugfix r= elease of=A0Lambda Function Power Patch for Lua=A01.0.

=
:-)

Enjoy,
Francesco

--- BEGIN FILE ---
--- lua-5.1.4/src/lparser.c 2007-12-28 16:32:2= 3.000000000 +0100
+++ lua-5.1.4-real-mod/src/lparser.c 2009-10-12 21:39:32.000000000 +0200
@@ -538,16 +538,15 @@
=A0
=A0/* }=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
=A0
=A0
-
-static void parlist (LexState= *ls) {
+static void parlist_ext (LexState *ls, int end_token) {<= /div>
=A0=A0 /* parlist -> [ param { `,' param } ] */
= =A0=A0 FuncState *fs =3D ls->fs;
=A0=A0 Proto *f =3D fs->f;
=A0=A0 int nparams =3D 0;
=A0=A0 f->is_vararg =3D 0;
- =A0if (ls->t.token !=3D = ')') { =A0/* is `parlist' not empty? */
+ =A0if (ls-&= gt;t.token !=3D end_token) { =A0/* is `parlist' not empty? */
=A0=A0 =A0 do {
=A0=A0 =A0 =A0 switch (ls->t.token) {
=A0=A0 =A0 =A0 =A0 case TK_NAME: { =A0/* param -> NAME */
=A0=A0 =A0 =A0 =A0 =A0 new_localvar(ls, str_checkname(ls), nparams++);
@@ -571,8 +570,11 @@
=A0=A0 f->numparams =3D cast_byte(fs->nactvar - (f->is_vararg= & VARARG_HASARG));
=A0=A0 luaK_reserveregs(fs, fs->nactva= r); =A0/* reserve register for parameters */
=A0}
=A0
+static void parlist (LexState *ls) {
+ =A0parlist_ext (ls, ')');
+}
=A0
=A0static void body (LexState *ls, expdesc *e, int needself, int line) {=
=A0=A0 /* body -> =A0`(' parlist `)' chunk END */
=A0=A0 FuncState new_fs;
@@ -592,8 +594,26 @@
=A0=A0 pushclosure(ls, &new_fs, e);=
=A0}
=A0
=A0
+static void simplebo= dy (LexState *ls, expdesc *e, int line) {
+ =A0/* simplebody ->= ; =A0parlist `|' expr END */
+ =A0FuncState new_fs;
+ =A0expdesc ebody;
+ =A0in= t reg;
+ =A0open_func(ls, &new_fs);
+ =A0new_fs.f-&= gt;linedefined =3D line;
+ =A0parlist_ext(ls, '|');
=
+ =A0checknext(ls, '|');
+ =A0expr(ls, &ebody);
+ =A0reg =3D luaK_exp2anyreg(&= ;new_fs, &ebody);
+ =A0luaK_ret(&new_fs, reg, 1);
+ =A0new_fs.f->lastlinedefined =3D ls->linenumber;
+ =A0= close_func(ls);
+ =A0pushclosure(ls, &new_fs, e);
+}
+
+
=A0static int explist1 (LexState *ls, expdesc *v) {
=A0=A0 /* explist1 -> expr { `,' expr } */
=A0=A0 int n = =3D 1; =A0/* at least one expression */
=A0=A0 expr(ls, v);
@@ -765,8 +785,13 @@
=A0=A0 = =A0 =A0 luaX_next(ls);
=A0=A0 =A0 =A0 body(ls, v, 0, ls->linen= umber);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
+= =A0 =A0case '|': {
+ =A0 =A0 =A0luaX_next(ls);
+ =A0 =A0 =A0simplebody(ls, v, ls->= ;linenumber);
+ =A0 =A0 =A0return;
+ =A0 =A0}
=A0=A0 =A0 default: {
=A0=A0 =A0 =A0 primaryexp(ls, v);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
--- END FILE ---

2009/1= 0/12 Francesco Abbate <francesco.bbt@gmail.com>
Hi guys,

thank you very much for the suggestion. Actuall= y I was able to make a patch for the 'compact function literal' and= it works like a charm :-)

I was impressed how sim= ple and well written is the Lua parser but that's not a surprise given = the general level of quality of Lua.

About the priority, my idea was that it should act very= much like a classic function literal. In this spirit I've given a prio= rity 0 and I've thus used expr(ls, e) in the parser instead of subexpr(= ls, v, priority). Note that the comma is not treated like an operator so th= e statement:

f, g =3D |x| 2*x, |x| 3*x
perform the assignm= ent for f and g as expected.

Otherwise I don't= want to heavily modify the syntax to support function literals without par= enthesis as you suggested. I don't want to make another Ruby implementa= tion :-)

I'm sending the patch for the interested ones. I gu= ess it qualifies to be listed among the PowerPatchs.

Francesco

--- BEGIN OF FILE ---
--- lua-5.1.4/src/lparser.c 2007-12-= 28 16:32:23.000000000 +0100
+++ lua-5.1.4-real-mod/src/lparser.c<= span style=3D"white-space:pre"> 2009-10-12 20:08:06.000000000 +0200<= /div>
@@ -592,8 +592,26 @@
=A0=A0 pushclosure(ls, &new_fs, e);=
=A0}
=A0
=A0
+static void simplebo= dy (LexState *ls, expdesc *e, int line) {
+ =A0/* simplebody ->= ; =A0parlist `|' expr END */
+ =A0FuncState new_fs;
+ =A0expdesc ebody;
+ =A0in= t reg;
+ =A0open_func(ls, &new_fs);
+ =A0new_fs.f-&= gt;linedefined =3D line;
+ =A0parlist(ls);
+ =A0checkne= xt(ls, '|');
+ =A0expr(ls, &ebody);
+ =A0reg =3D luaK_exp2anyreg(&= ;new_fs, &ebody);
+ =A0luaK_ret(&new_fs, reg, 1);
+ =A0new_fs.f->lastlinedefined =3D ls->linenumber;
+ =A0= close_func(ls);
+ =A0pushclosure(ls, &new_fs, e);
+}
+
+
=A0static int explist1 (LexState *ls, expdesc *v) {
=A0=A0 /* explist1 -> expr { `,' expr } */
=A0=A0 int n = =3D 1; =A0/* at least one expression */
=A0=A0 expr(ls, v);
@@ -765,8 +783,13 @@
=A0=A0 = =A0 =A0 luaX_next(ls);
=A0=A0 =A0 =A0 body(ls, v, 0, ls->linen= umber);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
+= =A0 =A0case '|': {
+ =A0 =A0 =A0luaX_next(ls);
+ =A0 =A0 =A0simplebody(ls, v, ls->= ;linenumber);
+ =A0 =A0 =A0return;
+ =A0 =A0}
=A0=A0 =A0 default: {
=A0=A0 =A0 =A0 primaryexp(ls, v);
=A0=A0 =A0 =A0 return;
=A0=A0 =A0 }
--- END OF FILE ---

2009/10/12 Mar= k Hamburg <mark@grubmah.com>

On Oct 12, 2009, at 9:08 AM, Francesco Abbate wrote:
Hi all,

I know that in this list there are a lot of clever guys so I guess it is th= e good place to ask *very* difficult questions about Lua :-)

For my project, GSL shell, I would like to slightly modify the Lua parser t= o add some syntactic sugar. For example I would like to write:

|x| sin(x)/x

or

|x, y| sin(x) * cos(y)

as a function literal instead of

function(x) return sin(x)/x end
or
function(x,y) return sin(x) * cos(y) end

Incidentally, this syntax is supported by metalua.

Otherwise I would like to index object with more comma-separated values bec= ause for a matrix is natural to write something like m[i, j] to refer to an= element of the matrix. Right now I'm doing m:get(i, j) but I would lik= e to simplify the notation.

It seems that metalua can offer all these things but I'm wondering if i= t is really the good choice. The other alternative could be to hack the Lua= code to modify the parser. I'm ready to fiddle my hands in the Lua cod= e but the source code is quite complicated and I didn't find any tutori= al on 'hacking Lua' so it is very difficult to start.

Thank you in advance for any help.

I'm afraid I'm not going to answer your question though the general= answer probably is of middling difficulty (you need to modify the lexer to= recognize the bar token and you'll need to define a new case for expre= ssions -- I would probably look at where the function keyword is accepted).= But before you dive in, you probably need to consider a variety of questio= ns:

* What sort of precedence does | <args> | <expression> have? In= particular, how does it relate to commas? For example, is:

=A0 =A0 =A0 =A0| x | x + 1, 2

Equivalent to:

=A0 =A0 =A0 =A0function( x ) return x + 1 end, 2

Or is it equivalent to:

=A0 =A0 =A0 =A0function( x ) return x + 1, 2 end

Does this really do what you want in the context of expression lists? In ot= her contexts?

* Do you also want to consider a syntax like:

=A0 =A0 =A0 =A0| <args> | do <statements> end

This would allow for more than just expression one liners.

* On a similar front, how about:

=A0 =A0 =A0 =A0| <args> | <statement>

For the cases where one has just one statement. That has the problem that y= ou need a way to tell a statement (which won't need an implicit return)= from an expression (which will).

* Do you want to treat these expression like tables and strings and allow t= hem to be invoked without parentheses? This is probably particularly intere= sting for method calls:

=A0 =A0 =A0 =A0myCollection:map | x | sin( x ) / x

If so, should this be allowed for the heavy syntax as well:

=A0 =A0 =A0 =A0myCollection:map function( x ) return sin( x ) / x end

Of course, the further one pushes on these sort of constructs, the closer o= ne gets to Smalltalk and Ruby blocks but note that those have interesting r= ules about returns v non-local exits. (A block can either return a value to= its caller or can return/exit from the method in which it is created.) Non= -local exit is an interesting semantic extension to Lua, but it isn't c= lear what it would mean for pcall.

But pulling back from the semantic question, there are presumably answers t= o some of these points available in Metalua. One could also resolve some of= the questions through alternative syntax choices that provided an explicit= end marker for the "syntactically lightweight" closure. This mig= ht also make dropping parentheses more appealing:

=A0 =A0 =A0 =A0myCollection:map<< | x | sin( x ) / x >>

(I'm not particularly attached to the above syntax.)

Mark



--000325559f56c6301d0475c23da7-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:54:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJsboK023574; Mon, 12 Oct 2009 16:54:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4CC218E78; Mon, 12 Oct 2009 17:53:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F9D618D60 for ; Mon, 12 Oct 2009 17:53:29 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MxQxy-0002eN-Tw for ; Mon, 12 Oct 2009 20:53:58 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MxQyA-0004ld-21 for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 20:54:10 +0100 Date: Mon, 12 Oct 2009 20:54:09 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Lua Pre-compiler / Lua side userdata Message-ID: <20091012205409.5a04a80e@trite.i.flarn.net.i.flarn.net> In-Reply-To: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 12 Oct 2009 12:30:22 -0700 Chris Gagnon wrote: > I'm come to a situation, where to maintain readability for script > writers but ensure fast code i want to parse lua code before it goes > to the compiler. > The issue i foresee is that I'll essentially want to create user data > in the Lua script. > > So an example in Lua: > PostEvent("ButtonClick") > very readable, however strings...yuck > > I want to create a hash of that string for speed: > PostEvent( 0xABC45678 ) Have you actually benchmarked this? The string will be folded into the constants table at compile time, and should take a similar amount of time to load from it as a numerical constant. Additionally, string comparison for equality boils down to a single pointer compare, so is very quick; not to mention more readable. B. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 16:59:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CJxLJE023987; Mon, 12 Oct 2009 16:59:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5598418EBE; Mon, 12 Oct 2009 17:58:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6151F18D60 for ; Mon, 12 Oct 2009 17:58:13 -0200 (BRST) Received: by iwn5 with SMTP id 5so4940798iwn.11 for ; Mon, 12 Oct 2009 12:58:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.126.69 with SMTP id b5mr13332260ibs.54.1255377535311; Mon, 12 Oct 2009 12:58:55 -0700 (PDT) In-Reply-To: <20091012205409.5a04a80e@trite.i.flarn.net.i.flarn.net> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <20091012205409.5a04a80e@trite.i.flarn.net.i.flarn.net> Date: Mon, 12 Oct 2009 15:58:55 -0400 Message-ID: <790db3550910121258y27f3a90ex49db51b80f7c3159@mail.gmail.com> Subject: Re: Lua Pre-compiler / Lua side userdata From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CJxLJE023987 On Mon, Oct 12, 2009 at 3:54 PM, Rob Kendrick wrote: > Have you actually benchmarked this?  The string will be folded into the > constants table at compile time, and should take a similar amount of > time to load from it as a numerical constant.  Additionally, string > comparison for equality boils down to a single pointer compare, so is > very quick; not to mention more readable. I believe his problem is comparing the option string to a long list of options a la [1]. [1] http://www.lua.org/manual/5.1/manual.html#luaL_checkoption -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 17:09:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CK9fxo024906; Mon, 12 Oct 2009 17:09:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C079318F70; Mon, 12 Oct 2009 18:08:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FA6518D90 for ; Mon, 12 Oct 2009 18:08:33 -0200 (BRST) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MxRCl-0000s5-Ok for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 17:09:15 -0300 Message-ID: <4AD38CEB.4000302@sct.microlink.com.br> Date: Mon, 12 Oct 2009 17:09:15 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua Pre-compiler / Lua side userdata References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> In-Reply-To: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Can't you create a table of events? Your example would become PostEvent(Events.ButtonClick) You can assign numbers to entries in the Events table so Events.ButtonClick will translate to an number (one that fits in a float) which you can easily compare in the C side. Cheers, Andre Chris Gagnon wrote: > I'm come to a situation, where to maintain readability for script > writers but ensure fast code i want to parse lua code before it goes to > the compiler. > The issue i foresee is that I'll essentially want to create user data in > the Lua script. > > So an example in Lua: > PostEvent("ButtonClick") > very readable, however strings...yuck > > I want to create a hash of that string for speed: > PostEvent( 0xABC45678 ) > > All is good you might think, however the gotcha is that that we compile > lua using a 32-bit float to represent numbers. > Internally that float will lose the precision and hence mess up the 32 > bit constant. > > Basically I'm looking for any suggestions, as i don't have any great > ideas that don't add needless run time overhead. > > Thanks, > Chris > > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 17:28:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CKSVr8026948; Mon, 12 Oct 2009 17:28:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D601185DD; Mon, 12 Oct 2009 18:27:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39B32185C5 for ; Mon, 12 Oct 2009 18:27:21 -0200 (BRST) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MxRUy-0001Ft-6r for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 17:28:04 -0300 Message-ID: <4AD39154.7030807@sct.microlink.com.br> Date: Mon, 12 Oct 2009 17:28:04 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Lua hashes Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi All, When __index and __newindex are implemented in C, one has to compare the key with a list of strings to find out what key was passed in. I usually have all strings I need to compare fed to gperf, and use gperf to translate the string to an integer which then I can put in a switch for example. But gperf has to compute the hash of the string and ultimately compare the string to avoid false positives. If key hashes are available to these metamethods, I can get rid of gperf and string by string comparisons. If the hash function is good enough, I can even live without one single string comparison, relying only on the hash. For this to be possible, I'd also need easy access to Lua's hashes to pre-hash my strings and use the resulting hash in my code. It would also be interesting to be able to override the default hashes. So what I'd like to know is: 1. Is it possible to change __index and __newindex to receive the hash of the key? 2. Is it possible to expose Lua's hash functions to user code? 3. Is it possible to change Lua's hash functions to allow for experimentation with different hashes? I know all three can be done by changing Lua, but I'd rather have them inside the core. 1 and 2 doesn't affect code performance (ok, in 1 an extra parameter must be pushed on the stack...) 3 might affect performance a little since hash functions would be calls to function pointers, unless it's a compile time feature. Cheers, Andre From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 17:50:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CKoLBQ028531; Mon, 12 Oct 2009 17:50:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5ABA518CAD; Mon, 12 Oct 2009 18:49:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 676CD189E1 for ; Mon, 12 Oct 2009 18:49:09 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 4so682437eyf.5 for ; Mon, 12 Oct 2009 13:49:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.93.16 with SMTP id k16mr2120830wef.33.1255380589271; Mon, 12 Oct 2009 13:49:49 -0700 (PDT) In-Reply-To: <4AD38CEB.4000302@sct.microlink.com.br> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <4AD38CEB.4000302@sct.microlink.com.br> From: Chris Gagnon Date: Mon, 12 Oct 2009 13:49:29 -0700 Message-ID: <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> Subject: Re: Lua Pre-compiler / Lua side userdata To: Lua list Content-Type: multipart/alternative; boundary=0016e6d6495c14e61d0475c3120b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d6495c14e61d0475c3120b Content-Type: text/plain; charset=ISO-8859-1 > > Can't you create a table of events? Your example would become > > PostEvent(Events.ButtonClick) > An event is but one example of the uses of hashed strings in the project, and they can be arbitrary named by the script writers. Maintaining a table of events like: PostEvent(Events.ButtonClick) would likely be a pain. This creates a C++ code dependency which lowers the usefulness of scripting (fast iteration on changes). Otherwise it's all done lua side which still runs into the hash precision issue. Have you actually benchmarked this? The string will be folded into the > constants table at compile time, and should take a similar amount of > time to load from it as a numerical constant. Additionally, string > comparison for equality boils down to a single pointer compare, so is > very quick; not to mention more readable. > > B. > I have not bench marked this, the problem is internal systems still require the hash so the calculation of the hash is an overhead I'd like to avoid. More thoughts? -Chris On Mon, Oct 12, 2009 at 1:09 PM, Andre de Leiradella < aleirade@sct.microlink.com.br> wrote: > Can't you create a table of events? Your example would become > > PostEvent(Events.ButtonClick) > > You can assign numbers to entries in the Events table so Events.ButtonClick > will translate to an number (one that fits in a float) which you can easily > compare in the C side. > > Cheers, > > Andre > > > Chris Gagnon wrote: > >> I'm come to a situation, where to maintain readability for script writers >> but ensure fast code i want to parse lua code before it goes to the >> compiler. >> The issue i foresee is that I'll essentially want to create user data in >> the Lua script. >> >> So an example in Lua: >> PostEvent("ButtonClick") >> very readable, however strings...yuck >> >> I want to create a hash of that string for speed: >> PostEvent( 0xABC45678 ) >> >> All is good you might think, however the gotcha is that that we compile >> lua using a 32-bit float to represent numbers. >> Internally that float will lose the precision and hence mess up the 32 bit >> constant. >> >> Basically I'm looking for any suggestions, as i don't have any great ideas >> that don't add needless run time overhead. >> >> Thanks, >> Chris >> >> >> --0016e6d6495c14e61d0475c3120b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Can't you cre= ate a table of events? Your example would become

PostEvent(Events.ButtonClick)

An event is but one example of the uses of hashed strings in the projec= t, and they can be arbitrary named by the script writers.
Maintaining a = table of events like:
PostEvent(Events.ButtonClick)
would likely be a= pain.
This creates a C++ code dependency which lowers the usefulness of scripting= (fast iteration on changes).
Otherwise it's all done lua side which= still runs into the hash precision issue.

Have you actually benchmarked this? =A0The string will be folded into the constants table at compile time, and should take a similar amount of
time to load from it as a numerical constant. =A0Additionally, string
comparison for equality boils down to a single pointer compare, so is
very quick; not to mention more readable.

B.

I have not bench marked this, the problem is internal systems still req= uire the hash so the calculation of the hash is an overhead I'd like to= avoid.

More thoughts?

-Chris

On Mon, Oct 12, 2009 at 1:09 PM, Andre de Leiradella <= aleirade@sct.microlink.com= .br> wrote:
Can't you create a table of events? Your example would become

PostEvent(Events.ButtonClick)

You can assign numbers to entries in the Events table so Events.ButtonClick= will translate to an number (one that fits in a float) which you can easil= y compare in the C side.

Cheers,

Andre


Chris Gagnon wrote:
I'm come to a situation, where to maintain readability for script write= rs but ensure fast code i want to parse lua code before it goes to the comp= iler.
The issue i foresee is that I'll essentially want to create user data i= n the Lua script.

So an example in Lua:
PostEvent("ButtonClick")
very readable, however strings...yuck

I want to create a hash of that string for speed:
PostEvent( 0xABC45678 )

All is good you might think, however the gotcha is that that we compile lua= using a 32-bit float to represent numbers.
Internally that float will lose the precision and hence mess up the 32 bit = constant.

Basically I'm looking for any suggestions, as i don't have any grea= t ideas that don't add needless run time overhead.

Thanks,
Chris



--0016e6d6495c14e61d0475c3120b-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:16:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLGA5R030574; Mon, 12 Oct 2009 18:16:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17F091A688; Mon, 12 Oct 2009 19:15:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-04.prod.phx3.secureserver.net (p3plsmtpa01-04.prod.phx3.secureserver.net [72.167.82.84]) by bazar2.conectiva.com.br (Postfix) with SMTP id 864C11A678 for ; Mon, 12 Oct 2009 19:14:56 -0200 (BRST) Received: (qmail 25228 invoked from network); 12 Oct 2009 21:15:35 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-04.prod.phx3.secureserver.net (72.167.82.84) with ESMTP; 12 Oct 2009 21:15:32 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua Pre-compiler / Lua side userdata From: Mark Hamburg In-Reply-To: <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> Date: Mon, 12 Oct 2009 14:15:32 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <4AD38CEB.4000302@sct.microlink.com.br> <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It sounds like you just need a hash value and not that the C side needs to assign that value. At least that's my reading of your desire to avoid a C side dependency for creating the values. Could you just use the fact that Lua 5.1 strings don't move (at least if they don't get collected and you could deal with that by shoving them in a table) and using the address of the string as the input to the hash function? Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:17:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLH0r7030675; Mon, 12 Oct 2009 18:17:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DD491A6A3; Mon, 12 Oct 2009 19:15:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A13E1A689 for ; Mon, 12 Oct 2009 19:15:51 -0200 (BRST) Received: by bwz22 with SMTP id 22so7986707bwz.5 for ; Mon, 12 Oct 2009 14:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=eRC465jQBQnwn+294yMZCTFk76TZsqsuUDIcKexb55k=; b=F1HtQJtMuGAr/ruPCPsnWhrxf5udcmygmoLua+4qrCzB+rizotUGSfO+lfB1uQmhZi q7aM2TMvDlhkQvJODqTUFNB5sjMKjHM7Mnn+SpCSD6LGhM9avaQcOsmhPqA1/jCCruew rzHxSIdaxkJAnjSM5rnQuFtS+obdCP6JLeXVc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=kqNPFMhcu6y+Oq39L1i0gFRgMeZp2knloaAByp1vKT2mpxvfdSSnwSAou/DUYaDUJg HIAA5nzHJri4/Jts0Vb4/Z13017lA/xhmJp6HmPQo5ufhgi/wVn+PUFcUOOWCm0BNPLj qpK8lE95w/HGccfYju9E6EVyIu9JPCF0VicMU= MIME-Version: 1.0 Received: by 10.204.11.17 with SMTP id r17mr5507065bkr.41.1255382192178; Mon, 12 Oct 2009 14:16:32 -0700 (PDT) From: =?ISO-8859-1?Q?Andr=E9_Ericsson?= Date: Mon, 12 Oct 2009 23:16:12 +0200 Message-ID: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> Subject: Addition of map() and filter(). To: Lua mailing list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CLH0r7030675 I've more than once been struck by lua's lacking tools for handling "lists", i.e. several values separated by commas in Lua. The problem is usually when dealing with lists of arbitrary or unknown length, as expressed by "...". Since this doesn't have a good term (as far as I know), I'll make one up. I shall call this an expression list in this post. For example: function funcThatTakesAnArbitraryNumberOfArgs(...) --[[ Manipulates the variable number of arguments in some way. ]] end Functions of this kind are often difficult to write and often require either auxiliary functions that recurse one depth per list item. For example, if we want to take a variable number of arguments and turn them all into a string, we can either recursively call tostring(), or we can create an intermediary table and insert the values there. A good example is a function in the Lua API from World of Warcraft: local LOCAL_ToStringAllTemp = {}; function tostringall(...) local n = select('#', ...); -- Simple versions for common argument counts if (n == 1) then return tostring(...); elseif (n == 2) then local a, b = ...; return tostring(a), tostring(b); elseif (n == 3) then local a, b, c = ...; return tostring(a), tostring(b), tostring(c); elseif (n == 0) then return; end local needfix; for i = 1, n do local v = select(i, ...); if (type(v) ~= "string") then needfix = i; break; end end if (not needfix) then return ...; end wipe(LOCAL_ToStringAllTemp); -- wipe(tbl) removes all entries from tbl. for i = 1, needfix - 1 do LOCAL_ToStringAllTemp[i] = select(i, ...); end for i = needfix, n do LOCAL_ToStringAllTemp[i] = tostring(select(i, ...)); end return unpack(LOCAL_ToStringAllTemp); end As can be seen, manipulating expression lists isn't very easy. I'm proposing we add two functions to simplify this: map() and filter(). map(func, ...) takes a function and applies it on all of the items in the expression list, returning them as a new expression list. Example: function tostringall(...) return map(tostring, ...); end filter(func, ...) takes a function and calls it for every item in the expression list, and returns a new expression list consisting of all the items for which the function returned a true value. Example: function filterPrimeNumbers(...) return filter(isPrime, ...) -- isPrime(n) returns true if n is prime end This function doesn't have a good precedent in the wow codebase, but is commonly used throughout functional programming languages and programming languages supporting such constructs. Optionally coupled with a function to generate an expression list from 1 to n, range(n), it's very easy to generate an expression list of all prime numbers up to n: filter(isPrime, range(n)) -- Generates an expression list of all primes up to n The range() function is not really part of this proposal but is also, in my opinion, a good addition. I have implemented these three functions in C as well as in Lua. Limited performance tests show that for larger expression lists, lua-map() is about 3x slower than C-map(). For smaller expression lists the difference is roughly 1.5x. For filter() the performance difference depends on the number of elements being filtered out. If every element is valid, C-map() was roughly 15x faster in my testing, down to about 5x if every other element was filtered out. range() appears to be about 1.5x slower but both implementations are fast. If desired, I can share my implementations of these functions. Regarding use cases, not everyone I've discussed this with over IRC thinks it's a useful addition to Lua. However, I think the tostringall() example above alone shows that at least map() has some very useful use cases. Thoughts? Best regards, André Eriksson From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:27:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLRch4031963; Mon, 12 Oct 2009 18:27:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34A0F1A684; Mon, 12 Oct 2009 19:26:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth20.prod.mesa1.secureserver.net (smtpauth20.prod.mesa1.secureserver.net [64.202.165.36]) by bazar2.conectiva.com.br (Postfix) with SMTP id 398391873C for ; Mon, 12 Oct 2009 19:26:29 -0200 (BRST) Received: (qmail 14881 invoked from network); 12 Oct 2009 21:27:06 -0000 Received: from unknown (98.117.140.83) by smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 12 Oct 2009 21:27:06 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua hashes From: Mark Hamburg In-Reply-To: <4AD39154.7030807@sct.microlink.com.br> Date: Mon, 12 Oct 2009 14:27:05 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <4AD39154.7030807@sct.microlink.com.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Your __index and __newindex functions can also store string to integer maps as upvalues and do the following: lua_pushvalue( L, 2 ); /* The key */ lua_gettable( L, lua_upvalueindex( kKeyTableIndex ) ); int keyIndex = lua_tointeger( L, -1 ); You could also use the environment index for the functions to do this. Note that you don't want to have 0 be a valid result index (offset everything by 1 if need be) since undefined keys will come back as 1. The actual lookup will probably be about as fast as your hash table so the overhead is in the other API calls. You could become more clever for __index by having the translation table itself have an __index method that returns the key for any undefined items and you could then avoid the need to copy the key and instead could just translate it in place. Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:30:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLUSGQ032244; Mon, 12 Oct 2009 18:30:28 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2D551874C; Mon, 12 Oct 2009 19:29:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BC681873C for ; Mon, 12 Oct 2009 19:29:18 -0200 (BRST) Received: by ewy26 with SMTP id 26so9849570ewy.5 for ; Mon, 12 Oct 2009 14:29:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.137 with SMTP id e9mr2008443wef.141.1255382999237; Mon, 12 Oct 2009 14:29:59 -0700 (PDT) In-Reply-To: References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <4AD38CEB.4000302@sct.microlink.com.br> <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> From: Chris Gagnon Date: Mon, 12 Oct 2009 14:29:39 -0700 Message-ID: <826d5c730910121429j4466e021m470a5a4a004eed41@mail.gmail.com> Subject: Re: Lua Pre-compiler / Lua side userdata To: Lua list Content-Type: multipart/alternative; boundary=0016e6d99cd7ba03830475c3a1e0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d99cd7ba03830475c3a1e0 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 12, 2009 at 2:15 PM, Mark Hamburg wrote: > It sounds like you just need a hash value and not that the C side needs to > assign that value. At least that's my reading of your desire to avoid a C > side dependency for creating the values. Could you just use the fact that > Lua 5.1 strings don't move (at least if they don't get collected and you > could deal with that by shoving them in a table) and using the address of > the string as the input to the hash function? > > Mark > > This doesn't work since we actually use CRC-32 as our hash. --0016e6d99cd7ba03830475c3a1e0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Oct 12, 2009 at 2:15 PM, Mark Hambur= g <mark@grubmah.co= m> wrote:
It sounds like you just need a hash value and not that the C side needs to = assign that value. At least that's my reading of your desire to avoid a= C side dependency for creating the values. Could you just use the fact tha= t Lua 5.1 strings don't move (at least if they don't get collected = and you could deal with that by shoving them in a table) and using the addr= ess of the string as the input to the hash function?

Mark


This doesn't work since we actually use C= RC-32 as our hash.


--0016e6d99cd7ba03830475c3a1e0-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:31:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLVQfV032347; Mon, 12 Oct 2009 18:31:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01A55187D5; Mon, 12 Oct 2009 19:30:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FDAC1873C for ; Mon, 12 Oct 2009 19:30:19 -0200 (BRST) Received: by fxm12 with SMTP id 12so3112939fxm.5 for ; Mon, 12 Oct 2009 14:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=J+1U1XAFaJ1NKlXvSVHUWPEjpDl5+Y4OJWgAa0zTzhw=; b=AfZ1P4pvUUH2JYumrPA+BZJ3UjutF4RXXPqi009TbrFuGeL47CcipmELfujRBRoZ+e f93N2z+lpXd5BLRhQRnZisVK22m/QSm57ILhL2opCoAE4kXRfMnfavJuUnHlcNTMf48O IihJBDI2hQt2HXUtEJXWQ51yeMgOrG6OzPkAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=FjOfF1p/jFywGpHIOT3FfpvMW7aOxqMHspCXWJ1Uh9/6YNFH/t9yQXsF11GK/LHesW pt5uD2dKRJWxtD6W+VbY8WWThQYUDdOEi6vDOT4Epdve24O3pAHGt4ic2n0YU6V6Swrs oLkcaxXFGQYkHG2hs8EisDTPUH4FSaLjzPgsA= Received: by 10.86.187.27 with SMTP id k27mr5690556fgf.11.1255383059901; Mon, 12 Oct 2009 14:30:59 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id l12sm212600fgb.4.2009.10.12.14.30.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Oct 2009 14:30:59 -0700 (PDT) Message-Id: <61588535-B4D1-48D7-8AA1-BAEF89451014@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Addition of map() and filter(). Date: Mon, 12 Oct 2009 23:30:28 +0200 References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CLVQfV032347 On Oct 12, 2009, at 11:16 PM, André Ericsson wrote: > Regarding use cases, not everyone I've discussed this with over IRC > thinks it's a useful addition to Lua. However, I think the > tostringall() example above alone shows that at least map() has some > very useful use cases. Thoughts? This is all good and fine, but... why would you want to add that to Lua itself? From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:36:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLaTqg032699; Mon, 12 Oct 2009 18:36:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45BED1A692; Mon, 12 Oct 2009 19:35:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth23.prod.mesa1.secureserver.net (smtpauth23.prod.mesa1.secureserver.net [64.202.165.47]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6DCA21A678 for ; Mon, 12 Oct 2009 19:35:16 -0200 (BRST) Received: (qmail 6072 invoked from network); 12 Oct 2009 21:35:54 -0000 Received: from unknown (98.117.140.83) by smtpauth23.prod.mesa1.secureserver.net (64.202.165.47) with ESMTP; 12 Oct 2009 21:35:54 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua Pre-compiler / Lua side userdata From: Mark Hamburg In-Reply-To: <826d5c730910121429j4466e021m470a5a4a004eed41@mail.gmail.com> Date: Mon, 12 Oct 2009 14:35:54 -0700 Content-Transfer-Encoding: 7bit Message-Id: <0550C2F1-7C55-44ED-B145-AA501A125F8E@grubmah.com> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <4AD38CEB.4000302@sct.microlink.com.br> <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> <826d5c730910121429j4466e021m470a5a4a004eed41@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think I need more information. On the one hand, you don't want there to be a need to change C code to add new event codes or other values in need of hashes. On the other hand, you care about the specific hash algorithm. Is this because sometimes these are generated from the C side and sometimes they exist purely on the Lua side? Mark From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:44:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLiSfX000717; Mon, 12 Oct 2009 18:44:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85C5D1A6B3; Mon, 12 Oct 2009 19:43:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B795B1A678 for ; Mon, 12 Oct 2009 19:43:21 -0200 (BRST) Received: by fxm12 with SMTP id 12so3121327fxm.5 for ; Mon, 12 Oct 2009 14:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Fwn3AjQFbAfkgVg9uxjkYwBaIwfXjPf5C/JaHBBZpvE=; b=uZdrtFIZx+34rpYmJhWR5MkxUXrVoDNMUhGGc7uhFmKJxB9iaLrFVPQVbeW9N4RzFW M1/gDoCIIAGStfg1kaFCRz0WmAr1U6RQ6dYpHLQnBA+h/ChDqTRRYKVmN1T5GvcEE1vq 9/iuQkWlJh0T0yN5i8wON4rf4MbfaX9B1Qcmo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VuDwuAXuBF6Q7IxRjRbRI/rWETTdRQPN/SoDTiA4TJQjIekOHD2iQcxJR48Hqs2PG5 vNQzeGdkkeuBipBsaUpkFfWQwKCSnYazctY9/b7RJTEVM9dS5BOBZFqrUWDHakAFzHVa EdM75QpIxaGq2Z4Lh9p9MJelxXw32yDQuNM8M= MIME-Version: 1.0 Received: by 10.86.232.5 with SMTP id e5mr5627327fgh.27.1255383842556; Mon, 12 Oct 2009 14:44:02 -0700 (PDT) In-Reply-To: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> Date: Mon, 12 Oct 2009 23:44:02 +0200 Message-ID: <9386fb2d0910121444x464a7486o7e48d5bda073343d@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Regarding use cases, not everyone I've discussed this with over IRC > thinks it's a useful addition to Lua. However, I think the > tostringall() example above alone shows that at least map() has some > very useful use cases. Thoughts? > I may have missed something while reading through this, but why not use tables, like this? function tostringall(...) local t={...} for k,v in ipairs(t) t[k]=tostring(v) end return unpack(t) end /Pierre From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:51:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLp7xC001308; Mon, 12 Oct 2009 18:51:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5E11184C9; Mon, 12 Oct 2009 19:50:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2CF1184A4 for ; Mon, 12 Oct 2009 19:49:53 -0200 (BRST) Received: by fxm12 with SMTP id 12so3125248fxm.5 for ; Mon, 12 Oct 2009 14:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=jlCv/WfH2Fje9xf2ChhFvzkE4gHcampj0anEWjNDZ1o=; b=fFfCH73/zrjOtKw9wCU++IRgh2Xqu3iAp5Gy0Dri7XLHIZkImQElqElhikNdEUgumS x7ywW24YImltk2f9BJkQxXmBnPlcaZU9K6OTsW8eK43aHDTHrNBgDKNF3ENpoPEov+YX z3wLkMVwX/ySVFstnRKV1666ifydid/lzlBz4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=bJYAsLs4KUp1bt/h6ECXRE1dbSo0vIsVckRBbzH2ETZhNXSrGN4XwwZhcmjupwcoZv +V+lgJEx9RDBIkI04Y+yPWJzTg4e4U0tdpOk/bjgozsuo9sP9/68soIhjNYeyv48U1ks rg1MG+vD3vFiDnAusnoMlXUFpvkOtIIDSAplw= MIME-Version: 1.0 Received: by 10.204.151.194 with SMTP id d2mr5539959bkw.85.1255384235128; Mon, 12 Oct 2009 14:50:35 -0700 (PDT) From: =?ISO-8859-1?Q?Andr=E9_Ericsson?= Date: Mon, 12 Oct 2009 23:50:15 +0200 Message-ID: <27b7d0b60910121450j5ce37f6cr3ade6b5c39bcffb3@mail.gmail.com> Subject: Re: Addition of map() and filter(). To: Lua mailing list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I may have missed something while reading through this, but why not > use tables, like this? > function tostringall(...) > local t={...} > for k,v in ipairs(t) > t[k]=tostring(v) > end > return unpack(t) > end I believe the reasoning against that was garbage creation concerns. The simple cases at the beginning of the function were added due to performance concerns. From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 18:56:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CLuhiC001881; Mon, 12 Oct 2009 18:56:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8BCF18542; Mon, 12 Oct 2009 19:55:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07284184A5 for ; Mon, 12 Oct 2009 19:55:36 -0200 (BRST) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MxSsM-0003LI-AK for lua@bazar2.conectiva.com.br; Mon, 12 Oct 2009 18:56:18 -0300 Message-ID: <4AD3A602.3020307@sct.microlink.com.br> Date: Mon, 12 Oct 2009 18:56:18 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Lua hashes References: <4AD39154.7030807@sct.microlink.com.br> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hum... So instead of feeding all my strings to gperf, I would insert them all in a Lua table as keys to integer values. In the metamethods, I just index that table with the key which already has its hash value computed (i.e. the hash will not be re-evaluated) and get back the unique integer I can use in a switch for example. This is precisely what I suggested to Chris Gagnon, but done in the C side. How on Earth I didn't think of it? Thanks! Mark Hamburg wrote: > Your __index and __newindex functions can also store string to integer > maps as upvalues and do the following: > > lua_pushvalue( L, 2 ); /* The key */ > lua_gettable( L, lua_upvalueindex( kKeyTableIndex ) ); > int keyIndex = lua_tointeger( L, -1 ); > > You could also use the environment index for the functions to do this. > > Note that you don't want to have 0 be a valid result index (offset > everything by 1 if need be) since undefined keys will come back as 1. > > The actual lookup will probably be about as fast as your hash table so > the overhead is in the other API calls. > > You could become more clever for __index by having the translation table > itself have an __index method that returns the key for any undefined > items and you could then avoid the need to copy the key and instead > could just translate it in place. > > Mark > > > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 19:17:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CMHTFR003404; Mon, 12 Oct 2009 19:17:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCE76187CD; Mon, 12 Oct 2009 20:16:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f204.google.com (mail-px0-f204.google.com [209.85.216.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2C4C18744 for ; Mon, 12 Oct 2009 20:16:20 -0200 (BRST) Received: by pxi42 with SMTP id 42so8910226pxi.5 for ; Mon, 12 Oct 2009 15:17:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.61.41 with SMTP id j41mr516645wfa.298.1255385821605; Mon, 12 Oct 2009 15:17:01 -0700 (PDT) In-Reply-To: <27b7d0b60910121450j5ce37f6cr3ade6b5c39bcffb3@mail.gmail.com> References: <27b7d0b60910121450j5ce37f6cr3ade6b5c39bcffb3@mail.gmail.com> Date: Mon, 12 Oct 2009 17:17:01 -0500 Message-ID: <576e7620910121517r7755ea19q6e9d9630cb37df5d@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9CMHTFR003404 On Mon, Oct 12, 2009 at 4:50 PM, André Ericsson wrote: >> I may have missed something while reading through this, but why not >> use tables, like this? >> function tostringall(...) >>    local t={...} >>    for k,v in ipairs(t) >>       t[k]=tostring(v) >>    end >>    return unpack(t) >> end > > I believe the reasoning against that was garbage creation concerns. > The simple cases at the beginning of the function were added due to > performance concerns. There have been proposals now and then to add an apairs() iterator, which would behave like ipairs(), but over its arguments instead of a table's array part. A little while back I mentioned one that I had written with minimal garbage in mind: http://lua-users.org/lists/lua-l/2009-06/msg00358.html From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 19:37:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CMbY0R004704; Mon, 12 Oct 2009 19:37:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84F0118E5E; Mon, 12 Oct 2009 20:36:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5322E18D64 for ; Mon, 12 Oct 2009 20:36:21 -0200 (BRST) Received: by ewy26 with SMTP id 26so40167ewy.5 for ; Mon, 12 Oct 2009 15:37:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.12 with SMTP id b12mr2101115wef.93.1255387023171; Mon, 12 Oct 2009 15:37:03 -0700 (PDT) In-Reply-To: <0550C2F1-7C55-44ED-B145-AA501A125F8E@grubmah.com> References: <826d5c730910121230x4fddf77ci280a0ce19f7bdb7e@mail.gmail.com> <4AD38CEB.4000302@sct.microlink.com.br> <826d5c730910121349m25b00e01jd0a6cae2083b48c7@mail.gmail.com> <826d5c730910121429j4466e021m470a5a4a004eed41@mail.gmail.com> <0550C2F1-7C55-44ED-B145-AA501A125F8E@grubmah.com> From: Chris Gagnon Date: Mon, 12 Oct 2009 15:36:43 -0700 Message-ID: <826d5c730910121536n5ed334f6k7a05adc002ee1c09@mail.gmail.com> Subject: Re: Lua Pre-compiler / Lua side userdata To: Lua list Content-Type: multipart/alternative; boundary=0016e6da2e7e92615d0475c491cf X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6da2e7e92615d0475c491cf Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 12, 2009 at 2:35 PM, Mark Hamburg wrote: > I think I need more information. On the one hand, you don't want there to > be a need to change C code to add new event codes or other values in need of > hashes. On the other hand, you care about the specific hash algorithm. Is > this because sometimes these are generated from the C side and sometimes > they exist purely on the Lua side? > > Mark > > I have an established event system used from the c+ side that uses compile time CRC-32 for events, we also utilize these when defining attributes and other things. I'm trying to extend that functionality to lua. Since the events are dispatched through c++ anyone can be listening(lua or c++). So there is no required change in c++ in the lua posts event and lua listens for event case. -Chris --0016e6da2e7e92615d0475c491cf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I have an established event system used from = the c+ side that uses compile time CRC-32 for events, we also utilize these= when defining attributes and other things. I'm trying to extend that f= unctionality to lua.

Since the events are dispatched through c++ anyone can be listening(lua= or c++).
So there is no required change in c++ in the lua posts event a= nd lua listens for event case.

-Chris
--0016e6da2e7e92615d0475c491cf-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 20:40:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CNedCN009663; Mon, 12 Oct 2009 20:40:39 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE8AD187D3; Mon, 12 Oct 2009 21:39:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA43E1873C for ; Mon, 12 Oct 2009 21:39:23 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LZxbR-1MZvzG382f-00lYpv; Mon, 12 Oct 2009 19:40:04 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> In-Reply-To: <5fe281d40910111416n60605e6mdf6365c2292b7f2a@mail.gmail.com> Subject: Re: Luaforge redesign, data crisis, project management, and a partridge in a pear tree.. Date: Mon, 12 Oct 2009 16:39:34 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19lDIcee1W4kLOBcf/0jaKJ8/bTHZQXIY6gAIH BCtSCaKm1ei7c399WQq7MDtw9Cti7beYDluNCgIVn8Jv2NM9zX ZAjKEvX76WwRmyXTRUBBTFh6XmX5KAl X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If wouldn't be too much of a burden to him, I think the most logical choice for project manager would be Andre, seeing as how it's pretty much his site. -------------------------------------------------- From: "Jim Whitehead II" Sent: Sunday, October 11, 2009 P2:16 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Luaforge redesign, data crisis, project management, and a partridge in a pear tree.. > I sincerely apologize for the new topic, but I want to ensure that > anyone who might have muted the otherthread (it's up to 97 responses > at this point) gets a chance to read this. Fernando just raised some > points in his last response that I wanted to clarify. > > When the Luaforge server first went down, we entered crisis mode. It > was unclear how long it would take to get the site back up and running > and it showed the entire community a deficiency in our infrastructure. > As a community, we have come to rely quite heavily on the site, as > evidenced by the periodic downtime this year and the most recent > crash. Thanks to the Andre, Alessandro and everyone else involved, > portions of the website have been restored. As far as I am aware the > faulty hardware has been replaced and while in the short term we need > a better backup solution, I wouldn't consider us to be in crisis mode > any longer. We're no more aware of the possibility of a crash than we > were the last time Andre warned us, it's just fresher in our minds! > > Secondly, although my actions over the past four days may have > indicated otherwise, I am not (at this point) assuming the role of > project manager for our discussion and redesign. I happened to be the > one who took notes at our meeting in Rio and when I landed in the U.S, > I didn't see any responses from those people, so I took the initiative > and tried to corral everyone into a more appropriate location. > > This long term project is less than a week old, and I think it's a bit > premature to be deciding what role everyone will have in the project. > There are people who might not have been reading the mailing list this > week that might like to be involved, for example. I'm more than happy > to act as project manager, but if that prevents other people from > being involved in the project due to interpersonal conflicts, I am > happy to step aside and let someone else lead while still helping the > project in any way I can. > > For right now, I just ask that we all take a step back and breathe. > Whatever the complexity of the solution, it's going to take time and a > number of iterations in order to get to a point where it's usable as a > replacement for G-Forge. Starting tomorrow (so I have a remote chance > of enjoying the remainder of my weekend), I'm going to try and start > an architectural/design discussion somewhere. Then we will have a > concrete place to list precisely what we want on the site, without > getting bogged down with the specific details of implementation. > > I'd like to (again) extend an invitation for anyone who is interested > in the future development of to join the > luaforge-development mailing list [1] at Google Groups. Of course any > release announcements or preliminary designs may be made here, we > should try to restrict active discussion about the site to the mailing > list. > > Thanks for your patience with me, > > - Jim > > [1]: http://groups.google.com/group/luaforge-development. > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 20:43:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CNgx60009872; Mon, 12 Oct 2009 20:42:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 577EF1A67B; Mon, 12 Oct 2009 21:41:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE44518744 for ; Mon, 12 Oct 2009 21:41:52 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LuwOn-1MF7H62v4L-00zmzJ; Mon, 12 Oct 2009 19:42:35 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <421D7D4429BB473DAEBBE47B33459C5A@Stucomet> In-Reply-To: Subject: Re: Kepler graph Date: Mon, 12 Oct 2009 16:42:23 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX190pWObWxD9G9zaO6qLMdMcgVpN2UDDEwhp7ZV sZr0TzeCMQlipPoAB3PPl8xhkhPoBXd/L0d4+BQGpCLCTcqvf4 SQxCtF6+foyxoXryS2BjqcmdqNDHgbq X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I don't want to revert it to a previous version. I want to keep the current additions, but have them work like the old one did. When I looked at history (which I'm fairly sure I did) I couldn't see any change that would be causing the problem. -------------------------------------------------- From: "Philippe Lhoste" Sent: Monday, October 12, 2009 A7:13 Newsgroups: gmane.comp.lang.lua.general To: Subject: Re: Kepler graph > On 11/10/2009 03:02, Stuart P. Bentley wrote: >> I think I broke it. I made an edit to clarify how Sputnik handles pages >> and now it's stopped recognizing subgraphs. > > Stuart, it is a Wiki, if you click on the table icon (top-right of page), > you can see history and go back to a working version. > > Also using Graphviz, you can play with it locally until it looks like you > want... :-) > > -- > Philippe Lhoste > -- (near) Paris -- France > -- http://Phi.Lho.free.fr > -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 20:57:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9CNv5Si010870; Mon, 12 Oct 2009 20:57:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F2BB18B1F; Mon, 12 Oct 2009 21:56:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE80618A61 for ; Mon, 12 Oct 2009 21:55:57 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0M5dh2-1M4Jpd2mwS-00y94e; Mon, 12 Oct 2009 19:56:39 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com><560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com><457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet><560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com><1D99EA267DC948B189409523B6540D1C@Stucomet><5D02E5E848434879B251D2DD8EFB3F3B@Stucomet><8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> <560972290910110703y66e40566m2df9def3f425e57d@mail.gmail.com> In-Reply-To: <560972290910110703y66e40566m2df9def3f425e57d@mail.gmail.com> Subject: Re: Lua Recipes Site? Date: Mon, 12 Oct 2009 16:56:27 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX18UdPJxLzJuM8dVRsl4CFcb+82lVxGV/U7xdbi TuDsw1q9qea7alcFlpJ3yrCnUK/aEgBlwqrZW6QOa6yTYI2S87 XayPB7ukZsGD1w/5nK4eMMf9Xuz1FGB X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Yeah, the scale in the image is a bit crazy to fit the proportions of the original logo. It's not an unheard of size for cookies, though (it's about the size of the standard cookie you can buy at Disneyland). Also, the mug was originally going to be a glass of milk, which I changed to fit the colors of the logo (dark moon and light spot). What specifically are you referring to with "the color coordination of the logo"? The cookie is 10 degrees off from the flatware so as to not seem to be part of the plate itself, and the coffee is about as close as I could get while still maintaining recognizability. Are you talking about the doily? -------------------------------------------------- From: "steve donovan" Sent: Sunday, October 11, 2009 A7:03 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Lua Recipes Site? > On Sun, Oct 11, 2009 at 3:59 PM, Stuart P. Bentley > wrote: >> It's supposed to be a cookie... > > OK, but it _is_ a humongous cookie, considering the size of the coffie > cup. > > It's rather cool, the colour coordination with the logo needs a little > tweak? > From lua-bounces@bazar2.conectiva.com.br Mon Oct 12 21:46:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9D0ksIB015566; Mon, 12 Oct 2009 21:46:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB0E41A678; Mon, 12 Oct 2009 22:45:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C5571929A for ; Mon, 12 Oct 2009 22:45:38 -0200 (BRST) Received: by bwz22 with SMTP id 22so8083732bwz.5 for ; Mon, 12 Oct 2009 17:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=OCousyXvdVr73XsGtLqxQG4kAdqBZFGem+MEgHik8Tw=; b=hymjl3KfqPhX1yDXZFht44j9MXswQDVkgCQ0onDNXET02aSfxKb/IPQTpwnGJfOLmL OoRlPn5eRiMBcLnvinEjeYRPXmhkAmWRJf54uJ3EiJxPoBipMsrGFZ2s8JqH3vZrt7rE BOwfVc1fwzJlDT59q9WK/XMS2hr2xSkvfrqUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bDEJe2gnUAyJ1rpS5Ibg9pu3wWxTGnwuqWscvQ8ce2vFqQzlTileWCMec1X6is03LR KXm1S5GZjvfUvR+IdjwuiWrSo8KjqdpOhZB1DnlAtr0r+LdLL5iF8bNVXWbGLIxX+NFv osbmInOPYJFLC9k80WFTpGrY1Wufio3y/C7tA= MIME-Version: 1.0 Received: by 10.239.145.8 with SMTP id q8mr447175hba.122.1255394778404; Mon, 12 Oct 2009 17:46:18 -0700 (PDT) In-Reply-To: <92ab989c0910120912v353d47dfm3b9335d3957bbff5@mail.gmail.com> References: <92ab989c0910120912v353d47dfm3b9335d3957bbff5@mail.gmail.com> Date: Mon, 12 Oct 2009 17:46:18 -0700 Message-ID: Subject: Re: LuaForge CVS is back From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9D0ksIB015566 André Should any projects on LuaForge updated after Sept 9th, resubmit their files? Or resubmit any files they don't see that were recently added? Andrew On Mon, Oct 12, 2009 at 9:12 AM, Andre Carregal wrote: > After another sprint Alessandro got the developer access to CVS fully > back up, please help us test if everything is OK with it. > > As some have already manifested, if you are using CVS on LuaForge this > would be a good time to start planning your migration strategy. While > we will keep supporting CVS for at least two months, our plan is to > stop using it as soon as possible. > > André > From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 03:24:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9D6Ollw008181; Tue, 13 Oct 2009 03:24:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D8C0A18507; Tue, 13 Oct 2009 04:23:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEFD6184EF for ; Tue, 13 Oct 2009 04:23:30 -0200 (BRST) Received: by fxm12 with SMTP id 12so3323600fxm.5 for ; Mon, 12 Oct 2009 23:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=J+xf16F6FyNbEzGtfsmDh9n7Oqf/1So9nCiurFVkrZo=; b=DkDlv1BgCY7alusAWpX+sjMZ9Q6GlbfbTJskL4W1ulalSh0zK8i2m21eWss/oLd09p qoHZAJWAFWB+VWziM79HleQBksPs2lpXPJ41FPbu/Zep00fypNCaLnwBGsR+rP9zLxnx VjvHzS7RgpuFMfFH4X324VdkuEE1OQYpkYez8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xz6wXAFezmblAFFO4lxcFN41eCIdQ3az41Gq9OiC79PUhS8D/J01GZiJTMeYUvZitO LF7nqdKh4xrEmLNtEqJ2ImN9cqTS5ZMRa1t1b/Blokm0HxfFnHRize9GoLeAJArB4L1Q 8XV0PNfYZmkyFRkqcGPZFQuWX5ppbUDQ/1uRU= MIME-Version: 1.0 Received: by 10.239.182.208 with SMTP id r16mr502285hbg.203.1255415051814; Mon, 12 Oct 2009 23:24:11 -0700 (PDT) In-Reply-To: References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <560972290909200809l3fdf1d50i7d8ab3b7c7d694e@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> <8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> <560972290910110703y66e40566m2df9def3f425e57d@mail.gmail.com> Date: Tue, 13 Oct 2009 08:24:11 +0200 Message-ID: <560972290910122324r157f1cc7n67678763fd82b762@mail.gmail.com> Subject: Re: Lua Recipes Site? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 13, 2009 at 1:56 AM, Stuart P. Bentley wrote: > Are you talking about the doily? The doily is fine, maybe my feeling is that the cookie should be more blue. Yes, I know, blueberry cookies are not traditional. steve d. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 05:31:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9D8VOKf019411; Tue, 13 Oct 2009 05:31:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7550E1A6B6; Tue, 13 Oct 2009 06:30:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f222.google.com (mail-bw0-f222.google.com [209.85.218.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6FA21A693 for ; Tue, 13 Oct 2009 06:30:05 -0200 (BRST) Received: by bwz22 with SMTP id 22so8249928bwz.5 for ; Tue, 13 Oct 2009 01:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=bRV5Rwro6K2NAmTm5t72oUbW8vT35egZnhnXRpw26t0=; b=f2R12kdbaXkh+JjuQ6vTYeZAGMtCsr1xRk7lNCmHEAQJtqcPiI2n9wJ6x93RJF92f7 N2QtEo6CNYc8iAB+OtVRLZD6lQ3nYLEjAp3MGPfXkPotZTveSUIwGpgSDUfmwFsPrpPX Chng20DwZ6GcHW2paDpwcnhvn4wvYSLQsV1T8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=dZRUdHw9IYHOq5GIqzEBwwIC5O6zZ4ueO7pHkj7BxZCw+BegaPfdYE4vwoZiF2EFeY RDhJxM0c8P//Ttb9MgDnQoehx42OlPPJ3glmSHh/GfF30tTwNigTV6r1noHAznswDKWF OEiZvhxO9oaOsOnTY/6Un3j22yX68lq2eQ98c= MIME-Version: 1.0 Received: by 10.223.58.208 with SMTP id i16mr1894508fah.22.1255422647340; Tue, 13 Oct 2009 01:30:47 -0700 (PDT) In-Reply-To: <560972290910122324r157f1cc7n67678763fd82b762@mail.gmail.com> References: <560972290909190325n6b53ebc2kb4b328661f102080@mail.gmail.com> <457EACFD31AF4A25BF7C2BCC23CB248F@Stucomet> <560972290910100127n7e257e0fof0bd4569f6c40fd5@mail.gmail.com> <1D99EA267DC948B189409523B6540D1C@Stucomet> <5D02E5E848434879B251D2DD8EFB3F3B@Stucomet> <8A0FFBE7F5FC40A7B64B2C63798494EA@Stucomet> <560972290910110703y66e40566m2df9def3f425e57d@mail.gmail.com> <560972290910122324r157f1cc7n67678763fd82b762@mail.gmail.com> From: Jim Whitehead II Date: Tue, 13 Oct 2009 09:30:27 +0100 Message-ID: <5fe281d40910130130h1f4fd6e1lbd9511fd314adef4@mail.gmail.com> Subject: Re: Lua Recipes Site? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9D8VOKf019411 On Tue, Oct 13, 2009 at 7:24 AM, steve donovan wrote: > On Tue, Oct 13, 2009 at 1:56 AM, Stuart P. Bentley > wrote: >> Are you talking about the doily? > > The doily is fine, maybe my feeling is that the cookie should be more > blue. Yes, I know, blueberry cookies are not  traditional. Since you guys are both on the other mailing list, can we please move discussion there? Thanks! - Jim From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 10:07:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DD7sw6022251; Tue, 13 Oct 2009 10:07:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAFBC1A6CE; Tue, 13 Oct 2009 11:06:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C09FC188DB for ; Tue, 13 Oct 2009 11:06:23 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so666687qwb.11 for ; Tue, 13 Oct 2009 06:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=LFspgn8vRURQtzN0GWd1wQAilSA6m1lO2RlkrjSbjaM=; b=XFE6oRB2E3r4sxwcui9rU7z3OpDCCsiC71gonldJJDmYPsQzli1iif6Mkwwqr2XxUb ee3OPoIfsi9sta/YFVwsJWxOo3Yay89Nt7JrxXJique24ewXSNblGiwTyq9QEUJqESGu 1AjQ+1EvOO596fqhQzml2wG29M5Vlgl2NQ258= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KyItzSGaMinEYcLsKuBfxuOiLZsFEQ3iC0xc+wQgQOOrvZ6JQm4q84E6himwkcHpkX 5IAL9024vcSzNv4hzuFLSzFDIsRDdrEOPu8XNDe3kqHWYn5FilbzFR8I/7DLvWK0rsiF CnvVl5Ixd6uU2EmNlisT4foaMnNfDco3SnniI= MIME-Version: 1.0 Received: by 10.224.70.133 with SMTP id d5mr5820656qaj.211.1255439225394; Tue, 13 Oct 2009 06:07:05 -0700 (PDT) Date: Tue, 13 Oct 2009 15:07:05 +0200 Message-ID: Subject: A simple SOAP client From: Thijs Koerselman To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00c09f86da1a11194d0475d0b934 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f86da1a11194d0475d0b934 Content-Type: text/plain; charset=ISO-8859-1 Hi, I would like to write a simple SOAP client in Lua. I am using luarocks and installed the Kepler project additionally. I found luasoap, but my problem is that it relies on Expat, yet isn't available for luarocks. Apparently it was developed as part of the Kepler project, but I haven't found anything about SOAP in the Kepler documentation. Luasoap is also quite old (2004) so I wonder if it is recommended. If I'm going with luasoap, is there a way to add it to the luarocks repository, so that it will automatically find luaexpat there too? Thijs --00c09f86da1a11194d0475d0b934 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I would like to write a simple SOAP client in Lua. I= am using luarocks and installed the Kepler project additionally. I found l= uasoap, but my problem is that it relies on Expat, yet isn't available = for luarocks. Apparently it was developed as part of the Kepler project, bu= t I haven't found anything about SOAP in the Kepler documentation.

Luasoap is also quite old (2004) so I wonder if it is r= ecommended.

If I'm going with luasoap, is ther= e a way to add it to the luarocks repository, so that it will automatically= find luaexpat there too?

Thijs
--00c09f86da1a11194d0475d0b934-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:09:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DF9NOA019508; Tue, 13 Oct 2009 12:09:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BF1D1A6A4; Tue, 13 Oct 2009 13:08:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCC771A668 for ; Tue, 13 Oct 2009 13:07:59 -0200 (BRST) Received: by qyk34 with SMTP id 34so8214389qyk.14 for ; Tue, 13 Oct 2009 08:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tn+pj3gLpp9eRPDfQbD71OG/p+wbpGq6dR04oPuzbL0=; b=l+CwClrz01/mhFAL0bksKGzvHDnqvwSffbnMgw51vtTWJQygoB481b107Yl3qE/bc0 GgNIo5W59i9ZD7jz2gxgZ4dGxIEiAf3KbUnYdu5ZhqfEzmMmDM2hnoNQiVm/YVJV7+CA uFdMCr3wzYY8PVz1ausEGwyilDHBef4OvYC3Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RbTlLsISanTgOCyOiQK/eDRbItlQRR/0vxYP9iFhbc2aIzFzp5maZHVPXAOvNIbH5I EqrnP0gq46yoDeWLOs/MTAvId3fOzhJ7DxFduCNuZNerybIsFgaxQxMY+l1EQHTl9CsE qeoSDhRLrhQoGFeaKXZBupgwM6WDNy6qcVdIY= MIME-Version: 1.0 Received: by 10.224.41.134 with SMTP id o6mr5959491qae.152.1255446522531; Tue, 13 Oct 2009 08:08:42 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Oct 2009 19:08:42 +0400 Message-ID: Subject: Fwd: LFS build fails on Ubuntu 9.04 amd64 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DF9NOA019508 Sorry, Luarocks list on Luaforge seems to be down, so I'm posting it here. Alexander. ---------- Forwarded message ---------- From: Alexander Gladysh Date: Tue, Oct 13, 2009 at 19:06 Subject: LFS build fails on Ubuntu 9.04 amd64 To: LuaRocks developers list Hi, list! I can't install luafilesystem rock on my 64-bit Ubuntu Server 9.04 box (luarocks 1.0.1-1 from the standard apt package). Here is the output: $ sudo luarocks install luafilesystem Installing http://luarocks.luaforge.net/rocks/luafilesystem-1.4.2-1.src.rock... Archive:  /tmp/luarocks-rock-luafilesystem-1.4.2-1-6606/luafilesystem-1.4.2-1.src.rock  inflating: luafilesystem-1.4.2-1.rockspec  extracting: luafilesystem-1.4.2.tar.gz gcc -O2 -I/usr/include/lua5.1/ -c src/lfs.c -o src/lfs.o gcc -shared -o lfs.so src/lfs.o /usr/bin/ld: src/lfs.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC src/lfs.o: could not read symbols: Bad value collect2: ld returned 1 exit status cp: cannot stat `lfs.so': No such file or directory Error: Build error: Build error Any clues? Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:14:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFEOuE020899; Tue, 13 Oct 2009 12:14:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2775D1A6E7; Tue, 13 Oct 2009 13:13:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F390F1A668 for ; Tue, 13 Oct 2009 13:13:13 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1Mxj4J-0001Kq-WB for ; Tue, 13 Oct 2009 16:13:44 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1Mxj4V-00014N-Rj for lua@bazar2.conectiva.com.br; Tue, 13 Oct 2009 16:13:55 +0100 Date: Tue, 13 Oct 2009 16:13:55 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: LFS build fails on Ubuntu 9.04 amd64 Message-ID: <20091013161355.77d7a00c@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 13 Oct 2009 19:08:42 +0400 Alexander Gladysh wrote: > Sorry, Luarocks list on Luaforge seems to be down, so I'm posting it > here. > > Any clues? Looks like the flags that the rock passes to the compiler are wrong, and make x86-centric assumptions. Unfortunately, this kind of error is common in rocks, which makes them break in just the way you describe on AMD64 and on other architectures, like ARM. Best you can do is report a bug to the rock's maintainer, and perhaps alter it in the meantime yourself to add the flag the linker suggests to the compiler command line options. B. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:17:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFHgON021803; Tue, 13 Oct 2009 12:17:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 310E81A6F5; Tue, 13 Oct 2009 13:16:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38DFE1A668 for ; Tue, 13 Oct 2009 13:16:26 -0200 (BRST) Received: by qyk34 with SMTP id 34so8223603qyk.14 for ; Tue, 13 Oct 2009 08:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=/kI6cW4zgHQZwda6llIIz6eDhUQSJeS1I+qmBEYplEs=; b=A5SDS1uWkCrn+bLxycAmwpnXRiYXa3t0YBa8bMy0f96EVUeN6M1pZUUB7o12cAWXWV Od8Mb0I+ZYrNs6w+8VF4IU02w4D++UAlSxs0N+wioDD9lslj3++8ezT61KIGrzB+3NwZ UYXqbbZ1I3F0L4xjuo+9O1zBd8D8FK5wZRfbs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=pPAdTnodZ+7EE0iAmSDcJA4T7/XyAKbaxLCbwhQAlc0VgTn7M9fOOt3Kx6MW5kUCQj F3X6aRD8kXdxYzFESbmbdB00OndFspL9xS6nZetf7DiY4JkepQxQ23svEmkseE0lbDPg kvWB0lCPbXFD7hdzM1tv4dXd+awxmS/BIjiRk= MIME-Version: 1.0 Received: by 10.224.22.132 with SMTP id n4mr5973441qab.176.1255447028370; Tue, 13 Oct 2009 08:17:08 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Oct 2009 12:17:08 -0300 X-Google-Sender-Auth: 641022dc71a071d8 Message-ID: <7913df4d0910130817k1a984682h9a8e7b5ca1b7e844@mail.gmail.com> Subject: Re: LFS build fails on Ubuntu 9.04 amd64 From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DFHgON021803 Hi, This problem has already showed up at the LuaRocks list, the apt package for LuaRocks is broken. Uninstall it and install LuaRocks from source, then reinstall luafilesystem and everything will work. The mantainer for the package has already been notified. -- Fabio Mascarenhas On Tue, Oct 13, 2009 at 12:08 PM, Alexander Gladysh wrote: > Sorry, Luarocks list on Luaforge seems to be down, so I'm posting it here. > > Alexander. > > > ---------- Forwarded message ---------- > From: Alexander Gladysh > Date: Tue, Oct 13, 2009 at 19:06 > Subject: LFS build fails on Ubuntu 9.04 amd64 > To: LuaRocks developers list > > > Hi, list! > > I can't install luafilesystem rock on my 64-bit Ubuntu Server 9.04 box > (luarocks 1.0.1-1 from the standard apt package). > > Here is the output: > > $ sudo luarocks install luafilesystem > Installing http://luarocks.luaforge.net/rocks/luafilesystem-1.4.2-1.src.rock... > Archive:  /tmp/luarocks-rock-luafilesystem-1.4.2-1-6606/luafilesystem-1.4.2-1.src.rock >  inflating: luafilesystem-1.4.2-1.rockspec >  extracting: luafilesystem-1.4.2.tar.gz > gcc -O2 -I/usr/include/lua5.1/ -c src/lfs.c -o src/lfs.o > gcc -shared -o lfs.so src/lfs.o > /usr/bin/ld: src/lfs.o: relocation R_X86_64_32 against > `.rodata.str1.1' can not be used when making a shared object; > recompile with -fPIC > src/lfs.o: could not read symbols: Bad value > collect2: ld returned 1 exit status > cp: cannot stat `lfs.so': No such file or directory > > Error: Build error: Build error > > Any clues? > > Alexander. > From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:28:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFSuZ4025037; Tue, 13 Oct 2009 12:28:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DD621A702; Tue, 13 Oct 2009 13:27:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43FF61A6F8 for ; Tue, 13 Oct 2009 13:27:45 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MxjIW-0008Si-DP for lua@bazar2.conectiva.com.br; Tue, 13 Oct 2009 16:28:24 +0100 Received: from [192.168.2.74] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id E4D4A71004 for ; Tue, 13 Oct 2009 16:28:19 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:14209 with envelope Message-ID: <4AD49C8C.6080504@cowlark.com> Date: Tue, 13 Oct 2009 16:28:12 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: IUP rock? Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DFSuZ4025037 Does anyone have a rock (or Debian package!) for IUP? I've been spoilt by so many years of configure scripts that I now cannot figure out how to install it. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "They laughed at Newton. They laughed at Einstein. Of course, they │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:31:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFVCeO025586; Tue, 13 Oct 2009 12:31:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 278D11A706; Tue, 13 Oct 2009 13:30:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C1051A700 for ; Tue, 13 Oct 2009 13:30:02 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so714275qwb.11 for ; Tue, 13 Oct 2009 08:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ACv6MRjZ3yv26gENOBXNrP8X0vgKthxVxUcO/PdEgAw=; b=oDY98NB7hXSJXBoFFRM6KOkoKbREEQFPHDOqypwPPbN1FBoV9cSLXEV37MaSMgtYeC V5dGBFiynwQNFInYQotw7JcAFPhzHeiHoB/bUttXbgBQ4ifiWCqZAIUbARpOtGVD8986 6Foc6keT4jsBSnmAZESc95ft47zeoCAw61djQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bGb9fIPIbRat8JZ1KaKi0Pkel+sAB3jtAUMe1ZgiMNDetbWVROiNohmFMmVL69CGKB PUwjTRVI9A1SXa1axyXPBf8qyA3lqP7CsNSphWAZLO9jws0r0bPtxwaQda8Ncda43VpU HZu3j4q2XDAlosJ6hIx1BQe3+zz11DEXFqT74= MIME-Version: 1.0 Received: by 10.224.78.22 with SMTP id i22mr5993312qak.280.1255447845593; Tue, 13 Oct 2009 08:30:45 -0700 (PDT) In-Reply-To: <7913df4d0910130817k1a984682h9a8e7b5ca1b7e844@mail.gmail.com> References: <7913df4d0910130817k1a984682h9a8e7b5ca1b7e844@mail.gmail.com> Date: Tue, 13 Oct 2009 19:30:45 +0400 Message-ID: Subject: Re: LFS build fails on Ubuntu 9.04 amd64 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > This problem has already showed up at the LuaRocks list, the apt > package for LuaRocks is broken. Uninstall it and install LuaRocks from > source, then reinstall luafilesystem and everything will work. The > mantainer for the package has already been notified. Thanks. That helped. That is sad that the system package is broken. Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:41:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFfbr8027950; Tue, 13 Oct 2009 12:41:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EE6718583; Tue, 13 Oct 2009 13:40:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7717918559 for ; Tue, 13 Oct 2009 13:40:21 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1MxjUa-0006kw-2q for ; Tue, 13 Oct 2009 16:40:52 +0100 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1MxjUl-0002MP-RD for lua@bazar2.conectiva.com.br; Tue, 13 Oct 2009 16:41:03 +0100 Date: Tue, 13 Oct 2009 16:41:03 +0100 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: IUP rock? Message-ID: <20091013164103.39c61f3d@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4AD49C8C.6080504@cowlark.com> References: <4AD49C8C.6080504@cowlark.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 13 Oct 2009 16:28:12 +0100 David Given wrote: > Does anyone have a rock (or Debian package!) for IUP? > > I've been spoilt by so many years of configure scripts that I now > cannot figure out how to install it. I spent a few days trying this too; please share any insights found! B. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 12:55:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DFtZfe031500; Tue, 13 Oct 2009 12:55:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BE6D18C94; Tue, 13 Oct 2009 13:54:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from aa013msr.fastwebnet.it (aa013msr.fastwebnet.it [85.18.95.73]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3009E18C43 for ; Tue, 13 Oct 2009 13:54:26 -0200 (BRST) Received: from [192.168.0.16] (39.254.73.45) by aa013msr.fastwebnet.it (8.5.016.6) id 4A9CF8A8055E48DB for lua@bazar2.conectiva.com.br; Tue, 13 Oct 2009 17:55:05 +0200 Message-Id: <8B1CBE67-D19C-43D9-99A1-EB5D1D6A71EB@gmail.com> From: "Andrea D'Amore" To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Kepler graph Date: Tue, 13 Oct 2009 17:55:04 +0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 09/ott/09, at 07:10, Yuri Takhteyev wrote: > Something like this perhaps: > http://spu.tnik.org/en/Kepler_Diagram.png Enlightening. -- A. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 13:05:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DG56s0001634; Tue, 13 Oct 2009 13:05:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BB4B1A6AC; Tue, 13 Oct 2009 14:04:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E69F18C1B for ; Tue, 13 Oct 2009 14:03:56 -0200 (BRST) Received: by gxk4 with SMTP id 4so11029835gxk.8 for ; Tue, 13 Oct 2009 09:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gzERHb0y4HGolHTwfP3dGlGz4WLQF8oR1oIQyKaw/Dg=; b=tlGypNCVyYwCJ5OArNT8ihSYjmIthIIcxgSSd9cf7kIMYCyZcoDfqHr/q9bvdRoVVa 49dSK2oOxzyiFOgV0UUXt2SgHT5j/cMuMS1GH8m8lDPO0EsyXMJRowm7U+HwsZ5qo8kP 9dS9VJ+QkF8qcbPFsK3WxX38VSZXvL7yTcuE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=g8LsckfufVkVv2udMzrwVN9xCUPHwWIgXXmwkdeisrBFsKIUOvP5E8G45nroO5ofde hcC0vVDuH34tAgxuPVZZKQyjtGZYlOBxIaiI1/9U+arENLXrXhcR5Wcoo5Bou6Ga8XT7 ARc5o6HqzNixeRkT9q3tndUwKinP7z22SnEmM= MIME-Version: 1.0 Received: by 10.103.81.20 with SMTP id i20mr3041773mul.127.1255449878510; Tue, 13 Oct 2009 09:04:38 -0700 (PDT) In-Reply-To: <8B1CBE67-D19C-43D9-99A1-EB5D1D6A71EB@gmail.com> References: <8B1CBE67-D19C-43D9-99A1-EB5D1D6A71EB@gmail.com> Date: Tue, 13 Oct 2009 12:04:38 -0400 X-Google-Sender-Auth: 2df83a889eca2812 Message-ID: Subject: Re: Kepler graph From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DG56s0001634 >>  http://spu.tnik.org/en/Kepler_Diagram.png > > Enlightening. With all the extra boxes that got added to it, the diagram got a little messy. However, being a wiki means not only letting people edit things, but also keeping history... So, the original diagram is still available: http://spu.tnik.org/en/Kepler_Diagram.png&version=000003 (This is what I sent to the list originally with a spelling correction someone made.) - yuri From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 14:07:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DH7hli014998; Tue, 13 Oct 2009 14:07:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F4161A5ED; Tue, 13 Oct 2009 15:06:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8618818F13 for ; Tue, 13 Oct 2009 15:06:23 -0200 (BRST) Received: from magritte (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DH72Gi014900 for ; Tue, 13 Oct 2009 14:07:03 -0300 Date: Tue, 13 Oct 2009 14:07:02 -0300 (BRT) From: Tomas Guisasola Gorham To: Lua list Subject: Re: A simple SOAP client In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="678920-140640322-1255453622=:19983" X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --678920-140640322-1255453622=:19983 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi Thijs > I would like to write a simple SOAP client in Lua. I am using luarocks and > installed the Kepler project additionally. I found luasoap, but my problem > is that it relies on Expat, yet isn't available for luarocks. Apparently it > was developed as part of the Kepler project, but I haven't found anything > about SOAP in the Kepler documentation. > > Luasoap is also quite old (2004) so I wonder if it is recommended. > > If I'm going with luasoap, is there a way to add it to the luarocks > repository, so that it will automatically find luaexpat there too? We are using LuaSOAP here at PUC and it is working quite well. Also, we are planning to release a new version quite soon (in fact, we are waiting LuaSec 0.4 which will come with https support). If cannot wait, I can send you the files (I think anonymous CVS on LuaForge won't work). Regards, Tomás --678920-140640322-1255453622=:19983-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 14:09:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DH9tgW015460; Tue, 13 Oct 2009 14:09:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68AB41A699; Tue, 13 Oct 2009 15:08:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BFA7185BD for ; Tue, 13 Oct 2009 15:08:46 -0200 (BRST) Received: from magritte (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DH9TUw015371 for ; Tue, 13 Oct 2009 14:09:29 -0300 Date: Tue, 13 Oct 2009 14:09:29 -0300 (BRT) From: Tomas Guisasola Gorham To: Lua list Subject: Re: A simple SOAP client In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="678920-267399238-1255453769=:19983" X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --678920-267399238-1255453769=:19983 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi Thijs > I found luasoap, but my problem > is that it relies on Expat, yet isn't available for luarocks. I forgot to mention that LuaExpat is available: [tomas@vivaldi:] luarocks search expat Search results: =============== Rockspecs and source rocks: --------------------------- luaexpat 1.1.0-3 (src) - http://luarocks.luaforge.net/rocks 1.1.0-3 (rockspec) - http://luarocks.luaforge.net/rocks Regards, Tomás --678920-267399238-1255453769=:19983-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 16:37:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DJbOC9022731; Tue, 13 Oct 2009 16:37:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61E5818CA1; Tue, 13 Oct 2009 17:36:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E72718BFD for ; Tue, 13 Oct 2009 17:36:01 -0200 (BRST) Received: by vws9 with SMTP id 9so6056549vws.11 for ; Tue, 13 Oct 2009 12:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=AZ+Kuc+SvMm7QDhrvngoq6qEUxBorUnIRuCksbbAyvo=; b=oHLMNuNTDbytEKd78hfdYRDMb9ItFxLhRj+zjBc83B0qxHy86CfUABcZzxFIXIfkvD jIcYnq4JcFtdZgIVbtcDmjRvmnckQg/3KyBdYFpuoujdhXaFuK1o+J+ZhwesrnInTJAB gytTdFwnZaQs7nDyVPbBrgHaKdmBUvip0uWeA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=N/NV5ITZha86aNWJNZaa8NQfA3Qxiy6fsbHd9l+XpZlyCr/8p/88N1j25d7tED/ZJ7 EE2TUrEoSIjj0MDHN5cHSzIs4kzKhYZc92kyXV1gdJhtn7DFMuNjZpHnhNv3g387szbB ou23Pa/T/ZZeGR8qSWQ9vzgSZ2DA/webXwiNc= MIME-Version: 1.0 Received: by 10.220.114.142 with SMTP id e14mr11035017vcq.83.1255462604267; Tue, 13 Oct 2009 12:36:44 -0700 (PDT) In-Reply-To: References: <92ab989c0910120912v353d47dfm3b9335d3957bbff5@mail.gmail.com> Date: Tue, 13 Oct 2009 16:36:44 -0300 X-Google-Sender-Auth: 00f1fa8797d46dba Message-ID: <92ab989c0910131236v8fc6bc0h325a6c41c3e186e4@mail.gmail.com> Subject: Re: LuaForge CVS is back From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DJbOC9022731 On Mon, Oct 12, 2009 at 9:46 PM, Andrew Wilson wrote: > Should any projects on LuaForge updated after Sept 9th, resubmit their > files? Or resubmit any files they don't see that were recently added? Unfortunately yes. We have backups of the files themselves, but the metadata (release name, date, stats) from 13/sep to 5/out was lost. In the end we lost 5 project registrations, 25 user registrations and any file releases, issues and forum messages entered online during that period. André From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 16:48:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DJmCLL025537; Tue, 13 Oct 2009 16:48:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1042B18EA0; Tue, 13 Oct 2009 17:47:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3947D18D64 for ; Tue, 13 Oct 2009 17:47:04 -0200 (BRST) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DJlkG1025476 for ; Tue, 13 Oct 2009 16:47:46 -0300 From: "Antonio Scuri" To: "'Lua list'" References: <4AD49C8C.6080504@cowlark.com> In-Reply-To: <4AD49C8C.6080504@cowlark.com> Subject: RE: IUP rock? Date: Tue, 13 Oct 2009 16:47:40 -0300 Message-ID: <009501ca4c3e$06256dc0$12704940$@puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpMGeCgQwbEjpuQQ9iVehyYhrANhAAIscUA Content-Language: pt-br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DJmCLL025537 Hi, Sorry I still did not have time to build a rock for IUP, CD and IM. But I can help you and anyone interested in installing IUP, CD or IM. The first thing to do is to try the pre-compiled binaries. Download the pack for your system, unpack it on the folder you like, set LD_LIBRARY_PATH if you do not install it on the system folder, and change LUA_CPATH to contain "./lib?51.so;" (if you are not using LuaBinaries), so require"iuplua" will work. Of course something can go wrong on the way. Then simply contact us directly so we can work together on any issues. Thanks, scuri > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of David Given > Sent: terça-feira, 13 de outubro de 2009 12:28 > To: Lua list > Subject: IUP rock? > > Does anyone have a rock (or Debian package!) for IUP? > > I've been spoilt by so many years of configure scripts that I now > cannot > figure out how to install it. > > -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "They laughed at Newton. They laughed at Einstein. Of course, they > │ also laughed at Bozo the Clown." --- Carl Sagan From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 16:49:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DJmvph025714; Tue, 13 Oct 2009 16:48:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D84218FF0; Tue, 13 Oct 2009 17:47:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f179.google.com (mail-vw0-f179.google.com [209.85.212.179]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B15B718D64 for ; Tue, 13 Oct 2009 17:47:49 -0200 (BRST) Received: by vws9 with SMTP id 9so6062334vws.11 for ; Tue, 13 Oct 2009 12:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=VbVTZJ/EsgSayvWPF0NUNeqD/vPMpN5Zhpm0UjkATi8=; b=tdi8Kfd24w5eAvcXGDXoafGAMHxArjP1kN4TNkuNmhuVJN/gwPKR08yl+iOcqwxsxC Gy6Aphlxst0ijNWwRUbVmkxVSIP7b7+3XCda36nokcV9alTf75JCvYZYddBBlwtHn/h8 8xkq6OX5WqMCIy3t7nlEzmGsufFeZJk1OUNwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=wHNB6boxJWzJ49TJv+PApQojUPZjqpbrlhC1KzwNRew0sCFY3ctvQ6IsavekUT5SSj S1dS3ACTKfEFEvG/m9oNYDwb5PRC3QpPuMN7SHAXuq1uULzfBD2uOJw9lfRUaZw6icP5 Bd5DUCSwLYmHKAQIm1l7py/UK3bEOlXBcbhOg= MIME-Version: 1.0 Received: by 10.220.109.41 with SMTP id h41mr11129480vcp.54.1255463310714; Tue, 13 Oct 2009 12:48:30 -0700 (PDT) Date: Tue, 13 Oct 2009 16:48:30 -0300 X-Google-Sender-Auth: f8c1dec99c259334 Message-ID: <92ab989c0910131248o1c80d135y2be4f72ad9c40984@mail.gmail.com> Subject: LuaForge Administration Status From: Andre Carregal To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DJmvph025714 While the LuaForge recovery is still going on, I'm going out on vacation for the next 30 days (the trip was already scheduled). During that time I'll probably be able to check mail, but I'm not sure how often. Alessandro Hecht and Jason Santos are assuming the administration of LuaForge during that time and can be contacted both on this list as off list. Parallel to this, the planning for the next version of LuaForge (or whatever it ends being called) is going in a separate list under the supervision of both me and Jim Whitehead II and can be followed here: http://groups.google.com/group/luaforge-development Thanks for everyone involved in this transition. André From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 16:59:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DJxUZG030550; Tue, 13 Oct 2009 16:59:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE18F1A671; Tue, 13 Oct 2009 17:58:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C64A31A5A0 for ; Tue, 13 Oct 2009 17:58:19 -0200 (BRST) Received: by pxi2 with SMTP id 2so474257pxi.11 for ; Tue, 13 Oct 2009 12:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=c6FgCAOCfDbBG+IjkUJI917yDEGfawvGYbcS8j3kV7s=; b=qSKAYBe567TyiTd5jqcc12W8rCr5jfzG7f2vIAI6vEKAfV9uT0HStkaGQlYdJGluoo 79DzU1Cl7WmWA0LmQpponJlHk6QzLSXMXT1uvHx56ZGXxI5i/UFbtFH51BxBWsSvgu6X vEFvVFVB5tFijLA8QMyz8Qqay5U2jCvzbK490= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=v4yMX6Uw8aOvbl01hw3e1jE7Exa+2R/jAVXWvvdcCvzdzguYocpgtgpMkBfz5Qa4Ox T9llHDIUu/FMy8HmtNcvnrE0/mtY4sfHkKBtwCAxwYkbcMNp6GhaTGhWYGr/4urYnVif tojOvfXUcq142SVLjRu4W2qwoQL2VHGNZ7J8w= MIME-Version: 1.0 Received: by 10.114.55.34 with SMTP id d34mr13120915waa.225.1255463941221; Tue, 13 Oct 2009 12:59:01 -0700 (PDT) In-Reply-To: <92ab989c0910131248o1c80d135y2be4f72ad9c40984@mail.gmail.com> References: <92ab989c0910131248o1c80d135y2be4f72ad9c40984@mail.gmail.com> From: Marco Antonio Abreu Date: Tue, 13 Oct 2009 16:58:41 -0300 Message-ID: <31ca41400910131258s108219foab074b55f20d27fd@mail.gmail.com> Subject: Re: LuaForge Administration Status To: Lua list Content-Type: multipart/alternative; boundary=0016369204c73eb6ed0475d67ab5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016369204c73eb6ed0475d67ab5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you Andr=E9 for your effort and initiative. Have a nice vacation and good photos. []'s, Marco 2009/10/13 Andre Carregal > While the LuaForge recovery is still going on, I'm going out on > vacation for the next 30 days (the trip was already scheduled). During > that time I'll probably be able to check mail, but I'm not sure how > often. > > Alessandro Hecht and Jason Santos are assuming the administration of > LuaForge during that time and can be contacted both on this list as > off list. > > Parallel to this, the planning for the next version of LuaForge (or > whatever it ends being called) is going in a separate list under the > supervision of both me and Jim Whitehead II and can be followed here: > http://groups.google.com/group/luaforge-development > > Thanks for everyone involved in this transition. > > Andr=E9 > --=20 Marco Antonio Abreu mabreu.ti@gmail.com System Analist/Developer --0016369204c73eb6ed0475d67ab5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you Andr=E9 for your effort and initiative. Have a nice vacation and = good photos.

[]'s,
Marco

2= 009/10/13 Andre Carregal <carregal@fabricadigital.com.br>
While the LuaForg= e recovery is still going on, I'm going out on
vacation for the next 30 days (the trip was already scheduled). During
that time I'll probably be able to check mail, but I'm not sure how=
often.

Alessandro Hecht and Jason Santos are assuming the administration of
LuaForge during that time and can be contacted both on this list as
off list.

Parallel to this, the planning for the next version of LuaForge (or
whatever it ends being called) is going in a separate list under the
supervision of both me and Jim Whitehead II and can be followed here:
http://groups.google.com/group/luaforge-development

Thanks for everyone involved in this transition.

Andr=E9



--
Marco Antonio Abreu
= mabreu.ti@gmail.com
System An= alist/Developer
--0016369204c73eb6ed0475d67ab5-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 17:22:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DKMUto003070; Tue, 13 Oct 2009 17:22:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23F1F1A695; Tue, 13 Oct 2009 18:21:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9F731A65B for ; Tue, 13 Oct 2009 18:21:15 -0200 (BRST) Received: by fxm12 with SMTP id 12so4247105fxm.5 for ; Tue, 13 Oct 2009 13:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=t+gjTQJy0hI7WnBhPosJEubbGl7yi7JOg020vLuWB60=; b=YZeNMuXrCFTfhi9GUZ2XK5EHUV2KmkQUvKdWbvKf2ODvbyjFGYfLC6O0XysBgcsEua FqRBOp7mFOcP8VTEYDjuOlGIVsqH15aIKFM4OIUI8/gTZ7qiAkZIUazXhtd+tNRS0Ozi vXlshgLdBhzfToliR4vmHRgHEXsjbdCYBpbEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=WIK1JjDf/RbfZUtmqYCi+9OdMSoiEGOrRSiKNpdH+z1a/5tQQqw5i+wO6ohu95ZD0L 8EDKI/giRvfwTkrVm5g8CMkedEP6XEwM/f9syP0RU2Bxj2PrlDWFZvwGxj+qo6mkhtPx YiY6a9MTAX0XCkAxkCdq/zt7sQgtRJMIJPLPg= MIME-Version: 1.0 Received: by 10.204.160.90 with SMTP id m26mr6458934bkx.63.1255465317321; Tue, 13 Oct 2009 13:21:57 -0700 (PDT) Date: Tue, 13 Oct 2009 16:21:57 -0400 X-Google-Sender-Auth: 22fae41402dfb6e4 Message-ID: Subject: a LuaForge mirror From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The recent LuaForge outage has made it obvious that there is a need for a mirror, ideally totally separated from the main LF machine. Here is what we've go so far: http://lfmirror.dreamhosters.com/ (Note that the domain name is temporary.) This mirror should have: 1. Basic public metadata for all projects 2. All public releases as of 2009/10/10 (under /files/) 3. Archives of all public mailing lists (under /lists/) The metadata is presented as just an HTML file for now, though that file should be easy to parse. It lists first the projects that actually have some archived content, then all remaining registered projects. The HTML file links to the locations of each projects mailing list and file archives. Owners of projects whose releases were lost with the crash can get their files from this mirror and resubmit them. We do not yet know how often the mirror will be updated. We'll try to keep it reasonably up to date, but it's a messy process. If someone wants to replicate the full content of the mirror, please get in touch with me before spidering the 3GB of data. We can discuss the best way to get you the data. Comments and suggestions are welcome. Please keep it civil, though... - yuri From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 18:11:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DLB0BS013045; Tue, 13 Oct 2009 18:11:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 496FD1A600; Tue, 13 Oct 2009 19:09:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87F24186A5 for ; Tue, 13 Oct 2009 19:09:34 -0200 (BRST) Received: by yxe36 with SMTP id 36so11533254yxe.11 for ; Tue, 13 Oct 2009 14:10:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.161.28 with SMTP id n28mr4687251ago.36.1255468214844; Tue, 13 Oct 2009 14:10:14 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Oct 2009 00:10:14 +0300 X-Google-Sender-Auth: 5d39e124bf3a39c9 Message-ID: Subject: Re: a LuaForge mirror From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e640d408f8fde30475d778ff X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e640d408f8fde30475d778ff Content-Type: text/plain; charset=UTF-8 > > Comments and suggestions are welcome. Please keep it civil, though... > With this in sight, are authors still encouraged to move their projects away from luaforge following the Kepler example? Is there a general attitude towards this? --0016e640d408f8fde30475d778ff Content-Type: text/html; charset=UTF-8
Comments and suggestions are welcome. Please keep it civil, though...

With this in sight, are authors still encouraged to move their projects away from luaforge following the Kepler example? Is there a general attitude towards this?

--0016e640d408f8fde30475d778ff-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 18:20:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DLKIxP014409; Tue, 13 Oct 2009 18:20:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B45B51A685; Tue, 13 Oct 2009 19:19:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2CA71A5DE for ; Tue, 13 Oct 2009 19:19:03 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so815733qwb.11 for ; Tue, 13 Oct 2009 14:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=2D2Qv0A0lBPCjgBRSJilUrlLS8VuwIozP+xvKXFcKL4=; b=Wdy+DZRR70le7swrxE+NWtuXf0ynjw0fcAhFy5RpFa/ph4hnRp3DyTzUayRpDatoLY N19FIGwXwQySYalm5V74pfrPD5j8nVtONQ7VohEWDBUUkV86IucoJVRPkh8zrQcDbiAH 0YVCr30jZcYc/GZO5FhDDqB4K0FxcMYFGhybA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=jS3m1A/skCo3briaWUEI9Yj6ounFXCkYQhbIt+WApcGMACLxl99VvFB1fJBGPiVv3m Qtwr6GYYgrdlYyAtBin/7gk2aMT9nvfoZs1fePvCX2Ms7yZNyIlh0L5Kp9IGH9EKzh3f dDdNfcgl7cnfAi0TnvmEY6kitZBP64RXXeHqQ= MIME-Version: 1.0 Received: by 10.224.86.227 with SMTP id t35mr6463667qal.121.1255468784873; Tue, 13 Oct 2009 14:19:44 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Oct 2009 18:19:44 -0300 X-Google-Sender-Auth: 5622ed35a7cdc6b7 Message-ID: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> Subject: Re: a LuaForge mirror From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9DLKIxP014409 >From André's message about the resumption of CVS access (not yet in the archives, sorry): "As some have already manifested, if you are using CVS on LuaForge this would be a good time to start planning your migration strategy. While we will keep supporting CVS for at least two months, our plan is to stop using it as soon as possible." -- Fabio Mascarenhas On Tue, Oct 13, 2009 at 6:10 PM, Cosmin Apreutesei wrote: >> Comments and suggestions are welcome. Please keep it civil, though... > > With this in sight, are authors still encouraged to move their projects away > from luaforge following the Kepler example? Is there a general attitude > towards this? > From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 19:06:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DM6erX021249; Tue, 13 Oct 2009 19:06:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 542CC1A662; Tue, 13 Oct 2009 20:05:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FE60188E9 for ; Tue, 13 Oct 2009 20:05:25 -0200 (BRST) Received: by fxm12 with SMTP id 12so4371185fxm.5 for ; Tue, 13 Oct 2009 15:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=5g9FdmJyT5rLs3oF3mGlbwWG36+JYwA4ERl84rugoN4=; b=HzmU0Nb+1Jkwu0RirhPSygT4CXAh2OMzLW7vRy5O8RqntLENsQKikEuivZMvREA1LU Bcw//cPq+nBYjiSvPWFCFvF9zcUQwcfPy9oWQSVT6LYLwNnA0CLzTXwX3vMdKismfi2C AI0wi9c2DZ3Sw3OzE9xtNz31SzoQvqE4ecRZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=X8OBrFKGXQObbpM7NNxG/hiLBQMLeIK6jMYRtopn/Rz3c7OYRfJsVvGI+By4gLUdns 5Xs6S2dbnkodj8t7+dBnRy/jB4qsk+24UKnKxNc1EtYPFMAI2vsLPdGHzzJlH1pQamrs yNXCHtRBEUu0en5eYxzG42ezx0gf+3fKFvueM= MIME-Version: 1.0 Received: by 10.204.34.5 with SMTP id j5mr6567489bkd.5.1255471566839; Tue, 13 Oct 2009 15:06:06 -0700 (PDT) In-Reply-To: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> References: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> Date: Tue, 13 Oct 2009 18:06:06 -0400 X-Google-Sender-Auth: 9e9503bffb3ef139 Message-ID: Subject: Re: a LuaForge mirror From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > "As some have already manifested, if you are using CVS on LuaForge this > would be a good time to start planning your migration strategy. While > we will keep supporting CVS for at least two months, our plan is to > stop using it as soon as possible." Note that this specifically concerns the use of LuaForge's CVS. There are definitely plans to keep LF as a catalog of Lua projects. It may also continue providing the mailing list service and a facility for uploading and downloading releases. (The future of LuaForge is are being discussed on the luaforge-development list.) - yuri From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 19:22:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DMMJbS023297; Tue, 13 Oct 2009 19:22:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C79041A6A3; Tue, 13 Oct 2009 20:21:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A5761A67D for ; Tue, 13 Oct 2009 20:21:02 -0200 (BRST) Received: by gxk4 with SMTP id 4so11381052gxk.8 for ; Tue, 13 Oct 2009 15:21:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.19.15 with SMTP id w15mr4676136agi.12.1255472505297; Tue, 13 Oct 2009 15:21:45 -0700 (PDT) In-Reply-To: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> References: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> Date: Wed, 14 Oct 2009 01:21:45 +0300 X-Google-Sender-Auth: 3d1764faa43e1616 Message-ID: Subject: Re: a LuaForge mirror From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001485f94df0b41cca0475d878aa X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f94df0b41cca0475d878aa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Have you considered spamming the authors about this? Maybe some of them are not subscribed to the mailing list. It would also provide some refreshing feedback about which projects are unmaintained/forgotten. They will probabl= y announce back the movings on this list. On Wed, Oct 14, 2009 at 00:19, Fabio Mascarenhas wrote= : > >From Andr=C3=A9's message about the resumption of CVS access (not yet in > the archives, sorry): > > "As some have already manifested, if you are using CVS on LuaForge this > would be a good time to start planning your migration strategy. While > we will keep supporting CVS for at least two months, our plan is to > stop using it as soon as possible." > > -- > Fabio Mascarenhas > > > On Tue, Oct 13, 2009 at 6:10 PM, Cosmin Apreutesei > wrote: > >> Comments and suggestions are welcome. Please keep it civil, though... > > > > With this in sight, are authors still encouraged to move their projects > away > > from luaforge following the Kepler example? Is there a general attitude > > towards this? > > > --001485f94df0b41cca0475d878aa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Have you considered spamming the authors about this? Maybe some of the= m are not subscribed to the mailing list. It would also provide some refres= hing feedback about which projects are unmaintained/forgotten. They will pr= obably announce back the movings on this list.

On Wed, Oct 14, 2009 at 00:19, Fa= bio Mascarenhas <mascarenhas@acm.org> wrote:
>From Andr=C3=A9's message about the resumption of CVS access (not y= et in
the archives, sorry):

"As some have already manifested, if you are using CVS on LuaForge thi= s
would be a good time to start planning your migration strategy. While
we will keep supporting CVS for at least two months, our plan is to
stop using it as soon as possible."

--
Fabio Mascarenhas


On Tue, Oct 13, 2009 at 6:10 PM, Cosmin Apreutesei
<cosmin.apreutesei@gmail.= com> wrote:
>> Comments and suggestions are welcome. Please keep it civil, though= ...
>
> With this in sight, are authors still encouraged to move their project= s away
> from luaforge following the Kepler example? Is there a general attitud= e
> towards this?
>

--001485f94df0b41cca0475d878aa-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 19:35:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DMZjhI024865; Tue, 13 Oct 2009 19:35:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76C591A688; Tue, 13 Oct 2009 20:34:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-320.bluehost.com (outbound-mail-320.bluehost.com [67.222.54.252]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7CA2E1A5ED for ; Tue, 13 Oct 2009 20:34:35 -0200 (BRST) Received: (qmail 29491 invoked by uid 0); 13 Oct 2009 22:35:16 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy6.bluehost.com with SMTP; 13 Oct 2009 22:35:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=4xzC7tEzR0asqiFBz7s9wetcgh13qNu47nSMFleQe+MAMocG+wtx5wm7J3Eh5j6whSr2uKv/PjcDXsyqFwnw8ITTrnBJc3Vdf1ttzLQWnNnc/mM1Zek3yEKauKHNGk3L; Received: from host-114-178.staunton.va.us ([64.4.114.178] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Mxpxc-00059c-16 for lua@bazar2.conectiva.com.br; Tue, 13 Oct 2009 16:35:16 -0600 Date: Tue, 13 Oct 2009 18:35:11 -0400 From: TNHarris To: Lua list Subject: Re: Addition of map() and filter(). Message-ID: <20091013183511.4a4dfced@egeria.whoopdedo.org> In-Reply-To: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.4.114.178 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 12 Oct 2009 23:16:12 +0200 André Ericsson wrote: > local LOCAL_ToStringAllTemp = {}; > function tostringall(...) > -- etc... That's rather ugly. I've learned that recursion isn't a dirty word in Lua, so it's not at all difficult to write a 'map' function function map(f,...) if select('#',...) == 0 then return end return f((...)),map(f,select(2,...)) end Which could be optimized to use local variables only. However, that does demonstrate one thing about Lua that I didn't expect. This... return something, F() ... isn't a tail-call. I thought it would be, but the comma operator is enough to prevent the optimization. I think it would be a worthwhile change to the VM to allow a tail-call in this case. A function that I think is better done in C than Lua is a complement to 'select', which could be called 'shift'. shift(n,...) returns the values that select(n+1,...) skips over. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 20:09:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9DN8xXK028876; Tue, 13 Oct 2009 20:09:00 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 452C918BD6; Tue, 13 Oct 2009 21:07:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth18.prod.mesa1.secureserver.net (smtpauth18.prod.mesa1.secureserver.net [64.202.165.31]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4915E18BB1 for ; Tue, 13 Oct 2009 21:07:45 -0200 (BRST) Received: (qmail 27081 invoked from network); 13 Oct 2009 23:08:25 -0000 Received: from unknown (98.117.140.83) by smtpauth18.prod.mesa1.secureserver.net (64.202.165.31) with ESMTP; 13 Oct 2009 23:08:25 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Addition of map() and filter(). From: Mark Hamburg In-Reply-To: <20091013183511.4a4dfced@egeria.whoopdedo.org> Date: Tue, 13 Oct 2009 16:08:23 -0700 Content-Transfer-Encoding: 7bit Message-Id: <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 13, 2009, at 3:35 PM, TNHarris wrote: > > Which could be optimized to use local variables only. However, that > does > demonstrate one thing about Lua that I didn't expect. This... > > return something, F() > > ... isn't a tail-call. I thought it would be, but the comma operator > is > enough to prevent the optimization. I think it would be a worthwhile > change to the VM to allow a tail-call in this case. This can't be a tail call because it has to process the results of F() to combine them with something before returning further up the chain. So, in this case, you might actually want to fear recursion. Basically, you want to write map and filter in C because it will be much easier to work with varargs efficiently in C. Mark From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 22:14:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E1E9SK009253; Tue, 13 Oct 2009 22:14:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C84941A6D5; Tue, 13 Oct 2009 23:12:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCCBF1A6B2 for ; Tue, 13 Oct 2009 23:12:52 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MxsQj-0007dc-7L for lua@bazar2.conectiva.com.br; Wed, 14 Oct 2009 03:13:29 +0200 Received: from 66-192-186-101.static.twtelecom.net ([66.192.186.101]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2009 03:13:29 +0200 Received: from stuart by 66-192-186-101.static.twtelecom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2009 03:13:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Lua for Windows bug Date: Tue, 13 Oct 2009 18:12:56 -0700 Lines: 3 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 66-192-186-101.static.twtelecom.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If you choose not to make a Start Menu folder in a Lua for Windows install, it still creates a folder with a Documentation folder and two shortcuts. From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 22:25:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E1PFp7010272; Tue, 13 Oct 2009 22:25:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D270D1A6EA; Tue, 13 Oct 2009 23:24:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1B221A5ED for ; Tue, 13 Oct 2009 23:24:01 -0200 (BRST) Received: by fxm12 with SMTP id 12so4546348fxm.5 for ; Tue, 13 Oct 2009 18:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=c/5xcflYdjEqHvf3iXXZa9CiT3aOyDi6JYUzBIFc6ko=; b=YdQyAzHdOcFjuIveUAB2WjL0kLOPApCWQlc5lGcYWQEWWsnnxJWncN0AU439iVHHZD x4C64KCG7cv4t2UlggyMNV7/QPb2WnvAQXNnezdsucuYOYcDd4kCKJKvVsLJMTQX4VGr 0vKnlJ3krQtbHPKm50PGqJ1LtDmSUCUbEWegs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=fYErr7o3oebBBZOSKl+AZL7nRUCk+knADsxlOG0JUGzPMsm45jI3/9d3oHuRGxJSkH Y8qPLO54R1LSWsfeU6NCgvNMklPWDvENGMQDLOxF/qXugVGGr6sstQrA3NZdzvrz4HDT IRjrojxSRGZAOszsZMQjWJvEOEi3z0MuKwY70= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr6628653bkw.154.1255483482712; Tue, 13 Oct 2009 18:24:42 -0700 (PDT) In-Reply-To: References: <7913df4d0910131419m1360ca4iace0f03de14db6c1@mail.gmail.com> Date: Tue, 13 Oct 2009 20:24:42 -0500 X-Google-Sender-Auth: d44ffd3c96cff50b Message-ID: <5ba75e2f0910131824q3823d5cei55a8e1954b8752c@mail.gmail.com> Subject: Re: a LuaForge mirror From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf772022a2a0475db07cc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf772022a2a0475db07cc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Please also consider visit statistics, for those projects still used but unmaintained Blessings! On Tue, Oct 13, 2009 at 5:21 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > Have you considered spamming the authors about this? Maybe some of them a= re > not subscribed to the mailing list. It would also provide some refreshing > feedback about which projects are unmaintained/forgotten. They will proba= bly > announce back the movings on this list. > > On Wed, Oct 14, 2009 at 00:19, Fabio Mascarenhas wro= te: > >> >From Andr=C3=A9's message about the resumption of CVS access (not yet i= n >> the archives, sorry): >> >> "As some have already manifested, if you are using CVS on LuaForge this >> would be a good time to start planning your migration strategy. While >> we will keep supporting CVS for at least two months, our plan is to >> stop using it as soon as possible." >> >> -- >> Fabio Mascarenhas >> >> >> On Tue, Oct 13, 2009 at 6:10 PM, Cosmin Apreutesei >> wrote: >> >> Comments and suggestions are welcome. Please keep it civil, though... >> > >> > With this in sight, are authors still encouraged to move their project= s >> away >> > from luaforge following the Kepler example? Is there a general attitud= e >> > towards this? >> > >> > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf772022a2a0475db07cc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Please also consider visit statistics, for those projects still used but un= maintained

Blessings!

On Tue, Oct = 13, 2009 at 5:21 PM, Cosmin Apreutesei <cosmin.apreutesei@gmail.com>= wrote:
Have you con= sidered spamming the authors about this? Maybe some of them are not subscri= bed to the mailing list. It would also provide some refreshing feedback abo= ut which projects are unmaintained/forgotten. They will probably announce b= ack the movings on this list.

On Wed, Oct 14, 2009 at 00:19, Fa= bio Mascarenhas <mascarenhas@acm.org> wrote:
>From Andr=C3=A9's message about the resumption of CVS access (not y= et in
the archives, sorry):

"As some have already manifested, if you are using CVS on LuaForge thi= s
would be a good time to start planning your migration strategy. While
we will keep supporting CVS for at least two months, our plan is to
stop using it as soon as possible."

--
Fabio Mascarenhas


On Tue, Oct 13, 2009 at 6:10 PM, Cosmin Apreutesei
<cosmin= .apreutesei@gmail.com> wrote:
>> Comments and suggestions are welcome. Please keep it civil, though= ...
>
> With this in sight, are authors still encouraged to move their project= s away
> from luaforge following the Kepler example? Is there a general attitud= e
> towards this?
>




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf772022a2a0475db07cc-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 13 23:40:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E2emEi018372; Tue, 13 Oct 2009 23:40:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B0161A6F4; Wed, 14 Oct 2009 00:39:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B70881A5ED for ; Wed, 14 Oct 2009 00:39:33 -0200 (BRST) Received: by ywh5 with SMTP id 5so5171399ywh.11 for ; Tue, 13 Oct 2009 19:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=QD1Nk6h9a+YURnYc2taXQTS13K/7jvYamUyY/ojn2JU=; b=CmxfSGsT6jZGAosM25cCwYq6MoexMrxZ/DaCNq1dYFinLPoga/yyL1wBTPRVkM+KqP ms4N1a2yIpPHsnk9Swo88fXinenq+xBK9+MmqseR6NXPlb3v7Q+BlK0GqjVfsrMn7Lyt liNbQSIkTYujHxaWrwIxjhWGgUiX76Nt4E/3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=MY1S18YnNN5EJ9HkBN/HiUPJdim3gkGbDUvo7c6rLujR4w+PRpdcErBarYLYAqF60X Yf5dP29mFHJxtufvbJBFgPK1uAwerg4uattmiHaUI4rnQtkBa1jjCyPUeyJRbqT9JYJQ VxY+ED+RlqKcXvw9fGq0y+ic5vDURl+BwNBec= MIME-Version: 1.0 Received: by 10.150.175.1 with SMTP id x1mr13940468ybe.45.1255488015063; Tue, 13 Oct 2009 19:40:15 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Tue, 13 Oct 2009 22:39:55 -0400 X-Google-Sender-Auth: 4cb8e079eb2049c2 Message-ID: Subject: Re: Lua for Windows bug To: Lua list Content-Type: multipart/alternative; boundary=000e0cd76220285bb40475dc1528 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd76220285bb40475dc1528 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 13, 2009 at 9:12 PM, Stuart P.Bentley wrote: > If you choose not to make a Start Menu folder in a Lua for Windows install, > it still creates a folder with a Documentation folder and two shortcuts. > > Hi Stuart, I will take a look at this tomorrow. Thanks for letting us know. -- Regards, Ryan --000e0cd76220285bb40475dc1528 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Oct 13, 2009 at 9:12 PM, Stuart P.Bentley <
stuart@testtrack4.com>
= wrote:
If you choose not to make a Start Menu folder in a Lua for Windows install,= it still creates a folder with a Documentation folder and two shortcuts. <= br>

Hi Stuart,

I will take a look at this tomorro= w. Thanks for letting us know.
--
Regards,
Ryan
--000e0cd76220285bb40475dc1528-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 00:03:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E33pci021137; Wed, 14 Oct 2009 00:03:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 09EF8187FF; Wed, 14 Oct 2009 01:02:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FBAB18592 for ; Wed, 14 Oct 2009 01:02:42 -0200 (BRST) Received: by ywh5 with SMTP id 5so5185030ywh.11 for ; Tue, 13 Oct 2009 20:03:25 -0700 (PDT) Received: by 10.101.7.17 with SMTP id k17mr6682519ani.181.1255489405402; Tue, 13 Oct 2009 20:03:25 -0700 (PDT) Received: from mothra.localnet ([201.230.137.224]) by mx.google.com with ESMTPS id 22sm3435805yxe.15.2009.10.13.20.03.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Oct 2009 20:03:24 -0700 (PDT) From: Javier Guerra To: lua@bazar2.conectiva.com.br Subject: Re: Addition of map() and filter(). Date: Tue, 13 Oct 2009 22:03:21 -0500 User-Agent: KMail/1.12.2 (Linux/2.6.28-15-generic; KDE/4.3.2; x86_64; ; ) References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> In-Reply-To: <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200910132203.21477.javier@guerrag.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: > On Oct 13, 2009, at 3:35 PM, TNHarris wrote: > > return something, F() > > > > ... isn't a tail-call. I thought it would be, but the comma operator > > is > > enough to prevent the optimization. I think it would be a worthwhile > > change to the VM to allow a tail-call in this case. > > This can't be a tail call because it has to process the results of F() > to combine them with something before returning further up the chain. Note that even Scheme can't tail-call similar constructs -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 03:46:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E6kWve008461; Wed, 14 Oct 2009 03:46:32 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D6721A66A; Wed, 14 Oct 2009 04:45:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 590C91A65A for ; Wed, 14 Oct 2009 04:45:15 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so2312484eye.39 for ; Tue, 13 Oct 2009 23:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kuDvImVHIdyCTy3vgfVAhL9ODQo0eoTqR8Y990H54EY=; b=O53aqTDmDv0bpcMeMd+ZYTzu4ME5JP7GAYSQjB8Oku0dPII8YsIEUtF4PUR+/Wydyf DwhrBmOFZWMuFtmlDLZoUWjaAyGE8UTkDkfyKs/NMB2fPm73RDViLYayXIwwKYE0gTxg cpR/94AnpbZdnTdC0qyT66RbBr+Nx4k3k+mB4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ncRt4M4jb+Q89fVjmvbSMX4aOWS8+nSm1uAngVk9J6bkUXLJKCGBZ/S0S4rIKXUwC0 Q7Tn7bE4jd5Cs7kmo4ZDc3U/fInq5DrRREMJT6NQ9C93NwnwjGYSu8fUOoEZ9fPokN49 S5ef6szOwKbxxoB0TwdwYy6V25NI2pT/Qgi64= MIME-Version: 1.0 Received: by 10.211.156.19 with SMTP id i19mr6877775ebo.79.1255502757347; Tue, 13 Oct 2009 23:45:57 -0700 (PDT) In-Reply-To: <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> Date: Wed, 14 Oct 2009 08:45:57 +0200 Message-ID: <13af99c70910132345v3a2af55fkd922879b917817aa@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=00504502d28eddc05b0475df831f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502d28eddc05b0475df831f Content-Type: text/plain; charset=ISO-8859-1 On Wed, Oct 14, 2009 at 1:08 AM, Mark Hamburg wrote: > On Oct 13, 2009, at 3:35 PM, TNHarris wrote: > > >> Which could be optimized to use local variables only. However, that does >> demonstrate one thing about Lua that I didn't expect. This... >> >> return something, F() >> >> ... isn't a tail-call. I thought it would be, but the comma operator is >> enough to prevent the optimization. I think it would be a worthwhile >> change to the VM to allow a tail-call in this case. >> > > This can't be a tail call because it has to process the results of F() to > combine them with something before returning further up the chain. > > So, in this case, you might actually want to fear recursion. > > Basically, you want to write map and filter in C because it will be much > easier to work with varargs efficiently in C. > > Mark > > Well, you _could_ make this a special case that supported tail recursion, by offsetting the stack for each prepended argument: return a, foo() or return a, b, foo(), et.c. The cases that can't be tail called is stuff like: return 1 + foo() --00504502d28eddc05b0475df831f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Oct 14, 2009 at 1:08 AM, Mark Ha= mburg <mark@grubma= h.com> wrote:
On Oct 13, 2009, at 3:35 PM, TNHarris wrote:


Which could be optimized to use local variables only. However, that does demonstrate one thing about Lua that I didn't expect. This...

=A0 return something, F()

... isn't a tail-call. I thought it would be, but the comma operator is=
enough to prevent the optimization. I think it would be a worthwhile
change to the VM to allow a tail-call in this case.

This can't be a tail call because it has to process the results of F() = to combine them with something before returning further up the chain.

So, in this case, you might actually want to fear recursion.

Basically, you want to write map and filter in C because it will be much ea= sier to work with varargs efficiently in C.

Mark


Well, you _could_ make this a special case th= at supported tail recursion, by offsetting the stack for each prepended arg= ument:
return a, foo() or return a, b, foo(), et.c.

The cases tha= t can't be tail called is stuff like: return 1 + foo()

--00504502d28eddc05b0475df831f-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 04:29:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E7TCcc013736; Wed, 14 Oct 2009 04:29:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 175181866F; Wed, 14 Oct 2009 05:28:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAA4418629 for ; Wed, 14 Oct 2009 05:27:52 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so213328fgg.17 for ; Wed, 14 Oct 2009 00:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5mhRjGqoq98MY0pw45cabMiyJAg0FjjjvdhTESuQnxc=; b=jbTuZYC+aEb7FDDBfr4qFIOSJxMl7gHf7kIg9X8u5iITWPx5frjoJUqxFFIz84qmDs pP5ndGCDsDINTUDm6LDiD3WYm1SbbRRoffTY3nbhU4sTdNVCuqj7WVOcSHSVnUQ7ZXO6 pyYALSeZMSb81zg99HJeKL+KHw0kaFJVfZHoM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VkwIdUzjJ4U6CogcelS3OaqF19ANSEVLYZugna62UISa9evN2+MJCQCX4KpNpBCx87 sW8JCQ0AaCp9Lxe2zYgyT4IzAaPgKcb4E6OzkzsSX2o2arFg9SPuxdImddsemb+bZyAE OHx6OftPQRkaVGwWao4dsBnyxjABhQydkEOA4= MIME-Version: 1.0 Received: by 10.239.168.131 with SMTP id k3mr594626hbe.101.1255505312976; Wed, 14 Oct 2009 00:28:32 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Oct 2009 09:28:32 +0200 Message-ID: <560972290910140028k263dd19ajdc3c21927ba3491c@mail.gmail.com> Subject: Re: a LuaForge mirror From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 13, 2009 at 10:21 PM, Yuri Takhteyev wrote: > Comments and suggestions are welcome. Please keep it civil, though... Ah, we're all friends here ;) It's probably the first time I've seen the whole list of projects presented so neatly. Sometimes, less is more. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 06:30:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9E9UtX4023962; Wed, 14 Oct 2009 06:30:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50678186A1; Wed, 14 Oct 2009 07:29:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A07CD1863A for ; Wed, 14 Oct 2009 07:29:25 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so935209qwb.11 for ; Wed, 14 Oct 2009 02:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=psPdbSc7gf5pcxmkHroYrFobzVS4Qdt74k4JsKC8gyY=; b=u3BICqnjaZfDNT46ZmJleaa1O1iII5pUECw3psvgHw/b6dxxYbVvClsdNTLM2bAma8 IdKwVP0H9LgQeUXPUx8jG//u64SHcOEkbQgmL04CGQdD9d9MpYa7HObKlW3OkEJ+JuTM D+ZevUe88QKuGRe7lgJz05N5LHnVwGTn95TfM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=m/7KiKiiuWskVi1dZ512IRGBaI4k+QkCHsCmF1EoezRQZ9iSx/7zqAmZeV1Ytob98k PdV8RGMHdYW+HdL1RTHq74QyGbp3DwfEYTUksiYgFnjxW9txVtJgF/+jqAnW0EidA99S KfsH8VXO/HuxUm+WlHvkYkXVjD/SOlpwwLVko= MIME-Version: 1.0 Received: by 10.224.125.76 with SMTP id x12mr6796534qar.130.1255512607968; Wed, 14 Oct 2009 02:30:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Oct 2009 11:30:07 +0200 Message-ID: Subject: Re: A simple SOAP client From: Thijs Koerselman To: Lua list Content-Type: multipart/alternative; boundary=0016364ed17a024db20475e1cf34 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016364ed17a024db20475e1cf34 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 13, 2009 at 7:07 PM, Tomas Guisasola Gorham < tomas@tecgraf.puc-rio.br> wrote: > > We are using LuaSOAP here at PUC and it is working quite well. > Also, we are planning to release a new version quite soon (in fact, we > are waiting LuaSec 0.4 which will come with https support). If cannot > wait, > I can send you the files (I think anonymous CVS on LuaForge won't work). > > Hi Tomas, Thanks for letting me know. I think LuaSOAP would probably be fine for me right now. I'm only at a test stage at the moment, and the SOAP methods are very simple. But I seem to be missing something obvious. I copied soap.lua and http.lua from the LuaSOAP library to my script directory. The script starts with: require "luarocks.require" require "http" This triggers an error about "luasocket" which can't be found. I initially thought it had something to do with luarocks, but it seems that in http.lua there is a line: require "luasocket" which I think should read: require "socket". After fixing this error I run into the next in soap.lua: module(arg and arg[1]) which gets a nil argument. Then I change this to module("soap") and I run into the next.... What is going on here? Am I trying to use an outdated version of LuaSOAP? Thijs --0016364ed17a024db20475e1cf34 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Oct 13, 2009 at 7:07 PM, Tomas G= uisasola Gorham <tomas@tecgraf.puc-rio.br> wrote:
=A0=A0 =A0
=A0 =A0 =A0 =A0We are using LuaSOAP here at PUC and it is working quite we= ll.
Also, we are planning to release a new version quite soon (in fact, we
are waiting LuaSec 0.4 which will come with https support). =A0If cannot wa= it,
I can send you the files (I think anonymous CVS on LuaForge won't work)= .


Hi Tomas,

Thanks fo= r letting me know. I think=A0Lu= aSOAP=A0would probably be fine for me right now. I'm only at a t= est stage at the moment, and the SOAP methods are very simple.

But I seem to be missing something obvious. I copied so= ap.lua=A0and http.lua=A0from the=A0LuaSOAP=A0library to my script dire= ctory. =A0The script starts with:

require "luarocks.require"
require "http"

This triggers an err= or about "luasocket= " which can't be found. I initially thought it had something to do= with=A0luarocks, but it= seems that in http.lua= =A0there is a line: require "lua: module(arg=A0and=A0arg[1]) which gets a nil argument. Then I change th= is to module("soap") and I run into the next....

What is going on here? Am I trying to use an outdated v= ersion of=A0LuaSOAP?

Thijs
--0016364ed17a024db20475e1cf34-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 07:40:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EAeHVu029541; Wed, 14 Oct 2009 07:40:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA88118BCD; Wed, 14 Oct 2009 08:38:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75CD418BA2 for ; Wed, 14 Oct 2009 08:38:16 -0200 (BRST) Received: from magritte (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EAcvun029444 for ; Wed, 14 Oct 2009 07:38:59 -0300 Date: Wed, 14 Oct 2009 07:38:57 -0300 (BRT) From: Tomas Guisasola Gorham To: Lua list Subject: Re: A simple SOAP client In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="678920-695260830-1255516737=:975" X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --678920-695260830-1255516737=:975 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi Thijs > What is going on here? Am I trying to use an outdated version of LuaSOAP? Sure, you have a wrong version. The future version will have a file client.lua (instead of http) which allows HTTP over LuaSocket's socket.http module and HTTPS over LuaSec's ssl.https module. In the new architecture, it would be simple to add another communication layer by providing a function with the same interface as socket.http.request() or ssl.https.request(). I am attaching the distribution file (beta version), so you can check if it works. Let me know if something goes wrong. Regards, Tomás --678920-695260830-1255516737=:975 Content-Type: APPLICATION/x-gzip; name=luasoap-2.0.0-beta.tar.gz Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=luasoap-2.0.0-beta.tar.gz H4sIAEep1UoAA+x9C3QcxbGoAiRYCyQk4QEv+IVmjO1de7WrXUmWLWtlC0m2 BLKkK8lgRxZitDuSBs/uLDOz+hicQAghF8LXL+Fz4eZDchPChYTAhfuAQALh /8kDAgkQTH5A8l4I4Q+5QF5VdffM7E+WsWzCi+aAtdO/qq6qrq6uru4xcqpt qtmqeKQ6Ul01rDlqtGK2n2p46uvr8G+svq6W3mO1/K94KmKx+LK6mnhtbQzS YzWx2uoKVjfrmJR4crajWoxVOGZatactp1nT5X9AH6OY//lJ1RHLTG62s1ry PcNABi9bVluO/8D6WuR/TWzZsvpYXT3wvz5WU1vBqmexn2Wff3D+Z9XkZnVU YwmmCL4rgXHoqW5mME3IgBII2GbOSmK5kwOMsZxlJJQxx8k2RKW8RODviGmN apGM5rhCFIvE4H8gcWR0ixIObA0EUpqdtPSswyFQa3YunVatKQTYl8tmTcth 0BLr627ugTpQIAVyqRtaCkt05lTMYFnLHNehMaYyQHiK2Xo6a2isuaeDOWOq w5JmBtIdBuWZow4bUNIxmZpJsRHLTLMN6zpZykzm0lrGsTmUMTOtZQUxpusb L23oSS1jU+F1Hf3RDbGY7F9Wy6S0TFIHiKKDSFvWlGB1kRivjAnaZBbQhFSg ERC5xsuxYcRplIX0j1eJlodzupGSTTpTWYKNiY6e4ZXTZipneGCRtIA9w3K2 lYzKrvDC8AwolASiDaRSBt1y9F6qZNLQgV5eSf7uldyKeL7fMj33zPyZRv/j ELBnYxbYof5fVufq/2Wg+Kvj1TXVsTn9vyeeYv3P+T47s8CIZUdT5kTGMNVU JDuWja5aVSBeuzo/MBPwZO39/T19RVPFwMDumCsigf4x3Raq1t/yhDqFtUBQ CjGLDA6+HxMM6X4xiSD7vAwtienVkVqR/h4nl7xJIcLlpmBqiFLq3ATx9/qU 0P+9bc2t69pmEQbp/9ry+r/Os/9xGQj2fy0kzun/PfFIDamjBjP0YQv1rDnC RnKZJKpgUoQpTTXYhO6MkWILcAUoC3N1ZDNQ19BYGxq1kUCgXbM0NmqSYrTT qmEwv14HAM6YxkZ01Cd6hl5Suu1Y+nAOCwRIwaxTN2tYhMmnqspLwwlgfUaf ZPaU7Whpm2pw0WXMX4OQxSoBUOHRnB2lkjpo0ElQWWnDK9kO6pmhfg5UapMq zhC2WwKym+W0ITIR8fb+dZ3UnlDWXotQocXMTln66JjDFrFOns/LCp2fzYy6 sCUfOs1Rkwql1UxONXwYQqFebQTImoEJmOcGUM8GpJmPStbf8T4+V1PXMcmz 1b0ybZMOoIUsEfOZO2mxYD5j+2hNEuLQ3PXBNC0NwzSTwsotazugfsA3JwQq 3VmBzQSXviJktGQo4Gi2I7iJPwu73w21Ue5okod8xsXPLU8GiKyE3CLciooH juxINQjBCo/DWq2GxaurV0Sr66PxOIutaKiON9QuY6Q+oAtZduQHanorof+R UbMKYyf8fzVQEv1/9TAlzPn/9sBThv9ioM4OjJ3x/8bj8Qq0CKrjc/zfE8/0 /HfV9C7B2IH9V10XI/5X18dx3MfQ/1tdO7f+3yNP1Ww8AbQ20HrhYuNf+WIW ZWuazx7KmA7YQ2hA+e0mLEezrSt2NOHGxYRbF43Xs1hNQxwm3FjehDs7nQhY 2kk53dLyPJ2BohUurG/dgrYhVr0fqDnf/5QZ/56FNwswph//cVj4xXH8x0Dt x2tqalD/18fn1n975DHMJKzt0N8ThiGFK7DMaJhlIdEIs1wG3YPwquqWHWY6 /QX535niAQ5BsyzTCjPVttHPlsh/F2XI8+YbXvSuiEwOyz/4KEFmJ0d1NOUT 4oeshB4wXxXa3grw5UUwb+8jFJCIZpJmikNSdNusWr68bkVVTIKZTBtDY5qa Av2WYIsbV8E7E47ShBKLVCtu/YSyOBKRL5HIYmVV06bMYgllaCitOWNmyg64 v8ivVmnAKnidmyBX4SyYUdOaDeTVQoHKSt6GgTW2wisuhTEf9SnRPOg2GmIp E0pUEikjegapHQRWnQzEpi7ycl1QWwnzRrYiBFhrwb+W5uSsDF9cUle0YEaH 2ooPy15Ay4R2oboBNaEiuRNlN5G8uvAYV4J+RxDuD+oQveUsg/4iqCGV+kzv E3bKYEEzCwtPfE3pdtIU7wBkdvQ+R9UltUUdSgXxb5hxZgN0LlcR/h5UWswM rFadKkPLjDpj0HkujhF4p5qhklUyGsGA4krSMIFoXqkkb1AWdrRJB4uBgGEh fURggq4SII2slc05QRdFYpovg/AIYOosUcqlETmLaQhrmXHNMLNacETNGQ6K SJjRT6kboB+WCsj5ElGwvbeGUTs3HFSCA41NgyEFRXNAaeRu5EWGsxJSBpQm 8T5K7yihZUUTUxrWYPPYVkA6BFyBd/FUBKIc563hMkWFminoFRSHQYJd4/W2 ziqdCyQypSGOKdVRgykzCZ3n+e4IAiIbWnoI3/lPVB1EGV4zrxa2Ctmuhhhw 6w5GeFKgkmvlIKr5IJYPsQSSQ+CDYrk+o46rukEKm9dqYCcokYicE4Juq6FI RFmM6lWyzIc2thhmQY4yKLGTdysZcZLClyAH68NDtUaHSEO6VIKhA9xGrcUn t+I6fLILelVDbKusbW6mSQebGIgN0ugFixeTxeh1my8xkLgE93G92YZZQHDR WHwQh7lhg9IUKt3S0mBtB3l+mMVQeQO4BRJCgsUkUA+qDzWuNOgfwR9zswS3 G3mBen1oVMsMoYwNqbnJIBDWVkc9DgznRkZolj1ZqlaY5tKqExwYYGKoNtoN KDq44kDGJJSFttLkDmPITZrop53sBxheOuXYYBGgI7UJd+YqKwXwCAlsoBKm FppUh0BEdc1I4cTKrRkXTT6vclTTeibM0uokJz0fNVgtYiaTOYsctnwEcYPG 5Yesh/qwoDzwJlycGCeGAfunByNU1kzgFAMREArqxUC0hLC43R4Su4S8BXoB mrl2WaDA6uAMDZflZhFPAXw3omUDY1MKIuJ/dTlOlEgodgP+jgqGurjLDnLl SCiHxFQZKI1fPkaNUZ+wBPypJYQLkwX2gIdP53FAMMUnVQlIaLrpxkUQt0y8 ua54zGB+xJXISIRBz8uUsoSZtjsVrAtaoFSAfynGN2KdBlHe5WkfaMCOjBjL vEhWteQoh5/w1wGrW2GC2gnFyUgBwFaj/mabpoXTnXNmDRCXPaI3lzc/g3hS iXzJGqF99gB/MIKilISVHpqcLjA1WSo1U6RreQE9AzYnE52VdBKc5NTyNZZz yhRGdsjSgrou5DL0Lfi5Ryg4rGdwXTdL9KMZ3yuAr80EkCs425kyoIaMQCmi JlG+ibcybKamMAQlAWs0BzfAsLQgJC9XghEzqCsKzpAv7rov4lvQRSK7h0cu d4AxiJE2hOgFS1gSgKS3gEeUCxkW4FRJaSN6Rqft7wDWAOlEN58b62Qnx7S0 akcgi8xs0xolkpC/PKrIOpi34zr45qvjVpiYmIhM1FC5eHV1LLphXWcftZHX PsxL04Kg1qUbwgMDA45kS76ndZTJHaGKpbANB6xezemSxnBeS1hwxy0pKDM+ MfEZ1iUS0bSm9T/qLBt/7Yx8zNwM4dwnIELSgcjUBan/10DxVo2WggnlpJxq 6GBegDVSiiLluhgKeeYlXzuVd9xIQ4+nlrQiS/aOl4+QviKbx2/p78DwIZOH eu2b4jhRuFEDjBCae6dZsQe77S0o/D0H3HH2Q6ttd8uRhOOZG1wScJorJRx7 Wi5cK2BmwuHJguyYJw5iOtzdFBVgShH0KMiSSwFhTfipHfDmWdmIY6kZG7uy Y/2J+SWnYRHXySrzOfl+c1Z0ceaDXjBW1PP4Kjqxu/kqncQFfM23y03LKTmS pPCV4DsJRb6VpaZSYG/bDE0Dz8LKNzgRlE/1CexKjNidec9ZBolBWS4IaD7b Y6ZryJ1iTlmmFZtR5G0PeuatZztFIkoj5WI0NZiI3m9Y988iThTzNqrbuAaD IcNFh2xoTUtpKYxNFO56/HlcX2snBW276GADuPmDkWL4ezUt6fg+Rx/3RVNY I8YfUqIITJRyn1+FZu+S9XhO2crA+6JqmFa2Am17+GuovHNyqSjnX9oKAXqo RshXm++S5Fd3SbKDNmaDa76tFM47OQiGkIVBPjL8rlTLCFOXwxxNkLj8cQS2 O983KmFNiTyxlZQ33iCL9pW8RKJrgmD5kznBEhx6wJ/jW76gT51rMNqwIKSV geOjg0uORI+4MquDkcIhUQ/ZTG4P8oMKaoYNa7hIS7HhKVd6YET6+Q/LLNZP vnlX3MS04wvCjcw2tzVCWC6Ji10bSODiRJgVi7wkoF7cbUVih9yrcBeQg2I5 J2U4UdrV4sp6KdBh6S0TfswSvje3iAentJPLLegaVf6iBf4Wt7A0RRJlHAvh AHWROOffDI5EIiEMWQ2W3pDg51RCDOd/bz/DoxG2R23wTYGijbSSy7IS9MNW hY0RRqf57Mp/O2hyOogD0it0OPxNavq4J/u4NYME5ELtHwNZ03ZwxyxPDfZ0 9/UzSqVjPaVHD0CypsRGZaHSpjypBmZ7/IxRh4dEX4OyB2E/RqU2//jWlLsR JUvwmZo2n1xiCAuyfGUSEne3UdZDJrtRD54V4G5FAQg/1dBkRYHmFisKKk1e rjFZWSk2IT2JJlGUsligr0FDFHl2ZISC2AwphE6K3APvTX7vAQc+OfiRcO0i Pxa+Jj195Q+UUHDzpjQZRTN+LmBgBzfb5ZZi2NuUnNlOpi+QgfYGZZzA7nOP joCsGLSbKZOCaXvUh8q0252aJXc7sRLHU0Qz2OiFhzzuhQwWwwnNHSp7b0+5 +D9xnmRWYEwf/xerrYkvKzj/VVdTPxf/t0ee2dED4gATRtvRESk0QPhCDb0e kBUpjgHumj4GWEoghQCv2OGZm9nph1BoPP5FRjC6AY1ewKMw8GZULlAynNHh C3kowl0B8IOHcmB4pW+lH2Z+h4F840UDpUMh4W0ErMgw48tlb93CU/PcMKIK 3+SXzUH6mBLBgAaZYkwCL8y0hACGEtnUIjlC7zKukpungcBQS3fPxt6Ote39 GEvl8T3YEkJu1lYhS9kxGoiLxXos80Qt6SiBoda2vpbejp7+ju6u3XbbR2Do 2LbevgIIpAEVKQJAbV019C3aLFq0fbJNsiX5TG+OMNXh5x4122+GqoUrOK8Y VcrILQleSZgtwmC1tCxMue4gFH4GcxhpPFt2a8Hcj+jZLKiG3HAn1Yt2ItwU BW2xjOnriWtBiiBeGdEKLagDsUHX44laRA+zcS8QByGJ2NZKMYRYMOnKfFBZ aCcWngS2xDgYRQPjg6FS5pqv1Z1rFGvltUj/YtxVkjWxal/EFe85w9A4PqCp QUgI+RBxCeR32M7uaipf9pJjYIeBDSYkyRMMKX2QUih/vBCOqmHNGx6pmYuf BLqbBFAE0AITAVNPCuHFJ0k+SpeWvFKShu0JsUgO6Oh6cLvPguNF4dIeo0O7 l5O7gXNUZ09oD4+C/iUY55yYIR1x0sDjp+PkxbcBq0RKJpce1iylgMtQL+CG yzkldlIEIIADRSOOOoqLMH5CIQhzrdKRGQccU0JVSy0AGuwEKLuYR5aFaCQL iK6iaFxoL7SbFtqNUfgDCgNaIwWJfYngr1DYFVjqHxTxQjv9Ujrr8iPnF0BC CAowmDN3sV00GZUQDxQGoEvOdXh7vtigQkEASkhE3e2mZSbYMUMECBQ20pJv rqkFqhxz3D01YRRBMg+qByTDFNUYKlTW47tPCTenUjKMXwY5BgE33WHapG6j yw7GqG9ItxiaCp00jaJqamZqQp2aXfpyEEOOBpaV6ogjGyIUnhbp7VSArosp 4AifK+XJGBRo38kJ2oNBe9XfExrPqJvjrm6WBjCvHpMHGoqOPhTgido94bbq zdu8lXBht/w6WZ744a6IaXreJopA3ytp4GBYsuJF4Sjy4IGMtOnDvWJFilrD pK37X1LYTuWAv4FB351A08TxcDSion4JkDNsR8YD+fFAJP3VywYgVQGJHTWT 1Aqqp2ZWHWvh+YmTKULYI/JRZmqKtxiT7n2RTyc7MOoEFus4h43ohqHhjOsy Y2vp/K3kl561k0J0pwetM3AdIm87EdODnsEFBz8HK/ch/PrWGrWLTHrpqw+z iTE9OQZTQg5GyLDWEPCfkGrY8Z6j0AtcacsDGYW1eDooeay+EktCFUvX7AZv IiD0ZWssKPsIlfjcFqJ6fEzJanxTaZiCKgCMGK0CM96gEFzfXiO1AzTTLHgb mqavsoav07j9BdVhrgaCg60yok+So8G30UV7S8EUD9VCEVM4xFITWj6KvmXV bMiMtz1GmysMN2hs18jhs1hCTkmk7bBApJgyUv3JKvQ3ElEaYG1Rpgr3KdsR dwupTDl/K/IMEOneknMQLqqFklVZRptgZkYrmMci0JH8KaFIyYY5Mv5Zok8D kcMGKRDVs+cRoGaptkZYiHSEIeI7sXSiBAicW6huiQzQMSE0IIvzYoN0MIYW AvzkA3pHggsQTJgtIKzFuBHmBebwdYE/E1I8KlLXBBuCatLJqYYBrbl+ABhf oOpChK7HlgA1HeFKMI87lI7Kb4DEwIXtY73c2POWKkV9dfcCcGSsQfOI38pk gRql1ZqMHgAMSLOst7WRnGGgmaKPZkxLQ70FEyaBtKdZhqD/xadVutehQZYD OlhaKMKjNAhbXqWggHddlItYpKRNSAWGqABfNGBQD4+7Mn1neOR6Tp7mkCFX Zl60FbJCLAv40PMfU5ErDDcRCSn/zq7R6Jtx/HMLn2/Q3cUNxjzqp8xksYaT /q+yhr1vH8mfnDdtIFlQ9fp4u8MpY9ZVKd+iZHnnGlHgpEeWBbmHkgp4W6a2 t9BrALxgvg0qxwcjVaEGXMPJqpLnIApcv3rGH1O6yK9FPZbJDejcQVNGHn0U DYSK92rpsJS3dnHXgm4fZIEiQSZrOR8tMpdQhbnpCuJV1dZ1rMgTEwanTHG7 3nqTttIYnlAG8yOz2KHCvJfY0hGKtMWFt1hOJ4XEXNgQHDi+YXBJ6EiFlKtc VcuKQjMKX4twtWhGaV+Lp0bxugAj/5CiT1Q5NmHZOI2+93tX5YPzTHv/zx65 /6O6dll90f5ffbx6bv9vTzyzo5nz7/+hCUacksCLJd3rgMJsOOeQuYhxbLSK BGPCBD1lubfL2jlQJSpFa+bdugOTndgDYmoyiSG847rqu2Ropy4Y8sR7hlf6 zQ6ZCrYXHZP7LYuuUvFtLZYtI+894b5md/MuKMyXkNg/lDANJxOL+4tRAih2 eVEK3u44hKT2F+LJxAFfUbWgjIqZ+beqiNuTQgFiTdk7m1E65BqN7K2MUXih KL93MiAw8+E5myYW0lwlL5UjV5AzXruXWrrnLKN4IStDzv1hvyL0DGnGo0yL q+W5WpF8zSJcjEdi735PQeQ9egoi78FTgNaLz0kQ2XUnAWM75yX44FvHdF9F npdBhBQO2XpmMygSsWAmDRDBtAjpjGBReVHQHxua1y6PsUZHHf9FS1AMjPaH rSoYdUl+PffyeAGZXiPCavbDpAhZREzoGRd31/trSwfhgHsTD55I4g5IvDsn ihfnhHmJZP5dPVjGNdb9YBvw8p5QSNTyhhrVWIz3OVEHvcGK1zotDrt+RkkW mKccM2mK+HMkCLeQYbGxUF0aom1wWUYIjmtaczcNv39laN2ALDYY5gjId4Ts wbGFgsX9TrxqX0tFWD+F+hddaBcpbATmVS3DHZiQWSgCHjKAWUQkAi60UiB4 tFSQpV0Z9C7xLQM75C0KLAv3wvASHsFbjFFRnZztcR+j7UMF/h5xEoakOeTd WSPmyyC2SOt5mNq9yTMI0HBlQrmwitqU2ZTxX1tDjYXyoi5pcTQE/2Vsb7Hh hmLy22F8l+2EWT5C2IQfumxrWuhC/UwDmjsZdt3+2+H3P/gHGnbpG1A7/P5H XT3a/3U19fGauppl+P2PWG3NnP2/J54Zff+DZGDu6x8fzK9/cOaV+PbHrnxW au7LH/+fPCX0P79XfxZhzPD+71qYJWACqMbvf8TrY3P3f++Jpyz/5ScVZgHG juL/6+qK/X/18bn5f088s7P29H3AhL6dgd8cibjeNilK5Gtbtmd9bQZM4F5k e0Ece+nrgd1FDI+11/CaFxZ0YmDHx337RLRl6MRojcF/x0MF0fUUMcyCC+0Q +2yCiZ9KmMmqYf+2Eb77GvLS46FQyN0tGY/5QtwQuu8ewnF08Dlx2niWsY1Q XqA3Lu+GpLTiWyXyVjzuKQTR+3Ho/XicIp6LLrP0oh9Vw9aoetEBPQAJFAAE C4LtRJUSVCOCKT46jMf8VAFk8q63cINvrZzmD+4iZUaGy8mBSv9GnNIH5ljV +t4O9BJ4zoq1mtOp2k6/BSvRHkvnMU6+fSvvdlh7Kj1sGrgp2Nq2RmFb+aWw 7vk+X3ST09CPd42o4vbUQGVRDJnjBpBhCNP6DK6CHTBApQdDluImlg9xNwqs oN4gRS4Iz0RlnYi4wtuq0TAONOZFtbEZXldVEIPGisPPduYqKuZGne34yisv 4sytlZrBRVlNgcpGX+QivFY25jFDtOYkPKKyEuRMKDFsCwiJLUTzmkAY0Xwg jW44G0EsEikONeFJILXdyAWqCaQJGuS/CVxRfQ8khyFeJDubBgcDwO33KvCt YglVIPiAiiv6fYWi789sMdNZNTMlclmLaWULi4iBxWpqIzHK+ocWzvKCIllR RmD6fALT5wpMZaPgQJMkf2NUplA2lyGkfWNUylMpMZPQd6+4effHlxU3n7jU ueKyC4oWuEr3meHv96Bv3eqUC8xu0DOOzJzTw7OlhyWZEy6J2W7VylIQyww2 d9TUTT9qZDPv26jxwqb5wGnOpI41jVyaR2t7o6rQzKHhJW6290q1qlOyNovh ck2U2PoPLsm7JkcuTyitsrFofscH+cGzo6XyG13WiPLEHlEhP09IbB7UWRdd DNL3y6z/QwxlVbv/awy8xroChVxgOuR/k4E26RhWYV4dJq+RmLMspJB6vODy 4JK9qQTNG6Netlea07ypPMFFNVGOJCwP7PsnUvxykR2KEpXKE548Zcq3FoQS 5UeEeYbWkJ6itngJmxcpMj00+pKJ/D2Yr+yF2q30fZeHonwRsXVTTM1mDV1E j6R0CtGcMK3NJerRlqHoPSiEmCyx1d2mnhsQOx4QXBamHwg+cSkS/cpGLgtC UxdKiEBeK5wcoKh7Zz29VpbnvSgfza/Q6PJftoBCIMsWZEJCAWJitvCQn/0x rKn2VB+F9vdr9nTj2HZMc1SzSwy4ZM4ypopHmWfVl7XR5XCpise8UZHfuKFa 1q41XreiXNtpU9ullmOxubEsCotgsZadwa5YDeQLo3DDcLkTQ4RkrcRapAlE qDFKuaIkCU6pknUrGqOUKQqCFJQqFoP2IEsMQR8WMEwL0ZzJONwaCAifseM7 +0L+UO411s3IhKU7WlDH4wRMCa1kkDRi5OwxLxTM/ZSUPL6Gx9Qp0bsLkwVt vApzU2aTtckZFJdhivr0GTvpMnfvimHBgYHpP57X0dctP723CnoUidjo73Ui XNzzgFNieQQmZwkBAhPybwD4HeQpIEFqErMlWZVNlkKe6KyF/O3efMTf41dC p93/cz+RvmswdhD/H4vVVBfs/y2rj9fP7f/tice/R+eymzbqane4UefbRRsS X/5NlIo5dC9VkmFsdFhHKBZRM0Jx7xhewkNJpVqnCzhUx7Qo7HJCtTTU7BRR 4sVhYnmvJA92KbJBGJvGCGH+s0kU4yIjXYqsEZ7sminCGGE7PaOzqjrvq4Nu c8L8eA/NlWqNDA5I2PnWamOyOfqzFWaTwghLoJg8SJtIQIXQ37emm3tKPSX0 f8pMzmb0z0zjfyjooxoDP6pjNfWx2rn4nz3xlOF/bjYDwGYe/1WPN39i/FdN TXyO/3viKc9//8G5XYOxg/iv6mU1NYX237LaufivPfI0HtHa3dK/saeNIZ9Z z/qjOjtamFIVjR5X0xKNtva3sg3t/es6wSCspnNPSScabetSKJy4eLHe3xud xIZiWFP8rLKpWiTl4MdYGjEN/2gq7Sw7umNoTSJ6rIHHTtOJrxG688Sk41oY mZ21zFFLTafx5JWhZkZz6qjWGOXV+ddbDDwxZGlGQqFP9dhjmuYobMzSRvL8 CpvpytEsv3GUsAaJjyRt91OidH4I36OIIFiNKsPqVWjZjifyDxzJ60hELezc SpYcwzWmk1jfv6ZqObbSGOXdbRymFXugMaWPMz2VoKNJqp7RLHROeMmAXAqM U/JYFKQNGeaoqTQ1qjPoGHkVG/X0KFPxe2UyRI9aYLaVTMg48Ug2M8p7G1Xp cy7jpSCjSQ2Qh/VR+EeyrDE6DDUorVw9X0y/0lTAYHkgrzyHqVH+hzUegecB fQRiVVV+cqaBlvmUzKjj+qjKQYPQxTy04TfgmuNuTkP3KKpnUtokqT2lqd1M a0gTcsrkpD+3dOkFGPI/rmsTSlO3+MXJCcWnrcdPOwFp6O/M6shzFUpTq/g1 s3pjOqxkYIXR1M5/zKxW0tJSugMotvAfM6yFwo1S3MJ/sILONUYF9UVCXjtp NZNTDcGGdfQyPSN8FRaAfHEBIb53+N6mwTy/ATqbrsoGvLcZNkBLW3nsU0i9 fJ1hE8OqrSeVpqPwjzzih1WZcOdLKkzTBHfaKU38bz7caarxk2xKE/9bUE1y zePbNC0JB0BTC3cP2Dpvbie6gH4BpQn/3RU8IEGjz1sDL3rd3zOXRm1SxTND tpDHNvHqb4DKw1RnZkabOrnthG5cehdlOIhCXeZTUQXqTMwtCqaNxb1W4Tek ZJsCUqPrNhuxNDxsOeKgj6QB7+LyfysI1eywiXc5JdWUlgaBwpPKSTOd1qyk jmdWc1bWtPEkk8PUYds0co5mTOFtzUnTdiKsfwxoxqBpTLLMKZhQ8LIVaHZt 1/oqQ9+sMUA3C9PuCGhlS+NzPn7FLOKGhsvvZdp4JFuSNuCfwcwsdJAfCxbz sh31PogmiN8NhVgflSKNIDsdYR2OLc9N2YQrfqMbKOsexi4JdDSTI2iyZnQ0 K/XO2p5OBOF1AQiNwc96JoCTVjY3DJVYysR5hw6MzXBaBmoG8m8+p1GxWdOy wDmbJeVFFkR4Zmij6MkWm4fYsWHNMCciIEpZLglYys7qFrBdnKaX58d08eWo KTNHNUlOxEE10SvaJ1AzU1IIUAYE44lsZs5hYyCkeGrfBN5thsocMbyvQV4S T/eSSmj6CAFM5cEJ8w+yYIY9RgeIR/VxFNAAn1/wqz56JmnkUvKCADULZMta Ol7KmSy83ANDxSZILIEd0KjFhFWAB3yRivLQHo2tSB6tXFNIH7bwbCHdQ2Hr oxkYK3S/nfyKAf/WUK85rFmOGejQrJwNQpy2k2NTYdacSVmLNDUJY2Ula1Et C/kUZv1mepHKU222NqfbYGMZKo24HnXYMDF+QsWDhFrh1xKEeKU0i75yRMcP BSNT7uCWPRmz0LKEn961J4uQSCvRcVvDr9dHGPmCFmGe1PRoVlq3bQEZSQl9 BRMMux3mkgLShNbsqBbmZyJBSGAdZGYC5jAarsgolVjD5Q6akWgSHVXbNpPI vlQ+NwJ4QgRPMAB+Sp+ooVCAP/RepSuh6E4I2ZiQw4BPs4R9wiLFFFijC1rS d6OQKrYQ9zDhGcaLSvSRKfREU7doENtj9O05cfdxGKbbYUH3MPYjChJlawZe t5IltTeShx2VoRtqkKCOIBHBnRgTH5pye6LbgZGclQGQ/AOGMEZskyDKW7rp rjvTgBGOXYNJIMW/B9mQJ8LqMF6WWzQqCBPkQ9ZjrhwwY+hjH9YCnG4afYVU dXuFwwawwE1Zh6YEsDcQLCvorW8ktbfBgm1N/3HNvW2so4/19HYf29Ha1sqU 5j54V8LsuI7+9u71/QxK9DZ39W9k3WtYc9dGdkxHV2s40Lahp7etr49197KO dT2dHW2tYdbR1dK5vrWjay07Cup1dfezzo51Hf3QaH83Q4CiqY42qLcmsK6t t6UdXpuP6ujs6N8YZms6+ruwzTXQaDPrae7t72hZ39ncC0vb3p7uvjYA3xro 6u7q6FrTC1Da1rV19cPM0QWgWNux8ML62ps7OwlU83rAvpfw8z5m0d7d2drW 2xc4qg0waz6qs42Dgk61dDZ3rAuz1uZ1zWvbqFY3tNJLxQR2x7W3URLAa+4K NLfQZy6AJi3dXf298ArKo7u33616XEdfG6iZ3o4+JMia3m5oHskJNZBmXQGo 19XGW0FSszyOQBF8X9/X5uHS2tbcCW31IQaQEJCFJVMLbBNpgQjDpCCXllsF NguIZY4vXLNFi1RvM0e4C5JjWnLzqpylJ7iBBstgWq7S2rTYu9AB6Ni8lSru W6hW+NL2WLqn3fVUHAHLfg1HRUKpiSmgHVLOWEJZvpx/0B5ttqzA0E7DAIDf tAnmd3nN8LAabsVTE9RkIYE4MUoTz1v6y/xhsZ1PHhK2Z7ZQyvv/vIXcrsLY of8P0gr8f+T/nfP/7f5nzv835/+b8//51+7c5Sde5vx+c36/Ob/fnN9vR34/ Wd5vQSqew06dJQ8gwEElnFA8lYONe2pHegZ9/irVdXLgVW94iz59ft6mtX2p acSbyil+lgsxucFcf+MMb1QKzOxGpQ7UELCqntGchncmaXiDotIk71Ik/QDt 8w8oF7TuLlbL+UoJLYTPL+XEWxzLsNPw2IkeTOxcXSQmIOTzR6p2LCvVu+RN S86ycFDIC7YAIbS+GZBhQkU/FI/jTclvZwKQakKyHDBvTkBw3rxQ5CYWHmFZ njsAxKVeFN1L3AE9X8SKvAuqBDei9pg5QX4cvNxr1ahl5rJDILSxOmLNGixP tMrSp1BKYe7OSljOnZk43imDJQ3Vtn2luJmXcjw/u/ftRnfKZgOrVkWPzmUw cHzFIAw1R9ZLiR84BOW9/Th6W0Bw6EJ9LgH6aEbF7w7A+AhMq119cdFcJjKp 0hW4LvPfmJWv1/zIrM+m0NsJ4kw9i0XixWWaU8g7eesjFKV7xvBC5LyPFJRg oq0lCy4bIxpqSRpDVCkqyQOkA4qVpTkuCHC96CN8PNqqJZHutTOiu2yJ+7po /M1QB3C/vtIkb69LAwu4meCNmRgL2jjMNR4i+h6me2osjV+5EK73UMTjxU7R STWyY35C1Uabs5afUPCvgaMjf3i45hdi45pghTqeKw3hvPac1WwaZ3VAOqtJ r5TzV9v4oVe5oTAzzihNxdsaAX5B8phppOzC3Q2h8wrc7eUd6MxzoPMdHR0/ 0Zej+0txriT/LTktSZUdZeUyMJB0YxzdxlrxZCCULe1dICJ0ABY4TmiU3C0a UYdhNaum9FEdhCUCkhgZhtXbGokw5bJWnu2qhTUdXW09JZW3aywTj30Gs2Tz GimEeobfj4PSDOTCmdzDEFY+hmM2YJmqru6qvp7mdVX97c1dx/StLsGkZJ5h Hgm04EYg3k9MrnbNgF5pR8x5BBuYt6ohf2Bsx0HxHzCH4DTxf55rYBdhTH// a6we7/yLVVfH6+vql1Uvq0H/X93c9x/2zPPPPV1rDwh8CmXrgI721l74eyr+ P28v+Ldz0+uXVVR8erSjtbl/8skXLp/a1Hfck2+++OB9B7fPU5+5/dzVzT0b W/dZsiT6pb3iuc25JWcNOp955q+XdH/nlVsvv/WV8fkvfO/q5bnjfvX1TM/S ve/73scPOVjbtu6GitO+cP5qdvKf33nngltD214bOe3X5l/fWbrijV/ZDyV+ lnjK/tdXNh34RfXX9Q/se9+vPvzmxPP1H7r4kmf2OWHks5889ZKfXHxzxZOn qpNbtlx6b+qHG8IHn73w4LMTjY3KggWxiz88aPyo4pA/hb/04MjXmrZe+rPn T2ftygXz589vVR7+8Y9XZ7N/efGzb6w8cJ8HB1c/+oPs0MK9TmMHBS6KDv3r xRd/6c7hZ0+rq6tbv35956JH77333l99uPaA5w7fe/n8rlzutfsvin7l9pOW z7+g/aB5+5z15L4VJzz8zbaKii+fe+6lN/980R1v7/VdeK655t2X7j58Y/ir jyxcu3btom0rVqYMY/+KimOOOca+6MnUxUMVY7VP3nnnnU8++df7vrL0lKbP vQ7l7n7ppZOu7L9v5LqVDQ333X//MUcfvWlwcOvWrQ8OnrhNfbf5zcevHpj/ 0cWJxDs/v7LvmmuueeqGdMsVD798zNVXX/2LawbvOKG698qDzr7zwntTQ0PP vPnm5AtVp/7s+VVbXv3SavbLJ5/sDR60cuXKts8vWrvo9EWL9pl/7oFn7HVP aunKlfsddPRtT5z21r7qQYEPNx94xlH33nffTVteO1HX9c985tJTLvzdH/4w r2K1YRitrftc0N664by9Tvv6zTefvGXLlpGRj3z+6+eff/5ll81/9Ksb2fmb bnv3t0/+x7JPndPU9O7mq3L2giMX9T4zueDIuscOP7355zc/8L8q2LwT0+l0 JjNy3RPL5z/0s59Fly17/K67Rm6o+P2qvfbee9u2bUuXLAkedLTj1FZUvP76 62O1nzrv7m33pn6/4sJ7f3/LLY2HfnHhJ+796U+/8Mhj3/vekk+fd8ihh7Z/ u/ek5Zfdet6Cbc3f6a7f+vrG1+6Z1/3a//lL9YuPfPu5Yy66dO+97z3zY9/5 94FDvmvf1HjjXhdfckkoHE5VH/qTn/zk+OOP3xS58Rvf+Ma115706L+tg9eX l7+s3F79wLOWFv/vgTOWLF1qg4y89tqdJ1Sn4hv1+Wvmzfs8YP3EExtDl7Uf +fobbxxy8MHffPgPp5566quvOr9vaTi77rrc/33t5omTc3f96U+p7w997rU3 bjtv+Xj4wUc+cdXC5+af+6ED97k8cfKx7EDjiR/euX378Z++53cvnXXWWRd3 PvfQ5SufTXQCwQcGDruk89Pz5zsnnVT5sY+BGXzZZZc98OCDYNi/CcK0eNGi l19+uXPghksuueTPf/7z9u3bDzhsWfDSr4+vWTP5/ds+e+sVyU3f//KFF95y zNE3/PKXY8aJ9vL9gNz/41OfevJ6fds3X/9QBTtw3sANxrXXXx8Ohf7pnuPZ gf958823vfLQypsnXjz33HO33zJVEzjjJuvZs1azrOOkrt1w4D6X3GA8/vjj H//4xzdu3Hjd5s+lUinH6X/hsBU1C7q6b/uW+cLeFT3rH7st/dQB8x5586tX /O3li267+D9/+7fz9v3Yp3/90pvP3n/R0jOS124YGHjqppsaDj/88Kkzf/yb 7A3pp0bS6arzTlDV3zz33OPbt3cpF3z+859XFOXfr776+eY3egYH33m0e9W1 G8KLFy9euvSqJy56/cW/jXZ0XKTeOz5+7srlG9rW3nzVjxrOrDphZGTNH2MH 7fORj3xm48bXXn31nr/dl4p/ex6Q5fBT/tI8NvbdU5asWHXp11599dX0UzeA lLz99ttP3WguvfTp60avuPu8Xxy27eXPvXPcwm0rrnj9kfmBHz/++Pgpm7b+ S9sVD4Pg9fX1vfxM9f5XLXv7reNuPI394fnnb9z8i2seeKBzv/32a3vR+cP/ 3rtq67xPLFrc9tZb3Y8dHz8HBHvLS79tm5qaGhy8fDU7f9+/vvXWOeed9+gf ncferN7/lbdOeevVOwDAEz/U7GOv2nL6Ud+4/fbbj736Mwv/dv+zgbPPXvnl 7tdvP2P0xLWHfLKz5dlPHvaR04/4xfzGz717yht/fjp40JJg8J7t22+9/vpX X7jxmWMf+fXHPvrRrs7ON//rv/au+EHq3gunvnvs6Vde+cdD5n3rru88+ou7 X/hTat8PrwiecdjSigva+3t6TtC0185c9fZpq9lfJhubvhY1bzl0/0ULFvzu 9jP2A5Vx/wMP/PR3L708ADJ4zmH1b7/zztZTTnmg54otj/z8p9Xre885Z/9H 9/v1b+44c/ja5fX1x936vSMPnLfPXh/6onrthi//5IRbfvSj6667znz6ptee nnjmjC9+8RPzvvDww0C88cMP/xo0dusn/mXJ6af3/dvRJ461r+u9K4A6A9Tk WXWJ/e94+umnH3vssf0/cscjj8QXLtRe+u2dDz30UC6XSyQSvVf2X/PKxuvH LlD/42N3/OWeed///nlPPfMz7dqRu+5+a6/T+oP/c6+KE9TTbvjBjxuWb/in 4LHbt7cu+crvn1tTffxdygWVfz18xfC1l37ry/+t4qNnJqsPPXCf09jyxsZT Xtz+o3ff/ezExBvf+taRDZcfv2lT5zd6fvX0048++ugBDw2feHT/wMrVVxzQ tKX2579qXBY7YvXkgn/+f+19CTiU69//JJWG4lgmpTSkULas2VNCTrYQRRgM psaMZsaW0IYkRGmTJCEK2U5RlCQ5KglJRYmyi4gQ3vt5nhlmSuec3/v+r/f/ u97ffK+uLjPzPN97+6738rldf8N8EhRoFV35+fzJ93h3d9zGvpcv93dHKOPw KQaSuBuoK8nJQBTMEjRCNiWFhoZKCf756Wn8XA6OjXynK10rolbsJRD2+fqq YT/W1HSKqL0GxkAvuWZRwCL15TjP3o2evfdbypS1RFeIdMfECV1MKH5cH3dQ 6zcy+UqMtfI66dg9l3OKsMKhibrBDjY2YeXOqwCJi7vJ91UnaAJX0pBpF6al ly64VrZXxz83KT/fcK1KznzgoJWX2ec9IjdkXRsaQkksaw0Y2W+5Xe6cRHdp Ka+2Vs9pjnbzpRVOCqaXtAr9B91GaZaSm5KGvo+6Owbvbqgvv5Qs/vRRw9mh lrAc8r1i2zt/bMeevF0UVP4RHflETuttYbq0mfc2xY/GwNnuykGLrFhRfGCU 4uV1MzEx8ZkIXrHjyfnU9+8/j/QUausW8KLuV529OPLunoDwt6ZwgUW7LlxI We3T/bLhRLWcmtr23hP372NQes/LwniBH+Hg4HB2djaXEuQpc6++9JFSCIzz AZ17xcVN797pamoG/GFyZJdHfmnguLGIiIlqk+rBfq+0VYbbBfjv1r2sef/e 1at/5EDJw/dD2lpETY3hjBVHF9WFnjl9WllFpfD27bqGBl4enm/fvr0f8AOC mZ6eXlqqx8cpICAAvE0BWfyL35Wp79W5I813kn18CTpLReILvVpGH3PJi5VW Pdjk7+zs7n6o/Mrnptpi3uRw7iWKZQ/qRBSXvuDQ0NTMdrx3KT6+u6PjVV2d lb090dMz4fz58Ku3LPq/DTyPJzd39F3aGFSltTElFo1WPCs/YoU+W3m5p0e8 7PSmlYGCI+VLrqvsVrk6z8rK6nZh4RYDAw6UuY3NEj4+J3d3GwcHOf7wXXZ2 IKrZlJeNEQ6NXhFQ5D+ogomIVq4aPVwlhBHUupVTWv7wdnVflLmUwqpVN5MO DXxJCSJvc3CoU3t3o955Le4xVuZU5SuiKqcekB+gWzk5OZ2dncA+miXqAK8g zpf/NLfcuTFrt25vU4ChzBmxZ14OMUaXJ8ar/iDfW+3otO5m7oMzp4mT/WXC R0Ml/bQ+dWc3LNe9FGWw97rr5qLLwHU+evTIu/ulkJCQhdTptjZXFAr4MxB7 pVtlnAlKrBDAuy9pKh7fHv3kiaHzlZGn8fHH9D9+HSwLG4rWLbGx07zcaSCI tr+n00EODtht/TX1uOg6XOG1jXw0kNBRqXP1vJycsBISnCiUTuK7hoazsbFX UobVl+vtep1SVCRGtemR9z5qcESB57HryVS1m0VFuqs/biJ0qi4IC25siIgY vJbVXPNWy2di//jE+JEVK1qXR6E49QwNu7dESIWHN6uri1mt/S1pmXE05jmg t2+Bp+3p7JQ2m/g+Omgvp6ahMTY62O7j40O+OxCaai8pGbL3paBWkBbxkbFh cmmb6x43Ny/7iwvijMX5vBSXauk8IxOWXr/WIStD7P7cntEstLSTMtJnNzxM xUdmhKFAP4FwAoRfExMTQO4SEhL8tZp739zqpBUlJjqCMCskZL/nWXMpE5Ni 291NurwFN8LVmrlGe/Ku3t8YGXjYCr37zsvhgQqhDOdjEYO3A0ZkC/L8WmsC eC7XdoLO//JMcv36mlI9QzXJU6XkEv/WP+POFEpp8xtJRFDbVV1dOcXCtbRl m29lD/U0rknpv3Hj/ZUry3vL0jkWhw32NOY9fKgvUXyyudZcU/NOf7+XjU2D YbQosM8Dflq6urqy6iu0/KY6aipSs6yv3r7Nl5Hhc8O2JURBZ3HYs8dc+skW 1tYTeWWOd4XDsBvUzx+X+G1xGHXwk4mNjY0EJu4Y5/OGBncCIf1Vwzy9k9vW 3CkqWszLOw5iUz8/D/6N/v5mJFJ4YU/2Qk57/Ecfk9/NTQ5iz518X94aHveJ e+Qzr75BkUfnQ7ePvzvl2ILA0cLCQkPkUJ/qPL3noPOiRbWNk2skYh2/ioFo SEtUXk7O1FLUxaVW0+et4ovLZcJRoiaBvSruc0mcev2fgx2FVvSqavKFHkrQ jPhtj0nsqVMVFRVvXr+mPaqTRQmi486eXSIiEjA1OZFsGP2yoaGq95pDyYH0 8iLh0BbtAJKScC3UAQ8rAkjvRHH9vbYyY69ylFNUlkSUVz+V1ftiHFPZdvOm Qj3VJqNjPRc3J8eyyOG2SoG9e/eC/gSh+tWroPM2FMRk795bVTlaQ/uarobH k7McPHv0Lnztzj59mrZ2HkbQ1fNNqp2ebIyRgvCJZ3JGn3fyRVck13jQNLRB Yqyj45BJWB8tiV48GeT3iqhhSiY7m1XrHD2FkRVc4kt85WUt/bympiiPmt2F blQYkhM/tNG2iNYZtUKTn59feanPSo2h+ycg0/y6IOhRgw4KJS1dsuHil9eX Ki+OvpvKVLG2+Cq3mqcsJCREeZmJJef8IyO9t6K3WeuU2RbV1Ut02u7Ebd4k ldFSEaW9dPlF5a2YPZwK69cnpTg6K57ftsYyyMFGNoy31s2N552W4kIHh4fq JsZSp0W1/FZW9tI0Jrrqr+/qstyJAk73XfDURI5LRduCF9afiXv3JgPLj97i SSGqTrVVzrfUvlvq8c69gdtk2TFq+6XIyM5LrTt37fKh0a4VmJ9JlkFxc0f0 9BDRIZtA4jM4GL1S18HOrsot72PsQdztzExZCQn92veTZbyL3IIn5py6kCfd i36yWNenJ/3ZG2BLk5Nd3N3TUrn+7PLgmS/AD5E4f7iGhsbr16/37NkDdHS3 vf2mTZtAkviK6ANCyNf5V7d31EkP3ptEoZ53pnZenoN6/qIhUb12qF1X8lrU i7w5egpY7GXAtz7Des+7XZHjc0CYpQWRPZaPRqPl//HHjh07NvG19fTc2Fpu YV3f0FCRcGSsLj50/iM78hbhxCgjCU/Pej8Dqp9fxt3v+P37Dw7rg1xopW7Q k9YB4FOss7uaT4KQ3f6uH4iTItzd3Bzu+uFwuKT0qUJKSv3Veo8NU9/deTlL x0R32aRkZDhaLpFo//IRk8DhRaVqer0/uCbzkGit+d693at/P+PRFSzBf36r aey5o1lyw2VhtNZadd++88NculNvV/N1CA+aS53GJERWyrR2dYWefCNbPTd4 3C4zZsfZFStudDe8Kag4f4G/6Z6uxza5NQIbd+6MTo9VXJiSon2LtLRZXIyr +c4twXDvmzG8WZtRCjxVrooS2bGYdXOoOXtttpKzD4U6LuBtNvRA+06V9C04 m2jXQinMOEvjAlZZeVmmZYqkoPHTvW/TMap2N316twSmXVXgSdxgMfVuaneI wuRgu0ttrXNCzfGIiDtFdcu/qposqasvV33k490H3OyxCE2TZLHe1NX8jYmT Vjnu1Z5t40bOOTeKE1K0F3MdBuJVv1rYaS1ZWlbWxehKY2OLb8+xk1NZ2SuT arYpWNRUPn9u5fyh0Pfd7rFKyYVRUcs81+CEszK6pjqSc1PXFK94UZB/Qtbu U6p2VHGxdliZxSK1SBTf61cgAg0e98z4PpK0mfeTIQqFMkp5XpMcbZaw58mf 6DNv5qlr7Eo2x/KU8S+sq1nvYFETMEr5PXDiGK5zZKgj6ICISHwLTsXNQoPT 3NJSgI/v/YcPV7R3BesusO3vH42NWBIv70Ccj7r/EkN2OXJKc/kpoxPaXCGu E5+7u6+/pIaqznnsmguyrJOVrgkcCq3N2bhtJuGpqfqpxpGlz4vH2zohSl+W 5cl3ptJ1e7pg+Ob0xqDayUW4vEXBBzw5ThqnKPB0a7kA3xrtnnur0/rhuUdX k+ehUAcf2iQZ5W+MnGhf4CLqGI+SkZGhUChGErHPrJ54BOIlsFx8XBv4Kw9v vL+05yWqspVa+Pa6Tbap2TreM6/n42Qw69SmGhZiNFeK+gUGbv0ikHygpK1K fuWe4xjMp9Pnl4LiIsp1g+wnUoVCnAsCA/R37drod1vg0EHDpI1ch9PStsjK PkkM7tOhplpkt1oaiTqWZMZeuJAhSLrgjVqstnKx08T3x4mBZyA2KslbUC0t pl88entlCjhe5blXtpRJc3IE+WDR8/jDz6zb4Zdp2/K1QlfuXcH1trGvS7i4 Qyu6gw6YTBQSmu0VR+MGUidKF6wfHSUcfx2GPff0k5Kwlo7jlefqsUZnzsqT T4TrdX3gqBxYlGPLc/hyV5rkZDHn+w/O1P738gF5p049CBzv26Ae2PLe61X9 13Ui8dVlD76YXbx21rdjw/KxWjMb8aAD6xL2gVRp/hGLpvM1YgdBfhs6v2m8 59IlH41WGU5FxcNt7TfFuJ49uTvW5GsmuE5YeP7r17b+/sCnTZRnEEcpZkcn E2O0St6uuJwhmxTF89A5Z011WJ5F9zH8HP5lYxHqlrtX7O7kCgV83UZ5RUQu pqy+khNpvLrrxJGK1o+XDsc9j5kTrr/9TuRlfa+bfS7c3IcuXJgjZ8OJul+b tiyaey0m7nGxp5h6VMbCFRxY/vA9t347/XxE8HjhbZ/MidcqK97cLSkZfsw/ HtfgoPR9wJumt3jx4gM6jmndbr6+dkuWiLy3nn9Eb/TbyeGenZSxof3FpPxb t4YGamrmliloKSm5HHv3HCbzhMlyCykF1ZetjxZdFXDPO1J6+coVe/DvyOHl 37/3pFvFhoVlxgm9REkGr1/fp2HSAhL+6OXquQEjJOvi3MVzsLTexaiN2/m/ xvEdjFzUd//QR39/C1PTrniZsFXYmKFz1qvUNdQ1NNCHL79eVbzGrjRrZ3JY 9jJqCxioz83DWyImy/PjKy/29V0CJsKD7K7jrwjFaZ6B1fm8pmm1CRcv1gWh nrty9I/c4l2YlF+Qc8LsT6P8bc3yDk9iG3R4yqJFF63QdQj+3Px7SpNEcLD2 fFxwcMDqfRl4Ly/zWpxDk/YJfXECibRjw5HaTaaLxZ822bf23Cgh78x9qCLd ebbvQ3d294fWakFBLTWKPLn1EV8C5poCzykjCZPmG3wJAnLS0nqUDxQoJ7oV pnLpmtRXkWvrdnz/wB/19NNUp5nQBdrjxyvncB7KtCvj05+bl5vLwVH3pr8L gxKNHunvNz9A1OMuKQEJLfmU1RUfGdmcC2NLNTW/d9V3vVORTHMkbncoafPY tyTkgInAkvZDV6dqFl/Zampubg7cn1VG66uFXIc/F6uFOQJLEJyuUvj7+oJ9 OqMSpS8x2cOxD4KeNjXtqN3b1+ER2P9+7dGP/lMT+EfjqQbKXAsWLDgbF/d1 eHjPHkP0y0zuoRFJX9/u4YmlQh9zfeXFCU3Fb9ZN7Tc1q+bkKfviPjn8pqCy sj1O1WWkZ2ducPAN8Sh+tOFQVtbR3XfEg7/p7ay8TUvvTvm9MSjo3uIHtjce 9drKy9/pIUZKCsUcGbrsY2cXf/ZsQw/vTcKHnsbUW+/kdgRUNjSUpLknlmw5 0J0ZP29e9cd7hPyEfftEv7wrLr74uSTge1vlTVsZbjTFrzuz3/r6ARRqg3/u vpE+KRTq9ZudYmIVgp3vBzqysgIpT1O2zd9d8pYyMcatEcgfbbhgnjqIlDPt lhw0SL5tn5SwwkHugXzJ5cAJ76a2q+ZfRRZXRKf1NuZZubdU/fkn8MsuLi6R QiiKBP9OW9sg97QLBk53URh5n6z00eIXbmc4hEPNLnpsoHXokT8vyACpudPT ZfdiY5/uMvVWUYv+1Pbd1iKnqWmioVV/ZaDVZL3NVO4cw5RY4NnN2g3OmUt9 77qevd3S8qPomnrnsUx9GczEyL00VzcH62IJQeOTbyrXOuUETUyaW9Z2dGcn 6gbuL+4yV1dZPTZUm7HKUFRdvfEx1eJroPWOl6fO+HQ+DPe2ysgdDq0SCho0 aWopU04yH3uq5u0YVLjrusDVhhji5j/y8w9irwU6Bppe9C1TuOvTW/7lS+GX qGObDq2z2b96zf6AAIF9G5QjyskeTiDQxNJyIksv78gejoweGeq/uSXJnGf+ 54HWlhcv+hp3fFq69BCBMMnJUXIvMWDAeZA43h63rhjkDB3Lg8S4/qyuTtue Dk0sX+mUPDgwsC/GqO3Tp1QlN7Nqfb9vAyGEPBIPBnPu0aO7752a8szkztqZ m9/EV2F6g/KG3ghkZWYmTIQoyX4bbQye9M8tvF41dGCMIB77egHqoJFEydTk uEbxGcBXaN2OE1FRPjSsRkCBLzl/QDQAIwgyvgWLH4pFR7vGXU5ESQka29ra WlsLxRqA0X6WWE2j1rYGiHEvlZSMP3xY5pRf6fnI5srVq1fv23BxiTxf+mRC gufx40FpXXyTcXPDNi/BkC5qq9U/GBpS/hJjTZ5z0ujq7js+hH02yfr2FyvO K3U7hsiHElrDVr7MtO+MlEgF41mhO1lTV3dUQtHpHO4MyAAdNE4+jS8r+U5R +fKNO7JaNzhwfNjraMy6tWtRqI2Th5+FWciiUCuDhMd1p04p6/qfP2Oms3Ng oGKAy/F2aWnp2NhYXZ2VicNF6/XGqO3pVhKbaKpzOEt1p9RbnidZZ+9wHGp0 3xo8sVfxAXBuHWmJQWgeHv3JsbkGWUez7QsPl7Xk5ubyYX4LbalNi28OHPlj oP3Dp2U8873bjLo0P8vUXM9bISq6hj/8tS72ylELWayGRlFBgdDowbmHnUik tmpdcoImuX/NIaN8Kbnmob47v3+1HrlTWNhpPX4whqN/YGBnIeVjgqavgcHQ Blx87Ifxoc6+a1K1G1SV1YHDNrvUMxY9xaWgIy0hrMklKSHx7du3t4VUw+ys JxVh+snFge/vfwm5GXYDxXmIV+dY+vWqryMNvV/tS588OfF6Vb+RkoqDyFoQ z4nHJCSIYbp4V77w/TyZnhlJuF+culrqcUvYyhcC/He/Fv0uHnNRN1g00uDz qyQ73Ywz6t/PSGzSF+8ceac72u24d43kU+rLuI33A79sfVASWDOmced0peuW LVs2b96s6duXf6vhzVWbqNF52LDyC6MfuHcFTdaODu0n4EOeVtl9ATFFg2vq tXlch0lvb9c0NRUHjvvY2JRVKAlwOwHPMBmyTiItwhqn6P5lMFFUd/J05cX1 733aNmywBdajrcn3bNFt4WvrBCPKQZ61cCFIlIx0q5MwAtwHTdMci2iVtbVK kpILKn8LKDim/yI29lmee/zatWPbxovVZDBxp/WbclaJKym98hNKWjPIXawQ uOShkwIajX7s+iXVJH4oQXDdep1n9wLv5OXnp+XmVgv7Crrm4rfzq6jUy2tr m0dUYfMUJF1Q8U9LDoxSgDMwNj6+lf+0cVJW1kBRUdKnTzkvd7iR5d39/Ixr KcsithQWNm5Pf/jcvKLBgRoVvo8XTdno99a0nRp54sTRkE5VQ/1n9oseHNBZ GVaWrvJYdSF/+IkqoajowXkc6W8tlUWjc/IfnqzcoX8lxMf3QWhNY6P/4CcT Sck0kLmv0lVNOhWiyL3rMYhiMzLWLovECAkV+PTuqi2xHkyKCsXdTk0NrVSe 2lOlUFRUdEknsAhXFpqfr3zqVueoxxz+8DaQCIGhWrfjxrHo6MQ7QYQoeA1w 17j7/kVul4qwXIe7uruBLgEzraSoCHKxT2KWRw7hbCX4xd5ZrQ/137/UQqou F18F8qyqqqrIRM1qaRnM9dxcirOzuLx89dEjmWueaHGtK7EgPlKUcsprLCgo kJWVNTU1BbHu8PDwpbDD5ws1SXv2dHV0HIuMTEhMq39WFsa7lOfRo0iRI0eO tGcquJHmzJ07t76+PjAwUBANzXBbWFj4aTV/c/1NHBPhPh79W7i+rYyPaFFC o8wxb9SpSiIgMjm4PcH3pF+l8vzR06l37tzJzPT08PCYmpwYlKZYY46i2kB3 NWrUxcTEvHy5w8zMjJeXd5W3cZ60tDRhz54Hzjlz5swRExMD/4dKk0zKOfgP 8jc1NcXFxYH0fM2pxsbGTIfi/cNbF+TYnjBItpA6vcdd9lTlGkmICu37Hj7k jDE6cfz4dvve7u4j2MdVVXsPyRhi9MXqPnyGSJ4/3MDAQJgnNDZhpLM2rZGo iokod1LwUN7/ubn4+JLzT93a29vnopwIhK0S/HE3aNes9B3LL6lhSNzPFyeY tg/4iccYrY0zTnlx7pzwFkuQgRBV34BmVC1IxCzOzkBN3sM5pNnfS/qTzKGg dG/h/Sffdedapv75Yl87HqRWWrQttjT6rhQUdqsntMnLHU/CU3D0LUKGptZY Qw8ylYYcLYAu8fYhuOC1vUieFJyvNPrJkz9CoPXtrVtM9bM2OR3+/7W+/u9O v97/wbL1+X9Uxt/gf6oqKf6I/6mmoKTM3v/xv0Hs81/s81/s819s/Cf2OTD2 OTD2ObCfpJG+Y3/m3BcroNP/2uEv1j3jjNAM2TQ+Uzlky/j0znK4zx3pDyPP YiFOSozhoP8EXlQCL26CMIWQE2PwDmboLJQXkX4yyJVA9SLi/BnAPPTjYwjQ EB1Ch4TFoekw4Ex3lshBRXpBWEzIYZ7p6jBwg7CsUOG/RgqXY0UKX8gKFA4/ oUxVdoG25MtTASm7IF/iqF7iMkDiWPHCXcnezkToViDmy0kYvAieoOJueCK8 v18eFOjy40UljHMsASwnbuiw2yRvzxmkcIQYCNwsX0LEuBKIcaEFgsX9zy+1 kJmFI4OXBo5Cwflb/Yjwbaey+4fXAlk/BjA1xBm+OWm9wt8/o/gPnlH6B8+o /INn1iuwPMSAKkcHIhjkUuIsl+rJwPIkTre/sHogX0MjL824JgP6eeamDCyM bw6Bm0N3ZcBcwVfgEeg7+F4HLXkg1v/xJyRY0kT4kITi/7UzEv+X6df5P5P7 /B+W8df5v6KSwnoVOv63qprKegXo/IeyGvv8x/8KsfN/dv7Pzv/Z+f+/Tf5P T7AYGf/f4vCw03522v+fAP/COgPAKulQCazSPisOzGw+AzgAxFOAJ+Eh+gVY DPpvwWIg0Fn57Vs2y0I6sF5RFsIOUIBQaJUUVBWVWWBkttJAWo/AwuCYLT8o lIFxOg2uAPptC3L1IHT8HxFNJEqg33xKnQWjGIaQdSVQgB8k+k9niTBgAIQO A/NggnIAf2wl+ZD34kH04Emm4bE2eGcsdMErGMC/ZQ//Pl0Ga82QMpBRZx6O v8DPgVFzSRAGN41Cn60g4vzxFCzkXdBQ7XE+ZAIMegskneDljdgnaDYGuRUR tAHkpdRpTGHwA8gfcWgqfN+ZN/hpVkwcYHbwrlhmoIz/BgoPXHvAY1awCGZR g/A5EFlAoGxnayyMagL62gsk29RfcqXhXYDouMl5ebvIUghkOWcKcnLdZS8e qZwl/CcCEQMVqAe6BI5FwBj+UJglU2mzFkYgsRQU5AzhS5CpdGSVaTAVrIKc MlIYA6qZRXWZfQyiusx+ZlbVhbqMoZkQ+AmZiiyD47Aw9Lgn0HwgP1Ja01cY Q72tJQ9/lEZDowKhZYNkHZgTKowljEWepc+pzTyNwJgjfOArjpl+Q0aLuURP 6CZwZzyCIAzDGcNA3Mj7dHQWOSAcHszcITQRMvgPRH6+ZCyCBA3BQ2Fnqs94 HFEyMjK9CLFG/5I1UjmIG50PNG5U5pZBPck0+PQmIOgkdEByGBwZHg06OjJT neSRvvrvVG1WiCjWUAFGimINFxiSwPI1DNGBI/ri/Kkzmo4IAxPaFt7PBe9F QyMWgSqH1cMyM0FkCn6UMYsLQYtgYah9hBf0nRYO/S9YAnnoclW64wMVMYPh rNEmDGQeBJAFYTsLrMo/tjB0LYDx59FIEzxw1B8xs0ECBuwJngKCXIILldmp QMYeh6V64eFrD9wIeDDqLsh4I+NHw7kzhhh2GBBner9JUtHQ2GkiZv0HVtNy NQtPaPb3R6boaabw5DAMPE5FMItIQE8ZwEXSzKWx1AW0kkB0BSENLBJQNA+B 19OQPsZ76sCTv7Ab1pIHHyE4K+gn5NpaIBHw60BzEbmHVYMC/ApkYuieBORm LGIjhZtBdGPqbcCVSkdOowCNmoZJYvg9D2UdvekWArFWZr6zgHkcfu6saeOH lAmDy8EtpcJtYa4daz/C4EUEChUN9cQaIk1zL95/jTtNUxv6G4IMwkOf4I4B ogTdakD1pjA6AVgmKYIbmoR3gRw5xV9aBkEGw+/zhgJIGDgPvAhYwgyoM9YD 60UEWS1jGNCzDwPSDGQcZnEQ9AQAkvYfkgCGQYCtMGK9fjaZ01hKVBjb3ZmZ BaTmaMbawUxABX1gCVyY7/uAbbQ3yYUFgp6uSVgqckM4EeiZLPy3BpZEJuHF mdaq6LnITBQMS7KWsw5SdeR3KRzFnSqN1YYGBcu4jpzeIniGwZkCxWqbvAkQ iBQOqS0D5A9Ln0VBLiNA2CJLIKyMGJIiBziBEBSYbzzBBz9jCqfVfUa0Ybmk aqCZ0MtYaj+9zMBUV2j9DNEfmCEQKevtWyEkIXhFjL6ANrM+QXfa8CoQw2MD +UEEmWGeobUyPJUm83MNkMWrXxcPvY08AxQEKnUWHvSFLRYmkFUBggt0nrl3 SKDDKUCegOiD4WLOCf429Z2lXGhSDE9hLlYK0hiGJYX1RZrZUyEvUJkDHQ0j ZiaMEjWZ052/qhrsU2hksvQs1YNnqUA9HGcd5Z+rqgk5UJw3EVqwFBeXnmUg nBgsJX8hABoQ09nKBV9Ph3Mz4HNWsGhQoSKRdVukPCZ9mLaSDGWRwzJUEy3O SPh/pZv0bEsKkR9HUBIEj4Zn6Ol09WTQ9Cdg+WIa9R/0Vx9CcqPiPemZH6sS g1aTYVNPhiMHBBeUSUf/SdvQMx0CB0oaP+oawgQMNuNdWYZvY9GR6Qdh8Laf 7AM9LZ+5GQOqxCayq78cegsOBJMMnowrUZDX6eibOPSMd/0XhJTVp/6AIUef boEh5JinXP7SYcixxrPMfgMLXQLiKosjAluORR6jo/j5kil7qUzpGXxZzizZ I/p/lKNZsRphuveBCqJnzq7/uiNCZpR+JerwpgLEC/3sduD5ChecFxVKtulA sfALkAFk8mI/p1CMqTT4A+AEdxx0YQ6JRMelhHFxkb5E8i0o1vBGygDV8Z4J +r0g3XGlL4lARmCWkqe7ip5nTSsDXZFcp8PwaQYsVZxm8P/QR3pTiH/tnqy3 b2NoEhWZdEEuBgJjTSO7kIlM4dVMZseoMJnCnO7Rv5WhZ3X0LSZIb0KT5Ixy WJJf5jfpajKbO5jZP/LXzYGjS9aCIGXWY36V7slmKYUdUbAjin+LiAIxOtOY 2PQcG+E80xGzrRkwjB3DlvzSC2P/FS+M/dkG/YUfZso9Z9CmIT2nY03Ds32Q kYTfgc0yPCUFWknBkahwsgTPDjIlrHpAgl2Ru7iY8/1fOVZWuzI95QvZXg+c M4FIoMGz7FQ8Cblzjm5rf5hCRjwGiT4/OeM4YCcJXycG3dVHwiOeAdqXhyMh k2uwh2KMgQyICKDUlQBHikzezBUNB15wdyKhA+uddCAMI2HdgN2TYTac8LrM Dy6HQIKyeRqznMyYfjTDl0G1hLcwIS3zhVLhaUM/PYj05jNZfnhYoBUcV6jl SCTwo3egZ7lQV3hQyN7uwFROVw/98/hoEXQYTLTkCTpMvgPq2B9+hQNs9HRj p2UQVg5mzHDsdDwDxHjGNcnRDS6jP2YcrZXHr4SHaRYEjiPxftAq6o8+fpaW sUgeAYaqt8S7sNSH+qsK0V2nLwVIyD9rC0NG0T/KKOTGIbh9pvgN54MjEGEt RuSRPmHOwMJXkFOWZrrW8m9aRte86Ul7t9lw6/8S8nxmKWSTP8uMFlRV6PJJ EM7LYOEoGBYyeALddfr6yB80jiEvaGd/7B5oZnxalZCpiemOgHeS4Ih0dWDu ZObuBbENenrkWMZs1gll5sVOqG3MC55wImBEtxfQUgIVzk4oeOLPdzNqYJmm SmeN51lviGCs9YGO/ftnZuJvhoX+j949ybRYjQBMK9A3T26QB39CmyeVNZQV 2Jsn2cQmNrGJTWxiE5vYxCY2sYlNbGITm9jEJjaxiU1sYhOb2MQmNrGJTWxi E5vYxCY2zUL/BTTj9w4AQAEA --678920-695260830-1255516737=:975-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 08:09:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EB9Qim032752; Wed, 14 Oct 2009 08:09:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86C6618C94; Wed, 14 Oct 2009 09:08:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4171718BF7 for ; Wed, 14 Oct 2009 09:08:14 -0200 (BRST) Received: by qyk26 with SMTP id 26so9247637qyk.5 for ; Wed, 14 Oct 2009 04:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gKSoObZQxgujKsPWIiUEX9hMk9iha99UwgCGQZwIn2c=; b=u3JgNUp+Q0QkQjNs/UddLG1FiJg6nVPj9Fytpm6rTqwLuHfjEUSbDB9+8HQPfbqiVP g1sKZoOgsSf1UrujD3Y5nu2DgYieDAgZ8yU+1Z3x6EdsqVTFQVMlSMUm/G3n4KWJ6CFQ NlJ6qJcy/ml4vSoUItj+s/JEtuOMoRlJzj3PU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gUyNSVeD3mKWjrKUu2BhPV5w7UAMW/y/Py1HV712CE2DF0l2CCAPBcB+EhJzDiQS2q 5Q8KNF7saLT428m/IqTZUtRway82SEFOST2kwN5v0JKF0YAU5MRsLy1Un7VjXX1YrcrK xGsgPZQN6NdaiAWqByRW47ESVA7nma1NnZk4k= MIME-Version: 1.0 Received: by 10.224.70.133 with SMTP id d5mr6894181qaj.211.1255518536296; Wed, 14 Oct 2009 04:08:56 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Oct 2009 13:08:56 +0200 Message-ID: Subject: Re: A simple SOAP client From: Thijs Koerselman To: Lua list Content-Type: multipart/alternative; boundary=00c09f86da1a5d6a770475e330ec X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f86da1a5d6a770475e330ec Content-Type: text/plain; charset=ISO-8859-1 On Wed, Oct 14, 2009 at 12:38 PM, Tomas Guisasola Gorham < tomas@tecgraf.puc-rio.br> wrote: > > > What is going on here? Am I trying to use an outdated version of LuaSOAP? >> > Sure, you have a wrong version. The future version will have > a file client.lua (instead of http) which allows HTTP over LuaSocket's > socket.http module and HTTPS over LuaSec's ssl.https module. In the > new architecture, it would be simple to add another communication layer > by providing a function with the same interface as socket.http.request() > or ssl.https.request(). > I am attaching the distribution file (beta version), so you can > check if it works. Let me know if something goes wrong. > > Thanks a lot Tomas. I'll give it a try and let you know in case anything goes wrong. I just got the old LuaSOAP to compile, but I'll use this one instead. All the best, Thijs --00c09f86da1a5d6a770475e330ec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Oct 14, 2009 at 12:38 PM, Tomas = Guisasola Gorham <tomas@tecgraf.puc-rio.br> wrote:

What is going on here? Am I trying to use an outdated version of LuaSOAP?
=A0 =A0 =A0 =A0Sure, you have a wrong version. =A0The future version will = have
a file client.lua (instead of http) which allows HTTP over LuaSocket's<= br> socket.http module and HTTPS over LuaSec's ssl.https module. =A0In the<= br> new architecture, it would be simple to add another communication layer
by providing a function with the same interface as socket.http.request() or ssl.https.request().
=A0 =A0 =A0 =A0I am attaching the distribution file (beta version), so you= can
check if it works. =A0Let me know if something goes wrong.


Thanks a lot Tomas. I'll give it a= try and let you know in case anything goes wrong. I just got the old LuaSO= AP to compile, but I'll use this one instead.=A0

All the best,
Thijs=A0
--00c09f86da1a5d6a770475e330ec-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 08:25:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EBPt2a002005; Wed, 14 Oct 2009 08:25:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8200C1A5DE; Wed, 14 Oct 2009 09:24:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C082519276 for ; Wed, 14 Oct 2009 09:24:41 -0200 (BRST) Received: by ewy26 with SMTP id 26so1578517ewy.5 for ; Wed, 14 Oct 2009 04:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=K5biFuvatruUe+72sDrBrByUaIJp7VLhKEdnS3urNEY=; b=FkeNAxdzzBuvKE8zvn0pA9S9laqK63kZS8nCmXHKgg4zI+wp9v2rnM3CjXGUZ8NvFg E5aWVmg45VfshaO2moPc86ZP6SA1KjF7PS2GLr4PYA3AZJCjvLYQGf54DzYhau01S1O/ cO/4S4MI/G02kM1I5SwcXfPH7YlcJnyGt9gXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=WRsQbhJyrHn4NFte7lRCkSbLEeyrakLdILMYQRnU7ObIstvfCcluIg3PZdE+Grg1tN a5gPEp1Z6JLBEeMl3aaAx2gY7vez6qBzDz/Z5uSlzsW/ByB62HcC31mXgnwOjPckxCqT hLqnvGmodv+1OLNO/oWC/TH50JbsSv0D879ec= MIME-Version: 1.0 Received: by 10.211.159.11 with SMTP id l11mr10163339ebo.78.1255519523436; Wed, 14 Oct 2009 04:25:23 -0700 (PDT) In-Reply-To: <20091013183511.4a4dfced@egeria.whoopdedo.org> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> Date: Wed, 14 Oct 2009 13:25:23 +0200 Message-ID: Subject: Re: Addition of map() and filter(). From: Eike Decker To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9EBPt2a002005 2009/10/14 TNHarris : > On Mon, 12 Oct 2009 23:16:12 +0200 > André Ericsson wrote: > >> local LOCAL_ToStringAllTemp = {}; >> function tostringall(...) >> -- etc... > > That's rather ugly. > > I've learned that recursion isn't a dirty word in Lua, so it's not at > all difficult to write a 'map' function > >    function map(f,...) >      if select('#',...) == 0 then return end >      return f((...)),map(f,select(2,...)) >    end > > Which could be optimized to use local variables only. However, that does > demonstrate one thing about Lua that I didn't expect. This... > >    return something, F() > > ... isn't a tail-call. I thought it would be, but the comma operator is > enough to prevent the optimization. I think it would be a worthwhile > change to the VM to allow a tail-call in this case. > > A function that I think is better done in C than Lua is a > complement to 'select', which could be called 'shift'. > shift(n,...) returns the values that select(n+1,...) skips over. > > -- tom > telliamed@whoopdedo.org > Tail calls don't change the stack's size, thus preventing the stack from overflowing. If you would however keep the stack increasing just the way how your code intends to, what would be the benefit of optimizing this (rare) case? I mean, sooner or later, a stack overflow could then happen as well. Eike From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 10:05:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ED5LlZ019091; Wed, 14 Oct 2009 10:05:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22EE61929E; Wed, 14 Oct 2009 11:04:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E351518BD6 for ; Wed, 14 Oct 2009 11:04:02 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9ED4i2q006849 for ; Wed, 14 Oct 2009 10:04:46 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 0179554C14E; Wed, 14 Oct 2009 10:04:44 -0300 (BRT) Date: Wed, 14 Oct 2009 10:04:44 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Addition of map() and filter(). Message-ID: <20091014130444.GB8692@inf.puc-rio.br> References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> <354DE197-2A76-427E-A11E-3045C0969C24@grubmah.com> <200910132203.21477.javier@guerrag.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200910132203.21477.javier@guerrag.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Mark Hamburg wrote: > > On Oct 13, 2009, at 3:35 PM, TNHarris wrote: > > > return something, F() > > > > > > ... isn't a tail-call. I thought it would be, but the comma operator > > > is > > > enough to prevent the optimization. I think it would be a worthwhile > > > change to the VM to allow a tail-call in this case. > > > > This can't be a tail call because it has to process the results of F() > > to combine them with something before returning further up the chain. > > Note that even Scheme can't tail-call similar constructs The definition of what is a tail call is language independent. I guess we would have to change the concept of tail calls to support such constructor. -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 10:08:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ED8JTX019892; Wed, 14 Oct 2009 10:08:19 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21CBC192B9; Wed, 14 Oct 2009 11:07:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EF3219276 for ; Wed, 14 Oct 2009 11:07:02 -0200 (BRST) Received: by ewy26 with SMTP id 26so1676830ewy.5 for ; Wed, 14 Oct 2009 06:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pM6D3OL0TaULUmQaf6SORvRnFefdb+hX2RseKtyvPxE=; b=C4nun7YoU6iDYPDFIa+IxfQzrqdD+8q1a9LhRY3vbtFkMVR81mK+K9sOmwoh1NyHcw UWIyN8pQMPp54FXgx7mN0UkGACkKN3SxEZMKMLpIJipI8zVotE2TW5s7pkx6SHSPrIUl TIJ17bOK3DOxKjjgLvkc1KDOAtpxpLQtLxcPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=o9kvB63dTBbf4TLxz4nvrA3iwTF0DPEM1G54KilIBHD1WdqDWjJbx1Ko3/Ruwq1/WA Ov9+6uh5crteTrfkc+b+kZYHTW0kfliGcZIWbYhk2svfFuW+rIZcUbxISIyt4YtGFbYE En3P/Nrpean/TqbD0kCiyE2DUB2H1fA+ThNtQ= MIME-Version: 1.0 Received: by 10.210.7.11 with SMTP id 11mr7469897ebg.5.1255525665411; Wed, 14 Oct 2009 06:07:45 -0700 (PDT) In-Reply-To: References: <27b7d0b60910121416o1afae584l6a7edc0e29dfa50d@mail.gmail.com> <20091013183511.4a4dfced@egeria.whoopdedo.org> Date: Wed, 14 Oct 2009 15:07:45 +0200 Message-ID: <13af99c70910140607t350b80d7ye440fad4247770c@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1f92c4b13a90475e4d98d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1f92c4b13a90475e4d98d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Oct 14, 2009 at 1:25 PM, Eike Decker wrote: > 2009/10/14 TNHarris : > > On Mon, 12 Oct 2009 23:16:12 +0200 > > Andr=E9 Ericsson wrote: > > > >> local LOCAL_ToStringAllTemp =3D {}; > >> function tostringall(...) > >> -- etc... > > > > That's rather ugly. > > > > I've learned that recursion isn't a dirty word in Lua, so it's not at > > all difficult to write a 'map' function > > > > function map(f,...) > > if select('#',...) =3D=3D 0 then return end > > return f((...)),map(f,select(2,...)) > > end > > > > Which could be optimized to use local variables only. However, that doe= s > > demonstrate one thing about Lua that I didn't expect. This... > > > > return something, F() > > > > ... isn't a tail-call. I thought it would be, but the comma operator is > > enough to prevent the optimization. I think it would be a worthwhile > > change to the VM to allow a tail-call in this case. > > > > A function that I think is better done in C than Lua is a > > complement to 'select', which could be called 'shift'. > > shift(n,...) returns the values that select(n+1,...) skips over. > > > > -- tom > > telliamed@whoopdedo.org > > > > Tail calls don't change the stack's size, thus preventing the stack > from overflowing. If you would however keep the stack increasing just > the way how your code intends to, what would be the benefit of > optimizing this (rare) case? I mean, sooner or later, a stack overflow > could then happen as well. > > Eike > For buggy code, yes, this would mean that tail recursion could overflow the stack. For proper code it wouldn't be a problem. While you'd increase the stack offset by one to insert your prepended value, you'd also remove that same value from the varargs in the stack, so you'd end up with a constant stack size. --000e0cd1f92c4b13a90475e4d98d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Oct 14, 2009 at 1:25 PM, Eike De= cker <zet23t@= googlemail.com> wrote:
2009/10/14 TNHarris <telliame= d@whoopdedo.org>:
> On Mon, 12 Oct 2009 23:16:12 +0200 > Andr=E9 Ericsson <eandre@gmail.= com> wrote:
>
>> local LOCAL_ToStringAllTemp =3D {};
>> function tostringall(...)
>> -- etc...
>
> That's rather ugly.
>
> I've learned that recursion isn't a dirty word in Lua, so it&#= 39;s not at
> all difficult to write a 'map' function
>
> =A0 =A0function map(f,...)
> =A0 =A0 =A0if select('#',...) =3D=3D 0 then return end
> =A0 =A0 =A0return f((...)),map(f,select(2,...))
> =A0 =A0end
>
> Which could be optimized to use local variables only. However, that do= es
> demonstrate one thing about Lua that I didn't expect. This...
>
> =A0 =A0return something, F()
>
> ... isn't a tail-call. I thought it would be, but the comma operat= or is
> enough to prevent the optimization. I think it would be a worthwhile > change to the VM to allow a tail-call in this case.
>
> A function that I think is better done in C than Lua is a
> complement to 'select', which could be called 'shift'.=
> shift(n,...) returns the values that select(n+1,...) skips over.
>
> -- tom
> telliamed@whoopdedo.org=
>

Tail calls don't change the stack's size, thus preventi= ng the stack
from overflowing. If you would however keep the stack increasing just
the way how your code intends to, what would be the benefit of
optimizing this (rare) case? I mean, sooner or later, a stack overflow
could then happen as well.

Eike

For buggy code, yes, this would mean that tai= l recursion could overflow the stack.

For proper code it wouldn'= t be a problem. While you'd increase the stack offset by one to insert = your prepended value, you'd also remove that same value from the vararg= s in the stack, so you'd end up with a constant stack size.
--000e0cd1f92c4b13a90475e4d98d-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 18:09:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EL9XGP008634; Wed, 14 Oct 2009 18:09:34 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8DC51926F; Wed, 14 Oct 2009 19:08:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0148191D6 for ; Wed, 14 Oct 2009 19:08:03 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so64975qwb.11 for ; Wed, 14 Oct 2009 14:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:dkim-signature :domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=/TvFQt9p3Z4EXQ4wo/a8I5vOVmFWTjHE65632unRldg=; b=hrUwloBE/sC5sCAodhuvEkQlb0g1U+GVu8a985fhmWtrI56B/ZlEsodwooopaF7+yr HB/OCXzXgNtkL8uTRXi+CUN5AerKG2U17doIONZWQiSJwB8BgPdA7pLjTvy/RV84WY5V nBKE8qyn121VlV515uxufRSgLJOlftnCbU/Rk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=dkim-signature:domainkey-signature:mime-version:from:date :message-id:subject:to:content-type; b=LsmvMOprDCjww09QeW/wQbIJ7ImMBNZ9zDrP6OIyJCwDpSE5FTWgstU3dbdcWAQ+pe 383fggWYxTMsJK6txGyEYXpfB8T8JE8GCryo4VNAVGvfqksiMkcJ9y/ckMr+JsXJtxZM 94u3JTrFN0EqW4n5DZ008Vadqn5ljb4jd38+4= Received: by 10.224.126.209 with SMTP id d17mr7596165qas.155.1255554526369; Wed, 14 Oct 2009 14:08:46 -0700 (PDT) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by mx.google.com with ESMTPS id 7sm3823521qwb.52.2009.10.14.14.08.44 (version=SSLv3 cipher=RC4-MD5); Wed, 14 Oct 2009 14:08:45 -0700 (PDT) Received: by ywh5 with SMTP id 5so218728ywh.11 for ; Wed, 14 Oct 2009 14:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=/TvFQt9p3Z4EXQ4wo/a8I5vOVmFWTjHE65632unRldg=; b=EpOE0rVFWV9A8zLvlIQNEF/OUUMuhzCexCACqx4iaCpTgo6k9QaHO9SDus7k7DYgHp jLYfr9/oiaf9BJ3TThk7tW5JmZicv/fkQo0NPAb00OZL9uWfkQzofwDJtaiGmIOW03gC etr4RnbEatk6TJ4Fw+SmrztbgbhG7C+mqHnhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=dqMAxPg32w2+zzXv43V9Mm0mJXxIbewW55gQJIi6BMlZs2Shan5DoIQ/+l+S6AdX7I v5vBXy/SS4A/ulchwcTWTa/VxjP8RP9okcV1veSgAymTq/rOy/hoqOXbTTSIxj8r8ZLx S1E/ldRZRsmUvBJuO4+NAZ2jTKU7RhaiWIlFY= MIME-Version: 1.0 Received: by 10.100.235.4 with SMTP id i4mr7853273anh.101.1255554524417; Wed, 14 Oct 2009 14:08:44 -0700 (PDT) From: Mike Crowe Date: Wed, 14 Oct 2009 17:08:24 -0400 Message-ID: <16d4c3590910141408j9ec6748ua8ce8de61b673bde@mail.gmail.com> Subject: LuaRocks on Wikipedia To: Lua list Content-Type: multipart/alternative; boundary=001636b2b2806c8dd10475eb91c7 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b2806c8dd10475eb91c7 Content-Type: text/plain; charset=ISO-8859-1 Hey LuaRocks folks, Was reading http://en.wikipedia.org/wiki/Package_management_system today, and LuaRocks stands out as incomplete. Anybody online willing to take a stable at writing it? Mike --001636b2b2806c8dd10475eb91c7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey LuaRocks folks,

Was reading=A0http://en.wikipedia.org/wiki/P= ackage_management_system=A0today, and LuaRocks stands out as incomplete= . =A0Anybody online willing to take a stable at writing it?

Mike
--001636b2b2806c8dd10475eb91c7-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 18:46:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ELk3su015521; Wed, 14 Oct 2009 18:46:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1245319271; Wed, 14 Oct 2009 19:44:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD2C919271 for ; Wed, 14 Oct 2009 19:44:43 -0200 (BRST) Received: by fxm12 with SMTP id 12so328272fxm.5 for ; Wed, 14 Oct 2009 14:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=f4II5q03ROpNBnuUfCIGMNWL/y6eh6sEhyYMsw0HYtU=; b=G2s0DUksOs5hqReG38cn34unBaPjGxf8OkrKTz6wwEHbhidQws7twFHQRF9nldVIfU SAuRSRufMMwFsWWYmiVHlYz9FRWaUTgSPrKBBdIN7mHZNOtAQA+LjH8raGsHkD2mrTJb 05ms0av+Kgm/CDm3dpZWsr9lqdt6/1YidRHRE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=U17UBd3A+RCrNHRFz4K9Tr6stbTfHdykayckMhKPz/HvWFPqClzfhDNMAcZRInfx6a KCshZMG9jHqa3deOV5eiL30Inc/IoQHU+7ZlLLVpg146kqB4BSwFRSnC40o1qh/6oZp0 6IBEfOVr6teTumTSdBTfYi51t84VX0/YBuEKg= MIME-Version: 1.0 Received: by 10.223.161.205 with SMTP id s13mr2136409fax.70.1255556724737; Wed, 14 Oct 2009 14:45:24 -0700 (PDT) Date: Wed, 14 Oct 2009 17:45:24 -0400 X-Google-Sender-Auth: 076f8e9fae98d3e0 Message-ID: Subject: Re: Addition of map() and filter(). From: Jim Jennings To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9ELk3su015521 >> >    function map(f,...) >> >      if select('#',...) == 0 then return end >> >      return f((...)),map(f,select(2,...)) >> >    end Recursion and tail-call optimization are the right ideas here, of course.  Given this particular signature for the map function, I would write: local function map1(f, a, results, i)   if i==0 then return results;  end   results[i] = f(a[i])   return map1(f, a, results, i-1) end function map(f, ...)   local a = {...}   return unpack(map1(f, a, {}, #a)) end However, there are good reasons to consider using the classical signature for map instead.  In other words, the arguments to map could be a function and a table (instead of a function and a series of arguments which implicitly form a list). > =map(function(x) return x+1 end, list(4, 5, 6)) {5, 6, 7} > Using this approach, you can map multi-argument functions, and you can also write 'reduce', which is another handy utility: > =map(function(x,y) return math.sqrt(x^2+y^2) end, list(3, 6, 9), list(4, 8, 12)) {5, 10, 15} > =reduce(function(x, acc) return x*acc end, list(1, 2, 3, 4), 1) 24 > Note: These examples use my own list module, which is why there is pretty printing of lists such as {5, 10, 15}. One could easily write the same functions (map, filter, reduce, foreach, member, etc.) for "tables used as arrays", which I think is what the original poster was thinking of as an approximation to a true list data type. Since (1) tables are not lists, and (2) list-processing functions can be implemented easily in either Lua or C, what is the benefit of incorporating list-processing functions into the Lua language?  I don't see any benefits. --Jim From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 19:44:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EMiIjW024076; Wed, 14 Oct 2009 19:44:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 008E318BCD; Wed, 14 Oct 2009 20:43:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE9D918885 for ; Wed, 14 Oct 2009 20:42:59 -0200 (BRST) Received: (wp-smtpd smtp.wp.pl 8844 invoked from network); 15 Oct 2009 00:43:37 +0200 Received: from miko.ras.wp-sa.pl (HELO [192.168.254.110]) (miko@[212.77.97.9]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 15 Oct 2009 00:43:37 +0200 Message-ID: <4AD65419.9080704@wp.pl> Date: Thu, 15 Oct 2009 00:43:37 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: A simple SOAP client References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [AePk] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thijs Koerselman wrote: > But I seem to be missing something obvious. I copied soap.lua and > http.lua from the LuaSOAP library to my script directory. The script > starts with: > > require "luarocks.require" > require "http" > > This triggers an error about "luasocket" which can't be found. I > initially thought it had something to do with luarocks, but it seems > that in http.lua there is a line: require "luasocket" which I think > should read: require "socket". No, it should be left as it was. You should install luasocket (which is a prerequisite) either using luarocks, or with your OS package manager (if it is available). > After fixing this error I run into the next in soap.lua: > module(arg and arg[1]) which gets a nil argument. Then I change this to > module("soap") and I run into the next.... Change it to: module(...) It should work then. > What is going on here? Am I trying to use an outdated version of LuaSOAP? Yes, but with above change it still works (I just run a test, and it seems to work). Regards, miko From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 19:55:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EMtGwf025359; Wed, 14 Oct 2009 19:55:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AF0D19289; Wed, 14 Oct 2009 20:54:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s14.bay0.hotmail.com (bay0-omc1-s14.bay0.hotmail.com [65.54.246.86]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9C0418AF1 for ; Wed, 14 Oct 2009 20:54:04 -0200 (BRST) Received: from BAY121-W30 ([207.46.10.65]) by bay0-omc1-s14.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 Oct 2009 15:54:38 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_1edec876-ab59-4203-b1ce-7eaa2a97a79c_" X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: RE: A simple SOAP client Date: Wed, 14 Oct 2009 15:54:38 -0700 Importance: Normal In-Reply-To: <4AD65419.9080704@wp.pl> References: X-OriginalArrivalTime: 14 Oct 2009 22:54:38.0281 (UTC) FILETIME=[4EAEAB90:01CA4D21] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean <4AD65419.9080704@wp.pl> MIME-Version: 1.0 --_1edec876-ab59-4203-b1ce-7eaa2a97a79c_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Date: Thu=2C 15 Oct 2009 00:43:37 +0200 > From: miko@wp.pl > To: lua@bazar2.conectiva.com.br > Subject: Re: A simple SOAP client >=20 > Thijs Koerselman wrote: >=20 > > But I seem to be missing something obvious. I copied soap.lua and > > http.lua from the LuaSOAP library to my script directory. The script > > starts with: > >=20 > > require "luarocks.require" > > require "http" > >=20 > > This triggers an error about "luasocket" which can't be found. I > > initially thought it had something to do with luarocks=2C but it seems > > that in http.lua there is a line: require "luasocket" which I think > > should read: require "socket". >=20 > No=2C it should be left as it was. You should install luasocket (which is > a prerequisite) either using luarocks=2C or with your OS package manager > (if it is available). >=20 LuaSocket is loaded with require "socket"=2C despite what you might expect.= At least in my environment=2C and I don't believe I changed any LuaSocket = file names. =20 _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/= --_1edec876-ab59-4203-b1ce-7eaa2a97a79c_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

>=3B Date: Thu=2C 15 Oct 2009 00:43:37 +0200
>=3B From: miko= @wp.pl
>=3B To: lua@bazar2.conectiva.com.br
>=3B Subject: Re: A s= imple SOAP client
>=3B
>=3B Thijs Koerselman wrote:
>=3B >=3B >=3B But I seem to be missing something obvious. I copied soap.l= ua and
>=3B >=3B http.lua from the LuaSOAP library to my script dire= ctory. The script
>=3B >=3B starts with:
>=3B >=3B
>= =3B >=3B require "luarocks.require"
>=3B >=3B require "http"
&g= t=3B >=3B
>=3B >=3B This triggers an error about "luasocket" whic= h can't be found. I
>=3B >=3B initially thought it had something to = do with luarocks=2C but it seems
>=3B >=3B that in http.lua there is= a line: require "luasocket" which I think
>=3B >=3B should read: re= quire "socket".
>=3B
>=3B No=2C it should be left as it was. You= should install luasocket (which is
>=3B a prerequisite) either using = luarocks=2C or with your OS package manager
>=3B (if it is available).=
>=3B

LuaSocket is loaded with require "socket= "=2C despite what you might expect. At least in my environment=2C and I don= 't believe I changed any LuaSocket file names.


Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up n= ow. = --_1edec876-ab59-4203-b1ce-7eaa2a97a79c_-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 19:57:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9EMvbAA025725; Wed, 14 Oct 2009 19:57:37 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC52D192FD; Wed, 14 Oct 2009 20:56:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f220.google.com (mail-ew0-f220.google.com [209.85.219.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C32A3192CB for ; Wed, 14 Oct 2009 20:56:27 -0200 (BRST) Received: by ewy20 with SMTP id 20so347232ewy.40 for ; Wed, 14 Oct 2009 15:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=BgLx7ZELz4KlhU+6OGt4ZG4pbX1P9gai0tv+A/9bZBI=; b=snMHf1iPeJkOn9h88dDTj8HvJXDqjwCa9lZ4jZp5Xbep7zNQtggEGhxJ40FszNccKM xbqNugNOnzeO5GIW4I4v5MlqZWPMAFEiLWI0yxuF40TeV8a/IcVg8XhapLLS14Z+/Bg+ k21nthK1LMhHCsTmr9BXqvzpv8lnplffagofA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=A/K6kPTFMKbtlEnMQSe/bjG0NlXpq37tprIJsbNI31T6PL0mw+rdwn+XB6KQzhjL/A LvUMsqyttGrDxk9L6HHYNyLbTQrhALBsGOepBOTSPFLqpZOv4eUHceHAfmoNRVF3COqc IqbwGeJKAJ/+wrsd5Nd0BqdhcDu3aomheb1EI= MIME-Version: 1.0 Received: by 10.211.147.25 with SMTP id z25mr7909737ebn.84.1255561030501; Wed, 14 Oct 2009 15:57:10 -0700 (PDT) Date: Thu, 15 Oct 2009 00:57:10 +0200 Message-ID: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> Subject: Testing LUA: verify the correctness of a UTF16 LUA port From: uri cohen To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636c5b8d83786220475ed15dc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5b8d83786220475ed15dc Content-Type: text/plain; charset=ISO-8859-1 I was able to create a UTF16 port of LUA for windows, by following the guidelines I found at http://lua-users.org/lists/lua-l/2002-12/msg00021.htmland the considerations from http://lua-users.org/lists/lua-l/2002-12/msg00025.html. This is a version of LUA where all internal strings are UTF16 (wide characters) rather than chars, not a version with two types of strings like LuaState. My question is on how can I verify my port works? Other than toy scripts I created, I'm looking for a comprehensive set of tests I can run in order to verify all important language feature were not broken... Any ideas if such a set exists? How does the correctness of changes in Lua 5.1.xx is verified? I saw there is an official test suite at http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gzbut I'm not sure if (a) it should work on Windows and (b) it is supposed to work without considerable changes for my port. I'd appreciate feedback with someone which is familiar with it... Thanks! Uri Cohen --001636c5b8d83786220475ed15dc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I was able to create a UTF16 port of LUA for windows, by f= ollowing the guidelines I found at http://lua-users.org/lists/lua= -l/2002-12/msg00021.html and the considerations from http://l= ua-users.org/lists/lua-l/2002-12/msg00025.html. This is a version of LU= A where all internal strings are UTF16 (wide characters) rather than chars,= not a version with two types of strings like LuaState.

My question is on how can I verify my port works? Other than toy script= s I created, I'm looking for a comprehensive set of tests I can run in = order to verify all important language feature were not broken...

Any ideas if such a set exists? How does the correctness of changes in = Lua 5.1.xx is verified?

I saw there is an official test suite at http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz= but I'm not sure if (a) it should work on Windows and (b) it is suppos= ed to work without considerable changes for my port. I'd appreciate fee= dback with someone which is familiar with it...

Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen
--001636c5b8d83786220475ed15dc-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 20:29:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ENTMn8029712; Wed, 14 Oct 2009 20:29:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14A3E19332; Wed, 14 Oct 2009 21:28:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33E4E19315 for ; Wed, 14 Oct 2009 21:28:08 -0200 (BRST) Received: (wp-smtpd smtp.wp.pl 28308 invoked from network); 15 Oct 2009 01:28:48 +0200 Received: from miko.ras.wp-sa.pl (HELO [192.168.254.110]) (miko@[212.77.97.9]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 15 Oct 2009 01:28:48 +0200 Message-ID: <4AD65EB0.7070907@wp.pl> Date: Thu, 15 Oct 2009 01:28:48 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: A simple SOAP client References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [AQME] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jonathan Castello wrote: > LuaSocket is loaded with require "socket", despite what you might > expect. At least in my environment, and I don't believe I changed any > LuaSocket file names. OK, sorry, you are right - it depends how luasocket was installed. It works for me, but it seems that usings luarocks you need "socket" indeed. Sorry for this misinformation. Regards, miko From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 20:40:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ENe65t030887; Wed, 14 Oct 2009 20:40:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A97C81934A; Wed, 14 Oct 2009 21:39:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EED3C192F9 for ; Wed, 14 Oct 2009 21:38:56 -0200 (BRST) Received: by fxm12 with SMTP id 12so449843fxm.5 for ; Wed, 14 Oct 2009 16:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=DwwbV5J/vi+RrOSmE42FHtg/3uTw8WHK32BS2rGaU+Q=; b=aQjKwvfFt6Eo0eQfOYa8P6Z2HCxaiCtHpGPgPHEGtEDZideg5hPCLsUGutMSv0GP8x rj1q2u3cHWI1N/xhWILwn3O5tlGozaGqV3z9kXCRxPk6cF8oHYAKUNaqD1f7hSd+cb91 OGh5L077FrBVfEgddtzsrmgKDxrYWGxgH7WW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=idnDe3aZRZP7elluizUweXfiF0sjvjuTinCecaBIXA3fe9XgScs3O/Cf6Kcgj2/wPd 1vY4pgldqY2ls01yiuPTyWnV033ynAdfQFAebHzYYctbp0tXVQvvGwTJjPla/enmOC4J KmnMT8Qhe9PFoImAvY6azEDdTTtCCiQLKVNzs= MIME-Version: 1.0 Received: by 10.204.26.130 with SMTP id e2mr2000359bkc.144.1255563580107; Wed, 14 Oct 2009 16:39:40 -0700 (PDT) In-Reply-To: <4AD65EB0.7070907@wp.pl> References: <4AD65EB0.7070907@wp.pl> From: Hisham Date: Wed, 14 Oct 2009 20:39:20 -0300 Message-ID: <5e7d91620910141639od8b77bfqa71d202270d61f3c@mail.gmail.com> Subject: Re: A simple SOAP client To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/14 Michal Kolodziejczyk : > Jonathan Castello wrote: > >> LuaSocket is loaded with require "socket", despite what you might >> expect. At least in my environment, and I don't believe I changed any >> LuaSocket file names. > > OK, sorry, you are right - it depends how luasocket was installed. It > works for me, but it seems that usings luarocks you need "socket" indeed. > Sorry for this misinformation. Not only with LuaRocks -- the standard LuaSocket tarball uses "socket" as the module name. -- Hisham From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 21:59:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F0x99l006972; Wed, 14 Oct 2009 21:59:09 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97A8A19338; Wed, 14 Oct 2009 22:58:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from kal-el.real.com (kal-el.real.com [207.188.23.4]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D4C01932B for ; Wed, 14 Oct 2009 22:57:54 -0200 (BRST) Received: from [10.0.1.6] ([::ffff:64.38.167.24]) (AUTH: PLAIN ddunham, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by kal-el.real.com with esmtp; Wed, 14 Oct 2009 17:58:36 -0700 id 0007C084.4AD673BC.00002465 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port From: David Dunham In-Reply-To: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> Date: Wed, 14 Oct 2009 17:58:35 -0700 Content-Transfer-Encoding: 7bit Message-Id: <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 14 Oct 2009, at 15:57, uri cohen wrote: > This is a version of > LUA where all internal strings are UTF16 (wide characters) rather than > chars, not a version with two types of strings like LuaState. I assume you're aware that not all Unicode characters fit in 16 bits -- I never know if Windows wide character support realizes this. David Dunham Development Manager +1 206 926 5722 GameHouse Studios From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 23:05:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F25hFc013033; Wed, 14 Oct 2009 23:05:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58974192F2; Thu, 15 Oct 2009 00:04:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AB27190B7 for ; Thu, 15 Oct 2009 00:04:22 -0200 (BRST) Received: by fxm12 with SMTP id 12so557564fxm.5 for ; Wed, 14 Oct 2009 19:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=biatihEQxUFCMiIsqkNZNffUuuRlFuiBOKrjdpETuxA=; b=B7U8idpnufSD/fYOSU5CEMFW3Izf/hAHdzm34zUSxQ6Igiq7CPoVfJ4tskUEbMZJDB TFlUGev96wys1L9r1vS+l8tGGw78DyoqScUZbBe1r6e31Kr/jqf1kDurTItWcrmKwlkw UIIcxAOWMEGBrkNfHuSv9DBRnR4NNvyT/qv1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Xv5c+rYrKxsR4NDDL2IUTGnMe20H6auCccH8yEHxkNcEwBrGr/svBmN2nCJQESwUrS ztM70i8Zyn43cA7rnXEoT1ktoMXo2252usFAXr8PekULaLVI+xEccZpL3mkWFZpLV+8r OJNJbYgrdgYiXZDggScWrsnJCVXHnNwJwlLsY= MIME-Version: 1.0 Received: by 10.223.143.12 with SMTP id s12mr2441735fau.30.1255572306462; Wed, 14 Oct 2009 19:05:06 -0700 (PDT) In-Reply-To: <7913df4d0910130817k1a984682h9a8e7b5ca1b7e844@mail.gmail.com> References: <7913df4d0910130817k1a984682h9a8e7b5ca1b7e844@mail.gmail.com> From: Anders Bergh Date: Thu, 15 Oct 2009 04:03:11 +0200 Message-ID: <976395530910141903s313887a7u93a4bcb1585182c4@mail.gmail.com> Subject: Re: LFS build fails on Ubuntu 9.04 amd64 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F25hFc013033 Hello, Has it been reported to the Debian bug tracker? On Tue, Oct 13, 2009 at 17:17, Fabio Mascarenhas wrote: > Hi, > > This problem has already showed up at the LuaRocks list, the apt > package for LuaRocks is broken. Uninstall it and install LuaRocks from > source, then reinstall luafilesystem and everything will work. The > mantainer for the package has already been notified. > > -- > Fabio Mascarenhas > > > On Tue, Oct 13, 2009 at 12:08 PM, Alexander Gladysh wrote: >> Sorry, Luarocks list on Luaforge seems to be down, so I'm posting it here. >> >> Alexander. >> >> >> ---------- Forwarded message ---------- >> From: Alexander Gladysh >> Date: Tue, Oct 13, 2009 at 19:06 >> Subject: LFS build fails on Ubuntu 9.04 amd64 >> To: LuaRocks developers list >> >> >> Hi, list! >> >> I can't install luafilesystem rock on my 64-bit Ubuntu Server 9.04 box >> (luarocks 1.0.1-1 from the standard apt package). >> >> Here is the output: >> >> $ sudo luarocks install luafilesystem >> Installing http://luarocks.luaforge.net/rocks/luafilesystem-1.4.2-1.src.rock... >> Archive:  /tmp/luarocks-rock-luafilesystem-1.4.2-1-6606/luafilesystem-1.4.2-1.src.rock >>  inflating: luafilesystem-1.4.2-1.rockspec >>  extracting: luafilesystem-1.4.2.tar.gz >> gcc -O2 -I/usr/include/lua5.1/ -c src/lfs.c -o src/lfs.o >> gcc -shared -o lfs.so src/lfs.o >> /usr/bin/ld: src/lfs.o: relocation R_X86_64_32 against >> `.rodata.str1.1' can not be used when making a shared object; >> recompile with -fPIC >> src/lfs.o: could not read symbols: Bad value >> collect2: ld returned 1 exit status >> cp: cannot stat `lfs.so': No such file or directory >> >> Error: Build error: Build error >> >> Any clues? >> >> Alexander. >> > -- Anders Bergh From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 23:17:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F2HZLV016224; Wed, 14 Oct 2009 23:17:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57F4E19343; Thu, 15 Oct 2009 00:16:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63AE31929D for ; Thu, 15 Oct 2009 00:16:25 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MyFtn-0001uV-Iv for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 03:17:03 +0100 Received: from [192.168.2.94] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 21A421D00F for ; Thu, 15 Oct 2009 03:17:01 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:46312 with envelope Message-ID: <4AD68618.6020102@cowlark.com> Date: Thu, 15 Oct 2009 03:16:56 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> In-Reply-To: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F2HZLV016224 uri cohen wrote: [...] > My question is on how can I verify my port works? Other than toy scripts > I created, I'm looking for a comprehensive set of tests I can run in > order to verify all important language feature were not broken... Unicode is harder than it looks... one reason Lua doesn't really use it is that once you start dealing with Unicode you start finding places where you get conflicting requirements. For example, é can be represented as both U+301 U+0065, or as U+00E9. Do these compare equal? They are technically the same thing. What about sorting order? Does Ð (U+0401) sort before, after, or equal to Ë (U+00CB)? For that matter, what about à´ (U+0D10) and áš” (U+1694)? What about E (U+0045), Ε (U+0395), Е (U+0415), â‹¿ (U+22FF), â´¹ (U+2D39), ï¼¥ (U+FF25), ð„ (U+1D404), ð¸ (U+1D438), 𑬠(U+1D46C), 𔼠(U+1D53C), ð–¤ (U+1D5A4), ð—˜ (U+1D5D8), 𘌠(U+1D60C), 𙀠(U+1D640), ð™´ (U+1D674), 𚬠(U+1D6AC), í µð›¦ (U+1D6E6), 𜠠(U+1D720), or ðš (U+1D75A)? Do you mean UTF-16 or UCS-2? UCS-2 can't handle some of the really freaky Unicode characters like ðŒ† (U+1D306) or ðŸ€Ží ´ (U_1F00E) --- I don't even have the font to display that last one! And, most importantly of all, can you still use Lua strings to represent arbitrary binary data, or is the data forced into well-formed UTF-16? One reason people tend to use UTF-8 in Lua is not that it solves all these problems, but that it cleanly divides the problems into soluble ones and non-soluble ones! And it turns out that most people don't care about the non-soluble ones. Unfortunately, once you start trying to *natively* support Unicode, you suddenly find yourself having to care about these things... (adjusts signature) -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ âŽ'⎕',∊Nâ´âŠ‚Sâ†'â†âŽ•â†(3=T)⋎Mâ‹2=Tâ†âŠƒ+/(V⌽"⊂M),(VâŠ"M),(V,⌽V)⌽"(V,Vâ†1⎺1)âŠ"⊂M)' │ --- Conway's Game Of Life, in one line of APL From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 23:23:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F2N2O9017160; Wed, 14 Oct 2009 23:23:02 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 645D01934B; Thu, 15 Oct 2009 00:22:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7FA41923D for ; Thu, 15 Oct 2009 00:21:54 -0200 (BRST) Received: (qmail 3452 invoked by uid 399); 14 Oct 2009 20:22:37 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 14 Oct 2009 20:22:37 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AD6876D.5070802@workspacewhiz.com> Date: Wed, 14 Oct 2009 20:22:37 -0600 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> In-Reply-To: <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: David Dunham Date: 10/14/2009 6:58 PM > On 14 Oct 2009, at 15:57, uri cohen wrote: >> This is a version of >> LUA where all internal strings are UTF16 (wide characters) rather than >> chars, not a version with two types of strings like LuaState. > I assume you're aware that not all Unicode characters fit in 16 bits > -- I never know if Windows wide character support realizes this. I used the LuaPlus wide character string support to ship games to the Japanese market. For a computer/console game, there is almost always a known quantity of glyphs for a given language when localizing its string tables. Wide character string support covers this nicely. LuaPlus achieves this via a C-like string representation: HelloWorld = L"Hello world!" Wide string hex representations of unprintable characters are as follows: RandomCharacters = L"\x80fe\xabcd\x1234" Of course, core Lua can support the string above, but what it can't do is proper endian conversion of the individual characters. Since it is known the string is wide, LuaPlus endian converts each character as necessary. LuaPlus supports one other useful wide string feature. It knows how to read a UCS-2 encoded Lua source file. Instead of using the escape sequences in RandomCharacters above, the actual glyphs can be inserted into the file. I apologize for hijacking the thread, but I really do feel it is useful to have wide character string support for my work within the games industry. For applications, wide characters may be worthless. Josh From lua-bounces@bazar2.conectiva.com.br Wed Oct 14 23:32:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F2WF8r018486; Wed, 14 Oct 2009 23:32:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 728781934E; Thu, 15 Oct 2009 00:31:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43A8E1923D for ; Thu, 15 Oct 2009 00:31:04 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MyG82-0006k9-2E for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 03:31:46 +0100 Received: from [192.168.2.94] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 9D8571E07F for ; Thu, 15 Oct 2009 03:31:42 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:34325 with envelope Message-ID: <4AD68988.70001@cowlark.com> Date: Thu, 15 Oct 2009 03:31:36 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> In-Reply-To: <4AD6876D.5070802@workspacewhiz.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F2WF8r018486 Joshua Jensen wrote: [...] > LuaPlus achieves this via a C-like string representation: > > HelloWorld = L"Hello world!" Yes, that sounds like a good solution --- that lets you distinguish between bag-of-bytes strings and Unicodish strings, which means you don't have to worry about conflicting requirements as much. What does LuaPlus do for things like string comparison and surrogates? [...] > I apologize for hijacking the thread, but I really do feel it is useful > to have wide character string support for my work within the games > industry. For applications, wide characters may be worthless. Do any of them use UTF-8? I work in mobile games; our company makes a portable native gaming solution that allows you to install C-based games on any device, regardless of architecture. The API's based on OpenKODE, which uses UTF-8 in the few places where it uses strings. As I tend to do the bottom-end porting to weird and freaky embedded operating systems, I've got tiresomely familiar with having to translate UTF-8 to whatever encoding the host OS uses. There are a surprising number that use some form of half-assed UCS-2, and I've never figured out why --- it just makes life complex. I suspect that it's simple tradition. Most of them come from Asia, and Asia seems to have a culture of using UCS-2 or UTF-16... -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ âŽ'⎕',∊Nâ´âŠ‚Sâ†'â†âŽ•â†(3=T)⋎Mâ‹2=Tâ†âŠƒ+/(V⌽"⊂M),(VâŠ"M),(V,⌽V)⌽"(V,Vâ†1⎺1)âŠ"⊂M)' │ --- Conway's Game Of Life, in one line of APL From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 00:04:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F347IL022471; Thu, 15 Oct 2009 00:04:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43EE71936A; Thu, 15 Oct 2009 01:03:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1415A19365 for ; Thu, 15 Oct 2009 01:02:56 -0200 (BRST) Received: (qmail 31025 invoked by uid 399); 14 Oct 2009 21:03:37 -0600 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 14 Oct 2009 21:03:37 -0600 X-Originating-IP: 24.10.200.9 Message-ID: <4AD69107.7020107@workspacewhiz.com> Date: Wed, 14 Oct 2009 21:03:35 -0600 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> In-Reply-To: <4AD68988.70001@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: David Given Date: 10/14/2009 8:31 PM > Joshua Jensen wrote: > [...] >> LuaPlus achieves this via a C-like string representation: >> >> HelloWorld = L"Hello world!" > What does LuaPlus do for things like string comparison and surrogates? It does the equivalent of wcscmp(), only it doesn't rely on the C runtime to achieve this. That's because on some non-Visual C++ compilers, sizeof(wchar_t) != 2. sizeof(lua_WChar) is always 2. My understanding is that UCS-2 doesn't support surrogates. I don't think Microsoft's C runtime wide character library supports them either. I could be wrong. > Do any of them use UTF-8? > > I work in mobile games; our company makes a portable native gaming > solution that allows you to install C-based games on any device, > regardless of architecture. The API's based on OpenKODE, which uses > UTF-8 in the few places where it uses strings. As I tend to do the > bottom-end porting to weird and freaky embedded operating systems, > I've got tiresomely familiar with having to translate UTF-8 to > whatever encoding the host OS uses. There are a surprising number that > use some form of half-assed UCS-2, and I've never figured out why --- > it just makes life complex. I suspect that it's simple tradition. Most > of them come from Asia, and Asia seems to have a culture of using > UCS-2 or UTF-16... I would consider ditching the LuaPlus wide character support if there was a small library that supported UTF-8 and allowed easy embedding of UTF-8 string types in Lua source files. Have you looked at slnunicode? That seems to be the smallest one I can find, but documentation is scarce, so I don't know if it achieves all of the goals. Josh From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 00:05:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F35XUs022928; Thu, 15 Oct 2009 00:05:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 343A11936D; Thu, 15 Oct 2009 01:04:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22A731936F for ; Thu, 15 Oct 2009 01:04:26 -0200 (BRST) Received: by ewy26 with SMTP id 26so489223ewy.5 for ; Wed, 14 Oct 2009 20:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=zN+dxp5+F6dAdvJPCeXuEdszlGMw6FkvP1ddJBDd6aw=; b=iwPDUmipD4ZyzlHIt97Bz79GW9EA8RXSQH6gKef3d+l4H2aZ99ZMIlNVPxBM9IVhzy gNq1CbghqLIPNW0BG9sWY518yPouH5LLR3RghV6wwP7RmZ8jPRXiQ02uifFltXbp+7Ex nX0e1WPO5jLx4KJ7zQS9RSww43lKPm1OB9Xso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=OPMRQHwjAeisTZ2neYMO3nWGDQF7zZ63TRSY/HPQEru7W/H5bQ77BB+Qo0kDVeWWFV bcuzAyha6FWctK8H6wC3ymD1L9fUKogLYwlWQoGZWGwaT+zKBRYBtwWQALA0DJDnfxpH stTknw/iyEs8B/E6S+VFxh2OZAQ6V0rIOG32I= MIME-Version: 1.0 Received: by 10.216.88.6 with SMTP id z6mr3371590wee.52.1255575909127; Wed, 14 Oct 2009 20:05:09 -0700 (PDT) In-Reply-To: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> From: Jerome Vuarand Date: Thu, 15 Oct 2009 05:04:49 +0200 Message-ID: <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/15 uri cohen : > I was able to create a UTF16 port of LUA for windows, by following the > guidelines I found at http://lua-users.org/lists/lua-l/2002-12/msg00021.html > and the considerations from > http://lua-users.org/lists/lua-l/2002-12/msg00025.html. This is a version of > LUA where all internal strings are UTF16 (wide characters) rather than > chars, not a version with two types of strings like LuaState. > > My question is on how can I verify my port works? Other than toy scripts I > created, I'm looking for a comprehensive set of tests I can run in order to > verify all important language feature were not broken... I think you should make sure your "port" doesn't break libraries that use strings for non-text data. For examples, you can try to use the io library on binary files (use one of the (de)serialization libraries available around), or LuaSocket on binary protocols. By the way, what's the goal of such a modification of Lua ? If all you need is being able to use Unicode filenames on windows, a simpler approach is to assume filenames passed to Lua are in utf-8 format, and convert it just when necessary when accessing the filesystem (in just a very few places in Lua source code). I have a patch doing that if anyone is interested. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 00:49:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F3nPw7026752; Thu, 15 Oct 2009 00:49:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ACA919374; Thu, 15 Oct 2009 01:48:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from proxy1-nit.microlink.com.br (proxy1-nit-0a.pop-rio.com.br [200.239.248.231]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08E9D1936F for ; Thu, 15 Oct 2009 01:48:12 -0200 (BRST) Received: from [10.101.170.215] (helo=[192.168.0.100]) by proxy1-nit.microlink.com.br with esmtp (Exim 4.69) (envelope-from ) id 1MyHKe-0006Vw-7h for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 00:48:52 -0300 Message-ID: <4AD69BA5.8070501@sct.microlink.com.br> Date: Thu, 15 Oct 2009 00:48:53 -0300 From: Andre de Leiradella User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> In-Reply-To: <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I think ICU4Lua adds some support for utf-8 strings to Lua? Jerome Vuarand wrote: > 2009/10/15 uri cohen : >> I was able to create a UTF16 port of LUA for windows, by following the >> guidelines I found at http://lua-users.org/lists/lua-l/2002-12/msg00021.html >> and the considerations from >> http://lua-users.org/lists/lua-l/2002-12/msg00025.html. This is a version of >> LUA where all internal strings are UTF16 (wide characters) rather than >> chars, not a version with two types of strings like LuaState. >> >> My question is on how can I verify my port works? Other than toy scripts I >> created, I'm looking for a comprehensive set of tests I can run in order to >> verify all important language feature were not broken... > > I think you should make sure your "port" doesn't break libraries that > use strings for non-text data. For examples, you can try to use the io > library on binary files (use one of the (de)serialization libraries > available around), or LuaSocket on binary protocols. > > By the way, what's the goal of such a modification of Lua ? If all you > need is being able to use Unicode filenames on windows, a simpler > approach is to assume filenames passed to Lua are in utf-8 format, and > convert it just when necessary when accessing the filesystem (in just > a very few places in Lua source code). I have a patch doing that if > anyone is interested. > > From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 01:17:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F4HTHY029708; Thu, 15 Oct 2009 01:17:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C00111923D; Thu, 15 Oct 2009 02:16:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CC6419183 for ; Thu, 15 Oct 2009 02:16:13 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MyHll-00029s-Of for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 05:16:53 +0100 Received: from [192.168.2.94] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 27A144901A for ; Thu, 15 Oct 2009 05:16:49 +0100 (BST) Received: from 61.82.185.3 and verified by Spey connected from 61.82.185.3:26641 with envelope Message-ID: <4AD6A228.40105@cowlark.com> Date: Thu, 15 Oct 2009 05:16:40 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> <4AD69107.7020107@workspacewhiz.com> In-Reply-To: <4AD69107.7020107@workspacewhiz.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F4HTHY029708 Joshua Jensen wrote: [...] > It does the equivalent of wcscmp(), only it doesn't rely on the C > runtime to achieve this. That's because on some non-Visual C++ > compilers, sizeof(wchar_t) != 2. sizeof(lua_WChar) is always 2. Yes, in the Unix world it's always 4 (wchar_t is an int). It's easier in the console world --- you've got complete control over all the text on your system, so you can ensure you're not using any weird stuff like RTL, surrogates, unsupported combining characters, etc. [...] > I would consider ditching the LuaPlus wide character support if there > was a small library that supported UTF-8 and allowed easy embedding of > UTF-8 string types in Lua source files. Well, UTF-8 in Lua source files already Just Works. (They're treated by Lua as Bags of Bytes.) As far as libraries go, I wrote some very simple UTF-8 parsing code for WordGrinder: http://wordgrinder.svn.sourceforge.net/viewvc/wordgrinder/wordgrinder/src/c/utils.c?view=markup This will let you read and write raw code points from/to a string in a relatively simple manner. Thinking about this, a while back I did actually find that Unicode has real rules for splitting up a UTF-8 string into 'characters', each of which is an arbitrary-sized string representing a single drawable thing (I forget the exact term --- grapheme clusters?). So theoretically it ought to be possible to *truly* do random-access on a string. Maybe I should revisit this at some point. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ âŽ'⎕',∊Nâ´âŠ‚Sâ†'â†âŽ•â†(3=T)⋎Mâ‹2=Tâ†âŠƒ+/(V⌽"⊂M),(VâŠ"M),(V,⌽V)⌽"(V,Vâ†1⎺1)âŠ"⊂M)' │ --- Conway's Game Of Life, in one line of APL From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 03:54:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F6sO7L009118; Thu, 15 Oct 2009 03:54:24 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C56B419376; Thu, 15 Oct 2009 04:53:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s40.bay0.hotmail.com (bay0-omc1-s40.bay0.hotmail.com [65.54.246.112]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED76319332 for ; Thu, 15 Oct 2009 04:53:06 -0200 (BRST) Received: from BAY121-W20 ([207.46.10.55]) by bay0-omc1-s40.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 Oct 2009 23:53:46 -0700 Message-ID: X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: RE: Using LuaSocket with non-blocking sockets Date: Wed, 14 Oct 2009 23:53:46 -0700 Importance: Normal Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginalArrivalTime: 15 Oct 2009 06:53:46.0396 (UTC) FILETIME=[3DE4E5C0:01CA4D64] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F6sO7L009118 Hello again, Lua-L, I sent this a few days ago, but I haven't seen any replies yet. I understand that people might just not know, but if someone could just give me a pointer to where I might find my answers (or even just tell me you don't know!), that would be fine. Thanks again, and apologies for reposting,~Jonathan Castello > From: solugon@hotmail.com > To: lua@bazar2.conectiva.com.br > Subject: Using LuaSocket with non-blocking sockets > Date: Sun, 11 Oct 2009 17:28:01 -0700 > > > Hello,>  > I'm using non-blocking sockets with LuaSocket under Win32, and I find myself looking for a way to tell if a connect() call failed. I can use socket.select(nil, {sock}, 0) to see if the socket has connected successfully, but I don't see any way to tell if it failed. Looking over the WinSock documentation, I notice an 'exceptfds' parameter that comes after the read and write tables, but LuaSocket doesn't appear to use it at all (its source shows NULL used instead). The WinSock documentation says that if a nonblocking socket failed to connect, passing it in as part of 'exceptfds' would return the socket as part of that list.>  > Does anyone have any suggestions for how to work around this? Or better, can anyone explain why 'exceptfds' is ignored in LuaSocket? I can't use blocking sockets due to the environment I'm writing this script for (as a plugin to a single-threaded process), and I don't want to lock up the rest of the environment with blocking calls.>  > Thank you,~Jonathan Castello _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 04:25:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F7Phj8012965; Thu, 15 Oct 2009 04:25:43 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A96671938D; Thu, 15 Oct 2009 05:24:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.dev.drweb.com (mail.dev.drweb.com [195.88.252.13]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97D4C19386 for ; Thu, 15 Oct 2009 05:24:25 -0200 (BRST) Received: from mail.dev.drweb.com (localhost.localdomain [127.0.0.1]) by mail.dev.drweb.com (Postfix) with ESMTP id 3B038E501D5 for ; Thu, 15 Oct 2009 11:25:09 +0400 (MSD) Received: from [192.168.0.200] (unknown [91.191.180.48]) by mail.dev.drweb.com (Postfix) with ESMTP id 4B5E0E501D5 for ; Thu, 15 Oct 2009 11:25:07 +0400 (MSD) Message-ID: <4AD6CE4E.1050204@gladkih.com> Date: Thu, 15 Oct 2009 11:25:02 +0400 From: john User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> <4AD69107.7020107@workspacewhiz.com> In-Reply-To: <4AD69107.7020107@workspacewhiz.com> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.5.0.1 X-Antivirus-Code: 0x100000 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: > ----- Original Message ----- > From: David Given > Date: 10/14/2009 8:31 PM >> Joshua Jensen wrote: >> [...] >>> LuaPlus achieves this via a C-like string representation: >>> >>> HelloWorld = L"Hello world!" >> What does LuaPlus do for things like string comparison and surrogates? > It does the equivalent of wcscmp(), only it doesn't rely on the C > runtime to achieve this. That's because on some non-Visual C++ > compilers, sizeof(wchar_t) != 2. sizeof(lua_WChar) is always 2. > > My understanding is that UCS-2 doesn't support surrogates. I don't > think Microsoft's C runtime wide character library supports them > either. I could be wrong. WinNT kernel doesn't know anything about UTF-16 it's pure UCS-2 coded ;) so, it's a myth that Windows is Unicode aware From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 04:37:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F7baVS013833; Thu, 15 Oct 2009 04:37:36 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2C3319385; Thu, 15 Oct 2009 05:36:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 859F819355 for ; Thu, 15 Oct 2009 05:36:23 -0200 (BRST) Received: by fxm12 with SMTP id 12so780862fxm.5 for ; Thu, 15 Oct 2009 00:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Z19/rwKSOWmGxle7mZpPLmKkW+qn2ZPHRF7x5R3lgCM=; b=HtF9HqYXg7pmKkr+GfEipv6sne3zjHTj9Y3eQkIqwKoCqJlFS5/JR32rz7J3tx/le4 cLVtqPZOwmIktbGM82kI1zsTtQGwJV/BQYMf4i3ecf4LwyDFkr3Djb0Nde5aIgM5DORt bRanRkamatYMROGTa/KZfKdSi+C/4o3jBeS1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FwOmPgBJYLwOw0c8CCE2G3WJEuTX755Zxiv26rqgeIo2FUJrsQnWFnLjZTC0+ODYdx oGo9FjAAfY+/gFI1bON5v3lp9cD6ECMIqobya4uoneeFvefGGpnPoXd3stNaWl59hKT4 d49CEy8Jh+nkDLsaq5BYZ6FgqpqBT4nSolVhs= MIME-Version: 1.0 Received: by 10.239.134.215 with SMTP id a23mr718602hba.168.1255592226109; Thu, 15 Oct 2009 00:37:06 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 09:37:05 +0200 Message-ID: <560972290910150037t6aac4039ua704b150c0d6f56d@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9F7baVS013833 On Wed, Oct 14, 2009 at 11:45 PM, Jim Jennings wrote: > Since (1) tables are not lists, and (2) list-processing functions can > be implemented easily in either Lua or C, what is the benefit of > incorporating list-processing functions into the Lua language?  I > don't see any benefits. Precisely. And the vararg style can be done efficiently as a C module From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 04:51:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F7pgn5014862; Thu, 15 Oct 2009 04:51:42 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44714193A3; Thu, 15 Oct 2009 05:50:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 139EB1939D for ; Thu, 15 Oct 2009 05:50:05 -0200 (BRST) Received: by ewy26 with SMTP id 26so619512ewy.5 for ; Thu, 15 Oct 2009 00:50:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.88.141 with SMTP id a13mr2664809wef.209.1255593049163; Thu, 15 Oct 2009 00:50:49 -0700 (PDT) Date: Thu, 15 Oct 2009 09:50:49 +0200 X-Google-Sender-Auth: dde6d1dbb5226506 Message-ID: <5e5c89e20910150050y2ba32624q161b9ff2cba92a73@mail.gmail.com> Subject: Struct library patch WAS: Roberto's struct library missing "size" function? From: Flemming Madsen To: Lua list Content-Type: multipart/mixed; boundary=0016e6d7e924ad8e480475f489f1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d7e924ad8e480475f489f1 Content-Type: multipart/alternative; boundary=0016e6d7e924ad8e3f0475f489ef --0016e6d7e924ad8e3f0475f489ef Content-Type: text/plain; charset=ISO-8859-1 I recently had to do some serious binary manipulations. The 'struct' library came in very handy, but fell short in a couple of case this is addressed with the attached patch. (Which btw. also adds the ability to report sizes) - c0 replaced with c. Means you can build the format string programatically without treating zero length strings as a special case. - Can handle 'long long' integers (i8 / I8) - Can insert/specify padding anywhere in a struct. ('X' eg. when a string is following a union) - Can report current offset in both pack and unpack ('=') - Can mask out return values when you only want to calculate sizes or unmarshal pascal-style strings. '(' & ')' - Handles doubles with swapped hi/lo words (Seen on ARM platform) - Can unpack arbitrary userdata,length datums (like alien version of struct) ** Valid formats: ** > - big endian ** < - little endian ** ![num] - alignment ** x[num] - pad num bytes, default 1 ** X[num] - pad to num align, default MAXALIGN ** b/B - signed/unsigned byte ** h/H - signed/unsigned short ** l/L - signed/unsigned long ** i/I[num] - signed/unsigned integer with size `n' (default is size of int) ** c[num] - sequence of `num' chars (from/to a string); when packing, num absent means the whole string; when unpacking, num absent means use the previous read number as the string length. ** s - zero terminated string ** f - float ** d - double ** ' ' - ignored ** '(' ')' - stop assigning items. ')' start assigning (padding when packing) ** '=' - return current position / offset /Flemming --0016e6d7e924ad8e3f0475f489ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I recently had to do some serious binary manipulations. The =A0'struct&= #39; library came in very handy, but fell short in =A0a couple of case this= is=A0addressed=A0with the=A0attached=A0patch. (Which btw. also adds the ab= ility to report sizes)

  • c0 replaced with c<nothing>. Means you ca= n build the format string programatically without treating zero length stri= ngs as a special case.
  • Can handle 'long long' integers (i8 = / I8)
  • Can insert/specify padding anywhere in a struct. ('X' eg. when = a string is following a union)
  • Can report current offset in both pa= ck and unpack ('=3D')
  • Can mask out return values when you o= nly want to calculate sizes or unmarshal pascal-style strings. '(' = & ')'
  • Handles doubles with swapped hi/lo words (Seen on ARM platform)
  • Can unpack arbitrary userdata,length datums (like alien version of struct)=

** Valid formats:
** > =A0 =A0 =A0 = =A0- big endian
** < =A0 =A0 =A0 =A0- little endian
** ![num] =A0 = - alignment
** x[num] =A0 - pad num bytes, default 1
** X[num] = =A0 - pad to num align, default MAXALIGN
** b/B =A0 =A0 =A0- signed/unsigned byte
** h/H =A0 = =A0 =A0- signed/unsigned short
** l/L =A0 =A0 =A0- signed/unsigned long
** i/I[num]= - signed/unsigned integer with size `n' (default is size of int)
** c[num] =A0 - sequence of `num' chars (from/to a string); when p= acking, num
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0absent means the= whole string; when unpacking, num absent means
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0use the previous read number as the stri= ng length.
** s =A0 =A0 =A0 =A0- zero terminated string
** f =A0 =A0 =A0 =A0- float
** d =A0 =A0 =A0 =A0- dou= ble
= ** ' ' =A0 =A0 =A0- ignored
** '(' ')&= #39; =A0- stop assigning items. ')' start assigning (padding when p= acking)
** '=3D' =A0 =A0 =A0- return current position / offset<= /div>


/Flemming

--0016e6d7e924ad8e3f0475f489ef-- --0016e6d7e924ad8e480475f489f1 Content-Type: text/x-patch; charset=US-ASCII; name="struct.patch" Content-Disposition: attachment; filename="struct.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g0t7kycv0 LS0tIHN0cnVjdC5vcmlnCTIwMDktMTAtMTUgMDg6MzA6NTkuMDAwMDAwMDAwICswMjAwCisrKyBz dHJ1Y3QuYwkyMDA5LTEwLTE1IDA5OjQ1OjMxLjAwMDAwMDAwMCArMDIwMApAQCAtMSwzNyArMSw0 MyBAQAotCiAjaW5jbHVkZSA8YXNzZXJ0Lmg+CiAjaW5jbHVkZSA8Y3R5cGUuaD4KICNpbmNsdWRl IDxsaW1pdHMuaD4KICNpbmNsdWRlIDxzdHJpbmcuaD4KKyNpbmNsdWRlIDxzdGRib29sLmg+CiAK IAogI2luY2x1ZGUgImx1YS5oIgogI2luY2x1ZGUgImxhdXhsaWIuaCIKIAorI2lmbmRlZiBMTE9O R19NQVgKKyNkZWZpbmUgTExPTkdfTUFYICAgIDkyMjMzNzIwMzY4NTQ3NzU4MDdMTAorI2VuZGlm CiAKIC8qCiAqKiB7PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09CiAqKiBMaWJyYXJ5IGZvciBwYWNraW5nL3VucGFja2luZyBzdHJ1Y3R1cmVzLgot KiogJElkOiBzdHJ1Y3QuYyx2IDEuMiAyMDA4LzA0LzE4IDIwOjA2OjAxIHJvYmVydG8gRXhwICQK KyoqICRJZDogc3RydWN0LmMgMjA0MDUgMjAwOS0xMC0xNSAwNzowNjo0NVogZm0gJAogKiogPT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogKi8K IC8qCiAqKiBWYWxpZCBmb3JtYXRzOgotKiogPiAtIGJpZyBlbmRpYW4KLSoqIDwgLSBsaXR0bGUg ZW5kaWFuCi0qKiAhW251bV0gLSBhbGlnbm1lbnQKLSoqIHggLSBwYWRpbmcKLSoqIGIvQiAtIHNp Z25lZC91bnNpZ25lZCBieXRlCi0qKiBoL0ggLSBzaWduZWQvdW5zaWduZWQgc2hvcnQKLSoqIGwv TCAtIHNpZ25lZC91bnNpZ25lZCBsb25nCi0qKiBpL0luIC0gc2lnbmVkL3Vuc2lnbmVkIGludGVn ZXIgd2l0aCBzaXplIGBuJyAoZGVmYXVsdCBpcyBzaXplIG9mIGludCkKLSoqIGNuIC0gc2VxdWVu Y2Ugb2YgYG4nIGNoYXJzIChmcm9tL3RvIGEgc3RyaW5nKTsgd2hlbiBwYWNraW5nLCBuPT0wIG1l YW5zCi0gICAgICAgIHRoZSB3aG9sZSBzdHJpbmc7IHdoZW4gdW5wYWNraW5nLCBuPT0wIG1lYW5z IHVzZSB0aGUgcHJldmlvdXMKLSAgICAgICAgcmVhZCBudW1iZXIgYXMgdGhlIHN0cmluZyBsZW5n dGgKLSoqIHMgLSB6ZXJvLXRlcm1pbmF0ZWQgc3RyaW5nCi0qKiBmIC0gZmxvYXQKLSoqIGQgLSBk b3VsYmUKLSoqICcgJyAtIGlnbm9yZWQKKyoqID4gICAgICAgIC0gYmlnIGVuZGlhbgorKiogPCAg ICAgICAgLSBsaXR0bGUgZW5kaWFuCisqKiAhW251bV0gICAtIGFsaWdubWVudAorKiogeFtudW1d ICAgLSBwYWQgbnVtIGJ5dGVzLCBkZWZhdWx0IDEKKyoqIFhbbnVtXSAgIC0gcGFkIHRvIG51bSBh bGlnbiwgZGVmYXVsdCBNQVhBTElHTgorKiogYi9CICAgICAgLSBzaWduZWQvdW5zaWduZWQgYnl0 ZQorKiogaC9IICAgICAgLSBzaWduZWQvdW5zaWduZWQgc2hvcnQKKyoqIGwvTCAgICAgIC0gc2ln bmVkL3Vuc2lnbmVkIGxvbmcKKyoqIGkvSVtudW1dIC0gc2lnbmVkL3Vuc2lnbmVkIGludGVnZXIg d2l0aCBzaXplIGBuJyAoZGVmYXVsdCBpcyBzaXplIG9mIGludCkKKyoqIGNbbnVtXSAgIC0gc2Vx dWVuY2Ugb2YgYG51bScgY2hhcnMgKGZyb20vdG8gYSBzdHJpbmcpOyB3aGVuIHBhY2tpbmcsIG51 bQorICAgICAgICAgICAgICBhYnNlbnQgbWVhbnMgdGhlIHdob2xlIHN0cmluZzsgd2hlbiB1bnBh Y2tpbmcsIG51bSBhYnNlbnQgbWVhbnMKKyAgICAgICAgICAgICAgdXNlIHRoZSBwcmV2aW91cyBy ZWFkIG51bWJlciBhcyB0aGUgc3RyaW5nIGxlbmd0aC4KKyoqIHMgICAgICAgIC0gemVybyB0ZXJt aW5hdGVkIHN0cmluZworKiogZiAgICAgICAgLSBmbG9hdAorKiogZCAgICAgICAgLSBkb3VibGUK KyoqICcgJyAgICAgIC0gaWdub3JlZAorKiogJygnICcpJyAgLSBzdG9wIGFzc2lnbmluZyBpdGVt cy4gJyknIHN0YXJ0IGFzc2lnbmluZyAocGFkZGluZyB3aGVuIHBhY2tpbmcpCisqKiAnPScgICAg ICAtIHJldHVybiBjdXJyZW50IHBvc2l0aW9uIC8gb2Zmc2V0CiAqLwogCiAKQEAgLTU5LDEwICs2 NSwxOCBAQAogICBjaGFyIGVuZGlhbjsKIH0gY29uc3QgbmF0aXZlID0gezF9OwogCitzdGF0aWMg dW5pb24gZGJsc3dhcCB7CisgIGxvbmcgbG9uZyBkdW1teTsKKyAgZG91YmxlIGRibDsKKyAgbG9u ZyBsWzJdOworfSBjb25zdCBzd2FwdGVzdCA9IHsweDAwMDAwMDAwYzAwMDAwMDB9OworCiAKIHR5 cGVkZWYgc3RydWN0IEhlYWRlciB7CiAgIGludCBlbmRpYW47CiAgIGludCBhbGlnbjsKKyAgYm9v bCBub2Fzc2lnbjsKKyAgYm9vbCBkYmxzd2FwOwogfSBIZWFkZXI7CiAKIApAQCAtNzksNyArOTMs OCBAQAogfQogCiAKLSNkZWZpbmUgZGVmYXVsdG9wdGlvbnMoaCkJKChoKS0+ZW5kaWFuID0gbmF0 aXZlLmVuZGlhbiwgKGgpLT5hbGlnbiA9IDEpCisjZGVmaW5lIGRlZmF1bHRvcHRpb25zKGgpCSgo aCktPmVuZGlhbiA9IG5hdGl2ZS5lbmRpYW4sIChoKS0+YWxpZ24gPSAxLCAoaCktPm5vYXNzaWdu ID0gMCwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGgpLT5kYmxzd2FwID0g ZmFsc2UpCiAKIAogCkBAIC05MCw5ICsxMDUsMTggQEAKICAgICBjYXNlICdMJzogY2FzZSAnbCc6 IHJldHVybiBzaXplb2YobG9uZyk7CiAgICAgY2FzZSAnZic6ICByZXR1cm4gc2l6ZW9mKGZsb2F0 KTsKICAgICBjYXNlICdkJzogIHJldHVybiBzaXplb2YoZG91YmxlKTsKLSAgICBjYXNlICd4Jzog cmV0dXJuIDE7Ci0gICAgY2FzZSAnYyc6IHJldHVybiBnZXRudW0oZm10LCAxKTsKLSAgICBjYXNl ICdzJzogY2FzZSAnICc6IGNhc2UgJzwnOiBjYXNlICc+JzogY2FzZSAnISc6IHJldHVybiAwOwor ICAgIGNhc2UgJ3gnOiByZXR1cm4gZ2V0bnVtKGZtdCwgMSk7CisgICAgY2FzZSAnWCc6IHJldHVy biBnZXRudW0oZm10LCBNQVhBTElHTik7CisgICAgY2FzZSAnYyc6IHJldHVybiBnZXRudW0oZm10 LCAwKTsKKyAgICBjYXNlICdzJzoKKyAgICBjYXNlICcgJzoKKyAgICBjYXNlICc8JzoKKyAgICBj YXNlICc+JzoKKyAgICBjYXNlICcoJzoKKyAgICBjYXNlICcpJzoKKyAgICBjYXNlICchJzoKKyAg ICBjYXNlICc9JzoKKyAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgY2FzZSAnaSc6IGNhc2Ug J0knOiB7CiAgICAgICBpbnQgc3ogPSBnZXRudW0oZm10LCBzaXplb2YoaW50KSk7CiAgICAgICBp ZiAoIWlzcDIoc3opKQpAQCAtMTA4LDcgKzEzMiw3IEBACiAKIAogc3RhdGljIGludCBnZXR0b2Fs aWduIChzaXplX3QgbGVuLCBIZWFkZXIgKmgsIGludCBvcHQsIHNpemVfdCBzaXplKSB7Ci0gIGlm IChzaXplID09IDAgfHwgb3B0ID09ICdjJykgcmV0dXJuIDA7CisgIGlmIChzaXplID09IDAgfHwg b3B0ID09ICdjJyB8fCBvcHQgPT0gJ3MnKSByZXR1cm4gMDsKICAgaWYgKHNpemUgPiAoc2l6ZV90 KWgtPmFsaWduKSBzaXplID0gaC0+YWxpZ247ICAvKiByZXNwZWN0IG1heC4gYWxpZ25tZW50ICov CiAgIHJldHVybiAgKHNpemUgLSAobGVuICYgKHNpemUgLSAxKSkpICYgKHNpemUgLSAxKTsKIH0K QEAgLTExNyw4ICsxNDEsMTAgQEAKIHN0YXRpYyB2b2lkIGNvbW1vbmNhc2VzIChsdWFfU3RhdGUg KkwsIGludCBvcHQsIGNvbnN0IGNoYXIgKipmbXQsIEhlYWRlciAqaCkgewogICBzd2l0Y2ggKG9w dCkgewogICAgIGNhc2UgICcgJzogcmV0dXJuOyAgLyogaWdub3JlIHdoaXRlIHNwYWNlcyAqLwot ICAgIGNhc2UgJz4nOiBoLT5lbmRpYW4gPSBCSUc7IHJldHVybjsKLSAgICBjYXNlICc8JzogaC0+ ZW5kaWFuID0gTElUVExFOyByZXR1cm47CisgICAgY2FzZSAnPic6IGgtPmVuZGlhbiA9IEJJRzsg KGgpLT5kYmxzd2FwID0gKHN3YXB0ZXN0LmRibCA9PSAtMik7IHJldHVybjsKKyAgICBjYXNlICc8 JzogaC0+ZW5kaWFuID0gTElUVExFOyAoaCktPmRibHN3YXAgPSAoc3dhcHRlc3QuZGJsID09IC0y KTsgcmV0dXJuOworICAgIGNhc2UgJygnOiBoLT5ub2Fzc2lnbiA9IHRydWU7IHJldHVybjsKKyAg ICBjYXNlICcpJzogaC0+bm9hc3NpZ24gPSBmYWxzZTsgcmV0dXJuOwogICAgIGNhc2UgJyEnOiB7 CiAgICAgICBpbnQgYSA9IGdldG51bShmbXQsIE1BWEFMSUdOKTsKICAgICAgIGlmICghaXNwMihh KSkKQEAgLTEzNCwxMSArMTYwLDExIEBACiBzdGF0aWMgdm9pZCBwdXRpbnRlZ2VyIChsdWFfU3Rh dGUgKkwsIGx1YUxfQnVmZmVyICpiLCBpbnQgYXJnLCBpbnQgZW5kaWFuLAogICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHNpemUpIHsKICAgbHVhX051bWJlciBuID0gbHVhTF9jaGVja251bWJl cihMLCBhcmcpOwotICB1bnNpZ25lZCBsb25nIHZhbHVlOwotICBpZiAobiA8IChsdWFfTnVtYmVy KUxPTkdfTUFYKQotICAgIHZhbHVlID0gKGxvbmcpbjsKKyAgdW5zaWduZWQgbG9uZyBsb25nIHZh bHVlOworICBpZiAobiA8IChsdWFfTnVtYmVyKUxMT05HX01BWCkKKyAgICB2YWx1ZSA9IChsb25n IGxvbmcpbjsKICAgZWxzZQotICAgIHZhbHVlID0gKHVuc2lnbmVkIGxvbmcpbjsKKyAgICB2YWx1 ZSA9ICh1bnNpZ25lZCBsb25nIGxvbmcpbjsKICAgaWYgKGVuZGlhbiA9PSBMSVRUTEUpIHsKICAg ICBpbnQgaTsKICAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZTsgaSsrKQpAQCAtMTY4LDYgKzE5NCw4 IEBACiAgIGx1YUxfQnVmZmVyIGI7CiAgIGNvbnN0IGNoYXIgKmZtdCA9IGx1YUxfY2hlY2tzdHJp bmcoTCwgMSk7CiAgIEhlYWRlciBoOworICBpbnQgcG9zY250ID0gMDsKKyAgaW50IHBvc0J1Zlsx MF07CiAgIGludCBhcmcgPSAyOwogICBzaXplX3QgdG90YWxzaXplID0gMDsKICAgZGVmYXVsdG9w dGlvbnMoJmgpOwpAQCAtMTc5LDE0ICsyMDcsMTkgQEAKICAgICBpbnQgdG9hbGlnbiA9IGdldHRv YWxpZ24odG90YWxzaXplLCAmaCwgb3B0LCBzaXplKTsKICAgICB0b3RhbHNpemUgKz0gdG9hbGln bjsKICAgICB3aGlsZSAodG9hbGlnbi0tID4gMCkgbHVhTF9wdXRjaGFyKCZiLCAnXDAnKTsKKyAg ICBpZiAob3B0ID09ICdYJykKKyAgICAgICAgc2l6ZSA9IDA7CisgICAgaWYgKGgubm9hc3NpZ24g JiYgc2l6ZSkKKyAgICAgICAgb3B0ID0gJ3gnOwogICAgIHN3aXRjaCAob3B0KSB7CiAgICAgICBj YXNlICdiJzogY2FzZSAnQic6IGNhc2UgJ2gnOiBjYXNlICdIJzoKICAgICAgIGNhc2UgJ2wnOiBj YXNlICdMJzogY2FzZSAnaSc6IGNhc2UgJ0knOiB7ICAvKiBpbnRlZ2VyIHR5cGVzICovCiAgICAg ICAgIHB1dGludGVnZXIoTCwgJmIsIGFyZysrLCBoLmVuZGlhbiwgc2l6ZSk7CiAgICAgICAgIGJy ZWFrOwogICAgICAgfQotICAgICAgY2FzZSAneCc6IHsKLSAgICAgICAgbHVhTF9wdXRjaGFyKCZi LCAnXDAnKTsKKyAgICAgIGNhc2UgJ3gnOiBjYXNlICdYJzogeworICAgICAgICBzaXplX3QgbCA9 IHNpemU7CisgICAgICAgIHdoaWxlIChsLS0gPiAwKSBsdWFMX3B1dGNoYXIoJmIsICdcMCcpOwog ICAgICAgICBicmVhazsKICAgICAgIH0KICAgICAgIGNhc2UgJ2YnOiB7CkBAIC0xOTYsMTUgKzIy OSwyMSBAQAogICAgICAgICBicmVhazsKICAgICAgIH0KICAgICAgIGNhc2UgJ2QnOiB7Ci0gICAg ICAgIGRvdWJsZSBkID0gbHVhTF9jaGVja251bWJlcihMLCBhcmcrKyk7CisgICAgICAgIHVuaW9u IGRibHN3YXAgZDsKKyAgICAgICAgZC5kYmwgPSBsdWFMX2NoZWNrbnVtYmVyKEwsIGFyZysrKTsK ICAgICAgICAgY29ycmVjdGJ5dGVzKChjaGFyICopJmQsIHNpemUsIGguZW5kaWFuKTsKKyAgICAg ICAgaWYgKGguZGJsc3dhcCkgeworICAgICAgICAgICAgbG9uZyB0bXAgPSBkLmxbMF07CisgICAg ICAgICAgICBkLmxbMF0gPSBkLmxbMV07CisgICAgICAgICAgICBkLmxbMV0gPSB0bXA7CisgICAg ICAgIH0KICAgICAgICAgbHVhTF9hZGRsc3RyaW5nKCZiLCAoY2hhciAqKSZkLCBzaXplKTsKICAg ICAgICAgYnJlYWs7CiAgICAgICB9CiAgICAgICBjYXNlICdjJzogY2FzZSAncyc6IHsKICAgICAg ICAgc2l6ZV90IGw7CiAgICAgICAgIGNvbnN0IGNoYXIgKnMgPSBsdWFMX2NoZWNrbHN0cmluZyhM LCBhcmcrKywgJmwpOwotICAgICAgICBpZiAoc2l6ZSA9PSAwKSBzaXplID0gbDsKKyAgICAgICAg aWYgKG9wdCA9PSAncycgfHwgKG9wdCA9PSAnYycgJiYgZm10Wy0xXSA9PSAnYycpKSBzaXplID0g bDsKICAgICAgICAgbHVhTF9hcmdjaGVjayhMLCBsID49IChzaXplX3Qpc2l6ZSwgYXJnLCAic3Ry aW5nIHRvbyBzaG9ydCIpOwogICAgICAgICBsdWFMX2FkZGxzdHJpbmcoJmIsIHMsIHNpemUpOwog ICAgICAgICBpZiAob3B0ID09ICdzJykgewpAQCAtMjEzLDEyICsyNTIsMTkgQEAKICAgICAgICAg fQogICAgICAgICBicmVhazsKICAgICAgIH0KKyAgICAgIGNhc2UgJz0nOiB7CisgICAgICAgIGlm IChwb3NjbnQgPCBzaXplb2YocG9zQnVmKS9zaXplb2YocG9zQnVmWzBdKSkKKyAgICAgICAgICAg IHBvc0J1Zltwb3NjbnQrK10gPSB0b3RhbHNpemUgKyAxOworICAgICAgICBicmVhazsKKyAgICAg IH0KICAgICAgIGRlZmF1bHQ6IGNvbW1vbmNhc2VzKEwsIG9wdCwgJmZtdCwgJmgpOwogICAgIH0K ICAgICB0b3RhbHNpemUgKz0gc2l6ZTsKICAgfQogICBsdWFMX3B1c2hyZXN1bHQoJmIpOwotICBy ZXR1cm4gMTsKKyAgZm9yIChhcmcgPSAwOyBhcmcgPCBwb3NjbnQ7IGFyZysrKQorICAgICAgbHVh X3B1c2hpbnRlZ2VyKEwsIHBvc0J1ZlthcmddKTsKKyAgcmV0dXJuIHBvc2NudCArIDE7CiB9CiAK IApAQCAtMjUwLDggKzI5NiwyNCBAQAogICBIZWFkZXIgaDsKICAgY29uc3QgY2hhciAqZm10ID0g bHVhTF9jaGVja3N0cmluZyhMLCAxKTsKICAgc2l6ZV90IGxkOwotICBjb25zdCBjaGFyICpkYXRh ID0gbHVhTF9jaGVja2xzdHJpbmcoTCwgMiwgJmxkKTsKLSAgc2l6ZV90IHBvcyA9IGx1YUxfb3B0 aW50ZWdlcihMLCAzLCAxKSAtIDE7CisgIGNvbnN0IGNoYXIgKmRhdGE7CisgIHNpemVfdCBwb3M7 CisgIGx1YV9OdW1iZXIgbGFzdG51bSA9IDA7CisKKyAgdm9pZCBwdXNobnVtYmVyKGx1YV9OdW1i ZXIgbikgeworICAgICAgbGFzdG51bSA9IG47CisgICAgICBpZiAoaC5ub2Fzc2lnbikgcmV0dXJu OworICAgICAgbHVhX3B1c2hudW1iZXIoTCwgbik7CisgIH0KKworICBpZiAobHVhX2lzdXNlcmRh dGEoTCwgMikpIHsKKyAgICBkYXRhID0gKGNvbnN0IGNoYXIqKWx1YV90b3VzZXJkYXRhKEwsIDIp OworICAgIGxkID0gKHNpemVfdClsdWFMX2NoZWNraW50ZWdlcihMLCAzKTsKKyAgICBwb3MgPSBs dWFMX29wdGludGVnZXIoTCwgNCwgMSkgLSAxOworICB9IGVsc2UgeworICAgIGRhdGEgPSBsdWFM X2NoZWNrbHN0cmluZyhMLCAyLCAmbGQpOworICAgIHBvcyA9IGx1YUxfb3B0aW50ZWdlcihMLCAz LCAxKSAtIDE7CisgIH0KICAgZGVmYXVsdG9wdGlvbnMoJmgpOwogICBsdWFfc2V0dG9wKEwsIDIp OwogICB3aGlsZSAoKmZtdCkgewpAQCAtMjU5LDQwICszMjEsNDUgQEAKICAgICBzaXplX3Qgc2l6 ZSA9IG9wdHNpemUoTCwgb3B0LCAmZm10KTsKICAgICBwb3MgKz0gZ2V0dG9hbGlnbihwb3MsICZo LCBvcHQsIHNpemUpOwogICAgIGx1YUxfYXJnY2hlY2soTCwgcG9zK3NpemUgPD0gbGQsIDIsICJk YXRhIHN0cmluZyB0b28gc2hvcnQiKTsKKyAgICBpZiAob3B0ID09ICdYJykKKyAgICAgICAgc2l6 ZSA9IDA7CiAgICAgc3dpdGNoIChvcHQpIHsKICAgICAgIGNhc2UgJ2InOiBjYXNlICdCJzogY2Fz ZSAnaCc6IGNhc2UgJ0gnOgogICAgICAgY2FzZSAnbCc6IGNhc2UgJ0wnOiBjYXNlICdpJzogIGNh c2UgJ0knOiB7ICAvKiBpbnRlZ2VyIHR5cGVzICovCiAgICAgICAgIGludCBpc3NpZ25lZCA9IGlz bG93ZXIob3B0KTsKICAgICAgICAgbHVhX051bWJlciByZXMgPSBnZXRpbnRlZ2VyKGRhdGErcG9z LCBoLmVuZGlhbiwgaXNzaWduZWQsIHNpemUpOwotICAgICAgICBsdWFfcHVzaG51bWJlcihMLCBy ZXMpOworICAgICAgICBwdXNobnVtYmVyKHJlcyk7CiAgICAgICAgIGJyZWFrOwogICAgICAgfQot ICAgICAgY2FzZSAneCc6IHsKKyAgICAgIGNhc2UgJ3gnOiBjYXNlICdYJzogewogICAgICAgICBi cmVhazsKICAgICAgIH0KICAgICAgIGNhc2UgJ2YnOiB7CiAgICAgICAgIGZsb2F0IGY7CiAgICAg ICAgIG1lbWNweSgmZiwgZGF0YStwb3MsIHNpemUpOwogICAgICAgICBjb3JyZWN0Ynl0ZXMoKGNo YXIgKikmZiwgc2l6ZW9mKGYpLCBoLmVuZGlhbik7Ci0gICAgICAgIGx1YV9wdXNobnVtYmVyKEws IGYpOworICAgICAgICBwdXNobnVtYmVyKGYpOwogICAgICAgICBicmVhazsKICAgICAgIH0KICAg ICAgIGNhc2UgJ2QnOiB7Ci0gICAgICAgIGRvdWJsZSBkOworICAgICAgICB1bmlvbiBkYmxzd2Fw IGQ7CiAgICAgICAgIG1lbWNweSgmZCwgZGF0YStwb3MsIHNpemUpOwogICAgICAgICBjb3JyZWN0 Ynl0ZXMoKGNoYXIgKikmZCwgc2l6ZW9mKGQpLCBoLmVuZGlhbik7Ci0gICAgICAgIGx1YV9wdXNo bnVtYmVyKEwsIGQpOworICAgICAgICBpZiAoaC5kYmxzd2FwKSB7CisgICAgICAgICAgICBsb25n IHRtcCA9IGQubFswXTsKKyAgICAgICAgICAgIGQubFswXSA9IGQubFsxXTsKKyAgICAgICAgICAg IGQubFsxXSA9IHRtcDsKKyAgICAgICAgfQorICAgICAgICBwdXNobnVtYmVyKGQuZGJsKTsKICAg ICAgICAgYnJlYWs7CiAgICAgICB9CiAgICAgICBjYXNlICdjJzogewotICAgICAgICBpZiAoc2l6 ZSA9PSAwKSB7Ci0gICAgICAgICAgaWYgKCFsdWFfaXNudW1iZXIoTCwgLTEpKQotICAgICAgICAg ICAgbHVhTF9lcnJvcihMLCAiZm9ybWF0IGBjMCcgbmVlZHMgYSBwcmV2aW91cyBzaXplIik7Ci0g ICAgICAgICAgc2l6ZSA9IGx1YV90b251bWJlcihMLCAtMSk7Ci0gICAgICAgICAgbHVhX3BvcChM LCAxKTsKKyAgICAgICAgaWYgKGZtdFstMV0gPT0gJ2MnKSB7CisgICAgICAgICAgc2l6ZSA9IGxh c3RudW07CiAgICAgICAgICAgbHVhTF9hcmdjaGVjayhMLCBwb3Mrc2l6ZSA8PSBsZCwgMiwgImRh dGEgc3RyaW5nIHRvbyBzaG9ydCIpOwogICAgICAgICB9Ci0gICAgICAgIGx1YV9wdXNobHN0cmlu ZyhMLCBkYXRhK3Bvcywgc2l6ZSk7CisgICAgICAgIGlmICghaC5ub2Fzc2lnbikKKyAgICAgICAg ICAgIGx1YV9wdXNobHN0cmluZyhMLCBkYXRhK3Bvcywgc2l6ZSk7CiAgICAgICAgIGJyZWFrOwog ICAgICAgfQogICAgICAgY2FzZSAncyc6IHsKQEAgLTMwMCw3ICszNjcsMTIgQEAKICAgICAgICAg aWYgKGUgPT0gTlVMTCkKICAgICAgICAgICBsdWFMX2Vycm9yKEwsICJ1bmZpbmlzaGVkIHN0cmlu ZyBpbiBkYXRhIik7CiAgICAgICAgIHNpemUgPSAoZSAtIChkYXRhK3BvcykpICsgMTsKLSAgICAg ICAgbHVhX3B1c2hsc3RyaW5nKEwsIGRhdGErcG9zLCBzaXplIC0gMSk7CisgICAgICAgIGlmICgh aC5ub2Fzc2lnbikKKyAgICAgICAgICAgIGx1YV9wdXNobHN0cmluZyhMLCBkYXRhK3Bvcywgc2l6 ZSAtIDEpOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGNhc2UgJz0nOiB7CisgICAg ICAgIGx1YV9wdXNoaW50ZWdlcihMLCBwb3MgKyAxKTsKICAgICAgICAgYnJlYWs7CiAgICAgICB9 CiAgICAgICBkZWZhdWx0OiBjb21tb25jYXNlcyhMLCBvcHQsICZmbXQsICZoKTsK --0016e6d7e924ad8e480475f489f1-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 05:11:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F8BcUV016432; Thu, 15 Oct 2009 05:11:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A508519383; Thu, 15 Oct 2009 06:10:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A40F819198 for ; Thu, 15 Oct 2009 06:10:22 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so149818eye.39 for ; Thu, 15 Oct 2009 01:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Ofci84zd2XkgLfC3nMLPLFIiCS1/3A5hE7QtA2ri2s8=; b=FWwihb3o6tJZrllqSGbdO2badNtKULRGGzQGsl4fwuEmLAg8qrCZnZGpZCAU4666XV lHYRjT8FXsZpSel0S6Ej/Th6yhghLTI3zUBr7H5RooSUpVgrbsgw4pirZIK+mbPmPlPs DLlTlZ6NAJU472yLp6BxT70WG12YtV6zMts2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=hu+ZaMLRkuRPMqg2Pfi74tHZRHOU2u4WDAakliKp0oetJmjBLJank5DzyI2icvRiGS bPfA/XsH4v36mArZ/RP1961EuFdWWmgm+lgV6j2FLjtanpC3skUe9VOIAB6fe8XBCSkd sxC8X7R8dIA9edC4RQu7Mn4/awwD/XlMRZJ1A= Received: by 10.211.171.14 with SMTP id y14mr9247031ebo.58.1255594265973; Thu, 15 Oct 2009 01:11:05 -0700 (PDT) Received: from ?95.78.77.145? ([95.78.77.145]) by mx.google.com with ESMTPS id 5sm2613605eyh.25.2009.10.15.01.11.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Oct 2009 01:11:05 -0700 (PDT) Date: Thu, 15 Oct 2009 12:10:56 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <867458232.20091015121056@gmail.com> To: john Subject: Re[2]: Testing LUA: verify the correctness of a UTF16 LUA port In-Reply-To: <4AD6CE4E.1050204@gladkih.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> <4AD69107.7020107@workspacewhiz.com> <4AD6CE4E.1050204@gladkih.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello john, Thursday, October 15, 2009, 11:25:02 AM, you wrote: > WinNT kernel doesn't know anything about UTF-16 it's pure UCS-2 coded > ;) so, it's a myth that Windows is Unicode aware afaik, it was fixed in Vista or so -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 06:57:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9F9vkRa025199; Thu, 15 Oct 2009 06:57:47 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92C0819399; Thu, 15 Oct 2009 07:56:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E9FA19386 for ; Thu, 15 Oct 2009 07:56:31 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 491D01AA92FA for ; Thu, 15 Oct 2009 05:57:15 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9F9vEU7019678 for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 05:57:14 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Thu, 15 Oct 2009 05:57:14 -0400 From: Sean Conner To: Lua list Subject: Re: Using LuaSocket with non-blocking sockets Message-ID: <20091015095714.GA14232@brevard.conman.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Jonathan Castello once stated: > > I sent this a few days ago, but I haven't seen any replies yet. I > understand that people might just not know, but if someone could just give > me a pointer to where I might find my answers (or even just tell me you > don't know!), that would be fine. > > Thanks again, and apologies for reposting,~Jonathan Castello > > > I'm using non-blocking sockets with LuaSocket under Win32, and I find > > myself looking for a way to tell if a connect() call failed. I can use > > socket.select(nil, {sock}, 0) to see if the socket has connected > > successfully, but I don't see any way to tell if it failed. Looking over > > the WinSock documentation, I notice an 'exceptfds' parameter that comes > > after the read and write tables, but LuaSocket doesn't appear to use it > > at all (its source shows NULL used instead). The WinSock documentation > > says that if a nonblocking socket failed to connect, passing it in as > > part of 'exceptfds' would return the socket as part of that list. > > > > Does anyone have any suggestions for how to work around this? Or better, > > can anyone explain why 'exceptfds' is ignored in LuaSocket? I can't use > > blocking sockets due to the environment I'm writing this script for (as > > a plugin to a single-threaded process), and I don't want to lock up the > > rest of the environment with blocking calls. I've been working on something similar under Linux, but have decided *not* to use LuaSocket but to roll my own (the program is basically the skeleton of a Unix daemon where the socket code is handled in C, and passes each connection off to a Lua thread). I can see two solutions for you: 1. fix LuaSocket to use the exceptfds 2. do something similar to what I did and handle the sockets in C/C++ and handle the logic in Lua (although it took me several long days to get it working how I wanted it to work). I can send you what I have, but it's Linux specific (uses epoll()) and has a few deficiencies, and is meant more for incoming connections than outgoing connections, but it does allow one to write code like: -- implement an echo service function main(socket) while true do socket:write(socket:read("*a")) end end and each connection is its own Lua thread. It couldn't hurt to look at it. Maybe. -spc (I didn't use LuaSocket because I wanted to learn how to embed Lua in an application and I had the skeleton of a daemon already lying around ... ) From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 08:50:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FBoGmi004792; Thu, 15 Oct 2009 08:50:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40AC1193B9; Thu, 15 Oct 2009 09:48:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B917193AD for ; Thu, 15 Oct 2009 09:48:45 -0200 (BRST) Received: by iwn5 with SMTP id 5so432715iwn.11 for ; Thu, 15 Oct 2009 04:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=kKfeIaEt7xiCvh/vWQfB3cGs20cRp8RMBtRScJvS3Xo=; b=Y3ndAl12UuLn0fC+kghgpP/su6KRUYSiH2hBojaYUNBGobK2Tvv2LyGyFe5Yr9OT8L jNWHSd+q/SHP/AjCrQNIEXq4TTUft1tba7IDFKsVFbWNM94H3RBZkLVChvClO/LhUZ1K 2C96EFFsqJLg92qSiKbS3FMHciBisu4w6R1cU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LzmcWAFoTtJvG844NH7ABpRLEGd9YeX0bflNNJZV94fUmDwHaFJqqD823rIONJun1T mBqHLm7t1yF+fBFR95vtheLTpCdTKKa7ZwbRPTyHvIGDQBHx4o7hucKS96AesO7kOYQZ FwTzPXOsQCkm47rqFNj9lnmgW7xkdAgsK7Gto= MIME-Version: 1.0 Received: by 10.231.10.16 with SMTP id n16mr6710456ibn.24.1255607369420; Thu, 15 Oct 2009 04:49:29 -0700 (PDT) Date: Thu, 15 Oct 2009 08:49:28 -0300 Message-ID: Subject: Lua Virtual Machine Implementation From: =?ISO-8859-1?Q?Alex_de_Magalh=E3es?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000325575d123b5f6e0475f7dfb1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325575d123b5f6e0475f7dfb1 Content-Type: text/plain; charset=ISO-8859-1 Hello everybody, I am an undergraduate student and on the course of Dedicated Operating Systems I must choose a theme for a implementation project in system software. I chose to research and implement some changes to the Lua virtual machine. Thus, I would like to know what papers, or books, or tutorials you recommend me to read, and if there are documents describing the implementation of the virtual machine so I can study it. I downloaded the Lua source code, I saw the files related to LVM, but there's not MUCH documentation in the code, and everything I know about its functionality is what I read in articles about it. I'm asking you because there might be a tutorial for those who want to start programming on the LVM itself. Anyway, I'll be waiting for an answer. Grateful, Alex. --000325575d123b5f6e0475f7dfb1 Content-Type: text/html; charset=ISO-8859-1
Hello everybody,

I am an undergraduate student and on the course of Dedicated Operating Systems I must choose a theme for a implementation project in system software. I chose to research and implement some changes to the Lua virtual machine.

Thus, I would like to know what papers, or books, or tutorials you recommend me to read, and if there are documents describing the implementation of the virtual machine so I can study it. I downloaded the Lua source code, I saw the files related to LVM, but there's not MUCH documentation in the code, and everything I know about its functionality is what I read in articles about it.

I'm asking you because there might be a tutorial for those who want to start programming on the LVM itself.

Anyway, I'll be waiting for an answer.

Grateful, Alex.
--000325575d123b5f6e0475f7dfb1-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 10:03:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FD3Swu016040; Thu, 15 Oct 2009 10:03:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3972193A6; Thu, 15 Oct 2009 11:01:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D81A519392 for ; Thu, 15 Oct 2009 11:01:53 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id ED77CE20B6 for ; Thu, 15 Oct 2009 15:02:31 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OMdeQOkzoBP2 for ; Thu, 15 Oct 2009 15:02:22 +0200 (CEST) Received: by steel.pruts.nl (Postfix, from userid 1000) id E5303E20B7; Thu, 15 Oct 2009 15:02:22 +0200 (CEST) Date: Thu, 15 Oct 2009 15:02:22 +0200 From: Ico Doornekamp To: Lua list Subject: Re: Lua Virtual Machine Implementation Message-ID: <20091015130222.GJ13463@pruts.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi Alex, * On 2009-10-15 Alex de Magalhães wrote : > I am an undergraduate student and on the course of Dedicated Operating > Systems I must choose a theme for a implementation project in system > software. I chose to research and implement some changes to the Lua virtual > machine. > > Thus, I would like to know what papers, or books, or tutorials you recommend > me to read, and if there are documents describing the implementation of the > virtual machine so I can study it. I downloaded the Lua source code, I saw > the files related to LVM, but there's not MUCH documentation in the code, > and everything I know about its functionality is what I read in articles > about it. The first thing that comes to mind would be 'The implementation of Lua 5.0', which can be found at http://www.lua.org/doc/jucs05.pdf. Do you plan to publish the results of your research after you're done ? -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 10:04:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FD4HZ3016190; Thu, 15 Oct 2009 10:04:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7856D193C3; Thu, 15 Oct 2009 11:03:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.211.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A4BE19392 for ; Thu, 15 Oct 2009 11:02:57 -0200 (BRST) Received: by ywh5 with SMTP id 5so757565ywh.11 for ; Thu, 15 Oct 2009 06:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UxwZjaoJeSVchkQ9djZoUMOMsLhxlzJDXNK6UAHFjbQ=; b=XhUAxY5AnUx6fHXaOJjqUSIoWzXOf/3DfVfwTAoonXlMvFUUYu/Ag4hr+uHxNoj4ps sQ67mpi4MAX4fQZmGFg39S2ZX9hdvIi75Jm3qXLGbLmN7BsuqWQ2EuPqHaA2iNqVLUgw a+NaEB4QWd7g9XwqmqBFWMErPDnVAOSxWwV2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jeLwfkCOvHxpsntdyVwl4tnTmuCFDzzifqxHOPA/X2euYQJhsaVEGyDFuQ2RgcwYzH aLTuuQpbnvfmkHS/OS3fvEX0oTyexkSaevlim7SZaSarwgaQJWLSx7chePszgzEW+VMI oZIC9Pm4i9DsOTM+BFOJYYe3OCHIuG1F14h/Y= MIME-Version: 1.0 Received: by 10.90.10.1 with SMTP id 1mr148029agj.62.1255611818706; Thu, 15 Oct 2009 06:03:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 13:03:38 +0000 Message-ID: <54e12800910150603r58743df8gcf73d6a905b6b35c@mail.gmail.com> Subject: Re: Lua Virtual Machine Implementation From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9FD4HZ3016190 Hallo, On 10/15/09, Alex de Magalhães wrote: > > Thus, I would like to know what papers, or books, or tutorials you > recommend me to read, and if there are documents describing the > implementation of the virtual machine so I can study it. I downloaded the > Lua source code, I saw the files related to LVM, but there's not MUCH > documentation in the code, and everything I know about its functionality is > what I read in articles about it. > You may enjoy Mike Pall's reading guide to the Lua source code: http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 10:11:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FDBBsQ017463; Thu, 15 Oct 2009 10:11:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAFC718B12; Thu, 15 Oct 2009 11:09:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7D5A188A1 for ; Thu, 15 Oct 2009 11:09:48 -0200 (BRST) Received: by qyk26 with SMTP id 26so582991qyk.5 for ; Thu, 15 Oct 2009 06:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=qQv0JuU2wgclojGpKeH7fO2xhZ55AZsMlrXJ8wXzHtQ=; b=F+JYZbeebElfDQNakTxWD1k4z/iIbABQf7isFa1j4DMSRqmRhHXmI6tyJRlL7z4tbX nbwJzPPN3NWJQCEhpVKQklXFiFCyVtF6j0E7c8CTg9CtxequSqkHRsZcx5ia5A/YR0xP NsA6yKHiLfsxsshurdZtbVRcVKcOi/AO32fDA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=KhPiiSuUKiy0N/8tYqWV4/LiprYOjZyDW6HOh0mTDBKzkvdkbBUffMD0v/kwVL80pH zTBi0Cr3IngRsNnzwtbZ0L31T4d2E1773MxNdqQ2UgkY5lN6e0x8MjOrvKiytBuHbv3u UaIl8qsOguwwscqOLisRv0pVefr9H6/OC/cVs= MIME-Version: 1.0 Received: by 10.224.64.162 with SMTP id e34mr19590qai.150.1255612230218; Thu, 15 Oct 2009 06:10:30 -0700 (PDT) Date: Thu, 15 Oct 2009 15:10:30 +0200 Message-ID: Subject: Programming Gems example code? From: Thijs Koerselman To: Lua list Content-Type: multipart/alternative; boundary=001485f90e7cf5324d0475f900d8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f90e7cf5324d0475f900d8 Content-Type: text/plain; charset=ISO-8859-1 I have been searching for the example code of the book, but I can't seem to find it anywhere. I was about to use the Chapter 3 vardump code. It feels very silly to retype the code from the book. I know it's not very big but still. Is there no repository with all the code which is published in the book? Thijs --001485f90e7cf5324d0475f900d8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have been searching for the example code of the book, but I can't see= m to find it anywhere.=A0

I was about to use the Chapter= 3 vardump code. It feels very silly to retype the code from the book. I kn= ow it's not very big but still. Is there no repository with all the cod= e which is published in the book?

Thijs
--001485f90e7cf5324d0475f900d8-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 10:18:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FDI7ia018630; Thu, 15 Oct 2009 10:18:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05597193D8; Thu, 15 Oct 2009 11:16:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F1EE18A54 for ; Thu, 15 Oct 2009 11:16:50 -0200 (BRST) Received: by ewy26 with SMTP id 26so878096ewy.5 for ; Thu, 15 Oct 2009 06:17:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.3.18 with SMTP id 18mr9064694ebc.80.1255612650780; Thu, 15 Oct 2009 06:17:30 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 15:17:30 +0200 X-Google-Sender-Auth: 86772fb49a991856 Message-ID: Subject: Re: Lua Virtual Machine Implementation From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9FDI7ia018630 2009/10/15 Alex de Magalhães : > Hello everybody, > > I am an undergraduate student and on the course of Dedicated Operating > Systems I must choose a theme for a implementation project in system > software. I chose to research and implement some changes to the Lua virtual > machine. > > Thus, I would like to know what papers, or books, or tutorials you recommend > me to read, and if there are documents describing the implementation of the > virtual machine so I can study it. I downloaded the Lua source code, I saw > the files related to LVM, but there's not MUCH documentation in the code, > and everything I know about its functionality is what I read in articles > about it. > > I'm asking you because there might be a tutorial for those who want to start > programming on the LVM itself. > A great ressource is : A No Frills Intro To Lua 5.1 VM Instructions François. > Anyway, I'll be waiting for an answer. > > Grateful, Alex. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 10:23:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FDNjMZ019726; Thu, 15 Oct 2009 10:23:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89DDA193DD; Thu, 15 Oct 2009 11:22:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dc.BULL.CO.MA (dc.bull.co.ma [196.12.220.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8BEF193D3 for ; Thu, 15 Oct 2009 11:22:28 -0200 (BRST) Received: from [192.168.17.56] ([192.168.17.56]) by dc.BULL.CO.MA with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 Oct 2009 13:20:06 +0000 Message-ID: <4AD7222C.2010602@bull.co.ma> Date: Thu, 15 Oct 2009 13:22:52 +0000 From: Robert SMITH User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 15 Oct 2009 13:20:06.0046 (UTC) FILETIME=[360ACBE0:01CA4D9A] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: >uri cohen wrote: >> > My question is on how can I verify my port works? Other than toy scripts >> > I created, I'm looking for a comprehensive set of tests I can run in >> > order to verify all important language feature were not broken... > > Unicode is harder than it looks... one reason Lua doesn't really use it > is that once you start dealing with Unicode you start finding places > where you get conflicting requirements. > > For example, ? can be represented as both U+301 U+0065, or as U+00E9. Do > these compare equal? They are technically the same thing. >... The other question mark above is an é (it got ASCII'd :-). I agree with you about the conflicting requirements, indeed more so because whether Latin small letter e with acute is the same as the unadorned e plus combining acute accent depends on context. In plain French text, I'd say yes, but what about in a mathematical text with variables

e é e̋

, i.e. e, e-acute, e-double-accute. In that case I'd say no, as maintaining the separation of the base letter and the diacritic would probably be important. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 11:16:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FEGe8E031599; Thu, 15 Oct 2009 11:16:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B115193C1; Thu, 15 Oct 2009 12:15:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DEFCB193B5 for ; Thu, 15 Oct 2009 12:15:11 -0200 (BRST) Received: by iwn5 with SMTP id 5so517868iwn.11 for ; Thu, 15 Oct 2009 07:15:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.20.230 with SMTP id g38mr246587ibb.49.1255616152243; Thu, 15 Oct 2009 07:15:52 -0700 (PDT) In-Reply-To: <20091013164103.39c61f3d@trite.i.flarn.net.i.flarn.net> References: <4AD49C8C.6080504@cowlark.com> <20091013164103.39c61f3d@trite.i.flarn.net.i.flarn.net> Date: Thu, 15 Oct 2009 10:15:52 -0400 X-Google-Sender-Auth: 37bb12da7d82145b Message-ID: Subject: Re: IUP rock? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 13, 2009 at 11:41 AM, Rob Kendrick wrote: > On Tue, 13 Oct 2009 16:28:12 +0100 > David Given wrote: >> Does anyone have a rock (or Debian package!) for IUP? >> >> I've been spoilt by so many years of configure scripts that I now >> cannot figure out how to install it. > > I spent a few days trying this too; please share any insights found! Peter Kapec added CMake build files for IUP in LuaDist [1]. Build the iup package for just the C libraries and optionally the iuplua package for Lua wrappers. These install dependent cd/cdlua and im/imlua packages. I've built on various Windows and Linux compilers, but there still could be some minor issues as things are in flux, so let me know you come across any problems. [1] http://lua-users.org/wiki/LuaDist From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 12:05:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FF5ENO010190; Thu, 15 Oct 2009 12:05:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 644CF192A7; Thu, 15 Oct 2009 13:04:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B245190D3 for ; Thu, 15 Oct 2009 13:03:55 -0200 (BRST) Received: by fxm12 with SMTP id 12so1339543fxm.5 for ; Thu, 15 Oct 2009 08:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=I5WNKsR+vseY3Knck7GTOUEEzpJaTegPguNV3f2Y2k0=; b=x0wZSxAh4fGf+AARh1HtY9g4WmjM5+LIgR/muVRGsGeM3BGxrukz+eqIMetwP1OSLs WslS6uuSIZ4mZ/r0erZnnq1do78GDX2bMT58tWla5JY69Df8K4Z1PkEuS0PBBXhZXq90 7xgHoXn9RXtDSynlhjmgtJjr/DQK5kBT3u0WE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=OblQatmRjWXTMVuJGnSRDOA2nX6A3lNC7GJCI5wFhtSfjGaaUxuR51NGnYFBS8d4My 822ZCAy7fas1zFPXAmNg815xrWJcuDWig554LlgrfbCE+1IgUOCebwg0D6KZKL5GaKJg Wl96mljiIMLEdslg23uYpoKbUsMKl0PhV2NhA= MIME-Version: 1.0 Received: by 10.204.10.20 with SMTP id n20mr101360bkn.161.1255619077579; Thu, 15 Oct 2009 08:04:37 -0700 (PDT) Date: Thu, 15 Oct 2009 11:04:37 -0400 X-Google-Sender-Auth: c6bf475c438e2ee4 Message-ID: Subject: a new domain for the LuaForge mirror From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The LuaForge mirror is now available on a subdomain of luaforge.net: http://mirror.luaforge.net/ This should make it much easier for you to remember where to find it and for us to move it between hosting providers when we need to. Note that while the mirror shares the domain with LuaForge, it is hosted on an entirely separate server and should not be affected by LuaForge outages. (BTW, if you have suggestions for a better place to host a 3GB mirror, either let me know or bring it up on the luaforge-development list.) - yuri From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 14:22:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FHMcHt004436; Thu, 15 Oct 2009 14:22:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D725C19392; Thu, 15 Oct 2009 15:21:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6ECE192A5 for ; Thu, 15 Oct 2009 15:21:11 -0200 (BRST) Received: by pzk34 with SMTP id 34so1038144pzk.11 for ; Thu, 15 Oct 2009 10:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=gENndSr2+POMoNlSCISXXkvjjRRkeKsDE2DWZ7S8qb0=; b=X9Bt5Vj45oN8LVRCEk3uTxVS69rAPA+SGX0pbViuyZeqtq1Se0bCIRzcozr6PEoIor vZ4Zem5rLW8RN1/HltLozA9bEeHNS6XbHCIlWUdfwe9sf6ZbbnLciC75izVvdyCmgx1Y U4xbh/V0WRT42/7SjpaEa8a3GfQxcNjKCD9b4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fJNQXEZIdzv//gwPrXXaZzcxxla2a1YhQsTmaFYZaY2g++zQ4WRZlj9P9VZ8bV61S2 H4Xu1OKaV3NEHGm8gRl7bfgAp44wA4WpzbePp9ec8zls5D75q0Uu9peFceQvPQsxmSCj HLhhn774w9DMgSiMddJkYqXDopAE1ALBpB35E= MIME-Version: 1.0 Received: by 10.142.248.40 with SMTP id v40mr29151wfh.203.1255627313345; Thu, 15 Oct 2009 10:21:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 10:21:53 -0700 Message-ID: <17eac67c0910151021i2e3116f4sce2c4912b36cc5ac@mail.gmail.com> Subject: Re: Using LuaSocket with non-blocking sockets From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9FHMcHt004436 On Sun, Oct 11, 2009 at 5:28 PM, Jonathan Castello wrote: > I'm using non-blocking sockets with LuaSocket under Win32, and I find myself looking for a way to tell if a connect() call failed. I can use socket.select(nil, {sock}, 0) to see if the socket has connected successfully, but I don't see any way to tell if it failed. Looking over the WinSock documentation, I notice an 'exceptfds' parameter that comes after the read and write tables, but LuaSocket doesn't appear to use it at all (its source shows NULL used instead). The WinSock documentation says that if a nonblocking socket failed to connect, passing it in as part of 'exceptfds' would return the socket as part of that list. I doubt that that winsocket works like that, it would be completely incompatible with the BSD socket API. You're not the first one to be confused by the documentaion, though, "exception" in this case doesn't mean "error", it means "exceptional data", which with TCP means "out-of-band data is pending on the socket". OOB data isn't commonly used outside of older unix protocols like rsh, and telnet. See http://www.cl.cam.ac.uk/cgi-bin/manpage?2+select_tut Anyhow, if connect fails (or any other asynchronous error occurs on a socket, such as a connected socket getting closed), select will return it as either readable, writeable, or both (which you can see below, I'm on a linux box). Then, when you attempt to use the socket, the call will return an error. Cheers, Sam ~/w % lua -l socket Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > s=socket.tcp() s:settimeout(0) return s:connect("192.168.41.2", 9000) nil timeout > r,w, e = socket.select({s}, {s}, 0) > return r[1] tcp{client}: 0x655fd8 > return w[1] tcp{client}: 0x655fd8 > return e nil > = s tcp{client}: 0x655fd8 > = s:receive("*l") nil connection refused > return s:send("*l") nil closed 0 > s=socket.tcp() s:settimeout(0) return s:connect("192.168.41.2", 9000) nil timeout > r,w, e = socket.select({s}, {s}, 0) > return s:send("hi") nil connection refused 0 From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 14:37:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FHb3LD007914; Thu, 15 Oct 2009 14:37:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0BFB193C5; Thu, 15 Oct 2009 15:35:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FC511937E for ; Thu, 15 Oct 2009 15:35:43 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id n9FHaLZU017298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Oct 2009 13:36:24 -0400 (EDT) Date: Thu, 15 Oct 2009 13:36:21 -0400 (EDT) From: Diego Nehab To: Lua list Subject: Re: Using LuaSocket with non-blocking sockets In-Reply-To: <17eac67c0910151021i2e3116f4sce2c4912b36cc5ac@mail.gmail.com> Message-ID: References: <17eac67c0910151021i2e3116f4sce2c4912b36cc5ac@mail.gmail.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5771 signatures=572598 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > Anyhow, if connect fails (or any other asynchronous error > occurs on a socket, such as a connected socket getting > closed), select will return it as either readable, > writeable, or both (which you can see below, I'm on a > linux box). > > Then, when you attempt to use the socket, the call will > return an error. Thanks Sam. I just moved to a new house and didn't have Internet until today. Anyway, there is a file dispatch.lua in the LuaSocket distribution that uses a non-blocking connect. I think that what I do is call connect. It will return "timeout" if connection is in progress. The socket will select writeable once the result of connect arrives. Then you call connect again and it will either work immediately or it will report an error with "alraedy connected". If it says "timeout" again, you know it really timedout. Regards, Diego From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 14:41:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FHfOp2008952; Thu, 15 Oct 2009 14:41:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA6E7193CF; Thu, 15 Oct 2009 15:40:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jor-el.real.com (jor-el.real.com [207.188.23.6]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EA3B193A0 for ; Thu, 15 Oct 2009 15:40:08 -0200 (BRST) Received: from silent.ddns.gh.lan ([::ffff:10.40.22.128]) (AUTH: PLAIN ddunham, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jor-el.real.com with esmtp; Thu, 15 Oct 2009 10:40:50 -0700 id 00098062.4AD75EA2.000035F0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port From: David Dunham In-Reply-To: <4AD6876D.5070802@workspacewhiz.com> Date: Thu, 15 Oct 2009 10:40:48 -0700 Content-Transfer-Encoding: 7bit Message-Id: <1297FC90-5BBC-4B13-B6E7-5EA9E2411F18@gamehouse.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 14 Oct 2009, at 19:22, Joshua Jensen wrote: > I apologize for hijacking the thread, but I really do feel it is > useful to have wide character string support for my work within the > games industry. For applications, wide characters may be worthless. Our games use UTF-8, but user-visible strings come from what are essentially external resources -- Lua code has to look them anyway up so they can be localized. > My understanding is that UCS-2 doesn't support surrogates. I don't > think Microsoft's C runtime wide character library supports them > either. I could be wrong. Again, this is why wide character support seems like the wrong idea -- it is not 21st century Unicode. David Dunham Development Manager +1 206 926 5722 GameHouse Studios From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 14:45:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FHjWnw009778; Thu, 15 Oct 2009 14:45:33 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D206C193D6; Thu, 15 Oct 2009 15:44:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29161193C3 for ; Thu, 15 Oct 2009 15:44:15 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FHivLB009635 for ; Thu, 15 Oct 2009 14:44:57 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9FHiu802059; Thu, 15 Oct 2009 14:44:56 -0300 Date: Thu, 15 Oct 2009 14:44:55 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Programming Gems example code? Message-ID: <20091015144455.A2047@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from thijskoerselman.lists@gmail.com on Thu, Oct 15, 2009 at 03:10:30PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I have been searching for the example code of the book, but I can't seem to > find it anywhere. > I was about to use the Chapter 3 vardump code. It feels very silly to retype > the code from the book. I know it's not very big but still. Is there no > repository with all the code which is published in the book? Whatever code was supplied by the authors in linked to in http://www.lua.org/gems/ The vardump code wasn't linked but it's now available at http://www.lua.org/gems/vardump.lua From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:00:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FI0L2K013040; Thu, 15 Oct 2009 15:00:22 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43A78193B5; Thu, 15 Oct 2009 15:59:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from basmati.dododge.net (static-71-163-52-187.washdc.fios.verizon.net [71.163.52.187]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5E06E192A5 for ; Thu, 15 Oct 2009 15:58:54 -0200 (BRST) Received: (qmail 1897 invoked by uid 1000); 15 Oct 2009 17:59:34 -0000 Date: Thu, 15 Oct 2009 13:59:34 -0400 From: Dave Dodge To: Lua list Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port Message-ID: <20091015175934.GA941@basmati.dododge.net> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> <4AD69107.7020107@workspacewhiz.com> <4AD6A228.40105@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AD6A228.40105@cowlark.com> User-Agent: Mutt/1.5.17 (2008-05-15) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 15, 2009 at 05:16:40AM +0100, David Given wrote: > Yes, in the Unix world it's always 4 (wchar_t is an int). True in general practice, but technically the Unix standard does not require it to be the same size as int. http://www.opengroup.org/onlinepubs/009695399/basedefs/stddef.h.html For example I think there were Unicos implementations where everything except char was 64 bits, but I don't know if Cray still does it that way. -Dave Dodge From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:34:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIXtFI018905; Thu, 15 Oct 2009 15:33:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D26A4193A3; Thu, 15 Oct 2009 16:32:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66FF81937B for ; Thu, 15 Oct 2009 16:32:33 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so1033924fgg.17 for ; Thu, 15 Oct 2009 11:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=5Gty6wrN5+NBzlLvqkMttikSQLjrF+iS23UZ3E8fhlw=; b=nZHaw0lMQ7Ym84W3P1OHGPPkaIkz8bcQ7gAj5/9V6sD0Z4TqASYVsZ3ixpt6izUKyX 03bHVJouiSTyanmWFxuQ0gR5b689icltM99NJxZTrNf84ZsiKqGoClAa6ZpTpnqwGS59 7PcPICW43SdxtL++5+ZVg0/3CF09Rc8Rw8Xzg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=VqfwFJtcCptbMSXYfFy04qlJ3pjWSQeFaCgXkC8J35Ann54kuVzIoEqkLCXQJU1hK+ Ibrhg44xXmS454/j1rhHGLDJq0Mn5dNgEAHUHwBaZeK9N4LuX1BQmePGo5oVA6+ZmXkj FFvtnj45rFF6PfSFnBNI4aXoglHfiqD0BjARk= Received: by 10.86.174.2 with SMTP id w2mr543755fge.0.1255631596988; Thu, 15 Oct 2009 11:33:16 -0700 (PDT) Received: from ?10.178.81.167? ([59.164.64.94]) by mx.google.com with ESMTPS id d4sm275569fga.11.2009.10.15.11.33.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 11:33:15 -0700 (PDT) Message-ID: <4AD76AE4.3080806@gmail.com> Date: Fri, 16 Oct 2009 00:03:08 +0530 From: Altaf User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Problem with luaL_loadbuffer Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello All, I am trying to use luaL_loadbuffer instead of luaL_dofile. The reason being I have my own factory system. I load the file then pass the read data to luaL_loadbuffer. It returns success code. But when I call the function from that script file. the application exits.What do I have to do to fix this problem. Thanks, Altaf From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:42:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIg7wB020935; Thu, 15 Oct 2009 15:42:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7767193D9; Thu, 15 Oct 2009 16:40:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D05B193A0 for ; Thu, 15 Oct 2009 16:40:51 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MyVGY-0005o5-KC for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 20:41:34 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2009 20:41:34 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2009 20:41:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Kepler cleanup Date: Thu, 15 Oct 2009 11:41:03 -0700 Lines: 48 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The site for Kepler needs to be majorly refactored. To a new visitor to the site, it is completely impenetrable, and the disorganization of the site reflects just as poorly on the project as a whole. Every sentence, that is not directed toward current project developers, uses only the broadest of terms rather than conveying an actual detail of the project. Several pages that involve crucial information relating to starting with Kepler (such as how to configure _any_ web server for actual use) openly lack even the most rudimentary text, with the page for Xavante, the bundled server with Kepler, being *completely blank*. Conversely, large sections of the site are devoted to open-ended "puff piece" general topic questions such as "What is web development?" To start addressing the site's specific shortcomings as it stands, the first line of the homepage is: "Kepler is an open source platform that brings the power of Lua to web development." "Platform"? It offers (from what I can piece together, at least) 3 separate, alternative, and conflicting modules that bill themselves as the exact same thing. You can develop "for Linux", "for iPhone", and even "for Lua": you can't develop "for Kepler". Likewise, module documentations keep using terms like "abstraction", "tool", and "framework", but they never contextualize it. .NET and Mediawiki are both "frameworks", but you can't use .NET in place of Mediawiki or vice-versa. These terms are complete non-descriptors in software development: a programming language is an abstraction framework tool, and so is anything written with it. It then goes on to explain several tautologies, such as asking the user, if they're familiar with Lua, to "think about all that power applied to web scripting". If the user is familiar with Lua, they don't need to be told that this power applies to web development if they've been told that Kepler is the application of Lua to web development, or that using Lua for web development allows you to use the modularization of Lua for web development. It's like telling someone that "a tiger is a large cat" and then following it by adding "if you've ever seen a cat move, a tiger moves like that". People can figure out basic interrelationships such as these, and listing them out only takes up space on the page while adding nothing, much like this entire paragraph explaining tautologies. If they're not familiar with the advantages of Lua, they can get them in full from lua.org (one link that is prominently absent from the site as a whole). The purpose of an overview is to explain what the user has arrived at. If the site's target audience is assumed to already be familiar with a topic it mentions in passing, it should provide a link to an in-depth explanation (the topic's home page) for the edge scenario where that's not the case. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:47:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIl7PQ021940; Thu, 15 Oct 2009 15:47:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1DC7193E4; Thu, 15 Oct 2009 16:45:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B85391937D for ; Thu, 15 Oct 2009 16:45:54 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIkagk021830 for ; Thu, 15 Oct 2009 15:46:38 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9FIkao02351; Thu, 15 Oct 2009 15:46:36 -0300 Date: Thu, 15 Oct 2009 15:46:35 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Problem with luaL_loadbuffer Message-ID: <20091015154635.A2345@lua.tecgraf.puc-rio.br> References: <4AD76AE4.3080806@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AD76AE4.3080806@gmail.com>; from altaf.navalur@gmail.com on Fri, Oct 16, 2009 at 12:03:08AM +0530 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Hello All, > I am trying to use luaL_loadbuffer instead of luaL_dofile. The reason > being I have my own factory system. I load the file then pass the read > data to luaL_loadbuffer. > It returns success code. But when I call the function from that script > file. the application exits.What do I have to do to fix this problem. The functions defined in the script are not defined until the script is run. So, use luaL_loadbuffer+lua+pcall. Then call whatever function you want. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:47:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIleSJ022069; Thu, 15 Oct 2009 15:47:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FF65193E5; Thu, 15 Oct 2009 16:46:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73F39193E5 for ; Thu, 15 Oct 2009 16:46:12 -0200 (BRST) Received: by fxm23 with SMTP id 23so1484566fxm.6 for ; Thu, 15 Oct 2009 11:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=GtqBo0oaJdk3VhM3QT9oC3XotcWWcCyM8Fo0IWbvm3o=; b=kld2luL1aQK99l37k4IWZpuVJQH4x1Wu6I+6fG+FiZkZ8Nayp39ZMXqjCrNrzLVinV Mnh7dxXincLL+CQobPClDifCp//bgdN5L9etVf/nVuZwL4qfjZWTQGAZaa5E512qg9vO WQd1UhRqXlrQ1LVipiKpJ/Po+7a0KbAtE4cz4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=mO32FZVNQHoTYzkHpQbdOkoqezYtTp5NgAuUcsvflXjr8N6SU6hAIXEqhDgv6dFo7N 7OFCFX15OO2sUOuXA9xFSpp1dO/nrxdJiPQADFrgDUU7F8s7r0mKob8TrDQpsCZy2YoA BtP0BjZrF9PHAr8twOjqhcImTuDcavoqFiho4= MIME-Version: 1.0 Received: by 10.223.15.86 with SMTP id j22mr73633faa.47.1255632415133; Thu, 15 Oct 2009 11:46:55 -0700 (PDT) In-Reply-To: <16d4c3590910141408j9ec6748ua8ce8de61b673bde@mail.gmail.com> References: <16d4c3590910141408j9ec6748ua8ce8de61b673bde@mail.gmail.com> From: Hisham Date: Thu, 15 Oct 2009 15:46:35 -0300 Message-ID: <5e7d91620910151146m4ec3fa98h23bd46107d5a101d@mail.gmail.com> Subject: Re: LuaRocks on Wikipedia To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9FIleSJ022069 On Wed, Oct 14, 2009 at 6:08 PM, Mike Crowe wrote: > Hey LuaRocks folks, > Was reading http://en.wikipedia.org/wiki/Package_management_system today, > and LuaRocks stands out as incomplete.  Anybody online willing to take a > stable at writing it? I'd love to see it done, but Wikipedia's policies say that I shouldn't be the one doing this. :) -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:48:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FImCiC022212; Thu, 15 Oct 2009 15:48:13 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1054C193F2; Thu, 15 Oct 2009 16:46:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s25.bay0.hotmail.com (bay0-omc1-s25.bay0.hotmail.com [65.54.246.97]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DB76193E5 for ; Thu, 15 Oct 2009 16:46:13 -0200 (BRST) Received: from BAY121-W24 ([207.46.10.59]) by bay0-omc1-s25.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 Oct 2009 11:46:45 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_6fe5becf-0429-4307-a695-d12647f995f9_" X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: Using LuaSocket with non-blocking sockets Date: Thu, 15 Oct 2009 11:46:45 -0700 Importance: Normal In-Reply-To: References: X-OriginalArrivalTime: 15 Oct 2009 18:46:45.0388 (UTC) FILETIME=[D8290CC0:01CA4DC7] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean MIME-Version: 1.0 --_6fe5becf-0429-4307-a695-d12647f995f9_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ---------------------------------------- > Date: Thu=2C 15 Oct 2009 10:21:53 -0700 > Subject: Re: Using LuaSocket with non-blocking sockets > From: vieuxtech@gmail.com > To: lua@bazar2.conectiva.com.br > > On Sun=2C Oct 11=2C 2009 at 5:28 PM=2C Jonathan Castello wrote: > > I'm using non-blocking sockets with LuaSocket under Win32=2C and I find= myself looking for a way to tell if a connect() call failed. I can use soc= ket.select(nil=2C {sock}=2C 0) to see if the socket has connected successfu= lly=2C but I don't see any way to tell if it failed. Looking over the WinSo= ck documentation=2C I notice an 'exceptfds' parameter that comes after the = read and write tables=2C but LuaSocket doesn't appear to use it at all (its= source shows NULL used instead). The WinSock documentation says that if a = nonblocking socket failed to connect=2C passing it in as part of 'exceptfds= ' would return the socket as part of that list. > > I doubt that that winsocket works like that=2C it would be completely > incompatible with the BSD socket API. > > You're not the first one to be confused by the documentaion=2C though=2C > "exception" in this case doesn't mean "error"=2C it means "exceptional > data"=2C which with TCP means "out-of-band data is pending on the > socket". OOB data isn't commonly used outside of older unix protocols > like rsh=2C and telnet. > The WinSock page in this case (http://msdn.microsoft.com/en-us/library/ms74= 0141(VS.85).aspx) specifically says this: exceptfds:- If processing a connect call (nonblocking)=2C connection attemp= t failed.- OOB data is available for reading (only if SO_OOBINLINE is disab= led). Looking over the man page you linked me=2C it doesn't seem like Linux does = it this way=2C which is interesting. From what I'm hearing=2C it looks like= I will need to send a no-op to determine if it failed or is just still con= necting? ~Jonathan Castello =20 _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/= --_6fe5becf-0429-4307-a695-d12647f995f9_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ----------------------------------------
>=3B Date: Thu=2C 15 Oct 2009= 10:21:53 -0700
>=3B Subject: Re: Using LuaSocket with non-blocking so= ckets
>=3B From: vieuxtech@gmail.com
>=3B To: lua@bazar2.conectiv= a.com.br
>=3B
>=3B On Sun=2C Oct 11=2C 2009 at 5:28 PM=2C Jonatha= n Castello wrote:
>=3B >=3B I'm using non-blocking sockets with Lua= Socket under Win32=2C and I find myself looking for a way to tell if a conn= ect() call failed. I can use socket.select(nil=2C {sock}=2C 0) to see if th= e socket has connected successfully=2C but I don't see any way to tell if i= t failed. Looking over the WinSock documentation=2C I notice an 'exceptfds'= parameter that comes after the read and write tables=2C but LuaSocket does= n't appear to use it at all (its source shows NULL used instead). The WinSo= ck documentation says that if a nonblocking socket failed to connect=2C pas= sing it in as part of 'exceptfds' would return the socket as part of that l= ist.
>=3B
>=3B I doubt that that winsocket works like that=2C it = would be completely
>=3B incompatible with the BSD socket API.
>= =3B
>=3B You're not the first one to be confused by the documentaion= =2C though=2C
>=3B "exception" in this case doesn't mean "error"=2C it= means "exceptional
>=3B data"=2C which with TCP means "out-of-band da= ta is pending on the
>=3B socket". OOB data isn't commonly used outsid= e of older unix protocols
>=3B like rsh=2C and telnet.
>=3B

The WinSock page in this case (http://msdn.microsoft.co= m/en-us/library/ms740141(VS.85).aspx) =3Bspecifically says this:

exceptfds:
- If processing a connect call = (nonblocking)=2C connection attempt failed.
- OOB data is availab= le for reading (only if SO_OOBINLINE is disabled).

Looking over the man page you linked me=2C it doesn't seem like Linux does= it this way=2C which is interesting. From what I'm hearing=2C it looks lik= e I will need to send a no-op to determine if it failed or is just still co= nnecting?

~Jonathan Castello


Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Si= gn up now. = --_6fe5becf-0429-4307-a695-d12647f995f9_-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:54:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIsFBJ023360; Thu, 15 Oct 2009 15:54:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7684E193F0; Thu, 15 Oct 2009 16:53:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1921193D6 for ; Thu, 15 Oct 2009 16:52:59 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0Lrd0n-1MHM1F31zx-012ydq; Thu, 15 Oct 2009 14:53:40 -0400 Message-ID: <320B64F9EC2242D1B3CA045C0A208111@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <20091015144455.A2047@lua.tecgraf.puc-rio.br> In-Reply-To: <20091015144455.A2047@lua.tecgraf.puc-rio.br> Subject: Re: Programming Gems example code? Date: Thu, 15 Oct 2009 11:53:17 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1+3jocvCmrY2v8a3Z8GUBGWrUTTMmZUu4NJWQy 8TjEKVDmC/bYCTR4vq56hUzHUMDIN8Kwhi414DT7W2DYNc7Cf6 33ygscYRsdmL1m9OTk5NP1TjU1Xoai+ X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I haven't gotten my copy yet, but is there unlinked code for chapters 3, 10, 11, 13, 19, 20, or 23 as well? -------------------------------------------------- From: "Luiz Henrique de Figueiredo" Sent: Thursday, October 15, 2009 A10:44 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Programming Gems example code? >> I have been searching for the example code of the book, but I can't seem >> to >> find it anywhere. >> I was about to use the Chapter 3 vardump code. It feels very silly to >> retype >> the code from the book. I know it's not very big but still. Is there no >> repository with all the code which is published in the book? > > Whatever code was supplied by the authors in linked to in > http://www.lua.org/gems/ > > The vardump code wasn't linked but it's now available at > http://www.lua.org/gems/vardump.lua > From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 15:56:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FIu376023720; Thu, 15 Oct 2009 15:56:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3917193F9; Thu, 15 Oct 2009 16:54:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 090C8193F3 for ; Thu, 15 Oct 2009 16:54:53 -0200 (BRST) Received: by pzk34 with SMTP id 34so1112384pzk.11 for ; Thu, 15 Oct 2009 11:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=UFqga7xCVz5PPKUfTcsKYQIOuPMnR7+LzscZnaUGc2E=; b=lOJx2qAfAPClIv7lNPCPBZnbWWkefnY1B3eP715Z3CZDFrRoHrvL+yHaHv9fYH6Sa6 K4XJBT/3KkzquE7I8btfrG2hb9ZCtI57SFBgi+PknBi1xWuLgBXElSaUpXDZWyymqOEG klftHuiC1emYRaxnUPepc1NmT06cw2ecI9qgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LqTi+5PhRJxNEONPr+77HZbuYI9IKEP1bDs47H9pVyDUqJFOkmk7U4Gea5qC9sCloB 7Ci7W9JTc/+BLBVtDsfNGck88r6Nve4FSqYwxQTP827iIXhOa7fsae4vpcqGzENe8ecw W381CDk9wpFepgiP2S6Njy0dyWs127Lu2PQXI= MIME-Version: 1.0 Received: by 10.142.7.2 with SMTP id 2mr44038wfg.104.1255632936813; Thu, 15 Oct 2009 11:55:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 11:55:36 -0700 Message-ID: <17eac67c0910151155g72c16aedr1447fb3bba912d7@mail.gmail.com> Subject: Re: Using LuaSocket with non-blocking sockets From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The WinSock page in this case > (http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx) specifically > says this: > exceptfds: > - If processing a connect call (nonblocking), connection attempt failed. > - OOB data is available for reading (only if SO_OOBINLINE is disabled). > Looking over the man page you linked me, it doesn't seem like Linux does it > this way, which is interesting. From what I'm hearing, it looks like I will > need to send a no-op to determine if it failed or is just still connecting? Linux, or any other unixy system, to my knowledge. Have you tried using luasocket's select yet, and verified that it does not in fact work? You can do it from the cmd line very quickly, see the code I posted. Its possible you'll see the connected fd in the read and/or write set. Sam From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 16:44:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FJi3d7003274; Thu, 15 Oct 2009 16:44:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD24C190A3; Thu, 15 Oct 2009 17:42:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A23E18C57 for ; Thu, 15 Oct 2009 17:42:44 -0200 (BRST) Received: by gxk8 with SMTP id 8so1374606gxk.1 for ; Thu, 15 Oct 2009 12:43:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.102.6 with SMTP id e6mr479934agm.99.1255635807322; Thu, 15 Oct 2009 12:43:27 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 22:43:27 +0300 X-Google-Sender-Auth: 0e85c31f36678310 Message-ID: Subject: Re: a new domain for the LuaForge mirror From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e645b7a04343ef0475fe7e94 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e645b7a04343ef0475fe7e94 Content-Type: text/plain; charset=UTF-8 > > Note that while the mirror shares the domain with LuaForge, it is > hosted on an entirely separate server and should not be affected by > LuaForge outages. (BTW, if you have suggestions for a better place to > host a 3GB mirror, either let me know or bring it up on the > luaforge-development list.) No idea about storage, but the DNS server should be mirrored too -- either with a secondary on the 2nd machine or even easier with everydns.com . --0016e645b7a04343ef0475fe7e94 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Note that while = the mirror shares the domain with LuaForge, it is
hosted on an entirely separate server and should not be affected by
LuaForge outages. (BTW, if you have suggestions for a better place to
host a 3GB mirror, either let me know or bring it up on the
luaforge-development list.)

No idea about s= torage, but the DNS server should be mirrored too -- either with a secondar= y on the 2nd machine or even easier=C2=A0with=C2=A0everydns.com.

--0016e645b7a04343ef0475fe7e94-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 16:47:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FJlKmn003954; Thu, 15 Oct 2009 16:47:20 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6032D1917B; Thu, 15 Oct 2009 17:46:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s1.bay0.hotmail.com (bay0-omc1-s1.bay0.hotmail.com [65.54.246.73]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEEE218FCD for ; Thu, 15 Oct 2009 17:45:59 -0200 (BRST) Received: from BAY121-W21 ([207.46.10.56]) by bay0-omc1-s1.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 Oct 2009 12:46:39 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_5baddcae-b193-4b9e-b09e-1919d551f8a5_" X-Originating-IP: [76.174.158.239] From: Jonathan Castello To: Subject: RE: Using LuaSocket with non-blocking sockets Date: Thu, 15 Oct 2009 12:46:39 -0700 Importance: Normal In-Reply-To: References: X-OriginalArrivalTime: 15 Oct 2009 19:46:39.0310 (UTC) FILETIME=[364E06E0:01CA4DD0] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean MIME-Version: 1.0 --_5baddcae-b193-4b9e-b09e-1919d551f8a5_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Date: Thu=2C 15 Oct 2009 11:55:36 -0700 > Subject: Re: Using LuaSocket with non-blocking sockets > From: vieuxtech@gmail.com > To: lua@bazar2.conectiva.com.br >=20 > > The WinSock page in this case > > (http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx) specific= ally > > says this: > > exceptfds: > > - If processing a connect call (nonblocking)=2C connection attempt fail= ed. > > - OOB data is available for reading (only if SO_OOBINLINE is disabled). > > Looking over the man page you linked me=2C it doesn't seem like Linux d= oes it > > this way=2C which is interesting. From what I'm hearing=2C it looks lik= e I will > > need to send a no-op to determine if it failed or is just still connect= ing? >=20 > Linux=2C or any other unixy system=2C to my knowledge. >=20 > Have you tried using luasocket's select yet=2C and verified that it does > not in fact work? >=20 > You can do it from the cmd line very quickly=2C see the code I posted. >=20 > Its possible you'll see the connected fd in the read and/or write set. >=20 > Sam I have experimented with select() before I ever came to Lua-L=2C and tried = to work around its problems on Windows=2C with not much luck. Below is my test run with output. It may also be worth mentioning that I've= noticed while developing my plugin that select({s}=2C {s}=2C nil) will onl= y return 's' in the writefds table=2C no matter how many times in a row I c= all select() - yet the moment I remove 's' from the writefds table=2C it ap= pears in the readfds. It's not particularly applicable to the code below - = neither of them contain 's' - but it's worth further pointing out how diffe= rent WinSock seems to be. (I expect that the sock would have appeared in exceptfds=2C had I access to= it.) > socket =3D require "socket"> s =3D socket.tcp()> s:settimeout(0)> print(s= :connect("192.168.41.2"=2C 9000))nil timeout> r=2Cw=2Ce =3D socket.select({= s}=2C {s}=2C 0)> print(r[1])nil> print(w[1])nil> print(e)timeout> print(s)t= cp{client}: 02A2A070> print(s:receive("*l"))nil Socket is not connected > p= rint(s:send("foobar"))nil Socket is not connected 0 > s =3D socket.tcp()> s:settimeout(0)> print(s:connect("192.168.41.2"=2C 90= 00))nil timeout> r=2Cw=2Ce =3D socket.select({s}=2C {s}=2C 0)> print(s:send= ("foobar"))nil Socket is not connected 0 =20 _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/= --_5baddcae-b193-4b9e-b09e-1919d551f8a5_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>=3B Date: Thu=2C 15 Oct 2009 11:55:36 -0700
>=3B Subject: Re: U= sing LuaSocket with non-blocking sockets
>=3B From: vieuxtech@gmail.co= m
>=3B To: lua@bazar2.conectiva.com.br
>=3B
>=3B >=3B The= WinSock page in this case
>=3B >=3B (http://msdn.microsoft.com/en-u= s/library/ms740141(VS.85).aspx) specifically
>=3B >=3B says this:>=3B >=3B exceptfds:
>=3B >=3B - If processing a connect call (= nonblocking)=2C connection attempt failed.
>=3B >=3B - OOB data is a= vailable for reading (only if SO_OOBINLINE is disabled).
>=3B >=3B L= ooking over the man page you linked me=2C it doesn't seem like Linux does i= t
>=3B >=3B this way=2C which is interesting. From what I'm hearing= =2C it looks like I will
>=3B >=3B need to send a no-op to determine= if it failed or is just still connecting?
>=3B
>=3B Linux=2C or= any other unixy system=2C to my knowledge.
>=3B
>=3B Have you t= ried using luasocket's select yet=2C and verified that it does
>=3B no= t in fact work?
>=3B
>=3B You can do it from the cmd line very q= uickly=2C see the code I posted.
>=3B
>=3B Its possible you'll s= ee the connected fd in the read and/or write set.
>=3B
>=3B Sam<= br>

I have experimented with select() before I ever came= to Lua-L=2C and tried to work around its problems on Windows=2C with not m= uch luck.

Below is my test run with output. It may= also be worth mentioning that I've noticed while developing my plugin that= select({s}=2C {s}=2C nil) will only return 's' in the writefds table=2C no= matter how many times in a row I call select() - yet the moment I remove '= s' from the writefds table=2C it appears in the readfds. It's not particula= rly applicable to the code below - neither of them contain 's' - but it's w= orth further pointing out how different WinSock seems to be.

=
(I expect that the sock would have appeared in exceptfds=2C had = I access to it.)


>=3B socket= =3D require "socket"
>=3B s =3D socket.tcp()
>=3B = s:settimeout(0)
>=3B print(s:connect("192.168.41.2"=2C 9000))
nil timeout
>=3B r=2Cw=2Ce =3D socket.select({s}=2C {s= }=2C 0)
>=3B print(r[1])
nil
>=3B print(w= [1])
nil
>=3B print(e)
timeout
&g= t=3B print(s)
tcp{client}: 02A2A070
>=3B print(s:rece= ive("*l"))
nil Socket is not connected =3B
>=3B p= rint(s:send("foobar"))
nil Socket is not connected 0
>=3B s =3D socket.tcp()
>=3B s:settimeout(0)
>=3B print(s:connect("192.168.41.2"=2C 9000))
nil timeou= t
>=3B r=2Cw=2Ce =3D socket.select({s}=2C {s}=2C 0)
&= gt=3B print(s:send("foobar"))
nil Socket is not connected 0
=


Your E-mail and More On-the-Go. Get Windows L= ive Hotmail Free. Sign up now. = --_5baddcae-b193-4b9e-b09e-1919d551f8a5_-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 17:00:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FK0VAe006423; Thu, 15 Oct 2009 17:00:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E7271A600; Thu, 15 Oct 2009 17:59:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D67E192A5 for ; Thu, 15 Oct 2009 17:59:13 -0200 (BRST) Received: by ywh40 with SMTP id 40so39105ywh.33 for ; Thu, 15 Oct 2009 12:59:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.189.1 with SMTP id r1mr484068agp.109.1255636796685; Thu, 15 Oct 2009 12:59:56 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 22:59:56 +0300 X-Google-Sender-Auth: be5654679ef65305 Message-ID: Subject: Re: Kepler cleanup From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e64602d63bbf560475feb917 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64602d63bbf560475feb917 Content-Type: text/plain; charset=UTF-8 It's ironic how many open software projects today have wiki-based websites but they miss the point of how a wiki works (wikipedia and c2.com still do it right). Should a wiki had been open for anybody to write (yes, without login or subscription or asking email or everything!), maybe your time would have been better served -- you might have shown us a little on how to do it right instead of writing this long critique :) On Thu, Oct 15, 2009 at 21:41, Stuart P.Bentley wrote: > The site for Kepler needs to be majorly refactored. To a new visitor to the > site, it is completely impenetrable, and the disorganization of the site > reflects just as poorly on the project as a whole. Every sentence, that is > not directed toward current project developers, uses only the broadest of > terms rather than conveying an actual detail of the project. Several pages > that involve crucial information relating to starting with Kepler (such as > how to configure _any_ web server for actual use) openly lack even the most > rudimentary text, with the page for Xavante, the bundled server with Kepler, > being *completely blank*. Conversely, large sections of the site are devoted > to open-ended "puff piece" general topic questions such as "What is web > development?" > > To start addressing the site's specific shortcomings as it stands, the > first line of the homepage is: > > "Kepler is an open source platform that brings the power of Lua to web > development." > > "Platform"? It offers (from what I can piece together, at least) 3 > separate, alternative, and conflicting modules that bill themselves as the > exact same thing. You can develop "for Linux", "for iPhone", and even "for > Lua": you can't develop "for Kepler". Likewise, module documentations keep > using terms like "abstraction", "tool", and "framework", but they never > contextualize it. .NET and Mediawiki are both "frameworks", but you can't > use .NET in place of Mediawiki or vice-versa. These terms are complete > non-descriptors in software development: a programming language is an > abstraction framework tool, and so is anything written with it. > > It then goes on to explain several tautologies, such as asking the user, if > they're familiar with Lua, to "think about all that power applied to web > scripting". If the user is familiar with Lua, they don't need to be told > that this power applies to web development if they've been told that Kepler > is the application of Lua to web development, or that using Lua for web > development allows you to use the modularization of Lua for web development. > It's like telling someone that "a tiger is a large cat" and then following > it by adding "if you've ever seen a cat move, a tiger moves like that". > People can figure out basic interrelationships such as these, and listing > them out only takes up space on the page while adding nothing, much like > this entire paragraph explaining tautologies. > > If they're not familiar with the advantages of Lua, they can get them in > full from lua.org (one link that is prominently absent from the site as a > whole). The purpose of an overview is to explain what the user has arrived > at. If the site's target audience is assumed to already be familiar with a > topic it mentions in passing, it should provide a link to an in-depth > explanation (the topic's home page) for the edge scenario where that's not > the case. > > --0016e64602d63bbf560475feb917 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It's ironic how many open software projects today have wiki-based = websites but they miss the point of how a wiki works (wikipedia and c2.com still do it right). Should a wiki had been op= en for anybody to write (yes, without login or subscription or asking email= or everything!), maybe your time would have been better served -- you migh= t have shown us a little on how to do it right instead of writing this long= critique :)

On Thu, Oct 15, 2009 at 21:41, St= uart P.Bentley <stuart@testtrack4.com> wrote:
The site for Kepler needs to be majorly refactored. To a new visitor to the= site, it is completely impenetrable, and the disorganization of the site r= eflects just as poorly on the project as a whole. Every sentence, that is n= ot directed toward current project developers, uses only the broadest of te= rms rather than conveying an actual detail of the project. Several pages th= at involve crucial information relating to starting with Kepler (such as ho= w to configure _any_ web server for actual use) openly lack even the most r= udimentary text, with the page for Xavante, the bundled server with Kepler,= being *completely blank*. Conversely, large sections of the site are devot= ed to open-ended "puff piece" general topic questions such as &qu= ot;What is web development?"

To start addressing the site's specific shortcomings as it stands, the = first line of the homepage is:

"Kepler is an open source platform that brings the power of Lua to web= development."

"Platform"? It offers (from what I can piece together, at least) = 3 separate, alternative, and conflicting modules that bill themselves as th= e exact same thing. You can develop "for Linux", "for iPhone= ", and even "for Lua": you can't develop "for Keple= r". Likewise, module documentations keep using terms like "abstra= ction", "tool", and "framework", but they never co= ntextualize it. .NET and Mediawiki are both "frameworks", but you= can't use .NET in place of Mediawiki or vice-versa. These terms are co= mplete non-descriptors in software development: a programming language is a= n abstraction framework tool, and so is anything written with it.

It then goes on to explain several tautologies, such as asking the user, if= they're familiar with Lua, to "think about all that power applied= to web scripting". If the user is familiar with Lua, they don't n= eed to be told that this power applies to web development if they've be= en told that Kepler is the application of Lua to web development, or that u= sing Lua for web development allows you to use the modularization of Lua fo= r web development. It's like telling someone that "a tiger is a la= rge cat" and then following it by adding "if you've ever seen= a cat move, a tiger moves like that". People can figure out basic int= errelationships such as these, and listing them out only takes up space on = the page while adding nothing, much like this entire paragraph explaining t= autologies.

If they're not familiar with the advantages of Lua, they can get them i= n full from lua.org (one l= ink that is prominently absent from the site as a whole). The purpose of an= overview is to explain what the user has arrived at. If the site's tar= get audience is assumed to already be familiar with a topic it mentions in = passing, it should provide a link to an in-depth explanation (the topic'= ;s home page) for the edge scenario where that's not the case.

--0016e64602d63bbf560475feb917-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 18:02:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FL2ITQ017174; Thu, 15 Oct 2009 18:02:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E304C18E58; Thu, 15 Oct 2009 19:01:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C2E018D75 for ; Thu, 15 Oct 2009 19:00:59 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from [137.131.248.101] by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRK00773QDT1140@asmtp029.mac.com> for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 14:01:07 -0700 (PDT) From: Craig Yoshioka Subject: LuaJIT and Snow Leopard Date: Thu, 15 Oct 2009 14:01:05 -0700 Message-id: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I get an architecture not supported error when trying to compile LuaJIT (dynasm) now that I have upgraded to Mac OS X 10.6. The LuaJIT binary I compiled before upgrading still works, but I'd like to stay up-to-date. Any idea how I go about fixing this? I'm guessing it might be as simple as changing some #defines or something like that. Thanks! From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 18:04:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FL4FuM017400; Thu, 15 Oct 2009 18:04:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CBE218EC5; Thu, 15 Oct 2009 19:03:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE07218E73 for ; Thu, 15 Oct 2009 19:03:06 -0200 (BRST) Received: by yxe17 with SMTP id 17so1459969yxe.33 for ; Thu, 15 Oct 2009 14:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=k4q5FT3cxL1wEN0XnpyhqDF0UeuR7+UsGKpt6eYkJQ0=; b=AewYOP0j6n33ZEGKHGDQbKucws8WLNW7PY+jgp8H1PJ1mGSpuOJpAvU5AqZuW7Ae0A I+0V2TyCgNhS3xqvl4L28h1GG9KAhmswKr4THSd1UyfTY4zMmydMilEGw3l3aOGD0aIA dTJkqdlz67qkNcgg27i336CRKfZ13Q+Blq4bc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=MTDMi1uN3e8daDjZmrdeVSE24hy0pYkaVWJxcDvDg6ZS26aEp46LeLCzMbdfjXrVAZ mrM+vu+o0hYZIQ4hoCDjL4i+XuBgpH36KcemwMNsrx2uzNmKx1vOKHK3AYv8Q7EhNeDq zeA/Tk7XNCNQXhG+sPqwZfKQJqSjJDKiWckww= MIME-Version: 1.0 Received: by 10.101.27.20 with SMTP id e20mr843466anj.137.1255640628580; Thu, 15 Oct 2009 14:03:48 -0700 (PDT) In-Reply-To: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> References: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> From: "Thomas Harning Jr." Date: Thu, 15 Oct 2009 17:03:28 -0400 Message-ID: Subject: Re: LuaJIT and Snow Leopard To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9FL4FuM017400 On Thu, Oct 15, 2009 at 5:01 PM, Craig Yoshioka wrote: > Hi all, > > I get an architecture not supported error when trying to compile LuaJIT > (dynasm) now that I have upgraded to Mac OS X 10.6.  The LuaJIT binary I > compiled before upgrading still works, but I'd like to stay up-to-date.  Any > idea how I go about fixing this?  I'm guessing it might be as simple as > changing some #defines or something like that.  Thanks! Not so simple... OSX 10.6 introduces x86_64 as the default architecture, so LuaJIT will need to be forced to compile only for x86 (32-bit mode) -- Thomas Harning Jr. From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 18:07:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FL74r4017829; Thu, 15 Oct 2009 18:07:05 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 542E318F75; Thu, 15 Oct 2009 19:06:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86F8D18D88 for ; Thu, 15 Oct 2009 19:05:48 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8E74AAA4D1 for ; Thu, 15 Oct 2009 17:06:30 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 15 Oct 2009 17:06:30 -0400 X-Sasl-enc: grbALNambNKk3Tzy+EE+FnWZkxpZs3XbrsBk0jVxFtyI 1255640790 Received: from [10.1.1.3] (222-152-77-118.jetstream.xtra.co.nz [222.152.77.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id B753C6B873 for ; Thu, 15 Oct 2009 17:06:29 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: LuaJIT and Snow Leopard From: Geoff Leyland In-Reply-To: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> Date: Fri, 16 Oct 2009 10:05:56 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Hi all, > > I get an architecture not supported error when trying to compile > LuaJIT (dynasm) now that I have upgraded to Mac OS X 10.6. The > LuaJIT binary I compiled before upgrading still works, but I'd like > to stay up-to-date. Any idea how I go about fixing this? I'm > guessing it might be as simple as changing some #defines or > something like that. Thanks! Have you tried adding either -m32 or -m64 to the compiler command line? I got a similar problem, and I think it was because I was building a 64 bit module and trying to link it to a 32 bit lua (a lua that I still had from before the upgrade to SL). I suspect that if you rebuild everything, you'll end up with all 64 bit and you'll be ok, but Thomas has just pointed out that LuaJIT is 32 bit only, so perhaps you want to keep everything 32 bit. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 18:53:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FLr7Wo024241; Thu, 15 Oct 2009 18:53:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF83F189D4; Thu, 15 Oct 2009 19:51:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 589B51888A for ; Thu, 15 Oct 2009 19:51:48 -0200 (BRST) Received: by fxm23 with SMTP id 23so1726364fxm.6 for ; Thu, 15 Oct 2009 14:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=dTDW/Ii8rRROkq6/eVNhiZbG8NO6RR8EujoxtZSeSTM=; b=IlEI/wbLQmYViygdyTJS/ZNgcLWDIn1+QM61mWTIdabz7b7q7CSgKpskvuHzJqT8yt 5COXRVLZpEotwFikxWyUfxcaoRr5/zPDXI2/HWhbJIZ91yOFiYXKg8qHdsT3Q8AIIQ2a cQdQwAAWo24zeMkl1KHUQfyM087EwmpILei9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FbkSWFic4lIt5egTIICkT0B8pmmQFnGTlOj+Kxl4bTXCJZpSbwELBc4Q9eU6Dgm9Ye JtF77dVXGkHZe9DMdJ4NX4YUKUfhrXi2qVlT1puBn51Nc6FPB+pdD4Pzsne/1pJneSIL cCRjJrSCKtYDxMYgvhnMFWxJdu8eamG3n5J6Q= MIME-Version: 1.0 Received: by 10.223.145.130 with SMTP id d2mr100157fav.78.1255643551177; Thu, 15 Oct 2009 14:52:31 -0700 (PDT) In-Reply-To: References: From: Jim Whitehead II Date: Thu, 15 Oct 2009 22:52:11 +0100 Message-ID: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> Subject: Re: Kepler cleanup To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 15, 2009 at 8:59 PM, Cosmin Apreutesei wrote: > It's ironic how many open software projects today have wiki-based websites > but they miss the point of how a wiki works (wikipedia and c2.com still do > it right). Should a wiki had been open for anybody to write (yes, without > login or subscription or asking email or everything!), maybe your time would > have been better served -- you might have shown us a little on how to do it > right instead of writing this long critique :) The wiki is open for editing. Click the 'edit' button on any page, and you get to edit it without requiring login or subscription. I'm not sure if you're saying that it should have been (it is), or that Stuart should have provided his feedback there, but wanted to clarify. - Jim From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 19:43:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FMh3wk030740; Thu, 15 Oct 2009 19:43:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B89C6193BE; Thu, 15 Oct 2009 20:41:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2815A19358 for ; Thu, 15 Oct 2009 20:41:38 -0200 (BRST) Received: by fxm23 with SMTP id 23so1781140fxm.6 for ; Thu, 15 Oct 2009 15:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=xJWFKdrlZ+/VY36dXwYHLMe196GhM+s4s28z7WVFzns=; b=JqJBPPXzt2L0XpeJSSb3PmOACqY4GEl0Nf6Qlpr8LFs45+3acvGbwO5TVPs7CUkxea SOTobQXkXXuZ+vGa3pwpmTZiTl5kg/CuSwJXq07r0vOOux+BSwaj0Kj/vj6MdXA+xqdU Nb9l5/B5SsRJhYd1QUCOtnywpgJwtuLnsQEwU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=RjoE4B+c4/hKEY5Cct7bd3aAmrkrPd4FhRK0tDQT1MSByM3Z3cCbQYYIUzMLw1YQlm /UJMLMyTH4IHDpKTNNNT0zQmEy2cWcRoXDw5QHczI/YmUqn7VUCNNaOCAnm1UoxvXVoK 0HYSrrKe65Zls+7UsZ0M9IC7zEoJG/Xo63Q4Q= MIME-Version: 1.0 Received: by 10.223.145.130 with SMTP id d2mr108683fav.78.1255646542133; Thu, 15 Oct 2009 15:42:22 -0700 (PDT) In-Reply-To: <320B64F9EC2242D1B3CA045C0A208111@Stucomet> References: <20091015144455.A2047@lua.tecgraf.puc-rio.br> <320B64F9EC2242D1B3CA045C0A208111@Stucomet> From: liam mail Date: Thu, 15 Oct 2009 23:42:02 +0100 Message-ID: <173d86e00910151542o377b3edbqd3d55a3b8bde5c7e@mail.gmail.com> Subject: Re: Programming Gems example code? To: Lua list Content-Type: multipart/alternative; boundary=0023545307fc1b795d047600fe84 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545307fc1b795d047600fe84 Content-Type: text/plain; charset=ISO-8859-1 2009/10/15 Stuart P. Bentley > I haven't gotten my copy yet, but is there unlinked code for chapters 3, > 10, 11, 13, 19, 20, or 23 as well? > > -------------------------------------------------- > From: "Luiz Henrique de Figueiredo" > Sent: Thursday, October 15, 2009 A10:44 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: Programming Gems example code? > > > I have been searching for the example code of the book, but I can't seem >>> to >>> find it anywhere. >>> I was about to use the Chapter 3 vardump code. It feels very silly to >>> retype >>> the code from the book. I know it's not very big but still. Is there no >>> repository with all the code which is published in the book? >>> >> >> Whatever code was supplied by the authors in linked to in >> http://www.lua.org/gems/ >> >> The vardump code wasn't linked but it's now available at >> http://www.lua.org/gems/vardump.lua >> >> Stuart the chapters which you asked about, only contain small code snippets and are generally more theory based then example based. So preempting any official word I would suppose the code is not available online. --0023545307fc1b795d047600fe84 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/10/15 Stuart P. Bentley <stuart@testtrack4.com= >
lhf@tecgraf.puc-rio.br>
Sent: Thursday, October 15, 2009 A10:44
Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: Programming Gems example code?


I have been searching for the example code of the book, but I can't see= m to
find it anywhere.
I was about to use the Chapter 3 vardump code. It feels very silly to retyp= e
the code from the book. I know it's not very big but still. Is there no=
repository with all the code which is published in the book?

Whatever code was supplied by the authors in linked to in
http://www.lua.org/g= ems/

The vardump code wasn't linked but it's now available at
http://ww= w.lua.org/gems/vardump.lua

Stuart the chapters which you asked about, o= nly contain small code snippets and are generally more theory based then ex= ample based. So preempting any official word I would suppose the code is no= t available online.
--0023545307fc1b795d047600fe84-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 19:46:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FMkevY031229; Thu, 15 Oct 2009 19:46:41 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AA82193CF; Thu, 15 Oct 2009 20:45:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 210B5193BB for ; Thu, 15 Oct 2009 20:45:31 -0200 (BRST) Received: by gxk4 with SMTP id 4so1496334gxk.8 for ; Thu, 15 Oct 2009 15:46:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.127.3 with SMTP id e3mr620943agn.111.1255646775096; Thu, 15 Oct 2009 15:46:15 -0700 (PDT) In-Reply-To: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> References: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> Date: Fri, 16 Oct 2009 01:46:15 +0300 X-Google-Sender-Auth: dfcd4a055027a1da Message-ID: Subject: Re: Kepler cleanup From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=001485f7d66cfe34dc0476010b9f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f7d66cfe34dc0476010b9f Content-Type: text/plain; charset=UTF-8 > > The wiki is open for editing. Click the 'edit' button on any page, > and you get to edit it without requiring login or subscription. I'm > not sure if you're saying that it should have been (it is), or that > Stuart should have provided his feedback there, but wanted to clarify. My apologies, I must be completely blind because I too had the urge do edit a few pages in the past and nowhere I could find that crayon... same with luarocks website -- now I see the crayon there too :) Nevertheless, my additions were to be minor -- if I had Stuart's vision of a major refactoring, I'd go right down to it and edit it and let the others feedback on *that* instead :) --001485f7d66cfe34dc0476010b9f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The wiki is open= for editing. =C2=A0Click the 'edit' button on any page,
and you get to edit it without requiring login or subscription. =C2=A0I'= ;m
not sure if you're saying that it should have been (it is), or that
Stuart should have provided his feedback there, but wanted to clarify.

My apologies, I must be completely blind becaus= e I too had the urge do edit a few pages in the past and nowhere I could fi= nd that crayon... same with luarocks website -- now I see the crayon there = too :) Nevertheless, my additions were to be minor -- if I had Stuart's= vision of a major refactoring, I'd go right down to it and edit it and= let the others feedback on *that* instead :)

--001485f7d66cfe34dc0476010b9f-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 20:55:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9FNtjid005313; Thu, 15 Oct 2009 20:55:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 001F918B72; Thu, 15 Oct 2009 21:54:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5324318B72 for ; Thu, 15 Oct 2009 21:54:12 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from [10.0.1.7] (cpe-66-75-4-227.san.res.rr.com [66.75.4.227]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRK001MRYFG8Y80@asmtp023.mac.com> for lua@bazar2.conectiva.com.br; Thu, 15 Oct 2009 16:54:53 -0700 (PDT) Subject: Re: LuaJIT and Snow Leopard From: Craig Yoshioka In-reply-to: Date: Thu, 15 Oct 2009 16:54:17 -0700 Message-id: <6452A2E7-8C5F-4F53-A134-550AE6F36410@me.com> References: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks, using -m32 worked. I don't know if there is a better way to do it, but I made two changes in the Makefiles First I added macosx10.6 as a platform (to Makefile and src/Makefile), then I added to src/Makefile: macosx10.6: $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX -m32" and changed line 90 in src/Makefile to: $(CC) $(MYCFLAGS) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) from: $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) I guess the bad part is the last compilation bit has -DLUA_USE_LINUX being passed to it that may break things on other platforms? Seems to work OK for me though. On Oct 15, 2009, at 2:05 PM, Geoff Leyland wrote: >> Hi all, >> >> I get an architecture not supported error when trying to compile >> LuaJIT (dynasm) now that I have upgraded to Mac OS X 10.6. The >> LuaJIT binary I compiled before upgrading still works, but I'd like >> to stay up-to-date. Any idea how I go about fixing this? I'm >> guessing it might be as simple as changing some #defines or >> something like that. Thanks! > > Have you tried adding either -m32 or -m64 to the compiler command > line? I got a similar problem, and I think it was because I was > building a 64 bit module and trying to link it to a 32 bit lua (a > lua that I still had from before the upgrade to SL). > > I suspect that if you rebuild everything, you'll end up with all 64 > bit and you'll be ok, but Thomas has just pointed out that LuaJIT is > 32 bit only, so perhaps you want to keep everything 32 bit. > > Cheers, > Geoff > From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 21:01:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G01FJT005927; Thu, 15 Oct 2009 21:01:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E26251A668; Thu, 15 Oct 2009 22:00:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51DB918D35 for ; Thu, 15 Oct 2009 22:00:01 -0200 (BRST) Received: from [192.168.254.14] (sms5-pool120-0151.bmts.com [209.240.120.151]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n9G00Y13008492 for ; Thu, 15 Oct 2009 20:00:41 -0400 Message-ID: <4AD7B7A2.7000809@hempeldesigngroup.com> Date: Thu, 15 Oct 2009 20:00:34 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Kepler cleanup References: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> In-Reply-To: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Whitehead II wrote: > On Thu, Oct 15, 2009 at 8:59 PM, Cosmin Apreutesei > wrote: >> It's ironic how many open software projects today have wiki-based websites >> but they miss the point of how a wiki works (wikipedia and c2.com still do >> it right). Should a wiki had been open for anybody to write (yes, without >> login or subscription or asking email or everything!), maybe your time would >> have been better served -- you might have shown us a little on how to do it >> right instead of writing this long critique :) > > The wiki is open for editing. Click the 'edit' button on any page, > and you get to edit it without requiring login or subscription. I'm > not sure if you're saying that it should have been (it is), or that > Stuart should have provided his feedback there, but wanted to clarify. Great! I'm working on a minimal Xavante/Kepler install for a Soekris box running OpenBSD - and would love to get my app framework to have a Lua-only webserver. I'll take notes as I go and add them to the Wiki for getting a minimal server up and running without Rocks.... Ralph PS: Not that Rocks is bad, it's just not ideal for what I want to do ight now... From lua-bounces@bazar2.conectiva.com.br Thu Oct 15 23:07:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G27TD4017448; Thu, 15 Oct 2009 23:07:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4E901A5D9; Fri, 16 Oct 2009 00:06:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3563193FD for ; Fri, 16 Oct 2009 00:06:10 -0200 (BRST) Received: by fxm12 with SMTP id 12so2020095fxm.5 for ; Thu, 15 Oct 2009 19:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=OnYRjBnFG5VyFbIyqnwoGVv4pDi4Kh5mowNWlLtzaRE=; b=fI0qkfhvks0rP9DpFxk12kwZ0wROm0MQr5OjbS4ihPfEHvv6A+tfbBz81ziL/fynsL whnuSKn9kR8dTtxjKNyTn1Vsdp5WwasIr7emKx3GFmg72v+UwdY7YbZJ2Otrr+6jooUB v3IkPdSN0MUCDT+rgIQmkcWlHSu98vJ7r1Wx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=NepUAguOqtLVYedRnfa53B8W5K0ASetNtknU+xFKIXercSljnqYX7qQ4hlDjgx0nTp IkIAtVccpU2iExz6tJm/G7p816DmOr6iUXScQJmp3vi4g79pY/tVJ++kNSjDKhLPIl18 7ZZ6FfzNzl8jP/xDPOkrrpdXokfKoBGJsW6cA= MIME-Version: 1.0 Received: by 10.204.156.19 with SMTP id u19mr701635bkw.62.1255658812153; Thu, 15 Oct 2009 19:06:52 -0700 (PDT) In-Reply-To: <4AD7B7A2.7000809@hempeldesigngroup.com> References: <5fe281d40910151452m4006651j4eccb0c255c58176@mail.gmail.com> <4AD7B7A2.7000809@hempeldesigngroup.com> From: Hisham Date: Thu, 15 Oct 2009 23:06:32 -0300 Message-ID: <5e7d91620910151906o229c7f7bt86357ff0e65015ab@mail.gmail.com> Subject: Re: Kepler cleanup To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9G27TD4017448 On Thu, Oct 15, 2009 at 9:00 PM, Ralph Hempel wrote: > I'll take notes as I go and add them to the Wiki for getting a minimal > server up and running without Rocks.... > > Ralph > > PS: Not that Rocks is bad, it's just not ideal for what I want to >    do ight now... With LuaRocks 2.0 (release candidate just released in the luarocks-developers list), you'll be able to use it for deployment and won't need to have it around at runtime. I've been talking to Fabio about some minor glitches in the Kepler distribution/scripts that made some tricks using LuaRocks 1.0 which are no longer valid in 2.0; he should fix it soon and release an updated installer. -- Hisham From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 00:11:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G3BiA5023328; Fri, 16 Oct 2009 00:11:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C92719423; Fri, 16 Oct 2009 01:10:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B825F1909A for ; Fri, 16 Oct 2009 01:10:19 -0200 (BRST) Received: by fxm12 with SMTP id 12so2058041fxm.5 for ; Thu, 15 Oct 2009 20:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=bmQGkxmXLcX7Ppf0ZvN+eJu7Uh5dGcAV3fACn34TF0U=; b=nr8W1gUMy7cxgO4rzgmQ0FarrzEdguHZuo5M/APMNaTezh9/QoFb1yODyHDjy0BUqB PN+cV3iKy2kmV3q+YbCA8yID9MyPPbNsBmTG1HaEpf99AGl+AOIdRMJJmK687byvojHQ A++GMILhFdEe3KnwHP7STaP4tC2xPZ5z653YM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=eKGkHzSG0T5efxcz/MK5Zz13DwhosHZzOl8Paq9sBmIUAlIonzgJDxq1RnzzlVJaQR aroGs3rurZAUW09Zum5qLMZ+gM08H6Z5nsxIvxE5P9ePw2yltX9Y2iXwO3PR2FaRF0UB vhT9XWgrPlgIbykzkvqlG23oVJKUqSMVNPz3k= MIME-Version: 1.0 Received: by 10.204.148.88 with SMTP id o24mr718748bkv.182.1255662662800; Thu, 15 Oct 2009 20:11:02 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Oct 2009 22:11:02 -0500 X-Google-Sender-Auth: fc1219dadbac9455 Message-ID: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> Subject: Re: a new domain for the LuaForge mirror From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cd4d6f9545b047604be9d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cd4d6f9545b047604be9d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What about Round Robin DNS? I mean to have 2 A records :), EveryDNS supports it AFAIK Blessings! On Thu, Oct 15, 2009 at 2:43 PM, Cosmin Apreutesei < cosmin.apreutesei@gmail.com> wrote: > Note that while the mirror shares the domain with LuaForge, it is >> hosted on an entirely separate server and should not be affected by >> LuaForge outages. (BTW, if you have suggestions for a better place to >> host a 3GB mirror, either let me know or bring it up on the >> luaforge-development list.) > > > No idea about storage, but the DNS server should be mirrored too -- eithe= r > with a secondary on the 2nd machine or even easier with everydns.com > . > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cd4d6f9545b047604be9d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What about Round Robin DNS?

I mean to have 2 A records :), EveryDNS = supports it AFAIK

Blessings!

On Th= u, Oct 15, 2009 at 2:43 PM, Cosmin Apreutesei <cosmin.apreutesei@gmail.com>= wrote:
Note that while the mirror shares the domain with LuaForge, it is
hosted on an entirely separate server and should not be affected by
LuaForge outages. (BTW, if you have suggestions for a better place to
host a 3GB mirror, either let me know or bring it up on the
luaforge-development list.)

No idea a= bout storage, but the DNS server should be mirrored too -- either with a se= condary on the 2nd machine or even easier=C2=A0with=C2=A0everydns.com.




--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cd4d6f9545b047604be9d-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 01:04:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G43v88027669; Fri, 16 Oct 2009 01:03:57 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFC1819092; Fri, 16 Oct 2009 02:02:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E06D18F98 for ; Fri, 16 Oct 2009 02:02:39 -0200 (BRST) Received: by iwn8 with SMTP id 8so900257iwn.33 for ; Thu, 15 Oct 2009 21:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=TWDnFw/HbQfBJ4Yu7hd1N4xC9xMdC3bZyg58DJfdWbE=; b=DAy/d+YtGLa59KFiOhWk39SoT9SLrBNhbCHHNFjFFhOo8RNCUAs4CE2hEdjz0nrz8R JPoaFsUnAaU5KemtrJn+Ax7yG6Scu+23xK89tkqwQYqb80i2EvXUJJyThoFceSNhd44L dQRizcHODESGBmbeB1StHQuTQ1Cx7LRKsiEJw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vpiwEyl1CYGNEkW0/aPk0gzDYXJVrlOj+UlTfiGn6Cu2924L+QIrvNjKq1jCj3OMID gtLQgSDhI7Hwt0URr3rlEJMnCQ5tsGlnZbr5HGtk40NF1BiVenDf4OMWpD7sWewm+Ed7 zDJ08awLeLL++x27i/KK6OKISW2xTIT4NOPEI= MIME-Version: 1.0 Received: by 10.231.123.216 with SMTP id q24mr2852032ibr.43.1255665804403; Thu, 15 Oct 2009 21:03:24 -0700 (PDT) In-Reply-To: <20091015130222.GJ13463@pruts.nl> References: <20091015130222.GJ13463@pruts.nl> Date: Fri, 16 Oct 2009 01:03:24 -0300 Message-ID: Subject: Re: Lua Virtual Machine Implementation From: =?ISO-8859-1?Q?Alex_de_Magalh=E3es?= To: Lua list Content-Type: multipart/alternative; boundary=0016e64698e43a62c30476057a33 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64698e43a62c30476057a33 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey guys, thank you so much for helping me. Ico and Fran=E7ois, I have already read these articles a few weeks ago, but now I'm really interested on the code itself, instead of an abstracted vision of it. I think I'm gonna reread the Implementation of Lua next week to remind me of some details. I'm actually planning to write an article about the research after it's done. Alex Queiroz, I think it's really really gonna help me! Thank you! It's a great start! Alex 2009/10/15 Ico Doornekamp > > The first thing that comes to mind would be 'The implementation of Lua > 5.0', which can be found at http://www.lua.org/doc/jucs05.pdf. > > Do you plan to publish the results of your research after you're done ? > > -- > :wq > ^X^Cy^K^X^C^C^C^C > 2009/10/15 Alex Queiroz > > You may enjoy Mike Pall's reading guide to the Lua source code: > > > http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_t= here_are_so/c02pxbp > > -- > -alex > http://www.ventonegro.org/ > 2009/10/15 Fran=E7ois Perrad > > A great ressource is : A No Frills Intro To Lua 5.1 VM Instructions > > Fran=E7ois. > > --0016e64698e43a62c30476057a33 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hey guys, thank you so much for helping me.

Ico and= Fran=E7ois, I have already read these articles a few weeks ago, but now I&= #39;m really interested on the code itself, instead of an abstracted vision= of it. I think I'm gonna reread the Implementation of Lua next week to= remind me of some details.

I'm actually planning to write an article about the research after = it's done.

Alex Queiroz, I think it's really really gonna he= lp me! Thank you! It's a great start!

Alex

2009/10/15 Ico Doornekamp <lua@zevv.nl>

The first thing that comes to mind would be 'The implementation of Lua<= br> 5.0', which can be found at http://www.lua.org/doc/jucs05.pdf.

Do you plan to publish the results of your research after you're done ?=

--
:wq
^X^Cy^K^X^C^C^C^C

2009/10/15 Alex Qu= eiroz <asandroq@= gmail.com>

=A0 =A0 You may enjoy Mike Pall's reading guide to the Lua sourc= e code:

http://www.reddit.com/comme= nts/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp

--
-alex
http://www.ventone= gro.org/

2009/10/15 Fran=E7= ois Perrad <francois.perrad@gadz.org>

A great ressource is : A No Frills Intro To Lua 5.1 VM Instruct= ions

Fran=E7ois.


--0016e64698e43a62c30476057a33-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 03:24:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G6OkuB007065; Fri, 16 Oct 2009 03:24:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D4C819412; Fri, 16 Oct 2009 04:23:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx1.wp.pl (smtp.wp.pl [212.77.101.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 040FB1940C for ; Fri, 16 Oct 2009 04:23:28 -0200 (BRST) Received: (wp-smtpd smtp.wp.pl 5941 invoked from network); 16 Oct 2009 08:24:09 +0200 Received: from it.wp-sa.pl (HELO [10.10.1.98]) (miko@[212.77.105.136]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 16 Oct 2009 08:24:09 +0200 Message-ID: <4AD81188.40209@wp.pl> Date: Fri, 16 Oct 2009 08:24:08 +0200 From: Michal Kolodziejczyk User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: a new domain for the LuaForge mirror References: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> In-Reply-To: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [AVME] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fernando P. García wrote: > What about Round Robin DNS? > > I mean to have 2 A records :), EveryDNS supports it AFAIK Then if the main site goes down, every second request (on average) will time out. I think the point is to choose a different site if you cannot connect to the main site. So you should be able to choose which server you want to connect to. Regards, miko From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 04:40:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G7dwKm015225; Fri, 16 Oct 2009 04:39:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5128519423; Fri, 16 Oct 2009 05:38:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5224B19418 for ; Fri, 16 Oct 2009 05:38:31 -0200 (BRST) Received: by fxm12 with SMTP id 12so2204927fxm.5 for ; Fri, 16 Oct 2009 00:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GjOEAS2dOPe7Jy9hpAjEA/z43UQ9UbOeKPKeYY3AvTs=; b=Cfl1cQ2wpoDwq5U4kgopCepOfGqUg+kgggz33Movn1B8NVBdw/UH6aHg6+d0WpxK8G xXikpdphH0oG9xuXPMwBeGQWLp4xyMEoXcjWFnCYu9UR8ljEurM3l54gDRjZFlYYnTbc zY7sZoU8mMmAFWRJsOZrmBhxN3E+rucUQrkes= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UfPRzM8ihKpW1pnsfsj0o7dkvhpXHK68R6OClgMMZNtR0O7XukM8EEXoE6x/74qND1 V8c8Dyek+keqkDJMwQby1zZ79fcZXFKo/07trhI3SbZGQ/yMOMgol35c21J9f73wSAdK m4CnDPmzuJQQK6tlVoTnnEpIxaLw4m91cmETI= MIME-Version: 1.0 Received: by 10.239.139.156 with SMTP id t28mr96651hbt.33.1255678753937; Fri, 16 Oct 2009 00:39:13 -0700 (PDT) In-Reply-To: <560972290910150037t6aac4039ua704b150c0d6f56d@mail.gmail.com> References: <560972290910150037t6aac4039ua704b150c0d6f56d@mail.gmail.com> Date: Fri, 16 Oct 2009 09:39:13 +0200 Message-ID: <560972290910160039k604b3ac2q4702dcce904f381a@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: steve donovan To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9G7dwKm015225 There is an interesting language called SequenceL which has implicit mapping. See the Search example at: http://lambda-the-ultimate.org/node/3635#comment A Lua-like equivalent syntax would be something like: Search = mapper (Target,{Subscript,Word}) return Word == Target and Subscript ; Search('f'ox',[{1,'dog'},{2,'cat'},{3,'fox'},{4,'parrot'}}) → 3 This is not a syntax or a Lua extension suggestion ;) Just another neat way to look at the map issue. It's the kind of thing which Metalua or LuaMacro could implement relatively easily. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 05:08:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G88Ngc017424; Fri, 16 Oct 2009 05:08:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE3B81941F; Fri, 16 Oct 2009 06:07:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43F2919412 for ; Fri, 16 Oct 2009 06:07:01 -0200 (BRST) Received: by fxm12 with SMTP id 12so2228416fxm.5 for ; Fri, 16 Oct 2009 01:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Vb832hXioHUnc12+hrk8inQx6+fWTeeHNv65F40uEFY=; b=oiCdAYxu6A0560kYynWj6MCAwR/anWxkJvyqnJusWBRvXHEwdq5C8lA//5JDEhjn2l gR3AeREwt8BnUWRrJu9EyELyc7pkkUwoa0JtwHFN5Z7Yfs5iTWZzNQRtsQQe2S4QuZYJ Ej282gtzrb/c6PyV1HDC56KJbg6ajMQCdFCbU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kUlQtNAHBaDCU4UU+i0yV/4CHtBbdlOA8D41gPS0sP3ODJ2ARfGQ8jW3snByKrD0iy a2gU2vbQAVvtZHkXEF9hJ3kvB3nlFcCF0U6CdNDwfeiDI51if1kS97CSuQeXfO6N2DHU PSMNDKxI6avlu1e8iqQlx+ewkFgVIeY6HEcQs= MIME-Version: 1.0 Received: by 10.239.139.84 with SMTP id s20mr103896hbs.110.1255680463831; Fri, 16 Oct 2009 01:07:43 -0700 (PDT) In-Reply-To: <560972290910160039k604b3ac2q4702dcce904f381a@mail.gmail.com> References: <560972290910150037t6aac4039ua704b150c0d6f56d@mail.gmail.com> <560972290910160039k604b3ac2q4702dcce904f381a@mail.gmail.com> Date: Fri, 16 Oct 2009 10:07:43 +0200 Message-ID: <560972290910160107k2fae1ee3s70e6613378d45f09@mail.gmail.com> Subject: Re: Addition of map() and filter(). From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 16, 2009 at 9:39 AM, steve donovan wrote: > There is an interesting language called SequenceL which has implicit mapping. > Search = mapper (Target,{Subscript,Word}) return Word == Target and Subscript ; Should be 'implicit _iteration_'. This function is not of course a map operation, as it stands; apologies for the noise. From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 05:35:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G8YwpR019598; Fri, 16 Oct 2009 05:34:59 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4CF819434; Fri, 16 Oct 2009 06:33:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 215A81942F for ; Fri, 16 Oct 2009 06:33:28 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LaVpn-1MY7rm3zWJ-00ltkd; Fri, 16 Oct 2009 04:34:10 -0400 Message-ID: <6B7184BFA9F24CE09BAF7E53B4D9A1D2@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: Kepler cleanup Date: Fri, 16 Oct 2009 01:33:59 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005C_01CA4E00.BC826870" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19c+Q8ZIo3QzDorMcygJoSKIFbAWXwncJQmjWR bOR7+p7x41bLfaP2mKsJJIFI6Qnp3G1HpyYBQE41hCWVSTnla0 NRN8MsILoCQAhPXT3pXn2sIu2/DxWhR X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_005C_01CA4E00.BC826870 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That's only valid if you know the information that needs to be = introduced. I don't know anything about Kepler, which is where my = complaint stems from (that this isn't rectifiable with what the site = provides). Maybe I'll be more able to contribute after reading the chapter on it in = my copy of Lua Programming Gems (which seems much better laid out) which = was delivered yesterday. From: Cosmin Apreutesei=20 Sent: Thursday, October 15, 2009 P12:59 Newsgroups: gmane.comp.lang.lua.general To: Lua list=20 Subject: Re: Kepler cleanup It's ironic how many open software projects today have wiki-based = websites but they miss the point of how a wiki works (wikipedia and = c2.com still do it right). Should a wiki had been open for anybody to = write (yes, without login or subscription or asking email or = everything!), maybe your time would have been better served -- you might = have shown us a little on how to do it right instead of writing this = long critique :) On Thu, Oct 15, 2009 at 21:41, Stuart P.Bentley = wrote: The site for Kepler needs to be majorly refactored. To a new visitor = to the site, it is completely impenetrable, and the disorganization of = the site reflects just as poorly on the project as a whole. Every = sentence, that is not directed toward current project developers, uses = only the broadest of terms rather than conveying an actual detail of the = project. Several pages that involve crucial information relating to = starting with Kepler (such as how to configure _any_ web server for = actual use) openly lack even the most rudimentary text, with the page = for Xavante, the bundled server with Kepler, being *completely blank*. = Conversely, large sections of the site are devoted to open-ended "puff = piece" general topic questions such as "What is web development?" To start addressing the site's specific shortcomings as it stands, the = first line of the homepage is: "Kepler is an open source platform that brings the power of Lua to web = development." "Platform"? It offers (from what I can piece together, at least) 3 = separate, alternative, and conflicting modules that bill themselves as = the exact same thing. You can develop "for Linux", "for iPhone", and = even "for Lua": you can't develop "for Kepler". Likewise, module = documentations keep using terms like "abstraction", "tool", and = "framework", but they never contextualize it. .NET and Mediawiki are = both "frameworks", but you can't use .NET in place of Mediawiki or = vice-versa. These terms are complete non-descriptors in software = development: a programming language is an abstraction framework tool, = and so is anything written with it. It then goes on to explain several tautologies, such as asking the = user, if they're familiar with Lua, to "think about all that power = applied to web scripting". If the user is familiar with Lua, they don't = need to be told that this power applies to web development if they've = been told that Kepler is the application of Lua to web development, or = that using Lua for web development allows you to use the modularization = of Lua for web development. It's like telling someone that "a tiger is a = large cat" and then following it by adding "if you've ever seen a cat = move, a tiger moves like that". People can figure out basic = interrelationships such as these, and listing them out only takes up = space on the page while adding nothing, much like this entire paragraph = explaining tautologies. If they're not familiar with the advantages of Lua, they can get them = in full from lua.org (one link that is prominently absent from the site = as a whole). The purpose of an overview is to explain what the user has = arrived at. If the site's target audience is assumed to already be = familiar with a topic it mentions in passing, it should provide a link = to an in-depth explanation (the topic's home page) for the edge scenario = where that's not the case.=20 ------=_NextPart_000_005C_01CA4E00.BC826870 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That's only valid if you know the information that = needs to be=20 introduced. I don't know anything about Kepler, which is where my = complaint=20 stems from (that this isn't rectifiable with what the = site=20 provides).
 
Maybe I'll be more able to contribute after reading = the=20 chapter on it in my copy of Lua Programming Gems (which seems much = better laid=20 out) which was delivered yesterday.

From: Cosmin Apreutesei
Sent: Thursday, October 15, 2009 P12:59
Newsgroups: gmane.comp.lang.lua.general
Subject: Re: Kepler cleanup

It's ironic how many open software projects today have wiki-based = websites=20 but they miss the point of how a wiki works (wikipedia and c2.com still do it right). Should a wiki had = been open=20 for anybody to write (yes, without login or subscription or asking email = or=20 everything!), maybe your time would have been better served -- you might = have=20 shown us a little on how to do it right instead of writing this long = critique=20 :)

On Thu, Oct 15, 2009 at 21:41, Stuart P.Bentley = <stuart@testtrack4.com>=20 wrote:
The site for Kepler needs to be majorly refactored. = To a new=20 visitor to the site, it is completely impenetrable, and the = disorganization of=20 the site reflects just as poorly on the project as a whole. Every = sentence,=20 that is not directed toward current project developers, uses only the = broadest=20 of terms rather than conveying an actual detail of the project. = Several pages=20 that involve crucial information relating to starting with Kepler = (such as how=20 to configure _any_ web server for actual use) openly lack even the = most=20 rudimentary text, with the page for Xavante, the bundled server with = Kepler,=20 being *completely blank*. Conversely, large sections of the site are = devoted=20 to open-ended "puff piece" general topic questions such as "What is = web=20 development?"

To start addressing the site's specific = shortcomings as=20 it stands, the first line of the homepage is:

"Kepler is an = open source=20 platform that brings the power of Lua to web = development."

"Platform"?=20 It offers (from what I can piece together, at least) 3 separate, = alternative,=20 and conflicting modules that bill themselves as the exact same thing. = You can=20 develop "for Linux", "for iPhone", and even "for Lua": you can't = develop "for=20 Kepler". Likewise, module documentations keep using terms like = "abstraction",=20 "tool", and "framework", but they never contextualize it. .NET and = Mediawiki=20 are both "frameworks", but you can't use .NET in place of Mediawiki or = vice-versa. These terms are complete non-descriptors in software = development:=20 a programming language is an abstraction framework tool, and so is = anything=20 written with it.

It then goes on to explain several = tautologies, such=20 as asking the user, if they're familiar with Lua, to "think about all = that=20 power applied to web scripting". If the user is familiar with Lua, = they don't=20 need to be told that this power applies to web development if they've = been=20 told that Kepler is the application of Lua to web development, or that = using=20 Lua for web development allows you to use the modularization of Lua = for web=20 development. It's like telling someone that "a tiger is a large cat" = and then=20 following it by adding "if you've ever seen a cat move, a tiger moves = like=20 that". People can figure out basic interrelationships such as these, = and=20 listing them out only takes up space on the page while adding nothing, = much=20 like this entire paragraph explaining tautologies.

If they're = not=20 familiar with the advantages of Lua, they can get them in full from lua.org (one link that is = prominently=20 absent from the site as a whole). The purpose of an overview is to = explain=20 what the user has arrived at. If the site's target audience is assumed = to=20 already be familiar with a topic it mentions in passing, it should = provide a=20 link to an in-depth explanation (the topic's home page) for the edge = scenario=20 where that's not the case.

------=_NextPart_000_005C_01CA4E00.BC826870-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 05:37:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G8bTd3019886; Fri, 16 Oct 2009 05:37:29 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FB4C18398; Fri, 16 Oct 2009 06:36:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55F1C19437 for ; Fri, 16 Oct 2009 06:36:11 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MZBDw-1Mg63d1Umy-00LQjT; Fri, 16 Oct 2009 04:36:54 -0400 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> <4AD81188.40209@wp.pl> In-Reply-To: <4AD81188.40209@wp.pl> Subject: Re: a new domain for the LuaForge mirror Date: Fri, 16 Oct 2009 01:36:48 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-2"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1/OGJ2HjX+CQ1oZa6LRabnNu3iS1+aTvUxJPpY ynZOO2KYXslbsCJNAt88T2X57Buv+ezJUpp/rM4MeUW/TWXb08 IwH7YNwE8LwBZi8jBQ8QeXAI/aP6god X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean There should be multiple DNS servers, though. I remember the nameserver being down during the outage. -------------------------------------------------- From: "Michal Kolodziejczyk" Sent: Thursday, October 15, 2009 P11:24 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: a new domain for the LuaForge mirror > Fernando P. García wrote: >> What about Round Robin DNS? >> >> I mean to have 2 A records :), EveryDNS supports it AFAIK > > Then if the main site goes down, every second request (on average) will > time out. I think the point is to choose a different site if you cannot > connect to the main site. So you should be able to choose which server > you want to connect to. > > Regards, > miko > From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 05:44:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G8ikaO020528; Fri, 16 Oct 2009 05:44:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27A801943D; Fri, 16 Oct 2009 06:43:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8375119433 for ; Fri, 16 Oct 2009 06:43:30 -0200 (BRST) Received: by fxm12 with SMTP id 12so2261564fxm.5 for ; Fri, 16 Oct 2009 01:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=qdhE8G2qnkL2kcORrs3CInX734BGtgNqB8hamoBiJRs=; b=QOnFwgaCvNiwtU0tZyPlTh+te4yW5VGloy45nifdpg3FHRCC8SfDlNhbi0Q2VzwAQG W5kku7dfsYjxwAmQEaVkJBO0jV28bZc7FsrVhXwjazkw2Vdgic54pA3t+3nvHfrg8oNS +Ye4RRMLNH6zlEX66i8fm4fa0Dleo+E8ZC+nM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=kDGMeTyUj1+iH9wMm6XP3oMTVQCQxH/bnBs4py/y8wxliB3zdzrtoGtfbWsPHoRQTN akn8Z3hYhuclbbLmWuZPJUodOtrZo2XM8W2pb/+7gTjeIyQ8M10UP1gU6UPkGQ7tVDph 6kfOcB77GE1lNyrHdOGuaXc4wiH3YkGf/NS+4= Received: by 10.102.80.14 with SMTP id d14mr476068mub.73.1255682651581; Fri, 16 Oct 2009 01:44:11 -0700 (PDT) Received: from ?95.78.77.145? ([95.78.77.145]) by mx.google.com with ESMTPS id w5sm1618776mue.7.2009.10.16.01.44.10 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Oct 2009 01:44:10 -0700 (PDT) Date: Fri, 16 Oct 2009 12:44:02 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1536876966.20091016124402@gmail.com> To: Cosmin Apreutesei Subject: Re[2]: Kepler cleanup In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Cosmin, Thursday, October 15, 2009, 11:59:56 PM, you wrote: > c2.com still do it right). Should a wiki had been open for anybody > to write (yes, without login or subscription or asking email or > everything!) are you have experience of cleaning up wiki of popular site from spam? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 05:56:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G8uEhh021373; Fri, 16 Oct 2009 05:56:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6781719441; Fri, 16 Oct 2009 06:55:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A7131943A for ; Fri, 16 Oct 2009 06:54:56 -0200 (BRST) Received: by ewy26 with SMTP id 26so1771984ewy.5 for ; Fri, 16 Oct 2009 01:55:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.132.28 with SMTP id j28mr555390ebn.56.1255683337191; Fri, 16 Oct 2009 01:55:37 -0700 (PDT) In-Reply-To: References: Date: Fri, 16 Oct 2009 10:55:37 +0200 X-Google-Sender-Auth: 6b9563df55930d7f Message-ID: Subject: Re: [ANN] lua-Coat 0.5.0 : Yet Another Lua Object-Oriented Model From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9G8uEhh021373 2009/8/26 David Manura : > On Mon, Aug 24, 2009 at 1:14 PM, François Perrad wrote: >> lua-Coat is a Lua 5.1 port of Coat (http://www.sukria.net/perl/coat/), ... >> Comment, bug report, patch are welcome. > > So if Moose is the ultimate class library for Perl, and Coat is a > quasi-subset Moose, and lua-Coat is a port of Coat to Lua, then does > that imply that lua-Coat is a quasi-subset of the ultimate class > library for Lua? > > We can try it on the benchmark [3] > >  -- added code >  function makeob5() >    require "Coat" >    class "ob5" >    has.data = {is='number',default=0} >    function method:test() self:data(self:data() + 1) end >    return _M() >  end >  addbenchmark("Object using lua-Coat", "ob:test()", makeob5()) > > Results: > >  $ lua bench.lua            # using count = 10000000 >  2.969   Standard (solid) >  3.406   Standard (metatable) >  3.64    Object using closures (PiL 16.4) >  2.25    Object using closures (noself) >  16.735  Object using lua-Coat >  1.469   Direct Access >  0.484   Local Variable > >> basic_type = type >> local basic_type = basic_type >> local function object_type (obj) >>     local t = basic_type(obj) >>     if t == 'table' then >>         pcall(function () t = obj._CLASS or t end) >>     end >>     return t >> end >> _G.type = object_type > > The above code implies that type {_CLASS='x'} == 'x', which is > inconsistent with the Lua specification [1].  This might not seem > important, but consider the case of some code that operates on a table > whose key names are generated from user input.  The above would > introduce subtle edge cases (or security holes).  The above also > implies that type(t) will now have the overhead of a pcall when t is a > table.  I recommend against redefining type(). With lua-Coat-0.5.1, the function 'type' is no longer overloaded. > >> function before (class, name, func) ..... >>     class[name] = function (...) >>         local result = func(...) >>         super(...) >>         return result >>     end > > To handle multiple return values, you can use the CPS style [2]. > However, I question whether before and after modifiers should alter > return values.  It appears Coat (in $modified_method_code) only does > so for around modifiers. > > [1] http://www.lua.org/manual/5.1/manual.html#pdf-type > [2] http://lua-users.org/wiki/VarargTheSecondClassCitizen > [3] http://lua-users.org/wiki/ObjectBenchmarkTests > > From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 06:10:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G9AeLF022742; Fri, 16 Oct 2009 06:10:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE4441944E; Fri, 16 Oct 2009 07:09:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C76F019441 for ; Fri, 16 Oct 2009 07:09:19 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id ABB3588119 for ; Fri, 16 Oct 2009 10:10:11 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" x-cr-hashedpuzzle: A9jU BrBJ B7rP EaBE E0BO FGiD F6xe F/w6 GeOF HqM4 JJKO JjK/ KOSj KQB5 KSqE Kpmf; 1; bAB1AGEAQABiAGEAegBhAHIAMgAuAGMAbwBuAGUAYwB0AGkAdgBhAC4AYwBvAG0ALgBiAHIA; Sosha1_v1; 7; {AE73CD80-609A-42A5-87EE-2C631D906987}; dABvAG0AQABjAHIAZQBhAHQAaQB2AGUALQBhAHMAcwBlAG0AYgBsAHkALgBjAG8AbQA=; Fri, 16 Oct 2009 09:09:59 GMT; SABlAGwAcAA6ACAAQwByAGEAcwBoACAAaQBuACAAZwBhAHIAYgBhAGcAZQAgAGMAbwBsAGwAZQBjAHQAaQBvAG4A x-cr-puzzleid: {AE73CD80-609A-42A5-87EE-2C631D906987} Content-class: urn:content-classes:message Subject: Help: Crash in garbage collection Date: Fri, 16 Oct 2009 10:09:59 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOQG+QXT5x9wpGQ8W7NVIMKBM/bg== From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9G9AeLF022742 Hi Guys, I have a problem that I've been tearing my hair out over for the past day or so. We have an application that saves out data in a lua parseable file. This has been working for a good few months, but we have found a file that under some as yet unknown condition will crash in lua when saving. The crash occurs in sweeplist() at the line: while ((curr = *p) != NULL && count-- > 0) { if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */ This is called from singlestep, case GCSsweepstring. I have noticed that g->sweepstrgc is larger than g->strt.nuse. Is that a bad thing as it seems to me like it would be. If so, how would it get into such a state? Any help in tracking this down would be greatly appreciated. On the plus side, I now know a little bit more about how lua works internally! :) Tom From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 06:41:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9G9fBUJ025703; Fri, 16 Oct 2009 06:41:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95F881943D; Fri, 16 Oct 2009 07:39:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 373FB19432 for ; Fri, 16 Oct 2009 07:39:53 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MyjIa-0002TW-1M for lua@bazar2.conectiva.com.br; Fri, 16 Oct 2009 11:40:36 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Oct 2009 11:40:36 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Oct 2009 11:40:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: Lua Programming Gems Kepler error Date: Fri, 16 Oct 2009 02:40:03 -0700 Lines: 20 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean After doing exactly as the book/pdf/readme file said, I get this error: C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:438: c:\LuaRocks\kepler/htdocs/gem: No such file or directory stack traceback: [C]: in function 'error' C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:438: in function (tail call): ? app.lua:36: in main chunk stack traceback: C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:161: in function 'err' ...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in function <...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22> (tail call): ? (tail call): ? C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:169: in function (tail call): ? (tail call): ? (tail call): ? From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 07:17:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GAHH4D028522; Fri, 16 Oct 2009 07:17:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 643AA19453; Fri, 16 Oct 2009 08:15:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9703F19449 for ; Fri, 16 Oct 2009 08:15:47 -0200 (BRST) Received: by fxm12 with SMTP id 12so2351169fxm.5 for ; Fri, 16 Oct 2009 03:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=uNgTQdII5IEv0BS8I966NxhB7QdKnVk1gVBQMmzORIg=; b=f21WW+06VVGhCFFpitgWI5W92F2fdXYwmWnw4vVp1ciAk0ikc/4k69lR9T59w9c/DD PM2bLsdDUvJ/b8euDqcgKI76W+x9HZzgKkbXKhLSkHZBaVGaXPX/GqhKPDlL0FcW7IDZ mokUsLKLeG9QUMLNqSH/bLdtaqmVaBX/mzr+4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=HwtXIeKTv3NGCWCqCHx9TUt5cX02ZALx5PVxoNeLX34rWnrIE6rjRbUCVshHBlIDJP PHRSUiZ95E5xJg6hU5qCipWwVEUwr4NjAbV80K3qHfV4dqpTCU/8RYv3YnE2/KvZtzLT sBRFRpq9h784UaKCnLiSVmdH2aURXqHrjDt3s= MIME-Version: 1.0 Received: by 10.223.144.195 with SMTP id a3mr211441fav.103.1255688190052; Fri, 16 Oct 2009 03:16:30 -0700 (PDT) In-Reply-To: <6452A2E7-8C5F-4F53-A134-550AE6F36410@me.com> References: <0637C6D2-AB70-431A-9BAD-F7ECE4A601FE@me.com> <6452A2E7-8C5F-4F53-A134-550AE6F36410@me.com> From: Anders Bergh Date: Fri, 16 Oct 2009 12:16:10 +0200 Message-ID: <976395530910160316m7fb542e9m766e1577dfdc21a@mail.gmail.com> Subject: Re: LuaJIT and Snow Leopard To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9GAHH4D028522 On Fri, Oct 16, 2009 at 01:54, Craig Yoshioka wrote: > Thanks, using -m32 worked.  I don't know if there is a better way to do it, > but I made two changes in the Makefiles > First I added macosx10.6 as a platform (to Makefile and src/Makefile), then > I added to src/Makefile: > > macosx10.6: >        $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX -m32" > > and changed line 90 in src/Makefile to: >        $(CC) $(MYCFLAGS) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) > from: >        $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) > > I guess the bad part is the last compilation bit has -DLUA_USE_LINUX being > passed to it that may break things on other platforms?  Seems to work OK for > me though. The Mac OS X way of compiling for a specific architecture is to use "-arch ", in this case "-arch i386". You can also pass this argument several times to compile universal binaries (-arch i386 -arch x86_64), although this is obviously not supported for LuaJIT. -- Anders Bergh From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 08:39:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GBd2m3003354; Fri, 16 Oct 2009 08:39:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 245A719434; Fri, 16 Oct 2009 09:37:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A544019405 for ; Fri, 16 Oct 2009 09:37:35 -0200 (BRST) Received: by pwj1 with SMTP id 1so273222pwj.21 for ; Fri, 16 Oct 2009 04:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LPgHwhkYs8sHNJzYqewfm9XX3VH+3pqpmFrQ2fGRnHo=; b=GUNuJzkMrm2fh8QW7QXf5VHDFuSgo41QLHTzeP+XCCtW5Wx16+5ngS1UchW9v8YcFA lvDKK/oNLl7XCDyJ21L+pH6qSBqLvz6pSWdaKjByOvFI7Lmi09mmubkZxKBbIigzr3Jg COMJEYZGLKwVluO5aBFt5/pTrcDa2AUFgOtsE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YgtEYnoPNN4qRbs23fsRaqQGZSx+u/szquFiqtccWaG8CsFvatj02nJnVgOHDmMNqk OacxnkcrvpNkhiu/YJDVjD0s66CQ8p75kLkAyjucDbATIFklYSdRJ8VKexc7SvtAbxI4 vxwXYTRC5N2YmXeW6KBRE5iVV8RwYdjAzINcU= MIME-Version: 1.0 Received: by 10.142.8.34 with SMTP id 34mr129457wfh.103.1255693097340; Fri, 16 Oct 2009 04:38:17 -0700 (PDT) In-Reply-To: References: Date: Fri, 16 Oct 2009 19:38:17 +0800 Message-ID: Subject: Re: Help: Crash in garbage collection From: Linker To: Lua list Content-Type: multipart/alternative; boundary=00504502b14603913504760bd568 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502b14603913504760bd568 Content-Type: text/plain; charset=UTF-8 Hi Tom, You can just stop the GC for saving your data by calling: *collectgarbage("stop")* It's not a solution for your problem, but just a work around.(May your time is limited.) Thanks. -- Regards, Linker Lin linker.m.lin@gmail.com --00504502b14603913504760bd568 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Tom,
=C2=A0=C2=A0You can just stop the GC for saving your data by ca= lling:
collectgarbage("stop")
= =C2=A0=C2=A0It's not a solution for your problem, but just a work aroun= d.(May your time is limited.)
Thanks.

--
Regards,
Linker Lin
linker.m.lin@gmail.com
--00504502b14603913504760bd568-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 08:52:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GBqLuL004801; Fri, 16 Oct 2009 08:52:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D949919455; Fri, 16 Oct 2009 09:51:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD58C1943A for ; Fri, 16 Oct 2009 09:51:02 -0200 (BRST) Received: by ywh40 with SMTP id 40so554749ywh.33 for ; Fri, 16 Oct 2009 04:51:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.255.1 with SMTP id c1mr1299933agi.115.1255693904684; Fri, 16 Oct 2009 04:51:44 -0700 (PDT) In-Reply-To: <1536876966.20091016124402@gmail.com> References: <1536876966.20091016124402@gmail.com> Date: Fri, 16 Oct 2009 14:51:44 +0300 X-Google-Sender-Auth: b6302ed70be840ec Message-ID: Subject: Re: Re[2]: Kepler cleanup From: Cosmin Apreutesei To: Bulat Ziganshin Content-Type: multipart/alternative; boundary=001636283f3822a69404760c0509 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636283f3822a69404760c0509 Content-Type: text/plain; charset=UTF-8 no need - what could a spammer do with a captcha + delayed indexing? this spam thing is a lame excuse IMHO On Fri, Oct 16, 2009 at 11:44, Bulat Ziganshin wrote: > Hello Cosmin, > > Thursday, October 15, 2009, 11:59:56 PM, you wrote: > > > c2.com still do it right). Should a wiki had been open for anybody > > to write (yes, without login or subscription or asking email or > > everything!) > > are you have experience of cleaning up wiki of popular site from spam? > > -- > Best regards, > Bulat mailto:Bulat.Ziganshin@gmail.com > > --001636283f3822a69404760c0509 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable no need - what could a spammer do with a captcha + delayed indexing? this s= pam thing is a lame excuse IMHO

On Fri, = Oct 16, 2009 at 11:44, Bulat Ziganshin <bulat.ziganshin@gmail.com> wro= te:
Hello Cosmin,

Thursday, October 15, 2009, 11:59:56 PM, you wrote:

> c2.com still do it rig= ht). Should a wiki had been open for anybody
> to write (yes, without login or subscription or asking email or
> everything!)

are you have experience of cleaning up wiki of popular site from spam= ?

--
Best regards,
=C2=A0Bulat =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mailto:Bulat.Ziganshin@gmail.com


--001636283f3822a69404760c0509-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 08:52:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GBqsMg004916; Fri, 16 Oct 2009 08:52:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E2781945B; Fri, 16 Oct 2009 09:51:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exch03.pdv-fs.de (exch03.pdv-fs.de [194.25.104.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1405F19451 for ; Fri, 16 Oct 2009 09:51:05 -0200 (BRST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Help: Crash in garbage collection Date: Fri, 16 Oct 2009 13:51:40 +0200 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOQG+QXT5x9wpGQ8W7NVIMKBM/bgAFQ4jg References: From: =?iso-8859-1?Q?Richter=2C_J=F6rg?= To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9GBqsMg004916 Hi, >I have a problem that I've been tearing my hair out over for the past >day or so. We have an application that saves out data in a lua >parseable file. This has been working for a good few months, but we >have found a file that under some as yet unknown condition >will crash in >lua when saving. The crash occurs in sweeplist() at the line: > > while ((curr = *p) != NULL && count-- > 0) { > if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each >thread */ I have exactly the same problem. Trying to write a (Lua parsable) file and get a crash on this exact same position. I have only seen this twice now on a server that usally runs for months without problems. Conincidentally the last crash happened today. I haven't tried to debug or reproduce it yet. Unfortunately I haven't got a core, only a backtrace. Sorry, that I can't help you much here. At least you are not alone. :/ Jörg From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 09:04:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GC4kYM006728; Fri, 16 Oct 2009 09:04:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9446919421; Fri, 16 Oct 2009 10:03:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sasl.smtp.pobox.com (b-pb-sasl-sd.pobox.com [64.74.157.63]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7ECB0191F0 for ; Fri, 16 Oct 2009 10:03:25 -0200 (BRST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 26FB36EAA3 for ; Fri, 16 Oct 2009 08:04:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; s=sasl; bh=02yuh77eTOVpxGn23HCTDxeNHgQ=; b=yJFkIb UulG22vPjKQH/s4fAWqVnMRECL5nHZfNAf9TSIesgnKkH1MvoEZLarUlNiH5en+5 MpvgWE2witc+vzBEnUAvnvkBEZs18WqvbDeCgHSMILocdqxCEtl+ssfWQDHchD1J hExgYclqXOceJgJbNQr/geF6LvXJrXPPU8umw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; q=dns; s=sasl; b=EjWo8J60LBjneD+kX7UZs/LPHZ3+97L0 +Uw1iA2LhMIvC4FPYHaxYakrxyuUhjH9iC4gRuBX0rDtpdaUzg70rcGBueCGaY5c INHhSPBuvQe+LB2kKJgF1NJXA0hTSzLOsZLoVtJXWTxsWPg6/dM4Kyxt8L0mImfU dFOCN/rhhjA= Received: from b-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 24A826EAA2 for ; Fri, 16 Oct 2009 08:04:07 -0400 (EDT) Received: from mail-vw0-f184.google.com (unknown [209.85.212.184]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id E186D6EAA1 for ; Fri, 16 Oct 2009 08:04:06 -0400 (EDT) Received: by vws14 with SMTP id 14so322173vws.33 for ; Fri, 16 Oct 2009 05:04:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.15.71 with SMTP id j7mr2923184vca.79.1255694646114; Fri, 16 Oct 2009 05:04:06 -0700 (PDT) In-Reply-To: References: <1536876966.20091016124402@gmail.com> Date: Fri, 16 Oct 2009 13:04:06 +0100 Message-ID: <9a0c00530910160504u7cbcba4j10089cc2071187@mail.gmail.com> Subject: Re: Re[2]: Kepler cleanup From: Paul Hudson To: Lua list Content-Type: multipart/alternative; boundary=001485e7c7c653f9a404760c31c5 X-Pobox-Relay-ID: 01609446-BA4C-11DE-B544-A58FA4293987-32369995!b-pb-sasl-sd.pobox.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485e7c7c653f9a404760c31c5 Content-Type: text/plain; charset=ISO-8859-1 Have a look at Ward's Wiki to see what damage and pain antisocial people can cause on a Wiki. It's mostly under control there, but it takes a lot of time and effort from a lot of people to keep it that way. 2009/10/16 Cosmin Apreutesei > no need - what could a spammer do with a captcha + delayed indexing? this > spam thing is a lame excuse IMHO > > --001485e7c7c653f9a404760c31c5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Have a look at Ward's Wiki to see what damage and pain antisocial peopl= e can cause on a Wiki.

It's mostly under control there, but it t= akes a lot of time and effort from a lot of people to keep it that way.

2009/10/16 Cosmin Apreutesei <cosmin.apreutesei@gma= il.com>
no need - what could a spammer do with a captcha + delayed indexing? this s= pam thing is a lame excuse IMHO

<= /div>

--001485e7c7c653f9a404760c31c5-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 09:05:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GC5MXZ006824; Fri, 16 Oct 2009 09:05:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C31DC19463; Fri, 16 Oct 2009 10:04:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1933019453 for ; Fri, 16 Oct 2009 10:04:04 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so510683qwb.11 for ; Fri, 16 Oct 2009 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=jIm2Bv2dlIM4okbQtCCQYJWz1kKTTcpx0TpttNATJ4E=; b=pBtjrtQ4/8dfaIC58YuMOvn/oakWDv5P7jfBK4q72+Pr3diX9Gh2HY8gaZC+EfLV1H 1czHVULGPtSe5NzjW4pMICYc57DVu3Tt3GtxnAyMvzlzMB+eJkAoOGc/Qe4bgxij6P7f Ava2eNE3lhvGShjJmkyc2CO3MLUmQ7FO7RfKE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=r2gEoEWWeSduLl3KibUaINCaogIt/q3eRW912qOeL+1s5IOGexBbBFFWB8UBhP9k9T +m2u1xDwfvTcB0rRJCb4/e/MyZo2uSgJArxbUdBFPrJjLHRozCsgIiExUc9PtRAYN74l qwMToF73iQD5AT9tWXw8vSWRcrENocbzBiyeE= MIME-Version: 1.0 Received: by 10.224.102.18 with SMTP id e18mr951961qao.44.1255694688658; Fri, 16 Oct 2009 05:04:48 -0700 (PDT) In-Reply-To: <20091015144455.A2047@lua.tecgraf.puc-rio.br> References: <20091015144455.A2047@lua.tecgraf.puc-rio.br> Date: Fri, 16 Oct 2009 14:04:48 +0200 Message-ID: Subject: Re: Programming Gems example code? From: Thijs Koerselman To: Lua list Content-Type: multipart/alternative; boundary=000feaf20c81dd246204760c330d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000feaf20c81dd246204760c330d Content-Type: text/plain; charset=ISO-8859-1 On Thu, Oct 15, 2009 at 7:44 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > > Whatever code was supplied by the authors in linked to in > http://www.lua.org/gems/ > > The vardump code wasn't linked but it's now available at > http://www.lua.org/gems/vardump.lua > Thanks for adding vardump to the list. I thought it would be convenient to have all in one place, but I guess it doesn't make much sense for some chapters since they don't contain code which could run out of the box. --000feaf20c81dd246204760c330d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Oct 15, 2009 at 7:44 PM, Luiz He= nrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:

Whatever code was supplied by the authors in linked to in
=A0 =A0 =A0 =A0http= ://www.lua.org/gems/

The vardump code wasn't linked but it's now available at
=A0 =A0 =A0 =A0http://www.lua.org/gems/vardump.lua

Thanks for adding vardump to the list. I though= t it would be convenient to have all in one place, but I guess it doesn'= ;t make much sense for some chapters since they don't contain code whic= h could run out of the box.

--000feaf20c81dd246204760c330d-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 10:23:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GDNBWx022185; Fri, 16 Oct 2009 10:23:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F7B91929F; Fri, 16 Oct 2009 11:21:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B34919178 for ; Fri, 16 Oct 2009 11:21:35 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9GDMDEE005413 for ; Fri, 16 Oct 2009 10:22:16 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id 61C5154C14E; Fri, 16 Oct 2009 10:22:14 -0300 (BRT) Date: Fri, 16 Oct 2009 10:22:14 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Help: Crash in garbage collection Message-ID: <20091016132214.GA17582@inf.puc-rio.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I have a problem that I've been tearing my hair out over for the past > day or so. We have an application that saves out data in a lua > parseable file. This has been working for a good few months, but we > have found a file that under some as yet unknown condition will crash in > lua when saving. The crash occurs in sweeplist() at the line: > > while ((curr = *p) != NULL && count-- > 0) { > if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each > thread */ > > This is called from singlestep, case GCSsweepstring. I have noticed > that g->sweepstrgc is larger than g->strt.nuse. Is that a bad thing as > it seems to me like it would be. If so, how would it get into such a > state? There should be no problem in sweepstrgc being large than nuse; it cannot be larger than strt.size. However, strt.size is usually (but not necessarily) larger than strt.nuse. Can you get all these values (nuse, strt.size, and sweepstrgc) after the crash? Are you using a standard Lua instalation? What version? Any extra C libraries? Can you use a tool for checking memory corruption (e.g., valgrind)? -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 10:43:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GDgvhS026393; Fri, 16 Oct 2009 10:42:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 075FB19439; Fri, 16 Oct 2009 11:41:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0761119417 for ; Fri, 16 Oct 2009 11:41:27 -0200 (BRST) Received: by ewy26 with SMTP id 26so2010813ewy.5 for ; Fri, 16 Oct 2009 06:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=oBSlNsZ1drkjpaUR6X7U75phM2crnc0N1z+MYojfMy0=; b=lZLoUzNZZ5bk31zIZuImPkxpHHuaPE3vxFvuHBy2cmJ6tMKZLnaWWgXac7mcjHc04a snqOuMe5co8/7EFZkLmMMu+AkkKqx7frI2V0h23/RuUtDlnIKlq4wYiHyWr3nmwjmF6o QmPGA44eIc8HoA1xzEy+0avICJHuP7MekFRHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KgZsAhXuWgLxWB78aiFVuKzvNhxERRD4Cr/I5TnOKwdW9GuyOMltYrpI9W7yuvSPg2 OEYw1gY0MM5N0CABr5KXqmAoUW3rsZSfTSZFjuyRd2Ys9icqVCUr+OHgq/KovwGWcr8I FY9G21P2adLI6EKQdjWXJTwNi/AkXd73tl1MY= MIME-Version: 1.0 Received: by 10.211.155.11 with SMTP id h11mr937014ebo.40.1255700530862; Fri, 16 Oct 2009 06:42:10 -0700 (PDT) In-Reply-To: <4AD69107.7020107@workspacewhiz.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <1BDB8512-1A88-49EC-8E91-F59AA632F4BB@gamehouse.com> <4AD6876D.5070802@workspacewhiz.com> <4AD68988.70001@cowlark.com> <4AD69107.7020107@workspacewhiz.com> Date: Fri, 16 Oct 2009 15:42:10 +0200 Message-ID: <76882e540910160642s59f32b93r92562f6f80a5470@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=00504502ca5a161c5104760d908e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502ca5a161c5104760d908e Content-Type: text/plain; charset=ISO-8859-1 Thanks you guys for your feedback on porting LUA to UTF16. but To my knowledge MS wide character support DOES support wide chars of more than 2 bytes (the so-called surrogates characters) indeed, my approach makes it hard to use Lua strings to represent 'arbitrary binary data'. I did it in order to embbed LUA in a native UTF16 application. The LuaPlus approach is interesting, but having two string types in LUA makes it hard to maintain- it will break in runtime whenever passing a string to a code which does not expect the a string, while the UTF16 approach will identify those problems in compile time. Nevertheless, I will give LuaPlus further thought.Thanks, Uri Cohen On Thu, Oct 15, 2009 at 5:03 AM, Joshua Jensen wrote: > ----- Original Message ----- > From: David Given > Date: 10/14/2009 8:31 PM > >> Joshua Jensen wrote: >> [...] >> >>> LuaPlus achieves this via a C-like string representation: >>> >>> HelloWorld = L"Hello world!" >>> >> What does LuaPlus do for things like string comparison and surrogates? >> > It does the equivalent of wcscmp(), only it doesn't rely on the C runtime > to achieve this. That's because on some non-Visual C++ compilers, > sizeof(wchar_t) != 2. sizeof(lua_WChar) is always 2. > > My understanding is that UCS-2 doesn't support surrogates. I don't think > Microsoft's C runtime wide character library supports them either. I could > be wrong. > > Do any of them use UTF-8? >> >> I work in mobile games; our company makes a portable native gaming >> solution that allows you to install C-based games on any device, regardless >> of architecture. The API's based on OpenKODE, which uses UTF-8 in the few >> places where it uses strings. As I tend to do the bottom-end porting to >> weird and freaky embedded operating systems, I've got tiresomely familiar >> with having to translate UTF-8 to whatever encoding the host OS uses. There >> are a surprising number that use some form of half-assed UCS-2, and I've >> never figured out why --- it just makes life complex. I suspect that it's >> simple tradition. Most of them come from Asia, and Asia seems to have a >> culture of using UCS-2 or UTF-16... >> > I would consider ditching the LuaPlus wide character support if there was a > small library that supported UTF-8 and allowed easy embedding of UTF-8 > string types in Lua source files. > > Have you looked at slnunicode? That seems to be the smallest one I can > find, but documentation is scarce, so I don't know if it achieves all of the > goals. > > Josh > > -- Uri Cohen --00504502ca5a161c5104760d908e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks you guys for your feedback on porting LUA to UTF16.=

but To my knowledge MS wide character support DOES support wide ch= ars of more than 2 bytes (the so-called surrogates characters) indeed, my a= pproach makes it hard to use Lua strings to represent 'arbitrary binary= data'. I did it in order to embbed LUA in a native UTF16 application.<= br>
The LuaPlus approach is interesting, but having two string types in LUA= makes it hard to maintain- it will break in runtime whenever passing a str= ing to a code which does not expect the a string, while the UTF16 approach = will identify those problems in compile time.
Nevertheless, I will give LuaPlus further thought.Thanks,
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 Uri Cohen

On Thu, O= ct 15, 2009 at 5:03 AM, Joshua Jensen <jjensen@workspacewhiz.com> wrot= e:
----- Original Message -----
From: David Given
Date: 10/14/2009 8:31 PM
Joshua Jensen wrote:
[...]
LuaPlus achieves this via a C-like string representation:

HelloWorld =3D L"Hello world!"
What does LuaPlus do for things like string comparison and surrogates?
It does the equivalent of wcscmp(), only it doesn't rely on the C runti= me to achieve this. =A0That's because on some non-Visual C++ compilers,= sizeof(wchar_t) !=3D 2. =A0sizeof(lua_WChar) is always 2.

My understanding is that UCS-2 doesn't support surrogates. =A0I don'= ;t think Microsoft's C runtime wide character library supports them eit= her. =A0I could be wrong.


Do any of them use UTF-8?

I work in mobile games; our company makes a portable native gaming solution= that allows you to install C-based games on any device, regardless of arch= itecture. The API's based on OpenKODE, which uses UTF-8 in the few plac= es where it uses strings. As I tend to do the bottom-end porting to weird a= nd freaky embedded operating systems, I've got tiresomely familiar with= having to translate UTF-8 to whatever encoding the host OS uses. There are= a surprising number that use some form of half-assed UCS-2, and I've n= ever figured out why --- it just makes life complex. I suspect that it'= s simple tradition. Most of them come from Asia, and Asia seems to have a c= ulture of using UCS-2 or UTF-16...
I would consider ditching the LuaPlus wide character support if there was a= small library that supported UTF-8 and allowed easy embedding of UTF-8 str= ing types in Lua source files.

Have you looked at slnunicode? =A0That seems to be the smallest one I can f= ind, but documentation is scarce, so I don't know if it achieves all of= the goals.

Josh




--

=A0 =A0 =A0 =A0 = =A0 =A0Uri Cohen
--00504502ca5a161c5104760d908e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 10:43:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GDhfhb026721; Fri, 16 Oct 2009 10:43:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 334FB19449; Fri, 16 Oct 2009 11:41:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F69F19435 for ; Fri, 16 Oct 2009 11:41:32 -0200 (BRST) Received: by mail-ew0-f226.google.com with SMTP id 26so2010813ewy.5 for ; Fri, 16 Oct 2009 06:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=tywmIRJFO4n5nf3AXvIFm10FA/cIPq9fFKySUhjhycU=; b=sMFzLdNWK72JMUzFIWK+EqTRYrRJ3cqDnookiqAB+LnASvhbiDQCGpBlb9ZFU5DjIr pjDRmO506Xqp0Ghc175QLlcN9yJwiVX6qXCjNq9qaAPSYYiRmS6aPyJLI0/wNaymhG6G C7FzuM8KDtfgsQ3OoeAy9+uz3cCfTphF8dfQQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HGGwgMcN7Mlsqk/28ddKR5Q60J5vnioAhufg02NEYQ7B0u4xcsoiIrmZ209hf20u1z HDD9+YSSNtwpXv77IFPgqPvcCs5o3AEWyNEenv1jzhs3UFFs0sdeIp9bmDiQ5TsDg2vB w4WUo4s9vyTghhGndtpuMkHBk8/poVvEh6ECU= MIME-Version: 1.0 Received: by 10.211.161.5 with SMTP id n5mr947504ebo.89.1255700538113; Fri, 16 Oct 2009 06:42:18 -0700 (PDT) In-Reply-To: <4AD69BA5.8070501@sct.microlink.com.br> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> <4AD69BA5.8070501@sct.microlink.com.br> Date: Fri, 16 Oct 2009 15:42:18 +0200 Message-ID: <76882e540910160642g6239d298qbcba594b0085c07d@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=001636c5a68384be4c04760d90cc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5a68384be4c04760d90cc Content-Type: text/plain; charset=ISO-8859-1 Following the feedback that using UTF8 is better than porting LUA to UTF16, is there a LUA port or library which allows the user to: - define UTF8 literals; - open files with UTF8 names; - read and write Windows unicode text using only LUA strings - bind with external C code which work in UTF16 Thanks you all! Uri Cohen On Thu, Oct 15, 2009 at 5:48 AM, Andre de Leiradella < aleirade@sct.microlink.com.br> wrote: > I think ICU4Lua adds some support for utf-8 strings to Lua? > > > Jerome Vuarand wrote: > >> 2009/10/15 uri cohen : >> >>> I was able to create a UTF16 port of LUA for windows, by following the >>> guidelines I found at >>> http://lua-users.org/lists/lua-l/2002-12/msg00021.html >>> and the considerations from >>> http://lua-users.org/lists/lua-l/2002-12/msg00025.html. This is a >>> version of >>> LUA where all internal strings are UTF16 (wide characters) rather than >>> chars, not a version with two types of strings like LuaState. >>> >>> My question is on how can I verify my port works? Other than toy scripts >>> I >>> created, I'm looking for a comprehensive set of tests I can run in order >>> to >>> verify all important language feature were not broken... >>> >> >> I think you should make sure your "port" doesn't break libraries that >> use strings for non-text data. For examples, you can try to use the io >> library on binary files (use one of the (de)serialization libraries >> available around), or LuaSocket on binary protocols. >> >> By the way, what's the goal of such a modification of Lua ? If all you >> need is being able to use Unicode filenames on windows, a simpler >> approach is to assume filenames passed to Lua are in utf-8 format, and >> convert it just when necessary when accessing the filesystem (in just >> a very few places in Lua source code). I have a patch doing that if >> anyone is interested. >> >> >> -- Uri Cohen --001636c5a68384be4c04760d90cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Following the feedback that using UTF8 is better than port= ing LUA to UTF16, is there a LUA port or library which allows the user to:<= br>- define UTF8 literals;
- open files with UTF8 names;
- read and w= rite Windows unicode text using only LUA strings
- bind with external C code which work in UTF16
Thanks you all!
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Uri Cohen

On Thu, Oct 15, 2009 at 5:48 AM, Andre de Leiradella = <alei= rade@sct.microlink.com.br> wrote:
I think ICU4Lua a= dds some support for utf-8 strings to Lua?


Jerome Vuarand wrote:
2009/10/15 uri cohen <uri.cohen@gmail.com>:
I was able to create a UTF16 port of LUA for windows, by following the
guidelines I found at http://lua-users.org/lists/lua-l/2002-12/ms= g00021.html
and the considerations from
http://lua-users.org/lists/lua-l/2002-12/msg00025.html. Thi= s is a version of
LUA where all internal strings are UTF16 (wide characters) rather than
chars, not a version with two types of strings like LuaState.

My question is on how can I verify my port works? Other than toy scripts I<= br> created, I'm looking for a comprehensive set of tests I can run in orde= r to
verify all important language feature were not broken...

I think you should make sure your "port" doesn't break librar= ies that
use strings for non-text data. For examples, you can try to use the io
library on binary files (use one of the (de)serialization libraries
available around), or LuaSocket on binary protocols.

By the way, what's the goal of such a modification of Lua ? If all you<= br> need is being able to use Unicode filenames on windows, a simpler
approach is to assume filenames passed to Lua are in utf-8 format, and
convert it just when necessary when accessing the filesystem (in just
a very few places in Lua source code). I have a patch doing that if
anyone is interested.





--

=A0 = =A0 =A0 =A0 =A0 =A0Uri Cohen
--001636c5a68384be4c04760d90cc-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 11:26:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GEPwPn003368; Fri, 16 Oct 2009 11:26:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F54D19455; Fri, 16 Oct 2009 12:24:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A3A619417 for ; Fri, 16 Oct 2009 12:24:25 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id A9ABC8811A for ; Fri, 16 Oct 2009 15:25:16 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Help: Crash in garbage collection Date: Fri, 16 Oct 2009 15:25:09 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOY70wyBXMBLf5RD+5fqkZ4BbBLwABukgQ References: <20091016132214.GA17582@inf.puc-rio.br> From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9GEPwPn003368 I've had to do a rebuild of the app, and now the crash has moved. It's now in lgc.c propagatemark() case LUA_TTABLE: traversetable() -> if (!weakkey) markvalue(g, gkey(n)); The value of g going in to this function looks a little dubious. strt.nuse = 1363, size = 2048, sweepstrgc = 2048. You said sweepstrgc cannot be more than size, but can it be equal? Also GCthreshold = 2712903, as does "totalbytes" is this a bad thing, it seems like it might be. Unfortunately this is a windows app, so I can't use valgrind. I had a look at Memory Validator but it didn't flag anything up, maybe I wasn't using it right. It kind of looks like memory corruption being that it moves, but I'm suspiciois of that totalbytes count... Oh, yes, this is essentially a standard lua 5.1 installation. It's got bitlib compiled in, and a tiny bit of added functionality to tell some external code of when a library is "required", but that's it. Thanks for the help, Tom > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Roberto Ierusalimschy > Sent: 16 October 2009 14:22 > To: Lua list > Subject: Re: Help: Crash in garbage collection > > > I have a problem that I've been tearing my hair out over for the past > > day or so. We have an application that saves out data in a lua > > parseable file. This has been working for a good few months, but we > > have found a file that under some as yet unknown condition will crash > in > > lua when saving. The crash occurs in sweeplist() at the line: > > > > while ((curr = *p) != NULL && count-- > 0) { > > if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each > > thread */ > > > > This is called from singlestep, case GCSsweepstring. I have noticed > > that g->sweepstrgc is larger than g->strt.nuse. Is that a bad thing > as > > it seems to me like it would be. If so, how would it get into such a > > state? > > There should be no problem in sweepstrgc being large than nuse; it > cannot be larger than strt.size. However, strt.size is usually (but not > necessarily) larger than strt.nuse. Can you get all these values (nuse, > strt.size, and sweepstrgc) after the crash? > > Are you using a standard Lua instalation? What version? Any extra C > libraries? Can you use a tool for checking memory corruption (e.g., > valgrind)? > > -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 11:33:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GEXOuc004868; Fri, 16 Oct 2009 11:33:25 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAF411946E; Fri, 16 Oct 2009 12:32:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from shelob.oktetlabs.ru (unknown [195.131.132.186]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CD5419469 for ; Fri, 16 Oct 2009 12:32:04 -0200 (BRST) Received: by shelob.oktetlabs.ru (Postfix, from userid 5001) id 53B6576DA5; Fri, 16 Oct 2009 18:32:45 +0400 (MSD) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru 53B6576DA5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1255703565; bh=PMy2A8PCzXya/sB+C7oWnVDxlVajEt1GPSo5z1B snm0=; l=256; h=Message-ID:Date:From:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=N VnPt2FpZsE4VnGrPpB/496xtBVMsg/IP9uHE/PYJcaDZZSMR8UKB64oKg9q5DGLR66j YSFUHp45mKh4ikAhwVZL7ne9+Yk0cK+Dhuq/pydq44hNPGLu5TZKr0ouHiykI7gW0JX PPT4zMonhi8ScO2Xt+E4i5S1MGgmwlUoyOJQ= X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED autolearn=ham version=3.2.5 Received: from [192.168.38.66] (marish.oktetlabs.ru [192.168.38.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 08CF776D8E for ; Fri, 16 Oct 2009 18:32:43 +0400 (MSD) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru 08CF776D8E Message-ID: <4AD8840A.6050909@oktetlabs.ru> Date: Fri, 16 Oct 2009 18:32:42 +0400 From: Nikolai Kondrashov User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Lua list Subject: Re: Help: Crash in garbage collection References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Tom Miles wrote: > Any help in tracking this down would be greatly appreciated. On the > plus side, I now know a little bit more about how lua works internally! > :) It maybe obvious, but have you tried running it under Valgrind? Sincerely, Nick From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 12:26:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GFQom1015497; Fri, 16 Oct 2009 12:26:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C539D1947A; Fri, 16 Oct 2009 13:25:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F8501946F for ; Fri, 16 Oct 2009 13:25:13 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id 0AD3F88119 for ; Fri, 16 Oct 2009 16:25:58 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA4E74.F0A85BFE" Subject: RE: Help: Crash in garbage collection Date: Fri, 16 Oct 2009 16:25:50 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOVTEnLor6/IJrQ22AihL1LP1exAAH3aHQ References: From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA4E74.F0A85BFE Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 TG9sLiAgV2VsbCBJIGRpc2FibGVkIHRoZSBnYXJiYWdlIGNvbGxlY3RvciBiZWZvcmUgc2F2aW5n IGFuZCBpdCBkb2VzIGluZGVlZCBzdG9wIHRoZSBjcmFzaC4gIElmIEkgZG8gYSBmdWxsIGNvbGxl Y3QgYWZ0ZXIgcmUtZW5hYmxpbmcgaXQsIGl0IGNyYXNoZXMgdGhlbiBpbnN0ZWFkLCBidXQgYXQg bGVhc3QgSSBoYXZlIGEgdmFsaWQgc2F2ZSBmaWxlLiA6KSAgSSBndWVzcyBJIGNvdWxkIGFsd2F5 cyBkaXNhYmxlZCBnYXJiYWdlIGNvbGxlY3Rpb24gb24gdGhhdCBzdGF0ZSBjb21wbGV0ZWx5LCBh bmQganVzdCBoYXZlIG15IGFwcCBlYXQgbWVtb3J5IHVudGlsIHF1aXR0aW5nISAgQXMgeW91IHNh eSwgbm90IGEgc29sdXRpb24sIGJ1dCBpdCBtZWFucyBteSB0ZWFtIGNhbiBjYXJyeSBvbiB3b3Jr aW5nIHdoaWxlIEkgdHJ5IGFuZCBmaWd1cmUgb3V0IHdoYXQncyBnb2luZyB3cm9uZy4NCg0KIA0K DQpGcm9tOiBsdWEtYm91bmNlc0BiYXphcjIuY29uZWN0aXZhLmNvbS5iciBbbWFpbHRvOmx1YS1i b3VuY2VzQGJhemFyMi5jb25lY3RpdmEuY29tLmJyXSBPbiBCZWhhbGYgT2YgTGlua2VyDQpTZW50 OiAxNiBPY3RvYmVyIDIwMDkgMTI6MzgNClRvOiBMdWEgbGlzdA0KU3ViamVjdDogUmU6IEhlbHA6 IENyYXNoIGluIGdhcmJhZ2UgY29sbGVjdGlvbg0KDQogDQoNCkhpIFRvbSwNCg0KICBZb3UgY2Fu IGp1c3Qgc3RvcCB0aGUgR0MgZm9yIHNhdmluZyB5b3VyIGRhdGEgYnkgY2FsbGluZzoNCg0KY29s bGVjdGdhcmJhZ2UoInN0b3AiKQ0KDQogIEl0J3Mgbm90IGEgc29sdXRpb24gZm9yIHlvdXIgcHJv YmxlbSwgYnV0IGp1c3QgYSB3b3JrIGFyb3VuZC4oTWF5IHlvdXIgdGltZSBpcyBsaW1pdGVkLikN Cg0KVGhhbmtzLg0KDQogDQoNCi0tIA0KUmVnYXJkcywNCkxpbmtlciBMaW4NCmxpbmtlci5tLmxp bkBnbWFpbC5jb20NCg0K ------_=_NextPart_001_01CA4E74.F0A85BFE Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: base64 PGh0bWwgeG1sbnM6dj0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp2bWwiIHhtbG5zOm89InVy bjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2ZmaWNlOm9mZmljZSIgeG1sbnM6dz0idXJuOnNjaGVt YXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6d29yZCIgeG1sbnM6eD0idXJuOnNjaGVtYXMtbWljcm9z b2Z0LWNvbTpvZmZpY2U6ZXhjZWwiIHhtbG5zOnA9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206 b2ZmaWNlOnBvd2VycG9pbnQiIHhtbG5zOmE9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2Zm aWNlOmFjY2VzcyIgeG1sbnM6ZHQ9InV1aWQ6QzJGNDEwMTAtNjVCMy0xMWQxLUEyOUYtMDBBQTAw QzE0ODgyIiB4bWxuczpzPSJ1dWlkOkJEQzZFM0YwLTZEQTMtMTFkMS1BMkEzLTAwQUEwMEMxNDg4 MiIgeG1sbnM6cnM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206cm93c2V0IiB4bWxuczp6PSIj Um93c2V0U2NoZW1hIiB4bWxuczpiPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpw dWJsaXNoZXIiIHhtbG5zOnNzPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpzcHJl YWRzaGVldCIgeG1sbnM6Yz0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6Y29tcG9u ZW50OnNwcmVhZHNoZWV0IiB4bWxuczpvZGM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2Zm aWNlOm9kYyIgeG1sbnM6b2E9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2ZmaWNlOmFjdGl2 YXRpb24iIHhtbG5zOmh0bWw9Imh0dHA6Ly93d3cudzMub3JnL1RSL1JFQy1odG1sNDAiIHhtbG5z OnE9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczpydGM9 Imh0dHA6Ly9taWNyb3NvZnQuY29tL29mZmljZW5ldC9jb25mZXJlbmNpbmciIHhtbG5zOkQ9IkRB VjoiIHhtbG5zOlJlcGw9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vcmVwbC8iIHhtbG5z Om10PSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3NoYXJlcG9pbnQvc29hcC9tZWV0aW5n cy8iIHhtbG5zOngyPSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL29mZmljZS9leGNlbC8y MDAzL3htbCIgeG1sbnM6cHBkYT0iaHR0cDovL3d3dy5wYXNzcG9ydC5jb20vTmFtZVNwYWNlLnhz ZCIgeG1sbnM6b2lzPSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3NoYXJlcG9pbnQvc29h cC9vaXMvIiB4bWxuczpkaXI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vc2hhcmVwb2lu dC9zb2FwL2RpcmVjdG9yeS8iIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3ht bGRzaWcjIiB4bWxuczpkc3A9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vc2hhcmVwb2lu dC9kc3AiIHhtbG5zOnVkYz0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9kYXRhL3VkYyIg eG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6c3ViPSJo dHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3NoYXJlcG9pbnQvc29hcC8yMDAyLzEvYWxlcnRz LyIgeG1sbnM6ZWM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZW5jIyIgeG1sbnM6c3A9 Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vc2hhcmVwb2ludC8iIHhtbG5zOnNwcz0iaHR0 cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9zaGFyZXBvaW50L3NvYXAvIiB4bWxuczp4c2k9Imh0 dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4bWxuczp1ZGNzPSJodHRw Oi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL2RhdGEvdWRjL3NvYXAiIHhtbG5zOnVkY3hmPSJodHRw Oi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL2RhdGEvdWRjL3htbGZpbGUiIHhtbG5zOnVkY3AycD0i aHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9kYXRhL3VkYy9wYXJ0dG9wYXJ0IiB4bWxuczp3 Zj0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9zaGFyZXBvaW50L3NvYXAvd29ya2Zsb3cv IiB4bWxuczpkc3NzPSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL29mZmljZS8yMDA2L2Rp Z3NpZy1zZXR1cCIgeG1sbnM6ZHNzaT0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9vZmZp Y2UvMjAwNi9kaWdzaWciIHhtbG5zOm1kc3NpPSJodHRwOi8vc2NoZW1hcy5vcGVueG1sZm9ybWF0 cy5vcmcvcGFja2FnZS8yMDA2L2RpZ2l0YWwtc2lnbmF0dXJlIiB4bWxuczptdmVyPSJodHRwOi8v c2NoZW1hcy5vcGVueG1sZm9ybWF0cy5vcmcvbWFya3VwLWNvbXBhdGliaWxpdHkvMjAwNiIgeG1s bnM6bT0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9vZmZpY2UvMjAwNC8xMi9vbW1sIiB4 bWxuczptcmVscz0iaHR0cDovL3NjaGVtYXMub3BlbnhtbGZvcm1hdHMub3JnL3BhY2thZ2UvMjAw Ni9yZWxhdGlvbnNoaXBzIiB4bWxuczpzcHdwPSJodHRwOi8vbWljcm9zb2Z0LmNvbS9zaGFyZXBv aW50L3dlYnBhcnRwYWdlcyIgeG1sbnM6ZXgxMnQ9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5j b20vZXhjaGFuZ2Uvc2VydmljZXMvMjAwNi90eXBlcyIgeG1sbnM6ZXgxMm09Imh0dHA6Ly9zY2hl bWFzLm1pY3Jvc29mdC5jb20vZXhjaGFuZ2Uvc2VydmljZXMvMjAwNi9tZXNzYWdlcyIgeG1sbnM6 cHB0c2w9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vc2hhcmVwb2ludC9zb2FwL1NsaWRl TGlicmFyeS8iIHhtbG5zOnNwc2w9Imh0dHA6Ly9taWNyb3NvZnQuY29tL3dlYnNlcnZpY2VzL1No YXJlUG9pbnRQb3J0YWxTZXJ2ZXIvUHVibGlzaGVkTGlua3NTZXJ2aWNlIiB4bWxuczpaPSJ1cm46 c2NoZW1hcy1taWNyb3NvZnQtY29tOiIgeG1sbnM6c3Q9IiYjMTsiIHhtbG5zPSJodHRwOi8vd3d3 LnczLm9yZy9UUi9SRUMtaHRtbDQwIj4NCg0KPGhlYWQ+DQo8bWV0YSBodHRwLWVxdWl2PUNvbnRl bnQtVHlwZSBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgiPg0KPG1ldGEgbmFtZT1H ZW5lcmF0b3IgY29udGVudD0iTWljcm9zb2Z0IFdvcmQgMTIgKGZpbHRlcmVkIG1lZGl1bSkiPg0K PHN0eWxlPg0KPCEtLQ0KIC8qIEZvbnQgRGVmaW5pdGlvbnMgKi8NCiBAZm9udC1mYWNlDQoJe2Zv bnQtZmFtaWx5OiJDYW1icmlhIE1hdGgiOw0KCXBhbm9zZS0xOjIgNCA1IDMgNSA0IDYgMyAyIDQ7 fQ0KQGZvbnQtZmFjZQ0KCXtmb250LWZhbWlseTpDYWxpYnJpOw0KCXBhbm9zZS0xOjIgMTUgNSAy IDIgMiA0IDMgMiA0O30NCkBmb250LWZhY2UNCgl7Zm9udC1mYW1pbHk6VGFob21hOw0KCXBhbm9z ZS0xOjIgMTEgNiA0IDMgNSA0IDQgMiA0O30NCiAvKiBTdHlsZSBEZWZpbml0aW9ucyAqLw0KIHAu TXNvTm9ybWFsLCBsaS5Nc29Ob3JtYWwsIGRpdi5Nc29Ob3JtYWwNCgl7bWFyZ2luOjBjbTsNCglt YXJnaW4tYm90dG9tOi4wMDAxcHQ7DQoJZm9udC1zaXplOjEyLjBwdDsNCglmb250LWZhbWlseToi VGltZXMgTmV3IFJvbWFuIiwic2VyaWYiO30NCmE6bGluaywgc3Bhbi5Nc29IeXBlcmxpbmsNCgl7 bXNvLXN0eWxlLXByaW9yaXR5Ojk5Ow0KCWNvbG9yOmJsdWU7DQoJdGV4dC1kZWNvcmF0aW9uOnVu ZGVybGluZTt9DQphOnZpc2l0ZWQsIHNwYW4uTXNvSHlwZXJsaW5rRm9sbG93ZWQNCgl7bXNvLXN0 eWxlLXByaW9yaXR5Ojk5Ow0KCWNvbG9yOnB1cnBsZTsNCgl0ZXh0LWRlY29yYXRpb246dW5kZXJs aW5lO30NCnNwYW4uRW1haWxTdHlsZTE3DQoJe21zby1zdHlsZS10eXBlOnBlcnNvbmFsLXJlcGx5 Ow0KCWZvbnQtZmFtaWx5OiJDYWxpYnJpIiwic2Fucy1zZXJpZiI7DQoJY29sb3I6IzFGNDk3RDt9 DQouTXNvQ2hwRGVmYXVsdA0KCXttc28tc3R5bGUtdHlwZTpleHBvcnQtb25seTt9DQpAcGFnZSBT ZWN0aW9uMQ0KCXtzaXplOjYxMi4wcHQgNzkyLjBwdDsNCgltYXJnaW46NzIuMHB0IDcyLjBwdCA3 Mi4wcHQgNzIuMHB0O30NCmRpdi5TZWN0aW9uMQ0KCXtwYWdlOlNlY3Rpb24xO30NCi0tPg0KPC9z dHlsZT4NCjwhLS1baWYgZ3RlIG1zbyA5XT48eG1sPg0KIDxvOnNoYXBlZGVmYXVsdHMgdjpleHQ9 ImVkaXQiIHNwaWRtYXg9IjEwMjYiIC8+DQo8L3htbD48IVtlbmRpZl0tLT48IS0tW2lmIGd0ZSBt c28gOV0+PHhtbD4NCiA8bzpzaGFwZWxheW91dCB2OmV4dD0iZWRpdCI+DQogIDxvOmlkbWFwIHY6 ZXh0PSJlZGl0IiBkYXRhPSIxIiAvPg0KIDwvbzpzaGFwZWxheW91dD48L3htbD48IVtlbmRpZl0t LT4NCjwvaGVhZD4NCg0KPGJvZHkgbGFuZz1FTi1HQiBsaW5rPWJsdWUgdmxpbms9cHVycGxlPg0K DQo8ZGl2IGNsYXNzPVNlY3Rpb24xPg0KDQo8cCBjbGFzcz1Nc29Ob3JtYWw+PHNwYW4gc3R5bGU9 J2ZvbnQtc2l6ZToxMS4wcHQ7Zm9udC1mYW1pbHk6IkNhbGlicmkiLCJzYW5zLXNlcmlmIjsNCmNv bG9yOiMxRjQ5N0QnPkxvbC7CoCBXZWxsIEkgZGlzYWJsZWQgdGhlIGdhcmJhZ2UgY29sbGVjdG9y IGJlZm9yZSBzYXZpbmcgYW5kIGl0DQpkb2VzIGluZGVlZCBzdG9wIHRoZSBjcmFzaC7CoCBJZiBJ IGRvIGEgZnVsbCBjb2xsZWN0IGFmdGVyIHJlLWVuYWJsaW5nIGl0LCBpdA0KY3Jhc2hlcyB0aGVu IGluc3RlYWQsIGJ1dCBhdCBsZWFzdCBJIGhhdmUgYSB2YWxpZCBzYXZlIGZpbGUuIDopwqAgSSBn dWVzcyBJDQpjb3VsZCBhbHdheXMgZGlzYWJsZWQgZ2FyYmFnZSBjb2xsZWN0aW9uIG9uIHRoYXQg c3RhdGUgY29tcGxldGVseSwgYW5kIGp1c3QNCmhhdmUgbXkgYXBwIGVhdCBtZW1vcnkgdW50aWwg cXVpdHRpbmchwqAgQXMgeW91IHNheSwgbm90IGEgc29sdXRpb24sIGJ1dCBpdA0KbWVhbnMgbXkg dGVhbSBjYW4gY2Fycnkgb24gd29ya2luZyB3aGlsZSBJIHRyeSBhbmQgZmlndXJlIG91dCB3aGF0 J3MgZ29pbmcNCndyb25nLjxvOnA+PC9vOnA+PC9zcGFuPjwvcD4NCg0KPHAgY2xhc3M9TXNvTm9y bWFsPjxzcGFuIHN0eWxlPSdmb250LXNpemU6MTEuMHB0O2ZvbnQtZmFtaWx5OiJDYWxpYnJpIiwi c2Fucy1zZXJpZiI7DQpjb2xvcjojMUY0OTdEJz48bzpwPiZuYnNwOzwvbzpwPjwvc3Bhbj48L3A+ DQoNCjxkaXYgc3R5bGU9J2JvcmRlcjpub25lO2JvcmRlci1sZWZ0OnNvbGlkIGJsdWUgMS41cHQ7 cGFkZGluZzowY20gMGNtIDBjbSA0LjBwdCc+DQoNCjxkaXY+DQoNCjxkaXYgc3R5bGU9J2JvcmRl cjpub25lO2JvcmRlci10b3A6c29saWQgI0I1QzRERiAxLjBwdDtwYWRkaW5nOjMuMHB0IDBjbSAw Y20gMGNtJz4NCg0KPHAgY2xhc3M9TXNvTm9ybWFsPjxiPjxzcGFuIGxhbmc9RU4tVVMgc3R5bGU9 J2ZvbnQtc2l6ZToxMC4wcHQ7Zm9udC1mYW1pbHk6DQoiVGFob21hIiwic2Fucy1zZXJpZiInPkZy b206PC9zcGFuPjwvYj48c3BhbiBsYW5nPUVOLVVTIHN0eWxlPSdmb250LXNpemU6MTAuMHB0Ow0K Zm9udC1mYW1pbHk6IlRhaG9tYSIsInNhbnMtc2VyaWYiJz4gbHVhLWJvdW5jZXNAYmF6YXIyLmNv bmVjdGl2YS5jb20uYnIgW21haWx0bzpsdWEtYm91bmNlc0BiYXphcjIuY29uZWN0aXZhLmNvbS5i cl0NCjxiPk9uIEJlaGFsZiBPZiA8L2I+TGlua2VyPGJyPg0KPGI+U2VudDo8L2I+IDE2IE9jdG9i ZXIgMjAwOSAxMjozODxicj4NCjxiPlRvOjwvYj4gTHVhIGxpc3Q8YnI+DQo8Yj5TdWJqZWN0Ojwv Yj4gUmU6IEhlbHA6IENyYXNoIGluIGdhcmJhZ2UgY29sbGVjdGlvbjxvOnA+PC9vOnA+PC9zcGFu PjwvcD4NCg0KPC9kaXY+DQoNCjwvZGl2Pg0KDQo8cCBjbGFzcz1Nc29Ob3JtYWw+PG86cD4mbmJz cDs8L286cD48L3A+DQoNCjxwIGNsYXNzPU1zb05vcm1hbD5IaSBUb20sPG86cD48L286cD48L3A+ DQoNCjxkaXY+DQoNCjxwIGNsYXNzPU1zb05vcm1hbD4mbmJzcDsmbmJzcDtZb3UgY2FuIGp1c3Qg c3RvcCB0aGUgR0MgZm9yIHNhdmluZyB5b3VyIGRhdGEgYnkNCmNhbGxpbmc6PG86cD48L286cD48 L3A+DQoNCjwvZGl2Pg0KDQo8ZGl2Pg0KDQo8cCBjbGFzcz1Nc29Ob3JtYWw+PGI+PGk+Y29sbGVj dGdhcmJhZ2UoJnF1b3Q7c3RvcCZxdW90Oyk8L2k+PC9iPjxvOnA+PC9vOnA+PC9wPg0KDQo8L2Rp dj4NCg0KPGRpdj4NCg0KPHAgY2xhc3M9TXNvTm9ybWFsPiZuYnNwOyZuYnNwO0l0J3Mgbm90IGEg c29sdXRpb24gZm9yIHlvdXIgcHJvYmxlbSwgYnV0IGp1c3QgYQ0Kd29yayBhcm91bmQuKE1heSB5 b3VyIHRpbWUgaXMgbGltaXRlZC4pPG86cD48L286cD48L3A+DQoNCjwvZGl2Pg0KDQo8ZGl2Pg0K DQo8cCBjbGFzcz1Nc29Ob3JtYWw+VGhhbmtzLjxvOnA+PC9vOnA+PC9wPg0KDQo8L2Rpdj4NCg0K PGRpdj4NCg0KPHAgY2xhc3M9TXNvTm9ybWFsPjxvOnA+Jm5ic3A7PC9vOnA+PC9wPg0KDQo8L2Rp dj4NCg0KPGRpdj4NCg0KPHAgY2xhc3M9TXNvTm9ybWFsPi0tIDxicj4NClJlZ2FyZHMsPGJyPg0K TGlua2VyIExpbjxicj4NCjxhIGhyZWY9Im1haWx0bzpsaW5rZXIubS5saW5AZ21haWwuY29tIj5s aW5rZXIubS5saW5AZ21haWwuY29tPC9hPjxvOnA+PC9vOnA+PC9wPg0KDQo8L2Rpdj4NCg0KPC9k aXY+DQoNCjwvZGl2Pg0KDQo8L2JvZHk+DQoNCjwvaHRtbD4NCg== ------_=_NextPart_001_01CA4E74.F0A85BFE-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 12:37:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GFbpXM017269; Fri, 16 Oct 2009 12:37:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15D46193F1; Fri, 16 Oct 2009 13:36:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4DDD193D9 for ; Fri, 16 Oct 2009 13:36:27 -0200 (BRST) Received: by fxm12 with SMTP id 12so2701548fxm.5 for ; Fri, 16 Oct 2009 08:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=0l4+TAq6WNvm7zLWIhPq4zlcs1Eo6vbhXZ1Wq95LeTg=; b=K7HuG1lJP+HFio8bahRE7Gx+g17TdztjlwpK6xgdcb2foBSaOoq8fwuYXtEWr61p2o VUOs2zwFwgnn58nej7CvfsdkX/vzjcNfloST6s3AkRuASv0XdfjeE+4/vfJHVrR/CYub OiYaECeWxt2tyZ6TLirrcugmzlUWxhv01OYUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=h+xpWiG4YXojfrv9hIvgV1kfjziGzotlqZiAAD1h7k02XgG82eQ2oLLCabBjFkTFZD 9Kwvp8QldER91g+nk6iBgdQUe1PAIKbAlfFUiBhddFUUg7WUjQajsSmhy6WPCmUPrdsB AwgW4lZdZz7KquvFUxWfM4/sgH2IeOLtzW7RI= MIME-Version: 1.0 Received: by 10.204.155.92 with SMTP id r28mr1419733bkw.121.1255707429424; Fri, 16 Oct 2009 08:37:09 -0700 (PDT) In-Reply-To: References: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> <4AD81188.40209@wp.pl> Date: Fri, 16 Oct 2009 10:37:09 -0500 X-Google-Sender-Auth: bf3f86a9f37306c7 Message-ID: <5ba75e2f0910160837j19ca3den5ffb2245863356a5@mail.gmail.com> Subject: Re: a new domain for the LuaForge mirror From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf7d645cdde04760f2b6e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf7d645cdde04760f2b6e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable OK, mixing both solutions will work also, I mean: A IP SRV1 A IP SRV2 A IP subdomain-SRV2 So, the SRV2 is ~always available via the subdomain, and also brings suppor= t for SRV1 Blessings! 2009/10/16 Stuart P. Bentley > There should be multiple DNS servers, though. I remember the nameserver > being down during the outage. > > -------------------------------------------------- > From: "Michal Kolodziejczyk" > Sent: Thursday, October 15, 2009 P11:24 > Newsgroups: gmane.comp.lang.lua.general > To: "Lua list" > Subject: Re: a new domain for the LuaForge mirror > > > Fernando P. Garc=C3=ADa wrote: >> >>> What about Round Robin DNS? >>> >>> I mean to have 2 A records :), EveryDNS supports it AFAIK >>> >> >> Then if the main site goes down, every second request (on average) will >> time out. I think the point is to choose a different site if you cannot >> connect to the main site. So you should be able to choose which server >> you want to connect to. >> >> Regards, >> miko >> >> --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf7d645cdde04760f2b6e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable OK, mixing both solutions will work also, I mean:

A IP SRV1
A IP = SRV2
A IP subdomain-SRV2

So, the SRV2 is ~always available via th= e subdomain, and also brings support for SRV1

Blessings!

2009/10/16 Stuart P. Bentley <stuart@testtrack4.com>
There should be multiple DNS servers, though. I remember the nameserver bei= ng down during the outage.

--------------------------------------------------
From: "Michal Kolodziejczyk" <miko@wp.pl>
Sent: Thursday, October 15, 2009 P11:24
Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: a new domain for the LuaForge mirror


Fernando P. Garc=C3=ADa wrote:
What about Round Robin DNS?

I mean to have 2 A records :), EveryDNS supports it AFAIK

Then if the main site goes down, every second request (on average) will
time out. I think the point is to choose a different site if you cannot
connect to the main site. So you should be able to choose which server
you want to connect to.

Regards,
miko




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf7d645cdde04760f2b6e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 12:53:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GFrBf2019771; Fri, 16 Oct 2009 12:53:12 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E506C19478; Fri, 16 Oct 2009 13:51:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73C0019469 for ; Fri, 16 Oct 2009 13:51:53 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GFqaRD019709 for ; Fri, 16 Oct 2009 12:52:36 -0300 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n9GFqZAG019707 for lua@bazar2.conectiva.com.br; Fri, 16 Oct 2009 12:52:35 -0300 Date: Fri, 16 Oct 2009 12:52:35 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Help: Crash in garbage collection Message-ID: <20091016155235.GA19607@duchamp.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Lol. Well I disabled the garbage collector before saving and it does indeed stop the crash. If I do a full collect after re-enabling it, it crashes then instead, but at least I have a valid save file. How do you save the file? From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 13:00:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GG0efp021132; Fri, 16 Oct 2009 13:00:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 272FE19484; Fri, 16 Oct 2009 13:59:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E88D419480 for ; Fri, 16 Oct 2009 13:59:12 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id 36A5088119 for ; Fri, 16 Oct 2009 17:00:01 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Help: Crash in garbage collection Date: Fri, 16 Oct 2009 16:59:51 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOeLcX3e1iK7Y5TH2F7gKybJNV9QAAD4jg References: <20091016155235.GA19607@duchamp.tecgraf.puc-rio.br> From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9GG0efp021132 > > > Lol. Well I disabled the garbage collector before saving and it does > indeed stop the crash. If I do a full collect after re-enabling it, it > crashes then instead, but at least I have a valid save file. > > How do you save the file? I build up a structure of embedded tables then save them out using some custom file writer that goes through all the tables saving to a text file. The crash occurs when building up the initial table to save. The structure I am saving out is a depth first search of an object tree with each table representing a child node. Generally the crash occurs when I have recursed to at least 10 nodes deep. From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 13:04:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GG48xO021766; Fri, 16 Oct 2009 13:04:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC6901948C; Fri, 16 Oct 2009 14:02:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from shelob.oktetlabs.ru (unknown [195.131.132.186]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF92919482 for ; Fri, 16 Oct 2009 14:02:49 -0200 (BRST) Received: by shelob.oktetlabs.ru (Postfix, from userid 5001) id 9F7B676DA5; Fri, 16 Oct 2009 20:03:33 +0400 (MSD) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru 9F7B676DA5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1255709013; bh=lxbSXVC8Fhnpa3ZORLYHyI8jY9xM49zIOPFHJKh jEpc=; l=516; h=Message-ID:Date:From:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=r PDsHPZoZRS/ZEHlsdWoKpIbWmGRyVw9f6ju6KUWhM9yGNfzJwzhp5sN3gi4R8KBt2KC wcd53n+SzoOgAznJogMlwh0lbOhcEVj7FahXtBwW15KO1P4nSHSTfetWBcKtNuf7TRV f6XXIE9Ct7oReLkvSl0xuzFKFENzKnO+zfv8= X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED autolearn=ham version=3.2.5 Received: from [192.168.38.66] (marish.oktetlabs.ru [192.168.38.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id A88C076D8E for ; Fri, 16 Oct 2009 20:03:25 +0400 (MSD) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru A88C076D8E Message-ID: <4AD8994D.4030000@oktetlabs.ru> Date: Fri, 16 Oct 2009 20:03:25 +0400 From: Nikolai Kondrashov User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Lua list Subject: Re: Help: Crash in garbage collection References: <20091016155235.GA19607@duchamp.tecgraf.puc-rio.br> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Tom Miles wrote: > I build up a structure of embedded tables then save them out using some > custom file writer that goes through all the tables saving to a text > file. The crash occurs when building up the initial table to save. The > structure I am saving out is a depth first search of an object tree with > each table representing a child node. Generally the crash occurs when I > have recursed to at least 10 nodes deep. Could it be, by any chance a lua_checkstack-missing issue? Sincerely, Nick From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 13:34:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GGYbkc026650; Fri, 16 Oct 2009 13:34:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A5CA19487; Fri, 16 Oct 2009 14:33:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91CE319479 for ; Fri, 16 Oct 2009 14:33:08 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9GGXqHB027229 for ; Fri, 16 Oct 2009 13:33:53 -0300 Received: by localhost.localdomain (Postfix, from userid 1000) id EAF2054C14E; Fri, 16 Oct 2009 13:33:52 -0300 (BRT) Date: Fri, 16 Oct 2009 13:33:52 -0300 From: Roberto Ierusalimschy To: Lua list Subject: Re: Help: Crash in garbage collection Message-ID: <20091016163352.GA18451@inf.puc-rio.br> References: <20091016132214.GA17582@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I've had to do a rebuild of the app, and now the crash has moved. It's > now in lgc.c > > propagatemark() > case LUA_TTABLE: > traversetable() > -> if (!weakkey) markvalue(g, gkey(n)); > > The value of g going in to this function looks a little dubious. > strt.nuse = 1363, size = 2048, sweepstrgc = 2048. You said sweepstrgc > cannot be more than size, but can it be equal? Yes. > Also GCthreshold = 2712903, as does "totalbytes" is this a bad thing, it > seems like it might be. No problem here, I guess. > Unfortunately this is a windows app, so I can't use valgrind. I had a > look at Memory Validator but it didn't flag anything up, maybe I wasn't > using it right. It kind of looks like memory corruption being that it > moves, but I'm suspiciois of that totalbytes count... > > Oh, yes, this is essentially a standard lua 5.1 installation. It's got > bitlib compiled in, and a tiny bit of added functionality to tell some > external code of when a library is "required", but that's it. It looks like memory corruption. Can you reproduce this bug consistently? -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 13:37:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GGaw4e027032; Fri, 16 Oct 2009 13:36:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4966919492; Fri, 16 Oct 2009 14:35:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F09B1948E for ; Fri, 16 Oct 2009 14:35:41 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GGaN8l026958 for ; Fri, 16 Oct 2009 13:36:23 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9GGaMR06100; Fri, 16 Oct 2009 13:36:22 -0300 Date: Fri, 16 Oct 2009 13:36:22 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Help: Crash in garbage collection Message-ID: <20091016133622.A6074@lua.tecgraf.puc-rio.br> References: <20091016132214.GA17582@inf.puc-rio.br> <20091016163352.GA18451@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091016163352.GA18451@inf.puc-rio.br>; from roberto@inf.puc-rio.br on Fri, Oct 16, 2009 at 01:33:52PM -0300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br If you are saving the file with C code then rebuild Lua with API asserts on and see if that helps. From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 16:18:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GJIHVa027275; Fri, 16 Oct 2009 16:18:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5F4B192E8; Fri, 16 Oct 2009 17:16:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA03E192DA for ; Fri, 16 Oct 2009 17:16:54 -0200 (BRST) Received: by gxk8 with SMTP id 8so2532217gxk.1 for ; Fri, 16 Oct 2009 12:17:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.189.5 with SMTP id r5mr1719250agp.31.1255720658675; Fri, 16 Oct 2009 12:17:38 -0700 (PDT) In-Reply-To: <9a0c00530910160504u7cbcba4j10089cc2071187@mail.gmail.com> References: <1536876966.20091016124402@gmail.com> <9a0c00530910160504u7cbcba4j10089cc2071187@mail.gmail.com> Date: Fri, 16 Oct 2009 22:17:38 +0300 X-Google-Sender-Auth: 8725ccd240f975de Message-ID: Subject: Re: Re[2]: Kepler cleanup From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016e64603f2cc28370476123f2b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64603f2cc28370476123f2b Content-Type: text/plain; charset=UTF-8 I read c2.com since ages and I still have a very good opinion about it :) You don't stop antisocial people with sign-up forms anyway :) On Fri, Oct 16, 2009 at 15:04, Paul Hudson wrote: > Have a look at Ward's Wiki to see what damage and pain antisocial people > can cause on a Wiki. > > It's mostly under control there, but it takes a lot of time and effort from > a lot of people to keep it that way. > > 2009/10/16 Cosmin Apreutesei > >> no need - what could a spammer do with a captcha + delayed indexing? this >> spam thing is a lame excuse IMHO >> >> > --0016e64603f2cc28370476123f2b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I read
c2.com since ages and I still have a v= ery good opinion about it :) You don't stop antisocial people with sign= -up forms anyway :)

On Fri, O= ct 16, 2009 at 15:04, Paul Hudson <phudson@pobox.com> wrote:
Have a look at Ward's Wiki to see what = damage and pain antisocial people can cause on a Wiki.

It's most= ly under control there, but it takes a lot of time and effort from a lot of= people to keep it that way.

2009/10/16 Cosmin Apreutesei <cos= min.apreutesei@gmail.com>
no need - what could a spammer do with a captcha + delayed indexing? this s= pam thing is a lame excuse IMHO



--0016e64603f2cc28370476123f2b-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 17:49:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GKnpr5015038; Fri, 16 Oct 2009 17:49:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D14619303; Fri, 16 Oct 2009 18:48:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D89B192A6 for ; Fri, 16 Oct 2009 18:48:22 -0200 (BRST) Received: by pxi1 with SMTP id 1so489110pxi.33 for ; Fri, 16 Oct 2009 13:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=cXHfd/aaKfvBv8t+HL2gjgu5c8vxHYis0oec7YUb1Xg=; b=F9Abc7ZA2RCtHzNVxPWmqENZ5mLAOCbAVnAGWCpDUFwTSRMVxaJuBk9txb7Pj7nPhn YlKwgycIBkULoPaMOA5tItBbd1MK/jMkebN50/0WjPxX8VzJ/Ht1d6V9JqT58WBfNMzY 3zFMYK+hXyVTWz0WF+5NE9OPsjvOmGaYjNMfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=mLw0H5BpJ5yDl7pX3QeGvJE2iVRyNoe7iStdUl6d6xv7siHY823F4Pl1TidC0TGrZ2 xxqvEcIOLCVcYxXmJuT3IlgclZJmALhuMZenpjJBDaEaXFEQWcF/C01OZkkiDWut/aoD 8MDazu9+lVjCxKq34UfXYWldNkG9LjVvFBJS0= MIME-Version: 1.0 Received: by 10.141.48.3 with SMTP id a3mr148096rvk.266.1255726146696; Fri, 16 Oct 2009 13:49:06 -0700 (PDT) Date: Fri, 16 Oct 2009 13:49:06 -0700 Message-ID: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> Subject: Crash in luaL_loadfile in 64-bit x86_64 From: "E. Wing" To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9GKnpr5015038 I have a semi-reproducible crash in Lua running in 64-bit x86_64 on Snow Leopard. When it crashes, I get a: Program received signal: “EXC_BAD_ACCESS”. at this line: while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ in the internal Lua function: static TValue *newkey (lua_State *L, Table *t, const TValue *key) (othern seems to be NULL which I think is related to the crash.) It only seems to crash in 64-bit mode for me. I have not experienced any problems in 32-bit mode. What's very strange is that if I make minor changes to my Lua script, such as deleting a line or changing a few things around, my program may or may not crash the next time around. But once I have a script that triggers the crash, it always seems to be reproducible with that exact same script. I gutted my program reduced it to a bare minimum where I have no custom code except to get the file path to load my lua script. So I have ruled out my application code. I also tried gcc 4.0, gcc 4.2 and Clang 1.0 in both debug and release modes, and they all have the same behavior so I think I can rule out a compiler bug. I did modify luaconf.h for 64-bit, which might be related to my problems. Since I needed to be able to hold 64-bit numbers, I changed lua_Number to long double. It's possible I forgot to change something else I'm required to change. This is my diff -u of luaconf.h. --- /Users/ewing/Downloads/lua-5.1.4/src/luaconf.h 2008-02-11 08:25:08.000000000 -0800 +++ luaconf.h 2009-10-16 12:21:04.000000000 -0700 @@ -501,9 +501,13 @@ ** =================================================================== */ +#if __LP64__ +#define LUA_NUMBER_LDOUBLE +#define LUA_NUMBER long double +#else #define LUA_NUMBER_DOUBLE #define LUA_NUMBER double - +#endif /* @@ LUAI_UACNUMBER is the result of an 'usual argument conversion' @* over a number. @@ -518,8 +522,14 @@ @@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. @@ lua_str2number converts a string to a number. */ +#ifdef LUA_NUMBER_LDOUBLE +#define LUA_NUMBER_SCAN "%Lg" +#define LUA_NUMBER_FMT "%.20Lg" +#else #define LUA_NUMBER_SCAN "%lf" #define LUA_NUMBER_FMT "%.14g" +#endif + #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) #define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ #define lua_str2number(s,p) strtod((s), (p)) I am really stumped by this crash. I would really appreciate any help/insights on this. I have uploaded my simplified reproducible crashing project to http://www.assembla.com/spaces/LuaCocoa/documents/aa1N0SUO8r3RGweJe5aVNr/download/Lua64bitcrash.tar.gz It includes the Lua source and builds it as a static library which links into my test program. I also include my backtrace below. Thanks, Eric (gdb) bt #0 0x0000000100015ccf in newkey (L=0x100110e60, t=0x10011d730, key=0x7fff5fbfe920) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ltable.c:412 #1 0x0000000100016193 in luaH_setstr (L=0x100110e60, t=0x10011d730, key=0x10011e190) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ltable.c:527 #2 0x000000010000e356 in luaX_newstring (ls=0x7fff5fbfef30, str=0x10011e041 "NSPoint.x, NSPoint.y\"ataon\"ata\"urn' value='0'> is:\"\"33", '0' , "4'> is:\"48'> is:\"", l=20) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:120 #3 0x000000010000f262 in read_string (ls=0x7fff5fbfef30, del=34, seminfo=0x7fff5fbfef50) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:327 #4 0x000000010000f855 in llex (ls=0x7fff5fbfef30, seminfo=0x7fff5fbfef50) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:391 #5 0x000000010000fbca in luaX_next (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:453 #6 0x0000000100012651 in funcargs (ls=0x7fff5fbfef30, f=0x7fff5fbfec00) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:618 #7 0x000000010001292f in primaryexp (ls=0x7fff5fbfef30, v=0x7fff5fbfec00) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:718 #8 0x0000000100013c5a in exprstat (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1228 #9 0x0000000100013f9f in statement (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1318 #10 0x0000000100013fd2 in chunk (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1330 #11 0x0000000100011db4 in luaY_parser (L=0x100110e60, z=0x7fff5fbff1e0, buff=0x7fff5fbff188, name=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:391 #12 0x000000010000b083 in f_parser (L=0x100110e60, ud=0x7fff5fbff180) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:497 #13 0x0000000100009b0b in luaD_rawrunprotected (L=0x100110e60, f=0x10000aff2 , ud=0x7fff5fbff180) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:116 #14 0x000000010000af38 in luaD_pcall (L=0x100110e60, func=0x10000aff2 , u=0x7fff5fbff180, old_top=64, ef=0) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:463 #15 0x000000010000b1cc in luaD_protectedparser (L=0x100110e60, z=0x7fff5fbff1e0, name=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:513 #16 0x000000010000360c in lua_load (L=0x100110e60, reader=0x100004f6e , data=0x7fff5fbff250, chunkname=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lapi.c:869 #17 0x00000001000052d4 in luaL_loadfile (L=0x100110e60, filename=0x100400fd0 "/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lauxlib.c:581 #18 0x00000001000013e9 in main (argc=1, argv=0x7fff5fbff6d8) at /Users/ewing/Source/HG/Lua64bitcrash/Xcode/../Test/main.m:28 (gdb) #0 0x0000000100015ccf in newkey (L=0x100110e60, t=0x10011d730, key=0x7fff5fbfe920) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ltable.c:412 #1 0x0000000100016193 in luaH_setstr (L=0x100110e60, t=0x10011d730, key=0x10011e190) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ltable.c:527 #2 0x000000010000e356 in luaX_newstring (ls=0x7fff5fbfef30, str=0x10011e041 "NSPoint.x, NSPoint.y\"ataon\"ata\"urn' value='0'> is:\"\"33", '0' , "4'> is:\"48'> is:\"", l=20) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:120 #3 0x000000010000f262 in read_string (ls=0x7fff5fbfef30, del=34, seminfo=0x7fff5fbfef50) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:327 #4 0x000000010000f855 in llex (ls=0x7fff5fbfef30, seminfo=0x7fff5fbfef50) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:391 #5 0x000000010000fbca in luaX_next (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/llex.c:453 #6 0x0000000100012651 in funcargs (ls=0x7fff5fbfef30, f=0x7fff5fbfec00) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:618 #7 0x000000010001292f in primaryexp (ls=0x7fff5fbfef30, v=0x7fff5fbfec00) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:718 #8 0x0000000100013c5a in exprstat (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1228 #9 0x0000000100013f9f in statement (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1318 #10 0x0000000100013fd2 in chunk (ls=0x7fff5fbfef30) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:1330 #11 0x0000000100011db4 in luaY_parser (L=0x100110e60, z=0x7fff5fbff1e0, buff=0x7fff5fbff188, name=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lparser.c:391 #12 0x000000010000b083 in f_parser (L=0x100110e60, ud=0x7fff5fbff180) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:497 #13 0x0000000100009b0b in luaD_rawrunprotected (L=0x100110e60, f=0x10000aff2 , ud=0x7fff5fbff180) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:116 #14 0x000000010000af38 in luaD_pcall (L=0x100110e60, func=0x10000aff2 , u=0x7fff5fbff180, old_top=64, ef=0) at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:463 #15 0x000000010000b1cc in luaD_protectedparser (L=0x100110e60, z=0x7fff5fbff1e0, name=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/ldo.c:513 #16 0x000000010000360c in lua_load (L=0x100110e60, reader=0x100004f6e , data=0x7fff5fbff250, chunkname=0x1004013a8 "@/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lapi.c:869 #17 0x00000001000052d4 in luaL_loadfile (L=0x100110e60, filename=0x100400fd0 "/Users/ewing/Source/HG/Lua64bitcrash/Xcode/build/Debug/TestApp.app/Contents/Resources/test.lua") at /Users/ewing/Source/HG/Lua64bitcrash/lua/Xcode/../src/lauxlib.c:581 #18 0x00000001000013e9 in main (argc=1, argv=0x7fff5fbff6d8) at /Users/ewing/Source/HG/Lua64bitcrash/Xcode/../Test/main.m:28 From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 18:02:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GL2mk6016838; Fri, 16 Oct 2009 18:02:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 905EB193EB; Fri, 16 Oct 2009 19:01:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CFDC193D6 for ; Fri, 16 Oct 2009 19:01:34 -0200 (BRST) Received: by fxm12 with SMTP id 12so3058356fxm.5 for ; Fri, 16 Oct 2009 14:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=GLAhC7HYxGAXuYp+RySu+55dTVqrR7379GuBL0nyEkQ=; b=Fyk2Awa8shiilcCN0kO0hmbDxdlso11JmDxwuJk/xeR28+/T2nrboAsupkc3hsEpbV D+4hCfbguj2nm68rSAbjSIaG5C1pDmlDKcwa3D3CvHdXWVNZXIa9IypvHWjxkO9W5XX9 CA434JP+XsWgSnA008+cIf3pLelPu5RXy8jrg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=aEzk3s6I3HZ3Ta4NMEX8jYSE9WV+lLcnEhJPmhnjG5Rye2NApA3gMqjlVGSlptjJhG RRHOfk/WAPy73Hk4qAd7cV0fLbHQSgRmcu53wR5P1JeRWPEcFTldVSqbA9RHThh5ugAD v9JVEBzIPamOyYu3XcYmNFk4pbrs/mDzY/58M= MIME-Version: 1.0 Received: by 10.204.11.23 with SMTP id r23mr1820229bkr.158.1255726937628; Fri, 16 Oct 2009 14:02:17 -0700 (PDT) Date: Fri, 16 Oct 2009 23:02:17 +0200 Message-ID: <4ff79edb0910161402i8b7e4b2o3336099970f89dcf@mail.gmail.com> Subject: GSL Shell release 0.6 + volunteers From: Francesco Abbate To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 Cc: gslshell@gmail.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I would like just to announce the release of GSL Shell 0.6. I've completed the new module for FFT routines and its documentation. I've also introduced the new syntax for function literals like |x, y| sin(x)*cos(y) but if you enable BUILD_LUA_DLL in makeconfig it will disabled. If you also disable complex numbers the library will work with a standard Lua binary but you will lose a lot of functionalities about complex numbers. Any suggestion is welcome. I would appreciate also if someone can test the build system on a mingw/windows system or also on other linux distributions. I currently looking for volunteers to help me to extend GSL shell. Many modules needs to be written like Special Functions, Random Numbers, Eigensystems, Simulated Annealing and many others. Thank you very much in any case. Best regards, Francesco From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 18:23:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GLNAxS019461; Fri, 16 Oct 2009 18:23:10 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88777193F1; Fri, 16 Oct 2009 19:21:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE095193EC for ; Fri, 16 Oct 2009 19:21:47 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GLMVAS019325 for ; Fri, 16 Oct 2009 18:22:31 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9GLMUN06717; Fri, 16 Oct 2009 18:22:30 -0300 Date: Fri, 16 Oct 2009 18:22:29 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 Message-ID: <20091016182229.A6709@lua.tecgraf.puc-rio.br> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com>; from ewmailing@gmail.com on Fri, Oct 16, 2009 at 01:49:06PM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I did modify luaconf.h for 64-bit, which might be related to my > problems. Since I needed to be able to hold 64-bit numbers, I changed > lua_Number to long double. It's possible I forgot to change something > else I'm required to change. This is my diff -u of luaconf.h. You did not change LUAI_USER_ALIGNMENT_T as instructed. I'm not sure the crash is related to that, though. You may want to check what Asko did in his LNUM patch. From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 18:27:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GLRiRV020240; Fri, 16 Oct 2009 18:27:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20B43193E5; Fri, 16 Oct 2009 19:26:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1210719305 for ; Fri, 16 Oct 2009 19:26:27 -0200 (BRST) Received: by pzk34 with SMTP id 34so2094823pzk.11 for ; Fri, 16 Oct 2009 14:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vktP4Le8qMclNc4gq55/vJMIc7aBes8HJ2ikJRfu21o=; b=cM7rPNAc8SwXAvPUPL50f19yhnv19141WtqQelomeyzeact6Twc9Y5CL8B8qnecsAk 4aFDYHXvL65wzD3XCQLTuMVfWz+xyOJ5t7Xmy5Cy7Jl1RCxMGYajVkuQp60Ew7SWG4q6 5SBWy8xXpCGPH/f1qTZCp2upwAxPxwu4qIDTw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AxelNLvkQeQIEiUQ9VQFPiy1bcgzsd/A4EoXoNDm7aYwE7amV19RwZudby3Y3KV+Bp nBWUoRCDe6bZ8peHLVbl3F/P7i6cAqAteFl8w96c49S1U9LH62NtwsTaDKoA/4bH0llu xK765tWoFA6DkuvIPrsFvpzx2NaJH0RtFi/Es= MIME-Version: 1.0 Received: by 10.140.203.15 with SMTP id a15mr168694rvg.183.1255728432135; Fri, 16 Oct 2009 14:27:12 -0700 (PDT) In-Reply-To: <20091016182229.A6709@lua.tecgraf.puc-rio.br> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> <20091016182229.A6709@lua.tecgraf.puc-rio.br> Date: Fri, 16 Oct 2009 14:27:12 -0700 Message-ID: <3c7e3c8a0910161427t66069535gf7b48048bc539fd3@mail.gmail.com> Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/16/09, Luiz Henrique de Figueiredo wrote: >> I did modify luaconf.h for 64-bit, which might be related to my >> problems. Since I needed to be able to hold 64-bit numbers, I changed >> lua_Number to long double. It's possible I forgot to change something >> else I'm required to change. This is my diff -u of luaconf.h. > > You did not change LUAI_USER_ALIGNMENT_T as instructed. I'm not sure > the crash is related to that, though. You may want to check what Asko > did in his LNUM patch. > What is the correct incantation for this? #define LUAI_USER_ALIGNMENT_T union { long double u; void *s; long l; } or #define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; long double v; } or something else (or does it matter). Unfortunately, I tried both of these, and the crash still persists. Thanks, Eric From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 18:35:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GLZrah021046; Fri, 16 Oct 2009 18:35:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD20719435; Fri, 16 Oct 2009 19:34:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D93B1931E for ; Fri, 16 Oct 2009 19:34:40 -0200 (BRST) Received: by pzk34 with SMTP id 34so2098708pzk.11 for ; Fri, 16 Oct 2009 14:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=i+UUuaHd+ZVHY+wYhNjsdIEBo+MpYMmRbvWIxFZ0MbU=; b=b1elW1gDydbeEFtnOe+PnxOOV6S3p1odpkZn2dN/w4unw3ajkpc7Y0cFZhbY/zDCYO 4BVUmT/GzDC70YB+FlWeC9mMjoC+rqqD7B5BZs6vSaRhfKErUp42+K2OxZyA1hFvRqLr wx8V3Yavo0tgiETaeQM+qybMoxj+foRr5g1hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gF2fpcYDhjyt7tVD/GzDFsNRb6AmI/dGpJKcY3gCo9Vwhf/kpg4A68OwVa1eFTplbV CAS6oJrA6qmggX+CBK3e0GWbQKPAAzsQnZj+MUeZi8Yfa5e5XHttBusLy5dUzqY+Nup5 zk7DBDRw7LBJTXtIo3MOIaqbOss8FI7u1cH4Q= MIME-Version: 1.0 Received: by 10.141.29.4 with SMTP id g4mr172245rvj.191.1255728924781; Fri, 16 Oct 2009 14:35:24 -0700 (PDT) In-Reply-To: <3c7e3c8a0910161427t66069535gf7b48048bc539fd3@mail.gmail.com> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> <20091016182229.A6709@lua.tecgraf.puc-rio.br> <3c7e3c8a0910161427t66069535gf7b48048bc539fd3@mail.gmail.com> Date: Fri, 16 Oct 2009 14:35:24 -0700 Message-ID: <3c7e3c8a0910161435u563db9a0seb87115de1cc1ce4@mail.gmail.com> Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I also just caught strtod and changed to: #define lua_str2number(s,p) strtold((s), (p)) But again, no effect on the crash. Thanks, Eric From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 19:14:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GME4aZ025927; Fri, 16 Oct 2009 19:14:04 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D26A192E2; Fri, 16 Oct 2009 20:12:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08CD319276 for ; Fri, 16 Oct 2009 20:12:35 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1Myv2y-0003Kk-00; Sat, 17 Oct 2009 00:13:16 +0200 Date: Sat, 17 Oct 2009 00:13:08 +0200 From: Mike Pall To: Lua list Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 Message-ID: <20091016221308.GA21968@mike.de> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean E. Wing wrote: > Since I needed to be able to hold 64-bit numbers, I changed > lua_Number to long double. Well, there's your problem ... sizeof(long double) is 12 bytes for the x86 OSX ABI, but 16 bytes for the x64 OSX ABI (due to stricter alignment rules). But the stores from the x87 FPU to a long double only write to the first 12 bytes. The remaining 4 bytes of memory on x64 still contain random garbage from a previous use. Alas, the function hashnum() in ltable.c reads sizeof(lua_Number) bytes to generate a hash for a lua_Number. I.e. on 64 bit this includes the 4 random bytes, but not on 32 bit. This means the same numeric key could hash to different values. This confuses the code in newkey(), because it tries to find a colliding key in the wrong hash chain. One solution is to avoid long double (it's pretty slow anyway) and instead use lightuserdata to store 64 bit numbers. The other solution is to modify ltable.c: hardcode the numints define to 3. [Ok, where do I send the invoice? ;-)] --Mike From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 19:28:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GMS8WU027593; Fri, 16 Oct 2009 19:28:08 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C2C7193EF; Fri, 16 Oct 2009 20:27:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5820E193C1 for ; Fri, 16 Oct 2009 20:26:51 -0200 (BRST) Received: by fxm12 with SMTP id 12so3134473fxm.5 for ; Fri, 16 Oct 2009 15:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=r/V3YA9na4WLDtcLZ+5AKQqxyXEEiX2IalEiNpqSXbg=; b=V0mdNtX16PsIqr/FRpDjx2V0ZHVRJATfHe3M2NT9rbrOLB6S3K3EQ4XNw8/64P8aw8 HCry1ZSvrhHY18FZ1DDmO2Vau17al3H3AgH7hK1VyXLDgQxz1kRskx5qXINd2sx+4/I6 OlS8kmbw3I5D57QZhfFFHKxbf1Xn+Z2fL1j9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=aKd172I8UClGEnXzCPAq7BasDMoM3jyAIqB5WMkOpztXDGE451FZZE2hwqkdgjy1ya aKLVtY9peO6Q1kWwCdaB+C9tAQ3Q0yujcfxEVBRmxEtuxFY0HAOt4iO0h0cjBkgJ+/Nu 9GRabAv/Sz37IwXDeo4PWLV17q9mHLwp9XrXo= Received: by 10.204.3.220 with SMTP id 28mr1843366bko.4.1255732055562; Fri, 16 Oct 2009 15:27:35 -0700 (PDT) Received: from ?95.78.77.145? ([95.78.77.145]) by mx.google.com with ESMTPS id f31sm2207129fkf.35.2009.10.16.15.27.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Oct 2009 15:27:34 -0700 (PDT) Date: Sat, 17 Oct 2009 02:22:17 +0400 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <910268519.20091017022217@gmail.com> To: Mike Pall Subject: Re[2]: Crash in luaL_loadfile in 64-bit x86_64 In-Reply-To: <20091016221308.GA21968@mike.de> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> <20091016221308.GA21968@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Mike, Saturday, October 17, 2009, 2:13:08 AM, you wrote: > Well, there's your problem ... sizeof(long double) is 12 bytes for > the x86 OSX ABI, but 16 bytes for the x64 OSX ABI (due to stricter > alignment rules). > But the stores from the x87 FPU to a long double only write to the > first 12 bytes. 10 bytes, i think -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 19:45:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GMjtLx029150; Fri, 16 Oct 2009 19:45:55 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7457193FB; Fri, 16 Oct 2009 20:44:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35060192E0 for ; Fri, 16 Oct 2009 20:44:26 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1MyvXn-0003Lx-00; Sat, 17 Oct 2009 00:45:07 +0200 Date: Sat, 17 Oct 2009 00:44:21 +0200 From: Mike Pall To: Lua list Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 Message-ID: <20091016224421.GA24733@mike.de> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> <20091016221308.GA21968@mike.de> <910268519.20091017022217@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <910268519.20091017022217@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin wrote: > > But the stores from the x87 FPU to a long double only write to the > > first 12 bytes. > > 10 bytes, i think Yup, you're right. Which makes this even more problematic because the hash code is prone to failure on 32 bit, too. It just happens statistically less often. Rewriting hashnum() to cope with this is left as an exercise to the reader ... --Mike #include #include int main(int argc, char **argv) { union { long double ld; unsigned char b[sizeof(long double)]; } x; int i; memset(x.b, 0xaa, sizeof(long double)); for (i = 0; i < sizeof(long double); i++) printf("%02x ", x.b[i]); printf("\n"); x.ld = (long double)argc + 0.0; /* Force a runtime calculation. */ for (i = 0; i < sizeof(long double); i++) printf("%02x ", x.b[i]); printf("\n"); return 0; } 32 bit output: aa aa aa aa aa aa aa aa aa aa aa aa 00 00 00 00 00 00 00 80 ff 3f aa aa 64 bit output: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa 00 00 00 00 00 00 00 80 ff 3f aa aa aa aa aa aa From lua-bounces@bazar2.conectiva.com.br Fri Oct 16 20:12:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9GNCQfN031821; Fri, 16 Oct 2009 20:12:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBF6A19455; Fri, 16 Oct 2009 21:11:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABBF419432 for ; Fri, 16 Oct 2009 21:10:55 -0200 (BRST) Received: by pzk34 with SMTP id 34so2142167pzk.11 for ; Fri, 16 Oct 2009 16:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=c7SZT/Gk06DcRyuLhsq/QH6bh6QHK4/juKqyudu8wAA=; b=Q/dcBmf0JtWN//gRVmRqFLE+oRcURydvebujm6dGnXFfUwV24DNbtmPjUc2P3Ty8f2 hHZ/hRRVsxlIzg5wCG0CjlSd1MR6lHJlhfaMZ/EgedoVt37X4PWdPoqXc75bpcptMxE4 K+2f5LckdfbYZyY8ju2dmZajbbUHEpBxbB30c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ICuG/zPvFKIuYIyiS+1B5GXinjHghJzUEw4NICUljxWyPnDOZFEHkyGA2KLdi02BN1 V5agwUeZHgd/xB8JYMexxuQxf/CLE/u3sYYYP5ycLveEmUitc2+WbI3HYWHgBqHhpW7N M/OG6r4CeACW7Z162G98ObXV6ppfVxvO+x7lQ= MIME-Version: 1.0 Received: by 10.140.203.15 with SMTP id a15mr227008rvg.183.1255734698987; Fri, 16 Oct 2009 16:11:38 -0700 (PDT) In-Reply-To: <20091016221308.GA21968@mike.de> References: <3c7e3c8a0910161349o6fe2250u5c0959f30754f63@mail.gmail.com> <20091016221308.GA21968@mike.de> Date: Fri, 16 Oct 2009 16:11:38 -0700 Message-ID: <3c7e3c8a0910161611g7a95c111u790c7262bcbd870c@mail.gmail.com> Subject: Re: Crash in luaL_loadfile in 64-bit x86_64 From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/16/09, Mike Pall wrote: > E. Wing wrote: >> Since I needed to be able to hold 64-bit numbers, I changed >> lua_Number to long double. > > Well, there's your problem ... sizeof(long double) is 12 bytes for > the x86 OSX ABI, but 16 bytes for the x64 OSX ABI (due to stricter > alignment rules). > > But the stores from the x87 FPU to a long double only write to the > first 12 bytes. The remaining 4 bytes of memory on x64 still > contain random garbage from a previous use. > > Alas, the function hashnum() in ltable.c reads sizeof(lua_Number) > bytes to generate a hash for a lua_Number. I.e. on 64 bit this > includes the 4 random bytes, but not on 32 bit. > > This means the same numeric key could hash to different values. > This confuses the code in newkey(), because it tries to find a > colliding key in the wrong hash chain. > > One solution is to avoid long double (it's pretty slow anyway) and > instead use lightuserdata to store 64 bit numbers. The other > solution is to modify ltable.c: hardcode the numints define to 3. > > [Ok, where do I send the invoice? ;-)] > > --Mike > Thanks Mike, Changing numints to 3 fixed the crash. I am working on a general purpose Lua/Objective-C bridge that provides access to all of Apple's frameworks via BridgeSupport. This will allow people to write Mac apps in Lua or Obj-C or a combination of both. In Cocoa, the base integer type is a typedef called NSInteger which maps to a 64-bit number when compiling in 64-bit mode. This is used everywhere in the Cocoa frameworks and I'm worried about the loss of precision with using normal doubles. Using lightuserdata doesn't seem practical for this kind of thing (at least to me). Thanks, Eric From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 00:35:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H3ZESj020436; Sat, 17 Oct 2009 00:35:15 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6542E192D9; Sat, 17 Oct 2009 01:34:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas01p.mx.bigpond.com (nskntmtas01p.mx.bigpond.com [61.9.168.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 644AB18E5E for ; Sat, 17 Oct 2009 01:33:51 -0200 (BRST) Received: from nskntotgx02p.mx.bigpond.com ([121.216.124.12]) by nskntmtas01p.mx.bigpond.com with ESMTP id <20091017033430.RXGE10503.nskntmtas01p.mx.bigpond.com@nskntotgx02p.mx.bigpond.com> for ; Sat, 17 Oct 2009 03:34:30 +0000 Received: from q66.ta.eth ([121.216.124.12]) by nskntotgx02p.mx.bigpond.com with ESMTP id <20091017033429.JJWZ6148.nskntotgx02p.mx.bigpond.com@q66.ta.eth> for ; Sat, 17 Oct 2009 03:34:29 +0000 Date: Sat, 17 Oct 2009 14:39:27 +1100 (EST) From: duck To: lua@bazar2.conectiva.com.br Subject: fd number to io object? Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150202.4AD93B46.0004,ss=1,fgs=0 X-SIH-MSG-ID: qhg7E9H9TFKtk3o4gja9QVUtlUy7/yU1v8pWRYIhuRsaTVjBuMfAQsinbaJD0e23kC4zZV6VP2YwY6/uXovbsdmgI7xRU4o= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Forgive my ignorance (can't find an answer by searching), but can I map a specific file descriptor onto an io object? Socat, a handy network utility program, lets you make bidirectional pipelines of sub-processes in which fd 0 and 1 are the input from, and output back to, the command to your left in the pipeline, and fd 3 and 4 are the input back from, and output onwards to, the command to your right in the pipeline. Fds 0 and 1 are obviously just io.stdin and io.stderr. Can the same arrangement be made to map fds 3 and 4 onto io objects? From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 01:33:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H4XkNL025100; Sat, 17 Oct 2009 01:33:46 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF2D819352; Sat, 17 Oct 2009 02:32:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69053192A4 for ; Sat, 17 Oct 2009 02:32:28 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so583210eye.39 for ; Fri, 16 Oct 2009 21:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=S9keDi4FO/T//wH87iEinSmgQ8s6C9XdtTTji4dQftU=; b=isue4b22hpWOA2eWL6LKKfwBr8vrnJ4GbKGxZUv3WwTsBigNWwtKhQgj7O5d3LkFlj UAJsEZCiHfXsYNdXUmg8bbcFvJDEHwYMDQ+n32N8L61FUmPiIeC+0wZyMb5jtXYgzE+j Ogh4PyqNo/X36yZCuUb2cihOhqyUaIrrYjIqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=J0zk9nPRfXdMyPrmzG3Vz9eC8ExlvsRoBavSZoKkiFN/2aSQWJX2DAUJ1vmv+TX5CF UTapjCXslFy+CJwUiSd/vugxfeTctWEiyou+lbkj+CDl90BivhDPLFYSJHYQjy/AZZhr 59O8RY4jtM/1YrjClWHr8NTTyW0nkJmpyIfQU= Received: by 10.211.132.28 with SMTP id j28mr2486362ebn.95.1255753993051; Fri, 16 Oct 2009 21:33:13 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.86.235]) by mx.google.com with ESMTPS id 23sm2842400eya.28.2009.10.16.21.33.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 21:33:05 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: a new domain for the LuaForge mirror From: Jacob Jay In-Reply-To: <5ba75e2f0910160837j19ca3den5ffb2245863356a5@mail.gmail.com> Date: Sat, 17 Oct 2009 10:02:55 +0530 Message-Id: <5E181A67-F39B-4F4F-AC8E-734E54576F7B@verse.org> References: <5ba75e2f0910152011p57beb6d0kf4c2e7157c524f68@mail.gmail.com> <4AD81188.40209@wp.pl> <5ba75e2f0910160837j19ca3den5ffb2245863356a5@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9H4XkNL025100 On 16 Oct 2009, at 9:07 PM, Fernando P. García wrote: > OK, mixing both solutions will work also, I mean: > > A IP SRV1 > A IP SRV2 > A IP subdomain-SRV2 As mentioned by Michal, 'DNS round-robin' records (multiple 'A' records) are entirely undesirable for providing redundancy to websites; their purpose is for load-balancing only (distributing traffic amongst multiple [hopefully identical] copies of a site), and any other use will have unpredictable results. Indeed the load balancing is random, thus if the two servers are out of sync, a visitor might see an old page and a new page randomly in the same session. (Every browser/resolver behaves differently.) Multiple A records may however be desirable for a subdomain used only by automated means (i.e. for CVS/LuaRocks downloads) as the lengthy/ broken resolution process during downtime might not be so unexpected by a user, or would be hidden from them. *But only providing both sites have live replication.* By far the best approach is to simply change the A record when and if the primary web site goes down; this can be done manually at the point of the outage --or better-- by using a DNS service provider with an automatic 'fail-over' function (where they regularly ping the server, and change the IP over if it does not respond). A low-ish TTL (time-to- live zone expiry record) is needed. The downtime for new visitors is nil after it has been updated, and for visitors immediately preceding the outage it is the TTL + a web browser's cache expiry (~15mins) or OS cache expiry (when using LuaRocks etc.). (BTW using 'SRV' as variable is slightly confusing for DNS as there is a SRV record type, which also happens to be a means of providing redundancy, albeit not for HTTP.) HTH. From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 02:28:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H5So0Q028733; Sat, 17 Oct 2009 02:28:50 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 325B219352; Sat, 17 Oct 2009 03:27:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1510F19289 for ; Sat, 17 Oct 2009 03:27:34 -0200 (BRST) Received: by pxi1 with SMTP id 1so716406pxi.33 for ; Fri, 16 Oct 2009 22:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=euhepNz1G27OfrkHqXzYTSqyL+JVFXA90aAFGZivPJ4=; b=SiS1Tp1gm761roGVCs6BaOnngE4TUToNXLxmgTo5w16SWAFway9ODqvQ3h6T3iUywq jijbVnZC7VUlnrsC4mQL+MgB6o7b9CMCJ1Bvlr/njTqk6Tsb+gVbLn6ufSncfcV7WLzi lYiHoAtkoeM5inTgMdEeQGX0coE8xk28iJQuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=let3eO0BYOUFft/eYMjg/GzmfO7i9bXU4zZiJX/u29Z3XCMy1sW5aux02QiYJauIZD ZI5aEMI0M+ijHKkMq7HPGAgWcwDEqvO4RhRF9xVCoGghSuA70vcixiWExekZtICkDbX4 sra1jQ48cfdI8LCW1obUUBSteor5CUyL3dZrE= MIME-Version: 1.0 Received: by 10.140.140.21 with SMTP id n21mr719838rvd.88.1255757299809; Fri, 16 Oct 2009 22:28:19 -0700 (PDT) In-Reply-To: <20080201180922.GA4527@mike.de> References: <20080201180922.GA4527@mike.de> Date: Sat, 17 Oct 2009 13:28:19 +0800 Message-ID: <3c7535c80910162228na4a2c6dy17c331591575b4a1@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 From: CHU Run-min To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean That's sounds great! I'm very curious about LuaJIT 2.x! Is there any beta release, or even working version to explore? From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 02:33:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H5XsPN029225; Sat, 17 Oct 2009 02:33:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEB6419377; Sat, 17 Oct 2009 03:32:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF8BD19365 for ; Sat, 17 Oct 2009 03:32:41 -0200 (BRST) Received: by fxm12 with SMTP id 12so3339139fxm.5 for ; Fri, 16 Oct 2009 22:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Vc31erCKa24PuQpNOPMaT1Y4adtZKNaTktHxmZ6G7Ho=; b=WmksDRS0LhIrKEpHSHnNuIU9S1Xx1H0sdjaP753vwE1Gq0TDHIvBVvRcvIpioA0fmS 5ETFriuxNx0epD7bIaZyifqrvQ30JdZpOAqdc8B1n4MA5OZXrSPVdYIQ7AclDMM7G9Do +DkHOHKA0EX9Z61FQC1SmRDVH0vyNpINas5cI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Kh+kuwyKc9iDmbOukkXJqXevazYsmX2ngvwzNx/uJPGpeVY59oC2t74t/waiNMLA/S RBwJfvwPUz9GoMmw8MfpzcdUtEl6K6X3TIvVUIJuB3P6PxnSzzxjtyKeST0n/hR6cmZA bVc7FmofDZn07WFbUrmlmwlOzDMPEhhkymYaM= MIME-Version: 1.0 Received: by 10.204.154.150 with SMTP id o22mr2036258bkw.154.1255757606479; Fri, 16 Oct 2009 22:33:26 -0700 (PDT) In-Reply-To: <3c7535c80910162228na4a2c6dy17c331591575b4a1@mail.gmail.com> References: <20080201180922.GA4527@mike.de> <3c7535c80910162228na4a2c6dy17c331591575b4a1@mail.gmail.com> Date: Sat, 17 Oct 2009 00:33:26 -0500 X-Google-Sender-Auth: 2d29d16aea2fb20d Message-ID: <5ba75e2f0910162233i730b7ec8g836e33e8abb90699@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf7720ee7c004761ada79 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf7720ee7c004761ada79 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 On Sat, Oct 17, 2009 at 12:28 AM, CHU Run-min wrote: > That's sounds great! I'm very curious about LuaJIT 2.x! Is there any > beta release, or even working version to explore? > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf7720ee7c004761ada79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1

On Sat, Oct 17, 2009 at 12:28 AM, CHU = Run-min <churun= min@gmail.com> wrote:
That's sounds great! I'm very curious about LuaJIT 2.x! Is there an= y
beta release, or even working version to explore?



--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf7720ee7c004761ada79-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 03:55:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H6swwd002559; Sat, 17 Oct 2009 03:54:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13753193CF; Sat, 17 Oct 2009 04:53:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A304B19373 for ; Sat, 17 Oct 2009 04:53:40 -0200 (BRST) Received: by fxm12 with SMTP id 12so3367663fxm.5 for ; Fri, 16 Oct 2009 23:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type; bh=MQKQW+Hbx85MTNuNG8sUMJzSIbeT3q0cs5L7AW/PfOE=; b=I8cXrbK3ECOQyDRgkWA5ttTAnVDnhWY0jCg2Dk2H5sfYgDB3/nT6BivQnUqcrD80EJ 7fXcH6lg3vcONwfXe+43eMK5h8MVTuLLx0SgpyPueE5eMM656VkQJ9b2cMnzc44tKiLX uCqwBoI/WcVQgU/YXGmOqH31p+Z9FsGuR4VlU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; b=f/noDtEO8o7HKu0QeM+jIAi41Ar6+ZNbYq16vPgbOfltd+SGJsTofcpJ+ZfL9znEz1 HKYJTCUKca7BG/RWUBcITXLHtr04cM4uZ25HTO0h6fpP6FknDA4q7wG1xvoKT/f7UHxU BGACU5dwOtUFCVNfnCgrOFSwo2chZnwA+LPxk= MIME-Version: 1.0 Received: by 10.204.155.92 with SMTP id r28mr2163752bkw.121.1255762464411; Fri, 16 Oct 2009 23:54:24 -0700 (PDT) Date: Sat, 17 Oct 2009 01:54:24 -0500 Message-ID: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> Subject: Support of kepler, sputnik, etc and security risks From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cf7d69d104104761bfbdc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cf7d69d104104761bfbdc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I have tried to deal with utf8 support in Lua but all I got is that Lua doe= s not cares about UTF-8. Would like to know how projects like kepler, sputnik and others deal with character encoding to prevent security attacks. Blessings! --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cf7d69d104104761bfbdc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello,

I have tried to deal with utf8 support in Lua but all I got i= s that Lua does not cares about UTF-8. Would like to know how projects like= kepler, sputnik and others deal with character encoding to prevent securit= y attacks.

Blessings!

--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Ana= lista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cu= sco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cf7d69d104104761bfbdc-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 05:48:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H8m3u0012386; Sat, 17 Oct 2009 05:48:03 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8C9D192B2; Sat, 17 Oct 2009 06:46:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05B641929E for ; Sat, 17 Oct 2009 06:46:33 -0200 (BRST) Received: by fxm12 with SMTP id 12so3415512fxm.5 for ; Sat, 17 Oct 2009 01:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=YNq4lt4lqFtSqElVuiuWLnGwmcCskTbHbG0+UdSjUKo=; b=KtBEeN3grHhfVmEMwtimrjEnbcdxKMr1S+kKT1ysZye9N50Sqq/76EsQNStTwO2TN9 p7QfTI1oVe970uVZ6qdzRDJyNDK4hwwc5fZ8ZB1jCBbHAVpxysax2q3xFPQmLvBaM9Xo dsM4f8jIduwxP5xO8AndCiyxBXiJ7VcFBAoNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bLBjk5m7scWAcx+LdhsD9lnIcQGALnXAdadsQtLRpsnTaJuPulfOp5uEmhAyXf56Lf JOol+puhACRbHLsmE7TqkPVu0dKCZ94vfDH2qY5fsRP/JApICSJnDdN0k4rDl0OeA+M5 8D3vUvzSJtbgx8plZxCroxlxAnDOW+aNXBAlU= MIME-Version: 1.0 Received: by 10.204.25.82 with SMTP id y18mr2258352bkb.137.1255769237024; Sat, 17 Oct 2009 01:47:17 -0700 (PDT) Date: Sat, 17 Oct 2009 10:47:17 +0200 Message-ID: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> Subject: Conversion Lua function to C function From: =?ISO-8859-2?Q?Ji=F8=ED_Prymus?= To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I would like to know if there is any chance to convert lua function to c function. I program a small opencv wrapper and there is one wrapping function where I need pointer to function. And that's a problem because I can get only pointer to Lua function and when I convert it to C function then it does nothing. I know that lua functions are stored in tables and that's probably why it doesn't work. In fact my problem is function gtk_signal_connect(...) where slot function is my lua function. Thanks for answer. With regards, Jiri Prymus From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 06:03:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9H93sCh013665; Sat, 17 Oct 2009 06:03:54 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F87D19393; Sat, 17 Oct 2009 07:02:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 241D91936A for ; Sat, 17 Oct 2009 07:02:37 -0200 (BRST) Received: by fxm12 with SMTP id 12so3422794fxm.5 for ; Sat, 17 Oct 2009 02:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=F8Lg+ocb10fw02wqs5eCONqk+SyY569IGJk8/xcg0FE=; b=eUaDYkyuszPR6R7RKe0wJu1O+6xT3Xpgv8XPf2v5islw9THIIOto7g2DSASyickN32 QihyHZ/nBcAT8R2Z0/xU224mAlH+cUgbx8+Vsh0GuBjJKBokIwlna9JsK1lXSZzCC+c/ ZXkX5VbMksj3nS5oQZrmZmhZgpsjNhYb9H3oQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=AC5yH9gxY6GJ9R9f9zfS/P4i/1HJdu9ekc3pT28WtHaniVpM3hmCcmuaE/dyEsNqD9 jR0wUG3OHB63agV1OJI4NP6siYyOin/RDLm6cddG6xA9PdJ6tvvzqHOroHcAt1SUQ+Zb vDWXEoCEIzNozRqUj8ysz3VCU1x9+PPOr0zkM= MIME-Version: 1.0 Received: by 10.223.22.4 with SMTP id l4mr454878fab.37.1255770201174; Sat, 17 Oct 2009 02:03:21 -0700 (PDT) In-Reply-To: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> From: Jim Whitehead II Date: Sat, 17 Oct 2009 10:03:01 +0100 Message-ID: <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> Subject: Re: Support of kepler, sputnik, etc and security risks To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9H93sCh013665 2009/10/17 Fernando P. García : > Hello, > > I have tried to deal with utf8 support in Lua but all I got is that Lua does > not cares about UTF-8. Would like to know how projects like kepler, sputnik > and others deal with character encoding to prevent security attacks. What in particular are you concerned about? As in, what's the security risk? > > Blessings! > > -- > Fernando P. García, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Perú > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de tí. > From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 08:28:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HBSIpg025966; Sat, 17 Oct 2009 08:28:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3E0619384; Sat, 17 Oct 2009 09:27:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 765BF192FD for ; Sat, 17 Oct 2009 09:27:03 -0200 (BRST) Received: by yxe36 with SMTP id 36so2798002yxe.11 for ; Sat, 17 Oct 2009 04:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=efke0QIBj7EvgFht4fGoPNFE8FGaoCbEBPdhXwuG1PI=; b=CEVkgHRgmTYSd6u5Pa+kZiOTsV0E9VqR0o4ZCdcLkKI0TlTsDLgMGixGKv7Jnj5xr/ 1HaS0Rv7lpe5m/HIN+6YX+tETPS15C12w8clJbdNDRL8EpeeR+UJQVFzcjMMKtFAx+cC utUbpHmd/6hnzDSd220T1T5pRkXy9/DO09pSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HzeuOK8dZc0vo7OJv+KHkb+uqvPyLyxVLTpPMCTS280QsHl0+XH8uXMrNqDKUImrqk kjfJMAY75KQMbEFdZf50REnXKCy44iYosWbvGvKCtaaYcLettpo0BF+bHEkhIPSnQ9SS 34B65yjs5oXd7B1NVp9wDLR5FEij62JEwew2w= MIME-Version: 1.0 Received: by 10.101.137.14 with SMTP id p14mr2832100ann.113.1255778866518; Sat, 17 Oct 2009 04:27:46 -0700 (PDT) Date: Sat, 17 Oct 2009 13:27:46 +0200 Message-ID: Subject: Multiple return values from require() From: Matthias Kluwe To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! Today I had the idea to return multiple object contruction functions from a module. Suppose I have a file "mod.lua": local function f1() -- ... end local function f2() -- ... end return f1, f2 Unfortunately, only one of them is returned by require: > lua -e 'print( require "mod" )' function: 0x95a84b0 I had the idea after seeing something similar in LuaMatrix (http://luamatrix.luaforge.net/) which returns two tables at the end of matrix.lua. These are assigned by 'local matrix, complex = require "matrix"' in test_matrix.lua, for example. Clearly, I am missing something here. Regards, Matthias From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 09:36:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HCamEr031400; Sat, 17 Oct 2009 09:36:48 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 854E8190D8; Sat, 17 Oct 2009 10:35:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB65D1908D for ; Sat, 17 Oct 2009 10:35:28 -0200 (BRST) Received: by pwj1 with SMTP id 1so380558pwj.21 for ; Sat, 17 Oct 2009 05:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rDi8GCArbxWnBQ8ALmgNMHFiaMaL4K2EFafwq1NXJPA=; b=m2Ff/P3tt9oBAjR8iV7bq+dl/Eg+b8VhxVH2grix83EmRTuOWf5+Mcqq0XeP323Enf vxlN5/1BrFHIgbPdu7jznKbm/mGqh+YMUHpMRIEn45hXwBOHbEc6BSgoLle4Ktg32Qw7 9S9hy8lkwE9KU7T5iw2yaQNyiPvO7gu3NSP1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AqB3qUgT0Yx2H1erkZRl3o2QqebIA10406ZO/1n71MAs54MkDUIeMqaUIh7i2lMUfO hVlUpFCUknN7vhfw/WXLaXW/HXAJ7YygNgN7s9dxR7YhCg/CRSNqRgdrfngVd2vDS0cL GYoaKnPcgRSQzXA6ifcgLovMA97WbXA6ILkuA= MIME-Version: 1.0 Received: by 10.141.34.20 with SMTP id m20mr1276914rvj.120.1255782972489; Sat, 17 Oct 2009 05:36:12 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 20:36:12 +0800 Message-ID: Subject: Re: Multiple return values from require() From: Linker To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1538cfd8135047620c146 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1538cfd8135047620c146 Content-Type: text/plain; charset=UTF-8 You can return a table instead of a list . On Sat, Oct 17, 2009 at 19:27, Matthias Kluwe wrote: > rtunately, only one of them is returned by require: -- Regards, Linker Lin linker.m.lin@gmail.com --000e0cd1538cfd8135047620c146 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can return a table instead of a list .

On Sat, Oct 17, 2009 at 19:27, Matthias Kluwe <mkluwe@gmail.com> wrote:
rtunately, only one of them is returned by require:

<= br clear=3D"all">
--
Regards,
Linker Lin
linker.m.lin@gmail.com
--000e0cd1538cfd8135047620c146-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 12:34:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HFYLwS014135; Sat, 17 Oct 2009 12:34:21 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AC3E192A6; Sat, 17 Oct 2009 13:33:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B78B019183 for ; Sat, 17 Oct 2009 13:32:56 -0200 (BRST) Received: by ewy26 with SMTP id 26so2939728ewy.5 for ; Sat, 17 Oct 2009 08:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:references; bh=UNM8cYaXwQlwh9SctBf0A7/MKKiWU0nuU8H0ypXausA=; b=SJ65ZKm+m+VeRu66sFFIXYpavZc1XKY3pCfqZ95y5RkuAgB1jEW+cz393AoWHY/8Ab OnQS3cXVSSxmdl3scm7ET2TUDyy5LtjxOfDTImhtYPHAdVZao4LkOUFoOonk6Mbgthop 0U25kkhPYmQ2hLYriuFz2cxBBd1119F4Vort0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date :references; b=jugnmQICguudkhXCYSX4m/Z1mSQV0fsFBTOmH88KsEl2diaO16gRqOp5xXjSjsuzjs 8HN7NKqv2lfhqBD8zInbOrxGHolsGnWWPUZt+b41RZ3ZgxTjzOj4KapZl6j704yOE8V3 NPFChvNqG9e48Zx4+fchntK4F6QjOCweHtrsg= Received: by 10.216.89.73 with SMTP id b51mr1024902wef.125.1255793619529; Sat, 17 Oct 2009 08:33:39 -0700 (PDT) Received: from ?192.168.1.109? (cable3-118.stinson.horizoncable.com [12.68.109.118]) by mx.google.com with ESMTPS id q9sm5969031gve.15.2009.10.17.08.33.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Oct 2009 08:33:38 -0700 (PDT) Message-Id: <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> From: Wesley Smith To: Lua list In-Reply-To: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes X-Mailer: iPhone Mail (7C144) Mime-Version: 1.0 (iPhone Mail 7C144) Subject: Re: Conversion Lua function to C function Date: Sat, 17 Oct 2009 08:33:28 -0700 References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HFYLwS014135 I don't completely follow, but you can store arbitrary function pointers as lightuserdata. wes On Oct 17, 2009, at 1:47 AM, Jiří Prymus wrote: > Hi, > > I would like to know if there is any chance to convert lua function to > c function. I program a small opencv wrapper and there is one wrapping > function where I need pointer to function. And that's a problem > because I can get only pointer to Lua function and when I convert it > to C function then it does nothing. I know that lua functions are > stored in tables and that's probably why it doesn't work. > > In fact my problem is function gtk_signal_connect(...) where slot > function is my lua function. > > Thanks for answer. > > With regards, > Jiri Prymus From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 12:40:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HFeH7I014709; Sat, 17 Oct 2009 12:40:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18095192C3; Sat, 17 Oct 2009 13:39:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6248E19183 for ; Sat, 17 Oct 2009 13:38:36 -0200 (BRST) Received: by iwn8 with SMTP id 8so1598716iwn.33 for ; Sat, 17 Oct 2009 08:39:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.117.215 with SMTP id s23mr2500370ibq.41.1255793961486; Sat, 17 Oct 2009 08:39:21 -0700 (PDT) In-Reply-To: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> Date: Sat, 17 Oct 2009 11:39:21 -0400 Message-ID: <790db3550910170839r2d3e5db7uf911098e9b70170@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HFeH7I014709 On Sat, Oct 17, 2009 at 4:47 AM, Jiří Prymus wrote: > Hi, > > I would like to know if there is any chance to convert lua function to > c function. I program a small opencv wrapper and there is one wrapping > function where I need pointer to function. And that's a problem > because I can get only pointer to Lua function and when I convert it > to C function then it does nothing. I know that lua functions are > stored in tables and that's probably why it  doesn't work. > > In fact my problem is function gtk_signal_connect(...) where slot > function is my lua function. If you are manually calling the C function using its pointer, your design is wrong. Learn how to use upvalues and hook functions. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 12:41:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HFfdSG014850; Sat, 17 Oct 2009 12:41:40 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B629A192D5; Sat, 17 Oct 2009 13:40:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tulikuusama.dnainternet.net (tulikuusama.dnainternet.net [83.102.40.132]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38320192C7 for ; Sat, 17 Oct 2009 13:40:27 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id 395D12C104 for ; Sat, 17 Oct 2009 18:41:11 +0300 (EEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -1.36 X-Spam-Level: X-Spam-Status: No, score=-1.36 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1.36] Received: from tulikuusama.dnainternet.net ([83.102.40.132]) by localhost (tulikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id lr0Eg8s9pHiv for ; Sat, 17 Oct 2009 18:41:11 +0300 (EEST) Received: from omenapuu.dnainternet.net (omenapuu.dnainternet.net [83.102.40.212]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id 113CC2C10B for ; Sat, 17 Oct 2009 18:41:11 +0300 (EEST) Received: from [10.0.0.3] (unknown [59.92.241.139]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by omenapuu.dnainternet.net (Postfix) with ESMTPSA id 3837B2BAE2 for ; Sat, 17 Oct 2009 18:41:10 +0300 (EEST) Message-Id: <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Conversion Lua function to C function Date: Sat, 17 Oct 2009 21:08:17 +0530 References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> X-Mailer: iPhone Mail (7D11) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HFfdSG014850 What he needs to do is store the Lua function entry as such (make a copy, forget about C pointers) in the Lua registry or a userdata's environment. This is a common need and many source codes will carry samples. Then have a C side common callback which picks up that stored ref to the Lua function and executes it. I've made a helper for all this but that code is not public. - asko On 17.10.2009, at 21.03, Wesley Smith wrote: > I don't completely follow, but you can store arbitrary function > pointers as lightuserdata. > > wes > > On Oct 17, 2009, at 1:47 AM, Jiří Prymus wro > te: > >> Hi, >> >> I would like to know if there is any chance to convert lua function >> to >> c function. I program a small opencv wrapper and there is one >> wrapping >> function where I need pointer to function. And that's a problem >> because I can get only pointer to Lua function and when I convert it >> to C function then it does nothing. I know that lua functions are >> stored in tables and that's probably why it doesn't work. >> >> In fact my problem is function gtk_signal_connect(...) where slot >> function is my lua function. >> >> Thanks for answer. >> >> With regards, >> Jiri Prymus From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 13:22:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HGMmDh019263; Sat, 17 Oct 2009 13:22:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8BE2192B3; Sat, 17 Oct 2009 14:21:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC6E31928E for ; Sat, 17 Oct 2009 14:21:24 -0200 (BRST) Received: by fxm12 with SMTP id 12so3669439fxm.5 for ; Sat, 17 Oct 2009 09:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=IWvLamCYmMOFYgIRw5lv7f1c8sKR/MROX5zGJ5o8Jl8=; b=Rf0rSqffgRq96WVmMfTzuhEbkJwBHNPao4EovCG2gET1CAJMzwUecf+PcBm0WVFv7m p3x3D/WlaVAQGnA6ClyYzCOCv7sc1OyRkf8OfdNb1BDXX7mEWLQiPZFY8QCzlLd0HxgK TIylr976D/lb0csHvRTTC7+Z+XVEc4tCuWhGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Nx8gEhIhvHJ/D8yFifeJUFfA/7IfpulsyTt+R4NUUiYSb86QpXYJneecP0Ds9QIE4l KcRxaOr2E6fQxNOL4ghU8YdS3v5dqrn/+C0iUDMeHH7i7CdQYgxJgKFfPFWtKxA4rlHD 4Y3ou/FKghLBj4XSjRk0bDnF9SCjzvAnPhjMs= MIME-Version: 1.0 Received: by 10.204.157.21 with SMTP id z21mr2730054bkw.160.1255796527866; Sat, 17 Oct 2009 09:22:07 -0700 (PDT) In-Reply-To: <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> Date: Sat, 17 Oct 2009 18:22:07 +0200 Message-ID: <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: =?ISO-8859-2?Q?Ji=F8=ED_Prymus?= To: Lua list Content-Type: text/plain; charset=ISO-8859-2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HGMmDh019263 Thanks for answers. I'm little confused from yours replies but I try to explain my problem clearly. I need to pass lua function to C++ wrapper function where it will be used as "update event" of GtkTrackBar widget. My wrapper is compiled as shared library for lua. Maybe that sample code make this problem clear. C++ wrapper function ----------------- static int luacv_cvCreateTrackbar(lua_State *L) { const char *trackbar_name=luaL_checkstring(L,1); const char *window_name=luaL_checkstring(L,2); int value=luaL_checkint(L,3); int count=luaL_checkint(L,4); CvTrackbarCallback on_change=NULL; if (lua_isfunction(L,5)) on_change=(CvTrackbarCallback)lua_tocfunction(L,5); else luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string window_name,int value,int count, void func(int pos))"); cvCreateTrackbar(trackbar_name,window_name,&value,count,on_change); return 0; } Type CvTrackbarCallback is defined like typedef void (CV_CDECL *CvTrackbarCallback)(int pos); As you can see , the "on_change" variable is pointer to c function with int as argument. Lua script may be look like this cv=require('luacv') function on_trackbar(pos) ...do some stuff here.. end cv.cvCreateTrackbar(tbarname,wndname,edge_thresh,100,on_trackbar) So I can get pointer of lua function "on_trackbar" via stack in wrapper , but when I want to convert it to c function, it doesn't work. No segmentation fault, but it does nothing. I tried functions lua_tolightuserdata, lua_touserdata, lua_tocfunction but none of them worked. Thanks for answer and sorry for my english. With regards, Jiri Prymus 2009/10/17 Asko Kauppi : > What he needs to do is store the Lua function entry as such (make a copy, > forget about C pointers) in the Lua registry or a userdata's environment. > This is a common need and many source codes will carry samples. Then have a > C side common callback which picks up that stored ref to the Lua function > and executes it. I've made a helper for all this but that code is not > public. > > - asko > > On 17.10.2009, at 21.03, Wesley Smith wrote: > >> I don't completely follow, but you can store arbitrary function pointers >> as lightuserdata. >> >> wes >> >> On Oct 17, 2009, at 1:47 AM, Jiøí Prymus wrote: >> >>> Hi, >>> >>> I would like to know if there is any chance to convert lua function to >>> c function. I program a small opencv wrapper and there is one wrapping >>> function where I need pointer to function. And that's a problem >>> because I can get only pointer to Lua function and when I convert it >>> to C function then it does nothing. I know that lua functions are >>> stored in tables and that's probably why it  doesn't work. >>> >>> In fact my problem is function gtk_signal_connect(...) where slot >>> function is my lua function. >>> >>> Thanks for answer. >>> >>> With regards, >>> Jiri Prymus > From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 13:47:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HGlmHg021268; Sat, 17 Oct 2009 13:47:53 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55E9A192C4; Sat, 17 Oct 2009 14:46:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2B1A18D31 for ; Sat, 17 Oct 2009 14:46:31 -0200 (BRST) Received: by fxm12 with SMTP id 12so3685342fxm.5 for ; Sat, 17 Oct 2009 09:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TdujChP7lly8OPSso7/rItC9REZ9GaximVaYcHwI/ME=; b=kDECWQjH6yT8MSNmDolxAGFVoE/pDOth1rIHSvwkUAIZfbn0LcGfPnS4pOaapmqofV K7OJ3VYHf4xDcQ2cE9LKnhokS8LZrJyQvphCDnR6KPH2Kg9EuSVnMLMCbZf4srQsf5nY t/wpurlZNGtiRLouUDYwvguNojkLQH0YuB4wI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cFxhaEbPvwQUcW+mM7q08bxNbeCiqyUyBunE1VUN+dW5yVnM74I/965ls8zIgKaadV JFbDNsqY+JSnhRk9+QaLQfM19Rfv4eTnZ5Pp4TqkC7INb7NXi1K7orNo64y053yXwBmz yyTMz5mAePmdxWtgX4vq4xhw3HvrVEWg0ma8I= MIME-Version: 1.0 Received: by 10.223.15.11 with SMTP id i11mr630712faa.105.1255798034979; Sat, 17 Oct 2009 09:47:14 -0700 (PDT) In-Reply-To: <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> Date: Sat, 17 Oct 2009 17:47:14 +0100 Message-ID: Subject: Re: Conversion Lua function to C function From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HGlmHg021268 2009/10/17 Jiøí Prymus : > Thanks for answers. > > I'm little confused from yours replies but I try to explain my problem clearly. > I need to pass lua function to C++ wrapper function where it will be > used as "update event" of GtkTrackBar widget. > My wrapper is compiled as shared library for lua. > > Maybe that sample code make this problem clear. > > C++ wrapper function ----------------- > > static int luacv_cvCreateTrackbar(lua_State *L) > { >  const char *trackbar_name=luaL_checkstring(L,1); >  const char *window_name=luaL_checkstring(L,2); >  int value=luaL_checkint(L,3); >  int count=luaL_checkint(L,4); >  CvTrackbarCallback on_change=NULL; > >  if (lua_isfunction(L,5)) >    on_change=(CvTrackbarCallback)lua_tocfunction(L,5); >  else >    luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string > window_name,int value,int count, void func(int pos))"); > >  cvCreateTrackbar(trackbar_name,window_name,&value,count,on_change); > >  return 0; > } > > Type CvTrackbarCallback is defined like > typedef void (CV_CDECL *CvTrackbarCallback)(int pos); > > As you can see , the "on_change" variable  is pointer to c function > with int as argument. > > Lua script may be look like this > > cv=require('luacv') > > function on_trackbar(pos) >    ...do some stuff here.. > end > > cv.cvCreateTrackbar(tbarname,wndname,edge_thresh,100,on_trackbar) > > > So I can get pointer of lua function "on_trackbar" via stack in > wrapper , but when I want to convert it to c function, it doesn't > work. You cannot get a pointer to a Lua function from C and call it directly as if it were a C function. There is no way to convert it. Instead, you must always get the Lua function onto the stack (from somewhere already inside the Lua "universe"), and call it using lua_call()/lua_pcall(). The trick is finding the right place to store it. Ideally you don't want to be doing any more than a single table lookup to get your function. For example, you could decide that the place to look for your function is a global variable with a specific name: lua_getglobal(L, "on_trackbar"); if (lua_isfunction(L,-1)) { lua_call(L,0,0); } Or, you could use the luaL_ref()/luaL_unref() system (look them up in the Reference Manual if you have not used them before) to get an integer reference to your function: // Lua function on_trackbar() is on top of the stack int on_trackbar_id = luaL_ref(L, LUA_REGISTRYINDEX); // on_trackbar() has been removed from the stack, // and stored in the registry table. on_trackbar_id now stores // a unique identifier for it. // ... later on, when we want to call on_trackbar(): luaL_unref(L, LUA_REGISTRYINDEX, on_trackbar_id); // on_trackbar() is back on top of the stack again, so we can call it: lua_call(L,0,0); There are other options as well, but it's all basically variations on the same thing. -Duncan From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 13:58:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HGwnbw022233; Sat, 17 Oct 2009 13:58:49 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81485192C0; Sat, 17 Oct 2009 14:57:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DE95192A6 for ; Sat, 17 Oct 2009 14:57:24 -0200 (BRST) Received: by yxe17 with SMTP id 17so2825109yxe.33 for ; Sat, 17 Oct 2009 09:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hCatjWKZZBnrvjpihjmOT+K8CFD0ZCyx5I+EmpsgFJc=; b=K0gcionNw6P68zobVhlD68xZllDxvO1uSMFcXfIXF6Y11O3eI8dR11DHziByhny/Cw OnOi28TFEEC9rK2Iyy1oYR6RKFQVZBKzWbbWUuEMUX5teH+xtFDcko8dhS6G4Zl70Bwl q82EwEC0F3iXuYuqVkMrppp7mskEH1Ehqfd9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=N1p5g+5J4OrQTK97QPmDocoGrPHe+YCt/HcjGD140YwTa+kiTRuGOdmgcx4sTwhm02 Y/oBX8Wa+uW4tL9fog4fAxpnisha/aILwPjgmx2WEeAavJWK1taP8odehn9RtYzDmk3t pycUXz/NVmCabDvZUOHQIwnwzlgHZ3Dr0+g9s= MIME-Version: 1.0 Received: by 10.150.15.42 with SMTP id 42mr4854997ybo.266.1255798689590; Sat, 17 Oct 2009 09:58:09 -0700 (PDT) In-Reply-To: References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> Date: Sat, 17 Oct 2009 09:58:09 -0700 Message-ID: <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've got a system that allows me to set Lua functions as callback actions from GtkMenuItems. You can find he code here: // generic interface: http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp 471: int MenuItem :: action(lua_State *L) // gtk callback system: http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp 93: void MenuBarImpl :: dispatch(MenuItem *mi) 419: void MenuItem :: implEnableAction() wes From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 14:01:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HH1sua022575; Sat, 17 Oct 2009 14:01:56 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 070AE192E2; Sat, 17 Oct 2009 15:00:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 429ED192A6 for ; Sat, 17 Oct 2009 15:00:42 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HH1Rw8022532 for ; Sat, 17 Oct 2009 14:01:27 -0300 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9HH1Qg10162; Sat, 17 Oct 2009 14:01:26 -0300 Date: Sat, 17 Oct 2009 14:01:26 -0300 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Conversion Lua function to C function Message-ID: <20091017140126.A10154@lua.tecgraf.puc-rio.br> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from duncan.cross@gmail.com on Sat, Oct 17, 2009 at 05:47:14PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > For example, you could decide that the place to look for your function > is a global variable with a specific name: > > lua_getglobal(L, "on_trackbar"); You can even use "strange" names such as "on trackbar" -- note the space. In this way you avoid clashes with names in scripts. From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 14:49:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HHnEUn026401; Sat, 17 Oct 2009 14:49:14 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB8E2192F2; Sat, 17 Oct 2009 15:47:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00A9D192E3 for ; Sat, 17 Oct 2009 15:47:49 -0200 (BRST) Received: by fxm12 with SMTP id 12so3722757fxm.5 for ; Sat, 17 Oct 2009 10:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=fgq/tdLYzYJpda5dZRTZn7cXLG3HeuW5dxjpsWLgsvA=; b=xsfgJJY15CtR8WDh7Oc8F9L04m20w5awnjZrSlu6OtNiTT0VdaDxVzsvz6RKvXNQst X4A6rXmQAQJERZ26Y/nquiFweewF17eXsAW72JTkkIL5Nkz4a1QFhDznA6fefLHausol lthNHaJ/dMueWxtDGyAhMWB2Oao7lAuMWl0KI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=HjpmBAHPQBgb4Vz0JmhA7vFUr0QM//OmQmw7qk5ppZfRxAgdTRF9Oktqj07yNPP3W9 IycvbR9t1sJEA4TtKFZSaD9fZjVT11Zn7wEKz7ARxJoMrdFZ7xEuVZsSOSZHxfcXvcax g8c5RKVBs5XlBgDeOj4QIoI/NSxl9CmBnT7/4= MIME-Version: 1.0 Received: by 10.204.26.206 with SMTP id f14mr2772931bkc.95.1255801713206; Sat, 17 Oct 2009 10:48:33 -0700 (PDT) From: Hisham Date: Sat, 17 Oct 2009 14:48:13 -0300 Message-ID: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> Subject: [ANN] LuaRocks 2.0 To: Lua list , LuaRocks developers list , Kepler Project mailing list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I'm happy to announce LuaRocks 2.0: http://luarocks.org/releases/luarocks-2.0.tar.gz This is the Unix tarball. The Windows package will follow later. What's new: * module files are now deployed to standard Lua-style paths: $PREFIX/lib/lua/5.1 and $PREFIX/share/lua/5.1. This means that vanilla builds of Lua and LuaRocks are now compatible with each other out-of-the-box (installing into /usr/local). This means require("luarocks.require") is no longer necessary to load modules installed using LuaRocks. Support for multiple repositories and multiple versions in a repository is still retained (for the latter, the new require("luarocks.loader") is needed -- luarocks.require works as a compatibility alias). * this should be transparent in regular use but it's important nonetheless -- new abstraction system for fs operations: the OS-specific backends for luarocks.fs were split between native-Lua and tool-based implementations. LuaRocks can now use libraries such as luafilesystem and luacurl to perform operations, as well as David Manura's native-Lua implementation of 'patch'. This is still an ongoing work but the long-term plan is to essentially remove dependency on third party tools (with probable exceptions being things like cvs when using development rocks). I'd like to have LuaRocks 2.0 ship with no dependencies on command-line tools in its usual operation (which is desired for things such as Lua for Windows) but getting the new module handling scheme out was a higher priority. * Local manifest and repositories are not compatible and need to be rebuilt (sorry), but remote manifest, the rockspec and rock formats remain compatible. That means the current LuaRocks repository works with LR1 and LR2. * new command for luarocks: "download", to fetch .rock and .rockspec files. * new commands for luarocks-admin: "add", to upload rocks to a repository, and "refresh_cache", to refresh the cache used by the "add" command. These are not very useful for most users, but make managing remote repositories much, much easier. * plus a number of cleanups and bugfixes. Thanks to everyone involved in the making of this release, which has been in the works for over one year. You know who you are and you all rock! Any feedback is welcome. Thanks for your patience, -- Hisham From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 15:02:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HI26G3027879; Sat, 17 Oct 2009 15:02:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACD22192C6; Sat, 17 Oct 2009 16:01:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E76C918A58 for ; Sat, 17 Oct 2009 16:00:51 -0200 (BRST) Received: by gxk8 with SMTP id 8so3391981gxk.1 for ; Sat, 17 Oct 2009 11:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xFqPXBaaEoWaEmK0DMUVPwdKOiykidH/P89HqYxKD6k=; b=nwy3mCu+qju9wcmvwzw6U0BNI2tVHL+fyVukij1TFY6hBsgE+hPbAFZ+1H0W+R/3At 3apGU7IopSMau8NdZoX/GrcrT5CsgxDigG9rrLDcU8MMF9CXgs+x7mUIHcjCT6o0Lh0D CIjdg4SjOHkYOEVdSdHCzDR10hdkLohIu4lNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qBYSbEHImLyxJQzphe2g9aV9PnbswsGZYHeOQ8f5GXfCjk0B0PkdSAsv+8rUUvtb+h Z1FaX+J/BX8wf+esm5Vd+HTEiftEqy6DpJ5kwz9XjpiziNg1sQvqIN9NQajRtQjKNV1o Zh0T2l8th3F9VSqFWCzmt7zEJ6Y0CbUZobXAY= MIME-Version: 1.0 Received: by 10.101.186.17 with SMTP id n17mr202560anp.29.1255802497137; Sat, 17 Oct 2009 11:01:37 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 20:01:37 +0200 Message-ID: Subject: Re: Multiple return values from require() From: Matthias Kluwe To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! 2009/10/17 Linker : > You can return a table instead of a list . Well, I know ... I can return _one_ table, but matrix.lua does return two of them, and there has to be a trick (well, not a trick obviously, but I can't find it in the reference manual). > On Sat, Oct 17, 2009 at 19:27, Matthias Kluwe wrote: >> >> rtunately, only one of them is returned by require: Regards, Matthias From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 15:07:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HI7i55028484; Sat, 17 Oct 2009 15:07:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6829D19305; Sat, 17 Oct 2009 16:06:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 048FD18CE2 for ; Sat, 17 Oct 2009 16:06:32 -0200 (BRST) Received: by fxm12 with SMTP id 12so3733859fxm.5 for ; Sat, 17 Oct 2009 11:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vaiCyIFf7cE9ubPMSBtjZtOUTRAXO0VkLbYDasiLUXk=; b=ShUeWfhNLNbxRf5Maha8D7EjU+QLtzIGnDvrgOCZKY+JG5eKfRXHaJ/dDxhqs7yAFy cjI7r2nYBjTzEukiNZBXusbREzLcmr8cDnhI0qtxKfWQsAJF+z2CwtAoq/CjgxQ78Aan 0TXvgKE37JPYpAP7dFSikMfsIIMLlikfYhRZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eA1OuErLKOxhQlKAQ/9QHloKqT+G+T1o3qYTBW5cBj6sNGzOzkjL1WlHB/bWyQmQcn ZIhMC/beI1yMmLRVToIztVOQc5aEp2uH/X01SQcWZJykSuYfyW70ORGVPrui7FGR/5DY ki0dBWb77TBU9pQD1TFJkchfoAO3fPjxeQhI4= MIME-Version: 1.0 Received: by 10.223.4.220 with SMTP id 28mr595866fas.18.1255802836218; Sat, 17 Oct 2009 11:07:16 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 19:07:16 +0100 Message-ID: Subject: Re: Multiple return values from require() From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 17, 2009 at 7:01 PM, Matthias Kluwe wrote: > Hi! > > 2009/10/17 Linker : >> You can return a table instead of a list . > > Well, I know ... I can return _one_ table, but matrix.lua does return > two of them, and there has to be a trick (well, not a trick obviously, > but I can't find it in the reference manual). > >> On Sat, Oct 17, 2009 at 19:27, Matthias Kluwe wrote: >>> >>> rtunately, only one of them is returned by require: > > Regards, > Matthias > I believe when you require() a module, the single first return value is what gets stored in the package.loaded table, so the next time require gets called for the same module you will only ever get that one value back anyway. You would need to write your own variant of require() to store the results in a table and unpack them etc. for what you are talking about to properly work. (Disclaimer, I haven't actually tried this matrix script, this is just from what I understand.) -Duncan From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 15:11:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HIAw79028819; Sat, 17 Oct 2009 15:10:58 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF48319342; Sat, 17 Oct 2009 16:09:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45D2219323 for ; Sat, 17 Oct 2009 16:09:47 -0200 (BRST) Received: by ewy26 with SMTP id 26so3023868ewy.5 for ; Sat, 17 Oct 2009 11:10:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.7 with SMTP id d7mr1061079wef.81.1255803031705; Sat, 17 Oct 2009 11:10:31 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 19:10:31 +0100 X-Google-Sender-Auth: 2ef9861959289865 Message-ID: Subject: Re: Multiple return values from require() From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 17, 2009 at 7:01 PM, Matthias Kluwe wrote: > Hi! > > 2009/10/17 Linker : >> You can return a table instead of a list . > > Well, I know ... I can return _one_ table, but matrix.lua does return > two of them, and there has to be a trick (well, not a trick obviously, > but I can't find it in the reference manual). Look at http://www.lua.org/source/5.1/loadlib.c.html#ll_require - you will notice that all execution paths terminate with an error or "return 1;", hence require() can only return a single value. From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 16:40:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HJeIpQ004109; Sat, 17 Oct 2009 16:40:18 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9172192AE; Sat, 17 Oct 2009 17:39:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6736A19180 for ; Sat, 17 Oct 2009 17:38:56 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MzF7q-0005DZ-PE for lua@bazar2.conectiva.com.br; Sat, 17 Oct 2009 20:39:38 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id A349515242 for ; Sat, 17 Oct 2009 20:39:35 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:39986 with envelope Message-ID: <4ADA2B78.2080001@cowlark.com> Date: Sat, 17 Oct 2009 21:39:20 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Support of kepler, sputnik, etc and security risks References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> In-Reply-To: <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HJeIpQ004109 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Whitehead II wrote: [...] > What in particular are you concerned about? As in, what's the security risk? Unicode has quite a lot of similar-looking characters that make spoofing very easy. For example: www.google.com www.ð—€ð—ˆð—ˆð—€ð—…ð–¾.com ...are actually *different*. (I'm assuming your mail readers are rendering it properly!) There isn't really a good solution to this --- it's one of the reasons why Unicode domain names have never really taken off. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK2it2f9E0noFvlzgRAuM3AKDTTeklkblARbEGln4SJhVxTpq+owCeNsYW i8JgxGzSLyqSLIy5QpiwOAI= =3xjG -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 16:52:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HJqi95005187; Sat, 17 Oct 2009 16:52:44 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E35E19309; Sat, 17 Oct 2009 17:51:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout018.mac.com (asmtpout018.mac.com [17.148.16.93]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94742192EE for ; Sat, 17 Oct 2009 17:51:28 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp018.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRO00B03CI4ZF80@asmtp018.mac.com> for lua@bazar2.conectiva.com.br; Sat, 17 Oct 2009 12:52:12 -0700 (PDT) Message-id: <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> From: Petite Abeille To: Lua list In-reply-to: <4ADA2B78.2080001@cowlark.com> Subject: Re: Support of kepler, sputnik, etc and security risks Date: Sat, 17 Oct 2009 21:51:39 +0200 References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 17, 2009, at 10:39 PM, David Given wrote: > There isn't really a good solution to this --- it's one of the reasons > why Unicode domain names have never really taken off. Hmmm... this is not really related to "kepler, sputnik, etc", isn't it? From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 16:56:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HJuiqF005506; Sat, 17 Oct 2009 16:56:45 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3775E1926F; Sat, 17 Oct 2009 17:55:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4330418C6A for ; Sat, 17 Oct 2009 17:55:29 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRO00JDJCOUJW60@asmtp015.mac.com> for lua@bazar2.conectiva.com.br; Sat, 17 Oct 2009 12:56:14 -0700 (PDT) Message-id: <95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: Re[2]: Kepler cleanup Date: Sat, 17 Oct 2009 21:55:41 +0200 References: <1536876966.20091016124402@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 16, 2009, at 1:51 PM, Cosmin Apreutesei wrote: > no need - what could a spammer do with a captcha + delayed indexing? > this > spam thing is a lame excuse IMHO Captcha are not very user friendly as they tend to get in the way. Alternatively: "Stopping spambots with hashes and honeypots" http://nedbatchelder.com/text/stopbots.html A relevant joke: Jim and Joe are out hiking in the forest, when in the distance, they see a huge bear. The bear notices them, and begins angrily running toward them. Jim calmly checks the knots of his shoes and stretches his legs. Joe asks incredulously, "What are you doing? Do you think you can outrun that bear!?" Jim replies, "I don't have to outrun the bear, I just have to outrun you." From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 17:03:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HK31K2006183; Sat, 17 Oct 2009 17:03:01 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CD811928D; Sat, 17 Oct 2009 18:01:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E33E18C6A for ; Sat, 17 Oct 2009 18:01:44 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 0A7013806A63E for ; Sun, 18 Oct 2009 03:02:28 +0700 (NOVST) Message-ID: <003a01ca4f64$be16ce50$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com><4D9B8D09-9691-430A-9810-618687340A73@gmail.com><3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 03:02:20 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-2"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 18 Oct 2009 03:02:28 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br The problem is in poorly designed callback. A good callback should at least pass object pointer to callback function, or user data associated with it in the best case. In that cases there wouldn't be any problems. This problem is similar to passing a pointer to object method as callback. The only way I see is to use a platform-dependant hack. For 32 bit Windows I can tell you how to do it. It should be easy to tweak it to use it on 32 bit Linux. ----- Original Message ----- From: Jiøí Prymus To: Lua list Sent: Saturday, October 17, 2009 11:22 PM Subject: Re: Conversion Lua function to C function Thanks for answers. I'm little confused from yours replies but I try to explain my problem clearly. I need to pass lua function to C++ wrapper function where it will be used as "update event" of GtkTrackBar widget. My wrapper is compiled as shared library for lua. Maybe that sample code make this problem clear. C++ wrapper function ----------------- static int luacv_cvCreateTrackbar(lua_State *L) { const char *trackbar_name=luaL_checkstring(L,1); const char *window_name=luaL_checkstring(L,2); int value=luaL_checkint(L,3); int count=luaL_checkint(L,4); CvTrackbarCallback on_change=NULL; if (lua_isfunction(L,5)) on_change=(CvTrackbarCallback)lua_tocfunction(L,5); else luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string window_name,int value,int count, void func(int pos))"); cvCreateTrackbar(trackbar_name,window_name,&value,count,on_change); return 0; } Type CvTrackbarCallback is defined like typedef void (CV_CDECL *CvTrackbarCallback)(int pos); As you can see , the "on_change" variable is pointer to c function with int as argument. Lua script may be look like this cv=require('luacv') function on_trackbar(pos) ...do some stuff here.. end cv.cvCreateTrackbar(tbarname,wndname,edge_thresh,100,on_trackbar) So I can get pointer of lua function "on_trackbar" via stack in wrapper , but when I want to convert it to c function, it doesn't work. No segmentation fault, but it does nothing. I tried functions lua_tolightuserdata, lua_touserdata, lua_tocfunction but none of them worked. Thanks for answer and sorry for my english. With regards, Jiri Prymus 2009/10/17 Asko Kauppi : > What he needs to do is store the Lua function entry as such (make a copy, > forget about C pointers) in the Lua registry or a userdata's environment. > This is a common need and many source codes will carry samples. Then have > a > C side common callback which picks up that stored ref to the Lua function > and executes it. I've made a helper for all this but that code is not > public. > > - asko > > On 17.10.2009, at 21.03, Wesley Smith wrote: > >> I don't completely follow, but you can store arbitrary function pointers >> as lightuserdata. >> >> wes >> >> On Oct 17, 2009, at 1:47 AM, Jiøí Prymus wrote: >> >>> Hi, >>> >>> I would like to know if there is any chance to convert lua function to >>> c function. I program a small opencv wrapper and there is one wrapping >>> function where I need pointer to function. And that's a problem >>> because I can get only pointer to Lua function and when I convert it >>> to C function then it does nothing. I know that lua functions are >>> stored in tables and that's probably why it doesn't work. >>> >>> In fact my problem is function gtk_signal_connect(...) where slot >>> function is my lua function. >>> >>> Thanks for answer. >>> >>> With regards, >>> Jiri Prymus > From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 17:14:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HKEQh9007396; Sat, 17 Oct 2009 17:14:26 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27E2119289; Sat, 17 Oct 2009 18:13:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00D3519198 for ; Sat, 17 Oct 2009 18:13:11 -0200 (BRST) Received: by gxk8 with SMTP id 8so3473791gxk.1 for ; Sat, 17 Oct 2009 13:13:56 -0700 (PDT) Received: by 10.151.5.1 with SMTP id h1mr5211125ybi.27.1255810436479; Sat, 17 Oct 2009 13:13:56 -0700 (PDT) Received: from two ([71.21.67.37]) by mx.google.com with ESMTPS id 14sm96018gxk.2.2009.10.17.13.13.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Oct 2009 13:13:55 -0700 (PDT) Date: Sat, 17 Oct 2009 15:13:51 -0500 From: phoenix To: Lua list Subject: newproxy() Message-ID: <20091017151351.45185790@two> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there any tangible notion of what is to become of newproxy() ? I found it useful today, to add some implicit finalization to objects implemented with tables. (After feeling surprised that '__gc' is for userdata only.) Thanks. Rock on, Lua developers. From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 17:19:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HKJc8I007839; Sat, 17 Oct 2009 17:19:38 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45E0E192EE; Sat, 17 Oct 2009 18:18:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43EE5191D9 for ; Sat, 17 Oct 2009 18:18:28 -0200 (BRST) Received: by ewy26 with SMTP id 26so3085591ewy.5 for ; Sat, 17 Oct 2009 13:19:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.88.8 with SMTP id z8mr1089910wee.109.1255810752763; Sat, 17 Oct 2009 13:19:12 -0700 (PDT) In-Reply-To: <003a01ca4f64$be16ce50$6600a8c0@sat3> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <003a01ca4f64$be16ce50$6600a8c0@sat3> Date: Sat, 17 Oct 2009 21:19:12 +0100 X-Google-Sender-Auth: 5f809c77746a1885 Message-ID: Subject: Re: Conversion Lua function to C function From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If you're thinking what I think you are, then it would be an operating system dependant, and processor architecture (or at least CPU bytecode) dependant. Note that some 32 versions of Windows (around NT4?) could run on non-x86 architectures. Linux can do the same. 2009/10/17 GrayFace : > The only way see is to use a platform-dependant hack. For 32 bit Windows I can tell you > how to do it. It should be easy to tweak it to use it on 32 bit Linux. From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 17:39:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HKdG7n009315; Sat, 17 Oct 2009 17:39:16 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0752E192F2; Sat, 17 Oct 2009 18:38:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EC4919271 for ; Sat, 17 Oct 2009 18:38:02 -0200 (BRST) Received: by pxi1 with SMTP id 1so297743pxi.33 for ; Sat, 17 Oct 2009 13:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XKSG0GWa0wvJbEFqXBEgnA0Otj11fo0RIcukTyxxjEc=; b=NzAYLsByk5TillKkEICUQp84/xK4WBwq7mq5yOyzJI74iHaT7b9cr8AJQ9LwqMuxde PEwj4taQF7ZeiT6N/M4RaapuCGKnJXtOwZ6ItoMX5l31ciyoltlUevvzuszqdVG0FnOw mnn1xm5pePL7SA+rCxnudYoJmtvH22QR30DiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ixNuPJeiAyb0GxMVwvphc4SlNU5yeEE43SDRNDx8uekhZKKEMgThyCcZRBTx8sF1jK Cted6pEFDYKVDdWTxF1hVKO65P+2xUPDOcVzeZZ1CT0upoo4/vwuZ3Wi3jcE+O8dre2w yDDxRbWC5lYUsDdRRrjjDKEZ3GBhT7POdDDpc= MIME-Version: 1.0 Received: by 10.142.202.21 with SMTP id z21mr174490wff.235.1255811926273; Sat, 17 Oct 2009 13:38:46 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 13:38:46 -0700 Message-ID: <17eac67c0910171338j7814aac6wb0ca57bc66c53d75@mail.gmail.com> Subject: Re: fd number to io object? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 16, 2009 at 8:39 PM, duck wrote: > Forgive my ignorance (can't find an answer by searching), but can I map a http://www.lua.org/manual/5.1/manual.html#5.7 > specific file descriptor onto an io object? No, not without writing a C extension, which is easy, you'd write a variant of io_open() from: http://www.lua.org/source/5.1/liolib.c.html that calls fdopen() instead of fopen() Sam From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 17:43:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HKhUFc009642; Sat, 17 Oct 2009 17:43:30 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A166219331; Sat, 17 Oct 2009 18:42:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8321E19271 for ; Sat, 17 Oct 2009 18:42:16 -0200 (BRST) Received: by fxm12 with SMTP id 12so3818595fxm.5 for ; Sat, 17 Oct 2009 13:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=055PPN4BNGO18zsaiOpHDzXYfzvt1L+beGlZ4oMzOpo=; b=CYRI1L4K3Nxesnuq3mSqRH5dmyIaxSM8KA5DToI3luRP30qWNRG7LhwuSmCZH1yCjI n0XQXSkV5OVYNSPbldQIljWfPeqorJOP4ixea3fg3MGvI/c3wP8FiiIPh+bMEWsxYAKB O6WCcJJGPR1NW9Zmm3AxGBEfN/FdnkFaQx/28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=s2vcI4+DUYC3aO7eH0x4ChiqapxfiNIiD7Wjr2a3OlnSHsSj4VIvbyjdd3QhwxTtXU 0EWSMWtjYcdtmzZLT5yOjwfZAEfMHNVDsrjSj7n7rYMbnqHqCDdM/kiLF2rOd/D4oKbt Hg/VjOgIp1ZXm+IQcXJQ/9g9eh/5LMmbjgjj4= MIME-Version: 1.0 Received: by 10.204.160.73 with SMTP id m9mr2805283bkx.214.1255812179672; Sat, 17 Oct 2009 13:42:59 -0700 (PDT) In-Reply-To: <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> Date: Sat, 17 Oct 2009 22:42:59 +0200 Message-ID: <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: =?ISO-8859-2?Q?Ji=F8=ED_Prymus?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9HKhUFc009642 So if I understand that, I can't wrapper cvCreateTrackBar function without re-implementing it in my wrapper, because i'm not able to get proper Callback function pointer from lua and pass it to opencv library as a C function pointer. But it leads to the bypassing original library function and that isn't too great. And using hacks isn't proper for me, because it's part of my Bachelor thesis and I want clear code. Thanks for help. With regards, Jiri Prymus 2009/10/17 Wesley Smith : > I've got a system that allows me to set Lua functions as callback > actions from GtkMenuItems.  You can find he code here: > > // generic interface: > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp > 471: int MenuItem :: action(lua_State *L) > > > // gtk callback system: > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp > 93: void MenuBarImpl :: dispatch(MenuItem *mi) > 419: void MenuItem :: implEnableAction() > > > wes > From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 18:19:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HLJFlb013110; Sat, 17 Oct 2009 18:19:17 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BFD0191EE; Sat, 17 Oct 2009 19:18:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44B4A190DD for ; Sat, 17 Oct 2009 19:17:59 -0200 (BRST) Received: by fxm12 with SMTP id 12so3836924fxm.5 for ; Sat, 17 Oct 2009 14:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=W2CPv+WgiYVBRdefeZtWRhd9VRv17DA6n7MJsEFAers=; b=UekUQ7G1iybvipzDQKkGFnEj0rHb19gBcxvvU8NaqXXMd9vkp2MoVocwOYVPi3PLUi FMwFRru1lDGDLLfrtQH5JMewXf6olFJd26h+3vztbcK9zKoazVgqQz+UjPe9s/qKdQ1a QH9eSfQnfgH1GC8t/+LAMV2IZk4hdZIMyn8Ps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=rKshGxv+cHINMVvM5Ar8DcLtOrYrYL3NrmlCoGvWquESqZF0YL1jHluQU24LLetEVZ 0YiIgwmPqsvSQTtkACoLdzskDcYjvk2PtS3OSVcDMDmU555re74g1HGVXwtA8yaRj1kZ Sy3A+0jkmEDvP3tnY+OSh+cuq+JRcZnM/narE= MIME-Version: 1.0 Received: by 10.204.34.65 with SMTP id k1mr2911647bkd.111.1255814322560; Sat, 17 Oct 2009 14:18:42 -0700 (PDT) In-Reply-To: <95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> References: <1536876966.20091016124402@gmail.com> <95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> Date: Sat, 17 Oct 2009 17:18:42 -0400 X-Google-Sender-Auth: ad1a7eeae502e10c Message-ID: Subject: Re: Re[2]: Kepler cleanup From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > "Stopping spambots with hashes and honeypots" > http://nedbatchelder.com/text/stopbots.html I implemented this approach in Sputnik in late 2007 and it did cut down the amount of spam dramatically. But it didn't stop all of it. My guess is that people were coming to our sites to setup playback attacks and would post crap to see if they could do it. They would fail and eventually give up, but in the process of trying to set it up they ended up vandalizing a few pages, which then needed to be fixed. Then a week later someone else would come and try to do the same. It never turned into a massive flood of spam (as it did before hashes and honeypots) but it assured the need to do regular maintenance. By contrast, adding captcha stopped all spam. When spammers see captcha, they know to not waste their time (and yours!) trying to figure out how to spam your site. - yuri From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 18:51:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HLpVrw015344; Sat, 17 Oct 2009 18:51:31 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 355421921E; Sat, 17 Oct 2009 19:50:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B255E18489 for ; Sat, 17 Oct 2009 19:50:15 -0200 (BRST) Received: by ywh40 with SMTP id 40so1568008ywh.33 for ; Sat, 17 Oct 2009 14:51:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.61.31 with SMTP id j31mr2933004aga.3.1255816261168; Sat, 17 Oct 2009 14:51:01 -0700 (PDT) In-Reply-To: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> References: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> Date: Sun, 18 Oct 2009 00:51:01 +0300 X-Google-Sender-Auth: 2cfbbe4d99eec309 Message-ID: Subject: Re: [ANN] LuaRocks 2.0 From: Cosmin Apreutesei To: Lua list Content-Type: multipart/alternative; boundary=0016361e7b802670b50476288202 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016361e7b802670b50476288202 Content-Type: text/plain; charset=UTF-8 > > Any feedback is welcome. Thanks for your patience, Installing to Lua standard paths is really neat. Kudos! My little wish: mercurial support -- I have projects on google code and I wish to make cvs rockspecs that download the sources directly from the mercurial repo. --0016361e7b802670b50476288202 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Any feedback is = welcome. Thanks for your patience,

Installi= ng to Lua standard paths is really neat. Kudos! My little wish: mercurial s= upport -- I have projects on google code and I wish to make cvs rockspecs t= hat download the sources directly from the mercurial repo.

--0016361e7b802670b50476288202-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 18:55:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HLtpw0015606; Sat, 17 Oct 2009 18:55:51 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 005CE192C0; Sat, 17 Oct 2009 19:54:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sirppi.helsinki.fi (sirppi.helsinki.fi [128.214.205.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C98AB18D78 for ; Sat, 17 Oct 2009 19:54:38 -0200 (BRST) Received: from sirppi.helsinki.fi (localhost [127.0.0.1]) by sirppi.helsinki.fi (8.13.7/8.13.7) with ESMTP id n9HLtM2a139660 for ; Sun, 18 Oct 2009 00:55:22 +0300 (EEST) Received: (from jpihlaja@localhost) by sirppi.helsinki.fi (8.13.7/8.13.7/Submit) id n9HLtMN2141239; Sun, 18 Oct 2009 00:55:22 +0300 (EEST) Date: Sun, 18 Oct 2009 00:55:21 +0300 (EEST) From: M Joonas Pihlaja To: Lua list Subject: Re: fd number to io object? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 17 Oct 2009, duck wrote: > Forgive my ignorance (can't find an answer by searching), but can I map a > specific file descriptor onto an io object? Here's a small library that lets you do that: http://sage.discontinuity.info/cgi-bin/gitweb/gitweb.cgi?p=thin.git;a=blob_plain;f=lfdopen.c Cheers, Joonas From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 19:01:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HM16qG016161; Sat, 17 Oct 2009 19:01:06 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0110A192F2; Sat, 17 Oct 2009 20:00:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC6C81926C for ; Sat, 17 Oct 2009 19:59:50 -0200 (BRST) Received: by fxm12 with SMTP id 12so3857353fxm.5 for ; Sat, 17 Oct 2009 15:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=ETkoYwNXaE1q1dd4R2gGtPLwlbST86LFfw9yo+kiCa8=; b=Pk1LE4Jthm5vFWGCoF7B6VkDqcF2JYcSSkgjzMPDBS3uRzQhIcSHrqV7lJ9c6ES+ax pjEitkCgdF8b4CGX1n6VIfj4Z+BdU5LlE1kZVm6cafIXdXw/76aGySU1m3AGFjHmTJqQ vns15g4zxKqgERRJf2A9xhkPbWR6yqTtm+HR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=TNUu6MzPwv/r5oI6LPidAceIXDV16dFABu5otW3kXFzR51UxFIDbwB9nNy4H5VRErJ 8NzlISqGd0lFntjynhYjW3AZVQnqD86oSjbUelSUwXVzKjTAXsl00pG96I7BQAiN+X9q AZy/ar8ei+0aWjFru46reS1rbZBgk6IAhPwyY= Received: by 10.103.86.23 with SMTP id o23mr1310263mul.116.1255816834978; Sat, 17 Oct 2009 15:00:34 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id j10sm3520374mue.6.2009.10.17.15.00.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Oct 2009 15:00:34 -0700 (PDT) Message-Id: <26268919-A26A-4A86-990D-D2E345D9FCD4@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Re[2]: Kepler cleanup Date: Sun, 18 Oct 2009 00:00:02 +0200 References: <1536876966.20091016124402@gmail.com> <95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 17, 2009, at 11:18 PM, Yuri Takhteyev wrote: > By contrast, adding captcha stopped all spam. When spammers see > captcha, they know to not waste their time (and yours!) trying to > figure out how to spam your site. Perhaps the same is true of would-be users... I personally much prefer Ned's, hmm, humanistic approach to the problem: "Rather than stopping bots by having people identify themselves, we can stop the bots by making it difficult for them to make a successful post, or by having them inadvertently identify themselves as bots. This removes the burden from people, and leaves the comment form free of visible anti-spam measures." From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 19:19:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HMJ7Qd017486; Sat, 17 Oct 2009 19:19:07 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 001DE192FB; Sat, 17 Oct 2009 20:18:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C94B019271 for ; Sat, 17 Oct 2009 20:17:54 -0200 (BRST) Received: by fxm12 with SMTP id 12so3865764fxm.5 for ; Sat, 17 Oct 2009 15:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=EIAyzjM1EzMfV4+2hlwdCp8pH6i02IVYHlB/37b/DZo=; b=ZX+HOslmaJbo3nSIwWXzs0Va1GzJF4Zi9yDZE/6TwCqc4DLrbOvexFbhztlVTcBIwJ f0VUBzaOXE2Yueew9qRXwaNg8/CQLO/1t23P6+LgwkOLRBCcZ3z6JluItNFPzAvjR8kv p6lYQjscSdo8DT1WRVz9G+JWmgdzKoI2SL19w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=r6f7vldy17fBAv+7HRErrxc2D8f9n4mWFIp3L15mCejiMuJdUb04IdDR+pzTPs6snd ALMODam8dS9YSJovMrM4fz+80DHqQS8e+6oQkKupmCRPaLqIeM20d8VCwLQHlmHFLUe1 7k24pL/E12kOVCzu6hIC23cCsSJa6IJwt8iV8= MIME-Version: 1.0 Received: by 10.204.34.78 with SMTP id k14mr3050297bkd.106.1255817919076; Sat, 17 Oct 2009 15:18:39 -0700 (PDT) Date: Sun, 18 Oct 2009 06:18:39 +0800 Message-ID: Subject: recommended reading order for the lua source code From: Shenyang Zhao To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I'm interested in reading the whole lua source codes. I think many things can be learned like the implementation of an efficiency virtual machine. Can someone recommend an order of reading all the source codes? Thanks regards, Zhao Shenyang From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 19:34:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9HMXcIX018661; Sat, 17 Oct 2009 19:34:23 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3222F19330; Sat, 17 Oct 2009 20:32:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D24C9192CB for ; Sat, 17 Oct 2009 20:32:21 -0200 (BRST) Received: by iwn8 with SMTP id 8so1698664iwn.33 for ; Sat, 17 Oct 2009 15:33:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.122.208 with SMTP id m16mr4248201ibr.16.1255818786380; Sat, 17 Oct 2009 15:33:06 -0700 (PDT) In-Reply-To: References: Date: Sat, 17 Oct 2009 18:33:06 -0400 X-Google-Sender-Auth: e3b54420533886a3 Message-ID: Subject: Re: recommended reading order for the lua source code From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 17, 2009 at 6:18 PM, Shenyang Zhao wrote: > Can someone recommend an order of reading all the source codes? Mike Pall once offered a recommended reading order [1]. See also [2]. [1] http://lua-users.org/lists/lua-l/2008-03/msg00025.html [2] http://lua-users.org/wiki/LuaSource From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 21:30:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I0UZif028148; Sat, 17 Oct 2009 21:30:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4754F18F13; Sat, 17 Oct 2009 22:29:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55FCB18A4B for ; Sat, 17 Oct 2009 22:29:11 -0200 (BRST) Received: by fxm12 with SMTP id 12so3920461fxm.5 for ; Sat, 17 Oct 2009 17:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=cKggpqLPlhlaRf3aRHd6q1JzUWdPidRLUUzxh2euGN4=; b=AHoGfT6comkpEs7KcoIJJ+6a9PFtmYoFxjTfrCdJgtzzN8W40jKRbBICMDy71zumnq RBZJa5psP30LSkTRTBL6Pkh7DJNZPt1439GDi/8qvsrvXBSiz+cP1AJEa7M26TKrXm50 +aTDzjClYL/+0cMYU1BZljsmIGg1oVgrKzr9A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=h6N1R0+i9HXUmentoDGyYUJ0FeT7IBXFNM43IS6XweHEzDEsciiNBNNN3lDcqPiPcl w9Gy7ZZdZoPvp9Drh1m45d4vxeG+eiOEjNtlhcvGfG6ImNt1XFJnVFPh8gJ4r3G4s77g qaz1zgm0IGpZw4MeRkN1POW30udJJIKkhdf7Y= MIME-Version: 1.0 Received: by 10.223.74.91 with SMTP id t27mr697845faj.62.1255825794090; Sat, 17 Oct 2009 17:29:54 -0700 (PDT) In-Reply-To: <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> From: Jim Whitehead II Date: Sun, 18 Oct 2009 01:29:34 +0100 Message-ID: <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> Subject: Re: Support of kepler, sputnik, etc and security risks To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 17, 2009 at 8:51 PM, Petite Abeille wrote: > > On Oct 17, 2009, at 10:39 PM, David Given wrote: > >> There isn't really a good solution to this --- it's one of the reasons >> why Unicode domain names have never really taken off. > > Hmmm... this is not really related to "kepler, sputnik, etc", isn't it? Precisely my point. Why does a web server need to be concerned with this? What's the attack vector? - Jim From lua-bounces@bazar2.conectiva.com.br Sat Oct 17 21:34:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I0YZZr028435; Sat, 17 Oct 2009 21:34:35 -0300 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE4071914F; Sat, 17 Oct 2009 22:33:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E35E218EA0 for ; Sat, 17 Oct 2009 22:33:23 -0200 (BRST) Received: by fxm12 with SMTP id 12so3922100fxm.5 for ; Sat, 17 Oct 2009 17:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=0BTppxvnuJ2dXrYGjSwhFpjb1SbJm7CUfs7OcpdgC30=; b=EDRZn1a4XacW8kDDP98P/ExytEmhUcXSjbve1nDJ5uoE5pXFWPJEU4NLgq2o+QZdJ+ HPhIla4Pjwpp5mrSXpqy33QnP+6MdujN5sUu8Uz4kcvaob36Xk22fD1Sy3Y63sCv9dKR HqxHKXyOmeH95veVr177grg8sSmCbV72kzIxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ivx0K6WjAZTzebeqw/n0PwQI6LvTe3mtihDMISEjFkcpo4HoYVpGCqfsuuD5bQzV9Y nmi4H5uPFMIkZAXaein0kD/y3mm45tuArYP+DIROD1nGX4pkt7nU1TzYE6osVSvgqMcY 4U0Wa4Nc4ADUe1Hx8C0avvxmOL+miG38EK7R0= MIME-Version: 1.0 Received: by 10.204.33.194 with SMTP id i2mr3031499bkd.146.1255826048156; Sat, 17 Oct 2009 17:34:08 -0700 (PDT) In-Reply-To: References: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> From: Hisham Date: Sat, 17 Oct 2009 21:33:48 -0300 Message-ID: <5e7d91620910171733o17a2af7fw4c6ab3de3c50bc46@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 17, 2009 at 6:51 PM, Cosmin Apreutesei wrote: >> Any feedback is welcome. Thanks for your patience, > > Installing to Lua standard paths is really neat. Kudos! My little wish: > mercurial support -- I have projects on google code and I wish to make cvs > rockspecs that download the sources directly from the mercurial repo. Patches are welcome. :) It should be really easy, since we already have support for CVS, Git and SurroundSCM. -- Hisham From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 01:38:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I3coUg012147; Sun, 18 Oct 2009 01:38:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34A3B19049; Sun, 18 Oct 2009 01:37:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1A5518941 for ; Sun, 18 Oct 2009 01:37:23 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MzMat-0001cy-Rj for lua@bazar2.conectiva.com.br; Sat, 17 Oct 2009 20:38:08 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: luac - library preload support Date: Sat, 17 Oct 2009 20:38:01 -0700 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Z2o2KQwqZLgBNCX" Message-Id: <200910172038.01818.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_Z2o2KQwqZLgBNCX Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline I have added library preloading support to luac (Lua compiler) with the attached patch. It works like luac.lua [1], except it works on systems with different bit sizes then x86 (it hacks the bytecode and has the sizes hardcoded). Also this patch uses 'require' to find & preload Lua modules (not C-modules only pure Lua modules). The command line options are a bit different from luac.lua [1], here is an example: luac -L a.lua -L b -L sub-folder/c.lua x.lua y.lua That command will compile all 5 lua scripts into a single Lua bytecode file 'luac.out'. a.lua, lua module "b" & sub-folder/c.lua are compiled & preloaded into "package.preload", which can then be required as a, b, or c from x.lua & y.lua. Module "b" would need to be somewhere in the search path for Lua modules. Note that the "-L" option accepts Lua module names or file names. The patch adds support to the require() function to allow preloading Lua modules without running them. luac uses this preload feature to search for Lua modules that it needs to preload. The patch is only needed for luac, the compiled bytecode file can still run on a normal lua interpreter that doesn't have this patch. Here is what the compiled Lua code from the above command would look like: local t=package.preload t[a] = function(...) print("hello from a") end -- preload of a.lua t[b] = function(...) print("hello from b") end -- preload of b.lua t[c] = function(...) print("hello from c") end -- preload of c.lua (function(...) require("a"); require("b") end) () -- execute x.lua (function(...) require("c") end) () -- execute y.lua That is basically the same as what luac.lua [1] generates. The change to require() adds a second boolean parameter 'preload'. if it is missing or false, then require() will work like normal. If it is true, then require will try to find and load the module like normal but instead of executing the module (i.e. fully loading it), it will place the module into "package.preload" and return the module as a function. Lets say we have module a.lua: print("hello from a") and b.lua: print("hello from b") then you run main.lua: print(require("a")) print(require("a")) print(require("b",true)) print(require("b",true)) require("b",true) () require("b",true) () print(require("b")) print(require("b",true)) you would get the follow output: hello from a true true function: 0x62a580 function: 0x62a580 hello from b hello from b hello from b true function: 0x62a580 [1] http://lua-users.org/lists/lua-l/2008-08/msg00092.html -- Robert G. Jakabosky --Boundary-00=_Z2o2KQwqZLgBNCX Content-Type: text/x-diff; charset="iso 8859-15"; name="luac_preloading.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="luac_preloading.patch" diff --git a/src/loadlib.c b/src/loadlib.c index 0d401eb..23020c4 100644 --- a/src/loadlib.c +++ b/src/loadlib.c @@ -450,9 +450,10 @@ static const int sentinel_ = 0; static int ll_require (lua_State *L) { const char *name = luaL_checkstring(L, 1); + int preload = lua_toboolean(L, 2); int i; - lua_settop(L, 1); /* _LOADED table will be at index 2 */ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_settop(L, 1); /* _PRELOAD/_LOADED table will be at index 2 */ + lua_getfield(L, LUA_REGISTRYINDEX, (preload)?"_PRELOAD":"_LOADED"); lua_getfield(L, 2, name); if (lua_toboolean(L, -1)) { /* is it there? */ if (lua_touserdata(L, -1) == sentinel) /* check loops */ @@ -478,6 +479,11 @@ static int ll_require (lua_State *L) { else lua_pop(L, 1); } + if (preload) { /* add library to preload list, don't run it yet. */ + lua_pushvalue(L, -1); /* dup module function */ + lua_setfield(L, 2, name); /* _PRELOAD[name] = library load function. */ + return 1; + } lua_pushlightuserdata(L, sentinel); lua_setfield(L, 2, name); /* _LOADED[name] = sentinel */ lua_pushstring(L, name); /* pass name as argument to module */ @@ -656,7 +662,7 @@ LUALIB_API int luaopen_package (lua_State *L) { luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); lua_setfield(L, -2, "loaded"); /* set field `preload' */ - lua_newtable(L); + luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 0); lua_setfield(L, -2, "preload"); lua_pushvalue(L, LUA_GLOBALSINDEX); luaL_register(L, NULL, ll_funcs); /* open lib into global table */ diff --git a/src/luac.c b/src/luac.c index d070173..d4179d4 100644 --- a/src/luac.c +++ b/src/luac.c @@ -14,6 +14,7 @@ #include "lua.h" #include "lauxlib.h" +#include "lualib.h" #include "ldo.h" #include "lfunc.h" @@ -33,6 +34,10 @@ static char Output[]={ OUTPUT }; /* default output file name */ static const char* output=Output; /* actual output file name */ static const char* progname=PROGNAME; /* actual program name */ +#define MAX_PRELOADS (MAXINDEXRK - 2) /* max preloads about 250, to simplify code. */ +static char* preload_libs[MAX_PRELOADS]; +static int preloads=0; + static void fatal(const char* message) { fprintf(stderr,"%s: %s\n",progname,message); @@ -56,6 +61,7 @@ static void usage(const char* message) "Available options are:\n" " - process stdin\n" " -l list\n" + " -L name preload lua library " LUA_QL("name") "\n" " -o name output to file " LUA_QL("name") " (default is \"%s\")\n" " -p parse only\n" " -s strip debug information\n" @@ -84,6 +90,12 @@ static int doargs(int argc, char* argv[]) } else if (IS("-")) /* end of options; use stdin */ break; + else if (IS("-L")) /* preload library */ + { + if (preloads >= MAX_PRELOADS) usage(LUA_QL("-L") " too many preloads"); + preload_libs[preloads]=argv[++i]; + preloads++; + } else if (IS("-l")) /* list */ ++listing; else if (IS("-o")) /* output file */ @@ -116,28 +128,69 @@ static int doargs(int argc, char* argv[]) #define toproto(L,i) (clvalue(L->top+(i))->l.p) -static const Proto* combine(lua_State* L, int n) +static const Proto* combine(lua_State* L, int scripts) { - if (n==1) + if (scripts == 1 && preloads == 0) return toproto(L,-1); else { - int i,pc; + TString *s; + TValue *k; + int i,pc,n; Proto* f=luaF_newproto(L); setptvalue2s(L,L->top,f); incr_top(L); f->source=luaS_newliteral(L,"=(" PROGNAME ")"); f->maxstacksize=1; - pc=2*n+1; + pc=(2*scripts) + 1; + if(preloads > 0) + { + pc+=(2*preloads) + 2; + } f->code=luaM_newvector(L,pc,Instruction); f->sizecode=pc; + n=(scripts + preloads); f->p=luaM_newvector(L,n,Proto*); f->sizep=n; pc=0; - for (i=0; i 0) + { + /* create constants array. */ + f->k=luaM_newvector(L, (preloads + 2),TValue); + f->sizek=(preloads + 2); + /* make room for "local t" variable. */ + f->maxstacksize=2; + /* add "package" & "preload" constants. */ + k=&(f->k[0]); + s=luaS_newliteral(L, "package"); + setsvalue2n(L,k,s); + k=&(f->k[1]); + s=luaS_newliteral(L, "preload"); + setsvalue2n(L,k,s); + /* code: local t = package.preload */ + f->code[pc++]=CREATE_ABx(OP_GETGLOBAL,0,0); + f->code[pc++]=CREATE_ABC(OP_GETTABLE,0,0,RKASK(1)); + } + /* add preload libraries to "package.preload" */ + for (i=0; i < preloads; i++) + { + /* create constant for library name. */ + k=&(f->k[i+2]); + s=luaS_new(L, preload_libs[i]); + setsvalue2n(L,k,s); + /* code: t['name'] = function() --[[ lib code ]] end */ + f->code[pc++]=CREATE_ABx(OP_CLOSURE,1,n); + f->code[pc++]=CREATE_ABC(OP_SETTABLE,0,RKASK(i+2),1); + f->p[n++]=toproto(L,i-preloads-1); + } + /* call scripts. */ + for (i=0; i < scripts; i++) { - f->p[i]=toproto(L,i-n-1); - f->code[pc++]=CREATE_ABx(OP_CLOSURE,0,i); + /* code: (function() --[[ script code ]] end)() */ + f->code[pc++]=CREATE_ABx(OP_CLOSURE,0,n); f->code[pc++]=CREATE_ABC(OP_CALL,0,1,1); + f->p[n++]=toproto(L,i-scripts-1-preloads); } f->code[pc++]=CREATE_ABC(OP_RETURN,0,1,0); return f; @@ -161,14 +214,60 @@ static int pmain(lua_State* L) int argc=s->argc; char** argv=s->argv; const Proto* f; + int scripts=0; int i; if (!lua_checkstack(L,argc)) fatal("too many input files"); - for (i=0; i= filename; p--) { + if(p[0] == '.') { /* Remove file extension. */ + p[0] = '\0'; + continue; + } + if(p[0] == '/') { /* Remove file path. */ + preload_libs[i] = p+1; + break; + } + } + } } - f=combine(L,argc); + /* generate a new Lua function to combine all of the compiled scripts. */ + f=combine(L, scripts); if (listing) luaU_print(f,listing>1); if (dumping) { --Boundary-00=_Z2o2KQwqZLgBNCX-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 03:22:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I5MoL9020201; Sun, 18 Oct 2009 03:22:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3506518D78; Sun, 18 Oct 2009 03:21:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45A1818CA1 for ; Sun, 18 Oct 2009 03:21:25 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so831429fgg.17 for ; Sat, 17 Oct 2009 22:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0XIFH+Eshfs0maErqAzTsLLAHxrS3KoiP2iBr74lLV8=; b=x3LKIpyZZMKViTwcRT2tcMS4wlj5MqCK1IMxCja7DOxGYq/6nf03BsE3t0D70J8sHV qTwrm0yR4zWcMgJMAHTOpS1JjZtK4xfUsLsXRpWJNXC/+2gTgsrKz1/osIKS9hl4VMi7 JaCyRtT5/jmGG8tgQdCqih31nVa7s2JuAjm/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kfF083bA0Dhk8NQ9CNC04g/q8N1i6raklZsI4uDc7uhNI/37ZHLY+2X9EMEKr3fEEo feJ3fANQFZRl6PpFeUX5sYsErax8tUhCEz9lap3CxWcVSmOANSQqs7pWd+E+xSkVDtIp p1Gc4P/d9TBYqZ7L1kAaVMla9njUWNrO62K8o= MIME-Version: 1.0 Received: by 10.86.222.5 with SMTP id u5mr2170966fgg.67.1255843329809; Sat, 17 Oct 2009 22:22:09 -0700 (PDT) In-Reply-To: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> References: <5e7d91620910171048j5b89d1c0u7d656be09e0ecce3@mail.gmail.com> Date: Sun, 18 Oct 2009 07:22:09 +0200 Message-ID: <9386fb2d0910172222s1d394a41hffd36414bf1e3996@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0 From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Any feedback is welcome. Thanks for your patience, Still no support for compiling with mingw on windows? A quick search trough the new files showed me nothing new :'( If implemented, how would switching between the compilers be done? /Pierre From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 03:52:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I5q63w022521; Sun, 18 Oct 2009 03:52:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C20D718F75; Sun, 18 Oct 2009 03:50:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7006E18BF7 for ; Sun, 18 Oct 2009 03:50:52 -0200 (BRST) Received: by fxm12 with SMTP id 12so4025686fxm.5 for ; Sat, 17 Oct 2009 22:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=EYrF353YxGDTeYQ15ikx7I3U00OLgu0lVfNDFN1CuUQ=; b=ZaPfEiDkI5Y2Q7iaMrKKKIJgBiivLFYY1owelP0T+mNkF8tGMK4aLWgKQe7ZM6i/iQ SNM0QaG3CHlx3OLvbE+l8K9YjNmisN/WxP0irhJ0v1+74nzHFW6+fk5IhYl4V3cWiB1B P59R+mntRxfrZmzUkIy5UjUyeKjCQQxUXeN60= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=piPYMi+F41RPBiFL2DyXGTTyw10brEb8cG10XxK1evRFD3OMqvdKTYDlA2K+gPPvUi 31ooIeZN5um/1IFI3qhZgEGw4BWzXKw42tMcghPGb8Agrx1blT4Rrdf+Ket021NTmZL2 bN/ZeKHg3R9h+baXKlJCxVmhzHjcry1lPmfVk= MIME-Version: 1.0 Received: by 10.204.160.85 with SMTP id m21mr3266985bkx.175.1255845097187; Sat, 17 Oct 2009 22:51:37 -0700 (PDT) In-Reply-To: <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> Date: Sun, 18 Oct 2009 00:51:37 -0500 X-Google-Sender-Auth: 27d5f8d5aa073abb Message-ID: <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> Subject: Re: Support of kepler, sputnik, etc and security risks From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cda20e92c0404762f389b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cda20e92c0404762f389b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Example 1: UTF-8 cross site scripting http://xforce.iss.net/xforce/xfdb/39619 Example 2: UTF8 encoded HTML code execution http://xforce.iss.net/xforce/xfdb/26766 More and more: http://webapp.iss.net/Search.do?searchType=3Dkeywd&x=3D0&y=3D0&keyword=3Dut= f8 Blessings! On Sat, Oct 17, 2009 at 7:29 PM, Jim Whitehead II wrote= : > On Sat, Oct 17, 2009 at 8:51 PM, Petite Abeille > wrote: > > > > On Oct 17, 2009, at 10:39 PM, David Given wrote: > > > >> There isn't really a good solution to this --- it's one of the reasons > >> why Unicode domain names have never really taken off. > > > > Hmmm... this is not really related to "kepler, sputnik, etc", isn't it? > > Precisely my point. Why does a web server need to be concerned with > this? What's the attack vector? > > - Jim > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cda20e92c0404762f389b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Example 1:
UTF-8 cross site scripting
http://xforce.iss.net/xforce/xfdb/39619

Exa= mple 2:
UTF8 encoded HTML code execution
http://xforce.iss.net/xforce/xfdb/26766

More and more:
http://webapp.iss.net/Sear= ch.do?searchType=3Dkeywd&x=3D0&y=3D0&keyword=3Dutf8

= Blessings!

On Sat, Oct 17, 2009 at 7:29 PM, Jim Whitehe= ad II <jnwhiteh@= gmail.com> wrote:
On Sat, Oct 17, 2009 at 8:51 PM, Petite A= beille <petite_abeille@mac.com= > wrote:
>
> On Oct 17, 2009, at 10:39 PM, David Given wrote:
>
>> There isn't really a good solution to this --- it's one of= the reasons
>> why Unicode domain names have never really taken off.
>
> Hmmm... this is not really related to "kepler, sputnik, etc"= , isn't it?

Precisely my point. =C2=A0Why does a web server need to be conc= erned with
this? =C2=A0What's the attack vector?

- Jim



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cda20e92c0404762f389b-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 05:35:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I7ZkIa012580; Sun, 18 Oct 2009 05:35:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFE7518F13; Sun, 18 Oct 2009 05:34:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC74B18EA5 for ; Sun, 18 Oct 2009 05:34:31 -0200 (BRST) Received: by fxm12 with SMTP id 12so4058654fxm.5 for ; Sun, 18 Oct 2009 00:35:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.34.70 with SMTP id k6mr3212338bkd.178.1255851316348; Sun, 18 Oct 2009 00:35:16 -0700 (PDT) In-Reply-To: <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> Date: Sun, 18 Oct 2009 09:35:15 +0200 X-Google-Sender-Auth: 7c5d263218eafb81 Message-ID: Subject: Re: Support of kepler, sputnik, etc and security risks From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9I7ZkIa012580 2009/10/18 Fernando P. García : > Example 1: > UTF-8 cross site scripting > http://xforce.iss.net/xforce/xfdb/39619 This is a bug in IE6. No wonder Drupal performance is so slow if they filter every content through a unicode regular expression just to make sure it will not break IE6 :) -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 06:26:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I8Q3JO016138; Sun, 18 Oct 2009 06:26:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B39819068; Sun, 18 Oct 2009 06:24:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1008B18FF3 for ; Sun, 18 Oct 2009 06:24:50 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 172853806A3B4 for ; Sun, 18 Oct 2009 15:25:35 +0700 (NOVST) Message-ID: <001601ca4fcc$90b42c10$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com><4D9B8D09-9691-430A-9810-618687340A73@gmail.com><3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net><1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com><003a01ca4f64$be16ce50$6600a8c0@sat3> Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 15:25:32 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 18 Oct 2009 15:25:35 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br I'm thinking of the same way window procedures are done in Delphi. Allocate memory blocks for executtion (VirtualAlloc on Windows, dunno what on Linux. Maybe even malloc would be fine), write delegates there: write machine code for call instruction + the parameter to function. I wasn't correct about 32-bit Windows. I mean 32-bit applications for Windows. No matter what the real processor is as long as it supports 32-bit applications. For other architectures it would need different call opcode, for other systems it would need different memory allocation. I hoped such thing was in some kind of cross-platform library, but brief googling hasn't given the needed result. Maybe someone else would be more lucky. I personally don't see anything bad in using such hacks except the direct consiquences of architecture/platform dependance. ----- Original Message ----- From: Peter Cawley To: Lua list Sent: Sunday, October 18, 2009 3:19 AM Subject: Re: Conversion Lua function to C function If you're thinking what I think you are, then it would be an operating system dependant, and processor architecture (or at least CPU bytecode) dependant. Note that some 32 versions of Windows (around NT4?) could run on non-x86 architectures. Linux can do the same. 2009/10/17 GrayFace : > The only way see is to use a platform-dependant hack. For 32 bit Windows I > can tell you > how to do it. It should be easy to tweak it to use it on 32 bit Linux. From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 06:39:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I8dAuL016988; Sun, 18 Oct 2009 06:39:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A281190B7; Sun, 18 Oct 2009 06:38:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0B3A19049 for ; Sun, 18 Oct 2009 06:38:00 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1MzRHq-0002QR-1m for lua@bazar2.conectiva.com.br; Sun, 18 Oct 2009 01:38:46 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 01:38:40 -0700 User-Agent: KMail/1.9.10 References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <001601ca4fcc$90b42c10$6600a8c0@sat3> In-Reply-To: <001601ca4fcc$90b42c10$6600a8c0@sat3> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910180138.41032.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sunday 18, GrayFace wrote: > I'm thinking of the same way window procedures are done in Delphi. Allocate > memory blocks for executtion (VirtualAlloc on Windows, dunno what on Linux. > Maybe even malloc would be fine), write delegates there: write machine code > for call instruction + the parameter to function. > I wasn't correct about 32-bit Windows. I mean 32-bit applications for > Windows. No matter what the real processor is as long as it supports 32-bit > applications. For other architectures it would need different call opcode, > for other systems it would need different memory allocation. > I hoped such thing was in some kind of cross-platform library, but brief > googling hasn't given the needed result. Maybe someone else would be more > lucky. You could do this with a JIT like LLVM [1] or libjit [2] [1] http://llvm.org/ [2] http://libjit.com/ -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 06:58:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I8wdpS018297; Sun, 18 Oct 2009 06:58:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EFF318ED1; Sun, 18 Oct 2009 06:57:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B35CB18714 for ; Sun, 18 Oct 2009 06:57:21 -0200 (BRST) Received: by fxm12 with SMTP id 12so4090220fxm.5 for ; Sun, 18 Oct 2009 01:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=AYNrWU/8X+B4SLHWryuj5f/X1dJ6DniQL0ob5WqZChw=; b=a/1LmG/MOIPhOyG3Mq4e6gT1DpvJXJvu0gdPSYLtRZ4UGK5AmNH7iFHB2Ob465TSBP DuSe9nhice+jT7OzHetF5ZpFv8FN5uhvGUpBaoM7rVOsDCBdseyJjrEdxnlsdZE6eX+C FjKk7GwpuJ2psNlApVzqF3bvTmYWLXTmgYJcg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uJp1LbeHhsQEJJQGstmuQQQg6f+ZRrT0Lgi1fVX8VksdO+thWfJ430Cz2QsoSs0d5N P+TAH52b2dVRRO9vQKcrJBs2dTP+axXtIb89lh9P8Cs9DiUu+vTbF58Ei4YVvoAuet79 pBjBeBAqFGVh8lHP6i/EtUCHcMqJVVlFBR5OM= MIME-Version: 1.0 Received: by 10.204.152.154 with SMTP id g26mr3327745bkw.54.1255856286238; Sun, 18 Oct 2009 01:58:06 -0700 (PDT) In-Reply-To: <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> Date: Sun, 18 Oct 2009 10:58:06 +0200 Message-ID: <4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9I8wdpS018297 Hi, I think you can do it cleanly. When you use gtk_signal_connect you should pass lua_State * as a gpointer func_data. As a callback function you should use a simple C function that you define in your code, lets call it 'my_callback'. Then in my_callback you will have access the lua_State * through the func_data gpointer (you need just a cast). The you need to use Lua_State to put the Lua function you want in the Lua stack. The function could be in the Environment, or in the registry or in the global namespace of even it could already be in the stack. Then you push the arguments of the Lua functions in the Lua stack and you use lua_call or lua_pcall. Anyway, to use this schema the condition is that the GTK main event loop run  from a C function that was called from Lua. So the schema could be: - gtk_signal_connect will be used with some C functions callback that you prepare on your source code. These functions will look for particular Lua function and call them with lua_call - a Lua function is called to run the GTK main loop, some Lua functions have been   prepared in advance in the Environment or in the Lua stack to be used as callbacks So we can summarize the call sequence like that: Lua main code => GTK main loop (C code called from Lua, a Lua stack will be available) => a C callback is called by GTK main loop (we still have access to the same Lua stack available for GTK main loop) => a lua function is called. So we have closed the sequence Lua => C code => Lua. Of course it will be important to clean the stack before the C callback terminates. I hope this is clear and pertinent with your problem. Regards, Francesco 2009/10/17 Jiří Prymus > > So if I understand that, I can't wrapper cvCreateTrackBar function > without re-implementing it in my wrapper, because i'm not able to get > proper Callback function pointer from lua and pass it to opencv > library as a C function pointer. > > But it leads to the bypassing original library function and that isn't > too great. > > And using hacks isn't proper for me, because it's part of my Bachelor > thesis and I want clear code. > > Thanks for help. > > With regards, > Jiri Prymus > > 2009/10/17 Wesley Smith : > > I've got a system that allows me to set Lua functions as callback > > actions from GtkMenuItems.  You can find he code here: > > > > // generic interface: > > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp > > 471: int MenuItem :: action(lua_State *L) > > > > > > // gtk callback system: > > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp > > 93: void MenuBarImpl :: dispatch(MenuItem *mi) > > 419: void MenuItem :: implEnableAction() > > > > > > wes > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 07:34:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9I9YAiR020663; Sun, 18 Oct 2009 07:34:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D20018F13; Sun, 18 Oct 2009 07:33:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E40E18C2F for ; Sun, 18 Oct 2009 07:32:56 -0200 (BRST) Received: by fxm12 with SMTP id 12so4105852fxm.5 for ; Sun, 18 Oct 2009 02:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=1mZjVBMUiob4F6/WkEg0YK9ltIb7NpIt+YONxHzc4Co=; b=IUQdn/W4h3V1hE4o5kFKFeAd7diIKFPvUYNxJ/e/BjQoq3GupF/gCMqpSUkSNX1LzJ 8Cxgtl/APvRr/SDn7JVkU+8DpVD0kvYYk+gj7k4qALi7w3cYCmOgWIcLeEXCAaH/umYI 2LURxJit7Nu8GARP5jogeaWa7W7SvMTv1lFHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=uWjKpVYx7Z5qwxkYog0NPTCzXDniUKbPyuKBwE1JUZqsIMtHVOQ/Pe5v8hFSVfedjx 9IwdgEI0Hm5Y/FOGtOG4qN/v+QNsJvHE6KVJOLRGJsJR8aFYx6FXB5X1NFhs5sqR0/n7 ZrJuJdGaTGuzBJvV+ce/V2NEeYAjD7oFb4+V4= MIME-Version: 1.0 Received: by 10.223.76.65 with SMTP id b1mr640701fak.44.1255858420219; Sun, 18 Oct 2009 02:33:40 -0700 (PDT) In-Reply-To: <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> From: Jim Whitehead II Date: Sun, 18 Oct 2009 10:33:20 +0100 Message-ID: <5fe281d40910180233j202a1732y7040f1eac43b7536@mail.gmail.com> Subject: Re: Support of kepler, sputnik, etc and security risks To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9I9YAiR020663 2009/10/18 Fernando P. García : > Example 1: > UTF-8 cross site scripting > http://xforce.iss.net/xforce/xfdb/39619 > > Example 2: > UTF8 encoded HTML code execution > http://xforce.iss.net/xforce/xfdb/26766 > > More and more: > http://webapp.iss.net/Search.do?searchType=keywd&x=0&y=0&keyword=utf8 Most if not all of these have to do with the processing of UTF-8 strings, something which none of the applications you brought up have to do. The XSS attack is, indeed, a web browser issue. Lua treats UTF-8 strings as distinct strings. If they're wrong, they're wrong. This doesn't affect Kepler, Sputnik or any of the other frameworks in any way that I can see. - Jim From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 11:41:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IDfmC6009301; Sun, 18 Oct 2009 11:41:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8729218A5F; Sun, 18 Oct 2009 11:40:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B72318A1F for ; Sun, 18 Oct 2009 11:40:28 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1MzW0W-0005ta-9G for lua@bazar2.conectiva.com.br; Sun, 18 Oct 2009 14:41:12 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 7CC6411A52 for ; Sun, 18 Oct 2009 14:41:09 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:44765 with envelope Message-ID: <4ADB28F6.6040100@cowlark.com> Date: Sun, 18 Oct 2009 15:40:54 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: IUP oddity X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IDfmC6009301 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm having some trouble with IUP 3.0RC3 on GTK. When I run this: - ---snip--- require "iuplua" local d = iup.dialog { iup.tree { name = "tree", expand = "YES" } } d:show() print(iup.GetDialogChild(d, "tree")) if (not iup.MainLoopLevel or iup.MainLoopLevel()==0) then iup.MainLoop() end - ---snip--- ...I would *expect* to get a valid IUP handle printed to stdout, and see a window containing an empty tree. What I *get* is 'nil' and a tree containing a single node, labelled 'tree'. This doesn't seem to correspond with what the documentation is telling me --- can anyone enlighten? - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ "People who think they know everything really annoy those of us who │ know we don't." --- Bjarne Stroustrup -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK2yjzf9E0noFvlzgRAm9XAJ0acXQ8njGZO335DbLmPk+Kxbj1bgCfXZtS 0onmjhJE6JpoyZy0wVbf2ag= =MoQE -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 11:53:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IDrVIw010803; Sun, 18 Oct 2009 11:53:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF8D418E58; Sun, 18 Oct 2009 11:52:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C52418C1B for ; Sun, 18 Oct 2009 11:52:21 -0200 (BRST) Received: by ewy26 with SMTP id 26so3449602ewy.5 for ; Sun, 18 Oct 2009 06:53:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.209 with SMTP id y59mr1311433wee.21.1255873984275; Sun, 18 Oct 2009 06:53:04 -0700 (PDT) In-Reply-To: <001601ca4fcc$90b42c10$6600a8c0@sat3> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <003a01ca4f64$be16ce50$6600a8c0@sat3> <001601ca4fcc$90b42c10$6600a8c0@sat3> Date: Sun, 18 Oct 2009 14:53:04 +0100 X-Google-Sender-Auth: 720b890697f074ea Message-ID: Subject: Re: Conversion Lua function to C function From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 18, 2009 at 9:25 AM, GrayFace wrote: > I mean 32-bit applications for Windows. No matter what the real > processor is as long as it supports 32-bit applications. My point was that Windows NT 4.0 is a 32 bit operating system (thus running 32 bit apps) which can run on x86, Alpha, MIPS, or PowerPC. Thus you would need to support several different architectures, and not just x86, to fully support this hack for 32 bit Windows applications. From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 12:25:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IEPiB4013730; Sun, 18 Oct 2009 12:25:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C83B318D03; Sun, 18 Oct 2009 12:24:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E04E18B6F for ; Sun, 18 Oct 2009 12:24:22 -0200 (BRST) Received: by fxm12 with SMTP id 12so4250283fxm.5 for ; Sun, 18 Oct 2009 07:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=um4DCz+gL/h6yDC+xOl84Fd7DDHAUzitlIr9Y8T+4UY=; b=B7fwOlVvqyVEWW89+n6apDT7MtKUoN6I6KqD2L0iahd3YEVLGDPm5OF185AWb8c7kU XQxjB8WFzKr98m/M7xNZEIjfD4t8zZZe+3Q/N211lRiNEmOhPO4SRXIyFG/1O8IM+48C diSlWKtW7E2J17ZHezjlmBAXnxJizC/ASUXss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=h9pxCG5a72Tt+ckj4jqjz0+QVK7VaFZC50xSqqk/E9GFxujte4arYg06Cx1BD95BDp ayXdKt/nEkGl8NKRzCU0PwQDeTSD7gtiINH264HEqYZT/k8DgyklRl5iLjVG2Oz/kDdX t+ijajkyPCycZuBJG+YNEs+wcwgS2IzBx6MHc= MIME-Version: 1.0 Received: by 10.204.24.81 with SMTP id u17mr3639937bkb.202.1255875907064; Sun, 18 Oct 2009 07:25:07 -0700 (PDT) In-Reply-To: <4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> <4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> Date: Sun, 18 Oct 2009 16:25:07 +0200 Message-ID: <1039c1dd0910180725n860123j83f3e4fad0513dc5@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: =?ISO-8859-2?Q?Ji=F8=ED_Prymus?= To: Lua list Content-Type: text/plain; charset=ISO-8859-2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IEPiB4013730 Hi, thanks for great idea. But I have problem with lua_State * in my_callback fuction, because it has only "int pos " as argument . It's defined like : typedef void (CV_CDECL *CvTrackbarCallback)(int pos); And only way to pass stack to callback function is in global variable, but this isn't so good technique as I hoped. But yes sample code like this works. .... lua_State *state; char funcname[100]; void mycallback(int pos) { lua_pushstring(state,funcname); lua_gettable(state,LUA_GLOBALSINDEX); lua_pushnumber(state,pos); lua_call(state,1,0); } static int luacv_cvCreateTrackbar(lua_State *L) { const char *trackbar_name=luaL_checkstring(L,1); const char *window_name=luaL_checkstring(L,2); int value=luaL_checkint(L,3); int count=luaL_checkint(L,4); sprintf(funcname,"%s",luaL_checkstring(L,5)); lua_pushstring(L,funcname); lua_gettable(L,LUA_GLOBALSINDEX); if (lua_isfunction(L,-1)) { sprintf(funcname,"%s",luaL_checkstring(L,-1)); state=lua_newthread(L); } else luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string window_name,int value,int count, name of 'void func(int pos))'"); cvCreateTrackbar(trackbar_name,window_name,&value,count,mycallback); return 0; } .... if state and funcname are global variables, then it works. But this way is limited to only one Trackbar widget per script. Unfortunately I can't use lua_State in mycallback as you wrote with gpointer, because cvCreateTrackbar function is platform depended. Depends on GUI you use, including WinAPI. With regards, Jiri Prymus 2009/10/18 Francesco Abbate : > Hi, > I think you can do it cleanly. When you use gtk_signal_connect you > should pass lua_State * as a gpointer func_data. As a callback > function you should use a simple C function that you define in your > code, lets call it 'my_callback'. > > Then in my_callback you will have access the lua_State * through the > func_data gpointer (you need just a cast). The you need to use > Lua_State to put the Lua function you want in the Lua stack. The > function could be in the Environment, or in the registry or in the > global namespace of even it could already be in the stack. Then you > push the arguments of the Lua functions in the Lua stack and you use > lua_call or lua_pcall. > > Anyway, to use this schema the condition is that the GTK main event > loop run  from a C function that was called from Lua. So the schema > could be: > - gtk_signal_connect will be used with some C functions callback that > you prepare on your source code. These functions will look for > particular Lua function and call them > with lua_call > - a Lua function is called to run the GTK main loop, some Lua > functions have been >   prepared in advance in the Environment or in the Lua stack to be > used as callbacks > > So we can summarize the call sequence like that: > Lua main code => GTK main loop (C code called from Lua, a Lua stack > will be available) => a C callback is called by GTK main loop (we > still have access to the same Lua stack available for GTK main loop) > => a lua function is called. > > So we have closed the sequence Lua => C code => Lua. > > Of course it will be important to clean the stack before the C > callback terminates. > > I hope this is clear and pertinent with your problem. > > Regards, > Francesco > > 2009/10/17 Jiøí Prymus >> >> So if I understand that, I can't wrapper cvCreateTrackBar function >> without re-implementing it in my wrapper, because i'm not able to get >> proper Callback function pointer from lua and pass it to opencv >> library as a C function pointer. >> >> But it leads to the bypassing original library function and that isn't >> too great. >> >> And using hacks isn't proper for me, because it's part of my Bachelor >> thesis and I want clear code. >> >> Thanks for help. >> >> With regards, >> Jiri Prymus >> >> 2009/10/17 Wesley Smith : >> > I've got a system that allows me to set Lua functions as callback >> > actions from GtkMenuItems.  You can find he code here: >> > >> > // generic interface: >> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp >> > 471: int MenuItem :: action(lua_State *L) >> > >> > >> > // gtk callback system: >> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp >> > 93: void MenuBarImpl :: dispatch(MenuItem *mi) >> > 419: void MenuItem :: implEnableAction() >> > >> > >> > wes >> > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 12:52:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IEq5l6015781; Sun, 18 Oct 2009 12:52:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49D6518BA1; Sun, 18 Oct 2009 12:50:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA86A187EE for ; Sun, 18 Oct 2009 12:50:48 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id CDA013803AD9D for ; Sun, 18 Oct 2009 21:51:33 +0700 (NOVST) Message-ID: <003801ca5002$7c2a15d0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com><4D9B8D09-9691-430A-9810-618687340A73@gmail.com><3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net><1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com><003a01ca4f64$be16ce50$6600a8c0@sat3><001601ca4fcc$90b42c10$6600a8c0@sat3> Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 21:51:30 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 18 Oct 2009 21:51:33 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Yes, if the system cannot run x86 applications, then the hack won't work. If it can, the hack will work. ----- Original Message ----- From: Peter Cawley To: Lua list Sent: Sunday, October 18, 2009 8:53 PM Subject: Re: Conversion Lua function to C function On Sun, Oct 18, 2009 at 9:25 AM, GrayFace wrote: > I mean 32-bit applications for Windows. No matter what the real > processor is as long as it supports 32-bit applications. My point was that Windows NT 4.0 is a 32 bit operating system (thus running 32 bit apps) which can run on x86, Alpha, MIPS, or PowerPC. Thus you would need to support several different architectures, and not just x86, to fully support this hack for 32 bit Windows applications. From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 13:03:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IF3Mx2016668; Sun, 18 Oct 2009 13:03:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E35D18F5F; Sun, 18 Oct 2009 13:02:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E86FA187EE for ; Sun, 18 Oct 2009 13:02:00 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id F3F50380366A0 for ; Sun, 18 Oct 2009 22:02:45 +0700 (NOVST) Message-ID: <003901ca5004$0cff0010$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com><4D9B8D09-9691-430A-9810-618687340A73@gmail.com><3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net><1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com><1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com><1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com><4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> <1039c1dd0910180725n860123j83f3e4fad0513dc5@mail.gmail.com> Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 22:02:45 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-2"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sun, 18 Oct 2009 22:02:46 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Instead of 1 you can also have 10 or 100 or 1000 callbacks, but a limited number of them. Like, void mycallback(int pos, int funcid) { luaL_unref(...); lua_rawgeti(state, -1, funcid); lua_pushnumber(state,pos); lua_call(state,1,0); lua_pop(state, 1); } void mycallback_1(int pos) { mycallback(pos, 1); } ... void mycallback_100(int pos) { mycallback(pos, 100); } ----- Original Message ----- From: Jiøí Prymus To: Lua list Sent: Sunday, October 18, 2009 9:25 PM Subject: Re: Conversion Lua function to C function Hi, thanks for great idea. But I have problem with lua_State * in my_callback fuction, because it has only "int pos " as argument . It's defined like : typedef void (CV_CDECL *CvTrackbarCallback)(int pos); And only way to pass stack to callback function is in global variable, but this isn't so good technique as I hoped. But yes sample code like this works. .... lua_State *state; char funcname[100]; void mycallback(int pos) { lua_pushstring(state,funcname); lua_gettable(state,LUA_GLOBALSINDEX); lua_pushnumber(state,pos); lua_call(state,1,0); } static int luacv_cvCreateTrackbar(lua_State *L) { const char *trackbar_name=luaL_checkstring(L,1); const char *window_name=luaL_checkstring(L,2); int value=luaL_checkint(L,3); int count=luaL_checkint(L,4); sprintf(funcname,"%s",luaL_checkstring(L,5)); lua_pushstring(L,funcname); lua_gettable(L,LUA_GLOBALSINDEX); if (lua_isfunction(L,-1)) { sprintf(funcname,"%s",luaL_checkstring(L,-1)); state=lua_newthread(L); } else luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string window_name,int value,int count, name of 'void func(int pos))'"); cvCreateTrackbar(trackbar_name,window_name,&value,count,mycallback); return 0; } .... if state and funcname are global variables, then it works. But this way is limited to only one Trackbar widget per script. Unfortunately I can't use lua_State in mycallback as you wrote with gpointer, because cvCreateTrackbar function is platform depended. Depends on GUI you use, including WinAPI. With regards, Jiri Prymus 2009/10/18 Francesco Abbate : > Hi, > I think you can do it cleanly. When you use gtk_signal_connect you > should pass lua_State * as a gpointer func_data. As a callback > function you should use a simple C function that you define in your > code, lets call it 'my_callback'. > > Then in my_callback you will have access the lua_State * through the > func_data gpointer (you need just a cast). The you need to use > Lua_State to put the Lua function you want in the Lua stack. The > function could be in the Environment, or in the registry or in the > global namespace of even it could already be in the stack. Then you > push the arguments of the Lua functions in the Lua stack and you use > lua_call or lua_pcall. > > Anyway, to use this schema the condition is that the GTK main event > loop run from a C function that was called from Lua. So the schema > could be: > - gtk_signal_connect will be used with some C functions callback that > you prepare on your source code. These functions will look for > particular Lua function and call them > with lua_call > - a Lua function is called to run the GTK main loop, some Lua > functions have been > prepared in advance in the Environment or in the Lua stack to be > used as callbacks > > So we can summarize the call sequence like that: > Lua main code => GTK main loop (C code called from Lua, a Lua stack > will be available) => a C callback is called by GTK main loop (we > still have access to the same Lua stack available for GTK main loop) > => a lua function is called. > > So we have closed the sequence Lua => C code => Lua. > > Of course it will be important to clean the stack before the C > callback terminates. > > I hope this is clear and pertinent with your problem. > > Regards, > Francesco > > 2009/10/17 Jiøí Prymus >> >> So if I understand that, I can't wrapper cvCreateTrackBar function >> without re-implementing it in my wrapper, because i'm not able to get >> proper Callback function pointer from lua and pass it to opencv >> library as a C function pointer. >> >> But it leads to the bypassing original library function and that isn't >> too great. >> >> And using hacks isn't proper for me, because it's part of my Bachelor >> thesis and I want clear code. >> >> Thanks for help. >> >> With regards, >> Jiri Prymus >> >> 2009/10/17 Wesley Smith : >> > I've got a system that allows me to set Lua functions as callback >> > actions from GtkMenuItems. You can find he code here: >> > >> > // generic interface: >> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp >> > 471: int MenuItem :: action(lua_State *L) >> > >> > >> > // gtk callback system: >> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp >> > 93: void MenuBarImpl :: dispatch(MenuItem *mi) >> > 419: void MenuItem :: implEnableAction() >> > >> > >> > wes >> > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 14:05:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IG5TJw022417; Sun, 18 Oct 2009 14:05:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B03118D03; Sun, 18 Oct 2009 14:04:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B9F118C55 for ; Sun, 18 Oct 2009 14:04:06 -0200 (BRST) Received: by fxm12 with SMTP id 12so4310534fxm.5 for ; Sun, 18 Oct 2009 09:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=NLkKSInt90UBQmaP8DztLtmT+92fhlssAyVqFlj0LRE=; b=lJUGv37dKpGE6us6XUrJBsZZzcqc2ub+4vmtMN3cmMeZzMN2vkbHpTHfVUxM0aeZIA pwM4K9ID4XZMMXQ7AFDf73sGzlBk/7HwHptcgbvhe6cBhvgt+KRFIA3adgdBBin7WOKR g2RllCSv+JXREn69wCtKKfVqioKMMXAIwfdYo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=durPe/G94p/3biy66fJUptja2MHaH24oqBsMzRU+3cEIFw6mCjtC34Wz2X9XNuFkqM 6UrSP0S1hZ+XUUTQQcpou/k0OCn3HlkLMR4nxpGMOxk2qPFmcSB4BkC5o4EqwtCu/Vg5 5bzW4EoT9RFQlYoeF3zTdXYOhsHgTYOzlTHT0= MIME-Version: 1.0 Received: by 10.204.24.130 with SMTP id v2mr3686369bkb.33.1255881892665; Sun, 18 Oct 2009 09:04:52 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Oct 2009 00:04:52 +0800 Message-ID: Subject: Re: recommended reading order for the lua source code From: Shenyang Zhao To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IG5TJw022417 Thanks, I think this will definitely help my reading! regards, Zhao Shenyang On Sun, Oct 18, 2009 at 6:33 AM, David Manura wrote: > On Sat, Oct 17, 2009 at 6:18 PM, Shenyang Zhao wrote: >> Can someone recommend an order of reading all the source > codes? > > Mike Pall once offered a recommended reading order [1].  See also [2]. > > [1] http://lua-users.org/lists/lua-l/2008-03/msg00025.html > [2] http://lua-users.org/wiki/LuaSource > From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 14:16:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IGGnu6023368; Sun, 18 Oct 2009 14:16:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA90E1A5DD; Sun, 18 Oct 2009 14:15:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC60D18F5F for ; Sun, 18 Oct 2009 14:15:33 -0200 (BRST) Received: by fxm12 with SMTP id 12so4317460fxm.5 for ; Sun, 18 Oct 2009 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=O9ifzj5vusN2twYyLEOUy57MLk3FyUqi/6Pr9LyTZzw=; b=HCUtoCbxKJ0OxEjrb+986/U86fJYaHwYSWr69VOOww6zeqjm225yuXSSTmz9yyq8L4 y9X9v+SLKaZvBgK4WfzJDL92JZVnG/muUAkeIk5Ri1BbIlxSFE4RYH9805sC6SWmEhg3 mbi0uRg+g8q5SGFRio40vn5NtzKiPtNO074dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=OkISiwwu16Wyy6YRJsfCF1LOPhpW/2cH9uYA7wmL+xWxLGXWLG9yrggpKa/JOO6wk5 gdg9aC1b8L8frdY1AKen9vc8W11qtP8euzk27wIP7QOHJ9Ns84rExa1GA9XXoAqacc8U R4d38tEKVqrIS0DBI5Wbz9G/7CPiSBFPIDq+A= MIME-Version: 1.0 Received: by 10.204.33.194 with SMTP id i2mr3701960bkd.146.1255882578624; Sun, 18 Oct 2009 09:16:18 -0700 (PDT) In-Reply-To: References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> Date: Sun, 18 Oct 2009 12:16:18 -0400 X-Google-Sender-Auth: e69205ee13998c2b Message-ID: Subject: Re: Support of kepler, sputnik, etc and security risks From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > This is a bug in IE6. No wonder Drupal performance is so slow if they > filter every content through a unicode regular expression just to make > sure it will not break IE6 :) I actually agree with Fernando on this. (The good news is that the fix is fairly simple - see below.) While XSS attacks are almost always based on browser bugs, the issue goes beyond breaking IE6 for those unfortunately enough to use it. As I understand, this particular bug in IE6 means that IE6 can see (and execute) Javascript while a different parser (e.g., the XSS filter) will see different markup, well-formed and compliant. This may potentially make it possible for the attacker to connect the site with victim's credentials, doing things that would affect other users, even those not using IE. There was an XSS worm on Reddit just two weeks ago. That one was caused by simpler issues (Reddit just wasn't filtering javascript well enough, apparently relying on black-listing rather than white-listing). But I think the concern is valid at least for some sites. I think this decision should be ultimately left to the site administrator, but I added utf8 validation to XSSFilter[1]. Since this requires a C library (iconv), I decided to turn it on and off based on whether iconv is available. (So, if you want to enable it, you just need to install iconv.) This check takes almost no time (.0001 second per I request it seems) and there is an easy way to disable XSSFilter in Sputnik. The updated XSSFilter code: http://gitorious.org/sputnik/mainline/blobs/master/xssfilter/lua/xssfilter.lua - yuri [1]: http://sputnik.freewisdom.org/lib/xssfilter/ From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 14:49:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IGnFDs025941; Sun, 18 Oct 2009 14:49:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42B3D183E2; Sun, 18 Oct 2009 14:48:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FDB6183B0 for ; Sun, 18 Oct 2009 14:47:53 -0200 (BRST) Received: by fxm12 with SMTP id 12so4337733fxm.5 for ; Sun, 18 Oct 2009 09:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5tFgKKOwC20P/BB96jr3J83pEeDXTkGjINOUWHO8URA=; b=ZbByWc0tEvLHvUY2L+iZLaVfbKIF+1ZhyYECdNh0WiEwx977H+iqMG3+PjYwYsi7JS t5483i5BSHywL5zrOwbLqlXDuavHYbv8lQHgdnlZKNrGDwwxm7xBPZfvjWYQLvW6fw/N c7b1jK5bsob7HZdG9NyT6H85ZaqRVzq6UlWEw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hLKNtjcgu93yyFQDSFC77xjtykV5dz6cIuLdaL5hEvJ2O1dhXa8EQ559xnryKOUjdn lT7lXxxS2QJTJavgeYE2xsOO8+k8rZkEAplEx+ds7xBoZBWj4GQlX5P18E7TkzQPmKH+ dhyVOgMMmkaxrC7QEoxc8oEbO8ndRNIFr1+XY= MIME-Version: 1.0 Received: by 10.204.13.210 with SMTP id d18mr3821776bka.211.1255884518662; Sun, 18 Oct 2009 09:48:38 -0700 (PDT) In-Reply-To: <003901ca5004$0cff0010$6600a8c0@sat3> References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> <4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> <1039c1dd0910180725n860123j83f3e4fad0513dc5@mail.gmail.com> <003901ca5004$0cff0010$6600a8c0@sat3> Date: Sun, 18 Oct 2009 18:48:38 +0200 Message-ID: <1039c1dd0910180948p31c4327ag32bd955b6607ed6a@mail.gmail.com> Subject: Re: Conversion Lua function to C function From: =?ISO-8859-2?Q?Ji=F8=ED_Prymus?= To: Lua list Content-Type: text/plain; charset=ISO-8859-2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IGnFDs025941 Yes, I know what do you think but this static approach, in my case will be better use dynamic algorithm. But meantime I don't know how to do that. I want to create algorithm where I can use something like this: -- lua script-- cv=require('luacv') function on_trackbar1(pos) .... some update event stuff.. end function on_trackbar2(pos) ...another update event stuff for another trackbar widget end cv.cvCreateTrackbar(name1,wndname1,edge1,100,"on_trackbar1") cv.cvCreateTrackbar(name2,wndname2,edge2,100,"on_trackbar2") -- end of lua -- And that is problem with my current implementation because stack information and funcname will be rewritten by second calling of cvCreateTrackbar(....) and C callback function of first TrackBar will call lua callback function of second TrackBar. Little confusing, isn't it? :) With regards, Jiri Prymus 2009/10/18 GrayFace : > Instead of 1 you can also have 10 or 100 or 1000 callbacks, but a limited > number of them. > Like, > void mycallback(int pos, int funcid) > { >     luaL_unref(...); >     lua_rawgeti(state, -1, funcid); >     lua_pushnumber(state,pos); >     lua_call(state,1,0); >     lua_pop(state, 1); > } > > void mycallback_1(int pos) { mycallback(pos, 1); } > ... > void mycallback_100(int pos) { mycallback(pos, 100); } > > > > > > ----- Original Message ----- From: Jiøí Prymus > To: Lua list > Sent: Sunday, October 18, 2009 9:25 PM > Subject: Re: Conversion Lua function to C function > > > Hi, > > thanks for great idea. > But I have problem with lua_State *  in my_callback fuction, because > it has only "int pos " as argument . > It's defined like : > typedef void (CV_CDECL *CvTrackbarCallback)(int pos); > > And only way to pass stack to callback function is in global variable, > but this isn't so good technique as I hoped. > > But yes sample code like this works. > > .... > lua_State *state; > char funcname[100]; > > void mycallback(int pos) > { >     lua_pushstring(state,funcname); >     lua_gettable(state,LUA_GLOBALSINDEX); >     lua_pushnumber(state,pos); >     lua_call(state,1,0); > } > > static int luacv_cvCreateTrackbar(lua_State *L) > { >  const char *trackbar_name=luaL_checkstring(L,1); >  const char *window_name=luaL_checkstring(L,2); >  int value=luaL_checkint(L,3); >  int count=luaL_checkint(L,4); > >  sprintf(funcname,"%s",luaL_checkstring(L,5)); >  lua_pushstring(L,funcname); >  lua_gettable(L,LUA_GLOBALSINDEX); >  if (lua_isfunction(L,-1)) >  { >     sprintf(funcname,"%s",luaL_checkstring(L,-1)); >     state=lua_newthread(L); >   } > else >   luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string > window_name,int value,int count, name of 'void func(int pos))'"); > > cvCreateTrackbar(trackbar_name,window_name,&value,count,mycallback); > return 0; > } > .... > > if  state and funcname are global variables, then it works. But this > way is limited to only one Trackbar widget per script. > > Unfortunately I can't use lua_State  in mycallback as you wrote with > gpointer, because > cvCreateTrackbar function is platform depended. Depends on GUI you > use, including WinAPI. > > > With regards, > Jiri Prymus > > 2009/10/18 Francesco Abbate : >> >> Hi, >> I think you can do it cleanly. When you use gtk_signal_connect you >> should pass lua_State * as a gpointer func_data. As a callback >> function you should use a simple C function that you define in your >> code, lets call it 'my_callback'. >> >> Then in my_callback you will have access the lua_State * through the >> func_data gpointer (you need just a cast). The you need to use >> Lua_State to put the Lua function you want in the Lua stack. The >> function could be in the Environment, or in the registry or in the >> global namespace of even it could already be in the stack. Then you >> push the arguments of the Lua functions in the Lua stack and you use >> lua_call or lua_pcall. >> >> Anyway, to use this schema the condition is that the GTK main event >> loop run from a C function that was called from Lua. So the schema >> could be: >> - gtk_signal_connect will be used with some C functions callback that >> you prepare on your source code. These functions will look for >> particular Lua function and call them >> with lua_call >> - a Lua function is called to run the GTK main loop, some Lua >> functions have been >> prepared in advance in the Environment or in the Lua stack to be >> used as callbacks >> >> So we can summarize the call sequence like that: >> Lua main code => GTK main loop (C code called from Lua, a Lua stack >> will be available) => a C callback is called by GTK main loop (we >> still have access to the same Lua stack available for GTK main loop) >> => a lua function is called. >> >> So we have closed the sequence Lua => C code => Lua. >> >> Of course it will be important to clean the stack before the C >> callback terminates. >> >> I hope this is clear and pertinent with your problem. >> >> Regards, >> Francesco >> >> 2009/10/17 Jiøí Prymus >>> >>> So if I understand that, I can't wrapper cvCreateTrackBar function >>> without re-implementing it in my wrapper, because i'm not able to get >>> proper Callback function pointer from lua and pass it to opencv >>> library as a C function pointer. >>> >>> But it leads to the bypassing original library function and that isn't >>> too great. >>> >>> And using hacks isn't proper for me, because it's part of my Bachelor >>> thesis and I want clear code. >>> >>> Thanks for help. >>> >>> With regards, >>> Jiri Prymus >>> >>> 2009/10/17 Wesley Smith : >>> > I've got a system that allows me to set Lua functions as callback >>> > actions from GtkMenuItems. You can find he code here: >>> > >>> > // generic interface: >>> > >>> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp >>> > 471: int MenuItem :: action(lua_State *L) >>> > >>> > >>> > // gtk callback system: >>> > >>> > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp >>> > 93: void MenuBarImpl :: dispatch(MenuItem *mi) >>> > 419: void MenuItem :: implEnableAction() >>> > >>> > >>> > wes >>> > >> > > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 15:21:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IHLQAZ028371; Sun, 18 Oct 2009 15:21:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0764818993; Sun, 18 Oct 2009 15:20:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tulikuusama.dnainternet.net (tulikuusama.dnainternet.net [83.102.40.132]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA566187D3 for ; Sun, 18 Oct 2009 15:20:01 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id 4089B2C25E for ; Sun, 18 Oct 2009 20:20:46 +0300 (EEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -1.36 X-Spam-Level: X-Spam-Status: No, score=-1.36 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1.36] Received: from tulikuusama.dnainternet.net ([83.102.40.132]) by localhost (tulikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id T1tuL6ISCPPC for ; Sun, 18 Oct 2009 20:20:46 +0300 (EEST) Received: from kirsikkapuu.dnainternet.net (kirsikkapuu.dnainternet.net [83.102.40.214]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id F2A3A2C25A for ; Sun, 18 Oct 2009 20:20:45 +0300 (EEST) Received: from [10.0.0.4] (unknown [59.92.251.213]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by kirsikkapuu.dnainternet.net (Postfix) with ESMTPSA id A4EF32BAD9 for ; Sun, 18 Oct 2009 20:20:44 +0300 (EEST) Message-Id: <209AC4D4-B584-4CBE-B56E-568531DC30CA@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <1039c1dd0910180948p31c4327ag32bd955b6607ed6a@mail.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Conversion Lua function to C function Date: Sun, 18 Oct 2009 22:50:59 +0530 References: <1039c1dd0910170147y5f8eab4aucf27280d5ae3eafe@mail.gmail.com> <4D9B8D09-9691-430A-9810-618687340A73@gmail.com> <3DD08962-7F40-40E7-A419-B63D319EF874@dnainternet.net> <1039c1dd0910170922i7228d272lc90272c4cacedde@mail.gmail.com> <1079b050910170958g5371d10fxfbe6b9b45e37dec@mail.gmail.com> <1039c1dd0910171342h4886c19awd03973524e483c7b@mail.gmail.com> <4ff79edb0910180158v3fac2010t863f0a90c56880f6@mail.gmail.com> <1039c1dd0910180725n860123j83f3e4fad0513dc5@mail.gmail.com> <003901ca5004$0cff0010$6600a8c0@sat3> <1039c1dd0910180948p31c4327ag32bd955b6607ed6a@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IHLQAZ028371 You will find samples of doing this right in other people's code and at least one message included links. Read their code. We've given enough hints by now, the rest is for you to figure out. This is also the only way to really learn something well. Imitate, adopt and then teach others. - asko On 18.10.2009, at 22.18, Jiří Prymus wrote: > Yes, I know what do you think but this static approach, in my case > will be better use dynamic algorithm. > But meantime I don't know how to do that. > > I want to create algorithm where I can use something like this: > > -- lua script-- > cv=require('luacv') > > function on_trackbar1(pos) > .... some update event stuff.. > end > > function on_trackbar2(pos) > ...another update event stuff for another trackbar widget > end > > cv.cvCreateTrackbar(name1,wndname1,edge1,100,"on_trackbar1") > cv.cvCreateTrackbar(name2,wndname2,edge2,100,"on_trackbar2") > -- end of lua -- > > And that is problem with my current implementation because stack > information and funcname will be rewritten > by second calling of cvCreateTrackbar(....) and C callback function > of first TrackBar will call lua callback function of second TrackBar. > > Little confusing, isn't it? :) > > With regards, > Jiri Prymus > > > 2009/10/18 GrayFace : >> Instead of 1 you can also have 10 or 100 or 1000 callbacks, but a >> limited >> number of them. >> Like, >> void mycallback(int pos, int funcid) >> { >> luaL_unref(...); >> lua_rawgeti(state, -1, funcid); >> lua_pushnumber(state,pos); >> lua_call(state,1,0); >> lua_pop(state, 1); >> } >> >> void mycallback_1(int pos) { mycallback(pos, 1); } >> ... >> void mycallback_100(int pos) { mycallback(pos, 100); } >> >> >> >> >> >> ----- Original Message ----- From: Jiří Prymus >> To: Lua list >> Sent: Sunday, October 18, 2009 9:25 PM >> Subject: Re: Conversion Lua function to C function >> >> >> Hi, >> >> thanks for great idea. >> But I have problem with lua_State * in my_callback fuction, because >> it has only "int pos " as argument . >> It's defined like : >> typedef void (CV_CDECL *CvTrackbarCallback)(int pos); >> >> And only way to pass stack to callback function is in global >> variable, >> but this isn't so good technique as I hoped. >> >> But yes sample code like this works. >> >> .... >> lua_State *state; >> char funcname[100]; >> >> void mycallback(int pos) >> { >> lua_pushstring(state,funcname); >> lua_gettable(state,LUA_GLOBALSINDEX); >> lua_pushnumber(state,pos); >> lua_call(state,1,0); >> } >> >> static int luacv_cvCreateTrackbar(lua_State *L) >> { >> const char *trackbar_name=luaL_checkstring(L,1); >> const char *window_name=luaL_checkstring(L,2); >> int value=luaL_checkint(L,3); >> int count=luaL_checkint(L,4); >> >> sprintf(funcname,"%s",luaL_checkstring(L,5)); >> lua_pushstring(L,funcname); >> lua_gettable(L,LUA_GLOBALSINDEX); >> if (lua_isfunction(L,-1)) >> { >> sprintf(funcname,"%s",luaL_checkstring(L,-1)); >> state=lua_newthread(L); >> } >> else >> luaL_error(L,"luacv.cvCreateTrackbar(string trackbar_name,string >> window_name,int value,int count, name of 'void func(int pos))'"); >> >> cvCreateTrackbar(trackbar_name,window_name,&value,count,mycallback); >> return 0; >> } >> .... >> >> if state and funcname are global variables, then it works. But this >> way is limited to only one Trackbar widget per script. >> >> Unfortunately I can't use lua_State in mycallback as you wrote with >> gpointer, because >> cvCreateTrackbar function is platform depended. Depends on GUI you >> use, including WinAPI. >> >> >> With regards, >> Jiri Prymus >> >> 2009/10/18 Francesco Abbate : >>> >>> Hi, >>> I think you can do it cleanly. When you use gtk_signal_connect you >>> should pass lua_State * as a gpointer func_data. As a callback >>> function you should use a simple C function that you define in your >>> code, lets call it 'my_callback'. >>> >>> Then in my_callback you will have access the lua_State * through the >>> func_data gpointer (you need just a cast). The you need to use >>> Lua_State to put the Lua function you want in the Lua stack. The >>> function could be in the Environment, or in the registry or in the >>> global namespace of even it could already be in the stack. Then you >>> push the arguments of the Lua functions in the Lua stack and you use >>> lua_call or lua_pcall. >>> >>> Anyway, to use this schema the condition is that the GTK main event >>> loop run from a C function that was called from Lua. So the schema >>> could be: >>> - gtk_signal_connect will be used with some C functions callback >>> that >>> you prepare on your source code. These functions will look for >>> particular Lua function and call them >>> with lua_call >>> - a Lua function is called to run the GTK main loop, some Lua >>> functions have been >>> prepared in advance in the Environment or in the Lua stack to be >>> used as callbacks >>> >>> So we can summarize the call sequence like that: >>> Lua main code => GTK main loop (C code called from Lua, a Lua stack >>> will be available) => a C callback is called by GTK main loop (we >>> still have access to the same Lua stack available for GTK main loop) >>> => a lua function is called. >>> >>> So we have closed the sequence Lua => C code => Lua. >>> >>> Of course it will be important to clean the stack before the C >>> callback terminates. >>> >>> I hope this is clear and pertinent with your problem. >>> >>> Regards, >>> Francesco >>> >>> 2009/10/17 Jiří Prymus >>>> >>>> So if I understand that, I can't wrapper cvCreateTrackBar function >>>> without re-implementing it in my wrapper, because i'm not able to >>>> get >>>> proper Callback function pointer from lua and pass it to opencv >>>> library as a C function pointer. >>>> >>>> But it leads to the bypassing original library function and that >>>> isn't >>>> too great. >>>> >>>> And using hacks isn't proper for me, because it's part of my >>>> Bachelor >>>> thesis and I want clear code. >>>> >>>> Thanks for help. >>>> >>>> With regards, >>>> Jiri Prymus >>>> >>>> 2009/10/17 Wesley Smith : >>>>> I've got a system that allows me to set Lua functions as callback >>>>> actions from GtkMenuItems. You can find he code here: >>>>> >>>>> // generic interface: >>>>> >>>>> http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/src/LuaAVMenu.cpp >>>>> 471: int MenuItem :: action(lua_State *L) >>>>> >>>>> >>>>> // gtk callback system: >>>>> >>>>> http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/LuaAV/library/linux/LuaAVMenuLinux.cpp >>>>> 93: void MenuBarImpl :: dispatch(MenuItem *mi) >>>>> 419: void MenuItem :: implEnableAction() >>>>> >>>>> >>>>> wes >>>>> >>> >> >> >> From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 15:29:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IHTdJV028894; Sun, 18 Oct 2009 15:29:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52263189E3; Sun, 18 Oct 2009 15:28:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A323188C8 for ; Sun, 18 Oct 2009 15:28:21 -0200 (BRST) Received: by yxe17 with SMTP id 17so3325754yxe.33 for ; Sun, 18 Oct 2009 10:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ispQHr/978RRnki+nvMHBijg11ZHpIlPs1rsOdDHGFg=; b=DPBzbB+TpGrfvdymZglOyaVlTObIKn0aGxG0dzuCxNi1yMGoBDjuHVIzC8JTOoApT+ c3H2AicZl2P9Nx+e1TLXbf2T8J+zAGQBDR0j/HbBWjFUcm5B+imvVHx+3wdPWKBBttaL kf16RsiWEDKuzzfdVuiZPcx8KIIacm0Q6z4iE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BJZLkeCAlhr9fPycTV9PN9s0y5NmD6JS8pvuhytv2PgSQjzGpH9+Sg8oUgQvn0/mRt 9hO08TneT/JLJ/ng6u7yZDS9AdTE3hHbJdHAXGgDChv7u0ZRq2PXfEmDPOf4jJpXAms6 frwRFm0iJo58zqm5gLkZVMovm+LSRXYLJ0B3o= MIME-Version: 1.0 Received: by 10.101.194.8 with SMTP id w8mr62476anp.190.1255886945571; Sun, 18 Oct 2009 10:29:05 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Oct 2009 19:29:05 +0200 Message-ID: Subject: Re: Multiple return values from require() From: Matthias Kluwe To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi! 2009/10/17 Peter Cawley : > On Sat, Oct 17, 2009 at 7:01 PM, Matthias Kluwe wrote: >> Hi! >> >> 2009/10/17 Linker : >>> You can return a table instead of a list . >> >> Well, I know ... I can return _one_ table, but matrix.lua does return >> two of them, and there has to be a trick (well, not a trick obviously, >> but I can't find it in the reference manual). > > Look at http://www.lua.org/source/5.1/loadlib.c.html#ll_require - you > will notice that all execution paths terminate with an error or > "return 1;", hence require() can only return a single value. Right. I was mislead by the above mentioned script which I assumed to work. I checked now -- it does not. Thank you for the clarification. Regards, Matthias From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 19:37:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ILb8Gf015310; Sun, 18 Oct 2009 19:37:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79DE4187A4; Sun, 18 Oct 2009 19:35:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F5B91888B for ; Sun, 18 Oct 2009 19:35:43 -0200 (BRST) Received: from antonio (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ILaQMI015271 for ; Sun, 18 Oct 2009 19:36:29 -0200 From: "Antonio Scuri" To: "'Lua list'" References: <4ADB28F6.6040100@cowlark.com> In-Reply-To: <4ADB28F6.6040100@cowlark.com> Subject: RE: IUP oddity Date: Sun, 18 Oct 2009 19:36:25 -0200 Message-ID: <00a901ca503b$0cbdfa70$2639ef50$@puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpP+L3n6HE2P2XHT5uIhTtmqvgOAAAQVeag Content-Language: pt-br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9ILb8Gf015310 Hi, IupTree is the only control that the NAME attribute does not work. This happens because we kept backward compatibility with IUP 2. The IupTree originally had an attribute called NAME, it was renamed to TITLE but until old application are not updated we have to keep NAME working. I should have added a comment in the IupTree documentation, but I did only in the History page. Sorry. Best, scuri > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of David Given > Sent: domingo, 18 de outubro de 2009 12:41 > To: Lua list > Subject: IUP oddity > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm having some trouble with IUP 3.0RC3 on GTK. > > When I run this: > > - ---snip--- > require "iuplua" > > local d = iup.dialog > { > iup.tree > { > name = "tree", > expand = "YES" > } > } > > d:show() > > print(iup.GetDialogChild(d, "tree")) > > if (not iup.MainLoopLevel or iup.MainLoopLevel()==0) then > iup.MainLoop() > end > - ---snip--- > > ...I would *expect* to get a valid IUP handle printed to stdout, and > see > a window containing an empty tree. What I *get* is 'nil' and a tree > containing a single node, labelled 'tree'. > > This doesn't seem to correspond with what the documentation is telling > me --- can anyone enlighten? > > - -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ > │ "People who think they know everything really annoy those of us who > │ know we don't." --- Bjarne Stroustrup > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFK2yjzf9E0noFvlzgRAm9XAJ0acXQ8njGZO335DbLmPk+Kxbj1bgCfXZtS > 0onmjhJE6JpoyZy0wVbf2ag= > =MoQE > -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 20:27:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IMQw6o018704; Sun, 18 Oct 2009 20:26:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC9371A5E7; Sun, 18 Oct 2009 20:25:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-6.csi.cam.ac.uk (ppsw-6.csi.cam.ac.uk [131.111.8.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 243C118C6A for ; Sun, 18 Oct 2009 20:25:38 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:43953) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpa (EXTERNAL:fanf2) id 1MzeCi-0004Ag-M8 (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Sun, 18 Oct 2009 23:26:20 +0100 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1MzeCi-0000kp-RO (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Sun, 18 Oct 2009 23:26:20 +0100 Date: Sun, 18 Oct 2009 23:26:20 +0100 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Support of kepler, sputnik, etc and security risks In-Reply-To: <4ADA2B78.2080001@cowlark.com> Message-ID: References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1870869256-1613551463-1255904780=:11942" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1870869256-1613551463-1255904780=:11942 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 17 Oct 2009, David Given wrote: > > There isn't really a good solution to this --- it's one of the reasons > why Unicode domain names have never really taken off. The solution is generally for TLDs to implement a character set policy. For example, .at only allows these non-ascii characters in domain names: =C3=A4 =C3=BC =C3=B6 =C3=AB =C3=A0 =C3=A1 =C3=A2 =C3=A8 =C3=A9 =C3=AA =C3= =AC =C3=AD =C3=AE =C3=AF =C3=B2 =C3=B3 =C3=B4 =C3=B9 =C3=BA =C3=BB =C3=BD = =C3=BF =C3=A3 =C3=A5 =C3=A6 =C3=A7 =C3=B0 =C3=B1 =C3=B5 =C3=B8 =C5=93 =C5= =A1 =C3=BE =C5=BE The other reason for limited adoption of internationalized domain names is that the specifications are not yet finalized. Tony. --=20 f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. --1870869256-1613551463-1255904780=:11942-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 20:36:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IMaFTF019454; Sun, 18 Oct 2009 20:36:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6336E19027; Sun, 18 Oct 2009 20:35:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8084E18D75 for ; Sun, 18 Oct 2009 20:35:00 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2BAF5ACE2B for ; Sun, 18 Oct 2009 18:35:46 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 18 Oct 2009 18:35:46 -0400 X-Sasl-enc: d2zugqDgNYibyqCBnUNXiyb+2iLL6nElQn03aOkhPnh8 1255905345 Received: from [10.1.1.3] (222-152-77-118.jetstream.xtra.co.nz [222.152.77.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id 60528A791 for ; Sun, 18 Oct 2009 18:35:45 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Getting the address of a table with a __tostring Date: Mon, 19 Oct 2009 11:35:12 +1300 Message-Id: <25EA1390-D96D-43FE-92DA-8A783D5BE04F@fastmail.fm> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Has anyone got a better idea for getting the address of a table with a __tostring in its metatable than this? > a = setmetatable({}, { __tostring = function() return "pretty but no address" end}) > print(a) pretty but no address > function rawtostring(t) local mt = getmetatable(t) setmetatable(t, nil) local r = tostring(t) setmetatable(t, mt) return r end > print(a, rawtostring(a), a) pretty but no address table: 0x115150 pretty but no address It works, but it's a bit mucky. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 20:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IMkiA6020398; Sun, 18 Oct 2009 20:46:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17787190D1; Sun, 18 Oct 2009 20:45:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58E8218D75 for ; Sun, 18 Oct 2009 20:45:27 -0200 (BRST) Received: by fxm12 with SMTP id 12so4567800fxm.5 for ; Sun, 18 Oct 2009 15:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=O/qwNvlexPO7VxT95PA7T1dUit2VhWYCmSgTdOoetS8=; b=bCF6hxhPXbe1RD+FAAEXGRYF6iW04XonUte+u5UZvee+8pDZA6aR9nYLbxn6TU2yRk uiJxrXe8NYO+wuS3RTpgLHW4vVUMfYqlKnzOhPXLKpaG0mnKEDrAVf505UDTovlMFr9P uETbWV/efCzJLaOPOXcdjhQBVMQmjHyUECUMc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PdYV/FnB/9zuwjW0iUdI/81bI9wvaxfxJK8BkJRdBMRoLgAYYsGYNFDDdJ3Y29EuK1 J+Bg0ScTYzdpm+BFbDc0nzv+Zj7hzls2xjSuiKas5xu01JTF+ZdfYY8C/uiqqB00nx1E N17NNMpzx4H3scjiuUKdn8Fo2no0xFvHBVDdY= MIME-Version: 1.0 Received: by 10.223.63.202 with SMTP id c10mr740350fai.73.1255905972948; Sun, 18 Oct 2009 15:46:12 -0700 (PDT) In-Reply-To: <25EA1390-D96D-43FE-92DA-8A783D5BE04F@fastmail.fm> References: <25EA1390-D96D-43FE-92DA-8A783D5BE04F@fastmail.fm> Date: Sun, 18 Oct 2009 23:46:12 +0100 Message-ID: Subject: Re: Getting the address of a table with a __tostring From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9IMkiA6020398 On Sun, Oct 18, 2009 at 11:35 PM, Geoff Leyland wrote: > Hi, > > Has anyone got a better idea for getting the address of a table with a > __tostring in its metatable than this? > >> a = setmetatable({}, { __tostring = function() return "pretty but no >> address" end}) >> print(a) > pretty but no address >> function rawtostring(t) local mt = getmetatable(t) setmetatable(t, nil) >> local r = tostring(t) setmetatable(t, mt) return r end >> print(a, rawtostring(a), a) > pretty but no address   table: 0x115150 pretty but no address > > It works, but it's a bit mucky. > > Cheers, > Geoff > > Not if the metatable has __metatable set to protect it from being changed. In that case, you could use debug.getmetatable/debug.setmetatable instead. If you have access to the C API rather than looking for a pure-Lua solution, you could add a Lua function that wraps lua_topointer() to get the pointers for objects. I think this: lua_pushfstring(L, "%p", lua_topointer(L,1)); ...should push a string onto the stack in the same format as the pointer returned by the default tostring. -Duncan From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 21:03:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9IN39BC022411; Sun, 18 Oct 2009 21:03:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61CCF1A660; Sun, 18 Oct 2009 21:02:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70754187A1 for ; Sun, 18 Oct 2009 21:01:51 -0200 (BRST) Received: by ewy26 with SMTP id 26so3752063ewy.5 for ; Sun, 18 Oct 2009 16:02:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.85.69 with SMTP id t47mr1441084wee.107.1255906954352; Sun, 18 Oct 2009 16:02:34 -0700 (PDT) In-Reply-To: References: <25EA1390-D96D-43FE-92DA-8A783D5BE04F@fastmail.fm> Date: Mon, 19 Oct 2009 00:02:34 +0100 X-Google-Sender-Auth: c803b0f0397d5f08 Message-ID: Subject: Re: Getting the address of a table with a __tostring From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Oct 18, 2009 at 11:46 PM, Duncan Cross wrote: > Not if the metatable has __metatable set to protect it from being > changed. In that case, you could use > debug.getmetatable/debug.setmetatable instead. > > If you have access to the C API rather than looking for a pure-Lua > solution, you could add a Lua function that wraps lua_topointer() to > get the pointers for objects. I think this: If you don't have access to the C API, or the debug table, then you can (in theory) use bytecode hacks to get the address of any (garbage collectable) object, provided that you are using the standard Lua 5.1 interpreter / library, and sizeof(lua_Number) >= sizeof(void*). In short, OP_FORLOOP will interpret its arguments as lua_Numbers even when they are not, so a void* is reinterpreted as a number, said number is returned to Lua, and then we can perform some work to reinterpret it back to a void*. This method is at least an order of magnitude muckier than the method in the OP, but it could allow you to get addresses in situations you otherwise wouldn't. If you're interested, I can try and write some proof of concept code rather than just theorising, but I'm guessing that nobody needs code to do this. From lua-bounces@bazar2.conectiva.com.br Sun Oct 18 21:11:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9INBnBE023038; Sun, 18 Oct 2009 21:11:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C3B91A666; Sun, 18 Oct 2009 21:10:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 961B21A661 for ; Sun, 18 Oct 2009 21:10:10 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 04544B2F60 for ; Sun, 18 Oct 2009 19:10:57 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 18 Oct 2009 19:10:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=KXsg/43Gq1v+VOhL2ZtN0KMWUTU=; b=j4vAPd79OCXWD5P+750swZEt0zKmGL5UlXC9rkg9EOtKFh8VXtMl/XuFJSCOOINQHx1kyfZAx4WInGW33np6x40YzbjXX2ed5LwtrBkBBdrOLDze3VsMjnMRn9Y2VdVuxWN9G4ofj2f+GL7UbNOLO5IqFQXYYbPzBxfPdSn+zeY= X-Sasl-enc: rxuSCYPnlFKnV/Sszf8rqBZ8sx2V5lkAA1EfxUGU54/X 1255907456 Received: from [10.1.1.3] (222-152-77-118.jetstream.xtra.co.nz [222.152.77.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id D6804A7CF for ; Sun, 18 Oct 2009 19:10:55 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Getting the address of a table with a __tostring From: Geoff Leyland In-Reply-To: Date: Mon, 19 Oct 2009 12:10:22 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <25EA1390-D96D-43FE-92DA-8A783D5BE04F@fastmail.fm> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 19/10/2009, at 12:02 PM, Peter Cawley wrote: > On Sun, Oct 18, 2009 at 11:46 PM, Duncan Cross > wrote: >> Not if the metatable has __metatable set to protect it from being >> changed. In that case, you could use >> debug.getmetatable/debug.setmetatable instead. >> >> If you have access to the C API rather than looking for a pure-Lua >> solution, you could add a Lua function that wraps lua_topointer() to >> get the pointers for objects. I think this: > > If you don't have access to the C API, or the debug table, then you > can (in theory) use bytecode hacks to get the address of any (garbage > collectable) object, provided that you are using the standard Lua 5.1 > interpreter / library, and sizeof(lua_Number) >= sizeof(void*). In > short, OP_FORLOOP will interpret its arguments as lua_Numbers even > when they are not, so a void* is reinterpreted as a number, said > number is returned to Lua, and then we can perform some work to > reinterpret it back to a void*. This method is at least an order of > magnitude muckier than the method in the OP, but it could allow you to > get addresses in situations you otherwise wouldn't. If you're > interested, I can try and write some proof of concept code rather than > just theorising, but I'm guessing that nobody needs code to do this. Thanks Duncan and Peter, You both confirmed what I thought - there's no really clean way to do, so my mess is sufficient for my purposes (debugging). I control the objects, so I don't set __metatable. I could use the C API and lua_topointer, but what I've got is ok, and bytecode hacks just sounds scary! Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 01:47:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J3l8Co016150; Mon, 19 Oct 2009 01:47:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 491871923D; Mon, 19 Oct 2009 01:45:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from arrisi.com (ironmail.arrisi.com [216.234.147.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55CBB1917B for ; Mon, 19 Oct 2009 01:45:48 -0200 (BRST) Received: from ([10.0.248.166]) by ironmail.arrisi.com with ESMTP with TLS id 6NFSXF1.123418508; Sun, 18 Oct 2009 23:46:30 -0400 Received: from pdxexcas1.ARRS.ARRISI.COM (10.109.0.56) by atlexcas1.ARRS.ARRISI.COM (10.0.248.166) with Microsoft SMTP Server (TLS) id 8.1.336.0; Sun, 18 Oct 2009 23:46:30 -0400 Received: from PDXEXMAIL1.ARRS.ARRISI.COM ([10.109.0.52]) by pdxexcas1.ARRS.ARRISI.COM ([10.109.0.56]) with mapi; Sun, 18 Oct 2009 20:46:29 -0700 From: "Morita, Bill" To: "lua@bazar2.conectiva.com.br" Date: Sun, 18 Oct 2009 20:46:25 -0700 Subject: Table with text keys question Thread-Topic: Table with text keys question Thread-Index: AcpQbruNLmX5irnoQKWDp/mtkiFRFA== Message-ID: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-TM-AS-Product-Ver: SMEX-8.0.0.1285-5.600.1016-16956.004 X-TM-AS-Result: No--14.640400-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No Content-Type: multipart/alternative; boundary="_000_6660AA9431971E4C9A0BBC01A935F93390083F4112PDXEXMAIL1ARR_" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_6660AA9431971E4C9A0BBC01A935F93390083F4112PDXEXMAIL1ARR_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have an issue I do not seem to find a reasonable solution to in Lua 5.1 I wish to dynamically generate text keys and then put them in a table to be= retrieved by a generated text key. The nature of Lua is such that, while text keys are supported, they can onl= y be set in the source code. Because everything is an object in lua, two separate instances of x=3D"abc"= will generated different objects and Thus a[x] =3D 1 cannot be retrieved by a later by a[x] where x was re-assi= gned (even to the same string). There does not seem a function to "de-objectify" a value, nor does there se= em to be a way to dynamically execute a generated statement. Perhaps there is something I fail to understand. Thanks --------------- Bill Morita Cube 1040 503-495-9513 Bill.Morita@arrisi.com --_000_6660AA9431971E4C9A0BBC01A935F93390083F4112PDXEXMAIL1ARR_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have an issue I do not seem to find a reasonable sol= ution to in Lua 5.1

I wish to dynamically generate text keys and then put = them in a table to be retrieved by a generated text key.

 

The nature of Lua is such that, while text keys are supported, they can only be set in the source code.

Because everything is an object in lua, two separate instances of x=3D”abc” will generated different objects and

Thus a[x] =3D 1  cannot be retrieved by a later b= y a[x] where x was re-assigned (even to the same string).

 

There does not seem a function to “de-objectify&= #8221; a value, nor does there seem to be a way to dynamically execute a generated statement.

 

Perhaps there is something I fail to understand.<= /o:p>

 

Thanks

 

---------------

Bill Morita

Cube 1040

503-495-9513

Bill.Morita@arrisi.com

 

--_000_6660AA9431971E4C9A0BBC01A935F93390083F4112PDXEXMAIL1ARR_-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 01:52:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J3qA68016544; Mon, 19 Oct 2009 01:52:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCA841926F; Mon, 19 Oct 2009 01:51:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 846531912F for ; Mon, 19 Oct 2009 01:51:02 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 1BDA1A7A29 for ; Sun, 18 Oct 2009 23:51:49 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 18 Oct 2009 23:51:49 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=ODOQnHe312vJp43fGnNnakskAQs=; b=PK4xwQI72mjNuxcjcsNEX9mbS9OuUUWZBqLyHjVd059thf3Elvz90L7+u4wGf0D9SoXSR3792C/+yMdEya8lZta8NiCW7uyXTGssIYnmPT81TlSHJnRpzdf8Rgaz81KkSDrOOsi5XWa9s+tSiL0CxsUufv/ig58iHa+0mc8t+e8= X-Sasl-enc: AWZeq7oEGVNOTnD3ypXeZk3c2lERl9GpV7+2Lzw+LF7W 1255924308 Received: from [10.1.1.3] (222-152-77-118.jetstream.xtra.co.nz [222.152.77.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id 10B0169E3 for ; Sun, 18 Oct 2009 23:51:47 -0400 (EDT) Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Table with text keys question From: Geoff Leyland In-Reply-To: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> Date: Mon, 19 Oct 2009 16:51:15 +1300 Message-Id: References: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9J3qA68016544 On 19/10/2009, at 4:46 PM, Morita, Bill wrote: > I have an issue I do not seem to find a reasonable solution to in > Lua 5.1 > I wish to dynamically generate text keys and then put them in a > table to be retrieved by a generated text key. > > The nature of Lua is such that, while text keys are supported, they > can only be set in the source code. > Because everything is an object in lua, two separate instances of > x=”abc” will generated different objects and > Thus a[x] = 1 cannot be retrieved by a later by a[x] where x was re- > assigned (even to the same string). > > There does not seem a function to “de-objectify” a value, nor does > there seem to be a way to dynamically execute a generated statement. > > Perhaps there is something I fail to understand. > > Thanks Hi Bill, I'm not quite sure I understand what you mean, but if it helps, all of the following work: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > a = "abc" > x = {} > x[a] = 13 > =x[a] 13 > =x.abc 13 > =x["abc"] 13 > b = "abc" > =x[b] 13 Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 04:11:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J6B1OI029895; Mon, 19 Oct 2009 04:11:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3A1A190F9; Mon, 19 Oct 2009 04:09:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DFFD19051 for ; Mon, 19 Oct 2009 04:09:39 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 87AE5170C510 for ; Mon, 19 Oct 2009 02:10:25 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9J6APGu030335 for lua@bazar2.conectiva.com.br; Mon, 19 Oct 2009 02:10:25 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Mon, 19 Oct 2009 02:10:24 -0400 From: Sean Conner To: Lua list Subject: Re: Table with text keys question Message-ID: <20091019061024.GA28228@brevard.conman.org> References: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Morita, Bill once stated: > I have an issue I do not seem to find a reasonable solution to in Lua 5.1 > I wish to dynamically generate text keys and then put them in a table to be retrieved by a generated text key. > > The nature of Lua is such that, while text keys are supported, they can only be set in the source code. > Because everything is an object in lua, two separate instances of x="abc" will generated different objects and > Thus a[x] = 1 cannot be retrieved by a later by a[x] where x was re-assigned (even to the same string). > > There does not seem a function to "de-objectify" a value, nor does there seem to be a way to dynamically execute a generated statement. > > Perhaps there is something I fail to understand. I'm not sure what you are asking. Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > a = {} > x = "abc" > a[x] = "the one and only X" > =a[x] the one and only X > x = nil > x = string.lower("ABC") > =a[x] the one and only X > Seems to work to me. -spc From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 04:40:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J6eUFp000376; Mon, 19 Oct 2009 04:40:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71C4819295; Mon, 19 Oct 2009 04:39:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95E94191F0 for ; Mon, 19 Oct 2009 04:39:13 -0200 (BRST) Received: by fxm23 with SMTP id 23so4758661fxm.6 for ; Sun, 18 Oct 2009 23:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GNMeDJfsS+7PM+fdDp/v/ZZHxhWI1FHU+W1FiS/GoXI=; b=rg4m8AUXxoqXrU5zhQ+Wnp4dFPE3nb11k6G5iyjKc08AKz0aZuh0l4JrU1LQY5YKPl DdzKb1qBctci7bNu+yEVpzDRHsO8gqbk0+Dto5K3rcIhKEwa3PqMhYot1PZdazYjKuzA H3aBmMDlGKHdrXlSfG5754txsSbBiiTLVSK0E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=T3Lo/B80I8ryX1teHaGOuSlFof0tmd/htwJH7ULwvMtOLzWzBqk53wXik8dPWN1JY4 BwyWIe3BbAOxoK7iuuUUEjOiRuufv7caC9JoS/4LindLJlyLBmzyZa2QbopX/i7uDPVu R9rvukpfFWzHiP9tUt3M0SuGbaqvcG+b5QJEg= MIME-Version: 1.0 Received: by 10.239.183.26 with SMTP id s26mr347356hbg.179.1255934397858; Sun, 18 Oct 2009 23:39:57 -0700 (PDT) In-Reply-To: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> References: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> Date: Mon, 19 Oct 2009 08:39:57 +0200 Message-ID: <560972290910182339icff5138u53603cdfec7f4bc3@mail.gmail.com> Subject: Re: Table with text keys question From: steve donovan To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9J6eUFp000376 On Mon, Oct 19, 2009 at 5:46 AM, Morita, Bill wrote: > Because everything is an object in lua, two separate instances of x=”abc” > will generated different objects and> > Thus a[x] = 1  cannot be retrieved by a later by a[x] where x was > re-assigned (even to the same string). Strings work fine as unique keys, because they are interned (there is only one actual copy of each unique string kept). From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 04:53:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J6rKrC001155; Mon, 19 Oct 2009 04:53:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 200B4192AD; Mon, 19 Oct 2009 04:52:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51DA9190F9 for ; Mon, 19 Oct 2009 04:52:03 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so1142223fgg.17 for ; Sun, 18 Oct 2009 23:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bTDASVQFemkMjRz2Hfx8PpXySYWIlUTpZnD2O8MPyX4=; b=bPO46q4YFW6p/eqZZs9XQ0ClserGbj8MC8aEXQe4RZ6uGeCD0IZ0euuKvNtO5yUQr9 IgvowTfXQhhBq78MEUhlJm2R5EHRPs/uDyqe/xKQZx6ccjVQ2JB969LWh3Uq19SJNmey jJtPfkPivOJN5rRdNAhxVm3+JWaAzQJlK465E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=M19BWn7LGouAIIBes7R/0G7axSQqQT1gziZX+vclkhYe+0te5F8UeTbCkbCUMAS+CX YUYbrsVF5G0ZurgX7bqTww5IWZI9BP0HbHSb9oQDJiWREU8ohU4AnnlLy4991LcZjxJt hdbaiUXlkOg5QikOn7wVyYNGWcvgBzxVACYpw= MIME-Version: 1.0 Received: by 10.86.234.9 with SMTP id g9mr2890428fgh.39.1255935168529; Sun, 18 Oct 2009 23:52:48 -0700 (PDT) In-Reply-To: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> References: <6660AA9431971E4C9A0BBC01A935F93390083F4112@PDXEXMAIL1.ARRS.ARRISI.COM> Date: Mon, 19 Oct 2009 08:52:48 +0200 Message-ID: <9386fb2d0910182352yf7d6db2i90f73ccc1b73ab19@mail.gmail.com> Subject: Re: Table with text keys question From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9J6rKrC001155 > There does not seem a function to “de-objectify” a value, nor does there > seem to be a way to dynamically execute a generated statement. Not sure what you mean with the last part of this sentence, but as i've understood it.. you want to load lua strings and execute them? Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio > func = loadstring("print('dynamically generated code!'); function newfunc(param) print(param) end") > newfunc(5) stdin:1: attempt to call global 'newfunc' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > func() dynamically generated code! > newfunc(5) 5 /Pierre From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 07:05:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J95Eh6012613; Mon, 19 Oct 2009 07:05:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2CCD192C5; Mon, 19 Oct 2009 07:04:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5BC319295 for ; Mon, 19 Oct 2009 07:03:54 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id BEA9D88116 for ; Mon, 19 Oct 2009 10:04:40 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Help: Crash in garbage collection Date: Mon, 19 Oct 2009 10:04:28 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection Thread-Index: AcpOftSwYUoS7J9eT/WRHGCgWHZQDQCGr8cA References: <20091016132214.GA17582@inf.puc-rio.br><20091016163352.GA18451@inf.puc-rio.br> <20091016133622.A6074@lua.tecgraf.puc-rio.br> From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9J95Eh6012613 I defined "lua_assert" in lua.h and rebuilt but it didn't produce any different results. Was that the right define to use? > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique de > Figueiredo > Sent: 16 October 2009 17:36 > To: Lua list > Subject: Re: Help: Crash in garbage collection > > If you are saving the file with C code then rebuild Lua with API > asserts on > and see if that helps. From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 07:27:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J9R28i014528; Mon, 19 Oct 2009 07:27:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFF3A1934E; Mon, 19 Oct 2009 07:25:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2BD5192D0 for ; Mon, 19 Oct 2009 07:25:11 -0200 (BRST) Received: by ewy26 with SMTP id 26so4080030ewy.5 for ; Mon, 19 Oct 2009 02:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=hWusGfLAWWIHBbkAwhq9ZX5f9u/NBrcThcdUGZJF37U=; b=NOVR4f3ai6kzW7yDrcjMrFHiHYSkMCusblkN5rYN0PJMxigNLPJ17r4zXx5+Ed2D3L ZbYB50IG4/EMyyIoUNZ5MMhXsagMKNIW1Rq2E4Vb09kbC3UUVVECxOvWMUFZ+QoF0VEn xRPAR2n8c1M48DybTmwj6B0fTX7xcJdspD338= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ZqudG3J8DRIVLllemBu2d/xOu0RnCYt9L5qgecHLBY7TArPE5ruIv/qt6d5DuZxWvU YXgJIrl68naN1GzYwK+B/T0urTXbC0jl15RMXdUlB8hoswsIGm+jlhrwj/Lov3POLtgn Zn3buLeI+0rdPbve3abgzAv30JZW1KVlKxYn4= MIME-Version: 1.0 Received: by 10.216.89.137 with SMTP id c9mr1705289wef.228.1255944356120; Mon, 19 Oct 2009 02:25:56 -0700 (PDT) In-Reply-To: <76882e540910160642g6239d298qbcba594b0085c07d@mail.gmail.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> <4AD69BA5.8070501@sct.microlink.com.br> <76882e540910160642g6239d298qbcba594b0085c07d@mail.gmail.com> From: Jerome Vuarand Date: Mon, 19 Oct 2009 11:25:35 +0200 Message-ID: <89d273ba0910190225j113dc796w2d01ed8505b20ca@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port To: Lua list Content-Type: multipart/mixed; boundary=0016e6d9714f344888047646556b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d9714f344888047646556b Content-Type: text/plain; charset=UTF-8 2009/10/16 uri cohen : > Following the feedback that using UTF8 is better than porting LUA to UTF16, > is there a LUA port or library which allows the user to: > - define UTF8 literals; > - open files with UTF8 names; > - read and write Windows unicode text using only LUA strings > - bind with external C code which work in UTF16 I wrote such a patch, it is attached to this mail. It adds the following to the Lua API, declared in standard lua headers but implemented in lwstring.c: #define LUA_HAS_WSTRING 1 LUA_API const wchar_t *(lua_towstring) (lua_State *L, int index); LUA_API const wchar_t *(lua_tolwstring) (lua_State *L, int index, size_t *length); LUA_API void (lua_pushwstring) (lua_State *L, const wchar_t *value); LUA_API void (lua_pushlwstring) (lua_State *L, const wchar_t *value, size_t size); LUALIB_API const wchar_t *(luaL_optwstring) (lua_State *L, int index, const wchar_t *def); LUALIB_API const wchar_t *(luaL_checkwstring) (lua_State *L, int index); LUALIB_API const wchar_t *(luaL_checklwstring) (lua_State *L, int index, size_t *length); LUALIB_API int (luaL_loadwfile) (lua_State *L, const wchar_t *filename); #define luaL_dowfile(L, fn) \ (luaL_loadwfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) A "wstring" is a userdata which contains a NULL-terminated string of wchar_t. lua_towstring converts a string on the stack to a wide char string. It does replace the string on the stack, similarly to lua_tostring and lua_tonumber when they are passed a number or a string respectively, so the same restrictions apply (don't use on keys in a lua_next loop). On windows these functions use MultiByteToWideChar and WideCharToMultiByte to convert between utf-8 and utf-16. On other platforms the functions use mbstowcs and wcstombs, which convert between the current multi-byte locale and wide strings, usually ucs-4. On windows only, the patch modifies all calls to the C library that uses filenames, and convert these filenames using wstring conversion functions. It's only been tested on windows so far (both the MultiByteToWideChar/WideCharToMultiByte and mbstowcs/wcstombs versions compile there). It's not perfect (I think it may leak if a lua_pushstring errors), and I didn't patch the Makefile since I'm not using it. Any feedback is welcome. --0016e6d9714f344888047646556b Content-Type: application/octet-stream; name="lua-wstring.patch" Content-Disposition: attachment; filename="lua-wstring.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g0z0rkdc0 ZGlmZiAtZHVyTiBhL2x1YS01LjEuNC9zcmMvbGF1eGxpYi5jIGIvbHVhLTUuMS40L3NyYy9sYXV4 bGliLmMNCi0tLSBhL2x1YS01LjEuNC9zcmMvbGF1eGxpYi5jCU1vbiBKYW4gMjEgMTQ6MjA6NTEg MjAwOA0KKysrIGIvbHVhLTUuMS40L3NyYy9sYXV4bGliLmMJVGh1IE9jdCAgOCAwMjo0NTozNSAy MDA5DQpAQCAtNTYwLDggKzU2MCwxOCBAQA0KICAgICBsZi5mID0gc3RkaW47DQogICB9DQogICBl bHNlIHsNCisjaWZkZWYgX1dJTjMyDQorICAgIGNvbnN0IHdjaGFyX3QqIHdmaWxlbmFtZTsNCisj ZW5kaWYNCiAgICAgbHVhX3B1c2hmc3RyaW5nKEwsICJAJXMiLCBmaWxlbmFtZSk7DQorI2lmZGVm IF9XSU4zMg0KKyAgICBsdWFfcHVzaHN0cmluZyhMLCBmaWxlbmFtZSk7DQorICAgIHdmaWxlbmFt ZSA9IGx1YUxfY2hlY2t3c3RyaW5nKEwsIC0xKTsNCisgICAgbGYuZiA9IF93Zm9wZW4od2ZpbGVu YW1lLCBMInIiKTsNCisgICAgbHVhX3BvcChMLCAxKTsNCisjZWxzZQ0KICAgICBsZi5mID0gZm9w ZW4oZmlsZW5hbWUsICJyIik7DQorI2VuZGlmDQogICAgIGlmIChsZi5mID09IE5VTEwpIHJldHVy biBlcnJmaWxlKEwsICJvcGVuIiwgZm5hbWVpbmRleCk7DQogICB9DQogICBjID0gZ2V0YyhsZi5m KTsNCmRpZmYgLWR1ck4gYS9sdWEtNS4xLjQvc3JjL2xhdXhsaWIuaCBiL2x1YS01LjEuNC9zcmMv bGF1eGxpYi5oDQotLS0gYS9sdWEtNS4xLjQvc3JjL2xhdXhsaWIuaAlUaHUgRGVjIDI3IDE0OjAy OjI1IDIwMDcNCisrKyBiL2x1YS01LjEuNC9zcmMvbGF1eGxpYi5oCVRodSBPY3QgIDggMDI6NDU6 MzUgMjAwOQ0KQEAgLTE1Myw2ICsxNTMsMjQgQEANCiAvKiB9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovDQogDQogDQorLyoNCisqKiB7PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PQ0KKyoqIHdzdHJpbmcgcGF0Y2ggQVBJDQorKiogPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisq Lw0KKw0KKw0KK0xVQUxJQl9BUEkgY29uc3Qgd2NoYXJfdCAqKGx1YUxfb3B0d3N0cmluZykgKGx1 YV9TdGF0ZSAqTCwgaW50IGluZGV4LCBjb25zdCB3Y2hhcl90ICpkZWYpOw0KK0xVQUxJQl9BUEkg Y29uc3Qgd2NoYXJfdCAqKGx1YUxfY2hlY2t3c3RyaW5nKSAobHVhX1N0YXRlICpMLCBpbnQgaW5k ZXgpOw0KK0xVQUxJQl9BUEkgY29uc3Qgd2NoYXJfdCAqKGx1YUxfY2hlY2tsd3N0cmluZykgKGx1 YV9TdGF0ZSAqTCwgaW50IGluZGV4LCBzaXplX3QgKmxlbmd0aCk7DQorTFVBTElCX0FQSSBpbnQJ KGx1YUxfbG9hZHdmaWxlKSAobHVhX1N0YXRlICpMLCBjb25zdCB3Y2hhcl90ICpmaWxlbmFtZSk7 DQorDQorI2RlZmluZSBsdWFMX2Rvd2ZpbGUoTCwgZm4pCVwNCisJKGx1YUxfbG9hZHdmaWxlKEws IGZuKSB8fCBsdWFfcGNhbGwoTCwgMCwgTFVBX01VTFRSRVQsIDApKQ0KKw0KKy8qIH09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09ICovDQorDQorDQogLyogY29tcGF0aWJpbGl0eSB3aXRoIHJlZiBzeXN0ZW0gKi8NCiAN CiAvKiBwcmUtZGVmaW5lZCByZWZlcmVuY2VzICovDQpkaWZmIC1kdXJOIGEvbHVhLTUuMS40L3Ny Yy9sYmFzZWxpYi5jIGIvbHVhLTUuMS40L3NyYy9sYmFzZWxpYi5jDQotLS0gYS9sdWEtNS4xLjQv c3JjL2xiYXNlbGliLmMJVGh1IEZlYiAxNCAxNzo0NjoyMiAyMDA4DQorKysgYi9sdWEtNS4xLjQv c3JjL2xiYXNlbGliLmMJVGh1IE9jdCAgOCAwMjo0NTozNSAyMDA5DQpAQCAtMzIzLDkgKzMyMywx NyBAQA0KIA0KIA0KIHN0YXRpYyBpbnQgbHVhQl9kb2ZpbGUgKGx1YV9TdGF0ZSAqTCkgew0KKyNp ZmRlZiBfV0lOMzINCisgIGNvbnN0IHdjaGFyX3QgKmZuYW1lID0gbHVhTF9vcHR3c3RyaW5nKEws IDEsIE5VTEwpOw0KKyNlbHNlDQogICBjb25zdCBjaGFyICpmbmFtZSA9IGx1YUxfb3B0c3RyaW5n KEwsIDEsIE5VTEwpOw0KKyNlbmRpZg0KICAgaW50IG4gPSBsdWFfZ2V0dG9wKEwpOw0KKyNpZmRl ZiBfV0lOMzINCisgIGlmIChsdWFMX2xvYWR3ZmlsZShMLCBmbmFtZSkgIT0gMCkgbHVhX2Vycm9y KEwpOw0KKyNlbHNlDQogICBpZiAobHVhTF9sb2FkZmlsZShMLCBmbmFtZSkgIT0gMCkgbHVhX2Vy cm9yKEwpOw0KKyNlbmRpZg0KICAgbHVhX2NhbGwoTCwgMCwgTFVBX01VTFRSRVQpOw0KICAgcmV0 dXJuIGx1YV9nZXR0b3AoTCkgLSBuOw0KIH0NCmRpZmYgLWR1ck4gYS9sdWEtNS4xLjQvc3JjL2xp b2xpYi5jIGIvbHVhLTUuMS40L3NyYy9saW9saWIuYw0KLS0tIGEvbHVhLTUuMS40L3NyYy9saW9s aWIuYwlGcmkgSmFuIDE4IDE4OjQ3OjQzIDIwMDgNCisrKyBiL2x1YS01LjEuNC9zcmMvbGlvbGli LmMJVGh1IE9jdCAgOCAwMjo0NTozNSAyMDA5DQpAQCAtMTU5LDEwICsxNTksMjMgQEANCiANCiAN CiBzdGF0aWMgaW50IGlvX29wZW4gKGx1YV9TdGF0ZSAqTCkgew0KKyNpZmRlZiBfV0lOMzINCisg IGNvbnN0IGNoYXIgKmZpbGVuYW1lID0gbHVhTF9jaGVja3N0cmluZyhMLCAxKTsNCisgIGNvbnN0 IHdjaGFyX3QgKm1vZGUgPSBsdWFMX29wdHdzdHJpbmcoTCwgMiwgTCJyIik7DQorICBjb25zdCB3 Y2hhcl90ICp3ZmlsZW5hbWU7DQorI2Vsc2UNCiAgIGNvbnN0IGNoYXIgKmZpbGVuYW1lID0gbHVh TF9jaGVja3N0cmluZyhMLCAxKTsNCiAgIGNvbnN0IGNoYXIgKm1vZGUgPSBsdWFMX29wdHN0cmlu ZyhMLCAyLCAiciIpOw0KKyNlbmRpZg0KICAgRklMRSAqKnBmID0gbmV3ZmlsZShMKTsNCisjaWZk ZWYgX1dJTjMyDQorICBsdWFfcHVzaHZhbHVlKEwsIDEpOw0KKyAgd2ZpbGVuYW1lID0gbHVhTF9j aGVja3dzdHJpbmcoTCwgLTEpOw0KKyAgKnBmID0gX3dmb3Blbih3ZmlsZW5hbWUsIG1vZGUpOw0K KyAgbHVhX3BvcChMLCAxKTsNCisjZWxzZQ0KICAgKnBmID0gZm9wZW4oZmlsZW5hbWUsIG1vZGUp Ow0KKyNlbmRpZg0KICAgcmV0dXJuICgqcGYgPT0gTlVMTCkgPyBwdXNocmVzdWx0KEwsIDAsIGZp bGVuYW1lKSA6IDE7DQogfQ0KIA0KZGlmZiAtZHVyTiBhL2x1YS01LjEuNC9zcmMvbG9hZGxpYi5j IGIvbHVhLTUuMS40L3NyYy9sb2FkbGliLmMNCi0tLSBhL2x1YS01LjEuNC9zcmMvbG9hZGxpYi5j CVdlZCBBdWcgIDYgMTU6Mjk6MjggMjAwOA0KKysrIGIvbHVhLTUuMS40L3NyYy9sb2FkbGliLmMJ VGh1IE9jdCAgOCAwMjo0NTozNSAyMDA5DQpAQCAtOTUsMjYgKzk1LDMxIEBADQogI3VuZGVmIHNl dHByb2dkaXINCiANCiBzdGF0aWMgdm9pZCBzZXRwcm9nZGlyIChsdWFfU3RhdGUgKkwpIHsNCi0g IGNoYXIgYnVmZltNQVhfUEFUSCArIDFdOw0KLSAgY2hhciAqbGI7DQotICBEV09SRCBuc2l6ZSA9 IHNpemVvZihidWZmKS9zaXplb2YoY2hhcik7DQotICBEV09SRCBuID0gR2V0TW9kdWxlRmlsZU5h bWVBKE5VTEwsIGJ1ZmYsIG5zaXplKTsNCi0gIGlmIChuID09IDAgfHwgbiA9PSBuc2l6ZSB8fCAo bGIgPSBzdHJyY2hyKGJ1ZmYsICdcXCcpKSA9PSBOVUxMKQ0KKyAgd2NoYXJfdCBidWZmW01BWF9Q QVRIICsgMV07DQorICB3Y2hhcl90ICpsYjsNCisgIERXT1JEIG5zaXplID0gTUFYX1BBVEggKyAx Ow0KKyAgRFdPUkQgbiA9IEdldE1vZHVsZUZpbGVOYW1lVyhOVUxMLCBidWZmLCBuc2l6ZSk7DQor ICBpZiAobiA9PSAwIHx8IG4gPT0gbnNpemUgfHwgKGxiID0gd2NzcmNocihidWZmLCBMJ1xcJykp ID09IE5VTEwpDQogICAgIGx1YUxfZXJyb3IoTCwgInVuYWJsZSB0byBnZXQgTW9kdWxlRmlsZU5h bWUiKTsNCiAgIGVsc2Ugew0KLSAgICAqbGIgPSAnXDAnOw0KLSAgICBsdWFMX2dzdWIoTCwgbHVh X3Rvc3RyaW5nKEwsIC0xKSwgTFVBX0VYRUNESVIsIGJ1ZmYpOw0KLSAgICBsdWFfcmVtb3ZlKEws IC0yKTsgIC8qIHJlbW92ZSBvcmlnaW5hbCBzdHJpbmcgKi8NCisgICAgKmxiID0gTCdcMCc7DQor ICAgIGx1YV9wdXNod3N0cmluZyhMLCBidWZmKTsNCisgICAgbHVhTF9nc3ViKEwsIGx1YV90b3N0 cmluZyhMLCAtMiksIExVQV9FWEVDRElSLCBsdWFfdG9zdHJpbmcoTCwgLTEpKTsNCisgICAgbHVh X3JlbW92ZShMLCAtMyk7ICAvKiByZW1vdmUgb3JpZ2luYWwgc3RyaW5nICovDQorICAgIGx1YV9y ZW1vdmUoTCwgLTIpOyAgLyogcmVtb3ZlIHV0Zi04IGNvcHkgb2YgYnVmZiAqLw0KICAgfQ0KIH0N CiANCiANCiBzdGF0aWMgdm9pZCBwdXNoZXJyb3IgKGx1YV9TdGF0ZSAqTCkgew0KICAgaW50IGVy cm9yID0gR2V0TGFzdEVycm9yKCk7DQotICBjaGFyIGJ1ZmZlclsxMjhdOw0KLSAgaWYgKEZvcm1h dE1lc3NhZ2VBKEZPUk1BVF9NRVNTQUdFX0lHTk9SRV9JTlNFUlRTIHwgRk9STUFUX01FU1NBR0Vf RlJPTV9TWVNURU0sDQotICAgICAgTlVMTCwgZXJyb3IsIDAsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZl ciksIE5VTEwpKQ0KLSAgICBsdWFfcHVzaHN0cmluZyhMLCBidWZmZXIpOw0KKyAgd2NoYXJfdCog YnVmZmVyOw0KKyAgaWYgKEZvcm1hdE1lc3NhZ2VXKEZPUk1BVF9NRVNTQUdFX0lHTk9SRV9JTlNF UlRTIHwgRk9STUFUX01FU1NBR0VfRlJPTV9TWVNURU0gfCBGT1JNQVRfTUVTU0FHRV9BTExPQ0FU RV9CVUZGRVIsDQorICAgICAgTlVMTCwgZXJyb3IsIDAsICh3Y2hhcl90KikmYnVmZmVyLCAwLCBO VUxMKSkNCisgIHsNCisgICAgbHVhX3B1c2h3c3RyaW5nKEwsIGJ1ZmZlcik7DQorICAgIExvY2Fs RnJlZSgoSExPQ0FMKWJ1ZmZlcik7DQorICB9DQogICBlbHNlDQogICAgIGx1YV9wdXNoZnN0cmlu ZyhMLCAic3lzdGVtIGVycm9yICVkXG4iLCBlcnJvcik7DQogfQ0KQEAgLTEyMyw5ICsxMjgsMTMg QEANCiAgIEZyZWVMaWJyYXJ5KChISU5TVEFOQ0UpbGliKTsNCiB9DQogDQotDQogc3RhdGljIHZv aWQgKmxsX2xvYWQgKGx1YV9TdGF0ZSAqTCwgY29uc3QgY2hhciAqcGF0aCkgew0KLSAgSElOU1RB TkNFIGxpYiA9IExvYWRMaWJyYXJ5QShwYXRoKTsNCisgIGNvbnN0IHdjaGFyX3QqIHdwYXRoOw0K KyAgSElOU1RBTkNFIGxpYjsNCisgIGx1YV9wdXNoc3RyaW5nKEwsIHBhdGgpOw0KKyAgd3BhdGgg PSBsdWFfdG93c3RyaW5nKEwsIC0xKTsNCisgIGxpYiA9IExvYWRMaWJyYXJ5Vyh3cGF0aCk7DQor ICBsdWFfcG9wKEwsIDEpOw0KICAgaWYgKGxpYiA9PSBOVUxMKSBwdXNoZXJyb3IoTCk7DQogICBy ZXR1cm4gbGliOw0KIH0NCmRpZmYgLWR1ck4gYS9sdWEtNS4xLjQvc3JjL2xvc2xpYi5jIGIvbHVh LTUuMS40L3NyYy9sb3NsaWIuYw0KLS0tIGEvbHVhLTUuMS40L3NyYy9sb3NsaWIuYwlGcmkgSmFu IDE4IDE3OjM4OjE4IDIwMDgNCisrKyBiL2x1YS01LjEuNC9zcmMvbG9zbGliLmMJVGh1IE9jdCAg OCAwMjo1MDoxOCAyMDA5DQpAQCAtNDMsMTQgKzQzLDM1IEBADQogDQogc3RhdGljIGludCBvc19y ZW1vdmUgKGx1YV9TdGF0ZSAqTCkgew0KICAgY29uc3QgY2hhciAqZmlsZW5hbWUgPSBsdWFMX2No ZWNrc3RyaW5nKEwsIDEpOw0KKyNpZmRlZiBfV0lOMzINCisgIGNvbnN0IHdjaGFyX3QgKndmaWxl bmFtZTsNCisgIGludCByZXN1bHQ7DQorICBsdWFfcHVzaHZhbHVlKEwsIDEpOw0KKyAgd2ZpbGVu YW1lID0gbHVhTF9jaGVja3dzdHJpbmcoTCwgLTEpOw0KKyAgcmVzdWx0ID0gX3dyZW1vdmUod2Zp bGVuYW1lKTsNCisgIGx1YV9wb3AoTCwgMSk7DQorICByZXR1cm4gb3NfcHVzaHJlc3VsdChMLCBy ZXN1bHQgPT0gMCwgZmlsZW5hbWUpOw0KKyNlbHNlDQogICByZXR1cm4gb3NfcHVzaHJlc3VsdChM LCByZW1vdmUoZmlsZW5hbWUpID09IDAsIGZpbGVuYW1lKTsNCisjZW5kaWYNCiB9DQogDQogDQog c3RhdGljIGludCBvc19yZW5hbWUgKGx1YV9TdGF0ZSAqTCkgew0KICAgY29uc3QgY2hhciAqZnJv bW5hbWUgPSBsdWFMX2NoZWNrc3RyaW5nKEwsIDEpOw0KKyNpZmRlZiBfV0lOMzINCisgIGNvbnN0 IHdjaGFyX3QgKnRvbmFtZSA9IGx1YUxfY2hlY2t3c3RyaW5nKEwsIDIpOw0KKyAgY29uc3Qgd2No YXJfdCAqd2Zyb21uYW1lOw0KKyAgaW50IHJlc3VsdDsNCisgIGx1YV9wdXNodmFsdWUoTCwgMSk7 DQorICB3ZnJvbW5hbWUgPSBsdWFMX2NoZWNrd3N0cmluZyhMLCAtMSk7DQorICByZXN1bHQgPSBf d3JlbmFtZSh3ZnJvbW5hbWUsIHRvbmFtZSk7DQorICBsdWFfcG9wKEwsIDEpOw0KKyAgcmV0dXJu IG9zX3B1c2hyZXN1bHQoTCwgcmVzdWx0ID09IDAsIGZyb21uYW1lKTsNCisjZWxzZQ0KICAgY29u c3QgY2hhciAqdG9uYW1lID0gbHVhTF9jaGVja3N0cmluZyhMLCAyKTsNCiAgIHJldHVybiBvc19w dXNocmVzdWx0KEwsIHJlbmFtZShmcm9tbmFtZSwgdG9uYW1lKSA9PSAwLCBmcm9tbmFtZSk7DQor I2VuZGlmDQogfQ0KIA0KIA0KZGlmZiAtZHVyTiBhL2x1YS01LjEuNC9zcmMvbHVhLmggYi9sdWEt NS4xLjQvc3JjL2x1YS5oDQotLS0gYS9sdWEtNS4xLjQvc3JjL2x1YS5oCVdlZCBBdWcgIDYgMTU6 MzA6MTIgMjAwOA0KKysrIGIvbHVhLTUuMS40L3NyYy9sdWEuaAlUaHUgT2N0ICA4IDAyOjQ1OjM1 IDIwMDkNCkBAIC0zMDAsNiArMzAwLDIzIEBADQogDQogLyoNCiAqKiB7PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0K KyoqIHdzdHJpbmcgcGF0Y2ggQVBJDQorKiogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisqLw0KKw0KKw0KKyNk ZWZpbmUgTFVBX0hBU19XU1RSSU5HIDENCisNCitMVUFfQVBJIGNvbnN0IHdjaGFyX3QgKihsdWFf dG93c3RyaW5nKSAobHVhX1N0YXRlICpMLCBpbnQgaW5kZXgpOw0KK0xVQV9BUEkgY29uc3Qgd2No YXJfdCAqKGx1YV90b2x3c3RyaW5nKSAobHVhX1N0YXRlICpMLCBpbnQgaW5kZXgsIHNpemVfdCAq bGVuZ3RoKTsNCitMVUFfQVBJIHZvaWQgKGx1YV9wdXNod3N0cmluZykgKGx1YV9TdGF0ZSAqTCwg Y29uc3Qgd2NoYXJfdCAqdmFsdWUpOw0KK0xVQV9BUEkgdm9pZCAobHVhX3B1c2hsd3N0cmluZykg KGx1YV9TdGF0ZSAqTCwgY29uc3Qgd2NoYXJfdCAqdmFsdWUsIHNpemVfdCBzaXplKTsNCisNCisv KiB9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PSAqLw0KKw0KKw0KKy8qDQorKiogez09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCiAqKiBE ZWJ1ZyBBUEkNCiAqKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KICovDQpkaWZmIC1kdXJOIGEvbHVhLTUuMS40 L3NyYy9sd3N0cmluZy5jIGIvbHVhLTUuMS40L3NyYy9sd3N0cmluZy5jDQotLS0gYS9sdWEtNS4x LjQvc3JjL2x3c3RyaW5nLmMJVGh1IEphbiAgMSAwMTowMDowMCAxOTcwDQorKysgYi9sdWEtNS4x LjQvc3JjL2x3c3RyaW5nLmMJVGh1IE9jdCAgOCAwMjo0NTozNSAyMDA5DQpAQCAtMCwwICsxLDEz MyBAQA0KKyNkZWZpbmUgTFVBX0NPUkUNCisjaW5jbHVkZSAibHVhLmgiDQorI2luY2x1ZGUgImxh dXhsaWIuaCINCisNCisjaWZkZWYgX1dJTjMyDQorI2luY2x1ZGUgPHdpbmRvd3MuaD4NCisjZWxz ZQ0KKyNpbmNsdWRlIDxzdGRsaWIuaD4NCisjZW5kaWYNCisNCitMVUFfQVBJIGNvbnN0IHdjaGFy X3QgKmx1YV90b2x3c3RyaW5nIChsdWFfU3RhdGUgKkwsIGludCBpbmRleCwgc2l6ZV90ICpsZW5n dGgpIHsNCisgIHN3aXRjaCAobHVhX3R5cGUoTCwgaW5kZXgpKSB7DQorICBjYXNlIExVQV9UU1RS SU5HOiB7DQorICAgIGNvbnN0IGNoYXIgKnV0Zjg7DQorICAgIHNpemVfdCBzaXplOCwgc2l6ZTE2 Ow0KKyAgICB3Y2hhcl90ICp1dGYxNjsNCisgICAgdXRmOCA9IGx1YV90b2xzdHJpbmcoTCwgaW5k ZXgsICZzaXplOCk7DQorI2lmZGVmIF9XSU4zMg0KKyAgICBzaXplMTYgPSBNdWx0aUJ5dGVUb1dp ZGVDaGFyKENQX1VURjgsIDAsIHV0ZjgsIHNpemU4LCAwLCAwKTsNCisjZWxzZQ0KKyAgICBzaXpl MTYgPSBtYnN0b3djcyhOVUxMLCB1dGY4LCBzaXplOCk7DQorI2VuZGlmDQorICAgIGlmIChzaXpl MTYgPiBJTlRfTUFYKQ0KKyAgICAgIHNpemUxNiA9IElOVF9NQVg7DQorICAgIHV0ZjE2ID0gKHdj aGFyX3QqKWx1YV9uZXd1c2VyZGF0YShMLCAoc2l6ZTE2KzEpICogc2l6ZW9mKHdjaGFyX3QpKTsN CisjaWZkZWYgX1dJTjMyDQorICAgIE11bHRpQnl0ZVRvV2lkZUNoYXIoQ1BfVVRGOCwgMCwgdXRm OCwgc2l6ZTgsIHV0ZjE2LCAoaW50KXNpemUxNik7DQorI2Vsc2UNCisgICAgc2l6ZTE2ID0gbWJz dG93Y3ModXRmMTYsIHV0ZjgsIHNpemU4KTsNCisjZW5kaWYNCisgICAgdXRmMTZbc2l6ZTE2XSA9 IDA7DQorICAgIGx1YV9yZXBsYWNlKEwsIGluZGV4KTsNCisgICAgaWYgKGxlbmd0aCkNCisgICAg ICAqbGVuZ3RoID0gc2l6ZTE2OyAgLyogcmVtb3ZlIHRyYWlsaW5nIDAgKi8NCisgICAgcmV0dXJu IHV0ZjE2Ow0KKyAgfQ0KKyAgY2FzZSBMVUFfVFVTRVJEQVRBOg0KKyAgICBpZiAobGVuZ3RoKQ0K KyAgICAgICpsZW5ndGggPSBsdWFfb2JqbGVuKEwsIGluZGV4KSAvIHNpemVvZih3Y2hhcl90KSAt IDE7ICAvKiByZW1vdmUgdHJhaWxpbmcgMCAqLw0KKyAgICByZXR1cm4gKGNvbnN0IHdjaGFyX3Qq KWx1YV90b3VzZXJkYXRhKEwsIGluZGV4KTsNCisgIGRlZmF1bHQ6DQorICAgIHJldHVybiAwOw0K KyAgfQ0KK30NCisNCitMVUFfQVBJIGNvbnN0IHdjaGFyX3QgKmx1YV90b3dzdHJpbmcgKGx1YV9T dGF0ZSAqTCwgaW50IGluZGV4KSB7DQorICByZXR1cm4gbHVhX3RvbHdzdHJpbmcoTCwgaW5kZXgs IDApOw0KK30NCisNCitMVUFfQVBJIGNvbnN0IHdjaGFyX3QgKmx1YUxfb3B0d3N0cmluZyAobHVh X1N0YXRlICpMLCBpbnQgbmFyZywgY29uc3Qgd2NoYXJfdCAqZGVmKSB7DQorICBpZiAobHVhX2lz bm9uZW9ybmlsKEwsIG5hcmcpKQ0KKyAgICByZXR1cm4gZGVmOw0KKyAgZWxzZQ0KKyAgICByZXR1 cm4gbHVhTF9jaGVja3dzdHJpbmcoTCwgbmFyZyk7DQorfQ0KKw0KK0xVQV9BUEkgY29uc3Qgd2No YXJfdCAqbHVhTF9jaGVja3dzdHJpbmcgKGx1YV9TdGF0ZSAqTCwgaW50IGluZGV4KSB7DQorICBp ZiAobHVhX3R5cGUoTCwgaW5kZXgpIT1MVUFfVFVTRVJEQVRBKQ0KKyAgICBsdWFMX2NoZWNrc3Ry aW5nKEwsIGluZGV4KTsNCisgIHJldHVybiBsdWFfdG93c3RyaW5nKEwsIGluZGV4KTsNCit9DQor DQorTFVBX0FQSSBjb25zdCB3Y2hhcl90ICpsdWFMX2NoZWNrbHdzdHJpbmcgKGx1YV9TdGF0ZSAq TCwgaW50IGluZGV4LCBzaXplX3QgKmxlbmd0aCkgew0KKyAgbHVhTF9jaGVja3N0cmluZyhMLCBp bmRleCk7DQorICByZXR1cm4gbHVhX3RvbHdzdHJpbmcoTCwgaW5kZXgsIGxlbmd0aCk7DQorfQ0K Kw0KK0xVQV9BUEkgdm9pZCBsdWFfcHVzaHdzdHJpbmcgKGx1YV9TdGF0ZSAqTCwgY29uc3Qgd2No YXJfdCAqdmFsdWUpIHsNCisjaWZkZWYgX1dJTjMyDQorICBzaXplX3Qgc2l6ZTg7DQorICBjaGFy ICp1dGY4Ow0KKyAgc2l6ZTggPSBXaWRlQ2hhclRvTXVsdGlCeXRlKENQX1VURjgsIDAsIHZhbHVl LCAtMSwgMCwgMCwgMCwgMCk7DQorICBpZiAoc2l6ZTggPiBJTlRfTUFYKQ0KKyAgICBzaXplOCA9 IElOVF9NQVg7DQorICB1dGY4ID0gKGNoYXIqKWx1YV9uZXd1c2VyZGF0YShMLCBzaXplOCk7DQor ICBXaWRlQ2hhclRvTXVsdGlCeXRlKENQX1VURjgsIDAsIHZhbHVlLCAtMSwgdXRmOCwgKGludClz aXplOCwgMCwgMCk7DQorICBsdWFfcHVzaGxzdHJpbmcoTCwgdXRmOCwgc2l6ZTggLSAxKTsgIC8q IHJlbW92ZSB0aGUgdGVybWluYXRpbmcgTlVMTCwgTHVhIGFkZHMgYW5vdGhlciBvbmUgKi8NCisg IGx1YV9yZW1vdmUoTCwgLTIpOyAgLyogcmVtb3ZlIHRoZSB1dGYtOCB1c2VyZGF0YSAqLw0KKyNl bHNlDQorICBzaXplX3Qgc2l6ZTg7DQorICBzaXplOCA9IHdjc3RvbWJzKE5VTEwsIHZhbHVlLCAw KTsNCisgIGlmIChzaXplOD09KHNpemVfdCktMSkNCisgICAgbHVhTF9lcnJvcihMLCAiY291bGQg bm90IGNvbnZlcnQgd3N0cmluZyB0byBzdHJpbmciKTsNCisgIGlmIChzaXplOCA+IElOVF9NQVgp DQorICAgIHNpemU4ID0gSU5UX01BWDsNCisgIGVsc2Ugew0KKyAgICBjaGFyICp1dGY4Ow0KKyAg ICB1dGY4ID0gKGNoYXIqKWx1YV9uZXd1c2VyZGF0YShMLCBzaXplOCk7DQorICAgIHNpemU4ID0g d2NzdG9tYnModXRmOCwgdmFsdWUsIHNpemU4KTsNCisgICAgbHVhX3B1c2hsc3RyaW5nKEwsIHV0 ZjgsIHNpemU4IC0gMSk7ICAvKiByZW1vdmUgdGhlIHRlcm1pbmF0aW5nIE5VTEwsIEx1YSBhZGRz IGFub3RoZXIgb25lICovDQorICAgIGx1YV9yZW1vdmUoTCwgLTIpOyAgLyogcmVtb3ZlIHRoZSB1 dGYtOCB1c2VyZGF0YSAqLw0KKyAgfQ0KKyNlbmRpZg0KK30NCisNCitMVUFfQVBJIHZvaWQgbHVh X3B1c2hsd3N0cmluZyAobHVhX1N0YXRlICpMLCBjb25zdCB3Y2hhcl90ICp2YWx1ZSwgc2l6ZV90 IGlzaXplKSB7DQorICBzaXplX3Qgb3NpemU7DQorICBjaGFyICp1dGY4Ow0KKyNpZmRlZiBfV0lO MzINCisgIGlmIChpc2l6ZSA+IElOVF9NQVgpDQorICAgIGlzaXplID0gSU5UX01BWDsNCisgIG9z aXplID0gV2lkZUNoYXJUb011bHRpQnl0ZShDUF9VVEY4LCAwLCB2YWx1ZSwgKGludClpc2l6ZSwg MCwgMCwgMCwgMCk7DQorICBpZiAob3NpemUgPiBJTlRfTUFYKQ0KKyAgICBvc2l6ZSA9IElOVF9N QVg7DQorICB1dGY4ID0gKGNoYXIqKWx1YV9uZXd1c2VyZGF0YShMLCAoaW50KW9zaXplKTsNCisg IFdpZGVDaGFyVG9NdWx0aUJ5dGUoQ1BfVVRGOCwgMCwgdmFsdWUsIChpbnQpaXNpemUsIHV0Zjgs IChpbnQpb3NpemUsIDAsIDApOw0KKyNlbHNlDQorICBzaXplX3QgaTsNCisgIC8qIHdjc3RvbWJz IGlzIG5vdCBjYXBhYmxlIG9mIGNvbnZlcnRpbmcgZW1iZWRkZWQgemVyb3MsIHNvIHdlIGRvIGl0 DQorICAgKiBtYW51YWxseSAqLw0KKyAgb3NpemUgPSAwOw0KKyAgZm9yIChpPTA7IGk8aXNpemU7 ICsraSkNCisgICAgb3NpemUgKz0gd2N0b21iKE5VTEwsIHZhbHVlW2ldKTsNCisgIHV0ZjggPSAo Y2hhciopbHVhX25ld3VzZXJkYXRhKEwsIChpbnQpb3NpemUpOw0KKyAgZm9yIChpPTA7IGk8aXNp emU7ICsraSkNCisgICAgdXRmOCArPSB3Y3RvbWIodXRmOCwgdmFsdWVbaV0pOw0KKyNlbmRpZg0K KyAgbHVhX3B1c2hsc3RyaW5nKEwsIHV0ZjgsIG9zaXplKTsNCisgIGx1YV9yZW1vdmUoTCwgLTIp OyAgLyogcmVtb3ZlIHRoZSB1dGYtOCB1c2VyZGF0YSAqLw0KK30NCisNCitMVUFfQVBJIGludCBs dWFMX2xvYWR3ZmlsZSAobHVhX1N0YXRlICpMLCBjb25zdCB3Y2hhcl90ICpmaWxlbmFtZSkgew0K KyAgaW50IHJlc3VsdDsNCisgIGludCB0b3A7DQorICB0b3AgPSBsdWFfZ2V0dG9wKEwpOw0KKyAg bHVhX3B1c2h3c3RyaW5nKEwsIGZpbGVuYW1lKTsNCisgIHJlc3VsdCA9IGx1YUxfbG9hZGZpbGUo TCwgbHVhX3Rvc3RyaW5nKEwsIC0xKSk7DQorICBsdWFfcmVtb3ZlKEwsIHRvcCsxKTsNCisgIHJl dHVybiByZXN1bHQ7DQorfQ0KKw0KKy8qIHZpOiB0cz0yIHN0cz0yIHN3PTIgZXQNCisqLw0K --0016e6d9714f344888047646556b-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 07:53:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J9rFhK017080; Mon, 19 Oct 2009 07:53:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8105119344; Mon, 19 Oct 2009 07:52:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s802.sureserver.com (s802.sureserver.com [195.8.222.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5C2919318 for ; Mon, 19 Oct 2009 07:51:58 -0200 (BRST) Received: (qmail 13786 invoked by uid 1003); 19 Oct 2009 09:52:42 -0000 Received: from unknown (HELO ?192.168.1.101?) (ikolev@91.92.152.6) by s802.sureserver.com with ESMTPA; 19 Oct 2009 09:52:42 -0000 Message-ID: <4ADC36D9.60100@gmail.com> Date: Mon, 19 Oct 2009 12:52:25 +0300 From: Ivan Kolev User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: LfW with wxLua and OpenGL Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Are there any examples of using wxLua with OpenGL? Because I can't make it work for some reason. I use Lua for Windows 5.1.4-28 (to make things much easier). There's an OpenGL example with IUP, but not with wxLua. I copied the minimal wxLua example and added the code from wx's cube example. The result is here: http://www.ddag.org/ikolev/files/testGL.wlua What happens is that the application freezes right after frame:Show(true), without calling any of the event handlers I've connected. An empty window appears, but I can't even move it, I can only kill the process. By attaching a debugger to the process I see that there seems to be an endless recursion (though this should cause a crash, not just freezing), because the stack is quite long and there are alternating calls inside the OpenGL driver, wx DLLs and Windows DLLs. Which leads me to another question - wouldn't it be a good idea to provide a debug version of Lua for Windows (along with PDBs)? It would help in such cases when we need to get "under the hood" to understand what's happening. Thanks, Ivan From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 07:54:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9J9sH7D017192; Mon, 19 Oct 2009 07:54:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E973E1935D; Mon, 19 Oct 2009 07:53:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B1B419355 for ; Mon, 19 Oct 2009 07:53:07 -0200 (BRST) Received: by ewy26 with SMTP id 26so4101504ewy.5 for ; Mon, 19 Oct 2009 02:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=kAUEzTjrjX9FK9vZkVQDWHpxF/NHem7SSNxCWYpOjW4=; b=R4/0h/Om0M5A/gwb/aVuNqPmJ/C3jpyXm7ljULoYKAs8+9L1nXzy3kwCAxhLu2o3An Je5iz51O1JYKXqj7Nc91XSmb5N6GVfzqVI15z2v+x9CEv6/k2Gl3nF1gFXUdsP3wxQlH /qx+nivAAMJ5zVhZDjvwiO04P7aA2NpI97oCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=MqX9e9Vl83LjbEjI7sws8kQU1aP1+pEfVHPMW6pGe0gvTyWOAHH9f8P5HDsRMNVrWI x49PyFefDmiGHTvGZ044pcZKEC9rbIewH6gCQgFzcO/im0vXV/mK9/5Y3hyZdDx6FJPx V7ljTk40Im0xX/Ol9TkbCbKaaDFrjzQbHtSUU= MIME-Version: 1.0 Received: by 10.216.85.144 with SMTP id u16mr1724834wee.3.1255946033106; Mon, 19 Oct 2009 02:53:53 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Mon, 19 Oct 2009 11:53:33 +0200 Message-ID: <89d273ba0910190253j2c7c44c8qb610337e2b9d88e4@mail.gmail.com> Subject: Re: Multiple return values from require() To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/18 Matthias Kluwe : > Hi! > > 2009/10/17 Peter Cawley : >> On Sat, Oct 17, 2009 at 7:01 PM, Matthias Kluwe wrote: >>> Hi! >>> >>> 2009/10/17 Linker : >>>> You can return a table instead of a list . >>> >>> Well, I know ... I can return _one_ table, but matrix.lua does return >>> two of them, and there has to be a trick (well, not a trick obviously, >>> but I can't find it in the reference manual). >> >> Look at http://www.lua.org/source/5.1/loadlib.c.html#ll_require - you >> will notice that all execution paths terminate with an error or >> "return 1;", hence require() can only return a single value. > > Right. I was mislead by the above mentioned script which I assumed to > work. I checked now -- it does not. If that's an old script, it may have worked in a previous version of Lua (5.0 had a different 'require' function). From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 08:06:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JA6GTZ018449; Mon, 19 Oct 2009 08:06:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 025C419372; Mon, 19 Oct 2009 08:05:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (unknown [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42D171934A for ; Mon, 19 Oct 2009 08:04:57 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1Mzp7V-0006gZ-1P for lua@bazar2.conectiva.com.br; Mon, 19 Oct 2009 11:05:41 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 211ED11A56 for ; Mon, 19 Oct 2009 11:05:38 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:50485 with envelope Message-ID: <4ADC39B3.5090901@cowlark.com> Date: Mon, 19 Oct 2009 11:04:35 +0100 From: David Given Organization: Cowlark Technologies User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Support of kepler, sputnik, etc and security risks References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9JA6GTZ018449 Tony Finch wrote: [...] > The solution is generally for TLDs to implement a character set policy. > For example, .at only allows these non-ascii characters in domain names: > ä ü ö ë à á â è é ê ì í î ï ò ó ô ù ú û ý ÿ ã Ã¥ æ ç ð ñ õ ø Å“ Å¡ þ ž Interestingly, after posting my message I tried resolving the addresses; and it turns out that www.google.com and www.ð ð¨ð¨ð ð¥ðž.com both appear to resolve to the same address... as does www.google.ðœð¨ð¦. (Using the bold versions of the characters here to make them visible --- these are all from U+1D400 MATHEMATICAL BOLD.) So it certainly looks like something is remapping at least some letter-like glyphs to actual ASCII. I don't know whether that's my Linux system or part of DNS. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ âŽ'⎕',∊Nâ´âŠ‚Sâ†'â†âŽ•â†(3=T)⋎Mâ‹2=Tâ†âŠƒ+/(V⌽"⊂M),(VâŠ"M),(V,⌽V)⌽"(V,Vâ†1⎺1)âŠ"⊂M)' │ --- Conway's Game Of Life, in one line of APL From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 08:06:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JA6fmX018512; Mon, 19 Oct 2009 08:06:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43C4919378; Mon, 19 Oct 2009 08:05:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC7DD19373 for ; Mon, 19 Oct 2009 08:05:23 -0200 (BRST) Received: by ewy26 with SMTP id 26so4111751ewy.5 for ; Mon, 19 Oct 2009 03:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=2wZsa5k3zpF32eC+1zoo4A+NnwhiJhk/mtWepFx2pJE=; b=mglONmP8tAEuuqAY3WyexKvkf7NOJ+niTR6dpx7AbUz6Rqp6hvTI7hfLBU9NFdYQZp Di9w7VaENYNP+FsP33uibj5kuKIC91C1ZLdTUMRJdjeM+BKw71m5aC1BA9ChqaQBsWUL auUvLmIb2Bp0shQSzDkI6nweIwSdsisbVG55g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Hs5zPq3ExPO3IGffeMPbCaeBjFXYjj2/XaeDnodL/4jnVBL4SCWpoMxdKCggmPtGS4 vsfUYsA8SkrubSylnhzP1CLA2l578uInhVzxRXdZ0t8KlgwR9SjH0M+2WsOuW+6nGW4V Jx3z9EyZvnLt47aGWhHyiYfQVZtEw09Z9VUmc= MIME-Version: 1.0 Received: by 10.216.89.137 with SMTP id c9mr1719573wef.228.1255946769105; Mon, 19 Oct 2009 03:06:09 -0700 (PDT) In-Reply-To: References: <20091016132214.GA17582@inf.puc-rio.br> <20091016163352.GA18451@inf.puc-rio.br> <20091016133622.A6074@lua.tecgraf.puc-rio.br> From: Jerome Vuarand Date: Mon, 19 Oct 2009 12:05:49 +0200 Message-ID: <89d273ba0910190305k67cc2edeg9e574231398eb1d9@mail.gmail.com> Subject: Re: Help: Crash in garbage collection To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/19 Tom Miles : > I defined "lua_assert" in lua.h and rebuilt but it didn't produce any > different results. Was that the right define to use? Define LUA_USE_APICHECK in the Makefile or in lua.h/luaconf.h, and rebuild Lua itself. From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 08:32:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JAW1Mc021160; Mon, 19 Oct 2009 08:32:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FF5419387; Mon, 19 Oct 2009 08:30:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 753A219372 for ; Mon, 19 Oct 2009 08:30:36 -0200 (BRST) Received: by fxm23 with SMTP id 23so5002979fxm.6 for ; Mon, 19 Oct 2009 03:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=W/az1WN1Rl/qQMTrTzq6UHCU+hhtVkmfQyGD7T5yMgw=; b=Z/6JUPZTJo5xRCqSupqvMtc3CC3ihd0mHOWUWdEy3TXdZiZnlYigoAIkZi+C6vf1jQ yUOCABI69G9fdFvRPk6ZTfh/r+bA4vE4W2HOno4gKSdqDRC7QjPzoNui2OxL+n9GvvAk LjwbpL/W/NDes6XCCX43gHgNnKUmTdyjzEL1k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=fQDipAFT9R7CRhI5rIj9438tAfp1Cn2D7WV9NSCiHrzKDHN8ZYFZMPcksBaAex19b2 9DzgNMSX/2LSBQBKVrmokuv2EZyjP8aMD6CN/PTKCUO9KNI8+Hn711frqSkrY1K1B1V/ Dz0xHOy80uu9VhSHK3KWiMSeboljNfWS+ePPw= MIME-Version: 1.0 Received: by 10.204.8.199 with SMTP id i7mr4611295bki.37.1255948281550; Mon, 19 Oct 2009 03:31:21 -0700 (PDT) In-Reply-To: <4ADC39B3.5090901@cowlark.com> References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <4ADC39B3.5090901@cowlark.com> From: Matthew Wild Date: Mon, 19 Oct 2009 11:31:00 +0100 Message-ID: <4db9cacb0910190331k9af63e8q6170655542d17bf2@mail.gmail.com> Subject: Re: Support of kepler, sputnik, etc and security risks To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9JAW1Mc021160 2009/10/19 David Given : > Tony Finch wrote: > [...] >> >> The solution is generally for TLDs to implement a character set policy. >> For example, .at only allows these non-ascii characters in domain names: >> ä ü ö ë à á â è é ê ì í î ï ò ó ô ù ú û ý ÿ ã Ã¥ æ ç ð ñ õ ø Å“ Å¡ þ ž > > Interestingly, after posting my message I tried resolving the addresses; and > it turns out that www.google.com and www.ð ð¨ð¨ð ð¥ðž.com both appear to > resolve to the same address... as does www.google.ðœð¨ð¦. (Using the bold > versions of the characters here to make them visible --- these are all from > U+1D400 MATHEMATICAL BOLD.) So it certainly looks like something is > remapping at least some letter-like glyphs to actual ASCII. I don't know > whether that's my Linux system or part of DNS. > Standard DNS only supports ASCII. Unicode addresses are mapped to ASCII using various rules, see http://en.wikipedia.org/wiki/IDNA . To be at least a little on-topic, we have Lua bindings to libidn which provides IDNA conversion, among other unicode profiles, see http://prosody.im/tip/util-src/encodings.c . Examples: matthew@silver:~/lxmppd-hg-depot$ lua -lutil.encodings Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > =encodings.idna.to_ascii("www.google.ðœð¨ð¦.") -- Your unicode www.google.com www.google.com. -- The letters you chose map directly to ASCII > return encodings.idna.to_ascii("写真管ç†.com") -- unlike these xn--g7q225f79b5rg.com Matthew From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 09:34:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JBYGmj029823; Mon, 19 Oct 2009 09:34:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71F1419393; Mon, 19 Oct 2009 09:33:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2C651934B for ; Mon, 19 Oct 2009 09:32:56 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9JBXfum007575 for ; Mon, 19 Oct 2009 09:33:42 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 6AA7354C14E; Mon, 19 Oct 2009 09:33:42 -0200 (BRST) Date: Mon, 19 Oct 2009 09:33:42 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Help: Crash in garbage collection Message-ID: <20091019113342.GA28908@inf.puc-rio.br> References: <20091016133622.A6074@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I defined "lua_assert" in lua.h and rebuilt but it didn't produce any > different results. Was that the right define to use? Can you be more specific about what you are doing in C? For what you described earlier, I do not think these asserts will help. (That is, it looked like C code has nothing to do with the bug.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 12:25:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JEPMoh003655; Mon, 19 Oct 2009 12:25:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B134C193BF; Mon, 19 Oct 2009 12:24:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFDBE193AE for ; Mon, 19 Oct 2009 12:23:59 -0200 (BRST) Received: by qyk26 with SMTP id 26so3036687qyk.5 for ; Mon, 19 Oct 2009 07:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BVWrJiTOq1bMTIHtAgU2YhYwvD4EBxKQ8MB6jzYfXng=; b=BSg/Rc4ejNP0Izb9IyCxbFhCu+7LWfRYt5P7t47D1UK+a5Hjocp2TbIo8/0Fp277cK 2DPiufs5FqR3JMw7hF7DBgzOG99gmoWrOOy9tVXqddclP5/49edBWSUx57oA6etKwcGu fMIKbKy8ftxPU2/RC03IwBBqdfTRNLi6JSTG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MTEFIRW99s68pZ8uirzluBs9wYwP6FGyHFGXIr0ljlVDqqHlFZQ4Uxt1T66Ij+2/pB FRnT902wN4onB4J4MJL3F74jjMrEuepUcWc/OvPLvrdmSNpVeJSekCerOZi1bMYkeNbS GTEEggqS//YMwHgcLl+XvoRYBsLMea30UQrnw= MIME-Version: 1.0 Received: by 10.239.141.162 with SMTP id c34mr402940hba.0.1255962283072; Mon, 19 Oct 2009 07:24:43 -0700 (PDT) In-Reply-To: <4ADC36D9.60100@gmail.com> References: <4ADC36D9.60100@gmail.com> Date: Mon, 19 Oct 2009 10:24:43 -0400 Message-ID: Subject: Re: LfW with wxLua and OpenGL From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Ivan, The focus for LfW is running scripts more than developing libs, so LfW uses Lua Binaries for Windows straight out of LuaForge. The hope is that future versions of LfW will build off of LuaRocks 2.0 so that switching to debug dlls would be an option. As for wxLua & OpenGL, might connect with wxLua developer. Regards Andrew Wilson On Mon, Oct 19, 2009 at 5:52 AM, Ivan Kolev wrote: > Hi, > > Are there any examples of using wxLua with OpenGL? Because I can't make it > work for some reason. > > I use Lua for Windows 5.1.4-28 (to make things much easier). There's an > OpenGL example with IUP, but not with wxLua. > I copied the minimal wxLua example and added the code from wx's cube > example. The result is here: > http://www.ddag.org/ikolev/files/testGL.wlua > What happens is that the application freezes right after frame:Show(true), > without calling any of the event handlers I've connected. An empty window > appears, but I can't even move it, I can only kill the process. > By attaching a debugger to the process I see that there seems to be an > endless recursion (though this should cause a crash, not just freezing), > because the stack is quite long and there are alternating calls inside the > OpenGL driver, wx DLLs and Windows DLLs. > > Which leads me to another question - wouldn't it be a good idea to provide a > debug version of Lua for Windows (along with PDBs)? It would help in such > cases when we need to get "under the hood" to understand what's happening. > > Thanks, > Ivan > > From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 12:45:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JEjGUn007344; Mon, 19 Oct 2009 12:45:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3AEE19351; Mon, 19 Oct 2009 12:44:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC1A3192B3 for ; Mon, 19 Oct 2009 12:44:00 -0200 (BRST) Received: by ewy26 with SMTP id 26so4390495ewy.5 for ; Mon, 19 Oct 2009 07:44:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.83 with SMTP id x61mr1847867wee.7.1255963486599; Mon, 19 Oct 2009 07:44:46 -0700 (PDT) In-Reply-To: <4ADC36D9.60100@gmail.com> References: <4ADC36D9.60100@gmail.com> Date: Mon, 19 Oct 2009 15:44:46 +0100 X-Google-Sender-Auth: 76d84f59f06ad955 Message-ID: Subject: Re: LfW with wxLua and OpenGL From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 19, 2009 at 10:52 AM, Ivan Kolev wrote: > What happens is that the application freezes right after frame:Show(true), > without calling any of the event handlers I've connected. An empty window > appears, but I can't even move it, I can only kill the process. I believe that the wxWidgets API for using OpenGL changed slightly fairly recently. First of all, OpenGL support wasn't enabled by default in wxWidgets until fairly recently. Secondly, I think that the method for creating and associating a GLContext changed too - it used to be that a context was created when you created a canvas, and that might still be the case if you use an old version of wxWidgets, or one of the deprecated constructors for GLCanvas in a new version of wxWidgets. The new approach is that a canvas does not create a context, and that a context should be created for the first time during the first paint event, and then reused and associated with the canvas in that paint event and subsequent ones. In short, check which wxWidgets version you are targeting, which constructor you are using for GLCanvas, and what the proper semantics for GLContext are given your two previous answers. From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 16:17:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JIHE2V003510; Mon, 19 Oct 2009 16:17:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DF2D19386; Mon, 19 Oct 2009 16:15:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 118E11935E for ; Mon, 19 Oct 2009 16:15:42 -0200 (BRST) Received: by fxm12 with SMTP id 12so5572675fxm.5 for ; Mon, 19 Oct 2009 11:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=CXh3VsPph6FLtMDeKZBxfeta9CQhI9HdDbspXryKNBc=; b=r3uN01D39SBm+NA47qUiLx/FqAGK5iKKbIVnTMAbioH7i7W24nvt9HpZ1Vk6Uw7Pq3 zj8vmFKG/wfJW2LJQS5xDchf9gU9Hms6rg0mO+EzGof2DUCnJ0eaexJZPocvgc5y0ENv dw1IHYcZtbMUupB4dGI/hjfTpQzgh+PRorrAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=kKb7t/fBUsi0F5Th4YzU9Chu+uAOCTAFfyf4E0kwn6cqBvjIEUJZL5uixVK9sXYTWI ifXHgDtWdGS74TcZiNQY//t7oAV7o+Q6arxeaoo22uaQSXr+9hvYzfsfpPYIX344jOa5 9U2GxJPAKv7VI/zbBJRQWGgnInLopq0hR2NS8= MIME-Version: 1.0 Received: by 10.204.36.203 with SMTP id u11mr5350855bkd.141.1255976188269; Mon, 19 Oct 2009 11:16:28 -0700 (PDT) In-Reply-To: <2EB3A31D-229B-4B5F-8B79-B2CED1167328@dnainternet.net> References: <7AA9AD6F-ACC2-4BA0-AE1C-B9F52C997354@stefan-marr.de> <2EB3A31D-229B-4B5F-8B79-B2CED1167328@dnainternet.net> From: Hisham Date: Mon, 19 Oct 2009 16:16:08 -0200 Message-ID: <5e7d91620910191116s209350d3ucce61789ba829e26@mail.gmail.com> Subject: Re: LuaLanes and Snow Leopard OSX 10.6 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9JIHE2V003510 On Mon, Oct 5, 2009 at 4:16 PM, Asko Kauppi wrote: > > My by-now standard disclaimer to why Lanes via LuaRocks is not working (it's > actually great, this way I know people tried >:): > > << > I've essentially cleaned away my web sites since Lanes came out. That > explains the missing links, though does not justify them. Sorry. > > I'm not going to change anything, though. People who really need to reach me > will - as you have.  :) > > As to LuaRocks, I only intended to make the rock as a test on how easy/hard > making a rock feels. I did not and do not intend to be maintaining the rock > as well as the library itself. Rocks, and other distributions, require a > "second tier" view on the product and in my opinion are best done by someone > else than the author. > << > > The error you got is indeed the same as I had with Fink Lua (which I'm the > maintainer of) prior to tuning it for safe multithreading. I'll send you the > Fink building rules, maybe there is something in there that will help. > > Thanks for sending the bug report. Sorry about the late response -- I updated the Lanes rockspec to version 2.0.3 (and uploaded a .src.rock file as well, so the repository is resistant to future URL changes). Tested on Linux -- please let me know if there are any problems on other platforms. -- Hisham From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 18:36:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JKaqhE032359; Mon, 19 Oct 2009 18:36:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D552E192C4; Mon, 19 Oct 2009 18:35:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3C0219298 for ; Mon, 19 Oct 2009 18:35:23 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0Mdb4G-1MacTm3NXQ-00PqXA; Mon, 19 Oct 2009 16:36:09 -0400 Message-ID: <775D9C9D17EA40F4945FDE45B7438DC4@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: <1536876966.20091016124402@gmail.com><95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> <26268919-A26A-4A86-990D-D2E345D9FCD4@gmail.com> In-Reply-To: <26268919-A26A-4A86-990D-D2E345D9FCD4@gmail.com> Subject: Re: Re[2]: Kepler cleanup Date: Mon, 19 Oct 2009 13:35:54 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19eiacta9UCvvGKQa2RuWZyD1etvAC6zsjSbHI KAHQGKKQvDXuCFuGGxn5EaE6o5XqpaHnmYZQXZKtR0GYEQnkjl VYmwx8M46axRAjEUJMzKBjORGgallS5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've never heard of a user being discouraged from contributing because they needed to enter two words into Recaptcha. -------------------------------------------------- From: "Petite Abeille" Sent: Saturday, October 17, 2009 P3:00 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Re: Re[2]: Kepler cleanup > > On Oct 17, 2009, at 11:18 PM, Yuri Takhteyev wrote: > >> By contrast, adding captcha stopped all spam. When spammers see >> captcha, they know to not waste their time (and yours!) trying to >> figure out how to spam your site. > > Perhaps the same is true of would-be users... > > I personally much prefer Ned's, hmm, humanistic approach to the problem: > > "Rather than stopping bots by having people identify themselves, we can > stop the bots by making it difficult for them to make a successful post, > or by having them inadvertently identify themselves as bots. This removes > the burden from people, and leaves the comment form free of visible > anti-spam measures." > > > From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 18:40:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JKeor6000342; Mon, 19 Oct 2009 18:40:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90BFC19363; Mon, 19 Oct 2009 18:39:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7110192DD for ; Mon, 19 Oct 2009 18:39:29 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRS00IHB41X3D00@asmtp015.mac.com> for lua@bazar2.conectiva.com.br; Mon, 19 Oct 2009 13:40:07 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <775D9C9D17EA40F4945FDE45B7438DC4@Stucomet> Subject: Re: Re[2]: Kepler cleanup X-Priority: 3 Date: Mon, 19 Oct 2009 22:39:32 +0200 References: <1536876966.20091016124402@gmail.com> <95ADAA68-1C5C-4114-B1D2-E4D30CB25826@mac.com> <26268919-A26A-4A86-990D-D2E345D9FCD4@gmail.com> <775D9C9D17EA40F4945FDE45B7438DC4@Stucomet> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 19, 2009, at 10:35 PM, Stuart P. Bentley wrote: > I've never heard of a user being discouraged from contributing > because they needed to enter two words into Recaptcha. Perhaps they left before even telling you :)) From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 18:49:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JKnSDg001705; Mon, 19 Oct 2009 18:49:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2D93192E6; Mon, 19 Oct 2009 18:48:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25DC0192C7 for ; Mon, 19 Oct 2009 18:48:02 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mzz9m-0004Xc-Au for lua@bazar2.conectiva.com.br; Mon, 19 Oct 2009 22:48:42 +0200 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 22:48:42 +0200 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2009 22:48:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P.Bentley" Subject: LfW Inno Setup script Date: Mon, 19 Oct 2009 13:48:02 -0700 Lines: 5 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there a publicly visible location for the Lua for Windows setup script? I'm asking because I'm looking to build a silent administrative install command for it, and I need to know the installation setting parameters/names. From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 19:19:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9JLJpI0005773; Mon, 19 Oct 2009 19:19:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A6CC1937C; Mon, 19 Oct 2009 19:18:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A94319365 for ; Mon, 19 Oct 2009 19:18:18 -0200 (BRST) Received: by ewy26 with SMTP id 26so4819395ewy.5 for ; Mon, 19 Oct 2009 14:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=nPJjIRVi5PF4xxa7iwTmo/iC+FcxG5ilMXs0wgKkXiQ=; b=kbtu+yS1w3FMv0I1QLqQ0S7B1xgesomI0nc5flKO/lL7CrxE0eIQdp0/ETSXF+vwue pI8DKDpsEBtkoqjf5FoC7AvdQvv8lXPB69I6hKjwRmFeG8uAiEXrDcVvK7RhFXdIsEl3 GvnqBC9Jj0o8M7tyDYx+Xn+/sWVeFHn/p+zBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=JD3Mc32XhBPcRRK+uFCsh5hiKjZZT/6EPnRh9HUIMNBvyj0YcD9eDBJ28kaoDCJF9L FTnerIplOLtuBXw3MB2NNPWPTgkn3tr1uzbyaxiWxw1s1Go2SyOayiJGYUQ59FBN6y0y EQLBskMTHR4lwzOFyBGr39+UsOj09T0Nkw+HM= MIME-Version: 1.0 Received: by 10.216.90.138 with SMTP id e10mr1942972wef.150.1255987143118; Mon, 19 Oct 2009 14:19:03 -0700 (PDT) In-Reply-To: References: From: RJP Computing Date: Mon, 19 Oct 2009 17:18:43 -0400 X-Google-Sender-Auth: 3630fa53e74e9fb3 Message-ID: Subject: Re: LfW Inno Setup script To: Lua list Content-Type: multipart/alternative; boundary=0016e6d99bed8211530476504b20 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d99bed8211530476504b20 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 19, 2009 at 4:48 PM, Stuart P.Bentley wrote: > Is there a publicly visible location for the Lua for Windows setup script? > I'm asking because I'm looking to build a silent administrative install > command for it, and I need to know the installation setting > parameters/names. > > Look at the 'install' directory under the installation path. It puts the script in there. INNO already support silent installs using the /SILENT command line option. Look at the help file for INNO to see other options. -- Regards, Ryan --0016e6d99bed8211530476504b20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Oct 19, 2009 at 4:48 PM, Stuart P.Be= ntley <stuart= @testtrack4.com> wrote:
Is there a publicly visible location for the Lua for Windows setup script? = I'm asking because I'm looking to build a silent administrative ins= tall command for it, and I need to know the installation setting parameters= /names.



Look at the 'install' dire= ctory under the installation path. It puts the script in there.

INNO already support silent installs using the /SILENT command line option.= Look at the help file for INNO to see other options.
--
Regards,Ryan
--0016e6d99bed8211530476504b20-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 22:13:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K0DYlR024264; Mon, 19 Oct 2009 22:13:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80AC318A87; Mon, 19 Oct 2009 22:12:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail15-a-ad.linkedin.com (mail15-a-ad.linkedin.com [208.111.169.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 422D8188EF for ; Mon, 19 Oct 2009 22:12:12 -0200 (BRST) DomainKey-Signature: s=prod; d=linkedin.com; c=nofws; q=dns; h=Sender:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type:X-LinkedIn-fbl; b=bNb2Xxp+1OvOvId2tpNMAZrgbGWoxMz7ynImvnVOTiVvj9RRRFnRoI8c ssSMmj1udDCv6VtzmCJSeQdB7hylxLoX8+Erh9v5Cle13pLF7qHuA+wh4 /rP0P0NvYBTnKzw; Date: Mon, 19 Oct 2009 17:12:56 -0700 (PDT) From: Antonio Tadeu Gomes To: Nikolai Kondrashov Message-ID: <1964342063.1187291.1255997576449.JavaMail.app@ech3-cdn11.prod> Subject: Invitation to connect on LinkedIn MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1187290_806237798.1255997576448" X-LinkedIn-fbl: XXzFQ1rIeD1lIF2tg6zDJJmrGWyOItUjSdkB-_oIcD1IrtLttP-2HD X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_1187290_806237798.1255997576448 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit LinkedIn ------------ Antonio Tadeu Gomes requested to add you as a connection on LinkedIn: ------------------------------------------ Nikolai, I'd like to add you to my professional network on LinkedIn. - Antonio Tadeu Accept invitation from Antonio Tadeu Gomes http://www.linkedin.com/e/umUaI4vbmXLNZJBsRdC6u58_HULNWBso5XaYp5rkj9/blk/I387416810_3/6lColZJrmZznQNdhjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfPdvc34Udz4QdPwPiiZqpQxMs4NCtOYRd34SdjwSc3wLrCBxbOYWrSlI/EML_comm_afe/ View invitation from Antonio Tadeu Gomes http://www.linkedin.com/e/umUaI4vbmXLNZJBsRdC6u58_HULNWBso5XaYp5rkj9/blk/I387416810_3/0PnP0Ne3oNd3sUcQALqnpPbOYWrSlI/svi/ ------------------------------------------ DID YOU KNOW you can showcase your professional knowledge on LinkedIn to receive job/consulting offers and enhance your professional reputation? Posting replies to questions on LinkedIn Answers puts you in front of the world's professional community. http://www.linkedin.com/e/abq/inv-24/ ------ (c) 2009, LinkedIn Corporation ------=_Part_1187290_806237798.1255997576448 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

LinkedIn

Antonio Tadeu Gomes requested to add you as a connection on LinkedIn:

Nikolai,

I'd like to add you to my professional network on LinkedIn.

- Antonio Tadeu

 
Accept View invitation from Antonio Tadeu Gomes

 

DID YOU KNOW you can showcase your professional knowledge on LinkedIn to receive job/consulting offers and enhance your professional reputation?
Posting replies to questions on LinkedIn Answers puts you in front of the world's professional community.

 

© 2009, LinkedIn Corporation

------=_Part_1187290_806237798.1255997576448-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 22:24:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K0Ocj1025346; Mon, 19 Oct 2009 22:24:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 59FFD18EC5; Mon, 19 Oct 2009 22:23:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD3D018BCD for ; Mon, 19 Oct 2009 22:23:21 -0200 (BRST) Received: by yxe17 with SMTP id 17so4539596yxe.33 for ; Mon, 19 Oct 2009 17:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=WC2TOn8xTIHTKOxIpksT69yj7kkWC7OG3PSkCllpk7s=; b=oiDfIouRXEKjSL1w8FAX9PmbckiXFbBTe/xrQue5u6zt08hLHoMl3D6DVYCb7wEy0Q 5akyWRDej124ekIqXVwOGOypA+l/cdL+GGyNMgSF9s6tltKS1NuB8Ns1qwN3rshu3Xyb 2ZJ6w7Ug/EF6Cpp28IJGul+p+iCDris291n+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=QQ0Y49kShl+XJWj5dP14Qd/vo6m2prXtq++IhUlthD2qxIgEJ/1veH+JFh01XR9zwd DKOO78EYCyJdRfG6LPO8kFsqUb/s3muvSZdClip133d+jdK3G0zuTvdlN+kUKdgPJnjW o7Xky9rTi36oafSeTxJ9xQ05oAhYon8AegNbk= MIME-Version: 1.0 Received: by 10.90.16.40 with SMTP id 40mr5421102agp.7.1255998247636; Mon, 19 Oct 2009 17:24:07 -0700 (PDT) Date: Mon, 19 Oct 2009 22:24:07 -0200 Message-ID: Subject: [Sorry for the spam]: Invitation to connect on LinkedIn From: Antonio Tadeu Azevedo Gomes To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636283bf663905f047652e181 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636283bf663905f047652e181 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all, I'm deeply sorry for the LinkedIn invitation, which was sent by mistake. Regards, Tadeu. 2009/10/19 Antonio Tadeu Gomes > LinkedIn > > Antonio Tadeu Gomes requested to add you as a connection on LinkedIn: > > Nikolai, > > I'd like to add you to my professional network on LinkedIn. > > - Antonio Tadeu > > Accept View > invitation from Antonio Tadeu Gomes > > > DID YOU KNOW *you can showcase your professional knowledge on LinkedIn t= o > receive job/consulting offers and enhance your professional reputation?* > Posting replies to questions on LinkedIn Answersputs you in front of the world's professional community. > > > =A9 2009, LinkedIn Corporation > --=20 Antonio Tadeu Azevedo Gomes, DSc. http://wiki.martin.lncc.br/atagomes http://martin.lncc.br --001636283bf663905f047652e181 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

I'm deeply sorry for the LinkedIn invitation= , which was sent by mistake.

Regards,
= =A0=A0 =A0 Tadeu.




2009/10/19 Antonio Tadeu Gomes <atagomes@gmail.com>
=20
=20

LinkedIn

Antonio Tadeu Gomes requested to add you as a connection on Linked= In:

Nikolai,

I'd like to add you to my professional network on LinkedIn.

- Antonio Tadeu

=A0
Accept =20 View invitation from Antonio Tadeu Gomes

=A0

DID YOU KNOW you can showcase your professional knowledge on = LinkedIn to receive job/consulting offers and enhance your professional rep= utation?
Posting replies to questions on LinkedIn Answers puts yo= u in front of the world's professional community.

=A9 2009, LinkedIn Corporation




--
Antonio Tadeu Azevedo G= omes, DSc.
http://wiki.m= artin.lncc.br/atagomes
http://mart= in.lncc.br
--001636283bf663905f047652e181-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 22:52:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K0qlVl027948; Mon, 19 Oct 2009 22:52:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC21918D75; Mon, 19 Oct 2009 22:51:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BE8B18C1B for ; Mon, 19 Oct 2009 22:51:26 -0200 (BRST) Received: from [192.168.254.14] (pool122-0213.bmts.com [209.240.122.213]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id n9K0pwu1019385 for ; Mon, 19 Oct 2009 20:52:09 -0400 Message-ID: <4ADD09AE.5080301@hempeldesigngroup.com> Date: Mon, 19 Oct 2009 20:51:58 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: [Sorry for the spam]: Invitation to connect on LinkedIn References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Antonio Tadeu Azevedo Gomes wrote: > Hi all, > > I'm deeply sorry for the LinkedIn invitation, which was sent by mistake. Antonio, No problem at all. Of course, being the curious type, I looked up your profile and see your background is PUC Rio, the home of the Lua programming language. I'm the author of pbLua - a port of Lua to the LEGO MINDSTORMS NXT programmale brick. So maybe it's not so far out a connection after all :-) Ralph From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 23:00:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K10e4f028799; Mon, 19 Oct 2009 23:00:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90BD318E5E; Mon, 19 Oct 2009 22:59:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from paris.bmts.com (paris.bmts.com [216.183.128.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C3C918CD2 for ; Mon, 19 Oct 2009 22:59:28 -0200 (BRST) Received: from [192.168.254.14] (pool122-0213.bmts.com [209.240.122.213]) by paris.bmts.com (8.13.1/8.13.1) with ESMTP id n9K108WQ003113 for ; Mon, 19 Oct 2009 21:00:09 -0400 Message-ID: <4ADD0B98.1010907@hempeldesigngroup.com> Date: Mon, 19 Oct 2009 21:00:08 -0400 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: [Sorry for the spam]: Invitation to connect on LinkedIn References: <4ADD09AE.5080301@hempeldesigngroup.com> In-Reply-To: <4ADD09AE.5080301@hempeldesigngroup.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean And of course, I did not check to see that my reply was going back to the list. At least I was not rude to Antonio :-) Sorry for the noise. Ralph From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 23:07:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K17udF029480; Mon, 19 Oct 2009 23:07:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABB3018F56; Mon, 19 Oct 2009 23:06:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f189.google.com (mail-pz0-f189.google.com [209.85.222.189]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 135C618CF4 for ; Mon, 19 Oct 2009 23:06:45 -0200 (BRST) Received: by pzk27 with SMTP id 27so1615301pzk.12 for ; Mon, 19 Oct 2009 18:07:31 -0700 (PDT) Received: by 10.114.7.13 with SMTP id 13mr7784857wag.82.1256000851090; Mon, 19 Oct 2009 18:07:31 -0700 (PDT) Received: from two ([71.21.67.37]) by mx.google.com with ESMTPS id 20sm255028pxi.15.2009.10.19.18.07.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 18:07:30 -0700 (PDT) Date: Mon, 19 Oct 2009 20:07:24 -0500 From: phoenix To: Lua list Subject: Lua, the movie Message-ID: <20091019200724.285455d6@two> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean http://www.imdb.com/title/tt1182345/ From lua-bounces@bazar2.conectiva.com.br Mon Oct 19 23:45:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K1jZwQ032671; Mon, 19 Oct 2009 23:45:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE9C018CD2; Mon, 19 Oct 2009 23:44:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4B3618A9B for ; Mon, 19 Oct 2009 23:44:14 -0200 (BRST) Received: by fxm12 with SMTP id 12so6022618fxm.5 for ; Mon, 19 Oct 2009 18:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3y3iP/czPSs2CxQgO8a632gmr0In/RfAfBtD6Ze5t+A=; b=lMMOdqF3PwObMIOe2CCiPy7bxRftagEQhet+5pWR66jU9hbhJj3uX/Fnf+hD/cCmzB nl7f++kKN3HvMH/wj0o+yreSfjz+G8LWrueT+7iBBMYGIvJqvrn4s2UnuMnUvft5RfBb yStQh5z5sxrh437BkSx4LI4A2t5BfeuvMHw2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sWyDZr6B6gjeZrOhgYD9ky34iPETbAh0MTptkBLji+EG+0vLMpzT49MjJLfp9iq6DS AXgadXLqJz0kKD98GScx7SpGSURgn4am3XPqstS3sV/+tlGESvQ1CWm7zwz49DUy9oPS LWdhDSWAmGXF4Jm9FRaNp+7CLADrZzCn6pO88= MIME-Version: 1.0 Received: by 10.223.143.21 with SMTP id s21mr297107fau.54.1256003100352; Mon, 19 Oct 2009 18:45:00 -0700 (PDT) In-Reply-To: <20091019200724.285455d6@two> References: <20091019200724.285455d6@two> Date: Mon, 19 Oct 2009 22:45:00 -0300 Message-ID: <2bc7f0950910191845w2daf26c4vb3dbc2a7fbb3949d@mail.gmail.com> Subject: Re: Lua, the movie From: Elias Barrionovo To: Lua list Content-Type: multipart/alternative; boundary=0023545bd89ca221f0047654029d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545bd89ca221f0047654029d Content-Type: text/plain; charset=ISO-8859-1 "Plot: Astronaut Sam Bell has a quintessentially personal encounter toward the end of his three-year stint on the Moon, where he, working alongside *his computer, GERTY*, sends back to Earth parcels of a resource that has helped diminish our planet's power problems." I wonder if they use Lua on that computer... On Mon, Oct 19, 2009 at 10:07 PM, phoenix wrote: > > http://www.imdb.com/title/tt1182345/ > -- NI! --0023545bd89ca221f0047654029d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable "Plot: Astronaut Sam Bell has a quintessentially personal encounter toward the end of his three-year stint on the Moon, where he, working alongside his computer, GERTY, sends back to Earth parcels of a resource that = has helped diminish our planet's power problems."

I wonder if t= hey use Lua on that computer...


On Mo= n, Oct 19, 2009 at 10:07 PM, phoenix <phoenix@burninglabs.com> wrote:

http://w= ww.imdb.com/title/tt1182345/



--
NI!
--0023545bd89ca221f0047654029d-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 00:06:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K26E8R002921; Tue, 20 Oct 2009 00:06:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50BE218D5E; Tue, 20 Oct 2009 00:05:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC2B618BB1 for ; Tue, 20 Oct 2009 00:05:01 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1090954eye.39 for ; Mon, 19 Oct 2009 19:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=uDlDnJE0QG0l11IEne4Q1lU2t5MbDvcuT3/g60ZlJRU=; b=WOe1nTtle35HWBevAz2W+apJDUyLV1h3oYfEMHS3bxZcx3HLcwG09EoI93z47anr0H wgKH2B4gj0dDCC3ZCx9GJi+cJdrGeikggu50sEVW6ggtrZ2QvUJeRZFlugTPlj2awFGY v7jmtcobbQCF+LLC01lbLT+UAp2Jq0OCX0iu8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BvL16q86zwO2q7dVzrNQExH0SWilglN9x4GlaUy35FlPt31rsQV/w3XhnYkiTOBh3d KdjDZLx4Yc+Z/j0Nwl9zu2VrxcxXWUXnP0WoJ3J/hFGkvR1854F9t6IF5PrI1WUYqJTS h8NQlPiidH7q6x/qNnkfO3CNwJY2tDoyF+rwQ= MIME-Version: 1.0 Received: by 10.216.93.17 with SMTP id k17mr2113727wef.31.1256004348092; Mon, 19 Oct 2009 19:05:48 -0700 (PDT) Date: Tue, 20 Oct 2009 00:05:47 -0200 Message-ID: <92fa37330910191905m37c3bbbam11e20006283786c0@mail.gmail.com> Subject: [ANN] LuaGravity 0.5 From: "Francisco Sant'anna" To: Lua list Content-Type: multipart/alternative; boundary=0016e6d7e33a012a7d0476544de8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d7e33a012a7d0476544de8 Content-Type: text/plain; charset=ISO-8859-1 I'm pleased to announce the release of LuaGravity 0.5 (the first public version). LuaGravity is a reactive language that implements the synchronous approach for concurrency. It is roughly based on Esterel and FrTime, two synchronous languages, the former having an imperative style, the latter being functional. LuaGravity is implemented as a set of runtime extensions to the Lua language. Homepage: http://www.lua.inf.puc-rio.br/luagravity/ -- Francisco Sant'Anna http://thesynchronousblog.wordpress.com --0016e6d7e33a012a7d0476544de8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I'm pleased to announce the release of LuaGravity 0.5 (= the first public version).

LuaGravity is a reactive language that= implements the synchronous approach for=20 concurrency.

It is roughly based on Esterel and FrTime, two synchronous languages, the= =20 former having an imperative style, the latter being functional.

LuaGravity is implemented as a set of runtime extensions to the Lua lang= uage.=A0

Homepage: http://www.lua.inf.puc-rio.br/luagravity/

-- Francisco Sant'Anna
http:= //thesynchronousblog.wordpress.com
--0016e6d7e33a012a7d0476544de8-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 04:32:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K6WCBs028217; Tue, 20 Oct 2009 04:32:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 506C5191E8; Tue, 20 Oct 2009 04:30:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFC2A18E6D for ; Tue, 20 Oct 2009 04:30:48 -0200 (BRST) Received: by iwn8 with SMTP id 8so2731706iwn.33 for ; Mon, 19 Oct 2009 23:31:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.125.13 with SMTP id w13mr2485153ibr.32.1256020295506; Mon, 19 Oct 2009 23:31:35 -0700 (PDT) In-Reply-To: <4ADC36D9.60100@gmail.com> References: <4ADC36D9.60100@gmail.com> Date: Tue, 20 Oct 2009 02:31:35 -0400 X-Google-Sender-Auth: 22311b807cc69dc8 Message-ID: Subject: Re: LfW with wxLua and OpenGL From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 19, 2009 at 5:52 AM, Ivan Kolev wrote: > wouldn't it be a good idea to provide a > debug version of Lua for Windows (along with PDBs)? It would help in such > cases when we need to get "under the hood" to understand what's happening. This can be done once we get all LfW packages compiling under LuaDist. It's getting there. I've, for example, used the PDB from LuaDist to debug LuaCOM (after setting cleanup=false in the config.lua). From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 06:04:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K84C1o003941; Tue, 20 Oct 2009 06:04:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4AE81928E; Tue, 20 Oct 2009 06:02:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from creative-assembly.com (unknown [193.128.86.150]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B72D191D9 for ; Tue, 20 Oct 2009 06:02:41 -0200 (BRST) Received: from exchange2.cauk.domain (exchange2.cauk.domain [10.10.5.60]) by creative-assembly.com (Postfix) with ESMTP id 8186B88115 for ; Tue, 20 Oct 2009 09:03:33 +0100 (BST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Help: Crash in garbage collection (solved, thanks!) Date: Tue, 20 Oct 2009 09:03:20 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help: Crash in garbage collection (solved, thanks!) Thread-Index: AcpOfn8XRpSoFRMJTeKa9UNr4XK/gwC3PSnw References: <20091016132214.GA17582@inf.puc-rio.br> <20091016163352.GA18451@inf.puc-rio.br> From: "Tom Miles" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9K84C1o003941 Thanks to everyone for the help. The problem was indeed stack corruption. With LUA_USE_APICHECK defined I found two places where the stack was growing too big. I'm surprised that we didn't have more problems with this sooner. I'm going to leave the define in for a while just in case there are any more. Is there anyway though of modifing lua so that it automatically grows the stack if it needs to? > -----Original Message----- > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > bounces@bazar2.conectiva.com.br] On Behalf Of Roberto Ierusalimschy > Sent: 16 October 2009 17:34 > To: Lua list > Subject: Re: Help: Crash in garbage collection > > > I've had to do a rebuild of the app, and now the crash has moved. > It's > > now in lgc.c > > > > propagatemark() > > case LUA_TTABLE: > > traversetable() > > -> if (!weakkey) markvalue(g, gkey(n)); > > > > The value of g going in to this function looks a little dubious. > > strt.nuse = 1363, size = 2048, sweepstrgc = 2048. You said > sweepstrgc > > cannot be more than size, but can it be equal? > > Yes. > > > > Also GCthreshold = 2712903, as does "totalbytes" is this a bad thing, > it > > seems like it might be. > > No problem here, I guess. > > > > Unfortunately this is a windows app, so I can't use valgrind. I had > a > > look at Memory Validator but it didn't flag anything up, maybe I > wasn't > > using it right. It kind of looks like memory corruption being that > it > > moves, but I'm suspiciois of that totalbytes count... > > > > Oh, yes, this is essentially a standard lua 5.1 installation. It's > got > > bitlib compiled in, and a tiny bit of added functionality to tell > some > > external code of when a library is "required", but that's it. > > It looks like memory corruption. Can you reproduce this bug > consistently? > > > -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 06:17:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K8HENd005064; Tue, 20 Oct 2009 06:17:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCC55192AE; Tue, 20 Oct 2009 06:16:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8DEA192A0 for ; Tue, 20 Oct 2009 06:16:03 -0200 (BRST) Received: by iwn8 with SMTP id 8so2760684iwn.33 for ; Tue, 20 Oct 2009 01:16:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.75 with SMTP id o11mr6879618ibr.55.1256026609980; Tue, 20 Oct 2009 01:16:49 -0700 (PDT) In-Reply-To: References: <20091016132214.GA17582@inf.puc-rio.br> <20091016163352.GA18451@inf.puc-rio.br> Date: Tue, 20 Oct 2009 04:16:49 -0400 Message-ID: <790db3550910200116l1fee753dxffd51b1e423c903d@mail.gmail.com> Subject: Re: Help: Crash in garbage collection (solved, thanks!) From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9K8HENd005064 On Tue, Oct 20, 2009 at 4:03 AM, Tom Miles wrote: > Is there anyway though of modifing lua > so that it automatically grows the stack if it needs to? No. Use lua(L)_checkstack for growing the stack as needed. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 06:49:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K8nbk6008045; Tue, 20 Oct 2009 06:49:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9595192A4; Tue, 20 Oct 2009 06:48:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4068619297 for ; Tue, 20 Oct 2009 06:48:18 -0200 (BRST) Received: by fxm12 with SMTP id 12so6310019fxm.5 for ; Tue, 20 Oct 2009 01:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=eE+64NQzA5Zl2qa/JLJu2uoL9HG+YzD4R51K7rMlakQ=; b=Ttzr0pJQtC0G+8L3OgPlRPCYVUgaS6z7ieDm1TgYL9o9+VveNz2zfAeN6/crHxn2Pl pmNgAFAWUSU7J2A6quRFqahAbuxI1rw8vbukH6d8LuYONqzXIPfeiRCY70z5NehO/rRN qiD+0Wyb796A/FZOkCLip1xg57d+ohNQA166c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qPyY4cmtfSI++EaAywIZy6wWXaSvE63EvA9ePpsa4W64WPbP+EFXu37NMiFN+LPzp2 0QA90r87Z6lOGRzlVD3VOCYPlu0M5h3dN9bayYGyoL9gh3IWL3erKRwH41lVu2Nd5Pns 7HjYaZDRtKKAmbKXliDopi+2fGV1quWpRD73o= MIME-Version: 1.0 Received: by 10.204.7.144 with SMTP id d16mr6029709bkd.209.1256028544800; Tue, 20 Oct 2009 01:49:04 -0700 (PDT) In-Reply-To: References: <20091016132214.GA17582@inf.puc-rio.br> <20091016163352.GA18451@inf.puc-rio.br> Date: Tue, 20 Oct 2009 10:49:04 +0200 Message-ID: <4ff79edb0910200149v155fd82andeb12f72d12ddb6e@mail.gmail.com> Subject: Re: Help: Crash in garbage collection (solved, thanks!) From: Francesco Abbate To: Lua list Content-Type: multipart/alternative; boundary=001517588cfa3d9986047659ef36 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517588cfa3d9986047659ef36 Content-Type: text/plain; charset=ISO-8859-1 That's very interesting. Actually I was wondering if there was a method to catch errors in the Lua stack management in user library C code. Can I have more informations on what kind of checks LUA_USE_APICHECK triggers ? Francesco 2009/10/20 Tom Miles > Thanks to everyone for the help. The problem was indeed stack > corruption. With LUA_USE_APICHECK defined I found two places where the > stack was growing too big. I'm surprised that we didn't have more > problems with this sooner. I'm going to leave the define in for a while > just in case there are any more. Is there anyway though of modifing lua > so that it automatically grows the stack if it needs to? > > > -----Original Message----- > > From: lua-bounces@bazar2.conectiva.com.br [mailto:lua- > > bounces@bazar2.conectiva.com.br] On Behalf Of Roberto Ierusalimschy > > Sent: 16 October 2009 17:34 > > To: Lua list > > Subject: Re: Help: Crash in garbage collection > > > > > I've had to do a rebuild of the app, and now the crash has moved. > > It's > > > now in lgc.c > > > > > > propagatemark() > > > case LUA_TTABLE: > > > traversetable() > > > -> if (!weakkey) markvalue(g, gkey(n)); > > > > > > The value of g going in to this function looks a little dubious. > > > strt.nuse = 1363, size = 2048, sweepstrgc = 2048. You said > > sweepstrgc > > > cannot be more than size, but can it be equal? > > > > Yes. > > > > > > > Also GCthreshold = 2712903, as does "totalbytes" is this a bad > thing, > > it > > > seems like it might be. > > > > No problem here, I guess. > > > > > > > Unfortunately this is a windows app, so I can't use valgrind. I had > > a > > > look at Memory Validator but it didn't flag anything up, maybe I > > wasn't > > > using it right. It kind of looks like memory corruption being that > > it > > > moves, but I'm suspiciois of that totalbytes count... > > > > > > Oh, yes, this is essentially a standard lua 5.1 installation. It's > > got > > > bitlib compiled in, and a tiny bit of added functionality to tell > > some > > > external code of when a library is "required", but that's it. > > > > It looks like memory corruption. Can you reproduce this bug > > consistently? > > > > > > -- Roberto > --001517588cfa3d9986047659ef36 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable That's very interesting. Actually I was wondering if there was a method= to catch errors in the Lua stack management in user library C code.
Can I have more informations on what kind of checks=A0LUA_USE_= APICHECK triggers ?

Francesco

2009/10/20 = Tom Miles <Tom@creative-assembly.com>
Thanks to everyone for the help. =A0The problem was indeed stack
corruption. With LUA_USE_APICHECK defined I found two places where the
stack was growing too big. =A0I'm surprised that we didn't have mor= e
problems with this sooner. =A0I'm going to leave the define in for a wh= ile
just in case there are any more. =A0Is there anyway though of modifing lua<= br> so that it automatically grows the stack if it needs to?

> -----Original Message-----
> From: lua-bounc= es@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.cone= ctiva.com.br] On Behalf Of Roberto Ierusalimschy
> Sent: 16 October 2009 17:34
> To: Lua list
> Subject: Re: Help: Crash in garbage collection
>
> > I've had to do a rebuild of the app, and now the crash has mo= ved.
> It's
> > now in lgc.c
> >
> > propagatemark()
> > =A0 =A0 case LUA_TTABLE:
> > traversetable()
> > -> =A0 =A0 =A0if (!weakkey) markvalue(g, gkey(n));
> >
> > The value of g going in to this function looks a little dubious.<= br> > > strt.nuse =3D 1363, size =3D 2048, sweepstrgc =3D 2048. =A0You sa= id
> sweepstrgc
> > cannot be more than size, but can it be equal?
>
> Yes.
>
>
> > Also GCthreshold =3D 2712903, as does "totalbytes" is t= his a bad
thing,
> it
> > seems like it might be.
>
> No problem here, I guess.
>
>
> > Unfortunately this is a windows app, so I can't use valgrind.= =A0I had
> a
> > look at Memory Validator but it didn't flag anything up, mayb= e I
> wasn't
> > using it right. =A0It kind of looks like memory corruption being = that
> it
> > moves, but I'm suspiciois of that totalbytes count...
> >
> > Oh, yes, this is essentially a standard lua 5.1 installation. =A0= It's
> got
> > bitlib compiled in, and a tiny bit of added functionality to tell=
> some
> > external code of when a library is "required", but that= 's it.
>
> It looks like memory corruption. Can you reproduce this bug
> consistently?
>
>
> -- Roberto

--001517588cfa3d9986047659ef36-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 07:21:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K9LF8a010837; Tue, 20 Oct 2009 07:21:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBBCF192B7; Tue, 20 Oct 2009 07:20:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B4A61928E for ; Tue, 20 Oct 2009 07:19:55 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N0AtT-0004wN-00; Tue, 20 Oct 2009 11:20:39 +0200 Date: Tue, 20 Oct 2009 11:14:35 +0200 From: Mike Pall To: Lua list Subject: Re: Help: Crash in garbage collection (solved, thanks!) Message-ID: <20091020091435.GA10874@mike.de> References: <20091016163352.GA18451@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Tom Miles wrote: > Is there anyway though of modifing lua > so that it automatically grows the stack if it needs to? Well, you'd have to ask Roberto about that. But FYI: in LuaJIT 2.x I'm doing exactly that. I.e. lua_checkstack is unnecessary (except to catch the 10K hard limit in a few cases). So far this has turned out to be much simpler for the whole VM. Adding the stack size checks to a couple of the public API functions is cheap. And with a little bit of tuning this has no measurable performance impact at all. IMHO this whole idea of forcing all Lua/C API users to pre-size the stack is probably a case of premature optimization. And, as has just been demonstrated, it causes a lot of grief for developers. If you get the pre-sizing wrong, it may silently corrupt memory. But only under special circumstances that may be hard to reproduce. Just to be clear, turning on the API checks certainly helps -- but it does NOT mean you'll find all places where lua_checkstack is missing or the given limit is too small. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 07:35:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9K9ZNi7012911; Tue, 20 Oct 2009 07:35:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22A55192D0; Tue, 20 Oct 2009 07:34:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB5ED191F2 for ; Tue, 20 Oct 2009 07:34:08 -0200 (BRST) Received: by iwn8 with SMTP id 8so2782824iwn.33 for ; Tue, 20 Oct 2009 02:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=GwFDlNkzxBoAO5r1f1esPaBhMuBAUSzFDAtU5S7iy8k=; b=CrN5+Vhppz5Gk41jIxAQarFLLKEVZrttIJGelXR8y5rKKC9p3VLVnMbu48nACe7N6U stLj7zdFXvtWg2vc0chm5ZAbJRmD0Q7zvfJwdEzX8z8F5GK574FvE9UefnsvXPkaaKy0 u5xl3LalYwcRFnuEkEzwasNn7NQ1E1TjV5/F8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OFgvxn0bX7u5cRx/PGxxiaNqUy6yIQj3FNj6HpR0EIUGVjbYKpdK3B0XFDVsbgb1WE Wy1CTMSGewgsj41gQLWpNmpvOiYBTDoB6B72Lm9Uf4WHwE1aRu/lNwRUHwJODS4w9DCk WsCJTgazo0BujKJTke656ot/d+S0sdRP9OD+U= MIME-Version: 1.0 Received: by 10.231.122.139 with SMTP id l11mr4699465ibr.53.1256031294152; Tue, 20 Oct 2009 02:34:54 -0700 (PDT) Date: Tue, 20 Oct 2009 02:34:54 -0700 Message-ID: <1079b050910200234x539f11dfw6a374822100f1d8e@mail.gmail.com> Subject: ceg - C99 LPEG parser From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've just posted a first release of a C99 parser using LPEG. This is a full parser implementing all of the C99 grammar rules except for some of the preprocessor directives. I based it off of http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf . In addition to defining nearly all of the rules of the C99 grammar, there are some convenience data structures and functions. C99 has tons of rules, so I've also grouped them into sections according to Appendix A of the C99 spec. For example, there are listings of identifier_rules, constant_rules, string_literal_rules, expression_rules, declaration_rules, statement_rules, external_definition_rules, and all_rules as well as a special lpeg.P for matching any token called token_patt. These can be found in the c99.ceg module. The ceg module itself defines some useful functions such as apply (apply a set of captures to a grammer (like in LEG)) and scan, which will return a scanning function to match a pattern. See the example provided for details. The example takes a chunk of C code (actually C++ code) and LuaDocs the documented functions. It can process C++ code since it simply ignores tokens that don't match the pattern it's looking for through the use of the scan function. One thing of note, typedefs are handled by a special table. Usage is demonstrated in the example. ceg can be downloaded at: http://www.mat.ucsb.edu/~whsmith/temp/ceg.zip Feedback is welcome. thanks, wes From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 08:36:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KAaspI020290; Tue, 20 Oct 2009 08:36:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADFE7192F9; Tue, 20 Oct 2009 08:35:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2BBA192A4 for ; Tue, 20 Oct 2009 08:35:31 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so2414615fgg.17 for ; Tue, 20 Oct 2009 03:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=SnxSO8UTf+SCFlnxEh+h3Oxau+qjRmnJAz7NELvwgwA=; b=rlhOH/pnl4BFsHtGvNjnix+YcDUBIkKmiYSPOofH+7yj6w0wpnUTNERPcH0f+id1pU +SRAyg/nys9x6mOhhY0FE5W3W0UBM8LZscYU0gAC4jr/oerKG2K6dYGN3a1P6Z+FLz8q 4dBrPATaiA+nne24ND7JJ0f1x0dmCr8oTDHj8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=wGFQSuXwZ/tWl9ZL3dyw81Dp8NPhYhYGJv3qWlsrSYjqhtkCtF3KsA0B4yRVMnqYb5 G7c5SujqVt26ypQnrLylB3BdS+yFb7exvw0+qOrjItMz+pK8L5sw6NnCBJdLdazPOk/J dDr/oTJnvPCz5AjMufPaTVkftoPCu9HlmfYvQ= MIME-Version: 1.0 Received: by 10.86.242.15 with SMTP id p15mr3776967fgh.14.1256034977560; Tue, 20 Oct 2009 03:36:17 -0700 (PDT) Date: Tue, 20 Oct 2009 16:06:17 +0530 Message-ID: Subject: API which convert in type userdata From: Awadhesh Kumar To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001485e8e587a9bb5804765b6e6d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485e8e587a9bb5804765b6e6d Content-Type: text/plain; charset=ISO-8859-1 Hi, I am writing LUA disectors for Wireshark packets. I am calling a utility application written in C from LUA file. I am getting a string (null terminated) from C application which in in hex string format (like* 2CA000*). I want to convert this string in numeric or float format with LUA' API like uint or float but LUA fails in conversion. I used to do operations as below function directmip_proto.dissector(buffer,pinfo,tree) . . *print("Port ", buffer(2, 2):uint())* In the same way, I am trying to do same operations with output (hex string) given by C utilty but it is failing for this string (2CA000). I have checked the type of buffer as print("Port ", type(buffer(2, 2))) //output is *userdata* but for my output (2CA000), type is *string*. So I want an API which converts the datatype into userdata or any API which converts the hex string into numeric format. Thanks in Advance Awadhesh --001485e8e587a9bb5804765b6e6d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I am writing LUA disectors for Wireshark packets. I am calling a= utility application written in C from LUA file. I am getting a string (nul= l terminated) from C application which in in hex string format (like 2CA= 000).

I want to=A0 convert this string in numeric or float format with LUA= 9; API like uint or float but LUA fails in conversion. I used to do operati= ons as below

function directmip_proto.dissector(buffer,pinfo,tree) .
.
print("Port=A0 ", buffer(2, 2):uint())

In= the same way, I am trying to do same operations with output (hex string) g= iven by C utilty=A0 but it is failing for this string (2CA000).

I h= ave checked the type of buffer as

print("Port=A0 ", type(buffer(2, 2)))=A0=A0 //output=A0 is userdata

but for my output (2CA000), type is string.
So I want an API which converts the datatype into userdata or any API = which converts the hex string into numeric format.

Thanks in Advance
Awadhesh
--001485e8e587a9bb5804765b6e6d-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 08:40:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KAeLko020667; Tue, 20 Oct 2009 08:40:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD6E219345; Tue, 20 Oct 2009 08:39:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E2F819320 for ; Tue, 20 Oct 2009 08:39:06 -0200 (BRST) Received: by iwn8 with SMTP id 8so2802865iwn.33 for ; Tue, 20 Oct 2009 03:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=PJaUncqspe6YUH++jgUdHE+3l5rRRTUBGwQKuzAJs0w=; b=svwQ17QojPE0URmbSOBN8cHlFq0Ul8KPWntSp9RkLH81ba85Pq7jhk307VUjMosUxD MufdgIZHmjvBfjBUHbI0Vlegc0YFy5ykpNpjkEkFpfouAuP24ok2tA7dSuIK+42N6c0P 8unYh8QIDBInGGIuPYBBLhG8d7YS1rqWjOMfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=k+fgH55W2EvtzmO84kvD4AdHWc+KIKY9E0cA/H/4m6ruKSWoP7+PhqOcOYT2WJjWKq u1/aMkBJZ/xEOZeBEo8/0j79bdo5V7YCSErw+4Kg/K+Li64/YfjZN8eotVpr1IvTLnox +z5bV1AtLxuCaVSRlMNRO49d1z9QBd9rwuu1Q= MIME-Version: 1.0 Received: by 10.231.9.218 with SMTP id m26mr7139876ibm.29.1256035191975; Tue, 20 Oct 2009 03:39:51 -0700 (PDT) In-Reply-To: <1079b050910200234x539f11dfw6a374822100f1d8e@mail.gmail.com> References: <1079b050910200234x539f11dfw6a374822100f1d8e@mail.gmail.com> Date: Tue, 20 Oct 2009 03:39:51 -0700 Message-ID: <1079b050910200339h6f150f7vc292b8bd6844c6b6@mail.gmail.com> Subject: Re: ceg - C99 LPEG parser From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean PS ceg license == MIT From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 08:49:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KAnfXf021774; Tue, 20 Oct 2009 08:49:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CB601A5A9; Tue, 20 Oct 2009 08:48:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 873B518885 for ; Tue, 20 Oct 2009 08:48:28 -0200 (BRST) Received: by fxm12 with SMTP id 12so6434513fxm.5 for ; Tue, 20 Oct 2009 03:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=eSrmLVYG84RtGG/KvdGbBDtHd957qqqgJcrkLRjn5Rk=; b=APd5j3p8X0WrRqM42/pCsQjXDbuMkeyXMpfSvQOSXXPyTE2aUi5khz6dAO9EDsKJJp xcnTgtRzhjsLhpYgQnHUHt8FpJ10uKsf/YyGNtdRkeNBjbhvr+INSIbiZGCG4reIiblV oquyqhu03OGEgkr6FEGs7I0G06tMgNYYp50uc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XGSsVP5eMqXetsIqflZ5IsrgQyQe+mHY71vw31pg3imInBF/2ixvpKDvbuc1Wk2yED rrhErJgk38Hsr843me2Mfle+uCY+4Dgzj6rs43LvfG543VgiSEsSJESknf+ptgu48CwH jQ5+5eeJbGDMmYT9SbLbM4hnVBOTMFQ/2svSE= MIME-Version: 1.0 Received: by 10.239.144.104 with SMTP id n40mr475973hba.174.1256035754251; Tue, 20 Oct 2009 03:49:14 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Oct 2009 12:49:14 +0200 Message-ID: <560972290910200349p23430b75v97854be36eff9e37@mail.gmail.com> Subject: Re: API which convert in type userdata From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 20, 2009 at 12:36 PM, Awadhesh Kumar wrote: > So I want an API which converts the datatype into userdata or any API which > converts the hex string into numeric format. tonumber(your_string,16) (It defaults to base 10) From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 09:48:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KBm9GK031894; Tue, 20 Oct 2009 09:48:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 610181A664; Tue, 20 Oct 2009 09:46:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B010321B3 for ; Tue, 20 Oct 2009 09:46:41 -0200 (BRST) Received: by fxm12 with SMTP id 12so6499853fxm.5 for ; Tue, 20 Oct 2009 04:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=qdNUMwmnCDA5pr7UN4jB7N7GDWz/IplnydDTWBWqHZY=; b=ac48FKpIAUGApqtwXl2gOcfAbpcY4pNHa9tXvfgXBA8oCiF9JsubDw1iQk/0r1iiz9 rD/aLGdq3D9HA5JgmYQdUEx2Sl4jLEdn95S5GmZdWCtkV87E4DrLgIdw4T7E98GnV3Oo cIxrO+9Ru0qkqPyjuoebO/ErHzdxSKcKN0HaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PRTSMKbaBUiJ8ZvEw/XGRjjfvQO22/ZS4EPwoa+cmbHeg5TTpSjmj1GaGUZDybl+h1 IsORnMsGhwOGYC8ZM8+n2BXE7ssXal63CokM8DA6xKq/I51PRZqDEsC/If6kmCO82CBY IvXx5sty70HY3vSnYTHEQknVASeHxJkNnJEMM= MIME-Version: 1.0 Received: by 10.223.7.21 with SMTP id b21mr1226864fab.104.1256039246109; Tue, 20 Oct 2009 04:47:26 -0700 (PDT) In-Reply-To: <20090916063609.GA6960@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> <20090913071008.GA15326@protagoras.phil.berkeley.edu> <20090916063609.GA6960@protagoras.phil.berkeley.edu> From: Jim Whitehead II Date: Tue, 20 Oct 2009 12:47:06 +0100 Message-ID: <5fe281d40910200447n43f713d7xee9fb60da19405e3@mail.gmail.com> Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9KBm9GK031894 On Wed, Sep 16, 2009 at 7:36 AM, John MacFarlane wrote: > +++ Yuri Takhteyev [Sep 14 09 11:12 ]: >> > I'll look into releasing on luaforge.  The project needs some polishing >> > first, e.g. better error handling and documentation. >> >> It can always be made better, but please don't let this stop you from >> making a release. > > Okay, I've tagged 0.1 and made a rock available on github: you should > now be able to install the library using > > luarocks --from=http://github.com/jgm/rocks/raw/master install lunamark > >> > No, currently you'd have to modify the module code. In the definition >> > of 'parser' in markdown_parser.lua, you'd add a clause for your new >> > pattern: something like >> > >> > MyPattern = p"[[" * lpeg.Ct((_"Inline" - p"]]")^0) * p"]]" / writer.mypattern >> >> If this is the only thing that needs to be done, shouldn't it be easy >> to expose the table that is used to create the parser, to allow adding >> a pattern by simply setting a field? Perhaps something like: >> >>     require("lunamark") >>     require("lpeg") >>     local wikilink_handler = function(s) return {"", s, ""} end >>     my_parser = lunamark.parsers.markdown() -- or something similar >>     my_parser.WikiLink = lpeg.P"[[" * lpeg.Ct((_"Inline" - >> lpeg.P"]]")^0) * lpeg.P"]]" / wikilink_handler >>     local converter = lunamark.converter(my_parser, "html") > > Good thought.  I've done something similar.  You can now pass in a > modify_syntax function as an option.  This is a function from a table > to a table, so you can perform arbitrary transformations on the input > format grammar.  A simple example: > >    function capify(t) >      t.Str = t.Str / string.upper >      return t >    end > >    markdown2htmlCAPS = lunamark.converter("markdown", "html", { modify_syntax = capify }) > > This gives you a markdown variant in which all strings are capitalized. > > Adding a handler for, say, wikilinks would be slightly more complicated. > You'd have to do two things to the grammar table: > (1) insert an entry for WikiLink > (2) register WikiLink as an Inline element by modifying Inline > > So, something like this: > >    function add_wikilink(t) >      t.WikiLink = --[[ whatever... ]] / write_wikilink >      t.Inline = lpeg.V("WikiLink") + t.Inline >      return t >    end > >    function write_wikilink(s) >      -- code to write the wikilink as HTML >    end I took a stab at implementing this, and I got wiki links working perfectly. I had a question about how I would accomplish something else, however, since its a bit of a weird need. I'd like for any special characters (gt, lt, quot) to be escaped when they aren't encountered in an inline code element, or a verbatim block. I tried altering the grammar to get it to work, but every attempt has failed miserably. Any idea how I would do something like that, John? Thanks, - Jim From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 10:01:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KC1eOM002421; Tue, 20 Oct 2009 10:01:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0D101A667; Tue, 20 Oct 2009 10:00:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 384021A667 for ; Tue, 20 Oct 2009 10:00:25 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1N0DOo-000233-RV for lua@bazar2.conectiva.com.br; Tue, 20 Oct 2009 05:01:10 -0700 From: "Robert G. Jakabosky" To: Lua list Subject: Re: API which convert in type userdata Date: Tue, 20 Oct 2009 05:00:58 -0700 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910200500.58795.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tuesday 20, Awadhesh Kumar wrote: > Hi, > > I am writing LUA disectors for Wireshark packets. I am calling a utility > application written in C from LUA file. I am getting a string (null > terminated) from C application which in in hex string format (like* > 2CA000*). About a year ago I wrote a Wireshark protocol dissector in Lua. You might find it helpful (BSD licensed): http://opensimulator.org/index.php?title=LLUDP_Dissector When I was writing it I had a hard time finding good up-to-date documention on the Lua Wireshark API (I hope that has changed since then). It even contains a simple lexer & parser since the protocol it dissects uses a text file to describe the different message formats (similar to Google's Protocol Buffers) that each UDP packet can contain. -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 13:05:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KF5M31014176; Tue, 20 Oct 2009 13:05:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 049951928C; Tue, 20 Oct 2009 13:03:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp238.iad.emailsrvr.com (smtp238.iad.emailsrvr.com [207.97.245.238]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 114C118E73 for ; Tue, 20 Oct 2009 13:03:53 -0200 (BRST) Received: from relay13.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay13.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id C9BD91CF489 for ; Tue, 20 Oct 2009 11:04:38 -0400 (EDT) Received: by relay13.relay.iad.mlsrvr.com (Authenticated sender: garyb-AT-strata.com) with ESMTPSA id 9FB841CF50F for ; Tue, 20 Oct 2009 11:04:38 -0400 (EDT) From: Gary Bringhurst Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Weak keyed tables with primitive keys Date: Tue, 20 Oct 2009 09:04:37 -0600 Message-Id: To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My google fu is failing me on this one. Where can I find a definitive discussion of weak keyed tables and the behavior of primitive data types as those weak keys? My tests say that unique string keys are never collected, and while I can see a justification for that I'd really like to know the relationship of primitive types such as strings to the garbage collector. Do we have to use tables or user data as keys in weak keyed tables in order for them to be collected? Many thanks in advance, Gary Bringhurst From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 13:54:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KFsBUB024780; Tue, 20 Oct 2009 13:54:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 512241935E; Tue, 20 Oct 2009 13:52:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A80D81928C for ; Tue, 20 Oct 2009 13:52:38 -0200 (BRST) Received: by pxi1 with SMTP id 1so1477510pxi.33 for ; Tue, 20 Oct 2009 08:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YeKmXdzlLKLC/jla6/PnKRZt8is7X14It/0q5DDM7y4=; b=Q2eOKEEiF3+C2ODqTyxqIxj7o0oenJoa7UcDgXN/wMkKwy2oWdstz6NopXCRBrt72M hq7mJ67rWwV5kLBr/gpDliIg/hhfGganPB58k3Nb0efh59M8qBti9h560VDpIHJelCop Gv4PwePczvYxamYqgoxkzsCBrJ0awA4KR6sm8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vH46Tn5GhI1FwEclP0JmcJJDGX/MCYCP3hsu4sXfEk/BDHFeL+cU9pRjVl9zSHFjYp V1ZhBGGeteOUXg/FeWsvPyoBe68oF6S5dfwnrgvzRVsZw6HDJUaBu96sK85xJRybjmRZ PPlf3oSDDsRNeWswpCn2BKHigMGmVkm723zMs= MIME-Version: 1.0 Received: by 10.142.2.34 with SMTP id 34mr440381wfb.143.1256054005238; Tue, 20 Oct 2009 08:53:25 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Oct 2009 08:53:25 -0700 Message-ID: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 20, 2009 at 8:04 AM, Gary Bringhurst wrote: > Where can I find a definitive discussion of weak keyed tables and the > behavior of primitive data types as those weak keys? My tests say that > unique string keys are never collected, and while I can see a justification > for that I'd really like to know the relationship of primitive types such as > strings to the garbage collector. Do we have to use tables or user data as > keys in weak keyed tables in order for them to be collected? When you do t["hi"] = "bye" both the key and the value are being put into the table, why would either get collected? If a key was collected, it wouldn't be in the table. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 14:03:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KG30fR027589; Tue, 20 Oct 2009 14:03:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E70C3192D5; Tue, 20 Oct 2009 14:01:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2999818ED1 for ; Tue, 20 Oct 2009 14:01:41 -0200 (BRST) Received: by pxi1 with SMTP id 1so1483964pxi.33 for ; Tue, 20 Oct 2009 09:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=VuQM9vRQ7Db316rBm+qPPEnUVUjz0AfFqq6Lsua7j3I=; b=C20oppu1guCrOb5Mjuv+QEudqnj/3qjadhz3nBrcODcrJZi/MU9Yl5sgwTzzo2OY+4 XXLO0xzejTcTGnMZh5W+35xp16LUodJgjdiM2rAlpbtoOrthPX7BKiohy1Yv4W9G0Mj3 BZYdsAz9AGnCpdbxaqdZW2lGW57e8vBZgv39A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=O4cR5ghaMe1BiKStVGxdSThvmkExRt4/JdjxR7McQ9JJRe75mB3XcNGlj9+rrvF56d /AZhUxbBjy6yCjDhtMUM+2sgjImPLVL2CGqOkUUFXcCtgBhFRy3Hex67V10BIfBtGtNQ lTOsIwAo5ifyqEwavR53MUd2IWEK2qEjP23f0= MIME-Version: 1.0 Received: by 10.142.74.4 with SMTP id w4mr459018wfa.195.1256054548893; Tue, 20 Oct 2009 09:02:28 -0700 (PDT) In-Reply-To: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> Date: Tue, 20 Oct 2009 09:02:28 -0700 Message-ID: <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 20, 2009 at 8:53 AM, Sam Roberts wrote: > On Tue, Oct 20, 2009 at 8:04 AM, Gary Bringhurst wrote: >> Where can I find a definitive discussion of weak keyed tables and the >> behavior of primitive data types as those weak keys? My tests say that >> unique string keys are never collected, and while I can see a justification >> for that I'd really like to know the relationship of primitive types such as >> strings to the garbage collector. Do we have to use tables or user data as >> keys in weak keyed tables in order for them to be collected? Sorry, it is too early in the morning, I didn't see the "weak". If that was true, it would surprise me, I would expect a weak-keyed table to have a pair cleared from it, both key and value, when the value no longer has a reference outside the table. Sam From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 14:08:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KG81Ff028620; Tue, 20 Oct 2009 14:08:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DFE61936E; Tue, 20 Oct 2009 14:06:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8BF21928C for ; Tue, 20 Oct 2009 14:06:34 -0200 (BRST) Received: by fxm12 with SMTP id 12so6802565fxm.5 for ; Tue, 20 Oct 2009 09:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=pe59Zt/azJxhcY/gu8qlR+3N2KnHgmt6hwMfnbhRDrU=; b=Yd0hm8MxIjYVnslAXntC9t7/7WiauGOEn2XK4YMLsM92JPUMqSV+JXi8xDFTjpVeR2 n7k+0m7/VvURq9So2evobJmvudy4kdXV0tPErrDW3QwCZbFHQNC2Y63LX31u2uutUYr1 WOrcE0Y05YdmIjSR80Qkl2LBSB1JFlV33VgAg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=P0bmn9Mt4JrZOd4CsL+wREtmFeot3HrvkHt/H3cjEDqHtSoJN2PxyZRI2bXM5sVidL 70BlTWYWYGKKIMQSnRcwsOHWP6S2ZhtGNmhOJzNubhv/ogqCpxJyX8pAjEoKStEcNOBU Eb8mBQ93ZPECuG09FVYaM35EKtB6GFNiwg40Y= MIME-Version: 1.0 Received: by 10.223.27.194 with SMTP id j2mr1281026fac.76.1256054839082; Tue, 20 Oct 2009 09:07:19 -0700 (PDT) In-Reply-To: <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> From: Jim Whitehead II Date: Tue, 20 Oct 2009 17:06:59 +0100 Message-ID: <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9KG81Ff028620 On Tue, Oct 20, 2009 at 5:02 PM, Sam Roberts wrote: > On Tue, Oct 20, 2009 at 8:53 AM, Sam Roberts wrote: >> On Tue, Oct 20, 2009 at 8:04 AM, Gary Bringhurst wrote: >>> Where can I find a definitive discussion of weak keyed tables and the >>> behavior of primitive data types as those weak keys?  My tests say that >>> unique string keys are never collected, and while I can see a justification >>> for that I'd really like to know the relationship of primitive types such as >>> strings to the garbage collector. Do we have to use tables or user data as >>> keys in weak keyed tables in order for them to be collected? > > Sorry, it is too early in the morning, I didn't see the "weak". > > If that was true, it would surprise me, I would expect a weak-keyed > table to have a pair cleared from it, both key and value, when the > value no longer has a reference outside the table. In my experience: numbers, strings, and boolean values aren't eligible for collection in this manner: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > t = { >> number = 4, >> boolean = true, >> string = "foo", >> table = {}, >> func = function() end, >> thread = coroutine.create(function() end), >> lightud = newproxy(), >> } > setmetatable(t, {__mode = "v"}) > collectgarbage("collect") > collectgarbage("collect") > for k,v in pairs(t) do print(k, v) end number 4 string foo boolean true I've never looked into the implementation reasons for this, but I suspect there's a fairly good reason =). - Jim From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 14:16:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KGGse1030786; Tue, 20 Oct 2009 14:16:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B194F1A5A9; Tue, 20 Oct 2009 14:15:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F08918C55 for ; Tue, 20 Oct 2009 14:15:34 -0200 (BRST) Received: by ewy26 with SMTP id 26so5739857ewy.5 for ; Tue, 20 Oct 2009 09:16:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.86.213 with SMTP id w63mr2558680wee.71.1256055379343; Tue, 20 Oct 2009 09:16:19 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Oct 2009 17:16:19 +0100 X-Google-Sender-Auth: fb84aab3fca94fdf Message-ID: Subject: Re: Weak keyed tables with primitive keys From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9KGGse1030786 I believe that the following two excerpts from the the Lua 5.1 reference manual mean that strings, booleans, and numbers are always strongly referenced, even in situations where other types would be weak referenced (as in weak tables). 2.10.2 - "In other words, if the only references to an object are weak references, then the garbage collector will collect this object." 2.2(.0) - "Tables, functions, threads, and (full) userdata values are objects" On Tue, Oct 20, 2009 at 4:04 PM, Gary Bringhurst wrote: > My google fu is failing me on this one. > > Where can I find a definitive discussion of weak keyed tables and the > behavior of primitive data types as those weak keys?  My tests say that > unique string keys are never collected, and while I can see a justification > for that I'd really like to know the relationship of primitive types such as > strings to the garbage collector. Do we have to use tables or user data as > keys in weak keyed tables in order for them to be collected? > > Many thanks in advance, > Gary Bringhurst > > From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 15:55:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KHtWm3026476; Tue, 20 Oct 2009 15:55:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0856519377; Tue, 20 Oct 2009 15:54:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BDFC18EF2 for ; Tue, 20 Oct 2009 15:54:03 -0200 (BRST) Received: by yxe17 with SMTP id 17so5211738yxe.33 for ; Tue, 20 Oct 2009 10:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=2z0kSG30Lb0ZXkkNzKJJEXG7U/nqxT9X3UpnDAsPXtI=; b=gP0j44jH7kUaXUpBxMcqFAKKVXEgnf8tHuTob4gsLoNJKrYgzF2anfJdbV04LzW9cU EDYCpB0exj1D8D6McxqGYctoTR2hEvpPMHjKoNe8rvqvPAvXdBnSVadZmqbCoMwWLQce np7nbP2eUh3udvxc8b0N9AgrR6g38hakT1XpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=c01ddF82n5QWFX5Z7VdVPD2CwxmPx0I1mIw5gmQBLUc4aWBJiwGX0eyK5Kc9stZZTy lH34HID3EJnau4Qvq42I+/HMZ7c5nX2aBkQ0FE/TMy1Ryfo+vrtY8z9q+CmLjbMVZHKY Zfrih8X60WL28tjctWhp3vIOsyZnpJbMeUyJ8= MIME-Version: 1.0 Received: by 10.151.33.1 with SMTP id l1mr11158363ybj.10.1256061288586; Tue, 20 Oct 2009 10:54:48 -0700 (PDT) Date: Tue, 20 Oct 2009 15:54:48 -0200 Message-ID: Subject: Creating Lua programs on Windows Mobile From: Daniel Florio To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000e0cd72b2cec1fdc0476618efd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd72b2cec1fdc0476618efd Content-Type: text/plain; charset=ISO-8859-1 Hi people, I'm new on Lua world and i'm doing some explorations. I want to start to create programs to mobile phones, but i don't have any idea from where to start. I received a tip to try to start making little programs to Windows Mobile, but i can't find an interpreter to run my lua programs on WM. Anyone can help me? Thanks Daniel Florio --000e0cd72b2cec1fdc0476618efd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi people,

I'm new on Lua world and i'm doing some explorati= ons. I want to start to create programs to mobile phones, but i don't h= ave any idea from where to start.
I received a tip to try to start maki= ng little programs to Windows Mobile, but i can't find an interpreter t= o run my lua programs on WM.

Anyone can help me?

Thanks

Daniel Florio
--000e0cd72b2cec1fdc0476618efd-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 16:14:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KIECgX031789; Tue, 20 Oct 2009 16:14:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C74D1A66D; Tue, 20 Oct 2009 16:12:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EB801A662 for ; Tue, 20 Oct 2009 16:12:53 -0200 (BRST) Received: by qyk14 with SMTP id 14so4266497qyk.11 for ; Tue, 20 Oct 2009 11:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=jpE5+A2yRb7ozQrL2wCNpLFSGiA6UwROnplYfbjAiDc=; b=S+Cgr/rab2LCJR3Z27LV0MkJiOXfQEGGcdSQTek/aB6fj5OhkbvFC5D2e6PEtdcGoK nKtlqLPApTocri+VgwRqeSWSDUsUkUBLS+aS10kB5hpqRJeo8j8B9RderXZvOZw6HvcZ iJOPZu9qQTN9KC/UakozWrYUpvC0tLQBZDf/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bTPieKFiZ++QAbEa5MKCkDQVm3jh9xVFdBKpyJYJAUPO7dX0um9kYzTXLHMCKad2ci XRSfwZkesalbH54A3V5LoyrPptjVZR6g4KDLBeOjWxsLxVyaq4j1v/lcD736PJF1atLo RkVsIy3K0hoPFmNRczCtJgLb/KtTCOQSaeLRc= MIME-Version: 1.0 Received: by 10.239.194.137 with SMTP id n9mr537644hbi.15.1256062417896; Tue, 20 Oct 2009 11:13:37 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Oct 2009 14:13:37 -0400 Message-ID: Subject: Re: Creating Lua programs on Windows Mobile From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Daniel, This might be a place to start - http://luapocket.luaforge.net/ . Cheers Andrew On Tue, Oct 20, 2009 at 1:54 PM, Daniel Florio wrote: > Hi people, > > I'm new on Lua world and i'm doing some explorations. I want to start to > create programs to mobile phones, but i don't have any idea from where to > start. > I received a tip to try to start making little programs to Windows Mobile, > but i can't find an interpreter to run my lua programs on WM. > > Anyone can help me? > > Thanks > > Daniel Florio > From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 16:15:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KIEoII031986; Tue, 20 Oct 2009 16:14:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AED91A678; Tue, 20 Oct 2009 16:13:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5090B1A66F for ; Tue, 20 Oct 2009 16:13:26 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9KIEDPP024630 for ; Tue, 20 Oct 2009 16:14:13 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 82A0F54C07E; Tue, 20 Oct 2009 16:14:13 -0200 (BRST) Date: Tue, 20 Oct 2009 16:14:13 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Weak keyed tables with primitive keys Message-ID: <20091020181413.GA3341@inf.puc-rio.br> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > In my experience: numbers, strings, and boolean values aren't eligible > for collection in this manner: > > [...] > > I've never looked into the implementation reasons for this, but I > suspect there's a fairly good reason =). You will not find the reason in the implementation, quite the opposite. See PiL Chapter 17: Notice that only objects can be collected from a weak table. Values, such as numbers and booleans, are not collectible. [...] Strings present a subtlety here: Although strings are collectible, from an implementation point of view, they are not like other collectible objects. [...] -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 16:42:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KIgNwV008251; Tue, 20 Oct 2009 16:42:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C641E18B15; Tue, 20 Oct 2009 16:40:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E0A1318A35 for ; Tue, 20 Oct 2009 16:40:51 -0200 (BRST) Received: by ewy26 with SMTP id 26so5898696ewy.5 for ; Tue, 20 Oct 2009 11:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=/oVBDflBWp1yjnuvJnBtPuqvvo4SUsILUsMb8EcQ+Xc=; b=dZP1JWTfVuOpvi7pZR1dqwDTE/3/leO8ZDKJRDp4DrgZDxEpogolQAgQ+OvFItSo/W K9fdKD3nF/B/EtfxdszbeSZqqhqjRgt6HSx3Fzg84KzVQl+7+m09g9fyFXzM0TfKfOZ7 CPKKMEUUJjQXObCmoS/xApXfFZlGjyd1m5AxY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=XFuqHp+tL9KQoee/h40MCUWB41c50ZVOqsy5Th6q+wJ8Y5+NAFupkkRnvdS0015VxC +vz4clePPXAaBm62/E0lXH5hcTqzWHQNUQ33rBzxvD6CrJn0sea3TSXxowZbDACsk1ln CMWrEu9+xERARyAhMrYsJmaCOoc998sL40Dok= MIME-Version: 1.0 Received: by 10.211.160.11 with SMTP id m11mr7643949ebo.79.1256064096298; Tue, 20 Oct 2009 11:41:36 -0700 (PDT) Date: Tue, 20 Oct 2009 20:41:36 +0200 X-Google-Sender-Auth: a661374a4b6d25d3 Message-ID: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Subject: Can someone convert this POSIX regex to a Lua regex? From: =?UTF-8?Q?Linus_Sj=C3=B6gren?= To: Lua list Content-Type: multipart/alternative; boundary=00504502d1c646689e0476623616 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502d1c646689e0476623616 Content-Type: text/plain; charset=UTF-8 Here's the regex in question: '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| )+$' Thanks in advance... --00504502d1c646689e0476623616 Content-Type: text/html; charset=UTF-8 Here's the regex in question:

'^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| )+$'

Thanks in advance... --00504502d1c646689e0476623616-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 16:48:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KImduI010740; Tue, 20 Oct 2009 16:48:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE1AC18D03; Tue, 20 Oct 2009 16:47:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp188.iad.emailsrvr.com (smtp188.iad.emailsrvr.com [207.97.245.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4504018A74 for ; Tue, 20 Oct 2009 16:47:20 -0200 (BRST) Received: from relay8.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay8.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 1EC80202DD1 for ; Tue, 20 Oct 2009 14:48:06 -0400 (EDT) Received: by relay8.relay.iad.mlsrvr.com (Authenticated sender: garyb-AT-strata.com) with ESMTPSA id E60011FFE5D for ; Tue, 20 Oct 2009 14:48:05 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Weak keyed tables with primitive keys From: Gary Bringhurst In-Reply-To: Date: Tue, 20 Oct 2009 12:48:04 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks Peter. That makes sense to me. -gary On Oct 20, 2009, at 10:16 AM, Peter Cawley wrote: > I believe that the following two excerpts from the the Lua 5.1 > reference manual mean that strings, booleans, and numbers are always > strongly referenced, even in situations where other types would be > weak referenced (as in weak tables). > > 2.10.2 - "In other words, if the only references to an object are weak > references, then the garbage collector will collect this object." > 2.2(.0) - "Tables, functions, threads, and (full) userdata values > are objects" > > On Tue, Oct 20, 2009 at 4:04 PM, Gary Bringhurst > wrote: >> My google fu is failing me on this one. >> >> Where can I find a definitive discussion of weak keyed tables and the >> behavior of primitive data types as those weak keys? My tests say >> that >> unique string keys are never collected, and while I can see a >> justification >> for that I'd really like to know the relationship of primitive >> types such as >> strings to the garbage collector. Do we have to use tables or user >> data as >> keys in weak keyed tables in order for them to be collected? >> >> Many thanks in advance, >> Gary Bringhurst >> >> From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 16:53:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KIr0oT011899; Tue, 20 Oct 2009 16:53:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1A2518F02; Tue, 20 Oct 2009 16:51:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mengele.ibawizard.net (ibawizard.net [82.208.49.253]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 43CFC18C55 for ; Tue, 20 Oct 2009 16:51:40 -0200 (BRST) Received: by mengele.ibawizard.net (Postfix, from userid 1002) id 2B9561D36078; Tue, 20 Oct 2009 20:52:20 +0200 (CEST) Date: Tue, 20 Oct 2009 20:52:20 +0200 From: Petr =?iso-8859-2?Q?=A9tetiar?= To: Lua list Subject: Re: Creating Lua programs on Windows Mobile Message-ID: <20091020185220.GA21833@ibawizard.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Daniel Florio [2009-10-20 15:54:48]: > Hi people, Hi, > I'm new on Lua world and i'm doing some explorations. I want to start to > create programs to mobile phones, but i don't have any idea from where to > start. > I received a tip to try to start making little programs to Windows Mobile, > but i can't find an interpreter to run my lua programs on WM. This should run on WM http://github.com/ynezz/luace/downloads also. If not, I think, that you can recompile easily... -- ynezz From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 17:33:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KJXjCe023833; Tue, 20 Oct 2009 17:33:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D77018F06; Tue, 20 Oct 2009 17:32:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout4.netvision.net.il (mxout4.netvision.net.il [194.90.9.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7668518E73 for ; Tue, 20 Oct 2009 17:32:17 -0200 (BRST) Received: from [93.172.139.190] by mxout4.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KRT00CTJVN1FJ90@mxout4.netvision.net.il> for lua@bazar2.conectiva.com.br; Tue, 20 Oct 2009 21:33:01 +0200 (IST) Date: Tue, 20 Oct 2009 21:33:04 +0200 From: Shmuel Zeigerman Subject: Re: Can someone convert this POSIX regex to a Lua regex? In-reply-to: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> To: Lua list Message-id: <4ADE1070.9070805@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8BIT References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Linus Sjögren wrote: > Here's the regex in question: > > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| > )+$' Lua regular expressions are less powerful than POSIX ones (while being quite adequate for most pattern matching tasks). The above pattern is not convertible to a Lua pattern. You can use POSIX patterns in Lua with Lrexlib (its POSIX part). -- Shmuel From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 17:37:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KJbmvi024999; Tue, 20 Oct 2009 17:37:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA29F193D3; Tue, 20 Oct 2009 17:36:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FB9318EA5 for ; Tue, 20 Oct 2009 17:36:32 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KJbIqS024849 for ; Tue, 20 Oct 2009 17:37:18 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9KJbIk30377; Tue, 20 Oct 2009 17:37:18 -0200 Date: Tue, 20 Oct 2009 17:37:18 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Can someone convert this POSIX regex to a Lua regex? Message-ID: <20091020173717.A30371@lua.tecgraf.puc-rio.br> References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com>; from thelinx@unreliablepollution.net on Tue, Oct 20, 2009 at 08:41:36PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| > )+$' I cannot be converted directly but if you tell what you're trying to match, perhaps we can offer solutions in Lua. From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 17:43:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KJhXW9026206; Tue, 20 Oct 2009 17:43:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70FFE193D9; Tue, 20 Oct 2009 17:42:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from esemetz.metz.supelec.fr (esemetz.metz.supelec.fr [193.48.224.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A8B018EA5 for ; Tue, 20 Oct 2009 17:42:11 -0200 (BRST) Received: from mx1.metz.supelec.fr (mx1.metz.supelec.fr [193.48.224.216]) by esemetz.metz.supelec.fr (8.14.1/8.14.1) with ESMTP id n9KJgrQt009655 for ; Tue, 20 Oct 2009 21:42:54 +0200 Received: from [127.0.0.1] (Java_cJ@duboucher.rez-metz.supelec.fr [193.48.225.222] (may be forged)) by mx1.metz.supelec.fr (8.14.1/8.14.1) with ESMTP id n9KJgl5N012309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 20 Oct 2009 21:42:48 +0200 Message-ID: <4ADE1298.7040300@duboucher.eu> Date: Tue, 20 Oct 2009 21:42:16 +0200 From: Duboucher Thomas User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Can someone convert this POSIX regex to a Lua regex? References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> <20091020173717.A30371@lua.tecgraf.puc-rio.br> In-Reply-To: <20091020173717.A30371@lua.tecgraf.puc-rio.br> X-Enigmail-Version: 0.96.0 OpenPGP: id=A79F86A8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV 0.94.1/9912/Tue Oct 20 03:06:47 2009 on mx1.metz.supelec.fr X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on mx1.metz.supelec.fr X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (esemetz.metz.supelec.fr [193.48.224.212]); Tue, 20 Oct 2009 21:42:54 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx1.metz.supelec.fr [193.48.224.216]); Tue, 20 Oct 2009 21:42:53 +0200 (CEST) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Luiz Henrique de Figueiredo a écrit : >> '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| >> )+$' > > I cannot be converted directly but if you tell what you're trying to match, > perhaps we can offer solutions in Lua. > Looks like finding 'C''s functions IMHO ;) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkreEpgACgkQBV7eXqefhqhQhACfempDmJ/RSnHw56gaz+3s9Xpb B1MAoLZzZ0cGhd3x+T5cCfTusQCu5xhi =qkA+ -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 17:58:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KJw1hJ029928; Tue, 20 Oct 2009 17:58:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E6E21A5A9; Tue, 20 Oct 2009 17:56:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1AB718C14 for ; Tue, 20 Oct 2009 17:56:42 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N0Kpl-00006J-Le for lua@bazar2.conectiva.com.br; Tue, 20 Oct 2009 12:57:29 -0700 Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: Norbert Kiesel To: Lua list In-Reply-To: <20091020173717.A30371@lua.tecgraf.puc-rio.br> References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> <20091020173717.A30371@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset="UTF-8" Date: Tue, 20 Oct 2009 12:57:25 -0700 Message-Id: <1256068645.16263.83.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 2009-10-20 at 17:37 -0200, Luiz Henrique de Figueiredo wrote: > > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| > > )+$' > > I cannot be converted directly but if you tell what you're trying to match, > perhaps we can offer solutions in Lua. Actually started doing that, but it's quite complicated. Can we have | in Lua regexp pretty please? I can work around most other limitations, but alternatives are hard (especially like /hi (foo|bar)+ there/). From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 18:06:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KK6E10031732; Tue, 20 Oct 2009 18:06:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D3F3193DF; Tue, 20 Oct 2009 18:05:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99CC618C14 for ; Tue, 20 Oct 2009 18:04:56 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so665574qwb.11 for ; Tue, 20 Oct 2009 13:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bj2CSpemuiuF6kRP+wkDCJeGMUzOJFjr0a1l69InDLk=; b=KV6hIxi+i1BpIpTuwYyLl9Cewe3100ReKxsBtd3+nB3OFpOdZ790v4ZHMx0gp2R4kd qEFzfOj5hkz0jFRtkrYW9oR6nsEV+l+ppA1e0GTSS53Zf1fyPFS7VzJRdxpuSj6RXLSF 7xD4DiI1aHtRh51YCTKTOgXkUC1VmvCAAzkdw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rpLuyrW1ea6j8Bs/uUhsipwjAFkjCx8Rg3xiriIhHYi0GKtycJ2L2WIDqsR5Eo/hT3 qvMqXS7Nkkar3pFMi2Yvws6bqk23F0J8Z1CFULmm2UzFpYDzQzXzrpLfvFJHq8URIbaZ rlECJRwF+0Z6WRnr/YTKXbWkk3Zki1v/U5kzk= MIME-Version: 1.0 Received: by 10.229.9.83 with SMTP id k19mr961409qck.47.1256069143963; Tue, 20 Oct 2009 13:05:43 -0700 (PDT) In-Reply-To: <1256068645.16263.83.camel@defiant.tbdnetworks.com> References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> <20091020173717.A30371@lua.tecgraf.puc-rio.br> <1256068645.16263.83.camel@defiant.tbdnetworks.com> Date: Wed, 21 Oct 2009 01:35:43 +0530 Message-ID: <2610f25f0910201305o435e3ec0va0b4e28908b98bf7@mail.gmail.com> Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: Rajesh Malepati To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9KK6E10031732 On Wed, Oct 21, 2009 at 1:27 AM, Norbert Kiesel wrote: > On Tue, 2009-10-20 at 17:37 -0200, Luiz Henrique de Figueiredo wrote: >> > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| >> > )+$' >[snip] > Actually started doing that, but it's quite complicated.  Can we have | > in Lua regexp pretty please?  I can work around most other limitations, > but alternatives are hard (especially like /hi (foo|bar)+ there/). Can you try using LPeg instead ? See http://www.inf.puc-rio.br/~roberto/lpeg/ Regards, Rajesh From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 18:13:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KKDl7a000696; Tue, 20 Oct 2009 18:13:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49514193D6; Tue, 20 Oct 2009 18:12:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2149C18F13 for ; Tue, 20 Oct 2009 18:12:24 -0200 (BRST) Received: by fxm12 with SMTP id 12so7082521fxm.5 for ; Tue, 20 Oct 2009 13:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uR9iVkHWYdXryueLi/bM6jYvFjjJedZRGgp6JZTUWZ4=; b=RQk0f2BKwA/ZCqPHo5SxagKvTskewnAgN9lu2zwJl/u5Lp5ciqiCoDCj7ldUay07fk rGmKNZbyRV5fRRyapJ4OzgHGVoWN4JyS1Bj8cVxVnLZAUvri0Gw6JZvSkjLuYwt5zQW9 quew85lFaRtLImAZVH9+kDxfCqI1X01ajoP/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uhE5VtLF//3AAAdEcn8K3iMgnZZVpWaa6CNQSbz95FN+XxMCnQlXKf/xECsGNjeU6q JBGq9o5dcO2tWUS69zS2WvcnS8TMvWYtgurIRaAnqjUutWJD7XZIyhRrNOkFg5s40nAQ L8EACWkJku5l1pUTKmKy6n3FxiT3AvQdCqrKw= MIME-Version: 1.0 Received: by 10.223.144.85 with SMTP id y21mr1328333fau.1.1256069591607; Tue, 20 Oct 2009 13:13:11 -0700 (PDT) In-Reply-To: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Date: Tue, 20 Oct 2009 21:13:11 +0100 Message-ID: Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9KKDl7a000696 On Tue, Oct 20, 2009 at 7:41 PM, Linus Sjögren wrote: > Here's the regex in question: > > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| > )+$' > > Thanks in advance... Lua's string patterns are not full regular expressions, and simply don't support many constructs like (pattern1|pattern2) or (pattern)+. You cannot have an exact equivalent to this regular expression in a single string pattern, but would instead have to break down what you want to do into a function. Alternatively, you could look into LPEG, or one of the bindings available for providing full regular expressions in Lua. However, if you'd like to see what a "pure-Lua" solution would look like, here is one. It's not exactly identical, because unlike your regex it will fail to match things like 'pi()' and 'pipi', but I can't imagine that was intentional anyway. match() is a function that takes a string and returns either nil if the string does not match, or a table of captures: -- code start local funcnames = { ceil=1, abs=1, floor=1, mod=1, exp=1, log=1, pow=1, sqrt=1, acos=1, asin=1, atan=1, cos=1, sin=1, tan=1, deg=1, rad=1, random=1 } local constnames = { pi=1 } function match(str) local pos = 1 local caps = {} while (pos <= #str) do -- first try to capture single characters local char = str:match('^[%(%)%-%+%*%/%d%.%^, ]', pos) if char then caps[#caps+1] = char pos = pos + 1 else -- now try to capture multi-character sequences local name, paren, new_pos = str:match('^(%w+)(%(?)()', pos) if (name == nil) or (paren == '' and not constnames[name]) or (paren == '(' and not funcnames[name]) then return nil end caps[#caps+1] = name .. paren pos = new_pos end end return caps end -- code end (I agree with Norbert that | would be great addition, if it could be achieved without causing too much extra complexity/bloat to the Lua source...) -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 18:42:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KKg9J8006933; Tue, 20 Oct 2009 18:42:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 509F21A65F; Tue, 20 Oct 2009 18:40:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F8201A5E7 for ; Tue, 20 Oct 2009 18:40:36 -0200 (BRST) Received: by fxm12 with SMTP id 12so7114568fxm.5 for ; Tue, 20 Oct 2009 13:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=7ip3EU2tS5B+fxFYo/s+WaEPp7qPo/oCa38TwoIaEZ4=; b=qZVpw7aTd8vD0dEIy06Q3piKsY8b/kokNRtjD5OXpukmB29WfnN+o4W0312qp96iYn h5vyx4EWWsAxP83N8rqu0q1RLbG9ThSR7Q/Cc3+6Sy212zr7CydVES8YlaqcwheZtIdJ 4IwUafmoZyVnNcacahRCFQX8v640cTTLQGhmk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=VB699zdZG9lUVQQ2sZ0mZe26Kz4xOAVBjIUe9qdKKG6pgf/hFhe5DtyBjLswJx/J8+ hOR0HWZy7+lN/VoCl2N9G9Yjrg/Ki+cyj7p+P7s+zP8NBj87WA714sGy0/Jf3CKYvn2I pl6cVooF0AhbS+ZPENbFR8aIR6i7aeXrJuEh4= MIME-Version: 1.0 Received: by 10.204.24.69 with SMTP id u5mr7020873bkb.1.1256071282727; Tue, 20 Oct 2009 13:41:22 -0700 (PDT) In-Reply-To: References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Date: Tue, 20 Oct 2009 15:41:22 -0500 X-Google-Sender-Auth: e88b30b9aa009e87 Message-ID: <5ba75e2f0910201341g8d27830s1767e568d5fdf664@mail.gmail.com> Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0003255547669e9d47047663e2ba X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255547669e9d47047663e2ba Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I had a lot of PCRE to convert before, but as said, there are limitations, please USE lrexlib if you don't want to do a mess mixing lua's regexp with functions. More info: http://lrexlib.luaforge.net/manual.html Blessings! On Tue, Oct 20, 2009 at 3:13 PM, Duncan Cross wrote= : > On Tue, Oct 20, 2009 at 7:41 PM, Linus Sj=C3=B6gren > wrote: > > Here's the regex in question: > > > > > '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|de= g|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| > > )+$' > > > > Thanks in advance... > > Lua's string patterns are not full regular expressions, and simply > don't support many constructs like (pattern1|pattern2) or (pattern)+. > You cannot have an exact equivalent to this regular expression in a > single string pattern, but would instead have to break down what you > want to do into a function. > > Alternatively, you could look into LPEG, or one of the bindings > available for providing full regular expressions in Lua. > > However, if you'd like to see what a "pure-Lua" solution would look > like, here is one. It's not exactly identical, because unlike your > regex it will fail to match things like 'pi()' and 'pipi', but I can't > imagine that was intentional anyway. match() is a function that takes > a string and returns either nil if the string does not match, or a > table of captures: > > > -- code start > local funcnames =3D { > ceil=3D1, abs=3D1, floor=3D1, mod=3D1, exp=3D1, log=3D1, pow=3D1, sqrt= =3D1, > acos=3D1, asin=3D1, atan=3D1, cos=3D1, sin=3D1, tan=3D1, deg=3D1, rad=3D= 1, > random=3D1 > } > local constnames =3D { > pi=3D1 > } > > function match(str) > local pos =3D 1 > local caps =3D {} > while (pos <=3D #str) do > -- first try to capture single characters > local char =3D str:match('^[%(%)%-%+%*%/%d%.%^, ]', pos) > if char then > caps[#caps+1] =3D char > pos =3D pos + 1 > else > -- now try to capture multi-character sequences > local name, paren, new_pos =3D str:match('^(%w+)(%(?)()', pos) > if (name =3D=3D nil) or (paren =3D=3D '' and not constnames[na= me]) > or (paren =3D=3D '(' and not funcnames[name])= then > return nil > end > caps[#caps+1] =3D name .. paren > pos =3D new_pos > end > end > return caps > end > -- code end > > > (I agree with Norbert that | would be great addition, if it could be > achieved without causing too much extra complexity/bloat to the Lua > source...) > > -Duncan > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0003255547669e9d47047663e2ba Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I had a lot of PCRE to convert before, but as said, there are limitations, = please USE lrexlib if you don't want to do a mess mixing lua's rege= xp with functions.
More info: http://lrexlib.luaforge.net/manual.html

Blessings!

On Tue, Oct 20, 2009 at 3:= 13 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
On Tue, Oct 20, 2009 at 7:41 PM, Linus Sj= =C3=B6gren
<thelinx@unreliablepo= llution.net> wrote:
> Here's the regex in question:
>
> '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin= |tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C|
> )+$'
>
> Thanks in advance...

Lua's string patterns are not full regular expressions, and= simply
don't support many constructs like (pattern1|pattern2) or (pattern)+. You cannot have an exact equivalent to this regular expression in a
single string pattern, but would instead have to break down what you
want to do into a function.

Alternatively, you could look into LPEG, or one of the bindings
available for providing full regular expressions in Lua.

However, if you'd like to see what a "pure-Lua" solution woul= d look
like, here is one. It's not exactly identical, because unlike your
regex it will fail to match things like 'pi()' and 'pipi', = but I can't
imagine that was intentional anyway. match() is a function that takes
a string and returns either nil if the string does not match, or a
table of captures:


-- code start
local funcnames =3D {
=C2=A0ceil=3D1, abs=3D1, floor=3D1, mod=3D1, exp=3D1, log=3D1, pow=3D1, sq= rt=3D1,
=C2=A0acos=3D1, asin=3D1, atan=3D1, cos=3D1, sin=3D1, tan=3D1, deg=3D1, ra= d=3D1,
=C2=A0random=3D1
}
local constnames =3D {
=C2=A0pi=3D1
}

function match(str)
=C2=A0 =C2=A0local pos =3D 1
=C2=A0 =C2=A0local caps =3D {}
=C2=A0 =C2=A0while (pos <=3D #str) do
=C2=A0 =C2=A0 =C2=A0 =C2=A0-- first try to capture single characters
=C2=A0 =C2=A0 =C2=A0 =C2=A0local char =3D str:match('^[%(%)%-%+%*%/%d%= .%^, ]', pos)
=C2=A0 =C2=A0 =C2=A0 =C2=A0if char then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0caps[#caps+1] =3D char
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pos =3D pos + 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- now try to capture multi-chara= cter sequences
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0local name, paren, new_pos =3D st= r:match('^(%w+)(%(?)()', pos)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (name =3D=3D nil) or (paren = =3D=3D '' and not constnames[name])
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 or (paren =3D=3D '(' and not funcnames[nam= e]) then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0caps[#caps+1] =3D name .. paren =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pos =3D new_pos
=C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0end
=C2=A0 =C2=A0return caps
end
-- code end


(I agree with Norbert that | would be great addition, if it could be
achieved without causing too much extra complexity/bloat to the Lua
source...)

-Duncan



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0003255547669e9d47047663e2ba-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 18:43:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KKh5jh007178; Tue, 20 Oct 2009 18:43:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A8E41A661; Tue, 20 Oct 2009 18:41:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6226B1A5E7 for ; Tue, 20 Oct 2009 18:41:44 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8AD96AD930 for ; Tue, 20 Oct 2009 16:42:30 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 20 Oct 2009 16:42:30 -0400 X-Sasl-enc: 9P62XXZjNLSYYiYruS3JMmYh/d7DROuiOwYelp/yAxMR 1256071349 Received: from [10.1.1.4] (222-152-77-118.jetstream.xtra.co.nz [222.152.77.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id 7558A2C238 for ; Tue, 20 Oct 2009 16:42:29 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Documentation Markup From: Geoff Leyland In-Reply-To: <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> Date: Wed, 21 Oct 2009 09:41:56 +1300 Content-Transfer-Encoding: 7bit Message-Id: <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/10/2009, at 2:19 AM, steve donovan wrote: > On Fri, Oct 9, 2009 at 3:06 PM, Robert Raschke > wrote: >> can't remember the changes. It would probably be pretty trivial to >> change it >> to allow markdown. > > In fact, I bet you that a hundred lines of Lua will do the whole job > nicely - pretty-printing can be done as an afterthought, using some > styling and client Javascript. One of those satisfying > rainy-afternoon jobs. The weather's actually starting to improve down here (though I'm sure nothing like SA), but nonetheless you can get a rough cut of doctest.lua from http://www.incremental.co.nz/projects/lua.html (BTW, how's the snippet site coming on?). doctest.lua reads a markdown file and tries to execute any code snippets it finds, reporting errors and matching output. It's not great, it's sufficient. I haven't started on the opposite tool, that reads a Lua file with markdown in the comments, turns it into a markdown file with Lua in code blocks and checks that the Lua output matches specially marked up output. I haven't tried syntax-coloring either. There must be something that does that, right? Or is the attraction of pure Lua enough to make it worth building that wheel? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 19:47:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9KLlGY8018117; Tue, 20 Oct 2009 19:47:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A12E0191F2; Tue, 20 Oct 2009 19:45:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83E3618C2F for ; Tue, 20 Oct 2009 19:45:49 -0200 (BRST) Received: by fxm12 with SMTP id 12so7186967fxm.5 for ; Tue, 20 Oct 2009 14:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rYtMT/gVtBTO/xhhOOca0RMuXscyoMZdCxY+rhZVZMI=; b=PlndL/JEE9g8tD+rBKuxSneS1l56L0c5BuQbHhStW+U017CsUVVXBxSa46/fFMg6Wm 6RxouNtVIO0O4CqvzzkStg2SuDvVUHd31ILm3IMfx49GBegMqdXpJpktLlWtmklUekL2 t/1PSZo7ZcglF0cu01jmvXOf8aCoLoIUa1TV0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=M+4udjb37PHgwLynnG9Ma2ev7N4IehD17AHPtuaG3J7L0W1kho8FIe0+N6ICVyZft7 Qmq3vDS3OkCCzX9g7B/FtDzcKrKsUwlTRyPDYNb+22/OKWkFhuPg9RbQDUa5YVRYY8o9 ET7tOiDUiTs6lQC57oy83J43MOgGGTjTYXMW4= MIME-Version: 1.0 Received: by 10.204.48.141 with SMTP id r13mr6435271bkf.0.1256075195661; Tue, 20 Oct 2009 14:46:35 -0700 (PDT) In-Reply-To: <20091020185220.GA21833@ibawizard.net> References: <20091020185220.GA21833@ibawizard.net> Date: Tue, 20 Oct 2009 23:46:35 +0200 Message-ID: <222ade940910201446x710463e3wc5daca23de9a0798@mail.gmail.com> Subject: Re: Creating Lua programs on Windows Mobile From: Vincent Torri To: Lua list Content-Type: multipart/alternative; boundary=000325558d66d93fa3047664cbcc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325558d66d93fa3047664cbcc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Oct 20, 2009 at 8:52 PM, Petr =C5=A0tetiar wrote: > Daniel Florio [2009-10-20 15:54:48]: > > > Hi people, > > Hi, > > > I'm new on Lua world and i'm doing some explorations. I want to start t= o > > create programs to mobile phones, but i don't have any idea from where = to > > start. > > I received a tip to try to start making little programs to Windows > Mobile, > > but i can't find an interpreter to run my lua programs on WM. > > This should run on WM http://github.com/ynezz/luace/downloads also. If > not, > I think, that you can recompile easily... > > But is there an official repository of lua for Windows CE / WM ? Vincent Torri --000325558d66d93fa3047664cbcc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Tue, Oct 20, 2009 at 8:52 PM, Petr = =C5=A0tetiar <ynezz@t= rue.cz> wrote:
Daniel Florio <erunamo.flori= o@gmail.com> [2009-10-20 15:54:48]:

> Hi people,

Hi,

> I'm new on Lua world and i'm doing some explorations. I want t= o start to
> create programs to mobile phones, but i don't have any idea from w= here to
> start.
> I received a tip to try to start making little programs to Windows Mob= ile,
> but i can't find an interpreter to run my lua programs on WM.

This should run on WM http://github.com/ynezz/luace/downloads also. If= not,
I think, that you can recompile easily...

But is there an official repository of lua for Window= s CE / WM ?

Vincent Torri

--000325558d66d93fa3047664cbcc-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 22:17:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L0Hlfj009320; Tue, 20 Oct 2009 22:17:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93663188EF; Tue, 20 Oct 2009 22:16:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B379188A4 for ; Tue, 20 Oct 2009 22:16:20 -0200 (BRST) Received: by ewy26 with SMTP id 26so6212568ewy.5 for ; Tue, 20 Oct 2009 17:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:to:date:subject :mime-version:content-transfer-encoding:from:message-id:user-agent; bh=pQxV8BNxBb6WyE+p5u+mWYIljRew8Rsh+vHLGJKQB5c=; b=NjLAhh+7tpHTP/JjlvnEVzIov8eJytM2BSm6DPxz2AU9pA8L8X5TKkeD+cDYw8P/P7 J9SgNyPkcnbd5uI8ODiJWjiRtQP6qRIgwl1AH5Kn/KBDlDrFstG9OVH2lggReVh1dGLK kj131HmZ11LbB3M2sycV0iAkhtbVuqK+osWNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:to:date:subject:mime-version:content-transfer-encoding :from:message-id:user-agent; b=nj9Jww2+4igHbD6E2Xm25Ca4VgdRLTsLHMpk/Rj+xe9W80iOoQU4QVwpkwVsnie+VJ opjFKoNd2OcGg9FleEeEaQsu6577fmEhgIuwM3UXf1b2QC1kJgvUpEaUu3gXTq/l21KT xLQbOeqzvz7V2SxE+gQMG6G88gBfZ1bJeO1kA= Received: by 10.216.87.144 with SMTP id y16mr32707wee.95.1256084227730; Tue, 20 Oct 2009 17:17:07 -0700 (PDT) Received: from desktop.neo.rr.com (cpe-76-188-68-197.neo.res.rr.com [76.188.68.197]) by mx.google.com with ESMTPS id 10sm714855eyd.8.2009.10.20.17.17.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 20 Oct 2009 17:17:06 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: lua@bazar2.conectiva.com.br Date: Tue, 20 Oct 2009 20:14:45 -0500 Subject: A Lua to JavaScript translator MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Phil Deets" Message-ID: User-Agent: Opera Mail/10.00 (Win32) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I have been thinking about writing a Lua to JavaScript translator. The main use case would simply be to provide an alternative language for the web. You would just have to run the translator before you use the script. This would be different than the lua2js which already exists on LuaForge since I would want to make it work in all cases with the only restrictions being on what modules can be used. I think lua2js only does a superficial translation. For example, I don't think it handles using functions as an index into a table. I do not have a goal of making the output readable. In fact I might purposely obfuscate the output to hinder reverse-engineering efforts of the translated code. The approach that seems the easiest to me is to run the Lua source through luac.exe and use the output of luac as the input of the translator. This way I don't have to worry about lexing or parsing. I also could have a smaller range of inputs to worry about; there would only be the 38 types of instructions to translate. The down-side to this approach is that the format of the luac output could change significantly between versions. Now for my questions: Is this already being work on? Can you think of any major problems that would prevent the approach described in the previous paragraph from working? Can you think of a better approach? Thanks, Phil P.S. I couldn't find a search feature for the mailing list archive; so sorry if this has already been discussed. From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 22:24:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L0OnN1010511; Tue, 20 Oct 2009 22:24:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79A13193B5; Tue, 20 Oct 2009 22:23:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 538C7188EF for ; Tue, 20 Oct 2009 22:23:33 -0200 (BRST) Received: by fxm12 with SMTP id 12so7335076fxm.5 for ; Tue, 20 Oct 2009 17:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=WJu0Jn2/wfGZY4PnKA1YmL+kyVIVqGu1OWkI+DjS34Q=; b=c+DJjLZjkWNqwo2ZfZd2gAt7bgnqTD85ZIKCq/wLk5m3UHCJBHzyAVQk1MuJ2O6p5y wZbOpxPFWgPCMYsvXXcw5GIE9VwEB5GpnOexIHHEf20DKwCX8P6E+neCSHT1fkWdNm3t Sku9OmK62g7cXWunnHa1fMHwY5C3HmDWvop2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=QarpCl9HttV2LNth0qJMgMmIK2q8kYd9kWdxekCyzdyylJaleqRuBa7If1rzoikjDU xUjzuI0swnXFzrWPL/SnhPvTEOs17VJDs054bKdBRQqS3qgyDMJnpiVr9GMxjGy5jPMN PHWMNi3HOi5mcIcjSkqsPMoBycXbAHYUDbX6I= MIME-Version: 1.0 Received: by 10.204.157.21 with SMTP id z21mr7153774bkw.160.1256084660357; Tue, 20 Oct 2009 17:24:20 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Oct 2009 19:24:20 -0500 X-Google-Sender-Auth: bbae084d505e1b7c Message-ID: <5ba75e2f0910201724o72ffb7ccnd2a8d9fcb5764f25@mail.gmail.com> Subject: Re: A Lua to JavaScript translator From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cd1e8fd0b44047666ff06 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cd1e8fd0b44047666ff06 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Moonshine(http://code.google.com/p/mshine) is an XPI plug-in for firefox, s= o you can use Lua into Firefox and play with DOM. I interested in that project also. Blessings! On Tue, Oct 20, 2009 at 8:14 PM, Phil Deets wrote: > Hello, I have been thinking about writing a Lua to JavaScript translator. > The main use case would simply be to provide an alternative language for = the > web. You would just have to run the translator before you use the script. > > This would be different than the lua2js which already exists on LuaForge > since I would want to make it work in all cases with the only restriction= s > being on what modules can be used. I think lua2js only does a superficial > translation. For example, I don't think it handles using functions as an > index into a table. > > I do not have a goal of making the output readable. In fact I might > purposely obfuscate the output to hinder reverse-engineering efforts of t= he > translated code. > > The approach that seems the easiest to me is to run the Lua source throug= h > luac.exe and use the output of luac as the input of the translator. This = way > I don't have to worry about lexing or parsing. I also could have a smalle= r > range of inputs to worry about; there would only be the 38 types of > instructions to translate. The down-side to this approach is that the for= mat > of the luac output could change significantly between versions. > > Now for my questions: > Is this already being work on? > Can you think of any major problems that would prevent the approach > described in the previous paragraph from working? > Can you think of a better approach? > > Thanks, > Phil > > P.S. I couldn't find a search feature for the mailing list archive; so > sorry if this has already been discussed. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cd1e8fd0b44047666ff06 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Moonshine(http://code.google.co= m/p/mshine) is an XPI plug-in for firefox, so you can use Lua into Fire= fox and play with DOM.
I interested in that project also.

Blessin= gs!

On Tue, Oct 20, 2009 at 8:14 PM, Phil Deets = <pjdeets2@gmail.= com> wrote:
Hello, I have been thinking about writing a Lua to JavaScript translator. T= he main use case would simply be to provide an alternative language for the= web. You would just have to run the translator before you use the script.<= br>
This would be different than the lua2js which already exists on LuaForge si= nce I would want to make it work in all cases with the only restrictions be= ing on what modules can be used. I think lua2js only does a superficial tra= nslation. For example, I don't think it handles using functions as an i= ndex into a table.

I do not have a goal of making the output readable. In fact I might purpose= ly obfuscate the output to hinder reverse-engineering efforts of the transl= ated code.

The approach that seems the easiest to me is to run the Lua source through = luac.exe and use the output of luac as the input of the translator. This wa= y I don't have to worry about lexing or parsing. I also could have a sm= aller range of inputs to worry about; there would only be the 38 types of i= nstructions to translate. The down-side to this approach is that the format= of the luac output could change significantly between versions.

Now for my questions:
Is this already being work on?
Can you think of any major problems that would prevent the approach describ= ed in the previous paragraph from working?
Can you think of a better approach?

Thanks,
Phil

P.S. I couldn't find a search feature for the mailing list archive; so = sorry if this has already been discussed.



--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cd1e8fd0b44047666ff06-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 22:25:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L0Pj9r010659; Tue, 20 Oct 2009 22:25:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BD32193C6; Tue, 20 Oct 2009 22:24:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD305193C1 for ; Tue, 20 Oct 2009 22:24:35 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L0PMCK010631 for ; Tue, 20 Oct 2009 22:25:22 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n9L0PMS2010628 for lua@bazar2.conectiva.com.br; Tue, 20 Oct 2009 22:25:22 -0200 Date: Tue, 20 Oct 2009 22:25:22 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: A Lua to JavaScript translator Message-ID: <20091021002522.GA10449@duchamp.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I have been thinking about writing a Lua to JavaScript translator. See these for instance: http://stackoverflow.com/questions/176235/are-there-any-recent-lua-to-javascript-converters-or-interpreters-somewhere http://lua-users.org/lists/lua-l/2008-11/msg00243.html From lua-bounces@bazar2.conectiva.com.br Tue Oct 20 22:55:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L0tTDX015045; Tue, 20 Oct 2009 22:55:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27F0D193D7; Tue, 20 Oct 2009 22:54:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57CC4193CB for ; Tue, 20 Oct 2009 22:54:09 -0200 (BRST) Received: by gxk4 with SMTP id 4so5316407gxk.8 for ; Tue, 20 Oct 2009 17:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=ZRjOlYDr58D3V1mp+sBESiXx3Qwlwdn8mHMS4svGZSM=; b=UGqnlsj39mTcbaEAleRGxR/fB/GliNBNfJm+u3l07ZJEIHDFWQFztWZj7mwC1BC1sq iGPzu6lTcwVCCWo2RYgpe9aPjwcNoTZwE+u6Qt7JNrKw5LjRfCeKnM//HX/zq8mHqfmM jiKHuyKoDUtn4DjqUoJhfRth9HeO/k9eX3a/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=JAboXYKv2Tg2yp64Tq13yzW7MUBVMk81AML+xW56mj5p/T7YiWffnoR11FRaq7gw+U U3M+TaiMeg/ymGmWgH3aYxoMkexjDVa24lAE7YsbTLml10+EE4VMCvH2eISXrFE89myM 2Sn+N8O2e1SCm5ipI5BHUNW2xoAswp4NIHsBE= Received: by 10.150.233.3 with SMTP id f3mr11743913ybh.148.1256086495669; Tue, 20 Oct 2009 17:54:55 -0700 (PDT) Received: from ?192.168.2.100? (r190-135-8-88.dialup.adsl.anteldata.net.uy [190.135.8.88]) by mx.google.com with ESMTPS id 20sm3808841ywh.2.2009.10.20.17.54.52 (version=SSLv3 cipher=RC4-MD5); Tue, 20 Oct 2009 17:54:54 -0700 (PDT) Subject: Re: A simple SOAP client From: =?ISO-8859-1?Q?Andr=E9s?= Aguirre To: Lua list , williamgiannino@gmail.com In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Tue, 20 Oct 2009 22:54:49 -0200 Message-Id: <1256086489.9601.20.camel@andres-laptop2> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, we develop a mobile aplication with lua, and it uses luasoap for consuming web services published in a Jboss aplication server. It was quite simple to do it and it works very well. Now we are trying to port this application to android operating system, the main problem is to cross compile expat for android (has anyone tried this?). One thing that it could be improved is support for wssecurity in this library. Best regards Andrés El mar, 13-10-2009 a las 15:07 +0200, Thijs Koerselman escribió: > Hi, > > > I would like to write a simple SOAP client in Lua. I am using luarocks > and installed the Kepler project additionally. I found luasoap, but my > problem is that it relies on Expat, yet isn't available for luarocks. > Apparently it was developed as part of the Kepler project, but I > haven't found anything about SOAP in the Kepler documentation. > > > Luasoap is also quite old (2004) so I wonder if it is recommended. > > > If I'm going with luasoap, is there a way to add it to the luarocks > repository, so that it will automatically find luaexpat there too? > > > Thijs From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 02:40:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L4edGm013680; Wed, 21 Oct 2009 02:40:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73026193C4; Wed, 21 Oct 2009 02:39:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-152.bluehost.com (outbound-mail-152.bluehost.com [67.222.39.32]) by bazar2.conectiva.com.br (Postfix) with SMTP id 115B919377 for ; Wed, 21 Oct 2009 02:39:14 -0200 (BRST) Received: (qmail 31619 invoked by uid 0); 21 Oct 2009 04:40:00 -0000 Received: from unknown (HELO box524.bluehost.com) (74.220.219.124) by outboundproxy5.bluehost.com with SMTP; 21 Oct 2009 04:40:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=fmad.co.jp; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=Qn7gE21B4xOKHcJjPD71Dlhdfx/qa3aQHF0CirFfhUli7d4309mQcEsc55t1A8d4Wdyh0CgE0ZFVGoyoQPu4iuiRurwIArabpcOQ0PbM90kLONkQCoGORCxM9ilKHSpS; Received: from y228023.dynamic.ppp.asahi-net.or.jp ([118.243.228.23] helo=[10.0.2.15]) by box524.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1N0SzQ-0003yK-2r; Tue, 20 Oct 2009 22:40:00 -0600 Message-ID: <4ADE908F.9060203@fmad.co.jp> Date: Wed, 21 Oct 2009 13:39:43 +0900 From: info User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list , pjdeets2@gmail.com Subject: Re: A Lua to JavaScript translator References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {5082:box524.bluehost.com:fmadcom:fmad.com} {sentby:smtp auth 118.243.228.23 authed with aaron@fmad.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Phil, I`ve written similar code, where you write everyhing a web pages might need in lua and it compiles to html/css/js. Theres 2 approaches really: 1) parse lua source and output javascript 2) write a luavm in javascript We chose chose 1) purely for performance (warranted or not...) as it seemed the simpler choice at the time. Hindsight.. would consider 2) more carefully as 1) means using only a subset of the langauge.. and.. you have to be aware your writing javascript in lua.. We used lbc to do the trick, and its a fairly straight forward process - a few pages of code. Its far from perfect but supports enough of the language that theres no major mental switch between the subset and full spec. If you want any lua code to run 2) is the only real option. And you code this up let me know! Cheers, Aaron Phil Deets wrote: > Hello, I have been thinking about writing a Lua to JavaScript > translator. The main use case would simply be to provide an > alternative language for the web. You would just have to run the > translator before you use the script. > > This would be different than the lua2js which already exists on > LuaForge since I would want to make it work in all cases with the only > restrictions being on what modules can be used. I think lua2js only > does a superficial translation. For example, I don't think it handles > using functions as an index into a table. > > I do not have a goal of making the output readable. In fact I might > purposely obfuscate the output to hinder reverse-engineering efforts > of the translated code. > > The approach that seems the easiest to me is to run the Lua source > through luac.exe and use the output of luac as the input of the > translator. This way I don't have to worry about lexing or parsing. I > also could have a smaller range of inputs to worry about; there would > only be the 38 types of instructions to translate. The down-side to > this approach is that the format of the luac output could change > significantly between versions. > > Now for my questions: > Is this already being work on? > Can you think of any major problems that would prevent the approach > described in the previous paragraph from working? > Can you think of a better approach? > > Thanks, > Phil > > P.S. I couldn't find a search feature for the mailing list archive; so > sorry if this has already been discussed. > From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 03:04:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L54jga017989; Wed, 21 Oct 2009 03:04:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B315192C1; Wed, 21 Oct 2009 03:03:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D45E91929F for ; Wed, 21 Oct 2009 03:03:31 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N0TMv-0006Lj-73 for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 07:04:17 +0200 Received: from aaubervilliers-155-1-89-158.w90-61.abo.wanadoo.fr ([90.61.64.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Oct 2009 07:04:17 +0200 Received: from PhiLho by aaubervilliers-155-1-89-158.w90-61.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Oct 2009 07:04:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: A Lua to JavaScript translator Date: Wed, 21 Oct 2009 07:03:48 +0200 Lines: 13 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-89-158.w90-61.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-Antivirus: avast! (VPS 091020-0, 20/10/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 21/10/2009 03:14, Phil Deets wrote: > P.S. I couldn't find a search feature for the mailing list archive; so > sorry if this has already been discussed. From http://www.lua.org/lua-l.html You can read and search the archives at Conectiva, lua-users.org, MARC, and Gmane. (links on the page) -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 03:22:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L5M6iS020194; Wed, 21 Oct 2009 03:22:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6901F193D2; Wed, 21 Oct 2009 03:20:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-07.prod.phx3.secureserver.net (p3plsmtpa01-07.prod.phx3.secureserver.net [72.167.82.87]) by bazar2.conectiva.com.br (Postfix) with SMTP id BEF34193C3 for ; Wed, 21 Oct 2009 03:20:49 -0200 (BRST) Received: (qmail 13526 invoked from network); 21 Oct 2009 05:21:36 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-07.prod.phx3.secureserver.net (72.167.82.87) with ESMTP; 21 Oct 2009 05:21:36 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Weak keyed tables with primitive keys From: Mark Hamburg In-Reply-To: <20091020181413.GA3341@inf.puc-rio.br> Date: Tue, 20 Oct 2009 22:21:34 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <20091020181413.GA3341@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I understand the theoretical arguments for treating strings as values with respect to weak tables, but are there any practical benefits? It would seem, for example, to get in the way of caching the results of file reads a la: fileCache = setmetatable( { }, { __mode = 'kv', __index = function( t, k ) local v local f = io.open( k ) if f then v = f:read( "*a" ) t[ k ] = v f:close() end return v end } ) Mark From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 04:34:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L6YtlW032646; Wed, 21 Oct 2009 04:34:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0FA71A66D; Wed, 21 Oct 2009 04:33:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E32B01A668 for ; Wed, 21 Oct 2009 04:33:26 -0200 (BRST) Received: by bwz27 with SMTP id 27so179538bwz.21 for ; Tue, 20 Oct 2009 23:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vE+9hjZNlsGV0P1YqbbGSfnd52Ly7+S1AzuZQ1QR4c8=; b=HaSKvyk7tU3Ce9Moim+1S02MsqE2n40nycihL7sC2c8z426QqIpWmzxwgVQTSMFEfh NBtouZFpwZoyE/Lj0TfPAIJ88MDhj+socT8pxR5E5PCKYeqSFEqKLd+11ltCEABAg0d0 yc7xaEa7XjOzJ93LW5mNwMYc3o5zC157wh9BE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lFNeFtLYhkiy5FwppWWmgS+FXX+iG4nJb3HlbG7l0nn1jQu3t2lZTdKcekkILRg67V Zfivqfg4HeHTFDPsYCNmx68v5PyFFNsCjABBm3lHxgOJEMnBfAna2dCDD+IHFXqjTPWG nuY8j0/+rZxtaIi/Y2/R0lnDPzcamUVMOxJ8s= MIME-Version: 1.0 Received: by 10.239.139.80 with SMTP id s16mr651010hbs.111.1256106853740; Tue, 20 Oct 2009 23:34:13 -0700 (PDT) In-Reply-To: References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Date: Wed, 21 Oct 2009 08:34:13 +0200 Message-ID: <560972290910202334q16396ec6wfbd1051ac787a18c@mail.gmail.com> Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 20, 2009 at 10:13 PM, Duncan Cross wrote: > However, if you'd like to see what a "pure-Lua" solution would look > like, here is one. It's not exactly identical, because unlike your > regex it will fail to match things like 'pi()' and 'pipi', but I can't > imagine that was intentional anyway. That's the thing about regexes; a reasonably complicated one takes a whole mailing list thread to untangle ;) Another approach is to use a lexical analylizer: require 'lexer' local names = { -- functions ceil=1, abs=1, floor=1, mod=1, exp=1, log=1, pow=1, sqrt=1, acos=1, asin=1, atan=1, cos=1, sin=1, tan=1, deg=1, rad=1, random=1, -- constants pi = 0 } function match(str) local res = {} local tok = lexer.c(str) local t,val = tok() while t do if t == 'iden' and names[val] then if names[val] == 0 then table.insert(res,val) -- a constant! else -- a function; is it followed by parens? t,val = tok() if t == '(' then return table.insert(res,val..'(') end end end t,val = tok() end return res end This has the advantage of not being confused by things like /* sin(x) */ steve d. From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 04:40:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9L6enEN001015; Wed, 21 Oct 2009 04:40:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BB3A1855B; Wed, 21 Oct 2009 04:39:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF522193E4 for ; Wed, 21 Oct 2009 04:39:26 -0200 (BRST) Received: by fxm12 with SMTP id 12so7575711fxm.5 for ; Tue, 20 Oct 2009 23:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W9oaU+A9lju7eH2LjsOFTsW3L4XZBNl4/YOHZgGgW0c=; b=iPPosu8HtTFtzJzgAwAI3D3hiuCEVbnDUXPjVXLSet3UwtK0X1DfqBnkFOIAZLQLJG ag8QLilW+j/fWac3XnNg1xAivxD1ljQMx3ru6unXS9ak7pv5QNSj7Qr7v78rgjilHcvH eRwlharXJLYwGcy4qSBDlEYmic6T5zZ5ZTmsk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iozYxsMyX5sUHmeRDqmnI7MpfohDDjnyVJv2cRcWEVCGfhpX0OyMig9Ub7cU4bx+Hs FfDNrYqFnn2l9Ta94QYN3yWrqploNm+rTOLnEi1Aa9MKkMg9teTZRv3dWPAS4cwr9Afu zMJh3GPyZyix7ev4ek0Szvb6I/eEyEBg3qfsE= MIME-Version: 1.0 Received: by 10.239.168.131 with SMTP id k3mr583675hbe.101.1256107211632; Tue, 20 Oct 2009 23:40:11 -0700 (PDT) In-Reply-To: <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> Date: Wed, 21 Oct 2009 08:40:11 +0200 Message-ID: <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> Subject: Re: Documentation Markup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9L6enEN001015 On Tue, Oct 20, 2009 at 10:41 PM, Geoff Leyland wrote: > doctest.lua reads a markdown file and tries to execute any code snippets it > finds, reporting errors and matching output.  It's not great, it's > sufficient. Which is usually all that's needed! These are the kind of things everyone needs in their toolchest. > I haven't tried syntax-coloring either.  There must be something that does > that, right?  Or is the attraction of pure Lua enough to make it worth > building that wheel? People often use client-side Javascript, e.g. Alex Gorbatchev's syntax highlighter does Lua as well as the usual suspects. > from http://www.incremental.co.nz/projects/lua.html (BTW, how's the snippet > site coming on?). Not bad, we have a prototype. Been writing half-assed Lua parsing code to extract dependencies and exports from snippets automatically. steve d. From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 08:52:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LAqKdl006012; Wed, 21 Oct 2009 08:52:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CF8019342; Wed, 21 Oct 2009 08:51:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4515319322 for ; Wed, 21 Oct 2009 08:51:00 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9LApkYB005091 for ; Wed, 21 Oct 2009 08:51:48 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id ECD4154C07E; Wed, 21 Oct 2009 08:51:46 -0200 (BRST) Date: Wed, 21 Oct 2009 08:51:46 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Weak keyed tables with primitive keys Message-ID: <20091021105146.GA6461@inf.puc-rio.br> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <20091020181413.GA3341@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I understand the theoretical arguments for treating strings as values > with respect to weak tables, but are there any practical benefits? Yes, it makes it possible to understand and to explain what is going on without having to understand the underlying implementation of strings in Lua (which may change in the future). -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 09:00:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LB0WOh007422; Wed, 21 Oct 2009 09:00:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 043091934C; Wed, 21 Oct 2009 08:59:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 265FE19327 for ; Wed, 21 Oct 2009 08:59:15 -0200 (BRST) Received: by iwn8 with SMTP id 8so3435767iwn.33 for ; Wed, 21 Oct 2009 04:00:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.120.84 with SMTP id c20mr11528604ibr.47.1256122802928; Wed, 21 Oct 2009 04:00:02 -0700 (PDT) Date: Wed, 21 Oct 2009 07:00:02 -0400 Message-ID: <790db3550910210400qb320b48sdf917b1e145f1548@mail.gmail.com> Subject: Trace debugger for lpeg From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi List, I thought I would share a debugger I created for tracing the path lpeg takes in matching a pattern using a large/complex grammar. I've gone through a lot of headache debugging a parser I made for Lua so I thought I would share this bit of code which made it much easier. The code changes the grammar like so: (1) Changes each rule in the grammar to have a prefix pattern that is always true and run time captures to print "ENTER " (2) Changes each rule in the grammar to have a suffix pattern that is composed of a pattern always true that run time captures to print "LEAVE ". The end of the suffix pattern is always false so it does not change the actual pattern when it fails. (3) If the rule in the grammar matches, (2) does not happen and instead the current position and subject up to the position is printed. For my Lua parser, it looks something like this: ENTER 1 ENTER space ENTER comment LEAVE comment --- space --- 2 ENTER chunk ENTER space ENTER comment LEAVE comment --- space --- 2 ENTER stat ENTER varlist ENTER var ENTER prefix ENTER Name The actual code to make this happen is quite simple: for k, p in pairs(grammar) do local enter = lpeg.Cmt(lpeg.P(true), function(s, p, ...) print("ENTER", k) return p end); local leave = lpeg.Cmt(lpeg.P(true), function(s, p, ...) print("LEAVE", k) return p end) * (lpeg.P("k") - lpeg.P "k"); grammar[k] = lpeg.Cmt(enter * p + leave, function(s, p, ...) print("---", k, "---") print(p, s:sub(1, p-1)) return p end) end (Notice that there is a trick in leave, we can't use lpeg.P(false) because LPeg optimizes it out.) Hope someone out there finds it useful! -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 09:52:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LBpxdF018571; Wed, 21 Oct 2009 09:51:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DBCD1934D; Wed, 21 Oct 2009 09:50:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5C80192DF for ; Wed, 21 Oct 2009 09:50:36 -0200 (BRST) Received: by ewy26 with SMTP id 26so6698694ewy.5 for ; Wed, 21 Oct 2009 04:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=phSB4OGk7vP9zN6PUDtsjG/FUY+RM/Oxi54UvxG6Jik=; b=NuPj+0AyLxKN3paNhhYentBCUsD7Z+xxpYRAwozuUPaF/LBRRBrqvYihj0sgeBRW66 B+rNg2OvHTkbG2hTHlyy5n4sAbK6ijPXpv4hTc70rMoDwGBinlsLXmUDKY3qE/6hpyuI o5Veagp71cqbQkaoPXI6T5MbGiFpUmI9FzPas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=bis4KYikNPbq0Z5eF4LPixY9Mt3gCfZVttJoDe6Ofz5IWFgMRxX2YXtXsRtX/xK54v 9BE+/b4tIPUYnVohDT7vvfSBniPGffyMOCzKXVtijZDJJwNOsiqFJSK1yU4n2qiBq5Cp Im1P6S7E+kFOvKRCEc2E6b4mG6ZsN4R+zf5lU= Received: by 10.216.86.204 with SMTP id w54mr2714771wee.54.1256125883872; Wed, 21 Oct 2009 04:51:23 -0700 (PDT) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id g11sm2668564gve.5.2009.10.21.04.51.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 04:51:22 -0700 (PDT) Message-ID: <4ADEF5B2.6000709@gmail.com> Date: Wed, 21 Oct 2009 19:51:14 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Weak keyed tables with primitive keys References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <20091020181413.GA3341@inf.puc-rio.br> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean From my opinion, implement a data cache using weak table is not a good idea. If you do so, your application will have no control over when the data in cache will be garbage collected. Even if the data is access very frequently by clients, it may still be collected immediately after all references are released. You should implement the cache in a regular table and implement a replacement algorithm to manage the data in cache. Regards Long Mark Hamburg 写é“: > I understand the theoretical arguments for treating strings as values > with respect to weak tables, but are there any practical benefits? It > would seem, for example, to get in the way of caching the results of > file reads a la: > > fileCache = setmetatable( { }, { > __mode = 'kv', > __index = function( t, k ) > local v > local f = io.open( k ) > if f then > v = f:read( "*a" ) > t[ k ] = v > f:close() > end > return v > end } ) > > Mark > From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 11:17:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LDHOOL006082; Wed, 21 Oct 2009 11:17:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DD4319384; Wed, 21 Oct 2009 11:15:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3FF719352 for ; Wed, 21 Oct 2009 11:15:52 -0200 (BRST) Received: by qyk14 with SMTP id 14so4627220qyk.11 for ; Wed, 21 Oct 2009 06:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=5CHD6MCPRrJODuf2uq4UyuUK6V07P74x+B3o9AYZAqM=; b=YcACZHNQohlzzG+mQX5/HXv1ayae4BYwGlctLcZGQ7y74TsxwgCtwjrdqoNRltlXQh QLi8w74OGiKOejPynsXudwT0YwROI9kiqS5yrhRD5IxHblbx+4hAIBglrb4YJ0lWsNFG 0eshGwaSnrQyFfXOztdfdyhw6uK4GZMKkrKjM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=CmEq/bFAK5/cmv7c2oKF4ws4FODVv2NEAjCVlwrKHL+agiWQGGTKDOgoeJrRdaZWbW TYnTDM+pqBDvj3qNxYD7Ph407hUnWwvo4c1B2cn83Pa1N1jJ3tVIFobXJlotWce2HvGy K57Xg7EL2lF0QAfSg5Z1g8/d4orvktr/Os64c= MIME-Version: 1.0 Received: by 10.229.111.195 with SMTP id t3mr1151737qcp.44.1256130998262; Wed, 21 Oct 2009 06:16:38 -0700 (PDT) In-Reply-To: <790db3550910210400qb320b48sdf917b1e145f1548@mail.gmail.com> References: <790db3550910210400qb320b48sdf917b1e145f1548@mail.gmail.com> From: Norman Clarke Date: Wed, 21 Oct 2009 10:16:18 -0300 Message-ID: Subject: Re: Trace debugger for lpeg To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Oct 21, 2009 at 8:00 AM, Patrick Donnelly wrote: > Hi List, > > I thought I would share a debugger I created for tracing the path lpeg > takes in matching a pattern using a large/complex grammar. I've gone > through a lot of headache debugging a parser I made for Lua so I > thought I would share this bit of code which made it much easier. Thanks Patrick, this is actually very useful for me right now! Regards, Norman From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 11:49:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LDnZMv015246; Wed, 21 Oct 2009 11:49:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9599319363; Wed, 21 Oct 2009 11:48:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 978FA19332 for ; Wed, 21 Oct 2009 11:48:04 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8BCB9B37FF for ; Wed, 21 Oct 2009 09:48:52 -0400 (EDT) Received: from web6.messagingengine.com ([10.202.2.215]) by compute2.internal (MEProxy); Wed, 21 Oct 2009 09:48:52 -0400 Received: by web6.messagingengine.com (Postfix, from userid 99) id 010619BEA3; Wed, 21 Oct 2009 09:48:55 -0400 (EDT) Message-Id: <1256132935.7046.1341212929@webmail.messagingengine.com> X-Sasl-Enc: NPbrxV2OlMt+ioTuuXxZ5+ruTyx6GpOz8dGoX28n79zJ 1256132935 From: "V S P" To: "Lua list" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <1256084557.7868.1341119247@webmail.messagingengine.com> References: <1256084557.7868.1341119247@webmail.messagingengine.com> Subject: Re: A Lua to JavaScript translator Date: Wed, 21 Oct 2009 09:48:55 -0400 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I would recommend to consider metalua and do the source level translation rather than bytecode translation mainly because I think doing byte code translation would lead to need to emulate garbage collection idioms that are specific to lua (or so I think) plus, of course, for users of your final tool would probably like to 'limit' the types of APIs that get translated. Vlad > On Tue, 20 Oct 2009 20:14 -0500, "Phil Deets" > wrote: > > Hello, I have been thinking about writing a Lua to JavaScript translator. > > The main use case would simply be to provide an alternative language for > > the web. You would just have to run the translator before you use the > > script. > > > > This would be different than the lua2js which already exists on LuaForge > > since I would want to make it work in all cases with the only > > restrictions > > being on what modules can be used. I think lua2js only does a superficial > > translation. For example, I don't think it handles using functions as an > > index into a table. -- Vlad P author of C++ ORM http://github.com/vladp/CppOrm/tree/master -- http://www.fastmail.fm - A fast, anti-spam email service. From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 11:57:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LDvPjr017716; Wed, 21 Oct 2009 11:57:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C4FB1934C; Wed, 21 Oct 2009 11:56:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55B4D192DF for ; Wed, 21 Oct 2009 11:56:09 -0200 (BRST) Received: by yxe17 with SMTP id 17so6031856yxe.33 for ; Wed, 21 Oct 2009 06:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LzaaNk4k0S0ZLm1Qv2W3NyLwpre2O3OyMxB/HlFk8tY=; b=sDPNEsqkAfPVS/BgeMMN7ArfiD8hq3Ox/G0WCOzy09GcyKBdAu7YcyDPm3cGMSBKr+ mu1vXESE7pqTM93Ejtsk7lCsHgGtQuORE7LRgncuf2bhxs3CG7KzSksCMI+6+ff4aTEf dFs27IuNQ06oYkrQpc4aud7Ov/QJ3a7TSSMuc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=duHMTR4zbOxuP5qnawNE7HzT0Fw7Z773G9WS3EaLE0haQQE+BP62lDjREicmG8q6I6 nfjtjrPCBXDiwsXSTdnqq8JUmA+PMKlnfIyD6uUATJxMu0ysAxri5WLtfZhs6Wybbnpt MX8teGAuDxVgZ2BsaPk2MmK2BDaYBPZCBjR3E= MIME-Version: 1.0 Received: by 10.91.103.17 with SMTP id f17mr8695727agm.114.1256133416905; Wed, 21 Oct 2009 06:56:56 -0700 (PDT) In-Reply-To: <1256132935.7046.1341212929@webmail.messagingengine.com> References: <1256084557.7868.1341119247@webmail.messagingengine.com> <1256132935.7046.1341212929@webmail.messagingengine.com> Date: Wed, 21 Oct 2009 13:56:56 +0000 Message-ID: <54e12800910210656l32c4cea6k479d68394446bcb3@mail.gmail.com> Subject: Re: A Lua to JavaScript translator From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 10/21/09, V S P wrote: > > I would recommend to consider metalua > and do the source level translation rather than bytecode translation > mainly because I think doing byte code translation would lead to need to > emulate garbage collection > idioms that are specific to lua (or so I think) > Actually source code translation is more prone to semantic mismatches than bytecode translation, because the meaning of each bytecode is simpler. The problem is the API (collectgarbage(), for instance). Cheers, -- -alex http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 12:28:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LESasH025669; Wed, 21 Oct 2009 12:28:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83EBC19376; Wed, 21 Oct 2009 12:27:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D631191F0 for ; Wed, 21 Oct 2009 12:27:09 -0200 (BRST) Received: by qyk14 with SMTP id 14so4679861qyk.11 for ; Wed, 21 Oct 2009 07:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W1UnuaUHJohX035MI9UCw1w/MMxP4Qi2f4BbvjMfGY0=; b=sfIzW5VdCLu0jH+bc4a8/nK5QR9DomxTG/OVDms1S1h9kivPdGkGcHtcKexdrrfFxK 6aZKQ0D0Dp+lzaf++7Zi4CMXOH7iqc5m9c+PgjyXCS5CGWUd4P3HPhOSE+oI22Dwfpew tgNImSSbyGy+g9dndTejg7ySB9q8W03uRKrYw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Ehr6Y/mznC1ZPkB0TOs9wNoCnQx56M+7OMxMY0Nvmba7U3qO7C9z0ON0DXv1+3x10S dnpEAJ0Dg33NfHYAHdIm224Voa6QM0OxAsVEH5gQkynZ8EFNqA4NkQ2YdBem/JxtDbZ3 qNabU52A1EvRo6GJH4533aO2DsNymU8UcZqig= MIME-Version: 1.0 Received: by 10.239.181.167 with SMTP id m39mr638410hbg.169.1256135275985; Wed, 21 Oct 2009 07:27:55 -0700 (PDT) In-Reply-To: <222ade940910201446x710463e3wc5daca23de9a0798@mail.gmail.com> References: <20091020185220.GA21833@ibawizard.net> <222ade940910201446x710463e3wc5daca23de9a0798@mail.gmail.com> Date: Wed, 21 Oct 2009 10:27:55 -0400 Message-ID: Subject: Re: Creating Lua programs on Windows Mobile From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LESasH025669 Is there an official repository of lua for Windows CE / WM ? No, not to my knowledge. AGRW On Tue, Oct 20, 2009 at 5:46 PM, Vincent Torri wrote: > > > On Tue, Oct 20, 2009 at 8:52 PM, Petr Å tetiar wrote: >> >> Daniel Florio [2009-10-20 15:54:48]: >> >> > Hi people, >> >> Hi, >> >> > I'm new on Lua world and i'm doing some explorations. I want to start to >> > create programs to mobile phones, but i don't have any idea from where >> > to >> > start. >> > I received a tip to try to start making little programs to Windows >> > Mobile, >> > but i can't find an interpreter to run my lua programs on WM. >> >> This should run on WM http://github.com/ynezz/luace/downloads also. If >> not, >> I think, that you can recompile easily... >> > But is there an official repository of lua for Windows CE / WM ? > > Vincent Torri > > From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 12:38:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LEccMd027561; Wed, 21 Oct 2009 12:38:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E12411939A; Wed, 21 Oct 2009 12:37:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-09.prod.phx3.secureserver.net (p3plsmtpa01-09.prod.phx3.secureserver.net [72.167.82.89]) by bazar2.conectiva.com.br (Postfix) with SMTP id EDD7C19395 for ; Wed, 21 Oct 2009 12:37:13 -0200 (BRST) Received: (qmail 2692 invoked from network); 21 Oct 2009 14:37:55 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-09.prod.phx3.secureserver.net (72.167.82.89) with ESMTP; 21 Oct 2009 14:37:55 -0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Weak keyed tables with primitive keys From: Mark Hamburg In-Reply-To: <4ADEF5B2.6000709@gmail.com> Date: Wed, 21 Oct 2009 07:37:54 -0700 Message-Id: <38037087-33B1-4EF9-8C5A-3A237BBEF45F@grubmah.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <20091020181413.GA3341@inf.puc-rio.br> <4ADEF5B2.6000709@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LEccMd027561 One can build bucket brigades to keep things around longer based on GC cycles or based on total accumulated data. That said, the data in the cache isn't going away from memory until the GC actually gets around to collecting it which means that the weak table (if it worked) would always be a viable optimization provided you aren't worried about the file changing on disk. The work around for the handling of strings in this case would be to have the values be tables containing the file contents as a string. Since these tables would never be referenced elsewhere they would not survive a GC pass. But then to make the above storage management ideas (bucket brigades, etc) work you do need to expose the tables, so it's not really a satisfactory solution. Mark On Oct 21, 2009, at 4:51 AM, Cheng, Long wrote: > From my opinion, implement a data cache using weak table is not a > good idea. If you do so, your application will have no control over > when the data in cache will be garbage collected. Even if the data > is access very frequently by clients, it may still be collected > immediately after all references are released. You should implement > the cache in a regular table and implement a replacement algorithm > to manage the data in cache. > > Regards > Long > > Mark Hamburg 写é“: >> I understand the theoretical arguments for treating strings as >> values with respect to weak tables, but are there any practical >> benefits? It would seem, for example, to get in the way of caching >> the results of file reads a la: >> >> fileCache = setmetatable( { }, { >> __mode = 'kv', >> __index = function( t, k ) >> local v >> local f = io.open( k ) >> if f then >> v = f:read( "*a" ) >> t[ k ] = v >> f:close() >> end >> return v >> end } ) >> >> Mark >> > From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 12:53:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LErkpQ030276; Wed, 21 Oct 2009 12:53:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C01D1193A4; Wed, 21 Oct 2009 12:52:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E62119326 for ; Wed, 21 Oct 2009 12:52:27 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so799882qwb.11 for ; Wed, 21 Oct 2009 07:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=b8JYIDL+3Lu1aEhf2mXtsGSJzU3SWtpDzTQm6LdBekQ=; b=JEXxXlvcUwa/3ycGvXyzMHVM1J2YUAs3ZbMTkXmR2lWdKdRCUSfZi8buXnWwsUiZ2w oc7lwoCUDio3bGWxnPHygD0XrbOSjDPYHsR7Ycji9tY9aj4lZ6ImGxMwGmplCQ2AtTtP NNEdsvjh0ux5ckFS2pbag6eHPBZCql23HRZ/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FGl6ONDyiZCJsnsLSCyYKGiNvsfAOUCcrLOAU30gdB/kaRLqCCFmjbxLISRjOm2O4S zegU8DSVinN9tFJ7diBImwy5448IceoPCcWW5huHpgQZhRQuatWzNNP6rgEkzQxVJ3bj bIBaR/wkFUrQo0nONBmaaMCi4sI53jjOnaGiE= MIME-Version: 1.0 Received: by 10.239.130.154 with SMTP id 26mr664828hbj.57.1256136794081; Wed, 21 Oct 2009 07:53:14 -0700 (PDT) In-Reply-To: References: From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Wed, 21 Oct 2009 12:52:54 -0200 Message-ID: Subject: Re: Creating Lua programs on Windows Mobile To: Lua list Content-Type: multipart/alternative; boundary=001485f5b0c0668a0f04767323d3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f5b0c0668a0f04767323d3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This one might help either: http://keplermobile.luaforge.net/ Lu=EDs Eduardo Jason Santos On Tue, Oct 20, 2009 at 4:13 PM, Andrew Wilson wrote: > Daniel, > > This might be a place to start - http://luapocket.luaforge.net/ . > > Cheers > Andrew > > On Tue, Oct 20, 2009 at 1:54 PM, Daniel Florio > wrote: > > Hi people, > > > > I'm new on Lua world and i'm doing some explorations. I want to start t= o > > create programs to mobile phones, but i don't have any idea from where = to > > start. > > I received a tip to try to start making little programs to Windows > Mobile, > > but i can't find an interpreter to run my lua programs on WM. > > > > Anyone can help me? > > > > Thanks > > > > Daniel Florio > > > --001485f5b0c0668a0f04767323d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This one might help either:


Lu=EDs Eduardo Jason Santos


On Tue, Oct 20, 2009 at 4:13 PM, Andrew = Wilson <agrwagrw= @gmail.com> wrote:
Daniel,

This might be a place to start - http://luapocket.luaforge.net/ .

Cheers
Andrew

On Tue, Oct 20, 2009 at 1:54 PM, Daniel Florio <erunamo.florio@gmail.com> wrote:
> Hi people,
>
> I'm new on Lua world and i'm doing some explorations. I want t= o start to
> create programs to mobile phones, but i don't have any idea from w= here to
> start.
> I received a tip to try to start making little programs to Windows Mob= ile,
> but i can't find an interpreter to run my lua programs on WM.
>
> Anyone can help me?
>
> Thanks
>
> Daniel Florio
>

--001485f5b0c0668a0f04767323d3-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 13:40:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LFeOow006320; Wed, 21 Oct 2009 13:40:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7086F18FDF; Wed, 21 Oct 2009 13:38:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B92218D5E for ; Wed, 21 Oct 2009 13:38:46 -0200 (BRST) Received: by pxi2 with SMTP id 2so5416699pxi.11 for ; Wed, 21 Oct 2009 08:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=PctIgmEYa71yhsccK95OEs/oADOpRCYjruVQYWTDiCM=; b=Vwx7M4oQFZQQAd9wotBVcHVyjX+99IrLdPtOp1nRwaANddTy49Z2rVx+9pw0Db2PqX Lr+BTaa0rgqzkdHDz5Xsx0RBkUibhZntQ8yxyHXh1AD3BH1fcxWXYn5paWQx7oHIiZwY +GXKQFUa27vGjcrss66ZcXKRgcKcOAhu4mh2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=DPaSI3Sa5Olk2C+6PUYBu/dPg9fcNYfb4vtsyVP+CxcKCtQ3Vnksg34RlSk1tIFWRQ 3BPsadtHaw9/7RO4XrJw/WjDHIhuczCEWIKYznk9r9nlOODr9y9gmzv93XJwSGzwxB+K 9RlkFHZ8GMzw5Gujo5ZqMf7zn3AA/J6DeY37Y= Received: by 10.114.249.17 with SMTP id w17mr12312203wah.85.1256138277859; Wed, 21 Oct 2009 08:17:57 -0700 (PDT) Received: from ?10.164.16.75? ([166.205.131.115]) by mx.google.com with ESMTPS id 21sm361524pxi.0.2009.10.21.08.17.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 08:17:57 -0700 (PDT) References: <790db3550910210400qb320b48sdf917b1e145f1548@mail.gmail.com> Message-Id: <79EBA443-6F55-414D-A10E-7CD0A1C78879@gmail.com> From: Wesley Smith To: Lua list In-Reply-To: <790db3550910210400qb320b48sdf917b1e145f1548@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7C144) Mime-Version: 1.0 (iPhone Mail 7C144) Subject: Re: Trace debugger for lpeg Date: Wed, 21 Oct 2009 08:17:46 -0700 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This looks sweet. I've been thinking about something exactly like this recently as the grammers I've been wrestling with are getting out if hand :) wes On Oct 21, 2009, at 4:00 AM, Patrick Donnelly wrote: > Hi List, > > I thought I would share a debugger I created for tracing the path lpeg > takes in matching a pattern using a large/complex grammar. I've gone > through a lot of headache debugging a parser I made for Lua so I > thought I would share this bit of code which made it much easier. > > The code changes the grammar like so: > > (1) Changes each rule in the grammar to have a prefix pattern that is > always true and run time captures to print "ENTER " > (2) Changes each rule in the grammar to have a suffix pattern that is > composed of a pattern always true that run time captures to print > "LEAVE ". The end of the suffix pattern is always false so it > does not change the actual pattern when it fails. > (3) If the rule in the grammar matches, (2) does not happen and > instead the current position and subject up to the position is > printed. > > For my Lua parser, it looks something like this: > > ENTER 1 > ENTER space > ENTER comment > LEAVE comment > --- space --- > 2 > > ENTER chunk > ENTER space > ENTER comment > LEAVE comment > --- space --- > 2 > > ENTER stat > ENTER varlist > ENTER var > ENTER prefix > ENTER Name > > The actual code to make this happen is quite simple: > > for k, p in pairs(grammar) do > local enter = lpeg.Cmt(lpeg.P(true), function(s, p, ...) > print("ENTER", k) return p end); > local leave = lpeg.Cmt(lpeg.P(true), function(s, p, ...) > print("LEAVE", k) return p end) * (lpeg.P("k") - lpeg.P "k"); > grammar[k] = lpeg.Cmt(enter * p + leave, function(s, p, ...) > print("---", k, "---") print(p, s:sub(1, p-1)) return p end) > end > > (Notice that there is a trick in leave, we can't use lpeg.P(false) > because LPeg optimizes it out.) > > Hope someone out there finds it useful! > > -- > -Patrick Donnelly > > "Let all men know thee, but no man know thee thoroughly: Men freely > ford that see the shallows." > > - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 15:26:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LHQ28d031958; Wed, 21 Oct 2009 15:26:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA6F5193B8; Wed, 21 Oct 2009 15:24:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9EA619143 for ; Wed, 21 Oct 2009 15:24:36 -0200 (BRST) Received: by ewy26 with SMTP id 26so7063597ewy.5 for ; Wed, 21 Oct 2009 10:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bQ4220s3mMse4QsD5lGE4R5IdBL3P88OdcwsM8tSbUE=; b=XnMFawaVY9l0G5icfYS54rfbnAPTSeeMJpYYhqIzZ0ddTMwgczNzUQZJwhq/HBAADG u9nyr76iFVslSIHkCbToE+05qibFMLfY8eVSr7Qrg0uGX+nQMAmA5ZFC1fWkMP40NBA+ q6ZT/tFEt3gpcnxby1r2IbKu0JWpHfVwW9aCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=SKTtU4WCZWFaNVAZdp7rjyiw8vw4u7HT7ITV0xLy4/AWLKSilq7jmNjEnkyTznYWQq UnCDOcMf9nO7TnbvlzG8tgRW+782TBxJHqj3bwHKtaQuG0migPZAb4xvdcWTj1EDT4cK uN0/cr94pCNRN1nVlTkiS4Pl+/HJTJDZwqOis= MIME-Version: 1.0 Received: by 10.216.91.81 with SMTP id g59mr2926587wef.128.1256145923644; Wed, 21 Oct 2009 10:25:23 -0700 (PDT) In-Reply-To: <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> Date: Wed, 21 Oct 2009 19:25:23 +0200 Message-ID: <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys From: Wim Couwenberg To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > In my experience: numbers, strings, and boolean values aren't eligible > for collection in this manner: It's quite natural: instead of "referenced" think about a key as "reproducible". I can reconstruct numbers, booleans and strings *identically* from thin air at any time. This does not hold for other collectable types. For weak valued tables there is a nice analogy: these can be thought of as functions. If you cannot reproduce a certain input, it's pointless to keep the output. Bye, Wim From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 15:27:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LHRGkp032321; Wed, 21 Oct 2009 15:27:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A0E9193DE; Wed, 21 Oct 2009 15:26:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A6FE193C3 for ; Wed, 21 Oct 2009 15:25:58 -0200 (BRST) Received: by ewy26 with SMTP id 26so7065166ewy.5 for ; Wed, 21 Oct 2009 10:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ql4qEZipEanFXhGE6HSVL/L3r71X28n0hrQfBPlgrdo=; b=LBhH1I+GCGPl0dvjSSw7FvrESjRLQVMlBzx3yTU6bJQubnXlDzGewc+loe81WmO/K4 pgH25kdTOXTnVg4yhjrQCJSmnR0MY+VlCIHvPMz5VOsZQp7WdX1d/U3LkzYK6bjyMRGw vLd3qKhFXsZLBmEDb8wf+UM33ZUCHMEsVgRbk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ck7VSbQbOF3laxuZK4YbiMt1l6tfKoxt0IM9KauBw40NF/cfqNOc/ZBzgN1qxYBbcS +G6rjOgEpBmuVQrtgGBck447MXHOIKtmJ9ec5yPKpVU4O7e+5Qyp22xgsYNnwpbA9XgA 25X7VvxmoHUT77aMXCyUE7yk8JyNLzfmX/0mk= MIME-Version: 1.0 Received: by 10.216.89.14 with SMTP id b14mr3046699wef.76.1256146006914; Wed, 21 Oct 2009 10:26:46 -0700 (PDT) In-Reply-To: <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> Date: Wed, 21 Oct 2009 19:26:46 +0200 Message-ID: <6d59dad30910211026n4e2bd556pc7ea5c1b4af3aff@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys From: Wim Couwenberg To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LHRGkp032321 > collectable types.  For weak valued tables there is a nice analogy: er... that should be weak keyed. Bye, Wim From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 15:44:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LHi926003698; Wed, 21 Oct 2009 15:44:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFEFE193A1; Wed, 21 Oct 2009 15:42:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from psmtp.com (exprod6ob109.obsmtp.com [64.18.1.22]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5292018ED1 for ; Wed, 21 Oct 2009 15:42:45 -0200 (BRST) Received: from source ([207.168.191.2]) by exprod6ob109.postini.com ([64.18.5.12]) with SMTP ID DSNKSt9IPpbQIHwKnhWdmqQViJmFmXsPJf4a@postini.com; Wed, 21 Oct 2009 10:43:34 PDT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA5275.F2F26A29" Subject: LuaSNMP Windows Binary? Date: Wed, 21 Oct 2009 10:42:50 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: LuaSNMP Windows Binary? Thread-Index: AcpSdeigolwaZPcuQXivRnpWJm8aEw== From: "John Dunn" To: "Lua list" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA5275.F2F26A29 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is a Windows binary for LuaSNMP available anywhere? The only place I found a possible reference was in Lua All In One but I'm not able to download that package from luaforge for some reason. =20 John ------_=_NextPart_001_01CA5275.F2F26A29 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Is a Windows binary for LuaSNMP available anywhere? = The only place I found a possible reference was in Lua All In One but I'm not = able to download that package from luaforge for some reason.

 

John

------_=_NextPart_001_01CA5275.F2F26A29-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 16:55:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LItVVr021025; Wed, 21 Oct 2009 16:55:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CEFC1A66C; Wed, 21 Oct 2009 16:54:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 809F218F02 for ; Wed, 21 Oct 2009 16:54:04 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9LIsoMB030167 for ; Wed, 21 Oct 2009 16:54:52 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id F255954C07E; Wed, 21 Oct 2009 16:54:50 -0200 (BRST) Date: Wed, 21 Oct 2009 16:54:50 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Weak keyed tables with primitive keys Message-ID: <20091021185450.GA8907@inf.puc-rio.br> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > It's quite natural: instead of "referenced" think about a key as > "reproducible". I can reconstruct numbers, booleans and strings > *identically* from thin air at any time. This does not hold for other > collectable types. For weak valued tables there is a nice analogy: > these can be thought of as functions. If you cannot reproduce a > certain input, it's pointless to keep the output. Brilliant! -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 17:26:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LJQ26E028569; Wed, 21 Oct 2009 17:26:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F020193AE; Wed, 21 Oct 2009 17:24:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9384E1939E for ; Wed, 21 Oct 2009 17:24:40 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N0goC-0005Jm-K7 for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 21:25:20 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N0goC-0006XT-3P for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 21:25:20 +0200 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Support of kepler, sputnik, etc and security risks References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <72BC5846-DC90-441D-BFAD-7C77023BA4C1@mac.com> <5fe281d40910171729v40bdc7d9w82bd65b4b2af6c26@mail.gmail.com> <5ba75e2f0910172251r6d565ed2tb33f7fc839d0344b@mail.gmail.com> Date: Wed, 21 Oct 2009 21:25:20 +0200 In-Reply-To: (Yuri Takhteyev's message of "Sun, 18 Oct 2009 12:16:18 -0400") Message-ID: <87tyxs7dnj.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Yuri Takhteyev: > While XSS attacks are almost always based on browser bugs, Not true. Most of them are caused by templating engines which do not differentiate between template contents and externally supplied data at the type level. (This does not need a static type system, a dynamic type system is completely sufficient.) It's actually fairly easy to patch existing templating frameworks to implement this, but you may lose tool support along the way. And if the template framework does not support the moral equivalent of subroutines, the changes are not backwards-compatible. From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 17:29:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LJT8V0029306; Wed, 21 Oct 2009 17:29:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C23911A674; Wed, 21 Oct 2009 17:27:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 211881A66D for ; Wed, 21 Oct 2009 17:27:51 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N0grP-0005Ow-0r for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 21:28:39 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N0grO-0006Zp-HR for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 21:28:38 +0200 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Support of kepler, sputnik, etc and security risks References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> Date: Wed, 21 Oct 2009 21:28:38 +0200 In-Reply-To: (Tony Finch's message of "Sun, 18 Oct 2009 23:26:20 +0100") Message-ID: <87pr8g7di1.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LJT8V0029306 * Tony Finch: > On Sat, 17 Oct 2009, David Given wrote: >> >> There isn't really a good solution to this --- it's one of the reasons >> why Unicode domain names have never really taken off. > > The solution is generally for TLDs to implement a character set policy. > For example, .at only allows these non-ascii characters in domain names: > ä ü ö ë à á â è é ê ì í î ï ò ó ô ù ú û ý ÿ ã å æ ç ð ñ õ ø ½ ¨ þ ¸ .at can't control what you put into subdomains. So you just have to put a homograph for "/" into a subdomain and you are done. But the l1I homographs and the fact that browsers truncate long domain names at the right end, and not the left, shows that this is a tempest in a teapot. If those problems were real, vendors would have been forced to fix them by now. (Back when those issues were raised for the first time, the URL bar wasn't even a mandatory UI element, it could be disabled with simple, well-documented Javascript!) From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 17:29:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LJTfmt029497; Wed, 21 Oct 2009 17:29:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08A9618885; Wed, 21 Oct 2009 17:28:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CE0A18822 for ; Wed, 21 Oct 2009 17:28:06 -0200 (BRST) Received: by fxm12 with SMTP id 12so8394914fxm.5 for ; Wed, 21 Oct 2009 12:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=SGspIYw93i1dbUuSEZXSykGPpyN31Kom73iZRG0OiFI=; b=sxMdQwsBTqQugMLt04c0J+zWP7Rf/dG0F9AelMf8Ef6+0uGv00D/Fyd1DN/aszYOAI jSakzGGQ5Vp0JF+enBRdxPKjjuFeoNgmJ3/P/NEkRChTPncXxwHteEnHOjFyuaPY9jsm VnPBIr7T6lPU77T6o57dOwUZ/EvkYOYl4FJps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=cFM1avnj3LfLbT8joWwsnYvonzQv9q9Eb/2DLOQxTHPgbmGcgj2xtUXEQMaYTCkly+ qkw0RmvMviwE/PizxM6LUB4gGj52N8LSNQXvjfNQj6io+gvExXKoOZiE+szl2j1QUEad sOwif9LirSex1rZuXt70IyL/nop1KZLAMGzW0= Received: by 10.204.8.65 with SMTP id g1mr8386617bkg.153.1256153333817; Wed, 21 Oct 2009 12:28:53 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 16sm25931bwz.11.2009.10.21.12.28.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 12:28:52 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Weak keyed tables with primitive keys Date: Wed, 21 Oct 2009 21:28:21 +0200 References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 7:25 PM, Wim Couwenberg wrote: > If you cannot reproduce a > certain input, it's pointless to keep the output. Right. But to follow up on Mark's example, given a path, io.open():read(), and it's result, how would one cache the content of a file? local cache = setmetatable( {}, { __mode = 'k' } ) local function content( aPath ) local aContent = cache[ aPath ] or io.open( aPath, 'rb' ):read( '*a' ) cache[ aPath ] = aContent return aContent end The above seems like a memory leak, as 'cache[ aPath ] = aContent' will hold everything forever. Thoughts? From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 17:36:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LJaaIc031218; Wed, 21 Oct 2009 17:36:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C7F31A67E; Wed, 21 Oct 2009 17:35:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0DC61882C for ; Wed, 21 Oct 2009 17:35:14 -0200 (BRST) Received: by fxm12 with SMTP id 12so8402820fxm.5 for ; Wed, 21 Oct 2009 12:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=L35tM9FBzi3iJRLo44LRCjDk808SGev2wgUOKcqAfG4=; b=Gvo0QQx+G3c2Qg3IlrtQuI1vh20Jy2nFEvblzBMYUCnpqpKTzvU0QhppR/K8cvhD8r YmDsK5elGsB9TYMvYdCQFRAKU4a4v+V5IS8pdZ78CqJqPgq8rzs7DygTQobnHCprYP7q QMM1t3bEWnreaPY9AuHcctkFmTKwz8L8INVyM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=cpu4B9+YmSQ2OMC/4WJ6YfNrs5O2mXkEw/PR39cqkJMiX5Q0YrIXX5Gnu3t+LvJOtV WqsUQGDcsfoT4QX8OPbB4NhkGLbkoAEsbyqpp71OQRiUmgrfLUA3sgO81QCHkSG8YeF1 ggW2ySg3+wHTQgs7Dr1kRW61neaWrkdKheWHg= MIME-Version: 1.0 Received: by 10.223.103.25 with SMTP id i25mr1687804fao.64.1256153761610; Wed, 21 Oct 2009 12:36:01 -0700 (PDT) In-Reply-To: References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> Date: Wed, 21 Oct 2009 20:36:01 +0100 Message-ID: Subject: Re: Weak keyed tables with primitive keys From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LJaaIc031218 On Wed, Oct 21, 2009 at 8:28 PM, Petite Abeille wrote: > > On Oct 21, 2009, at 7:25 PM, Wim Couwenberg wrote: > >> If you cannot reproduce a >> certain input, it's pointless to keep the output. > > Right. > > But to follow up on Mark's example, given a path, io.open():read(), and it's > result, how would one cache the content of a file? > > local cache = setmetatable( {}, { __mode = 'k' } ) > > local function content( aPath ) >    local aContent = cache[ aPath ] or io.open( aPath, 'rb' ):read( '*a' ) > >    cache[ aPath ] = aContent > >    return aContent > end > > The above seems like a memory leak, as 'cache[ aPath ] = aContent' will hold > everything forever. > Thoughts? > > I would put the result into its own table and make the cache weak-valued, not weak-keyed: local cache = setmetatable( {}, { __mode = 'v' } ) local function content( aPath ) local fromCache = cache[aPath] if fromCache then return fromCache.value; end local aContent = io.open( aPath, 'rb' ):read( '*a' ) cache[ aPath ] = {value=aContent} return aContent end -Duncan From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 17:40:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LJeGin031913; Wed, 21 Oct 2009 17:40:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44A281A66F; Wed, 21 Oct 2009 17:39:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1AA591882C for ; Wed, 21 Oct 2009 17:39:02 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRV00HMBQLFN070@asmtp012.mac.com> for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 12:39:48 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: Subject: Re: Weak keyed tables with primitive keys Date: Wed, 21 Oct 2009 21:39:14 +0200 References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 9:36 PM, Duncan Cross wrote: > I would put the result into its own table and make the cache > weak-valued, not weak-keyed: > > cache[ aPath ] = {value=aContent} Right. But then it would get garbage collected right away as nothing would have any reference to that wrapper table, no? From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 18:08:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LK8sc0006693; Wed, 21 Oct 2009 18:08:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A59B1A67E; Wed, 21 Oct 2009 18:07:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5C6B1A66D for ; Wed, 21 Oct 2009 18:07:26 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so962073gvf.40 for ; Wed, 21 Oct 2009 13:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=2rUR6WRQizJCi2Wg/B3atw6RIlzwyc6CrAhM7tSh2cs=; b=o+FDF+2vNF+PEQA8DSxw1QQu/LX+T+uHfV0FoNrhZX1b1Trd+oXAh1MkxiLMUDe7pG watdu8VLvpw1ENRqrJDr4ghpzeQ6R5qqMBpZSsG4Eh0Vg3yOnHNtQLiTVWkpsThkDMap wztSJJ5Ae+NHL2SqyuQDgkqnUOAgjn4TaDroY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=AJD6Lo/39IdIG1y+IVkrWRR4pVzcm/D2zYnafZxprQgsWt6WIhDrFO3f8wY+7ed9Jy ulFQIZYt1svHHwFXvYOP49rt1z1POmCeiYf2L+bXiLCuhjvyfBMQ9Px5LCe8Ey/WKC5U tJbPrOmp8/lNVnCVXqewaVd4ujVVQRgRe3+/w= MIME-Version: 1.0 Received: by 10.239.138.34 with SMTP id n34mr684486hbn.64.1256155691405; Wed, 21 Oct 2009 13:08:11 -0700 (PDT) In-Reply-To: <1079b050910200234x539f11dfw6a374822100f1d8e@mail.gmail.com> References: <1079b050910200234x539f11dfw6a374822100f1d8e@mail.gmail.com> Date: Wed, 21 Oct 2009 22:08:11 +0200 X-Google-Sender-Auth: 9afefc3e830c4d9c Message-ID: <9b7735fc0910211308j4a204bcfle017e55d901731b@mail.gmail.com> Subject: Re: ceg - C99 LPEG parser From: Andreas Stenius To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LK8sc0006693 Looks really nice! I've not been working in Lua for a while now, time to pick it back up to take a closer look at this! BR, Andreas 2009/10/20 Wesley Smith : > I've just posted a first release of a C99 parser using LPEG.  This is > a full parser implementing all of the C99 grammar rules except for > some of the preprocessor directives. I based it off of > http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf .  In > addition to defining nearly all of the rules of the C99 grammar, there > are some convenience data structures and functions. > > C99 has tons of rules, so I've also grouped them into sections > according to Appendix A of the C99 spec.  For example, there are > listings of identifier_rules, constant_rules, string_literal_rules, > expression_rules, declaration_rules, statement_rules, > external_definition_rules, and all_rules as well as a special lpeg.P > for matching any token called token_patt.  These can be found in the > c99.ceg module. > > The ceg module itself defines some useful functions such as apply > (apply a set of captures to a grammer (like in LEG)) and scan, which > will return a scanning function to match a pattern.  See the example > provided for details. > > The example takes a chunk of C code (actually C++ code) and LuaDocs > the documented functions.  It can process C++ code since it simply > ignores tokens that don't match the pattern it's looking for through > the use of the scan function.  One thing of note, typedefs are handled > by a special table.  Usage is demonstrated in the example. > > ceg can be downloaded at: http://www.mat.ucsb.edu/~whsmith/temp/ceg.zip > > Feedback is welcome. > > > thanks, > wes > From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 18:09:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LK9WcM006886; Wed, 21 Oct 2009 18:09:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B46021A686; Wed, 21 Oct 2009 18:08:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B6F31A680 for ; Wed, 21 Oct 2009 18:08:18 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KRV00LBERY98I50@asmtp022.mac.com> for lua@bazar2.conectiva.com.br; Wed, 21 Oct 2009 13:09:06 -0700 (PDT) Message-id: <03680FD6-977A-4EB9-9DF3-EA4A72E5E336@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: Weak keyed tables with primitive keys Date: Wed, 21 Oct 2009 22:08:32 +0200 References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 9:39 PM, Petite Abeille wrote: > > On Oct 21, 2009, at 9:36 PM, Duncan Cross wrote: > >> I would put the result into its own table and make the cache >> weak-valued, not weak-keyed: >> >> cache[ aPath ] = {value=aContent} > > Right. But then it would get garbage collected right away as nothing > would have any reference to that wrapper table, no? Something along those lines: local cache = setmetatable( {}, { __mode = 'v' } ) local function content( aPath ) local aCache = cache[ aPath ] if not aCache then print( 'miss', aPath ) aCache = { io.open( aPath, 'rb' ):read( '*a' ) } cache[ aPath ] = aCache else print( 'hit', aPath ) end return aCache[ 1 ] end local aPath = 'TestGC.lua' content( aPath ) content( aPath ) collectgarbage() content( aPath ) > miss TestGC.lua > hit TestGC.lua > miss TestGC.lua So the lifespan of the cache would only be the interval between collectgarbage, instead of the lifespan of the key, as intended originally. From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 18:30:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LKUfuq010676; Wed, 21 Oct 2009 18:30:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE0161A68A; Wed, 21 Oct 2009 18:29:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E75C1A680 for ; Wed, 21 Oct 2009 18:29:20 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9LKU8U7006930 for ; Wed, 21 Oct 2009 18:30:09 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 057BE54C07E; Wed, 21 Oct 2009 18:30:09 -0200 (BRST) Date: Wed, 21 Oct 2009 18:30:08 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Weak keyed tables with primitive keys Message-ID: <20091021203008.GA9178@inf.puc-rio.br> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The above seems like a memory leak, as 'cache[ aPath ] = aContent' will > hold everything forever. > Thoughts? It is curious why nodoby is concerned with similar things happening with numerical keys. If aPath is a number, you have exactly the same situation. Should Lua wait until the number is collected to remove that entry from the table? -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 18:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LKkiGR014283; Wed, 21 Oct 2009 18:46:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C0A018C55; Wed, 21 Oct 2009 18:45:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB73118BFD for ; Wed, 21 Oct 2009 18:45:15 -0200 (BRST) Received: by fxm12 with SMTP id 12so8481094fxm.5 for ; Wed, 21 Oct 2009 13:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=mxxLjEaUPNUJY3EfKXzvkcbCuHzca3i5o0ZRBbnmUXU=; b=clb2QQJN3ynFEO0ohVaPmLPdkw/pdfZKntMTxaEmAU4rtFcan7xkLUrfP0NG0aewTx C7SBicT4CbmC2xVDr1RbLYO7hIcI1UjeIJlwi8czKelM+nQe87ppvMcjR8ud877srw8i D39UiAFknCY4iPLo7l7us1hQSzryrlKWaNSyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=jRJChOaJSHRLgrrIllOI+Vw9CmhdifRMcdFoBL2+Vlf+Vbe0ivxZjmRYgVRvxbLag1 N12bNjEvDhDWyJQCWdjMo54R3C0RDWRCt3EvoWpLzIH0nw29RelBO9aJ7pJiE+CsOfmf awqJ4UrSXT8xNH8eOrhNzwgcsoyV7cfpzbumg= Received: by 10.103.125.36 with SMTP id c36mr3539027mun.126.1256157962300; Wed, 21 Oct 2009 13:46:02 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id e8sm747088muf.29.2009.10.21.13.46.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 13:46:01 -0700 (PDT) Message-Id: <55468280-BCA3-4821-A14E-5A3BA14696E3@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <20091021203008.GA9178@inf.puc-rio.br> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Weak keyed tables with primitive keys Date: Wed, 21 Oct 2009 22:45:30 +0200 References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> <20091021203008.GA9178@inf.puc-rio.br> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 10:30 PM, Roberto Ierusalimschy wrote: > It is curious why nodoby is concerned with similar things happening > with numerical keys. If aPath is a number, you have exactly the same > situation. Should Lua wait until the number is collected to remove > that > entry from the table? Sounds good, yes :) From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 19:35:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LLZ470021279; Wed, 21 Oct 2009 19:35:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 744FE19344; Wed, 21 Oct 2009 19:33:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 020EE19324 for ; Wed, 21 Oct 2009 19:33:40 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 5DAABB4545 for ; Wed, 21 Oct 2009 17:34:25 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 21 Oct 2009 17:34:25 -0400 X-Sasl-enc: tNVnBBKgu5hth7ADWcZhKqQb6/e8nIpA1WUmpNNYxLS4 1256160864 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id 9D3FC11395 for ; Wed, 21 Oct 2009 17:34:24 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Documentation Markup From: Geoff Leyland In-Reply-To: <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> Date: Thu, 22 Oct 2009 10:33:51 +1300 Content-Transfer-Encoding: 7bit Message-Id: <45B4B233-49CF-44D0-9075-58B144BBDE47@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 21/10/2009, at 7:40 PM, steve donovan wrote: > People often use client-side Javascript, e.g. Alex Gorbatchev's syntax > highlighter does Lua as well as the usual suspects. Nice! Done. I gave syntaxhighlighter an inline mode for embedded in paragraphs, and fiddled with markdown.lua (Nicolas Frykholm's one, not the LPEG one discussed here recently) so that it was a little more flexible with headers. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 19:43:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LLhboZ022322; Wed, 21 Oct 2009 19:43:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA8AA193BA; Wed, 21 Oct 2009 19:42:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55960193A4 for ; Wed, 21 Oct 2009 19:42:21 -0200 (BRST) Received: by fxm12 with SMTP id 12so8543988fxm.5 for ; Wed, 21 Oct 2009 14:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=MhJTYQv37B5zn3dU7LSrPJImfephubWzh6Dt1jj+wEU=; b=gMSNNO4JuubBGNhCtWRhB2Srxc7VqpljcgIpYgM8Rom2hIpecyePOLK7YGX8t1wOxn /D9ronXSRa9PA7dLmZwqvctTN9R+rvWeKiPf/PvjSCM9HHlupL3jvFcCLEeKp8J77aiR 4JmO8C1NZLWIz9KmlJozulCski3HwRNW/0StY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=iPmE/U5SlUwEF+/uImP2AddtnOjemfIkCh0Wpr989dv1cCCobpFFOYSqFYSpCKG5zQ FvnuPgf7IglrO+JdXugEh1BcHh2rrxYJ9850Ir4Yynr6EXDQ4ThTZZeXRezgSOwsYB7o LXELanMRkWjuL/MrgvbBpI2uhe1Xy3fRiSxmE= Received: by 10.103.64.16 with SMTP id r16mr111843muk.90.1256161386258; Wed, 21 Oct 2009 14:43:06 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id g1sm555440muf.5.2009.10.21.14.43.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 14:43:05 -0700 (PDT) Message-Id: <31A5A7D7-BA31-40D5-8D12-CF37220340EF@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <45B4B233-49CF-44D0-9075-58B144BBDE47@fastmail.fm> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Documentation Markup Date: Wed, 21 Oct 2009 23:42:34 +0200 References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> <45B4B233-49CF-44D0-9075-58B144BBDE47@fastmail.fm> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 11:33 PM, Geoff Leyland wrote: > fiddled with markdown.lua (Nicolas Frykholm's one, not the LPEG one > discussed here recently) Talking of which, David Loren Parsons' discount library is "de rigueur" for efficient Markdown processing: http://www.pell.portland.or.us/~orc/Code/markdown/ Alex Bradbury has a Lua binding for it: http://asbradbury.org/projects/lua-discount/ Alex's binding is for an older version of discount (1.2.10), but it's rather straightforward to update to the latest, greatest (1.5.5). From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 20:01:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LM1hvc024660; Wed, 21 Oct 2009 20:01:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51B31192C8; Wed, 21 Oct 2009 20:00:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C72218BB2 for ; Wed, 21 Oct 2009 20:00:27 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 346ACB46E3 for ; Wed, 21 Oct 2009 18:01:15 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 21 Oct 2009 18:01:15 -0400 X-Sasl-enc: U6sAzHeHKZeJbNECOeM+a/SfMmKieOdUI21W/3ohMn3O 1256162470 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id D1574B63D for ; Wed, 21 Oct 2009 18:01:09 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Documentation Markup From: Geoff Leyland In-Reply-To: <31A5A7D7-BA31-40D5-8D12-CF37220340EF@gmail.com> Date: Thu, 22 Oct 2009 11:00:36 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> <45B4B233-49CF-44D0-9075-58B144BBDE47@fastmail.fm> <31A5A7D7-BA31-40D5-8D12-CF37220340EF@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 22/10/2009, at 10:42 AM, Petite Abeille wrote: > On Oct 21, 2009, at 11:33 PM, Geoff Leyland wrote: > >> fiddled with markdown.lua (Nicolas Frykholm's one, not the LPEG one >> discussed here recently) > > Talking of which, David Loren Parsons' discount library is "de > rigueur" for efficient Markdown processing: > > http://www.pell.portland.or.us/~orc/Code/markdown/ > > Alex Bradbury has a Lua binding for it: > > http://asbradbury.org/projects/lua-discount/ > > Alex's binding is for an older version of discount (1.2.10), but > it's rather straightforward to update to the latest, greatest (1.5.5). That looks like it would let me do what I wanted - set things in the header (in this case titles, and add all the script guff SyntaxHighlighter needs), but I've never seen that stuff documented. Maybe I should google harder... Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 20:31:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LMVKhb028669; Wed, 21 Oct 2009 20:31:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B99BF193AE; Wed, 21 Oct 2009 20:30:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E937190D8 for ; Wed, 21 Oct 2009 20:29:54 -0200 (BRST) Received: by ewy26 with SMTP id 26so7386992ewy.5 for ; Wed, 21 Oct 2009 15:30:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.156.7 with SMTP id d7mr3552311ebe.16.1256164241019; Wed, 21 Oct 2009 15:30:41 -0700 (PDT) In-Reply-To: <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> Date: Wed, 21 Oct 2009 17:30:40 -0500 Message-ID: <90eb1dc70910211530k37bb4571k5785de5d26225837@mail.gmail.com> Subject: Re: Weak keyed tables with primitive keys From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LMVKhb028669 On Wed, Oct 21, 2009 at 12:25 PM, Wim Couwenberg wrote: > It's quite natural: instead of "referenced" think about a key as > "reproducible".  I can reconstruct numbers, booleans and strings > *identically* from thin air at any time. nice image. add lightuserdata to that list. -- Javier From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 20:43:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LMhe4Z030002; Wed, 21 Oct 2009 20:43:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70B1E193E3; Wed, 21 Oct 2009 20:42:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth21.prod.mesa1.secureserver.net (smtpauth21.prod.mesa1.secureserver.net [64.202.165.38]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7B729193BF for ; Wed, 21 Oct 2009 20:42:17 -0200 (BRST) Received: (qmail 31219 invoked from network); 21 Oct 2009 22:43:01 -0000 Received: from unknown (98.117.140.83) by smtpauth21.prod.mesa1.secureserver.net (64.202.165.38) with ESMTP; 21 Oct 2009 22:43:00 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Weak keyed tables with primitive keys From: Mark Hamburg In-Reply-To: <20091021203008.GA9178@inf.puc-rio.br> Date: Wed, 21 Oct 2009 15:42:59 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <17eac67c0910200853o6844b11bl9f0511a720eac0db@mail.gmail.com> <17eac67c0910200902t5d24ad2v36e36cdb69ba4aa3@mail.gmail.com> <5fe281d40910200906q66630589geb27bfab9e6df9@mail.gmail.com> <6d59dad30910211025m161b1d37y99b709374f93bdf5@mail.gmail.com> <20091021203008.GA9178@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 21, 2009, at 1:30 PM, Roberto Ierusalimschy wrote: >> The above seems like a memory leak, as 'cache[ aPath ] = aContent' >> will >> hold everything forever. >> Thoughts? > > It is curious why nodoby is concerned with similar things happening > with numerical keys. If aPath is a number, you have exactly the same > situation. Should Lua wait until the number is collected to remove > that > entry from the table? To start with files aren't generally identified by number (though I guess one could get the inode number), but be that as it may... What seems more troubling is not the fact that string keys aren't weak (though that's at times awkward) as that string values aren't weak (though the lack of weakness for string keys is a problem for weak sets of strings even strings as values were weak). In the file cache case, what really matters is that if the results of the file read are still in memory then there's no point in reading again. We can work around the issue with an intermediate table in the cache which is mostly accurate if we don't hang onto the results of file reads for very long. On the other hand, this means that any GC protection logic -- i.e., logic to keep the read data from going away too fast -- must now deal with the intermediate tables. We can't simply access a value from the file cache and hand it to the GC protection logic. Rather we need to hand an internal data structure from the file cache to the GC protection logic. Mark From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 21:09:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LN9FBt000671; Wed, 21 Oct 2009 21:09:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A528193A1; Wed, 21 Oct 2009 21:07:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B993E1938A for ; Wed, 21 Oct 2009 21:07:52 -0200 (BRST) Received: by bwz27 with SMTP id 27so334784bwz.21 for ; Wed, 21 Oct 2009 16:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Z5NEcJCJGieyWdyFup875pX/1Gbhv27xGDulrbs2hpM=; b=P1AQMMtIxKDsojzN8UwjONFNqjQAfJEP8HEDzN+JrbLp3/UvjDA7tPXjflVjgUeKeM IjxcAN9hwd5EVBA7O9qhrmO48WtTWaVO5N3r15V5qZ78xTsQLE/o/4wq465F7qLwceE6 CTgQADXuBU4GTMgW5igKPJ4OV9yd+vLUh5xzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Hq2oawI1LKlQ0i0N1rgq4MyX7czfoGTSXA3ASSm/qL2zOUI/j4UBzSo7mrhQFTQ2d1 ltBO0hb1WSQIPd1izl2BbIM4KTKskRcZQyIhwugkCvwFXSKU//xN1s9dVbmmQSk+87+/ bwSfKieo6U3NJvz3QbnKfGprgpPg5xMtqTjgo= MIME-Version: 1.0 Received: by 10.204.156.18 with SMTP id u18mr1744390bkw.102.1256166520350; Wed, 21 Oct 2009 16:08:40 -0700 (PDT) In-Reply-To: <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> Date: Wed, 21 Oct 2009 19:08:40 -0400 X-Google-Sender-Auth: 9560c1d236bbb61d Message-ID: Subject: Re: Documentation Markup From: Yuri Takhteyev To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LN9FBt000671 > People often use client-side Javascript, e.g. Alex Gorbatchev's syntax > highlighter does Lua as well as the usual suspects. Actually, Lua support isn't included with SyntaxHighlighter by the default. The reason Sputnik gets to show off syntax highlighting for Lua is because Sérgio Medeiros and I wrote a Lua "brush" for SyntaxHighlighter, see [1]. However, we've been too lazy to get in touch with Alex Gorbatchev about this. If someone wants to take on this task, please feel welcome to do so. BTW, our syntaxhighlighter module [2] wraps SyntaxHighlighter's JS and CSS in Lua, to enable installing SyntaxHighlighter as a rock and then serving JS and CSS from the rock. But again, I haven't gotten around to actually releasing this as a rock. - yuri [1]: http://gitorious.org/sputnik/mainline/blobs/master/syntaxhighlighter/lua/syntaxhighlighter/scripts/shBrushLua.lua [2]: http://gitorious.org/sputnik/mainline/trees/master/syntaxhighlighter/lua From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 21:15:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LNFeSr001449; Wed, 21 Oct 2009 21:15:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0878A193D2; Wed, 21 Oct 2009 21:14:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B55F1938B for ; Wed, 21 Oct 2009 21:14:25 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id E7DF9B4FB2 for ; Wed, 21 Oct 2009 19:15:13 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 21 Oct 2009 19:15:12 -0400 X-Sasl-enc: 7UYwOUl57QvSmhgJB5KsjSvsOeHnlOLgq3TOkobMTRWz 1256166913 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id CA240B676 for ; Wed, 21 Oct 2009 19:15:12 -0400 (EDT) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Documentation Markup From: Geoff Leyland In-Reply-To: Date: Thu, 22 Oct 2009 12:14:38 +1300 Message-Id: <799002DC-E946-438C-A907-2743A4FB710B@fastmail.fm> References: <4ACF11DC.6030805@peterodding.com> <5AC0EFDC-FBDF-4A9A-874C-D6AA8944739F@fastmail.fm> <6a3ae47e0910090606v3ff8ccfdg5e7385ca30f81380@mail.gmail.com> <560972290910090619w44018fefj15d17728376fb61f@mail.gmail.com> <1AC476FC-0002-4538-ADEE-509687613233@fastmail.fm> <560972290910202340n6e478dedg6fb0946596d4ba96@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LNFeSr001449 On 22/10/2009, at 12:08 PM, Yuri Takhteyev wrote: >> People often use client-side Javascript, e.g. Alex Gorbatchev's >> syntax >> highlighter does Lua as well as the usual suspects. > > Actually, Lua support isn't included with SyntaxHighlighter by the > default. The reason Sputnik gets to show off syntax highlighting for > Lua is because Sérgio Medeiros and I wrote a Lua "brush" for > SyntaxHighlighter, see [1]. However, we've been too lazy to get in > touch with Alex Gorbatchev about this. If someone wants to take on > this task, please feel welcome to do so. > > BTW, our syntaxhighlighter module [2] wraps SyntaxHighlighter's JS and > CSS in Lua, to enable installing SyntaxHighlighter as a rock and then > serving JS and CSS from the rock. But again, I haven't gotten around > to actually releasing this as a rock. > > - yuri > > [1]: http://gitorious.org/sputnik/mainline/blobs/master/syntaxhighlighter/lua/syntaxhighlighter/scripts/shBrushLua.lua > > [2]: http://gitorious.org/sputnik/mainline/trees/master/syntaxhighlighter/lua Thanks. I just grabbed the two listed here: http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/ both of which seem to be for an earlier version of lua and needed a little fixing. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 21 21:36:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9LNZvE6003713; Wed, 21 Oct 2009 21:35:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A2F91938B; Wed, 21 Oct 2009 21:34:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB19119287 for ; Wed, 21 Oct 2009 21:34:40 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N0kiA-00068w-5P for lua@bazar2.conectiva.com.br; Thu, 22 Oct 2009 00:35:22 +0100 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 877437112D for ; Wed, 21 Oct 2009 23:16:58 +0100 (BST) Received: from hilfy.local and verified by Spey connected from hilfy.local:55150 with envelope Message-ID: <4ADF9657.8090004@cowlark.com> Date: Thu, 22 Oct 2009 00:16:39 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Objective Lua suggestion wanted X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9LNZvE6003713 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 (People who want to talk about *useful* stuff may want to skip this post.) So I'm working on v0.1 of OLua. It's going pretty well; I have a recursive descent Lua parser and emitter with OLua extensions, a framework for transforming code, some runtime, etc. However, a few irritating realities have cropped up in places where the Lua idiom for doing something is totally unlike the Objective idiom. Such as instance variables. The toy I released a little while ago had methods like this: @implementation Thing : Object - width return self._width end @end The initial problem here is that instance variables and methods occupy the same namespace --- hence the _ in front of the name. That's pretty ugly. The second problem is that they're public, which means anyone can access them without going through the getter; but the third problem, the biggie, is that you cannot have an instance variable set to nil, because if you do that then when you read from it the fallback method handler kicks in and returns you a function that calls object:doesNotRecognise(). So, I'm now looking at a closure-based mechanism. This works much better. It's faster and the variables are private. Objects are now more expensive to create, but I can live with that. So now it looks like this: @implementation Thing : Object local width - width return width end @end Note that the variables live in a different namespace. This is good, but introduces a syntax ambiguity: @implementation Thing : Object local width = 4 - width return width end @end ...is parsed as: local width = 4 - width return width ...which is not good. So, any suggestions for alternative syntax? Objective J, which is the same principle applied to Javascript, does this: @implementation Thing : Object { int width; } - width { return width } @end The equivalent in Lua would be to have a do...end block containing the local declarations. But I don't like that, because it would look like the locals are scoped inside the block, where they're actually visible to the object methods (but not the class methods). You can get away with it in Javascript because that language doesn't really have lexical scoping. Using a special keyword to introduce a instance variable doesn't help, because the ambiguity occurs at the *end* of an expression, not the beginning --- I need a keyword to separate the expression from the method declaration. (Right now I'm just putting a ; in to make it work.) I could change the method declaration syntax, but I'd rather like to keep it as traditionally Objectified as possible. I could disallow initialised instance variables, but allowing that is very convenient and I don't want to lose it. So, assuming there's anyone out there who would want to use this abomination once I get it working, what would you like to see? - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD4DBQFK35ZXf9E0noFvlzgRAuoaAJiOcg0tnubzcpCnaFxLrYxVbv3CAKCSxoVr nchD1meQqcI+OLmBwQRAWg== =f8hi -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 01:48:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M3mK2j000477; Thu, 22 Oct 2009 01:48:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D5C01934C; Thu, 22 Oct 2009 01:47:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EF1719289 for ; Thu, 22 Oct 2009 01:47:00 -0200 (BRST) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n9M3kfRx003505; Thu, 22 Oct 2009 12:47:45 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay11.aps.necel.com with ESMTP; Thu, 22 Oct 2009 12:47:45 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay11.aps.necel.com with ESMTP; Thu, 22 Oct 2009 12:47:45 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 0342252E1F8; Thu, 22 Oct 2009 12:47:45 +0900 (JST) From: Miles Bader To: Rajesh Malepati Subject: Re: Can someone convert this POSIX regex to a Lua regex? References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> <20091020173717.A30371@lua.tecgraf.puc-rio.br> <1256068645.16263.83.camel@defiant.tbdnetworks.com> <2610f25f0910201305o435e3ec0va0b4e28908b98bf7@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Thu, 22 Oct 2009 12:47:44 +0900 In-Reply-To: <2610f25f0910201305o435e3ec0va0b4e28908b98bf7@mail.gmail.com> (Rajesh Malepati's message of "Wed, 21 Oct 2009 01:35:43 +0530") Message-ID: Lines: 18 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9M3mK2j000477 Rajesh Malepati writes: >> Actually started doing that, but it's quite complicated.  Can we have | >> in Lua regexp pretty please?  I can work around most other limitations, >> but alternatives are hard (especially like /hi (foo|bar)+ there/). > > Can you try using LPeg instead ? > See http://www.inf.puc-rio.br/~roberto/lpeg/ Yeah, for anything non-trivial, you're going to be much happier with lpeg anyway. It's just better. -Miles -- (\(\ (^.^) (")") *This is the cute bunny virus, please copy this into your sig so it can spread. From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 02:04:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M446Xo002656; Thu, 22 Oct 2009 02:04:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83F8019383; Thu, 22 Oct 2009 02:02:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7459119378 for ; Thu, 22 Oct 2009 02:02:45 -0200 (BRST) Received: by fxm12 with SMTP id 12so8895625fxm.5 for ; Wed, 21 Oct 2009 21:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=7QNa0tBoK2G5d58QLq/56GjltTYUO6jK/t90bD/1QPQ=; b=OojaJA/94KPxKyAA9BkLbVtxow+o7pN2mag3frgyyx7aoRwQXrYbnS0CdwEyqhv+MZ Sw6zb/pca3waR88FqQVKN5H5jEZX+9tQdKbvFeYdw3qOByfgjvaYqhu65Hayq1ifA0aD ZwOuls8kkxkzDuTrQaivGPRU3JJ5jnjfNLZD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; b=HfQSDn8O3nDb+oN+Nxpc603EDYXJKu+UKV9GFi8yJvs1QVu0hxbZwoQUshowTiM23Z dTicOvLqCfyxD+mVrFCMMvTH1vDM7b7XoIFw2+BJHawvphz+72GxiSJljjAE8kO619Os fYCR3dm2seosU4chbLPS1GGTU4GnDANkHDDDY= MIME-Version: 1.0 Received: by 10.204.6.65 with SMTP id 1mr8908653bky.186.1256184212371; Wed, 21 Oct 2009 21:03:32 -0700 (PDT) Date: Wed, 21 Oct 2009 23:03:32 -0500 X-Google-Sender-Auth: 2136f80504b6155c Message-ID: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> Subject: LPEG vs. PCRE (was: Can someone convert this POSIX regex to a Lua regex?) From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015174c1cd0c0389b04767e2d83 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174c1cd0c0389b04767e2d83 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > > Yeah, for anything non-trivial, you're going to be much happier with > lpeg anyway. It's just better. > Based on your experience, may you tell me why LPEG is better than PCRE? --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015174c1cd0c0389b04767e2d83 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yeah, for anything non-trivial, you're going to be much happier w= ith
lpeg anyway. =C2=A0It's just better.

Based on = your experience, may you tell me why LPEG is better than PCRE?


--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina= Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje pien= sa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. <= br> --0015174c1cd0c0389b04767e2d83-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 02:16:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M4GrZv003854; Thu, 22 Oct 2009 02:16:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BD9519326; Thu, 22 Oct 2009 02:15:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41DC719316 for ; Thu, 22 Oct 2009 02:15:43 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id D9CF5B438D for ; Thu, 22 Oct 2009 00:16:31 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 22 Oct 2009 00:16:30 -0400 X-Sasl-enc: RWvjEmR25ILxVBOyMvQ+dYHsKQoyQ0IxdZxkD1KftE/w 1256184991 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id CD4C511619 for ; Thu, 22 Oct 2009 00:16:30 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Rima: Linear Programming for Lua Date: Thu, 22 Oct 2009 17:15:58 +1300 Message-Id: <11D0CE6E-FE9E-471D-9CB3-29975750D3DA@fastmail.fm> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Version 0.02 of Rima, a symbolic math modelling package and binding to a number of linear programming [1] libraries, is available. Documentation starts at http://www.incremental.co.nz/projects/ lua.html , development is now hosted on google code at http://code.google.com/p/rima/ , and you can get the tarball from http://rima.googlecode.com/files/rima-0.02.tar.gz If you're wanting to solve LPs from Lua, then as far as I know, Rima's your only choice (can anyone tell me otherwise?). If you're not interested in LPs, then Rima's late-bound symbolic math is worth a look. It might be pretty nifty, and at the very least it's a horribly complicated way of solving a simple problem. Changes since the last version are a much richer late-bound handling of tables and table composition, improvements to syntax, and much better (but still not complete) documentation. (BTW, the all the code snippets in the documentation make up part of the test suite thanks to doctest.lua!). Coming up (this could take a while) I hope to move onto column-wise modelling and submodels, heading for some kind really nice composability system for models. Any feedback would be much appreciated. Cheers, Geoff [1] http://en.wikipedia.org/wiki/Linear_programming From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 02:51:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M4pPjE006681; Thu, 22 Oct 2009 02:51:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D67161A67E; Thu, 22 Oct 2009 02:50:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9022C1A66D for ; Thu, 22 Oct 2009 02:49:59 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so943447qwb.11 for ; Wed, 21 Oct 2009 21:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=DRnqrIn9jfu404UIEJh649iyXy8kM1zEXDWrJyKvJlY=; b=Vmd0qW88vP5Z/BnrOFmX7rcDfw6a2uH58gh1f3pEbXI9fKChvgx+RM40K+IIH6ojMi NeubDW9DzMwweulOno9gI5mrD6CaAjmjbCDjS3+v9wXittbgRBugYiiZyBui9tYZ4KjH w5vB1VG/Y7IES4+49cJd7zYdAsxAHe1KxacJo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=g5cb9JuBOJ7tYZz1NR8mjNdb5SM0PQKMzQfUt8c8YzdXzYnjxV+l7GBN4OUGyLGMIA VzhO8xdARZZN23P+oFb9OwqCVk3inu2stuJRW776bvFmpsQGfX08weUrrIKIwimofewX OqIAyLeh865zQSsBMKhmpsTKKYbUdVyGT7d3c= MIME-Version: 1.0 Received: by 10.224.114.194 with SMTP id f2mr4431334qaq.68.1256187047059; Wed, 21 Oct 2009 21:50:47 -0700 (PDT) In-Reply-To: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> References: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> Date: Thu, 22 Oct 2009 02:50:47 -0200 X-Google-Sender-Auth: 26bea15a8b566347 Message-ID: <7913df4d0910212150g62f9e6f0l8b6159bbd3ae03ea@mail.gmail.com> Subject: Re: LPEG vs. PCRE (was: Can someone convert this POSIX regex to a Lua regex?) From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9M4pPjE006681 Roberto's talk at the 2008 Lua Workshop gives a nice summary: http://www.vimeo.com/1485123 LPEG patterns can be composed and abstracted away, so building a complex pattern is much more like programming. LPEG's re module is specially nice for the kinds of pattern for which you would use PCRE. -- Fabio 2009/10/22 Fernando P. García : >> Yeah, for anything non-trivial, you're going to be much happier with >> lpeg anyway.  It's just better. > > Based on your experience, may you tell me why LPEG is better than PCRE? > > > -- > Fernando P. García, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Perú > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de tí. > From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 04:05:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M65S8J014238; Thu, 22 Oct 2009 04:05:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9217919369; Thu, 22 Oct 2009 04:04:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21CC61934A for ; Thu, 22 Oct 2009 04:03:56 -0200 (BRST) Received: by iwn8 with SMTP id 8so3973987iwn.33 for ; Wed, 21 Oct 2009 23:04:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.27 with SMTP id n27mr5767149ibr.48.1256191484526; Wed, 21 Oct 2009 23:04:44 -0700 (PDT) In-Reply-To: References: <48b7e23a0910201141r6fc11bcerba2864e4de7ad3f8@mail.gmail.com> Date: Thu, 22 Oct 2009 02:04:44 -0400 X-Google-Sender-Auth: d44ea0228a342da2 Message-ID: Subject: Re: Can someone convert this POSIX regex to a Lua regex? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9M65S8J014238 On Tue, Oct 20, 2009 at 4:13 PM, Duncan Cross wrote: > On Tue, Oct 20, 2009 at 7:41 PM, Linus Sjögren wrote: >> Here's the regex in question: '^(?:(?:ceil|abs|floor|mod|exp|log|pow|sqrt|acos|asin|atan|cos|sin|tan|deg|rad|random)\\(|pi|\\(|\\)|-|\\+|\\*|/|\\d|\\.|\\^|\\x2C| >> )+$' > > Lua's string patterns are not full regular expressions, and simply > don't support many constructs like (pattern1|pattern2) or (pattern)+.... > However, if you'd like to see what a "pure-Lua" solution would look > like, here is one. I've updated the pure-Lua "xpattern" library: http://lua-users.org/wiki/ExPattern So, one can now write a quasi-Lpeg like test as such: local m = ( P'^' * ( ( P'ceil'+P'abs' +P'floor'+P'mod' +P'exp'+P'log'+P'pow'+ P'sqrt'+P'acos'+P'asin' +P'atan'+P'cos'+P'sin'+P'tan'+ P'deg' +P'rad' +P'random' ) * P'%(' + P'[0-9%(%)%-%+%*%/%.%,]' + P'pi' )^1 * P'$' ):compile() assert(m'cos(1+pi)' == 'cos(1+pi)') assert(m'cos(1+p)' == nil) -- 'p' assert(m'cos(12.3/2)+mod(2,3)' == 'cos(12.3/2)+mod(2,3)') assert(m'cos(12.3/2)+mod(2,3) ' == nil) -- ' ' assert(m' cos(12.3/2)+mod(2,3)' == nil) -- ' ' assert(m'cos(12.3/2)+mod+2' == nil) -- no '(' And it code generates this Lua code: local match = ... -- string.match return function(s,pos) local pos1=pos or 1 local pos2 pos2 = match(s, "^()", pos1) if pos2 then do local pos3=pos2 pos2 = nil while 1 do local pos4 = pos3 local pos5 = pos3 local pos6 = pos3 local pos7 = pos3 local pos8 = pos3 local pos9 = pos3 local pos10 = pos3 local pos11 = pos3 local pos12 = pos3 local pos13 = pos3 local pos14 = pos3 local pos15 = pos3 local pos16 = pos3 local pos17 = pos3 local pos18 = pos3 local pos19 = pos3 local pos20 = pos3 local pos21 = pos3 pos21 = match(s, "^ceil()", pos3) if not pos21 then pos21 = match(s, "^abs()", pos3) end pos20 = pos21 if not pos20 then pos20 = match(s, "^floor()", pos3) end pos19 = pos20 if not pos19 then pos19 = match(s, "^mod()", pos3) end pos18 = pos19 if not pos18 then pos18 = match(s, "^exp()", pos3) end pos17 = pos18 if not pos17 then pos17 = match(s, "^log()", pos3) end pos16 = pos17 if not pos16 then pos16 = match(s, "^pow()", pos3) end pos15 = pos16 if not pos15 then pos15 = match(s, "^sqrt()", pos3) end pos14 = pos15 if not pos14 then pos14 = match(s, "^acos()", pos3) end pos13 = pos14 if not pos13 then pos13 = match(s, "^asin()", pos3) end pos12 = pos13 if not pos12 then pos12 = match(s, "^atan()", pos3) end pos11 = pos12 if not pos11 then pos11 = match(s, "^cos()", pos3) end pos10 = pos11 if not pos10 then pos10 = match(s, "^sin()", pos3) end pos9 = pos10 if not pos9 then pos9 = match(s, "^tan()", pos3) end pos8 = pos9 if not pos8 then pos8 = match(s, "^deg()", pos3) end pos7 = pos8 if not pos7 then pos7 = match(s, "^rad()", pos3) end pos6 = pos7 if not pos6 then pos6 = match(s, "^random()", pos3) end pos5 = pos6 if pos5 then pos5 = match(s, "^%(()", pos5) end if not pos5 then pos5 = match(s, "^[0-9%(%)%-%+%*%/%.%,]()", pos3) end pos4 = pos5 if not pos4 then pos4 = match(s, "^pi()", pos3) end pos3 = pos4 if pos3 then pos2=pos3 else break end end end end if pos2 then pos2 = match(s, "^()$", pos2) end if pos2 then return s:sub(pos1,pos2-1) end end It's currently somewhat experimental, so fix it up if you're so inclined. From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 04:12:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M6CR4Y015087; Thu, 22 Oct 2009 04:12:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66BF11938A; Thu, 22 Oct 2009 04:11:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFFFB19378 for ; Thu, 22 Oct 2009 04:11:07 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1616647eye.39 for ; Wed, 21 Oct 2009 23:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=vIWHFOF88cnpI5QdDeUXEP21pO0001s21DUcpNSYSwc=; b=iGvHiT/P2bD70HhC7EJ9UQyhTParOlOVxc7VVQefZ0W4V1giN8txATI4eCgySbzqK7 O6vnc50vpQ2NbMtGZ6vheWJuf59KMWD/s2c6tji0xv9zGTsbr/GMMLG4L9kFSn3CrfOw ZiNoAv6Eud4iyNg0RSzWbBubAwOXZUx1ZDpRg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=lXm7KXUKsfLyonvsLgnvd5OWV55H7R0zAqh1P46/beotHW3iKKqEo8IXIvqa8P+bhP SrPXthmmulbtUapfoZ6Dt6iU/EDk2GNhW9vc/0lLYPtKTBZgXkjQ/v2/UZumjx9qZudM DRQHRb9whh62iNKutVbbkBA9ObSBByvrsK5ac= MIME-Version: 1.0 Received: by 10.211.174.15 with SMTP id b15mr3992087ebp.22.1256191914861; Wed, 21 Oct 2009 23:11:54 -0700 (PDT) In-Reply-To: <4ADF9657.8090004@cowlark.com> References: <4ADF9657.8090004@cowlark.com> Date: Thu, 22 Oct 2009 08:11:54 +0200 X-Google-Sender-Auth: 495c746ad3a61d6e Message-ID: <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> Subject: Re: Objective Lua suggestion wanted From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=00504502c5ffdae50404767ff86c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502c5ffdae50404767ff86c Content-Type: text/plain; charset=ISO-8859-1 Generally speaking, the most limiting feature of Lua syntax, when you want to extend/modify it, is the lack of mandatory statement separators. If you think of a random extension, 3/4 of the time it will introduce statement separation ambiguities, sometimes hard to suppress. The usual way to fix this is to use dedicated keywords to introduce statements, which can't appear in an expression: here that would be choosing method introduction keyword other than "-". Since you're going to break source compatibility anyway, I'd suggest that you make the ";" statement separators mandatory. Since your program's purpose is to clarify sources, I fear that introducing contrived rules to resolve parsing ambiguities would defeat its main purpose. Note that mandatory separators would also solve your index/invocation ambiguity; here again, the other clean alternative would be to use another keyword than "[" to introduce invocations. -- Fabien. --00504502c5ffdae50404767ff86c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Generally speaking, the most limiting feature of Lua syntax, when you want = to extend/modify it, is the lack of mandatory statement separators. If you = think of a random extension, 3/4 of the time it will introduce statement se= paration ambiguities, sometimes hard to suppress. The usual way to fix this= is to use dedicated keywords to introduce statements, which can't appear in an expression: = here that would be choosing method introduction keyword other than "-&= quot;.

Since you're going to break source compatibility anyway, = I'd suggest that you make the ";" statement separators mandat= ory.=A0 Since your program's purpose is to clarify sources, I fear that introducing contrived rules to resolve parsing ambiguities would defeat its main purpose.

Note that mandatory separators would also s= olve your index/invocation ambiguity; here again, the other clean alternati= ve would be to use another keyword than "[" to introduce invocati= ons.

=A0=A0=A0 -- Fabien.
--00504502c5ffdae50404767ff86c-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 04:38:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M6cav0017326; Thu, 22 Oct 2009 04:38:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93456192B6; Thu, 22 Oct 2009 04:37:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BD78192A6 for ; Thu, 22 Oct 2009 04:37:15 -0200 (BRST) Received: by ewy26 with SMTP id 26so7706260ewy.5 for ; Wed, 21 Oct 2009 23:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=j0ldJ5sEzd7YgkZDTFtYSv4BuqCeZ4PDg58OQJ7341M=; b=xYM1Wt6aNIlrxCnnlYF9wDtUdF0f+SL/vOV4zOqnKGUp8De3fWazf3fAQknFssIYGc Mly8+6fHwbcoanDswI5vwpGJO8ND30MzkKMxe+XyKu7RowxquvalFXZVxH8wn7p5mGnm huuSBqnprVMHW8CRUrKRblBcEjj86DfjOIY14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oBbbolqp/ScLuHtyzIO85QYRi+/JcDUr8y8AWHs8B3RiwAT0PIOQd28VH3WpcaDLMW gOY8aVSGG9JrBSbspD7ox4FIukyirw0nI4XJ37v4Bsph054kWw5iU/9vtukI2+GCeyJ9 cqM5zGzs4m8Bd8d9KoRICQTqBsfZXyJweszOo= MIME-Version: 1.0 Received: by 10.216.93.12 with SMTP id k12mr234037wef.195.1256193482961; Wed, 21 Oct 2009 23:38:02 -0700 (PDT) Date: Thu, 22 Oct 2009 19:38:02 +1300 Message-ID: Subject: Behaviour of 'set' From: Mark Sibly To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I'm currently using lua as a configuration parsing tool where users create config files like: speed=100 bounciness=20 I'm using meta tables to chain these together so users get a sort of 'scope hierarchy' - ie: 'inner' configs can override settings in outer configs. This works well for reading values but not for writing, because the way lua works, an assignment like 'speed=100' will overwrite the outer speed value. The behaviour I'm after would instead create a new key/value in the inner scope if it didn't exist there already. Is there anyway to do this without resorting to either a C function to do the metatable set_index work, or having to littler the config files with something like 'self.speed=100'? Thanks in advance for any advice. Bye! Mark From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 06:12:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9M8CICn025031; Thu, 22 Oct 2009 06:12:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49FC7193A6; Thu, 22 Oct 2009 06:11:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73FB8192C7 for ; Thu, 22 Oct 2009 06:10:56 -0200 (BRST) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n9M8BfM8017269; Thu, 22 Oct 2009 17:11:41 +0900 (JST) Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay11.aps.necel.com with ESMTP; Thu, 22 Oct 2009 17:11:41 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay21.aps.necel.com with ESMTP; Thu, 22 Oct 2009 17:11:41 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 916B752E1F8; Thu, 22 Oct 2009 17:11:41 +0900 (JST) From: Miles Bader To: Fabien Subject: Re: Objective Lua suggestion wanted References: <4ADF9657.8090004@cowlark.com> <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Thu, 22 Oct 2009 17:11:41 +0900 In-Reply-To: <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> (Fabien's message of "Thu, 22 Oct 2009 08:11:54 +0200") Message-ID: Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabien writes: > Since you're going to break source compatibility anyway, I'd suggest that > you make the ";" statement separators mandatory. That's literally true, but _completely_ misses the point of the extension, which is to add a syntactically distinct and obvious OO "layer" on top of the existing language. This makes it much easier for existing Lua programmers to use the feature, and allows new programs to easily use existing documentation, code-snippets, libraries, etc. Making separators mandatory completely ruins all of that. > Note that mandatory separators would also solve your index/invocation > ambiguity ... at huge cost. While "contrived rules" may seem worse in theory, in practice they're often much better, because they mirror how people actually write code. Of course it's good to minimize such things, but they must be judged individually to determine whether they're truly a problem or not. Seriously tho, while there may indeed be a better syntax than the [...] stuff, mandatory separators is a horrible idea. -Miles -- Happiness, n. An agreeable sensation arising from contemplating the misery of another. From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 09:27:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MBRgIq015875; Thu, 22 Oct 2009 09:27:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A44C6192EA; Thu, 22 Oct 2009 09:26:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 979B4192B5 for ; Thu, 22 Oct 2009 09:26:10 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MBQuBR015812 for ; Thu, 22 Oct 2009 09:26:58 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9MBQtZ04736; Thu, 22 Oct 2009 09:26:55 -0200 Date: Thu, 22 Oct 2009 09:26:54 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Behaviour of 'set' Message-ID: <20091022092654.A4720@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from blitzmunter@gmail.com on Thu, Oct 22, 2009 at 07:38:02PM +1300 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The behaviour I'm after would instead create a new key/value in the > inner scope if it didn't exist there already. Evaluate scripts in their own empty environment that have __index to the outer one. So you can read values from the outer scope but write only in the inner one. From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 09:51:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MBp0UT021400; Thu, 22 Oct 2009 09:51:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88C318A35; Thu, 22 Oct 2009 09:49:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC760192A2 for ; Thu, 22 Oct 2009 09:49:34 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N0wBN-0002RR-L2 for lua@bazar2.conectiva.com.br; Thu, 22 Oct 2009 12:50:17 +0100 Received: from [172.22.67.145] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id A43AC170AB for ; Thu, 22 Oct 2009 12:50:16 +0100 (BST) Received: from starling.antixlabs.com and verified by Spey connected from starling.antixlabs.com:1460 with envelope Message-ID: <4AE046D3.2050600@cowlark.com> Date: Thu, 22 Oct 2009 12:49:39 +0100 From: David Given User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Objective Lua suggestion wanted References: <4ADF9657.8090004@cowlark.com> <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> In-Reply-To: <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9MBp0UT021400 Fabien wrote: > Generally speaking, the most limiting feature of Lua syntax, when you > want to extend/modify it, is the lack of mandatory statement separators. > If you think of a random extension, 3/4 of the time it will introduce > statement separation ambiguities, sometimes hard to suppress. I have to agree with you here. It does make things awkward. Luckily for me, @ isn't used for anything in Lua, so I can use @-prefixed keywords for a clean namespace; it might be a useful extension for Lua 5.2 to actually *define* a language extension namespace for this sort of thing, like Java annotations. [...] > Since you're going to break source compatibility anyway, I'd suggest > that you make the ";" statement separators mandatory. Since your > program's purpose is to clarify sources, I fear that introducing > contrived rules to resolve parsing ambiguities would defeat its main > purpose. Believe me, I've thought about it! But it is, I think, a step too far away from being a strict Lua superset for comfort. I've already had to break compatibility in one area (see below)... Introducing a new keyword for method declarations is probably the least bad workaround. > Note that mandatory separators would also solve your index/invocation > ambiguity; here again, the other clean alternative would be to use > another keyword than "[" to introduce invocations. Actually, the ambiguity goes away if you do enough lookahead. An index is always '[' expr ']'; and method call is always '[' expr selector extended-selector ']', so I can simply test for the existence of the ']' or not and backtrack if necessary. (A table-driven parser wouldn't need to backtrack, but I'm using a recursive descent parser.) In fact, I did find a syntax ambiguity. Working: [o doSomething] Working: [o doSomethingWith: [o doSomething]] Failing: [[o doSomething] doSomething] It took me *ages* to figure out why the third example gave weird parse errors --- I'd completely forgotten about Lua's [[...]] long string syntax! So I've had to disable that (I reckon that nested method calls are more useful). Which means, alas, that OLua will not be a strict superset of Lua, to my regret. -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ │ âŽ'⎕',∊Nâ´âŠ‚Sâ†'â†âŽ•â†(3=T)⋎Mâ‹2=Tâ†âŠƒ+/(V⌽"⊂M),(VâŠ"M),(V,⌽V)⌽"(V,Vâ†1⎺1)âŠ"⊂M)' │ --- Conway's Game Of Life, in one line of APL From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 10:04:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MC4dIw023993; Thu, 22 Oct 2009 10:04:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88F46192E8; Thu, 22 Oct 2009 10:03:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DC3A18E5E for ; Thu, 22 Oct 2009 10:03:16 -0200 (BRST) Received: by ewy26 with SMTP id 26so7989368ewy.5 for ; Thu, 22 Oct 2009 05:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=cyNBGUOk3mLYovdbLn5vZQj8WTY7fQAM/LJSZxz4fJg=; b=w1vLlPNN+0/3kvh9GTM6M0tQordlHeRrIFwKmCQcTn6QgLlS8tl2smNF/Lophrww3T 1t4/jcZSb+ppw7QZ9l7smuGZHF23rNTE6SWNSJHtlXA403v4pewofUjnheyxY7X5i0fc yE6r8ELN7mgPIm2zJrWT/KGwywEwixFePsof0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=CgZKdGwdDQLB/BlvrSgFmzAvXEBcLWYijzVSU1g3Kj4VrFvXkB7L8DM5oWRYiTK8Sc 7SHdz4PN3f5oj5yXw7DMcgwif+JzjHqAzKMIiGK7aXg8bZjC2VX2IGlhNyCKcUx+kRaG H5Ze9RZdhC3e/2aDxxurqumfIQXq+GhLpY+Yw= MIME-Version: 1.0 Received: by 10.211.161.34 with SMTP id n34mr10466780ebo.18.1256213044484; Thu, 22 Oct 2009 05:04:04 -0700 (PDT) In-Reply-To: <4AE046D3.2050600@cowlark.com> References: <4ADF9657.8090004@cowlark.com> <956373d40910212311s279197dctac36deb9b67e41fa@mail.gmail.com> <4AE046D3.2050600@cowlark.com> Date: Thu, 22 Oct 2009 14:04:04 +0200 X-Google-Sender-Auth: 3357ca789cee60c3 Message-ID: <956373d40910220504x5d267efm4164946478f44083@mail.gmail.com> Subject: Re: Objective Lua suggestion wanted From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=001636c5ab36475cb5047684e45d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5ab36475cb5047684e45d Content-Type: text/plain; charset=ISO-8859-1 > Believe me, I've thought about it! But it is, I think, a step too far > away from being a strict Lua superset for comfort. There's no need to break compatibility: the only place were it would be mandatory are between a statement and an objective invocation, and between method declarations, i.e. in places that aren't plain-lua compatible anyway. Sure, it would be simpler for people to just put semicolons everywhere (rather than wondering whether they're required or not), but copy/pasting lua code blocks in olua files would just work. Again, semilcolons are part of Objective Lua's syntax, so I don't see anything shoking about strongly encouraging their use in objective lua. > Actually, the [index/invocation] ambiguity goes away if you do enough > lookahead. Indeed, but Lua's ability to be parsed with almost no lookahead helps keeping the language simple and beginner-friendly. I would rather keep it as a good design constraint. --001636c5ab36475cb5047684e45d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Believe me, I've thought about it! But it is, I think, a = step too far
away from being a strict Lua superset for comfort.

There's no need to break compatibility: the only place were it= would be mandatory are between a statement and an objective invocation, an= d between method declarations, i.e. in places that aren't plain-lua com= patible anyway. Sure, it would be simpler for people to just put semicolons= everywhere (rather than wondering whether they're required or not), bu= t copy/pasting lua code blocks in olua files would just work.

Again, semilcolons are part of Objective Lua's syntax, so I don'= ;t see anything shoking about strongly encouraging their use in objective l= ua.
=A0
Actually, the [index/invocation] ambiguity goes away if you do enough looka= head.

Indeed, but Lua's ability to be parsed with= almost no lookahead helps keeping the language simple and beginner-friendl= y. I would rather keep it as a good design constraint.

--001636c5ab36475cb5047684e45d-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 10:09:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MC9FTl025186; Thu, 22 Oct 2009 10:09:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C734C19219; Thu, 22 Oct 2009 10:08:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A49D19176 for ; Thu, 22 Oct 2009 10:07:59 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N0wPj-0001Tk-DQ for lua@bazar2.conectiva.com.br; Thu, 22 Oct 2009 14:05:07 +0200 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2009 14:05:07 +0200 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2009 14:05:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: LPEG vs. PCRE (was: Can someone convert this POSIX regex to a Lua regex?) Date: Thu, 22 Oct 2009 13:57:32 +0200 Lines: 21 Message-ID: References: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 22/10/2009 06:03, Fernando P. García wrote: > Based on your experience, may you tell me why LPEG is better than PCRE? It might be arguable for simple patterns like checking a date format (without checking the validity of the date!) or looking that a string has no spaces, for example. But for real parsing (using context and such), a parser (Peg based or something else) is always better than a RE engine... :-) It might be interesting to do some comparisons (memory usage, speed, compactness of expression vs. readability, etc.) between Lpeg and a binding of PCRE for a number of cases (from simple cases above to the shown expression using lot of alternatives, look-ahead expressions and so on). I am not volunteer... :-) -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 12:55:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MEtoW0014516; Thu, 22 Oct 2009 12:55:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC1EC1911A; Thu, 22 Oct 2009 12:54:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA6621902A for ; Thu, 22 Oct 2009 12:54:23 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1708912eye.39 for ; Thu, 22 Oct 2009 07:55:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.90.81 with SMTP id d59mr3473238wef.29.1256223308742; Thu, 22 Oct 2009 07:55:08 -0700 (PDT) In-Reply-To: <20091022092654.A4720@lua.tecgraf.puc-rio.br> References: <20091022092654.A4720@lua.tecgraf.puc-rio.br> Date: Thu, 22 Oct 2009 09:55:08 -0500 Message-ID: <90eb1dc70910220755y47af7a72jd002e6c569158f86@mail.gmail.com> Subject: Re: Behaviour of 'set' From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 22, 2009 at 6:26 AM, Luiz Henrique de Figueiredo wrote: >> The behaviour I'm after would instead create a new key/value in the >> inner scope if it didn't exist there already. > > Evaluate scripts in their own empty environment that have __index to the > outer one. So you can read values from the outer scope but write only > in the inner one. note that that's exactly what module(name,seeall) does -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 15:08:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MH7r9j018683; Thu, 22 Oct 2009 15:07:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C23E318A61; Thu, 22 Oct 2009 15:06:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C9B4188AE for ; Thu, 22 Oct 2009 15:06:26 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9MH7C7K009247 for ; Thu, 22 Oct 2009 15:07:14 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id CF97F54C07E; Thu, 22 Oct 2009 15:07:12 -0200 (BRST) Date: Thu, 22 Oct 2009 15:07:12 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: LPEG vs. PCRE (was: Can someone convert this POSIX regex to a Lua regex?) Message-ID: <20091022170712.GA12610@inf.puc-rio.br> References: <5ba75e2f0910212103j79bb45cer3d0fb46d8915d4f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On 22/10/2009 06:03, Fernando P. García wrote: >> Based on your experience, may you tell me why LPEG is better than PCRE? > > It might be arguable for simple patterns like checking a date format > (without checking the validity of the date!) or looking that a string has > no spaces, for example. > But for real parsing (using context and such), a parser (Peg based or > something else) is always better than a RE engine... :-) Even for regular languages, LPEG may be better than PCRE. As an extreme example, we have email addresses as defined in RFC 822. There is a real Perl module that validates such addresses using a regular expression that starts like this: (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:( ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ and goes on for a total of 75 lines like those. (Mail::RFC822::Address: regexp-based address validation) In LPEG we may describe the same pattern with the following syntax: p = re.compile[[ address <- / group <- ":" [#mailbox] ";" mailbox <- / route_addr <- "<" ? ">" route <- (("@" ) (","+ "@" )*) ":" addr_spec <- "@" local_part <- ("." )* domain <- ("." )* sub_domain <- / domain_ref <- domain_literal <- "[" ([^][] / "\" .)* "]" phrase <- (","+ )* word <- / atom <- [^] %c()<>@,;:\".[]+ quoted_string <- '"' ([^"\%nl] / "\" .)* '"' ]] Note that the above syntax defines a regular language (no recursive rules). -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 17:53:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MJr8a7000895; Thu, 22 Oct 2009 17:53:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB7FB192A2; Thu, 22 Oct 2009 17:51:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36B2518B06 for ; Thu, 22 Oct 2009 17:51:35 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 040CAB4FDF for ; Thu, 22 Oct 2009 15:52:22 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 22 Oct 2009 15:52:20 -0400 X-Sasl-enc: D6AB00Jiy9dszC8hyCaA0GZb+Czmcfg9K8Q+ryGp8MuF 1256241141 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id DF0BDBB3A for ; Thu, 22 Oct 2009 15:52:20 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Luarocks Snow Leopard and MacPorts bug? Date: Fri, 23 Oct 2009 08:51:46 +1300 References: <8752B753-DBD1-439E-9BEC-13A705F1B05E@fastmail.fm> To: Lua list Message-Id: Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Sorry to post a luarocks issue to the lua list, but I sent this to luarocks last night, and it hasn't shown up anywhere. Is luarocks a subscriber-only list? Is it a remnant of the luaforge meltdown, or are some of you seeing this for the second time - in which case, please excuse me. I just upgraded MacPorts OS X 10.6 and decided to get luarocks 2.0. So Lua is from macports and in /opt/local and luarocks seemed happy to install itself in /usr/local. But then I get an error, I'm afraid I'm not sure where to go from here (and it told me to mail you!) bender:~ geoff$ luarocks search lfs Error: LuaRocks 2.0 bug (please report at luarocks-developers@lists.luaforge.net ). /usr/local/share/lua/5.1//luarocks/fs/unix/tools.lua:241: attempt to index global 'dir' (a nil value) stack traceback: /usr/local/share/lua/5.1//luarocks/fs/unix/tools.lua:241: in function 'download' /usr/local/share/lua/5.1//luarocks/fetch.lua:33: in function 'fetch_url' /usr/local/share/lua/5.1//luarocks/fetch.lua:70: in function 'fetch_url_at_temp_dir' /usr/local/share/lua/5.1//luarocks/manif.lua:95: in function 'load_manifest' /usr/local/share/lua/5.1//luarocks/search.lua:174: in function 'manifest_search' /usr/local/share/lua/5.1//luarocks/search.lua:203: in function 'search_repos' /usr/local/share/lua/5.1//luarocks/search.lua:375: in function (tail call): ? [C]: in function 'xpcall' /usr/local/share/lua/5.1//luarocks/command_line.lua:126: in function 'run_command' /usr/local/bin/luarocks:21: in main chunk [C]: ? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 18:04:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MK4MqS005062; Thu, 22 Oct 2009 18:04:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D4DD192F7; Thu, 22 Oct 2009 18:03:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5E26192E8 for ; Thu, 22 Oct 2009 18:02:51 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id C3F8AB5580 for ; Thu, 22 Oct 2009 16:03:40 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 22 Oct 2009 16:03:38 -0400 X-Sasl-enc: B5SUkm3kO1Gkt1bk8Ghb551vkT/y5vYWYUIXQGk2bIAN 1256241820 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id 15235BCA9 for ; Thu, 22 Oct 2009 16:03:39 -0400 (EDT) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Enhanced tostring Date: Fri, 23 Oct 2009 09:03:07 +1300 Message-Id: To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Rima has an "enhanced" tostring that I've called repr (I pinched the name from python, but I don't really know much about python's repr). It's the same as tostring (so there's a corresponding __repr) except that it takes a second format argument. The format is a table of, well, format information, whatever suits you really. I use it to keep a default number format and control how I output rima objects (prettily or a as a tree dump, and one day it might support ouput in LaTeX or in re-readable lua). Because the format argument is optional, setting a metatable's __tostring to its __repr works just fine. Is there any general interest in such a thing? It's really not a big bit of code, but if it was of interest it'd be nice if it was standardised in some sense. One problem repr presents is that now you have to handle outputting a range of possible objects in a range of possible formats - there are objectsxformats options. Should each object's repr be smart enough to handle all formats? Should format tables be smart enough to handle all objects? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 18:07:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MK7X7M005823; Thu, 22 Oct 2009 18:07:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8311019317; Thu, 22 Oct 2009 18:06:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9FDE192EE for ; Thu, 22 Oct 2009 18:06:09 -0200 (BRST) Received: by fxm12 with SMTP id 12so9880745fxm.5 for ; Thu, 22 Oct 2009 13:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=UCVqRExlgTQYuOZ6PH7QNpXoozmQ/UdYpg3BM9Hl/FQ=; b=c3BivKFV/m1DmjQtSgTcJElDnGbp16dSplkajLSd2VxBFnhJ6X1D8DRli9n56TD7N7 DtY+HdFyH2sgCve3M0yKTSd8/16+xBKsa1HSB4IFGC1IJB19NL6jZoV5vWT0oYgxe/Xz xc4GbMlh9XGDBavwWi1+uqWYOWrp4R4uDv6cs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=CqQZ0WrmW/Ieyu5iTSfWAMa/tKTd3KQUfr3xzbRIIqFO7NhPnLEsaAqRodlfyenayk Jm9fUQ/AeZX/bPT9gIf9dW41GS/rrEvkwuqKbHqiitV/IjCjmb2rFZWtlscuMrfAcyvq 07Cpeu1xz9mpScvA9bXj/CDy1qjj0ykQ0KZA0= MIME-Version: 1.0 Received: by 10.204.7.197 with SMTP id e5mr8268986bke.184.1256242018193; Thu, 22 Oct 2009 13:06:58 -0700 (PDT) In-Reply-To: References: <8752B753-DBD1-439E-9BEC-13A705F1B05E@fastmail.fm> From: Hisham Date: Thu, 22 Oct 2009 18:06:38 -0200 Message-ID: <5e7d91620910221306v634ccc88u2fbb277d882074ff@mail.gmail.com> Subject: Re: Luarocks Snow Leopard and MacPorts bug? To: Lua list Content-Type: text/plain; charset=UTF-8 Cc: LuaRocks developers list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9MK7X7M005823 On Thu, Oct 22, 2009 at 5:51 PM, Geoff Leyland wrote: > Hi, > > Sorry to post a luarocks issue to the lua list, but I sent this to luarocks > last night, and it hasn't shown up anywhere.  Is luarocks a subscriber-only > list?  Is it a remnant of the luaforge meltdown, or are some of you seeing > this for the second time - in which case, please excuse me. The mailman page for the luarocks-developers list at luaforge currently shows me an error message, so yes, it may be down (I'm cc'ing the list anyway, to check). > I just upgraded MacPorts OS X 10.6 and decided to get luarocks 2.0.  So Lua > is from macports and in /opt/local and luarocks seemed happy to install > itself in /usr/local. > > But then I get an error, I'm afraid I'm not sure where to go from here (and > it told me to mail you!) Thanks for the report -- this has already been detected and it's fixed in svn. I'm preparing a 2.0.1 release for today or tomorrow, fixing this and other issues that have been reported since the release. -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 18:15:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MKF3Jn007281; Thu, 22 Oct 2009 18:15:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62727192FB; Thu, 22 Oct 2009 18:13:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 442F318EF2 for ; Thu, 22 Oct 2009 18:13:38 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8CB7CB2D83 for ; Thu, 22 Oct 2009 16:14:27 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 22 Oct 2009 16:14:28 -0400 X-Sasl-enc: x4SSEEtbisry7TUGloMahrR8udhq0GdcMCLb2EIDM9+R 1256242466 Received: from [10.1.1.4] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id 66FEC2C662 for ; Thu, 22 Oct 2009 16:14:26 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Luarocks Snow Leopard and MacPorts bug? From: Geoff Leyland In-Reply-To: <5e7d91620910221306v634ccc88u2fbb277d882074ff@mail.gmail.com> Date: Fri, 23 Oct 2009 09:13:53 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <8752B753-DBD1-439E-9BEC-13A705F1B05E@fastmail.fm> <5e7d91620910221306v634ccc88u2fbb277d882074ff@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23/10/2009, at 9:06 AM, Hisham wrote: > On Thu, Oct 22, 2009 at 5:51 PM, Geoff Leyland > wrote: >> Hi, >> >> Sorry to post a luarocks issue to the lua list, but I sent this to >> luarocks >> last night, and it hasn't shown up anywhere. Is luarocks a >> subscriber-only >> list? Is it a remnant of the luaforge meltdown, or are some of you >> seeing >> this for the second time - in which case, please excuse me. > > The mailman page for the luarocks-developers list at luaforge > currently shows me an error message, so yes, it may be down (I'm > cc'ing the list anyway, to check). > >> I just upgraded MacPorts OS X 10.6 and decided to get luarocks >> 2.0. So Lua >> is from macports and in /opt/local and luarocks seemed happy to >> install >> itself in /usr/local. >> >> But then I get an error, I'm afraid I'm not sure where to go from >> here (and >> it told me to mail you!) > > Thanks for the report -- this has already been detected and it's fixed > in svn. I'm preparing a 2.0.1 release for today or tomorrow, fixing > this and other issues that have been reported since the release. Thanks Hisham, I'll grab the new release when it comes! From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 21:02:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MN2khE000707; Thu, 22 Oct 2009 21:02:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 962D61A685; Thu, 22 Oct 2009 21:01:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B762B321B3 for ; Thu, 22 Oct 2009 21:01:16 -0200 (BRST) Received: by ewy26 with SMTP id 26so8665320ewy.5 for ; Thu, 22 Oct 2009 16:02:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.209 with SMTP id c59mr1695411wef.181.1256252524567; Thu, 22 Oct 2009 16:02:04 -0700 (PDT) From: Chris Gagnon Date: Thu, 22 Oct 2009 16:01:44 -0700 Message-ID: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> Subject: Creating userdata interfaces To: Lua list Content-Type: multipart/alternative; boundary=0016e6dab056799d6f04768e15cf X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6dab056799d6f04768e15cf Content-Type: text/plain; charset=ISO-8859-1 I must be making this harder then it is but I'm not sure how to lay it out. I have this: luaL_newmetatable(L, "Vector"); lua_pushliteral(L, "__index"); lua_pushcfunction(L, LuaVectorGet); lua_settable(L, -3); lua_pushliteral(L, "__newindex"); lua_pushcfunction(L, LuaVectorSet); lua_settable(L, -3); lua_newtable(L); int nFuncIndex = lua_gettop(L); lua_pushvalue(L, nFuncIndex); lua_setfield(L, LUA_GLOBALSINDEX, msc_pType); lua_newtable(L); int mt = lua_gettop(L); lua_pushliteral(L, "__call"); lua_pushcfunction(L, LuaNew); lua_pushliteral(L, "new"); lua_pushvalue(L, -2); // duplicate LuaNew lua_settable(L, nFuncIndex); lua_settable(L, mt); lua_setmetatable(L, nFuncIndex); lua_pop(L, 2); User data created like so: float * fUserData = (float *)lua_newuserdata(L, 4 * sizeof(float)); luaL_getmetatable(L, "Vector"); lua_setmetatable(L, -2); return fUserData; This gives me the interface: local v = Vector.new(1,1,1) local vec = Vector(1,1,2) local x = vec.x the problem is when i want a Length() function if i switch the __index block to: lua_pushliteral(L, "__index"); lua_newtable(L); lua_pushliteral(L, "Length"); lua_pushcfunction(L, LuaLength); lua_settable(L, -3); lua_pushliteral(L, "__index"); lua_pushcfunction(L, LuaGet); lua_settable(L, -3); lua_pushvalue(L,-1); lua_setmetatable(L, -2); lua_settable(L, nMetatableIndex); i now get the interface: vec:Length() however the vec.x interface is broken since the __index gets the table on the stack not my userdata. Hopefully that was clear, i appreciate any comments/ help on a fix for this or on better ways to build what I'm trying to do. -Chris --0016e6dab056799d6f04768e15cf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I must be making this harder then it is but I'm not sure how to lay it = out.

I have this:

luaL_newmetatable(L, "Vector");
lua_pushliteral(L, "__index");
lua_pushcfunction(L, LuaV= ectorGet);
lua_settable(L, -3);

lua_pushliteral(L, "__newindex");
= lua_pushcfunction(L, LuaVectorSet);
lua_settable(L, -3);

lua_newt= able(L);
int nFuncIndex =3D lua_gettop(L);

lua_pushvalue(L, nFunc= Index);
lua_setfield(L, LUA_GLOBALSINDEX, msc_pType);

lua_newtable(L);
in= t mt =3D lua_gettop(L);
lua_pushliteral(L, "__call");
lua_p= ushcfunction(L, LuaNew);
lua_pushliteral(L, "new");
lua_pus= hvalue(L, -2);=A0=A0=A0=A0 // duplicate LuaNew
lua_settable(L, nFuncIndex);
lua_settable(L, mt);
lua_setmetatable(L,= nFuncIndex);
lua_pop(L, 2);

User data created like so:
float = * fUserData =3D (float *)lua_newuserdata(L, 4 * sizeof(float));
luaL_get= metatable(L, "Vector");
lua_setmetatable(L, -2);
return fUserData;

This gives me the inte= rface:
local v =3D Vector.new(1,1,1)
local vec =3D Vector(1,1,2)
l= ocal x =3D vec.x

the problem is when i want a Length() function
<= br> if i switch the __index block to:

lua_pushliteral(L, "__index&q= uot;);
lua_newtable(L);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_pushliteral= (L, "Length");
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_pushcfunction= (L, LuaLength);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_settable(L, -3);

=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_pushliteral(L, "__index");<= br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_pushcfunction(L, LuaGet);
=A0=A0=A0= =A0=A0=A0 =A0=A0=A0 lua_settable(L, -3);

=A0=A0=A0 =A0=A0=A0 =A0=A0= =A0 lua_pushvalue(L,-1);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 lua_setmetatable(= L, -2);
lua_settable(L, nMetatableIndex);

i now get the interface:
vec:Le= ngth()

however the vec.x interface is broken since the __index gets = the table on the stack not my userdata.

Hopefully that was clear, i = appreciate any comments/ help on a fix for this or on better ways to build = what I'm trying to do.

-Chris


=A0
--0016e6dab056799d6f04768e15cf-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 21:10:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MNAL0D001373; Thu, 22 Oct 2009 21:10:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12E7C1A689; Thu, 22 Oct 2009 21:09:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A937321B3 for ; Thu, 22 Oct 2009 21:09:06 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1808797eye.39 for ; Thu, 22 Oct 2009 16:09:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.6.8 with SMTP id 8mr5238187ebf.41.1256252994324; Thu, 22 Oct 2009 16:09:54 -0700 (PDT) In-Reply-To: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> References: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> Date: Thu, 22 Oct 2009 18:09:54 -0500 Message-ID: <90eb1dc70910221609l6bd9f110x5d6df9e4aeb3eec7@mail.gmail.com> Subject: Re: Creating userdata interfaces From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 22, 2009 at 6:01 PM, Chris Gagnon wrote: > I must be making this harder then it is but I'm not sure how to lay it out. check luaL_register() -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 21:18:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MNIRJx002360; Thu, 22 Oct 2009 21:18:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF9071A68E; Thu, 22 Oct 2009 21:17:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2123A1A680 for ; Thu, 22 Oct 2009 21:17:05 -0200 (BRST) Received: by fxm12 with SMTP id 12so10052446fxm.5 for ; Thu, 22 Oct 2009 16:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=rrbJMdLmAgtaR1fbsNcdNVRHigaZ4LlQee/mrZJK5lY=; b=AIPWQKaNozxpRoM/0fQ5O9KVWVVrwo6o9R/phDO5ymxvrClTQqjyKeiMqo56TuooDO Ifjiwnsti1LQDUG3+9sk+6FK9cWijScTQUGHZlDvCveyhzn+Z8eQa9gOpy761nJPXNJb xFvfabsyJsLGbg0yClrXX8W32P4LCJUOtmMj8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=PrzDB6nZ1lAMCwV4hLphcRKbPyXCO9aIL44AwaUzutqCEGx4wSwWLB7KyDOVbQEwvI UeKcRAeqJEfUjZkxW0XSAQfVpyYzUP5eXGOhSabFewjrXsewajVu2fbO81aMKNbyIXsg E5aE0Ls2LV+3rVddtnw/RjPVtLzauWLHHjkjQ= MIME-Version: 1.0 Received: by 10.223.143.12 with SMTP id s12mr320655fau.30.1256253471795; Thu, 22 Oct 2009 16:17:51 -0700 (PDT) Date: Fri, 23 Oct 2009 01:17:51 +0200 Message-ID: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> Subject: Running the test suite on Windows From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=0023545bd590ef29d104768e4d35 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545bd590ef29d104768e4d35 Content-Type: text/plain; charset=ISO-8859-1 Is the lua test suite from http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz expected to work on Windows? Any special configuration required? Thanks! Uri Cohen --0023545bd590ef29d104768e4d35 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Is the lua test suite from http://www.inf.puc-rio.br/~roberto/= lua/lua5.1-tests.tar.gz expected to work on Windows?
Any special con= figuration required?

Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen
--0023545bd590ef29d104768e4d35-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 21:33:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9MNX1Xl004236; Thu, 22 Oct 2009 21:33:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E0D41A68F; Thu, 22 Oct 2009 21:31:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1798A321B3 for ; Thu, 22 Oct 2009 21:31:24 -0200 (BRST) Received: by fxm12 with SMTP id 12so10061380fxm.5 for ; Thu, 22 Oct 2009 16:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=TNhhqP34N4ZMO5W4uRNc7HXNzoD7xaxzBQ/ZZwDJpLo=; b=t8Kg5grvzYDCaBz3eVQ2F9rbfTW9aKZP9rgvXtueAkqc66v+FhaBTK69BIGfiHpPgt +6WfUZK+6N8HHTxVyB0S7P3dLn+ckhGZo9HodmpILzLfbPcim5SFkdyyg0V86GJQ3JR6 smoydKTt7U6ads/PfAf/f9INY8AsfUZF91sZc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=t3oGFQAMAZ01ShpJrvOQGf0QpANuNTSBGdlY/7ryNo18Fdz58PO5Y+4N4lnJHjbfg7 jiU+m9fPaib6UOWwN5wXp8Ypj2Ceusz22crZchdFXReVRVF7B+uJ6Q17RHUVavKxTmDB +0ZJgsCvG3ghom0n8K5oKYyzLm9207gg5ACd8= MIME-Version: 1.0 Received: by 10.239.139.89 with SMTP id s25mr899498hbs.113.1256254332123; Thu, 22 Oct 2009 16:32:12 -0700 (PDT) In-Reply-To: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> References: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Thu, 22 Oct 2009 21:31:52 -0200 Message-ID: Subject: Re: Running the test suite on Windows To: Lua list Content-Type: multipart/alternative; boundary=001485f6cd8c36bcbf04768e81d3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f6cd8c36bcbf04768e81d3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Lots of free memory. :-) Lu=EDs Eduardo Jason Santos On Thu, Oct 22, 2009 at 9:17 PM, uri cohen wrote: > Is the lua test suite from > http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz expected to > work on Windows? > Any special configuration required? > > Thanks! > Uri Cohen > --001485f6cd8c36bcbf04768e81d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Lots of free memory. :-)

Lu=EDs Eduardo Jason Santos<= br>

On Thu, Oct 22, 2009 at 9:17 PM, uri coh= en <uri.cohen@g= mail.com> wrote:
Is the lua test suite from http://www.inf.pu= c-rio.br/~roberto/lua/lua5.1-tests.tar.gz expected to work on Windows?<= br> Any special configuration required?

Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen

--001485f6cd8c36bcbf04768e81d3-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 22:02:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N02B2T007653; Thu, 22 Oct 2009 22:02:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8FAD321B3; Thu, 22 Oct 2009 22:00:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 122431886D for ; Thu, 22 Oct 2009 22:00:50 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N01dae007621 for ; Thu, 22 Oct 2009 22:01:39 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9N01cb06895; Thu, 22 Oct 2009 22:01:38 -0200 Date: Thu, 22 Oct 2009 22:01:38 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Creating userdata interfaces Message-ID: <20091022220138.A6882@lua.tecgraf.puc-rio.br> References: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com>; from cgagnon@zindagigames.com on Thu, Oct 22, 2009 at 04:01:44PM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I must be making this harder then it is but I'm not sure how to lay it out. See my lv3: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.0/lv3.tar.gz (Don't be mislead by the URL; the code works in Lua 5.1, though you may need to edit the Makefile.) From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 23:08:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N186wu014850; Thu, 22 Oct 2009 23:08:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7824E192F2; Thu, 22 Oct 2009 23:06:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27181192E8 for ; Thu, 22 Oct 2009 23:06:36 -0200 (BRST) Received: by iwn8 with SMTP id 8so4541672iwn.33 for ; Thu, 22 Oct 2009 18:07:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.122.208 with SMTP id m16mr12156282ibr.16.1256260044376; Thu, 22 Oct 2009 18:07:24 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Oct 2009 21:07:24 -0400 X-Google-Sender-Auth: d3063a030cf3520f Message-ID: Subject: Re: Enhanced tostring From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 22, 2009 at 4:03 PM, Geoff Leyland wrote: > Rima has an "enhanced" tostring that I've called repr (I pinched the name > from python, but I don't really know much about python's repr). > > It's the same as tostring (so there's a corresponding __repr) except that it > takes a second format argument. That is [1,2]. I once posted, though have since removed, an idea like that on the wiki [3]. Could someone remind me why Lua stringifies an object o by way of getmetatable(o).__tostring(o) rather than o:__tostring()? Is it because the latter is syntactic sugar for indexing operations o.__tostring(o) and o["__tostring"](o) so this would lead to ambiguities if o represents a hashtable with an indexing operator that queries by key? The __methindex proposal [4,5], would probably resolve that since it allows differentiating an object's method namespace from its field namespace so that o:__tostring() can be assigned different behavior from o.__tostring(o). The lack of this difference, I suspect, is in part why Lua introduces it's own additional namespace (metamethods), thereby replacing o.__tostring(o) with a similarly fashioned getmetatable(o).__tostring(o), just without the same ":"-like syntactic sugar for doing that, but rather with operators and wrapper functions like tostring. The metamethod concept is absent in many other languages, e.g. Python [6], but many of those languages differentiate field and method namespaces. Is this the reason that metamethods exist in Lua? If we were to introduce a serialization API (e.g. repr), would we make the operation a method or metamethod? [1] http://docs.python.org/library/functions.html#repr [2] http://docs.python.org/library/functions.html#str [3] http://web.archive.org/web/20080101100134/lua-users.org/wiki/GeneralizedTostring [4] http://www.lua.org/wshop06/Silverstone.pdf [5] http://lua-users.org/lists/lua-l/2009-06/msg00394.html [6] http://docs.python.org/reference/datamodel.html#special-method-names From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 23:20:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N1JvBD016107; Thu, 22 Oct 2009 23:19:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 833A818858; Thu, 22 Oct 2009 23:18:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A857C1882C for ; Thu, 22 Oct 2009 23:18:40 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N1JSuT016023 for ; Thu, 22 Oct 2009 23:19:28 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9N1JSG07271; Thu, 22 Oct 2009 23:19:28 -0200 Date: Thu, 22 Oct 2009 23:19:27 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Enhanced tostring Message-ID: <20091022231927.A7263@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Thu, Oct 22, 2009 at 09:07:24PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Could someone remind me why Lua stringifies an object o by way of > getmetatable(o).__tostring(o) rather than o:__tostring()? In my libraries and probably many others, the two expressions are equivalent. From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 23:30:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N1U7PM017082; Thu, 22 Oct 2009 23:30:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CFC81A67C; Thu, 22 Oct 2009 23:28:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 934D81A667 for ; Thu, 22 Oct 2009 23:28:45 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 217C7B564A for ; Thu, 22 Oct 2009 21:29:34 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 22 Oct 2009 21:29:34 -0400 X-Sasl-enc: 8z0P9pEtn3VIYOOZuBb/AEG1F3lfsUVZIlb5iwpYqIQs 1256261373 Received: from [192.168.1.106] (unknown [121.98.132.26]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0B4D22C85B for ; Thu, 22 Oct 2009 21:29:32 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Enhanced tostring From: Geoff Leyland In-Reply-To: Date: Fri, 23 Oct 2009 14:29:29 +1300 Content-Transfer-Encoding: 7bit Message-Id: <3FF23C08-0B00-4CB3-A4B5-C0503720493F@fastmail.fm> References: To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23/10/2009, at 2:07 PM, David Manura wrote: > On Thu, Oct 22, 2009 at 4:03 PM, Geoff Leyland wrote: >> Rima has an "enhanced" tostring that I've called repr (I pinched >> the name >> from python, but I don't really know much about python's repr). >> >> It's the same as tostring (so there's a corresponding __repr) >> except that it >> takes a second format argument. > > That is [1,2]. Python's repr doesn't seem to have a format object? > I once posted, though have since removed, an idea like > that on the wiki [3]. Why did you remove it? I think the hard part of such an undertaking would be to get some agreement on what the format object might contain. > Could someone remind me why Lua stringifies an object o by way of > getmetatable(o).__tostring(o) rather than o:__tostring()? Is it > because the latter is syntactic sugar for indexing operations > o.__tostring(o) and o["__tostring"](o) so this would lead to > ambiguities if o represents a hashtable with an indexing operator that > queries by key? Certainly for me. Rima uses proxy objects that save indexing operations for later, so they have no fields of their own (they want to catch ALL __index and __newindex events), they do have a metatable (with the appropriate __index and __newindex) and the metatable has a __tostring and __repr. These objects can certainly be 'tostring'ed, but o:__tostring() and o.__tostring(o) won't work, they'll just get remembered. > The __methindex proposal [4,5], would probably > resolve that since it allows differentiating an object's method > namespace from its field namespace so that o:__tostring() can be > assigned different behavior from o.__tostring(o). As it stands, this would work, but I wouldn't rule out Rima wanting to record method calls in the future. > The lack of this > difference, I suspect, is in part why Lua introduces it's own > additional namespace (metamethods), thereby replacing o.__tostring(o) > with a similarly fashioned getmetatable(o).__tostring(o), just without > the same ":"-like syntactic sugar for doing that, but rather with > operators and wrapper functions like tostring. The metamethod concept > is absent in many other languages, e.g. Python [6], but many of those > languages differentiate field and method namespaces. Is this the > reason that metamethods exist in Lua? It's certainly one reason why Lua's different, but I'm not sure that there's a good argument for which is better. Personally, I like metamethods and the simplicity of how Lua handles 'objects', but that's just me. > If we were to introduce a serialization API (e.g. repr), would we make > the operation a method or metamethod? I vote metamethod. I'd note that Rima's repr might have the wrong name - it's not about serialisation (though I s'pose it could be) Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Oct 22 23:56:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N1uTwX019797; Thu, 22 Oct 2009 23:56:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3716D187D3; Thu, 22 Oct 2009 23:55:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f184.google.com (mail-vw0-f184.google.com [209.85.212.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93DE11877F for ; Thu, 22 Oct 2009 23:55:09 -0200 (BRST) Received: by vws14 with SMTP id 14so120422vws.33 for ; Thu, 22 Oct 2009 18:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=sZyiF+lXZVB8qYely7Yiph7B2/qGg9JUh0RdbYKScCI=; b=MKkd7S549MDSLB7eMTlMEGJvMJ0KU5ZEqbBYr49wfNKTWx+6ro9ASXqRJoTibgRDUm D1uF5z33n7YxS6dSN+Q66MBY+03RloOnJGViT7rsHpDec458n04Ydo9sdUCg176mLVCu f66g6mRNA1I+nGsH0X7r7I/Ph0d9KN1K6gZg4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=i3iSWl0KaanM0cj+EUtKc45SX+WV0Gkglhyubz+VewXI3cTZWRiLu6dkj2IrIv4Kw5 5vFNQ4peBrb3MrK8Pdo9PV3XvShbFmNoue4yCMJsX/YDyYHQSh0luHqEmImhMCcwe2Wq +9fgPcnakOxoyCnW+jRbAFaBKvv8Zl+N/7HQY= MIME-Version: 1.0 Received: by 10.220.88.220 with SMTP id b28mr5407873vcm.35.1256262956871; Thu, 22 Oct 2009 18:55:56 -0700 (PDT) Date: Fri, 23 Oct 2009 09:55:56 +0800 Message-ID: Subject: comment error about OP_VARARG in lopcodes.h From: VirusCamp To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I'm working on luadec, but got confused about OP_VARARG in lua-5.1.4. I think the comment is wrong, that should be R(A), R(A+1), ..., R(A+B-2) = vararg lopcodes.h line 210 OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ lvm.c line 751 case OP_VARARG: { int b = GETARG_B(i) - 1; .......... for (j = 0; j < b; j++) { From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 00:39:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N2dmPJ024870; Fri, 23 Oct 2009 00:39:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85DD71A692; Fri, 23 Oct 2009 00:38:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id C076C1A67F for ; Fri, 23 Oct 2009 00:38:28 -0200 (BRST) Received: (qmail invoked by alias); 23 Oct 2009 02:39:16 -0000 Received: from p5B012912.dip0.t-ipconnect.de (EHLO dialup) [91.1.41.18] by mail.gmx.net (mp059) with SMTP; 23 Oct 2009 04:39:16 +0200 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX19PfaVeQ1ZPSSyykLKOxf70kl5ggjs/lYQLEn7oN2 GGfSEDP4nG/Q8r Date: Fri, 23 Oct 2009 04:39:14 +0200 From: Edgar Toernig To: Lua list Subject: Re: Enhanced tostring Message-Id: <20091023043914.03dcdf9c.froese@gmx.de> In-Reply-To: <20091022231927.A7263@lua.tecgraf.puc-rio.br> References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > > > Could someone remind me why Lua stringifies an object o by way of > > getmetatable(o).__tostring(o) rather than o:__tostring()? > > In my libraries and probably many others, the two expressions are equivalent. Yeah, but should they? At the moment "o" is a table and you add arbitrary elements to it everything falls apart. Just look at the recent thread "Tracking number of pairs in a dictionary" [1]. One suggestion was: function make_LimitedTable(limit) [...] return setmetatable({}, ) end > t = make_LimitedTable(2) > t:add('a',{}) > t:add('b',{}) Guess what happens on t:add('add',{}) And this was not the first time I saw this broken usage. IMO it's time to drop the "colon is only syntactic sugar" dogma. Ciao, ET. [1] http://lua-users.org/lists/lua-l/2009-10/msg00007.html From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 03:03:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N53BHO004730; Fri, 23 Oct 2009 03:03:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 891061A696; Fri, 23 Oct 2009 03:01:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D1F91A68B for ; Fri, 23 Oct 2009 03:01:48 -0200 (BRST) Received: by iwn8 with SMTP id 8so4627982iwn.33 for ; Thu, 22 Oct 2009 22:02:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.121.69 with SMTP id g5mr2247150ibr.44.1256274157431; Thu, 22 Oct 2009 22:02:37 -0700 (PDT) In-Reply-To: <20091023043914.03dcdf9c.froese@gmx.de> References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> <20091023043914.03dcdf9c.froese@gmx.de> Date: Fri, 23 Oct 2009 01:02:37 -0400 X-Google-Sender-Auth: d797b4f8bccac415 Message-ID: Subject: Re: Enhanced tostring From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9N53BHO004730 On Thu, Oct 22, 2009 at 10:39 PM, Edgar Toernig wrote: > At the moment "o" is a table and you add > arbitrary elements to it everything falls apart.... >    t:add('add',{}) True, the current Lua design implies that an object implemented as a table cannot store arbitrary keys directly inside itself because this can interfere with method calls. That might also be solved with the __getindex/__setindex proposal [1], so that "add" would be looked up first in the metatable rather than the table itself. (I wondered if this behavior could instead be changed with a special table __mode rather than adding new metamethods.) [1] http://lua-users.org/lists/lua-l/2004-06/msg00478.html On Thu, Oct 22, 2009 at 9:29 PM, Geoff Leyland wrote: > Python's repr doesn't seem to have a format object? Nope. >> I once posted, though have since removed, an idea like >> that on the wiki [3]. > Why did you remove it? I didn't have a much of an opinion of whether this was a useful approach, and there was an objection that tostring should not confuse debugging and serialization. Unlike your suggestion, this redefined tostring rather than create a separate metamethod. > These objects can certainly be 'tostring'ed, but o:__tostring() and > o.__tostring(o) won't work, they'll just get remembered. If I understand correctly, your __index could could keys prefixed by "__". From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 03:29:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N5TXVV006852; Fri, 23 Oct 2009 03:29:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7E521A69C; Fri, 23 Oct 2009 03:28:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BBAA1A694 for ; Fri, 23 Oct 2009 03:28:19 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1Ci3-00083k-5X for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 07:29:07 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 07:29:07 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 07:29:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: FastCGI daemon Date: Thu, 22 Oct 2009 22:28:24 -0700 Lines: 16 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello all, I was recently looking at different ways to switch our web application written in Lua from apache to nginx (we are currently using mod_wombat *in production* to earn a living). One night, I started with the FastCGI devkit threaded.c example, and after a bit'o'hackin started to see some promising results. It is multi-threaded and very lightweight, with Lua VM states that persist between HTTP requests. So I tossed it up on http://github.com/STPeters/luafcgid and now I have come to the point where I will be building the interface (API?) from Lua land back to the worker thread. I was going to just build a mod_wombat compatible one, but then thought I would ask here - just in case anyone else was interested in one day using this abomination. WSAPI comes to mind as a potential target... From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 03:43:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N5hVQ3008118; Fri, 23 Oct 2009 03:43:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7079B1897E; Fri, 23 Oct 2009 03:42:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tilde.org (mail.tilde.org [209.177.145.230]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7FEB1894D for ; Fri, 23 Oct 2009 03:42:13 -0200 (BRST) Received: from [192.168.0.7] ([138.89.63.52]) (authenticated user ml@iridescent.org) by mail.tilde.org (Kerio MailServer 6.4.1 patch 1) for lua@bazar2.conectiva.com.br; Thu, 22 Oct 2009 22:42:52 -0700 Mime-Version: 1.0 Message-Id: Date: Fri, 23 Oct 2009 01:42:26 -0400 To: lua@bazar2.conectiva.com.br From: "Lawrence E. Bakst" Subject: Better way to code an iterator function? Content-Type: text/plain; charset="us-ascii" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 1. Is there a better, shorter, cuter, or cooler way to code the example below? 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. 3. This is probably FAQ, but I couldn't find much with a quick search on Google. I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. Thanks in advance for all help and suggestions. function it_paths(paths) local function next(state, var) if (state.idx > #paths) then return nil end; state.idx = state.idx + 1; return paths[state.idx - 1]; end local state = {idx = 1}; return next, state, ""; end; function process_random_files(paths) for path in it_paths(paths) do print(path); end end process_random_files{"foo", "bar", "baz", "quuz"}; -- leb@iridescent.org From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 04:29:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N6TBc8014850; Fri, 23 Oct 2009 04:29:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0D9F1928C; Fri, 23 Oct 2009 04:28:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2CA69191D9 for ; Fri, 23 Oct 2009 04:27:49 -0200 (BRST) Received: by fxm12 with SMTP id 12so10250802fxm.5 for ; Thu, 22 Oct 2009 23:28:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.148.78 with SMTP id o14mr10591133bkv.83.1256279317818; Thu, 22 Oct 2009 23:28:37 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 08:28:37 +0200 X-Google-Sender-Auth: 45afe5512e7b8b69 Message-ID: Subject: Re: FastCGI daemon From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 7:28 AM, Stefan wrote: > Hello all, I was recently looking at different ways to switch our web > application written in Lua from apache to nginx (we are currently using > mod_wombat *in production* to earn a living). I wouldn't use mod_wombat in production at the moment, it can be vulnerable to DoS attack because the size of the request body that is read is not limited and could fill the memory. It should use apreq2 instead of trying to do request parsing by itself. And there is no easy way to limit and control how server resources are used (max execution time, memory limit, ...). For nginx, it is possible to use spawn-fcgid with Lua, wsapi and fastcgi. I haven't tested this setup in production yet but it looks promising. > One night, I started with the FastCGI devkit threaded.c example, and after a > bit'o'hackin started to see some promising results. It is multi-threaded and > very lightweight, with Lua VM states that persist between HTTP requests. > > So I tossed it up on http://github.com/STPeters/luafcgid and now I have come > to the point where I will be building the interface (API?) from Lua land > back to the worker thread. I was going to just build a mod_wombat compatible > one, but then thought I would ask here - just in case anyone else was > interested in one day using this abomination. The performance seems very good, especially compared to mod_wombat. > WSAPI comes to mind as a potential target... In my opinion, WSAPI would be the way to go. I think it is better if you don't force the use of handler functions like in mod_wombat. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 04:38:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N6cgNw015593; Fri, 23 Oct 2009 04:38:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3210192D5; Fri, 23 Oct 2009 04:37:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0F51192A1 for ; Fri, 23 Oct 2009 04:37:26 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id BC1C0170C510 for ; Fri, 23 Oct 2009 02:38:15 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9N6cF0c005433 for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 02:38:15 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Fri, 23 Oct 2009 02:38:15 -0400 From: Sean Conner To: Lua list Subject: Re: Better way to code an iterator function? Message-ID: <20091023063815.GB19762@brevard.conman.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Lawrence E. Bakst once stated: > 1. Is there a better, shorter, cuter, or cooler way to code the example below? > > 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. > > 3. This is probably FAQ, but I couldn't find much with a quick search on Google. > > I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. > > Thanks in advance for all help and suggestions. > > function it_paths(paths) > local function next(state, var) > if (state.idx > #paths) then return nil end; > state.idx = state.idx + 1; > return paths[state.idx - 1]; > end > local state = {idx = 1}; > return next, state, ""; > end; > > function process_random_files(paths) > for path in it_paths(paths) do > print(path); > end > end > > process_random_files{"foo", "bar", "baz", "quuz"}; What's wrong with: function process_random_files(paths) for i=1,#paths do print(paths[i]) end end Or am I missing something? -spc From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 05:09:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N79MK8018223; Fri, 23 Oct 2009 05:09:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5CDF192A6; Fri, 23 Oct 2009 05:08:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B836191E8 for ; Fri, 23 Oct 2009 05:07:58 -0200 (BRST) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id ERF96840 for ; Fri, 23 Oct 2009 18:08:40 +1100 Message-ID: <4AE15678.3040002@infinite-interactive.com> Date: Fri, 23 Oct 2009 18:08:40 +1100 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Better way to code an iterator function? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Are you trying to avoid backtracking the index or keeping its previous value? How about this: function it_paths(paths) local function next(state, var) local result result, state.idx = paths[state.idx], state.idx+1 return result end local state = {idx = 1 }; return next, state, ""; end; Mark Feldman Lawrence E. Bakst wrote: > 1. Is there a better, shorter, cuter, or cooler way to code the example below? > > 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. > > 3. This is probably FAQ, but I couldn't find much with a quick search on Google. > > I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. > > Thanks in advance for all help and suggestions. > > function it_paths(paths) > local function next(state, var) > if (state.idx > #paths) then return nil end; > state.idx = state.idx + 1; > return paths[state.idx - 1]; > end > local state = {idx = 1}; > return next, state, ""; > end; > > function process_random_files(paths) > for path in it_paths(paths) do > print(path); > end > end > > process_random_files{"foo", "bar", "baz", "quuz"}; > > This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 06:38:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N8cP45024814; Fri, 23 Oct 2009 06:38:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 923EB1A660; Fri, 23 Oct 2009 06:37:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from buran.ubisoft.fr (buran.ubisoft.fr [195.22.144.40]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E57D1A5A9 for ; Fri, 23 Oct 2009 06:37:02 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by buran.ubisoft.fr (Postfix) with ESMTP id 7D5FEB7A31 for ; Fri, 23 Oct 2009 10:37:50 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at ubisoft.fr Received: from buran.ubisoft.fr ([127.0.0.1]) by localhost (buran.ubisoft.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id arzCzstP53VI for ; Fri, 23 Oct 2009 10:37:13 +0200 (CEST) Received: by buran.ubisoft.fr (Postfix, from userid 500) id A0166B77C5; Fri, 23 Oct 2009 10:37:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on buran.ubisoft.fr X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=UNWANTED_LANGUAGE_BODY autolearn=unavailable version=3.2.5 Received: from pdc-mail-hub01.ubisoft.org (pdc-mail-hub01 [194.169.249.120]) by buran.ubisoft.fr (Postfix) with ESMTP id 819F1B7776 for ; Fri, 23 Oct 2009 10:37:08 +0200 (CEST) Received: from PDC-MAIL-CMS01.ubisoft.org ([fe80::2cf5:9572:e559:65e8]) by pdc-mail-hub01.ubisoft.org ([fe80::d586:5776:ca6b:841f%13]) with mapi; Fri, 23 Oct 2009 10:37:08 +0200 From: Benoit Germain To: Lua list Date: Fri, 23 Oct 2009 10:37:06 +0200 Subject: RE: Enhanced tostring Thread-Topic: Enhanced tostring Thread-Index: AcpTfvtOdQrqY+SxT4S/RO3E5H09lwAOrA5A Message-ID: References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> In-Reply-To: <20091022231927.A7263@lua.tecgraf.puc-rio.br> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: fr-FR, en-US Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9N8cP45024814 What if the object wants to protect the metatable from public access, like this? meta = { __metatable = false, __tostring = function(o) return "hello " .. o.name end } o = {} setmetatable(o, meta) o.name = "bob" print( o) -- yields "hello bob" o.name = "mick" print( getmetatable(o).__tostring(o)) -- causes "attempt to index a boolean value" o.name = "ted" print( o:__tostring()) -- causes "attempt to call method '__tostring' (a nil value)" -----Message d'origine----- De : lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] De la part de Luiz Henrique de Figueiredo Envoyé : vendredi 23 octobre 2009 03:19 À : Lua list Objet : Re: Enhanced tostring > Could someone remind me why Lua stringifies an object o by way of > getmetatable(o).__tostring(o) rather than o:__tostring()? In my libraries and probably many others, the two expressions are equivalent. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 06:46:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N8kp8C025939; Fri, 23 Oct 2009 06:46:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69C0E183B0; Fri, 23 Oct 2009 06:45:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9D64183A5 for ; Fri, 23 Oct 2009 06:45:37 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id C59EBB5EF8 for ; Fri, 23 Oct 2009 04:46:20 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 23 Oct 2009 04:46:18 -0400 X-Sasl-enc: DXb8oPDB5KAROaQLNWBxfMYbRCq8jQpCtU+CsTYlojt5 1256287487 Received: from [10.1.1.3] (222-152-22-42.jetstream.xtra.co.nz [222.152.22.42]) by mail.messagingengine.com (Postfix) with ESMTPSA id CE4662CA0F for ; Fri, 23 Oct 2009 04:44:46 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Enhanced tostring From: Geoff Leyland In-Reply-To: Date: Fri, 23 Oct 2009 21:44:12 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> <20091023043914.03dcdf9c.froese@gmx.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23/10/2009, at 6:02 PM, David Manura wrote: > On Thu, Oct 22, 2009 at 9:29 PM, Geoff Leyland wrote: >> These objects can certainly be 'tostring'ed, but o:__tostring() and >> o.__tostring(o) won't work, they'll just get remembered. > > If I understand correctly, your __index could could keys prefixed by > "__". I think you meant "could ignore"? Yep, that'd work, but wouldn't that be creating yet another namespace? From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 06:51:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N8pLxJ026259; Fri, 23 Oct 2009 06:51:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EB291A666; Fri, 23 Oct 2009 06:50:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tilde.org (mail.tilde.org [209.177.145.230]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDBBB1A663 for ; Fri, 23 Oct 2009 06:50:06 -0200 (BRST) Received: from [192.168.0.7] ([138.89.63.52]) (authenticated user ml@iridescent.org) by mail.tilde.org (Kerio MailServer 6.4.1 patch 1) for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 01:50:46 -0700 Mime-Version: 1.0 Message-Id: In-Reply-To: <20091023063815.GB19762@brevard.conman.org> References: <20091023063815.GB19762@brevard.conman.org> Date: Fri, 23 Oct 2009 03:30:37 -0400 To: Lua list From: "Lawrence E. Bakst" Subject: Re: Better way to code an iterator function? Content-Type: text/plain; charset="us-ascii" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks, It's example code to keep the email short and simple. I understand I could have done it the way you described. I wanted to learn how to write an iterator. I am an experienced C and Lisp/Scheme programmer. Best, leb At 2:38 AM -0400 10/23/09, Sean Conner wrote: >It was thus said that the Great Lawrence E. Bakst once stated: >> 1. Is there a better, shorter, cuter, or cooler way to code the example below? >> >> 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. >> >> 3. This is probably FAQ, but I couldn't find much with a quick search on Google. >> >> I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. >> >> Thanks in advance for all help and suggestions. >> >> function it_paths(paths) >> local function next(state, var) >> if (state.idx > #paths) then return nil end; >> state.idx = state.idx + 1; >> return paths[state.idx - 1]; >> end >> local state = {idx = 1}; >> return next, state, ""; >> end; >> >> function process_random_files(paths) >> for path in it_paths(paths) do >> print(path); >> end >> end >> >> process_random_files{"foo", "bar", "baz", "quuz"}; > > What's wrong with: > > function process_random_files(paths) > for i=1,#paths do > print(paths[i]) > end > end > > Or am I missing something? > > -spc -- leb@iridescent.org From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 06:51:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N8pmmf026335; Fri, 23 Oct 2009 06:51:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 119E91A689; Fri, 23 Oct 2009 06:50:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tilde.org (mail.tilde.org [209.177.145.230]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BB351A666 for ; Fri, 23 Oct 2009 06:50:08 -0200 (BRST) Received: from [192.168.0.7] ([138.89.63.52]) (authenticated user ml@iridescent.org) by mail.tilde.org (Kerio MailServer 6.4.1 patch 1) for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 01:50:48 -0700 Mime-Version: 1.0 Message-Id: In-Reply-To: <4AE15678.3040002@infinite-interactive.com> References: <4AE15678.3040002@infinite-interactive.com> Date: Fri, 23 Oct 2009 04:07:04 -0400 To: Lua list From: "Lawrence E. Bakst" Subject: Re: Better way to code an iterator function? Content-Type: text/plain; charset="us-ascii" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Backtracking the index was one of the things that was bugging me. I think I like your code better, although it's the same number of lines and adds a local variable. Thanks. leb >function it_paths(paths) > local function next(state, var) > local result > result, state.idx = paths[state.idx], state.idx+1 > return result > end > local state = {idx = 1 }; > return next, state, ""; >end; At 6:08 PM +1100 10/23/09, Mark Feldman wrote: >Are you trying to avoid backtracking the index or keeping its previous value? How about this: > >function it_paths(paths) > local function next(state, var) > local result > result, state.idx = paths[state.idx], state.idx+1 > return result > end > local state = {idx = 1 }; > return next, state, ""; >end; > >Mark Feldman > >Lawrence E. Bakst wrote: >>1. Is there a better, shorter, cuter, or cooler way to code the example below? >> >>2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. >> >>3. This is probably FAQ, but I couldn't find much with a quick search on Google. >> >>I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. >> >>Thanks in advance for all help and suggestions. >> >>function it_paths(paths) >> local function next(state, var) >> if (state.idx > #paths) then return nil end; >> state.idx = state.idx + 1; >> return paths[state.idx - 1]; >> end >> local state = {idx = 1}; >> return next, state, ""; >>end; >> >>function process_random_files(paths) >> for path in it_paths(paths) do >> print(path); >> end >>end >> >>process_random_files{"foo", "bar", "baz", "quuz"}; >> >> > > >This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. -- leb@iridescent.org From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 07:30:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N9U2j4029570; Fri, 23 Oct 2009 07:30:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E52718814; Fri, 23 Oct 2009 07:28:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED47B183B0 for ; Fri, 23 Oct 2009 07:28:42 -0200 (BRST) Received: by ewy26 with SMTP id 26so9004972ewy.5 for ; Fri, 23 Oct 2009 02:29:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.146.10 with SMTP id y10mr303483ebn.32.1256290171030; Fri, 23 Oct 2009 02:29:31 -0700 (PDT) Date: Fri, 23 Oct 2009 11:29:31 +0200 X-Google-Sender-Auth: 553f3d4a0da397dc Message-ID: Subject: [ANN] lua-TestMore 0.2.0 From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9N9U2j4029570 I am pleased to announce the first official release of lua-TestMore. lua-TestMore is an Unit Testing Framework. It is a port of the Perl5 module Test::More. It uses the Test Anything Protocol as output, that allows a compatibility with the Perl QA ecosystem. It's an extensible framework. The first extension lua-TestLongString is already available (http://testlongstring.luaforge.net/). It allows a simple and efficient way to write tests (without OO style). Some tests could be marked as TODO or skipped. Errors could be fully checked with error_like(). It supplies a Test Suite for Lua itself. The homepage is at http://testmore.luaforge.net/, and the sources are hosted at http://github.com/fperrad/lua-TestMore/. Rockspecs are available on http://github.com/fperrad/lua-TestMore/tree/master/rockspec/ François. NB: currently, the site http://testmore.luaforge.net/ and http://testlongstring.luaforge.net/ are out of date, and I can't update them (since the LuaForge crash). From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 07:52:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9N9qLLW031437; Fri, 23 Oct 2009 07:52:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 328D318E5B; Fri, 23 Oct 2009 07:51:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9B27183A9 for ; Fri, 23 Oct 2009 07:51:04 -0200 (BRST) Received: by qyk4 with SMTP id 4so6661015qyk.33 for ; Fri, 23 Oct 2009 02:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=ak4t9LUuHih0r+VePmEoPXAWjeibmbBA5jd8IRKcZG0=; b=Q2FdDLHkxeRjp3UeWvzKENj6SJ0ANMosnrp0HpCVKbemBXYGjNv+CEJYTKkmuuvYff BgeeWa0f7WIuxgCGCL2vsHYMGiOHLY39cALsUDhfVbxFyKP/ZCSiuTVu18E+MefOYaWR sb8RLgme6tzBFc3YSrWFPdjKGl0zuI5Ouht+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=gxU/mKWbMfFVVJoG4CEsfyMhnPY3R51U4CVPCINGHCBUlbglN40otsgRE97O1+d2hq cgYUauE8EzUFZS4JEIHpx1n7GCsDQ1TYUO/49Vkint8SUJrl/oJ93CKM2zboB7dsAOPu BXDHNmiNRvkr50lEV+jbu6tM4lQ9SW33esKTY= Received: by 10.224.118.140 with SMTP id v12mr5257048qaq.360.1256291513983; Fri, 23 Oct 2009 02:51:53 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.57.203]) by mx.google.com with ESMTPS id 4sm7724708qwe.7.2009.10.23.02.51.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 02:51:53 -0700 (PDT) Message-ID: <4AE17CAF.5090005@gmail.com> Date: Fri, 23 Oct 2009 17:51:43 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: comment error about OP_VARARG in lopcodes.h References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean VirusCamp wrote: > I'm working on luadec, but got confused about OP_VARARG in lua-5.1.4. > I think the comment is wrong, that should be R(A), R(A+1), ..., > R(A+B-2) = vararg > > lopcodes.h line 210 > OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ > > > lvm.c line 751 > case OP_VARARG: { > int b = GETARG_B(i) - 1; > .......... > for (j = 0; j < b; j++) { Nothing wrong there. You can plug in some numbers in order to 'see' the indices and ranges better. GETARG_B(i)'s zero value is taken by multiple return mode, since b is -1 when GETARG_B(i) == 0 and -1 is LUA_MULTRET in the test. When GETARG_B(i) is 1, b = 0 and the loop iterates once only, for one value. So, A+B-1 = A+1-1 = A. I think perhaps you have confused b with B in the comments. B is GETARG_B(i). -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 08:13:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NADkNW001232; Fri, 23 Oct 2009 08:13:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F3F21902A; Fri, 23 Oct 2009 08:12:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F2E818FD6 for ; Fri, 23 Oct 2009 08:12:27 -0200 (BRST) Received: by ewy26 with SMTP id 26so9036556ewy.5 for ; Fri, 23 Oct 2009 03:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=++6+V32jffqLDZcsI5OtZ0tUNGmQ2H4/qOEh0owGkPQ=; b=wik0DOw0GAs8zrWGHsw2bvqHRNWIisaold93sFauYJiL80EBQ7u2+BAcOYBfwguydQ EADomMFVELIHyQ3+2EcAMLg0qoxWoI22yjoGV8gQrKyK+1U9bvZN2F9QhzGmLeacCU0/ QPLa65u0QQUhqHRrbtQcBHCVocFS/QWpV0XRY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=DqFJw4tcrlQ/Ey49uEhx5OOnUTNiTdnvhBVVhNIbIMiF+85JUkEyGPmVe7wlo/NDCx jETYD+/MOF5pXkWp+Fj2OI7w6O1nkVkZr4eWdnB+abJyDYrkMYrs3AurDdSDY3xa8LhE M4WAx73kMcq9dhbSSIIcvUEZOmDdPogMWfsi4= MIME-Version: 1.0 Received: by 10.216.90.76 with SMTP id d54mr2644533wef.55.1256292796120; Fri, 23 Oct 2009 03:13:16 -0700 (PDT) In-Reply-To: References: From: Jerome Vuarand Date: Fri, 23 Oct 2009 12:12:56 +0200 Message-ID: <89d273ba0910230312r5c38f081oc02fef5350ee0f4d@mail.gmail.com> Subject: Re: Better way to code an iterator function? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/23 Lawrence E. Bakst : > 1. Is there a better, shorter, cuter, or cooler way to code the example below? > > [...] > > function it_paths(paths) > local function next(state, var) > if (state.idx > #paths) then return nil end; > state.idx = state.idx + 1; > return paths[state.idx - 1]; > end > local state = {idx = 1}; > return next, state, ""; > end; > > function process_random_files(paths) > for path in it_paths(paths) do > print(path); > end > end > > process_random_files{"foo", "bar", "baz", "quuz"}; I don't know if it's cuter or cooler, but with an upvalue to store the state it's shorter : function it_paths(paths) local index = 0 return function() index = index + 1 return paths[index] end end From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 08:18:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NAIYir001667; Fri, 23 Oct 2009 08:18:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDCBA190D1; Fri, 23 Oct 2009 08:17:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46A901908D for ; Fri, 23 Oct 2009 08:17:19 -0200 (BRST) Received: by fxm12 with SMTP id 12so10410157fxm.5 for ; Fri, 23 Oct 2009 03:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=d6uXi4Tk/xLkk8zGmI08n4+rClP2ZzDN7iDIx5sSdKA=; b=fJIxvymIyoTZonH6m46O4uNIIg46hlqpjVOLsyneXrMfZR1skNKCPnbqlMukXnXPpd R992kCFE2xEkBWJ7pKClZFxnbd5qATsdw6wQhyjjryQYTp552Tq7gE6pICG2Qbm2b5MI rDHW4Q501x8l7MGqo0bsTAX92Xy2cob4ILXJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P9r/GZ5vrw+ZfbRzH4wxha8vhbjCfLBx4gVcxbCLa+gCOpo0H3cCDDHugnQ56+XmFD gd2jPEYWc8b+qo8wXC1HVFZnt0K6s6pyNT2PVNbeBsO895AucNFAlBS1P/KANnuZ3Jij YdZ2VeHZub7y51pcSCPnOvplAIyf1WV/PC3oY= MIME-Version: 1.0 Received: by 10.223.15.11 with SMTP id i11mr2108637faa.105.1256293087767; Fri, 23 Oct 2009 03:18:07 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2009 11:18:07 +0100 Message-ID: Subject: Re: Better way to code an iterator function? From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NAIYir001667 On Fri, Oct 23, 2009 at 6:42 AM, Lawrence E. Bakst wrote: > 1. Is there a better, shorter, cuter, or cooler way to code the example below? > > 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. > > 3. This is probably FAQ, but I couldn't find much with a quick search on Google. > > I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. Right, it isn't possible in standard Lua. > function it_paths(paths) >    local function next(state, var) >        if (state.idx > #paths) then return nil end; >        state.idx = state.idx + 1; >        return paths[state.idx - 1]; >    end >    local state = {idx = 1}; >    return next, state, ""; > end; > > function process_random_files(paths) >    for path in it_paths(paths) do >        print(path); >    end > end > > process_random_files{"foo", "bar", "baz", "quuz"}; It seems to me that what you want is to -either- use a dedicated local function, like this: -- example 1 local function it_paths_aux(state) local idx = state.idx + 1 state.idx = idx return state.paths[idx] end function it_paths(paths) return it_paths_aux, {paths=paths, idx=0} end -- end example 1 ...or if don't mind generating a closure each time, using an upvalue to store the current state: -- example 2 function it_paths(paths) local idx = 0 return function() idx = idx + 1 return paths[idx] end end -- end example 2 -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 08:28:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NASIBu002719; Fri, 23 Oct 2009 08:28:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D82719180; Fri, 23 Oct 2009 08:27:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 53D3E18D78 for ; Fri, 23 Oct 2009 08:26:53 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so150708fgg.17 for ; Fri, 23 Oct 2009 03:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=tRCF+OzDHV1ieaX0LWVrVugna+d8gJ0nWbfwBHcXgfE=; b=LWMMeWgJYBuzyZWqhxhhkZKFEejO67Y8r/cOBK8jkxfnaYT/MxI6iRpzMC/PnwnmxW j1AGLnwNJWE1K/yq9kP0h+pSWBbfYcirQXfRA2mkeIr18o2vJXZqWex0pEF6GoDUGJ0P h9t5mGauf6Hv2uGAxSvLpsuptOMQ9KMawc9zk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Yt/Y1LIzoKkdlx4T+jZlhZcTTlSMZEwo5PbmSrnnsMcoI3XX2ZSW6DY5Ff4+nO2fmR CGzb7Up3ciwEhnP8xJusVfrvYxbACiNQPktpoZ01iTCj7aORrXV/gGavtoU0BuTUp3hw 2UUn/Jzi9OypRoqOXk77Bpb5TwXEHQz9yDzxo= MIME-Version: 1.0 Received: by 10.87.64.6 with SMTP id r6mr16765fgk.48.1256293662658; Fri, 23 Oct 2009 03:27:42 -0700 (PDT) Date: Fri, 23 Oct 2009 12:27:42 +0200 Message-ID: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> Subject: Literal string strangeness From: Chris de Villiers To: lua Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all I am struggling with the long format for specifying literal strings in programs. Here is my program: ------------------------------------ s = [[a bc]] print(string.byte(s, 1, string.len(s))) ------------------------------------ Unfortunately I am loosing a carriage return in the string. Here is a hexdump of the code to clarify: 7320 3d20 5b5b 610a 620d 635d 5d0a 0a70 s = [[a.b.c]]..p 7269 6e74 2873 7472 696e 672e 6279 7465 rint(string.byte 2873 2c20 312c 2073 7472 696e 672e 6c65 (s, 1, string.le 6e28 7329 2929 0a0a n(s))).. You will notice there is a newline between the "a" and "b", and a carriage return between the "b" and "c". Here is the output as interpreted by the standard Lua interpreter: 97 10 98 10 99 I would have expected a 13 in place of the second 10. Any ideas? I am using Lua 5.1.4 on linux. Thanx! -- chris de villiers From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 08:47:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NAlL1H004946; Fri, 23 Oct 2009 08:47:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3F361A663; Fri, 23 Oct 2009 08:46:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CF671A660 for ; Fri, 23 Oct 2009 08:45:59 -0200 (BRST) Received: by ewy26 with SMTP id 26so9060639ewy.5 for ; Fri, 23 Oct 2009 03:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=N1kZKhikeqXg3fOu2aftP+9CRXYh6ss31r+H0VHPHKk=; b=JHuyf/kHIt/gYZEYZAd7hg5tN6XCl6nGydbMxelZjnhvlG4rDqfnQGM1u1GOJWikIM qsikcfkWydUBCZGxhKe2c5QrRKy/886wcBII8AHoKQ6H9EdphPCzJaHMLmkiO8JrZDJz 94Kjbq3O/yyKaobnlXbLfVIboBAvh2vT9ISNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=UYhhECv9w3GTj30gQjeGIecCtz/5CKbKK6ElGBB9Kv2nbot7nzmvs4YqDSIGtfIQ+2 izv5RqnNDfwFyM3ChNXttu5o9ETBqMuwdY1ZeFRsLRwQYiBULaxPowTbtl7W2lQBwhbw 5JIKFqvMZlcqIa9zi2NslpRB1Em8Nk5bCqAqc= MIME-Version: 1.0 Received: by 10.216.85.5 with SMTP id t5mr3775468wee.142.1256294808111; Fri, 23 Oct 2009 03:46:48 -0700 (PDT) In-Reply-To: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> From: Jerome Vuarand Date: Fri, 23 Oct 2009 12:46:28 +0200 Message-ID: <89d273ba0910230346m6eb8958w292ff6014c12cfed@mail.gmail.com> Subject: Re: Literal string strangeness To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/23 Chris de Villiers : > I am struggling with the long format for specifying literal strings in > programs. Here is my program: > > ------------------------------------ > s = [[a > bc]] > > print(string.byte(s, 1, string.len(s))) > ------------------------------------ > > Unfortunately I am loosing a carriage return in the string. Here is a > hexdump of the code to clarify: > > 7320 3d20 5b5b 610a 620d 635d 5d0a 0a70 s = [[a.b.c]]..p > 7269 6e74 2873 7472 696e 672e 6279 7465 rint(string.byte > 2873 2c20 312c 2073 7472 696e 672e 6c65 (s, 1, string.le > 6e28 7329 2929 0a0a n(s))).. > > You will notice there is a newline between the "a" and "b", and a > carriage return between the "b" and "c". Here is the output as > interpreted by the standard Lua interpreter: > > 97 10 98 10 99 > > I would have expected a 13 in place of the second 10. Any ideas? > I am using Lua 5.1.4 on linux. Thanx! I don't know what exactly happens, but here is a test I did (on Windows, but I think OS is irrelevant) : s = "a\nb\rc" print(string.byte(s, 1, string.len(s))) > 97 10 98 13 99 loadstring("s = [[a\nb\rc]]")() print(string.byte(s, 1, string.len(s))) > 97 10 98 10 99 It seems the compiler doesn't preserve end of lines in long strings, but rather force them to \n. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 08:51:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NApsgB006014; Fri, 23 Oct 2009 08:51:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE9811A68B; Fri, 23 Oct 2009 08:50:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E8531A662 for ; Fri, 23 Oct 2009 08:50:41 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so3575823fgg.17 for ; Fri, 23 Oct 2009 03:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qbFKqbKAlb4CHtRIO6yb7HLxb7zrTW/PEbp5rwvYEZQ=; b=k7x+h6oHecs9R2+QuUX+6E/j8kjCoqAzDLvKRi5f2BN7S0OiiGncRPAUjeE8mL21Zj OqmzvNI9ZA+u6F9cIODjK46pgXtxSN6IjWJ3BuWLI65MMVDOs4d32WRO1fMiDOtWWuN+ go0k9ZdNSSGjnVOo6mOBVh7cyXsgFVVwNQA68= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EaDvfrtXMrdX61kXd1/IpHRj1a8nXUWf8Kkuyaj0I5yPZNIDrxzfyFONRY4QAH3rCv lkhFmhh7O7NlylPqHVvDjM8Ena3GWUYUREhDyfI/Wf3DDjJSDiH8/RU6Jr89Ciy1yu1R rETyQo/ggCk+gdnCyUqz/gPTF96VU7/b5n62M= MIME-Version: 1.0 Received: by 10.103.122.5 with SMTP id z5mr4582179mum.11.1256295089507; Fri, 23 Oct 2009 03:51:29 -0700 (PDT) In-Reply-To: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> Date: Fri, 23 Oct 2009 12:51:29 +0200 Message-ID: Subject: Re: Literal string strangeness From: Mauro Iazzi To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NApsgB006014 > I would have expected a 13 in place of the second 10.  Any ideas? > I am using Lua 5.1.4 on linux.  Thanx! It is deliberate, see llex.c lines 257-263. I cannot find any mention in the manual ( assuming it would be in http://www.lua.org/manual/5.1/manual.html#2.1) mauro From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:12:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBCNXl008520; Fri, 23 Oct 2009 09:12:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46C0F1A690; Fri, 23 Oct 2009 09:11:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCEC61A667 for ; Fri, 23 Oct 2009 09:11:05 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBBssh008487 for ; Fri, 23 Oct 2009 09:11:54 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9NBBsf08889; Fri, 23 Oct 2009 09:11:54 -0200 Date: Fri, 23 Oct 2009 09:11:53 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Enhanced tostring Message-ID: <20091023091153.A8862@lua.tecgraf.puc-rio.br> References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from bgermain@ubisoft.fr on Fri, Oct 23, 2009 at 10:37:06AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > What if the object wants to protect the metatable from public access, like this? It still works for me. require"bc" bc.digits(20) x=bc.sqrt(2) print(getmetatable(x)) print(x) print(x:tostring()) print(x:__tostring()) getmetatable(x).__metatable=false print(getmetatable(x)) print(x) print(x:tostring()) print(x:__tostring()) From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:15:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBFUZW008961; Fri, 23 Oct 2009 09:15:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 469641A695; Fri, 23 Oct 2009 09:14:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 071DB1A667 for ; Fri, 23 Oct 2009 09:14:15 -0200 (BRST) Received: by ewy26 with SMTP id 26so9081393ewy.5 for ; Fri, 23 Oct 2009 04:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=umiQiDi/IGKoR1XsoPCQSe1mKz+cT2y55EZiQrO1zBw=; b=DDRQCedy65JRsLgwcIZ2dr7g8aNWy+9b4YAQmKbFOJ2YxprPbTJbF63Sargin1cZWz 0/kKu5KvYzd0z3dbxiWmIYopm7hisT6/xAmhwl7Y+eNdSt10UtUn6bzY2qvDXUZbsg6l wXZnbIl53ho4b11kMDDp9pireLwfXsMjfQBNY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bWll2Oe6EvnuzSZ+AnF1Ue5rqtEcBbFtYIT0C6TmtRUSYPDWx78hzXsJlu3nHSjYSt /Z79T+jWfSQlBiWLjunULf8Nrz6IpGRRT5/ldpYefG4NlJPAhJMCzKLCOvVT8PWFDWqb bzbaHi/F+yOCM2uyKViVnfHAmoxm/K5DNFaaw= MIME-Version: 1.0 Received: by 10.216.89.194 with SMTP id c44mr3755917wef.199.1256296504809; Fri, 23 Oct 2009 04:15:04 -0700 (PDT) In-Reply-To: References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> Date: Fri, 23 Oct 2009 13:15:04 +0200 Message-ID: <6dfff91b0910230415r467199d2pb343a7391787b347@mail.gmail.com> Subject: Re: Literal string strangeness From: Dirk Feytons To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NBFUZW008961 On Fri, Oct 23, 2009 at 12:51 PM, Mauro Iazzi wrote: >> I would have expected a 13 in place of the second 10.  Any ideas? >> I am using Lua 5.1.4 on linux.  Thanx! > > It is deliberate, see llex.c lines 257-263. I cannot find any mention > in the manual ( assuming it would be in > http://www.lua.org/manual/5.1/manual.html#2.1) It is mentioned there: "For convenience, when the opening long bracket is immediately followed by a newline, the newline is not included in the string." -- Dirk From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:22:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBMEx0009837; Fri, 23 Oct 2009 09:22:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F8E11A6A1; Fri, 23 Oct 2009 09:20:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF5781A694 for ; Fri, 23 Oct 2009 09:20:48 -0200 (BRST) Received: by bwz27 with SMTP id 27so831915bwz.21 for ; Fri, 23 Oct 2009 04:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=UJY/CoZhT/EqocVOlxIzr0DXdD3fJW1K07pf4df9pR8=; b=ikvZciJuF5VIw2fL9yz/P+Hoi9FRKuULEpopqInxTGiKCnLUDiaA3weDuar7q8vCJ6 ovC3QVKBXxi1okyoF6Aub9V9DTtI/4drBcKHYwlJV9hXuKypoQcWAzOdOy9KEwRxU+pp PNl0cuU0R3jF2zFPuWs74QfKkQx9dkBEKgAsM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=N8X44QwPYd65sY6MYnXLwZ7T5wIHv6eqcXmd8iXsdiesx4ycKCqOq7ddKDN2yU+G3o jfrja4YW5upLmSc5fnbUpdoEqhYIrlW81fiBXVffslsv71gdFP2akjHOfTycAJvk8cvs 8xn7CebnDZPjkbLiP61HgSHinXYUu2uF+o4fc= MIME-Version: 1.0 Received: by 10.204.34.73 with SMTP id k9mr1380328bkd.45.1256296895932; Fri, 23 Oct 2009 04:21:35 -0700 (PDT) In-Reply-To: <6dfff91b0910230415r467199d2pb343a7391787b347@mail.gmail.com> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> <6dfff91b0910230415r467199d2pb343a7391787b347@mail.gmail.com> From: Matthew Wild Date: Fri, 23 Oct 2009 12:21:15 +0100 Message-ID: <4db9cacb0910230421x164743ccp7225407e373ce77f@mail.gmail.com> Subject: Re: Literal string strangeness To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NBMEx0009837 2009/10/23 Dirk Feytons : > On Fri, Oct 23, 2009 at 12:51 PM, Mauro Iazzi wrote: >>> I would have expected a 13 in place of the second 10.  Any ideas? >>> I am using Lua 5.1.4 on linux.  Thanx! >> >> It is deliberate, see llex.c lines 257-263. I cannot find any mention >> in the manual ( assuming it would be in >> http://www.lua.org/manual/5.1/manual.html#2.1) > > It is mentioned there: "For convenience, when the opening long bracket > is immediately followed by a newline, the newline is not included in > the string." > No, this is different. It is to do with Lua's "handling" of CRLF line endings I believe. I feel this is wrong in strings, especially long strings, and have been hit by it before (fair enough, I /was/ trying to embed binary data inside a script). Matthew From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:24:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBNwqH010063; Fri, 23 Oct 2009 09:23:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 387951A6A5; Fri, 23 Oct 2009 09:22:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C0271A694 for ; Fri, 23 Oct 2009 09:22:40 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBNT9d010047 for ; Fri, 23 Oct 2009 09:23:29 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9NBNTi08931; Fri, 23 Oct 2009 09:23:29 -0200 Date: Fri, 23 Oct 2009 09:23:28 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Enhanced tostring Message-ID: <20091023092328.A8915@lua.tecgraf.puc-rio.br> References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from bgermain@ubisoft.fr on Fri, Oct 23, 2009 at 10:37:06AM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > meta = > { > __metatable = false, > __tostring = function(o) return "hello " .. o.name end > } > > o = {} > setmetatable(o, meta) > o.name = "bob" > print( o) -- yields "hello bob" > o.name = "mick" > print( getmetatable(o).__tostring(o)) -- causes "attempt to index a boolean value" getmetatable(o) returns false and so the message is expected. > print( o:__tostring()) -- causes "attempt to call method '__tostring' (a nil value)" o does not have a __tostring method and so the message is expected. Try adding this meta.__index = meta The __tostring method is used by "tostring" and so print(o) works even if the metatable is proteced. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:28:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBSdMc010722; Fri, 23 Oct 2009 09:28:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 047881A6A8; Fri, 23 Oct 2009 09:27:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C37F1A6A3 for ; Fri, 23 Oct 2009 09:27:18 -0200 (BRST) Received: by fxm12 with SMTP id 12so10469148fxm.5 for ; Fri, 23 Oct 2009 04:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=El/SN9x977BAdxxUv5DXVU/TvwHWHTg5V3Y5+PH0Z+Y=; b=hBa399TljpINYEIE81bL8R7oU/LrQ7a8X7xgIW+JZjsBpkFRmfD7UEb2/nwC7hX5pl 7ogwszIhXwruntfnSB7EVKDAd6Ik52PeukbZIWQRqpkwUUpTljm0E+Jaur7eM/pdibHB iyLEtLjBBvD+taamK55f610Pts4LC35PjtQPc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=V70wlJs4Y6lW+X+CzXFm9XWTRb89aXtuE/Tzz+5MfZb1iDzJDjBDv0tEwu2DLa9LnA 5aDJrea63z4RBTZik3j7RMYo+mD5+oun3oGVWvBH7WP2wl/4S4gXt4lV7ksK7+rPT7v7 sPS/glKTfJEVMPxnSJz/nD16KT40io432+s/M= MIME-Version: 1.0 Received: by 10.223.161.212 with SMTP id s20mr35147fax.2.1256297287285; Fri, 23 Oct 2009 04:28:07 -0700 (PDT) In-Reply-To: <4db9cacb0910230421x164743ccp7225407e373ce77f@mail.gmail.com> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> <6dfff91b0910230415r467199d2pb343a7391787b347@mail.gmail.com> <4db9cacb0910230421x164743ccp7225407e373ce77f@mail.gmail.com> From: Jim Whitehead II Date: Fri, 23 Oct 2009 12:27:47 +0100 Message-ID: <5fe281d40910230427v697bd837qf55c85ca48b1a8a5@mail.gmail.com> Subject: Re: Literal string strangeness To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NBSdMc010722 On Fri, Oct 23, 2009 at 12:21 PM, Matthew Wild wrote: > > 2009/10/23 Dirk Feytons : > > On Fri, Oct 23, 2009 at 12:51 PM, Mauro Iazzi wrote: > >>> I would have expected a 13 in place of the second 10.  Any ideas? > >>> I am using Lua 5.1.4 on linux.  Thanx! > >> > >> It is deliberate, see llex.c lines 257-263. I cannot find any mention > >> in the manual ( assuming it would be in > >> http://www.lua.org/manual/5.1/manual.html#2.1) > > > > It is mentioned there: "For convenience, when the opening long bracket > > is immediately followed by a newline, the newline is not included in > > the string." > > > > No, this is different. It is to do with Lua's "handling" of CRLF line > endings I believe. I feel this is wrong in strings, especially long > strings, and have been hit by it before (fair enough, I /was/ trying > to embed binary data inside a script). The correct passage from the refman: Literals in this bracketed form can run for several lines, do not interpret any escape sequences, and ignore long brackets of any other level. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:31:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBVMQc011223; Fri, 23 Oct 2009 09:31:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 064741A6AB; Fri, 23 Oct 2009 09:30:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C9881A6A3 for ; Fri, 23 Oct 2009 09:30:05 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9NBUsgH022864 for ; Fri, 23 Oct 2009 09:30:54 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id EAC2954C07E; Fri, 23 Oct 2009 09:30:54 -0200 (BRST) Date: Fri, 23 Oct 2009 09:30:54 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Literal string strangeness Message-ID: <20091023113054.GB17349@inf.puc-rio.br> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > I would have expected a 13 in place of the second 10.  Any ideas? > > I am using Lua 5.1.4 on linux.  Thanx! > > It is deliberate, see llex.c lines 257-263. I cannot find any mention > in the manual ( assuming it would be in > http://www.lua.org/manual/5.1/manual.html#2.1) > > mauro Long strings should be used for text. If you want to embedded control characters (anything that needs "a hexdump of the code to clarify"), you should use a regular string with escapes. We will clarify this in the manual (without an hexdump ;). -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 09:36:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NBab31011861; Fri, 23 Oct 2009 09:36:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB4501A6AF; Fri, 23 Oct 2009 09:35:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 467631A6A6 for ; Fri, 23 Oct 2009 09:35:18 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9NBa7lf023296 for ; Fri, 23 Oct 2009 09:36:07 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 7662154C07E; Fri, 23 Oct 2009 09:36:08 -0200 (BRST) Date: Fri, 23 Oct 2009 09:36:08 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: comment error about OP_VARARG in lopcodes.h Message-ID: <20091023113608.GC17349@inf.puc-rio.br> References: <4AE17CAF.5090005@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AE17CAF.5090005@gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> [...] >> .......... >> for (j = 0; j < b; j++) { > > [...] > > When GETARG_B(i) is 1, b = 0 and the loop iterates once only, for one > value. So, A+B-1 = A+1-1 = A. Is that right? It seems that when b = 0 the loop does not iterate at all (as 0 < 0 is false). -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 10:11:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NCBF1I017361; Fri, 23 Oct 2009 10:11:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 890081A69F; Fri, 23 Oct 2009 10:09:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from buran.ubisoft.fr (buran.ubisoft.fr [195.22.144.40]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60F7B1A5DE for ; Fri, 23 Oct 2009 10:09:47 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by buran.ubisoft.fr (Postfix) with ESMTP id B747EB7932 for ; Fri, 23 Oct 2009 14:10:33 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at ubisoft.fr Received: from buran.ubisoft.fr ([127.0.0.1]) by localhost (buran.ubisoft.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6nrnqI6Byt2M for ; Fri, 23 Oct 2009 14:10:14 +0200 (CEST) Received: by buran.ubisoft.fr (Postfix, from userid 500) id CD821B7A3B; Fri, 23 Oct 2009 14:10:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on buran.ubisoft.fr X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=UNWANTED_LANGUAGE_BODY autolearn=unavailable version=3.2.5 Received: from pdc-mail-hub01.ubisoft.org (pdc-mail-hub01 [194.169.249.120]) by buran.ubisoft.fr (Postfix) with ESMTP id 55A06B7A41 for ; Fri, 23 Oct 2009 14:10:09 +0200 (CEST) Received: from PDC-MAIL-CMS01.ubisoft.org ([fe80::2cf5:9572:e559:65e8]) by pdc-mail-hub01.ubisoft.org ([fe80::d586:5776:ca6b:841f%13]) with mapi; Fri, 23 Oct 2009 14:10:09 +0200 From: Benoit Germain To: Lua list Date: Fri, 23 Oct 2009 14:10:08 +0200 Subject: RE: Enhanced tostring Thread-Topic: Enhanced tostring Thread-Index: AcpT013hbNTxO6XYQXqjcSfb6FfHIAABQQRg Message-ID: References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> <20091023092328.A8915@lua.tecgraf.puc-rio.br> In-Reply-To: <20091023092328.A8915@lua.tecgraf.puc-rio.br> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: fr-FR, en-US Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NCBF1I017361 Yes, I forgot the __index, my bad. The point remains that once this is fixed, o:__tostring() and getmetatable(o).__tostring(o) are not equivalent, since a protected metatable might prevent the latter to work, precisely because getmetatable checks the __metatable field, whereas the rest of the language doesn't. But this isn't what the thread is about anyway :-). -----Message d'origine----- De : lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] De la part de Luiz Henrique de Figueiredo Envoyé : vendredi 23 octobre 2009 13:23 À : Lua list Objet : Re: Enhanced tostring > meta = > { > __metatable = false, > __tostring = function(o) return "hello " .. o.name end > } > > o = {} > setmetatable(o, meta) > o.name = "bob" > print( o) -- yields "hello bob" > o.name = "mick" > print( getmetatable(o).__tostring(o)) -- causes "attempt to index a boolean value" getmetatable(o) returns false and so the message is expected. > print( o:__tostring()) -- causes "attempt to call method '__tostring' (a nil value)" o does not have a __tostring method and so the message is expected. Try adding this meta.__index = meta The __tostring method is used by "tostring" and so print(o) works even if the metatable is proteced. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 11:12:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NDCCOi030036; Fri, 23 Oct 2009 11:12:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60AE819331; Fri, 23 Oct 2009 11:10:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id D6D9C19329 for ; Fri, 23 Oct 2009 11:10:47 -0200 (BRST) Received: (qmail invoked by alias); 23 Oct 2009 13:11:35 -0000 Received: from p5B012912.dip0.t-ipconnect.de (EHLO dialup) [91.1.41.18] by mail.gmx.net (mp031) with SMTP; 23 Oct 2009 15:11:35 +0200 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX190IzRcUpJ0k7VSOrt8Gsg0055nL5BhehmEnQHyDw PSJ2UHF5A3tpUJ Date: Fri, 23 Oct 2009 15:11:33 +0200 From: Edgar Toernig To: Lua list Subject: Re: Enhanced tostring Message-Id: <20091023151133.1ac17e7a.froese@gmx.de> In-Reply-To: References: <20091022231927.A7263@lua.tecgraf.puc-rio.br> <20091023043914.03dcdf9c.froese@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Manura wrote: > > On Thu, Oct 22, 2009 at 10:39 PM, Edgar Toernig wrote: > > At the moment "o" is a table and you add > > arbitrary elements to it everything falls apart.... > >    t:add('add',{}) > > True, the current Lua design implies that an object implemented as a > table cannot store arbitrary keys directly inside itself because this > can interfere with method calls. A very strong limitation given that tables are the usual datatype to implement "objects". Using a proxy table is not only awkward, I see no reason why it has to be like that. > That might also be solved with the __getindex/__setindex proposal [1], > so that "add" would be looked up first in the metatable rather than > the table itself. Not really - that proposal is about overriding every index access even if the key is already in the table. If you would use that for method lookup, methods would override table keys and you are still unable to store arbitrary keys in the object. You have to differentiate between data lookup ([]) and method lookup (:). One proposal was using __methindex for the colon instead of __index. > (I wondered if this behavior could instead be changed with a special > table __mode rather than adding new metamethods.) It could but IMHO it shouldn't. Why being tricky when it can be done directly? Ciao, ET. > [1] http://lua-users.org/lists/lua-l/2004-06/msg00478.html From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 11:30:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NDUnXa000711; Fri, 23 Oct 2009 11:30:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BCB41932D; Fri, 23 Oct 2009 11:29:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E09D6192F2 for ; Fri, 23 Oct 2009 11:29:22 -0200 (BRST) Received: by ewy26 with SMTP id 26so9199077ewy.5 for ; Fri, 23 Oct 2009 06:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=3q2N4/IzljApPrE9txYeKoC2YKSRcnTzTrXZwanE42g=; b=CxKCwRFgoKeSUCVYTLU3jxnoX5zx/ihgaHL8QaZrVW/5gKm+JQmk/tJdSQ+6CF9wTv dAVpPE0RY05OuE7lflGNwU2w3+QlOEePR4+Kb1PuIKYpiLHAn3mOWkvJbahxI7I5Mzjb msPLJ2Px3kBeBN4wkRuLMeN6oFNieuGLzSBx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=SZkWIaJ/SsReI71EKMnTLt3et6/DbaNIlTVcUFkCDWWax+ljA2MSXW21F9SBE/ZJLF D5g1bLc1GT9b3EiRRaKMN4i6WevWGhL4SJkQqUXZvvHBVM45uIGc2bxkq+9pcAhPwBLJ sOjpITF8t9Lw6jsUOyrmE6L2FOR5UqZ8RYEeA= Received: by 10.211.131.34 with SMTP id i34mr582666ebn.86.1256304611896; Fri, 23 Oct 2009 06:30:11 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.86.235]) by mx.google.com with ESMTPS id 7sm6053197eyg.9.2009.10.23.06.30.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 06:30:10 -0700 (PDT) Subject: Re: FastCGI daemon Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Jacob Jay In-Reply-To: Date: Fri, 23 Oct 2009 19:00:02 +0530 Content-Transfer-Encoding: 7bit Message-Id: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> References: To: Lua list X-Mailer: Apple Mail (2.1076) Cc: Kepler Project mailing list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23 Oct 2009, at 10:58 AM, Stefan wrote: > Hello all, I was recently looking at different ways to switch our > web application written in Lua from apache to nginx (we are > currently using mod_wombat *in production* to earn a living). > > One night, I started with the FastCGI devkit threaded.c example, and > after a bit'o'hackin started to see some promising results. It is > multi-threaded and very lightweight, with Lua VM states that persist > between HTTP requests. > > So I tossed it up on http://github.com/STPeters/luafcgid and now I > have come to the point where I will be building the interface (API?) > from Lua land back to the worker thread. I was going to just build a > mod_wombat compatible one, but then thought I would ask here - just > in case anyone else was interested in one day using this abomination. > > WSAPI comes to mind as a potential target... [cc'd to Kepler list] FastCGI is definitely the way to go, but if you haven't, do check out wsapi-fcgi which is part of Kepler (http://keplerproject.org/). I use this with spawn-fcgi and lighttpd/nginx. An additional FCGI-Lua interface may be unnecessary unless you want it to do something notably different to that of the Kepler WSAPI one. I had actually been considering replacing wsapi-fcgi with something like your setup if only for simplicity...however now that I've measured yours against it, the extra functionality of wsapi-fcgi is probably worth its little additional overhead. For a basic "hello world" test wsapi-fcgi yields results similar to yours (both in the region of 4,000+ requests per second on 2 cores) and the best I've seen thus far is 7000rps on 4 cores (makes all the difference, given that I can't seem to otherwise push CPU use to the max.). Incidentally luafcgid is eating CPU at ~6% when idle (on OS X, anyway). From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 11:51:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NDprXs005357; Fri, 23 Oct 2009 11:51:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E36831A6A6; Fri, 23 Oct 2009 11:50:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f184.google.com (mail-vw0-f184.google.com [209.85.212.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD8D51A666 for ; Fri, 23 Oct 2009 11:50:27 -0200 (BRST) Received: by vws14 with SMTP id 14so298374vws.33 for ; Fri, 23 Oct 2009 06:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=RPlPvzLmIwuFvGpP736PmZ91u9voYf1+k55YR+T8XsM=; b=U1wS47NERTfX7nRocML7s/+QXuTyBijcGqNluweNpghVeA2gBz6enkCge3v6o9yQt6 kpRP9SGXzOFLrrGjH5E/k/DTaL5ZLpg2muCqo5fnmkLJAIjeEGw45nnA2EBXUByQcbkg KSRDrQvVD/NNzXzlBr1jjaLRLr+2qWrS9pCU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oQBE+253lCkfgJMXmmzUebTueFVxtx5LIxKOz7v8f5I2SOh3IRcioJgW7XlusRXKfs vBPxGGTkXDsIK0jWQGzw22T97UKnn6eIUeCJgoNg6+87iTt2GUoFASOid1w99wt6HY25 rS3pwMTLl36wATNBAUVPFWhMpJ4EYPQq7X+So= MIME-Version: 1.0 Received: by 10.220.127.74 with SMTP id f10mr6081796vcs.83.1256305876182; Fri, 23 Oct 2009 06:51:16 -0700 (PDT) In-Reply-To: <4AE17CAF.5090005@gmail.com> References: <4AE17CAF.5090005@gmail.com> Date: Fri, 23 Oct 2009 21:51:16 +0800 Message-ID: Subject: Re: comment error about OP_VARARG in lopcodes.h From: VirusCamp To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NDprXs005357 >a,b,c = ... ; source chunk: (interactive mode) ; x86 standard (32-bit, little endian, doubles) ; function [0] definition (level 1) ; 0 upvalues, 0 params, 3 stacks .function 0 0 2 3 .const "a" ; 0 .const "b" ; 1 .const "c" ; 2 [1] vararg 0 4 [2] setglobal 2 2 ; c := R2 [3] setglobal 1 1 ; b := R1 [4] setglobal 0 0 ; a := R0 [5] return 0 1 ; end of function So in VARARG, A=0, B =4 ,is that right ? R(A),....R(A+B-1) = ... can be translated to R0,R1,R2,R3 = ... 2009/10/23 KHMan : > VirusCamp wrote: >> >> I'm working on luadec, but got confused about OP_VARARG in lua-5.1.4. >> I think the comment is wrong, that should be R(A), R(A+1), ..., >> R(A+B-2) = vararg >> >> lopcodes.h line 210 >> OP_VARARG/*     A B     R(A), R(A+1), ..., R(A+B-1) = vararg            */ >> >> >> lvm.c line 751 >>      case OP_VARARG: { >>        int b = GETARG_B(i) - 1; >> .......... >>        for (j = 0; j < b; j++) { > > Nothing wrong there. You can plug in some numbers in order to 'see' the > indices and ranges better. > > GETARG_B(i)'s zero value is taken by multiple return mode, since b is -1 > when GETARG_B(i) == 0 and -1 is LUA_MULTRET in the test. > > When GETARG_B(i) is 1, b = 0 and the loop iterates once only, for one value. > So, A+B-1 = A+1-1 = A. > > I think perhaps you have confused b with B in the comments. B is > GETARG_B(i). > > -- > Cheers, > Kein-Hong Man (esq.) > Kuala Lumpur, Malaysia > > From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 12:12:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NECnZs009273; Fri, 23 Oct 2009 12:12:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B07EE190E0; Fri, 23 Oct 2009 12:11:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F5E2190AC for ; Fri, 23 Oct 2009 12:11:28 -0200 (BRST) Received: by qyk4 with SMTP id 4so6719259qyk.33 for ; Fri, 23 Oct 2009 07:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=REdgnb58KcvB5JpovbFl5+xRoGfK1VVWNgGoizeY7/4=; b=o8O5BFIOViOgKOxDVyF2U9jBcIVVlHvho76VVa2V5m+hFjSTZ1I/k4RDAvXghGh9cG bTs5ibRCyiV9b3dfQRDb6VFG1ndFmLjTZkDPp/xeu+ffFbeRxDevIxuzhnSFUh2nnXLN SiKaDmEefWchGtFvLHchyR9ycBmfSkd5TXTxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=r9dXII8Mw6mdgYQ1GKRHqg9AuKiZIH+AdYRGhRjJV08jB/CXggiaRHb2VOS7t83e0J 6T4wbJYlxVf2usJATWAWq6RTCjKXNxffOpagZ0XhCQXhVpVvg2DeMHudIVwP+OGA9JHb IwPh+3NgPBUSfsaWLBkMP1+2d75ZUty/gKDog= Received: by 10.224.12.204 with SMTP id y12mr5439401qay.99.1256307138420; Fri, 23 Oct 2009 07:12:18 -0700 (PDT) Received: from ?192.168.1.2? ([124.13.57.203]) by mx.google.com with ESMTPS id 5sm6127qwg.30.2009.10.23.07.12.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 07:12:17 -0700 (PDT) Message-ID: <4AE1B9B7.2050706@gmail.com> Date: Fri, 23 Oct 2009 22:12:07 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: comment error about OP_VARARG in lopcodes.h References: <4AE17CAF.5090005@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean VirusCamp wrote: >> a,b,c = ... > ; source chunk: (interactive mode) > ; x86 standard (32-bit, little endian, doubles) > > ; function [0] definition (level 1) > ; 0 upvalues, 0 params, 3 stacks > .function 0 0 2 3 > .const "a" ; 0 > .const "b" ; 1 > .const "c" ; 2 > [1] vararg 0 4 > [2] setglobal 2 2 ; c := R2 > [3] setglobal 1 1 ; b := R1 > [4] setglobal 0 0 ; a := R0 > [5] return 0 1 > ; end of function > > So in VARARG, A=0, B =4 ,is that right ? > R(A),....R(A+B-1) = ... > can be translated to > R0,R1,R2,R3 = ... Yep, I guess I should have taken my own advice and tested it with some actual values and actual code ;-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 12:43:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NEh5tg014823; Fri, 23 Oct 2009 12:43:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAFF51A6B0; Fri, 23 Oct 2009 12:41:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp111.rog.mail.re2.yahoo.com (smtp111.rog.mail.re2.yahoo.com [206.190.37.1]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3CA641A666 for ; Fri, 23 Oct 2009 12:41:45 -0200 (BRST) Received: (qmail 90928 invoked from network); 23 Oct 2009 14:42:33 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp111.rog.mail.re2.yahoo.com with SMTP; 23 Oct 2009 07:42:32 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: kKtmV6IVM1l66Ub2mSvZii4ZTSIqQ4ze6Tosdrb_kVZbTgHAeL7Y2AGsXinp7b61Mg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: From: "Kenk" To: "Lua list" References: <4AE17CAF.5090005@gmail.com> <4AE1B9B7.2050706@gmail.com> In-Reply-To: <4AE1B9B7.2050706@gmail.com> Subject: Metatables, C and Script... Date: Fri, 23 Oct 2009 10:42:22 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi everyone, Can I extend an object defined in C with a metatable, with more methods in script? --in Script myObject = FuncDefinedInC.CreateObjWithMetaInC() function ExtendMetaForMyObject : SomeScriptFunction() -- other stuff defined in script. end Or once you define a metatable for an object, you can't extend it at all? Either it's defined in C or it's defined in script, you can't do both? Thanks for any help! Ken From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 12:55:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NEti56017075; Fri, 23 Oct 2009 12:55:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F225186A5; Fri, 23 Oct 2009 12:54:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CBB718577 for ; Fri, 23 Oct 2009 12:54:25 -0200 (BRST) Received: by fxm12 with SMTP id 12so10656544fxm.5 for ; Fri, 23 Oct 2009 07:55:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.26.130 with SMTP id e2mr10875141bkc.144.1256309714076; Fri, 23 Oct 2009 07:55:14 -0700 (PDT) In-Reply-To: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> Date: Fri, 23 Oct 2009 16:55:13 +0200 X-Google-Sender-Auth: a7341dc13e16ad3a Message-ID: Subject: Re: FastCGI daemon From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 3:30 PM, Jacob Jay wrote: > On 23 Oct 2009, at 10:58 AM, Stefan wrote: > >> Hello all, I was recently looking at different ways to switch our web >> application written in Lua from apache to nginx (we are currently using >> mod_wombat *in production* to earn a living). >> >> One night, I started with the FastCGI devkit threaded.c example, and after >> a bit'o'hackin started to see some promising results. It is multi-threaded >> and very lightweight, with Lua VM states that persist between HTTP requests. >> >> So I tossed it up on http://github.com/STPeters/luafcgid and now I have >> come to the point where I will be building the interface (API?) from Lua >> land back to the worker thread. I was going to just build a mod_wombat >> compatible one, but then thought I would ask here - just in case anyone else >> was interested in one day using this abomination. >> >> WSAPI comes to mind as a potential target... > > [cc'd to Kepler list] > > FastCGI is definitely the way to go, but if you haven't, do check out > wsapi-fcgi which is part of Kepler (http://keplerproject.org/). I use this > with spawn-fcgi and lighttpd/nginx. An additional FCGI-Lua interface may be > unnecessary unless you want it to do something notably different to that of > the Kepler WSAPI one. > > I had actually been considering replacing wsapi-fcgi with something like > your setup if only for simplicity...however now that I've measured yours > against it, the extra functionality of wsapi-fcgi is probably worth its > little additional overhead. > > For a basic "hello world" test wsapi-fcgi yields results similar to yours > (both in the region of 4,000+ requests per second on 2 cores) and the best > I've seen thus far is 7000rps on 4 cores (makes all the difference, given > that I can't seem to otherwise push CPU use to the max.). > > Incidentally luafcgid is eating CPU at ~6% when idle (on OS X, anyway). Hi Jacob I'd be interested in seeing how you start spawn-fcgid with wsapi-fcgi, what command line do you use, just to compare with mine... Do you have any specific setup options ? I have posted my nginx configuration about two weeks ago on the kepler mailing list. Do you use nginx or lighttpd ? Do you mind posting the nginx/lighty config you used for the tests ? thanks, -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 12:58:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NEwhHr017807; Fri, 23 Oct 2009 12:58:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58237186D6; Fri, 23 Oct 2009 12:57:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 831C7186A9 for ; Fri, 23 Oct 2009 12:57:28 -0200 (BRST) Received: by ewy26 with SMTP id 26so9285021ewy.5 for ; Fri, 23 Oct 2009 07:58:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.139.16 with SMTP id r16mr12198595ebn.89.1256309897576; Fri, 23 Oct 2009 07:58:17 -0700 (PDT) In-Reply-To: <20091023113054.GB17349@inf.puc-rio.br> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> <20091023113054.GB17349@inf.puc-rio.br> Date: Fri, 23 Oct 2009 09:58:17 -0500 Message-ID: <90eb1dc70910230758w64a59941gbb414f51521e503b@mail.gmail.com> Subject: Re: Literal string strangeness From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 6:30 AM, Roberto Ierusalimschy wrote: > Long strings should be used for text. fair enough. and what's the current behavior for long strings? turn all flavors of EOL into linefeeds? -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 13:41:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NFfFZq028433; Fri, 23 Oct 2009 13:41:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA59B1A6AD; Fri, 23 Oct 2009 13:39:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF0311A660 for ; Fri, 23 Oct 2009 13:39:44 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NFeYfY028285 for ; Fri, 23 Oct 2009 13:40:34 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9NFeW209839; Fri, 23 Oct 2009 13:40:32 -0200 Date: Fri, 23 Oct 2009 13:40:32 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Metatables, C and Script... Message-ID: <20091023134032.A9833@lua.tecgraf.puc-rio.br> References: <4AE17CAF.5090005@gmail.com> <4AE1B9B7.2050706@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from kenk@heroesent.com on Fri, Oct 23, 2009 at 10:42:22AM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Or once you define a metatable for an object, you can't extend it at all? A metatable is just a plain ordinary table. You can do anything to it. OTOH, you may choose to protect it from Lua code by adding __metatable=false to it. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 14:41:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NGfeh8008543; Fri, 23 Oct 2009 14:41:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAD861A6B8; Fri, 23 Oct 2009 14:40:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 162FB1A678 for ; Fri, 23 Oct 2009 14:40:16 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9NGf5Z3020936 for ; Fri, 23 Oct 2009 14:41:06 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 4D60554C07E; Fri, 23 Oct 2009 14:41:06 -0200 (BRST) Date: Fri, 23 Oct 2009 14:41:06 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Literal string strangeness Message-ID: <20091023164106.GA19394@inf.puc-rio.br> References: <8822cb990910230327j6556d929m695a6d5dd149a63a@mail.gmail.com> <20091023113054.GB17349@inf.puc-rio.br> <90eb1dc70910230758w64a59941gbb414f51521e503b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90eb1dc70910230758w64a59941gbb414f51521e503b@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Fri, Oct 23, 2009 at 6:30 AM, Roberto Ierusalimschy > wrote: > > Long strings should be used for text. > > fair enough. and what's the current behavior for long strings? turn > all flavors of EOL into linefeeds? Yes. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 14:45:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NGjBHb009254; Fri, 23 Oct 2009 14:45:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D94DB1A6BA; Fri, 23 Oct 2009 14:43:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f171.google.com (mail-px0-f171.google.com [209.85.216.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20BCC188DB for ; Fri, 23 Oct 2009 14:43:52 -0200 (BRST) Received: by pxi1 with SMTP id 1so3972991pxi.33 for ; Fri, 23 Oct 2009 09:44:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.119.24 with SMTP id r24mr820957wfc.291.1256316281241; Fri, 23 Oct 2009 09:44:41 -0700 (PDT) In-Reply-To: <20091022220138.A6882@lua.tecgraf.puc-rio.br> References: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> <20091022220138.A6882@lua.tecgraf.puc-rio.br> From: Chris Gagnon Date: Fri, 23 Oct 2009 09:44:21 -0700 Message-ID: <826d5c730910230944y6ebf58e7se8ba4187032aa0f7@mail.gmail.com> Subject: Re: Creating userdata interfaces To: Lua list Content-Type: multipart/alternative; boundary=001636e1f85dab414204769ced73 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e1f85dab414204769ced73 Content-Type: text/plain; charset=ISO-8859-1 I don't believe this solves the issue I'm running into, using your vector as the example how would i go about adding a Lenght() function? Ive experimented with this, however this doesn't seem to work likely since it's added to the metatable. If I expand the __index to a table with a Length() function I'll break the Lget functionality. static const luaL_reg R[] = { { "Length", LLength }, { "__index", Lget }, { "__newindex", Lset }, { "__tostring", Ltostring }, { NULL, NULL } }; -Chris On Thu, Oct 22, 2009 at 5:01 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > I must be making this harder then it is but I'm not sure how to lay it > out. > > See my lv3: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.0/lv3.tar.gz > > (Don't be mislead by the URL; the code works in Lua 5.1, though you may > need to edit the Makefile.) > --001636e1f85dab414204769ced73 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't believe this solves the issue I'm running into, using your = vector as the example how would i go about adding a Lenght() function?
<= br>Ive experimented with this, however this doesn't seem to work likely= since it's added to the metatable.
If I expand the __index to a table with a Length() function I'll break = the Lget functionality.

static const luaL_reg R[] =3D
{
=A0=A0= =A0 { "Length",=A0=A0=A0 LLength =A0=A0 =A0=A0=A0 },
=A0=A0=A0= { "__index",=A0=A0=A0 Lget=A0=A0=A0 =A0=A0=A0 },
=A0=A0=A0 { "__newindex",=A0=A0=A0 Lset=A0=A0=A0 =A0=A0=A0 },
= =A0=A0=A0 { "__tostring",=A0=A0=A0 Ltostring=A0=A0=A0 },
=A0= =A0=A0 { NULL,=A0=A0=A0 =A0=A0=A0 NULL=A0=A0=A0 =A0=A0=A0 }
};

-C= hris

On Thu, Oct 22, 2009 at 5:01 PM, Lui= z Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> I must be making this harder then it is but I'm not sure how to l= ay it out.

See my lv3: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua= /5.0/lv3.tar.gz

(Don't be mislead by the URL; the code works in Lua 5.1, though you may=
need to edit the Makefile.)

--001636e1f85dab414204769ced73-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 14:49:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NGnlXU010371; Fri, 23 Oct 2009 14:49:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F7111A6BE; Fri, 23 Oct 2009 14:48:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp109.rog.mail.re2.yahoo.com (smtp109.rog.mail.re2.yahoo.com [68.142.225.207]) by bazar2.conectiva.com.br (Postfix) with SMTP id E8B051A6B5 for ; Fri, 23 Oct 2009 14:48:31 -0200 (BRST) Received: (qmail 45609 invoked from network); 23 Oct 2009 16:49:20 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp109.rog.mail.re2.yahoo.com with SMTP; 23 Oct 2009 09:49:20 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: dIsHIVYVM1lgx7R_PfmzgihIoJueUZ7YzAHybDuXt8LtAhbCY9EHA3n9CrA7rWZ4oQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: From: "Kenk" To: "Lua list" References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com> <20091023134032.A9833@lua.tecgraf.puc-rio.br> In-Reply-To: <20091023134032.A9833@lua.tecgraf.puc-rio.br> Subject: Re: Metatables, C and Script... Date: Fri, 23 Oct 2009 12:49:09 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hmm.. I see... I think page 123 accomplishes what I'm looking to do. let me play with that... Thanks, Ken ----- Original Message ----- From: "Luiz Henrique de Figueiredo" To: "Lua list" Sent: Friday, October 23, 2009 11:40 AM Subject: Re: Metatables, C and Script... >> Or once you define a metatable for an object, you can't extend it at all? > > A metatable is just a plain ordinary table. You can do anything to it. > OTOH, you may choose to protect it from Lua code by adding > __metatable=false > to it. > From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 14:56:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NGu85S011906; Fri, 23 Oct 2009 14:56:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9364A1A6BF; Fri, 23 Oct 2009 14:54:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A27D1A6B5 for ; Fri, 23 Oct 2009 14:54:47 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1962166eye.39 for ; Fri, 23 Oct 2009 09:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=0sS3KUJTV9o+4UU274TeJWSl/lG2uB2osfZkHkC8QxM=; b=dDKDpIum7kffIcVPAQtoFyXKIPo23VudvFOiPD1Ym3v8cakINvg98w5uEkMCw8LiYs R8TlgfRzxRrhtdHSyhToGBW6G7KCuzem9RgDpulEII7AHIhSOQQZzyyhtILo3mFqFrrG XIt8AKjDMFkK6gkyKafgCIuQTCPzYoIwRoWew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=CNGCfAkyGf/9DamHeoiprPjtB1DMwW7e+AX8b1aNzCFpzmaCS59CduyKQb/Ox5Z8+c grEnaMIdg8MrfosyOxQ59MyCwwakaQYi12enTy60BPR2d2nhTbWjd3nbzmaYpBxXeAzY 1ET/aYnOSS3Fo02+nYRnlM5CaHCgxCDQmeNnQ= MIME-Version: 1.0 Received: by 10.216.86.142 with SMTP id w14mr887840wee.74.1256316935473; Fri, 23 Oct 2009 09:55:35 -0700 (PDT) In-Reply-To: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> References: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> From: Jerome Vuarand Date: Fri, 23 Oct 2009 18:55:15 +0200 Message-ID: <89d273ba0910230955g5e65c9ecibf19ac33900b5379@mail.gmail.com> Subject: Re: Creating userdata interfaces To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/23 Chris Gagnon : > I must be making this harder then it is but I'm not sure how to lay it out. > > I have this: > > luaL_newmetatable(L, "Vector"); > > lua_pushliteral(L, "__index"); > lua_pushcfunction(L, LuaVectorGet); > lua_settable(L, -3); > > lua_pushliteral(L, "__newindex"); > lua_pushcfunction(L, LuaVectorSet); > lua_settable(L, -3); > > lua_newtable(L); > int nFuncIndex = lua_gettop(L); > > lua_pushvalue(L, nFuncIndex); > lua_setfield(L, LUA_GLOBALSINDEX, msc_pType); > > lua_newtable(L); > int mt = lua_gettop(L); > lua_pushliteral(L, "__call"); > lua_pushcfunction(L, LuaNew); > lua_pushliteral(L, "new"); > lua_pushvalue(L, -2); // duplicate LuaNew > lua_settable(L, nFuncIndex); > lua_settable(L, mt); > lua_setmetatable(L, nFuncIndex); > lua_pop(L, 2); > > User data created like so: > float * fUserData = (float *)lua_newuserdata(L, 4 * sizeof(float)); > luaL_getmetatable(L, "Vector"); > lua_setmetatable(L, -2); > return fUserData; > > This gives me the interface: > local v = Vector.new(1,1,1) > local vec = Vector(1,1,2) > local x = vec.x > > the problem is when i want a Length() function > > if i switch the __index block to: > > lua_pushliteral(L, "__index"); > lua_newtable(L); > lua_pushliteral(L, "Length"); > lua_pushcfunction(L, LuaLength); > lua_settable(L, -3); > > lua_pushliteral(L, "__index"); > lua_pushcfunction(L, LuaGet); > lua_settable(L, -3); > > lua_pushvalue(L,-1); > lua_setmetatable(L, -2); > lua_settable(L, nMetatableIndex); > > i now get the interface: > vec:Length() > > however the vec.x interface is broken since the __index gets the table on > the stack not my userdata. > > Hopefully that was clear, i appreciate any comments/ help on a fix for this > or on better ways to build what I'm trying to do. When I need to define both accessors (e.g. your LuaVectorGet) and static fields (a classic __index table), I usually use a generic index function that accesses other fields of the metatable : int lua__generic___index(lua_State* L) { lua_getmetatable(L, 1); lua_getfield(L, -1, "getters"); if (!lua_isnil(L, -1)) { lua_pushvalue(L, 2); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { lua_pushvalue(L, 1); lua_call(L, 1, 1); return 1; } lua_pop(L, 1); // getter } lua_pop(L, 1); // getters lua_getfield(L, -1, "methods"); lua_pushvalue(L, 2); lua_gettable(L, -2); return 1; } int lua__generic___newindex(lua_State* L) { lua_getmetatable(L, 1); lua_getfield(L, -1, "setters"); if (!lua_isnil(L, -1)) { lua_pushvalue(L, 2); lua_gettable(L, -2); if (!lua_isnil(L, -1)) { lua_pushvalue(L, 1); lua_pushvalue(L, 3); lua_call(L, 2, 0); return 0; } lua_pop(L, 1); // setter } lua_pop(L, 1); // setters return luaL_error(L, "invalid key"); } Note that the keys of the methods, setters and getters tables can be any type, this can be useful if you want your v.x getter also work with v[1]. Here I throw an error when trying to write to an unsupported key (one without setter), but you could store that new pair in a table associated to the userdata (for exemple its environment), and return them from __index. This would allow adding custom attributes from Lua to a userdata object. Just ask if you would like to see such an enhanced version. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:21:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHL8Uq019138; Fri, 23 Oct 2009 15:21:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 529A6188AA; Fri, 23 Oct 2009 15:19:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44EF81888B for ; Fri, 23 Oct 2009 15:19:46 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1NoT-0005a9-GT for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 19:20:29 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:20:29 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:20:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: FastCGI daemon Date: Fri, 23 Oct 2009 10:20:09 -0700 Lines: 23 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bertrand Mansion wrote: > On Fri, Oct 23, 2009 at 7:28 AM, Stefan wrote: >> Hello all, I was recently looking at different ways to switch our web >> application written in Lua from apache to nginx (we are currently using >> mod_wombat *in production* to earn a living). > > I wouldn't use mod_wombat in production at the moment, it can be > vulnerable to DoS attack because the size of the request body that is > read is not limited and could fill the memory. It should use apreq2 > instead of trying to do request parsing by itself. And there is no > easy way to limit and control how server resources are used (max > execution time, memory limit, ...). > Correction: a in-house modified version of mod_wombat, based on the last snap back when they *did* use apreq2. And yes, the lack of proper controls is one of the issues prompting the switch. When I performed heavy benchmarking, apache filled the screen of 'top' with over 60 httpd processes. And that was at only 10 concurrent connections. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:34:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHYBtI023531; Fri, 23 Oct 2009 15:34:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54D90188EF; Fri, 23 Oct 2009 15:32:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C8411888B for ; Fri, 23 Oct 2009 15:32:47 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1O1A-00031D-Tu for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 19:33:36 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:33:36 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:33:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: FastCGI daemon Date: Fri, 23 Oct 2009 10:33:22 -0700 Lines: 39 Message-ID: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jacob Jay wrote: > On 23 Oct 2009, at 10:58 AM, Stefan wrote: > > > [cc'd to Kepler list] > > FastCGI is definitely the way to go, but if you haven't, do check out > wsapi-fcgi which is part of Kepler (http://keplerproject.org/). I use > this with spawn-fcgi and lighttpd/nginx. An additional FCGI-Lua > interface may be unnecessary unless you want it to do something notably > different to that of the Kepler WSAPI one. I was under the impression that wsapi-fcgi did NOT persist the scripts between invocations, unless you run each script as it's own fastcgi server. Running a couple dozen (at least) extra processes that MUST stay up at all times doesn't appeal to sysadmin in me. My main criteria are: 1) lightweight 2) fast 3) reliable, even under extremely heavy loads 4) controllable and intelligent resource utilization 4) easy administration for critical installations > For a basic "hello world" test wsapi-fcgi yields results similar to > yours (both in the region of 4,000+ requests per second on 2 cores) and > the best I've seen thus far is 7000rps on 4 cores (makes all the > difference, given that I can't seem to otherwise push CPU use to the max.). > Interesting. What is the memory load of wsapi-fcgi at identical rps rates compared to luafcgid? > Incidentally luafcgid is eating CPU at ~6% when idle (on OS X, anyway). > Yes, the idle loop of the parent process is a placeholder 'usleep(100)' right now. Some configurable housekeeping is planned there. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:39:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHdXpi025058; Fri, 23 Oct 2009 15:39:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D096618CAD; Fri, 23 Oct 2009 15:38:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E7B918899 for ; Fri, 23 Oct 2009 15:38:09 -0200 (BRST) Received: by ewy26 with SMTP id 26so9447905ewy.5 for ; Fri, 23 Oct 2009 10:38:58 -0700 (PDT) Received: by 10.216.87.80 with SMTP id x58mr1246427wee.92.1256319538196; Fri, 23 Oct 2009 10:38:58 -0700 (PDT) Received: from erikpc (adsl-75-61-106-222.dsl.pltn13.sbcglobal.net [75.61.106.222]) by mx.google.com with ESMTPS id x6sm4159266gvf.16.2009.10.23.10.38.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 10:38:57 -0700 (PDT) From: "Erik Cassel" To: Subject: Resuming a co-routing with an exception Date: Fri, 23 Oct 2009 10:39:01 -0700 Organization: Roblox Message-ID: <000001ca5407$b9339470$2b9abd50$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01CA53CD.0CD4BC70" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpUB7VS2ECVTnbbQTaurpJxS4SuWw== Content-Language: en-us X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_0001_01CA53CD.0CD4BC70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I have defined an asynchronous function in C that yields the current thread and then resumes it when the operation completes. If the function succeeds, then I push the result onto the stack and call lua_resume(). What can I do in case of an exception? I'd love to somehow cause an exception to be thrown into the resumed thread, but I don't see an easy way to do this. So far I've considered injecting some Lua shim code, but that seems pretty complicated: -- Get the async function from the stack f = ... -- Call the async function. It will return true on success and false on failure success, result = f() if success then return result -- the 2nd argument is the result. TODO: Handle tuple results. else error(result) -- the 2nd argument is the error message. Throw it. end I'd much rather not go down this complicated (and inefficient) route if I can avoid it. Any ideas? -Erik ------=_NextPart_000_0001_01CA53CD.0CD4BC70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

I have defined an asynchronous function in C = that yields the current thread and then resumes it when the operation = completes.  If the function succeeds, then I push the result onto the stack and call lua_resume().

     

What can I do in case of an exception? I’d = love to somehow cause an exception to be thrown into the resumed thread, but I don’t see an easy way to do this.

 

So far I’ve considered injecting some Lua = shim code, but that seems pretty complicated:

 

 

 

-- Get the async function from the stack =

f =3D ...

 

-- Call the async function. It will return true = on success and false on failure

success, result =3D f() 

 

if success then

      return result    -- the 2nd argument is the result. TODO: Handle = tuple results.

else

      = error(result)    -- the 2nd argument is the error message. Throw it.

end

 

 

 

 

I’d much rather not go down this = complicated (and inefficient) route if I can avoid it. Any ideas?

 

-Erik

 

 

 

 

 

 

------=_NextPart_000_0001_01CA53CD.0CD4BC70-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:40:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHeFHp025383; Fri, 23 Oct 2009 15:40:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A4E718D5E; Fri, 23 Oct 2009 15:39:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0C7818CE6 for ; Fri, 23 Oct 2009 15:38:54 -0200 (BRST) Received: by gxk8 with SMTP id 8so10691238gxk.1 for ; Fri, 23 Oct 2009 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=a8jTGueZpgMTkaIMe++srCaFU9dhyD7MpqPDRu3V1ig=; b=BQj0NuFAxTeP88PnoeN13lozuSGNS0Pj4TWbNasD4FTDOGGfAlVesMqZpBvQkwp9Hn 9T8rKag0pbaOOnRsixcFctluRUIrF4vtZuY4QaPlaXIgM5qxUQTMEpbY6J3V710snkO0 6Id0X2K/xnV2GJ7DKIRMSinqtQG5dWbBZ8qHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=dhwJHtAYKAImx0Fqpog0vogTDU3Lq8zKzt0oHpSOZ2DXMnYorzZWmzMXlQq9yS4j7e +mK2aCpYm6Knj6234NPShPFKW2waYTxAqjMTZqMTToCArnhAK6mvRbkexM/YO+p7DRnB GMFI6JsgCB2hHH9FJBO8dazW59uDZjrLWDkag= MIME-Version: 1.0 Received: by 10.100.56.17 with SMTP id e17mr2165432ana.100.1256319584350; Fri, 23 Oct 2009 10:39:44 -0700 (PDT) From: corey johnson Date: Fri, 23 Oct 2009 10:39:24 -0700 Message-ID: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> Subject: Userdata and the GC To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have a situation where Lua wants to free a userdata, but I need the userdata to stick around because separate obj-c code is still reliant upon the userdata. My workaround was to add new luaT_eventname that will return true if the obj-c code still needs the object (ie it's retain count > 1) . I do this check in the lgc.c traversetable method, which works great! But the code requires a lua_State*, and the only way I can figure out how to get one is through g->mainthread. You can check out the actual code around line 195 here http://github.com/probablycorey/wax/blob/master/lib/lua/lgc.c Because I'm using the mainthread, I'm assuming I can't use coroutines because they are run in different Lua threads. So is there a way I can determine the currently running thread from inside the traversetable method? I am aware this is crazy, so no need to let me know that again. I'm just wondering if anyone knows of an alternative solution, or if there is a way to make the current solution work with coroutines. Thanks, Corey From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:48:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHm4Dw027676; Fri, 23 Oct 2009 15:48:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 735D01A6A4; Fri, 23 Oct 2009 15:46:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12B0418D1B for ; Fri, 23 Oct 2009 15:46:44 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1OEa-0001Rg-SG for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 19:47:28 +0200 Received: from p5b2c2535.dip.t-dialin.net ([91.44.37.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:47:28 +0200 Received: from dak by p5b2c2535.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 19:47:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Resuming a co-routing with an exception Date: Fri, 23 Oct 2009 19:47:16 +0200 Organization: Organization?!? Lines: 17 Message-ID: <87zl7ij93v.fsf@lola.goethe.zz> References: <000001ca5407$b9339470$2b9abd50$@com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2535.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:4kLS6z3Klk8gjN42JYY1fmlJbzM= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "Erik Cassel" writes: > > > I have defined an asynchronous function in C that yields the current thread and > then resumes it when the operation completes. If the function succeeds, then I > push the result onto the stack and call lua_resume(). > > > > What can I do in case of an exception? I?d love to somehow cause an exception > to be thrown into the resumed thread, but I don?t see an easy way to do this. The default behavior of coroutine.wrap is not helpful here? -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 15:49:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NHnSFv028083; Fri, 23 Oct 2009 15:49:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 698631A6C3; Fri, 23 Oct 2009 15:48:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C93B31A6B5 for ; Fri, 23 Oct 2009 15:48:08 -0200 (BRST) Received: by ewy26 with SMTP id 26so9456686ewy.5 for ; Fri, 23 Oct 2009 10:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=a9NKJ3n4BZtTR7/2jAty7hv2nIAA9YczOjsmt0VnF2g=; b=dm7Cxm6JpZ33OOeLOCl3bmzxtMehg1mu/Upwq901wqVCh2SAlhlqP5j+cyE/+5MRfa pvizTHAPHIjWsPNfPbNmlIaBSA9FfC3LzjcbUoIbC7NEzTh8yPSLZkodHAVZFMLOUkUd wHlUlkRJpo83jY4eIq+twJjpx3rfjwIKz2sWU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=h+smkbyrO3e0ySnInbxeLP4g7XaSrwBdrgJsHh+LOiq/05UGaPUwU2TcatzK8LC1sL 99ZGELnOcm0EuBw95xiIoF1lR4YJVqn3gT8vFURlTu9ZWBjWTIcpiIWLgOrFcH7Nh9Dw dryOgv4Z0SgTyPw6IpLUPRRybGMB7aftynAY0= MIME-Version: 1.0 Received: by 10.216.87.197 with SMTP id y47mr4193146wee.202.1256320137695; Fri, 23 Oct 2009 10:48:57 -0700 (PDT) In-Reply-To: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> Date: Fri, 23 Oct 2009 10:48:57 -0700 Message-ID: <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> Subject: Re: Userdata and the GC From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 10:39 AM, corey johnson wrote: > I have a situation where Lua wants to free a userdata, but I need the > userdata to stick around because separate obj-c code is still reliant > upon the userdata. My workaround was to add new luaT_eventname that > will return true if the obj-c code still needs the object (ie it's > retain count > 1) . Is the obj-c code reliant on the userdata because it wants to use it as a lua object, or just reliant on the userdata as C memory (perhaps there is a struct in there)? Assuming its just memory, and the obj-c code isn't goint to be making lua calls on that userdata, then I would say the userdata should not be the shared resource, it should have a pointer to the shared resource. When lua collects the shared resource, decrement its ref count. When an obj-c object with a ref to that resource gets released, decrement a the ref count. Of course, making this shared resource a obj-c object would give you something that already implements ref counts, and retain/release. Way easier than hacking the gc. If you actually need your obj-c code to make lua calls on the userdata, then you need a different system, you need to create a lua table that maps obj-c objects to the userdata they refer to (using lightuserdata). When an obj-c object is released, it will clear the mapping in the lua table. When lua has no mappings, then it will collect the userdata. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 16:00:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NI0TFN030990; Fri, 23 Oct 2009 16:00:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DF9D1A6C6; Fri, 23 Oct 2009 15:59:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 641101A6A7 for ; Fri, 23 Oct 2009 15:59:08 -0200 (BRST) Received: by ewy26 with SMTP id 26so9466800ewy.5 for ; Fri, 23 Oct 2009 10:59:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.101.1 with SMTP id y1mr964131ebb.60.1256320797463; Fri, 23 Oct 2009 10:59:57 -0700 (PDT) In-Reply-To: <826d5c730910230944y6ebf58e7se8ba4187032aa0f7@mail.gmail.com> References: <826d5c730910221601n1ffd8270w3bc5d451ac91faee@mail.gmail.com> <20091022220138.A6882@lua.tecgraf.puc-rio.br> <826d5c730910230944y6ebf58e7se8ba4187032aa0f7@mail.gmail.com> Date: Fri, 23 Oct 2009 12:59:57 -0500 Message-ID: <90eb1dc70910231059n30b7783bod0a8338b6b28086c@mail.gmail.com> Subject: Re: Creating userdata interfaces From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 11:44 AM, Chris Gagnon wrote: > Ive experimented with this, however this doesn't seem to work likely since > it's added to the metatable. luaL_register() does two different things: - if you set libname to NULL, it adds the C functions to the Lua table currently on the stack's top - if libname is not NULL, it creates a table, adds the C functions, and stores the table in _G[libname] , and package.loaded[libname], roughly what expected for a loadable module. i usually use one luaL_Reg[] array for the module and one for the metatable of each type i define. if you want the functions to be stored directly in the table (and not on a metatable) you can simply do: lua_newtable(L); luaL_register (L, NULL, funcs); return 1; where 'funcs' is the luaL_Reg[] array. just for this. (and a different one for the metatables, i guess) -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 16:18:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NIIKCa003327; Fri, 23 Oct 2009 16:18:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22ACB18F5F; Fri, 23 Oct 2009 16:16:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75AFF18EF2 for ; Fri, 23 Oct 2009 16:16:53 -0200 (BRST) Received: by gxk8 with SMTP id 8so10747410gxk.1 for ; Fri, 23 Oct 2009 11:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=DBHA45Xb0X8dm1WpbkqSiNbLIMRjWwolaXPO+/8LjWU=; b=Cb+Klz6RKoV5A+Tm2m47Vlw43R2JocYs/XbHCiy/Q1JUdd+CiyIWlCFV13LqbEhqKP gFaMsaCDiDoFxoRSBLM1N0FCGFJOPWbOZEIC4a+/2d5XzG5mvGg50L6Cuoj4lI2JzC5b OucDzbcqWU37AHGRKWM8GwNHbOZvpaYYBUpfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=xoN41pHzTClxaBbakDOIPFp+lW5CDVW4bJZKHK9lNFoZtShcUWEoqKuFG5NyeaviEl 8TwfwoMJ9SX8T/CYAwH3nh1Y3avvX62Eshd/NjU94xN61oaGBvO/Dimo5zwhWCSLp6Dn qAtiJp19ZuKshV6IxOTtECva/UNat1N/kGUuQ= MIME-Version: 1.0 Received: by 10.100.24.37 with SMTP id 37mr79737anx.45.1256321862098; Fri, 23 Oct 2009 11:17:42 -0700 (PDT) In-Reply-To: <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> From: corey johnson Date: Fri, 23 Oct 2009 11:17:22 -0700 Message-ID: <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> Subject: Re: Userdata and the GC To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 10:48 AM, Sam Roberts wrote: > If you actually need your obj-c code to make lua calls on the > userdata, then you need a different > system, you need to create a lua table that maps obj-c objects to the > userdata they refer to (using > lightuserdata). When an obj-c object is released, it will clear the > mapping in the lua table. When lua > has no mappings, then it will collect the userdata. Thanks Sam, It's a little more complicated than I let on. For a little background, I've written an obj-c <-> lua bridge http://github.com/probablycorey/wax. The obj-c code actually calls Lua functions from userdata env, so I need to use the userdata as the shared resource. I also currently have a table with weak references that links the obj-c object to the userdata, but don't have knowledge of when obj-c objects get released. This is because I ask obj-c to create objects, I don't have knowledge of when it is released. I also pass these objects off to other methods, which then control the object's retain/release cycle. For example... local viewController = LuaViewController:init() -- returns userdata containing an obj-c object and some lua functions i've added self:navigationController():pushViewController_animated(viewController, true) At this point Lua wants to clean up the viewController, but the Lua methods in viewController could still be called from the navigationController. I'd love to avoid hacking the GC, but I keep running into walls when I try solutions that avoid that. So know I'm just trying to figure out how to get the current running thread from the Lua C API. But your suggestions gave me some ideas. Thanks! Corey From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 16:24:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NIOq9R004793; Fri, 23 Oct 2009 16:24:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDD361A66B; Fri, 23 Oct 2009 16:23:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5328B1928C for ; Fri, 23 Oct 2009 16:23:31 -0200 (BRST) Received: by qyk4 with SMTP id 4so6843460qyk.33 for ; Fri, 23 Oct 2009 11:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=RJxpa+ARksT1IT6848o+ikEpoSsssBaXZx5fqIwS2AI=; b=r7FcZEn+TZCCG2LTHeAO7mO4PFjsty6PyGiECE3taVOePbr/fNu8aJMwWnz/QofpZO Anb6Jb+4ar93mLNHnS+kmbLzol5BBA5Ek3vCJEKcbbm/wpUZ7IWybT/QRYjeZd/Pitj/ y86KxLjYg13LNXBTnq6RKMYSlKl5i70O90daM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Gk6JaQEJ6yl3iBM2I71TtWsoRq2DAbciem3EImqZDM1eYvno5QvC4y/OQN3AsQqIfg W8NsxHb/idMdOGMPOIkYXYOCUhXFFb/zNLlYLyBVnh4g8iL9at9orlBV8Xhp0VWGouKk mBEpxrAzIeERKU8IL9KXrPZHZot8SAgn6NqA0= MIME-Version: 1.0 Received: by 10.224.117.14 with SMTP id o14mr5574414qaq.334.1256322259920; Fri, 23 Oct 2009 11:24:19 -0700 (PDT) In-Reply-To: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> Date: Fri, 23 Oct 2009 16:24:19 -0200 X-Google-Sender-Auth: b0fb4e299d2c003b Message-ID: <7913df4d0910231124w313bf382xd12696bd7ec58065@mail.gmail.com> Subject: Re: FastCGI daemon From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 3:33 PM, Stefan wrote: > Jacob Jay wrote: >> FastCGI is definitely the way to go, but if you haven't, do check out >> wsapi-fcgi which is part of Kepler (http://keplerproject.org/). I use this >> with spawn-fcgi and lighttpd/nginx. An additional FCGI-Lua interface may be >> unnecessary unless you want it to do something notably different to that of >> the Kepler WSAPI one. > > I was under the impression that wsapi-fcgi did NOT persist the scripts > between invocations, unless you run each script as it's own fastcgi server. > Running a couple dozen (at least) extra processes that MUST stay up at all > times doesn't appeal to sysadmin in me. > The generic wsapi.fcgi launcher does persist scripts (and each script is isolated in its own Lua state), but each wsapi.fcgi process can only serve a single request at a time, so you need to configure your web server to keep multiple wsapi.fcgi workers to service concurrent requests. wsapi.fcgi also reloads the script in a fresh Lua state if the underlying file has been modified. A caveat: wsapi.fcgi's persistence is useless for things like keeping session data in memory, unless your web server has FCGI process affinity. But it is enough to avoid reloading the script and the libraries it uses for each request, and keeping database connections and other long-lived resources open. -- Fabio Mascarenhas From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 16:30:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NIUe1L006045; Fri, 23 Oct 2009 16:30:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 358CF192B1; Fri, 23 Oct 2009 16:29:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp106.rog.mail.re2.yahoo.com (smtp106.rog.mail.re2.yahoo.com [68.142.225.204]) by bazar2.conectiva.com.br (Postfix) with SMTP id C51D4192A6 for ; Fri, 23 Oct 2009 16:29:15 -0200 (BRST) Received: (qmail 72911 invoked from network); 23 Oct 2009 18:30:04 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp106.rog.mail.re2.yahoo.com with SMTP; 23 Oct 2009 11:30:04 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: zDdT5sYVM1mB8u2F2bJcwxJjucrCIC0gE9xzWaBCtVrbco8GsRZu2rJvyXHLDViaOQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: From: "Kenk" To: "Lua list" References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br> In-Reply-To: Subject: Re: Metatables, C and Script... Date: Fri, 23 Oct 2009 14:29:54 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Okay, getting closer... Following page 123... Okay... I have AWindowClass defined in script. I set a field within that table to be another table object with a metatable I've defined in C. I 've __index AWindowClass. AWindowClass has a .new method which takes a table and set's that objects metatable to that of AWindowClass. So now O=AWindowClass.new{fields and stuff} ... When 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass and look in the prototype's table. which it finds...Problem is, the initial 'self' state isn't be passed through...as get's done when you reference a method with anObject:AFunction(); ----- Original Message ----- From: "Kenk" To: "Lua list" Sent: Friday, October 23, 2009 12:49 PM Subject: Re: Metatables, C and Script... > Hmm.. I see... I think page 123 accomplishes what I'm looking to do. let > me play with that... > > Thanks, > > Ken > ----- Original Message ----- > From: "Luiz Henrique de Figueiredo" > To: "Lua list" > Sent: Friday, October 23, 2009 11:40 AM > Subject: Re: Metatables, C and Script... > > >>> Or once you define a metatable for an object, you can't extend it at >>> all? >> >> A metatable is just a plain ordinary table. You can do anything to it. >> OTOH, you may choose to protect it from Lua code by adding >> __metatable=false >> to it. >> > > From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 16:54:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NIsp3s010471; Fri, 23 Oct 2009 16:54:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FC5D1A6C1; Fri, 23 Oct 2009 16:53:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8650F1A5FB for ; Fri, 23 Oct 2009 16:53:28 -0200 (BRST) Received: by ewy26 with SMTP id 26so9515745ewy.5 for ; Fri, 23 Oct 2009 11:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=MMyDu9A0iabYVz4FP2TfBJ98TJrVJUCBfObw0pNjkl8=; b=bozR7gp+QM7scGL2a0WAvbwamDtWE4hM7Yv7AtMTghq0xmi9/mUwsxo0GPKJHmML2q tryMPUR/1Xiu/e8zfSK8zoHXbYQfECDTGG1SpN1zdoaUBM/2+UJ8NAxt6GeEzASfEPPM lRuD9jUsUAlemAEFUJaK+tbxlR4fn4NIPKHH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=H5b2wxC6qHK+dmGBNu//sNfpZyT21nw/u/7RGiHbpjEqmNkvC2lpaWu9+ojcNFWijl jatLVvtYoXNayyPGHj/Z0dY95vuuXpk9Hgp7B4QbG1GoBRzRZhLGLeNFzCqm8v8Grbfj T/KRv2jHTpsuor2MlCojhxmNBRHGPEZ1sW+ow= Received: by 10.211.143.19 with SMTP id v19mr995123ebn.47.1256324057162; Fri, 23 Oct 2009 11:54:17 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.86.235]) by mx.google.com with ESMTPS id 28sm5687889eye.5.2009.10.23.11.54.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 11:54:16 -0700 (PDT) Subject: Re: FastCGI daemon Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Jacob Jay In-Reply-To: Date: Sat, 24 Oct 2009 00:24:08 +0530 Content-Transfer-Encoding: 7bit Message-Id: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> To: Lua list X-Mailer: Apple Mail (2.1076) Cc: Kepler Project mailing list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 23 Oct 2009, at 11:03 PM, Stefan wrote: > I was under the impression that wsapi-fcgi did NOT persist the > scripts between invocations, unless you run each script as it's own > fastcgi server. Fabio has pitched in a concise answer on this point. I'd add that if needed you could probably do high-performance shared data in your solution using lindas amongst the threads, whereas with separate fastcgi server processes I'm resorting to a solution something akin to a memcached for Lua tables. Of course if you just use MySQL only the persistence for the connection matters. (I was getting ~2500rps with some MySQL queries and app logic.) > Running a couple dozen (at least) extra processes that MUST stay up > at all times doesn't appeal to sysadmin in me. > > My main criteria are: > > 1) lightweight > 2) fast > 3) reliable, even under extremely heavy loads > 4) controllable and intelligent resource utilization > 4) easy administration for critical installations Same here :) But I do think separate fcgi server processes are more resilient and flexible, if not quite as manageable as a single multi- threaded process. With balancing across the multiple processes (as noted in my response to Bertrand, the number of processes would probably only equal the number of cores), if one of them dies (or is restarted...) the webserver/proxy will ignore it until it comes back, and continue distributing requests amongst those that are still up. > Interesting. What is the memory load of wsapi-fcgi at identical rps > rates compared to luafcgid? I'm afraid I haven't been paying any attention to that, I've yet to actually do a heavy duty test over any long duration...will try soon though. From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 17:14:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NJDvFL014176; Fri, 23 Oct 2009 17:13:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6033D192D0; Fri, 23 Oct 2009 17:12:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB070192C0 for ; Fri, 23 Oct 2009 17:12:28 -0200 (BRST) Received: by ewy26 with SMTP id 26so9532641ewy.5 for ; Fri, 23 Oct 2009 12:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=aXZ7Sj2KYjDSQwidKnZaGfZpXE4GEt4fJQAn526gjUQ=; b=DmuHaRGPcT6reKxdEfu0n7Z0FXX2sFX9Jdx6Fp15ILtmgaBcNiu1C0ZIdVGtZbx7jt IBDGuyy0UzARvLmjWQshkNOBwChIru8YXhNtBVfcVc+Dzs1AwOwxMfnz4YAUSMicYv3G MGQS34u9q9VdgiJl/mOwpfFKQAzXtYYuVMaBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=NcPU/Vuivgb3HZoBJrPRhqd8UJH5OEIy317HT4m7EYbpF+YiSQZRgE/9USxssmWGR8 lSjC7V/csARO+q4+wrx3pOxxQgkuvdhhq53S3VGzr7hhRP9b/su7dzBju/4Lxye7fc6y wqOkmgUPprLpIcYGUDHel2gP3HLLZQD2SClb0= Received: by 10.211.159.15 with SMTP id l15mr2229823ebo.96.1256325196549; Fri, 23 Oct 2009 12:13:16 -0700 (PDT) Received: from ?192.168.1.2? ([122.161.86.235]) by mx.google.com with ESMTPS id 5sm6182608eyh.42.2009.10.23.12.13.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Oct 2009 12:13:15 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: FastCGI daemon From: Jacob Jay In-Reply-To: Date: Sat, 24 Oct 2009 00:43:07 +0530 Message-Id: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9NJDvFL014176 On 23 Oct 2009, at 8:25 PM, Bertrand Mansion wrote: > I'd be interested in seeing how you start spawn-fcgid with wsapi-fcgi, Sure; this is by no means a complete example, but it's most of what's relevant. Note that there's two files with the name wsapi.fcgi, typically (using luarocks) you'd spawn with the shell script in lib/ bin or thereabouts. In my setup I actually pass launch arguments via wsapi.fcgi, through the wsapi_env to the webapp so that each server [process] knows which it is (most folks probably wouldn't need this), and thus I use a modified version of the Lua script of the same name (having «function wsapi_loader»). It seems best (and makes sense) to have as many fastcgi servers as you have CPU cores (of course shared memory/data access may then become an issue). In my usage under Ubuntu, no single fastcgi server seems capable of using more than 30% of a core (and webserver 40-50% of a core), and adding additional servers doesn't make better use of the CPU... -- spawn-fcgi spawn-fcgi -s /tmp/1.fcgi.socket -- wsapi.fcgi & spawn-fcgi -s /tmp/2.fcgi.socket -- wsapi.fcgi & -- nginx http { upstream wsapi { server unix:/tmp/1.fcgi.socket; server unix:/tmp/2.fcgi.socket; } server { location /static/ { root /var/www; } location /favicon.ico { alias /var/www/static/favicon.ico; } location / { fastcgi_pass wsapi; include fastcgi_params; } } } -- lighttpd server.modules += ( "mod_rewrite" ) url.rewrite-once = ( "^/robots.txt" => "/static/robots.txt", "^/favicon.ico" => "/static/favicon.ico", "^/static/(.*)$" => "/static/$1", "^/(.*)" => "/wsapi.fcgi/$1", ) server.modules += ( "mod_fastcgi" ) fastcgi.server = ( "/wsapi.fcgi" => ( ( "socket" => "/tmp/1.fcgi.socket", "check-local" => "disable" ), ( "socket" => "/tmp/2.fcgi.socket", "check-local" => "disable" ), )) If you use bin-path and max-procs for each fastcgi server you can achieve better load handling, however this is being depreciated (and makes it impossible to pass launch args). From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 17:54:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NJsGUn021429; Fri, 23 Oct 2009 17:54:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF96F1A6CB; Fri, 23 Oct 2009 17:52:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FA9F1A6C5 for ; Fri, 23 Oct 2009 17:52:46 -0200 (BRST) Received: by ewy26 with SMTP id 26so9568760ewy.5 for ; Fri, 23 Oct 2009 12:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6YoyqOFw6FH7tfa79czmVxHBJccIG2nUqdx4OQVyZj8=; b=x7AkTfDyfaDPicXOZC/zIKBy3pus/GOJa1tEtexF9gunHNETvVkDd534kH5eEAQEtx jTuGLxK9nLu3zK+aT1Cu8Ym5ZmV7xGiXcMRIkKCyFJ30xyQcRwGQmr13XTELYovpRWYI wJbMCvQ+IrO9vZtimK8bn79ZHcB4w0i/z1j/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DuLpl9FUBx+FYAhTGxXtZU1IVJCz+RAf2jLiY6hdIjYlf0nsrlXTaHzQNqU+YsToAb 992IR8ggk+Px0jU/PU8jXum0q86UO/m/LUMO6DyaQ+1n6SPjQzAtP2My5Vj2jH4B5syr jiVLc8b96XHTdxMio5y2lZaItrmrMxkwYSslM= MIME-Version: 1.0 Received: by 10.216.90.210 with SMTP id e60mr4058427wef.120.1256327615102; Fri, 23 Oct 2009 12:53:35 -0700 (PDT) In-Reply-To: <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> Date: Fri, 23 Oct 2009 12:53:35 -0700 Message-ID: <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> Subject: Re: Userdata and the GC From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 11:17 AM, corey johnson wrote: > On Fri, Oct 23, 2009 at 10:48 AM, Sam Roberts wrote: >> If you actually need your obj-c code to make lua calls on the >> userdata, then you need a different >> system, you need to create a lua table that maps obj-c objects to the >> userdata they refer to (using >> lightuserdata). When an obj-c object is released, it will clear the >> mapping in the lua table. When lua >> has no mappings, then it will collect the userdata. > > Thanks Sam, > It's a little more complicated than I let on. For a little background, > I've written an obj-c <-> lua bridge > http://github.com/probablycorey/wax. > > The obj-c code actually calls Lua functions from userdata env, so I > need to use the userdata as the shared resource. I also currently have > a table with weak references that links the obj-c object to the > userdata, but don't have knowledge of when obj-c objects get released. > This is because I ask obj-c to create objects, I don't have knowledge > of when it is released. I also pass these objects off to other > methods, which then control the object's retain/release cycle. Ok, yes, I see your problem. obj-c is pretty flexible, you can probably attach a category or something to your obj-c objects, dynamically overriding the release message, and calling into lua land to keep it apprised of the obj-c ref count. How do other bindings deal with this? macruby, for example? Do they insert obj-c proxy objects? Anyhow, assuming you can't get notified by obj-c when an object is no longer needed, then if I understand you correctly, you have essentially implemented a polling mechanism, using lua's gc() sweep code, wherein you are attempting to find userdata that wraps an obj-c object with a retain count of exactly 1 (which means its only retainer is lua, and lua can release it). Instead of implementing this by hacking the gc, can you make the loop explicit? Add a poller to the ns run loop, make a STRONG lightuserdata -> userdata mapping table, and go through it periodically, looking for obj-c objects that are only referenced by lua? If only lua knows about them, remove them from the strong table, at which point lua's gc will release them if there are no other refs. I think all variations of this scheme are actually going to be heuristic. As long as the object is live in lua it can come back to life in obj-c, and vice versa. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 17:54:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NJsiYa021541; Fri, 23 Oct 2009 17:54:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA1351A6CF; Fri, 23 Oct 2009 17:53:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFF071A6C5 for ; Fri, 23 Oct 2009 17:53:20 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1QDC-0007oQ-4s for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 21:54:10 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 21:54:10 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 21:54:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: FastCGI daemon Date: Fri, 23 Oct 2009 12:53:05 -0700 Lines: 25 Message-ID: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> <7913df4d0910231124w313bf382xd12696bd7ec58065@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <7913df4d0910231124w313bf382xd12696bd7ec58065@mail.gmail.com> Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabio Mascarenhas wrote: > On Fri, Oct 23, 2009 at 3:33 PM, Stefan wrote: >> Jacob Jay wrote: >>> FastCGI is definitely the way to go, but if you haven't, do check out >>> wsapi-fcgi which is part of Kepler (http://keplerproject.org/). I use this >>> with spawn-fcgi and lighttpd/nginx. An additional FCGI-Lua interface may be >>> unnecessary unless you want it to do something notably different to that of >>> the Kepler WSAPI one. >> I was under the impression that wsapi-fcgi did NOT persist the scripts >> between invocations, unless you run each script as it's own fastcgi server. >> Running a couple dozen (at least) extra processes that MUST stay up at all >> times doesn't appeal to sysadmin in me. >> > > The generic wsapi.fcgi launcher does persist scripts (and each script > is isolated in its own Lua state), but each wsapi.fcgi process can > only serve a single request at a time, so you need to configure your > web server to keep multiple wsapi.fcgi workers to service concurrent > requests. wsapi.fcgi also reloads the script in a fresh Lua state if > the underlying file has been modified. So, does this mean that if you had say - 60 scripts - and were running 3 launchers, you would end up with a total of 180 Lua states (and connections to the DB or other backend storage)? From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 18:07:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NK7OJU023289; Fri, 23 Oct 2009 18:07:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 048391A6D0; Fri, 23 Oct 2009 18:06:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9607418592 for ; Fri, 23 Oct 2009 18:06:04 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1QPV-0004UA-5M for lua@bazar2.conectiva.com.br; Fri, 23 Oct 2009 22:06:53 +0200 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 22:06:53 +0200 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 22:06:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: FastCGI daemon Date: Fri, 23 Oct 2009 13:05:27 -0700 Lines: 43 Message-ID: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jacob Jay wrote: > > On 23 Oct 2009, at 11:03 PM, Stefan wrote: > >> I was under the impression that wsapi-fcgi did NOT persist the scripts >> between invocations, unless you run each script as it's own fastcgi >> server. > > Fabio has pitched in a concise answer on this point. I'd add that if > needed you could probably do high-performance shared data in your > solution using lindas amongst the threads, whereas with separate fastcgi > server processes I'm resorting to a solution something akin to a > memcached for Lua tables. Of course if you just use MySQL only the > persistence for the connection matters. (I was getting ~2500rps with > some MySQL queries and app logic.) > > >> Running a couple dozen (at least) extra processes that MUST stay up at >> all times doesn't appeal to sysadmin in me. >> >> My main criteria are: >> >> 1) lightweight >> 2) fast >> 3) reliable, even under extremely heavy loads >> 4) controllable and intelligent resource utilization >> 4) easy administration for critical installations > > Same here :) But I do think separate fcgi server processes are more > resilient and flexible, if not quite as manageable as a single > multi-threaded process. With balancing across the multiple processes (as > noted in my response to Bertrand, the number of processes would probably > only equal the number of cores), if one of them dies (or is > restarted...) the webserver/proxy will ignore it until it comes back, > and continue distributing requests amongst those that are still up. > I *was* planning on running at least two instances of the fastcgi daemon... I suppose the main difference left would be the threading and the tighter control on resource usage. How does wsapi-fcgi handle file modifications? Is it doing a file stat each request? From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 18:23:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NKN075025332; Fri, 23 Oct 2009 18:23:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 933F01A684; Fri, 23 Oct 2009 18:21:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D1761A684 for ; Fri, 23 Oct 2009 18:21:37 -0200 (BRST) Received: by qyk4 with SMTP id 4so6901079qyk.33 for ; Fri, 23 Oct 2009 13:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=/CZZuvgUFThMjlAMtcKdNX2AKanTY61eBPIPJ6ptzkg=; b=G19D6+y9o8uvfiD+ACSVUt6QCNgRz/kBGDwR9Npti0GYAOEO89kBuT1R6nytLDsPhw BUd7vYgHVVwSpCeuICnpodsc7k1DXD8at3J7WGXyiEx738mJaz7tBKtd5CNasBHQjeKc 53HiNFxyxhfC6vg7DoFWzJEJA6L8qkhc9jGSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=EwdKeVy5raxsf+OpWNQu1H0A1IIIjGf+mhQtVcsFMELXMl0HjnESBf/LTtpAlCaLrI O1VxwketVEvBwYOdFLTlhPQJCabNQOBuvNBggEFzwz/CCJCK38HD2WcZQDaQe1Wjc/pN qYxT0urRMIYl1Ly1CVKnXwJNstwbjk9j4kJK8= MIME-Version: 1.0 Received: by 10.224.117.14 with SMTP id o14mr5664889qaq.334.1256329346500; Fri, 23 Oct 2009 13:22:26 -0700 (PDT) In-Reply-To: References: <48F4BBFA-E255-4638-B5D9-C1F04700DF65@verse.org> <7913df4d0910231124w313bf382xd12696bd7ec58065@mail.gmail.com> Date: Fri, 23 Oct 2009 18:22:26 -0200 X-Google-Sender-Auth: 268ede28d9ac4406 Message-ID: <7913df4d0910231322k7cc2a88co24299f6a300281ca@mail.gmail.com> Subject: Re: FastCGI daemon From: Fabio Mascarenhas To: Lua list Content-Type: text/plain; charset=UTF-8 Cc: kepler-project@lists.luaforge.net X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 5:53 PM, Stefan wrote: > Fabio Mascarenhas wrote: >> >> The generic wsapi.fcgi launcher does persist scripts (and each script >> is isolated in its own Lua state), but each wsapi.fcgi process can >> only serve a single request at a time, so you need to configure your >> web server to keep multiple wsapi.fcgi workers to service concurrent >> requests. wsapi.fcgi also reloads the script in a fresh Lua state if >> the underlying file has been modified. > > So, does this mean that if you had say - 60 scripts - and were running 3 > launchers, you would end up with a total of 180 Lua states (and connections > to the DB or other backend storage)? > > Yep, the default setup trades memory consumption for application isolation, as Lua states are pretty lightweight. But it is trivial to have a wsapi.fcgi launcher without this isolation, you just have to change it to use wsapi.common.load_wsapi instead of wsapi.common.load_wsapi_isolated. But you also lose file reloading, so you have to kill your wsapi.fcgi processes if you change a script. Answering your other question, yes, wsapi.fcgi (with load_wsapi_isolated) does a fstat for each request. I would love to use some change notification service, but these are awfully non-portable, and it is already hard enough to deal with subtle incompatibilities among web servers. -- Fabio Mascarenhas From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 21:10:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NNAMQd013222; Fri, 23 Oct 2009 21:10:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 183051A6C9; Fri, 23 Oct 2009 21:09:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-01.prod.phx3.secureserver.net (p3plsmtpa01-01.prod.phx3.secureserver.net [72.167.82.81]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3C53C1A6B6 for ; Fri, 23 Oct 2009 21:08:54 -0200 (BRST) Received: (qmail 19636 invoked from network); 23 Oct 2009 23:09:41 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-01.prod.phx3.secureserver.net (72.167.82.81) with ESMTP; 23 Oct 2009 23:09:41 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Userdata and the GC From: Mark Hamburg In-Reply-To: <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> Date: Fri, 23 Oct 2009 16:09:40 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Here's the Lightroom solution. Note that this is working with reference counted Objective-C. Note also that it only matters for Objective-C objects that need to persist their Lua proxy because, for example, they have userdata environments. We keep a weak table mapping light userdata (the Objective-C object pointer) to full userdata (the Lua proxy for the object). Pushing an existing object from it's Objective-C reference is just a lookup. More clever code would probably use metamethods to do the proxy construction if it didn't already exist. That's all pretty much standard stuff. The weak table means that we will generate at most one proxy for the object in Lua and that that proxy will only stick around as long as there is a Lua reference to the object. But what if we want it to stick around longer because, for example, the Objective-C code needs to vector through the userdata environment to find other objects? Well, obviously, we need to create another reference in Lua. So, we maintain a table with a set of strongly referenced objects. An object needs to be in this table if we need to preserve it's Lua proxy and there exist references to it on the Objective-C side of the world. There's our invariant. How do we know if there are references on the Objective-C side of the world? There will be a reference other than the Lua proxy and hence the retain count will be greater than 1. So, we refine our invariant to, if an object needs to have its Lua proxy preserved and it has a retain count greater than 1, then it needs to be in the strong set. When we create the proxy, we know there must have been an Objective-C side reference, so we need to add the object to the strong set. When we read the pointer out of the proxy, the conservative behavior is to do a retain and an autorelease on the pointer and add it to the strong set. This will avoid having the pointer floating loose and potentially having its count get incremented from 1 to 2 where you can't see it happen. You avoid it by doing the increment yourself. Of course, that gets a bit expensive in auto-release pool space. You can reduce that cost by special casing self in your bridging code. So, now we've got things so that if the retain count goes above 1, we will guarantee membership in the strong set. How do we get things out of the set? Create a userdata object that exists purely to get collected and have its __gc metamethod called. When the metamethod gets called, scan the strong set looking for objects with retain counts of 1 and remove them from the set. Then create a new object to get collected on the next GC cycle. Provided the number of objects is small, you can do the scan quickly. Mark From lua-bounces@bazar2.conectiva.com.br Fri Oct 23 21:45:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9NNj7Uq015666; Fri, 23 Oct 2009 21:45:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 722811A6B5; Fri, 23 Oct 2009 21:43:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6BF61A689 for ; Fri, 23 Oct 2009 21:43:40 -0200 (BRST) Received: from fwd03.aul.t-online.de by mailout08.t-online.de with smtp id 1N1To5-0005xO-00; Sat, 24 Oct 2009 01:44:29 +0200 Received: from [192.168.178.25] (b7LMZqZLrhqmBcjkMe0yhtc0xutdqbTydC3vVS6Facd5bq1w5J7O7Px3Tmsq3mcQCq@[93.192.60.93]) by fwd03.t-online.de with esmtp id 1N1To2-2C8JA80; Sat, 24 Oct 2009 01:44:26 +0200 Subject: Re: LuaSNMP Windows Binary? From: Herbert Leuwer To: Lua list In-Reply-To: References: Content-Type: text/plain Organization: privat Date: Sat, 24 Oct 2009 01:44:31 +0200 Message-Id: <1256341471.25528.4.camel@goofy> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-ID: b7LMZqZLrhqmBcjkMe0yhtc0xutdqbTydC3vVS6Facd5bq1w5J7O7Px3Tmsq3mcQCq X-TOI-MSGID: 8b17615b-1d42-4cbd-ba01-bcda638db6c0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Am Mittwoch, den 21.10.2009, 10:42 -0700 schrieb John Dunn: > Is a Windows binary for LuaSNMP available anywhere? The only place I > found a possible reference was in Lua All In One but I'm not able to > download that package from luaforge for some reason. > > > > John > > Yes, under Cygwin. In addition to the binary Lua module you require the appropriate net-snmp library and the cygwin libs of course. Herbert From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 05:57:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9O7vpSE021030; Sat, 24 Oct 2009 05:57:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E0141A66A; Sat, 24 Oct 2009 05:56:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tilde.org (mail.tilde.org [209.177.145.230]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F380818BB1 for ; Sat, 24 Oct 2009 05:56:27 -0200 (BRST) Received: from [192.168.0.7] ([138.89.63.52]) (authenticated user ml@iridescent.org) by mail.tilde.org (Kerio MailServer 6.4.1 patch 1) for lua@bazar2.conectiva.com.br; Sat, 24 Oct 2009 00:57:07 -0700 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Sat, 24 Oct 2009 03:56:44 -0400 To: Lua list From: "Lawrence E. Bakst" Subject: Re: Better way to code an iterator function? Content-Type: text/plain; charset="us-ascii" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks for this and to the other poster as well who suggested the same thing. Very clean and I get it. FWIW one thing I was missing is that while you can return 3 values (f, state, var) to set up an iterator, you don't have to return/use all 3, which I guess is obvious, but somehow I missed it. At 11:18 AM +0100 10/23/09, Duncan Cross wrote: >On Fri, Oct 23, 2009 at 6:42 AM, Lawrence E. Bakst wrote: >> 1. Is there a better, shorter, cuter, or cooler way to code the example below? >> >> 2. I guess something I didn't try was to "deep copy" paths, use that as the state, and then remove one element at a time from the state. >> >> 3. This is probably FAQ, but I couldn't find much with a quick search on Google. >> >> I miss C's pre/post inc/dec operators and I can't be the only one. Is there any way to make inc and dec functions that increment or decrement the number passed in and return the previous value? Seems difficult in a language that only has pass by value for numbers and strings. > >Right, it isn't possible in standard Lua. > >> function it_paths(paths) >> local function next(state, var) >> if (state.idx > #paths) then return nil end; >> state.idx = state.idx + 1; >> return paths[state.idx - 1]; >> end >> local state = {idx = 1}; >> return next, state, ""; >> end; >> >> function process_random_files(paths) >> for path in it_paths(paths) do >> print(path); >> end >> end >> >> process_random_files{"foo", "bar", "baz", "quuz"}; > >It seems to me that what you want is to -either- use a dedicated local >function, like this: > > -- example 1 > local function it_paths_aux(state) > local idx = state.idx + 1 > state.idx = idx > return state.paths[idx] > end > > function it_paths(paths) > return it_paths_aux, {paths=paths, idx=0} > end > -- end example 1 > >...or if don't mind generating a closure each time, using an upvalue >to store the current state: > > -- example 2 > function it_paths(paths) > local idx = 0 > return function() > idx = idx + 1 > return paths[idx] > end > end > -- end example 2 > >-Duncan -- leb@iridescent.org From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 10:57:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9OCvqxo012684; Sat, 24 Oct 2009 10:57:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5CFE18D31; Sat, 24 Oct 2009 10:56:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B25118CF8 for ; Sat, 24 Oct 2009 10:56:27 -0200 (BRST) Received: from fwd04.aul.t-online.de by mailout08.t-online.de with smtp id 1N1gBG-0004A5-04; Sat, 24 Oct 2009 14:57:14 +0200 Received: from [192.168.178.25] (VajDSBZDQhY42HDJuRDQkC9LpH34rhkWdLMjpelJIwdAKXOYYqMeeVhK-tvZ-VFg72@[93.192.42.39]) by fwd04.t-online.de with esmtp id 1N1gBG-0hSHC40; Sat, 24 Oct 2009 14:57:14 +0200 Subject: Re: LuaSNMP Windows Binary? From: Herbert Leuwer To: Lua list In-Reply-To: <1256341471.25528.4.camel@goofy> References: <1256341471.25528.4.camel@goofy> Content-Type: text/plain Organization: privat Date: Sat, 24 Oct 2009 14:57:20 +0200 Message-Id: <1256389040.29260.2.camel@goofy> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-ID: VajDSBZDQhY42HDJuRDQkC9LpH34rhkWdLMjpelJIwdAKXOYYqMeeVhK-tvZ-VFg72 X-TOI-MSGID: 2bedacd2-887e-46fd-8c2b-7ee3ae855c0c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Am Samstag, den 24.10.2009, 01:44 +0200 schrieb Herbert Leuwer: > Am Mittwoch, den 21.10.2009, 10:42 -0700 schrieb John Dunn: > > Is a Windows binary for LuaSNMP available anywhere? The only place I > > found a possible reference was in Lua All In One but I'm not able to > > download that package from luaforge for some reason. > > > > > > > > John > > > > > Yes, under Cygwin. In addition to the binary Lua module you require the > appropriate net-snmp library and the cygwin libs of course. > > Herbert > I should have been more precise. LuaSNMP builds under Cygwin. If you are not able to compile the code, let me know offline. I can try to assemble a binary package for you. Herbert From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 13:27:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9OFRYLj025401; Sat, 24 Oct 2009 13:27:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F24C21A690; Sat, 24 Oct 2009 13:26:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DB7318EBE for ; Sat, 24 Oct 2009 13:26:03 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 1583E3806A688 for ; Sat, 24 Oct 2009 22:26:52 +0700 (NOVST) Message-ID: <002b01ca54be$68de77d0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br> Subject: Re: Metatables, C and Script... Date: Sat, 24 Oct 2009 22:26:48 +0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Sat, 24 Oct 2009 22:26:52 +0700 (NOVST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Are you sure? ----- Original Message ----- From: Kenk To: Lua list Sent: Saturday, October 24, 2009 1:29 AM Subject: Re: Metatables, C and Script... Okay, getting closer... Following page 123... Okay... I have AWindowClass defined in script. I set a field within that table to be another table object with a metatable I've defined in C. I 've __index AWindowClass. AWindowClass has a .new method which takes a table and set's that objects metatable to that of AWindowClass. So now O=AWindowClass.new{fields and stuff} ... When 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass and look in the prototype's table. which it finds...Problem is, the initial 'self' state isn't be passed through...as get's done when you reference a method with anObject:AFunction(); ----- Original Message ----- From: "Kenk" To: "Lua list" Sent: Friday, October 23, 2009 12:49 PM Subject: Re: Metatables, C and Script... > Hmm.. I see... I think page 123 accomplishes what I'm looking to do. let > me play with that... > > Thanks, > > Ken > ----- Original Message ----- > From: "Luiz Henrique de Figueiredo" > To: "Lua list" > Sent: Friday, October 23, 2009 11:40 AM > Subject: Re: Metatables, C and Script... > > >>> Or once you define a metatable for an object, you can't extend it at >>> all? >> >> A metatable is just a plain ordinary table. You can do anything to it. >> OTOH, you may choose to protect it from Lua code by adding >> __metatable=false >> to it. >> > > From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 17:08:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9OJ8ZJH012025; Sat, 24 Oct 2009 17:08:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 765B21A6A5; Sat, 24 Oct 2009 17:07:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 300C71A66D for ; Sat, 24 Oct 2009 17:07:10 -0200 (BRST) Received: by ywh40 with SMTP id 40so7307088ywh.33 for ; Sat, 24 Oct 2009 12:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Q6CQYCcWRGVfixpz6zZyMg4+B6JeL1Eq1+f8sFXv3p0=; b=hMRd7TnC5TH3nFzjDXBrnItw5UXmqvfkWhn9sD1O2s9agVDwb90u8dFLS8KW82Iw/d 2tucbkT/GOsj0OKLGj6veH9pyZb3hYw2ZJyVSgl3lJtJS2gYs+MNmLcLYyyWzyojCIcK yZU2mxff2SkS24N33R83Yc1G2fIlUA+pLHEGw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=o2uMaZW0klvfw+ZYslO6ZboUC4o9IBj7XDJZ2Oz0L1Qo0GDu1FYm7zI1zan70v+krQ fom5on/neRzFEQt+5bArRJJLfiF+tu8IYdQaQHiROGCySykGN94T4DBnuf3J3Wx7tT8u GGkm0t7CmU0BRXFAd0XvkRSHu/zfCu3jN65uA= MIME-Version: 1.0 Received: by 10.101.195.34 with SMTP id x34mr7540888anp.175.1256411280150; Sat, 24 Oct 2009 12:08:00 -0700 (PDT) In-Reply-To: References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> From: corey johnson Date: Sat, 24 Oct 2009 12:07:40 -0700 Message-ID: <5a4c9d880910241207y1e810556k696a510731c678fe@mail.gmail.com> Subject: Re: Userdata and the GC To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks Mark and Sam! I like how both approaches will move me away from hacking the GC. I'm going to play around with "userdata GC trigger object" it sounds like the simplest approach. But adding a poller to the NSRunLoop may turn out to be better on a mobile device. Thanks Again, Corey From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 21:09:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ON93TI028050; Sat, 24 Oct 2009 21:09:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7761818658; Sat, 24 Oct 2009 21:07:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A50C18624 for ; Sat, 24 Oct 2009 21:07:30 -0200 (BRST) Received: by fxm12 with SMTP id 12so11514543fxm.5 for ; Sat, 24 Oct 2009 16:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0aeh2jrGFfitHY/Nt/qErXVjzdKXVywew5bvCThVFjM=; b=ZABoLIOp2QQbsoyYA2JgLZqof0AEHftlrTvgXXiUuWN9m3Ja4sufTlT+aeDihpxM+y if8J28VN8IISDTnCEa70Mt8PkqOVQicQhxvxz8YbbUGoBYseLX3SDH5zQ9sXPRLvmzUp lGuOzyaTkAVOgvZby2nrwZ++tO6hoqhOPtR9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=L5B+DOiXjKi2nENSXiBlJqRvLCzEtLLIhIZjRbwPYp+0/3e7YrmUKX+bkoEOPDCmPX kXSW0oS66AaeGXDVprHjkcoYfiO2x3S0Z+2pZXQXDpvRzU5BfO/gODRSzunvzzBLcqad VJZJC+8F1PUXiPLuuYr8Gvpr0mdzSn8jjDbOk= MIME-Version: 1.0 Received: by 10.223.5.18 with SMTP id 18mr1539127fat.58.1256425699578; Sat, 24 Oct 2009 16:08:19 -0700 (PDT) In-Reply-To: References: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> Date: Sun, 25 Oct 2009 01:08:19 +0200 Message-ID: <76882e540910241608o715ac9b7ie9c148a8ac628221@mail.gmail.com> Subject: Re: Running the test suite on Windows From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=0015174783848293e10476b66711 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174783848293e10476b66711 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable No, really. :) Did anyone run the test suite on Windows? With which compiler? Does it supposed to compile? Does it supposed to pass? Muito obrigado, Uri 2009/10/23 Lu=EDs Eduardo Jason Santos > Lots of free memory. :-) > > Lu=EDs Eduardo Jason Santos > > > > On Thu, Oct 22, 2009 at 9:17 PM, uri cohen wrote: > >> Is the lua test suite from >> http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gzexpected to work on Windows= ? >> Any special configuration required? >> >> Thanks! >> Uri Cohen >> > > --=20 Uri Cohen --0015174783848293e10476b66711 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
No, really. :)
Did anyone run the test suite on Windows= ? With which compiler? Does it supposed to compile? Does it supposed to pas= s?
Muito obrigado,
=A0=A0=A0=A0=A0=A0=A0=A0 Uri

2009/10/23 Lu=EDs Eduardo Jason Santos &= lt;jasonsantos@gmail.com>
Lots of free memo= ry. :-)

Lu=EDs Eduardo Jason = Santos



On Thu, Oct 22, 2009 at 9:17 PM, uri coh= en <uri.cohen@gmail.com> wrote:
Is the lua test suite from http://www.inf.= puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz expected to work on Windows= ?
Any special configuration required?

Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen




--

=A0 =A0 =A0 =A0 = =A0 =A0Uri Cohen
--0015174783848293e10476b66711-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 24 21:37:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ONbshQ030439; Sat, 24 Oct 2009 21:37:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B4181A6D0; Sat, 24 Oct 2009 21:36:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp110.rog.mail.re2.yahoo.com (smtp110.rog.mail.re2.yahoo.com [206.190.37.120]) by bazar2.conectiva.com.br (Postfix) with SMTP id 7F9E91A672 for ; Sat, 24 Oct 2009 21:36:35 -0200 (BRST) Received: (qmail 15721 invoked from network); 24 Oct 2009 23:37:24 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp110.rog.mail.re2.yahoo.com with SMTP; 24 Oct 2009 16:37:23 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: _Fxc.5AVM1lo.8k_2poMslD0f.vxGHq9EGNNfSgr6IXpyhgtDv9zuBi0mgrBV7Pkww-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> From: "Kenk" To: "Lua list" References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br> <002b01ca54be$68de77d0$6600a8c0@sat3> In-Reply-To: <002b01ca54be$68de77d0$6600a8c0@sat3> Subject: Re: Metatables, C and Script... Date: Sat, 24 Oct 2009 19:37:23 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ummm... If I say yes, will you tell me I'm wrong and proceed to explain how it works and what I'm missing? ----- Original Message ----- From: "GrayFace" To: "Lua list" Sent: Saturday, October 24, 2009 11:26 AM Subject: Re: Metatables, C and Script... > Are you sure? > > > > > > > ----- Original Message ----- > From: Kenk > To: Lua list > Sent: Saturday, October 24, 2009 1:29 AM > Subject: Re: Metatables, C and Script... > > > Okay, getting closer... > > Following page 123... > > Okay... I have AWindowClass defined in script. I set a field within that > table to be another table object with a metatable I've defined in C. I 've > __index AWindowClass. AWindowClass has a .new method which takes a table > and > set's that objects metatable to that of AWindowClass. > > So now O=AWindowClass.new{fields and stuff} ... When > 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass > and > look in the prototype's table. which it finds...Problem is, the initial > 'self' state isn't be passed through...as get's done when you reference a > method with anObject:AFunction(); > > > > ----- Original Message ----- > From: "Kenk" > To: "Lua list" > Sent: Friday, October 23, 2009 12:49 PM > Subject: Re: Metatables, C and Script... > > >> Hmm.. I see... I think page 123 accomplishes what I'm looking to do. let >> me play with that... >> >> Thanks, >> >> Ken >> ----- Original Message ----- >> From: "Luiz Henrique de Figueiredo" >> To: "Lua list" >> Sent: Friday, October 23, 2009 11:40 AM >> Subject: Re: Metatables, C and Script... >> >> >>>> Or once you define a metatable for an object, you can't extend it at >>>> all? >>> >>> A metatable is just a plain ordinary table. You can do anything to it. >>> OTOH, you may choose to protect it from Lua code by adding >>> __metatable=false >>> to it. >>> >> >> > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 08:11:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PABU5m026796; Sun, 25 Oct 2009 08:11:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AF8C1A6D0; Sun, 25 Oct 2009 08:10:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9B3E1A65A for ; Sun, 25 Oct 2009 08:10:05 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N203o-0003RX-J5 for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 11:10:52 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N203n-00083l-Ri for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 11:10:51 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Support of kepler, sputnik, etc and security risks References: <5ba75e2f0910162354h6aafad40y81336334bf53d9c8@mail.gmail.com> <5fe281d40910170203o7afd978es4f102b17eefcde96@mail.gmail.com> <4ADA2B78.2080001@cowlark.com> <4ADC39B3.5090901@cowlark.com> Date: Sun, 25 Oct 2009 11:10:51 +0100 In-Reply-To: <4ADC39B3.5090901@cowlark.com> (David Given's message of "Mon, 19 Oct 2009 11:04:35 +0100") Message-ID: <87my3fdbro.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9PABU5m026796 * David Given: > Interestingly, after posting my message I tried resolving the > addresses; and it turns out that www.google.com and www.ð ð¨ð¨ð ð¥ðž.com > both appear to resolve to the same address... as does > www.google.ðœð¨ð¦. (Using the bold versions of the characters here to > make them visible --- these are all from U+1D400 MATHEMATICAL BOLD.) > So it certainly looks like something is remapping at least some > letter-like glyphs to actual ASCII. I don't know whether that's my > Linux system or part of DNS. It's part of IDNA normalization implemented in the application/browser (it's called Nameprep IIRC). From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 10:44:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PCiGXH006822; Sun, 25 Oct 2009 10:44:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A362218AE7; Sun, 25 Oct 2009 10:42:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7195618A58 for ; Sun, 25 Oct 2009 10:42:54 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N22Ri-0005rk-G9 for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 13:43:42 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N22Rh-0000Zj-VV for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 13:43:42 +0100 From: Florian Weimer To: Subject: Interning strings considered harmful (somewhat) Date: Sun, 25 Oct 2009 13:43:41 +0100 Message-ID: <87eiorabk2.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The second part of the following benchmark shows distinctly non-linear performance: Each pass of the first part runs under one second on my machine, but the passes in the second part take 4, 14, and 32 seconds, respectively. I'm a bit worried by this, and the impact on programs which process data from untrusted inputs. I haven't got a really good idea what can be done about this. In similar cases, people have used Jenkins' lookup3.c hash function with a random seed. Perhaps it is sufficient to drop the skipping from Lua's hash function and use a random seed stored in the Lua state, but the internal mixing of the current hash function seems to be rather weak. local function intersperse(s, ch) local t = {string.byte(s, 1, #s)} for i=1,#t do t[i] = string.char(t[i]) end return table.concat(t, ch) end local function magic(s, i) return s .. intersperse(tostring(i), '-') .. s end local function f(s, count) local t = {} for i=10000,10000 + count - 1 do local s1 = magic(s, i) t[#t + 1] = s1 end end local function bench(f, ...) local stime = os.time() f(...) local etime = os.time() return etime - stime end -- part 1 print(bench(f, "@@@@@@@@@@@@@@@@", 10000)) print(bench(f, "@@@@@@@@@@@@@@@@", 20000)) print(bench(f, "@@@@@@@@@@@@@@@@", 30000)) -- part 2 print(bench(f, "@@@@@@@@@@@@@@@@@", 10000)) print(bench(f, "@@@@@@@@@@@@@@@@@", 20000)) print(bench(f, "@@@@@@@@@@@@@@@@@", 30000)) From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 19:41:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PLfgOl021178; Sun, 25 Oct 2009 19:41:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BC351839C; Sun, 25 Oct 2009 19:40:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EFEA18398 for ; Sun, 25 Oct 2009 19:40:13 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2Ape-00019Z-2G for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 21:40:58 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 1BC801523E for ; Sun, 25 Oct 2009 21:40:57 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:41761 with envelope Message-ID: <4AE4C5E5.8060506@cowlark.com> Date: Sun, 25 Oct 2009 21:40:53 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Lua syntax gotcha X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9PLfgOl021178 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I recently found this, and thought it was worth bringing to people's attention: function test() print(1) return print(2) end test() - -> 1 2 Surprised? I was, until I realised what was going on --- remember that return and break must be the *last* statement of a chunk; the code is being parsed like this: function test() print(1) return (print(2)) end The second print statement is emitting '2' as a side effect and returning nil. This, of course, does what I expect: function test() print(1) do return end print(2) end ...and if there's more than one statement after the return then the code won't compile and it's obvious what's going on. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK5MXif9E0noFvlzgRAgb/AJ9IMYSddQYHJE+K5MMCukMkw9uA1ACff6i+ ALEo+8k3XGhJDqeoZSYhkdo= =Agah -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 19:53:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PLrZhb022436; Sun, 25 Oct 2009 19:53:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24D111A6C2; Sun, 25 Oct 2009 19:52:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1E671A614 for ; Sun, 25 Oct 2009 19:52:14 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 0F32439A61EEB for ; Mon, 26 Oct 2009 03:53:04 +0600 (NOVT) Message-ID: <001201ca55bd$85bc71e0$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br><002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> Subject: Re: Metatables, C and Script... Date: Mon, 26 Oct 2009 03:52:58 +0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Mon, 26 Oct 2009 03:53:04 +0600 (NOVT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br All 'obj:method' calls must pass 'obj' as the first parameter to function, no metter what type 'obj' is. So it's extremely wierd if it doesn't. I haven't tried this on objects, but it works well with strings and numbers. Maybe I couldn't understand what your problem is. ----- Original Message ----- From: Kenk To: Lua list Sent: Sunday, October 25, 2009 5:37 AM Subject: Re: Metatables, C and Script... Ummm... If I say yes, will you tell me I'm wrong and proceed to explain how it works and what I'm missing? ----- Original Message ----- From: "GrayFace" To: "Lua list" Sent: Saturday, October 24, 2009 11:26 AM Subject: Re: Metatables, C and Script... > Are you sure? > > > > > > > ----- Original Message ----- > From: Kenk > To: Lua list > Sent: Saturday, October 24, 2009 1:29 AM > Subject: Re: Metatables, C and Script... > > > Okay, getting closer... > > Following page 123... > > Okay... I have AWindowClass defined in script. I set a field within that > table to be another table object with a metatable I've defined in C. I 've > __index AWindowClass. AWindowClass has a .new method which takes a table > and > set's that objects metatable to that of AWindowClass. > > So now O=AWindowClass.new{fields and stuff} ... When > 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass > and > look in the prototype's table. which it finds...Problem is, the initial > 'self' state isn't be passed through...as get's done when you reference a > method with anObject:AFunction(); > > > > ----- Original Message ----- > From: "Kenk" > To: "Lua list" > Sent: Friday, October 23, 2009 12:49 PM > Subject: Re: Metatables, C and Script... > > >> Hmm.. I see... I think page 123 accomplishes what I'm looking to do. let >> me play with that... >> >> Thanks, >> >> Ken >> ----- Original Message ----- >> From: "Luiz Henrique de Figueiredo" >> To: "Lua list" >> Sent: Friday, October 23, 2009 11:40 AM >> Subject: Re: Metatables, C and Script... >> >> >>>> Or once you define a metatable for an object, you can't extend it at >>>> all? >>> >>> A metatable is just a plain ordinary table. You can do anything to it. >>> OTOH, you may choose to protect it from Lua code by adding >>> __metatable=false >>> to it. >>> >> >> > > From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:01:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PM1UaM023493; Sun, 25 Oct 2009 20:01:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B0271A6DA; Sun, 25 Oct 2009 20:00:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC2601A6C4 for ; Sun, 25 Oct 2009 20:00:10 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:49183) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1N2B8n-0002fP-5B (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Sun, 25 Oct 2009 22:00:45 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N2B8n-0002xQ-J4 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Sun, 25 Oct 2009 22:00:45 +0000 Date: Sun, 25 Oct 2009 22:00:45 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Interning strings considered harmful (somewhat) In-Reply-To: <87eiorabk2.fsf@mid.deneb.enyo.de> Message-ID: References: <87eiorabk2.fsf@mid.deneb.enyo.de> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 25 Oct 2009, Florian Weimer wrote: > > I'm a bit worried by this, and the impact on programs which process > data from untrusted inputs. I haven't got a really good idea what can > be done about this. In similar cases, people have used Jenkins' > lookup3.c hash function with a random seed. Perhaps it is sufficient > to drop the skipping from Lua's hash function and use a random seed > stored in the Lua state, but the internal mixing of the current hash > function seems to be rather weak. Your observation reminds me of this paper which studies the robustness of state table lookups in firewalls: http://www.maths.tcd.ie/~dwmalone/p/ec2nd08.pdf Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:02:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PM2Gh6023639; Sun, 25 Oct 2009 20:02:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62DB51A6EC; Sun, 25 Oct 2009 20:01:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7D2A1A6C4 for ; Sun, 25 Oct 2009 20:00:59 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2B9l-0002tt-KW for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 22:01:45 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id E34251523E for ; Sun, 25 Oct 2009 22:01:44 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:40132 with envelope Message-ID: <4AE4CAC6.4030404@cowlark.com> Date: Sun, 25 Oct 2009 22:01:42 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Metatables, C and Script... References: <4AE17CAF.5090005@gmail.com><4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9PM2Gh6023639 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kenk wrote: [...] > So now O=AWindowClass.new{fields and stuff} ... When > 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass > and look in the prototype's table. which it finds...Problem is, the > initial 'self' state isn't be passed through...as get's done when you > reference a method with anObject:AFunction(); That's because you're calling it with . and not :, if I've understood you correctly. foo:bar() is syntactic sugar for foo.bar(foo). There's nothing magical about methods, unlike Javascript... so if you forget to use : (which I do periodically), then all the parameters are wrong. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK5MrFf9E0noFvlzgRAqTxAKCaoDAki4c8nu4WE4mzD8i3ebLE7wCgx/c/ U2L93D5VSXx5UlR9lRx86xo= =ry65 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:13:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PMDLFg024430; Sun, 25 Oct 2009 20:13:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D2C51A6F3; Sun, 25 Oct 2009 20:12:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D87381A6EF for ; Sun, 25 Oct 2009 20:11:54 -0200 (BRST) Received: by bwz27 with SMTP id 27so1759111bwz.21 for ; Sun, 25 Oct 2009 15:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=jFrSh1R9rusmOyf0ITbFAfE4DeGUgt8J5gwMi/lOloE=; b=kmeqccvYvR8JNr79UgievatRNZG858VzsylVJrXsl9xIjaJvrtUM20KtOBNFKcI/iG oElD0Kusjj9lYLBT8Qurup09+rQqdBlPPE2RMjW8b9+Q4lhPRzxQgwDgZ+nIDHFHhai9 AV5DTLFG/anTYe9Asd46ZTydpdZIGEfylxby4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=q4EA4wBJ0HbFQxfCbxWxC95CKI6/adJbuRRQZPrQHYePm+uA+XxkFiK92LekFBnd88 XNxi4BEdU/jKCoNMqPq51M+9HxrdHSyEaKmirhuwJWGq+Xfx7z7DxqB1YqsQWxDomwQC betmj4Mi2LwzGk/nYcDF3Dfk6J3yE8OpQBgXQ= MIME-Version: 1.0 Received: by 10.204.25.207 with SMTP id a15mr93823bkc.8.1256508765429; Sun, 25 Oct 2009 15:12:45 -0700 (PDT) In-Reply-To: <001201ca55bd$85bc71e0$6600a8c0@sat3> References: <4AE1B9B7.2050706@gmail.com> <20091023134032.A9833@lua.tecgraf.puc-rio.br> <002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> <001201ca55bd$85bc71e0$6600a8c0@sat3> Date: Sun, 25 Oct 2009 17:12:45 -0500 X-Google-Sender-Auth: bf3f3d58f86c89e1 Message-ID: <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> Subject: Re: Metatables, C and Script... From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0003255579569ee07b0476c9be85 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255579569ee07b0476c9be85 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > > All 'obj:method' calls must pass 'obj' as the first parameter to function= , > no metter what type 'obj' is. So it's extremely wierd if it doesn't. I > haven't tried this on objects, but it works well with strings and numbers= . > Maybe I couldn't understand what your problem is. I'm curious about why following does not works: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > t=3D{'a','a'} > print(t:concat()) stdin:1: attempt to call method 'concat' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > Blessings! --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0003255579569ee07b0476c9be85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
All 'obj:method' calls must pass 'obj' as the first parameter t= o function, no metter what type 'obj' is. So it's extremely wierd if it doe= sn't. I haven't tried this on objects, but it works well with strings and numbers. Maybe I couldn't understand what your problem is.
=

I'm curious about why following does not works:

Lua 5.= 1.4=C2=A0 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> t=3D{'a'= ,'a'}
> print(t:concat())
stdin:1: attempt to call method 'concat' = (a nil value)
stack traceback:
=C2=A0=C2=A0=C2=A0 stdin:1: in main ch= unk
=C2=A0=C2=A0=C2=A0 [C]: ?
>


Blessings!
--
Fe= rnando P. Garc=C3=ADa, http://www.devel= cuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina= Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje pien= sa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. <= br> --0003255579569ee07b0476c9be85-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:14:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PMElHJ024563; Sun, 25 Oct 2009 20:14:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78A801A6F8; Sun, 25 Oct 2009 20:13:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 538D31A6F4 for ; Sun, 25 Oct 2009 20:13:34 -0200 (BRST) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS30034PCF37P80@asmtp011.mac.com> for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 15:14:23 -0700 (PDT) Message-id: <55B09F24-6408-4AE0-BDF5-3CDC55DF12EA@mac.com> From: Petite Abeille To: Lua list In-reply-to: <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> Subject: Re: Metatables, C and Script... Date: Sun, 25 Oct 2009 23:13:50 +0100 References: <4AE1B9B7.2050706@gmail.com> <20091023134032.A9833@lua.tecgraf.puc-rio.br> <002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> <001201ca55bd$85bc71e0$6600a8c0@sat3> <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9PMElHJ024563 On Oct 25, 2009, at 11:12 PM, Fernando P. García wrote: > I'm curious about why following does not works: No metatable From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:16:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PMGrPx024790; Sun, 25 Oct 2009 20:16:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49AC31A6FC; Sun, 25 Oct 2009 20:15:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 527791A6F2 for ; Sun, 25 Oct 2009 20:15:37 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 96C5A3806E147 for ; Mon, 26 Oct 2009 04:16:27 +0600 (NOVT) Message-ID: <003a01ca55c0$ca4bd690$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4AE1B9B7.2050706@gmail.com><20091023134032.A9833@lua.tecgraf.puc-rio.br><002b01ca54be$68de77d0$6600a8c0@sat3><82E3E44C1AD94071881E2ACC9A4264E6@MobileDev><001201ca55bd$85bc71e0$6600a8c0@sat3> <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> Subject: Re: Metatables, C and Script... Date: Mon, 26 Oct 2009 04:16:24 +0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Mon, 26 Oct 2009 04:16:27 +0600 (NOVT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Because tables have their own metatables, there's may not be global metatable for all tables. Same for full userdata. Dunno about lightweights. ----- Original Message ----- From: Fernando P. García To: Lua list Sent: Monday, October 26, 2009 4:12 AM Subject: Re: Metatables, C and Script... All 'obj:method' calls must pass 'obj' as the first parameter to function, no metter what type 'obj' is. So it's extremely wierd if it doesn't. I haven't tried this on objects, but it works well with strings and numbers. Maybe I couldn't understand what your problem is. I'm curious about why following does not works: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > t={'a','a'} > print(t:concat()) stdin:1: attempt to call method 'concat' (a nil value) stack traceback: stdin:1: in main chunk [C]: ? > Blessings! -- Fernando P. García, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Perú ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de tí. From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 20:54:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PMsOY1027821; Sun, 25 Oct 2009 20:54:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2393F1A600; Sun, 25 Oct 2009 20:53:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D26371A692 for ; Sun, 25 Oct 2009 20:52:53 -0200 (BRST) Received: by fxm12 with SMTP id 12so11977102fxm.5 for ; Sun, 25 Oct 2009 15:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=cYLD5RgVAkrY+0pv7LaFaVUrWvh9dCpGekFDYB46L2s=; b=fjWIUPzAP8xpCKb2Sd1rbg7LxoVWeGSIi2h0V3Cc8xVgmXbhrf16QK1HafZgB1kO+H TNLmUcRTX0UE/LafDAUCHPnOywdp1ir4Y/pzn+OvuvfMfD7zZkb8XbYAH8X3c6GjNBMI Xegb2suWta4bY2FCYDTRTCpDD2ZU+h0R7rzf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZYdmBqJVZwnGm3xrJ1XtT3YujKJPvArVC7x18M6a35IRUk696uk+xHjWofxBoZHbuY ePsBWy/IjQEUqbR20WP4oQEBKele942xg9BTN6fDNzR8sB3LYiUHO8037EFeHWet/ots rsU6DlzA0uANS2b3AlWejPoTi5kF8XB0KNOng= MIME-Version: 1.0 Received: by 10.204.19.144 with SMTP id a16mr3579998bkb.9.1256511223403; Sun, 25 Oct 2009 15:53:43 -0700 (PDT) In-Reply-To: <003a01ca55c0$ca4bd690$6600a8c0@sat3> References: <20091023134032.A9833@lua.tecgraf.puc-rio.br> <002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> <001201ca55bd$85bc71e0$6600a8c0@sat3> <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> <003a01ca55c0$ca4bd690$6600a8c0@sat3> Date: Sun, 25 Oct 2009 17:53:43 -0500 X-Google-Sender-Auth: c3cc53b167ab61a4 Message-ID: <5ba75e2f0910251553k689ab766p6f1fffcd806a73a@mail.gmail.com> Subject: Re: Metatables, C and Script... From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000325558b4e2095b20476ca5101 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325558b4e2095b20476ca5101 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you, how can I "fix" that in pure lua? On Sun, Oct 25, 2009 at 5:16 PM, GrayFace wrote: > Because tables have their own metatables, there's may not be global > metatable for all tables. Same for full userdata. Dunno about lightweight= s. > > > > > > > > > ----- Original Message ----- From: Fernando P. Garc=C3=ADa > To: Lua list > Sent: Monday, October 26, 2009 4:12 AM > > Subject: Re: Metatables, C and Script... > > > All 'obj:method' calls must pass 'obj' as the first parameter to function= , > no metter what type 'obj' is. So it's extremely wierd if it doesn't. I > haven't tried this on objects, but it works well with strings and numbers= . > Maybe I couldn't understand what your problem is. > > I'm curious about why following does not works: > > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > >> t=3D{'a','a'} >> print(t:concat()) >> > stdin:1: attempt to call method 'concat' (a nil value) > stack traceback: > stdin:1: in main chunk > [C]: ? > >> >> > > Blessings! > -- > Fernando P. Garc=C3=ADa, http://www.develcuy.com > Developer - Analista de Sistemas > +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA > > ** Antes de imprimir este mensaje piensa en tu compromiso con el medio > ambiente, protegerlo depende de t=C3=AD. > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000325558b4e2095b20476ca5101 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you, how can I "fix" that in pure lua?

On Sun, Oct 25, 2009 at 5:16 PM, GrayFace &= lt;sergroj@mail.ru> wrote:=
Because tables ha= ve their own metatables, there's may not be global metatable for all ta= bles. Same for full userdata. Dunno about lightweights.








----- Original Message ----- From: Fernando P. Garc=C3=ADa
To: Lua list
Sent: Monday, October 26, 2009 4:12 AM

Subject: Re: Metatables, C and Script...


All 'obj:method' calls must pass 'obj' as the first paramet= er to function, no metter what type 'obj' is. So it's extremely= wierd if it doesn't. I haven't tried this on objects, but it works= well with strings and numbers. Maybe I couldn't understand what your p= roblem is.

I'm curious about why following does not works:

Lua 5.1.4 =C2=A0Copyright (C) 1994-2008 Lua.org, PUC-Rio
t=3D{'a','a'}
print(t:concat())
stdin:1: attempt to call method 'concat' (a nil value)
stack traceback:
=C2=A0 stdin:1: in main chunk
=C2=A0 [C]: ?



Blessings!
--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambi= ente, protegerlo depende de t=C3=AD.




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000325558b4e2095b20476ca5101-- From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 21:00:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9PN01q0028225; Sun, 25 Oct 2009 21:00:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C36E21A6EF; Sun, 25 Oct 2009 20:58:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14A141A692 for ; Sun, 25 Oct 2009 20:58:42 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2C3b-0006g2-4x for lua@bazar2.conectiva.com.br; Sun, 25 Oct 2009 22:59:27 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id D1E111F1BF for ; Sun, 25 Oct 2009 22:59:26 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:51803 with envelope Message-ID: <4AE4D84A.8040308@cowlark.com> Date: Sun, 25 Oct 2009 22:59:22 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Metatables, C and Script... References: <20091023134032.A9833@lua.tecgraf.puc-rio.br> <002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> <001201ca55bd$85bc71e0$6600a8c0@sat3> <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> <003a01ca55c0$ca4bd690$6600a8c0@sat3> <5ba75e2f0910251553k689ab766p6f1fffcd806a73a@mail.gmail.com> In-Reply-To: <5ba75e2f0910251553k689ab766p6f1fffcd806a73a@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9PN01q0028225 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fernando P. García wrote: > Thank you, how can I "fix" that in pure lua? Do this: setmetatable(t, {__index=table}) ...for each and every table that you want to act like this. You can't do it globally. However, this will cause you problems down the line, because: (a) if you want to set a different metatable on one of your tables, that table will suddenly start behaving differently; (b) your table's contents will suddenly become pulluted with the contents of the table utility library; For example: t:sort() t["sart"] = 1 t["sert"] = 1 t["sirt"] = 1 t["sort"] = 1 t["surt"] = 1 t:sort() -- crash! If you want to deal with object-oriented data structures in Lua, your best bet is to build your own rather than trying to extend tables like this --- less problematic. (This is one of the places where Lua's non-object-oriented philosophy really shows through.) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK5NhKf9E0noFvlzgRAuuTAKCJDBwOlzpNhgkK1kO/b5hHbSw5ZACg2E95 HnwYDeDRI6bp3O74BJIA2+s= =5mPL -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Oct 25 22:46:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9Q0ktWC005789; Sun, 25 Oct 2009 22:46:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 380681A6EB; Sun, 25 Oct 2009 22:45:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B11FC1A6CA for ; Sun, 25 Oct 2009 22:45:23 -0200 (BRST) Received: by ewy26 with SMTP id 26so10872149ewy.5 for ; Sun, 25 Oct 2009 17:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=RmTH77KGNd+fDwAybrlYWlpqCkJbBYpbRo2KmUoMlgs=; b=JKBROlXt37LHxlh0jHvu2zcSngxHVKHqPx9IHlxoL5DX0x+CYUnATg6rLQh3fj9ds2 z3B4VRI0mAUBA0pzYaY9ynXut8PKcG1DU3wkzVCk8c28pPmf5Zdu0vGZ5pd5eGk3FMw5 fkpA08cOCm3kBQbmkN5xTg/J94uASUi2huZFg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=he7si0FGO5jv2adhxQDKClaDFPzCWopIrowJfj8+UdMFg1tEdo5gvYz8gM30qKdd8X YhggKwJ+GKEVNmcJtFSxEDKRe4Pm+8FvrQV9sAZ4MkpYobwrbn7bnfeqazchin6Y0JWq OUHPGpSDYB/PeLnNTZVKaWG+OP5ydokLANj6Y= MIME-Version: 1.0 Received: by 10.216.85.137 with SMTP id u9mr5096888wee.214.1256517973091; Sun, 25 Oct 2009 17:46:13 -0700 (PDT) In-Reply-To: <4AE4D84A.8040308@cowlark.com> References: <002b01ca54be$68de77d0$6600a8c0@sat3> <82E3E44C1AD94071881E2ACC9A4264E6@MobileDev> <001201ca55bd$85bc71e0$6600a8c0@sat3> <5ba75e2f0910251512mb0afc90wa16aa82428e4bedd@mail.gmail.com> <003a01ca55c0$ca4bd690$6600a8c0@sat3> <5ba75e2f0910251553k689ab766p6f1fffcd806a73a@mail.gmail.com> <4AE4D84A.8040308@cowlark.com> From: Jerome Vuarand Date: Mon, 26 Oct 2009 01:45:53 +0100 Message-ID: <89d273ba0910251745s696f7f99h5d26f74acad534af@mail.gmail.com> Subject: Re: Metatables, C and Script... To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/25 David Given : > If you want to deal with object-oriented data structures in Lua, your > best bet is to build your own rather than trying to extend tables like > this --- less problematic. (This is one of the places where Lua's > non-object-oriented philosophy really shows through.) I think the good advice is to use something more complex than simply setting a metatable to a table and consider it an object. However you don't have to do it yourself. The LOOP library [1] provides several very complete object models to create table-based objects. And even if you don't find the model matching your dreams, one of these is probably a good starting point. [1] http://loop.luaforge.net/ From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 08:33:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QAXEX0029372; Mon, 26 Oct 2009 08:33:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 991B01A6E9; Mon, 26 Oct 2009 08:31:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 934071A5A9 for ; Mon, 26 Oct 2009 08:31:35 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so4252298fgg.17 for ; Mon, 26 Oct 2009 03:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=yZ5TQY+lyebIk56DtpZCJMxhCb9hjcwPeeHaIjLI6LE=; b=rCeJMEVWj/dtiTt641uR2Voa2UJ9r2GYl/kjQIi3NB815/551668v4ikzojjgjBPy1 acufizofrL4JjQurTfFFpW2cy3v+NZoKtOvHM5OjR2iYrU9P8FH7iqdWZVDkkjXYK2vy yz8SjAlEJdd2RYwmIf/LxVozTlW16R4NCqjGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=G+xJYAA3Ab14ZSFdXifKAouhFrqSGHP1eY0dCHn6PYUvpVHClQBYrFeg4WkbZBBhPZ B9p+/gr4VasCnCXOMWNdncCMuNgoCuRHfGQ2Ils6tYbrGji/7wGsgajMmf+y9FXSLHY3 UVELImRQAbyGdvBUn3sR+VKw18Oe8XTt2t9oc= MIME-Version: 1.0 Received: by 10.86.184.35 with SMTP id h35mr3274639fgf.18.1256553144233; Mon, 26 Oct 2009 03:32:24 -0700 (PDT) Date: Mon, 26 Oct 2009 16:02:24 +0530 Message-ID: Subject: problem in adding message in wireshark tree From: Awadhesh Kumar To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00c09ffb585ccdaff90476d4134d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09ffb585ccdaff90476d4134d Content-Type: text/plain; charset=ISO-8859-1 Hi, I am writing LUA disectors for Wireshark packets. I am seeing that my disectors are getting called multiple times for a packet. I am calculating udp packet length as below udp_len_f = Field.new("udp.length") function InDirectmip_proto.dissector(buffer,pinfo,tree) print(udp_len_f ( )) end But in second call of disectors, udp length is coming null. I don't know for what packet this is being called? Also I have created tree to add my own user defined information in wireshark tree as stmpsecuritytree = tree:add(InDirectmip_proto,buffer(),"STMP SECURITY HEADER"); stmptree = tree:add(InDirectmip_proto,buffer(),"STMP DATA HEADER"); subtree = tree:add(InDirectmip_proto,buffer(),"ST DATA") res, status = pcall (udp_len_f ) if( res) then stmpsecuritytree:add(buffer(0,1)," STMP Message length: " .. udp_len_f()); else print (" I got exception"); end Here at call of pcall (udp_len_f ) , res is printing as false in second call. It means function udp_len_f () has thrown exception in second call. Due to this exception my message "STMP Message length" is not added in the wireshark tree. I want to handle the exception in following if failed stmpsecuritytree:add(buffer(0,1)," STMP Message length: " .. udp_len_f()); in lua when I am calling above API. Please help me in this regard. Thanks in Advance Awadhesh. --00c09ffb585ccdaff90476d4134d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Hi,

I am writing LUA disectors for Wireshark packets. I am seeing that my = disectors are getting called multiple times for a packet. I am calculating = udp packet length as below
=A0
udp_len_f =3D Field.new("udp.length")=20
=A0
function InDirectmip_proto.dissector(buffer,pinfo,tree)
=A0
=A0=A0=A0=A0=A0=A0=A0 print(udp_len_f ( ))
=A0
end
=A0
But in second call of disectors, udp length is coming null. I don'= t know=A0for what packet this is being called?
=A0
Also I have created tree to add my own user defined information in wir= eshark tree as
=A0
stmpsecuritytree =3D tree:add(InDirectmip_proto,buffer(),"STMP SE= CURITY HEADER");
stmptree =3D tree:add(InDirectmip_proto,buffer(),&= quot;STMP DATA HEADER");
subtree =3D tree:add(InDirectmip_proto,buf= fer(),"ST DATA")
=A0
res, status =3D pcall (udp_len_f )
=A0
if( res) then
=A0
stmpsecuritytree:add(buffer(0,1)," STMP Message length: " ..= udp_len_f());
=A0
else
print (" I got exception");
=A0
end
=A0
Here at call of pcall (udp_len_f ) , res is printing as false in secon= d call. It means function udp_len_f () has thrown exception in second call.= Due to this exception my message "STMP Message length" is not ad= ded in the wireshark tree.
=A0
=A0
I want to=A0handle the exception in following if failed
=A0
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stmpsecuritytree:add(buf= fer(0,1)," STMP Message length: " .. udp_len_f());
=A0
in lua when=A0I am calling above API.
=A0
=A0
Please help me in this regard.
=A0
Thanks in Advance
Awadhesh.
--00c09ffb585ccdaff90476d4134d-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 08:38:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QAcQSO030129; Mon, 26 Oct 2009 08:38:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 779C01A716; Mon, 26 Oct 2009 08:37:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB9911A712 for ; Mon, 26 Oct 2009 08:37:10 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N2Mxc-00018S-A4 for lua@bazar2.conectiva.com.br; Mon, 26 Oct 2009 11:38:00 +0100 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Oct 2009 11:38:00 +0100 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Oct 2009 11:38:00 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Lua syntax gotcha Date: Mon, 26 Oct 2009 11:37:47 +0100 Lines: 25 Message-ID: References: <4AE4C5E5.8060506@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4AE4C5E5.8060506@cowlark.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 25/10/2009 22:40, David Given wrote: > Surprised? Not really, as I still have in mind the discussions about ambiguities when omitting semi-colons... :-) > ...and if there's more than one statement after the return then the code > won't compile and it's obvious what's going on. Or if you add these semi-colons: function test() print(1); return; print(2); end => 'end' expected (to close 'function' at line nn) near 'print' -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 08:48:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QAmrig031380; Mon, 26 Oct 2009 08:48:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82C701A71B; Mon, 26 Oct 2009 08:47:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E18251A715 for ; Mon, 26 Oct 2009 08:47:37 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so837995fgg.17 for ; Mon, 26 Oct 2009 03:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=68YIplb24vzP7sxKm9+ldMFrpUQyLSQIM6pXTjGQZag=; b=SpdNf/pLD4PlAZgzwK/Wj3mFmu0h2DeKMJF7M/OxMauURfOummiWXKZwEzo5D74UA3 5yv2MdR/MjpRI2arfZf2ufZ6Fp/Nu+Cufk9VuWtzoxh1ku+nhseFcHmLR/nnisREIQDX 4HLIi6ELdOwSm6TPNkXxDUSDUH7825aLv0zOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WmBVetDPzopl58Gn5paTgejnavJ0ki9JHdcC/wopKozaQ+hX0LnV2U2yZPSaoPZRxs TcyD2zN/on691VGAu8JhJB5YcEtlOVZvTW/X9TFSfFxg25dWW7vCrsJW1SheVKyQrC6R pvwnzwlo+iucM+LQSJV3JDF9TGVwvdW/auoaY= MIME-Version: 1.0 Received: by 10.239.168.213 with SMTP id l21mr1193982hbe.26.1256554107220; Mon, 26 Oct 2009 03:48:27 -0700 (PDT) In-Reply-To: References: <4AE4C5E5.8060506@cowlark.com> Date: Mon, 26 Oct 2009 12:48:27 +0200 Message-ID: <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> Subject: Re: Lua syntax gotcha From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 26, 2009 at 12:37 PM, Philippe Lhoste wrote: > Not really, as I still have in mind the discussions about ambiguities when > omitting semi-colons... :-) Sounds like a FAQ question; something like 'When do I have to worry about line ends in code?' From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 09:21:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QBLTfQ003508; Mon, 26 Oct 2009 09:21:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F259F1A71F; Mon, 26 Oct 2009 09:20:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5FDF01A711 for ; Mon, 26 Oct 2009 09:20:05 -0200 (BRST) Received: by fxm12 with SMTP id 12so12286831fxm.5 for ; Mon, 26 Oct 2009 04:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=fBtf0cf5cxopzCPpARUCGET8rQ3fJSWS73JBfs330So=; b=o2/Vv7rXJ4YMHxbwMzw0idW4sNV+j4ZWmWSEfPqYZ+IUbtrX6ixmsi01x3EuV6GGir UL7n76ZROO5vcDCse9A2HL3qwlfyCInyn1WJvJFCPi0I9JTknjl51vFryXFw+MaV2Zrh r0j0wpwI/8/VNt1DExVM2Qepz073zfoE84J9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=kUV/yvl7SeVfvJW2t1xuDLlPntIcBWMDHYnta+P1Q9QqUTh21wfBT3nVtCnV55rjex OpLTU5C0yRDVmPySbdHNHOywLTo3VxCRt8wePggrKeQp5czsd0F2FAyr7fxiu/8tk2wm R6eBWZRZeHG2IuzOvZ6ZzCwOvHCKk23rbBuOM= Received: by 10.102.170.12 with SMTP id s12mr5923206mue.12.1256556055562; Mon, 26 Oct 2009 04:20:55 -0700 (PDT) Received: from ?92.255.248.110? ([92.255.248.110]) by mx.google.com with ESMTPS id b9sm30086mug.39.2009.10.26.04.20.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Oct 2009 04:20:54 -0700 (PDT) Date: Mon, 26 Oct 2009 14:20:34 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <639942972.20091026142034@gmail.com> To: steve donovan Subject: Re[2]: Lua syntax gotcha In-Reply-To: <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello steve, Monday, October 26, 2009, 1:48:27 PM, you wrote: > Sounds like a FAQ question; something like 'When do I have to worry > about line ends in code?' i think that better solution would be to change Lua syntax so that this situation that looks like a separate print statement for humans, would be the same for computers -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 09:27:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QBR8fL004444; Mon, 26 Oct 2009 09:27:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEE451A6E4; Mon, 26 Oct 2009 09:25:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D89E1A6D2 for ; Mon, 26 Oct 2009 09:25:48 -0200 (BRST) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n9QBPWk6005756; Mon, 26 Oct 2009 20:26:35 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay21.aps.necel.com with ESMTP; Mon, 26 Oct 2009 20:26:35 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay31.aps.necel.com with ESMTP; Mon, 26 Oct 2009 20:26:35 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 03D1752E1FA; Mon, 26 Oct 2009 20:26:34 +0900 (JST) From: Miles Bader To: Bulat Ziganshin Subject: Re: Lua syntax gotcha References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Mon, 26 Oct 2009 20:26:34 +0900 In-Reply-To: <639942972.20091026142034@gmail.com> (Bulat Ziganshin's message of "Mon, 26 Oct 2009 14:20:34 +0300") Message-ID: Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin writes: > i think that better solution would be to change Lua syntax so that this > situation that looks like a separate print statement for humans, would > be the same for computers It's hardly worth it, given that the "intended" code is nonsensical anyway. -Miles -- "Though they may have different meanings, the cries of 'Yeeeee-haw!' and 'Allahu akbar!' are, in spirit, not actually all that different." From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 09:40:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QBeooF007583; Mon, 26 Oct 2009 09:40:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 438101A720; Mon, 26 Oct 2009 09:39:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7B841A6D2 for ; Mon, 26 Oct 2009 09:39:26 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so4269355fgg.17 for ; Mon, 26 Oct 2009 04:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=nSRQj3KFtF+iFnPJbJN1Op1pJzyMJfoAyArA6O2ssFM=; b=Fp4BNLN3CWodtfmvVqw6JK3iToAmsGIRVbnRc/tBxI6dsGohCqaPklZYkCZ02075FC U2gfi8Wrwx03TNOZ2/2O9MtZVWJf4ygdqgtEmnESuA4+8FWb9Iu8D1y2RKudBpgoLMIe Sa6DIJj4yzipsvdEa4s9LRNHzWP106KJJLpsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mXvzeZgUTNyqyL5MgBsAFmt46FfVOe97xLSgvoiwaDd/2+JmezROaDti4FED323ddL 7gjFiOu7I6Je/ZY7Zo4e+oRONkuSXYXjQmkJK12PAlYVLxlTyMyVM7vH4mNSA2dxdT7G n2+41s8oW6eo7NukIO8onObnFubF6Z9WgBsP0= MIME-Version: 1.0 Received: by 10.239.141.142 with SMTP id c14mr1251613hba.1.1256557216785; Mon, 26 Oct 2009 04:40:16 -0700 (PDT) In-Reply-To: References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> Date: Mon, 26 Oct 2009 13:40:16 +0200 Message-ID: <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> Subject: Re: Lua syntax gotcha From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Oct 26, 2009 at 1:26 PM, Miles Bader wrote: > It's hardly worth it, given that the "intended" code is nonsensical anyway. Yes, we like the syntax as it is. It is however the kind of thing people write in a hurry when they're debugging; As David says, it's just a gotcha, a case where the end of statement is not where you naively expect it to be. From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 09:51:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QBpgE9009715; Mon, 26 Oct 2009 09:51:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16FC31A723; Mon, 26 Oct 2009 09:50:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from pub11.public.flexiguided.net (static.20.55.40.188.clients.your-server.de [188.40.55.20]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7F951A6D1 for ; Mon, 26 Oct 2009 09:50:20 -0200 (BRST) Received: from e179000063.adsl.alicedsl.de ([85.179.0.63] helo=titanium.joh12.building.flexiguided.net) by pub11.public.flexiguided.net with esmtpsa (Cipher TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69 #1 (Debian)) id 1N2O7z-0000w7-AT for ; Mon, 26 Oct 2009 12:52:47 +0100 Message-ID: <4AE58D39.9090501@public-software-group.org> Date: Mon, 26 Oct 2009 11:51:21 +0000 From: Jan Behrens Organization: Public Software Group e. V. User-Agent: Thunderbird 2.0.0.22 (X11/20090818) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Web Application Framework Software Announcement (WebMCP) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean After plenty of effort, we are finally publishing WebMCP, a new Web Application Framework for Lua. Instead of using the classical Model-View-Controller (MVC) concept, WebMCP makes use of a so-called Model-View-Action concept. The database is accessed through the Model layer, which provides an Object-Relational Mapping (ORM). HTTP-GET requests are handled by Views, which process the request data, query the database, and render the result. HTTP-POST requests are handled by Actions, which can write to the database and redirect to a View, dependent on success or failure. The project page is: http://www.public-software-group.org/webmcp Jan Behrens Public Software Group e. V., Berlin, Germany From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 11:54:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QDs0LD006821; Mon, 26 Oct 2009 11:54:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D2EE186E7; Mon, 26 Oct 2009 11:52:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D303186A5 for ; Mon, 26 Oct 2009 11:52:27 -0200 (BRST) Received: by pzk34 with SMTP id 34so8142774pzk.11 for ; Mon, 26 Oct 2009 06:53:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.44.14 with SMTP id r14mr23053658war.196.1256565196747; Mon, 26 Oct 2009 06:53:16 -0700 (PDT) Date: Mon, 26 Oct 2009 15:53:15 +0200 Message-ID: <137286af0910260653u3baa68f9r3aa48fde5eda8500@mail.gmail.com> Subject: Lua+wxWidgets+SWIG From: Dzmitry Hancharou To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502e89d3076590476d6e279 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502e89d3076590476d6e279 Content-Type: text/plain; charset=ISO-8859-1 Hi all. There are several finished GUI-blocks(frames, panels, dialogs) as dll. I need link each other all of them to data can pass from one component to another. I built small project, where use C++-Lua binding by SWIG and wxWidgets GUI. The following listings of modules which I used: swig_wrap.i: *Code:* %module MyModule %{ #include "MyModule.h" %} MyModule.h: *Code:* #include void OpenDialog(void* frame); void HelloWorld(); MyModule.cpp: *Code:* #include "MyModule.h" #include "windows.h" void HelloWorld() {MessageBox(NULL,"Hello","World",MB_OK);} void OpenDialog (void* frame) { wxWindow *wxframe = (wxWindow *) frame; wxFileDialog *fd = new wxFileDialog(wxframe); fd->ShowModal(); } script.lua: *Code:* package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;" require("wx") frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Frame", wx.wxDefaultPosition, wx.wxSize(450, 450), wx.wxDEFAULT_FRAME_STYLE ); package.cpath = "MyModule.dll" require("MyModule") MyModule.HelloWorld(); frame:Show(); MyModule.OpenDialog(frame); print("OK") wx.wxGetApp():MainLoop() Run command: *Code:* lua script.lua MyModule.HelloWorld() work fine, but MyModule.OpenDialog(frame) crashes. What do I need to fix? --00504502e89d3076590476d6e279 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all.
There are several finished GUI-blocks(frames, panels, dialogs) as dll. I need link each other all of them to data can pass from one component to another.
I built small project, where use C++-Lua binding by SWIG and wxWidgets GUI.= The following listings of modules which I used:
swig_wrap.i:
Code:
%module MyModule
%{
#include "MyModule.h"
%}


MyModule.h:
Code:
#include <wxCommon.h>

void OpenDialog(void* frame);
void HelloWorld();


MyModule.cpp:
Code:
#include "MyModule.h"
#include "windows.h"

void HelloWorld() {MessageBox(NULL,"Hello","World",MB_O= K);}
void OpenDialog (void* frame) {
=A0 =A0 wxWindow *wxframe =3D (wxWindow *) frame;
=A0 =A0 wxFileDialog *fd =3D new wxFileDialog(wxframe); fd->ShowModal();
}


script.lua:
Code:
package.cpath =3D package.cpath..";./?.dll;./?.so;../lib/= ?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
require("wx")

frame =3D wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Frame",
wx.wxDefaultPosition, wx.wxSize(450, 450),
wx.wxDEFAULT_FRAME_STYLE );

package.cpath =3D "MyModule.dll"
require("MyModule")
MyModule.HelloWorld();

frame:Show();
MyModule.OpenDialog(frame);

print("OK")
wx.wxGetApp():MainLoop()


Run command:
Code:
lua script.lua

MyModule.HelloWorld() work fine, but MyModule.OpenDialog(frame) crashes. Wh= at do I need to fix?
--00504502e89d3076590476d6e279-- From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 12:14:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QEE7fU011399; Mon, 26 Oct 2009 12:14:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C233519027; Mon, 26 Oct 2009 12:12:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A3CA18FCD for ; Mon, 26 Oct 2009 12:12:45 -0200 (BRST) Received: by fxm12 with SMTP id 12so12425142fxm.5 for ; Mon, 26 Oct 2009 07:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=aeeGaukGrZkWXpkB0gcdY+QtlgQ/ZA4mFrLwc71ziLo=; b=sXl0GRzmdfHwLh/wE7QKpgZk87aGKlir3ABV67hC2G2lOOPfzRwQlsWfn2J9Rzp4KD CJnUaxgmXLF/rxXvOpLYSiemtN/WLUJwWJ7gRu9+GtDaRyhqs6jONq11VAPQW92mjd3R dfEY7rwQ475m72ZgYivFYvcp0cDLC17ZW40bo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=RL9EfmVBbeJCV9/5zhy+6rF8/cbP7JxAZimBeUScELQf6b73qwG+jFEX4+GvYRTFjk 9bDoXnPg42iOI95rbxSpeLJcv5rzlH45aYotCRnhYEvyAfAfrG2qmwGTEy4uk+M5RRb/ 3Lhw4rtibdn4TD9oA0e1XNa08OvRc4Kxd+yxo= Received: by 10.103.86.9 with SMTP id o9mr5900601mul.4.1256566417178; Mon, 26 Oct 2009 07:13:37 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.93.2]) by mx.google.com with ESMTPS id u26sm282394mug.32.2009.10.26.07.13.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 07:13:36 -0700 (PDT) Message-ID: <4AE5AE88.6090804@gmail.com> Date: Mon, 26 Oct 2009 22:13:28 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: problem in adding message in wireshark tree References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Awadhesh Kumar wrote: > I am writing LUA disectors for Wireshark packets. I am seeing that my > disectors are getting called multiple times for a packet. I am > calculating udp packet length as below > [snip] When Lua, the language, is embedded in an application, e.g. wireshark, you'll generally have better results asking such questions on the wireshark mailing list. If you're lucky, you may get a useful answer here, if not, you won't get a single useful reply. Since you have been on the list awhile, I think you should be getting an idea of conversations on this list. IIRC, there was no useful reply for the last similar posting you made on 12 October. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 14:04:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QG41Uw004795; Mon, 26 Oct 2009 14:04:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39A431897B; Mon, 26 Oct 2009 14:01:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id E48C11892B for ; Mon, 26 Oct 2009 14:01:01 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Mon, 26 Oct 2009 10:47:53 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Oct 2009 12:01:49 -0400 Message-ID: <4AE5C7ED.9050803@elbitsystems-us.com> Date: Mon, 26 Oct 2009 12:01:49 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua syntax gotcha References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> In-Reply-To: <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Oct 2009 16:01:49.0961 (UTC) FILETIME=[A091F790:01CA5655] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > On Mon, Oct 26, 2009 at 1:26 PM, Miles Bader wrote: > Yes, we like the syntax as it is. It is however the kind of thing > people write in a hurry when they're debugging; Yes, I can see myself spending time tracking down such a thing. I'll try to remember to use a semicolon when I add debug code like that: function test2() print(1) return; print(2) end Lua looks so much better without statement delimeters, yet edge cases like this show us the down side of omitting them. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 14:11:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QGBVkc006586; Mon, 26 Oct 2009 14:11:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D37718A61; Mon, 26 Oct 2009 14:10:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0662818A1F for ; Mon, 26 Oct 2009 14:10:11 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9QGB3x3018747 for ; Mon, 26 Oct 2009 14:11:03 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id CCA5C54C1D0; Mon, 26 Oct 2009 14:11:03 -0200 (BRST) Date: Mon, 26 Oct 2009 14:11:03 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Interning strings considered harmful (somewhat) Message-ID: <20091026161103.GA12846@inf.puc-rio.br> References: <87eiorabk2.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87eiorabk2.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The second part of the following benchmark shows distinctly non-linear > performance: Each pass of the first part runs under one second on my > machine, but the passes in the second part take 4, 14, and 32 seconds, > respectively. > > I'm a bit worried by this, and the impact on programs which process > data from untrusted inputs. I haven't got a really good idea what can > be done about this. In similar cases, people have used Jenkins' > lookup3.c hash function with a random seed. Perhaps it is sufficient > to drop the skipping from Lua's hash function and use a random seed > stored in the Lua state, but the internal mixing of the current hash > function seems to be rather weak. What exactly is worrying you? Excluding malware, I do not think this situation happens enough to justify any worry. Considering malware, I guess there are plenty of ways for untrusted inputs to waste CPU time, this is only one more. (BTW, simply dropping the skip in the hash function does solve the "problem"; just add a "step = 1" in lstring.c to check. But it creates a new one: the hash function becomes too expensive for long strings.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 14:47:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QGlmdO015444; Mon, 26 Oct 2009 14:47:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD47518BCD; Mon, 26 Oct 2009 14:46:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 70E2A18A74 for ; Mon, 26 Oct 2009 14:46:16 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Mon, 26 Oct 2009 11:34:12 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Oct 2009 12:43:45 -0400 Message-ID: <4AE5D1C0.1010100@elbitsystems-us.com> Date: Mon, 26 Oct 2009 12:43:44 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: problem in adding message in wireshark tree References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Oct 2009 16:43:45.0417 (UTC) FILETIME=[7BE61790:01CA565B] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Awadhesh Kumar wrote: > But in second call of disectors, udp length is coming null. I don't > know for what packet this is being called? > Please help me in this regard. I *think* the second call is a re-dissection of the packet, and I *think* the whole set of properties gets cleared out when a packet is re-dissected. Each packet is then freshly dissected. You can pick up properties when you chain dissectors or register as a postdissector. You might also be able to store some history in a global table, but I haven't tried that. The Wireshark Lua API documentation is not complete - it's on their to-do list. You might be able to track down your problem by looking at the Lua interface code in the Wireshark distribution under epan/wslua. Also, try trimming down your dissector to the bare minimum that shows the problem - including how it is registered with the UDP or TCP table - then post the full code (to the Wireshark list). My Wireshark dissectors are called whenever a new filter is applied and whenever a particular packet is selected. When I initially load a pcap file, it does not run twice. but only once. I learned enough of the Wireshark Lua API to replace my binary C filter with a much simpler Lua one so I can move it easily between Windows and Linux. But I'm far from an expert. As KHMan indicated, you'll have better luck contacting Wireshark Lua API people. This isn't such a bad place to look initially, I suppose. You might find a few here (I'm not one). On a side note, I'd like to add some kind words of congratulations to KHMan. In the past I have seen more severe admonishments from you. I'm happy to see your patience has improved! :) Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 15:07:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QH6vCK021221; Mon, 26 Oct 2009 15:06:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96ED21914F; Mon, 26 Oct 2009 15:05:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E31A71912F for ; Mon, 26 Oct 2009 15:05:34 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QH6Qex021130 for ; Mon, 26 Oct 2009 15:06:26 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9QH6Pw28268; Mon, 26 Oct 2009 15:06:25 -0200 Date: Mon, 26 Oct 2009 15:06:24 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Lua syntax gotcha Message-ID: <20091026150624.A28262@lua.tecgraf.puc-rio.br> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AE5C7ED.9050803@elbitsystems-us.com>; from doug.rogers@elbitsystems-us.com on Mon, Oct 26, 2009 at 12:01:49PM -0400 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Yes, I can see myself spending time tracking down such a thing. I'll try > to remember to use a semicolon when I add debug code like that: > > function test2() > print(1) > return; > print(2) > end This code does not compile: "return" must be the last statement in the block. So you need to use this instead: "do return end". No semicolon is needed. From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 17:12:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QJCX63021579; Mon, 26 Oct 2009 17:12:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AC3219198; Mon, 26 Oct 2009 17:11:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 75F731911A for ; Mon, 26 Oct 2009 17:10:59 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Mon, 26 Oct 2009 13:58:59 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Oct 2009 15:11:48 -0400 Message-ID: <4AE5F473.6020009@elbitsystems-us.com> Date: Mon, 26 Oct 2009 15:11:47 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua syntax gotcha References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <20091026150624.A28262@lua.tecgraf.puc-rio.br> In-Reply-To: <20091026150624.A28262@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Oct 2009 19:11:48.0639 (UTC) FILETIME=[2AB632F0:01CA5670] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> Yes, I can see myself spending time tracking down such a thing. I'll try >> to remember to use a semicolon when I add debug code like that: >> >> function test2() >> print(1) >> return; >> print(2) >> end > This code does not compile: "return" must be the last statement in the block. > So you need to use this instead: "do return end". No semicolon is needed. Yes, believe it or not, I checked that it did NOT compile before posting it! What I was trying to say was that if I used a semicolon there, the compiler would notice that I was attempting to run code beyond the 'return', so I would not reach the point of being surprised by the behavior. For some reason it felt more natural to remember to add a semicolon (and then fix it after it fails to compile) than to remember the 'do return end' construct. These kinds of cross-line parsing issues don't come up too often for me. When I want to continue something on the next line, I just make sure that an expression or statement is incomplete so that more text must be read. But 'return' can appear with or without a following expression, so that's a case where I need to be more careful. David's post was a good reminder. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Mon Oct 26 19:05:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9QL52qb010811; Mon, 26 Oct 2009 19:05:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22E4019287; Mon, 26 Oct 2009 19:03:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E03C19235 for ; Mon, 26 Oct 2009 19:03:29 -0200 (BRST) Received: by pwj9 with SMTP id 9so1519504pwj.21 for ; Mon, 26 Oct 2009 14:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZwzbV/tuoVFDvY+nTg2b2QwM8q47QwiQDBj+t84oJGA=; b=UN+RX5Bz4hs0EzouKI4Bnt/svjYVyS6J9B98aN4R3TKnTE1QVuphrczvzeI+ZJPWdf ySKJhHGC9Xd1DaNJwve5LCU8Bg1l/DS//JdHK+RVhoeG9UBmctkC7rbDvatG8nfeHWXp kzoQECli8O7oIMt/b+oOgMoizS7gtc/XEsAFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jUckXZrciWzSfa/8e0ixmzScrue9149tu40u65hUVA6Eim2GN9D0oiMdMtTjTl2Ke5 ydUrN0kw99oY7CkShl/IrxrKaL00DdP3uxM3DL3CGjjyc6V+PFY5V5OkYjObmvKIzHCM kjbBWgy+Ty13npFp4g40iE/jSt0OR63MJWAsg= MIME-Version: 1.0 Received: by 10.142.1.3 with SMTP id 3mr1232564wfa.66.1256591059584; Mon, 26 Oct 2009 14:04:19 -0700 (PDT) In-Reply-To: <137286af0910260653u3baa68f9r3aa48fde5eda8500@mail.gmail.com> References: <137286af0910260653u3baa68f9r3aa48fde5eda8500@mail.gmail.com> Date: Mon, 26 Oct 2009 17:04:19 -0400 Message-ID: Subject: Re: Lua+wxWidgets+SWIG From: John Labenski To: Lua list Content-Type: multipart/alternative; boundary=001636b2bc02bc06d10476dce7ce X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2bc02bc06d10476dce7ce Content-Type: text/plain; charset=ISO-8859-1 I don't know about Swig or the cause of your problem, but you may find wxLua to your liking as it is designed to be easily embedded into a C++ program and you can add your own bindings as well. See the wxLua/apps/wxluacan sample app. http://wxlua.sf.net Regards, John On Mon, Oct 26, 2009 at 9:53 AM, Dzmitry Hancharou wrote: > Hi all. > There are several finished GUI-blocks(frames, panels, dialogs) as dll. I > need link each other all of them to data can pass from one component to > another. > I built small project, where use C++-Lua binding by SWIG and wxWidgets GUI. > The following listings of modules which I used: > swig_wrap.i: > *Code:* %module MyModule > %{ > #include "MyModule.h" > %} > > MyModule.h: > *Code:* #include > > void OpenDialog(void* frame); > void HelloWorld(); > > MyModule.cpp: > *Code:* #include "MyModule.h" > #include "windows.h" > > void HelloWorld() {MessageBox(NULL,"Hello","World",MB_OK);} > void OpenDialog (void* frame) { > wxWindow *wxframe = (wxWindow *) frame; > wxFileDialog *fd = new wxFileDialog(wxframe); fd->ShowModal(); > } > > script.lua: > *Code:* package.cpath = > package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;" > > require("wx") > > frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Frame", > wx.wxDefaultPosition, wx.wxSize(450, 450), > wx.wxDEFAULT_FRAME_STYLE ); > > package.cpath = "MyModule.dll" > require("MyModule") > MyModule.HelloWorld(); > > frame:Show(); > MyModule.OpenDialog(frame); > > print("OK") > wx.wxGetApp():MainLoop() > > Run command: > *Code:* lua script.lua > MyModule.HelloWorld() work fine, but MyModule.OpenDialog(frame) crashes. > What do I need to fix? > --001636b2bc02bc06d10476dce7ce Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't know about Swig or the cause of your problem, but you may find = wxLua to your liking as it is designed to be easily embedded into a C++ pro= gram and you can add your own bindings as well. See the wxLua/apps/wxluacan= sample app.

http://wxlua.sf.net

Regards,=
=A0=A0=A0 John

On Mon, Oct 26, 2009 a= t 9:53 AM, Dzmitry Hancharou <red1ynx@tut.by> wrote:
Hi all= .
There are several finished GUI-blocks(frames, panels, dialogs) as dll. I need link each other all of them to data can pass from one component to another.
I built small project, where use C++-Lua binding by SWIG and wxWidgets GUI.= The following listings of modules which I used:
swig_wrap.i:
Code:
%module MyModule
%{
#include "MyModule.h"
%}


MyModule.h:
Code:
#include <wxCommon.h>

void OpenDialog(void* frame);
void HelloWorld();


MyModule.cpp:
Code:
#include "MyModule.h"
#include "windows.h"

void HelloWorld() {MessageBox(NULL,"Hello","World",MB_O= K);}
void OpenDialog (void* frame) {
=A0 =A0 wxWindow *wxframe =3D (wxWindow *) frame;
=A0 =A0 wxFileDialog *fd =3D new wxFileDialog(wxframe); fd->ShowModal();
}


script.lua:
Code:
package.cpath =3D package.cpath..";./?.dll;./?.so;../lib/= ?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
require("wx")

frame =3D wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Frame",
wx.wxDefaultPosition, wx.wxSize(450, 450),
wx.wxDEFAULT_FRAME_STYLE );

package.cpath =3D "MyModule.dll"
require("MyModule")
MyModule.HelloWorld();

frame:Show();
MyModule.OpenDialog(frame);

print("OK")
wx.wxGetApp():MainLoop()


Run command:
Code:
lua script.lua

MyModule.HelloWorld() work fine, but MyModule.OpenDialog(frame) crashes. Wh= at do I need to fix?

--001636b2bc02bc06d10476dce7ce-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 08:07:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RA7gOW030201; Tue, 27 Oct 2009 08:07:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 538C1192B3; Tue, 27 Oct 2009 08:06:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f216.google.com (mail-fx0-f216.google.com [209.85.220.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3DB619289 for ; Tue, 27 Oct 2009 08:06:07 -0200 (BRST) Received: by fxm12 with SMTP id 12so13142884fxm.5 for ; Tue, 27 Oct 2009 03:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=P7GacL3Cency1Js2co0cEC2sCUQYOQgL8L0tGSZUjsc=; b=jnc2kQLEJHD/oEUwBPeXNeU5ipz4pk2LwPYuDwbgZOlCiAEplPtKLS/MzDpaIIslVw c4v2H+5zSg5tWdirjkCMdVm4ochKD/JT2JL7YzX3Lx0zgak9ziNU6uQT10ca93O59LKX 6zhvKY2cJ4pnYReqz1Kb246XdkkHXIcFTrmCE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RMGVlNTcQFUTANKrBkCsjFRjUTJcr6Rjoaz7uGdMbgA0YRukN8Zi+m7Q+1rrUI0zkZ 6IgqqktoLVNFayJSdS37JBXLcoJqdeY7cWTzFEOWIJOeAksCDYCJ+MFye207dapjYgCz hSSrXUZSy0zePma6rYER4rTFFRxhod0eUmkOk= MIME-Version: 1.0 Received: by 10.223.14.145 with SMTP id g17mr260063faa.51.1256638019235; Tue, 27 Oct 2009 03:06:59 -0700 (PDT) In-Reply-To: <76882e540910241608o715ac9b7ie9c148a8ac628221@mail.gmail.com> References: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> <76882e540910241608o715ac9b7ie9c148a8ac628221@mail.gmail.com> Date: Tue, 27 Oct 2009 12:06:59 +0200 Message-ID: <76882e540910270306m5d1043a4ifcb8c9a163e91c97@mail.gmail.com> Subject: Re: Running the test suite on Windows From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=00151747360abf70d80476e7d64c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151747360abf70d80476e7d64c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Seems that no one used the test suite on Windows... Thanks anyway... Uri Cohen On Sun, Oct 25, 2009 at 1:08 AM, uri cohen wrote: > No, really. :) > Did anyone run the test suite on Windows? With which compiler? Does it > supposed to compile? Does it supposed to pass? > Muito obrigado, > Uri > > 2009/10/23 Lu=EDs Eduardo Jason Santos > > Lots of free memory. :-) >> >> Lu=EDs Eduardo Jason Santos >> >> >> >> On Thu, Oct 22, 2009 at 9:17 PM, uri cohen wrote: >> >>> Is the lua test suite from >>> http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gzexpected to work on Window= s? >>> Any special configuration required? >>> >>> Thanks! >>> Uri Cohen >>> >> >> > > > -- > > Uri Cohen > --00151747360abf70d80476e7d64c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Seems that no one used the test suite on Windows...
Thanks anyway...
= =A0 =A0 =A0 =A0 =A0=A0 Uri Cohen

On Sun, = Oct 25, 2009 at 1:08 AM, uri cohen <uri.cohen@gmail.com> wrote:
= No, really. :)
Did anyone run the test suite on Windows? With which comp= iler? Does it supposed to compile? Does it supposed to pass?
Muito obrigado,
=A0=A0=A0=A0=A0=A0=A0=A0 Uri

2009/10/23 Lu=EDs Eduardo Jason Santos <jasonsantos@gmail.com<= /a>>

Lots of free memo= ry. :-)

Lu=EDs Eduardo Jason = Santos



On Thu, Oct 22, 2009 at 9:17 PM, uri coh= en <uri.cohen@gmail.com> wrote:
Is the lua test suite from http://www.inf.= puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz expected to work on Windows= ?
Any special configuration required?

Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen




--

=A0 = =A0 =A0 =A0 =A0 =A0Uri Cohen



--00151747360abf70d80476e7d64c-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 08:16:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RAGELs031289; Tue, 27 Oct 2009 08:16:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62B4D192C7; Tue, 27 Oct 2009 08:15:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0D64192AD for ; Tue, 27 Oct 2009 08:14:57 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N2j5h-0004b5-Qn for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 11:15:49 +0100 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 11:15:49 +0100 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 11:15:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Lua syntax gotcha Date: Tue, 27 Oct 2009 11:15:39 +0100 Lines: 14 Message-ID: References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4AE5C7ED.9050803@elbitsystems-us.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 26/10/2009 17:01, Doug Rogers wrote: > I'll try > to remember to use a semicolon when I add debug code like that: [...] > Lua looks so much better without statement delimeters, yet edge cases > like this show us the down side of omitting them. And the ugliness of the semi-colon reminds this is just temporary debug code! :-) -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 09:14:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RBEM0o005837; Tue, 27 Oct 2009 09:14:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0312192D8; Tue, 27 Oct 2009 09:12:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f180.google.com (mail-px0-f180.google.com [209.85.216.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1B25192C7 for ; Tue, 27 Oct 2009 09:12:51 -0200 (BRST) Received: by pxi10 with SMTP id 10so16510pxi.33 for ; Tue, 27 Oct 2009 04:13:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.115.66.35 with SMTP id t35mr468721wak.87.1256642022292; Tue, 27 Oct 2009 04:13:42 -0700 (PDT) In-Reply-To: References: <137286af0910260653u3baa68f9r3aa48fde5eda8500@mail.gmail.com> Date: Tue, 27 Oct 2009 13:13:42 +0200 Message-ID: <137286af0910270413g649146b4v55fbf0a57285e540@mail.gmail.com> Subject: Re: Lua+wxWidgets+SWIG From: Dzmitry Hancharou To: Lua list Content-Type: multipart/alternative; boundary=0016e64ce5b6593dcc0476e8c5d6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64ce5b6593dcc0476e8c5d6 Content-Type: text/plain; charset=ISO-8859-1 I tested wxLua/apps/wxluacan sample app. In this case from C++ module we can run lua-scripts. These scripts can only use those parent modules. That is: mod1 = module1.getInst() mod1:func1(); mod1:func2(params); and no more. And if I add a functional, I need to modify i-file and recompile the entire project. I want to break a problem into several parts like this: mod1 = module1.getInst() mod2 = module2.getInst() mod1:doIt(mod2:getIt()) In this case if I want to change the first module, I did not recompile the second. Does anyone know how this can be done? --0016e64ce5b6593dcc0476e8c5d6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tested wxLua/apps/wxluacan sample app. In this case from C++ module we ca= n run lua-scripts. These scripts can only use those parent modules. That is= :
=A0 mod1 =3D module1.getInst()
=A0 mod1:func1();
=A0 mod1:func2(= params);
and no more.
And if I add a functional, I need to modify i-file and reco= mpile the entire project.

I want to break a problem into several par= ts like this:
=A0 mod1 =3D module1.getInst()
=A0 mod2 =3D module2.get= Inst()
=A0 mod1:doIt(mod2:getIt())
In this case if I want to change the first m= odule, I did not recompile the second.

Does anyone know how this can= be done?
--0016e64ce5b6593dcc0476e8c5d6-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 09:49:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RBn0nY010956; Tue, 27 Oct 2009 09:49:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 744BF192EA; Tue, 27 Oct 2009 09:47:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA3218F56 for ; Tue, 27 Oct 2009 09:47:32 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9RBmOHU027798 for ; Tue, 27 Oct 2009 09:48:24 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 1646754C1D0; Tue, 27 Oct 2009 09:48:25 -0200 (BRST) Date: Tue, 27 Oct 2009 09:48:25 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Running the test suite on Windows Message-ID: <20091027114825.GB9240@inf.puc-rio.br> References: <76882e540910221617j121c2545xe0b427b0a8d81b43@mail.gmail.com> <76882e540910241608o715ac9b7ie9c148a8ac628221@mail.gmail.com> <76882e540910270306m5d1043a4ifcb8c9a163e91c97@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76882e540910270306m5d1043a4ifcb8c9a163e91c97@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Seems that no one used the test suite on Windows... We do. (But see http://lua-users.org/lists/lua-l/2008-06/msg00124.html) -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 12:02:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RE1x4Q012183; Tue, 27 Oct 2009 12:02:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA1619315; Tue, 27 Oct 2009 12:00:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth18.prod.mesa1.secureserver.net (smtpauth18.prod.mesa1.secureserver.net [64.202.165.31]) by bazar2.conectiva.com.br (Postfix) with SMTP id DF908192C7 for ; Tue, 27 Oct 2009 12:00:26 -0200 (BRST) Received: (qmail 5887 invoked from network); 27 Oct 2009 14:01:11 -0000 Received: from unknown (98.117.140.83) by smtpauth18.prod.mesa1.secureserver.net (64.202.165.31) with ESMTP; 27 Oct 2009 14:01:11 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua syntax gotcha From: Mark Hamburg In-Reply-To: Date: Tue, 27 Oct 2009 07:01:10 -0700 Content-Transfer-Encoding: 7bit Message-Id: <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If unexpected line continuations are the problem, then obviously what Lua needs is a line continuation character. It goes in column 7 as I recall. ;-) Mark From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 12:25:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9REP1uR016755; Tue, 27 Oct 2009 12:25:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3276219345; Tue, 27 Oct 2009 12:23:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD23519331 for ; Tue, 27 Oct 2009 12:23:41 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N2myN-00073y-0N for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 15:24:31 +0100 Received: from p5b2c267f.dip.t-dialin.net ([91.44.38.127]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 15:24:30 +0100 Received: from dak by p5b2c267f.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 15:24:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Lua syntax gotcha Date: Tue, 27 Oct 2009 15:24:09 +0100 Organization: Organization?!? Lines: 10 Message-ID: <87k4ygx6d2.fsf@lola.goethe.zz> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c267f.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:1ubQiOksL7e1gKq1fwzQz1nWV8o= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg writes: > If unexpected line continuations are the problem, then obviously what > Lua needs is a line continuation character. It goes in column 7 as I > recall. ;-) Even 1-based (as Lua programmers would have it) it goes in column 6. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 12:40:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9REeZx7020113; Tue, 27 Oct 2009 12:40:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6086919326; Tue, 27 Oct 2009 12:39:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C400192DD for ; Tue, 27 Oct 2009 12:39:05 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so75223qwb.11 for ; Tue, 27 Oct 2009 07:39:56 -0700 (PDT) Received: by 10.224.78.105 with SMTP id j41mr8310557qak.371.1256654396757; Tue, 27 Oct 2009 07:39:56 -0700 (PDT) Received: from two ([71.21.67.37]) by mx.google.com with ESMTPS id 4sm8118ywi.27.2009.10.27.07.39.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 07:39:55 -0700 (PDT) Date: Tue, 27 Oct 2009 08:39:49 -0600 From: phoenix To: lua@bazar2.conectiva.com.br Subject: Re: Lua syntax gotcha Message-ID: <20091027083949.4da70ef3@two> In-Reply-To: <87k4ygx6d2.fsf@lola.goethe.zz> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> <87k4ygx6d2.fsf@lola.goethe.zz> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 27 Oct 2009 15:24:09 +0100 David Kastrup wrote: > Mark Hamburg writes: > > > If unexpected line continuations are the problem, then obviously > > what Lua needs is a line continuation character. It goes in column > > 7 as I recall. ;-) > > Even 1-based (as Lua programmers would have it) it goes in column 6. > Gosh, thanks for the obscure Fortran humor. X_x From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 12:58:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9REw05c024156; Tue, 27 Oct 2009 12:58:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7227E19330; Tue, 27 Oct 2009 12:56:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ringworld.transsys.com (ringworld.transsys.com [144.202.0.15]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F151192B7 for ; Tue, 27 Oct 2009 12:56:40 -0200 (BRST) Received: from [144.202.1.164] (pa-67-234-64-172.dhcp.embarqhsd.net [67.234.64.172]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: louie) by ringworld.transsys.com (Postfix) with ESMTP id 4CFB95C04 for ; Tue, 27 Oct 2009 10:57:32 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua syntax gotcha From: Louis Mamakos In-Reply-To: <20091027083949.4da70ef3@two> Date: Tue, 27 Oct 2009 10:57:31 -0400 Content-Transfer-Encoding: 7bit Message-Id: <1E1744A8-24B8-4DE8-8415-DF6DAD8FD16C@transsys.com> References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> <87k4ygx6d2.fsf@lola.goethe.zz> <20091027083949.4da70ef3@two> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 27, 2009, at 10:39 AM, phoenix wrote: > On Tue, 27 Oct 2009 15:24:09 +0100 > David Kastrup wrote: > >> Mark Hamburg writes: >> >>> If unexpected line continuations are the problem, then obviously >>> what Lua needs is a line continuation character. It goes in column >>> 7 as I recall. ;-) >> >> Even 1-based (as Lua programmers would have it) it goes in column 6. >> > > Gosh, thanks for the obscure Fortran humor. X_x > We could use columns 73-80 for the module name, too. louie From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 13:02:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RF20s1025036; Tue, 27 Oct 2009 13:02:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CB0419352; Tue, 27 Oct 2009 13:00:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 598B519327 for ; Tue, 27 Oct 2009 13:00:32 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Tue, 27 Oct 2009 09:48:29 -0500 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 27 Oct 2009 11:01:22 -0400 Message-ID: <4AE70B42.60306@elbitsystems-us.com> Date: Tue, 27 Oct 2009 11:01:22 -0400 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Lua syntax gotcha References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> In-Reply-To: <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Oct 2009 15:01:22.0824 (UTC) FILETIME=[590A8880:01CA5716] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: > If unexpected line continuations are the problem, then obviously what > Lua needs is a line continuation character. It goes in column 7 as I > recall. ;-) Yes, as David Kastrup said, it was definitely column 6. Except in Emacs, where it's 5. So who's up to the challenge of writing a Lua interpreter in FORTRAN? Then I could put my Lua programs on a stack of punch cards, just after the FORTRAN compiler deck and the Lua FORTRAN program deck. Then I could wait a few hours until the printout told me I forgot to use the 'do return end' construct! Ah, the good old days, when the computer science students could use terminals but the engineering students used punch cards. I can tell the stories to my kids, so there was some gain to go with the fondly remembered pain. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 13:32:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RFWjX7031581; Tue, 27 Oct 2009 13:32:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BF8F1935D; Tue, 27 Oct 2009 13:31:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2717D1934D for ; Tue, 27 Oct 2009 13:31:19 -0200 (BRST) Received: by bwz19 with SMTP id 19so329842bwz.28 for ; Tue, 27 Oct 2009 08:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=vN+te7NHDrkeCZ8Ba5kbFrezroAndOEpJbIdE7pVECk=; b=mu7qMsHFBpZ3lWOYKofwTAwYbYDAOskTshfYj/0Z0bSqBFZp+xr+B5JeKVaryHq7IW 3PWytMvmPPgN1uErgCLFk4t2ATtj75y/LW9hOAgdTlOleuQZED9bZ3ZbprtgLXnWmufb x4JoTHSbPQsXpEuofchn+HogLejxxwjyxvICY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VtjI6RhOX2FMKxhVfOFOKBwt7FA81u7aBWD/0iqtzentFnpcdP3ZFk4omno5VUlL/y B0L8RIEeTFfaqKAAxgnfUUQVijm8qV2c4Je++7AsUeLS1LtIWhJSXmBQrrlCmSrXejAU H7lDW/Z2Y2kcQpHL50I1VZ6t8ir8zDmqZiMTc= MIME-Version: 1.0 Received: by 10.204.34.70 with SMTP id k6mr2462848bkd.178.1256657531463; Tue, 27 Oct 2009 08:32:11 -0700 (PDT) In-Reply-To: References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> From: Matthew Wild Date: Tue, 27 Oct 2009 15:31:51 +0000 Message-ID: <4db9cacb0910270831s2c1b3021lb61eb7c26aa7704e@mail.gmail.com> Subject: Re: Lua syntax gotcha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/27 Philippe Lhoste : > On 26/10/2009 17:01, Doug Rogers wrote: >> >> I'll try to remember to use a semicolon when I add debug code like that: > > [...] >> >> Lua looks so much better without statement delimeters, yet edge cases like >> this show us the down side of omitting them. > > And the ugliness of the semi-colon reminds this is just temporary debug > code! :-) > That's funny... I omit semi-colons to remind me to remove debug lines :) Matthew, the semi-colon fan From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 14:37:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RGbIjC014707; Tue, 27 Oct 2009 14:37:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9308918F56; Tue, 27 Oct 2009 14:35:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-346.bluehost.com (outbound-mail-346.bluehost.com [66.147.249.7]) by bazar2.conectiva.com.br (Postfix) with SMTP id 77B1B18E78 for ; Tue, 27 Oct 2009 14:35:38 -0200 (BRST) Received: (qmail 23395 invoked by uid 0); 27 Oct 2009 16:36:26 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 27 Oct 2009 16:36:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=zw0GE1hYomCk85tyl8koZU7rAqPmoh0nann8REidEDvd/vkrvxwAZIZd1caGF/EJJr+jyH899hoOsXIJhkXA14LtiVf/ai6ipr8n7cVF8gHeMsE9RwXArZXw7eFXvGNn; Received: from bas3-unionville55-1279332649.dsl.bell.ca ([76.65.17.41] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N2p22-0002vI-3i for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 10:36:26 -0600 Message-ID: <4AE72188.2030301@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 12:36:24 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Advice Mixing PHP and Lua? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.65.17.41 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Everyone I am new to Lua and still reading Roberto's book. I am absolutely loving everything that I have learned so far. It's amazing how many things are the way I was hoping they would be in the other languages that I learned but were not. I am going to use Lua with C++ and it looks like a perfect match already but I also want to do some web based stuff. PHP just has such a large set of libraries of which one I have already become Dependant on. Lua seems like a better language but PHP has such a head start with the web. What would be the best way to mesh PHP code and Lua? I know there is a PECL extension for embedding the Lua interpretor, has anyone else used this?Is there a better way? Thanks in advance-Patrick From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 14:40:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RGeKFl015376; Tue, 27 Oct 2009 14:40:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB46C1902A; Tue, 27 Oct 2009 14:38:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F41C189C7 for ; Tue, 27 Oct 2009 14:38:52 -0200 (BRST) Received: by pzk34 with SMTP id 34so244077pzk.11 for ; Tue, 27 Oct 2009 09:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gVaiV9SxcfAI8u9ZF+f57w9pMVpYbupHulzjWrh0J6U=; b=o2fjsnlhqd0OnwTfxYuxC7UH71zH+tv94IV+/RCj//IMZDQ9pl/ZaGaDVr5vHGNVD5 UNAcuA5geQWDx5DjJKzSCN6mWtgfsrCMQ9i5i4afISWTuMNcraj0PNy4hsFmEHFTJDi4 AmN3wI5FV/cD8GV3pFU+yR987X9wLyzr5sU7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YYjWfTx1eT2ZKMBM4rcMdEOtyslXiW4Vt7+1mXtFM7SKTzVcwiWFEFeE6LK/GyVaC4 dIzl/01msOhd8fsMXjRlUV7NCjCwDwcidmJLxWSDId0FJOOObiAM8HEahA1S9vQtWiYA Lv1HiUbbvCciiopRfoIi2Fc60tWT9ml6ZX2GU= MIME-Version: 1.0 Received: by 10.142.61.41 with SMTP id j41mr1262852wfa.335.1256661584068; Tue, 27 Oct 2009 09:39:44 -0700 (PDT) In-Reply-To: <4AE72188.2030301@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 14:39:44 -0200 Message-ID: <5947f2ab0910270939o1b2e2df8k3e54cdb064612ad9@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: Marcelo Araujo To: Lua list Content-Type: multipart/alternative; boundary=001636e0b60152403c0476ed533e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e0b60152403c0476ed533e Content-Type: text/plain; charset=ISO-8859-1 lua PECL extension needs several improvements. Depending on what you are going to do, it may not fit. On Tue, Oct 27, 2009 at 2:36 PM, Patrick < spell_gooder_now@spellingbeewinnars.org> wrote: > Hi Everyone > > I am new to Lua and still reading Roberto's book. I am absolutely loving > everything that I have learned so far. It's amazing how many things are > the way I was hoping they would be in the other languages that I learned > but were not. > > I am going to use Lua with C++ and it looks like a perfect match already > but I also want to do some web based stuff. PHP just has such a large > set of libraries of which one I have already become Dependant on. Lua > seems like a better language but PHP has such a head start with the web. > What would be the best way to mesh PHP code and Lua? I know there is a > PECL extension for embedding the Lua interpretor, has anyone else used > this?Is there a better way? > > Thanks in advance-Patrick > > -- Marcelo Araujo --001636e0b60152403c0476ed533e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable lua PECL extension needs several improvements. Depending on what you are go= ing to do, it may not fit.




--
Marcelo Araujo

<= br> --001636e0b60152403c0476ed533e-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 14:50:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RGnpEf017450; Tue, 27 Oct 2009 14:49:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9456192A5; Tue, 27 Oct 2009 14:48:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30B47191B7 for ; Tue, 27 Oct 2009 14:48:29 -0200 (BRST) Received: by bwz19 with SMTP id 19so422497bwz.28 for ; Tue, 27 Oct 2009 09:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=dbafWsIxj/uzs1WsNiwsGXxOjlyVjjEENagu48/A8BM=; b=rGhnN3IQ8blN8USXg+PhcaHGUqFQMAVD/l0oZ3sYdXE8MtlDWAxFSxXGeMNYRslZ5s JFNV+hQTFhsa9vg/3q8IAH1gSs9LI3t9dJRQHEK42eQjpT5CjJsFnbrrDdyw5bW9E5/q VrtBzp7UM1cOZ2t3+PHhzzuoS0FLU0sQZrdxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=MaaYflbhZGiOIac0MVh19Zhkbyr1s/q5HE0mtq2qUg/9K5rYjRIPbFxdlwHdQZYexT 4n8U0AAqZo7TLu+JokhbyOv9r5ES8wNqPrIOmwpanXEMTFkmUPNm6ore97ll2jU7y3z0 tkK9hF3pLLcbqdpk0u2JhE3lQNm+RcEmv4d3A= MIME-Version: 1.0 Received: by 10.223.20.85 with SMTP id e21mr155294fab.25.1256662159079; Tue, 27 Oct 2009 09:49:19 -0700 (PDT) From: Hisham Date: Tue, 27 Oct 2009 14:48:58 -0200 Message-ID: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> Subject: [ANN] LuaRocks 2.0.1 To: Lua list , LuaRocks developers list , Kepler Project mailing list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I'm happy to announce LuaRocks 2.0.1, a bugfix release: http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz This is the Unix tarball. The Windows package is in the works in will follow later in the 2.0.x series. (If you downloaded a release candidate, this is a new package: md5: 795a30b42894ef5cd2ad449c3bf9cff9) What's changed: * there were still references to the old LuaForge repository URL around; these were removed. * luarocks.cfg is no longer edited during installation; a separate site-local luarocks.config module is created. * bugfix in the luarocks.loader module * bugfix for installation of LR1 .rocks in LR2 * bugfix for luarocks.pack * bugfix for luarocks.unix.tools which resulted in crash * robustness fixes and improvements for luarocks.add * cleanup of configure options matching current LR2 capabilities * and last but not the least... ...a new experimental feature: installing LuaRocks as a rock. To try that, instead of the usual "./configure; make; make install", do "./configure; make bootstrap" (passing your configure-flags as usual, of course). "luarocks list" should then show "luarocks 2.0.1-1" as one of the installed rocks. Feedback on this feature is especially welcome. Also, the usual installation procedure should still work normally. -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 14:54:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RGsWH1019365; Tue, 27 Oct 2009 14:54:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2CAF19320; Tue, 27 Oct 2009 14:53:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA88719292 for ; Tue, 27 Oct 2009 14:53:06 -0200 (BRST) Received: by bwz19 with SMTP id 19so427844bwz.28 for ; Tue, 27 Oct 2009 09:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Q9Y0FkfwlbL0SwMJsxCJCH6+MeRcf6Cgcg4oY3am6Yk=; b=Zso4ZW+VTkmpglKPiu1skp/eoF232kLWTfxbZbNleKLUlsg8eKws5YvfqgIZ7x6WkP 2TNrH4V68RoBO2XtTpQwGN3Ae6X+D6q0jExbpH/YB6BEnMoFPAWvgnBdO/+P5C3qW7g8 6blX2bEgVL0cI5bBKs5Z5l/1V8Pk+u1EWGoPo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=p03dJwj2dsrP2yI66jW2UU7a2Gnpa7tLfFehJ0JJmaH2eHANs75DKBrumuK5BOyhgN +qMK7+pM9ZtPGrUvAKHP35XpSuwHJSSiotmSAUHUcgtDv706H5EbCWLy53F/fHMZJosB UWod5TpO8xPqHHvJvVaIV0iuI32ZsUnqcqHro= MIME-Version: 1.0 Received: by 10.223.6.17 with SMTP id 17mr769291fax.93.1256662438313; Tue, 27 Oct 2009 09:53:58 -0700 (PDT) In-Reply-To: <89d273ba0910190225j113dc796w2d01ed8505b20ca@mail.gmail.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> <4AD69BA5.8070501@sct.microlink.com.br> <76882e540910160642g6239d298qbcba594b0085c07d@mail.gmail.com> <89d273ba0910190225j113dc796w2d01ed8505b20ca@mail.gmail.com> Date: Tue, 27 Oct 2009 18:53:57 +0200 Message-ID: <76882e540910270953j6f9cfeefpbe7e6f29a47ce26d@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port From: uri cohen To: Lua list Content-Type: multipart/alternative; boundary=0015174784f03cff780476ed8658 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174784f03cff780476ed8658 Content-Type: text/plain; charset=ISO-8859-1 Thanks for your patch, Jerome. I've used it and found it is a minimal and elegant support for UTF16 unicode strings. Although it provide the requirements I wrote in my post, I found it does not work for me because it does not support ability to run LUA code from UTF16 files or lines. So while you support unicode strings you can't really define unicode literals in an easy way. Thanks! Uri Cohen On Mon, Oct 19, 2009 at 11:25 AM, Jerome Vuarand wrote: > 2009/10/16 uri cohen : > > Following the feedback that using UTF8 is better than porting LUA to > UTF16, > > is there a LUA port or library which allows the user to: > > - define UTF8 literals; > > - open files with UTF8 names; > > - read and write Windows unicode text using only LUA strings > > - bind with external C code which work in UTF16 > > I wrote such a patch, it is attached to this mail. It adds the > following to the Lua API, declared in standard lua headers but > implemented in lwstring.c: > > #define LUA_HAS_WSTRING 1 > > LUA_API const wchar_t *(lua_towstring) (lua_State *L, int index); > LUA_API const wchar_t *(lua_tolwstring) (lua_State *L, int index, > size_t *length); > LUA_API void (lua_pushwstring) (lua_State *L, const wchar_t *value); > LUA_API void (lua_pushlwstring) (lua_State *L, const wchar_t *value, > size_t size); > > LUALIB_API const wchar_t *(luaL_optwstring) (lua_State *L, int index, > const wchar_t *def); > LUALIB_API const wchar_t *(luaL_checkwstring) (lua_State *L, int index); > LUALIB_API const wchar_t *(luaL_checklwstring) (lua_State *L, int > index, size_t *length); > LUALIB_API int (luaL_loadwfile) (lua_State *L, const wchar_t *filename); > > #define luaL_dowfile(L, fn) \ > (luaL_loadwfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) > > A "wstring" is a userdata which contains a NULL-terminated string of > wchar_t. lua_towstring converts a string on the stack to a wide char > string. It does replace the string on the stack, similarly to > lua_tostring and lua_tonumber when they are passed a number or a > string respectively, so the same restrictions apply (don't use on keys > in a lua_next loop). > > On windows these functions use MultiByteToWideChar and > WideCharToMultiByte to convert between utf-8 and utf-16. On other > platforms the functions use mbstowcs and wcstombs, which convert > between the current multi-byte locale and wide strings, usually ucs-4. > > On windows only, the patch modifies all calls to the C library that > uses filenames, and convert these filenames using wstring conversion > functions. > > It's only been tested on windows so far (both the > MultiByteToWideChar/WideCharToMultiByte and mbstowcs/wcstombs versions > compile there). It's not perfect (I think it may leak if a > lua_pushstring errors), and I didn't patch the Makefile since I'm not > using it. Any feedback is welcome. > --0015174784f03cff780476ed8658 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for your patch, Jerome.
I've used it and found it is a minima= l and elegant support for UTF16 unicode strings. Although it provide the r= equirements I wrote in my post, I found it does not work for me because it = does not support ability to run LUA code from UTF16 files or lines. So whil= e you support unicode strings you can't really define unicode literals = in an easy way.
Thanks!
=A0 =A0 =A0 =A0 =A0 =A0Uri Cohen

On Mon, Oct 19, 2009 at 11:25 AM, Jerome Vuarand <= jerome.vuarand@gmail.com>= ; wrote:
2009/10/16 uri co= hen <uri.cohen@gmail.com>:=
> Following the feedback that using UTF8 is better tha= n porting LUA to UTF16,
> is there a LUA port or library which allows the user to:
> - define UTF8 literals;
> - open files with UTF8 names;
> - read and write Windows unicode text using only LUA strings
> - bind with external C code which work in UTF16

I wrote such a patch, it is attached to this mail. It adds the
following to the Lua API, declared in standard lua headers but
implemented in lwstring.c:

#define LUA_HAS_WSTRING 1

LUA_API const wchar_t *(lua_towstring) (lua_State *L, int index);
LUA_API const wchar_t *(lua_tolwstring) (lua_State *L, int index,
size_t *length);
LUA_API void (lua_pushwstring) (lua_State *L, const wchar_t *value);
LUA_API void (lua_pushlwstring) (lua_State *L, const wchar_t *value,
size_t size);

LUALIB_API const wchar_t *(luaL_optwstring) (lua_State *L, int index,
const wchar_t *def);
LUALIB_API const wchar_t *(luaL_checkwstring) (lua_State *L, int index); LUALIB_API const wchar_t *(luaL_checklwstring) (lua_State *L, int
index, size_t *length);
LUALIB_API int =A0(luaL_loadwfile) (lua_State *L, const wchar_t *filename);=

#define luaL_dowfile(L, fn) =A0 =A0 \
=A0 =A0 =A0 =A0(luaL_loadwfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))<= br>
A "wstring" is a userdata which contains a NULL-terminated string= of
wchar_t. lua_towstring converts a string on the stack to a wide char
string. It does replace the string on the stack, similarly to
lua_tostring and lua_tonumber when they are passed a number or a
string respectively, so the same restrictions apply (don't use on keys<= br> in a lua_next loop).

On windows these functions use MultiByteToWideChar and
WideCharToMultiByte to convert between utf-8 and utf-16. On other
platforms the functions use mbstowcs and wcstombs, which convert
between the current multi-byte locale and wide strings, usually ucs-4.

On windows only, the patch modifies all calls to the C library that
uses filenames, and convert these filenames using wstring conversion
functions.

It's only been tested on windows so far (both the
MultiByteToWideChar/WideCharToMultiByte and mbstowcs/wcstombs versions
compile there). It's not perfect (I think it may leak if a
lua_pushstring errors), and I didn't patch the Makefile since I'm n= ot
using it. Any feedback is welcome.

--0015174784f03cff780476ed8658-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 14:56:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RGuOTK019792; Tue, 27 Oct 2009 14:56:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F74919357; Tue, 27 Oct 2009 14:55:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1A3E191B7 for ; Tue, 27 Oct 2009 14:55:04 -0200 (BRST) Received: by bwz19 with SMTP id 19so430104bwz.28 for ; Tue, 27 Oct 2009 09:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Rp+1aGEmIRK3ajSDCplATyKAruNEoj4QUTy7y8f2ar4=; b=YEpQr5jZ6rxtqy5JxPIwrWlUd7IKqUF6CUnBgFBRRNT9920KAGKQ4cGF1Oo74xb+pt haoyR6Ib/+M02Ly/pxDYThiRykhTxD9TIQbo9FhDIC278Pu2LtGrdqdKBV/0WM4Pg2kj BJ0I71Fh2SYiZ/eW9zlLRn0h7Y5O6QEMiHwzg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=b83jLM466Fgb0J59mHSHWupPNrZyDqfZ9ZGHuc4dceaYB1c9LbePDS8CSFnofv67Db JdYYAkqN90MnUvgyj9gC45S/cQl3FjuzsByKlVKwFqtnsfne8jsVE28A92jUwCAxEaxV hbpHHbWyNUAUnjjVpfhpukG8LYp4RI+v1922I= MIME-Version: 1.0 Received: by 10.204.162.137 with SMTP id v9mr3789558bkx.60.1256662555530; Tue, 27 Oct 2009 09:55:55 -0700 (PDT) In-Reply-To: <4AE72188.2030301@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 11:55:55 -0500 X-Google-Sender-Auth: c0446a99e12c5281 Message-ID: <5ba75e2f0910270955x1fd3394cvbc867d603682c18b@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=00032555a59a3995600476ed8dc8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555a59a3995600476ed8dc8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Lua is the first ever language I've learned because I really wanted it, not because of study or work. So I understand what you say :) I have started a project for those who want to migrate from PHP to Lua, it is called Nutria: http://gitorious.org/nutria http://gitorious.org/nutria/pages/Home Blessings! On Tue, Oct 27, 2009 at 11:36 AM, Patrick < spell_gooder_now@spellingbeewinnars.org> wrote: > Hi Everyone > > I am new to Lua and still reading Roberto's book. I am absolutely loving > everything that I have learned so far. It's amazing how many things are > the way I was hoping they would be in the other languages that I learned > but were not. > > I am going to use Lua with C++ and it looks like a perfect match already > but I also want to do some web based stuff. PHP just has such a large > set of libraries of which one I have already become Dependant on. Lua > seems like a better language but PHP has such a head start with the web. > What would be the best way to mesh PHP code and Lua? I know there is a > PECL extension for embedding the Lua interpretor, has anyone else used > this?Is there a better way? > > Thanks in advance-Patrick > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --00032555a59a3995600476ed8dc8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Lua is the first ever language I've learned because I really wanted it,= not because of study or work. So I understand what you say :)

I hav= e started a project for those who want to migrate from PHP to Lua, it is ca= lled Nutria:
http://gitorious.org/nutria
= http://gitorious.org/nut= ria/pages/Home

Blessings!

On T= ue, Oct 27, 2009 at 11:36 AM, Patrick <spell_gooder_now@spellingbeewin= nars.org> wrote:
Hi Everyone

I am new to Lua and still reading Roberto's book. I am absolutely lovin= g
everything that I have learned so far. It's amazing how many things are=
the way I was hoping they would be in the other languages that I learned but were not.

I am going to use Lua with C++ and it looks like a perfect match already but I also want to do some web based stuff. PHP just has such a large
set of libraries of which one I have already become Dependant on. Lua
seems like a better language but PHP has such a head start with the web. What would be the best way to mesh PHP code and Lua? I know there is a
PECL extension for embedding the Lua interpretor, has anyone else used
this?Is there a better way?

Thanks in advance-Patrick




--
Fernando P. Garc=C3=ADa= , http://www.develcuy.com
Develo= per - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha= #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--00032555a59a3995600476ed8dc8-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:01:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RH1MVX020919; Tue, 27 Oct 2009 15:01:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A93011A668; Tue, 27 Oct 2009 15:00:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96A37192FB for ; Tue, 27 Oct 2009 15:00:00 -0200 (BRST) Received: by yxe17 with SMTP id 17so307768yxe.33 for ; Tue, 27 Oct 2009 10:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=KtLFrARE9DyBEFjNIT49O9R3hUFfokRaGDB7gm+N4P4=; b=N7v+cPtRZTfGjx9OCHrFTzlx4CseJkc4tGnv8s5+xuQ1/r90Og3etOpAVj24zNG2Zm iz4e9QoKhZoLeG/NGw+VkGJg2R+WQEj97rzkzcRXZv7K2ILGESLidKbOpweVsZ6po6VG bO7SB/WriPbzW7CytEKnWgkpdI1IKvPcZ4l3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=h8d/LBElh2QzOWsg3Du9Ftcxt1ynoqO5VHIkFGi4FKMnXWucoRVh21pyXciZFfpMqW y7aootdIoVLMTZ0ye6Ib08cwqMj9JbibwMuXZD6BXidHvcmo299WDC8Q7ByJMch6quT/ e3ddbofi1a9G1LLIASUSuKucMJXtit9pO6Yjk= MIME-Version: 1.0 Received: by 10.239.182.158 with SMTP id q30mr684651hbg.23.1256662852246; Tue, 27 Oct 2009 10:00:52 -0700 (PDT) In-Reply-To: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> Date: Tue, 27 Oct 2009 19:00:52 +0200 Message-ID: <560972290910271000n3c8edf99v72b14fefb3284ca8@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 6:48 PM, Hisham wrote: > I'm happy to announce LuaRocks 2.0.1, a bugfix release: Congratulations! Second birthday! Hisham, people here on the Lua list may not know the big change in LR 2.0, which is that it now uses 'normal' Lua module paths. From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:03:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RH37Vo021332; Tue, 27 Oct 2009 15:03:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2159F1A66F; Tue, 27 Oct 2009 15:01:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.186]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D60F1A669 for ; Tue, 27 Oct 2009 15:01:49 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so102630gvf.40 for ; Tue, 27 Oct 2009 10:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=BCiIgjX3F1un5a5L0alTTeFaikRj7gchDmGJ9pS5p2w=; b=m8NOuS9mrW5JqPkJnPxArPUFPHRZRdV1Zta7Jt94LySoIUIdtdNu0oisdYdZ6gPjNy habJ0w5TmYbUPKIJbYeR82L+HlP5MHdA434s/2SgMPqYBeD4RYQpKss1i2x5DpjfcEDl tie0Ux5zUaIkblCmD3CZCslXg7bE+Tb9cKG6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=C5+3219i7yleMOlwibrpU3/jclZjUt1VwQbimcgaR0cWWSvoMr56msgieVe00qe9na k/g7lklsnGz0pqcIZ7bv1L91KCDChz9YHADxznTSiXq77/aHz4JXZyYkPDE29nJrvpLS 981L+Ai9+XtF6bg6h4slFQR+fPv+gNwwmR93U= MIME-Version: 1.0 Received: by 10.216.86.16 with SMTP id v16mr216946wee.162.1256662959247; Tue, 27 Oct 2009 10:02:39 -0700 (PDT) In-Reply-To: <76882e540910270953j6f9cfeefpbe7e6f29a47ce26d@mail.gmail.com> References: <76882e540910141557q38e7fa51p75839f865c0591d1@mail.gmail.com> <89d273ba0910142004s2096d92g66d77566f6bd2043@mail.gmail.com> <4AD69BA5.8070501@sct.microlink.com.br> <76882e540910160642g6239d298qbcba594b0085c07d@mail.gmail.com> <89d273ba0910190225j113dc796w2d01ed8505b20ca@mail.gmail.com> <76882e540910270953j6f9cfeefpbe7e6f29a47ce26d@mail.gmail.com> From: Jerome Vuarand Date: Tue, 27 Oct 2009 18:02:19 +0100 Message-ID: <89d273ba0910271002k39fed14xaabed28e3df506af@mail.gmail.com> Subject: Re: Testing LUA: verify the correctness of a UTF16 LUA port To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/10/27 uri cohen : > Thanks for your patch, Jerome. > I've used it and found it is a minimal and elegant support for UTF16 unicode > strings. Although it provide the requirements I wrote in my post, I found it > does not work for me because it does not support ability to run LUA code > from UTF16 files or lines. So while you support unicode strings you can't > really define unicode literals in an easy way. If you encode your scripts as utf-8, you can have any unicode character in literal strings. If you really need your scripts to be utf-16 rather than utf-8, it's very easy to write a script loader that does the conversion on the fly. From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:05:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RH5OuA021766; Tue, 27 Oct 2009 15:05:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03F091A671; Tue, 27 Oct 2009 15:04:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 148BD192FB for ; Tue, 27 Oct 2009 15:03:58 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so4968eye.39 for ; Tue, 27 Oct 2009 10:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=UbuC/xd/6GaTJ6CZz0M2XJGWjfKApV6zO72eaFubZHY=; b=Gk5aVVhL9+C2JBUXaPX5Fc1DaYJLRQ0i3knO6L2BVAsbZ54fUX+sc16HS8+SAOLUcO NvOCP8/Dz1xrBDynuAvX/uKW6TjxZuo77Pis/z4CKnvPsszI9vmyaqr2VtSyx5IHiPpn Xa62oUIIa3GmqYAzdWchEGFL5MQIVXS8xoQd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=j1CbV1QWNgzj87Qv9X5SyqfdBjZstOeJMH4vh+mis2wmayDerdjAzWuBvipFBjQ0X9 PW8Ra7rz25pBd2JlovIIvJisOAt967l78kj5yD1KN6D9ByTfHUTBRW5PYv9A0sGxEzbi FjXtWpipDeBfML2baUWiAyzFEypBUje0lkBHE= MIME-Version: 1.0 Received: by 10.211.184.14 with SMTP id l14mr2833368ebp.18.1256663090159; Tue, 27 Oct 2009 10:04:50 -0700 (PDT) In-Reply-To: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> Date: Tue, 27 Oct 2009 18:04:50 +0100 X-Google-Sender-Auth: aa2689e876d44267 Message-ID: <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 From: =?UTF-8?Q?Linus_Sj=C3=B6gren?= To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'm happy to announce LuaRocks 2.0.1, a bugfix release: Everything looks great and all, but can you see about getting it into the Ubuntu repos? The latest version on 'universe' is 0.6... From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:34:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RHYb68029189; Tue, 27 Oct 2009 15:34:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3FD6192C0; Tue, 27 Oct 2009 15:33:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1302A192A8 for ; Tue, 27 Oct 2009 15:33:09 -0200 (BRST) Received: by bwz19 with SMTP id 19so475644bwz.28 for ; Tue, 27 Oct 2009 10:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=VP1/ENVhNVYCsC9HR5MVfZD+h84uodXPE93kH1hjuIg=; b=LF7b0a/MpI9Jt1JU0E4k0b9R5xV0Vb5dIpvm6oIN9ETFS2bH8DHHXr0L2/aBcZpxit afz/Lm0TEmwYqpS2sBgwtaq+ZMbmJctO248d72zf15Ujrno1ozmI8BtXDpaJT/9HwFdo CqBhdQ1CYnlg0lU0vmolggLEaT2r0Gj7iemEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=vzb5dM5q1mqoWHkS5Fu1CMby1OMU8xdS7pmlSjhMxgMToWVRt9dN52rk0AYHvTdyPK IBpqtnV2pnz6Z7HdJGlVPeJkxs8iHVXWRfzCHiq5NIG0fuM0xZmxnofiCo09Tc3Udjas P19K4O9IOmpzWMz5wS73ELhGUTxY3XOoCfM0I= MIME-Version: 1.0 Received: by 10.223.97.132 with SMTP id l4mr940295fan.100.1256664841205; Tue, 27 Oct 2009 10:34:01 -0700 (PDT) In-Reply-To: <560972290910271000n3c8edf99v72b14fefb3284ca8@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <560972290910271000n3c8edf99v72b14fefb3284ca8@mail.gmail.com> From: Hisham Date: Tue, 27 Oct 2009 15:33:41 -0200 Message-ID: <5e7d91620910271033m34b1920fwc66cd7cc2ffc2894@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 3:00 PM, steve donovan wrote: > On Tue, Oct 27, 2009 at 6:48 PM, Hisham wrote: >> I'm happy to announce LuaRocks 2.0.1, a bugfix release: > > Congratulations! Second birthday! Thank you! > Hisham, people here on the Lua list may not know the big change in LR > 2.0, which is that it now uses 'normal' Lua module paths. This was the first item in the What's New list for LR 2.0.0, but it never hurts to restate: :) * module files are now deployed to standard Lua-style paths: $PREFIX/lib/lua/5.1 and $PREFIX/share/lua/5.1. This means that vanilla builds of Lua and LuaRocks are now compatible with each other out-of-the-box (installing into /usr/local). This means require("luarocks.require") is no longer necessary to load modules installed using LuaRocks. Support for multiple repositories and multiple versions in a repository is still retained (for the latter, the new require("luarocks.loader") is needed -- luarocks.require works as a compatibility alias). -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:36:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RHa0P8029469; Tue, 27 Oct 2009 15:36:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2192B192F7; Tue, 27 Oct 2009 15:34:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8917E192A8 for ; Tue, 27 Oct 2009 15:34:42 -0200 (BRST) Received: by bwz19 with SMTP id 19so477377bwz.28 for ; Tue, 27 Oct 2009 10:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=k8OKOSZ1ruP5ema4VYnXA61ZliEGYS4FO2dE4SFP/bY=; b=b9nVbdQoBH8f1BjZYoncfeSgqozFPYQV1R42kSwv/McHpzEXnKJhm5/nenYvKfUyL0 z4oHtP522ueHB+kelvcV9T2hZiRgMlmNrlzV38PASC6RjbrO6atH5nCUmya5Qs2G8fat cDaETPPORCwelSUyfuapG9GMvVxVw29gH7gbM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=iNPraNvYiq7NewuErY6J4BLxiEKlFLPwDgv44c11kJJuljqA6pnhBEUmUI3dY2bKGf V5SEXDNwePN1dgyWKLL8YcmvCITgmOdOwQF76x4JN9M/AqSke5EUmxMXu702uh69cGQp 9LgefRrSYyfRHc7sckjf565jSQLph9ICPAQTY= MIME-Version: 1.0 Received: by 10.223.4.132 with SMTP id 4mr206498far.45.1256664933702; Tue, 27 Oct 2009 10:35:33 -0700 (PDT) In-Reply-To: <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> From: Hisham Date: Tue, 27 Oct 2009 15:35:13 -0200 Message-ID: <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9RHa0P8029469 On Tue, Oct 27, 2009 at 3:04 PM, Linus Sjögren wrote: >> I'm happy to announce LuaRocks 2.0.1, a bugfix release: > > Everything looks great and all, but can you see about getting it into > the Ubuntu repos? > The latest version on 'universe' is 0.6... I'm not the maintainer for any distro packages of LuaRocks. My advice would be to get in contact with the downstream maintainer for your favorite distro and ask them to update. :) -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 15:53:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RHqmwZ003584; Tue, 27 Oct 2009 15:53:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A89A19397; Tue, 27 Oct 2009 15:51:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B32EE1938E for ; Tue, 27 Oct 2009 15:51:24 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so15306eye.39 for ; Tue, 27 Oct 2009 10:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fXhIp0WazcNr7G4HYgAIZa0raGhuatWlkfWgMd3bQwc=; b=bUKCR1QYm42gVG+Lwac3Yia61pGD8zfbuaAYMJpj30YryfJsv6Ty5XREV8mVAZkL8d 56mSJLUlShB5o187aO87xyq0et6Lq6VkEJNwggdKuV4OM5wDwWuwJ3iCE4HM1NSWNqE7 cVucN14oOLdXI8lajCWjxQ1xz8Cg0I3/a/230= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Yi83DlIJPFAM9JTpW5bNNwQ2BA+PSMmEs0VcPHylDfdbEvphk6nOGrf8JhRtjvKEd8 KNGYOwGFE6NUEROVJ94chBYx0QuGY0PnZ8bDQZLbAUUAO/XN8QLjPYBAkxNrSAbMBjpJ wuPLdqZfbPXh0GqGd9HTPHUN8RenNX2mJcJf8= MIME-Version: 1.0 Received: by 10.216.86.129 with SMTP id w1mr515673wee.145.1256665935893; Tue, 27 Oct 2009 10:52:15 -0700 (PDT) In-Reply-To: <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> Date: Tue, 27 Oct 2009 10:52:15 -0700 Message-ID: <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9RHqmwZ003584 On Tue, Oct 27, 2009 at 10:35 AM, Hisham wrote: > On Tue, Oct 27, 2009 at 3:04 PM, Linus Sjögren > wrote: >>> I'm happy to announce LuaRocks 2.0.1, a bugfix release: >> >> Everything looks great and all, but can you see about getting it into >> the Ubuntu repos? >> The latest version on 'universe' is 0.6... > > I'm not the maintainer for any distro packages of LuaRocks. My advice > would be to get in contact with the downstream maintainer for your > favorite distro and ask them to update. :) For debian and ubuntu, the way to do this would be to report a bug against the out-of-date package. Sam From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 17:05:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RJ4vEt021314; Tue, 27 Oct 2009 17:04:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A88D919383; Tue, 27 Oct 2009 17:03:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22C4D19373 for ; Tue, 27 Oct 2009 17:03:24 -0200 (BRST) Received: by bwz19 with SMTP id 19so43458bwz.28 for ; Tue, 27 Oct 2009 12:04:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.36.203 with SMTP id u11mr170229bkd.141.1256670255130; Tue, 27 Oct 2009 12:04:15 -0700 (PDT) In-Reply-To: <4AE72188.2030301@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 20:04:15 +0100 X-Google-Sender-Auth: aa57dd4bdf3dc978 Message-ID: Subject: Re: Advice Mixing PHP and Lua? From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 5:36 PM, Patrick wrote: > Hi Everyone > > I am new to Lua and still reading Roberto's book. I am absolutely loving > everything that I have learned so far. It's amazing how many things are > the way I was hoping they would be in the other languages that I learned > but were not. > > I am going to use Lua with C++ and it looks like a perfect match already > but I also want to do some web based stuff. PHP just has such a large > set of libraries of which one I have already become Dependant on. Lua > seems like a better language but PHP has such a head start with the web. > What would be the best way to mesh PHP code and Lua? I know there is a > PECL extension for embedding the Lua interpretor, has anyone else used > this?Is there a better way? > > Thanks in advance-Patrick Hi Patrick, If you want to go PHP+Lua, the best is to use the PECL extension. You can try my branch here, I have fixed a few little things: http://svn.php.net/viewvc/pecl/lua/branches/NO_LUA_TABLE/ I use this in my trylua experiment and it's working great. http://trylua.mamasam.com The PECL extension needs more love, if you want to work on it, you are welcome, just let me know. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 17:14:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RJEMik023151; Tue, 27 Oct 2009 17:14:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F69A1939C; Tue, 27 Oct 2009 17:13:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32DED19389 for ; Tue, 27 Oct 2009 17:12:54 -0200 (BRST) Received: by bwz19 with SMTP id 19so54203bwz.28 for ; Tue, 27 Oct 2009 12:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FdKN8ChUwNxHBPqHQnP/xw9jqO4WiV9iexL6APR0Aa4=; b=xCIyYgxVw19wlGfHvPqTW8/Qz6PKmnAyrhGSbPiQJKC/0Ns3iaXeC7e+Z/2EPzQMPp BzgxbOB3IsOjLmPsTloQ+3C5AphtBxxzNeUFLhAb24HfkuFe4wlXB1vxvO9rVs61Cn5e xb2Bd0vBnN5LdhCRAiV716R+zEg7Ic7gV8240= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=n6Ws962iR/wECrC/sHE7P0ocwcxUAtdzwaE9w5kh/wCBVRbeoFr/9x6dpRmG0kxyw+ c46eiJAKpWdFxgbZSXMCTzu81PLFWJo/Y2elqvSHW357dwdzBJTlFOApFulTer/IeOr9 NmcJomWxrqWDYxoQpTMzEkmv73X69G+tMOR2w= MIME-Version: 1.0 Received: by 10.204.156.212 with SMTP id y20mr5349998bkw.126.1256670824518; Tue, 27 Oct 2009 12:13:44 -0700 (PDT) In-Reply-To: References: <4AE72188.2030301@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 20:13:43 +0100 Message-ID: <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: troels knak-nielsen To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Which libraries in particular are you using from php? -- troels On Tue, Oct 27, 2009 at 8:04 PM, Bertrand Mansion wrote: > On Tue, Oct 27, 2009 at 5:36 PM, Patrick > wrote: >> Hi Everyone >> >> I am new to Lua and still reading Roberto's book. I am absolutely loving >> everything that I have learned so far. It's amazing how many things are >> the way I was hoping they would be in the other languages that I learned >> but were not. >> >> I am going to use Lua with C++ and it looks like a perfect match already >> but I also want to do some web based stuff. PHP just has such a large >> set of libraries of which one I have already become Dependant on. Lua >> seems like a better language but PHP has such a head start with the web. >> What would be the best way to mesh PHP code and Lua? I know there is a >> PECL extension for embedding the Lua interpretor, has anyone else used >> this?Is there a better way? >> >> Thanks in advance-Patrick > > Hi Patrick, > > If you want to go PHP+Lua, the best is to use the PECL extension. You > can try my branch here, I have fixed a few little things: > http://svn.php.net/viewvc/pecl/lua/branches/NO_LUA_TABLE/ > > I use this in my trylua experiment and it's working great. > http://trylua.mamasam.com > > The PECL extension needs more love, if you want to work on it, you are > welcome, just let me know. > > -- > Bertrand Mansion > Mamasam > From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 17:34:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RJYeCP027333; Tue, 27 Oct 2009 17:34:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1B8C193A5; Tue, 27 Oct 2009 17:33:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-347.bluehost.com (outbound-mail-347.bluehost.com [66.147.249.8]) by bazar2.conectiva.com.br (Postfix) with SMTP id 60AC1192DC for ; Tue, 27 Oct 2009 17:33:19 -0200 (BRST) Received: (qmail 30405 invoked by uid 0); 27 Oct 2009 19:34:05 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 27 Oct 2009 19:34:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=OtevErKHUPsgoMrtrP9LmWw/Dxij1g63xue/x7PTLuC/vKQhvFJIKCg0snP5Bi+kd+100nG8gFgAyGBUow28t86lugvePvmGc3qgMU7XjoEO2uCoXy4IL7awuTVMrusM; Received: from bas3-unionville55-1279332649.dsl.bell.ca ([76.65.17.41] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N2rnx-0007or-D6 for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 13:34:05 -0600 Message-ID: <4AE74B2B.5080207@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 15:34:03 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Advice Mixing PHP and Lua? References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> In-Reply-To: <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.65.17.41 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Troels Actually the only thing I am really suck with is FPDF. I want to generate PDF quotes for my small business. Thanks-Patrick troels knak-nielsen wrote: > Which libraries in particular are you using from php? > > From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 17:47:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RJlEgq030323; Tue, 27 Oct 2009 17:47:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FCA0193AE; Tue, 27 Oct 2009 17:45:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE25619385 for ; Tue, 27 Oct 2009 17:45:41 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS600H47UVU4H80@asmtp012.mac.com> for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 12:46:04 -0700 (PDT) Message-id: <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> From: Petite Abeille To: Lua list In-reply-to: <4AE74B2B.5080207@spellingbeewinnars.org> Subject: Re: Advice Mixing PHP and Lua? Date: Tue, 27 Oct 2009 20:45:30 +0100 References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 27, 2009, at 8:34 PM, Patrick wrote: > Actually the only thing I am really suck with is FPDF. I want to > generate PDF quotes for my small business. Perhaps something like lpdf would help? http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpdf lpdf is a binding for PDFlib: http://www.pdflib.com/ From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:02:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RK2thj001354; Tue, 27 Oct 2009 18:02:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D99D193BC; Tue, 27 Oct 2009 18:01:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F68E193B5 for ; Tue, 27 Oct 2009 18:01:36 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RK2QQd001278 for ; Tue, 27 Oct 2009 18:02:26 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9RK2P332690; Tue, 27 Oct 2009 18:02:25 -0200 Date: Tue, 27 Oct 2009 18:02:24 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Advice Mixing PHP and Lua? Message-ID: <20091027180224.A32672@lua.tecgraf.puc-rio.br> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com>; from petite_abeille@mac.com on Tue, Oct 27, 2009 at 08:45:30PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On Oct 27, 2009, at 8:34 PM, Patrick wrote: > > > Actually the only thing I am really suck with is FPDF. I want to > > generate PDF quotes for my small business. > > Perhaps something like lpdf would help? > > http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpdf > > lpdf is a binding for PDFlib: FPDF explicitly avoids PDFlib. Looking at the code in FPDF, it seems to be easy to convert to pure Lua, but of course I know no PHP. If anyone knows PHP and can confirm that it'd be easy to convert to pure Lua, I could try it. From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:06:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RK6ebO001996; Tue, 27 Oct 2009 18:06:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61EA2193CD; Tue, 27 Oct 2009 18:05:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87074193C5 for ; Tue, 27 Oct 2009 18:05:17 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RK68fp001892 for ; Tue, 27 Oct 2009 18:06:08 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9RK68h32705; Tue, 27 Oct 2009 18:06:08 -0200 Date: Tue, 27 Oct 2009 18:06:07 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Advice Mixing PHP and Lua? Message-ID: <20091027180607.B32672@lua.tecgraf.puc-rio.br> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091027180224.A32672@lua.tecgraf.puc-rio.br>; from lhf@tecgraf.puc-rio.br on Tue, Oct 27, 2009 at 06:02:24PM -0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > FPDF explicitly avoids PDFlib. Another route would be a Lua binding to the free libHaru: http://luahpdf.luaforge.net/ From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:15:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RKFriC004172; Tue, 27 Oct 2009 18:15:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C2BC1939B; Tue, 27 Oct 2009 18:14:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B85A619381 for ; Tue, 27 Oct 2009 18:14:24 -0200 (BRST) Received: by bwz27 with SMTP id 27so121545bwz.21 for ; Tue, 27 Oct 2009 13:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Kdo7qqdYpsCAGiYXESBRUfBYCh722ToNNpIY+i2ILyU=; b=hILPkym+6jd+h5oJSH2gcId8oa/KAnTV+vPtovtsfDfdd1MWrfKHOi8UUoffkxm2nc XPyuEkTTGrKWbm4u5G6uiwhXt1NvT6SDuN0BuOwCeSb1ecFB5ShB5wxBqfmhoR8+r/Jh rgzdorZF/EOtpvj8pqMNQqjQDoA9hwGxX6aFg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DLGiGNr70usZulN00nZKtEtVqCIjymtvdneRlrjSw2owvxOb8Ftt4ESjfoeGO0zDLN Q1edgnSD4gcyioNeHtNp6WWYYtKz6FXFQ/SnBXmzEjuORXeV5rZ8S5yPfzNVLraKqUYT sd/pJEO+FJqPy6v+gszTDVJAXB3RKryx4IeoE= MIME-Version: 1.0 Received: by 10.204.34.78 with SMTP id k14mr145372bkd.106.1256674515041; Tue, 27 Oct 2009 13:15:15 -0700 (PDT) In-Reply-To: <4AE74B2B.5080207@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 21:15:13 +0100 Message-ID: <98b8086f0910271315u731e9784qfbac9d748350837f@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: troels knak-nielsen To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 8:34 PM, Patrick wrote: > Hi Troels > > Actually the only thing I am really suck with is FPDF. I want to > generate PDF quotes for my small business. > If you generate pdf's, chances are that you are doing it in an offline mail-merge fashion (just guessing here of course, but that's a common thing to do). In that case, you could keep your current php code for generating pdf's, but use Lua for everything else. There is no rule that you *must* use the same language for every part of your application. From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:19:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RKJZpE004780; Tue, 27 Oct 2009 18:19:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D477D1A65A; Tue, 27 Oct 2009 18:18:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47DCA193C8 for ; Tue, 27 Oct 2009 18:17:57 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N2sVA-0004Qv-8T for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 21:18:44 +0100 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 21:18:44 +0100 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Oct 2009 21:18:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Advice Mixing PHP and Lua? Date: Tue, 27 Oct 2009 13:17:40 -0700 Lines: 27 Message-ID: References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <20091027180224.A32672@lua.tecgraf.puc-rio.br> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> On Oct 27, 2009, at 8:34 PM, Patrick wrote: >> >>> Actually the only thing I am really suck with is FPDF. I want to >>> generate PDF quotes for my small business. >> Perhaps something like lpdf would help? >> >> http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpdf >> >> lpdf is a binding for PDFlib: > > FPDF explicitly avoids PDFlib. Perhaps LuaHPDF then? http://luahpdf.luaforge.net/ > > Looking at the code in FPDF, it seems to be easy to convert to pure Lua, > but of course I know no PHP. If anyone knows PHP and can confirm that it'd > be easy to convert to pure Lua, I could try it. > The PDF dialect that FPDF creates appears to be a slightly older one, which is basically a red-headed stepchild of Postscript. This means that it is just a fancy text template/generation engine. It shouldn't be TOO hard to port it over... (famous last words) From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:26:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RKPw9u006553; Tue, 27 Oct 2009 18:25:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60E541A669; Tue, 27 Oct 2009 18:24:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 061601A65E for ; Tue, 27 Oct 2009 18:24:31 -0200 (BRST) Received: by ewy26 with SMTP id 26so114767ewy.5 for ; Tue, 27 Oct 2009 13:25:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.155.20 with SMTP id h20mr541802ebo.44.1256675122189; Tue, 27 Oct 2009 13:25:22 -0700 (PDT) In-Reply-To: References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Date: Tue, 27 Oct 2009 15:25:22 -0500 Message-ID: <90eb1dc70910271325o6c83351ek5d4168cde4046d3e@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 3:17 PM, Stefan wrote: >> >> Looking at the code in FPDF, it seems to be easy to convert to pure Lua, >> but of course I know no PHP. If anyone knows PHP and can confirm that it'd >> be easy to convert to pure Lua, I could try it. >> > > The PDF dialect that FPDF creates appears to be a slightly older one, which > is basically a red-headed stepchild of Postscript. This means that it is > just a fancy text template/generation engine. It shouldn't be TOO hard to > port it over... (famous last words) i can confirm that FPDF does very little more than just outputting some text to a file. this is as "PDF" as any other, it's just not binary-encoded. i think the only non-obvious thing to do is to remember the file offsets where each page begins, so that at file-closing time you can add the 'directory' part. the second enhancement is not to repeat an embedded image, but to create a 'resource' and use its definition on each usage. (disclaimer, this is from hazy memory of reading several iterations of the adobe specs, and the source of FPDF and Redland libs) -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:29:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RKTW21007001; Tue, 27 Oct 2009 18:29:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46570193AE; Tue, 27 Oct 2009 18:28:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C0F819387 for ; Tue, 27 Oct 2009 18:28:08 -0200 (BRST) Received: by bwz27 with SMTP id 27so135963bwz.21 for ; Tue, 27 Oct 2009 13:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=a8QwqJlfUD2XGSvjxQ+pSZIhCSItgZaMBHycjz5XOkY=; b=rSpL+XtULIEhgS+E3kKnl6bbyhZc/QfkxbeALqtN3NsFF5h9tclfIZFPBgyd+GExMd ixnw0AjkRSg3Mfubj+mm9kdAPNtD2BekajlBJbUz7nv4x2miutfMGEcmDfoN/frFnd6X /E/3fp04z6GhajdvhOM1oQ8VDc9jAAkhNUlhw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=coQjZoSdHKnI8VB60rijzMb8z+R+vLH4xvpOEQ3Hdi9yFPux26tqyWUR4uuUt6/u3L LU815ytSWdLbewTX5qwGCjCnJi8Yge/BvCW/ejkz2ZHTSB2ELFWXV31KRZzvwjMBxWPi o9F37hVaXJSfJevXBzipEUwYjq0ppm8Ze35U8= MIME-Version: 1.0 Received: by 10.204.35.142 with SMTP id p14mr2010868bkd.21.1256675339878; Tue, 27 Oct 2009 13:28:59 -0700 (PDT) In-Reply-To: References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Date: Tue, 27 Oct 2009 21:28:59 +0100 Message-ID: <98b8086f0910271328j1dac0877xfc349490e310a1d4@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: troels knak-nielsen To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 9:17 PM, Stefan wrote: >> Looking at the code in FPDF, it seems to be easy to convert to pure Lua, >> but of course I know no PHP. If anyone knows PHP and can confirm that it'd >> be easy to convert to pure Lua, I could try it. >> > > The PDF dialect that FPDF creates appears to be a slightly older one, which > is basically a red-headed stepchild of Postscript. This means that it is > just a fancy text template/generation engine. It shouldn't be TOO hard to > port it over... (famous last words) I just skimmed the code through. It's very procedural in style, which probably makes it relatively simple to understand and port, even if it's ugly as heck. The library depends on the zlib extension for compression, and on gdlib for converting gif images into png, and for finding the dimensions of image files. You'll need replacements for both of those. Otherwise it looks like something that could be done in a weekend. If you give it a try, you're welcome to ask me for help. I know php pretty well. -- troels From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 18:47:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RKlKVm009650; Tue, 27 Oct 2009 18:47:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E6B9193C0; Tue, 27 Oct 2009 18:46:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-348.bluehost.com (outbound-mail-348.bluehost.com [66.147.249.9]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9E4711939B for ; Tue, 27 Oct 2009 18:45:59 -0200 (BRST) Received: (qmail 27792 invoked by uid 0); 27 Oct 2009 20:46:47 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 27 Oct 2009 20:46:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=LJzpVUoaVoTmvl3EQ4tcMRrrKLJHMX7FXjiD+V+ATPrOwtpDVfxEjqUCTqJvaHOemXiyeqwvf333/DWhoenMVmtGMkwYqUL0y2tpw7CGcZDwqpQgAzagoLtEzizLZ/um; Received: from bas3-unionville55-1279332649.dsl.bell.ca ([76.65.17.41] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N2swJ-0007et-O4 for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 14:46:47 -0600 Message-ID: <4AE75C36.8020708@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 16:46:46 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Advice Mixing PHP and Lua? References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.65.17.41 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Wow, you guys are awesome thanks so much for these great responses. My Lua skills are still minimal but if a port of FPDF does need to be done, I would like to contribute in some way. I just read today that Apache will come with Mod_Lua by default. This sounds like very exciting news. I am just wondering, if it came down to a FPDF port vs LuaHPDF, which would be better to bring new users to Lua? If Mod_Lua will come pre-installed does this mean that many economy hosting providers will eventually have Lua by default as well? LuaHDPF must be complied but an FPDF port would be just another Lua script. Would this make it easier to attract new users? From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:05:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RL5Q0c012180; Tue, 27 Oct 2009 19:05:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11ADE193CF; Tue, 27 Oct 2009 19:04:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5F94193AE for ; Tue, 27 Oct 2009 19:03:55 -0200 (BRST) Received: by ewy26 with SMTP id 26so155121ewy.5 for ; Tue, 27 Oct 2009 14:04:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.147.5 with SMTP id z5mr495763ebn.87.1256677487612; Tue, 27 Oct 2009 14:04:47 -0700 (PDT) In-Reply-To: <4AE75C36.8020708@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> <4AE75C36.8020708@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 16:04:47 -0500 Message-ID: <90eb1dc70910271404p755a3343je99df445f219cbd5@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 3:46 PM, Patrick wrote: > Wow, you guys are awesome thanks so much for these great responses. > > My Lua skills are still minimal but if a port of FPDF does need to be > done, I would like to contribute in some way. a big help would be to detail all the PDF objects created by FPDF, together with a template to reproduce them. using that as a base would be a lot faster than using the adobe docs. > I just read today that Apache will come with Mod_Lua by default. This > sounds like very exciting news. I am just wondering, if it came down to > a FPDF port vs LuaHPDF, which would be better to bring new users to Lua? > If Mod_Lua will come pre-installed does this mean that many economy > hosting providers will eventually have Lua by default as well? as the Django people are learning, having the language interpreter embedded in the apache processes usually isn't the best idea. currently the advised deployment architecture uses mod_wsgi instead of mod_python, especially using the 'daemon' mode, which spawns the python VM(s) separate from apache's own processes/threads. Not too different from FastCGI, but with better task longevity management. check this: http://www.modpython.org/pipermail/mod_python/2007-July/024080.html > LuaHDPF must be complied but an FPDF port would be just another Lua > script. Would this make it easier to attract new users? totally. the 'pure Lua' tag is a big plus in any project -- Javier From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:13:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RLCwLb013270; Tue, 27 Oct 2009 19:12:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA126193DE; Tue, 27 Oct 2009 19:11:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0E9F193D4 for ; Tue, 27 Oct 2009 19:11:35 -0200 (BRST) Received: by bwz19 with SMTP id 19so182339bwz.28 for ; Tue, 27 Oct 2009 14:12:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.7.144 with SMTP id d16mr7611476bkd.209.1256677946656; Tue, 27 Oct 2009 14:12:26 -0700 (PDT) In-Reply-To: <20091027180224.A32672@lua.tecgraf.puc-rio.br> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Date: Tue, 27 Oct 2009 22:12:26 +0100 X-Google-Sender-Auth: a62384e9e353b589 Message-ID: Subject: Re: Advice Mixing PHP and Lua? From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 9:02 PM, Luiz Henrique de Figueiredo wrote: >> On Oct 27, 2009, at 8:34 PM, Patrick wrote: >> >> > Actually the only thing I am really suck with is FPDF. I want to >> > generate PDF quotes for my small business. >> >> Perhaps something like lpdf would help? >> >> http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpdf >> >> lpdf is a binding for PDFlib: > > FPDF explicitly avoids PDFlib. > > Looking at the code in FPDF, it seems to be easy to convert to pure Lua, > but of course I know no PHP. If anyone knows PHP and can confirm that it'd > be easy to convert to pure Lua, I could try it. > Hi Luiz, FPDF is very popular in the PHP world because it is free and easy to use. Its pseudo OO code is ugly though. But TCPDF, which is even more useful is even uglier, probably the ugliest code I have seen in PHP ever. But it does the job quite well and has lots of features. I produce this kind of documents with it : http://www.intermedes.com/voyage/2010/174-chili-du-cap-horn-atacama.pdf The best PHP PDF class in terms of "code beauty" is Zend_PDF. Unfortunately it is incomplete as for example it doesn't support cells. But its API is nice and powerful. You might want to have a look at it before you start working on a pure Lua PDF module. If you are more familiar with Python, there are at least two FPDF ports in Python: http://juanfernandoe.googlepages.com/ http://www.sistemasagiles.com.ar/trac/browser/pyfpdf/FPDF.py There are also some Ruby ports: http://code.zhdk.ch/projects/leihs/browser/trunk/lib/fpdf/fpdf.rb http://github.com/edwinmoss/rfpdf It would be nice to have such a thing in Lua, indeed :) -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:51:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RLpMdE018887; Tue, 27 Oct 2009 19:51:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 681F21939B; Tue, 27 Oct 2009 19:50:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from postduif.ic.uva.nl (postduif.ic.uva.nl [145.18.40.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C54918BB1 for ; Tue, 27 Oct 2009 19:49:59 -0200 (BRST) Received: from [192.168.178.23] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by postduif.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n9RLoiYF003605 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 27 Oct 2009 22:50:47 +0100 Message-Id: From: Hans van der Meer To: lua-list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: ARM series Lua implementation? Date: Tue, 27 Oct 2009 22:50:44 +0100 X-Mailer: Apple Mail (2.936) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.180 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Now that I have NAS built around a Marvell 6281 (ARM x19 series) running a Linux system, I wonder if there is a Lua implementation running on this combination. For those who are acquainted with this system: it is a QNAP TS-419P. Hans van der Meer From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:54:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RLsiPp019295; Tue, 27 Oct 2009 19:54:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C262193E5; Tue, 27 Oct 2009 19:53:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9ABB8193DF for ; Tue, 27 Oct 2009 19:53:20 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2tzV-0007KB-HG for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 21:54:09 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 878728FAE1 for ; Tue, 27 Oct 2009 21:54:06 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:57273 with envelope Message-ID: <4AE76BFA.7010506@cowlark.com> Date: Tue, 27 Oct 2009 21:54:02 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Advice Mixing PHP and Lua? References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9RLsiPp019295 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bertrand Mansion wrote: [...] > FPDF is very popular in the PHP world because it is free and easy to > use. Its pseudo OO code is ugly though. > But TCPDF, which is even more useful is even uglier, probably the > ugliest code I have seen in PHP ever. On the gripping hand, don't forget that you can also write out an XSL-FO file, which is dead easy because it's just simple XML, then run the result through fop and generate PDF from that. This has the advantage in that you can trivially define all your style in off-line XSLT documents so that all your Lua code needs to concern itself with is the actual content... but it has the disadvantage in that all your style is stored in off-line XSLT documents. http://www.learn-xsl-fo-tutorial.com/ http://xmlgraphics.apache.org/fop/ - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK52v3f9E0noFvlzgRAlkCAJ0Zll2s9KRLpxijDQYb1MrXWszq0wCfZ7U4 c56DR1CXD2Cn+wPPYSTW9hs= =9tKG -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:56:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RLuLEx019486; Tue, 27 Oct 2009 19:56:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98AEA193F0; Tue, 27 Oct 2009 19:55:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12E5E193EA for ; Tue, 27 Oct 2009 19:55:06 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2u1G-00022U-0C for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 21:55:58 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 58FE33D5B5 for ; Tue, 27 Oct 2009 21:55:55 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:57276 with envelope Message-ID: <4AE76C67.6070308@cowlark.com> Date: Tue, 27 Oct 2009 21:55:51 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9RLuLEx019486 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hans van der Meer wrote: > Now that I have NAS built around a Marvell 6281 (ARM x19 series) running > a Linux system, I wonder if there is a Lua implementation running on > this combination. For those who are acquainted with this system: it is a > QNAP TS-419P. Yes, stock Lua Just Works on it. (I have a SheevaPlug, which has a Marvell 88FR131 'Feroceon' in it.) In general, Lua is completely platform-independent and and needs no modification to Just Work on any 32-bit CPU with enough RAM. There isn't a LuaJIT for ARM yet, though. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK52xnf9E0noFvlzgRAj+wAJ9bHjAKvIFFGOnct8CoINumQuZ8fwCgr02G x111nSUu/T6IqJcnfttikqU= =UgEY -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 19:59:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RLxHQB019881; Tue, 27 Oct 2009 19:59:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2BF8193F3; Tue, 27 Oct 2009 19:58:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dottedmag.net (burger.dottedmag.net [212.75.37.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C70B193E2 for ; Tue, 27 Oct 2009 19:58:00 -0200 (BRST) Received: from vertex (unknown [91.197.127.125]) by dottedmag.net (Postfix) with ESMTPSA id E6F818C03E for ; Tue, 27 Oct 2009 22:58:51 +0100 (CET) Received: from dottedmag by vertex with local (Exim 4.69) (envelope-from ) id 1N2u41-0003be-H4 for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 03:58:49 +0600 From: Mikhail Gusarov To: Lua list Subject: Re: ARM series Lua implementation? References: Date: Wed, 28 Oct 2009 03:58:45 +0600 In-Reply-To: (Hans van der Meer's message of "Tue, 27 Oct 2009 22:50:44 +0100") Message-ID: <87fx947b3e.fsf@vertex.dottedmag.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-=-= Content-Transfer-Encoding: quoted-printable Twas brillig at 22:50:44 27.10.2009 UTC+01 when H.vanderMeer@uva.nl did gyr= e and gimble: HvdM> Now that I have NAS built around a Marvell 6281 (ARM x19 series) HvdM> running a Linux system, I wonder if there is a Lua implementation HvdM> running on this combination. Stock Lua will work on it, as David already pointed out. You'd probably like to see LNUM patch, which makes Lua use integers for sufficiently small numbers instead of floating point numbers. =2D-=20 http://fossarchy.blogspot.com/ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJK520WAAoJEJ0g9lA+M4iI0KQP/izpBPGDy4mVAVOivq60Yyv7 hoe+6wNlsccc6Ds0ZpenRno9UQLF3U4QorgchxFeZn+Qg6oGDNXwCL4weY7jW3dG A8r6wG3TJNAJbEVc2Lb5FL5KRBfclTR9e3WSHWOKJUq/fih2vYMsxfoKAWhJbsIz 0oqBXvZt7zPi8z+yvoTtWaMDlmdC/pi2ULYOGonWhuWNrfq7kLVEpJ1jx893RQtK m2QzUhnnreTR1GEJmykAD/0pZKRoDk89b0Sd/mnwr+7I02/pyXd1BLtZXQgh+uqf OjxDwiKcxXC0SoXVU+Hi60LdvjXGvOf/FbOM97B/PunR9dOFTLU2fjASrkEy3Xd0 YNY1r3N1uF/7FtBk1jhEmovnDDcxnKYgTR12g/Gg5sVXVqcMrGB26AUj8Owa92Jy pTH5/gJTOj8/EmsanrqdxRD52PdeAGVSH1oWtu1jDpRHJ9G6KjHc5U4hfJp6jUll ewhOxwaz7oeUPwRv0oa4YlEixOhSrdVTUsC0zop1tBoJQjogJDYDN2NP6lkUfSx3 U2zp7P48vtNR2wDkcR3x1I+LWUyy9gYzK4vyWuvJ3kSrN47ZT+3XH6kcomTALOrL NViSzsqGokNV17/FpNptQGBQui538MtV7IDVKaLK2zmjhGp3nQsPl6k+7ub6PPjX KrEwYC1M/5ADl20Fbu+S =vKGA -----END PGP SIGNATURE----- --=-=-=-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 20:02:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RM2ibM020559; Tue, 27 Oct 2009 20:02:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68812193FE; Tue, 27 Oct 2009 20:01:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailout11.t-online.de (mailout11.t-online.de [194.25.134.85]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C0A9193F9 for ; Tue, 27 Oct 2009 20:01:17 -0200 (BRST) Received: from fwd02.aul.t-online.de by mailout11.t-online.de with smtp id 1N2u7C-0004Fo-06; Tue, 27 Oct 2009 23:02:06 +0100 Received: from [192.168.2.102] (rxJ27cZdohz+QxF1wd9QEoA6iDq-8NH98q0UGVGQh+OTZZDag3Z6nOsqdCUngPAgYu@[79.199.81.68]) by fwd02.aul.t-online.de with esmtp id 1N2u78-2AADRo0; Tue, 27 Oct 2009 23:02:02 +0100 Message-ID: <4AE76DD3.4090006@t-online.de> Date: Tue, 27 Oct 2009 23:01:55 +0100 From: Alexander Walz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Request for help on extending if statement (lparser.c) Content-Type: multipart/alternative; boundary="------------020400010506040504090703" X-ID: rxJ27cZdohz+QxF1wd9QEoA6iDq-8NH98q0UGVGQh+OTZZDag3Z6nOsqdCUngPAgYu X-TOI-MSGID: f313c474-abdc-4d4e-98aa-a5c3e1bb4a03 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------020400010506040504090703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dear Lua users, I am currently trying to understand how the Lua interpreter (lparser.c) parses if statements. I am trying to add an extension to the if .. then .. elseif .. end statement that will always be executed if at least one of the if/elseif conditions evaluates to true - to save some code if every `then` clause contains equal statements. Would you please explain how the luaK_concat and luaK_patchtohere functions work and what targets are stored to the flist and escapelist jump variables ? Do you know how to implement such a feature or give me some hints ? All my experiments to implement such a feature failed despite code analysis of the lcode.c functions (which I often do not understand). Thank you, Alexander ----------------------------------------------------------------------------- The extended if structure would look something like this: Old New if cond1 then if cond1 then statement1 statement1 statementX statementY elseif cond2 elseif cond 2 then statement2 statement2 statementX statementY finally -- will always be executed of one cond is true statementX statementY else else other statements other statements end; end; Of course, statementsXY could be put into a procedure to be called from within the if statement. Also situations in which a `finally` clause would be helpful are quite rare. static void ifstat (LexState *ls, int line) { /* ifstat -> IF cond THEN block {ELIF cond THEN block} [ELSE block] FI */ FuncState *fs = ls->fs; int flist; int escapelist = NO_JUMP; flist = test_then_block(ls); /* IF cond THEN block */ while (ls->t.token == TK_ELSEIF) { /* changed Oct. 12, 2006, changed 0.4.0 */ luaK_concat(fs, &escapelist, luaK_jump(fs)); luaK_patchtohere(fs, flist); flist = test_then_block(ls); /* ELIF cond THEN block */ } if (ls->t.token == TK_FINALLY) { /* does not work if the last condition parsed evaluates to true, in this case the else case is executed */ expdesc e; init_exp(&e, VJMP, 0); /* what am I doing here ? */ luaK_concat(fs, &flist, luaK_jump(fs)); luaK_patchtohere(fs, escapelist); luaK_goiffalse(fs, &e); escapelist = e.f; luaX_next(ls); /* skip FINALLY (after patch, for correct line info) */ block(ls); /* `finally' part */ } if (ls->t.token == TK_ELSE) { luaK_concat(fs, &escapelist, luaK_jump(fs)); luaK_patchtohere(fs, flist); luaX_next(ls); /* skip ELSE (after patch, for correct line info) */ block(ls); /* `else' part */ } else luaK_concat(fs, &escapelist, flist); luaK_patchtohere(fs, escapelist); check_match(ls, TK_FI, TK_END, line); } --------------020400010506040504090703 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Dear Lua users,

I am currently trying to understand how the Lua interpreter (lparser.c) parses
if statements.

I am trying to add an extension to the if .. then .. elseif .. end statement
that will always be executed if at least one of the if/elseif conditions evaluates
to true - to save some code if every `then` clause contains equal statements.

Would you please explain how the luaK_concat and luaK_patchtohere functions
work and what targets are stored to the flist and escapelist jump variables ?
Do you know how to implement such a feature or give me some hints ?

All my experiments to implement such a feature failed despite code analysis
of the lcode.c functions (which I often do not understand).

Thank you,

Alexander

-----------------------------------------------------------------------------

The extended if structure would look something like this:

Old                      New

if cond1 then            if cond1 then
    statement1              statement1
    statementX
    statementY
elseif cond2             elseif cond 2 then
    statement2              statement2
    statementX
    statementY
                         finally  -- will always be executed of one cond is true
                            statementX
                            statementY
else                     else
    other statements        other statements
end;                     end;

Of course, statementsXY could be put into a procedure to be called from within the
if statement. Also situations in which a `finally` clause would be helpful are quite rare.


static void ifstat (LexState *ls, int line) {
  /* ifstat -> IF cond THEN block {ELIF cond THEN block} [ELSE block] FI */
  FuncState *fs = ls->fs;
  int flist;
  int escapelist = NO_JUMP;
  flist = test_then_block(ls);  /* IF cond THEN block */
  while (ls->t.token == TK_ELSEIF) {  /* changed Oct. 12, 2006, changed 0.4.0 */
    luaK_concat(fs, &escapelist, luaK_jump(fs));
    luaK_patchtohere(fs, flist);
    flist = test_then_block(ls);  /* ELIF cond THEN block */
  }
  if (ls->t.token == TK_FINALLY) {  /* does not work if the last condition parsed evaluates to true, in this case the else case is executed */
    expdesc e;
    init_exp(&e, VJMP, 0);  /* what am I doing here ? */
    luaK_concat(fs, &flist, luaK_jump(fs));
    luaK_patchtohere(fs, escapelist);
    luaK_goiffalse(fs, &e);
    escapelist = e.f;
    luaX_next(ls);  /* skip FINALLY (after patch, for correct line info) */
    block(ls);  /* `finally' part */
  }
  if (ls->t.token == TK_ELSE) {
    luaK_concat(fs, &escapelist, luaK_jump(fs));
    luaK_patchtohere(fs, flist);
    luaX_next(ls);  /* skip ELSE (after patch, for correct line info) */
    block(ls);  /* `else' part */
  }
  else
    luaK_concat(fs, &escapelist, flist);
  luaK_patchtohere(fs, escapelist);
  check_match(ls, TK_FI, TK_END, line);
}

--------------020400010506040504090703-- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 20:08:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RM86mX021643; Tue, 27 Oct 2009 20:08:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E14FA193DA; Tue, 27 Oct 2009 20:06:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6451019385 for ; Tue, 27 Oct 2009 20:06:44 -0200 (BRST) Received: by ewy26 with SMTP id 26so218193ewy.5 for ; Tue, 27 Oct 2009 15:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=a6mUvwS1w4PImVX6Yxhb2R6VxuFqC1hFrWA+tURY/zs=; b=eIQzy9kx/ZZqOL2i/UY0IaqC8zKpskw50KE2XQlwTHqtlYChDm5DrEPMHhIdVfeHdk 8C7rVxzRQ9xI0npwekFxGspifG5+ix67fwJp79lxhIZZsz6Sm9u2rGjfsqSavkGtZ7J3 Jis4tzOW5w6BYMMMvEQUwOMCE82+vEdhY46g8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eyGoczroy2DXlUq6P2Y2Xw2MNIoWOmHGKMvF1FPmbaDC7sSrzF+AWMlJ9zUgWot6iy EnGKx+qKx53QcaukTZrQ/NSy4UwSgTQqqtMhZnociIa7LXX202WFybgV3tUtAEIamZcx eg/Fz+t1h0OtpxVThFjbYyOpPZBm5BL1Fspik= MIME-Version: 1.0 Received: by 10.216.87.140 with SMTP id y12mr2988716wee.4.1256681256500; Tue, 27 Oct 2009 15:07:36 -0700 (PDT) In-Reply-To: <4AE76DD3.4090006@t-online.de> References: <4AE76DD3.4090006@t-online.de> Date: Tue, 27 Oct 2009 15:07:36 -0700 Message-ID: <17eac67c0910271507k54fbd445xd0418fb57c7a745e@mail.gmail.com> Subject: Re: Request for help on extending if statement (lparser.c) From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 3:01 PM, Alexander Walz wrote: > I am trying to add an extension to the if .. then .. elseif .. end statement > that will always be executed if at least one of the if/elseif conditions > evaluates > to true - to save some code if every `then` clause contains equal > statements. Could you give an example of the syntax you want to implement? It sounds like just using and will work for you: if cond and condb and condc and condd then equal_statements() else other_statements() end You also might want to check out metalua as an easier way of hacking the syntax. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 20:32:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RMWLmC025026; Tue, 27 Oct 2009 20:32:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFD01193F1; Tue, 27 Oct 2009 20:31:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-349.bluehost.com (outbound-mail-349.bluehost.com [66.147.249.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id B8017193E9 for ; Tue, 27 Oct 2009 20:30:54 -0200 (BRST) Received: (qmail 12569 invoked by uid 0); 27 Oct 2009 22:31:36 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 27 Oct 2009 22:31:36 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Disposition-Notification-To:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=Jr4w8Y+lwweccyrZoW0rb1BO7oKJicCZpKUG8GAuQzJDKEV0XZzYkG/JyO3I2YiNF/KhE5Z2MSc7oxClCE2TYwHMlWdVpGRAT6iMVa6BN+8FpYbsHVikz+F5WZjrKLwo; Received: from bas3-unionville55-1279332649.dsl.bell.ca ([76.65.17.41] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N2uZk-0003hw-Dj for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 16:31:36 -0600 Message-ID: <4AE774C6.3060009@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 18:31:34 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Advice Mixing PHP and Lua? References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> <4AE75C36.8020708@spellingbeewinnars.org> <90eb1dc70910271404p755a3343je99df445f219cbd5@mail.gmail.com> In-Reply-To: <90eb1dc70910271404p755a3343je99df445f219cbd5@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.65.17.41 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Would it be okay if I renamed this thread "pure Lua PDF module"? My original post regarding PHP has been narrowed down to this topic and it might be easier for others to follow later. > a big help would be to detail all the PDF objects created by FPDF, > together with a template to reproduce them. using that as a base > would be a lot faster than using the adobe docs. > I am at an intermediate level with Python and PHP(I repair Spectrometers for a living, I am not a pro programmer). I could probably at least go through these code examples that Bertrand has given plus FPDF and document what each part does. Then maybe someone could help turn it into proper Lua code. I am still overloaded with my Son(who's Autism is getting much better) and my Daughter will be here in a few weeks but if you can bare with my slow pace I will give it my best. The FPDF forum is also a friendly place, I might be able to get some help here. Patrick From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 20:43:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RMhf8Q026320; Tue, 27 Oct 2009 20:43:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 963211A5DE; Tue, 27 Oct 2009 20:42:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from postduif.ic.uva.nl (postduif.ic.uva.nl [145.18.40.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E54D5193F9 for ; Tue, 27 Oct 2009 20:42:20 -0200 (BRST) Received: from [192.168.178.23] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by postduif.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n9RMh5N6022419 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 27 Oct 2009 23:43:10 +0100 Message-Id: <379131B5-212B-4C9C-AE78-0C1427BB90EF@uva.nl> From: Hans van der Meer To: Lua list In-Reply-To: <4AE76C67.6070308@cowlark.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: ARM series Lua implementation? Date: Tue, 27 Oct 2009 23:43:05 +0100 References: <4AE76C67.6070308@cowlark.com> X-Mailer: Apple Mail (2.936) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.180 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 27 okt 2009, at 22:55, David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hans van der Meer wrote: >> Now that I have NAS built around a Marvell 6281 (ARM x19 series) >> running >> a Linux system, I wonder if there is a Lua implementation running on >> this combination. For those who are acquainted with this system: it >> is a >> QNAP TS-419P. > > Yes, stock Lua Just Works on it. (I have a SheevaPlug, which has a > Marvell 88FR131 'Feroceon' in it.) > Great and glad to hear. Where can I download a suitable executable? As far as I know my MacOSX XCode has no backend for this processor. That makes crosscompiling I bit difficult. > In general, Lua is completely platform-independent and and needs no > modification to Just Work on any 32-bit CPU with enough RAM. > > There isn't a LuaJIT for ARM yet, though. > Hans van der Meer From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 20:56:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RMuFn8028014; Tue, 27 Oct 2009 20:56:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AFE6C1940A; Tue, 27 Oct 2009 20:55:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D021C19404 for ; Tue, 27 Oct 2009 20:54:55 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N2ux4-0007b4-P1 for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 22:55:42 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id E8A88C367 for ; Tue, 27 Oct 2009 22:55:39 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:50706 with envelope Message-ID: <4AE77A67.1080301@cowlark.com> Date: Tue, 27 Oct 2009 22:55:35 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: <4AE76C67.6070308@cowlark.com> <379131B5-212B-4C9C-AE78-0C1427BB90EF@uva.nl> In-Reply-To: <379131B5-212B-4C9C-AE78-0C1427BB90EF@uva.nl> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9RMuFn8028014 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hans van der Meer wrote: [...] > Great and glad to hear. Where can I download a suitable executable? > As far as I know my MacOSX XCode has no backend for this processor. That > makes crosscompiling I bit difficult. Debian's got one, but getting the binary *out* of Debian may be tricky. You say it runs Linux. Do you know what variety? If it's an open source version (Debian, SlugOS, etc), you're very likely to have a package manager already on it and a binary package for Lua available. If not, your best bet could well be to try and get ipkg up and running on it. (Linux' cross compilation support is usually pretty poor, and most people just install gcc on the device and build stuff natively. Not easy unless you have a gcc for it, though.) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK53pmf9E0noFvlzgRAsPZAJwLC4Tv/uLgHsWGY6Wdaw27SpLxAwCgqtvx PXDKgRJjiThb+E0JkjwVzEA= =Mu9c -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Tue Oct 27 21:37:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9RNbnHR032421; Tue, 27 Oct 2009 21:37:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30B801936E; Tue, 27 Oct 2009 21:36:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 378F41935E for ; Tue, 27 Oct 2009 21:36:23 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N2vb4-0000wY-1e for ; Tue, 27 Oct 2009 23:37:02 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N2vbH-0004Oy-FG for lua@bazar2.conectiva.com.br; Tue, 27 Oct 2009 23:37:15 +0000 Date: Tue, 27 Oct 2009 23:37:11 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: ARM series Lua implementation? Message-ID: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 27 Oct 2009 22:50:44 +0100 Hans van der Meer wrote: > Now that I have NAS built around a Marvell 6281 (ARM x19 series) I work with ARM daily, and "ARM x19 series" means nothing to me. Can you expand? > running a Linux system, I wonder if there is a Lua implementation > running on this combination. For those who are acquainted with this > system: it is a QNAP TS-419P. For all the systems I work with, either apt-get install lua5.1, or just build Lua from source with a cross compiler. B. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:17:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCHXkE022412; Wed, 28 Oct 2009 10:17:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6115C1A6AB; Wed, 28 Oct 2009 00:32:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (unknown [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46B901A6A6 for ; Wed, 28 Oct 2009 00:32:10 -0200 (BRST) Received: by iwn5 with SMTP id 5so301166iwn.11 for ; Tue, 27 Oct 2009 19:32:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.123.216 with SMTP id q24mr6852999ibr.43.1256697161967; Tue, 27 Oct 2009 19:32:41 -0700 (PDT) In-Reply-To: <4AE76DD3.4090006@t-online.de> References: <4AE76DD3.4090006@t-online.de> Date: Tue, 27 Oct 2009 22:32:41 -0400 X-Google-Sender-Auth: 4e2d68e94b6d31b2 Message-ID: Subject: Re: Request for help on extending if statement (lparser.c) From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Oct 27, 2009 at 6:01 PM, Alexander Walz wrote: > Of course, statementsXY could be put into a procedure to be called from > within the if statement. or transformed via token filters, in a way that preserves line numbers for debugging: local _FINALLY; if cond1 then statement1 _FINALLY = true; elseif cond 2 then statement2; _FINALLY = true; end; if _FINALLY then statementX statementY else other statements end From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:21:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCLAbA023289; Wed, 28 Oct 2009 10:21:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4A471949B; Wed, 28 Oct 2009 10:19:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-356.bluehost.com (outbound-mail-356.bluehost.com [66.147.249.250]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9A0DD19493 for ; Wed, 28 Oct 2009 10:19:50 -0200 (BRST) Received: (qmail 31677 invoked by uid 0); 28 Oct 2009 12:20:40 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 28 Oct 2009 12:20:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=KYit8H6gKMEwJXeWuvazOLQ/Fcti+Whk3ERNldrVADqPghSNmdaE0SmwR8AOGKVpLOkN9I2ZLKR9L+XVq1gL+/DAiuIqfPxtPLC75407vbBHaKhCF+VYm+WJH6B1tXOn; Received: from bas3-unionville55-1279751709.dsl.bell.ca ([76.71.118.29] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N37W4-0000rj-Aa for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 06:20:40 -0600 Message-ID: <4AE83715.2010702@spellingbeewinnars.org> Date: Wed, 28 Oct 2009 08:20:37 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: confused about mod_lua, mod_python, mod_php Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.71.118.29 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I hope that I am not lowering the signal to noise ratio on this list. As I was saying I am not a pro programmer and judging from the posts to this lists I am it's dumbest member. Having said this, our thread about PHP and Lua yesterday left me wondering about Mod_lua. It seems to me the Mod_PHP is the preferred way to deploy PHP while Mod_Python is not the preferred way to deploy Python. It is my understanding that Mod_Python can access Apache's internals in such a way that it make it unsuitable for deployment with economy hosting providers as one account could clobber another account. If Mod_lua is being bundled with Apache by default now, surely it will not cause the same problem as Mod_python will it? -Patrick From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:34:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCYW4b026773; Wed, 28 Oct 2009 10:34:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C7B819453; Tue, 27 Oct 2009 22:45:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (unknown [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D76B1944C for ; Tue, 27 Oct 2009 22:45:27 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so98969eye.39 for ; Tue, 27 Oct 2009 17:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=eqxJJz3d+ZeMI05nTevniiTaugMNPUGFxsddxO3AsPQ=; b=krPAzV9YnGzz1HxsYaz/cZvKtre/Rk3OjUDMsTXOvKvcLBE0UJUkgA1BYLO10b2usV 8F2aGS3cYUAvJTNVihqCdrgGGj6DoyWLbdaKPgTuuBqsb6JVEuDXcf340uNVconUZ/XE kOnKY0JfIarQB8G7O5sV4SppSwODDwuECnGcI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Xu7Ci5iTzdX+K7IPTfvnAfHQptVwai213c9qOMCiYNOv7VNXr5kFLI+x6MXf8iu6oh S1XPcCQOmZW/FSut1iK+KAj2l4InE4XovmdpOYOXt6En/IESagO5ZThwgxk+I4lONlxC fW6bbWLt9/dqLYYMNwJ2AWZ8pZgqz0EVKEulQ= Received: by 10.216.89.200 with SMTP id c50mr1128058wef.137.1256690766959; Tue, 27 Oct 2009 17:46:06 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.20.221]) by mx.google.com with ESMTPS id g11sm1674119gve.20.2009.10.27.17.46.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 17:46:06 -0700 (PDT) Message-ID: <4AE79445.2020004@gmail.com> Date: Wed, 28 Oct 2009 08:45:57 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > On Tue, 27 Oct 2009 22:50:44 +0100 > Hans van der Meer wrote: > >> Now that I have NAS built around a Marvell 6281 (ARM x19 series) > > I work with ARM daily, and "ARM x19 series" means nothing to me. Can > you expand? Apparently a Marvell Sheeva, http://www.marvell.com/products/embedded_processors/kirkwood/index.jsp Funny thing is, Marvell does not seem to be on the same page with ARM on this, they are careful to claim only ARM compatibility. One of these days, it will end in tears, or rather, a lawsuit... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:34:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCYqKD026884; Wed, 28 Oct 2009 10:34:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C27419479; Tue, 27 Oct 2009 23:28:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA10.westchester.pa.mail.comcast.net (unknown [76.96.62.17]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B7C319471 for ; Tue, 27 Oct 2009 23:28:49 -0200 (BRST) Received: from OMTA17.westchester.pa.mail.comcast.net ([76.96.62.89]) by QMTA10.westchester.pa.mail.comcast.net with comcast id xzMd1c0011vXlb85A1VXFB; Wed, 28 Oct 2009 01:29:31 +0000 Received: from [192.168.0.104] ([76.98.175.41]) by OMTA17.westchester.pa.mail.comcast.net with comcast id y1d91c00F0txmd03d1d9xN; Wed, 28 Oct 2009 01:37:12 +0000 Message-ID: <4AE79E75.8010006@comcast.net> Date: Tue, 27 Oct 2009 21:29:25 -0400 From: dcharno User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: <4AE76C67.6070308@cowlark.com> In-Reply-To: <4AE76C67.6070308@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > Yes, stock Lua Just Works on it. (I have a SheevaPlug, which has a > Marvell 88FR131 'Feroceon' in it.) Off topic, but what do you think about the SheevaPlug. It looks interesting. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:36:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCZvoE027096; Wed, 28 Oct 2009 10:35:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A1E41953A; Wed, 28 Oct 2009 01:53:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (unknown [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F01619536 for ; Wed, 28 Oct 2009 01:53:12 -0200 (BRST) Received: by bwz27 with SMTP id 27so491888bwz.21 for ; Tue, 27 Oct 2009 20:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=WFr3Hr7DiggSPn0L0RGJZPTuLKDQ+UCM31vRK9MsUY4=; b=YKIhmYacifBLVe2v97Lvi6k/T5Ii4E9vxC0gqdAYDo6bGtqfYkUTSMZPE2JWsaF8Fz fQx0Eyf/2WQaUmJXRJ26QBWagWfzou40TIINajtJAieDgL1m+pRirmTO4dVbD5TalpbE AqmDztcqf0iJPOREo9RLMIdR1kGlBZouTzlc0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=AYfr8dW2BwxTtysRSmMLskENXSZ2f2m07N9U+DUIsIbaHUwVS1ZKCsjSysfuV+zH/n WYwn9g4v5mqmIQR0SPEsXTp+xAyVewzZzUrmiG/4SoykBGArePMU++5eg22wNMH6I76x +KI0XN8dSpUSB+KkPQS88s42zIDvRowSGWhpE= MIME-Version: 1.0 Received: by 10.204.154.144 with SMTP id o16mr7269056bkw.213.1256702031847; Tue, 27 Oct 2009 20:53:51 -0700 (PDT) In-Reply-To: <4AE774C6.3060009@spellingbeewinnars.org> References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> <4AE75C36.8020708@spellingbeewinnars.org> <90eb1dc70910271404p755a3343je99df445f219cbd5@mail.gmail.com> <4AE774C6.3060009@spellingbeewinnars.org> Date: Tue, 27 Oct 2009 22:53:51 -0500 X-Google-Sender-Auth: a6fb16ee2d953378 Message-ID: <5ba75e2f0910272053l417f6934wc54d3f28d99f8c4b@mail.gmail.com> Subject: Re: Advice Mixing PHP and Lua? From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175cb40a3261c90476f6bee6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175cb40a3261c90476f6bee6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Patrick, If you do the migration from PHP to Lua, count with me!!! I'm usin= g Nutria to migrate a PHP project with about 1.5MB of code... I have saved a lot of time and learned Lua at the same time, I can bring you support porting the missing PHP functions in Nutria and a quick start with PHP to Lua. Blessings! On Tue, Oct 27, 2009 at 5:31 PM, Patrick < spell_gooder_now@spellingbeewinnars.org> wrote: > Would it be okay if I renamed this thread "pure Lua PDF module"? > > My original post regarding PHP has been narrowed down to this topic and i= t > might be easier for others to follow later. > > > > a big help would be to detail all the PDF objects created by FPDF, > > together with a template to reproduce them. using that as a base > > would be a lot faster than using the adobe docs. > > > I am at an intermediate level with Python and PHP(I repair Spectrometers > for a living, I am not a pro programmer). I could probably at least go > through these code examples that Bertrand has given plus FPDF and > document what each part does. Then maybe someone could help turn it into > proper Lua code. > > I am still overloaded with my Son(who's Autism is getting much better) > and my Daughter will be here in a few weeks but if you can bare with my > slow pace I will give it my best. > > The FPDF forum is also a friendly place, I might be able to get some > help here. > > Patrick > > > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175cb40a3261c90476f6bee6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Patrick, If you do the migration from PHP to Lua, count with me!!! I'm = using Nutria to migrate a PHP project with about 1.5MB of code... I have sa= ved a lot of time and learned Lua at the same time, I can bring you support= porting the missing PHP functions in Nutria and a quick start with PHP to = Lua.

Blessings!

On Tue, Oct 27, 2009 at 5:= 31 PM, Patrick <spell_gooder_now@spellingbeewinnars.org>= wrote:
Would it be okay = if I renamed this thread "pure Lua PDF module"?

My original post regarding PHP has been narrowed down to this topic and it = might be easier for others to follow later.


> a big help would be to detail all the PDF objects created by FPDF,
> together with a template to reproduce them. =C2=A0using that as a base=
> would be a lot faster than using the adobe docs.
>
I am at an intermediate level with Python and PHP(I repair Spectromet= ers
for a living, I am not a pro programmer). I could probably at least go
through these code examples that Bertrand has given plus FPDF and
document what each part does. Then maybe someone could help turn it into proper Lua code.

I am still overloaded with my Son(who's Autism is getting much better)<= br> and my Daughter will be here in a few weeks but if you can bare with my
slow pace I will give it my best.

The FPDF forum is also a friendly place, I might be able to get some
help here.

Patrick






--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175cb40a3261c90476f6bee6-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:36:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCaQQX027266; Wed, 28 Oct 2009 10:36:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E27441A6CC; Wed, 28 Oct 2009 02:14:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (unknown [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4C9A1A6C8 for ; Wed, 28 Oct 2009 02:14:42 -0200 (BRST) Received: by pwj9 with SMTP id 9so565258pwj.21 for ; Tue, 27 Oct 2009 21:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=G+fBmIFZ2MU+cA1WE/Wy388BcHLJE9TaTY+/vBqBdc8=; b=EFpVL/yXX9y+q95ukBiINDTncqcUYfb0N3z1Snn25Gx4mX2bZiXGDkKVMwJ4LQHSo5 Dzskw5ISiPRcWh17tug75vEk9Igy9aKW6ub+YANW+uL83uXOsoJ0tgirskEsPF6/HEND 8QBL/zKcMnfZmSF0BwfAfoFEtgYtoWrCUDjw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=SQT2DpdtAKmInc0aYPAc1w9XrShuhrHRtGvzyPlACPevcHsuyqwJeO3BJdUVrtwaSE 6fTOGwi/UQnyd4CtRx2F5xEE38xzPpmRAncZgXDwyzSpxH0gdn4xLZPj1338xMrZC/SO +NuR/XIa1rgqjQMnY9xxuADo9cmgciqmDmAa0= Received: by 10.114.7.25 with SMTP id 25mr28421772wag.21.1256703320931; Tue, 27 Oct 2009 21:15:20 -0700 (PDT) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 22sm329537pzk.2.2009.10.27.21.15.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 21:15:20 -0700 (PDT) Message-ID: <4AE7C551.7060100@gmail.com> Date: Wed, 28 Oct 2009 12:15:13 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean There is already lua packages in ipkg. Here is the output on my TS-209: [~] # ipkg list | grep lua lua - 5.1.4-2 - Lua is a powerful light-weight programming language designed for extending applications. luarocks - 1.0.1-1 - LuaRocks is a deployment and management system for Lua modules. perlconsole - 0.4-2 - Perl Console is a small program that implements a Read-eval-print loop: it lets you evaluate Perl code interactively. [~] # The ipkg repository I'm currently using is: src/gz cs05q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable Regards Long Hans van der Meer 写é“: > Now that I have NAS built around a Marvell 6281 (ARM x19 series) > running a Linux system, I wonder if there is a Lua implementation > running on this combination. For those who are acquainted with this > system: it is a QNAP TS-419P. > > Hans van der Meer > > > > From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:45:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCjbBn029255; Wed, 28 Oct 2009 10:45:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17DD319422; Wed, 28 Oct 2009 10:44:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from postduif.ic.uva.nl (postduif.ic.uva.nl [145.18.40.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D746C193BB for ; Wed, 28 Oct 2009 10:44:07 -0200 (BRST) Received: from [192.168.178.23] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by postduif.ic.uva.nl (8.13.1/8.13.1) with ESMTP id n9SCigiC019705 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 28 Oct 2009 13:44:49 +0100 Message-Id: <747EAD66-4BB4-4553-B71A-716118CC439B@uva.nl> From: Hans van der Meer To: Lua list In-Reply-To: <4AE79445.2020004@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: ARM series Lua implementation? Date: Wed, 28 Oct 2009 13:44:42 +0100 References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> <4AE79445.2020004@gmail.com> X-Mailer: Apple Mail (2.936) X-Spam-Score: undef - spam scanning disabled X-CanIt-Geo: ip=82.95.102.36; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: auth (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 145.18.40.180 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 28 okt 2009, at 01:45, KHMan wrote: > Rob Kendrick wrote: >> On Tue, 27 Oct 2009 22:50:44 +0100 >> Hans van der Meer wrote: >>> Now that I have NAS built around a Marvell 6281 (ARM x19 series) >> I work with ARM daily, and "ARM x19 series" means nothing to me. Can >> you expand? > > Apparently a Marvell Sheeva, > > http://www.marvell.com/products/embedded_processors/kirkwood/index.jsp From that data sheet I guess you're right with this processor. Other details fit, like the 1.2GHz. > > Funny thing is, Marvell does not seem to be on the same page with > ARM on this, they are careful to claim only ARM compatibility. One > of these days, it will end in tears, or rather, a lawsuit... > > -- > Cheers, > Kein-Hong Man (esq.) > Kuala Lumpur, Malaysia Hans van der Meer From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 10:57:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SCvCBW032404; Wed, 28 Oct 2009 10:57:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82AD519414; Wed, 28 Oct 2009 10:55:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE1A919400 for ; Wed, 28 Oct 2009 10:55:42 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 8080CE20CD for ; Wed, 28 Oct 2009 13:56:32 +0100 (CET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gq1J9Yj3IlZC for ; Wed, 28 Oct 2009 13:56:30 +0100 (CET) Received: by steel.pruts.nl (Postfix, from userid 1000) id ACBA7E20D0; Wed, 28 Oct 2009 13:56:30 +0100 (CET) Resent-From: ico@pruts.nl Resent-Date: Wed, 28 Oct 2009 13:56:30 +0100 Resent-Message-ID: <20091028125630.GK5051@pruts.nl> Resent-To: lua@bazar2.conectiva.com.br Date: Wed, 28 Oct 2009 11:23:33 +0100 From: Ico To: lua@bazar2.conectiva.com.br Subject: io.lines() behaviour on \0 characters Message-ID: <20091028102333.GI5051@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hello, I'm trying to use io.lines() to read lines from a file which contains \0 characters. This seems to fail, probably because of the fgets() used in iolib.c:read_line(). Because - unlike C strings/char arrays - Lua strings are 8-bit safe, the expected behaviour for me was for io.lines() to simply handle the \0's as regular characters. local fd = io.open(os.tmpname(), "r+") fd:write("one\0one\n") fd:write("two\0two\n") fd:write("three\0three\n") fd:seek("set", 0) i = 0 for l in fd:lines() do i = i + 1 print(i, l) end I would expect the above to show 1 one<\0>one<\n> 2 two<\0>two<\n> 3 three<\0>three<\n> instead, it returns 1 onetwothree<\n> (control characters enclosed in <> by me) I did not find any references in the documentation about how iolib is supposed to handle zeros. Is the behaviour I see intented, or more of an side effect of the usage of C-strings in the implementation of io.lines() ? -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:05:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SD5nnn002156; Wed, 28 Oct 2009 11:05:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 247B119417; Wed, 28 Oct 2009 11:04:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from starling.antixlabs.com (starling.antixlabs.com [212.36.36.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E406193AB for ; Wed, 28 Oct 2009 11:04:11 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by starling.antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N38Cr-0005Uk-2l for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 13:04:53 +0000 Message-ID: <4AE84176.2000700@cowlark.com> Date: Wed, 28 Oct 2009 13:04:54 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: [OT] ARMs (was: ARM series Lua implementation?) References: <4AE76C67.6070308@cowlark.com> <4AE79E75.8010006@comcast.net> In-Reply-To: <4AE79E75.8010006@comcast.net> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 dcharno wrote: [...] > Off topic, but what do you think about the SheevaPlug. It looks > interesting. Well, I run my entire house system off one. It serves cowlark.com, does all my incoming and outgoing email, spam filtering, is my main ssh point-of-contact, manages all my backups, runs the Java backend for the website comment system etc. The whole stack including SheevaPlug, home made 64GB SSD, ADSL router, wireless router, UPS, and a bunch of USB hubs runs at about 30 watts, going up to 40 when it spins up the external hard drive. It runs Debian. It's not entirely perfect --- it's got exactly one USB 2.0 port, which means that my home made RAID array of USB keys is pushing bandwidth limits almost continuously; there's something slightly dodgy in the Linux kernel that causes it to kill processes under load; the Marvell USB chipset is notoriously quirky that causes I/O errors with some devices. OTOH it is $99, which I can forgive a lot for. Marvell are producing a different version, the OpenRD, which has got a lot more ports (including eSATA) and is more suitable for server use, but it's three times the price. The Marvell chipset is apparently based on the old StrongARM architecture that Intel used to have; this could be the reason for their cool relationship with ARM, as Intel and ARM aren't talking to each other these days. The StrongARM architecture has a reputation for being fast but hot. The thing certainly gets warm when in use. At 1.2GHz it's pretty high-end as ARMs go but I believe the new Cortex line (from ARM) will beat it. I have a writeup here with some benchmarks from about a week after I got it. It's now a bit obsolete and a few things are wrong --- I should post an update. http://www.cowlark.com/2009-04-15-sheevaplug/ (Yes, hosted on the SheevaPlug.) Lua-wise, I have no complaints on it --- although as it has no FPU if I were doing anything performance-related I'd probably want to build a copy with LNUM. The entire website is based on a home-made CMS written in Lua, which compiles the templates into static HTML. On the SheevaPlug itself, it takes 15-20 seconds to rebuild the site depending whether email comes in while it's working. That's with Debian's stock Lua. On my Celeron-D desktop it takes about 3. The Lua executable is 129kB of code, while on i386 it's 140kB, showing that ARM is denser than i386. I haven't build a Thumb version (which the SheevaPlug also supports), but it might be interesting. This is the kind of device that an integerised ARM LuaJIT would be really rather good on. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "To be is to do" -- Nietzche │ "To do is to be" -- Sartre │ "Do be do be do" -- Sinatra -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkroQW8ACgkQf9E0noFvlzgCkwCgjLAPaq9Ab8a0MzpWq2a7L0WA 4DUAn3jDXQg4AYDsj9r7Ko5PvqeuROHV =z4e2 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:07:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SD7eZW002593; Wed, 28 Oct 2009 11:07:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E4F01A7E8; Wed, 28 Oct 2009 08:23:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (unknown [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 918C11A7E0 for ; Wed, 28 Oct 2009 08:23:08 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id B612DE20C3 for ; Wed, 28 Oct 2009 11:23:35 +0100 (CET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ta1lm0ELUrHl for ; Wed, 28 Oct 2009 11:23:34 +0100 (CET) Received: by steel.pruts.nl (Postfix, from userid 1000) id 04E45E20CD; Wed, 28 Oct 2009 11:23:33 +0100 (CET) Date: Wed, 28 Oct 2009 11:23:33 +0100 From: Ico To: lua@bazar2.conectiva.com.br Subject: io.lines() behaviour on \0 characters Message-ID: <20091028102333.GI5051@pruts.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hello, I'm trying to use io.lines() to read lines from a file which contains \0 characters. This seems to fail, probably because of the fgets() used in iolib.c:read_line(). Because - unlike C strings/char arrays - Lua strings are 8-bit safe, the expected behaviour for me was for io.lines() to simply handle the \0's as regular characters. local fd = io.open(os.tmpname(), "r+") fd:write("one\0one\n") fd:write("two\0two\n") fd:write("three\0three\n") fd:seek("set", 0) i = 0 for l in fd:lines() do i = i + 1 print(i, l) end I would expect the above to show 1 one<\0>one<\n> 2 two<\0>two<\n> 3 three<\0>three<\n> instead, it returns 1 onetwothree<\n> (control characters enclosed in <> by me) I did not find any references in the documentation about how iolib is supposed to handle zeros. Is the behaviour I see intented, or more of an side effect of the usage of C-strings in the implementation of io.lines() ? -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:08:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SD8AlI002832; Wed, 28 Oct 2009 11:08:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3083E1A7EE; Wed, 28 Oct 2009 08:29:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from esemetz.metz.supelec.fr (unknown [193.48.224.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DF741A7EA for ; Wed, 28 Oct 2009 08:29:43 -0200 (BRST) Received: from mx1.metz.supelec.fr (mx1.metz.supelec.fr [193.48.224.216]) by esemetz.metz.supelec.fr (8.14.1/8.14.1) with ESMTP id n9SAUQ1o025701 for ; Wed, 28 Oct 2009 11:30:26 +0100 Received: from [127.0.0.1] (Java_cJ@duboucher.rez-metz.supelec.fr [193.48.225.222] (may be forged)) by mx1.metz.supelec.fr (8.14.1/8.14.1) with ESMTP id n9SAUJuc017304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 28 Oct 2009 11:30:21 +0100 Message-ID: <4AE81D13.4040702@duboucher.eu> Date: Wed, 28 Oct 2009 11:29:39 +0100 From: Duboucher Thomas User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaRocks 2.0.1 References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> In-Reply-To: <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=A79F86A8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV 0.94.1/9951/Wed Oct 28 01:14:07 2009 on mx1.metz.supelec.fr X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on mx1.metz.supelec.fr X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (esemetz.metz.supelec.fr [193.48.224.212]); Wed, 28 Oct 2009 11:30:26 +0100 (CET) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx1.metz.supelec.fr [193.48.224.216]); Wed, 28 Oct 2009 11:30:26 +0100 (CET) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sam Roberts a écrit : > On Tue, Oct 27, 2009 at 10:35 AM, Hisham wrote: >> On Tue, Oct 27, 2009 at 3:04 PM, Linus Sjögren >> wrote: >>>> I'm happy to announce LuaRocks 2.0.1, a bugfix release: >>> Everything looks great and all, but can you see about getting it into >>> the Ubuntu repos? >>> The latest version on 'universe' is 0.6... >> I'm not the maintainer for any distro packages of LuaRocks. My advice >> would be to get in contact with the downstream maintainer for your >> favorite distro and ask them to update. :) > > For debian and ubuntu, the way to do this would be to report a bug > against the out-of-date package. > > Sam > Well, Ubuntu Karmic Koala will go live tomorrow with LuaRocks 1.0.1 ... :/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkroHRMACgkQBV7eXqefhqhiTACeL9j00ochGxoddaWPfEmUmNd7 1foAnAqijKunOFi6/YYL3DImr1P3HPk9 =up5x -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:08:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SD8teU003124; Wed, 28 Oct 2009 11:08:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C56841A7DB; Wed, 28 Oct 2009 08:21:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (unknown [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A62931A7A5 for ; Wed, 28 Oct 2009 08:21:07 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N34xY-0008DR-J3 for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 10:36:52 +0100 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2009 10:36:52 +0100 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2009 10:36:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: Advice Mixing PHP and Lua? Date: Wed, 28 Oct 2009 10:36:44 +0100 Lines: 18 Message-ID: References: <4AE72188.2030301@spellingbeewinnars.org> <98b8086f0910271213q3095d96cmadf02a4f28635734@mail.gmail.com> <4AE74B2B.5080207@spellingbeewinnars.org> <8E8BECBF-FE75-4CB7-BDBC-0C58BF912603@mac.com> <20091027180224.A32672@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 27/10/2009 22:12, Bertrand Mansion wrote: > FPDF is very popular in the PHP world because it is free and easy to > use. Its pseudo OO code is ugly though. > But TCPDF, which is even more useful Indeed, I was about to point to it: FPDF has an annoying limitation for non-English speaking people: AFAIK, it doesn't support Unicode. Hence the usage of TCPDF or UFPDF If some effort must be put in a port, I think it might be better to start from a more universal code base. Or to inject proper Unicode support in the port effort. -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:09:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SD99Dl003201; Wed, 28 Oct 2009 11:09:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DB161A68C; Wed, 28 Oct 2009 00:01:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (unknown [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 502C81A687 for ; Wed, 28 Oct 2009 00:01:02 -0200 (BRST) Received: by bwz27 with SMTP id 27so427760bwz.21 for ; Tue, 27 Oct 2009 19:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=sjuMxMUqYfDgxJpsX4AMWC38To2IfLqiOx3b0FQGRac=; b=XuB5Ky+MQiQLD9I1v4DIr4CMUjwpYixC1+Yv+gzqnqFF9cqQHwD5ltxzHTHXJe4j5D 58SVt7xMxbmCUyGaeKyOyhAd/eLHDzu6i31bbJoGxUHwFdFE0qULlXiktdbR1c5I4Hy3 Qk3xjZE6ENFM1s8RtW6YQ6QPIptzKy7+2D2KE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kyJpgG+7yEHXXTTrUkmpAslIhFACMxjcMXthjlYcBKV4oQnLJqcI1oC5mR4hh6tMJs xeCFPEEwUUHn5uuCdhVAzfm5IlzihRom4Q+Oj5CjQJMiRmBPxtxpagrrKrr+WnXIIK57 juKDdfbaW2nMpeirgl4LxTZFhf5O9k6OtxgXw= MIME-Version: 1.0 Received: by 10.204.32.201 with SMTP id e9mr123027bkd.122.1256695302197; Tue, 27 Oct 2009 19:01:42 -0700 (PDT) In-Reply-To: <4AE76C67.6070308@cowlark.com> References: <4AE76C67.6070308@cowlark.com> Date: Wed, 28 Oct 2009 10:01:42 +0800 Message-ID: <438c11350910271901t320c331bl53b4d0f8193144af@mail.gmail.com> Subject: Re: ARM series Lua implementation? From: pan shizhu To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Oct 28, 2009 at 5:55 AM, David Given wrote: > > In general, Lua is completely platform-independent and and needs no > modification to Just Work on any 32-bit CPU with enough RAM. > That's not always the truth, Lua make extensive use of floating point, so it is advisable to use integer as numbers for those CPU who do not have hardware floating-point support. Also, some CPUs do not support floating point at all and cannot compile lua without any modification. Generally, I compile lua with floating point only for x86 cpus which have SSE support. for ARM and MIPS cpus it is better to use integer as numbers. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:13:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDDlwa005099; Wed, 28 Oct 2009 11:13:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04CD1193FB; Wed, 28 Oct 2009 11:12:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92688193A5 for ; Wed, 28 Oct 2009 11:12:20 -0200 (BRST) Received: by ywh40 with SMTP id 40so597537ywh.33 for ; Wed, 28 Oct 2009 06:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gTlT86CVSiHp73yKCHagF4OWdwtOpDgHJZuoAR/r5P4=; b=PDjN4DsYCrzYjWyLGUvilfFJL7ImN+I02Ahvd8/vISBUxl3GR+Ljd68RtmfPb6RoQ6 /3UC62KGs4vjASBhg02BgC9jRqADUlsqMTfgxHtV2Lyr972h9qFyuFyXiKDMcI1UfqXC xTD6725LPlOP8STNs9ROph/OVg6hbplbMMRUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uaCkkWib5P47teqW+q7v9Adb5NbyRGzah2T2DmLJN7W1Bbbof0o7KbAubmwm1mWkFw TRyB1JWgZMMRlatVlV/QgMUyCGJzJiPLOomXupqnVyvvr10SyBKeftx0ZF+ziiCbCJjD 4rrW/d4fUG/jDesUD6NblwW/WxwbFb4WEGbCg= MIME-Version: 1.0 Received: by 10.239.139.4 with SMTP id r4mr770765hbr.199.1256735592515; Wed, 28 Oct 2009 06:13:12 -0700 (PDT) In-Reply-To: <438c11350910271901t320c331bl53b4d0f8193144af@mail.gmail.com> References: <4AE76C67.6070308@cowlark.com> <438c11350910271901t320c331bl53b4d0f8193144af@mail.gmail.com> Date: Wed, 28 Oct 2009 15:13:12 +0200 Message-ID: <560972290910280613j4909b6d6x849e210b114a6ac4@mail.gmail.com> Subject: Re: ARM series Lua implementation? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, Oct 28, 2009 at 4:01 AM, pan shizhu wrote: > Generally, I compile lua with floating point only for x86 cpus which > have SSE support. for ARM and MIPS cpus it is better to use integer as > numbers. And with the LNUM patch you can have both ... From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:14:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDEL6S005370; Wed, 28 Oct 2009 11:14:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C33631941C; Wed, 28 Oct 2009 11:12:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C13719403 for ; Wed, 28 Oct 2009 11:12:43 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDDXXo005026 for ; Wed, 28 Oct 2009 11:13:34 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9SDDXK03251; Wed, 28 Oct 2009 11:13:33 -0200 Date: Wed, 28 Oct 2009 11:13:32 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: io.lines() behaviour on \0 characters Message-ID: <20091028111332.A3236@lua.tecgraf.puc-rio.br> References: <20091028102333.GI5051@pruts.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091028102333.GI5051@pruts.nl>; from lua@zevv.nl on Wed, Oct 28, 2009 at 11:23:33AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm trying to use io.lines() to read lines from a file which contains \0 > characters. Then the file is not a text file and has no notion of lines. So io.lines does not necessarily work. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:19:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDIvpX006702; Wed, 28 Oct 2009 11:18:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1D581941B; Wed, 28 Oct 2009 11:17:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3CAA193E9 for ; Wed, 28 Oct 2009 11:17:31 -0200 (BRST) Received: by bwz27 with SMTP id 27so980610bwz.21 for ; Wed, 28 Oct 2009 06:18:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.3.211 with SMTP id 19mr2440875bko.36.1256735902173; Wed, 28 Oct 2009 06:18:22 -0700 (PDT) In-Reply-To: <4AE83715.2010702@spellingbeewinnars.org> References: <4AE83715.2010702@spellingbeewinnars.org> Date: Wed, 28 Oct 2009 14:18:22 +0100 X-Google-Sender-Auth: 448406927a09d938 Message-ID: Subject: Re: confused about mod_lua, mod_python, mod_php From: Bertrand Mansion To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SDIvpX006702 On Wed, Oct 28, 2009 at 1:20 PM, Patrick wrote: > I hope that I am not lowering the signal to noise ratio on this list. As I was saying I am not a pro programmer and judging from the posts to this lists I am it's dumbest member. > > > Having said this, our thread about PHP and Lua yesterday left me wondering about Mod_lua. > > > It seems to me the Mod_PHP is the preferred way to deploy PHP while Mod_Python is not the preferred way to deploy Python. It is my understanding that Mod_Python can access Apache's internals in such a way that it make it unsuitable for deployment with economy hosting providers as one account could clobber another account. If Mod_lua is being bundled with Apache by default now, surely it will not cause the same problem as Mod_python will it? Mod_lua is not ready yet and as things are moving slowly with Apache 2.4, I wouldn't count on it before two years (this is only my opinion, I might be wrong). About mod_php, more recent benchmarks show that it is slower than using fastcgi because mod_php only works correctly when Apache uses its prefork MPM. The prefork MPM is less performant that other Apache MPM because it doesn't use all the Apache threading potential. If you use fastcgi, you don't have this problem anymore and can use a better suited Apache MPM. If I understand correctly, the problem is not really with mod_php, but with some PHP extensions which are not threadsafe. And because it is better to be safe than sorry, most people prefer to keep the prefork MPM. Currently, the best setup I have tried in term of overall performance (rps, memory, cpu) is with Nginx and fastcgi. The new PHP 5.3 makes it even easier to use this setup because it doesn't require spawn-fcgi anymore. With older versions, you can use spawn-fcgi with great performance as well. The good thing is that Nginx + spawn-fcgi also works great with Lua, as long as you manage to install wsapi.fcgi. And since spawn-fcgid is a subproduct of Lighttpd, it will also work well with this server. Fabio posted a small tutorial on his brand new shiny blog : http://mascarenhas.github.com/2009/10/24/wsapi-nginx-fcgi.html This means you can use both PHP and Lua at the same time with the same Nginx server and almost the same configuration. I also heard good things about the Cherokee http://www.cherokee-project.com it has a nice admin interface and supports fastcgi. In conclusion, I would say that today, Apache might not be the best choice to run alternatives to Java and PHP. You will probably have to try one of Nginx, Lighttpd or Cherokee. If you are more adventurous, you can also try qDecoder's qHttpd server, as it seems it supports Lua directly http://www.qdecoder.org but I haven't tried it myself. If you can wait, I am sure mod_lua will be great, but not before long I am afraid. At the moment it is pretty useless if you are planning something serious. -- Bertrand Mansion Mamasam From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:22:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDMRtf007915; Wed, 28 Oct 2009 11:22:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A191C19426; Wed, 28 Oct 2009 11:21:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A28D3193E9 for ; Wed, 28 Oct 2009 11:21:03 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 70647E20CD for ; Wed, 28 Oct 2009 14:21:56 +0100 (CET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JruEB+K6IzKp for ; Wed, 28 Oct 2009 14:21:54 +0100 (CET) Received: by steel.pruts.nl (Postfix, from userid 1000) id C655FE20D0; Wed, 28 Oct 2009 14:21:54 +0100 (CET) Date: Wed, 28 Oct 2009 14:21:54 +0100 From: Ico Cc: Lua list Subject: Re: io.lines() behaviour on \0 characters Message-ID: <20091028132154.GM5051@pruts.nl> References: <20091028102333.GI5051@pruts.nl> <20091028111332.A3236@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091028111332.A3236@lua.tecgraf.puc-rio.br> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-10-28 Luiz Henrique de Figueiredo wrote : > Then the file is not a text file and has no notion of lines. So io.lines > does not necessarily work. Clear -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:23:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDNRBb008139; Wed, 28 Oct 2009 11:23:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A24D19430; Wed, 28 Oct 2009 11:22:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7000193E9 for ; Wed, 28 Oct 2009 11:22:10 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDMx8Y008041 for ; Wed, 28 Oct 2009 11:22:59 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n9SDMxqL008039 for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 11:22:59 -0200 Date: Wed, 28 Oct 2009 11:22:58 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: io.lines() behaviour on \0 characters Message-ID: <20091028132258.GA5726@duchamp.tecgraf.puc-rio.br> References: <20091028102333.GI5051@pruts.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091028102333.GI5051@pruts.nl> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I'm trying to use io.lines() to read lines from a file which contains \0 > characters. This seems to fail, probably because of the fgets() used in > iolib.c:read_line(). Exactly. fgets does not report the length of the string read and so we're forced to use strlen, which of course stops at any embedded \0. fgets does read past \0 until it finds \n, at least in Linux, but the the standard probably says that files containing \0 are not text files. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:24:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDNwae008275; Wed, 28 Oct 2009 11:23:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6A2C1A79E; Wed, 28 Oct 2009 07:13:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (unknown [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id 6462019443 for ; Wed, 28 Oct 2009 07:13:31 -0200 (BRST) Received: (qmail 22111 invoked by uid 600); 28 Oct 2009 09:14:10 -0000 Date: Wed, 28 Oct 2009 10:14:09 +0100 From: Klaus Ripke To: Lua list Subject: Re: Request for help on extending if statement (lparser.c) Message-ID: <20091028091409.GA6668@fand.local> Mail-Followup-To: Lua list References: <4AE76DD3.4090006@t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AE76DD3.4090006@t-online.de> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi On Tue, Oct 27, 2009 at 11:01:55PM +0100, Alexander Walz wrote: > The extended if structure would look something like this: > > Old New > > if cond1 then if cond1 then > statement1 statement1 > statementX > statementY > elseif cond2 elseif cond 2 then > statement2 statement2 > statementX > statementY > finally -- will always be executed of one cond > is true > statementX > statementY > else else > other statements other statements > end; end; that should translate to something like: local _else -- if_with_finally_clause if cond1 then ... else other statements _else = true end if ~ _else then -- finally statementX statementY end Should be possible using the token filter. Obviously the if cases must not contain a break or return. In plain Lua I would prefer repeat if cond1 then ... else other statements break end -- finally statementX statementY until true cheers From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:24:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDOMZI008399; Wed, 28 Oct 2009 11:24:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2309D1A7B9; Wed, 28 Oct 2009 07:11:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (unknown [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 369301A7B4 for ; Wed, 28 Oct 2009 07:11:49 -0200 (BRST) Received: by yxe17 with SMTP id 17so464959yxe.33 for ; Wed, 28 Oct 2009 02:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=NXtnLx5Xr3OK168VwdB/6mQQqI2z/LvQzJPwSJEzauQ=; b=ZpF9TgWWUX78GBjJ6ZsJzqaVTeWG+KxBYHrGZkBhq6HGzURHRuZuGqS1BnmC5vJovy NfWlqiMFvijH3U2G4vWIM7giAgoCVhs40B4BBv+T72zkI9naWU4tLf9XWce6Jw0WjRHr Z7/ItfTswi0AoQdZm2xyXId/i4mDd32Ia3c0w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Kbhfd2O0MSe7j/bdUuXsqHGwZTityu1EBLd/M2UfNz1JJeiCiPl2e/P8mp+TQx3i/n aVgBt9DiCXzUuEmMwMC0udGEu38r473hGnruF3HAzn9kycV136+n2HZ+tbbnZVuIyKmD E+M3QT2R5jJQ+kqzoVITpJlq9yzWZBf3FIXMY= Received: by 10.90.62.4 with SMTP id k4mr11608830aga.56.1256721148001; Wed, 28 Oct 2009 02:12:28 -0700 (PDT) Received: from ?192.168.1.2? ([115.135.90.146]) by mx.google.com with ESMTPS id 5sm356427yxg.64.2009.10.28.02.12.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Oct 2009 02:12:26 -0700 (PDT) Message-ID: <4AE80AF2.4080408@gmail.com> Date: Wed, 28 Oct 2009 17:12:18 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > On Tue, 27 Oct 2009 22:50:44 +0100 > Hans van der Meer wrote: > >> Now that I have NAS built around a Marvell 6281 (ARM x19 series) > > I work with ARM daily, and "ARM x19 series" means nothing to me. Can > you expand? My last post may be exaggerating due to lack of clear information from Marvell and industry news, so I've checked the docs and news and this is to clear things up. :-) Marvel does have an ARM license and all, but it also does its own cores, so maybe that's why one never sees the usual specific-core label, like "ARM9" or "ARM7TDMI". So, compared to other ARMs, these always seem to be conspicuously missing the particular family designations. Well, ARM is pretty aggressive these days and I get the feeling that they desire more control in their war with the 800-pound gorilla. Good luck to them... -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:25:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDPIuP008573; Wed, 28 Oct 2009 11:25:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 533001A7C6; Wed, 28 Oct 2009 07:24:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (unknown [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F4901A7C2 for ; Wed, 28 Oct 2009 07:24:43 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N34mS-00074d-9q for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 09:25:24 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 6727F26127 for ; Wed, 28 Oct 2009 08:49:18 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:53401 with envelope Message-ID: <4AE8056D.5040906@cowlark.com> Date: Wed, 28 Oct 2009 08:48:45 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: ARM series Lua implementation? References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SDPIuP008573 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rob Kendrick wrote: [...] >> Now that I have NAS built around a Marvell 6281 (ARM x19 series) > > I work with ARM daily, and "ARM x19 series" means nothing to me. Can > you expand? It's an Kirkwood 88F6281 --- which actually turns out to be the same processor, AFAICT, as in my SheevaPlug. In practical terms an ARMv5TE. (Annoyingly, Marvell don't appear to document what kind of ARM core their devices have. *Plus* some marketing drone at HR managed to misquote the CPU model, which is where the '6281' came from. *Plus* Linux' /proc/cpuinfo is reporting a different version number to Marvell's documentation, which is where the '88FR131' I quoted came from. Heigh ho.) You *can* get ipkg for this, and can therefore install any Optware package; and I know Lua is available. Instructions here: http://www.turbonas.com/phpBB3/viewtopic.php?f=18&t=385 - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK6AVqf9E0noFvlzgRAlcKAJ9K1ibnlFouTfzf8eFoAzf32pvIsACg24No NpxZ62ZPGmuGJkboRf2M2ss= =KjVp -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:25:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDPXco008654; Wed, 28 Oct 2009 11:25:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56DD51888F; Wed, 28 Oct 2009 00:22:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sinikuusama.dnainternet.net (unknown [83.102.40.134]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AA111886D for ; Wed, 28 Oct 2009 00:22:11 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id 49FD12C976; Wed, 28 Oct 2009 04:22:50 +0200 (EET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: 0.075 X-Spam-Level: X-Spam-Status: No, score=0.075 tagged_above=-9999 required=6 tests=[AWL=-0.025, RDNS_NONE=0.1] Received: from sinikuusama.dnainternet.net ([83.102.40.134]) by localhost (sinikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id LGwyfJj2SeTW; Wed, 28 Oct 2009 04:22:50 +0200 (EET) Received: from luumupuu.dnainternet.net (luumupuu.dnainternet.net [83.102.40.213]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id 11B222C968; Wed, 28 Oct 2009 04:22:50 +0200 (EET) Received: from poppeli.dnainternet.net (unknown [83.102.40.44]) by luumupuu.dnainternet.net (Postfix) with ESMTP id 08C1A7F001; Wed, 28 Oct 2009 04:22:50 +0200 (EET) Received: by poppeli.dnainternet.net (Postfix, from userid 33) id F3FE12BADB; Wed, 28 Oct 2009 04:22:49 +0200 (EET) Date: Wed, 28 Oct 2009 04:22:49 +0200 From: =?UTF-8?Q?Asko_Kauppi?= Subject: Re: ARM series Lua implementation? To: =?UTF-8?Q?Hans_van_der_Meer?= , lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=UTF-8 Content-Description: Mailbody Content-Disposition: inline User-Agent: Taajama X-Mailer: Taajama Webmail Message-Id: <20091028022249.F3FE12BADB@poppeli.dnainternet.net> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean You won't normally be getting anything binary on these devices (embedded NAS etc.) One either needs to compile "native" on the device itself, or cross-compile using Linux host. OS X host can in theory be used, but one must recompile gcc for this from scratch, which is rather time taking and complex. I've tried. My NAS is a NSLU2 ("Slug"), and I've done compilations native on it. http://www.nslu2-linux.org/wiki/SlugOS/HomePage SlugOS started on the NSLU2 device, but is nowadays covering quite a number of other NASes as well. > Marvell 1.2GHz CPU and 512MB DDRII memory Now that is one high performance ARM system. Forget the above; these systems should better be served by something like full-blown Debian installation. Also forget about the LNUM patch; I'm rather sure the CPU has floating point support included? Check here: http://qnap.nas-central.org/wiki/Main_Page - Asko 28.10.09 00:43, Hans van der Meer kirjoitti: > On 27 okt 2009, at 22:55, David Given wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hans van der Meer wrote: > >> Now that I have NAS built around a Marvell 6281 (ARM x19 series) > >> running > >> a Linux system, I wonder if there is a Lua implementation running on > >> this combination. For those who are acquainted with this system: it > >> is a > >> QNAP TS-419P. > > > > Yes, stock Lua Just Works on it. (I have a SheevaPlug, which has a > > Marvell 88FR131 'Feroceon' in it.) > > > > Great and glad to hear. Where can I download a suitable executable? > As far as I know my MacOSX XCode has no backend for this processor. > That makes crosscompiling I bit difficult. > > > In general, Lua is completely platform-independent and and needs no > > modification to Just Work on any 32-bit CPU with enough RAM. > > > > There isn't a LuaJIT for ARM yet, though. > > > > Hans van der Meer > > From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:29:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDTedj009636; Wed, 28 Oct 2009 11:29:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C603193C4; Wed, 28 Oct 2009 11:28:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B67A18FAA for ; Wed, 28 Oct 2009 11:28:19 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N38a9-0004AD-KE for ; Wed, 28 Oct 2009 13:28:57 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N38aM-0003nv-Hw for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 13:29:10 +0000 Date: Wed, 28 Oct 2009 13:29:06 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: ARM series Lua implementation? Message-ID: <20091028132906.2b0d44c1@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4AE79445.2020004@gmail.com> References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> <4AE79445.2020004@gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 28 Oct 2009 08:45:57 +0800 KHMan wrote: > Apparently a Marvell Sheeva, > > http://www.marvell.com/products/embedded_processors/kirkwood/index.jsp > > Funny thing is, Marvell does not seem to be on the same page with > ARM on this, they are careful to claim only ARM compatibility. One > of these days, it will end in tears, or rather, a lawsuit... At the risk of going even more off-topic, Marvell and Intel both have licences to the ARM architecture, related patents, and test suites. Marvell bought some elements of Intel's XScale business (which itself came from DEC's StrongARM business), along with an Israeli company called Ferocean, who had developed an ARM clone *without* any licences from ARM, but that problem went away when Marvell (who did) bought them. The Shiva, if memory serves, is what has developed from that Ferocean purchase. Incidentally, anybody can build an ARM clone with no licences from ARM. The entire specification was placed into the public domain by Acorn long before ARM Ltd. even existed. However, using the ARM trademark and some of the newer patent-encumbered instructions do require licences. Anyway, enough. Back to Lua :) B. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:31:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDVDFK010133; Wed, 28 Oct 2009 11:31:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B9E519410; Wed, 28 Oct 2009 11:30:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A91818884 for ; Wed, 28 Oct 2009 11:29:56 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N38bj-0004mv-Bi for ; Wed, 28 Oct 2009 13:30:35 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N38bv-0003zc-Uw for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 13:30:48 +0000 Date: Wed, 28 Oct 2009 13:30:44 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: ARM series Lua implementation? Message-ID: <20091028133044.3e5145f8@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4AE8056D.5040906@cowlark.com> References: <20091027233711.345b22d9@trite.i.flarn.net.i.flarn.net> <4AE8056D.5040906@cowlark.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 28 Oct 2009 08:48:45 +0000 David Given wrote: > > I work with ARM daily, and "ARM x19 series" means nothing to me. > > Can you expand? > > It's an Kirkwood 88F6281 --- which actually turns out to be the same > processor, AFAICT, as in my SheevaPlug. In practical terms an ARMv5TE. Right, so not an ARM series thing. A Marvell series thing :) > (Annoyingly, Marvell don't appear to document what kind of ARM core > their devices have. That's because they do not include an ARM core. It's a core of their own design (like StrongARM, XScale and Ferocean) that happens to execute ARM code. > You *can* get ipkg for this, and can therefore install any Optware > package; and I know Lua is available. Instructions here: I have a modern and up to date Ubuntu running on our Sheevaplugs quite successfully, along with the stock Lua from their repositories. B. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:34:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDY9kl011315; Wed, 28 Oct 2009 11:34:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B381319425; Wed, 28 Oct 2009 11:32:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E52519415 for ; Wed, 28 Oct 2009 11:32:51 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDXhK1011216 for ; Wed, 28 Oct 2009 11:33:43 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id n9SDXh603370; Wed, 28 Oct 2009 11:33:43 -0200 Date: Wed, 28 Oct 2009 11:33:42 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Request for help on extending if statement (lparser.c) Message-ID: <20091028113342.A3367@lua.tecgraf.puc-rio.br> References: <4AE76DD3.4090006@t-online.de> <20091028091409.GA6668@fand.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091028091409.GA6668@fand.local>; from paul-lua@malete.org on Wed, Oct 28, 2009 at 10:14:09AM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > repeat > if cond1 then > ... > else > other statements > break > end > -- finally > statementX > statementY > until true You mean, until *false*, right? From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:36:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDadk5011916; Wed, 28 Oct 2009 11:36:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 857D219436; Wed, 28 Oct 2009 11:35:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73EA919415 for ; Wed, 28 Oct 2009 11:35:03 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so171828qwb.11 for ; Wed, 28 Oct 2009 06:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=v6gNixUtHXNBZ6qu6cxjekrHyU0b723wPD5+gPepo9I=; b=M2CXHlTJu8cvWwn5XahakGgW6Ip8UnIsaAxnKUHPl4EhsgVheOOyGWR13FzhS1jUtW g/Lc2dS9B0kLgUP1U95DtNrCCWBtG3mZXuU8xho5x1MgEBNYqxIx+Qo9MC/ezAAX7ScL xgnetJia/fhmr6k/2m1Jb4HFO5V8NXEJoHMpc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=OMObvmR29otwPBeQrfQEqL6EUWFWLRPeWlqSA+d57p3WJ8xUexYVnukYCvtl4TDRok X/1DjIVcDf6IV9tXCzShVhBqaHbo1/lWpKSOwXadmrtCZZy4wBzlB5xfQmk8kgOdE2dF N+2SfBMDYEpf9c6yNYSDlKG4pXw6MYksJsU8g= MIME-Version: 1.0 Received: by 10.224.102.212 with SMTP id h20mr9264600qao.40.1256736956263; Wed, 28 Oct 2009 06:35:56 -0700 (PDT) In-Reply-To: References: <4AE83715.2010702@spellingbeewinnars.org> Date: Wed, 28 Oct 2009 11:35:56 -0200 X-Google-Sender-Auth: 0c328dbe66f12a3b Message-ID: <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> Subject: Re: confused about mod_lua, mod_python, mod_php From: Fabio Mascarenhas To: Lua list Content-Type: multipart/alternative; boundary=00c09f88d101daae3a0476fedf1d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f88d101daae3a0476fedf1d Content-Type: text/plain; charset=UTF-8 It is also trivial to setup Lua with mod_fcgid, this is the Apache configuration snippet: Options +ExecCGI AddHandler fcgid-script .lua AddHandler fcgid-script .ws FCGIWrapper "/path/to/wsapi.fcgi" .lua FCGIWrapper "/path/to/wsapi.fcgi" .ws DirectoryIndex index.lua And you don't need spawn-fcgi in this case, as mod_fcgid does its own process management. I haven't compared how it fares against nginx+spawn-fcgi, though. -- Fabio Mascarenhas On Wed, Oct 28, 2009 at 11:18 AM, Bertrand Mansion wrote: > On Wed, Oct 28, 2009 at 1:20 PM, Patrick > wrote: > > I hope that I am not lowering the signal to noise ratio on this list. As > I was saying I am not a pro programmer and judging from the posts to this > lists I am it's dumbest member. > > > > > > Having said this, our thread about PHP and Lua yesterday left me > wondering about Mod_lua. > > > > > > It seems to me the Mod_PHP is the preferred way to deploy PHP while > Mod_Python is not the preferred way to deploy Python. It is my understanding > that Mod_Python can access Apache's internals in such a way that it make it > unsuitable for deployment with economy hosting providers as one account > could clobber another account. If Mod_lua is being bundled with Apache by > default now, surely it will not cause the same problem as Mod_python will > it? > > Mod_lua is not ready yet and as things are moving slowly with Apache > 2.4, I wouldn't count on it before two years (this is only my opinion, > I might be wrong). > > About mod_php, more recent benchmarks show that it is slower than > using fastcgi because mod_php only works correctly when Apache uses > its prefork MPM. The prefork MPM is less performant that other Apache > MPM because it doesn't use all the Apache threading potential. If you > use fastcgi, you don't have this problem anymore and can use a better > suited Apache MPM. If I understand correctly, the problem is not > really with mod_php, but with some PHP extensions which are not > threadsafe. And because it is better to be safe than sorry, most > people prefer to keep the prefork MPM. > > Currently, the best setup I have tried in term of overall performance > (rps, memory, cpu) is with Nginx and fastcgi. The new PHP 5.3 makes it > even easier to use this setup because it doesn't require spawn-fcgi > anymore. With older versions, you can use spawn-fcgi with great > performance as well. The good thing is that Nginx + spawn-fcgi also > works great with Lua, as long as you manage to install wsapi.fcgi. And > since spawn-fcgid is a subproduct of Lighttpd, it will also work well > with this server. Fabio posted a small tutorial on his brand new shiny > blog : > http://mascarenhas.github.com/2009/10/24/wsapi-nginx-fcgi.html > > This means you can use both PHP and Lua at the same time with the same > Nginx server and almost the same configuration. > > I also heard good things about the Cherokee > http://www.cherokee-project.com it has a nice admin interface and > supports fastcgi. > > In conclusion, I would say that today, Apache might not be the best > choice to run alternatives to Java and PHP. You will probably have to > try one of Nginx, Lighttpd or Cherokee. If you are more adventurous, > you can also try qDecoder's qHttpd server, as it seems it supports Lua > directly http://www.qdecoder.org but I haven't tried it myself. If you > can wait, I am sure mod_lua will be great, but not before long I am > afraid. At the moment it is pretty useless if you are planning > something serious. > > > -- > Bertrand Mansion > Mamasam > --00c09f88d101daae3a0476fedf1d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It is also trivial to setup Lua with mod_fcgid, this is the Apache con= figuration snippet:

<IfModule mod_fcgid.c&= gt;
=C2=A0=C2=A0Options +ExecCGI
=C2=A0=C2=A0AddHandler= fcgid-script .lua
=C2=A0=C2=A0AddHandler fcgid-script .ws
=C2=A0=C2=A0FCGIWrap= per "/path/to/wsapi.fcgi" .lua
=C2=A0=C2=A0FCGIWrapper = "/path/to/wsapi.fcgi" .ws
=C2=A0=C2=A0DirectoryIndex in= dex.lua
</IfModule>

And you don't need spawn-fcgi in this case, as mod_= fcgid does its own process management. I haven't compared how it fares = against nginx+spawn-fcgi, though.=C2=A0

--
= Fabio Mascarenhas


On Wed, Oct 28, 2009 at 11:18 AM, Bertra= nd Mansion <lua@mam= asam.net> wrote:
On Wed, Oct 28, 2009 at 1:20 PM, Patrick<= br> <spell_gooder= _now@spellingbeewinnars.org> wrote:
> I hope that I am not lowering the signal to noise ratio on this list. = As I was saying I am not a pro programmer and judging from the posts to thi= s lists I am it's dumbest member.
>
>
> Having said this, our thread about PHP and Lua yesterday left me wonde= ring about Mod_lua.
>
>
> It seems to me the Mod_PHP is the preferred way to deploy PHP while Mo= d_Python is not the preferred way to deploy Python. It is my understanding = that Mod_Python can access Apache's internals in such a way that it mak= e it unsuitable for deployment with economy hosting providers as one accoun= t could clobber another account. If Mod_lua is being bundled with Apache by= default now, surely it will not cause the same problem as Mod_python will = it?

Mod_lua is not ready yet and as things are moving slowly with A= pache
2.4, I wouldn't count on it before two years (this is only my opinion,<= br> I might be wrong).

About mod_php, more recent benchmarks show that it is slower than
using fastcgi because mod_php only works correctly when Apache uses
its prefork MPM. The prefork MPM is less performant that other Apache
MPM because it doesn't use all the Apache threading potential. If you use fastcgi, you don't have this problem anymore and can use a better suited Apache MPM. If I understand correctly, the problem is not
really with mod_php, but with some PHP extensions which are not
threadsafe. And because it is better to be safe than sorry, most
people prefer to keep the prefork MPM.

Currently, the best setup I have tried in term of overall performance
(rps, memory, cpu) is with Nginx and fastcgi. The new PHP 5.3 makes it
even easier to use this setup because it doesn't require spawn-fcgi
anymore. With older versions, you can use spawn-fcgi with great
performance as well. The good thing is that Nginx + spawn-fcgi also
works great with Lua, as long as you manage to install wsapi.fcgi. And
since spawn-fcgid is a subproduct of Lighttpd, it will also work well
with this server. Fabio posted a small tutorial on his brand new shiny
blog :
http://mascarenhas.github.com/2009/10/24/wsapi-nginx-fcgi= .html

This means you can use both PHP and Lua at the same time with the same
Nginx server and almost the same configuration.

I also heard good things about the Cherokee
http://www.ch= erokee-project.com it has a nice admin interface and
supports fastcgi.

In conclusion, I would say that today, Apache might not be the best
choice to run alternatives to Java and PHP. You will probably have to
try one of Nginx, Lighttpd or Cherokee. If you are more adventurous,
you can also try qDecoder's qHttpd server, as it seems it supports Lua<= br> directly http://www.q= decoder.org but I haven't tried it myself. If you
can wait, I am sure mod_lua will be great, but not before long I am
afraid. At the moment it is pretty useless if you are planning
something serious.


--
Bertrand Mansion
Mamasam

--00c09f88d101daae3a0476fedf1d-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:38:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDcKIT012333; Wed, 28 Oct 2009 11:38:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD6CA19444; Wed, 28 Oct 2009 11:37:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DD47A1941F for ; Wed, 28 Oct 2009 11:37:02 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDbtUh012239 for ; Wed, 28 Oct 2009 11:37:55 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id n9SDbtUB012237 for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 11:37:55 -0200 Date: Wed, 28 Oct 2009 11:37:55 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Request for help on extending if statement (lparser.c) Message-ID: <20091028133755.GA12048@duchamp.tecgraf.puc-rio.br> References: <4AE76DD3.4090006@t-online.de> <20091028091409.GA6668@fand.local> <20091028113342.A3367@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091028113342.A3367@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > repeat > > until true > > You mean, until *false*, right? Oops, never mind me -- you're right of course. Sorry for the noise. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 11:46:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SDjx2M013752; Wed, 28 Oct 2009 11:45:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7750818D64; Wed, 28 Oct 2009 11:44:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BD3918CE2 for ; Wed, 28 Oct 2009 11:44:37 -0200 (BRST) Received: from [93.173.249.142] by mxout2.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KS80040C8VNBA10@mxout2.netvision.net.il> for lua@bazar2.conectiva.com.br; Wed, 28 Oct 2009 15:45:24 +0200 (IST) Date: Wed, 28 Oct 2009 15:45:26 +0200 From: Shmuel Zeigerman Subject: Re: io.lines() behaviour on \0 characters In-reply-to: <20091028102333.GI5051@pruts.nl> To: Lua list Message-id: <4AE84AF6.9070103@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <20091028102333.GI5051@pruts.nl> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ico wrote: > I'm trying to use io.lines() to read lines from a file which contains \0 > characters. This seems to fail, probably because of the fgets() used in > iolib.c:read_line(). > > Because - unlike C strings/char arrays - Lua strings are 8-bit safe, the > expected behaviour for me was for io.lines() to simply handle the \0's > as regular characters. This behavior can be easily achieved, see http://lua-users.org/lists/lua-l/2008-04/msg00266.html -- Shmuel From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 12:46:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SEklZn027835; Wed, 28 Oct 2009 12:46:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E30D19393; Wed, 28 Oct 2009 12:45:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4060819378 for ; Wed, 28 Oct 2009 12:45:09 -0200 (BRST) Received: by bwz27 with SMTP id 27so1079961bwz.21 for ; Wed, 28 Oct 2009 07:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=yB9A69pyvW6Z0AHG2H5mVrEKGn5J28NOz/LLNHqXaY4=; b=ScMf6g1Lq+1ZkampSgYsGEZClQmTJQH3UXTqyADjrKTRLWyEaaEApMpmABqAaLm/5V DKqkL3DefdcBZvDJDfT95ouoSBCWLO/fNd/K5eeA+b3Cmcx/vf5gGlxmAEJZ/j3bGkND JAuENrv6DB3ax25Hppx13os0MsDTslk0w8UCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=fK//lejZcbWbdwQZ2TYnZ9tz0iy+/Dl0moBlct0z8uD9ta4spkROCXzUuOwFNUArg/ f5ZoXCYJ8QwEsSrvH7+R/iAOxspk80V4UFN1o3VPmjfbEc8hGKIGhSo4Se4FIR1Vne4N vbxqmob7xbRBoBU1ZDonuK4fAnYJzkiUXU6g0= MIME-Version: 1.0 Received: by 10.204.32.204 with SMTP id e12mr5298266bkd.51.1256741157882; Wed, 28 Oct 2009 07:45:57 -0700 (PDT) In-Reply-To: <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> Date: Wed, 28 Oct 2009 09:45:56 -0500 X-Google-Sender-Auth: 9e55bb8eb5c7aa39 Message-ID: <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> Subject: Re: confused about mod_lua, mod_python, mod_php From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=00032555488e4a68a10476ffdac6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555488e4a68a10476ffdac6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1, I'm using mod_fcgid for both Lua and PHP, performance is great! Blessings! On Wed, Oct 28, 2009 at 8:35 AM, Fabio Mascarenhas wro= te: > It is also trivial to setup Lua with mod_fcgid, this is the Apache > configuration snippet: > > > Options +ExecCGI > AddHandler fcgid-script .lua > AddHandler fcgid-script .ws > FCGIWrapper "/path/to/wsapi.fcgi" .lua > FCGIWrapper "/path/to/wsapi.fcgi" .ws > DirectoryIndex index.lua > > > And you don't need spawn-fcgi in this case, as mod_fcgid does its own > process management. I haven't compared how it fares against > nginx+spawn-fcgi, though. > > -- > Fabio Mascarenhas > > > > On Wed, Oct 28, 2009 at 11:18 AM, Bertrand Mansion wrote= : > >> On Wed, Oct 28, 2009 at 1:20 PM, Patrick >> wrote: >> > I hope that I am not lowering the signal to noise ratio on this list. = As >> I was saying I am not a pro programmer and judging from the posts to thi= s >> lists I am it's dumbest member. >> > >> > >> > Having said this, our thread about PHP and Lua yesterday left me >> wondering about Mod_lua. >> > >> > >> > It seems to me the Mod_PHP is the preferred way to deploy PHP while >> Mod_Python is not the preferred way to deploy Python. It is my understan= ding >> that Mod_Python can access Apache's internals in such a way that it make= it >> unsuitable for deployment with economy hosting providers as one account >> could clobber another account. If Mod_lua is being bundled with Apache b= y >> default now, surely it will not cause the same problem as Mod_python wil= l >> it? >> >> Mod_lua is not ready yet and as things are moving slowly with Apache >> 2.4, I wouldn't count on it before two years (this is only my opinion, >> I might be wrong). >> >> About mod_php, more recent benchmarks show that it is slower than >> using fastcgi because mod_php only works correctly when Apache uses >> its prefork MPM. The prefork MPM is less performant that other Apache >> MPM because it doesn't use all the Apache threading potential. If you >> use fastcgi, you don't have this problem anymore and can use a better >> suited Apache MPM. If I understand correctly, the problem is not >> really with mod_php, but with some PHP extensions which are not >> threadsafe. And because it is better to be safe than sorry, most >> people prefer to keep the prefork MPM. >> >> Currently, the best setup I have tried in term of overall performance >> (rps, memory, cpu) is with Nginx and fastcgi. The new PHP 5.3 makes it >> even easier to use this setup because it doesn't require spawn-fcgi >> anymore. With older versions, you can use spawn-fcgi with great >> performance as well. The good thing is that Nginx + spawn-fcgi also >> works great with Lua, as long as you manage to install wsapi.fcgi. And >> since spawn-fcgid is a subproduct of Lighttpd, it will also work well >> with this server. Fabio posted a small tutorial on his brand new shiny >> blog : >> http://mascarenhas.github.com/2009/10/24/wsapi-nginx-fcgi.html >> >> This means you can use both PHP and Lua at the same time with the same >> Nginx server and almost the same configuration. >> >> I also heard good things about the Cherokee >> http://www.cherokee-project.com it has a nice admin interface and >> supports fastcgi. >> >> In conclusion, I would say that today, Apache might not be the best >> choice to run alternatives to Java and PHP. You will probably have to >> try one of Nginx, Lighttpd or Cherokee. If you are more adventurous, >> you can also try qDecoder's qHttpd server, as it seems it supports Lua >> directly http://www.qdecoder.org but I haven't tried it myself. If you >> can wait, I am sure mod_lua will be great, but not before long I am >> afraid. At the moment it is pretty useless if you are planning >> something serious. >> >> >> -- >> Bertrand Mansion >> Mamasam >> > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --00032555488e4a68a10476ffdac6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1, I'm using mod_fcgid for both Lua and PHP, performance is great!
=
Blessings!

On Wed, Oct 28, 2009 at 8:= 35 AM, Fabio Mascarenhas <mascarenhas@acm.org> wrote:
It is also t= rivial to setup Lua with mod_fcgid, this is the Apache configuration snippe= t:

<IfModule mod_fcgid.c>
=C2=A0=C2= =A0Options +ExecCGI
=C2=A0=C2=A0AddHandler fcgid-script .lua
=C2=A0=C2=A0AddHandler fcgid-script .ws
=C2=A0=C2=A0FCGIWrap= per "/path/to/wsapi.fcgi" .lua
=C2=A0=C2=A0FCGIWrapper = "/path/to/wsapi.fcgi" .ws
=C2=A0=C2=A0DirectoryIndex in= dex.lua
</IfModule>

And you don't need spawn-fcgi in this case, as mod_= fcgid does its own process management. I haven't compared how it fares = against nginx+spawn-fcgi, though.=C2=A0

--
= Fabio Mascarenhas



On Wed, Oct 28, 2009 at 11:18 AM, Bertra= nd Mansion <lua@mamasam.net> wrote:
On Wed, Oct 28, 2009 at 1:20 PM, Patrick
<spell_gooder_now@spellingbeewinnars.org> wrote:
> I hope that I am not lowering the signal to noise ratio on this list. = As I was saying I am not a pro programmer and judging from the posts to thi= s lists I am it's dumbest member.
>
>
> Having said this, our thread about PHP and Lua yesterday left me wonde= ring about Mod_lua.
>
>
> It seems to me the Mod_PHP is the preferred way to deploy PHP while Mo= d_Python is not the preferred way to deploy Python. It is my understanding = that Mod_Python can access Apache's internals in such a way that it mak= e it unsuitable for deployment with economy hosting providers as one accoun= t could clobber another account. If Mod_lua is being bundled with Apache by= default now, surely it will not cause the same problem as Mod_python will = it?

Mod_lua is not ready yet and as things are moving slowly with A= pache
2.4, I wouldn't count on it before two years (this is only my opinion,<= br> I might be wrong).

About mod_php, more recent benchmarks show that it is slower than
using fastcgi because mod_php only works correctly when Apache uses
its prefork MPM. The prefork MPM is less performant that other Apache
MPM because it doesn't use all the Apache threading potential. If you use fastcgi, you don't have this problem anymore and can use a better suited Apache MPM. If I understand correctly, the problem is not
really with mod_php, but with some PHP extensions which are not
threadsafe. And because it is better to be safe than sorry, most
people prefer to keep the prefork MPM.

Currently, the best setup I have tried in term of overall performance
(rps, memory, cpu) is with Nginx and fastcgi. The new PHP 5.3 makes it
even easier to use this setup because it doesn't require spawn-fcgi
anymore. With older versions, you can use spawn-fcgi with great
performance as well. The good thing is that Nginx + spawn-fcgi also
works great with Lua, as long as you manage to install wsapi.fcgi. And
since spawn-fcgid is a subproduct of Lighttpd, it will also work well
with this server. Fabio posted a small tutorial on his brand new shiny
blog :
http://mascarenhas.github.com/2009/10/24/wsapi-nginx-fcgi= .html

This means you can use both PHP and Lua at the same time with the same
Nginx server and almost the same configuration.

I also heard good things about the Cherokee
http://www.ch= erokee-project.com it has a nice admin interface and
supports fastcgi.

In conclusion, I would say that today, Apache might not be the best
choice to run alternatives to Java and PHP. You will probably have to
try one of Nginx, Lighttpd or Cherokee. If you are more adventurous,
you can also try qDecoder's qHttpd server, as it seems it supports Lua<= br> directly http://www.q= decoder.org but I haven't tried it myself. If you
can wait, I am sure mod_lua will be great, but not before long I am
afraid. At the moment it is pretty useless if you are planning
something serious.


--
Bertrand Mansion
Mamasam




--
Fernando P.= Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Ca= talina Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--00032555488e4a68a10476ffdac6-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 14:37:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SGbGjk019598; Wed, 28 Oct 2009 14:37:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE3DC193A3; Wed, 28 Oct 2009 14:35:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (unknown [203.59.1.104]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7C9219382 for ; Wed, 28 Oct 2009 14:35:38 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBAAoQ6ErLzl5a/2dsb2JhbAAI2l+EPwSCUg X-IronPort-AV: E=Sophos;i="4.44,640,1249228800"; d="scan'208";a="477108065" Received: from unknown (HELO [10.1.1.2]) ([203.206.94.90]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 29 Oct 2009 00:36:21 +0800 Content-Type: text/plain; charset=iso-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: confused about mod_lua, mod_python, mod_php From: Jacques Chester In-Reply-To: <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> Date: Thu, 29 Oct 2009 00:36:20 +0800 Message-Id: References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SGbGjk019598 On 28/10/2009, at 10:45 PM, Fernando P. García wrote: > +1, I'm using mod_fcgid for both Lua and PHP, performance is great! It's funny how doing this throws Lua's benefits into sharp relief. Each copy of PHP on my servers chews ~ between 15Mb and 33Mb. Each copy of Lua is less than 300kb, from memory. That's a memory usage ratio of between ~50:1 and ~100:1. I published some microbenchmarks on the Kepler mailing list a while back; and as I recall one of the interesting facts was that you could run so many instances of Lua in the same memory space that the key bottleneck ceased to be waiting on FCGI children. It became waiting on disk. Sometimes I wonder if part of Lua's excellent performance is simply because the entire VM and code can usually fit into a modern CPU's caches. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 14:37:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SGbqjR019876; Wed, 28 Oct 2009 14:37:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 473B6193BB; Wed, 28 Oct 2009 14:36:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-01.prod.phx3.secureserver.net (p3plsmtpa01-01.prod.phx3.secureserver.net [72.167.82.81]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3990C193B0 for ; Wed, 28 Oct 2009 14:35:59 -0200 (BRST) Received: (qmail 20425 invoked from network); 28 Oct 2009 16:36:50 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-01.prod.phx3.secureserver.net (72.167.82.81) with ESMTP; 28 Oct 2009 16:36:50 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Lua syntax gotcha From: Mark Hamburg In-Reply-To: <87k4ygx6d2.fsf@lola.goethe.zz> Date: Wed, 28 Oct 2009 09:36:48 -0700 Message-Id: References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> <87k4ygx6d2.fsf@lola.goethe.zz> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SGbqjR019876 On Oct 27, 2009, at 7:24 AM, David Kastrup wrote: > Mark Hamburg writes: > >> If unexpected line continuations are the problem, then obviously what >> Lua needs is a line continuation character. It goes in column 7 as I >> recall. ;-) > > Even 1-based (as Lua programmers would have it) it goes in column 6. I think I was remembering COBOL: • Cobol: String constants may be continued by not ending the original string in a PICTURE clause with ', then inserting a - in column 7 (same position as the * for comment is used.) Or a corrupted mixture of COBOL and FORTRAN syntax. Mark From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 14:45:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SGjQOS021805; Wed, 28 Oct 2009 14:45:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAA5419306; Wed, 28 Oct 2009 14:44:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5650192D9 for ; Wed, 28 Oct 2009 14:43:59 -0200 (BRST) Received: by bwz27 with SMTP id 27so1215983bwz.21 for ; Wed, 28 Oct 2009 09:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=L0xMPfxkjUTCFpEqoS2U49ysRacpIgbgf2udgHrKa2Y=; b=KLkhJm1nsm+jNn6wNQcXP20vXWv2fzlXc68z4WziOkHSUi3xF1MZdidhrHv4PoGINY mS8TSKV6EkTBNIciiDS5RlpWjfzzz02Sw0+9pvM+zQJGQluLnpmvmAF5QIsaAzyb5ktO BR7ud06/IThnJjwrawoUWFRBdpaK11mDBO0f0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dIVdqjuFtG1o/vpCNmjBhZkMNvW33ksu7B2oDQHL1idS/kCnHlbhYqMlJVrD6dfQpO dXrMAfYjcnDkKzKOGTO102lHn9I1YuksmeuJmNKx/5ie53+CiDgdGhl84WuKNjTJrwFA 90+xsPI5JTxIjcnPd3lGjMiP72lGOFluCj4Kw= MIME-Version: 1.0 Received: by 10.223.15.86 with SMTP id j22mr1537656faa.47.1256748292163; Wed, 28 Oct 2009 09:44:52 -0700 (PDT) In-Reply-To: References: <4AE4C5E5.8060506@cowlark.com> <560972290910260348p23762149vdce21f44fb660c0d@mail.gmail.com> <639942972.20091026142034@gmail.com> <560972290910260440g4efe018aq24f93b3372fdb447@mail.gmail.com> <4AE5C7ED.9050803@elbitsystems-us.com> <57B03643-6729-4A08-8BE7-31BA2A5E922F@grubmah.com> <87k4ygx6d2.fsf@lola.goethe.zz> Date: Wed, 28 Oct 2009 16:44:52 +0000 Message-ID: <6a3ae47e0910280944w224b9d2axb47070c2cd1295b2@mail.gmail.com> Subject: Re: Lua syntax gotcha From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=001517447f0c86c74804770183f3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517447f0c86c74804770183f3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Oct 28, 2009 at 4:36 PM, Mark Hamburg wrote: > On Oct 27, 2009, at 7:24 AM, David Kastrup wrote: > > Mark Hamburg writes: >> >> If unexpected line continuations are the problem, then obviously what >>> Lua needs is a line continuation character. It goes in column 7 as I >>> recall. ;-) >>> >> >> Even 1-based (as Lua programmers would have it) it goes in column 6. >> > > I think I was remembering COBOL: > > =E2=80=A2 Cobol: String constants may be continued by not ending t= he > original string in a PICTURE clause with ', then inserting a - in column = 7 > (same position as the * for comment is used.) > > Or a corrupted mixture of COBOL and FORTRAN syntax. > > Mark > > I prefer the VB _ at the end of line as a continuation character. Much easier to miss. You can write truly great misleading code. Robby --001517447f0c86c74804770183f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Oct 28, 2009 at 4:36 PM, Mark Hamburg <
mark@grubmah.com> wrote:
On Oct 27, 2009, at 7:24 AM, David Kastru= p wrote:

Mark Hamburg <mark= @grubmah.com> writes:

If unexpected line continuations are the problem, then obviously what
Lua needs is a line continuation character. It goes in column 7 as I
recall. ;-)

Even 1-based (as Lua programmers would have it) it goes in column 6.

I think I was remembering COBOL:

=C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=A2 Cobol: String constants may be contin= ued by not ending the original string in a PICTURE clause with ', then = inserting a - in column 7 (same position as the * for comment is used.)

Or a corrupted mixture of COBOL and FORTRAN syntax.

Mark


I prefer the VB _ at the end of line as a con= tinuation character.
Much easier to miss.
You can write truly great m= isleading code.

Robby

--001517447f0c86c74804770183f3-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 15:56:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SHuKi6009850; Wed, 28 Oct 2009 15:56:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE84A1934B; Wed, 28 Oct 2009 15:54:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vaxjo.synopsys.com (us02smtp1.synopsys.com [198.182.60.75]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9DDE192C5 for ; Wed, 28 Oct 2009 15:54:35 -0200 (BRST) Received: from mother.synopsys.com (mother.synopsys.com [146.225.100.171]) by vaxjo.synopsys.com (Postfix) with ESMTP id AFE771046F for ; Wed, 28 Oct 2009 10:55:24 -0700 (PDT) Received: from us01wxhtc1.internal.synopsys.com (localhost [127.0.0.1]) by mother.synopsys.com (8.9.1/8.9.1) with ESMTP id KAA18886 for ; Wed, 28 Oct 2009 10:55:19 -0700 (PDT) Received: from US01WXMBX1.internal.synopsys.com ([10.15.75.41]) by us01wxhtc1.internal.synopsys.com ([10.15.75.39]) with mapi; Wed, 28 Oct 2009 10:55:19 -0700 From: Nayana Datta To: "lua@bazar2.conectiva.com.br" Date: Wed, 28 Oct 2009 10:55:19 -0700 Subject: lua 5.1.4 on amd64 Thread-Topic: lua 5.1.4 on amd64 Thread-Index: AcpX99BfUl/oVUeBQh+ZRs576hGQdQ== Message-ID: Accept-Language: en-US Content-Language: en-US acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_CB41A9C76889A44996DA6CA98E8AF62E15F05433US01WXMBX1inter_" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_CB41A9C76889A44996DA6CA98E8AF62E15F05433US01WXMBX1inter_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am very new to Lua, hence a rather basic question: I built lua5.1.4 on am= 64, and while trying to use it, I get the following errors: I have math.h i= ncluded in my c file. I have a c-calling lua-calling c setup. liblua.a(lvm.o)(.text+0xc3c): In function `Arith':: undefined reference to = `floor' liblua.a(lvm.o)(.text+0xc69): In function `Arith':: undefined reference to = `pow' liblua.a(lvm.o)(.text+0x2244): In function `luaV_execute':: undefined refer= ence to `floor' liblua.a(lvm.o)(.text+0x2276): In function `luaV_execute':: undefined refer= ence to `pow' liblua.a(lcode.o)(.text+0x10f2): In function `codearith':: undefined refere= nce to `floor' liblua.a(lcode.o)(.text+0x1149): In function `codearith':: undefined refere= nce to `pow' Is there a known issue with using/build lua-5.1.4 on amd64? If yes, is the= re a workaround? Thanks nayana --_000_CB41A9C76889A44996DA6CA98E8AF62E15F05433US01WXMBX1inter_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am very new to Lua, hence a rather basic question: I= built lua5.1.4 on am64, and while trying to use it, I get the following errors: I= have math.h included in my c file. I have a c-calling lua-calling c setup.<= /o:p>

 

liblua.a(lvm.o)(.text+0xc3c): In function `Arith':: undefined reference to `floor'

liblua.a(lvm.o)(.text+0xc69): In function `Arith':: undefined reference to `pow'

liblua.a(lvm.o)(.text+0x2244): In function `luaV_execu= te':: undefined reference to `floor'

liblua.a(lvm.o)(.text+0x2276): In function `luaV_execu= te':: undefined reference to `pow'

liblua.a(lcode.o)(.text+0x10f2): In function `codearit= h':: undefined reference to `floor'

liblua.a(lcode.o)(.text+0x1149): In function `codearit= h':: undefined reference to `pow'

 

Is there a known issue with using/build lua-5.1.4 on a= md64? If yes,  is there a workaround?

 

 

Thanks

nayana

--_000_CB41A9C76889A44996DA6CA98E8AF62E15F05433US01WXMBX1inter_-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 15:57:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SHv1R5010067; Wed, 28 Oct 2009 15:57:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9712619387; Wed, 28 Oct 2009 15:54:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail15-a-ad.linkedin.com (mail15-a-ad.linkedin.com [208.111.169.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 961B8192C5 for ; Wed, 28 Oct 2009 15:54:37 -0200 (BRST) DomainKey-Signature: s=prod; d=linkedin.com; c=nofws; q=dns; h=Sender:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type:X-LinkedIn-fbl; b=XpDkH60aunmTovUCBWNX1A+EYTFlvH5zcLgbEGnpqtPa4wdV2WKbDLjX x9IzXD8sv7OToDO6XIh/01YvlP750FuiVWKiviQPMkNij3xdtccX0sAdx oU1uHNK2R8qvl9Q; Date: Wed, 28 Oct 2009 10:55:27 -0700 (PDT) From: Aidin Abedi To: Nikolai Kondrashov Message-ID: <97359541.2424082.1256752527372.JavaMail.app@ech3-cdn05.prod> Subject: Invitation to connect on LinkedIn MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2424081_1594870485.1256752527370" X-LinkedIn-fbl: vzJ0rpcn1IvWpYNRy6J3aGlpVzH6vy-wDkS3XdRKtFF5LBxrsMIL9e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ------=_Part_2424081_1594870485.1256752527370 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit LinkedIn ------------ Aidin Abedi requested to add you as a connection on LinkedIn: ------------------------------------------ Nikolai, I'd like to add you to my professional network on LinkedIn. - Aidin Accept invitation from Aidin Abedi http://www.linkedin.com/e/umUaI4vbmXLNZJBsRdC6u58_HULNWBso5XaYp5rkj9/blk/I400733807_3/6lColZJrmZznQNdhjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfPdvdP0UcPcTc30QiiZcq557l65QqiYMd3cTdzgSczwLrCBxbOYWrSlI/EML_comm_afe/ View invitation from Aidin Abedi http://www.linkedin.com/e/umUaI4vbmXLNZJBsRdC6u58_HULNWBso5XaYp5rkj9/blk/I400733807_3/0PnPsMe3cPdP0Md4ALqnpPbOYWrSlI/svi/ ------ (c) 2009, LinkedIn Corporation ------=_Part_2424081_1594870485.1256752527370 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

LinkedIn

Aidin Abedi requested to add you as a connection on LinkedIn:

Nikolai,

I'd like to add you to my professional network on LinkedIn.

- Aidin

 
Accept View invitation from Aidin Abedi

 

© 2009, LinkedIn Corporation

------=_Part_2424081_1594870485.1256752527370-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 16:01:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SI1Zcq011204; Wed, 28 Oct 2009 16:01:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4B08193A4; Wed, 28 Oct 2009 16:00:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5463B192C5 for ; Wed, 28 Oct 2009 16:00:06 -0200 (BRST) Received: by bwz27 with SMTP id 27so1303294bwz.21 for ; Wed, 28 Oct 2009 11:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=HEkzrtIiPENWRPRMB9PD/+LML7LctMjXxk5MBFzBueI=; b=WpdDYxu64UC3VGU12TbMSAiHphFZFSP1lQqGnYv3zQPbyVScsKtftGelpdUqvRwa+S cjnVEatOfM+jZw9CHINF4hyK+1DA3AkzYEKubD2KVkt7B49ScSAJzWvWFE9O32Saa7uI 5AgpLkZr2oYH1RcXIn7l2BpuNyqR9dRWZBMaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=VPpVGeH1vAPxjxFLfhPDj6l1x02n/50jZk8Jr5Bavswg8azrs6rUacwC6cLZfI0rgs atHY6N8U4NVyEDvxTjPZaoUilYj2ThgRajqlFZh+s/v5f3PKWSfDhrJ15UWRTiuf/llq DYsNtlTFKlQnd4GEhhrv9KhQPEYmhMYGO9Hxg= MIME-Version: 1.0 Received: by 10.223.68.155 with SMTP id v27mr1346491fai.10.1256752857190; Wed, 28 Oct 2009 11:00:57 -0700 (PDT) In-Reply-To: References: From: Anders Bergh Date: Wed, 28 Oct 2009 19:00:37 +0100 Message-ID: <976395530910281100ua37573fs6afcd12971d32c65@mail.gmail.com> Subject: Re: lua 5.1.4 on amd64 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SI1Zcq011204 On Wed, Oct 28, 2009 at 18:55, Nayana Datta wrote: > Hi, > > > > I am very new to Lua, hence a rather basic question: I built lua5.1.4 on > am64, and while trying to use it, I get the following errors: I have math.h > included in my c file. I have a c-calling lua-calling c setup. > > > > liblua.a(lvm.o)(.text+0xc3c): In function `Arith':: undefined reference to > `floor' > > liblua.a(lvm.o)(.text+0xc69): In function `Arith':: undefined reference to > `pow' > > liblua.a(lvm.o)(.text+0x2244): In function `luaV_execute':: undefined > reference to `floor' > > liblua.a(lvm.o)(.text+0x2276): In function `luaV_execute':: undefined > reference to `pow' > > liblua.a(lcode.o)(.text+0x10f2): In function `codearith':: undefined > reference to `floor' > > liblua.a(lcode.o)(.text+0x1149): In function `codearith':: undefined > reference to `pow' > > > > Is there a known issue with using/build lua-5.1.4 on amd64? If yes,  is > there a workaround? > > > > > > Thanks > > nayana Link to libm (math) as well. Add -lm to your gcc flags, should fix it. -- Anders Bergh From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 18:27:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SKRh6U012898; Wed, 28 Oct 2009 18:27:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D181F192A8; Wed, 28 Oct 2009 18:26:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71D0C1928C for ; Wed, 28 Oct 2009 18:26:06 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 736D1BD85C for ; Wed, 28 Oct 2009 16:26:57 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 28 Oct 2009 16:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=mPuhmJ7ZWR3xQ8UgLfGQFDstSxc=; b=hn7hu3POkiY0UjW2sJ4Q3WTFyizfSl5Jin1+0i42+55MWtmMskpV3oEw9i0Yj3FrYxDcMCue4vh9l2TNqYyLEuv3tyOYiFYBGuC3ImjeKBEDBTeAz9oKMN5Y6q3b1rXiDTduWbUfYUnTJlH4VXDbDSQymp7rYecLW5v/+3m3MRE= X-Sasl-enc: QAc9sibeZbDzeW0xwBMniZYnyIU7GqilqCN26yVZh/a4 1256761616 Received: from [10.1.1.3] (222-152-73-237.jetstream.xtra.co.nz [222.152.73.237]) by mail.messagingengine.com (Postfix) with ESMTPSA id 804B949A8D1 for ; Wed, 28 Oct 2009 16:26:56 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaRocks 2.0.1 From: Geoff Leyland In-Reply-To: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> Date: Thu, 29 Oct 2009 09:26:23 +1300 Content-Transfer-Encoding: 7bit Message-Id: <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 28/10/2009, at 5:48 AM, Hisham wrote: > Hello, > > I'm happy to announce LuaRocks 2.0.1, a bugfix release: > > http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz Hi Hisham, With lua installed by macports in /opt/local, luarocks installs itself in /usr/local and the packages it installs don't work immediately (you have to add /usr/local... to your LUAPATH). It's not a big deal, but it might be worth luarocks offering to install in /opt/local in these cases, or have it mention that you're going to have to fiddle? By the way, I've made a number of minor changes to luacov (to handle os.exit, wraps coroutine.create and coroutine.wrap). Are you interested in seeing them? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 18:34:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SKY5vK014239; Wed, 28 Oct 2009 18:34:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 496CF192C0; Wed, 28 Oct 2009 18:32:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91B371928C for ; Wed, 28 Oct 2009 18:32:34 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so312394qwb.11 for ; Wed, 28 Oct 2009 13:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=bQ8meUYKJlTsdhdK563mRduhFv3i8F1yXZuOHT7C/pI=; b=Ex2nhbmioDNycp9q9Mz5RbM0Pdl9GcQ3pcT9ZHAWcnfvxFxlX/P1D2BF3EV9YpRXqL kRfPEi2gAhXAUQ22hXnKn1zdKibNmgQhL7vSDbh0GmBuua5IFm0TNtu8V75cK9G0sy2h IsL8zvqBWZP4+cpakderZha3Wg62/+hA1ec/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=eOq/9yQtZsxFy+noLsSBY0EtbMKbJNWJ84e/WcI0pbhJldyGQ3yK1OM4hPeGEqzdUx eot86hQQhyEeiZKYbWqeQZQ2FrFOlugXTRnRudeL3LEFgG4CTSQ/BpBBRCYDkUvKAklQ EVlpCVCQz4MsQyfLg/fD3ZYOqt6htqrHobAlA= MIME-Version: 1.0 Received: by 10.224.80.77 with SMTP id s13mr4540452qak.169.1256762005457; Wed, 28 Oct 2009 13:33:25 -0700 (PDT) In-Reply-To: <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> Date: Wed, 28 Oct 2009 18:33:25 -0200 X-Google-Sender-Auth: 56d72c4821d16b0c Message-ID: <7913df4d0910281333q10a4aeedpc834361e3a9a7cad@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 From: Fabio Mascarenhas To: Lua list Content-Type: multipart/alternative; boundary=00c09f88cb2ce70e0a047704b4db X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f88cb2ce70e0a047704b4db Content-Type: text/plain; charset=UTF-8 Hi Geoff, Just pass --prefix=/opt/local to the LuaRocks configure script. -- Fabio Mascarenhas On Wed, Oct 28, 2009 at 6:26 PM, Geoff Leyland wrote: > On 28/10/2009, at 5:48 AM, Hisham wrote: > > Hello, >> >> I'm happy to announce LuaRocks 2.0.1, a bugfix release: >> >> http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz >> > > Hi Hisham, > > With lua installed by macports in /opt/local, luarocks installs itself in > /usr/local and the packages it installs don't work immediately (you have to > add /usr/local... to your LUAPATH). It's not a big deal, but it might be > worth luarocks offering to install in /opt/local in these cases, or have it > mention that you're going to have to fiddle? > > By the way, I've made a number of minor changes to luacov (to handle > os.exit, wraps coroutine.create and coroutine.wrap). Are you interested in > seeing them? > > Cheers, > Geoff > --00c09f88cb2ce70e0a047704b4db Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Geoff,

Just pass --prefix=3D/opt/local to the LuaRock= s configure script.

--
Fabio Mascarenhas


On Wed, Oct 28, 2009 at 6:26 PM, Geoff L= eyland <g= eoff_leyland@fastmail.fm> wrote:
On 28/10/2009, at 5:48 AM, Hisham wrote:

Hello,

I'm happy to announce LuaRocks 2.0.1, a bugfix release:

http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz

Hi Hisham,

With lua installed by macports in /opt/local, luarocks installs itself in /= usr/local and the packages it installs don't work immediately (you have= to add /usr/local... to your LUAPATH). =C2=A0It's not a big deal, but = it might be worth luarocks offering to install in /opt/local in these cases= , or have it mention that you're going to have to fiddle?

By the way, I've made a number of minor changes to luacov (to handle os= .exit, wraps coroutine.create and coroutine.wrap). =C2=A0Are you interested= in seeing them?

Cheers,
Geoff

--00c09f88cb2ce70e0a047704b4db-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 18:45:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SKjF63016197; Wed, 28 Oct 2009 18:45:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C845191D9; Wed, 28 Oct 2009 18:43:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BA0418BCD for ; Wed, 28 Oct 2009 18:43:48 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 7321ABDDA5 for ; Wed, 28 Oct 2009 16:44:41 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 28 Oct 2009 16:44:42 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=uucYjpOgQ2g6EF09EVju9AMvS9A=; b=KAeRMWYHhloGmJYgfkuxTmxbM8rGNWqW2TOMwUTaFsfeHEYTrH1qziznWwGT6qnERelEfBVVsMHQQ+Ic7JAiY+mbi4f5ccn6mWvLS/d+DwLIKmFcGgBnH2RctC7eJwH8Gf14F0JhlK73EyRP/jnzifbsfscfAU0Vxulome/jvnw= X-Sasl-enc: 0+QxAV6dVj2zFxC77gLwAAyuwuQhpwU34Nx90GG9Srhp 1256762678 Received: from [10.1.1.3] (222-152-73-237.jetstream.xtra.co.nz [222.152.73.237]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6B25D49A8D0 for ; Wed, 28 Oct 2009 16:44:38 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaRocks 2.0.1 From: Geoff Leyland In-Reply-To: <7913df4d0910281333q10a4aeedpc834361e3a9a7cad@mail.gmail.com> Date: Thu, 29 Oct 2009 09:44:05 +1300 Content-Transfer-Encoding: 7bit Message-Id: <78F1CE3F-6BC9-4D58-A367-488D92C07B1C@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> <7913df4d0910281333q10a4aeedpc834361e3a9a7cad@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Fabio, Sorry for not explaining better. Yes, I did that (after trying once to see if LuaRocks handled being in a different root to Lua) and everything's working fine. As I said, it's really not a big deal, but it'd just be nice if, when LuaRocks detected Lua somewhere unusual, it either said "you might want to change PREFIX" or "it'll take a bit of fiddling to make this work". Cheers, Geoff On 29/10/2009, at 9:33 AM, Fabio Mascarenhas wrote: > Hi Geoff, > > Just pass --prefix=/opt/local to the LuaRocks configure script. > > -- > Fabio Mascarenhas > > > On Wed, Oct 28, 2009 at 6:26 PM, Geoff Leyland > wrote: > On 28/10/2009, at 5:48 AM, Hisham wrote: > > Hello, > > I'm happy to announce LuaRocks 2.0.1, a bugfix release: > > http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz > > Hi Hisham, > > With lua installed by macports in /opt/local, luarocks installs > itself in /usr/local and the packages it installs don't work > immediately (you have to add /usr/local... to your LUAPATH). It's > not a big deal, but it might be worth luarocks offering to install > in /opt/local in these cases, or have it mention that you're going > to have to fiddle? > > By the way, I've made a number of minor changes to luacov (to handle > os.exit, wraps coroutine.create and coroutine.wrap). Are you > interested in seeing them? > > Cheers, > Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 19:08:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SL8HUG019417; Wed, 28 Oct 2009 19:08:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15D36192B6; Wed, 28 Oct 2009 19:06:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEA0C192B6 for ; Wed, 28 Oct 2009 19:06:46 -0200 (BRST) Received: by bwz19 with SMTP id 19so1469048bwz.28 for ; Wed, 28 Oct 2009 14:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=y17D5aqKgCkSR3bAAuXCn6o1hz11n3vNO7ZbesVllsI=; b=gR/Ucv6X3u9kurvIEDdNsMMVJ8ZwTcx1Qkqv49woVjXie3PjHMHJKDYDVGgeweMTH9 H5uPHnW5zv+atgeyE57XgVbUpy2y0vHmJYm+OJaWzdQJUoxkp2g2U7nz+8tuuUDV5aiB rU0lgPzvEx2lFK1Wk2DKrJiL/8u8GBp9CPD+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Z7/meK9YwVilUHs9WDspaYuaE/nPV9vOW9OVFA18klbZY/n57YDcSr9tlPSRbDIArj 4+/azx1Mi5b5Xkm+dpJOArp6wWU4cjIHB3Y3FPJhODCIA9J8qO+y4Y37ISa84wY5M5FK TiLMUH9Wvz+2Xh/sEIss1Ssq4sXufz2QOPKkU= MIME-Version: 1.0 Received: by 10.204.0.69 with SMTP id 5mr931333bka.173.1256764059377; Wed, 28 Oct 2009 14:07:39 -0700 (PDT) In-Reply-To: <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> From: Hisham Date: Wed, 28 Oct 2009 19:07:19 -0200 Message-ID: <5e7d91620910281407m22086da1jb94924a8419614f6@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SL8HUG019417 On Wed, Oct 28, 2009 at 6:26 PM, Geoff Leyland wrote: > On 28/10/2009, at 5:48 AM, Hisham wrote: > >> Hello, >> >> I'm happy to announce LuaRocks 2.0.1, a bugfix release: >> >> http://www.luarocks.org/releases/luarocks-2.0.1.tar.gz > > Hi Hisham, > > With lua installed by macports in /opt/local, luarocks installs itself in > /usr/local and the packages it installs don't work immediately (you have to > add /usr/local... to your LUAPATH).  It's not a big deal, but it might be > worth luarocks offering to install in /opt/local in these cases, or have it > mention that you're going to have to fiddle? The current behavior is pretty standard fare for "configure"-based installs, so I'd prefer to keep it as it is (too much autodetection and the install scripts soon become too hard to maintain), but adding a check in the end to at least inform the user that their chosen install location is not in LUA_PATH sounds like a good idea. > By the way, I've made a number of minor changes to luacov (to handle > os.exit, wraps coroutine.create and coroutine.wrap).  Are you interested in > seeing them? Sure, send them in. I'm not using/maintaining LuaCov much these days, so it's nice to see it alive. :) -- Hisham From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 19:12:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SLC9Mu020042; Wed, 28 Oct 2009 19:12:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1DD5191DC; Wed, 28 Oct 2009 19:10:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88DAD19178 for ; Wed, 28 Oct 2009 19:10:47 -0200 (BRST) Received: by bwz27 with SMTP id 27so1511723bwz.21 for ; Wed, 28 Oct 2009 14:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=aDZHg8lHWIIyWIzRGVRdKKIbIzg+LK64EIabj91CfMs=; b=W4vAjbU6h3LWCNHqQbVGXw7zZedkBAlpn3pDRjjt24yOqdhk4gTxibifKZKoc3mXsL lGu0aXC6mTAfXExWmTu8/Rj+RZPoIJ9L5raLiCf0DJwtEOdOxemYBd3P9JAHj4bfxhUd 2iVrcFRo5VNTX5jjN8sQi2UwjVHTOIFIJhlHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Qt04A9wIIazbIkHDi3+Y/LS/dsznOLSuSW+zSaxatrw1MEY1IBFqnmK42/TA6FrjFV 1pBbdtShp0f/EyZHxZtaPL2Y0WMg46KOwLWDdGekMFfOmWsKv6l4xMThtr5HoQXYl8bO 3VKamUeOFU/jRkD1Waq8EL8jT9U9yJRi/XsQE= MIME-Version: 1.0 Received: by 10.204.152.27 with SMTP id e27mr6981226bkw.192.1256764299516; Wed, 28 Oct 2009 14:11:39 -0700 (PDT) In-Reply-To: References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> Date: Wed, 28 Oct 2009 16:11:39 -0500 X-Google-Sender-Auth: a488b82f04dc51e2 Message-ID: <5ba75e2f0910281411j7bf7db25tacf9e06d74c5784@mail.gmail.com> Subject: Re: confused about mod_lua, mod_python, mod_php From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175d03a6a39a2c0477053d39 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d03a6a39a2c0477053d39 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Just another comparison. The application I'm migrating weights 6MB in PHP, but 1.5-3MB in Lua, I'm wondering why Lua does such variation on every run, but PHP keeps the mem usage exactly the same on every run. Blessings! On Wed, Oct 28, 2009 at 11:36 AM, Jacques Chester wr= ote: > > On 28/10/2009, at 10:45 PM, Fernando P. Garc=C3=ADa wrote: > > +1, I'm using mod_fcgid for both Lua and PHP, performance is great! >> > > It's funny how doing this throws Lua's benefits into > sharp relief. Each copy of PHP on my servers chews ~ > between 15Mb and 33Mb. Each copy of Lua is less than > 300kb, from memory. That's a memory usage ratio of > between ~50:1 and ~100:1. > > I published some microbenchmarks on the Kepler mailing > list a while back; and as I recall one of the interesting > facts was that you could run so many instances of Lua in > the same memory space that the key bottleneck ceased to > be waiting on FCGI children. It became waiting on disk. > > Sometimes I wonder if part of Lua's excellent performance > is simply because the entire VM and code can usually fit > into a modern CPU's caches. > > Cheers, > > JC. > > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175d03a6a39a2c0477053d39 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Just another comparison. The application I'm migrating weights 6MB in P= HP, but 1.5-3MB in Lua, I'm wondering why Lua does such variation on ev= ery run, but PHP keeps the mem usage exactly the same on every run.

Blessings!

On Wed, Oct 28, 2009 at 11:36 = AM, Jacques Chester <jacques@chester.id.au> wrote:

On 28/10/2009, at 10:45 PM, Fernando P. Garc=C3=ADa wrote:

+1, I'm using mod_fcgid for both Lua and PHP, performance is great!

It's funny how doing this throws Lua's benefits into
sharp relief. Each copy of PHP on my servers chews ~
between 15Mb and 33Mb. Each copy of Lua is less than
300kb, from memory. That's a memory usage ratio of
between ~50:1 and ~100:1.

I published some microbenchmarks on the Kepler mailing
list a while back; and as I recall one of the interesting
facts was that you could run so many instances of Lua in
the same memory space that the key bottleneck ceased to
be waiting on FCGI children. It became waiting on disk.

Sometimes I wonder if part of Lua's excellent performance
is simply because the entire VM and code can usually fit
into a modern CPU's caches.

Cheers,

JC.




--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175d03a6a39a2c0477053d39-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 19:21:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SLLI72021696; Wed, 28 Oct 2009 19:21:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51ADB192D9; Wed, 28 Oct 2009 19:20:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15232191D9 for ; Wed, 28 Oct 2009 19:19:58 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2AAA5BA4C1 for ; Wed, 28 Oct 2009 17:20:50 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 28 Oct 2009 17:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=7nUEthj7nTdXkx5KDhZDZHx1+Ls=; b=TovXDEmdsRYg5CjAj8Q/erMHcaFtXOMkTUD1zGDKEwxtu4RPYaKUbUbGYCKBxT8S0bwVIchI6QNlQowcxKLFlT9fW9IlAsHI+GvLUHtG9cmr3LpxKqi0M0OoZXswx4qhaqDVmT4WWdS5i0jK4NoV3EPmrN32/Nx+ImvRHduYXGY= X-Sasl-enc: Eu1tFK79fkPLNRmEbE8VcGyiWPbIv3uAAiS1fiLICuLu 1256764849 Received: from [10.1.1.3] (222-152-73-237.jetstream.xtra.co.nz [222.152.73.237]) by mail.messagingengine.com (Postfix) with ESMTPSA id EB75A49AD3D for ; Wed, 28 Oct 2009 17:20:48 -0400 (EDT) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: confused about mod_lua, mod_python, mod_php From: Geoff Leyland In-Reply-To: <5ba75e2f0910281411j7bf7db25tacf9e06d74c5784@mail.gmail.com> Date: Thu, 29 Oct 2009 10:20:14 +1300 Message-Id: <47258EF4-43CB-43D9-991D-5B894898796E@fastmail.fm> References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> <5ba75e2f0910281411j7bf7db25tacf9e06d74c5784@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9SLLI72021696 On 29/10/2009, at 10:11 AM, Fernando P. García wrote: > Just another comparison. The application I'm migrating weights 6MB > in PHP, but 1.5-3MB in Lua, I'm wondering why Lua does such > variation on every run, but PHP keeps the mem usage exactly the same > on every run. Could it be GC vs reference counting? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 19:29:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9SLTojP022702; Wed, 28 Oct 2009 19:29:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D2DD192C6; Wed, 28 Oct 2009 19:28:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A24AF1929F for ; Wed, 28 Oct 2009 19:28:26 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 56FF9BDB27 for ; Wed, 28 Oct 2009 17:29:19 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 28 Oct 2009 17:29:19 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:mime-version:content-type:subject:date:in-reply-to:to:references:message-id; s=smtpout; bh=QR6HNfb0KC4WckrY+rdD8ezJ+wo=; b=QB/41DIACnK4Qr9SsQ0iu55JedaPhMxKPB4xqF+ty7Hmipb0vEMqWyyih/yb0mhJD2B381g7SqSJ9YIuu43qW/Aszlwx13DEC62y75DUXKKDIynAfmoaBO4vt04ECQrSIrzw07bYaUzUh/9zRHaBE5lWksQz4uG6YHIB9SpZQak= X-Sasl-enc: /GK4qYmLvFB1YQgYPthCrNTrDTfwqWpKgQ32fMWawe6S 1256765358 Received: from [10.1.1.3] (222-152-73-237.jetstream.xtra.co.nz [222.152.73.237]) by mail.messagingengine.com (Postfix) with ESMTPSA id E23A549AD4E for ; Wed, 28 Oct 2009 17:29:17 -0400 (EDT) From: Geoff Leyland Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: multipart/mixed; boundary=Apple-Mail-27--714749119 Subject: Re: [ANN] LuaRocks 2.0.1 Date: Thu, 29 Oct 2009 10:28:44 +1300 In-Reply-To: <5e7d91620910281407m22086da1jb94924a8419614f6@mail.gmail.com> To: Lua list References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <8C2773F6-FC5D-45E9-BD8E-D77F9A6C696C@fastmail.fm> <5e7d91620910281407m22086da1jb94924a8419614f6@mail.gmail.com> Message-Id: X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-27--714749119 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes On 29/10/2009, at 10:07 AM, Hisham wrote: > On Wed, Oct 28, 2009 at 6:26 PM, Geoff Leyland wrote: >> By the way, I've made a number of minor changes to luacov (to handle >> os.exit, wraps coroutine.create and coroutine.wrap). Are you >> interested in >> seeing them? > > Sure, send them in. I'm not using/maintaining LuaCov much these days, > so it's nice to see it alive. :) I use it fairly regularly. I hope some of these changes are useful! Cheers, Geoff --Apple-Mail-27--714749119 Content-Disposition: attachment; filename=luacov.tgz Content-Type: application/octet-stream; name="luacov.tgz" Content-Transfer-Encoding: base64 H4sIANu26EoAA+1azW8buRWXsgmaqpdctuilADOJUCmRJ6MvG/XWu+42e9tugTgFCrhedTyipIFH M9r5sJMaLoICLVD02EsL7H+w/0CB3nrvpecei/4VPfSRfJwhR18OVlY2DX+AzdHw8fGRfO/NeySD zPWi8yeVm4TjOHv9PuHlriidTk+UCNJud/Y67W633e4Sp93p73UqpH+jUiGyJHVjEGVMo9FoBR2Q razHceTlW4JArL89sJ8eDY7SKKab7wPmY7fXW77+7U6ntP693m6/QpzNizKPd3z9K3e++63KrUrl p65HfnZEfkEQ7F3l2/DXgT8Cf+z3M7Xh4dZFNdg8pP3fnPWvs/92z3F6Zfvv9HvG/reE6sfZsF2p 3IPHuxVRVuqLSe/i3xxuqfyQh4GBgYGBgcE3G1VR3P3OmxXDwMDgGwjmHwiWh1i+EmUV629heVtp cw9LguUhlq9EWUW6W1jexvIulvewJFgeYvlKlOi0qph8VLHnKmYoVcxCqgTLw9casoHBO4P3RHGP ff8/qSzN/w0MDP6PUb399Ojpx5U8IZgngL9fKc+vKsuDgFtis/B7SluC5SGWr0RpAgEDAwODbQPP /0798ObugLzW/Q9nlzhQ9nrm/sc2gOsf3OQ1oNda/94eO/91zP2f7SC//yMebCg23se6+z+dvWL9 nS47/+87Ttec/28F17n/8/uKiOz/ej2WP37+/FnlT/+4whZ/rmDcr6BavH/fi6b21PXiaOqmNLE9 N6Zp5cWXX/3nWeW3//7vl//814/uHN9578z56AfdJ+///as7lT/+5e73NzJ2A93/34j1r7X/rjNn /73+7p6x/22gNo2GWUAbltAAq0VmrnfmjqmdUOoGQbNWCyLPDQiMP03IAYnpF5kf5w1s/t4CsqGb ulDPf9tB5A4H/LEBVfxh5Ac0r2eTnhYEqe+dQZ3smrWmw2PZBau1TmpeGgONIwUaZaGX+lFIonAQ +CFtDFqElYMwbtbAg/kjwtmmExrWhFMTHNj/x6SN74CMvz4gbVg2hTind4oXKLx7TlF2NugWycfX RFIaDmtYsFIIHLpTNgFDepqN7TFN/XAUNTotYh1ZTTuJstijKDej3Adv6E0a1ueHVlMVC7lwkiQ7 bXRknzgrYpaZXMeM5qQYZhilolofJLa4vNJfgUt+oQ++4AnvGYk+WNEJrgD5sGAy3x3yRto5NmIk XhbHNEyxr2MkLo1HEs33kTcABnKtaZDQ5VSSV6EbyjLypRSCCa2EZ6ayUWKn0xmbFabHqk7SF37a 4IsDNDGdRue0UTTlFddSJ2kw0QyJlGouFU6FpuzY/yCNhWX5kR3NaKgIAHp3YfEOhEImNJ1S4Oye gjfQmrfIJRkMxh4brXhPrgj2nbedRNFZAy0RWAfMI8TuhRfFUQaaTr2YwtedzbJ8Y4tXyqSVqxq2 bTMJUR8i5n3mWEoiXRIvahFdGgKeK81i1osQfUG3F7E7u5lOZWdCIZA5cy6XSvcxTTLQIy9qEmGM uLLxcftE1XAax1HciI87J4KbtBzsKwuZH23ELcJ9Q669qL4wGr6GXHfZk6K14oUcnarE2EpUAbs3 /d0y2Az0/N8e4Od7o3Hg+vyvq+T/DsR/u+2eyf+2g+vkf3+oiPzvb9djifnf77AFy/MelEiqxfvF +d8l92heFGTTEFxVp/+BcJzgJ+Fn1/mgdrWhCXi3odv/TVj/Wvvv9Hv9kv3397odY//bQCn/w3Ru dRaIGYPWxIYYxlKCKi0BzCMeEd9OoyQdTHyeTl5etUSOoWeZMl7N+4OAKrZkXseCIkHJoiIZ9/AE FGOhiwlPdOKMkmGkpRUhcyGJTET3IZwbNqxHodXUEwsk4/xPgehsLj9JzvyZzqat8OC1v4FJ2rdW MWFDw4xOkycoy5MTLmTGUzNJcqJmc3oNJl5icEgximLisySpJQedz1guJi7WkikrpOR0CyW8zrSV Zo4smTlBxrv6kJRT9rkhH/tsPhi1RqTqIHx3JmxmGvnLFm+gyFX0ruSEBJOzfS+IEir0XNFFRdFL GYe++1G0WqT1LEkrt9ZTwea8IKUGCxNMpRkY+VnDgjRGLCnTCDl/Lf7ETcsPwSv4sWDSLNuV0CxJ zKYTq0UXF7EPaZNa3WK20VI6sn5ZqJSilIzxUo2UDGGVlyujtvDY0Fm0tiVphSaAHpa2dUpkudya ToyCLJngUrxpJ78C+vef7SFsfhN4Xfzf7fZL53/9ftcx3/9toLazs0M+hY81bmuRLPHDMZiNnzA7 ehll5MINU+KnJI3IjMZ+NPTBAIOXBJpy18JsDD/HfHOPPOeNE2BFR1mAbGKSeLE/A04Ja+iCi6RT cE4NH0x/GMFnh9nsLAYHGAPzlMZTP4SEwG6WQxS+HbwgQintTINNvunJfQug3P+QZ8Ab72Pd+b+S /3f2+uL8t9029r8V3Fz+/7Kywfy/o+X/P9w1+f9moNj/DVn/WvsHu2+X7L/X3zP7f1vBg/tPsiTm 60/DcxYE6Mdcq058l+X08jKBdgaMQTnPJGRQPov9MG1YP4myYMhrWRMllCCWbaud8vDCtmwRbmPr Z1ko4otPM5fFD+PYnZILP52QnQDH4IZDuVMQAzWytOThHD/YaDfVM76YzqI4VTYi5OBFBd/twOSM RTNRCCELtoGYhsmZkGRGPX/k0yF7xWIkcHRTJgpzYtjPzE0h0gnFTkhNyXoeuPEY0x5JIzJZeM+S HUVWlj0pDIqEarA4ZcOVyNnqh0v8AND2w4TGaYOzLnI0keUUh6j5GCaYivFT6TE7lraesPmBOcaf dbaQD9m7PJsSrf3QC7Ihc+ojt+DMBjKAGI+NwBdDkPI2tWwQBsP6x9PyWXM+4Ss6YNtBWhXfWViR 5Av+koHOee08kfnzY9EmiWSL3IZy6xkAgzGfTpiyIcweTAQMrdiZaO4DBdiTaEens/TlQNDwNpCr 7oMeNsoMH7dlEz7Lg5CO3dQ/p2rb+/U6qQ8XdYpMJItf0zhSGz5a0mkTbNWxavIkNQtTtdW63pjI cpgvYAUSP2J2UuORwaUYB6jT5w/uW+SqxecbLPHnof+CTNxksnPqQh4zdce+JwyOt2IqwHRQtsBW n7B5nCeDRWt9JGmB7AhSI+aV4L2lE4IsqhQ5IXuvUcI8UTdFWoUS32u0w0iRU6GF9xodn6R68vi4 fjFo1ZOTx7wZNBA15NyNwaPYtt1ij5+taVxPHh2sZkAOFrOQG07Aod6Q/B7VmyVu+Vk4uDLJFh4/ a67jymUEhtdjT0ZkQQ9Xc9eHuHIN6bDBlj/f/wLnQxXnU2ig4n7AN9CS9yT5JZj8/g6IC58xetw5 AXOAHw+tJoEOVtLUd+o7eO1H7g3yvWzFQ2lXWfQ+GZ/VjbU9THlFgbtfsXMoJiDfcy7mQbgtnIJi Cxvvfuk7rzqJ8i1VtvyKPf3yzSTxNS1vsc1VHGwUy7pZvEm5JUkwHMOLVcVtplN2jWfAggoapqCu X2SwgvI7ypwc0i06C9HY4sd7/uyB5MECJ1u9sc86GCA76UkFypQhvRhowpc+/kW3OtXcpx2HoIxd s6qG/ajJLKl+3DiAp2N1XGg08zxJnmQG5feL5J6LKbSZ0a20kLgkaf2EWT8fA7P/Eyb4w68r7ZoZ FqLmz0u2w9dtu+fX58BjONry6d1Dte5nF8Rpq850SNkgF0UxMpLgcZI+e3MLUWaoRlLN11hQKfXB wXXEViKnpkr0erKqodSqMWuCqz9KvpWlMrn16i5OjHBe8YUrWGALJc+QOy35tPRy5ZtOhA0MDAwM DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDN5i/A9jAuYwAHgAAA== --Apple-Mail-27--714749119 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed --Apple-Mail-27--714749119-- From lua-bounces@bazar2.conectiva.com.br Wed Oct 28 23:40:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T1eBpB017309; Wed, 28 Oct 2009 23:40:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E726119183; Wed, 28 Oct 2009 23:38:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E727719131 for ; Wed, 28 Oct 2009 23:38:41 -0200 (BRST) Received: by pzk34 with SMTP id 34so1018488pzk.11 for ; Wed, 28 Oct 2009 18:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=70BV9wea/MWBw50eVeOySWrOE1eYSM/Hfnjuz+q6nJ0=; b=iqv5OkUzlw7I5jgRBaUuMXUOMdx3MHgiOZWw3qIdY0pRvQ9GLzTR8KCcS/2TQBIf86 zyX15cGDn6G28v2j7PD7vjr+w2RY8VihQgWPvtOr0jew/+HfDaYwzSlCNqaZWvPz6KTr ILRF5FBOIlMbXl2PrGuf93bDN+q8B4i6Sp7Gw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=LdfS5lrYzgiSA3yOOn5ZBHZOCcqEqjnlo50SrODeWHxFk+SUTHNmHPdHabbXrR4uS9 ZaCY9AnC3kgK7+ken9fPC7dNHcHpJsLswaV5NUmF3ZQ8R+mwFFeRenJE7s8B1A5zM7zh aYNqFPKkN/gk9yR0SnyQNaIXzh6cD45mwQAqM= MIME-Version: 1.0 Received: by 10.142.202.9 with SMTP id z9mr1551351wff.34.1256780373112; Wed, 28 Oct 2009 18:39:33 -0700 (PDT) Date: Thu, 29 Oct 2009 09:39:33 +0800 X-Google-Sender-Auth: 8eca734dd12a91d9 Message-ID: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> Subject: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In LuaJIT roadmap 2008: - The explicit frame stack (CallInfo) is gone. The frame structure is implicitly stored in the regular Lua stack (tagged values). This speeds up call handling substantially and also simplifies the compiler (uniform treatment of slots and frames). I cannot figure out the details about it, May anyone explain it in details? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 02:24:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T4OiRA001348; Thu, 29 Oct 2009 02:24:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0998C1912F; Thu, 29 Oct 2009 02:23:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out1.iinet.net.au (outbound.icp-qv1-irony-out1.iinet.net.au [203.59.1.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 869A3190D1 for ; Thu, 29 Oct 2009 02:23:16 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEADe26Ep8qQKd/2dsb2JhbACEcowwuUiQd4EygjpTBIFhcQ X-IronPort-AV: E=Sophos;i="4.44,643,1249228800"; d="scan'208";a="596247635" Received: from unknown (HELO Mania) ([124.169.2.157]) by outbound.icp-qv1-irony-out1.iinet.net.au with SMTP; 29 Oct 2009 12:24:05 +0800 Message-ID: From: "Alex Davies" To: "Lua list" References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> In-Reply-To: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question Date: Thu, 29 Oct 2009 12:23:45 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I believe it means that the call info, ie saved instruction pointer, function base/top (to allow call stack traversal), number of tail calls, etc are all stored as implicit, hidden local variables. A simple method would be to store them as basic Lua types, light userdata and numbers, but I imagine Mike Pall's method would make significant optimizations. For instance the state and number of tail calls could be stored together in a number, likewise the base and top could be stored as offsets rather full addresses which may also allow them to be combined into one number. Or the struct could be stored as binary data across multiple stack positions, with each tag being set to some Internal value. Does away with the second stack Lua maintains, which can only be a good thing imo. I wonder if Mike would like to reveal more ;). - Alex ----- Original Message ----- From: "tankxx" To: "Lua list" Sent: Thursday, October 29, 2009 9:39 AM Subject: LuaJIT roadmap 2008 question > In LuaJIT roadmap 2008: > > - The explicit frame stack (CallInfo) is gone. The frame > structure is implicitly stored in the regular Lua stack (tagged > values). This speeds up call handling substantially and also > simplifies the compiler (uniform treatment of slots and frames). > > > I cannot figure out the details about it, May anyone explain it in > details? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 02:35:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T4ZnGN002670; Thu, 29 Oct 2009 02:35:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A36B1935D; Thu, 29 Oct 2009 02:34:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEA7B19331 for ; Thu, 29 Oct 2009 02:34:26 -0200 (BRST) Received: by pwj9 with SMTP id 9so1205889pwj.21 for ; Wed, 28 Oct 2009 21:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=/xx1S978YNMI0gNwzSbMatvpSdfVfY5FVjbb3nja6Zw=; b=QM0SJMRVUEeUemHOZcm5eYYYw3ry3EFlgcTeM/9Jb5fBg5itU21Bb8DfISfCEjnB5H e20IfpXJeGyNLtvM4LYGQTQYG2FYU6vXvwCtiUTQ33IP2ohhxZFJdzwKRbxl6amxT9RF 9J95VVvdT82U39aQL2EG/THmbXhrhS39Gb8qA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=K7kCzAcF6dZBdFsFUBa6XC5KFY/kXycZiN4bMMXdMZdtLp0k6UG+7H4A3e1Fhp4t3w thbsLWAKSJiLF2IpDh9FKbEPzVSITQu7/IpWOTpmw9r7kouqVUG1nbP+y64CZbMgsT14 tXISlmfIkPi9z+ON2eUxcbzE4TbhfreaeYTEU= MIME-Version: 1.0 Received: by 10.142.5.25 with SMTP id 25mr1449799wfe.80.1256790919528; Wed, 28 Oct 2009 21:35:19 -0700 (PDT) In-Reply-To: References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> Date: Thu, 29 Oct 2009 12:35:19 +0800 X-Google-Sender-Auth: 4d9faba36a6ba31d Message-ID: <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I cannot figure out why this speeds up call handling substantially. May it reduce cache misses? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 03:06:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T55wxk005463; Thu, 29 Oct 2009 03:05:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B0881A5DE; Thu, 29 Oct 2009 03:04:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1BEFF19182 for ; Thu, 29 Oct 2009 03:04:35 -0200 (BRST) Received: from Stucomet (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0Lg28h-1MNyi926iB-00p3Qb; Thu, 29 Oct 2009 01:05:26 -0400 Message-ID: <3D7B3F2F958E447DB64347D220E4E8F7@Stucomet> From: "Stuart P. Bentley" To: "Lua list" References: In-Reply-To: Subject: Re: Lua Programming Gems Kepler error Date: Wed, 28 Oct 2009 22:05:17 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX18SP2IOUxkdqYnQU4Fanqk8Ry1mAjqmAvU/lwx eXi+9jN0EEjinZOhqsHEaB7WS5nOBTKz1n7Brcnp/z2mQl/ONJ WaQTOUT08MjbVU9tG+EUSEDvC6wFrBw X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Does anybody know why the book's examples won't run? This error appeared in my browser when I entered the URL it said to go to. -------------------------------------------------- From: "Stuart P.Bentley" Sent: Friday, October 16, 2009 A2:40 Newsgroups: gmane.comp.lang.lua.general To: Subject: Lua Programming Gems Kepler error > After doing exactly as the book/pdf/readme file said, I get this error: > > C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:438: > c:\LuaRocks\kepler/htdocs/gem: No such file or directory > stack traceback: > [C]: in function 'error' > C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:438: in function > (tail call): ? > app.lua:36: in main chunk > stack traceback: > C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:161: in function 'err' > ...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in function > <...:\LuaRocks/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:22> > (tail call): ? > (tail call): ? > C:\LuaRocks/rocks//cgilua/5.1.3-1/lua/cgilua.lua:169: in function > (tail call): ? > (tail call): ? > (tail call): ? > > From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 03:33:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T5X6Vw008182; Thu, 29 Oct 2009 03:33:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67A681A664; Thu, 29 Oct 2009 03:31:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B7BC1A65E for ; Thu, 29 Oct 2009 03:31:44 -0200 (BRST) Received: by bwz27 with SMTP id 27so1870245bwz.21 for ; Wed, 28 Oct 2009 22:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type; bh=5P9zpjHbfBVRXAbQWJvsgS5IytPdyC1oaKoph5WH4Qw=; b=xGjN1UnSKUxS9egJlFLHHVMuNa5bkzcEVa34IwlNEO1vMtoCOT2PCPqdoX42l8HV32 1sqyBK15soS0fnfoPY3L1ikp26NgFcIa1VvjvKv9mM6MXQvzmOSEDCHiv1bNXR3AKgeE pgD2wWOF4mB8Oquy0V/OL1Vof9mcnNQ12ov/0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; b=YJ/xUxxVQoTfP2h+O7Pc86pKQyrIPfgJQn06iwBbJ4keiB+GZmOi+6y3Bc3L62TKJU kp5kjd5yPoL6DJN4Hh9loJv2UezCQhvOwjCzLEAd2ORB1a2mb1i52O3mAn7qRSDEqOOE rek+Q4fYY04LckGwCceVvmbcFCpzGMyKoG7SM= MIME-Version: 1.0 Received: by 10.204.32.1 with SMTP id a1mr7070142bkd.191.1256794357117; Wed, 28 Oct 2009 22:32:37 -0700 (PDT) Date: Thu, 29 Oct 2009 00:32:37 -0500 Message-ID: <5ba75e2f0910282232l481ecf0cxa391a0b66ac9d3dc@mail.gmail.com> Subject: Does Luaforge CVS is down? From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=00032555666e36343404770c3def X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00032555666e36343404770c3def Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Got following error with cvs export: cvs_direct initialized to CVSROOT /cvsroot/cgilua > cvs rlog: Logging cgilua > cvs rlog: failed to create lock directory for `/cvsroot/cgilua/cgilua' > (/var/lib/gforge/chroot/cvsroot/cvs-locks/cgilua/cgilua/#cvs.lock): > Permission denied > cvs rlog: failed to obtain dir lock in repository `/cvsroot/cgilua/cgilua= ' > cvs [rlog aborted]: read lock failed - giving up > Blessings! --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --00032555666e36343404770c3def Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Got following error with cvs export:

cvs_direct initialized to CVSROOT /cvsroot/cgilu= a
cvs rlog: Logging cgilua
cvs rlog: failed to create lock directory for `= /cvsroot/cgilua/cgilua' (/var/lib/gforge/chroot/cvsroot/cvs-locks/cgilu= a/cgilua/#cvs.lock): Permission denied
cvs rlog: failed to obtain dir lo= ck in repository `/cvsroot/cgilua/cgilua'
cvs [rlog aborted]: read lock failed - giving up

Blessi= ngs!

--
Fernando P. Garc=C3=ADa, http://www.develcuy.com
Developer - Analista de S= istemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA
** Antes de imprimir este mensaje piensa en tu compromiso con el medio amb= iente, protegerlo depende de t=C3=AD.
--00032555666e36343404770c3def-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 04:09:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T69gUL012274; Thu, 29 Oct 2009 04:09:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A740192C7; Thu, 29 Oct 2009 04:08:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5139B19092 for ; Thu, 29 Oct 2009 04:08:15 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAOPN6Ep8qQKd/2dsb2JhbACEcowwuT+QeoEygjpTBIFhcQ X-IronPort-AV: E=Sophos;i="4.44,644,1249228800"; d="scan'208";a="516282481" Received: from unknown (HELO Mania) ([124.169.2.157]) by outbound.icp-qv1-irony-out3.iinet.net.au with SMTP; 29 Oct 2009 14:09:03 +0800 Message-ID: <08EFC144CF6F42058449D214CA2BC57B@Mania> From: "Alex Davies" To: "Lua list" References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> In-Reply-To: <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question Date: Thu, 29 Oct 2009 14:08:43 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Perhaps. There's at least one other advantage - in a register poor architecture like x86, it allows a function to have full access to its callinfo without reserving a second register to point to the CallInfo stack (assuming a register is already reserved for the TValue stack, which makes sense). And even on architectures with more registers they then have to worry then about keeping them valid through growths/shrinks. It would also allow just one bounds test on entering a function, vs the current two. In Jit every instruction counts... something as minor as that will show up on recursion tests. Definitely looking forward to playing around with it when it comes out ;) - Alex ----- Original Message ----- From: "tankxx" To: "Lua list" Sent: Thursday, October 29, 2009 12:35 PM Subject: Re: LuaJIT roadmap 2008 question >I cannot figure out why this speeds up call handling substantially. > May it reduce cache misses? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 04:35:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T6ZX8u014677; Thu, 29 Oct 2009 04:35:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3482F1937E; Thu, 29 Oct 2009 04:34:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04AB51935D for ; Thu, 29 Oct 2009 04:34:07 -0200 (BRST) Received: by pzk34 with SMTP id 34so1147872pzk.11 for ; Wed, 28 Oct 2009 23:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=29J3BxPHi5zJ592StZ5fzBvgli4w/dBYCJ9iZkkvba4=; b=f6qpyFBgTaJqmzeh4PImnxsl1zyx52KJ5nNGeKXWHgSBuS+7Osk5lMaN6RAcZMANTH Be3hdbk1aXaqpClUrWN2DxQHcU5CqFTR8WUATbRkyg+aD/93dp6vYTNhnJsCk9YE+TAO oiXWJEDgK7IFgg3OWJRDcndg9JeYOwMXo0ETU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tVhC7+IjlmViqd7qsPfIkb1vVwQ2MVSJH+g1GbidXZK+L40bIBIDl5qyS0duX3054z FkCgHjWoMFs1fUzODjbSy+d1P0xaD2dBrk1yCCHynMNGQVp4PLqVVrNye644roqObZ/D K9LbYlybUo3GkKsiZ77PvJtk73vs+tiHVWMRg= MIME-Version: 1.0 Received: by 10.140.201.3 with SMTP id y3mr2168974rvf.288.1256798101215; Wed, 28 Oct 2009 23:35:01 -0700 (PDT) In-Reply-To: <4AE81D13.4040702@duboucher.eu> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> <4AE81D13.4040702@duboucher.eu> Date: Thu, 29 Oct 2009 09:35:01 +0300 Message-ID: Subject: Re: [ANN] LuaRocks 2.0.1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >>>>> I'm happy to announce LuaRocks 2.0.1, a bugfix release: >>>> Everything looks great and all, but can you see about getting it into >>>> the Ubuntu repos? >>>> The latest version on 'universe' is 0.6... >>> I'm not the maintainer for any distro packages of LuaRocks. My advice >>> would be to get in contact with the downstream maintainer for your >>> favorite distro and ask them to update. :) >> For debian and ubuntu, the way to do this would be to report a bug >> against the out-of-date package. > Well, Ubuntu Karmic Koala will go live tomorrow with LuaRocks 1.0.1 ... :/ I'm not related to the current maintainers in any way. My company is planning to create a debian package for LuaRocks for our own needs and to maintain it in our public apt repository (sorry, no links yet). We do not currently plan to submit the package for inclusion to the official Ubuntu / Debian repos, but anyone would be able to use our repo. We plan to keep packages there up-to date. As we're doing it for our own setup, there is a chance we miss something we do not use, but that is important for others. If anyone have their suggestions on how this package should be set up, please say so. Also, I remember seeing the post, where it was explained why current Lua package is patched to place its .so files in the manner it does. Does anyone still have a link? I understand that it is due to the packaging rules, but I vaguely remember there was even more practical reason for that. Alexander. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 04:56:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T6uGim016494; Thu, 29 Oct 2009 04:56:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B35C3193C1; Thu, 29 Oct 2009 04:54:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EED7193B9 for ; Thu, 29 Oct 2009 04:54:44 -0200 (BRST) Received: by bwz27 with SMTP id 27so1910534bwz.21 for ; Wed, 28 Oct 2009 23:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8o2CAiuADYyR8o8jemQ8TnhIbGLToUxJD4wRa4wZ38Q=; b=Rq18MOqrxxhzanLkTiCJLyZ/6AgkByNvtUQ4XiMsE3ZAIXl2U2Pl68jogYRbPygDdq FIkfqOdt/XHu74111nHBKLE2pvJ9TZzzWBQsOmwH9SI7PNj8aHvX9vvjz+kvMSvk/kD4 fAmrTTaltlmT1jHoMT+gXIgmxoh4FSIcPV1bc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=MMLokUx3pojNz2JO0eZc+OY1bSb9jyhK0uLYoH6MsYB9RLF9U+VpGtQC+zrbWMObNm ZspEz7s0kL972oV8b1sj+cvWQnBcJLH9wz5KOMweu2w38kIXw2/gYEyMBKryymQ8RV0k Izx6DlQGIKc4fPCFu41WOF21AEmjtmC4T/aIo= MIME-Version: 1.0 Received: by 10.239.237.77 with SMTP id i13mr1736192hbp.198.1256799337096; Wed, 28 Oct 2009 23:55:37 -0700 (PDT) Date: Thu, 29 Oct 2009 03:55:37 -0300 Message-ID: <7fed67710910282355h1cf40270x7d47464fd20af05d@mail.gmail.com> Subject: bug in 'parser' module, unable to find table.permute function From: dprotti To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Trying to use the 'parser' module in Lua 5.1.4.30 under Windows XP, from the following program: ==================================================================== require 'parser' function prod1_action (tree, token, pos) return {} end --prod1 = { "1", prod1_action } prod1 = { "1" } -- dummy, hardcoded, just for test number = { prod1 } grammar = { { "number", number} } grammar.lexemes = {} p = parser.Parser { grammar } token1 = { ty = "NUMBER", tok = "1" } dummy_program_tokens = { token1 } function main () result = p:parse ("NUMBER", dummy_program_tokens) end main() ==================================================================== I'm not completely sure if the program is making a correct use of the API, since the documentation does not provide an example and I was unable to find one on Internet. However, I have found a bug in the parser module itself: 1- Trying to run the above program, it gives an error in the 'parser' module stating that there is no table.permute() function definition. Googling a little, it seems that this function was available for tables in a previous version of Lua (https://opensvn.csie.org/traccgi/Ace/browser/trunk/stdlib/modules/std.table.lua?rev=283) 2- When I fix the parser module declaring the permute function described above as a local function in 'parser', the module parsing is ok but now my program gives another cryptical error. But may be this is due to a bad understanding of the module API from my part . However, I won't to go deeper with this since I'm not sure if this module is currently maintained and if the permute() function I have added is the originally expected by the module. My main concern is - Is this 'parser' module an unmaintained or deprecated module? - If this is not the case, where can I find an example of code using this module? Thanks, Duilio Protti. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 05:07:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9T77FoF017490; Thu, 29 Oct 2009 05:07:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28194193DB; Thu, 29 Oct 2009 05:06:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93868193CF for ; Thu, 29 Oct 2009 05:05:57 -0200 (BRST) Received: by bwz27 with SMTP id 27so1917154bwz.21 for ; Thu, 29 Oct 2009 00:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0qMvhL+WVNs8PALdp8WALw+fGONk0+ntXgTYUWWptrg=; b=FxHG9T1DvAI0Whpm8Q2qU6qQ1OtC2ghHTOZF768e/YlbbZhWZXqzQzr60ECS8ssya2 EA4pspr9owDVGu811MeJ48o0DptUcRByzxO9HZ+UwcuRlH6lJ8ppa3hRCT6Do82AmehH TS50bjDcWuiEtYFfPjbuWzxC7IOG2BH9ObO/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=cCqs2TlN/Whs3ORmfhSYzhhUzy4HyM7m1OyDJrvw2Z4zRTCxwA5w2Ec3Kjzm2lT4K/ B4gSQqlx/kGLyvf3shDmKa6oOY12tRupYe/fY6JVg3Cvg4OLbmrEdq+R+/G1ajBf5Dox v0ViVQr/T05LCvrPfLJF4od8eh/5LrB0cazEg= MIME-Version: 1.0 Received: by 10.239.143.227 with SMTP id l35mr1609827hba.164.1256800008808; Thu, 29 Oct 2009 00:06:48 -0700 (PDT) In-Reply-To: <7fed67710910282355h1cf40270x7d47464fd20af05d@mail.gmail.com> References: <7fed67710910282355h1cf40270x7d47464fd20af05d@mail.gmail.com> Date: Thu, 29 Oct 2009 09:06:48 +0200 Message-ID: <560972290910290006jfaa2c89we8b8ead1c481ca31@mail.gmail.com> Subject: Re: bug in 'parser' module, unable to find table.permute function From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 8:55 AM, dprotti wrote: > My main concern is > - Is this 'parser' module an unmaintained or deprecated module? It is not in standard Lua 5.1.4 > - If this is not the case, where can I find an example of code using > this module? You could go back to the source link and see if there's anything... From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 09:41:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TBfBZd016191; Thu, 29 Oct 2009 09:41:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69CE21938F; Thu, 29 Oct 2009 09:39:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from web94303.mail.in2.yahoo.com (web94303.mail.in2.yahoo.com [203.104.16.213]) by bazar2.conectiva.com.br (Postfix) with SMTP id C9847192C4 for ; Thu, 29 Oct 2009 09:38:57 -0200 (BRST) Received: (qmail 37032 invoked by uid 60001); 29 Oct 2009 11:39:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1256816387; bh=zB/IbbdDZDh0faFML/7DENkfnAejVQGwLFuDJYZWM7U=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=eGX7Skam01ld1C4u8Q/vaHE1GnzW23fQ4jIrTRpUs7dbQTxVHuKy5RFn3OyVzcB2/dccgxh/NFUIBCIH3PwpBHHYaGb/PFgWtsHyPibhO72kBjnpcTG4QGhpYTJxJOs5EFD+eEr4PxltoPSewxxhShsaSN1khRbZ7M9K5Pj2nBs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=rlaqcEqs2EoKuUtGcPLZ22kwCM4Yhw9dzyuQ07frbLIZM1j3kRnttMDIM2qQsa2624J9yCAbsnx3OABX5ejqpEfJRBYVYF4HY7WbtqbD3YbMoEDSx8DFep3ThmFM3vTo5wJMmHk47PJbByOAgop5uiDfBV/iZO0MH4zJgHcxU0U=; Message-ID: <619490.88131.qm@web94303.mail.in2.yahoo.com> X-YMail-OSG: 2SVn2b0VM1mbEpY71opA9_SYMR9IEnPJsuc.3wGgdrtPASYMHvtyuxskhHFK.0rzsSgoWldGHZfaQw_XFlu5QsMGkYchXltmtGuInj_KoojwwbRi8A4zxUSM0WhUqntPCxhD6YRIrf9gl7giBl6JvFn2uKF5Eco.55iIh_L0NluCBhdfB3zXgIs0hzGb3DJVDByeyfANLfL9XmZVR21iwfsrhUWSOH94BFMbmBgjhL5sQ2LIHeuzxsZ1IkqFXx6IVwznA8_M0OCQWYOP0R3epajGEtza7nG8pI5vnHWBqUwEl6oDJDfWkFWdibUIulbTBlyEFA-- Received: from [122.169.249.37] by web94303.mail.in2.yahoo.com via HTTP; Thu, 29 Oct 2009 17:09:47 IST X-Mailer: YahooMailRC/211.6 YahooMailWebService/0.7.361.4 References: Date: Thu, 29 Oct 2009 17:09:47 +0530 (IST) From: Anil Kumar Subject: How to use libluasqlite.c To: lua@bazar2.conectiva.com.br In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-424788080-1256816387=:88131" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0-424788080-1256816387=:88131 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Friends,=0AI am new to Lua. I have included libluasqlite.c in my project= (MSVC-5). I am trying to use Lua script in C++ code for data retrieval usin= g sqlite3(.h)(.c) files. Aim is to avoid sqlite3.dll. Any guidance for me r= egarding this is highly appreciable.=0A=0AThanks=0AAnil=0A=0A=0A Add w= hatever you love to the Yahoo! India homepage. Try now! http://in.yahoo.com= /trynew --0-424788080-1256816387=:88131 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
= Hi Friends,
I = am new to Lua. I have included libluasqlite.c in my project(MSVC-5). I am t= rying to use Lua script in C++ code for data retrieval using sqlite3(.h)(.c= ) files. Aim is to avoid sqlite3.dll. Any guidance for me regarding this is= highly appreciable.

Thanks
Anil

=0A=0A=0A
=0A
Keep up with people you care about wit= h Yahoo! India Mail. Learn how. --0-424788080-1256816387=:88131-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 10:32:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TCW7kk027377; Thu, 29 Oct 2009 10:32:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28989192B1; Thu, 29 Oct 2009 10:30:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from f63.mail.ru (f63.mail.ru [217.69.128.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F6FB192A1 for ; Thu, 29 Oct 2009 10:30:32 -0200 (BRST) Received: from mail by f63.mail.ru with local id 1N3U9y-0008G9-00 for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 15:31:22 +0300 Received: from [81.25.52.74] by win.mail.ru with HTTP; Thu, 29 Oct 2009 15:31:22 +0300 From: =?koi8-r?Q?=ED=C1=D2=CB_=E7=D5=D2=C5=D7=C9=DE?= To: lua@bazar2.conectiva.com.br Subject: Behaviour of table.remove() Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [81.25.52.74] Date: Thu, 29 Oct 2009 15:31:22 +0300 X-Mru-Data: 3523:0:1:199:70:0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: X-Spam: Not detected X-Mras: Ok X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, everyone! Could somebody explain me the behaviour of table.remove() in the following code: function f(t) print(t[1], t[2]) table.remove(t,1) print(t[1], t[2]) table.remove(t,1) print(t[1], t[2]) end f{1,nil,3} f{1,nil,3,4} The output of f{1,nil,3} is 1 nil nil 3 nil 3 and the output of f{1,nil,3,4} is 1 nil nil 3 3 4 Why does the second call of table.remove() leave nil in t for f{1,nil,3} and remove nil from t for f{1,nil,3,4} ? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 10:55:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TCtYiU002495; Thu, 29 Oct 2009 10:55:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60F8D1934B; Thu, 29 Oct 2009 10:54:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-348.bluehost.com (outbound-mail-348.bluehost.com [66.147.249.9]) by bazar2.conectiva.com.br (Postfix) with SMTP id E2DC2192E0 for ; Thu, 29 Oct 2009 10:54:06 -0200 (BRST) Received: (qmail 31659 invoked by uid 0); 29 Oct 2009 12:54:56 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 29 Oct 2009 12:54:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=za7ZDwGKqz3q4RfjqsOqMIjOtIfHYLdoLlVgekaPpdMBlilTrEcf6AS5WZ8i9Z5fmIPwODfFp+Pdo/hwmwdLARA9OOMcsLtg6VAVdoK0tSITN2Wz0I+u6vkfTJYB49+G; Received: from bas3-unionville55-1279751709.dsl.bell.ca ([76.71.118.29] helo=[192.168.1.4]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N3UWm-0007VJ-2m for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 06:54:56 -0600 Message-ID: <4AE9909C.7060807@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 08:54:52 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: promoting Lua Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.71.118.29 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean As I was saying I am new to Lua and I have not finished with the basics but again I am already in love with it. Once I am competent I would like to start promoting the language and I was wondering what would be best. I thought I could do some screencast tutorials. When I was learning PHP, Python and now C/C++, one of the first things I did/do was search for Python sucks, PHP sucks etc. BTW this also works well with hosting providers to dig up dirt. Lua sucks actually comes up with few results and the complaints are rather silly but still I was thinking about registering luasucks.org or something similar. I was thinking it might be helpful to try to "own" this keyword and displace others on the net. It could be a place to dispel myths about Lua(I.E it's a gaming language) and ways to mediate justifiable complaints. I watch the Tiobe index a lot and it has affected my decisions but I am wondering how valid it is. Even if it is not valid it's probably a force we have to deal with. As of October 2009 Lua is at position 20. Ruby was no where before Rails but I don't believe the language changed so much, people just discovered it once they saw it's usefulness in one application. Now Ruby has momentum and I bet it would still be popular without Rails. It seems like programmers may have a herding instinct and just want to follow the pack. This could work against Lua. It looks like the Delphi community has intentional manipulated Tiobe, please see: http://blog.timbunce.org/2009/05/17/tiobe-index-is-being-gamed/ The call went out to put "Delphi programming on every page in visible text (update the template). Stand up and be counted" and it worked and Tiobe congratulated them for it apparently. Do we need to do the same? Or should we educate people about the dangers of Tiobe's methodology? Doing nothing might not be a good idea. -Patrick From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 10:58:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TCw4VK003497; Thu, 29 Oct 2009 10:58:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 234F21938D; Thu, 29 Oct 2009 10:56:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC08619357 for ; Thu, 29 Oct 2009 10:56:45 -0200 (BRST) Received: by bwz27 with SMTP id 27so2274902bwz.21 for ; Thu, 29 Oct 2009 05:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9vc5u8mFPjw9hslY1b+kIvVeWxf6ffvXx8AftnLrBFg=; b=CqsyMnITcabmUUAdkwqGHN26PyMFSavJ/nX5rHjo9CAgKVxStib2Qi68iIh0d+XwM3 iBGX2iIMxQeaf8FcDVxxmePfgg/RSDyQoeQopWz+NPSsLJyRyYGElmdD+LwMGhnbxTfp UriqO+562NdweBEnpogKJ6F78lULJQUWsQchs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=NXnN3MTqfYCXzTIrCz4pzWLPOMSdIRc7W46kUp0p2f7SF4g/9DpbB0uhVkUmm7bbV8 MeFZO5ova3PHaoVSMnLvTp6FAyas0WrVssfU4H4ZcvJA/pv6uwvkukrUNoSRfVTtIvqt uoQRwl7d3y37z5IazlJWKSTaGp1nbc5gQ+oKc= MIME-Version: 1.0 Received: by 10.223.15.73 with SMTP id j9mr3326853faa.85.1256821056637; Thu, 29 Oct 2009 05:57:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 29 Oct 2009 12:57:36 +0000 Message-ID: Subject: Re: Behaviour of table.remove() From: Duncan Cross To: Lua list Content-Type: text/plain; charset=KOI8-R X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9TCw4VK003497 2009/10/29 íÁÒË çÕÒÅ×ÉÞ : > Hello, everyone! > Could somebody explain me the behaviour of table.remove() in the following code: > > function f(t) > š šprint(t[1], t[2]) > š štable.remove(t,1) > š šprint(t[1], t[2]) > š štable.remove(t,1) > š šprint(t[1], t[2]) > end > f{1,nil,3} > f{1,nil,3,4} > > The output of f{1,nil,3} is > 1 š š š nil > nil š š 3 > nil š š 3 > > and the output of f{1,nil,3,4} is > 1 š š š nil > nil š š 3 > 3 š š š 4 > > Why does the second call of table.remove() leave nil in t for f{1,nil,3} and remove nil from t for f{1,nil,3,4} ? > In Lua, a table is not considered to be "array-like" if it has nils in the middle of it. Features like table.insert(), table.remove(), table.sort() and the # length operator require that the table be "array-like", or they have undefined, inconsistent behaviour. (A common way to get around this is to find some other "placeholder" value instead of nil, such as the boolean value false.) -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 11:25:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TDPIln013649; Thu, 29 Oct 2009 11:25:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D39E919309; Thu, 29 Oct 2009 11:23:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0B1B192DA for ; Thu, 29 Oct 2009 11:23:49 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAI16UpUXebq/2dsb2JhbADdGwqEMwQ Received: from relay07.plus.net (HELO fhw-relay07.plus.net) ([84.93.230.234]) by relay.pcl-ipout01.plus.net with ESMTP; 29 Oct 2009 13:24:31 +0000 Received: from [80.229.242.93] (helo=iyonix) by fhw-relay07.plus.net with esmtp (Exim) id 1N3UzP-0001Ig-03 for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 13:24:31 +0000 Date: Thu, 29 Oct 2009 13:15:20 GMT From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: promoting Lua Message-ID: References: <4AE9909C.7060807@spellingbeewinnars.org> In-Reply-To: <4AE9909C.7060807@spellingbeewinnars.org> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: 41a6e6425e3f2b49e12fb43dc554587e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message <4AE9909C.7060807@spellingbeewinnars.org> you wrote: > Lua sucks actually comes up with few results and the complaints are > rather silly but still I was thinking about registering luasucks.org or > something similar. I was thinking it might be helpful to try to "own" > this keyword and displace others on the net. Nice idea. I remember seeing a website that organized programming languages not by positive ancestry ("good feature - let us have that!") but by negative ("ugh - how can we cure that nastiness!"). I foolishly forgot to note the URL. So if anybody knows it, please post. Thanks. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 11:28:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TDSifb014923; Thu, 29 Oct 2009 11:28:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1A171938F; Thu, 29 Oct 2009 11:27:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92FCE19357 for ; Thu, 29 Oct 2009 11:27:18 -0200 (BRST) Received: by gxk8 with SMTP id 8so2184586gxk.1 for ; Thu, 29 Oct 2009 06:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Z3Pjzvhm8g7fHsnWNDhnv5bJVdFaPSeMcpSIka3bIBg=; b=VQmsv2skojQZRaxvWlqBmGPRoLs1TjHKhPGyki4ot56lA6nXtK5hOcj8gWAy50hVUv 8trNkzaoQj1ccdAQVzeW3W/f8Os6Xfl+LbQUrbOhFChtJGeJFePbqF5mFtOtSfoIWSyI Zen2eAAxY2Ibo42PS8W7B/rfb5+G3n93TNW1c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HzUATzyUIXXjC97zo2J0AiEHmMyyhAmjKeWpsMus5baxI66zLJZpQuZDWhg/pZD67g w/dnuX9YFQS2hec6cDqOum0TC5Gwq0gkACxYf/rkCRUkYUSCRN4G95WeEcsWk+rHkRaB i2DL5IxLMYw62Aw0VAqhvw//a4k4ZzlLF/3SU= MIME-Version: 1.0 Received: by 10.239.170.36 with SMTP id q36mr2600hbe.153.1256822890482; Thu, 29 Oct 2009 06:28:10 -0700 (PDT) In-Reply-To: <4AE9909C.7060807@spellingbeewinnars.org> References: <4AE9909C.7060807@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 09:28:10 -0400 Message-ID: Subject: Re: promoting Lua From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Patrick, Tutorials are a great way to promote Lua. I believe Ruby on Rail filled a need so adding something you find useful to a lua library or lua is certainly a good way to promote lua. LuaForge is currently being redesigned http://groups.google.com/group/luaforge-development that should help promote lua. Maybe luadoesnotsuck.org ?? Cheers Andrew On Thu, Oct 29, 2009 at 8:54 AM, Patrick wrote: > As I was saying I am new to Lua and I have not finished with the basics > but again I am already in love with it. Once I am competent I would like > to start promoting the language and I was wondering what would be best. > > I thought I could do some screencast tutorials. > > When I was learning PHP, Python and now C/C++, one of the first things I > did/do was search for Python sucks, PHP sucks etc. BTW this also works > well with hosting providers to dig up dirt. > > Lua sucks actually comes up with few results and the complaints are > rather silly but still I was thinking about registering luasucks.org or > something similar. I was thinking it might be helpful to try to "own" > this keyword and displace others on the net. It could be a place to > dispel myths about Lua(I.E it's a gaming language) and ways to mediate > justifiable complaints. > > I watch the Tiobe index a lot and it has affected my decisions but I am > wondering how valid it is. Even if it is not valid it's probably a force > we have to deal with. As of October 2009 Lua is at position 20. > > Ruby was no where before Rails but I don't believe the language changed > so much, people just discovered it once they saw it's usefulness in one > application. Now Ruby has momentum and I bet it would still be popular > without Rails. It seems like programmers may have a herding instinct and > just want to follow the pack. This could work against Lua. > > It looks like the Delphi community has intentional manipulated Tiobe, > please see: > > http://blog.timbunce.org/2009/05/17/tiobe-index-is-being-gamed/ > > The call went out to put "Delphi programming on every page in visible > text (update the template). Stand up and be counted" and it worked and > Tiobe congratulated them for it apparently. Do we need to do the same? > Or should we educate people about the dangers of Tiobe's methodology? > Doing nothing might not be a good idea. > > -Patrick > > From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 11:41:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TDewFr019425; Thu, 29 Oct 2009 11:40:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08A5B193C4; Thu, 29 Oct 2009 11:39:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from saarni.dnainternet.net (saarni.dnainternet.net [83.102.40.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08A6D193B8 for ; Thu, 29 Oct 2009 11:39:28 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by saarni.dnainternet.net (Postfix) with ESMTP id 2AAE3E6B2B for ; Thu, 29 Oct 2009 15:40:21 +0200 (EET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -0.111 X-Spam-Level: X-Spam-Status: No, score=-0.111 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1.36, AWL=-1.250, LOCALPART_IN_SUBJECT=2.499] Received: from saarni.dnainternet.net ([83.102.40.136]) by localhost (saarni.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id UIMmzvAz7W+B for ; Thu, 29 Oct 2009 15:40:21 +0200 (EET) Received: from kirsikkapuu.dnainternet.net (kirsikkapuu.dnainternet.net [83.102.40.214]) by saarni.dnainternet.net (Postfix) with ESMTP id 02396E6B2F for ; Thu, 29 Oct 2009 15:40:21 +0200 (EET) Received: from [10.0.0.2] (unknown [59.92.253.33]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by kirsikkapuu.dnainternet.net (Postfix) with ESMTPSA id 22F967F002 for ; Thu, 29 Oct 2009 15:40:20 +0200 (EET) Message-Id: <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 19:10:40 +0530 References: <4AE9909C.7060807@spellingbeewinnars.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Luasucksless.org ? :) One thing that would be so nice to have is optional typing. I think Python 3 has that (correct if I'm wrong). And C# has something similar, coming from the other direction. Lua with optional static type checking would expand the use of the language much. And we've shown it can be done. - asko On 29.10.2009, at 18.58, Andrew Wilson wrote: > Hi Patrick, > > Tutorials are a great way to promote Lua. > > I believe Ruby on Rail filled a need so adding something you find > useful to a lua library or lua is certainly a good way to promote > lua. > > LuaForge is currently being redesigned > http://groups.google.com/group/luaforge-development that should help > promote lua. > > Maybe luadoesnotsuck.org ?? > > Cheers > Andrew > > > > > On Thu, Oct 29, 2009 at 8:54 AM, Patrick > wrote: >> As I was saying I am new to Lua and I have not finished with the >> basics >> but again I am already in love with it. Once I am competent I would >> like >> to start promoting the language and I was wondering what would be >> best. >> >> I thought I could do some screencast tutorials. >> >> When I was learning PHP, Python and now C/C++, one of the first >> things I >> did/do was search for Python sucks, PHP sucks etc. BTW this also >> works >> well with hosting providers to dig up dirt. >> >> Lua sucks actually comes up with few results and the complaints are >> rather silly but still I was thinking about registering >> luasucks.org or >> something similar. I was thinking it might be helpful to try to "own" >> this keyword and displace others on the net. It could be a place to >> dispel myths about Lua(I.E it's a gaming language) and ways to >> mediate >> justifiable complaints. >> >> I watch the Tiobe index a lot and it has affected my decisions but >> I am >> wondering how valid it is. Even if it is not valid it's probably a >> force >> we have to deal with. As of October 2009 Lua is at position 20. >> >> Ruby was no where before Rails but I don't believe the language >> changed >> so much, people just discovered it once they saw it's usefulness in >> one >> application. Now Ruby has momentum and I bet it would still be >> popular >> without Rails. It seems like programmers may have a herding >> instinct and >> just want to follow the pack. This could work against Lua. >> >> It looks like the Delphi community has intentional manipulated Tiobe, >> please see: >> >> http://blog.timbunce.org/2009/05/17/tiobe-index-is-being-gamed/ >> >> The call went out to put "Delphi programming on every page in visible >> text (update the template). Stand up and be counted" and it worked >> and >> Tiobe congratulated them for it apparently. Do we need to do the >> same? >> Or should we educate people about the dangers of Tiobe's methodology? >> Doing nothing might not be a good idea. >> >> -Patrick >> >> From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 11:49:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TDnNbB021792; Thu, 29 Oct 2009 11:49:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE117193D5; Thu, 29 Oct 2009 11:48:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7FC9193B0 for ; Thu, 29 Oct 2009 11:47:57 -0200 (BRST) Received: by qyk4 with SMTP id 4so1104336qyk.33 for ; Thu, 29 Oct 2009 06:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=m9EO4KlPnzR4SVKTqsYLM2ggSG5CjYZele8urIMoCfs=; b=NcnAghMXtfhgTnKA7R/6baNdYv/dxmkx4Sz/3lCmMOjftTj4/Sjgg1FZ2ArB52+pA/ yvAJjwf15b+qM+VIdyHbXiKMI/goLsuaAOGpjcAX2dT+et3ndInUwDbHevw3HE43ZaiX 41iCa0xlEo8gXbTYyRKUzywSxBYL28oAvrWo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BtV/mU1DA/QqiW2z+6nJJcrYxbZ5MpaakSU/3ha6xTG65DRTsHqK2uB1sv+TnY4deg OzR9wXEfCOdAfqHOQQNRyGGjdE0t2qagKR4raD3OkzidKneuPHOeID+LerAzBOjNTjua UBjIQwT4j/yVNEAwD17gNxPM+XW0cv+PnYwl8= MIME-Version: 1.0 Received: by 10.239.183.21 with SMTP id s21mr11406hbg.5.1256824128159; Thu, 29 Oct 2009 06:48:48 -0700 (PDT) In-Reply-To: <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> References: <4AE9909C.7060807@spellingbeewinnars.org> <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> Date: Thu, 29 Oct 2009 15:48:48 +0200 Message-ID: <560972290910290648v2f3b19a8se85af6cf1c59352b@mail.gmail.com> Subject: Re: promoting Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 3:40 PM, Asko Kauppi wrote: > One thing that would be so nice to have is optional typing. I think Python 3 > has that (correct if I'm wrong). It seems to be done through decorators, and it looks like an assertion-at-runtime kind of thing. http://stackoverflow.com/questions/1275646/python-3-and-static-typing > And C# has something similar, coming from the other direction. Yes, 'var ls = new List()', wrist-saving type-inference. Still considered spawn of the devil in the Java world. Metalua has an extension which does something like the Python example. Though, would Lua be Lua if it had static typing, in the sense of something that could be checked at compile time? steve d. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 14:35:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TGZqqa030663; Thu, 29 Oct 2009 14:35:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17DF319343; Thu, 29 Oct 2009 14:34:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 863AB1932D for ; Thu, 29 Oct 2009 14:34:04 -0200 (BRST) Received: by bwz27 with SMTP id 27so2518845bwz.21 for ; Thu, 29 Oct 2009 09:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=tiYOQyiuTDigfInqhuL53j2xHtRFQuLKjqci3bPFE+o=; b=FOCDFo1TSilSzx/qoFLprShHwaWvsPQL535x/vyDvuehcw3EdxG2rZn2h9QNSgBySk CbOHUiMkurdsiu5IQXquzIC9YJLzVHrkTUBRvVwtVV57yAcV7lx6m1yrRLzO9Zk3V4bl BhcWpx8oixYpDKhKFHJO+hjsJVqWIWacgzg68= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=I/+eiSnHBCJJcIDA1F8is+esqMl0P0b/yirszFUH6GsspmMNsBsA2fXT/IHKUV4I0v znVkMeFvP30PX/TkhFmLxn7HTdQoE9HXlRKCx8iUg/O9qg7fLUAF30P6nZiI4KDJGLxp EuOuA4k4NBE5uXd6yCLlKpogDviqVdBjg3b00= MIME-Version: 1.0 Received: by 10.204.33.193 with SMTP id i1mr193799bkd.75.1256834095068; Thu, 29 Oct 2009 09:34:55 -0700 (PDT) In-Reply-To: References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> <4AE81D13.4040702@duboucher.eu> Date: Thu, 29 Oct 2009 11:34:54 -0500 X-Google-Sender-Auth: 3fdc7d0a53d9d70f Message-ID: <5ba75e2f0910290934n5b4be673m3077a53c6bcaea38@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=000325557a76c735570477157d07 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325557a76c735570477157d07 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have test luarocks 2 yesterday and have to say that works great. I just miss some backwards compatibility for uninstalling old packages, otherwise it results in conflicts, yesterday I had to uninstall luarocks 0.6, then install luarocks 2, then uninstall luarocks 2 to unistall ALL my rocks, switch back to luarocks 2... Blessings! On Thu, Oct 29, 2009 at 1:35 AM, Alexander Gladysh wrot= e: > >>>>> I'm happy to announce LuaRocks 2.0.1, a bugfix release: > >>>> Everything looks great and all, but can you see about getting it int= o > >>>> the Ubuntu repos? > >>>> The latest version on 'universe' is 0.6... > >>> I'm not the maintainer for any distro packages of LuaRocks. My advice > >>> would be to get in contact with the downstream maintainer for your > >>> favorite distro and ask them to update. :) > > >> For debian and ubuntu, the way to do this would be to report a bug > >> against the out-of-date package. > > > Well, Ubuntu Karmic Koala will go live tomorrow with LuaRocks 1.0.1 ... > :/ > > I'm not related to the current maintainers in any way. > > My company is planning to create a debian package for LuaRocks for our > own needs and to maintain it in our public apt repository (sorry, no > links yet). > > We do not currently plan to submit the package for inclusion to the > official Ubuntu / Debian repos, but anyone would be able to use our > repo. We plan to keep packages there up-to date. > > As we're doing it for our own setup, there is a chance we miss > something we do not use, but that is important for others. If anyone > have their suggestions on how this package should be set up, please > say so. > > Also, I remember seeing the post, where it was explained why current > Lua package is patched to place its .so files in the manner it does. > Does anyone still have a link? I understand that it is due to the > packaging rules, but I vaguely remember there was even more practical > reason for that. > > Alexander. > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --000325557a76c735570477157d07 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have test luarocks 2 yesterday and have to say that works great. I just m= iss some backwards compatibility for uninstalling old packages, otherwise i= t results in conflicts, yesterday I had to uninstall luarocks 0.6, then ins= tall luarocks 2, then uninstall luarocks 2 to unistall ALL my rocks, switch= back to luarocks 2...

Blessings!

On Thu, Oct 29, 2009 at 1:= 35 AM, Alexander Gladysh <agladysh@gmail.com> wrote:
>>>>> I'm happy to announce LuaRocks 2= .0.1, a bugfix release:
>>>> Everything looks great and all, but can you see about gett= ing it into
>>>> the Ubuntu repos?
>>>> The latest version on 'universe' is 0.6...
>>> I'm not the maintainer for any distro packages of LuaRocks= . My advice
>>> would be to get in contact with the downstream maintainer for = your
>>> favorite distro and ask them to update. :)

>> For debian and ubuntu, the way to do this would be to report a bug=
>> against the out-of-date package.

> Well, Ubuntu Karmic Koala will go live tomorro= w with LuaRocks 1.0.1 ... :/

I'm not related to the current maintainers in any way.

My company is planning to create a debian package for LuaRocks for our
own needs and to maintain it in our public apt repository (sorry, no
links yet).

We do not currently plan to submit the package for inclusion to the
official Ubuntu / Debian repos, but anyone would be able to use our
repo. We plan to keep packages there up-to date.

As we're doing it for our own setup, there is a chance we miss
something we do not use, but that is important for others. If anyone
have their suggestions on how this package should be set up, please
say so.

Also, I remember seeing the post, where it was explained why current
Lua package is patched to place its .so files in the manner it does.
Does anyone still have a link? I understand that it is due to the
packaging rules, but I vaguely remember there was even more practical
reason for that.

Alexander.



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--000325557a76c735570477157d07-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 14:46:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TGkA8H001225; Thu, 29 Oct 2009 14:46:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A2BD1934E; Thu, 29 Oct 2009 14:44:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01D5219326 for ; Thu, 29 Oct 2009 14:44:43 -0200 (BRST) Received: by bwz27 with SMTP id 27so2530913bwz.21 for ; Thu, 29 Oct 2009 09:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=6inx0Ix3bJfUhql/3xojZQ1w+u8geUKeYeVdx8YgB90=; b=NfOYzFlyESbt+A7OKsPFAKiL8Wp1WELDZqncUq4rCINPo5mrKt3XxXF3u6E+1/TqQP nklzj/I7AgWfIiipEjoxnzozqvbFgfxc5oT1imxsYxBAHyjTNO686HA27Rz9VHuPT2nF 0KjFl3LyGGOaRUk9ZZw6OVGjj4T8/JDrBx/FM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=wvNCXHNy0S6qaghOu0uLCmtZ+BPB5QXKcUJRRrSLs69E9JInFlVvtoqminZtTwJcNU W2iJXpiTu3+pR/HLzGx3rYKkwRWBVQaPb/Bc83rreV99r4T+lZ/8gTGDQnaXlJ4zg72k gwsflHnDYfKhRtkmwMfQwfNnYGETp7VebA6cM= MIME-Version: 1.0 Received: by 10.204.34.5 with SMTP id j5mr222805bkd.5.1256834736040; Thu, 29 Oct 2009 09:45:36 -0700 (PDT) In-Reply-To: <5ba75e2f0910290934n5b4be673m3077a53c6bcaea38@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <48b7e23a0910271004x186386f6i29b22ff1f962a3eb@mail.gmail.com> <5e7d91620910271035g49600215ma0b77ea4169ca5d3@mail.gmail.com> <17eac67c0910271052j15fed87cg26d1853432e55ef7@mail.gmail.com> <4AE81D13.4040702@duboucher.eu> <5ba75e2f0910290934n5b4be673m3077a53c6bcaea38@mail.gmail.com> From: Hisham Date: Thu, 29 Oct 2009 14:45:15 -0200 Message-ID: <5e7d91620910290945s5df625c0t6e07e39715a44b35@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9TGkA8H001225 2009/10/29 Fernando P. García : > I have test luarocks 2 yesterday and have to say that works great. I just > miss some backwards compatibility for uninstalling old packages, otherwise > it results in conflicts, yesterday I had to uninstall luarocks 0.6, then > install luarocks 2, then uninstall luarocks 2 to unistall ALL my rocks, > switch back to luarocks 2... Yes, the structure of local repositories are unfortunately not compatible. One way to perform the conversion is to run "luarocks pack" using LuaRocks 0.x/1.x on all installed packages (this will create binary packages), erase the repository, and then run "luarocks install" with LuaRocks 2 to install all packages to the new locations. (This reminds me that someone once asked me to add an option to "luarocks list" to make its output more script friendly.....) -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 14:53:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TGr7Hk002707; Thu, 29 Oct 2009 14:53:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 854CE193A3; Thu, 29 Oct 2009 14:51:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74B4619357 for ; Thu, 29 Oct 2009 14:51:37 -0200 (BRST) Received: by ewy26 with SMTP id 26so2139513ewy.5 for ; Thu, 29 Oct 2009 09:52:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.211.146.5 with SMTP id y5mr380713ebn.41.1256835146899; Thu, 29 Oct 2009 09:52:26 -0700 (PDT) In-Reply-To: <4AE9909C.7060807@spellingbeewinnars.org> References: <4AE9909C.7060807@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 11:52:26 -0500 Message-ID: <90eb1dc70910290952m1239517ai1612e4bab665c2c0@mail.gmail.com> Subject: Re: promoting Lua From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 7:54 AM, Patrick wrote: > The call went out to put "Delphi programming on every page in visible > text (update the template). Stand up and be counted" after reading TIOBE's methodology, i changed the tags on my blog from "Lua" and "Programming" to "Lua Programming". just adding my grain of sand; but i haven't posted there for a looong time... -- Javier http://javier.guerrag.com From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 14:53:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TGrdkn002853; Thu, 29 Oct 2009 14:53:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 844E61A5DE; Thu, 29 Oct 2009 14:52:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B11919357 for ; Thu, 29 Oct 2009 14:51:57 -0200 (BRST) Received: by mail-ew0-f226.google.com with SMTP id 26so2139513ewy.5 for ; Thu, 29 Oct 2009 09:52:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.96.12 with SMTP id t12mr2790544ebb.71.1256835172466; Thu, 29 Oct 2009 09:52:52 -0700 (PDT) In-Reply-To: <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> References: <4AE9909C.7060807@spellingbeewinnars.org> <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> Date: Thu, 29 Oct 2009 11:52:52 -0500 Message-ID: <90eb1dc70910290952saba69bdica9ad5e0985fb8ad@mail.gmail.com> Subject: Re: promoting Lua From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 8:40 AM, Asko Kauppi wrote: > Luasucksless.org ? :) +1 -- Javier From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 15:06:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TH6nHS006084; Thu, 29 Oct 2009 15:06:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC9FD193C4; Thu, 29 Oct 2009 15:05:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD9B319365 for ; Thu, 29 Oct 2009 15:05:12 -0200 (BRST) Received: by qyk4 with SMTP id 4so1266999qyk.33 for ; Thu, 29 Oct 2009 10:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=82ysMScWN9AkVTzoLNIeB+4qLrRunNDBh3qAyEh4bis=; b=ISDTur25e7Rva1dTsFkAxBSW+us92k7JNh8NdNMjp0PZxnzpKDh0frLvi51XAYXB87 jlulH0yzEWWWTblJlmyo5NzVZsimv+Ag/+fCUzBemVLl5TRbGWLIn3tXdjZ7U4m5egVl wgoOON3tCYEbCZZWrKmsUOgFzP0FoXJCxIHuA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=vGYHxVBhhRyLMtpHGmFEhsWdJSe+ECa0LeVQJG1dETFyTHMPpYGpc9pM41r0FQJ3rP rGIfg1w//OkLhPtUy6qSEyZ7Eg3klGwAZ1BFdBpzZOX6hnw4ljWdubVd8yuntC2dlw5l O1O87dX1DDvdeLDZxDkGlMNWSxIi39jvB/VjA= MIME-Version: 1.0 Received: by 10.229.19.21 with SMTP id y21mr48922qca.27.1256835963133; Thu, 29 Oct 2009 10:06:03 -0700 (PDT) In-Reply-To: <4AE9909C.7060807@spellingbeewinnars.org> References: <4AE9909C.7060807@spellingbeewinnars.org> From: Norman Clarke Date: Thu, 29 Oct 2009 14:05:43 -0300 Message-ID: Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 9:54 AM, Patrick wrote: > As I was saying I am new to Lua and I have not finished with the basics > but again I am already in love with it. Once I am competent I would like > to start promoting the language and I was wondering what would be best. > > I thought I could do some screencast tutorials. I actually bought the domain names luacasts.org, luacasts.com and "luanatics.com" (yeah, silly name I know) about a year ago, with the intention of doing something similar. Then I became busy with other things and never followed through. If you're interested in the topic perhaps we can find some way to work together. Regards, Norman From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 15:08:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TH88sX006424; Thu, 29 Oct 2009 15:08:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D39C1193DA; Thu, 29 Oct 2009 15:06:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67377193CF for ; Thu, 29 Oct 2009 15:06:40 -0200 (BRST) Received: by bwz27 with SMTP id 27so2555031bwz.21 for ; Thu, 29 Oct 2009 10:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=O2yL8zsQE4lcfWWgWYO9BumfIlOljT2DhE8UYJOpWR8=; b=J+Ulq/HhGxpiL/4rqzfiML//jOzSND/6mICHcFh9r9hijQ+80NoDqbGhmkwgN6BjT/ cdsPjVN/hfP6YFhwtdewZ6kI7s7pD4MBXGjfjH5U8JHG2X90giCeJKqpLRjL1cIULMh7 BRD5yNUr6CTE4k/ZK6IPcQEV9UKehUUTeKzuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=kFsXBKSiAcETWWE6H7UD1pxz4aRyZhBosCcRCrp0ybHow8OmnDBLwo2Bq/bZIURcoR dxmaMeVBlYgmIO+Ho8zimEhMjKH9cDamY5f7+gzsIvDShO3mu3H7/Bpkq3DiADnhvQTw LFtiFEq78WkYJH04C1Z8s5UUtOVivHYjs5Y30= MIME-Version: 1.0 Received: by 10.223.17.65 with SMTP id r1mr53289faa.5.1256836053151; Thu, 29 Oct 2009 10:07:33 -0700 (PDT) In-Reply-To: References: <4AE9909C.7060807@spellingbeewinnars.org> From: Jim Whitehead II Date: Thu, 29 Oct 2009 17:07:13 +0000 Message-ID: <5fe281d40910291007h2596cf22w369cad00df6bbfde@mail.gmail.com> Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 5:05 PM, Norman Clarke wrote: > On Thu, Oct 29, 2009 at 9:54 AM, Patrick > wrote: > >> As I was saying I am new to Lua and I have not finished with the basics >> but again I am already in love with it. Once I am competent I would like >> to start promoting the language and I was wondering what would be best. >> >> I thought I could do some screencast tutorials. > > I actually bought the domain names luacasts.org, luacasts.com and > "luanatics.com" (yeah, silly name I know) about a year ago, with the > intention of doing something similar. Then I became busy with other > things and never followed through. If you're interested in the topic > perhaps we can find some way to work together. I own http://trylua.net as well =) - Jim From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 15:30:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9THUnLN012129; Thu, 29 Oct 2009 15:30:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D7571A5E5; Thu, 29 Oct 2009 15:29:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9DDE19357 for ; Thu, 29 Oct 2009 15:29:12 -0200 (BRST) Received: by bwz27 with SMTP id 27so2579104bwz.21 for ; Thu, 29 Oct 2009 10:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Ywq2A7AgDMyVfdeDsA2PqNWfubdoAbQZ0eh8Y5DKiJI=; b=KjsT+ovuL80T3xByXb+N0BscG/BAxuR9n1luSvrmk1tplaWPOFKjKKPCyFyZP9JAzN stuhrIgfr9AacU4Ql4YMhnOt/HdwZ8H3Wlxgjr40lokLkA5/DlDn/TfvNcVkSuwCUv3g cALtpk9ijM/yHzehBqhGcP6mIK8CtTuJpOLJM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=hfMTRdN1ifK8+oyYzPcI8c7AH+4RB3Oqzi7JPGS7ZF4499f8zMniUH6RzcD7IRaoor ogHG7zjOCs+1uDeaeeXhkhyDPTd63Bk1bPBVEWdquZJSwg0fmdqvDwBKaTmyC3Vjc+PD 9y+8VHL6L0Zkn8AIO/46xh2J7TyHa0JOGusG0= MIME-Version: 1.0 Received: by 10.204.153.217 with SMTP id l25mr240659bkw.108.1256837404809; Thu, 29 Oct 2009 10:30:04 -0700 (PDT) In-Reply-To: <90eb1dc70910290952saba69bdica9ad5e0985fb8ad@mail.gmail.com> References: <4AE9909C.7060807@spellingbeewinnars.org> <2E909493-4D7C-47C2-B7A0-11C52FA93B17@dnainternet.net> <90eb1dc70910290952saba69bdica9ad5e0985fb8ad@mail.gmail.com> Date: Thu, 29 Oct 2009 12:30:04 -0500 X-Google-Sender-Auth: 52ca841c5535a9b0 Message-ID: <5ba75e2f0910291030n612ee7ben37ff94c02d34f324@mail.gmail.com> Subject: Re: promoting Lua From: =?UTF-8?Q?Fernando_P=2E_Garc=C3=ADa?= To: Lua list Content-Type: multipart/alternative; boundary=0015175d094e0ddc0f0477164322 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d094e0ddc0f0477164322 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 On Thu, Oct 29, 2009 at 11:52 AM, Javier Guerra wrote: > On Thu, Oct 29, 2009 at 8:40 AM, Asko Kauppi > wrote: > > Luasucksless.org ? :) > > +1 > > -- > Javier > --=20 Fernando P. Garc=C3=ADa, http://www.develcuy.com Developer - Analista de Sistemas +51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Per=C3=BA ** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de t=C3=AD. --0015175d094e0ddc0f0477164322 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1

On Thu, Oct 29, 2009 at 11:52 AM, Javi= er Guerra <javie= r@guerrag.com> wrote:
On Thu, Oct 29, 2009 at 8:40 AM, Asko Kauppi <askok@dnainternet.net> wrote:
> Luasucksless.org ? :)

+1

--
Javier



--
Fernando P. Garc= =C3=ADa, http://www.develcuy.comDeveloper - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalin= a Ancha #377, Cusco -Per=C3=BA

** Antes de imprimir este mensaje piensa en tu compromiso con el medio = ambiente, protegerlo depende de t=C3=AD.
--0015175d094e0ddc0f0477164322-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 16:12:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TICXf3022904; Thu, 29 Oct 2009 16:12:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F360E1A5E5; Thu, 29 Oct 2009 16:11:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A63C11934E for ; Thu, 29 Oct 2009 16:11:03 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N3ZTP-0000Op-0z for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 19:11:47 +0100 Received: from mycomadmin-6-206.cnt.nerim.net ([213.215.6.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Oct 2009 19:11:47 +0100 Received: from PhiLho by mycomadmin-6-206.cnt.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Oct 2009 19:11:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 19:11:25 +0100 Lines: 25 Message-ID: References: <4AE9909C.7060807@spellingbeewinnars.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mycomadmin-6-206.cnt.nerim.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <4AE9909C.7060807@spellingbeewinnars.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 29/10/2009 13:54, Patrick wrote: > When I was learning PHP, Python and now C/C++, one of the first things I > did/do was search for Python sucks, PHP sucks etc. I fear I haven't seen the interest. Can you expand a bit? > Lua sucks actually comes up with few results Can be because the language is great... or because it has too few users! I prefer to think it is for the former reason... :-) Looks a bit like language comparison based on number of tags in StackOverflow: are they numerous because they are popular? Or because they are problematic! :-D > the complaints are > rather silly A quite common one is "this language sucks because it doesn't use soft braces {}"... People are too used to C/C++/C#/Java/JavaScript/Perl... :-) I still think having a flexible mind is a quality for a programmer... ;-) -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 16:29:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TITgJo027908; Thu, 29 Oct 2009 16:29:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3384193CB; Thu, 29 Oct 2009 16:28:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-351.bluehost.com (outbound-mail-351.bluehost.com [66.147.249.12]) by bazar2.conectiva.com.br (Postfix) with SMTP id 052B91934E for ; Thu, 29 Oct 2009 16:28:18 -0200 (BRST) Received: (qmail 8746 invoked by uid 0); 29 Oct 2009 18:29:10 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 29 Oct 2009 18:29:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=Kjw1lXOZ0uzdsQy/6ZuQI6AtX/Nsiy4LQOK1lMx480vh16pQTl89nKnuRBByMoDGvJXluBHRaUk6IoLIaQ+k5zW3xClZr11Lz1y5LV8UCSk0ywoaqc6IpS8zDkJkFoX8; Received: from bas3-unionville55-1279751709.dsl.bell.ca ([76.71.118.29] helo=[192.168.1.3]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N3ZkD-0001lI-Kh for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 12:29:09 -0600 Message-ID: <4AE9DEF4.3040706@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 14:29:08 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.71.118.29 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > When I was learning PHP, Python and now C/C++, one of the first things I > did/do was search for Python sucks, PHP sucks etc. I fear I haven't seen the interest. Can you expand a bit? Hi Philippe I totally understand if this was confusing. I want to promote Lua so why luasucks.org?? I would like to make sure that search results will bring up my site rather then someone who actually does not like Lua. My site could deal with any complaints in a productive way and help to stop misunderstandings not increase them. I was using IX Web hosting but I found terrible issue when I searched for IX Web hosting sucks, issues I confirmed as real. I have also found significant issues with PHP and Python this way. I guess if you want to use a tool you really should know what not to use it for as well as knowing what to use it for. Hope this helps-Patrick From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 16:32:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TIWQac028628; Thu, 29 Oct 2009 16:32:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90AB1193E3; Thu, 29 Oct 2009 16:31:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B903193C5 for ; Thu, 29 Oct 2009 16:31:05 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSA00HHOGRFAQ80@asmtp019.mac.com> for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 11:31:26 -0700 (PDT) Message-id: <6047481E-10E4-4515-8E46-32FA09FCA118@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: confused about mod_lua, mod_python, mod_php Date: Thu, 29 Oct 2009 19:30:50 +0100 References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 28, 2009, at 5:36 PM, Jacques Chester wrote: > It's funny how doing this throws Lua's benefits into > sharp relief. Each copy of PHP on my servers chews ~ > between 15Mb and 33Mb. Each copy of Lua is less than > 300kb, from memory. That's a memory usage ratio of > between ~50:1 and ~100:1. Right, memory usage for Lua is in a different league altogether. For example, Nanoki consumes around ~300-400 KB as reported by collectgarbage( 'count' ): http://svr225.stepx.com:3388/a From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 17:09:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TJ97WN004187; Thu, 29 Oct 2009 17:09:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39CA518A5B; Thu, 29 Oct 2009 17:07:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F6D7189C4 for ; Thu, 29 Oct 2009 17:07:30 -0200 (BRST) Received: by ewy26 with SMTP id 26so2284725ewy.5 for ; Thu, 29 Oct 2009 12:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=n7w2xK+vX3SiYchTTy4ir3if4oZcfntLugWViTWXB4I=; b=FYaOcC7NkQCLGY+hqIZTz8iwyGdvwmD6xD3Fy01X0zEkDKf4Ydx/hGLByi7HjyVSyU 6bb3ykWyX69fKqkC7P9eK8dU+3KS5qAPBXY2Xm00fKMvCu2YkmrJp3/rzKKX8JP8zs0T G3NF7HGNen4en11NBlcJmT0sqzhBwCM1MCVNY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=onNaL3q0q0aBpnR9ax62FATnE3UpMy67kB8SKEmnnPlWOhPvBUyb/GZMyqLxSEQvn4 8YGPfLmaiiv0i3Nv+Zdca/mFSSffLZKVF3VWdoAVt11VNZgAtq0nLVjUVqk/6iH0OhIO NxE7G7weyoxYj9u2ddGsF98sf3WoMBWi1Zvxs= Received: by 10.210.152.4 with SMTP id z4mr592973ebd.7.1256843301481; Thu, 29 Oct 2009 12:08:21 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 7sm1878222eyg.41.2009.10.29.12.08.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 12:08:19 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <6047481E-10E4-4515-8E46-32FA09FCA118@mac.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: confused about mod_lua, mod_python, mod_php Date: Thu, 29 Oct 2009 20:07:48 +0100 References: <4AE83715.2010702@spellingbeewinnars.org> <7913df4d0910280635v74dfefa1n8aa7b96d44fd3743@mail.gmail.com> <5ba75e2f0910280745q62e31c0fy29b4066113d40256@mail.gmail.com> <6047481E-10E4-4515-8E46-32FA09FCA118@mac.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 7:30 PM, Petite Abeille wrote: > For example, Nanoki consumes around ~300-400 KB as reported by > collectgarbage( 'count' ): > > http://svr225.stepx.com:3388/a For what it's worth, that demo of Nanoki sports around 436,824 pages at the moment. Target is around 2 millions pages (i.e the entire content of en.wikipedia.org) or the mac mini hosting that instance running out of disk space. Whatever happens first :D From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 17:42:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TJgKeF011979; Thu, 29 Oct 2009 17:42:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECB2619092; Thu, 29 Oct 2009 17:40:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s54.bay0.hotmail.com (bay0-omc3-s54.bay0.hotmail.com [65.54.246.213]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C51B18FF3 for ; Thu, 29 Oct 2009 17:40:53 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s54.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 29 Oct 2009 12:41:44 -0700 Received: from [155.31.170.109] (155.31.170.109) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Thu, 29 Oct 2009 19:41:43 +0000 Message-ID: <4AE9EFEE.80707@my.erau.edu> Date: Thu, 29 Oct 2009 15:41:34 -0400 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Behaviour of table.remove() References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Oct 2009 19:41:44.0666 (UTC) FILETIME=[D8776BA0:01CA58CF] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Duncan Cross wrote: > the # length operator require that the table be > "array-like", or they have undefined, inconsistent behaviour. > > -Duncan I'm not sure saying it has "undefined" behavior is appropriate. Its behavior is perfectly defined. It is guaranteed that t[#t] will be non-nil and t[#t+1] will be nil, except in the special case of #t == 0. Thus, the table {1, nil, 3} has only two possible results of #t: 1 and 3. Inconsistent, however, I will take. Regards, Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 17:50:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TJo4pO014173; Thu, 29 Oct 2009 17:50:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1476D190AC; Thu, 29 Oct 2009 17:48:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bitdojo.org (bitdojo.org [200.46.204.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BAE118A58 for ; Thu, 29 Oct 2009 17:48:45 -0200 (BRST) Received: from localhost (unknown [200.46.208.211]) by bitdojo.org (Postfix) with ESMTP id C27BCE0A2E9 for ; Thu, 29 Oct 2009 19:49:35 +0000 (UTC) Received: from bitdojo.org ([200.46.204.210]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 52384-05 for ; Thu, 29 Oct 2009 19:49:31 +0000 (UTC) Received: from Users-MacBook-Pro.local (unknown [128.164.100.174]) by bitdojo.org (Postfix) with ESMTPA id 2D458E09F10 for ; Thu, 29 Oct 2009 19:49:35 +0000 (UTC) Message-ID: <4AE9F1CE.9000704@bluedino.net> Date: Thu, 29 Oct 2009 15:49:34 -0400 From: Matthew Burke User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> <5fe281d40910291007h2596cf22w369cad00df6bbfde@mail.gmail.com> In-Reply-To: <5fe281d40910291007h2596cf22w369cad00df6bbfde@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Whitehead II wrote: > I own http://trylua.net as well =) > > If we're all coming clean, I should fess up to luaquiz.com. Which will have some real content, real soon now... Matt From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 17:54:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TJsOnQ015155; Thu, 29 Oct 2009 17:54:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3DE41911E; Thu, 29 Oct 2009 17:53:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9472190DD for ; Thu, 29 Oct 2009 17:53:05 -0200 (BRST) Received: by bwz27 with SMTP id 27so2731075bwz.21 for ; Thu, 29 Oct 2009 12:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ZIWDJ/4ozV7nl6v6m/5SqsJ7HbMs1yqg5fzB9SzppoY=; b=O6eyM+Yb1s3qErhW4cg6VCWEd4GWYVvG+y9iau/yqeZ9afdpY2f9kN7Ga9zF1zJtlK ao0avDaR9r5lBSnTp6hmdOM7627Hl0Z2iP22iZNbG+y65qURF/UD60zxUwq6D3qUF826 ek5ESS+pa4vB5+BgZtnyi/19qXRugvE/wwkz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=pMeCz2U+1ufkfY/vWBFhtwAbjoJH2zS6zJUu/C/CGEIng9MnkDc0qPBC0y/Gm3U7c+ GlUQol3dlMlOnNtPbXOCcoIsEwjemhZuMTdDA4KxQlYKzhMUK/Cj3Svua0H6PNPK8CpR vvDghCeGUZ1B+GKksb0il21SOe1YW4PdfOm30= MIME-Version: 1.0 Received: by 10.223.97.132 with SMTP id l4mr75657fan.100.1256846037207; Thu, 29 Oct 2009 12:53:57 -0700 (PDT) In-Reply-To: <4AE9F1CE.9000704@bluedino.net> References: <4AE9909C.7060807@spellingbeewinnars.org> <5fe281d40910291007h2596cf22w369cad00df6bbfde@mail.gmail.com> <4AE9F1CE.9000704@bluedino.net> From: Jim Whitehead II Date: Thu, 29 Oct 2009 19:53:37 +0000 Message-ID: <5fe281d40910291253g7fba1a0awfdbc23af86a48f88@mail.gmail.com> Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9TJsOnQ015155 On Thu, Oct 29, 2009 at 7:49 PM, Matthew Burke wrote: > Jim Whitehead II wrote: >> >> I own http://trylua.net as well =) > > If we're all coming clean, I should fess up to luaquiz.com.  Which will have > some real content, real soon now... Soon(tm) =) - Jim From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 17:57:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TJvqVH016110; Thu, 29 Oct 2009 17:57:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B52F919299; Thu, 29 Oct 2009 17:56:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.ptn-ipout01.plus.net (relay.ptn-ipout01.plus.net [212.159.7.35]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBE0E191DC for ; Thu, 29 Oct 2009 17:56:32 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAL+Q6UrUnw4S/2dsb2JhbADfXAqEMwQ Received: from pih-relay05.plus.net ([212.159.14.18]) by relay.ptn-ipout01.plus.net with ESMTP; 29 Oct 2009 19:57:23 +0000 Received: from [80.229.242.93] (helo=iyonix) by pih-relay05.plus.net with esmtp (Exim) id 1N3b7b-0006id-6x for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 19:57:23 +0000 Date: Thu, 29 Oct 2009 19:52:28 GMT From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: promoting Lua Message-ID: References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> In-Reply-To: <4AE9DEF4.3040706@spellingbeewinnars.org> X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: b366aa990dbc1141e01b946687c3e925 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message <4AE9DEF4.3040706@spellingbeewinnars.org> you wrote: > > When I was learning PHP, Python and now C/C++, one of the first things I > > did/do was search for Python sucks, PHP sucks etc. > > I fear I haven't seen the interest. Can you expand a bit? Does the usage "xxx sucks", which I presume was coined in the USA, mean "I like xxx" or "I do not like xxx"? For most of my life "to suck" meant in English what Latin "sugere" meant, and it had no pejorative or sexual connotation. I presume that the recent usage means what Latin "irrumare" meant. Latin has two advantages over English: 1) it is unnecessary to invent new words in it to describe sexual acts, as it already has a sufficiency of them, and 2) it is impossible to invent new words in it because outside the Vatican it is dead. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:00:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TK0sIN016704; Thu, 29 Oct 2009 18:00:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EDD4192D9; Thu, 29 Oct 2009 17:59:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E447191DC for ; Thu, 29 Oct 2009 17:59:33 -0200 (BRST) Received: by qyk4 with SMTP id 4so1362007qyk.33 for ; Thu, 29 Oct 2009 13:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=l8aavjacV1TW9aKY/phOH37Ik1tLKtFqNfM8PSPKUVc=; b=fQ3ioB2QBiQLRBT3gy5n21rLOTTlaz2MUjlSXxEalpJGAr51i4QWSqtAboeYUIBSAi xyMUop33KY5gq9GXBOA507PZyxKv26nrOcf1V62RRl2qQgxuZbqUdXtlvI6X65XqJIGA i5ACcZHq03FqItp/fWCn8zISAQnyNzTwXOFgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=lcqbjS/3OlxfCK1WhVe+cSCecJDVDr7JZyeWobu+IfJbZ4ujDAjvFYgvAawse4jqhC MZKg7HTvGd07rfg0CcczxcbXspXXhVQVnoko7MX4cbwHJA9OQFkwERLIqb8UbEnwGi9B l71odpMe7gAchT7bqbrnmzU18nkL4/NNsnQlM= MIME-Version: 1.0 Received: by 10.229.53.208 with SMTP id n16mr67152qcg.90.1256846426092; Thu, 29 Oct 2009 13:00:26 -0700 (PDT) In-Reply-To: References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> From: Norman Clarke Date: Thu, 29 Oct 2009 17:00:06 -0300 Message-ID: Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 4:52 PM, Gavin Wraith wrote: > In message <4AE9DEF4.3040706@spellingbeewinnars.org> you wrote: > >> > When I was learning PHP, Python and now C/C++, one of the first things I >> > did/do was search for Python sucks, PHP sucks etc. >> >> I fear I haven't seen the interest. Can you expand a bit? > > Does the usage "xxx sucks", which I presume was coined in the USA, > mean "I like xxx" or "I do not like xxx"? For most of my life "to suck" > meant in English what Latin "sugere" meant, and it had no pejorative > or sexual connotation. I presume that the recent usage means what Latin > "irrumare" meant. Latin has two advantages over English: 1) it is > unnecessary to invent new words in it to describe sexual acts, as > it already has a sufficiency of them, and 2) it is impossible to invent > new words in it because outside the Vatican it is dead. I don't know where it was coined, but in American English it essentially means you consider something to be bad. It originally had a sexual connotation which I think is mostly forgotten now, though it's a phrase which more careful speakers still won't use in polite company. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:06:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TK635h017780; Thu, 29 Oct 2009 18:06:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F341F192EE; Thu, 29 Oct 2009 18:04:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58F76192AD for ; Thu, 29 Oct 2009 18:04:41 -0200 (BRST) Received: by pwj9 with SMTP id 9so256744pwj.21 for ; Thu, 29 Oct 2009 13:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6uy+MbK9RZM/8HRIxNvjArwDDR9A3Vxq+B3/etYLDxc=; b=V+VY+OjW4kIPXsUoQ/nQaAuhwgTQdsRWotjPcc4OPde13dFMAB3TyUUhJm5j+ro50+ TVMdHg3pL+rzQeSxSlM0JGPIC6oO1wDsaGgtZJUS24mMdElUpg2lZ+aNXKMB9BO3L3yn KZMBY89sRoAfcxH2x+e93Jj+PD0KDxKKDNMHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WT8VsF6L8bIUoOC3OQomJKfjfYP1neQgltFaV5Le1yxolYJ7QsDWpkTjIAaHQA0gYD tW6xA2spiY8AQoY/RwgrnfpDxkWOo58c8XhISQ3vzO4GOvJBflPoScMSl+POI7zdypMw fdx4Kexm1x+0OdKvYDFF7R0/Raib2ld+m6O4U= MIME-Version: 1.0 Received: by 10.142.247.5 with SMTP id u5mr49682wfh.333.1256846733865; Thu, 29 Oct 2009 13:05:33 -0700 (PDT) In-Reply-To: References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 18:05:33 -0200 Message-ID: <2bc7f0950910291305ic0bf2edj1578a4b8828d17b9@mail.gmail.com> Subject: Re: promoting Lua From: Elias Barrionovo To: Lua list Content-Type: multipart/alternative; boundary=00504502cc251bf2ae0477186fdc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502cc251bf2ae0477186fdc Content-Type: text/plain; charset=ISO-8859-1 The usage "aaa sucks" (also commonly written on internet as "aaa sux") means "aaa is not good", "aaa is crap". In other words, it expresses a negative point of view. On Thu, Oct 29, 2009 at 5:52 PM, Gavin Wraith wrote: > In message <4AE9DEF4.3040706@spellingbeewinnars.org> you wrote: > > > > When I was learning PHP, Python and now C/C++, one of the first things > I > > > did/do was search for Python sucks, PHP sucks etc. > > > > I fear I haven't seen the interest. Can you expand a bit? > > Does the usage "xxx sucks", which I presume was coined in the USA, > mean "I like xxx" or "I do not like xxx"? For most of my life "to suck" > meant in English what Latin "sugere" meant, and it had no pejorative > or sexual connotation. I presume that the recent usage means what Latin > "irrumare" meant. Latin has two advantages over English: 1) it is > unnecessary to invent new words in it to describe sexual acts, as > it already has a sufficiency of them, and 2) it is impossible to invent > new words in it because outside the Vatican it is dead. > > -- > Gavin Wraith (gavin@wra1th.plus.com) > Home page: http://www.wra1th.plus.com/ > -- NI! --00504502cc251bf2ae0477186fdc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The usage "aaa sucks" (also commonly written on internet as "= ;aaa sux") means "aaa is not good", "aaa is crap".= =A0 In other words, it expresses=A0 a negative point of view.

On Thu, Oct 29, 2009 at 5:52 PM, Gavin Wraith <gavin@wra1th.plus.com> wrot= e:
In message <4= AE9DEF4.3040706@spellingbeewinnars.org> you wrote:

> > When I was learning PHP, Python and now C/C++, one of the first t= hings I
> > did/do was search for Python sucks, PHP sucks etc.
>
> I fear I haven't seen the interest. Can you expand a bit?

Does the usage "xxx sucks", which I presume was coined in the USA= ,
mean "I like xxx" or "I do not like xxx"? For most of m= y life "to suck"
meant in English what Latin "sugere" meant, and it had no pejorat= ive
or sexual connotation. I presume that the recent usage means what Latin
"irrumare" meant. Latin has two advantages over English: 1) it is=
unnecessary to invent new words in it to describe sexual acts, as
it already has a sufficiency of them, and 2) it is impossible to invent
new words in it because outside the Vatican it is dead.

--
Gavin Wraith (gavin@wra1th.plus.co= m)
Home page: http:/= /www.wra1th.plus.com/



--
NI!
--00504502cc251bf2ae0477186fdc-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:13:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKDDOI019145; Thu, 29 Oct 2009 18:13:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B5D819324; Thu, 29 Oct 2009 18:11:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66428192E3 for ; Thu, 29 Oct 2009 18:11:52 -0200 (BRST) Received: by ewy26 with SMTP id 26so2352002ewy.5 for ; Thu, 29 Oct 2009 13:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=50ZUJ5laKy3wXqsPHtqw9++4LAojIxgU9JTB9YIVAck=; b=msxEOm9F2feNtSRgrSt1zQja8Zeukjyt6qXGuFO9zC6yNNCkN7qeADYJF5HkGpSRo2 f/S4+45+qBjjNHdEi22wcXlTzCRtHhp16MmwqPRVvhE8b11frpzQKUaMCZUrK30yB0+y h/2G5+WeQvI32Xnxm/x7yitriCWEXz4wI+aBc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=b0b1L7wIb8QibxUIYWyaDMr5bU4yvGhsfVDRWVbeXCJNw+kwKy7tyr0W9oGyrqe5iW o4zzRh6fWiQgvyHm4J8B8i0bDaBrQPv+kygInjBboQjEvPC8gmg/wi9mgUGVg3S/aAsZ uH0gR46XTE6o4RW4A4DEQnRaELFZBVil95uFA= Received: by 10.211.131.34 with SMTP id i34mr680179ebn.35.1256847165762; Thu, 29 Oct 2009 13:12:45 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 28sm6826393eyg.30.2009.10.29.13.12.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 13:12:44 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <2bc7f0950910291305ic0bf2edj1578a4b8828d17b9@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 21:12:13 +0100 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <2bc7f0950910291305ic0bf2edj1578a4b8828d17b9@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 9:05 PM, Elias Barrionovo wrote: > The usage "aaa sucks" (also commonly written on internet as "aaa > sux") means > "aaa is not good", "aaa is crap". In other words, it expresses a > negative > point of view. E.g. "Yeah, that sucks big time": Usage example: http://lasucksbigtime.blogspot.com/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:13:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKDrNq019292; Thu, 29 Oct 2009 18:13:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26BD81934E; Thu, 29 Oct 2009 18:12:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f216.google.com (mail-gx0-f216.google.com [209.85.217.216]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1624A19342 for ; Thu, 29 Oct 2009 18:12:35 -0200 (BRST) Received: by gxk8 with SMTP id 8so2675730gxk.1 for ; Thu, 29 Oct 2009 13:13:30 -0700 (PDT) Received: by 10.100.77.13 with SMTP id z13mr1203475ana.23.1256847209939; Thu, 29 Oct 2009 13:13:29 -0700 (PDT) Received: from ?10.140.33.14? ([166.137.5.32]) by mx.google.com with ESMTPS id 5sm1021944yxg.28.2009.10.29.13.13.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 13:13:28 -0700 (PDT) Message-Id: <3E878524-824E-4AED-89C8-400C79912614@burninglabs.com> From: Phoenix Sol To: Lua list In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 15:11:53 -0500 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 3:00 PM, Norman Clarke wrote: > On Thu, Oct 29, 2009 at 4:52 PM, Gavin Wraith > wrote: >> In message <4AE9DEF4.3040706@spellingbeewinnars.org> you wrote: >> >>>> When I was learning PHP, Python and now C/C++, one of the first >>>> things I >>>> did/do was search for Python sucks, PHP sucks etc. >>> >>> I fear I haven't seen the interest. Can you expand a bit? >> >> Does the usage "xxx sucks", which I presume was coined in the USA, >> mean "I like xxx" or "I do not like xxx"? For most of my life "to >> suck" >> meant in English what Latin "sugere" meant, and it had no pejorative >> or sexual connotation. I presume that the recent usage means what >> Latin >> "irrumare" meant. Latin has two advantages over English: 1) it is >> unnecessary to invent new words in it to describe sexual acts, as >> it already has a sufficiency of them, and 2) it is impossible to >> invent >> new words in it because outside the Vatican it is dead. > > I don't know where it was coined, but in American English it > essentially means you consider something to be bad. It originally had > a sexual connotation which I think is mostly forgotten now, though > it's a phrase which more careful speakers still won't use in polite > company. It does have a sexual connotation, and a very abusive one. I will spare you further elaboration. It's typical of the American gutter- mentality, I'm afraid. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:17:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKGv80020061; Thu, 29 Oct 2009 18:16:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57689193EE; Thu, 29 Oct 2009 18:15:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.190]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8EBE1934B for ; Thu, 29 Oct 2009 18:15:37 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so437924gvf.40 for ; Thu, 29 Oct 2009 13:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=F/5Ie88NrK6+GgnZDKWitMseHe0dN0YFoIn4gOvjiKo=; b=dnO0CRmRMOraOkiTAaHstUbvasNIGM+sPm45z+EjEk8bZqColzogh6Xw5QPXLcXA7j k1nQ1r3ksIKRKJXmJQuRbjDhxERjs7MhXr7m11QxgGqUMlNjwcaosTHZWTtms9Duz89L maIopvTDMWeaFS0t2yzqPnA3wzB9WyKKfZHo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=YtVlx/5plLbN4HIb3jB+7JXuJNCOkSHBAx13reKqkIpWL4jNKF3z30r1feh8nU5BoV zrzg18/5d92vBf8WDQTIbtZ2AnU/Vp9Exkw3A0Ap13P9xnl1ymVgwk5gVhDe06jwY9rA 6CHNuUhYQDICuzFY0ljgDAsyM3JeVH5PntsUM= Received: by 10.103.76.32 with SMTP id d32mr217941mul.98.1256847390882; Thu, 29 Oct 2009 13:16:30 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 7sm1345343mup.42.2009.10.29.13.16.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 13:16:29 -0700 (PDT) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <3E878524-824E-4AED-89C8-400C79912614@burninglabs.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 21:15:47 +0100 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <3E878524-824E-4AED-89C8-400C79912614@burninglabs.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 9:11 PM, Phoenix Sol wrote: > It's typical of the American gutter-mentality, I'm afraid. "can do" attitude you meant to say? From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:31:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKVTHv022718; Thu, 29 Oct 2009 18:31:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED091192C8; Thu, 29 Oct 2009 18:30:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71FE319298 for ; Thu, 29 Oct 2009 18:30:08 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJ+Y6UpUXebi/2dsb2JhbADfaQqEMwQ Received: from relay03.plus.net ([84.93.230.226]) by relay.pcl-ipout01.plus.net with ESMTP; 29 Oct 2009 20:30:59 +0000 Received: from [80.229.242.93] (helo=iyonix) by relay03.plus.net with esmtp (Exim) id 1N3be7-0007Jv-FJ for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 20:30:59 +0000 Date: Thu, 29 Oct 2009 20:30:00 GMT From: Gavin Wraith To: lua@bazar2.conectiva.com.br Subject: Re: promoting Lua Message-ID: <7c92ffb150.wra1th@wra1th.plus.com> References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> In-Reply-To: X-Organization: Home User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.14) POPstar/2.06-ds.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Plusnet-Relay: 8bcd33ebe18aa2f8c872ee63927e4d45 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In message you wrote: > On Thu, Oct 29, 2009 at 4:52 PM, Gavin Wraith wrote: > > In message <4AE9DEF4.3040706@spellingbeewinnars.org> you wrote: > > > >> > When I was learning PHP, Python and now C/C++, one of the first things I > >> > did/do was search for Python sucks, PHP sucks etc. > >> > >> I fear I haven't seen the interest. Can you expand a bit? > > > > Does the usage "xxx sucks", which I presume was coined in the USA, > > mean "I like xxx" or "I do not like xxx"? > > I don't know where it was coined, but in American English it > essentially means you consider something to be bad. It originally had > a sexual connotation which I think is mostly forgotten now, though > it's a phrase which more careful speakers still won't use in polite > company. Thank you. The reason I jerked the reins on this thread was to point out that Lua, now being a programming language of international repute, deserves a pinch of circumspection in the naming of URLs and suchlike. You probably know the story of Rolls Royce calling its cars Silver Ghost, Silver Wraith, Silver Mist ... The distributors in Germany soon pulled the plug on the last one, as "mist" means "manure", I think. Of course almost any word may have unfortunate connotations in some language. A cavalier, even abusive, approach to naming is adopted by marketroids for whom infantilizing their public is seen as good selling-strategy. To name is to control. Lua has a good name, with propitious connotations in many languages, and a beautiful logo. That is important. -- Gavin Wraith (gavin@wra1th.plus.com) Home page: http://www.wra1th.plus.com/ From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:54:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKsKEt027784; Thu, 29 Oct 2009 18:54:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA07C193EC; Thu, 29 Oct 2009 18:53:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F12419338 for ; Thu, 29 Oct 2009 18:52:51 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id n9TKrivn004466 for ; Thu, 29 Oct 2009 18:53:46 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 3265054C1D0; Thu, 29 Oct 2009 18:53:44 -0200 (BRST) Date: Thu, 29 Oct 2009 18:53:44 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: promoting Lua Message-ID: <20091029205344.GA21178@inf.puc-rio.br> References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I don't know where it was coined, but in American English it > essentially means you consider something to be bad. It originally had > a sexual connotation which I think is mostly forgotten now, though > it's a phrase which more careful speakers still won't use in polite > company. So it is worth remembering that we may be in polite company in this list. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 18:59:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TKxZxS028598; Thu, 29 Oct 2009 18:59:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7851F193F1; Thu, 29 Oct 2009 18:58:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-352.bluehost.com (outbound-mail-352.bluehost.com [66.147.249.13]) by bazar2.conectiva.com.br (Postfix) with SMTP id 061251934E for ; Thu, 29 Oct 2009 18:58:11 -0200 (BRST) Received: (qmail 18860 invoked by uid 0); 29 Oct 2009 20:59:03 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 29 Oct 2009 20:59:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=YfsZqGHgdS/h/Jo5XHkGaYRtqGAggB6CU1OlNSAxankJ+53cNe4aeTvDpZWbjebywuKuZbVNpjDbUn7rcuCy9RQCkIl7R9l+5WAIS3qObZ2YcLmbeoNd+7rrFDpBE0tn; Received: from bas3-unionville55-1279751709.dsl.bell.ca ([76.71.118.29] helo=[192.168.1.3]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N3c5G-0005HI-QN for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 14:59:03 -0600 Message-ID: <4AEA0215.60305@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 16:59:01 -0400 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <20091029205344.GA21178@inf.puc-rio.br> In-Reply-To: <20091029205344.GA21178@inf.puc-rio.br> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.71.118.29 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "So it is worth remembering that we may be in polite company in this list" Indeed. I am sorry if my original post spawned this but does anyone have any feedback on the best way to promote Lua? Any thoughts on the weight of Tiobe?-Patrick From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:03:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TL3lGW029264; Thu, 29 Oct 2009 19:03:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37A57193F7; Thu, 29 Oct 2009 19:02:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout018.mac.com (asmtpout018.mac.com [17.148.16.93]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2901B193ED for ; Thu, 29 Oct 2009 19:02:24 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp018.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSA00EDXNSI8Z80@asmtp018.mac.com> for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 14:03:15 -0700 (PDT) Message-id: From: Petite Abeille To: Lua list In-reply-to: <4AEA0215.60305@spellingbeewinnars.org> Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 22:02:41 +0100 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <20091029205344.GA21178@inf.puc-rio.br> <4AEA0215.60305@spellingbeewinnars.org> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 9:59 PM, Patrick wrote: > but does anyone have any feedback on the best way to promote Lua Yes... use it. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:12:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLCtGP030484; Thu, 29 Oct 2009 19:12:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30546193F9; Thu, 29 Oct 2009 19:11:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 602F7192E0 for ; Thu, 29 Oct 2009 19:11:37 -0200 (BRST) Received: by qyk4 with SMTP id 4so1386586qyk.33 for ; Thu, 29 Oct 2009 14:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=H/I4TEZVamxVIHq4sMOkfLbAA4e1oEHLke+cUv6MQvo=; b=NRKiHMy3r9oluhozbvGDw6J5ynDDWKI3BCWlTqsOBuWw9cPJ2OXj3sjzKkcy7YnygC akDmU2zHnJQFgA2p/NB9kOLYugeT6+33JzV+tKE48ItMNHVibZL2BuVchLb50NyUr9YG rgD21UjcApwbZoThsCWG1cthzLxpctjMpoBS4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ExJ/eIQA9yygBXSW+PIQlhCkZA4APKnizsODAYeJHmwyoiGKxERF3YCI2zSzQ5Uemk WKVTZpkDcWJtvDkO515LuCF/fAH/3Y+Uc/s0TQKRA5wHU/ZxMMIXBp201QQJR0ikuM5g RFL51l0FsxCA/1//BkueR+6egfnvtUFfxS9T0= MIME-Version: 1.0 Received: by 10.229.42.208 with SMTP id t16mr89029qce.14.1256850751131; Thu, 29 Oct 2009 14:12:31 -0700 (PDT) In-Reply-To: References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <20091029205344.GA21178@inf.puc-rio.br> <4AEA0215.60305@spellingbeewinnars.org> From: Norman Clarke Date: Thu, 29 Oct 2009 18:12:11 -0300 Message-ID: Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 6:02 PM, Petite Abeille wrote: > > On Oct 29, 2009, at 9:59 PM, Patrick wrote: > >> but does anyone have any feedback on the best way to promote Lua > > Yes... use it. Indeed, and perhaps also write about those things you use it for in blog posts so that more people find about it. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:19:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLJ3w9031394; Thu, 29 Oct 2009 19:19:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BDF9193FE; Thu, 29 Oct 2009 19:17:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D412B193F3 for ; Thu, 29 Oct 2009 19:17:45 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSA00MZ2OI7XS20@asmtp020.mac.com> for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 14:18:39 -0700 (PDT) Message-id: <740E2E33-BD35-4BD2-9590-BC8E5452A11E@mac.com> From: Petite Abeille To: Lua list In-reply-to: Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 22:18:06 +0100 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <20091029205344.GA21178@inf.puc-rio.br> <4AEA0215.60305@spellingbeewinnars.org> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 10:12 PM, Norman Clarke wrote: > On Thu, Oct 29, 2009 at 6:02 PM, Petite Abeille > wrote: >> >> On Oct 29, 2009, at 9:59 PM, Patrick wrote: >> >>> but does anyone have any feedback on the best way to promote Lua >> >> Yes... use it. > > Indeed, and perhaps also write about those things you use it for in > blog posts so that more people find about it. Perhaps. Alternatively, use it to do great things. After all, Lua is a means to an end. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:19:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLJi0L031500; Thu, 29 Oct 2009 19:19:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 531FD19408; Thu, 29 Oct 2009 19:18:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5FD2193F3 for ; Thu, 29 Oct 2009 19:18:28 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N3cOv-0006ga-1S for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 22:19:21 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N3cOu-0003UI-ED for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 22:19:20 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> Date: Thu, 29 Oct 2009 22:19:20 +0100 In-Reply-To: (Gavin Wraith's message of "Thu, 29 Oct 2009 19:52:28 GMT") Message-ID: <87hbthucdj.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Gavin Wraith: > Does the usage "xxx sucks", which I presume was coined in the USA, More likely Canada, according to the OED's entry on "sucker"; the use of "to suck" in this sense appears more recent. > mean "I like xxx" or "I do not like xxx"? For most of my life "to suck" > meant in English what Latin "sugere" meant, and it had no pejorative > or sexual connotation. It's often used pejoratively, without a sexual connotation, as in "a new sucker is born every minute" (which I think is used in TV programming for children, so...). From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:23:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLN31e031971; Thu, 29 Oct 2009 19:23:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50056193BC; Thu, 29 Oct 2009 19:21:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FCC91938A for ; Thu, 29 Oct 2009 19:21:46 -0200 (BRST) Received: by ewy26 with SMTP id 26so2423796ewy.5 for ; Thu, 29 Oct 2009 14:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=srnIZH7MHy7mB4y9/FI29LXZrnhYaMr2j3Ogd2lL8Z8=; b=Nw6F45OGbJQkRzL/77+ai/DoTPUqotA4wumoaXHsTE74j0fFAyc2pD3k3AgfTccuqf NyYCXcFfhCoFDvYPHDR7TWsykKcbZAaUaEZbcWpvCAcQM5Ozqiiw8t+xGBKrIRbxwwGH +alJijhFHMRwVohHG24pIFarKlPvNR9cFeeCQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=EBBSJbmdzPwY1J8K9dIMIYuBxD/9I1xKh2Rc8OAPl3PxYqm8elNvTcdFYN6WwaA5Ez cDhZnhl9JfjOuvKdZHwjLGENSg/8074Pww3lmbqGNlhCGQrDoxufv2j4LYkv1AnsAqAY 84d47mpCgT29GFxeoRHzYlikUDqbGWqPlgBlk= Received: by 10.211.155.11 with SMTP id h11mr3201210ebo.40.1256851360626; Thu, 29 Oct 2009 14:22:40 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 7sm6976377eyg.33.2009.10.29.14.22.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 14:22:39 -0700 (PDT) Message-Id: <3DDD0BB9-022D-4B86-A6B8-5F79D64B178B@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <87hbthucdj.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: promoting Lua Date: Thu, 29 Oct 2009 22:22:08 +0100 References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <87hbthucdj.fsf@mid.deneb.enyo.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 29, 2009, at 10:19 PM, Florian Weimer wrote: > (which I think is used in TV programming for children, so...). Perhaps literally then. From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:29:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLTUdW000598; Thu, 29 Oct 2009 19:29:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E131B193F1; Thu, 29 Oct 2009 19:28:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6338E19395 for ; Thu, 29 Oct 2009 19:28:08 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so540183qwb.11 for ; Thu, 29 Oct 2009 14:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=yBgQZ22SY5A+cAqCIT5X/mqKlfv4ROf3pFQR3yGVQBM=; b=K2zvZIVWnR6zlOtHC5ISsL7Qxi5h72ltQ2VtfQfB0te+3ffQZsdVCelfDnhtXmkyHR 1meydKCj7856p2HJoVVgebh+wNnNZDndF872bJWYNGASem17pxLZROlf4wNny1PoIdpA mVxV+SvE5sbqEgXPP2R9KOV1NqqPL74n1/1Fo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=EjjOYZ6IgtUTkAPhvWtPGUpnxlKGHz2ob0SzwHCHstRRgEJk3SI/N1zZ9la/MYQtr2 ir4d1wdjsaC6+2GomlSKesYasELPIB3tBcVJ0OmdkLT8HcJDllZapKKUb4i7xp/ycGhd OZNXTGDDcKLpMOBJRtLR8vkLHoeXTqeGUgLAs= MIME-Version: 1.0 Received: by 10.229.43.68 with SMTP id v4mr84484qce.95.1256851741233; Thu, 29 Oct 2009 14:29:01 -0700 (PDT) In-Reply-To: <740E2E33-BD35-4BD2-9590-BC8E5452A11E@mac.com> References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <20091029205344.GA21178@inf.puc-rio.br> <4AEA0215.60305@spellingbeewinnars.org> <740E2E33-BD35-4BD2-9590-BC8E5452A11E@mac.com> From: Norman Clarke Date: Thu, 29 Oct 2009 18:28:41 -0300 Message-ID: Subject: Re: promoting Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Oct 29, 2009 at 6:18 PM, Petite Abeille wrote: > > On Oct 29, 2009, at 10:12 PM, Norman Clarke wrote: > >> On Thu, Oct 29, 2009 at 6:02 PM, Petite Abeille >> wrote: >>> >>> On Oct 29, 2009, at 9:59 PM, Patrick wrote: >>> >>>> but does anyone have any feedback on the best way to promote Lua >>> >>> Yes... use it. >> >> Indeed, and perhaps also write about those things you use it for in >> blog posts so that more people find about it. > > Perhaps. Alternatively, use it to do great things. After all, Lua is a means > to an end. I'm sure writing the best software in the history of humankind would be a very effective way to promote Lua. However, prehaps writing some decent blog posts would be an easier first step. :-) From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 19:36:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TLaA2H002772; Thu, 29 Oct 2009 19:36:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D9D519409; Thu, 29 Oct 2009 19:34:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C294B1938A for ; Thu, 29 Oct 2009 19:34:41 -0200 (BRST) Received: by pwj9 with SMTP id 9so297095pwj.21 for ; Thu, 29 Oct 2009 14:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=t6RcFpSBSnCxV2bW2HcMP4k/gdAM8FAa6PB0/iq7nh4=; b=ikJwyzC6ikm2495Dl7Jbiwr3hM87yJLr2yyljkJwJKgm3DChul8jRwoE1BPk2uqrO3 ilfJq2kRheluKt24yDS8+Omn8Z0x/OOD9H6QUVqIbMCClftrRfWtoWjQnj0YnW0FXyeI GINmWaFVdIRsAs2OggG+NLblOu743dsHHBRSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=F9bW0ArpAsiJH8zkYfUkOYLoaHlBONBnZ/Tnz3gN82jkANE2ZQ2xcLtzEvElGStEhe R7OY5pRi68cfAEx6g43MqlydBl+CM9pqoVQiykwPtEPtpJst05mwa7Tmd/vC+RvRJgP+ ZhKohl6io9YhEZCqtA3EYoVOhcnVeJDFMpb00= MIME-Version: 1.0 Received: by 10.143.137.2 with SMTP id p2mr57912wfn.136.1256852133171; Thu, 29 Oct 2009 14:35:33 -0700 (PDT) Date: Thu, 29 Oct 2009 14:35:33 -0700 X-Google-Sender-Auth: 3635d43d78f16bca Message-ID: <9e264e780910291435r5beebbcbkc0147eefd54ec405@mail.gmail.com> Subject: Using lua_yield with common C functions From: Peter LaDow To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've spend the last several hours pouring through the archives trying to understand the interaction between lua_resume, lua_yield, and coroutines. The problem I'm having is that when I have multiple scripts running in separate threads, only the last created thread seems to run correctly. Here's my setup (more or less, minus error checking, a link to the real code is below): lua_State *L = NULL; static void openlualibs(lua_state *); // Open the common libraries // This creates a global Lua state if necessary, then creates a new Lua thread and loads the script into the thread. lua_State *create_thread(const char *scr) { lua_State *ret; if ( L == NULL ) { L = luaL_newstate(); openlualibs(L); } ret = lua_newthread(L); luaL_loadfile(ret, scr); return ret; } // Starts or resumes an Lua thread int run_thread(lua_State *l) { return lua_resume(l, 0); } Now, I have registered several functions that a Lua script can call that will yield. They all have a template similar to: int cb1(lua_State *l) { /* Process arguments */ ... /* Yield */ return lua_yield(l, 0); } Now, if I create multiple threads, such as: lua_State *t1, *t2, *t3; t1 = create_thread("test.lua"); t2 = create_thread("test.lua"); t3 = create_thread("test.lua"); Only t3 seems to run to completion. Both t1 and t2 seem stuck at the very same point. Here's a snippet of the output from my test program. The "(N)" is the thread id (N = 0, 1, 2). The FUNC_* are the names of the callback functions being executed. Starting tcon with tcon.lua Tcon with id = 0 created. (0) FUNC_GPIO_CLR_DIR: 0x00000007 Starting tcon with tcon.lua Tcon with id = 1 created. (1) FUNC_GPIO_CLR_DIR: 0x00000007 Starting tcon with tcon.lua Tcon with id = 2 created. (2) FUNC_GPIO_CLR_DIR: 0x00000007 (0) FUNC_GPIO_CLR_DIR: 0x00000007 (1) FUNC_GPIO_CLR_DIR: 0x00000007 (2) FUNC_WRITE: REQ: 2 ADDR: 0x00000001 DATA: 0x00004e20 (0) FUNC_GPIO_CLR_DIR: 0x00000007 (1) FUNC_GPIO_CLR_DIR: 0x00000007 (2) FUNC_WRITE: REQ: 2 ADDR: 0x00000002 DATA: 0x00004e20 [...snip...] (0) FUNC_GPIO_CLR_DIR: 0x00000007 (1) FUNC_GPIO_CLR_DIR: 0x00000007 (2) FUNC_HALT (0) FUNC_HALT (1) FUNC_HALT Note how (0) and (1) are all stuck until the end. Thread (2) runs just fine. Then they all jump straight to the end of the script. My calls to lua_resume either return LUA_YIELD or 0 all the time (I never get an error). So I don't think I'm bumping up against the C/coroutine boundary. Now, I did find reference to independent global environments (here http://lua-users.org/lists/lua-l/2003-10/msg00269.html). I tried to do what was suggested to create a new global table and replace the local thread with the new table. But instead I get the following error: Starting tcon with tcon.lua Tcon with id = 0 created. (0) FUNC_GPIO_CLR_DIR: 0x00000007 Starting tcon with tcon.lua Tcon with id = 1 created. PANIC: unprotected error in call to Lua API (tcon.lua:8: bad argument #1 to 'bor' (string expected, got nil)) Now, the arguments to 'bor' are included from an external file with a require statement. I tried doing a local require (i.e. "tb = require("tb")), but then I get an assertion from lua_pushlstring ('L->top < L->ci->top' failed). This is my initial foray into coroutines. Initially I used pthreads, but I thought the overhead of threads wasn't worth it, so I'm trying out this method. This seems far more straightforward, cleaner, and more efficient. But I'm not getting something with using lua_resume and lua_yield. I'd prefer not to use Coco, and I'm not even sure it is necessary in this case. I'm sure I'm misunderstanding something. I've created a tarball of my project including everything to build and run the example. You can download it at: http://cid-3e6aa75359e23754.skydrive.live.com/self.aspx/Lua/test.tgz The INDEP_TABLES define at the top of tcon_test.c inserts the code for the independent global environments that I gathered from the Lua mailing list. It is disabled by default. Any help would be appreciated, Pete From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 21:20:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9TNKkUN015146; Thu, 29 Oct 2009 21:20:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 940ED19392; Thu, 29 Oct 2009 21:19:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99EC2193A4 for ; Thu, 29 Oct 2009 21:19:14 -0200 (BRST) Received: by pwj9 with SMTP id 9so338562pwj.21 for ; Thu, 29 Oct 2009 16:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=3q+wGvWY7tt86JNEvNzP18XX/fi8PxVeK+1/jbivXk8=; b=S8YA+m7dmrJUyK6iUFkOEQM3hcxd/IB4EU4LJy5qBwJ8FIIEot4+Aul6EEd+wnBYl7 BVxLTCXkVErxVNS3+KyMIpoPtbF8BWkuq0GDSjRZa2ixvGtB2sq6yj+WY+7+fqKzBYBv fqExM2rYBnopJHJ4TwgCLMpdaN/UrNwugnOkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=wqjc9vqLd+WHfE5ldR/9erPegCOMccSoX82QuvshQ58TQDp18cNn35+sNs0OoABcBt C1DDxXNNwnZQ2qtTN7krVzdfKiTQZSQhPs+MoeTl6G1CbAVtrBV+7tqJSCW5hECfusVr 2jy+HgtP3ubyXtwQPPff2NocOHdcRU5qeypGE= MIME-Version: 1.0 Received: by 10.114.237.30 with SMTP id k30mr485256wah.102.1256858408062; Thu, 29 Oct 2009 16:20:08 -0700 (PDT) Date: Thu, 29 Oct 2009 18:20:07 -0500 Message-ID: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> Subject: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=0016e64b95e0f22b9904771b26f3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64b95e0f22b9904771b26f3 Content-Type: text/plain; charset=ISO-8859-1 Hi, I am using LUNAR(http://lua-users.org/wiki/CppBindingWithLunar) for exposing my C++ objects to LUA. The following is the C Portion of the code. CLObject is one class. CLNumList is another class which are being discussed here. #define NUMLIST "CLNumList" typedef struct {CLNumList*pT;} CLNL; typedef struct {CLObject *pT;} CLO; class CLObject { public: // Constants static const char className[]; static Luna< CLObject >::RegType methods[]; .. *int GetType(lua_State *L);//(unsigned char&cType);* *int GetListofNumbers(lua_State *L);* CObject* real_object; //this is the actual pointer to the C++ class. }; class CLNumList{ public: // Constants static const char className[]; static Luna< CLNumList >::RegType methods[]; .. int GetFirst(lua_State *L); int GetNext(lua_State *L); int GetInteger(lua_State *L); int GetIntegerCount(lua_State *L); CNumList* real_object; //this is the actual pointer to the C++ class. } ; The following is .cpp code ... CLObject :*GetListofNumbers*(lua_State *L)// { CLNumList*o = new CLNumList(L); CLNL*ud = static_cast< CLNL*>(lua_newuserdata(L, sizeof(CLNumList))); // create new userdata real_object->GetListofNumbers(*o->real_object); //CLObject ud->pT = o; lua_pushlightuserdata(L, ud); luaL_getmetatable(L, NUMLIST ); lua_setmetatable(L, -2); return 1; } -- The following is the LUA calling scenario. * * *CLObjectInstance = CLObjectI:new()* *local clnumlist1 = CLObjectInstance: GetListofNumbers()* * * *local total = clnumlist1:GetIntegerCount()* *local value=0* *for lpCount = 1, total do* *if(lpCount==1) then * * value = clnumlist1GetFirst()* *else* * value = clnumlist1GetNext()* *end* *end* --now if i access the following method using the CLObjectInstance, then LUA throws this error. CLObjectInstance:GetType() --throws attempt tp call method GetType a nil value. Could any one shed light on this issue? . Thanks and Regards. --0016e64b95e0f22b9904771b26f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I am using LUNAR(http://lua-users.org/wiki/CppBindingWithLunar) f= or exposing my C++ objects to LUA. =A0

The followi= ng is the C Portion of the code.=A0CLObject is one class.=A0CLNumList =A0is= another class which are being discussed here.

#define NUMLIST "CLNumList"

typedef struct {CLNumList*pT;} CLNL;
typedef struct = {CLObject=A0*pT;} CLO;


class=A0CLObject {
public:

// Constants
static c= onst char className[];
stati= c Luna<=A0CLObject >::RegType methods[];
..
in= t GetType(lua_State *L);//(unsigned char&cType);
int= =A0GetListofNumbers(lua_State *L);

CObject* real_object; //this is the actual pointer to t= he C++ class.

};
class=A0CLNumList{
public:

// Constants
st= atic const char className[];
static Luna<=A0CLNumList=A0>::RegType= methods[];
..
=A0=A0 =A0 =A0 =A0
int GetFirst(lua_State *L);
=
int G= etNext(lua_State *L);
int G= etInteger(lua_State *L);

int GetIntegerCount(lua_State *L);<= /div>

CNumList* real_object; //this is the actual point= er to the C++ class.

}=A0;

The following is .cpp code
...
CLObject=A0:GetList= ofNumbers(lua_State *L)//
{
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CLNumList*o = =3D new=A0CLNumList(L);
CLNL*ud =3D static_cast<=A0CLNL*>(lua_newuse= rdata(L, sizeof(CLNumList))); =A0// create new userdata
real_object->= ;GetListofNumbers(*o->real_object); //CLObject
ud->pT =3D o;
lua_= pushlightuserdata(L, ud);
luaL_getmetatable(L,=A0NUMLIST=A0);
lua_setmeta= table(L, -2);
retu= rn 1;=A0
}


-- The following is the LUA calling sc= enario.

CLObjectInstance =3D=A0CLObjectI:new()
local clnumlist1 =3D CLObjectInstance:=A0GetListofNumbers()<= /div>

local total =3D =A0clnumlist1:GetInteger= Count()
local value=3D0
for lpCount =3D 1, total do
if(lpCount=3D=3D1) then=A0
=A0=A0 =A0 =A0 =A0 = =A0value =3D=A0clnumlist1GetFirst()
else
= =A0=A0 =A0 =A0 =A0 =A0value =3D=A0clnumlist1GetNext()
end
end

--now if i access the following met= hod using the CLObjectInstance, then LUA throws this error.
CLObjectInstance:GetType() --throws attempt tp call method GetType a nil value.
Could any one shed light on this issue? .=A0

Thanks and Regards.



=





=
--0016e64b95e0f22b9904771b26f3-- From lua-bounces@bazar2.conectiva.com.br Thu Oct 29 22:52:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U0q74t024645; Thu, 29 Oct 2009 22:52:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB6B919401; Thu, 29 Oct 2009 22:50:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7000D193E8 for ; Thu, 29 Oct 2009 22:50:38 -0200 (BRST) Received: by pxi2 with SMTP id 2so1632277pxi.11 for ; Thu, 29 Oct 2009 17:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=sSZFEKdWwvNH4Fp3dr9ipwKXaxpn873V0tqALD89PlY=; b=Wrgj22YiKZEfVi/CD01fO0ALapUM74AAKnAVQzFegJdb3Xb9mkhM5FfmI3BPBMo3hX oApjKEfbVZlv5UtYkpOgjo3mAsF7ofa/YZbH2YwOaZH1h47dwMnia2EP4uBW6d5rkd8q +SZ+embCmckr/+59qKkKkOFyz6VGiK5yffavg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Ohqcsi2PfHRcuSvEiWs2MukhzZ+l9KwRXvbBpw9dOoyhyUr1XZa5YiWP1RDgjkAyA1 6kJtV8jpiRfOvukkyMtz9U9ZXJfJLn3K62dijbPjoftreEEr0Oex5SZXS2Qxjh103WHV q3L/zf+7ZLqgx3ZRIy8/zPldl8CLIYl6XCO0Y= MIME-Version: 1.0 Received: by 10.142.248.2 with SMTP id v2mr84512wfh.177.1256863891957; Thu, 29 Oct 2009 17:51:31 -0700 (PDT) In-Reply-To: <137286af0910270413g649146b4v55fbf0a57285e540@mail.gmail.com> References: <137286af0910260653u3baa68f9r3aa48fde5eda8500@mail.gmail.com> <137286af0910270413g649146b4v55fbf0a57285e540@mail.gmail.com> Date: Thu, 29 Oct 2009 20:51:31 -0400 Message-ID: Subject: Re: Lua+wxWidgets+SWIG From: John Labenski To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9U0q74t024645 On Tue, Oct 27, 2009 at 7:13 AM, Dzmitry Hancharou wrote: > I tested wxLua/apps/wxluacan sample app. In this case from C++ module we can > run lua-scripts. These scripts can only use those parent modules. That is: >   mod1 = module1.getInst() >   mod1:func1(); >   mod1:func2(params); > and no more. > And if I add a functional, I need to modify i-file and recompile the entire > project. You compiled the app staticly. > I want to break a problem into several parts like this: >   mod1 = module1.getInst() >   mod2 = module2.getInst() >   mod1:doIt(mod2:getIt()) > In this case if I want to change the first module, I did not recompile the > second. > > Does anyone know how this can be done? Compile your module as a DLL and use Lua's require() function to load it. Regards, John From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 00:10:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U2A8gQ001689; Fri, 30 Oct 2009 00:10:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA64D19415; Fri, 30 Oct 2009 00:08:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out1.berkeley.edu (smtp-out1.Berkeley.EDU [128.32.61.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6F2119409 for ; Fri, 30 Oct 2009 00:08:37 -0200 (BRST) Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by fe2.calmail with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (auth plain:jgm@berkeley.edu) (envelope-from ) id 1N3gvg-0005kt-8w for lua@bazar2.conectiva.com.br; Thu, 29 Oct 2009 19:09:29 -0700 Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id D2B5A1322D9; Thu, 29 Oct 2009 19:08:26 -0700 (PDT) Date: Thu, 29 Oct 2009 19:08:26 -0700 From: John MacFarlane To: Lua list Subject: Re: ANNOUNCE: lunamark - PEG-based markdown conversion library Message-ID: <20091030020826.GA27340@protagoras.phil.berkeley.edu> References: <20090912175135.GA7476@protagoras.phil.berkeley.edu> <20090913071008.GA15326@protagoras.phil.berkeley.edu> <20090916063609.GA6960@protagoras.phil.berkeley.edu> <5fe281d40910200447n43f713d7xee9fb60da19405e3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5fe281d40910200447n43f713d7xee9fb60da19405e3@mail.gmail.com> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9U2A8gQ001689 +++ Jim Whitehead II [Oct 20 09 12:47 ]: > On Wed, Sep 16, 2009 at 7:36 AM, John MacFarlane wrote: > > +++ Yuri Takhteyev [Sep 14 09 11:12 ]: > >> > I'll look into releasing on luaforge.  The project needs some polishing > >> > first, e.g. better error handling and documentation. > >> > >> It can always be made better, but please don't let this stop you from > >> making a release. > > > > Okay, I've tagged 0.1 and made a rock available on github: you should > > now be able to install the library using > > > > luarocks --from=http://github.com/jgm/rocks/raw/master install lunamark > > > >> > No, currently you'd have to modify the module code. In the definition > >> > of 'parser' in markdown_parser.lua, you'd add a clause for your new > >> > pattern: something like > >> > > >> > MyPattern = p"[[" * lpeg.Ct((_"Inline" - p"]]")^0) * p"]]" / writer.mypattern > >> > >> If this is the only thing that needs to be done, shouldn't it be easy > >> to expose the table that is used to create the parser, to allow adding > >> a pattern by simply setting a field? Perhaps something like: > >> > >>     require("lunamark") > >>     require("lpeg") > >>     local wikilink_handler = function(s) return {"", s, ""} end > >>     my_parser = lunamark.parsers.markdown() -- or something similar > >>     my_parser.WikiLink = lpeg.P"[[" * lpeg.Ct((_"Inline" - > >> lpeg.P"]]")^0) * lpeg.P"]]" / wikilink_handler > >>     local converter = lunamark.converter(my_parser, "html") > > > > Good thought.  I've done something similar.  You can now pass in a > > modify_syntax function as an option.  This is a function from a table > > to a table, so you can perform arbitrary transformations on the input > > format grammar.  A simple example: > > > >    function capify(t) > >      t.Str = t.Str / string.upper > >      return t > >    end > > > >    markdown2htmlCAPS = lunamark.converter("markdown", "html", { modify_syntax = capify }) > > > > This gives you a markdown variant in which all strings are capitalized. > > > > Adding a handler for, say, wikilinks would be slightly more complicated. > > You'd have to do two things to the grammar table: > > (1) insert an entry for WikiLink > > (2) register WikiLink as an Inline element by modifying Inline > > > > So, something like this: > > > >    function add_wikilink(t) > >      t.WikiLink = --[[ whatever... ]] / write_wikilink > >      t.Inline = lpeg.V("WikiLink") + t.Inline > >      return t > >    end > > > >    function write_wikilink(s) > >      -- code to write the wikilink as HTML > >    end > > I took a stab at implementing this, and I got wiki links working > perfectly. I had a question about how I would accomplish something > else, however, since its a bit of a weird need. I'd like for any > special characters (gt, lt, quot) to be escaped when they aren't > encountered in an inline code element, or a verbatim block. I tried > altering the grammar to get it to work, but every attempt has failed > miserably. Any idea how I would do something like that, John? > I'm not sure what you mean by "escaped." These characters are already escaped in HTML output; that is, < goes to <, " to ", etc. Do you mean that you want these NOT to be escaped when they occur in inline code or verbatim? Or do you mean that you want them to be escaped in some other way? Since you're dealing with the HTML output here, you probably want to be modifying the writer (lunamark/writer/html.lua), not the grammar. John From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 00:32:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U2WAox004578; Fri, 30 Oct 2009 00:32:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D91421941B; Fri, 30 Oct 2009 00:30:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30233193E2 for ; Fri, 30 Oct 2009 00:30:48 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N3hHB-0002Oc-00; Fri, 30 Oct 2009 03:31:41 +0100 Date: Fri, 30 Oct 2009 03:28:24 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091030022824.GA12167@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alex Davies wrote: > I believe it means that the call info, ie saved instruction pointer, > function base/top (to allow call stack traversal), number of tail calls, > etc are all stored as implicit, hidden local variables. Sure, that's the basic idea, but it goes beyond it. Actually, most of the stuff kept in CallInfo in standard Lua is not needed. Even LuaJIT 1.x has dropped tail call counting long ago (with zero complaints) -- IMHO that's the job of the debugger, not the VM. Vararg functions get an extra frame below the actual frame, which is used to hold the variable arguments. This way the current function is always at BASE[-1] and needs no extra pointer. TOP can either be reconstructed on-the-fly or can be stored in L->top for calls to C. BASE can be kept in a register or in L->base. Ok, that still leaves us with a need for the return address (the bytecode PC of caller), the number of expected results and a way to restore the callers BASE. All of this can be combined into a frame link, which is a single 32 bit value. It's stored instead of the type tag in the upper 32 bits of BASE[-1]. The lower 32 bits contain the function (closure). There are two basic types of frame links, depending on the kind of the _calling_ frame. If it's a Lua frame, then the frame link contains the return address: a bytecode PC with the lowest 2 bits set to zero. For all other kinds of frames, the frame link is a delta to the previous frame: this is a multiple of 8 plus one of 6 remaining bit patterns in the lowest 3 bits. These are used to differentiate upcalls from C, protected frames, vararg frames and continuations (for metamethods). Only backwards frame traversal is needed (e.g. for stack unwinding in error handling). It starts at the topmost frame link held in BASE[-1]. Operand A from bytecode PC[-1] (the CALL instruction) or the delta can be used to get to the previous frame link. The high orthogonality of the scheme really simplifies a lot of code. A frame slot is just a regular stack slot -- the frame link overlays the tag of the tagged value, but is always lower than any non-number type. In fact, a regular type check considers this slot as a number, which is convenient in many places (e.g. for the GC). A picture says more than a thousand words: <-------. .------------------. .------. .-- BASE \ V \ V \ V +=====+-----+-----+-----+=====+-----+=====+-----+-----+ tag -> |delta| STR | Num | NIL | PC1 | TAB | PC2 | Num | Num | ==> value-> |func1|GCstr| ber | |func2|GCtab|func3| ber | ber | ==> +=====+-----+-----+-----+=====+-----+=====+-----+-----+ ^----- prev. BASEs -----^ current PC = PC3 |--RA-from-CALL-->| |-RA->| tankxx wrote: > I cannot figure out why this speeds up call handling substantially. > May it reduce cache misses? What's so nice about this layout is that a call simply needs to bump BASE, save the PC in BASE[-1] and load the new PC. A return restores the PC from BASE[-1], adjusts the return value(s) and BASE with the help of the CALL instruction in PC[-1] and then continues executing code. This makes function calls and returns blazingly fast. The standard library functions don't need to set up and tear down the frame at all, except for the fallback path (coercions or errors). Even better, the JIT compiled code doesn't need to sync back the frame info to the Lua stack in most cases. It wouldn't be too costly either, since it's the same as syncing back any other stack slot (one or two stores). Summary: lower instruction count + less memory traffic + lower cache usage -> faster code. Alex Davies wrote: > Perhaps. There's at least one other advantage - in a register poor > architecture like x86, it allows a function to have full access to its > callinfo without reserving a second register to point to the CallInfo stack > (assuming a register is already reserved for the TValue stack, which makes > sense). And even on architectures with more registers they then have to > worry then about keeping them valid through growths/shrinks. That's correct. The interpreter needs a single register to point to the stack (BASE). It needs another 3 permanent registers for the current bytecode PC, the opcode dispatch table (DISPATCH) and the pointer to the constants of the current function (KBASE). That leaves us 3 temporary registers on x86 which are needed to execute the 3-operand bytecode (RA, RB and RC). Yup, there's no free register left. =:-) > It would also allow just one bounds test on entering a function, vs the > current two. In Jit every instruction counts... something as minor as that > will show up on recursion tests. Yes, exactly. Now, the one remaining stack limit check is the most costly step for calls (in the interpreter). Maybe I can somehow get rid of it, too (without virtual memory tricks). :-) > Definitely looking forward to playing around with it when it comes out ;) Umm, Alex, please check your mail (or your spam folder). :-) --Mike From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 00:41:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U2ftUS005805; Fri, 30 Oct 2009 00:41:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6842A19416; Fri, 30 Oct 2009 00:40:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03ADE19409 for ; Fri, 30 Oct 2009 00:40:33 -0200 (BRST) Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n9U2fJGv014801; Fri, 30 Oct 2009 11:41:23 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay31.aps.necel.com with ESMTP; Fri, 30 Oct 2009 11:41:23 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay31.aps.necel.com with ESMTP; Fri, 30 Oct 2009 11:41:23 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 0CEB952E1FC; Fri, 30 Oct 2009 11:41:22 +0900 (JST) From: Miles Bader To: Petite Abeille Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <3E878524-824E-4AED-89C8-400C79912614@burninglabs.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 30 Oct 2009 11:41:22 +0900 In-Reply-To: (Petite Abeille's message of "Thu, 29 Oct 2009 21:15:47 +0100") Message-ID: Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille writes: >> It's typical of the American gutter-mentality, I'm afraid. > > "can do" attitude you meant to say? Can do -- in the gutter... :) -Miles -- "Suppose He doesn't give a shit? Suppose there is a God but He just doesn't give a shit?" [George Carlin] From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 00:48:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U2mFcN006372; Fri, 30 Oct 2009 00:48:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B70691941F; Fri, 30 Oct 2009 00:47:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F0FD19414 for ; Fri, 30 Oct 2009 00:46:56 -0200 (BRST) Received: by yxe17 with SMTP id 17so2327129yxe.33 for ; Thu, 29 Oct 2009 19:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hvoMjKXZe+FW6s6JCDh9incnBbdllpnzA4T75GmSTaA=; b=Whuc3sNQvL4Jhhd0+402hVBUvDiZag7+DyXm8c7pQ+wp0poigpl/9RsaEfcoQqD8nc ujyeSQvauLdqEN/I3UbBVKbSLs5XEULNwr2R07Q90zJAB/wezWmyjgsczeftdAdMx4Iw wq4J7Wu0VHFjsvDaGhCEfRbOMvVWAKUCjlf9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=geuAdKLzwJ1F9mIxUcPQwQdPmhC8ZEek6bVxYsgNAVSI1WLv4Ge3Fq7Ob1OpKyho+0 idEsNjnQlEuEfuzfSshiab8WwU4USgA5hMWw9mO4qHc9ov+f4ZKXZWIVWaLLKxb5MjHv ugkGUpoFg2CJD/L4hNn5fELU4jv9JX8SRm5fA= MIME-Version: 1.0 Received: by 10.150.169.19 with SMTP id r19mr1839434ybe.111.1256870866289; Thu, 29 Oct 2009 19:47:46 -0700 (PDT) In-Reply-To: <87hbthucdj.fsf@mid.deneb.enyo.de> References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <87hbthucdj.fsf@mid.deneb.enyo.de> Date: Fri, 30 Oct 2009 13:47:46 +1100 Message-ID: <305dffcb0910291947r219106fdya2d6b355bda31501@mail.gmail.com> Subject: Re: promoting Lua From: Vaughan McAlley To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > More likely Canada, according to the OED's entry on "sucker"; the use > of "to suck" in this sense appears more recent. > That makes sense- the first time I think I heard "sucks" was Wayne's World (1991) with the Canadian Mike Myers. In my mind Wayne and Garth freed it from sexual connotations- innuendo wasn't their thing. It would require a lot of motivation to try Lua, dislike it, not have one's problems helped or a patch referred to by this list, then register luasucks.org. To hate a language that much one would probably have done a large project which came unstuck due to some fundamental (and unfixable) flaw in the language. Most of the discussion in this list seems to be tinkering around the edges (the posts I read anyway!) Otherwise it could be a bored teen who hopefully wouldn't have anything eloquent to say. Vaughan From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 00:51:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U2p2d7006623; Fri, 30 Oct 2009 00:51:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60F0F19423; Fri, 30 Oct 2009 00:49:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C8441941D for ; Fri, 30 Oct 2009 00:49:44 -0200 (BRST) Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n9U2oNDV022617; Fri, 30 Oct 2009 11:50:37 +0900 (JST) Received: from relay11.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay11.aps.necel.com with ESMTP; Fri, 30 Oct 2009 11:50:36 +0900 Received: from dhlpc061 ([10.114.114.39] [10.114.114.39]) by relay11.aps.necel.com with ESMTP; Fri, 30 Oct 2009 11:50:36 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id B28C552E1FC; Fri, 30 Oct 2009 11:50:36 +0900 (JST) From: Miles Bader To: Petite Abeille Subject: Re: promoting Lua References: <4AE9909C.7060807@spellingbeewinnars.org> <4AE9DEF4.3040706@spellingbeewinnars.org> <2bc7f0950910291305ic0bf2edj1578a4b8828d17b9@mail.gmail.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 30 Oct 2009 11:50:36 +0900 In-Reply-To: (Petite Abeille's message of "Thu, 29 Oct 2009 21:12:13 +0100") Message-ID: Lines: 18 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille writes: > E.g. "Yeah, that sucks big time": > > Usage example: > > http://...cksbigtime.blogspot.com/ For anyone thinking of checking that blag out (thinking, perhaps, that it could be a interesting discussion of city planning problems in LA), note that it's a basically filled with long, rambling, racist/xenophobic/homophobic rants.... Oo -Miles -- "... The revolution will be no re-run brothers; The revolution will be live." From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 02:48:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U4m5ot018060; Fri, 30 Oct 2009 02:48:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FE63193A4; Fri, 30 Oct 2009 02:46:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDA741938A for ; Fri, 30 Oct 2009 02:46:38 -0200 (BRST) Received: by pwj9 with SMTP id 9so458665pwj.21 for ; Thu, 29 Oct 2009 21:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=X6bLMCdHBw9/8SA+m42vxVjta1htoGlE/SMkfdZm+o0=; b=Sibdp8sbKnBxDCE8QD6cqjSxkV3A59LSDGZVMytfKEVNYK0PRHJuUijK37OQtLqO/w xwvvbMiqMPczPLBnawUwpBcJouPtaf2fiXGM8/Sjtp706u37vwOfBOOVLy9xOReEDlKa D4G2LhfuVnI67FKQ4QIAm3FZjGjSI5gAZaj1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=EUZIk8yGPu9/ToyjV+BQBoaf73JcW1pLJo/cyAFS607Itq0rwz2hrglECB3sJNOgsr zAADIXMYbO6TWTZgW9TQTxjKp7jmEGo4w1GgSVSNq/egZV19ltR8Fnm0zLZIWKFulM5W HD0gJcCHeQQmrjhSYgSdn+IlLCvuQj4WCwYpU= MIME-Version: 1.0 Received: by 10.142.56.11 with SMTP id e11mr108222wfa.26.1256878052071; Thu, 29 Oct 2009 21:47:32 -0700 (PDT) In-Reply-To: <20091030022824.GA12167@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> Date: Fri, 30 Oct 2009 12:47:31 +0800 X-Google-Sender-Auth: 0d1fbf7d9a69a722 Message-ID: <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Excellent design!!! But I found a bug, or my misunderstanding. gc will treat the BASE[-1] as a number, so the function in BASE[-1] will not be marked by gc. If the BASE[-1] is the only reference to the function, the function will be garbage collected. Then the program will be corrupted. From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 03:11:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U5BbwU020066; Fri, 30 Oct 2009 03:11:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50C1319425; Fri, 30 Oct 2009 03:10:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9A0619421 for ; Fri, 30 Oct 2009 03:10:18 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N3jlY-0002S8-00; Fri, 30 Oct 2009 06:11:12 +0100 Date: Fri, 30 Oct 2009 06:11:04 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091030051104.GA23082@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean tankxx wrote: > Excellent design!!! But I found a bug, or my misunderstanding. > gc will treat the BASE[-1] as a number, so the function in BASE[-1] > will not be marked by gc. If the BASE[-1] is the only reference to the > function, the function will be garbage collected. Then the program > will be corrupted. Good catch -- I've elided this detail in the interest of brevity: The GC has to traverse all frames anyway, since it needs to find the highest frame extent of all frames (*). The function objects are already marked by this pass -- no point in marking them during stack slot traversal, too. (*) A caller (outer function) may have a higher top than a callee (inner function). The extra slots must be cleaned up to avoid a peculiar marking problem: [aa[bb.X| X created. [aa[cc| GC called from (small) inner frame, X destroyed. [aa....X.| GC called again in (larger) outer frame, X resurrected (ouch). During GC in step 2 the stack must be cleaned up to the max. frame extent: ***| Slots cleaned [cc| from top of last frame [aa......| to max. frame extent. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 04:52:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U6qGM8030089; Fri, 30 Oct 2009 04:52:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E649193A4; Fri, 30 Oct 2009 04:50:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E3CFC18D64 for ; Fri, 30 Oct 2009 04:50:51 -0200 (BRST) Received: by pzk34 with SMTP id 34so1836537pzk.11 for ; Thu, 29 Oct 2009 23:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GYsSZqJ/He4khkTO5tm3odNyjg31wk2mqx4yRRZR9gQ=; b=wHrDTknFrdcQa5zkC+mTzuD7P+/PDoCdd4dgPfm/P2PW8moOO1UA3uWY+EvTsMEb4X 0nKpYql222sQuZjus2n1LkPGSnXpyQzuBPWEyPtfGMOeNhgjsp2fCoIIrgoDsxe9KTdu FzYfOw741CryvGw6doQQOPOVFFAPvhvi/idL0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VpJQquyUPTj0ajbj/aG5K5zK85cB60G1O6yiHMwn0WvmAcq1sfL2KvO0ZZ2uCbFKPJ Nb3ayd7umLQqHX3wq3qBw2o6aisrDGmUg1l8G+sTupQy1RaPGl16BgDMsdUyg03DccSh xHAwk94f0v+Z3v0kPMMHJIR0RisY6QEyw1jcY= MIME-Version: 1.0 Received: by 10.142.8.12 with SMTP id 12mr125514wfh.70.1256885504825; Thu, 29 Oct 2009 23:51:44 -0700 (PDT) In-Reply-To: <20091030051104.GA23082@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> Date: Fri, 30 Oct 2009 14:51:44 +0800 Message-ID: <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: CHU Run-min To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean in lgc.c static void traversestack (global_State *g, lua_State *l) { StkId o, lim; CallInfo *ci; markvalue(g, gt(l)); lim = l->top; for (ci = l->base_ci; ci <= l->ci; ci++) { lua_assert(ci->top <= l->stack_last); if (lim < ci->top) lim = ci->top; } for (o = l->stack; o < l->top; o++) markvalue(g, o); for (; o <= lim; o++) setnilvalue(o); checkstacksizes(l, lim); } The call stack will be traversed in gc mark phase, so the BASE[-1] will be treated specially. Though it is a number value, the gc known its internals. So the function object will be marked. May I got the right understanding? From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 05:09:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U79qeR031452; Fri, 30 Oct 2009 05:09:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2471E1A65B; Fri, 30 Oct 2009 05:08:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4FB31A5E5 for ; Fri, 30 Oct 2009 05:08:34 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N3lc0-0002Wn-00; Fri, 30 Oct 2009 08:09:28 +0100 Date: Fri, 30 Oct 2009 08:09:22 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091030070922.GA28084@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean CHU Run-min wrote: > [... Quote from Lua sources deleted ...] > > The call stack will be traversed in gc mark phase, so the BASE[-1] > will be treated specially. Though it is a number value, the gc known > its internals. So the function object will be marked. > May I got the right understanding? Yes, your understanding is correct. But of course the code base of LuaJIT 2.x has diverged quite a bit ... here are the relevant snippets from the code: /* Stack marking. */ TValue *o; for (o = th->stack+1; o < th->top; o++) gc_marktv(g, o); /* Frame marking and finding the max. top of all frames. */ TValue *frame, *top = th->top-1; for (frame = th->base-1; frame > th->stack; frame = frame_prev(frame)) { GCfunc *fn = frame_func(frame); TValue *ftop = frame; if (isluafunc(fn)) ftop += funcproto(fn)->framesize; if (ftop > top) top = ftop; gc_markobj(g, frame_gc(frame)); } if (top > th->maxstack) top = th->maxstack; --Mike From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 05:36:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U7a6ov001052; Fri, 30 Oct 2009 05:36:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4F3B19326; Fri, 30 Oct 2009 05:34:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C8AE192AD for ; Fri, 30 Oct 2009 05:34:43 -0200 (BRST) Received: by pwj9 with SMTP id 9so520944pwj.21 for ; Fri, 30 Oct 2009 00:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=18iNGnr/H+WVyCHxo3JgKAI6y0q25WeFoTEmrpkO6d4=; b=pNICHdew+Oa73ke24pUFT/+bcYTAa5hL6sOlr/dNJJl3R8q7p1SujuxI0tKlpUzwlD gY6qlkVRCTs70I+LyPKJWfeDDpSToV4FZRf8p8kRJI6GlfhV1JJWZHzU9Dt8yYJCMonB 0lip5nS/A3tRl0B5m380HxbLYECSXtbEKX9fg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Y/nsZMVnAlADMmM2axMz/+6Te89ib48cvK5mmWgqmYGbc8zPPr+W1F35LbEsm8hC6U 7IRv9198a74c8oXuEK4LIVNwVS9gmFK77RSk/6w80yzXhfALTyli+95xiZIwp5bZ/gCW xzp/kJfLYHHrT0CF0J82xqZpOXMkqujeDFCJQ= MIME-Version: 1.0 Received: by 10.142.250.42 with SMTP id x42mr118850wfh.345.1256888136491; Fri, 30 Oct 2009 00:35:36 -0700 (PDT) In-Reply-To: <20091030070922.GA28084@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> Date: Fri, 30 Oct 2009 15:35:36 +0800 X-Google-Sender-Auth: b02f92d61c202d7c Message-ID: <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9U7a6ov001052 The calling convention is so well designed that using the function slot inplace. May you post the code snippets about frame handling that corresponding ldo.c? I want to dig into the details about all kinds of frame links. :) From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 05:46:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9U7kTd5001944; Fri, 30 Oct 2009 05:46:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F84B1938A; Fri, 30 Oct 2009 05:45:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10F1B19315 for ; Fri, 30 Oct 2009 05:45:11 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N3mBR-0002ZR-00; Fri, 30 Oct 2009 08:46:05 +0100 Date: Fri, 30 Oct 2009 08:45:15 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091030074515.GA6700@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <3c7535c80910282135s6d6c1243wb00f9737f16a7e59@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean tankxx wrote: > The calling convention is so well designed that using the function > slot inplace. May you post the code snippets about frame handling that > corresponding ldo.c? > I want to dig into the details about all kinds of frame links. :) Well, it's heavily-macroized assembler ... but here you go: |->gate_lf: // Call gate for fixarg Lua functions. | // RA = new base, RB = LFUNC, RC = nargs+1, (BASE = old base), PC = return | // DISPATCH initialized | mov BASE, RA | mov PROTO:RB, LFUNC:RB->pt | mov [BASE-4], PC // Store caller PC. <=== !! | movzx RA, byte PROTO:RB->framesize | mov PC, PROTO:RB->bc | mov KBASE, PROTO:RB->k | mov L:RB, SAVE_L | lea RA, [BASE+RA*8] // Top of frame. | lea RC, [BASE+NARGS:RC*8-4] // Points to tag of 1st free slot. | cmp RA, L:RB->maxstack | ja ->gate_lf_growstack | mov RB, LJ_TNIL |1: // Clear free slots until top of frame. | mov [RC], RB | mov [RC+8], RB | add RC, 16 | cmp RC, RA | jb <1 | ins_next --Mike From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 10:51:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UCpM0w009779; Fri, 30 Oct 2009 10:51:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0ED419445; Fri, 30 Oct 2009 10:49:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.ucrony.net (mail.ucrony.net [212.43.82.249]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 176231943C for ; Fri, 30 Oct 2009 10:49:38 -0200 (BRST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: startx@plentyfact.org) with ESMTPSA id 509053DE323 Date: Fri, 30 Oct 2009 12:50:47 +0000 From: startx To: lua@bazar2.conectiva.com.br Subject: lua and webdav? Message-ID: <20091030125047.00e7915c@worthil> In-Reply-To: References: X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.2; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hello. i was wondering if anybody has tried to implement a basic library to use (secure) webdav from a lua script? would it be possible to implement something like this using luasocket? my understanding of webdav is still quite basic so im rather not the person to do so. startx From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 10:57:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UCvCps010928; Fri, 30 Oct 2009 10:57:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 558DA1944A; Fri, 30 Oct 2009 10:55:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70E6F192AA for ; Fri, 30 Oct 2009 10:55:49 -0200 (BRST) Received: by gxk26 with SMTP id 26so165848gxk.1 for ; Fri, 30 Oct 2009 05:56:43 -0700 (PDT) Received: by 10.150.39.28 with SMTP id m28mr3017208ybm.8.1256907403708; Fri, 30 Oct 2009 05:56:43 -0700 (PDT) Received: from two ([71.21.67.37]) by mx.google.com with ESMTPS id 4sm1099279ywg.58.2009.10.30.05.56.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Oct 2009 05:56:42 -0700 (PDT) Date: Fri, 30 Oct 2009 06:56:32 -0600 From: phoenix To: lua@bazar2.conectiva.com.br Subject: Re: lua and webdav? Message-ID: <20091030065632.5748976a@two> In-Reply-To: <20091030125047.00e7915c@worthil> References: <20091030125047.00e7915c@worthil> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 30 Oct 2009 12:50:47 +0000 startx wrote: > hello. > > i was wondering if anybody has tried to implement > a basic library to use (secure) webdav from a lua script? > > would it be possible to implement something like this using luasocket? > my understanding of webdav is still quite basic so im rather > not the person to do so. There's no better way to learn. From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 11:47:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UDiLaP022174; Fri, 30 Oct 2009 11:44:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7830A19446; Fri, 30 Oct 2009 11:42:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp127.rog.mail.re2.yahoo.com (smtp127.rog.mail.re2.yahoo.com [206.190.53.32]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9677F19425 for ; Fri, 30 Oct 2009 11:42:48 -0200 (BRST) Received: (qmail 3545 invoked from network); 30 Oct 2009 13:43:41 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp127.rog.mail.re2.yahoo.com with SMTP; 30 Oct 2009 06:43:41 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: OQi_4A0VM1lZ02Ws3G2nSY5uV0.L5bz9xg11_iVTzI3zlXcbJEUoKzRWw7Bu_mJgLA-- X-Yahoo-Newman-Property: ymail-3 Message-ID: From: "Kenk" To: "Lua list" References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two> In-Reply-To: <20091030065632.5748976a@two> Subject: Userdata and deleting... Date: Fri, 30 Oct 2009 09:43:33 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi there, I'm just looking for a 'best-practice' scenario here... Say I've got user data all setup and Lua's happily using it. If for whatever reason that user data becomes deleted in C code (for example, a window closing, or a routine called that deletes an element in the collection that Lua happens to have a reference to somewhere else in script).... What's the best way of setting this userdata to nil in C and then telling Lua it's no longer around? In script I'd set the variable to nil... Not sure how I'd go about that from C. Thanks! From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 12:05:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UE4x8u029711; Fri, 30 Oct 2009 12:05:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7044A19401; Fri, 30 Oct 2009 12:03:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1EDC193D5 for ; Fri, 30 Oct 2009 12:03:26 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:59346) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1N3s5P-0007E2-Nh (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Fri, 30 Oct 2009 14:04:15 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N3s5P-0003K8-AE (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Fri, 30 Oct 2009 14:04:15 +0000 Date: Fri, 30 Oct 2009 14:04:15 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: lua@bazar2.conectiva.com.br Subject: LPEG tweaks Message-ID: User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have a few tweaks to LPEG (mainly to re.lua) which I'd like to share. There's a patch at the end of this message. I've changed the identifier syntax to allow underscores, which is compatible with Bryan Ford's standard PEG syntax. I've added a .. operator to make it easy to search for matches. I chose it so that raw lpeg can support a similar feature by overloading Lua's .. operator. However the re.lua version is actually a prefix operator so you can just write .. instead of "" .. to match without a left anchor. I allow bare identifiers in the right hand side of grammar definitions. They are equivalent to %identifier if the identifier has an entry in the definitions table passed to re.compile(), otherwise they are equivalent to . It also supports the lpeg.locale() predefined patterns but not re.lua's short %a versions because that would interfere with using many single-letter grammer non-terminals. I like the following tweaks to the lpeg metatable: local lpeg_mt = getmetatable(lpeg.P(0)) lpeg_mt.__mod = lpeg.Cf function lpeg_mt.__concat (a,b) return a * lpeg.P{ b + 1 * lpeg.V(1) } end Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. --- lua-5.1.4/etc/re.lua 2008-10-11 20:21:05.000000000 +0000 +++ lua-5.1.4/etc/re.lua 2009-10-29 16:12:30.000000000 +0000 @@ -30,6 +30,11 @@ error(msg, 2) end +local function search (p) + -- shorter than (1 - p)^0 * p + return m.P{ p + 1 * m.V(1) } +end + local function mult (p, n) local np = m.P(true) while n >= 1 do @@ -49,7 +54,7 @@ local S = (m.S(" \t\n") + "--" * (any - m.S"\n")^0)^0 -local name = m.R("AZ", "az") * m.R("AZ", "az", "09")^0 +local name = m.R("AZ", "az", "__") * m.R("AZ", "az", "__", "09")^0 local exp_follow = m.P"/" + ")" + "}" + ":}" + "~}" + name + -1 @@ -71,6 +76,10 @@ return cat end +local BareID = Identifier / function (n,Defs) + return (Defs and Defs[n]) or (#n > 2 and Predef[n]) or m.V(n) +end + local Range = m.Cs(any * (m.P"-"/"") * (any - "]")) / m.R local item = Cat + Range + m.C(any) @@ -102,6 +111,7 @@ * (#exp_follow + patt_error); Prefix = "&" * S * m.V"Prefix" / mt.__len + "!" * S * m.V"Prefix" / mt.__unm + + ".." * S * m.V"Prefix" / search + m.V"Suffix"; Suffix = m.Cf(m.V"Primary" * S * ( ( m.P"+" * m.Cc(1, mt.__pow) @@ -128,7 +138,8 @@ + "{~" * m.V"Exp" * "~}" / m.Cs + "{" * m.V"Exp" * "}" / m.C + m.P"." * m.Cc(any) - + "<" * name * ">" / m.V; + + "<" * name * ">" / m.V + + BareID * ("" - S * "<-"); Definition = Identifier * S * '<-' * m.V"Exp"; Grammar = m.Cf(m.V"Definition" / firstdef * m.Cg(m.V"Definition")^0, adddef) / m.P From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 12:39:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UEdkHw004010; Fri, 30 Oct 2009 12:39:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 744B21934E; Fri, 30 Oct 2009 12:38:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36C67192C8 for ; Fri, 30 Oct 2009 12:38:16 -0200 (BRST) Received: by bwz27 with SMTP id 27so3642960bwz.21 for ; Fri, 30 Oct 2009 07:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Ojlyb1jveOi7gzUa0dO2JLBj6bw/ruT9pW1UgpCXwoY=; b=QhAp6EMGaYaZRmyu4L4G2DdbqrNef+Uv0AcMYWC1Oba0Nt1oy35s2QonuGRt12kJ28 EuQov5KZDLnTd4/IyPz7/Uda6qHSdC55ccBJcbDYYHaOdt9As5en+GEaKIoKjjJAV4ao VB1I9r+FITf9tvYour8IUG8IHSUkWmtNoG1j0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=OxgP7t19N59WT/T8vEEddjRtI30CfFhjBrA3rlWBXpfMxO2WY8GfzNEISItXZHo1fp kAfYyLbBVp/I7AWh6edc8o3J7T1KiOhi74DAfUTlmi5eypEfYFzHiruIJulmwN8QNn9n QWsD0bQYXgjnY30u7L3k551zig8ymBkktlvM8= MIME-Version: 1.0 Received: by 10.223.6.196 with SMTP id a4mr195218faa.94.1256913550092; Fri, 30 Oct 2009 07:39:10 -0700 (PDT) In-Reply-To: References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two> From: liam mail Date: Fri, 30 Oct 2009 14:38:50 +0000 Message-ID: <173d86e00910300738i28ca8675i2777376061204e62@mail.gmail.com> Subject: Re: Userdata and deleting... To: Lua list Content-Type: multipart/alternative; boundary=001517475f1caaa940047727fd20 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517475f1caaa940047727fd20 Content-Type: text/plain; charset=ISO-8859-1 2009/10/30 Kenk > Hi there, > > I'm just looking for a 'best-practice' scenario here... Say I've got user > data all setup and Lua's happily using it. If for whatever reason that user > data becomes deleted in C code (for example, a window closing, or a routine > called that deletes an element in the collection that Lua happens to have a > reference to somewhere else in script).... What's the best way of setting > this userdata to nil in C and then telling Lua it's no longer around? In > script I'd set the variable to nil... Not sure how I'd go about that from C. > > Thanks! > > It is the same principle. Say for example you have a full userdata stored as a global in Lua then: lua_pushstrings, ud_name); lua_pushnil(s); lua_settable(s, LUA_GLOBALSINDEX); --001517475f1caaa940047727fd20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/10/30 Kenk <kenk@heroesent.com>
Hi there,

=A0 I'm just looking for a 'best-practice' scenario here... Sa= y I've got user data all setup and Lua's happily using it. If for w= hatever reason that user data becomes deleted in C code (for example, a win= dow closing, or a routine called that deletes an element in the collection = that Lua happens to have a reference to somewhere else in script).... What&= #39;s the best way of setting this userdata to nil in C and then telling Lu= a it's no longer around? In script I'd set the variable to nil... N= ot sure how I'd go about that from C.

Thanks!

=A0
It is the same principle. Say for example you have= a full userdata stored as a global in Lua then:
lua_pushstr= ings, ud_name);
lua_pushnil(s);
lua_settable(s, LUA_GLOBALSINDE= X);
--001517475f1caaa940047727fd20-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 12:49:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UEnQdD006178; Fri, 30 Oct 2009 12:49:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1AD1193A8; Fri, 30 Oct 2009 12:48:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD666192F2 for ; Fri, 30 Oct 2009 12:48:05 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so1422324fgg.17 for ; Fri, 30 Oct 2009 07:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ec5YTiIqjV489QwepFVL8pDiDmXWNhGEo5rjiZ495h8=; b=daqAPEnE8HmNo5C2zZRve7S7V5helSCDySqd2QXjx4FuzdziDt/CEVp6ZKqJAHabbs fIv17lFUeMUZNl0jpIoAYJR0Ef1jjulPhVoOQqcFMzOWJK6GsYa3sgBVw/s/w1vmg5SQ H1yMqyHw+Vb+P6LeJBMIU240V3hC3w2TfoECI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SAeQsiTHrMkzMWOV6JDI/Ee1w0PZXNQwGd6Gu0K6pLvnshzU56KYLmbgwnCYWwWms8 8UKR3AKl4mWzN40LmkRaFI9uoqTZralifbXGFgC8dc8hiPnDVupCcNC/Zkkb6Ic0LKJJ dBA5Ved6nCKg+R4vUfnNRKOX7K2mA4mGtrfbc= MIME-Version: 1.0 Received: by 10.223.127.195 with SMTP id h3mr231835fas.57.1256914138801; Fri, 30 Oct 2009 07:48:58 -0700 (PDT) In-Reply-To: References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two> Date: Fri, 30 Oct 2009 14:48:58 +0000 Message-ID: Subject: Re: Userdata and deleting... From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UEnQdD006178 On Fri, Oct 30, 2009 at 1:43 PM, Kenk wrote: > Hi there, > >   I'm just looking for a 'best-practice' scenario here... Say I've got user > data all setup and Lua's happily using it. If for whatever reason that user > data becomes deleted in C code (for example, a window closing, or a routine > called that deletes an element in the collection that Lua happens to have a > reference to somewhere else in script).... What's the best way of setting > this userdata to nil in C and then telling Lua it's no longer around? In > script I'd set the variable to nil... Not sure how I'd go about that from C. > > Thanks! > > > There is no easy way to force all instances of a particular userdata to nil. What I would suggest instead is to change the metatable of the "deleted" userdata to one that throws an error in its __index metamethod, etc. Alternatively, you could set the pointer held by the userdata to NULL, and check that the pointer is not NULL before you do anything with it (this is what Lua's "file" objects do). -Duncan From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 12:50:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UEohQN006471; Fri, 30 Oct 2009 12:50:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3824119412; Fri, 30 Oct 2009 12:49:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from starling.antixlabs.com (starling.antixlabs.com [212.36.36.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E4FF4193DD for ; Fri, 30 Oct 2009 12:49:20 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by starling.antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N3sns-0005Sz-7S for lua@bazar2.conectiva.com.br; Fri, 30 Oct 2009 14:50:12 +0000 Message-ID: <4AEAFD21.7040601@cowlark.com> Date: Fri, 30 Oct 2009 14:50:09 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Userdata and deleting... References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kenk wrote: [...] > I'm just looking for a 'best-practice' scenario here... Say I've got > user data all setup and Lua's happily using it. If for whatever reason > that user data becomes deleted in C code (for example, a window closing, > or a routine called that deletes an element in the collection that Lua > happens to have a reference to somewhere else in script).... What's the > best way of setting this userdata to nil in C and then telling Lua it's > no longer around? In script I'd set the variable to nil... Not sure how > I'd go about that from C. Userdatas are owned by Lua, so only Lua is allowed to allocate or free them. This means that *Lua* needs to manage them. The upshot of this is that if you have a resource that's owned by C and which will be freed by C, then you're going to need to do work. Common techniques are: - - if the C resource is reference counted, then increase the reference count when you give it to Lua and decrease the reference count when it's garbage collected --- this means the resource won't be freed until Lua's finished with it. - - change your ownership model so that the C resources is only ever freed from Lua's GC method; this way the resource never goes away while Lua is using it. - - don't give Lua access to the raw resource, but instead work through an indirection table --- this means that when the resource goes away you can remove the entry from the table and know that Lua won't try to access the raw resource. What technique you pick depends very much on how your app works, I'm afraid... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "To be is to do" -- Nietzche │ "To do is to be" -- Sartre │ "Do be do be do" -- Sinatra -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrq/RoACgkQf9E0noFvlzglqACg1Szp/RXaMSVIGFH8FBSziXqk SiMAn2eiHUEwWYIk0hf5btJs/4qUq7jY =a7Y5 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 13:14:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UFESv0011049; Fri, 30 Oct 2009 13:14:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAFE11938B; Fri, 30 Oct 2009 13:12:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5247A184EF for ; Fri, 30 Oct 2009 13:12:21 -0200 (BRST) Received: by bwz27 with SMTP id 27so3679598bwz.21 for ; Fri, 30 Oct 2009 08:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=owwd2DGs7ngUetyx2OMkpHOmPwJiUnAQJy2a9pbFMT4=; b=v9aWTE1cAK7pf4QAC+ya4e/X0knG1X6xmPYhjIDt6KKVUqnaPMyGyRb7lOs0CvHS6q bDW/sRtCa1D1uYu/7QJ0itW+7vuWnQ9CxuXT3JtW3e994FOWtp97322qLrsnxG0lyMHw pQecv+0Ocxej1EeLEYfJvDk2Lde+1At+1B5B4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=O/fQEZevUOmyYHvIxX0kI89IJ8eEhaA9VHXomkJYC2b4+g6f3See15IgYx4oNyVs0N JT3Fx2s8x0x4j5jDAuRq7HSgvZzN8f2AO+qHkzonmEA6jmj9+kJfpjyOOe1QPVuBPO/P W2fbo7d10e2cLu+yCidISJgo8Xq88Xdmfp27U= MIME-Version: 1.0 Received: by 10.103.125.36 with SMTP id c36mr681273mun.126.1256915584977; Fri, 30 Oct 2009 08:13:04 -0700 (PDT) Date: Fri, 30 Oct 2009 17:13:04 +0200 Message-ID: Subject: my 2c about ... From: Jasper Cook To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e65bcd34f48d920477287611 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e65bcd34f48d920477287611 Content-Type: text/plain; charset=ISO-8859-1 Hello list As a 15 year old jazz trumpeter on the road with seasoned, grown-up jazz "blowers" in 1959, I remember LMAO at one blower saying about another (sax player) "he sucks", probably because he had a very small sound, or perhaps nothing to "say" through his horn. I think those musicians probably enjoyed feeling its "sexual breeze", but, if they did, it didn't show on their worldly, but often inscrutable, laugh-lined faces. It may well have been in use in jazz circles before 1959, but I didn't see it in jazz books from before. It might have occurred in "Miles", I can't remember. Miles Davis played in the 40s thru 90s, but the book itself was published mid 90s, if I remember correctly. After about when I heard it in 1959, the saying "he sucks" became very common in jazz circles. By the 70s, it started to emerge more generally, by the 90s, it was about things, too: "that sucks" could just as easily by then have been said about a slow motor cycle. regards Jasper Cook --0016e65bcd34f48d920477287611 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello list

As a 15 year old jazz trumpeter on the road with seasoned= , grown-up jazz "blowers" in 1959, I remember LMAO at one blower = saying about another (sax player) "he sucks", probably because he= had a very small sound, or perhaps nothing to "say" through his = horn.=A0 I think those musicians probably enjoyed feeling its "sexual = breeze", but, if they did, it didn't show on their worldly, but of= ten inscrutable, laugh-lined faces.=A0 It may well have been in use in jazz= circles before 1959, but I didn't see it in jazz books from before.=A0= It might have occurred in "Miles", I can't remember.=A0 Mil= es Davis played in the 40s thru 90s, but the book itself was published mid = 90s, if I remember correctly.

After about when I heard it in 1959, the saying "he sucks" be= came very common in jazz circles.=A0 By the 70s, it started to emerge more = generally, by the 90s, it was about things, too: "that sucks" cou= ld just as easily by then have been said about a slow motor cycle.

regards
Jasper Cook
--0016e65bcd34f48d920477287611-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 13:15:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UFFiav011452; Fri, 30 Oct 2009 13:15:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2DDE193E7; Fri, 30 Oct 2009 13:14:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp109.rog.mail.re2.yahoo.com (smtp109.rog.mail.re2.yahoo.com [68.142.225.207]) by bazar2.conectiva.com.br (Postfix) with SMTP id 532B1184EF for ; Fri, 30 Oct 2009 13:14:00 -0200 (BRST) Received: (qmail 76954 invoked from network); 30 Oct 2009 15:14:46 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp109.rog.mail.re2.yahoo.com with SMTP; 30 Oct 2009 08:14:46 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: qdKjqdAVM1nAhkzvTrEEq4P_eiaHJrKeW9qsc0fD1NKEmxpRWHdS8PKv_pkj0ipoxg-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <762D4C93325948539DD2CA748400B983@MobileDev> From: "Kenk" To: "Lua list" References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two> <4AEAFD21.7040601@cowlark.com> In-Reply-To: <4AEAFD21.7040601@cowlark.com> Subject: Re: Userdata and deleting... Date: Fri, 30 Oct 2009 11:14:38 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Great comments, thanks guys... This gives me a better understanding on how to approach it. From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 13:20:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UFKeqm012634; Fri, 30 Oct 2009 13:20:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C3671A669; Fri, 30 Oct 2009 13:19:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B17F1941B for ; Fri, 30 Oct 2009 13:19:00 -0200 (BRST) Received: by qyk4 with SMTP id 4so1696100qyk.33 for ; Fri, 30 Oct 2009 08:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=BHeGsNYmjN8uOyq2P3kbPj2fHZKRVQPQ7XPzkUj3i2U=; b=LOOMgYYpVhrGBpSjCYYQvLZhFR3UTfZceT1AGxF0RJQs4xSPrFnAG2nmDhd7K/ztsL qgYD1Lp2puAhZhQLbq4/7w575Q8h+kjN3bnLjwj6nZj0OnHCr2kXUAMRzw8yJQf7gziQ XzhGT/c8KpkJ9LAtvidhvVPTtS4kwJ+95Cqnk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=LIPU/3/KjmexfIcVuIp/lRRxRNBbqAmiGg/dTxeVfskdNVGMPMbZnPpx3fffREI0TC gHgPMDXdQN+UTbi0aoKsoDdtCZ33azP92vOHW9TdQWhr11kks7W0fDR9JdlZKnDmJ9Zx nxWsOzNDNi2XcEbD4hhh5rA/ZclL8KG13uJtY= MIME-Version: 1.0 Received: by 10.229.13.213 with SMTP id d21mr228151qca.45.1256915992542; Fri, 30 Oct 2009 08:19:52 -0700 (PDT) In-Reply-To: References: From: Norman Clarke Date: Fri, 30 Oct 2009 12:19:27 -0300 Message-ID: Subject: Re: my 2c about ... To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UFKeqm012634 On Fri, Oct 30, 2009 at 12:13 PM, Jasper Cook wrote: > Hello list > > As a 15 year old jazz trumpeter on the road with seasoned, grown-up jazz > "blowers" in 1959, I remember LMAO at one blower saying about another (sax > player) "he sucks", probably because he had a very small sound, or perhaps > nothing to "say" through his horn.  I think those musicians probably enjoyed > feeling its "sexual breeze", but, if they did, it didn't show on their > worldly, but often inscrutable, laugh-lined faces.  It may well have been in > use in jazz circles before 1959, but I didn't see it in jazz books from > before.  It might have occurred in "Miles", I can't remember.  Miles Davis > played in the 40s thru 90s, but the book itself was published mid 90s, if I > remember correctly. > > After about when I heard it in 1959, the saying "he sucks" became very > common in jazz circles.  By the 70s, it started to emerge more generally, by > the 90s, it was about things, too: "that sucks" could just as easily by then > have been said about a slow motor cycle. > > regards > Jasper Cook Thanks, as a language and etymology nerd, I find this to be one of the most interesting OT posts I've read on any list in a long time. :-) From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 13:58:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UFwUjX022548; Fri, 30 Oct 2009 13:58:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A10E1A600; Fri, 30 Oct 2009 13:57:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C06519092 for ; Fri, 30 Oct 2009 13:56:59 -0200 (BRST) Received: by qyk4 with SMTP id 4so1717367qyk.33 for ; Fri, 30 Oct 2009 08:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=1HjXZuFSBb+6CXJTZJosA0NXKrIKPiQYm5IjQnblfmY=; b=r5XYChUf6dqNcGRyAbZ5KDxrl2YvV+0RZFPYncaxIhYtBjQRwLSoVtdO2qtIZdeCxX z0KlcTs8/u57cQl+e63UjlmRRzsdXLNHSqnGkwxxqK1JLjDjr9cXfIX9DWqa4E0K0+50 1StajUhCeVxTmoU7BmDv6rfgBKZtOuDC31utU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qwdGK+AcsHUSjGzAkD35drmb6U3MuWEgTXawd/L+kvKfwwLp0XApLsJWVrocKDR6Dg ZDbuhVOXH8rfObBHXNpcGsEXif2MevN+8aS/1XGxyAhDGBZ/A9j2B8+sHPs7QbC++7Z5 aLeJoUXcFN3IKdtcJnYhog1ty9P+ghtrZghMI= MIME-Version: 1.0 Received: by 10.224.86.227 with SMTP id t35mr1081206qal.121.1256918271484; Fri, 30 Oct 2009 08:57:51 -0700 (PDT) In-Reply-To: References: Date: Fri, 30 Oct 2009 09:57:51 -0600 Message-ID: <88e4f940910300857l592c0d67m7cd623cc4ccf65b7@mail.gmail.com> Subject: Re: my 2c about ... From: Timothy McDowell To: Lua list Content-Type: multipart/alternative; boundary=00c09f8a4f221563ef0477291700 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09f8a4f221563ef0477291700 Content-Type: text/plain; charset=ISO-8859-1 You suck. On Fri, Oct 30, 2009 at 9:19 AM, Norman Clarke wrote: > On Fri, Oct 30, 2009 at 12:13 PM, Jasper Cook wrote: > > > Hello list > > > > As a 15 year old jazz trumpeter on the road with seasoned, grown-up jazz > > "blowers" in 1959, I remember LMAO at one blower saying about another > (sax > > player) "he sucks", probably because he had a very small sound, or > perhaps > > nothing to "say" through his horn. I think those musicians probably > enjoyed > > feeling its "sexual breeze", but, if they did, it didn't show on their > > worldly, but often inscrutable, laugh-lined faces. It may well have been > in > > use in jazz circles before 1959, but I didn't see it in jazz books from > > before. It might have occurred in "Miles", I can't remember. Miles > Davis > > played in the 40s thru 90s, but the book itself was published mid 90s, if > I > > remember correctly. > > > > After about when I heard it in 1959, the saying "he sucks" became very > > common in jazz circles. By the 70s, it started to emerge more generally, > by > > the 90s, it was about things, too: "that sucks" could just as easily by > then > > have been said about a slow motor cycle. > > > > regards > > Jasper Cook > > Thanks, as a language and etymology nerd, I find this to be one of the > most interesting OT posts I've read on any list in a long time. :-) > -- --Brains. --00c09f8a4f221563ef0477291700 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You suck.

On Fri, Oct 30, 2009 at 9:19 AM= , Norman Clarke <c= ompay@gmail.com> wrote:
On Fri, Oct 30, 2009 at 12:13 PM, Jasper = Cook <jazcook@gmail.com> wro= te:

> Hello list
>
> As a 15 year old jazz trumpeter on the road with seasoned, grown-up ja= zz
> "blowers" in 1959, I remember LMAO at one blower saying abou= t another (sax
> player) "he sucks", probably because he had a very small sou= nd, or perhaps
> nothing to "say" through his horn.=A0 I think those musician= s probably enjoyed
> feeling its "sexual breeze", but, if they did, it didn't= show on their
> worldly, but often inscrutable, laugh-lined faces.=A0 It may well have= been in
> use in jazz circles before 1959, but I didn't see it in jazz books= from
> before.=A0 It might have occurred in "Miles", I can't re= member.=A0 Miles Davis
> played in the 40s thru 90s, but the book itself was published mid 90s,= if I
> remember correctly.
>
> After about when I heard it in 1959, the saying "he sucks" b= ecame very
> common in jazz circles.=A0 By the 70s, it started to emerge more gener= ally, by
> the 90s, it was about things, too: "that sucks" could just a= s easily by then
> have been said about a slow motor cycle.
>
> regards
> Jasper Cook

Thanks, as a language and etymology nerd, I find this to be one= of the
most interesting OT posts I've read on any list in a long time. :-)



--
--Brains.
--00c09f8a4f221563ef0477291700-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 14:08:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UG8E2r025221; Fri, 30 Oct 2009 14:08:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5CE11A669; Fri, 30 Oct 2009 14:06:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDC5819372 for ; Fri, 30 Oct 2009 14:06:41 -0200 (BRST) Received: by ewy26 with SMTP id 26so3202130ewy.5 for ; Fri, 30 Oct 2009 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=sToSQMVlfk1IA+SHLc+uA3c8VDvrfgeFfz4um5ZF/A8=; b=DeR+Ep/aO2OarHmAIkBYI5LwV/9lWU35Kz2NVgnLpSyLq2OSSzU9fPFSIEUS0U3lQq kIQgNrZ405JeuhA4YI9ujBxtr1S0lGQePdGC5Yv+nUkHJVlt59ERX4Xi6r7PwzgdQ4z0 +5bfJpMKOgLplUQt2a4onWCmsMge6N3uwWLoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UcEm3kfCEfcPHqFjBL+U8HVKBj2GLcsuUMCRlgiqNg1LF46hzw1NaSTQY2Wdque4QH bahl/MqvZdcZzc07+SgCcxHjU1abdUl9D2eqoCS87VqmjBtZwX73fUK3GU010SrDKHh6 FQeH2g8d2wTc2QwMJbCrYYLjURmEmPktUbS8k= MIME-Version: 1.0 Received: by 10.216.93.69 with SMTP id k47mr639446wef.179.1256918853891; Fri, 30 Oct 2009 09:07:33 -0700 (PDT) In-Reply-To: <20091030125047.00e7915c@worthil> References: <20091030125047.00e7915c@worthil> Date: Fri, 30 Oct 2009 09:07:33 -0700 Message-ID: <17eac67c0910300907v59512630q4fa6f545d8a996d9@mail.gmail.com> Subject: Re: lua and webdav? From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You could bind this into lua: http://www.webdav.org/neon/ or maybe even find some bindings around. search the list archives, I think this has been mentioned before. Sam From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 14:59:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UGx9fH006328; Fri, 30 Oct 2009 14:59:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2E6D1A671; Fri, 30 Oct 2009 14:57:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 076821A600 for ; Fri, 30 Oct 2009 14:57:33 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so2790557fgg.17 for ; Fri, 30 Oct 2009 09:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lbPwqdIEPMonbV1IuLQe5ycpZGoznw/WIr9+DmcMiak=; b=tmEEOIgUH+JFtNZrWUXYwISK0tbpcU+W+9P15tTOXtsCJpitaAB0Zuj+astxj3281T UymfrnmVHFrwKP5G8iiLVzVLuDGCpMcmVCTssS4mo1b+HSGFp+7iq81MUDt0//pg3dI+ fLrKbPMG/XYvLpFy68Qyaiyu06GNcOGtKfBtA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jTQL0GMUyAG/BgVNnc8eUP+7X0PNxD/2xbIIKNL7HoGv20sJWthCu0Ehb8yj1eisDT 68ZWovmBq7qwI/DXVfbE9kpu3XcPcnHFvkM5bazPwwTsvnr7GD1mybKRv4iqKot5tvIQ SvqcTd9sZz+yR3WVIwfL6Jf5UrkzmdsUtbx/U= MIME-Version: 1.0 Received: by 10.223.127.198 with SMTP id h6mr226467fas.102.1256921907103; Fri, 30 Oct 2009 09:58:27 -0700 (PDT) In-Reply-To: <88e4f940910300857l592c0d67m7cd623cc4ccf65b7@mail.gmail.com> References: <88e4f940910300857l592c0d67m7cd623cc4ccf65b7@mail.gmail.com> Date: Fri, 30 Oct 2009 16:58:27 +0000 Message-ID: <6a3ae47e0910300958he7025d5pb0b374a391f577af@mail.gmail.com> Subject: Re: my 2c about ... From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=00235453068cc88a5c047729efb3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00235453068cc88a5c047729efb3 Content-Type: text/plain; charset=UTF-8 Primus sucks! On Fri, Oct 30, 2009 at 3:57 PM, Timothy McDowell wrote: > You suck. > > > On Fri, Oct 30, 2009 at 9:19 AM, Norman Clarke wrote: > >> On Fri, Oct 30, 2009 at 12:13 PM, Jasper Cook wrote: >> >> > Hello list >> > >> > As a 15 year old jazz trumpeter on the road with seasoned, grown-up jazz >> > "blowers" in 1959, I remember LMAO at one blower saying about another >> (sax >> > player) "he sucks", probably because he had a very small sound, or >> perhaps >> > nothing to "say" through his horn. I think those musicians probably >> enjoyed >> > feeling its "sexual breeze", but, if they did, it didn't show on their >> > worldly, but often inscrutable, laugh-lined faces. It may well have >> been in >> > use in jazz circles before 1959, but I didn't see it in jazz books from >> > before. It might have occurred in "Miles", I can't remember. Miles >> Davis >> > played in the 40s thru 90s, but the book itself was published mid 90s, >> if I >> > remember correctly. >> > >> > After about when I heard it in 1959, the saying "he sucks" became very >> > common in jazz circles. By the 70s, it started to emerge more >> generally, by >> > the 90s, it was about things, too: "that sucks" could just as easily by >> then >> > have been said about a slow motor cycle. >> > >> > regards >> > Jasper Cook >> >> Thanks, as a language and etymology nerd, I find this to be one of the >> most interesting OT posts I've read on any list in a long time. :-) >> > > > > -- > --Brains. > --00235453068cc88a5c047729efb3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Primus sucks!

On Fri, Oct 30, 2009 at 3:5= 7 PM, Timothy McDowell <tmcdowell@gmail.com> wrote:
You suck.


On Fri, Oct 30, 2009 at 9:19 AM, Norman Clarke <compay@gmail.com>= wrote:
On Fri, Oct 30, 2009 at 12:13 PM, Jasper Cook <jazcook@gmail.com>= ; wrote:

> Hello list
>
> As a 15 year old jazz trumpeter on the road with seasoned, grown-up ja= zz
> "blowers" in 1959, I remember LMAO at one blower saying abou= t another (sax
> player) "he sucks", probably because he had a very small sou= nd, or perhaps
> nothing to "say" through his horn.=C2=A0 I think those music= ians probably enjoyed
> feeling its "sexual breeze", but, if they did, it didn't= show on their
> worldly, but often inscrutable, laugh-lined faces.=C2=A0 It may well h= ave been in
> use in jazz circles before 1959, but I didn't see it in jazz books= from
> before.=C2=A0 It might have occurred in "Miles", I can't= remember.=C2=A0 Miles Davis
> played in the 40s thru 90s, but the book itself was published mid 90s,= if I
> remember correctly.
>
> After about when I heard it in 1959, the saying "he sucks" b= ecame very
> common in jazz circles.=C2=A0 By the 70s, it started to emerge more ge= nerally, by
> the 90s, it was about things, too: "that sucks" could just a= s easily by then
> have been said about a slow motor cycle.
>
> regards
> Jasper Cook

Thanks, as a language and etymology nerd, I find this to be one= of the
most interesting OT posts I've read on any list in a long time. :-)



--
--Brains.

--00235453068cc88a5c047729efb3-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 15:57:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UHvo8V026990; Fri, 30 Oct 2009 15:57:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2488D1903D; Fri, 30 Oct 2009 15:56:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73A3E18F06 for ; Fri, 30 Oct 2009 15:56:21 -0200 (BRST) MailScanner-NULL-Check: 1257530233.29546@7QKjZBlwX1P807bxKjLraQ Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n9UHvAAS027691 for ; Fri, 30 Oct 2009 15:57:12 -0200 Message-ID: <4AEB28E7.3000507@inconcertcc.com> Date: Fri, 30 Oct 2009 15:56:55 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Issues with Lunar while using multiple lunar templated objects. References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> In-Reply-To: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sivan Thiruvengadam wrote: > Hi, > class CLObject { > public: > > // Constants > static const char className[]; > static Luna< CLObject >::RegType methods[]; > .. > *int GetType(lua_State *L);//(unsigned char&cType);* > *int GetListofNumbers(lua_State *L);* Please show your CLObject::methods[] array. Is GetType defined there? From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 16:06:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UI6eRj029125; Fri, 30 Oct 2009 16:06:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B97AF190DD; Fri, 30 Oct 2009 16:05:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C55F18FF0 for ; Fri, 30 Oct 2009 16:05:16 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.34] ([92.104.14.51]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSC0013NA96L210@asmtp011.mac.com> for lua@bazar2.conectiva.com.br; Fri, 30 Oct 2009 11:06:05 -0700 (PDT) Message-id: <26BF1D2F-8D9D-4E07-806A-C3B85B67D2BD@mac.com> From: Petite Abeille To: Lua list In-reply-to: <20091030125047.00e7915c@worthil> Subject: Re: lua and webdav? Date: Fri, 30 Oct 2009 19:05:29 +0100 References: <20091030125047.00e7915c@worthil> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 30, 2009, at 1:50 PM, startx wrote: > i was wondering if anybody has tried to implement > a basic library to use (secure) webdav from a lua script? No, but this should be rather straightforward. Alternatively, most modern OSs can mount WebDAV servers directly as remote volumes (e.g. davfs, etc). > would it be possible to implement something like this using luasocket? > my understanding of webdav is still quite basic so im rather > not the person to do so. FWIW, Nanoki implements the server side of WebDAV: http://dev.alt.textdrive.com/browser/HTTP/WikiDAV.txt http://dev.alt.textdrive.com/browser/HTTP/WikiDAV.lua You can see it in action by connection to Nanoki's online demo through any type of WebDAV client, e.g. your favorite OS: dav://svr225.stepx.com:3388/ From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:08:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UK8JFV026162; Fri, 30 Oct 2009 18:08:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C51C1A677; Fri, 30 Oct 2009 18:06:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 034F81A671 for ; Fri, 30 Oct 2009 18:06:41 -0200 (BRST) Received: by pzk34 with SMTP id 34so2205236pzk.11 for ; Fri, 30 Oct 2009 13:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Q5oAve48IyrXwIA9s94JllnBPzSzA7exikb43ltyEUs=; b=j9bDzaEAIp33KHL7o+bQJNqvPy72af4Z+jcGgd5JCpIiF3RbxoI7MBXcVBDKEO7UCn Y/d0mgz1OYoc9jiT0R5eSg9m59PMPiZCH6M+0Id7GcGwb1EEkJ2Jf9lyvKn3ddbn3a4V 8hE6J5tF6F3J6Fe5L6HsdAILzoJUQB4jtCWfE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wFbSKA7z/8k59jWBmebMZaggKobsoJb1lJ/5CZ4zQ46ldyADUSSr9paw8dzrgw5Mow /zfmMT8C7vUAfBSq476aCaLN0RrokZzYXaLKgB1MONqJwpgyoHhfGhSCQl5lxi2MCdSc KLR0okq/ceIavpdQJbE2Pl9I+ZUcgahqwoyws= MIME-Version: 1.0 Received: by 10.115.102.9 with SMTP id e9mr1451027wam.199.1256933254486; Fri, 30 Oct 2009 13:07:34 -0700 (PDT) In-Reply-To: <4AEB28E7.3000507@inconcertcc.com> References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> Date: Fri, 30 Oct 2009 15:07:34 -0500 Message-ID: <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> Subject: Re: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=0016e64f807023d9f604772c9407 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64f807023d9f604772c9407 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes. Its being defined there. const char CLObject::className[] =3D "CLObject"; Luna< CLObject >::RegType CLObject::methods[] =3D { method(CLObject, GetType), method(CLObject, GetListofNumbers), method(CLObject, Instance), {0,0} }; 2009/10/30 Ignacio Burgue=F1o > Sivan Thiruvengadam wrote: > >> Hi, >> > > class CLObject { >> public: >> >> // Constants >> static const char className[]; >> static Luna< CLObject >::RegType methods[]; >> .. >> *int GetType(lua_State *L);//(unsigned char&cType);* >> *int GetListofNumbers(lua_State *L);* >> > > > Please show your CLObject::methods[] array. Is GetType defined there? > > > --0016e64f807023d9f604772c9407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yes. Its being defined there.

const char=A0CLObject::className[] =3D= "CLObject";<= /div>
Luna<=A0CLObject=A0>::RegType=A0CLObject::methods[] =3D {
metho= d(CLObject, =A0GetType),
metho= d(CLObject, =A0GetListofNumbers),
metho= d(CLObject, =A0Instance= ),
{0,0}
};


2009/10/30 Ignacio Burgue=F1o <ignaciob@inconcertcc.com>
Sivan Thiruvengadam wrote:
Hi,

class CLObject {
public:

// Constants
static const char className[];
static Luna< CLObject >::RegType methods[];
..
*int GetType(lua_State *L);//(unsigned char&cType);*
*int GetListofNumbers(lua_State *L);*


Please show your CLObject::methods[] array. Is GetType defined there?



--0016e64f807023d9f604772c9407-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:14:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKEYHl027288; Fri, 30 Oct 2009 18:14:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB2A81A67A; Fri, 30 Oct 2009 18:13:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D92F1A673 for ; Fri, 30 Oct 2009 18:13:01 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 78742170C510 for ; Fri, 30 Oct 2009 16:13:55 -0400 (EDT) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id n9UKDtAA020244 for lua@bazar2.conectiva.com.br; Fri, 30 Oct 2009 16:13:55 -0400 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Fri, 30 Oct 2009 16:13:55 -0400 From: Sean Conner To: Lua list Subject: Re: Using lua_yield with common C functions Message-ID: <20091030201355.GA5754@brevard.conman.org> References: <9e264e780910291435r5beebbcbkc0147eefd54ec405@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e264e780910291435r5beebbcbkc0147eefd54ec405@mail.gmail.com> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Peter LaDow once stated: > I've spend the last several hours pouring through the archives trying > to understand the interaction between lua_resume, lua_yield, and > coroutines. The problem I'm having is that when I have multiple > scripts running in separate threads, only the last created thread > seems to run correctly. > > This is my initial foray into coroutines. Initially I used pthreads, > but I thought the overhead of threads wasn't worth it, so I'm trying > out this method. This seems far more straightforward, cleaner, and > more efficient. But I'm not getting something with using lua_resume > and lua_yield. I'd prefer not to use Coco, and I'm not even sure it > is necessary in this case. I'm sure I'm misunderstanding something. I recently finished a project using Lua threads (extending a network daemon---sockets handled by C, logic by Lua) here's what works for me, and I'll concentrate primarily on the Lua side of things (and skimp on the error handling as it would only cloud the issue at hand). First, I initialize Lua: g_L = lua_open(); /*------------------------------------- ; do I need the GCSTOP/GCRESTART? I saw ; the lua interpreter do it, so I was ; unsure enough to include it here ;---------------------------------------*/ lua_gc(g_L,LUA_GCSTOP,0); luaL_loadlibs(g_L); lua_gc(g_L,LUA_GCRESTART,0); /*--------------------------------------- ; create a table to store references to ; userdata and coroutines ;------------------------------------*/ lua_newtable(g_L); lua_setglobal(g_L,"sockets"); /*------------------------------------------ ; load the script and make sure it's okay ; error handling of lua_pcall() omitted ... ;-------------------------------------------*/ luaL_loadfile(g_L,scriptfile); rc = lua_pcall(g_L,0,LUA_MULTRET,0); The easy stuff is out of the way. The program then waits for a network connection, and upon a connection, some userdata is created, a Lua thread is created, and we call a predefined Lua function. When that returns, we handle the result, and go back into the main loop of the program (written in C). void newluathread(void) { lua_State *new; UserData *n; /*--------------------------------------------- ; after each command, I show the stack of ; each state at the end of the command. Top ; of stack is to the right ;--------------------------------------------*/ lua_getglobal(g_L,"sockets"); /* g_L = ( sockets ) */ new = lua_newthread(g_L); /* g_L = ( sockets new ) */ lua_getglobal(new,"main"); /* function we'll be calling */ /* new = ( main ) n = lua_newuserdata(new,sizeof(UserData)); /* ( main n ) */ lua_getglobal(new,"sockets"); /* new = (main n sockets) */ lua_pushvalue(new,-2); /* new = (main n sockets n ) */ n->userref = luaL_ref(new,-2); /* new = (main n sockets ) */ lua_pop(new,1); /* new = (main n ) */ n->coref = luaL_ref(g_L,-2); /* g_L = ( sockets ) */ lua_pop(g_L,1); /* g_L = ( ) */ /*-------------------------------------------------- ; at this point, we save n on a list, but that's ; not important to this dicussion, but just note ; that we have a reference to it. ;-------------------------------------------------*/ n->L = new; rc = lua_resume(new,1); /* start main(userdata) */ if (rc == 0) thread_exit(n); /* we'll get to this later */ else if (rc != LUA_YIELD) /* error - handle as needed */ else thread_schedule(n); /* we'll get to this later */ } Note that I save a reference to the userdata and coroutine in the global table "sockets". This is to keep the garbage collection from reclaiming the space before we're done. Now, I too, have a few routines that call lua_yield() (in my case, whenever you read from a socket, or maybe even write to a socket, if everything can't be written in one shot). Those functions tend to look a bit like: int function(lua_State *L) { UserData *n; luaL_checkudata(L,1); n = lua_touserdata(L,1); /*----------------------------- ; do whatever processing ;------------------------------*/ if (takes_too_long) { n->state = WAITING_FOR_WIDGET; return lua_yield(L,0); } else return items_to_return; } Oh, I should mention that each C function that does yield sets a state in the userdata structure indicating what it's waiting for (so I know what to return when whatever what the thread is waiting for is available). Now, onto the two functions thread_schedule() and thread_exit(): void thread_schedule(UserData *n) { switch(n->state) { case WAITING_FOR_WIDGET: case WAITING_FOR_GADGET: case WAITING_FOR_GODOT: /* put n into a waiting queue */ break; case RUNNING: /* put n into a run queue */ break; } } void thread_exit(UserData *n) { /* remove n from any queue it might be in */ /* free any resources allocated from C */ /* and stored in n as well ... */ /*-------------------------------------------- ; remove the references to the userdata and ; coroutine from our global table ;--------------------------------------------*/ lua_getglobal(g_L,"sockets"); luaL_unref(g_L,-1,n->sockref); luaL_unref(g_L,-1,n->coref); lua_pop(g_L,1); /*----------------------------------------- ; purely optional, but I do this since the ; program as a whole is a long lived daemon ; and I might as well do it now. ;------------------------------------------*/ lua_gc(g_L,LUA_GCCOLLECT,0); } The only thing left to do is show the main loop of the program, which I'll kind of summarize here: while(1) { if (run_queue_length > 0) timeout = 0; /* return if no events */ else timeout = INDEFINITE; /*--------------------------------------------------------------- ; check for events, and handle them (say, WIDGET #2 is now ready, ; Godot returns, etc). The code in wait_for_various_events() ; will find the appropriate userdata, and set the state ; appropriately (or even create a new thread). There's lots of ; handwaving here because I don't want to overwhelm the example ; with a ton of extraneous, non-Lua based details. ;--------------------------------------------------------------*/ wait_for_various_events(timeout); /*--------------------------------------------------- ; We now might have threads scheduled to run ... so ; run the first one on the queue ... ;---------------------------------------------------*/ if (run_queue_length > 0) { n = remove_first_item(run_queue); rc = lua_resume(n->L,lua_gettop(n->L)); if (rc == 0) thread_exit(n); else if (rc != LUA_YIELD) /* error */ else thread_schedule(n); } } The way I've set this up is that the Lua code can call coroutine.yield() and it will still work properly (only that thread will then get rescheduled to run---I use a simple round-robin scheduler). I should also note that the C code is single-threaded and all the "multi-threading" is purely Lua coroutines. Also note than when you call lua_newthread() you basically get a copy of the global state, so any global variable changed in one Lua thread is instantly visible in any other Lua thread, so tread carefully. I've found that what I've done works. It may not be the best way to do it, but it works. Hope this helps some. -spc From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:44:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKhvhK032149; Fri, 30 Oct 2009 18:43:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BDE818890; Fri, 30 Oct 2009 18:42:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B23121886D for ; Fri, 30 Oct 2009 18:42:23 -0200 (BRST) Received: (qmail 5996 invoked by uid 399); 30 Oct 2009 14:43:14 -0600 Received: from unknown (HELO ?192.168.1.2?) (jjensen@workspacewhiz.com@70.192.236.64) by hsmail.qwknetllc.com with ESMTPAM; 30 Oct 2009 14:43:14 -0600 X-Originating-IP: 70.192.236.64 Message-ID: <4AEB4FDC.9050406@workspacewhiz.com> Date: Fri, 30 Oct 2009 14:43:08 -0600 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: Lua list Subject: The shortest possible sequence match with Lua regular expressions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I ran into this today, and while I tried to explain it away, I have to admit I am mildly confused. Why does the following match the entire string "/dev/myprog/image/xyz/"? =string.match('/dev/myprog/image/xyz/', '(/.-/)$) The documentation states that a - (minus) matches the shortest possible sequence. I hadn't given this any thought until today, as I normally would have written '.+(/.-/)$'. That would have yielded the correct result of '/xyz/'. When discussing it with a coworker, though, he raised the point that with the final / (slash) anchored at the end of the string, the shortest possible matching sequence should be '/xyz/'. I can buy into that argument. What are we missing? Thanks! Josh From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:53:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKrIW5001565; Fri, 30 Oct 2009 18:53:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F0E2188E9; Fri, 30 Oct 2009 18:51:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E38081888A for ; Fri, 30 Oct 2009 18:51:45 -0200 (BRST) Received: by bwz27 with SMTP id 27so4037711bwz.21 for ; Fri, 30 Oct 2009 13:52:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.50.25 with SMTP id c25mr853346muk.10.1256935958467; Fri, 30 Oct 2009 13:52:38 -0700 (PDT) In-Reply-To: <4AEB4FDC.9050406@workspacewhiz.com> References: <4AEB4FDC.9050406@workspacewhiz.com> Date: Fri, 30 Oct 2009 15:52:38 -0500 Message-ID: <90eb1dc70910301352o29094beas962064cfd055de1a@mail.gmail.com> Subject: Re: The shortest possible sequence match with Lua regular expressions From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UKrIW5001565 On Fri, Oct 30, 2009 at 3:43 PM, Joshua Jensen wrote: > I ran into this today, and while I tried to explain it away, I have to admit > I am mildly confused. > > Why does the following match the entire string "/dev/myprog/image/xyz/"? > > =string.match('/dev/myprog/image/xyz/', '(/.-/)$) > > The documentation states that a - (minus) matches the shortest possible > sequence. > > I hadn't given this any thought until today, as I normally would have > written '.+(/.-/)$'.  That would have yielded the correct result of '/xyz/'. >   When discussing it with a coworker, though, he raised the point that with > the final / (slash) anchored at the end of the string, the shortest possible > matching sequence should be '/xyz/'. > > I can buy into that argument.  What are we missing? i haven't looked at the code; so i guess that backtracking (to 'move' the first slash of the pattern to another slash of the target string) happens only when there's no possible match. if it always tried backtracking just to see if there's a shorter match, you'd quickly get exponential time for almost any pattern. -- Javier From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:53:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKrmnr001679; Fri, 30 Oct 2009 18:53:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A9AF1892D; Fri, 30 Oct 2009 18:52:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35A94188EF for ; Fri, 30 Oct 2009 18:52:01 -0200 (BRST) Received: by ewy11 with SMTP id 11so3389225ewy.35 for ; Fri, 30 Oct 2009 13:52:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.86.212 with SMTP id w62mr790819wee.131.1256935974766; Fri, 30 Oct 2009 13:52:54 -0700 (PDT) In-Reply-To: <4AEB4FDC.9050406@workspacewhiz.com> References: <4AEB4FDC.9050406@workspacewhiz.com> Date: Fri, 30 Oct 2009 20:52:54 +0000 X-Google-Sender-Auth: bff5daf2e3696df3 Message-ID: Subject: Re: The shortest possible sequence match with Lua regular expressions From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UKrmnr001679 With the pattern '(/.-/)$', you're asking Lua to match a forward slash, then match as few characters as possible such that what then follows is a forward slash followed by the end of the string. After the first forward slash in the pattern is matched against the first forward slash in the input, the minimum amount which can be captured to get a forward slash followed by the end of the input is the entire of the input. On Fri, Oct 30, 2009 at 8:43 PM, Joshua Jensen wrote: > I ran into this today, and while I tried to explain it away, I have to admit > I am mildly confused. > > Why does the following match the entire string "/dev/myprog/image/xyz/"? > > =string.match('/dev/myprog/image/xyz/', '(/.-/)$) > > The documentation states that a - (minus) matches the shortest possible > sequence. > > I hadn't given this any thought until today, as I normally would have > written '.+(/.-/)$'.  That would have yielded the correct result of '/xyz/'. >   When discussing it with a coworker, though, he raised the point that with > the final / (slash) anchored at the end of the string, the shortest possible > matching sequence should be '/xyz/'. > > I can buy into that argument.  What are we missing? > > Thanks! > > Josh > From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:54:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKsEev001825; Fri, 30 Oct 2009 18:54:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 482EF188EF; Fri, 30 Oct 2009 18:52:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A20D91888A for ; Fri, 30 Oct 2009 18:52:09 -0200 (BRST) Received: by iwn5 with SMTP id 5so2475499iwn.11 for ; Fri, 30 Oct 2009 13:53:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.153.69 with SMTP id j5mr1524635ibw.33.1256935981796; Fri, 30 Oct 2009 13:53:01 -0700 (PDT) In-Reply-To: <4AEB4FDC.9050406@workspacewhiz.com> References: <4AEB4FDC.9050406@workspacewhiz.com> Date: Fri, 30 Oct 2009 16:53:01 -0400 Message-ID: <790db3550910301353j1290be05ob92183a8e8eeafe2@mail.gmail.com> Subject: Re: The shortest possible sequence match with Lua regular expressions From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UKsEev001825 On Fri, Oct 30, 2009 at 4:43 PM, Joshua Jensen wrote: > I ran into this today, and while I tried to explain it away, I have to admit > I am mildly confused. > > Why does the following match the entire string "/dev/myprog/image/xyz/"? > > =string.match('/dev/myprog/image/xyz/', '(/.-/)$) > > The documentation states that a - (minus) matches the shortest possible > sequence. > > I hadn't given this any thought until today, as I normally would have > written '.+(/.-/)$'.  That would have yielded the correct result of '/xyz/'. >   When discussing it with a coworker, though, he raised the point that with > the final / (slash) anchored at the end of the string, the shortest possible > matching sequence should be '/xyz/'. > > I can buy into that argument.  What are we missing? .- will only backtrack if the portion of the pattern following it (/$) all fail for all characters after the current position. The shortest sequence simply means that it will attempt to match using the least amount of characters first. This is naturally different from a greedy repetition which will try to match using the most amount of characters first. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 18:56:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UKu3Gp002219; Fri, 30 Oct 2009 18:56:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C6D718E78; Fri, 30 Oct 2009 18:54:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7405F188AE for ; Fri, 30 Oct 2009 18:54:39 -0200 (BRST) MailScanner-NULL-Check: 1257540932.10744@0gKfC6S9M+ye741p0594mA Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n9UKtR4N010886 for ; Fri, 30 Oct 2009 18:55:27 -0200 Message-ID: <4AEB52B0.4040604@inconcertcc.com> Date: Fri, 30 Oct 2009 18:55:12 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Issues with Lunar while using multiple lunar templated objects. References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> In-Reply-To: <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sivan Thiruvengadam wrote: > Yes. Its being defined there. > > const char CLObject::className[] = "CLObject"; > Luna< CLObject >::RegType CLObject::methods[] = { > method(CLObject, GetType), > method(CLObject, GetListofNumbers), > method(CLObject, Instance), > {0,0} > }; > So this works: CLObjectInstance = CLObjectI:new() CLObjectInstance:GetType() but this does not: CLObjectInstance = CLObjectI:new() local clnumlist1 = CLObjectInstance: GetListofNumbers() CLObjectInstance:GetType() Am I right? If so, what does the constructor of CLNumList do? I fear it is messing with 'self'. From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 19:09:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UL9Q7C004362; Fri, 30 Oct 2009 19:09:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1978A19172; Fri, 30 Oct 2009 19:08:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7353118A22 for ; Fri, 30 Oct 2009 19:07:56 -0200 (BRST) Received: by pzk34 with SMTP id 34so2232070pzk.11 for ; Fri, 30 Oct 2009 14:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=AQAsJxAK2NBDUQ3RHn7f44oELHgXwYjNLsMJhk3Aw/I=; b=RE1DIx4J+wqyc5UwRxM94EXb1DV1J5ls/JDRamWDNSjdksOZy6TGlkta+dClbwKM+2 HQy6vtsAjKGQieCHtZv2eKZDKs27B/jyoacdHTaRZYsvFbNOqVcBqs5s/e/JUfPvhIdb iqSGPhmV2J+W8NTXhehGcNDLleELg6359sj6Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Fo088a9A5SyEpoHr6oz7nRjbkv18M7xh8iMaJxTULC1QwB7ty3cNJUPxpLHO8zj7qL DIjVswqNJoNmDcaGcaq+oNcZJyAdDPqGKrwZ5XElPlEceRWmAeL22p5l8IzqaodeYfQB PmIj8ZrJ2iQvWJYKXLd7lBv04r97l+F6V1WgA= MIME-Version: 1.0 Received: by 10.114.252.14 with SMTP id z14mr1576150wah.84.1256936928923; Fri, 30 Oct 2009 14:08:48 -0700 (PDT) In-Reply-To: <4AEB52B0.4040604@inconcertcc.com> References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> Date: Fri, 30 Oct 2009 16:08:48 -0500 Message-ID: <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> Subject: Re: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=0016e687872a27514804772d6f0e X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e687872a27514804772d6f0e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ignacio, * * Yes, you are absolutely right. CLNumList:: CLNumList(lua_State *L) { if (lua_isuserdata(L,1)) { CLNL*t =3D static_cast< CLNL*>(lua_touserdata(L, 1)); real_object =3D new CNumList(*t->pT->real_object); } else real_object =3D new CNumList(); } Thanks 2009/10/30 Ignacio Burgue=F1o > Sivan Thiruvengadam wrote: > >> Yes. Its being defined there. >> >> const char CLObject::className[] =3D "CLObject"; >> Luna< CLObject >::RegType CLObject::methods[] =3D { >> method(CLObject, GetType), >> method(CLObject, GetListofNumbers), >> method(CLObject, Instance), >> {0,0} >> }; >> >> > So this works: > CLObjectInstance =3D CLObjectI:new() > CLObjectInstance:GetType() > > but this does not: > > CLObjectInstance =3D CLObjectI:new() > local clnumlist1 =3D CLObjectInstance: GetListofNumbers() > CLObjectInstance:GetType() > > Am I right? > > If so, what does the constructor of CLNumList do? I fear it is messing wi= th > 'self'. > > > --0016e687872a27514804772d6f0e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I= gnacio,

Yes, you are absolutely right.=A0
CLNumList::=A0CLNumList(lua_State *L)
{
= =A0=A0 =A0 =A0=A0 = if (lua_isuserdata(L,1))
=A0{=

CLNL*t= =3D static_cast<=A0CLNL*>(lua_touserdata(L, 1));
real= _object =3D new CNumList(*t->pT->real_object);

=A0}
=A0else
= =A0 real_object =3D new=A0CNumList();
}

Thanks


2009/10/30 Ignacio Burgue=F1o= <ignaciob= @inconcertcc.com>
Sivan Thiruvengadam wrote:
Yes. Its being defined there.

const char CLObject::className[] =3D "CLObject";
Luna< CLObject >::RegType CLObject::methods[] =3D {
method(CLObject, =A0GetType),
method(CLObject, =A0GetListofNumbers),
method(CLObject, =A0Instance),
{0,0}
};


So this works:
CLObjectInstance =3D CLObjectI:new()
CLObjectInstance:GetType()

but this does not:

CLObjectInstance =3D CLObjectI:new()
local clnumlist1 =3D CLObjectInstance: GetListofNumbers()
CLObjectInstance:GetType()

Am I right?

If so, what does the constructor of CLNumList do? I fear it is messing with= 'self'.



--0016e687872a27514804772d6f0e-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 19:31:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ULVBSC007515; Fri, 30 Oct 2009 19:31:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B1D9183E1; Fri, 30 Oct 2009 19:29:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp116.rog.mail.re2.yahoo.com (smtp116.rog.mail.re2.yahoo.com [68.142.225.232]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9C2E018E78 for ; Fri, 30 Oct 2009 19:29:32 -0200 (BRST) Received: (qmail 80463 invoked from network); 30 Oct 2009 21:30:26 -0000 Received: from CPE0008743bfa80-CM0018c0c0f0ec.cpe.net.cable.rogers.com (kenk@99.236.26.122 with login) by smtp116.rog.mail.re2.yahoo.com with SMTP; 30 Oct 2009 14:30:26 -0700 PDT X-Yahoo-SMTP: fjetMD.swBBMG4cdu4hQawamBhEt3mMxhiIRTveoijddSCg- X-YMail-OSG: 1qQFUkcVM1kZwv9k1Nx3iMWCe2N6YBiNRGoSTcwKd9BC_c76QKYlGaKzIEkPnE6HlQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <8C4A98D7D33B4A5383704AAC8E3D64A4@MobileDev> From: "Kenk" To: "Lua list" References: <20091030125047.00e7915c@worthil> <20091030065632.5748976a@two><4AEAFD21.7040601@cowlark.com> <762D4C93325948539DD2CA748400B983@MobileDev> In-Reply-To: <762D4C93325948539DD2CA748400B983@MobileDev> Subject: Missing something here...__Index override... Date: Fri, 30 Oct 2009 17:30:26 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean So I'm overriding the __index call of my script object that wraps my C user data... Short example below... How do I get the prototype call to pass in the instance of my object as the first param (like it does when I reference with : ) ...? So far the only way I can call it is my table.prototype[key] ... LuaWindow = { instanceName="", prototype = nil } function LuaWindow.new(o) LuaWindow.instanceName = o.instanceName; LuaWindow.prototype = --Create my C object with metatable here setmetatable(o,LuaWindow); return o; end LuaWindow.__index = function (table,key) if LuaWindow[key] ~= nil then return LuaWindow[key]; else --How do I get it to call the method and pass in the first param here? I'm trying : but Lua complains -- return LuaWindow.prototype[key]; return table.prototype[key]; end end mainWindow = LuaWindow.new{instanceName="newWndObject"}; --This method will be passed to the C object since it doesn't exist in the script object mainWindow:ShowWindow(); From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 19:33:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9ULX8UW007936; Fri, 30 Oct 2009 19:33:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45242193A0; Fri, 30 Oct 2009 19:31:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50DF119398 for ; Fri, 30 Oct 2009 19:31:40 -0200 (BRST) MailScanner-NULL-Check: 1257543155.4112@Cm+1jtE5jyfgwh5ltALjhw Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id n9ULWXCS023777 for ; Fri, 30 Oct 2009 19:32:33 -0200 Message-ID: <4AEB5B61.2010100@inconcertcc.com> Date: Fri, 30 Oct 2009 19:32:17 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Issues with Lunar while using multiple lunar templated objects. References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> In-Reply-To: <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sivan Thiruvengadam wrote: > Ignacio, > * > * > Yes, you are absolutely right. > > CLNumList:: CLNumList(lua_State *L) > { > if (lua_isuserdata(L,1)) > { > > CLNL*t = static_cast< CLNL*>(lua_touserdata(L, 1)); > real_object = new CNumList(*t->pT->real_object); > > } > else > real_object = new CNumList(); > } > I think that is the problem. See, the constructor of CLNumList is assuming that at stackpos 1 there is a CLNumList. In the case of your call to GetListofNumbers, at that position there is an instance of CLObject. I fail to see how that ends up messing the Lua side of things, but I think it is definitely wrong. Could you just use push(L, new CLNumList) in GetListofNumbers ? Something like: CLObject :GetListofNumbers(lua_State *L)// { CLNumList*o = new CLNumList(); // initialize it properly with the corresponding CNumList pointer CLNumList::push(L, o); return 1; } From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 21:27:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UNR1jU022346; Fri, 30 Oct 2009 21:27:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25C4D19319; Fri, 30 Oct 2009 21:25:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 922C0192E6 for ; Fri, 30 Oct 2009 21:25:29 -0200 (BRST) Received: by pwj9 with SMTP id 9so912130pwj.21 for ; Fri, 30 Oct 2009 16:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bMUg9J32nv9V6FtARCaWYgsun0zXFaAhWXOP3RlAxXk=; b=ZtX8Hdk+C+nVjF2yVs/XWAZHijnAduEZ80vs22v4tiEobY7FD5dkmSq0alEzWYGuGz xlBs3AZDOalrUAK8HI6orkQqT8hKcqJ1qnvL2nsZdcaNCTSQnxen1SdW7aY8pXPBgb2w sr7iZhluH4iJ3uCsFkcDFuiQuT7fA2awNRyTQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fiVdzFC2spiUPQWAHzvEm5MHf39CfPFKrdnjd5EQTUXLC/qHphmvirUN+FWnoIdSwB iV6mxvOV6SbYGBv8IbI33Htm7WKdxUc5NJt0vfXVaSMr3o1gjJzfdGoTAbyiiTBGE8jB DbaL7dJbwWa7DuxeXTNALhDHmzvSxSECKq4Zo= MIME-Version: 1.0 Received: by 10.115.84.10 with SMTP id m10mr1665467wal.100.1256945182906; Fri, 30 Oct 2009 16:26:22 -0700 (PDT) In-Reply-To: <4AEB5B61.2010100@inconcertcc.com> References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> <4AEB5B61.2010100@inconcertcc.com> Date: Fri, 30 Oct 2009 18:26:22 -0500 Message-ID: <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> Subject: Re: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=001636417d1321197304772f5bdb X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636417d1321197304772f5bdb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks. Let me change this by pushing the object as you suggest and see if things work as expected. BTW, I always hit the else part of the CLNumList constructor, since i am no= t passing any CLNumList instance from LUA. I will update you as soon as i test this. Thanks once again 2009/10/30 Ignacio Burgue=F1o > Sivan Thiruvengadam wrote: > >> Ignacio, >> * >> * >> Yes, you are absolutely right. >> CLNumList:: CLNumList(lua_State *L) >> { >> if (lua_isuserdata(L,1)) >> { >> >> CLNL*t =3D static_cast< CLNL*>(lua_touserdata(L, 1)); >> real_object =3D new CNumList(*t->pT->real_object); >> >> } >> else >> real_object =3D new CNumList(); >> } >> >> > I think that is the problem. See, the constructor of CLNumList is assumin= g > that at stackpos 1 there is a CLNumList. > In the case of your call to GetListofNumbers, at that position there is a= n > instance of CLObject. I fail to see how that ends up messing the Lua side= of > things, but I think it is definitely wrong. > > Could you just use push(L, new CLNumList) in GetListofNumbers ? > > > Something like: > > CLObject :GetListofNumbers(lua_State *L)// > { > CLNumList*o =3D new CLNumList(); > // initialize it properly with the corresponding CNumList pointer > CLNumList::push(L, o); > return 1; > } > > > --001636417d1321197304772f5bdb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks. =A0

Let me change this by pushing the= object as you suggest and see if things work as expected.=A0
BTW,=A0I always hit the else part of the CLNumList constructor,= since i am not passing any CLNumList instance from LUA.

I will update you as soon as i test this.
Thanks once again


2009/10/30 Ignacio Burgue=F1o <ignaciob@inconcertcc.com>
Sivan Thiruvengadam wrote= :
Ignacio,
*
*
Yes, you are absolutely right.
CLNumList:: CLNumList(lua_State *L)
{
=A0 =A0 =A0 =A0if (lua_isuserdata(L,1))
=A0{

CLNL*t =3D static_cast< CLNL*>(lua_touserdata(L, 1));
real_object =3D new CNumList(*t->pT->real_object);

=A0}
=A0else
=A0real_object =3D new CNumList();
}


I think that is the problem. See, the constructor of CLNumList is assuming = that at stackpos 1 there is a CLNumList.
In the case of your call to GetListofNumbers, at that position there is an = instance of CLObject. I fail to see how that ends up messing the Lua side o= f things, but I think it is definitely wrong.

Could you just use push(L, new CLNumList) in GetListofNumbers ?


Something like:

CLObject :GetListofNumbers(lua_State *L)//
{
=A0CLNumList*o =3D new CLNumList();
// initialize it properly with the corresponding CNumList pointer
=A0CLNumList::push(L, o);
return 1;
}



--001636417d1321197304772f5bdb-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 21:37:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UNbGcZ023748; Fri, 30 Oct 2009 21:37:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9490E19351; Fri, 30 Oct 2009 21:35:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A34618EBE for ; Fri, 30 Oct 2009 21:35:33 -0200 (BRST) Received: by pxi2 with SMTP id 2so2239338pxi.11 for ; Fri, 30 Oct 2009 16:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=UuRWz//FMF/nEWVC6PXb2FA9M+rqr7OyL7jTxXR1E10=; b=UrgaUEUX95cHQF1PSGrpuOp+C4mbuicBYDxdmdfHEI0SzrcsRbuDTMmJejaAsrBNle HOygrIfjhwV4dbinYpAAFxDP6/QW985mdKqeal5cmC93Z0bqe4jRvG0voakuVYDNhZx7 vMw7g60tLV3ZW7L4eAHvOqdFjyoL1A8yEukPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Cs37S73cRfIElRZPxH6y7D5r9nQ7t3056gQ1N1A5CI5EBmKZ0iNEgn3gt9KztV0ryg QPzzHuelnTNNofqjxOlp0n9Tg73/Kkye/LeTF98IdNOZUxbAEbxcJAbh1aNnyLePqdsB 5sNFIKCQAdsO8/PGWesmUu7+veyapx5zPVPDc= MIME-Version: 1.0 Received: by 10.115.81.21 with SMTP id i21mr1671363wal.125.1256945785578; Fri, 30 Oct 2009 16:36:25 -0700 (PDT) In-Reply-To: <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> <4AEB5B61.2010100@inconcertcc.com> <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> Date: Fri, 30 Oct 2009 18:36:25 -0500 Message-ID: <7fa0608b0910301636x5a2984c7g544b2733af99d3c9@mail.gmail.com> Subject: Re: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=0016e64de80e0d24d704772f7ff2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64de80e0d24d704772f7ff2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I changed the method as you suggested CLObject :*GetListofNumbers*(lua_State *L)// { * CLNumList*o =3D new CLNumList(L); CLNL*ud =3D static_cast< CLNL*>(lua_newuserdata(L, sizeof(CLNumList))); // create new userdata real_object->GetListofNumbers(*o->real_object); //CLObject ud->pT =3D o; // lua_pushlightuserdata(L, ud); // luaL_getmetatable(L, NUMLIST ); // lua_setmetatable(L, -2); * *CLNumList::push(L, o);* *return 1;* *}* i am receiving this error C2039: 'push' : is not a member of 'CLNumList' On Fri, Oct 30, 2009 at 6:26 PM, Sivan Thiruvengadam wrot= e: > Thanks. > > Let me change this by pushing the object as you suggest and see if things > work as expected. > > BTW, I always hit the else part of the CLNumList constructor, since i am > not passing any CLNumList instance from LUA. > > I will update you as soon as i test this. > > Thanks once again > > > 2009/10/30 Ignacio Burgue=F1o > >> Sivan Thiruvengadam wrote: >> >> Ignacio, >>> * >>> * >>> Yes, you are absolutely right. >>> CLNumList:: CLNumList(lua_State *L) >>> { >>> if (lua_isuserdata(L,1)) >>> { >>> >>> CLNL*t =3D static_cast< CLNL*>(lua_touserdata(L, 1)); >>> real_object =3D new CNumList(*t->pT->real_object); >>> >>> } >>> else >>> real_object =3D new CNumList(); >>> } >>> >>> >> I think that is the problem. See, the constructor of CLNumList is assumi= ng >> that at stackpos 1 there is a CLNumList. >> In the case of your call to GetListofNumbers, at that position there is = an >> instance of CLObject. I fail to see how that ends up messing the Lua sid= e of >> things, but I think it is definitely wrong. >> >> Could you just use push(L, new CLNumList) in GetListofNumbers ? >> >> >> Something like: >> >> CLObject :GetListofNumbers(lua_State *L)// >> { >> CLNumList*o =3D new CLNumList(); >> // initialize it properly with the corresponding CNumList pointer >> CLNumList::push(L, o); >> return 1; >> } >> >> >> > --0016e64de80e0d24d704772f7ff2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I changed the method as you suggested=A0
CLObject=A0:GetListofNumbers(lua_State= *L)//
{
=A0
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0CLNumList*o =3D new=A0CLNumList(L);
CLNL*ud =3D static_cast<=A0= CLNL*>(lua_newuserdata(L, sizeof(CLNumList))); =A0// create new userdata
real_object->GetListofNumbers(*o->real_object); //CLObject
<= span style=3D"white-space: pre; "> ud->pT =3D o;
// lua_pushlightuserdata(L, ud);
= // luaL_g= etmetatable(L,=A0NUMLIST=A0);
// lua_setmetatable(L, -2);

=
CLNumList::push(L, o);<= /span>
= return 1;
}=
i = am receiving this

<= span class=3D"Apple-style-span" style=3D"border-collapse: collapse;">error = C2039: 'push' : is not a member of 'CLNumList'

<= span class=3D"Apple-style-span" style=3D"border-collapse: collapse;">

On Fri, Oct 30, 2009 at 6:26 PM, Sivan Thiruvengadam <= rajskm@gmail.com> wrote:<= br>
Thanks. =A0

Let me change this by pushing the= object as you suggest and see if things work as expected.=A0
BTW,=A0I always hit the else part of the CLNumList constructor,= since i am not passing any CLNumList instance from LUA.

I will update you as soon as i test this.
Thanks once again


2009/10/30 Ignacio Burgue=F1o <= ;ignaciob@inc= oncertcc.com>
Sivan Thiruvengadam wrote:

Ignacio,
*
*
Yes, you are absolutely right.
CLNumList:: CLNumList(lua_State *L)
{
=A0 =A0 =A0 =A0if (lua_isuserdata(L,1))
=A0{

CLNL*t =3D static_cast< CLNL*>(lua_touserdata(L, 1));
real_object =3D new CNumList(*t->pT->real_object);

=A0}
=A0else
=A0real_object =3D new CNumList();
}


I think that is the problem. See, the constructor of CLNumList is assuming = that at stackpos 1 there is a CLNumList.
In the case of your call to GetListofNumbers, at that position there is an = instance of CLObject. I fail to see how that ends up messing the Lua side o= f things, but I think it is definitely wrong.

Could you just use push(L, new CLNumList) in GetListofNumbers ?


Something like:

CLObject :GetListofNumbers(lua_State *L)//
{
=A0CLNumList*o =3D new CLNumList();
// initialize it properly with the corresponding CNumList pointer
=A0CLNumList::push(L, o);
return 1;
}




--0016e64de80e0d24d704772f7ff2-- From lua-bounces@bazar2.conectiva.com.br Fri Oct 30 21:58:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9UNwAvT025580; Fri, 30 Oct 2009 21:58:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F8C31937A; Fri, 30 Oct 2009 21:56:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2FD9619372 for ; Fri, 30 Oct 2009 21:56:42 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N41LY-00050H-I1 for lua@bazar2.conectiva.com.br; Fri, 30 Oct 2009 23:57:32 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id A38873D59F for ; Fri, 30 Oct 2009 23:57:29 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:59092 with envelope Message-ID: <4AEB7D67.3080106@cowlark.com> Date: Fri, 30 Oct 2009 23:57:27 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: The shortest possible sequence match with Lua regular expressions References: <4AEB4FDC.9050406@workspacewhiz.com> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id n9UNwAvT025580 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Cawley wrote: > With the pattern '(/.-/)$', you're asking Lua to match a forward > slash, then match as few characters as possible such that what then > follows is a forward slash followed by the end of the string. After > the first forward slash in the pattern is matched against the first > forward slash in the input, the minimum amount which can be captured > to get a forward slash followed by the end of the input is the entire > of the input. I note that this: string.match('/dev/myprog/image/xyz/', '(/[^/]-/)$') ...produces the expected output. I'll admit that I've never really found - very intuitive, for this sort of reason. I tend to prefer using + and * instead with explicit rejects for invalid input, like above. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK631nf9E0noFvlzgRAgn6AJ0T+XCT29KrKrIG/XIxNlI8bAgr8QCgziDF 4gCPQnrbRc78seS7JotJjgk= =QhNE -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 00:59:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9V2xIA0010435; Sat, 31 Oct 2009 00:59:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D423D1A600; Sat, 31 Oct 2009 00:57:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BF2F1936C for ; Sat, 31 Oct 2009 00:57:49 -0200 (BRST) Received: by pxi2 with SMTP id 2so2301685pxi.11 for ; Fri, 30 Oct 2009 19:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=sYdHDUa+thJKCS1yhsIXNq7dMyDIZgbXz5gCiHbEXWA=; b=SAeBXmGIcuhP9Kre6pxEH0b6XoFWH9WrPrbPN+DvxwjqD5uzB1IHE33OmH4I0D8l1h YRpu/xiiUo6qXX/7rFA8k51cbnDCL0mdCVkQ0XqeZk4twdgyHTn8GYpXrv4qk9ZpMOhA VyB3El+Tw7xn6QXJ11YKPghmJmARaBAWZKf4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ikUC+FzpUycirismDDCgy5kSxJcWmjKPHGl4hPJ0+Ujkq6AlPPfv9fZnOX+I7KppME iIGdBCKoN8vtT/8SvoNxUoMagwjukRWsqR9J3GWPCPRwvfT/8tHlpx5/k2u3reXhb61F zi6TGg9k5249fj5SenkiebHVMCWQ4+04FeStc= MIME-Version: 1.0 Received: by 10.142.6.2 with SMTP id 2mr224617wff.90.1256957923054; Fri, 30 Oct 2009 19:58:43 -0700 (PDT) In-Reply-To: <20091030074515.GA6700@mike.de> References: <3c7535c80910281839r397ae292xa427fd49e107c83a@mail.gmail.com> <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> Date: Sat, 31 Oct 2009 10:58:43 +0800 X-Google-Sender-Auth: 790d92da7053b72f Message-ID: <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I try hard to find out how zero-cost-pcall is implemented, but I failed. I'm curious about it. May Mike Pall explain it in details? From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 04:05:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9V65FL4026023; Sat, 31 Oct 2009 04:05:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A473191D9; Sat, 31 Oct 2009 04:03:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0901C1917B for ; Sat, 31 Oct 2009 04:03:39 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N474g-0007RW-00; Sat, 31 Oct 2009 07:04:30 +0100 Date: Sat, 31 Oct 2009 07:04:20 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091031060420.GA4698@mike.de> References: <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean tankxx wrote: > I try hard to find out how zero-cost-pcall is implemented, but I > failed. I'm curious about it. May Mike Pall explain it in details? The pcall() function is implemented as a "fast function", i.e. it doesn't set up any frame (as explained earlier). It simply does: BASE = RA; BASE[-1] = PC; NARGS--; PC = 8|FRAME_PCALL; And then re-dispatches the call to the passed function. After that, a pcall(func, args...) looks like this: <-------. .. .-- BASE \ V \ V +=====+=====+-----+-----+ tag -> | PC |delta| args| ... | ==> value-> |pcall|func | | | ==> +=====+=====+-----+-----+ delta = 8|FRAME_PCALL (a 1 slot delta) A normal return from a pcall simply does: *--RESULTS = true; NARGS++; And then continues with the standard return value adjustment. If an error is raised from a frame higher up, the pcall frame stops the unwinding and returns false + the error to the caller. Ok, so this already makes pcall() as cheap as any other call for the interpreter. More magic happens, when the code is JIT compiled: Recording a pcall() just means recording a call to its first argument. Since calls are inlined, the on-trace code doesn't have to set up any frames (i.e. it's zero-cost). Only the snapshot maps for any intermediate side exits have the pcall frame info. One invariant is that the on-trace code doesn't throw any errors. So this must happen in some alternative control-flow path, i.e. it would always trigger a side exit. The side exit handler syncs its state back to the Lua stack (which includes all frame links). Now the interpreter is restarted with the snapshot PC, the alternative path gets executed, throws the error and the same events as above would take place. If such a side exit would ever become hot, it would of course be recorded, too. But the side trace will always be aborted when the error is thrown. After a couple of such mishaps, the heuristics decide that it's better to generate machine code for a fast exit to the interpreter and patches the exit branch with its address. --Mike From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 14:23:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VGNY3l016182; Sat, 31 Oct 2009 14:23:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E37171929F; Sat, 31 Oct 2009 14:21:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1DE61916D for ; Sat, 31 Oct 2009 14:21:54 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 35BA5B6D9F for ; Sat, 31 Oct 2009 12:22:50 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 31 Oct 2009 12:22:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:mime-version:content-type; s=smtpout; bh=UfofuK5zI1lkVOM5oS6DD/1swnw=; b=ZraX6Lli3IC5V4+pFoRyNhfIZKlWvjmK92UBu7f5RJhOsOO3M3bfpgIqAHD0+7RoOMFxnh+e2aA+s/WzMAyoZs2NtXqYS+uZfKqOrOUctFL1gZ7QmlzmoUF7DxwUycTgRtNEClHQ62mCcqbHHv4yy3L80wesh0ynNcbwC75vgjg= X-Sasl-enc: Tp2N9F3XPgfPXg/Jwid1u0TeXPsAA7mhbrxW+veQWAA8 1257006169 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id B8FC249E847 for ; Sat, 31 Oct 2009 12:22:49 -0400 (EDT) Date: Sat, 31 Oct 2009 12:23:19 -0400 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Self-deleting weak tables? Message-ID: <20091031162319.GB11203@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I have a hierarchy of weak tables set up for interning objects. We can assume that: alpha = newobject(10,20,30) will look in cache_root[10][20][30], bailing if any of the tables in that path are absent. If the terminal cache table is weak-valued (actually it's fully weak, but let's not worry about the keys for now), the alpha object will be collectible when all other references to it disappear. However, that table will itself stick around even if it's empty. I don't know whether there will be enough such empty tables to worry about. But I was thinking through what would be a good strategy for having these tables delete themselves (from the cache table hierarchy) when they become empty. In Python one can handle this by putting a handler on a weakref. If I had full control over the alpha-values, I could put __gc-handlers on them; however I don't want to assume I can mess around with the metatables of the alpha-values. Here's what I thought of. In addition to the cache table hierarchy, we also have a another, flat, weak-valued table "handlers". When a new object alpha is created and inserted into cache table hierarchy, we also create a userdatum ualpha, which saves the table that alpha was inserted into as its env table, and has a __gc method that will "kick" that cache table when ualpha is collected. We also set handlers[ualpha] = alpha, and no other refs to ualpha will exist. Since handlers is weak-valued, when alpha gets collected, the ualpha entry will be deleted from handlers, and so ualpha will also become collectible. When ualpha gets collected, it "kicks" its env table, and that table stores enough information to delete itself from the cache hierarchy when it's kicked and empty. Does that seem like a good solution? It's creating one extra userdatum per cached object. I can't see any way around that. I don't think it would create any reference cycles that would prevent alpha or ualpha from being collected. Anyone have better ideas---or know of existing implementations of weak tables that are smart enough to delete themselves when they become empty? If I had any way to intern argument lists, so that a value-sequence could be collected into a single bundle that was guaranteed identical to any other bundle created from the same value-sequence, then I could just use a single, flat, weak cache table, with those bundled sequences as keys. But that's just what I'm trying to set up with this... -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 17:04:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VJ3rv3031791; Sat, 31 Oct 2009 17:03:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7B161A67C; Sat, 31 Oct 2009 17:02:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id B1028191EE for ; Sat, 31 Oct 2009 17:02:22 -0200 (BRST) Received: (qmail invoked by alias); 31 Oct 2009 19:03:16 -0000 Received: from p5B0113EA.dip0.t-ipconnect.de (EHLO dialup) [91.1.19.234] by mail.gmx.net (mp071) with SMTP; 31 Oct 2009 20:03:16 +0100 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX1+0FXl3Y+G0scOQBTH8RBTB+PfHRFGYEcV3Pp5CLf UvMSYrAwY+anO+ Date: Sat, 31 Oct 2009 20:03:14 +0100 From: Edgar Toernig To: Lua list Subject: Re: Self-deleting weak tables? Message-Id: <20091031200314.03aaf35c.froese@gmx.de> In-Reply-To: <20091031162319.GB11203@vaio.jimpryor.net> References: <20091031162319.GB11203@vaio.jimpryor.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Pryor wrote: > > alpha = newobject(10,20,30) > [...] > If I had any way to intern argument lists, so that > a value-sequence could be collected into a single bundle that was > guaranteed identical to any other bundle created from the > same value-sequence, then I could just use a single, flat, weak cache > table, with those bundled sequences as keys. Just put them all in a string: function bundle(...) return table.concat({...}, "/") end and if profiling shows that it's too slow or generates too much garbage (the {...} table), write a C function that puts the binary representation into a string: int bundle(lua_State *L) { lua_Number buf[32]; // assume no padding int i, n; n = lua_gettop(L); if (n > 32) luaL_error(L, "sorry pal, too many arguments"); for (i = 0; i < n; ++i) buf[i] = luaL_checknumber(L, i+1); lua_pushlstring(L, (char*)buf, n * sizeof(*buf)); return 1; } Ciao, ET. From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 17:09:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VJ94Kv032365; Sat, 31 Oct 2009 17:09:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C440E1A680; Sat, 31 Oct 2009 17:07:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s51.bay0.hotmail.com (bay0-omc3-s51.bay0.hotmail.com [65.54.246.210]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D321191EE for ; Sat, 31 Oct 2009 17:07:45 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s51.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 31 Oct 2009 12:08:36 -0700 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sat, 31 Oct 2009 19:08:35 +0000 Message-ID: <4AEC8B29.4080702@my.erau.edu> Date: Sat, 31 Oct 2009 15:08:25 -0400 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Self-deleting weak tables? References: <20091031162319.GB11203@vaio.jimpryor.net> <20091031200314.03aaf35c.froese@gmx.de> In-Reply-To: <20091031200314.03aaf35c.froese@gmx.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 31 Oct 2009 19:08:36.0562 (UTC) FILETIME=[8C4A5320:01CA5A5D] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Edgar Toernig wrote: > Jim Pryor wrote: >> alpha = newobject(10,20,30) >> [...] >> If I had any way to intern argument lists, so that >> a value-sequence could be collected into a single bundle that was >> guaranteed identical to any other bundle created from the >> same value-sequence, then I could just use a single, flat, weak cache >> table, with those bundled sequences as keys. > > Just put them all in a string: > > function bundle(...) > return table.concat({...}, "/") > end > Assuming they are all numbers, as your C++ code does, I would prefer to see something that makes garbage strings over garbage tables: function bundle(...) return string.format(("%f/):rep(select('#', ...)-1) .. "%f", ...); end It has the added side effect that, since strings are interned, frequent, identical calls would not result in an ever-increasing memory rate. Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 20:59:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VMxo2T022972; Sat, 31 Oct 2009 20:59:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9EBA7190C7; Sat, 31 Oct 2009 20:58:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7F9718FF0 for ; Sat, 31 Oct 2009 20:58:20 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4Muf-0008De-00; Sat, 31 Oct 2009 23:59:13 +0100 Date: Sat, 31 Oct 2009 23:59:59 +0100 From: Mike Pall To: Lua list Subject: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It's almost midnight on Halloween here. This is the perfect time to release long-awaited, almost mythical open source software ... ;-) Yes, here it is: the first public release of LuaJIT 2.0! Here is a link to the home page: http://luajit.org/luajit.html And a direct link to the download page: http://luajit.org/download.html What is LuaJIT? --------------- LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully compatible with standard Lua 5.1 and can significantly boost the performance of your Lua programs. LuaJIT is open source software, released under the MIT/X license. LuaJIT builds out-of-the-box on all popular x86 operating systems (Linux, Windows, OSX etc.). It runs fine as a 32 bit application under x64-based systems, too. This is a BETA TEST release -- the current status and the list of known issues are shown here: http://luajit.org/status.html Please report any problems you may find with this release. Thank you! What's new in LuaJIT 2.0 ------------------------ The VM of LuaJIT 2.0 has been rewritten from the ground up and is relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler. An innovative trace compiler is integrated with advanced, SSA-based optimizations and a highly tuned code generation backend. This allows a substantial reduction of the overhead associated with dynamic language features. It's destined to break into the performance range traditionally reserved for offline, static language compilers. Performance on numerical code is already quite competitive (see below). Support for other areas (e.g. string functions) is still a bit weak. Although the VM supports all Lua language features and standard library functions, the JIT compiler is not complete (yet) and falls back to the interpreter in some cases. All of this works transparently, so unless you use -jv, you'll probably never notice. The interpreter is quite fast, too (near the performance of the LuaJIT 1.x JIT compiler). Preliminary benchmark numbers are shown below -- performance will likely improve during the beta test phase. These numbers are mainly intended to give you an idea about the typical speedups you can expect, depending on the type of application. Your mileage may vary. Ok, so thanks to everyone for their patience! A big thank you goes to the alpha testers. And now, please have fun with it -- Happy Halloween! --Mike Relative speedup over Lua 5.1.4 on standard Lua benchmarks (e.g. 11.9 means it's almost twelve times faster): md5 152.7 | mandelbrot 13.4 | nsieve 4.7 | array3d 101.5 | pidigits 12.4 | partialsums 4.1 | array 73.5 | random 12.2 | chameneos 3.8 | methcall 28.8 | nsievebits 12.0 | recursive 3.5 | nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 | matrix 23.0 | lists 9.3 | binarytrees 2.7 | spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 | fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 | nbody 14.8 | fasta 5.3 | sumfile 1.5 | SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), higher numbers are better: SciMark composite | small score | FFT SOR MC SPARSE LU ----------------------------+--------------------------------------- GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4 JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 ----------------------------+--------------------------------------- LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 21:37:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VNbdCQ027200; Sat, 31 Oct 2009 21:37:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8454C1929D; Sat, 31 Oct 2009 21:36:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4DA63190B7 for ; Sat, 31 Oct 2009 21:36:00 -0200 (BRST) Received: by pzk34 with SMTP id 34so2672905pzk.11 for ; Sat, 31 Oct 2009 16:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=luGAJtkTzEdEPehXXmtWWZVuL1TotNjxiLnx00BLjF4=; b=qiHAgSCTOf887xtbkN4pZHFgFVmX5TDaYScFzHo+yOiXOQn7vA22JcS+b6MZ2fDW3D hUrDg3/Q3NsPgL6LvFE/fm52hutQTthePnQ1LSnt8jEFJcYd8b374psN51SeA+RgM9Nx OYPZWk6GXhyGW8YaNtlLYARPgnobYygPo/A+8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=t+MiI2QVtF7UKc4TmjF5Taa3G767DAI69ti8qzZ/JMZSILzFVCu6vPy04n8GLkLAH4 nL0Zly5SvTHogEvzpunW9wXvlVYu5Ir5jn9jeqijAyjjmr+hTCv2n5k/S8SW8EieC5Ss 24rzvG/I3BUbx5UMw0Gu/pitqtfQOew/8SKHk= MIME-Version: 1.0 Received: by 10.142.59.10 with SMTP id h10mr287980wfa.91.1257032211914; Sat, 31 Oct 2009 16:36:51 -0700 (PDT) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 07:36:51 +0800 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Linker To: Lua list Content-Type: multipart/alternative; boundary=00504502af987662960477439e16 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502af987662960477439e16 Content-Type: text/plain; charset=UTF-8 It is indeed exciting! Well done! :) On Sun, Nov 1, 2009 at 06:59, Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! > > Here is a link to the home page: > http://luajit.org/luajit.html > > And a direct link to the download page: > http://luajit.org/download.html > > What is LuaJIT? > --------------- > > LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully > compatible with standard Lua 5.1 and can significantly boost the > performance of your Lua programs. > > LuaJIT is open source software, released under the MIT/X license. > > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. > > This is a BETA TEST release -- the current status and the list of > known issues are shown here: http://luajit.org/status.html > Please report any problems you may find with this release. Thank you! > > What's new in LuaJIT 2.0 > ------------------------ > > The VM of LuaJIT 2.0 has been rewritten from the ground up and is > relentlessly optimized for performance. It combines a high-speed > interpreter, written in assembler, with a state-of-the-art JIT compiler. > > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. This allows a > substantial reduction of the overhead associated with dynamic language > features. It's destined to break into the performance range > traditionally reserved for offline, static language compilers. > > Performance on numerical code is already quite competitive (see below). > Support for other areas (e.g. string functions) is still a bit weak. > Although the VM supports all Lua language features and standard library > functions, the JIT compiler is not complete (yet) and falls back to the > interpreter in some cases. All of this works transparently, so unless > you use -jv, you'll probably never notice. The interpreter is quite > fast, too (near the performance of the LuaJIT 1.x JIT compiler). > > Preliminary benchmark numbers are shown below -- performance will > likely improve during the beta test phase. These numbers are mainly > intended to give you an idea about the typical speedups you can expect, > depending on the type of application. Your mileage may vary. > > Ok, so thanks to everyone for their patience! A big thank you goes to > the alpha testers. And now, please have fun with it -- Happy Halloween! > > --Mike > > Relative speedup over Lua 5.1.4 on standard Lua benchmarks > (e.g. 11.9 means it's almost twelve times faster): > > md5 152.7 | mandelbrot 13.4 | nsieve 4.7 | > array3d 101.5 | pidigits 12.4 | partialsums 4.1 | > array 73.5 | random 12.2 | chameneos 3.8 | > methcall 28.8 | nsievebits 12.0 | recursive 3.5 | > nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 | > matrix 23.0 | lists 9.3 | binarytrees 2.7 | > spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 | > fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 | > nbody 14.8 | fasta 5.3 | sumfile 1.5 | > > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: > > SciMark composite | > small score | FFT SOR MC SPARSE LU > ----------------------------+--------------------------------------- > GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 > JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4 > JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 > LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 > Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 > > Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua > > -- Regards, Linker Lin linker.m.lin@gmail.com --00504502af987662960477439e16 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It is indeed exciting!=C2=A0
Well done!
:)

On Sun, Nov 1, 2009 at 06:59, Mike Pall = <mikelu-0910@mike.de> wrote:
It's almost midnight on Halloween here.= This is the perfect time
to release long-awaited, almost mythical open source software ... ;-)

Yes, here it is: the first public release of LuaJIT 2.0!

Here is a link to the home page:
=C2=A0http://l= uajit.org/luajit.html

And a direct link to the download page:
=C2=A0http:/= /luajit.org/download.html

What is LuaJIT?
---------------

LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully
compatible with standard Lua 5.1 and can significantly boost the
performance of your Lua programs.

LuaJIT is open source software, released under the MIT/X license.

LuaJIT builds out-of-the-box on all popular x86 operating systems
(Linux, Windows, OSX etc.). It runs fine as a 32 bit application
under x64-based systems, too.

This is a BETA TEST release -- the current status and the list of
known issues are shown here: http://luajit.org/status.html
Please report any problems you may find with this release. Thank you!

What's new in LuaJIT 2.0
------------------------

The VM of LuaJIT 2.0 has been rewritten from the ground up and is
relentlessly optimized for performance. It combines a high-speed
interpreter, written in assembler, with a state-of-the-art JIT compiler.
An innovative trace compiler is integrated with advanced, SSA-based
optimizations and a highly tuned code generation backend. This allows a
substantial reduction of the overhead associated with dynamic language
features. It's destined to break into the performance range
traditionally reserved for offline, static language compilers.

Performance on numerical code is already quite competitive (see below).
Support for other areas (e.g. string functions) is still a bit weak.
Although the VM supports all Lua language features and standard library
functions, the JIT compiler is not complete (yet) and falls back to the
interpreter in some cases. All of this works transparently, so unless
you use -jv, you'll probably never notice. The interpreter is quite
fast, too (near the performance of the LuaJIT 1.x JIT compiler).

Preliminary benchmark numbers are shown below -- performance will
likely improve during the beta test phase. These numbers are mainly
intended to give you an idea about the typical speedups you can expect,
depending on the type of application. Your mileage may vary.

Ok, so thanks to everyone for their patience! A big thank you goes to
the alpha testers. And now, please have fun with it -- Happy Halloween!

--Mike

Relative speedup over Lua 5.1.4 on standard Lua benchmarks
(e.g. 11.9 means it's almost twelve times faster):

md5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 152.7 =C2=A0| =C2=A0mandelbrot =C2= =A0 13.4 =C2=A0| =C2=A0nsieve =C2=A0 =C2=A0 =C2=A0 =C2=A04.7 =C2=A0|
array3d =C2=A0 =C2=A0 =C2=A0 101.5 =C2=A0| =C2=A0pidigits =C2=A0 =C2=A0 12.= 4 =C2=A0| =C2=A0partialsums =C2=A0 4.1 =C2=A0|
array =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A073.5 =C2=A0| =C2=A0random =C2=A0 = =C2=A0 =C2=A0 12.2 =C2=A0| =C2=A0chameneos =C2=A0 =C2=A0 3.8 =C2=A0|
methcall =C2=A0 =C2=A0 =C2=A0 28.8 =C2=A0| =C2=A0nsievebits =C2=A0 12.0 =C2= =A0| =C2=A0recursive =C2=A0 =C2=A0 3.5 =C2=A0|
nsievebits =C2=A0 =C2=A0 28.0 =C2=A0| =C2=A0nestedloop =C2=A0 11.9 =C2=A0| = =C2=A0knucleotide =C2=A0 3.4 =C2=A0|
matrix =C2=A0 =C2=A0 =C2=A0 =C2=A0 23.0 =C2=A0| =C2=A0lists =C2=A0 =C2=A0 = =C2=A0 =C2=A0 9.3 =C2=A0| =C2=A0binarytrees =C2=A0 2.7 =C2=A0|
spectralnorm =C2=A0 21.4 =C2=A0| =C2=A0cheapconcr =C2=A0 =C2=A05.5 =C2=A0| = =C2=A0meteor =C2=A0 =C2=A0 =C2=A0 =C2=A02.0 =C2=A0|
fannkuch =C2=A0 =C2=A0 =C2=A0 20.9 =C2=A0| =C2=A0cheapconcw =C2=A0 =C2=A05.= 4 =C2=A0| =C2=A0revcomp =C2=A0 =C2=A0 =C2=A0 1.8 =C2=A0|
nbody =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A014.8 =C2=A0| =C2=A0fasta =C2=A0 =C2= =A0 =C2=A0 =C2=A0 5.3 =C2=A0| =C2=A0sumfile =C2=A0 =C2=A0 =C2=A0 1.5 =C2=A0= |

SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized),
higher numbers are better:

SciMark =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0composite =C2=A0|
small =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0score =C2=A0| = =C2=A0FFT =C2=A0 =C2=A0 SOR =C2=A0 =C2=A0 =C2=A0MC =C2=A0 =C2=A0SPARSE =C2= =A0 =C2=A0LU
----------------------------+---------------------------------------
GCC 4.3.2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0906.1 =C2=A0| =C2=A0739.= 1 =C2=A0 909.0 =C2=A0 190.4 =C2=A01057.0 =C2=A01635.1
JVM 1.6 Server =C2=A0 =C2=A0 =C2=A0 876.3 =C2=A0| =C2=A0573.8 =C2=A01185.5 = =C2=A0 297.7 =C2=A0 579.2 =C2=A01745.4
JVM 1.6 Client =C2=A0 =C2=A0 =C2=A0 579.6 =C2=A0| =C2=A0424.8 =C2=A0 895.8 = =C2=A0 122.8 =C2=A0 595.5 =C2=A0 859.0
----------------------------+---------------------------------------
LuaJIT 2.0.0-beta1 =C2=A0 580.4 =C2=A0| =C2=A0427.4 =C2=A01025.0 =C2=A0 223= .7 =C2=A0 303.4 =C2=A0 922.5
LuaJIT 1.1.5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A096.7 =C2=A0| =C2=A0 72.0 =C2= =A0 166.1 =C2=A0 =C2=A037.1 =C2=A0 =C2=A091.8 =C2=A0 116.5
Lua 5.1.4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 16.5 =C2=A0| =C2=A0 11.= 0 =C2=A0 =C2=A027.4 =C2=A0 =C2=A0 7.6 =C2=A0 =C2=A016.9 =C2=A0 =C2=A019.5
Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua




--
Regards,
Linker Lin<= br>linker.m.lin@gmail.com
--00504502af987662960477439e16-- From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 21:46:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VNk35W028017; Sat, 31 Oct 2009 21:46:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B89B4192C1; Sat, 31 Oct 2009 21:44:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth22.prod.mesa1.secureserver.net (smtpauth22.prod.mesa1.secureserver.net [64.202.165.44]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1F4A81929A for ; Sat, 31 Oct 2009 21:44:43 -0200 (BRST) Received: (qmail 29989 invoked from network); 31 Oct 2009 23:45:35 -0000 Received: from unknown (98.117.140.83) by smtpauth22.prod.mesa1.secureserver.net (64.202.165.44) with ESMTP; 31 Oct 2009 23:45:35 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Mark Hamburg In-Reply-To: Date: Sat, 31 Oct 2009 16:45:34 -0700 Content-Transfer-Encoding: 7bit Message-Id: <85757A04-A2E1-4D2D-97ED-5C3A0EFD05DE@grubmah.com> References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Very cool. And do I recall that this no longer needs Coco and hence should be friendlier toward use cases with lots of coroutines? Mark From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 21:50:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VNohF3028559; Sat, 31 Oct 2009 21:50:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EE41192CB; Sat, 31 Oct 2009 21:49:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E4B21929A for ; Sat, 31 Oct 2009 21:49:26 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N4Nhu-0005TV-8X; Sat, 31 Oct 2009 23:50:06 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N4Ni8-0006fo-Mh; Sat, 31 Oct 2009 23:50:21 +0000 Date: Sat, 31 Oct 2009 23:50:20 +0000 From: Rob Kendrick To: Luiz Henrique de Figueiredo Subject: Re: lua.org down Message-ID: <20091031235020.3ebb0ef8@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091031183840.A16144@lua.tecgraf.puc-rio.br> References: <20091031183840.A16144@lua.tecgraf.puc-rio.br> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: lua-l@lua.org X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 31 Oct 2009 18:38:41 -0200 Luiz Henrique de Figueiredo wrote: > Is Pepperfish down? Yes, it was, sorry. Unfortunately, something caused Linux to run its OOM, and it all went down hill from there. Doubly unfortunate was that the remote power management wasn't set up properly by our ISP in our recent data centre move for the server on which lua.org and lua-users.org is hosted, so we couldn't remotely power cycle it. Both of these issues are now fixed. Apologies for the downtime, which was exacerbated by the fact that the engineer who was on-call wasn't answering his phone! B. From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 21:55:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id n9VNtBqr028933; Sat, 31 Oct 2009 21:55:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73C3A192D8; Sat, 31 Oct 2009 21:54:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 075EB1929A for ; Sat, 31 Oct 2009 21:53:55 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N4NmF-0005eQ-3A for ; Sat, 31 Oct 2009 23:54:35 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N4NmU-0006gq-1V for lua@bazar2.conectiva.com.br; Sat, 31 Oct 2009 23:54:50 +0000 Date: Sat, 31 Oct 2009 23:54:49 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091031235449.6574c9e2@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 31 Oct 2009 23:59:59 +0100 Mike Pall wrote: > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. Out of interest, what sort of engineering effort is required to get this working natively on AMD64? From what I've read of your descriptions of it in the past, it sounds like it'll be even harder than with LuaJIT 1. Unfortunately, using the 32-bit x86 version doesn't help when you ideally want to link to a load of libraries that are 64-bit. (We tend to just not use LuaJIT on our web apps simply because the effort required to keep two sets of libraries up-to-date and managed is more than the performance benefit makes worth.) If it's a matter of sponsorship and paying for your time, I wonder if it might be worth starting a bounty pot. B. From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 22:06:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA106Oj6029956; Sat, 31 Oct 2009 22:06:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B376192E2; Sat, 31 Oct 2009 22:05:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E47671929A for ; Sat, 31 Oct 2009 22:05:04 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4NxI-0003lW-00; Sun, 01 Nov 2009 01:06:00 +0100 Date: Sun, 1 Nov 2009 01:05:48 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101000548.GA3960@mike.de> References: <20091031225554.GA30341@mike.de> <85757A04-A2E1-4D2D-97ED-5C3A0EFD05DE@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85757A04-A2E1-4D2D-97ED-5C3A0EFD05DE@grubmah.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: > Very cool. And do I recall that this no longer needs Coco and hence > should be friendlier toward use cases with lots of coroutines? Yes, it's operating on a single C stack, only switching Lua stacks (i.e. heap-allocated objects). The coroutine model of LuaJIT 2.x is more like RVM than Coco in that respect. LuaJIT 2.0 coroutines use very little memory: LuaJIT 2.0.0 410 bytes/coroutine (lua_State + default stack) Lua 5.1.4 (x86/POSIX) 860 Lua 5.1.4 (x86/Win32) 1040 Lua 5.1.4 (x64) 1250 LuaJIT 1.1.5 62550 So you can happily juggle with hundreds of thousands of them (again). Since there is also less context to update, coroutine yield/resume is substantially faster (even though the JIT compiler currently falls back to the interpreter for this). --Mike From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 22:29:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA10Sx2d032062; Sat, 31 Oct 2009 22:28:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 163221A66A; Sat, 31 Oct 2009 22:27:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D695419289 for ; Sat, 31 Oct 2009 22:27:34 -0200 (BRST) Received: from papaya.tek (dslb-088-075-201-223.pools.arcor-ip.net [88.75.201.223]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id E4009515E6 for ; Sun, 1 Nov 2009 01:28:27 +0100 (CET) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id 396AE3EAB7 for ; Sun, 1 Nov 2009 01:28:27 +0100 (CET) Date: Sun, 1 Nov 2009 01:28:26 +0100 From: "Timm S. Mueller" To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-Id: <20091101012826.49fd7140.tmueller@schulze-mueller.de> In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 31 Oct 2009 23:59:59 +0100 Mike Pall wrote: Hello Mike, > Yes, here it is: the first public release of LuaJIT 2.0! very nice! I was running some tests and the performance boost is tremendous. Even though the vast majority of my code runs through LuaJIT without a noticeable difference, some tests bail out if a certain function in my C library is getting called. The message is: /usr/local/bin/luajit-2.0.0-beta1: ./tek/ui/class/drawable.lua:205: bad argument #-2 to 'drawimage' (number expected, got table) I got it nailed down to the following line (tek/lib/visual_api.c:694) in my C code: fmt = luaL_checkinteger(L, -1); This C code fumbles around in nested tables which are passed in by the caller. The next Lua function on the call stack is this: function Drawable:drawImage(...) self.Visual:drawimage(...) end obviously, the same code was working before (and with LuaJIT 1.x). It only affects the drawimage function, all other C library functions so far work as expected. Without a spontaneous idea from your side I would try to provide a more isolated test case. Or, if you want to try it yourself, see [1] and run f.ex. bin/imagetest.lua from the top-level directory (using Linux, gcc-4.3.4). - Timm [1] http://tekui.teklib.org/ -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 22:52:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA10qGma002586; Sat, 31 Oct 2009 22:52:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 362B91A687; Sat, 31 Oct 2009 22:51:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47C0B1A66A for ; Sat, 31 Oct 2009 22:50:56 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4Off-0003tQ-00; Sun, 01 Nov 2009 01:51:51 +0100 Date: Sun, 1 Nov 2009 01:51:39 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101005139.GA5687@mike.de> References: <20091031225554.GA30341@mike.de> <20091031235449.6574c9e2@trite.i.flarn.net.i.flarn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091031235449.6574c9e2@trite.i.flarn.net.i.flarn.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Rob Kendrick wrote: > Out of interest, what sort of engineering effort is required to get > this working natively on AMD64? From what I've read of your > descriptions of it in the past, it sounds like it'll be even harder > than with LuaJIT 1. Umm, no, I think it will be easier. The code base and the internal structures of LJ2 have already been designed with a 64 bit port in mind. The backend code generator is already pretty close to supporting x64. It's mainly missing support for the different calling conventions and stack frame setup. The disassembler included with the debug modules can already read x64 code. The real biggie is the interpreter, because it's written in assembler with the help of DynASM. So one needs to port DynASM to x64 first (eeek), redesign the C stack layout and then it's mainly cut'n'paste from the x86 interpreter, modulo x87 vs. SSE2 differences. There are some general open issues for a 64 bit VM, like where and how to allocate the machine code and the heap (it needs to be in certain address ranges). But I already have some ideas for this. Ok, now, that sounds probably simpler than it is. But it's more a mechanical translation, not in need of some cutting edge research. It's still a lot of work, for sure. > If it's a matter of sponsorship and paying for your time, I wonder if > it might be worth starting a bounty pot. I'm not sure if it's a good idea to collect lots of small donations from individuals. This would cost me too much time (I have to write a proper invoice, put it into accounting etc.). Well, ok, if there's some way to shield me from this (e.g. a proxy) ... But I have no objections to corporate sponsorship. Since I'm an independent consultant, you'll get a proper bill/invoice/tax receipt or whatever it's called in your country. Companies should be able to deduct this as expenses. Some financial support for the rest of this year would be nice, so I can offer more of my time to bring LuaJIT 2.0 x86 out of beta status as soon as possible. The x64 port is only step #2, after all. --Mike From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 22:53:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA10r0rr002694; Sat, 31 Oct 2009 22:53:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C99711A68B; Sat, 31 Oct 2009 22:51:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F39621A689 for ; Sat, 31 Oct 2009 22:51:42 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 86B2BBD0C2 for ; Sat, 31 Oct 2009 20:52:38 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 31 Oct 2009 20:52:38 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=x/lUD7QCPwCfhiJdV7H6F2Hi3lM=; b=FLqr3wiCjiOTLk7n17qAonJ1ju6s0aBQ/6jbG2qjdmjtDH8x+xUzJNtFuDwZT3CoS+EpWxklCZkGrdFQnWXarbxu3ybJRK/sIB0WYH+qZkPOkFFdBvK7bdXvmw0NKPGHbSbrsEkqMpuOFmw0NTq8AgRzVIBP3q8Y0mDgjJfX5G4= X-Sasl-enc: mAZRiBooE0CQ5NW1/Dtj5YTN23V6owyE6y5Llipspxil 1257036758 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id B5AAD49EF65 for ; Sat, 31 Oct 2009 20:52:37 -0400 (EDT) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 13:52:04 +1300 Content-Transfer-Encoding: 7bit Message-Id: <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Mike, On 1/11/2009, at 11:59 AM, Mike Pall wrote: > It's almost midnight on Halloween here. That's long gone in this timezone! > Yes, here it is: the first public release of LuaJIT 2.0! That's awesome, your work is really appreciated! Built fine on OS X 10.6. It didn't like my heap code: $ time lua heap_test.lua real 2m4.923s user 2m4.334s sys 0m0.381s $ time luajit -O heap_test.lua real 1m5.412s user 1m4.874s sys 0m0.260s $ time luajit-2.0.0-beta1 heap_test.lua real 2m3.326s user 2m2.565s sys 0m0.281s As far as I can tell, it really doesn't like the heap integrity check on the skew heap. Is there anything I should try? No guarantees I've written good code, but if you're interested, you can get the heap stuff at http://www.incremental.co.nz/projects/lua.html I'll try some other map-related stuff I have, but I just ran into a 64 vs 32 hiccup I'll have to straighten out. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Sat Oct 31 23:53:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA11rETV009913; Sat, 31 Oct 2009 23:53:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD43618BB3; Sat, 31 Oct 2009 23:51:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C96818B91 for ; Sat, 31 Oct 2009 23:51:48 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4PcX-0003x9-00; Sun, 01 Nov 2009 02:52:41 +0100 Date: Sun, 1 Nov 2009 02:52:35 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101015235.GA7316@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > It didn't like my heap code: Well, yes and no. First, it's easier to analyze when the different phases are separated out to individual benchmarks. The total execution time of all of the test is not very meaningful. The heap integrity checks spend 90% - 95% of their time writing output. This overwhelms the check itself. And I/O functions are not recorded (yet). Comparing test_heap_speed is more interesting: binary_heap skew_heap ------------------------------------ Lua 11.4s 10.7s LJ1 2.9s 4.2s LJ2 1.6s 3.0s / 50% JIT 25% JIT Profile ( 40% Interp 65% Interp \ 10% GC 10% GC So, even though LJ2 is quite a bit faster, it still spends way too much time in the interpreter. Upon cursory examination it looks like this is one of the NYI items: The innermost loops seem to run only for very few iterations. And side exits from it return back to a lower frame than the loop itself. This case can't be recorded, yet. So it falls back to the interpreter instead of creating a nice side trace. Fixing this issue is actually quite high on my list. Thank you for providing a good test case for it! :-) But the original test run is dominated by test_sort_queue_speed which spends a lot of time in table.sort and table.remove. Neither of which is supported, yet. The former is really hard, but the latter is trivial to do for the usual "pop-last-element" case. Ok, I've just reprioritized my TODO list a bit ... ;-) --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 00:06:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA126ef8011779; Sun, 1 Nov 2009 00:06:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20AD318C1B; Sun, 1 Nov 2009 00:05:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFDC318BA2 for ; Sun, 1 Nov 2009 00:05:20 -0200 (BRST) Received: by qyk4 with SMTP id 4so2093685qyk.33 for ; Sat, 31 Oct 2009 19:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=t4p9ZUI5Ezr0BWh7LPkUKEND78g7D7MACz35bCXWT3U=; b=wh9kylZuQ9yGjQ8NC4NOZ+PkiLPFoxRR9aUAnFrI9D0llnCXXZX+RLrbJ2kEdYWj3P myXXsyOJZHBX2M0bvudJWfxriELrRgUOQYq1s3s2BVvSSIfgVOyn4tZvoW+m2C5XQPCS Q/B/zzd0HW/nEyykzNtHtPuSNKiV3/4ZswhVI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=hH6e8AlUGVN7ONIwEHDUpNVydN6YQo6tPmWYOaFtlOGaDD2VDC63QV+2NtIfs7kUd7 reYoo+h5IS8C324A7dKqumtUH9XKG43Idx7xbsy4i+BrgQLLv4/mWEYFjOipPy/ON8v5 dWs39YEjA6Q67GBklCjaAfPSjzsAvvWMRGlPA= MIME-Version: 1.0 Received: by 10.224.71.203 with SMTP id i11mr1950290qaj.338.1257041175895; Sat, 31 Oct 2009 19:06:15 -0700 (PDT) Date: Sat, 31 Oct 2009 19:06:15 -0700 Message-ID: Subject: Undocumented/Buggy Behavior with Function Definitions From: RJ Russell To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The Manual says that: function f () body end is translated to: f=function() body end, However, this code doesn't seem to work: ----------------------------------------------------------------- do local cdoc local docs local function newindex(G,k,v) docs[k]=cdoc rawset(G,k,v) setmetatable(_G,nil) end function adddoc(s) cdoc=s setmetatable(_G,{__newindex=newindex}) end end adddoc[[----------------------- -- Some function doc -- that has info in it --Blah foo bar baz ----------------------------------]] function Foo(arg1) doStuff() end ---------------------------------------------------------------- Apparently function definitions like that bypass the __newindex metamethod in the globals table. Why is this not stated? From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 00:10:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA12AAWt012130; Sun, 1 Nov 2009 00:10:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93B981A688; Sun, 1 Nov 2009 00:08:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36F4B1A66A for ; Sun, 1 Nov 2009 00:08:52 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4Pt5-0003xu-00; Sun, 01 Nov 2009 03:09:47 +0100 Date: Sun, 1 Nov 2009 03:09:43 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101020943.GA8663@mike.de> References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091101012826.49fd7140.tmueller@schulze-mueller.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Timm S. Mueller wrote: > fmt = luaL_checkinteger(L, -1); Aiiieeee ... you're using negative stack indexes with the luaL_check*() functions? Maybe the Lua manual could be a bit more clear about this point, but it *does* say this at the start of section 4: "Because the error message is formatted for arguments (e.g., "bad argument #1"), you should not use these functions for other stack values." For me this implies, that only positive values cause defined behaviour. Obviously the standard Lua implementation is somewhat more lenient: it properly checks the type of the stack object at the relative position, but it would report a pretty meaningless error if the check ever failed (like "bad argument #-7"). Currently LJ2 happily misinterprets negative indexes for these functions. Sooo ... what to do? I guess I'll have to bite the bullet and support some undefined behavior, too. :-/ Patch will follow shortly. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 00:17:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA12HUE1012790; Sun, 1 Nov 2009 00:17:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E9B01A689; Sun, 1 Nov 2009 00:16:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DDC11A66A for ; Sun, 1 Nov 2009 00:16:11 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA12H3XZ012759 for ; Sun, 1 Nov 2009 00:17:04 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nA12H3716989; Sun, 1 Nov 2009 00:17:03 -0200 Date: Sun, 1 Nov 2009 00:17:02 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Undocumented/Buggy Behavior with Function Definitions Message-ID: <20091101001702.A16917@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from russellsprouts2@gmail.com on Sat, Oct 31, 2009 at 07:06:15PM -0700 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > However, this code doesn't seem to work: > do > local cdoc > local docs > local function newindex(G,k,v) > docs[k]=cdoc You need to initialize docs: local docs={} From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 00:27:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA12R3sX013578; Sun, 1 Nov 2009 00:27:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91DD61892B; Sun, 1 Nov 2009 00:25:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f82.google.com (mail-pw0-f82.google.com [209.85.160.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CB7C818866 for ; Sun, 1 Nov 2009 00:25:39 -0200 (BRST) Received: by pwi3 with SMTP id 3so291914pwi.1 for ; Sat, 31 Oct 2009 19:26:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.3.37 with SMTP id 37mr321306wfc.146.1257042393526; Sat, 31 Oct 2009 19:26:33 -0700 (PDT) Date: Sat, 31 Oct 2009 19:26:33 -0700 Message-ID: <204fe0960910311926t5519013eue896cba1d1cfd2f5@mail.gmail.com> Subject: Job Offer: Permanent, full-time, work at home, Lua and C developer From: Aaron Bergen To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502c14d55718c047745fd75 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502c14d55718c047745fd75 Content-Type: text/plain; charset=ISO-8859-1 Mi Casa Verde has developed a unique home automation software platform which we license for use in low-cost embedded systems. Our customers use our software in consumer electronics for a variety of applications, generally with a focus on home energy conservation. Our software is written in C and most often runs on embedded Linux systems, but incorporates Lua for creating external plugins. Third party users and developers have created Lua plugins to interface with things like Yahoo Weather, Google Traffic, various alarm panels, and so on. We're looking for an experienced Lua and C developer to work from home, anywhere in the world. Primarily we need someone to develop plugins in Lua, extend our custom Lua API, and assist third party developers with their applications. You will be collaborting with our team of 5 other developers as well as some customers, so fluent English and a good internet connection for clear Skype calls are a must. We're looking for a serious, professional developer who enjoys the flexibility of working from home, but has the self-discipline and organizational skills to be as productive as an office commuter. The hours are flexible. We have developers who have been on the team for years, and work hard to make sure everyone on the team is well taken care of so you'll be happy and stick with us for the long run. If you're interested email aaron [at] micasaverde [dot] com. --00504502c14d55718c047745fd75 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Mi Casa Verde has developed a unique home automation software platform= which we license for use in low-cost embedded systems. =A0Our customers us= e our software in consumer electronics for a variety of applications, gener= ally with a focus on home energy conservation. =A0Our software is written i= n C and most often runs on embedded Linux systems, but incorporates Lua for= creating external plugins. =A0Third party users and developers have create= d Lua plugins to interface with things like Yahoo Weather, Google Traffic, = various alarm panels, and so on.

We're looking for an experienced Lua and C develope= r to work from home, anywhere in the world. =A0Primarily we need someone to= develop plugins in Lua, extend our custom Lua API, and assist third party = developers with their applications.

You will be collaborting with our team of 5 other devel= opers as well as some customers, so fluent English and a good internet conn= ection for clear Skype calls are a must. =A0We're looking for a serious= , professional developer who enjoys the flexibility of working from home, b= ut has the self-discipline and organizational skills to be as productive as= an office commuter. =A0The hours are flexible. =A0We have developers who h= ave been on the team for years, and work hard to make sure everyone on the = team is well taken care of so you'll be happy and stick with us for the= long run.

If you're interested email aaron [at] micasaverde [= dot] com.


--00504502c14d55718c047745fd75-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 00:36:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA12aJgg014798; Sun, 1 Nov 2009 00:36:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A29E1A686; Sun, 1 Nov 2009 00:35:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A5141886D for ; Sun, 1 Nov 2009 00:34:57 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4QIK-0003zC-00; Sun, 01 Nov 2009 03:35:52 +0100 Date: Sun, 1 Nov 2009 03:32:29 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101023229.GA10905@mike.de> References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> <20091101020943.GA8663@mike.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20091101020943.GA8663@mike.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I wrote: > Currently LJ2 happily misinterprets negative indexes for these > functions. Sooo ... what to do? I guess I'll have to bite the > bullet and support some undefined behavior, too. :-/ > > Patch will follow shortly. Ok, here it is. Timm, can you please check whether this fixes your original problem? Thank you! --Mike --bg08WKrSYDhXBjb5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="luaL_narg.diff" --- a/src/lib_aux.c +++ b/src/lib_aux.c @@ -24,6 +24,11 @@ #define abs_index(L, i) \ ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) +static LJ_AINLINE int abs_narg(lua_State *L, int narg) +{ + return LJ_LIKELY(narg >= 0) ? narg : (L->top - L->base) + narg + 1; +} + /* -- Type checks --------------------------------------------------------- */ LUALIB_API void luaL_checkstack(lua_State *L, int size, const char *msg) @@ -34,18 +39,19 @@ LUALIB_API void luaL_checkstack(lua_State *L, int size, const char *msg) LUALIB_API void luaL_checktype(lua_State *L, int narg, int tt) { + narg = abs_narg(L, narg); if (lua_type(L, narg) != tt) lj_err_argt(L, narg, tt); } LUALIB_API void luaL_checkany(lua_State *L, int narg) { - lj_lib_checkany(L, narg); + lj_lib_checkany(L, abs_narg(L, narg)); } LUALIB_API const char *luaL_checklstring(lua_State *L, int narg, size_t *len) { - GCstr *s = lj_lib_checkstr(L, narg); + GCstr *s = lj_lib_checkstr(L, abs_narg(L, narg)); if (len != NULL) *len = s->len; return strdata(s); } @@ -53,7 +59,7 @@ LUALIB_API const char *luaL_checklstring(lua_State *L, int narg, size_t *len) LUALIB_API const char *luaL_optlstring(lua_State *L, int narg, const char *def, size_t *len) { - GCstr *s = lj_lib_optstr(L, narg); + GCstr *s = lj_lib_optstr(L, abs_narg(L, narg)); if (s) { if (len != NULL) *len = s->len; return strdata(s); @@ -64,11 +70,12 @@ LUALIB_API const char *luaL_optlstring(lua_State *L, int narg, LUALIB_API lua_Number luaL_checknumber(lua_State *L, int narg) { - return lj_lib_checknum(L, narg); + return lj_lib_checknum(L, abs_narg(L, narg)); } LUALIB_API lua_Number luaL_optnumber(lua_State *L, int narg, lua_Number def) { + narg = abs_narg(L, narg); lj_lib_opt(L, narg, return lj_lib_checknum(L, narg); , @@ -79,14 +86,15 @@ LUALIB_API lua_Number luaL_optnumber(lua_State *L, int narg, lua_Number def) LUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int narg) { #if LJ_64 - return (lua_Integer)lj_lib_checknum(L, narg); + return (lua_Integer)lj_lib_checknum(L, abs_narg(L, narg)); #else - return lj_lib_checkint(L, narg); + return lj_lib_checkint(L, abs_narg(L, narg)); #endif } LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int narg, lua_Integer def) { + narg = abs_narg(L, narg); #if LJ_64 lj_lib_opt(L, narg, return (lua_Integer)lj_lib_checknum(L, narg); @@ -101,9 +109,12 @@ LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int narg, lua_Integer def) LUALIB_API int luaL_checkoption(lua_State *L, int narg, const char *def, const char *const lst[]) { - GCstr *s = lj_lib_optstr(L, narg); - const char *opt = s ? strdata(s) : def; + GCstr *s; + const char *opt; uint32_t i; + narg = abs_narg(L, narg); + s = lj_lib_optstr(L, narg); + opt = s ? strdata(s) : def; if (!opt) lj_err_argt(L, narg, LUA_TSTRING); for (i = 0; lst[i]; i++) if (strcmp(lst[i], opt) == 0) --bg08WKrSYDhXBjb5-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 01:37:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA13brEU020686; Sun, 1 Nov 2009 01:37:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5679319235; Sun, 1 Nov 2009 01:36:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06664191E8 for ; Sun, 1 Nov 2009 01:36:28 -0200 (BRST) Received: by iwn5 with SMTP id 5so2984868iwn.11 for ; Sat, 31 Oct 2009 20:37:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.117.215 with SMTP id s23mr797473ibq.41.1257046642743; Sat, 31 Oct 2009 20:37:22 -0700 (PDT) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sat, 31 Oct 2009 23:37:22 -0400 X-Google-Sender-Auth: 7d9056e5f5e85e40 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 31, 2009 at 6:59 PM, Mike Pall wrote: > Yes, here it is: the first public release of LuaJIT 2.0! Deploying LuaJIT2 via LuaDist is now supported [1]. BTW, appending "/debug" to the LJLINK flags in msvcbuild.bat causes nearly anything to crash (e.g. `luajit -e "return"`). The problem appears to affect only MSVC (2008) debug mode linking, not Cygwin/MinGW/Linux. [1] http://lua-users.org/wiki/LuaDist From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 02:03:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA143KGN023124; Sun, 1 Nov 2009 02:03:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4870119276; Sun, 1 Nov 2009 02:02:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85F741926C for ; Sun, 1 Nov 2009 02:01:56 -0200 (BRST) Received: by qw-out-2122.google.com with SMTP id 9so811140qwb.11 for ; Sat, 31 Oct 2009 21:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=OHUHgMuHaxTCqIrhvfwed5uTUoky2gHUE/Ym6TxHFP4=; b=k9C772XPr5NeGV2gaKUn3qTZPgdayiGYDifR22WQwkC1vkHmbeA7pWBqGnr1mE0Fpr zzhGIOv/UoXkPOwgmaEYnrAfeOKTkpNReNDr4WvNm0KFRyI28PJSJakInZZ5K16ih+pi oV2tS9W2jfdGZdCmBossmtJOvw/7/PrUWgFBc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=B428GkAX121/TffmxcILhzu+TmtraqLNORZj71ZPV/IvQCOFUzNZfjV71cASHNie+x 7yJ4TD026jy+yp0F2uERldyIhWvddig0ybHPz7DRtqPBr1OizsOLb2LLG3zML/G5VQt8 LaGOnTS9QFp2mJeH8NrNJQEMti7AfJ/r2yZUs= MIME-Version: 1.0 Received: by 10.224.117.8 with SMTP id o8mr1997144qaq.227.1257048171908; Sat, 31 Oct 2009 21:02:51 -0700 (PDT) In-Reply-To: <20091101001702.A16917@lua.tecgraf.puc-rio.br> References: <20091101001702.A16917@lua.tecgraf.puc-rio.br> Date: Sat, 31 Oct 2009 21:02:51 -0700 Message-ID: Subject: Re: Undocumented/Buggy Behavior with Function Definitions From: RJ Russell To: Lua list Content-Type: multipart/alternative; boundary=000feaeec653c090c104774755c0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000feaeec653c090c104774755c0 Content-Type: text/plain; charset=ISO-8859-1 Sorry, that code isn't the actual code, just a demonstration code that I made really fast. It was to demonstrate that the __newindex wasn't working on a function definition function foo()end. But now I rewrote another one, and it seems to work. I guess I was wrong. Thanks anyway. On Sat, Oct 31, 2009 at 7:17 PM, Luiz Henrique de Figueiredo < lhf@tecgraf.puc-rio.br> wrote: > > However, this code doesn't seem to work: > > > do > > local cdoc > > local docs > > local function newindex(G,k,v) > > docs[k]=cdoc > > You need to initialize docs: > local docs={} > --000feaeec653c090c104774755c0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, that code isn't the actual code, just a demonstration code that = I made really fast. It was to demonstrate that the __newindex wasn't wo= rking on a function definition function foo()end. But now I rewrote another= one, and it seems to work. I guess I was wrong. Thanks anyway.

On Sat, Oct 31, 2009 at 7:17 PM, Luiz Henriq= ue de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> However, this code doesn't seem to work:

> do
> =A0 local cdoc
> =A0 local docs
> =A0 local function newindex(G,k,v)
> =A0 =A0 docs[k]=3Dcdoc

You need to initialize docs:
=A0 =A0local docs=3D{}

--000feaeec653c090c104774755c0-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 02:03:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA143loM023201; Sun, 1 Nov 2009 02:03:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FA0F1928D; Sun, 1 Nov 2009 02:02:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC42A1926C for ; Sun, 1 Nov 2009 02:02:17 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 22C982F74EB for ; Sat, 31 Oct 2009 21:03:12 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tOLV+rF0fvQj for ; Sat, 31 Oct 2009 21:03:11 -0700 (PDT) Received: from [192.168.180.3] (h-67-102-31-245.lsanca54.static.covad.net [67.102.31.245]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 12A4F2F74EA for ; Sat, 31 Oct 2009 21:03:11 -0700 (PDT) Message-Id: <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> From: Graham Wakefield To: Lua list In-Reply-To: <20091031225554.GA30341@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Sat, 31 Oct 2009 21:03:10 -0700 References: <20091031225554.GA30341@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi this is wonderful and yes, long-awaited! At the risk of looking stupid ~ currently the makefile installs headers into /usr/local/include, but no static library libluajit.a (or whatever it should be called); is embedding LJ2 problematic? On Oct 31, 2009, at 3:59 PM, Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! > > Here is a link to the home page: > http://luajit.org/luajit.html > > And a direct link to the download page: > http://luajit.org/download.html > > What is LuaJIT? > --------------- > > LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully > compatible with standard Lua 5.1 and can significantly boost the > performance of your Lua programs. > > LuaJIT is open source software, released under the MIT/X license. > > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. > > This is a BETA TEST release -- the current status and the list of > known issues are shown here: http://luajit.org/status.html > Please report any problems you may find with this release. Thank you! > > What's new in LuaJIT 2.0 > ------------------------ > > The VM of LuaJIT 2.0 has been rewritten from the ground up and is > relentlessly optimized for performance. It combines a high-speed > interpreter, written in assembler, with a state-of-the-art JIT > compiler. > > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. This > allows a > substantial reduction of the overhead associated with dynamic language > features. It's destined to break into the performance range > traditionally reserved for offline, static language compilers. > > Performance on numerical code is already quite competitive (see > below). > Support for other areas (e.g. string functions) is still a bit weak. > Although the VM supports all Lua language features and standard > library > functions, the JIT compiler is not complete (yet) and falls back to > the > interpreter in some cases. All of this works transparently, so unless > you use -jv, you'll probably never notice. The interpreter is quite > fast, too (near the performance of the LuaJIT 1.x JIT compiler). > > Preliminary benchmark numbers are shown below -- performance will > likely improve during the beta test phase. These numbers are mainly > intended to give you an idea about the typical speedups you can > expect, > depending on the type of application. Your mileage may vary. > > Ok, so thanks to everyone for their patience! A big thank you goes to > the alpha testers. And now, please have fun with it -- Happy > Halloween! > > --Mike > > Relative speedup over Lua 5.1.4 on standard Lua benchmarks > (e.g. 11.9 means it's almost twelve times faster): > > md5 152.7 | mandelbrot 13.4 | nsieve 4.7 | > array3d 101.5 | pidigits 12.4 | partialsums 4.1 | > array 73.5 | random 12.2 | chameneos 3.8 | > methcall 28.8 | nsievebits 12.0 | recursive 3.5 | > nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 | > matrix 23.0 | lists 9.3 | binarytrees 2.7 | > spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 | > fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 | > nbody 14.8 | fasta 5.3 | sumfile 1.5 | > > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: > > SciMark composite | > small score | FFT SOR MC SPARSE LU > ----------------------------+--------------------------------------- > GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 > JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4 > JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 > LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 > Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 > > Get the newest Lua SciMark here: http://luajit.org/download/ > scimark.lua > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 02:17:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA14H5FD024357; Sun, 1 Nov 2009 02:17:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B2A719299; Sun, 1 Nov 2009 02:15:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 517BF19289 for ; Sun, 1 Nov 2009 02:15:43 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4Rrp-00043q-00; Sun, 01 Nov 2009 05:16:37 +0100 Date: Sun, 1 Nov 2009 05:13:11 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101041311.GA15210@mike.de> References: <20091031225554.GA30341@mike.de> <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Graham Wakefield wrote: > At the risk of looking stupid ~ currently the makefile installs headers > into /usr/local/include, but no static library libluajit.a (or whatever > it should be called); is embedding LJ2 problematic? Errm, yes, I knew I forgot to mention something in the TODO list. Thank you for reminding me. The plan is to switch to generating a shared library on all platforms (currently only done on Windows). But I haven't gotten around to this, yet. That's why it currently builds everything into the executable. Or do you really want to embed a static library? In this case, simply do this: cd src make ar rcu libluajit-2.0.0-beta1.a lj_*.o lib_*.o Embedding it is actually trivial. Just link against it, like you'd link with liblua.a. No extra setup required. If you've replaced luaL_openlibs(), remember to add the "jit" and "bit" libraries, too. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 02:48:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA14msk8028549; Sun, 1 Nov 2009 02:48:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25D121A68D; Sun, 1 Nov 2009 02:47:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E82871A65C for ; Sun, 1 Nov 2009 02:47:26 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 24D55B9DD1 for ; Sun, 1 Nov 2009 00:48:22 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 01 Nov 2009 00:48:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=O4BhQLHdGnQX5cz7Z19jgYubWE0=; b=cA9rHhcmILCqeZ8CIFwiEGgXJs1i1+m1hoz78kHqyL1EPZUUkjbdnMthCbAq0ISftQ4h1t3I2sJFYfMwGS7U4dqptezRMkPRxSj22hlxTPM/UMqajhkMv5uucE8KWef/2MBWWBGPFSsxyFISMCjmssP3hnvY9O9XeYbXI5gfsnY= X-Sasl-enc: pDDDBMHb4LnHENUrO6mGKYnlw7nyQQr0OkPTe/EAYMWy 1257050901 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3E92749F13B for ; Sun, 1 Nov 2009 00:48:21 -0400 (EDT) Date: Sun, 1 Nov 2009 00:48:50 -0400 From: Jim Pryor To: Lua list Subject: Re: Self-deleting weak tables? Message-ID: <20091101044850.GC11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20091031162319.GB11203@vaio.jimpryor.net> <20091031200314.03aaf35c.froese@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091031200314.03aaf35c.froese@gmx.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Oct 31, 2009 at 08:03:14PM +0100, Edgar Toernig wrote: > and if profiling shows that it's too slow or generates too much > garbage (the {...} table), write a C function that puts the > binary representation into a string: > > int bundle(lua_State *L) > { > lua_Number buf[32]; // assume no padding > int i, n; > > n = lua_gettop(L); > if (n > 32) > luaL_error(L, "sorry pal, too many arguments"); > for (i = 0; i < n; ++i) > buf[i] = luaL_checknumber(L, i+1); > lua_pushlstring(L, (char*)buf, n * sizeof(*buf)); > return 1; > } Nice idea. The arguments aren't restricted to numbers, but I could use this technique to encode whatever the arguments are: switch lua_type(L, i) { case LUA_TNUMBER: // write LUA_TNUMBER, then the number, to buf break; case LUA_TTABLE: // write LUA_TTABLE, then lua_topointer(L, i), to buf break; // etc } If this needs to be fully general, what should I do for strings? I'd have to stuff the whole string into buf, wouldn't I? Perhaps one word to indicate that it's a string, and one word to indicate the length (I guess these could be combined, if I store the length + an offset higher than any LUA_TYPE), followed by the whole string. (I'm sure this would be reinventing the wheel...what do people standardly use for compact, needn't-be-human-readable serialization?) Now, I did say in my original email let's not worry for now about weak keys. However, I do in fact want to have my cache tables weak-keyed too. And this strategy wouldn't work in that case. Here's what I have come up with. It involves one userdatum + one table per self-deleting table, plus two user-datums and four table rows per key,value pair in a self-deleting table. Not horrible; but that is some real overhead. Not sure if it's worth it. Here's the code. The self-deleting table is implemented as a userdatum with __index and __newindex methods. It will start off with size 0, but won't delete itself until its size is incremented and then decreases again to zero. This version has the self-deleting table fully weak (both with keys and values); and non-nil entries can't be overwritten; and when its size gets to zero, it deletes itself from a parent table specified when it was created. This can all be changed. Another way to do the deletion would be to have the parent table be weak-valued, but have a strong ref stored elsewhere to the self-deleting userdatum. When the userdatum's size drops to zero, it deletes that strong ref and then just lets itself be dropped from the parent table and gc'd normally. local pairs, collectgarbage, setmetatable, getmetatable, assert, newproxy = pairs, collectgarbage, setmetatable, getmetatable, assert, newproxy require "debug"; local getfenv, setfenv = debug.getfenv, debug.setfenv local print = print local format, tostring = string.format, tostring local wk_mt = {__mode = 'k'} local function weakkey() return setmetatable({}, wk_mt) end local selfdel_mappings = setmetatable({}, {__mode = 'kv'}) local selfdel_values = setmetatable({}, {__mode = 'v'}) local SIZEKEY, KEYKEY, PARENTKEY local baseuv = newproxy(true) local uv_mt = getmetatable(baseuv) function uv_mt.__gc(self) if self ~= baseuv then local k = selfdel_mappings[self] local env = getfenv(self) if k == nil then else -- value is being gc'd before key local uk = env[k] assert(uk ~= nil and selfdel_mappings[uk] == nil) env[k] = nil end -- we only decrement size in the uv.__gc, in case both uk and uv are gc'd in the same collection cycle local parent = env[PARENTKEY] assert(parent[env[KEYKEY]] ~= nil) local size = env[SIZEKEY] if size == 1 then parent[env[KEYKEY]] = nil else env[SIZEKEY] = size - 1 end end end -- reuse baseuv as a sentinel for the env table SIZEKEY = baseuv local baseuk = newproxy(true) local uk_mt = getmetatable(baseuk) function uk_mt.__gc(self) if self ~= baseuk then local uv = selfdel_mappings[self] assert(selfdel_mappings[uv] == nil) local env = getfenv(self) if uv == nil then -- this key,value already deleted -- parent[key] may still exist, if it has other elements else assert(selfdel_values[uv] ~= nil) selfdel_values[uv] = nil end end end -- reuse baseuk as a sentinel for the env table KEYKEY = baseuk local baseu = newproxy(true) local u_mt = getmetatable(baseu) function u_mt.__index(self, k) local env = getfenv(self) local uk = env[k] local uv = selfdel_mappings[uk] local v = selfdel_values[uv] return v end -- reuse baseu as a sentinel for the env table PARENTKEY = baseu function u_mt.__newindex(self, k, v) local env = getfenv(self) assert(env, "already deleted") assert(env[k] == nil, "can't modify existing entry") if v ~= nil then env[SIZEKEY] = env[SIZEKEY] + 1 local uk = newproxy(baseuk) setfenv(uk, env) env[k] = uk local uv = newproxy(baseuv) setfenv(uv, env) selfdel_values[uv] = v selfdel_mappings[uk] = uv selfdel_mappings[uv] = k end end function make_selfdel(parent, key) local u = newproxy(baseu) local env = weakkey() env[PARENTKEY], env[KEYKEY], env[SIZEKEY] = parent, key, 0 setfenv(u, env) parent[key] = u return u end local function test() local parent = {} local u = make_selfdel(parent, 10) local alpha = setmetatable({}, {__tostring=function() return "alpha" end}) local beta = setmetatable({}, {__tostring=function() return "beta" end}) local gamma = setmetatable({}, {__tostring=function() return "gamma" end}) local delta = setmetatable({}, {__tostring=function() return "delta" end}) local function collect(n) for i=1,n do collectgarbage("collect") end end u[20] = alpha u[30] = beta collect(4) assert(parent[10][20] ~= nil and parent[10][30] ~= nil) beta = nil collect(2) assert(parent[10][20] ~= nil and parent[10][30] == nil) alpha = nil u[delta] = gamma collect(2) assert(parent[10][20] == nil and parent[10][delta] ~= nil) u[20] = delta collect(2) assert(parent[10][20] ~= nil and parent[10][delta] ~= nil) delta = nil gamma = nil collect(2) assert(parent[10] == nil) end I also thought up a different scheme, which needed a number of userdata proportional to the number of non-terminal cache tables one was using, rather than proportional to the number of leaf entries in the cache hierarchy. It's definitely less elegant; I don't know whether it'd be any more efficient. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 04:03:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1638vl003342; Sun, 1 Nov 2009 04:03:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B84D6190B7; Sun, 1 Nov 2009 04:01:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE8A819068 for ; Sun, 1 Nov 2009 04:01:39 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 2CD912F74F0 for ; Sat, 31 Oct 2009 23:02:33 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id l2hZdw1Pgm6J for ; Sat, 31 Oct 2009 23:02:32 -0700 (PDT) Received: from [192.168.1.104] (ResNet-35-220.resnet.ucsb.edu [169.231.35.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 926FA2F74DF for ; Sat, 31 Oct 2009 23:02:32 -0700 (PDT) Message-Id: From: Graham Wakefield To: Lua list In-Reply-To: <20091101041311.GA15210@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Sat, 31 Oct 2009 23:02:32 -0700 References: <20091031225554.GA30341@mike.de> <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> <20091101041311.GA15210@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Great that works perfectly thanks. So fast... On Oct 31, 2009, at 9:13 PM, Mike Pall wrote: > Graham Wakefield wrote: >> At the risk of looking stupid ~ currently the makefile installs >> headers >> into /usr/local/include, but no static library libluajit.a (or >> whatever >> it should be called); is embedding LJ2 problematic? > > Errm, yes, I knew I forgot to mention something in the TODO list. > Thank you for reminding me. > > The plan is to switch to generating a shared library on all > platforms (currently only done on Windows). But I haven't gotten > around to this, yet. That's why it currently builds everything > into the executable. > > Or do you really want to embed a static library? > In this case, simply do this: > > cd src > make > ar rcu libluajit-2.0.0-beta1.a lj_*.o lib_*.o > > Embedding it is actually trivial. Just link against it, like you'd > link with liblua.a. No extra setup required. If you've replaced > luaL_openlibs(), remember to add the "jit" and "bit" libraries, too. > > --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 05:24:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA17OBpJ024499; Sun, 1 Nov 2009 05:24:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3322E19363; Sun, 1 Nov 2009 05:22:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68DA4191F2 for ; Sun, 1 Nov 2009 05:22:35 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 1A2572F74F0 for ; Sun, 1 Nov 2009 00:23:28 -0700 (PDT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sf8eOI0uUol6 for ; Sun, 1 Nov 2009 00:23:27 -0700 (PDT) Received: from [192.168.1.104] (ResNet-35-220.resnet.ucsb.edu [169.231.35.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 33EFC2F74EA for ; Sun, 1 Nov 2009 00:23:27 -0700 (PDT) Message-Id: From: Graham Wakefield To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Sun, 1 Nov 2009 00:23:26 -0700 References: <20091031225554.GA30341@mike.de> <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> <20091101041311.GA15210@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean So, another question: Am I right in thinking that it would be feasible to run multiple independent lua_States in different threads (along the lines of LuaRings)? That is, can the JIT engine itself be instantiated multiple times, with each instance fully encapsulated within a global lua_State (i.e. no statics)? Thanks in advance! On Oct 31, 2009, at 11:02 PM, Graham Wakefield wrote: > Great that works perfectly thanks. > > So fast... > > On Oct 31, 2009, at 9:13 PM, Mike Pall wrote: > >> Graham Wakefield wrote: >>> At the risk of looking stupid ~ currently the makefile installs >>> headers >>> into /usr/local/include, but no static library libluajit.a (or >>> whatever >>> it should be called); is embedding LJ2 problematic? >> >> Errm, yes, I knew I forgot to mention something in the TODO list. >> Thank you for reminding me. >> >> The plan is to switch to generating a shared library on all >> platforms (currently only done on Windows). But I haven't gotten >> around to this, yet. That's why it currently builds everything >> into the executable. >> >> Or do you really want to embed a static library? >> In this case, simply do this: >> >> cd src >> make >> ar rcu libluajit-2.0.0-beta1.a lj_*.o lib_*.o >> >> Embedding it is actually trivial. Just link against it, like you'd >> link with liblua.a. No extra setup required. If you've replaced >> luaL_openlibs(), remember to add the "jit" and "bit" libraries, too. >> >> --Mike > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 06:33:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA18X501031774; Sun, 1 Nov 2009 06:33:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51AF1192D5; Sun, 1 Nov 2009 06:31:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 578C6189C4 for ; Sun, 1 Nov 2009 06:31:36 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id B724CB9724 for ; Sun, 1 Nov 2009 03:32:30 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 01 Nov 2009 03:32:31 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=VBmlh31v58V0fbflZCivAHfE+S0=; b=KCDvCzWv0v0fbEHGtHe44nEg8GCwQX2LAoNAektkkdiFcjeZhMBFYRBsX1imXQDgQuVAKBGm/XY0k9nDqG275zLW2ygR/J3H80BeVXNN8FFcn5GZSNYYZIZEYMBofd0JY6DNwQgNj0L5Iakkbvp0E39nCamTcDhyYlyJ3QOcKa4= X-Sasl-enc: trLpUJUSLON58L/4dhS/dKzNJwnOKC17AnmJup7sykPe 1257064349 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id 98F6661621 for ; Sun, 1 Nov 2009 03:32:29 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091101015235.GA7316@mike.de> Date: Sun, 1 Nov 2009 21:31:56 +1300 Content-Transfer-Encoding: 7bit Message-Id: <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 1/11/2009, at 2:52 PM, Mike Pall wrote: > Geoff Leyland wrote: >> It didn't like my heap code: > > Well, yes and no. First, it's easier to analyze when the different > phases are separated out to individual benchmarks. The total > execution time of all of the test is not very meaningful. > > The heap integrity checks spend 90% - 95% of their time writing > output. This overwhelms the check itself. And I/O functions are > not recorded (yet). Sorry Mike, I owe you an apology - it was clear that LJ2 was faster on the bit that mattered (the speed test) and I didn't think clearly about the not-for-speed integrity check - I had it in my head that it was the integrity check itself that was slow, even though I should have known the problem was io. > But the original test run is dominated by test_sort_queue_speed > which spends a lot of time in table.sort and table.remove. Neither > of which is supported, yet. The former is really hard, but the > latter is trivial to do for the usual "pop-last-element" case. Unless it's interesting to you, the test_sort_queue_speed really isn't relevant. I think it came about because someone on the list asked how bad it was to keep a table sorted rather than use a heap, so I checked (if anyone's is wondering, use a heap!) > The innermost loops seem to run only for very few iterations. And > side exits from it return back to a lower frame than the loop > itself. This case can't be recorded, yet. So it falls back to the > interpreter instead of creating a nice side trace. Fixing this > issue is actually quite high on my list. Thank you for providing a > good test case for it! :-) I'm glad it was useful nonetheless! I'll run some kdtree stuff soon, and I'll be more careful about isolating relevant results. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 06:52:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA18qtwd000853; Sun, 1 Nov 2009 06:52:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BD47192E6; Sun, 1 Nov 2009 06:51:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDA38192B7 for ; Sun, 1 Nov 2009 06:51:33 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so939359eye.39 for ; Sun, 01 Nov 2009 01:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=g/+9+O4D2JIyZmGj8ZG4jzrrKbNDa+wH/aZ7/rrZIWU=; b=YYHvHxu6pi64gTgvuDF004tarvhGMcJMDsceibJjrDC5hHkUDGpdn0ZQXL5PwiTDg2 oKVfKPwYoAWj9/shOfJ/uekKONWXBnPY9hDHzhMQS3RBYzmwd/16qI0bdRE6ILDnTbXX 35a/EhW7iofonPJH5O+Cc71TkeLub7/ygxFkA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=fxJTWGO+fBab6xlY+H4K7XjQ6btQICdt3dIL365fFiwC/fsa8KDZttOs9iaULo4X4Z WrnB+UZZ5JOSxJ32IRUWAD/id4kVbQOAw+VWtBhQo+BX0OScNuJp0nN8yR5oIIskvSLL VV6jKakR3fcr2CIA5DLgMO9eH1N6ASm3zyTJs= Received: by 10.216.86.72 with SMTP id v50mr2814403wee.184.1257065548046; Sun, 01 Nov 2009 01:52:28 -0700 (PDT) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 5sm3103359eyf.1.2009.11.01.01.52.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 01:52:27 -0700 (PDT) Message-Id: <7DAA1994-B523-4F87-A0AA-0E382A570FCC@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <20091031225554.GA30341@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Sun, 1 Nov 2009 09:51:55 +0100 References: <20091031225554.GA30341@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Oct 31, 2009, at 11:59 PM, Mike Pall wrote: > Relative speedup over Lua 5.1.4 on standard Lua benchmarks (e.g. > 11.9 means it's almost twelve times faster): Very nice, very nice :) FWIW, here is what ApacheBench has to say when run against an HTTP stack in pure Lua: % uname -a Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu1228.15.4~1/RELEASE_I386 i386 % ab -n 1000 -k http://127.0.0.1:1080/a % lua -v Nanoki.lua . 0 1080 Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio Requests per second: 773.17 [#/sec] (mean) Time per request: 1.293 [ms] (mean) % luajit -v Nanoki.lua . 0 1080 LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ Requests per second: 1174.19 [#/sec] (mean) Time per request: 0.852 [ms] (mean) Quite a palpable speedup out-of-the-box :)) That said, the main speedup seems to come from a much more streamlined VM, irrespectively of JIT: % luajit -v -joff Nanoki.lua . 0 1080 LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ Requests per second: 1167.37 [#/sec] (mean) Time per request: 0.857 [ms] (mean) P.S. When trying 'luajit -jv' I get an 'unknown luaJIT command'. Did I get the command line options wrong? From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 07:09:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA199XrW002253; Sun, 1 Nov 2009 07:09:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7DA8D1A661; Sun, 1 Nov 2009 07:08:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B554A19178 for ; Sun, 1 Nov 2009 07:08:08 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so409083fgg.17 for ; Sun, 01 Nov 2009 01:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=eU+iPdBURkNTrdMu1Z9c8sCzqUnY5+7h8MoT1Z9q5To=; b=YBe/MRHQS2NonG8AmaSxM49hILYOBbqr4cbeynEZsOTYCU3i0WOpOtauaLWpvOHAzL bAGOZ4pV31zxoxwndY8uqTCB/KlBxMPgAad97GPz+KOX3okWft66JKQa8y4333SwpoQK OdVh3Vxki2Kf4zuv7NmWmGlCJAjYKMPVP0pAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fRAD64c3vLVlZpSQ29f95A4U1aleqMTqfwyd+tB3cjAWbPq0FkjSmbuUzi7jASLs1G FPwg0n1lo+Zm7z3J+2iuC2gejApQUmrcbkYBjO62X6SlQ3o5HmlEOJ6DTj8LKfFbIVAf PGPhFHnkUK5gyRt2e+BxQRV9ctk2xo2b6NnG8= MIME-Version: 1.0 Received: by 10.239.145.129 with SMTP id s1mr374183hba.45.1257066541862; Sun, 01 Nov 2009 01:09:01 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 11:09:01 +0200 Message-ID: <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 1, 2009 at 12:59 AM, Mike Pall wrote: > SciMark composite | > small score | FFT SOR MC SPARSE LU > ----------------------------+--------------------------------------- > GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 ... > JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 What is particularly impressive, from the point of view of someone who has to do serious numerical work occaisionally, is that LJ2 is right up there with the compiled languages for raw performance - and this is just the beta! So, the generalization 'dynamic languages are slow' is now officially outdated. Also, I would suspect that the memory use for LJ2 versus Java would be much less. (So much for another common generalization, that one has to pay for VM use in memory) So, congratulations are in order, as well as the suggestion that the phenomenon named 'Mike Pall' definitely needs more funding! Anyone else who thinks it's time for an MPI binding for Lua? steve d. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 07:16:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA19FwoB002774; Sun, 1 Nov 2009 07:15:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17301A68A; Sun, 1 Nov 2009 07:14:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 61FA419178 for ; Sun, 1 Nov 2009 07:14:40 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 27C88B5D89 for ; Sun, 1 Nov 2009 04:15:36 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 01 Nov 2009 04:15:35 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=17X3u680QmK/Xjj/woUUeDzii6M=; b=NVQ6js+FNShzgVP9Nv9JvvS/THLtEW8P4WKWoEiitKwVankhHrD+mI1Qb9lOwiQUqpF/JGMBFHrOmrV5cFEleJ8/3oST5cM0FVeR2rH2LQUJS9zHnzCwrOCjc2AlE8dgLf4EkCV+AQaN4QtOfR6/vacjydQOtJdkGE3N7EhVCk0= X-Sasl-enc: P0cM6jmuuYRO7bj+7F4FWamx52TosqRtyTgCBulfMMrH 1257066935 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id EFF6749D575 for ; Sun, 1 Nov 2009 04:15:34 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaRocks 2.0.1 From: Geoff Leyland In-Reply-To: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> Date: Sun, 1 Nov 2009 22:15:02 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 28/10/2009, at 5:48 AM, Hisham wrote: > Hello, > > I'm happy to announce LuaRocks 2.0.1, a bugfix release: Hi Hisham, OS X 10.6's 64/32 bit support has caused a few headaches since I rebuilt everything from MacPorts, and I guess most things rebuilt x86_64. LuaJIT however is 32-bit. Rebuilding MacPorts with +universal helped (I never knew what that flag meant...), and then the problem that remained was that LuaRocks didn't build universal binaries. I changed lines 223&4 of cfg.lua to defaults.variables.CC = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch x86_64" defaults.variables.LD = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch x86_64" Which got me a a universal binary for lfs: $ sudo luarocks install luafilesystem ... $ lipo -info /opt/local/lib/lua/5.1/lfs.so Architectures in the fat file: /opt/local/lib/lua/5.1/lfs.so are: i386 x86_64 ... and compatibility with LuaJIT! Would an option for a universal build be worth including in LuaRocks? (note that I don't know that this is the *right* way to change cfg.lua, it's just a way that seems to get me what I want) Cheers and thanks, Geoff From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 07:24:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA19O4fV003513; Sun, 1 Nov 2009 07:24:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8D5E192E3; Sun, 1 Nov 2009 07:22:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.herrje.net (reed.herrje.net [62.75.227.78]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78FD1192C1 for ; Sun, 1 Nov 2009 07:22:46 -0200 (BRST) Received: from papaya.tek (dslb-088-075-201-223.pools.arcor-ip.net [88.75.201.223]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.herrje.net (Postfix) with ESMTPSA id 40139515E6 for ; Sun, 1 Nov 2009 10:23:42 +0100 (CET) Received: from paradies.tek (paradies.tek [192.168.0.17]) by papaya.tek (Postfix) with SMTP id F0D55149B for ; Sun, 1 Nov 2009 10:23:40 +0100 (CET) Date: Sun, 1 Nov 2009 10:23:40 +0100 From: "Timm S. Mueller" To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-Id: <20091101102340.2f2e8479.tmueller@schulze-mueller.de> In-Reply-To: <20091101023229.GA10905@mike.de> References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> <20091101020943.GA8663@mike.de> <20091101023229.GA10905@mike.de> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 1 Nov 2009 03:32:29 +0100 Mike Pall wrote: > > Currently LJ2 happily misinterprets negative indexes for these > > functions. Sooo ... what to do? I guess I'll have to bite the > > bullet and support some undefined behavior, too. :-/ > > > > Patch will follow shortly. > > Ok, here it is. Timm, can you please check whether this fixes > your original problem? Thank you! Yes, now it works like a charm. Thank you! - Timm -- Timm S. Mueller Schulze & Mueller GbR, Gryphiusstr. 2, 10245 Berlin, Gesellschafter: Franciska Schulze, Timm S. Mueller, Tel. +49 30 93624410, http://www.schulze-mueller.de/ From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 07:38:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA19c64v004666; Sun, 1 Nov 2009 07:38:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B0ECE192E8; Sun, 1 Nov 2009 07:36:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38D02192D9 for ; Sun, 1 Nov 2009 07:36:03 -0200 (BRST) Received: by pzk34 with SMTP id 34so2791395pzk.11 for ; Sun, 01 Nov 2009 01:36:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.26.40 with SMTP id d40mr358814wfj.232.1257068217091; Sun, 01 Nov 2009 01:36:57 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 03:36:57 -0600 Message-ID: <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Steven Johnson To: Lua list Content-Type: multipart/mixed; boundary=001636e0ae8e89c65804774c0043 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e0ae8e89c65804774c0043 Content-Type: text/plain; charset=ISO-8859-1 I'm running into some issue with module() and / or environments. The attached file is a dump of the package table, just before an error gets thrown: "attempt to index global 'widgetops' (a nil value)". All the standard libs (Lua libs, bit, jit, etc.) look like they install correctly, on startup. I first put a wrapper around module(), so I can debug without messing with package.seeall or caching functions: local _G = _G local getfenv = getfenv local getmetatable = getmetatable local loaded = package.loaded local setfenv = setfenv local setmetatable = setmetatable local type = type -- Extend the module function. local old_module = module local imports = { gprintf_temp_at = true, messagef = true, printf = true, vardump = true } function module (name, ...) old_module(name, ...) local mtable = loaded[name] local meta = getmetatable(mtable) or {} local index = meta.__index local itype = type(index) function meta.__index (t, k) if imports[k] then return _G[k] elseif itype == "function" then return index(t, k) elseif itype == "table" then return index[k] end end setmetatable(mtable, meta) setfenv(2, getfenv()) end This seems to work fine in LJ1 and stock Lua. If I skip this step the error I'm describing here doesn't seem to happen, but I then run into something else. :( Next I start loading module files. I use module() but instead of require() just loadfile() these files in order and read the globals they emit. It may be relevant that my loader setfenv()'s each chunk with a table I provide, which is _G in all pre-error cases. I first load up some base Lua modules: coroutine_ex, coroutineops, varops, and a few more. These all look okay. I then load up some C++ modules via luaL_register(), and this seems fine, as evidenced by math_ex. At this point I go back Lua-side and something odd happens: effect, graphicshelpers, list, etc. and finally the offending widgetops are loaded. These do not look okay: each one inserts itself into the previous table, as seen about a third of the way down the file. Their functions, on the other hand, inject themselves into _G (this is most of the stuff from the beginning of the file up to the "_G = CYCLE..." part). So the roles seem to get reversed. Any ideas? What seems most odd to me is the change from before to after the luaL_register()... --001636e0ae8e89c65804774c0043 Content-Type: text/plain; charset=US-ASCII; name="package.txt" Content-Disposition: attachment; filename="package.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1hlrqr30 dGFibGU6IHsNCiAgIGNvbmZpZyA9ICJcDQo7DQo/DQohDQotIg0KICAgY3BhdGggPSAiLlw/LmRs bDtjOlxSZXBvc2l0b3JpZXNcSWNlYnJlYWtlcnNcZ2FtZVxyZWxlYXNlXD8uZGxsO2M6XFJlcG9z aXRvcmllc1xJY2VicmVha2Vyc1xnYW1lXHJlbGVhc2VcbG9hZGFsbC5kbGwiDQogICBsb2FkZWQg PSB7DQogICAgICBfRyA9IHsNCiAgICAgICAgIEFkZEFmdGVyID0gZnVuY3Rpb246IDB4MDMxMDg0 ZmMNCiAgICAgICAgIEFuaW1UZXh0dXJlID0gZnVuY3Rpb246IDB4MDMxMTU3M2MNCiAgICAgICAg IEFwcGVuZCA9IGZ1bmN0aW9uOiAweDAzMDAxNTljDQogICAgICAgICBBdHRhY2hUb1Jvb3QgPSBm dW5jdGlvbjogMHgwMzAxNzgzYw0KICAgICAgICAgQXVnbWVudFNpZ25hbCA9IGZ1bmN0aW9uOiAw eDAzMTBjOTdjDQogICAgICAgICBCYWNrID0gZnVuY3Rpb246IDB4MDMwMGIzYmMNCiAgICAgICAg IEJhY2tUb0Zyb250SXRlciA9IGZ1bmN0aW9uOiAweDAzMDE0MzVjDQogICAgICAgICBCb3hJbkJv eCA9IGZ1bmN0aW9uOiAweDAzMDAwYmZjDQogICAgICAgICBCb3hJbnRlcnNlY3Rpb24gPSBmdW5j dGlvbjogMHgwMzEwMGQzYw0KICAgICAgICAgQm94ZXNJbnRlcnNlY3QgPSBmdW5jdGlvbjogMHgw MzAwMGI5Yw0KICAgICAgICAgQnV0dG9uU3R5bGVSZW5kZXIgPSBmdW5jdGlvbjogMHgwMzAxNzhi Yw0KICAgICAgICAgQ2hvb3NlID0gZnVuY3Rpb246IDB4MDMxMDFmYmMNCiAgICAgICAgIENob29z ZU11bHRpID0gZnVuY3Rpb246IDB4MDMxMDU3N2MNCiAgICAgICAgIENsYW1wSW4gPSBmdW5jdGlv bjogMHgwMzEwMGRiYw0KICAgICAgICAgQ2xlYXIgPSBmdW5jdGlvbjogMHgwMzAxNjdkYw0KICAg ICAgICAgRGVmaW5lT3duZWRXaWRnZXQgPSBmdW5jdGlvbjogMHgwMzEwY2M3Yw0KICAgICAgICAg RGlhZ25vc3RpY3MgPSBmdW5jdGlvbjogMHgwMzAwMDA3Yw0KICAgICAgICAgRHJhd1N0cmluZyA9 IGZ1bmN0aW9uOiAweDAzMDE3YjFjDQogICAgICAgICBGcm9udFRvQmFja0l0ZXIgPSBmdW5jdGlv bjogMHgwMzAxMTQ3Yw0KICAgICAgICAgR2V0U2l6ZSA9IGZ1bmN0aW9uOiAweDAzMDBiNGJjDQog ICAgICAgICBHZXRTb3J0ZWRLZXlzID0gZnVuY3Rpb246IDB4MDMxMDdmM2MNCiAgICAgICAgIEdl dFNvcnRlZEtleXNfID0gZnVuY3Rpb246IDB4MDMxMDdmM2MNCiAgICAgICAgIEdldFN0cmluZ09w cyA9IGZ1bmN0aW9uOiAweDAzMTBkMWJjDQogICAgICAgICBJblJhbmdlID0gZnVuY3Rpb246IDB4 MDMwMTVkM2MNCiAgICAgICAgIEluc2VydCA9IGZ1bmN0aW9uOiAweDAzMDE2N2ZjDQogICAgICAg ICBJc0VtcHR5ID0gZnVuY3Rpb246IDB4MDMwMTY4M2MNCiAgICAgICAgIExhdHRpY2VVViA9IGZ1 bmN0aW9uOiAweDAzMTE1MWZjDQogICAgICAgICBMaXN0ZW5Ub1Rhc2tzID0gZnVuY3Rpb246IDB4 MDMwMTc5OWMNCiAgICAgICAgIExvYWQgPSBmdW5jdGlvbjogMHgwMzEwMDdiYw0KICAgICAgICAg TWVzc2FnZXIgPSB1c2VyZGF0YTogMHgwMzAxMzZiNA0KICAgICAgICAgTXVsdGlQaWN0dXJlID0g ZnVuY3Rpb246IDB4MDMxMTU3YmMNCiAgICAgICAgIE5hbWVkTGlzdFNvcnRlciA9IGZ1bmN0aW9u OiAweDAzMDE2MmJjDQogICAgICAgICBOZXh0ID0gZnVuY3Rpb246IDB4MDMwMGI0OWMNCiAgICAg ICAgIFBpY3R1cmUgPSBmdW5jdGlvbjogMHgwMzAxNTJmYw0KICAgICAgICAgUG9pbnRJbkJveCA9 IGZ1bmN0aW9uOiAweDAzMDAwZWRjDQogICAgICAgICBQcmV2ID0gZnVuY3Rpb246IDB4MDMwMTQx N2MNCiAgICAgICAgIFB1cmdlQXR0YWNoTGlzdCA9IGZ1bmN0aW9uOiAweDAzMDE3OWRjDQogICAg ICAgICBSYW5nZU92ZXJsYXAgPSBmdW5jdGlvbjogMHgwMzAwMGVmYw0KICAgICAgICAgUmVjdCA9 IGZ1bmN0aW9uOiAweDAzMDAwYWZjDQogICAgICAgICBSZW1vdmUgPSBmdW5jdGlvbjogMHgwMzEw ODhiYw0KICAgICAgICAgUmVtb3ZlRnJvbSA9IGZ1bmN0aW9uOiAweDAzMTEyZjdjDQogICAgICAg ICBSb290ID0gZnVuY3Rpb246IDB4MDMwMTY4NWMNCiAgICAgICAgIFJvdGF0ZUluZGV4ID0gZnVu Y3Rpb246IDB4MDMwMTVjZmMNCiAgICAgICAgIFJvdGF0ZUluZGV4SW5SYW5nZSA9IGZ1bmN0aW9u OiAweDAzMDE1ZDFjDQogICAgICAgICBTZXRMb2NhbFJlY3QgPSBmdW5jdGlvbjogMHgwMzAxNzlm Yw0KICAgICAgICAgU29ydFBhaXJzID0gZnVuY3Rpb246IDB4MDMwMTVkNWMNCiAgICAgICAgIFN0 YXRlU3dpdGNoID0gZnVuY3Rpb246IDB4MDMwMTdhMWMNCiAgICAgICAgIFN0cmluZ0dldEggPSBm dW5jdGlvbjogMHgwMzAxN2I5Yw0KICAgICAgICAgU3RyaW5nR2V0VyA9IGZ1bmN0aW9uOiAweDAz MDE3YzVjDQogICAgICAgICBTdHJpbmdTaXplID0gZnVuY3Rpb246IDB4MDMwMTdiZmMNCiAgICAg ICAgIFN3YXBJZiA9IGZ1bmN0aW9uOiAweDAzMDE1ZDdjDQogICAgICAgICBUZXh0dXJlID0gZnVu Y3Rpb246IDB4MDMwMTUzMWMNCiAgICAgICAgIFRyYXBlem9pZCA9IGZ1bmN0aW9uOiAweDAzMDE1 ZDljDQogICAgICAgICBYT1IgPSBmdW5jdGlvbjogMHgwMzAxNWRiYw0KICAgICAgICAgX0cgPSBD WUNMRSwgdGFibGU6IDB4MDIwNzBlYTANCiAgICAgICAgIF9WRVJTSU9OID0gIkx1YSA1LjEiDQog ICAgICAgICBhc3NlcnQgPSBmdW5jdGlvbjogZmFzdCMyDQogICAgICAgICBiVXNpbmdKSVQgPSB0 cnVlDQogICAgICAgICBiaXQgPSB7DQogICAgICAgICAgICBhcnNoaWZ0ID0gZnVuY3Rpb246IGZh c3QjNzANCiAgICAgICAgICAgIGJhbmQgPSBmdW5jdGlvbjogZmFzdCM3Mw0KICAgICAgICAgICAg Ym5vdCA9IGZ1bmN0aW9uOiBmYXN0IzY2DQogICAgICAgICAgICBib3IgPSBmdW5jdGlvbjogZmFz dCM3NA0KICAgICAgICAgICAgYnN3YXAgPSBmdW5jdGlvbjogZmFzdCM2Nw0KICAgICAgICAgICAg YnhvciA9IGZ1bmN0aW9uOiBmYXN0Izc1DQogICAgICAgICAgICBsc2hpZnQgPSBmdW5jdGlvbjog ZmFzdCM2OA0KICAgICAgICAgICAgcm9sID0gZnVuY3Rpb246IGZhc3QjNzENCiAgICAgICAgICAg IHJvciA9IGZ1bmN0aW9uOiBmYXN0IzcyDQogICAgICAgICAgICByc2hpZnQgPSBmdW5jdGlvbjog ZmFzdCM2OQ0KICAgICAgICAgICAgdG9iaXQgPSBmdW5jdGlvbjogZmFzdCM2NQ0KICAgICAgICAg ICAgdG9oZXggPSBmdW5jdGlvbjogZmFzdCM3Ng0KICAgICAgICAgfSAodGFibGU6IDB4MDIwNzU5 ZDgpDQogICAgICAgICBjbGFzcyA9IHsNCiAgICAgICAgICAgIERlZmluZSA9IGZ1bmN0aW9uOiAw eDAzMTg4ZWZjDQogICAgICAgICAgICBFeGlzdHMgPSBmdW5jdGlvbjogMHgwMzAwODk3Yw0KICAg ICAgICAgICAgR2V0TWVtYmVyID0gZnVuY3Rpb246IDB4MDMwMDg5OWMNCiAgICAgICAgICAgIEhp ZGRlbiA9IHsNCiAgICAgICAgICAgIH0gKHRhYmxlOiAweDAzMTA2YTNjKQ0KICAgICAgICAgICAg SXNJbnN0YW5jZSA9IGZ1bmN0aW9uOiAweDAzMDA4OWJjDQogICAgICAgICAgICBJc1R5cGUgPSBm dW5jdGlvbjogMHgwMzEwNmZiYw0KICAgICAgICAgICAgTGluZWFyaXphdGlvbiA9IGZ1bmN0aW9u OiAweDAzMTA2ZmZjDQogICAgICAgICAgICBOZXcgPSBmdW5jdGlvbjogMHgwMzEwNzEzYw0KICAg ICAgICAgICAgTmV3QXJyYXkgPSBmdW5jdGlvbjogMHgwMzEwNzE3Yw0KICAgICAgICAgICAgU3Vw ZXJDb25zID0gZnVuY3Rpb246IDB4MDMxMDcwN2MNCiAgICAgICAgICAgIFN1cGVycyA9IGZ1bmN0 aW9uOiAweDAzMTA3MWJjDQogICAgICAgICAgICBUeXBlID0gZnVuY3Rpb246IDB4MDMxMDcxZmMN CiAgICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTA2YmJjDQogICAgICAgICAgICBf TkFNRSA9ICJjbGFzcyINCiAgICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgIH0gKHRh YmxlOiAweDAzMTA2YmJjKQ0KICAgICAgICAgY29sbGVjdGdhcmJhZ2UgPSBmdW5jdGlvbjogZmFz dCMyNw0KICAgICAgICAgY29yb3V0aW5lID0gew0KICAgICAgICAgICAgY3JlYXRlID0gZnVuY3Rp b246IGZhc3QjMzINCiAgICAgICAgICAgIHJlc3VtZSA9IGZ1bmN0aW9uOiBmYXN0IzM0DQogICAg ICAgICAgICBydW5uaW5nID0gZnVuY3Rpb246IGZhc3QjMzENCiAgICAgICAgICAgIHN0YXR1cyA9 IGZ1bmN0aW9uOiBmYXN0IzMwDQogICAgICAgICAgICB3cmFwID0gZnVuY3Rpb246IGZhc3QjMzYN CiAgICAgICAgICAgIHlpZWxkID0gZnVuY3Rpb246IGZhc3QjMzMNCiAgICAgICAgIH0gKHRhYmxl OiAweDAyMDcyOWUwKQ0KICAgICAgICAgY29yb3V0aW5lX2V4ID0gew0KICAgICAgICAgICAgQ3Jl YXRlID0gZnVuY3Rpb246IDB4MDMxODYwZmMNCiAgICAgICAgICAgIFJlc2V0ID0gZnVuY3Rpb246 IDB4MDMxMDQ3ZmMNCiAgICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTA0NWZjDQog ICAgICAgICAgICBfTkFNRSA9ICJjb3JvdXRpbmVfZXgiDQogICAgICAgICAgICBfUEFDS0FHRSA9 ICIiDQogICAgICAgICB9ICh0YWJsZTogMHgwMzEwNDVmYykNCiAgICAgICAgIGNvcm91dGluZW9w cyA9IHsNCiAgICAgICAgICAgIFdhaXQgPSBmdW5jdGlvbjogMHgwMzAwNzNiYw0KICAgICAgICAg ICAgV2FpdEZvck11bHRpcGxlU2lnbmFscyA9IGZ1bmN0aW9uOiAweDAzMTA1NmJjDQogICAgICAg ICAgICBXYWl0Rm9yU2lnbmFsID0gZnVuY3Rpb246IDB4MDMwMDc0NWMNCiAgICAgICAgICAgIFdh aXRVbnRpbCA9IGZ1bmN0aW9uOiAweDAzMDA3NDdjDQogICAgICAgICAgICBXYWl0VW50aWxfTWV0 aG9kID0gZnVuY3Rpb246IDB4MDMwMDc0OWMNCiAgICAgICAgICAgIFdhaXRXaGlsZSA9IGZ1bmN0 aW9uOiAweDAzMDA3NGJjDQogICAgICAgICAgICBXYWl0V2hpbGVfTWV0aG9kID0gZnVuY3Rpb246 IDB4MDMwMDc0ZGMNCiAgICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTA1NTdjDQog ICAgICAgICAgICBfTkFNRSA9ICJjb3JvdXRpbmVvcHMiDQogICAgICAgICAgICBfUEFDS0FHRSA9 ICIiDQogICAgICAgICB9ICh0YWJsZTogMHgwMzEwNTU3YykNCiAgICAgICAgIGRlYnVnID0gew0K ICAgICAgICAgICAgZGVidWcgPSBmdW5jdGlvbjogZmFzdCMxNDQNCiAgICAgICAgICAgIGdldGZl bnYgPSBmdW5jdGlvbjogZmFzdCMxMzUNCiAgICAgICAgICAgIGdldGhvb2sgPSBmdW5jdGlvbjog ZmFzdCMxNDMNCiAgICAgICAgICAgIGdldGluZm8gPSBmdW5jdGlvbjogZmFzdCMxMzcNCiAgICAg ICAgICAgIGdldGxvY2FsID0gZnVuY3Rpb246IGZhc3QjMTM4DQogICAgICAgICAgICBnZXRtZXRh dGFibGUgPSBmdW5jdGlvbjogZmFzdCMxMzMNCiAgICAgICAgICAgIGdldHJlZ2lzdHJ5ID0gZnVu Y3Rpb246IGZhc3QjMTMyDQogICAgICAgICAgICBnZXR1cHZhbHVlID0gZnVuY3Rpb246IGZhc3Qj MTQwDQogICAgICAgICAgICBzZXRmZW52ID0gZnVuY3Rpb246IGZhc3QjMTM2DQogICAgICAgICAg ICBzZXRob29rID0gZnVuY3Rpb246IGZhc3QjMTQyDQogICAgICAgICAgICBzZXRsb2NhbCA9IGZ1 bmN0aW9uOiBmYXN0IzEzOQ0KICAgICAgICAgICAgc2V0bWV0YXRhYmxlID0gZnVuY3Rpb246IGZh c3QjMTM0DQogICAgICAgICAgICBzZXR1cHZhbHVlID0gZnVuY3Rpb246IGZhc3QjMTQxDQogICAg ICAgICAgICB0cmFjZWJhY2sgPSBmdW5jdGlvbjogZmFzdCMxNDUNCiAgICAgICAgIH0gKHRhYmxl OiAweDAyMDc1NTEwKQ0KICAgICAgICAgZG9maWxlID0gZnVuY3Rpb246IGZhc3QjMjUNCiAgICAg ICAgIGVmZmVjdCA9IHsNCiAgICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTE0ZGJj DQogICAgICAgICAgICBfTkFNRSA9ICJlZmZlY3QiDQogICAgICAgICAgICBfUEFDS0FHRSA9ICIi DQogICAgICAgICAgICBncmFwaGljc2hlbHBlcnMgPSB7DQogICAgICAgICAgICAgICBfTSA9IENZ Q0xFLCB0YWJsZTogMHgwMzExNTYzYw0KICAgICAgICAgICAgICAgX05BTUUgPSAiZ3JhcGhpY3No ZWxwZXJzIg0KICAgICAgICAgICAgICAgX1BBQ0tBR0UgPSAiIg0KICAgICAgICAgICAgICAgbGlz dCA9IHsNCiAgICAgICAgICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTAyN2JjDQog ICAgICAgICAgICAgICAgICBfTkFNRSA9ICJsaXN0Ig0KICAgICAgICAgICAgICAgICAgX1BBQ0tB R0UgPSAiIg0KICAgICAgICAgICAgICAgICAgbm9uZGV0ZXJtaW5pc21fb3BzID0gew0KICAgICAg ICAgICAgICAgICAgICAgX00gPSBDWUNMRSwgdGFibGU6IDB4MDMxMDljM2MNCiAgICAgICAgICAg ICAgICAgICAgIF9OQU1FID0gIm5vbmRldGVybWluaXNtX29wcyINCiAgICAgICAgICAgICAgICAg ICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgICAgICAgICAgICAgIG51bWVyaWNvcHMgPSB7DQog ICAgICAgICAgICAgICAgICAgICAgICBfTSA9IENZQ0xFLCB0YWJsZTogMHgwMzEwMDdmYw0KICAg ICAgICAgICAgICAgICAgICAgICAgX05BTUUgPSAibnVtZXJpY29wcyINCiAgICAgICAgICAgICAg ICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgICAgICAgICAgICAgICAgIG9wYnVpbGRl cnMgPSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICBfTSA9IENZQ0xFLCB0YWJsZTogMHgw MzEwN2E3Yw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgX05BTUUgPSAib3BidWlsZGVycyIN CiAgICAgICAgICAgICAgICAgICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNrZXdoZWFwID0gew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg X00gPSBDWUNMRSwgdGFibGU6IDB4MDMxMDg2N2MNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIF9OQU1FID0gInNrZXdoZWFwIg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX1BB Q0tBR0UgPSAiIg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkZ2V0b3BzID0gew0K ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX00gPSBDWUNMRSwgdGFibGU6IDB4MDMx MGM1YmMNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9OQU1FID0gIndpZGdldG9w cyINCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIH0gKHRhYmxlOiAweDAzMTBjNWJjKQ0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgfSAodGFibGU6IDB4MDMxMDg2N2MpDQogICAgICAgICAgICAgICAg ICAgICAgICB9ICh0YWJsZTogMHgwMzEwN2E3YykNCiAgICAgICAgICAgICAgICAgICAgIH0gKHRh YmxlOiAweDAzMTAwN2ZjKQ0KICAgICAgICAgICAgICAgICAgfSAodGFibGU6IDB4MDMxMDljM2Mp DQogICAgICAgICAgICAgICB9ICh0YWJsZTogMHgwMzEwMjdiYykNCiAgICAgICAgICAgIH0gKHRh YmxlOiAweDAzMTE1NjNjKQ0KICAgICAgICAgfSAodGFibGU6IDB4MDMxMTRkYmMpDQogICAgICAg ICBlcnJvciA9IGZ1bmN0aW9uOiBmYXN0IzE5DQogICAgICAgICBmdW5jb3BzID0gew0KICAgICAg ICAgICAgQ2FsbCA9IGZ1bmN0aW9uOiAweDAzMDA0MWJjDQogICAgICAgICAgICBDYWxsTWV0aG9k ID0gZnVuY3Rpb246IDB4MDMwMDQxZGMNCiAgICAgICAgICAgIENhbGxPckdldCA9IGZ1bmN0aW9u OiAweDAzMDA0MWZjDQogICAgICAgICAgICBHZXRMYXN0VHJhY2ViYWNrID0gZnVuY3Rpb246IDB4 MDMwMDQ0N2MNCiAgICAgICAgICAgIEdldFRpbWVMYXBzZUZ1bmMgPSBmdW5jdGlvbjogMHgwMzAw NDQzYw0KICAgICAgICAgICAgSWRlbnRpdHkgPSBmdW5jdGlvbjogMHgwMzAwNDIzYw0KICAgICAg ICAgICAgSWRlbnRpdHlfMSA9IGZ1bmN0aW9uOiAweDAzMDA0MjVjDQogICAgICAgICAgICBOb09w ID0gZnVuY3Rpb246IDB4MDMwMDQyN2MNCiAgICAgICAgICAgIFByb3h5ID0gZnVuY3Rpb246IDB4 MDMxMDI3ZmMNCiAgICAgICAgICAgIFNldFRpbWVMYXBzZUZ1bmMgPSBmdW5jdGlvbjogMHgwMzEw MmEzYw0KICAgICAgICAgICAgU2V0VHJhY2ViYWNrRnVuYyA9IGZ1bmN0aW9uOiAweDAzMTAwM2Zj DQogICAgICAgICAgICBTdG9yZVRyYWNlYmFjayA9IGZ1bmN0aW9uOiAweDAzMTAwZTdjDQogICAg ICAgICAgICBXaXRoUmVzb3VyY2UgPSBmdW5jdGlvbjogMHgwMzEwMjhiYw0KICAgICAgICAgICAg X00gPSBDWUNMRSwgdGFibGU6IDB4MDMxMDIwN2MNCiAgICAgICAgICAgIF9OQU1FID0gImZ1bmNv cHMiDQogICAgICAgICAgICBfUEFDS0FHRSA9ICIiDQogICAgICAgICB9ICh0YWJsZTogMHgwMzEw MjA3YykNCiAgICAgICAgIGdjaW5mbyA9IGZ1bmN0aW9uOiBmYXN0IzI2DQogICAgICAgICBnZXRm ZW52ID0gZnVuY3Rpb246IGZhc3QjNg0KICAgICAgICAgZ2V0bWV0YXRhYmxlID0gZnVuY3Rpb246 IGZhc3QjNA0KICAgICAgICAgZ3ByaW50Zl90ZW1wX2F0ID0gZnVuY3Rpb246IDB4MDMxMDAwYmMN CiAgICAgICAgIGlvID0gew0KICAgICAgICAgICAgY2xvc2UgPSBmdW5jdGlvbjogZmFzdCMxMTEN CiAgICAgICAgICAgIGZsdXNoID0gZnVuY3Rpb246IGZhc3QjMTE0DQogICAgICAgICAgICBpbnB1 dCA9IGZ1bmN0aW9uOiBmYXN0IzExNw0KICAgICAgICAgICAgbGluZXMgPSBmdW5jdGlvbjogZmFz dCMxMTYNCiAgICAgICAgICAgIG9wZW4gPSBmdW5jdGlvbjogZmFzdCMxMDkNCiAgICAgICAgICAg IG91dHB1dCA9IGZ1bmN0aW9uOiBmYXN0IzExOA0KICAgICAgICAgICAgcG9wZW4gPSBmdW5jdGlv bjogZmFzdCMxMjANCiAgICAgICAgICAgIHJlYWQgPSBmdW5jdGlvbjogZmFzdCMxMTINCiAgICAg ICAgICAgIHN0ZGVyciA9IGZpbGUgKDB4NzI4YzFiYjgpDQogICAgICAgICAgICBzdGRpbiA9IGZp bGUgKDB4NzI4YzFiNzgpDQogICAgICAgICAgICBzdGRvdXQgPSBmaWxlICgweDcyOGMxYjk4KQ0K ICAgICAgICAgICAgdG1wZmlsZSA9IGZ1bmN0aW9uOiBmYXN0IzExMA0KICAgICAgICAgICAgdHlw ZSA9IGZ1bmN0aW9uOiBmYXN0IzExOQ0KICAgICAgICAgICAgd3JpdGUgPSBmdW5jdGlvbjogZmFz dCMxMTMNCiAgICAgICAgIH0gKHRhYmxlOiAweDAyMDczYWQwKQ0KICAgICAgICAgaXBhaXJzID0g ZnVuY3Rpb246IGZhc3QjMTgNCiAgICAgICAgIGl0ZXJhdG9ycyA9IHsNCiAgICAgICAgICAgIEFQ YWlycyA9IGZ1bmN0aW9uOiAweDAzMTAwNTNjDQogICAgICAgICAgICBDYWNoZWRDYWxsYmFjayA9 IGZ1bmN0aW9uOiAweDAzMTAwMzNjDQogICAgICAgICAgICBJUGFpcnNSID0gZnVuY3Rpb246IDB4 MDMwMDFiOWMNCiAgICAgICAgICAgIElQYWlyc1RoZW5JdGVtID0gZnVuY3Rpb246IDB4MDMxMDBj M2MNCiAgICAgICAgICAgIEl0ZW1UaGVuSVBhaXJzID0gZnVuY3Rpb246IDB4MDMxMDA4N2MNCiAg ICAgICAgICAgIF9NID0gQ1lDTEUsIHRhYmxlOiAweDAzMTAyYWJjDQogICAgICAgICAgICBfTkFN RSA9ICJpdGVyYXRvcnMiDQogICAgICAgICAgICBfUEFDS0FHRSA9ICIiDQogICAgICAgICB9ICh0 YWJsZTogMHgwMzEwMmFiYykNCiAgICAgICAgIGppdCA9IHsNCiAgICAgICAgICAgIGFyY2ggPSAi eDg2Ig0KICAgICAgICAgICAgYXR0YWNoID0gZnVuY3Rpb246IGZhc3QjMTUwDQogICAgICAgICAg ICBmbHVzaCA9IGZ1bmN0aW9uOiBmYXN0IzE0OA0KICAgICAgICAgICAgb2ZmID0gZnVuY3Rpb246 IGZhc3QjMTQ3DQogICAgICAgICAgICBvbiA9IGZ1bmN0aW9uOiBmYXN0IzE0Ng0KICAgICAgICAg ICAgb3B0ID0gew0KICAgICAgICAgICAgICAgc3RhcnQgPSBmdW5jdGlvbjogZmFzdCMxNjENCiAg ICAgICAgICAgIH0gKHRhYmxlOiAweDAyMDc2NmEwKQ0KICAgICAgICAgICAgc3RhdHVzID0gZnVu Y3Rpb246IGZhc3QjMTQ5DQogICAgICAgICAgICB1dGlsID0gew0KICAgICAgICAgICAgICAgZnVu Y2JjID0gZnVuY3Rpb246IGZhc3QjMTUyDQogICAgICAgICAgICAgICBmdW5jaW5mbyA9IGZ1bmN0 aW9uOiBmYXN0IzE1MQ0KICAgICAgICAgICAgICAgZnVuY2sgPSBmdW5jdGlvbjogZmFzdCMxNTMN CiAgICAgICAgICAgICAgIGZ1bmN1dm5hbWUgPSBmdW5jdGlvbjogZmFzdCMxNTQNCiAgICAgICAg ICAgICAgIHRyYWNlZXhpdHN0dWIgPSBmdW5jdGlvbjogZmFzdCMxNjANCiAgICAgICAgICAgICAg IHRyYWNlaW5mbyA9IGZ1bmN0aW9uOiBmYXN0IzE1NQ0KICAgICAgICAgICAgICAgdHJhY2VpciA9 IGZ1bmN0aW9uOiBmYXN0IzE1Ng0KICAgICAgICAgICAgICAgdHJhY2VrID0gZnVuY3Rpb246IGZh c3QjMTU3DQogICAgICAgICAgICAgICB0cmFjZW1jID0gZnVuY3Rpb246IGZhc3QjMTU5DQogICAg ICAgICAgICAgICB0cmFjZXNuYXAgPSBmdW5jdGlvbjogZmFzdCMxNTgNCiAgICAgICAgICAgIH0g KHRhYmxlOiAweDAyMDc2MTY4KQ0KICAgICAgICAgICAgdmVyc2lvbiA9ICJMdWFKSVQgMi4wLjAt YmV0YTEiDQogICAgICAgICAgICB2ZXJzaW9uX251bSA9IDIwMDAwDQogICAgICAgICB9ICh0YWJs ZTogMHgwMjA3NWVlOCkNCiAgICAgICAgIGxvYWQgPSBmdW5jdGlvbjogZmFzdCMyNA0KICAgICAg ICAgbG9hZGZpbGUgPSBmdW5jdGlvbjogZmFzdCMyMw0KICAgICAgICAgbG9hZHN0cmluZyA9IGZ1 bmN0aW9uOiBmYXN0IzIyDQogICAgICAgICBtYXRoID0gew0KICAgICAgICAgICAgYWJzID0gZnVu Y3Rpb246IGZhc3QjMzcNCiAgICAgICAgICAgIGFjb3MgPSBmdW5jdGlvbjogZmFzdCM0OA0KICAg ICAgICAgICAgYXNpbiA9IGZ1bmN0aW9uOiBmYXN0IzQ3DQogICAgICAgICAgICBhdGFuID0gZnVu Y3Rpb246IGZhc3QjNDkNCiAgICAgICAgICAgIGF0YW4yID0gZnVuY3Rpb246IGZhc3QjNTcNCiAg ICAgICAgICAgIGNlaWwgPSBmdW5jdGlvbjogZmFzdCMzOQ0KICAgICAgICAgICAgY29zID0gZnVu Y3Rpb246IGZhc3QjNDUNCiAgICAgICAgICAgIGNvc2ggPSBmdW5jdGlvbjogZmFzdCM1MQ0KICAg ICAgICAgICAgZGVnID0gZnVuY3Rpb246IGZhc3QjNTUNCiAgICAgICAgICAgIGV4cCA9IGZ1bmN0 aW9uOiBmYXN0IzQzDQogICAgICAgICAgICBmbG9vciA9IGZ1bmN0aW9uOiBmYXN0IzM4DQogICAg ICAgICAgICBmbW9kID0gZnVuY3Rpb246IGZhc3QjNjANCiAgICAgICAgICAgIGZyZXhwID0gZnVu Y3Rpb246IGZhc3QjNTMNCiAgICAgICAgICAgIGh1Z2UgPSAxLiNJTkYNCiAgICAgICAgICAgIGxk ZXhwID0gZnVuY3Rpb246IGZhc3QjNTgNCiAgICAgICAgICAgIGxvZyA9IGZ1bmN0aW9uOiBmYXN0 IzQxDQogICAgICAgICAgICBsb2cxMCA9IGZ1bmN0aW9uOiBmYXN0IzQyDQogICAgICAgICAgICBt YXggPSBmdW5jdGlvbjogZmFzdCM2Mg0KICAgICAgICAgICAgbWluID0gZnVuY3Rpb246IGZhc3Qj NjENCiAgICAgICAgICAgIG1vZCA9IGZ1bmN0aW9uOiBmYXN0IzYwDQogICAgICAgICAgICBtb2Rm ID0gZnVuY3Rpb246IGZhc3QjNTQNCiAgICAgICAgICAgIHBpID0gMy4xNDE1OTI2NTM1ODk4DQog ICAgICAgICAgICBwb3cgPSBmdW5jdGlvbjogZmFzdCM1OQ0KICAgICAgICAgICAgcmFkID0gZnVu Y3Rpb246IGZhc3QjNTYNCiAgICAgICAgICAgIHJhbmRvbSA9IGZ1bmN0aW9uOiAweDAzMDExMTFj DQogICAgICAgICAgICByYW5kb21zZWVkID0gZnVuY3Rpb246IDB4MDMwMTExM2MNCiAgICAgICAg ICAgIHNpbiA9IGZ1bmN0aW9uOiBmYXN0IzQ0DQogICAgICAgICAgICBzaW5oID0gZnVuY3Rpb246 IGZhc3QjNTANCiAgICAgICAgICAgIHNxcnQgPSBmdW5jdGlvbjogZmFzdCM0MA0KICAgICAgICAg ICAgdGFuID0gZnVuY3Rpb246IGZhc3QjNDYNCiAgICAgICAgICAgIHRhbmggPSBmdW5jdGlvbjog ZmFzdCM1Mg0KICAgICAgICAgfSAodGFibGU6IDB4MDIwNzRhODgpDQogICAgICAgICBtYXRoX2V4 ID0gew0KICAgICAgICAgICAgQUFCb3hTZWdtZW50SW50ZXJzZWN0RXggPSBmdW5jdGlvbjogMHgw MzAxMTE3Yw0KICAgICAgICAgICAgQlFGID0gZnVuY3Rpb246IDB4MDMwMTExOWMNCiAgICAgICAg ICAgIENhcHN1bGVTZWdtZW50SW50ZXJzZWN0ID0gZnVuY3Rpb246IDB4MDMwMTExZGMNCiAgICAg ICAgICAgIENvc1NpbiA9IGZ1bmN0aW9uOiAweDAzMDExMWZjDQogICAgICAgICAgICBMb29rQXQg PSBmdW5jdGlvbjogMHgwMzAxMTIzYw0KICAgICAgICAgICAgUG9pbnRJblNwaGVyZSA9IGZ1bmN0 aW9uOiAweDAzMDExMjdjDQogICAgICAgICAgICBSQnkgPSBmdW5jdGlvbjogMHgwMzAxMTM3Yw0K ICAgICAgICAgICAgUmFuZCA9IGZ1bmN0aW9uOiAweDAzMDExMzNjDQogICAgICAgICAgICBTZWdt ZW50c0ludGVyc2VjdCA9IGZ1bmN0aW9uOiAweDAzMDExMmJjDQogICAgICAgICAgICBTcGhlcmVT ZWdtZW50SW50ZXJzZWN0RXggPSBmdW5jdGlvbjogMHgwMzAxMTJkYw0KICAgICAgICAgICAgU3Bo ZXJlc0ludGVyc2VjdCA9IGZ1bmN0aW9uOiAweDAzMDExMmZjDQogICAgICAgICAgICBVUFF1YWRT ZWdtZW50SW50ZXJzZWN0ID0gZnVuY3Rpb246IDB4MDMwMTEzMWMNCiAgICAgICAgIH0gKHRhYmxl OiAweDAzMTBlY2JjKQ0KICAgICAgICAgbWVzc2FnZWYgPSBmdW5jdGlvbjogMHgwMzAwMDBiYw0K ICAgICAgICAgbW9kdWxlID0gZnVuY3Rpb246IDB4MDMxMDEyN2MNCiAgICAgICAgIG5ld3Byb3h5 ID0gZnVuY3Rpb246IGZhc3QjMjgNCiAgICAgICAgIG5leHQgPSBmdW5jdGlvbjogZmFzdCMxNQ0K ICAgICAgICAgb3MgPSB7DQogICAgICAgICAgICBjbG9jayA9IGZ1bmN0aW9uOiBmYXN0IzEyNw0K ICAgICAgICAgICAgZGF0ZSA9IGZ1bmN0aW9uOiBmYXN0IzEyOA0KICAgICAgICAgICAgZGlmZnRp bWUgPSBmdW5jdGlvbjogZmFzdCMxMzANCiAgICAgICAgICAgIGV4ZWN1dGUgPSBmdW5jdGlvbjog ZmFzdCMxMjENCiAgICAgICAgICAgIGV4aXQgPSBmdW5jdGlvbjogZmFzdCMxMjYNCiAgICAgICAg ICAgIGdldGVudiA9IGZ1bmN0aW9uOiBmYXN0IzEyNQ0KICAgICAgICAgICAgcmVtb3ZlID0gZnVu Y3Rpb246IGZhc3QjMTIyDQogICAgICAgICAgICByZW5hbWUgPSBmdW5jdGlvbjogZmFzdCMxMjMN CiAgICAgICAgICAgIHNldGxvY2FsZSA9IGZ1bmN0aW9uOiBmYXN0IzEzMQ0KICAgICAgICAgICAg dGltZSA9IGZ1bmN0aW9uOiBmYXN0IzEyOQ0KICAgICAgICAgICAgdG1wbmFtZSA9IGZ1bmN0aW9u OiBmYXN0IzEyNA0KICAgICAgICAgfSAodGFibGU6IDB4MDIwNzNmZjgpDQogICAgICAgICBwYWNr YWdlID0gQ1lDTEUsIHRhYmxlOiAweDAyMDcyZDMwDQogICAgICAgICBwYWlycyA9IGZ1bmN0aW9u OiBmYXN0IzE2DQogICAgICAgICBwY2FsbCA9IGZ1bmN0aW9uOiBmYXN0IzIwDQogICAgICAgICBw cmludCA9IGZ1bmN0aW9uOiBmYXN0IzI5DQogICAgICAgICBwcmludGYgPSBmdW5jdGlvbjogMHgw MzAwMDEzYw0KICAgICAgICAgcmF3ZXF1YWwgPSBmdW5jdGlvbjogZmFzdCMxMA0KICAgICAgICAg cmF3Z2V0ID0gZnVuY3Rpb246IGZhc3QjOA0KICAgICAgICAgcmF3c2V0ID0gZnVuY3Rpb246IGZh c3QjOQ0KICAgICAgICAgcmVxdWlyZSA9IGZ1bmN0aW9uOiAweDAyMDczMjU4DQogICAgICAgICBz ZWxlY3QgPSBmdW5jdGlvbjogZmFzdCMxMg0KICAgICAgICAgc2V0ZmVudiA9IGZ1bmN0aW9uOiBm YXN0IzcNCiAgICAgICAgIHNldG1ldGF0YWJsZSA9IGZ1bmN0aW9uOiBmYXN0IzUNCiAgICAgICAg IHN0cmluZyA9IHsNCiAgICAgICAgICAgIGJ5dGUgPSBmdW5jdGlvbjogZmFzdCM3OA0KICAgICAg ICAgICAgY2hhciA9IGZ1bmN0aW9uOiBmYXN0Izc5DQogICAgICAgICAgICBkdW1wID0gZnVuY3Rp b246IGZhc3QjODUNCiAgICAgICAgICAgIGZpbmQgPSBmdW5jdGlvbjogZmFzdCM4Ng0KICAgICAg ICAgICAgZm9ybWF0ID0gZnVuY3Rpb246IGZhc3QjOTENCiAgICAgICAgICAgIGdmaW5kID0gZnVu Y3Rpb246IGZhc3QjODkNCiAgICAgICAgICAgIGdtYXRjaCA9IGZ1bmN0aW9uOiBmYXN0Izg5DQog ICAgICAgICAgICBnc3ViID0gZnVuY3Rpb246IGZhc3QjOTANCiAgICAgICAgICAgIGxlbiA9IGZ1 bmN0aW9uOiBmYXN0Izc3DQogICAgICAgICAgICBsb3dlciA9IGZ1bmN0aW9uOiBmYXN0IzgzDQog ICAgICAgICAgICBtYXRjaCA9IGZ1bmN0aW9uOiBmYXN0Izg3DQogICAgICAgICAgICByZXAgPSBm dW5jdGlvbjogZmFzdCM4MQ0KICAgICAgICAgICAgcmV2ZXJzZSA9IGZ1bmN0aW9uOiBmYXN0Izgy DQogICAgICAgICAgICBzdWIgPSBmdW5jdGlvbjogZmFzdCM4MA0KICAgICAgICAgICAgdXBwZXIg PSBmdW5jdGlvbjogZmFzdCM4NA0KICAgICAgICAgfSAodGFibGU6IDB4MDIwNzQ0NjgpDQogICAg ICAgICB0YWJsZSA9IHsNCiAgICAgICAgICAgIGNvbmNhdCA9IGZ1bmN0aW9uOiBmYXN0Izk4DQog ICAgICAgICAgICBmb3JlYWNoID0gZnVuY3Rpb246IGZhc3QjOTMNCiAgICAgICAgICAgIGZvcmVh Y2hpID0gZnVuY3Rpb246IGZhc3QjOTINCiAgICAgICAgICAgIGdldG4gPSBmdW5jdGlvbjogZmFz dCM5NA0KICAgICAgICAgICAgaW5zZXJ0ID0gZnVuY3Rpb246IGZhc3QjOTYNCiAgICAgICAgICAg IG1heG4gPSBmdW5jdGlvbjogZmFzdCM5NQ0KICAgICAgICAgICAgcmVtb3ZlID0gZnVuY3Rpb246 IGZhc3QjOTcNCiAgICAgICAgICAgIHNvcnQgPSBmdW5jdGlvbjogZmFzdCM5OQ0KICAgICAgICAg fSAodGFibGU6IDB4MDIwNzMyYjgpDQogICAgICAgICB0YWJsZV9leCA9IHsNCiAgICAgICAgICAg IENsZWFyID0gZnVuY3Rpb246IDB4MDMwMDU5MWMNCiAgICAgICAgICAgIENvcHkgPSBmdW5jdGlv bjogMHgwMzAwNTk3Yw0KICAgICAgICAgICAgQ29weUsgPSBmdW5jdGlvbjogMHgwMzAwNTlkYw0K ICAgICAgICAgICAgQ3VsbGluZ0ZvckVhY2ggPSBmdW5jdGlvbjogMHgwMzAwNWExYw0KICAgICAg ICAgICAgRGVlcENvcHkgPSBmdW5jdGlvbjogMHgwMzEwM2NiYw0KICAgICAgICAgICAgRXF1YWwg PSBmdW5jdGlvbjogMHgwMzEwM2QzYw0KICAgICAgICAgICAgRmluZCA9IGZ1bmN0aW9uOiAweDAz MDA1YmJjDQogICAgICAgICAgICBGaW5kTm90ID0gZnVuY3Rpb246IDB4MDMwMDViZmMNCiAgICAg ICAgICAgIEZpbmRfTiA9IGZ1bmN0aW9uOiAweDAzMDA1YmRjDQogICAgICAgICAgICBGb3JFYWNo ID0gZnVuY3Rpb246IDB4MDMwMDVjMWMNCiAgICAgICAgICAgIEZvckVhY2hJX0NvbmQgPSBmdW5j dGlvbjogMHgwMzEwM2Q3Yw0KICAgICAgICAgICAgRm9yRWFjaEtWID0gZnVuY3Rpb246IDB4MDMw MDVjM2MNCiAgICAgICAgICAgIEdldEZpZWxkcyA9IGZ1bmN0aW9uOiAweDAzMTAzZGZjDQogICAg ICAgICAgICBHZXRLZXlzID0gZnVuY3Rpb246IDB4MDMwMDVkMWMNCiAgICAgICAgICAgIE1ha2VT ZXQgPSBmdW5jdGlvbjogMHgwMzAwNWQzYw0KICAgICAgICAgICAgTWFwID0gZnVuY3Rpb246IDB4 MDMxMDNlM2MNCiAgICAgICAgICAgIE1hcEFycmF5RXggPSBmdW5jdGlvbjogMHgwMzEwM2U3Yw0K ICAgICAgICAgICAgTWFwSyA9IGZ1bmN0aW9uOiAweDAzMDA1ZGZjDQogICAgICAgICAgICBNYXBL ViA9IGZ1bmN0aW9uOiAweDAzMTAzZWJjDQogICAgICAgICAgICBNb3ZlID0gZnVuY3Rpb246IDB4 MDMxMDNlZmMNCiAgICAgICAgICAgIFN1YlRhYmxlc09uRGVtYW5kID0gZnVuY3Rpb246IDB4MDMx MDQxYmMNCiAgICAgICAgICAgIFdlYWsgPSBmdW5jdGlvbjogMHgwMzEwNDFmYw0KICAgICAgICAg ICAgV2l0aEJvdW5kVGFibGUgPSBmdW5jdGlvbjogMHgwMzEwNDI3Yw0KICAgICAgICAgICAgX00g PSBDWUNMRSwgdGFibGU6IDB4MDMxMDNiN2MNCiAgICAgICAgICAgIF9OQU1FID0gInRhYmxlX2V4 Ig0KICAgICAgICAgICAgX1BBQ0tBR0UgPSAiIg0KICAgICAgICAgfSAodGFibGU6IDB4MDMxMDNi N2MpDQogICAgICAgICB0b251bWJlciA9IGZ1bmN0aW9uOiBmYXN0IzEzDQogICAgICAgICB0b3N0 cmluZyA9IGZ1bmN0aW9uOiBmYXN0IzE0DQogICAgICAgICB0eXBlID0gZnVuY3Rpb246IGZhc3Qj Mw0KICAgICAgICAgdW5wYWNrID0gZnVuY3Rpb246IGZhc3QjMTENCiAgICAgICAgIHZhcmR1bXAg PSB7DQogICAgICAgICAgICBQcmludCA9IGZ1bmN0aW9uOiAweDAzMTAwYmJjDQogICAgICAgICAg ICBTZXREZWZhdWx0T3V0ZiA9IGZ1bmN0aW9uOiAweDAzMTAwYWJjDQogICAgICAgICAgICBfTSA9 IENZQ0xFLCB0YWJsZTogMHgwMzEwNzZmYw0KICAgICAgICAgICAgX05BTUUgPSAidmFyZHVtcCIN CiAgICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgIH0gKHRhYmxlOiAweDAzMTA3NmZj KQ0KICAgICAgICAgdmFyb3BzID0gew0KICAgICAgICAgICAgQ2xlYXJBbmRSZWNhY2hlID0gZnVu Y3Rpb246IDB4MDMwMDI1YmMNCiAgICAgICAgICAgIENsZWFyUmFuZ2UgPSBmdW5jdGlvbjogMHgw MzAwMjU5Yw0KICAgICAgICAgICAgQ29sbGVjdEFyZ3NJbnRvID0gZnVuY3Rpb246IDB4MDMwMDI1 M2MNCiAgICAgICAgICAgIEhhc01ldGEgPSBmdW5jdGlvbjogMHgwMzAwMjNiYw0KICAgICAgICAg ICAgSXNDYWxsYWJsZSA9IGZ1bmN0aW9uOiAweDAzMDAyNDFjDQogICAgICAgICAgICBJc0NvdW50 YWJsZSA9IGZ1bmN0aW9uOiAweDAzMDAyNDdjDQogICAgICAgICAgICBJc0ludGVnZXIgPSBmdW5j dGlvbjogMHgwMzAwMjQ5Yw0KICAgICAgICAgICAgSXNOYU4gPSBmdW5jdGlvbjogMHgwMzAwMjRk Yw0KICAgICAgICAgICAgU3dhcE1lbWJlciA9IGZ1bmN0aW9uOiAweDAzMDAyNTdjDQogICAgICAg ICAgICBVbnBhY2tBbmRDbGVhciA9IGZ1bmN0aW9uOiAweDAzMDAyNjFjDQogICAgICAgICAgICBV bnBhY2tDbGVhckFuZFJlY2FjaGUgPSBmdW5jdGlvbjogMHgwMzAwMjY3Yw0KICAgICAgICAgICAg X00gPSBDWUNMRSwgdGFibGU6IDB4MDMxMDFkYmMNCiAgICAgICAgICAgIF9OQU1FID0gInZhcm9w cyINCiAgICAgICAgICAgIF9QQUNLQUdFID0gIiINCiAgICAgICAgIH0gKHRhYmxlOiAweDAzMTAx ZGJjKQ0KICAgICAgICAgeHBjYWxsID0gZnVuY3Rpb246IGZhc3QjMjENCiAgICAgIH0gKHRhYmxl OiAweDAyMDcwZWEwKQ0KICAgICAgYml0ID0gQ1lDTEUsIHRhYmxlOiAweDAyMDc1OWQ4DQogICAg ICBjbGFzcyA9IENZQ0xFLCB0YWJsZTogMHgwMzEwNmJiYw0KICAgICAgY29yb3V0aW5lID0gQ1lD TEUsIHRhYmxlOiAweDAyMDcyOWUwDQogICAgICBjb3JvdXRpbmVfZXggPSBDWUNMRSwgdGFibGU6 IDB4MDMxMDQ1ZmMNCiAgICAgIGNvcm91dGluZW9wcyA9IENZQ0xFLCB0YWJsZTogMHgwMzEwNTU3 Yw0KICAgICAgZGVidWcgPSBDWUNMRSwgdGFibGU6IDB4MDIwNzU1MTANCiAgICAgIGVmZmVjdCA9 IENZQ0xFLCB0YWJsZTogMHgwMzExNGRiYw0KICAgICAgZnVuY29wcyA9IENZQ0xFLCB0YWJsZTog MHgwMzEwMjA3Yw0KICAgICAgZ3JhcGhpY3NoZWxwZXJzID0gQ1lDTEUsIHRhYmxlOiAweDAzMTE1 NjNjDQogICAgICBpbyA9IENZQ0xFLCB0YWJsZTogMHgwMjA3M2FkMA0KICAgICAgaXRlcmF0b3Jz ID0gQ1lDTEUsIHRhYmxlOiAweDAzMTAyYWJjDQogICAgICBqaXQgPSBDWUNMRSwgdGFibGU6IDB4 MDIwNzVlZTgNCiAgICAgIGppdC5vcHQgPSBDWUNMRSwgdGFibGU6IDB4MDIwNzY2YTANCiAgICAg IGppdC51dGlsID0gQ1lDTEUsIHRhYmxlOiAweDAyMDc2MTY4DQogICAgICBsaXN0ID0gQ1lDTEUs IHRhYmxlOiAweDAzMTAyN2JjDQogICAgICBtYXRoID0gQ1lDTEUsIHRhYmxlOiAweDAyMDc0YTg4 DQogICAgICBtYXRoX2V4ID0gQ1lDTEUsIHRhYmxlOiAweDAzMTBlY2JjDQogICAgICBub25kZXRl cm1pbmlzbV9vcHMgPSBDWUNMRSwgdGFibGU6IDB4MDMxMDljM2MNCiAgICAgIG51bWVyaWNvcHMg PSBDWUNMRSwgdGFibGU6IDB4MDMxMDA3ZmMNCiAgICAgIG9wYnVpbGRlcnMgPSBDWUNMRSwgdGFi bGU6IDB4MDMxMDdhN2MNCiAgICAgIG9zID0gQ1lDTEUsIHRhYmxlOiAweDAyMDczZmY4DQogICAg ICBwYWNrYWdlID0gQ1lDTEUsIHRhYmxlOiAweDAyMDcyZDMwDQogICAgICBza2V3aGVhcCA9IENZ Q0xFLCB0YWJsZTogMHgwMzEwODY3Yw0KICAgICAgc3RyaWN0ID0gdHJ1ZQ0KICAgICAgc3RyaW5n ID0gQ1lDTEUsIHRhYmxlOiAweDAyMDc0NDY4DQogICAgICB0YWJsZSA9IENZQ0xFLCB0YWJsZTog MHgwMjA3MzJiOA0KICAgICAgdGFibGVfZXggPSBDWUNMRSwgdGFibGU6IDB4MDMxMDNiN2MNCiAg ICAgIHZhcmR1bXAgPSBDWUNMRSwgdGFibGU6IDB4MDMxMDc2ZmMNCiAgICAgIHZhcm9wcyA9IENZ Q0xFLCB0YWJsZTogMHgwMzEwMWRiYw0KICAgICAgd2lkZ2V0b3BzID0gQ1lDTEUsIHRhYmxlOiAw eDAzMTBjNWJjDQogICB9ICh0YWJsZTogMHgwMjA3MWY1MCkNCg== --001636e0ae8e89c65804774c0043-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 08:05:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1A598f007537; Sun, 1 Nov 2009 08:05:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77CF919076; Sun, 1 Nov 2009 08:03:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4508F18959 for ; Sun, 1 Nov 2009 08:03:37 -0200 (BRST) Received: by pzk34 with SMTP id 34so2796865pzk.11 for ; Sun, 01 Nov 2009 02:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=SARWCPX37ePyFAYnNZ4llzNwbf0WeQEco+Etd5rv7C8=; b=tsKv/GmcMF57AFY0u+M2AmIgIL62YF1flwBKGDJd4x0f0XtPuIM50XMspkvAMkx+jz DZCfZyrKkAg1ZBAXNxBJh9iKEBRVMQWogA4o5jjtNV/K8X/0NRDu7BrgyQYf6/6cP6p8 wFlzXWwtbHYfujkAPfcR5K2jJRFc9xQK/JFrE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Hy38fpyosTxNseexjOtXQowtOPX5s3HuyQX/qAB6RsG9Yt08xDMq/nkAps5D84V5Ua HgoSCTTB1hP9FRbvvhpsaq7XAvdspAVWhyh7Uu4eXhxSqCKmxabl1KTOriQ0C8sUCzNq qC5ynIzgjYuOP5gPy1uNlYAJvRUrSTZ1Au5Wc= MIME-Version: 1.0 Received: by 10.142.75.5 with SMTP id x5mr333299wfa.197.1257069870510; Sun, 01 Nov 2009 02:04:30 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 18:04:30 +0800 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Long Cheng To: Lua list Content-Type: multipart/alternative; boundary=001636e1fd3e16f28f04774c632b X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e1fd3e16f28f04774c632b Content-Type: text/plain; charset=ISO-8859-1 Congrates Mike! Thank you for the efforts. I'll definitely try out this new release tomorrow and let you know the results Regards Long 2009/11/1 Mike Pall > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! > > Here is a link to the home page: > http://luajit.org/luajit.html > > And a direct link to the download page: > http://luajit.org/download.html > > What is LuaJIT? > --------------- > > LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully > compatible with standard Lua 5.1 and can significantly boost the > performance of your Lua programs. > > LuaJIT is open source software, released under the MIT/X license. > > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. > > This is a BETA TEST release -- the current status and the list of > known issues are shown here: http://luajit.org/status.html > Please report any problems you may find with this release. Thank you! > > What's new in LuaJIT 2.0 > ------------------------ > > The VM of LuaJIT 2.0 has been rewritten from the ground up and is > relentlessly optimized for performance. It combines a high-speed > interpreter, written in assembler, with a state-of-the-art JIT compiler. > > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. This allows a > substantial reduction of the overhead associated with dynamic language > features. It's destined to break into the performance range > traditionally reserved for offline, static language compilers. > > Performance on numerical code is already quite competitive (see below). > Support for other areas (e.g. string functions) is still a bit weak. > Although the VM supports all Lua language features and standard library > functions, the JIT compiler is not complete (yet) and falls back to the > interpreter in some cases. All of this works transparently, so unless > you use -jv, you'll probably never notice. The interpreter is quite > fast, too (near the performance of the LuaJIT 1.x JIT compiler). > > Preliminary benchmark numbers are shown below -- performance will > likely improve during the beta test phase. These numbers are mainly > intended to give you an idea about the typical speedups you can expect, > depending on the type of application. Your mileage may vary. > > Ok, so thanks to everyone for their patience! A big thank you goes to > the alpha testers. And now, please have fun with it -- Happy Halloween! > > --Mike > > Relative speedup over Lua 5.1.4 on standard Lua benchmarks > (e.g. 11.9 means it's almost twelve times faster): > > md5 152.7 | mandelbrot 13.4 | nsieve 4.7 | > array3d 101.5 | pidigits 12.4 | partialsums 4.1 | > array 73.5 | random 12.2 | chameneos 3.8 | > methcall 28.8 | nsievebits 12.0 | recursive 3.5 | > nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 | > matrix 23.0 | lists 9.3 | binarytrees 2.7 | > spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 | > fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 | > nbody 14.8 | fasta 5.3 | sumfile 1.5 | > > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: > > SciMark composite | > small score | FFT SOR MC SPARSE LU > ----------------------------+--------------------------------------- > GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 > JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4 > JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 > LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 > Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 > > Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua > > --001636e1fd3e16f28f04774c632b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Congrates Mike! Thank you for the efforts. I'll definitely try out this= new release tomorrow and let you know the results

Regards
Long
2009/11/1 Mike Pall <= mikelu-0910@mike.de>
It's almost m= idnight on Halloween here. This is the perfect time
to release long-awaited, almost mythical open source software ... ;-)

Yes, here it is: the first public release of LuaJIT 2.0!

Here is a link to the home page:
=A0http://luaj= it.org/luajit.html

And a direct link to the download page:
=A0http://lu= ajit.org/download.html

What is LuaJIT?
---------------

LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully
compatible with standard Lua 5.1 and can significantly boost the
performance of your Lua programs.

LuaJIT is open source software, released under the MIT/X license.

LuaJIT builds out-of-the-box on all popular x86 operating systems
(Linux, Windows, OSX etc.). It runs fine as a 32 bit application
under x64-based systems, too.

This is a BETA TEST release -- the current status and the list of
known issues are shown here: http://luajit.org/status.html
Please report any problems you may find with this release. Thank you!

What's new in LuaJIT 2.0
------------------------

The VM of LuaJIT 2.0 has been rewritten from the ground up and is
relentlessly optimized for performance. It combines a high-speed
interpreter, written in assembler, with a state-of-the-art JIT compiler.
An innovative trace compiler is integrated with advanced, SSA-based
optimizations and a highly tuned code generation backend. This allows a
substantial reduction of the overhead associated with dynamic language
features. It's destined to break into the performance range
traditionally reserved for offline, static language compilers.

Performance on numerical code is already quite competitive (see below).
Support for other areas (e.g. string functions) is still a bit weak.
Although the VM supports all Lua language features and standard library
functions, the JIT compiler is not complete (yet) and falls back to the
interpreter in some cases. All of this works transparently, so unless
you use -jv, you'll probably never notice. The interpreter is quite
fast, too (near the performance of the LuaJIT 1.x JIT compiler).

Preliminary benchmark numbers are shown below -- performance will
likely improve during the beta test phase. These numbers are mainly
intended to give you an idea about the typical speedups you can expect,
depending on the type of application. Your mileage may vary.

Ok, so thanks to everyone for their patience! A big thank you goes to
the alpha testers. And now, please have fun with it -- Happy Halloween!

--Mike

Relative speedup over Lua 5.1.4 on standard Lua benchmarks
(e.g. 11.9 means it's almost twelve times faster):

md5 =A0 =A0 =A0 =A0 =A0 152.7 =A0| =A0mandelbrot =A0 13.4 =A0| =A0nsieve = =A0 =A0 =A0 =A04.7 =A0|
array3d =A0 =A0 =A0 101.5 =A0| =A0pidigits =A0 =A0 12.4 =A0| =A0partialsums= =A0 4.1 =A0|
array =A0 =A0 =A0 =A0 =A073.5 =A0| =A0random =A0 =A0 =A0 12.2 =A0| =A0chame= neos =A0 =A0 3.8 =A0|
methcall =A0 =A0 =A0 28.8 =A0| =A0nsievebits =A0 12.0 =A0| =A0recursive =A0= =A0 3.5 =A0|
nsievebits =A0 =A0 28.0 =A0| =A0nestedloop =A0 11.9 =A0| =A0knucleotide =A0= 3.4 =A0|
matrix =A0 =A0 =A0 =A0 23.0 =A0| =A0lists =A0 =A0 =A0 =A0 9.3 =A0| =A0binar= ytrees =A0 2.7 =A0|
spectralnorm =A0 21.4 =A0| =A0cheapconcr =A0 =A05.5 =A0| =A0meteor =A0 =A0 = =A0 =A02.0 =A0|
fannkuch =A0 =A0 =A0 20.9 =A0| =A0cheapconcw =A0 =A05.4 =A0| =A0revcomp =A0= =A0 =A0 1.8 =A0|
nbody =A0 =A0 =A0 =A0 =A014.8 =A0| =A0fasta =A0 =A0 =A0 =A0 5.3 =A0| =A0sum= file =A0 =A0 =A0 1.5 =A0|

SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized),
higher numbers are better:

SciMark =A0 =A0 =A0 =A0 =A0composite =A0|
small =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0score =A0| =A0FFT =A0 =A0 SOR =A0 =A0 = =A0MC =A0 =A0SPARSE =A0 =A0LU
----------------------------+---------------------------------------
GCC 4.3.2 =A0 =A0 =A0 =A0 =A0 =A0906.1 =A0| =A0739.1 =A0 909.0 =A0 190.4 = =A01057.0 =A01635.1
JVM 1.6 Server =A0 =A0 =A0 876.3 =A0| =A0573.8 =A01185.5 =A0 297.7 =A0 579.= 2 =A01745.4
JVM 1.6 Client =A0 =A0 =A0 579.6 =A0| =A0424.8 =A0 895.8 =A0 122.8 =A0 595.= 5 =A0 859.0
----------------------------+---------------------------------------
LuaJIT 2.0.0-beta1 =A0 580.4 =A0| =A0427.4 =A01025.0 =A0 223.7 =A0 303.4 = =A0 922.5
LuaJIT 1.1.5 =A0 =A0 =A0 =A0 =A096.7 =A0| =A0 72.0 =A0 166.1 =A0 =A037.1 = =A0 =A091.8 =A0 116.5
Lua 5.1.4 =A0 =A0 =A0 =A0 =A0 =A0 16.5 =A0| =A0 11.0 =A0 =A027.4 =A0 =A0 7.= 6 =A0 =A016.9 =A0 =A019.5

Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua


--001636e1fd3e16f28f04774c632b-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 08:08:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1A8tsV007827; Sun, 1 Nov 2009 08:08:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45CC3192C1; Sun, 1 Nov 2009 08:07:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA3D618FF0 for ; Sun, 1 Nov 2009 08:07:34 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id A7183BCC7C for ; Sun, 1 Nov 2009 05:08:30 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 01 Nov 2009 05:08:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=CF4Hk3MSP8KxiByU8g7lLIPkaME=; b=HlBu6EIS8FUcUT91naMrb24Ad0sJmGinStcLJmbFsLY/KhKSXV29u9gOZron9SLdpNqLBnxevovc3Ygu4Jp2CD1S8BxU8wwM3fF4nqiPW4/TLkv0NGsAoBtjLlg5d2W/X0GyldeJgGmmzlz5Hg9cW87LuxRBJ9N5kKOY97juUVw= X-Sasl-enc: erUirO4a+bBWgzmV6Z2pho2wFngKJiBxBRVv73ucZ+HB 1257070109 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id 898E749F287 for ; Sun, 1 Nov 2009 05:08:29 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> Date: Sun, 1 Nov 2009 23:07:53 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean (please excuse me replying to myself!) On 1/11/2009, at 9:31 PM, Geoff Leyland wrote: > I'm glad it was useful nonetheless! I'll run some kdtree stuff > soon, and I'll be more careful about isolating relevant results. Here are some more results (this time making it clear that LJ2 is much better!): Read the DIMACS New York map, preprocess it, and write out: Total Compute only lua 60s 22s LJ1 45s 17s LJ2 35s 13s Read the preprocessed map, build a kdtree and write it: Total Compute only lua 547s 526s LJ1 145s 128s LJ2 121s 108s Times are measured with os.time(), so not much resolution. I tried -jv, but it didn't give me a breakdown of what was interpreted and what was JIT compiled - how did you get that? The kdtree code is in the same place as the heap stuff, but there's no test harness or data. If you'd like that, let me know and I'll put something together. The map preprocessing stuff will be harder (but possible) to isolate. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 08:24:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1AO79U009166; Sun, 1 Nov 2009 08:24:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 624B2192D9; Sun, 1 Nov 2009 08:22:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8574A1929D for ; Sun, 1 Nov 2009 08:22:48 -0200 (BRST) Received: by pwj9 with SMTP id 9so1360656pwj.21 for ; Sun, 01 Nov 2009 02:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=f/auswFf0i+y+mdUgDZpU0oIO296FtRBR/UlV9/nGHM=; b=VJiUL5PNbnUlval46Hf++6hAJJYx+P02r3mR8N+ScZryXuB/hzqvTanqDgoctXe4dK l0eyaNpeLZnDu3p480JlLk8paICp26l1D5UUcjrpic6nMZsKKMY7l7trn8BV6KEcFemS xLadXh1DEr3ceHGDNfzAtAhrzaFB0GqgGeZ94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gPFQz+1aJaAx5SzYAQ/hSo5G1V2l+Ohjh2Z67Hll5A7tWXGwb0/quoCvt89+XoMzUm I+H6St9krn3dTHbEL4Ksgw9YQ3mNGGhjOsDUsNCdDcIlq/ubIY2n3PZfKaj+OW+orcHo uvzbMPB5xPnWoP2uYW36cKxzm0MZLz6s5Uf5I= MIME-Version: 1.0 Received: by 10.142.6.2 with SMTP id 2mr347544wff.90.1257071022878; Sun, 01 Nov 2009 02:23:42 -0800 (PST) In-Reply-To: <20091031060420.GA4698@mike.de> References: <08EFC144CF6F42058449D214CA2BC57B@Mania> <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> Date: Sun, 1 Nov 2009 18:23:42 +0800 Message-ID: <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: CHU Run-min To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean in lj_gc.c /* Traverse the frame structure of a stack. */ static TValue *gc_traverse_frames(global_State *g, lua_State *th) { TValue *frame, *top = th->top-1; /* Note: extra vararg frame not skipped, marks function twice (harmless). */ for (frame = th->base-1; frame > th->stack; frame = frame_prev(frame)) { GCfunc *fn = frame_func(frame); TValue *ftop = frame; if (isluafunc(fn)) ftop += funcproto(fn)->framesize; if (ftop > top) top = ftop; gc_markobj(g, frame_gc(frame)); /* Need to mark hidden function (or L). */ } top++; /* Correct bias of -1 (frame == base-1). */ if (top > th->maxstack) top = th->maxstack; return top; } I found it doesn't consider C func's frame size. In standard Lua implementation, the func's frame size is recorded in CallInfo' top field. But in LJ2, there is no space to record the frame size of C func. It seems harmful, isn't it? Or my misunderstanding. May Mike Pall reveal the mystery about this? From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 11:25:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1DPbPI026362; Sun, 1 Nov 2009 11:25:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBFCC18C57; Sun, 1 Nov 2009 11:24:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85ADD18B9F for ; Sun, 1 Nov 2009 11:24:05 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so460317fgg.17 for ; Sun, 01 Nov 2009 05:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LDKTwjkZ2V4JNCWMBl3KY2OoNFycWNg69QWIKZBbj9k=; b=Q5YjM2j4yQHmCyPLrDZ9Ybu4PaXc5rfbdy+3mqy0OXudda0RD9GfS01RXsHIps1DPM w+QQx9c8z0JH0VPGmML969ad3vez5feud1UVKacPUduZlEho7YmccekpQTuIt0OztUYa fm3mDeSNoKoz2polI0/ZYppn2MKqc5TnlAfDs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z+edIUTvpEvS06ju8eeR14siHPwQqJ+9ewkCBdhxHSwx5y44knHH79XsWDt+mbkSZK asW61tpINxPbHKzZJhrMvRi9+rcmdlFBUnYbiLNrHVSiZsaZQjE/MXVnaaBwTQYcv3zK cRDUhhBLin07o4nZNsMdPys4QT6dilwrkBmIE= MIME-Version: 1.0 Received: by 10.239.141.142 with SMTP id c14mr386294hba.1.1257081899848; Sun, 01 Nov 2009 05:24:59 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 15:24:59 +0200 Message-ID: <560972290911010524j110248d8oabf69d555aa53149@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 1, 2009 at 12:59 AM, Mike Pall wrote: > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. Seeing as LJ is already tracing all Lua calls that are executed, could it not have an option to export this information in a form that would facilitate code browsing? This is a common problem when familiarizing oneself with a large code base. From static analysis, it is practically impossible to know what code paths are implied by the simple call 'obj:method()' The exact format is not important, only that it is parseable ;) steve d. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 11:38:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1DcpG0028162; Sun, 1 Nov 2009 11:38:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BF491A695; Sun, 1 Nov 2009 11:37:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FCA01A672 for ; Sun, 1 Nov 2009 11:37:27 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4adK-0002dS-4i for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 13:38:14 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id AE19F5F2ED for ; Sun, 1 Nov 2009 13:38:13 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:55736 with envelope Message-ID: <4AED8F44.3030809@cowlark.com> Date: Sun, 01 Nov 2009 13:38:12 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> In-Reply-To: <20091031225554.GA30341@mike.de> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1DcpG0028162 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) But Christmas isn't for another two months! > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: [...] > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 > LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 > Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 Impressive. However... I tried the Clue Whetstone benchmark through LuaJIT 2 (which is a version of the old C Whetstone benchmark 'compiled' into an assortment of languages). The results are: Native C 830 C translated to C 530 Java 290 LuaJIT 1 94 LuaJIT 2 36 Lua 13 SpiderMonkey Javascript 9.5 Perl 5 1.7 In fact, I notice that a lot of Clue's tests appear to run slower in LuaJIT 2 than in LuaJIT 1. I don't think I'm doing anything particularly stupid --- the docs say I don't need to do anything particular to turn the JIT on, right? I can just run a problem with luajit instead of lua and it'll work? So assuming that I am working LuaJIT correctly there's something about Clue's output that it's not getting on with. As Clue's Lua output is mostly dead simple, my initial instinct is to blame the disgusting hack I'm having to do to emulate gotos: local state = 0 repeat while true do if state == 0 then end if state == 1 then end if ...etc.. end if state == 99 then state = 42 break end -- transfer to basic block 42 if ...etc... end end end Could this be upsetting the JIT? (I have had thoughts about using tail calls to do the transfer of execution from one basic block to another, but I haven't come up with a decent way of doing it without doing memory allocations on entry to each function.) Here's a complete short function so you can see what it's actually emitting: _pa = function(fp, stack, H0, H1, H2, H3) local sp local H4 local H5 local H6 local H7 local H8 local H9 local H10 local state = 0; while true do repeat if state == 0 then sp = 0 sp = fp + sp H4 = 0 state = 1 break end if state == 1 then H5 = 6 H6 = H4 < H5 and 1 or 0 if H6 ~= 0 then state = 2 else state = 3 end break end if state == 2 then H5 = H1[H0 + 0] H6 = H1[H0 + 1] H7 = H5 + H6 H5 = H1[H0 + 2] H8 = H7 + H5 H7 = H1[H0 + 3] H9 = H8 - H7 H8 = H9 * H2 H1[H0 + 0] = H8 H9 = H8 + H6 H6 = H9 - H5 H9 = H6 + H7 H6 = H9 * H2 H1[H0 + 1] = H6 H9 = H8 - H6 H10 = H9 + H5 H5 = H10 + H7 H9 = H5 * H2 H1[H0 + 2] = H9 H5 = -H8 H8 = H5 + H6 H5 = H8 + H9 H6 = H5 + H7 H5 = H6 / H3 H1[H0 + 3] = H5 H5 = 1 H6 = H4 + H5 H4 = H6 state = 1 break end if state == 3 then do return end end until true end end - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7Y9Ef9E0noFvlzgRAr0BAJ9q8ZeRpmAMbHt7xocZO9AzcMo3XgCeII15 9VPvGAXxcDBMO6ehB20mN8c= =zPLO -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 11:57:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1DvAbY029747; Sun, 1 Nov 2009 11:57:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A14F11A699; Sun, 1 Nov 2009 11:55:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from c.painless.aaisp.net.uk (c.painless.aaisp.net.uk [81.187.30.53]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFD021A672 for ; Sun, 1 Nov 2009 11:55:41 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by c.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4av6-0006Yo-B9 for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 13:56:36 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B13F464028 for ; Sun, 1 Nov 2009 13:56:33 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:44164 with envelope Message-ID: <4AED9390.4070002@cowlark.com> Date: Sun, 01 Nov 2009 13:56:32 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> In-Reply-To: <4AED8F44.3030809@cowlark.com> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1DvAbY029747 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Given wrote: [...] >> SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), >> higher numbers are better: > [...] >> LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 >> LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 >> Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 > > Impressive. However... I forgot to add: I assume what you're using here are hand-translated versions of the SciMark benchmarks to each of the various languages? Is it: http://luajit.org/download/scimark.lua ...? What about the C version? I'd be interested to run it through Clue and see what happens. Incidentally, I have tried to compare LuaJIT 2 with V8, but V8 doesn't seem to want to build easily these days. Last time I tried it I recall that it wasn't particularly fast compared to LuaJIT 1 anyway! Anyway, it's very good to see this out, and it's impressively fast. It'd be very interesting to try doing traditionally high-CPU tasks with LuaJIT 2 and to see how well it works; I work in the mobile phone industry and it is *frightening* how shoddy the code tends to be. It'd be really nice to move away from traditional languages like C and C++ and towards scripting languages like Lua. Now I just have to wait for an ARM version... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7ZOPf9E0noFvlzgRAm4LAJ0To4egIDCcqz1zPwctf8Y4oxqWSQCglw+P JUhKDnlG93U04FjSo+d8s+8= =se2Y -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 11:58:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Dwpu8029919; Sun, 1 Nov 2009 11:58:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F05131A69E; Sun, 1 Nov 2009 11:57:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C74EB1A69A for ; Sun, 1 Nov 2009 11:57:26 -0200 (BRST) Received: by bwz27 with SMTP id 27so5288099bwz.21 for ; Sun, 01 Nov 2009 05:58:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.32.75 with SMTP id b11mr3022705bkd.94.1257083897978; Sun, 01 Nov 2009 05:58:17 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 14:58:17 +0100 X-Google-Sender-Auth: bc67ce325a5d0a4a Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1Dwpu8029919 2009/10/31 Mike Pall : > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! > > Here is a link to the home page: >  http://luajit.org/luajit.html > > And a direct link to the download page: >  http://luajit.org/download.html > > What is LuaJIT? > --------------- > > LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully > compatible with standard Lua 5.1 and can significantly boost the > performance of your Lua programs. > > LuaJIT is open source software, released under the MIT/X license. > > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. > > This is a BETA TEST release -- the current status and the list of > known issues are shown here: http://luajit.org/status.html > Please report any problems you may find with this release. Thank you! > > What's new in LuaJIT 2.0 > ------------------------ > > The VM of LuaJIT 2.0 has been rewritten from the ground up and is > relentlessly optimized for performance. It combines a high-speed > interpreter, written in assembler, with a state-of-the-art JIT compiler. > > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. This allows a > substantial reduction of the overhead associated with dynamic language > features. It's destined to break into the performance range > traditionally reserved for offline, static language compilers. > > Performance on numerical code is already quite competitive (see below). > Support for other areas (e.g. string functions) is still a bit weak. > Although the VM supports all Lua language features and standard library > functions, the JIT compiler is not complete (yet) and falls back to the > interpreter in some cases. All of this works transparently, so unless > you use -jv, you'll probably never notice. The interpreter is quite > fast, too (near the performance of the LuaJIT 1.x JIT compiler). > > Preliminary benchmark numbers are shown below -- performance will > likely improve during the beta test phase. These numbers are mainly > intended to give you an idea about the typical speedups you can expect, > depending on the type of application. Your mileage may vary. > > Ok, so thanks to everyone for their patience! A big thank you goes to > the alpha testers. And now, please have fun with it -- Happy Halloween! > > --Mike > I run my Lua test suite which is available with lua-TestMore (testmore.luaforge.net). See the full report at http://smolder.plusthree.com/app/public_projects/report_details/29566 (currently, 1315 tests in 3 seconds). I found the 2 same issues than with LuaJIT 1.1.5 1) numeric for with step = 0 causes infinite loop $ luajit -e 'for i = 5, 7, 0 do end' 2) losing arguments with metamethod __call m = {} setmetatable(m, { __call = function (obj, ...) print('m.__call ' .. tostring(obj) .. ', ' .. table.concat(arg, ', ')) end }) m() m(1, 2) --> arguments are lost and some new minor issues or delta : 1) getfenv(-3) gives a more general message : bad argument #1 to 'getfenv' (invalid level) instead of bad argument #1 to 'getfenv' (level must be non-negative) same issue with setfenv(). 2) tostring of C function $ luajit -e 'print(tostring(print))' function: fast#29 when lua gives : function: 0x9a5d020 3) xpcall without error handler $ luajit -e 'print(xpcall(assert, nil))' luajit: (command line):1: bad argument #2 to 'xpcall' (function expected, got nil) instead of : false error in error handling 4) table.maxn $ luajit -e 't = {3,4}; print(table.maxn(t))' 1 instead of : 2 5) deprecated table.setn $ luajit -e 'table.setn({},7)' luajit: (command line):1: attempt to call field 'setn' (a nil value) instead of : lua: (command line):1: 'setn' is obsolete 6) math.random with extra arguments $ luajit -e 'print(math.random(1, 2, 3))' 2 instead of : lua: (command line):1: wrong number of arguments François Perrad > Relative speedup over Lua 5.1.4 on standard Lua benchmarks > (e.g. 11.9 means it's almost twelve times faster): > > md5           152.7  |  mandelbrot   13.4  |  nsieve        4.7  | > array3d       101.5  |  pidigits     12.4  |  partialsums   4.1  | > array          73.5  |  random       12.2  |  chameneos     3.8  | > methcall       28.8  |  nsievebits   12.0  |  recursive     3.5  | > nsievebits     28.0  |  nestedloop   11.9  |  knucleotide   3.4  | > matrix         23.0  |  lists         9.3  |  binarytrees   2.7  | > spectralnorm   21.4  |  cheapconcr    5.5  |  meteor        2.0  | > fannkuch       20.9  |  cheapconcw    5.4  |  revcomp       1.8  | > nbody          14.8  |  fasta         5.3  |  sumfile       1.5  | > > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: > > SciMark          composite  | > small                score  |  FFT     SOR      MC    SPARSE    LU > ----------------------------+--------------------------------------- > GCC 4.3.2            906.1  |  739.1   909.0   190.4  1057.0  1635.1 > JVM 1.6 Server       876.3  |  573.8  1185.5   297.7   579.2  1745.4 > JVM 1.6 Client       579.6  |  424.8   895.8   122.8   595.5   859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1   580.4  |  427.4  1025.0   223.7   303.4   922.5 > LuaJIT 1.1.5          96.7  |   72.0   166.1    37.1    91.8   116.5 > Lua 5.1.4             16.5  |   11.0    27.4     7.6    16.9    19.5 > > Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua > > > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:17:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FH5SO004401; Sun, 1 Nov 2009 13:17:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 731C018CE2; Sun, 1 Nov 2009 13:15:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D41318C57 for ; Sun, 1 Nov 2009 13:15:38 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4cAO-0003XS-Ka for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 15:16:28 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id B711E7005A for ; Sun, 1 Nov 2009 15:16:25 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:52920 with envelope Message-ID: <4AEDA648.3010402@cowlark.com> Date: Sun, 01 Nov 2009 15:16:24 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1FH5SO004401 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 François Perrad wrote: [...] > 1) numeric for with step = 0 causes infinite loop > $ luajit -e 'for i = 5, 7, 0 do end' I can confirm this. If I replace the for...do...end with the equivalent chunk of pseudocode from section 2.4.5 of the manual, it all works as expected. > 2) losing arguments with metamethod __call [...] > print('m.__call ' .. tostring(obj) .. ', ' .. > table.concat(arg, ', ')) arg is a Lua 5.0-ism. Lua 5.1 has a backwards compatibility option, which by default is turned on. LuaJIT 1 had this option which was by default turned off --- LuaJIT 2 appears not to have it at all. Use {...} instead of arg and it all works. [...] > 4) table.maxn > 5) deprecated table.setn Again, these are Lua 5.0-isms that are now deprecated in Lua 5.1. Use #table instead. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7aZHf9E0noFvlzgRAp32AJwPJcM8AESkPB7sGd3fw7s9+LoGYwCgyIru AyzdJlejIVtYzaEMB4fWo+A= =SaAF -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:36:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FaRql006818; Sun, 1 Nov 2009 13:36:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D7FD18504; Sun, 1 Nov 2009 13:35:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96391184C9 for ; Sun, 1 Nov 2009 13:35:05 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4cTI-0004P8-00; Sun, 01 Nov 2009 16:36:00 +0100 Date: Sun, 1 Nov 2009 16:35:54 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101153554.GA6503@mike.de> References: <20091031225554.GA30341@mike.de> <3F9F6A43-3104-4071-9DF9-B8FC9A1A264D@mat.ucsb.edu> <20091101041311.GA15210@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Graham Wakefield wrote: > So, another question: Am I right in thinking that it would be feasible > to run multiple independent lua_States in different threads (along the > lines of LuaRings)? > That is, can the JIT engine itself be instantiated multiple times, with > each instance fully encapsulated within a global lua_State (i.e. no > statics)? Yes, this works fine. It uses *zero* static writable memory. I've had an eye on good embeddability. No use of virtual memory tricks or process-wide OS stuff either (good luck embedding Java ;-)). But it won't necessarily be efficient. If you open 10 global states and run the same scripts, the bytecode is stored 10x, compiled 10x, the machine code is stored 10x etc. ... You may have to lower some parameters to get this to scale to a larger number of global states. E.g. -Osizemcode=16 or 8, if the machine code still fits in there (pointless for Windows, since it enforces a 64K granularity). That said, globally sharing bytecode/machine code would be nice, but is very difficult. I think that some kind of support for native threads in the same global state would be a better idea (but that's still hard). --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:44:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FiJar007969; Sun, 1 Nov 2009 13:44:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F09FA1A691; Sun, 1 Nov 2009 13:43:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 814CE1A65E for ; Sun, 1 Nov 2009 13:42:58 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4caw-0004Pj-00; Sun, 01 Nov 2009 16:43:54 +0100 Date: Sun, 1 Nov 2009 16:43:34 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101154334.GA6853@mike.de> References: <20091031225554.GA30341@mike.de> <7DAA1994-B523-4F87-A0AA-0E382A570FCC@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7DAA1994-B523-4F87-A0AA-0E382A570FCC@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille wrote: > % lua -v Nanoki.lua . 0 1080 > Requests per second: 773.17 [#/sec] (mean) > % luajit -v Nanoki.lua . 0 1080 > Requests per second: 1174.19 [#/sec] (mean) > % luajit -v -joff Nanoki.lua . 0 1080 > Requests per second: 1167.37 [#/sec] (mean) I suspect this is doing many I/O calls (not compiled yet) or doing a lot of string handling (the compiler is still a bit weak there). There's still a lot of room for improvement ... > When trying 'luajit -jv' I get an 'unknown luaJIT command'. Did I get > the command line options wrong? No, but you've either not installed the modules, e.g. lib/v.lua installs to: /usr/local/share/luajit-2.0.0-beta1/jit/v.lua Or maybe the paths are wrong. Try luajit -ljit.XYZ and check the error message to see where it's searching. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:46:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FkPd2008234; Sun, 1 Nov 2009 13:46:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D52AB1A697; Sun, 1 Nov 2009 13:45:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EEE01A65E for ; Sun, 1 Nov 2009 13:45:07 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4cd0-0004QE-00; Sun, 01 Nov 2009 16:46:02 +0100 Date: Sun, 1 Nov 2009 16:45:58 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101154558.GA7168@mike.de> References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> <20091101020943.GA8663@mike.de> <20091101023229.GA10905@mike.de> <20091101102340.2f2e8479.tmueller@schulze-mueller.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091101102340.2f2e8479.tmueller@schulze-mueller.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Timm S. Mueller wrote: > > Ok, here it is. Timm, can you please check whether this fixes > > your original problem? Thank you! > > Yes, now it works like a charm. Thank you! Ok, it'll go into the beta2. But I'm trying to accumulate more fixes. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:49:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Fn6bP008521; Sun, 1 Nov 2009 13:49:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C567F1A69A; Sun, 1 Nov 2009 13:47:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D7101A65E for ; Sun, 1 Nov 2009 13:47:42 -0200 (BRST) Received: by qyk4 with SMTP id 4so2192903qyk.33 for ; Sun, 01 Nov 2009 07:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=W+wx3RuYVtK3vWopDIdtc0j73K0BaSO9N4LHhJk+IXc=; b=CmITMToRcodKrDTGLyEvZB1xHVtdVkxuJbYBz57ZhROaV9lPu8BNQI5GXDWDXIaQxN hzIzlhqwCk+Hv4MEcD4hKtiWFBFiO+Dqx2+PmP4mXcKa/dxBQCtNFrxdDEN+qcQlULcz GaMHcTgNqUTiWwxufkAdLh4xRIxtbHHqbGMQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=l89zp88eydxGfKorBMWY+Dwru5XE9mossLfn0/NS9ngdIvR6zyRRtfsOKtPKVIUjhi EBWHAGlhClpv2K+i3VYovqLaKM9rsQfwQulsEDN5n8skxFC0lDokrCZzaKKwQ/NZ4ahs F29u1krtCeQ8EmOGk2pTg6DFQAJy0H8vztCC4= Received: by 10.224.93.77 with SMTP id u13mr2243361qam.226.1257090518758; Sun, 01 Nov 2009 07:48:38 -0800 (PST) Received: from ?192.168.0.101? ([75.68.47.100]) by mx.google.com with ESMTPS id 22sm2272371qyk.10.2009.11.01.07.48.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 07:48:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Doug Currie In-Reply-To: <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> Date: Sun, 1 Nov 2009 10:48:34 -0500 Content-Transfer-Encoding: 7bit Message-Id: <10221641-2759-4111-B413-85511FFC6D7A@gmail.com> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thank you, Mike, for LJ2. On Oct 31, 2009, at 8:52 PM, Geoff Leyland wrote: > Built fine on OS X 10.6. Just some notes, everything is working for me... The first time I built on OS X 10.6 I got this warning: CC lib_package.o In file included from /usr/include/dlfcn.h:41, from lib_package.c:32: /usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid. Editing the Makefile to eliminate this, I tried uncommenting the line CC= gcc -m32 -march=native and commenting out the line: export MACOSX_DEPLOYMENT_TARGET=10.3 and despite using gcc 4.2.1 got: HOSTCC buildvm.o buildvm.c:1: error: bad value (native) for -march= switch So I restored the line: CC= gcc -m32 -march=i686 and it built without warnings. e From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:56:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FuCPk009178; Sun, 1 Nov 2009 13:56:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF2B61A695; Sun, 1 Nov 2009 13:54:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2DA81A672 for ; Sun, 1 Nov 2009 13:54:52 -0200 (BRST) Received: by qyk4 with SMTP id 4so2194462qyk.33 for ; Sun, 01 Nov 2009 07:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=drud2b6ljDIG74paES0TxeLsKowvalCJvVFmijqeg7c=; b=tk2mrb/gjx+RBtzwiptEaZIKNHkvHudPOwfUGqaKeK6MndNmmQUA3Ob0FDW9GewRvJ IcskFwwaw1nLk/BFR6pA1lYUt7oLI7G5j0FT1vVXW42tyvauY1sEi6cZb5rdw3awNULj gwU9r8R6HQxVHY1NuJbYjk5CXgpslQI7aJfCM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=H0yLI43+34845NpBGT7PtcU9QApD/H2T9BAM4SivCkOdbLON69/8DT7Xy1Toeh12fG 1v/O03vEg/gGBgvxFsCMR/UytmObdRR+IrPzMLAYkSOrVTXQd183QCmaP6g96swyr+F0 wI/WlhZ9sDA0gKSQGq56a4AvHPuSHLHXxUhjA= Received: by 10.224.72.98 with SMTP id l34mr2257349qaj.344.1257090947965; Sun, 01 Nov 2009 07:55:47 -0800 (PST) Received: from ?192.168.0.101? ([75.68.47.100]) by mx.google.com with ESMTPS id 22sm4007589qyk.14.2009.11.01.07.55.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 07:55:46 -0800 (PST) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Doug Currie In-Reply-To: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 10:55:44 -0500 Content-Transfer-Encoding: 7bit Message-Id: References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is readline support gone, or did I miss a configuration option? e From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 13:58:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1FwUKC009385; Sun, 1 Nov 2009 13:58:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2CE21A69E; Sun, 1 Nov 2009 13:57:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD1981A672 for ; Sun, 1 Nov 2009 13:57:10 -0200 (BRST) Received: by ewy26 with SMTP id 26so4238692ewy.5 for ; Sun, 01 Nov 2009 07:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=qv326UBLTX2e7Q0QqBBlClk8hB/BhoOnEtvEKILo47w=; b=rmp5jVwrh4tjWLNgqekeTu30i6HB56Hza6q7TUbSUpfE5WMo587/nHZGe4AUG+InQV QTfyfVMmxvnJwwqz5jQDrgmoySJFFzUBGhEaSpNy1SDzEr1suK25vbb38spPMLcmcfU+ 2fjkca5hVIhaIi3kqjuhB4+T/POKP2cO7cc8Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=nP9xE2bOYk49TR5rZ3DqMyyCFQ7bYK2ZgqW2OaHoKTtBoBKaCPZtNRU9Ge9JVeP6Hs BFEaA5LumbP2zfkm7Iq1pYRENbar++qNrW1O71DBwjVj/pO0xZaL0cHcvmP3kYeSRJMT /pbxZQ2oF+OfWMaPuWPRS4vid8o5raR0FwelY= Received: by 10.216.86.148 with SMTP id w20mr3124226wee.138.1257091086270; Sun, 01 Nov 2009 07:58:06 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 28sm4755eye.15.2009.11.01.07.58.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 07:58:05 -0800 (PST) Message-Id: <9656C114-E44C-4C83-AF40-0323F0406B35@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <20091101154334.GA6853@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Sun, 1 Nov 2009 16:57:33 +0100 References: <20091031225554.GA30341@mike.de> <7DAA1994-B523-4F87-A0AA-0E382A570FCC@gmail.com> <20091101154334.GA6853@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 1, 2009, at 4:43 PM, Mike Pall wrote: > I suspect this is doing many I/O calls (not compiled yet) or doing > a lot of string handling (the compiler is still a bit weak there). > There's still a lot of room for improvement ... Yes on both count (io + string). Still very nice improvement at this stage :) > No, but you've either not installed the modules, e.g. lib/v.lua > installs to: /usr/local/share/luajit-2.0.0-beta1/jit/v.lua Ah, yes, the module was not in the path. All good now. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:07:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1G7Jt8010128; Sun, 1 Nov 2009 14:07:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D51101A67F; Sun, 1 Nov 2009 14:05:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 755E218537 for ; Sun, 1 Nov 2009 14:05:35 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4cwp-0004RL-00; Sun, 01 Nov 2009 17:06:31 +0100 Date: Sun, 1 Nov 2009 17:06:10 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101160610.GA7245@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Geoff Leyland wrote: > Here are some more results (this time making it clear that LJ2 is much > better!): Ah, nice! > Times are measured with os.time(), so not much resolution. Consider using os.clock(). > I tried -jv, but it didn't give me a breakdown of what was interpreted > and what was JIT compiled - how did you get that? I have a profiler on the backburner. Gives output like this (speed test of binary heap): 39.2 interpreter 34.9 5 binary_heap.lua:101 10.9 GC 5.6 1 binary_heap.lua:69 3.0 C functions 2.8 7 (5/3) binary_heap.lua:42 1.9 6 (5/11) binary_heap.lua:42 It also visualizes the different states. See the attached image. Green is native code, the shades indicate different traces. If this looks noisy, this means it's jumping between traces a lot. Grey is the interpreter, blue are C functions, cyan is the GC. The red to yellow shades show the compiler itself (it's fast, that's why you don't see much of it). Time goes top->down first, then left->right. The scale at the bottom summarizes the different states. It's able to sample at higher resolutions. But I didn't want to dump a big image to the mailing list. SciMark looks much nicer -- pure green. :-) Not sure whether there is enough interest in the profiler. Maybe that's also something for a commercial add-on, to aid in financing the project. > The kdtree code is in the same place as the heap stuff, but there's no > test harness or data. If you'd like that, let me know and I'll put > something together. The map preprocessing stuff will be harder (but > possible) to isolate. I'm always interested in independent benchmarks. Because the benchmarks I write myself are biased (I know what compiles well). --Mike --vtzGhvizbBRQ85DL Content-Type: image/png Content-Disposition: attachment; filename="vmprof_heap_speed_binary.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAIMAAAEGBAMAAAC0uTuKAAAAMFBMVEUAAAAA/wAA5wAAzwAA twAAnwAAhwAAbwAAVwD/YAD/AP//AACAgID//wAAwMAAAP8mpiPpAAAlp0lEQVR42t27P68k 2Z0ldj/CSEZDRgMSHsVkGxdZACHUjlFoAjTKKswANAgZBW51NvtkYHAQb7aNZBuJnpkGNthG oPgF1l6LkClLRvWt6pMJ4eAXX2ABgcmZqGdc3CcUl480Aq9kxKuWJdmCws9ExP39PX9uqvTd 7zbbnxIfHavp8lozpoHn+0trzdmYNryE82ec57nIFDAABqk9T3yR3rN3aAyDrEbJ01zhvQ63 l1rbVPSV83VrpZI3m3kxjA6wCIK0+SItPN5RDnLssuHpfiPaGm9dW8vejMuZrU4+4KbOO4IC sDe7AQOA7lVa+NI79fUaRHY3xfZmdjnJl+oWzhtksToMVs3k8QgJEPwbAWfhH9M7j7YdlLkY /tV0Fi3DU63tkcXicrutjZifztcQAEJHQMRvDL1Ky7hbnL39grCvcPVmezPTYFfydAlPljeu 2xpArbMAgxAIqgNovEgLKZ8ZOxtZmJZ4e0Ob3Y9rtGrTli+RA5jrLPjcAQQgURbwIr0jHZs+ bKDeye+K7pw94vt632wLZeNqhx7Pnt0REABDtARofYtbRSOOrtnl3nX2xKOibmvYeLqYdfJC z3kmDwP3ILE+r6EX6d2u+EfK08gDq5inba1cdOy2UVv1AvlU6pWnPW/mitE2hf8ggySx14u0 0MrO2xGdq2QXzfwZPfbhVr0ANltrFbt5nvcgeAQAQaAOwItk2tZkm7wInvzHzc4gS9Tblk17 cW2taD1OCACGDv8gYCTwKv2nXXHdRJBE3TiHVXeG4VJbWwphs0Y86vx2vhNkDMenIoi9eIRe pN/Tsso9dRqr6fdRKxd8jqvsVv1ew3RiW3IYdc5YAwpwT+wBgf+cfr+7vgu/CwqucnE5V2d7 v8tLbTkDz+Vawz7Mdf7cIgCZGAEC4otkj8+mvy6TgX3VwbV6tj/3wTW3Zne8cqn1ibthnmVi 3IMALIAm/SK5353feAoLqJKnIjMfrhWxbZOvAMs1aiaqRdoPH0OCR4EvUnavcs5hH1T1cb5t nunj6N6ttWzYYp2cf3uu5wqdqM6AQJqC/SL5+qgsXzK0t6UrzzOvjuzGS7tUm7+0+K/Z0Wmu ldIOhjvxAFjw+dVaZtnhI4dyx83V65vKQmN3u71c8nSQycvkT6l5ruDnu/Uj1nq38Spp/Ebe bL2exeFUYpl3C6nXxbUt7mBc15yvxDpX6UAcRXjodAas7kU6H2lr+dTioXq/+XGp+tInk75t 0zvzYHm+5AtUa6XBAej2INARnxEv0l1YxX+aiqX6RPLVXHeZ1q7U1pxF4zjHxfIcktdoAIAB QHyVnvW0l6so1N7nyS184zwSfUyt2YThOVoG522GcMQoas0NaH98kczj2XJk01V+PEXO19aE CLdqvzma49urR+bppt0B8kOrAEGJeJV0vTvZ22Zz8GOqXuaZP4WHb+5rq1cGPHquNnBTZ30p PsyQ05rgepHcH2U5nhu2r8/tfZ25wN3rS2vbYv72OcYaU5B1e36ite3CgI4QoFdJwTvb4UGs G2dX3Y6TJvES7fL374EC1qkGVZsJudOHD4EtvUh/DT63c7wDBv+Vd75V+DUmuuZ2WTIGnzy3 EiPnNkO4PhnYAQAl8fQq1fg+T/RiG3XzJj+asmnsED+6vRT7xMLjXK4mnGurIHfAHjzCoMmO L5KDy98rxxWhi7iUULNh9Y7WLLN85vraIc+tej0FUoREDOCLpGX8W8vtEcH6ybUm1+oJvx7G Gq3l07cocG23tudaR4j7k0SsE43Eq6TMTzyU+8KTvRl1qWrZ8EFXuVabLMdxLi5CrfWhxLz+ gQXiVVo8bQx/Oh3sqzvqqs7Nhge5tGqf+Eiu+Xk15iaSlAGI5kk6Gy+Sn/V302GqJvdFk2Or i0tH/uef1lYtTldfcY5Sz6h1sbuH7DyA1Bn0i5SDsj8NQ6yeNrF1eNHu7OrWbHkx5/uwUOu8 z6IA/PZDsUmvkibLhxKLxeoixxz5F6Ppsq1PimTbc2y3GXObRVLCgAGUABOvksIb02EZVdbl 4pYnHPeda2uTOhucS956P7f5oP06RySMEkn8Y9LWOTu3vB9g7eyqZond+SpazQILdjfvrqo8 t0qDwH49Dpmg/jmdg1rkmDTyIspXbhYo2ZdqgRmcfblUzW1e313AZxD4rWG+SHLcGY4M0rJ9 cTjDoOPSfMbuPTi71hvNbYYGs/tIogARgl6ls/2TDG+Lzri1zyXmewu/Bl1v2yOddot4Q3tZ E1y/I/f4TCPX0OpFWiJkO3z4Tvn56JIdXsTRpbZHWYcpu8x0CHObAZEAhU7g4FHHV+kUo8wI nzE8X5eNmCTuld2q2R2NZfYlhDluwLXO5QNswNKLtJnG08/grY9G1c/l/LZZdidPrbrD76w8 77KF2uoeyrAJQYI7wy+SMlURzQAMKi7Vzqbk2i7vzh8fiz33+blV2wwM2YIo7UHsCb5K3u5s xHbhMBiTy9Zt8tkES6uFYsaf5uvJb13bLNp6/O8wAAQIUv+YtITc2eaISp6XkC1k6Lq2atr/ 03GZx3yx6rYChwIDAmiho/AqzfcF1o/aYsLf0nW6c1ZnMC612r42ljmqzXk74wSPMAcCpCTw b5KD3SKHCVVQsa32HSeBbvUR/N9fwTUc4tz++jAHKY1r36FeJP8d8fxQwhRqR+Vcw3fDMhzp djFBI9eYQprbzRmjQdB4TEKE+SLVuIbt0O5ju3Ne7JbvtIz4PtpVcea7U6m8mmbVNss08BWk kwYJw4C/SXZvOzdR8OFL17K5WIPtvrU/XkEs9jy9W8R5a+Kpof2aoBAIv0r+1Yg3+FHoGmPt +NTeZGeUo2Lbau7AzFLpLNzEbNpYwcBDXPQ/JEeMPi3N1yMqyp23uVmjO/XbVicei+CZJU6q W1F6hM+NFdZob+hFqnE9ZNYQz6igHbOLYKOPVk3yL+Pz6hL23NSRa7+gwD1k4VVa8pEXtDDp emL28tTFyD593drt9yT10dVcnLeYWwX0/kPjhYCO+VXyZpLHS9mM0LszVb1pVxstB5TWLsZn NPJMu7GGRT9fawmACHh8keSdiy55IZXFnOtr2w+p9ccfGdZvp5lbV1zaDcSF2IOCAB5I/HPa nCzzEvoS++Lr821VXe4687fctuqDpgzXKJG76grgEfYfkCbWxmcRhTVEqoqbW2+qN7COcWmT D5o28uwSW7bmjliAB3gH8mC+SstSOKFG9qGa0/l1VX2/0QSztnqSx59oqpyiuLVlv8L1ATDX TUev0o34xcQaJjYZ1671fbVlmo/aLILnwXNEaahtPg38M7327tEGxH9MujMn1OrJvrXtKS6W bJZte3v3FZ49xvfzLiajNuHgAnnte6IAvkqzR1bUJmOe9td3Yb/z+WQpWttsJP8E0zzYgT/e 1g97JwWCEDW8SvMvzWmobWMqk57aVO29PbysdT7jcC17VnXmpXrEd4b2KyjCCRRfJD8lrUu7 M2/qmTlfWp18WIS+rANwM3hG21rtfgb3y4eRSpwA+lV6Lbui1rPHv9bf07anSXztM9zeftJ1 Nt/PKPcX1m3VYy4SOkDQiYCevEiyRz+t7S/kbPJ8ae3iEyx9t20bUYt9NcM2mzXwUD7gTPPD TN0stuttPi5zlpelhO1xIYfcZhP2kKta9W9b1DNhnqGB4BnoOPhV8uKdfdu8q7Pxa9/Wdskb GYbbLLNkl6rWCm63MyTrMUgQoAYCr5LksbA22Sr44hzPn9QiTaCmVoXBOud5cI1D8wYdrx4Y IVpnmniVNufpjd3aG1pXtFpt2QtMdNtahbE8lmdd5cy2rfL+/YcxsAck4kW6k6+L67/Klnl9 fGPX95QPHq7i8Qaw7PpV9eLWZvG8rJPw8ICMvnuRZNu7S7Mtk2iOiwXbiDJLvJJcj0utfl4F fW5B3wIjSGnF7Mo/NVt7TZ/NxdvbuDXkDqr57QZ+bU/zkyhxijbrDbwO5JUGgYcXSVpo1lt9 c6nF1v3Wt6aKoPuqDNnf/qiiOnh1P+8P+wzhs7VlDMDJL9LdX9+XhbWJ1ZbR7HoFGPux/bGa 3RuhzPpzvYw1BLAQBAxrbRmvkk72c9Z2pqvOuXNptx7h0d+Vy9wBNlwdtcgxH3g9PTTeNT15 fpXOCl99WZuuvfgjM+K+FsEDdNU2PMKLXO3qocVbnFk4DOa6g8sHvkonmf/KWk0rHxfEfVzs 0ehwVWeI1nGqrLbuWwU8rTB5LxnCb/DPSQpObtU/Kzc6GtHCBbaAlqs+O/q08/x9jWDZ2hi9 wpqPjnoGUn6VFpnZrT2mtcjaRlwm0Qb/WGZgyLLr2fZdixkq6zjWGtST9Cqd78yJ9WLW+vy4 +PWUq3+t5yd0t3UGO9uuKjUr2qw9swgDPuwpAMdX6W7x6KnWza5u3Jmut/Wn5BUAx1qZ/H7W xaHcqkB/NUgYDJhag3qX+Y5xEae3RvZVbjVjpfDaLMF2qV0fddNaNVi4skmAKEivkhVe/qOr vwnnYXK+5Muks2mxzUCXz8wzXOumNuPxbsVm57UBC3yVLBddl6qpSocnftdqtugjvWtSPlh0 PTCqppZBZlA0SXWjBuNF0uPNTrytYjgfp0PUVhd5oj21WVK+K2VG2HNtjUcXj6SEPfYkgFfp JP3aznGyZzEj6jJ54DsabHU40+Y0f16iurXWgVcP3BgFajiM/2fSnShfLqZlPjnUuK3TUPJw 7KJVgFmcZkzbyzx9Wikaeli1TEpKyT/xN9W+yiVmD0X//l278oGmwFZp+MwfVfQ1VCPA3xk6 DDQKBOFjpWSZM6PYk8SrU9u2dxm2zoo2GweffPVW1/GrOVoTPdEafmg6Qkp3vivzlEPxqIr2 FM3m9bu95Da7Q8m/zjdgTIrWRJY1JR7+wYeUTjLfcmnqQ+fhPUa3Wv52soVvtrNB/+XzPLvP xbeXCw/2CRAwPFBLSin7xJmuS299YoPRiuVF3EfIgDPzrLFZrTV8yQngyvoSMJDSnc163arC +qQr2OXqH3GXj2fs7jf06I6lqizP3m5Lw7AU/d/U1h5wSlkuldHu7v/NgEHX20UMoDtuNwDN yTdwyW7RpEfv/+Wwxx62JEBjSrY4+3k4SsX4Tiyt2vyVDT8xJfPalSx/qrUG4QxogDpSIIyU LF/P9uWT+zDP1q7Un/nAsMCWgcHm69m/c5lbq6ALPmDtD0H9vf/K+WNXhSvx5LfwbZ0ODlh9 mwF+D/tGL+Onaq2RbwooggBOgL89pfS/6o51V+omsuBJiuZMb9EdS5OE5fixbr699sW5NaG8 Xr9A/yKQhFP6L9r09fr3cY46j98Zcrta5Pudyfb4rNN0KHrL3W3UvK2Q140PtqWzwJR+f2fO H0+3jrbBr6+AuNQrMECWpu68c8dN7SK2tUUzflYGaBA5GOwEpsSTeu3sHJ5HGir1IuzuoRGf zMC1UVzlbavt0shiSMB4Bj+T8BgpUZuv765dN/cXS0Xu660+95YeMFfKBXSFL67RKh8+5CEz 0Qkp2cvLM1tVVO9piHUyx6jPSM8kjWvNpt+5Tb862ZkERIsdCDAlWiEWM7LARV/1ze528Rcd hln/nejPjnoLhS+399E9EPoEAA0SndJ/2bufWf51iNiA1qlvFhziV5xndswnatYvw9/XKAf8 OMPSVwCgPUikdE3FXF7fKmwNBf601TMZps/zfNrT4F0d4O19a/H5WBZYKwFCCVRKpvu3zJcx LHTuzEs9f+6IvQ51lo/5/LEq5BptGxgmQwceiQM5EERK/4dF7VzHqNVnk32tct4G7Xmmdgu/ PFWjZbdaCfv3ovxAYQs/Smn6tTl/nCvDC5gJtmo/iSqd87pfXJ9myFFba09g74kBOtPA+ha2 eONSEe0M/PzAvtVsh62PNxuQplWNui3RGvnIAofDiswOwJjSDuo3Y6m49+2h++nwUd8u+TTF Amne2DToKj5rUVuDnXEwYBoDBgEpXevEt4wLtu1WB7NTq2dNEYRUSWaM/gNou23bSP8cZw4A aeBMOKXRZnXYUX6O/XIGahWnbYzQPAMs5OYteXFt0UgL+OxhqoMgU9od71ipiigx4j2EVi3f 5+8GzBuRJjWju3K0aGJ5TQziSjmCYEo7imI1w3FQAQ7tomGKxfI8CyywbojqqNs/YrcIGEAM APfA6JQMfVG9ea6oFnTw/9yqke996jTfANfGqDrgXXVrjd8XUxQBas+1Rkj18sZduAkW2C4n fh8+AnXGxsXUzXqcfQXz3RpPEQMOOI4pESdvvNxi6yAE7lsVHIakG8Nv9IUrlcMtYm9r5S24 J6AOTMkSb0aXEvlTfO6H4yxhCMrUmOHNLDjfRr/VzgYGjCLZ4WAipS+hY/3CGeEK6/of/rbZ 8tYg/nAjFMufzAdd1dsWDSw6EySwQkwppWvqP868uRzj0khTbFl0bCUoE57Av8xSH631TS4b Qqv2B5oYUiJd5iIj8o/PPBndxR7y1qOxmQXa156l3aNofeXu6oPsJcKCldIk8S2Veb9UUgRa zXuHgW9uKsjMspnRMbc1O0/AmhlcIUlK1IbzP6l62xpoys2St1tAMjiaVoWmFi3qwKwfNC9h INbUcqWMyCZFsnpj/10zNM+D/tt3KK4SL3nLRi/6oG+DpICUvrA4e77VfUwo4h7Nr+1tQKoz MD4aJs0Y7G12MHsjPWgSK1RMyRBr8e0QscX1Ej5cpo2XaKZOBmkungf1jy7ur+Tvz90P29qZ 58+cUv/ZJ5x9V7DN97RfHtCqNYUJLPXMa9OahaNz7Ruz9UH8W30gTKnv5I2VcZ+jO6o/Pm71 AMeE8VyFbjStGfDWrW9cLHbEYxCfGziRKZH2nF25LRneBPaXnfyjqATmWS5Zk2+I3u+2fYMt dQ+KEWGAKZn5+q313lGjo/oT2tFwWOBc8S/+JbLeCsyPWv8r2A+pRe1P0DpTpaOy2EW7B9XT FxKP4smM4cZkUWfPI5xd+4C9eVBTO4heU4uKueiImLa6dk+0HeSt59F1FixZ1SPvS42qvPyw dIIQyZRMe55MfhoxTuf+4Mu14Psw8Id6/NgbT573KNvlsmuy/0pwL/gBau5TOsJ99dm8jyAV dKO1xGTwRt777jR9Mq/MXd945Q9wH7A6gykd6V6TjHDTTr11KYIjNsQ8k96c/LhSEY9aX+i8 rKztCAKdxZTYqa9WwX2tpIJoBB9FzORmBrJoN4lRW99oG/xMANRBZKeUiv07WVeObZzpgCvh afsLfYtZLM6YfEvtiltc6GxIBr592B0/BHWaeQoH7KDaNbD08QbdLNKC1YzpNreo9GtzHbTQ mQCc0k4n2y7cbgvsHl07Au5tolbQG1q1U2mOvtGLhoEY/CBR45DSp/AVrmYjomHUy8/cCLov gt7OUDnBat+yLxH9Pf3eD/6NE0GKTOlzyp3x2uEJRT2OrYilD/uj+gfKzv5N/YqMer9rtM9r oQLAIMkpHV/KmEDHFMdpE/ItAb/0LGyErshGhXe5bsPFy+rfAEjseeqQ0vVKmtgR8e31Js5s BB3/Zni+A7NPVtOhr259K/aB3ToSP1Ln9TjjHLbZhRt5DrB9jrN76yPNkrI1sRr9lW/7ttgE cHhoO5SOKTEUMIiowaLeQ+Wmc2/tWIWzLR+r4VouEXnxaW2cGkAfAKXEl/o72aRdRjuARvh1 b3HcCLRh1hGoufXNzgDAD7YY7ZGSo8tdxtRFbRjVd647De7jbtzXebC1L2iPwewa4fzDjwmJ BFNy/5XtzpyWJuul1CC5f/df4VpHTllZDeL73FizjYEPQwQUnjAlmousnXIU2HFUAHC0Csx3 pN29Q5Uw+dLfTpNPMCWunyMqJdtWpjy5iYrVkOZ+Wj7ivAjT/+6CerYWt769Lj83BOAzSHxM CCmR3NKE7a13d70ZIsunYR9n01kw6wDY2whfWQCoAZAgWSnxf4F5JTHqFlS/74LD0RE+rmUm mO1wQDi+rsXTKlfphw6aEinjNZ7KDvEUOt4DfB9299lcTevwjhV7FLe+2T6Dw/ovHFfy4Uga 2eZzN/Evwf1WoPtl2n82z2fmDZ6rdqTjUW8XP1gFnu454qROKfG1VjdUjiDvesKf44urPizN M2zpaqgUH7lG9esF2OO8lhm1B1LqTeNP0M4OTM/CrgKXvmWOcwWzzu6azPrH2sfkvNLglj5b 7ZkpmdjQHeirLY7qxRifXi+9LevEnfNPvLrzao2wywOpdewEG0JKu2vIBfimlNg7BxgwHZ8G tAicNqO7WukI72792oCgIwGg2xNIyRPlP4v2uyA3fTc0iKVv1drM3WjZQ9uIru6rfYXxYeUc Vi0xJRMn5BH83+JTFvVwmHTcX6T5Rn59Hu1/rTgufh/Vk7GO5ZXaWmH/iDN0wPWzlfbQIeDR vSsxv7UtuasLnmztuNiZAnB+MA5YTmk07joRfBaBXyz9GT6AU59N1KrrLNhNZNTW2/YJH60k uOD/7LFLiUdZlq6f5eCy6aFP99o5bP/WhrO60jWJ3kZU+8nYAQAfjKJQSiNtGOYzZxgBNoA5 HLI34GugfNsqXCMi5/Khga/iGbxP6WtKtD7//ucOm73VyGtHLrM1w7bfub4lw62vnqwHsvPD lpJSXOuJNIo/rwGfeyBoOkq9sM52HmDUSkbeRi3FZ5HiSkqNolL6HZG/ksSfR2MZXgqB1URS VWdcl/3krqqj3XoXTyKIA7jCO5xTMilroB1NZsjBx8XhuMPNjNGno1nV8X2LoH31wLnCAEUe UorfUWdDu3zb5I+DqMQ3JVzzR3MVjam4Ccw5dmO2iV9LPhwkcCXoPrXOnayfeduY9SuuA7G3 ZUtcQHdVZDh6+k+Fn62iLuBBA5hSP9Hwv4x2NHgIoEkufSzGporvVeyLBl4c/bXXHZzGEwoa IaT00vJ38kdH58aCAEzsHPeepQqau6Iq0bWZj2yvo4wHUjSckossjdiVpSF/t32Dpt9c+2W7 CHorGrTa3Dn+xxY72+wgCQb2tHROqey6OxtktEYrpEbSfdRZ84a0aNfZ8PvWX9v5gZJ6UL7o lOLaZ2xIOjdl3/8Dmo7XjqnOnAVeweWLOkt521iWZRqw7q6GSEgp0Xt3G4HvlkYfAm7A7nW4 niGPLizPXT+xmltPLyYkHkh+JYgnpuQvuNGbzuW+NmfFb0oj6bhaTpglF02L6p1Uty129sYP JUIcZHNMyf9EUwSn0mCEcIXT5+5LM+qNbPvduZ7P9FXEN7a0ZjceILdTMrmMHo5cSj0aAbS9 PcWUZ/itvAyeXDOwNfudl9XgJMGkTCOl3jtjQxS7uehe44Uj3/e1VczC9GM6d812ib7n82WD Bx4HknAgUwr22ot2zlVvHGITS+ld/4p5VpnIO7Z65mQGy3P/0CkOq1E1pfiyz5BY3l0azICb RH9dlnlfNfpK9LF5YK3x7zk9kaABXPUoUUjpHUP7ou56e9U8KfbYwna4SadKm9yg5v3e255P vveGa8f6jtqfJZ9Tsnt5Az6xL4c3iAFNpHq3mbqRi8qdWu1QbTpnCaDEoVspyzGlbektAztf LnjtMBtEhd3GxZ1tW3U66Fj6nrYeFvCzVwuGU4qRG/gjMErjpADqiPFZ79wGzfQT8G5oAfEZ e+Ylr8jug8bCfUqe4o7ek9kXTQoi4N3Tvt7HR+dZLuad6i3A6PtdmTKElQC3wAGHlGLnTyDg 2K8R8bjtsHsaxRe91dHZzK6Net36fvcun/bAYQW6kHhWSsuT3oPU7Xa+lRnsgh2f9pdt1iwX e1zQKs32NXf2YhxArvyHvzsrpZh8Pms4fvmNL1gcRsB8Gu1RYJ47F1sf1Ri5Cwbt1SC1+nI+ kqWUzP4va6LUhsKwJjo/ixYT841t7J6wuiOjf7lz3mA/UCatvQAzJbnXtYQd3WAG0UA/jRZG FV1gsVWa0QfLkh/cRR+i4pSWcdTRJPvnDVnBztr7aW9nzYvtj3fnc/0V1EchX2dx/wOhBABM 6W6Kv/CJ/WS3NBTcU0XMT8P5nppZ3FFo9Yzdfc9v8mKAFNFhwAkCUtLUb3YWdnaTxxCq6Ke9 /XeaN1xKdy1EJd5se9P+QYd88AIqJTk2k4xr5gbjHriQ5VkfnlRt/0L8d7Yx/tN9H7tcTgc9 5OUKsIaUTgtzPgt2NL47bIndY5WnES7K884evYHd4br1ve0NvXa+TuaKR27KF+fXJ4zfxF3z IwSw08HP+up8mj3Z/HsPttRHH5wyRGoV/Om1dyqPsvn4mvOFVowKYnkay5/DqnQmTVcytj7S BofjHgJMaqCR0t2T2FC07Wo7gB6enka9LN2snYVvzmNtHtn6cDYJCJ0JQgfTKeVnzrY/mvq5 2Q45XrM8jW225tm+EzdDbhKjJ738oNp9MFOnJNPjHVWeqzEj9ITUpNg+8uxaik3RpbK/70d6 WhPLA23yADClTaGvNwKtyuIwe/DqL/Gmep7n62ei7zovVQ72Zcrdid0XK1kJaaXS3Zt3Hd2r 2d/ez4fo5NznVt7OlVefwAu29Xz+afTmo7VCaK58EMCUFof5+Lcg0XZG3KmXy11cRWieuWzM RY67nVvQ009FaAAMn18TNFLSFCfqoMluNEKeRLufHj3TPO8sjUJYfhn8mn5kAT6uayMJOaXn 3mlnwKFmK4QQc+4v1Ztfzi5nesNssd/GjlfrVvFwTQsAuvUsrgWQbsyIRQE499V1rvqpN+b5 m6vmjrH7tJSCDQDa+9VZc2ZK5/e9aHBHNRqRz/TnyyYuUTXP9hkW3eS+9X3xLyRJ4GldMaTf p+TppXcGf6ehsZzvb449lBVb12WZXe5k836aieh7etK4qgqrSkMopbN72xA7bFkUHnrAilxv VevySLIYkzBGeU2/2euBvhbgz71XSvq3l7+kDvyFvB2LyxlB+Nzbn2p2zpI1Vmvkto9dzqu9 dCXnuiPklO5qL/6VKKKvf3IOi0JWXy++uatlEa0vqqt0/3VPL2vTJQV8hAeoe+nvLOp7Y2tx MYyjHfWqapadmT06RLSvv97ZK2cwQFqvJyElVy6WaHUX2iXUg5OjOmrV5EWWbXEMBp0BHHAC B5zX+4gpqR6181l/GnA/aog/MiRvYrtUzV6WTOvaISBM+tQd9LD4jmvNpnR2j2vLHtl8N3g5 RIfivkTNqsV3eKdrb+tB0Y8sOh8J4MwfKOSUlidfHKiXMBXXZ5RA8LHxtXOrc7VNu5R3c4fo v2Y+P0SD5gH0vjunJB99/MnHttC8nOzPKVh9dd1san5+R/vNpUpDRD96gw4AvJrb2YkpVV8f CR8L4XFzdLjvYPbt0/y4PrIXTmbkjdX6vnizKjkERBqvzZTq+2m9xamPW7nDEp8E8Vp9LlVz Xa6sYvvPGyBipIXXlHCSYJqfASltamDc06YvFpbq3ge7d9QneVmKkDXZooL9F9NPHqrd3z1c m1BKrl/LpB8dzs3nXUSNPTP6sm2eFz86sWiq02y0iWPW5z+M9BWRdCktU2iH4ELVnbkUBYrV 15jaxl7uDha31X4cfT9Nht0RD4T+ShPO3pnqbbOWv3gJvZTNcPs+5pxtZzFcrAjaGxxwfsAj 7kA5pVk9TCMP8k7Xdu0x2v0TT77JznK289VyZove+Q5e9b+HmQimVGXw2J8Mtp1o6yX8zPGu lbp57ixZrK5CxNc7a2XnhE4POZbSfKaLxmEC22g6JmP37vB1bKPN2dbHC+io6OJl73w6QJao rluv/TKl+a4fqJ2tLpez87ta6Ix++rdL/OFiP5E/2jlXMF7GMXs9SXUaRAyEUqo/oSmykM2i 3zv0pcGplSp7kqbOrs/MYO8rrzzOD1SjkdK86b/i2ZiosL4ot5deR3d92O2tvVg+/lMuBafo d2XFRAZFUjjvV9a11zXoArQfa2c/MvgEpfxsG5u8FHYexuw4/Db6/vrdOo9XQCFTREobryqf DwwvLJfas2Sx2LGxPRwMtmqM277nskZz8APTCDCl6l4EbastmhzlJXcelB1R61IAH7y9XSMy XvH02A/jdBVJlJL/QlrWFb+L4mu7BZn5Hy7vWsx11QtKmaoYX/a7BXi4zaj9am1UStUGybMH N284efkGtpCjtvmP9mE0vdg4Rh8uD27ZVfD6aICRUp3vZRl+ovDGfrTtcf1cyC3irrqI1pSn APp+t1vMDh+QKiVKKXkJ79jD2DeLP8+Pen2Rxam2+EP1I8C0LwH0X16XNw+xQAfwIHTfMiXl 6MyoZa+2bOwpKJrgE8dci8lMX6aLHT1Zjus77CG8xgCLKZ3n57TKbOJREd1aDz868rp6+3bJ eTgaY94WjdEHX3O/arEPC8q6NH5iZXj2OFTfXW/rn3v4CTVN77bnum7+15Gb1fdhD3ywHa92 Va3Gs8ICvy1Atd4URz/yitg9ytvZxR8xf8vWDMWO9EN58OEOinxOaeMF9TveeeeL9c19ufSk 9+od7VSXDEweHfWO8ZI2RA44ADppkAmmdOf3vsCziFrM72Pbk/8V4tbbWm0xY3oT9j7We/PY r5gMhGh1KdkZF9niuF08OtzvSwG+Kbft5rbk4zPLy/a53fex8w8b30O9uUvJbypv7XkDVYul 1t6eNLDWlquz5Ozcpop+13O1z4EQ9uu9TKX0S1VXVMvIxYxcXmK0yIuj2qvDsGzrjIiw6G4A Bhtwx7WDS9VZns2u+TyG3ZtF4JXbHxZfDfCR7f3lqSNi1NCtd94erjwATkmuJ8v17HN9Zvri Hh8/Ffi+tZs6Zei5OD1vG/TRUx98hOvC1XF0SouNi9eI+M6vf2Ty6N/Sjk9/5WzbiDw9kuPY 884PrnpI6gyRKXlZeMEym79p2TtPEWQ+d7sardlFLoqruvW+j6BErOSxoQMEO/3/5/H/0zO9 v2/r89/8vz5/8/+Nv/i/AF4Z4lWwOzuSAAAAAElFTkSuQmCC --vtzGhvizbBRQ85DL-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:15:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GFfTs010772; Sun, 1 Nov 2009 14:15:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55A731A69C; Sun, 1 Nov 2009 14:14:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7EA51A672 for ; Sun, 1 Nov 2009 14:14:19 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4d5H-0004S2-00; Sun, 01 Nov 2009 17:15:15 +0100 Date: Sun, 1 Nov 2009 17:11:35 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101161135.GA8198@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010524j110248d8oabf69d555aa53149@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290911010524j110248d8oabf69d555aa53149@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > Seeing as LJ is already tracing all Lua calls that are executed, could > it not have an option to export this information in a form that would > facilitate code browsing? This is a common problem when familiarizing > oneself with a large code base. From static analysis, it is > practically impossible to know what code paths are implied by the > simple call 'obj:method()' Well, yes, but it only shows the hot paths. Try -jdump=b and watch the traced bytecode on a non-trivial example. > The exact format is not important, only that it is parseable ;) Even better: the VM has full introspection -- the dump module is written in pure Lua. Look at the dump_record() function. Simply hook into the "record" vmhook yourself and collect whatever info you need about the executed code. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:16:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GG68n010865; Sun, 1 Nov 2009 14:16:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A1421A6A3; Sun, 1 Nov 2009 14:14:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D78A61A674 for ; Sun, 1 Nov 2009 14:14:19 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4d5H-0004S8-00; Sun, 01 Nov 2009 17:15:15 +0100 Date: Sun, 1 Nov 2009 17:15:04 +0100 From: Mike Pall To: Lua list Subject: Benchmark shootout shows LuaJIT 2.0 (was Re: [ANN] LuaJIT-2.0.0-beta1) Message-ID: <20091101161504.GA8498@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > What is particularly impressive, from the point of view of someone who > has to do serious numerical work occaisionally, is that LJ2 is right > up there with the compiled languages for raw performance - and this is > just the beta! So, the generalization 'dynamic languages are slow' is > now officially outdated. Also, I would suspect that the memory use > for LJ2 versus Java would be much less. (So much for another common > generalization, that one has to pay for VM use in memory) The shootout site now shows LuaJIT 2: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&d=data&gpp=on&java=on&luajit=on&v8=on&calc=calculate&box=1 As I've already said in a reddit comment: Heh, it beats Intel Fortran on two numeric benchmarks (mandelbrot and spectralnorm). :-) Only the hand-vectorized stuff in C and C++ is faster. Guess I need to add auto-vectorization. Well, maybe next week ... ;-) --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:19:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GJQPE011143; Sun, 1 Nov 2009 14:19:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68FCB1A693; Sun, 1 Nov 2009 14:18:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9ACBB1A65E for ; Sun, 1 Nov 2009 14:18:05 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4d8v-0004SZ-00; Sun, 01 Nov 2009 17:19:01 +0100 Date: Sun, 1 Nov 2009 17:18:54 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101161854.GA8743@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <10221641-2759-4111-B413-85511FFC6D7A@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10221641-2759-4111-B413-85511FFC6D7A@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Doug Currie wrote: > The first time I built on OS X 10.6 I got this warning: > /usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for > Intel with Mac OS X Deployment Target < 10.4 is invalid. > > export MACOSX_DEPLOYMENT_TARGET=10.3 Ick, I knew it. I'll change that to 10.4. It's a requirement for building the shared library (which isn't done yet). I assume nobody is compiling on 10.3 anymore? --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:33:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GXpiD013030; Sun, 1 Nov 2009 14:33:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 163301A69A; Sun, 1 Nov 2009 14:32:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth02.prod.mesa1.secureserver.net (smtpauth02.prod.mesa1.secureserver.net [64.202.165.182]) by bazar2.conectiva.com.br (Postfix) with SMTP id CBD831A65E for ; Sun, 1 Nov 2009 14:32:27 -0200 (BRST) Received: (qmail 24610 invoked from network); 1 Nov 2009 16:33:18 -0000 Received: from unknown (98.117.140.83) by smtpauth02.prod.mesa1.secureserver.net (64.202.165.182) with ESMTP; 01 Nov 2009 16:33:18 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Self-deleting weak tables? From: Mark Hamburg In-Reply-To: <20091031162319.GB11203@vaio.jimpryor.net> Date: Sun, 1 Nov 2009 08:33:17 -0800 Content-Transfer-Encoding: 7bit Message-Id: <45EB25AF-DA53-43D4-B2C8-D7E3B81CE507@grubmah.com> References: <20091031162319.GB11203@vaio.jimpryor.net> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If you can attach data to the cached objects, then build the cache using fully weak tables and have the cached objects hold references to the tables in the chain leading to them. Mark From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:45:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GjmKH014146; Sun, 1 Nov 2009 14:45:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AE7F1A67F; Sun, 1 Nov 2009 14:44:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF1F01886D for ; Sun, 1 Nov 2009 14:44:24 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4dYO-0004U0-00; Sun, 01 Nov 2009 17:45:20 +0100 Date: Sun, 1 Nov 2009 17:44:50 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101164450.GA9366@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit François Perrad wrote: > 1) numeric for with step = 0 causes infinite loop > $ luajit -e 'for i = 5, 7, 0 do end' This is testing implementation-defined behavior, i.e. you'll get undefined results. Should 'for i=a,b,0' run upwards or downwards? And what about 'for i=a,b,-0'? LJ2 chooses to look at the sign bit and runs downwards it it's set. Lua runs upwards if 0 < step. Now, please don't ask what happens if step is NaN. :-) > 2) losing arguments with metamethod __call > m = {} > setmetatable(m, { > __call = function (obj, ...) > print('m.__call ' .. tostring(obj) .. ', ' .. > table.concat(arg, ', ')) > end > }) > m() > m(1, 2) --> arguments are lost 'arg' is a Lua 5.0 feature. Not supported. Use {...}. > and some new minor issues or delta : > 1) getfenv(-3) gives a more general message : > bad argument #1 to 'getfenv' (invalid level) > instead of > bad argument #1 to 'getfenv' (level must be non-negative) > same issue with setfenv(). Intentional change. The common error message is precise enough. > 2) tostring of C function > $ luajit -e 'print(tostring(print))' > function: fast#29 > when lua gives : > function: 0x9a5d020 The exact format of of a tostring'ized object is implementation- defined. Giving more information (since it's there) is intentional. > 3) xpcall without error handler > $ luajit -e 'print(xpcall(assert, nil))' > luajit: (command line):1: bad argument #2 to 'xpcall' (function > expected, got nil) > instead of : > false error in error handling I'm testing that the error handler is a function. This is apparently missing in the Lua codebase and it's erroring out later (which is not useful). File a bug against Lua. > 4) table.maxn > $ luajit -e 't = {3,4}; print(table.maxn(t))' > 1 > instead of : > 2 Definitely a bug. Patch attached. Thank you! > 5) deprecated table.setn > $ luajit -e 'table.setn({},7)' > luajit: (command line):1: attempt to call field 'setn' (a nil value) > instead of : > lua: (command line):1: 'setn' is obsolete Intentional. > 6) math.random with extra arguments > $ luajit -e 'print(math.random(1, 2, 3))' > 2 > instead of : > lua: (command line):1: wrong number of arguments Intentional. None of the other library functions care when more arguments than necessary are passed. Thanks for helping with testing! --Mike --OgqxwSJOaUobr8KG Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="maxn.patch" --- a/src/lib_table.c +++ b/src/lib_table.c @@ -74,14 +74,14 @@ LJLIB_CF(table_maxn) TValue *array = tvref(t->array); Node *node; lua_Number m = 0; - uint32_t i; - for (i = 0; i < t->asize; i++) + ptrdiff_t i; + for (i = (ptrdiff_t)t->asize - 1; i >= 0; i--) if (!tvisnil(&array[i])) { - m = (lua_Number)i; + m = (lua_Number)(int32_t)i; break; } node = noderef(t->node); - for (i = 0; i <= t->hmask; i++) + for (i = (ptrdiff_t)t->hmask - 1; i >= 0; i--) if (tvisnum(&node[i].key) && numV(&node[i].key) > m) m = numV(&node[i].key); setnumV(L->top-1, m); --OgqxwSJOaUobr8KG-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:48:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GmduF014453; Sun, 1 Nov 2009 14:48:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 926A51A691; Sun, 1 Nov 2009 14:47:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08B9B1886D for ; Sun, 1 Nov 2009 14:47:21 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4dbE-0004UU-00; Sun, 01 Nov 2009 17:48:16 +0100 Date: Sun, 1 Nov 2009 17:48:12 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101164812.GA10147@mike.de> References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <20091101164450.GA9366@mike.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I wrote: > > 4) table.maxn > > Definitely a bug. Patch attached. Thank you! Ouch, that was too quick. Fixed patch attached. --Mike --ReaqsoxgOBHFXBhH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="maxn.patch" --- a/src/lib_table.c +++ b/src/lib_table.c @@ -74,14 +74,14 @@ LJLIB_CF(table_maxn) TValue *array = tvref(t->array); Node *node; lua_Number m = 0; - uint32_t i; - for (i = 0; i < t->asize; i++) + ptrdiff_t i; + for (i = (ptrdiff_t)t->asize - 1; i >= 0; i--) if (!tvisnil(&array[i])) { - m = (lua_Number)i; + m = (lua_Number)(int32_t)i; break; } node = noderef(t->node); - for (i = 0; i <= t->hmask; i++) + for (i = (ptrdiff_t)t->hmask; i >= 0; i--) if (tvisnum(&node[i].key) && numV(&node[i].key) > m) m = numV(&node[i].key); setnumV(L->top-1, m); --ReaqsoxgOBHFXBhH-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:50:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Gokl9014714; Sun, 1 Nov 2009 14:50:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B67071A697; Sun, 1 Nov 2009 14:49:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9349E18883 for ; Sun, 1 Nov 2009 14:49:24 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4ddD-0004Uy-00; Sun, 01 Nov 2009 17:50:19 +0100 Date: Sun, 1 Nov 2009 17:50:00 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101165000.GA10258@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Doug Currie wrote: > Is readline support gone, or did I miss a configuration option? Nope, forgot to mention that in the status page: Starting readline up all the time is expensive. The plan is to move this into a module, which is only loaded in interactive mode. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 14:57:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1GvbMn015273; Sun, 1 Nov 2009 14:57:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B2DE18A5B; Sun, 1 Nov 2009 14:56:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 258D318A02 for ; Sun, 1 Nov 2009 14:56:17 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4djs-0004Vi-00; Sun, 01 Nov 2009 17:57:12 +0100 Date: Sun, 1 Nov 2009 17:57:06 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101165706.GA10540@mike.de> References: <20091031225554.GA30341@mike.de> <4AEDA648.3010402@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEDA648.3010402@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > > 4) table.maxn > > 5) deprecated table.setn > > Again, these are Lua 5.0-isms that are now deprecated in Lua 5.1. Use > #table instead. That's true for table.setn. But table.maxn is not deprecated. It's just a very slow and very stupid function that anyone could write themselves quickly (for the few cases where you *really* need it). It should never have found its way into the Lua codebase, but my veto was ignored back then. I also predicted it would be misused. Nowadays, newbies amongst the WoW modders use table.maxn all over the place, where they really should use #t. Drats. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:07:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1H7PvT016103; Sun, 1 Nov 2009 15:07:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F316218A7F; Sun, 1 Nov 2009 15:06:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5CB418A02 for ; Sun, 1 Nov 2009 15:06:04 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4dtM-0004Wj-00; Sun, 01 Nov 2009 18:07:00 +0100 Date: Sun, 1 Nov 2009 18:06:38 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091101170638.GA10614@mike.de> References: <20091030022824.GA12167@mike.de> <3c7535c80910292147m32ad72d9u1fe47ffef5caa778@mail.gmail.com> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean CHU Run-min wrote: > I found it doesn't consider C func's frame size. In standard Lua > implementation, the func's frame size is recorded in CallInfo' top > field. But in LJ2, there is no space to record the frame size of C > func. Correct. But there is no need to record the size of a C function frame anymore. [BTW: Congratulations on your grasp of the internals of the code!] > It seems harmful, isn't it? Or my misunderstanding. May Mike Pall > reveal the mystery about this? C functions can only use the lua_*() API functions to access the stack. But LJ2 uses auto-sizing of the stack (see incr_top(L)) and mostly ignores lua_checkstack(). As I explained in another thread this is a) simpler, b) less error prone and c) has no negative performance impact. The peculiar marking problem with the re-appearing stack slots can't happen for C function frames because they do not have a fixed-size top. A return back to them always reduces top to the last valid slot. Bulk-incrementing top with lua_settop() always sets the new slots to nil. BTW: that particular GC issue was the main reason why I switched to auto-sizing of the stack for the Lua/C API. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:19:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1HJ0xX017052; Sun, 1 Nov 2009 15:19:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 246C018B9F; Sun, 1 Nov 2009 15:17:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A64F518A58 for ; Sun, 1 Nov 2009 15:17:39 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4e4W-0004Xy-00; Sun, 01 Nov 2009 18:18:32 +0100 Date: Sun, 1 Nov 2009 18:18:24 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101171824.GA11584@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Manura wrote: > Deploying LuaJIT2 via LuaDist is now supported [1]. Hey, nice, thank you! > BTW, appending "/debug" to the LJLINK flags in msvcbuild.bat causes > nearly anything to crash (e.g. `luajit -e "return"`). The problem > appears to affect only MSVC (2008) debug mode linking, not > Cygwin/MinGW/Linux. I have no clue what MSVC is doing there. Need to investigate (low priority). Please mail, If you find out anything about it. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:19:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1HJSQe017113; Sun, 1 Nov 2009 15:19:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B4ED918A58; Sun, 1 Nov 2009 15:18:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 459AD18A58 for ; Sun, 1 Nov 2009 15:18:08 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so521500fgg.17 for ; Sun, 01 Nov 2009 09:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XUye0CTQKwoAOFN5WqfY1zrTIwJyaJ2J9+btwhxMznw=; b=NcjXkNUtmhmbFWGMOUeXen/WWPEnBM7B2XpWwK3jOUBnQyYByYYURL0EQMABwbPLhX 4YRErWm3oWcNG7ojMGIsXG5X9oNxhjMqScKHespyEnJfiUmV1d8a5Osl2r9X716IV/9x 1OP4/4/EXF5D+e+Y/On0SlJ1ZgMU2uBJ1cYAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qLvRdWXeqdkGRgr849PL1KblC05KkruQJDQs+LDu3lGbqznypzpBnZJXa2CNU5TEqT ShZqorBtZjq+6OPZug0APiw3tQYe4lcb+wnIYQnU+QZaWovv85BA6/r2vXIHlpM6+m/e G0tyPesB04fqxbdTjMAAfzJLUBnlmcy8qeupg= MIME-Version: 1.0 Received: by 10.86.187.38 with SMTP id k38mr1471402fgf.5.1257095943600; Sun, 01 Nov 2009 09:19:03 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 12:19:03 -0500 Message-ID: <347397800911010919q738dbbeg8a2cdc066b2b2662@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Chris To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Nice, I have been waiting for this! :) I can't remember if I asked this before but at some point will LuaJIT be able to improve its recursive call speed? In this area LuaJIT seems to lag way behind VM's like Google's V8. It's pretty easy to see the difference when using benchmarks like Ackermann or Fibonacci where LuaJIT is about 4 times slower in my tests. CR From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:31:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1HVB7J018214; Sun, 1 Nov 2009 15:31:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAC661A691; Sun, 1 Nov 2009 15:29:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4DC7A1A65E for ; Sun, 1 Nov 2009 15:29:48 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4eGH-0004ZK-00; Sun, 01 Nov 2009 18:30:41 +0100 Date: Sun, 1 Nov 2009 18:30:35 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101173035.GA11825@mike.de> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AED8F44.3030809@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > I don't think I'm doing anything particularly stupid --- the docs say I > don't need to do anything particular to turn the JIT on, right? I can > just run a problem with luajit instead of lua and it'll work? Yes, definitely. > So assuming that I am working LuaJIT correctly there's something about > Clue's output that it's not getting on with. As Clue's Lua output is > mostly dead simple, my initial instinct is to blame the disgusting hack > I'm having to do to emulate gotos: > > local state = 0 > repeat > while true do > if state == 0 then end > if state == 1 then end > if ...etc.. end > if state == 99 then > > state = 42 break end -- transfer to basic block 42 > if ...etc... end > end > end > > Could this be upsetting the JIT? Well, yes, it's disgusting. :-) You are putting a loop around something which should be mostly linear control flow. And all of the branches inside are now much less predictable, too. Congratulations, you've managed to brew up the perfect nightmare for a trace compiler and a super-scalar CPU at the same time. ;-) > (I have had thoughts about using tail calls to do the transfer of > execution from one basic block to another, but I haven't come up with a > decent way of doing it without doing memory allocations on entry to each > function.) Dunno about these allocations. But tail calls are very fast with LJ2. The compiler turns them into an inlined goto, i.e. a no-op. > Here's a complete short function so you can see what it's actually emitting: Yikes. Can we come up with some nice isolated test case? E.g. something that can be scaled to run for 0.5-10 seconds and only does _one_ thing. Maybe translate one of the C shootout benchmarks? --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:32:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1HW2Uv018996; Sun, 1 Nov 2009 15:32:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A5801A69A; Sun, 1 Nov 2009 15:30:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 299971A65E for ; Sun, 1 Nov 2009 15:30:42 -0200 (BRST) Received: by ewy26 with SMTP id 26so4277473ewy.5 for ; Sun, 01 Nov 2009 09:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=khQSZJMkQS/hsp3u/cUkoakKFD1IKxVFt8g9sQFa1vk=; b=AEGX1imrBJ2NmcMQTU+pGyDi9FycQHuMshYGGm/WndhRtAT+2iWZWjPiYgP19vukS6 qX0re4IDGjYl7shyHbiLPSbIiikllttKekZP/RrJdKUDeBMcBwdi2GFr8ajKCDyrIUq+ kw4vaEaMzz30C8fAk6gYvyobtT7Qq4dC6SFTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TZvrNfa8uTG8ue17NRGB8EYGMRy2K4LHr18k/bKzCTKLTaf4XgtHKyhPlsew9ewIoY qX3xT7N/hx6PKtZbVLXZO4VkPWhbMGGNJW5RmqVdB8N3fwn0YRWzpFCab/dArwJUyhkY GAqA3girL552uA7kNc8x5CS3ZThA96u/A2oio= MIME-Version: 1.0 Received: by 10.216.91.5 with SMTP id g5mr3391807wef.168.1257096696258; Sun, 01 Nov 2009 09:31:36 -0800 (PST) In-Reply-To: <20091101161504.GA8498@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> <20091101161504.GA8498@mike.de> Date: Sun, 1 Nov 2009 18:31:34 +0100 Message-ID: <6d59dad30911010931r696b8372i8df5ed656b0583fb@mail.gmail.com> Subject: Re: Benchmark shootout shows LuaJIT 2.0 (was Re: [ANN] LuaJIT-2.0.0-beta1) From: Wim Couwenberg To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1HW2Uv018996 Mike, first of all: congratulations with your new release! It must have been a hell of a job. > The shootout site now shows LuaJIT 2: The pidigits benchmark is nagging me a bit, in particular i'm not sure if my "matrix optimizations" used in #5 are in fact optimizations when using lgmp. (I did those for a Lua only implementation.) For example, as shown here http://shootout.alioth.debian.org/u64q/benchmark.php?test=pidigits&lang=all version #7 is still faster and that one doesn't use the matrix trick. This is on x64, no JIT, but still i'm wondering why the difference... Bye, Wim > >  http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&d=data&gpp=on&java=on&luajit=on&v8=on&calc=calculate&box=1 > > As I've already said in a reddit comment: > >  Heh, it beats Intel Fortran on two numeric benchmarks (mandelbrot >  and spectralnorm). :-) > >  Only the hand-vectorized stuff in C and C++ is faster. Guess I >  need to add auto-vectorization. Well, maybe next week ... ;-) > > --Mike > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 15:32:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1HWSfp019065; Sun, 1 Nov 2009 15:32:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EEBE1A69F; Sun, 1 Nov 2009 15:30:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E3F11A65E for ; Sun, 1 Nov 2009 15:30:53 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 0DF9BB5ABF for ; Sun, 1 Nov 2009 12:31:49 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 01 Nov 2009 12:31:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=JuRIu+Prf3JJ6A4TV046lLS3RJU=; b=pVK3Xae5rAhGwm2P3TYvGFRSzp/xS7gTIHwMlGBIQoFBiZh6bFhQEFT1Blj3Ynh/Df3lCQE0sE7KhUMWwxsUFpSDyMNJZht0XHdqewz4nlWgoXRYnObUhRnuYMNq4fAyqtrTTQh/K6K7qPHdJcA2Zk+4CeH7SYWoFvRX+VBV/I8= X-Sasl-enc: SuNC4h+aAQ1NU4CURZ3y2IzV4N5jURziCYc1b2ABEiJ6 1257096708 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 9E6C549F654 for ; Sun, 1 Nov 2009 12:31:48 -0500 (EST) Date: Sun, 1 Nov 2009 12:32:18 -0500 From: Jim Pryor To: Lua list Subject: Re: Self-deleting weak tables? Message-ID: <20091101173218.GE11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20091031162319.GB11203@vaio.jimpryor.net> <45EB25AF-DA53-43D4-B2C8-D7E3B81CE507@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45EB25AF-DA53-43D4-B2C8-D7E3B81CE507@grubmah.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 01, 2009 at 08:33:17AM -0800, Mark Hamburg wrote: > If you can attach data to the cached objects, then build the cache > using fully weak tables and have the cached objects hold references > to the tables in the chain leading to them. Thanks Mark, this is a nice idea. I won't in general be able to rely on adding data to the cached objects. But maybe there's a way to do this with objects wrapping the cached objects? The problem is, if the cache's clients are just getting the cached objects, without their wrappers, and the wrapper is what holds the refs that keep the cache tables from being gc'd, what holds the refs to the wrappers? In your suggestion, the cached objects themselves hold those refs. Probably the best way to do something like this using wrappers is what I ended up posting last night. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 16:02:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1I2Xpf021802; Sun, 1 Nov 2009 16:02:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 790CD1886D; Sun, 1 Nov 2009 16:01:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00EFC18850 for ; Sun, 1 Nov 2009 16:01:06 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4eka-0004bo-00; Sun, 01 Nov 2009 19:02:00 +0100 Date: Sun, 1 Nov 2009 19:01:55 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101180155.GA12403@mike.de> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AED9390.4070002@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > I assume what you're using here are hand-translated versions of the > SciMark benchmarks to each of the various languages? Is it: > > http://luajit.org/download/scimark.lua > > ...? What about the C version? I'd be interested to run it through Clue > and see what happens. http://math.nist.gov/scimark2/download.html > Incidentally, I have tried to compare LuaJIT 2 with V8, but V8 doesn't > seem to want to build easily these days. Last time I tried it I recall > that it wasn't particularly fast compared to LuaJIT 1 anyway! http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=luajit&lang2=v8&box=1 Looks like V8 is only faster on the only recursive and allocation- heavy benchmark in there. And it's much slower on all others. Even LJ1 was often faster than V8. Also check the ranking here: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&box=1 1.00 C++ 1.02 C 1.62 Java steady state 1.86 Java 2.11 Fortran 2.32 ==> LuaJIT <== 2.56 C# Mono .... 9.77 JavaScript V8 .... 30.18 Ruby JRuby 34.22 JavaScript TraceMonkey 43.62 Ruby 44.45 Python 66.51 Perl Ok, kicking Fortran will be easy. Next victim: Java. > Anyway, it's very good to see this out, and it's impressively fast. It'd > be very interesting to try doing traditionally high-CPU tasks with > LuaJIT 2 and to see how well it works; I need to add auto-vectorization for that. Other than that, it's already a killer: someone just sent me a private mail where it outperformed Java on heavily numerical code (real use case, not a synthetic benchmark). > I work in the mobile phone > industry and it is *frightening* how shoddy the code tends to be. It'd > be really nice to move away from traditional languages like C and C++ > and towards scripting languages like Lua. > > Now I just have to wait for an ARM version... Well, waiting is not a good tactic. Collect requirements (desired number type, target architectures, VFP or not etc.), collect funding, gather people who'd like to work on it. In short: let me not drown in administrative stuff. I'm more efficient at designing/coding. [Sorry for the rant, please don't take it personally.] --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 16:20:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1IJwB4023344; Sun, 1 Nov 2009 16:19:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80EB41A672; Sun, 1 Nov 2009 16:18:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EE45188AA for ; Sun, 1 Nov 2009 16:18:36 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4f1Y-0004cs-00; Sun, 01 Nov 2009 19:19:32 +0100 Date: Sun, 1 Nov 2009 19:12:34 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101181234.GA13540@mike.de> References: <20091031225554.GA30341@mike.de> <347397800911010919q738dbbeg8a2cdc066b2b2662@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <347397800911010919q738dbbeg8a2cdc066b2b2662@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Chris wrote: > I can't remember if I asked this before but at some point will LuaJIT > be able to improve its recursive call speed? In this area LuaJIT > seems to lag way behind VM's like Google's V8. It's pretty easy to > see the difference when using benchmarks like Ackermann or Fibonacci > where LuaJIT is about 4 times slower in my tests. Yes, recursion is not compiled (yet). This is mentioned in the status page. [Note: tail-recursive calls *are* supported. They're fast, too.] Up-recursion is not too difficult. Some support code for counting hotcalls is already there. Down-recursion is much more difficult, but I already have some ideas for that. Still, recursion is, umm, 'unpopular' in Lua (outside of synthetic benchmarks). Other things have a higher priority on my list. [That, BTW, is what annoys me most about V8: their benchmarketing. They ported some quaint, recursive SmallTalk benchmarks to JavaScript, tuned their VM for it and now claim bragging rights. That roughly 0% of all JavaScript on the web makes use of recursion doesn't seem to bother them at all.] [Umm, before the functional programmers come to slaughter me: yes, recursion is a useful tool. But compiler optimization is not a beauty contest. Popularity of language idioms is what matters most.] --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 16:24:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1IOqrA023776; Sun, 1 Nov 2009 16:24:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAA6518A58; Sun, 1 Nov 2009 16:23:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D6D9188AA for ; Sun, 1 Nov 2009 16:23:33 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4f6K-0004dO-00; Sun, 01 Nov 2009 19:24:28 +0100 Date: Sun, 1 Nov 2009 19:24:24 +0100 From: Mike Pall To: Lua list Subject: Re: Benchmark shootout shows LuaJIT 2.0 (was Re: [ANN] LuaJIT-2.0.0-beta1) Message-ID: <20091101182424.GA14040@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> <20091101161504.GA8498@mike.de> <6d59dad30911010931r696b8372i8df5ed656b0583fb@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d59dad30911010931r696b8372i8df5ed656b0583fb@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Wim Couwenberg wrote: > The pidigits benchmark is nagging me a bit, in particular i'm not sure > if my "matrix optimizations" used in #5 are in fact optimizations when > using lgmp. (I did those for a Lua only implementation.) For > example, as shown here > > http://shootout.alioth.debian.org/u64q/benchmark.php?test=pidigits&lang=all > > version #7 is still faster and that one doesn't use the matrix trick. > This is on x64, no JIT, but still i'm wondering why the difference... Back when I looked at this I also wondered about some of the timings. Since the pidigits benchmark deteriorated into a GMP optimization festival, I'm not too worried about it anymore. After all it only spends something like 1% of its time in Lua. But to get the Lua/LuaJIT scores up, it would be nice to investigate what algorithmic changes the better performing GMP programs made and simply copy that. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 16:57:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Ivt8K027065; Sun, 1 Nov 2009 16:57:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E67141A67F; Sun, 1 Nov 2009 16:56:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A022718B15 for ; Sun, 1 Nov 2009 16:56:26 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4fc4-0008Io-8w for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 18:57:16 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id D2D9933F8 for ; Sun, 1 Nov 2009 18:57:15 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:37284 with envelope Message-ID: <4AEDDA08.7090506@cowlark.com> Date: Sun, 01 Nov 2009 18:57:12 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <20091101173035.GA11825@mike.de> In-Reply-To: <20091101173035.GA11825@mike.de> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1Ivt8K027065 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Pall wrote: [...] > Well, yes, it's disgusting. :-) You are putting a loop around > something which should be mostly linear control flow. And all of > the branches inside are now much less predictable, too. > > Congratulations, you've managed to brew up the perfect nightmare > for a trace compiler and a super-scalar CPU at the same time. ;-) Yes, well, that's what you get when you try to translate code written for a language that supports arbitrary bb graphs to a language that does *not* support arbitrary bb graphs... I remember that way back when you pointed me at some algorithms for converting a bb graph into a set of if...else...end, while...end etc constructs, but the problem appears not to be solvable in the general case. At this point the illustrious reader may wish to insert my standard rant on the evils of languages with no 'goto' (which I'm sure you've all heard before). [...] >> (I have had thoughts about using tail calls to do the transfer of >> execution from one basic block to another, but I haven't come up with a >> decent way of doing it without doing memory allocations on entry to each >> function.) > > Dunno about these allocations. But tail calls are very fast with > LJ2. The compiler turns them into an inlined goto, i.e. a no-op. In which case it's probably worth having another look at. Having actually put a couple of minutes thought into it I realise that I don't think I do need memory allocations at all. Each bb state transition would involve passing a huge pile of arguments: local function test_function(fp, stack, H0, H1, H2) local H3, H4, H5 -- do stuff here if H0 == 1 then return test_function_bb_3(fp, stack, H0, H1, H4) end if H0 == 2 then return test_function_bb_42(fp, stack, H4, H5, H1, H2) end return 94 end I'm assuming that all the argument passing would usually turn into no code in LuaJIT due to the way the trace compiler works. Alas, while sparse does support managing bbs this way (with distinct import, export and private registers in each bb), it's entirely undocumented, has a very clunky API, and is hugely bug-ridden. I don't fancy the archaeology required in figuring out how it all works. Plus, as Lua is oddly one of the few modern languages to support proper tail calls, I wouldn't be able to use the same code generator architecture for, say, Java. Anyone know a good C compiler framework I could use instead of sparse? [...] > Yikes. Can we come up with some nice isolated test case? E.g. > something that can be scaled to run for 0.5-10 seconds and only > does _one_ thing. Maybe translate one of the C shootout benchmarks? Actually, Clue uses some of the shootout benchmarks as unit tests. Results follow: time comparison factor clbg-binary-trees: gcc: 0.054 1.000 luajit: 3.919 72.543 luajit2: 2.110 39.063 lua: 4.363 80.763 clbg-mandelbrot: gcc: 0.249 1.000 luajit: 4.452 17.900 luajit2: 13.530 54.396 lua: 26.929 108.268 clbg-partialsums: gcc: 0.267 1.000 luajit: 0.722 2.705 luajit2: 1.673 6.267 lua: 3.270 12.246 clbg-fannkuch: gcc: 0.015 1.000 luajit: 0.347 22.670 luajit2: 0.704 45.906 lua: 2.062 134.563 clbg-recursive: gcc: 0.195 1.000 luajit: 1.335 6.848 luajit2: 5.679 29.133 lua: 8.008 41.076 clbg-n-body: gcc: 0.045 1.000 luajit: 0.705 15.682 luajit2: 1.706 37.944 lua: 3.315 73.712 clbg-nsieve: gcc: 0.133 1.000 luajit: 1.894 14.285 luajit2: 3.855 29.074 lua: 6.645 50.113 Huge great slab of code for the main nsieve function follows (note that pointers are stored as (offset, table) register pairs in Clue --- see the return from _malloc early on in the function): static_1743_0_nsieve = function(fp, stack, H0) local sp local H1 local H2 local H3 local H4 local H5 local H6 local H7 local H8 local H9 local H10 local state = 0; while true do repeat if state == 0 then sp = 0 sp = fp + sp H7 = _malloc H1, H2 = H7(sp, stack, H0) H3 = H1 H4 = H2 H7 = 1 H8 = _memset H9, H10 = H8(sp, stack, H3, H4, H7, H0) H6 = 0 H5 = 2 state = 1 break end if state == 1 then H7 = H5 < H0 and 1 or 0 if H7 ~= 0 then state = 3 else state = 7 end break end if state == 2 then H7 = 1 H8 = H5 + H7 H5 = H8 state = 1 break end if state == 3 then H7 = H1 + H5 H8 = H2[H7 + 0] if H8 ~= 0 then state = 4 else state = 2 end break end if state == 4 then H8 = 1 H9 = H6 + H8 H8 = 1 H10 = shl(H5, H8) H6 = H9 H7 = H10 state = 5 break end if state == 5 then H8 = H7 < H0 and 1 or 0 if H8 ~= 0 then state = 6 else state = 2 end break end if state == 6 then H8 = H1 + H7 H9 = 0 H2[H8 + 0] = H9 H8 = H7 + H5 H7 = H8 state = 5 break end if state == 7 then H1 = _free H1(sp, stack, H3, H4) H2 = static_1743_1_anon H1 = 1 H3 = _printf H4 = H3(sp, stack, H1, H2, H0, H6) do return end end until true end end - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7doIf9E0noFvlzgRAmp1AJ9BPlFSrvT6retLKjuffAaD5EzrlQCgpkfe 08Ma4A9drpwO01kyTOQIvHY= =Z+RJ -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:09:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1J97uY028049; Sun, 1 Nov 2009 17:09:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17CD1A697; Sun, 1 Nov 2009 17:07:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-09.prod.phx3.secureserver.net (p3plsmtpa01-09.prod.phx3.secureserver.net [72.167.82.89]) by bazar2.conectiva.com.br (Postfix) with SMTP id A94E21A672 for ; Sun, 1 Nov 2009 17:07:44 -0200 (BRST) Received: (qmail 709 invoked from network); 1 Nov 2009 19:08:38 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-09.prod.phx3.secureserver.net (72.167.82.89) with ESMTP; 01 Nov 2009 19:08:38 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Self-deleting weak tables? From: Mark Hamburg In-Reply-To: <20091101173218.GE11203@vaio.jimpryor.net> Date: Sun, 1 Nov 2009 11:08:37 -0800 Content-Transfer-Encoding: 7bit Message-Id: <149C1056-6C24-49F2-AA9B-504F966B1832@grubmah.com> References: <20091031162319.GB11203@vaio.jimpryor.net> <45EB25AF-DA53-43D4-B2C8-D7E3B81CE507@grubmah.com> <20091101173218.GE11203@vaio.jimpryor.net> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean For Lua-based objects note that you can add essentially arbitrary keys to the object. You can even keep these moderately private by using tables rather than strings as keys. The "moderate" part stems from the fact that you can discover them via iteration. In fact, as long as the objects aren't used with the pairs iterator (or next), it should generally be safe to add the extra fields. For userdata, you would need to add support for storing arbitrary references presumably using the environment table. But the key point is that so long as the objects don't need to be iterable, it actually isn't all that hard to store extra links into them. Mark ----- -- WARNING: Untested. Not even compiled. local kLevel1Key = { } local kLevel2Key = { } -- cacheRoot auto constructs the succeeding levels -- Base tables will simply be fully weak local kFullyWeak = { __mode = 'kv' } local function makeBase() return setmetatable( {}, kFullyWeak ) end -- Given a constructor function, we want an __index function that runs the constructor and -- stores the result. local function makeConstructingIndex( constructor ) return function( t, k ) local v = constructor() t[ k ] = v return v end end -- Given a constructor function, we want a metatable for tables that auto-populate. local function makeConstructingMetatable( constructor ) return { __mode = 'kv', _index = makeConstructingIndex( constructor ) } end -- Given the constructor for the next level in the cache, create a constructor for this level. local function makeConstructor( nextLevelConstructor ) local mt = makeConstructingMetatable( nextLevelConstructor ) return function() return setmetatable( {}, mt ) end end -- For a three level cache, we do one round of wrapping local cacheRoot = setmetatable( { }, makeConstructingMetatable( -- Constructs first level makeConstructor( -- Constructs second level makeBase ) ) ) -- Constructs leaves function storeCachedObject( object, key1, key ) local t1 = cacheRoot[ key1 ] local t2 = t1[ key2 ] t2[ key3 ] = object object[ kLevel1Key ] = t1 object[ kLevel2Key ] = t2 return object end -- BONUS POINTS: The cache could actually auto construct the object but then it needs to have back links to -- find the path through the cache. This could be done using private links in the cache tables. If doing that, -- we might try to arrange for a strong back chain via an extra level of indirection in the cache tables. Logic -- to do so not evaluated here. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:15:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JFOJx028653; Sun, 1 Nov 2009 17:15:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CCE01A69A; Sun, 1 Nov 2009 17:13:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AA131A672 for ; Sun, 1 Nov 2009 17:13:54 -0200 (BRST) Received: by bwz27 with SMTP id 27so5520099bwz.21 for ; Sun, 01 Nov 2009 11:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7C4QALH9MwAbDpZ2wW1+j5NW6YlIDIjSfsWaYB6DX5A=; b=P2zbXPJgQ2ZwomGG92uwFq8drfox+G7Ab7LqYKZ9jUyuTp6xKR2oeP7uFgnGHkp6rJ WArZmv7ibYLH6jL7M4hCtbqD1CgDQJQZE70rVHhvMKXYibS8nw7bqzY7xrfyvxLIuOsT apeNLZqYQR3E3A7nhYK4AMHXcsD9TgGncWHoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HkETtjqVYneqY+0K7EckH00JFGffEi6YzSqjdf+sL5DouqCEIQVrHRlKq3RU2rKDF8 J9nlV6ZM6+IrwL4nM1lN4Ot2oxy7UdHZ4OwA/OYT576kBhILofg/+muNOE4x3Q1ABvba gk2iPZksPD0zkran6NRPDko8oEb5Y/qQn0rpY= MIME-Version: 1.0 Received: by 10.223.3.6 with SMTP id 6mr635680fal.21.1257102889428; Sun, 01 Nov 2009 11:14:49 -0800 (PST) In-Reply-To: <4AEDDA08.7090506@cowlark.com> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <20091101173035.GA11825@mike.de> <4AEDDA08.7090506@cowlark.com> Date: Sun, 1 Nov 2009 19:14:49 +0000 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 1, 2009 at 6:57 PM, David Given wrote: > [...] >>> (I have had thoughts about using tail calls to do the transfer of >>> execution from one basic block to another, but I haven't come up with a >>> decent way of doing it without doing memory allocations on entry to each >>> function.) >> >> Dunno about these allocations. But tail calls are very fast with >> LJ2. The compiler turns them into an inlined goto, i.e. a no-op. > > In which case it's probably worth having another look at. Having > actually put a couple of minutes thought into it I realise that I don't > think I do need memory allocations at all. Each bb state transition > would involve passing a huge pile of arguments: Are you sure you need any arguments? It seems like you could use upvalues external to all your state functions, instead. For example, doing a blind-rewrite your nsieve example from later in your post: -- code begin local fp, stack, sp local H0, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10 local state_0, state_1, state_3, state_4, state_5, state_6, state_7 fp, stack, H0 = ... state_0 = function() sp = 0 sp = fp + sp H7 = _malloc H1, H2 = H7(sp, stack, H0) H3 = H1 H4 = H2 H7 = 1 H8 = _memset H9, H10 = H8(sp, stack, H3, H4, H7, H0) H6 = 0 H5 = 2 return state_1() end state_1 = function() H7 = H5 < H0 and 1 or 0 if H7 ~= 0 then return state_3() else return state_7() end end state_2 = function() H7 = 1 H8 = H5 + H7 H5 = H8 return state_1() end state_3 = function() H7 = H1 + H5 H8 = H2[H7 + 0] if H8 ~= 0 then return state_4(); else return state_2(); end end state_4 = function() H8 = 1 H9 = H6 + H8 H8 = 1 H10 = shl(H5, H8) H6 = H9 H7 = H10 return state_5() end state_5 = function() H8 = H7 < H0 and 1 or 0 if H8 ~= 0 then return state_6() else return state_2() end end state_6 = function() H8 = H1 + H7 H9 = 0 H2[H8 + 0] = H9 H8 = H7 + H5 H7 = H8 return state_5() end state_7 = function() H1 = _free H1(sp, stack, H3, H4) H2 = static_1743_1_anon H1 = 1 H3 = _printf H4 = H3(sp, stack, H1, H2, H0, H6) end return state_0() -- code end ...as I say, I wrote this "blind", I have not tried actually running it. But it seems like something like it should do what you want. -Duncan From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:16:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JGXHl028799; Sun, 1 Nov 2009 17:16:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABD631A69E; Sun, 1 Nov 2009 17:15:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from a.painless.aaisp.net.uk (a.painless.aaisp.net.uk [81.187.30.51]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 677B71A672 for ; Sun, 1 Nov 2009 17:15:13 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by a.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4fuF-0000e5-Ur for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 19:16:04 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id A028B5029 for ; Sun, 1 Nov 2009 19:16:03 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:45529 with envelope Message-ID: <4AEDDE71.7060506@cowlark.com> Date: Sun, 01 Nov 2009 19:16:01 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> <20091101180155.GA12403@mike.de> In-Reply-To: <20091101180155.GA12403@mike.de> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1JGXHl028799 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Pall wrote: [...] > http://math.nist.gov/scimark2/download.html Ta, I'll give it a try. [...] > http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=luajit&lang2=v8&box=1 > > Looks like V8 is only faster on the only recursive and allocation- > heavy benchmark in there. And it's much slower on all others. > Even LJ1 was often faster than V8. Of course, the Shootout uses hand-translated code. I'd be interested to compare using machine-translated code, using the same algorithm in each language. (I'm well aware that I'm not working in the real world here.) [...] > 2.11 Fortran > 2.32 ==> LuaJIT <== > 2.56 C# Mono May I say that that is awesome? [...] > Collect requirements (desired number type, target architectures, > VFP or not etc.), collect funding, gather people who'd like to > work on it. In short: let me not drown in administrative stuff. > I'm more efficient at designing/coding. > > [Sorry for the rant, please don't take it personally.] Oh, I'm well aware that it would be a lot of work! And I don't expect you to drop what you're doing and do one. I'm willing to let you rest for a few weeks before producing the next miracle... Actually, I'd be quite willing to have a look at it myself (after waiting for the codebase to stabilise), but I suspect I won't have the opportunity; I have a feeling that other people with more money than I are going to be eyeing LuaJIT and ARM and rubbing their hands together. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7d5xf9E0noFvlzgRAozbAJwKTzzqU+NjjhXPskyveEhT1ON+dwCfb5Y1 HpzUh7XCcTrKi056H9ruNxU= =tqJf -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:21:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JLXmt029225; Sun, 1 Nov 2009 17:21:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 951CA1A693; Sun, 1 Nov 2009 17:20:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B7FC1A666 for ; Sun, 1 Nov 2009 17:20:14 -0200 (BRST) MailScanner-NULL-Check: 1257708065.71769@Vm5Lxe8t1VQISOBEq00A7g Received: from [192.168.1.101] (r190-135-188-230.dialup.adsl.anteldata.net.uy [190.135.188.230]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA1JL1Df006249 for ; Sun, 1 Nov 2009 17:21:02 -0200 Message-ID: <4AEDDF8A.3050203@inconcertcc.com> Date: Sun, 01 Nov 2009 17:20:42 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Issues with Lunar while using multiple lunar templated objects. References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> <4AEB5B61.2010100@inconcertcc.com> <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> <7fa0608b0910301636x5a2984c7g544b2733af99d3c9@mail.gmail.com> In-Reply-To: <7fa0608b0910301636x5a2984c7g544b2733af99d3c9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sivan Thiruvengadam wrote: > I changed the method as you suggested > CLObject :*GetListofNumbers*(lua_State *L)// > { > > * > CLNumList*o = new CLNumList(L); > CLNL*ud = static_cast< CLNL*>(lua_newuserdata(L, sizeof(CLNumList))); > // create new userdata > real_object->GetListofNumbers(*o->real_object); //CLObject > ud->pT = o; > // lua_pushlightuserdata(L, ud); > // luaL_getmetatable(L, NUMLIST ); > // lua_setmetatable(L, -2); > > * > *CLNumList::push(L, o);* > *return 1;* > *}* > > i am receiving this > > error C2039: 'push' : is not a member of 'CLNumList' Are you sure you're using Lunar ? Lunar adds two methods, call and push, that I think were not present in Luna, and parts of your code suggests you're using Luna instead of Lunar. Things like this: static Luna< CLObject >::RegType methods[]; The example at http://lua-users.org/wiki/CppBindingWithLunar says: static Lunar::RegType methods[]; From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:22:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JM9Iu029314; Sun, 1 Nov 2009 17:22:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1C6D1A69B; Sun, 1 Nov 2009 17:20:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 114011A666 for ; Sun, 1 Nov 2009 17:20:49 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N4fzj-0001BU-A1 for lua@bazar2.conectiva.com.br; Sun, 01 Nov 2009 19:21:43 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id D86316147 for ; Sun, 1 Nov 2009 19:21:40 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:59544 with envelope Message-ID: <4AEDDFC2.6020807@cowlark.com> Date: Sun, 01 Nov 2009 19:21:38 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <20091101173035.GA11825@mike.de> <4AEDDA08.7090506@cowlark.com> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1JM9Iu029314 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Duncan Cross wrote: [...] > Are you sure you need any arguments? It seems like you could use > upvalues external to all your state functions, instead. For example, > doing a blind-rewrite your nsieve example from later in your post: That was my initial plan (the one that made me groan and give up on it). The problem with this approach is that in order to allow my translated C functions to be reentrant, all the upvalues need to be unique to a particular invocation of the function. In other words, take your example, and wrap a function around it... so that when the C function is called, all the closures are created and then state_0 run. Passing lots of arguments around means that we don't have to create (and then discard) lots of closures every time we call a C function. This would only work if argument passing was efficient, of course. Bear in mind, though, that I've been thinking about this for all of ten minutes now and there's likely to be something I'm missing. I haven't done anything on Clue for ages. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK7d/Cf9E0noFvlzgRAiLiAKDXcJstLxpLID0MRkbFvnrTKmca/ACgsAar E2Z9Jq/3RbXzKVrlPfVdtkI= =smz0 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:25:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JPcQB029644; Sun, 1 Nov 2009 17:25:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9AC1A1A697; Sun, 1 Nov 2009 17:24:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 798ED1A666 for ; Sun, 1 Nov 2009 17:24:19 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4g39-0004ge-00; Sun, 01 Nov 2009 20:25:15 +0100 Date: Sun, 1 Nov 2009 20:17:32 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101191732.GA15770@mike.de> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <20091101173035.GA11825@mike.de> <4AEDDA08.7090506@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEDDA08.7090506@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > At this point the illustrious reader may wish to insert my standard rant > on the evils of languages with no 'goto' (which I'm sure you've all > heard before). Actually LJ2 makes extensive use of the fact that Lua doesn't have a goto. This enables the use of a new region-selection algorithm, which I termed NLF (natural-loop-first). IMHO it outperforms NET (next-executed tail) and LEI (last-executed iteration) which has previously been used for trace compilers. ObRef: Improving region selection in dynamic optimization systems, D. Hiniker, Intl. Symp. on Microarchitecture, 2005 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.102.9615 > I'm assuming that all the argument passing would usually turn into no > code in LuaJIT due to the way the trace compiler works. Yes. > Actually, Clue uses some of the shootout benchmarks as unit tests. > Results follow: Since others may be misinterpreting this: these are the results for a C->Lua translation (and, as we have discussed, a rather suboptimal one). The native Lua variants of these benchmarks run *much* faster. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:26:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JQcxE029761; Sun, 1 Nov 2009 17:26:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0549A1A6A0; Sun, 1 Nov 2009 17:25:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 555ED1A666 for ; Sun, 1 Nov 2009 17:25:20 -0200 (BRST) MailScanner-NULL-Check: 1257708377.33907@zmrib2uOoDsY+cx1/xhmbg Received: from [192.168.1.101] (r190-135-188-230.dialup.adsl.anteldata.net.uy [190.135.188.230]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA1JQG6t007797 for ; Sun, 1 Nov 2009 17:26:16 -0200 Message-ID: <4AEDE0C4.70901@inconcertcc.com> Date: Sun, 01 Nov 2009 17:25:56 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Issues with Lunar while using multiple lunar templated objects. References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> <4AEB5B61.2010100@inconcertcc.com> <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> In-Reply-To: <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sivan Thiruvengadam wrote: > Thanks. > > Let me change this by pushing the object as you suggest and see if > things work as expected. > > BTW, I always hit the else part of the CLNumList constructor, since i am > not passing any CLNumList instance from LUA. > Yep, I forgot that Lunar removes 'self'. // member function dispatcher static int thunk(lua_State *L) { // stack has userdata, followed by method args T *obj = check(L, 1); // get 'self', or if you prefer, 'this' ---> lua_remove(L, 1); // remove self so member function args start at index 1 // get member function from upvalue RegType *l = static_cast(lua_touserdata(L, lua_upvalueindex(1))); return (obj->*(l->mfunc))(L); // call member function } From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:42:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Jg6Ce031880; Sun, 1 Nov 2009 17:42:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFFB21A691; Sun, 1 Nov 2009 17:40:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3BE91A65E for ; Sun, 1 Nov 2009 17:40:40 -0200 (BRST) Received: by pwj9 with SMTP id 9so1482269pwj.21 for ; Sun, 01 Nov 2009 11:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8pjqBpHDiVfhcDRGJtCFLIJEi7bIxpMsk6n9ZwMYuKA=; b=afqNfqEFUCE9JbssnyRMyzumVKxdVuoQ+5navyLBerVikkPRuVrBGo7G9Vh1JOVRB+ 0zgRCfSOQ6CAgYrw6eo8uDyHX/n8Y5C9PpWQFBSKTPcLzy4vyQ5sNJlnIVO0CoqhLGW+ j3B7/jKrVXLpJQRrRDarmP7ZL0d/4P+MtS5o8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AhR3MpCtbR+rk9ZEwXjXGvYYHs5Vp/8oMNFU7z0EPe4WWjEHuDE06Q4jhVqvAI2RNe U7bf5PIPpJRol8r0IXkGTEiX9p/kC88V/YbdLTMxDW4ehwLHCrVa6h7H5k1I9k7UMinY tMDmKQW53eKtbSn7pp4kxak6jIlN1/QTnBfS8= MIME-Version: 1.0 Received: by 10.140.136.19 with SMTP id j19mr200905rvd.187.1257104494749; Sun, 01 Nov 2009 11:41:34 -0800 (PST) In-Reply-To: <20091031225554.GA30341@mike.de> References: <20091031225554.GA30341@mike.de> Date: Sun, 1 Nov 2009 22:41:34 +0300 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 1, 2009 at 01:59, Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > Yes, here it is: the first public release of LuaJIT 2.0! Mike, congratulations on the release! All this time since your roadmap announce we held our breaths for the LuaJIT 2.0. Now, when it is almost here, and we all see that it is, at least, as great as was promised... I'm saying: life with Lua just became brighter than ever! Kudos for the great work! Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 17:47:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1JlsYp032485; Sun, 1 Nov 2009 17:47:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96A7E1A69F; Sun, 1 Nov 2009 17:46:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D7F41A67F for ; Sun, 1 Nov 2009 17:46:33 -0200 (BRST) Received: by pxi2 with SMTP id 2so2917079pxi.11 for ; Sun, 01 Nov 2009 11:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BP96GY/TCOMhypYblQtBB7ny6Vy804DNXZXO6IXVsbY=; b=Ud9QM4zoRW96dBlrZMTFVhRcGhdA3N3f7/2ON50k+dyvEkj5s7WYJYtl9IMClSVZDl 9YM/58DcXFmGiFnJqcJqia0hs2WaT0SifIkWp5FQw5szkmkW698v4MeS4AWlerVt/RLw 7u2ULJf63E/moRm9uv+5V4spyX+StHJqhAa/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iNg+bM7PII88Tby7e1TvnJsQrevjrk5CcONA/5uw/nTXHaKPBpCmflGeno6LnTHWCr 25EnC8JJmFkd+GYWl9gdoZDhO+Yt6ADvJSIrFGAnggNX3oAywk7jOIR1LZPT2bavnrfm /mly31NHsV1vu1aZ3ie2SDiBD7Zc5j3RSwEnY= MIME-Version: 1.0 Received: by 10.140.194.12 with SMTP id r12mr204595rvf.65.1257104849291; Sun, 01 Nov 2009 11:47:29 -0800 (PST) In-Reply-To: <20091101160610.GA7245@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> Date: Sun, 1 Nov 2009 22:47:29 +0300 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I have a profiler on the backburner. Gives output like this > (speed test of binary heap): <...> > Not sure whether there is enough interest in the profiler. Maybe > that's also something for a commercial add-on, to aid in financing > the project. I'm interested in the profiler. Does not have enough information on whether it would justify to be a commercial tool, but it surely looks like a tool I'd like to use when I'm tuning performance of Lua code for LJ2. Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 18:42:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1KgEe7004929; Sun, 1 Nov 2009 18:42:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B01F31A65B; Sun, 1 Nov 2009 18:40:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11EC81A65B for ; Sun, 1 Nov 2009 18:40:48 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4hF7-0004jw-00; Sun, 01 Nov 2009 21:41:41 +0100 Date: Sun, 1 Nov 2009 21:41:34 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101204134.GA21085@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > I'm interested in the profiler. > > Does not have enough information on whether it would justify to be a > commercial tool, but it surely looks like a tool I'd like to use when > I'm tuning performance of Lua code for LJ2. The raw information is already there. Sampling it fast enough with minimal overhead is a bit tricky, but I mostly solved that. The real challenge is to make a nice GUI around it (like Shark) and to package it and market it and sell it ... gaah, no fun. Here's the visualization of SciMark: http://luajit.org/temp/vmprof_scimark.png [Zoom in with an image viewer, not with a browser.] Of course it's all green, because it compiles well. The little blue/red blotches are where the JIT compiler jumps in (i.e. very low overhead). The five phases (different sub-benchmarks) are clearly visible and it's easy to see how branchy they are. One could make a tool where you move over it with a mouse and it pinpoints the source location in a window next to it. But I don't like writing GUIs (anymore). Someone up to it? --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 18:49:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1KniLo005683; Sun, 1 Nov 2009 18:49:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B594D18644; Sun, 1 Nov 2009 18:48:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 780FE185D7 for ; Sun, 1 Nov 2009 18:48:24 -0200 (BRST) Received: by bwz27 with SMTP id 27so5593399bwz.21 for ; Sun, 01 Nov 2009 12:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=nUZbz++bzcZ90Zh9Hiz8+38dIFWTkzS+6Zd95AGvKEM=; b=RD7Ydc6PavUR03sF/qcqH87RFQK42JJSxgeAYSAMAI137Nk1gMtAy5kCq9T0ys9abn jUNrM4L5byU1VrSsSVme7eB9ojGjJMpFEbUgDfh+F7BXSHWJnT8Qp4RwM1qYb2+k8fVj BBu7rQ6feU0Va9hmELbl4HL3M9NyVzTjLMu58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HkrBNmCwIwdNWq2EzT9gD8BAl8wgelEuN8eviKbV1o72+nCbHWTX0BxIdfcwl1YvEr FTYnyu9/SVV/JRFG5rfhing9flBQIBMKuCvdU2FkNre1YLvUB+mGz34RRkdWu5QJ7P8/ MTvEieItJ/W6N+zQ3yy7vS5jy2wi+scTq7Kq0= MIME-Version: 1.0 Received: by 10.204.34.73 with SMTP id k9mr3334382bkd.45.1257108559356; Sun, 01 Nov 2009 12:49:19 -0800 (PST) Date: Sun, 1 Nov 2009 15:49:19 -0500 Message-ID: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> Subject: LUA_ERRSYNTAX with luaL_dofile From: cynthia powers To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000325559e261fe37d04775565d4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000325559e261fe37d04775565d4 Content-Type: text/plain; charset=ISO-8859-1 Hi, I am very new to lua. and I am trying a c-calling-lua setup. I get an error : status = 3(LUA_ERRSYNTAX) to the luaL_dofile call below. WHat am I doing wrong? Any help is appreciated. int run_lua_block () { lua_State *L; L = lua_open(); openlualibs(L); registerMyFunction (L); lua_settop (L,0); int status = luaL_dofile (L, "myfile.lua"); lua_close(L); return status; } Thanks cynthia. --000325559e261fe37d04775565d4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
=A0
I am very new to lua. and I am trying a c-calling-lua setup. I get an = error : status =3D 3(LUA_ERRSYNTAX) to the luaL_dofile call=A0below. WHat a= m I doing wrong? Any help is appreciated.
=A0
int run_lua_block ()
{
=A0=A0=A0 lua_State *L;
=A0=A0=A0 L = =3D lua_open();
=A0=A0=A0 openlualibs(L);
=A0=A0=A0 registerMyFunctio= n (L);
=A0=A0=A0 lua_settop (L,0);
=A0=A0=A0 int status =3D luaL_dofi= le (L, "myfile.lua");
=A0=A0=A0 lua_close(L);
=A0=A0=A0 return status;
}
=A0
=A0
Thanks
cynthia.
--000325559e261fe37d04775565d4-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 18:51:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1KpJvd005886; Sun, 1 Nov 2009 18:51:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 136281A65E; Sun, 1 Nov 2009 18:50:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s34.bay0.hotmail.com (bay0-omc3-s34.bay0.hotmail.com [65.54.246.234]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2F1B18658 for ; Sun, 1 Nov 2009 18:50:03 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s34.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 1 Nov 2009 12:50:57 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sun, 1 Nov 2009 20:50:50 +0000 Message-ID: <4AEDF4A7.5000506@my.erau.edu> Date: Sun, 1 Nov 2009 15:50:47 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LUA_ERRSYNTAX with luaL_dofile References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> In-Reply-To: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Nov 2009 20:50:57.0343 (UTC) FILETIME=[02E4E4F0:01CA5B35] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean cynthia powers wrote: > Hi, > > I am very new to lua. and I am trying a c-calling-lua setup. I get an error > : status = 3(LUA_ERRSYNTAX) to the luaL_dofile call below. WHat am I doing > wrong? Any help is appreciated. > > int run_lua_block () > { > lua_State *L; > L = lua_open(); > openlualibs(L); > registerMyFunction (L); > lua_settop (L,0); > int status = luaL_dofile (L, "myfile.lua"); > lua_close(L); > return status; > } > > > Thanks > cynthia. > Your myfile.lua has a syntax error? ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 19:02:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1L20sl007001; Sun, 1 Nov 2009 19:02:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F08141A66C; Sun, 1 Nov 2009 19:00:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 795E6186E8 for ; Sun, 1 Nov 2009 19:00:41 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4hYP-0004lR-00; Sun, 01 Nov 2009 22:01:37 +0100 Date: Sun, 1 Nov 2009 22:01:28 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091101210128.GA22817@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Steven Johnson wrote: > I'm running into some issue with module() and / or environments. The > attached file is a dump of the package > table, just before an error gets thrown: "attempt to index global > 'widgetops' (a nil value)". I'm a bit stumped on that one ... does it work with the pure interpreter (-j off)? Anyway, I'd probably need a lot more context to analyze this. Maybe you could try to reduce this to a minimal test case? > Any ideas? What seems most odd to me is the change from before to > after the luaL_register()... Since this is a mix of Lua and C: have you checked that all your luaL_check*() and luaL_opt*() calls do *not* use negative indexes? Because that's an incompatibility in beta1 (patch posted to the list). --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 19:28:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1LSETW009278; Sun, 1 Nov 2009 19:28:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4C3E1A691; Sun, 1 Nov 2009 19:26:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 126ED1A65B for ; Sun, 1 Nov 2009 19:26:46 -0200 (BRST) Received: by bwz27 with SMTP id 27so5622577bwz.21 for ; Sun, 01 Nov 2009 13:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LZvHbI1L8i3iMCJZ+tZBYzCfAHtyJvY6/28oyKJSm24=; b=C2VNHhScuwDdrRGtrv/1MDOVHWsFiJsvr2zcCkHROt5V76nd3k7caGFMzvqQ/Hg9Li bN6qSQ0vs7w9cFH+FjPdlzm+J4N+TbunTddov6+uvHBv+W1SueNU3/6OaUyjk48w4pru EwnyK1SWjPHR0i2LBHhEiNgk7gypTjUO5OzGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=M0QASD4Hhkix1XH4Y7Ao1/YrK1rNXd7oceEjc9FCZrCz8ThYpBRTee3PuEqkKMRPva CH7ZeTqH0wu+HL+jWT6GYTErUxfMfIXg2lKzFOCzEcn4cS2nczbZVGkAnzM3TVQ7ERtW d599H1v++Cc/XrSlv4KtoXQCn8nytN0DZ2m1A= MIME-Version: 1.0 Received: by 10.204.151.209 with SMTP id d17mr431797bkw.120.1257110860759; Sun, 01 Nov 2009 13:27:40 -0800 (PST) In-Reply-To: <4AEDF4A7.5000506@my.erau.edu> References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> <4AEDF4A7.5000506@my.erau.edu> Date: Sun, 1 Nov 2009 16:27:40 -0500 Message-ID: <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> Subject: Re: LUA_ERRSYNTAX with luaL_dofile From: cynthia powers To: Lua list Content-Type: multipart/alternative; boundary=0015175d67ec4c8438047755ee45 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015175d67ec4c8438047755ee45 Content-Type: text/plain; charset=ISO-8859-1 yes. Thanks! it does appear that my myfile.lua has a syntax error, because when I replaced that file with another simpler lua file, it seems to go through. Is there a way to (auto) check on the syntax of a lua file? the lua file I have is "generated" .. cynthia. On Sun, Nov 1, 2009 at 3:50 PM, Matthew P. Del Buono wrote: > cynthia powers wrote: > > Hi, > > > > I am very new to lua. and I am trying a c-calling-lua setup. I get an > error > > : status = 3(LUA_ERRSYNTAX) to the luaL_dofile call below. WHat am I > doing > > wrong? Any help is appreciated. > > > > int run_lua_block () > > { > > lua_State *L; > > L = lua_open(); > > openlualibs(L); > > registerMyFunction (L); > > lua_settop (L,0); > > int status = luaL_dofile (L, "myfile.lua"); > > lua_close(L); > > return status; > > } > > > > > > Thanks > > cynthia. > > > Your myfile.lua has a syntax error? > > ====== > > Matthew P. Del Buono > --0015175d67ec4c8438047755ee45 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
yes. Thanks! it does appear that my myfile.lua has a syntax error, bec= ause when I replaced that file with another simpler lua file, it seems to g= o through.
Is there a way to (auto) check on the syntax of a lua file? the lua fi= le I have is "generated" ..
=A0
cynthia.
On Sun, Nov 1, 2009 at 3:50 PM, Matthew P. Del B= uono <delbu9c1= @my.erau.edu> wrote:
cynthia powers wrote:
> Hi,
>
> I am ve= ry new to lua. and I am trying a c-calling-lua setup. I get an error
>= ; : status =3D 3(LUA_ERRSYNTAX) to the luaL_dofile call below. WHat am I do= ing
> wrong? Any help is appreciated.
>
> int run_lua_block ()> {
> =A0 =A0 lua_State *L;
> =A0 =A0 L =3D lua_open();> =A0 =A0 openlualibs(L);
> =A0 =A0 registerMyFunction (L);
&g= t; =A0 =A0 lua_settop (L,0);
> =A0 =A0 int status =3D luaL_dofile (L, "myfile.lua");
>= ; =A0 =A0 lua_close(L);
> =A0 =A0 return status;
> }
>>
> Thanks
> cynthia.
>
Your myfile.lu= a has a syntax error?

=3D=3D=3D=3D=3D=3D

Matthew P. Del Buono<= br>

--0015175d67ec4c8438047755ee45-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 19:37:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1Lb2kv010706; Sun, 1 Nov 2009 19:37:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D44B91A69A; Sun, 1 Nov 2009 19:35:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s66.bay0.hotmail.com (bay0-omc3-s66.bay0.hotmail.com [65.54.246.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A760C1A672 for ; Sun, 1 Nov 2009 19:35:42 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s66.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 1 Nov 2009 13:36:33 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sun, 1 Nov 2009 21:36:32 +0000 Message-ID: <4AEDFF5F.2010501@my.erau.edu> Date: Sun, 1 Nov 2009 16:36:31 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LUA_ERRSYNTAX with luaL_dofile References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> <4AEDF4A7.5000506@my.erau.edu> <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> In-Reply-To: <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Nov 2009 21:36:34.0111 (UTC) FILETIME=[62228CF0:01CA5B3B] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean cynthia powers wrote: > yes. Thanks! it does appear that my myfile.lua has a syntax error, because > when I replaced that file with another simpler lua file, it seems to go > through. > Is there a way to (auto) check on the syntax of a lua file? the lua file I > have is "generated" .. > > cynthia. Please don't top-post. You can either check the syntax of your file by calling luaL_loadfile and checking the result to ensure it's 0, or you can run luac on the file and look for a non-zero return code. Regards, -- Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 20:18:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1MIuox014772; Sun, 1 Nov 2009 20:18:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65B2C1A69B; Sun, 1 Nov 2009 20:17:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BEFE1A65B for ; Sun, 1 Nov 2009 20:17:29 -0200 (BRST) Received: by bwz27 with SMTP id 27so5659856bwz.21 for ; Sun, 01 Nov 2009 14:18:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.24.71 with SMTP id u7mr3420253bkb.35.1257113902950; Sun, 01 Nov 2009 14:18:22 -0800 (PST) In-Reply-To: <20091101164450.GA9366@mike.de> References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> Date: Sun, 1 Nov 2009 23:18:22 +0100 X-Google-Sender-Auth: ce7792842b65bb19 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: =?ISO-8859-1?Q?Fran=E7ois_Perrad?= To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1MIuox014772 2009/11/1 Mike Pall : > François Perrad wrote: >> 1) numeric for with step = 0 causes infinite loop >>     $ luajit -e 'for i = 5, 7, 0 do end' > > This is testing implementation-defined behavior, i.e. you'll get > undefined results. Should 'for i=a,b,0' run upwards or downwards? > And what about 'for i=a,b,-0'? > > LJ2 chooses to look at the sign bit and runs downwards it it's > set. Lua runs upwards if 0 < step. Now, please don't ask what > happens if step is NaN. :-) > Nobody writes a for loop with direct 0. The step could be the return of a function. So, I prefer the Lua choice which prevents a infinite loop when a positive increment is excepted. But 'for i = 7, 5, 0' is a infinite loop with Lua. >> 2) losing arguments with metamethod __call >>     m = {} >>     setmetatable(m, { >>         __call = function (obj, ...) >>                      print('m.__call ' .. tostring(obj) .. ', ' .. >> table.concat(arg, ', ')) >>                  end >>     }) >>     m() >>     m(1, 2) --> arguments are lost > > 'arg' is a Lua 5.0 feature. Not supported. Use {...}. > >> and some new minor issues or delta : >> 1) getfenv(-3) gives a more general message : >>     bad argument #1 to 'getfenv' (invalid level) >> instead of >>     bad argument #1 to 'getfenv' (level must be non-negative) >> same issue with setfenv(). > > Intentional change. The common error message is precise enough. > >> 2) tostring of C function >>     $ luajit -e 'print(tostring(print))' >>     function: fast#29 >> when lua gives : >>     function: 0x9a5d020 > > The exact format of of a tostring'ized object is implementation- > defined. Giving more information (since it's there) is intentional. > >> 3) xpcall without error handler >>     $ luajit -e 'print(xpcall(assert, nil))' >>     luajit: (command line):1: bad argument #2 to 'xpcall' (function >> expected, got nil) >> instead of : >>     false     error in error handling > > I'm testing that the error handler is a function. This is > apparently missing in the Lua codebase and it's erroring out > later (which is not useful). File a bug against Lua. > Another suspect behavior is flush() with a closed file f : f:flush() throws the expected error io.flush(f) doesn't >> 4) table.maxn >>     $ luajit -e 't = {3,4}; print(table.maxn(t))' >>     1 >> instead of : >>     2 > > Definitely a bug. Patch attached. Thank you! > >> 5) deprecated table.setn >>     $ luajit -e 'table.setn({},7)' >>     luajit: (command line):1: attempt to call field 'setn' (a nil value) >> instead of : >>     lua: (command line):1: 'setn' is obsolete > > Intentional. > >> 6) math.random with extra arguments >>     $ luajit -e 'print(math.random(1, 2, 3))' >>     2 >> instead of : >>     lua: (command line):1: wrong number of arguments > > Intentional. None of the other library functions care when more > arguments than necessary are passed. > Another exception is table.insert(). I'll update my test suite. François > Thanks for helping with testing! > > --Mike > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 20:21:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1MLZui015032; Sun, 1 Nov 2009 20:21:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86C171A6A1; Sun, 1 Nov 2009 20:20:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9568C1A65B for ; Sun, 1 Nov 2009 20:20:14 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so613141fgg.17 for ; Sun, 01 Nov 2009 14:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=zMj3VxjCWqk36k6dQGtAzcjwEfCNHUamVB4bjZZ9Mjo=; b=sld7aeG2g0eU3WM8My8Qt12gJk/NT+/mq8DRs32hAxJz7hZaCLtJq6FVJCXZghunrZ rKVdCizCnklOdnybYU/FvAl+Jg0L0fQMKoDKPde89slGuy8w1j7yRgfOLxQUF2ipueRz HgLBaB+HJgwgG0rmR72C1FDeijKdPD2n4qSgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=mxvV6zKxemcQX6wXL8WdYrS+mNcncYSM1NGQIj9dZRa1bn5Z54i6b8WjN1EPn8N689 xUzaJIIHxTwvJYg30q8NM50EbMc5ZomehpODaolV93Gm1tLDAZmVE/rf1EqderU39WKy F24P7Ihl2qimKNov8wrQ0ERT/Jb93ILCidY4o= MIME-Version: 1.0 Received: by 10.239.134.215 with SMTP id a23mr467807hba.168.1257114069181; Sun, 01 Nov 2009 14:21:09 -0800 (PST) In-Reply-To: <4AEDFF5F.2010501@my.erau.edu> References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> <4AEDF4A7.5000506@my.erau.edu> <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> <4AEDFF5F.2010501@my.erau.edu> From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Sun, 1 Nov 2009 20:20:49 -0200 Message-ID: Subject: Re: LUA_ERRSYNTAX with luaL_dofile To: Lua list Content-Type: multipart/alternative; boundary=001485f5b0a489245b047756add2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f5b0a489245b047756add2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > > > Please don't top-post. > OT: Is there a posting-style convention in the Lua list? Note that top-posting is the default behavior of Outlook, Thunderbird and Gmail. Att. Lu=EDs Eduardo Jason Santos --001485f5b0a489245b047756add2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Please don't top-post.

OT: Is there a posting-style convention i= n the Lua list?

Note that top-posting is the default=A0b= ehavior=A0of Outlook, Thunderbird and Gmail.

Att.<= /div>
Lu=EDs Eduardo Jason Santos
--001485f5b0a489245b047756add2-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 20:31:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1MVCZb015915; Sun, 1 Nov 2009 20:31:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19D9C184C0; Sun, 1 Nov 2009 20:29:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s68.bay0.hotmail.com (bay0-omc1-s68.bay0.hotmail.com [65.54.246.99]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96DAF184A5 for ; Sun, 1 Nov 2009 20:29:52 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc1-s68.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 1 Nov 2009 14:30:40 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sun, 1 Nov 2009 22:30:39 +0000 Message-ID: <4AEE0C0D.20701@my.erau.edu> Date: Sun, 1 Nov 2009 17:30:37 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [OT] Posting-Style Convention References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> <4AEDF4A7.5000506@my.erau.edu> <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> <4AEDFF5F.2010501@my.erau.edu> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Nov 2009 22:30:40.0433 (UTC) FILETIME=[F117FA10:01CA5B42] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> >> Please don't top-post. >> > > OT: Is there a posting-style convention in the Lua list? > > Note that top-posting is the default behavior of Outlook, Thunderbird and > Gmail. > http://www.lua.org/lua-l.html has a section on netiquette, which directly links to http://www.netmeister.org/news/learn2quote.html. Reference 2.3. Even if it weren't explicitly stated, top-posting is bad in general. Especially like in the case that just occurred where a quoted section was bottom-posted, but replied to in top-posting convention, which resulted in a post that could neither be read from top to bottom nor bottom to top, but rather from the middle out. Note that I myself use Thunderbird. It is trivial to adapt accordingly to handle bottom-posting. Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 21:35:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1NZmmk022797; Sun, 1 Nov 2009 21:35:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DABB1886D; Sun, 1 Nov 2009 21:34:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E94F18858 for ; Sun, 1 Nov 2009 21:34:18 -0200 (BRST) Received: by bwz27 with SMTP id 27so5710751bwz.21 for ; Sun, 01 Nov 2009 15:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=RLcE5yJ72ZnnsSu1605/xpBHCmAcvUGQigdKYr5/5/g=; b=HNO3NVR9AWYis92QjFkhRR8AOWGJylZODh20IZ3RdtjyTk0XzU+yBOlSvq5O6K10r3 UyDjz0oCTSW/PdoL1IaM/yOx+htUewESseBXd+2wSKUrwDG+qM6yeAebBSsfWNkjH7Lw 1gRY2qB4wf9Wp1i0l2kTFH+SVrDLis2ScaQu8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Js8P3eH8R+7b96HMTBjbnzco3lbi9gbd71kR18i5eT79cKW65QMK5vtr0OyI7dsBy0 1MJJcfp4/0SNza8JWOU39jkMvSv+Dqhy99QjYjHJid/5IyTEI4rEiRpx2DWoc4RD7qCY Ac+nWRNnG187ov9qlBUwOhm7qa3SFRMwrJEgc= MIME-Version: 1.0 Received: by 10.239.139.134 with SMTP id t6mr464513hbt.12.1257118513801; Sun, 01 Nov 2009 15:35:13 -0800 (PST) In-Reply-To: References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> Date: Sun, 1 Nov 2009 18:35:13 -0500 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA1NZmmk022797 Mike Very impressive!! & Great Job! I've an older machine PC I run linux on. andrew:/usr/local/bin$ /usr/local/bin/luajit-2.0.0-beta1 /home/andrew/spectral.lua 5500 /usr/local/bin/luajit-2.0.0-beta1: Sorry, SSE2 CPU support required for this beta release Will SSE2 support be minimum required? Cheers Andrew On Sun, Nov 1, 2009 at 5:18 PM, François Perrad wrote: > 2009/11/1 Mike Pall : >> François Perrad wrote: >>> 1) numeric for with step = 0 causes infinite loop >>>     $ luajit -e 'for i = 5, 7, 0 do end' >> >> This is testing implementation-defined behavior, i.e. you'll get >> undefined results. Should 'for i=a,b,0' run upwards or downwards? >> And what about 'for i=a,b,-0'? >> >> LJ2 chooses to look at the sign bit and runs downwards it it's >> set. Lua runs upwards if 0 < step. Now, please don't ask what >> happens if step is NaN. :-) >> > > Nobody writes a for loop with direct 0. > The step could be the return of a function. > So, I prefer the Lua choice which prevents a infinite loop when a > positive increment is excepted. > But 'for i = 7, 5, 0' is a infinite loop with Lua. > >>> 2) losing arguments with metamethod __call >>>     m = {} >>>     setmetatable(m, { >>>         __call = function (obj, ...) >>>                      print('m.__call ' .. tostring(obj) .. ', ' .. >>> table.concat(arg, ', ')) >>>                  end >>>     }) >>>     m() >>>     m(1, 2) --> arguments are lost >> >> 'arg' is a Lua 5.0 feature. Not supported. Use {...}. >> >>> and some new minor issues or delta : >>> 1) getfenv(-3) gives a more general message : >>>     bad argument #1 to 'getfenv' (invalid level) >>> instead of >>>     bad argument #1 to 'getfenv' (level must be non-negative) >>> same issue with setfenv(). >> >> Intentional change. The common error message is precise enough. >> >>> 2) tostring of C function >>>     $ luajit -e 'print(tostring(print))' >>>     function: fast#29 >>> when lua gives : >>>     function: 0x9a5d020 >> >> The exact format of of a tostring'ized object is implementation- >> defined. Giving more information (since it's there) is intentional. >> >>> 3) xpcall without error handler >>>     $ luajit -e 'print(xpcall(assert, nil))' >>>     luajit: (command line):1: bad argument #2 to 'xpcall' (function >>> expected, got nil) >>> instead of : >>>     false     error in error handling >> >> I'm testing that the error handler is a function. This is >> apparently missing in the Lua codebase and it's erroring out >> later (which is not useful). File a bug against Lua. >> > > Another suspect behavior is flush() with a closed file f : >   f:flush() throws the expected error >   io.flush(f) doesn't > >>> 4) table.maxn >>>     $ luajit -e 't = {3,4}; print(table.maxn(t))' >>>     1 >>> instead of : >>>     2 >> >> Definitely a bug. Patch attached. Thank you! >> >>> 5) deprecated table.setn >>>     $ luajit -e 'table.setn({},7)' >>>     luajit: (command line):1: attempt to call field 'setn' (a nil value) >>> instead of : >>>     lua: (command line):1: 'setn' is obsolete >> >> Intentional. >> >>> 6) math.random with extra arguments >>>     $ luajit -e 'print(math.random(1, 2, 3))' >>>     2 >>> instead of : >>>     lua: (command line):1: wrong number of arguments >> >> Intentional. None of the other library functions care when more >> arguments than necessary are passed. >> > > Another exception is table.insert(). > > I'll update my test suite. > > François > >> Thanks for helping with testing! >> >> --Mike >> > From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 21:59:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA1NxgTY025270; Sun, 1 Nov 2009 21:59:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E052618A5F; Sun, 1 Nov 2009 21:58:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D17F18A02 for ; Sun, 1 Nov 2009 21:58:18 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so636919fgg.17 for ; Sun, 01 Nov 2009 15:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Ow/88njkCL6sxZ4ZcBXaMinwBysVjMpSXOl2onH8w2E=; b=tY8Dt1R811e9WPocFHqTTcjBtN7pHadh6fxOBZzhwdjRffZWGvLWZ1E+KLBGb/ouhS reA+rQiUWK19Y3ns+ricGPi2r5LefJsjZw2IsfPANBLl18aLigYeidj/VtfQxkm1EDfv LxjRQyBfJgYzfB3y40Yosq2TrHmrcMGObbO9s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VkrX1cBMJ+vXQ5DAFE888gNaEUvZiTQwH/XL9iglQR1E+Itast6gCdR1H0NRmsOWGH hX5C3JdY2II4jNqJdOadqdsTeXXRyG9GqMAEtWTqvmfDTYWF49qeyDM98J02/sYf+AQq +tmevs95ng8K3ax3SL6vQdK5CZvVtxCzVQKkA= MIME-Version: 1.0 Received: by 10.239.134.215 with SMTP id a23mr475693hba.168.1257119953102; Sun, 01 Nov 2009 15:59:13 -0800 (PST) In-Reply-To: <4AEE0C0D.20701@my.erau.edu> References: <372b07510911011249t559e3bbdv827296560f7e0690@mail.gmail.com> <4AEDF4A7.5000506@my.erau.edu> <372b07510911011327i5850d5a6p16e9af43a4c36d93@mail.gmail.com> <4AEDFF5F.2010501@my.erau.edu> <4AEE0C0D.20701@my.erau.edu> From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Sun, 1 Nov 2009 21:58:53 -0200 Message-ID: Subject: Re: [OT] Posting-Style Convention To: Lua list Content-Type: multipart/alternative; boundary=001485f5b0a43ea8bb0477580c11 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f5b0a43ea8bb0477580c11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > > > OT: Is there a posting-style convention in the Lua list? > Thanks a lot for the pointer. I should have seen it before. Even if it weren't explicitly stated, top-posting is bad in general. > I don't think I can agree with such a broad assertion, but I don't really bother about that, so I'll go for the bottom-posting. > Especially like in the case that just occurred where a quoted section > was bottom-posted, but replied to in top-posting convention, which > resulted in a post that could neither be read from top to bottom nor > bottom to top, but rather from the middle out. > I agree. Styles have to be consistent or everything gets messed up. Note that I myself use Thunderbird. It is trivial to adapt accordingly > to handle bottom-posting. > I use GMail, and these issues are greatly diminished by its interface. Best regards. --=20 Lu=EDs Eduardo Jason Santos --001485f5b0a43ea8bb0477580c11 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
> OT: Is there= a posting-style convention in the Lua list?
=A0
Thanks a lot for the pointer. I should have seen it befo= re.

Even if it weren'= ;t explicitly stated, top-posting is bad in general.

I don't think I can agree with such a = broad assertion, but I don't really bother about that, so I'll go f= or the bottom-posting.
=A0
Especially like in the case that just occurred where a quoted section
was bottom-posted, but replied to in top-posting convention, which
resulted in a post that could neither be read from top to bottom nor
bottom to top, but rather from the middle out.
=A0
I agree. Styles have to be consistent or everything gets messed up.<= /div>

Note that I myself use Thunderbird. It is trivial to adapt accordingly
to handle bottom-posting.

I use GMail, = and these issues are greatly diminished by its interface.

Best regards.
--=A0
Lu=EDs Eduardo Jason Santos=
--001485f5b0a43ea8bb0477580c11-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 1 22:24:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA20O6el027397; Sun, 1 Nov 2009 22:24:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF2FF1A6A1; Sun, 1 Nov 2009 22:22:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-out-01.simnet.is (smtp-out-01.simnet.is [194.105.231.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5A7418858 for ; Sun, 1 Nov 2009 22:22:40 -0200 (BRST) Authentication-Results: smtp-out-01.simnetpro.is; dkim=neutral (message not signed) header.i=none X-SBRS: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAN+u7UrCaehF/2dsb2JhbADYJoQ5BIFi Received: from consumer-mta-02.simnet.is ([194.105.232.69]) by smtp-out-01.simnetpro.is with ESMTP; 02 Nov 2009 00:23:32 +0000 Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: =?ISO-8859-1?Q?Gabr=EDel?= "A." =?ISO-8859-1?Q?P=E9tursson?= To: Lua list In-Reply-To: References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-HXBVLmm64iI9D+8vjuEG" Date: Mon, 02 Nov 2009 00:23:31 +0000 Message-Id: <1257121411.30355.0.camel@polarina-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-HXBVLmm64iI9D+8vjuEG Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > Will SSE2 support be minimum required? Would you like to use the good-ol' FPU instead? --=-HXBVLmm64iI9D+8vjuEG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkruJnYACgkQV73tUuRKpK6JCwCeKxSLd/sVTI3Vnn0qVZNEFM5Z 1jMAmwaKtjBbIVhE0AInk33Irvg5VO3+ =t1q3 -----END PGP SIGNATURE----- --=-HXBVLmm64iI9D+8vjuEG-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 00:56:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA22u8mF011096; Mon, 2 Nov 2009 00:56:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 216611A6AD; Mon, 2 Nov 2009 00:54:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EED61A677 for ; Mon, 2 Nov 2009 00:54:41 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4n4w-0000YM-00; Mon, 02 Nov 2009 03:55:34 +0100 Date: Mon, 2 Nov 2009 03:55:31 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102025531.GA3878@mike.de> References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean François Perrad wrote: > Another suspect behavior is flush() with a closed file f : > f:flush() throws the expected error > io.flush(f) doesn't Well, why should it? io.flush() does not have an argument (or rather ignores it). --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 01:04:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA234Mws011990; Mon, 2 Nov 2009 01:04:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23E391A6B0; Mon, 2 Nov 2009 01:03:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 923ED1A677 for ; Mon, 2 Nov 2009 01:03:02 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4nD4-0000Yz-00; Mon, 02 Nov 2009 04:03:58 +0100 Date: Mon, 2 Nov 2009 04:03:47 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102030347.GB3878@mike.de> References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Andrew Wilson wrote: > I've an older machine PC I run linux on. > > andrew:/usr/local/bin$ /usr/local/bin/luajit-2.0.0-beta1 > /home/andrew/spectral.lua 5500 > /usr/local/bin/luajit-2.0.0-beta1: Sorry, SSE2 CPU support required > for this beta release > > Will SSE2 support be minimum required? The status page mentions it: The JIT compiler can only generate code for CPUs with SSE2 at the moment. I.e. you need at least a P4, Core 2/i5/i7 or K8/K10 to use it. I plan to fix this during the beta phase and add support for emitting x87 instructions to the backend. But this is a lot of work and kind of low priority right now. In the meantime you could just use LJ1. Or try building LJ2 as a pure interpreter. Uncomment this line in the Makefile; XCFLAGS+= -DLUAJIT_DISABLE_JIT Then run 'make clean && make'. The interpreter uses x87 only (wouldn't make much of a difference to use SSE2 there). --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 01:19:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA23Jhs4013229; Mon, 2 Nov 2009 01:19:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB4701A6B1; Mon, 2 Nov 2009 01:18:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 500281A6A9 for ; Mon, 2 Nov 2009 01:18:22 -0200 (BRST) Received: by bwz27 with SMTP id 27so5834033bwz.21 for ; Sun, 01 Nov 2009 19:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=uENsj7brlnOGnUDRNnzY3AyiiZO3QmSqdB1UZbXeD3o=; b=uyqAp95o+i+9Y8o1kc0CGInwtLPTrmIIGbx8MU8qmErRQbhbDONAb0HbNWUInJG35+ z71YaFaBQ2qICSdJLspPvHw05shbJXB8SHUlhepJwG4CWqFW1oCwOG5+COYG6RwZnu61 zOvy5DTuHTW6e8mzDp5PwJEBEw7zCdQnaY0Ss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rb8OTh7Okyv0W2ncoFHCsQLD0tqKoVmeWWRZbhAe90q7tEBNFjkthc0swtEFyrcZ11 fTJdkBlbOEO4s67G44wbj8Z9Bt5+h9jMTYmwnW8K2Uu1fhRZ33Quo//BW0vnbGPCxsco jo0B1MnAFalERDSCb7VSYQTPtRIlg2+VASZRc= MIME-Version: 1.0 Received: by 10.239.138.23 with SMTP id n23mr409263hbn.154.1257131956437; Sun, 01 Nov 2009 19:19:16 -0800 (PST) In-Reply-To: <20091102030347.GB3878@mike.de> References: <20091031225554.GA30341@mike.de> <20091101164450.GA9366@mike.de> <20091102030347.GB3878@mike.de> Date: Sun, 1 Nov 2009 22:19:16 -0500 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> Will SSE2 support be minimum required? > > The status page mentions it: > > The JIT compiler can only generate code for CPUs with SSE2 at > the moment. I.e. you need at least a P4, Core 2/i5/i7 or K8/K10 > to use it. I plan to fix this during the beta phase and add > support for emitting x87 instructions to the backend. > > But this is a lot of work and kind of low priority right now. In > the meantime you could just use LJ1. Or try building LJ2 as a pure > interpreter. Uncomment this line in the Makefile; > > XCFLAGS+= -DLUAJIT_DISABLE_JIT > > Then run 'make clean && make'. The interpreter uses x87 only > (wouldn't make much of a difference to use SSE2 there). > > --Mike > Cool, sorry for the noise, didn't see status page. Thanks Andrew From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 01:25:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA23PQt8014128; Mon, 2 Nov 2009 01:25:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32675186E6; Mon, 2 Nov 2009 01:24:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91229186A9 for ; Mon, 2 Nov 2009 01:24:08 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id D250BBCE5F for ; Sun, 1 Nov 2009 22:25:04 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 01 Nov 2009 22:25:04 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:mime-version:content-type; s=smtpout; bh=NRJd3uk1s1raB+YfxRo/lPhyyv8=; b=W7sdTfsxjKTv858VgNKUAaz2MNlxquTpcs4dWF0Y++HBYr35ocEO6FYaY+pQ8GHPnWApJ4hCKuFHmaaAFsuNkNYjiXaNF3S5mBB/9wh6GkHWyIt3O4+5NDhN9zJtNm8oAWoYM82XwQBA9ldGL/T98+mvDOdJht8g6h5DsuA/6yQ= X-Sasl-enc: M9pIIq+3NW/kce7SDPrUHEPX+Zp2lItjpqIo+S7z2PHs 1257132304 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 4CD8349FE56 for ; Sun, 1 Nov 2009 22:25:04 -0500 (EST) Date: Sun, 1 Nov 2009 22:25:33 -0500 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Signature of iterator factories Message-ID: <20091102032533.GF11203@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean At this point, I'm sure too much code would break to introduce any changes. But if we were designing iterators from scratch, wouldn't it be nice to give them this signature instead: generator(control_variable, state_var1, ...) That way, we could pass multiple state_vars when we need to. I know, just pack all your state information into a table, or have your generator be a closure with the extra state information as upvalues. Easy enough to program. But it's a shame to bring in that overhead just because we can't write iterators taking more than one state_var. I don't know the VM architecture, maybe there are low-level reasons for doing it the way it is. What's the standard nomenclature for these things anyway? "pairs" is example of what? an "iterator factory"? "next" is an example of what? a "generator"? an "iterator function"? the triple (next, tbl, control_var) is what? an "iterator"? -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 03:09:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA259D3W024010; Mon, 2 Nov 2009 03:09:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D6831A67E; Mon, 2 Nov 2009 03:07:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C25F71A678 for ; Mon, 2 Nov 2009 03:07:41 -0200 (BRST) Received: by yxe17 with SMTP id 17so4250032yxe.33 for ; Sun, 01 Nov 2009 21:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=PCYlg3ihMItk8ud70K6CzH4KMOEkHya4F2D+Sai7aUQ=; b=cocAcjmKoZnAB9BvrmiwvXTHnslizZS+fjvvJlV8LmojJm1AQ2rb+Zi6Bj0/xAYbV9 xmKjoOIBwRS/kgoCopgjAvH7xzkLOMIAcsWePp8gBCTjPKLcz/pRb8dW96WPPlWovvoy 6kDZNNduET7RLA7z+KCCB5J0OSzZllujGCTRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; b=Nxsq3zdpEmBCDoLIr+yLQ4p7Oizjkknl60M96iIF7G6aa6NwSm+ubhY0H0AxelBRlU s0sOqx+N2Q83mZN+AaVOm90RtnJTWWVnSwynRiyB1Qk5+qb6smFITa5kMPMSbG5kBy0j +yMolDliRTL5O/bJL1niZEXd8ssIt4z0sN88U= Received: by 10.90.8.21 with SMTP id 21mr520637agh.37.1257138516591; Sun, 01 Nov 2009 21:08:36 -0800 (PST) Received: from IBM-73F5CA019D1 ([122.237.142.2]) by mx.google.com with ESMTPS id 9sm1042982yxf.59.2009.11.01.21.08.34 (version=SSLv3 cipher=RC4-MD5); Sun, 01 Nov 2009 21:08:35 -0800 (PST) Date: Mon, 2 Nov 2009 13:08:24 +0800 From: "YangFan" To: "Lua list" Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <200911021308217969275@gmail.com> X-mailer: Foxmail 6, 15, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id nA259D3W024010 Hi, Mike Pall LuaJIT 2.0 requires iuplua failed with the error messages shown below: -- LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ -- JIT: ON CMOV SSE2 fold cse dce fwd dse narrow loop fuse -- > require "iuplua" -- attempt to call a nil value -- stack traceback: -- [C]: ? -- [C]: in function 'require' -- stdin:1: in main chunk -- [C]: ? But LJ 1.1.5 works fine. And I'm using Windows XP Pro SP3, Pentium(R) M 1.86GHz. You can donwload the latest IUP source code from http://www.tecgraf.puc-rio.br/iup/ , or just use the precompiled binaries shipped with LuaForWindows package at http://luaforwindows.luaforge.net/. ======= 2009-11-01 06:59:36 you said£º======= >It's almost midnight on Halloween here. This is the perfect time >to release long-awaited, almost mythical open source software ... ;-) > >Yes, here it is: the first public release of LuaJIT 2.0! > = = = = = = = = = = = = = = = = = = = = ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Regards ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡YangFan ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡missdeer@gmail.com ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2009-11-02 From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 04:12:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA26CjbH030607; Mon, 2 Nov 2009 04:12:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 335EC1A6C1; Mon, 2 Nov 2009 04:11:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CDAD31A678 for ; Mon, 2 Nov 2009 04:11:15 -0200 (BRST) Received: by pxi2 with SMTP id 2so3143369pxi.11 for ; Sun, 01 Nov 2009 22:12:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.3.13 with SMTP id 13mr507053wfc.273.1257142329606; Sun, 01 Nov 2009 22:12:09 -0800 (PST) In-Reply-To: <20091101210128.GA22817@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> <20091101210128.GA22817@mike.de> Date: Mon, 2 Nov 2009 00:12:09 -0600 Message-ID: <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 1, 2009 at 3:01 PM, Mike Pall wrote: > Steven Johnson wrote: >> I'm running into some issue with module() and / or environments. The >> attached file is a dump of the package >> table, just before an error gets thrown: "attempt to index global >> 'widgetops' (a nil value)". > > I'm a bit stumped on that one ... does it work with the pure > interpreter (-j off)? > > Anyway, I'd probably need a lot more context to analyze this. > Maybe you could try to reduce this to a minimal test case? > Sure, I'll see what I can do. This is embedded in a pretty big program and I think I've got meetings and such this week, so it might be a few days getting around to it. I tried a run with a jit.off() call at the beginning and got similar results. Probably also nothing obvious, but just in case: It does not seem particularly fond of looping over package.loaders (as evidenced by the abrupt end of the dump once package.loaded closes), and this is true even when I dump only that table. On the other hand, I can iterate it without trouble in the command line, so maybe I've stepped on something. >> Any ideas? What seems most odd to me is the change from before to >> after the luaL_register()... > > Since this is a mix of Lua and C: have you checked that all your > luaL_check*() and luaL_opt*() calls do *not* use negative indexes? > Because that's an incompatibility in beta1 (patch posted to the list). > > --Mike > I applied the patch beforehand. I do use negative indices, and worse still pseudo-indices (mea maxima culpa). I have since gotten rid of the latter, so far as a quick search revealed, though I'll have to give it a more thorough check when I've had some rest. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 05:55:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA27tC1n006477; Mon, 2 Nov 2009 05:55:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A2721A6CA; Mon, 2 Nov 2009 05:53:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34D241A678 for ; Mon, 2 Nov 2009 05:53:44 -0200 (BRST) Received: by pzk34 with SMTP id 34so3240831pzk.11 for ; Sun, 01 Nov 2009 23:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=NKPBfhODb0n6VU8Ajvr9yi7zi5drdSlM3lSB0Je2bt4=; b=npKzPPbUoAsj6yFcWfZS9xUpOm7lXT3v1mUJi+yXCy5KLYBjZLU8ig+cjWoB+P78sb 9/+gQdYvhJMaBJe8cJIeclZclt/L1KFeVl+55i6sLN983LGaa8Acwvj25I3XmnS7iU3b /Pbf4J4fC6LA0D+wZHUJBwYf4KVFpqE3uvnys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=FeYtHc3cCNMyPEe9X/fpTbOXl1cTpNm5GoMeqteP3RARAJwxeSIQGkMuzah3TVpkWP Ek++zYbkM9Sp6UEGZZ2tpTL3BmU0w5gaweyWoNoD9sAImqxiRoIFisvl57uKABIewAd9 xPHTddloBIRkeAAscS/McU1cr2I4TEBX6jIEY= MIME-Version: 1.0 Received: by 10.142.3.19 with SMTP id 19mr554346wfc.321.1257148480167; Sun, 01 Nov 2009 23:54:40 -0800 (PST) From: sagasw Date: Mon, 2 Nov 2009 15:54:20 +0800 Message-ID: <4de92fd0911012354u4a3c96ccg1b7691041ab8adc1@mail.gmail.com> Subject: Ask, how to implement the function like ipairs with C api? To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502ad2c971e6b04775eb027 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502ad2c971e6b04775eb027 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi guys, I have a question when I read the manual. lua_gettable could get table, and lua_getfield could get specific key. If I only know the table in top of stack like=EF=BC=9A local tbl_sample =3D {a =3D "aaa", b =3D "bbb", c=3D "ccc", 15} How could I get the information of table key-value pairs in c? And the case is I don't know the key. Just like the function ipairs(), it doesn't need to know the key before using the table. I read the source code of ipairs(), it says to use upvalue to aux the function. Who could give me c code sample for it? Thanks, --00504502ad2c971e6b04775eb027 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi guys,
I have a question when I read the manual.
lua_gettable coul= d get table, and lua_getfield could get specific key.

If I only know= the table in top of stack like=EF=BC=9A

local tbl_sample =3D {a =3D= "aaa", b =3D "bbb", c=3D "ccc", 15}

How could I get the information of table key-value pairs in c? And the = case is I don't know the key.

Just like the function ipairs(), i= t doesn't need to know the key before using the table.

I read th= e source code of ipairs(), it says to use upvalue to aux the function.
Who could give me c code sample for it?

Thanks,
--00504502ad2c971e6b04775eb027-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 06:11:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA28BETG008028; Mon, 2 Nov 2009 06:11:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AE181A6CC; Mon, 2 Nov 2009 06:09:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E90B1A678 for ; Mon, 2 Nov 2009 06:09:54 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nA28Amhp009518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 2 Nov 2009 03:10:49 -0500 (EST) Date: Mon, 2 Nov 2009 03:10:48 -0500 (EST) From: Diego Nehab To: Lua list Subject: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Message-ID: User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5789 signatures=575501 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi All, The new candidate release for LuaSocket 2.0.3 is available for download from http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/luasocket-2.0.3-rc2.zip I plan to release the final version within the next couple of weeks, so please take a look and see if you find any issues you want fixed before then. Kind regards, Diego From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 07:11:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA29BPFA013860; Mon, 2 Nov 2009 07:11:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5ACC91A6C7; Mon, 2 Nov 2009 07:10:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81DDF1A678 for ; Mon, 2 Nov 2009 07:09:56 -0200 (BRST) Received: by pwj9 with SMTP id 9so1745180pwj.21 for ; Mon, 02 Nov 2009 01:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=jLgi00aIKgnxFAoK0/OxKpl6KUuEpyg0GA0pxu/1rv0=; b=KRDjJuL26YxfnmlSqo2QkbGDW2BU3//tPtYiG26fnVSSFKWMLtr+qP4QkUTLkphgYi R5GJRcvN80U+gMe9cUjlV5gCre63Ct7bPsveo9se2I8sXY0X7cjd1nqgqgp7VkInDCcO c9IzqN+M+S1CxRLGGCBuJydmYGnsJJq/mOZkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=SqzJpbCQFIiL1wpxlMGY3wcUmd+ucoJjpoMV0ZWeDQgtkpMy3azeJpi3MI9Q6ubBQI 4E44gxUsHlBIrj+Xj4J8fzMKlYnon4glwpqjjvK1wiLCJ6jRFfoUjSutNihAZStLDl/k pxJXpnFEPHitHMkXZgZErh7akNnxN5mnkkBa4= Received: by 10.115.37.37 with SMTP id p37mr7883584waj.11.1257153048471; Mon, 02 Nov 2009 01:10:48 -0800 (PST) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 20sm1451008pxi.15.2009.11.02.01.10.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 01:10:47 -0800 (PST) Message-ID: <4AEEA213.2090108@gmail.com> Date: Mon, 02 Nov 2009 17:10:43 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> <20091101020943.GA8663@mike.de> <20091101023229.GA10905@mike.de> In-Reply-To: <20091101023229.GA10905@mike.de> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Simular problem here, our code passes registry index to luaL_checkxxx and failed on LJ2. The following code snippet segfaults on the "printf" line with LJ2 on debian 5.0. #include #include "lua.h" #include "lauxlib.h" #include "lualib.h" int cfunc(lua_State *L) { printf("checkstring for upvalue 2 %s\n", luaL_checkstring(L, lua_upvalueindex(1))); return 0; } int main() { lua_State *L = lua_open(); luaopen_base(L); lua_pushstring(L, "aaa"); lua_pushcclosure(L, cfunc, 1); lua_call(L, 0, 0); } Regards Long Mike Pall дµÀ: > I wrote: > >> Currently LJ2 happily misinterprets negative indexes for these >> functions. Sooo ... what to do? I guess I'll have to bite the >> bullet and support some undefined behavior, too. :-/ >> >> Patch will follow shortly. >> > > Ok, here it is. Timm, can you please check whether this fixes > your original problem? Thank you! > > --Mike > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 07:21:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA29LZEA014821; Mon, 2 Nov 2009 07:21:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B281186E6; Mon, 2 Nov 2009 07:20:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 90F35185D1 for ; Mon, 2 Nov 2009 07:20:13 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id EA211BD4A9 for ; Mon, 2 Nov 2009 04:21:09 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 02 Nov 2009 04:21:10 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=T02DSZUZrUfBYfVvl0svcQRYjis=; b=Pyu797Hc7b+zyxQn+GDeN1SZdcOf8mUwpiVOt0O1wB7WP8ncCyirVTE+Mj5KouoX6NF9HeQu5OfzB6dqOpZUtx3hDynIg7KFGq/jZ0PmOOp5BLfotDRzQG83/XjQZCwIihfRSxFip1Qb8CtRue1n2KuFIeFokrz274boCsVL4y4= X-Sasl-enc: 9YgdsA31PTFq6HJJuR8daxmARtqmQ7QKlEOSixgIsBtL 1257153669 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id 347A23232B for ; Mon, 2 Nov 2009 04:21:08 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091031225554.GA30341@mike.de> Date: Mon, 2 Nov 2009 22:20:36 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Have I done something wrong with math.random? $ luajit-2.0.0-beta1 LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ JIT: ON CMOV SSE2 SSE4.1 fold cse dce fwd dse narrow loop fuse > =math.random() 1.7863937924312 LRM: "When called without arguments, returns a uniform pseudo-random real number in the range [0,1)" $ uname -v Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) $ lipo -info /usr/local/bin/luajit-2.0.0-beta1 Non-fat file: /usr/local/bin/luajit-2.0.0-beta1 is architecture: i386 Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 07:31:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA29VZnh015639; Mon, 2 Nov 2009 07:31:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A56A185D1; Mon, 2 Nov 2009 07:30:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E19F18399 for ; Mon, 2 Nov 2009 07:30:07 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 30A3FBA58B for ; Mon, 2 Nov 2009 04:31:04 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 02 Nov 2009 04:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:content-transfer-encoding:in-reply-to; s=smtpout; bh=7uWtfe9y4+rkbAvAmlUHp5Ls9So=; b=Q2y9yUyZHtXMk162PPtEeIGaN60C6TWxmeEnV5oTr6ECc68liemQiiZt1PmOACOhgjIjQsNgMOeKzNZ2g7seRzZx+nD0lebiN3yJPhy4j/w9NmS3d4KdnBzifqFo8AOJxo6mggJClRAEB9gyKzNconluWiVNLfpS4zv6Ssr84Xc= X-Sasl-enc: AyTuS/K18q9Y/6BZ6v6Dj5x/2869yhPt2+seUlBHQ9eT 1257154263 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8FE4A4A21DC for ; Mon, 2 Nov 2009 04:31:03 -0500 (EST) Date: Mon, 2 Nov 2009 04:31:33 -0500 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Re: Ask, how to implement the function like ipairs with C api? Message-ID: <20091102093132.GG11203@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <4de92fd0911012354u4a3c96ccg1b7691041ab8adc1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4de92fd0911012354u4a3c96ccg1b7691041ab8adc1@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 02, 2009 at 03:54:20PM +0800, sagasw wrote: > I have a question when I read the manual. > lua_gettable could get table, and lua_getfield could get specific key. > > If I only know the table in top of stack like: > > local tbl_sample = {a = "aaa", b = "bbb", c= "ccc", 15} > > How could I get the information of table key-value pairs in c? And the > case is I don't know the key. > > Just like the function ipairs(), it doesn't need to know the key before > using the table. > > I read the source code of ipairs(), it says to use upvalue to aux the > function. > Who could give me c code sample for it? Just call lua_next(L, index_of_table). It's in the Reference Manual. If stack starts like this: -1: nil -2: your table then after lua_next(L, -2), the stack will look like this: -1: "aaa" -2: "a" -3: your table The Ref Manual has sample code for table traversals. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 07:32:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA29WGSV015744; Mon, 2 Nov 2009 07:32:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC592187D5; Mon, 2 Nov 2009 07:30:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79F25185E4 for ; Mon, 2 Nov 2009 07:30:32 -0200 (BRST) Received: by pwj9 with SMTP id 9so1753095pwj.21 for ; Mon, 02 Nov 2009 01:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=1US0ZEjZ992cwJbK9Ij9vnEoRkI4QDjzjBsJVfnlJAY=; b=e9cC0LWf8yWAF9JLvB7eVgl5mC0uxyXK9KmDsn6h02ydFClUkLYc9QpkN6LLDLsdCZ SLmYEl+TaMIhiZsTcAsXXqYyvX7dj21/22xB0Z9HqOIaYR1f7TMxeMNKefNu9ms2+jYV /Ilr7gH8LxP4n0Uxllor9cwsc4IIY1Gl3LaNE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=I7qqGOvjdvPIGsVYyJp/hytJ4sjsiebaC7zqPBx/s9GsK9dlcgx/S6meZosQ8tL9tp c0dGp66TI0koOm/ivoWqb2JJnW4RZDuxVl+kY8Ri/lMkJ9lbzRiqPBYc3n6parJTNoEk DRC7b/trfJw1kmlpA4tSzj7dCYlMjfWlXfi6M= MIME-Version: 1.0 Received: by 10.142.74.11 with SMTP id w11mr654968wfa.184.1257154288536; Mon, 02 Nov 2009 01:31:28 -0800 (PST) In-Reply-To: <20091101170638.GA10614@mike.de> References: <20091030022824.GA12167@mike.de> <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> Date: Mon, 2 Nov 2009 17:31:28 +0800 X-Google-Sender-Auth: c16b838ba4399b38 Message-ID: <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I found a problem. If the frame slot was referenced by an upvalue, the frame slot will be broken. Is the parser aware of this and ensure the frame slot is safe? From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 08:19:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2AJ1Pd019783; Mon, 2 Nov 2009 08:19:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46A5A18993; Mon, 2 Nov 2009 08:17:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A0901894D for ; Mon, 2 Nov 2009 08:17:23 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4tzN-0000ps-00; Mon, 02 Nov 2009 11:18:17 +0100 Date: Mon, 2 Nov 2009 11:17:04 +0100 From: Mike Pall To: Lua list Subject: LuaJIT 2.0 intellectual property disclosure and research opportunities Message-ID: <20091102101704.GA8174@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It has been brought to my attention that it might be advantageous for some parts of the research community and the open source community, that I make a public statement about the intellectual property (IP) contained in LuaJIT 2.0 and earlier versions: I hereby declare any and all of my own inventions contained in LuaJIT to be in the public domain and up for free use by anyone without payment of any royalties whatsoever. [Note that the source code itself is licensed under a permissive license and is not placed in the public domain. But this is an orthogonal issue.] I cannot guarantee it to be free of third-party IP however. In fact nobody can. Writing software has become a minefield and any moderately complex piece of software is probably (unknowingly to the author) encumbered by hundreds of dubious patents. This especially applies to compilers. The curent IP system is broken and software patents must be abolished. Ceterum censeo. The usual form of disclosure is to write papers and publish them. I'm sorry, but I don't have the time for this right now. But I would consider publishing open source software as a form of disclosure. In the interest of anyone doing research on virtual machines, compilers and interpreters, I've compiled a list of some of the new aspects to be found in LuaJIT 2.0. I do not claim all of them are original (I cannot possibly know all of the literature), but my research indicates that many of them are quite innovative. This also presents some research opportunities for 3rd parties. I have little use for academic merits myself -- I'm more interested in coding than writing papers. Anyone is welcome to dig out any aspects, explore them in detail and publish them (giving due credit). Design aspects of the VM: - NaN-tagging: 64 bit tagged values are used for stack slots and table slots. Unboxed floating-point numbers (doubles) are overlayed with tagged object references. The latter can be distinguished from numbers via the use of special NaNs as tags. It's a remote descendant of pointer-tagging. [The idea dates back to 2006, but I haven't disclosed it before 2008. Special NaNs have been used to overlay pointers before. Others have used it for tagging later on. The specific layout is of my own devising.] - Low-overhead call frames: The linear, growable stack implicitly holds the frame structure. The tags for the base function of each call frame hold a linked structure of frames, using no extra space. Calls/returns are faster due to lower memory traffic. This also allows installing exception handlers at zero cost (it's a special bit pattern in the frame link). Design of the IR (intermediate representation) used by the compiler: - Linear, pointer-free IR: The typed IR is SSA-based and highly orthogonal. An instruction takes up only 64 bits. It has up to two operands which are 16 bit references. It's implemented with a bidirectionally growable array. No trees, no pointers, no cry. Heavily optimized for minimal D-cache impact, too. - Skip-list chains: The IR is threaded with segregated, per-opcode skip-list chains. The links are stored in a multi-purpose 16 bit field in the instruction. This facilitates low-overhead lookup for CSE, DSE and alias analysis. Back-linking enables short-cut searches (average overhead is less than 1 lookup). Incremental build-up is trivial. No hashes, no sets, no complex updates. - IR references: Specially crafted IR references allow fast const vs. non-const decisions. The trace recorder uses type-tagged references (a form of caching) internally for low-overhead type-based dispatch. - High-level IR: A single, uniform high-level IR is used across all stages of the compiler. This reduces overall complexity. Careful instruction design avoids any impact on low-level CSE opportunities. It also allows cheap and effective high-level semantic disambiguation for memory references. Design of the compiler pipeline: - Rule-based FOLD engine: The FOLD engine is primarily used for constant folding, algebraic simplifications and reassociation. Most traditional compilers have an evolutionary grown set of implicit rules, spread over thousands of hand-coded tiny conditionals. The rule-based FOLD engine uses a declarative approach to combine the first and second level of lookup. It allows wildcard lookup with masked keys, too. A pre-processor generates a semi-perfect hash table for constant-time rule lookup. It's able to deal with thousands of rules in a uniform manner without performance degradation. A declarative approach is also much easier to maintain. - Unified stage dispatch: The FOLD engine is the first stage in the compiler pipeline. Wildcard rules are used to dispatch specific instructions or instruction types (loads, stores, allocations etc.) to later optimization stages (load forwarding, DSE etc.). Unmatched instructions are passed on to CSE. Unified stage dispatch facilitates modular and pluggable optimizations with only local knowledge. It's also faster than doing multiple dispatches in every stage. Trace compiler: - NLF region-selection: The trace heuristics use a natural-loop first (NLF) region-selection mechanism to come up with a close-to optimal set of (looping) root traces. Only special bytecode instructions trigger new root traces -- regular conditionals never do this. Root traces that leave the loop are aborted and retried later. This also gives outer loops a chance to inline inner loops with a low trip count. NLF usually generates a superior set of root traces than the MRET/NET (next-executing tail) and LEI (last-executed iteration) region-selection mechanisms known from the literature. - Hashed profile counters: Bytecode instructions to trigger the start of a hot trace use low-overhead hashed profiling counters. The profile is imprecise because collisions are ignored. The hash table is kept very small to reduce D-cache impact (only two hot cache lines). Since NLF weeds out most false positives, this doesn't deteriorate hot trace detection. [Neither using hashed profile counters, nor imprecise profiling, nor using profiling to detect hot loops is new. But the specific combination may be original.] - Code sinking via snapshots: The VM must be in a consistent state when a trace exits. This means that all updates (stores) to the state (stack or objects) must track the original language semantics. Naive trace compilers achieve this by forcing a full update of the state to memory before every exit. This causes many on-trace stores and seriously diminishes code quality. A better approach is to sink these stores to compensation code, which is only executed if the trace exits are actually taken. A common solution is to emit actual code for these stores. But this causes code cache bloat and the information often needs to be stored redundantly, for linking of side traces. Code sinking via snapshots allows sinking of arbitrary code without the overhead of the other approaches. A snapshot stores a consistent view of all updates to the state before an exit. If an exit is taken the on-trace machine state (registers and spill slots) and the snapshot can be used to restore the VM state. State restoration using this data-driven approach is slow of course. But repeatedly taken side exits quickly trigger the generation of side traces. The snapshot is used to initialize the IR of the side trace with the necessary state using pseudo-loads. These can be optimized together with the remainder of the side trace. The pseudo-loads are unified with the machine state of the parent trace by the backend to enable zero-cost linking to side traces. [Currently snapshots only allow store sinking of scalars. It's planned to extend this to allow arbitrary store and allocation sinking, which together with store forwarding would be a unique way to achieve scalar-replacement of aggregates.] - Sparse snapshots: Taking a full snapshot of all state updates before every exit would need a considerable amount of storage. Since all scalar stores are sunk, it's feasible to reduce the snapshot density. The basic idea is that it doesn't matter which state is restored on a taken exit, as long as it's consistent. This is a form of transactional state management. Every snapshot is a commit; a taken exit causes a rollback to the last commit. The on-trace state may advance beyond the last commit as long as this doesn't affect the possibility of a rollback. In practice this means that all on-trace updates to the state (non-scalar stores that are not sunk) need to force a new snapshot for the next exit. Otherwise the trace recorder only generates a snapshot after control-flow constructs that are present in the source, too. Guards that have a low probability of being wrongly predicted do not cause snapshots (e.g. function dispatch). This further reduces the snapshot density. Sparse snapshots also improve on-trace code quality, because they reduce the live range of the results of intermediate computations. Scheduling decisions can be made over a longer stream of instructions, too. [It's planned to switch to compressed snapshots. 2D-compression across snapshots may be able to remove even more redundancy.] Optimizations: - Hash slot specialization: Hash table lookup for constant keys is specialized to the predicted hash slot. This avoids a loop to follow the hash chain. Pseudocode: HREFK: if (hash[17].key != key) goto exit HLOAD: x = hash[17].value -or- HSTORE: hash[17].value = x HREFK is shared by multiple HLOADs/HSTOREs and may be hoisted independently. The verification of the prediction (HREFK) is moved out of the dependency chain by a super-scalar CPU. This makes hash lookup as cheap as array lookup with minimal complexity. It also avoids all the complications (cache invalidation, ordering constraints, shape mismatches) associated with hidden classes (V8) or shape inference/property caching (TraceMonkey). - Code hoisting via unrolling and copy-substitution (LOOP): Traditional loop-invariant code motion (LICM) is mostly useless for the IR resulting from dynamic languages. The IR has many guards and most subsequent instructions are control-dependent on them. The first non-hoistable guard would effectively prevent hoisting of all subsequent instructions. The LOOP pass does synthetic unrolling of the recorded IR, combining copy-substitution with redundancy elimination to achieve code hoisting. The unrolled and copy-substituted instructions are simply fed back into the compiler pipeline, which allows reuse of all optimizations for redundancy elimination. Loop recurrences are detected on-the-fly and a minimized set of PHIs is generated. - Narrowing of numbers to integers: Predictive narrowing is used for induction variables. Demand-driven narrowing is used for index expressions using a backpropagation algorithm. This avoids the complexity associated with speculative, eager narrowing, which also causes excessive control-flow dependencies due to the many overflow checks. Selective narrowing is better at exploiting the combined bandwidth of the FP and integer units of the CPU and avoids clogging up the branch unit. Register allocation: - Blended cost-model for R-LSRA: The reverse-linear-scan register allocator uses a blended cost model for its spill decisions. This takes into account multiple factors (e.g. PHI weight) and benefits from the special layout of IR references (constants before invariant instructions, before variant instructions). - Register hints: The register allocation heuristics take into account register hints, e.g. for loop recurrences or calling conventions. This is very cheap to implement, but improves the allocation decisions considerably. It reduces register shuffling and prevents unnecessary spills. - x86-specific improvements: Special heuristics for move vs. rename produce close to optimal code for two-operand machine code instructions. Fusion of memory operands into instructions is required to generate high-quality x86 code. Late fusion in the backend allows better, local decisions, based on actual register pressure, rather than estimates of prior stages. Ok, that's it! Sorry for the length of this posting, but I hope it was at least informative to someone out there. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 08:25:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2AOw6T020326; Mon, 2 Nov 2009 08:24:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6D981A6CF; Mon, 2 Nov 2009 08:23:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF6AE1A678 for ; Mon, 2 Nov 2009 08:23:38 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4u5T-0000qx-00; Mon, 02 Nov 2009 11:24:35 +0100 Date: Mon, 2 Nov 2009 11:24:30 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091102102430.GA20637@mike.de> References: <20091030051104.GA23082@mike.de> <3c7535c80910292351u68f8f821j8036e0444117f7b2@mail.gmail.com> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean tankxx wrote: > I found a problem. If the frame slot was referenced by an upvalue, the > frame slot will be broken. Is the parser aware of this and ensure the > frame slot is safe? This cannot happen. The parser only generates upvalues for slots that correspond to actual variables in the source. The called object is always copied to the first free slot and this slot is then used as the frame slot. Oh, and before I forget: resolving of the __call metamethod is done before the call dispatch. So the frame slot always contains a pointer to a function object (which makes the tag redundant). --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 08:40:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Ae4df021595; Mon, 2 Nov 2009 08:40:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE0541A6D2; Mon, 2 Nov 2009 08:38:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mr01.hansenet.de (mr011.hansenet.de [85.183.254.144]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BD8B1A678 for ; Mon, 2 Nov 2009 08:38:39 -0200 (BRST) Received: from exactcode.de (85.183.32.143) by mr01.hansenet.de (8.0.026) id 4ABC83D200424D14 for lua@bazar2.conectiva.com.br; Mon, 2 Nov 2009 11:39:34 +0100 Received: from [192.168.2.173] (helo=[192.168.2.173]) by exactcode.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.54) id 1N4uJs-0003QE-Ap for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 10:39:34 +0000 Message-ID: <4AEEB6DC.1050503@exactcode.de> Date: Mon, 02 Nov 2009 11:39:24 +0100 From: =?ISO-8859-1?Q?Ren=E9_Rebe?= User-Agent: Thunderbird 2.0.0.21 (X11/20090417) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> In-Reply-To: <20091031225554.GA30341@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.7 (-) X-Spam-Report: Spam detection software, running on the system "exactcode.de", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Mike, congratulations for your tremendous and amazing work! I updated the T2 SDE package, web view at: [...] Content analysis details: (-1.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.5 ALL_TRUSTED Passed through trusted hosts only via SMTP -0.2 BAYES_40 BODY: Bayesian spam probability is 20 to 40% [score: 0.3368] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Mike, congratulations for your tremendous and amazing work! I updated the T2 SDE package, web view at: http://www.t2-project.org/packages/luajit.html Including the 2 hot-fixes so far. Greetings from Berlin, René Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! > > Here is a link to the home page: > http://luajit.org/luajit.html > > And a direct link to the download page: > http://luajit.org/download.html > > What is LuaJIT? > --------------- > > LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully > compatible with standard Lua 5.1 and can significantly boost the > performance of your Lua programs. > > LuaJIT is open source software, released under the MIT/X license. > > LuaJIT builds out-of-the-box on all popular x86 operating systems > (Linux, Windows, OSX etc.). It runs fine as a 32 bit application > under x64-based systems, too. > > This is a BETA TEST release -- the current status and the list of > known issues are shown here: http://luajit.org/status.html > Please report any problems you may find with this release. Thank you! > > What's new in LuaJIT 2.0 > ------------------------ > > The VM of LuaJIT 2.0 has been rewritten from the ground up and is > relentlessly optimized for performance. It combines a high-speed > interpreter, written in assembler, with a state-of-the-art JIT compiler. > > An innovative trace compiler is integrated with advanced, SSA-based > optimizations and a highly tuned code generation backend. This allows a > substantial reduction of the overhead associated with dynamic language > features. It's destined to break into the performance range > traditionally reserved for offline, static language compilers. > > Performance on numerical code is already quite competitive (see below). > Support for other areas (e.g. string functions) is still a bit weak. > Although the VM supports all Lua language features and standard library > functions, the JIT compiler is not complete (yet) and falls back to the > interpreter in some cases. All of this works transparently, so unless > you use -jv, you'll probably never notice. The interpreter is quite > fast, too (near the performance of the LuaJIT 1.x JIT compiler). > > Preliminary benchmark numbers are shown below -- performance will > likely improve during the beta test phase. These numbers are mainly > intended to give you an idea about the typical speedups you can expect, > depending on the type of application. Your mileage may vary. > > Ok, so thanks to everyone for their patience! A big thank you goes to > the alpha testers. And now, please have fun with it -- Happy Halloween! > > --Mike > > Relative speedup over Lua 5.1.4 on standard Lua benchmarks > (e.g. 11.9 means it's almost twelve times faster): > > md5 152.7 | mandelbrot 13.4 | nsieve 4.7 | > array3d 101.5 | pidigits 12.4 | partialsums 4.1 | > array 73.5 | random 12.2 | chameneos 3.8 | > methcall 28.8 | nsievebits 12.0 | recursive 3.5 | > nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 | > matrix 23.0 | lists 9.3 | binarytrees 2.7 | > spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 | > fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 | > nbody 14.8 | fasta 5.3 | sumfile 1.5 | > > SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized), > higher numbers are better: > > SciMark composite | > small score | FFT SOR MC SPARSE LU > ----------------------------+--------------------------------------- > GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1 > JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4 > JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0 > ----------------------------+--------------------------------------- > LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5 > LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5 > Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5 > > Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua > > -- René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10785 Berlin http://exactcode.de | http://t2-project.org | http://rene.rebe.name From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 08:42:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Ag84f021802; Mon, 2 Nov 2009 08:42:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84E411A6D5; Mon, 2 Nov 2009 08:40:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 139D51A6CA for ; Mon, 2 Nov 2009 08:40:49 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id nA2AfhwG008299 for ; Mon, 2 Nov 2009 11:41:43 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAApG7krDbohb/2dsb2JhbADaNIQ5BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 02 Nov 2009 11:41:41 +0100 Received: from [192.168.127.128] (host86-55-dynamic.0-87-r.retail.telecomitalia.it [87.0.55.86]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nA2Afc3l001450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Nov 2009 11:41:41 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AEEB75E.80501@erix.it> Date: Mon, 02 Nov 2009 11:41:34 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities References: <20091102101704.GA8174@mike.de> In-Reply-To: <20091102101704.GA8174@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > I hereby declare any and all of my own inventions contained in > LuaJIT to be in the public domain and up for free use by anyone > without payment of any royalties whatsoever. > > [Note that the source code itself is licensed under a permissive > license and is not placed in the public domain. But this is an > orthogonal issue.] > > I cannot guarantee it to be free of third-party IP however. In > fact nobody can. Writing software has become a minefield and any > moderately complex piece of software is probably (unknowingly to > the author) encumbered by hundreds of dubious patents. This > especially applies to compilers. The curent IP system is broken > and software patents must be abolished. Ceterum censeo. Nice copyright statement, I think I'll steal it someday. Assuming it's not patented ;-) I'll add my congratulations for your great work on LuaIJT 2.0. Even if most of the technical discussion is well above my head (I hardly lifted Lua's lid to look at its internals), it's definitely a strong incentive to use Lua for more and more high-performance code. Enrico From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 08:50:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Aob7p022532; Mon, 2 Nov 2009 08:50:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23C571A6DA; Mon, 2 Nov 2009 08:49:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE72B1A6D0 for ; Mon, 2 Nov 2009 08:49:11 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id B19D6BD4A9 for ; Mon, 2 Nov 2009 05:50:07 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 02 Nov 2009 05:50:07 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=R9ePoGXP1phusCH8L+GYi9RjYJU=; b=KRujw01oEQujz54lFwjXJFfEAEGyjFnaj4TfUUT44rOWuxoxA+cfFLBJEG+np3isusRube5zduOtF3WvZQQZSEouFpLxV2Fbhh2mwLkFRoyKAoed5CeeDfebbLJS9jBqj62+6WLrcs9mFSh3xijwIUvMjr4kgMbg4+QCJWrdCKs= X-Sasl-enc: tuAM0/4iD3e+otOpqzP8AVVaCktydZxnFnABYz7eKxae 1257159006 Received: from [10.1.1.4] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id 902E012D2C for ; Mon, 2 Nov 2009 05:50:06 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091101160610.GA7245@mike.de> Date: Mon, 2 Nov 2009 23:49:32 +1300 Content-Transfer-Encoding: 7bit Message-Id: <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2/11/2009, at 5:06 AM, Mike Pall wrote: > Consider using os.clock(). When I read that I thought "what, clock is implemented and undocumented in Lua?", but no, there it is in the PiL and the LRM right in front of me, where it has been for several years. Anyway, I wrote a test harness for the kdtree. It's at http://www.incremental.co.nz/projects/lua.html . Instructions for getting data are in the comments in kdtree-test.lua. Like the heap, I managed to screw some of test results up (just in case there's any doubt, I've been waiting for LJ2 with as much anticipation as the rest of the list and am convinced it will make the world a better place. My test cases are just a little problematic. Hopefully that's not too much bad coding on my part, and of some help for improving LJ2). Reading and querying are much better. Querying is particularly nice: a tree query returns a coroutine iterator, so tracking a mouse moving across a map and highlighting the road it's over allocates an awful lot of coroutines, so lighter coroutines are a real bonus! Read Build Query lua 6.33616 115.959 4.29028 LJ1 5.34206 74.3395 1.25906 LJ2 4.18 77.04 1.01 Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:02:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2B2Ars023589; Mon, 2 Nov 2009 09:02:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6784B187CD; Mon, 2 Nov 2009 09:00:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tilde.org (mail.tilde.org [209.177.145.230]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2136518593 for ; Mon, 2 Nov 2009 09:00:49 -0200 (BRST) Received: from [192.168.0.7] ([70.18.162.128]) (authenticated user ml@iridescent.org) by mail.tilde.org (Kerio MailServer 6.4.1 patch 1) for lua@bazar2.conectiva.com.br; Mon, 2 Nov 2009 03:01:37 -0800 Mime-Version: 1.0 Message-Id: Date: Mon, 2 Nov 2009 06:01:09 -0400 To: lua@bazar2.conectiva.com.br From: "Lawrence E. Bakst" Subject: LuaJIT 2.0 bug Content-Type: text/plain; charset="us-ascii" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is below enough info to find the crash? Here is output run with -jdump=b. What else do you need? ---- TRACE 34 start ktest.lua:465 0019 KSHORT 16 0 0020 TSETV 16 3 14 0021 ITERC 14 3 3 ; next ---- TRACE 34 abort ktest.lua:465 -- NYI: FastFunc next ---- TRACE 34 start ktest.lua:477 [1] 95226 segmentation fault luajit -jdump=b ktest.lua line 477 reads: for k,v in pairs(fields) do res[v] = math.sqrt(res[v]) end; Is line 477 likely to be the cause of the problem? It is in a function called std_dev that is called over and over again. The crash happens on the 64th iteration of a loop, but which time that function has been called 30*64 times. The code runs fine with -joff -- leb@iridescent.org From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:15:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BFQSo024594; Mon, 2 Nov 2009 09:15:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E8DD1899C; Mon, 2 Nov 2009 09:14:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E4321894D for ; Mon, 2 Nov 2009 09:14:06 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4usI-0000td-00; Mon, 02 Nov 2009 12:15:02 +0100 Date: Mon, 2 Nov 2009 12:14:53 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102111453.GA22577@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Geoff Leyland wrote: > > =math.random() > 1.7863937924312 Ok, so Apple thinks -fpic is a good on x86. And I'm stupid because I broke it. Patch attached. Thank you for the report! --Mike --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="math_random.diff" --- a/src/lib_math.c +++ b/src/lib_math.c @@ -98,8 +98,8 @@ typedef union { uint64_t u64; double d; } U64double; z = (((z<> (k-s)) ^ ((z&((uint64_t)(int64_t)-1 << (64-k)))<gen[i] = z; -/* PRNG step function. Returns a double in the range 0.0 <= d < 1.0. */ -static double tw223_step(TW223State *tw) +/* PRNG step function. Returns a double in the range 1.0 <= d < 2.0. */ +static LJ_NOINLINE double tw223_step(TW223State *tw) { uint64_t z, r = 0; U64double u; @@ -108,16 +108,7 @@ static double tw223_step(TW223State *tw) TW223_GEN(2, 55, 24, 7) TW223_GEN(3, 47, 21, 8) u.u64 = (r & (((uint64_t)1 << 52)-1)) | ((uint64_t)0x3ff << 52); -#if defined(__GNUC__) && LJ_TARGET_X86 && __pic__ - /* Compensate for unbelievable GCC pessimization. */ - { - volatile U64double u1; - u1.u64 = (uint64_t)0x3f8 << 52; - return u.d - u1.d; - } -#else - return u.d - 1.0; -#endif + return u.d; } /* PRNG initialization function. */ @@ -146,7 +137,7 @@ LJLIB_CF(math_random) TW223State *tw = (TW223State *)(uddata(udataV(lj_lib_upvalue(L, 1)))); double d; if (LJ_UNLIKELY(!tw->valid)) tw223_init(tw, 0.0); - d = tw223_step(tw); + d = tw223_step(tw) - 1.0; if (n > 0) { double r1 = lj_lib_checknum(L, 1); if (n == 1) { --+HP7ph2BbKc20aGI-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:30:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BUofm026087; Mon, 2 Nov 2009 09:30:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13FB71A6BE; Mon, 2 Nov 2009 09:29:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A389188B4 for ; Mon, 2 Nov 2009 09:29:25 -0200 (BRST) Received: by pxi2 with SMTP id 2so3284346pxi.11 for ; Mon, 02 Nov 2009 03:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=S9t0HvsecL+g6WJx7lIUVys8GSgpuoOYYcFlOjTH59Y=; b=mwpyHhRM67ezy11VNK4r0zwaPln9ZMYtPMoTFsmVTcjntFmQH5HYA4QFChrZEnO7ll oy+KDVg27vgALC5JAanMOFiy4HNVeGy15iIJQmxC8mj6AMac9bfuj8Q+W56YTI9xtHTB QA1hqqW9LiQfxqoEjPXf7cbmCgrUe40yJkKwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=CdW92ffT/ryWmDWiUloP8ITaP8oWo7LXWDqH1mJJW/e32CUGl+U5PmZYehB1P3rplT OVa1JP+syWm41zPp5dkKviIbyHER+VH1/8NN0BaHQ5I4IoiRqPRkimAEb0jiEXYpfmAG O1hweI5myGCVSUiLsBvEhMuvTngVdKyt/QfQ8= MIME-Version: 1.0 Received: by 10.142.195.7 with SMTP id s7mr622280wff.293.1257161422087; Mon, 02 Nov 2009 03:30:22 -0800 (PST) In-Reply-To: <20091102102430.GA20637@mike.de> References: <20091030051104.GA23082@mike.de> <20091030070922.GA28084@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> <20091102102430.GA20637@mike.de> Date: Mon, 2 Nov 2009 19:30:22 +0800 X-Google-Sender-Auth: 7e8482971be27c69 Message-ID: <3c7535c80911020330v2d1a2958g40ee31c977915cc2@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean LUA_API int lua_pcall(lua_State *L, int nargs, int nresults, int errfunc); May Mike Pall explain where errfunc is stored in frame? I cannot figure out it when digging into source code of LJ2. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:31:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BVawc026216; Mon, 2 Nov 2009 09:31:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A47771A6D0; Mon, 2 Nov 2009 09:30:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF36C188E9 for ; Mon, 2 Nov 2009 09:30:18 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id 16so812087fgg.17 for ; Mon, 02 Nov 2009 03:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=+lFiSJ7LtY9Ibv01YMj2CkojD6pD8DzjMfJ15Gm6iPM=; b=ihs4SzznAHnEMKRbNW/QVNweeckqN3d+Agh6QQm1PIc8v0LFG9pfQkTiMMW5qa+nGN /RTFnhTxJQjd3Y6k/sHPKQLqAStqyIBG9fNUMcBtBln0bZvq2vhs0oaQ0UvsGFAUM2EA jbOFbVfoWtaPoh+bqTOhv0tX9+CPLE6WEsako= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=dW0s1i8yNy3BDzSEQTnHTYy02M2Ipv0rYykV+KFi6EMLZ53i5C3eZeL4hMh+Pf4apk dYssxlogN708l/zUnwPAnOAsUMD1qIQfyvZyYQGgGscl9WH1VTRSmMF0c52mK/YX3lvQ ERoIINE96IPL2uRQHJdJH3x7IBj2Vt0wJDvsw= Received: by 10.103.125.23 with SMTP id c23mr2091928mun.41.1257161473423; Mon, 02 Nov 2009 03:31:13 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 14sm8945322muo.15.2009.11.02.03.31.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Nov 2009 03:31:12 -0800 (PST) Date: Mon, 2 Nov 2009 14:24:22 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <546306733.20091102142422@gmail.com> To: Mike Pall Subject: Re: Benchmark shootout shows LuaJIT 2.0 (was Re: [ANN] LuaJIT-2.0.0-beta1) In-Reply-To: <20091101161504.GA8498@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> <20091101161504.GA8498@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Mike, Sunday, November 1, 2009, 7:15:04 PM, you wrote: > Only the hand-vectorized stuff in C and C++ is faster. Guess I > need to add auto-vectorization. Well, maybe next week ... ;-) with Larrabee support, please :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:36:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BaR4v026656; Mon, 2 Nov 2009 09:36:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A918818ED1; Mon, 2 Nov 2009 09:35:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9979418E5E for ; Mon, 2 Nov 2009 09:35:08 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4vCe-0000ub-00; Mon, 02 Nov 2009 12:36:04 +0100 Date: Mon, 2 Nov 2009 12:35:54 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102113554.GA23098@mike.de> References: <20091031225554.GA30341@mike.de> <4AEEB6DC.1050503@exactcode.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4AEEB6DC.1050503@exactcode.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean René Rebe wrote: > I updated the T2 SDE package, web view at: Umm, isn't it a bit early for a distro release? :-) But, anyway, thanks for the work! > http://www.t2-project.org/packages/luajit.html The info text at the top of the page is outdated -- you can cut'n'paste something from the new web pages, if you want. And ... maybe I just didn't see it, but if you pass a different PREFIX for the Makefile, you need to patch the module paths in luaconf.h, too. The convention from Debian's Lua package is to add both /usr/local/... and /usr/... to the module paths (in this order). Note that the LuaJIT-version-specific path must be after the current-dir path, but before /usr/local/.... Oh, and I haven't yet documented, that LuaJIT can also be compiled as an amalgamation with the 'make amalg' target. This reduces total code size and speeds up the JIT compiler. The only drawback is that this causes GCC to consume *a lot* of memory during the build. But I assume your build box is big enough, so I think it would be a good option for binary distros. There are some changes to the build process ahead. E.g. I want to build a shared library by default. But I need to consult with all of the distro maintainers first (I want a *common* name for the shared library). You'll get mail sometime in the coming weeks. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:39:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BdAuu026998; Mon, 2 Nov 2009 09:39:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F41918FAA; Mon, 2 Nov 2009 09:37:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EE3118E78 for ; Mon, 2 Nov 2009 09:37:50 -0200 (BRST) MailScanner-NULL-Check: 1257766725.25706@SwY9SN+QkhcKCtLZ5p466A Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA2BcgjJ001119 for ; Mon, 2 Nov 2009 09:38:43 -0200 Message-ID: <4AEEC4AF.2090009@inconcertcc.com> Date: Mon, 02 Nov 2009 09:38:23 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Diego Nehab wrote: > Hi All, > > The new candidate release for LuaSocket 2.0.3 is available > for download from > > > http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/luasocket-2.0.3-rc2.zip > Does the NEW file inside describes what's new in this version or it hasn't been updated yet? Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:53:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2BrD53029074; Mon, 2 Nov 2009 09:53:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D90F51A6D5; Mon, 2 Nov 2009 09:51:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7DCB190C7 for ; Mon, 2 Nov 2009 09:51:32 -0200 (BRST) Received: by ewy26 with SMTP id 26so4785262ewy.5 for ; Mon, 02 Nov 2009 03:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=wMWFgkhCHpr86gJRggLOxs45P7FiR2vGLxTVEhH7kgo=; b=QKf+uQCtRjksDYQJIBQsvnCqR8phhhI90mOPml3DWAP0t5Ww6v+GaLbyhb9mnL9+sj aaWMjeLo/JAEwf2aTBcanPKZyfaG9PVr7kzhFBqP/B5zNkKlS2Lrfe4+fJcJB4aM1a9t R2HE9J5K8mwssyqqIDWAH64OOHFJczF5Jn6Fo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=p/Dq1sS7OalcF2pWcbNG+MGWlnLZsW8YqQRoehsOEzPac/8sR4QT9hIH3NSQTw2+Vu A4r8Y0vLglt5eqF6ErNxuEQMgRkcUCFyj96yxTvXu0Q817QBjVFjrytxroy3MAupafq0 j2mIKPPjCwwq+68Bh0DWutVxBqmtSd7wCVoiU= MIME-Version: 1.0 Received: by 10.216.87.206 with SMTP id y56mr1016906wee.207.1257162747277; Mon, 02 Nov 2009 03:52:27 -0800 (PST) In-Reply-To: <20091102101704.GA8174@mike.de> References: <20091102101704.GA8174@mike.de> Date: Mon, 2 Nov 2009 06:52:25 -0500 Message-ID: Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike, many sincere thanks for your gratuitous gift to the community!! I think that you have been one of the legends of the Lua development and LuaJIT is a testament to this. Some people speculated that Mike Pall is Lua's version of a "Bourbaki" group -- a nickname for a group of talented mathematicians disguising their identities under a collective pen-name:-) Once in a while messages about "real Mike Pall" pop up on this list. Without invading your privacy, could you please, add a human face to the code and dispel the misconceptions. Best Regards, --Leo-- P.S. With apologies for celebrity thirsty modern culture and top-posting your message. On 2009-11-02, Mike Pall wrote: > It has been brought to my attention that it might be advantageous > for some parts of the research community and the open source > community, that I make a public statement about the intellectual > property (IP) contained in LuaJIT 2.0 and earlier versions: > > I hereby declare any and all of my own inventions contained in > LuaJIT to be in the public domain and up for free use by anyone > without payment of any royalties whatsoever. > > [Note that the source code itself is licensed under a permissive > license and is not placed in the public domain. But this is an > orthogonal issue.] > > I cannot guarantee it to be free of third-party IP however. In > fact nobody can. Writing software has become a minefield and any > moderately complex piece of software is probably (unknowingly to > the author) encumbered by hundreds of dubious patents. This > especially applies to compilers. The curent IP system is broken > and software patents must be abolished. Ceterum censeo. > > The usual form of disclosure is to write papers and publish them. > I'm sorry, but I don't have the time for this right now. But I > would consider publishing open source software as a form of > disclosure. > > In the interest of anyone doing research on virtual machines, > compilers and interpreters, I've compiled a list of some of the > new aspects to be found in LuaJIT 2.0. I do not claim all of them > are original (I cannot possibly know all of the literature), but > my research indicates that many of them are quite innovative. > > This also presents some research opportunities for 3rd parties. > I have little use for academic merits myself -- I'm more interested > in coding than writing papers. Anyone is welcome to dig out any > aspects, explore them in detail and publish them (giving due credit). > > Design aspects of the VM: > > - NaN-tagging: 64 bit tagged values are used for stack slots and > table slots. Unboxed floating-point numbers (doubles) are > overlayed with tagged object references. The latter can be > distinguished from numbers via the use of special NaNs as tags. > It's a remote descendant of pointer-tagging. > > [The idea dates back to 2006, but I haven't disclosed it before > 2008. Special NaNs have been used to overlay pointers before. > Others have used it for tagging later on. The specific layout is > of my own devising.] > > - Low-overhead call frames: The linear, growable stack implicitly > holds the frame structure. The tags for the base function of > each call frame hold a linked structure of frames, using no > extra space. Calls/returns are faster due to lower memory > traffic. This also allows installing exception handlers at zero > cost (it's a special bit pattern in the frame link). > > Design of the IR (intermediate representation) used by the compiler: > > - Linear, pointer-free IR: The typed IR is SSA-based and highly > orthogonal. An instruction takes up only 64 bits. It has up to > two operands which are 16 bit references. It's implemented with > a bidirectionally growable array. No trees, no pointers, no cry. > Heavily optimized for minimal D-cache impact, too. > > - Skip-list chains: The IR is threaded with segregated, per-opcode > skip-list chains. The links are stored in a multi-purpose 16 bit > field in the instruction. This facilitates low-overhead lookup > for CSE, DSE and alias analysis. Back-linking enables short-cut > searches (average overhead is less than 1 lookup). Incremental > build-up is trivial. No hashes, no sets, no complex updates. > > - IR references: Specially crafted IR references allow fast const > vs. non-const decisions. The trace recorder uses type-tagged > references (a form of caching) internally for low-overhead > type-based dispatch. > > - High-level IR: A single, uniform high-level IR is used across > all stages of the compiler. This reduces overall complexity. > Careful instruction design avoids any impact on low-level CSE > opportunities. It also allows cheap and effective high-level > semantic disambiguation for memory references. > > Design of the compiler pipeline: > > - Rule-based FOLD engine: The FOLD engine is primarily used for > constant folding, algebraic simplifications and reassociation. > Most traditional compilers have an evolutionary grown set of > implicit rules, spread over thousands of hand-coded tiny > conditionals. > > The rule-based FOLD engine uses a declarative approach to > combine the first and second level of lookup. It allows wildcard > lookup with masked keys, too. A pre-processor generates a > semi-perfect hash table for constant-time rule lookup. It's able > to deal with thousands of rules in a uniform manner without > performance degradation. A declarative approach is also much > easier to maintain. > > - Unified stage dispatch: The FOLD engine is the first stage in > the compiler pipeline. Wildcard rules are used to dispatch > specific instructions or instruction types (loads, stores, > allocations etc.) to later optimization stages (load forwarding, > DSE etc.). Unmatched instructions are passed on to CSE. > > Unified stage dispatch facilitates modular and pluggable > optimizations with only local knowledge. It's also faster than > doing multiple dispatches in every stage. > > Trace compiler: > > - NLF region-selection: The trace heuristics use a natural-loop > first (NLF) region-selection mechanism to come up with a > close-to optimal set of (looping) root traces. Only special > bytecode instructions trigger new root traces -- regular > conditionals never do this. Root traces that leave the loop are > aborted and retried later. This also gives outer loops a chance > to inline inner loops with a low trip count. > > NLF usually generates a superior set of root traces than the > MRET/NET (next-executing tail) and LEI (last-executed iteration) > region-selection mechanisms known from the literature. > > - Hashed profile counters: Bytecode instructions to trigger the > start of a hot trace use low-overhead hashed profiling counters. > The profile is imprecise because collisions are ignored. The > hash table is kept very small to reduce D-cache impact (only two > hot cache lines). Since NLF weeds out most false positives, this > doesn't deteriorate hot trace detection. > > [Neither using hashed profile counters, nor imprecise profiling, > nor using profiling to detect hot loops is new. But the specific > combination may be original.] > > - Code sinking via snapshots: The VM must be in a consistent state > when a trace exits. This means that all updates (stores) to the > state (stack or objects) must track the original language > semantics. > > Naive trace compilers achieve this by forcing a full update of > the state to memory before every exit. This causes many on-trace > stores and seriously diminishes code quality. > > A better approach is to sink these stores to compensation code, > which is only executed if the trace exits are actually taken. > A common solution is to emit actual code for these stores. But > this causes code cache bloat and the information often needs to > be stored redundantly, for linking of side traces. > > Code sinking via snapshots allows sinking of arbitrary code > without the overhead of the other approaches. A snapshot stores > a consistent view of all updates to the state before an exit. If > an exit is taken the on-trace machine state (registers and spill > slots) and the snapshot can be used to restore the VM state. > > State restoration using this data-driven approach is slow of > course. But repeatedly taken side exits quickly trigger the > generation of side traces. The snapshot is used to initialize > the IR of the side trace with the necessary state using > pseudo-loads. These can be optimized together with the remainder > of the side trace. The pseudo-loads are unified with the machine > state of the parent trace by the backend to enable zero-cost > linking to side traces. > > [Currently snapshots only allow store sinking of scalars. It's > planned to extend this to allow arbitrary store and allocation > sinking, which together with store forwarding would be a unique > way to achieve scalar-replacement of aggregates.] > > - Sparse snapshots: Taking a full snapshot of all state updates > before every exit would need a considerable amount of storage. > Since all scalar stores are sunk, it's feasible to reduce the > snapshot density. The basic idea is that it doesn't matter which > state is restored on a taken exit, as long as it's consistent. > > This is a form of transactional state management. Every snapshot > is a commit; a taken exit causes a rollback to the last commit. > The on-trace state may advance beyond the last commit as long as > this doesn't affect the possibility of a rollback. In practice > this means that all on-trace updates to the state (non-scalar > stores that are not sunk) need to force a new snapshot for the > next exit. > > Otherwise the trace recorder only generates a snapshot after > control-flow constructs that are present in the source, too. > Guards that have a low probability of being wrongly predicted do > not cause snapshots (e.g. function dispatch). This further > reduces the snapshot density. Sparse snapshots also improve > on-trace code quality, because they reduce the live range of the > results of intermediate computations. Scheduling decisions can > be made over a longer stream of instructions, too. > > [It's planned to switch to compressed snapshots. 2D-compression > across snapshots may be able to remove even more redundancy.] > > Optimizations: > > - Hash slot specialization: Hash table lookup for constant keys is > specialized to the predicted hash slot. This avoids a loop to > follow the hash chain. Pseudocode: > > HREFK: if (hash[17].key != key) goto exit > HLOAD: x = hash[17].value > -or- > HSTORE: hash[17].value = x > > HREFK is shared by multiple HLOADs/HSTOREs and may be hoisted > independently. The verification of the prediction (HREFK) is > moved out of the dependency chain by a super-scalar CPU. This > makes hash lookup as cheap as array lookup with minimal complexity. > > It also avoids all the complications (cache invalidation, > ordering constraints, shape mismatches) associated with hidden > classes (V8) or shape inference/property caching (TraceMonkey). > > - Code hoisting via unrolling and copy-substitution (LOOP): > Traditional loop-invariant code motion (LICM) is mostly useless > for the IR resulting from dynamic languages. The IR has many > guards and most subsequent instructions are control-dependent on > them. The first non-hoistable guard would effectively prevent > hoisting of all subsequent instructions. > > The LOOP pass does synthetic unrolling of the recorded IR, > combining copy-substitution with redundancy elimination to > achieve code hoisting. The unrolled and copy-substituted > instructions are simply fed back into the compiler pipeline, > which allows reuse of all optimizations for redundancy > elimination. Loop recurrences are detected on-the-fly and a > minimized set of PHIs is generated. > > - Narrowing of numbers to integers: Predictive narrowing is used > for induction variables. Demand-driven narrowing is used for > index expressions using a backpropagation algorithm. > > This avoids the complexity associated with speculative, eager > narrowing, which also causes excessive control-flow dependencies > due to the many overflow checks. Selective narrowing is better > at exploiting the combined bandwidth of the FP and integer units > of the CPU and avoids clogging up the branch unit. > > Register allocation: > > - Blended cost-model for R-LSRA: The reverse-linear-scan register > allocator uses a blended cost model for its spill decisions. > This takes into account multiple factors (e.g. PHI weight) and > benefits from the special layout of IR references (constants > before invariant instructions, before variant instructions). > > - Register hints: The register allocation heuristics take into > account register hints, e.g. for loop recurrences or calling > conventions. This is very cheap to implement, but improves the > allocation decisions considerably. It reduces register shuffling > and prevents unnecessary spills. > > - x86-specific improvements: Special heuristics for move vs. > rename produce close to optimal code for two-operand machine > code instructions. > > Fusion of memory operands into instructions is required to > generate high-quality x86 code. Late fusion in the backend > allows better, local decisions, based on actual register > pressure, rather than estimates of prior stages. > > Ok, that's it! Sorry for the length of this posting, but I hope it > was at least informative to someone out there. > > > --Mike > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 09:54:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Bs7Xr029200; Mon, 2 Nov 2009 09:54:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D9341A6DD; Mon, 2 Nov 2009 09:52:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A0C61A6D6 for ; Mon, 2 Nov 2009 09:52:45 -0200 (BRST) Received: by ywh40 with SMTP id 40so4387096ywh.33 for ; Mon, 02 Nov 2009 03:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=nKGkuR+sDMukgVPwGGTcpQ3QtZ5NOKd9UvHHG7wTro8=; b=eHROYslHi7V8iDVQYMQbzK+aCxptS6TIjFxNsVk1o/lYH8pngYDTR1828s0gLcDGnv fyGUC7pYX6Fn4F9p7Itud4raVV321Yn3KjznkUAcYBgDgWQ9bFXnc8unMiw6O7dsL6W7 mSojtrY5675fpNswNoLstBmt0gQzAkr05HF2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=MpZ9gy9g+OnrIwPsZmGDQ2l30k5xFsGG9sv/Hmtbn4dXv2tUjLntEzl+mNJm6IHIrR sJT5s3FAS9Cb0qHUay88t0MuC0Zs0N9wdRRJfmKbTFtkXW6YFgjmaqbz5i5c1nO4OUzp +he5uN9AySbbqJ/OtpUWw+KGsu0x/1jUMaO/g= MIME-Version: 1.0 Received: by 10.90.45.11 with SMTP id s11mr8595908ags.72.1257162821093; Mon, 02 Nov 2009 03:53:41 -0800 (PST) In-Reply-To: <20091101180155.GA12403@mike.de> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> <20091101180155.GA12403@mike.de> Date: Mon, 2 Nov 2009 17:53:40 +0600 X-Google-Sender-Auth: 7ca94384bc12f93f Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2Bs7Xr029200 > > I need to add auto-vectorization for that. Other than that, it's > already a killer: someone just sent me a private mail where it > outperformed Java on heavily numerical code (real use case, not a > synthetic benchmark). > I am curious what was JVM's weak side here (assuming that measurements/configuration etc are flawless). Maybe that person will consider sharing his experiences? I am pretty sure both worlds might benifit from that. Also there were some benchmarks[1] showing that HotSpot-Server is not the fastest JVM around. It might be interesting to test the very same number crunching app on JRockit or Excelsior JET. PS. BTW, Mike your code is a very insightful reading. Thank you. [1] http://www.stefankrause.net/wp/?p=9; methodology of the benchmarking was not flawless, so results should be interpreted with caution. -- e.v.e On Mon, Nov 2, 2009 at 12:01 AM, Mike Pall wrote: > David Given wrote: >> I assume what you're using here are hand-translated versions of the >> SciMark benchmarks to each of the various languages? Is it: >> >> http://luajit.org/download/scimark.lua >> >> ...? What about the C version? I'd be interested to run it through Clue >> and see what happens. > > http://math.nist.gov/scimark2/download.html > >> Incidentally, I have tried to compare LuaJIT 2 with V8, but V8 doesn't >> seem to want to build easily these days. Last time I tried it I recall >> that it wasn't particularly fast compared to LuaJIT 1 anyway! > > http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=luajit&lang2=v8&box=1 > > Looks like V8 is only faster on the only recursive and allocation- > heavy benchmark in there. And it's much slower on all others. > Even LJ1 was often faster than V8. > > Also check the ranking here: >  http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&box=1 > >  1.00  C++ >  1.02  C >  1.62  Java steady state >  1.86  Java >  2.11  Fortran >  2.32  ==> LuaJIT <== >  2.56  C# Mono >  .... >  9.77  JavaScript V8 >  .... > 30.18  Ruby JRuby > 34.22  JavaScript TraceMonkey > 43.62  Ruby > 44.45  Python > 66.51  Perl > > Ok, kicking Fortran will be easy. Next victim: Java. > >> Anyway, it's very good to see this out, and it's impressively fast. It'd >> be very interesting to try doing traditionally high-CPU tasks with >> LuaJIT 2 and to see how well it works; > > I need to add auto-vectorization for that. Other than that, it's > already a killer: someone just sent me a private mail where it > outperformed Java on heavily numerical code (real use case, not a > synthetic benchmark). > >> I work in the mobile phone >> industry and it is *frightening* how shoddy the code tends to be. It'd >> be really nice to move away from traditional languages like C and C++ >> and towards scripting languages like Lua. >> >> Now I just have to wait for an ARM version... > > Well, waiting is not a good tactic. > > Collect requirements (desired number type, target architectures, > VFP or not etc.), collect funding, gather people who'd like to > work on it. In short: let me not drown in administrative stuff. > I'm more efficient at designing/coding. > > [Sorry for the rant, please don't take it personally.] > > --Mike > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:09:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2C9dbc030671; Mon, 2 Nov 2009 10:09:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5264E1A6DE; Mon, 2 Nov 2009 10:08:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mr01.hansenet.de (mr011.hansenet.de [85.183.254.144]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D44841A6BE for ; Mon, 2 Nov 2009 10:08:12 -0200 (BRST) Received: from exactcode.de (85.183.32.143) by mr01.hansenet.de (8.0.026) id 4ABC83D20042B1F3 for lua@bazar2.conectiva.com.br; Mon, 2 Nov 2009 13:09:08 +0100 Received: from [192.168.2.173] (helo=[192.168.2.173]) by exactcode.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.54) id 1N4viZ-0000ZW-LY for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 12:09:08 +0000 Message-ID: <4AEECBDC.2030401@exactcode.de> Date: Mon, 02 Nov 2009 13:09:00 +0100 From: =?ISO-8859-1?Q?Ren=E9_Rebe?= User-Agent: Thunderbird 2.0.0.21 (X11/20090417) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <4AEEB6DC.1050503@exactcode.de> <20091102113554.GA23098@mike.de> In-Reply-To: <20091102113554.GA23098@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.1 (----) X-Spam-Report: Spam detection software, running on the system "exactcode.de", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Mike, Mike Pall wrote: > René Rebe wrote: > >> I updated the T2 SDE package, web view at: >> > > Umm, isn't it a bit early for a distro release? :-) > But, anyway, thanks for the work! > > Well, my trust in your coding skills :-) And that's the SVN/trunk of T2, so ... there still is the last stable release available in the T2 7.0 release series: [...] Content analysis details: (-4.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.5 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Mike, Mike Pall wrote: > René Rebe wrote: > >> I updated the T2 SDE package, web view at: >> > > Umm, isn't it a bit early for a distro release? :-) > But, anyway, thanks for the work! > > Well, my trust in your coding skills :-) And that's the SVN/trunk of T2, so ... there still is the last stable release available in the T2 7.0 release series: http://www.t2-project.org/packages/7.0/luajit.html >> http://www.t2-project.org/packages/luajit.html >> > > The info text at the top of the page is outdated -- you can > cut'n'paste something from the new web pages, if you want. > > And ... maybe I just didn't see it, but if you pass a different > PREFIX for the Makefile, you need to patch the module paths in > luaconf.h, too. > > The convention from Debian's Lua package is to add both > /usr/local/... and /usr/... to the module paths (in this order). > Note that the LuaJIT-version-specific path must be after the > current-dir path, but before /usr/local/.... > > Oh, and I haven't yet documented, that LuaJIT can also be compiled > as an amalgamation with the 'make amalg' target. This reduces > total code size and speeds up the JIT compiler. > > The only drawback is that this causes GCC to consume *a lot* of > memory during the build. But I assume your build box is big > enough, so I think it would be a good option for binary distros. > > There are some changes to the build process ahead. E.g. I want to > build a shared library by default. But I need to consult with all > of the distro maintainers first (I want a *common* name for the > shared library). You'll get mail sometime in the coming weeks. > Thanks for the notes, I removed the outdated coco reference with the "innovative trace compiler et al." note from your site. Have fun, -- René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10785 Berlin http://exactcode.de | http://t2-project.org | http://rene.rebe.name From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:17:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CHJEf031449; Mon, 2 Nov 2009 10:17:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85BE31A6E0; Mon, 2 Nov 2009 10:16:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC0F61A6BE for ; Mon, 2 Nov 2009 10:15:59 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4vqC-0000wB-00; Mon, 02 Nov 2009 13:16:56 +0100 Date: Mon, 2 Nov 2009 13:16:49 +0100 From: Mike Pall To: Lua list Subject: Re: Benchmark shootout shows LuaJIT 2.0 (was Re: [ANN] LuaJIT-2.0.0-beta1) Message-ID: <20091102121649.GA24359@mike.de> References: <20091031225554.GA30341@mike.de> <560972290911010109w72d39192ha7feea0149cc1307@mail.gmail.com> <20091101161504.GA8498@mike.de> <546306733.20091102142422@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <546306733.20091102142422@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin wrote: > > Only the hand-vectorized stuff in C and C++ is faster. Guess I > > need to add auto-vectorization. Well, maybe next week ... ;-) > > with Larrabee support, please :) I prefer to wait until Intel gets their act together, the silicon performs well and there's an actual market for it. You know, in the past I had the displeasure of porting some stuff to Itanium and I think it never went live ... That said, trace compilers are especially well suited to non-monolithic architectures (like GPGPU, Larrabee or Cell). Here's the basic idea: A general-purpose CPU or a dedicated controller runs the interpreter and collects traces. When a cluster of sufficiently hot traces has been generated, they are analyzed for suitability to the special-purpose processing units (e.g. high number of FPU ops and not too branchy). If yes, the trace cluster is recompiled for the SPU architecture (heterogeneous archs pose no problem). After distribution to the SPUs it (hopefully) runs much faster. It helps that traces are much more linear than regular code and represent only a minimal hot subset of the code. FYI: A very unscientific survey showed that one might get away with a trace cache of 8K-16K in many cases. This would also put TCM to good use in cache-challenged CPUs. Hyperblock scheduling should increase the opportunities for SPU execution, because it replaces branches with predicated execution. To unlock the full potential of most architectures, one would need some support for concurrent execution in the VM, too. [And no, these are just some nice research ideas and not a goal for LuaJIT anytime soon.] --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:22:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CMR1b032021; Mon, 2 Nov 2009 10:22:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52B0E188DB; Mon, 2 Nov 2009 10:21:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EFEC118592 for ; Mon, 2 Nov 2009 10:21:07 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4vvA-0000wr-00; Mon, 02 Nov 2009 13:22:04 +0100 Date: Mon, 2 Nov 2009 13:21:56 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102122156.GA26098@mike.de> References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> <20091101180155.GA12403@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vyacheslav Egorov wrote: > > I need to add auto-vectorization for that. Other than that, it's > > already a killer: someone just sent me a private mail where it > > outperformed Java on heavily numerical code (real use case, not a > > synthetic benchmark). > > I am curious what was JVM's weak side here (assuming that > measurements/configuration etc are flawless). > > Maybe that person will consider sharing his experiences? I am pretty > sure both worlds might benifit from that. I have politely asked him to publish the code or some excerpt, because I want to analyze it as well. We'll see. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:33:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CXcZf000905; Mon, 2 Nov 2009 10:33:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A85118FCD; Mon, 2 Nov 2009 10:32:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C54318EF2 for ; Mon, 2 Nov 2009 10:32:15 -0200 (BRST) Received: by gxk4 with SMTP id 4so4128597gxk.8 for ; Mon, 02 Nov 2009 04:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=yKbpE7uDJ4r0AEV9RQV2Yh4HlAIVUIOQ7b1tnw5Zi2I=; b=xm52Gj8JsVWkJHXCl04bHXXtJhqUpiZ8Y3+JZZDBQzjx6wOEMbhbzkttygiOCxQkxF FTiw1i8kfAgGdgK0oiUPZNiVIGwHWDD45gB8S+K5mmUR4P5aqr7DJWvh7gNXux972tZc 5BhSI8jdZuo6sk8IvoVmNTIrvYKCHrhvZNC2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Epulu7/ORh00dsplf9OR4r/3U9E2V2KZlLdtDmcf0m38FyXee3JXL7YRu5rK9IPK97 QWSjgJNGemZ3bMZyDNMa+MAgoxOUgriX0jKapXk2uOau+IEEE4oescpoOo5iQuz62RYq ICrEW40pGmqpqXDWplMxfNman2fUJ7mnWfj7A= MIME-Version: 1.0 Received: by 10.90.17.29 with SMTP id 29mr2482993agq.79.1257165191602; Mon, 02 Nov 2009 04:33:11 -0800 (PST) In-Reply-To: <3c7535c80911020330v2d1a2958g40ee31c977915cc2@mail.gmail.com> References: <20091030051104.GA23082@mike.de> <3c7535c80910300035p796228b9xfa58d1c47a97d686@mail.gmail.com> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> <20091102102430.GA20637@mike.de> <3c7535c80911020330v2d1a2958g40ee31c977915cc2@mail.gmail.com> Date: Mon, 2 Nov 2009 18:33:11 +0600 X-Google-Sender-Auth: e21119173fd9a3dc Message-ID: Subject: Re: LuaJIT roadmap 2008 question From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Take a look at cframe_errfunc in lj_frame.h. As far as I understand errfunc (converted to a "relative position" by savestack) just keeps lying on stack where it was passed to lj_vm_pcall (lj_api.c:880). So it can be later retrieved during stack walk just as a 4th frame argument. If you are interested about other cases it seems relevant to look at finderrfunc (lj_err.c:489). -- e.v.e On Mon, Nov 2, 2009 at 5:30 PM, tankxx wrote: > LUA_API int lua_pcall(lua_State *L, int nargs, int nresults, int errfunc); > > May Mike Pall explain where errfunc is stored in frame? I cannot > figure out it when digging into source code of LJ2. > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:37:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Cbm2s001319; Mon, 2 Nov 2009 10:37:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 618251888B; Mon, 2 Nov 2009 10:36:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CAFB7190F7 for ; Mon, 2 Nov 2009 10:36:27 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4wA0-0000yQ-00; Mon, 02 Nov 2009 13:37:24 +0100 Date: Mon, 2 Nov 2009 13:36:50 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities Message-ID: <20091102123650.GB26098@mike.de> References: <20091102101704.GA8174@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > Some people speculated that Mike Pall is Lua's version of a "Bourbaki" > group -- a nickname for a group of talented mathematicians disguising > their identities under a collective pen-name:-) Heck, I've done the opposite. There's quite a bit of code out there which I haven't published under my real name (for various reasons). Not any Lua stuff, though. Good luck hunting it down. ;-) > Without invading your privacy, could you please, add a human face to > the code and dispel the misconceptions. I know enough about the Internet not to do this. But you'd be surprised for sure. > P.S. With apologies for celebrity thirsty modern culture and > top-posting your message. The former I can easily ignore. The latter is inexcusable. It's not just the top-posting that makes it bad. It's the full-quote. In Germany we call it TOFU (text oben, full-quote unten) and once upon a time it gave reason for death penalty on Usenet. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:54:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CsWgC003173; Mon, 2 Nov 2009 10:54:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E85FE1A6D7; Mon, 2 Nov 2009 10:53:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 435721A6CA for ; Mon, 2 Nov 2009 10:53:06 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nA2Cs1bd009203 for ; Mon, 2 Nov 2009 13:54:01 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAK9l7krDbohc/2dsb2JhbADafIQ5BA Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 02 Nov 2009 13:53:42 +0100 Received: from [192.168.127.128] (host86-55-dynamic.0-87-r.retail.telecomitalia.it [87.0.55.86]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nA2CrfCT046541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Nov 2009 13:53:43 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AEED651.2010802@erix.it> Date: Mon, 02 Nov 2009 13:53:37 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities References: <20091102101704.GA8174@mike.de> <20091102123650.GB26098@mike.de> In-Reply-To: <20091102123650.GB26098@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > In Germany we call it TOFU (text oben, full-quote unten) and once > upon a time it gave reason for death penalty on Usenet. You said too much. Now we just have to show a subtly flawed piece of Lua code to every German resident, so that the real Mike Pall could not resist revealing itself by correcting it. Enrico From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:55:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CttWt003350; Mon, 2 Nov 2009 10:55:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28E441A6E2; Mon, 2 Nov 2009 10:54:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BD361A6CA for ; Mon, 2 Nov 2009 10:54:34 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nA2CtUsd010403 for ; Mon, 2 Nov 2009 13:55:30 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOtl7krDbohb/2dsb2JhbADbBIQ5BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 02 Nov 2009 13:55:30 +0100 Received: from [192.168.127.128] (host86-55-dynamic.0-87-r.retail.telecomitalia.it [87.0.55.86]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nA2CtT3l028249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Nov 2009 13:55:30 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AEED6BE.1030804@erix.it> Date: Mon, 02 Nov 2009 13:55:26 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities References: <20091102101704.GA8174@mike.de> <20091102123650.GB26098@mike.de> <4AEED651.2010802@erix.it> In-Reply-To: <4AEED651.2010802@erix.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > itself Himself, sorry. (or is it herself?) Enrico From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 10:57:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2CvYeQ003528; Mon, 2 Nov 2009 10:57:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B27F41A6E5; Mon, 2 Nov 2009 10:56:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F0A71A6CA for ; Mon, 2 Nov 2009 10:56:17 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4wTB-00010A-00; Mon, 02 Nov 2009 13:57:13 +0100 Date: Mon, 2 Nov 2009 13:57:08 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2.0 bug Message-ID: <20091102125708.GA26909@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Lawrence E. Bakst wrote: > for k,v in pairs(fields) do res[v] = math.sqrt(res[v]) end; That isolated line doesn't crash here, no matter how hard I try. > [1] 95226 segmentation fault luajit -jdump=b ktest.lua Please recompile LuaJIT with debug info. Enable this line: CCDEBUG= -g and this line (if you have GDB 7.0 or higher) in src/Makefile: XCFLAGS+= -DLUAJIT_USE_GDBJIT Then do 'make clean && make'. Now run the recompiled luajit executable under GDB: gdb --args ./luajit ktest.lua At the GDB prompt type 'run'. After the crash it should print the C file + line where the problem is. I need the output of 'bt', too. And I may need to know a bit more context, like the values of some local variables in the vicinity of the crash. But we'll have to see. If it crashes in a location called something like TRACE_31 (only visible with GDB 7.0), then I need to see the full code of that particular trace. Assuming the code is deterministic, just rerun with -jdump=bim,foo.dump, cut out that particular trace from foo.dump and send it to me please. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:06:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2D6uFQ004492; Mon, 2 Nov 2009 11:06:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 294A11A6E9; Mon, 2 Nov 2009 11:05:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D91371A6CA for ; Mon, 2 Nov 2009 11:05:33 -0200 (BRST) Received: from know-smtpout-1.server.virginmedia.net ([62.254.123.1]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091102130629.XSNP17277.mtaout03-winn.ispmail.ntl.com@know-smtpout-1.server.virginmedia.net> for ; Mon, 2 Nov 2009 13:06:29 +0000 Received: from [78.146.110.250] (helo=taboche) by know-smtpout-1.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1N4wc8-0006ep-TM for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 13:06:29 +0000 From: Thomas Lauer To: Lua list Subject: [ANN] Idle v1.0 Date: Mon, 02 Nov 2009 13:06:33 +0000 Organization: TL Message-ID: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=SFBYNVl0AAAA:8 a=OllfqT8u64yH-erbD3AA:9 a=SRxLN4zcaoXScnhSRNhUvkWJ67QA:4 a=I-Q4fQThMMMA:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2D6uFQ004492 After more than two years of development, I am happy to announce the release of Idle version 1.0. See http://idle.thomaslauer.com for details about Idle and http://idle.thomaslauer.com/IdleDownload.html for downloads. Idle is a compact, powerful scripting language based on Lua 5.1. It is available for Windows 2000 and later systems (a Linux/BSD/... release is neither available nor planned). Idle is released under the MIT licence. Anyone interested in the upcoming source code release please drop me a quick note as I a looking for a few volunteers to torture with a preliminary release of the sources. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:09:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2D98YY004704; Mon, 2 Nov 2009 11:09:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C76131A6EB; Mon, 2 Nov 2009 11:07:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D60881A678 for ; Mon, 2 Nov 2009 11:07:42 -0200 (BRST) Received: by ewy26 with SMTP id 26so4857356ewy.5 for ; Mon, 02 Nov 2009 05:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=k9YRBFU7EOMSOJLbt2AADzun+85y/C7nqrwXKiBDxtc=; b=bmAICtc4p0GIQcCn/8czE4uw+Tcl3OzJhbWYSrGlEmJneUbWYEapvTtOE9jCC43eRa tEhWBQcw8QCW8jekVsBLTObBuJX9B7GWLBwa7iprC5ZDK/HNV6451EMRrhW1AJYqyhr2 GLpZBgYmgPB1nQJhCZqG8tTi0TRoTiIYA2M9M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=ksseK4QvoSgubOvXVSXB3tRSwuDTD9GCpAsZNrSa9L8k7K9q/eXkW31gsFC/PhRh/g Jg2W7B1y3vNcvo5hOVneBzo7qbNn4c/whaG2HB9P4FRWz5meSSa9RPi4fFsAo1xEDjzu ByseqMvolBunYXSAZDJE83d3iXBM7CMPCmjas= MIME-Version: 1.0 Received: by 10.216.89.146 with SMTP id c18mr4530632wef.84.1257167317946; Mon, 02 Nov 2009 05:08:37 -0800 (PST) In-Reply-To: <20091102123650.GB26098@mike.de> References: <20091102101704.GA8174@mike.de> <20091102123650.GB26098@mike.de> Date: Mon, 2 Nov 2009 08:08:37 -0500 Message-ID: Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Mike Pall wrote: > [..snip..] > The former I can easily ignore. The latter is inexcusable. It's > not just the top-posting that makes it bad. It's the full-quote. > In Germany we call it TOFU (text oben, full-quote unten) and once > upon a time it gave reason for death penalty on Usenet. > > --Mike Bitte, sparen Sie mein Leben! Ich werde das nie wieder tun! --Leo-- P.S. In English: Please, spare my life! I would never do it again! From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:11:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DBcf7004926; Mon, 2 Nov 2009 11:11:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E29661A6EF; Mon, 2 Nov 2009 11:10:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A02F51A6CA for ; Mon, 2 Nov 2009 11:10:19 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1N4wgF-0003A1-VT for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 15:10:44 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> Date: Mon, 02 Nov 2009 15:11:08 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091031225554.GA30341@mike.de> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Looking at lj_str_new. Just curious, was there something wrong with that fast string hash patch that used Jenkins' hash? From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:13:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DDc6G005292; Mon, 2 Nov 2009 11:13:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 751B51A6F5; Mon, 2 Nov 2009 11:12:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C81E81A6F0 for ; Mon, 2 Nov 2009 11:12:18 -0200 (BRST) Received: by pxi2 with SMTP id 2so3334813pxi.11 for ; Mon, 02 Nov 2009 05:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=9FNoxJgPOUIdk3VvZemXksvDTvSK5ikEtvjSB4Mhaak=; b=xyyYxtcRybF85CnaficBrONC9z0oydEDw6JnvQYZvVtXLxisugnzKhriJF5MqNC9r2 fKhTCvpanf16yscjdHRK5XDgzGBVDOb/B9ci4A0OpfrrtLe87vnZ6b6IUNaCL3LccPqn 42buMOfIxSZ2vZNIUQV721E8q1ncnhyFc87vE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=lgSHmWgRhZDq4wqJth2sdcTdQXJmzFp6Fb/uSMyGT+xshPL6UOyW2XqqKaXMA4zpPI QYVvzhQ/snM9AFmz8cEM5fAILfDjQZr3uV5dH+L4qWGP19iK77EIdIeiT8i7xrwgAp6J rbLDuyRmeyUeej1RA4onw56gm1ZQ+2hEmt0fk= MIME-Version: 1.0 Received: by 10.142.59.6 with SMTP id h6mr657177wfa.25.1257167594853; Mon, 02 Nov 2009 05:13:14 -0800 (PST) In-Reply-To: References: <20091030051104.GA23082@mike.de> <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> <20091102102430.GA20637@mike.de> <3c7535c80911020330v2d1a2958g40ee31c977915cc2@mail.gmail.com> Date: Mon, 2 Nov 2009 21:13:14 +0800 X-Google-Sender-Auth: 82a4b2260820d6b8 Message-ID: <3c7535c80911020513v536a7221meec3cef991c40cac@mail.gmail.com> Subject: Re: LuaJIT roadmap 2008 question From: tankxx To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean If the errfunc is stored in C stack, the pcall is non-resumable. That is it doesn't allow yield across it. Is my understanding correct? From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:21:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DLhhO006235; Mon, 2 Nov 2009 11:21:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 844E91A6F9; Mon, 2 Nov 2009 11:20:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0DBB1A6F6 for ; Mon, 2 Nov 2009 11:20:23 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4wqW-00011T-00; Mon, 02 Nov 2009 14:21:20 +0100 Date: Mon, 2 Nov 2009 14:21:12 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102132112.GA27625@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> <20091101210128.GA22817@mike.de> <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Steven Johnson wrote: > Sure, I'll see what I can do. This is embedded in a pretty big program and > I think I've got meetings and such this week, so it might be a few days > getting around to it. The beta phase will take quite a bit longer than that. Take your time. :-) > I tried a run with a jit.off() call at the beginning and got similar results. Ah, ok. Looks like some problem with the Lua/C API calls then. Strange enough, but all of the key functions involved (module(), luaL_register, luaL_findtable etc.) are the few remaining ones that are still identical to the Lua codebase. > It does not seem particularly fond of looping over package.loaders (as evidenced > by the abrupt end of the dump once package.loaded closes), and this is true > even when I dump only that table. On the other hand, I can iterate it > without trouble > in the command line, so maybe I've stepped on something. Umm, have you checked your usage of lua_next() is correct? In particular the stack adjustment during and after the traversal. > I applied the patch beforehand. I do use negative indices, and worse still > pseudo-indices (mea maxima culpa). I have since gotten rid of the latter, > so far as a quick search revealed, though I'll have to give it a more thorough > check when I've had some rest. I'll probably have to support all kinds of indexes for the luaL_* functions. It's more widespread than I had thought. Compatibility with the quirks of the Lua implementation seems more important here than following the specification. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:24:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DOclR006537; Mon, 2 Nov 2009 11:24:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AEA41A6FB; Mon, 2 Nov 2009 11:23:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 506771A6BE for ; Mon, 2 Nov 2009 11:23:14 -0200 (BRST) Received: by ewy26 with SMTP id 26so4874943ewy.5 for ; Mon, 02 Nov 2009 05:24:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type; bh=8cce752O1Syu5kDN52xvUnaqIIox4iNM2WuWg2NY9NU=; b=RG/NblMVOFQd7RnMH9GPWMzKT1FvF53A+/z3mqLAqd5C3nqhXLTAHjyGhAYivObxte V/Iug+EbAHhdSPI+h8J2hxbWHnoKcFFdkb38cFWrviMpOmRjqCPQkszYF9lZ4CZLzVhs V3FD34gOfUkDhrL8ojt8hYhOaIhgbxLRuNpVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; b=H4tAN5sYsdXk86CK9Ti6KK4mn/ciRU56NoxlF7dCD8Q2RpoPs094wJj95ysE7ujc0Z 3qJRUPR/rTNLOA8As6XIU7g7TyuDL7YLC0L+LTNqIfJSfxG9iiNny+vCraueX9tSmEhY /wJ3/ltzWIZYLi1wye9E85mctHUaYlo+SUaM8= MIME-Version: 1.0 Received: by 10.216.87.206 with SMTP id y56mr1152477wee.207.1257168249825; Mon, 02 Nov 2009 05:24:09 -0800 (PST) Date: Mon, 2 Nov 2009 08:24:09 -0500 Message-ID: Subject: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-01, Mike Pall wrote: > [..snip..] > The shootout site now shows LuaJIT 2: > > http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&d=data&gpp=on&java=on&luajit=on&v8=on&calc=calculate&box=1 > > As I've already said in a reddit comment: > > Heh, it beats Intel Fortran on two numeric benchmarks (mandelbrot > and spectralnorm). :-) > [..snip..] > > --Mike By beating Fortran in few instances and coming reasonably close to C/C++ performance on numerics LuaJIT-2 is becoming a viable candidate for heavy number crunching applications. How difficult it is to add native Complex numbers to LuaJIT (C-99 compatible)? By native I mean as little overhead over lua_Number as possible. --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:25:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DPgU1006677; Mon, 2 Nov 2009 11:25:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 255E91A6FC; Mon, 2 Nov 2009 11:24:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B9BB1A6D0 for ; Mon, 2 Nov 2009 11:24:24 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4wuO-000126-00; Mon, 02 Nov 2009 14:25:20 +0100 Date: Mon, 2 Nov 2009 14:25:16 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102132516.GA28881@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Juris Kalnins wrote: > Looking at lj_str_new. > Just curious, was there something wrong with that fast string hash patch > that used Jenkins' hash? Not with the hash per-se but with the selection of the characters to hash. It badly hashed strings that contained URLs. Since I presume this is a common use case, I pulled it. I didn't have the time to come up with something better (yet). :-/ --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:27:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DRICU006845; Mon, 2 Nov 2009 11:27:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2642D1A6FE; Mon, 2 Nov 2009 11:26:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 36DE11A6BE for ; Mon, 2 Nov 2009 11:26:00 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4wvw-00012W-00; Mon, 02 Nov 2009 14:26:56 +0100 Date: Mon, 2 Nov 2009 14:26:47 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102132647.GB28881@mike.de> References: <20091031225554.GA30341@mike.de> <20091101012826.49fd7140.tmueller@schulze-mueller.de> <20091101020943.GA8663@mike.de> <20091101023229.GA10905@mike.de> <4AEEA213.2090108@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEEA213.2090108@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cheng, Long wrote: > Simular problem here, our code passes registry index to luaL_checkxxx > and failed on LJ2. The following code snippet segfaults on the "printf" > line with LJ2 on debian 5.0. I'll change the code to accept all kinds of indexes for LuaL_*. Patch will follow soon. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:31:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DVlX2007662; Mon, 2 Nov 2009 11:31:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C4311A702; Mon, 2 Nov 2009 11:30:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D2C21A6D7 for ; Mon, 2 Nov 2009 11:30:27 -0200 (BRST) Received: by bwz27 with SMTP id 27so6303989bwz.21 for ; Mon, 02 Nov 2009 05:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=LbGM1Fy/e0xg6KCN+jGQubiptJUrEMshXhLIG030iwc=; b=D/f0fkkH271i3y8z3XTNWFewV/vQQMVxMhiUCoR+KfIgJ0QYqEgzzJ19SCxXCMWib1 ZjxSDhfEFowvgj0WHYk6loDv6G1c4LLLmdaOuyfl1RoJA85j2+1JmfEcNGJHKcTY//8H LxxBRqVtMwJMNGgoNDjUndrsVK9oWHJ7gy6s4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=sYZknx10Q2Pew6CiixwxymWkB8k1gGJBNoAgF22KH1ULFfeXdqHuvsQkQUc+n1KeHA kotNdsqC8mjwN/NHB8axXIRjL5idDVcZYCHabadjJgkf/tbvdYR0EScWhlaxuaKN+qiz v1ojXGU5OjFzBcpiP0K9axZFanp2dRKZj698c= Received: by 10.102.236.11 with SMTP id j11mr2125964muh.3.1257168679429; Mon, 02 Nov 2009 05:31:19 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id y6sm10619825mug.10.2009.11.02.05.31.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Nov 2009 05:31:18 -0800 (PST) Date: Mon, 2 Nov 2009 16:24:12 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <838449882.20091102162412@gmail.com> To: Mike Pall Subject: Re[2]: [ANN] LuaJIT-2.0.0-beta1 In-Reply-To: <20091101005139.GA5687@mike.de> References: <20091031225554.GA30341@mike.de> <20091031235449.6574c9e2@trite.i.flarn.net.i.flarn.net> <20091101005139.GA5687@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Mike, Sunday, November 1, 2009, 3:51:39 AM, you wrote: > I'm not sure if it's a good idea to collect lots of small donations > from individuals. This would cost me too much time (I have to write a > proper invoice, put it into accounting etc.). Well, ok, if there's > some way to shield me from this (e.g. a proxy) ... if you live in proper country, you can create Business PayPal account and accept donations -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:41:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DfdGb008525; Mon, 2 Nov 2009 11:41:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 843C81A6E9; Mon, 2 Nov 2009 11:40:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 332FA1A678 for ; Mon, 2 Nov 2009 11:40:17 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4x9l-00013K-00; Mon, 02 Nov 2009 14:41:13 +0100 Date: Mon, 2 Nov 2009 14:40:14 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT roadmap 2008 question Message-ID: <20091102134014.GA28988@mike.de> References: <20091030074515.GA6700@mike.de> <3c7535c80910301958k38d9e349ic7adc7928654ba2@mail.gmail.com> <20091031060420.GA4698@mike.de> <3c7535c80911010223w17f57e58g9bf17fde82035c69@mail.gmail.com> <20091101170638.GA10614@mike.de> <3c7535c80911020131g3ac48b7ds3764cda35ff3900b@mail.gmail.com> <20091102102430.GA20637@mike.de> <3c7535c80911020330v2d1a2958g40ee31c977915cc2@mail.gmail.com> <3c7535c80911020513v536a7221meec3cef991c40cac@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7535c80911020513v536a7221meec3cef991c40cac@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean tankxx wrote: > If the errfunc is stored in C stack, the pcall is non-resumable. That > is it doesn't allow yield across it. Is my understanding correct? We're talking about lua_pcall(). This sets up a FRAME_CP and that's not resumable indeed. But pcall() and xpcall() (the Lua library functions) don't use it. They set up a FRAME_PCALL/FRAME_PCALLH (*). And xpcall() in particular flips its first two arguments, so the error function is left below the callee. If an error is thrown, the frames are traversed backwards to find the innermost error function. The size of the pcall frame (1 or 2) is used to distinguish betwen pcall() and xpcall(). In the latter case the error function is fetched from below the callee frame. (*) The FRAME_PCALLH variant is used when hooks are blocked before the pcall(). I had no bit left anywhere to store this info. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:42:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Dg7qj008618; Mon, 2 Nov 2009 11:42:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D9E41A703; Mon, 2 Nov 2009 11:40:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 342741A678 for ; Mon, 2 Nov 2009 11:40:28 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N4x9p-0004Ta-KG for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 14:41:17 +0100 Received: from p5b2c2616.dip.t-dialin.net ([91.44.38.22]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 14:41:17 +0100 Received: from dak by p5b2c2616.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 14:41:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities Date: Mon, 02 Nov 2009 14:40:53 +0100 Organization: Organization?!? Lines: 24 Message-ID: <877hu9t57e.fsf@lola.goethe.zz> References: <20091102101704.GA8174@mike.de> <20091102123650.GB26098@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2616.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:ERWIWKAfjuSobZhRWeV1Rrh/08Q= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov writes: > On 2009-11-02, Mike Pall wrote: >> [..snip..] >> The former I can easily ignore. The latter is inexcusable. It's >> not just the top-posting that makes it bad. It's the full-quote. >> In Germany we call it TOFU (text oben, full-quote unten) and once >> upon a time it gave reason for death penalty on Usenet. >> >> --Mike > > Bitte, sparen Sie mein Leben! Ich werde das nie wieder tun! > > --Leo-- > > P.S. In English: Please, spare my life! I would never do it again! No, the English version of what you wrote would be more or less: "Please, put my life into a savings account. I shall do that never again!" -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:51:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DpVmu009786; Mon, 2 Nov 2009 11:51:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B99B1A708; Mon, 2 Nov 2009 11:50:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9A2F2321B3 for ; Mon, 2 Nov 2009 11:50:07 -0200 (BRST) Received: by ewy26 with SMTP id 26so4904505ewy.5 for ; Mon, 02 Nov 2009 05:51:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=jYQjO5nG/CCkLZZ0bgixeafvoBfSD2VtoR8/Q1i/2DM=; b=FdZKOYOF1PJxu9i/UlNWUMYcIvB0rWgJZPCMYmwu3AC10rgtMLKq/p7JqtfIhK2t7v dCpYqQmdcDjWRszTXF7AnAHA5loUK+QJQtZJZjlvR47iUvUYw6rXH1u6ElM7HR8aTalA 2IvQVmKk1ypwch7X8SOe4WyKDWa7p1PgAzcFM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=OjkLfSDvRt6A4ntpX93bNwyOAlaBQ9LD4e2DMcodKARnmTVDY8i3CmoANyYuobcyTG yAtCl9dJDN8BPrR5DNKXs5Eq8W5ZdEwGREGC+650mhvvhDOxeeDiHzvyat3LMBW8HZ0o ARaExa1zTQL0JQbym+6sYCnzjTDI8ZqVakjX4= MIME-Version: 1.0 Received: by 10.216.87.67 with SMTP id x45mr4684846wee.18.1257169862513; Mon, 02 Nov 2009 05:51:02 -0800 (PST) In-Reply-To: <877hu9t57e.fsf@lola.goethe.zz> References: <20091102101704.GA8174@mike.de> <20091102123650.GB26098@mike.de> <877hu9t57e.fsf@lola.goethe.zz> Date: Mon, 2 Nov 2009 08:51:02 -0500 Message-ID: Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, David Kastrup wrote: > Leo Razoumov writes: > > > On 2009-11-02, Mike Pall wrote: > >> [..snip..] > >> The former I can easily ignore. The latter is inexcusable. It's > >> not just the top-posting that makes it bad. It's the full-quote. > >> In Germany we call it TOFU (text oben, full-quote unten) and once > >> upon a time it gave reason for death penalty on Usenet. > >> > >> --Mike > > > > Bitte, sparen Sie mein Leben! Ich werde das nie wieder tun! > > > > --Leo-- > > > > P.S. In English: Please, spare my life! I would never do it again! > > > No, the English version of what you wrote would be more or less: > > "Please, put my life into a savings account. I shall do that never > again!" > > -- > > David Kastrup bummer, I should have looked it up in a German dictionary. --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 11:57:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2DvJ4P010428; Mon, 2 Nov 2009 11:57:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 20C7F1A70C; Mon, 2 Nov 2009 11:56:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4D931A678 for ; Mon, 2 Nov 2009 11:55:54 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4xOr-00015D-00; Mon, 02 Nov 2009 14:56:49 +0100 Date: Mon, 2 Nov 2009 14:56:43 +0100 From: Mike Pall To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091102135643.GA29657@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > How difficult it is to add native Complex numbers to LuaJIT (C-99 compatible)? > By native I mean as little overhead over lua_Number as possible. Without causing undue trouble to the VM, they would have to be boxed (in a userdata or an even smaller container). And one would have to add a special kind of array type to store them, because storing boxed values in a table is just too much overhead for numerical programs. That would be pretty slow in the interpreter (one allocation for every arithmetic result). But the JIT compiler could do transparent boxing/unboxing to reduce the overhead in many (but not all) cases. To be really effective this also needs allocation sinking, but that's planned anyway. If you want to embark on that adventure yourself, I suggest to wait until LJ2 has gained support for both allocation sinking and arrays holding low-level data types (a Complex would just be a "struct { double re, im; }"). --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 12:15:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2EFU6h012013; Mon, 2 Nov 2009 12:15:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8850B1908D; Mon, 2 Nov 2009 12:14:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 289DA18F13 for ; Mon, 2 Nov 2009 12:14:07 -0200 (BRST) Received: by ewy26 with SMTP id 26so4931475ewy.5 for ; Mon, 02 Nov 2009 06:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=zMabrOpgnf5jeiY20nbiNLsOM7pFI6Xjr5WQHXpAtFE=; b=wsBKVMJLBnmja1Fr7UL2wQitbYZhsL08rkIlIxu8LxK+JbYgXUgXswEQavXqNIdfYo aew+2It/+kSnWSbyKnykLJf6PACqF/2WmdVS6hx7f8mXTyEx6oGEPHs5HpXUyJVU1VsD Ipnetod7T8h7rkXxmCP2qjKLWevxGaRKT2VM8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=FJ1fK0sVTQ9wG6uSaqxy4gc9qSY/116xNODId6PsBSofLLIcb4xGNOMRVh7T1ARLXX FbCx22AYx8+Ux+IbqZLFjJUAJL6q0G491dTDAacv/VKw9smgM9DVpsT1oLWeZH3sWKCZ IPTov+6Jgq1GcLOcieWgLwF0vsEmGeSmhf774= MIME-Version: 1.0 Received: by 10.216.93.66 with SMTP id k44mr4540989wef.67.1257171303997; Mon, 02 Nov 2009 06:15:03 -0800 (PST) In-Reply-To: <20091102135643.GA29657@mike.de> References: <20091102135643.GA29657@mike.de> Date: Mon, 2 Nov 2009 09:15:03 -0500 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Mike Pall wrote: > Leo Razoumov wrote: > > How difficult it is to add native Complex numbers to LuaJIT (C-99 compatible)? > > By native I mean as little overhead over lua_Number as possible. > > [..snip..] > But the JIT compiler could do transparent > boxing/unboxing to reduce the overhead in many (but not all) cases. > To be really effective this also needs allocation sinking, but > that's planned anyway. > > If you want to embark on that adventure yourself, I suggest to > wait until LJ2 has gained support for both allocation sinking and > arrays holding low-level data types (a Complex would just be a > "struct { double re, im; }"). > > --Mike Mike, I would like to give it a try. I implemented complex numbers as userdata for the Lua interpreter. But userdata is allocated on the heap and, thus, is too slow for tight loops commonly found in numerics. Bringing down box/unbox overhead could save the day. Also I am a bit worried about function dispatch. Adding two doubles is a native Lua opcode and it does not go through the trouble of metamethods. Using __add, __mul, etc metamethods dispatch for complex numbers is slow. Could it be avoided? --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 12:34:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2EYuC0014721; Mon, 2 Nov 2009 12:34:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 269DE19276; Mon, 2 Nov 2009 12:33:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from un.b-et-a.de (trick.b-et-a.de [87.230.102.10]) by bazar2.conectiva.com.br (Postfix) with SMTP id 603CE1924D for ; Mon, 2 Nov 2009 12:33:28 -0200 (BRST) Received: (qmail 22507 invoked by uid 600); 2 Nov 2009 14:34:23 -0000 Date: Mon, 2 Nov 2009 15:34:21 +0100 From: Klaus Ripke To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091102143421.GD15824@fand.local> Mail-Followup-To: Lua list References: <20091102135643.GA29657@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean hi On Mon, Nov 02, 2009 at 09:15:03AM -0500, Leo Razoumov wrote: > Also I am a bit worried about function dispatch. Adding two doubles is > a native Lua opcode and it does not go through the trouble of > metamethods. Using __add, __mul, etc metamethods dispatch for complex > numbers is slow. Could it be avoided? Hmm, I reckon where you want fast complex numbers, you might prefer a VM with complex as the basic numeric type? After all others are just special cases. cheers From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 12:40:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2EeALi015297; Mon, 2 Nov 2009 12:40:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A93251A65F; Mon, 2 Nov 2009 12:38:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F5BD1924D for ; Mon, 2 Nov 2009 12:38:45 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEANJ97krLzkTU/2dsb2JhbACRJssfhDkEglY X-IronPort-AV: E=Sophos;i="4.44,667,1249228800"; d="scan'208";a="576573259" Received: from unknown (HELO Mania) ([203.206.68.212]) by outbound.icp-qv1-irony-out2.iinet.net.au with SMTP; 02 Nov 2009 22:39:38 +0800 Message-ID: From: "Alex Davies" To: "Lua list" References: <20091102135643.GA29657@mike.de> <20091102143421.GD15824@fand.local> In-Reply-To: <20091102143421.GD15824@fand.local> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootoutshows LuaJIT 2.0] Date: Mon, 2 Nov 2009 22:39:23 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Mon, Nov 02, 2009 at 09:15:03AM -0500, Leo Razoumov wrote: > Also I am a bit worried about function dispatch. Adding two doubles is > a native Lua opcode and it does not go through the trouble of > metamethods. Using __add, __mul, etc metamethods dispatch for complex > numbers is slow. Could it be avoided? Well you could code the metamethods in Lua and have LuaJit inline them. - Alex From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 12:44:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2EiK7g015735; Mon, 2 Nov 2009 12:44:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 678C81A6D7; Mon, 2 Nov 2009 12:43:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D00BC1A678 for ; Mon, 2 Nov 2009 12:42:55 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4y8O-0001E0-00; Mon, 02 Nov 2009 15:43:52 +0100 Date: Mon, 2 Nov 2009 15:43:28 +0100 From: Mike Pall To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091102144328.GA31649@mike.de> References: <20091102135643.GA29657@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > I would like to give it a try. I implemented complex numbers as > userdata for the Lua interpreter. But userdata is allocated on the > heap and, thus, is too slow for tight loops commonly found in > numerics. > Bringing down box/unbox overhead could save the day. Yes, the JIT compiler ought to be able to remove the overhead in tight loops. It might not work too well for branchy loops, though. > Also I am a bit worried about function dispatch. Adding two > doubles is a native Lua opcode and it does not go through the > trouble of metamethods. Using __add, __mul, etc metamethods > dispatch for complex numbers is slow. Could it be avoided? That's an issue for the interpreter, yes. But the JIT compiler treats metamethod dispatch like any other table lookup. It's usually able to disambiguate it, to hoist it and so on. [If the complex data type were to be defined as a special kind of userdata, the JIT compiler could shortcut the dispatch even under more difficult circumstances.] To see the metamethod dispatch hoisting, try this program: local t = {} for i=1,100 do t[i] = tostring(i) end local x = 0 for i=1,100 do x = x + t[i]:len() end print(x) The dispatch in the second loop first involves a lookup of the "__index" table in the string metatable. Then "len" is looked up in this table and the resulting function (string.len) is called. Ok, so run it with: luajit -jdump=im test.lua Here's the loop part of the second trace: ->LOOP: f7f21e20 cmp edi, ecx // Array bounds check f7f21e22 jnb 0xf7f1a010 ->2 f7f21e28 cmp dword [eax+edi*8+0x4], -0x05 // Type check for array load f7f21e2d jnz 0xf7f1a010 ->2 f7f21e33 mov esi, [eax+edi*8] // temp1 = t[i] f7f21e36 xorps xmm6, xmm6 f7f21e39 cvtsi2sd xmm6, [esi+0xc] // temp2 = #temp1 f7f21e3e addsd xmm7, xmm6 // x = x + temp2 f7f21e42 add edi, +0x01 f7f21e45 cmp edi, +0x64 f7f21e48 jle 0xf7f21e20 ->LOOP f7f21e4a jmp 0xf7f1a014 ->3 Pretty short, eh? As you can see, all dispatch has been hoisted. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 13:06:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2F6fhD018463; Mon, 2 Nov 2009 13:06:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58B3D1A6FF; Mon, 2 Nov 2009 13:05:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 982F3321B3 for ; Mon, 2 Nov 2009 13:05:14 -0200 (BRST) Received: by bwz27 with SMTP id 27so6404712bwz.21 for ; Mon, 02 Nov 2009 07:06:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LLRcixdkJq1X5TtobE0yyBQ0UeI0S/SuaN8YfYUWm10=; b=BJOXhEWJnChweJkWMUC3nG54fLjaOT/KdGbxSUMHvoWMQSivLlhMtx6QVGacQtWr2S 5y9w19fUPBdsLLzVgBvkfuN4z16WK0m+vRL/SF2La9V69Dki4d+12hWPbO2cDkvjGN7I uASHSMgXoBGgvBcXldWH1JUz6woadgt+k1L88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=blTB9YeB46wELONCiln1wW5nmy85ns8Do66Sf+DCDDJaqdXsF+bv39cOAua99OeA9a 16VuDIxTpcAkf34vXrX5pYTjiOP3E6NgS2Z9uFj26EuDk7wdVB1m3h9JaY3K2cTvPYsx DxS+b8NlX8cT5UoXHTHR+cPlL+G4C6L4qSkOI= MIME-Version: 1.0 Received: by 10.204.36.202 with SMTP id u10mr4009209bkd.196.1257174370275; Mon, 02 Nov 2009 07:06:10 -0800 (PST) In-Reply-To: <20091102135643.GA29657@mike.de> References: <20091102135643.GA29657@mike.de> Date: Mon, 2 Nov 2009 16:06:09 +0100 Message-ID: <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/2 Mike Pall > Without causing undue trouble to the VM, they would have to be > boxed (in a userdata or an even smaller container). And one would > have to add a special kind of array type to store them, because > storing boxed values in a table is just too much overhead for > numerical programs. Hi, I think that native support for complex numbers would be a *great* plus for numerical calculations. I think also that complex numbers should be supported, if possible, as a native type just like Asko's LNUM patch is doing. Also, I'm not sure that you need a struct to represent complex number, in C99 they are a native type just like 'int' or 'double' I guess anyway that integration with the LuaJIT VM can absolutely non trivial. Otherwise, me too, I'm impressed by your work and I have a small unrelated question. I was wondering if the JIT compiler is also able to optimise Lua functions called with 'lua_call' from within a C library code (called, in turn, from Lua top level). Thank you a lot in any case for sharing your work! Francesco From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 13:16:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2FGUxO019509; Mon, 2 Nov 2009 13:16:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6E941A709; Mon, 2 Nov 2009 13:15:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A65071A703 for ; Mon, 2 Nov 2009 13:15:05 -0200 (BRST) Received: by ewy26 with SMTP id 26so5002291ewy.5 for ; Mon, 02 Nov 2009 07:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=AH2ciVg7qmL4V0ehdomnJ+0s4OawWHykfz7ApEc6m70=; b=TCaxLXAmyx4Fsm9SO8JQqBStPFhQtv8BpLhJsHW7VxxB7N/poNmAGkiywnKZj7mdSB CB3qF9FPQhX/U8VisMfLeekTEkckn23qdxMXuVn1QwvufYhTHw3q/uFTQKhSq8ZCAl6T RBeJeQPZDH1JM4kcaNVMM4KsIs1ZWEKhZpO4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=Pztx2/6KvV3DDDlGAzvuEv+c3cTm6d5QZa5UOTLl590In/n0p+AFyr5EsflnDZNq49 lE7ETn5erwZM5nDTAeA696e3DiMnEPPF15OvfgMpY3am3RsK3wliEmEL3Vzwjf55kqIG Rex/gdrzkVQaEn1fwNCh8r68aG545kgPyBdW8= MIME-Version: 1.0 Received: by 10.216.89.200 with SMTP id c50mr4842353wef.137.1257174945434; Mon, 02 Nov 2009 07:15:45 -0800 (PST) In-Reply-To: <20091102143421.GD15824@fand.local> References: <20091102135643.GA29657@mike.de> <20091102143421.GD15824@fand.local> Date: Mon, 2 Nov 2009 10:15:43 -0500 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Klaus Ripke wrote: > hi > > > On Mon, Nov 02, 2009 at 09:15:03AM -0500, Leo Razoumov wrote: > > Also I am a bit worried about function dispatch. Adding two doubles is > > a native Lua opcode and it does not go through the trouble of > > metamethods. Using __add, __mul, etc metamethods dispatch for complex > > numbers is slow. Could it be avoided? > > > Hmm, I reckon where you want fast complex numbers, > you might prefer a VM with complex as the basic numeric type? > After all others are just special cases. > Actually not! There is a lot of sense in keeping basic numeric type as double and having complex as an additional numeric type. I do not think that x86 and x86-64 have any complex number registers. Therefore, complex number operations are implemented in floating point registers separately for real and imaginary parts. Treating all numbers as complex would add unnecessary overhead in too many cases. Secondly, the entire math library will have to be reimplemented, for it uses double numbers exclusively. --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 13:23:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2FNkGB020323; Mon, 2 Nov 2009 13:23:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6C0E18FF0; Mon, 2 Nov 2009 13:22:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 899C118D75 for ; Mon, 2 Nov 2009 13:22:23 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N4yka-0001JT-00; Mon, 02 Nov 2009 16:23:20 +0100 Date: Mon, 2 Nov 2009 16:23:12 +0100 From: Mike Pall To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091102152312.GA452@mike.de> References: <20091102135643.GA29657@mike.de> <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Francesco Abbate wrote: > I was wondering if the JIT compiler is also able > to optimise Lua functions called with 'lua_call' from within a C > library code (called, in turn, from Lua top level). Yes, if that Lua function contains a loop. No, if you repeatedly call a 'flat' Lua function from C. I.e. if the inner loop is on the C side and the Lua side is just a short non-looping callback (like the comparison function of table.sort). The Lua part of the latter variant could be compiled as a non-looping trace. This is probably going to be added when I add tracing of recursion, because it needs similar support code. But you have to realize that context switches between C and Lua are costly, that nothing can be hoisted out of such a trace and that the compiler cannot optimize the C side and the Lua side together. You are going to get much better performance if you stay on the Lua side for as long as possible. This also applies to upcalls to C functions: avoid them in inner loops written in Lua. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 13:46:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2FkcT4023859; Mon, 2 Nov 2009 13:46:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79C211A70D; Mon, 2 Nov 2009 13:45:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B0981A6D7 for ; Mon, 2 Nov 2009 13:45:09 -0200 (BRST) Received: (qmail 10492 invoked by uid 399); 2 Nov 2009 08:45:59 -0700 Received: from unknown (HELO ?192.168.1.2?) (jjensen@workspacewhiz.com@70.193.102.11) by hsmail.qwknetllc.com with ESMTPAM; 2 Nov 2009 08:45:59 -0700 X-Originating-IP: 70.193.102.11 Message-ID: <4AEEFEB3.3000604@workspacewhiz.com> Date: Mon, 02 Nov 2009 08:45:55 -0700 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: Lua list Subject: LuaJIT 2 and the creation of object files/executables Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean For consoles such as Xbox 360, it is not possible to emit instructions on the fly and pass certification to ship the game. Ignoring the fact that the Xbox 360 is PowerPC-based and therefore incompatible with LuaJIT in its current form, could the code generator be tailored to generate a linkable .obj file with a translation of the Lua code to native instructions? For LuaJIT in its current form, is it a possibility to generate a linkable x86 .obj file or an executable from a Lua script? I have used Lua heavily within a build system, with Lua scripts (often the same) being called hundreds of times from different build processes. Having a native x86 version of the script could save a great deal of time over hundreds of invocations. Thanks. Josh From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 13:47:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2FlBkn023973; Mon, 2 Nov 2009 13:47:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 960B41A712; Mon, 2 Nov 2009 13:45:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF7091A6D7 for ; Mon, 2 Nov 2009 13:45:48 -0200 (BRST) Received: (qmail 10857 invoked by uid 399); 2 Nov 2009 08:46:44 -0700 Received: from unknown (HELO ?192.168.1.2?) (jjensen@workspacewhiz.com@70.193.102.11) by hsmail.qwknetllc.com with ESMTPAM; 2 Nov 2009 08:46:44 -0700 X-Originating-IP: 70.193.102.11 Message-ID: <4AEEFEDD.2@workspacewhiz.com> Date: Mon, 02 Nov 2009 08:46:37 -0700 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: The shortest possible sequence match with Lua regular expressions References: <4AEB4FDC.9050406@workspacewhiz.com> <4AEB7D67.3080106@cowlark.com> In-Reply-To: <4AEB7D67.3080106@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Peter Cawley wrote: >> With the pattern '(/.-/)$', you're asking Lua to match a forward >> slash, then match as few characters as possible such that what then >> follows is a forward slash followed by the end of the string. After >> the first forward slash in the pattern is matched against the first >> forward slash in the input, the minimum amount which can be captured >> to get a forward slash followed by the end of the input is the entire >> of the input. >> > Thank you for the answers. I will forward the information. Josh From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 14:35:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2GZKJd028527; Mon, 2 Nov 2009 14:35:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2CFAB1A70D; Mon, 2 Nov 2009 14:33:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 187A0191AE for ; Mon, 2 Nov 2009 14:33:48 -0200 (BRST) Received: by bwz27 with SMTP id 27so6499520bwz.21 for ; Mon, 02 Nov 2009 08:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kRXbRgnJlBqqRzaqmZvlqQtCBhInxdCdglipS5YV9nk=; b=oFi3NarpPrpFQUh8bU5LN9u6uBfT3Z5llXtBAcuAeJ5FbQQIlFdrj57HWOhPfI4vr/ WZ1fbbaWAQEEMANtIGeMeANNiqEeJf3SkqpnLZRTIWLXaXw56Btit1WFQ9xr8frgBiIu jG75xQlQ3IP1yfd9v5Oct0stnZ3HBm/DPQM7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kYRAWCioF2yx1ona4x+rUZFHLeuoTPIyTi5Tig/vEOOITEhZ/QKZGT4wxqHgET1aHr fgUcGMu+fcplRxfNFUggYs9R5qwxxJ2aiWV7n/t0v1W3ey3Ugrf8J1rAidEIHBfrv0a+ GkMYRj6WEIfZKrp7iAQ38pBZMYa1o4pujozbM= MIME-Version: 1.0 Received: by 10.204.13.198 with SMTP id d6mr4035607bka.188.1257179682871; Mon, 02 Nov 2009 08:34:42 -0800 (PST) In-Reply-To: <20091102152312.GA452@mike.de> References: <20091102135643.GA29657@mike.de> <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> <20091102152312.GA452@mike.de> Date: Mon, 2 Nov 2009 17:34:42 +0100 Message-ID: <4ff79edb0911020834w259f703n8fa151a2e0cd0e86@mail.gmail.com> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/2 Mike Pall : > No, if you repeatedly call a 'flat' Lua function from C. I.e. if > the inner loop is on the C side and the Lua side is just a short > non-looping callback (like the comparison function of table.sort). Unfortunately this is actually the case of my code, a simple Lua function called over and over from a library C code. I guees I will have to wait for LuaJIT 3 :-) > But you have to realize that context switches between C and Lua > are costly, that nothing can be hoisted out of such a trace and > that the compiler cannot optimize the C side and the Lua side > together. > > You are going to get much better performance if you stay on the > Lua side for as long as possible. This also applies to upcalls > to C functions: avoid them in inner loops written in Lua. I understand but unfortunately to have everything in Lua for me would mean to rewrite some large and complex, optimised C routines. In particular I'm talking about GSL routines for ODE integration. I don't think I'm not going to rewrite them in Lua :-) thank you very much anyway for the clarifications! Francesco From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 14:45:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2GjWrA029420; Mon, 2 Nov 2009 14:45:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC97219297; Mon, 2 Nov 2009 14:44:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6BC6190FC for ; Mon, 2 Nov 2009 14:44:09 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N501f-0004zM-4b for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 17:45:03 +0100 Received: from c-76-102-15-45.hsd1.ca.comcast.net ([76.102.15.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 17:45:03 +0100 Received: from igouy2 by c-76-102-15-45.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 17:45:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Isaac Gouy Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Mon, 2 Nov 2009 16:32:42 +0000 (UTC) Lines: 33 Message-ID: References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> <20091101180155.GA12403@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 76.102.15.45 (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vyacheslav Egorov gmail.com> writes: -snip- > Also there were some benchmarks[1] showing that HotSpot-Server is not > the fastest JVM around. It might be interesting to test the very same > number crunching app on JRockit or Excelsior JET. > -snip- > > [1] http://www.stefankrause.net/wp/?p=9; methodology of the > benchmarking was not flawless, so results should be interpreted with > caution. -snip- Only one (fannkuch) of the four programs that Stefan Krause borrowed from the benchmarks game shows Excelsior JET much faster than HotSpot. The fifth and final program (himeno) shows Excelsior JET 4x faster and that (outlier?) has an unduly large effect on the mean Stefan Krause shows. Let's be clear - the benchmarks game isn't flawless either! ;-) However, the benchmarks game has been open to incremental improvements over the last 4 or 5 years - in fact, median (more resistant to outliers) and quartiles are shown instead of a mean because someone came and made a persuasive argument. And of course programmers contribute better programs - the Java fannkuch program Stefan Krause borrowed is no longer shown, it's been replaced by 2 faster Java programs. No doubt "someone" will contribute better LuaJIT programs :-) From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 14:56:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2GuddL030400; Mon, 2 Nov 2009 14:56:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B88461A712; Mon, 2 Nov 2009 14:54:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 444FC1926C for ; Mon, 2 Nov 2009 14:54:27 -0200 (BRST) Received: by pwj9 with SMTP id 9so1954160pwj.21 for ; Mon, 02 Nov 2009 08:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Y5cFf9GiFdprO1GN7FFQCfSpBvaUg6fd0z0ZUK722sg=; b=Yx7/VT4qnTvTOqVjzumLubCmSdx8d896Y0iTByEbZdDCfkKfiF6/tlmIAkDvHvmn57 N1N/74h3Y5tViI1Z7vqraPu01jOPJ7j7Bdxekmd0K7rdNcxmcFXm6qzzhg4Jy1H8z9Be o74RvpVeExviQhuKyBV6YNomsKhBE0EJahL4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=b1JARP3FpFnxmopkF93jyaWyucVKE6qn9W71e+9YNDjO6zvl75CXulsghfN3sDyFFb x23NqjOji6WYs2M1MjxU6zPYVu+Xd0iE9JLAYZhz8jaVaQN6gvpuFAk1WtbiZ1CxTGHo amheliNI6mdNSmuGB1NaGnFwkspTe95jvSgwY= MIME-Version: 1.0 Received: by 10.115.101.15 with SMTP id d15mr8925844wam.200.1257180922397; Mon, 02 Nov 2009 08:55:22 -0800 (PST) In-Reply-To: <4AEDDF8A.3050203@inconcertcc.com> References: <7fa0608b0910291620x4db073d4qd01d9873fe3f05a4@mail.gmail.com> <4AEB28E7.3000507@inconcertcc.com> <7fa0608b0910301307g63eb1d36u3271f36c61270cd@mail.gmail.com> <4AEB52B0.4040604@inconcertcc.com> <7fa0608b0910301408ia2e846ev92791df4e7b8e2c7@mail.gmail.com> <4AEB5B61.2010100@inconcertcc.com> <7fa0608b0910301626k761fe0aeib6b2b920f6f06ed4@mail.gmail.com> <7fa0608b0910301636x5a2984c7g544b2733af99d3c9@mail.gmail.com> <4AEDDF8A.3050203@inconcertcc.com> Date: Mon, 2 Nov 2009 10:55:22 -0600 Message-ID: <7fa0608b0911020855k5094ac8di2653fa05f4c0c6a7@mail.gmail.com> Subject: Re: Issues with Lunar while using multiple lunar templated objects. From: Sivan Thiruvengadam To: Lua list Content-Type: multipart/alternative; boundary=0016e64dca144c45570477663e6a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e64dca144c45570477663e6a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable sure i am using lunar. But i might have declared the class as LUNA. but al= l the lunar code is there in the .h file. i do even see those two methods, push and call which are specific to lunar. The following is the full definition of my CLObject class CLObject { public: // Constants static const char className[]; static Luna< CLObject >::RegType methods[]; CLObject :: CLObject (lua_State *L, CLObject * p); // Initialize the pointer CLObject (lua_State *L); ~ CLObject (); int GetType(lua_State *L);//(unsigned char&cType); * int GetListofNumbers(lua_State *L);* *...//some additional methods defined* CObject* real_object; //this is the actual pointer to the C++ class. }; const char CLObject ::className[] =3D "CLObject "; Luna< CLObject >::RegType CLObject ::methods[] =3D { method(CLObject , GetType), method(CLObject , GetListofNumbers), method(CLObject , Instance), method(CLObject , Process), {0,0} }; and during lua intiialize i do call up the following *Luna< CLObject >::Register(L);* The following is the lunar code in my header file which has both of those push and call methods defined. template class Luna { typedef struct { T *pT; } userdataType; public: typedef int (T::*mfp)(lua_State *L); typedef struct { const char *name; mfp mfunc; } RegType; static void Register(lua_State *L) { lua_newtable(L); int methods =3D lua_gettop(L); luaL_newmetatable(L, T::className); int metatable =3D lua_gettop(L); // store method table in globals so that // scripts can add functions written in Lua. lua_pushvalue(L, methods); set(L, LUA_GLOBALSINDEX, T::className); // hide metatable from Lua getmetatable() lua_pushvalue(L, methods); set(L, metatable, "__metatable"); lua_pushvalue(L, methods); set(L, metatable, "__index"); lua_pushcfunction(L, tostring_T); set(L, metatable, "__tostring"); lua_pushcfunction(L, gc_T); set(L, metatable, "__gc"); lua_newtable(L); // mt for method table lua_pushcfunction(L, new_T); lua_pushvalue(L, -1); // dup new_T function set(L, methods, "new"); // add new_T to method table set(L, -3, "__call"); // mt.__call =3D new_T lua_setmetatable(L, methods); // fill method table with methods from class T for (RegType *l =3D T::methods; l->name; l++) { lua_pushstring(L, l->name); lua_pushlightuserdata(L, (void*)l); lua_pushcclosure(L, thunk, 1); lua_settable(L, methods); } lua_pop(L, 2); // drop metatable and method table } // call named lua method from userdata method table static int call(lua_State *L, const char *method, int nargs=3D0, int nresults=3DLUA_MULTRET, int errfunc=3D= 0) { int base =3D lua_gettop(L) - nargs; // userdata index if (!luaL_checkudata(L, base, T::className)) { lua_settop(L, base-1); // drop userdata and args lua_pushfstring(L, "not a valid %s userdata", T::className); return -1; } lua_pushstring(L, method); // method name lua_gettable(L, base); // get method from userdata if (lua_isnil(L, -1)) { // no method? lua_settop(L, base-1); // drop userdata and args lua_pushfstring(L, "%s missing method '%s'", T::className, method); return -1; } lua_insert(L, base); // put method under userdata, args int status =3D lua_pcall(L, 1+nargs, nresults, errfunc); // call metho= d if (status) { const char *msg =3D lua_tostring(L, -1); if (msg =3D=3D NULL) msg =3D "(error with no message)"; lua_pushfstring(L, "%s:%s status =3D %d\n%s", T::className, method, status, msg); lua_remove(L, base); // remove old message return -1; } return lua_gettop(L) - base + 1; // number of results } // push onto the Lua stack a userdata containing a pointer to T object static int push(lua_State *L, T *obj, bool gc=3Dfalse) { if (!obj) { lua_pushnil(L); return 0; } luaL_getmetatable(L, T::className); // lookup metatable in Lua registr= y if (lua_isnil(L, -1)) luaL_error(L, "%s missing metatable", T::className); int mt =3D lua_gettop(L); subtable(L, mt, "userdata", "v"); userdataType *ud =3D static_cast(pushuserdata(L, obj, sizeof(userdataType))); if (ud) { ud->pT =3D obj; // store pointer to object in userdata lua_pushvalue(L, mt); lua_setmetatable(L, -2); if (gc =3D=3D false) { lua_checkstack(L, 3); subtable(L, mt, "do not trash", "k"); lua_pushvalue(L, -2); lua_pushboolean(L, 1); lua_settable(L, -3); lua_pop(L, 1); } } lua_replace(L, mt); lua_settop(L, mt); return mt; // index of userdata containing pointer to T object } // get userdata from Lua stack and return pointer to T object static T *check(lua_State *L, int narg) { userdataType *ud =3D static_cast(luaL_checkudata(L, narg, T::className)); if(!ud) luaL_typerror(L, narg, T::className); return ud->pT; // pointer to T object } private: Luna(); // hide default constructor // member function dispatcher static int thunk(lua_State *L) { // stack has userdata, followed by method args T *obj =3D check(L, 1); // get 'self', or if you prefer, 'this' lua_remove(L, 1); // remove self so member function args start at inde= x 1 // get member function from upvalue RegType *l =3D static_cast(lua_touserdata(L, lua_upvalueindex(1))); return (obj->*(l->mfunc))(L); // call member function } // create a new T object and // push onto the Lua stack a userdata containing a pointer to T object static int new_T(lua_State *L) { lua_remove(L, 1); // use classname:new(), instead of classname.new() T *obj =3D new T(L); // call constructor for T objects push(L, obj, true); // gc_T will delete this object return 1; // userdata containing pointer to T object } // garbage collection metamethod static int gc_T(lua_State *L) { if (luaL_getmetafield(L, 1, "do not trash")) { lua_pushvalue(L, 1); // dup userdata lua_gettable(L, -2); if (!lua_isnil(L, -1)) return 0; // do not delete object } userdataType *ud =3D static_cast(lua_touserdata(L, 1)); T *obj =3D ud->pT; if (obj) delete obj; // call destructor for T objects return 0; } static int tostring_T (lua_State *L) { char buff[32]; userdataType *ud =3D static_cast(lua_touserdata(L, 1)); T *obj =3D ud->pT; sprintf(buff, "%p", (void*)obj); lua_pushfstring(L, "%s (%s)", T::className, buff); return 1; } static void set(lua_State *L, int table_index, const char *key) { lua_pushstring(L, key); lua_insert(L, -2); // swap value and key lua_settable(L, table_index); } static void weaktable(lua_State *L, const char *mode) { lua_newtable(L); lua_pushvalue(L, -1); // table is its own metatable lua_setmetatable(L, -2); lua_pushliteral(L, "__mode"); lua_pushstring(L, mode); lua_settable(L, -3); // metatable.__mode =3D mode } static void subtable(lua_State *L, int tindex, const char *name, const char *mode) { lua_pushstring(L, name); lua_gettable(L, tindex); if (lua_isnil(L, -1)) { lua_pop(L, 1); lua_checkstack(L, 3); weaktable(L, mode); lua_pushstring(L, name); lua_pushvalue(L, -2); lua_settable(L, tindex); } } static void *pushuserdata(lua_State *L, void *key, size_t sz) { void *ud =3D 0; lua_pushlightuserdata(L, key); lua_gettable(L, -2); // lookup[key] if (lua_isnil(L, -1)) { lua_pop(L, 1); // drop nil lua_checkstack(L, 3); ud =3D lua_newuserdata(L, sz); // create new userdata lua_pushlightuserdata(L, key); lua_pushvalue(L, -2); // dup userdata lua_settable(L, -4); // lookup[key] =3D userdata } return ud; } }; Any idea of what could be wrong? Thanks 2009/11/1 Ignacio Burgue=F1o > Sivan Thiruvengadam wrote: > >> I changed the method as you suggested CLObject >> :*GetListofNumbers*(lua_State *L)// >> { >> * >> CLNumList*o =3D new CLNumList(L); >> CLNL*ud =3D static_cast< CLNL*>(lua_newuserdata(L, sizeof(CLNumList))); = // >> create new userdata >> real_object->GetListofNumbers(*o->real_object); //CLObject >> ud->pT =3D o; >> // lua_pushlightuserdata(L, ud); >> // luaL_getmetatable(L, NUMLIST ); >> // lua_setmetatable(L, -2); >> >> * >> *CLNumList::push(L, o);* >> *return 1;* >> *}* >> >> i am receiving this >> >> error C2039: 'push' : is not a member of 'CLNumList' >> > > > Are you sure you're using Lunar ? Lunar adds two methods, call and push, > that I think were not present in Luna, and parts of your code suggests > you're using Luna instead of Lunar. > > Things like this: > > static Luna< CLObject >::RegType methods[]; > > The example at http://lua-users.org/wiki/CppBindingWithLunar says: > static Lunar::RegType methods[]; > > > > --0016e64dca144c45570477663e6a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable =A0sure i am using lunar. But i might have declared the class as LUNA. but = all the lunar code is there in the .h file.=A0i do even see those two metho= ds, push and call which are specific to lunar.
The following is th= e full definition of my=A0CLObject=A0

class=A0CLObject=A0{
public:
<= br>
// Constants
static const char className[];
stati= c Luna<=A0CLObject=A0=A0>::RegType methods[];
CLObject=A0::=A0CLObj= ect=A0(lua_State *L,=A0CLObject=A0* p);
// In= itialize the pointer
CLObject=A0(lua_State *L);
~=A0CLObject=A0();
int GetType(lua_= State *L);//(unsigned char&cType);
=A0=A0 =A0 =A0 =A0 int= =A0GetListofNumbers(lua_State *L);
...//some additional me= thods defined

CObject* real_object; //this is the actual pointer to t= he C++ class.
};

const char=A0CLObject=A0::className[] =3D "CLObject=A0";
Luna<=A0CLObject =A0>::= RegType=A0CLObject=A0::methods[] = =3D {
metho= d(CLObject=A0, =A0GetType),
metho= d(CLObject=A0, =A0GetListofNumbers),
metho= d(CLObject=A0, =A0Instance),
=
metho= d(CLObject=A0, =A0Process),
{0,0} };


and du= ring lua intiialize i do call up the following
Luna<= =A0CLObject =A0>::Register(L);

The followin= g is the lunar code in my header file which has both of those push and call= methods defined.


template <typename T> class L= una {
=A0=A0typedef struct { T *pT; } userdataType;
pub= lic:
=A0=A0typedef int (T::*mfp)(lua_State *L);
=A0=A0t= ypedef struct { const char *name; mfp mfunc; } RegType;

=A0=A0static void Register(lua_State *L) {
= =A0=A0 =A0lua_newtable(L);
=A0=A0 =A0int methods =3D lua_gettop(L= );

=A0=A0 =A0luaL_newmetatable(L, T::className);
=A0=A0 =A0int metatable =3D lua_gettop(L);

=A0=A0 =A0// store method table in globals so that
=A0=A0 =A0// scripts can add functions written in Lua.
=A0= =A0 =A0lua_pushvalue(L, methods);
=A0=A0 =A0set(L, LUA_GLOBALSIND= EX, T::className);

=A0=A0 =A0// hide metatable from Lua getmetatable()
=A0=A0 =A0lua_pushvalue(L, methods);
=A0=A0 =A0set(L, meta= table, "__metatable");

=A0=A0 =A0lua_pus= hvalue(L, methods);
=A0=A0 =A0set(L, metatable, "__index");

=
=A0=A0 =A0lua_pushcfunction(L, tostring_T);
=A0=A0 =A0set(L,= metatable, "__tostring");

=A0=A0 =A0lua= _pushcfunction(L, gc_T);
=A0=A0 =A0set(L, metatable, "__gc");

=A0=A0 =A0lua_newtable(L); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// mt for metho= d table
=A0=A0 =A0lua_pushcfunction(L, new_T);
=A0=A0 = =A0lua_pushvalue(L, -1); =A0 =A0 =A0 =A0 =A0 // dup new_T function
=A0=A0 =A0set(L, methods, "new"); =A0 =A0 =A0 =A0 // add new= _T to method table
=A0=A0 =A0set(L, -3, "__call"); =A0 = =A0 =A0 =A0 =A0 // mt.__call =3D new_T
=A0=A0 =A0lua_setmetatable= (L, methods);

=A0=A0 =A0// fill method table with methods from class T
=A0= =A0 =A0for (RegType *l =3D T::methods; l->name; l++) {
=A0=A0 = =A0 =A0lua_pushstring(L, l->name);
=A0=A0 =A0 =A0lua_pushlight= userdata(L, (void*)l);
=A0=A0 =A0 =A0lua_pushcclosure(L, thunk, 1);
=A0=A0 =A0 =A0l= ua_settable(L, methods);
=A0=A0 =A0}

=A0= =A0 =A0lua_pop(L, 2); =A0// drop metatable and method table
=A0= =A0}

=A0=A0// call named lua method from userdata = method table
=A0=A0static int call(lua_State *L, const char *method,
=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int nargs=3D0, int nresults=3DLUA_MULTRE= T, int errfunc=3D0)
=A0=A0{
=A0=A0 =A0int base =3D lua_= gettop(L) - nargs; =A0// userdata index
=A0=A0 =A0if (!luaL_checkudata(L, base, T::className)) {
=A0= =A0 =A0 =A0lua_settop(L, base-1); =A0 =A0 =A0 =A0 =A0 // drop userdata and = args
=A0=A0 =A0 =A0lua_pushfstring(L, "not a valid %s userda= ta", T::className);
=A0=A0 =A0 =A0return -1;
=A0=A0 =A0}

=A0=A0 =A0lua_pushstring(L, method); =A0 =A0 =A0 =A0 // method name
=
=A0=A0 =A0lua_gettable(L, base); =A0 =A0 =A0 =A0 =A0 =A0 // get method= from userdata
=A0=A0 =A0if (lua_isnil(L, -1)) { =A0 =A0 =A0 =A0 = =A0 =A0// no method?
=A0=A0 =A0 =A0lua_settop(L, base-1); =A0 =A0 =A0 =A0 =A0 // drop userd= ata and args
=A0=A0 =A0 =A0lua_pushfstring(L, "%s missing me= thod '%s'", T::className, method);
=A0=A0 =A0 =A0ret= urn -1;
=A0=A0 =A0}
=A0=A0 =A0lua_insert(L, base); =A0 =A0 =A0 =A0 =A0 =A0 =A0 // put method un= der userdata, args

=A0=A0 =A0int status =3D lua_pc= all(L, 1+nargs, nresults, errfunc); =A0// call method
=A0=A0 =A0i= f (status) {
=A0=A0 =A0 =A0const char *msg =3D lua_tostring(L, -1= );
=A0=A0 =A0 =A0if (msg =3D=3D NULL) msg =3D "(error with no messag= e)";
=A0=A0 =A0 =A0lua_pushfstring(L, "%s:%s status =3D= %d\n%s",
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0T::c= lassName, method, status, msg);
=A0=A0 =A0 =A0lua_remove(L, base)= ; =A0 =A0 =A0 =A0 =A0 =A0 // remove old message
=A0=A0 =A0 =A0return -1;
=A0=A0 =A0}
=A0=A0 =A0ret= urn lua_gettop(L) - base + 1; =A0 // number of results
=A0=A0}

=A0=A0// push onto the Lua stack a userdata containi= ng a pointer to T object
=A0=A0static int push(lua_State *L, T *obj, bool gc=3Dfalse) {
=A0=A0 =A0if (!obj) { lua_pushnil(L); return 0; }
=A0=A0 =A0lu= aL_getmetatable(L, T::className); =A0// lookup metatable in Lua registry
=A0=A0 =A0if (lua_isnil(L, -1)) luaL_error(L, "%s missing meta= table", T::className);
=A0=A0 =A0int mt =3D lua_gettop(L);
=A0=A0 =A0subtable(L, mt= , "userdata", "v");
=A0=A0 =A0userdataType *u= d =3D
=A0=A0 =A0 =A0static_cast<userdataType*>(pushuserdata= (L, obj, sizeof(userdataType)));
=A0=A0 =A0if (ud) {
=A0=A0 =A0 =A0ud->pT =3D obj; =A0// s= tore pointer to object in userdata
=A0=A0 =A0 =A0lua_pushvalue(L,= mt);
=A0=A0 =A0 =A0lua_setmetatable(L, -2);
=A0=A0 =A0= =A0if (gc =3D=3D false) {
=A0=A0 =A0 =A0 =A0lua_checkstack(L, 3)= ;
=A0=A0 =A0 =A0 =A0subtable(L, mt, "do not trash", "k&qu= ot;);
=A0=A0 =A0 =A0 =A0lua_pushvalue(L, -2);
=A0=A0 = =A0 =A0 =A0lua_pushboolean(L, 1);
=A0=A0 =A0 =A0 =A0lua_settable(= L, -3);
=A0=A0 =A0 =A0 =A0lua_pop(L, 1);
=A0=A0 =A0 =A0}
=A0=A0 =A0}
=A0=A0 =A0lua_replace(= L, mt);
=A0=A0 =A0lua_settop(L, mt);
=A0=A0 =A0return m= t; =A0// index of userdata containing pointer to T object
=A0=A0}=

=A0=A0// get userdata from Lua stack and return p= ointer to T object
=A0=A0static T *check(lua_State *L, int narg) {
=A0=A0 =A0us= erdataType *ud =3D
=A0=A0 =A0 =A0static_cast<userdataType*>= (luaL_checkudata(L, narg, T::className));
=A0=A0 =A0if(!ud) luaL_= typerror(L, narg, T::className);
=A0=A0 =A0return ud->pT; =A0// pointer to T object
=A0=A0= }

private:
=A0=A0Luna(); =A0// hide defa= ult constructor

=A0=A0// member function dispatche= r
=A0=A0static int thunk(lua_State *L) {
=A0=A0 =A0// stack has userdata, followed by method args
=A0= =A0 =A0T *obj =3D check(L, 1); =A0// get 'self', or if you prefer, = 'this'
=A0=A0 =A0lua_remove(L, 1); =A0// remove self so m= ember function args start at index 1
=A0=A0 =A0// get member function from upvalue
=A0=A0 =A0RegT= ype *l =3D static_cast<RegType*>(lua_touserdata(L, lua_upvalueindex(1= )));
=A0=A0 =A0return (obj->*(l->mfunc))(L); =A0// call mem= ber function
=A0=A0}

=A0=A0// create a new T object and
=A0=A0// push onto the Lua stack a userdata containing a pointer to= T object
=A0=A0static int new_T(lua_State *L) {

= lua_remove(L, 1); =A0 // use classname:new(), instead of classname.new()
T *o= bj =3D new T(L); =A0// call constructor for T objects
push(L, obj, true); = // gc_T will delete this object
retu= rn 1; =A0 =A0 =A0 =A0 =A0 // userdata containing pointer to T object
<= div>
=

=A0=A0}

=A0=A0// garbage collection metametho= d
=A0=A0static int gc_T(lua_State *L) {
=A0=A0 =A0if (l= uaL_getmetafield(L, 1, "do not trash")) {
=A0=A0 =A0 = =A0lua_pushvalue(L, 1); =A0// dup userdata
=A0=A0 =A0 =A0lua_gettable(L, -2);
=A0=A0 =A0 =A0if (!lua_is= nil(L, -1)) return 0; =A0// do not delete object
=A0=A0 =A0}
=A0=A0 =A0userdataType *ud =3D static_cast<userdataType*>(lua_t= ouserdata(L, 1));
=A0=A0 =A0T *obj =3D ud->pT;
=A0=A0 =A0if (obj) delete obj; = =A0// call destructor for T objects
=A0=A0 =A0return 0;
=A0=A0}

=A0=A0static int tostring_T (lua_State *L= ) {
=A0=A0 =A0char buff[32];
=A0=A0 =A0userdataType *ud =3D static_cast<userdataType*>(lua_to= userdata(L, 1));
=A0=A0 =A0T *obj =3D ud->pT;
=A0=A0= =A0sprintf(buff, "%p", (void*)obj);
=A0=A0 =A0lua_push= fstring(L, "%s (%s)", T::className, buff);

=A0=A0 =A0return 1;
=A0=A0}

=A0=A0static void set(lua_State *L, int table_index, const char *ke= y) {
=A0=A0 =A0lua_pushstring(L, key);
=A0=A0 =A0lua_in= sert(L, -2); =A0// swap value and key
=A0=A0 =A0lua_settable(L, table_index);
=A0=A0}
=A0=A0static void weaktable(lua_State *L, const char *mode) {<= /div>
=A0=A0 =A0lua_newtable(L);
=A0=A0 =A0lua_pushvalue(L, -= 1); =A0// table is its own metatable
=A0=A0 =A0lua_setmetatable(L, -2);
=A0=A0 =A0lua_pushliteral= (L, "__mode");
=A0=A0 =A0lua_pushstring(L, mode);
=
=A0=A0 =A0lua_settable(L, -3); =A0 // metatable.__mode =3D mode
<= div>=A0=A0}

=A0=A0static void subtable(lua_State *L, int tindex, const char *name,= const char *mode) {
=A0=A0 =A0lua_pushstring(L, name);
=A0=A0 =A0lua_gettable(L, tindex);
=A0=A0 =A0if (lua_isnil(L, -1= )) {
=A0=A0 =A0 =A0lua_pop(L, 1);
=A0=A0 =A0 =A0lua_checkstack(L, 3);
=A0=A0 =A0 =A0weaktable(= L, mode);
=A0=A0 =A0 =A0lua_pushstring(L, name);
=A0=A0= =A0 =A0lua_pushvalue(L, -2);
=A0=A0 =A0 =A0lua_settable(L, tinde= x);
=A0=A0 =A0}
=A0=A0}

=A0=A0static void *pushuserdata(lua_State *L, void *key= , size_t sz) {
=A0=A0 =A0void *ud =3D 0;
=A0=A0 =A0lua_= pushlightuserdata(L, key);
=A0=A0 =A0lua_gettable(L, -2); =A0 =A0= // lookup[key]
=A0=A0 =A0if (lua_isnil(L, -1)) {
=A0=A0 =A0 =A0lua_pop(L, 1); = =A0 =A0 =A0 =A0 // drop nil
=A0=A0 =A0 =A0lua_checkstack(L, 3);
=A0=A0 =A0 =A0ud =3D lua_newuserdata(L, sz); =A0// create new user= data
=A0=A0 =A0 =A0lua_pushlightuserdata(L, key);
=A0=A0 =A0 =A0lua_pushvalue(L, -2); =A0// dup userdata
=A0= =A0 =A0 =A0lua_settable(L, -4); =A0 // lookup[key] =3D userdata
= =A0=A0 =A0}
=A0=A0 =A0return ud;
=A0=A0}
};

Any idea of what could be wrong?

Thanks


2009/11/1 Ignacio Burgue=F1o <ignaciob@inconcertcc.com>
Sivan Thiruvengadam wrote:
I changed the method as you suggested CLObject :*GetListofNumbers*(lua_Stat= e *L)//
{
=A0*
=A0 =A0 =A0 =A0 =A0 =A0 =A0CLNumList*o =3D new CLNumList(L);
CLNL*ud =3D static_cast< CLNL*>(lua_newuserdata(L, sizeof(CLNumList))= ); =A0// create new userdata
real_object->GetListofNumbers(*o->real_object); //CLObject
ud->pT =3D o;
// lua_pushlightuserdata(L, ud);
// luaL_getmetatable(L, NUMLIST );
// lua_setmetatable(L, -2);

*
*CLNumList::push(L, o);*
*return 1;*
*}*

i am receiving this

error C2039: 'push' : is not a member of 'CLNumList'


Are you sure you're using Lunar ? Lunar adds two methods, call and push= , =A0that I think were not present in Luna, and parts of your code suggests= you're using Luna instead of Lunar.

Things like this:

static Luna< CLObject >::RegType methods[];

The example at http://lua-users.org/wiki/CppBindingWithLunar says:
static Lunar<Account>::RegType methods[];




--0016e64dca144c45570477663e6a-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 15:32:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2HWobj001203; Mon, 2 Nov 2009 15:32:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE9DE1A715; Mon, 2 Nov 2009 15:31:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB770192E2 for ; Mon, 2 Nov 2009 15:31:19 -0200 (BRST) Received: by qyk4 with SMTP id 4so2580395qyk.33 for ; Mon, 02 Nov 2009 09:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=9clQycaYVwO6NQDvYPxDcItNT+YUsqIjJlJqtQpQRfo=; b=X5IKbGlAIaNoxDzGqzX5kjsTIRP30lM/mWxiB4IsqVzRFseedcL3Kr3Po7Q5yDok6b NLvqaaLSzQiK6AyvNiXSbDILcpvVYcbRdERXdyeS8lQAmSQwUa6O7HW6G3u8fEbsDH+A sYAffLBLm0C++JXax6aKYSyKt3e/tpJRe2R6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=tIZP+9HJTgwGB/vOwMcVHJA4QSiMc5ZZDMytL9bFJO6BWrMYm1f9UUIE8pUGQjZSDo to6nbBvtbu5f3F8Pxvw/V4/KXSIB5Og86Z/dzkyIvPI8WQrDcRIFGDsfsg1gnqjAHfcx +pAMUzhcy2IzBHCk8L3ot9ryzdAGh7f7y3fLQ= MIME-Version: 1.0 Received: by 10.224.70.202 with SMTP id e10mr3023334qaj.16.1257183134906; Mon, 02 Nov 2009 09:32:14 -0800 (PST) In-Reply-To: References: <20091031225554.GA30341@mike.de> <4AED8F44.3030809@cowlark.com> <4AED9390.4070002@cowlark.com> <20091101180155.GA12403@mike.de> Date: Mon, 2 Nov 2009 23:32:14 +0600 X-Google-Sender-Auth: 06b0b754d14e971b Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I was not trying to say that JET is the fastest JVM around. It would be unethical and false. My point was: different JVMs have different weak and strong sides, so they can show different performance boost for different applications. To make things more complicated: for language like Java you should consider not only optimization differences (e.g. approaches to loop versioning, to global optimizations), code generation differences (e.g. SSE2 vs. FPU, or different implementations of operations with "long" type), but also differences in runtime support (different approach to GC, special means to optimize reflection etc.). You just can't say that "HS performance" is equal to "Java performace". Nevertheless all this is irrelevant to the whole topic of Lua JIT. Sorry for the disturbance, I should have waited for the actual sample for benchmarking before saying anything. /* BTW, Krause uses not arithmetic, but _geometric_ mean. Also it measures ratio not between HS and JET, but between X and the fastest competitor for each test. So "unduly large" is not very large. I did some finger-math to exclude it: HS score will be ~1.35226. But this is also irrelevant, we are not on Java lovers list ;-) If you would like to continue this argument, feel free to contact me directly. */ Regards, -- e.v.e On Mon, Nov 2, 2009 at 10:32 PM, Isaac Gouy wrote: > Vyacheslav Egorov gmail.com> writes: > > -snip- >> Also there were some benchmarks[1] showing that HotSpot-Server is not >> the fastest JVM around. It might be interesting to test the very same >> number crunching app on JRockit or Excelsior JET. >> > -snip- >> >> [1] http://www.stefankrause.net/wp/?p=9; methodology of the >> benchmarking was not flawless, so results should be interpreted with >> caution. > -snip- > > > Only one (fannkuch) of the four programs that Stefan Krause borrowed from the > benchmarks game shows Excelsior JET much faster than HotSpot. > > The fifth and final program (himeno) shows Excelsior JET 4x faster and that > (outlier?) has an unduly large effect on the mean Stefan Krause shows. > > > Let's be clear - the benchmarks game isn't flawless either! ;-) > > However, the benchmarks game has been open to incremental improvements over the > last 4 or 5 years - in fact, median (more resistant to outliers) and quartiles > are shown instead of a mean because someone came and made a persuasive argument. > > And of course programmers contribute better programs - the Java fannkuch program > Stefan Krause borrowed is no longer shown, it's been replaced by 2 faster Java > programs. > > No doubt "someone" will contribute better LuaJIT programs :-) > > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 15:36:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Hautm001576; Mon, 2 Nov 2009 15:36:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B17871A6D7; Mon, 2 Nov 2009 15:35:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 625FF19305 for ; Mon, 2 Nov 2009 15:35:35 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id BACF2BD7DA for ; Mon, 2 Nov 2009 12:36:30 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 02 Nov 2009 12:36:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=0AbbhJMbt+8cj35iMIu3BDWJo1Q=; b=XAMVPQlcLUpBr+1hzFAD/9/Z2oECR7kwYXARTN8N6OrG6j8phXvdHZLR8jIbRu3E17jPyObDoLwVDhWQpm0DzpqujdwC+/ivTSsLn9NEuyxlcFwiNI2KWQtYjkhPXy5mLK7Vt3qKK8sToSBsC1vHnyq95Oa+XBpAJx5B5uJxRo8= X-Sasl-enc: 73X84nvE2Ev96WU7BbedjZGWleXRSWpusPK89FCuog4/ 1257183390 Received: from [10.1.1.3] (222-152-74-164.jetstream.xtra.co.nz [222.152.74.164]) by mail.messagingengine.com (Postfix) with ESMTPSA id D1D314A26B2 for ; Mon, 2 Nov 2009 12:36:29 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091102111453.GA22577@mike.de> Date: Tue, 3 Nov 2009 06:35:55 +1300 Content-Transfer-Encoding: 7bit Message-Id: <142DF295-4BF4-47BF-A71E-FC4B1B220908@fastmail.fm> References: <20091031225554.GA30341@mike.de> <20091102111453.GA22577@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 3/11/2009, at 12:14 AM, Mike Pall wrote: > Geoff Leyland wrote: >>> =math.random() >> 1.7863937924312 > > Ok, so Apple thinks -fpic is a good on x86. And I'm stupid because > I broke it. > > Patch attached. Thank you for the report! Fixed! Thanks. $ luajit-2.0.0-beta1 LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ JIT: ON CMOV SSE2 SSE4.1 fold cse dce fwd dse narrow loop fuse > min, max=math.huge, -math.huge > for i = 1, 1000 do local r = math.random() min = math.min(min, r) max = math.max(max, r) end > =min, max 0.00123587576387 0.99956828411132 Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 15:48:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Hm9du002557; Mon, 2 Nov 2009 15:48:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7F1F1931F; Mon, 2 Nov 2009 15:46:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8109219315 for ; Mon, 2 Nov 2009 15:46:45 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id E93C42F74F7 for ; Mon, 2 Nov 2009 09:47:40 -0800 (PST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZYzeT5gYAunV for ; Mon, 2 Nov 2009 09:47:40 -0800 (PST) Received: from [192.168.1.104] (ResNet-35-220.resnet.ucsb.edu [169.231.35.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id CDB7F2F74F2 for ; Mon, 2 Nov 2009 09:47:39 -0800 (PST) Message-Id: <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu> From: Graham Wakefield To: Lua list In-Reply-To: <20091031225554.GA30341@mike.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Mon, 2 Nov 2009 09:47:38 -0800 References: <20091031225554.GA30341@mike.de> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi, This is quite amazing work. Hope this is useful feedback: I've had consistent crashes with a rather large codebase, every time in lua_iscfunction() (sometimes but not always with negative indices). Hard to give specific code examples; this is spread throughout 1000's of LOC, about 40 or so instances of lua_iscfunction() regularly triggering the crash. In every case, replacing lua_iscfunction(L, idx) with lua_type(L, idx) == LUA_TFUNCTION fixes the crashes. OSX 10.5.8 (LuaJIT and host application built against 10.4 sdk; LuaJIT built as static library and embedded, with the three recent patches applied) 2.66 GHz Intel Core 2 Duo From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 16:00:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2I0sbr003645; Mon, 2 Nov 2009 16:00:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E08B19327; Mon, 2 Nov 2009 15:59:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.189]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2973F19322 for ; Mon, 2 Nov 2009 15:59:27 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so677193gvf.40 for ; Mon, 02 Nov 2009 10:00:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=1ABoeHyAn9QSIgLuaefcTRapkZWFyuAF96zgC3eulQ0=; b=rBjhXfrOC3xNf2QNNk3IMaMfyQg4rgJNY0zRxYOib3y+f63O14Cn3uRYlq/OlW7S8q M0OWzWmOf94eL1mB5ScfEQ6if4hIWQD3lupOqAzpnDZbZwf/sKB4MNdOnKFw7RbanvCz urkswxaomzmuLJSi/UAML3b1oAqtP4bsyz2Us= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=P+CSoEgkkaoNWGoc04N+zFsw5Ka8/DIjdlNiQtLWffFKFcjZLiqPfDfvVi5bwXJIOr 1jOtFn1ecEUnLha2XzwT0+vX+zcuUGr3eMo8TwD2yMGJmeGqO+fo1zKM4SxWCIOoPV5+ orWRnQHW/qTmuVoSpIXgAR8r3W/9WWFiqIv8U= Received: by 10.103.127.28 with SMTP id e28mr2252047mun.120.1257184823652; Mon, 02 Nov 2009 10:00:23 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id e10sm10677801muf.51.2009.11.02.10.00.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 10:00:21 -0800 (PST) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Date: Mon, 2 Nov 2009 18:59:50 +0100 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 2, 2009, at 9:10 AM, Diego Nehab wrote: > The new candidate release for LuaSocket 2.0.3 is available > for download from > > http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/luasocket-2.0.3-rc2.zip Thanks :) > > I plan to release the final version within the next couple > of weeks, so please take a look and see if you find any > issues you want fixed before then. Any specific area to look into? From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 16:01:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2I1iOW003802; Mon, 2 Nov 2009 16:01:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3424019331; Mon, 2 Nov 2009 16:00:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49A151932B for ; Mon, 2 Nov 2009 16:00:24 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2I1JTW003758 for ; Mon, 2 Nov 2009 16:01:19 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nA2I1IC31796; Mon, 2 Nov 2009 16:01:18 -0200 Date: Mon, 2 Nov 2009 16:01:18 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102160118.A31749@lua.tecgraf.puc-rio.br> References: <20091031225554.GA30341@mike.de> <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu>; from wakefield@mat.ucsb.edu on Mon, Nov 02, 2009 at 09:47:38AM -0800 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > replacing lua_iscfunction(L, idx) with lua_type(L, idx) == LUA_TFUNCTION > fixes the crashes. These are not equivalent. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 16:14:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2IEGd8004669; Mon, 2 Nov 2009 16:14:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB14C1A717; Mon, 2 Nov 2009 16:12:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED0B1321B3 for ; Mon, 2 Nov 2009 16:12:44 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nA2IDbDx029729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 2 Nov 2009 13:13:40 -0500 (EST) Date: Mon, 2 Nov 2009 13:13:37 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 In-Reply-To: <4AEEC4AF.2090009@inconcertcc.com> Message-ID: References: <4AEEC4AF.2090009@inconcertcc.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5789 signatures=575501 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > Does the NEW file inside describes what's new in this version or it hasn't > been updated yet? It's updated but I should probably have made it relative to RC1 instead. Very few things changed since RC1. Here are the new changes: * Fixed: receive() returns immediatelly if prefix can satisfy bytes requested (M Joonas Pihlaja); * Improved: Decent makefiles (LHF). * Fixed: manual sample of HTTP authentication now uses correct "authorization" header (Alexandre Ittner); Regards, Diego From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 16:31:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2IVYkG005966; Mon, 2 Nov 2009 16:31:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 079B71A71C; Mon, 2 Nov 2009 16:30:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05A8D1A600 for ; Mon, 2 Nov 2009 16:30:07 -0200 (BRST) Received: by ewy26 with SMTP id 26so5223720ewy.5 for ; Mon, 02 Nov 2009 10:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=NsHPmoCqH3bU7JXFgYQKN6qWVrS3Si66Vgd/+uD3EYM=; b=l7A4NtaY4Tx1EzcrODw+Wtc+Avi94LiJwVP76M8agUG0JfOgDzGdlP5MHMhP1aI6fc LEVGcYbJfzK39s+5Z+bcoRX2PHVqXSJJ0G9+O2t7VTjP9CzNEqra9+pBGSuVFFmg3Y+1 XEOvAG9jfnhIZiNGjN5R++S/DbQNypFkMU3aE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=jJlfECs2JWZxD62Y7ypAmRAzl285lHizEfWQDweEM6YfzkeYJG/NMjROhyPfGo1h9q vj+vrkNw2RrshRx68driijSudFL64Uk5atkLwEvZB/ewKmHjcXGcwoKqBPPTBvoKinCr JlRpv4+XIDL3AOSE61chO78HHcnuQ5KJddJNo= MIME-Version: 1.0 Received: by 10.216.86.204 with SMTP id w54mr5183673wee.54.1257186663222; Mon, 02 Nov 2009 10:31:03 -0800 (PST) In-Reply-To: <20091102144328.GA31649@mike.de> References: <20091102135643.GA29657@mike.de> <20091102144328.GA31649@mike.de> Date: Mon, 2 Nov 2009 13:31:03 -0500 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Mike Pall wrote: > To see the metamethod dispatch hoisting, try this program: > > local t = {} > for i=1,100 do t[i] = tostring(i) end > local x = 0 > for i=1,100 do x = x + t[i]:len() end > print(x) > > The dispatch in the second loop first involves a lookup of the > "__index" table in the string metatable. Then "len" is looked up > in this table and the resulting function (string.len) is called. > > Ok, so run it with: > > luajit -jdump=im test.lua > > Here's the loop part of the second trace: > > ->LOOP: > [..snip..] > Pretty short, eh? As you can see, all dispatch has been hoisted. > > --Mike > Well, the next step in functions like __add(z1,z2) or __mul(z1,z2) will be to check that the second argument is indeed of the type "complex". Typically it is done with luaL_checkudata which (1) pulls object's metatable onto the stack (2) looks up the required metatable in the REGISTRY with lua_getfield(L, LUA_REGISTRYINDEX, tname) by its name string and (3) compares two metatables. It is a lot of overhead for +-/* of complex numbers. I do not see how LuaJIT can help here, for this overhead happens on the C-side of things outside of LuaJIT control. Is a good solution possible? --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 16:38:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2IcbKW006575; Mon, 2 Nov 2009 16:38:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 258201A721; Mon, 2 Nov 2009 16:37:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 834351A600 for ; Mon, 2 Nov 2009 16:37:13 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id C42B92F74F7 for ; Mon, 2 Nov 2009 10:38:09 -0800 (PST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id F6CiOxMnzT6h for ; Mon, 2 Nov 2009 10:38:09 -0800 (PST) Received: from [192.168.1.104] (ResNet-35-220.resnet.ucsb.edu [169.231.35.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id 42A3C2F74F2 for ; Mon, 2 Nov 2009 10:38:09 -0800 (PST) Message-Id: From: Graham Wakefield To: Lua list In-Reply-To: <20091102160118.A31749@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Mon, 2 Nov 2009 10:38:08 -0800 References: <20091031225554.GA30341@mike.de> <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu> <20091102160118.A31749@lua.tecgraf.puc-rio.br> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean True, but in this case they are good enough... I should have said 'temporarily fixes' ... On Nov 2, 2009, at 10:01 AM, Luiz Henrique de Figueiredo wrote: >> replacing lua_iscfunction(L, idx) with lua_type(L, idx) == >> LUA_TFUNCTION >> fixes the crashes. > > These are not equivalent. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 17:21:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2JLc6X010230; Mon, 2 Nov 2009 17:21:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 977661A722; Mon, 2 Nov 2009 17:20:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2247B1A600 for ; Mon, 2 Nov 2009 17:20:05 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so177962fgb.17 for ; Mon, 02 Nov 2009 11:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tkZ3CG6Z57vdMRYJLfIqqk5NR9ZcOqKDgP/Dyq7jauQ=; b=IHS7vTwPPlU0OfYQAr49i1osCJ85sExgil6tOyOu+nHUKj/VmARR8O6z2hcmTk3obp FaRNFGrScTvTor0RXyhcOLbHJZX3LdzVPQzQTyqOCLN9TKqzGYjVV3kZUIyequtq45Xt Zd+hD9uVBCXsMRHrEORJB07raFHmy1vXMSOIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eU6teiFSkFr3PtLopn1jLDOeBamPljI1kEjS7MnS6i9FGFuu5j7CePTnP8q4GBb+V6 ODwlRbsFPF/SYVpZz0Ppv5eO46Re1vFgHcguB2IF2+5tE9TnJli6QETC8XEjZ16Paq39 baB0htGP39QibnIkz+1L2o5i0qKFZrRd4WWu0= MIME-Version: 1.0 Received: by 10.223.143.68 with SMTP id t4mr846077fau.20.1257189661396; Mon, 02 Nov 2009 11:21:01 -0800 (PST) In-Reply-To: References: <20091102135643.GA29657@mike.de> <20091102144328.GA31649@mike.de> Date: Mon, 2 Nov 2009 19:21:01 +0000 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2JLc6X010230 On Mon, Nov 2, 2009 at 6:31 PM, Leo Razoumov wrote: > On 2009-11-02, Mike Pall wrote: >>  To see the metamethod dispatch hoisting, try this program: >> >>   local t = {} >>   for i=1,100 do t[i] = tostring(i) end >>   local x = 0 >>   for i=1,100 do x = x + t[i]:len() end >>   print(x) >> >>  The dispatch in the second loop first involves a lookup of the >>  "__index" table in the string metatable. Then "len" is looked up >>  in this table and the resulting function (string.len) is called. >> >>  Ok, so run it with: >> >>   luajit -jdump=im test.lua >> >>  Here's the loop part of the second trace: >> >>  ->LOOP: >> [..snip..] >>  Pretty short, eh? As you can see, all dispatch has been hoisted. >> >>  --Mike >> > > Well, the next step in functions like __add(z1,z2) or __mul(z1,z2) > will be to check that the second argument is indeed of the type > "complex". Typically it is done with luaL_checkudata which (1) pulls > object's metatable onto the stack (2) looks up the required metatable > in the REGISTRY with  lua_getfield(L, LUA_REGISTRYINDEX, tname) by its > name string and (3) compares two metatables. It is a lot of overhead > for +-/* of complex numbers. I do not see how LuaJIT can help here, > for this overhead happens on the C-side of things outside of LuaJIT > control. Is a good solution possible? > > --Leo-- > Have you tried getting the metatable of both arguments and simply checking that they are identical? Alternatively, you could store the metatable in an upvalue of the metamethods, and compare to that instead of using the registry-based luaL_checkudata(). -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:05:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2K5Tfi014707; Mon, 2 Nov 2009 18:05:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 172CA1A6E3; Mon, 2 Nov 2009 18:04:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 599661A6D5 for ; Mon, 2 Nov 2009 18:03:59 -0200 (BRST) Received: by ewy26 with SMTP id 26so5324348ewy.5 for ; Mon, 02 Nov 2009 12:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=R5MWsXBkIXw1dN6I5wSIf1fBxGV5vu1ct8s3kwtTYjA=; b=hdIr9OK/nYMARc511Yr+Wdn1PuhzD0CMuGzLW71O8Z5e2oAxDoPydejKaA9m7DkS0f BnyNGEshiQL4yX0zCKtJtyr2YRL7iInVrwtyjzYfb129LFtRY4zuPw8N4dc/EJaSt92D x4mJE798hv3/7Gucm/ksFkhDvWxQPDTqmEd/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=Nal4N5moa4Majga4FVDXd7VR5CqnfGOSKQvZ5McrxQFCMzB9vo6r+Ylnsmsg7UEhtz TXlVVRTIqq6wX3YmIzwV/C7oAS4EhBv6jCtp0aUORIvHUmikYtzNJcZoNx5Fhmiwdjgs tLAuCEpDeGbcxroard614En2dKonoczDCYDkQ= MIME-Version: 1.0 Received: by 10.216.86.74 with SMTP id v52mr5181366wee.124.1257192294244; Mon, 02 Nov 2009 12:04:54 -0800 (PST) In-Reply-To: References: <20091101001702.A16917@lua.tecgraf.puc-rio.br> Date: Mon, 2 Nov 2009 21:04:54 +0100 Message-ID: Subject: Re: Undocumented/Buggy Behavior with Function Definitions From: Eike Decker To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2K5Tfi014707 It is not completely true that function f () end is translated to f = function () end For global variable assignments this might be true but not so for local variables. Sample case of corner case: local foo = "blah" local foo = function () return foo end print(foo()) -- prints "blah" The scope of the local variable is only starting after the assignment has been finished, so this code local bar = function () return bar end print(bar()) -- returns nil makes perfectly sense but is not what you might expecting to get. Contrary: local function bar() return bar end will return the function itself as this a special case of assignment. Greetings, Eike 2009/11/1 RJ Russell : > Sorry, that code isn't the actual code, just a demonstration code that I > made really fast. It was to demonstrate that the __newindex wasn't working > on a function definition function foo()end. But now I rewrote another one, > and it seems to work. I guess I was wrong. Thanks anyway. > > On Sat, Oct 31, 2009 at 7:17 PM, Luiz Henrique de Figueiredo > wrote: >> >> > However, this code doesn't seem to work: >> >> > do >> >   local cdoc >> >   local docs >> >   local function newindex(G,k,v) >> >     docs[k]=cdoc >> >> You need to initialize docs: >>    local docs={} > > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:33:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2KXt6G017127; Mon, 2 Nov 2009 18:33:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 419EA1A6F2; Mon, 2 Nov 2009 18:32:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C9831A6DD for ; Mon, 2 Nov 2009 18:32:30 -0200 (BRST) Received: by ewy26 with SMTP id 26so5356084ewy.5 for ; Mon, 02 Nov 2009 12:33:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.87.75 with SMTP id x53mr10957wee.13.1257193623121; Mon, 02 Nov 2009 12:27:03 -0800 (PST) Date: Mon, 2 Nov 2009 15:27:03 -0500 Message-ID: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> Subject: (another) lua libevent binding From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all. I recently learned how not to sleep, so as a result I can release the next step on my world domination plan: a Lua binding for (most of) libevent. Grab it at http://github.com/javierguerragiraldez/lualibevent/ it's still incomplete, but i think it's already a simple and usable approach for non-blocking I/O. The biggest missing parts are around the 'fd accessor' facilities (a few functions to let you use any 'file like' Lua object for your events, just as long as there's a Lua or C function to get the file descriptor number from the object. LuaSocket has them (socked:getfd()), and i've provided one for standard Lua files (levent.fdfromfile(file))). I've preserved the 'event driven' architecture of libevent, and also the 'buffered events' objects, that let you read/write on demand to a buffer, which will be filled/drained from/to the underlying file automatically and nonblockingly. Of course, it's still missing real docs (but there's a sizable README), and a LuaForge project. I also didn't waste much time with libevent's http server, since i think it can be done better in Lua (i've heard there are a few existing http servers in pure Lua...) please check it, i'll appreciate any comments, and advices, bot on the code and how to make day-time hallucinations bring me caffeinated beverages. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:38:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Kc9XB017590; Mon, 2 Nov 2009 18:38:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 771D51A6FC; Mon, 2 Nov 2009 18:36:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C4CC1A6F0 for ; Mon, 2 Nov 2009 18:36:36 -0200 (BRST) Received: by bwz27 with SMTP id 27so6757102bwz.21 for ; Mon, 02 Nov 2009 12:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=+roUQmIvwesAkaz8Oz+HBj5M0vYtxRzgVCvlmsUaYQQ=; b=I6ZvDRVPzUQRowUtC3TjVIZ84cATrDp9xwmzp6+iAuY2kpxFaKwQxt+bQxgPs1suVf dUMr5AxA4PmAfge40ot8QcMjonH2jA47KsGBy49MyY2fGfBAaZXoOW8xZLPKTdanQsoq PG+y9sNWV8EJ7ic7NIIED6ka9wv0eyk0hteg8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=CmRr6uTpRpFc02o+ts9mMCCNJ98T35vphONTqLBxBr36Ji4Ds50G9VEZw+pbTurC74 LJ07KbLOTkK+gm7eghSwhh2NDT/Adn7P/UUCf0M3YS8WHaWBTrxxxxeZ3bljIzpcI0tH UnMsLylZhbqZml6iCzgw55clONStQJX9WIETI= MIME-Version: 1.0 Received: by 10.204.8.155 with SMTP id h27mr4390520bkh.55.1257194253150; Mon, 02 Nov 2009 12:37:33 -0800 (PST) In-Reply-To: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> References: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> From: Matthew Wild Date: Mon, 2 Nov 2009 20:37:13 +0000 Message-ID: <4db9cacb0911021237x48590a52q8dfc04314a7c9ef2@mail.gmail.com> Subject: Re: (another) lua libevent binding To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2Kc9XB017590 2009/11/2 Javier Guerra : > Hi all. > > I recently learned how not to sleep, so as a result I can release the > next step on my world domination plan: a Lua binding for (most of) > libevent.  Grab it at > http://github.com/javierguerragiraldez/lualibevent/ > Nice work :) Question (and I'm sure you saw this coming)... how does it differ from luaevent at http://repo.or.cz/w/luaevent.git ? Regards, Matthew From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:38:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Kcqar017698; Mon, 2 Nov 2009 18:38:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E86081A712; Mon, 2 Nov 2009 18:37:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B4D91A700 for ; Mon, 2 Nov 2009 18:37:00 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N53ey-0001Sl-00; Mon, 02 Nov 2009 21:37:52 +0100 Date: Mon, 2 Nov 2009 21:37:47 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102203747.GA3915@mike.de> References: <20091031225554.GA30341@mike.de> <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <6CE46AFC-5CD6-4AE3-BF3F-4DFC4C1481DD@mat.ucsb.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Graham Wakefield wrote: > Hope this is useful feedback: I've had consistent crashes with a rather > large codebase, every time in lua_iscfunction() (sometimes but not always > with negative indices). Thanks for the report! Patch attached. --Mike --vtzGhvizbBRQ85DL Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="lua_iscfunction.patch" --- a/src/lj_api.c +++ b/src/lj_api.c @@ -202,7 +202,7 @@ LUA_API const char *lua_typename(lua_State *L, int t) LUA_API int lua_iscfunction(lua_State *L, int idx) { cTValue *o = index2adr(L, idx); - return !isluafunc(funcV(o)); + return tvisfunc(o) && !isluafunc(funcV(o)); } LUA_API int lua_isnumber(lua_State *L, int idx) --vtzGhvizbBRQ85DL-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:39:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Kddu1017781; Mon, 2 Nov 2009 18:39:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F82F1A715; Mon, 2 Nov 2009 18:38:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout020.mac.com (asmtpout020.mac.com [17.148.16.95]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 201E21A6F6 for ; Mon, 2 Nov 2009 18:38:18 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from [192.168.1.34] ([92.104.14.51]) by asmtp020.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSI006BX1BMB920@asmtp020.mac.com> for lua@bazar2.conectiva.com.br; Mon, 02 Nov 2009 12:38:42 -0800 (PST) Message-id: <0DFB1F81-B2B8-4895-92C9-710C7173541E@mac.com> From: Petite Abeille To: Lua list In-reply-to: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> Subject: Re: (another) lua libevent binding Date: Mon, 02 Nov 2009 21:38:09 +0100 References: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 2, 2009, at 9:27 PM, Javier Guerra wrote: > how to make day-time hallucinations bring me caffeinated beverages. Heard good things about mescaline From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:46:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2KkM8c018379; Mon, 2 Nov 2009 18:46:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB0901A71D; Mon, 2 Nov 2009 18:45:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69FC51A6F9 for ; Mon, 2 Nov 2009 18:44:57 -0200 (BRST) Received: by bwz27 with SMTP id 27so6765753bwz.21 for ; Mon, 02 Nov 2009 12:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=zV8FjMSxveqehUnv7XRJr1hZJ/7aAFlGF/090Uy5y9I=; b=ch+NkF25aQ7zStbulhyMBNEn2AqpwB4UJp9ZpzNfjyGOC83y+HDiNEIMoEYaArQcuT a7R6fp3LKfa7/JtBi2qNGkUhyD94sMsbK98zqHwACYUWuQxK9825qTiEb0srOcOemOi7 DuXZf2nCHwoHajtF3LBGHENEXhyyKEX/CEpLI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eiL12f73FxjLuY2cXxHjllWvl0dEnNj4IJLkMMxEVBc6xZgvA5qMMX8qX2pV+0f3yw 4Md/XndU89viM7ZFF/19K46YcLr9JBXaloVwTp/h0ancu9XUvmkn6FMoYiU/EN7hiPzK CPkJcTstWNWtL49KB9Xr6LdRnGSzTBwbKovP8= MIME-Version: 1.0 Received: by 10.204.154.155 with SMTP id o27mr4205684bkw.198.1257194750711; Mon, 02 Nov 2009 12:45:50 -0800 (PST) In-Reply-To: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> References: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> Date: Mon, 2 Nov 2009 21:45:50 +0100 Message-ID: <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> Subject: Re: [ANN] Idle v1.0 From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/2 Thomas Lauer : > After more than two years of development, I am happy to announce the > release of Idle version 1.0. > > See http://idle.thomaslauer.com for details about Idle and > http://idle.thomaslauer.com/IdleDownload.html for downloads. > > Idle is a compact, powerful scripting language based on Lua 5.1. It is > available for Windows 2000 and later systems (a Linux/BSD/... release is > neither available nor planned). Idle is released under the MIT licence. > > Anyone interested in the upcoming source code release please drop me a > quick note as I a looking for a few volunteers to torture with a > preliminary release of the sources. Hi Thomas, I've given a look to your page. It seems to me that Idle is not 'based on Lua' but actually *is* Lua just with some customizations :-) Actually the extensions you've introduced are pretty interesting and I've thought myself to some of them in past but I didn't implement nothing. For the the construct 'break n' that you've introduced: I don't like it a lot and I rather prefer the approach of Perl with labelled 'for' loop. I think it is much more elegant and readable. But I recognize that this construct is actually useful and I was disappointed with Python to discover that it doesn't have labelled break. I was also interested in the gui module and I was wondering if it is based on an existing toolkit or if you built it from scratch. Otherwise, I'm using Windows at work with mingw and I would be glad to try your code. Best regards, Francesco From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:56:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2Kurdc019152; Mon, 2 Nov 2009 18:56:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEC2A1A729; Mon, 2 Nov 2009 18:55:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA7BC1A6F3 for ; Mon, 2 Nov 2009 18:55:32 -0200 (BRST) Received: by ewy26 with SMTP id 26so5383208ewy.5 for ; Mon, 02 Nov 2009 12:56:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.85.194 with SMTP id u44mr5222360wee.65.1257195387887; Mon, 02 Nov 2009 12:56:27 -0800 (PST) In-Reply-To: <4db9cacb0911021237x48590a52q8dfc04314a7c9ef2@mail.gmail.com> References: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> <4db9cacb0911021237x48590a52q8dfc04314a7c9ef2@mail.gmail.com> Date: Mon, 2 Nov 2009 15:56:27 -0500 Message-ID: <90eb1dc70911021256s6fb9c407u67cb6074ebaaff55@mail.gmail.com> Subject: Re: (another) lua libevent binding From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 3:37 PM, Matthew Wild wrote: > Nice work :) tks > Question (and I'm sure you saw this coming)... how does it differ from > luaevent at http://repo.or.cz/w/luaevent.git ? pure NIH... no, in fact i first found the luasync proyect (http://code.google.com/p/luasync/) and found it unfilling. i think i did saw luaevent; but i might have mixed 'em in my mind, so i discarded both. i'll have to recheck luaevent; to see if it's better to use (and participate) or if i like mine better. at first glance, the 'drop-in replacement for copas' is a counter-goal for me (even if i intend to write a think Lua layer that mainly does that) -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 18:57:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2KvnJw019266; Mon, 2 Nov 2009 18:57:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50F541A72D; Mon, 2 Nov 2009 18:56:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF8A81A72A for ; Mon, 2 Nov 2009 18:56:31 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1219806eye.39 for ; Mon, 02 Nov 2009 12:57:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.91.13 with SMTP id g13mr429300wef.36.1257195447870; Mon, 02 Nov 2009 12:57:27 -0800 (PST) In-Reply-To: <0DFB1F81-B2B8-4895-92C9-710C7173541E@mac.com> References: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> <0DFB1F81-B2B8-4895-92C9-710C7173541E@mac.com> Date: Mon, 2 Nov 2009 15:57:27 -0500 Message-ID: <90eb1dc70911021257p9e62052s8433cd886639c27f@mail.gmail.com> Subject: Re: (another) lua libevent binding From: Javier Guerra To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 3:38 PM, Petite Abeille wrote: > On Nov 2, 2009, at 9:27 PM, Javier Guerra wrote: >> how to make day-time hallucinations bring me caffeinated beverages. > > Heard good things about mescaline oh, yeah. make one set of hallucinations fight the other... hope they won't make too much noise to let me code. -- Javier From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 19:01:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2L1b3j019682; Mon, 2 Nov 2009 19:01:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B364E1A730; Mon, 2 Nov 2009 19:00:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B559C1A72A for ; Mon, 2 Nov 2009 19:00:16 -0200 (BRST) Received: by ywh40 with SMTP id 40so4858409ywh.33 for ; Mon, 02 Nov 2009 13:01:13 -0800 (PST) Received: by 10.100.26.2 with SMTP id 2mr2944286anz.1.1257195672888; Mon, 02 Nov 2009 13:01:12 -0800 (PST) Received: from two ([71.21.67.37]) by mx.google.com with ESMTPS id 4sm2224412ywi.42.2009.11.02.13.01.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 13:01:11 -0800 (PST) Date: Mon, 2 Nov 2009 15:01:07 -0600 From: phoenix To: lua@bazar2.conectiva.com.br Subject: Re: (another) lua libevent binding Message-ID: <20091102150107.214437c0@two> In-Reply-To: <0DFB1F81-B2B8-4895-92C9-710C7173541E@mac.com> References: <90eb1dc70911021227w43452531p5e9ab9d30da7b292@mail.gmail.com> <0DFB1F81-B2B8-4895-92C9-710C7173541E@mac.com> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 02 Nov 2009 21:38:09 +0100 Petite Abeille wrote: > > On Nov 2, 2009, at 9:27 PM, Javier Guerra wrote: > > > how to make day-time hallucinations bring me caffeinated beverages. > > Heard good things about mescaline > Well, he already has hallucinations, and wants to tame them for practical purposes... Maybe something like: local hmt = getmetatable(hallucinations) if hmt.__call then local run_hallucination = hmt.__call function hmt:__call(...) if self.patient.caffeine <= CAFFEINE_CRITICAL then self.patient.nurse.pump_caffeine( LOTS_OF_CAFFEINE ) run_hallucination(...) end From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 19:07:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2L7ZlW020105; Mon, 2 Nov 2009 19:07:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CC501A733; Mon, 2 Nov 2009 19:06:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C5241A727 for ; Mon, 2 Nov 2009 19:06:11 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N547H-0001Ud-00; Mon, 02 Nov 2009 22:07:07 +0100 Date: Mon, 2 Nov 2009 22:05:42 +0100 From: Mike Pall To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091102210542.GA4102@mike.de> References: <20091102135643.GA29657@mike.de> <20091102144328.GA31649@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > Well, the next step in functions like __add(z1,z2) or __mul(z1,z2) > will be to check that the second argument is indeed of the type > "complex". Typically it is done with luaL_checkudata which (1) pulls > object's metatable onto the stack (2) looks up the required metatable > in the REGISTRY with lua_getfield(L, LUA_REGISTRYINDEX, tname) by its > name string and (3) compares two metatables. It is a lot of overhead > for +-/* of complex numbers. I do not see how LuaJIT can help here, > for this overhead happens on the C-side of things outside of LuaJIT > control. Is a good solution possible? You are still thinking too much interpreter-centric. *None* of that involves calls to the C-side on the JIT side. The trace compiler records the _functionality_ of each bytecode, not the actual C code involved. In effect it does a complete simulation of every bytecode and all the associated metamethod stuff, before it's even run. So here's what happens, if the trace recorder sees the BC_ADD: - First it checks the runtime type of the two operands: since these are userdata it resolves their metamethods, recording every lookup on the way. - Then it records the call to the resolved metamethod: it sees that it's one of the special internal fast functions and runs the associated recording handler. - The recording handler checks that the arguments it got are indeed of the right userdata type (recording the functionality of the checks involved). - The two complex numbers are pulled from the userdata (recording four number loads on the way -- the unboxing step), added together (recording two additions) and stored in a newly created userdata (recording an allocation and two stores -- the boxing step). Only after the recording of the bytecode is finished, the actual bytecode execution starts in the interpreter. And it should exactly follow the simulated steps and come up with a new userdata in the end. Now, if a subsequent BC_MUL of the result is seen, almost the same happens, except the recorded loads from the userdata are forwarded from the previous stores (eliminating the unboxing). I.e. the multiplies directly operate on the adds, bypassing the userdata object. This makes the stores redundant, which in turn makes the allocation redundant. Depending on the surrounding code, the stores and the allocation can be sunk into a side exit or eliminated altogether (eliminating the boxing). After hoisting, the end result is a pure expression (z1 + z2) * z3 on complex numbers, that's split up into the scalar operations. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 19:19:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2LJZJr021080; Mon, 2 Nov 2009 19:19:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC71F1A70A; Mon, 2 Nov 2009 19:18:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C4B31A6E3 for ; Mon, 2 Nov 2009 19:18:09 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nA2LJ2Kt016990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 2 Nov 2009 16:19:05 -0500 (EST) Date: Mon, 2 Nov 2009 16:19:02 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5790 signatures=575578 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, >> I plan to release the final version within the next couple >> of weeks, so please take a look and see if you find any >> issues you want fixed before then. > > Any specific area to look into? Not really. :) But sometimes my "bug tracking system" may fail. The only two outstanding issues I am considering are http://lua-users.org/lists/lua-l/2009-08/msg00342.html and http://lua-users.org/lists/lua-l/2008-08/msg00446.html so no need to remind me of them. If there are other open issues I should to consider, please let me know. Kind regards, Diego From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 19:22:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2LMLaU021363; Mon, 2 Nov 2009 19:22:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEFFC1A71D; Mon, 2 Nov 2009 19:21:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 170911A6FC for ; Mon, 2 Nov 2009 19:20:58 -0200 (BRST) Received: by gxk4 with SMTP id 4so4633582gxk.8 for ; Mon, 02 Nov 2009 13:21:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hOz2n/h+3x42yLCNwXdFymEZZcJfXUaMHKz1+nMRWCI=; b=oaNdJHEzNgJw9eT84vjIPlu6BmNtI6fp4m3Hp65/YD8+ifdQTM+Io2kt93wp6Mvzjr KLpLOCcpOQhaG56XKY+RFzcu4DrQT1dZSfXwv9eeOQKZlLtbcYCw7UiefHB+4w1Slwgd kj083SBJPtO6jyq+lA2WOn1/sfhNUe7rZPu4k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Xo9npL6Wa65hk8dVh/E2/Vw85cTNNpEcc8j+6gS9Q8rbFlAhkR6mW+4wsKQ9Ku05B7 VGxekRj1TQQGjPclnPE8/DvfGmODSslcHRL2v454ptSI5YJPO+d6JvV2RoMqEmGXraeS XPAQ8KoiSGTuCfuZnoildP6Vcuqx6ODpipA7o= MIME-Version: 1.0 Received: by 10.91.193.11 with SMTP id v11mr2320427agp.25.1257196915743; Mon, 02 Nov 2009 13:21:55 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Nov 2009 16:21:55 -0500 Message-ID: <2781f020911021321s28070201ic396b79145832ca6@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Joseph Stewart To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA2LMLaU021363 Diego, First pass at running a non-trivial program (cross-compiled, no less) show this to pass the "smoke test". As always, thanks for working on this! -joe On Mon, Nov 2, 2009 at 4:19 PM, Diego Nehab wrote: > Hi, > >>> I plan to release the final version within the next couple >>> of weeks, so please take a look and see if you find any >>> issues you want fixed before then. >> >> Any specific area to look into? > > Not really. :) But sometimes my "bug tracking system" may > fail. The only two outstanding issues I am considering are > >    http://lua-users.org/lists/lua-l/2009-08/msg00342.html > > and > >    http://lua-users.org/lists/lua-l/2008-08/msg00446.html > > so no need to remind me of them. > > If there are other open issues I should to consider, please > let me know. > > Kind regards, > Diego > From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 20:46:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2MkqVX029571; Mon, 2 Nov 2009 20:46:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5ADB71A70E; Mon, 2 Nov 2009 20:45:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A08A1A660 for ; Mon, 2 Nov 2009 20:45:20 -0200 (BRST) Received: by qyk4 with SMTP id 4so2684068qyk.33 for ; Mon, 02 Nov 2009 14:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fbbYP1xwI8h58+wzmCJhrNfSN4hlOMpJ0TrGKex12tA=; b=CrZttjwzVZJnUtyCj/MjHKWavPgmKpv6kuIXKp9Q3sMZtMFLPyD/ELe28tJonvPxN+ d8/A6Em4B8eZx+GL8+NbwiRZw97oebxo2yFCHtKLDYThC8A2SIKRDx41F1VPWk+Q8waY SPGdMrBWVL0mG4OuzX3Yt28JvgjmFYc8WHDgw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mj6jB1y9Ntw66VSUNNtxKk3B72CD8bi4cX6bNaZROmeZUn7QD9KgHhXprzft0URsIz 8GuAnN169lHvPqG57vDxrESmb4+Qkw+mPdy9vfFuasNkPkGLEFUA+HRsqwKFRve7+ZXP PfwRUW385kJbYDqJoE3FptVevDwqry/MjpPvc= MIME-Version: 1.0 Received: by 10.224.104.130 with SMTP id p2mr3191347qao.164.1257201975879; Mon, 02 Nov 2009 14:46:15 -0800 (PST) In-Reply-To: References: <20091101001702.A16917@lua.tecgraf.puc-rio.br> Date: Mon, 2 Nov 2009 14:46:15 -0800 Message-ID: Subject: Re: Undocumented/Buggy Behavior with Function Definitions From: RJ Russell To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 12:04 PM, Eike Decker wrote: > It is not completely true that > function f () end > is translated to > f = function () end > For global variable assignments this might be true but not so for > local variables. > > Sample case of corner case: > local foo = "blah" > local foo = function () return foo end > print(foo()) -- prints "blah" > > The scope of the local variable is only starting after the assignment > has been finished, so this code > > local bar = function () return bar end > print(bar()) -- returns nil > > makes perfectly sense but is not what you might expecting to get. > Contrary: > > local function bar() return bar end > > will return the function itself as this a special case of assignment. > > Greetings, > Eike > I knew that for locals it was different, I was just worried about global. I found the problem in my code (real code-not the one I posted here) though. The function definition that I wanted to be detected by a __newindex in _G's metatable was already defined in an earlier file, so it wasn't detected. I thought that it showed that function foo() definitions don't cause __newindex events, but it was just because it wasn't a new index. That method of function documentation won't be very effective anyway (though I think it looks best), I'll go back to one on the wiki. Mine won't work in cases like local functions, already defined variables, and functions not in the global environment. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 20:51:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2MpB39030025; Mon, 2 Nov 2009 20:51:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 30A2B18444; Mon, 2 Nov 2009 20:49:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB29E1840A for ; Mon, 2 Nov 2009 20:49:41 -0200 (BRST) Received: by ewy26 with SMTP id 26so5504801ewy.5 for ; Mon, 02 Nov 2009 14:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=qmPKbqWJ8L76n6SfnPOgl/Zc0Fho7J4ykaLktfz+bbs=; b=bOyhKUtulmxVEzDU2ARtvqW240NGgw3oSzd8g6FS4eOFe7NeSWd9P0CVOp8XHh9SKk bDYkTi7bbuv3d7IjYAj4ukeb/INGnFu0DAI1G4nRygWVkJ1JNuF0nadYSKZOJXRO/dqW SKubUVQAUBA92ToACv4JNbEkSmcuYchVffjOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=fnCZOcP/T8B3Bv1Ptg58DELwHDOdvrUHTLgCwIkuXfoTXbwGCuluGC7LS+axgS++VZ pAiFRYvEAT1/aEYK9Ji4rgrligNLhCYD21TM8p/gXNKF8Sjfg1aRZRfVwYM7cBdbVTLM eFUUffWf1haBuisi0yHnFMm7bvOtU6kHaDn/U= MIME-Version: 1.0 Received: by 10.216.87.206 with SMTP id y56mr2039880wee.207.1257202237776; Mon, 02 Nov 2009 14:50:37 -0800 (PST) In-Reply-To: <20091102210542.GA4102@mike.de> References: <20091102135643.GA29657@mike.de> <20091102144328.GA31649@mike.de> <20091102210542.GA4102@mike.de> Date: Mon, 2 Nov 2009 17:50:37 -0500 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Mike Pall wrote: > Leo Razoumov wrote: > > Well, the next step in functions like __add(z1,z2) or __mul(z1,z2) > > will be to check that the second argument is indeed of the type > > "complex". Typically it is done with luaL_checkudata which (1) pulls > > object's metatable onto the stack (2) looks up the required metatable > > in the REGISTRY with lua_getfield(L, LUA_REGISTRYINDEX, tname) by its > > name string and (3) compares two metatables. It is a lot of overhead > > for +-/* of complex numbers. I do not see how LuaJIT can help here, > > for this overhead happens on the C-side of things outside of LuaJIT > > control. Is a good solution possible? > > You are still thinking too much interpreter-centric. *None* of > that involves calls to the C-side on the JIT side. Well, I am new to JIT concept and still learning. > The trace compiler records the _functionality_ of each bytecode, > not the actual C code involved. In effect it does a complete > simulation of every bytecode and all the associated metamethod > stuff, before it's even run. > > So here's what happens, if the trace recorder sees the BC_ADD: > - First it checks the runtime type of the two operands: since > these are userdata it resolves their metamethods, recording > every lookup on the way. > - Then it records the call to the resolved metamethod: it sees > that it's one of the special internal fast functions and runs > the associated recording handler. > - The recording handler checks that the arguments it got are > indeed of the right userdata type (recording the functionality > of the checks involved). Does it mean that if I use lua_getfield(L, LUA_REGISTRYINDEX, tname) in my implementation of __add(z1,z2) the hash lookup will be cached for further invocation?? In general, how effective is LuaJIT-2 in minimizing run-time type identification overhead? Is there LuaJIT-way different from (interpreted) Lua-way? Are there any common Lua idioms *not* recommended when writing Lua code and C-bindings targeting LuaJIT? Thanks for the great work!! --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 21:07:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2N70qg031464; Mon, 2 Nov 2009 21:07:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A89D189C4; Mon, 2 Nov 2009 21:05:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32BAF18434 for ; Mon, 2 Nov 2009 21:05:38 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N55ys-0001Ya-00; Tue, 03 Nov 2009 00:06:34 +0100 Date: Tue, 3 Nov 2009 00:05:56 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091102230556.GA13730@mike.de> References: <200911021308217969275@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911021308217969275@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean YangFan wrote: > Hi, Mike Pall > > LuaJIT 2.0 requires iuplua failed with the error messages shown below: > > -- LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ > -- JIT: ON CMOV SSE2 fold cse dce fwd dse narrow loop fuse > -- > require "iuplua" > -- attempt to call a nil value > -- stack traceback: > -- [C]: ? > -- [C]: in function 'require' > -- stdin:1: in main chunk > -- [C]: ? The IUP binaries (esp. imlua51.dll) apparently include hardcoded, bytecode-compiled Lua files. And they do not properly check for returned errors from luaL_loadbuffer(). So what happens is that (obviously) loading the bytecode fails (it's incompatible), the errors get ignored and the initialization of the library fails with the above message. Solution: file a bug against IUP. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 21:40:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2NeNXo002384; Mon, 2 Nov 2009 21:40:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA85B18FCC; Mon, 2 Nov 2009 21:38:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-06.prod.phx3.secureserver.net (p3plsmtpa01-06.prod.phx3.secureserver.net [72.167.82.86]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9496E18F02 for ; Mon, 2 Nov 2009 21:38:54 -0200 (BRST) Received: (qmail 3251 invoked from network); 2 Nov 2009 23:39:49 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-06.prod.phx3.secureserver.net (72.167.82.86) with ESMTP; 02 Nov 2009 23:39:49 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Mark Hamburg In-Reply-To: <20091102230556.GA13730@mike.de> Date: Mon, 2 Nov 2009 15:39:47 -0800 Content-Transfer-Encoding: 7bit Message-Id: <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 2, 2009, at 3:05 PM, Mike Pall wrote: > YangFan wrote: >> Hi, Mike Pall >> >> LuaJIT 2.0 requires iuplua failed with the error messages shown >> below: >> >> -- LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ >> -- JIT: ON CMOV SSE2 fold cse dce fwd dse narrow loop fuse >> -- > require "iuplua" >> -- attempt to call a nil value >> -- stack traceback: >> -- [C]: ? >> -- [C]: in function 'require' >> -- stdin:1: in main chunk >> -- [C]: ? > > The IUP binaries (esp. imlua51.dll) apparently include hardcoded, > bytecode-compiled Lua files. And they do not properly check for > returned errors from luaL_loadbuffer(). > > So what happens is that (obviously) loading the bytecode fails > (it's incompatible), the errors get ignored and the initialization > of the library fails with the above message. > > Solution: file a bug against IUP. To what extent did you change the instruction set v to what extent did you change the encoding of the instruction set? (I'm thinking about whether a bytecode translator is even reasonable to consider.) Mark From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 21:53:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA2NrBaL003616; Mon, 2 Nov 2009 21:53:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 621B21A72B; Mon, 2 Nov 2009 21:51:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D2661A70E for ; Mon, 2 Nov 2009 21:51:42 -0200 (BRST) Received: by pxi2 with SMTP id 2so3713727pxi.11 for ; Mon, 02 Nov 2009 15:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=4w1VY1tV+nh7mLWj6xrPQZ4f+zixKxWRuGBdJ/oqkfQ=; b=WWrHZIzB+IrQXVb0Mu1FjqhtqezzB+/ZlOpXkAptnAa21AlbjJ/Z3xw2RPk4EOwsbc fEuaWNDV5XKGTE7wTqUTY5uwUh5OaY8cFFqpx05JOQ9L3uMB6XV4g9IdnmQkuP6/VnBx ytww5k+8KH3kznKHxvrofD3h+pgMM6C/P7nVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=WElRRU491grXYXg9Vmwros9Wi8enn50uVGsg6vtr8jWNs+M2cQosb0G8qx6vmX1Szy zXjs04RKgFxq5pSD9RrP3zhiJCghXN4JRnWg077DF/GP6WKtNJbUFydrqt6SLjQn6Kax ajcEo0DxJ3ATzWr8IPSXgI0Hx8DGd+F4qfdMU= MIME-Version: 1.0 Received: by 10.143.20.38 with SMTP id x38mr970568wfi.233.1257205958086; Mon, 02 Nov 2009 15:52:38 -0800 (PST) In-Reply-To: <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> References: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> From: sagasw Date: Tue, 3 Nov 2009 07:52:18 +0800 Message-ID: <4de92fd0911021552t2222d4f9p58a5e2d25e1666f8@mail.gmail.com> Subject: Re: [ANN] Idle v1.0 To: Lua list Content-Type: multipart/alternative; boundary=00504502cc1e8a92ff04776c1298 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502cc1e8a92ff04776c1298 Content-Type: text/plain; charset=UTF-8 Thomas, I want to say, it is a great gift for me. I will try it and give you feedback. And I want to advice you to open a group or maillist for Idle, it would be helpful. sagasw On Tue, Nov 3, 2009 at 4:45 AM, Francesco Abbate wrote: > 2009/11/2 Thomas Lauer : > > After more than two years of development, I am happy to announce the > > release of Idle version 1.0. > > > > See http://idle.thomaslauer.com for details about Idle and > > http://idle.thomaslauer.com/IdleDownload.html for downloads. > > > > Idle is a compact, powerful scripting language based on Lua 5.1. It is > > available for Windows 2000 and later systems (a Linux/BSD/... release is > > neither available nor planned). Idle is released under the MIT licence. > > > > Anyone interested in the upcoming source code release please drop me a > > quick note as I a looking for a few volunteers to torture with a > > preliminary release of the sources. > > Hi Thomas, > > I've given a look to your page. It seems to me that Idle is not 'based > on Lua' but actually *is* Lua just with some customizations :-) > Actually the extensions you've introduced are pretty interesting and > I've thought myself to some of them in past but I didn't implement > nothing. For the the construct 'break n' that you've introduced: I > don't like it a lot and I rather prefer the approach of Perl with > labelled 'for' loop. I think it is much more elegant and readable. But > I recognize that this construct is actually useful and I was > disappointed with Python to discover that it doesn't have labelled > break. > > I was also interested in the gui module and I was wondering if it is > based on an existing toolkit or if you built it from scratch. > > Otherwise, I'm using Windows at work with mingw and I would be glad to > try your code. > > Best regards, > Francesco > --00504502cc1e8a92ff04776c1298 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thomas,

I want to say, it is a great gift for me.
I will try it= and give you feedback.
And I want to advice you to open a group or mail= list for Idle, it would be helpful.

sagasw

On Tue, Nov 3, 2009 at 4:45 AM, Francesco Abbate <francesco.bbt@gmail.com> wrote:
2009/11/2 Thomas Lauer <thoma= s.lauer@virgin.net>:
> After more than two years of develop= ment, I am happy to announce the
> release of Idle version 1.0.
>
> See http://i= dle.thomaslauer.com for details about Idle and
> http://idle.thomaslauer.com/IdleDownload.html for downloads.
>
> Idle is a compact, powerful scripting language based on Lua 5.1. It is=
> available for Windows 2000 and later systems (a Linux/BSD/... release = is
> neither available nor planned). Idle is released under the MIT licence= .
>
> Anyone interested in the upcoming source code release please drop me a=
> quick note as I a looking for a few volunteers to torture with a
> preliminary release of the sources.

Hi Thomas,

I've given a look to your page. It seems to me that Idle is not 'ba= sed
on Lua' but actually *is* Lua just with some customizations :-)
Actually the extensions you've introduced are pretty interesting and I've thought myself to some of them in past but I didn't implement<= br> nothing. For the the construct 'break n' that you've introduced= : I
don't like it a lot and I rather prefer the approach of Perl with
labelled 'for' loop. I think it is much more elegant and readable. = But
I recognize that this construct is actually useful and I was
disappointed with Python to discover that it doesn't have labelled
break.

I was also interested in the gui module and I was wondering if it is
based on an existing toolkit or if you built it from scratch.

Otherwise, I'm using Windows at work with mingw and I would be glad to<= br> try your code.

Best regards,
Francesco

--00504502cc1e8a92ff04776c1298-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:07:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA307Zca005397; Mon, 2 Nov 2009 22:07:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00A9E1A730; Mon, 2 Nov 2009 22:06:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 327901A67C for ; Mon, 2 Nov 2009 22:06:13 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N56vV-0005XR-00; Tue, 03 Nov 2009 01:07:09 +0100 Date: Tue, 3 Nov 2009 01:06:50 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103000650.GA16333@mike.de> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mark Hamburg wrote: > To what extent did you change the instruction set v to what extent did > you change the encoding of the instruction set? (I'm thinking about > whether a bytecode translator is even reasonable to consider.) http://lua-users.org/lists/lua-l/2008-07/msg00256.html http://lua-users.org/lists/lua-l/2008-07/msg00284.html Summary: Nope, use source code. Bytecode isn't shorter, anyway. Oh, and LJ2 doesn't even *have* a bytecode loader/dumper at the moment. It simply wasn't a priority. Open source projects using LJ2 have nothing to worry about, since they don't need to hide their Lua sources. The idea was to make a commercial add-on for bytecode handling. But I'm not sure it would pay off (required work + support overhead vs. money in return). There are cheaper ways to hide your Lua sources: simply compress and encrypt them. And bytecode is easy to reverse-engineer, too. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:10:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30Aqs7005713; Mon, 2 Nov 2009 22:10:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E3E41A737; Mon, 2 Nov 2009 22:09:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E11B71A731 for ; Mon, 2 Nov 2009 22:09:26 -0200 (BRST) Received: by ewy26 with SMTP id 26so5562941ewy.5 for ; Mon, 02 Nov 2009 16:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yrzn2siVLYbtgNfk3MbhIzY5tsYvqqZ47ayTaAfwZGI=; b=VJ+xu333/4nsRE8tdZxQltrCPfb9gzYV/gECDaK4e0W788KI9qtTBCd40ua+McBrJI 0ncEDehzc+obcL0tAfXt94KlHaCOF1yVEEG+EKFphKLpavu31CEMv/nb9PbuIAgHh7hh i4at0eTjFT9irvaLngv5MvAJfoOInxDw9p0pg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=SiRntxaQrPYl5rNgoKg9HT3Qdr9O1UYNFjEQmxVqTY5/zgRuZx5ZCKK/D1qsp2rq2w 6hSlSpfmy1T2KgrFFbjNS7fEzjBMpF9CFmQRrzmXmeZcWn6sOdueCvLkxv87UOggaqTO P+hwrgmkBecOX8pkCvhOJHMbM9mW71u5+jIUk= MIME-Version: 1.0 Received: by 10.216.90.136 with SMTP id e8mr5656793wef.110.1257207023113; Mon, 02 Nov 2009 16:10:23 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Nov 2009 16:10:22 -0800 Message-ID: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 5:24 AM, Leo Razoumov wrote: > On 2009-11-01, Mike Pall wrote: > By beating Fortran in few instances and coming reasonably close to > C/C++ performance on numerics LuaJIT-2 is becoming a viable candidate > for heavy number crunching applications. > > How difficult it is to add native Complex numbers to LuaJIT (C-99 compatible)? > By native I mean as little overhead over lua_Number as possible. What do people use complex numbers for? I'm baffled, me and two guys sitting near me, all with engineering degrees, did lots of pen and paper work with complex numbers in university, but I don't recall ever seeing an algorithm that would benefit from being coded, and I've never, in my 15+ years since graduation, seen any code that uses complex numbers. And yet... they keep appearing in the C standards, and now on the lua list... What are you guys using them for? Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:15:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30FeP7006167; Mon, 2 Nov 2009 22:15:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7D4618F06; Mon, 2 Nov 2009 22:14:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D90BB189C7 for ; Mon, 2 Nov 2009 22:14:10 -0200 (BRST) Received: by iwn5 with SMTP id 5so3784475iwn.11 for ; Mon, 02 Nov 2009 16:15:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2VyrizRqAzPnHgKAF5EOg8QfBKG5zzftCxqrg2ivTwo=; b=MLdu5w/Z8gDO0Gn0TnId1afez3V5LEIhejsyQl/2VwJMI1kG0WEoI+r3CECE6P/e7I 59Amu4dlojJardD6saOx1so1iEkSwPpMX7qPc4ADYfT6+QFAELPNw5zhOy2P4Dncb4sW l2eSHxE/i73JIgPEdvOcMPqyBJYduZM1qcOGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jyuX5UhWlZagTHw5dSScYbKp+QLjKsMCkmiNYhmQcq74eSkoGVhkQoAlNDwW4WI2CT Y333xHXGUB/8s8D5W7idxOqa/suaDM1l/tIv5YHZA45uoVEeIJax9VSHcE54NEz/7+nd jl8C0xpBSr8OxgFWx0CTVJT2UOsR/9/0KV1Ig= MIME-Version: 1.0 Received: by 10.231.25.160 with SMTP id z32mr5516960ibb.5.1257207306173; Mon, 02 Nov 2009 16:15:06 -0800 (PST) In-Reply-To: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> References: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> Date: Mon, 2 Nov 2009 16:15:05 -0800 Message-ID: <1079b050911021615kd4524car181b6c5ab25a874b@mail.gmail.com> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > What do people use complex numbers for? Signal processing. Quantum physics. Geometric Algebra-y computations. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:33:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30X0GH008109; Mon, 2 Nov 2009 22:33:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7E54190A3; Mon, 2 Nov 2009 22:31:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A17061908D for ; Mon, 2 Nov 2009 22:31:38 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N57K4-0007WV-B0 for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 00:32:32 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 2B71A17088 for ; Tue, 3 Nov 2009 00:32:29 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:42277 with envelope Message-ID: <4AEF7A1A.1000901@cowlark.com> Date: Tue, 03 Nov 2009 00:32:26 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> In-Reply-To: <20091103000650.GA16333@mike.de> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA30X0GH008109 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Pall wrote: [...] > Oh, and LJ2 doesn't even *have* a bytecode loader/dumper at the > moment. It simply wasn't a priority. Open source projects using > LJ2 have nothing to worry about, since they don't need to hide > their Lua sources. If at any point you felt inclined to formalise and document the LJ2 bytecode, it might be interesting as a target for other languages (assuming the bytecode is any easier to use than just emitting Lua, of course). In particular, if it turned out to be possible to bolt a Dalvik front end to the LJ2 backend, I'm pretty sure that you *would* end up ruling the world. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK73oaf9E0noFvlzgRAofGAJ93kroSRAFc8Z5D8Idsl+utlVGgqACfZA0F sP57MKbyaM6t9OppeZVsYSU= =3Qgv -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:38:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30c0cu008515; Mon, 2 Nov 2009 22:38:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A7B9190F7; Mon, 2 Nov 2009 22:36:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D44B190D3 for ; Mon, 2 Nov 2009 22:36:40 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N57Oz-0005YS-00; Tue, 03 Nov 2009 01:37:37 +0100 Date: Tue, 3 Nov 2009 01:37:31 +0100 From: Mike Pall To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091103003731.GA17238@mike.de> References: <20091102135643.GA29657@mike.de> <20091102144328.GA31649@mike.de> <20091102210542.GA4102@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > Does it mean that if I use lua_getfield(L, LUA_REGISTRYINDEX, tname) > in my implementation of __add(z1,z2) the hash lookup will be cached > for further invocation?? Your C side implementation doesn't matter that much. You _also_ need to add a recording handler to the JIT compiler. What you do there _does_ matter. If you emit the correct lookups, they can usually be hoisted. To get some idea of it, look at (say) setmetatable(). Check the C side of it in lib_base.c and then compare with recff_setmetatable in lj_record.c. > In general, how effective is LuaJIT-2 in minimizing run-time type > identification overhead? Is there LuaJIT-way different from > (interpreted) Lua-way? It's quite effective. There is no way I could explain all of this in two sentences. The FAQ has some links to papers on the subject. Or have a look at the output of -jdump for simple example loops. Then look into the LJ2 sources how it's done. > Are there any common Lua idioms *not* recommended when writing Lua > code and C-bindings targeting LuaJIT? Just writing a C-binding doesn't help. A call to an arbitrary, non-analyzable C function is not compiled at all right now. Even if I'll add that later, most optimizations would not be safe to use then. It would be slow, no matter what the compiler does. A future FFI with hints about side-effects may help somewhat. If you strive for a deeper embedding, you need to add functions to the core libraries, add recording handlers etc. Probably doable and even useful for the mentioned Complex data type. But not so useful for arbitrary C functions. Summary: Write more code in Lua -- LuaJIT 2.0 is fast enough. Reserve C code only for I/O and such. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:44:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30iZp2009046; Mon, 2 Nov 2009 22:44:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CB1C19104; Mon, 2 Nov 2009 22:43:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0151190DD for ; Mon, 2 Nov 2009 22:43:10 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N57VE-0005Z4-00; Tue, 03 Nov 2009 01:44:04 +0100 Date: Tue, 3 Nov 2009 01:43:46 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103004346.GB17238@mike.de> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEF7A1A.1000901@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > If at any point you felt inclined to formalise and document the LJ2 > bytecode, it might be interesting as a target for other languages > (assuming the bytecode is any easier to use than just emitting Lua, of > course). Emitting source is easier. But the semantic mismatches vs. other languages make this an unattractive option. LJ2 is an integrated VM and optimized for Lua. It's not a generic JIT compiler backend. The ideas in there are up for grabs. Adapt them to other languages and apply them to _their_ VMs. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 22:50:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA30o1K5009596; Mon, 2 Nov 2009 22:50:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D01D18F13; Mon, 2 Nov 2009 22:48:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE36F18ED1 for ; Mon, 2 Nov 2009 22:48:40 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1263982eye.39 for ; Mon, 02 Nov 2009 16:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=QJMStXoet6uU0W+ndgmfbX0CZnKLgVznZJHhzN+RjoM=; b=wWr3OJpVXwaYMxcoxY27p/OpzQovdjJv21OCPYfHbZmoLGt62BW9/dQl/xf0sRU7oq Sii6yw4UqxQBLBZtMQj7OkgxitdzbblvC5tkHNrIrJHf8I4jmRoXHUsrVcnsVetcHzbb k5JBgSM/fJrXTyGhaEuRwRnMtS5QJzsI63XAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=aAFySVBjzHnLd5z0S1e7Jv5hWoonH8GXdTWq7wPdF6DXPpVLhebP36OkitjhNlYk2D 9IBG0vzu2ofHQByUVc5fONPPagjjMO/HxrJNE6MtPeLDjS4+huFHXK1tHYG/2UxLMas1 7ZeKX9jI8nZV7+dfqusH/k5igiXvEP1nt08js= MIME-Version: 1.0 Received: by 10.216.91.81 with SMTP id g59mr5571271wef.128.1257209376088; Mon, 02 Nov 2009 16:49:36 -0800 (PST) In-Reply-To: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> References: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> Date: Mon, 2 Nov 2009 19:49:36 -0500 Message-ID: Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-02, Sam Roberts wrote: > > What do people use complex numbers for? > > I'm baffled, me and two guys sitting near me, all with engineering > degrees, did lots of pen and paper > work with complex numbers in university, but I don't recall ever > seeing an algorithm that would benefit > from being coded, and I've never, in my 15+ years since graduation, > seen any code that uses complex > numbers. > Pretty much entire signal processing, radio communications. Complex numbers are everywhere. Your cell-phone, WiFi, DSL modems, etc. Everywhere you have amplitude and phase, you work with complex numbers (cos and sin bases are not as convenient :-) Of course, in embedded systems the implementation is cycle/memory optimized and normally breaks complex-number operations into separate real and imaginary parts. But for the simulations (especially of non-bit exact floating point variety) complex data type is God sent. --Leo-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 23:05:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA315t1X011710; Mon, 2 Nov 2009 23:05:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3D611A668; Mon, 2 Nov 2009 23:04:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id DE358192A7 for ; Mon, 2 Nov 2009 23:04:31 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Mon, 02 Nov 2009 18:51:12 -0600 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 2 Nov 2009 20:05:24 -0500 Message-ID: <4AEF81D4.20603@elbitsystems-us.com> Date: Mon, 02 Nov 2009 20:05:24 -0500 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] References: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> In-Reply-To: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Nov 2009 01:05:24.0130 (UTC) FILETIME=[B9057820:01CA5C21] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sam Roberts wrote: > What do people use complex numbers for? In my own work I've used them for discrete systems (FFTs, signal processing, etc.). I've also used them for fun many times, just for exploring various transformations. And I've seen them used in some physics domains, too (can't say I'm an expert in QM, though). A generalization of complex numbers, quaternions, turns out to be good for smoothly rotating objects. So quaternions are used in many graphics libraries. Check it out at the Wikipedia [1]; it's pretty cool stuff. And if you have a mathematical bent, check out octonions, too [2,3]. [1] http://en.wikipedia.org/wiki/Quaternions [2] http://en.wikipedia.org/wiki/Octonions [3] http://math.ucr.edu/home/baez/octonions/octonions.html Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 23:13:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA31DoOm012477; Mon, 2 Nov 2009 23:13:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACF4F192B5; Mon, 2 Nov 2009 23:12:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C0E1192A8 for ; Mon, 2 Nov 2009 23:12:30 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA31DQEN012443 for ; Mon, 2 Nov 2009 23:13:26 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id nA31DQSC012441 for lua@bazar2.conectiva.com.br; Mon, 2 Nov 2009 23:13:26 -0200 Date: Mon, 2 Nov 2009 23:13:26 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091103011326.GA12105@duchamp.tecgraf.puc-rio.br> References: <20091102135643.GA29657@mike.de> <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I think that native support for complex numbers would be a *great* > plus for numerical calculations. I think also that complex numbers > should be supported, if possible, as a native type just like Asko's > LNUM patch is doing. Also, I'm not sure that you need a struct to > represent complex number, in C99 they are a native type just like > 'int' or 'double' My lcomplex library exports C99 complex numbers to Lua: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lcomplex From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 23:44:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA31iG2p015707; Mon, 2 Nov 2009 23:44:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E306B1A712; Mon, 2 Nov 2009 23:42:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6FCC21A684 for ; Mon, 2 Nov 2009 23:42:46 -0200 (BRST) Received: by yxe17 with SMTP id 17so5052487yxe.33 for ; Mon, 02 Nov 2009 17:43:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=Ibp/QMIqgjBvRwDNgS2Qx+YSGPQx7BSMYZsqK36sbgA=; b=Q1hErWiWRvzmrTsH13KQ82C1zblc2ML9fbJmq89DDHzdGchiRWgX+jK2/7s+uzvPK7 9kibjJDJ4uWZ2YHV7SjIw7zdNwld5fZYcztWCfn17VLx2lg/H7kuam5y+yzy0LbPGNtX kkEa5gdOKkXPBJ8jVq6A/KIstnjqZK5JslLdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=olkxjhyFqlgV/Vns/FraWIfT9DcWi7CqR88u+SoArX6wMn4w3rZfjsg93otobIaop7 83Diswexl84chsS7B5qh5FiSXnbusiWHgxXSKEaqcOFU7rrQ9n30SGDEqIaqDgUNPpEL yxPrAJbw6n1d9Ij5FzJJypqi1Vro5Yud2e0QA= Received: by 10.150.251.28 with SMTP id y28mr9325140ybh.185.1257212622148; Mon, 02 Nov 2009 17:43:42 -0800 (PST) Received: from ?192.168.1.4? (r190-134-22-87.dialup.adsl.anteldata.net.uy [190.134.22.87]) by mx.google.com with ESMTPS id 4sm2306619ywd.59.2009.11.02.17.43.40 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 17:43:41 -0800 (PST) Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: Jorge To: Lua list In-Reply-To: <1079b050911021615kd4524car181b6c5ab25a874b@mail.gmail.com> References: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> <1079b050911021615kd4524car181b6c5ab25a874b@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 02 Nov 2009 23:43:37 -0200 Message-ID: <1257212617.2764.6.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 2009-11-02 at 16:15 -0800, Wesley Smith wrote: > > What do people use complex numbers for? > > Signal processing. Quantum physics. Geometric Algebra-y computations. And getting the roots of 2nd degree polinomials in high school. From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 23:50:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA31oN2a016237; Mon, 2 Nov 2009 23:50:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BEE6192C3; Mon, 2 Nov 2009 23:49:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hsmail.qwknetllc.com (hsmail.qwknetllc.com [208.71.137.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C279E192B1 for ; Mon, 2 Nov 2009 23:49:01 -0200 (BRST) Received: (qmail 2954 invoked by uid 399); 2 Nov 2009 18:49:57 -0700 Received: from unknown (HELO ?192.168.1.107?) (jjensen@workspacewhiz.com@24.10.200.9) by hsmail.qwknetllc.com with ESMTPAM; 2 Nov 2009 18:49:57 -0700 X-Originating-IP: 24.10.200.9 Message-ID: <4AEF8C40.1070703@workspacewhiz.com> Date: Mon, 02 Nov 2009 18:49:52 -0700 From: Joshua Jensen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> In-Reply-To: <20091103004346.GB17238@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ----- Original Message ----- From: Mike Pall Date: 11/2/2009 5:43 PM > David Given wrote: > >> If at any point you felt inclined to formalise and document the LJ2 >> bytecode, it might be interesting as a target for other languages >> (assuming the bytecode is any easier to use than just emitting Lua, of >> course). >> > Emitting source is easier. But the semantic mismatches vs. other > languages make this an unattractive option. > Metalua, I believe, outputs bytecode. I haven't had much success with its source output. So, I imagine, without a bytecode translator or a LuaJIT emitter added to Metalua, it isn't possible to use Metalua extensions with LuaJIT. Just talking out loud. I haven't tried LuaJIT 2 yet, but I am very impressed by the benchmarks. Josh From lua-bounces@bazar2.conectiva.com.br Mon Nov 2 23:54:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA31s73C016658; Mon, 2 Nov 2009 23:54:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 406491A733; Mon, 2 Nov 2009 23:52:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F4591A680 for ; Mon, 2 Nov 2009 23:52:44 -0200 (BRST) Received: by pwj9 with SMTP id 9so2215779pwj.21 for ; Mon, 02 Nov 2009 17:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5doGEIsbRRt6ugGak9wxoKTo/62dplb/wq6Hgc80TSw=; b=u/NnnsnQtzpHSUJy4dve6K1F5WWpEfWKII8Mhccvqzwkz989/eGFVx+NgJTz0Q9Fuq +MUv1z+459deow5DH3bQfLDexT+rPrbeSjLfrrS0JHbjoHPSclIoDK16dTdamovKZT86 eHA53ELGNG7v3cDzSo/bRP5jE0s3RCkbz+SdA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=qNuxs2OhwNwQXWgtVBDhnXNCCZGDib+A3SciZ/jmb+xzuCabbvUTKnCiwM4z5uCnoL QZ4VHdskBcRprUs5lnVbeDnMjf7favlcAyJ1y6GPVh9HcubtYpc5aVGrr+FknA65ibof ArkHOiZ/gbimgKKqBJtg+UE2OOLoDCD2E+Peg= MIME-Version: 1.0 Received: by 10.140.193.10 with SMTP id q10mr372756rvf.42.1257213218998; Mon, 02 Nov 2009 17:53:38 -0800 (PST) In-Reply-To: <4AEF8C40.1070703@workspacewhiz.com> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> Date: Tue, 3 Nov 2009 04:53:38 +0300 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA31s73C016658 >>> If at any point you felt inclined to formalise and document the LJ2 >>> bytecode, it might be interesting as a target for other languages >>> (assuming the bytecode is any easier to use than just emitting Lua, of >>> course). >> Emitting source is easier. But the semantic mismatches vs. other >> languages make this an unattractive option. > Metalua, I believe, outputs bytecode.  I haven't had much success with its > source output.  So, I imagine, without a bytecode translator or a LuaJIT > emitter added to Metalua, it isn't possible to use Metalua extensions with > LuaJIT. I would be interested in LuaJIT-compatible backend for Metalua. This is, indeed, a way to rule, if not the whole world, but at least quite a part of it! ;-) Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 01:30:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA33U455024895; Tue, 3 Nov 2009 01:30:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB2191A73B; Tue, 3 Nov 2009 01:28:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas01p.mx.bigpond.com (nskntmtas01p.mx.bigpond.com [61.9.168.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E834D1A734 for ; Tue, 3 Nov 2009 01:28:33 -0200 (BRST) Received: from nskntotgx03p.mx.bigpond.com ([121.217.55.96]) by nskntmtas01p.mx.bigpond.com with ESMTP id <20091103032924.XXLJ10503.nskntmtas01p.mx.bigpond.com@nskntotgx03p.mx.bigpond.com> for ; Tue, 3 Nov 2009 03:29:24 +0000 Received: from [10.0.0.8] (really [121.217.55.96]) by nskntotgx03p.mx.bigpond.com with ESMTP id <20091103032923.CKAE24930.nskntotgx03p.mx.bigpond.com@[10.0.0.8]> for ; Tue, 3 Nov 2009 03:29:23 +0000 Message-ID: <4AEFA15A.30008@bigpond.net.au> Date: Tue, 03 Nov 2009 14:19:54 +1100 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> In-Reply-To: <4AEF8C40.1070703@workspacewhiz.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nskntotgx03p.mx.bigpond.com from [121.217.55.96] using ID btolputt@bigpond.net.au at Tue, 3 Nov 2009 03:29:23 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150204.4AEFA394.001B,ss=1,pt=SMP_3_AMIR10528,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: > Metalua, I believe, outputs bytecode. I haven't had much success with > its source output. So, I imagine, without a bytecode translator or a > LuaJIT emitter added to Metalua, it isn't possible to use Metalua > extensions with LuaJIT. Which would be an incredible pain for me... Metalua is a god-send for using idioms like try/catch/finally in Lua. I haven't dug too deep into Metalua, but if it were compiled with LuaJIT-2, would it "just work"? -- Regards, Benjamin Tolputt Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 01:36:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA33aGcS025427; Tue, 3 Nov 2009 01:36:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A76A41A73F; Tue, 3 Nov 2009 01:34:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B805B1A739 for ; Tue, 3 Nov 2009 01:34:54 -0200 (BRST) Received: by yxe17 with SMTP id 17so5114078yxe.33 for ; Mon, 02 Nov 2009 19:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=+aDPM0QlwnQQN1Q/ceW0s/J7GTp32eQSDndZDi45vXc=; b=kKJQ83Z/j9MmtaJe3gSy1vxgWvnch8LUciCRI7lCTh0simLL9gyWUovo0OCSOFD+zY tF178Y12KlAwxbT5fsBOxplcDOiVXyZ8y5//SV2A8rCX+Ji/YlQP/QBPzO2vjYF0Ssxq miiKG4mcwTMQ/lqOsuR5LpQTI2S+IRbzq0gMk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=EL2f8a2V78ixOkpA9XMNlY1hXMY73bC4SfKRP8HsGncZjMnqwBFVHeMXNRQg8++y31 LvnPgyW5r39962SgSMja6wGW2Z+4AVE/h8cQQPCwqjr3EGQFNBMkdxuYCf7pOg4O6gsF CEQXGGa3TmqrW3a5paRDk8Z3/kbAmu1ZrIgcM= MIME-Version: 1.0 Received: by 10.91.54.8 with SMTP id g8mr3496186agk.83.1257219348771; Mon, 02 Nov 2009 19:35:48 -0800 (PST) In-Reply-To: <4AEFA15A.30008@bigpond.net.au> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> Date: Tue, 3 Nov 2009 09:35:48 +0600 X-Google-Sender-Auth: 9a67c8efa1d18bb1 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA33aGcS025427 > if it were compiled with LuaJIT-2, would it "just work"? No, it was already discussed before (when Mike announced that he altered bytecode format). Someone needs to provide a new bytecode backend. -- e.v.e On Tue, Nov 3, 2009 at 9:19 AM, Benjamin Tolputt wrote: > Joshua Jensen wrote: >> Metalua, I believe, outputs bytecode.  I haven't had much success with >> its source output.  So, I imagine, without a bytecode translator or a >> LuaJIT emitter added to Metalua, it isn't possible to use Metalua >> extensions with LuaJIT. > > Which would be an incredible pain for me... Metalua is a god-send for > using idioms like try/catch/finally in Lua. I haven't dug too deep into > Metalua, but if it were compiled with LuaJIT-2, would it "just work"? > > -- > Regards, > > Benjamin Tolputt > Analyst Programmer > > From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 01:42:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA33gb3n025955; Tue, 3 Nov 2009 01:42:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33D911A742; Tue, 3 Nov 2009 01:41:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 224631A73C for ; Tue, 3 Nov 2009 01:41:13 -0200 (BRST) Received: by bwz27 with SMTP id 27so7102546bwz.21 for ; Mon, 02 Nov 2009 19:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=UoS4TAoJh6QlGR8yqjz3M4fz9cfRGQ5I3m0ebXK65kM=; b=d1kDvergBcn8QvhE1Y7pdjopAeKl1YAPUOmEzl2yHkD3EpewGAwgVPk6MF40VguOr8 RR8IVfeOhVbcTPUg/xMaeF2calVzyqVlVMvZtixpEssX8kga33f0TCwWlekvloZGPrzT uFZ8/WZ8SN2PXLkagOyNkX7AUdCx9rxR0MoUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=SnTsSuB5mD/wTdDeHXgVK0kmQGTwZGbTaSSLQRZ/roNZSW81ClUAE85+BQy+qk8FNk S6qtBOnvi6Wx392r0wFEXoizjdT+n2FCqFzvZ56TmOShhTWz0OIjreehmBiqwZ4Yd+ed niqZrg6DZPAbWh8qLGFkk/bQbW+mcgzsBaPhs= MIME-Version: 1.0 Received: by 10.204.34.71 with SMTP id k7mr4546970bkd.206.1257219730197; Mon, 02 Nov 2009 19:42:10 -0800 (PST) In-Reply-To: References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> From: Hisham Date: Tue, 3 Nov 2009 01:41:50 -0200 Message-ID: <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA33gb3n025955 On Sun, Nov 1, 2009 at 7:15 AM, Geoff Leyland wrote: > I changed lines 223&4 of cfg.lua to > >   defaults.variables.CC = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch > i686 -arch x86_64" >   defaults.variables.LD = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch > i686 -arch x86_64" > > Which got me a a universal binary for lfs: Alternatively, you could have edited your ~/.luarocks/config.lua file and added: variables = { CC = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch x86_64", LD = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch x86_64" } and that would override the defaults set by luarocks.cfg. Unfortunately, the sad truth is that this will not guarantee that every rock will correctly build as universal binaries, since not all Makefile-based projects honor these variables (many authors hardcode 'gcc' in their Makefiles...). LuaRocks' "builtin" build engine, in which it launches the compiler without using make, uses those variables, so rocks using it will work. Having said that, I'm thinking about which would be the best way to proceed in providing support for universal binaries in LuaRocks. A flag in the configure script? A special variable in the configuration file? A command-line flag? The usual way to shy away from design decisions is to just provide all of the above and justify it with "giving users choice", but mixing fat and thin binaries in the same local rocks tree sounds like a bad idea, so doing that as a command-line flag sounds like a recipe for trouble. Maybe a special variable to the configuration file, just to make it easier than resetting variables.CC and variables.LD. There's also the issue of how to identify architectures. In my iBook G4, for example, "luarocks pack luafilesystem" generates a file called "luafilesystem-1.5.0-1.macosx-powerpc.rock". How should multi-architecture binaries be identified? Using "universal" as an arch identifier is probably too vague, since at one point that meant "powerpc+x86" and now it seems to mean "x86+x86_64". This complicates things a bit, so there would have to be support for "fat rocks". Will have to think a bit more about that... -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 01:51:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA33pTnB026744; Tue, 3 Nov 2009 01:51:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0D501A73D; Tue, 3 Nov 2009 01:50:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas01p.mx.bigpond.com (nskntmtas01p.mx.bigpond.com [61.9.168.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D0081A684 for ; Tue, 3 Nov 2009 01:50:06 -0200 (BRST) Received: from nskntotgx02p.mx.bigpond.com ([121.217.55.96]) by nskntmtas01p.mx.bigpond.com with ESMTP id <20091103035103.ZFMU10503.nskntmtas01p.mx.bigpond.com@nskntotgx02p.mx.bigpond.com> for ; Tue, 3 Nov 2009 03:51:03 +0000 Received: from [10.0.0.8] (really [121.217.55.96]) by nskntotgx02p.mx.bigpond.com with ESMTP id <20091103035102.HWMD5306.nskntotgx02p.mx.bigpond.com@[10.0.0.8]> for ; Tue, 3 Nov 2009 03:51:02 +0000 Message-ID: <4AEFA65F.8080004@bigpond.net.au> Date: Tue, 03 Nov 2009 14:41:19 +1100 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> In-Reply-To: Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nskntotgx02p.mx.bigpond.com from [121.217.55.96] using ID btolputt@bigpond.net.au at Tue, 3 Nov 2009 03:51:02 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150202.4AEFA8A6.0125,ss=1,pt=SMP_3_AMIR10528,fgs=0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vyacheslav Egorov wrote:
if it were compiled with LuaJIT-2, would it "just work"?
    

No, it was already discussed before (when Mike announced that he
altered bytecode format). Someone needs to provide a new bytecode
backend.
  

I am aware of the byte-code change. My question could be better defined as

"Given Metalua is written IN Lua (to my knowledge) - should it be used by LuaJIT-2, will it use the new byte-codes automatically or does it have them defined as constants that would need to be changed/altered?"

For most Lua libraries, I wouldn't even ask as I would assume (being written in Lua) that they'd just work. However, given the fact Metalua does play with the AST of code it compiles - I thought the question more pertinent.

The next big library for me to work out how to get LuaJIT-2 compatible is Pluto. It didn't work with LuaJIT-1 for a variety of reasons, but I am hoping perhaps there is a way to get it working for this version of LuaJIT. Will wait on a more stable version though before I dig into that project.

-- 
Regards,

Benjamin Tolputt
Analyst Programmer
From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 02:23:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA34NNJR029679; Tue, 3 Nov 2009 02:23:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 993B51924D; Tue, 3 Nov 2009 02:21:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9072B191EF for ; Tue, 3 Nov 2009 02:21:43 -0200 (BRST) Received: by ywh40 with SMTP id 40so5124351ywh.33 for ; Mon, 02 Nov 2009 20:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=1N+l8rGJCVwJ+jU+17ed2aW9B+YlslLwBCAdavNNhEk=; b=iecsFs7CTCD3XcD2zLu6hTRVGlOmtUP4nh9JV3oqZ2au1ujX25zB/8wRFrBwK85ymj C1D4278llBessgNY6Ahg00SwFRM3fKb/zKNR4S0Yo/RD0mcOKjykOM9gpS1z50EgQEBc JkkUkbcesVs0bwiebEBaWz8w4nRkDxiSrDpVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=vMzQ4xSXb3XTDejyFC+RfsOksAIvySAkNQL6mBH/4kWsWrr+COK8eV1LX8RG9XBZRL V2q6D56/ytVy2/w+FJP1OpRnbAnCi1a9S9al3Aze4bZBAl5Z/IEcsoW0BPswwjYtHkvy /f+bl3c6b/ZWgwi4oepz41ThK1rxLqX0/k810= MIME-Version: 1.0 Received: by 10.90.180.16 with SMTP id c16mr10351454agf.15.1257222159085; Mon, 02 Nov 2009 20:22:39 -0800 (PST) In-Reply-To: <4AEFA65F.8080004@bigpond.net.au> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> Date: Tue, 3 Nov 2009 10:22:38 +0600 X-Google-Sender-Auth: 6d3777537f4dd75a Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I should correct myself: it seems that there is no bytecode frontend in Lua JIT now, so it is not possible to create Lua JIT backend for metalua. The only option is to provide a source code backend for metalua. But as far as I remember metalua can produce irreducable control flow graphs (AST contains `Goto constructs). So translation into source is not a straightforward task. > > "Given Metalua is written IN Lua (to my knowledge) - should it be used by > LuaJIT-2, will it use the new byte-codes automatically or does it have them > defined as constants that would need to be changed/altered?" > The answer is no: even if Lua JIT had bytecode frontend, metalua would not be able to adapt itself automatically. Metalua inherited it's backend from Yueliang which is just rewrite of several modules (lcode.c, ldump.c) from C into pure Lua. When this modules change in original Lua sources, metalua backend must be changed to accommodate it. -- e.v.e On Tue, Nov 3, 2009 at 9:41 AM, Benjamin Tolputt wrote: > Vyacheslav Egorov wrote: > > if it were compiled with LuaJIT-2, would it "just work"? > > > No, it was already discussed before (when Mike announced that he > altered bytecode format). Someone needs to provide a new bytecode > backend. > > > I am aware of the byte-code change. My question could be better defined as > > "Given Metalua is written IN Lua (to my knowledge) - should it be used by > LuaJIT-2, will it use the new byte-codes automatically or does it have them > defined as constants that would need to be changed/altered?" > > For most Lua libraries, I wouldn't even ask as I would assume (being written > in Lua) that they'd just work. However, given the fact Metalua does play > with the AST of code it compiles - I thought the question more pertinent. > > The next big library for me to work out how to get LuaJIT-2 compatible is > Pluto. It didn't work with LuaJIT-1 for a variety of reasons, but I am > hoping perhaps there is a way to get it working for this version of LuaJIT. > Will wait on a more stable version though before I dig into that project. > > -- > Regards, > > Benjamin Tolputt > Analyst Programmer From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 02:52:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA34qkEh031909; Tue, 3 Nov 2009 02:52:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E944192E8; Tue, 3 Nov 2009 02:51:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B20B7192E2 for ; Tue, 3 Nov 2009 02:51:21 -0200 (BRST) Received: by ywh40 with SMTP id 40so5138531ywh.33 for ; Mon, 02 Nov 2009 20:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=eYsyjmwu7jTwr7/33/4bLV1Q5bDFkBaTRpxMI/zVuBM=; b=QhPLJJVcn9KHyBaydKyY/HOccGr5RGuV5Rhgvc1ngvfEXVL3kjQxcBdB4EMmeFqZXQ cLdugCwGIDPh6fEw3jDY0tKNRTA4Xk+O6KEn0+eyl2KEMlG/skVeCO+f5Yn4jz+vl3tg f2orUotQ9Eh9gEC8bPGsoG9LwAedN5D4IkWr4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=GYgG9z49pV63jlWY1J3jiuXslxNr1bPah+a0747Um5owlkbdtk1D5VnLPsD62jSsr6 kEWe4UWbyOMlkeRbVfs2b8xAlJBu1XezzvuBkMCKF9OTv6AMlj1HyS6zcYpyHYpAbyML uCGJBss+82PPjvMd7GVnyb3Czk68JpclZhZbA= Received: by 10.100.224.20 with SMTP id w20mr664884ang.160.1257223938339; Mon, 02 Nov 2009 20:52:18 -0800 (PST) Received: from ?192.168.1.3? ([124.13.55.37]) by mx.google.com with ESMTPS id 39sm1664648yxd.45.2009.11.02.20.52.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 20:52:17 -0800 (PST) Message-ID: <4AEFB6FC.6030700@gmail.com> Date: Tue, 03 Nov 2009 12:52:12 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vyacheslav Egorov wrote: > [snip] >> "Given Metalua is written IN Lua (to my knowledge) - should it be used by >> LuaJIT-2, will it use the new byte-codes automatically or does it have them >> defined as constants that would need to be changed/altered?" > > The answer is no: even if Lua JIT had bytecode frontend, metalua would > not be able to adapt itself automatically. Metalua inherited it's > backend from Yueliang which is just rewrite of several modules > (lcode.c, ldump.c) from C into pure Lua. When this modules change in > original Lua sources, metalua backend must be changed to accommodate > it. IIRC, I don't think Metalua has any constraints, beyond where the author wants to take it. Yueliang's constraint is an artificial one in order to have convenient roughly-one-to-one correspondence as an academic toy. Thus Yueliang intentionally does not do anything much beyond being a mimic, while Fabien is taking Metalua in many interesting directions. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 04:03:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA363Gk7005732; Tue, 3 Nov 2009 04:03:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 382CA1A683; Tue, 3 Nov 2009 04:01:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6904E190AC for ; Tue, 3 Nov 2009 04:01:30 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so219465fgb.17 for ; Mon, 02 Nov 2009 22:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Q0dFru+E0ciRDk3jl49gES77WY9f7J6n9KSAf7JI/I0=; b=xGvF1x/EWCMBB4PQhKDQUXEXxROL8Jgxc93zVbtv6FT9CYT1CR7DYp/3sHQDjClDw+ 3kwYwuA/7qQ80tTiBWXLQn8kbGt5k81iTyT+Z4Ehm+Ynl0kzFec0LUsLl0FVU/ijxI+I TL6fDls6S7VakGBfsSxZBlp6UpfxGrKnLUj7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZWeccQQWl+PE3C8s6FUysw1O1/8raJ5kqxmifSN7xUPDqJUYuAe8CvgFsqmtAZ1Ufe iL4zauGS0lds5DUCGa0JkIKYeUIOMJQq5SXDZ4MB6FnFC7BvWxj/FEKes2aoQV2OnejC Of/peJfT0B82lp6EKTepCJNFoq5MesJRaiWNQ= MIME-Version: 1.0 Received: by 10.103.37.34 with SMTP id p34mr2524982muj.84.1257228145839; Mon, 02 Nov 2009 22:02:25 -0800 (PST) In-Reply-To: References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> Date: Tue, 3 Nov 2009 07:02:25 +0100 X-Google-Sender-Auth: 61acc9c3579e1f6a Message-ID: <956373d40911022202p753e0a12y8cc194cf864dc6b6@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=0016e659fcc808ce600477713d5f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e659fcc808ce600477713d5f Content-Type: text/plain; charset=ISO-8859-1 On Tue, Nov 3, 2009 at 2:53 AM, Alexander Gladysh wrote: > I would be interested in LuaJIT-compatible backend for Metalua. This > is, indeed, a way to rule, if not the whole world, but at least quite > a part of it! ;-) > There are some bytecode changes due for Lua 5.2 anyway, so that will be the occasion to go back to bytecode generator issues. Generating sources would have it limits: a couple of Metalua constructs don't exist in Lua, and fixing line numbers in tracebacks would be tricky (they should be in sync with the Metalua source, not with an hypothetical plain Lua intermediate representation). The "proper" way would probably be to fork a LuaJIT version with a dedicated interface, but it won't be trivial: I guess LuaJIT expects some sort of regularity in jumps (such as "no jumps from outside to inside a block"), and statements-in-an-expression-context violate a couple of Lua invariants. --0016e659fcc808ce600477713d5f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Nov 3, 2009 at 2:53 AM, Alexander Gladys= h <agladysh@gmai= l.com> wrote:
I would be interested in LuaJIT-compatible backend for Me= talua. This
is, indeed, a way to rule, if not the whole world, but at least quite
a part of it! ;-)

There are some byteco= de changes due for Lua 5.2 anyway, so that will be the occasion to go back = to bytecode generator issues.

Generating sources w= ould have it limits: a couple of Metalua constructs don't exist in Lua,= and fixing line numbers in tracebacks would be tricky (they should be in s= ync with the Metalua source, not with an hypothetical plain Lua intermediat= e representation).

The "proper" way would probably be to fork a = LuaJIT version with a dedicated interface, but it won't be trivial: I g= uess LuaJIT expects some sort of regularity in jumps (such as "no jump= s from outside to inside a block"), and statements-in-an-expression-co= ntext violate a couple of Lua invariants.

=A0
--0016e659fcc808ce600477713d5f-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 04:14:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA36Dwne006903; Tue, 3 Nov 2009 04:13:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4832B1914C; Tue, 3 Nov 2009 04:12:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 609F8190F7 for ; Tue, 3 Nov 2009 04:12:34 -0200 (BRST) Received: by bwz27 with SMTP id 27so7175215bwz.21 for ; Mon, 02 Nov 2009 22:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=vZs7Jc3eNk9Y6MKMIkS9MXf+kjvSYpHjG/DQ8iw2loE=; b=PgToqfIV29NUCraZv5ec7YUJB1YEpnuK2bcBuOyoeonBZ9dKpxaJEWoWpbIGTtt63D SHkyduWcxg0S9+zfQxuyyMYcvguywdO9LLcN7Px5Q4kHuHIsqb64DH/EI184fc2G1yzl jPk0VGvvaAimE4WJTZ12Df0W0lo9dr4Ml7qY0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RQJWdTiu3t+eoImfdH0de09H/okj06GJsg/xHNIsrUts+GZBbTHvX/yUMvkixxL9VK eGnz5p4mtEP4Z77nWyiVyVWTceds2i3hzx14mO69aOrJhLoGgHiincXL366GeXr7Bf4t HbSeoCtc1vsEriGeP9Ic0ndG0OIAW0hBmIjUw= MIME-Version: 1.0 Received: by 10.239.138.12 with SMTP id n12mr675333hbn.69.1257228809810; Mon, 02 Nov 2009 22:13:29 -0800 (PST) In-Reply-To: <1079b050911021615kd4524car181b6c5ab25a874b@mail.gmail.com> References: <17eac67c0911021610l26a94e8dm667baeb8c3b0e97c@mail.gmail.com> <1079b050911021615kd4524car181b6c5ab25a874b@mail.gmail.com> Date: Tue, 3 Nov 2009 08:13:29 +0200 Message-ID: <560972290911022213h4ebe49a4u2378c7e033246349@mail.gmail.com> Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA36Dwne006903 On Tue, Nov 3, 2009 at 2:15 AM, Wesley Smith wrote: > Signal processing.  Quantum physics.  Geometric Algebra-y computations. In physics, real numbers are a special case of complex numbers ;) Which is one reason why Fortran still has such a strong following among the number-crunching fraternity, apart from it being easier to optimize than C. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 04:20:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA36KfqS007528; Tue, 3 Nov 2009 04:20:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A78D71A614; Tue, 3 Nov 2009 04:19:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8C421916D for ; Tue, 3 Nov 2009 04:19:11 -0200 (BRST) Received: by iwn5 with SMTP id 5so3956529iwn.11 for ; Mon, 02 Nov 2009 22:20:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.124.227 with SMTP id v35mr2666715ibr.18.1257229207289; Mon, 02 Nov 2009 22:20:07 -0800 (PST) In-Reply-To: References: <200911021308217969275@gmail.com> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> Date: Tue, 3 Nov 2009 01:20:07 -0500 X-Google-Sender-Auth: d63f2dca629bd306 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 11:22 PM, Vyacheslav Egorov wrote: > it seems that there is no bytecode frontend in Lua JIT now, so it is > not possible to create Lua JIT backend for metalua. > > The only option is to provide a source code backend for metalua. But > as far as I remember metalua can produce irreducable control flow > graphs (AST contains `Goto constructs). So translation into source is > not a straightforward task. True. Conceptually, Metalua does these two steps: (A) translates a source code string--either plain Lua or Lua with extended syntax--into an AST of the form given in [1]. This step is implemented in pure Lua code, and the emitted AST is in the form of Lua tables. (B) translates the AST into Lua bytecodes. This step is also implemented in pure Lua code based on Yueliang (a port of the the Lua compiler to Lua). However, the output is normally standard Lua 5.1 bytecodes. So, you should be able to use Metalua under LuaJIT2 to perform steps A and/or B provided you don't use any Metalua extensions modules implemented in Metalua without first rewriting them in terms of standard Lua. However, I understand you can't run those bytecodes in LuaJIT2 without perhaps some ugly portability layer. You may, however, replace step B with your own generator. This could, for example, output LuaJIT2 bytecodes if LuaJIT2 added such an interface for reading those bytecodes. Alternately you could emit standard Lua source. Metalua 0.5 already has a module to do that latter [2] for standard Lua ASTs. This module is implemented in Metalua, but it is easy enough to rip out the Metalua syntax extensions and replace them with standard Lua. Now, emitting standard Lua source has a couple issues, each of which can be addressed in a few different ways. The first problem is that the Metalua AST [1] has a couple of extensions outside of standard Lua syntax. These are `Goto/`Label and `Stat nodes. `Goto/`Label are for gotos. `Stat executes statements inside of expressions, which can frequently occur upon expanding syntax extensions and macros. Though you can achieve `Stat with closures, the purpose of `Stat is to avoid closures for efficiency sake. `Stat nodes perhaps can be avoided. I had once written a source code optimizer that can inline function calls [3], and the primary motivation of that was to eliminate the need for special bytecode generation for `Stat nodes in Metalua. Similarly, maybe LuaJIT2 would negate these efficiency concerns as well. The problems handling `Goto/`Label still remain, but I suppose there are ways to automatically translate gotos in plan Lua code or even patch Lua to support gotos. The Clue discussions [5-6] went into that. This problem is mitigated, however, in that that not all Metalua extensions emit `Goto/`Label nodes. If you avoid those extensions or rewrite them in such a way not to emit these nodes, you won't have a problem. The same can be said about `Stat. The second problem is that standard Lua source does not allow emitting meaningful debug information like line numbers are symbol names. This problem has been mentioned a number of times in the context of Lua source preprocessing. You might implicitly achieve this by formatting your generated Lua code in such a way that line numbers in the original and generated sources match up, but this might not be always possible. There have been suggestions to allow pragmas to be inserted into the Lua source to alter line numbers somewhat like the C preprocessor [6], and something similar might be done for symbols. This is a second reason why Metalua implements its own bytecode generator. This second problem is likely easily solved by a patch to the Lua parser though. Though I agree it is helpful to think of Lua source as its own type of portable bytecode, a few Lua syntax extensions as described above could make it more effective in this regard. [1] http://metalua.luaforge.net/manual006.html#toc17 [2] http://github.com/fab13n/metalua/blob/0.5-branch/src/lib/metalua/ast_to_string.mlua [3] http://lua-users.org/wiki/SourceOptimizer [5] http://lua-users.org/lists/lua-l/2008-07/msg00114.html [6] http://lua-users.org/lists/lua-l/2008-07/msg00238.html [7] http://lua-users.org/lists/lua-l/2009-05/msg00288.html From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 04:31:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA36V5Uu008391; Tue, 3 Nov 2009 04:31:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB5CD1A686; Tue, 3 Nov 2009 04:29:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth14.prod.mesa1.secureserver.net (smtpauth14.prod.mesa1.secureserver.net [64.202.165.39]) by bazar2.conectiva.com.br (Postfix) with SMTP id 58E341A67C for ; Tue, 3 Nov 2009 04:29:40 -0200 (BRST) Received: (qmail 27775 invoked from network); 3 Nov 2009 06:30:36 -0000 Received: from unknown (98.117.140.83) by smtpauth14.prod.mesa1.secureserver.net (64.202.165.39) with ESMTP; 03 Nov 2009 06:30:35 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Mark Hamburg In-Reply-To: <20091103000650.GA16333@mike.de> Date: Mon, 2 Nov 2009 22:30:35 -0800 Content-Transfer-Encoding: 7bit Message-Id: <88129A9C-D790-4E22-BBAB-7CE27EABA780@grubmah.com> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 2, 2009, at 4:06 PM, Mike Pall wrote: > Mark Hamburg wrote: >> To what extent did you change the instruction set v to what extent >> did >> you change the encoding of the instruction set? (I'm thinking about >> whether a bytecode translator is even reasonable to consider.) > > http://lua-users.org/lists/lua-l/2008-07/msg00256.html > http://lua-users.org/lists/lua-l/2008-07/msg00284.html > > Summary: Nope, use source code. Bytecode isn't shorter, anyway. > > Oh, and LJ2 doesn't even *have* a bytecode loader/dumper at the > moment. It simply wasn't a priority. Open source projects using > LJ2 have nothing to worry about, since they don't need to hide > their Lua sources. > > The idea was to make a commercial add-on for bytecode handling. > But I'm not sure it would pay off (required work + support > overhead vs. money in return). There are cheaper ways to hide your > Lua sources: simply compress and encrypt them. And bytecode is > easy to reverse-engineer, too. It would be nice to save the parse step when loading though perhaps some of Michael Franz's work prior to tracing JITs is relevant to that problem. Mark From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 04:45:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA36j5GZ009619; Tue, 3 Nov 2009 04:45:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C77A01A689; Tue, 3 Nov 2009 04:43:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3500D1A67C for ; Tue, 3 Nov 2009 04:43:30 -0200 (BRST) Received: by yxe17 with SMTP id 17so5197187yxe.33 for ; Mon, 02 Nov 2009 22:44:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=c9bKOkA76CJ43SMJSyokps6bwTrVWsAzDhOosXKBBdE=; b=K3xwx8ntxm5p+2DVE9bxIt5ZrKl0kjGQY+QyaR2+ZbSNDXsruYVIma8n6DZSDhVAOT DOpP6qQWO0UVFV4wOKopVqIS/nVJYk6QutJaVZIEYHPeaNBEN1GVMDJp3fJvbAjWmhtb KcwBrqXzRyrLCw8Pyw0Dx+TmmZ3oMNsGG3E/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=rAZXNExPqEhzOUZHgRtzpT5XpEpBjifMDgdJjhp8WuLNM9Ta0RwkHAvn9yDpW8uFGg awvYX2YXjHBSylr3ha7JWQUJYQnpGZICxSHAlAYaaGfIUuMGv4LrdMPxPHz/NuT3OUWH ENpzl0LZLDqZ/Z9rj0GPPQlphv1Igix3IgFTY= MIME-Version: 1.0 Received: by 10.91.183.4 with SMTP id k4mr10931545agp.41.1257230666523; Mon, 02 Nov 2009 22:44:26 -0800 (PST) In-Reply-To: References: <200911021308217969275@gmail.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> Date: Tue, 3 Nov 2009 12:44:26 +0600 X-Google-Sender-Auth: 0e2d206ed4a0d9dc Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA36j5GZ009619 > You might implicitly achieve this by formatting > your generated Lua code in such a way that line numbers in the > original and generated sources match up, but this might not be always > possible. Ah, I am always forgetting about debug info... If I remember correctly (I was the one who initially contributed simple version of debug info handling to metalua, but it was long ago) when you create piece of AST by quasiquotes in A.mlua and then splice it into AST from B.mlua source code positions pointing to A.mlua will be preserved in resulting AST. So indeed there is no way to format resulting AST to preserve debug info. -- e.v.e On Tue, Nov 3, 2009 at 12:20 PM, David Manura wrote: > On Mon, Nov 2, 2009 at 11:22 PM, Vyacheslav Egorov wrote: >> it seems that there is no bytecode frontend in Lua JIT now, so it is >> not possible to create Lua JIT backend for metalua. >> >> The only option is to provide a source code backend for metalua. But >> as far as I remember metalua can produce irreducable control flow >> graphs (AST contains `Goto constructs). So translation into source is >> not a straightforward task. > > True.  Conceptually, Metalua does these two steps: > >  (A) translates a source code string--either plain Lua or Lua with > extended syntax--into an AST of the form given in [1].  This step is > implemented in pure Lua code, and the emitted AST is in the form of > Lua tables. > >  (B) translates the AST into Lua bytecodes.  This step is also > implemented in pure Lua code based on Yueliang (a port of the the Lua > compiler to Lua).  However, the output is normally standard Lua 5.1 > bytecodes. > > So, you should be able to use Metalua under LuaJIT2 to perform steps A > and/or B provided you don't use any Metalua extensions modules > implemented in Metalua without first rewriting them in terms of > standard Lua.  However, I understand you can't run those bytecodes in > LuaJIT2 without perhaps some ugly portability layer. > > You may, however, replace step B with your own generator.  This could, > for example, output LuaJIT2 bytecodes if LuaJIT2 added such an > interface for reading those bytecodes.  Alternately you could emit > standard Lua source.  Metalua 0.5 already has a module to do that > latter [2] for standard Lua ASTs.  This module is implemented in > Metalua, but it is easy enough to rip out the Metalua syntax > extensions and replace them with standard Lua. > > Now, emitting standard Lua source has a couple issues, each of which > can be addressed in a few different ways. > > The first problem is that the Metalua AST [1] has a couple of > extensions outside of standard Lua syntax.  These are `Goto/`Label and > `Stat nodes.  `Goto/`Label are for gotos.  `Stat executes statements > inside of expressions, which can frequently occur upon expanding > syntax extensions and macros.  Though you can achieve `Stat with > closures, the purpose of `Stat is to avoid closures for efficiency > sake.  `Stat nodes perhaps can be avoided.  I had once written a > source code optimizer that can inline function calls [3], and the > primary motivation of that was to eliminate the need for special > bytecode generation for `Stat nodes in Metalua.  Similarly, maybe > LuaJIT2 would negate these efficiency concerns as well.  The problems > handling `Goto/`Label still remain, but I suppose there are ways to > automatically translate gotos in plan Lua code or even patch Lua to > support gotos.  The Clue discussions [5-6] went into that.  This > problem is mitigated, however, in that that not all Metalua extensions > emit `Goto/`Label nodes.  If you avoid those extensions or rewrite > them in such a way not to emit these nodes, you won't have a problem. > The same can be said about `Stat. > > The second problem is that standard Lua source does not allow emitting > meaningful debug information like line numbers are symbol names.  This > problem has been mentioned a number of times in the context of Lua > source preprocessing.  You might implicitly achieve this by formatting > your generated Lua code in such a way that line numbers in the > original and generated sources match up, but this might not be always > possible.  There have been suggestions to allow pragmas to be inserted > into the Lua source to alter line numbers somewhat like the C > preprocessor [6], and something similar might be done for symbols. > This is a second reason why Metalua implements its own bytecode > generator.  This second problem is likely easily solved by a patch to > the Lua parser though. > > Though I agree it is helpful to think of Lua source as its own type of > portable bytecode, a few Lua syntax extensions as described above > could make it more effective in this regard. > > [1] http://metalua.luaforge.net/manual006.html#toc17 > [2] http://github.com/fab13n/metalua/blob/0.5-branch/src/lib/metalua/ast_to_string.mlua > [3] http://lua-users.org/wiki/SourceOptimizer > [5] http://lua-users.org/lists/lua-l/2008-07/msg00114.html > [6] http://lua-users.org/lists/lua-l/2008-07/msg00238.html > [7] http://lua-users.org/lists/lua-l/2009-05/msg00288.html > From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 05:29:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA37TpbT013918; Tue, 3 Nov 2009 05:29:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C80DD1A6F3; Tue, 3 Nov 2009 05:28:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5AAF11A67C for ; Tue, 3 Nov 2009 05:28:18 -0200 (BRST) Received: by ywh40 with SMTP id 40so5197915ywh.33 for ; Mon, 02 Nov 2009 23:29:15 -0800 (PST) Received: by 10.150.237.10 with SMTP id k10mr9839762ybh.112.1257233355142; Mon, 02 Nov 2009 23:29:15 -0800 (PST) Received: from ?192.168.200.10? (ppp118-209-24-106.lns20.mel4.internode.on.net [118.209.24.106]) by mx.google.com with ESMTPS id 4sm2406589ywi.12.2009.11.02.23.29.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 23:29:13 -0800 (PST) Message-ID: <4AEFDBC3.6070309@daurnimator.com> Date: Tue, 03 Nov 2009 18:29:07 +1100 From: daurnimator User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] References: <20091102135643.GA29657@mike.de> <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> <20091103011326.GA12105@duchamp.tecgraf.puc-rio.br> In-Reply-To: <20091103011326.GA12105@duchamp.tecgraf.puc-rio.br> Content-Type: multipart/mixed; boundary="------------060602010102060903060200" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------060602010102060903060200 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Well, today I got bored, and started coding a complex number implementation in pure lua. I'm sure its been done before, but wondering what you guys think, and how it goes with luajit (I don't know what sort of benchmarks I should try...) Not all complex functions are defined, but the majority are there... (see attached) Regards, Daurn. --------------060602010102060903060200 Content-Type: application/lua; name="complex.lua" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="complex.lua" cmF3dHlwZSA9IHR5cGUKbG9jYWwgcmF3dHlwZSA9IHJhd3R5cGUKdHlwZSA9IGZ1bmN0aW9u ICggb2IgKQoJbG9jYWwgbXQgPSBnZXRtZXRhdGFibGUgKCBvYiApCglpZiBtdCB0aGVuCgkJ bG9jYWwgdHlwZWZ1bmMgPSBnZXRtZXRhdGFibGUgKCBvYiApLl9fdHlwZSBvciByYXd0eXBl CgkJcmV0dXJuIHR5cGVmdW5jICggb2IgKQoJZWxzZQoJCXJldHVybiByYXd0eXBlICggb2Ig KQoJZW5kCmVuZAoKbG9jYWwgdHlwZSA9IHR5cGUKbG9jYWwgZ2V0bWV0YXRhYmxlID0gZ2V0 bWV0YXRhYmxlCmxvY2FsIGVycm9yID0gZXJyb3IKbG9jYWwgbmV3cHJveHkgPSBuZXdwcm94 eQpsb2NhbCBhdGFuMiA9IG1hdGguYXRhbjIKbG9jYWwgYWJzID0gbWF0aC5hYnMKbG9jYWwg ZXhwID0gbWF0aC5leHAKbG9jYWwgbG9nID0gbWF0aC5sb2cKbG9jYWwgc2luID0gbWF0aC5z aW4KbG9jYWwgY29zID0gbWF0aC5jb3MKbG9jYWwgc2luaCA9IG1hdGguc2luaApsb2NhbCBj b3NoID0gbWF0aC5jb3NoCgpsb2NhbCBuZXdjb21wbGV4Cgpsb2NhbCB6dHlwZSA9IGZ1bmN0 aW9uICggeiApIHJldHVybiAiY29tcGxleCIgZW5kCgpsb2NhbCB6dG9zdHJpbmcgPSBmdW5j dGlvbiAoIHogKQoJcmV0dXJuIHoucmUgLi4gIisiIC4uIHouaW0gLi4gImkiCmVuZAoKbG9j YWwgemFyZyA9IGZ1bmN0aW9uICggeiApCglsb2NhbCB0ID0gdHlwZSAoIHogKQoJaWYgdCA9 PSAiY29tcGxleCIgdGhlbgoJCXJldHVybiBhdGFuMiAoIHouaW0gLCB6LnJlICkKCWVsc2Vp ZiB0ID09ICJudW1iZXIiIHRoZW4KCQlyZXR1cm4gMAoJZW5kCQkJCmVuZAoKbG9jYWwgem5v cm0gPSBmdW5jdGlvbiAoIHogKQoJbG9jYWwgdCA9IHR5cGUgKCB6ICkKCWlmIHQgPT0gImNv bXBsZXgiIHRoZW4KCQlyZXR1cm4gKCAoIHoucmUgKV4yICsgKCB6LmltICleMiApXigxLzIp CgllbHNlaWYgdCA9PSAibnVtYmVyIiB0aGVuCgkJcmV0dXJuIGFicyAoIHogKQoJZW5kCQpl bmQKCmxvY2FsIHplcSA9IGZ1bmN0aW9uICggejEgLCB6MiApCglsb2NhbCB0MSA9IHR5cGUg KCB6MSApCglsb2NhbCB0MiA9IHR5cGUgKCB6MiApCglpZiB0MSA9PSAiY29tcGxleCIgYW5k IHQyID09ICJjb21wbGV4IiB0aGVuCgkJcmV0dXJuIHoxLnJlID09IHoyLnJlIGFuZCB6MS5p bSA9PSB6Mi5pbQoJZWxzZWlmIHQxID09ICJjb21wbGV4IiBhbmQgdDIgPT0gIm51bWJlciIg dGhlbgoJCXJldHVybiB6MS5yZSA9PSB6MiBhbmQgejEuaW0gPT0gMAoJZWxzZWlmIHQxID09 ICJudW1iZXIiIGFuZCB0MiA9PSAiY29tcGxleCIgdGhlbgoJCXJldHVybiB6MSA9PSB6Mi5y ZSBhbmQgejIuaW0gPT0gMAoJZWxzZQoJCXJldHVybiBmYWxzZQoJZW5kCmVuZAoKbG9jYWwg emFkZCA9IGZ1bmN0aW9uICggejEgLCB6MiApCglsb2NhbCB0MSA9IHR5cGUgKCB6MSApCgls b2NhbCB0MiA9IHR5cGUgKCB6MiApCglpZiB0MSA9PSAiY29tcGxleCIgYW5kIHQyID09ICJj b21wbGV4IiB0aGVuCgkJcmV0dXJuIG5ld2NvbXBsZXggKCB6MS5yZSArIHoyLnJlICwgejEu aW0gKyB6Mi5pbSApCgllbHNlaWYgdDEgPT0gImNvbXBsZXgiIGFuZCB0MiA9PSAibnVtYmVy IiB0aGVuCgkJcmV0dXJuIG5ld2NvbXBsZXggKCB6MS5yZSArIHoyICwgejEuaW0gKQoJZWxz ZWlmIHQxID09ICJudW1iZXIiIGFuZCB0MiA9PSAiY29tcGxleCIgdGhlbgoJCXJldHVybiBu ZXdjb21wbGV4ICggejEgKyB6Mi5yZSAsIHoyLmltICkKCWVsc2UKCQllcnJvciAoICJjYW5u b3QgYWRkICIgLi4gdDEgLi4gIiB0byAiIC4uIHQyICkKCWVuZAplbmQKCmxvY2FsIHpzdWIg PSBmdW5jdGlvbiAoIHoxICwgejIgKQoJbG9jYWwgdDEgPSB0eXBlICggejEgKQoJbG9jYWwg dDIgPSB0eXBlICggejIgKQoJaWYgdDEgPT0gImNvbXBsZXgiIGFuZCB0MiA9PSAiY29tcGxl eCIgdGhlbgoJCXJldHVybiBuZXdjb21wbGV4ICggejEucmUgLSB6Mi5yZSAsIHoxLmltIC0g ejIuaW0gKQoJZWxzZWlmIHQxID09ICJjb21wbGV4IiBhbmQgdDIgPT0gIm51bWJlciIgdGhl bgoJCXJldHVybiBuZXdjb21wbGV4ICggejEucmUgLSB6MiAsIHoxLmltICkKCWVsc2VpZiB0 MSA9PSAibnVtYmVyIiBhbmQgdDIgPT0gImNvbXBsZXgiIHRoZW4KCQlyZXR1cm4gbmV3Y29t cGxleCAoIHoxIC0gejIucmUgLCAtejIuaW0gKQoJZWxzZQoJCWVycm9yICggImNhbm5vdCBz dWJ0cmFjdCAiIC4uIHQyIC4uICIgZnJvbSAiIC4uIHQxICkKCWVuZAplbmQKCmxvY2FsIHpt dWwgPSBmdW5jdGlvbiAoIHoxICwgejIgKQoJbG9jYWwgdDEgPSB0eXBlICggejEgKQoJbG9j YWwgdDIgPSB0eXBlICggejIgKQoJaWYgdDEgPT0gImNvbXBsZXgiIGFuZCB0MiA9PSAiY29t cGxleCIgdGhlbgoJCWxvY2FsIHoxcmUgLCB6MWltID0gejEucmUgLCB6MS5pbQoJCWxvY2Fs IHoycmUgLCB6MmltID0gejIucmUgLCB6Mi5pbQoJCXJldHVybiBuZXdjb21wbGV4ICggejFy ZSAqIHoycmUgLSB6MWltICogejJpbSAsIHoxcmUgKiB6MmltICsgejFpbSAqIHoycmUgKQoJ ZWxzZWlmIHQxID09ICJjb21wbGV4IiBhbmQgdDIgPT0gIm51bWJlciIgdGhlbgoJCXJldHVy biBuZXdjb21wbGV4ICggejEucmUgKiB6MiAsIHoxLmltICogejIgKQoJZWxzZWlmIHQxID09 ICJudW1iZXIiIGFuZCB0MiA9PSAiY29tcGxleCIgdGhlbgoJCXJldHVybiBuZXdjb21wbGV4 ICggejEgKiB6Mi5yZSAsIHoxICogejIuaW0gKQoJZWxzZQoJCWVycm9yICggImNhbm5vdCBt dWx0aXBseSAiIC4uIHQxIC4uICIgYnkgIiAuLiB0MiApCgllbmQKZW5kCgpsb2NhbCB6ZGl2 ID0gZnVuY3Rpb24gKCB6MSAsIHoyICkKCWxvY2FsIHQxID0gdHlwZSAoIHoxICkKCWxvY2Fs IHQyID0gdHlwZSAoIHoyICkKCWlmIHQxID09ICJjb21wbGV4IiBhbmQgdDIgPT0gImNvbXBs ZXgiIHRoZW4KCQlsb2NhbCB6MXJlICwgejFpbSA9IHoxLnJlICwgejEuaW0KCQlsb2NhbCB6 MnJlICwgejJpbSA9IHoyLnJlICwgejIuaW0KCQlsb2NhbCBkZW5vbSA9IHoycmVeMiArIHoy aW1eMgoJCXJldHVybiBuZXdjb21wbGV4ICggKCB6MXJlICogejJyZSArIHoxaW0gKiB6Mmlt ICkgLyBkZW5vbSAsICggejFpbSAqIHoycmUgLSB6MXJlICogejJpbSApIC8gZGVub20gKQoJ ZWxzZWlmIHQxID09ICJjb21wbGV4IiBhbmQgdDIgPT0gIm51bWJlciIgdGhlbgoJCXJldHVy biBuZXdjb21wbGV4ICggejEucmUgLyB6MiAsIHoxLmltIC8gejIgKQoJZWxzZWlmIHQxID09 ICJudW1iZXIiIGFuZCB0MiA9PSAiY29tcGxleCIgdGhlbgoJCWxvY2FsIHoycmUgLCB6Mmlt ID0gejIucmUgLCB6Mi5pbQoJCWxvY2FsIHBhcnRpYWwgPSB6MSAvICggejJyZV4yICsgejJp bV4yICkKCQlyZXR1cm4gbmV3Y29tcGxleCAoIHoycmUgKiBwYXJ0aWFsICwgLXoyaW0gKiBw YXJ0aWFsICkKCWVsc2UKCQllcnJvciAoICJjYW5ub3QgZGl2aWRlICIgLi4gdDEgLi4gIiBi eSAiIC4uIHQyICkKCWVuZAplbmQKCmxvY2FsIHpwb3cgPSBmdW5jdGlvbiAoIHoxICwgejIg KQoJbG9jYWwgdDEgPSB0eXBlICggejEgKQoJbG9jYWwgdDIgPSB0eXBlICggejIgKQoJaWYg dDEgPT0gImNvbXBsZXgiIGFuZCB0MiA9PSAiY29tcGxleCIgdGhlbgoJCWxvY2FsIHoxciAs IHoxdCA9IHpub3JtICggejEgKSAsIHphcmcgKCB6MSApCgkJbG9jYWwgejJyZSAsIHoyaW0g PSB6Mi5yZSAsIHoyLmltCgkJCgkJbG9jYWwgY29lZmYgPSAoIHoxciBeIHoycmUgKSAqIGV4 cCAoIC16MmltICogejF0ICkKCQlsb2NhbCBhbmdsZSA9IGxvZyAoIHoxciApICogejJpbSAr IHoxdCAqIHoycmUKCQkKCQlyZXR1cm4gbmV3Y29tcGxleCAoIGNvZWZmICogY29zICggYW5n bGUgICkgLCBjb2VmZiAqIHNpbiAoIGFuZ2xlICkgKQoJZWxzZWlmIHQxID09ICJjb21wbGV4 IiBhbmQgdDIgPT0gIm51bWJlciIgdGhlbgoJCWxvY2FsIGNvZWZmID0gem5vcm0gKCB6MSAp XnoyCgkJbG9jYWwgYW5nbGUgPSB6YXJnICggejEgKSAqIHoyCgkJCgkJcmV0dXJuIG5ld2Nv bXBsZXggKCBjb2VmZiAqIGNvcyAoIGFuZ2xlICApICwgY29lZmYgKiBzaW4gKCBhbmdsZSAp ICkKCWVsc2VpZiB0MSA9PSAibnVtYmVyIiBhbmQgdDIgPT0gImNvbXBsZXgiIHRoZW4KCQls b2NhbCBjb2VmZiA9IHoxXnoyLnJlCgkJbG9jYWwgYW5nbGUgPSBsb2cgKCB6MSApICogejIu aW0KCQlyZXR1cm4gbmV3Y29tcGxleCAoIGNvZWZmICogY29zICggYW5nbGUgICkgLCBjb2Vm ZiAqIHNpbiAoIGFuZ2xlICkgKQoJZWxzZQoJCWVycm9yICggImNhbm5vdCBwdXQgIiAuLiB0 MSAuLiAiIHRvIHRoZSBwb3dlciBvZiBhICIgLi4gdDIgKQoJZW5kCmVuZAoKbG9jYWwgenVu bSA9IGZ1bmN0aW9uICggeiApCglsb2NhbCB0ID0gdHlwZSAoIHogKQoJaWYgdCA9PSAiY29t cGxleCIgdGhlbgoJCXJldHVybiBuZXdjb21wbGV4ICggLXoucmUgLCAtei5pbSApCgllbHNl aWYgdCA9PSAibnVtYmVyIiB0aGVuCgkJcmV0dXJuIC16CgllbHNlCgkJZXJyb3IgKCAiY2Fu bm90IGZpbmQgdW5hcnkgb2YgIiAuLiB0ICkKCWVuZAplbmQKCmxvY2FsIHpyZWFsID0gZnVu Y3Rpb24gKCB6ICkKCWxvY2FsIHQgPSB0eXBlICggeiApCglpZiB0ID09ICJjb21wbGV4IiB0 aGVuCgkJcmV0dXJuIHoucmUKCWVsc2VpZiB0ID09ICJudW1iZXIiIHRoZW4KCQlyZXR1cm4g egoJZWxzZQoJCWVycm9yICggImNhbm5vdCBnZXQgcmVhbCBwYXJ0IG9mICIgLi4gdCApCgll bmQKZW5kCgpsb2NhbCB6aW1hZyA9IGZ1bmN0aW9uICggeiApCglsb2NhbCB0ID0gdHlwZSAo IHogKQoJaWYgdCA9PSAiY29tcGxleCIgdGhlbgoJCXJldHVybiB6LmltCgllbHNlaWYgdCA9 PSAibnVtYmVyIiB0aGVuCgkJcmV0dXJuIDAKCWVsc2UKCQllcnJvciAoICJjYW5ub3QgZ2V0 IGltYWdpbmFyeSBwYXJ0IG9mICIgLi4gdCApCgllbmQKZW5kCgpsb2NhbCB6bG9nID0gZnVu Y3Rpb24gKCB6ICkKCWxvY2FsIHQgPSB0eXBlICggeiApCglpZiB0ID09ICJjb21wbGV4IiB0 aGVuCgkJcmV0dXJuIG5ld2NvbXBsZXggKCBsb2cgKCB6bm9ybSAoIHogKSApICwgemFyZyAo IHogKSApCgllbHNlaWYgdCA9PSAibnVtYmVyIiB0aGVuCgkJcmV0dXJuIGxvZyAoIHogKQoJ ZWxzZQoJCWVycm9yICggImNhbm5vdCBmaW5kIGxvZyBvZiAiIC4uIHQgKQoJZW5kCmVuZAoK bG9jYWwgemNvbmogPSBmdW5jdGlvbiAoIHogKQoJbG9jYWwgdCA9IHR5cGUgKCB6ICkKCWlm IHQgPT0gImNvbXBsZXgiIHRoZW4KCQlyZXR1cm4gbmV3Y29tcGxleCAoIHoucmUgLCAtei5p bSApCgllbHNlaWYgdCA9PSAibnVtYmVyIiB0aGVuCgkJcmV0dXJuIHoKCWVsc2UKCQllcnJv ciAoICJjYW5ub3QgZ2V0IGNvbmp1Z2F0ZSBvZiAiIC4uIHQgKQoJZW5kCmVuZAoKbG9jYWwg enNpbiA9IGZ1bmN0aW9uICggeiApCglsb2NhbCB0ID0gdHlwZSAoIHogKQoJaWYgdCA9PSAi Y29tcGxleCIgdGhlbgoJCWxvY2FsIHpyZSAsIHppbSA9IHoucmUgLCB6LmltCgkJcmV0dXJu IG5ld2NvbXBsZXggKCBzaW4gKCB6cmUgKSAqIGNvc2ggKCB6aW0gKSAsIGNvcyAoIHpyZSAp ICogc2luaCAoIHppbSApICkKCWVsc2VpZiB0ID09ICJudW1iZXIiIHRoZW4KCQlyZXR1cm4g c2luICggeiApCgllbHNlCgkJZXJyb3IgKCAiY2Fubm90IGZpbmQgc2luZSBvZiAiIC4uIHQg KQoJZW5kCmVuZAoKbG9jYWwgemNvcyA9IGZ1bmN0aW9uICggeiApCglsb2NhbCB0ID0gdHlw ZSAoIHogKQoJaWYgdCA9PSAiY29tcGxleCIgdGhlbgoJCWxvY2FsIHpyZSAsIHppbSA9IHou cmUgLCB6LmltCgkJcmV0dXJuIG5ld2NvbXBsZXggKCBjb3MgKCB6cmUgKSAqIGNvc2ggKCB6 aW0gKSAsIHNpbiAoIHpyZSApICogc2luaCAoIHppbSApICkKCWVsc2VpZiB0ID09ICJudW1i ZXIiIHRoZW4KCQlyZXR1cm4gY29zICggeiApCgllbHNlCgkJZXJyb3IgKCAiY2Fubm90IGZp bmQgY29zaW5lIG9mICIgLi4gdCApCgllbmQKZW5kCgpuZXdjb21wbGV4ID0gZnVuY3Rpb24g KCByZSAsIGltICkKCWlmIGltID09IG5pbCB0aGVuIGltID0gMCBlbmQKCWlmIHR5cGUgKCBy ZSApIH49ICJudW1iZXIiIG9yIHR5cGUgKCBpbSApIH49ICJudW1iZXIiIHRoZW4KCQllcnJv ciAoICJCYWQgYXJndW1lbnQocykgdG8gY29tcGxleC5uZXcsIG11c3QgcHJvdmlkZSBudW1i ZXJzIiApCgllbmQKCQoJbG9jYWwgeiA9IG5ld3Byb3h5ICggdHJ1ZSApCglsb2NhbCBtdCA9 IGdldG1ldGF0YWJsZSAoIHogKQoJbXQuX190eXBlID0genR5cGUKCW10Ll9fdG9zdHJpbmcg PSB6dG9zdHJpbmcKCW10Ll9fZXEgPSB6ZXEKCW10Ll9fYWRkID0gemFkZAoJbXQuX19zdWIg PSB6c3ViCgltdC5fX211bCA9IHptdWwKCW10Ll9fZGl2ID0gemRpdgoJbXQuX19wb3cgPSB6 cG93CgltdC5fX3VubSA9IHp1bm0KCW10Ll9fbGVuID0gem5vcm0KCQoJbXQuX19pbmRleCA9 IHsgcmUgPSByZSAsIGltID0gaW0gfQoJbXQuX19uZXdpbmRleCA9IHpuZXdpbmRleAoJCgly ZXR1cm4gegplbmQKCmNvbXBsZXggPSB7CgluZXcgPSBuZXdjb21wbGV4ICwKCWFicyA9IHpu b3JtICwgYXJnID0gemFyZyAsIHJlYWwgPSB6cmVhbCAsIGltYWcgPSB6aW1hZyAsIGNvbmog PSB6Y29uaiAsCglwb3cgPSB6cG93ICwgbG9nID0gemxvZyAsCglzaW4gPSB6c2luICwgY29z ID0gemNvcwp9Cg== --------------060602010102060903060200-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 06:22:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA38MjJW018155; Tue, 3 Nov 2009 06:22:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B99051A726; Tue, 3 Nov 2009 06:21:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BAB81A6A7 for ; Tue, 3 Nov 2009 06:20:58 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1N5Edk-0006xs-OO for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 10:21:20 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> Date: Tue, 03 Nov 2009 10:21:42 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091102132516.GA28881@mike.de> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 02 Nov 2009 15:25:16 +0200, Mike Pall wrote: > Not with the hash per-se but with the selection of the characters > to hash. It badly hashed strings that contained URLs. Thanks, this is useful information. I was thinking how much it is possible to gain by searching for hash function that gives least number of lower bit collisions on the set of keys that are actually used together in the application. (e.g. names of modules, names of metamethods, ...) Also, if I understand correctly, LJ 2 can much optimize table lookups if the key lives at is 'primary' position? From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 06:32:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA38WdeL019155; Tue, 3 Nov 2009 06:32:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B135C1A733; Tue, 3 Nov 2009 06:31:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45CAE1A6A7 for ; Tue, 3 Nov 2009 06:31:16 -0200 (BRST) Received: by bwz27 with SMTP id 27so7271388bwz.21 for ; Tue, 03 Nov 2009 00:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=pj8HnToNdGp98RbC7ci5QfyYA4IMjnWSwngOUiZiepA=; b=eS65OeDOc9V5kviJddGHT83xjW8hU6PJl6NaiTOKojuc9HW/xXh4LVCRs23mO+dp/Y q5Dd+eJp5oKef/i+/vHNNArsPRH9XuCuluula4fWXlUVzEiKicbVlchH+9tasMtoE1m/ EkjPYemf2LUDDrqgBbmxcPjTsTY3hxdyIs640= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=ASS6vS1bzk7Z33n1tkqZpReCXxEfzRsxQcsz6+hW8qm9Rxbens+sldq+hX0tcV5GIJ 5RsslrpYDBjC9wIuHOfwsQ/d0WdlcxwLC6m8RRLwp8TMGaBSyWR+24neB2psPD0iYN9h drSAzpZTFQfIMAviM/cNxIsxr0Cl7j19lNWm0= Received: by 10.103.125.17 with SMTP id c17mr2675099mun.16.1257237132653; Tue, 03 Nov 2009 00:32:12 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 14sm2298591muo.15.2009.11.03.00.32.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Nov 2009 00:32:11 -0800 (PST) Date: Tue, 3 Nov 2009 11:23:56 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <193237882.20091103112356@gmail.com> To: Vyacheslav Egorov Subject: Re[2]: [ANN] LuaJIT-2.0.0-beta1 In-Reply-To: References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Vyacheslav, Tuesday, November 3, 2009, 7:22:38 AM, you wrote: > The only option is to provide a source code backend for metalua. But > as far as I remember metalua can produce irreducable control flow > graphs (AST contains `Goto constructs). So translation into source is > not a straightforward task. heh. appearance of LuaJIT 2 raises question of adding goto statements to Lua in order to use it as intermediate language. i personally interested in fast protected VM for C/C++ code and JIT2 is an interesting option well, at least JIT fornt-end may support it as Lua extension targeted exclusively for automatic code generators -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 06:33:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA38XNSq019240; Tue, 3 Nov 2009 06:33:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98C141A73D; Tue, 3 Nov 2009 06:32:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAF051A6A7 for ; Tue, 3 Nov 2009 06:32:02 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id AFFDEBE07D for ; Tue, 3 Nov 2009 03:32:59 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 03 Nov 2009 03:32:59 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=OD74hn9K3wEZ7cHJlTIaK7mh9bg=; b=gBH92wY+6i7O1/a7OdAPauiH5/oXm8mgG5WRiR4KD3WYjAQlGQgu1nXa8IlreXYw1O9VCQKI8KYYzeijGj0UR5pW55Ih94TW5qztSBMvF7h48cAtVL8tGZhibrMIqGf3tafMBaU4f4BtKuSV8uRCl7n7S97ToBD766r+g3ljzic= X-Sasl-enc: My4bQTvH+c/5azA12nWHgW9dYFXMmgZDcI+iTEJrKocS 1257237178 Received: from [10.1.1.3] (219-89-14-166.dialup.xtra.co.nz [219.89.14.166]) by mail.messagingengine.com (Postfix) with ESMTPSA id 96C6733FF6 for ; Tue, 3 Nov 2009 03:32:58 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaRocks 2.0.1 From: Geoff Leyland In-Reply-To: <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> Date: Tue, 3 Nov 2009 21:32:25 +1300 Content-Transfer-Encoding: 7bit Message-Id: <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 3/11/2009, at 4:41 PM, Hisham wrote: > On Sun, Nov 1, 2009 at 7:15 AM, Geoff Leyland > wrote: >> I changed lines 223&4 of cfg.lua to >> >> defaults.variables.CC = "export MACOSX_DEPLOYMENT_TARGET=10.6; >> gcc -arch >> i686 -arch x86_64" >> defaults.variables.LD = "export MACOSX_DEPLOYMENT_TARGET=10.6; >> gcc -arch >> i686 -arch x86_64" >> >> Which got me a a universal binary for lfs: > > Alternatively, you could have edited your ~/.luarocks/config.lua > file and added: > > variables = { > CC = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch > x86_64", > LD = "export MACOSX_DEPLOYMENT_TARGET=10.6; gcc -arch i686 -arch > x86_64" > } > > and that would override the defaults set by luarocks.cfg. That's a better solution! The documentation on http://www.luarocks.org/en/Creating_a_rock suggests that external dependencies work like this: external_dependencies = { LIBDATE = { headers = "libdate.h" } } But that should be "header" not "headers". I agree that it's hard to know what the right thing is on OS X - perhaps it's as simple as suggesting what you did above in the documentation. I'm trying make a rock for rima at the moment - once I've got through that, I might be in a position to have more of an opinion. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 06:38:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA38crpJ019703; Tue, 3 Nov 2009 06:38:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE8D518E6D; Tue, 3 Nov 2009 06:37:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EA0918D60 for ; Tue, 3 Nov 2009 06:37:31 -0200 (BRST) Received: by yxe17 with SMTP id 17so5235286yxe.33 for ; Tue, 03 Nov 2009 00:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=1H0WwzEUzXt4x9kldz4u/+3qGeGxGB9hnipy0JuHnYU=; b=PJOKjonkyL5S34pAyIhYsroxCPtWuMErg2Loh06FVJ3cpooWS0e590K22dR6FKRP1P L4Iw6YUZZqNcGdCy7PbWBYtuZLv4jCuNKn1N8Z821M1GIRlCHT1EKMz7V1VMeoAtwqnB 9aTp6vm9LHrWUqQhj+3Wf8Q/2NY4eOCulg2R0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=yAHZFf7JGzq72zhINUdQdGX0bCksFCOI1cYtxZPfVvmHijIw5cezZpI3zO30hpDs0S TOWViqXQDWp6ptE2NMBe4oG/NotYwcgOVML4UILg5MTmFF5Uop+bxMwknBAA+evfNrKQ rLRCw6eeUtPMNNyztAqjPOakOaq64k34OGgr0= MIME-Version: 1.0 Received: by 10.91.19.4 with SMTP id w4mr2671521agi.0.1257237507060; Tue, 03 Nov 2009 00:38:27 -0800 (PST) In-Reply-To: <193237882.20091103112356@gmail.com> References: <200911021308217969275@gmail.com> <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> <193237882.20091103112356@gmail.com> Date: Tue, 3 Nov 2009 14:38:27 +0600 X-Google-Sender-Auth: 45c66165e1adcc90 Message-ID: Subject: Re: Re[2]: [ANN] LuaJIT-2.0.0-beta1 From: Vyacheslav Egorov To: Bulat Ziganshin Content-Type: text/plain; charset=ISO-8859-1 Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA38crpJ019703 Mike Pall mentioned that some algorithms used in Lua JIT 2 exploit _absence_ of goto in Lua. So I assume that LJ2 would not perform well for arbitrary irreducible cfgs. But I am not sure, it is for Mike to clarify. -- e.v.e On Tue, Nov 3, 2009 at 2:23 PM, Bulat Ziganshin wrote: > Hello Vyacheslav, > > Tuesday, November 3, 2009, 7:22:38 AM, you wrote: > >> The only option is to provide a source code backend for metalua. But >> as far as I remember metalua can produce irreducable control flow >> graphs (AST contains `Goto constructs). So translation into source is >> not a straightforward task. > > heh. appearance of LuaJIT 2 raises question of adding goto statements > to Lua in order to use it as intermediate language. i personally > interested in fast protected VM for C/C++ code and JIT2 is an > interesting option > > well, at least JIT fornt-end may support it as Lua extension > targeted exclusively for automatic code generators > > -- > Best regards, >  Bulat                            mailto:Bulat.Ziganshin@gmail.com > > From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:06:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA396P1Q022062; Tue, 3 Nov 2009 07:06:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5597218FF0; Tue, 3 Nov 2009 07:05:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C94F18F75 for ; Tue, 3 Nov 2009 07:04:58 -0200 (BRST) Received: by ewy26 with SMTP id 26so5836545ewy.5 for ; Tue, 03 Nov 2009 01:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=gyBlvUZdOqWl/EnbycDkRyKJoob5IsL68vEfJtp4WNo=; b=QkYG+TvPhjg5N1COSZhm8gur5hDUXi9R0eWvKmJ7hA6phGdGzvmrHfM/vOaHdHerMl Zk/uYZmXKzH+lySIBu0OkxDOJ41+9//tzGHFI8PkWUWuQSpDzFDt7dTj9w9OtFxmx3OV PHsuKC04zBJ3PEGLSFyruzXN/1+HMCiV3SSFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=FyWLg8vGa9WKC0770ch8HoQcUm/eJBnE85vr1F/D/5WFUWWXrEb12nzfs+A4Q22aTK lY4uz34ugctp5QLttIIZfsAOaPb/3de9o0D59S7Ds39dMICSJj+Uuppa1W3UThSz4gxW fLwZWjOApRtj4yD3YV+bIXhSiw64jQlgLjQMw= MIME-Version: 1.0 Received: by 10.216.93.78 with SMTP id k56mr6061003wef.102.1257239154810; Tue, 03 Nov 2009 01:05:54 -0800 (PST) Date: Tue, 3 Nov 2009 14:35:54 +0530 Message-ID: Subject: Authoring Flash games in LUA From: Rajnish Bharti To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there anything (tool, library) available out there that allows creation of Flash games using LUA? Would anyone be interested in a library or tool that allows you to script in LUA and output to Flash? -Rajnish From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:11:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39BV2O022559; Tue, 3 Nov 2009 07:11:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 545791A742; Tue, 3 Nov 2009 07:10:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96C0E18AF1 for ; Tue, 3 Nov 2009 07:10:09 -0200 (BRST) Received: by pxi2 with SMTP id 2so3962136pxi.11 for ; Tue, 03 Nov 2009 01:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GVr/MXpKlbXXkiAVMrf7t0wPmHHF7nwLAJw1IEakYVg=; b=oeRFN5UWbmP9YzdpvhzP8MwWJ6x7ymI+ubbAPD+NUyGRaiFhitQOLK7Op+bRgDLJiq avif+yOazfiLaIBIoGMu1ZhO6eADgju3WswwPn4qEHhG7Uymk3qGgQKE7iCqf2tBhAk0 n9tt+AQ8nJ+LJdlAGD6MKpSsSbBw8pKv3QXH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xm2DoJG1YeA0vnEPuZyuT0WJjqLryX8zSBO+RM9/a6oZ+JXU5/S8XpbjzEcpQtZkZh 1NsOoNhdo8I4whW5mUW4SKlBbxOVUvJHF3wxdxTGye5K0IDnoVotdRNfCI8e1sXkqDlE FwnvgU7z/JtdD9VQbKrhFkHx97kRIELLfZSpw= MIME-Version: 1.0 Received: by 10.140.174.1 with SMTP id w1mr389311rve.56.1257239466116; Tue, 03 Nov 2009 01:11:06 -0800 (PST) In-Reply-To: References: Date: Tue, 3 Nov 2009 12:11:06 +0300 Message-ID: Subject: Re: Authoring Flash games in LUA From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 12:05, Rajnish Bharti wrote: > Is there anything (tool, library) available out there that allows > creation of Flash games using LUA? > Would anyone be interested in a library or tool that allows you to > script in LUA and output to Flash? Please see http://code.google.com/p/lua-alchemy/ Welcome to the mailing list: http://groups.google.com/group/lua-alchemy-dev Alexander. P.S. Please do not write Lua in all caps: http://www.lua.org/about.html#name From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:22:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39MuYr024416; Tue, 3 Nov 2009 07:22:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 829DB18BA2; Tue, 3 Nov 2009 07:21:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51CAA18B06 for ; Tue, 3 Nov 2009 07:21:35 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5Fax-0005qK-00; Tue, 03 Nov 2009 10:22:31 +0100 Date: Tue, 3 Nov 2009 10:22:26 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103092226.GA11838@mike.de> References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Juris Kalnins wrote: > I was thinking how much it is possible to gain by searching for hash > function > that gives least number of lower bit collisions on the set of keys that > are actually used together in the application. (e.g. names of modules, > names of metamethods, ...) Yes, that's what I did. And it had less collisions. Unfortunately, I haven't tested on a wide enough range of strings. Selecting only up to 3*4 bytes was fast, but not good enough. See also the recent post from Florian Weimer: whatever we use, it'll collide on _some_ set of strings. Full hashing is no exception, so we might as well stay with partial hashing and optimize for common usage patterns. To proceed, one would have to gather different collections from real-life apps. And then vary the different ways to do a partial hash and the hash function itself (the Jenkins hash wasn't so bad). If you come up with anything, please post your results. > Also, if I understand correctly, LJ 2 can much optimize table lookups if > the key lives at is 'primary' position? You mean the HREFK thing? No, it specializes constant key lookups to a hash slot number, not the chain position. It doesn't care where in the chain the key is (it doesn't look at node->next either). The HREFK optimization is not affected by hash quality. That said, hash quality _is_ important, because string interning, all lookups in the interpreter and variable key lookups in compiled code are still affected. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:32:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39WrRt025312; Tue, 3 Nov 2009 07:32:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B2EBD190D3; Tue, 3 Nov 2009 07:31:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C28E190B5 for ; Tue, 3 Nov 2009 07:31:30 -0200 (BRST) Received: by pwj9 with SMTP id 9so2395020pwj.21 for ; Tue, 03 Nov 2009 01:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ZVUoqjGryXfMWI+Qfy12X3EhnH9Xw9elSZe9E9Ji2sc=; b=E15hse/lSYBn049tro9spj+akd9dY5ouVuJwjjbve0TFjt7MTgXssR9BQkuXQw0BkI r03A2TqMG2aDuEjdV2a451htZYMovWFjAyfjGkR0i5LkSmgGUTv4BAPiW1R33xVwQpZF GwkArb7SZB4cwx3b0jM17xAk6AYF67dT+GgDA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=J7shJRGXkVyoA82zqpGtr43J28sDIq2WFBYqJ2S9JzR14huxXJdMNC4pH3jUgOHCsY UQfJY80d+MLEwj49XDSzAtPT3v2lSktrLBxf2GNX0SJBO5PX82p7boOxSyzW1v9M2uQd nrg/zzSN/58vx6SC4LpH2wMiefCGBvnCmFv4A= MIME-Version: 1.0 Received: by 10.114.2.38 with SMTP id 38mr5161735wab.64.1257240746858; Tue, 03 Nov 2009 01:32:26 -0800 (PST) Date: Tue, 3 Nov 2009 17:32:26 +0800 Message-ID: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: =?GB2312?B?uerr6w==?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00504502f5e61d19510477742c0c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502f5e61d19510477742c0c Content-Type: text/plain; charset=ISO-8859-1 Diego, hi, i think i need ssl suport while connect to xmpp server which has strict require on autheration -- welcom to gtalk me http://hi.baidu.com/jyf1987 --00504502f5e61d19510477742c0c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Di= ego,
=A0=A0 =A0hi, i think i need ssl suport while conne= ct to xmpp server which has strict require on autheration

--
welcom to gtalk me
http://hi.baidu.com/jyf1987
--00504502f5e61d19510477742c0c-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:36:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39Zvq4025672; Tue, 3 Nov 2009 07:35:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6AA119107; Tue, 3 Nov 2009 07:34:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F3B5190B5 for ; Tue, 3 Nov 2009 07:34:36 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5FnZ-0005rH-00; Tue, 03 Nov 2009 10:35:33 +0100 Date: Tue, 3 Nov 2009 10:35:27 +0100 From: Mike Pall To: Lua list Subject: Re: Re[2]: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103093527.GA12984@mike.de> References: <20091103000650.GA16333@mike.de> <4AEF7A1A.1000901@cowlark.com> <20091103004346.GB17238@mike.de> <4AEF8C40.1070703@workspacewhiz.com> <4AEFA15A.30008@bigpond.net.au> <4AEFA65F.8080004@bigpond.net.au> <193237882.20091103112356@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Vyacheslav Egorov wrote: > Mike Pall mentioned that some algorithms used in Lua JIT 2 exploit > _absence_ of goto in Lua. > > So I assume that LJ2 would not perform well for arbitrary irreducible > cfgs. But I am not sure, it is for Mike to clarify. Yes, the NLF (natural-loop-first) region-selection algorithm relies on having only 'natural' loops, as the name implies. Irreducible cfgs are the exception, so one could certainly extend the algorithm to cope with it somehow. But it's probably not that simple and it might select suboptimal regions for these cfgs. The other issue is that all JMPs in LJ2's bytecode also indicate the top of the set of live registers. That's easy to generate from the parser on-the-fly. Recreating this information from arbitrary cfgs requires data-flow analysis (standard textbook algorithm, but hard to get right). --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 07:49:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39nIFB026899; Tue, 3 Nov 2009 07:49:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC6D11A748; Tue, 3 Nov 2009 07:47:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E3A71A67C for ; Tue, 3 Nov 2009 07:47:54 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA39moII026860 for ; Tue, 3 Nov 2009 07:48:50 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nA39mok02368; Tue, 3 Nov 2009 07:48:50 -0200 Date: Tue, 3 Nov 2009 07:48:49 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0] Message-ID: <20091103074849.A2336@lua.tecgraf.puc-rio.br> References: <20091102135643.GA29657@mike.de> <4ff79edb0911020706s1a07e2e8ub9d53402d04fddb1@mail.gmail.com> <20091103011326.GA12105@duchamp.tecgraf.puc-rio.br> <4AEFDBC3.6070309@daurnimator.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AEFDBC3.6070309@daurnimator.com>; from quae@daurnimator.com on Tue, Nov 03, 2009 at 06:29:07PM +1100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Well, today I got bored, and started coding a complex number > implementation in pure lua. Caveat: as far as I remember, writing correct code for complex functions is not that simple if one wants to be correct to the last digit, handle and avoid overflow in intermediate steps, etc. Just like you wouln't want to write the math library if pure Lua, except as an emergency. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 08:17:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3AHh9o030517; Tue, 3 Nov 2009 08:17:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79DFE18BB3; Tue, 3 Nov 2009 08:16:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CED6E18A5F for ; Tue, 3 Nov 2009 08:16:21 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5GRy-0005uZ-00; Tue, 03 Nov 2009 11:17:18 +0100 Date: Tue, 3 Nov 2009 11:16:57 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 and the creation of object files/executables Message-ID: <20091103101657.GA13320@mike.de> References: <4AEEFEB3.3000604@workspacewhiz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEEFEB3.3000604@workspacewhiz.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joshua Jensen wrote: > For consoles such as Xbox 360, it is not possible to emit instructions > on the fly and pass certification to ship the game. Yep, same thing for PS3. If MS/Sony ever want to get JIT compilers running on their platform they gotta come up with a solution. > Ignoring the fact > that the Xbox 360 is PowerPC-based and therefore incompatible with > LuaJIT in its current form, could the code generator be tailored to > generate a linkable .obj file with a translation of the Lua code to > native instructions? Not easy. The emitted machine code contains runtime values of all sorts. Relocations to helper functions are probably easy. But heap-allocated objects get their addresses at runtime. You'd need to add all sorts of indirections and a special loader. Also, the trace compiler comes up with a different set of traces, depending on runtime behavior. It would be hard to ensure you get sufficient coverage of the relevant code paths. Some user, somewhere in the world will slash the wrong monster and then you'd be stuck with the interpreter for some important code paths (this may or may not be ok). Turning a JIT compiler into a full coverage compiler is not an easy undertaking. A more realistic option for the near future would be to port just the LJ2 interpreter to PPC. PPC has a good FPU, little variation in instruction support and should cope well with the overall design of the VM. It would be much easier than an ARM port. Getting a 3x speedup over Lua wouldn't be too bad, initially? > For LuaJIT in its current form, is it a possibility to generate a > linkable x86 .obj file or an executable from a Lua script? I have used > Lua heavily within a build system, with Lua scripts (often the same) > being called hundreds of times from different build processes. Having a > native x86 version of the script could save a great deal of time over > hundreds of invocations. Compile time is negligible. We are talking about microseconds up to milliseconds here. And it's done incrementally during the execution, so there are no big pauses either. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 08:51:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Ap1pA002624; Tue, 3 Nov 2009 08:51:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 213641A748; Tue, 3 Nov 2009 08:49:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 530541A6A7 for ; Tue, 3 Nov 2009 08:49:35 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA3AoWRM013755 for ; Tue, 3 Nov 2009 08:50:32 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 0890A54C1D0; Tue, 3 Nov 2009 08:50:33 -0200 (BRST) Date: Tue, 3 Nov 2009 08:50:33 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Signature of iterator factories Message-ID: <20091103105032.GA16722@inf.puc-rio.br> References: <20091102032533.GF11203@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091102032533.GF11203@vaio.jimpryor.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > At this point, I'm sure too much code would break to introduce any > changes. But if we were designing iterators from scratch, > wouldn't it be nice to give them this signature instead: > > generator(control_variable, state_var1, ...) Yes. :( -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:00:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3B0JTC003846; Tue, 3 Nov 2009 09:00:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1B481A74D; Tue, 3 Nov 2009 08:58:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BC5E1A6A7 for ; Tue, 3 Nov 2009 08:58:54 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5H79-0005xp-00; Tue, 03 Nov 2009 11:59:51 +0100 Date: Tue, 3 Nov 2009 11:57:17 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103105717.GA15089@mike.de> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > Like the heap, I managed to screw some of test results up (just in case > there's any doubt, I've been waiting for LJ2 with as much anticipation as > the rest of the list and am convinced it will make the world a better > place. > My test cases are just a little problematic. A trace compiler and a modern CPU have something in common: they don't like branchy code. And CPUs don't like pointer chasing. That's why standard textbook tree data structures are rarely the best choice anymore. The big-O notation assumes constant overhead per access or per instruction. But that's far from the truth with a modern CPU. An O(n) linear search can outperform an O(log n) tree search for a much larger 'n' than you might imagine. Try it! A case in point are the algorithms and data structures used by compilers: traditional compilers make heavy use of trees and pointers, which is one reason why they are usually dead slow. LuaJIT uses growable arrays with direct indexing for almost everything. It also employs growable hash tables, semi-perfect hashes, skip lists, stacks, round-robin queues and bloom filters. But not a single search tree ... > Hopefully that's > not too much bad coding on my part, and of some help for improving LJ2). Your code serves as nice worst-case test cases. Very useful, indeed. Thank you! BTW: The upcoming beta2 will compile table.insert/table.remove. > Reading and querying are much better. Querying is particularly nice: a > tree query returns a coroutine iterator, so tracking a mouse moving > across a map and highlighting the road it's over allocates an awful lot > of coroutines, so lighter coroutines are a real bonus! Umm yes, that should help. But currently LJ2 doesn't trace across coroutine boundaries. That's planned for the future. But for now kdtree-test has this (sad) profile: 41% Interpreter 29% Compiled 19% GC 11% C functions --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:07:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3B7MWt004901; Tue, 3 Nov 2009 09:07:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7F121A752; Tue, 3 Nov 2009 09:06:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89D231A668 for ; Tue, 3 Nov 2009 09:06:00 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA3B6vPn014869 for ; Tue, 3 Nov 2009 09:06:57 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 4FAE454C1D0; Tue, 3 Nov 2009 09:06:58 -0200 (BRST) Date: Tue, 3 Nov 2009 09:06:58 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: LuaJIT 2.0 intellectual property disclosure and research opportunities Message-ID: <20091103110658.GC16722@inf.puc-rio.br> References: <20091102101704.GA8174@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091102101704.GA8174@mike.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Ok, that's it! Sorry for the length of this posting, but I hope it > was at least informative to someone out there. Sure it is! Many thanks, -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:24:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BOqqa007174; Tue, 3 Nov 2009 09:24:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12BCE1A74D; Tue, 3 Nov 2009 09:23:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD0A01A668 for ; Tue, 3 Nov 2009 09:23:22 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1342635eye.39 for ; Tue, 03 Nov 2009 03:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=idznxzPvBk+FbmKoFBX1HQ1r2S2N4ppZhy1+Fz7ApX4=; b=mb3Y8LV9pqetSAuPPl0xxpO6hFSGlmtLdrOMa+Cecp/DAT7ra68tQdDbDmmy7oWM7z n+Fy9J9xqJdE4/4DGHZQmzDvVAnQXCXyoIOtDCd6Sq3HQu34SeR3V+FDSUTVYD63VKDa TvMdbshoT1/3AhPbkYKD2td3WcIpNQ9y6QbKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=TuxyWCki7Cysl0TkV2CZ08S93aLISM9104rGAF7/EN2Gv/AzBMpVQYfFGlFw1kpZ9n hs6V1FzIiJqYRnW8g3fvNFZDpOjYnLZE1kDGevAlQAQybbefgawpJPQCD2HAEXx1czxa +6LbBl+NrtVNauQ82Mr/qmg0yqD6U+No7uMlc= MIME-Version: 1.0 Received: by 10.216.87.194 with SMTP id y44mr6361080wee.204.1257247458146; Tue, 03 Nov 2009 03:24:18 -0800 (PST) In-Reply-To: <20091102032533.GF11203@vaio.jimpryor.net> References: <20091102032533.GF11203@vaio.jimpryor.net> From: Jerome Vuarand Date: Tue, 3 Nov 2009 12:23:58 +0100 Message-ID: <89d273ba0911030323i165a1c3cia37df56dcf022426@mail.gmail.com> Subject: Re: Signature of iterator factories To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/2 Jim Pryor : > At this point, I'm sure too much code would break to introduce any > changes. But if we were designing iterators from scratch, > wouldn't it be nice to give them this signature instead: > > generator(control_variable, state_var1, ...) That would only break iterators with a "generator" function (I don't like the name) also usable as-is *and* interpreting extra arguments (next wouldn't be impacted for example). Also it would be possible to fix the problem "on site" with a wrapper function that force old behaviour: local function fix(generator, ...) return function(control_variable, state_var1, ...) return generator(control_variable, state_var1) end, ... end for k,v in fix(olditerator(t)) do end So even though I don't feel the change as necessary (for the reasons you gave), a change in the language would imho have minor impact. > That way, we could pass multiple state_vars when we need to. I know, > just pack all your state information into a table, or have your > generator be a closure with the extra state information as upvalues. > Easy enough to program. But it's a shame to bring in that overhead just > because we can't write iterators taking more than one state_var. > > I don't know the VM architecture, maybe there are low-level reasons for doing > it the way it is. An argument (kinda weak I admit) against using more than one state variable, is that the for construct only check the first iteration variable when deciding whether to stop the iteration or continue it. So you having more than one state variable may be confusing since they are ignored by the construct itself. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:33:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BXrkb008748; Tue, 3 Nov 2009 09:33:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E725E1A756; Tue, 3 Nov 2009 09:32:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 412321A668 for ; Tue, 3 Nov 2009 09:32:30 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA3BXRN7018315 for ; Tue, 3 Nov 2009 09:33:27 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 0B97554C1D0; Tue, 3 Nov 2009 09:33:28 -0200 (BRST) Date: Tue, 3 Nov 2009 09:33:28 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Signature of iterator factories Message-ID: <20091103113328.GE16722@inf.puc-rio.br> References: <20091102032533.GF11203@vaio.jimpryor.net> <20091103105032.GA16722@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091103105032.GA16722@inf.puc-rio.br> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > At this point, I'm sure too much code would break to introduce any > > changes. But if we were designing iterators from scratch, > > wouldn't it be nice to give them this signature instead: > > > > generator(control_variable, state_var1, ...) > > Yes. :( > > -- Roberto I am sorry, but I sent a wrong reply. I thought his proposal was to have an extra hidden (but unique) control variable before the visible variables in the loop. That is, the statement for a,b,c in exp do would be really for _,a,b,c in exp do with '_' hidden from the programmer. -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:41:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BfZSL010037; Tue, 3 Nov 2009 09:41:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED942188E9; Tue, 3 Nov 2009 09:40:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E8D7188A1 for ; Tue, 3 Nov 2009 09:40:12 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1N5HkX-0006lN-5U for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 13:40:33 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: Signature of iterator factories References: <20091102032533.GF11203@vaio.jimpryor.net> Date: Tue, 03 Nov 2009 13:40:54 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091102032533.GF11203@vaio.jimpryor.net> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 02 Nov 2009 05:25:33 +0200, Jim Pryor wrote: > But if we were designing iterators from scratch, > wouldn't it be nice to give them this signature instead: > > generator(control_variable, state_var1, ...) > If about iterators that could have been... for var_1, ···, var_n in explist do block end -- could be equivalent to the code: do local f, s, ... = explist -- all values returned by explist while true do local s, ..., var_1, ···, var_n = f(s, ...) -- call f with all values returned by previous iteration, assign leftmost n to control variables if s == nil then break end block end end I.e. for would not throw away extra values returned by iterator. When it returns nothing, loop would end. This would have made writing iterators for nested data structures (like filesystem) so easy... From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:45:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Bj0e3010683; Tue, 3 Nov 2009 09:45:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DFEF1A668; Tue, 3 Nov 2009 09:43:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70688188E9 for ; Tue, 3 Nov 2009 09:43:32 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1N5Hno-000723-Hz for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 13:43:56 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: Signature of iterator factories References: <20091102032533.GF11203@vaio.jimpryor.net> Date: Tue, 03 Nov 2009 13:44:18 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 03 Nov 2009 13:40:54 +0200, Juris Kalnins wrote: > local s, ..., var_1, ···, var_n = f(s, ...) -- call f with all > values returned by previous iteration, assign leftmost n to control > variables I meant to write 'rightmost' ... From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:45:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Bjl49010884; Tue, 3 Nov 2009 09:45:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD8241A759; Tue, 3 Nov 2009 09:44:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 715771A6A7 for ; Tue, 3 Nov 2009 09:44:21 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so476473fgb.17 for ; Tue, 03 Nov 2009 03:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xO6dQpSbJqNCtOKcjYJHWBkwAsHtzpA9/i7X7wtrCQQ=; b=uJoUzwSp5kaFtu49X4hrH/oSNZFCfXrn8iLQrwkvOD9f5284i+7Y4LDLG8MsB6Iszp 2Jg4l6cM8eu7OlMWTpFEnBEoCrUbSRi0sLhz5A58MLvTrb1XpHDS4R9EoXeBDgHi0aco rgzFVSCYEZnLVE7lLZfCWfprnZk9orwohKIPI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=r2hmzbupdiQ4NgyW+13yChokJe5iEYRenWl63UgC4S+Z+K6Y/DwGR+fdDX8yC0sMFY dzFNCPCpyK6zItG9roULgsaJPP/7QM7ZcKYePq5rNHVDB4Ss0+IAD3Ch8bVRiyLASg7z B2aHN5PBehS93kf5OV1CdwMlfTMYguob+lvmg= MIME-Version: 1.0 Received: by 10.86.235.29 with SMTP id i29mr3048830fgh.57.1257248715680; Tue, 03 Nov 2009 03:45:15 -0800 (PST) In-Reply-To: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> References: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> Date: Tue, 3 Nov 2009 12:45:15 +0100 Message-ID: <9386fb2d0911030345o71040b73g4b5b3cdba6d39f3e@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3Bjl49010884 > Diego, >     hi, i think i need ssl suport while connect to xmpp server which has > strict require on autheration http://luasec.luaforge.net/ might be what you'r looking for then? /Pierre From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:46:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BkLvw011001; Tue, 3 Nov 2009 09:46:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E2A11A75D; Tue, 3 Nov 2009 09:44:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3BB51A66A for ; Tue, 3 Nov 2009 09:44:39 -0200 (BRST) Received: by ewy26 with SMTP id 26so5962664ewy.5 for ; Tue, 03 Nov 2009 03:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type; bh=js6r6NeiX8Ki8cfTVf9f0efzQzTNKOMcBx8p/v0FpkU=; b=eQ6bB6xw6BhtA2suXU0r4RBZh6tuDo5S7oXT6XlSkvnJckusPtHkz9cIIZ6Y9uBLoO FvAD1e+7rdIWDuJDdwZoahy709Vh8snME9AAk/rUrf4TG/TVHwIvRVCnFWE2iL4QDE7s H2LNM+m9gw/yMlbccIXIAQcaHLS2B2AC91U5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; b=kFL/l9b57a5ZOgsgF1fznEvWWaQeJ9bfvVRBJ/rF5MtK6YeusTviYMwZsowS2KRIKa zzFExQAS6a7gyowrQfv6yvX6uGJT9ld1lrFmVnOxICKAF8c0avrC6+HKFu2jhyrMZ3IP vhQtSN8gOrhtdIS5/PoGjTMzpEkOc7wqRUf90= MIME-Version: 1.0 Received: by 10.216.89.5 with SMTP id b5mr6332470wef.143.1257248735087; Tue, 03 Nov 2009 03:45:35 -0800 (PST) Date: Tue, 3 Nov 2009 06:45:35 -0500 Message-ID: Subject: LuaJIT-2 shootout performance one-core versus quad-core From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Examining latest "language shootout" results at http://shootout.alioth.debian.org/ I noticed a significant relative performance degradation when comparing LuaJIT-2.beta on x86 one-core http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all&box=1 versus x-86 quad-core http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=all&box=1 On a single-core LuaJIT-2 looses to GCC 1:2 while on quad-core 1:7. Is there any hope that LuaJIT will use multi-threading? After all, it traces the execution and knows at run-time what paths are parallel. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 09:53:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BrqXN012354; Tue, 3 Nov 2009 09:53:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA86B1A6A7; Tue, 3 Nov 2009 09:52:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D679B188E9 for ; Tue, 3 Nov 2009 09:52:29 -0200 (BRST) Received: from magritte (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3BrOLa012289 for ; Tue, 3 Nov 2009 09:53:24 -0200 Date: Tue, 3 Nov 2009 09:53:24 -0200 (BRST) From: Tomas Guisasola Gorham To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 In-Reply-To: <9386fb2d0911030345o71040b73g4b5b3cdba6d39f3e@mail.gmail.com> Message-ID: References: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> <9386fb2d0911030345o71040b73g4b5b3cdba6d39f3e@mail.gmail.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="678920-201100348-1257249204=:27921" X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --678920-201100348-1257249204=:27921 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi On Tue, 3 Nov 2009, Pierre LeMoine wrote: >> Diego, >>     hi, i think i need ssl suport while connect to xmpp server which has >> strict require on autheration > http://luasec.luaforge.net/ might be what you'r looking for then? > /Pierre You should take a look at the new version at: http://www.inf.puc-rio.br/~brunoos/luasec/ http://www.inf.puc-rio.br/~brunoos/luasec/reference.html#request Version 0.4 now provides support for HTTPS through LuaSocket. Tomás --678920-201100348-1257249204=:27921-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 10:13:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3CDJWO015907; Tue, 3 Nov 2009 10:13:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C81B1A750; Tue, 3 Nov 2009 10:11:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C6CEE1A689 for ; Tue, 3 Nov 2009 10:11:51 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5IFj-00069j-00; Tue, 03 Nov 2009 13:12:47 +0100 Date: Tue, 3 Nov 2009 13:08:17 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT-2 shootout performance one-core versus quad-core Message-ID: <20091103120817.GA18760@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > Is there any hope that LuaJIT will use multi-threading? After all, it > traces the execution and knows at run-time what paths are parallel. Auto-parallelization has been tried for the last fourty years with, umm, mixed results. Almost all of the benchmarks on the shootout are manually parallelized (e.g. using OpenMP). But this is tedious. Also, parallel != concurrent. This is a wide field. No easy solution in sight. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 11:23:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3DMd8r032444; Tue, 3 Nov 2009 11:23:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D9B91932D; Tue, 3 Nov 2009 11:20:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C03EE19183 for ; Tue, 3 Nov 2009 11:20:53 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 27721BDBA5 for ; Tue, 3 Nov 2009 08:21:48 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 03 Nov 2009 08:21:48 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:mime-version:content-type:content-transfer-encoding:in-reply-to; s=smtpout; bh=0iGVDkD8XzU1sueNXqElnOAlGbs=; b=YpfKFzs747JG3n2zmzlQLCu3foAsQ94vBCRbX+agIvnqdUZNrPr178ARJlkWyi1b0kdXTf32pCaWSTkV2WZXxUfV8NuYueU1Gmc177uCzp8zBRCA1FqfPXbjTOOlP7v2dQp8zulta2VpkW1BIanTeTxzQBNqO/eEGvsyly6Va2A= X-Sasl-enc: G5fJLaFYEdviQMAcSs8UYADdFdXLUzgYHhN22ejvZLA6 1257254507 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8D1994A4681 for ; Tue, 3 Nov 2009 08:21:47 -0500 (EST) Date: Tue, 3 Nov 2009 08:22:16 -0500 From: Jim Pryor To: Lua list Subject: Re: Signature of iterator factories Message-ID: <20091103132216.GH11203@vaio.jimpryor.net> Mail-Followup-To: Lua list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20091103113328.GE16722@inf.puc-rio.br> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 03, 2009 at 09:33:28AM -0200, Roberto Ierusalimschy wrote: > > > At this point, I'm sure too much code would break to introduce any > > > changes. But if we were designing iterators from scratch, > > > wouldn't it be nice to give them this signature instead: > > > > > > generator(control_variable, state_var1, ...) > > > > Yes. :( > > I am sorry, but I sent a wrong reply. I thought his proposal was to > have an extra hidden (but unique) control variable before the visible > variables in the loop. That is, the statement > > for a,b,c in exp do > > would be really > > for _,a,b,c in exp do > > with '_' hidden from the programmer. What I had in mind was instead that we'd be able to do this: for var_1, ..., var_n in my_next_function,initial_key,state1,...staten do stuff end which would be equivalent to this: do local _f, _var, _s1 ... _sn = my_next_function, initial_key, state1, ..., staten while true do local var_1, ···, var_n = _f(_var, _s1, ... _sn) _var = var_1 if _var == nil then break end stuff end end So there's still only one control variable. In the bit quoted below, Juris was talking about having multiple simultaneous control variables, which I can see might be useful when iterating nested structures. But I was only talking about increasing the number of static state variables. On Tue, Nov 03, 2009 at 01:40:54PM +0200, Juris Kalnins wrote: > If about iterators that could have been... > > for var_1, ···, var_n in explist do block end > > -- could be equivalent to the code: > do > local f, s, ... = explist -- all values returned by explist > while true do > local s, ..., var_1, ···, var_n = f(s, ...) -- call f with all > values returned by previous iteration, assign leftmost n to control > variables > if s == nil then break end > block > end > end > > I.e. for would not throw away extra values returned by iterator. > When it returns nothing, loop would end. > This would have made writing iterators for nested data structures > (like filesystem) so easy... > -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 11:23:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3DNH2O032663; Tue, 3 Nov 2009 11:23:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56BE319349; Tue, 3 Nov 2009 11:21:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from s802.sureserver.com (s802.sureserver.com [195.8.222.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C15819183 for ; Tue, 3 Nov 2009 11:21:26 -0200 (BRST) Received: (qmail 9375 invoked by uid 1003); 3 Nov 2009 13:22:19 -0000 Received: from unknown (HELO ?192.168.1.101?) (ikolev@91.92.152.6) by s802.sureserver.com with ESMTPA; 3 Nov 2009 13:22:19 -0000 Message-ID: <4AF02E85.3010100@gmail.com> Date: Tue, 03 Nov 2009 15:22:13 +0200 From: Ivan Kolev User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Re: Authoring Flash games in LUA References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I don't know of such a tool but it sounds a great idea to me. Recently I was wondering what's the easiest way to cover the most possible platforms with a game (including mobile devices). There are a few options with various coverage, advantages and disadvantages - C/C++, Java, HTML/Javascript, Lua and Flash. Of all, Flash seems to be the most available and easiest, because of what I understand you can create a single Flash which would run everywhere (of course, it would only cover the more modern smartphones which support Flash). I'm not sure about Lua availability on various mobile platforms (especially the newer ones like Android, iPhone, Maemo). If there was a game-oriented Lua library for all platforms where Flash is available, then we wouldn't need a Lua->Flash converter, we'd happily use Lua directly. Regards, Ivan > Date: Tue, 3 Nov 2009 14:35:54 +0530 > From: Rajnish Bharti > Subject: Authoring Flash games in LUA > To: lua@bazar2.conectiva.com.br > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Is there anything (tool, library) available out there that allows > creation of Flash games using LUA? > Would anyone be interested in a library or tool that allows you to > script in LUA and output to Flash? > > -Rajnish From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 11:37:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3DYahd003465; Tue, 3 Nov 2009 11:34:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0DDD5183E2; Tue, 3 Nov 2009 11:33:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5622A183A5 for ; Tue, 3 Nov 2009 11:33:05 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id d26so492178eyd.5 for ; Tue, 03 Nov 2009 05:34:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.86.206 with SMTP id w56mr1212wee.1.1257255241639; Tue, 03 Nov 2009 05:34:01 -0800 (PST) In-Reply-To: <20091103132216.GH11203@vaio.jimpryor.net> References: <20091103113328.GE16722@inf.puc-rio.br> <20091103132216.GH11203@vaio.jimpryor.net> Date: Tue, 3 Nov 2009 13:34:01 +0000 X-Google-Sender-Auth: e3df0771d2074cbf Message-ID: Subject: Re: Signature of iterator factories From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3DYahd003465 On Tue, Nov 3, 2009 at 1:22 PM, Jim Pryor wrote: > for var_1, ..., var_n in my_next_function,initial_key,state1,...staten do >    stuff > end > > which would be equivalent to this: > > do >    local _f, _var, _s1 ... _sn = my_next_function, initial_key, state1, ..., staten >    while true do >        local var_1, ···, var_n = _f(_var, _s1, ... _sn) >        _var = var_1 >        if _var == nil then break end >        stuff >    end > end Implementing the transformed code in the Lua VM would not be possible with the current virtual machine, as it would require a variable number of stack slots for the state variables, and so the variables above the state variables in the stack (which may be locals within the loop, or state variables for an embedded loop) would not be at known positions. One approach would be to implement tuples as a new type (visible only to the Lua internals) which would allow a variable number of stack slots to be compressed into a single stack slot (as an aside, tuples could also be used to implement other things, like not truncating vararg expressions which are in the middle of a list of expressions). Unfortunately, doing it in this manner would prevent a generic for loop being rewritable as a do-while loop using plain Lua. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 11:55:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3DtafI010774; Tue, 3 Nov 2009 11:55:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38B781A74E; Tue, 3 Nov 2009 11:53:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DAED1914F for ; Tue, 3 Nov 2009 11:53:51 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 77493BEB14 for ; Tue, 3 Nov 2009 08:54:46 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 03 Nov 2009 08:54:46 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:content-transfer-encoding:in-reply-to; s=smtpout; bh=KIugHpkFDktycDtN0m8SHMJ7FOw=; b=sHmdLODKU41WZoxOTpqRb0uZK7YPVPgjs9THw2Zpiz1+6PernRz5aUGqlhoKBvw5dI3IVsK40wOh353DYp4d6qNNCr6hg1Ms3JoDghaR4Qe0EMqlM3K3tZXnp1qxb5MFOT6wRT/7oK9DEoLF4yUXdvC1S+FtaV/ER7ZMqAdBOxk= X-Sasl-enc: 3lSXPNLrY4ck5bbeKx2Qlrihzjt2zZ8VTRPNOG4aSPse 1257256485 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id DA2BC4A46DA for ; Tue, 3 Nov 2009 08:54:45 -0500 (EST) Date: Tue, 3 Nov 2009 08:55:15 -0500 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Reassigning control variables in loop body? Message-ID: <20091103135515.GI11203@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is it OK to do things like this: for k,v in ipairs{10,20,30,40} do if k==3 then k = 1 end -- pointless but keeps the example small ...other stuff that processes k,v... end I _know_ this doesn't rewind the iteration at all; that's not my intent. Sometimes it's just useful for the logic of the loop body to reassign the control variable. Similarly, what about: for i=1,10 do if i==3 then i = 1 end ...other stuff that processes i... end Again, I _know_ it doesn't rewind the iteration. The question is just, do we _have to_ keep our hands off of the control variable? PiL 2nd ed, pp. 32 - 33 say: "You should never change the value of the control variable [in examples like the second, above]: the effect of such changes is unpredictable... The generic loop [my first example, above] shares two properties with the numeric loop: the loop variables are local to the loop body and you should never assign any value to them." But if you look at the code equivalents in the reference manual: > for var_1, ···, var_n in explist do block end > is equivalent to the code: > do > local f, s, var = explist > while true do > local var_1, ···, var_n = f(s, var) > var = var_1 > if var == nil then break end > block > end > end > > for v = e1, e2, e3 do block end > is equivalent to the code: > do > local var, limit, step = tonumber(e1), tonumber(e2), tonumber(e3) > if not (var and limit and step) then error() end > while (step > 0 and var <= limit) or (step <= 0 and var >= limit) do > local v = var > block > var = var + step > end > end The control variable is supposedly saved in a hidden variable "var" that isn't exposed to the programmer. So it should be harmless for the programmer to overwrite var_1 in the first statement, or v in the second statement. And simple tests in the interpreter don't show anything funny happening... I assume that PiL knows what it's talking about :-) but why do the different sources of documentation not give a consistent message? -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 12:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Dvj6x011225; Tue, 3 Nov 2009 11:57:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05CF01A757; Tue, 3 Nov 2009 11:56:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E8811A750 for ; Tue, 3 Nov 2009 11:56:17 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 031CBBE26F for ; Tue, 3 Nov 2009 08:57:13 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 03 Nov 2009 08:57:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=NTn3NbONMUfrtVwbtEdZcOPer6w=; b=hx//gQWZiQE4rzuMukiUZz12MIXqbGbFNdlk1k+EFXj5zUfhPeLI/Eg/h2qjydnW5rJbTfpNsquGcSfPkMyxCfPGG3pX4tmh95u7u94ysmFpdJ5PcsZf0UxqqtI+Ma51Lq8mErp0fNZkDxQod9UbM8veQecq+W/n2YWOu9ffyGU= X-Sasl-enc: FMVmUEk4e3LBINfne/0H3qfrMxkL8/I+WMqFNY59bOlY 1257256633 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 8B8614A46FC for ; Tue, 3 Nov 2009 08:57:13 -0500 (EST) Date: Tue, 3 Nov 2009 08:57:43 -0500 From: Jim Pryor To: lua@bazar2.conectiva.com.br Subject: Re: Reassigning control variables in loop body? Message-ID: <20091103135743.GJ11203@vaio.jimpryor.net> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <20091103135515.GI11203@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091103135515.GI11203@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sorry, the previous message had nothing to do with "LuaJIT-2 shootout performance one-core versus quad-core". I just forgot to delete a In-Reply-To header. -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 13:07:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3F6wkk026031; Tue, 3 Nov 2009 13:06:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 756741A660; Tue, 3 Nov 2009 13:05:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8120718846 for ; Tue, 3 Nov 2009 13:05:25 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:58099) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1N5Kxe-0001wC-O9 (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Tue, 03 Nov 2009 15:06:18 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N5Kxe-0003IL-F9 (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Tue, 03 Nov 2009 15:06:18 +0000 Date: Tue, 3 Nov 2009 15:06:18 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 In-Reply-To: <20091031225554.GA30341@mike.de> Message-ID: References: <20091031225554.GA30341@mike.de> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 31 Oct 2009, Mike Pall wrote: > It's almost midnight on Halloween here. This is the perfect time > to release long-awaited, almost mythical open source software ... ;-) > > Yes, here it is: the first public release of LuaJIT 2.0! Wow, cool. I tried it out with an LPEG-based program, not expecting much improvement since the code is heavy on IO and calls back and forth between C and Lua a lot. When run with an empty input file (and the -n option to stop it re-downloading the RIR stats files) the program runs in about 4s with lua and 2.5s with luajit2 (37% faster). The bulk of this time is a fairly tight loop which it looks like LJ handles well. When run with a 900MB input file, lua runs in about 23s and luajit2 in about 17s (25% faster). This is remarkable, since the loop is not JIT-friendly, and it hits an NYI case. http://www-uxsup.csx.cam.ac.uk/~fanf2/hermes/conf/exim/sbin/bogons (requires LPEG tweaks from http://lua-users.org/lists/lua-l/2009-10/msg01068.html) Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 13:18:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3FI78q028328; Tue, 3 Nov 2009 13:18:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC1A51A696; Tue, 3 Nov 2009 13:16:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth12.prod.mesa1.secureserver.net (smtpauth12.prod.mesa1.secureserver.net [64.202.165.35]) by bazar2.conectiva.com.br (Postfix) with SMTP id BD15E1A688 for ; Tue, 3 Nov 2009 13:16:34 -0200 (BRST) Received: (qmail 10611 invoked from network); 3 Nov 2009 15:17:28 -0000 Received: from unknown (98.117.140.83) by smtpauth12.prod.mesa1.secureserver.net (64.202.165.35) with ESMTP; 03 Nov 2009 15:17:28 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Authoring Flash games in LUA From: Mark Hamburg In-Reply-To: <4AF02E85.3010100@gmail.com> Date: Tue, 3 Nov 2009 07:17:25 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <4AF02E85.3010100@gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 3, 2009, at 5:22 AM, Ivan Kolev wrote: > I don't know of such a tool but it sounds a great idea to me. > Recently I was wondering what's the easiest way to cover the most > possible platforms with a game (including mobile devices). There are > a few options with various coverage, advantages and disadvantages - > C/C++, Java, HTML/Javascript, Lua and Flash. Of all, Flash seems to > be the most available and easiest, because of what I understand you > can create a single Flash which would run everywhere (of course, it > would only cover the more modern smartphones which support Flash). > I'm not sure about Lua availability on various mobile platforms > (especially the newer ones like Android, iPhone, Maemo). If there > was a game-oriented Lua library for all platforms where Flash is > available, then we wouldn't need a Lua->Flash converter, we'd > happily use Lua directly. It only gets you iPhone and it doesn't get you the rest that Flash offers, but Ansca Mobile's Corona is a Lua-based development environment for the iPhone. To really exploit Flash (on any platform), you probably want to use ActionScript as opposed to Lua and CS5 promises an option to export to iPhone. Mark From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 13:46:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3FkoTd003032; Tue, 3 Nov 2009 13:46:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 178281A752; Tue, 3 Nov 2009 13:45:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from odin.funcom.com (odin.funcom.com [195.110.28.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07E3A321B3 for ; Tue, 3 Nov 2009 13:45:17 -0200 (BRST) Received: from christ-tmp.funcom.com ([195.110.28.242] helo=[127.0.0.1]) by odin.funcom.com with esmtp (Exim 4.63) (envelope-from ) id 1N5LaE-0005sb-Fk for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 16:46:10 +0100 Message-ID: <4AF05041.2070105@funcom.com> Date: Tue, 03 Nov 2009 16:46:09 +0100 From: Christian Tellefsen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: Preventing Lua scripts that never return from freezing the host application Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 091103-0, 11/03/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello all! Since this is my first post here, I'll just have to start by saying thanks to everyone who has been working on Lua. I started using Lua a few months back, and so far it's been a joy. I think it's a very elegant language. Thank you! I'm investigating using Lua as a scripting language for content designers. If I want to make sure that none of the designer-supplied scripts can loop forever and freeze the host application, how would I do that? Sample problem code: f = coroutine.create(function() while true do print('x') end end) -- No yield() coroutine.resume(f) -- Oh no Some possible solutions I'm looking at: - Change the interpreter, so that it returns an error if we've spent too much time / done too many operations. - Run Lua in a separate thread and somehow stop it if it takes too long. - Wrap f in code that calls yield(), and disallow bytecode in f that contains loops or backwards jumps. This would of course greatly limit what can be in a script. Something like this: mycode.create = function(f) assert(mycode.checknoloops(f)) return coroutine.create(function() f() coroutine.yield() end) end - Alternatively, don't fix it in code, just spend some time on teaching the content designers to write their scripts right. If you have any suggestions or experience on how to best attack this problem, I'd be grateful. Cheers, Christian. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 13:57:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Fs9S8004992; Tue, 3 Nov 2009 13:54:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF1631A74E; Tue, 3 Nov 2009 13:52:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BB561A688 for ; Tue, 3 Nov 2009 13:52:43 -0200 (BRST) Received: by ewy26 with SMTP id 26so6224284ewy.5 for ; Tue, 03 Nov 2009 07:53:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.89.8 with SMTP id b8mr51348wef.180.1257263618706; Tue, 03 Nov 2009 07:53:38 -0800 (PST) In-Reply-To: <4AF05041.2070105@funcom.com> References: <4AF05041.2070105@funcom.com> Date: Tue, 3 Nov 2009 15:53:38 +0000 X-Google-Sender-Auth: 2627541e1a2e65cb Message-ID: Subject: Re: Preventing Lua scripts that never return from freezing the host application From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 3:46 PM, Christian Tellefsen wrote: > I'm investigating using Lua as a scripting language for content designers. > If I want to make sure that none of the designer-supplied scripts can loop > forever and freeze the host application, how would I do that? > > Sample problem code: > > f = coroutine.create(function() while true do print('x') end end) -- No > yield() > coroutine.resume(f) -- Oh no > > Some possible solutions I'm looking at: > - Change the interpreter, so that it returns an error if we've spent too > much time / done too many operations. > > - Run Lua in a separate thread and somehow stop it if it takes too long. > > - Wrap f in code that calls yield(), and disallow bytecode in f that > contains loops or backwards jumps. This would of course greatly limit what > can be in a script. Something like this: > > mycode.create = function(f) > assert(mycode.checknoloops(f)) > return coroutine.create(function() f() coroutine.yield() end) > end > > - Alternatively, don't fix it in code, just spend some time on teaching the > content designers to write their scripts right. > > If you have any suggestions or experience on how to best attack this > problem, I'd be grateful. > > Cheers, > Christian. > I would use lua_sethook, with LUA_MASKCOUNT and some value between 50 and 500. This will call your hook function at a regular interval, and then you can abort if things are taking too long. You'll have to do this for each thread though, so you'll have to export slightly tweaked versions of the coroutine.xyz functions to your scripts to add automatic hooking. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 14:05:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3G51Je007234; Tue, 3 Nov 2009 14:05:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F14BF1916D; Tue, 3 Nov 2009 14:03:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth20.prod.mesa1.secureserver.net (smtpauth20.prod.mesa1.secureserver.net [64.202.165.36]) by bazar2.conectiva.com.br (Postfix) with SMTP id 502B419107 for ; Tue, 3 Nov 2009 14:03:34 -0200 (BRST) Received: (qmail 31464 invoked from network); 3 Nov 2009 16:04:27 -0000 Received: from unknown (98.117.140.83) by smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 03 Nov 2009 16:04:27 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Signature of iterator factories From: Mark Hamburg In-Reply-To: <20091103113328.GE16722@inf.puc-rio.br> Date: Tue, 3 Nov 2009 08:04:25 -0800 Content-Transfer-Encoding: 7bit Message-Id: <66618E74-95D1-4EDB-AC18-9F3C970D8FE8@grubmah.com> References: <20091102032533.GF11203@vaio.jimpryor.net> <20091103105032.GA16722@inf.puc-rio.br> <20091103113328.GE16722@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 3, 2009, at 3:33 AM, Roberto Ierusalimschy wrote: > I am sorry, but I sent a wrong reply. I thought his proposal was to > have an extra hidden (but unique) control variable before the visible > variables in the loop. That is, the statement > > for a,b,c in exp do > > would be really > > for _,a,b,c in exp do > > with '_' hidden from the programmer. > > -- Roberto That could be useful in cases where one might want to have an iterator return nil for the first visible state variable. For example, imagine wanting an iterator that would deliver just the values from an array over a range -- values( array, lo, hi ) -- this won't work if there is a nil in the array. I had better examples where I'd wished for this, but the caffeine hasn't kicked in enough this morning for me to remember them. Mark From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 14:05:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3G5l7q007464; Tue, 3 Nov 2009 14:05:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AED98191C8; Tue, 3 Nov 2009 14:04:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.189]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C35CD191B7 for ; Tue, 3 Nov 2009 14:04:20 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so822590gvf.40 for ; Tue, 03 Nov 2009 08:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=jhO+wvfDwpAHS3NsB03udjnP8Is4Qodub/e9VlBelMU=; b=Qhi7ZhXzZ6PvxgJ318Q2LrU7Sv1FxH6uacOqrRqRZmQ4cit3ugAoVDbb3x3p6v9OHv pWl5hrrUKm/nbLR5FcU1e2N8LlDB6+Sw2PdTFfLf1eONKwVOtoSK26eF0jX/pP7X3Daf gGbTT0S4wPv7OY/kNtUJTsYOUNRBSbj89/GtY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=I4v+MRab69Aq8wA6z4usWx3tsuwzJ9kyfz+JugvEXnsqmxkMN9QIpXZfuUFV29g+kr QOkxffrQbVkvG4MSP87ABbnkn7kjRZ4ILOeSWYXm4NXyXlyqG64ZaLieRtjj/RHlp+Jv Ha7gHX5YTdCtbhpMn4a9odVr/dx6V/gd9HLKA= MIME-Version: 1.0 Received: by 10.86.135.27 with SMTP id i27mr2517892fgd.39.1257264316399; Tue, 03 Nov 2009 08:05:16 -0800 (PST) Date: Tue, 3 Nov 2009 21:35:16 +0530 Message-ID: Subject: control of lua dissectors at run time for better performance From: Awadhesh Kumar To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3G5l7q007464 Hi, I have written LUA disectors for Wireshark packets. When I have integrated this lua dissectors with wireshark and start wireshark to capture live packets, I observe that wireshark slows down. Also whenever I tries to stop the wireshark, it takes many 10’s of seconds to accept the command. How can I increase the performance of wireshark? Currently I have registered 25 udp ports to dissects the message. Is it possible to use multi threaded dissectors based on udp port. Can you give me link for that? Is there a way to control whether the LUA script should be engaged or not from the Wireshark GUI – e.g. an option to disable/enable select LUA script at runtime without messing with the init.lua file. Thanks Awadhesh. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 14:07:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3G7idB007941; Tue, 3 Nov 2009 14:07:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 984941928C; Tue, 3 Nov 2009 14:06:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth21.prod.mesa1.secureserver.net (smtpauth21.prod.mesa1.secureserver.net [64.202.165.38]) by bazar2.conectiva.com.br (Postfix) with SMTP id 28F6F1921E for ; Tue, 3 Nov 2009 14:06:15 -0200 (BRST) Received: (qmail 22589 invoked from network); 3 Nov 2009 16:07:10 -0000 Received: from unknown (98.117.140.83) by smtpauth21.prod.mesa1.secureserver.net (64.202.165.38) with ESMTP; 03 Nov 2009 16:07:10 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Signature of iterator factories From: Mark Hamburg In-Reply-To: Date: Tue, 3 Nov 2009 08:07:08 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <20091102032533.GF11203@vaio.jimpryor.net> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean As I said, not enough caffeine. Juris's post reminded me... When I'd thought about the issue before, it wasn't so much that I wanted more or hidden control variables as I wanted the end-of-loop to be signaled by returning nothing rather than by returning nil. Mark From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 14:15:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3GFgnx009810; Tue, 3 Nov 2009 14:15:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76AAD1929D; Tue, 3 Nov 2009 14:14:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCFBE1921E for ; Tue, 3 Nov 2009 14:14:12 -0200 (BRST) Received: by bwz27 with SMTP id 27so7771194bwz.21 for ; Tue, 03 Nov 2009 08:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=vuvf8Q27TKFYOI0TGhEUH9SAy8XO7K7oNzD7WRIs2Zo=; b=qzdoaog1Jdr+F04LIOPWLOAxOGKO3zyHFuUtlZQY3DwYgOhcfgfZOVWc7NFTCz6hJj XQ++8ksM3GalvcYAAZKBfeOXZXWeJ+/PdCrM4J+coxrd1oN6NLZq/iP+CVCT4LthDRzg JP9Hc1RdXvruXkZLQdKf0JLOX1vTWcAriGvKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VUqs9IpvAWWPBYAf7aOcvwqGEeOp2VYx1pqM1Gh34elpoGL3SQ1OPFsb4SR8Py9T3V 9QL+di4ZrV7PpRNuqNXXd5htVu55WqtwvG8Q5ddAnMlxPJAT8WAMYkEjmnICPTIhwdgg F50stglddXNijegqQbjM4nCrdxNNCKM206DNQ= MIME-Version: 1.0 Received: by 10.223.54.23 with SMTP id o23mr23593fag.72.1257264908113; Tue, 03 Nov 2009 08:15:08 -0800 (PST) In-Reply-To: References: <4AF05041.2070105@funcom.com> From: Jim Whitehead II Date: Tue, 3 Nov 2009 16:14:48 +0000 Message-ID: <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com> Subject: Re: Preventing Lua scripts that never return from freezing the host application To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 3:53 PM, Peter Cawley wrote: > On Tue, Nov 3, 2009 at 3:46 PM, Christian Tellefsen > wrote: >> I'm investigating using Lua as a scripting language for content designers. >> If I want to make sure that none of the designer-supplied scripts can loop >> forever and freeze the host application, how would I do that? >> >> Sample problem code: >> >> f = coroutine.create(function() while true do print('x') end end) -- No >> yield() >> coroutine.resume(f) -- Oh no >> >> Some possible solutions I'm looking at: >> - Change the interpreter, so that it returns an error if we've spent too >> much time / done too many operations. >> >> - Run Lua in a separate thread and somehow stop it if it takes too long. >> >> - Wrap f in code that calls yield(), and disallow bytecode in f that >> contains loops or backwards jumps. This would of course greatly limit what >> can be in a script. Something like this: >> >> mycode.create = function(f) >> assert(mycode.checknoloops(f)) >> return coroutine.create(function() f() coroutine.yield() end) >> end >> >> - Alternatively, don't fix it in code, just spend some time on teaching the >> content designers to write their scripts right. >> >> If you have any suggestions or experience on how to best attack this >> problem, I'd be grateful. >> >> Cheers, >> Christian. >> > > I would use lua_sethook, with LUA_MASKCOUNT and some value between 50 > and 500. This will call your hook function at a regular interval, and > then you can abort if things are taking too long. You'll have to do > this for each thread though, so you'll have to export slightly tweaked > versions of the coroutine.xyz functions to your scripts to add > automatic hooking. Keep in mind that for certain C functions (like string.find) won't call your debug hook in them, so a user script can still tie up the system in what appears to be an infinite loop, but really is just code that takes a long time to run (all without your hook being called). - Jim From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 14:49:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3GnacH016914; Tue, 3 Nov 2009 14:49:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D0031A6F1; Tue, 3 Nov 2009 14:48:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 961981A668 for ; Tue, 3 Nov 2009 14:47:56 -0200 (BRST) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091103164850.BTCT27507.mtaout02-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Tue, 3 Nov 2009 16:48:50 +0000 Received: from [92.29.18.120] (helo=taboche) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1N5MYs-0005jS-I6 for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 16:48:50 +0000 From: Thomas Lauer To: Lua list Subject: Re: [ANN] Idle v1.0 Date: Tue, 03 Nov 2009 16:48:55 +0000 Organization: TL Message-ID: References: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> In-Reply-To: <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=8RloEfZUAAAA:8 a=SFBYNVl0AAAA:8 a=AjNtXHXTAAAA:8 a=Ke57FpjNCfM_vmxwVqQA:9 a=HIcfUw2FSE0QajQWoocQuF8igwgA:4 a=I-Q4fQThMMMA:10 a=TJIZK83Hqg4A:10 a=gxrx0nZMkGAA:10 a=MSl-tDqOz04A:10 a=O58u2wXj750A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3GnacH016914 Francesco Abbate wrote: > 2009/11/2 Thomas Lauer : > > After more than two years of development, I am happy to announce the > > release of Idle version 1.0. > > > > See http://idle.thomaslauer.com for details about Idle and > > http://idle.thomaslauer.com/IdleDownload.html for downloads. > > > > Idle is a compact, powerful scripting language based on Lua 5.1. It is > > available for Windows 2000 and later systems (a Linux/BSD/... release is > > neither available nor planned). Idle is released under the MIT licence. > > > > Anyone interested in the upcoming source code release please drop me a > > quick note as I a looking for a few volunteers to torture with a > > preliminary release of the sources. > > Hi Thomas, > > I've given a look to your page. It seems to me that Idle is not 'based > on Lua' but actually *is* Lua just with some customizations :-) http://lua-users.org/lists/lua-l/2007-07/msg00215.html Since the above was written I have added further features (see http://idle.thomaslauer.com/IdleLanguage.html#Differences%20to%20Lua ). So although Idle is indeed (mostly) backward-compatible it is, as far as I can see, not Lua. However, other people have been known to disagree. Fair enough as I may be misguided or even muddled in my thinking. At any rate, I'm not going to argue the point: if you think Idle is Lua, that's fine with me. > I was also interested in the gui module and I was wondering if it is > based on an existing toolkit or if you built it from scratch. The latter. It is a pragmatic attempt to create a usable module ("good enough") for building simple GUIs and dialog boxes. Like many things in Idle the gui module is mostly based on what I needed for my own projects (though I added some bits and pieces as suggested by other users). > Otherwise, I'm using Windows at work with mingw and I would be glad to > try your code. Noted. Compiling with minGW won't be an out-of-the-box experience but it should be possible w/o too much trouble. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 15:08:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3H85SX021351; Tue, 3 Nov 2009 15:08:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B844619049; Tue, 3 Nov 2009 15:06:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47F7918FF0 for ; Tue, 3 Nov 2009 15:06:38 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so466605fgb.17 for ; Tue, 03 Nov 2009 09:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TKPJwONvXVG7QfH7yKmKTxHmnQQG3Mo5LTKn/zU+KOo=; b=MVmL3B6X8sPVS5UsLSDCkl2/WeeG5/uJ8jrWdntRkTeP7IHUM0mNbz5l/ksNhFT4Uv X+6hlclNOJWzVPEhS4TtHf+nu4AGzIIlUq+S1/sjaNF+Z9cp32L9iTGKo9J8SLkzErt4 oT8OzmAhdKWDCMQkMww89vQpuRpVj4g/imKJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=HPoQobsSTI8qUXKenaki4Kdevc1YmLnKpkPy4rTX1tldsq0FQXQeBsSzEjTUVNOzI8 JBLIqX/Tw6TYphxhxWWhwoEIFjHp1//VUhnKggygo2fIqKTKiBN//K5xaXeLN3oKl1u8 ooB93wrQ2N1mMdzWwXfRrQSBNg8nlvqQa8w/0= MIME-Version: 1.0 Received: by 10.86.203.35 with SMTP id a35mr3282344fgg.44.1257268053356; Tue, 03 Nov 2009 09:07:33 -0800 (PST) In-Reply-To: References: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> <9386fb2d0911030345o71040b73g4b5b3cdba6d39f3e@mail.gmail.com> Date: Tue, 3 Nov 2009 18:07:33 +0100 Message-ID: <9386fb2d0911030907i177962cbo826a312ee4cf796@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3H85SX021351 >        You should take a look at the new version at: > > http://www.inf.puc-rio.br/~brunoos/luasec/ > http://www.inf.puc-rio.br/~brunoos/luasec/reference.html#request > >        Version 0.4 now provides support for HTTPS through LuaSocket. >                Tomás Hmm... What obvious reason is there for the luaforge-page not to be updated/redirecting, that i am missing? I, at least, find it confusing with old mirrors lying around on the internet. /Pierre From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 15:35:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3HZrsQ029268; Tue, 3 Nov 2009 15:35:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 060EB1A75B; Tue, 3 Nov 2009 15:34:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C7421A68F for ; Tue, 3 Nov 2009 15:34:12 -0200 (BRST) MailScanner-NULL-Check: 1257874445.00873@ozuE6Eui181uNt4X6Lkq1w Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA3HXq4C030836 for ; Tue, 3 Nov 2009 15:33:59 -0200 Message-ID: <4AF0699E.1020802@inconcertcc.com> Date: Tue, 03 Nov 2009 15:34:22 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Diego Nehab wrote: > > If there are other open issues I should to consider, please > let me know. Maybe this? Is not an open issue per se, but a useful addition. http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 15:49:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3HnQt2032646; Tue, 3 Nov 2009 15:49:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1207B1A752; Tue, 3 Nov 2009 15:48:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 110F01A68F for ; Tue, 3 Nov 2009 15:47:56 -0200 (BRST) Received: by fxm21 with SMTP id 21so14178fxm.21 for ; Tue, 03 Nov 2009 09:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=P02+00QMTzaw7UCZ/ky8T/IdM59tdFB6aE97++CdJ34=; b=mp2DTMwZa5pclAbbtSnCgswSyUBgGToeudT+t1VtajsuwVCWfhtrmNK9BrIJoa7Q7e 6ukAKF1SiKZslfvRBQTL+T96Ihy5qC8SzbbmrwszR98F5L8bZ9pjI/Jcq+Bsf711FOYp Hly5ncurYUg5fkjFX0ZxUIXslpY1te6mfqX9g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=uLGhRIeBOcIeK28bw687NatyV7LLWWasnYjfbtJwHJwhZhXQjfJKfyMvr9xmbbypv3 i2wnvx0ZIumbnQCwCMNpLLcBQXs5QFU6ARuBp6qOtgaYuZYuxD/WjgKLOUJDaamSqVde Bq3d+FlpVU5gGecyhpqXyGCz5MCZKoNC4DAmo= Received: by 10.204.6.24 with SMTP id 24mr313418bkx.25.1257270530044; Tue, 03 Nov 2009 09:48:50 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 15sm85474fxm.10.2009.11.03.09.48.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Nov 2009 09:48:48 -0800 (PST) Date: Tue, 3 Nov 2009 20:43:21 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1616701622.20091103204321@gmail.com> To: Mike Pall Subject: Re[2]: [ANN] LuaJIT-2.0.0-beta1 In-Reply-To: <20091103092226.GA11838@mike.de> References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Mike, Tuesday, November 3, 2009, 12:22:26 PM, you wrote: > Selecting only up to 3*4 bytes was fast, but not good enough. See why not use those 12 bytes from the *center* of string? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 15:57:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Huwkm002119; Tue, 3 Nov 2009 15:57:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E8DF1A762; Tue, 3 Nov 2009 15:55:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EC901A696 for ; Tue, 3 Nov 2009 15:55:31 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5NcJ-0006Qk-00; Tue, 03 Nov 2009 18:56:27 +0100 Date: Tue, 3 Nov 2009 18:56:19 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091103175619.GA1860@mike.de> References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> <1616701622.20091103204321@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1616701622.20091103204321@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Bulat Ziganshin wrote: > > Selecting only up to 3*4 bytes was fast, but not good enough. See > > why not use those 12 bytes from the *center* of string? But that's why it failed on URLs. The front is 'http', the back is 'html'. And the center is some common part of the path higher up in the hierarchy. Now, if the URLs are the same length we get a 100% collision probability. :-/ BTW: There's no need to CC me for on-list postings. :-) --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 16:02:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3I2iAH003740; Tue, 3 Nov 2009 16:02:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 03A8C1A766; Tue, 3 Nov 2009 16:01:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from odin.funcom.com (odin.funcom.com [195.110.28.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CECA21A754 for ; Tue, 3 Nov 2009 16:01:13 -0200 (BRST) Received: from christ-tmp.funcom.com ([195.110.28.242] helo=[127.0.0.1]) by odin.funcom.com with esmtp (Exim 4.63) (envelope-from ) id 1N5Nhq-0004jG-AQ for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 19:02:10 +0100 Message-ID: <4AF07021.8070100@funcom.com> Date: Tue, 03 Nov 2009 19:02:09 +0100 From: Christian Tellefsen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Preventing Lua scripts that never return from freezing the host application References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com> In-Reply-To: <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 091103-0, 11/03/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jim Whitehead II wrote: > On Tue, Nov 3, 2009 at 3:53 PM, Peter Cawley wrote: > >> On Tue, Nov 3, 2009 at 3:46 PM, Christian Tellefsen >> wrote: >> >>> I'm investigating using Lua as a scripting language for content designers. >>> If I want to make sure that none of the designer-supplied scripts can loop >>> forever and freeze the host application, how would I do that? >>> >>> Sample problem code: >>> >>> f = coroutine.create(function() while true do print('x') end end) -- No >>> yield() >>> coroutine.resume(f) -- Oh no >>> >> I would use lua_sethook, with LUA_MASKCOUNT and some value between 50 >> and 500. This will call your hook function at a regular interval, and >> then you can abort if things are taking too long. You'll have to do >> this for each thread though, so you'll have to export slightly tweaked >> versions of the coroutine.xyz functions to your scripts to add >> automatic hooking. >> Thanks, this worked great! void CoroutineTimeoutHook(lua_State * L, lua_Debug * ar) { luaL_error(L, "Script took too long to execute."); } int CoroutineCreate(lua_State * L) { lua_State * L1 = lua_newthread(L); // L: f, thread lua_pushvalue(L, 1); // L: f, thread, f lua_xmove(L, L1, 1); // L: f, thread L1: f lua_sethook(L1, &CoroutineTimeoutHook, LUA_MASKCOUNT, 10000); return 1; } > > Keep in mind that for certain C functions (like string.find) won't > call your debug hook in them, so a user script can still tie up the > system in what appears to be an infinite loop, but really is just code > that takes a long time to run (all without your hook being called). > > - Jim > > OK, thanks, I'll keep that in mind, or maybe I'll just remove access to that function. Cheers, Christian. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:02:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3J1uan018723; Tue, 3 Nov 2009 17:01:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 681031A75B; Tue, 3 Nov 2009 17:00:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E60B71A68F for ; Tue, 3 Nov 2009 17:00:21 -0200 (BRST) Received: by bwz27 with SMTP id 27so7949376bwz.21 for ; Tue, 03 Nov 2009 11:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=CVq8HiioP/f99ZDyj9lgBS8+kI+6NtIeWdDni7L2sT8=; b=bSAp1HgjONoLAUEGNqwbG0x69YT7ax8I/+Jdy+75+SQzzfp5BDNzHQc7Wh1yVpY+/P Tph2LTOTKp+pvnAE2wvZa14FGAw9BxXwUoFzKhLdekqzBDK2w9eIOoZRI19r/Upka5b/ TATexckUYf3+g9C955PKnIA64c0Lhail40tr4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=pan5mf/jMHdG3xzt22suljQKB7PWB1C26F701sXowGRpuwzw2+zlBSzzWXTFt9XSBW t/KMsFk1Ytor8F02RVOpJNnPNtYpDx5Fdrbj8ZOl9w7USGC4vLE94r8WfOFX79E/NJa5 RWi+H1REHH32Nf+wERRRXG1kuA6erlp9abzVQ= Received: by 10.204.34.5 with SMTP id j5mr404710bkd.5.1257274876150; Tue, 03 Nov 2009 11:01:16 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 16sm151804bwz.11.2009.11.03.11.01.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Nov 2009 11:01:14 -0800 (PST) Message-Id: <2E4356F7-1820-4CA5-8224-41BE93FFF23E@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <4AF0699E.1020802@inconcertcc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Date: Tue, 3 Nov 2009 20:00:43 +0100 References: <4AF0699E.1020802@inconcertcc.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3J1uan018723 On Nov 3, 2009, at 6:34 PM, Ignacio Burgueño wrote: > Maybe this? Is not an open issue per se, but a useful addition. > > http://www.net-core.org/39/lua/patching-luasocket-to-make-it- > compatible > > http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch I would second that! Such addition would be very useful. Please, pretty please! :)) From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:26:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JQ2sK025376; Tue, 3 Nov 2009 17:26:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C584C190B5; Tue, 3 Nov 2009 17:24:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 563201908D for ; Tue, 3 Nov 2009 17:24:31 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5P0L-0007UY-57 for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 20:25:21 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5P0K-0006ki-J7 for lua@bazar2.conectiva.com.br; Tue, 03 Nov 2009 20:25:20 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Interning strings considered harmful (somewhat) References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> Date: Tue, 03 Nov 2009 20:25:20 +0100 In-Reply-To: <20091026161103.GA12846@inf.puc-rio.br> (Roberto Ierusalimschy's message of "Mon, 26 Oct 2009 14:11:03 -0200") Message-ID: <87tyxbxvfj.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Roberto Ierusalimschy: >> The second part of the following benchmark shows distinctly non-linear >> performance: Each pass of the first part runs under one second on my >> machine, but the passes in the second part take 4, 14, and 32 seconds, >> respectively. >> >> I'm a bit worried by this, and the impact on programs which process >> data from untrusted inputs. I haven't got a really good idea what can >> be done about this. In similar cases, people have used Jenkins' >> lookup3.c hash function with a random seed. Perhaps it is sufficient >> to drop the skipping from Lua's hash function and use a random seed >> stored in the Lua state, but the internal mixing of the current hash >> function seems to be rather weak. > > What exactly is worrying you? A network service that uses externally supplied strings and does not immediately release them (either due to explicit retention, or due to GC delays) can experience a significant slowdown. The effect is also visible without without an string retention, that is, with: local function f(s, count) for i=10000,10000 + count - 1 do local s1 = magic(s, i) end end You won't see quadratic behavior in the count because it's now dependent on the length of a GC cycle (I think). > Excluding malware, I do not think this situation happens enough to > justify any worry. I know the argument: anybody who wants to take out your web server can just flood it with 5 Gbps of traffic (or more if necessary). > Considering malware, I guess there are plenty of ways for untrusted > inputs to waste CPU time, this is only one more. It's a generic one, that can't be avoided as long as you keep using strings. Other things can be avoided by applying conservative bounds before starting computations etc. > (BTW, simply dropping the skip in the hash function does solve the > "problem"; just add a "step = 1" in lstring.c to check. But it creates a > new one: the hash function becomes too expensive for long strings.) You need to add a random seed, too. Is the result really too expensive? Doug Baskins (the Judy array inventor) suggests to use a relatively weak hash to split strings into buckets and then store the strings in each bucket in a trie, using Judy arrays. I don't know if Judy arrays actually pay off their complexity (the hashing destroys locality, so it's hard to imagine how the'd be a win). Would an uninterned string type introduce too many additional code paths in the VM? From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:28:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JS9NT025939; Tue, 3 Nov 2009 17:28:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A432F1A5E5; Tue, 3 Nov 2009 17:26:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s45.bay0.hotmail.com (bay0-omc3-s45.bay0.hotmail.com [65.54.246.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DDD22190D8 for ; Tue, 3 Nov 2009 17:26:43 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s45.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 3 Nov 2009 11:27:34 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Tue, 3 Nov 2009 19:27:33 +0000 Message-ID: <4AF08422.6040905@my.erau.edu> Date: Tue, 3 Nov 2009 14:27:30 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Preventing Lua scripts that never return from freezing the host application References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com> <4AF07021.8070100@funcom.com> In-Reply-To: <4AF07021.8070100@funcom.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Nov 2009 19:27:34.0603 (UTC) FILETIME=[B1DAD9B0:01CA5CBB] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Christian Tellefsen wrote: > Jim Whitehead II wrote: >> >> Keep in mind that for certain C functions (like string.find) won't >> call your debug hook in them, so a user script can still tie up the >> system in what appears to be an infinite loop, but really is just code >> that takes a long time to run (all without your hook being called). >> >> - Jim >> >> > OK, thanks, I'll keep that in mind, or maybe I'll just remove access to > that function. > That's not really a solution, to be honest. There are other functions with this problem as well. In addition, there are also things you can't remove that will result in your hook rarely being called. A few examples: string.rep("s", 2^30) -- Removable, but probably a bad idea -- Problematic if it can loop enough times: local s = "aaaaaaaaaaaaaaaa"; while true do s = s .. s; end The second is a more severe problem because it's the concatenation that will take a long time (at later iterations, e.g., around the 5th+). If your limits are set low enough, this won't be a problem because that iteration can't be reached. But if your limits aren't low enough, and those iterations are reachable, you're going to encounter a problem in that the concatenation operation can take a very long time. These are just a few examples of what came across various Lua bots that have been tested for security. Generally the premium solution has been in one of two forms: (1) Use ulimit to control CPU usage (not portable) (2) Use a second thread through a library like lualanes to monitor the progression of the execution thread, and terminate it after a known time limit. Neither of these, however, are Lua-only solutions. Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:29:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JT8tF026136; Tue, 3 Nov 2009 17:29:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA271A760; Tue, 3 Nov 2009 17:27:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D51A1A696 for ; Tue, 3 Nov 2009 17:27:39 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1453830eye.39 for ; Tue, 03 Nov 2009 11:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=Z4iNYWZTNiVOrcZddzyaOJdPkYrow+QA/egyv+LZ2y4=; b=WOicGKqtSlKCHwO8FauKmpUdEy+LUqkJPiFlZ25yPafQNRFqTG2HXqGimHM5ylMcAj ClsFR9ZLBbR1+dPRH6hw6rnM1qrvi1VCnnEqgoXYmVSs5LCdmh9d5qjMr/UcSrRO1uv+ CJK+ygzW3tsbXwTau2ZOcRAvb/HrFwizbGgEM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=d9gatG8AaJQ9FrNTCkbBvyx6zq4VY55iXmcroQiq41PdgQOQuvTrg/naDQfgJr19WN N6Jj8Whtev2/JDPIorqZQ9o/65NnFw5oOZKummcs7BOCIJn13QWBSWa8muD4A0s1I2XR eo3UcuyVOZu5WArgpPZKhL1s8tteniJvHKqWc= MIME-Version: 1.0 Received: by 10.216.89.137 with SMTP id c9mr158889wef.228.1257276515604; Tue, 03 Nov 2009 11:28:35 -0800 (PST) In-Reply-To: <20091103120817.GA18760@mike.de> References: <20091103120817.GA18760@mike.de> Date: Tue, 3 Nov 2009 14:28:16 -0500 Message-ID: Subject: Re: LuaJIT-2 shootout performance one-core versus quad-core From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-03, Mike Pall wrote: > Auto-parallelization has been tried for the last fourty years > with, umm, mixed results. Almost all of the benchmarks on the > shootout are manually parallelized (e.g. using OpenMP). But this > is tedious. Also, parallel != concurrent. > > This is a wide field. No easy solution in sight. > > --Mike Parallel != Concurrent. Parallel is much easier. For example, fractal can grow from 4 stems in parallel requiring no data exchanges between the branches and no need for synchronization. Something like LuaLanes might be sufficient for some benchmarks in shootout to improve the standing. LuaJIT-2 performance on a single-core is spectacular. On the quad-core it is less so. --Leo-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:49:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Jn0Wv031313; Tue, 3 Nov 2009 17:49:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAC631A763; Tue, 3 Nov 2009 17:47:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E9B51A696 for ; Tue, 3 Nov 2009 17:47:25 -0200 (BRST) Received: by yxe17 with SMTP id 17so5736939yxe.33 for ; Tue, 03 Nov 2009 11:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=I2E1/E+9UUnqdNEUXzjo2TMlgEogVO3wqSAcaTmQ7Gs=; b=p2cCis7Y3Yv/nprQ9lYD2QrCbDCz6noQEoe2G61Pt/HlK/j5UyfM0kOGG1TYPU7W++ 1nCNnh4VX2/beqdqtEfyJNPk0v0GljeyRY+iepfwAtEQV4awOWNNvt1bmpnwmoFegdB8 zmg7IGcM1FBU29h/IWPQbvNvepBVxIfDkiswA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=onokWFPwHlak0pA6t4t4cW4S2LZBX7k3bC5XNSmauJmAl5I/67h3DSPsIVa6onXleX W2llasxkkztjAv9OjY/lexO4zwUsyrC1Bwgzl/ZZ0Df+olb0n8KERswHRwvcaSs1pPU4 miiorsrjvsJg29tnLIA91JpNH0WUmrzllJeuk= MIME-Version: 1.0 Received: by 10.91.55.2 with SMTP id h2mr1081191agk.65.1257277700374; Tue, 03 Nov 2009 11:48:20 -0800 (PST) In-Reply-To: <4AF0699E.1020802@inconcertcc.com> References: <4AF0699E.1020802@inconcertcc.com> Date: Tue, 3 Nov 2009 14:48:20 -0500 Message-ID: <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Joseph Stewart To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3Jn0Wv031313 All, Maybe I don't understand the underlying problem the acceptfd patch addresses, but if it's simply a matter of getting the file descriptor from a luasocket object, then you can use the :getfd() function. -joe 2009/11/3 Ignacio Burgueño : > Diego Nehab wrote: > >> >> If there are other open issues I should to consider, please >> let me know. > > Maybe this? Is not an open issue per se, but a useful addition. > > http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible > > http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch > > Regards, > Ignacio > > > From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:49:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3Jnl0v031505; Tue, 3 Nov 2009 17:49:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D9BF31A76D; Tue, 3 Nov 2009 17:48:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01EEC1A696 for ; Tue, 3 Nov 2009 17:48:21 -0200 (BRST) Received: by pzk34 with SMTP id 34so4372204pzk.11 for ; Tue, 03 Nov 2009 11:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rAeppPrzYniYQuiF7RU2xOow9ykSw493ska3S2sUWvE=; b=alNsrplH+vxBtaCqqptJ84DReq/C72Vt7zFTtnO8WvREmmvhzyaM4Ku36mgNBgCuOm i4tA36NaJK9M0abDxsfZbsR7597Hkw5zHG5He2HmqWzJNViLQRJX+TUZgCVMZY8kK7QZ k3pgkRTIJY6s2vT6mv/mZg8XYl0XGHiduuHRU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=s/3W8AKsPBr1A1IJ2o75C50anJUt+ZLZ6IXiSTY+f3kWkBGxG2DgE896GF3XvdENuX pH2U/G/5U0YkMseOd4aXIK7uizQ96ceujejXOKBNLnvtiXG8H2e3mV7HKuMsa24AmmVc qE04pvitVGFwK1pu9MfozFjcRwRPmTYE5snvI= MIME-Version: 1.0 Received: by 10.140.131.5 with SMTP id e5mr999rvd.173.1257277758384; Tue, 03 Nov 2009 11:49:18 -0800 (PST) In-Reply-To: <2E4356F7-1820-4CA5-8224-41BE93FFF23E@gmail.com> References: <4AF0699E.1020802@inconcertcc.com> <2E4356F7-1820-4CA5-8224-41BE93FFF23E@gmail.com> Date: Tue, 3 Nov 2009 22:49:18 +0300 Message-ID: Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> Maybe this? Is not an open issue per se, but a useful addition. >> http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible >> http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch > I would second that! Such addition would be very useful. Please, pretty > please! :)) Me too :-) (Sorry, can't resist.) Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:51:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JpZRA031859; Tue, 3 Nov 2009 17:51:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7B2F1A771; Tue, 3 Nov 2009 17:50:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BE8A1A696 for ; Tue, 3 Nov 2009 17:50:09 -0200 (BRST) Received: by ewy26 with SMTP id 26so6479001ewy.5 for ; Tue, 03 Nov 2009 11:51:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.90.12 with SMTP id d12mr168158wef.64.1257277864628; Tue, 03 Nov 2009 11:51:04 -0800 (PST) In-Reply-To: <4AF08422.6040905@my.erau.edu> References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com> <4AF07021.8070100@funcom.com> <4AF08422.6040905@my.erau.edu> Date: Tue, 3 Nov 2009 19:51:04 +0000 X-Google-Sender-Auth: 2abc0866673c2d07 Message-ID: Subject: Re: Preventing Lua scripts that never return from freezing the host application From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 7:27 PM, Matthew P. Del Buono wrote: > Neither of these, however, are Lua-only solutions. People often seem to point at standard library functions being problematic. I don't see anything special about standard library functions - if you have a problem with them, then you've got their source code, so you can provide your own custom standard library which calls hooks from within the inner loops of standard functions. Could you not just hook every N virtual machine instructions (via sethook), every call (again via sethook), every memory allocation (by changing the allocator function at runtime), and provide custom versions of all standard library functions which call a hook on every N iterations of their inner loop(s)? Most of these hooks would just check elapsed time, and the memory allocator would also check against a memory limit. Unless I'm missing something, surely this would be a Lua-only solution? From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:55:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JtWpR032462; Tue, 3 Nov 2009 17:55:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D972E1A774; Tue, 3 Nov 2009 17:54:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D39801A696 for ; Tue, 3 Nov 2009 17:54:03 -0200 (BRST) Received: by bwz27 with SMTP id 27so8007702bwz.21 for ; Tue, 03 Nov 2009 11:54:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=tUiKVjTWe7+fG4CoUFFtfmoqdHqmVS2n7XPkXUi/jB4=; b=HWpk7/B8kqWqntM7ZBSjp13hwGPVnvDkaWLJMnEtG4HIjbvGxz3sE4r3NripEp/ipG nYn6DNAE4AqvppQ1/82BtsIYJOReObBCXu5kaIoDDRQqDn+RQxWAbo2JMrc04mbj6+v3 t6IQjH9tDw2+vcuFhi63zI+WiImAL/P8xO0Ik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=L9D0Y5agiW5wC+sUp08l1Yh24z4MLQWUDOLvsyWFUSsUsFaT6HfoapimMQWJxoSpIW CXzUHx1X4xTOrPvVfZkoVRaQ70E655OYGwoS0UV0Pdoq+A6bqNtEJ2FkaqiY3VPUjFrz fl+nazz3LSCHSMjFrMXVwWd+WuwyAZq13uK+g= MIME-Version: 1.0 Received: by 10.204.32.201 with SMTP id e9mr424251bkd.122.1257278099081; Tue, 03 Nov 2009 11:54:59 -0800 (PST) In-Reply-To: <9386fb2d0911030907i177962cbo826a312ee4cf796@mail.gmail.com> References: <8d896d0f0911030132k7a7f8a31j5538d0dcf1d57fd1@mail.gmail.com> <9386fb2d0911030345o71040b73g4b5b3cdba6d39f3e@mail.gmail.com> <9386fb2d0911030907i177962cbo826a312ee4cf796@mail.gmail.com> From: Bruno Silvestre Date: Tue, 3 Nov 2009 17:54:39 -0200 Message-ID: <851b2b420911031154i4917c88wdea906bc3b01d0be@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 3:07 PM, Pierre LeMoine wrote: > Hmm... What obvious reason is there for the luaforge-page not to be > updated/redirecting, that i am missing? FTP is not working (at least for me) and Google forgot the mirror. :-/ -- bruno From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 17:57:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3JvJHk000334; Tue, 3 Nov 2009 17:57:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 289931A777; Tue, 3 Nov 2009 17:55:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3E061A696 for ; Tue, 3 Nov 2009 17:55:48 -0200 (BRST) Received: by bwz27 with SMTP id 27so8009624bwz.21 for ; Tue, 03 Nov 2009 11:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=yFYHkD1cQgvMROOQjxqP9WvGOk+3yFZcennIRa4EJfg=; b=bPiVFLjEaD+Lo8L0IszUkOSZYfW1UwneUFzwwATmR7/y0tu/g8e5wT4qxrI2c0IMw8 oKkF4ysgeJ5+Lu/RYur07XIp6JMbOGuZr2NBR+sYB9+uK1zKcc9IXjgeIQNTaOnYx2Hz JF4C2SKLJXl8mj0rwt61dlA6Ttt0zcIsnYpAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=YSD47ez98Uw7z3CT7GiYY2bs9KfnCLtpmGPj3ayWshUeb1GeUVaJh9Su7w0lOkyyrv FKIib640EbghPDY+P+3mTxxDblCx0/wt0UKpWaBtjVEdComMCzp0UKYruOiov/xCHzrv DP6nBLJ71gETNLEypGD60fJQ57QqQsbWWooPw= Received: by 10.204.2.131 with SMTP id 3mr391082bkj.175.1257278205216; Tue, 03 Nov 2009 11:56:45 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 15sm170330bwz.8.2009.11.03.11.56.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Nov 2009 11:56:43 -0800 (PST) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Date: Tue, 3 Nov 2009 20:56:12 +0100 References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 3, 2009, at 8:48 PM, Joseph Stewart wrote: > Maybe I don't understand the underlying problem the acceptfd patch > addresses, but if it's simply a matter of getting the file descriptor > from a luasocket object, then you can use the :getfd() function. That, and build a socket out of a fd, e.g. socket.tcp( fd ). Once a socket can be express solely in term of a fd, serializing it become trivial :)) From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 18:06:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3K618W001904; Tue, 3 Nov 2009 18:06:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4FDE1877F; Tue, 3 Nov 2009 18:04:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0588186E6 for ; Tue, 3 Nov 2009 18:04:22 -0200 (BRST) MailScanner-NULL-Check: 1257883505.70187@w4AdefGHRF3guaxsBFIAhw Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA3K53As007914 for ; Tue, 3 Nov 2009 18:05:04 -0200 Message-ID: <4AF08CE2.1010906@inconcertcc.com> Date: Tue, 03 Nov 2009 18:04:50 -0200 From: =?windows-1252?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> In-Reply-To: <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Joseph Stewart wrote: > All, > > Maybe I don't understand the underlying problem the acceptfd patch > addresses, but if it's simply a matter of getting the file descriptor > from a luasocket object, then you can use the :getfd() function. > Quoting from: http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible "It adds a new method “acceptfd” which works just like “accept” but instead of returning a socket object it returns the underlying “file descriptor” (a number). A new optional parameter to “socket.tcp()” allows to create a socket object from a file descriptor." So you could accept connections in a given Lua state and process it in a different one. Be it by means of using Lanes, LuaProc, or whatever suits you. Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 18:34:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3KYchl006687; Tue, 3 Nov 2009 18:34:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0B581A763; Tue, 3 Nov 2009 18:33:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 141671A696 for ; Tue, 3 Nov 2009 18:33:03 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so696138fgb.17 for ; Tue, 03 Nov 2009 12:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=wkmabxCvq7KA0JgL11fShjFPixI8nRnqyOiEIiQXX+M=; b=aa8/LnIc14hFtceQM0+5WfY76pRhjwlxF8Mr2nZWbiLPGjx1pJNSc5iZepOfiM+ueE UpW5FLKyFgMiRT9BEj69gxRs8+dAcxWCU/oDpbMDmsT0qcm2bwngtffLfznH1eBc81Pc 4B/iOxUQEBN0BgpNtGiMP/cF1xpxDZRKrlkJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Rtenolid4tG6oTdVaT/dBJes9DE4hyBMAT0ItLeaW8DBnR0+kzE1gmILiPzqbdkF/W zKx7oDPZgRCeUjiWpptH7Pg5mfxNuQ64Y6vO5INvFPd28WMkumUk61RbLQ5KOq8/s17E ev+G10Bcbr6kq6nHdV2+KljGmuM5R9v2p3KGg= MIME-Version: 1.0 Received: by 10.86.135.33 with SMTP id i33mr3391998fgd.56.1257280439079; Tue, 03 Nov 2009 12:33:59 -0800 (PST) In-Reply-To: <4AF0699E.1020802@inconcertcc.com> References: <4AF0699E.1020802@inconcertcc.com> Date: Tue, 3 Nov 2009 21:33:59 +0100 Message-ID: <9386fb2d0911031233j7c6ae1bbx5bebaa5cf60d17b3@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Maybe this? Is not an open issue per se, but a useful addition. > > http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible > > http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch +1 /Pierre From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 19:19:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3LJn8s013393; Tue, 3 Nov 2009 19:19:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05FC418BB2; Tue, 3 Nov 2009 19:18:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56118187FF for ; Tue, 3 Nov 2009 19:18:16 -0200 (BRST) Received: by ewy26 with SMTP id 26so6573378ewy.5 for ; Tue, 03 Nov 2009 13:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bD75rTGr+duWfHwNyQycfWUo5MoPz5I9e6jUEtRLHbI=; b=AlISXI0HnVPPh1ZWDY4ATjnm7VnxoECvKTGDmDckAOzafPw8Ep8B6lMi7UIGm4QFbo AWxF4WxN6Nh8/PcNZWe8D7EVEFBt29obpbrpkEkyJ3Omf/TJcgh5oivz7is9JKrRIKCf 3PuxdPBk4+7HGKqZWYy1rWYm2gbo/7KmJRqIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PPAUvp4918wIigqhasEUl+C6sxkECCeF2WzDubvdubYFaO8RGI4YnFCNWMnI5JXZGs bObaUdH/3THkNt0Nk9rPRq+P2cJTBGZwqY0EArLD2Al6rem+HQG+69fJaBj+iIdGaJjT YRPWUkMxaw9AAoLMPA73KyDfkmOrTAzn67P+Q= MIME-Version: 1.0 Received: by 10.216.88.1 with SMTP id z1mr223838wee.49.1257283150409; Tue, 03 Nov 2009 13:19:10 -0800 (PST) In-Reply-To: <4AF08CE2.1010906@inconcertcc.com> References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> <4AF08CE2.1010906@inconcertcc.com> Date: Tue, 3 Nov 2009 13:19:10 -0800 Message-ID: <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: Sam Roberts To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA3LJn8s013393 2009/11/3 Ignacio Burgueño : > Joseph Stewart wrote: >> Maybe I don't understand the underlying problem the acceptfd patch >> addresses, but if it's simply a matter of getting the file descriptor >> from a luasocket object, then you can use the :getfd() function. >> > > Quoting from: > http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible > > "It adds a new method “acceptfd” which works just like “accept” but instead > of returning a socket object it returns the underlying “file descriptor” (a > number). A new optional parameter to “socket.tcp()” allows to create a > socket object from a file descriptor." > > So you could accept connections in a given Lua state and process it in a > different one. Be it by means of using Lanes, LuaProc, or whatever suits > you. The above doesn't answer the OP's question of how fd = ssock:acceptfd() is different from fd = ssock:accept():getfd() It might be that the problem is that the accepted userdata will close the underlying fd in it's __gc(). If true, acceptfd() might be better replaced with a method of relinquishing ownership. I totally support the idea of being able to work with fds in the luasocket API, particularly so tcp-like userdata can be created from fds. I would use this for serial devices, for example, which are much more like sockets than they are like files, so lua's stdio-based io library works quite poorly with them, despite being able to do io.open"/dev/ttyWhatever" Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 19:45:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3LixYA016683; Tue, 3 Nov 2009 19:44:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD99E1A669; Tue, 3 Nov 2009 19:43:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 962B418624 for ; Tue, 3 Nov 2009 19:43:31 -0200 (BRST) Received: from tux.CS.Princeton.EDU (tux.CS.Princeton.EDU [128.112.155.166]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nA3LiQVb007305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 3 Nov 2009 16:44:26 -0500 (EST) Date: Tue, 3 Nov 2009 16:44:26 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 In-Reply-To: <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> Message-ID: References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> <4AF08CE2.1010906@inconcertcc.com> <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5791 signatures=575831 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, I agree getfd and setfd are not greatly thought out features. That's why I call them hacks and that's why they are not part of the documented API. They are there just for debugging purposes and for people who want to use them at their own risk. The problem is that these functions can lead to confusion on Windows, since socket objects are not file descriptors Having them in the API would seem to indicate it is ok to obtain a file descriptor from a file handle and then insert them in a socket object. This would not work on Windows and I don't like the idea of having this on the API. Now, if what we are talking about functionality that allows you to obtain this OS-dependent socket handle/descriptor and create another LuaSocket object from it, we can discuss what is the best API for it. It is a valid scenario that I had not foreseen, and I'd be happy to add it to the library. But this is not a bug, which is what I am looking for right now. Regards, Diego From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 20:04:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3M4p2w019226; Tue, 3 Nov 2009 20:04:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8678F1A764; Tue, 3 Nov 2009 20:03:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 02A521A67F for ; Tue, 3 Nov 2009 20:03:16 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Tue, 03 Nov 2009 15:50:29 -0600 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 3 Nov 2009 17:04:06 -0500 Message-ID: <4AF0A8D5.3010406@elbitsystems-us.com> Date: Tue, 03 Nov 2009 17:04:05 -0500 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: control of lua dissectors at run time for better performance References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 03 Nov 2009 22:04:06.0266 (UTC) FILETIME=[8FB8E5A0:01CA5CD1] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Awadhesh Kumar wrote: > How can I increase the performance of wireshark? > Currently I have registered 25 udp ports to dissects the message. Is > it possible to use multi threaded dissectors based on udp port. Can > you give me link for that? I do not know of Wireshark supporting multithreaded Lua dissectors. You should check on a Wireshark forum or mailing list. > Is there a way to control whether the LUA script should be engaged or > not from the Wireshark GUI – e.g. an option to disable/enable select > LUA script at runtime without messing with the init.lua file. I do not know of such a control. First, you should try to make your code efficient. Second, you could try short-cutting your own dissectors by creating a preference: proto.prefs["my_proto.disable_dissector"] = Pref.bool("Disable Dissector", false, "Set this to true and the dissector won't run.") wsLua (Wireshark Lua) will add the preference to the Edit -> Preferences dialog. Scroll down to your protocol's name under Protocol on the left pane then click on it. You'll see the list of preferences. For booleans, it's a checkbox. The value is stored in ~/.wireshark/preferences under Linux, or the similar location in Documents and Settings\Username under Windows. You'll have to add code to your dissector to honor the preference. Google for help on that, or find a Wireshark forum. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Tue Nov 3 21:24:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA3NORXP029783; Tue, 3 Nov 2009 21:24:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F5B01A66F; Tue, 3 Nov 2009 21:23:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE3C21914C for ; Tue, 3 Nov 2009 21:22:55 -0200 (BRST) Received: by bwz27 with SMTP id 27so8221570bwz.21 for ; Tue, 03 Nov 2009 15:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=p5o4iq9KJfHrScpRUdVNqH5aQPsdMiI5m/eQqH5No1c=; b=tfgARdqHv3ON4mAiqsbaf/7TAu0FtE41JMVPWMOc76NbegIezmx3E5rr6JtU4VlbSq ajl/OE/CyBcNlkHLqWl5ESOm2QeVhbLWkH+1BVW7NG6zSs1zWp2ZZB8fzy5LfN+A1loK efIw2cxPHak8EzQSCSglwmvXX+lZ19+bHgcQg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=nnkeI0SBHIkixRB177sDSPO3DyoxYq9nPDLSFgDevmKSlQK34y8e3IxwAGtceVrE/+ nio3VsVODvGRD73EQJ2srXp2wiS/OysOSuvw4dH3D1XFRRUdAEgYP1N48jKy2egkuP2M YbkhBpdvOeNz21OCrmHf3L01wKQ+jO6QzR9Fs= MIME-Version: 1.0 Received: by 10.204.160.144 with SMTP id n16mr598911bkx.152.1257290630841; Tue, 03 Nov 2009 15:23:50 -0800 (PST) From: Matthew Wild Date: Tue, 3 Nov 2009 23:23:29 +0000 Message-ID: <4db9cacb0911031523u6093dac5nc795b66b91f1aee3@mail.gmail.com> Subject: Lua Lanes issue(s) To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I'm stuck on a little problem using Lua Lanes. It's the first time I've actually tried to use it other than just playing around, but now that I try I just can't get it to work the way I want. In this case I have a producer and consumer, I use a linda to pass data from one to the other, this works fine. However I also want to keep track of how many lines are awaiting processing by a consumer. For this I'm looking for an atomic counter which can be incremented and decremented. According to the docs, Lanes provides exactly this through its 'genatomic' API method. However the code example I link below doesn't seem to work - the processor ends up hanging on the queued_count(-1) call. I tried using locks manually but also had problems, as described in the comments. The code is at: http://matthewwild.co.uk/uploads/lanetest.lua The script needs lines for input, to run you can try: $ yes | lua ./lanetest.lua At least on my PC it hangs very shortly after starting (well, the processor does, the reader seems happy). Is Asko or anyone familiar with Lanes able to explain what's going wrong, or even better, provide me with pointers to working Lanes code? It's proving hard to come by via Google. Many thanks, Matthew From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 04:25:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA46PPb9010369; Wed, 4 Nov 2009 04:25:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2AB3C192D9; Wed, 4 Nov 2009 04:23:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s66.bay0.hotmail.com (bay0-omc1-s66.bay0.hotmail.com [65.54.246.97]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E646192C4 for ; Wed, 4 Nov 2009 04:23:46 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc1-s66.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 3 Nov 2009 22:24:44 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Wed, 4 Nov 2009 06:24:43 +0000 Message-ID: <4AF11E27.5060408@my.erau.edu> Date: Wed, 4 Nov 2009 01:24:39 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Interning strings considered harmful (somewhat) References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> <87tyxbxvfj.fsf@mid.deneb.enyo.de> In-Reply-To: <87tyxbxvfj.fsf@mid.deneb.enyo.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Nov 2009 06:24:44.0115 (UTC) FILETIME=[7FACEA30:01CA5D17] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Florian Weimer wrote: > * Roberto Ierusalimschy: >> Excluding malware, I do not think this situation happens enough to >> justify any worry. > > I know the argument: anybody who wants to take out your web server can > just flood it with 5 Gbps of traffic (or more if necessary). > I think you already have an issue if you're being flooded like that anyway. > Would an uninterned string type introduce too many additional code > paths in the VM? Why make a change to the VM? Why can't you just do it yourself? The only logical way to add an uninterned string type would be to enforce that uninterned strings and interned strings are considered two distinct types. Accordingly, uninterned strings are never equal to interned strings, even if their contents are equal. Following the above logic, we can implement uninterned strings trivially as userdata. An __eq metamethod can be provided which passes off execution to strcmp (additional work may be neccessary to handle strings with zeros). We would use this userdata only for "insecure" strings, that is, strings that the remote user can influence. If we need to test between interned strings and our userdata, the userdata could provide a method through __index that allows for comparison against a string. Don't change what isn't broken. Userdata were made for special situations and types just like this. ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 04:38:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA46cf6C012025; Wed, 4 Nov 2009 04:38:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB5B81A67E; Wed, 4 Nov 2009 04:37:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out2.iinet.net.au (outbound.icp-qv1-irony-out2.iinet.net.au [203.59.1.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C73C31A66B for ; Wed, 4 Nov 2009 04:37:08 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0AAI+w8Ep8qb74/2dsb2JhbAAI3XCEPQSBZXQ X-IronPort-AV: E=Sophos;i="4.44,678,1249228800"; d="scan'208";a="577083519" Received: from unknown (HELO [10.1.1.2]) ([124.169.190.248]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 04 Nov 2009 14:38:01 +0800 Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Jacques Chester In-Reply-To: <20091103105717.GA15089@mike.de> Date: Wed, 4 Nov 2009 14:38:01 +0800 Content-Transfer-Encoding: 7bit Message-Id: <052D63AE-B1CB-4199-B903-AD700B24D166@chester.id.au> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> <20091103105717.GA15089@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 03/11/2009, at 6:57 PM, Mike Pall wrote: > The big-O notation assumes constant overhead per access or per > instruction. But that's far from the truth with a modern CPU. An > O(n) linear search can outperform an O(log n) tree search for a > much larger 'n' than you might imagine. Try it! I assume that this scenario depends on n fitting into an L1/L2 data cache? Now that you put it this way I can see how a tree search would be slow -- constantly sending the CPU galloping off into main memory for the next element. There's a book in there somewhere. "Data Structures and Algorithms for Modern Architectures". Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 05:50:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA47nv8X017555; Wed, 4 Nov 2009 05:49:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15A5C1A6B3; Wed, 4 Nov 2009 05:48:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01252321B3 for ; Wed, 4 Nov 2009 05:48:28 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N5acO-0000Hn-AO for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 08:49:24 +0100 Received: from p5b2c2031.dip.t-dialin.net ([91.44.32.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 08:49:24 +0100 Received: from dak by p5b2c2031.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 08:49:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Date: Wed, 04 Nov 2009 08:48:59 +0100 Organization: Organization?!? Lines: 25 Message-ID: <87pr7ypw5w.fsf@lola.goethe.zz> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> <20091103105717.GA15089@mike.de> <052D63AE-B1CB-4199-B903-AD700B24D166@chester.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2031.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:Jn44CJybxmLtDT3Gse6mqm3o4GU= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jacques Chester writes: > On 03/11/2009, at 6:57 PM, Mike Pall wrote: >> The big-O notation assumes constant overhead per access or per >> instruction. But that's far from the truth with a modern CPU. An >> O(n) linear search can outperform an O(log n) tree search for a >> much larger 'n' than you might imagine. Try it! > > I assume that this scenario depends on n fitting into > an L1/L2 data cache? Now that you put it this way I can > see how a tree search would be slow -- constantly sending > the CPU galloping off into main memory for the next > element. > > There's a book in there somewhere. "Data Structures > and Algorithms for Modern Architectures". Knuth's "The Art of Computer Programming" contains numerous algorithms for working with sequential-access-optimized memory (aka tape drives). Modern memory prefetching is getting there again. Not much new under the sun. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 06:00:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA480cpH018485; Wed, 4 Nov 2009 06:00:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1320F18742; Wed, 4 Nov 2009 05:59:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 865E318710 for ; Wed, 4 Nov 2009 05:59:14 -0200 (BRST) Received: by iwn5 with SMTP id 5so4821597iwn.11 for ; Wed, 04 Nov 2009 00:00:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.122.139 with SMTP id l11mr3164256ibr.53.1257321610510; Wed, 04 Nov 2009 00:00:10 -0800 (PST) In-Reply-To: <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> Date: Wed, 4 Nov 2009 03:00:10 -0500 X-Google-Sender-Auth: c9aa255fdd589702 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 6:39 PM, Mark Hamburg wrote: > To what extent did you change the instruction set v to what extent did you > change the encoding of the instruction set? (I'm thinking about whether a > bytecode translator is even reasonable to consider.) Here's a test of running Lua 5.1 bytecodes on LuaJIT2 via LuLu [1] $ time ../LuaJIT-2.0.0-beta1/src/luajit.exe lulu.lua luac.out 24 ~ 1.3 s $ time ../lua-5.1.4/src/lua lulu.lua luac.out 24 ~ 6.6 s $ time ../lua-5.1.4/src/lua luac.out 24 ~ 0.1 s To run this in LuaJIT2, do a "luac test/fib.lua" and make the following edit to lulu.lua: - local chunk = string.dump(loadfile(arg[1])) + local chunk = io.open(arg[1], 'rb'):read'*a' --string.dump(loadfile(arg[1])) (BTW, for whatever reason, a compiled life.lua runs under lulu under Lua 5.1 but not under LuaJIT2.) [1] http://lulu.luaforge.net/ From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 06:07:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA487Ffc019153; Wed, 4 Nov 2009 06:07:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D85D187A3; Wed, 4 Nov 2009 06:05:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C773018744 for ; Wed, 4 Nov 2009 06:05:51 -0200 (BRST) Received: by bwz27 with SMTP id 27so8531163bwz.21 for ; Wed, 04 Nov 2009 00:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=9xK+R3l8AJrvZVuHbYm3g9icrZYwF7z+l2sifUoIGDI=; b=xlewcE8qWWTvTuWysKXR7dfkMVCnBSMR4YcboMhQ1ZnMyf9kPPEKZJpn63tNsiqfey XvE/GsA0MQTk4Bga1+pts3ZLeEErJi0WfwOv9w4vGJm/ybKEfhlIpij3rVV6tX+BK5BQ G1wewChIFyXNVq85PHAuj9zri9zBVUypT5vmE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=ljxeyC1XUmlEQihg7vRt+Ic1y3+ef51ijrFMo0xD85V0cjwb+vl6rxeICgd6mvLQGc 3T7+IA8YFLMwyk23fNcVmmigGQY/umOsvxAXuB6iAT8UG5jFKNTIfosC31ukkp/JtrZ9 tsCtT/sKTDZMYW6kgWZNp2mtvz8Hac1MdOBqw= Received: by 10.204.154.69 with SMTP id n5mr1115990bkw.43.1257322008066; Wed, 04 Nov 2009 00:06:48 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 16sm252975fxm.0.2009.11.04.00.06.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Nov 2009 00:06:47 -0800 (PST) Date: Wed, 4 Nov 2009 11:06:38 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <651376189.20091104110638@gmail.com> To: Jacques Chester Subject: Re[2]: [ANN] LuaJIT-2.0.0-beta1 In-Reply-To: <052D63AE-B1CB-4199-B903-AD700B24D166@chester.id.au> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> <20091103105717.GA15089@mike.de> <052D63AE-B1CB-4199-B903-AD700B24D166@chester.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Jacques, Wednesday, November 4, 2009, 9:38:01 AM, you wrote: >> The big-O notation assumes constant overhead per access or per >> instruction. But that's far from the truth with a modern CPU. An >> O(n) linear search can outperform an O(log n) tree search for a >> much larger 'n' than you might imagine. Try it! > I assume that this scenario depends on n fitting into > an L1/L2 data cache? no. linear memory read is much faster because 1) it's predictable, so cpu can prefetch data, 2) usually one cache line (64 bytes, typical) contains several data items -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 08:34:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4AYmJ1002442; Wed, 4 Nov 2009 08:34:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2469C1A671; Wed, 4 Nov 2009 08:33:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F89318A25 for ; Wed, 4 Nov 2009 08:33:16 -0200 (BRST) Received: by ewy26 with SMTP id 26so7085404ewy.5 for ; Wed, 04 Nov 2009 02:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=4JvvCcacfmp+qdVfjspXHfC4FHlZeNZ3hOvUCiF+imE=; b=HV/MGI8bfi3Nt5RPlpMVc69DcF2tkZX/tKFA4dZLVMGsyvl+4MexutbXoxJuNyYFjw zkrmxfJqB07MRNMdi/4iQlayHbMRvPKatOWgazBOcvi58CEgRnNQTY7O3xtSMC8NXHW0 yaGcI+1MwGRpvxtSoGd8TAfafqhgEx0mFbK2k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=yHm2MXjNY1PJBMY/rYaKtPGkzmxWJvufVpNPCIUF3BvPk/7p/yBqVH0vY9M8YFFHjg EEyA3sCTFJkm369LQhwZNFKmt1ND0j0EN4Hwu8w9F9YQ5jSvmB/10QgpvTedMOWJu84Z t9XD0b9h/Cn+kbcMIQp5U0CFnmCVrymlE7Vog= MIME-Version: 1.0 Received: by 10.216.86.132 with SMTP id w4mr467808wee.87.1257330854117; Wed, 04 Nov 2009 02:34:14 -0800 (PST) In-Reply-To: References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> <4AF08CE2.1010906@inconcertcc.com> <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> From: Jerome Vuarand Date: Wed, 4 Nov 2009 11:33:54 +0100 Message-ID: <89d273ba0911040233t5bed8271v63f21a1e97ab4d66@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/3 Diego Nehab : > I agree getfd and setfd are not greatly thought out > features. That's why I call them hacks and that's why they > are not part of the documented API. They are there just for > debugging purposes and for people who want to use them at > their own risk. > > The problem is that these functions can lead to confusion on > Windows, since socket objects are not file descriptors > Having them in the API would seem to indicate it is ok to > obtain a file descriptor from a file handle and then insert > them in a socket object. This would not work on Windows and > I don't like the idea of having this on the API. > > Now, if what we are talking about functionality that allows > you to obtain this OS-dependent socket handle/descriptor and > create another LuaSocket object from it, we can discuss what > is the best API for it. It is a valid scenario that I had > not foreseen, and I'd be happy to add it to the library. I couldn't agree more. Leaking low level concepts in a high level API is likely to make it non-portable. Lua userdata bing opaque to Lua scripts is what makes it easy to nicely integrate any low level mechanism or paradigm into Lua, even though it makes their serialization impossible (but not all objects hidden behind a userdata are naturally serializable anyway). From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 08:55:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4At0wJ005284; Wed, 4 Nov 2009 08:55:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12BDD1A6A1; Wed, 4 Nov 2009 08:53:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fettunta.fettunta.org (fettunta.fettunta.org [67.207.129.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C57501A67A for ; Wed, 4 Nov 2009 08:53:36 -0200 (BRST) Received: from localhost.localdomain (unknown [10.17.0.6]) by fettunta.fettunta.org (Postfix) with ESMTPS id F28AA1813E for ; Wed, 4 Nov 2009 10:54:32 +0000 (UTC) Received: from tassi by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1N5dVW-0002nh-7H for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 11:54:30 +0100 Date: Wed, 4 Nov 2009 11:54:30 +0100 From: Enrico Tassi To: lua@bazar2.conectiva.com.br Subject: Re: Lua Lanes issue(s) Message-ID: <20091104105430.GA10695@birba> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <4db9cacb0911031523u6093dac5nc795b66b91f1aee3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4db9cacb0911031523u6093dac5nc795b66b91f1aee3@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 03, 2009 at 11:23:29PM +0000, Matthew Wild wrote: > Hi all, > > I'm stuck on a little problem using Lua Lanes. It's the first time > I've actually tried to use it other than just playing around, but now Will next prosody release require lanes? In that case I'll package it for Debian, but I want to be sure :-) Cheers -- Enrico Tassi From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 09:51:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4BpBPL015105; Wed, 4 Nov 2009 09:51:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85F511897E; Wed, 4 Nov 2009 09:49:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC4621891C for ; Wed, 4 Nov 2009 09:49:38 -0200 (BRST) Received: by bwz27 with SMTP id 27so8755452bwz.21 for ; Wed, 04 Nov 2009 03:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=z2Ea1AMENtWP2oB3RI/95TlldhyJJ7HlwkCloLtZ7Vw=; b=CIxYe5rGsapSst68r2u28VPvwE50LxOMUY8PVuahTegt8LYWQLKvicC5Ar/RhzXYcX 9OLBSdOsxb8Cc2zu/OXckhDMyMHIOwkbCfe+6D71e2YcpCc4c59f5GtVho0EdoU9Jage 5FwaABathSBxzcSeHL0orJYeYSAb1UbtdbuQI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=JjaviGkjpQ6/+NrPJa3EL502bEONgOz4H82juYj2iuQ3/r3tYNRR2AoT/gZi0i+cQf DuXvFxtBPOIKl2kW6FI8HiLjMATTp/BTfFryOQA/OZOZdEZYwEvBH/SseNXOWO1961it QfmW2V/KDJMnTLGcuo+1jyy97j/l54qS144GM= MIME-Version: 1.0 Received: by 10.204.49.79 with SMTP id u15mr1326838bkf.117.1257335435155; Wed, 04 Nov 2009 03:50:35 -0800 (PST) In-Reply-To: <20091104105430.GA10695@birba> References: <4db9cacb0911031523u6093dac5nc795b66b91f1aee3@mail.gmail.com> <20091104105430.GA10695@birba> From: Matthew Wild Date: Wed, 4 Nov 2009 11:50:15 +0000 Message-ID: <4db9cacb0911040350r4322aa79m41974415db861ecd@mail.gmail.com> Subject: Re: Lua Lanes issue(s) To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/4 Enrico Tassi : > On Tue, Nov 03, 2009 at 11:23:29PM +0000, Matthew Wild wrote: >> Hi all, >> >> I'm stuck on a little problem using Lua Lanes. It's the first time >> I've actually tried to use it other than just playing around, but now > > Will next prosody release require lanes? In that case I'll package it > for Debian, but I want to be sure :-) > Not the next one, but quite possibly a future one if I get it working :) Also missing in Debian is a libevent binding. We're currently working on a port to luaevent from http://repo.or.cz/w/luaevent.git - but it's not 100% certain we'll be sticking with it yet. I'll keep you posted. Matthew From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 10:08:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4C8gLv019066; Wed, 4 Nov 2009 10:08:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D90501A6B5; Wed, 4 Nov 2009 10:07:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D71251A692 for ; Wed, 4 Nov 2009 10:07:08 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5eei-0002gY-00; Wed, 04 Nov 2009 13:08:04 +0100 Date: Wed, 4 Nov 2009 13:07:45 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091104120745.GA16104@mike.de> References: <200911021308217969275@gmail.com> <20091102230556.GA13730@mike.de> <20ACD6D9-E43F-4DBE-84FC-63ED3D092A91@grubmah.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline David Manura wrote: > On Mon, Nov 2, 2009 at 6:39 PM, Mark Hamburg wrote: > > To what extent did you change the instruction set v to what extent did you > > change the encoding of the instruction set? (I'm thinking about whether a > > bytecode translator is even reasonable to consider.) > > Here's a test of running Lua 5.1 bytecodes on LuaJIT2 via LuLu [1] Well, but that's a different issue. Bytecode->bytecode translation ought to be a lot more efficient (if it worked) than running a nested interpreter. > (BTW, for whatever reason, a compiled life.lua runs under lulu under > Lua 5.1 but not under LuaJIT2.) Ok, four hours later and it has revealed three wildly different bugs. This is really a goldmine of a test case, due to the unique style this is written in. Thanks for digging it out! Interim patches are attached. Now it works with life.lua. Here's the runtime in seconds (lower is better): native via LuLu LJ2 1.1 7.9 LJ2 interp 1.4 28.9 Lua 5.1 2.2 114.5 Ok, so LJ2 doesn't like life.lua that much due to the NYI string concatenations (60% interpreted, 35% GC, 5% compiled). That's why the native speedup of 2x is kind of disappointing. But more interesting is that LJ2 runs LuLu 14.5x faster and spends almost 80% of the time in compiled code. That's despite that it fails to compile quite a bit of it due to various NYI issues. Generating good code for the main loop of an interpreter is known to be one of the worst cases for a compiler. In this case the inner loop has 38 comparisons in a row. The trace compiler turns this into an interesting maze of traces (*), probably resembling a decision tree -- nice. :-) This would work even better if the comparisons were sorted by frequency (letting the compiler do that is tricky). (*) If anyone has some time left, here's an interesting project: Write a compiler plugin that gathers the traces (start with a copy of lib/v.lua) and convert the link info to graphviz input. This should generate some pretty wallpapers (or a nice term paper). --Mike --FL5UXtIhxfXey3p5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="various_lulu.diff" --- a/src/lj_opt_loop.c +++ b/src/lj_opt_loop.c @@ -286,7 +286,7 @@ static void loop_unroll(jit_State *J) if (!irt_sametype(t, irr->t)) { if (irt_isnum(t) && irt_isinteger(irr->t)) /* Fix int->num case. */ subst[ins] = tref_ref(emitir(IRTN(IR_TONUM), ref, 0)); - else + else if (!(irt_isinteger(t) && irt_isinteger(irr->t))) lj_trace_err(J, LJ_TRERR_TYPEINS); } } --- a/src/lj_opt_mem.c +++ b/src/lj_opt_mem.c @@ -519,8 +519,8 @@ int lj_opt_fwd_wasnonnil(jit_State *J, IROpT loadop, IRRef xref) } else if (irt_isnil(store->t)) { /* Must check any nil store. */ IRRef skref = IR(store->op1)->op2; IRRef xkref = IR(xref)->op2; - /* Same key type MAY alias. */ - if (irt_sametype(IR(skref)->t, IR(xkref)->t)) { + /* Same key type MAY alias. Need ALOAD check due to multiple int types. */ + if (loadop == IR_ALOAD || irt_sametype(IR(skref)->t, IR(xkref)->t)) { if (skref == xkref || !irref_isk(skref) || !irref_isk(xkref)) return 0; /* A nil store with same const key or var key MAY alias. */ /* Different const keys CANNOT alias. */ --- a/src/lj_record.c +++ b/src/lj_record.c @@ -168,8 +168,8 @@ static int rec_objcmp(jit_State *J, TRef a, TRef b, cTValue *av, cTValue *bv) { int diff = !lj_obj_equal(av, bv); if (!tref_isk2(a, b)) { /* Shortcut, also handles primitives. */ - IRType ta = tref_type(a); - IRType tb = tref_type(b); + IRType ta = tref_isinteger(a) ? IRT_INT : tref_type(a); + IRType tb = tref_isinteger(b) ? IRT_INT : tref_type(b); if (ta != tb) { /* Widen mixed number/int comparisons to number/number comparison. */ if (ta == IRT_INT && tb == IRT_NUM) { @@ -447,7 +447,7 @@ static int rec_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm) mix.tab = lj_ir_ktab(J, mt); goto nocheck; } - ix->mt = mix.tab; + ix->mt = mt ? mix.tab : TREF_NIL; emitir(IRTG(mt ? IR_NE : IR_EQ, IRT_TAB), mix.tab, lj_ir_knull(J, IRT_TAB)); nocheck: if (mt) { @@ -1670,8 +1670,8 @@ void lj_record_ins(jit_State *J) case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: /* Emit nothing for two numeric or string consts. */ if (!(tref_isk2(ra,rc) && tref_isnumber_str(ra) && tref_isnumber_str(rc))) { - IRType ta = tref_type(ra); - IRType tc = tref_type(rc); + IRType ta = tref_isinteger(ra) ? IRT_INT : tref_type(ra); + IRType tc = tref_isinteger(rc) ? IRT_INT : tref_type(rc); int irop; if (ta != tc) { /* Widen mixed number/int comparisons to number/number comparison. */ --- a/src/lj_tab.c +++ b/src/lj_tab.c @@ -191,8 +191,8 @@ GCtab *lj_tab_dup(lua_State *L, const GCtab *kt) Node *kn = &knode[i]; Node *n = &node[i]; Node *next = nextnode(kn); - copyTV(L, &n->val, &kn->val); - copyTV(L, &n->key, &kn->key); + /* Don't use copyTV here, since it asserts on a copy of a DEADKEY. */ + n->val = kn->val; n->key = kn->key; setmref(n->next, next == NULL? next : (Node *)((char *)next + d)); } } --FL5UXtIhxfXey3p5-- From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 10:15:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4CFU2W020733; Wed, 4 Nov 2009 10:15:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E74FD1A6B8; Wed, 4 Nov 2009 10:14:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAC531A692 for ; Wed, 4 Nov 2009 10:13:54 -0200 (BRST) MailScanner-NULL-Check: 1257941702.82528@xPqm69xjb8qzOwRn6izENg Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA4CF1t8011361 for ; Wed, 4 Nov 2009 10:15:02 -0200 Message-ID: <4AF1701E.8010901@inconcertcc.com> Date: Wed, 04 Nov 2009 10:14:22 -0200 From: =?UTF-8?B?SWduYWNpbyBCdXJndWXDsW8=?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> <4AF08CE2.1010906@inconcertcc.com> <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> <89d273ba0911040233t5bed8271v63f21a1e97ab4d66@mail.gmail.com> In-Reply-To: <89d273ba0911040233t5bed8271v63f21a1e97ab4d66@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jerome Vuarand wrote: > 2009/11/3 Diego Nehab : >> I agree getfd and setfd are not greatly thought out >> features. That's why I call them hacks and that's why they >> are not part of the documented API. They are there just for >> debugging purposes and for people who want to use them at >> their own risk. >> >> The problem is that these functions can lead to confusion on >> Windows, since socket objects are not file descriptors >> Having them in the API would seem to indicate it is ok to >> obtain a file descriptor from a file handle and then insert >> them in a socket object. This would not work on Windows and >> I don't like the idea of having this on the API. >> >> Now, if what we are talking about functionality that allows >> you to obtain this OS-dependent socket handle/descriptor and >> create another LuaSocket object from it, we can discuss what >> is the best API for it. It is a valid scenario that I had >> not foreseen, and I'd be happy to add it to the library. > > I couldn't agree more. Leaking low level concepts in a high level API > is likely to make it non-portable. Lua userdata bing opaque to Lua > scripts is what makes it easy to nicely integrate any low level > mechanism or paradigm into Lua, even though it makes their > serialization impossible (but not all objects hidden behind a userdata > are naturally serializable anyway). > Agreed, but maybe there's a way that we can combine Sam Roberts' suggestion, to have a socket relinquish its ownership and gaining access to an opaque identifier that is easily serializable (i.e. a number). Note that I'm not mentioning file descriptors. That identifier could be the fd but one must not rely on that. Only that I could get that identifier, send it to another lua_State and reconstruct a socket object from it and resume processing there. Maybe something like local raw = my_socket:detach() ==> send raw to another VM and there local new_socket = socket.tcp(raw) new_socket:read -- etc etc Anyway, this, if it gets considered, will become part of LuaSocket 3 :) Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 10:16:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4CGrOJ021075; Wed, 4 Nov 2009 10:16:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 720C31A6BF; Wed, 4 Nov 2009 10:15:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 943B81A692 for ; Wed, 4 Nov 2009 10:15:21 -0200 (BRST) Received: by bwz27 with SMTP id 27so8783070bwz.21 for ; Wed, 04 Nov 2009 04:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=zRgW9Mp6pJFIj8tY17xcN+QN6YX9Rqg3hGa6s4BY28Y=; b=G0USqFHc2kqJCvsD7siLKxRgvUWT9km4L7FWvl1Sa5i0yJ32iARVSRtnXCeywmQySR A/jf96h6ftgSFTQhG6/J9kIgt+9LL0lihJAgq6q3KRIqLiEpPxuERsaiSp4pOOI8pxgJ u8BJ5BJBihbL9Yu0yL4+sseG80TLj3FfMXODo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rLnIuk4Qiyb/1f5L7qEFcb72ly+NLKsa/LGavV9D8LWw1iOnxYXxtjEusYdaJPtKtZ PQaoJr9xFkTureyPJxQQYYOsjrlikUl0dgcWxLpsUNybWLOzB9CFD9ew7GthVxAt5i5r p2GrgCFQjyMuCIhTFpFSfSu4F6hEFBeQNAnxo= MIME-Version: 1.0 Received: by 10.102.193.20 with SMTP id q20mr551300muf.28.1257336976192; Wed, 04 Nov 2009 04:16:16 -0800 (PST) Date: Wed, 4 Nov 2009 07:16:16 -0500 Message-ID: <2a5649da0911040416r1f516e2fyd5b2b92c26404745@mail.gmail.com> Subject: Re: Interning strings considered harmful (somewhat) From: Mike Zraly To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=001636416e65d4342004778a93cd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636416e65d4342004778a93cd Content-Type: text/plain; charset=ISO-8859-1 On Wed, Nov 4, 2009 at 1:37 AM, Florian Weimer wrote: > Doug Baskins (the Judy array inventor) suggests to use a relatively > weak hash to split strings into buckets and then store the strings in > each bucket in a trie, using Judy arrays. I don't know if Judy arrays > actually pay off their complexity (the hashing destroys locality, so > it's hard to imagine how the'd be a win). > I think judy arrays are intended to be fairly cache-friendly, though they assume a particular cache line size (64 bits?). It might also be interesting to look into the HAT trie and other cache-friendly data structures. A number of interesting papers on HAT tries can be found at their author's homepage, http://www.naskitis.com/. Not sure how well HAT tries handle small sets of strings, but the burst tries they are based on supposedly do quite well -- see http://crpit.com/confpapers/CRPITV4Heinz.pdf. --001636416e65d4342004778a93cd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Nov 4, 2009 at 1:37 AM, Florian Weimer &= lt;fw@deneb.enyo.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 2= 04, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Doug Baskins (the Judy array inventor) suggests to use a relatively
weak hash to split strings into buckets and then store the strings in
each bucket in a trie, using Judy arrays. =A0I don't know if Judy array= s
actually pay off their complexity (the hashing destroys locality, so
it's hard to imagine how the'd be a win).

= I think judy arrays are intended to be fairly cache-friendly, though they a= ssume a particular cache line size (64 bits?).

It might also be inte= resting to look into the HAT trie and other cache-friendly data structures.= =A0 A number of interesting papers on HAT tries can be found at their autho= r's homepage, http://www.naskitis.= com/.=A0 Not sure how well HAT tries handle small sets of strings, but = the burst tries they are based on supposedly do quite well -- see http://crpit.com/confpape= rs/CRPITV4Heinz.pdf.




=A0
--001636416e65d4342004778a93cd-- From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 10:22:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4CMOFB022400; Wed, 4 Nov 2009 10:22:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 844EF1909A; Wed, 4 Nov 2009 10:21:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4F941185C2 for ; Wed, 4 Nov 2009 10:20:58 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so846336fgb.17 for ; Wed, 04 Nov 2009 04:21:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=HhqRpedJ/ElX6W3HEqWLdMJI+zsETxPX43/VIxxTpHU=; b=STPf302th6WgtUxd0ijJuOn+F6uK6QnP/YiB2D5eMmppMAyAJJlqb2gzMcpQvWyGos mAfEhLJQBr0pQHzKEW98BpCPZUJijqEOMJtE9XeT6IlQd+f8eDc/KZ6IU7vhSvUfTlF0 /0h37IxicPo3HxPZRmzr7umzwmF6Cyy+xflm0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=m2KfZf4BRGlMbnJLJLIvc2c5kOOuyy/R+dBkGPmvHqg0AXUdbCVTOMlXJHHAvoqv7w zP/XBgziCG6wAIHhoiENU6ihRHLQYwIndr941Hxdxy0EnhfYMv54aIn3AaZJoX/DtGOX oMnJc+DfNww/b8/V7EWy9i0X9fMsY6PyZV1BA= MIME-Version: 1.0 Received: by 10.239.237.193 with SMTP id k1mr144530hbp.173.1257337314818; Wed, 04 Nov 2009 04:21:54 -0800 (PST) In-Reply-To: <4AF1701E.8010901@inconcertcc.com> References: <4AF0699E.1020802@inconcertcc.com> <2781f020911031148m2e5d7d2dm8c2f6556df6c47c@mail.gmail.com> <4AF08CE2.1010906@inconcertcc.com> <17eac67c0911031319x64c4745cuec6c21aac55423b5@mail.gmail.com> <89d273ba0911040233t5bed8271v63f21a1e97ab4d66@mail.gmail.com> <4AF1701E.8010901@inconcertcc.com> Date: Wed, 4 Nov 2009 14:21:54 +0200 Message-ID: <560972290911040421k2c0a2563y738c744ed92e7790@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA4CMOFB022400 2009/11/4 Ignacio Burgueño : > to have a socket relinquish its ownership and gaining access to an opaque > identifier that is easily serializable (i.e. a number). Note that I'm not > mentioning file descriptors. That identifier could be the fd but one must > not rely on that. A most sensible suggestion. There is always some raw underlying OS handle involved, but for Windows it isn't a fd, and should not be treated as such. So portability _and_ flexibility! From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 11:25:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4DPVb7007187; Wed, 4 Nov 2009 11:25:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54147192D9; Wed, 4 Nov 2009 11:23:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from centaury.net-core.org (centaury.net-core.org [91.121.98.194]) by bazar2.conectiva.com.br (Postfix) with SMTP id C751C191AE for ; Wed, 4 Nov 2009 11:23:46 -0200 (BRST) X-Tethys-FixMail: date_replace,tethys-smtp-envelope X-Tethys-SMTP-Envelope: From: nicolas@net-core.org To: lua@bazar2.conectiva.com.br Date: 04 Nov 2009 12:25:03 +0100 Received: from nx10.prv by centaury.net-core.org (Tethys SMTP) ; 04 Nov 2009 12:25:03 +0100 X-Tethys-Original-Date: Wed, 4 Nov 2009 12:25:03 +0100 From: Nicolas To: Lua list Subject: WSAPI & FCGI woes Message-ID: <20091104122503.74447d04@nx10.prv> Organization: NetCore X-Mailer: Claws Mail 3.7.0 (GTK+ 2.12.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA4DPVb7007187 Hi, First I have found what looks like a bug to me, which surprises me a lot: There was an error in the specified application. The full error message follows: /usr/local/share/lua/5.1//wsapi/common.lua:393: bad argument #1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' /usr/local/share/lua/5.1//wsapi/common.lua:393: in function 'collect_states' /usr/local/share/lua/5.1//wsapi/common.lua:442: in function (tail call): ? [C]: in function 'xpcall' /usr/local/share/lua/5.1//wsapi/common.lua:195: in function 'run_app' /usr/local/share/lua/5.1//wsapi/common.lua:219: in function 'run' /usr/local/share/lua/5.1//wsapi/fastcgi.lua:38: in function 'run' /var/www/test.netpim.info/cgi/netpim.fcgi:24: in main chunk [C]: ? I have installed WSAPI with fastcgi and apache's mod_fcgi. The way it works is that I run a first request, it works well and all. Then I wait a while (longer than the period defined in wsapi.fcgi runner script) and I get this error. I have tracked it in wsapi.common and it looks to me that app_states[app].states is never initialized to be a table. The init code seems to be at line 370 in the metamethod __index. But the code is: setmetatable(app_states, { __index = function (tab, app) tab[app] = {} return tab[app] end }) Shouldn't it be more like: setmetatable(app_states, { __index = function (tab, app) tab[app] = { states={} } return tab[app] end }) I have fixed it this way in my version and it seems to work all fine. Secondly I am having an other problem, in my setup with apache and fcgi let's say I make an app for the url /lua/foo.ws It works fine and my app is called. Now if I try to access it as /lua/foo.ws/whatever, if I am reading things right it should still work (otherwise Orbit dispatchers becomes quite useless no ?) But it does not, I get an error that wsapi does not find the app to launch. /usr/local/share/lua/5.1//wsapi/common.lua:315: could not find a filename to load, check your configuration or URL stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1//wsapi/common.lua:315: in function 'adjust_non_wrapped' /usr/local/share/lua/5.1//wsapi/common.lua:324: in function 'normalize_paths' /usr/local/share/lua/5.1//wsapi/common.lua:340: in function 'find_module' /usr/local/share/lua/5.1//wsapi/common.lua:406: in function (tail call): ? (tail call): ? [C]: in function 'xpcall' /usr/local/share/lua/5.1//wsapi/common.lua:195: in function 'run_app' /usr/local/share/lua/5.1//wsapi/common.lua:219: in function 'run' /usr/local/share/lua/5.1//wsapi/fastcgi.lua:38: in function 'run' /var/www/test.netpim.info/cgi/netpim.fcgi:24: in main chunk [C]: ? The problem is that in normalize_paths() in wsapi.common there are three lines: if not filename or filename == "" then filename = wsapi_env.PATH_TRANSLATED if filename == "" then filename = wsapi_env.SCRIPT_FILENAME end "filename" parameter comes from the wsapi.fcgi launcher which sets it as "" thus the code enters the if and replaced filename with PATH_TRANSLATED which does not contain the app name. In my example (/lua/foo.ws/whatever) I have: PATH_TRANSLATED=/var/www/test.netpim.info/htdocs/whatever SCRIPT_FILENAME=/var/www/test.netpim.info/htdocs/lua/foo.ws I resolved my problem by forcing "filename = wsapi_env.SCRIPT_FILENAME" but it looks like a bad fix to me. Any ideas ? Thanks From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 11:26:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4DQAuh007437; Wed, 4 Nov 2009 11:26:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 97758192E3; Wed, 4 Nov 2009 11:23:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from centaury.net-core.org (centaury.net-core.org [91.121.98.194]) by bazar2.conectiva.com.br (Postfix) with SMTP id CC33D191B7 for ; Wed, 4 Nov 2009 11:23:46 -0200 (BRST) X-Spam-Flag: YES X-Spam-Status: Yes, score=6.5 required=5.0 tests=AWL,BAYES_00,NO_RELAYS X-Tethys-FixMail: date_replace,tethys-smtp-envelope X-Tethys-SMTP-Envelope: From: nicolas@net-core.org To: lua@bazar2.conectiva.com.br Date: 04 Nov 2009 10:00:08 +0100 Received: from nx10.prv by centaury.net-core.org (Tethys SMTP) ; 04 Nov 2009 10:00:08 +0100 X-Tethys-Original-Date: Wed, 4 Nov 2009 10:00:07 +0100 From: Nicolas To: lua@bazar2.conectiva.com.br Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Message-ID: <20091104100007.1f95851f@nx10.prv> In-Reply-To: References: Organization: ToME Corp X-Mailer: Claws Mail 3.7.0 (GTK+ 2.12.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > So you could accept connections in a given Lua state and process it in a > > different one. Be it by means of using Lanes, LuaProc, or whatever suits > > you. > > The above doesn't answer the OP's question of how > > fd = ssock:acceptfd() > > is different from > > fd = ssock:accept():getfd() > > It might be that the problem is that the accepted userdata will close > the underlying fd in it's __gc(). > > If true, acceptfd() might be better replaced with a method of > relinquishing ownership. There is currently no way that I know of to make luasocket work corrently for this behavior. getfd and setfd are not good enough for that (as Diego says they were made for debugging mainly). When you do ssock:accept():getfd() you risk getting the fd closed by the GC as you said, but that is not all. Then you must use that fd somehow, so you try to do: s = socket.tcp() s:setfd(fd) data = s:recieve() But then receive complains that s is of type tcp{master} instead of tcp{client}. Also, socket.tcp() does actually create a fd when called, not when :connect() or :bind() are called. This means when you do s = socket.tcp() s:setfd(fd) You actually get a "loose" fd, which is terrible if your application must handled hundreds or thousands of connections per minutes, you run VERY quickly into the OS fd limit. So you could use a small C lib to implement the OS close(fd) call then do socket.tcp(), getfd() on it to close it, then setfd(fd). This is not exactly intuitive. And anyway since socket.tcp() makes the object a tcp{master} it does not work anyway. To get it to work the only way is to do a "fake" connect() call to a port you know will not respond to change the class to tcp{client}. Like in this example: s = socket.tcp() s:connect("127.0.0.1", 12312) myclose(s:getfd()) s:setfd(fd) data = s:recieve() This is extremely clunky and requires a C module that implements the OS close() call otherwise you get lost fds. I believe making threaded socket servers is a quite basic and common problem and thus this "solution" is not workable with it. Lanes is a really nice threading module, I like it a lot, but the inability to do network based stuff with it is annoying as hell, so as long as we do not get native threading in a single lua state we must find a workaround. > Now, if what we are talking about functionality that allows > you to obtain this OS-dependent socket handle/descriptor and > create another LuaSocket object from it, we can discuss what > is the best API for it. It is a valid scenario that I had > not foreseen, and I'd be happy to add it to the library. I do agree my patch is probably not the best or most beautiful, I did it only to resolve my problem, and it seems it is not only my problem :) But yes I do not code, nor care much I must confess, for Windows and a solution for it would be desirable too. However if windows does not use integer fds for its handles I am not sure it would work anyway. Can Lanes Lindas transfer something like that between states ? It only works for unix because fds are ints and so are transported just fine with Lindas. Maybe luasocket could keep an internal global list of all openned sockets with the fd/handle/... they refer to in the OS and then the multiple lua states could all use some luasocket API to access it via a simple number. But this would mean to make the global list threading resistant which is probably out of the scope of luasocket (and also an extremely ugly solution..) Well I guess I have written enough or too much already, good luck to those that read all of my bad english :) From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 12:00:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4E0OIj017423; Wed, 4 Nov 2009 12:00:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2C50192E6; Wed, 4 Nov 2009 11:58:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A63A3190B7 for ; Wed, 4 Nov 2009 11:58:47 -0200 (BRST) Received: by qyk4 with SMTP id 4so3369374qyk.33 for ; Wed, 04 Nov 2009 05:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=QsjD/8vUrrmkWWJSQ6Gpl6C0fnLJ53M4vcOFEPr2hg4=; b=WZUleC2G14XfJKLoEV9lVIRdujaIbeK9ZvgJ0O76QzartwjS72DknCVzvjidyNYyYu poXt39PatQuazIi6voNIkrwVunLN1wKDoU7nAKbQrRfsmG9ENXFzOxR2YlKsqPTVEbN/ YNo+3M67UmclEW1qCYqV+jmi05+qvs/7RAEYc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=jbDQc+Yp+YLsKp1J9xyjZl7nLhiEW3/+CGLkhlxIoGnLXSbKYDUpDxY3ea1LWuRewZ Ube+bDhaHYGADLT55CijlXj2kRGPcHZ38KOEHxIJCPDCRfBWJ2aAu0JYEKCh+sdg1t7T vd3aaQx8ILzfOF1tK+faLQkZ4QrKi6e4BLssw= MIME-Version: 1.0 Received: by 10.224.124.204 with SMTP id v12mr766724qar.115.1257343184227; Wed, 04 Nov 2009 05:59:44 -0800 (PST) In-Reply-To: <20091104122503.74447d04@nx10.prv> References: <20091104122503.74447d04@nx10.prv> Date: Wed, 4 Nov 2009 11:59:44 -0200 X-Google-Sender-Auth: 3d65e5916b4141e9 Message-ID: <7913df4d0911040559r4d0f0b20l4b1a808352cab125@mail.gmail.com> Subject: Re: WSAPI & FCGI woes From: Fabio Mascarenhas To: Lua list , Kepler Project mailing list Content-Type: multipart/alternative; boundary=0016360e3f82db4e3104778c052a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016360e3f82db4e3104778c052a Content-Type: text/plain; charset=UTF-8 Hi, Nicolas, I am crossposting this to the Kepler developers list, we like to keep the noise down in the regular Lua list. :-) On Wed, Nov 4, 2009 at 9:25 AM, Nicolas wrote: > Hi, > > First I have found what looks like a bug to me, which surprises > me a lot: > > There was an error in the specified application. The full error message > follows: > > /usr/local/share/lua/5.1//wsapi/common.lua:393: bad argument #1 to 'ipairs' > (table expected, got nil) > stack traceback: > The initialization is done at line 431, so it looks like you are hitting a strange corner case. Did you change anything in wsapi.fcgi? > > Secondly I am having an other problem, in my setup with apache and fcgi > let's say I make an app for the url /lua/foo.ws > It works fine and my app is called. > Now if I try to access it as /lua/foo.ws/whatever, if I am reading things > right it > should still work (otherwise Orbit dispatchers becomes quite useless no ?) > It should. > The problem is that in normalize_paths() in wsapi.common there are three > lines: > if not filename or filename == "" then > filename = wsapi_env.PATH_TRANSLATED > if filename == "" then filename = wsapi_env.SCRIPT_FILENAME end > > "filename" parameter comes from the wsapi.fcgi launcher which sets it as "" > thus the code enters the if and replaced filename with PATH_TRANSLATED > which > does not contain the app name. > In my example (/lua/foo.ws/whatever) I have: > PATH_TRANSLATED=/var/www/test.netpim.info/htdocs/whatever > SCRIPT_FILENAME=/var/www/test.netpim.info/htdocs/lua/foo.ws > > Apache shouldn't be messing with PATH_TRANSLATED in this way, these web servers and their inconsistent behavior drive me up the wall. I am going to fire up an Apache and test, but is there anything different in your Apache config? I used grab SCRIPT_FILENAME first, but an user discovered that Apache on OSX had a problem with that in some cases, so I switched. I should probably give up on autodetecting how the particular webserver works and add an option to wsapi.fcgi... > I resolved my problem by forcing "filename = wsapi_env.SCRIPT_FILENAME" but > it looks like a bad fix to me. > Any ideas ? > > Thanks > Thanks for the report, Fabio Mascarenhas --0016360e3f82db4e3104778c052a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Nicolas,

I am crossposting this to the Kepler develo= pers list, we like to keep the noise down in the regular Lua list. :-)
<= br>
On Wed, Nov 4, 2009 at 9:25 AM, Nicolas <nicolas@net-core.o= rg> wrote:
Hi,

First I have found what looks like a bug to me, which surprises
me a lot:

There was an error in the specified application. The full error message fol= lows:

/usr/local/share/lua/5.1//wsapi/common.lua:393: bad argument #1 to 'ipa= irs' (table expected, got nil)
stack traceback:
=C2=A0
The initialization is done at line 431,= so it looks like you are hitting a strange corner case. Did you change any= thing in wsapi.fcgi?



Secondly I am having an other problem, in my setup with apache and fcgi
let's say I make an app for the url /lua/foo.ws
It works fine and my app is called.
Now if I try to access it as /lua/foo.ws/whatever, if I am reading things right it
should still work (otherwise Orbit dispatchers becomes quite useless no ?)<= br>

It should.
=C2=A0
The problem is that in normalize_paths() in wsapi.common there are three li= nes:
=C2=A0 if not filename or filename =3D=3D "" then
=C2=A0 =C2=A0 =C2=A0filename =3D wsapi_env.PATH_TRANSLATED
=C2=A0 =C2=A0 =C2=A0if filename =3D=3D "" then filename =3D wsap= i_env.SCRIPT_FILENAME end

"filename" parameter comes from the wsapi.fcgi launcher which set= s it as ""
thus the code enters the if and replaced filename with PATH_TRANSLATED whic= h
does not contain the app name.
In my example (/lua/fo= o.ws/whatever) I have:
PATH_TRANSLATED=3D/var/www/test.netpim.info/htdocs/whatever
SCRIPT_FILENAME=3D/var/www/test.netpim.info/htdocs/lua/foo.ws



Apache shouldn't be messing with P= ATH_TRANSLATED in this way, these web servers and their inconsistent behavi= or drive me up the wall. I am going to fire up an Apache and test, but is t= here anything different in your Apache config? I used grab SCRIPT_FILENAME = first, but an user discovered that Apache on OSX had a problem with that in= some cases, so I switched. I should probably give up on autodetecting how = the particular webserver works and add an option to wsapi.fcgi...
=C2=A0
I resolved my problem by forcing "filename =3D wsapi_env.SCRIPT_FILENA= ME" but
it looks like a bad fix to me.
Any ideas ?

Thanks

Thanks for the report,
Fabio Ma= scarenhas

--0016360e3f82db4e3104778c052a-- From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 14:49:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4GnCZa027460; Wed, 4 Nov 2009 14:49:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E02A192B6; Wed, 4 Nov 2009 14:47:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BE9B192AA for ; Wed, 4 Nov 2009 14:47:37 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5j28-0006LU-5T for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 17:48:32 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5j27-0006ce-Fz for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 17:48:31 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Interning strings considered harmful (somewhat) References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> <87tyxbxvfj.fsf@mid.deneb.enyo.de> <4AF11E27.5060408@my.erau.edu> Date: Wed, 04 Nov 2009 17:48:31 +0100 In-Reply-To: <4AF11E27.5060408@my.erau.edu> (Matthew P. Del Buono's message of "Wed, 4 Nov 2009 01:24:39 -0500") Message-ID: <874opaw80w.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Matthew P. Del Buono: > Florian Weimer wrote: >> * Roberto Ierusalimschy: >>> Excluding malware, I do not think this situation happens enough to >>> justify any worry. >> >> I know the argument: anybody who wants to take out your web server can >> just flood it with 5 Gbps of traffic (or more if necessary). >> > > I think you already have an issue if you're being flooded like that > anyway. Well, the idea behind that argument is that those attacks are readily available, so you don't have to guard against anything. I don't really buy it. >> Would an uninterned string type introduce too many additional code >> paths in the VM? > > Why make a change to the VM? Why can't you just do it yourself? Because I'd lose interoperability. > Following the above logic, we can implement uninterned strings trivially > as userdata. An __eq metamethod can be provided which passes off > execution to strcmp (additional work may be neccessary to handle strings > with zeros). We would use this userdata only for "insecure" strings, > that is, strings that the remote user can influence. If we need to test > between interned strings and our userdata, the userdata could provide a > method through __index that allows for comparison against a string. If I want to do use some existing code, I need to convert the data to a real string, which exposes my code to interning. The VM can present the uninterned string as a regular string to C routines, for instance. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 15:05:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4H5O9A031219; Wed, 4 Nov 2009 15:05:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A835D192D9; Wed, 4 Nov 2009 15:03:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87FCF192A4 for ; Wed, 4 Nov 2009 15:03:40 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N5jHh-0005lJ-F0 for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 18:04:37 +0100 Received: from p5b2c2031.dip.t-dialin.net ([91.44.32.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 18:04:37 +0100 Received: from dak by p5b2c2031.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 18:04:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Interning strings considered harmful (somewhat) Date: Wed, 04 Nov 2009 18:04:06 +0100 Organization: Organization?!? Lines: 40 Message-ID: <87tyxanrw9.fsf@lola.goethe.zz> References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> <87tyxbxvfj.fsf@mid.deneb.enyo.de> <4AF11E27.5060408@my.erau.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c2031.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:lj//Kd/n7D8O5uhM45SJ5p64UVs= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "Matthew P. Del Buono" writes: > Florian Weimer wrote: >> * Roberto Ierusalimschy: >>> Excluding malware, I do not think this situation happens enough to >>> justify any worry. >> >> I know the argument: anybody who wants to take out your web server can >> just flood it with 5 Gbps of traffic (or more if necessary). >> > > I think you already have an issue if you're being flooded like that anyway. > >> Would an uninterned string type introduce too many additional code >> paths in the VM? > > Why make a change to the VM? Why can't you just do it yourself? The > only logical way to add an uninterned string type would be to enforce > that uninterned strings and interned strings are considered two > distinct types. Accordingly, uninterned strings are never equal to > interned strings, even if their contents are equal. > > Following the above logic, we can implement uninterned strings > trivially as userdata. An __eq metamethod can be provided which passes > off execution to strcmp (additional work may be neccessary to handle > strings with zeros). We would use this userdata only for "insecure" > strings, that is, strings that the remote user can influence. If we > need to test between interned strings and our userdata, the userdata > could provide a method through __index that allows for comparison > against a string. > > Don't change what isn't broken. Userdata were made for special > situations and types just like this. One can't use Lua's string operations (in particular pattern matching) on userdata, and there is no actual necessity to intern them for most applications (excepting indexing or fast equality tests). -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 15:35:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4HZA4m007537; Wed, 4 Nov 2009 15:35:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECF2F19383; Wed, 4 Nov 2009 15:33:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27B0B192B1 for ; Wed, 4 Nov 2009 15:33:34 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id DE4723849EB23 for ; Wed, 4 Nov 2009 23:34:29 +0600 (NOVT) Message-ID: <008e01ca5d75$0fd7d400$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com><4AF07021.8070100@funcom.com> <4AF08422.6040905@my.erau.edu> Subject: Re: Preventing Lua scripts that never return from freezing the hostapplication Date: Wed, 4 Nov 2009 23:34:25 +0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Wed, 04 Nov 2009 23:34:29 +0600 (NOVT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br In this particular case of s..s the concatination shouldn't take much more than Lim*2 time, where Lim is the limit of time a loop may take. At least if time/length dependance is linear enough. ----- Original Message ----- From: Matthew P. Del Buono To: Lua list Sent: Wednesday, November 04, 2009 1:27 AM Subject: Re: Preventing Lua scripts that never return from freezing the hostapplication Christian Tellefsen wrote: > Jim Whitehead II wrote: >> >> Keep in mind that for certain C functions (like string.find) won't >> call your debug hook in them, so a user script can still tie up the >> system in what appears to be an infinite loop, but really is just code >> that takes a long time to run (all without your hook being called). >> >> - Jim >> >> > OK, thanks, I'll keep that in mind, or maybe I'll just remove access to > that function. > That's not really a solution, to be honest. There are other functions with this problem as well. In addition, there are also things you can't remove that will result in your hook rarely being called. A few examples: string.rep("s", 2^30) -- Removable, but probably a bad idea -- Problematic if it can loop enough times: local s = "aaaaaaaaaaaaaaaa"; while true do s = s .. s; end The second is a more severe problem because it's the concatenation that will take a long time (at later iterations, e.g., around the 5th+). If your limits are set low enough, this won't be a problem because that iteration can't be reached. But if your limits aren't low enough, and those iterations are reachable, you're going to encounter a problem in that the concatenation operation can take a very long time. These are just a few examples of what came across various Lua bots that have been tested for security. Generally the premium solution has been in one of two forms: (1) Use ulimit to control CPU usage (not portable) (2) Use a second thread through a library like lualanes to monitor the progression of the execution thread, and terminate it after a known time limit. Neither of these, however, are Lua-only solutions. Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 15:55:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4HtIrB013359; Wed, 4 Nov 2009 15:55:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73C4018C83; Wed, 4 Nov 2009 15:53:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC43118C14 for ; Wed, 4 Nov 2009 15:53:52 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAA9O8UpUXebz/2dsb2JhbADefIQ9BA Received: from relay02.plus.net ([84.93.230.243]) by relay.ptn-ipout02.plus.net with ESMTP; 04 Nov 2009 17:54:48 +0000 Received: from flute.plus.com ([212.159.60.16] helo=[127.0.0.1]) by relay02.plus.net with esmtp (Exim) id 1N5k4G-0005ui-H0 for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 17:54:48 +0000 Message-ID: <4AF1BFE8.8050507@gpsl.net> Date: Wed, 04 Nov 2009 17:54:48 +0000 From: Tim Channon User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 9f99791b162e3a1b956398c3232eb2ea X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Diego Nehab wrote: > The new candidate release for LuaSocket 2.0.3 is available > for download from README in archive Unix root says "This is the LuaSocket 2.0.1." From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 16:46:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4Iki8h028977; Wed, 4 Nov 2009 16:46:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6556E1A6CF; Wed, 4 Nov 2009 16:45:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 480C1321B3 for ; Wed, 4 Nov 2009 16:45:19 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N5krp-0008HD-Af for ; Wed, 04 Nov 2009 18:46:01 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N5ks4-0005Hx-Ge for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 18:46:16 +0000 Date: Wed, 4 Nov 2009 18:46:16 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091104184616.79f5f333@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091103175619.GA1860@mike.de> References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> <1616701622.20091103204321@gmail.com> <20091103175619.GA1860@mike.de> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 3 Nov 2009 18:56:19 +0100 Mike Pall wrote: > Bulat Ziganshin wrote: > > > Selecting only up to 3*4 bytes was fast, but not good enough. See > > > > why not use those 12 bytes from the *center* of string? > > But that's why it failed on URLs. The front is 'http', the back is > 'html'. And the center is some common part of the path higher up > in the hierarchy. Now, if the URLs are the same length we get a > 100% collision probability. :-/ One approach I've used in the past is to use an (extremely) trivial PRNG to decide which byte to hash next, using the current hash value as the seed, and the length of the string as the initial seed. B. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 16:52:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4IqrSo030723; Wed, 4 Nov 2009 16:52:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 527681A6D3; Wed, 4 Nov 2009 16:51:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from centaury.net-core.org (centaury.net-core.org [91.121.98.194]) by bazar2.conectiva.com.br (Postfix) with SMTP id 258BF321B3 for ; Wed, 4 Nov 2009 16:51:24 -0200 (BRST) X-Tethys-FixMail: date_replace,tethys-smtp-envelope X-Tethys-SMTP-Envelope: From: nicolas@net-core.org To: lua@bazar2.conectiva.com.br Date: 04 Nov 2009 19:52:16 +0100 Received: from localhost by centaury.net-core.org (Tethys SMTP) ; 04 Nov 2009 19:52:16 +0100 X-Tethys-Original-Date: Wed, 4 Nov 2009 19:52:14 +0100 From: Nicolas To: lua@bazar2.conectiva.com.br Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 Message-ID: <20091104195214.0c44fc1d@net-core.org> In-Reply-To: <89d273ba0911041032y6e3a7320wc3f48dea06a74f50@mail.gmail.com> References: <20091104100007.1f95851f@nx10.prv> <89d273ba0911041032y6e3a7320wc3f48dea06a74f50@mail.gmail.com> Organization: Net-Core X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Lua function return types are not static, so socket.tcp() could return > a tcp{master} in the general case, and a tcp{client} if it is passed a > "serializable socket description". The caller knows if he's passing a > parameter or not, so checking the return type shouldn't even be > mandatory. I know that. You did not understand what I was saying. *Currently* socket.tcp() takes no argument and always returns a tcp{master}. The patch I made makes it do just what you say :) > I assume you can transport strings through Lindas. At the very least, > whatever a socket is on Windows (or any other platform) if you have it > in one thread, you can get it's address in memory, serialize the > address, send it, have the other thread deserialize the memory > address, and unreference it. IMHO this doesn't seem like a good > solution to circumvent Lanes inability to share resources between > threads. Yes indeed, or even casting the address itself into an int but that is not much better. > The nice part is that it would make the work independent of LuaLanes, > and eventually compatible with all "multiple-independent-states" Lua > threading libraries. However I don't know the LuaSocket sources, and > such an adaptation could mean any amount of work between mere > adjustments to a complete rewrite. Probably yes, much more work than I am willing to do ;) The "best" option seems the passing of the fd/handle pointer directly, clunky as it may be. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 17:25:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4JPLn3006858; Wed, 4 Nov 2009 17:25:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71F831A6D1; Wed, 4 Nov 2009 17:23:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23DA41A6A2 for ; Wed, 4 Nov 2009 17:23:36 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id EDDDEB685B for ; Wed, 4 Nov 2009 14:24:27 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 04 Nov 2009 14:24:27 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=KkCIO6UUhkq6Oii/XxCQeBD34EY=; b=D16JZ3jSwrz/2cbFsZ+PVLvgmqS8CFwdGG4TIJXKf4gpqFcYdQWYaX0hCcIVYobhWLQ7MwPNJYYK7X/mVlr7LVzmf3nYh1C+DXmWSHt8h1PL9nRKPTl34HGSM3RzwH7Qe8jDmDf9i/pCaFsvFpNgDeZ/lJtYsxprzXioWFlXohQ= X-Sasl-enc: OCG3SRX0RyOf7RYMUQ3gYVwG4FKXawBgwIKHjzMX4+9E 1257362667 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2F0994A5B82 for ; Wed, 4 Nov 2009 14:24:26 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091031225554.GA30341@mike.de> Date: Thu, 5 Nov 2009 08:23:52 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, Here's a difference, but not a bug: $ lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > print(#{1, nil, 3}) 3 $ luajit-2.0.0-beta1 LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ JIT: ON CMOV SSE2 SSE4.1 fold cse dce fwd dse narrow loop fuse > print(#{1, nil, 3}) 1 Same details as before, all patches you've posted to the list applied. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 17:37:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4JY2eq009489; Wed, 4 Nov 2009 17:34:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ECBD1A6E0; Wed, 4 Nov 2009 17:32:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 301371A6A2 for ; Wed, 4 Nov 2009 17:32:33 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5lbl-000321-92 for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 20:33:29 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5lbk-000842-No for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 20:33:28 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> <1616701622.20091103204321@gmail.com> <20091103175619.GA1860@mike.de> <20091104184616.79f5f333@trite.i.flarn.net.i.flarn.net> Date: Wed, 04 Nov 2009 20:33:28 +0100 In-Reply-To: <20091104184616.79f5f333@trite.i.flarn.net.i.flarn.net> (Rob Kendrick's message of "Wed, 4 Nov 2009 18:46:16 +0000") Message-ID: <87hbtat793.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Rob Kendrick: > One approach I've used in the past is to use an (extremely) trivial > PRNG to decide which byte to hash next, using the current hash value as > the seed, and the length of the string as the initial seed. See the other thread---it's pretty easy to force collisions with longer strings. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 17:37:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4JXxTp009475; Wed, 4 Nov 2009 17:33:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3C9C1A6CC; Wed, 4 Nov 2009 16:32:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 007B11A6A2 for ; Wed, 4 Nov 2009 16:32:01 -0200 (BRST) Received: by ewy26 with SMTP id 26so7577700ewy.5 for ; Wed, 04 Nov 2009 10:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=kbrvclTIP0mkQ2AXPSfu4GT18GMrGbCtabj0OyeRESo=; b=QTpIAv9RNSALbX5W4Qyilm0rFV06PXcI0CrkuLWNEV4MquJ7/EjjnbfsriKYKhsCcN ffGxQaSHDVxDutDG/7ylX78WkMYtChSWkMs86tzQSVbCm4b+YVkHXPKqQ6scv0p+UiTK XVFazwpkvee1mCbHt4KaX6vQ/oCj5DRpT0akQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=KPeyeq10glUL6cx0CH7uuHjkMSXHyMBpHpSsBsv72ZaNOfWOeu0Sa5giClNJDibzAy ++h/VRKsvfaQcKjKyvA4eJ/ZfmvAePe0CWdmWZethza7yhpO6QiqzljOtwKJoUp6RBX1 Hz99JpW+5l8BN96F3EhQRO43E1TkfmSdqzjNA= MIME-Version: 1.0 Received: by 10.216.89.138 with SMTP id c10mr656861wef.47.1257359577187; Wed, 04 Nov 2009 10:32:57 -0800 (PST) In-Reply-To: <20091104100007.1f95851f@nx10.prv> References: <20091104100007.1f95851f@nx10.prv> From: Jerome Vuarand Date: Wed, 4 Nov 2009 19:32:37 +0100 Message-ID: <89d273ba0911041032y6e3a7320wc3f48dea06a74f50@mail.gmail.com> Subject: Re: [ANNOUNCE]: LuaSocket 2.0.3 RC2 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Just a few comments: 2009/11/4 Nicolas : >> > So you could accept connections in a given Lua state and process it in a >> > different one. Be it by means of using Lanes, LuaProc, or whatever suits >> > you. >> >> The above doesn't answer the OP's question of how >> >> fd = ssock:acceptfd() >> >> is different from >> >> fd = ssock:accept():getfd() >> >> It might be that the problem is that the accepted userdata will close >> the underlying fd in it's __gc(). >> >> If true, acceptfd() might be better replaced with a method of >> relinquishing ownership. > > There is currently no way that I know of to make luasocket work > corrently for this behavior. > getfd and setfd are not good enough for that (as Diego says they > were made for debugging mainly). > > When you do ssock:accept():getfd() you risk getting the fd closed > by the GC as you said, but that is not all. > Then you must use that fd somehow, so you try to do: > s = socket.tcp() > s:setfd(fd) > data = s:recieve() > > But then receive complains that s is of type tcp{master} instead > of tcp{client}. Also, socket.tcp() does actually create a fd when > called, not when :connect() or :bind() are called. > This means when you do > s = socket.tcp() > s:setfd(fd) > You actually get a "loose" fd, which is terrible if your application > must handled hundreds or thousands of connections per minutes, > you run VERY quickly into the OS fd limit. > So you could use a small C lib to implement the OS close(fd) call > then do socket.tcp(), getfd() on it to close it, then setfd(fd). > This is not exactly intuitive. > > And anyway since socket.tcp() makes the object a tcp{master} it > does not work anyway. > To get it to work the only way is to do a "fake" connect() call to > a port you know will not respond to change the class to tcp{client}. > Like in this example: > s = socket.tcp() > s:connect("127.0.0.1", 12312) > myclose(s:getfd()) > s:setfd(fd) > data = s:recieve() > > This is extremely clunky and requires a C module that implements the OS > close() call otherwise you get lost fds. Lua function return types are not static, so socket.tcp() could return a tcp{master} in the general case, and a tcp{client} if it is passed a "serializable socket description". The caller knows if he's passing a parameter or not, so checking the return type shouldn't even be mandatory. > I believe making threaded socket servers is a quite basic and common > problem and thus this "solution" is not workable with it. > Lanes is a really nice threading module, I like it a lot, but the > inability to do network based stuff with it is annoying as hell, > so as long as we do not get native threading in a single lua state > we must find a workaround. > >> Now, if what we are talking about functionality that allows >> you to obtain this OS-dependent socket handle/descriptor and >> create another LuaSocket object from it, we can discuss what >> is the best API for it. It is a valid scenario that I had >> not foreseen, and I'd be happy to add it to the library. > > I do agree my patch is probably not the best or most beautiful, > I did it only to resolve my problem, and it seems it is not only > my problem :) But yes I do not code, nor care much I must confess, > for Windows and a solution for it would be desirable too. > > However if windows does not use integer fds for its handles I am not > sure it would work anyway. Can Lanes Lindas transfer something like that > between states ? It only works for unix because fds are ints and so > are transported just fine with Lindas. I assume you can transport strings through Lindas. At the very least, whatever a socket is on Windows (or any other platform) if you have it in one thread, you can get it's address in memory, serialize the address, send it, have the other thread deserialize the memory address, and unreference it. IMHO this doesn't seem like a good solution to circumvent Lanes inability to share resources between threads. > Maybe luasocket could keep an internal global list of all openned sockets > with the fd/handle/... they refer to in the OS and then the multiple lua > states could all use some luasocket API to access it via a simple number. > But this would mean to make the global list threading resistant which is > probably out of the scope of luasocket (and also an extremely ugly solution..) > > Well I guess I have written enough or too much already, good luck to > those that read all of my bad english :) The root of the problem is that a module is loaded twice in independent Lua states, but it has no knowledge of that. Ideally, passing a socket to another Lane would mean that the two instances of the module have to be aware of each other, be able to pass data structures from one to the other, even in the eventuality that one of the instances is terminated (its parent state is closed). This would make C modules writing a lot more complicated. Instead of avoiding global variables to help multiple instanciation of a module, you would have to make sure everything is global, and that userdata are merely references to globally accessible structures. The C library could provide some way to associate a serializable id to an object, pass the id to another instance (in an independent state), and get the object back (re-encapsulated in the new State). The nice part is that it would make the work independent of LuaLanes, and eventually compatible with all "multiple-independent-states" Lua threading libraries. However I don't know the LuaSocket sources, and such an adaptation could mean any amount of work between mere adjustments to a complete rewrite. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 17:47:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4JgjPg011338; Wed, 4 Nov 2009 17:42:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D2B251891C; Wed, 4 Nov 2009 17:41:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0793918899 for ; Wed, 4 Nov 2009 17:41:20 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N5lk1-00031R-BE for ; Wed, 04 Nov 2009 19:42:01 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N5lkG-0007Wl-PA for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 19:42:16 +0000 Date: Wed, 4 Nov 2009 19:42:16 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091104194216.58655c93@trite.i.flarn.net.i.flarn.net> In-Reply-To: <87hbtat793.fsf@mid.deneb.enyo.de> References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> <1616701622.20091103204321@gmail.com> <20091103175619.GA1860@mike.de> <20091104184616.79f5f333@trite.i.flarn.net.i.flarn.net> <87hbtat793.fsf@mid.deneb.enyo.de> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 04 Nov 2009 20:33:28 +0100 Florian Weimer wrote: > * Rob Kendrick: > > > One approach I've used in the past is to use an (extremely) trivial > > PRNG to decide which byte to hash next, using the current hash > > value as the seed, and the length of the string as the initial seed. > > See the other thread---it's pretty easy to force collisions with > longer strings. To force, or accidentally come by? If the former, it's pretty easy whatever hash you use, unless it's a cryptographic one, which you don't want at all in this context. B. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 17:54:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4Js9Bj013786; Wed, 4 Nov 2009 17:54:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C2941A6E1; Wed, 4 Nov 2009 17:52:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0BDC8321B3 for ; Wed, 4 Nov 2009 17:52:41 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5lvC-0003SH-QN for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 20:53:34 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5lvC-0008Dl-At for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 20:53:34 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: [ANN] LuaJIT-2.0.0-beta1 References: <20091031225554.GA30341@mike.de> <20091102132516.GA28881@mike.de> <20091103092226.GA11838@mike.de> <1616701622.20091103204321@gmail.com> <20091103175619.GA1860@mike.de> <20091104184616.79f5f333@trite.i.flarn.net.i.flarn.net> <87hbtat793.fsf@mid.deneb.enyo.de> <20091104194216.58655c93@trite.i.flarn.net.i.flarn.net> Date: Wed, 04 Nov 2009 20:53:34 +0100 In-Reply-To: <20091104194216.58655c93@trite.i.flarn.net.i.flarn.net> (Rob Kendrick's message of "Wed, 4 Nov 2009 19:42:16 +0000") Message-ID: <874opat6bl.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Rob Kendrick: > On Wed, 04 Nov 2009 20:33:28 +0100 > Florian Weimer wrote: > >> * Rob Kendrick: >> >> > One approach I've used in the past is to use an (extremely) trivial >> > PRNG to decide which byte to hash next, using the current hash >> > value as the seed, and the length of the string as the initial seed. >> >> See the other thread---it's pretty easy to force collisions with >> longer strings. > > To force, or accidentally come by? If the former, it's pretty easy > whatever hash you use, Sure? Try lookup3.c from Bob Jenkins. > unless it's a cryptographic one, which you don't want at all in this > context. You don't want a slow function. But why not something resistant to collisions? Those cryptographic hash functions try to solve a much more difficult problem: absence of collisions without any secret. For some opaque implementation, the "without any secret" part is certainly overkill. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:00:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4K0EaD014929; Wed, 4 Nov 2009 18:00:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B57541A6EC; Wed, 4 Nov 2009 17:58:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1F001A6A2 for ; Wed, 4 Nov 2009 17:58:39 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id B64C1BD276 for ; Wed, 4 Nov 2009 14:59:35 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 04 Nov 2009 14:59:35 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:content-type:content-transfer-encoding:subject:date:message-id:to:mime-version; s=smtpout; bh=QsSl4aXFNMKDD+hltNCLS/QkmGA=; b=qpKD3AzcYtwvggpSExF7G7u+bV313A2NiHxDovY2vVmWdtH7Ity1MwciJbeK0icunD9ZB5QGDPuLLJkwCx/SaO9XEnC02KNe4oYpS/rLk+Do4KiwBZ/DRJ76V3vVqMZsaiLUm8ty4EEcSgdjJhK3wvzIli0GfXGzbg7WWZY+13o= X-Sasl-enc: wg16qtY7thqaViXtckQ0IUs2KRc+jMO85AQAemnM7JIt 1257364775 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id E6E914A5C00 for ; Wed, 4 Nov 2009 14:59:34 -0500 (EST) From: Geoff Leyland Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: How do you return multiple values? Date: Thu, 5 Nov 2009 08:59:00 +1300 Message-Id: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, How do you return multiple values from a function that pcalls a function that returns an unknown number of values possibly including nil in a manner that doesn't involve undefined behaviour? function a() -- could cause an error, could return different numbers of values return 1, nil, 2 end function b() local status, r = pcall(function() return { a() } end) if not r then error("nicely handled error!") end return unpack(r) end print(a()) --> 1 nil 2 print(b()) --> 1 nil 2 But, with the new LuaJIT 2 beta: print(a()) --> 1 nil 2 print(b()) --> 1 That's not a bug, it's just different undefined behavior. Anyone know how to do this in a defined manner? (unpack(r, 1, ) would work, but I'd like to do better). Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:07:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4K7oJZ016248; Wed, 4 Nov 2009 18:07:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E4AC1A6F4; Wed, 4 Nov 2009 18:06:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A3FB1A6EE for ; Wed, 4 Nov 2009 18:06:15 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5m8L-0003rD-EM for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 21:07:09 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5m8K-0008Nj-UT for lua@bazar2.conectiva.com.br; Wed, 04 Nov 2009 21:07:08 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: How do you return multiple values? References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> Date: Wed, 04 Nov 2009 21:07:08 +0100 In-Reply-To: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> (Geoff Leyland's message of "Thu, 5 Nov 2009 08:59:00 +1300") Message-ID: <87ljimrr4j.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Geoff Leyland: > function a() > -- could cause an error, could return different numbers of values > return 1, nil, 2 > end > > function b() > local status, r = pcall(function() return { a() } end) > if not r then error("nicely handled error!") end > return unpack(r) > end I guess you should use a helper function and a tail call, like this: function a() -- could cause an error, could return different numbers of values return 1, nil, 2 end do local function b1(status, r, ...) if not r then error("nicely handled error!") end -- ??? status? return r, ... end function b() return b1(pcall(a)) end end From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:09:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4K9TCH016522; Wed, 4 Nov 2009 18:09:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EE071A6FF; Wed, 4 Nov 2009 18:08:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EA961A6F5 for ; Wed, 4 Nov 2009 18:08:03 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA4K91CU008210 for ; Wed, 4 Nov 2009 18:09:01 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id C247454C1D0; Wed, 4 Nov 2009 18:09:01 -0200 (BRST) Date: Wed, 4 Nov 2009 18:09:01 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: How do you return multiple values? Message-ID: <20091104200901.GA24409@inf.puc-rio.br> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > How do you return multiple values from a function that pcalls a function > that returns an unknown number of values possibly including nil in a > manner that doesn't involve undefined behaviour? > > [...] > > function b() > local status, r = pcall(function() return { a() } end) > if not r then error("nicely handled error!") end > return unpack(r) > end > > [...] function pack (...) return { n = select("#", ...); ... } end function b() local r = pack(pcall(function() return { a() } end)) if not r[1] then error("nicely handled error!") end return unpack(r, 2, r.n) end ? -- Roberto From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:13:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KDcKE017229; Wed, 4 Nov 2009 18:13:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F05191A709; Wed, 4 Nov 2009 18:12:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 149A7321B3 for ; Wed, 4 Nov 2009 18:12:08 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id CE280BE939 for ; Wed, 4 Nov 2009 15:13:05 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 04 Nov 2009 15:13:05 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=txBK7SqHuSe0Lmd+RUb8u+aAxs8=; b=q4Ei77dCdJCW5LUVwqVsgxxmubxHSzATFTFBB8ME5vVOH/t5aFVRPzaMdeAv7iNj5utPkur7lHZvLSPso7u2eHQW6NU59RCNN98WxndLe1yDBsQTCTAmlfl4bKE6a0eJYL3GkgR8tBtBlv70H+tAGhodTKlNa8IH8VuS5qyR82s= X-Sasl-enc: xqw02n2OEaCBxBxTwNmE1lZWoVUBic4Njqib5roF68Vj 1257365585 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 01F604A5C41 for ; Wed, 4 Nov 2009 15:13:04 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you return multiple values? From: Geoff Leyland In-Reply-To: <87ljimrr4j.fsf@mid.deneb.enyo.de> Date: Thu, 5 Nov 2009 09:12:31 +1300 Content-Transfer-Encoding: 7bit Message-Id: <5331B9AC-79A2-4B74-9980-31C976009844@fastmail.fm> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <87ljimrr4j.fsf@mid.deneb.enyo.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 5/11/2009, at 9:07 AM, Florian Weimer wrote: > * Geoff Leyland: > >> function a() >> -- could cause an error, could return different numbers of values >> return 1, nil, 2 >> end >> >> function b() >> local status, r = pcall(function() return { a() } end) >> if not r then error("nicely handled error!") end >> return unpack(r) >> end > > I guess you should use a helper function and a tail call, like this: > > function a() > -- could cause an error, could return different numbers of values > return 1, nil, 2 > end > > do > local function b1(status, r, ...) > if not r then error("nicely handled error!") end -- ??? status? > return r, ... > end > > function b() > return b1(pcall(a)) > end > end Nice! Thanks Florian! And excuse me for putting r where I meant status. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:26:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KQ4kd018850; Wed, 4 Nov 2009 18:26:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1CBA41A6F5; Wed, 4 Nov 2009 18:24:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0164C1A6CC for ; Wed, 4 Nov 2009 18:24:34 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2CDE5BDC95 for ; Wed, 4 Nov 2009 15:25:32 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 04 Nov 2009 15:25:32 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=+VYKxMcFq4nhqXGMx4I44/0XfNs=; b=tILRzZZGgtc80Sa32sVEgXNFqaor9Rqi4QvBMKGx+2RmtJNctNR++avKfBUa68+oRKzzzu3C5ONXTF6heFes9UHCcNYt89Pq29L8DII0gOFAU31jFJ9PSEUrtiH5SLNNfchH2TkS00mzwvDpIbODXQpfgdYvP6TAKM+NZlEDzgA= X-Sasl-enc: LIA3lQmkClGVM6TycCvNqktAeMKKnU4YimnAIRBdLCZx 1257366331 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id E470F4A5C81 for ; Wed, 4 Nov 2009 15:25:30 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you return multiple values? From: Geoff Leyland In-Reply-To: <20091104200901.GA24409@inf.puc-rio.br> Date: Thu, 5 Nov 2009 09:24:58 +1300 Content-Transfer-Encoding: 7bit Message-Id: <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Thanks Roberto, On 5/11/2009, at 9:09 AM, Roberto Ierusalimschy wrote: >> How do you return multiple values from a function that pcalls a >> function >> that returns an unknown number of values possibly including nil in a >> manner that doesn't involve undefined behaviour? >> >> [...] >> >> function b() >> local status, r = pcall(function() return { a() } end) >> if not r then error("nicely handled error!") end >> return unpack(r) >> end >> >> [...] > > > function pack (...) > return { n = select("#", ...); ... } > end > > function b() > local r = pack(pcall(function() return { a() } end)) > if not r[1] then error("nicely handled error!") end > return unpack(r, 2, r.n) > end > > ? Excuse me for causing confusion by writing "if not r" where I meant "if not status", and for the case of what I *meant*, it'd be local status, r = pcall(function() return pack(a()) end) if not status [...] It has the advantage over Florian's that you only write pack once and you handle the error in b(), not in the helper function, whereas Florian's avoids the packing and unpacking. I think they have the same number of closures? Anyway, thanks to you both! Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:35:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KZgFw021140; Wed, 4 Nov 2009 18:35:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B8CD1A706; Wed, 4 Nov 2009 18:34:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58C631A6CA for ; Wed, 4 Nov 2009 18:34:16 -0200 (BRST) Received: by iwn5 with SMTP id 5so5292245iwn.11 for ; Wed, 04 Nov 2009 12:35:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.59.12 with SMTP id j12mr2432285ibh.26.1257366914095; Wed, 04 Nov 2009 12:35:14 -0800 (PST) In-Reply-To: <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> Date: Wed, 4 Nov 2009 15:35:14 -0500 Message-ID: <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> Subject: Re: How do you return multiple values? From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA4KZgFw021140 On Wed, Nov 4, 2009 at 3:24 PM, Geoff Leyland wrote: > Thanks Roberto, > > On 5/11/2009, at 9:09 AM, Roberto Ierusalimschy wrote: > >>> How do you return multiple values from a function that pcalls a function >>> that returns an unknown number of values possibly including nil in a >>> manner that doesn't involve undefined behaviour? >>> >>> [...] >>> >>> function b() >>>  local status, r = pcall(function() return { a() } end) >>>  if not r then error("nicely handled error!") end >>>  return unpack(r) >>> end >>> >>> [...] >> >> >> function pack (...) >>  return { n = select("#", ...); ... } >> end >> >> function b() >>  local r = pack(pcall(function() return { a() } end)) >>  if not r[1] then error("nicely handled error!") end >>  return unpack(r, 2, r.n) >> end >> >> ? > > > Excuse me for causing confusion by writing "if not r" where I meant "if not > status", and for the case of what I *meant*, it'd be > > local status, r = pcall(function() return pack(a()) end) > if not status [...] > > It has the advantage over Florian's that you only write pack once and you > handle the error in b(), not in the helper function, whereas Florian's > avoids the packing and unpacking.  I think they have the same number of > closures? > > Anyway, thanks to you both! Use: function b() local t = pack(pcall(a)); if not r[1] then error("something") end return unpack(r, 2, r.n) end (this is what Roberto's code meant to be I think) Note there is no closure cost here. -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:45:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KjpQR022614; Wed, 4 Nov 2009 18:45:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEC5D18899; Wed, 4 Nov 2009 18:44:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s29.bay0.hotmail.com (bay0-omc3-s29.bay0.hotmail.com [65.54.246.229]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68D7E18814 for ; Wed, 4 Nov 2009 18:44:23 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s29.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 12:45:20 -0800 Received: from [155.31.170.207] (155.31.170.207) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Wed, 4 Nov 2009 20:45:19 +0000 Message-ID: <4AF1E7D6.2070607@my.erau.edu> Date: Wed, 4 Nov 2009 15:45:10 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Interning strings considered harmful (somewhat) References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> <87tyxbxvfj.fsf@mid.deneb.enyo.de> <4AF11E27.5060408@my.erau.edu> <87tyxanrw9.fsf@lola.goethe.zz> In-Reply-To: <87tyxanrw9.fsf@lola.goethe.zz> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Nov 2009 20:45:20.0320 (UTC) FILETIME=[B9408400:01CA5D8F] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Kastrup wrote: > One can't use Lua's string operations (in particular pattern matching) > on userdata, and there is no actual necessity to intern them for most > applications (excepting indexing or fast equality tests). > One also can't rely on Lua's string operations to work on strings unless they are interned in certain situations. Accordingly, it follows that the userdata would expose a method through its __index metamethod that would allow you to intern a string and produce a true Lua string. This would require more work on the Lua side, but zero work on the VM side. It would also allow you to explicitly control how an uninterned string becomes interned, so you know precisely where your vulnerabilities lie. ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:46:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KkHIN022701; Wed, 4 Nov 2009 18:46:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FE2F1892D; Wed, 4 Nov 2009 18:44:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8043D188AA for ; Wed, 4 Nov 2009 18:44:41 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 5A517BE9BD for ; Wed, 4 Nov 2009 15:45:36 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 04 Nov 2009 15:45:38 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=2KDu+R3Qz3tAvdusz7yZyjdGfsk=; b=blPt/gdEQDW0n2Kg3xGJ/s0hbLLtlYjFScbIb7yNytUdaDzghO5a/acMSG7WoBikBcM1saDjgpVcwcDSkY28euHntBIR+8Ai5Xxao9i+0I5kXmWZNVXOgEuuo4R1kjEX3Q4IGvuL5GooM63PcNdfwUEQX8ZV1jyNUhJ8jsIQnKw= X-Sasl-enc: X8zd38bv26Q/TvyHENdtQIC6J5X5lq0S3U4+3qW8VD5y 1257367536 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 16FEF4A5CB7 for ; Wed, 4 Nov 2009 15:45:35 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you return multiple values? From: Geoff Leyland In-Reply-To: <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> Date: Thu, 5 Nov 2009 09:45:02 +1300 Content-Transfer-Encoding: 7bit Message-Id: <0BA91F0A-62C0-4BB4-A442-02C364F88FE2@fastmail.fm> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 5/11/2009, at 9:35 AM, Patrick Donnelly wrote: > Use: > > function b() > local t = pack(pcall(a)); > if not r[1] then error("something") end > return unpack(r, 2, r.n) > end > > (this is what Roberto's code meant to be I think) > > Note there is no closure cost here. Right. Thanks again. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 18:48:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4KmsfB023213; Wed, 4 Nov 2009 18:48:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 736A218A35; Wed, 4 Nov 2009 18:47:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc2-s40.bay0.hotmail.com (bay0-omc2-s40.bay0.hotmail.com [65.54.246.176]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBAFD189F4 for ; Wed, 4 Nov 2009 18:47:30 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc2-s40.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 12:48:25 -0800 Received: from [155.31.170.207] (155.31.170.207) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Wed, 4 Nov 2009 20:48:24 +0000 Message-ID: <4AF1E892.1060800@my.erau.edu> Date: Wed, 4 Nov 2009 15:48:18 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Preventing Lua scripts that never return from freezing the hostapplication References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com><4AF07021.8070100@funcom.com> <4AF08422.6040905@my.erau.edu> <008e01ca5d75$0fd7d400$6600a8c0@sat3> In-Reply-To: <008e01ca5d75$0fd7d400$6600a8c0@sat3> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Nov 2009 20:48:25.0798 (UTC) FILETIME=[27CE3660:01CA5D90] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean GrayFace wrote: > In this particular case of s..s the concatination shouldn't take much more > than Lim*2 time, where Lim is the limit of time a loop may take. At > least if > time/length dependance is linear enough. > This would be a valid argument the increase of the string length were linear. However, it is not. The string length grows at 2^n, which is very far from linear. ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 19:01:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4L1qhn025557; Wed, 4 Nov 2009 19:01:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E01C018C55; Wed, 4 Nov 2009 19:00:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s37.bay0.hotmail.com (bay0-omc3-s37.bay0.hotmail.com [65.54.246.237]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9A7518C14 for ; Wed, 4 Nov 2009 19:00:27 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s37.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 13:01:23 -0800 Received: from [155.31.170.207] (155.31.170.207) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Wed, 4 Nov 2009 21:01:22 +0000 Message-ID: <4AF1EB9B.4060708@my.erau.edu> Date: Wed, 4 Nov 2009 16:01:15 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Preventing Lua scripts that never return from freezing the hostapplication References: <4AF05041.2070105@funcom.com> <5fe281d40911030814y36ddf4f9odba382d0d31a4c8c@mail.gmail.com><4AF07021.8070100@funcom.com> <4AF08422.6040905@my.erau.edu> <008e01ca5d75$0fd7d400$6600a8c0@sat3> <4AF1E892.1060800@my.erau.edu> In-Reply-To: <4AF1E892.1060800@my.erau.edu> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Nov 2009 21:01:23.0247 (UTC) FILETIME=[F73383F0:01CA5D91] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew P. Del Buono wrote: > GrayFace wrote: >> In this particular case of s..s the concatination shouldn't take much more >> than Lim*2 time, where Lim is the limit of time a loop may take. At >> least if >> time/length dependance is linear enough. >> > > This would be a valid argument the increase of the string length were > linear. However, it is not. The string length grows at 2^n, which is > very far from linear. > I apologize, I misunderstood your statement. I get what you mean now, but it's mostly a moot point. The starting point is completely arbitrary, and fact of the matter is it's possible to construct a concatenation operation that takes an extremely long time. Point is, Lua operators are not necessarily fast and negligible operations. Regards, -- Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 21:01:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4N1bEu009425; Wed, 4 Nov 2009 21:01:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 129871A6CF; Wed, 4 Nov 2009 21:00:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BFD91883F for ; Wed, 4 Nov 2009 21:00:06 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N5oqc-00038R-00; Thu, 05 Nov 2009 00:01:02 +0100 Date: Thu, 5 Nov 2009 00:01:00 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091104230100.GA8479@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > Here's a difference, but not a bug: > > $ lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > print(#{1, nil, 3}) > 3 > > $ luajit-2.0.0-beta1 > LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ > JIT: ON CMOV SSE2 SSE4.1 fold cse dce fwd dse narrow loop fuse > > print(#{1, nil, 3}) > 1 Implementation defined behavior. Results may vary even more in the future. --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 21:10:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA4NASIC010370; Wed, 4 Nov 2009 21:10:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E609B18899; Wed, 4 Nov 2009 21:09:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44E9018846 for ; Wed, 4 Nov 2009 21:09:03 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id B8E43BE1B5 for ; Wed, 4 Nov 2009 18:10:00 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 04 Nov 2009 18:10:00 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=qqhsJnXsEHGc4r9u5AGFTTNuq3s=; b=mBzwpajzc77rJYuM1I6PNl51UaKqJazyLkH8jnpZFpWYW8+i00xbxKXc7uPUeyO15xsudHOi77jcQbQwdONp/9rDFMOgpzpM/er76WCzUraknb0SlxiLzPlokdkUucAoFgPA0IyRMmW0xRhexpMQewCeABy+l9LcpO/ZdT5vhzs= X-Sasl-enc: yq4i8LGWEb6xoelnvCIWwXC7e8LHie4MEtbKoCZEN4Cb 1257376200 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id EDC3738F9 for ; Wed, 4 Nov 2009 18:09:59 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091104230100.GA8479@mike.de> Date: Thu, 5 Nov 2009 12:09:59 +1300 Content-Transfer-Encoding: 7bit Message-Id: <4A6F4FE2-C994-4C65-9316-54AFAD8CF91D@fastmail.fm> References: <20091031225554.GA30341@mike.de> <20091104230100.GA8479@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 5/11/2009, at 12:01 PM, Mike Pall wrote: > Geoff Leyland wrote: >> Here's a difference, but not a bug: >> >> $ lua >> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio >>> print(#{1, nil, 3}) >> 3 >> >> $ luajit-2.0.0-beta1 >> LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ >> JIT: ON CMOV SSE2 SSE4.1 fold cse dce fwd dse narrow loop fuse >>> print(#{1, nil, 3}) >> 1 > > Implementation defined behavior. Results may vary even more in the > future. Absolutely. And I prefer it that way - it's caught a couple of my bugs already. From lua-bounces@bazar2.conectiva.com.br Wed Nov 4 23:31:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA51VkJN026382; Wed, 4 Nov 2009 23:31:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C24A51A6ED; Wed, 4 Nov 2009 23:30:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85BF81A6CA for ; Wed, 4 Nov 2009 23:30:11 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 27DADBE2AA for ; Wed, 4 Nov 2009 20:31:05 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 04 Nov 2009 20:31:05 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=f1RNcyv997gcxZ8n/2f2hRyMr9w=; b=HDH4Z+Z+ad6cMssNaCZl76nlax+JPjmy2X2pmLZmJmjllgx4nPwbMA1dneYAYhVAzRb7+yJihIx23LJUez/AOqSN7Mb/tkbgtijT1m83aNgOkyWpHLwsID79fMmGgg3L3JdNes6CxijsXHGsZ5y6mpGXV3/KoF+9XOlVSM4EJVE= X-Sasl-enc: 3Xr37wx8D7oVeP9w951k/KzWMmQa5sENVU9uDb9iP+vI 1257384664 Received: from [10.1.1.4] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0388A1F0EC for ; Wed, 4 Nov 2009 20:31:03 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091103105717.GA15089@mike.de> Date: Thu, 5 Nov 2009 14:30:29 +1300 Content-Transfer-Encoding: 7bit Message-Id: <9B383221-247C-4FA3-A086-0B3635A1B95F@fastmail.fm> References: <20091031225554.GA30341@mike.de> <9AD6541C-FFF3-4967-8BD3-792664E7DE29@fastmail.fm> <20091101015235.GA7316@mike.de> <843CC0FA-BD53-4A2D-862A-7023BD94E076@fastmail.fm> <20091101160610.GA7245@mike.de> <5ED95F00-05B7-46D0-AB81-E78EDF742D17@fastmail.fm> <20091103105717.GA15089@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 3/11/2009, at 11:57 PM, Mike Pall wrote: > A trace compiler and a modern CPU have something in common: they > don't like branchy code. And CPUs don't like pointer chasing. > That's why standard textbook tree data structures are rarely > the best choice anymore. > > The big-O notation assumes constant overhead per access or per > instruction. But that's far from the truth with a modern CPU. An > O(n) linear search can outperform an O(log n) tree search for a > much larger 'n' than you might imagine. Try it! I did! Running a test to find the best leaf size on my spare hardware is very slow (not enough memory), but it seems that the best size for a leaf in the kdtree (for the NY map, this hardware, LJ2 etc) is about 400 items (not the 100 I had). I'll run it on something more likely to get a result while I'm out. Still, 400 is a lot less than the 800,000-odd items in the map, so modern architecture is all good, but those logs tend to win in the end. I tried querying with a leaf size larger than the items in the map (ie a linear search), but I got bored of waiting even on the fast box. (Of course, these conclusions are only valid if everything's coded right) Anyway, this is no longer particularly relevant to LuaJIT, other than I'm curious to see if the optimal leaf size is different between Lua and LuaJIT. I'm trying to get the rima unit tests running on LJ2 and will hopefully get there soon. The Lulu patch fixed one segfault, and the other problems so far have been me being lax with tables with nils in them. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 00:28:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA52StKN000855; Thu, 5 Nov 2009 00:28:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4340F1A6F7; Thu, 5 Nov 2009 00:27:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1D751A6DD for ; Thu, 5 Nov 2009 00:27:21 -0200 (BRST) Received: by iwn5 with SMTP id 5so5508686iwn.11 for ; Wed, 04 Nov 2009 18:28:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.170.201 with SMTP id e9mr109310ibz.15.1257388098964; Wed, 04 Nov 2009 18:28:18 -0800 (PST) In-Reply-To: <20091103135515.GI11203@vaio.jimpryor.net> References: <20091103135515.GI11203@vaio.jimpryor.net> Date: Wed, 4 Nov 2009 21:28:18 -0500 X-Google-Sender-Auth: a76d18fe0beaf00b Message-ID: Subject: Re: Reassigning control variables in loop body? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 3, 2009 at 8:55 AM, Jim Pryor wrote: > PiL 2nd ed, pp. 32 - 33 say: > "You should never change the value of the control variable [in examples > like the second, above]: the effect of such changes is unpredictable..." > > But if you look at the code equivalents in the reference manual:.... > The control variable is supposedly saved in a hidden variable "var" that isn't > exposed to the programmer. So it should be harmless for the programmer to > overwrite var_1 in the first statement, or v in the second statement. Maybe the statement was a carryover from the first edition covering 5.0. PiL's opinion doesn't matter though: only the Reference Manual defines specified behavior. The Lua 5.0 Reference Manual omits this hidden variable and explicitly says "The behavior is undefined if you assign to var inside the block." [1] As you saw, the Lua 5.1 Reference Manual seems to allow this. A change was made between versions [2,3]. That said, what's permissible is not always beneficial. That fact that you're unsure indicates that others reading your code are likely unsure as well. You can for greater code clarity rewrite it in a way that avoids mutating variables: "local j = (k==3) and 1 or k" (recommended) or, if you really want, "local k = (k==3) and 1 or k". Or rewrite as a while loop. [1] http://www.lua.org/manual/5.0/manual.html#2.4.5 [2] http://lua-users.org/lists/lua-l/2005-02/msg00250.html [3] http://lua-users.org/lists/lua-l/2007-09/msg00479.html From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 01:14:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA53EdFv005387; Thu, 5 Nov 2009 01:14:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CCA518C2F; Thu, 5 Nov 2009 01:13:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 526D818B9F for ; Thu, 5 Nov 2009 01:13:13 -0200 (BRST) Received: by iwn5 with SMTP id 5so5530890iwn.11 for ; Wed, 04 Nov 2009 19:14:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.122.162 with SMTP id l34mr581923ibr.20.1257390848790; Wed, 04 Nov 2009 19:14:08 -0800 (PST) In-Reply-To: <0BA91F0A-62C0-4BB4-A442-02C364F88FE2@fastmail.fm> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> <0BA91F0A-62C0-4BB4-A442-02C364F88FE2@fastmail.fm> Date: Wed, 4 Nov 2009 22:14:08 -0500 X-Google-Sender-Auth: a89eb9e6797f9a71 Message-ID: Subject: Re: How do you return multiple values? From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA53EdFv005387 On Wed, Nov 4, 2009 at 3:45 PM, Geoff Leyland wrote: >> function b() >>  local t = pack(pcall(a)); >>  if not r[1] then error("something") end >>  return unpack(r, 2, r.n) >> end The above solutions and others are cataloged in http://lua-users.org/wiki/VarargTheSecondClassCitizen (Vararg Saving). From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 01:22:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA53MBa2006095; Thu, 5 Nov 2009 01:22:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C05F61A704; Thu, 5 Nov 2009 01:20:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth20.prod.mesa1.secureserver.net (smtpauth20.prod.mesa1.secureserver.net [64.202.165.36]) by bazar2.conectiva.com.br (Postfix) with SMTP id 9E32D1A6ED for ; Thu, 5 Nov 2009 01:20:50 -0200 (BRST) Received: (qmail 9545 invoked from network); 5 Nov 2009 03:21:46 -0000 Received: from unknown (98.117.140.83) by smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 05 Nov 2009 03:21:46 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you return multiple values? From: Mark Hamburg In-Reply-To: <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> Date: Wed, 4 Nov 2009 19:21:46 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 4, 2009, at 12:35 PM, Patrick Donnelly wrote: > Use: > > function b() > local t = pack(pcall(a)); > if not r[1] then error("something") end > return unpack(r, 2, r.n) > end > > (this is what Roberto's code meant to be I think) > > Note there is no closure cost here. But there is the cost of the pack which may actually be higher depending on how many results you are dealing with v how many upvalues. Mark From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 04:49:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA56nIZ6026637; Thu, 5 Nov 2009 04:49:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3398C19352; Thu, 5 Nov 2009 04:47:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6180F18EA5 for ; Thu, 5 Nov 2009 04:47:46 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N5w9B-0006r2-P0 for lua@bazar2.conectiva.com.br; Thu, 05 Nov 2009 07:48:41 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N5w9B-0002AV-9r for lua@bazar2.conectiva.com.br; Thu, 05 Nov 2009 07:48:41 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: How do you return multiple values? References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> Date: Thu, 05 Nov 2009 07:48:41 +0100 In-Reply-To: (Mark Hamburg's message of "Wed, 4 Nov 2009 19:21:46 -0800") Message-ID: <87eiodpiuu.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Mark Hamburg: > But there is the cost of the pack which may actually be higher > depending on how many results you are dealing with v how many > upvalues. My example didn't need a fresh closure, either. If you get away without a closure in a real-world case depends on what you're doing. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 08:19:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5AJD3Z014383; Thu, 5 Nov 2009 08:19:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8553119344; Thu, 5 Nov 2009 08:17:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C763192E8 for ; Thu, 5 Nov 2009 08:17:44 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N5zQL-0005m4-GA for lua@bazar2.conectiva.com.br; Thu, 05 Nov 2009 11:18:37 +0100 Received: from p5b2c1c01.dip.t-dialin.net ([91.44.28.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Nov 2009 11:18:37 +0100 Received: from dak by p5b2c1c01.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Nov 2009 11:18:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Reassigning control variables in loop body? Date: Thu, 05 Nov 2009 11:18:14 +0100 Organization: Organization?!? Lines: 17 Message-ID: <87vdhpmg0p.fsf@lola.goethe.zz> References: <20091103135515.GI11203@vaio.jimpryor.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c1c01.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:WQFjg2O504wL+BCafqHFF9Jn69g= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Manura writes: > That said, what's permissible is not always beneficial. That fact > that you're unsure indicates that others reading your code are likely > unsure as well. Yup. C++ is a language where it is not a good idea to explore the boundaries of _defined_ behavior because they are so intricate that you'll confuse human readers, and possibly even the compiler. Now here we are even messing around _beyond_ the boundary of good definition (and style). Since with Lua the contention "a solution in the spirit of the language will be obtuse/ugly" is even less valid, I'd keep away from such constructs. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 11:18:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5DIswj018040; Thu, 5 Nov 2009 11:18:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B38C918A5B; Thu, 5 Nov 2009 11:17:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79F03188AE for ; Thu, 5 Nov 2009 11:17:05 -0200 (BRST) Received: by bwz27 with SMTP id 27so10096373bwz.21 for ; Thu, 05 Nov 2009 05:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=F6rxaM6+B2tMqC9iHp9T6Zag4LcjX5kiR8zszEksLDk=; b=fdUhffboWArHqkaqFvPAoUQPRixOqYiqnEtiUwjFp7iZNvYoB5GeJp1zwW8L7/k2b6 DOCaNzKpNAiiXnFMrXmu+lzDjEvsDZR4gsZUsgSilTO/ZPesXjPpaeJ19nAFuLxX7+uN BSa18dGQNvkGibhsx03YkeEhazG2Hyi5jPa2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=cTCuIbwHn0gwfioGFddy4ILaLJLFP7TwjvpcZF2z8/l2Wga1f69rv0meDIt0/GFPZm LesQW8rloMYIJnzCIA63mUpKa1E++X2vnR6Tohudbaw05/kyXPcaWg19Un10Ba4jE+xf v6D4apZArhCyWC661NEWxKSqrWERNCHlSkL0o= MIME-Version: 1.0 Received: by 10.204.24.130 with SMTP id v2mr2998016bkb.33.1257427081277; Thu, 05 Nov 2009 05:18:01 -0800 (PST) Date: Thu, 5 Nov 2009 14:18:01 +0100 Message-ID: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> Subject: help to (slightly) modify Lua interpreter From: Francesco Abbate To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi guys, I'm coming again with the same help request, I would like to use expressions where userdata are indexed with more comma-separated values. For example, if you want to index a matrix it would be natural to write something like: m[i, j] but Lua does not accept this construct. For the moment I've implemented that with the syntax m:get(i,j ) and m:set(i, j, value) which is quite reasonable but ugly to read for a mathematician or a non-Lua casual user. I'm quite determined to change Lua to obtain this syntax extension and I would appreciate a lot any suggestions about where to look in the source code to understand how it works for the part I'm interested on and make the modification right. I already have a good knowledge of the paser but I think that I would need to make non-trivial changes in the AST and in the way the AST is interpreted. Any suggestions or help would be very welcome. Thank you very much in any case. Best regards, Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 11:27:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5DQssb019987; Thu, 5 Nov 2009 11:26:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0A1919176; Thu, 5 Nov 2009 11:25:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 891ED19092 for ; Thu, 5 Nov 2009 11:25:29 -0200 (BRST) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5DQOld019883 for ; Thu, 5 Nov 2009 11:26:25 -0200 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 57ABAD7F3; Thu, 5 Nov 2009 11:26:22 -0200 (BRST) Date: Thu, 5 Nov 2009 11:26:22 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I would like to use expressions where userdata are indexed with more > comma-separated values. For example, if you want to index a matrix it > would be natural to write something like: > > m[i, j] If you can use m(i,j) (as in Fortran), then you can set a __call metamethod. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 11:35:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5DZW50023499; Thu, 5 Nov 2009 11:35:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5CB851A67A; Thu, 5 Nov 2009 11:34:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DCA781914C for ; Thu, 5 Nov 2009 11:34:02 -0200 (BRST) Received: by ewy26 with SMTP id 26so8432306ewy.5 for ; Thu, 05 Nov 2009 05:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4jsQbYmKCT4W6e9hfmeL6JfwDbXS73C/xQsMrV7ykn4=; b=CBmROTrGAo1sYJUccbkYDch9FnInvtuuX8pGCcz/aeLf7Sl6EZ5a9GmgGl1bKJpIjM wJeJbao5Kk+DZ/+uA+w0s9AI9Qa5hezTZiMiFvBvSuZzMWoayc1YajzNflRYLctSWJvi Gy9qxAcl+TjijC+vSsNh1zLNrzvYW26yQB9M4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=V5ifE7gYcEIz+4/wPbf93qdoTi+MS9YMK2V+eNqyXc2DmfAeHtPy2b3BtT6HxGJcfR kv+1+phQ9rrucFTtjC9zoje9r+4x3OaAoNVfOmZ799KYhWlzgrCtrSdswSVBb/YZG3bD Xi9ZQsvaJK2q1J+ijlVytwrRvBfjneRkxrTI8= MIME-Version: 1.0 Received: by 10.239.139.100 with SMTP id s36mr340065hbs.109.1257428098251; Thu, 05 Nov 2009 05:34:58 -0800 (PST) In-Reply-To: <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> Date: Thu, 5 Nov 2009 15:34:58 +0200 Message-ID: <560972290911050534mea1089u7c58d661d4ccd740@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 5, 2009 at 3:26 PM, Luiz Henrique de Figueiredo wrote: > If you can use m(i,j) (as in Fortran), then you can set a __call metamethod. And then no one can argue when you use 1-based arrays ;) From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 11:57:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5Dvrm3030881; Thu, 5 Nov 2009 11:57:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B660B19288; Thu, 5 Nov 2009 11:56:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 952E11A614 for ; Thu, 5 Nov 2009 11:56:07 -0200 (BRST) Received: by gxk26 with SMTP id 26so2422gxk.1 for ; Thu, 05 Nov 2009 05:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ViLIRntWV4a7QaAGShCHOzlUfoQrIx4grHuIS9CLj+M=; b=soqj2PNUvDLgy9l6XjO0qkIuNYUCJr4UxMFVeHIW/I993GnhBLAG7wv1tpO3kGsUCD 5SA9OsiWpYM4vy1+GDrdBablkW3asiMiYSYr7I7om7Qc4iwEdS6d8QBIyEN1jW2yG8jx IVfwjlnoRYd6e11OjUkQ4Pu6Q9POGi0GMZ01M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OVb3gCWq7Qki/WFnFS3vnbobUVRaWo06/Chth2sC6+OJ77GtkHEKdcsvp8sgbzx8sC j8rGcHoQgjyPiPa5zKYYgc6PlTkKHFBOf5GNECPR2J5e9wJh3NgiI3839RG+H6NH93YE W4jmKAtiX6trDN0c7Juy6+bBKt7NkZEReXFIk= MIME-Version: 1.0 Received: by 10.90.17.29 with SMTP id 29mr6001432agq.79.1257429423833; Thu, 05 Nov 2009 05:57:03 -0800 (PST) In-Reply-To: <560972290911050534mea1089u7c58d661d4ccd740@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <560972290911050534mea1089u7c58d661d4ccd740@mail.gmail.com> Date: Thu, 5 Nov 2009 08:57:03 -0500 Message-ID: <2781f020911050557x4347a2d7r78592bd45eb79127@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Joseph Stewart To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean ...then you could make the constructor like this: local m = dim(100,100) ;-) -joe On Thu, Nov 5, 2009 at 8:34 AM, steve donovan wrote: > On Thu, Nov 5, 2009 at 3:26 PM, Luiz Henrique de Figueiredo > wrote: >> If you can use m(i,j) (as in Fortran), then you can set a __call metamethod. > > And then no one can argue when you use 1-based arrays ;) > From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 12:31:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5EVChY007300; Thu, 5 Nov 2009 12:31:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9369E1A6B2; Thu, 5 Nov 2009 12:29:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 677941A67A for ; Thu, 5 Nov 2009 12:29:35 -0200 (BRST) Received: by fxm21 with SMTP id 21so5849fxm.21 for ; Thu, 05 Nov 2009 06:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0QvWcwssH/gj6n1o/xtL76M3SLJp7EiP+S3Gcp30zos=; b=c7EvD7ZRyUhVTdEmj8y+eizUCizbFG2pz4Z8uRp0M/WwSZv8P/0SADIvH2B7Ft2j1F vhgQ0LKPzV3CgGWjiiomTrujNOLiqmydf0RZgX76A/XquC5nttvWa70lsDKUqlESaXxE aRyu434KUNQQw3MEVaZ8gQgxVY6IEv6QMR0I8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MxCsQPaq7R9cTBLh7sjG79D1b4zxEt/S7iDaWXAswBlqQFex9AljWNssv5rmU2J8Fk +kQTRreU+CKFccMSP0qPKgqBjf3Y2/OWN6uN9MC5v5AefsO3/CrY/d+TzuhU2FNy+W7A 2lKvfY6MlcUuCSRWOch70Xc4zafmxCGsf9qdM= MIME-Version: 1.0 Received: by 10.204.175.80 with SMTP id w16mr3027057bkz.207.1257431432041; Thu, 05 Nov 2009 06:30:32 -0800 (PST) In-Reply-To: <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> Date: Thu, 5 Nov 2009 15:30:31 +0100 Message-ID: <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Luiz Henrique de Figueiredo : > If you can use m(i,j) (as in Fortran), then you can set a __call metamethod. That's an excellent suggestion!! Thank you very much, it will spare me a lot of hard work with Lua internals :-) Actually, I completely missed the 'call' metamethod, I'm wondering if it is covered in the PiL book since I read it quite thoroughlly. Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 12:43:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5EhNTl010482; Thu, 5 Nov 2009 12:43:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 890061A6F0; Thu, 5 Nov 2009 12:41:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93BF31A687 for ; Thu, 5 Nov 2009 12:41:53 -0200 (BRST) Received: by bwz27 with SMTP id 27so46753bwz.21 for ; Thu, 05 Nov 2009 06:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=HzeRi/cqsQrN4QMc4OrFpT0G0XMz72GZkHXdrwFbVZA=; b=T6Hh9ogE8NMog4qHx0zsrQtq9jfEaaNWUlHIDM+uMlQQxJ/u1FWRnizklTeo8dcpHx 4TwUBt3J4O7KVsB3DxFjfRViC35cX3ut5FUTLFXImFC91ypAOqJG8ajrzxmlB1TeZoMD +3brb5SeCS+k+nM15KAzbrIf9Hv7jWnIwzRm8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=R4u7oWAzuYUNUyY4ibJCO5wJk24/WxWyS2iKSQP+T4peR5+cBdLxH/IgUtmtIfwIqi AETTPgy2ZZOiUyOw2ir0WaJXdgYDsLC3IrjJq9c6nRwLvQOrJUHNBLXdlzvwY5cceNoG knR1MP0ldjfHJvPPSIb8WMbmhkXvCf41mlFV8= MIME-Version: 1.0 Received: by 10.204.34.71 with SMTP id k7mr3028222bkd.206.1257432169184; Thu, 05 Nov 2009 06:42:49 -0800 (PST) In-Reply-To: <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> Date: Thu, 5 Nov 2009 15:42:48 +0100 Message-ID: <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Francesco Abbate : > 2009/11/5 Luiz Henrique de Figueiredo : >> If you can use m(i,j) (as in Fortran), then you can set a __call metamethod. > > That's an excellent suggestion!! Thank you very much, it will spare me > a lot of hard work with Lua internals :-) I better thought about this problem and the __call metamethod does not make the affair since, for assignments, the syntax: m(i,j) = value will be invalid. So I still need to hack the __index and __newindex metamethods. Please give me some hints about the Lua code so that I can modify it. I need a real solution and a modification of Lua is really needed! Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 12:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5EkjBV011299; Thu, 5 Nov 2009 12:46:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C2061A6F3; Thu, 5 Nov 2009 12:45:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE89A1A614 for ; Thu, 5 Nov 2009 12:45:17 -0200 (BRST) Received: by bwz27 with SMTP id 27so50406bwz.21 for ; Thu, 05 Nov 2009 06:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=dnskbGiUYKrj1fjIElfMcvT4TrDKsRpAjqY8Y8Oz1Iw=; b=anmTigeuC94dDUao89PnJQRHTElfR9+IN8asiS4jVX/jDW/SYHQ0RPKM/HYuPSDoZF Nk1zofRQBpbdPmPX/m4iaJUD7BRhMBxvzkufA3YCqOBuf4kK08EQepEjV9MnpjS/TuTH gZBSBNDAoXHN/2FBOBl7FzGSc/Kpyu5z4F3x4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JvaUd0ktpS+QaIwBvKbmF/d0ZEFHXA7FFlXn9V1WHXNk5ppsQvWCvElUoMSLqC8B3w vXKJHld+u8mGsGbl+Ymdl6fHTl2lMVXbK8NmtgYfsug+mG4/uEijvSg6nQrYGk6FioyG ecdSXwoCGUeH/tqsLSzUHVFkC1geHXun7O4I0= MIME-Version: 1.0 Received: by 10.204.150.77 with SMTP id x13mr3040288bkv.100.1257432375775; Thu, 05 Nov 2009 06:46:15 -0800 (PST) In-Reply-To: <2781f020911050557x4347a2d7r78592bd45eb79127@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <560972290911050534mea1089u7c58d661d4ccd740@mail.gmail.com> <2781f020911050557x4347a2d7r78592bd45eb79127@mail.gmail.com> Date: Thu, 5 Nov 2009 15:46:15 +0100 Message-ID: <4ff79edb0911050646r1947addv90c3a49bd1c5c604@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Joseph Stewart : > ...then you could make the constructor like this: > > local m = dim(100,100) > > ;-) This syntax is already supported by gsl shell, I can write local m = new(100, 100) but also local m = new(100, 100, |i, j| i+2*j) this latter form takes a third argument that should be a function to initialise the matrix. I've added in GSL shell the notation |x, y| x+2*y to mean function(x, y) return x+2*y end The idea was borrowed from Metalua and I think that's really handy. ;-) Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 12:57:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5EvcQ1013823; Thu, 5 Nov 2009 12:57:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 641E71A6FC; Thu, 5 Nov 2009 12:56:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A39981A614 for ; Thu, 5 Nov 2009 12:56:08 -0200 (BRST) Received: by ewy26 with SMTP id 26so69688ewy.5 for ; Thu, 05 Nov 2009 06:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=MJkbT/e+6DYBmui2TR75InhfVzPXYWWUKinJpkiePbM=; b=vhZC02qFxwenWJ/4/YI9CRrSaIIwsFQhW+bnL+zeQtbZ6Atz3psiGzVJ+v2E6d+m8m DTVZkCh3gFf7p8ZmWxqpKP9cQ11VlhLkt/ENv+Zb0Dw7s/yi+TnU+PY94CXljB9r/gYd w2+EzDNcbLPa4yLEFzqQ1NjvEN2U9AsyYNcn0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=RtKRPH61dL/FQ4rmfk4Z24TZPKG7BA8JOZDg6TKtxoWDNVeId3vZo/0SgrOuGDnm6f F3SR4IYyUqPI0uusPW0CnVQpatW2DdQacWCmNQCmn4EtLcyWvT7LSYNYcmaT3Q8BoCF1 oaaYyEyL706Uu36UIXYongCwPVf0r9xUjNDYE= MIME-Version: 1.0 Received: by 10.213.0.154 with SMTP id 26mr3507382ebb.82.1257433025698; Thu, 05 Nov 2009 06:57:05 -0800 (PST) In-Reply-To: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> Date: Thu, 5 Nov 2009 15:57:05 +0100 X-Google-Sender-Auth: 66b9c2387c6337d7 Message-ID: <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=000e0cdf9b10d35c240477a0f0c2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cdf9b10d35c240477a0f0c2 Content-Type: text/plain; charset=ISO-8859-1 In metalua: *-- Metalua extension --* -{ block: local function index_builder(expr, indices) indices = indices[1] if #indices==1 then return `Index{ expr, indices[1] } end local var = mlp.gensym() return `Stat{ +{block: local -{var} = -{expr} }, `Call{ +{getmetatable(-{var}).__index}, var, unpack(indices) } } end mlp.expr.suffix:del '[' *-- remove old "[...]" suffix parser* mlp.expr.suffix:add{ "[", gg.list{mlp.expr, separators=","}, "]", builder=index_builder } } *-- Test code: a metatable with __index accepting several indices --* MT = { __index = |t, ...| "requesting from " .. tostring(t) .. " index " .. table.concat({...}, ", ") } x = setmetatable({ }, MT) *-- Use the metatable --* print (x[1]) print (x[1,2]) print (x[1,2,3]) It generates normal code for 1-dimension indices; if there are several indices, it directly calls the __index metamethod with all the indices. -- Fabien --000e0cdf9b10d35c240477a0f0c2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In metalua:

-- Metalua extension --
-{ block:

=A0=A0 local function index_buil= der(expr, indices)
=A0=A0 =A0 =A0indices =3D indices[1]
=A0=A0 =A0 =A0if= #indices=3D=3D1 then return `Index{ expr, indices[1] } end
=A0=A0 =A0 =A0local var =3D mlp.gensym()
<= div>=A0=A0 =A0 =A0return `Stat{=A0
=A0=A0 =A0 =A0 =A0 +{block: local -{var} =3D -{expr} },=A0
=A0=A0 =A0 =A0 =A0 `Call{ +{getmetatable(-{var}).__index}, var, unpac= k(indices) } }=A0
=A0=A0 end

=A0=A0 mlp.expr.suff= ix:del '[' -- remove old "[...]" suffix parser

=A0=A0 mlp.expr.suffix:add{ &quo= t;[", gg.list{mlp.expr, separators=3D","},=A0"]", = builder=3Dindex_builder }=A0
}

-- Test code: a metatable = with __index accepting several indices --
MT =3D { __index =3D |t, ...|
=A0=A0 =A0 =A0 =A0 &quo= t;requesting from " .. tostring(t) ..
=A0=A0 =A0 =A0 =A0 " index " .. table.concat({...}, ", = ") }

x =3D setmetatable({ }, MT)

=
= -- Use the metatable --
print (x[1])
print (x[1,2])
print (x[1,2,3])

It generates normal c= ode for 1-dimension indices; if there are several indices, it directly call= s the __index metamethod with all the indices.

=A0=A0 -- Fabien
--000e0cdf9b10d35c240477a0f0c2-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 13:22:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5FMs9f019818; Thu, 5 Nov 2009 13:22:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CB4C1A6BA; Thu, 5 Nov 2009 13:21:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA1601881C for ; Thu, 5 Nov 2009 13:21:20 -0200 (BRST) Received: by ywh40 with SMTP id 40so76969ywh.33 for ; Thu, 05 Nov 2009 07:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=eisAeh7ohzVEE2oxFJwefV6thchubYLz6CuiE57eAOQ=; b=jPyxUbWeeO5HiFXUF6zhFYi/ytSW04DIy60iDsTUIhDXP4N/f57po8AHil6zkUFT1U rkztGq1qjf7rnFHhuSLzlUpV8zC0WB8EHhg7tjMbOMHK91dpEP0W1xkDT9Vk/FTIDog1 7jDHswItwZyEoAayA6o7zhZ3FF2qBKqHda5Ug= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Evmhr3LQhDZR7s0836VsauB5D7X1QWQ5A9Eh4JMJcrQJsl3rAF5ooDLtEFwCeDb7TB sRQcT3gtLru9s1z0Qy8dtjm0Y3zJ4ObVRpBTQY4sECNVX+VIBPTdn1T4FlLCrvhREQZM yfeO+js7mmKObspRtGx/JPHuIne3BxC9LwNZU= MIME-Version: 1.0 Received: by 10.101.29.9 with SMTP id g9mr470950anj.123.1257434537714; Thu, 05 Nov 2009 07:22:17 -0800 (PST) Date: Thu, 5 Nov 2009 10:22:17 -0500 Message-ID: Subject: mochalua heap memory issues? From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=001636b2b0cdf2e6770477a14ae2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b2b0cdf2e6770477a14ae2 Content-Type: text/plain; charset=ISO-8859-1 Greetings all, I hope it is alright posting about mochalua here; I couldn't seem to find a good spot to talk about mochalua elsewhere. I've recently started using mochalua in my Java 1.6 SE application; and while I can get small, trivial lua code to run; a larger multi-function script results in a Java out of heap memory exception. I've tried to set the xms and xmm VM arguments to up the JVM heap size but nothing seems to be helping. I am using luaL_loadstring to load the data; has anyone had similar issues when working with mochalua? Any information is appreciated, Thanks, Raymond Jacobs Owner, Ethereal Darkness Interactive www.edigames.com --001636b2b0cdf2e6770477a14ae2 Content-Type: text/html; charset=ISO-8859-1 Greetings all,

I hope it is alright posting about mochalua here;
I couldn't seem to find a good spot to talk about mochalua elsewhere.

I've recently started using mochalua in my Java 1.6 SE application;
and while I can get small, trivial lua code to run; a larger multi-function script
results in a Java out of heap memory exception.

I've tried to set the xms and xmm VM arguments to up the JVM heap size but nothing seems to be helping.

I am using luaL_loadstring to load the data;

has anyone had similar issues when working with mochalua?

Any information is appreciated,

Thanks,

Raymond Jacobs
Owner,
Ethereal Darkness Interactive
www.edigames.com

--001636b2b0cdf2e6770477a14ae2-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 13:25:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5FPcCX020518; Thu, 5 Nov 2009 13:25:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EF6C1A70A; Thu, 5 Nov 2009 13:24:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D005A1A614 for ; Thu, 5 Nov 2009 13:24:10 -0200 (BRST) Received: by bwz27 with SMTP id 27so92079bwz.21 for ; Thu, 05 Nov 2009 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3YJF18EfyR2vIHSebyfgy6rDvONjsorJ/0WlBrWsH04=; b=gQ/UX3pugDGsWp+Gwraws7I36kYQif+801YWWZ6mu/cPFxevXhOPDFopIqHzO8ln+1 2Ae3UcAraUUS+dAfDoFU6D+Q1eCYgVww8AaR7wNqxcdMpD+/mNcoIHhcLhX179oYYdPk U60XM5zgZemAeu+G6D4Z2EZWmhhw1k+gCJCCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YTBC3TrD0AydOUag1yodLaG7Xb6N5aVOwnhmqvANTKHaV7phIWQb5n73lPIaA8F9rk kMixS/kisZkhCuk/pv7Hj7MmYXsT7C59nWGh19KmrPRFWToxUHZK3LEkeYlpBmhGxUx7 UVuTOyLRw4sfljIpOt2yA8p224EZRSMC5UrX0= MIME-Version: 1.0 Received: by 10.204.8.65 with SMTP id g1mr3157602bkg.153.1257434703555; Thu, 05 Nov 2009 07:25:03 -0800 (PST) In-Reply-To: <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> Date: Thu, 5 Nov 2009 16:25:03 +0100 Message-ID: <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA5FPcCX020518 2009/11/5 Fabien : > In metalua: > -- Metalua extension -- > -{ block: [...] > x = setmetatable({ }, MT) > -- Use the metatable -- > print (x[1]) > print (x[1,2]) > print (x[1,2,3]) > It generates normal code for 1-dimension indices; if there are several > indices, it directly calls the __index metamethod with all the indices. >    -- Fabien Thank you very much Fabien, that looks great. I really need to improve my knowledge of Metalua since it is an excellent tool. The only problem is that if I adopt this solution I will be forced to run GSL shell through Metalua instead of Lua. This will add a significant level of complexity that will be, at the end, unjustified. So, I'm going to test your solution, it is a really smart proposition, but still I would like to adopt the option of changing Lua itself. So, I still need the help of the Lua hackers :-) Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 14:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5G1odV029152; Thu, 5 Nov 2009 14:01:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 475E019027; Thu, 5 Nov 2009 14:00:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-05.prod.phx3.secureserver.net (p3plsmtpa01-05.prod.phx3.secureserver.net [72.167.82.85]) by bazar2.conectiva.com.br (Postfix) with SMTP id 8AC1818E5E for ; Thu, 5 Nov 2009 13:59:56 -0200 (BRST) Received: (qmail 684 invoked from network); 5 Nov 2009 16:00:52 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-05.prod.phx3.secureserver.net (72.167.82.85) with ESMTP; 05 Nov 2009 16:00:52 -0000 From: Mark Hamburg Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: multipart/alternative; boundary=Apple-Mail-224--43222519 Subject: Re: help to (slightly) modify Lua interpreter Date: Thu, 5 Nov 2009 08:00:51 -0800 In-Reply-To: <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> To: Lua list References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> Message-Id: <6F2D0FC7-1C76-42A7-B661-649E8572BF03@grubmah.com> X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-224--43222519 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes On Nov 5, 2009, at 6:57 AM, Fabien wrote: > In metalua: > > -- Metalua extension -- > -{ block: > > local function index_builder(expr, indices) > indices = indices[1] > if #indices==1 then return `Index{ expr, indices[1] } end > local var = mlp.gensym() > return `Stat{ > +{block: local -{var} = -{expr} }, > `Call{ +{getmetatable(-{var}).__index}, var, unpack > (indices) } } > end > > mlp.expr.suffix:del '[' -- remove old "[...]" suffix parser > > mlp.expr.suffix:add{ "[", gg.list{mlp.expr, separators=","}, "]", > builder=index_builder } > } > > -- Test code: a metatable with __index accepting several indices -- > MT = { __index = |t, ...| > "requesting from " .. tostring(t) .. > " index " .. table.concat({...}, ", ") } > > x = setmetatable({ }, MT) > > -- Use the metatable -- > print (x[1]) > print (x[1,2]) > print (x[1,2,3]) > > It generates normal code for 1-dimension indices; if there are > several indices, it directly calls the __index metamethod with all > the indices. What about assignment? I guess if the __newindex function knows it will have a fixed number of indices there isn't a problem, but if you don't know that you need to tack the extra indices on after the value. Mark --Apple-Mail-224--43222519 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
On Nov 5, 2009, at 6:57 AM, Fabien wrote:

In metalua:

-- Metalua extension --
-{ block:

   local function index_builder(expr, indices)
      indices = indices[1]
      if #indices==1 then return `Index{ expr, indices[1] } end
      local var = mlp.gensym()
      return `Stat{ 
         +{block: local -{var} = -{expr} }, 
         `Call{ +{getmetatable(-{var}).__index}, var, unpack(indices) } } 
   end

   mlp.expr.suffix:del '[' -- remove old "[...]" suffix parser

   mlp.expr.suffix:add{ "[", gg.list{mlp.expr, separators=","}, "]", builder=index_builder } 
}

-- Test code: a metatable with __index accepting several indices --
MT = { __index = |t, ...|
         "requesting from " .. tostring(t) ..
         " index " .. table.concat({...}, ", ") }

x = setmetatable({ }, MT)

-- Use the metatable --
print (x[1])
print (x[1,2])
print (x[1,2,3])

It generates normal code for 1-dimension indices; if there are several indices, it directly calls the __index metamethod with all the indices.

What about assignment? I guess if the __newindex function knows it will have a fixed number of indices there isn't a problem, but if you don't know that you need to tack the extra indices on after the value.

Mark

--Apple-Mail-224--43222519-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 14:09:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5G9mer030902; Thu, 5 Nov 2009 14:09:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 885DB1A6F0; Thu, 5 Nov 2009 14:08:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8D301A614 for ; Thu, 5 Nov 2009 14:08:10 -0200 (BRST) Received: by ewy26 with SMTP id 26so153907ewy.5 for ; Thu, 05 Nov 2009 08:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=nEVY+cBeRvyeXbaX2gU5CC4PXARxkTGZijb/oisqLOI=; b=wd3DsE7tT9rNDqYzQSgOQMdeh8AHeLXqcaPyFAfEwotp5xmQUVP5SQ3TsKAxFhmbeE +lx9a7Z7Oz7Gf3vMXnxgVstXhVhsw53JwzukcBF9t+wXuAY7VZnYmuOOc2ClTPF+/nj9 ezf3yaPYOB76t7zh5++G3b9/uy25JyfpptDzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=CFWPxKzFFRHN2hgO2Ia6/V0sGhGGA6aQReuNvTH7QJV3vo2ij/BnEtjqSjQjoQZZ7q woW4zOPg2z2SG5I0Yza8tEXxDOnjtK6iUES4xGbNNK4+vjGDSs0NdX51etSArOzIk6Ns DG2y/UykhMrLDkUF8Qjje3NrWZYYCDUAU9U3E= MIME-Version: 1.0 Received: by 10.213.100.168 with SMTP id y40mr3864811ebn.28.1257437346459; Thu, 05 Nov 2009 08:09:06 -0800 (PST) In-Reply-To: <6F2D0FC7-1C76-42A7-B661-649E8572BF03@grubmah.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> <6F2D0FC7-1C76-42A7-B661-649E8572BF03@grubmah.com> Date: Thu, 5 Nov 2009 17:09:06 +0100 X-Google-Sender-Auth: b4538c07aa368c94 Message-ID: <956373d40911050809o5c75bc63rad7a57ce160378e7@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=00504502e2bb5cf1220477a1f293 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00504502e2bb5cf1220477a1f293 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Nov 5, 2009 at 5:00 PM, Mark Hamburg wrote: > > What about assignment? I guess if the __newindex function knows it will > have a fixed number of indices there isn't a problem, but if you don't know > that you need to tack the extra indices on after the value. > I completely overlooked the left-hand-side occurences issue :( It can be done, but it's not a 10 minutes hack then: it requires some contextual transformation in the `Set{ } nodes. -- Fabien. --00504502e2bb5cf1220477a1f293 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Thu, Nov 5, 2009 at 5:00 PM, Mark Hamburg= <mark@grubmah.com= > wrote:
What about assignment? I guess if = the __newindex function knows it will have a fixed number of indices there = isn't a problem, but if you don't know that you need to tack the ex= tra indices on after the value.

I completely overlooked the left-han= d-side occurences issue :( It can be done, but it's not a 10 minutes ha= ck then: it requires some contextual transformation in the `Set{ } nodes.

=A0=A0 -- Fabien.=A0
--00504502e2bb5cf1220477a1f293-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 14:17:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5GHXGc000624; Thu, 5 Nov 2009 14:17:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 34F281A6F6; Thu, 5 Nov 2009 14:16:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5DB51A614 for ; Thu, 5 Nov 2009 14:16:00 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA5GGxY5013736 for ; Thu, 5 Nov 2009 14:16:59 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 314EA54C1D0; Thu, 5 Nov 2009 14:16:59 -0200 (BRST) Date: Thu, 5 Nov 2009 14:16:59 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091105161659.GA28130@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'm coming again with the same help request, I would like to use > expressions where userdata are indexed with more comma-separated > values. For example, if you want to index a matrix it would be natural > to write something like: > > m[i, j] > > [...] > > I'm quite determined to change Lua to obtain this syntax extension and > I would appreciate a lot any suggestions about where to look in the > source code to understand how it works for the part I'm interested on > and make the modification right. I already have a good knowledge of > the paser but I think that I would need to make non-trivial changes in > the AST and in the way the AST is interpreted. Lua does not build an AST; it generates code on the fly. For the syntax part, you have to look at lparser.c, function 'primaryexp', case '['. But of course you must know what code you want to generate for that syntax. Do you plan to make m[i, j] the same as m[i][j]? -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 14:28:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5GSqow003852; Thu, 5 Nov 2009 14:28:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A5BD1A690; Thu, 5 Nov 2009 14:27:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-04.prod.phx3.secureserver.net (p3plsmtpa01-04.prod.phx3.secureserver.net [72.167.82.84]) by bazar2.conectiva.com.br (Postfix) with SMTP id 921B618D03 for ; Thu, 5 Nov 2009 14:27:18 -0200 (BRST) Received: (qmail 20903 invoked from network); 5 Nov 2009 16:28:14 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-04.prod.phx3.secureserver.net (72.167.82.84) with ESMTP; 05 Nov 2009 16:28:14 -0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you return multiple values? From: Mark Hamburg In-Reply-To: <87eiodpiuu.fsf@mid.deneb.enyo.de> Date: Thu, 5 Nov 2009 08:28:13 -0800 Content-Transfer-Encoding: 7bit Message-Id: <17350D00-2F61-42DF-82C1-CA5315C992C2@grubmah.com> References: <2A2CA32F-0DB8-42A6-A8D3-CF73ABED7705@fastmail.fm> <20091104200901.GA24409@inf.puc-rio.br> <6A98CF5B-0E7C-4084-87DC-E57AC9FCFF64@fastmail.fm> <790db3550911041235w249be576s9710d9179b835c23@mail.gmail.com> <87eiodpiuu.fsf@mid.deneb.enyo.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean As a specific example of doing this without closures or pack, here is a routine (from memory and without the aid of caffeine) for closing a file promptly when done even in the event of an error. local function finish( file, success, ... ) file:close() if success then return ... else error( ( ... ) ) -- Probably should adjust the stack level for the message end end function doWithOpenFile( fn, fp ) local file = assert( io.open( fp ) ) return finish( file, pcall( fn, file ) ) end I've used this enough that I wrapped the final step of the finish routine into a pcall2call function that does the appropriate level adjustment for the error return as well. You can find more examples in the archive if you search on pcall2call. I don't have a proposed syntax, but it feels like there ought to be a more natural way to deal with this and with other cases where one needs to process the results of a function returning an unknown number of arguments. The specific case here could b addressed with a variety of exception handling mechanisms, but if one wants to actually process the return arguments then one is stuck. For example, consider: local reportErrors( success, fp, msg ) if success then return end print( "error:", fp, msg ) error( msg ) end local function finish( file, fp, success, ... ) file:close() reportErrors( success, fp, ... ) print( fp, ... ) return ... end function openExtractPrintAndClose( extractor, fp ) local file, msg = io.open( fp ) reportErrors( file, fp, msg ) return finish( file, fp, pcall( extractor, file ) ) end Mark From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 14:52:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5Gq8GT009952; Thu, 5 Nov 2009 14:52:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3ED9419169; Thu, 5 Nov 2009 14:50:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C60A18814 for ; Thu, 5 Nov 2009 14:50:32 -0200 (BRST) Received: by bwz27 with SMTP id 27so183783bwz.21 for ; Thu, 05 Nov 2009 08:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kKKih1Mp3cw3q9L20sxkin+sUgpMUS+Ie/OnFrawOeo=; b=KNi+3am3yIXGILrE2C2IwyPDlUAzPi0YIfzYSVYkp1x2OUx8CfyWf0IMTacoqF9uUQ 1o6AGJfXjPc3QEzhrDuH3I03q1jL0ocJ+sBBcXn6J9rxSFQfkAm8kCZJWHz+HOArV3Sc 1DDOujoIho8Luu5KGIzGhMKBMoCq+1gV6yfLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PfS9VrxSgTJLFqQm6Bs4uuiSIQj+r+Fra/s/xg/uz+hEtbD/geugFYJHI7QgcJYRse MKdETvORmm/KOWuXKku8Ck3i+nPiYtZWcBeKSYOWnnqN86W9OFRYtJK8NX8lSwfnpqfY Q5ioeCor2FIWLItvDcwd/yUGUOGKg5PY+NLz8= MIME-Version: 1.0 Received: by 10.204.2.131 with SMTP id 3mr3203616bkj.175.1257439889470; Thu, 05 Nov 2009 08:51:29 -0800 (PST) In-Reply-To: <20091105161659.GA28130@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> Date: Thu, 5 Nov 2009 17:51:29 +0100 Message-ID: <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Roberto Ierusalimschy : > Lua does not build an AST; it generates code on the fly. For the syntax > part, you have to look at lparser.c, function 'primaryexp', case '['. > But of course you must know what code you want to generate for that > syntax. Do you plan to make m[i, j] the same as m[i][j]? Hi, I'm planning to translate the code like that: m[i, j] => __index(m, i, j) m[i, j] = v => __newindex(m, i, j, v) So all the indexes will be feeded to the __index or __newindex metamethods in the order. I guess that the variable number of arguments is not a problem: the metamethods are supposed to check how many arguments and act accordingly. The nested indexing method you was thinking about is complicated and not interesting, I think. So, for the parser modification I should be able to do it. I'm more worried about the code generation. May be is not that difficult but I will need some hints. Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 15:39:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5HUZxe018722; Thu, 5 Nov 2009 15:30:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4025191AE; Thu, 5 Nov 2009 14:58:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBADA18A87 for ; Thu, 5 Nov 2009 14:58:09 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA5Gx9ue018718 for ; Thu, 5 Nov 2009 14:59:09 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 0E92E54C1D0; Thu, 5 Nov 2009 14:59:09 -0200 (BRST) Date: Thu, 5 Nov 2009 14:59:09 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091105165909.GA28690@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'm planning to translate the code like that: > > m[i, j] => __index(m, i, j) > m[i, j] = v => __newindex(m, i, j, v) > > [...] > > So, for the parser modification I should be able to do it. I'm more > worried about the code generation. May be is not that difficult but I > will need some hints. Currently Lua does not have opcodes to do that. The calls to metamethods are done automatically by the virtual machine, there is no instruction to explicitly call a metamethod or even to get the metatable of an object. So either you modify the virtual machine, adding an extra instruction, or you will have to generate a long (and inefficient) sequence of instructions equivalent to getmetatable(m).__index(m, i, j). -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 16:36:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5IZxCL002070; Thu, 5 Nov 2009 16:36:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B66201A6F0; Thu, 5 Nov 2009 16:34:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8977E187EE for ; Thu, 5 Nov 2009 16:34:20 -0200 (BRST) Received: by bwz27 with SMTP id 27so293847bwz.21 for ; Thu, 05 Nov 2009 10:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5IXFdhlZvEqmzlj7qL92HnkgcsuZy5cuPfxo8n8UKUs=; b=f7e15Nt87hK4hogWai40K790HwQDAV33zcVLX4W8LU3s9zHA7R39FkeU9p7K/VpY7y lpd6O9Ex/OZ40C5fUP75uyS8ILPyeA/BK5bHFKEWj9KNscGd70eOwWLLoX4ElrL2jHbA HsVq678IrUM4tgerDhHor6yBNnkcn4wy0E5g8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LsbzWAb3wivgEpSz+vm2xq31e4h12y1/hPoP0tDukD8h9WCYdtwVRC0m6vTgcB+h89 jVAyLqZ4nIN64VSqk6WfEJJAhxIagjWmp2bWQlnexh0uv+ct2VpI5Mz6DODnYA5VNRfx Q8PDXiaYc86jPNy70w9jEMcibAOND48v/4SBA= MIME-Version: 1.0 Received: by 10.204.13.201 with SMTP id d9mr3434494bka.12.1257446118559; Thu, 05 Nov 2009 10:35:18 -0800 (PST) In-Reply-To: <20091105165909.GA28690@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <20091105165909.GA28690@inf.puc-rio.br> Date: Thu, 5 Nov 2009 19:35:18 +0100 Message-ID: <4ff79edb0911051035m3f3fd7b3hf6bf94ca2b429926@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Currently Lua does not have opcodes to do that. The calls to metamethods > are done automatically by the virtual machine, there is no instruction > to explicitly call a metamethod or even to get the metatable of an > object. So either you modify the virtual machine, adding an extra > instruction, or you will have to generate a long (and inefficient) > sequence of instructions equivalent to getmetatable(m).__index(m, i, j). I think I need to modify the VM, even if it can be difficult this is the only *real* solution to my problem. Could you possibly give me some hints about how should I modify the code and which functions is concerned ? Thank you very much for the help, I appreciate a lot. Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 16:50:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5IojoA006214; Thu, 5 Nov 2009 16:50:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C43FC18B1F; Thu, 5 Nov 2009 16:49:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A8F718A7F for ; Thu, 5 Nov 2009 16:49:13 -0200 (BRST) Received: by ewy26 with SMTP id 26so335708ewy.5 for ; Thu, 05 Nov 2009 10:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=mAQ5njFJu6REzjlD5b1ulbj52Kt5nDYapPOFFTRLWkI=; b=oikMHXiNJ1eUJTcNFSdE2JcbpE6+CNS+bBut/6OU/iui+OuJglbZfWqPugsmjVCBtu qlXGJrHFk8kJA/IuTza0q3btMfYbSDzS5KA1eYSnqhMBWtx0nJ2NCQPjGdOpnYmCWnc/ 6gHwKaGOp9nNBnD1jvfiTa8XepEFEIQEE8eBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=gETwRB1fWGSNbj3b9/jlL7/gA1ZSwAJhUllb+zdHukj3MGt7TgjaoRRCOEbuidApXD MrKBuyL5sMp1V2rkveCyg0ssfcmhSi9OUSzwzM+fHwCDzpJgG62WXneW81PT4GwOXw9Z vNBID9F2IExluXtY7WOOSnwqL5IVCDqKMJ660= MIME-Version: 1.0 Received: by 10.213.2.84 with SMTP id 20mr3863009ebi.46.1257447010518; Thu, 05 Nov 2009 10:50:10 -0800 (PST) In-Reply-To: <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> Date: Thu, 5 Nov 2009 19:50:10 +0100 X-Google-Sender-Auth: 3fee10f76e3a2eea Message-ID: <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=000e0ce0d4a062ea200477a43286 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0ce0d4a062ea200477a43286 Content-Type: text/plain; charset=ISO-8859-1 > > I'm planning to translate the code like that: > > m[i, j] => __index(m, i, j) > m[i, j] = v => __newindex(m, i, j, v) > Beware that translating multiple assignments might be trickier than it seems, if right-hand-side terms and/or __newindex methods have side effects: foo, bar[i,j], bar[k,l] = f1(), f2() --000e0ce0d4a062ea200477a43286 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm planning= to translate the code like that:

m[i, j] =A0 =A0 =A0 =A0 =3D> __index(m, i, j)
m[i, j] =3D v =A0 =A0=3D> __newindex(m, i, j, v)
Beware that translating multiple assignments might be trickier= than it seems, if right-hand-side terms and/or __newindex methods have sid= e effects:

foo, bar[i,j], bar[k,l] =3D f1(), f2()

--000e0ce0d4a062ea200477a43286-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 16:53:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5IrPRR006826; Thu, 5 Nov 2009 16:53:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06A6318C14; Thu, 5 Nov 2009 16:52:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-vw0-f204.google.com (mail-vw0-f204.google.com [209.85.212.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E17C18B7A for ; Thu, 5 Nov 2009 16:52:00 -0200 (BRST) Received: by vws42 with SMTP id 42so139076vws.11 for ; Thu, 05 Nov 2009 10:52:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.125.87 with SMTP id x23mr3957731vcr.55.1257447178389; Thu, 05 Nov 2009 10:52:58 -0800 (PST) Date: Thu, 5 Nov 2009 10:52:58 -0800 Message-ID: <9ee46f950911051052x7c0ef831n8aec3cb05da2e7e1@mail.gmail.com> Subject: [Job] Wiki Administrator job - Lua knowledge a huge plus! From: "Becky H." To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA5IrPRR006826 ROBLOX is a virtual world and building game for kids, and our users are passionate about sharing their ideas and helping each other. The players build their own worlds and script them to life with Lua! This job is part community manager, part wiki sysop, and part Lua expert. I am hoping someone on this list is the right fit. :) http://sfbay.craigslist.org/pen/web/1414256964.html Check out www.roblox.com and search Youtube for "Roblox scripting" The wiki is a vital part of our website, both a resource for new users and an outlet for experienced users to share their knowledge. Because most of our users are kids and teens we have the interesting job of making our wiki highly informational, yet usable and interesting for users aged 7-15. We are continually adding new features and want to start using the wiki more as our game grows more complex. We need someone to take charge of our wiki and do the following: - Serve as chief editor - Create a new wiki front page - Revamp and maintain key editorial pages - Organize volunteers around topics that need the most work - Assist, mentor, and monitor community editors - Identify needed wiki features and help implement them - Evangelize the wiki throughout the community We’re looking for someone who has experience with wikis, with preference to applicants with prior editorial experience. Experience with kid-targeted content would be a plus – our wiki has to be useful to all our users, aged 7-15 and beyond. Lua knowledge is a huge plus! We expect an initial “revamp” phase of 10-30 hours (over 2 to 3 weeks), followed ongoing editorial and management work of 5 to 10 hours per week. Send queries and resumes to job-qhv5h-1414256964@craigslist.org Remote work is possible, for awesome candidates. -Becky From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 17:07:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5Ixjj6008357; Thu, 5 Nov 2009 16:59:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68F3B1A6F1; Thu, 5 Nov 2009 16:58:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 1EBD819294 for ; Thu, 5 Nov 2009 16:58:15 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 05 Nov 2009 12:45:24 -0600 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Nov 2009 13:59:11 -0500 Message-ID: <4AF3207F.1030600@elbitsystems-us.com> Date: Thu, 05 Nov 2009 13:59:11 -0500 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: help to (slightly) modify Lua interpreter References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> In-Reply-To: <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Nov 2009 18:59:12.0006 (UTC) FILETIME=[0FDAAA60:01CA5E4A] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Francesco Abbate wrote: > I better thought about this problem and the __call metamethod does not > make the affair since, for assignments, the syntax: > m(i,j) = value > will be invalid. I've gotta get your GSL shell installed. I wrote a similar thing a few years back but I never followed through to the end. I had to ditch GSL anyway due to its license (which I mistakenly thought was LGPL when I started the project). But I kept the Lua part, switching to another vector/matrix package. Well, you've inspired me to do some crazy coding. I use the __call metamethod on a tensor (matrix of possibly more dimensions) to return an element-reference object whose own __call metamethod allows access to the element. I also provide set() and get() functions may be used for the element-reference object. Finally, just for fun, I overload __index and __newindex to get or set the element, but that requires a dummy index. Below is the bottom portion of the code, followed by a run. The full code follows that. I like the way that recursion, varargs and the metamethods work together. A fuller code base would have checks on the dimensions of items so that sub-tensors could be set, etc. Enjoy! -- Here we go... p = tensor(2,3,4) print(p:tostring()) -- Using call interface. p(2,3,4)(234) -- __call with a value sets the element. print(p(2,3,4)()) -- __call without a value gets the element. print(p:tostring()) -- Using a dummy index to set/get values: local _ = true -- Can be anything except nil. p(1,2,3)[_] = 123 print(p(1,2,3)[_]) print(p:tostring()) -- Using set/get directly. p(1,2,2):set(122) print(p(1,2,2):get()) print(p:tostring()) Output: {{{0,0,0,0},{0,0,0,0},{0,0,0,0}},{{0,0,0,0},{0,0,0,0},{0,0,0,0}}} 234 {{{0,0,0,0},{0,0,0,0},{0,0,0,0}},{{0,0,0,0},{0,0,0,0},{0,0,0,234}}} 123 {{{0,0,0,0},{0,0,123,0},{0,0,0,0}},{{0,0,0,0},{0,0,0,0},{0,0,0,234}}} 122 {{{0,0,0,0},{0,122,123,0},{0,0,0,0}},{{0,0,0,0},{0,0,0,0},{0,0,0,234}}} The full code: function elem_ref_set(ref, val) ref.t[ref.i] = val return val end function elem_ref_get(ref) return ref.t[ref.i] end elem_ref_mt = { __index = function (t, k) if k == 'get' then return elem_ref_get end if k == 'set' then return elem_ref_set end return t.t[t.i] end, __newindex = function (t, k, v) t.t[t.i] = v end, __call = function (t, val, ...) if val == nil then return t.t[t.i] end t.t[t.i] = val return val end } function elem_ref(t, i, ...) if type(t[i]) ~= 'table' then return setmetatable({ t = t, i = i }, elem_ref_mt) end return elem_ref(t[i], ...) end function tensor_tostring(m) if type(m) ~= 'table' then return tostring(m) end local t = { "{" } for i, row in ipairs(m) do if i > 1 then t[#t+1] = "," end t[#t+1] = tensor_tostring(row) end t[#t+1] = "}" return table.concat(t) end tensor_mt = { __call = function (m, ...) return elem_ref(m, ...) end, __index = { tostring = tensor_tostring }, } function tensor_new(_,N,...) if not N then return 0 else local m = {} for i = 1, N do m[i] = tensor_new(_, ...) end return setmetatable(m, tensor_mt) end end -- This is for creation of tensors. This has nothing to do -- with setting/getting elements. tensor = setmetatable({}, { __call = tensor_new }) -- Here we go... p = tensor(2,3,4) print(p:tostring()) -- Using call interface. p(2,3,4)(234) -- __call with a value sets the element. print(p(2,3,4)()) -- __call without a value gets the element. print(p:tostring()) -- Using a dummy index to set/get values: local _ = true -- Can be anything except nil. p(1,2,3)[_] = 123 print(p(1,2,3)[_]) print(p:tostring()) -- Using set/get directly. p(1,2,2):set(122) print(p(1,2,2):get()) print(p:tostring()) ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 17:12:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5JAT9i011249; Thu, 5 Nov 2009 17:10:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DCBD192C1; Thu, 5 Nov 2009 17:09:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C99D192A7 for ; Thu, 5 Nov 2009 17:08:55 -0200 (BRST) Received: by ewy26 with SMTP id 26so358007ewy.5 for ; Thu, 05 Nov 2009 11:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=kY6ny6rYeHaSGfitAh61ZqtmKGPFwBoQGt1dzn55hsg=; b=Uotzd2QZTb8D9kmZynQr89lRUKdrs5HdOWoCpf2MJpcBLffvA8juRQXwbqMEyvm72D 882rts98pronyG3gYaOEGT46NoakUnHN6bY6LbRvguyyHoEhlUb6zVdEZ/EdEy/9sMOt DGscQ+XeimJi6WsqvqMcIfLv1r5wHmncmuX98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=KvZIHu6eeXO4bfJ6OWlNCpZrDknsbxcxJBAb3y+dPCNNF8lCaBtW4e+sBk9lJpSbBF D6lxbAyuvw0Pq47tnhRXyMLe8SgyMfXr9LHw2Ckr9mRq3YNF/2itbJg9He6axzkfm31C iKjJlJYd4/b0c+Lr4zHvmpwIX01DM0wHBCBKU= MIME-Version: 1.0 Received: by 10.216.89.209 with SMTP id c59mr963565wef.181.1257448194121; Thu, 05 Nov 2009 11:09:54 -0800 (PST) In-Reply-To: <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> From: Jerome Vuarand Date: Thu, 5 Nov 2009 20:09:34 +0100 Message-ID: <89d273ba0911051109y20f15dcdy2c7df0dcef6dcebd@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Francesco Abbate : > 2009/11/5 Fabien : >> In metalua: >> -- Metalua extension -- >> -{ block: > [...] >> x = setmetatable({ }, MT) >> -- Use the metatable -- >> print (x[1]) >> print (x[1,2]) >> print (x[1,2,3]) >> It generates normal code for 1-dimension indices; if there are several >> indices, it directly calls the __index metamethod with all the indices. >> -- Fabien > > Thank you very much Fabien, that looks great. I really need to improve > my knowledge of Metalua since it is an excellent tool. > > The only problem is that if I adopt this solution I will be forced to > run GSL shell through Metalua instead of Lua. This will add a > significant level of complexity that will be, at the end, unjustified. > > So, I'm going to test your solution, it is a really smart proposition, > but still I would like to adopt the option of changing Lua itself. > > So, I still need the help of the Lua hackers :-) If you don't mind modifying Lua itself, why can't you use Metalua ? What's the difference between a patched Lua and Metalua ? From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 17:22:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5JMGPN013790; Thu, 5 Nov 2009 17:22:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B008819324; Thu, 5 Nov 2009 17:20:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B4E1192B3 for ; Thu, 5 Nov 2009 17:20:47 -0200 (BRST) Received: by bwz27 with SMTP id 27so342466bwz.21 for ; Thu, 05 Nov 2009 11:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=IXpZ+MOvfA90oJlCNJGXRDzPVTfDvtHyDDz0ni/IUhg=; b=eB6Hc7ezZE4LqVFh3Gb2C5Km7tQTDOKHgeuvz1yWa6qYD8c6HTchPVLVckDBu+jv9C RidmcluN1n0ouKLf7R46eGmz37RJ5czNINz1pNxCKJ5LsZXf/6RKdRIJBqAcltWP4psQ PvL8yWF5SxBNHSBnvSuFpi+yhFVxcNLy5g1VI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=aEOGfpBo58yswG52R0HnKf0uZ6Prps+uEWfvRkGcWjxyl2dKf/spSqajqu8fTQbiPK UMKR766ot+jFzXOhBCuue4JFWufPYCaqIA5GM/KmOr15/S30dJ/vnZirPC0Utimn6G7o wOTm8k8S3QiDPg+1cqecEDe1WuqAW0SBDeWI4= MIME-Version: 1.0 Received: by 10.204.153.3 with SMTP id i3mr3589246bkw.26.1257448904760; Thu, 05 Nov 2009 11:21:44 -0800 (PST) In-Reply-To: <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> Date: Thu, 5 Nov 2009 20:21:44 +0100 Message-ID: <4ff79edb0911051121t55c9960al8ddcfae88a3bf41@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA5JMGPN013790 2009/11/5 Fabien : >> I'm planning to translate the code like that: >> >> m[i, j]         => __index(m, i, j) >> m[i, j] = v    => __newindex(m, i, j, v) > > Beware that translating multiple assignments might be trickier than it > seems, if right-hand-side terms and/or __newindex methods have side effects: > foo, bar[i,j], bar[k,l] = f1(), f2() I'm sorry but I don't understand. Could you explain better your point ? Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 17:34:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5JYcpY017412; Thu, 5 Nov 2009 17:34:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48D8A1A614; Thu, 5 Nov 2009 17:33:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D09811A66E for ; Thu, 5 Nov 2009 17:33:06 -0200 (BRST) Received: by bwz27 with SMTP id 27so355085bwz.21 for ; Thu, 05 Nov 2009 11:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=s9C1iYNOM4UJ2ULfxAxJwkqCw8jeniLCG/bMk7QVEJg=; b=ATIcXSj67YeSP2kGUv6Y6WZAXu2DnwqkNco0P/QSHAqRsUEs4DnvcZ0F5Bf7PMMzDM 9erdg4St884qLmlGi2TfxRX48FCw8cfic8uN4t1+oThyzKfs4txeCSQHAuaLx4O6E9li 5KkQ+VOu5xtJ/zmrK9gkVkdOOOB4V9L0YKVx8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=oCUSaz8ZhgB1EIGjYFFNBE6AUGN8yiCiqdJEmZALfk64tZYcM2z2tcNDIv/JQ8gODd poVwKaN9G8zzJFfq704OHik6hLKwXjBKQwOc4+JQpZAvWzKRkzV5hw2AIIgVRq77fNez yqJ3LUaaYEFeeknfRtifHx2O0TIgRxXuIBTZE= MIME-Version: 1.0 Received: by 10.204.5.207 with SMTP id 15mr3540273bkw.89.1257449643795; Thu, 05 Nov 2009 11:34:03 -0800 (PST) In-Reply-To: <4AF3207F.1030600@elbitsystems-us.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> <4AF3207F.1030600@elbitsystems-us.com> Date: Thu, 5 Nov 2009 20:34:03 +0100 Message-ID: <4ff79edb0911051134r4d3541a2gd4dd50ede4747b22@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Doug Rogers : > I've gotta get your GSL shell installed. I wrote a similar thing a few > years back but I never followed through to the end. I had to ditch GSL > anyway due to its license (which I mistakenly thought was LGPL when I > started the project). But I kept the Lua part, switching to another > vector/matrix package. Well, if you want to help me with GSL shell I'm open to accept collaborators ;-) actually I'm looking for people to help me. Otherwise, GPL license is great and I'm not planning to make money with it. > Well, you've inspired me to do some crazy coding. I use the __call > metamethod on a tensor (matrix of possibly more dimensions) to return an > element-reference object whose own __call metamethod allows access to > the element. I also provide set() and get() functions may be used for > the element-reference object. Finally, just for fun, I overload __index > and __newindex to get or set the element, but that requires a dummy index. I've given a look to your code. The idea is not bad but still, it is a trick, a workaround to the problem that index takes just one argument. My point is to have a plain simple syntax, nothing tricky or awkward. For the moment I will stick to the slogan "simple is beautiful" :-) Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 18:32:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5KWm10030023; Thu, 5 Nov 2009 18:32:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8A5518A58; Thu, 5 Nov 2009 18:31:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A87D18866 for ; Thu, 5 Nov 2009 18:31:11 -0200 (BRST) Received: by bwz27 with SMTP id 27so415548bwz.21 for ; Thu, 05 Nov 2009 12:32:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GB/U1jc8mprkOyrd/Okp3akkcbnSpCN8Z8QXZu05uEg=; b=coYkbr76RKpvvwM/7OQRJRQyntQoXvkZ6OWluMsGPbJ/f60eA9A3+FBUuPuv/WnQGe SQ7XyB/bABGqjd5+m+PNETaSiLcfRHQeCaDFMsbOcbqyKpegXSegGmRDJwRxwQN9lq3X fSLmmZ9h3Mb/bUXWPbJbYBUuHEpm25/AqLV7g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZU2ByidFe5GN8ujtcZZelWqKD1/bWppAWy8fU5KMDGUKTU3Umm6xpW7DweeB8UQcVd B935/qE4xSwknkhWNDRb0f9KSx25CP94IenxWwR3w9m2DMvaOFbmUCHBZsR3n8eodaYP Zy+pyWszAV1txZHHJfpwCED9b7AnbVNNNXnxM= MIME-Version: 1.0 Received: by 10.204.15.16 with SMTP id i16mr3653138bka.72.1257453128785; Thu, 05 Nov 2009 12:32:08 -0800 (PST) In-Reply-To: <89d273ba0911051109y20f15dcdy2c7df0dcef6dcebd@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> <89d273ba0911051109y20f15dcdy2c7df0dcef6dcebd@mail.gmail.com> Date: Thu, 5 Nov 2009 21:32:08 +0100 Message-ID: <4ff79edb0911051232o330f82faxc1a704aad420767c@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Jerome Vuarand : > If you don't mind modifying Lua itself, why can't you use Metalua ? > What's the difference between a patched Lua and Metalua ? Well, I could use Metalua, this is something that I will take into consideration, but using it will add a significant layer of complexity to my software. In fact, metalua allows you to modify Lua as your need even at runtime but this is not really needed in my case since I want a simple modification of Lua to be used over and over, always the same. So, I think that a change in Lua will be justified, the only problem could be the technical difficulty of implementing this change. In addition I think that the Lua code base is more mature and stable than Metalua. Francesco From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 19:00:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5L0tvs002676; Thu, 5 Nov 2009 19:00:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6CA819349; Thu, 5 Nov 2009 18:59:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (efwdmzmail.efw.com [76.195.112.202]) by bazar2.conectiva.com.br (Postfix) with SMTP id 5AC5C1932B for ; Thu, 5 Nov 2009 18:59:23 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 05 Nov 2009 14:46:29 -0600 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Nov 2009 16:00:18 -0500 Message-ID: <4AF33CE0.303@elbitsystems-us.com> Date: Thu, 05 Nov 2009 16:00:16 -0500 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: help to (slightly) modify Lua interpreter References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> <4AF3207F.1030600@elbitsystems-us.com> <4ff79edb0911051134r4d3541a2gd4dd50ede4747b22@mail.gmail.com> In-Reply-To: <4ff79edb0911051134r4d3541a2gd4dd50ede4747b22@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Nov 2009 21:00:18.0222 (UTC) FILETIME=[FADB3CE0:01CA5E5A] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Francesco Abbate wrote: > Well, if you want to help me with GSL shell I'm open to accept > collaborators ;-) actually I'm looking for people to help me. > Otherwise, GPL license is great and I'm not planning to make money > with it. The license was not compatible with the project. I've since used GSL for other things, but rarely. I own a hard copy of the GSL documentation. I'll see what I can do to help. There's one thing immediately: "LUA" should be "Lua" everywhere at http://www.nongnu.org/gsl-shell/! :) I downloaded gsl-shell and ran one of the examples, so that's a start. I've got GSL 1.10 at work (Ubuntu 8.04), but it compiled and ran okay. I'll send you a message from my home address later today. > I've given a look to your code. The idea is not bad but still, it is a > trick, ... > My point is to have a plain simple syntax, nothing tricky or awkward. Agreed. 'm(1,2)(3.14159265)' is not as pretty as 'm[1,2] = 3.14159265'. But the latter comes at the cost of a non-trivial VM mod - and an excellent opportunity to learn. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 19:24:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5LOTHX006540; Thu, 5 Nov 2009 19:24:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C010D19377; Thu, 5 Nov 2009 19:23:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD8431936D for ; Thu, 5 Nov 2009 19:22:57 -0200 (BRST) Received: by gxk26 with SMTP id 26so516173gxk.1 for ; Thu, 05 Nov 2009 13:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=L8jrvR7GEK4rYfLvh1/mn1el65rXIpx40Oed54FKksM=; b=DiOwLcWvBCkuKjTCjd/gXu0ZI/+yOA8P6gyCS6Drpo0KGbbPIkJNhrdwyW69wEVWUK Y/7B5cZp8waPySanY987szrEwnPJAw3iYZTSYvdceIakiZlB12XVFn1TgCSs4W6L2vkT d7f8z9aQ6kmaHMUsSO/XUbNc7RkxIsbkycnh4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kJw3H4wgK1th6Mx7Pys7cGSFtaBXhKGwDxhIT4UY7AMkyfawUZuRJx4kpOr9Yy2pC2 9ylnsEM4vRKWJjyjKcVMyvXQXek/RYLRlxkzOboFb5OB/ABNCc9465J1yuIlE5MsNwhJ ZwS8c0N2M233E49J5rzh4hsDeb9UxoIrTt4iY= MIME-Version: 1.0 Received: by 10.101.179.5 with SMTP id g5mr1450663anp.89.1257456234474; Thu, 05 Nov 2009 13:23:54 -0800 (PST) Date: Thu, 5 Nov 2009 19:23:54 -0200 Message-ID: Subject: Passing C struct values automatically to Lua From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636c9277f2d2d600477a65850 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c9277f2d2d600477a65850 Content-Type: text/plain; charset=ISO-8859-1 Hello, I use tolua++ and I am used to passing C++ objects with tolua_pushusertype(). There are not any way of doing the same with C structs? Thanks, Danilo --001636c9277f2d2d600477a65850 Content-Type: text/html; charset=ISO-8859-1 Hello,

I use tolua++ and I am used to passing C++ objects with tolua_pushusertype(). There are not any way of doing the same with C structs?

Thanks,
Danilo
--001636c9277f2d2d600477a65850-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 21:13:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA5NDeMs020026; Thu, 5 Nov 2009 21:13:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75F7118658; Thu, 5 Nov 2009 21:12:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 00C8E1860A for ; Thu, 5 Nov 2009 21:12:01 -0200 (BRST) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id MIO71055 for ; Fri, 06 Nov 2009 10:09:55 +1100 Message-ID: <4AF35B40.4030208@infinite-interactive.com> Date: Fri, 06 Nov 2009 10:09:52 +1100 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: help to (slightly) modify Lua interpreter References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> In-Reply-To: <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Francesco Abbate wrote: > I'm planning to translate the code like that: > > m[i, j] => __index(m, i, j) > m[i, j] = v => __newindex(m, i, j, v) > > So all the indexes will be feeded to the __index or __newindex > metamethods in the order. Can you wrap the indices into their own seperate table, i.e. m[{1,2}]? The code below uses only a single __index/__newindex handler but it works for an arbitrary number of dimensions and could be modified to pass control down through the heirarchy. Mark Feldman mt = { __index = function(table, indices) if tonumber(indices) then return rawget(table, indices) else for i=1,#indices-1 do table = table[indices[i]] end return table[indices[#indices]] end end, __newindex = function(table, indices, value) if tonumber(indices) then rawset(table, indices, value) else for i=1,#indices-1 do table = table[indices[i]] end table[indices[#indices]] = value end end, } m = {} setmetatable(m, mt) m[{1}] = {} m[{2}] = {} print(m[{1}]) --> table: 00463F48 print(m[{2}]) --> table: 00463FF8 m[{1,2}] = "foo" print(m[{1,2}]) --> foo m[{3}] = {} m[{3,4}] = {} m[{3,4,5}] = "bar" print(m[{3,4,5}]) --> bar This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 22:01:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA601RLH026275; Thu, 5 Nov 2009 22:01:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D70A1A6F1; Thu, 5 Nov 2009 21:59:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE7FE192EF for ; Thu, 5 Nov 2009 21:59:53 -0200 (BRST) Received: by ewy26 with SMTP id 26so688254ewy.5 for ; Thu, 05 Nov 2009 16:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=fEc7sbpNiaOmb/eqboOmvIZe01bxCjImBHNImvRvXY8=; b=Cn5iUaUe7eOMyDRLwCSsgcdwrvkdPe3j41idgY9ZxtdJpuAtM512SnQ8j3iPQtePDW MJ8LdpJmZO/AxNRmA6j3OLg8rRtwY6834jk2EpB4zyuaunDVQzX0TkkDC3XVCVlTbQiI cDlxAFFrFdajjTAnZupuTFJM3qlPdJvipgrmE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=HJjK1Cq2RV3bE7Ko0M8Q21m9NA8vTjTiR/YWgG220Ri/HeOuaZGHPK9rmSIqCBUV8X w3rwSOVsyHWezyj3cp4/oE22r7TGo4rka9Vqw3HLvJcDilApaWj8VNgceQl0rZq3d6kI E9mioSiRLyJZ9ccjxAZvDoz/79MvzMeoeHFOk= MIME-Version: 1.0 Received: by 10.216.86.14 with SMTP id v14mr1054020wee.183.1257465651084; Thu, 05 Nov 2009 16:00:51 -0800 (PST) In-Reply-To: <4ff79edb0911051232o330f82faxc1a704aad420767c@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> <89d273ba0911051109y20f15dcdy2c7df0dcef6dcebd@mail.gmail.com> <4ff79edb0911051232o330f82faxc1a704aad420767c@mail.gmail.com> From: Jerome Vuarand Date: Fri, 6 Nov 2009 01:00:31 +0100 Message-ID: <89d273ba0911051600n4b9da32p3c09048761da900@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/5 Francesco Abbate : > 2009/11/5 Jerome Vuarand : >> If you don't mind modifying Lua itself, why can't you use Metalua ? >> What's the difference between a patched Lua and Metalua ? > > Well, I could use Metalua, this is something that I will take into > consideration, but using it will add a significant layer of complexity > to my software. In fact, metalua allows you to modify Lua as your need > even at runtime but this is not really needed in my case since I want > a simple modification of Lua to be used over and over, always the > same. So, I think that a change in Lua will be justified, the only > problem could be the technical difficulty of implementing this change. > In addition I think that the Lua code base is more mature and stable > than Metalua. The point was that Lua is not meant to be modified (at least not more than any open source project) beyond the numerous adjustment you can do in luaconf.h. Metalua on the other hand is precisely meant to help you adapt Lua syntax to your needs. Surely Metalua can do huge things, but it can also do little things, just like C can be used to write a supercomputer operating system or a keyboard firmware. And while I agree in the end your patch will be smaller than the full Metalua sources, the work you will have to do yourself may be much bigger. From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 22:52:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA60qddb032525; Thu, 5 Nov 2009 22:52:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 352F218F02; Thu, 5 Nov 2009 22:51:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECC8518ED1 for ; Thu, 5 Nov 2009 22:51:04 -0200 (BRST) Received: by ewy26 with SMTP id 26so728031ewy.5 for ; Thu, 05 Nov 2009 16:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=lSxkLH/8Q9A1Nwa69EzIWMEuq6ebd/oi7LXlJUA7AkQ=; b=Otk+0HKVgPqfQtQ+BRSOO3HmpDBPfb33D7IqjhMgMea3Cnz/9H1F9lPUsEXz7K7aqB k/8HG1ovQ89XSI+ntI413WOfVc0vFxFTzCq/LIpOcO1+v+YaNw4R0m2ft2B5rNQpLmcx eroMnvsOr7+yBqUE2y3YsDDCSeYHD/UEo/dlE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=pjrQFtWwF6HdFry0YRmiqOjHfljqAMR/V33UKpZm7ey2aXHeOT3O4Q1DPJdJ1ZM5qH 1Pj9BuK2JIDTz5TVLzkjMe5mrWJouxUUlmedsuAQV0J6dsWVeCCynF4tR8HExFJ7oSbb 5+qrAXY1SeTqPRa3WehKrnTtkpKkKvj+OH8Fs= Received: by 10.213.25.77 with SMTP id y13mr31033ebb.77.1257468722445; Thu, 05 Nov 2009 16:52:02 -0800 (PST) Received: from ?192.168.1.2? ([124.13.49.163]) by mx.google.com with ESMTPS id 5sm7724266eyh.2.2009.11.05.16.51.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Nov 2009 16:52:01 -0800 (PST) Message-ID: <4AF37327.60709@gmail.com> Date: Fri, 06 Nov 2009 08:51:51 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: help to (slightly) modify Lua interpreter References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <956373d40911050657v26522e36qbb78c936b7cf57a4@mail.gmail.com> <4ff79edb0911050725m70ac3cd7xb6cf7d5c0c79c02a@mail.gmail.com> <89d273ba0911051109y20f15dcdy2c7df0dcef6dcebd@mail.gmail.com> <4ff79edb0911051232o330f82faxc1a704aad420767c@mail.gmail.com> <89d273ba0911051600n4b9da32p3c09048761da900@mail.gmail.com> In-Reply-To: <89d273ba0911051600n4b9da32p3c09048761da900@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jerome Vuarand wrote: > 2009/11/5 Francesco Abbate: >> 2009/11/5 Jerome Vuarand: >>> If you don't mind modifying Lua itself, why can't you use Metalua ? >>> What's the difference between a patched Lua and Metalua ? >> Well, I could use Metalua, this is something that I will take into >> consideration, but using it will add a significant layer of complexity >> to my software. In fact, metalua allows you to modify Lua as your need >> even at runtime but this is not really needed in my case since I want >> a simple modification of Lua to be used over and over, always the >> same. So, I think that a change in Lua will be justified, the only >> problem could be the technical difficulty of implementing this change. >> In addition I think that the Lua code base is more mature and stable >> than Metalua. > > The point was that Lua is not meant to be modified (at least not more > than any open source project) beyond the numerous adjustment you can > do in luaconf.h. Ha ha ha, now I have coffee on my keyboard... :-) -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 23:33:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA61WwKO005324; Thu, 5 Nov 2009 23:32:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E2DC19373; Thu, 5 Nov 2009 23:31:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 544511935D for ; Thu, 5 Nov 2009 23:31:24 -0200 (BRST) Received: by bwz27 with SMTP id 27so674718bwz.21 for ; Thu, 05 Nov 2009 17:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=CpeU5IeXPINsmfU4VLfslFUkT/SC9obB6RiIvuF+AEw=; b=Zi2IZLBBmLtyYHsWTqgX89gn4FK9h12xC7p4uiZ6L3O5EAFYjw+tnCfT2SOv04HXeX f5kTvpY6OlaRY88Jz0zAu1QvE3qbg1wNzercYhCh3mqIGTPxKb8Sjgr0dXoAo+cGIBAY iAR8u2RhVuHgjKVJjv60Dgb8K5KXBKs5cSgLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=q0QenOffQBghkDxxL5/Qgs92FiKnv7AR1oBec7BnMHcIse948MNWEYlWydjl5jvKNC yGQXf1oRZFTzzNDX7aP/WULKMjHXVF/XZWB1Wt93eHea+S+65U2jBEYuBzfx+N2DE+er kwPsqjbQZQGb1LG8WvbWh8HUO+EHPTXLHvO+k= MIME-Version: 1.0 Received: by 10.204.156.25 with SMTP id u25mr3849812bkw.129.1257471141723; Thu, 05 Nov 2009 17:32:21 -0800 (PST) In-Reply-To: <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> From: Hisham Date: Thu, 5 Nov 2009 23:32:01 -0200 Message-ID: <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> Subject: Re: [ANN] LuaRocks 2.0.1 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA61WwKO005324 On Tue, Nov 3, 2009 at 6:32 AM, Geoff Leyland wrote: > The documentation on http://www.luarocks.org/en/Creating_a_rock suggests > that external dependencies work like this: > > external_dependencies = { >   LIBDATE = { >      headers = "libdate.h" >   } > } > > But that should be "header" not "headers". Fixed, thanks! But the site is a wiki, it would be probably be faster for you to just have changed it directly. :) > I agree that it's hard to know what the right thing is on OS X - perhaps > it's as simple as suggesting what you did above in the documentation.  I'm > trying make a rock for rima at the moment - once I've got through that, I > might be in a position to have more of an opinion. Cool -- thanks! -- Hisham From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 23:58:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA61w0XZ008110; Thu, 5 Nov 2009 23:58:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 415C81A695; Thu, 5 Nov 2009 23:56:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2317D193C1 for ; Thu, 5 Nov 2009 23:56:34 -0200 (BRST) Received: by iwn5 with SMTP id 5so529766iwn.11 for ; Thu, 05 Nov 2009 17:57:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.4.75 with SMTP id 11mr860103ibq.25.1257472653795; Thu, 05 Nov 2009 17:57:33 -0800 (PST) In-Reply-To: <20091105161659.GA28130@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> Date: Thu, 5 Nov 2009 20:57:33 -0500 X-Google-Sender-Auth: 350cde75a7624098 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 5, 2009 at 11:16 AM, Roberto Ierusalimschy wrote: > Do you plan to make m[i, j] the same as m[i][j]? Numeric Lua [1-3] uses the m[i][j] approach. This allows a reasonable syntax, without patching, for indexing and assignment: m[i][j] = m[j][i] Furthermore, m[i] may represent a vector and you can perform vector operations on it. The implementation is described in [3]. Internally, the matrix is a 1D array with __index/__newindex metamethods, and intermediate objects such as m[i] are lazily interned. LuaMatrix [4] also supports this syntax as a side-effect of matrices being implemented in a simple way as nested Lua tables: { {1, 2}, {3, 4} } [1] http://numlua.luaforge.net/ [2] http://bluedino.net/luapix/carvalho-numlua.pdf [3] Chapter 16 of Lua Programming Gems - http://www.lua.org/gems/ [4] http://lua-users.org/wiki/LuaMatrix From lua-bounces@bazar2.conectiva.com.br Thu Nov 5 23:59:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA61xfva008359; Thu, 5 Nov 2009 23:59:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6278E1A713; Thu, 5 Nov 2009 23:58:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E0C21A67F for ; Thu, 5 Nov 2009 23:58:20 -0200 (BRST) Received: by bwz27 with SMTP id 27so689748bwz.21 for ; Thu, 05 Nov 2009 17:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mB3LPndydU7bmn/5i/TqtyTticMJfumy/8xo7h7AHRo=; b=X3IjEQTijy26Vs16STMDhFhfuwbiETAjttR32S98NDJirY3aY0DRkFZj8+K9QPCdC3 1rqv5zp/YJpM5zqUdZDjzgs9OrO/K/Nd1+Ko5c4yFSwnndfYgouJToiUo456Anxl8yur 7GYXdi3p2ti1HH/p5hI75lrQ4cCs/8y+THRwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gVciRuz4A7xnIxlPjlVjx4wnLwVtqSI0ruXHCFUl0B/5XZEQ7/EdYEkqM/j8luzws8 6ygSp2uw54pt6cPVbKiiQlnbwbszNrBu9sj56G+Pv6h82rJBmk8LejIrq0qwVzRDAAKg XUlNCUcUJetlzSmI8GVBD1aB4gjVVbSK+f4s4= MIME-Version: 1.0 Received: by 10.239.145.136 with SMTP id s8mr377381hba.46.1257472757825; Thu, 05 Nov 2009 17:59:17 -0800 (PST) In-Reply-To: <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> Date: Thu, 5 Nov 2009 20:59:17 -0500 Message-ID: Subject: Re: [ANN] LuaRocks 2.0.1 From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA61xfva008359 Wondering about timeline for LF2 on Windows? Andrew On Thu, Nov 5, 2009 at 8:32 PM, Hisham wrote: > On Tue, Nov 3, 2009 at 6:32 AM, Geoff Leyland wrote: >> The documentation on http://www.luarocks.org/en/Creating_a_rock suggests >> that external dependencies work like this: >> >> external_dependencies = { >>   LIBDATE = { >>      headers = "libdate.h" >>   } >> } >> >> But that should be "header" not "headers". > > Fixed, thanks! But the site is a wiki, it would be probably be faster > for you to just have changed it directly. :) > >> I agree that it's hard to know what the right thing is on OS X - perhaps >> it's as simple as suggesting what you did above in the documentation.  I'm >> trying make a rock for rima at the moment - once I've got through that, I >> might be in a position to have more of an opinion. > > Cool -- thanks! > > -- Hisham > From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 00:01:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA621dRo009034; Fri, 6 Nov 2009 00:01:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9FE501A717; Fri, 6 Nov 2009 00:00:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E53C41A67F for ; Fri, 6 Nov 2009 00:00:15 -0200 (BRST) Received: by bwz27 with SMTP id 27so690799bwz.21 for ; Thu, 05 Nov 2009 18:01:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=EFVF8KboM5hIXj6++srqpqEuiiXZNIWrp+ALr1RMhQA=; b=BnV22axiIZISSih8fENTtJ5kQLSEfRfl2eYbpjlXWCdxxknpSb/1KMpa4AQu3GRjGh nwZXtflMZaLDSIJDgBDmHMK3mf4WP8BGZLDqSM9+g352IaHG+otJfHiU86eQ1KHsHgZ8 hDaoJFJLOwfQHRkAo5e8b7JhOLa5g2r5Kz3yY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WFarHQA7FgDzhh8yMwExglvfgQMgMcJCRLMe+lwefQLPMgqcgFonwkTvQM7UdpY6dI myD3ODmLhhfaBTQlnaBVJEdNbR0JeqniM4dqMoDcg46QuO1+UPmhFgmqrObHabLZlOWx bRmMm1QnRcP7KfYhtOY731SWhmo4HG5UaJwrk= MIME-Version: 1.0 Received: by 10.239.183.37 with SMTP id s37mr393737hbg.90.1257472871548; Thu, 05 Nov 2009 18:01:11 -0800 (PST) In-Reply-To: References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> Date: Thu, 5 Nov 2009 21:01:11 -0500 Message-ID: Subject: Re: [ANN] LuaRocks 2.0.1 From: Andrew Wilson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA621dRo009034 Sorry, I should have written wonder about LR 2.0 on windows, (Wonder about LuaForge 2 timeline too, but that's a lot bigger problem) Cheers. Andrew On Thu, Nov 5, 2009 at 8:59 PM, Andrew Wilson wrote: > Wondering about timeline for LF2 on Windows?   Andrew > > On Thu, Nov 5, 2009 at 8:32 PM, Hisham wrote: >> On Tue, Nov 3, 2009 at 6:32 AM, Geoff Leyland wrote: >>> The documentation on http://www.luarocks.org/en/Creating_a_rock suggests >>> that external dependencies work like this: >>> >>> external_dependencies = { >>>   LIBDATE = { >>>      headers = "libdate.h" >>>   } >>> } >>> >>> But that should be "header" not "headers". >> >> Fixed, thanks! But the site is a wiki, it would be probably be faster >> for you to just have changed it directly. :) >> >>> I agree that it's hard to know what the right thing is on OS X - perhaps >>> it's as simple as suggesting what you did above in the documentation.  I'm >>> trying make a rock for rima at the moment - once I've got through that, I >>> might be in a position to have more of an opinion. >> >> Cool -- thanks! >> >> -- Hisham >> > From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 01:00:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA630Mfh017746; Fri, 6 Nov 2009 01:00:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A4271A669; Fri, 6 Nov 2009 00:58:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50A5C1931E for ; Fri, 6 Nov 2009 00:58:47 -0200 (BRST) Received: by ywh40 with SMTP id 40so588015ywh.33 for ; Thu, 05 Nov 2009 18:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=m4ppxlM49rRmF02+YiC/t/3sZOoUGaAFMrwyk0J4Bqs=; b=wW7OCXWJ3nFt4asychMluD2S+/SNV9WxTIfY8XLPmdc9L58ve0AE5d6zxcBoLDkjqc QnqemCZxkgl2DSVwp4VeX1UuJuSslCmnd712T21faZczd9L0OHZS+Jr0cVzmEXv5ORXE ZXEN8aEcsqL8sgxwJUvg9qmwAenjYa/VFmwyM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Q0xYaUdAc+/jsY001AXHRECKFHENVtis61wwDgWv2aTFudoQ9a6krMcA28AZh4pyJo HdSUP9D+C82hPA3xpgDL0rb3fVd44xnKIRtaPdELm3MKPA5RL19gTu+EmBDT8GX6wUA8 YR1qmClq+iohDb0Wk72wzE49fGDt5U0hu9HFc= MIME-Version: 1.0 Received: by 10.101.10.6 with SMTP id n6mr3643345ani.17.1257476385029; Thu, 05 Nov 2009 18:59:45 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Nov 2009 00:59:45 -0200 Message-ID: Subject: Re: Passing C struct values automatically to Lua From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=0016e68eef783e3e470477ab09c1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68eef783e3e470477ab09c1 Content-Type: text/plain; charset=ISO-8859-1 Hi all, Answering my own question and asking another one. First if you have a similar problem as I had before, try changing the names of the variables inside the struct and see if the tolua++ parser works. It worked for me using tolua_pushusertype(). Second, Is there anyway of knowing inside a lua script, automatically the name of the script itself. I would like to have something like in bash shell, where the first argument is the name of the program called. In Lua is there a way to get the value passed to lua_pcall() inside the script called, in order to know its own name automatically? Thanks in advance, Danilo 2009/11/5 zweifel > Hello, > > I use tolua++ and I am used to passing C++ objects with > tolua_pushusertype(). There are not any way of doing the same with C > structs? > > Thanks, > Danilo > --0016e68eef783e3e470477ab09c1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

Answering my own question and asking another one.

Fi= rst if you have a similar problem as I had before, try changing the names o= f the variables inside the struct and see if the tolua++ parser works. It w= orked for me using tolua_pushusertype().

Second, Is there anyway of knowing inside a lua script, automatically t= he name of the script itself.

I would like to have something like i= n bash shell, where the first argument is the name of the program called. I= n Lua is there a way to get the value passed to lua_pcall() inside the scri= pt called, in order to know its own name automatically?

Thanks in advance,
Danilo

2009/11/= 5 zweifel <zweife= l@gmail.com>
Hello,

I use tolua++ and I am used to passing C++ objects with tolua= _pushusertype(). There are not any way of doing the same with C structs?
Thanks,
Danilo



--0016e68eef783e3e470477ab09c1-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 01:52:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA63qKPt023596; Fri, 6 Nov 2009 01:52:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B952B19370; Fri, 6 Nov 2009 01:50:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C50BE1932B for ; Fri, 6 Nov 2009 01:50:53 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id E2CD3BDA70 for ; Thu, 5 Nov 2009 22:51:49 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 05 Nov 2009 22:51:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=FzLgNwfxeqTSPIsjaiEodEZAzsk=; b=GXQfE08Tukha6gMSpDepbn8XWt4MhLZw18eL2+JbR/cWXUm8953W8Vx4Dmdufw/EvLrizBaOD2xQ+G4gTLBhzfeKQ4qIlEirkWmqsnOw6++DKJmDJCnuQfyVjvO10n6ZAL+U5ou6SDAcutSf7U3ML5e3eYphwn8M4HhrpOQkVes= X-Sasl-enc: p9xWBRLQkYgSwgCNS51/NIMQAtLigzRfkaWYO15R+qm3 1257479509 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 203D94A6F60 for ; Thu, 5 Nov 2009 22:51:48 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaRocks 2.0.1 From: Geoff Leyland In-Reply-To: <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> Date: Fri, 6 Nov 2009 16:51:15 +1300 Content-Transfer-Encoding: 7bit Message-Id: <40FCAD91-62C2-4681-A3F3-7510B2F62BDC@fastmail.fm> References: <5e7d91620910270948q1407f731yf3f0f027688a9593@mail.gmail.com> <5e7d91620911021941n580a60cr96a88e4ac1f1160a@mail.gmail.com> <4233B3A7-3E05-4DAC-9951-CD9346044944@fastmail.fm> <5e7d91620911051732s6abe0a60v74c220cc6d940cee@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 6/11/2009, at 2:32 PM, Hisham wrote: > On Tue, Nov 3, 2009 at 6:32 AM, Geoff Leyland > wrote: >> The documentation on http://www.luarocks.org/en/Creating_a_rock >> suggests >> that external dependencies work like this: >> >> external_dependencies = { >> LIBDATE = { >> headers = "libdate.h" >> } >> } >> >> But that should be "header" not "headers". > > Fixed, thanks! But the site is a wiki, it would be probably be faster > for you to just have changed it directly. :) Thanks, and noted. I'll take the initiative if I spot anything else - but I'll also let you know what I did. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 03:20:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA65K87B032393; Fri, 6 Nov 2009 03:20:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E588F1A697; Fri, 6 Nov 2009 03:18:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp28.orange.fr (smtp28.orange.fr [80.12.242.99]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E77E5192DD for ; Fri, 6 Nov 2009 03:18:35 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2802.orange.fr (SMTP Server) with ESMTP id B5F8E80000A0 for ; Fri, 6 Nov 2009 06:19:31 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2802.orange.fr (SMTP Server) with ESMTP id A985780000A1 for ; Fri, 6 Nov 2009 06:19:31 +0100 (CET) Received: from o (AToulouse-553-1-158-121.w92-156.abo.wanadoo.fr [92.156.230.121]) by mwinf2802.orange.fr (SMTP Server) with ESMTP id 5C60E80000A0 for ; Fri, 6 Nov 2009 06:19:31 +0100 (CET) X-ME-UUID: 20091106051931378.5C60E80000A0@mwinf2802.orange.fr Date: Thu, 5 Nov 2009 21:32:39 +0100 From: spir To: *lua Subject: bottom-up processing Message-ID: <20091105213239.11871dec@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I'm new to Lua and the list. Jump on the opportunity to comment and ask about the following: Roberto Ierusalimschy wrote: > Lua does not build an AST; it generates code on the fly. I'm rather surprised to read this. Thought, actually, that I was the only one to use such an approach for big jobs like that. I have never read about the topic, but anyway my knowledge in computer science lies at the zeroth level ;-) I'd like to know how the method used in Lua code generation compares to the following: * Each pattern possibly assign a "post-parse node action" (or several) to each node they will generate. * This action transforms the node (or rather its data), including possibly collapsing whole branches into what becomes a simple leaf. * That way, each node is responsible to pass itself in the most convenient form to higher levels. This method is incredibly easy and powerful. Usually, it will not only help converting or restructuring nodes or branches, instead directly produce the desired result, be it returning a computed value or performing an action such as writing xhtml from wiki lang. I call that "bottom-up processing", mirroring "top-down parsing". In a personal parsing tool (in python), I use it intensively to generate parsers. The meta-grammar specifies such actions so that the meta-parser does all the job -- actually the generator itself is a func of ~ 15 lines mainly instantiating a result parser with proper params. A node action to write the line of code for a repetitive pattern may look like this (I write in python, for I don't know yet matching lua idioms): def repetitionExpression(node): (pattern, min, max) = node.data params = "%s, %s, %s" % (pattern, min, max) node.data = "Repetition(%s)" % params This works because the func can rely on the fact that child node have already transformed themselves as expected -- recursively. Using nearly the same expression, I can alternatively transform a whole grammar into a mega-pattern, a kind of giant regex, instead of a set of patterns, simply by inserting the expression of sub-patterns instead of a reference to them. To be more concrete, a parser for (arbitrary complex) expression evaluation could directly yield results using node actions as complicated as: def negate(node): node.data = - node.data def doAdd(node): (op1,op2) = node.data node.data = op1 + op2 def writeVar(node): (name,value) = node.data state.vars[name] = value def readVar(node): name = node.data node.data = state.vars[name] ... Then the top node is a leaf containing the result... provided the source is correct. There are a bunch of standard node actions to restructure a parse tree. Eg a 'negation' would yield a node that looks like negation:[NEG, op]. I get rid of NEG setting 'drop' on its pattern, and 'extract' unnests the operand, so as to return negation:op. I also often use node actions to write metadata on a node itself, while the said data is still at hand. Before using this method, I long tried the hard way of walking parse trees, from outside and from the top. Well, sorry if all of this is well-known to the ones of you possibly interested in the topic. The opportunity was too tempting. I'd really love pointers if any. But above all, I'm really curious about the method used in Lua to generate code while parsing. Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 03:23:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA65N3wH032656; Fri, 6 Nov 2009 03:23:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B39131A6AC; Fri, 6 Nov 2009 03:21:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86A66192E7 for ; Fri, 6 Nov 2009 03:21:42 -0200 (BRST) Received: by bwz27 with SMTP id 27so782479bwz.21 for ; Thu, 05 Nov 2009 21:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=TNXpkVOK1bys9MsHU36RVkWGgScvlWu+ad9puDkZukI=; b=D+PeAJyS8WiokLwv3TNzHGCr8Ving8RNbdTzZnicbwIOUqLHCxopGPYthFws1fA2or y5fMqcaAQffWLPRAVsvLzX3Pw+xuMQ2TMBi5IOsTfm/tqzdp7/PXJ9TtfeRAIH4ReXom J9RWRiccpmXWf/Fouaj1JFLBAn41lNaIDdrHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MmKhCqj+aAPY60DGY5P5xbeRNberlSs30DvzbCMqvvvOeZgz80UfYPz0fDYC4GsGvy fo0Y1DMpj1tD3njZAyPe+sDdTTH8P2nLC1z/Uh8iwDXiCPcCBvbjiqdFmp96MhIfUeco oUYZVdNOgQhQ6ADWs616Wl563qcm3GUbmWYFk= MIME-Version: 1.0 Received: by 10.239.130.150 with SMTP id 22mr338450hbj.59.1257484959701; Thu, 05 Nov 2009 21:22:39 -0800 (PST) In-Reply-To: <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> Date: Fri, 6 Nov 2009 07:22:39 +0200 Message-ID: <560972290911052122y53e2d02bqcfea2b16dd6e4071@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 5, 2009 at 8:50 PM, Fabien wrote: > Beware that translating multiple assignments might be trickier than it > seems, if right-hand-side terms and/or __newindex methods have side effects: > foo, bar[i,j], bar[k,l] = f1(), f2() This is in fact the case that makes this so non-trivial. It is not difficult to do a token-filter that copes with the difference between A[i,j] and A[i,j] = value, but multiple assignment needs a proper AST transformation. A valid concern in this case is that A[i,j] has to be as fast as possible. David's A[i][j] is perhaps the most natural way to wrap a Lua multidimensional table (as in C) but not if you are hooking into an API that provides a get(), probably using index calculation. (Then A[i] has to be some intermediate object; the old problem of temporaries) From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 03:24:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA65OIC8000322; Fri, 6 Nov 2009 03:24:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4D9B1A722; Fri, 6 Nov 2009 03:23:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1358B1A6A8 for ; Fri, 6 Nov 2009 03:22:59 -0200 (BRST) Received: by bwz27 with SMTP id 27so782923bwz.21 for ; Thu, 05 Nov 2009 21:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=S8+Atlz+BdRbu7XJa6YyMWnaJ6Vo2nhinal0tM4FUr4=; b=kV9HOTg29KfrLe6YWOZwoiSZXGeYCxNnt3HbF1PcXHESl79mf8U2Ri+x0bsp/jdu3X 0BxiZ6fB3cRK341+Us0NjPQ0TCfD4Nd4zxRrmWiL8t759puUnEV9zOANdJQNoRW3vDZW k83togKD0+EecqxMlhtP63BCEYFEapxRfSR6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=chI26rW8bnIl2QJzGBR20W+AgSLpPOY46TDSA/PjGn36IliSoDaqssm94A8eDWwj04 f3UA13SUuH2lbLzI1nX/jyZnQt8CrdOiV0Ezovm2ELwke/gfdrLj8bGj18paLCgOEKCW BqpM/ckQG3HKDBJax0PAgC9pF5KlO8Rna6HKM= MIME-Version: 1.0 Received: by 10.239.184.157 with SMTP id y29mr439243hbg.54.1257485036531; Thu, 05 Nov 2009 21:23:56 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Nov 2009 07:23:56 +0200 Message-ID: <560972290911052123g615934b3i8bcd2c0cafb69bd8@mail.gmail.com> Subject: Re: Passing C struct values automatically to Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 4:59 AM, zweifel wrote: > Second, Is there anyway of knowing inside a lua script, automatically the > name of the script itself. Have a look at the value of arg[0], it is exactly what you need. You may have to strip off the directory part. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 06:49:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA68nhYd021906; Fri, 6 Nov 2009 06:49:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9DF571A670; Fri, 6 Nov 2009 06:48:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sonic.mat.ucsb.edu (sonic.mat.ucsb.edu [128.111.221.122]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 56AC719399 for ; Fri, 6 Nov 2009 06:48:12 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sonic.mat.ucsb.edu (Postfix) with ESMTP id E0B352F752A; Fri, 6 Nov 2009 00:49:09 -0800 (PST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by amavisd-new using ClamAV at mat.ucsb.edu Received: from sonic.mat.ucsb.edu ([127.0.0.1]) by localhost (sonic.mat.ucsb.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Anr9g9X8z72Y; Fri, 6 Nov 2009 00:49:09 -0800 (PST) Received: from [192.168.1.104] (ResNet-35-220.resnet.ucsb.edu [169.231.35.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sonic.mat.ucsb.edu (Postfix) with ESMTP id D12AD2F74DB; Fri, 6 Nov 2009 00:49:08 -0800 (PST) Message-Id: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> From: Graham Wakefield To: Lua list Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: it's a shame about voodoopad Mime-Version: 1.0 (Apple Message framework v936) Date: Fri, 6 Nov 2009 00:49:07 -0800 X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean http://flyingmeat.com/voodoopad/docs/scripting.html Scripting in VoodooPad There are two ways to script VoodooPad. There's the traditional approach with AppleScript, or you can use two other great programming languages- Python and Lua. If you aren't really familiar with either of these languages, we'd prefer you to pick Python*. Lua is great, but Python has a lot more momentum behind it as well as a lot more documentation. ... * In a future release of VoodooPad (think something along the lines of a hypothetical VoodooPad 6), we'll be taking out the Lua support. You'll be able to download a plugin to continue to use your legacy scripts in Lua, but we'll no longer officially support it. So now is a good time to look and see what it would take to move your scripts to Python. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 06:53:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA68rgnx022335; Fri, 6 Nov 2009 06:53:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B91581A67D; Fri, 6 Nov 2009 06:52:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s62.bay0.hotmail.com (bay0-omc3-s62.bay0.hotmail.com [65.54.246.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECD8D193A0 for ; Fri, 6 Nov 2009 06:52:19 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s62.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 6 Nov 2009 00:53:18 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Fri, 6 Nov 2009 08:53:17 +0000 Message-ID: <4AF3E3F6.4090609@my.erau.edu> Date: Fri, 6 Nov 2009 03:53:10 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: it's a shame about voodoopad References: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> In-Reply-To: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Nov 2009 08:53:18.0678 (UTC) FILETIME=[95FEC760:01CA5EBE] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Graham Wakefield wrote: > http://flyingmeat.com/voodoopad/docs/scripting.html > > Scripting in VoodooPad > > There are two ways to script VoodooPad. There's the traditional > approach with AppleScript, or you can use two other great programming > languages- Python and Lua. If you aren't really familiar with either > of these languages, we'd prefer you to pick Python*. Lua is great, > but Python has a lot more momentum behind it as well as a lot more > documentation. > > ... > > * In a future release of VoodooPad (think something along the lines of > a hypothetical VoodooPad 6), we'll be taking out the Lua support. > You'll be able to download a plugin to continue to use your legacy > scripts in Lua, but we'll no longer officially support it. So now is > a good time to look and see what it would take to move your scripts to > Python. > Despite the fact that I can't really change their decision, especially without giving hard facts, I find it interesting to point out that they seem to be going in the exact opposite direction as everyone else. I personally feel (and a few coworkers have brought this up too, independently) that Lua is rapidly replacing Python as the premier choice in embedded scripting languages for applications. Why they are choosing to move back to Python seems to be beyond me. In fact, based off your quote (I haven't done research myself), it seems to be based mostly off a personal opinion and off no hard facts whatsoever. But if that's what they want, then by all means, it's their decision. ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 07:06:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6967bo023622; Fri, 6 Nov 2009 07:06:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78F411909C; Fri, 6 Nov 2009 07:04:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DC3319027 for ; Fri, 6 Nov 2009 07:04:45 -0200 (BRST) Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id nA695fcP022301; Fri, 6 Nov 2009 18:05:41 +0900 (JST) Received: from relay31.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay21.aps.necel.com with ESMTP; Fri, 6 Nov 2009 18:05:41 +0900 Received: from dhlpc061 ([10.114.114.32] [10.114.114.32]) by relay31.aps.necel.com with ESMTP; Fri, 6 Nov 2009 18:05:40 +0900 Received: by dhlpc061 (Postfix, from userid 31295) id 9C36152E1E9; Fri, 6 Nov 2009 18:05:40 +0900 (JST) From: Miles Bader To: "Matthew P. Del Buono" Subject: Re: it's a shame about voodoopad References: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> <4AF3E3F6.4090609@my.erau.edu> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 06 Nov 2009 18:05:39 +0900 In-Reply-To: <4AF3E3F6.4090609@my.erau.edu> (Matthew P. Del Buono's message of "Fri, 6 Nov 2009 03:53:10 -0500") Message-ID: Lines: 16 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean "Matthew P. Del Buono" writes: > But if that's what they want, then by all means, it's their decision. No reason users can't show their displeasure though. Given that they already support Lua, and multiple extension languages generally, they may decide that continuing official support for Lua is worth it after all. [There's no denying that Python, creaky and clumsy may it be, has "momentum", lots of users, libraries, etc] -Miles -- A zen-buddhist walked into a pizza shop and said, "Make me one with everything." From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 08:24:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6AOQoX000511; Fri, 6 Nov 2009 08:24:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB6071A6A6; Fri, 6 Nov 2009 08:23:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BA2D919317 for ; Fri, 6 Nov 2009 08:22:58 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1N6Lz0-0002a0-KW for lua@bazar2.conectiva.com.br; Fri, 06 Nov 2009 02:23:54 -0800 From: "Robert G. Jakabosky" To: Lua list Subject: [ANN] Emergency GC patch release 4 for Lua 5.1.4 Date: Fri, 6 Nov 2009 03:23:53 -0700 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911060223.53478.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The Emergency GC patch makes it safe to call the Lua garbage collector after a memory allocation has failed. This allows the garbage collector to free some memory so that the failed allocation can be retried. The patch also add support for setting a limit on how much memory Lua scripts can allocate. This new release fixes some more EGC related bugs. Here is the new patch: http://lua-users.org/files/wiki_insecure/power_patches/5.1/emergency_gc-5.1.4-r4.patch Here is more info about the Emergency GC patch: http://lua-users.org/wiki/EmergencyGarbageCollector -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 09:15:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6BEviH009886; Fri, 6 Nov 2009 09:14:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C1A4193AD; Fri, 6 Nov 2009 09:13:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E85B7193A4 for ; Fri, 6 Nov 2009 09:13:18 -0200 (BRST) Received: by fxm21 with SMTP id 21so174626fxm.21 for ; Fri, 06 Nov 2009 03:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yrLI94D0aRlr+ZHXDTzLkPG/9Thfd6A6qssWMjVGi6Y=; b=o6ipDUpRAI1pF58tNVM9RCfcqLnRf1opsbe8l90/MlG87rO1qF94Ra1dCcexV0Suaf SJylM+1eThlgEJ1SRpE+1G1KfkCw0ySjAvYyWVEQrELQS65nhJu4YwKLxs6NitXE1Iyn wywzsW++vuAKJWVWLVYrFWm9Si+1VVlbwxKMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=letQ/z5yVGVtw1nHFOS1dAMY0h28hZ73I4yF/i6nQXn9rPaSYuYkANvGkCoc9PACGR MVUalcARQpzbXdzCU0CcinYL9CRwFGhVWDGWb1LuLGTu53JBZ3MERyI17FJamkyZOdVf ALsWW+8JeZU62aG4ervyb+Kkr2KBZcS/GT5Gg= MIME-Version: 1.0 Received: by 10.204.15.16 with SMTP id i16mr4542709bka.72.1257506057159; Fri, 06 Nov 2009 03:14:17 -0800 (PST) In-Reply-To: <4AF35B40.4030208@infinite-interactive.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> Date: Fri, 6 Nov 2009 12:14:17 +0100 Message-ID: <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/6 Mark Feldman : > Can you wrap the indices into their own seperate table, i.e. m[{1,2}]? The > code below uses only a single __index/__newindex handler but it works for an > arbitrary number of dimensions and could be modified to pass control down > through the heirarchy. Hi Mark, thank you very much for your suggestion. Actually I've got exactly the same idea this morning, that's not bad, may be I'm going to adopt it. Otherwise, if I understand well, everyone here is saying loudly: you don't need to change Lua, please keep your dirty hands away from it!! :-) Well, I can understand that you want to preserve the original form of Lua. From my point of view I see - a technical difficulty, since a VM modification will affect many parts of the code (I guess) - the result, if I succeed, would be basically incompatible with existing Lua binaries. For the latter remark, this is already the case as I've adopted the LNUM patch to support complex numbers and the Metalua notation for direct, expression-based, functions (like |x,y| x+2*y). So I don't care to break further the compatibility since it is already broken. Please note that complex number are very important in many domains and Lua does not support them natively: this is clearly a Lua limitation and the support as user-defined data is clearly sub-optimal. So from my point of view I just see a technical difficulty in doing the change of the VM. In any case, I would appreciate a lot to have anyway some hints about how should I change the VM if I decide to do so. I understand all your remarks against Lua modification and I will keep your remarks in mind but I hope that you will give me some help anyway. Best regards, Francesco From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 09:57:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6BtGOT017770; Fri, 6 Nov 2009 09:55:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0F620192C3; Fri, 6 Nov 2009 09:53:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24DF9190FC for ; Fri, 6 Nov 2009 09:53:40 -0200 (BRST) Received: by fxm21 with SMTP id 21so186590fxm.21 for ; Fri, 06 Nov 2009 03:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hVEObd2yPHEsT4N4e01V2G+oiVmqBgAdmh7eiJa8r44=; b=DLAs/TrIvYFcTxTIwaDOBk+R2p4FDvUUzSvekGgsCn99x2xWvaCs6SRGYSoDCNRpjj ikKXUw4PR6HNcoWdAdJ4563BAVWDSbN8XgTsrkfLkjaDM6NJHMRJQOoAkcB+Jg0Ct7aY /kfqutC7W08zkdJmT2JjAPx//uXolN18Bz/jE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lAArCUwTRP9L88dZ4ivgWrj8ZW7nMdxg7C/sru0rHn7TVtFcWGapGZnc3LDt22pm9u ZN15oLidKkuu4S0fOLObx4iIaIT7Nt1c6aWx1dwBZYTHmfjD7HIbjHz0ZsyySWjdCmhF zWep0TSWuw1BLcYC3dT0D8Fk77DR7nWuB/h4o= MIME-Version: 1.0 Received: by 10.239.145.13 with SMTP id q13mr419419hba.125.1257508478588; Fri, 06 Nov 2009 03:54:38 -0800 (PST) In-Reply-To: <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> Date: Fri, 6 Nov 2009 13:54:38 +0200 Message-ID: <560972290911060354h700118b0n1c1e4c2358415a7f@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 1:14 PM, Francesco Abbate wrote: > thank you very much for your suggestion. Actually I've got exactly the > same idea this morning, that's not bad, may be I'm going to adopt it. I wonder about all the little tables created by A[{i,j}] ? Would it hurt indexing much? Only one way to find out! > Otherwise, if I understand well, everyone here is saying loudly: > you don't need to change Lua, please keep your dirty hands away from it!! People here are actually relatively relaxed about modifying Lua syntax [1], but VM compatibility is important. (OK, that issue is now a bit confused by LuaJIT 2) However, modding via token filters or Metalua _is_ easier than fooling with the parser. > For the latter remark, this is already the case as I've adopted the > LNUM patch to support complex numbers and the Metalua notation for > direct, expression-based, functions (like |x,y| x+2*y). Well, strictly speaking you have a subset, which will not break any normal Lua. The |x,y| patch is definitely something that mainline Lua could do with, since it fits with the philosophy of simple, well-understood syntactical sugar and makes the functional style less 'noisy'. steve d. [1] Compared to (say) C++. That is only done by committees that sit for decades ;) From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:09:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6C999d020520; Fri, 6 Nov 2009 10:09:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1098819389; Fri, 6 Nov 2009 10:07:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04E30192A6 for ; Fri, 6 Nov 2009 10:07:40 -0200 (BRST) MailScanner-NULL-Check: 1258114093.72786@wVtNWNqSb1wPYOa5Sj4Dyg Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA6C8CXY032207 for ; Fri, 6 Nov 2009 10:08:13 -0200 Message-ID: <4AF411BB.6050808@inconcertcc.com> Date: Fri, 06 Nov 2009 10:08:27 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Is this possible? (garbage collect and weak tables) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean module("translators", package.seeall) local translators = {} setmetatable(translators, {__mode = "v"}) local mt = {} -- If there is not a suitable translator (for the given key and language), -- create a new one and store it in a weak-valued table so it does not -- linger there for ever. mt.__index = function(tab, key) local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} --> translators[key] = translators[key] or {} local translator = translators[key][user.languageId] if not translator then translator = i18nlib.Translator{domain=key, language = user.languageId, codepage = user.codepage, transliterate=false} --> translators[key][user.languageId] = translator end return translator end setmetatable(_M, mt) A user reported the following error: shared.render.cgiluaPage: ...les\inConcert\Web\data\lua\inconcert\translators.lua:20: attempt to index field '?' (a nil value) Line 20 is the second line in the code above marked with an arrow. I guess that is possible that the GC kicks in between both marked lines, so the table I put in the weak table went away, right? Regards, Ignacio Burgueño From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:17:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6CH1Rr022032; Fri, 6 Nov 2009 10:17:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9BAD1A670; Fri, 6 Nov 2009 10:15:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B440519382 for ; Fri, 6 Nov 2009 10:15:35 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAAKj80rLO60j/2dsb2JhbACRNstthD0Eglw X-IronPort-AV: E=Sophos;i="4.44,692,1249228800"; d="scan'208";a="519361477" Received: from unknown (HELO Mania) ([203.59.173.35]) by outbound.icp-qv1-irony-out3.iinet.net.au with SMTP; 06 Nov 2009 20:16:32 +0800 Message-ID: <02911E765094496C89DD8AD7CF3E6668@Mania> From: "Alex Davies" To: "Lua list" References: <4AF411BB.6050808@inconcertcc.com> In-Reply-To: <4AF411BB.6050808@inconcertcc.com> Subject: Re: Is this possible? (garbage collect and weak tables) Date: Fri, 6 Nov 2009 20:16:25 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ignacio Burgueño wrote: > Line 20 is the second line in the code above marked with an arrow. > I guess that is possible that the GC kicks in between both marked lines, > so the table I put in the weak table went away, right? Right, easily possible - particularly if i18nlib.Translator makes a lot of allocations. Easy enough to fix though, just save translators[key] to a local variable and restore it after the i18nlib call. - Alex From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:37:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6CX2P3026127; Fri, 6 Nov 2009 10:33:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3D3FD1A6A4; Fri, 6 Nov 2009 10:31:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B26E1A66B for ; Fri, 6 Nov 2009 10:31:26 -0200 (BRST) MailScanner-NULL-Check: 1258115536.5181@oBS8TGmT+16/YA5VyKzRTg Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA6CWD4a011825 for ; Fri, 6 Nov 2009 10:32:14 -0200 Message-ID: <4AF4174E.4060409@inconcertcc.com> Date: Fri, 06 Nov 2009 10:32:14 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is this possible? (garbage collect and weak tables) References: <4AF411BB.6050808@inconcertcc.com> <02911E765094496C89DD8AD7CF3E6668@Mania> In-Reply-To: <02911E765094496C89DD8AD7CF3E6668@Mania> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alex Davies wrote: > > Right, easily possible - particularly if i18nlib.Translator makes a lot > of allocations. Easy enough to fix though, just save translators[key] > to a local variable and restore it after the i18nlib call. > > - Alex Sadly, i18nlib.Translator allocates just a userdata wrapping a pointer (so 4 bytes for me). Would this be safe? local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} local temp = translators[key] or {} -- get a strong reference to the -- elements in the weak table translators[key] = temp local translator = temp[user.languageId] if not translator then translator = i18nlib.Translator{(arguments omitted)} temp[user.languageId] = translator end return translator From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:46:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6Ck7Ym029465; Fri, 6 Nov 2009 10:46:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38A55193C1; Fri, 6 Nov 2009 10:44:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from QMTA01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3ECC193A1 for ; Fri, 6 Nov 2009 10:44:39 -0200 (BRST) Received: from OMTA09.westchester.pa.mail.comcast.net ([76.96.62.20]) by QMTA01.westchester.pa.mail.comcast.net with comcast id 1oHz1d0040SCNGk51olZVN; Fri, 06 Nov 2009 12:45:33 +0000 Received: from clef.greenwood ([66.30.209.28]) by OMTA09.westchester.pa.mail.comcast.net with comcast id 1olc1d00G0dJGLJ3VolcWt; Fri, 06 Nov 2009 12:45:38 +0000 References: In-Reply-To: Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Message-Id: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> Content-Transfer-Encoding: 7bit From: Nevin Flanagan Subject: Re: Passing C struct values automatically to Lua Date: Fri, 6 Nov 2009 07:46:24 -0500 To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 5, 2009, at 9:59 PM, zweifel wrote: > Second, Is there anyway of knowing inside a lua script, > automatically the name of the script itself. > > I would like to have something like in bash shell, where the first > argument is the name of the program called. In Lua is there a way to > get the value passed to lua_pcall() inside the script called, in > order to know its own name automatically? > > Thanks in advance, > Danilo Functions don't fundamentally have names in Lua. From the documentation on the lua_Debug struct: "name: a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions can be the value of multiple global variables, while others can be stored only in a table field. The lua_getinfo function checks how the function was called to find a suitable name. If it cannot find a name, then name is set to NULL. " If you have access to the debug library inside your Lua environment, debug.getinfo contains a function that you can use to retrieve information like what name the function was called from. Nevin From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6Ckigd029694; Fri, 6 Nov 2009 10:46:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B9E4193D1; Fri, 6 Nov 2009 10:45:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out1.iinet.net.au (outbound.icp-qv1-irony-out1.iinet.net.au [203.59.1.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88B1D193C4 for ; Fri, 6 Nov 2009 10:45:18 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJKp80rLO60j/2dsb2JhbACRNstphD0Eglw X-IronPort-AV: E=Sophos;i="4.44,693,1249228800"; d="scan'208";a="599162231" Received: from unknown (HELO Mania) ([203.59.173.35]) by outbound.icp-qv1-irony-out1.iinet.net.au with SMTP; 06 Nov 2009 20:46:14 +0800 Message-ID: From: "Alex Davies" To: "Lua list" References: <4AF411BB.6050808@inconcertcc.com><02911E765094496C89DD8AD7CF3E6668@Mania> <4AF4174E.4060409@inconcertcc.com> In-Reply-To: <4AF4174E.4060409@inconcertcc.com> Subject: Re: Is this possible? (garbage collect and weak tables) Date: Fri, 6 Nov 2009 20:46:08 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ignacio Burgueño wrote: > Would this be safe? > local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} > > local temp = translators[key] or {} -- get a strong reference to the > -- elements in the weak table >>>>> translators[key] = temp > local translator = temp[user.languageId] > if not translator then > translator = i18nlib.Translator{(arguments omitted)} > temp[user.languageId] = translator > end > return translator That'd be safe, but I think you accidentally commented out a required line? (Indicated). You could even just add this one line: mt.__index = function(tab, key) local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} translators[key] = translators[key] or {} --> local temp = translators[key] -- keep a strong reference to the table for this call local translator = translators[key][user.languageId] if not translator then translator = i18nlib.Translator{(arguments omitted)} translators[key][user.languageId] = translator end return translator end I wonder if LuaJit 2.x would incorrectly optimise the temp variable away =/? I'm guessing not, as the gc only runs in interpreted mode, but still interesting. - Alex From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 10:57:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6CrR2C031560; Fri, 6 Nov 2009 10:53:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7363193DB; Fri, 6 Nov 2009 10:52:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CFF5193C6 for ; Fri, 6 Nov 2009 10:52:02 -0200 (BRST) Received: by bwz27 with SMTP id 27so1112705bwz.21 for ; Fri, 06 Nov 2009 04:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EC/S3pDn3ppvpR+hwNPRXzGjMX2i1+Hcpb0lPGLHlGQ=; b=xK6Go7SreGooGDxSBnG6DckPCqZGnGHfVCMmduoXC0GoXfHftlu7NX1FXA0lU+3g80 fZHbCS8jPEnEPmTrA4/UD57vQVJz1hv0vj9HLMSUxkOiYQjaheIsx/+behvSfrB0+Br9 J65l9ckkWcpLCCyIiDU1GgQClwyF8Q6FHcz2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=NQfCZMdB7z3DzcLSei+LGFA9W7E0dAU3TaLkxy5AvVgVyUtIvTMrLfDjSPI1AExdTC ecbBwE2rdOZQKBKJ/PlDlJwjO/JNeYKoq8enEbEVHdBgjkbVv/f2uXBGy1n+hElsoorh qWTSiLUb+OVEtzattTuwDwclD/2HckWPga0HI= MIME-Version: 1.0 Received: by 10.239.139.100 with SMTP id s36mr494254hbs.109.1257511981018; Fri, 06 Nov 2009 04:53:01 -0800 (PST) In-Reply-To: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> Date: Fri, 6 Nov 2009 14:53:00 +0200 Message-ID: <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> Subject: Re: Passing C struct values automatically to Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 2:46 PM, Nevin Flanagan wrote: > If you have access to the debug library inside your Lua environment, > debug.getinfo contains a function that you can use to retrieve information > like what name the function was called from. This is true, but the 'function' (or rather, chunk) which is executed when your script runs is anonymous. However, the arg table is always available if your code runs as a script. The caveat is that this applies to the Lua executable itself; it may not make sense in an embedded environment (but then you could set a helpful global) For plain Lua, arg[-1] is the path of the Lua executable, arg[0] is the script (path included, maybe) and arg[1]...arg[#arg] are the command-line arguments. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:00:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6D04uM000402; Fri, 6 Nov 2009 11:00:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFA8A193F5; Fri, 6 Nov 2009 10:58:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 860BD193F0 for ; Fri, 6 Nov 2009 10:58:32 -0200 (BRST) Received: by ywh40 with SMTP id 40so864869ywh.33 for ; Fri, 06 Nov 2009 04:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=m9+XhBT+JZZYr2e5a0CkpLFsFF5cm6tNVssBgKj8ou4=; b=p2dznX6zhYuvFFK8Ce66r0s9dC5RtyWz+4ssCFHTFXrTZzRYqQqlZfA1Q3wsPI+aUT q4Y8P4J8iQqsno7sXiaeM+Uhn/jZKHrNvKdpVcxxUQndauN2jSHJiNmYqGy9+Fwy3ibP kF/R2ka5b5V1vVkR5chSDltIldBgJEr7bNX0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eNEP/4FP8M16sDFNdGQWWJaTiibiPjy43pLIbzSEs7yWvckoj+9+QoU3n/CtMVFPq+ /h2tsDjX/2hfEtH/8WnoE8MxTH/ihebsH/SVjNaz1Hr4L0nh8h4N4YZbbbVGW5KiJFhh rv6mwrJUJsMqSeQ+nSl6NXt4pypakOMygcZaA= MIME-Version: 1.0 Received: by 10.100.245.11 with SMTP id s11mr4010374anh.55.1257512370269; Fri, 06 Nov 2009 04:59:30 -0800 (PST) In-Reply-To: <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> Date: Fri, 6 Nov 2009 10:59:30 -0200 Message-ID: Subject: Re: Passing C struct values automatically to Lua From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=0016e68de9f5216d880477b36a7c X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68de9f5216d880477b36a7c Content-Type: text/plain; charset=ISO-8859-1 In my case it is mostly anonymous. I call the script from C by lua_pcall. I checked the arg variable and it is nil. I am reading things about debug.getinfo now, but I found nothing about anonymous calls... 2009/11/6 steve donovan > On Fri, Nov 6, 2009 at 2:46 PM, Nevin Flanagan > wrote: > > If you have access to the debug library inside your Lua environment, > > debug.getinfo contains a function that you can use to retrieve > information > > like what name the function was called from. > > This is true, but the 'function' (or rather, chunk) which is executed > when your script runs is anonymous. > > However, the arg table is always available if your code runs as a > script. The caveat is that this applies to the Lua executable itself; > it may not make sense in an embedded environment (but then you could > set a helpful global) > > For plain Lua, arg[-1] is the path of the Lua executable, arg[0] is > the script (path included, maybe) and arg[1]...arg[#arg] are the > command-line arguments. > > steve d. > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --0016e68de9f5216d880477b36a7c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In my case it is mostly anonymous. I call the script from C by lua_pcall.
I checked the arg variable and it is nil. I am reading things about d= ebug.getinfo now, but I found nothing about anonymous calls...

2009/11/6 steve donovan <steve.j.donovan@gmail.com>
On Fri, Nov 6, 2009 at 2:46 PM, Nevin Flanagan <Alestane@comcast.net> wrote:
> If you have access to the debug library inside your Lua environment, > debug.getinfo contains a function that you can use to retrieve informa= tion
> like what name the function was called from.

This is true, but the 'function' (or rather, chunk) which is = executed
when your script runs is anonymous.

However, the arg table is always available if your code runs as a
script. The caveat is that this applies to the Lua executable itself;
it may not make sense in an embedded environment (but then you could
set a helpful global)

For plain Lua, arg[-1] is the path of the Lua executable, arg[0] is
the script (path included, maybe) and arg[1]...arg[#arg] are the
command-line arguments.

steve d.



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--0016e68de9f5216d880477b36a7c-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:07:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6D74W7002238; Fri, 6 Nov 2009 11:07:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48275193FE; Fri, 6 Nov 2009 11:05:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84B4A193F2 for ; Fri, 6 Nov 2009 11:05:27 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA6D6M6l021629 for ; Fri, 6 Nov 2009 11:06:22 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 26F6F54C1D0; Fri, 6 Nov 2009 11:06:23 -0200 (BRST) Date: Fri, 6 Nov 2009 11:06:23 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Is this possible? (garbage collect and weak tables) Message-ID: <20091106130623.GA2051@inf.puc-rio.br> References: <4AF4174E.4060409@inconcertcc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > You could even just add this one line: > > mt.__index = function(tab, key) > local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} > translators[key] = translators[key] or {} > --> local temp = translators[key] -- keep a strong reference to the > table for this call > local translator = translators[key][user.languageId] > if not translator then > translator = i18nlib.Translator{(arguments omitted)} > translators[key][user.languageId] = translator > end > return translator > end The correctness of this code rests on the assumption that the GC will not run between the two assignments. It seems better style the other way around: local temp = translators[key] or {} translators[key] = temp ... (use 'temp' for the rest of this code) ... (Actually the assumption may be wrong! a line hook may cause a GC between the two lines when debugging this code ;) -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:07:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6D7WxP002506; Fri, 6 Nov 2009 11:07:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EC0A19405; Fri, 6 Nov 2009 11:05:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 25F8319401 for ; Fri, 6 Nov 2009 11:05:37 -0200 (BRST) Received: by bwz27 with SMTP id 27so1126451bwz.21 for ; Fri, 06 Nov 2009 05:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=R3YRxQApqpJ4isIkah/uSl7Z8j1ScEnqRmgkfN7yX0Y=; b=sGCYuyVU/eQlCWW2Mu73sxpSs7Q/GrgaiL8j9JlL53gv0y71I8JgC/cV1KxPFiIsdq BYm1Khoh0t0M2dKJlVqxEmFPPmPMscuVOXr3GmbHjPaj8gUu7erALB3uXNsV71uqrX56 jL+WUE9TIp7xn318UHPQ/XR8V+k6Xu1Pa4OXs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ULzpXi2za+DKZgReRrtJ44IB4kEgzyLJewmGCBad3kZeXUDC/EcznmsbMk1zjpadlz L0KtluIuzMMmQrxrubz16SFc2Jv+oP9QKyTEDT8Ym2xiNfMfPBZ4vzX8pHMJzBi92qjS 5W0cB8g/EHjWcuhJSaQC8I5tTJPcccuUAz1OI= MIME-Version: 1.0 Received: by 10.239.184.157 with SMTP id y29mr484187hbg.54.1257512795066; Fri, 06 Nov 2009 05:06:35 -0800 (PST) In-Reply-To: References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> Date: Fri, 6 Nov 2009 15:06:35 +0200 Message-ID: <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> Subject: Re: Passing C struct values automatically to Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 2:59 PM, zweifel wrote: > I checked the arg variable and it is nil. I am reading things about > debug.getinfo now, but I found nothing about anonymous calls... Ah right, sorry I was thinking about scripts running from Lua itself. Why not set a global to the name of the script before you launch it with lua_pcall? Or pass it as an argument? (I'm thinking of how require() works; it passes the name of the module, so that a module can be defined as module(...) That is, it picks up the name from the first argument) From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:17:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DC0bC003998; Fri, 6 Nov 2009 11:12:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7D0B1940D; Fri, 6 Nov 2009 11:10:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CFFF193FC for ; Fri, 6 Nov 2009 11:10:33 -0200 (BRST) Received: by bwz27 with SMTP id 27so1131410bwz.21 for ; Fri, 06 Nov 2009 05:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=wJyjGwKYMXwW94e2bj+VbzoRUHofhy8ne82SXZJRKq0=; b=Kic5Emczko+Tg+a21LQ+d6sWf19YbZ/BYn/mHddg7wQqF0+dzDH2eOoDPbrZeJvTTq ZnXz0F5wRfgfayzGfzENiOja1QSGiYpWzDiE2IwoZfjR5Xhxf31hGTlyy0aRcuezi/t4 KNgp7mshydbWdKH606z6Go9skKLCywNfSwnQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CKEgSQb7E6lrgLBWocP5rI01VftG9y1ovyrqrCCeQRVqAx5Xp4YmrFjqilXbqmzNEZ b8HfekSOuGg2qaajUVXbGWZVputY6qO5ojiqcFLIdSoBY64uvU+U4qiRwQ+wD7Xnh1ix 84NSg/TXsWdpbQ0StQprtnqTHdQIa4qVJ0gaM= MIME-Version: 1.0 Received: by 10.239.145.13 with SMTP id q13mr427134hba.125.1257513091110; Fri, 06 Nov 2009 05:11:31 -0800 (PST) In-Reply-To: <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> Date: Fri, 6 Nov 2009 15:11:31 +0200 Message-ID: <560972290911060511p6a2c830cr8434e566f5f7270c@mail.gmail.com> Subject: Re: Passing C struct values automatically to Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 3:06 PM, steve donovan wrote: > On Fri, Nov 6, 2009 at 2:59 PM, zweifel wrote: >> I checked the arg variable and it is nil. I am reading things about >> debug.getinfo now, but I found nothing about anonymous calls... This illustrates the situation with pure Lua, applies to C API as well. Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > ls = loadstring 'print(...)' > = ls function: 0x807d490 --> compiled chunk (won't have a name) > pcall(ls,10) --> call with arg, prints it out 10 > pcall(ls,'one','two') one two From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:19:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DIrKd006115; Fri, 6 Nov 2009 11:18:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FB65193CB; Fri, 6 Nov 2009 11:17:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5A15B192D8 for ; Fri, 6 Nov 2009 11:17:24 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N6Ohp-00040x-00; Fri, 06 Nov 2009 14:18:21 +0100 Date: Fri, 6 Nov 2009 14:18:13 +0100 From: Mike Pall To: Lua list Subject: Re: Is this possible? (garbage collect and weak tables) Message-ID: <20091106131813.GA22095@mike.de> References: <4AF4174E.4060409@inconcertcc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alex Davies wrote: > I wonder if LuaJit 2.x would incorrectly optimise the temp variable away > =/? I'm guessing not, as the gc only runs in interpreted mode, but still > interesting. The GC check is performed for compiled code, too. But only at specific points: at the start of a trace and before each loop iteration. And only if there's actually anything between these points which could change the GC thresholds, i.e. an allocation. Any collectable object that is live at these points is synced to the stack. Since these points are carefully chosen, this usually only happens for loop-carried GC objects or side traces with inherited GC objects. For linear control-flow, like in the example, the GC doesn't run at the critical spot in compiled code. So it wouldn't need to sync the temp to the stack. But you still need to keep the strong reference for semantic correctness and for the interpreter. And you should copy the strong reference to the weak reference, not the other way round. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:32:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DLLsK007071; Fri, 6 Nov 2009 11:21:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B6171941B; Fri, 6 Nov 2009 11:19:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F058B193DE for ; Fri, 6 Nov 2009 11:19:50 -0200 (BRST) Received: by ywh40 with SMTP id 40so879457ywh.33 for ; Fri, 06 Nov 2009 05:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yyCXFIg4ZkDe4W5JZlRyYY/irCWnkGVT1r3zqWq0vqA=; b=k1xfVWu/oDpX7IxE8bPHmN7kCmdOiMrUymbt9GKR7DI91yTS1Ya9v7QPvfLU4ViX1Q /Oat0xNZyBqbNynCuu85ihuawjOZQqds81UnbZv+gGEzcevzTj+zK7K02FLjIb3V6O+N Qz245DDpI6rj0ZzQ12vo8lHF3XXli0bH4Nu4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RqZ+gmmDotWCd47eOiQk+8IWlKAJkg79r5g+Z0+47U/PPiyQWwRc84p610FL68R6tY 4623xylAhC0GBbyXA+ycuqONo4ZERhpxaN58BVlcaFB18td2XkvJ/ti9A/6hpx+y53ye jEVDTD5CdKuZ+QUEnjZOiLw9kz0WJ4nlcOXHA= MIME-Version: 1.0 Received: by 10.101.41.16 with SMTP id t16mr4029249anj.163.1257513647804; Fri, 06 Nov 2009 05:20:47 -0800 (PST) In-Reply-To: <560972290911060511p6a2c830cr8434e566f5f7270c@mail.gmail.com> References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> <560972290911060511p6a2c830cr8434e566f5f7270c@mail.gmail.com> Date: Fri, 6 Nov 2009 11:20:47 -0200 Message-ID: Subject: Re: Passing C struct values automatically to Lua From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636ed692b4710790477b3b6f2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636ed692b4710790477b3b6f2 Content-Type: text/plain; charset=ISO-8859-1 Thanks Nevin for pointing out, found it! Although it seems to be a bad solution... local da= debug.getinfo(1,"S") print (da.source) The da.source returns the path to the script! Because I dont know if it is fast enough to be called each frame, since they say that the debug information is stored with velocity as a second goal. But I will find it soon enough, it is very practical though, but if this not work I will try pushing and setting a global... hey steve, that would be a better solution, but why my print(arg) returns nil? Ok, maybe I have not passed any arguments, but do I have to pass args in order to access the arg[0]?? 2009/11/6 steve donovan > On Fri, Nov 6, 2009 at 3:06 PM, steve donovan > wrote: > > On Fri, Nov 6, 2009 at 2:59 PM, zweifel wrote: > >> I checked the arg variable and it is nil. I am reading things about > >> debug.getinfo now, but I found nothing about anonymous calls... > > This illustrates the situation with pure Lua, applies to C API as well. > > Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > > ls = loadstring 'print(...)' > > = ls > function: 0x807d490 --> compiled chunk (won't have a name) > > pcall(ls,10) --> call with arg, prints it out > 10 > > pcall(ls,'one','two') > one two > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636ed692b4710790477b3b6f2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Nevin for pointing out, found it! Although it seems to be a bad solu= tion...

local da=3D debug.getinfo(1,"S")
print (da.sour= ce)

The da.source returns the path to the script!

Because I d= ont know if it is fast enough to be called each frame, since they say that = the debug information is stored with velocity as a second goal. But I will = find it soon enough, it is very practical though, but if this not work I wi= ll try pushing and setting a global...

hey steve, that would be a better solution, but why my print(arg) retur= ns nil? Ok, maybe I have not passed any arguments, but do I have to pass ar= gs in order to access the arg[0]??

2009/1= 1/6 steve donovan <steve.j.donovan@gmail.com>
On Fri, Nov 6, 2009 at 3:06 PM, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Fri, Nov 6, 2009 at 2:59 PM, zweifel <zweifel@gmail.com> wrote:
>> I checked the arg variable and it is nil. I am reading things abou= t
>> debug.getinfo now, but I found nothing about anonymous calls...
This illustrates the situation with pure Lua, applies to C API as wel= l.

Lua 5.1.2 =A0Copyright (C) 1994-2007 Lua.org, PUC-Rio
> ls =3D loadstring 'print(...)'
> =3D ls
function: 0x807d490 =A0 =A0--> compiled chunk (won't have a name) > pcall(ls,10) =A0 =A0 =A0--> call with arg, prints it out
10
> pcall(ls,'one','two')
one =A0 =A0 two



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636ed692b4710790477b3b6f2-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:42:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DccC1012478; Fri, 6 Nov 2009 11:38:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C37C91942C; Fri, 6 Nov 2009 11:37:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9691F19428 for ; Fri, 6 Nov 2009 11:37:07 -0200 (BRST) MailScanner-NULL-Check: 1258119486.01746@S/c+1s8tTdreGgZvPaIXjg Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nA6Dc4x4013379 for ; Fri, 6 Nov 2009 11:38:05 -0200 Message-ID: <4AF426B1.1080204@inconcertcc.com> Date: Fri, 06 Nov 2009 11:37:53 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Is this possible? (garbage collect and weak tables) References: <4AF4174E.4060409@inconcertcc.com> <20091106131813.GA22095@mike.de> In-Reply-To: <20091106131813.GA22095@mike.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Alex Davies wrote: >> I wonder if LuaJit 2.x would incorrectly optimise the temp variable away >> =/? I'm guessing not, as the gc only runs in interpreted mode, but still >> interesting. ... > > But you still need to keep the strong reference for semantic > correctness and for the interpreter. And you should copy the > strong reference to the weak reference, not the other way round. Thanks Alex, Roberto, Mike. I rewrote the code as Roberto suggested. And Mike's last comment made me aware of my mistake (using the weak reference throughout the code instead of the strong one). Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:45:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DivCv014230; Fri, 6 Nov 2009 11:44:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C62F19433; Fri, 6 Nov 2009 11:43:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 06AE119428 for ; Fri, 6 Nov 2009 11:43:29 -0200 (BRST) Received: by fxm21 with SMTP id 21so222488fxm.21 for ; Fri, 06 Nov 2009 05:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DxtaEpgHwMWA/L/O0c35qbepPqC2fGD5WHLlMoBR3Lw=; b=QkNqEPWYf9xIoq4Ckb0vL75aGOKOdcKcrV5wlpsOScCsNSll5O7Wv3CGajsierSr3h lzAL82/t0R/TFxEnTr95CHn0LnoU3yP7qIfdLif3fiWeWf/jsAuPLAzOGipuLPnEIUbB Yai0IxRGZ/KiDyGjkJhJCS2AqUvgUgHbrpmD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UkvW6U9rUJ5a8o0aX6s7Nvqx3jJdA6E66v12i586DbkCtqiRyGrgQVg5LtKm8VKzFG QwSHwsC5rq4LkjUMCd4DLLHnKbZ6GoExpAoT3zp1Zw+eHRzUNnpuEIaEqn7xWrlBTUiP PI4E038hQGH3iHaKRx4PzfcgINP//hvKF0F+c= MIME-Version: 1.0 Received: by 10.239.145.148 with SMTP id s20mr370650hba.142.1257515068064; Fri, 06 Nov 2009 05:44:28 -0800 (PST) In-Reply-To: References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> <560972290911060511p6a2c830cr8434e566f5f7270c@mail.gmail.com> Date: Fri, 6 Nov 2009 15:44:28 +0200 Message-ID: <560972290911060544x63c3aa68t5e6f79ada0d1349b@mail.gmail.com> Subject: Re: Passing C struct values automatically to Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 3:20 PM, zweifel wrote: > hey steve, that would be a better solution, but why my print(arg) returns > nil? Ok, maybe I have not passed any arguments, but do I have to pass args > in order to access the arg[0]?? Because it's only set by the Lua interpreter itself. But you can create your own args table, make it global and access that from your script. E.g. in lua.c: int narg = getargs(L, argv, n); /* collect arguments */ lua_setglobal(L, "arg"); where getargs() is static int getargs (lua_State *L, char **argv, int n) { int narg; int i; int argc = 0; while (argv[argc]) argc++; /* count total number of arguments */ narg = argc - (n + 1); /* number of arguments to the script */ luaL_checkstack(L, narg + 3, "too many arguments to script"); for (i=n+1; i < argc; i++) lua_pushstring(L, argv[i]); lua_createtable(L, narg, n + 1); for (i=0; i < argc; i++) { lua_pushstring(L, argv[i]); lua_rawseti(L, -2, i - n); } return narg; } From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 11:48:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6DmeHG015301; Fri, 6 Nov 2009 11:48:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77C3B19437; Fri, 6 Nov 2009 11:47:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EEE9319418 for ; Fri, 6 Nov 2009 11:47:07 -0200 (BRST) Received: by ewy26 with SMTP id 26so1251265ewy.5 for ; Fri, 06 Nov 2009 05:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=GrNKzEvdsUhRnf3b/uWBbE+DKttytrS812DaMd7GS2M=; b=SEt8+MEMMr/djmmb/tDzdYisTtnZTBCf+kXaaik273ZI/Qunawl2EyVv0wSClm8Tsy 72Lm7+JLIYRSt27cIYxJDQ1I0VwL62QOSEZvQigxAUavIoQXwEAFXhFqRLvyyKM6KbZM mucNCeznIldaToubHpQNF0tmxYBE0WtpZDSWM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=cE5io1urbh5fMWCkKusxOef/UNyiOPfopmoX+f0QkdhaOnowHsWCllLS8nnVLBBdJA iF2U/i60cvil/ZAD6k/czJSJ33A7CXUoFqKMdxJumX9WS6RErmmfxMVloNO/7Iv7/v/6 1gUdsULHPHI6YK8hvAbhA9Wf9RhUTRPNbX72s= MIME-Version: 1.0 Received: by 10.216.87.5 with SMTP id x5mr1346852wee.75.1257515286146; Fri, 06 Nov 2009 05:48:06 -0800 (PST) In-Reply-To: <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> From: Jerome Vuarand Date: Fri, 6 Nov 2009 14:47:46 +0100 Message-ID: <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/6 Francesco Abbate : > Otherwise, if I understand well, everyone here is saying loudly: > you don't need to change Lua, please keep your dirty hands away from it!! > > :-) As Steve suggested changes to the language are welcome. I personnally asked for the exact same feature as what you need (ie. multiple values in the [] operator forwarded to the metamethods) some time ago, you can probably find it in the list archive. It would be nice to have a simple patch for Lua itself, which could hopefully be integrated in a future official version. But using appropriate tools will be much much easier than that, unless you actually enjoy compiler programming in C. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 12:09:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6E9CvG020037; Fri, 6 Nov 2009 12:09:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A8441A6A5; Fri, 6 Nov 2009 12:07:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 279761A66B for ; Fri, 6 Nov 2009 12:07:36 -0200 (BRST) Received: by ywh40 with SMTP id 40so915532ywh.33 for ; Fri, 06 Nov 2009 06:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rcB89MfCyyl7cZD6/jxQTNs3siEVrEeCdFAbJlDUAj8=; b=LU+1Zf0mbYvTKCd69/rWhr4L9apMdIS5DxTrBBTH4vD+yU8/51sNhvcr41x4f8FH/x 9zDYd1kbCghBBOj+LfKiNPq+8D7RnTyYb5ZldofOElAJC3Tc/dQFphw8DHdczaeikh/m vR1iRHPeik7ULe33VkowtbDamiBQVdhzz/N7I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ieq1sFr9/Nqxf5OoOhUvBNsztR1qyhhSmzGygS2oqgrJb09dxAKJeck7YnzH6hHtth UZdIAQfJfq3082tNNwlHFmgJIDopkSFb8HD0CHXql+k65WVCtvKim+w9AKJVVGszsomq DbfDwgLd8F9URb+36lNdNIJPhEts9C/SbLjMw= MIME-Version: 1.0 Received: by 10.101.142.24 with SMTP id u24mr4051481ann.35.1257516511225; Fri, 06 Nov 2009 06:08:31 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Nov 2009 09:08:31 -0500 Message-ID: Subject: Re: mochalua heap memory issues? From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016e6d2820ef36d490477b460d9 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d2820ef36d490477b460d9 Content-Type: text/plain; charset=ISO-8859-1 I wanted to follow up with this; as I discovered the issue. Detailed here: http://code.google.com/p/mochalua/issues/detail?id=5 It is not mochalua's fault, though with a lack of documentation it is potentially easy to fall into this trap. luaL_loadstring takes a String type, but only accepts binary data within the string type; Java has some rather weasily functions when it comes to converting a byte[] to a String. In my cause it caused 'some' of my bytes to be transcoded based on the current locale; enough that most of lua chunk would be deserialized; however in one case the int length prefix of a string constant was changed, resulting in a smaller number; this caused an under-read of the subsequent string the subsequent int read was the number of lua functions which turned out to be wrong; resulting in a LARGE int value; this int value is promptly used as the quantity for an array of LuaFunctions; but the large size causes an instant out of memory error. Only through inspecting what was going in by attaching the mochalua source; and a lot of time, was I able to figure this out. Due to the nature of system specific encoding; and the varied nature of input files, it's potential that people could have this issue and not even know about it; as trivial scripts worked fine for me. and the out of memory error didint point to anything being wrong in my bytecode data. -Raymond On Thu, Nov 5, 2009 at 10:22 AM, Raymond Jacobs wrote: > Greetings all, > > I hope it is alright posting about mochalua here; > I couldn't seem to find a good spot to talk about mochalua elsewhere. > > I've recently started using mochalua in my Java 1.6 SE application; > and while I can get small, trivial lua code to run; a larger multi-function > script > results in a Java out of heap memory exception. > > I've tried to set the xms and xmm VM arguments to up the JVM heap size but > nothing seems to be helping. > > I am using luaL_loadstring to load the data; > > has anyone had similar issues when working with mochalua? > > Any information is appreciated, > > Thanks, > > Raymond Jacobs > Owner, > Ethereal Darkness Interactive > www.edigames.com > > --0016e6d2820ef36d490477b460d9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I wanted to follow up with this; as I discovered the issue.

Detailed= here:
http://code.google.com/p/mochalua/issues/detail?id=3D5

It is n= ot mochalua's fault, though with a lack of documentation it is potentia= lly easy to fall into this trap.

luaL_loadstring takes a String type, but only accepts binary data withi= n the string type;
Java has some rather weasily functions when it comes = to converting a byte[] to a String.

In my cause it caused 'some&= #39; of my bytes to be transcoded based on the current locale;
enough that most of lua chunk would be deserialized; however in one case th= e int length prefix of a string
constant was changed, resulting in a sma= ller number; this caused an under-read of the subsequent string
the subs= equent int read was the number of lua functions which turned out to be wron= g; resulting in a LARGE int value;
this int value is promptly used as the quantity for an array of LuaFunction= s; but the large size causes an instant out of memory
error.

Only= through inspecting what was going in by attaching the mochalua source; and= a lot of time, was I able to figure this out.
Due to the nature of system specific encoding; and the varied nature of inp= ut files, it's potential that people could have this issue and not even= know about it; as trivial scripts worked fine for me. and the out of memor= y error didint point to anything being wrong in my bytecode data.

-Raymond

On Thu, Nov 5, 2009 at 10:22= AM, Raymond Jacobs <raymondj@gmail.com> wrote:
Greetings all,

I hope it is alright posting about mochalua here;
= I couldn't seem to find a good spot to talk about mochalua elsewhere.
I've recently started using mochalua in my Java 1.6 SE applicatio= n;
and while I can get small, trivial lua code to run; a larger multi-function= script
results in a Java out of heap memory exception.

I've = tried to set the xms and xmm VM arguments to up the JVM heap size but nothi= ng seems to be helping.

I am using luaL_loadstring to load the data;

has anyone had simi= lar issues when working with mochalua?

Any information is appreciate= d,

Thanks,

Raymond Jacobs
Owner, Ethereal Darkness Interactive
www.edigames.com<= br>

--0016e6d2820ef36d490477b460d9-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 12:09:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6E9ibe020225; Fri, 6 Nov 2009 12:09:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 085001A6B7; Fri, 6 Nov 2009 12:08:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 130F21A6A6 for ; Fri, 6 Nov 2009 12:08:03 -0200 (BRST) Received: by ewy26 with SMTP id 26so1275124ewy.5 for ; Fri, 06 Nov 2009 06:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/Mlt/FEYUdVMqz2dKwF240AVDplgekUqfeGwBWww0VM=; b=KwpdgH4T7GYCqI7t+ZxUA9/SI2Buna7sKDpgffvvGyqhChYrZrNPoFH4cZsh89fqM1 Cmob9brAdBJoD6pF+FQ/RuAJlY9x7WyMMyuuPIFdZ7R0PZR3vIx35vcPYxhcgKfu3RJU +gPORFnnQ63tBmOjfhz4rLs88vbCw5M4B3hxU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=n6wHVDbZZM2nQZGswobD/IXtf0aeoUCLklS9ItIL666y2svFTS5atccQ8jttMZan+0 MvZgGNpsOR4Yy0buuM0VJ9O9CarwWkALLXs6dMqJa0jHcZUP/f3yWTTaWJ9xLx4aYk+9 jyRywU7kfkHSuYokU5FcS2dZnNREb2SjJDBEI= MIME-Version: 1.0 Received: by 10.213.55.70 with SMTP id t6mr910930ebg.11.1257516541577; Fri, 06 Nov 2009 06:09:01 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Nov 2009 15:09:01 +0100 Message-ID: <13af99c70911060609jbc215e9seb5de99d925a5cb7@mail.gmail.com> Subject: Re: mochalua heap memory issues? From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=001636026110c289f90477b462bc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636026110c289f90477b462bc Content-Type: text/plain; charset=ISO-8859-1 Can you provide a preferably minimal test case to reproduce the problem? Seems like it would be a memory leak. I would personally like to verify it in Kahlua to see if it suffers from the same potiential problem as Mochalua. /Kristofer On Thu, Nov 5, 2009 at 4:22 PM, Raymond Jacobs wrote: > Greetings all, > > I hope it is alright posting about mochalua here; > I couldn't seem to find a good spot to talk about mochalua elsewhere. > > I've recently started using mochalua in my Java 1.6 SE application; > and while I can get small, trivial lua code to run; a larger multi-function > script > results in a Java out of heap memory exception. > > I've tried to set the xms and xmm VM arguments to up the JVM heap size but > nothing seems to be helping. > > I am using luaL_loadstring to load the data; > > has anyone had similar issues when working with mochalua? > > Any information is appreciated, > > Thanks, > > Raymond Jacobs > Owner, > Ethereal Darkness Interactive > www.edigames.com > > --001636026110c289f90477b462bc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can you provide a preferably minimal test case to reproduce the problem?Seems like it would be a memory leak.

I would personally like to ve= rify it in Kahlua to see if it suffers from the same potiential problem as = Mochalua.

/Kristofer

On Thu, Nov 5, 2009 at 4:2= 2 PM, Raymond Jacobs <raymondj@gmail.com> wrote:
Greetings all,

I hope it is alright posting about mochalua here;
= I couldn't seem to find a good spot to talk about mochalua elsewhere.
I've recently started using mochalua in my Java 1.6 SE applicatio= n;
and while I can get small, trivial lua code to run; a larger multi-function= script
results in a Java out of heap memory exception.

I've = tried to set the xms and xmm VM arguments to up the JVM heap size but nothi= ng seems to be helping.

I am using luaL_loadstring to load the data;

has anyone had simi= lar issues when working with mochalua?

Any information is appreciate= d,

Thanks,

Raymond Jacobs
Owner, Ethereal Darkness Interactive
www.edigames.com<= br>

--001636026110c289f90477b462bc-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 12:14:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6EECR8021185; Fri, 6 Nov 2009 12:14:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A5341A713; Fri, 6 Nov 2009 12:12:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8BE851A692 for ; Fri, 6 Nov 2009 12:12:43 -0200 (BRST) Received: by ywh40 with SMTP id 40so919760ywh.33 for ; Fri, 06 Nov 2009 06:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=iDXim8N9f6m2vFwDyXEcimoHl1sYQe4C+1d3HuRJkdM=; b=TUZxPNN2GnknJ2xtTP/4EIvBl7VidTC8nnCK+FaDxWnIk5YTnNtuChwQ/mcR1U8PMf 443aJZx8P6j2kUcnSw31SpS6l3nbTOQq2y3w6/UrLKeAZKoZJdqp+qkudoBhxYRh8qn9 gmBKtDjDdBq8Tqsw/Zl1ZuloJ+caz/SVcFux0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=APQpeMhvqcuSs4CODeFfGudIuDJY4tX68Jt1bnHY2XwkE7qKSFcCSAzT405/8db5ne DXRjxpdK0RyDb0agRLRBzn/9EQelyMy25ow1U9muzxZmDz9OT27zPzca+gkNqeW+7f+j 6dCq9EuvzH5W/fKTJR1n3KcizPud3nGWG2kuA= MIME-Version: 1.0 Received: by 10.100.214.1 with SMTP id m1mr4097472ang.191.1257516813644; Fri, 06 Nov 2009 06:13:33 -0800 (PST) In-Reply-To: <13af99c70911060609jbc215e9seb5de99d925a5cb7@mail.gmail.com> References: <13af99c70911060609jbc215e9seb5de99d925a5cb7@mail.gmail.com> Date: Fri, 6 Nov 2009 09:13:33 -0500 Message-ID: Subject: Re: mochalua heap memory issues? From: Raymond Jacobs To: Lua list Content-Type: multipart/alternative; boundary=0016368e24ccf9f3670477b47210 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016368e24ccf9f3670477b47210 Content-Type: text/plain; charset=ISO-8859-1 I have some test files but unfortunetly I wont be able to deliver them until after the weekend at the soonest, sorry. The -key- issue is not to feed mochalua (or anything) potentially corupt data; the big issue is that with what mochalua expects for byte data (it being in a String type) makes it 'very' easy to wrongly convert your binary data and not even know it. I have found that taking a byte[] and manually converting it to a char[], byte by byte; and using that char[] to init the string seems to work fine; I have read online that new String(byte[]) is particularly insidious about it's conversion. -Raymond On Fri, Nov 6, 2009 at 9:09 AM, Kristofer Karlsson < kristofer.karlsson@gmail.com> wrote: > Can you provide a preferably minimal test case to reproduce the problem? > Seems like it would be a memory leak. > > I would personally like to verify it in Kahlua to see if it suffers from > the same potiential problem as Mochalua. > > /Kristofer > > > On Thu, Nov 5, 2009 at 4:22 PM, Raymond Jacobs wrote: > >> Greetings all, >> >> I hope it is alright posting about mochalua here; >> I couldn't seem to find a good spot to talk about mochalua elsewhere. >> >> I've recently started using mochalua in my Java 1.6 SE application; >> and while I can get small, trivial lua code to run; a larger >> multi-function script >> results in a Java out of heap memory exception. >> >> I've tried to set the xms and xmm VM arguments to up the JVM heap size but >> nothing seems to be helping. >> >> I am using luaL_loadstring to load the data; >> >> has anyone had similar issues when working with mochalua? >> >> Any information is appreciated, >> >> Thanks, >> >> Raymond Jacobs >> Owner, >> Ethereal Darkness Interactive >> www.edigames.com >> >> > --0016368e24ccf9f3670477b47210 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have some test files but unfortunetly I wont be able to deliver them unti= l after the weekend at the soonest, sorry.

The -key- issue is not to= feed mochalua (or anything) potentially corupt data; the big issue is that= with what mochalua expects for byte data (it being in a String type) makes= it 'very' easy to wrongly convert your binary data and not even kn= ow it.

I have found that taking a byte[] and manually converting it to a char[= ], byte by byte; and using that char[] to init the string seems to work fin= e; I have read online that new String(byte[]) is particularly insidious abo= ut it's conversion.

-Raymond

On Fri, Nov 6, 2009 at 9:09 = AM, Kristofer Karlsson <kristofer.karlsson@gmail.com> wrote:
Can you provide a preferably minimal test case to reproduce the problem?Seems like it would be a memory leak.

I would personally like to ve= rify it in Kahlua to see if it suffers from the same potiential problem as = Mochalua.

/Kristofer


On Thu, Nov 5, 2009 at 4:22 PM, Raymond Jacobs <raymon= dj@gmail.com> wrote:
Greetings all,

I hope it is alright posting about mochalua here;
= I couldn't seem to find a good spot to talk about mochalua elsewhere.
I've recently started using mochalua in my Java 1.6 SE applicatio= n;
and while I can get small, trivial lua code to run; a larger multi-function= script
results in a Java out of heap memory exception.

I've = tried to set the xms and xmm VM arguments to up the JVM heap size but nothi= ng seems to be helping.

I am using luaL_loadstring to load the data;

has anyone had simi= lar issues when working with mochalua?

Any information is appreciate= d,

Thanks,

Raymond Jacobs
Owner, Ethereal Darkness Interactive
www.edigames.com<= br>


--0016368e24ccf9f3670477b47210-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 12:28:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6ESRST024251; Fri, 6 Nov 2009 12:28:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 101C81A717; Fri, 6 Nov 2009 12:26:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA43B1A670 for ; Fri, 6 Nov 2009 12:26:52 -0200 (BRST) Received: by fxm21 with SMTP id 21so237903fxm.21 for ; Fri, 06 Nov 2009 06:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=/iuDPvFCmPxBHxyOZ9Gwmc+mlgL73/EkHfbDy6ms/8k=; b=MMg7VThWhWYF2nY5GRD8N+t9SFwL7nduzjyIvxWHHBOWw07ioUx82yQ0BEzqhXoHi8 IpboqMA87hO5qPUuceovUI/aLeymN9PiRFwrk5p2j5dl6IYYXkAIV1/DK6vVf5jlgm7m ZPOlFZgg3/prS6QcVKuUGKLz4LT2GjIJVUzvE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Q++xRSrw9/R2E2vg+/c+ulQCpc20EFc64cJQCILcwdQnB3dBP9fpFEfk8w/Q8Jin3F 57MarfdNfg+8k+ALpnKiwRoq9tN4Js6aAECkf2suPjD4eSB7gnvBK4TQ6vxRSJFAW59L JBuvjt2ob0FYlfEIEj56aDjJbiKhZQPNpIPCI= Received: by 10.204.150.81 with SMTP id x17mr4763774bkv.73.1257517671453; Fri, 06 Nov 2009 06:27:51 -0800 (PST) Received: from lurch.humyo.com (91-65-142-230-dynip.superkabel.de [91.65.142.230]) by mx.google.com with ESMTPS id 31sm300476fkt.40.2009.11.06.06.27.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Nov 2009 06:27:50 -0800 (PST) Message-ID: <4AF43265.8010608@gmail.com> Date: Fri, 06 Nov 2009 15:27:49 +0100 From: Richard Hundt User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: bottom-up processing References: <20091105213239.11871dec@o> In-Reply-To: <20091105213239.11871dec@o> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean spir wrote: > Hello, > > I'm new to Lua and the list. Jump on the opportunity to comment and ask about the following: > > Roberto Ierusalimschy wrote: >> Lua does not build an AST; it generates code on the fly. > > I'm rather surprised to read this. Thought, actually, that I was the only one to use such an approach for big jobs like that. I have never read about the topic, but anyway my knowledge in computer science lies at the zeroth level ;-) > > I'd like to know how the method used in Lua code generation compares to the following: > * Each pattern possibly assign a "post-parse node action" (or several) to each node they will generate. > * This action transforms the node (or rather its data), including possibly collapsing whole branches into what becomes a simple leaf. > * That way, each node is responsible to pass itself in the most convenient form to higher levels. > > This method is incredibly easy and powerful. Usually, it will not only help converting or restructuring nodes or branches, instead directly produce the desired result, be it returning a computed value or performing an action such as writing xhtml from wiki lang. I call that "bottom-up processing", mirroring "top-down parsing". > In a personal parsing tool (in python), I use it intensively to generate parsers. The meta-grammar specifies such actions so that the meta-parser does all the job -- actually the generator itself is a func of ~ 15 lines mainly instantiating a result parser with proper params. [...] I think what you're describing is essentially an "attribute grammar", so you may find [1] interesting, or just google around for the term. > Before using this method, I long tried the hard way of walking parse trees, from outside and from the top. > Well, sorry if all of this is well-known to the ones of you possibly interested in the topic. The opportunity was too tempting. I'd really love pointers if any. But above all, I'm really curious about the method used in Lua to generate code while parsing. > If the language is fairly simple, you can do everything in one pass. Lua doesn't do any hoisting (e.g. in JavaScript you can call a function before it is declared), and the register allocation is more stack-like (so no graph colouring or linear scan algorithms, or similar, which require later analysis of variable lifetimes). [DISCLAIMER] I haven't studied Lua's compiler code, so YMMV, but I'm going for the general principle here. The basic strategy is to emit instructions when you've collected enough information during parsing to do so, simple statements and expressions like: local a = 41; a = a + 1, can have code generated for them at the end of the statement/expression (1 token lookahead is nice to have here), others require recursing down and then generating the opcodes a bit later. I can imagine that there is also a certain amount of back patching of instructions and meta-data (variable life-time, upvalues, etc.) in the generated bytecode stream besides the usual forward jumps stuff for conditional branching. It does mean that the parser and code generator are very tightly coupled, though, but it also makes for fast, small memory footprint compilation. Cheers, Richard Hundt [1] http://www.cs.uiowa.edu/~fleck/agExample.pdf From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 12:36:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6EZteD026117; Fri, 6 Nov 2009 12:35:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AC2E1A722; Fri, 6 Nov 2009 12:34:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 744E01A71B for ; Fri, 6 Nov 2009 12:34:25 -0200 (BRST) Received: by ewy26 with SMTP id 26so1305304ewy.5 for ; Fri, 06 Nov 2009 06:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=deVwFkHprsu3TGcvyZvassusmrndPPHGD/KwkEg+bGE=; b=tOmmhoQ/u83Vgldk8aEBSpwMG1ai8dBfKDb+7eYwlFGHvEQ2dcmdkJdsVBXxXSSjrG G+dU1ufpSFLbH5cKIQHgq/5wLAXDnqHANxLOofS+a942O9JdwqEMX1vuRh3aynLsMRU2 PYpbbrjQcM9rfD4QkkjzBvV0dCVcwamApt7LA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=x5Kk0yVkc4AUFWaiyQRpxIXX7hBA82ohDtml8vr7iVd76AkP4Z1+lWOqcZEH56FEkV D2QRRBsQw5ZvMq8DREiqbd/lX97FIoCQUT9PJAQsb0D8ZlrUF3Nwv5kgaAETc3nZXz3I bZFU+Zkczd/1QFhojf+XB+KKH660s83TdUDAA= MIME-Version: 1.0 Received: by 10.216.93.18 with SMTP id k18mr1386451wef.218.1257518123154; Fri, 06 Nov 2009 06:35:23 -0800 (PST) In-Reply-To: <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> Date: Fri, 6 Nov 2009 09:35:23 -0500 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-06, Jerome Vuarand wrote: > As Steve suggested changes to the language are welcome. I personnally > asked for the exact same feature as what you need (ie. multiple values > in the [] operator forwarded to the metamethods) some time ago, you > can probably find it in the list archive. It would be nice to have a > simple patch for Lua itself, which could hopefully be integrated in a > future official version. But using appropriate tools will be much much > easier than that, unless you actually enjoy compiler programming in C. I also do believe that m[i,j]=val syntax is long overdue in Lua/LuaJIT. With LuaJIT-2 Lua is becoming a serious contender for scientific numeric work. In some of my unofficial tests in scalar operations LuaJIT-1 beats Matlab 1 to 50 in tight loops. (LuaJIT-2 will do even better). Inability to do m[i,j]=val as __newindex(m,i,j,val) makes it very difficult to design a decent interface to BLAS/LAPACK libraries for matrix operations which is a MUST for any serious scientific numeric simulations. Question for Mike Pall: How difficult is it to put this feature into LuaJIT-2 ?? (If I am not mistaken LuaJIT is not bound by VM bytecode compatibility to Lua interpreter) --Leo-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 13:00:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6F08gB030945; Fri, 6 Nov 2009 13:00:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04ACC1935D; Fri, 6 Nov 2009 12:58:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5B97D19316 for ; Fri, 6 Nov 2009 12:58:38 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N6QHn-00044S-00; Fri, 06 Nov 2009 15:59:35 +0100 Date: Fri, 6 Nov 2009 15:58:30 +0100 From: Mike Pall To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091106145830.GA31168@mike.de> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov wrote: > I also do believe that m[i,j]=val syntax is long overdue in Lua/LuaJIT. > With LuaJIT-2 Lua is becoming a serious contender for scientific > numeric work. In some of my unofficial tests in scalar operations > LuaJIT-1 beats Matlab 1 to 50 in tight loops. (LuaJIT-2 will do even > better). Please post current benchmark results vs. Matlab, if you have any. > Question for Mike Pall: How difficult is it to put this feature into > LuaJIT-2 ?? I want to keep full compatibility with the standard Lua language specification. Additional modules (e.g. bit.*) or additional functionality for standard functions (e.g. xpcall takes args) are ok, of course. That said, given sufficient demand, adding a vector/matrix library is not out of the question. The compiler would be able to eliminate the intermediate object creation for 'm[i][j] = val'. The interpreter, too, with some tricks. So, if you can get over the syntax ... But there are other priorities at the moment. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 14:12:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6GCL8t012759; Fri, 6 Nov 2009 14:12:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FFAE19183; Fri, 6 Nov 2009 14:10:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 935DF19155 for ; Fri, 6 Nov 2009 14:10:46 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA6GBhab006965 for ; Fri, 6 Nov 2009 14:11:46 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 2CC8454C1D0; Fri, 6 Nov 2009 14:11:44 -0200 (BRST) Date: Fri, 6 Nov 2009 14:11:44 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: bottom-up processing Message-ID: <20091106161144.GC3684@inf.puc-rio.br> References: <20091105213239.11871dec@o> <4AF43265.8010608@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF43265.8010608@gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > It does mean that the parser and code generator are very tightly > coupled, though, but it also makes for fast, small memory footprint > compilation. And that is the main reason for using that approach with Lua. > [DISCLAIMER] > I haven't studied Lua's compiler code, so YMMV, but I'm going for the > general principle here. Your description is perfect. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 14:15:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6GFoQJ013445; Fri, 6 Nov 2009 14:15:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C5571A67E; Fri, 6 Nov 2009 14:14:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from caleb.petrasoft.net (caleb.petrasoft.net [174.46.30.71]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D97C519176 for ; Fri, 6 Nov 2009 14:14:26 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by caleb.petrasoft.net (Postfix) with ESMTP id 947BE912A82 for ; Fri, 6 Nov 2009 10:15:24 -0600 (CST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: Debian amavisd-new at petrasoft.net Received: from caleb.petrasoft.net ([127.0.0.1]) by localhost (caleb.petrasoft.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hlxFkDOmSmc1 for ; Fri, 6 Nov 2009 10:15:24 -0600 (CST) Received: from [10.100.3.52] (unknown [10.100.3.52]) by caleb.petrasoft.net (Postfix) with ESMTPA id 040AA91227C for ; Fri, 6 Nov 2009 10:15:24 -0600 (CST) From: Phil Birkelbach Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Lua Library and Mutexas Date: Fri, 6 Nov 2009 10:15:18 -0600 Message-Id: <8545D1D8-60A7-48C1-A7BE-A871A3269704@petrasoft.net> To: Lua list Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean I have an application that spawns several threads, each thread runs a Lua script (each with it's own lua_State). Each script calls some extension functions that abstract a database / communication library that is NOT thread safe. Yesterday I went about adding mutex lock / unlock code around every call to this API from my C code that is called from the scripts. This seemed like the best answer until I got to a function in the API that is basically an iterator. This function calls a callback function to deal with compound data types in the API. This callback function calls Lua library functions, like lua_pushstring(), lua_rawset(), lua_rawget(), etc. There are no lua_error() calls in here. I'm worried about these functions raising errors, longjmp'ing back to the script and leaving my mutex locked, which will deadlock the application. I thought about writing a wrapper function that I can call from lua_cpcall() but the way I read the documentation the stack that is passed to the C function in lua_cpcall() only has the lightuserdata that was passed. I also need the Lua stack that was passed to the original function. Thanks Phil From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 16:38:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6IbvFZ016024; Fri, 6 Nov 2009 16:37:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B599193DB; Fri, 6 Nov 2009 16:35:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C1AD193D1 for ; Fri, 6 Nov 2009 16:35:54 -0200 (BRST) Received: by ewy26 with SMTP id 26so1574862ewy.5 for ; Fri, 06 Nov 2009 10:36:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/rEWvdldEB4ffczxCfUIhTu6qYPrck284tt8jVEJYZM=; b=X3JWpJr06je7CXlSSkM5T/WKHGTA4HVZKK62mAYJV2HtfOJLRCub4Fq1edZUJ2EB+Z 6RaYOATOUX3FtLT2aLnfwD9lEr6cuaBKglP38F9quQli5EY9MLNl9qj1aZzRQ4CzlQIx zrifmPUpNAoKaMGkqWbkNhCZbLKhF9ESJgXcI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vLiyPSARe0XEhPYYJimpr7bcSNxoqb3fNStWrXAAYZXzOQ2yMEnHIdf7dThYM26Uog CY5tOyNc4OtFSSBn0F91EKHd5WFBvLH8TTwsFhVFLQYTyX4dELLTrsqfUmSZH3hJo/3M tKqT+a3W2j6CJXXCBy7I4apgEDNfI7cpKKE+g= MIME-Version: 1.0 Received: by 10.216.88.79 with SMTP id z57mr1639244wee.22.1257532612038; Fri, 06 Nov 2009 10:36:52 -0800 (PST) In-Reply-To: <4AF3E3F6.4090609@my.erau.edu> References: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> <4AF3E3F6.4090609@my.erau.edu> Date: Fri, 6 Nov 2009 10:36:52 -0800 Message-ID: <17eac67c0911061036gee132dwe07984c65c446dd4@mail.gmail.com> Subject: Re: it's a shame about voodoopad From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 6, 2009 at 12:53 AM, Matthew P. Del Buono wrote: > Despite the fact that I can't really change their decision, especially > without giving hard facts, I find it interesting to point out that they > seem to be going in the exact opposite direction as everyone else. I > personally feel (and a few coworkers have brought this up too, > independently) that Lua is rapidly replacing Python as the premier > choice in embedded scripting languages for applications. Why they are > choosing to move back to Python seems to be beyond me. In fact, based > off your quote (I haven't done research myself), it seems to be based > mostly off a personal opinion and off no hard facts whatsoever. Yeah, but the voodoopad author actually put significant time and energy into integrating lua, it's his opionion, but its based on a fair bit of experience. I think that one of two things might have happened. lua is great if most of the code you write interacts with the app you are embedded in. Examples of this would WoW, nmap, wireshark, etc. You don't write lua code in a wireshark dissector that interacts with the world, all it can do is call back into the lua core libraries, and the wireshark libraries. lua is perfect here. But, if you want to write code that half interacts with the app, and also interacts with the outside world, maybe it does xmlrpc calls to get info, maybe it starts up a mini web server or stores things in mysql, etc., then the fact that lua is library poor starts to matter, and the fact that your users might already know how to do all those things in python starts to matter. I think that's what happened to voodoo pad, he's trying to use the embedded language to integrate external libraries into his app. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 17:02:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6J2eY7021910; Fri, 6 Nov 2009 17:02:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F6D71A6C2; Fri, 6 Nov 2009 17:01:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0690B1A6A3 for ; Fri, 6 Nov 2009 17:01:08 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA6J27kQ025894 for ; Fri, 6 Nov 2009 17:02:07 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 4FF9554C1D0; Fri, 6 Nov 2009 17:02:08 -0200 (BRST) Date: Fri, 6 Nov 2009 17:02:08 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091106190208.GA6160@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I'm planning to translate the code like that: > > m[i, j] => __index(m, i, j) > m[i, j] = v => __newindex(m, i, j, v) > > So all the indexes will be feeded to the __index or __newindex > metamethods in the order. I guess that the variable number of > arguments is not a problem: the metamethods are supposed to check how > many arguments and act accordingly. I guess the next code gives a reasonable solution for 2D arrays. (It should not be too dificult to generalize it to n dimensions.) ------------------------------------- local mt1 = { __index = function (t,k) local nt = setmetatable({}, { __index = function (t1, k1) return t:index(k,k1) end, __newindex = function (t1, k1, v) t:newindex(k,k1,v) end, }) t[k] = nt return nt end, mode = 'v', } function newmatrix (index, newindex) return setmetatable({index = index, newindex = newindex}, mt1) end ------------------------------------- The call 'newmatrix(f1,f2)' creates a new matrix 'm' that calls f1(m,i,j) for accesses m[i][j] and calls f2(m,i,j,v) for assignments m[i][j]=v. Memorization avoids creating too much garbage (mainly if you traverse these matrices in proper order). (I slightly different approach is to use a fixed metatable for the inner tables, storing in those tables what are upvalues here. This might save some memory but makes the calls a little more expensive.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 19:12:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6LBsau015510; Fri, 6 Nov 2009 19:11:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B278F19305; Fri, 6 Nov 2009 19:10:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6C3B18C43 for ; Fri, 6 Nov 2009 19:10:13 -0200 (BRST) Received: by pwj9 with SMTP id 9so862307pwj.21 for ; Fri, 06 Nov 2009 13:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=KBcEtRJvgy/VYVcRG05voxhWefOZLbbqKHi9IE8i3Co=; b=tCp/CemPPnWzyh+zZJ3g56L6XP90fUrlWKKlr7k4SBn1YFb/49Hfgzcf6jFAAu6Md/ TjI3F4DO6JlYThNZwwnZT3W/Sy3FuDOJOGEG20lEaIbjt35Opa3mfOdKbLmT+xia0tzx xnKgf6rFRX/gPXtDVNcNnUCa+uT2qq0Rb/hOw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=O5050XVRbER9ESZO4PdKfcbxl1lkEmYYG1AQ7b8tf9NtZIsuFhhoz3WSjojdGMUIf5 l0XyodBznV1YYOLui+njlCcu0vbOaHuiTEThAGybm2zFpkVus8iOvXZ/aq53hnmeDfUJ A0RI5Z9jeVXtSO0Z5b9ZRUmYKm6Di5o+t8ey4= MIME-Version: 1.0 Received: by 10.142.248.40 with SMTP id v40mr482520wfh.203.1257541871748; Fri, 06 Nov 2009 13:11:11 -0800 (PST) In-Reply-To: <17eac67c0911061036gee132dwe07984c65c446dd4@mail.gmail.com> References: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> <4AF3E3F6.4090609@my.erau.edu> <17eac67c0911061036gee132dwe07984c65c446dd4@mail.gmail.com> Date: Fri, 6 Nov 2009 13:11:11 -0800 Message-ID: <3c7e3c8a0911061311y11cc1e3dmc23243eb22f5b5b9@mail.gmail.com> Subject: Re: it's a shame about voodoopad From: "E. Wing" To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 11/6/09, Sam Roberts wrote: > On Fri, Nov 6, 2009 at 12:53 AM, Matthew P. Del Buono > wrote: >> Despite the fact that I can't really change their decision, especially >> without giving hard facts, I find it interesting to point out that they >> seem to be going in the exact opposite direction as everyone else. I >> personally feel (and a few coworkers have brought this up too, >> independently) that Lua is rapidly replacing Python as the premier >> choice in embedded scripting languages for applications. Why they are >> choosing to move back to Python seems to be beyond me. In fact, based >> off your quote (I haven't done research myself), it seems to be based >> mostly off a personal opinion and off no hard facts whatsoever. > > Yeah, but the voodoopad author actually put significant time and > energy into integrating lua, it's his opionion, but its based on a > fair bit of experience. > > I think that one of two things might have happened. > > lua is great if most of the code you write interacts with the app you > are embedded in. Examples of this would WoW, nmap, wireshark, etc. You > don't write lua code in a wireshark dissector that interacts with the > world, all it can do is call back into the lua core libraries, and the > wireshark libraries. lua is perfect here. > > But, if you want to write code that half interacts with the app, and > also interacts with the outside world, maybe it does xmlrpc calls to > get info, maybe it starts up a mini web server or stores things in > mysql, etc., then the fact that lua is library poor starts to matter, > and the fact that your users might already know how to do all those > things in python starts to matter. > > I think that's what happened to voodoo pad, he's trying to use the > embedded language to integrate external libraries into his app. > Actually, I bet the problem is more fundamental. Last I checked, his code was based on LuaObjCBridge which is horribly out of date. It is not Objective-C 2.0 ready among other things and thus will prevent his application from being 64-bit. I am in the middle of writing a new next generation Lua/Objective-C bridge using all the modern things the other bridges use like BridgeSupport and libffi to fix these problems plus do things that the old bridge didn't do well like functions, structs, constants, etc. But it's not done yet. (Though there are lots of things it can do already that the old bridge could not.) But whether this will be enough to convince him to re-adopt Lua is another matter. And my bridge is pretty much a rewrite with new APIs and behaviors, so it will not be a drop-in replacement for the old bridge. (And I don't know how much longer it will take me to finish the new bridge (maybe I need to recruit?). Chances are he will ship before I finish.) -Eric From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 19:14:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6LEN23015931; Fri, 6 Nov 2009 19:14:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E329E193E2; Fri, 6 Nov 2009 19:13:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99EDE1931E for ; Fri, 6 Nov 2009 19:12:52 -0200 (BRST) Received: by iwn5 with SMTP id 5so1115271iwn.11 for ; Fri, 06 Nov 2009 13:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=G1xkzbfIDTpHUYEiXylVSDdLjotWFegz2So03l5Jvsc=; b=K8+7dvGUzlLiH1SaMmGdnpOmT4Jra4TMOK8kNa+1W3tMtZBz0Etu9KH4g3fvclU/8/ dNhSh8sibf5d54xkUM1AOqKyA0fIW/zDaR0vKfbjbuVL8+UwcWlE/yJ3BlMEEWaUaZhx XAvg4uk/a8qumR9FOaInXHoLPXn9+FBsIvsRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=j0K1VaSGuc8aqwp6ZMudb5hKirEacZpW86UYezbGm66xjIsWfJ2hRI/KFiek5bC+bn c/ymNYk7nq2b8BsrIqw2WV6aEF2z5MYYDjs0KsYRMTFRauKxPtgza8IU+YdO7fJsy0wh aOc1s/aZs7Pt7dt7HXwA3iu948W4YrlTkQ7Co= MIME-Version: 1.0 Received: by 10.231.73.131 with SMTP id q3mr135322ibj.6.1257542030234; Fri, 06 Nov 2009 13:13:50 -0800 (PST) In-Reply-To: <3c7e3c8a0911061311y11cc1e3dmc23243eb22f5b5b9@mail.gmail.com> References: <7F2AA1CD-B2EE-4F39-A531-4ABF2DD36E18@mat.ucsb.edu> <4AF3E3F6.4090609@my.erau.edu> <17eac67c0911061036gee132dwe07984c65c446dd4@mail.gmail.com> <3c7e3c8a0911061311y11cc1e3dmc23243eb22f5b5b9@mail.gmail.com> Date: Fri, 6 Nov 2009 13:13:50 -0800 Message-ID: <1079b050911061313p73cbf162mab670af01741bb47@mail.gmail.com> Subject: Re: it's a shame about voodoopad From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Actually, I bet the problem is more fundamental. Last I checked, his > code was based on LuaObjCBridge which is horribly out of date. It is > not Objective-C 2.0 ready among other things and thus will prevent his > application from being 64-bit. I also think this is the problem. There wasn't much effort put into making the Lua plugin from what I can tell. Just a few globals and LuaObjCBridge, which doesn't make for the best interface. wes From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 19:33:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6LXaq5019252; Fri, 6 Nov 2009 19:33:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18FB319397; Fri, 6 Nov 2009 19:32:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70E2419397 for ; Fri, 6 Nov 2009 19:32:00 -0200 (BRST) Received: by yxe17 with SMTP id 17so1263881yxe.33 for ; Fri, 06 Nov 2009 13:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xV/52sR6s5+XvVx4ZmsHdr87HsMjpeQK0McKTVMxISk=; b=XsC5GGMij7XmW+bZBlaOWxKX7dzkNfkjyWss16XoCme0eMlEVbnblVu7dEycn7y284 b9HAnbaJjox7CpEhj7SNXKRPVBNh4PZkNz2p/K6IzZ34yAzc1f7NSJhtSg+6nO19C3uA x6AX6SCx+eUIHHt7a4c+TlcujHV8NBcuybceg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eh5oNruYz2pv5r/SwShkjPxQwIkIKkr/vx2pNOtnvaaoD4IukBBdDpWY3xsPAbi2GF e0y0jJrSmAFwUEUap7BnXCK9FvAiV5rriXYRwI9C09eQbo4KVde/OugGqetk5yjT3i08 rHxk4QUeOQa5Gg10XfnKjQfYoJCwOlhX2X7X8= MIME-Version: 1.0 Received: by 10.101.106.40 with SMTP id i40mr5276667anm.193.1257543178704; Fri, 06 Nov 2009 13:32:58 -0800 (PST) In-Reply-To: <560972290911060544x63c3aa68t5e6f79ada0d1349b@mail.gmail.com> References: <7D9A478C-BF40-46A6-8349-995FAF7A0631@comcast.net> <560972290911060453p4aceebbcy600d30c4b7dbc92a@mail.gmail.com> <560972290911060506n646bcd5bobc4d69fc50b0086f@mail.gmail.com> <560972290911060511p6a2c830cr8434e566f5f7270c@mail.gmail.com> <560972290911060544x63c3aa68t5e6f79ada0d1349b@mail.gmail.com> Date: Fri, 6 Nov 2009 19:32:58 -0200 Message-ID: Subject: Re: Passing C struct values automatically to Lua From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636c928b574dd830477ba969f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c928b574dd830477ba969f Content-Type: text/plain; charset=ISO-8859-1 Thanks steve, I see what you mean.. but since I just need the path, I would rather only pass the path as a parameter... Specially because I call these functions each frame, so it needs to be optimized... 2009/11/6 steve donovan > On Fri, Nov 6, 2009 at 3:20 PM, zweifel wrote: > > hey steve, that would be a better solution, but why my print(arg) returns > > nil? Ok, maybe I have not passed any arguments, but do I have to pass > args > > in order to access the arg[0]?? > > Because it's only set by the Lua interpreter itself. But you can > create your own args table, make it global and access that from your > script. > > E.g. in lua.c: > > int narg = getargs(L, argv, n); /* collect arguments */ > lua_setglobal(L, "arg"); > > where getargs() is > > static int getargs (lua_State *L, char **argv, int n) { > int narg; > int i; > int argc = 0; > while (argv[argc]) argc++; /* count total number of arguments */ > narg = argc - (n + 1); /* number of arguments to the script */ > luaL_checkstack(L, narg + 3, "too many arguments to script"); > for (i=n+1; i < argc; i++) > lua_pushstring(L, argv[i]); > lua_createtable(L, narg, n + 1); > for (i=0; i < argc; i++) { > lua_pushstring(L, argv[i]); > lua_rawseti(L, -2, i - n); > } > return narg; > } > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636c928b574dd830477ba969f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks steve,

I see what you mean.. but since I just need the path, = I would rather only pass the path as a parameter...

Specially becaus= e I call these functions each frame, so it needs to be optimized...

2009/11/6 steve donovan <steve.j.donovan@gmail.com>= ;
On Fri, Nov 6, 2009 at 3:20 PM, zweifel <zweifel@gmail.com> wrote:
> hey steve, that would be a better solution, but why my print(arg) retu= rns
> nil? Ok, maybe I have not passed any arguments, but do I have to pass = args
> in order to access the arg[0]??

Because it's only set by the Lua interpreter itself. =A0But you c= an
create your own args table, make it global and access that from your
script.

E.g. in lua.c:

=A0int narg =3D getargs(L, argv, n); =A0/* collect arguments */
=A0lua_setglobal(L, "arg");

where getargs() is

static int getargs (lua_State *L, char **argv, int n) {
=A0int narg;
=A0int i;
=A0int argc =3D 0;
=A0while (argv[argc]) argc++; =A0/* count total number of arguments */
=A0narg =3D argc - (n + 1); =A0/* number of arguments to the script */
=A0luaL_checkstack(L, narg + 3, "too many arguments to script");=
=A0for (i=3Dn+1; i < argc; i++)
=A0 =A0lua_pushstring(L, argv[i]);
=A0lua_createtable(L, narg, n + 1);
=A0for (i=3D0; i < argc; i++) {
=A0 =A0lua_pushstring(L, argv[i]);
=A0 =A0lua_rawseti(L, -2, i - n);
=A0}
=A0return narg;
}



--
God$ g++ -o earth earth= .cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636c928b574dd830477ba969f-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 20:26:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6MQaJj025028; Fri, 6 Nov 2009 20:26:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 366CF19406; Fri, 6 Nov 2009 20:25:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54B44193EE for ; Fri, 6 Nov 2009 20:25:00 -0200 (BRST) Received: by ewy26 with SMTP id 26so1793931ewy.5 for ; Fri, 06 Nov 2009 14:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type; bh=qPSpd2bwnnv0yNshHe0+gq7kyyLxT6mUxCxG4TymiVE=; b=Dl1bYtWjFBRmy26LmIOXi+1Hw6JZNp5NeZz13HMgLo2j861KUtfZdvdLCHq+xXk9vH K+AusgWX3Wfg2TKZ6UgKQzsZQl/SXg/DwKTscdZtr8kfmRyUeL2RSOm3aCXt/A4Xdx7a xUBe+AihoRgMeMrcnyndoaRA3FExujJOHqAqA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; b=r9j+LGP9/kqVqDAYLY3C45sWl6IVaEzI+zNAak1Kt057UlSHfOt83QRVBckT/xbYWW BkZJHhwT/iGQHZULCNGJG2nF1cFtVRpGNwbbSelDMUwm+yB1yt6pXcrFU6lWoHfNuXZ8 ZJWiOaptrVQkSl72n6gEBSXAvtT0UwoUsRgns= MIME-Version: 1.0 Received: by 10.216.93.68 with SMTP id k46mr1582517wef.161.1257546358350; Fri, 06 Nov 2009 14:25:58 -0800 (PST) Date: Fri, 6 Nov 2009 17:25:58 -0500 Message-ID: Subject: LuaJIT vs MATLAB benchmark [Was: Re: help to (slightly) modify Lua interpreter] From: Leo Razoumov To: Lua list Content-Type: multipart/mixed; boundary=0016e6d64441fa70700477bb53bd X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d64441fa70700477bb53bd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2009-11-06, Mike Pall wrote: > Please post current benchmark results vs. Matlab, if you have any. For whatever it is worth below is a comparison of LuaJIT-1 versus MATLAB-7.8.0 (February 2009 release) for a scalar tight loop performance. Comparison is done on 64-bit 4 way Quadcore machine (16 cores total) running Linux * 4 x QuadCore Intel(R) Xeon(R) CPU E5530 @ 2.40GHz * Linux 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 06:38:05 EDT 2009 x86_64 GNU/Linux * memory 64GB * MATLAB Version 7.8.0.347 (R2009a) 64-bit (glnxa64) February 12, 2009 * Lua 5.1.4 (aka LuaJIT-1) To double check MATLAB results I asked my colleague to run the test on Windows XP version of MATLAB on Core2Duo laptop @ 2GHz. The test programs that compute Euler constant are attached to this message. The results are below. In the case of MATLAB the so called "Elapsed time" as reported by tic/toc commands is more accurate metric then output from "time" command. "time" counts Matlab startup time that can be couple of seconds while MATLAB's "Elapsed time" is pure script execution time. * (1) MATLAB (Linux): N =3D 1E+07 euler=3D 0.577216 Elapsed time is 16.714563 seconds. real 0m19.863s user 0m17.524s sys 0m0.173s * (2) LuaJIT-1 (Linux) N =3D 1E+07 euler=3D 0.577216 real 0m0.140s user 0m0.139s sys 0m0.001s * (3) MATLAB (Windows XP, different hardware. Core2Duo @ 2GHz) N =A0 =A0=3D 1E+007 euler=3D 0.577216 Elapsed time is 12.677472 seconds. It seems that MATLAB Windows port is better optimized but it is still about 100 times slower than LuaJIT-1. The joke is that MATLAB has its own JIT since version 6.5 and JIT was enabled for these tests. Now you may ask how come that people put up with such a poor performance of the interpreter. The answer is multi-fold. First they buy hardware. 16 core machine can simultaneously run 16 independent and slow simulations and I have an access to a dozen of those boxes. Often one can convert loops into vector operations and offload them from the interpreter to high performance numeric libraries included in MATLAB and these libraries are good! However, if one has conditionals inside a loop, vectorization becomes problematic. Also it is difficult-to-impossible to vectorize event driven simulations. Additionally, vectorization trades off memory for performance. MATLAB cannot run on an embedded system but LuaJIT can. As the last resort one can write critical sections in C/C++ using Matlab's MX interface. There is also a MATLAB compiler but I have not much experience with it. LuaJIT performance together with its ability to nicely interface to native libraries can make it a viable contender in the fields of numeric and scientific computing. --Leo-- --0016e6d64441fa70700477bb53bd Content-Type: text/x-objcsrc; charset=US-ASCII; name="bmark_euler.m" Content-Disposition: attachment; filename="bmark_euler.m" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1phybwv JSBCZW5jaG1hcms6IEV1bGVyIGNvbnN0YW50CiUgUnVuIGFzOiBzaCQgdGltZSBtYXRsYWIgLW5v c3BsYXNoIC1ub2p2bSAtciBibWFya19ldWxlcgoKdGljCnN1bT0gMDsKTj0gMUU3Owpmb3Igbj0x OjE6TgogIHN1bSA9IHN1bSArIDEvbjsKZW5kCmV1bGVyPSBzdW0gLSBsb2coTik7CmZwcmludGYo J04gICAgPSAlR1xuJywgTik7CmZwcmludGYoJ2V1bGVyPSAlR1xuJywgZXVsZXIpOwp0b2MKcXVp dAoKJUVvRgo= --0016e6d64441fa70700477bb53bd Content-Type: text/x-lua; charset=US-ASCII; name="bmark_euler.lua" Content-Disposition: attachment; filename="bmark_euler.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1phz01s bG9jYWwgTj0gMUU3CmxvY2FsIHN1bT0gMApmb3Igbj0xLE4gZG8KICAgIHN1bT0gc3VtICsgMS9u CmVuZApsb2NhbCBldWxlcj0gc3VtIC0gbWF0aC5sb2coTikKcHJpbnQoKCJOICAgID0gJUciKTpm b3JtYXQoTikpCnByaW50KCgiZXVsZXI9ICVHXG4iKTpmb3JtYXQoZXVsZXIpKQo= --0016e6d64441fa70700477bb53bd-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 20:30:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6MUT6p025510; Fri, 6 Nov 2009 20:30:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21B4D19413; Fri, 6 Nov 2009 20:29:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 008281940C for ; Fri, 6 Nov 2009 20:29:01 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so389323eye.39 for ; Fri, 06 Nov 2009 14:30:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=4ZKospgFdsY/OTR8kdeiEu2XIR2BZBHhqKNAhgQNoNg=; b=mphR6vR2aYMacx2xJdDbh/bSZo+mUVwtn5pYCoqyqmQRO3eaYRpBLp4pay6grN5115 a7swx3JNb07KNoWiPwgRnXKWP4HrsuhjKn/m7DfyXRJkqumhSDfz7I/+vWAqFstSu1V5 AsE9rRKx6gA5TvKoI3+n6JiEI2PB65PCY9lFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=NgfN7KGvpb+vTJvnL4l2+nnsnn/LdRr1F1NPK10yvOqnUaP2x3gONMF3KpYCNAxsB3 4YP/9TiqtHW3sVRmRgnLvq+hJ13DEURqkFeU5irBD+1N/s7NCdJRqPRkxhW+o28zGC5R 0J/DRQzVRrbERVRcxxXOgJTg/ZGGfL7s06Bvs= MIME-Version: 1.0 Received: by 10.216.86.206 with SMTP id w56mr1536212wee.1.1257546600850; Fri, 06 Nov 2009 14:30:00 -0800 (PST) In-Reply-To: <20091106190208.GA6160@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <20091106190208.GA6160@inf.puc-rio.br> Date: Fri, 6 Nov 2009 17:30:00 -0500 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-06, Roberto Ierusalimschy wrote: > > I'm planning to translate the code like that: > > > > m[i, j] => __index(m, i, j) > > m[i, j] = v => __newindex(m, i, j, v) > > > > So all the indexes will be feeded to the __index or __newindex > > metamethods in the order. I guess that the variable number of > > arguments is not a problem: the metamethods are supposed to check how > > many arguments and act accordingly. > > > I guess the next code gives a reasonable solution for 2D arrays. > (It should not be too dificult to generalize it to n dimensions.) > > ------------------------------------- > local mt1 = { __index = function (t,k) > local nt = setmetatable({}, { > __index = function (t1, k1) > return t:index(k,k1) > end, > __newindex = function (t1, k1, v) > t:newindex(k,k1,v) > end, > }) > t[k] = nt > return nt > end, > mode = 'v', > } > > > function newmatrix (index, newindex) > return setmetatable({index = index, newindex = newindex}, mt1) > end > ------------------------------------- Every time m[i][j] is called two new closures are created to be used only once. Would it drive GC crazy if m[i][j] is used withing loops millions of times?? --Leo-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 20:42:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6MgnON027242; Fri, 6 Nov 2009 20:42:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABBAC19392; Fri, 6 Nov 2009 20:41:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA02119382 for ; Fri, 6 Nov 2009 20:41:20 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N6XVZ-0003KN-Du for lua@bazar2.conectiva.com.br; Fri, 06 Nov 2009 23:42:17 +0100 Received: from p5b2c22df.dip.t-dialin.net ([91.44.34.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Nov 2009 23:42:17 +0100 Received: from dak by p5b2c22df.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Nov 2009 23:42:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: LuaJIT vs MATLAB benchmark Date: Fri, 06 Nov 2009 23:41:55 +0100 Organization: Organization?!? Lines: 32 Message-ID: <878weji8cs.fsf@lola.goethe.zz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c22df.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:ntBrVxckOIloPSt5zB88qLRlIqY= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Leo Razoumov writes: > On 2009-11-06, Mike Pall wrote: >> Please post current benchmark results vs. Matlab, if you have any. > > For whatever it is worth below is a comparison of LuaJIT-1 versus > MATLAB-7.8.0 (February 2009 release) for a scalar tight loop > performance. [...] > It seems that MATLAB Windows port is better optimized but it is still > about 100 times slower than LuaJIT-1. The joke is that MATLAB has its > own JIT since version 6.5 and JIT was enabled for these tests. > > Now you may ask how come that people put up with such a poor > performance of the interpreter. The answer is multi-fold. And mostly wrong. Matlab is _known_ to suck at scalar code and nested loops. Nobody uses it in that manner for serious number crunching. What you do is convert your task into a matrix operation task. At times that takes quite a bit of ingenuity. It helps that you can index a matric or vector using a vector (and getting a vector), and the vectors of form a:b (a range) are often optimized away into explicit code/loops. There are tutorials and stuff around for maximizing Matlab performance. And the main point is to avoid scalar operations. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 21:03:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6N3sBu029328; Fri, 6 Nov 2009 21:03:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3C45819407; Fri, 6 Nov 2009 21:02:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9BFA8193EE for ; Fri, 6 Nov 2009 21:02:23 -0200 (BRST) Received: by ewy26 with SMTP id 26so1819507ewy.5 for ; Fri, 06 Nov 2009 15:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=6mcmF9HTWJ3WIbpoObRshn7tEu0K4/g5szp0bt0cZ64=; b=qEJBmh/tF9/QS934Qwl8nleH9JCi17DNdk7lSJgnNTuuIFYx0M9e2ECA9u3Tm/71HZ M8/6JYAj6NzwRFxPurPlFerbGhZXeW/f0byZCpT1Imi/j7tsd+Ysr1VdmIJqtmEbjHP3 T0aM7pMv1tSNZU27IjmviCniOBFmG6H9/IK1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=NrNxMLFMvMYCFZRq+xChznnqJ53RBH7493X24Pa30sHqg0zuuHRxVxDvveHDQZ4YlC zwZGLtYLUm6t9YkyGzXifZs5wmXcgs3Tdo9IWHlQL3WXKLg7lJEbavBxmynGePgBNucX sqZq3S4KkcoG98FXyf7TXlAIgiXn8I1T2mIJ8= MIME-Version: 1.0 Received: by 10.216.93.75 with SMTP id k53mr408606wef.209.1257548600868; Fri, 06 Nov 2009 15:03:20 -0800 (PST) In-Reply-To: <878weji8cs.fsf@lola.goethe.zz> References: <878weji8cs.fsf@lola.goethe.zz> Date: Fri, 6 Nov 2009 18:03:20 -0500 Message-ID: Subject: Re: LuaJIT vs MATLAB benchmark From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-06, David Kastrup wrote: > > Matlab is _known_ to suck at scalar code and nested loops. Nobody uses > it in that manner for serious number crunching. What you do is convert > your task into a matrix operation task. At times that takes quite a bit > of ingenuity. It helps that you can index a matric or vector using a > vector (and getting a vector), and the vectors of form a:b (a range) are > often optimized away into explicit code/loops. > > There are tutorials and stuff around for maximizing Matlab performance. > And the main point is to avoid scalar operations. > > -- > > David Kastrup > I think you did not read my email carefully:-) After professionally working with MATLAB for more than a decade I know how to use vectors and matrices and how to avoid scalar operations for simple control flows. But if you have non-trivial logic in your loop constructs or/and you are doing event driven processing you cannot vectorize. These days MATLAB is used (and abused) for much more than just a matrix calculator it once was. I deliberately have chosen scalar operations test because I wanted an apple-to-apple comparison between two JIT compilers. In case of vectorized algorithms MATLAB will spend most of the time inside its highly optimized numeric libraries and it tells you nothing about MATLAB's own JIT performance. --Leo-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 21:28:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6NSr0q032191; Fri, 6 Nov 2009 21:28:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D48419427; Fri, 6 Nov 2009 21:27:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB43819416 for ; Fri, 6 Nov 2009 21:27:24 -0200 (BRST) Received: by pzk34 with SMTP id 34so997612pzk.11 for ; Fri, 06 Nov 2009 15:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=U4y8z7W/26HT62UgvSfqnXuLw6VfJ2bkbVTotfYvnwM=; b=u6ecKIPqtXS05WBamVEE4YUqyNOD2ZrVw5QphPcDtDaG1R4p26h17DB9lZRmheRllI CME5AgrCpbFDnfHsevbMENLXTEueeG9G1gsrBrW8Mn+oU6y6+LXvZeTki61UT/dna9e8 t4vIoXUEedLsRnJzqsEx4ZSkKsiKxIpsMWW3w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jiVod9pp3wKh9CDAImdf8owMdHIyWwWEs0eKG+E53cGKu8DpQWQbbpbfVcm56xW5A+ CxQ8lj1IOT2uEZJ5mOc3rBk5aYPTPli3Jtww5pMVVr3cp0Cs+oaBJTVJ9lNOUQ7rVou4 KJ+6a4y8rl/rmciT4lcCHcDEIqJAxUnSzjGKg= MIME-Version: 1.0 Received: by 10.140.199.10 with SMTP id w10mr278484rvf.205.1257550102979; Fri, 06 Nov 2009 15:28:22 -0800 (PST) In-Reply-To: <20091106145830.GA31168@mike.de> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> <20091106145830.GA31168@mike.de> Date: Sat, 7 Nov 2009 02:28:22 +0300 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > That said, given sufficient demand, adding a vector/matrix library > is not out of the question. The compiler would be able to > eliminate the intermediate object creation for 'm[i][j] = val'. > The interpreter, too, with some tricks. So, if you can get over > the syntax ... Ugh. On the rights of the voice from the crowd: I'm not against the possibility that LuaJIT would extend Lua syntax. However, I ask for a clear option to disable any such extensions on all levels -- compiler, interpreter whatever ("run as strict Lua, as defined by the Lua Programming Manual"). If I'm to adopt LuaJIT for production, this is the critical feature. It is too easy to deviate from Lua to some "luaish" language, and, for me, it is crucial to have full 100% two-way compatibility. At least for the documented behavior. With all respect and awe, LuaJIT is younger than Lua. If I stumble on a show-stopper bug while using LuaJIT, I want to be able to quickly switch back to Lua until the bug is fixed. If I use LuaJIT as a primary tool, I need to be sure that I wouldn't accidentally use some obscure "language extension" which would prevent me to run my code on plain Lua. Of course I may (and will) run tests for my code on both Lua and LuaJIT, but tests never cover 100% of the code... Alexander. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 21:34:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6NYF8B000329; Fri, 6 Nov 2009 21:34:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF7C119409; Fri, 6 Nov 2009 21:32:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3AAD4193EE for ; Fri, 6 Nov 2009 21:32:46 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N6YJM-0006Qz-6c for lua@bazar2.conectiva.com.br; Sat, 07 Nov 2009 00:33:44 +0100 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 00:33:44 +0100 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 00:33:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Threading headaches Date: Fri, 06 Nov 2009 15:32:37 -0800 Lines: 41 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is there any 'gotchas' to using luaL_openlibs() from multiple OS threads with separate Lua states? I am getting a rash of these while opening new Lua states en masse (but only when opening new states): Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x282028b0 (LWP 100257)] 0x280d047a in lua_newstate () from /usr/local/lib/liblua-5.1.so.1 (gdb) bt #0 0x280d047a in lua_newstate () from /usr/local/lib/liblua-5.1.so.1 #1 0x280c5c48 in lua_rawget () from /usr/local/lib/liblua-5.1.so.1 #2 0x280d47c4 in luaL_findtable () from /usr/local/lib/liblua-5.1.so.1 #3 0x280d4ce9 in luaL_openlib () from /usr/local/lib/liblua-5.1.so.1 #4 0x280d4e07 in luaL_register () from /usr/local/lib/liblua-5.1.so.1 #5 0x280d59ca in luaopen_base () from /usr/local/lib/liblua-5.1.so.1 #6 0x280c9926 in lua_resume () from /usr/local/lib/liblua-5.1.so.1 #7 0x280c9d15 in lua_resume () from /usr/local/lib/liblua-5.1.so.1 #8 0x280c5863 in lua_call () from /usr/local/lib/liblua-5.1.so.1 #9 0x280de481 in luaL_openlibs () from /usr/local/lib/liblua-5.1.so.1 #10 0x00000001 in ?? () #11 0x00000000 in ?? () #12 0x2820dfd0 in ?? () #13 0x2820dfd0 in ?? () #14 0x00000064 in ?? () #15 0xbe3e8f98 in ?? () #16 0x08049d9b in worker_run (a=0x283bd448) at main.c:281 Previous frame inner to this frame (corrupt stack?) Now the last line makes me think I am doing something asinine within some unrelated code. But I thought I would ask just to make sure. On a related (sorta) note, I was testing various third-party Lua C Modules (like LuaSQL). Strangely, even without enabling thread-safety on the mysql and pgsql client libs everything ran great. This is at decent levels of concurrency (100 threads using 100 Lua states with 100 modules loaded and connections to the DB). Running around 800-2000 TPS with millions of select/insert/update transactions, and not a peep. Do you really need "thread-safe" builds of these libs when using each instance of the modules only from the Lua state that requir()ed it? Or am I just getting lucky? From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 21:45:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA6NjtCC001456; Fri, 6 Nov 2009 21:45:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69E8419428; Fri, 6 Nov 2009 21:44:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A387919407 for ; Fri, 6 Nov 2009 21:44:28 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so400842eye.39 for ; Fri, 06 Nov 2009 15:45:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.3.140 with SMTP id 12mr75536ebn.20.1257551127640; Fri, 06 Nov 2009 15:45:27 -0800 (PST) In-Reply-To: References: Date: Sat, 7 Nov 2009 01:45:27 +0200 X-Google-Sender-Auth: dc332280e2b51b72 Message-ID: Subject: Re: Threading headaches From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Do you really need > "thread-safe" builds of these libs when using each instance of the modules > only from the Lua state that requir()ed it? Or am I just getting lucky? > AFAIK, a shared library can only be loaded once (i.e. have one global state) per process. If only that weren't true, many stateful libs would become thread-safe automatically and the Lua C API wouldn't need a state argument. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 22:20:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA70Kdrv004740; Fri, 6 Nov 2009 22:20:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D093919426; Fri, 6 Nov 2009 22:19:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E034D1940F for ; Fri, 6 Nov 2009 22:19:06 -0200 (BRST) Received: by iwn5 with SMTP id 5so1226403iwn.11 for ; Fri, 06 Nov 2009 16:20:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.26.131 with SMTP id e3mr927074ibc.0.1257553205321; Fri, 06 Nov 2009 16:20:05 -0800 (PST) In-Reply-To: <4AF3207F.1030600@elbitsystems-us.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105132622.GA17341@magritte.tecgraf.puc-rio.br> <4ff79edb0911050630uf7f44b8y8eca5f98bdb6f3e4@mail.gmail.com> <4ff79edb0911050642i308442c2xfeae7dc493660dd1@mail.gmail.com> <4AF3207F.1030600@elbitsystems-us.com> Date: Fri, 6 Nov 2009 19:20:05 -0500 X-Google-Sender-Auth: c1c8538c2beb17a5 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA70Kdrv004740 On Thu, Nov 5, 2009 at 1:59 PM, Doug Rogers wrote: > Well, you've inspired me to do some crazy coding. I use the __call > metamethod on a tensor (matrix of possibly more dimensions) to return an > element-reference object whose own __call metamethod allows access to > the element. I also provide set() and get() functions may be used for > the element-reference object. Finally, just for fun, I overload __index > and __newindex to get or set the element, but that requires a dummy index > ... > local _ = true   -- Can be anything except nil. > p(1,2,3)[_] = 123 > print(p(1,2,3)[_]) This variant would be preferable: p(1,2,3).v = 123 print(p(1,2,3).v) Something like that is actually done when scripting Excel: ws.Cells(1, 2).Value = y From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 23:05:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA7159D1010273; Fri, 6 Nov 2009 23:05:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 10C7D19434; Fri, 6 Nov 2009 23:03:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ADB119428 for ; Fri, 6 Nov 2009 23:03:38 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N6ZjF-0002b2-U5 for lua@bazar2.conectiva.com.br; Sat, 07 Nov 2009 02:04:33 +0100 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 02:04:33 +0100 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 02:04:33 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Threading headaches Date: Fri, 06 Nov 2009 17:03:36 -0800 Lines: 42 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stefan wrote: > Is there any 'gotchas' to using luaL_openlibs() from multiple OS threads > with separate Lua states? > > I am getting a rash of these while opening new Lua states en masse (but > only when opening new states): > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x282028b0 (LWP 100257)] > 0x280d047a in lua_newstate () from /usr/local/lib/liblua-5.1.so.1 > (gdb) bt > #0 0x280d047a in lua_newstate () from /usr/local/lib/liblua-5.1.so.1 > #1 0x280c5c48 in lua_rawget () from /usr/local/lib/liblua-5.1.so.1 > #2 0x280d47c4 in luaL_findtable () from /usr/local/lib/liblua-5.1.so.1 > #3 0x280d4ce9 in luaL_openlib () from /usr/local/lib/liblua-5.1.so.1 > #4 0x280d4e07 in luaL_register () from /usr/local/lib/liblua-5.1.so.1 > #5 0x280d59ca in luaopen_base () from /usr/local/lib/liblua-5.1.so.1 > #6 0x280c9926 in lua_resume () from /usr/local/lib/liblua-5.1.so.1 > #7 0x280c9d15 in lua_resume () from /usr/local/lib/liblua-5.1.so.1 > #8 0x280c5863 in lua_call () from /usr/local/lib/liblua-5.1.so.1 > #9 0x280de481 in luaL_openlibs () from /usr/local/lib/liblua-5.1.so.1 > #10 0x00000001 in ?? () > #11 0x00000000 in ?? () > #12 0x2820dfd0 in ?? () > #13 0x2820dfd0 in ?? () > #14 0x00000064 in ?? () > #15 0xbe3e8f98 in ?? () > #16 0x08049d9b in worker_run (a=0x283bd448) at main.c:281 > Previous frame inner to this frame (corrupt stack?) > > Now the last line makes me think I am doing something asinine within > some unrelated code. But I thought I would ask just to make sure. > Nothing to see here, move along please. Sorry for the noise, it appears that my C string math is a wee bit rusty. My logging was not leaving enough room for the timestamp in the line buffer - which was throughly stomping the stack after thousands of (debug) log lines. This is what I get for programming in Lua so long... :P From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 23:44:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA71ie6a015219; Fri, 6 Nov 2009 23:44:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C06FB193C0; Fri, 6 Nov 2009 23:43:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 243101932B for ; Fri, 6 Nov 2009 23:43:08 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N6aLW-0005Oo-Oa for lua@bazar2.conectiva.com.br; Sat, 07 Nov 2009 02:44:06 +0100 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 02:44:06 +0100 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Nov 2009 02:44:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Threading headaches Date: Fri, 06 Nov 2009 17:43:02 -0800 Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cosmin Apreutesei wrote: >> Do you really need >> "thread-safe" builds of these libs when using each instance of the modules >> only from the Lua state that requir()ed it? Or am I just getting lucky? >> > > AFAIK, a shared library can only be loaded once (i.e. have one global > state) per process. If only that weren't true, many stateful libs > would become thread-safe automatically and the Lua C API wouldn't need > a state argument. > Indeed. I found out I actually was a little bit lucky - FreeBSD by default enables thread safety on everything possible in the port tree. I will add it to the luafcgid README. All linked libs in the modules must be threadsafe. Does anyone know of any common Lua modules that are not usually threadsafe? This way I could list them. From lua-bounces@bazar2.conectiva.com.br Fri Nov 6 23:52:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA71qDem015999; Fri, 6 Nov 2009 23:52:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73DEC193E1; Fri, 6 Nov 2009 23:50:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CD02193E9 for ; Fri, 6 Nov 2009 23:50:37 -0200 (BRST) Received: by fxm21 with SMTP id 21so436142fxm.21 for ; Fri, 06 Nov 2009 17:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=VIzpAkcnGn6JgQAqpD5vs/hNyp95ddrbN54+eap5U3U=; b=Svu5xrHsw5zN9FiY7qe8JLEHUkt0GVLKJTWUDrzX0eWu33byojcx7aEUUiHB/AwQlY 0thUoD5VCDv5oSmFm2Ko2IEaIKfNcixSnv/PBhC5/Uk+MFtNdEmryOsdctZRaPmjmjW3 /5wvRnMbVbyZXeUc1hCrgfA2A270QT3EYdFfY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=AmJbJxie05yNN3ucq0P94EdTR9TC6RU6gdWkIl5lXAzla3DEwcsJxirihuQxKk/nvK yJumGfHgFfVx8FY9Gv6Yp2OKvq+GacXBkGNugIcOYmkEVKD+OHelFAfyDONVM/3h/vzm f0Hd121ddr5hRUV5qeKsSjEzT9D2/7t7luIjg= MIME-Version: 1.0 Received: by 10.204.48.212 with SMTP id s20mr299288bkf.101.1257558696287; Fri, 06 Nov 2009 17:51:36 -0800 (PST) In-Reply-To: References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> <20091106145830.GA31168@mike.de> From: Matthew Wild Date: Sat, 7 Nov 2009 01:51:16 +0000 Message-ID: <4db9cacb0911061751m2a626f50va576b917405bb220@mail.gmail.com> Subject: Re: help to (slightly) modify Lua interpreter To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/6 Alexander Gladysh : >> That said, given sufficient demand, adding a vector/matrix library >> is not out of the question. The compiler would be able to >> eliminate the intermediate object creation for 'm[i][j] = val'. >> The interpreter, too, with some tricks. So, if you can get over >> the syntax ... > > Ugh. On the rights of the voice from the crowd: > > I'm not against the possibility that LuaJIT would extend Lua syntax. > > However, I ask for a clear option to disable any such extensions on > all levels -- compiler, interpreter whatever ("run as strict Lua, as > defined by the Lua Programming Manual"). > > If I'm to adopt LuaJIT for production, this is the critical feature. > Either I'm mistaken, or the email you quote didn't advocate any syntax extensions. As I understand it Mike was talking of the possibility of LuaJIT having a built-in matrix library (require "matrix") so you could create a matrix object (m = matrix.new(x, y)) and reference any position (m[x][y]) efficiently without the overhead one incurs trying to replicate this in standard Lua. It would be simple to make such a library for standard Lua too (same API, but without the internal optimisations possible in LuaJIT) - code examples have already been given in this thread. Matthew From lua-bounces@bazar2.conectiva.com.br Sat Nov 7 01:59:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA73xQuC028571; Sat, 7 Nov 2009 01:59:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 22F441A6A2; Sat, 7 Nov 2009 01:57:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A0511A667 for ; Sat, 7 Nov 2009 01:57:54 -0200 (BRST) Received: by iwn5 with SMTP id 5so1307004iwn.11 for ; Fri, 06 Nov 2009 19:58:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.126.104 with SMTP id b40mr441800ibs.30.1257566330116; Fri, 06 Nov 2009 19:58:50 -0800 (PST) Date: Fri, 6 Nov 2009 22:58:50 -0500 X-Google-Sender-Auth: 054793a37a65f028 Message-ID: Subject: column numbers in errors and debug info From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Why does Lua debug info, as well as error messages, contain line numbers but not columns numbers? It might be argued that column numbers take up extra memory. However, Lua's line number storage (f->lineinfo) has a very low entropy. Here's a dump of f->lineinfo using tests/cf.lua: 3 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 5 8 8 8 8 10 10 10 10 11 11 11 11 11 12 12 12 13 13 13 13 13 13 13 13 11 15 15 15 15 3 16 In the same space, we could instead store character positions. With less than 50% additional space, we could also store a line number <-> character position index: 3 X 4 X 5 X 6 X 8 X 10 X 11 X 12 X 13 X 15 X 16 X (note: X represents character positions that I've left uncomputed) Significant opportunities exist for compressing the above data so that total memory requirements with column numbers would be less than the current memory requirements on average. A simple way may be to make lineinfo be a byte array storing deltas of neighboring elements as varints [1]. On average, this will require about 1 byte per instruction, not including the above index. Decoding speed is not much of a concern since decoding debug information is limited to exceptional circumstances. [1] http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints From lua-bounces@bazar2.conectiva.com.br Sat Nov 7 02:19:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA74JPaI030504; Sat, 7 Nov 2009 02:19:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71F8F1A6C2; Sat, 7 Nov 2009 02:18:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out3.iinet.net.au (outbound.icp-qv1-irony-out3.iinet.net.au [203.59.1.148]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1EF861A667 for ; Sat, 7 Nov 2009 02:18:00 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAAKE9ErLO4qD/2dsb2JhbACROcpChD4Egl4 X-IronPort-AV: E=Sophos;i="4.44,698,1249228800"; d="scan'208";a="519477090" Received: from unknown (HELO Mania) ([203.59.138.131]) by outbound.icp-qv1-irony-out3.iinet.net.au with SMTP; 07 Nov 2009 12:18:57 +0800 Message-ID: <572D4EC602434EA3857FA475776705E3@Mania> From: "Alex Davies" To: "Lua list" References: <4AF4174E.4060409@inconcertcc.com> <20091106130623.GA2051@inf.puc-rio.br> In-Reply-To: <20091106130623.GA2051@inf.puc-rio.br> Subject: Re: Is this possible? (garbage collect and weak tables) Date: Sat, 7 Nov 2009 12:18:52 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: > The correctness of this code rests on the assumption that the GC will > not run between the two assignments. It seems better style the other way > around: > > local temp = translators[key] or {} > translators[key] = temp > ... (use 'temp' for the rest of this code) ... > > (Actually the assumption may be wrong! a line hook may cause a GC between > the two lines when debugging this code ;) > > -- Roberto Good catch! Also has the benefit of being slightly quicker. Will have to look out for that one. - Alex From lua-bounces@bazar2.conectiva.com.br Sat Nov 7 06:09:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA789Lko017989; Sat, 7 Nov 2009 06:09:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D43AE1A678; Sat, 7 Nov 2009 06:07:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E72518C43 for ; Sat, 7 Nov 2009 06:07:50 -0200 (BRST) Received: by bwz27 with SMTP id 27so1915844bwz.21 for ; Sat, 07 Nov 2009 00:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=qsh9Wm0+jhlfgvfTG57loSgQR0fVJUQYps3fo6ltrUQ=; b=EGLe75cpEb9hsoSkGlwrUepO+oD8KlScfdPMGhe7UVTYd8vohwR40XVTfPrbxzF4tV T+r7hYzzWrSPRbMGLp4Hd2wZAV2518O25aoTQcCzgBzULNuNMaYCYcxdnVAEWlhENaDp 2mOqBqfWWry9rNDdZJv+pZee5nkM0fkU8Mk0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=PPHINSeufwfB4Og8o6pk6EbyRvBO916nv6IqBJa8hOJYWm5efDg+3x3+VyYbrksd55 emZGvpnLKqkL0uX2MD4Cn50+j2+UtsJFZWnzw53Mouajt4KL65nhAsRxu4SwB4zpr/qr LkFzLHINRSrXOF1IUL4Ll3m70iFlh0tJSlUcY= Received: by 10.204.24.15 with SMTP id t15mr5711004bkb.113.1257581327858; Sat, 07 Nov 2009 00:08:47 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 14sm263308fxm.3.2009.11.07.00.08.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Nov 2009 00:08:46 -0800 (PST) Date: Sat, 7 Nov 2009 11:06:07 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <582256715.20091107110607@gmail.com> To: Leo Razoumov Subject: Re: LuaJIT vs MATLAB benchmark [Was: Re: help to (slightly) modify Lua interpreter] In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Leo, Saturday, November 7, 2009, 1:25:58 AM, you wrote: > LuaJIT performance together with its ability to nicely interface to > native libraries can make it a viable contender in the fields of > numeric and scientific computing. i think that doing this conclusion based solely on matlab performance is wrong. first you should check all other alternatives for doing math. matlab may be used for scalar operations not because it's fast but because it has good UI. lua/luajit doesn't have such UI, so you should compare in different category - all programming languages. if you will find that lj2 outperform other languages on the speed/cpnvenience ratio, you can make some conclusions -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Nov 7 06:09:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA789ls3018057; Sat, 7 Nov 2009 06:09:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 498DF1A6CF; Sat, 7 Nov 2009 06:08:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5354418C55 for ; Sat, 7 Nov 2009 06:07:50 -0200 (BRST) Received: by bwz27 with SMTP id 27so1915849bwz.21 for ; Sat, 07 Nov 2009 00:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=tqk/D3W6Ii/2QvXJvK3Oba60FaaJEgDPjSf4KeHV0Rg=; b=nRgiZ1emZpp1ymAhBMTqawlu5f5jjq3PUl+nqBV2PdMYjWW8H+k5kNRtZLXRJej4Id QRSZ98vpyXJOH4FGHmXUb8UczQQLa/QhWrFdcKkz5iTKz827fxDCOwb+ArbnrLn2CcPE /AqQ/WgUmmG/o2xa0hnPDBAXe5aRXxdTOcRI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=Jlz0cHx9dWrELukEamve9rxTfWj1wuMbwnmI9OC7NN4kXg4TXMjMhHf+6GvBr8H3Nj TFJcVAF8thIPNYNFymBmvAuU19Jy8uFN5gnrzPLO9SUw3xw6OQvp8ng9aF3F4kMsH1Q5 oxtvEIaro7teOVCIINiaX5booz4cG+UA+OOzA= Received: by 10.204.151.208 with SMTP id d16mr5739954bkw.115.1257581329296; Sat, 07 Nov 2009 00:08:49 -0800 (PST) Received: from ?95.78.77.233? ([95.78.77.233]) by mx.google.com with ESMTPS id 14sm263308fxm.3.2009.11.07.00.08.48 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Nov 2009 00:08:48 -0800 (PST) Date: Sat, 7 Nov 2009 11:08:26 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <457582605.20091107110826@gmail.com> To: Cosmin Apreutesei Subject: Re[2]: Threading headaches In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Cosmin, Saturday, November 7, 2009, 2:45:27 AM, you wrote: > AFAIK, a shared library can only be loaded once (i.e. have one global > state) per process. If only that weren't true, many stateful libs > would become thread-safe automatically and the Lua C API wouldn't need > a state argument. as the last resort, we can make a copy of file and load it again :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Sat Nov 7 06:55:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA78tiJW023740; Sat, 7 Nov 2009 06:55:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3877F1A6E2; Sat, 7 Nov 2009 06:54:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 220351A6CA for ; Sat, 7 Nov 2009 06:54:12 -0200 (BRST) Received: by bwz27 with SMTP id 27so1931368bwz.21 for ; Sat, 07 Nov 2009 00:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=NP5SQN1UQkTHBlxHE2pXY3pWv0+bi5FDruYU2qW3a2I=; b=PW9N2XYmsVVeTuBln//GGbUcTGS2WD0TWsXTcJ9YYhr3zrsIg95Q9eM6vZGKgxDUU5 DaQ4RKPoJebVKKiD2y9hs7oZhAQF1BtGGxlIdjpvELXSVJOzNdjMGG/QNN5/zB/ceK0A T9BhBSLlJadxc/G1fOc2PNnPrfzRlRCL8cHN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZcZJosMPQfYIcM7TanmBEZNNxV4RvciSHqq1fHH/ao2WW/3BBJxZAW8guI4ToGvasa C7244hy3vLHvFyg/CkhkXajlmn9X8DU0rCs4dJoyNNuhPesqmdehWn/5Gnge0hqcZevI Z2J1ow5lKk9loIu6VwXPYqIJnBlhyKWH8U380= MIME-Version: 1.0 Received: by 10.239.163.204 with SMTP id q12mr529560hbd.39.1257584110896; Sat, 07 Nov 2009 00:55:10 -0800 (PST) In-Reply-To: <582256715.20091107110607@gmail.com> References: <582256715.20091107110607@gmail.com> Date: Sat, 7 Nov 2009 10:55:10 +0200 Message-ID: <560972290911070055s3df1e6dfwe3acb1b992b13edd@mail.gmail.com> Subject: Re: LuaJIT vs MATLAB benchmark [Was: Re: help to (slightly) modify Lua interpreter] From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Nov 7, 2009 at 10:06 AM, Bulat Ziganshin wrote: > math. matlab may be used for scalar operations not because it's fast > but because it has good UI. lua/luajit doesn't have such > UI, As a manager once said to us, this is a 'mere matter of programming' We were amused ;) From lua-bounces@bazar2.conectiva.com.br Sun Nov 8 04:08:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA868cMN017875; Sun, 8 Nov 2009 04:08:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 11CE718D75; Sun, 8 Nov 2009 04:07:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ECFB18BCD for ; Sun, 8 Nov 2009 04:07:01 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N6toz-0000uO-00; Sat, 07 Nov 2009 23:31:49 +0100 Date: Sat, 7 Nov 2009 23:31:42 +0100 From: Mike Pall To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091107223142.GA4946@mike.de> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> <20091106145830.GA31168@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > I'm not against the possibility that LuaJIT would extend Lua syntax. > [...] Eh?!? My take on this is clearly outlined in the part you so aptly failed to quote. Next time you're going on a rant, please get your facts straight first. --Mike From lua-bounces@bazar2.conectiva.com.br Sun Nov 8 04:09:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA8696Qo017955; Sun, 8 Nov 2009 04:09:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9796518E5B; Sun, 8 Nov 2009 04:07:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2268E18D60 for ; Sun, 8 Nov 2009 04:07:04 -0200 (BRST) Received: by pwi3 with SMTP id 3so71746pwi.21 for ; Sat, 07 Nov 2009 22:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=sLkTOtUJM6ti2k6dikhKCH/cCFb81AjRPK5kTywAU0E=; b=RjMsPGBi1vDbKpKe7BXhAu/WiiWpHPr2WwNCKOWHHXZ4V0e1heyWVc5WlGvC2GDmXd KNh2c0eMuDJyYOqjsoo7x+sAzh9Sfq++TOzM+doZo/x2ehtsr6jITY9f+3EEOOZ+OraB l9M17lNWtSDSqawySkc7Tkg+xQvKamxRwiyMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=iKOHX7kiMyXF1EugVuAGychnfkviAyHlZXjm1GNPj7uSOE32DedWCyxWvTwFbQT8CX hFhuIjRaFLEwZi9GEhJnFeEgTI9Jl25yCdB1pgAb+iu5yObUHZBFFaucIe13+JLCDDwM 9UhH5p9rrKq1JkZrVXWEe420duIYjjoKi6Igo= MIME-Version: 1.0 Received: by 10.141.40.7 with SMTP id s7mr315281rvj.25.1257620403988; Sat, 07 Nov 2009 11:00:03 -0800 (PST) Date: Sat, 7 Nov 2009 22:00:03 +0300 Message-ID: Subject: Unix Domain Sockets in Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, list! I want to use Unix Domain Sockets in my Lua code. I see that LuaSocket does not support them. Are there any other solutions? Alexander. From lua-bounces@bazar2.conectiva.com.br Sun Nov 8 04:20:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA86KtMP018891; Sun, 8 Nov 2009 04:20:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EAED018EF0; Sun, 8 Nov 2009 04:19:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9CCE218E78 for ; Sun, 8 Nov 2009 04:19:27 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 7C55DBE221 for ; Sun, 8 Nov 2009 01:20:26 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 08 Nov 2009 01:20:26 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=kDOL/NuKbn8LwIXOU00u3+KjeDo=; b=TddRQa5cHnzN/xcD4G6wVpeaS/iQoV4sCt+v1xWwJtvFJaamIYCdS1QQt9GQDCHKmTbV4sR3HxN5vAFauaCj7hwYKDynPY5JC74q8Y02ktJA0a7Rcx2TlFiL17XmT3FYDwIyNDjsLVvIkIMprqrAK8htdQNNZr2TEuKoZYiZgF8= X-Sasl-enc: 4Afw/ymyODuALNuYUx146zBkGWCJEIg6Wa+KjsKSvZ5C 1257661226 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id BE01354DB for ; Sun, 8 Nov 2009 01:20:25 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091031225554.GA30341@mike.de> Date: Sun, 8 Nov 2009 19:19:52 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091031225554.GA30341@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, On some occasions, debug.info(depth) seems to return info about a different level of the stack frame in LJ2 than in Lua. I'm guessing you know this, and I think it's alluded to on the status page, but I thought I'd check. If it is new or of interest I'll try to make a short test case. Oh, it turns out that LJ1 behaves the same as LJ2, so I'm sure you already know. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:13:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BD0ZF024992; Mon, 9 Nov 2009 09:13:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3109B18504; Mon, 9 Nov 2009 09:11:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F0D2184BC for ; Sun, 8 Nov 2009 04:35:19 -0200 (BRST) Received: by pwi3 with SMTP id 3so76945pwi.21 for ; Sat, 07 Nov 2009 22:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=YGxPJYed54dcPG9cGzpLQu0evlph2EBu3GQJ2IqjJ8s=; b=WpN2dSobWtp8U9aGmc4S00w0JSvVueOCnJvbiYZtim9QuhJNyG6CSDD6wq2bByn40Q hSZmAUQRjEQZ68dzA9eNMZ4+6pUlcJxu5UTAwbDJkzkFYaobppqGVN8TofGVUKKn9b5L TRB6eWJaIOXEdqUnzgSrSgU+yeRk0xmOUUFwU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BAm3CJb28+xWYEZHf5zODnFrFqtjYzzIk39oSsVtvufz0zxi0u8DD0jHKxxzj2PjJB 8W0CM1gyeFaQkUsBq6W4HRUKXWvIdxgZbJul1/h0dxH4XDP/hQJR3OtRh9lIPu1Q7q53 62F6d92YHVR1h6rJv9QgGbHOShvWruUG6y/5s= MIME-Version: 1.0 Received: by 10.140.134.14 with SMTP id h14mr160154rvd.297.1257629518303; Sat, 07 Nov 2009 13:31:58 -0800 (PST) In-Reply-To: <4db9cacb0911061751m2a626f50va576b917405bb220@mail.gmail.com> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> <20091106145830.GA31168@mike.de> <4db9cacb0911061751m2a626f50va576b917405bb220@mail.gmail.com> Date: Sun, 8 Nov 2009 00:31:58 +0300 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Either I'm mistaken, or the email you quote didn't advocate any syntax > extensions. Right. Ugh again. :-) I want to apologize, as I misread that e-mail. Sorry for the noise. Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:14:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BEb3E025341; Mon, 9 Nov 2009 09:14:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83F8C18537; Mon, 9 Nov 2009 09:12:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E7E01851D for ; Mon, 9 Nov 2009 09:12:38 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nA8MOvAW016408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 8 Nov 2009 17:25:01 -0500 (EST) Date: Sun, 8 Nov 2009 17:24:57 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: Unix Domain Sockets in Lua In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5796 signatures=577388 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. > > Are there any other solutions? There is an undocumented module luasocket/src/unix.c that implements Unix Domain Sockets for LuaSocket. Let me know (contact me directly) if you need help compiling it and getting it to work for you. Kind regards, Diego From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:20:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BKNn3026915; Mon, 9 Nov 2009 09:20:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A928185BD; Mon, 9 Nov 2009 09:18:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0D22185BD for ; Mon, 9 Nov 2009 09:18:24 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N7Qcg-0005oe-Gj for ; Mon, 09 Nov 2009 09:33:18 +0000 Received: from petitemort.i.flarn.net ([10.19.3.101] helo=petitemort) by master with esmtp (Exim 4.69) (envelope-from ) id 1N7Qcr-0002lR-IZ for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 09:33:29 +0000 Received: from dsilvers by petitemort with local (Exim 4.69) (envelope-from ) id 1N7Qcr-0002XT-DP for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 09:33:29 +0000 Date: Mon, 9 Nov 2009 09:33:29 +0000 From: Daniel Silverstone To: lua@bazar2.conectiva.com.br Subject: Re: Unix Domain Sockets in Lua Message-ID: <20091109093329.GA5733@digital-scurf.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Nov 07, 2009 at 10:00:03PM +0300, Alexander Gladysh wrote: > I want to use Unix Domain Sockets in my Lua code. > I see that LuaSocket does not support them. LuaSocket certainly supports them for us. It depends on your OS if you're using pre-packaged LuaSocket since the Makefile doesn't build them by default. Regards, Daniel. -- Daniel Silverstone http://www.digital-scurf.org/ PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69 From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:29:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BTCM8028503; Mon, 9 Nov 2009 09:29:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D347818629; Mon, 9 Nov 2009 09:27:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C98B18615 for ; Mon, 9 Nov 2009 09:27:16 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N7SQ6-0003kg-2u for ; Mon, 09 Nov 2009 11:28:26 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N7SQM-0007To-6g for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 11:28:42 +0000 Date: Mon, 9 Nov 2009 11:28:41 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Unix Domain Sockets in Lua Message-ID: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 8 Nov 2009 17:24:57 -0500 (EST) Diego Nehab wrote: > There is an undocumented module luasocket/src/unix.c that > implements Unix Domain Sockets for LuaSocket. Let me know > (contact me directly) if you need help compiling it and > getting it to work for you. Incidentally, can we look forward to these being official? They're dreadfully useful. B. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:38:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BcYoP030886; Mon, 9 Nov 2009 09:38:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CBF31185E4; Mon, 9 Nov 2009 09:36:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E846818615 for ; Mon, 9 Nov 2009 09:36:38 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N7AqD-0000Ee-5v for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 17:42:13 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N7AqC-0006oN-BH for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 17:42:12 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: testing for network connection References: <1079b050907241215g6fbeee39pac221037e161d29d@mail.gmail.com> Date: Sun, 08 Nov 2009 17:42:12 +0100 In-Reply-To: <1079b050907241215g6fbeee39pac221037e161d29d@mail.gmail.com> (Wesley Smith's message of "Fri, 24 Jul 2009 12:15:38 -0700") Message-ID: <87vdhlx923.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Wesley Smith: > Anyone know of a more efficient/effective method? Use a routing protocol, such as RIP, BGP or OSPF. 8-) Seriously, this is a really hard thing to answer because connectivity to one site doesn't mean you can reach the site you're actually interested in. Most applications with a user interface solve this by supplying the user with a "try again" button, perhaps with minimal additional information on the problem. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:39:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Bd6tH031026; Mon, 9 Nov 2009 09:39:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 04B94186A1; Mon, 9 Nov 2009 09:36:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C424318615 for ; Mon, 9 Nov 2009 09:36:39 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N75r4-0002I7-W7 for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 12:22:47 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N75r4-00053X-DV for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 12:22:46 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Using LuaSocket with non-blocking sockets References: <17eac67c0910151021i2e3116f4sce2c4912b36cc5ac@mail.gmail.com> Date: Sun, 08 Nov 2009 12:22:46 +0100 In-Reply-To: (Diego Nehab's message of "Thu, 15 Oct 2009 13:36:21 -0400 (EDT)") Message-ID: <87k4y145x5.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Diego Nehab: > I think that what I do is call connect. It will return > "timeout" if connection is in progress. The socket will select > writeable once the result of connect arrives. Then you call > connect again and it will either work immediately or it will > report an error with "alraedy connected". If it says > "timeout" again, you know it really timedout. The standard way is to look at SO_ERROR with getsockopt (but that API is not very standard--some systems return the error code in errno, others return it in the passed integer). I don't know if there are any systems which return misleading error codes on a second connect, but I suspect that there are. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:39:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BdbWr031148; Mon, 9 Nov 2009 09:39:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84A64186C3; Mon, 9 Nov 2009 09:36:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4BE018687 for ; Mon, 9 Nov 2009 09:36:40 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N7BbI-0000ny-JI for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 18:30:52 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N7BbI-0007AG-5l for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 18:30:52 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Simple way to create a big string of blanks? References: <3413920F05C848FD8D796C1E9BE90C40@CAYENNE> <72964DB5-2E4F-4785-9DCC-8B1A1F6EFA1F@mac.com> <1F45CC0B514D4C9D8E099DA822861BF5@CAYENNE> <7C238A62-74D3-46CC-976D-8FD3ABCE2642@gmail.com> <7F474CCD7190404996917C03BD53F782@CAYENNE> Date: Sun, 08 Nov 2009 18:30:52 +0100 In-Reply-To: <7F474CCD7190404996917C03BD53F782@CAYENNE> (Michael Newberry's message of "Wed, 19 Aug 2009 13:45:11 -0700") Message-ID: <87eio8vs8j.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Michael Newberry: > To blank-pad a file whose format requires it. I realize I could make a > CFunction to do this easily, but I'm just wondering if there's a way > in pure lua that doesn;t involve zillions of string concatenations. You could use something like binary exponentiation. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:40:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Be8bl031349; Mon, 9 Nov 2009 09:40:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82B15186F1; Mon, 9 Nov 2009 09:37:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B771C185E4 for ; Mon, 9 Nov 2009 09:36:41 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N6qGF-0001pv-07 for lua@bazar2.conectiva.com.br; Sat, 07 Nov 2009 19:43:43 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N6qGE-0005G3-6x for lua@bazar2.conectiva.com.br; Sat, 07 Nov 2009 19:43:42 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART Date: Sat, 07 Nov 2009 19:43:42 +0100 Message-ID: <87639muqe9.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I would like to pair LUA_GCSTOP/LUA_GCRESTART invocations in a nested fashion (or at least, I want to call it from a library where I don't know if the garbage collector has already been stopped). There doesn't seem to be any way to restore the previous state after calling lua_gc(LUA_GCSTOP), unfortunately. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 09:48:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9BmTCf000832; Mon, 9 Nov 2009 09:48:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D3A818537; Mon, 9 Nov 2009 09:46:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 479991851D for ; Mon, 9 Nov 2009 09:46:30 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA804HOV023971 for ; Sat, 7 Nov 2009 22:04:19 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id F23DC54C1D0; Sat, 7 Nov 2009 22:04:17 -0200 (BRST) Date: Sat, 7 Nov 2009 22:04:17 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: help to (slightly) modify Lua interpreter Message-ID: <20091108000417.GA9759@inf.puc-rio.br> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <20091106190208.GA6160@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > I guess the next code gives a reasonable solution for 2D arrays. > > (It should not be too dificult to generalize it to n dimensions.) > > > > [...] > > Every time m[i][j] is called two new closures are created to be used > only once. Would it drive GC crazy if m[i][j] is used withing loops > millions of times?? Maybe there is something wrong in my code, but I think it memorizes accesses to m[i]. So, the first time m[i] is accessed Lua creates two new closures (plus one table), but after that, the following accesses do not create anything (until the next collection). -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:07:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9C7ZwE006001; Mon, 9 Nov 2009 10:07:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC60218704; Mon, 9 Nov 2009 10:07:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C17F186A5 for ; Mon, 9 Nov 2009 10:07:01 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 25so181413eya.5 for ; Mon, 09 Nov 2009 04:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xzTD5DrY4vmSNNRQA+JPF4idBp1vEdyB1zLQMfXLieY=; b=Gv7S0hWBchHKcj4yA5CohQAc5gU1tEqll0J6mOwf6aLKjkaMTec0CqYNpNI0BBPd/D aGDH+uNuE57kIT8LEtePD5F5AUQJNFBQVl8DeU4QQni98FyVGCH4CSaJ29D0ixbAxNeX tzOwbuFXrBg461l7lDIso6epkshblyzbLP6YE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lF/fZLS5XATarVNLUHNZfUtgEn4IX6A2UoIwr2IC2LDBJFb9rEw36yDmVzgurCD90T IxhCpQz970TcdbRU6KYpniLDXdWNeIiS8u0J3vrgaDla9FGzww4y1bzL1fxVJ884z05V g6do1BZlXAqNPU099RnpppdczhUluorw5EhF8= MIME-Version: 1.0 Received: by 10.216.89.210 with SMTP id c60mr127813wef.149.1257662219414; Sat, 07 Nov 2009 22:36:59 -0800 (PST) In-Reply-To: References: Date: Sat, 7 Nov 2009 22:36:59 -0800 Message-ID: <17eac67c0911072236t71c61de9x95ab93c9e07845a0@mail.gmail.com> Subject: Re: Unix Domain Sockets in Lua From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Nov 7, 2009 at 11:00 AM, Alexander Gladysh wrote: > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. > > Are there any other solutions? I think there used to be a udp.c in the luasocket source that doesn't build by default but does unix domain sockets. Sam From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:08:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9C8Tl6006198; Mon, 9 Nov 2009 10:08:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF91F1880B; Mon, 9 Nov 2009 10:08:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fettunta.fettunta.org (fettunta.fettunta.org [67.207.129.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9809F1873C for ; Mon, 9 Nov 2009 10:08:00 -0200 (BRST) Received: from localhost.localdomain (unknown [10.17.0.6]) by fettunta.fettunta.org (Postfix) with ESMTPS id 57662182EF for ; Sun, 8 Nov 2009 09:09:15 +0000 (UTC) Received: from tassi by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1N73ll-0000ya-D2 for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 10:09:09 +0100 Date: Sun, 8 Nov 2009 10:09:09 +0100 From: Enrico Tassi To: lua@bazar2.conectiva.com.br Subject: Re: Unix Domain Sockets in Lua Message-ID: <20091108090909.GA3519@birba> Mail-Followup-To: lua@bazar2.conectiva.com.br References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Nov 07, 2009 at 10:00:03PM +0300, Alexander Gladysh wrote: > Hi, list! > > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. On unix luasocket can be compiled with unix sockets: tassi@birba:~$ lua -l socket.unix -e 'print(socket.unix)' function: 0xa4d240 Cheers -- Enrico Tassi From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:25:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9CPhLi010580; Mon, 9 Nov 2009 10:25:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12406188AE; Mon, 9 Nov 2009 10:25:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B52118869 for ; Mon, 9 Nov 2009 10:25:08 -0200 (BRST) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id QNA74933 for ; Mon, 09 Nov 2009 13:17:33 +1100 Message-ID: <4AF77BBA.4070002@infinite-interactive.com> Date: Mon, 09 Nov 2009 13:17:30 +1100 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: help to (slightly) modify Lua interpreter References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <956373d40911051050m710c484ibf464ecc791a1816@mail.gmail.com> <560972290911052122y53e2d02bqcfea2b16dd6e4071@mail.gmail.com> In-Reply-To: <560972290911052122y53e2d02bqcfea2b16dd6e4071@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > This is in fact the case that makes this so non-trivial. It is not > difficult to do a token-filter that copes with the difference between > A[i,j] and A[i,j] = value, but multiple assignment needs a proper AST > transformation. > I created a patch for multi-dimensional indexing over the weekend (see code below) and pretty-much reached the same conclusion. I eventually gave up on using multiple parameters for the indexing and instead modified the parser to treat m[1,2] the same as m[1][2]. Apart from being a very small patch (and faster to parse) it doesn't break multiple assignment or constructors. Of course, I personally would hope that this never officially makes it into Lua because it forces a very specific and unnessessary syntax onto the language IMHO, but for the time being it would probably be good enough for what Francesco is after. As far as the technical implementation goes my patch does 3 things: 1) The yindex function (which parses table indices) has been modified so that it doesn't parse the outer '[' and ']' tokens. This is now handled by the calling functions. 2) The loop in primaryexp has been modified to keep looping and indexing while the ',' token is encountered. 3) The recfield function has had a couple of lines added so that parsing of constructors remains the same. Statements such as m={[1][2]="foo"} could technically be made to work but they're nonsensical and would fail since m[1] is nil to begin with. Also the existing parser doesn't allow statements such as m={[1]={}, [1][2]="foo"} so I've kept that behaviour the same. I haven't tested this patch exhaustively but looking at the way the code works I think it should be ok, it seems to have no problem handling code like this: -- test multidimensional arrays. also test constructors -- and multiple assignment to show they're not broken m = {[1]={}, [2]="foo"} m[1,2] = "bar" print(m[2], m[1][2], m[1,2]) --> foo bar bar m.foo = {} m.foo.bar = "grok" print(m["foo","bar"]) --> grok Cheers, Mark Feldman === mda.patch=== diff C:\Temp\lua-5.1.4\src/lparser.c lua-5.1.4\src/lparser.c 420d419 < luaX_next(ls); /* skip the '[' */ 423d421 < checknext(ls, ']'); 453a452,453 > { > luaX_next(ls); 454a455,456 > checknext(ls, ']'); > } 703,705c705,712 < luaK_exp2anyreg(fs, v); < yindex(ls, &key); < luaK_indexed(fs, v, &key); --- > luaX_next(ls); > do > { > luaK_exp2anyreg(fs, v); > yindex(ls, &key); > luaK_indexed(fs, v, &key); > } while (testnext(ls, ',')); > checknext(ls, ']'); This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:35:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9CYxWh013033; Mon, 9 Nov 2009 10:34:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 89146186A0; Mon, 9 Nov 2009 10:34:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ED1B6185E4 for ; Mon, 9 Nov 2009 10:34:33 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N7TRw-0005th-1o for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 12:34:24 +0000 Message-ID: <4AF80C4F.5090406@cowlark.com> Date: Mon, 09 Nov 2009 12:34:23 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: debug.traceback() oddity X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Resend, as the original message doesn't seem to have shown up --- are there mailing list server issues?] I'm trying to use the level parameter described in the docs for debug.traceback(). However, I'm finding that it doesn't appear to work as described. For example: > =debug.traceback() stack traceback: stdin:1: in main chunk [C]: ? ...works as expected. But this: > =debug.traceback(nil, "foo", 1) 1 ...doesn't. Experimentation reveals that: > =debug.traceback("foo", "bar", "baz", "boo") foobarbazboo stack traceback: stdin:1: in main chunk [C]: ? ...which is very odd; it appears that all the parameters are getting concatenated together and become the message. What am I missing here? - - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr4DE4ACgkQf9E0noFvlzjR6QCguXkPN6xuHTLDsapsPltXlzKx EOAAniHHtcwXRSUFDYaoGEZtHG5SogEX =fOG0 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:42:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9CgMwi015637; Mon, 9 Nov 2009 10:42:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48F061883D; Mon, 9 Nov 2009 10:42:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0138518714 for ; Mon, 9 Nov 2009 10:41:57 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so635177fga.17 for ; Mon, 09 Nov 2009 04:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=NDYay+Ztlz/DR68YmsLtNfSdECi4eKttplw/T4RfHOc=; b=cWC86kbDM/viUQRe7LvN1Fp+szvweokEG11EuUkDi97clsay08GIQRWI0cVBKSx4Wa WsFwFKK+JXHGMjUlfp1T3DXbwROuhQomGn9hL+C9z5voOsNlxPN9T0RAyvXutvmk1VYQ cKNL7hLjDHzDMH86Wk08D/V22SAHaUgo24Dro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mwkUlpVaIYAG3rlvOnjfmF9Y7vKEyyXB2Xlcqxp9meEBXn52Fb9oId+Ow4UpdEGii/ dMhJWWcKK6YGkWWjXHaZs+lCtJJMtN9Z2ZajcSCUssgbO8Ur9maJD+7EuK9Svy20xdRH O56wcdXUddnA8LMGqTv8Ms5Mot7k84P8gfDS0= MIME-Version: 1.0 Received: by 10.223.92.131 with SMTP id r3mr1149081fam.40.1257770515851; Mon, 09 Nov 2009 04:41:55 -0800 (PST) In-Reply-To: <87639muqe9.fsf@mid.deneb.enyo.de> References: <87639muqe9.fsf@mid.deneb.enyo.de> Date: Mon, 9 Nov 2009 12:41:55 +0000 Message-ID: Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9CgMwi015637 On Sat, Nov 7, 2009 at 6:43 PM, Florian Weimer wrote: > I would like to pair LUA_GCSTOP/LUA_GCRESTART invocations in a nested > fashion (or at least, I want to call it from a library where I don't > know if the garbage collector has already been stopped).  There > doesn't seem to be any way to restore the previous state after calling > lua_gc(LUA_GCSTOP), unfortunately. > I'd like to second this request, or something with the same intention - for example, being able to call an API function that returns 0 or 1 to indicate whether the GC is currently running or not. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:44:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9CiAFr016208; Mon, 9 Nov 2009 10:44:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D003818883; Mon, 9 Nov 2009 10:43:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 892C218714 for ; Mon, 9 Nov 2009 10:43:47 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9ChhOr016020 for ; Mon, 9 Nov 2009 10:43:43 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nA9Chh531364; Mon, 9 Nov 2009 10:43:43 -0200 Date: Mon, 9 Nov 2009 10:43:42 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART Message-ID: <20091109104342.A31361@lua.tecgraf.puc-rio.br> References: <87639muqe9.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from duncan.cross@gmail.com on Mon, Nov 09, 2009 at 12:41:55PM +0000 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > - for example, being able to call an API function that returns 0 or 1 > to indicate whether the GC is currently running or not. Why? What can will you do with that information? From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:54:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9CrqJj019073; Mon, 9 Nov 2009 10:53:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A264188B4; Mon, 9 Nov 2009 10:53:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C2E8C18890 for ; Mon, 9 Nov 2009 10:53:24 -0200 (BRST) Received: by bwz27 with SMTP id 27so3407653bwz.21 for ; Mon, 09 Nov 2009 04:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=93wkv83mYYGrfK6cNGLKm5lUSFDTAkbhgx3HTlqjUbs=; b=CuxZoTsk8rz8uJDRJs8n4I74vc/6k5YeDs+2auArJWNpR3dRw+fCSETZFgt0O+Bnc/ HQwZLK9Y8CHd3YimC2tP4uMcsMPZYogFgOw6DTcL1reO9pvhR+tnXeIiNE/ZDkmLpxRx gNGl7gTj4nYMCsSwCOEBntnfI5RjExNpI04rM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=A+z4TwlEbRnKlxrlRlg3KCfP68E5/Dz2WdUb+wx88EarQRmY0gp7IdgBrw9tiN88V9 8R2g+y1MSyscLj7F6YkcSM5n8xEHN3QUR1FbMTAHvfwauIh07+14Axqih2hjxDL5f1dF X5RjHjeJiq7mY93WPHKvoNgU+hdHPd+zjtLNc= MIME-Version: 1.0 Received: by 10.223.57.66 with SMTP id b2mr1110166fah.33.1257771201496; Mon, 09 Nov 2009 04:53:21 -0800 (PST) In-Reply-To: <20091109104342.A31361@lua.tecgraf.puc-rio.br> References: <87639muqe9.fsf@mid.deneb.enyo.de> <20091109104342.A31361@lua.tecgraf.puc-rio.br> Date: Mon, 9 Nov 2009 12:53:21 +0000 Message-ID: Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 9, 2009 at 12:43 PM, Luiz Henrique de Figueiredo wrote: >> - for example, being able to call an API function that returns 0 or 1 >> to indicate whether the GC is currently running or not. > > Why? What can will you do with that information? > If I have a C module function where I want to be certain the Lua garbage collector is not running temporarily for a particular piece of code, I would use it then - just in case that function is ever called from a context where the garbage collector has *already* been stopped, and the calling function does not expect it to be restarted. In that situation I would get the current state at the beginning, then conditionally decide whether to start the GC again at the end. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 10:54:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Csd5V019299; Mon, 9 Nov 2009 10:54:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C6751897B; Mon, 9 Nov 2009 10:54:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6DDE21892D for ; Mon, 9 Nov 2009 10:54:11 -0200 (BRST) Received: by pzk34 with SMTP id 34so2093070pzk.11 for ; Mon, 09 Nov 2009 04:54:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.247.42 with SMTP id u42mr612026wfh.259.1257650907490; Sat, 07 Nov 2009 19:28:27 -0800 (PST) In-Reply-To: <20091102132112.GA27625@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> <20091101210128.GA22817@mike.de> <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> <20091102132112.GA27625@mike.de> Date: Sat, 7 Nov 2009 21:28:27 -0600 Message-ID: <576e7620911071928m355fb7e7q929a3a38f09140b4@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 7:21 AM, Mike Pall wrote: > Steven Johnson wrote: >> Sure, I'll see what I can do. This is embedded in a pretty big program and >> I think I've got meetings and such this week, so it might be a few days >> getting around to it. > > The beta phase will take quite a bit longer than that. Take your > time. :-) > >> I tried a run with a jit.off() call at the beginning and got similar results. > > Ah, ok. Looks like some problem with the Lua/C API calls then. > Strange enough, but all of the key functions involved (module(), > luaL_register, luaL_findtable etc.) are the few remaining ones > that are still identical to the Lua codebase. With a lot of shadow modules and dumps of the package table, I tracked the issue down to before (modules look fine) and after (the nesting) our middleware initialization call. I made an educated guess and added _control87( _PC_53, MCW_PC ); immediately after that, and the game is up and running. :P So, this being DX9, I imagine the lack of D3DCREATE_FPU_PRESERVE reared its ugly head once LJ2 was already active. I'll see if I can attend to that properly and will report back if my assumptions don't hold. If they do, that's probably worth putting a big warning somewhere. :) From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 11:16:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9DGIlQ025605; Mon, 9 Nov 2009 11:16:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 419611880A; Mon, 9 Nov 2009 11:15:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19DCE18704 for ; Mon, 9 Nov 2009 11:15:36 -0200 (BRST) Received: by pzk34 with SMTP id 34so2103590pzk.11 for ; Mon, 09 Nov 2009 05:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Eq74RIrTFRx+H/5G8iAdnYhps69pRm2+yzuX5KNopoI=; b=Zt19PtFy0zWAi9a3ROEFMfhOR3yfS1eXBNevUK4ee2EIrC16M3zYuYYugPaoTP18zK nchr6f0EHmSIeUX+pZcU3nZVATkPyt89LY0iJiDCkac3wcaa7+78WewzUI9Pw3zCdpWG fCZ9IcOYYqWns9AA0eNmvwAkRRb5DzdxQJN/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=r5GKJbMCaIXT15Cwv0VXK3GKenuaLKUJRz8gSi3WPkCXogVvSKHO5G9HqzoJUi2De6 4DPtXLsmLr47lu8314JjIdaTWYti6CQQjM2s8T1n3h/qo0konRyYpCa/RkspMUgmnR77 Lkhflpc4VhUpO/EdB5U8ywgfbaVMt9dOc3M4Q= MIME-Version: 1.0 Received: by 10.141.22.2 with SMTP id z2mr340799rvi.122.1257668393682; Sun, 08 Nov 2009 00:19:53 -0800 (PST) In-Reply-To: <20091107223142.GA4946@mike.de> References: <4ff79edb0911050518t440499e6m29fbf05f6eee95ac@mail.gmail.com> <20091105161659.GA28130@inf.puc-rio.br> <4ff79edb0911050851l5d4f3019mbfc9b0607d2c53e7@mail.gmail.com> <4AF35B40.4030208@infinite-interactive.com> <4ff79edb0911060314r8d0c7cet82ceb697f7d6e692@mail.gmail.com> <89d273ba0911060547v6ef5cabn767a7172ca7ac7a5@mail.gmail.com> <20091106145830.GA31168@mike.de> <20091107223142.GA4946@mike.de> Date: Sun, 8 Nov 2009 11:19:53 +0300 Message-ID: Subject: Re: help to (slightly) modify Lua interpreter From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Alexander Gladysh wrote: >> I'm not against the possibility that LuaJIT would extend Lua syntax. >> [...] > Eh?!? My take on this is clearly outlined in the part you so aptly > failed to quote. Next time you're going on a rant, please get your > facts straight first. Sorry, Mike, I apologize again. I do not know why I thought this. Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 11:17:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9DHI2a025821; Mon, 9 Nov 2009 11:17:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CA9E318858; Mon, 9 Nov 2009 11:16:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth02.prod.mesa1.secureserver.net (smtpauth02.prod.mesa1.secureserver.net [64.202.165.182]) by bazar2.conectiva.com.br (Postfix) with SMTP id 115CE18704 for ; Mon, 9 Nov 2009 11:16:47 -0200 (BRST) Received: (qmail 26834 invoked from network); 8 Nov 2009 18:30:03 -0000 Received: from unknown (98.117.140.83) by smtpauth02.prod.mesa1.secureserver.net (64.202.165.182) with ESMTP; 08 Nov 2009 18:30:02 -0000 Subject: Re: Is this possible? (garbage collect and weak tables) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Mark Hamburg X-Priority: 3 In-Reply-To: <572D4EC602434EA3857FA475776705E3@Mania> Date: Sun, 8 Nov 2009 10:31:36 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <4AF4174E.4060409@inconcertcc.com> <20091106130623.GA2051@inf.puc-rio.br> <572D4EC602434EA3857FA475776705E3@Mania> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You can also set the translators table to auto-populate by giving it an appropriate __index metamethod. Mark ---- module("translators", package.seeall) local translators = {} setmetatable(translators, {__mode = "v", __index = function( t, k ) local v = { }; t[ k ] = v; return v; end }) local mt = {} -- If there is not a suitable translator (for the given key and language), -- create a new one and store it in a weak-valued table so it does not -- linger there for ever. mt.__index = function(tab, key) local user = inconcert.authUser or {languageId=14346, codepage="UTF-8"} local translator = translators[key][user.languageId] if not translator then translator = i18nlib.Translator{domain=key, language = user.languageId, codepage = user.codepage, transliterate=false} translators[key][user.languageId] = translator end return translator end setmetatable(_M, mt) From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 11:20:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9DK6UZ026713; Mon, 9 Nov 2009 11:20:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E66F91896F; Mon, 9 Nov 2009 11:19:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 523A01873C for ; Mon, 9 Nov 2009 11:19:35 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7U9d-0002We-00; Mon, 09 Nov 2009 14:19:33 +0100 Date: Mon, 9 Nov 2009 14:19:28 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091109131928.GA3212@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> <20091101210128.GA22817@mike.de> <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> <20091102132112.GA27625@mike.de> <576e7620911071928m355fb7e7q929a3a38f09140b4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <576e7620911071928m355fb7e7q929a3a38f09140b4@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Steven Johnson wrote: > With a lot of shadow modules and dumps of the package table, I tracked > the issue down to before (modules look fine) and after (the nesting) our > middleware initialization call. I made an educated guess and added > _control87( _PC_53, MCW_PC ); immediately after that, and the game > is up and running. :P Yikes! Does any middleware vendor still believe butchering the x87 flags makes a difference? None of the compute-intensive paths use the x87 FPU anymore. I guess most games nowadays don't even run without SSE2 support and a high performance GPU. Since most of these initializations happen after luaL_openlibs(), I guess I could add a check for the FPU flags to luaL_register() or at the end of the C module loader. Would that have helped to track down the cause in your case? > So, this being DX9, I imagine the lack of D3DCREATE_FPU_PRESERVE > reared its ugly head once LJ2 was already active. I'll see if I can attend to > that properly and will report back if my assumptions don't hold. If they do, > that's probably worth putting a big warning somewhere. :) I'll add it to the FAQ. But the caveat applies to Lua, too. You just don't notice the problem until it's too late (like when indexing some big table or using luaL_ref). --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 11:27:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9DRouV029362; Mon, 9 Nov 2009 11:27:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 506B918993; Mon, 9 Nov 2009 11:27:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8061188DB for ; Mon, 9 Nov 2009 11:27:12 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N77M2-0003YY-2V for lua@bazar2.conectiva.com.br; Sun, 08 Nov 2009 12:58:50 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id 4BA8F1B5D2 for ; Sun, 8 Nov 2009 12:58:47 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:44357 with envelope Message-ID: <4AF6C085.9030507@cowlark.com> Date: Sun, 08 Nov 2009 12:58:45 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: debug.traceback() oddity X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9DRouV029362 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to use the level parameter described in the docs for debug.traceback(). However, I'm finding that it doesn't appear to work as described --- instead, all the parameters get concatenated and become the error message. For example: > =debug.traceback() stack traceback: stdin:1: in main chunk [C]: ? ...works as expected. But this: > =debug.traceback(nil, "foo", 1) 1 ...isn't. Experimentation reveals that: > =debug.traceback("foo", "bar", "baz", "boo") foobarbazboo stack traceback: stdin:1: in main chunk [C]: ? ...which is very odd. What am I missing here? - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK9sCFf9E0noFvlzgRAr4lAJ9QHriaCgZ9bcx1sKdkTXT6TR5lMACeL9NF Q/Q5PRzg+C3myXNiETR/dVQ= =3z64 -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 12:05:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9E5N1G007737; Mon, 9 Nov 2009 12:05:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3472E18B06; Mon, 9 Nov 2009 12:04:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C1E918A61 for ; Mon, 9 Nov 2009 12:04:36 -0200 (BRST) Received: by ywh40 with SMTP id 40so2558006ywh.33 for ; Mon, 09 Nov 2009 06:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=BvcQJYkDwaNDyzHnWGXwtgST5RQUBQyVdj6gpxx1+vk=; b=Xmbgf/3aEiSjramOoIRtUGjfZ/ju/ah+D9AyUuqL7QC3d8vAApPDcN/1+2IVH6ubQf jgoVZQegBxo1T4UWg3a2jHM7ysTcYSgbyBN4D/HTHDbXkd/2YmBB9k1HQ7zCPpKMOTkK gsEz2pjTnFO4Upe968+ISyrWh6NUJfOftcgmM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IkEEjyDylxRR4OAethN2PvkjaCVBm1E0oAKRNA30wF67IcRDD1TX+eyzu31TZqAQYf YRC0XkVzkBUMP+oL52Tdf3oFlmByc3nT4dzzr5WEKZimfJNDLfbWQ/DKB9HuHssEC2+b ZGcFCIl/Lrhd9IV/tuuCZfTyBmEID8Ek1EUcw= MIME-Version: 1.0 Received: by 10.101.205.23 with SMTP id h23mr3565368anq.34.1257700842912; Sun, 08 Nov 2009 09:20:42 -0800 (PST) In-Reply-To: References: Date: Sun, 8 Nov 2009 15:20:42 -0200 Message-ID: Subject: Re: Lightuserdata freed in Lua? From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=0016e6d27c72f9bd680477df4bb1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d27c72f9bd680477df4bb1 Content-Type: text/plain; charset=ISO-8859-1 Solved! The confusion of my email was in fact the problem.. because the pointers received by lua was of tables created and not from the C object... resulting in multiple tables. Passing the pointer as lightuserdata solved the problem. 2009/11/8 zweifel > Sorry, It is not a lightuserdata. > > In fact it is passed by tolua_pushusertype()... , but that does not solve > anything. > > Everything works right when only one character is executing the script, but > not with 2 characters doing different things. I do not see any conflict > whatsoever that could lead to this. There are two tables storing arguments > and I am sure that both tables are distinct. > > 2009/11/8 zweifel > > Hello guys, >> >> I am using a script which updates the action of a character in game. Each >> tme the script is called with the pointer to a character, which I use as a >> key to a global table to access the arguments and other variables of the >> action. >> >> The problem arrives when one character i executing one script when I try >> to pass parameters to another. The characters that was already executing >> stops, because the argument stored in its table turns to NULL, but it is a >> lightuserdata! This should not be freed by C? >> >> I pass the parameters to one script and after that I set the parameters to >> NULL, to be sure that the other characters do not get it. >> >> Here is my code; >> >> >> pointer="x%x+" >> key= string.sub(tostring(id), string.find(tostring(id),pointer)) >> >> if table_arg[key] == nil then >> table_arg[key]={} >> --id={} >> print(key) >> end >> >> function endCurrentAction() >> table_arg[key]["action"]=nil >> id:System_endCurrentAction() >> end >> >> --set the name of the action based on debug information >> local da= debug.getinfo(1,"S") >> action= da.source >> >> >> --if this is the first time this action is called >> --or if this is the first action to be called for this character >> --set the action in the table to this action >> if table_arg[key]["action"] ~= action then >> table_arg[key]["action"]= action >> --------------------Initialization Begin--------------- >> id:beginAnimation(WALK_ANIM) >> --------------------Initialization End----------------- >> end >> >> -- everytime new arguments are passed to the script >> -- even when the same action remains, the arguments in >> -- the character's table must be changed >> if arg0 ~= nil then >> --------------Insert all Args to the Table------------- >> table_arg[key]["arg0"]= arg0 >> print("new_arg" .. tostring(arg0)) >> -------------------------------------------------------- >> end >> >> >> >> ----------------------Main------------------------------ >> >> --print(id) >> >> >> --local target_position= table_arg[id].arg0 >> local target_position= table_arg[key]["arg0"] >> --print("key " .. key) >> --print("target " .. tostring(target_position)) >> if target_position == nil then >> endCurrentAction() >> print("new_arg" .. tostring(arg0)) >> --*WHY IT ENTERS HERE???* >> end >> >> local current_position = id:getPosition() >> >> >> id:changeDirection(target_position.x, target_position.z, dt) >> >> --print(dt) >> >> local dist= math.sqrt( (target_position.x - >> current_position.x)*(target_position.x - current_position.x) + >> (target_position.y - >> current_position.y)*(target_position.y - current_position.y) + >> (target_position.z - >> current_position.z)*(target_position.z - current_position.z) >> ) >> >> local character_data= id:getCharacterData() >> >> --check if he arrived at the destination >> if dist <= character_data.size then >> endCurrentAction(); >> end >> >> > > > > > --0016e6d27c72f9bd680477df4bb1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Solved! The confusion of my email was in fact the problem.. because the poi= nters received by lua was of tables created and not from the C object... re= sulting in multiple tables. Passing the pointer as lightuserdata solved the= problem.

2009/11/8 zweifel <zweifel@gmail.com>
Sorry, It is not a lightuserdata.

In fact it is passed by tolua_pushusertype()... , but that does not solve a= nything.

Everything works right when only one character is executing the script, but not with 2 characters doing different things. I do not see any conflict whatsoever that could lead to this. There are two tables storing a= rguments and I am sure that both tables are distinct.

2009/11/8 zweifel <zweifel@gmail.com>

Hello guys,
I am using a script which updates the action of a character in game. Each= tme the script is called with the pointer to a character, which I use as a= key to a global table to access the arguments and other variables of the a= ction.

The problem arrives when one character i executing one script when I tr= y to pass parameters to another. The characters that was=A0 already executi= ng=A0 stops, because the argument stored in its table turns to NULL, but it= is a lightuserdata! This should not be freed by C?

I pass the parameters to one script and after that I set the parameters= to NULL, to be sure that the other characters do not get it.

Here i= s my code;


pointer=3D"x%x+"
key=3D string.sub(tostr= ing(id), string.find(tostring(id),pointer))

if table_arg[key] =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 table_arg[ke= y]=3D{}
=A0=A0=A0=A0=A0=A0=A0 --id=3D{}
=A0=A0=A0=A0=A0=A0=A0 print(k= ey)
end

function endCurrentAction()
=A0=A0=A0=A0=A0=A0=A0 tabl= e_arg[key]["action"]=3Dnil
=A0=A0=A0=A0=A0=A0=A0 id:System_end= CurrentAction()
end

--set the name of the action based on debug information
local= da=3D debug.getinfo(1,"S")
action=3D da.source


--i= f this is the first time this action is called
--or if this is the first= action to be called for this character
--set the action in the table to this action
if table_arg[key]["act= ion"] ~=3D action then
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["a= ction"]=3D action
--------------------Initialization Begin---------= ------
=A0=A0=A0=A0=A0=A0=A0 id:beginAnimation(WALK_ANIM)
--------------------Initialization End-----------------
end

-- ev= erytime new arguments are passed to the script
-- even when the same act= ion remains, the arguments in
-- the character's table must be chang= ed
if arg0 ~=3D nil then
--------------Insert all Args to the Table--------= -----
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["arg0"]=3D arg0
= =A0=A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
-----= ---------------------------------------------------
end



----------------------Main------------------------------=

--print(id)


--local target_position=3D table_arg[id].arg= 0
local target_position=3D table_arg[key]["arg0"]
--print(&= quot;key " .. key)
--print("target=A0 " .. tostring(target_position))
if target_p= osition =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 endCurrentAction()
=A0= =A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
=A0=A0= =A0=A0=A0=A0=A0 --WHY IT ENTERS HERE???
end

local current_position =3D id:getPosition()


id:change= Direction(target_position.x, target_position.z, dt)

--print(dt)
<= br>local dist=3D math.sqrt( (target_position.x - current_position.x)*(targe= t_position.x - current_position.x) +
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (target_= position.y - current_position.y)*(target_position.y - current_position.y) +=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (tar= get_position.z - current_position.z)*(target_position.z - current_position.= z)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 )

local character_data=3D id:getCharacterData()

--check if he arri= ved at the destination
if dist <=3D character_data.size then
=A0= =A0=A0=A0=A0=A0=A0 endCurrentAction();
end








--0016e6d27c72f9bd680477df4bb1-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 12:07:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9E7Nd3008242; Mon, 9 Nov 2009 12:07:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B562018B72; Mon, 9 Nov 2009 12:06:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C226318A25 for ; Mon, 9 Nov 2009 12:06:53 -0200 (BRST) Received: by ewy26 with SMTP id 26so3549120ewy.5 for ; Mon, 09 Nov 2009 06:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=+ZFOvHvJZsPF4n3g0hvcHkpvsDPJlffC/NBc7jS6U+c=; b=X6/kfCJHa824XyEJNg+J+aPoX4GzY+GJzA+p2Ico8VjsJZL93O9NdhLJOd3rXEBJ4D LrvevA1IxMeXCNasI8qg7tU/mGn5o/ISuGVtyU0TL1ZO8kKKGz16jFYzWuoernYxhZe4 dzj9oEwhVDHd7rGfmECusyAqRNA02WkZ5u0M4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=XM1Aq26QgT4L9VOXLkT3UHfnBLNAbzrw7X9U05qgfz6KXI48TOe9RQzMwnTT1UYXX3 XbuLGFfi1ALtZ2qnADHmUno3c2UP16SCcJJsOt4EWGCNoDOyeIBPLpj4DI4Vx5l8CiN+ wUNRBlPREJxeq6Rtoa+VB6W+oPe+1yvfrqkJM= Received: by 10.213.1.7 with SMTP id 7mr1893563ebd.27.1257682001314; Sun, 08 Nov 2009 04:06:41 -0800 (PST) Received: from ?192.168.1.2? ([122.162.198.78]) by mx.google.com with ESMTPS id 10sm3298138eyz.27.2009.11.08.04.06.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 04:06:40 -0800 (PST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Unix Domain Sockets in Lua From: Jacob Jay In-Reply-To: Date: Sun, 8 Nov 2009 17:36:33 +0530 Content-Transfer-Encoding: 7bit Message-Id: <6EE899B7-7BC1-4F2E-B3DE-8A2C9EE5FC1E@verse.org> References: To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8 Nov 2009, at 12:30 AM, Alexander Gladysh wrote: > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. It does but 'unofficially', just edit the Makefile to enable 'unix' and build :) I am using this extensively without problem, although it appears select () does not work. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:22:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FMci4024190; Mon, 9 Nov 2009 13:22:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2136218C14; Mon, 9 Nov 2009 13:22:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60ADD18B2B for ; Mon, 9 Nov 2009 13:21:59 -0200 (BRST) Received: by pxi2 with SMTP id 2so632540pxi.11 for ; Mon, 09 Nov 2009 07:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ELUCMSuqMoPuyTPSNYir5KlyUzQLkVyURakhZH5Rq7w=; b=qZaUZuokY956yomK4ofYM1PPpaFv/JTZwHQy+tNj5hTHjou6AGIA1cf1iTmgex1K5E 4O9kSFjbNatk4YopcWGdeYyUgfKt8cKJUjG0MsAS1bwUqXx2SF24VekIgWG0FpwTKYoF AiVE2SUA6wtjeXf58kHfcDWl8Is2metMzMTyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PiXZVOLf5O3NwBt3eyM6Q28TmUiQn9yHaxzRqtYtXxIr7Q2mGvo4dFCcbWjLwG9CS/ 6njDamslJigfhRWVSv7UanQU2qg1CGhr8r/Q8XXO1fwwPwUmjXjYwkMB+MDbGWCjlIkp dqH9lo0II3vaJSlLvBbhpahTwcdmetyhLkuVI= MIME-Version: 1.0 Received: by 10.140.177.1 with SMTP id z1mr375870rve.1.1257780114593; Mon, 09 Nov 2009 07:21:54 -0800 (PST) In-Reply-To: <6EE899B7-7BC1-4F2E-B3DE-8A2C9EE5FC1E@verse.org> References: <6EE899B7-7BC1-4F2E-B3DE-8A2C9EE5FC1E@verse.org> Date: Mon, 9 Nov 2009 18:21:54 +0300 Message-ID: Subject: Re: Unix Domain Sockets in Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean >> I want to use Unix Domain Sockets in my Lua code. >> I see that LuaSocket does not support them. > It does but 'unofficially', just edit the Makefile to enable 'unix' and > build :) > I am using this extensively without problem, although it appears select() > does not work. Cool, thanks. Since that's LuaSocket, I'd prefer it to be installed from LuaRocks. Is there an option to enable this feature (or a separate package perhaps)? Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:23:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FNhF7024397; Mon, 9 Nov 2009 13:23:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5805718C94; Mon, 9 Nov 2009 13:23:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com [209.85.217.212]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 735B118C55 for ; Mon, 9 Nov 2009 13:23:13 -0200 (BRST) Received: by gxk4 with SMTP id 4so345110gxk.8 for ; Mon, 09 Nov 2009 07:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LsRhj3a3ug/pBALolxDGHlJZaDIZ6CUKRY9sqB8YuzE=; b=KTB2trt7tqfmPjGK/ZtsaUiExzkR7D70zuutf8kF4o2aS/vqFw+kzqS1m7tyGCLhQ1 8+lWoZlt7cEG1PNzp9XFIOy9doFsQP+GZY5L4j2CA0OARkF7tfqloR6yHzFhctELiPI6 ws0yY84JlyrTbJfBJhQK0QomsDmpHqvXSidYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bV/M/23uQF88aNqi1Q+VO3rLMyEn45Kk8GCGfc7OTAhQHbRmkwKpNrHNcWhj30PENV dodg+1+Mq8+i30zpRm/iGN92LzSmBpfnGrji1u/uRBU/l1S7KAs83ythzzj3wl8TtrB1 0eJNL6kt1LFQ6i8PP69ZhiilOis9LHy8uMSg8= MIME-Version: 1.0 Received: by 10.91.199.3 with SMTP id b3mr12987408agq.88.1257685405413; Sun, 08 Nov 2009 05:03:25 -0800 (PST) In-Reply-To: References: Date: Sun, 8 Nov 2009 08:03:25 -0500 Message-ID: <2781f020911080503p9fc21b9u6cce4d58772275a7@mail.gmail.com> Subject: Re: Unix Domain Sockets in Lua From: Joseph Stewart To: Lua list Content-Type: multipart/alternative; boundary=001636b42dc1d430aa0477dbb362 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636b42dc1d430aa0477dbb362 Content-Type: text/plain; charset=ISO-8859-1 Alexander, Diego can correct me here if I'm not saying something accurate, but IIRC if you enable the file usocket.c in the sources you'll get unix domain support. -joe On Sat, Nov 7, 2009 at 2:00 PM, Alexander Gladysh wrote: > Hi, list! > > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. > > Are there any other solutions? > > Alexander. > --001636b42dc1d430aa0477dbb362 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Alexander,

Diego can correct me here if I'm no= t saying something accurate, but IIRC if you enable the file usocket.c in t= he sources you'll get unix domain support.

-joe

On Sat, Nov 7, 2009 at 2:00 PM, Alexander Gl= adysh <agladysh@= gmail.com> wrote:
Hi, list!

I want to use Unix Domain Sockets in my Lua code.

I see that LuaSocket does not support them.

Are there any other solutions?

Alexander.

--001636b42dc1d430aa0477dbb362-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:26:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FQ9Zo024818; Mon, 9 Nov 2009 13:26:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8148118CE6; Mon, 9 Nov 2009 13:25:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B219218BD6 for ; Mon, 9 Nov 2009 13:25:22 -0200 (BRST) Received: by ywh40 with SMTP id 40so2627164ywh.33 for ; Mon, 09 Nov 2009 07:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/oOKO1DGYvKBNw0FENUtlTBOMvq0TEn68/RaF58y81g=; b=FyIVE1ZWVytDge0fQMGtC8VceetT247NrxM/iPGJhoZNwr8gGdY0gua7DjJ57z6GiX Fa7xgPFPNmwthog4n4w/LIujjtsG5lAPgFdRrTd3mitiBY2SrEWQ2QlAjXal/3H66HL8 z2jOAuCBASRxATxSnUxF0akmUU7/W9o2Sz/c0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YYX+3lynHCc8negOMJoC2RAR5ABw1gHtOmDiRxmSlefm79N50iSeH4rHDK012NYhAv mL3yzwJhYYtUAosD8Qlq7/YG7hxfy4qhGy8NY6uActEYmDt5pBDYmvfHMf9XXpLGP/MQ peXur/1n8oMbn5Z1JL7hjeeOn4APekHGw5HQs= MIME-Version: 1.0 Received: by 10.101.4.27 with SMTP id g27mr5724574ani.150.1257691486582; Sun, 08 Nov 2009 06:44:46 -0800 (PST) In-Reply-To: References: Date: Sun, 8 Nov 2009 12:44:46 -0200 Message-ID: Subject: Re: Lightuserdata freed in Lua? From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=005045015fd74b78d40477dd1e70 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --005045015fd74b78d40477dd1e70 Content-Type: text/plain; charset=ISO-8859-1 Sorry, It is not a lightuserdata. In fact it is passed by tolua_pushusertype()... , but that does not solve anything. Everything works right when only one character is executing the script, but not with 2 characters doing different things. I do not see any conflict whatsoever that could lead to this. There are two tables storing arguments and I am sure that both tables are distinct. 2009/11/8 zweifel > Hello guys, > > I am using a script which updates the action of a character in game. Each > tme the script is called with the pointer to a character, which I use as a > key to a global table to access the arguments and other variables of the > action. > > The problem arrives when one character i executing one script when I try to > pass parameters to another. The characters that was already executing > stops, because the argument stored in its table turns to NULL, but it is a > lightuserdata! This should not be freed by C? > > I pass the parameters to one script and after that I set the parameters to > NULL, to be sure that the other characters do not get it. > > Here is my code; > > > pointer="x%x+" > key= string.sub(tostring(id), string.find(tostring(id),pointer)) > > if table_arg[key] == nil then > table_arg[key]={} > --id={} > print(key) > end > > function endCurrentAction() > table_arg[key]["action"]=nil > id:System_endCurrentAction() > end > > --set the name of the action based on debug information > local da= debug.getinfo(1,"S") > action= da.source > > > --if this is the first time this action is called > --or if this is the first action to be called for this character > --set the action in the table to this action > if table_arg[key]["action"] ~= action then > table_arg[key]["action"]= action > --------------------Initialization Begin--------------- > id:beginAnimation(WALK_ANIM) > --------------------Initialization End----------------- > end > > -- everytime new arguments are passed to the script > -- even when the same action remains, the arguments in > -- the character's table must be changed > if arg0 ~= nil then > --------------Insert all Args to the Table------------- > table_arg[key]["arg0"]= arg0 > print("new_arg" .. tostring(arg0)) > -------------------------------------------------------- > end > > > > ----------------------Main------------------------------ > > --print(id) > > > --local target_position= table_arg[id].arg0 > local target_position= table_arg[key]["arg0"] > --print("key " .. key) > --print("target " .. tostring(target_position)) > if target_position == nil then > endCurrentAction() > print("new_arg" .. tostring(arg0)) > --*WHY IT ENTERS HERE???* > end > > local current_position = id:getPosition() > > > id:changeDirection(target_position.x, target_position.z, dt) > > --print(dt) > > local dist= math.sqrt( (target_position.x - > current_position.x)*(target_position.x - current_position.x) + > (target_position.y - > current_position.y)*(target_position.y - current_position.y) + > (target_position.z - > current_position.z)*(target_position.z - current_position.z) > ) > > local character_data= id:getCharacterData() > > --check if he arrived at the destination > if dist <= character_data.size then > endCurrentAction(); > end > > --005045015fd74b78d40477dd1e70 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, It is not a lightuserdata.

In fact it is passed by tolua_pushusertype()... , but that does not solve a= nything.

Everything works right when only one character is executing the script, but not with 2 characters doing different things. I do not see any conflict whatsoever that could lead to this. There are two tables storing a= rguments and I am sure that both tables are distinct.

2009/11/8 zweifel <zweifel@gmail.com>
Hello guys,
I am using a script which updates the action of a character in game. Each= tme the script is called with the pointer to a character, which I use as a= key to a global table to access the arguments and other variables of the a= ction.

The problem arrives when one character i executing one script when I tr= y to pass parameters to another. The characters that was=A0 already executi= ng=A0 stops, because the argument stored in its table turns to NULL, but it= is a lightuserdata! This should not be freed by C?

I pass the parameters to one script and after that I set the parameters= to NULL, to be sure that the other characters do not get it.

Here i= s my code;


pointer=3D"x%x+"
key=3D string.sub(tostr= ing(id), string.find(tostring(id),pointer))

if table_arg[key] =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 table_arg[ke= y]=3D{}
=A0=A0=A0=A0=A0=A0=A0 --id=3D{}
=A0=A0=A0=A0=A0=A0=A0 print(k= ey)
end

function endCurrentAction()
=A0=A0=A0=A0=A0=A0=A0 tabl= e_arg[key]["action"]=3Dnil
=A0=A0=A0=A0=A0=A0=A0 id:System_end= CurrentAction()
end

--set the name of the action based on debug information
local= da=3D debug.getinfo(1,"S")
action=3D da.source


--i= f this is the first time this action is called
--or if this is the first= action to be called for this character
--set the action in the table to this action
if table_arg[key]["act= ion"] ~=3D action then
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["a= ction"]=3D action
--------------------Initialization Begin---------= ------
=A0=A0=A0=A0=A0=A0=A0 id:beginAnimation(WALK_ANIM)
--------------------Initialization End-----------------
end

-- ev= erytime new arguments are passed to the script
-- even when the same act= ion remains, the arguments in
-- the character's table must be chang= ed
if arg0 ~=3D nil then
--------------Insert all Args to the Table--------= -----
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["arg0"]=3D arg0
= =A0=A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
-----= ---------------------------------------------------
end



----------------------Main------------------------------=

--print(id)


--local target_position=3D table_arg[id].arg= 0
local target_position=3D table_arg[key]["arg0"]
--print(&= quot;key " .. key)
--print("target=A0 " .. tostring(target_position))
if target_p= osition =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 endCurrentAction()
=A0= =A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
=A0=A0= =A0=A0=A0=A0=A0 --WHY IT ENTERS HERE???
end

local current_position =3D id:getPosition()


id:change= Direction(target_position.x, target_position.z, dt)

--print(dt)
<= br>local dist=3D math.sqrt( (target_position.x - current_position.x)*(targe= t_position.x - current_position.x) +
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (target_= position.y - current_position.y)*(target_position.y - current_position.y) +=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (tar= get_position.z - current_position.z)*(target_position.z - current_position.= z)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 )

local character_data=3D id:getCharacterData()

--check if he arri= ved at the destination
if dist <=3D character_data.size then
=A0= =A0=A0=A0=A0=A0=A0 endCurrentAction();
end





--005045015fd74b78d40477dd1e70-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:47:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Fkdig030205; Mon, 9 Nov 2009 13:46:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 854B318BF7; Mon, 9 Nov 2009 13:46:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from col0-omc3-s9.col0.hotmail.com (col0-omc3-s9.col0.hotmail.com [65.55.34.147]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B0EC18813 for ; Mon, 9 Nov 2009 13:46:05 -0200 (BRST) Received: from COL107-W12 ([65.55.34.137]) by col0-omc3-s9.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Nov 2009 07:43:57 -0800 Message-ID: Content-Type: multipart/mixed; boundary="_36c71056-6ad8-4596-a5b1-4ca8d65f251d_" X-Originating-IP: [87.10.138.55] From: francesco puca To: Subject: Client LUA Date: Mon, 9 Nov 2009 15:43:57 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 09 Nov 2009 15:43:57.0462 (UTC) FILETIME=[73181B60:01CA6153] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_36c71056-6ad8-4596-a5b1-4ca8d65f251d_ Content-Type: multipart/alternative; boundary="_5e1d4275-7ec2-44da-a468-8bc1e0295cf5_" --_5e1d4275-7ec2-44da-a468-8bc1e0295cf5_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all! I'm created a client LUA that catch the query sent to a MySQL DB (using MyS= QL Proxy)=2C writes it to a file .log and sends a message (for each queries= captured) to a SQL parser (written in java). The problem is this: When i e= nter a query such as "USE database=3B" the client first captures a "nil inf= ormation" and then the query itself=3B so=20 when i enter a query "USE database=3B" the client sends 2 messages instead = of 1 How can I fix this?=20 Thank you very much =20 _________________________________________________________________ Facile=2C veloce=2C sicuro: scarica Internet Explorer 8 per MSN http://www.microsoft.com/italy/windows/internet-explorer/msn.aspx= --_5e1d4275-7ec2-44da-a468-8bc1e0295cf5_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all!
I'm created a client LUA that catch =3Bthe query sent to a MySQL DB (us= ing MySQL Proxy)=2C writes =3Bit to a file .log and sends a message (fo= r each queries captured) to a SQL parser (written in java). The problem is = this: When =3Bi enter a query such as "USE database=3B" =3Bthe clie= nt =3Bfirst captures a "nil information" and then the query itself=3B s= o
when =3Bi enter a query "USE database=3B" the client sen= ds 2 messages instead of 1
How can I fix this?
Thank you very much


Chia= cchiera con i tuoi amici da Messenger.it = --_5e1d4275-7ec2-44da-a468-8bc1e0295cf5_-- --_36c71056-6ad8-4596-a5b1-4ca8d65f251d_ Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="provaClient.lua" c29ja2V0ID0gcmVxdWlyZSgic29ja2V0IikNCg0KLS1jcmVhemlvbmUgZGVsbGEgc29ja2V0DQps b2NhbCBjID0gc29ja2V0LnRjcCgpDQoNCi0tIGxvZ19xdWVyeSDoIGlsIGZpbGUgaW4gY3VpIHZl cnJhbm5vIHNjcml0dGUgbGUgcXVlcnkgY2F0dHVyYXRlDQpsb2NhbCBsb2dfZmlsZSA9ICJDOi9V c2Vycy9GcmFuY2VzY28vRGVza3RvcC9UZXNpL215c3FsLXByb3h5L2xvZ19xdWVyeS5sb2ciDQoN Cg0KLS1mZCDoIGlsIGZpbGUgZGVzY3JpcHRvci4gbG9nX2ZpbGUgdmllbmUgYXBlcnRvIGluIHNj cml0dHVyYSBhbmRhbmRvIG1hbiBtYW5vDQotLWFkIGFjY29kYXJlIGNp8iBjaGUgdmllbmUgY2F0 dHVyYXRvIHNlbnphIGNhbmNlbGxhcm5lIGlsIGNvbnRlbnV0bw0KbG9jYWwgZmQgPSBpby5vcGVu KGxvZ19maWxlLCAiYSsiKQ0KDQoNCi0tUGFyYW1ldHJpIGRpIGNvbm5lc3Npb25lIGNvbCBzZXJ2 ZXINCmhvc3Q9ImxvY2FsaG9zdCINCnBvcnRhPTc3NzcNCg0KDQpmdW5jdGlvbiByZWFkX3F1ZXJ5 KCBwYWNrZXQgKQ0KDQoNCi0tIGNvbm5lc3Npb25lIGNvbCBzZXJ2ZXINCmxvY2FsIGMgPSBzb2Nr ZXQuY29ubmVjdChob3N0ICwgcG9ydGEpDQotLXByaW50KCIuLi5Db25uZXNzaW9uZSBlZmZldHR1 YXRhIGNvbCBzZXJ2ZXIuLi4iKQ0KDQoNCi0tYXR0cmF2ZXJzbyBzb2NrZXQubmV3dHJ5IGRlZmlu aWFtbyB1biAiZ2VzdG9yZSBkZWxsZSBlY2NlemlvbmkiIDoNCi0tbmVsIG1vbWVudG8gaW4gY3Vp IHZpZW5lIGNhdHR1cmF0YSB1bidlY2NlemlvbmUsIGlsIGZpbmFsaXp6YXRvcmUNCi0tc2kgb2Nj dXBlcuAgZGkgY2hpdWRlcmUgbGEgc29ja2V0DQpsb2NhbCBlY2NlemlvbmUgPSBzb2NrZXQubmV3 dHJ5KGZ1bmN0aW9uKCkgYzpjbG9zZSgpIGVuZCkNCg0KDQoJLS1TZSBpbCBwcmltbyBieXRlIGRl bCBwYWNjaGV0dG8gY2F0dHVyYXRvIOggcHJveHkuQ09NX1FVRVJZIGFsbG9yYSDoIHN0YXRhIGNh dHR1cmF0YSB1bmEgcXVlcnkNCiAgICBpZiBzdHJpbmcuYnl0ZShwYWNrZXQpID09IHByb3h5LkNP TV9RVUVSWSB0aGVuDQogICAgICAgIC0tIEkgcmVzdGFudGkgYnl0ZSBkZWwgcGFjY2hldHRvIHJh cHByZXNlbnRhbm8gbGEgcXVlcnkgdmVyYSBlIHByb3ByaWENCgkJbG9jYWwgcXVlcnkgPSBzdHJp bmcuc3ViKHBhY2tldCwgMikNCg0KDQoJCWlmIHF1ZXJ5PT0iU0VMRUNUIERBVEFCQVNFKCkiIHRo ZW4gcXVlcnk9IlVTRSBEQVRBQkFTRSINCgkJZW5kDQoNCgkJLS1zY3Jpdm8gbGEgcXVlcnkgbmVs IGZpbGUgZSB2YSBhIGNhcG8NCgkJZmQ6d3JpdGUoc3RyaW5nLmZvcm1hdCgiJXM7IiwgcXVlcnkp KQ0KCQlmZDp3cml0ZShzdHJpbmcuZm9ybWF0KCJcbiIpKQ0KDQoNCgkJLS0gU2UgdmllbmUgbGFu Y2lhdG8gaWwgY29tYW5kbyBxdWl0L2V4aXQsIHZpZW5lIHNjcml0dG8gIlFVSVQ7IiBhbGwnaW50 ZXJubyBkaSBsb2dfcXVlcnkNCgkJZWxzZWlmIHN0cmluZy5ieXRlKHBhY2tldCkgPT0gcHJveHku Q09NX1FVSVQgdGhlbg0KCQkJZmQ6d3JpdGUoICJRVUlUOyIpDQoJCQlmZDp3cml0ZShzdHJpbmcu Zm9ybWF0KCJcbiIpKQ0KDQoNCgllbmQNCg0KDQoJLS1JbnZpbyBkZWwgbWVzc2FnZ2lvIGFsIHNl cnZlcg0KCWVjY2V6aW9uZShjOnNlbmQoIk51b3ZhIHF1ZXJ5IGNhdHR1cmF0YVxyXG4iKSkNCg0K DQoJLS1SaWNlemlvbmUgZGVsIG1lc3NhZ2dpbyBwcm92ZW5pZW50ZSBkYWwgc2VydmVyDQoJbG9j YWwgYW5zd2VyID0gZWNjZXppb25lKGM6cmVjZWl2ZSgnKmwnKSkNCg0KDQoJLS1zdGFtcGEgaWwg bWVzc2FnZ2lvIHByb3ZlbmllbnRlIGRhbCBzZXJ2ZXINCglwcmludChhbnN3ZXIpDQoNCg0KDQoJ LS0gY2hpdWRvIGlsIGZpbGUgZGVzY3JpcHRvcg0KCWZkOmZsdXNoKCkNCg0KDQotLWVuZCBmdW5j dGlvbg0KCWVuZA0KDQoNCi0tY2hpdXN1cmEgZGVsbGEgc29ja2V0DQpjOmNsb3NlKCkNCg0KDQo= --_36c71056-6ad8-4596-a5b1-4ca8d65f251d_-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:47:18 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FlEBT030635; Mon, 9 Nov 2009 13:47:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8650F18D7F; Mon, 9 Nov 2009 13:46:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D17F018CAD for ; Mon, 9 Nov 2009 13:46:19 -0200 (BRST) Received: by ywh40 with SMTP id 40so2645013ywh.33 for ; Mon, 09 Nov 2009 07:46:17 -0800 (PST) Received: by 10.150.239.15 with SMTP id m15mr11554407ybh.109.1257699507904; Sun, 08 Nov 2009 08:58:27 -0800 (PST) Received: from burninglabs.com ([71.21.67.37]) by mx.google.com with ESMTPS id 15sm949226gxk.0.2009.11.08.08.58.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 08:58:27 -0800 (PST) Date: Sun, 8 Nov 2009 10:58:21 -0600 From: Phoenix Sol To: lua@bazar2.conectiva.com.br Subject: Re: Unix Domain Sockets in Lua Message-ID: <20091108105821.435a511e@burninglabs.com> In-Reply-To: References: Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, 7 Nov 2009 22:00:03 +0300 Alexander Gladysh wrote: > Hi, list! > > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. > > Are there any other solutions? > > Alexander. Steven Barth's nixio supports them. Also, I thought I'd mention that I've added a few things to a fork of nixio, such as socketpair(), and support for passing socket descriptors between processes: http://github.com/phoenixsol/nixio. My changes are listed here: http://wiki.github.com/phoenixsol/nixio. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:48:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FmfG7031014; Mon, 9 Nov 2009 13:48:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4823918DCC; Mon, 9 Nov 2009 13:48:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-341.bluehost.com (outbound-mail-341.bluehost.com [66.147.249.2]) by bazar2.conectiva.com.br (Postfix) with SMTP id CBF5618CD2 for ; Mon, 9 Nov 2009 13:48:10 -0200 (BRST) Received: (qmail 22346 invoked by uid 0); 9 Nov 2009 15:48:07 -0000 Received: from unknown (HELO box571.bluehost.com) (66.147.242.171) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 9 Nov 2009 15:48:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=spellingbeewinnars.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=uK1KFFOH3EdABH7yksn6SykwMveUCYQhzBZ86nj0/0u3Krv4HKAu4TPwlAhl8nl+R7FJwZy5gaJNQF91AHEijdxeutwL/EUILygqOv1XXzlcjt/ymn5G5TnGqf41ow9b; Received: from bas3-unionville55-1279753060.dsl.bell.ca ([76.71.123.100] helo=[192.168.1.3]) by box571.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1N7WTP-0006MK-9R for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 08:48:07 -0700 Message-ID: <4AF839AF.9040201@spellingbeewinnars.org> Date: Mon, 09 Nov 2009 10:47:59 -0500 From: Patrick User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Whats does your Lua Stack look like? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {1895:box571.bluehost.com:mccavery:2h2inc.com} {sentby:smtp auth 76.71.123.100 authed with patrick@2h2inc.com} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi Everyone Again I am new to Lua and just learning my way around. I am trying to figure how to use it appropriately in my projects. Where does Lua fit in your stack? I would like to use Lua for web development and Desktop development. I have not figured out things out but my web stack might look a bit like: Ubuntu Fast CGI server(Cherokee, Lightpd, Xavante etc) WSAPI My App or Orbit+ My App My App or Kepler+My App My desktop stack might be: Ubuntu C language Lua Lua-Gnome or Browser for GUI Thanks for reading-Patrick From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:49:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FnXwV031478; Mon, 9 Nov 2009 13:49:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 956E418E07; Mon, 9 Nov 2009 13:49:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5BCD818B9F for ; Mon, 9 Nov 2009 13:49:09 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA9Fn84g001949 for ; Mon, 9 Nov 2009 13:49:08 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id BDA4054C1D0; Mon, 9 Nov 2009 13:49:08 -0200 (BRST) Date: Mon, 9 Nov 2009 13:49:08 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: debug.traceback() oddity Message-ID: <20091109154908.GB15558@inf.puc-rio.br> References: <4AF80C4F.5090406@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF80C4F.5090406@cowlark.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > =debug.traceback() > stack traceback: > stdin:1: in main chunk > [C]: ? > > ...works as expected. But this: > > > =debug.traceback(nil, "foo", 1) > 1 > > ...doesn't. [...] The first argument cannot be nil. Because the first argument is an optional thread, and nil is not a thread, the function gets confused about what is what. The call without the nil gives a correct answer. The call with nil probably should give an error; 5.2 does: > =debug.traceback(nil, "foo", 1) stdin:1: bad argument #2 to 'traceback' (number expected, got string) stack traceback: [C]: in function 'traceback' stdin:1: in main chunk [C]: in ? -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:54:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9FsjK2032473; Mon, 9 Nov 2009 13:54:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 898A518E3C; Mon, 9 Nov 2009 13:54:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4336C18D7F for ; Mon, 9 Nov 2009 13:54:10 -0200 (BRST) Received: by pzk34 with SMTP id 34so2192868pzk.11 for ; Mon, 09 Nov 2009 07:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=3208MjUlKWD2Km7zZ7Hnnrom4fARL824wTovFlc4mto=; b=mSjp0/5j6HNYAFkOebue2FUBfR69NV1v502aAi+cp7WebdZ4AefBj2y9m6X4NG0I3Z SpXejTqphJHz7rA++QRT8cRt0IjTjA3KHCzZ0n+XyFfJFOQoYvgI/YOaNxjNv75SvHc3 bENWdq4VrtvPKqOv5+L1RyMtaRLxeWjFsWqJk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hAxA44sndNWUcDbRJJWxnmmRdgbd0yQZ+EmPZaaqB5jeYXKQ3cNGoYBkTOjZLOluQL y9kIQKx2SvDgJ7lhRrdjio+INLVWqDji2Sl3ruGpl9wvGhpSjOSXdzaJ6xANhQv8qS39 vgDmKOChGkmsIDyjDbH8iWQNdo0oF7raMnxN8= MIME-Version: 1.0 Received: by 10.143.25.39 with SMTP id c39mr824036wfj.10.1257782047950; Mon, 09 Nov 2009 07:54:07 -0800 (PST) In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> References: <4AF839AF.9040201@spellingbeewinnars.org> Date: Mon, 9 Nov 2009 13:54:07 -0200 Message-ID: Subject: Re: Whats does your Lua Stack look like? From: Lucas Hermann Negri To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 9, 2009 at 1:47 PM, Patrick wrote: > Hi Everyone > > Again I am new to Lua and just learning my way around. I am trying to figure > how to use it appropriately in my projects. Where does Lua fit in your > stack? > > I would like to use Lua for web development and Desktop development. I have > not figured out things out but my web stack might look a bit like: > Ubuntu > Fast CGI server(Cherokee, Lightpd, Xavante etc) > WSAPI > My App or Orbit+ My App > My App or Kepler+My App > > My desktop stack might be: > Ubuntu > C language > Lua > Lua-Gnome or Browser for GUI > > Thanks for reading-Patrick > > > Hi, my stack: For web: nginx + fastcgi + wsapi + ldbi(postgres) (+ Lua) For desktop: lgob (for GTK+ and other libraries) + ldbi(postgres, sqlite) (+ Lua) http://oproj.tuxfamily.org From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 13:59:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Fx5N4001077; Mon, 9 Nov 2009 13:59:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B0C918D03; Mon, 9 Nov 2009 13:58:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from shelob.oktetlabs.ru (unknown [195.131.132.186]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9AE2F18C6A for ; Mon, 9 Nov 2009 13:58:37 -0200 (BRST) Received: by shelob.oktetlabs.ru (Postfix, from userid 5001) id 627D676DAD; Mon, 9 Nov 2009 18:58:30 +0300 (MSK) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru 627D676DAD DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1257782310; bh=AIDwKgvDUtwRQCoDscmLnv3PLDJPlKqYISsZhal 5g/8=; l=423; h=Message-ID:Date:From:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=O ddHU2mZifJbuPZBWjaySgqt1RraX/X3SmIZLdS55paRM4eOJRXCPnHyzWhvX0tf+YpA XH9Ho+Kq+FrZ7XSR2NFTjToMgvDJo0wDorOzw7UzETppfjOhmM4pdlA5hX7oHMSffkq d7nvvHqacCkaB2vVsGeOimQdLhsEBttgen1A= X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED autolearn=ham version=3.2.5 Received: from [192.168.128.9] (unknown [93.100.118.145]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id D24CD76DAC for ; Mon, 9 Nov 2009 18:58:26 +0300 (MSK) X-DKIM: Sendmail DKIM Filter v2.6.0 shelob.oktetlabs.ru D24CD76DAC Message-ID: <4AF83C1C.3020203@oktetlabs.ru> Date: Mon, 09 Nov 2009 18:58:20 +0300 From: Nikolai Kondrashov User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Lua list Subject: Re: Whats does your Lua Stack look like? References: <4AF839AF.9040201@spellingbeewinnars.org> In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick wrote: > Again I am new to Lua and just learning my way around. I am trying to > figure how to use it appropriately in my projects. Where does Lua fit in > your stack? Embedded Linux on a CPE (home router) Lighttpd mod_fastcgi ClearSilver C application with Lua modules We have our implementation of Lua interface for ClearSilver, but haven't considered opening the sources, yet. Sincerely, Nick From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:02:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9G2o08002010; Mon, 9 Nov 2009 14:02:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F377118E4C; Mon, 9 Nov 2009 14:02:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64DE018CF4 for ; Mon, 9 Nov 2009 14:02:21 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N7Wh6-0006Q9-6U for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 16:02:16 +0000 Message-ID: <4AF83D0C.70706@cowlark.com> Date: Mon, 09 Nov 2009 16:02:20 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: debug.traceback() oddity References: <4AF80C4F.5090406@cowlark.com> <20091109154908.GB15558@inf.puc-rio.br> In-Reply-To: <20091109154908.GB15558@inf.puc-rio.br> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roberto Ierusalimschy wrote: [...] > The first argument cannot be nil. Because the first argument is an > optional thread, and nil is not a thread, the function gets confused > about what is what. The call without the nil gives a correct answer. I did wonder about this, but since coroutine.running() returns nil when in the main thread, I assumed it was all right... how do I find out what the currently running thread is? Is the correct invocation debug.traceback(message, level) if I'm not specifying a thread, then? What if I don't want a message either? debug.traceback(level) doesn't seem to do what I want. (I have to say that leading optional arguments are extremely confusing. It was only after reading your message here that I realised how they're supposed to work --- previously I'd been passing in nil to indicate 'no argument here'...) - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr4PQoACgkQf9E0noFvlzixrQCfeM5vxANBPR7O5jKOBm6Ekvuo E88AnjSDRgGd76vjDJFvid7fGe//QkCM =cuEM -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:05:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9G5j8P002650; Mon, 9 Nov 2009 14:05:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1D28718EBE; Mon, 9 Nov 2009 14:05:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6855D18E33 for ; Mon, 9 Nov 2009 14:05:15 -0200 (BRST) Received: by ywh40 with SMTP id 40so2661398ywh.33 for ; Mon, 09 Nov 2009 08:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=SXxW5jLwd7K8vKUbKvMaM+gmWfwcZI9AWlbmS7iTkgY=; b=FDMwDJiOzvyNDTKlfqxCDieJ5XFyqQSVvMEe1kipUlea+6rFKXQ9vQpvotMijSNwSo ogpk3I3IPjwFR95aMngI4SOiVhTGeJJ9fxHI1rvNe4DGvdclerSihkbG7eLVtjfluA9g GAfCgQJWGWec3PdTUyntQDDktPPlEGkZSsjb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Og7PjXRXY+pfs3A4ogzaQzaDu7DXC32YSbCtFgVQyh7NAY9HlY58vSUzjw/uUwaIga 4aRhtEFIl0bc1E2ScR8jbKoB5mc4IXFUSaxzu3d8u1n3wq/qgmLnafNYDk+hNwDYiocV JJ0s2Rxan9emqgkO2or/QnW9kANteKWzn/iBA= MIME-Version: 1.0 Received: by 10.101.130.25 with SMTP id h25mr6523283ann.66.1257782713714; Mon, 09 Nov 2009 08:05:13 -0800 (PST) Date: Mon, 9 Nov 2009 14:05:13 -0200 Message-ID: Subject: tolua_pushusertype Documentation From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636c924cadb06f80477f25b61 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c924cadb06f80477f25b61 Content-Type: text/plain; charset=ISO-8859-1 Hello guys, I would like to know how exactly the memory management in tolua_pushusertype() works. I was expecting that my information was passed as tables to my lua script and that would be I could without problems delete my structs in C. But that does not hold truth, because after deleting the data in C the scripts stopped working. I looked also that tolua uses a begin_module() to define the classes, but I am not sure how this works either and I was not able to find it on the net. Could you provide me some information in how does this work or where to obtain information. Thanks, Danilo --001636c924cadb06f80477f25b61 Content-Type: text/html; charset=ISO-8859-1 Hello guys,

I would like to know how exactly the memory management in tolua_pushusertype() works. I was expecting that my information was passed as tables to my lua script and that would be I could without problems delete my structs in C. But that does not hold truth, because after deleting the data in C the scripts stopped working.

I looked also that tolua uses a begin_module() to define the classes, but I am not sure how this works either and I was not able to find it on the net.

Could you provide me some information in how does this work or where to obtain information.

Thanks,
Danilo --001636c924cadb06f80477f25b61-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:11:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9GAxp8004137; Mon, 9 Nov 2009 14:10:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55A2C18DAF; Mon, 9 Nov 2009 13:47:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B06518CD2 for ; Mon, 9 Nov 2009 13:47:03 -0200 (BRST) Received: by bwz27 with SMTP id 27so3589205bwz.21 for ; Mon, 09 Nov 2009 07:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=mcWKkAuCZQVyvzOsKLxOQl5j/l0sEjswWnPerlnI2eE=; b=cu4F2mKWTblB0Tp9NXrNBmOrVMUqWZWoPGaqaVXscqxmfEwW1Rf5rpWp+ieFCH/PNm Aw1zp4xkRMcLDGyQQoUgecMtoA3dah8cXsgIoZHC0CZLes6bH/lkXs9VI1F4svUg79r1 haJOZ7wEexFed5PxlM+sciRmUdNR87OaX2S0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=uZoKGgY+Y/TmtQwJueWGo1swckangGL/We/5GmmkqMKKNPRB41c8Jj6VhFL7fwmB9u iPhaXaxPZUyxU0Yu7pksYU2yT5M4HdBAY1ZoyKuEMYomABOO8ryP6Dokh1/brJL4vxGm 9k4rWp+0pxxLYKlexCRFer3OqPi3GrXgAPz7k= Received: by 10.204.24.83 with SMTP id u19mr7106680bkb.22.1257677035557; Sun, 08 Nov 2009 02:43:55 -0800 (PST) Received: from lurch.humyo.com (91-65-142-230-dynip.superkabel.de [91.65.142.230]) by mx.google.com with ESMTPS id d13sm3466599fka.22.2009.11.08.02.43.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 02:43:54 -0800 (PST) Message-ID: <4AF6A0E9.2090800@gmail.com> Date: Sun, 08 Nov 2009 11:43:53 +0100 From: Richard Hundt User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Unix Domain Sockets in Lua References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > Hi, list! > > I want to use Unix Domain Sockets in my Lua code. > > I see that LuaSocket does not support them. > > Are there any other solutions? http://luaforge.net/projects/luasys/ Documentation is sparse, but the tests are instructive. Lots of other nice goodies in there too (event queue, native threads, malloced buffers which you can use as I/O streams from within Lua, etc.), but still light-weight. Does UNIX domain sockets too, of course. Cheers, Richard Hundt From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:14:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9GEUtH005436; Mon, 9 Nov 2009 14:14:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7197A18F75; Mon, 9 Nov 2009 14:14:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.216.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6ABEC18DFD for ; Mon, 9 Nov 2009 14:14:00 -0200 (BRST) Received: by pxi2 with SMTP id 2so666404pxi.11 for ; Mon, 09 Nov 2009 08:13:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.8.7 with SMTP id 7mr619939wfh.338.1257651801543; Sat, 07 Nov 2009 19:43:21 -0800 (PST) In-Reply-To: <20091102132112.GA27625@mike.de> References: <20091031225554.GA30341@mike.de> <576e7620911010136l660fc989ocaef8702c02314a0@mail.gmail.com> <20091101210128.GA22817@mike.de> <576e7620911012212w6870a511u781d25cfc954fdca@mail.gmail.com> <20091102132112.GA27625@mike.de> Date: Sat, 7 Nov 2009 21:43:21 -0600 Message-ID: <576e7620911071943w53ab54a5ia2afb5dea5ed0a39@mail.gmail.com> Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Steven Johnson To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 2, 2009 at 7:21 AM, Mike Pall wrote: > Steven Johnson wrote: >> Sure, I'll see what I can do. This is embedded in a pretty big program and >> I think I've got meetings and such this week, so it might be a few days >> getting around to it. > > The beta phase will take quite a bit longer than that. Take your > time. :-) (Apologies if you get something similar to this, though I think the previous message got timed out.) I got around to this today, loading some dummy modules at various parts of the code and dumping package, and tracked the switch between well-ordered modules and nesting to where we initialize our middleware. Making an educated guess, I added _control87( _PC_53, MCW_PC ); immediately after that call. After that, and updating a few libraries to LJ2, the game is up and running! :D (Looks like the package.loaders thing was just another consequence of this.) This being DX9, it would seem the lack of D3DCREATE_FPU_PRESERVE reared its ugly head and fubar'd LJ2. I'll see about doing this a bit more properly and report back if anything violates that assumption. If not, though, I guess it's worth putting a warning somewhere. :) From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:15:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9GFKAp005682; Mon, 9 Nov 2009 14:15:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FF401902A; Mon, 9 Nov 2009 14:14:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FDC618FDF for ; Mon, 9 Nov 2009 14:14:37 -0200 (BRST) Received: by bwz27 with SMTP id 27so3619337bwz.21 for ; Mon, 09 Nov 2009 08:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=QOEVNlwgBGIoZdyCMnmBnBX/U7f9npq9cZ0YaaSpryA=; b=r/u00keET1DmHdtsQGgeF+SvV8Xe9UAOBTnMZ5QIwSGZhK/sY+/CplIfmWQT9Km0/s 10GhIbK5o15ofHjmgFEgmnEkKrZpxb8tOWW1nYjojH9N5ofVNXQfo3j6ZFzRtxpTxwGR tSRv5JBtFCoAM0W9unLJucDJYH/iPO+/pLp3E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=e9vCOZ9jpYaGbpAW9xmIy63peKmTPvq5vEzlr3FnLBsPP0AM8AShqJx/jKPmpuJaom fXfSDOP2ELCOF6Glg+whRP7LhHUr+woHNYcwiUHrBzyoGJCAFXkWUglOpkNDtxkYtd12 jXimp7YDIeyR8CV5efPn3pSwJ4rIqtr1C1rTY= MIME-Version: 1.0 Received: by 10.216.93.12 with SMTP id k12mr348798wef.195.1257783276158; Mon, 09 Nov 2009 08:14:36 -0800 (PST) In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> References: <4AF839AF.9040201@spellingbeewinnars.org> From: Jerome Vuarand Date: Mon, 9 Nov 2009 17:14:16 +0100 Message-ID: <89d273ba0911090814l794393c3x8d754ba0f389ce3f@mail.gmail.com> Subject: Re: Whats does your Lua Stack look like? To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/9 Patrick : > Again I am new to Lua and just learning my way around. I am trying to figure > how to use it appropriately in my projects. Where does Lua fit in your > stack? > > I would like to use Lua for web development and Desktop development. I have > not figured out things out but my web stack might look a bit like: > Ubuntu > Fast CGI server(Cherokee, Lightpd, Xavante etc) > WSAPI > My App or Orbit+ My App > My App or Kepler+My App > > My desktop stack might be: > Ubuntu > C language > Lua > Lua-Gnome or Browser for GUI My desktop stack : - win32 API - C glue (lwin32) - Lua Not portable of course, but Lua code remains surprisingly succinct, and it works like a charm even with a single thread. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 14:56:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9GumTO016481; Mon, 9 Nov 2009 14:56:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2CCC18F13; Mon, 9 Nov 2009 14:56:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8026E18E58 for ; Mon, 9 Nov 2009 14:56:03 -0200 (BRST) Received: by ywh40 with SMTP id 40so2707471ywh.33 for ; Mon, 09 Nov 2009 08:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=TYvgxXgVkt+exqwl6VV4J0RT1hB8Ut4M+JabIwPXR6g=; b=wd6DfI4F2dczpQ88541ioCdncuE2HkrsKeDK7ylYVJmmsTHuX7t9460PLSiVc/O7ew QgnYtbleZd5wdgqd8ONNJ3KEuyCgOvNQCyWmmw9Hr14+MI5LR8v6PtrxdcCmQadQ3tFb SwT+rRzzCgcjY5gKkPqcRdftAWcEL3sAcNuYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Im2Bt/rGho/uyw8zlLdRPLq03QaVHX+i5Ur3WGEeGv4BV8kDKvO16+Ot8ejzpwwdtr O6gnZgdbU6V62uNpLQtJXYRAAE0pAqDe/WcIY6ZhytpsmDuwYdTL/T0HF7Ym9LVOCvcw qlCawdZY7E8veAZh3bgsax0JVRLrBXEeEkPRU= MIME-Version: 1.0 Received: by 10.101.4.27 with SMTP id g27mr5722262ani.150.1257689551214; Sun, 08 Nov 2009 06:12:31 -0800 (PST) Date: Sun, 8 Nov 2009 12:12:31 -0200 Message-ID: Subject: Lightuserdata freed in Lua? From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=005045015fd7f01c720477dcaab2 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --005045015fd7f01c720477dcaab2 Content-Type: text/plain; charset=ISO-8859-1 Hello guys, I am using a script which updates the action of a character in game. Each tme the script is called with the pointer to a character, which I use as a key to a global table to access the arguments and other variables of the action. The problem arrives when one character i executing one script when I try to pass parameters to another. The characters that was already executing stops, because the argument stored in its table turns to NULL, but it is a lightuserdata! This should not be freed by C? I pass the parameters to one script and after that I set the parameters to NULL, to be sure that the other characters do not get it. Here is my code; pointer="x%x+" key= string.sub(tostring(id), string.find(tostring(id),pointer)) if table_arg[key] == nil then table_arg[key]={} --id={} print(key) end function endCurrentAction() table_arg[key]["action"]=nil id:System_endCurrentAction() end --set the name of the action based on debug information local da= debug.getinfo(1,"S") action= da.source --if this is the first time this action is called --or if this is the first action to be called for this character --set the action in the table to this action if table_arg[key]["action"] ~= action then table_arg[key]["action"]= action --------------------Initialization Begin--------------- id:beginAnimation(WALK_ANIM) --------------------Initialization End----------------- end -- everytime new arguments are passed to the script -- even when the same action remains, the arguments in -- the character's table must be changed if arg0 ~= nil then --------------Insert all Args to the Table------------- table_arg[key]["arg0"]= arg0 print("new_arg" .. tostring(arg0)) -------------------------------------------------------- end ----------------------Main------------------------------ --print(id) --local target_position= table_arg[id].arg0 local target_position= table_arg[key]["arg0"] --print("key " .. key) --print("target " .. tostring(target_position)) if target_position == nil then endCurrentAction() print("new_arg" .. tostring(arg0)) --*WHY IT ENTERS HERE???* end local current_position = id:getPosition() id:changeDirection(target_position.x, target_position.z, dt) --print(dt) local dist= math.sqrt( (target_position.x - current_position.x)*(target_position.x - current_position.x) + (target_position.y - current_position.y)*(target_position.y - current_position.y) + (target_position.z - current_position.z)*(target_position.z - current_position.z) ) local character_data= id:getCharacterData() --check if he arrived at the destination if dist <= character_data.size then endCurrentAction(); end --005045015fd7f01c720477dcaab2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello guys,

I am using a script which updates the action of a charac= ter in game. Each tme the script is called with the pointer to a character,= which I use as a key to a global table to access the arguments and other v= ariables of the action.

The problem arrives when one character i executing one script when I tr= y to pass parameters to another. The characters that was=A0 already executi= ng=A0 stops, because the argument stored in its table turns to NULL, but it= is a lightuserdata! This should not be freed by C?

I pass the parameters to one script and after that I set the parameters= to NULL, to be sure that the other characters do not get it.

Here i= s my code;


pointer=3D"x%x+"
key=3D string.sub(tostr= ing(id), string.find(tostring(id),pointer))

if table_arg[key] =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 table_arg[ke= y]=3D{}
=A0=A0=A0=A0=A0=A0=A0 --id=3D{}
=A0=A0=A0=A0=A0=A0=A0 print(k= ey)
end

function endCurrentAction()
=A0=A0=A0=A0=A0=A0=A0 tabl= e_arg[key]["action"]=3Dnil
=A0=A0=A0=A0=A0=A0=A0 id:System_end= CurrentAction()
end

--set the name of the action based on debug information
local= da=3D debug.getinfo(1,"S")
action=3D da.source


--i= f this is the first time this action is called
--or if this is the first= action to be called for this character
--set the action in the table to this action
if table_arg[key]["act= ion"] ~=3D action then
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["a= ction"]=3D action
--------------------Initialization Begin---------= ------
=A0=A0=A0=A0=A0=A0=A0 id:beginAnimation(WALK_ANIM)
--------------------Initialization End-----------------
end

-- ev= erytime new arguments are passed to the script
-- even when the same act= ion remains, the arguments in
-- the character's table must be chang= ed
if arg0 ~=3D nil then
--------------Insert all Args to the Table--------= -----
=A0=A0=A0=A0=A0=A0=A0 table_arg[key]["arg0"]=3D arg0
= =A0=A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
-----= ---------------------------------------------------
end



----------------------Main------------------------------=

--print(id)


--local target_position=3D table_arg[id].arg= 0
local target_position=3D table_arg[key]["arg0"]
--print(&= quot;key " .. key)
--print("target=A0 " .. tostring(target_position))
if target_p= osition =3D=3D nil then
=A0=A0=A0=A0=A0=A0=A0 endCurrentAction()
=A0= =A0=A0=A0=A0=A0=A0 print("new_arg" .. tostring(arg0))
=A0=A0= =A0=A0=A0=A0=A0 --WHY IT ENTERS HERE???
end

local current_position =3D id:getPosition()


id:change= Direction(target_position.x, target_position.z, dt)

--print(dt)
<= br>local dist=3D math.sqrt( (target_position.x - current_position.x)*(targe= t_position.x - current_position.x) +
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (target_= position.y - current_position.y)*(target_position.y - current_position.y) +=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (tar= get_position.z - current_position.z)*(target_position.z - current_position.= z)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 )

local character_data=3D id:getCharacterData()

--check if he arri= ved at the destination
if dist <=3D character_data.size then
=A0= =A0=A0=A0=A0=A0=A0 endCurrentAction();
end


--005045015fd7f01c720477dcaab2-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 15:17:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9HHEog020830; Mon, 9 Nov 2009 15:17:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EC7718FCC; Mon, 9 Nov 2009 15:16:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1DA518EDB for ; Mon, 9 Nov 2009 15:16:37 -0200 (BRST) Received: by ywh40 with SMTP id 40so2724840ywh.33 for ; Mon, 09 Nov 2009 09:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Tp8ftxWoQd+tVHcDP0jKWYTGCFZ3U5cyGuuPLgJCJKM=; b=SY+OiIyJo5mXmwxpRwrpKhdKTgT2/vbYDan1Bx++cdYrLaQvv61tfPw6F7ZLkr6t5i 1jgZ0yHbr4s2rS/3qhmqcGY1UBr5+WgKsx4wn2Ka2ORnPwev3mDj3SZjcQ/WFzxr6UzX qNCkROlphBO1mh0cZhn9cpd2HStw+3SXjVJGs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qJnich3qqr3r3lvKPz/JiPARv7nKf+Ydcm2bHWSoRY3XUsP7YNk7dJNggV5wIZM+Dq cD7jmgTuvfIDaNjPH2d5ijqKYYJClDmnHdYAGPtBrTvpU8C+3KD7d+4NSjtFmD/ej0fa lnwF+d3FScnPEGwJmLevQgXaCv0C0BjVw5lbE= MIME-Version: 1.0 Received: by 10.101.32.11 with SMTP id k11mr3076023anj.67.1257786995645; Mon, 09 Nov 2009 09:16:35 -0800 (PST) Date: Mon, 9 Nov 2009 15:16:35 -0200 Message-ID: Subject: LuaProfile at Eclipse From: julia varanda To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016367d58e4141e150477f35b00 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016367d58e4141e150477f35b00 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Did anyone have tried to use LuaProfile at Eclipse? I have tried but I wasn't successfull. When I run the lua document nothing happens. I use Eclipse 3.5, LuaEclipse 1.3.1 and LuaEclipse Profiler1.0.2. Could anyone help me? Thanks, J=FAlia Varanda da Silva Peta5 - N=F3s fazemos TV digital http://www.peta5.com.br (21) 3021-6001 --0016367d58e4141e150477f35b00 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

Did anyone have tried to use LuaProfile at Eclipse?
I have tr= ied but I wasn't successfull. When I run the lua document nothing happe= ns.
I use Eclipse 3.5, LuaEclipse 1.3.1 and LuaEclipse Profiler1.0.2.
Could anyone help me?

Thanks,

J=FAlia Varan= da da Silva
Peta5 - N=F3s fazemos TV digital
http://www.peta5.com.br
(21) 3021-6001
--0016367d58e4141e150477f35b00-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 15:21:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9HLkwm021861; Mon, 9 Nov 2009 15:21:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9952219051; Mon, 9 Nov 2009 15:21:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from col0-omc3-s5.col0.hotmail.com (col0-omc3-s5.col0.hotmail.com [65.55.34.143]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFFCE18FCD for ; Mon, 9 Nov 2009 15:21:06 -0200 (BRST) Received: from COL107-W39 ([65.55.34.136]) by col0-omc3-s5.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Nov 2009 09:20:21 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_198efee4-9d58-4cfc-a8c8-0d64b601eac4_" X-Originating-IP: [87.10.138.55] From: francesco puca To: Subject: Query capture Date: Mon, 9 Nov 2009 17:20:22 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 09 Nov 2009 17:20:21.0963 (UTC) FILETIME=[EAECE9B0:01CA6160] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_198efee4-9d58-4cfc-a8c8-0d64b601eac4_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all! I created a client LUA that catches the query sent to a MySQL DB (using MyS= QL Proxy)=2C writes it to a file .log and sends a message (for each queries= captured) to=20 a SQL parser (written in java). The problem is this: When i enter a query s= uch as "USE database=3B" the client first captures a "nil information" and = then the=20 query=3B so it sends 2 messages instead of 1 to the Parser. How can I fix this?=20 Thank you very much =20 socket =3D require("socket") local c =3D socket.tcp() local log_file =3D "C:/Users/Francesco/Desktop/Tesi/mysql-proxy/log_query.l= og" local fd =3D io.open(log_file=2C "a+") host=3D"localhost" porta=3D7777 function read_query( packet ) local c =3D socket.connect(host =2C porta) local eccezione =3D socket.newtry(function() c:close() end) if string.byte(packet) =3D=3D proxy.COM_QUERY then =20 local query =3D string.sub(packet=2C 2) if query=3D=3D"SELECT DATABASE()" then query=3D"USE DATABASE" end fd:write(string.format("%s=3B"=2C query)) =20 fd:write(string.format("\n")) elseif string.byte(packet) =3D=3D proxy.COM_QUIT then fd:write( "QUIT=3B") fd:write(string.format("\n")) end eccezione(c:send("Nuova query catturata\r\n")) eccezione(c:send(query)) local answer =3D eccezione(c:receive('*l')) print(answer) fd:flush() --end function end c:close() =20 _________________________________________________________________ Carica e scarica in un clic. Fino a 25 GB su SkyDrive=20 http://www.windowslive.it/skyDrive.aspx= --_198efee4-9d58-4cfc-a8c8-0d64b601eac4_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all!
I created a client LUA that catches the query sent to a MySQL DB= (using MySQL Proxy)=2C writes it to a file .log and sends a message (for e= ach queries captured) to
a SQL parser (written in java). The problem is= this: When i enter a query such as "USE database=3B" the client first capt= ures a "nil information" and then the
query=3B so it sends 2 messages i= nstead of 1 to the Parser.
How can I fix this?
Thank you very much
 =3B

socket =3D require("socket")

local c =3D socket.tcp()
local log_file =3D "C:/Users/Francesco/Desktop/Tesi/mysql-proxy/log_query.l= og"
local fd =3D io.open(log_file=2C "a+")
host=3D"localhost"
porta=3D7777
function read_query( packet )
local c =3D socket.connect(host =2C porta)
local eccezione =3D socket.newtry(function() c:close() end)
if string.byte(packet) =3D=3D proxy.COM_QUERY then
 =3B =3B = =3B =3B =3B =3B =3B
 =3B =3Blocal query =3D str= ing.sub(packet=2C 2)
 =3B =3Bif query=3D=3D"SELECT DATABASE()" then query=3D"USE DATABAS= E"
 =3B =3Bend
 =3B =3Bfd:write(string.format("%s=3B"=2C query))
 =3B = =3B
 =3B =3Bfd:write(string.format("\n"))
 =3B =3Belseif string.byte(packet) =3D=3D proxy.COM_QUIT then
&n= bsp=3B =3B =3Bfd:write( "QUIT=3B")
 =3B =3B =3Bfd:wr= ite(string.format("\n"))

end
eccezione(c:send("Nuova query catturata\r\n"))
eccezione(c:send(query))
local answer =3D eccezione(c:receive('*l'))
print(answer)
fd:flush()
--end function
end
c:close()



Personalizza il tuo spazio online:= ritaglia= ti il tuo Spaces = --_198efee4-9d58-4cfc-a8c8-0d64b601eac4_-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 15:26:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9HQMJh022739; Mon, 9 Nov 2009 15:26:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 606E51909C; Mon, 9 Nov 2009 15:25:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7105019027 for ; Mon, 9 Nov 2009 15:25:43 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA9HPfgQ012721 for ; Mon, 9 Nov 2009 15:25:41 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 3FB4854C1D0; Mon, 9 Nov 2009 15:25:42 -0200 (BRST) Date: Mon, 9 Nov 2009 15:25:42 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: debug.traceback() oddity Message-ID: <20091109172542.GB16039@inf.puc-rio.br> References: <4AF80C4F.5090406@cowlark.com> <20091109154908.GB15558@inf.puc-rio.br> <4AF83D0C.70706@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF83D0C.70706@cowlark.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I did wonder about this, but since coroutine.running() returns nil when > in the main thread, I assumed it was all right... how do I find out what > the currently running thread is? You do not. (This will be fixed in 5.2.) > Is the correct invocation debug.traceback(message, level) if I'm not > specifying a thread, then? Yes. > What if I don't want a message either? You cannot give a level without a message. (In 5.2 traceback(nil, level) will do that.) > (I have to say that leading optional arguments are extremely confusing. Yes :( That is the price of adding things while mantaining compatibility with previous versions. (Just ask Microsoft ;) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 16:00:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9I06vs031807; Mon, 9 Nov 2009 16:00:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7DFC19092; Mon, 9 Nov 2009 15:59:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28B4F18F98 for ; Mon, 9 Nov 2009 15:59:24 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N7YWN-0002c7-8k for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 18:59:19 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N7YWM-0002p3-PE for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 18:59:18 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART References: <87639muqe9.fsf@mid.deneb.enyo.de> <20091109104342.A31361@lua.tecgraf.puc-rio.br> Date: Mon, 09 Nov 2009 18:59:18 +0100 In-Reply-To: <20091109104342.A31361@lua.tecgraf.puc-rio.br> (Luiz Henrique de Figueiredo's message of "Mon, 9 Nov 2009 10:43:42 -0200") Message-ID: <87skcnbmvd.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Luiz Henrique de Figueiredo: >> - for example, being able to call an API function that returns 0 or 1 >> to indicate whether the GC is currently running or not. > > Why? What can will you do with that information? If you want to call fork() from Lua code, you have to disable the GC so that finalization doesn't occur both in the child and the parent. If this happens in a library routine, you need to make sure that the code composes with callers needing to disable GC as well. And this means that you need some sort of counter. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 16:16:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9IGId0003163; Mon, 9 Nov 2009 16:16:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5100190B7; Mon, 9 Nov 2009 16:15:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from obatala.inf.puc-rio.br (obatala.inf.puc-rio.br [139.82.20.25]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7432118FF0 for ; Mon, 9 Nov 2009 16:15:35 -0200 (BRST) Received: from coleiro.inf.puc-rio.br (coleiro.inf.puc-rio.br [139.82.20.74]) by obatala.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nA9IFVf2000941 for ; Mon, 9 Nov 2009 16:15:32 -0200 Message-Id: From: Waldemar Celes To: Lua list In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: tolua_pushusertype Documentation Date: Mon, 9 Nov 2009 16:15:32 -0200 References: X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The object is pushed as (heavy) Lua userdata. This means that Lua keeps a reference to the C object. If you want, you can ask tolua (through the 'takeownership' function) to delete the C object whenever Lua collects the corresponding userdata. -- Waldemar On Nov 9, 2009, at 2:05 PM, zweifel wrote: > Hello guys, > > I would like to know how exactly the memory management in > tolua_pushusertype() works. I was expecting that my information was > passed as tables to my lua script and that would be I could without > problems delete my structs in C. But that does not hold truth, > because after deleting the data in C the scripts stopped working. > > I looked also that tolua uses a begin_module() to define the > classes, but I am not sure how this works either and I was not able > to find it on the net. > > Could you provide me some information in how does this work or where > to obtain information. > > Thanks, > Danilo From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 16:29:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9ITXwd006474; Mon, 9 Nov 2009 16:29:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24E101911E; Mon, 9 Nov 2009 16:28:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6C4519049 for ; Mon, 9 Nov 2009 16:28:52 -0200 (BRST) Received: by ywh40 with SMTP id 40so2785700ywh.33 for ; Mon, 09 Nov 2009 10:28:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=CPoPw0oH2oE7ergUB/nj8SeVblMqUGRac1ba8Ao3ZKY=; b=HSKZVlLgeHtd5WK5VL1pNR1ldOrxATmJKae4LCGHwvXuC5yFfvL5z2X5jLtlBWhjXO vDF0k6gCH7xHABopy/0AIRu+/jyihGsd5qoHY2R5kzpz8vs94B3EVEaNXiasYLfXlHYj Oj0yB/OP8LyLj9hdG7/opzyxgu1gu3YyHrXhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nJapqxpUIWSl+1fZpyN9KLs6/ysLiS+ascKpbmxd1Ctx+TsJ5105Evkt54OAGfk+nB IbczKDytwgmSce+wY+ngfqwHFnSeryN8lqdcsOTPVKkZUFdia45Am66rGL7ISj3v6ntA RjMXlFmTtb43bp7lSQaLpUobLRVC1nAltj1Oo= MIME-Version: 1.0 Received: by 10.100.245.17 with SMTP id s17mr6827397anh.28.1257791328040; Mon, 09 Nov 2009 10:28:48 -0800 (PST) In-Reply-To: References: Date: Mon, 9 Nov 2009 16:28:47 -0200 Message-ID: Subject: Re: tolua_pushusertype Documentation From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=0016e68dec2e4f36270477f45ded X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68dec2e4f36270477f45ded Content-Type: text/plain; charset=ISO-8859-1 Thanks Waldemar, I do not know why, but Lua frees some strange places in memory when I pass it with takeownership. I switched to passing my position array with a simple lua table. I will use pushuserdata only for big classes. Danilo 2009/11/9 Waldemar Celes > The object is pushed as (heavy) Lua userdata. This means that Lua > keeps a reference to the C object. If you want, you can ask tolua > (through the 'takeownership' function) to delete the C object whenever > Lua collects the corresponding userdata. > > -- Waldemar > > > On Nov 9, 2009, at 2:05 PM, zweifel wrote: > > Hello guys, >> >> I would like to know how exactly the memory management in >> tolua_pushusertype() works. I was expecting that my information was passed >> as tables to my lua script and that would be I could without problems delete >> my structs in C. But that does not hold truth, because after deleting the >> data in C the scripts stopped working. >> >> I looked also that tolua uses a begin_module() to define the classes, but >> I am not sure how this works either and I was not able to find it on the >> net. >> >> Could you provide me some information in how does this work or where to >> obtain information. >> >> Thanks, >> Danilo >> > > --0016e68dec2e4f36270477f45ded Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Waldemar,

I do not know why, but Lua frees some strange place= s in memory when I pass it with takeownership.

I switched to passing= my position array with a simple lua table. I will use pushuserdata only fo= r big classes.

Danilo

2009/11/9 Waldemar Celes <celes@inf.puc-rio.= br>
The object is pushed as (heavy) Lua userdata. This means that Lua
keeps a reference to the C object. If you want, you can ask tolua
(through the 'takeownership' function) to delete the C object whene= ver
Lua collects the corresponding userdata.

-- Waldemar


On Nov 9, 2009, at 2:05 PM, zweifel wrote:

Hello guys,

I would like to know how exactly the memory management in tolua_pushusertyp= e() works. I was expecting that my information was passed as tables to my l= ua script and that would be I could without problems delete my structs in C= . But that does not hold truth, because after deleting the data in C the sc= ripts stopped working.

I looked also that tolua uses a begin_module() to define the classes, but I= am not sure how this works either and I was not able to find it on the net= .

Could you provide me some information in how does this work or where to obt= ain information.

Thanks,
Danilo



--0016e68dec2e4f36270477f45ded-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 16:54:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Irx18011937; Mon, 9 Nov 2009 16:53:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 775D2191EF; Mon, 9 Nov 2009 16:53:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0328B191D9 for ; Mon, 9 Nov 2009 16:53:07 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N71rF-0005OO-00; Sun, 08 Nov 2009 08:06:41 +0100 Date: Sun, 8 Nov 2009 08:06:16 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta1 Message-ID: <20091108070616.GA4141@mike.de> References: <20091031225554.GA30341@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > On some occasions, debug.info(depth) seems to return info about a > different level of the stack frame in LJ2 than in Lua. I'm guessing you > know this, and I think it's alluded to on the status page, but I thought > I'd check. If it is new or of interest I'll try to make a short test > case. > > Oh, it turns out that LJ1 behaves the same as LJ2, so I'm sure you > already know. This is probably about tail calls: The LJ1/LJ2 debug calls always reflect the actual stack layout. A tail call doesn't change the stack depth, neither for the actual stack, nor when seen from the debug API. The original Lua debug API adds fake stack levels for previously executed tail calls. I have argued before that this is not helpful for debuggers. It's not particularly useful either, as no info about them can be returned. And it's hiding important language semantics, too. Tail calls are a guaranteed feature in Lua, not just an implementation detail. Also, LJ2 applys the stack adjustment for tail calls consistently for all function types, whereas the standard Lua interpreter performs them after tail calls to C functions. This can affect the output of something like 'return getfenv(1)'. IMHO it's debatable which stack level this is supposed to refer to. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:09:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9J9ZBo015475; Mon, 9 Nov 2009 17:09:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5EF41923D; Mon, 9 Nov 2009 17:09:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5178019076 for ; Mon, 9 Nov 2009 17:09:05 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7Zbi-0003kW-Ep for lua@bazar2.conectiva.com.br; Mon, 09 Nov 2009 20:08:54 +0100 Received: from 75-151-119-121-washington.hfc.comcastbusiness.net ([75.151.119.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 20:08:54 +0100 Received: from stefan by 75-151-119-121-washington.hfc.comcastbusiness.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2009 20:08:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Stefan Subject: Re: Whats does your Lua Stack look like? Date: Mon, 09 Nov 2009 11:08:26 -0800 Lines: 40 Message-ID: References: <4AF839AF.9040201@spellingbeewinnars.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 75-151-119-121-washington.hfc.comcastbusiness.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Patrick wrote: > Hi Everyone > > Again I am new to Lua and just learning my way around. I am trying to > figure how to use it appropriately in my projects. Where does Lua fit in > your stack? > > I would like to use Lua for web development and Desktop development. I > have not figured out things out but my web stack might look a bit like: > Ubuntu > Fast CGI server(Cherokee, Lightpd, Xavante etc) > WSAPI > My App or Orbit+ My App > My App or Kepler+My App > > My desktop stack might be: > Ubuntu > C language > Lua > Lua-Gnome or Browser for GUI > > Thanks for reading-Patrick > On dev workstation: Code::Blocks C Lua IUP/nginx + fastcgi Production Recipe: (... means various third party & custom C modules for Lua) webapps - apache + mod_wombat + Lua + ... (switching to) nginx + fastcgi + C + Lua + ... industrial control - C + dialog + Lua + ... POS/office - Lua + IUP + ... Sprinkle PostgreSQL, SQLite, and memcached where needed, mix and serve. ;) From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:19:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9JJODI017403; Mon, 9 Nov 2009 17:19:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3F27191F2; Mon, 9 Nov 2009 17:18:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAC1A191C8 for ; Mon, 9 Nov 2009 17:18:50 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id D8086BEB45 for ; Mon, 9 Nov 2009 14:18:44 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 09 Nov 2009 14:18:44 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=Ri+SwzgzeMs8gcrGRqaSl4Av88E=; b=A8dztRo1rgU6sNjjyzx7XrJxnsFG57OhKuTmkgkGTeK0AHDMtDOpSUxmkJ1cUnGmqVyqLH9BECiiNJs4FDEPsEVbckw5fMZd519x/YDfn4wUuLMhi12+EPFCrUzFQjIiN+8oPHeH27F0UGx0SC4f0nqrAwO7ryrsC40AtAGOWTI= X-Sasl-enc: i0IVCI0P4BF+ix1gBk1f5sPZCWwIpgIDArZUCj8AYeBd 1257794324 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id BF6EC4AA5E0 for ; Mon, 9 Nov 2009 14:18:43 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta1 From: Geoff Leyland In-Reply-To: <20091108070616.GA4141@mike.de> Date: Tue, 10 Nov 2009 08:18:08 +1300 Content-Transfer-Encoding: 7bit Message-Id: <9DBE4DE9-4F40-48BB-BB43-DA2E84B4CC1C@fastmail.fm> References: <20091031225554.GA30341@mike.de> <20091108070616.GA4141@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 8/11/2009, at 8:06 PM, Mike Pall wrote: > Geoff Leyland wrote: >> On some occasions, debug.info(depth) seems to return info about a >> different level of the stack frame in LJ2 than in Lua. I'm >> guessing you >> know this, and I think it's alluded to on the status page, but I >> thought >> I'd check. If it is new or of interest I'll try to make a short test >> case. >> >> Oh, it turns out that LJ1 behaves the same as LJ2, so I'm sure you >> already know. > > This is probably about tail calls: Yes, thanks. I had written a short test case that didn't display the behavior which confused me a bit, but I now know that "function b() a () end" is not a tail call, whereas "function b() return a() end" is. The corrected test is below. This showed up in a unit test framework that reports errors at the line of the test, not the line of the test machinery that actually finds the error, so for that it would be nice if the two were consistent, but I'd prefer performance over that. One fix for this case would be to add some code to disrupt the tail call. Cheers, Geoff Test case: function a() for i = 1, 3 do local d = debug.getinfo(i) print(d.name, d.short_src, d.currentline) end end function b() return a() end b() Output: $ lua getinfo-test.lua nil getinfo-test.lua 3 (tail call) -1 nil getinfo-test.lua 12 $ luajit-2.0.0-beta1 getinfo-test.lua b getinfo-test.lua 3 nil getinfo-test.lua 12 nil [C] -1 From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:24:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9JOmSb018736; Mon, 9 Nov 2009 17:24:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5C5EA19287; Mon, 9 Nov 2009 17:24:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B4AB191D5 for ; Mon, 9 Nov 2009 17:24:07 -0200 (BRST) Received: by fxm21 with SMTP id 21so440197fxm.21 for ; Mon, 09 Nov 2009 11:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=qa57oYxLIgTSeeaJfSlPota08BQLOoIhywY5tZuU5R4=; b=qDG4lN0iNsAOc1XD3O3MBJn0w+Qn88FYAhrDmga0J+A6nNhIU2QYV5aIfH9DD5TMn0 ebYBB9Ba5zw8wzsB3GlOqYn6ShMFBdABzMN0gUGyBbJ37g6qGseyHX3K5D8vA0vn8NXi /SH2xo9R6/Ce1k0KkQT2vsdWM39QAH1035qZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=Gy4PrN6DhPg6wgtFVkZPQ9l/xgFJqgrwU1O75CpT/zSBM0x5jQKUKnIwRkr3VfyIeG UERDp6C6qk+Oeg9oJNr2RrdCXuGY/QTl+A/by6nm9S3c1FkF2gXQTGrGOaJ2Y6ry2QjM 8JkjB8EDQATMbThhtt38Q6IJwKVwuw/DroAns= MIME-Version: 1.0 Received: by 10.223.143.68 with SMTP id t4mr1208730fau.20.1257794645582; Mon, 09 Nov 2009 11:24:05 -0800 (PST) From: liam mail Date: Mon, 9 Nov 2009 19:22:03 +0000 Message-ID: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> Subject: Full userdata and metamethods (mail resent) To: Lua list Content-Type: multipart/alternative; boundary=0023545bd64c0ce35e0477f523ff X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545bd64c0ce35e0477f523ff Content-Type: text/plain; charset=ISO-8859-1 This message may or may not have appeared on the mailing list as it was sent went there was a problem with the server, yet I have received newer messages. So I am assuming the first has been lost in the cloud :). I am sorry if is a duplicate. I have come across something that I am unsure if it is expected behaviour or a bug and would like some help to identify which it is. Without going into too much detail I am trying to use the metamethod "__eq" using two full userdata types which both have different metatables yet the same metamethod. According to what I have reread in Programming in Lua and the Reference Manual this should work and does so for tables yet not userdata. Here is the Lua code for tables: mt1 = {} mt2 = {} equal = function (lhs, rhs) return lhs.i == rhs.i end mt1["__eq"] = equal mt2["__eq"] = equal t1 = {} setmetatable(t1,mt1) t2 = {} setmetatable(t2,mt2) t1.i = 1 t2.i = 1 assert(t1 == t2) As you can see it is two tables with different metables yet with the same metamethod which according to the Reference Manual would work. http://www.lua.org/manual/5.1/manual.html#2.8 When I try a similar thing with full userdata instead of tables the method is not called and it returns false, yet I feel it should not. Here is example C++ code for that, (forgive me it takes a bit more code to do this): First the userdata structure and the method struct Int_wrapper{int i;}; int equal(lua_State* s) { Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) ); Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) ); lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); return 1; } lua_State* s = luaL_newstate(); std::string chunk("equal = function (lhs, rhs) \ return lhs == rhs \ end"); luaL_loadbuffer(s,chunk.c_str( ),chunk.size(),"userChunk"); lua_pcall(s,0,LUA_MULTRET,0); lua_getfield(s, LUA_GLOBALSINDEX, "equal"); luaL_newmetatable(s, "mt1"); int mt1 = lua_gettop(s); luaL_newmetatable(s, "mt2"); int mt2 = lua_gettop(s); lua_pushliteral(s, "__eq"); lua_pushcfunction(s, &equal); lua_settable(s, mt1); lua_pushliteral(s, "__eq"); lua_pushcfunction(s, &equal); lua_settable(s, mt2); Int_wrapper* wrapper1 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w1 = lua_gettop(*m_lua); lua_pushvalue(*m_lua,mt1); lua_setmetatable(*m_lua,w1); Int_wrapper* wrapper2 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w2 = lua_gettop(s); lua_pushvalue(s,mt2); lua_setmetatable(s,w2); wrapper1->i = wrapper2->i = 1; lua_remove(s,mt1); lua_remove(s,mt1); lua_pcall(s,2,LUA_MULTRET,0); int result = lua_tointeger(s,-1); CPPUNIT_ASSERT_EQUAL(1,result); lua_close(s); Could some confirm that this should or should not work, if it should not could you please explain why? Thanks --0023545bd64c0ce35e0477f523ff Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This message may or may not have appeared on the mailing list as it was sen= t went there was a problem with the server, yet I have received newer messa= ges. So I am assuming the first has been lost in the cloud :).
I am sor= ry if is a duplicate.

I have come across something that I am unsure if it is expected behaviour or a bug and would like some help to identify which it is.
Wit= hout going into too much detail I am trying to use the metamethod "__eq&quo= t; using two full userdata types which both have different metatables yet the same metamethod. According to what I have reread in Programming in Lua and the Reference Manual this should work and does so for tables yet not userdata.
Here is the Lua code for tables:
mt1 =3D {}
mt2 =3D {}

equal = =3D function (lhs, rhs)
return lhs.i =3D=3D rhs.i
end

mt1[&quo= t;__eq"] =3D equal
mt2["__eq"] =3D equal
t1 =3D {}setmetatable(t1,mt1)
t2 =3D {}
setmetatable(t2,mt2)
t1.i =3D 1
t2.i =3D 1
assert(t1 = =3D=3D t2)

As you can see it is two tables with different metables yet with the same metamethod which according to the Reference Manual would work.
http://www.lua.org/manual/5.1/manual.html#2.8

When I try a similar thing with full userdata instead of tables the method is not called and it returns false, yet I feel it should not. Here is example C++ code for that, (forgive me it takes a bit more code to do this):
First the userdata structure and the method

struct Int_wrapper{int i= ;};

int equal(lua_State* s)
{
=A0=A0=A0 Int_wrapper* i1 =3D st= atic_cast<Int_wrapper *>( lua_touserdata(s, 1) );
=A0=A0=A0 Int_wr= apper* i2 =3D static_cast<Int_wrapper *>( lua_touserdata(s, 2) );
=A0=A0=A0 lua_pushinteger(s, i1->i =3D=3D i2->i ? 1 : 0 );
=A0=A0= =A0 return 1;
}

=A0=A0=A0 =A0=A0=A0 lua_State* s =3D luaL_newstat= e();
=A0=A0=A0 =A0=A0=A0 std::string chunk("equal =3D function (lhs= , rhs) \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0= return lhs =3D=3D rhs \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 end");=
=A0=A0=A0 =A0=A0=A0 luaL_loadbuffer(s,chunk.c_str(
),chunk.size(),"userChunk");
=A0=A0=A0 =A0=A0=A0 l= ua_pcall(s,0,LUA_MULTRET,0);
=A0=A0=A0 =A0=A0=A0 lua_getfield(s, LUA_GLO= BALSINDEX, "equal");

=A0=A0=A0 =A0=A0=A0 luaL_newmetatable(s, "mt1");
=A0=A0=A0= =A0=A0=A0 int mt1 =3D lua_gettop(s);
=A0=A0=A0 =A0=A0=A0 luaL_newmetata= ble(s, "mt2");
=A0=A0=A0 =A0=A0=A0 int mt2 =3D lua_gettop(s);<= br>
=A0=A0=A0 =A0=A0=A0 lua_pushliteral(s, "__eq");
=A0=A0=A0 =A0=A0=A0 lua_pushcfunction(s, &equal);
=A0=A0=A0 =A0=A0= =A0 lua_settable(s, mt1);

=A0=A0=A0 =A0=A0=A0 lua_pushliteral(s, &qu= ot;__eq");
=A0=A0=A0 =A0=A0=A0 lua_pushcfunction(s, &equal);=A0=A0=A0 =A0=A0=A0 lua_settable(s, mt2);

=A0=A0=A0 =A0=A0=A0 Int_w= rapper* wrapper1 =3D static_cast<Int_wrapper*>(lua_newuserdata(s, siz= eof(Int_wrapper)));
=A0=A0=A0 =A0=A0=A0 int w1 =3D lua_gettop(*m_lua);
=A0=A0=A0 =A0=A0=A0 l= ua_pushvalue(*m_lua,mt1);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(*m_lua,w1= );

=A0=A0=A0 =A0=A0=A0 Int_wrapper* wrapper2 =3D static_cast<Int_= wrapper*>(lua_newuserdata(s, sizeof(Int_wrapper)));
=A0=A0=A0 =A0=A0=A0 int w2 =3D lua_gettop(s);
=A0=A0=A0 =A0=A0=A0 lua_pu= shvalue(s,mt2);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(s,w2);

=A0= =A0=A0 =A0=A0=A0 wrapper1->i =3D wrapper2->i =3D 1;
=A0=A0=A0 =A0= =A0=A0 lua_remove(s,mt1);
=A0=A0=A0 =A0=A0=A0 lua_remove(s,mt1);

= =A0=A0=A0 =A0=A0=A0 lua_pcall(s,2,LUA_MULTRET,0);
=A0=A0=A0 =A0=A0=A0 int result =3D lua_tointeger(s,-1);
=A0=A0=A0 =A0=A0= =A0 CPPUNIT_ASSERT_EQUAL(1,result);
=A0=A0=A0 =A0=A0=A0 lua_close(s);

Could some confirm that this should or should not work, if it shou= ld not could you please explain why?
Thanks
--0023545bd64c0ce35e0477f523ff-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:37:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Jbb8N022203; Mon, 9 Nov 2009 17:37:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 128EF19219; Mon, 9 Nov 2009 17:37:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E672019155 for ; Mon, 9 Nov 2009 17:37:05 -0200 (BRST) Received: by bwz27 with SMTP id 27so3835502bwz.21 for ; Mon, 09 Nov 2009 11:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ux8/3z6mPslOo/wBmHBVjNoS3Zjn2mdgLxG+Y6H0z0I=; b=hsJ5hvFSzmSR7B/mEgN6KWKAPnb5jzPk0joNBFL62Lt3Te1kcllwq2hglPm357rM9W mQE4Ve5Bl+iEbWhDYJQ2MEIBT8z+JsW/eorUL1UP2DfjUHoNrh0mo3DJPCiGq3u27RLf z30r9pbOx3CYidfiokzjXD5HklMQBa09haV9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CjFxsflm8PAqiZknJUDQwdfgZCnsT9KNVACPEKuEl6SjUMa6ZV9XA0VITsXY16gcD/ GpTHy+dcKyFoPGZnPfI7jIqgwozdXJEzynYnfmFrke0bgw05pZmmBoGkA/OFGPMd5Wh9 U4qFaoyOeq+H3HBCKDHncEshIxUxt2s+qTnsc= MIME-Version: 1.0 Received: by 10.223.57.66 with SMTP id b2mr1183575fah.33.1257795420221; Mon, 09 Nov 2009 11:37:00 -0800 (PST) In-Reply-To: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> Date: Mon, 9 Nov 2009 19:37:00 +0000 Message-ID: Subject: Re: Full userdata and metamethods (mail resent) From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9Jbb8N022203 On Mon, Nov 9, 2009 at 7:22 PM, liam mail wrote: > I have come across something that I am unsure if it is expected behaviour or > a bug and would like some help to identify which it is. (...) > int equal(lua_State* s) > { >     Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) ); >     Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) ); >     lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); >     return 1; > } I believe that the __eq metamethod (as well as the other comparison metamethods) must return a boolean in order to work properly, so that may be your problem. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:38:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9JcYJt022431; Mon, 9 Nov 2009 17:38:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91AAA1928D; Mon, 9 Nov 2009 17:38:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15A1C19276 for ; Mon, 9 Nov 2009 17:38:07 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7a3y-00033X-00; Mon, 09 Nov 2009 20:38:06 +0100 Date: Mon, 9 Nov 2009 20:37:43 +0100 From: Mike Pall To: Lua list Subject: [ANN] LuaJIT-2.0.0-beta2 Message-ID: <20091109193743.GA25901@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is the second beta release of LuaJIT 2.0.0. It fixes many bugs present in the initial release. Please upgrade! The other major changes are reorganized Makefiles for POSIX (now builds both static and shared libraries) and support for handling C++ exceptions. Performance is unchanged over the initial release. Please check the changelog for more details. Here is a link to the home page: http://luajit.org/luajit.html A direct link to the download page: http://luajit.org/download.html And a link to the changelog: http://luajit.org/changes.html What is LuaJIT? --------------- LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully compatible with standard Lua 5.1 and can significantly boost the performance of your Lua programs. LuaJIT is open source software, released under the MIT/X license. LuaJIT builds out-of-the-box on all popular x86 operating systems (Linux, Windows, OSX etc.). It runs fine as a 32 bit application under x64-based systems, too. This is a BETA TEST release -- the current status and the list of known issues are shown here: http://luajit.org/status.html Please report any problems you may find with this release. Thank you! For more on what's new in LuaJIT 2.0, see the initial announcement: http://lua-users.org/lists/lua-l/2009-10/msg01098.html --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 17:41:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9JfgjS023504; Mon, 9 Nov 2009 17:41:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DD0719294; Mon, 9 Nov 2009 17:41:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F75A1926D for ; Mon, 9 Nov 2009 17:41:08 -0200 (BRST) Received: by fxm21 with SMTP id 21so452314fxm.21 for ; Mon, 09 Nov 2009 11:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=KZZBRH07qkmG+dcKd5LWw9ShA1q6U2qwhs3AIiJCvWo=; b=t1ZKCpsQpRjp/4q/RbdH26mkkq4bfRq5Gz+MA2pMUEE00OvlU6a4SKWNLn6Jng4uZq 8q6wc96mEP/iZzFLFDhLdquWtEbZkeR4PLTc6CFHO6Bykk//cU2Rgcp4NKZKQQplbYMS B39Gmj4vEwZeMV51i2z2fcMMjeKJYWfYH1/3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=T8btKnRNRXnkpTKNZIolLpxr42aagHteHUdrGZr438atzrD3bJM54pNFA1wQVQsCvF WENkxGl2yLfABSitLb+WPkC8cIv3mK2asdAPHnlRGqC+yZ82KsCq3hViDPqxBd+6M1n2 3qd5w3dwDjsOsN1hdIDdB8ZLTQERlPloCLhzo= MIME-Version: 1.0 Received: by 10.223.161.212 with SMTP id s20mr1280593fax.2.1257795665122; Mon, 09 Nov 2009 11:41:05 -0800 (PST) In-Reply-To: References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> From: liam mail Date: Mon, 9 Nov 2009 19:40:45 +0000 Message-ID: <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> Subject: Re: Full userdata and metamethods (mail resent) To: Lua list Content-Type: multipart/alternative; boundary=002354530938d1d7cf0477f55f64 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --002354530938d1d7cf0477f55f64 Content-Type: text/plain; charset=ISO-8859-1 2009/11/9 Duncan Cross > On Mon, Nov 9, 2009 at 7:22 PM, liam mail > wrote: > > I have come across something that I am unsure if it is expected behaviour > or > > a bug and would like some help to identify which it is. > (...) > > int equal(lua_State* s) > > { > > Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) ); > > Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) ); > > lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); > > return 1; > > } > > I believe that the __eq metamethod (as well as the other comparison > metamethods) must return a boolean in order to work properly, so that > may be your problem. > > -Duncan > Duncan even if that is the case it would not effect the fact that the method is never called. I should also say it is not just the equality operator that displays this behaviour. --002354530938d1d7cf0477f55f64 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/11/9 Duncan Cross <duncan.cross@gmail.com&g= t;
On Mon, Nov 9, 2009 at 7:22 PM, liam mail <liam.list@googlemail.com> wrote: > I have come across something that I am unsure if it is expected behavi= our or
> a bug and would like some help to identify which it is.
(...)
> int equal(lua_State* s)
> {
> =A0=A0=A0 Int_wrapper* i1 =3D static_cast<Int_wrapper *>( lua_to= userdata(s, 1) );
> =A0=A0=A0 Int_wrapper* i2 =3D static_cast<Int_wrapper *>( lua_to= userdata(s, 2) );
> =A0=A0=A0 lua_pushinteger(s, i1->i =3D=3D i2->i ? 1 : 0 );
> =A0=A0=A0 return 1;
> }

I believe that the __eq metamethod (as well as the other comparison metamethods) must return a boolean in order to work properly, so that
may be your problem.

-Duncan
Duncan even if that is the case it would not effe= ct the fact that the method is never called. I should also say it is not ju= st the equality operator that displays this behaviour.
--002354530938d1d7cf0477f55f64-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:16:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9KGZVU031766; Mon, 9 Nov 2009 18:16:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C84AC1928D; Mon, 9 Nov 2009 18:16:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 560681923D for ; Mon, 9 Nov 2009 18:15:52 -0200 (BRST) Received: by fxm21 with SMTP id 21so476656fxm.21 for ; Mon, 09 Nov 2009 12:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lnlrb89FiUFVUEPS094fRJPaQKs8KhXIqEt7BK79+bc=; b=CBwr9mIoUDti4czari9NpJhAOxWvSa/rawwbQ4bnD4lLX2YZOM8xwHGgzUGe2bcUpa 7sR0tYdz1AWbnexD/WR0I/kb2ufrbWDwPbXCGpCPNPRtcKNCJItP4rFQPLK/apLCoMfJ peEy7M4VSjt+nnGu33w+Tw/DaniUd5zPEE8W4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=nvaYgD00cHsUcO1NGU5ECBCx98ClD+bBJidF26GS0ylRI4QG+vqWL9m/THE/biph17 tyO7nNNIjjgbcpyZs8a6RuRDFA7R2M9b0PF6VhwV0ZeDMHHeWVubDLqxuwYhLsmqjZ91 oA+LPjxqvbtYhrnoXEchleSeHvfiOKAG3SHa4= MIME-Version: 1.0 Received: by 10.223.27.194 with SMTP id j2mr1203862fac.76.1257797750793; Mon, 09 Nov 2009 12:15:50 -0800 (PST) In-Reply-To: <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> Date: Mon, 9 Nov 2009 20:15:50 +0000 Message-ID: Subject: Re: Full userdata and metamethods (mail resent) From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9KGZVU031766 On Mon, Nov 9, 2009 at 7:40 PM, liam mail wrote: > > > 2009/11/9 Duncan Cross >> >> On Mon, Nov 9, 2009 at 7:22 PM, liam mail >> wrote: >> > I have come across something that I am unsure if it is expected >> > behaviour or >> > a bug and would like some help to identify which it is. >> (...) >> > int equal(lua_State* s) >> > { >> >     Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) >> > ); >> >     Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) >> > ); >> >     lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); >> >     return 1; >> > } >> >> I believe that the __eq metamethod (as well as the other comparison >> metamethods) must return a boolean in order to work properly, so that >> may be your problem. >> >> -Duncan > > Duncan even if that is the case it would not effect the fact that the method > is never called. I should also say it is not just the equality operator that > displays this behaviour. > Okay, you're right, I've had a closer look at the code now and I think the problem is that every time you use lua_pushcfunction(), this creates a new, unique closure on the stack. This means that two instances of the same C function pushed onto the stack will not be equal to each other. Try instead using lua_pushcfunction() only once, then lua_pushvalue() to get a copy of it. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:19:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9KJiDn032543; Mon, 9 Nov 2009 18:19:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F30D1929D; Mon, 9 Nov 2009 18:19:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B8CD219289 for ; Mon, 9 Nov 2009 18:19:09 -0200 (BRST) Received: by pwi3 with SMTP id 3so835333pwi.21 for ; Mon, 09 Nov 2009 12:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Nn9qB36KrDy9cJB3wyJzRk7kWi9D33TOgf+n/yolV7s=; b=T85FqrmDqZuINvdjAc45IOdWlDDl4Y2osoeaLwWY6VvjXMsPBzU0uhXAb5gveTTyU0 CYX+GZSGIb0Bi+883PrZd+zqAcAFQQCQRAVHFn2gYmAqVneAYZwnaNzalZpNCB4aFZfX J7R2x9QQcSoLtQPGVmj6kGIvycSQ1eQdHadE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aQ50OXs+PjQcIkQCNKF8lnaHmvNmG1hH4esGdqpO5NoQCUvBfDzLDmTYCxjaQYcWYE 8tM0qZmN8S/EPI7GhKe4W1Mkyr4iYxkKDMTMXiMkc14GND0nFZD5dLFN/aUU9PjL3hLd 6ONSKThtaongQ6AvC0CnnlKZrry9cznKQhxuQ= MIME-Version: 1.0 Received: by 10.141.40.7 with SMTP id s7mr463234rvj.25.1257797947422; Mon, 09 Nov 2009 12:19:07 -0800 (PST) In-Reply-To: <20091109193743.GA25901@mike.de> References: <20091109193743.GA25901@mike.de> Date: Mon, 9 Nov 2009 23:19:07 +0300 Message-ID: Subject: Re: [ANN] LuaJIT-2.0.0-beta2 From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 9, 2009 at 22:37, Mike Pall wrote: > This is the second beta release of LuaJIT 2.0.0. It fixes many > bugs present in the initial release. Please upgrade! For the stats: beta2 builds and installs fine on my OS X. > The other major changes are reorganized Makefiles for POSIX (now > builds both static and shared libraries) and support for handling > C++ exceptions. Performance is unchanged over the initial release. > Please check the changelog for more details. Hurray! C++ support! Thanks, Mike! Alexander. From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:38:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9KcXqj003517; Mon, 9 Nov 2009 18:38:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3053218EC5; Mon, 9 Nov 2009 18:38:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4BA9F18D78 for ; Mon, 9 Nov 2009 18:37:56 -0200 (BRST) Received: by gxk26 with SMTP id 26so2443387gxk.1 for ; Mon, 09 Nov 2009 12:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=1cobTnoJXcalp9iJeVx9EMGHOGMBiY+CplwbjfSZeVk=; b=ZMZ73Dxd694CA20qPU75WOPYSued7Er2g1Ty3V+gId8yZ9PYIlr/TheorNvZ1YDCdu p7V6PdTDON13jCyiMG7FqLd8lf/bwxKG2gf5LHQCWXP7+3cECtWV/XK7wMBa9h1hMa26 OY6kTKy3/GjEn2oGD7PCF+6SFLeoMQAku25Vs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RLY/MB7TjpBCqt0WkgKVbY15WBISwUeWJELot7u1VBaCwhujOwo3jJj5kf3Jk18ooh F28MZvwpXN5UC+S9QnIANJk4o7UbuXz6Uf26Ys/OAK7LTyWQLjgUWNueCB3KlFItDJpR nFDD1VfNxrsYvEWAg72CTg8Lz+H9O6UXjrLY8= MIME-Version: 1.0 Received: by 10.101.183.22 with SMTP id k22mr6094503anp.107.1257799075369; Mon, 09 Nov 2009 12:37:55 -0800 (PST) In-Reply-To: References: <4AF839AF.9040201@spellingbeewinnars.org> Date: Mon, 9 Nov 2009 20:37:55 +0000 Message-ID: <379686bd0911091237w7f552a89y37c743b6c9886358@mail.gmail.com> Subject: Re: Whats does your Lua Stack look like? From: Ashish Shrestha To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean webapps: nginx -> xavante -> wsapi -> mercury -> lua app daemons: c -> lua also using tokyocabinet and looking into lua-haml for template i am still evaluating lua for webapp. haven't done any production work. ashish From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:42:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Kg78f004068; Mon, 9 Nov 2009 18:42:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C9641926D; Mon, 9 Nov 2009 18:41:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D95AC19183 for ; Mon, 9 Nov 2009 18:41:29 -0200 (BRST) Received: by bwz27 with SMTP id 27so3902568bwz.21 for ; Mon, 09 Nov 2009 12:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=mg/bSJ26ietLY29clHpMpLP/84p4+mJlQK4dJDjhV1k=; b=JZ3eHoAaa+iUTSby2ez6Ma+O0pNdDcm/98vdLZ1JWItJmJnHHQdUIyy7FW2GM0Xo6E PTuVlljJaPYd+aWEBBxO0rcY6fSWsdLpIMB/RYgPdjRwtQU14gfz+KiVpCZNAo7I6oen 8mERbOs5PEb656eNDM47Oc8+0Rxm4+1fK/qgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=qTs2BPpw+Ooola2mDCh7p1kVMUrGoQQGVpJ8L8S8MHFnBaU74LwdfMxMMc/dr5JDkB 6tqNkwsVLeKt/FPH8iHo4g1wDPORQoIaBAZCIh0TGiT/SOlIG9TSAnE9r/WtuIj1WHpx bPyXSwfa9an6/toLTYq7wEhzdtHFB/famPd4c= MIME-Version: 1.0 Received: by 10.223.143.68 with SMTP id t4mr1221304fau.20.1257799288233; Mon, 09 Nov 2009 12:41:28 -0800 (PST) In-Reply-To: References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> From: liam mail Date: Mon, 9 Nov 2009 20:41:08 +0000 Message-ID: <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> Subject: Re: Full userdata and metamethods (mail resent) To: Lua list Content-Type: multipart/alternative; boundary=0023545bd64cc6203c0477f63786 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0023545bd64cc6203c0477f63786 Content-Type: text/plain; charset=ISO-8859-1 2009/11/9 Duncan Cross > On Mon, Nov 9, 2009 at 7:40 PM, liam mail > wrote: > > > > > > 2009/11/9 Duncan Cross > >> > >> On Mon, Nov 9, 2009 at 7:22 PM, liam mail > >> wrote: > >> > I have come across something that I am unsure if it is expected > >> > behaviour or > >> > a bug and would like some help to identify which it is. > >> (...) > >> > int equal(lua_State* s) > >> > { > >> > Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) > >> > ); > >> > Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) > >> > ); > >> > lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); > >> > return 1; > >> > } > >> > >> I believe that the __eq metamethod (as well as the other comparison > >> metamethods) must return a boolean in order to work properly, so that > >> may be your problem. > >> > >> -Duncan > > > > Duncan even if that is the case it would not effect the fact that the > method > > is never called. I should also say it is not just the equality operator > that > > displays this behaviour. > > > > Okay, you're right, I've had a closer look at the code now and I think > the problem is that every time you use lua_pushcfunction(), this > creates a new, unique closure on the stack. This means that two > instances of the same C function pushed onto the stack will not be > equal to each other. Try instead using lua_pushcfunction() only once, > then lua_pushvalue() to get a copy of it. > > -Duncan > Duncan you are correct that in pushing the function twice they are not equal (checked using lua_rawequal which seems strange); yet pushing the function once then using push_value whilst they are raw equal as you would expect still does not call the function. --0023545bd64cc6203c0477f63786 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/11/9 Duncan Cross <duncan.cross@gmail.com&g= t;
On Mon, Nov 9, 2009 at 7:40 PM, liam mail= <liam.list@googlemail.com> wrote:
>
>
> 2009/11/9 Duncan Cross <
d= uncan.cross@gmail.com>
>>
>> On Mon, Nov 9, 2009 at 7:22 PM, liam mail <liam.list@googlemail.com>
>> wrote:
>> > I have come across something that I am unsure if it is expect= ed
>> > behaviour or
>> > a bug and would like some help to identify which it is.
>> (...)
>> > int equal(lua_State* s)
>> > {
>> > =A0=A0=A0 Int_wrapper* i1 =3D static_cast<Int_wrapper *>= ;( lua_touserdata(s, 1)
>> > );
>> > =A0=A0=A0 Int_wrapper* i2 =3D static_cast<Int_wrapper *>= ;( lua_touserdata(s, 2)
>> > );
>> > =A0=A0=A0 lua_pushinteger(s, i1->i =3D=3D i2->i ? 1 : 0= );
>> > =A0=A0=A0 return 1;
>> > }
>>
>> I believe that the __eq metamethod (as well as the other compariso= n
>> metamethods) must return a boolean in order to work properly, so t= hat
>> may be your problem.
>>
>> -Duncan
>
> Duncan even if that is the case it would not effect the fact that the = method
> is never called. I should also say it is not just the equality operato= r that
> displays this behaviour.
>

Okay, you're right, I've had a closer look at the code = now and I think
the problem is that every time you use lua_pushcfunction(), this
creates a new, unique closure on the stack. This means that two
instances of the same C function pushed onto the stack will not be
equal to each other. Try instead using lua_pushcfunction() only once,
then lua_pushvalue() to get a copy of it.

-Duncan
Duncan you are correct that in pushing the functi= on twice they are not equal (checked using=A0 lua_rawequal which seems stra= nge); yet pushing the function once then using push_value whilst they are r= aw equal as you would expect still does not call the function.
--0023545bd64cc6203c0477f63786-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:48:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9KmGFK005604; Mon, 9 Nov 2009 18:48:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55AD61928C; Mon, 9 Nov 2009 18:47:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7B4B19183 for ; Mon, 9 Nov 2009 18:47:44 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so878955eye.39 for ; Mon, 09 Nov 2009 12:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=oJfYG+CwiEVR7ZNirlm8nAPMIJ53WI358FCAxBHAcmM=; b=MArSYNX+ZmXvg+H/Dy73sg4ZqTiUZzOpXtr56Xg6Di0xkoNB1tgQfhIX0mHsfcPNIE oKdQEVCFRSuUe/dkWUUAXi+rJeBrXrB4RPEXkHDNYeYUwLWmCAKfGJEdaYuBPgNkuDpc GqJxRw1qIm3hyZtKw8vLsifT5A18NZQc7bsAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=TVOILKKvuauLCED08Ll1BJLlTpjuxPGzWEbk3kbR+c66IhjVEVBO5t89mB3l69DjBk FvAH+PnPZ+w+hWUCQhkQNgokLbuX4i4Bm8+CUZzT5xH09sJoysRM2wVGcOvOgmPp049c 0Glix33/VD44VmFTCqTid7FAelVovGjlF5Y1A= Received: by 10.213.57.80 with SMTP id b16mr3871011ebh.36.1257799659319; Mon, 09 Nov 2009 12:47:39 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 23sm139033eya.44.2009.11.09.12.47.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 12:47:38 -0800 (PST) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Whats does your Lua Stack look like? Date: Mon, 9 Nov 2009 21:47:06 +0100 References: <4AF839AF.9040201@spellingbeewinnars.org> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 9, 2009, at 4:47 PM, Patrick wrote: > my web stack (tcpserver) + HTTP.lua + My App [1] http://cr.yp.to/ucspi-tcp/tcpserver.html [2] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua [3] http://svr225.stepx.com:3388/nanoki From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 18:49:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9Knt5e005845; Mon, 9 Nov 2009 18:49:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6365E19297; Mon, 9 Nov 2009 18:49:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29C741924D for ; Mon, 9 Nov 2009 18:49:29 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so1547281fgb.17 for ; Mon, 09 Nov 2009 12:49:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=86vM5GAmaCjeoFf+CQjbR9gZ3Z0h98BBaByjqwdOd6k=; b=ctVqMPkIKtbeI5UcVlg7zmUm4ypxm4sq6Jy8NOyEpcoWUPRU9xa/jciqZSWh2CKLHo 6eGvcdBvr07uhia5FtVkrcCuhcQpIICjlPBqchNdnz5rXPbLgkvGEuSVVQfH/qhntHL8 k1mL1/8TXOTQNm0q+sGDJG3x2BhwG6SW0+tW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ARDVJUUWCRm6Y2xwSmkzXAs4Wux5RWLCtRQbP9eURJk8yBAMy8JCjU10aVRRIRQmL7 v0USfWeS7Rb1V+IbB/g0Y17d5s1Mq83qkc72giDGR5Vb6cMoTSJZi/sZwALCY/YHse0F UbtDfRMaNFN9/ojkkObbsdgYcuGw6eAYUb0i0= MIME-Version: 1.0 Received: by 10.223.4.216 with SMTP id 24mr1222008fas.67.1257799768542; Mon, 09 Nov 2009 12:49:28 -0800 (PST) In-Reply-To: <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> Date: Mon, 9 Nov 2009 20:49:28 +0000 Message-ID: Subject: Re: Full userdata and metamethods (mail resent) From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9Knt5e005845 On Mon, Nov 9, 2009 at 8:41 PM, liam mail wrote: > Duncan you are correct that in pushing the function twice they are not equal > (checked using  lua_rawequal which seems strange); yet pushing the function > once then using push_value whilst they are raw equal as you would expect > still does not call the function. My final observation in the code is another boolean/number problem right at the end, when you get the result: > int result = lua_tointeger(s,-1); ...this should be lua_toboolean() instead. lua_tointeger() will return 0 for either boolean value. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 19:02:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9L2m4Z007761; Mon, 9 Nov 2009 19:02:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D79B1924D; Mon, 9 Nov 2009 19:02:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBD331911E for ; Mon, 9 Nov 2009 19:02:12 -0200 (BRST) Received: by bwz27 with SMTP id 27so3924006bwz.21 for ; Mon, 09 Nov 2009 13:02:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=geppFwZl/rFG2VBM7Fzy2510iyJHco+hFE/ah1Bupls=; b=yCVsV7NDLQbLD6cTDnzg5TmAWfa3PQpXd1HyAf0h3JMADNF2FbMd//yxBWjDY85kdG F8kgB86rGt/kk673/ElBhX1tBhl6xKrZEijEVguqtw6NKbcLbt8DjXSt7hkhZdLiSzTk vvW9hNmcNXjGXjWVicyq1JDjquMei1dbsrU5k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=bYMdGKor+ltKRlawjHmL0zCwVv+vXajJ5HkpfUjwiSbQg0HF12CcZz4V6ps8HFv6Gn P9BqTJOlC98sfgt2MPZ4HdVs+4H6AvVkFCePJ2FcUX5bd7gyZLvPYtLvqcNo+Jgf/gds b0/5MfsAmxEdtv2BYXUzqoTAoVLbIBbwbeIs0= MIME-Version: 1.0 Received: by 10.223.22.133 with SMTP id n5mr1288128fab.16.1257800530139; Mon, 09 Nov 2009 13:02:10 -0800 (PST) In-Reply-To: References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> From: liam mail Date: Mon, 9 Nov 2009 21:01:50 +0000 Message-ID: <173d86e00911091301h48f2ed01gb944831a8c68f65f@mail.gmail.com> Subject: Re: Full userdata and metamethods (mail resent) To: Lua list Content-Type: multipart/alternative; boundary=001517476042cc1ad60477f68174 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001517476042cc1ad60477f68174 Content-Type: text/plain; charset=ISO-8859-1 2009/11/9 Duncan Cross > On Mon, Nov 9, 2009 at 8:41 PM, liam mail > wrote: > > Duncan you are correct that in pushing the function twice they are not > equal > > (checked using lua_rawequal which seems strange); yet pushing the > function > > once then using push_value whilst they are raw equal as you would expect > > still does not call the function. > > My final observation in the code is another boolean/number problem > right at the end, when you get the result: > > > int result = lua_tointeger(s,-1); > > ...this should be lua_toboolean() instead. lua_tointeger() will return > 0 for either boolean value. > > -Duncan > Yes another good catch, unfortunately the code I posted was to verify the result I was seeing using binding code which was pushing and pulling booleans. I feel this would not stop the function being called yet have adjusted the code and will inline it below for fullness. struct Int_wrapper{int i;}; int equal(lua_State* s) { Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) ); Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) ); lua_pushboolean(s, i1->i == i2->i ? 1 : 0 ); return 1; } void equal_userdataWithDifferentMetatables_returnsTrue() { lua_State* s = luaL_newstate(); std::string chunk("equal = function (lhs, rhs) \ return lhs == rhs \ end"); luaL_loadbuffer(s,chunk.c_str(),chunk.size(),"userChunk"); lua_pcall(s,0,LUA_MULTRET,0); lua_getfield(s, LUA_GLOBALSINDEX, "equal"); luaL_newmetatable(s, "mt1"); int mt1 = lua_gettop(s); luaL_newmetatable(s, "mt2"); int mt2 = lua_gettop(s); lua_pushcfunction(s, &equal); int func = lua_gettop(s); lua_pushliteral(s, "__eq"); lua_pushvalue(s,func); lua_settable(s, mt1); lua_pushliteral(s, "__eq"); lua_pushvalue(s,func); lua_settable(s, mt2); lua_remove(s,func); Int_wrapper* wrapper1 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w1 = lua_gettop(*m_lua); lua_pushvalue(*m_lua,mt1); lua_setmetatable(*m_lua,w1); Int_wrapper* wrapper2 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w2 = lua_gettop(s); lua_pushvalue(s,mt2); lua_setmetatable(s,w2); wrapper1->i = wrapper2->i = 1; lua_remove(s,mt1); lua_remove(s,mt2-1); lua_pcall(s,2,LUA_MULTRET,0); bool result = lua_toboolean(s,-1); CPPUNIT_ASSERT_EQUAL(true,result); lua_close(s); } --001517476042cc1ad60477f68174 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/11/9 Duncan Cross <duncan.cross@gmail.com&g= t;
On Mon, Nov 9, 2009 at 8:41 PM, liam mail <liam.list@googlemail.com> wrote: > Duncan you are correct that in pushing the function twice they are not= equal
> (checked using=A0 lua_rawequal which seems strange); yet pushing the f= unction
> once then using push_value whilst they are raw equal as you would expe= ct
> still does not call the function.

My final observation in the code is another boolean/number problem right at the end, when you get the result:

> =A0 =A0 =A0 =A0int result =3D lua_tointeger(s,-1);

...this should be lua_toboolean() instead. lua_tointeger() will retur= n
0 for either boolean value.

-Duncan
=A0Yes another good catch, unfortunately the code= I posted was to verify the result I was seeing using binding code which wa= s pushing and pulling booleans. I feel this would not stop the function bei= ng called yet have adjusted the code and will inline it below for fullness.=

struct Int_wrapper{int i;};

int equal(lua_State* s)
{
=A0= =A0=A0 Int_wrapper* i1 =3D static_cast<Int_wrapper *>( lua_touserdata= (s, 1) );
=A0=A0=A0 Int_wrapper* i2 =3D static_cast<Int_wrapper *>= ( lua_touserdata(s, 2) );
=A0=A0=A0 lua_pushboolean(s, i1->i =3D=3D i2->i ? 1 : 0 );
=A0=A0= =A0 return 1;
}
=A0=A0=A0 void equal_userdataWithDifferentMetatables_= returnsTrue()
=A0=A0=A0 {
=A0=A0=A0 =A0=A0=A0 lua_State* s =3D luaL_n= ewstate();
=A0=A0=A0 =A0=A0=A0 std::string chunk("equal =3D functio= n (lhs, rhs) \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 return lhs = =3D=3D rhs \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0= =A0 end");
=A0=A0=A0 =A0=A0=A0 luaL_loadbuffer(s,chunk.c_str(),chu= nk.size(),"userChunk");
=A0=A0=A0 =A0=A0=A0 lua_pcall(s,0,LUA_= MULTRET,0);
=A0=A0=A0 =A0=A0=A0 lua_getfield(s, LUA_GLOBALSINDEX, "= equal");

=A0=A0=A0 =A0=A0=A0 luaL_newmetatable(s, "mt1");
=A0=A0=A0= =A0=A0=A0 int mt1 =3D lua_gettop(s);
=A0=A0=A0 =A0=A0=A0 luaL_newmetata= ble(s, "mt2");
=A0=A0=A0 =A0=A0=A0 int mt2 =3D lua_gettop(s);<= br>

=A0=A0=A0 =A0=A0=A0 lua_pushcfunction(s, &equal);
=A0=A0=A0 =A0=A0=A0 int func =3D lua_gettop(s);

=A0=A0=A0 =A0=A0=A0 = lua_pushliteral(s, "__eq");
=A0=A0=A0 =A0=A0=A0 lua_pushvalue(= s,func);
=A0=A0=A0 =A0=A0=A0 lua_settable(s, mt1);

=A0=A0=A0 =A0= =A0=A0 lua_pushliteral(s, "__eq");
=A0=A0=A0 =A0=A0=A0 lua_pus= hvalue(s,func);
=A0=A0=A0 =A0=A0=A0 lua_settable(s, mt2);
=A0=A0=A0 =A0=A0=A0 lua_remove= (s,func);

=A0=A0=A0 =A0=A0=A0 Int_wrapper* wrapper1 =3D static_cast&= lt;Int_wrapper*>(lua_newuserdata(s, sizeof(Int_wrapper)));
=A0=A0=A0 = =A0=A0=A0 int w1 =3D lua_gettop(*m_lua);
=A0=A0=A0 =A0=A0=A0 lua_pushval= ue(*m_lua,mt1);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(*m_lua,w1);

=A0=A0=A0 =A0=A0=A0= Int_wrapper* wrapper2 =3D static_cast<Int_wrapper*>(lua_newuserdata(= s, sizeof(Int_wrapper)));
=A0=A0=A0 =A0=A0=A0 int w2 =3D lua_gettop(s);<= br>=A0=A0=A0 =A0=A0=A0 lua_pushvalue(s,mt2);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(s,w2);

=A0=A0=A0 =A0=A0=A0 wrap= per1->i =3D wrapper2->i =3D 1;
=A0=A0=A0 =A0=A0=A0 lua_remove(s,mt= 1);
=A0=A0=A0 =A0=A0=A0 lua_remove(s,mt2-1);

=A0=A0=A0 =A0=A0=A0 = lua_pcall(s,2,LUA_MULTRET,0);
=A0=A0=A0 =A0=A0=A0 bool result =3D lua_to= boolean(s,-1);
=A0=A0=A0 =A0=A0=A0 CPPUNIT_ASSERT_EQUAL(true,result);
=A0=A0=A0 =A0=A0= =A0 lua_close(s);
=A0=A0=A0 }
--001517476042cc1ad60477f68174-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 19:09:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9L9lXc009014; Mon, 9 Nov 2009 19:09:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6F7E1929F; Mon, 9 Nov 2009 19:09:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BEC701911E for ; Mon, 9 Nov 2009 19:09:14 -0200 (BRST) Received: by fxm21 with SMTP id 21so513212fxm.21 for ; Mon, 09 Nov 2009 13:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=Yeej5Vu53OGi70gD/f0yvFCZsMT6wH2KkcDOyKSPJuQ=; b=KXSYqTYAS1wrhA7AEUQ57aTCnx+3V3nsONOGHgqx76zLcxJH+qfR1/mejhOrBwAsg5 dFsptpK6yNIhWY2wmYFEPWEoGSUfjasDKptTpyC/kGiuRuqK+BV68VmSG+9Pg4D4FM62 vMomdbgtNTxttxggip94ZmgLzIvt5DjK3iF3w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=XtthesiuyHLCLaOmDYXVq+0yp/RozPR21THge8cqiLa2BunpH8d0lT+1bRfJTkUPAa n8JCDIOQLazR8zUe+SnikgtOjvxOGKyVKCSFRcN4JbMweRapn1IUaeIFHHwTBnlUY5Xg 58MBhlC+NCqSu07zpUdZCyrslPeZNqkcYtmaI= MIME-Version: 1.0 Received: by 10.223.4.27 with SMTP id 27mr372543fap.48.1257630704740; Sat, 07 Nov 2009 13:51:44 -0800 (PST) From: liam mail Date: Sat, 7 Nov 2009 21:51:24 +0000 Message-ID: <173d86e00911071351i7172ede4saed3865c44ba2710@mail.gmail.com> Subject: Full userdata and metamethods To: Lua list Content-Type: multipart/alternative; boundary=0015174484746a29780477cef709 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174484746a29780477cef709 Content-Type: text/plain; charset=ISO-8859-1 I have come across something that I am unsure if it is expected behaviour or a bug and would like some help to identify which it is. Without going into too much detail I am trying to use the metamethod "__eq" using two full userdata types which both have different metatables yet the same metamethod. According to what I have reread in Programming in Lua and the Reference Manual this should work and does so for tables yet not userdata. Here is the Lua code for tables: mt1 = {} mt2 = {} equal = function (lhs, rhs) return lhs.i == rhs.i end mt1["__eq"] = equal mt2["__eq"] = equal t1 = {} setmetatable(t1,mt1) t2 = {} setmetatable(t2,mt2) t1.i = 1 t2.i = 1 assert(t1 == t2) As you can see it is two tables with different metables yet with the same metamethod which according to the Reference Manual would work. http://www.lua.org/manual/5.1/manual.html#2.8 When I try a similar thing with full userdata instead of tables the method is not called and it returns false, yet I feel it should not. Here is example C++ code for that, (forgive me it takes a bit more code to do this): First the userdata structure and the method struct Int_wrapper{int i;}; int equal(lua_State* s) { Int_wrapper* i1 = static_cast( lua_touserdata(s, 1) ); Int_wrapper* i2 = static_cast( lua_touserdata(s, 2) ); lua_pushinteger(s, i1->i == i2->i ? 1 : 0 ); return 1; } lua_State* s = luaL_newstate(); std::string chunk("equal = function (lhs, rhs) \ return lhs == rhs \ end"); luaL_loadbuffer(s,chunk.c_str(),chunk.size(),"userChunk"); lua_pcall(s,0,LUA_MULTRET,0); lua_getfield(s, LUA_GLOBALSINDEX, "equal"); luaL_newmetatable(s, "mt1"); int mt1 = lua_gettop(s); luaL_newmetatable(s, "mt2"); int mt2 = lua_gettop(s); lua_pushliteral(s, "__eq"); lua_pushcfunction(s, &equal); lua_settable(s, mt1); lua_pushliteral(s, "__eq"); lua_pushcfunction(s, &equal); lua_settable(s, mt2); Int_wrapper* wrapper1 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w1 = lua_gettop(*m_lua); lua_pushvalue(*m_lua,mt1); lua_setmetatable(*m_lua,w1); Int_wrapper* wrapper2 = static_cast(lua_newuserdata(s, sizeof(Int_wrapper))); int w2 = lua_gettop(s); lua_pushvalue(s,mt2); lua_setmetatable(s,w2); wrapper1->i = wrapper2->i = 1; lua_remove(s,mt1); lua_remove(s,mt1); lua_pcall(s,2,LUA_MULTRET,0); int result = lua_tointeger(s,-1); CPPUNIT_ASSERT_EQUAL(1,result); lua_close(s); Could some confirm that this should or should not work, if it should not could you please explain why? Thanks --0015174484746a29780477cef709 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have come across something that I am unsure if it is expected behaviour o= r a bug and would like some help to identify which it is.
Without going = into too much detail I am trying to use the metamethod "__eq" usi= ng two full userdata types which both have different metatables yet the sam= e metamethod. According to what I have reread in Programming in Lua and the= Reference Manual this should work and does so for tables yet not userdata.=
Here is the Lua code for tables:
mt1 =3D {}
mt2 =3D {}

equal = =3D function (lhs, rhs)
return lhs.i =3D=3D rhs.i
end

mt1[&quo= t;__eq"] =3D equal
mt2["__eq"] =3D equal
t1 =3D {}setmetatable(t1,mt1)
t2 =3D {}
setmetatable(t2,mt2)
t1.i =3D 1
t2.i =3D 1
assert(t1 = =3D=3D t2)

As you can see it is two tables with different metables y= et with the same metamethod which according to the Reference Manual would w= ork.
http://www.lua.or= g/manual/5.1/manual.html#2.8

When I try a similar thing with ful= l userdata instead of tables the method is not called and it returns false,= yet I feel it should not. Here is example C++ code for that, (forgive me i= t takes a bit more code to do this):
First the userdata structure and the method

struct Int_wrapper{int i= ;};

int equal(lua_State* s)
{
=A0=A0=A0 Int_wrapper* i1 =3D st= atic_cast<Int_wrapper *>( lua_touserdata(s, 1) );
=A0=A0=A0 Int_wr= apper* i2 =3D static_cast<Int_wrapper *>( lua_touserdata(s, 2) );
=A0=A0=A0 lua_pushinteger(s, i1->i =3D=3D i2->i ? 1 : 0 );
=A0=A0= =A0 return 1;
}

=A0=A0=A0 =A0=A0=A0 lua_State* s =3D luaL_newstat= e();
=A0=A0=A0 =A0=A0=A0 std::string chunk("equal =3D function (lhs= , rhs) \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0= return lhs =3D=3D rhs \
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 end");=
=A0=A0=A0 =A0=A0=A0 luaL_loadbuffer(s,chunk.c_str(),chunk.size(),"= userChunk");
=A0=A0=A0 =A0=A0=A0 lua_pcall(s,0,LUA_MULTRET,0);
= =A0=A0=A0 =A0=A0=A0 lua_getfield(s, LUA_GLOBALSINDEX, "equal");
=A0=A0=A0 =A0=A0=A0 luaL_newmetatable(s, "mt1");
=A0=A0=A0= =A0=A0=A0 int mt1 =3D lua_gettop(s);
=A0=A0=A0 =A0=A0=A0 luaL_newmetata= ble(s, "mt2");
=A0=A0=A0 =A0=A0=A0 int mt2 =3D lua_gettop(s);<= br>
=A0=A0=A0 =A0=A0=A0 lua_pushliteral(s, "__eq");
=A0=A0=A0 =A0=A0=A0 lua_pushcfunction(s, &equal);
=A0=A0=A0 =A0=A0= =A0 lua_settable(s, mt1);

=A0=A0=A0 =A0=A0=A0 lua_pushliteral(s, &qu= ot;__eq");
=A0=A0=A0 =A0=A0=A0 lua_pushcfunction(s, &equal);=A0=A0=A0 =A0=A0=A0 lua_settable(s, mt2);

=A0=A0=A0 =A0=A0=A0 Int_w= rapper* wrapper1 =3D static_cast<Int_wrapper*>(lua_newuserdata(s, siz= eof(Int_wrapper)));
=A0=A0=A0 =A0=A0=A0 int w1 =3D lua_gettop(*m_lua);
=A0=A0=A0 =A0=A0=A0 l= ua_pushvalue(*m_lua,mt1);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(*m_lua,w1= );

=A0=A0=A0 =A0=A0=A0 Int_wrapper* wrapper2 =3D static_cast<Int_= wrapper*>(lua_newuserdata(s, sizeof(Int_wrapper)));
=A0=A0=A0 =A0=A0=A0 int w2 =3D lua_gettop(s);
=A0=A0=A0 =A0=A0=A0 lua_pu= shvalue(s,mt2);
=A0=A0=A0 =A0=A0=A0 lua_setmetatable(s,w2);

=A0= =A0=A0 =A0=A0=A0 wrapper1->i =3D wrapper2->i =3D 1;
=A0=A0=A0 =A0= =A0=A0 lua_remove(s,mt1);
=A0=A0=A0 =A0=A0=A0 lua_remove(s,mt1);

= =A0=A0=A0 =A0=A0=A0 lua_pcall(s,2,LUA_MULTRET,0);
=A0=A0=A0 =A0=A0=A0 int result =3D lua_tointeger(s,-1);
=A0=A0=A0 =A0=A0= =A0 CPPUNIT_ASSERT_EQUAL(1,result);
=A0=A0=A0 =A0=A0=A0 lua_close(s);

Could some confirm that this should or should not work, if it shou= ld not could you please explain why?
Thanks
--0015174484746a29780477cef709-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 19:24:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9LOrun011098; Mon, 9 Nov 2009 19:24:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D886E19183; Mon, 9 Nov 2009 19:24:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26CB21911E for ; Mon, 9 Nov 2009 19:24:15 -0200 (BRST) Received: by fxm21 with SMTP id 21so523202fxm.21 for ; Mon, 09 Nov 2009 13:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bfwRY8KX67E+caFfv852DN58+trTu1kKbZlGLC2HfHk=; b=khYonwWcbv3UoZ6CnnzCSsR38hSDPVQpKXWWpmitglFY24fc6NC5oPISg0NNN+4UXf PMuRyDLAW9+QoPhVn6q/uVQMuiARNx97rRya9rTHs2EjASPQH+KrY2Rx4GAfCMHJVUy6 CoYs+xjhRbNWCp3imfn2RPkuVvhFNFPbGLExM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AwvV+4TLbc810rXvD96gzs/9Jq4+xEi67rqV2gQ+LWqagW+no6TnFpDub44a9sN2uQ A0ZsR7BIn0C+HX2Lrwi7R+ad4miOznk00TW0DZjxQMw0ZzZd7PHHrVhOQzC2145Qqd3v Jhd96JTiVI/a5KHcUTPuMFXQ07Ak9u0jlUA+E= MIME-Version: 1.0 Received: by 10.223.16.72 with SMTP id n8mr1262635faa.26.1257801852705; Mon, 09 Nov 2009 13:24:12 -0800 (PST) In-Reply-To: <173d86e00911091301h48f2ed01gb944831a8c68f65f@mail.gmail.com> References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> <173d86e00911091301h48f2ed01gb944831a8c68f65f@mail.gmail.com> Date: Mon, 9 Nov 2009 21:24:12 +0000 Message-ID: Subject: Re: Full userdata and metamethods (mail resent) From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nA9LOrun011098 On Mon, Nov 9, 2009 at 9:01 PM, liam mail wrote: > 2009/11/9 Duncan Cross >> On Mon, Nov 9, 2009 at 8:41 PM, liam mail >> wrote: >> > Duncan you are correct that in pushing the function twice they are not >> > equal >> > (checked using  lua_rawequal which seems strange); yet pushing the >> > function >> > once then using push_value whilst they are raw equal as you would expect >> > still does not call the function. >> >> My final observation in the code is another boolean/number problem >> right at the end, when you get the result: >> >> >        int result = lua_tointeger(s,-1); >> >> ...this should be lua_toboolean() instead. lua_tointeger() will return >> 0 for either boolean value. >> >> -Duncan > >  Yes another good catch, unfortunately the code I posted was to verify the > result I was seeing using binding code which was pushing and pulling > booleans. I feel this would not stop the function being called yet have > adjusted the code and will inline it below for fullness. Okay, I have finally tried actually *running* the code :) In three lines you refer to '*m_lua', instead of 's'. I changed these and it seems to work for me. -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 9 19:32:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nA9LW5AW012048; Mon, 9 Nov 2009 19:32:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 27C6F191C8; Mon, 9 Nov 2009 19:31:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2E6F19027 for ; Mon, 9 Nov 2009 19:31:34 -0200 (BRST) Received: by bwz27 with SMTP id 27so3953341bwz.21 for ; Mon, 09 Nov 2009 13:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Z4RSCWfvEyI8hJEf5Q5G/FR4Ia5foLRENFf3zzf6G+Q=; b=mUSaPm1Hyjr+ctT7S6CqyGOBi3on6ycqQO9Bh6fH0LNcR7eh/6N1F2wLfBjlrtEljm //pUSwqv/HF5xEBQElM5xpl6RERc8AlaP4SoCr7ckMR4BtNbM+1uPrRYplgty1ejRBTy Ir+ddnV/ueHHFIHyJrjlAHlhbaWhq9ge0dnY4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=JpYBajFrqBshmFCDr6psGZEPYvxGKCJR4UY17BTBlOI2gvHyR+DwZzsFIJx8kS1emO DArr1cvojJVA5fn4gu0ghUa//1RvI90vFu8fPd7zeVV9U9qTkTaQF6CWeG+YuV5eRapV JSluutB0mNX+kOOrJlzJck5nhSRfRtsynmX7Y= MIME-Version: 1.0 Received: by 10.223.16.216 with SMTP id p24mr1259263faa.35.1257802293127; Mon, 09 Nov 2009 13:31:33 -0800 (PST) In-Reply-To: References: <173d86e00911091122x71525f0cxb0859a246ab3b268@mail.gmail.com> <173d86e00911091140m3cd21dc5w8a4a3e71b35636d4@mail.gmail.com> <173d86e00911091241xa62c0bfgafbe39b7e783e728@mail.gmail.com> <173d86e00911091301h48f2ed01gb944831a8c68f65f@mail.gmail.com> From: liam mail Date: Mon, 9 Nov 2009 21:31:13 +0000 Message-ID: <173d86e00911091331h5d666693v3e71376747b52ed5@mail.gmail.com> Subject: Re: Full userdata and metamethods (mail resent) To: Lua list Content-Type: multipart/alternative; boundary=00151747965ae12b7f0477f6ea16 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00151747965ae12b7f0477f6ea16 Content-Type: text/plain; charset=ISO-8859-1 2009/11/9 Duncan Cross > On Mon, Nov 9, 2009 at 9:01 PM, liam mail > wrote: > > 2009/11/9 Duncan Cross > >> On Mon, Nov 9, 2009 at 8:41 PM, liam mail > >> wrote: > >> > Duncan you are correct that in pushing the function twice they are not > >> > equal > >> > (checked using lua_rawequal which seems strange); yet pushing the > >> > function > >> > once then using push_value whilst they are raw equal as you would > expect > >> > still does not call the function. > >> > >> My final observation in the code is another boolean/number problem > >> right at the end, when you get the result: > >> > >> > int result = lua_tointeger(s,-1); > >> > >> ...this should be lua_toboolean() instead. lua_tointeger() will return > >> 0 for either boolean value. > >> > >> -Duncan > > > > Yes another good catch, unfortunately the code I posted was to verify > the > > result I was seeing using binding code which was pushing and pulling > > booleans. I feel this would not stop the function being called yet have > > adjusted the code and will inline it below for fullness. > > Okay, I have finally tried actually *running* the code :) In three > lines you refer to '*m_lua', instead of 's'. I changed these and it > seems to work for me. > > -Duncan > :) Thank you Duncan for your time and most certainly the original bug was due to different closures. For the record m_lua is a member of the Unit Test which I adapted to post to the list, so I tried to create a full example fo the code and therefore created the instance of lua_State inside the function and ignoring the setup method which creates m_lua. I hang my head in shame :) --00151747965ae12b7f0477f6ea16 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/11/9 Duncan Cross <duncan.cross@gmail.com&g= t;
On Mon, Nov 9, 2009 at 9:01 PM, liam mail <liam.list@googlemail.com> wrote: > 2009/11/9 Duncan Cross <d= uncan.cross@gmail.com>
>> On Mon, Nov 9, 2009 at 8:41 PM, liam mail <liam.list@googlemail.com>
>> wrote:
>> > Duncan you are correct that in pushing the function twice the= y are not
>> > equal
>> > (checked using=A0 lua_rawequal which seems strange); yet push= ing the
>> > function
>> > once then using push_value whilst they are raw equal as you w= ould expect
>> > still does not call the function.
>>
>> My final observation in the code is another boolean/number problem=
>> right at the end, when you get the result:
>>
>> > =A0 =A0 =A0 =A0int result =3D lua_tointeger(s,-1);
>>
>> ...this should be lua_toboolean() instead. lua_tointeger() will re= turn
>> 0 for either boolean value.
>>
>> -Duncan
>
> =A0Yes another good catch, unfortunately the code I posted was to veri= fy the
> result I was seeing using binding code which was pushing and pulling > booleans. I feel this would not stop the function being called yet hav= e
> adjusted the code and will inline it below for fullness.

Okay, I have finally tried actually *running* the code :) In three lines you refer to '*m_lua', instead of 's'. I changed thes= e and it
seems to work for me.

-Duncan
:)
Thank you Duncan for = your time and most certainly the original bug was due to different closures= .
For the record m_lua is a member of the Unit Test which I adapted to p= ost to the list, so I tried to create a full example fo the code and theref= ore created the instance of lua_State inside the function and ignoring the = setup method which creates m_lua.
I hang my head in shame :)

--00151747965ae12b7f0477f6ea16-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 00:34:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA2YHD0018468; Tue, 10 Nov 2009 00:34:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 029DD18FC9; Tue, 10 Nov 2009 00:33:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA93418C83 for ; Tue, 10 Nov 2009 00:33:43 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 6E93DBF16F for ; Mon, 9 Nov 2009 21:33:31 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 09 Nov 2009 21:33:31 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=/u78Bxn8RUZqkSWPuhDpvSuBurM=; b=cFnvOtKu90qvz/c07GZo3U8wKtoPT8P0XC/DVzt3Yjft8xN0UMFQd8bBlB6vEjou8MWJkgUvlU7cjdvEQT4RrGESewJc4IPhcSH9rC733EwCS8EeZieEtq4EZhUpAZvMMCpF5duUrdzx25jFSPZ1PAVA9adNPLyPZkvWhXsq2gQ= X-Sasl-enc: pCLLwo7qpxVZwkKweK8JIkuPbtKivnINvAR/TElAKcRm 1257820410 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 5C85D4AA8C2 for ; Mon, 9 Nov 2009 21:33:30 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta2 From: Geoff Leyland In-Reply-To: <20091109193743.GA25901@mike.de> Date: Tue, 10 Nov 2009 15:32:56 +1300 Content-Transfer-Encoding: 7bit Message-Id: <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> References: <20091109193743.GA25901@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/11/2009, at 8:37 AM, Mike Pall wrote: > This is the second beta release of LuaJIT 2.0.0. It fixes many > bugs present in the initial release. Please upgrade! Anything I've done wrong? $ uname -v Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 $ make ==== Building LuaJIT 2.0.0-beta2 ==== make -C src ... BUILDVM ../lib/vmdef.lua DYNLINK libluajit.so ld: in lj_vm.o, ObjectFileAddressSpace::getEncodedP() encoding 0x00000005 not supported collect2: ld returned 1 exit status make[1]: *** [libluajit.so] Error 1 make: *** [default] Error 2 The actual command line used for DYNLINK was gcc -m32 -march=i686 -dynamiclib -single_module -undefined dynamic_lookup -fPIC -o libluajit.so lj_vm.o lj_gc.o lj_err.o lj_ctype.o lj_bc.o lj_obj.o lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_state.o lj_dispatch.o lj_vmevent.o lj_api.o lj_lex.o lj_parse.o lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o lj_opt_dce.o lj_opt_loop.o lj_mcode.o lj_snap.o lj_record.o lj_asm.o lj_trace.o lj_gdbjit.o lj_lib.o lj_alloc.o lib_aux.o lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_init.o -lm From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 01:07:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA37b3c021752; Tue, 10 Nov 2009 01:07:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D266B192A8; Tue, 10 Nov 2009 01:07:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41DC8191DC for ; Tue, 10 Nov 2009 01:07:06 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7h4R-0007J6-00; Tue, 10 Nov 2009 04:07:03 +0100 Date: Tue, 10 Nov 2009 04:06:06 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta2 Message-ID: <20091110030606.GA5217@mike.de> References: <20091109193743.GA25901@mike.de> <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Geoff Leyland wrote: > Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; > root:xnu-1456.1.25~1/RELEASE_I386 Oops, that must be Snow Leopard? Sorry, but most of my changes for OSX are guesswork, because I don't have an OSX machine. > ld: in lj_vm.o, ObjectFileAddressSpace::getEncodedP() encoding > 0x00000005 not supported Looks like something is wrong with the MACH-O/DWARF2 frame unwind info. That would explain why it gets ignored. :-| Since I really can't debug this, just disabling it would probably help. Please try the attached patch. --Mike --bp/iNruPH9dso1Pn Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="beta2_snow_leopard.patch" --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc @@ -3649,7 +3649,7 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.align 4\n" ".LEFDE1:\n\n", (int)ctx->codesz); break; - case BUILD_machasm: + case BUILD_machasm+9999: /* NYI: OSX ignores it. Something must be missing. */ fprintf(ctx->fp, "\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n"); fprintf(ctx->fp, --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h @@ -1680,7 +1680,7 @@ "\t.align 4\n" ".LEFDE1:\n\n", (int)ctx->codesz); break; - case BUILD_machasm: + case BUILD_machasm+9999: /* NYI: OSX ignores it. Something must be missing. */ fprintf(ctx->fp, "\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n"); fprintf(ctx->fp, --bp/iNruPH9dso1Pn-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 01:16:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA3GBHg023018; Tue, 10 Nov 2009 01:16:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 19C57192B3; Tue, 10 Nov 2009 01:15:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-qy0-f184.google.com (mail-qy0-f184.google.com [209.85.221.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBDE919286 for ; Tue, 10 Nov 2009 01:15:46 -0200 (BRST) Received: by qyk14 with SMTP id 14so1514157qyk.11 for ; Mon, 09 Nov 2009 19:15:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=yes6IhE4aFAXysG1Wzv64gyyVM1BUo765g8KJXk63cE=; b=h/AC4YN80spoeb/Iv/HJncsKIjDjwADi/bZRWPWUeaFg0b0Mw6PM8aOkr/CTtLj02f rDp164UkT0l21NxBai1xgSpxmSmq5URTgnJt1npt0rvBpLqnu14qTXOB7Cr/Vacf5upl 1PY1vdWcFgtd30D7yUBKBgy4gHy7sbFx6rvDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=THZWgMVNfInmolAC8/ezYgUgLuTD4XDZfK+cDIMLu78z39diY/Ur0+DqtrVSHUWQF8 SlvQhwGnEAsnPR69HLYzzBdfug/I1WOMbGfLAnCSP163RK4U21/mJ/OP6ODnmgM02rp5 BwiUTbNEEP5wSr0L/J5j3+TtO/XNJh5cGTRPc= Received: by 10.224.96.77 with SMTP id g13mr4564851qan.305.1257822945297; Mon, 09 Nov 2009 19:15:45 -0800 (PST) Received: from ?192.168.0.101? ([75.68.47.100]) by mx.google.com with ESMTPS id 22sm207068qyk.10.2009.11.09.19.15.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 19:15:44 -0800 (PST) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta2 From: Doug Currie In-Reply-To: <20091110030606.GA5217@mike.de> Date: Mon, 9 Nov 2009 22:15:41 -0500 Content-Transfer-Encoding: 7bit Message-Id: <4146068D-E207-44F6-BAD7-1B1C19FB4659@gmail.com> References: <20091109193743.GA25901@mike.de> <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> <20091110030606.GA5217@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 9, 2009, at 10:06 PM, Mike Pall wrote: > Please try the attached patch. > That fixes the build on Snow Leopard for me. e From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 01:26:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA3QAt0023944; Tue, 10 Nov 2009 01:26:10 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2E523192C1; Tue, 10 Nov 2009 01:25:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4B3719297 for ; Tue, 10 Nov 2009 01:25:45 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 4F21BBF25A for ; Mon, 9 Nov 2009 22:25:44 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 09 Nov 2009 22:25:44 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=5E772SXkkUWzn0dxTNpXciCKrUM=; b=s6G/a9UKPwC1lzRVN/x4/Z9pnbcVXN/VOHeDiARhUcPctvGHOuDvXEGrV6q5Lx/1T/x7Wu20rlb9in9mr55W8mmcq6BkwkflwGDwkn5mW1XKN+xp2h67TtvXSmZG6nihcukxQgQ925uhthVn0Jajd+OPVjP1N0YVMAd+IWjLskE= X-Sasl-enc: Opu3irp0l2sUO/gc/JrQfJnc7tqeVUfLtgwBC34GPEfN 1257823543 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6F9464AA921 for ; Mon, 9 Nov 2009 22:25:43 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta2 From: Geoff Leyland In-Reply-To: <20091110030606.GA5217@mike.de> Date: Tue, 10 Nov 2009 16:25:09 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091109193743.GA25901@mike.de> <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> <20091110030606.GA5217@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/11/2009, at 4:06 PM, Mike Pall wrote: > Geoff Leyland wrote: >> Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; >> root:xnu-1456.1.25~1/RELEASE_I386 > > Oops, that must be Snow Leopard? Yep! > Looks like something is wrong with the MACH-O/DWARF2 frame unwind > info. That would explain why it gets ignored. :-| > > Since I really can't debug this, just disabling it would probably > help. Please try the attached patch. Fixed, thanks. The heap test runs. If it's of interest, the _x86.h part of the patch was at a different line: $ patch -p1 --dry-run < beta2_snow_leopard.patch patching file src/buildvm_x86.dasc patching file src/buildvm_x86.h Hunk #1 succeeded at 5165 (offset 3485 lines). From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 01:30:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA3UsLb024421; Tue, 10 Nov 2009 01:30:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C33D9192CF; Tue, 10 Nov 2009 01:30:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E1CC1929D for ; Tue, 10 Nov 2009 01:30:26 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7hR3-0007NZ-00; Tue, 10 Nov 2009 04:30:25 +0100 Date: Tue, 10 Nov 2009 04:30:20 +0100 From: Mike Pall To: Lua list Subject: Re: [ANN] LuaJIT-2.0.0-beta2 Message-ID: <20091110033020.GA7696@mike.de> References: <20091109193743.GA25901@mike.de> <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> <20091110030606.GA5217@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > $ patch -p1 --dry-run < beta2_snow_leopard.patch > patching file src/buildvm_x86.dasc > patching file src/buildvm_x86.h > Hunk #1 succeeded at 5165 (offset 3485 lines). That file (as shipped) doesn't have that many lines. Apparently you've modified the *.dasc and have been rebuilding it? Doesn't matter though for the patch. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 01:36:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA3aqge024961; Tue, 10 Nov 2009 01:36:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8A38F192C4; Tue, 10 Nov 2009 01:36:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 41F1F192A8 for ; Tue, 10 Nov 2009 01:36:27 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 17541BF25A for ; Mon, 9 Nov 2009 22:36:26 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 09 Nov 2009 22:36:26 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=wh1zFTXi520C6zNkSklCZiitnI0=; b=kAmhu5hYQB0ZWeqpDMVj0wEn2udl9N6U60AMzIPAIcXmJDZ1eeNRdMLXW0sHZ7utZbTZlVRTFZrucdewo1rn9mzhK9XsHCKkw4TvvJSwNIOLLOlubaWRsQr2W/cvPCMip/GxPJFmkUOOE4sPxDUlrhU4yyhpNS1ItOuUkApMyKg= X-Sasl-enc: wSUVq/n0mCCb6xIOnzFCPPdAGBiG2mHC1RyWYWd41HXP 1257824185 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 36AF74AA94F for ; Mon, 9 Nov 2009 22:36:24 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: [ANN] LuaJIT-2.0.0-beta2 From: Geoff Leyland In-Reply-To: <20091110033020.GA7696@mike.de> Date: Tue, 10 Nov 2009 16:35:52 +1300 Content-Transfer-Encoding: 7bit Message-Id: References: <20091109193743.GA25901@mike.de> <15D061A5-9759-456E-9670-077F8645BA19@fastmail.fm> <20091110030606.GA5217@mike.de> <20091110033020.GA7696@mike.de> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/11/2009, at 4:30 PM, Mike Pall wrote: > Geoff Leyland wrote: >> $ patch -p1 --dry-run < beta2_snow_leopard.patch >> patching file src/buildvm_x86.dasc >> patching file src/buildvm_x86.h >> Hunk #1 succeeded at 5165 (offset 3485 lines). > > That file (as shipped) doesn't have that many lines. Apparently > you've modified the *.dasc and have been rebuilding it? Doesn't > matter though for the patch. Not that I'm aware of, but I'm sure it's not a big deal. It applied cleanly on the other machine. Maybe it was because I did a "make cleaner"? No need to reply, because it all works now. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 05:47:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA7l2w9017959; Tue, 10 Nov 2009 05:47:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 615A5192A8; Tue, 10 Nov 2009 05:46:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F9F21928C for ; Tue, 10 Nov 2009 05:46:26 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7lQm-0007aW-00; Tue, 10 Nov 2009 08:46:24 +0100 Date: Tue, 10 Nov 2009 08:41:03 +0100 From: Mike Pall To: Lua list Subject: Mandatory patch for OSX (was [ANN] LuaJIT-2.0.0-beta2) Message-ID: <20091110074103.GA10321@mike.de> References: <20091109193743.GA25901@mike.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've attached a revised patch to fix LuaJIT-2.0.0-beta2 for OSX. The zero-cost, automatic C++ exception catching now works on OSX, too. In case anyone has applied the previous patch, it needs to be backed out first (or start from the original beta2 sources). --Mike --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="beta2_snow_leopard.patch" --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc @@ -3650,7 +3650,6 @@ ".LEFDE1:\n\n", (int)ctx->codesz); break; case BUILD_machasm: - /* NYI: OSX ignores it. Something must be missing. */ fprintf(ctx->fp, "\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n"); fprintf(ctx->fp, "EH_frame1:\n" @@ -3659,7 +3658,7 @@ "LSCIE1:\n" "\t.long 0\n" "\t.byte 0x1\n" - "\t.ascii \"zPR\"\n" + "\t.ascii \"zPR\\0\"\n" "\t.byte 0x1\n" "\t.byte 128-4\n" "\t.byte 0x8\n" --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h @@ -1681,7 +1681,6 @@ ".LEFDE1:\n\n", (int)ctx->codesz); break; case BUILD_machasm: - /* NYI: OSX ignores it. Something must be missing. */ fprintf(ctx->fp, "\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n"); fprintf(ctx->fp, "EH_frame1:\n" @@ -1690,7 +1689,7 @@ "LSCIE1:\n" "\t.long 0\n" "\t.byte 0x1\n" - "\t.ascii \"zPR\"\n" + "\t.ascii \"zPR\\0\"\n" "\t.byte 0x1\n" "\t.byte 128-4\n" "\t.byte 0x8\n" --+HP7ph2BbKc20aGI-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 05:52:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA7qKAA018461; Tue, 10 Nov 2009 05:52:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D1E72192D8; Tue, 10 Nov 2009 05:52:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc1-s32.bay0.hotmail.com (bay0-omc1-s32.bay0.hotmail.com [65.54.246.104]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7C1E1929D for ; Tue, 10 Nov 2009 05:51:59 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc1-s32.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Nov 2009 23:51:57 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Tue, 10 Nov 2009 07:51:56 +0000 Message-ID: <4AF91B8D.10808@my.erau.edu> Date: Tue, 10 Nov 2009 02:51:41 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: LuaJIT2 - Performance Expectancies X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Nov 2009 07:51:57.0399 (UTC) FILETIME=[AD6F2E70:01CA61DA] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello all, I've been watching LuaJIT for a while now and decided to try integrating it with a 3D application I'm working on. Because a significant amount of work is done with Lua (and Lua code is called on every frame), I thought there might be a noticeable improvement by replacing Lua 5.1.4 with LuaJIT 2. Unfortunately, this required a fully automated build across several platforms using CMake, so I had to essentially rewrite LuaJIT's makefile in CMake format and consider the (notably minor, but important) differences between platforms. Because I've never used LuaJIT before, I'm pretty willing to admit I'll have likely screwed something up there. That being said, it compiles properly and runs like a charm. Unfortunately, I don't see much difference, if any. In fact, I can execute jit.off() in our configuration file and I don't see a change in FPS at all. In fact, the only way I could tell that it is in fact using LuaJIT was the one time that I replaced the LuaJIT DLL with the official Lua DLL, I started getting errors due to "jit" being a nil value. Interestingly enough, after fixing this problem, it seemed even the official Lua distribution was on par with LuaJIT. What I'm trying to get at is that I think that we /should/ be getting a decent performance improvement, but aren't. Does anyone have a suggestion on how I might be able to investigate what LuaJIT is doing in hopes of tuning its performance (or, more likely, fixing something I'm just plain doing wrong)? Because it's not a standalone application, it seems I can't use the "-jv" option. Any pointers would be most appreciated, Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:01:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA81767019409; Tue, 10 Nov 2009 06:01:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EFEF192EA; Tue, 10 Nov 2009 06:00:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E9DF192B1 for ; Tue, 10 Nov 2009 06:00:40 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 05A5EBED6C for ; Tue, 10 Nov 2009 03:00:39 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 10 Nov 2009 03:00:39 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=9WWGJbcgGBaqNnsrnZluPlhb4yQ=; b=TyNKgR5hWHY4nql0C6oJ3F3ISn9JDTlqdr9yJfgbFPm+7Z+sV3wpckdAxaDpm5/KbvRqUnTWYGEk/lLiXp4FPTW4qeoftXxCGZ5vFs902BiS5l1PuVe3Pgi8kkZnLXOHLSk8syqr0DmDH12tJLFff/WvzEtFn32BvB/NnTll0/c= X-Sasl-enc: OEfTEc0qIBfQTOkwML5PmVBsd+tsrhY1ZREXmZ1yQnbg 1257840038 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id 304D84AAA90 for ; Tue, 10 Nov 2009 03:00:37 -0500 (EST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: LuaJIT2 - Performance Expectancies From: Geoff Leyland In-Reply-To: <4AF91B8D.10808@my.erau.edu> Date: Tue, 10 Nov 2009 21:00:03 +1300 Content-Transfer-Encoding: 7bit Message-Id: <8E1C30E4-1ABB-49B8-BF72-8E17770E3619@fastmail.fm> References: <4AF91B8D.10808@my.erau.edu> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/11/2009, at 8:51 PM, Matthew P. Del Buono wrote: > Hello all, > > I've been watching LuaJIT for a while now and decided to try > integrating > it with a 3D application I'm working on. Because a significant > amount of > work is done with Lua (and Lua code is called on every frame), I > thought > there might be a noticeable improvement by replacing Lua 5.1.4 with > LuaJIT 2. What fraction of the total run time or time per frame is spent in Lua? Could plain Lua be quicker than you think? Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:01:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA81mku019516; Tue, 10 Nov 2009 06:01:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D73A518C30; Tue, 10 Nov 2009 06:01:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2098918A02 for ; Tue, 10 Nov 2009 06:01:11 -0200 (BRST) Received: by pwi3 with SMTP id 3so1151113pwi.21 for ; Tue, 10 Nov 2009 00:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=zZsOkCLegYfLidwxTSHRWzubicdDxkdxUbGWwW19h1g=; b=uFA7rfgt6cQ1EgDu17cW/Fh7XSI7n0Z29vGyyRQNw0yD6dBdd1LKzWimuEXwMSa1nj fJdPVeOBa45Wa2DpLMdKYUsHSrMcOl3ELbjX44eiqXeexMjLZzUeyMTiwjPpfD26Lyh1 Lo9zuWU9OV1uiQ5VbFTHDHKbNm6ZOo0XvRMgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=nHle107Isr2cYo2YajvfzoJxinsn1TkHUw5hUjyoOvR7PCFgiB012X1I7dtKwd6aoG FYyq3B9a7AC7OlXjHyArIGQLreH2Y/homAq49IOd7Sj4494GJ2m6rS0BZYW2J4gaaJof uWx26NUdvofOwNecw6/JnqBXvXOzTbJd0vD1Y= MIME-Version: 1.0 Received: by 10.140.199.10 with SMTP id w10mr512685rvf.205.1257840070044; Tue, 10 Nov 2009 00:01:10 -0800 (PST) Date: Tue, 10 Nov 2009 11:01:10 +0300 Message-ID: Subject: LuaJIT 2 vs. C modules built for Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAA81mku019516 Hi, list! This looks like a silly question, and I feel that it should be documented somewhere, but anyway: Can LJ2 be used with C modules, linked with Lua (on Linux / OS X platforms)? My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH and have its own environment variable. Looks like practice says "yes" — what I've tried worked. But this is strange. What am I missing? What are the consequences? What if modules are accidentally compiled as 64-bit code? Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:10:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8A8Zr020369; Tue, 10 Nov 2009 06:10:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C10119306; Tue, 10 Nov 2009 06:09:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 81B1218A02 for ; Tue, 10 Nov 2009 06:09:43 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id C3BEBBEFB6 for ; Tue, 10 Nov 2009 03:09:42 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 10 Nov 2009 03:09:42 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=content-type:mime-version:subject:from:in-reply-to:date:content-transfer-encoding:message-id:references:to; s=smtpout; bh=VOZ2v6QMD55lXKKYRJf3lCmoutA=; b=X00GByhj0wisRuwsY0+EYsQSNOofRwo1rHdf7VJXULP8vR7QrkBdqrc98LGZTBa0CtHmZBv87qtIPJnrvu1hFOA2iKKO61g74K/b+Xo6+3g/BHQBx8q1EOhXcICt1w6tiM9hUkCwGkyyAtWzIY7leeGSJg2pY4b+RlIVQmvmF9w= X-Sasl-enc: X1Mf09g9p/xojNumGtbojjm6B3zTVCPKEJhSimTiuivO 1257840581 Received: from [10.1.1.3] (unknown [222.155.245.147]) by mail.messagingengine.com (Postfix) with ESMTPSA id A30CA4AAA98 for ; Tue, 10 Nov 2009 03:09:41 -0500 (EST) Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: LuaJIT 2 vs. C modules built for Lua From: Geoff Leyland In-Reply-To: Date: Tue, 10 Nov 2009 21:09:08 +1300 Message-Id: References: To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAA8A8Zr020369 On 10/11/2009, at 9:01 PM, Alexander Gladysh wrote: > Hi, list! > > This looks like a silly question, and I feel that it should be > documented somewhere, but anyway: > > Can LJ2 be used with C modules, linked with Lua (on Linux / OS X > platforms)? Yes, it works for me. The API is the same. > My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH > and have its own environment variable. I use the exact same modules from the same path for lua and luajit. > Looks like practice says "yes" — what I've tried worked. But this is > strange. What am I missing? What are the consequences? What if modules > are accidentally compiled as 64-bit code? (I think you mentioned earlier you were on OS X?) Since snow leopard, upgrading macports and LJ2 I keep tripping over 32/64 bit issues. I *think* I've got it fixed now - lua and all my modules are built as fat binaries for both 32 and 64 bit. LJ2 is 32 bit. I assume Lua uses the 64 bit half of the binary and LJ2 the 32 bit half. The last hiccup I had was that up until a couple of weeks ago, macports failed to build lua +universal as a universal binary, and I needed to do a "macport selfupdate" to get the fix. Using "lipo - info" to check that you actually got fat binaries is a very good idea. Cheers, Geoff From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:10:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8AsIe020460; Tue, 10 Nov 2009 06:10:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B6C919318; Tue, 10 Nov 2009 06:10:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc2-s32.bay0.hotmail.com (bay0-omc2-s32.bay0.hotmail.com [65.54.246.168]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C617719315 for ; Tue, 10 Nov 2009 06:10:33 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc2-s32.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Nov 2009 00:10:28 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Tue, 10 Nov 2009 08:10:27 +0000 Message-ID: <4AF91FE3.7070107@my.erau.edu> Date: Tue, 10 Nov 2009 03:10:11 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies References: <4AF91B8D.10808@my.erau.edu> <8E1C30E4-1ABB-49B8-BF72-8E17770E3619@fastmail.fm> In-Reply-To: <8E1C30E4-1ABB-49B8-BF72-8E17770E3619@fastmail.fm> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Nov 2009 08:10:28.0098 (UTC) FILETIME=[43766620:01CA61DD] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Geoff Leyland wrote: > > What fraction of the total run time or time per frame is spent in > Lua? Could plain Lua be quicker than you think? > > Cheers, > Geoff In an attempt to evaluate this condition, I had already run the following code in the rendering loop (i.e., every frame): for x=1, 1000 do font:print(x) end Which pulled the framerate down to about 10 fps (extremely below what we're currently experiencing), so we know the majority of the time is being spent in that loop. However, your statement led me to re-evaluate the loop in consideration that the majority of the work might be during the actual drawing code, instead of the Lua code (that should be fairly obvious, actually, and I feel pretty sheepish for not thinking of that originally). After adding the following code into the rendering loop: for x = 1, 10000000 do end I can see the difference as 20 FPS with JIT off and nearly 200 FPS with JIT on, so it's definitely working. I guess the other tests I made simply do not have enough time in Lua. This is not surprising, as we're still in early stages, so it will be interesting to see how it plays out in the long run. Thanks for convincing me to re-evaluate my tests :) ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:12:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8CaEu020676; Tue, 10 Nov 2009 06:12:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE37819322; Tue, 10 Nov 2009 06:12:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CFF0719319 for ; Tue, 10 Nov 2009 06:12:13 -0200 (BRST) Received: by fxm21 with SMTP id 21so741434fxm.21 for ; Tue, 10 Nov 2009 00:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=nn+QfP6fOuCZT05K4aTN6QwP7UD45JkfwkfpnDEvgx4=; b=HW8qPaiCXhHAbZrOyt+9IAD4B7C5t8O3Fjg/afa+TapLiWBDJ7c+UzlEFsytt98fTS wUzplUkopQVNixQpiVNBsmccQ886uRfKNiofetvK3s22nss3t2M2qxeMgUPtiPeMW9I0 KVYw+3wejVkw8O4Bs4yY1KgwGSZqVVXay1uLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=W4MK3tHI0+sGyQ/u/gOTqBAU9laLZ2LIfGr/R5qRLGslDFjGecIbQMK8DZbP4ZcviB JozfeGIvebndOIy0T/VRDjq2oLc48g5GVKLEYKxpqyStD10HLhes49eQDyHuKQmBBk8Y rsVa+Zb1tkWA0Lk7KoX0sFsXlbmjjwR/zN4NI= Received: by 10.204.155.73 with SMTP id r9mr2586131bkw.14.1257840731060; Tue, 10 Nov 2009 00:12:11 -0800 (PST) Received: from ?95.78.67.157? ([95.78.67.157]) by mx.google.com with ESMTPS id 14sm132929fxm.15.2009.11.10.00.12.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Nov 2009 00:12:10 -0800 (PST) Date: Tue, 10 Nov 2009 11:11:56 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <143614189.20091110111156@gmail.com> To: "Matthew P. Del Buono" Subject: Re: LuaJIT2 - Performance Expectancies In-Reply-To: <4AF91B8D.10808@my.erau.edu> References: <4AF91B8D.10808@my.erau.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Matthew, Tuesday, November 10, 2009, 10:51:41 AM, you wrote: > What I'm trying to get at is that I think that we /should/ be getting a > decent performance improvement, but aren't. Does anyone have a afair, Make said that if you have short Lua code called repeatedly from C, it may remain uncompiled. you need to have entire loop written in Lua in order to allow LJ to find best ways to optimize it. OTOH, even LJ interpreter should be much faster than standard one. so th first question - how much time you spend in Lua? may be it's anyway fraction of second? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:15:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8FaBD021013; Tue, 10 Nov 2009 06:15:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF1D919327; Tue, 10 Nov 2009 06:15:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CA0E1931E for ; Tue, 10 Nov 2009 06:15:15 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7lsg-0007bp-00; Tue, 10 Nov 2009 09:15:14 +0100 Date: Tue, 10 Nov 2009 09:15:07 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies Message-ID: <20091110081507.GA11131@mike.de> References: <4AF91B8D.10808@my.erau.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF91B8D.10808@my.erau.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew P. Del Buono wrote: > Unfortunately, this required a fully automated build across several > platforms using CMake, so I had to essentially rewrite LuaJIT's makefile > in CMake format and consider the (notably minor, but important) > differences between platforms. Because I've never used LuaJIT before, > I'm pretty willing to admit I'll have likely screwed something up there. Wouldn't it be easier to build LuaJIT separately and then add it as a link dependency to the project? > That being said, it compiles properly and runs like a charm. > Unfortunately, I don't see much difference, if any. Obviously then your bottleneck is not in the Lua code itself. If you only spend (say) 5% of the CPU time in Lua code and LuaJIT would give you a speedup of (say) 5x, then you'd get a 4% speed difference at best. This is probably within the noise level of a complex application. Oh, BTW, a common pitfall other people supposedly have fallen into before (ahemm): make sure your app doesn't sync to a fixed frame rate or some subdivisor of it. Because then you'll never be able to tell a difference in the FPS. ;-) > What I'm trying to get at is that I think that we /should/ be getting a > decent performance improvement, but aren't. Does anyone have a > suggestion on how I might be able to investigate what LuaJIT is doing in > hopes of tuning its performance (or, more likely, fixing something I'm > just plain doing wrong)? Profile your whole application and find out where it spends most of its CPU time. If it's not inside Lua, then there's no point in spending time on improving its performance. > Because it's not a standalone application, it seems I can't use > the "-jv" option. I bet you can. Just redirect it to a file: require("jit.v").start("dump.txt") --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:25:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8PYaR022499; Tue, 10 Nov 2009 06:25:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F3BC2192DF; Tue, 10 Nov 2009 06:25:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCAB0192AE for ; Tue, 10 Nov 2009 06:25:05 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7m2B-0007cm-00; Tue, 10 Nov 2009 09:25:03 +0100 Date: Tue, 10 Nov 2009 09:24:57 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 vs. C modules built for Lua Message-ID: <20091110082457.GB11131@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > This looks like a silly question, and I feel that it should be > documented somewhere, but anyway: > > Can LJ2 be used with C modules, linked with Lua (on Linux / OS X platforms)? The very first section in http://luajit.org/luajit.html says: Compatibility LuaJIT implements the full set of language features defined by Lua 5.1. The virtual machine (VM) is API- and ABI-compatible to the standard Lua interpreter and can be deployed as a drop-in replacement. The 'B' in "ABI-compatible" means binary module compatibility. > My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH > and have its own environment variable. Alas, your intuition is wrong. It's deliberately using the same module paths. > Looks like practice says "yes" — what I've tried worked. But this is > strange. What am I missing? What are the consequences? What if modules > are accidentally compiled as 64-bit code? This is not specific to LuaJIT. The 32/64 bit issues are going to hurt you with a mixed 32 bit/64 bit Lua installation, too: lua64: error loading module 'test' from file './test.so': ./test.so: wrong ELF class: ELFCLASS32 --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:36:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8anJ5023969; Tue, 10 Nov 2009 06:36:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB826192B1; Tue, 10 Nov 2009 06:36:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f194.google.com (mail-px0-f194.google.com [209.85.216.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6C541914C for ; Tue, 10 Nov 2009 06:36:23 -0200 (BRST) Received: by pxi32 with SMTP id 32so2610817pxi.15 for ; Tue, 10 Nov 2009 00:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2USof14nSobgMY6SrEk9yZY0Ukymv9o5nuN/cmdsCls=; b=nGFmdKvl782duRmdYKZvsPDdMyD5aN3YZDZgO34ZNQoXtXDhj/nELpMxPmaMtZkofO Z4BcBT0GKPTA9Gx9creHFi48bQ+njC+LLjEvzndHooq4mpSYBwf2mcbUUkXBEPeqZ5fA qNabmDT0xk43nZ6z9WrZiMOmW2B0Nsf/E2hy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WKLO3krXE3nyEwwSBf3ZO5HQ/H6CzDC78CW9kUU2aWz1EoZrP5h2OdIAH4imeY1DPF YCPvSD9E8lCMdiwASREe0EZDZ+mUix2bWhqTzImk77jo0chhk3O9uIHvnvdqkEH6qNYJ AKTlUsFtcagAHualrPtKnQ4VfZHoxNE2thVNU= MIME-Version: 1.0 Received: by 10.141.188.1 with SMTP id q1mr491732rvp.2.1257842181255; Tue, 10 Nov 2009 00:36:21 -0800 (PST) In-Reply-To: <20091110082457.GB11131@mike.de> References: <20091110082457.GB11131@mike.de> Date: Tue, 10 Nov 2009 11:36:21 +0300 Message-ID: Subject: Re: LuaJIT 2 vs. C modules built for Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAA8anJ5023969 > Alexander Gladysh wrote: >> This looks like a silly question, and I feel that it should be >> documented somewhere, but anyway: >> Can LJ2 be used with C modules, linked with Lua (on Linux / OS X platforms)? > The very first section in http://luajit.org/luajit.html says: >  Compatibility >  LuaJIT implements the full set of language features defined by >  Lua 5.1. The virtual machine (VM) is API- and ABI-compatible to >  the standard Lua interpreter and can be deployed as a drop-in >  replacement. > The 'B' in "ABI-compatible" means binary module compatibility. Sorry, I've missed that one :-) >> My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH >> and have its own environment variable. > Alas, your intuition is wrong. That happens often. :-) > It's deliberately using the same module paths. Good news. So, no need to recompile any of my Lua modules? (32/64-bit issue aside.) I feel that this question may be worth adding to the LuaJIT FAQ. :-) >> Looks like practice says "yes" — what I've tried worked. But this is >> strange. What am I missing? What are the consequences? >> What if modules are accidentally compiled as 64-bit code? > This is not specific to LuaJIT. Indeed. > The 32/64 bit issues are going to > hurt you with a mixed 32 bit/64 bit Lua installation, too: > lua64: error loading module 'test' from file './test.so': >        ./test.so: wrong ELF class: ELFCLASS32 I see that this is not specific to LuaJIT, but I still have a question: Any standard way to workaround this issue on 64-bit Linux? I need to keep both Lua and LuaJIT working. I think that LuaRocks compiles Lua modules into 64-bits. It seems that I have to keep *manually* two separate module trees, and to change LUA_CPATH before I launch Lua or LuaJIT. Is there a better solution? Thank you, Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:42:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8gQpS024510; Tue, 10 Nov 2009 06:42:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D10B19303; Tue, 10 Nov 2009 06:42:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s65.bay0.hotmail.com (bay0-omc3-s65.bay0.hotmail.com [65.54.246.224]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F9D81914C for ; Tue, 10 Nov 2009 06:42:00 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s65.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Nov 2009 00:41:53 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Tue, 10 Nov 2009 08:41:53 +0000 Message-ID: <4AF92742.4030104@my.erau.edu> Date: Tue, 10 Nov 2009 03:41:38 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies References: <4AF91B8D.10808@my.erau.edu> <20091110081507.GA11131@mike.de> In-Reply-To: <20091110081507.GA11131@mike.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Nov 2009 08:41:53.0798 (UTC) FILETIME=[A76D6260:01CA61E1] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Matthew P. Del Buono wrote: >> Unfortunately, this required a fully automated build across several >> platforms using CMake, so I had to essentially rewrite LuaJIT's makefile >> in CMake format and consider the (notably minor, but important) >> differences between platforms. Because I've never used LuaJIT before, >> I'm pretty willing to admit I'll have likely screwed something up there. > > Wouldn't it be easier to build LuaJIT separately and then add it > as a link dependency to the project? > For me, it would be easier. For everyone else, well, let's just say there's no reason for them to put the effort in right now, so fully automating the process makes the buy-in process much easier. > Oh, BTW, a common pitfall other people supposedly have fallen into > before (ahemm): make sure your app doesn't sync to a fixed frame > rate or some subdivisor of it. Because then you'll never be able > to tell a difference in the FPS. ;-) > Actually, we're actively investigating this possibility, because we're seeing framerates in excess of 2000 on Linux, and 200 and under on Windows (without exaggeration in the difference). We're convinced there's something capping the rate somewhere, we just haven't been able to find out where yet. But that's a topic for another time and place :) > Profile your whole application and find out where it spends most > of its CPU time. If it's not inside Lua, then there's no point in > spending time on improving its performance. This is actually an interesting point. I had actually profiled the application before deciding to make this move and it was a driving factor in making the switch: Lua functions were frequently on the top of the hot spots list. I re-ran the profile and noticed a drop on the Lua side, but LuaJIT still comes up on top on percentage CPU time: lj_BC_TGETS = 13.81 (LuaJIT) Main::mainLoop = 8.95 (Application) lj_str_new = 7.17 (LuaJIT) _RTC_CheckStackVars = 6.15 (VC Debug Check) Grid::render = 5.00 (Application) A rule of thumb I follow is that when you start hitting _RTC_CheckStackVars (a debug analysis function added in by Visual Studio), you are going too far in analyzing performance. To compare, numbers I was getting before showed Lua having about 8 of the top 10 functions on CPU time. While LuaJIT still comes out on top, it is much better blended in with the application, which bodes well for what we plan to do with Lua in the near future (which will be a lot more Lua and a lot less C++). Thanks for reminding me to re-check the profile. > >> Because it's not a standalone application, it seems I can't use >> the "-jv" option. > > I bet you can. Just redirect it to a file: > > require("jit.v").start("dump.txt") > Very nice, thanks :) ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:44:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8i0jQ024711; Tue, 10 Nov 2009 06:44:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5963A19315; Tue, 10 Nov 2009 06:43:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D27A719289 for ; Tue, 10 Nov 2009 06:43:38 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7mK9-0007eC-00; Tue, 10 Nov 2009 09:43:37 +0100 Date: Tue, 10 Nov 2009 09:43:33 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 vs. C modules built for Lua Message-ID: <20091110084333.GA12856@mike.de> References: <20091110082457.GB11131@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Alexander Gladysh wrote: > Any standard way to workaround this issue on 64-bit Linux? I need to > keep both Lua and LuaJIT working. You could use 32 bit Lua, too, even on 64 bit. > I think that LuaRocks compiles Lua modules into 64-bits. I bet this can be changed with something as simple as adding -m32 to the compiler and linker lines. > It seems that I have to keep *manually* two separate module trees, and > to change LUA_CPATH before I launch Lua or LuaJIT. Is there a better > solution? You could install either one into a different tree and change the compiled-in module path. With LuaJIT that's pretty easy: make clean make PREFIX=/opt/lj2 make install PREFIX=/opt/lj2 Then the binary modules end up in /opt/lj2/lib/lua/5.1. You could symlink the Lua module path together, i.e.: rmdir /opt/lj2/share/lua/5.1 ln -s /usr/local/share/lua/5.1 /opt/lj2/share/lua/5.1 You don't need (or should) set LUA_CPATH then. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:49:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8nRGt025263; Tue, 10 Nov 2009 06:49:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D996019322; Tue, 10 Nov 2009 06:49:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C20719306 for ; Tue, 10 Nov 2009 06:48:56 -0200 (BRST) Received: by pzk34 with SMTP id 34so2752553pzk.11 for ; Tue, 10 Nov 2009 00:48:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=EQx5RNuYWejhRCpPLcq17473AD2sunroZqAH9ZqrQ1U=; b=V5z90fIQWsx9lSDplqCY3pxsrr6Su6chiacK2q+MsW/ZM2OU3EO25kcw/ixD2sOnmd morZVGzZq338+9KS97G+Ce+VZisAXzM/jU4hdMbRONxTqu+fx7px1DZAmbQm2XQ4UrBG HIBQ5cVyQyBlRLHvuEb8fU9ytkGhZ2ypBSoiM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RgL55mD1+5FCM4G8oKhQ9StMEPQBlMDL+TVTZm4pbIZwfJeXYH0YBuYN7ym2665dzY jPdHjjDW1zmkPhFrOHZ//rfvdzjb4ot+dr8i1B1KDWTPoQBEtEj6WuuNywlYmNaeupzO M/0poYCkpd0t20a02Alvv8EYrnY4torH+y5bY= MIME-Version: 1.0 Received: by 10.140.208.20 with SMTP id f20mr527214rvg.126.1257842935399; Tue, 10 Nov 2009 00:48:55 -0800 (PST) In-Reply-To: <20091110084333.GA12856@mike.de> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> Date: Tue, 10 Nov 2009 11:48:55 +0300 Message-ID: Subject: Re: LuaJIT 2 vs. C modules built for Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAA8nRGt025263 >> Any standard way to workaround this issue on 64-bit Linux? I need to >> keep both Lua and LuaJIT working. > You could use 32 bit Lua, too, even on 64 bit. Yes, this would suit me. >> I think that LuaRocks compiles Lua modules into 64-bits. > I bet this can be changed with something as simple as adding -m32 > to the compiler and linker lines. If I'm to go that way, I need LuaRocks to do this automatically for any module without me remembering this. I hope it has an option to do this somewhere. Time to dig into the docs. :-) >> It seems that I have to keep *manually* two separate module trees, and >> to change LUA_CPATH before I launch Lua or LuaJIT. Is there a better >> solution? > You could install either one into a different tree and change the > compiled-in module path. With LuaJIT that's pretty easy: >  make clean >  make PREFIX=/opt/lj2 >  make install PREFIX=/opt/lj2 > Then the binary modules end up in /opt/lj2/lib/lua/5.1. You could > symlink the Lua module path together, i.e.: >  rmdir /opt/lj2/share/lua/5.1 >  ln -s /usr/local/share/lua/5.1 /opt/lj2/share/lua/5.1 > You don't need (or should) set LUA_CPATH then. Thanks, this looks like what I need. Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:58:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8w8tQ026040; Tue, 10 Nov 2009 06:58:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F33719329; Tue, 10 Nov 2009 06:57:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp21.orange.fr (smtp21.orange.fr [80.12.242.46]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E9A4019317 for ; Tue, 10 Nov 2009 06:57:39 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2103.orange.fr (SMTP Server) with ESMTP id CD04920000A4 for ; Tue, 10 Nov 2009 09:57:33 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2103.orange.fr (SMTP Server) with ESMTP id C0ECE20000B2 for ; Tue, 10 Nov 2009 09:57:33 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2103.orange.fr (SMTP Server) with ESMTP id 63D3020000A4 for ; Tue, 10 Nov 2009 09:57:31 +0100 (CET) X-ME-UUID: 20091110085731408.63D3020000A4@mwinf2103.orange.fr Date: Tue, 10 Nov 2009 09:57:30 +0100 From: spir To: *lua Subject: table output Message-ID: <20091110095730.72815afb@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, Is there any builtin way to output table content? Couldn't find in docs, maybe I'm blind... Also, I would enjoy some clues about the reasoning for tostring(t) not doing that by default (and print(t) not writing that). Probably getting the memory address is useful in specific occasions, so there should certainly be a method for this in library "table". But the table content is certainly what we need in most cases, esp. during developpment/testing/debug phases, so that this should be the easiest output to get. Or am I missing something If the answer to the first question is "no", then take this post as a feature request for the "table" library. Actually, I guess 2 table output formats may be wished (called below "view" and "treeview); and matching pseudo-print funcs to avoid the burden of writing eg: print(myTable:view()) but instead directly: myTable.show() Below a (superficially tested) example of what I mean. (The func names don't pretend to be best.) Still, I guess the default output for a table should be a (flat) view of its content. Even if big (the programmer knows it). ======================================================= -- table output -- basic tools --- require "coroutine"--, "debug", "file", "io", "math", "string", require "table" require "os" ; exit=os.exit p=print stringmult = function(s, n) local ss = "" for i=1,n do ss = ss..s end return ss end --- a table to hold output funcs --- T = { -- view separators -- LS:line sep -- IS:item sep -- KS=key sep LS = '\n', IS = " ", KS = ":", -- default indentation string indent = " ", view = function(t) local index, item_view, item_views, items_view item_views = {} ; index = 0 for key,item in pairs(t) do index = index + 1 -- case table: recursion if type(item) == "table" then item_view = key..T.KS..T.view(item) -- else: simple view else item_view = key..T.KS..tostring(item) end item_views[index] = item_view end items_view = table.concat(item_views, T.IS) return "{"..items_view.."}" end, show = function(t) print(T.view(t)) end, treeview = function(t, level, indent) local index, item_view, item_views, items_view, offset, IS -- indentation offset -- item sep level = level or 1 indent = indent or T.indent offset = stringmult(indent,level) IS = T.LS..offset -- item views item_views = {} ; index = 0 for key,item in pairs(t) do index = index + 1 -- case table: recursion if type(item) == "table" then item_view = key..T.KS..T.treeview(item, level+1, indent) -- else: simple view else item_view = key..T.KS..tostring(item) end item_views[index] = item_view end items_view = IS..table.concat(item_views, IS) header = level==1 and "table:" or "" return header..items_view end, showtree = function(t) print(T.treeview(t)) end, test = function() circle = {radius=9, position={x=3,y=2,z=1}, color={r=33,g=99,b=66}, code={1,{2,3}}, drawfunc=function() print("foo") end} print ("=== test table:") print (" ".."circle = {radius=9, position={x=3,y=2,z=1}, color={r=33,g=99,b=66}, code={1,{2,3}}, drawfunc=Function() print('foo') end)}") print () T.show(circle) T.showtree(circle) end, } --- test --- T.test() ======================================================= Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 06:59:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA8xrX9026252; Tue, 10 Nov 2009 06:59:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3225F19344; Tue, 10 Nov 2009 06:59:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DA2819330 for ; Tue, 10 Nov 2009 06:59:34 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7mZZ-0007f2-00; Tue, 10 Nov 2009 09:59:33 +0100 Date: Tue, 10 Nov 2009 09:58:47 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies Message-ID: <20091110085847.GB12856@mike.de> References: <4AF91B8D.10808@my.erau.edu> <20091110081507.GA11131@mike.de> <4AF92742.4030104@my.erau.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF92742.4030104@my.erau.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew P. Del Buono wrote: > lj_BC_TGETS = 13.81 (LuaJIT) That's a field or method access in the interpreter, i.e. obj.field or obj:method. Interesting that this makes it to the top. > lj_str_new = 7.17 (LuaJIT) Umm, you're creating or hashing a lot of strings there? If it's from Lua, then check for string.sub or the concat operator (..). If it's from C, then check for lua_pushstring, lua_getfield, lua_setfield. Too many of the latter two means you should consider redesigning your C code (don't access Lua objects by name, use references). > >> Because it's not a standalone application, it seems I can't use > >> the "-jv" option. > > > > I bet you can. Just redirect it to a file: > > > > require("jit.v").start("dump.txt") > > Very nice, thanks :) This should tell you why it doesn't compile much of your code. Probably because it has too many Lua <-> C transitions (a common trace abort reason would be: "NYI: C function ..."). --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 07:23:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA9NlN7028749; Tue, 10 Nov 2009 07:23:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E394D18BF7; Tue, 10 Nov 2009 07:23:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2620B18977 for ; Tue, 10 Nov 2009 07:23:21 -0200 (BRST) Received: from [93.172.67.74] by mxout2.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KSV005DEZETY900@mxout2.netvision.net.il> for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 11:23:17 +0200 (IST) Date: Tue, 10 Nov 2009 11:23:22 +0200 From: Shmuel Zeigerman Subject: LuaJIT 2 and string.dump To: Lua list Message-id: <4AF9310A.8090408@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Is the following mentioned somewhere (I fail to find): string.dump(function() end) > luajit: 1.lua:1: cannot dump functions ? -- Shmuel From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 07:25:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA9PM5u028996; Tue, 10 Nov 2009 07:25:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 148FE19294; Tue, 10 Nov 2009 07:25:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F61B19219 for ; Tue, 10 Nov 2009 07:24:59 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7myA-0007gG-00; Tue, 10 Nov 2009 10:24:58 +0100 Date: Tue, 10 Nov 2009 10:24:53 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 and string.dump Message-ID: <20091110092453.GA14595@mike.de> References: <4AF9310A.8090408@013net.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF9310A.8090408@013net.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Shmuel Zeigerman wrote: > Is the following mentioned somewhere (I fail to find): > > string.dump(function() end) >> luajit: 1.lua:1: cannot dump functions Have a look at: http://luajit.org/status.html "Bytecode currently cannot be loaded or dumped." --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 07:39:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA9ddWU030305; Tue, 10 Nov 2009 07:39:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F06EC192EE; Tue, 10 Nov 2009 07:39:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBB1D192CF for ; Tue, 10 Nov 2009 07:39:14 -0200 (BRST) Received: from [93.172.67.74] by mxout2.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KSW00506056XZ10@mxout2.netvision.net.il> for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 11:39:06 +0200 (IST) Date: Tue, 10 Nov 2009 11:39:09 +0200 From: Shmuel Zeigerman Subject: Re: LuaJIT 2 and string.dump In-reply-to: <20091110092453.GA14595@mike.de> To: Lua list Message-id: <4AF934BD.6080309@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4AF9310A.8090408@013net.net> <20091110092453.GA14595@mike.de> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Have a look at: http://luajit.org/status.html > > "Bytecode currently cannot be loaded or dumped." Thanks. (I've a bunch of .dll and .lua modules, and a test suite for 48 of them. Only 2 out of 48 tests failed with LuaJIT 2, both due to the above reason). -- Shmuel From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 07:44:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAA9imXp030797; Tue, 10 Nov 2009 07:44:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4B4B192F9; Tue, 10 Nov 2009 07:44:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8827B192A6 for ; Tue, 10 Nov 2009 07:44:23 -0200 (BRST) Received: by iwn8 with SMTP id 8so3149742iwn.33 for ; Tue, 10 Nov 2009 01:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=v52k8eeDt7YHAVerF7UJa9jAEZBZ39V/hEK2z2VzI8M=; b=odySFpUKS+q2DKkce2BDQt10CMJywwoC6Wkravf73kFCfnjgCG6iRuMHCcsrXQ/knO BFYgqOzEdNx4HOy1QzW3aMcFcR/LDLB2mh4OhZkbPnFjfSsUktHZ/Rnb8x7obonRzHUW JsF3z06YjELtAOfqgqpW+C1iHI0q+FRoWCN1s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OGBkAseRzgqy4hIg1dYaUkeGSmya1w/JEuA8c7BWqwyACcfRDQES1SuuLs1VKaoPaO IzEquphFUJBl1KYO1qjudaihG+MJ/kzvoAJHn0NXwAW4FvTR4gmEsnNXY0nppVo77vNL SB1gYPqEaxlAxPoQ9qkhROpZ4sqccF0BnodAs= MIME-Version: 1.0 Received: by 10.231.122.162 with SMTP id l34mr1566676ibr.20.1257846261232; Tue, 10 Nov 2009 01:44:21 -0800 (PST) In-Reply-To: <20091110095730.72815afb@o> References: <20091110095730.72815afb@o> Date: Tue, 10 Nov 2009 01:44:20 -0800 Message-ID: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> Subject: Re: table output From: Wesley Smith To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I'm sure everyone on this list has written a table serializer at some point. Here's mine: http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/serializer/init.lua wes From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 08:36:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAAaZt6005602; Tue, 10 Nov 2009 08:36:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DB6EB192C4; Tue, 10 Nov 2009 08:36:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A99FC18CE2 for ; Tue, 10 Nov 2009 08:35:56 -0200 (BRST) Received: by fxm21 with SMTP id 21so808627fxm.21 for ; Tue, 10 Nov 2009 02:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=u2I1lGzdvMjKUbmAETnWQkMoYwIyjyg9AvW8p33Qgkw=; b=TOIVgKLnFsNjJu7gMaS14PbG+vBpTP+4XnEHQVodsYC2jWQ2qUHvrfITt8AEXtIgjv ehVMEW5rYxv0Go8CL7FuMzz10Nf12ybB2dBmW1bNTvrXB2n++F+7V12fTer91jkEOyVj F9gE3ixG3I1Yk8I9LGnOl3P9ooTYOjLC19A+E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vxlZCHL2G4EYfLOTbJhXH6+lak70eiUDBjjjKr5rQZPXL+GLdfETzsiWkYL15OTFo3 rqlONOHzPpMVnU0n013lzbXHptpZXaMLNGhmCBp36MkGLJ+3vbQhr0FNYRHqqm50kFao IP8wDgpsNyiDxHVU+YrC9eU5RONJga1LV/NV0= MIME-Version: 1.0 Received: by 10.223.68.155 with SMTP id v27mr1309286fai.10.1257849353551; Tue, 10 Nov 2009 02:35:53 -0800 (PST) In-Reply-To: <20091110095730.72815afb@o> References: <20091110095730.72815afb@o> Date: Tue, 10 Nov 2009 10:35:53 +0000 Message-ID: Subject: Re: table output From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAAaZt6005602 On Tue, Nov 10, 2009 at 8:57 AM, spir wrote: > Hello, > > Is there any builtin way to output table content? Couldn't find in docs, maybe I'm blind... > Also, I would enjoy some clues about the reasoning for tostring(t) not doing that by default (and print(t) not writing that). Probably getting the memory address is useful in specific occasions, so there should certainly be a method for this in library "table". But the table content is certainly what we need in most cases, esp. during developpment/testing/debug phases, so that this should be the easiest output to get. Or am I missing something > > Below a (superficially tested) example of what I mean. (The func names don't pretend to be best.) Still, I guess the default output for a table should be a (flat) view of its content. Even if big (the programmer knows it). There is no such standard function, and I believe the main reason is loops - a table might (directly or indirectly) contain fields that refer to the table itself. For example, the global variable _G is a reference to the global variables table itself, so if you try to use your function to display _G then it will get into an infinite loop trying to display _G._G._G._G... Now, of course you can rewrite your print function to keep track of the hierarchy and stop itself when it detects it is about to go into an infinite loop. But, what do you output instead? It is not trivial to be concise, meaningful, unambiguous and fit for all purposes here, as a standard function would have to be. One thing you should be also be aware of is that the keys of a Lua table can be (almost) any value, not only a string. For example, this would be valid thing to do in T.test(): local abcd = {a=1, b=2, c=3, d=4} circle[abcd] = true ...and would eventually cause an error at 'key .. T.KS', since 'key' would be a table not a string. Having a representation that displays tables-as-keys nicely is also not that easy. -Duncan From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 08:47:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAAl7oZ006832; Tue, 10 Nov 2009 08:47:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DC32192FD; Tue, 10 Nov 2009 08:46:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8FB6319288 for ; Tue, 10 Nov 2009 08:46:39 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 572FF1AA92E9 for ; Tue, 10 Nov 2009 05:46:37 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAAAkbGf011386 for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 05:46:37 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Tue, 10 Nov 2009 05:46:37 -0500 From: Sean Conner To: lua@bazar2.conectiva.com.br Subject: The Lua interpreter and large scripts Message-ID: <20091110104637.GA6015@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I've noticed some strange behavior with the Lua interpreter [1]. I'm trying to load two scripts, one is 1101 bytes in size (just dumps the contents of a table) and the other one is 83414279 bytes in size (yes, 80M---generated by a C program and contains a *really* large table of around 80,000 items [2]). [spc]lucy:/tmp/lua>ll total 81548 -rw------- 1 spc spc 83414279 Nov 10 05:30 default.lua -rw-r--r-- 1 spc spc 1101 Nov 10 05:30 show.lua Okay. [spc]lucy:/tmp/lua>time lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("show.lua") > dofile("default.lua") > os.exit() real 0m16.130s user 0m6.311s sys 0m0.365s [spc]lucy:/tmp/lua>time lua -i default.lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("show.lua") > os.exit() real 0m12.354s # file is probably cached at this point user 0m6.293s sys 0m0.413s [spc]lucy:/tmp/lua>time lua -i show.lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("default.lua") > os.exit() real 5m49.052s # okay ... what happened? user 5m43.279s sys 0m0.577s [spc]lucy:/tmp/lua> I can work around this, but I'm very curious as to why it's happening. -spc (Who finds this very odd behavior ... ) [1] Linux 2.6, dual core Pentium-4 2.6GHz with a 1G of RAM [2] Basically, an index of all the headers from over 80,000 messages from 2,300 files (of which the names, sizes and timestamps are saved as well in the table). From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 09:23:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAABN0A5012811; Tue, 10 Nov 2009 09:23:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E779A192E9; Tue, 10 Nov 2009 09:22:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBC0C192A4 for ; Tue, 10 Nov 2009 09:22:20 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAABMIT2012694 for ; Tue, 10 Nov 2009 09:22:18 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id nAABMItR012690 for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 09:22:18 -0200 Date: Tue, 10 Nov 2009 09:22:17 -0200 From: Luiz Henrique de Figueiredo To: lua@bazar2.conectiva.com.br Subject: videos of the Lua Workshop 2009 Message-ID: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br The videos of the talks given at the Lua Workshop 2009 are available at http://puc-riodigital.com.puc-rio.br/ You have to search for "Linguagem Lua" in "Busca". The list is also at http://puc-riodigital.com.puc-rio.br/cgi/cgilua.exe/sys/start.htm?sid=81 You probably need a special plugin to see the videos in the browser. I managed to see them by copying and pasting the URLs below directly into VLC. Linguagem Lua I André Carregal fala sobre o Kepler Project. http://midia.com.puc-rio.br/integra/20091106_lua1manhã1.wmv Linguagem Lua II Jason Santos fala sobre LuaEclipse. http://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv Linguagem Lua III Hisham Muhammad fala sobre o LuaRocks 2.0. http://midia.com.puc-rio.br/integra/20091106_lua1manhã3.wmv Linguagem Lua IV Fabio Mascarenhas apresenta o Orbit. http://midia.com.puc-rio.br/integra/20091106_lua1manhã4.wmv Linguagem Lua V Palestra com Rafael Sabbagh, Vagner Nascimento e Guilherme Sanchez Pacheco. http://midia.com.puc-rio.br/integra/20091106_lua1manhã5.wmv Linguagem Lua VI Jim Whitehead II fala sobre Sputnik. http://midia.com.puc-rio.br/integra/20091106_lua1manhã6.wmv Linguagem Lua VII Roberto Ierusalimschy fala sobre a evolução de Lua. http://midia.com.puc-rio.br/integra/20091106_lua1manhã7.wmv Linguagem Lua VIII Antonio Scuri fala sobre as ferramentas IUP, CD e IM http://midia.com.puc-rio.br/integra/20091106_lua1tarde1.wmv Linguagem Lua IX Renato Maia fala sobre o sistema MPA http://midia.com.puc-rio.br/integra/20091106_lua1tarde2.wmv Linguagem Lua X Daniel Colchete fala sobre segurança para internet utilizando Lua na MAV Tecnologia http://midia.com.puc-rio.br/integra/20091106_lua1tarde3.wmv Linguagem Lua XI Patrick Donelly fala sobre Nmap Script Engine http://midia.com.puc-rio.br/integra/20091106_lua1tarde4.wmv Linguagem Lua XII Dado Sutter e Bogdan Marinescu falam sobre o eLua. http://midia.com.puc-rio.br/integra/20091106_lua1tarde5.wmv Linguagem Lua XIII Palestra de Fabien Fleutot http://midia.com.puc-rio.br/integra/20091106_lua1tarde6.wmv Linguagem Lua XIV Palestra de Hamilton Athanazio http://midia.com.puc-rio.br/integra/20091109_lua2manha1.wmv Linguagem Lua XV Palestra com Anderson Ferreira de Oliveira. http://midia.com.puc-rio.br/integra/20091109_lua2manha2.wmv Linguagem Lua XVI Palestra com Ricardo Costa. http://midia.com.puc-rio.br/integra/20091109_lua2manha3.wmv Linguagem Lua XVII Palestra com Roberto Lerusalimschy. http://midia.com.puc-rio.br/integra/20091109_lua2manha4.wmv Linguagem Lua XVIII Palestra com Jim Whitehead II http://midia.com.puc-rio.br/integra/20091109_lua2manha5.wmv Linguagem Lua XIX Palestra com Francisco Sant'Anna. http://midia.com.puc-rio.br/integra/20091109_lua2tarde1.wmv Linguagem Lua XX Palestra com Helder Santos. http://midia.com.puc-rio.br/integra/20091109_lua2tarde2.wmv Linguagem Lua XXI Palestra com Roberto Beauclair. http://midia.com.puc-rio.br/integra/20091109_lua2tarde3.wmv Linguagem Lua XXII Palestra com Téo Benjamin e Ives Negreiros. http://midia.com.puc-rio.br/integra/20091109_lua2tarde4.wmv Linguagem Lua XXIII Palestra com Francisco Sant'Anna. http://midia.com.puc-rio.br/integra/20091109_lua2tarde5.wmv From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 09:24:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAABObM5013254; Tue, 10 Nov 2009 09:24:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C55FE19323; Tue, 10 Nov 2009 09:24:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hpelbers.org (hpelbers.org [74.54.162.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C80F19305 for ; Tue, 10 Nov 2009 09:24:12 -0200 (BRST) Received: from localhost ([127.0.0.1]) by gauri.webserversystems.com with esmtpa (Exim 4.69) (envelope-from ) id 1N7opX-0004s1-Ej for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 05:24:11 -0600 Received: from 77.165.148.98 ([77.165.148.98]) by hpelbers.org (Horde MIME library) with HTTP; Tue, 10 Nov 2009 05:24:11 -0600 Message-ID: <20091110052411.qmqofioekg4wcc0s@hpelbers.org> Date: Tue, 10 Nov 2009 05:24:11 -0600 From: hans elbers To: lua@bazar2.conectiva.com.br Subject: Re: table output References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> In-Reply-To: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gauri.webserversystems.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hpelbers.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean I did :-/ Here's mine: http://www.hpelbers.org/lua/print_r It can output to string or to stdout. h.t.h., Hans Quoting Wesley Smith : > I'm sure everyone on this list has written a table serializer at some > point. Here's mine: From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 10:25:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAACPrZ5025822; Tue, 10 Nov 2009 10:25:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5A681926D; Tue, 10 Nov 2009 10:25:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp28.orange.fr (smtp28.orange.fr [80.12.242.100]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C63F4190E0 for ; Tue, 10 Nov 2009 10:25:10 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2806.orange.fr (SMTP Server) with ESMTP id AE345700009E for ; Tue, 10 Nov 2009 13:25:03 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2806.orange.fr (SMTP Server) with ESMTP id A24EC700008B for ; Tue, 10 Nov 2009 13:25:03 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2806.orange.fr (SMTP Server) with ESMTP id 6B6ED700009E for ; Tue, 10 Nov 2009 13:25:03 +0100 (CET) X-ME-UUID: 20091110122503440.6B6ED700009E@mwinf2806.orange.fr Date: Tue, 10 Nov 2009 13:25:02 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: table output Message-ID: <20091110132502.780f17a8@o> In-Reply-To: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 10 Nov 2009 01:44:20 -0800, Wesley Smith s'exprima ainsi: > I'm sure everyone on this list has written a table serializer at some > point. Here's mine: > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/serializer/init.lua > > wes Should this reply be understood as "there is a need for this in core lua"? (But serializing is not output -- I intentionally formatted differently. My purpose is mainly developper feedback, possibly re-usable for user output.) Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 10:36:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAACanp1028408; Tue, 10 Nov 2009 10:36:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0AAA19318; Tue, 10 Nov 2009 10:36:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FFBC19305 for ; Tue, 10 Nov 2009 10:36:17 -0200 (BRST) Received: by fxm21 with SMTP id 21so894311fxm.21 for ; Tue, 10 Nov 2009 04:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=DN8mcDyO3I0uHviCOTbtQC3XUsD7Ed5EWaJapM+WbRM=; b=B7xHm3SJPVfmyUIwQ96tEJdUb60VBLixk9YZkDQ5VgBwHPeFF760AfIsLwykZ5mkD3 zcSZfuO9XOGTEs/gG2UzatT2jsJAT9BOOd9F0X2tfGex04zXJIULdglHiRdw7BNWYqpW UK+abVXTiL1N2ef6AYlpifkyVCSPMlKCEkVjM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=BkuivAfOn/NxBf4T3VopPhOyF9yaaQWMFdP9iCX4DMttPS2HAu2PWoZvMo191AtdUd ncpGtDYMTPaCmHzy1XRnnH1tu4e9eI8DJKYpqbFhsFAfW+iSTQnlwmOYKh6FmLcYP3S2 y/glhfQ+lz7IiIrzNpO/G+TAM0mJFKKQr77Wc= MIME-Version: 1.0 Received: by 10.239.168.204 with SMTP id l12mr2450hbe.36.1257856575701; Tue, 10 Nov 2009 04:36:15 -0800 (PST) In-Reply-To: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> Date: Tue, 10 Nov 2009 14:36:15 +0200 Message-ID: <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> Subject: Re: videos of the Lua Workshop 2009 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAACanp1028408 On Tue, Nov 10, 2009 at 1:22 PM, Luiz Henrique de Figueiredo wrote: > The videos of the talks given at the Lua Workshop 2009 are available at >        http://puc-riodigital.com.puc-rio.br/ I notice that according to wget these are very small 'stubs', which is a problem with the slow link I've got here. Anyway to grab them & play them later? steve d. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:01:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAD1jFt001319; Tue, 10 Nov 2009 11:01:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 118F719295; Tue, 10 Nov 2009 11:01:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7624118F56 for ; Tue, 10 Nov 2009 11:01:02 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAD0vrT001106 for ; Tue, 10 Nov 2009 11:00:59 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAAD1LT04603; Tue, 10 Nov 2009 11:01:21 -0200 Date: Tue, 10 Nov 2009 11:01:20 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110110120.A4592@lua.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com>; from steve.j.donovan@gmail.com on Tue, Nov 10, 2009 at 02:36:15PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I notice that according to wget these are very small 'stubs', which is > a problem with the slow link I've got here. These stubs are understood by VLC. > Anyway to grab them & play them later? Not that I know of. If anyone knows, please share. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:05:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAD5FcI002089; Tue, 10 Nov 2009 11:05:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5B4B1934D; Tue, 10 Nov 2009 11:04:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6D3A19345 for ; Tue, 10 Nov 2009 11:04:44 -0200 (BRST) Received: by fxm21 with SMTP id 21so916750fxm.21 for ; Tue, 10 Nov 2009 05:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=dKRx9pKPq1h6IbjgvGN7UMWqDHR+40IEZfekAAhXUok=; b=iF7qILym6P1H/ArUOk1bMVmTJftgFBOqLDzTnoPhRPbqJcS98zOO+3if8y7Opr1LdD AhoMFRoO8ETdnP2jd43F+0n6NPHN7YD+8dtyhoMs1uHOhOcbaJRRWupvT9GMyrtJwoaW FFUzkLLvzSAvs5h92EJ7FxO3zxbqiRSTd1DBc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=e9rchFBi7xUnZGXOn9xz+ep7YU2XN+sICS1xGA8jA1TUiJZN0m/qA0HkuRm34ZEEWb 5EObFlRrrAp7xvQVNebgxz8j4jCcvHvsL9dKU3xAh4+voRMpUWTmZMPn6kkfI5Lgsp0C 4Af7xe1HuJhiZjbnWeR8P5zvyFGjkMIipWZ38= MIME-Version: 1.0 Received: by 10.223.14.13 with SMTP id e13mr2287faa.85.1257858281267; Tue, 10 Nov 2009 05:04:41 -0800 (PST) In-Reply-To: <20091110110120.A4592@lua.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <20091110110120.A4592@lua.tecgraf.puc-rio.br> From: Jim Whitehead II Date: Tue, 10 Nov 2009 13:04:21 +0000 Message-ID: <5fe281d40911100504x797f9eb4ocd5292420f17398d@mail.gmail.com> Subject: Re: videos of the Lua Workshop 2009 To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 1:01 PM, Luiz Henrique de Figueiredo wrote: >> I notice that according to wget these are very small 'stubs', which is >> a problem with the slow link I've got here. > > These stubs are understood by VLC. > >> Anyway to grab them & play them later? > > Not that I know of. If anyone knows, please share. I'm sure there's a UNIX-ish solution to the problem, but I can open them in Quicktime on Snow Leopard, and can save them natively as .mov files. - Jim From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:08:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAD8mSM002905; Tue, 10 Nov 2009 11:08:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D25A519358; Tue, 10 Nov 2009 11:08:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1DAE519353 for ; Tue, 10 Nov 2009 11:08:11 -0200 (BRST) MailScanner-NULL-Check: 1258463282.72621@CjE84yaN1n9K4xIGDUVheA Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nAAD8027018971 for ; Tue, 10 Nov 2009 11:08:00 -0200 Message-ID: <4AF96599.5060101@inconcertcc.com> Date: Tue, 10 Nov 2009 11:07:37 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: videos of the Lua Workshop 2009 References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> In-Reply-To: <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------020902080708050209010504" X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------020902080708050209010504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit steve donovan wrote: > On Tue, Nov 10, 2009 at 1:22 PM, Luiz Henrique de Figueiredo > wrote: >> The videos of the talks given at the Lua Workshop 2009 are available at >> http://puc-riodigital.com.puc-rio.br/ > > I notice that according to wget these are very small 'stubs', which is > a problem with the slow link I've got here. > > Anyway to grab them & play them later? > > steve d. > Hi Steve. Yes. Attached is a .asx file (I think its just a playlist). Under Windows, I installed a free program called SDP Multimedia [1]. There you open this .asx file and you can choose which one to download or by clicking "batch" download the whole bunch. Ignacio Burgueño [1] http://sdp.ppona.com/ --------------020902080708050209010504 Content-Type: video/x-ms-asf; name="lua_Workshop.asx" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="lua_Workshop.asx" PEFTWCBWRVJTSU9OPSIzLjAiPg0KICA8VGl0bGU+THVhPC9UaXRsZT4NCiAg PEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEuY29tLnB1Yy1yaW8uYnIv aW50ZWdyYS8yMDA5MTEwNl9sdWExbWFuaOMyLndtdiIvPjwvRW50cnk+DQog IDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlhLmNvbS5wdWMtcmlvLmJy L2ludGVncmEvMjAwOTExMDZfbHVhMW1hbmjjMy53bXYiLz48L0VudHJ5Pg0K ICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRpYS5jb20ucHVjLXJpby5i ci9pbnRlZ3JhLzIwMDkxMTA2X2x1YTFtYW5o4zQud212Ii8+PC9FbnRyeT4N CiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEuY29tLnB1Yy1yaW8u YnIvaW50ZWdyYS8yMDA5MTEwNl9sdWExbWFuaOM1LndtdiIvPjwvRW50cnk+ DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlhLmNvbS5wdWMtcmlv LmJyL2ludGVncmEvMjAwOTExMDZfbHVhMW1hbmjjNi53bXYiLz48L0VudHJ5 Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRpYS5jb20ucHVjLXJp by5ici9pbnRlZ3JhLzIwMDkxMTA2X2x1YTFtYW5o4zcud212Ii8+PC9FbnRy eT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEuY29tLnB1Yy1y aW8uYnIvaW50ZWdyYS8yMDA5MTEwNl9sdWExdGFyZGUxLndtdiIvPjwvRW50 cnk+DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlhLmNvbS5wdWMt cmlvLmJyL2ludGVncmEvMjAwOTExMDZfbHVhMXRhcmRlMi53bXYiLz48L0Vu dHJ5Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRpYS5jb20ucHVj LXJpby5ici9pbnRlZ3JhLzIwMDkxMTA2X2x1YTF0YXJkZTMud212Ii8+PC9F bnRyeT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEuY29tLnB1 Yy1yaW8uYnIvaW50ZWdyYS8yMDA5MTEwNl9sdWExdGFyZGU0LndtdiIvPjwv RW50cnk+DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlhLmNvbS5w dWMtcmlvLmJyL2ludGVncmEvMjAwOTExMDZfbHVhMXRhcmRlNS53bXYiLz48 L0VudHJ5Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRpYS5jb20u cHVjLXJpby5ici9pbnRlZ3JhLzIwMDkxMTA2X2x1YTF0YXJkZTYud212Ii8+ PC9FbnRyeT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEuY29t LnB1Yy1yaW8uYnIvaW50ZWdyYS8yMDA5MTEwOV9sdWEybWFuaGExLndtdiIv PjwvRW50cnk+DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlhLmNv bS5wdWMtcmlvLmJyL2ludGVncmEvMjAwOTExMDlfbHVhMm1hbmhhMi53bXYi Lz48L0VudHJ5Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRpYS5j b20ucHVjLXJpby5ici9pbnRlZ3JhLzIwMDkxMTA5X2x1YTJtYW5oYTMud212 Ii8+PC9FbnRyeT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlkaWEu Y29tLnB1Yy1yaW8uYnIvaW50ZWdyYS8yMDA5MTEwOV9sdWEybWFuaGE0Lndt diIvPjwvRW50cnk+DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21pZGlh LmNvbS5wdWMtcmlvLmJyL2ludGVncmEvMjAwOTExMDlfbHVhMm1hbmhhNS53 bXYiLz48L0VudHJ5Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9taWRp YS5jb20ucHVjLXJpby5ici9pbnRlZ3JhLzIwMDkxMTA5X2x1YTJ0YXJkZTEu d212Ii8+PC9FbnRyeT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8vbWlk aWEuY29tLnB1Yy1yaW8uYnIvaW50ZWdyYS8yMDA5MTEwOV9sdWEydGFyZGUy LndtdiIvPjwvRW50cnk+DQogIDxFbnRyeT48cmVmIGhyZWY9Im1tczovL21p ZGlhLmNvbS5wdWMtcmlvLmJyL2ludGVncmEvMjAwOTExMDlfbHVhMnRhcmRl My53bXYiLz48L0VudHJ5Pg0KICA8RW50cnk+PHJlZiBocmVmPSJtbXM6Ly9t aWRpYS5jb20ucHVjLXJpby5ici9pbnRlZ3JhLzIwMDkxMTA5X2x1YTJ0YXJk ZTQud212Ii8+PC9FbnRyeT4NCiAgPEVudHJ5PjxyZWYgaHJlZj0ibW1zOi8v bWlkaWEuY29tLnB1Yy1yaW8uYnIvaW50ZWdyYS8yMDA5MTEwOV9sdWEydGFy ZGU1LndtdiIvPjwvRW50cnk+DQo8L0FTWD4g --------------020902080708050209010504-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:12:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADBsiG003623; Tue, 10 Nov 2009 11:11:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5CFB1936C; Tue, 10 Nov 2009 11:11:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2b.orange.fr (smtp2b.orange.fr [80.12.242.145]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 085A81934B for ; Tue, 10 Nov 2009 11:11:19 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b08.orange.fr (SMTP Server) with ESMTP id B824E70000AE for ; Tue, 10 Nov 2009 14:11:12 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b08.orange.fr (SMTP Server) with ESMTP id AC04770000AB for ; Tue, 10 Nov 2009 14:11:12 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2b08.orange.fr (SMTP Server) with ESMTP id 547B270000AE for ; Tue, 10 Nov 2009 14:11:12 +0100 (CET) X-ME-UUID: 20091110131112346.547B270000AE@mwinf2b08.orange.fr Date: Tue, 10 Nov 2009 14:11:11 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: table output Message-ID: <20091110141111.4a908209@o> In-Reply-To: References: <20091110095730.72815afb@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 10 Nov 2009 10:35:53 +0000, Duncan Cross s'exprima ainsi: > On Tue, Nov 10, 2009 at 8:57 AM, spir wrote: > > Hello, > > > > Is there any builtin way to output table content? Couldn't find in docs, > > maybe I'm blind... Also, I would enjoy some clues about the reasoning for > > tostring(t) not doing that by default (and print(t) not writing that). > > Probably getting the memory address is useful in specific occasions, so > > there should certainly be a method for this in library "table". But the > > table content is certainly what we need in most cases, esp. during > > developpment/testing/debug phases, so that this should be the easiest > > output to get. Or am I missing something > > > > Below a (superficially tested) example of what I mean. (The func names > > don't pretend to be best.) Still, I guess the default output for a table > > should be a (flat) view of its content. Even if big (the programmer knows > > it). Global comment: You're right, my trial is full of flaws. But this is a first trial. Anyway a standard & easy (print()) manner to output tables is highly useful I guess, even if not perfect is all cases. What do you all think? > There is no such standard function, and I believe the main reason is > loops - a table might (directly or indirectly) contain fields that > refer to the table itself. For example, the global variable _G is a > reference to the global variables table itself, so if you try to use > your function to display _G then it will get into an infinite loop > trying to display _G._G._G._G... Right. > Now, of course you can rewrite your print function to keep track of > the hierarchy and stop itself when it detects it is about to go into > an infinite loop. But, what do you output instead? It is not trivial > to be concise, meaningful, unambiguous and fit for all purposes here, > as a standard function would have to be. Have no idea how to identify the root table itself (after, I'm a beginner -- but see also (*)) as we get the object, while nested ones can be identified while walking, sure. As I said, the output needs not be perfect and a simple placeholder like would be fine for me. Below python's solution (I don't mean python's choices are good, it's just an example): d = {'a':1, 'b':2, 'c':3} print d d['b']=d print d ==> {'a': 1, 'c': 3, 'b': 2} {'a': 1, 'c': 3, 'b': {...}} > One thing you should be also be aware of is that the keys of a Lua > table can be (almost) any value, not only a string. For example, this > would be valid thing to do in T.test(): > > local abcd = {a=1, b=2, c=3, d=4} > circle[abcd] = true > > ...and would eventually cause an error at 'key .. T.KS', since 'key' > would be a table not a string. Having a representation that displays > tables-as-keys nicely is also not that easy. Well, I could just add a tostring(), but rather not develop keys, I guess. The issue again beeing we cannot a get a key's own name (here 'abcd'), there is no obvious placeholder else maybe the type: eg write or when the key is neither a number nore a string. table: foo: bar
: true Wonder how lua copes with nonstable keys (for the table key can be modified, so that the hash value will change). Any way, for 'static' objects, python would do so: def f():pass d[f]=4 print d ==> {'a': 1, 'c': 3, 'b': {...}, : 4} But we cannot implement this "manually", I guess, cause there is no way to get the key's name, only the data -- unless I'm missing something obvious (see (*) again). > -Duncan > Thanks for your comments, Denis (*) Other languages don't let you get the _name_ of an argument neither, nore its expression in calling code, except for highly reflexive ones like Io. So that it's impossible for instance to write the developper's quick debug dream func: show = function(obj) print(obj.name..': '..tostring(obj)) show(count) ==> count: 3 or even better show = function(obj) print(obj.expression..': '..tostring(obj)) show(count+1) ==> count+1: 4 Sure, we can write: print("count +1: "..tostring(count)). But this is so practicle, especially in languages languages well fitted for fast testing and debugging, that I guess most of us use simple prints as main everyday debug facility, and really wonder why such a func is not implemented in all scripting languages. Actually, when I design & implement my own Pl, this will be the first func I write ;-) Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:15:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADFGqB004427; Tue, 10 Nov 2009 11:15:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BB0019374; Tue, 10 Nov 2009 11:14:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8779A1936F for ; Tue, 10 Nov 2009 11:14:45 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N7qYF-000417-J0 for ; Tue, 10 Nov 2009 13:14:27 +0000 Received: from petitemort.i.flarn.net ([10.19.3.101] helo=petitemort) by master with esmtp (Exim 4.69) (envelope-from ) id 1N7qYQ-0002mC-Pv for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 13:14:38 +0000 Received: from dsilvers by petitemort with local (Exim 4.69) (envelope-from ) id 1N7qYQ-0007Mv-IE for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 13:14:38 +0000 Date: Tue, 10 Nov 2009 13:14:38 +0000 From: Daniel Silverstone To: lua@bazar2.conectiva.com.br Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110131438.GA24731@digital-scurf.org> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 02:36:15PM +0200, steve donovan wrote: > Anyway to grab them & play them later? Given mplayer can't play them, I can't give you an mencoder cmdline. Wget won't work because the server insists on streaming. There may be a way to set up a vlc pipeline but I've not yet got it... If I come up with something I'll let you know. D. -- Daniel Silverstone http://www.digital-scurf.org/ PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69 From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:20:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADKquV005671; Tue, 10 Nov 2009 11:20:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8373192DF; Tue, 10 Nov 2009 11:20:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1679F18A87 for ; Tue, 10 Nov 2009 11:20:16 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so10219fgb.17 for ; Tue, 10 Nov 2009 05:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fAFsZpoG7BM7BP0hb8ojoWJSy/M041MtZjaCiXLIXNE=; b=IAabJts3e4JF8NOce4SMyDGqtsnJVmcNwKa5rEONokQu4Zr95VHtnJWi7+DiC6biss ChzLoSf1sx6DOTjh4OAaAJWjNk6gHITp4sjA7ougmNG1Kg9cS6FxxHnivLW9tRjUkPdd gwuCtDnewv3IJD88Kb9a+ILdnSBngy26+qQS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EoZGGdL4SSkqrg84qVvwXb5gBQ/S836JwsgiOiA0R34mhZJsO2NaxUKrfVxxB5j+K1 jouvAZzaDQXtIsZ0Skgrmo2oyn2EU0FFcqNiGb6IOM3JbMWkikFrHnb/4dHk9hkAWq1E lMVjW1KcgaE1pxm/AsJI0FCncuhVOCTcuCI24= MIME-Version: 1.0 Received: by 10.239.181.163 with SMTP id m35mr3414hbg.175.1257859215129; Tue, 10 Nov 2009 05:20:15 -0800 (PST) In-Reply-To: <4AF96599.5060101@inconcertcc.com> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> Date: Tue, 10 Nov 2009 15:20:15 +0200 Message-ID: <560972290911100520n5866461cscd82551cd98db8c8@mail.gmail.com> Subject: Re: videos of the Lua Workshop 2009 From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAADKquV005671 2009/11/10 Ignacio Burgueño : > Hi Steve. Yes. Attached is a .asx file (I think its just a playlist). Under > Windows, I installed a free program called SDP Multimedia [1]. And it's working as I type - so there's a solution. Thanks! From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:21:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADLm4k005866; Tue, 10 Nov 2009 11:21:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 521B61937D; Tue, 10 Nov 2009 11:20:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B1CC818A87 for ; Tue, 10 Nov 2009 11:20:52 -0200 (BRST) MailScanner-NULL-Check: 1258464050.08221@6O3A4DNfuNDpPlQGSSvUmg Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nAADKkmL026108 for ; Tue, 10 Nov 2009 11:20:46 -0200 Message-ID: <4AF9689E.9050105@inconcertcc.com> Date: Tue, 10 Nov 2009 11:20:30 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: videos of the Lua Workshop 2009 References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> In-Reply-To: <4AF96599.5060101@inconcertcc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Ignacio Burgueño wrote: >> I notice that according to wget these are very small 'stubs', which is >> a problem with the slow link I've got here. >> >> Anyway to grab them & play them later? >> >> steve d. >> > > Hi Steve. Yes. Attached is a .asx file (I think its just a playlist). > Under Windows, I installed a free program called SDP Multimedia [1]. > There you open this .asx file and you can choose which one to download > or by clicking "batch" download the whole bunch. > > Ignacio Burgueño > > > [1] http://sdp.ppona.com/ My last message possibly got filtered by my mail provider. I've pasted the playlist contents here: http://pastebin.com/f682c606e Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:32:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADWHR7008617; Tue, 10 Nov 2009 11:32:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F8511938F; Tue, 10 Nov 2009 11:31:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F358B1938B for ; Tue, 10 Nov 2009 11:31:35 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADVT6Z008046 for ; Tue, 10 Nov 2009 11:31:29 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id nAADVSZ1008038 for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 11:31:28 -0200 Date: Tue, 10 Nov 2009 11:31:28 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4AF96599.5060101@inconcertcc.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Attached is a .asx file (I think its just a playlist). VLC understands that as well, good. But, at least in my Mac, it had problems with the first few videos: I guess it was because the URLs have accented characters, but I'm not sure. mms://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv Oh, now even this does not work now... http://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:52:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADqFSo013223; Tue, 10 Nov 2009 11:52:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F1E31936D; Tue, 10 Nov 2009 11:51:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5F44E19356 for ; Tue, 10 Nov 2009 11:51:42 -0200 (BRST) MailScanner-NULL-Check: 1258465895.39244@xyXLEnbLRJx7qw10qP7yDA Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nAADpYKk009580 for ; Tue, 10 Nov 2009 11:51:34 -0200 Message-ID: <4AF96FD9.4000102@inconcertcc.com> Date: Tue, 10 Nov 2009 11:51:21 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: videos of the Lua Workshop 2009 References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> In-Reply-To: <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> Attached is a .asx file (I think its just a playlist). > > VLC understands that as well, good. But, at least in my Mac, it had > problems with the first few videos: I guess it was because the URLs have > accented characters, but I'm not sure. > > mms://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv > > Oh, now even this does not work now... > > http://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv > Accented characters in urls should be escaped. See if this works for you: http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A32.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A33.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A34.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A35.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A36.wmv http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A37.wmv Those are sessions 1 to 7. I noticed that urls for sessions corresponding to day 2 don't have accented characters anymore. i.e. http://midia.com.puc-rio.br/integra/20091109_lua2manha1.wmv Regards, Ignacio From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 11:58:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAADwfIC014673; Tue, 10 Nov 2009 11:58:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D799B1937B; Tue, 10 Nov 2009 11:58:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2DAC419356 for ; Tue, 10 Nov 2009 11:58:09 -0200 (BRST) Received: by fxm21 with SMTP id 21so34972fxm.21 for ; Tue, 10 Nov 2009 05:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=aAg5v+WOoqtwIzv6hvA2hPAhnsxQ9+dTRTGmZxXes+U=; b=QiMmrpoDCx9QofU8L2PBHA8Ug03LCkTaP7norg/a6AYFMOHe37BuKYw5f5X9JVZiJV 96MjPAfVPlp0j7IVe1Eoi+cRhFo49yp7SuhdDD9CJSvHKWmKxD40Zgx2FB7EDIZ9YN2Y QeWmwbpdtf4E7ocfL4E7nZmHYe/8vGvRv/BqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=sJG4J4gOdNsEcVL0nWwgue57b5Ox1YUqak55uYbbayjJnPlYv0qu6fwkKUwMYJZGOu igF4bQm4LBQoy00ceTCmcWDqgVBFGr88ElfdC4ENcGjsznCChfhrlGITl9EQLKvMpVj+ xkVg5zjgVHHodUkw/49Nn88G8NfR6FmJVuH1Q= MIME-Version: 1.0 Received: by 10.216.87.9 with SMTP id x9mr41369wee.0.1257861487215; Tue, 10 Nov 2009 05:58:07 -0800 (PST) In-Reply-To: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> From: Jerome Vuarand Date: Tue, 10 Nov 2009 14:57:47 +0100 Message-ID: <89d273ba0911100557h7fd4241bl1e7cc4260cc630ca@mail.gmail.com> Subject: Re: videos of the Lua Workshop 2009 To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAADwfIC014673 2009/11/10 Luiz Henrique de Figueiredo : > The videos of the talks given at the Lua Workshop 2009 are available at > http://puc-riodigital.com.puc-rio.br/ > > You have to search for "Linguagem Lua" in "Busca". The list is also at > http://puc-riodigital.com.puc-rio.br/cgi/cgilua.exe/sys/start.htm?sid=81 > > You probably need a special plugin to see the videos in the browser. > I managed to see them by copying and pasting the URLs below directly into VLC. > > Linguagem Lua I > André Carregal fala sobre o Kepler Project. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã1.wmv > > Linguagem Lua II > Jason Santos fala sobre LuaEclipse. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv > > Linguagem Lua III > Hisham Muhammad fala sobre o LuaRocks 2.0. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã3.wmv > > Linguagem Lua IV > Fabio Mascarenhas apresenta o Orbit. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã4.wmv > > Linguagem Lua V > Palestra com Rafael Sabbagh, Vagner Nascimento e Guilherme Sanchez Pacheco. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã5.wmv > > Linguagem Lua VI > Jim Whitehead II fala sobre Sputnik. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã6.wmv > > Linguagem Lua VII > Roberto Ierusalimschy fala sobre a evolução de Lua. > http://midia.com.puc-rio.br/integra/20091106_lua1manhã7.wmv > > Linguagem Lua VIII > Antonio Scuri fala sobre as ferramentas IUP, CD e IM > http://midia.com.puc-rio.br/integra/20091106_lua1tarde1.wmv > > Linguagem Lua IX > Renato Maia fala sobre o sistema MPA > http://midia.com.puc-rio.br/integra/20091106_lua1tarde2.wmv > > Linguagem Lua X > Daniel Colchete fala sobre segurança para internet utilizando Lua na MAV Tecnologia > http://midia.com.puc-rio.br/integra/20091106_lua1tarde3.wmv > > Linguagem Lua XI > Patrick Donelly fala sobre Nmap Script Engine > http://midia.com.puc-rio.br/integra/20091106_lua1tarde4.wmv > > Linguagem Lua XII > Dado Sutter e Bogdan Marinescu falam sobre o eLua. > http://midia.com.puc-rio.br/integra/20091106_lua1tarde5.wmv > > Linguagem Lua XIII > Palestra de Fabien Fleutot > http://midia.com.puc-rio.br/integra/20091106_lua1tarde6.wmv > > Linguagem Lua XIV > Palestra de Hamilton Athanazio > http://midia.com.puc-rio.br/integra/20091109_lua2manha1.wmv > > Linguagem Lua XV > Palestra com Anderson Ferreira de Oliveira. > http://midia.com.puc-rio.br/integra/20091109_lua2manha2.wmv > > Linguagem Lua XVI > Palestra com Ricardo Costa. > http://midia.com.puc-rio.br/integra/20091109_lua2manha3.wmv > > Linguagem Lua XVII > Palestra com Roberto Lerusalimschy. > http://midia.com.puc-rio.br/integra/20091109_lua2manha4.wmv > > Linguagem Lua XVIII > Palestra com Jim Whitehead II > http://midia.com.puc-rio.br/integra/20091109_lua2manha5.wmv > > Linguagem Lua XIX > Palestra com Francisco Sant'Anna. > http://midia.com.puc-rio.br/integra/20091109_lua2tarde1.wmv > > Linguagem Lua XX > Palestra com Helder Santos. > http://midia.com.puc-rio.br/integra/20091109_lua2tarde2.wmv > > Linguagem Lua XXI > Palestra com Roberto Beauclair. > http://midia.com.puc-rio.br/integra/20091109_lua2tarde3.wmv > > Linguagem Lua XXII > Palestra com Téo Benjamin e Ives Negreiros. > http://midia.com.puc-rio.br/integra/20091109_lua2tarde4.wmv > > Linguagem Lua XXIII > Palestra com Francisco Sant'Anna. > http://midia.com.puc-rio.br/integra/20091109_lua2tarde5.wmv In the few ones I've tried the sound is awful. With my earing impairment I can barely understand some words of what is said (some of the presentations are not in english, right ?). Has the sound been recorded separately with better quality somewhere and waiting to be remixed ? From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:02:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE2aaS015612; Tue, 10 Nov 2009 12:02:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87CFD1938A; Tue, 10 Nov 2009 12:02:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9F801936F for ; Tue, 10 Nov 2009 12:01:54 -0200 (BRST) Received: by ewy26 with SMTP id 26so52222ewy.5 for ; Tue, 10 Nov 2009 06:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=L3+beCBskkI62247NhEaObT5zvKMK5aIauCTsySp1Oo=; b=UVk7ZksrC1p6nT/KRZkiYhs5UaNj7JZ+eh0nvMvwz616ZcouFRdJBejxkrvhrNdcWV si6+6hzcu9L0B6qD8Z8e6eozDwVLDBYth9oEMGGI1kV33BS0p9PLRwCkdduqcFEq85IN EbmqRz78vTEtn6rwBUfHzztXSzjMDUErN26Vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=uHHZruGxI/3ESOcQL8Ked9g6W4LoyBnq5wLsL6sK57Mjcv5EXGvGkNupM3li0NUpKM uGp55beR1eBj1ysbVh54ruraaYPlmt6lrD4Xk5OnBeQGAkYyON3mEYgEPz+DSVMpKbVM PKChNwPw2B+drno7fqEis+vE1/O6XFop3APD8= MIME-Version: 1.0 Received: by 10.213.0.135 with SMTP id 7mr101440ebb.65.1257861712989; Tue, 10 Nov 2009 06:01:52 -0800 (PST) In-Reply-To: <20091110092453.GA14595@mike.de> References: <4AF9310A.8090408@013net.net> <20091110092453.GA14595@mike.de> Date: Tue, 10 Nov 2009 15:01:52 +0100 X-Google-Sender-Auth: 76500b45991e45d6 Message-ID: <956373d40911100601g547d03c7le0cf4faee24f0429@mail.gmail.com> Subject: Re: LuaJIT 2 and string.dump From: Fabien To: Lua list Content-Type: multipart/alternative; boundary=000e0cdff7b4946c3a047804c063 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cdff7b4946c3a047804c063 Content-Type: text/plain; charset=ISO-8859-1 Mike, do you plan at some point to document the bytecode format you're using? -- Fabien. --000e0cdff7b4946c3a047804c063 Content-Type: text/html; charset=ISO-8859-1 Mike,

do you plan at some point to document the bytecode format you're using?

-- Fabien.
--000e0cdff7b4946c3a047804c063-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:03:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE3W1x015823; Tue, 10 Nov 2009 12:03:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60D3A1939A; Tue, 10 Nov 2009 12:03:17 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0AE0B19392 for ; Tue, 10 Nov 2009 12:03:08 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE36Xp015758 for ; Tue, 10 Nov 2009 12:03:06 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAAE3Wn05015; Tue, 10 Nov 2009 12:03:32 -0200 Date: Tue, 10 Nov 2009 12:03:26 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110120325.A5008@lua.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> <4AF96FD9.4000102@inconcertcc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4AF96FD9.4000102@inconcertcc.com>; from ignaciob@inconcertcc.com on Tue, Nov 10, 2009 at 11:51:21AM -0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Accented characters in urls should be escaped. See if this works for you: > > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv Yes, that worked, thanks. Apparently it has to be UTF not LATIN either. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:06:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE6B0t016369; Tue, 10 Nov 2009 12:06:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B005193A5; Tue, 10 Nov 2009 12:05:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 005241939E for ; Tue, 10 Nov 2009 12:05:42 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE5fox016295 for ; Tue, 10 Nov 2009 12:05:41 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAAE67R05051; Tue, 10 Nov 2009 12:06:07 -0200 Date: Tue, 10 Nov 2009 12:06:06 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110120606.B5008@lua.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <89d273ba0911100557h7fd4241bl1e7cc4260cc630ca@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <89d273ba0911100557h7fd4241bl1e7cc4260cc630ca@mail.gmail.com>; from jerome.vuarand@gmail.com on Tue, Nov 10, 2009 at 02:57:47PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > In the few ones I've tried the sound is awful Sorry about that. > (some of the presentations are not in english, right ?). Yes, most of them are in Portuguese. > Has the sound been recorded separately with better quality somewhere > and waiting to be remixed ? Not that I know. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:07:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE6xFo016537; Tue, 10 Nov 2009 12:06:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B02A4193B2; Tue, 10 Nov 2009 12:06:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D86E193A8 for ; Tue, 10 Nov 2009 12:06:29 -0200 (BRST) Received: by gxk26 with SMTP id 26so46802gxk.1 for ; Tue, 10 Nov 2009 06:06:27 -0800 (PST) Received: by 10.100.15.18 with SMTP id 18mr94665ano.60.1257861985468; Tue, 10 Nov 2009 06:06:25 -0800 (PST) Received: from burninglabs.com ([71.21.67.37]) by mx.google.com with ESMTPS id 5sm299611ywd.38.2009.11.10.06.06.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 06:06:25 -0800 (PST) Date: Tue, 10 Nov 2009 08:06:17 -0600 From: Phoenix Sol To: lua@bazar2.conectiva.com.br Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART Message-ID: <20091110080617.0f6bfecb@burninglabs.com> In-Reply-To: <87skcnbmvd.fsf@mid.deneb.enyo.de> References: <87639muqe9.fsf@mid.deneb.enyo.de> <20091109104342.A31361@lua.tecgraf.puc-rio.br> <87skcnbmvd.fsf@mid.deneb.enyo.de> Organization: burninglabs X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 09 Nov 2009 18:59:18 +0100 Florian Weimer wrote: > If you want to call fork() from Lua code, you have to disable the GC > so that finalization doesn't occur both in the child and the parent. > If this happens in a library routine, you need to make sure that the > code composes with callers needing to disable GC as well. And this > means that you need some sort of counter. Could you please elaborate on this a bit? I'm having difficulty understanding the problem. I'm building an application that uses nixio.fork() to create worker processes. I haven't noticed any problem using fork() yet. Here is nixio's implementation of fork(): static int nixio_fork(lua_State *L) { pid_t pid = fork(); if (pid == -1) { return nixio__perror(L); } else { lua_pushinteger(L, pid); return 1; } } Dead simple. It does nothing with the Lua GC, and as I said above, I don't see why it should. If it's application code that must be careful using this with reqard to the GC, then I'd really appreciate a head's up. Thanks. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:07:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAE7c1d016711; Tue, 10 Nov 2009 12:07:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 44C9D193BB; Tue, 10 Nov 2009 12:07:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from vhosts12.montevideo.net.uy (vhosts12.montevideo.net.uy [200.40.51.14]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88297193A8 for ; Tue, 10 Nov 2009 12:07:03 -0200 (BRST) MailScanner-NULL-Check: 1258466804.91869@T1zgwf8OI5HOY2jsX6k2ag Received: from [192.168.22.156] (r200-40-68-22.ae-static.anteldata.net.uy [200.40.68.22]) (authenticated bits=0) by vhosts12.montevideo.net.uy (8.13.1/8.13.1) with ESMTP id nAAE6Yei018061 for ; Tue, 10 Nov 2009 12:06:41 -0200 Message-ID: <4AF9735F.5010407@inconcertcc.com> Date: Tue, 10 Nov 2009 12:06:23 -0200 From: =?ISO-8859-1?Q?Ignacio_Burgue=F1o?= Organization: Tecnolink User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: videos of the Lua Workshop 2009 References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> <4AF96FD9.4000102@inconcertcc.com> <20091110120325.A5008@lua.tecgraf.puc-rio.br> In-Reply-To: <20091110120325.A5008@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MontevideoCOMM-MailScanner-Information: Please contact the ISP for more information X-MontevideoCOMM-MailScanner: Found to be clean X-MontevideoCOMM-MailScanner-SpamCheck: no es spam (whitelisted) X-MontevideoCOMM-MailScanner-From: ignaciob@inconcertcc.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: >> Accented characters in urls should be escaped. See if this works for you: >> >> http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv > > Yes, that worked, thanks. Apparently it has to be UTF not LATIN either. > Good! So the fixed playlist is available here: http://pastebin.com/f3bfdd30d From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:10:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEA3Hh017256; Tue, 10 Nov 2009 12:10:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D025193A3; Tue, 10 Nov 2009 12:09:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EA008192C6 for ; Tue, 10 Nov 2009 12:09:36 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7rPc-00085B-00; Tue, 10 Nov 2009 15:09:36 +0100 Date: Tue, 10 Nov 2009 15:09:30 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 and string.dump Message-ID: <20091110140930.GA11925@mike.de> References: <4AF9310A.8090408@013net.net> <20091110092453.GA14595@mike.de> <956373d40911100601g547d03c7le0cf4faee24f0429@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <956373d40911100601g547d03c7le0cf4faee24f0429@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Fabien wrote: > do you plan at some point to document the bytecode format you're using? Well, yes. When it stabilizes. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:12:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAECWkU017895; Tue, 10 Nov 2009 12:12:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4DEE9193C2; Tue, 10 Nov 2009 12:12:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from hpelbers.org (hpelbers.org [74.54.162.177]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCE0A193A8 for ; Tue, 10 Nov 2009 12:11:58 -0200 (BRST) Received: from localhost ([127.0.0.1]) by gauri.webserversystems.com with esmtpa (Exim 4.69) (envelope-from ) id 1N7rRu-0007Uv-5D for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 08:11:58 -0600 Received: from 77.165.148.98 ([77.165.148.98]) by hpelbers.org (Horde MIME library) with HTTP; Tue, 10 Nov 2009 08:11:58 -0600 Message-ID: <20091110081158.lseetnop7os4owgc@hpelbers.org> Date: Tue, 10 Nov 2009 08:11:58 -0600 From: hans elbers To: lua@bazar2.conectiva.com.br Subject: Re: table output References: <20091110095730.72815afb@o> <20091110141111.4a908209@o> In-Reply-To: <20091110141111.4a908209@o> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gauri.webserversystems.com X-AntiAbuse: Original Domain - bazar2.conectiva.com.br X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hpelbers.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAECWkU017895 On Tue, 2009-11-10 at 14:11 +0100, spir wrote: Le Tue, 10 Nov 2009 10:35:53 +0000, > Duncan Cross s'exprima ainsi: > > There is no such standard function, and I believe the main reason is > > loops - a table might (directly or indirectly) contain fields that > > refer to the table itself. For example, the global variable _G is a > > reference to the global variables table itself, so if you try to use > > your function to display _G then it will get into an infinite loop > > trying to display _G._G._G._G... > > Right. > > > Now, of course you can rewrite your print function to keep track of > > the hierarchy and stop itself when it detects it is about to go into > > an infinite loop. But, what do you output instead? It is not trivial > > to be concise, meaningful, unambiguous and fit for all purposes here, > > as a standard function would have to be. > > Have no idea how to identify the root table itself (after, I'm a > beginner -- but see also (*)) as we get the object, while nested > ones can be identified while walking, sure. > As I said, the output needs not be perfect and a simple placeholder like > would be fine for me. > That's exactly what 'print_r' does (I use it for debugging): http://www.hpelbers.org/lua/print_r It is not intended for serializing, but it's very handy for debugging (or even to see what functions are in a loaded module (just do pr(_G) and scroll around in the output) require 'print_r' circle={} abcd = {a=1, b=2, c=3, d=4, ref=circle} circle['abcd']= '123' circle[abcd] = '456' circle[print] = 'the standard print function' circle['zorro'] = abcd -- circular reference pr(circle, 'my circle' This prints: my circle = { | function: 0x870a020 = "the standard print function" | zorro = { | | a = 1 | | c = 3 | | b = 2 | | d = 4 | | ref = {} -- my circle (self reference) | } | table: 0x870e288 = "456" | abcd = "123" } From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:26:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEQIK4020605; Tue, 10 Nov 2009 12:26:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5CC2193A8; Tue, 10 Nov 2009 12:25:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C8C519395 for ; Tue, 10 Nov 2009 12:25:44 -0200 (BRST) Received: by fxm21 with SMTP id 21so63060fxm.21 for ; Tue, 10 Nov 2009 06:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Oj98m32nV0u9Sz7iqE1W3lHBPJ01K4fakDS93MWugqI=; b=ZSv/R/2xeKDT+ZE0gb3D4hoGcbAWFfKs8HWFXFXqKFIiRDfx4bBU1YI37ev2oFvz/t dDb59EEPwFoVAMkUJ/rQx57VVg4vDO+Lm+uytXcDT3imIssNjtU1pT04+kTyKKUu56oC BjnO+jhh4DeX8Yn6nJ3u9lm5pKq67bVlygmbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FBQo/MGyD3Hgk6fKtOEt5wKYitF3SwG+AWMpV11bx2p14pEuKmlO7Zy0PRQ5ogeB9W fx5lxY7rphQdXEifyc9rUa5UbIZVGsVC6aPybesbGz3Frb0SUz9r1o9dhPrJoJVdkGep 1m4XnPWs7fBWlN5FRvsjjXaAoE4rjY3pFzU8I= MIME-Version: 1.0 Received: by 10.239.168.154 with SMTP id k26mr14052hbe.104.1257863141127; Tue, 10 Nov 2009 06:25:41 -0800 (PST) In-Reply-To: <20091110081158.lseetnop7os4owgc@hpelbers.org> References: <20091110095730.72815afb@o> <20091110141111.4a908209@o> <20091110081158.lseetnop7os4owgc@hpelbers.org> Date: Tue, 10 Nov 2009 16:25:41 +0200 Message-ID: <560972290911100625y6bb6ff9ct994b969a39626936@mail.gmail.com> Subject: Re: table output From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAEQIK4020605 On Tue, Nov 10, 2009 at 4:11 PM, hans elbers wrote: > It is not intended for serializing, but it's very handy for debugging (or > even to see what functions are in a loaded module (just  do pr(_G) and > scroll around in the output) That's exactly it - if just for debugging you don't have to worry about the result being exactly parseable again by Lua in all circumstances. And yes, we all have one of those in our toolboxes! http://penlight.luaforge.net/api/modules/pl.pretty.html BTW, it's a Lua FAQ question, which has some handy references: http://batbytes.com/luafaq/#T1.15 steve d. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:33:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEXR68021914; Tue, 10 Nov 2009 12:33:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12119193D0; Tue, 10 Nov 2009 12:32:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CE1B1939B for ; Tue, 10 Nov 2009 12:32:51 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N7rm0-0004eG-BT for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 15:32:44 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N7rlz-0004gR-RA for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 15:32:43 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: videos of the Lua Workshop 2009 References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> Date: Tue, 10 Nov 2009 15:32:43 +0100 In-Reply-To: <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> (steve donovan's message of "Tue, 10 Nov 2009 14:36:15 +0200") Message-ID: <87skcme9h0.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAEXR68021914 * steve donovan: > On Tue, Nov 10, 2009 at 1:22 PM, Luiz Henrique de Figueiredo > wrote: >> The videos of the talks given at the Lua Workshop 2009 are available at >>        http://puc-riodigital.com.puc-rio.br/ > > I notice that according to wget these are very small 'stubs', which is > a problem with the slow link I've got here. > > Anyway to grab them & play them later? mimms should be able to do it. You just need the correct URL. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:34:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEY3fr022065; Tue, 10 Nov 2009 12:34:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 71CCB193D8; Tue, 10 Nov 2009 12:33:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B6272193D3 for ; Tue, 10 Nov 2009 12:33:13 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAAEXDAI013675 for ; Tue, 10 Nov 2009 12:33:13 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 175A954C1D0; Tue, 10 Nov 2009 12:33:13 -0200 (BRST) Date: Tue, 10 Nov 2009 12:33:13 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: table output Message-ID: <20091110143313.GA22311@inf.puc-rio.br> References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> <20091110132502.780f17a8@o> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091110132502.780f17a8@o> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > I'm sure everyone on this list has written a table serializer at some > > point. Here's mine: > > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/serializer/init.lua > > > > wes > > Should this reply be understood as "there is a need for this in core lua"? I think it should be understood as "it is not trivial to be concise, meaningful, unambiguous and fit for all purposes here, as a standard function would have to be." (thanks to Duncan.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:39:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEd43O023117; Tue, 10 Nov 2009 12:39:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BFB1193E2; Tue, 10 Nov 2009 12:38:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f204.google.com (mail-px0-f204.google.com [209.85.216.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72351193CD for ; Tue, 10 Nov 2009 12:38:31 -0200 (BRST) Received: by pxi42 with SMTP id 42so45816pxi.5 for ; Tue, 10 Nov 2009 06:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=L+eE739X0ypBVqiCvp4SJ2gw0kSIpCiZBeTyHby9p0g=; b=J4f1Tr9KsboaT0paAw3yBSP5pI7AsU90Vh+BsB5g3VnwksNzNAJFXRMv/RXri+4C1J 8znmUWeCfXN08M+EyW3cBa6PanfId7FC0JbhfhLIpIGcdxesx8q1mYxEaKz/NGepPRF+ OIOWe3NrESkC85IiPCsDvwbYPK0Tg8wnrBPg0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=MLNNjGT8esPzEkQOTsWc7l10TREY7TIrMztekQRhiLNTUL95vr3yGHnHGxWbV/8NVv VUcSEEIlHFKtuDEmlde9Uu904xxa/K+7z9skVyvfxeKpzbVFOgpUBGz7mZY7T42OvBIo +IBBQX31LVYhLcOzyN4ldiCBbddB2jtwygfTo= MIME-Version: 1.0 Received: by 10.140.208.15 with SMTP id f15mr7713rvg.49.1257863896035; Tue, 10 Nov 2009 06:38:16 -0800 (PST) In-Reply-To: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> Date: Tue, 10 Nov 2009 17:38:16 +0300 Message-ID: Subject: Re: table output From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAEd43O023117 On Tue, Nov 10, 2009 at 12:44, Wesley Smith wrote: > I'm sure everyone on this list has written a table serializer at some > point.  Here's mine: > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/serializer/init.lua And here are ours (from not-yet-released Lua library lua-nucleo): -- tstr to print data to user (does not support recursive tables, "corrupts" non-serializable types by converting them to human-readable string) http://github.com/lua-nucleo/lua-nucleo/blob/master/lua-nucleo/tstr.lua -- tserialize to serialize data for computer consumption. It is less readable, relatively slower, but supports recursive tables http://github.com/lua-nucleo/lua-nucleo/blob/master/lua-nucleo/tserialize.lua If you need multiline output, we have tpretty() in the works... but it is not ready yet. :-) These implementations are quite fast (at least according to my humble benchmarks). If you see faster pure-Lua serializer / dumper with comparable features, please tell me :-) Alexander. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:46:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEknMD024504; Tue, 10 Nov 2009 12:46:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B731B193EB; Tue, 10 Nov 2009 12:46:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 037F4193C0 for ; Tue, 10 Nov 2009 12:46:18 -0200 (BRST) Received: by ewy26 with SMTP id 26so102983ewy.5 for ; Tue, 10 Nov 2009 06:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=S1zK23YUA+xINd3y1wPm+mMoOXY197/F/FU6EpFC4/Y=; b=DG/7MRt00IAnS2yA7jQcOIiyY9Xj6kWvV+FF5Hcd5qwDiEqsOdzBj7r6koK3HT17W3 y4vW7XxX4MnwsZIo/Ym9RBYeocir6h2cL6jQxBljycynY1SF8Dc1T32ZdNlLP9xUvDEL XqFw4/71JWd8q980C0M8aRia0NpvdKiX25otk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Vgr41URJuZSwncPs/hJ0QuCCgwWZl859mMDSm37796uPnOgBIbdLXdFpnDn9XHKp5a BxaW9qc1SCV1NVWqKbCU8ce1ohQ7ec1/OORxU0kLVGPrz9vfmhzwU2H5fk3FRcHvux+u HaOVvxFkYlb3R1PKt/JvkQhbojgSiQjr6iLMA= MIME-Version: 1.0 Received: by 10.213.0.131 with SMTP id 3mr1155390ebb.68.1257864376159; Tue, 10 Nov 2009 06:46:16 -0800 (PST) In-Reply-To: <20091110084333.GA12856@mike.de> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> From: Anders Bergh Date: Tue, 10 Nov 2009 15:45:56 +0100 Message-ID: <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> Subject: Re: LuaJIT 2 vs. C modules built for Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 09:43, Mike Pall wrote: > I bet this can be changed with something as simple as adding -m32 > to the compiler and linker lines. Actually, quite a few Linux distributions do not support 32-bit compilation in their 64-bit versions, and configuring gcc to do this is kind of painful when your system can't compile 32-bit code... -- Anders Bergh From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:52:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEq8jt026075; Tue, 10 Nov 2009 12:52:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF80C193F5; Tue, 10 Nov 2009 12:51:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8ECFF193F0 for ; Tue, 10 Nov 2009 12:51:39 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so1089640fga.17 for ; Tue, 10 Nov 2009 06:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xNxy7avJDvrsHRW4hRSX9DiMJyT1o+dzPwt+tKo03ZE=; b=SE79xMLb+CyiKmH/PVlZQGacKcNni2dzNcvdwjnOyzAMOZDEn35KbfWxIhUPS0zC3z vPCaHGFNecPbn46I/REkT0oR+JCcWqSic+qZZVkpYIXXm33eCjn5Q7XKNwNX9sHsChH8 Pev0H3gUqYbVlG4L4eV5dcF8xbtO5ATv2g0FI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LVbcTYL9MynkQsWnKnFOSyU5Ciu2C2i46wZ4wUWTG6A4CUVv0dCqaMTRPiLWjukN3n XtnHG/nRE+WApY722V9OWTPnfCL2uXXZeWoxuX4tRLHJ39dPnkltWDJbMR+9u+PdS+0u Ko5YKqP8xFQdV2lrUmxzg7TFUqYmpUU2ETtYs= MIME-Version: 1.0 Received: by 10.239.138.12 with SMTP id n12mr18303hbn.69.1257864696612; Tue, 10 Nov 2009 06:51:36 -0800 (PST) In-Reply-To: <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> Date: Tue, 10 Nov 2009 16:51:36 +0200 Message-ID: <560972290911100651s6081f878tcdec583f57f38ac@mail.gmail.com> Subject: Re: LuaJIT 2 vs. C modules built for Lua From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 4:45 PM, Anders Bergh wrote: > Actually, quite a few Linux distributions do not support 32-bit > compilation in their 64-bit versions, and configuring gcc to do this > is kind of painful when your system can't compile 32-bit code... Virtual machines are good at this sort of thing ... ok, assuming then that the target host has the 32-bit libs you need. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:53:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEr7AO026307; Tue, 10 Nov 2009 12:53:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A526193FD; Tue, 10 Nov 2009 12:52:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 92CC8193F9 for ; Tue, 10 Nov 2009 12:52:19 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N7s4t-0002y2-Rc for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 15:52:15 +0100 Received: from faui26m.informatik.uni-erlangen.de ([131.188.32.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Nov 2009 15:52:15 +0100 Received: from siffiejoe by faui26m.informatik.uni-erlangen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Nov 2009 15:52:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philipp Janda Subject: Re: table output Date: Tue, 10 Nov 2009 15:51:55 +0100 Lines: 464 Message-ID: References: <20091110095730.72815afb@o> <20091110141111.4a908209@o> <20091110081158.lseetnop7os4owgc@hpelbers.org> <560972290911100625y6bb6ff9ct994b969a39626936@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090108060707080909060601" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: faui26m.informatik.uni-erlangen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) In-Reply-To: <560972290911100625y6bb6ff9ct994b969a39626936@mail.gmail.com> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --------------090108060707080909060601 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Hi! steve donovan schrieb: > On Tue, Nov 10, 2009 at 4:11 PM, hans elbers wrote: >> It is not intended for serializing, but it's very handy for debugging (or >> even to see what functions are in a loaded module (just do pr(_G) and >> scroll around in the output) > > That's exactly it - if just for debugging you don't have to worry > about the result being exactly parseable again by Lua in all > circumstances. And in that case it's not necessary to use normal text as output at all. So here is my try using graphviz. It should handle cycles, metatables, environment tables and upvalues. I used it to debug __index-cycles in a mixture of generated and hand-written code (was a real mess). Source is public domain. HF, Philipp --------------090108060707080909060601 Content-Type: text/plain; name="dotlua.lua" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dotlua.lua" -- generate a graphviz graph from a lua table structure local function append( tab, ... ) for i = 1, select( '#', ... ) do tab[ #tab + 1 ] = (select( i, ... )) end return tab end local function abbrev( str, data ) local escape = "\\\\" if data.use_html then escape = "\\" end local s = string.gsub( str, "[^%w?!=/+*-_.:,; ]", function( c ) -- local s = string.gsub( str, "[^%w_]", function( c ) return escape .. string.byte( c ) end ) if string.len( s ) > 20 then s = string.sub( s, 1, 17 ) .. "..." end return "'" .. s .. "'" end local function update_node_depth( val, data, depth ) data.node2depth[ val ] = math.min( data.node2depth[ val ] or depth, depth ) end local function define_node( data, node ) assert( not data.node2id[ node.value ] ) local id = data.n_nodes data.n_nodes = data.n_nodes + 1 data.node2id[ node.value ] = id append( data.nodes, node ) return id end local function define_edge( data, edge ) append( data.edges, edge ) end local function get_metatable( val, enabled ) if enabled then if type( debug ) == "table" and type( debug.getmetatable ) == "function" then return debug.getmetatable( val ) elseif type( getmetatable ) == "function" then return getmetatable( val ) end end end local function get_environment( val, enabled ) if enabled then if type( debug ) == "table" and type( debug.getfenv ) == "function" then return debug.getfenv( val ) elseif type( getfenv ) == "function" and type( val ) == "function" then return getfenv( val ) end end end -- generate dot code for references local function dottify_metatable_ref( val, id1, mt, id2, data ) append( data.edges, { A = val, A_id = id1, B = mt, B_id = id2, style = "dashed", arrowtail = "odiamond", label = "metatable", color = "blue" } ) data.nodes[ data.node2id[ val ] ].important = true data.nodes[ data.node2id[ mt ] ].important = true end local function dottify_environment_ref( val, id1, env, id2, data ) append( data.edges, { A = val, A_id = id1, B = env, B_id = id2, style = "dotted", arrowtail = "dot", label = "environment", color = "red" } ) data.nodes[ data.node2id[ val ] ].important = true data.nodes[ data.node2id[ env ] ].important = true end local function dottify_upvalue_ref( val, id1, upv, id2, data, name ) append( data.edges, { A = val, A_id = id1, B = upv, B_id = id2, style = "dashed", label = name or "#upvalue", color = "green" } ) data.nodes[ data.node2id[ val ] ].important = true data.nodes[ data.node2id[ upv ] ].important = true end local function dottify_ref( val1, id1, val2, id2, data ) append( data.edges, { A = val1, A_id = id1, B = val2, B_id = id2, style = "solid", arrowhead = "normal", } ) end -- forward declarations local dottify_table, dottify_userdata, dottify_thread, dottify_function local function make_label( tab, v, data, id, subid, depth ) if type( v ) == "table" then local id2 = dottify_table( v, data, depth+1 ) dottify_ref( tab, id..":"..subid, v, id2..":0", data ) return tostring( v ) elseif type( v ) == "userdata" then local id2 = dottify_userdata( v, data, depth+1 ) dottify_ref( tab, id..":"..subid, v, id2, data ) return tostring( v ) elseif type( v ) == "function" then local id2 = dottify_function( v, data, depth+1 ) dottify_ref( tab, id..":"..subid, v, id2, data ) return tostring( v ) elseif type( v ) == "thread" then local id2 = dottify_thread( v, data, depth+1 ) dottify_ref( tab, id..":"..subid, v, id2, data ) return tostring( v ) elseif type( v ) == "string" then return abbrev( v, data ) elseif type( v ) == "number" or type( v ) == "boolean" then return tostring( v ) else error( "unsupported primitive lua type" ) end end function dottify_table( tab, data, depth ) assert( type( tab ) == "table" ) update_node_depth( tab, data, depth ) if not data.node2id[ tab ] then local node = { value = tab } local id = define_node( data, node ) local label -- build label for this table if data.use_html then node.shape = "plaintext" label = [[
]] else node.shape = "record" label = "{ <0> " .. tostring( tab ) end local handled = {} local n = 1 -- first the array part for i,v in ipairs( tab ) do local el_label = make_label( tab, v, data, id, n, depth ) if data.use_html then label = label .. [[ ]] else label = label .. " | <" .. n .. "> " .. el_label end n = n + 1 handled[ i ] = true end -- and then the hash part local keys, values = {}, {} for k,v in pairs( tab ) do node.important = true if not handled[ k ] then -- skip array part elements local k_label = make_label( tab, k, data, id, "k"..n, depth ) local v_label = make_label( tab, v, data, id, "v"..n, depth ) if data.use_html then label = label .. [[ ]] else append( keys, " " .. k_label ) append( values, " " .. v_label ) end n = n + 1 end end if data.use_html then node.label = label .. [[
]] .. tostring( tab ) .. [[
]] .. el_label .. [[
]] .. k_label .. [[ ]] .. v_label .. [[
]] else if next( keys ) ~= nil then label = label .. " | { { " .. table.concat( keys, " | " ) .. " } | { " .. table.concat( values, " | " ) .. " } }" end node.label = label .. " }" end -- and now the metatable local mt = get_metatable( tab, data.show_metatables ) if type( mt ) == "table" then local id2 = dottify_table( mt, data, depth+1 ) dottify_metatable_ref( tab, id .. ":0", mt, id2 .. ":0", data ) end end return data.node2id[ tab ] end function dottify_userdata( udata, data, depth ) assert( type( udata ) == "userdata" ) update_node_depth( udata, data, depth ) if not data.node2id[ udata ] then local id = define_node( data, { value = udata, label = tostring( udata ), shape = "box" } ) -- the metatable local mt = get_metatable( udata, data.show_metatables ) if type( mt ) == "table" then local id2 = dottify_table( mt, data, depth+1 ) dottify_metatable_ref( udata, id, mt, id2..":0", data ) end -- the environment local env = get_environment( udata, data.show_environments ) if type( env ) == "table" then local id2 = dottify_table( env, data, depth+1 ) dottify_environment_ref( udata, id, env, id2..":0", data ) end end return data.node2id[ udata ] end function dottify_thread( thread, data, depth ) assert( type( thread ) == "thread" ) update_node_depth( thread, data, depth ) if not data.node2id[ thread ] then local id = define_node( data, { value = thread, label = tostring( thread ), shape = "triangle" } ) -- the environment local env = get_environment( val, data.show_environments ) if type( env ) == "table" then local id2 = dottify_table( env, data, depth+1 ) dottify_environment_ref( thread, id, env, id2..":0", data ) end end return data.node2id[ thread ] end function dottify_function( func, data, depth ) assert( type( func ) == "function" ) update_node_depth( func, data, depth ) if not data.node2id[ func ] then local id = define_node( data, { value = func, label = tostring( func ), shape = "ellipse" } ) -- the environment local env = get_environment( func, data.show_environments ) if type( env ) == "table" then local id2 = dottify_table( env, data, depth+1 ) dottify_environment_ref( func, id, env, id2..":0", data ) end -- the upvalues if data.show_upvalues and type( debug ) == "table" and type( debug.getupvalue ) == "function" then local n = 1 repeat local name, upvalue = debug.getupvalue( func, n ) if type( upvalue ) == "table" then local id2 = dottify_table( upvalue, data, depth+1 ) dottify_upvalue_ref( func, id, upvalue, id2..":0", data, name ) elseif type( upvalue ) == "userdata" then local id2 = dottify_userdata( upvalue, data, depth+1 ) dottify_upvalue_ref( func, id, upvalue, id2, data, name ) elseif type( upvalue ) == "function" then local id2 = dottify_function( upvalue, data, depth+1 ) dottify_upvalue_ref( func, id, upvalue, id2, data, name ) elseif type( upvalue ) == "thread" then local id2 = dottify_thread( upvalue, data, depth+1 ) dottify_upvalue_ref( func, id, upvalue, id2, data, name ) end n = n + 1 until name == nil end end return data.node2id[ func ] end local option_names = { "label", "shape", "style", "dir", "arrowhead", "arrowtail", "color", "fillcolor" } local function process_options( obj ) local options = {} for _,opt in ipairs( option_names ) do if obj[ opt ] then local quote_on = "\"" local quote_off = "\"" if opt == "label" and type( obj[ opt ] ) == "string" and obj[ opt ]:match( "^<.*>$" ) then quote_on, quote_off = "<", ">" end append( options, tostring( opt ) .. "=" .. quote_on .. tostring( obj[ opt ] ) .. quote_off ) end end return options end local function write_nodes( file, data ) for _,n in ipairs( data.nodes ) do if (data.max_depth <= 0 or data.node2depth[ n.value ] <= data.max_depth) and (data.show_unimportant or n.important) then local options = process_options( n ) file:write( " ", tostring( data.node2id[ n.value ] ), " [", table.concat( options, "," ), "];\n" ) end end end local function write_edges( file, data ) for _,e in ipairs( data.edges ) do if (data.max_depth <= 0 or (data.node2depth[ e.A ] <= data.max_depth and data.node2depth[ e.B ] <= data.max_depth)) and (data.show_unimportant or (data.nodes[ data.node2id[ e.A ] ].important and data.nodes[ data.node2id[ e.B ] ].important)) then local id1 = e.A_id or data.node2id[ e.A ] local id2 = e.B_id or data.node2id[ e.B ] local options = process_options( e ) file:write( " ", tostring( id1 ), " -> ", tostring( id2 ), " [", table.concat( options, "," ), "];\n" ) end end end -- main function local function dottify( filename, val, ... ) local data = { n_nodes = 1, node2id = {}, node2depth = {}, nodes = {}, edges = {}, show_metatables = true, show_upvalues = true, show_environments = false, use_html = true, show_unimportant = false, max_depth = 0, } for i = 1, select( '#', ... ) do local opt = select( i, ... ) if opt == "noenvironments" then data.show_environments = false elseif opt == "nometatables" then data.show_metatables = false elseif opt == "noupvalues" then data.show_upvalues = false elseif opt == "nohtml" then data.use_html = false elseif opt == "environments" then data.show_environments = true elseif opt == "metatables" then data.show_metatables = true elseif opt == "upvalues" then data.show_upvalues = true elseif opt == "html" then data.use_html = true elseif opt == "unimportant" then data.show_unimportant = true elseif type( opt ) == "number" then data.max_depth = opt end end local t = type( val ) if t == "table" then local id = dottify_table( val, data, 1 ) data.nodes[ id ].important = true elseif t == "function" then local id = dottify_function( val, data, 1 ) data.nodes[ id ].important = true elseif t == "thread" then local id = dottify_thread( val, data, 1 ) data.nodes[ id ].important = true elseif t == "userdata" then local id = dottify_userdata( val, data, 1 ) data.nodes[ id ].important = true else io.stderr:write( "warning: unsuitable value for dotlua!\n" ) end local file = assert( io.open( filename, "w" ) ) file:write( "digraph {\n" ) write_nodes( file, data ) write_edges( file, data ) file:write( "}\n" ) file:close() end return dottify --------------090108060707080909060601-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 12:59:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAEx6o7027589; Tue, 10 Nov 2009 12:59:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C5AD193D2; Tue, 10 Nov 2009 12:58:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7B23A1939D for ; Tue, 10 Nov 2009 12:58:37 -0200 (BRST) Received: from Stutwo (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0LeNRl-1MKAku0U17-00qiZE; Tue, 10 Nov 2009 09:58:34 -0500 Message-ID: From: "Stuart P. Bentley" To: "Lua list" References: <4AF839AF.9040201@spellingbeewinnars.org> In-Reply-To: <4AF839AF.9040201@spellingbeewinnars.org> Subject: Re: Whats does your Lua Stack look like? Date: Tue, 10 Nov 2009 06:58:42 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX19HGTvodtMvWUEwMAz04nk62nAJabVkEQJsADH 7+4nraPne9f51S2WqC4weH7nM0l/b/na/yCd6KzAyL5FSstI1j Elaq1RN70HARQx9hWGmkWV06BHPU/Vh X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean My development stack: Windows Vista or 7 Lua for Windows That's about it. I'm juuuust starting to actually develop C Lua stuff. -------------------------------------------------- From: "Patrick" Sent: Monday, November 9, 2009 A7:47 Newsgroups: gmane.comp.lang.lua.general To: "Lua list" Subject: Whats does your Lua Stack look like? > Hi Everyone > > Again I am new to Lua and just learning my way around. I am trying to > figure how to use it appropriately in my projects. Where does Lua fit in > your stack? > > I would like to use Lua for web development and Desktop development. I > have not figured out things out but my web stack might look a bit like: > Ubuntu > Fast CGI server(Cherokee, Lightpd, Xavante etc) > WSAPI > My App or Orbit+ My App > My App or Kepler+My App > > My desktop stack might be: > Ubuntu > C language > Lua > Lua-Gnome or Browser for GUI > > Thanks for reading-Patrick > > > From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 13:56:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAFuiqc007481; Tue, 10 Nov 2009 13:56:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0721193E5; Tue, 10 Nov 2009 13:56:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7D6D419376 for ; Tue, 10 Nov 2009 13:56:04 -0200 (BRST) Received: from Stutwo (c-24-16-108-67.hsd1.wa.comcast.net [24.16.108.67]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0Lyo51-1M5FNN3QVb-015lPl; Tue, 10 Nov 2009 10:56:02 -0500 Message-ID: <462ADBF463E44913BAD911FA33A6B2D5@Stutwo> From: "Stuart P. Bentley" To: "Lua list" , References: <9ee46f950911051052x7c0ef831n8aec3cb05da2e7e1@mail.gmail.com> In-Reply-To: <9ee46f950911051052x7c0ef831n8aec3cb05da2e7e1@mail.gmail.com> Subject: Re: [Job] Wiki Administrator job - Lua knowledge a huge plus! Date: Tue, 10 Nov 2009 07:55:56 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Provags-ID: V01U2FsdGVkX1/qUT66pj/W+5j0o69ohfpOxs+Dzbib8v5iIZU AjOhvoBqGKgcm/8hqT5HJ6l2WPozeCbZxr+XyUxJw7IUKJkYQe Ea2jX2TMdWyhqphXwbnc0EMrlUFLJik X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The listing has expired - is this job still open? -------------------------------------------------- From: "Becky H." Sent: Thursday, November 5, 2009 A10:52 Newsgroups: gmane.comp.lang.lua.general To: Subject: [Job] Wiki Administrator job - Lua knowledge a huge plus! > ROBLOX is a virtual world and building game for kids, and our users > are passionate about sharing their ideas and helping each other. The > players build their own worlds and script them to life with Lua! This > job is part community manager, part wiki sysop, and part Lua expert. I > am hoping someone on this list is the right fit. :) > > http://sfbay.craigslist.org/pen/web/1414256964.html > > Check out www.roblox.com and search Youtube for "Roblox scripting" > > The wiki is a vital part of our website, both a resource for new users > and an outlet for experienced users to share their knowledge. Because > most of our users are kids and teens we have the interesting job of > making our wiki highly informational, yet usable and interesting for > users aged 7-15. We are continually adding new features and want to > start using the wiki more as our game grows more complex. We need > someone to take charge of our wiki and do the following: > - Serve as chief editor > - Create a new wiki front page > - Revamp and maintain key editorial pages > - Organize volunteers around topics that need the most work > - Assist, mentor, and monitor community editors > - Identify needed wiki features and help implement them > - Evangelize the wiki throughout the community > > We’re looking for someone who has experience with wikis, with > preference to applicants with prior editorial experience. Experience > with kid-targeted content would be a plus – our wiki has to be useful > to all our users, aged 7-15 and beyond. Lua knowledge is a huge plus! > We expect an initial “revamp” phase of 10-30 hours (over 2 to 3 > weeks), followed ongoing editorial and management work of 5 to 10 > hours per week. > > Send queries and resumes to job-qhv5h-1414256964@craigslist.org > > Remote work is possible, for awesome candidates. > > -Becky > From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:00:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAG0d76008672; Tue, 10 Nov 2009 14:00:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 50009193F0; Tue, 10 Nov 2009 14:00:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79FC5193DE for ; Tue, 10 Nov 2009 14:00:10 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7t8a-0008Bp-00; Tue, 10 Nov 2009 17:00:08 +0100 Date: Tue, 10 Nov 2009 16:59:53 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 vs. C modules built for Lua Message-ID: <20091110155953.GB15963@mike.de> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Anders Bergh wrote: > Actually, quite a few Linux distributions do not support 32-bit > compilation in their 64-bit versions, and configuring gcc to do this > is kind of painful when your system can't compile 32-bit code... IMHO non-multilib x64 distros are the exception rather than the norm. I wouldn't use such a distro, for sure. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:07:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAG7Ctl010209; Tue, 10 Nov 2009 14:07:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9037519400; Tue, 10 Nov 2009 14:06:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 336E4193EC for ; Tue, 10 Nov 2009 14:06:41 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAG6bec010081 for ; Tue, 10 Nov 2009 14:06:39 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id nAAG6bsZ010074 for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 14:06:37 -0200 Date: Tue, 10 Nov 2009 14:06:36 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-ID: <20091110160636.GA9717@duchamp.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> <4AF96FD9.4000102@inconcertcc.com> <20091110120325.A5008@lua.tecgraf.puc-rio.br> <4AF9735F.5010407@inconcertcc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF9735F.5010407@inconcertcc.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Good! So the fixed playlist is available here: > > http://pastebin.com/f3bfdd30d It's also permanently at http://www.lua.org/wshop09/videos.asx From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:14:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGEiMo011895; Tue, 10 Nov 2009 14:14:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 07AC41940F; Tue, 10 Nov 2009 14:14:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 702CF19409 for ; Tue, 10 Nov 2009 14:14:21 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N7tM3-0002b4-UP for ; Tue, 10 Nov 2009 16:14:03 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N7tMK-0001g3-9B for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 16:14:20 +0000 Date: Tue, 10 Nov 2009 16:14:19 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: LuaJIT 2 vs. C modules built for Lua Message-ID: <20091110161419.0987fb92@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091110155953.GB15963@mike.de> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> <976395530911100645y421823d9q59339764afadb91c@mail.gmail.com> <20091110155953.GB15963@mike.de> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 10 Nov 2009 16:59:53 +0100 Mike Pall wrote: > Anders Bergh wrote: > > Actually, quite a few Linux distributions do not support 32-bit > > compilation in their 64-bit versions, and configuring gcc to do this > > is kind of painful when your system can't compile 32-bit code... > > IMHO non-multilib x64 distros are the exception rather than the > norm. I wouldn't use such a distro, for sure. Debian and Ubuntu have hacky and basically unusable i386 support in their AMD64 editions. They have a handful of i386 libraries for running the odd thing, mostly packages they ship which are not AMD64-compatible. And that's fine. The only 32 bit thing I want to run is LuaJIT, so it's hardly a big thing. And the joy I'd get from running LuaJIT wouldn't offset the displeasure I'd get from running an i386 edition, or using Fedora (which does have passable multi-arch support.) B. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:17:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGCwEq011524; Tue, 10 Nov 2009 14:12:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E08519406; Tue, 10 Nov 2009 14:12:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 99628193FB for ; Tue, 10 Nov 2009 14:12:31 -0200 (BRST) Received: from duchamp.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGCUWp011449 for ; Tue, 10 Nov 2009 14:12:30 -0200 Received: (from lhf@localhost) by duchamp.tecgraf.puc-rio.br (8.12.11.20060308/8.12.11/Submit) id nAAGAGhc011036 for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 14:10:16 -0200 Date: Tue, 10 Nov 2009 14:10:15 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: photos of the Lua Workshop 2009? Message-ID: <20091110161015.GA10866@duchamp.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Does anyone have photos of the Lua Workshop 2009 to share? A URL to a web page index would be great. Thanks. --lhf From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:24:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGO7pu014020; Tue, 10 Nov 2009 14:24:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BE501940C; Tue, 10 Nov 2009 14:23:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A3F12193E8 for ; Tue, 10 Nov 2009 14:23:35 -0200 (BRST) Received: by bwz27 with SMTP id 27so188324bwz.21 for ; Tue, 10 Nov 2009 08:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=K3V6WQr1DeBOGhuTi1cJsU1hL6AuKWKsXkvOdxkBqaU=; b=GSYRDraNrpN7RPrEq2OELtjDqSNUYonwWOcCTfRey9A732VFAS0jsqDVVKkq2ikkw6 R2lcIE0jY8Gwch9SxXkXnYjwaz8sQLSpHAQ8DaU9477wshMS2SEW2BNFraTmeGCzu2Rm IpLQaffpZPuE8+OXwxAPfqfyJBGM75qktCZRA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=JHqdySragsE0isIZXUvJfOO0+Yqou/iCmXhoyjiXKjwauV0EK8yVY587bu/AmqfJnM 9dvzhX/oKqxLm6QZ3xXRtr/rJ6cIyeNAI4sg5qwIXJri4d03s5pma0tNzfKqNNkn1Bto YXXlqtL7Ez1LWQL0LEsYcKfnG5pU/BSvgEr/A= MIME-Version: 1.0 Received: by 10.204.156.210 with SMTP id y18mr290278bkw.80.1257870212135; Tue, 10 Nov 2009 08:23:32 -0800 (PST) In-Reply-To: References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> From: Hisham Date: Tue, 10 Nov 2009 14:23:12 -0200 Message-ID: <5e7d91620911100823y59f7a011q6b73e077d4d7c93a@mail.gmail.com> Subject: Re: LuaJIT 2 vs. C modules built for Lua To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 6:48 AM, Alexander Gladysh wrote: >>> Any standard way to workaround this issue on 64-bit Linux? I need to >>> keep both Lua and LuaJIT working. > >> You could use 32 bit Lua, too, even on 64 bit. > > Yes, this would suit me. > >>> I think that LuaRocks compiles Lua modules into 64-bits. > >> I bet this can be changed with something as simple as adding -m32 >> to the compiler and linker lines. > > If I'm to go that way, I need LuaRocks to do this automatically for > any module without me remembering this. I hope it has an option to do > this somewhere. Time to dig into the docs. :-) You can tweak your CC variable in your configuration file (~/.luarocks/config.lua) variables = { CC = "gcc -m32" -- or whatever set of flags you need. } You can peek at luarocks/cfg.lua and see what are the defaults. Now that I look at it, Mac OSX actually sets CC = "export MACOSX_DEPLOYMENT_TARGET=10.3; gcc" -- Hisham From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:29:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGTcT4015391; Tue, 10 Nov 2009 14:29:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3602119417; Tue, 10 Nov 2009 14:29:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 803CA19413 for ; Tue, 10 Nov 2009 14:28:55 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N7taN-0008DR-00; Tue, 10 Nov 2009 17:28:51 +0100 Date: Tue, 10 Nov 2009 17:28:42 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 vs. C modules built for Lua Message-ID: <20091110162842.GA17572@mike.de> References: <20091110082457.GB11131@mike.de> <20091110084333.GA12856@mike.de> <5e7d91620911100823y59f7a011q6b73e077d4d7c93a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e7d91620911100823y59f7a011q6b73e077d4d7c93a@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hisham wrote: > You can peek at luarocks/cfg.lua and see what are the defaults. Now > that I look at it, Mac OSX actually sets CC = "export > MACOSX_DEPLOYMENT_TARGET=10.3; gcc" Since I've been bitten by this: OSX Snow Leopard won't accept 10.3 anymore. Reportedly, setting it to 10.4 makes it work again. --Mike From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:38:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGcH94018013; Tue, 10 Nov 2009 14:38:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0C75186A0; Tue, 10 Nov 2009 14:37:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 584BD1941E for ; Tue, 10 Nov 2009 14:37:35 -0200 (BRST) Received: by fxm21 with SMTP id 21so204045fxm.21 for ; Tue, 10 Nov 2009 08:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EOg47tPCq7BvitYB7UEQ+6387FlgH4WRh2vCB7BA7uI=; b=vCwiF+JxtfFFlMRFzklRv1kpbN8i2Znvm2MOBx8uQB6za5DC8Y/27ohwTbLco4skpA khniU+Ge8IASPyPGsckQ8q04phn4VO39HxPIiKsb1N75VWf7CRfDWc3e/ti1MuZ+S1/c WdebmNm52LvU8fCKCJuZBVZqhYegEwa7A3b0Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lDEfozcqM9wqp/jEFBPXgXfNlyoHzEQ0PhnvWPEHlRKEal/+JXBkFeLIxZNSfPMRgq Alc/OLnu7L8fXlQPUFxw8VCfmqzbXdvty2V24EVlcz5KKt4F8cbeN+8tMKWQ9XnovHaT cEDr5JaSYXEAYShkqUP/hMTo6Z0h2vlKIXD2E= MIME-Version: 1.0 Received: by 10.204.148.85 with SMTP id o21mr278545bkv.134.1257871051839; Tue, 10 Nov 2009 08:37:31 -0800 (PST) In-Reply-To: References: <4AF839AF.9040201@spellingbeewinnars.org> Date: Tue, 10 Nov 2009 17:37:31 +0100 Message-ID: <4ff79edb0911100837m7b215687hceef81de1dcfcdc4@mail.gmail.com> Subject: Re: Whats does your Lua Stack look like? From: Francesco Abbate To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/10 Stuart P. Bentley : > My development stack: > > Windows Vista or 7 > Lua for Windows > > That's about it. I'm juuuust starting to actually develop C Lua stuff. May be you should have chosen Visual Basic .NET enterprise edition instead of Lua, even the London Stock Exchange was using this stack for their mission critical applications... :-) Francesco From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 14:43:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAGhp5a019122; Tue, 10 Nov 2009 14:43:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 82B181942C; Tue, 10 Nov 2009 14:43:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp20.orange.fr (smtp20.orange.fr [80.12.242.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2ACFD19427 for ; Tue, 10 Nov 2009 14:43:13 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2001.orange.fr (SMTP Server) with ESMTP id D402D2001F14 for ; Tue, 10 Nov 2009 17:43:07 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2001.orange.fr (SMTP Server) with ESMTP id C43452002091 for ; Tue, 10 Nov 2009 17:43:07 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2001.orange.fr (SMTP Server) with ESMTP id 7B82F2001F24 for ; Tue, 10 Nov 2009 17:43:07 +0100 (CET) X-ME-UUID: 20091110164307505.7B82F2001F24@mwinf2001.orange.fr Date: Tue, 10 Nov 2009 17:43:07 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: table output Message-ID: <20091110174307.15f9283b@o> In-Reply-To: <20091110081158.lseetnop7os4owgc@hpelbers.org> References: <20091110095730.72815afb@o> <20091110141111.4a908209@o> <20091110081158.lseetnop7os4owgc@hpelbers.org> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 10 Nov 2009 08:11:58 -0600, hans elbers s'exprima ainsi: > On Tue, 2009-11-10 at 14:11 +0100, spir wrote: > Le Tue, 10 Nov 2009 10:35:53 +0000, > > Duncan Cross s'exprima ainsi: > > > There is no such standard function, and I believe the main reason is > > > loops - a table might (directly or indirectly) contain fields that > > > refer to the table itself. For example, the global variable _G is a > > > reference to the global variables table itself, so if you try to use > > > your function to display _G then it will get into an infinite loop > > > trying to display _G._G._G._G... > > > > Right. > > > > > Now, of course you can rewrite your print function to keep track of > > > the hierarchy and stop itself when it detects it is about to go into > > > an infinite loop. But, what do you output instead? It is not trivial > > > to be concise, meaningful, unambiguous and fit for all purposes here, > > > as a standard function would have to be. > > > > Have no idea how to identify the root table itself (after, I'm a > > beginner -- but see also (*)) as we get the object, while nested > > ones can be identified while walking, sure. > > As I said, the output needs not be perfect and a simple placeholder like > > would be fine for me. > > > > > That's exactly what 'print_r' does (I use it for debugging): > http://www.hpelbers.org/lua/print_r > > It is not intended for serializing, but it's very handy for debugging > (or even to see what functions are in a loaded module (just do pr(_G) > and scroll around in the output) > > require 'print_r' > circle={} > abcd = {a=1, b=2, c=3, d=4, ref=circle} > circle['abcd']= '123' > circle[abcd] = '456' > circle[print] = 'the standard print function' > circle['zorro'] = abcd -- circular reference > pr(circle, 'my circle' > > This prints: > > my circle = { > | function: 0x870a020 = "the standard print function" > | zorro = { > | | a = 1 > | | c = 3 > | | b = 2 > | | d = 4 > | | ref = {} -- my circle (self reference) > | } > | table: 0x870e288 = "456" > | abcd = "123" > } Thank you very much, that's exactly what I had in mind. Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 15:03:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAH2xfK023286; Tue, 10 Nov 2009 15:02:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72EEC1943E; Tue, 10 Nov 2009 15:02:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2a.orange.fr (smtp2a.orange.fr [80.12.242.140]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C114319430 for ; Tue, 10 Nov 2009 15:02:19 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a16.orange.fr (SMTP Server) with ESMTP id 7DDF680000A7 for ; Tue, 10 Nov 2009 18:02:15 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a16.orange.fr (SMTP Server) with ESMTP id 70D8580002E0 for ; Tue, 10 Nov 2009 18:02:15 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2a16.orange.fr (SMTP Server) with ESMTP id 6526180000A7 for ; Tue, 10 Nov 2009 18:02:13 +0100 (CET) X-ME-UUID: 20091110170213414.6526180000A7@mwinf2a16.orange.fr Date: Tue, 10 Nov 2009 18:02:13 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: table output Message-ID: <20091110180213.4e702808@o> In-Reply-To: <20091110143313.GA22311@inf.puc-rio.br> References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> <20091110132502.780f17a8@o> <20091110143313.GA22311@inf.puc-rio.br> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 10 Nov 2009 12:33:13 -0200, Roberto Ierusalimschy s'exprima ainsi: > > > I'm sure everyone on this list has written a table serializer at some > > > point. Here's mine: > > > http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/serializer/init.lua > > > > > > wes > > > > Should this reply be understood as "there is a need for this in core lua"? > > I think it should be understood as "it is not trivial to be concise, > meaningful, unambiguous and fit for all purposes here, as a standard > function would have to be." (thanks to Duncan.) > > -- Roberto > Well, while I understand that one can have this point of view, it's still surprising for me. From a rather practicle and everyday programming side, table output needs not be perfect, nore fit every possible use case, to be _extremely_ handy anyway. (Again, I'm not talking about serialization, or any other kind of machine-readable representation, even if it may also be, I'm talking of human feedback.) Nothing has to be perfect in a PL, no feature fits all purposes (think at tables themselves ;-). People customize or build their own tools when needed. About output func, while I don't mean at all that commonly implemented features are supposed to be best, all languages I know output by default the content of their collection type(s), and most programmers use this feature numerous times every day; it's also the degbugging tool #1. Now, I'll stop arguing ;-) Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 15:22:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAHMdfT028142; Tue, 10 Nov 2009 15:22:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E8D3A19446; Tue, 10 Nov 2009 15:22:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1102C19433 for ; Tue, 10 Nov 2009 15:22:03 -0200 (BRST) Received: by ewy26 with SMTP id 26so276267ewy.5 for ; Tue, 10 Nov 2009 09:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=xYFAlpyhVb3l4+pAws64c7prE93FvP1NNhwBVeyOFkU=; b=G515t9G4f63PdeFFIclsA/J6WmFWwka+NiNsujgZyQ6iJTXb4NzLdkv+kzQDxuPn2b Jn3PnP7GupI1wG5VKQgppY7zplXWGIL+c3XQ8RWxO/dwZZy6EZAbiUh4v0WoX5AKsgoR PgFS6QdIN70Iw1fV7phREEB02oBbGB26uRm9I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=CxzpKFFW9bOa8U7Ywug8md6hZmOa5pWCMvVPyYVr0vdyu1rD0yuZNKk9iN0NRLnOCM A7OTEdtVOnx09tGTQ4O033YUicQMt5nwCqUgPzdgfuj44Q6x5x0ZMGtjrOo9IUEHSlwK /i5TSXXqOPQWw9Bbq8fEKwg7P6TkkyOmXOCZ0= MIME-Version: 1.0 Received: by 10.216.86.135 with SMTP id w7mr101003wee.176.1257873720626; Tue, 10 Nov 2009 09:22:00 -0800 (PST) From: Jerome Vuarand Date: Tue, 10 Nov 2009 18:21:40 +0100 Message-ID: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> Subject: LuaSocket: asynchronous connect on Windows not behaving properly To: Lua Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi list, I'm trying to write a copas-like module that handles both incoming and outgoing connections. Since the socket:connect operation can take some time, and I may have other sockets ready to do something, I'm setting the timeout to zero, I call connect, but then select is not working as expected on Windows. Here is a test script: #!/usr/bin/env lua require 'socket' function test(ip, port) local master = assert(socket.tcp()) master:settimeout(0) print(master) local success,err = master:connect(ip, port) print(master, success, err) if not success and err=='timeout' then socket.select({}, {master}) success,err = master:connect(ip, port) print(master, success,err) end end print("valid address 1") test('127.0.0.1', 80) print("valid address 2") test('127.0.0.1', 2000) print("invalid address") test('127.0.0.1', 44444) Note that I have a server on port 80 (Apache), and a custom LuaSocket server on port 2000. There is nothing on port 44444. On Linux, select returns as soon as the connection status is known. I have to call connect again to determine if it succeeded or not, here is the log: doub@blimbox:~/test$ lua test valid address 1 tcp{master}: 0x80738d4 tcp{client}: 0x80738d4 nil timeout tcp{client}: 0x80738d4 1 nil valid address 2 tcp{master}: 0x8075b0c connection on PIC tcp{client}: 0x8075b0c nil timeout tcp{client}: 0x8075b0c 1 nil invalid address tcp{master}: 0x8077d4c tcp{client}: 0x8077d4c nil timeout tcp{client}: 0x8077d4c nil connection refused doub@blimbox:~/test$ On Windows however, when the connection succeeds, the socket is already connected and calling connect again triggers an error. And if the connection fails, select never returns. Note the Ctrl+C in the log that I had to do to kill the program : C:\test>lua test valid address 1 tcp{master}: 00465008 tcp{client}: 00465008 nil timeout tcp{client}: 00465008 nil already connected valid address 2 tcp{master}: 00467078 tcp{client}: 00467078 nil timeout tcp{client}: 00467078 nil already connected invalid address tcp{master}: 00469150 tcp{client}: 00469150 nil timeout ^C C:\test> On both platforms I'm using LuaSocket 2.0.2. Can anybody else reproduce the problem ? Is there a known workaround ? I haven't tried the 2.0.3 beta, should I ? Any help would be appreciated. Doub. From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 15:45:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAHjPMl001817; Tue, 10 Nov 2009 15:45:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFAE419447; Tue, 10 Nov 2009 15:44:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E4191942F for ; Tue, 10 Nov 2009 15:44:51 -0200 (BRST) Received: by yxe17 with SMTP id 17so221971yxe.33 for ; Tue, 10 Nov 2009 09:44:50 -0800 (PST) Received: by 10.101.26.5 with SMTP id d5mr601963anj.129.1257875082428; Tue, 10 Nov 2009 09:44:42 -0800 (PST) Received: from gandalf (201-34-153-164.jvece701.dsl.brasiltelecom.net.br [201.34.153.164]) by mx.google.com with ESMTPS id 8sm446618yxb.7.2009.11.10.09.44.38 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 09:44:41 -0800 (PST) Date: Tue, 10 Nov 2009 15:45:39 -0200 From: Alexandre Erwin Ittner To: Lua list Subject: Re: videos of the Lua Workshop 2009 Message-Id: <20091110154539.a574fd98.alexandre@ittner.com.br> In-Reply-To: <20091110110120.A4592@lua.tecgraf.puc-rio.br> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <20091110110120.A4592@lua.tecgraf.puc-rio.br> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.12.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote > > Anyway to grab them & play them later? > > Not that I know of. If anyone knows, please share. I've successfully saved one video (to an Ogg container with Theora and Speex encoders) using an old VLC 0.8.6, but I'm on a slow network and can not save the others... Att. -- Alexandre Erwin Ittner - alexandre@ittner.com.br OpenPGP pubkey 0x0041A1FB @ http://pgp.mit.edu From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 16:21:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAILLSo011054; Tue, 10 Nov 2009 16:21:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8DA481945A; Tue, 10 Nov 2009 16:20:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC85519447 for ; Tue, 10 Nov 2009 16:20:35 -0200 (BRST) Received: by ewy26 with SMTP id 26so342096ewy.5 for ; Tue, 10 Nov 2009 10:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=roa+kV8pW+xak4fut9pCZbSaY+qOtlOA5Z1b+lALXM8=; b=qID7OsGGJcFZk6TTVKW3hdkIGS72KVLyTs/HPx7VjdWZuWqfvei4qMtD2yl5seUPF4 CW8IKXo0nMWCBCqOB8R2LWF937jNkiemupGw/0s365CjBHOUaVZHRiQ3u5snWZVowo8v ObFV7ijvwNWHIJV0jY/3VHQgCmkW2RHcDi4Ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=QQfWu85OeQMSB6jTfVMbOoroMt/vY6A6BvsnmXp1AB/XiO+gmYXp7cNN7tl1JxlcuO Bt+SAETcWMU2HBiU48ajd9NlkiMUlgwFhMQ/I/qqY8fWlVaK7BPdKC5DYrLwALCy+x5V 6Dtq15MULZcFATdNxlBCOEdrQt47hw16Gtl14= Received: by 10.216.89.139 with SMTP id c11mr132006wef.198.1257877233883; Tue, 10 Nov 2009 10:20:33 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 10sm2252960eyd.2.2009.11.10.10.20.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 10:20:33 -0800 (PST) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: table output Date: Tue, 10 Nov 2009 19:20:21 +0100 References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 10, 2009, at 10:44 AM, Wesley Smith wrote: > I'm sure everyone on this list has written a table serializer at > some point. Me too! Me too! :P http://dev.alt.textdrive.com/browser/HTTP/Data.lua Mostly based on Programming in Lua, 12.1.2 - Saving Tables with Cycles: http://www.lua.org/pil/12.1.2.html More alternatives: http://lua-users.org/wiki/TableSerialization Usage example for Data.lua: local Data = require( 'Data' ) local a = {x = 1, y = 2, {3, 4, 5}} a[2] = a -- cycle a.z = a[1] -- shared subtable a.f = function(n) return n+1 end -- cross refs local b = {k = a[1]} a[3] = b print( Data( a ) ) _[1]={} _[1][1]=3 _[1][2]=4 _[1][3]=5 _[2]=_ _[3]={} _[3]["k"]=_[1] _["y"]=2 _["x"]=1 _ ["f "]= f "1b4c756151000104040408000e0000004054657374446174612e6c7561000a0000000a00000000010002030000004c0040005e0000011e0080000100000003000000000000f03f00000000030000000a0000000a0000000a00000001000000020000006e00000000000200000000000000 " _["z"]=_[1] From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 16:22:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAILvrv011217; Tue, 10 Nov 2009 16:21:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0103B19460; Tue, 10 Nov 2009 16:20:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39A941944E for ; Tue, 10 Nov 2009 16:20:35 -0200 (BRST) Received: by ewy26 with SMTP id 26so342105ewy.5 for ; Tue, 10 Nov 2009 10:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=bThrI4aYgXoso3Yztnb/UgNvs7O265jzhl9+zd0cYh8=; b=wMkMq6XNNpm9kB+608Umfpgf0qdcZt3kIQC7PEEBVLCfI+S8d3Bs0u8KF+MXr9HxwV LCmnoj+q7VoP+f4fJ0q+SVwUWkT0SqlB1+lVfHdpnyWVPP6YkVH5Bwil4y6Tukiu5yxD dqfTaRQTLzUisJgQ1kmf8Eq220Pv/aZNrNaP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=gLtiJLMU9W8XN/qcl84ncuzlerS67wFmaRpf3Boqn+ouDUh2ZImqko2XZpXRK3biVv U+cd8Wr0tskGwwyIVv55ZfUU60p87leIQpL162gBx+DEm5tXVli5PZNgSBeu4dOxIpvt hjgQdx06JNroN4MiTFuU51klx1+qWcZEDZ7vs= Received: by 10.213.100.11 with SMTP id w11mr509491ebn.34.1257877232801; Tue, 10 Nov 2009 10:20:32 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 10sm2252960eyd.2.2009.11.10.10.20.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 10:20:31 -0800 (PST) Message-Id: From: Petite Abeille To: Lua list In-Reply-To: <20091110180213.4e702808@o> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: table output Date: Tue, 10 Nov 2009 19:20:00 +0100 References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> <20091110132502.780f17a8@o> <20091110143313.GA22311@inf.puc-rio.br> <20091110180213.4e702808@o> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 10, 2009, at 6:02 PM, spir wrote: > Well, while I understand that one can have this point of view, it's > still surprising for me Welcome to Lua! It's a, hmmm, DIY kind of place :) "Lua gives you the power; you build the mechanisms." Roberto Ierusalimschy, Programming in Lua, 2003 http://www.lua.org/pil/12.1.2.html From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 17:17:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAJHq9N025146; Tue, 10 Nov 2009 17:17:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75C4519468; Tue, 10 Nov 2009 17:17:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp20.orange.fr (smtp20.orange.fr [80.12.242.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E54B19451 for ; Tue, 10 Nov 2009 17:17:09 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2016.orange.fr (SMTP Server) with ESMTP id E1BDB20000AE for ; Tue, 10 Nov 2009 20:17:04 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2016.orange.fr (SMTP Server) with ESMTP id D26DB20000A0 for ; Tue, 10 Nov 2009 20:17:04 +0100 (CET) Received: from o (AToulouse-553-1-203-226.w90-45.abo.wanadoo.fr [90.45.147.226]) by mwinf2016.orange.fr (SMTP Server) with ESMTP id 9D9DD20000AE for ; Tue, 10 Nov 2009 20:17:04 +0100 (CET) X-ME-UUID: 20091110191704645.9D9DD20000AE@mwinf2016.orange.fr Date: Tue, 10 Nov 2009 20:17:04 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: table output Message-ID: <20091110201704.476c4e78@o> In-Reply-To: References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> <20091110132502.780f17a8@o> <20091110143313.GA22311@inf.puc-rio.br> <20091110180213.4e702808@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAAJHq9N025146 Le Tue, 10 Nov 2009 19:20:00 +0100, Petite Abeille s'exprima ainsi: > > On Nov 10, 2009, at 6:02 PM, spir wrote: > > > Well, while I understand that one can have this point of view, it's > > still surprising for me > > Welcome to Lua! It's a, hmmm, DIY kind of place :) ça'm va! (it's all right for me!) > "Lua gives you the power; you build the mechanisms." > Roberto Ierusalimschy, Programming in Lua, 2003 > http://www.lua.org/pil/12.1.2.html > Good. So, is there a standard way of introducing a kind of customization? Either as a handy toolkit or for specific needs of an application. By "standard", I mean a kind of lua-style. I think at * a lua equivalent to subtyping builtin types * a lua equivalent to overloading "Object" (root obj/type) in a prototype-based PL [Note: I don't mean there should be such features, just to know.] Denis PS: I'm reading the 2 docs about evolu-a-tion pointed at http://www.lua.org/map.html, under "documentation": great! They answer loads why-s i intended to ask on the list one day or another. ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 17:57:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAJvkAL001059; Tue, 10 Nov 2009 17:57:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75C4A19484; Tue, 10 Nov 2009 17:57:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7AA6B1946C for ; Tue, 10 Nov 2009 17:56:55 -0200 (BRST) Received: by pzk34 with SMTP id 34so246991pzk.11 for ; Tue, 10 Nov 2009 11:56:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.154.29 with SMTP id g29mr52708wfo.267.1257882989660; Tue, 10 Nov 2009 11:56:29 -0800 (PST) In-Reply-To: <20091110095730.72815afb@o> References: <20091110095730.72815afb@o> Date: Tue, 10 Nov 2009 13:56:29 -0600 Message-ID: <576e7620911101156y3e7416f5gf8e30e4a9f067d6f@mail.gmail.com> Subject: Re: table output From: Steven Johnson To: Lua list Content-Type: multipart/mixed; boundary=001636e0b891c48c58047809b409 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636e0b891c48c58047809b409 Content-Type: text/plain; charset=ISO-8859-1 Another debugging one here. This one takes a formatted output function (and you can register one to act as the default) and then applies that line-by-line. The line-by-line thing lets us dump to arrays or other structures (e.g. a vector or linked list of strings on the C side), which can sometimes be easier to traverse. Also handles cycles and arbitrary keys, and respects __tostring; it ignores metatable and environment, though maybe I'll add those as options some day. Example: function printf (format, ...) print(string.format(format, ...)) end var_dump.Print(MyVariable, printf) -- Accepts any value, tables are just a special case or var_dump.SetDefaultOutf(printf) var_dump.Print(MyBigTable) License is MIT. --001636e0b891c48c58047809b409 Content-Type: application/octet-stream; name="VarDump.lua" Content-Disposition: attachment; filename="VarDump.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1v2w55o0 LS0gU2VlIFRhY29TaGVsbCBDb3B5cmlnaHQgTm90aWNlIGluIG1haW4gZm9sZGVyIG9mIGRpc3Ry aWJ1dGlvbg0KDQotLSBTdGFuZGFyZCBsaWJyYXJ5IGltcG9ydHMgLS0NCmxvY2FsIGFzc2VydCA9 IGFzc2VydA0KbG9jYWwgZm9ybWF0ID0gc3RyaW5nLmZvcm1hdA0KbG9jYWwgaW5zZXJ0ID0gdGFi bGUuaW5zZXJ0DQpsb2NhbCBpcGFpcnMgPSBpcGFpcnMNCmxvY2FsIHBhaXJzID0gcGFpcnMNCmxv Y2FsIHJhd2dldCA9IHJhd2dldA0KbG9jYWwgc29ydCA9IHRhYmxlLnNvcnQNCmxvY2FsIHRvc3Ry aW5nID0gdG9zdHJpbmcNCmxvY2FsIHR5cGUgPSB0eXBlDQoNCi0tIEltcG9ydHMgLS0NCmxvY2Fs IEhhc01ldGEgPSB2YXJfcHJlZHMuSGFzTWV0YQ0KbG9jYWwgSXNDYWxsYWJsZSA9IHZhcl9wcmVk cy5Jc0NhbGxhYmxlDQpsb2NhbCBJc0NhbGxhYmxlT3JOaWwgPSB2YXJfcHJlZHMuSXNDYWxsYWJs ZU9yTmlsDQpsb2NhbCBJc0ludGVnZXIgPSB2YXJfcHJlZHMuSXNJbnRlZ2VyDQotLWxvY2FsIFN1 YlRhYmxlc09uRGVtYW5kID0gdGFibGVfZXguU3ViVGFibGVzT25EZW1hbmQNCg0KbG9jYWwgc2V0 bWV0YXRhYmxlID0gc2V0bWV0YXRhYmxlDQoNCmxvY2FsIHN0b2RfbWV0YSA9IHsNCglfX2luZGV4 ID0gZnVuY3Rpb24odCwgaykNCgkJdFtrXSA9IHt9DQoNCgkJcmV0dXJuIHRba10NCgllbmQNCn0N Cg0KbG9jYWwgZnVuY3Rpb24gU3ViVGFibGVzT25EZW1hbmQgKCkNCglyZXR1cm4gc2V0bWV0YXRh YmxlKHt9LCBzdG9kX21ldGEpDQplbmQNCg0KLS0gRXhwb3J0IG5hbWVzcGFjZS4NCm1vZHVsZSAi dmFyX2R1bXAiDQoNCi0tIERlZmF1bHQgb3V0cHV0IGZ1bmN0aW9uIC0tDQpsb2NhbCBEZWZhdWx0 T3V0Zg0KDQotLSBPcmRlcmVkIGxpc3Qgb2YgdHlwZSBuYW1lcyAtLQ0KbG9jYWwgTmFtZXMgPSB7 ICJpbnRlZ2VyIiwgInN0cmluZyIsICJudW1iZXIiLCAiYm9vbGVhbiIsICJmdW5jdGlvbiIsICJ0 YWJsZSIsICJ0aHJlYWQiLCAidXNlcmRhdGEiIH0NCg0KLS0gS2V5IGZvcm1hdHMgLS0NCmxvY2Fs IEtleUZvcm1hdHMgPSB7IGludGVnZXIgPSAiJXNbJWldID0gJXMiLCBudW1iZXIgPSAiJXNbJWZd ID0gJXMiLCBzdHJpbmcgPSAiJXMlcyA9ICVzIiB9DQoNCi0tIHY6IFZhbHVlIHRvIGZvcm1hdA0K LS0gZ3VhcmQ6IEN5Y2xlIGd1YXJkDQotLSBSZXR1cm5zOiBUeXBlIG5hbWUsIHByZXR0eSBwcmlu dCBmb3JtIG9mIHZhbHVlDQpsb2NhbCBmdW5jdGlvbiBQcmV0dHkgKHYsIGd1YXJkKQ0KCWxvY2Fs IHZ0eXBlID0gdHlwZSh2KQ0KDQoJaWYgdnR5cGUgPT0gIm51bWJlciIgYW5kIElzSW50ZWdlcih2 KSB0aGVuDQoJCXJldHVybiAiaW50ZWdlciIsIGZvcm1hdCgiJWkiLCB2KQ0KCWVsc2VpZiB2dHlw ZSA9PSAic3RyaW5nIiB0aGVuDQoJCXJldHVybiAic3RyaW5nIiwgZm9ybWF0KCJcIiVzXCIiLCB2 KQ0KCWVsc2VpZiB2dHlwZSA9PSAidGFibGUiIHRoZW4NCgkJaWYgZ3VhcmRbdl0gdGhlbg0KCQkJ cmV0dXJuICJjeWNsZSIsIGZvcm1hdCgiQ1lDTEUsICVzIiwgdG9zdHJpbmcodikpDQoJCWVsc2UN CgkJCXJldHVybiAidGFibGUiLCAieyINCgkJZW5kDQoJZWxzZQ0KCQlyZXR1cm4gdnR5cGUsIHRv c3RyaW5nKHYpDQoJZW5kDQplbmQNCg0KLS0gUmV0dXJuczogSWYgdHJ1ZSwgazEgPCBrMg0KbG9j YWwgZnVuY3Rpb24gS2V5Q29tcCAoazEsIGsyKQ0KCXJldHVybiB0b3N0cmluZyhrMSkgPCB0b3N0 cmluZyhrMikNCmVuZA0KDQotLSBQcmludHMgYSB0YWJsZSBsZXZlbA0KLS0gdDogQ3VycmVudCB0 YWJsZQ0KLS0gb3V0ZjogRm9ybWF0dGVkIG91dHB1dCByb3V0aW5lDQotLSBpbmRlbnQ6IEN1cnJl bnQgaW5kZW50YXRpb24NCi0tIGd1YXJkOiBDeWNsZSBndWFyZA0KbG9jYWwgZnVuY3Rpb24gUHJp bnRMZXZlbCAodCwgb3V0ZiwgaW5kZW50LCBndWFyZCkNCglsb2NhbCBsaXN0cyA9IFN1YlRhYmxl c09uRGVtYW5kKCkNCglsb2NhbCBtZW1iZXJfaW5kZW50ID0gaW5kZW50IC4uICIgICAiDQoNCgkt LSBNYXJrIHRoaXMgdGFibGUgdG8gZ3VhcmQgYWdhaW5zdCBjeWNsZXMuDQoJZ3VhcmRbdF0gPSB0 cnVlDQoNCgktLSBDb2xsZWN0IGZpZWxkcyBpbnRvIHRhYmxlcy4NCglmb3IgayBpbiBwYWlycyh0 KSBkbw0KCQlsb2NhbCBrdHlwZSA9IHR5cGUoaykNCg0KCQlpZiBrdHlwZSA9PSAibnVtYmVyIiBh bmQgSXNJbnRlZ2VyKGspIHRoZW4NCgkJCWt0eXBlID0gImludGVnZXIiDQoJCWVuZA0KDQoJCWlu c2VydChsaXN0c1trdHlwZV0sIGspDQoJZW5kDQoNCgktLSBJdGVyYXRlIG92ZXIgdHlwZXMgd2l0 aCBlbGVtZW50cy4NCglmb3IgXywgbmFtZSBpbiBpcGFpcnMoTmFtZXMpIGRvDQoJCWxvY2FsIHN1 YnQgPSByYXdnZXQobGlzdHMsIG5hbWUpDQoJCWxvY2FsIGtmb3JtYXQgPSBLZXlGb3JtYXRzW25h bWVdDQoNCgkJaWYgc3VidCB0aGVuDQoJCQlzb3J0KHN1YnQsIG5vdCBrZm9ybWF0IGFuZCBLZXlD b21wIG9yIG5pbCkNCg0KCQkJZm9yIF8sIGsgaW4gaXBhaXJzKHN1YnQpIGRvDQoJCQkJbG9jYWwg diA9IHJhd2dldCh0LCBrKQ0KCQkJCWxvY2FsIHZ0eXBlLCB2c3RyDQoNCgkJCQktLSBQcmludCBv dXQgdGhlIGN1cnJlbnQgbGluZS4gSWYgdGhlIHZhbHVlIGhhcyBzdHJpbmcgY29udmVyc2lvbiwg dXNlDQoJCQkJLS0gdGhhdCwgaWdub3JpbmcgaXRzIHR5cGUuIE90aGVyd2lzZSwgaWYgdGhpcyBp cyBhIHRhYmxlLCB0aGlzIHdpbGwgb3Blbg0KCQkJCS0tIGl0IHVwOyBwcm9jZWVkIHRvIHJlY3Vy c2l2ZWx5IGR1bXAgdGhlIHRhYmxlIGl0c2VsZi4NCgkJCQlpZiBIYXNNZXRhKHYsICJfX3Rvc3Ry aW5nIikgdGhlbg0KCQkJCQl2c3RyID0gdG9zdHJpbmcodikNCgkJCQllbHNlDQoJCQkJCXZ0eXBl LCB2c3RyID0gUHJldHR5KHYsIGd1YXJkKQ0KCQkJCWVuZA0KDQoJCQkJb3V0ZihrZm9ybWF0IG9y ICIlc1slc10gPSAlcyIsIG1lbWJlcl9pbmRlbnQsIGtmb3JtYXQgYW5kIGsgb3IgdG9zdHJpbmco ayksIHZzdHIpDQoNCgkJCQlpZiB2dHlwZSA9PSAidGFibGUiIHRoZW4NCgkJCQkJUHJpbnRMZXZl bCh2LCBvdXRmLCBtZW1iZXJfaW5kZW50LCBndWFyZCkNCgkJCQllbmQNCgkJCWVuZA0KCQllbmQN CgllbmQNCg0KCS0tIENsb3NlIHRoaXMgdGFibGUuDQoJb3V0ZigiJXN9ICglcykiLCBpbmRlbnQs IHRvc3RyaW5nKHQpKQ0KZW5kDQoNCi0tLSBQcmV0dHkgcHJpbnRzIGEgdmFyaWFibGUuPGJyPjxi cj4NCi0tIElmIGEgdmFyaWFibGUgaGFzIGEgPGI+X190b3N0cmluZzwvYj4gbWV0YW1ldGhvZCwg dGhpcyBpcyBpbnZva2VkIGFuZCB0aGUgcmVzdWx0IGlzDQotLSBwcmludGVkLiBPdGhlcndpc2Us IHNvbWUgInByZXR0eSIgYmVoYXZpb3IgaXMgYXBwbGllZCB0byBpdDsgaWYgdGhlIHZhcmlhYmxl IGlzIGENCi0tIHRhYmxlLCBpdCB3aWxsIGRvIGEgbWVtYmVyLXdpc2UgcHJpbnQsIHJlY3Vyc2lu ZyBvbiBzdWJ0YWJsZXMgKHdpdGggY3ljbGUgZ3VhcmRzKS4NCi0tIEBwYXJhbSB2YXIgVmFyaWFi bGUgdG8gcHJpbnQuDQotLSBAcGFyYW0gb3V0ZiBGb3JtYXR0ZWQgb3V0cHV0IHJvdXRpbmUsIGku ZS4gd2l0aCBhbiBpbnRlcmZhY2UgbGlrZSA8Yj5zdHJpbmcuZm9ybWF0PC9iPjsNCi0tIGlmIGFi c2VudCwgdGhlIGRlZmF1bHQgb3V0cHV0IGZ1bmN0aW9uIGlzIHVzZWQuDQotLSBAcGFyYW0gaW5k ZW50IEluaXRpYWwgaW5kZW50IHN0cmluZzsgaWYgYWJzZW50LCB0aGUgZW1wdHkgc3RyaW5nLjxi cj48YnI+DQotLSBJZiB0aGUgdmFyaWFibGUgaXMgYSB0YWJsZSwgdGhpcyBpcyBwcmVwZW5kZWQg dG8gZWFjaCBsaW5lIG9mIHRoZSBwcmludG91dC4NCi0tIEBzZWUgU2V0RGVmYXVsdE91dGYNCmZ1 bmN0aW9uIFByaW50ICh2YXIsIG91dGYsIGluZGVudCkNCglvdXRmID0gb3V0ZiBvciBEZWZhdWx0 T3V0Zg0KCWluZGVudCA9IGluZGVudCBvciAiIg0KDQoJYXNzZXJ0KElzQ2FsbGFibGUob3V0Ziks ICJJbnZhbGlkIG91dHB1dCBmdW5jdGlvbiIpDQoNCglpZiBIYXNNZXRhKHZhciwgIl9fdG9zdHJp bmciKSB0aGVuDQoJCW91dGYoIiVzJXMiLCBpbmRlbnQsIHRvc3RyaW5nKHZhcikpDQoNCgllbHNl aWYgdHlwZSh2YXIpID09ICJ0YWJsZSIgdGhlbg0KCQlvdXRmKCIlc3RhYmxlOiB7IiwgaW5kZW50 KQ0KDQoJCVByaW50TGV2ZWwodmFyLCBvdXRmLCBpbmRlbnQsIHt9KQ0KDQoJZWxzZQ0KCQlsb2Nh bCB2dHlwZSwgdnN0ciA9IFByZXR0eSh2YXIpDQoNCgkJLS0gT3V0cHV0IHRoZSBwcmV0dHkgZm9y bSBvZiB0aGUgdmFyaWFibGUuIFdpdGggc29tZSB0eXBlcywgZm9yZ28gcHJlZmFjaW5nIHRoZW0N CgkJLS0gd2l0aCB0aGVpciB0eXBlIG5hbWUsIHNpbmNlIHByZXR0eWluZyB3aWxsIG1ha2UgaXQg cmVkdW5kYW50Lg0KCQlpZiB2dHlwZSA9PSAiZnVuY3Rpb24iIG9yIHZ0eXBlID09ICJuaWwiIG9y IHZ0eXBlID09ICJ0aHJlYWQiIG9yIHZ0eXBlID09ICJ1c2VyZGF0YSIgdGhlbg0KCQkJb3V0Zigi JXMlcyIsIGluZGVudCwgdnN0cikNCgkJZWxzZQ0KCQkJb3V0ZigiJXMlczogJXMiLCBpbmRlbnQs IHZ0eXBlLCB2c3RyKQ0KCQllbmQNCgllbmQNCmVuZA0KDQotLS0gU2V0cyB0aGUgZGVmYXVsdCBv dXRwdXQgZnVuY3Rpb24gdXNlZCBieSA8Yj5QcmludDwvYj4uDQotLSBAcGFyYW0gb3V0ZiBPdXRw dXQgZnVuY3Rpb24gdG8gYXNzaWduLCBvciA8Yj5uaWw8L2I+IHRvIGNsZWFyIHRoZSBkZWZhdWx0 Lg0KLS0gQHNlZSBQcmludA0KZnVuY3Rpb24gU2V0RGVmYXVsdE91dGYgKG91dGYpDQoJYXNzZXJ0 KElzQ2FsbGFibGVPck5pbChvdXRmKSwgIkludmFsaWQgb3V0cHV0IGZ1bmN0aW9uIikNCg0KCURl ZmF1bHRPdXRmID0gb3V0Zg0KZW5k --001636e0b891c48c58047809b409 Content-Type: application/octet-stream; name="VarPreds.lua" Content-Disposition: attachment; filename="VarPreds.lua" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1v2wfrf1 LS0gU2VlIFRhY29TaGVsbCBDb3B5cmlnaHQgTm90aWNlIGluIG1haW4gZm9sZGVyIG9mIGRpc3Ry aWJ1dGlvbg0KDQotLSBTdGFuZGFyZCBsaWJyYXJ5IGltcG9ydHMgLS0NCmxvY2FsIGFzc2VydCA9 IGFzc2VydA0KbG9jYWwgcmF3Z2V0ID0gcmF3Z2V0DQpsb2NhbCB0b251bWJlciA9IHRvbnVtYmVy DQpsb2NhbCB0eXBlID0gdHlwZQ0KDQotLSBQdXJlIEx1YSBoYWNrcyAtLQ0KbG9jYWwgZGVidWdf Z2V0bWV0YXRhYmxlID0gZGVidWcuZ2V0bWV0YXRhYmxlDQoNCi0tIENhY2hlZCByb3V0aW5lcyAt LQ0KbG9jYWwgSGFzTWV0YV8NCmxvY2FsIElzQ2FsbGFibGVfDQpsb2NhbCBJc0NvdW50YWJsZV8N CmxvY2FsIElzSW5kZXhhYmxlUl8NCmxvY2FsIElzTm9uTmVnYXRpdmVJbnRlZ2VyXw0KDQotLSBF eHBvcnQgbmFtZXNwYWNlLg0KbW9kdWxlICJ2YXJfcHJlZHMiDQoNCi0tLQ0KLS0gQHBhcmFtDQot LSBAcmV0dXJuDQpmdW5jdGlvbiBBbGwgKHZhciwgY291bnQpDQoJYXNzZXJ0KElzTm9uTmVnYXRp dmVJbnRlZ2VyXyhjb3VudCkgb3IgSXNDb3VudGFibGVfKHZhciksICJJbnZhbGlkIGNvdW50IikN Cg0KCWlmIElzQ2FsbGFibGVfKHZhcikgdGhlbg0KCQlmb3IgaSA9IDEsIGNvdW50IGRvDQoJCQlp ZiBub3QgdmFyKGkpIHRoZW4NCgkJCQlyZXR1cm4gZmFsc2UNCgkJCWVuZA0KCQllbmQNCgllbHNl DQoJCWFzc2VydChJc0luZGV4YWJsZVJfKHZhciksICJVbi1pbmRleGFibGUgdmFyaWFibGUiKQ0K DQoJCWZvciBpID0gMSwgY291bnQgb3IgI3ZhciBkbw0KCQkJaWYgbm90IHZhcltpXSB0aGVuDQoJ CQkJcmV0dXJuIGZhbHNlDQoJCQllbmQNCgkJZW5kDQoJZW5kDQoNCglyZXR1cm4gdHJ1ZQ0KZW5k DQoNCi0tLQ0KLS0gQHBhcmFtDQotLSBAcmV0dXJuDQpmdW5jdGlvbiBBbnkgKHZhciwgY291bnQp DQoJYXNzZXJ0KElzTm9uTmVnYXRpdmVJbnRlZ2VyXyhjb3VudCkgb3IgSXNDb3VudGFibGVfKHZh ciksICJJbnZhbGlkIGNvdW50IikNCg0KCWlmIElzQ2FsbGFibGVfKHZhcikgdGhlbg0KCQlmb3Ig aSA9IDEsIGNvdW50IGRvDQoJCQlpZiB2YXIoaSkgdGhlbg0KCQkJCXJldHVybiB0cnVlDQoJCQll bmQNCgkJZW5kDQoJZWxzZQ0KCQlhc3NlcnQoSXNJbmRleGFibGVSXyh2YXIpLCAiVW4taW5kZXhh YmxlIHZhcmlhYmxlIikNCg0KCQlmb3IgaSA9IDEsIGNvdW50IG9yICN2YXIgZG8NCgkJCWlmIHZh cltpXSB0aGVuDQoJCQkJcmV0dXJuIHRydWUNCgkJCWVuZA0KCQllbmQNCgllbmQNCg0KCXJldHVy biBmYWxzZQ0KZW5kDQoNCi0tLQ0KLS0gQHBhcmFtIHZhciBWYXJpYWJsZSB0byB0ZXN0Lg0KLS0g QHBhcmFtIGZpZWxkIEZpZWxkIHRvIGNoZWNrLg0KLS0gQHJldHVybiBJZiB0cnVlLCB0aGUgZmll bGQgaXMgc2V0Lg0KZnVuY3Rpb24gSGFzRmllbGRTZXQgKHZhciwgZmllbGQpDQoJaWYgSXNDYWxs YWJsZV8odmFyKSB0aGVuDQoJCXJldHVybiBub3Qgbm90IHZhcihmaWVsZCkNCgllbHNlDQoJCWFz c2VydChJc0luZGV4YWJsZVJfKHZhciksICJVbi1pbmRleGFibGUgdmFyaWFibGUiKQ0KDQoJCXJl dHVybiBub3Qgbm90IHZhcltmaWVsZF0NCgllbmQNCmVuZA0KDQotLS0NCi0tIEBwYXJhbSB2YXIg VmFyaWFibGUgdG8gdGVzdC4NCi0tIEBwYXJhbSBtZXRhIE1ldGFwcm9wZXJ0eSB0byBsb29rdXAu DQotLSBAcmV0dXJuIElmIHRydWUsIHZhcmlhYmxlIHN1cHBvcnRzIHRoZSBtZXRhcHJvcGVydHku DQpmdW5jdGlvbiBIYXNNZXRhICh2YXIsIG1ldGEpDQoJbG9jYWwgbXQgPSBkZWJ1Z19nZXRtZXRh dGFibGUodmFyKQ0KDQoJcmV0dXJuIChtdCBhbmQgcmF3Z2V0KG10LCBtZXRhKSkgfj0gbmlsDQpl bmQNCg0KLS0tDQotLSBAcGFyYW0gdmFyIFZhcmlhYmxlIHRvIHRlc3QuDQotLSBAcmV0dXJuIElm IHRydWUsIHZhcmlhYmxlIGlzIGNhbGxhYmxlLg0KZnVuY3Rpb24gSXNDYWxsYWJsZSAodmFyKQ0K CXJldHVybiB0eXBlKHZhcikgPT0gImZ1bmN0aW9uIiBvciBIYXNNZXRhXyh2YXIsICJfX2NhbGwi KQ0KZW5kDQoNCi0tLQ0KLS0gQHBhcmFtIHZhciBWYXJpYWJsZSB0byB0ZXN0Lg0KLS0gQHJldHVy biBJZiB0cnVlLCB2YXJpYWJsZSBpcyBjYWxsYWJsZSBvciA8Yj5uaWw8L2I+Lg0KZnVuY3Rpb24g SXNDYWxsYWJsZU9yTmlsICh2YXIpDQoJcmV0dXJuIHZhciA9PSBuaWwgb3IgSXNDYWxsYWJsZV8o dmFyKQ0KZW5kDQoNCi0tLQ0KLS0gQHBhcmFtIHZhciBWYXJpYWJsZSB0byB0ZXN0Lg0KLS0gQHJl dHVybiBJZiB0cnVlLCB2YXJpYWJsZSBpcyBjb3VudGFibGUuDQpmdW5jdGlvbiBJc0NvdW50YWJs ZSAodmFyKQ0KCWxvY2FsIHZ0eXBlID0gdHlwZSh2YXIpDQoNCglyZXR1cm4gdnR5cGUgPT0gInN0 cmluZyIgb3IgdnR5cGUgPT0gInRhYmxlIiBvciBIYXNNZXRhXyh2YXIsICJfX2xlbiIpDQplbmQN Cg0KLS0tDQotLSBAcGFyYW0gdmFyIFZhcmlhYmxlIHRvIHRlc3QNCi0tIEByZXR1cm4gSWYgdHJ1 ZSwgdmFyaWFibGUgaXMgcmVhZC1pbmRleGFibGUuDQpmdW5jdGlvbiBJc0luZGV4YWJsZVIgKHZh cikNCglyZXR1cm4gdHlwZSh2YXIpID09ICJ0YWJsZSIgb3IgSGFzTWV0YV8odmFyLCAiX19pbmRl eCIpDQplbmQNCg0KLS0tDQotLSBAcGFyYW0gdmFyIFZhcmlhYmxlIHRvIHRlc3QNCi0tIEByZXR1 cm4gSWYgdHJ1ZSwgdmFyaWFibGUgaXMgd3JpdGUtaW5kZXhhYmxlLg0KZnVuY3Rpb24gSXNJbmRl eGFibGVXICh2YXIpDQoJcmV0dXJuIHR5cGUodmFyKSA9PSAidGFibGUiIG9yIEhhc01ldGFfKHZh ciwgIl9fbmV3aW5kZXgiKQ0KZW5kDQoNCi0tLQ0KLS0gQHBhcmFtIHZhciBWYXJpYWJsZSB0byB0 ZXN0Lg0KLS0gQHJldHVybiBJZiB0cnVlLCB2YXJpYWJsZSBpcyBhbiBpbnRlZ2VyLg0KZnVuY3Rp b24gSXNJbnRlZ2VyICh2YXIpDQoJbG9jYWwgbiA9IHRvbnVtYmVyKHZhcikNCg0KCXJldHVybiBu IH49IG5pbCBhbmQgbiAlIDEgPT0gMA0KZW5kDQoNCi0tLQ0KLS0gQHBhcmFtIHZhciBWYXJpYWJs ZSB0byB0ZXN0Lg0KLS0gQHJldHVybiBJZiB0cnVlLCB2YXJpYWJsZSBpcyAwIG9yIGEgcG9zaXRp dmUgaW50ZWdlci4NCmZ1bmN0aW9uIElzTm9uTmVnYXRpdmVJbnRlZ2VyICh2YXIpDQoJbG9jYWwg biA9IHRvbnVtYmVyKHZhcikNCg0KCXJldHVybiBuIH49IG5pbCBhbmQgbiA+PSAwIGFuZCBuICUg MSA9PSAwDQplbmQNCg0KLS0tDQotLSBAcGFyYW0gdmFyIFZhcmlhYmxlIHRvIHRlc3QuDQotLSBA cmV0dXJuIElmIHRydWUsIHZhcmlhYmxlIGlzIGEgcG9zaXRpdmUgaW50ZWdlci4NCmZ1bmN0aW9u IElzUG9zaXRpdmVJbnRlZ2VyICh2YXIpDQoJbG9jYWwgbiA9IHRvbnVtYmVyKHZhcikNCg0KCXJl dHVybiBuIH49IG5pbCBhbmQgbiA+IDAgYW5kIG4gJSAxID09IDANCmVuZA0KDQotLS0NCi0tIEBw YXJhbSB2YXIgVmFyaWFibGUgdG8gdGVzdC4NCi0tIEByZXR1cm4gSWYgdHJ1ZSwgdmFyaWFibGUg aXMgIm5vdCBhIG51bWJlciIuDQpmdW5jdGlvbiBJc05hTiAodmFyKQ0KCXJldHVybiB2YXIgfj0g dmFyDQplbmQNCg0KLS0gQ2FjaGUgc29tZSByb3V0aW5lcy4NCkhhc01ldGFfID0gSGFzTWV0YQ0K SXNDYWxsYWJsZV8gPSBJc0NhbGxhYmxlDQpJc0NvdW50YWJsZV8gPSBJc0NvdW50YWJsZQ0KSXNJ bmRleGFibGVSXyA9IElzSW5kZXhhYmxlUg0KSXNOb25OZWdhdGl2ZUludGVnZXJfID0gSXNOb25O ZWdhdGl2ZUludGVnZXI= --001636e0b891c48c58047809b409-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 18:57:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAKvZiM012077; Tue, 10 Nov 2009 18:57:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A508419420; Tue, 10 Nov 2009 18:56:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6877719410 for ; Tue, 10 Nov 2009 18:56:52 -0200 (BRST) Received: by ewy26 with SMTP id 26so516514ewy.5 for ; Tue, 10 Nov 2009 12:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4p9ESnsQ2mm2Ew5N/WSTuET9P7OYT/8TIX7unx+bTgw=; b=gs2QRO5hPA2hCF7QltoA4irFpqKPRY1JYBKarVdXVR4Qw/yNsONG89/Lx6lwzD/+jK I5adhFDyoJpZDWffxh9EC1Ic4socN0PH1b3yal/u3eFA+DvPPv9XywcwUt3hlf3R1f0h Ux+ljSqOYspZR7l+w32IBxJkRvJzZybdYOb/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dJb36gvivE4T1SQd/C/8TJJK7vy6kRJ3+V3PMYktYA3M8kwZCaJ2f3kLM9/Xmrh0gs R83RDC1NDVlpmFrfs1DzEHxpuAr7H06yRmtUuFacs7fNR9r3EW8E0vgWxn3ID26DbK2f Uxtro1FSi+zzZ/PSs1umtBcm91psOhyj9MIX4= MIME-Version: 1.0 Received: by 10.213.0.131 with SMTP id 3mr1645384ebb.68.1257886609677; Tue, 10 Nov 2009 12:56:49 -0800 (PST) In-Reply-To: <576e7620911101156y3e7416f5gf8e30e4a9f067d6f@mail.gmail.com> References: <20091110095730.72815afb@o> <576e7620911101156y3e7416f5gf8e30e4a9f067d6f@mail.gmail.com> Date: Tue, 10 Nov 2009 21:56:49 +0100 Message-ID: <13af99c70911101256m204a2619k9fa25ea057940fc8@mail.gmail.com> Subject: Re: table output From: Kristofer Karlsson To: Lua list Content-Type: multipart/alternative; boundary=000e0cd1fd76899c5204780a8c07 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cd1fd76899c5204780a8c07 Content-Type: text/plain; charset=ISO-8859-1 Here's my version! http://pastey.net/128099 Handles cycles and generally creates the shortest serialization (though you can probably find some corner cases that doesn't do this!) Output from the test at the bottom: test 1:{1,2,3} test 2:{1,2,3} test 1:{hello="world",foo="bar"} test 2:{hello="world",foo="bar"} test 1:{1,2,3,[100]=4} test 2:{1,2,3,[100]=4} test 1:{1,2,34,45,hello="world"} test 2:{1,2,34,45,hello="world"} test 1:_(2,{t2=_(1,{t2=_(1),t1=_(2)}),t1=_(2)}) test 2:_(2,{t2=_(1,{t2=_(1),t1=_(2)}),t1=_(2)}) test 1:_(1,{1,2,4,[_(1)]=_(1),x=_(2,{x=_(2)}),asd="asdff"}) test 2:_(1,{1,2,4,[_(1)]=_(1),x=_(2,{x=_(2)}),asd="asdff"}) On Tue, Nov 10, 2009 at 8:56 PM, Steven Johnson wrote: > Another debugging one here. This one takes a formatted output function > (and you can register one to act as the default) and > then applies that line-by-line. The line-by-line thing lets us dump to > arrays or other structures (e.g. a vector or linked list of > strings on the C side), which can sometimes be easier to traverse. > Also handles cycles and arbitrary keys, and respects > __tostring; it ignores metatable and environment, though maybe I'll > add those as options some day. > > Example: > > function printf (format, ...) > print(string.format(format, ...)) > end > > var_dump.Print(MyVariable, printf) -- Accepts any value, tables are > just a special case > > or > > var_dump.SetDefaultOutf(printf) > var_dump.Print(MyBigTable) > > License is MIT. > --000e0cd1fd76899c5204780a8c07 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here's my version!
http://pastey.n= et/128099

Handles cycles and generally creates the shortest seri= alization (though you can probably find some corner cases that doesn't = do this!)

Output from the test at the bottom:
test 1:{1,2,3}
test 2:{1,2,3}=
test 1:{hello=3D"world",foo=3D"bar"}
test 2:{hel= lo=3D"world",foo=3D"bar"}
test 1:{1,2,3,[100]=3D4}test 2:{1,2,3,[100]=3D4}
test 1:{1,2,34,45,hello=3D"world"}
test 2:{1,2,34,45,hello=3D&= quot;world"}
test 1:_(2,{t2=3D_(1,{t2=3D_(1),t1=3D_(2)}),t1=3D_(2)}= )
test 2:_(2,{t2=3D_(1,{t2=3D_(1),t1=3D_(2)}),t1=3D_(2)})
test 1:_(1,= {1,2,4,[_(1)]=3D_(1),x=3D_(2,{x=3D_(2)}),asd=3D"asdff"})
test 2:_(1,{1,2,4,[_(1)]=3D_(1),x=3D_(2,{x=3D_(2)}),asd=3D"asdff"= })





On Tue, Nov 10, 2009 a= t 8:56 PM, Steven Johnson <steve@xibalbastudios.com> wrote:
Another debugging= one here. This one takes a formatted output function
(and you can register one to act as the default) and
then applies that line-by-line. The line-by-line thing lets us dump to
arrays or other structures (e.g. a vector or linked list of
strings on the C side), which can sometimes be easier to traverse.
Also handles cycles and arbitrary keys, and respects
__tostring; it ignores metatable and environment, though maybe I'll
add those as options some day.

Example:

function printf (format, ...)
=A0print(string.format(format, ...))
end

var_dump.Print(MyVariable, printf) -- Accepts any value, tables are
just a special case

or

var_dump.SetDefaultOutf(printf)
var_dump.Print(MyBigTable)

License is MIT.

--000e0cd1fd76899c5204780a8c07-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 21:07:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAAN7Rwa028608; Tue, 10 Nov 2009 21:07:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF5E5193F5; Tue, 10 Nov 2009 21:06:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f204.google.com (mail-px0-f204.google.com [209.85.216.204]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 133AA193EC for ; Tue, 10 Nov 2009 21:06:45 -0200 (BRST) Received: by pxi42 with SMTP id 42so358550pxi.5 for ; Tue, 10 Nov 2009 15:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LMQodcN3A+hKcf5U0Kg1Xh0hi9/3h6gfWYQySRk9l4I=; b=g0z2kuauPiP8OLhX1OKfRohguAXSsYZD+2uRFxNTOz+CIo99nspE8yvS/Hju/RHxpn NBmyO3bFW4R+ldLw5xDZtNlGziYfw9CvBizpQ8PvVEpyP+6Q8RVCAjDBxpgKOLz8vT2Y U0zJG+vF0yfSjuFyNvw0aA1ylBpLAA0nqsx6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jiATHXmGAg6QPQBj7m9z/k+Nukcgwrk2cs9GizELkM2oqKzTAFZDvxFU9EqmAXM7kn RrfX7tFaAqqXaOVtVYl1kVkNOKlES2GWkGliY4pLRqZsgGRWvsM1rR2P2MvnbJd0P/he tsbWN6FUkxkxPuUCA+ebKDR4H+uv2pAORG7b4= MIME-Version: 1.0 Received: by 10.143.20.29 with SMTP id x29mr72719wfi.182.1257894396532; Tue, 10 Nov 2009 15:06:36 -0800 (PST) In-Reply-To: <13af99c70911101256m204a2619k9fa25ea057940fc8@mail.gmail.com> References: <20091110095730.72815afb@o> <576e7620911101156y3e7416f5gf8e30e4a9f067d6f@mail.gmail.com> <13af99c70911101256m204a2619k9fa25ea057940fc8@mail.gmail.com> Date: Tue, 10 Nov 2009 18:06:36 -0500 Message-ID: Subject: Re: table output From: John Labenski To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You can browse and search the global and registry tables as well as metatables of any Lua program graphically using the program wxLuaEdit. It shows a tree control with the table names and a list of the keys and values in the tables. There are only compiled versions for MSW and OSX and you should be able to run any reasonably normal Lua program using it. It handles cycles by jumping you to an already opened version of the table. Screenshot: http://wxlua.sourceforge.net/screenshots/wxlua_stackdialog_gtk2.png http://wxlua.sourceforge.net If you need to change the working directory to run your program type this into the interactive prompt window at the bottom. print(wx.wxGetCwd()) wx.wxSetWorkingDirectory('c:/path/to/my/program') Regards, John From lua-bounces@bazar2.conectiva.com.br Tue Nov 10 21:21:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAANLuGu030026; Tue, 10 Nov 2009 21:21:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 73BA91939D; Tue, 10 Nov 2009 21:21:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA64B19391 for ; Tue, 10 Nov 2009 21:21:26 -0200 (BRST) Received: by ewy26 with SMTP id 26so665501ewy.5 for ; Tue, 10 Nov 2009 15:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=eymWApsD7c5mK6S3dqe6RfM+8bxUx6seXg3tkZ1NnV4=; b=ZiO55UyZxgdvG+cezPlWiys9q32czVChyZgI7YMgSTCYmcA+VxEJYhsAtD/xGKqfOR 2TRRZnwkz5rfAARM2ONQh++B9ZM9je5dPfqeXYjug4pck4+3EbXlKuWcgS9JPNLhm4TO EayJFihaYDNhcCo6umHYkJ87TGA/NF4Qf43sU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Eg3dK89gsIBQvwBMDVIxtJ8Y6NKN0+Q7lNZrEWHvMEJgVKJ1o+QFZh2WUUATo/4ek3 jaTU7rMBUEKZMKwEnPssja9lzBX6oPEWY+duUDRM9iSy2/QayUegFBD1RqAru3prZ1Kz 2SdJtkCpu29dvNjEQqUQHpTANbVN6kuJw6q3o= Received: by 10.213.2.84 with SMTP id 20mr816349ebi.46.1257895283596; Tue, 10 Nov 2009 15:21:23 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id 7sm2798085eyg.41.2009.11.10.15.21.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 15:21:22 -0800 (PST) Message-Id: <11AB9E97-E01A-4E90-ABC5-9D386A0AA595@gmail.com> From: Petite Abeille To: Lua list In-Reply-To: <13af99c70911101256m204a2619k9fa25ea057940fc8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: table output Date: Wed, 11 Nov 2009 00:20:50 +0100 References: <20091110095730.72815afb@o> <576e7620911101156y3e7416f5gf8e30e4a9f067d6f@mail.gmail.com> <13af99c70911101256m204a2619k9fa25ea057940fc8@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 10, 2009, at 9:56 PM, Kristofer Karlsson wrote: > Here's my version! http://pastey.net/128099 > > Handles cycles and generally creates the shortest serialization > (though you > can probably find some corner cases that doesn't do this!) Very nice :) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:41:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9f1Lp005449; Wed, 11 Nov 2009 07:41:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 29C441943F; Wed, 11 Nov 2009 05:54:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9241919421 for ; Wed, 11 Nov 2009 05:54:53 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N882W-0004Sn-00; Wed, 11 Nov 2009 08:54:52 +0100 Date: Wed, 11 Nov 2009 08:54:43 +0100 From: Mike Pall To: Lua list Subject: Re: Tecgraf.org Message-ID: <20091111075443.GA13612@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Stuart P. Bentley wrote: > http://downforeveryoneorjustme.com/tecgraf.org > > Of course, this probably goes without saying, but I'm recording it for > posterity. http://news.google.com/news/search?hl=en&q=brazil+blackout --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:41:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9f1T3005450; Wed, 11 Nov 2009 07:41:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8377D19449; Wed, 11 Nov 2009 05:49:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EF4919443 for ; Wed, 11 Nov 2009 05:49:48 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N87xZ-0004S8-00; Wed, 11 Nov 2009 08:49:45 +0100 Date: Wed, 11 Nov 2009 08:48:23 +0100 From: Mike Pall To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111074823.GA12525@mike.de> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111072559.GA15532@brevard.conman.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sean Conner wrote: > Third example was running the Lua interpreter with the "-i" option loading > up show.lua, then typing > dofile("default.lua") > > It was the third example that took six minutes. The "-i" option loads readline which as a side-effect initializes the NLS locale for the current process from the environment variables. This may slow down all conversions of strings to numbers, numbers to strings and string comparisons. Looks like it's 30x slower in your case. Try os.setlocale("C") before the dofile(). --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:41:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9f1cJ005453; Wed, 11 Nov 2009 07:41:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ACC6F1943E; Wed, 11 Nov 2009 03:05:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A7E2D1942A for ; Wed, 11 Nov 2009 03:05:08 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id E06951AA92E9 for ; Wed, 11 Nov 2009 00:05:07 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAB557SA015916 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 00:05:07 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 00:05:07 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111050507.GA13917@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFA35A2.7020903@danielstephens.com> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Daniel Stephens once stated: > Does show.lua call os.exit() ? No it doesn't. What you see is what I typed into the interpreter. Besides, if show.lua called os.exit(), then the last example wouldn't have taken nearly six minutes to run, since I load show.lua first. -spc (I can work around the six minute problem, I'm just curious as to what could cause it ... ) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:57:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9vfdE008612; Wed, 11 Nov 2009 07:57:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5E8D19439; Wed, 11 Nov 2009 05:26:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 330D119425 for ; Wed, 11 Nov 2009 05:26:00 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 572AD1AA92EA for ; Wed, 11 Nov 2009 02:25:59 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAB7PxSj015995 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 02:25:59 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 02:25:59 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111072559.GA15532@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFA5F25.9070206@danielstephens.com> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Daniel Stephens once stated: > According to your email you say: > > show.lua -> default.lua 16 seconds > show.lua 12 seconds > default.lua 6 minutes > > Which makes me think that in the FIRST example, default.lua isn't > running at all. First example was running the Lua interpreter, and typing dofile("show.lua") dofile("default.lua") Second example was running the Lua interpreter with the "-i" option loading up default.lua, then typing dofile("show.lua") Third example was running the Lua interpreter with the "-i" option loading up show.lua, then typing dofile("default.lua") It was the third example that took six minutes. -spc From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:57:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9vf31008615; Wed, 11 Nov 2009 07:57:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D15F19468; Wed, 11 Nov 2009 06:12:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2BCC219451 for ; Wed, 11 Nov 2009 06:12:13 -0200 (BRST) Received: by bwz27 with SMTP id 27so766246bwz.21 for ; Wed, 11 Nov 2009 00:12:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IYQa9ULaNg9wBc0pAsIfL8EQ2fTjedpe28rJPlhfNyw=; b=jDmp5PSpQU777+LZcuRMUw0JpYZzshIszLCvnX2fgPu/C63htuHJueocaEc/5rVmhD o+INKfRGGUss2166FpFSEwZ5sFcuZslbjccgvlwABtA5Gmmz9XkUl/pL50Jv4cFS21ye joRpQuJ4C3qNdBxg/aHD0n1CVnUY+7FodUro0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iWc9iwKGlOc+sDQa9QPlX+gB/WCbtgV7vO43jdGlHt2nRRAnwJjI0Pxe+syWbw+Of9 YVpsBtmbX0e5SoFF69lBICBai1q1mF9uGLNs+5CBMkxoLJG1zWoSy8yE5lPrnQlj6lzW vjAOuY2v0EVkNNKYZ03i5Go+D/CWUZQpKio3o= MIME-Version: 1.0 Received: by 10.239.130.31 with SMTP id 31mr121710hbh.134.1257927131836; Wed, 11 Nov 2009 00:12:11 -0800 (PST) In-Reply-To: References: <20091110095730.72815afb@o> <20091110141111.4a908209@o> <20091110081158.lseetnop7os4owgc@hpelbers.org> <560972290911100625y6bb6ff9ct994b969a39626936@mail.gmail.com> Date: Wed, 11 Nov 2009 10:12:11 +0200 Message-ID: <560972290911110012p58a8b98cuc2d1f4455ebffd88@mail.gmail.com> Subject: Re: table output From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 10, 2009 at 4:51 PM, Philipp Janda wrote: > And in that case it's not necessary to use normal text as output at all. > So here is my try using graphviz. It should handle cycles, metatables, > environment tables and upvalues. I used it to debug __index-cycles in a > mixture of generated and hand-written code (was a real mess). Source is > public domain. This is truly cool. To show what it does when passed _G while running luajit 1.1.5: http://mysite.mweb.co.za/residents/sdonovan/lua/lua.png Under the circumstances, does very well! steve d. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 07:57:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAB9vfOm008617; Wed, 11 Nov 2009 07:57:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9C3E19483; Wed, 11 Nov 2009 07:36:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4819A19479 for ; Wed, 11 Nov 2009 07:36:06 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nAB9Y95q021891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 11 Nov 2009 04:36:03 -0500 (EST) Date: Wed, 11 Nov 2009 04:34:09 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: Unix Domain Sockets in Lua In-Reply-To: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> Message-ID: References: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5798 signatures=578755 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > On Sun, 8 Nov 2009 17:24:57 -0500 (EST) Diego Nehab > wrote: > >> There is an undocumented module luasocket/src/unix.c that >> implements Unix Domain Sockets for LuaSocket. Let me know >> (contact me directly) if you need help compiling it and >> getting it to work for you. > > Incidentally, can we look forward to these being official? > They're dreadfully useful. By official you mean, me supporting them if some bug is reported? If this is the case, you can consider them "supported". As for enabling them by default in the makefiles, I don't think this is a good idea because it doesn't make sense on Windows. Unix people know to look for it and make it work. :) As for documenting them, I may add something to he webpage but I doubt the occasional message to the list will stop (we get about one per year). What do you think? Kind regards, Diego From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:09:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABB9rq0010761; Wed, 11 Nov 2009 09:09:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E4A51948B; Wed, 11 Nov 2009 09:09:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE70819473 for ; Wed, 11 Nov 2009 09:09:19 -0200 (BRST) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABB9IAl010689 for ; Wed, 11 Nov 2009 09:09:18 -0200 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id 8A2E0D7F4; Wed, 11 Nov 2009 08:09:14 -0200 (BRST) Date: Wed, 11 Nov 2009 08:09:14 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111074823.GA12525@mike.de> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The "-i" option loads readline which as a side-effect initializes > the NLS locale for the current process from the environment variables. If available, readline is compiled into the interpreter. You don't need to use -i to activate it. Do you mean that when you do use interactive input then a function from the readline library gets called and only then the OS loads the readline library? And so readline is not loaded at all when running the interpreter in batch? --lhf From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:12:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBCZWK012088; Wed, 11 Nov 2009 09:12:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 46B8119492; Wed, 11 Nov 2009 09:12:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A958119489 for ; Wed, 11 Nov 2009 09:12:09 -0200 (BRST) Received: from magritte.tecgraf.puc-rio.br (magritte [10.0.8.92]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBBq57011538 for ; Wed, 11 Nov 2009 09:11:58 -0200 Received: by magritte.tecgraf.puc-rio.br (Postfix, from userid 1026) id D2B22D7F4; Wed, 11 Nov 2009 08:11:50 -0200 (BRST) Date: Wed, 11 Nov 2009 08:11:50 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Tecgraf.org Message-ID: <20091111101150.GB3132@magritte.tecgraf.puc-rio.br> References: <20091111075443.GA13612@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111075443.GA13612@mike.de> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Stuart P. Bentley wrote: > > http://downforeveryoneorjustme.com/tecgraf.org > > > > Of course, this probably goes without saying, but I'm recording it for > > posterity. > > http://news.google.com/news/search?hl=en&q=brazil+blackout Yes, we had that last night. :-( Also the official URL for Tecgraf is www.tecgraf.puc-rio.br. Both should be working now. (How did you get to Tecgraf.org?) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:13:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBDZZH012669; Wed, 11 Nov 2009 09:13:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FBE81949A; Wed, 11 Nov 2009 09:13:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68FA919494 for ; Wed, 11 Nov 2009 09:13:12 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8B8R-0002i0-B8 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 12:13:11 +0100 Received: from aaubervilliers-155-1-68-11.w86-198.abo.wanadoo.fr ([86.198.27.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 12:13:11 +0100 Received: from PhiLho by aaubervilliers-155-1-68-11.w86-198.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 12:13:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: Philippe Lhoste Subject: Re: table output Date: Wed, 11 Nov 2009 12:12:47 +0100 Lines: 27 Message-ID: References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: aaubervilliers-155-1-68-11.w86-198.abo.wanadoo.fr User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> X-Antivirus: avast! (VPS 091110-1, 10/11/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 10/11/2009 10:44, Wesley Smith wrote: > I'm sure everyone on this list has written a table serializer at some > point. Indeed... :-) It is an interesting exercise, not too hard to do (apparently) although delicate to do correctly. Since everybody is showing off their serializer in this thread, I will show mine! :-D See it at: DumpObject.lua http://bazaar.launchpad.net/%7Ephilho/%2Bjunk/Lua/annotate/head%3A/DumpObject.lua It outputs code that can be reused as Lua code, trying to be concise when possible. It allows compact output (in one line) or indented output. It (tries to) addresses correctly cycles and most Lua types, but it is weak at handling functions (as keys or values). Otherwise, it seems quite robust for the tests I did (TestDumpObject.lua and TestDumpObject2.lua, plus some debug dumps I do in my own code). http://bazaar.launchpad.net/%7Ephilho/%2Bjunk/Lua/annotate/head%3A/TestDumpObject.lua http://bazaar.launchpad.net/%7Ephilho/%2Bjunk/Lua/annotate/head%3A/TestDumpObject2.lua -- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:14:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBEJMe013196; Wed, 11 Nov 2009 09:14:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EC561945B; Wed, 11 Nov 2009 05:51:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5E8419451 for ; Wed, 11 Nov 2009 05:50:56 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N87yh-0004Uo-Px for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 08:50:55 +0100 Received: from c-24-16-108-67.hsd1.wa.comcast.net ([24.16.108.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 08:50:55 +0100 Received: from stuart by c-24-16-108-67.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 Nov 2009 08:50:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: "Stuart P. Bentley" Subject: Tecgraf.org Date: Tue, 10 Nov 2009 23:50:47 -0800 Lines: 5 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-16-108-67.hsd1.wa.comcast.net X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean http://downforeveryoneorjustme.com/tecgraf.org Of course, this probably goes without saying, but I'm recording it for posterity. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:23:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBNToS018317; Wed, 11 Nov 2009 09:23:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A84E019485; Wed, 11 Nov 2009 09:23:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F481193BF for ; Wed, 11 Nov 2009 09:23:00 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 466951AA92EA for ; Wed, 11 Nov 2009 06:22:59 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nABBMxVZ009788 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 06:22:59 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 06:22:59 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111112259.GA3334@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111074823.GA12525@mike.de> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Mike Pall once stated: > Sean Conner wrote: > > Third example was running the Lua interpreter with the "-i" option loading > > up show.lua, then typing > > dofile("default.lua") > > > > It was the third example that took six minutes. > > The "-i" option loads readline which as a side-effect initializes > the NLS locale for the current process from the environment > variables. > > This may slow down all conversions of strings to numbers, numbers > to strings and string comparisons. Looks like it's 30x slower in > your case. > > Try os.setlocale("C") before the dofile(). I did that. Still took six minutes. I even set the locale from the command line and tried, and it took six minutes. I then did a quick look at the Lua interpeter (lua.c). The Lua function dofile() does: int n = lua_gettop(L); luaL_loadfile(L,name); lua_call(L,0,LUA_MULTRET); return lua_gettop(L) - n; whereas the "-i" option appears to do: int base = lua_gettop(L) - narg luaL_loadfile(L,name); lua_pushcfunction(L, traceback); lua_insert(L, base); lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); lua_remove(L, base); I'm still not sure why loading a small file via the "-i" option before loading the 80M script via dofile() takes so darned long. -spc From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:25:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBPOjm019292; Wed, 11 Nov 2009 09:25:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8B40194A2; Wed, 11 Nov 2009 09:25:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6AF111949C for ; Wed, 11 Nov 2009 09:25:00 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8BJr-0004bq-00; Wed, 11 Nov 2009 12:24:59 +0100 Date: Wed, 11 Nov 2009 12:24:52 +0100 From: Mike Pall To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111112452.GA22594@mike.de> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > > The "-i" option loads readline which as a side-effect initializes > > the NLS locale for the current process from the environment variables. > > If available, readline is compiled into the interpreter. You don't need > to use -i to activate it. Do you mean that when you do use interactive > input then a function from the readline library gets called and only then > the OS loads the readline library? And so readline is not loaded at all > when running the interpreter in batch? I should have been more precise. The shared library is always loaded (which is a waste without -i). The first time a readline function is called (only with -i), it's initialized and it sets the locale. You can verify that by comparing the output of these two commands: strace -e open lua -v strace -e open lua -i Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBUwfd020560; Wed, 11 Nov 2009 09:30:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 75C0F19415; Wed, 11 Nov 2009 01:55:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailer.cheeseplant.org (adsl-71-158-244-138.dsl.pltn13.sbcglobal.net [71.158.244.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3454E1940B for ; Wed, 11 Nov 2009 01:55:23 -0200 (BRST) Received: from globule.home.cheeseplant.org ([10.1.1.1] helo=quad.home.cheeseplant.org) by mailer.cheeseplant.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1N84Ig-0004wb-3w for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 19:55:18 -0800 Message-ID: <4AFA35A2.7020903@danielstephens.com> Date: Tue, 10 Nov 2009 19:55:14 -0800 From: Daniel Stephens User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091110104637.GA6015@brevard.conman.org> In-Reply-To: <20091110104637.GA6015@brevard.conman.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Does show.lua call os.exit() ? Sean Conner wrote: > I've noticed some strange behavior with the Lua interpreter [1]. I'm > trying to load two scripts, one is 1101 bytes in size (just dumps the > contents of a table) and the other one is 83414279 bytes in size (yes, > 80M---generated by a C program and contains a *really* large table of around > 80,000 items [2]). > > [spc]lucy:/tmp/lua>ll > total 81548 > -rw------- 1 spc spc 83414279 Nov 10 05:30 default.lua > -rw-r--r-- 1 spc spc 1101 Nov 10 05:30 show.lua > > Okay. > > [spc]lucy:/tmp/lua>time lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > >> dofile("show.lua") >> dofile("default.lua") >> os.exit() >> > > real 0m16.130s > user 0m6.311s > sys 0m0.365s > [spc]lucy:/tmp/lua>time lua -i default.lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > >> dofile("show.lua") >> os.exit() >> > > real 0m12.354s # file is probably cached at this point > user 0m6.293s > sys 0m0.413s > [spc]lucy:/tmp/lua>time lua -i show.lua > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > >> dofile("default.lua") >> os.exit() >> > > real 5m49.052s # okay ... what happened? > user 5m43.279s > sys 0m0.577s > [spc]lucy:/tmp/lua> > > I can work around this, but I'm very curious as to why it's happening. > > -spc (Who finds this very odd behavior ... ) > > [1] Linux 2.6, dual core Pentium-4 2.6GHz with a 1G of RAM > > [2] Basically, an index of all the headers from over 80,000 messages > from 2,300 files (of which the names, sizes and timestamps are > saved as well in the table). > > > From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:31:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBUxWY020562; Wed, 11 Nov 2009 09:30:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6BBB193C0; Wed, 11 Nov 2009 00:28:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D66C193B5 for ; Wed, 11 Nov 2009 00:28:24 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAACw+UpUXebz/2dsb2JhbACEcsgBkTCBMII4VAQ Received: from relay02.plus.net ([84.93.230.243]) by relay.ptn-ipout02.plus.net with ESMTP; 11 Nov 2009 02:28:21 +0000 Received: from flute.plus.com ([212.159.60.16] helo=[127.0.0.1]) by relay02.plus.net with esmtp (Exim) id 1N82wX-0004Mb-E2 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 02:28:21 +0000 Message-ID: <4AFA2145.4040608@gpsl.net> Date: Wed, 11 Nov 2009 02:28:21 +0000 From: Tim Channon User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> In-Reply-To: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 5d3c4c5d44c865f2cda742a632c98cb5 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jerome Vuarand wrote: > Hi list, > > I'm trying to write a copas-like module that handles both incoming and > outgoing connections. Since the socket:connect operation can take some > time, and I may have other sockets ready to do something, I'm setting > the timeout to zero, I call connect, but then select is not working as > expected on Windows. Some time ago I found a problem with the higher level calls, fail to return status. Seem to recall working this out from the sources. The documents are silent on specifying what actually happens. The workaround was use the low level calls. Related to your problem? No idea. Desperately trying to remember the details, found this in a source and the comments are all I know. fred = socket.tcp() -- do not use "shorthand" method, is badly behaved flag, errorstring=fred:bind(host, port) -- this kind of bind works properly if(flag==NIL) then print(flag, errorstring) -- prints socket in use if err... already used fred:close() -- clean up dead object so we can try another port without leaving junk end From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:38:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBc9kO022216; Wed, 11 Nov 2009 09:38:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2898419474; Wed, 11 Nov 2009 09:37:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f171.google.com (mail-pz0-f171.google.com [209.85.222.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2BC219450 for ; Wed, 11 Nov 2009 09:37:37 -0200 (BRST) Received: by pzk1 with SMTP id 1so11471pzk.33 for ; Wed, 11 Nov 2009 03:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=MmzRT16kJBpELN2D9w+PWEZNSaLua0KP7GykILUdXXA=; b=uQw/T/FGiQJCkU2BjRXpX61Phi8+1fnliCLznn37w3G6f41h1EQFL4wwhHCe8ReeiP 9gLC9za4AlL8zPh8GCWd6UId2WwPF2+l0rFzuZ750/8pSKYAKlmLqgdhpzCfOD3mjHeS T5C4RurZYj6YW7ckOcJ7BFwkUvXjD5nDSguvc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KZ5/oRnghFfDXpUmgCdWtHWfxY1ghHogZgMNL1mONGPbeXj4w9lSeIlXNS43jO6A9W p7ZwN3yQr4KI8/tJSRUKPfcfy1PKN9ViWyefwsVZj5UPo+udf+/vMlGLACGO2gOYuDUo cnJ1Dk953molVYAKjDI0ua5AdgYG6JhkL6Jj8= MIME-Version: 1.0 Received: by 10.140.201.3 with SMTP id y3mr75019rvf.288.1257939454066; Wed, 11 Nov 2009 03:37:34 -0800 (PST) In-Reply-To: References: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> Date: Wed, 11 Nov 2009 14:37:34 +0300 Message-ID: Subject: Re: Unix Domain Sockets in Lua From: Alexander Gladysh To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > By official you mean, me supporting them if some bug is > reported? If this is the case, you can consider them > "supported". As for enabling them by default in the > makefiles, I don't think this is a good idea because it > doesn't make sense on Windows. Unix people know to look for > it and make it work. :) As for documenting them, I may add something to he > webpage but I doubt the occasional message to the list will stop (we get > about one per year). > What do you think? Well, before posting my question, I've googled up "luasocket unix domain socket". The results did not told me anything about luasocket support for them, except this page: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/old/luasocket-2.0-beta/, which says that there is no support. I didn't noticed that this is a old beta page (that's my fault). So, here is what I think: 1. LuaSocket docs should mention that LuaSocket supports Unix Domain Sockets on platforms there they exist. 2. If there would be a module documentation for them, it would be even better, and should help googling. 3. Since I'm trying to live in LuaRocks ecosystem for my current project, I'd like to have a rock that enables the Unix Domain Socket support in LuaSocket. (Or is there an easy way to add it on top by hands?) Alexander. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:47:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBldLh024127; Wed, 11 Nov 2009 09:47:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B21EB19418; Wed, 11 Nov 2009 04:52:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailer.cheeseplant.org (adsl-71-158-244-138.dsl.pltn13.sbcglobal.net [71.158.244.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F570193D4 for ; Wed, 11 Nov 2009 04:52:30 -0200 (BRST) Received: from globule.home.cheeseplant.org ([10.1.1.1] helo=quad.home.cheeseplant.org) by mailer.cheeseplant.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1N8747-00032K-3w for lua@bazar2.conectiva.com.br; Tue, 10 Nov 2009 22:52:27 -0800 Message-ID: <4AFA5F25.9070206@danielstephens.com> Date: Tue, 10 Nov 2009 22:52:21 -0800 From: Daniel Stephens User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> In-Reply-To: <20091111050507.GA13917@brevard.conman.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean According to your email you say: show.lua -> default.lua 16 seconds show.lua 12 seconds default.lua 6 minutes Which makes me think that in the FIRST example, default.lua isn't running at all. Daniel Sean Conner wrote: > It was thus said that the Great Daniel Stephens once stated: > >> Does show.lua call os.exit() ? >> > > No it doesn't. What you see is what I typed into the interpreter. > Besides, if show.lua called os.exit(), then the last example wouldn't have > taken nearly six minutes to run, since I load show.lua first. > > -spc (I can work around the six minute problem, I'm just curious as to > what could cause it ... ) > > > > > From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 09:47:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABBldS3024129; Wed, 11 Nov 2009 09:47:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A1FA193A5; Wed, 11 Nov 2009 03:28:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 290F81938A for ; Wed, 11 Nov 2009 03:28:33 -0200 (BRST) Received: by iwn8 with SMTP id 8so688894iwn.33 for ; Tue, 10 Nov 2009 21:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=oZzn1ctqIi2KWazT9HY8QColPrxFART5LdUOkrF61xE=; b=A7yvghUiXH+K1f6mD4howZaBhSjwTTR5QLjtMYeuKAdCWIxRPgG6ChS2BB1E9FBDg+ R90FB29CHedhCZUjBIVAwmhdgatoUOr/u2NG2g2/R3L+k/HLuH716+02hQWyBMOHxxM2 AI10MsqAb3uogTjxrIfUzlvt0NrX4A2XE+PCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=lonog0byVZKxLk81r8/OSXyyF6CltfA/0lNE8S027cxiSYk81b1EbeWIgwSW6S68aO 45lTkMocmk2/e6Gmuvmzbn+4MJ7HrU/Ijyx/QuDvh6NdTV1bVX7HoKURAxb1KOvVkKBl iES0gcAxE2byMBpY/CYVfFquGuALC1X5/yMrk= MIME-Version: 1.0 Received: by 10.231.26.131 with SMTP id e3mr633243ibc.0.1257917311697; Tue, 10 Nov 2009 21:28:31 -0800 (PST) In-Reply-To: <4AF96FD9.4000102@inconcertcc.com> References: <20091110112217.GA10944@duchamp.tecgraf.puc-rio.br> <560972290911100436g29ea76f8t6389493ee7304a1@mail.gmail.com> <4AF96599.5060101@inconcertcc.com> <20091110133128.GA6973@duchamp.tecgraf.puc-rio.br> <4AF96FD9.4000102@inconcertcc.com> Date: Tue, 10 Nov 2009 21:28:31 -0800 X-Google-Sender-Auth: ccf6701d14d67889 Message-ID: <60b95520911102128r77f803b9x520906cf0bd9aba2@mail.gmail.com> Subject: Re: videos of the Lua Workshop 2009 From: Mike Schmitz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nABBldS3024129 2009/11/10 Ignacio Burgueño > > Luiz Henrique de Figueiredo wrote: >>> >>> Attached is a .asx file (I think its just a playlist). >> >> VLC understands that as well, good. But, at least in my Mac, it had >> problems with the first few videos: I guess it was because the URLs have >> accented characters, but I'm not sure. >> >> mms://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv >> >> Oh, now even this does not work now... >> >> http://midia.com.puc-rio.br/integra/20091106_lua1manhã2.wmv >> > > Accented characters in urls should be escaped. See if this works for you: > > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A32.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A33.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A34.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A35.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A36.wmv > http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A37.wmv > > Those are sessions 1 to 7. > I noticed that urls for sessions corresponding to day 2 don't have accented characters anymore. i.e. http://midia.com.puc-rio.br/integra/20091109_lua2manha1.wmv > > > Regards, > Ignacio > > mschmitz@tourmaline:~$ wget http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv --2009-11-10 21:26:36-- http://midia.com.puc-rio.br/integra/20091106%5Flua1manh%C3%A31.wmv Resolving midia.com.puc-rio.br... failed: Temporary failure in name resolution. wget: unable to resolve host address `midia.com.puc-rio.br' mschmitz@tourmaline:~$ From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 11:05:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABD5T59008757; Wed, 11 Nov 2009 11:05:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45156193D2; Wed, 11 Nov 2009 11:04:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7BC44193C1 for ; Wed, 11 Nov 2009 11:04:52 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N8CsE-0008JP-QW for ; Wed, 11 Nov 2009 13:04:34 +0000 Received: from [192.168.3.116] (helo=necrosis.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N8CsV-0001pE-2D for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 13:04:51 +0000 Date: Wed, 11 Nov 2009 13:04:48 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Unix Domain Sockets in Lua Message-ID: <20091111130448.225f9f14@necrosis.i.flarn.net> In-Reply-To: References: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 11 Nov 2009 04:34:09 -0500 (EST) Diego Nehab wrote: > By official you mean, me supporting them if some bug is > reported? If this is the case, you can consider them > "supported". As for enabling them by default in the > makefiles, I don't think this is a good idea because it > doesn't make sense on Windows. Surely the Makefile already knows if it's running on Windows, and can enable it when running on Windows? Certainly some documentation for software packagers about what to do would be helpful; most Linux distributions ship LuaSocket without UDS spport! > Unix people know to look for it and make it work. :) As for > documenting them, I may add something to he webpage but I doubt the > occasional message to the list will stop (we get about one per year). Documentation is always worth it. It would have saved me an hour or so, as I read the source rather than just asking here straight away. I imagine others are similar. B. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 14:19:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABGIwTv015958; Wed, 11 Nov 2009 14:18:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E1AFB18FF3; Wed, 11 Nov 2009 14:18:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D5F8218EF0 for ; Wed, 11 Nov 2009 14:18:10 -0200 (BRST) Received: by fxm21 with SMTP id 21so1185388fxm.21 for ; Wed, 11 Nov 2009 08:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=roY7hMnKJow86E8z8VrWyEBLL7dsUVjGuO7J/Qhtsdw=; b=xHu1LAoTM/zU9mFqp9A7QEYu6412I0LKauqy8/sx7/lFcKrt8hAgruSJLWKe1/B9vf QAZWu1F6iTZgHLzmECpuqY3qH0YZRxIz6YyYuYLD3drpaH8azxyhzUC0EaUD6AZuIAtG KJDdahF2iU1fKQOXfPcr9DN74C/TLGeK05Ayg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=kM1oIZWDaQCh60VnDAiT5bhjcAs4eacbma6qbkZGJF26dEM6XrcaeL27CH7AarRTVc 2BGxdz1lmiDIy8kG0SEUOw7uwoRbhm6QLHN9DwjXnT9ESdHuxQHySkMBBhHxwq6P0D2F CHjmFfJLTbD46J7XJFeQrQzUz568ZJ20DjucI= MIME-Version: 1.0 Received: by 10.204.15.16 with SMTP id i16mr1741408bka.72.1257956286861; Wed, 11 Nov 2009 08:18:06 -0800 (PST) In-Reply-To: References: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> From: Hisham Date: Wed, 11 Nov 2009 14:17:46 -0200 Message-ID: <5e7d91620911110817nc788018xca414acc3f9d768e@mail.gmail.com> Subject: Re: Unix Domain Sockets in Lua To: Lua list Content-Type: multipart/mixed; boundary=0003255540169f11ec04781ac55d X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0003255540169f11ec04781ac55d Content-Type: text/plain; charset=UTF-8 On Wed, Nov 11, 2009 at 9:37 AM, Alexander Gladysh wrote: > 3. Since I'm trying to live in LuaRocks ecosystem for my current > project, I'd like to have a rock that enables the Unix Domain Socket > support in LuaSocket. (Or is there an easy way to add it on top by > hands?) Since we can't just add a target to the make invocation to compile socket.unix (a target for that in the top-level Makefile would have come handy), one approach would be to make a separate rockspec for the extra module, such as the one that follows attached. I think I'd rather have it added unconditionally to Unix builds of the LuaSocket rock, though. I can think of two ways to do that, but I'm not sure which is better: to patch the Makefile to make it build unix.so or to change the rockspec to the builtin build type. -- Hisham --0003255540169f11ec04781ac55d Content-Type: application/octet-stream; name="luasocket-unix-2.0.2-1.rockspec" Content-Disposition: attachment; filename="luasocket-unix-2.0.2-1.rockspec" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1wahjxb0 cGFja2FnZSA9ICJMdWFTb2NrZXQtVW5peCIKdmVyc2lvbiA9ICIyLjAuMi0xIgpzb3VyY2UgPSB7 CiAgIHVybCA9ICJodHRwOi8vbHVhZm9yZ2UubmV0L2Zycy9kb3dubG9hZC5waHAvMjY2NC9sdWFz b2NrZXQtMi4wLjIudGFyLmd6IiwKICAgbWQ1ID0gIjQxNDQ1YjEzOGRlYjdiY2ZlOTdiZmY5NTc1 MDNkYThlIgp9CmRlc2NyaXB0aW9uID0gewogICBzdW1tYXJ5ID0gIlVuaXggRG9tYWluIFNvY2tl dHMgZm9yIHRoZSBMdWEgbGFuZ3VhZ2UiLAogICBkZXRhaWxlZCA9IFtbCiAgICAgIHNvY2tldC51 bml4IGlzIGEgTHVhU29ja2V0IG1vZHVsZSB0aGF0IGltcGxlbWVudHMgc3VwcG9ydCBmb3IgVW5p eCBEb21haW4gU29ja2V0cy4KICAgXV0KfQpidWlsZCA9IHsKICAgdHlwZSA9ICJidWlsdGluIiwK ICAgbW9kdWxlcyA9IHsKICAgICAgWyJzb2NrZXQudW5peCJdID0gewogICAgICAgICBzb3VyY2Vz ID0geyAic3JjL2J1ZmZlci5jIiwgInNyYy9hdXhpbGlhci5jIiwgInNyYy9vcHRpb25zLmMiLCAi c3JjL3RpbWVvdXQuYyIsICJzcmMvaW8uYyIsICJzcmMvdXNvY2tldC5jIiwgInNyYy91bml4LmMi IH0sCiAgICAgICAgIGRlZmluZXMgPSB7ICJMVUFTT0NLRVRfREVCVUciIH0KICAgICAgfQogICB9 LAogICBwbGF0Zm9ybXMgPSB7CiAgICAgIG1hY29zeCA9IHsKICAgICAgICAgbW9kdWxlcyA9IHsK ICAgICAgICAgICAgWyJzb2NrZXQudW5peCJdID0gewogICAgICAgICAgICAgICBkZWZpbmVzID0g eyAiTFVBU09DS0VUX0RFQlVHIiwgIlVOSVhfSEFTX1NVTl9MRU4iIH0KICAgICAgICAgICAgfQog ICAgICAgICB9LAogICAgICB9CiAgIH0KfQo= --0003255540169f11ec04781ac55d-- From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 15:29:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABHTtLC032136; Wed, 11 Nov 2009 15:29:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 05D74192A1; Wed, 11 Nov 2009 15:29:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail4.hostpark.net (mail4.hostpark.net [212.243.197.34]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AA9518EF2 for ; Wed, 11 Nov 2009 15:29:16 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by mail4.hostpark.net (Postfix) with ESMTP id D366440903 for ; Wed, 11 Nov 2009 18:29:10 +0100 (CET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail4.hostpark.net ([127.0.0.1]) by localhost (mail4.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id pC+Kl+tIeXpG for ; Wed, 11 Nov 2009 18:29:10 +0100 (CET) Received: from [10.10.1.57] (77-59-246-76.static.cablecom.ch [77.59.246.76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail4.hostpark.net (Postfix) with ESMTP id 7AEBE3F5CA for ; Wed, 11 Nov 2009 18:29:10 +0100 (CET) Message-ID: <4AFAF467.8090506@svox.com> Date: Wed, 11 Nov 2009 18:29:11 +0100 From: "Dr. Markus Walther" Organization: SVOX AG, =?ISO-8859-1?Q?Z=FCrich?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: lua@bazar2.conectiva.com.br Subject: luajit 2.0: string.dump with temporally switched-off luajit possible? References: <486CCF3C.1080005@svox.com> In-Reply-To: <486CCF3C.1080005@svox.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean Hi, I followed the discussion on string.dump unavailability, and can live with it for general code. However, for a specific need I wrote in Lua a bytecode verifier to characterize some subset of 'safe' bytecodes similar to what is described in the Gems book. I didn't succeed in my naive attempt to use jit.off(true,true) as the first thing in the verifier module to make string.dump available locally - so is this generally impossible, or is there some trick I don't know? Somewhat related, is the non-JIT interpreter that ships with luajit 2.0 byte-code-compatible with the official Lua interpreter? Thanks a lot in advance, Markus From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 15:38:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABHc4Ii001770; Wed, 11 Nov 2009 15:38:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E40E19343; Wed, 11 Nov 2009 15:37:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.184]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A134119305 for ; Wed, 11 Nov 2009 15:37:21 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so128998gvf.40 for ; Wed, 11 Nov 2009 09:37:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZqV1U27yXIq261hLjNS74x7j5lSvw7xZif1dWigtoNY=; b=ff/Ss5u1OBvYiOnW4ohtIpSlgEJe4OxTU0tnOcLmF+12HIK16U0A9aLfm5IuHg/sMy N8eFIYFli027XTa35Z9Zd/Lvcdj9514yLbye2sbWzx7oswommLJeOtm53pc6da1W70D+ o9M8etKBYkYlYLOxK/dFHwERboLSxvNTh6/sg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rR5Ze/YB/HjvQRLQeivYwV+A2EFaCUjQM28fymQaByFXRQH5iGvIImwIjTZaIKDtB6 fRI/xzgQifCxuv77TcqirAaS+snu9gneLE/EaDpIAAgcajiWtmtGk/vHTefK+99G0iNt B1vwEzS2ddCbR1hf9uILVbvK5/tiMU4U44dMI= MIME-Version: 1.0 Received: by 10.239.145.11 with SMTP id q11mr186285hba.98.1257961036407; Wed, 11 Nov 2009 09:37:16 -0800 (PST) In-Reply-To: <4AFAF467.8090506@svox.com> References: <486CCF3C.1080005@svox.com> <4AFAF467.8090506@svox.com> Date: Wed, 11 Nov 2009 15:37:16 -0200 Message-ID: Subject: Re: luajit 2.0: string.dump with temporally switched-off luajit possible? From: Romulo To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > However, for a specific need I wrote in Lua a bytecode verifier to > characterize some subset of 'safe' bytecodes similar to what is > described in the Gems book. I haven't read the Gems book, but you could run your bytecode verifier offline with plain Lua and then switch to Lua JIT for runtime. However, if you want to run your bytecode verifier in real time (user input, for instance), maybe LuaRings could be helpful in this particular case. --rb From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 15:55:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABHt5cG005765; Wed, 11 Nov 2009 15:55:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9E50719306; Wed, 11 Nov 2009 15:54:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-6.csi.cam.ac.uk (ppsw-6.csi.cam.ac.uk [131.111.8.136]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DFC121928C for ; Wed, 11 Nov 2009 15:54:35 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:42923) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpa (EXTERNAL:fanf2) id 1N8HOs-0008Cm-K7 (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Wed, 11 Nov 2009 17:54:34 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N8HOs-0001pG-7I (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Wed, 11 Nov 2009 17:54:34 +0000 Date: Wed, 11 Nov 2009 17:54:34 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: table output In-Reply-To: Message-ID: References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 11 Nov 2009, Philippe Lhoste wrote: > > It is an interesting exercise, not too hard to do (apparently) although > delicate to do correctly. Since everybody is showing off their > serializer in this thread, I will show mine! :-D I feel like joining in. This one is designed to be brief, while handling arbitrary recursion in keys or values, plus some support for functions. Its output isn't particularly short or readable. This code would be a line shorter if I could use ("%q"):format instead of the gsub() business, but sadly %q doesn't quote thoroughly enough to safely print a serialized function to a terminal. local szt = {} local function char(c) return ("\\%3d"):format(c:byte()) end local function szstr(s) return ('"%s"'):format(s:gsub("[^ !#-~]", char)) end local function szfun(f) return "loadstring"..szstr(string.dump(f)) end local function szany(...) return szt[type(...)](...) end local function sztbl(t,code,var) for k,v in pairs(t) do local ks = szany(k,code,var) local vs = szany(v,code,var) code[#code+1] = ("%s[%s]=%s"):format(var[t],ks,vs) end return "{}" end local function memo(sz) return function(d,code,var) if var[d] == nil then var[1] = var[1] + 1 var[d] = ("_[%d]"):format(var[1]) local index = #code+1 code[index] = "" -- reserve place during recursion code[index] = ("%s=%s"):format(var[d],sz(d,code,var)) end return var[d] end end szt["nil"] = tostring szt["boolean"] = tostring szt["number"] = tostring szt["string"] = szstr szt["function"] = memo(szfun) szt["table"] = memo(sztbl) function serialize(d) local code = { "local _ = {}" } local value = szany(d,code,{0}) code[#code+1] = "return "..value if #code == 2 then return code[2] else return table.concat(code, "\n") end end Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 16:02:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABI2jQ9008245; Wed, 11 Nov 2009 16:02:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 91C1319368; Wed, 11 Nov 2009 16:02:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-7.csi.cam.ac.uk (ppsw-7.csi.cam.ac.uk [131.111.8.137]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62E3419357 for ; Wed, 11 Nov 2009 16:02:15 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:55550) by ppsw-7.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:25) with esmtpa (EXTERNAL:fanf2) id 1N8HWF-0000x4-NJ (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Wed, 11 Nov 2009 18:02:11 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N8HWF-0002wt-6o (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Wed, 11 Nov 2009 18:02:11 +0000 Date: Wed, 11 Nov 2009 18:02:11 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: table output In-Reply-To: Message-ID: References: <20091110095730.72815afb@o> <1079b050911100144m58c18a5fl6ff31b54c74caa11@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Wed, 11 Nov 2009, Tony Finch wrote: > > local function char(c) return ("\\%3d"):format(c:byte()) end > local function szstr(s) return ('"%s"'):format(s:gsub("[^ !#-~]", char)) end Oops, that should be "\\%03d" Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 16:26:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABIQsdL014789; Wed, 11 Nov 2009 16:26:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85D96192F9; Wed, 11 Nov 2009 16:26:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 262501916D for ; Wed, 11 Nov 2009 16:26:20 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8HtY-00059h-00; Wed, 11 Nov 2009 19:26:16 +0100 Date: Wed, 11 Nov 2009 19:25:50 +0100 From: Mike Pall To: Lua list Subject: Re: luajit 2.0: string.dump with temporally switched-off luajit possible? Message-ID: <20091111182550.GA10400@mike.de> References: <486CCF3C.1080005@svox.com> <4AFAF467.8090506@svox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFAF467.8090506@svox.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Dr. Markus Walther wrote: > Somewhat related, is the non-JIT interpreter that ships with luajit 2.0 > byte-code-compatible with the official Lua interpreter? There is only one bytecode format in LJ2. It's not compatible with the Lua bytecode. > However, for a specific need I wrote in Lua a bytecode verifier to > characterize some subset of 'safe' bytecodes similar to what is > described in the Gems book. You don't need a bytecode dump for this in LJ2. It has a full reflection API for its bytecode. You can look into src/bc.lua to see how to use the high-level API: local bc = require("jit.bc") local function foo() print("hello") end bc.dump(foo) --> -- BYTECODE -- [...] print(bc.line(foo, 2)) --> 0002 KSTR 1 1 ; "hello" In your case, the low-level API might be a better fit. Here's a simple bytecode checker which verifies that a function can't create any sub-functions (closures) -- modify as needed: local jutil = require("jit.util") local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc local bcnames = require("jit.vmdef").bcnames local band = require("bit").band local sub = string.sub local function verifyfunc(func) local fi = funcinfo(func) if not fi or not fi.bytecodes then error("not a lua function", 2) end for pc=1,fi.bytecodes do local ins, m = funcbc(func, pc) if not ins then break end local oidx = 6*band(ins, 0xff) local name = sub(bcnames, oidx+1, oidx+6) if name == "FNEW " then return false end end return true end local function f() end local function g() return function() end end print(verifyfunc(f)) --> true print(verifyfunc(g)) --> false --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 17:39:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABJdJCS031100; Wed, 11 Nov 2009 17:39:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1FD1519344; Wed, 11 Nov 2009 17:38:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s60.bay0.hotmail.com (bay0-omc3-s60.bay0.hotmail.com [65.54.246.219]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A980119144 for ; Wed, 11 Nov 2009 17:38:05 -0200 (BRST) Received: from SN1PRD0201HT002.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s60.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 11 Nov 2009 11:37:58 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.62) with Microsoft SMTP Server (TLS) id 14.0.482.35; Wed, 11 Nov 2009 19:37:57 +0000 Message-ID: <4AFB1283.3000308@my.erau.edu> Date: Wed, 11 Nov 2009 14:37:39 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies References: <4AF91B8D.10808@my.erau.edu> <20091110081507.GA11131@mike.de> <4AF92742.4030104@my.erau.edu> <20091110085847.GB12856@mike.de> In-Reply-To: <20091110085847.GB12856@mike.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Nov 2009 19:37:58.0301 (UTC) FILETIME=[78E99CD0:01CA6306] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Mike Pall wrote: > Matthew P. Del Buono wrote: >> lj_BC_TGETS = 13.81 (LuaJIT) > > That's a field or method access in the interpreter, i.e. obj.field > or obj:method. Interesting that this makes it to the top. > >> lj_str_new = 7.17 (LuaJIT) > > Umm, you're creating or hashing a lot of strings there? If it's > from Lua, then check for string.sub or the concat operator (..). > > If it's from C, then check for lua_pushstring, lua_getfield, > lua_setfield. Too many of the latter two means you should consider > redesigning your C code (don't access Lua objects by name, use > references). > It's interesting you bring this up. After some other analysis, I had determined we are in fact hitting a border case which hits both of these problems simultaneously. We are constantly sticking an object in and out of the registry. We index the registry for classifiers by string, so this was resulting in strings being created a lot, and a lot of getfield/setfield operations. I have already proposed the change to use a static char's address as the key instead of a string, and the latter problem of getfield/setfield should disappear when we are no longer hitting that border case in the application (there's not much that can be done about it). >>>> Because it's not a standalone application, it seems I can't use >>>> the "-jv" option. >>> I bet you can. Just redirect it to a file: >>> >>> require("jit.v").start("dump.txt") >> Very nice, thanks :) > > This should tell you why it doesn't compile much of your code. > Probably because it has too many Lua <-> C transitions (a common > trace abort reason would be: "NYI: C function ..."). > > --Mike Actually I wasn't getting that; I was getting a different warning instead: [TRACE --- config.lua:9 -- NYI: return to lower frame at config.lua:10] But this appears rarely so I think it is a non-issue. I'm seeing performance improvement now, after a little work, of about 100 FPS, due to LuaJIT. This is without the registry change I mentioned earlier. Thanks again for the assistance as well as the great software :) Regards, ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 18:26:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABKQ8Ja009691; Wed, 11 Nov 2009 18:26:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8434191EE; Wed, 11 Nov 2009 18:25:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 062281902A for ; Wed, 11 Nov 2009 18:25:23 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8Jkl-0005FO-00; Wed, 11 Nov 2009 21:25:19 +0100 Date: Wed, 11 Nov 2009 21:25:16 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT2 - Performance Expectancies Message-ID: <20091111202516.GA15244@mike.de> References: <4AF91B8D.10808@my.erau.edu> <20091110081507.GA11131@mike.de> <4AF92742.4030104@my.erau.edu> <20091110085847.GB12856@mike.de> <4AFB1283.3000308@my.erau.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFB1283.3000308@my.erau.edu> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew P. Del Buono wrote: > We index the registry for classifiers by string, so > this was resulting in strings being created a lot, and a lot of > getfield/setfield operations. I have already proposed the change to use > a static char's address as the key instead of a string, and the latter > problem of getfield/setfield should disappear when we are no longer > hitting that border case in the application (there's not much that can > be done about it). Even faster is to use lua_rawgeti(). Either assign the indexes at runtime with luaL_ref, or use fixed indexes and an extra lookup table. Make sure the indexes are contiguous and start at 1 (for LJ2 it's ok to start at 0, too). The fastest way is to store an identifying object (e.g. a metatable) in an upvalue of the C function and compare it with lua_rawequal(). This can get a bit tedious if you need to check for more than one id or need the upvalues for other things. > Actually I wasn't getting that; I was getting a different warning instead: > [TRACE --- config.lua:9 -- NYI: return to lower frame at config.lua:10] > > But this appears rarely so I think it is a non-issue. If it's not in an inner loop, then it probably doesn't matter. But this NYI is high on my TODO list. --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 18:56:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABKu81i015630; Wed, 11 Nov 2009 18:56:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E7DC319351; Wed, 11 Nov 2009 18:55:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7691F191B7 for ; Wed, 11 Nov 2009 18:55:31 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 998931AA92EA for ; Wed, 11 Nov 2009 15:55:27 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nABKtR65021660 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 15:55:27 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 15:55:27 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111205527.GA11512@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111112452.GA22594@mike.de> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Mike Pall once stated: > Luiz Henrique de Figueiredo wrote: > > > The "-i" option loads readline which as a side-effect initializes > > > the NLS locale for the current process from the environment variables. > > > > If available, readline is compiled into the interpreter. You don't need > > to use -i to activate it. Do you mean that when you do use interactive > > input then a function from the readline library gets called and only then > > the OS loads the readline library? And so readline is not loaded at all > > when running the interpreter in batch? > > I should have been more precise. The shared library is always > loaded (which is a waste without -i). The first time a readline > function is called (only with -i), it's initialized and it sets > the locale. The "-i" option is used to load a script and continue into interactive mode. If you just run "lua" you still end up in interactive mode. When I run "strace -e open lua" I get the following: open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib/tls/libm.so.6", O_RDONLY) = 3 open("/lib/libdl.so.2", O_RDONLY) = 3 open("/usr/lib/libreadline.so.4", O_RDONLY) = 3 open("/usr/lib/libhistory.so.4", O_RDONLY) = 3 open("/usr/lib/libncurses.so.5", O_RDONLY) = 3 open("/lib/tls/libc.so.6", O_RDONLY) = 3 Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio open("/usr/share/terminfo/x/xterm", O_RDONLY) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 open("/etc/inputrc", O_RDONLY) = 3 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 > That final ">" is the Lua prompt. Now, let's load a script with "strace -e open lua -i default.lua" ("default.lua" being the 80M script---this takes only 15 seconds): open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib/tls/libm.so.6", O_RDONLY) = 3 open("/lib/libdl.so.2", O_RDONLY) = 3 open("/usr/lib/libreadline.so.4", O_RDONLY) = 3 open("/usr/lib/libhistory.so.4", O_RDONLY) = 3 open("/usr/lib/libncurses.so.5", O_RDONLY) = 3 open("/lib/tls/libc.so.6", O_RDONLY) = 3 Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio open("default.lua", O_RDONLY) = 3 open("/usr/share/terminfo/x/xterm", O_RDONLY) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 open("/etc/inputrc", O_RDONLY) = 3 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 > Hmm ... curious. The script is loaded first, then the locale stuff. What has me really bugged is when I do this: [spc]lucy:/tmp/lua>lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("show.lua") --NOTE! I'm typing this > dofile("default.lua") --this too! > it only takes less than 15 seconds. Yet doing: [spc]lucy:/tmp/lua>lua -i show.lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("default.lua") --NOTE! I'm typing this > takes six minutes. Other than the slight differences in how the script is loaded via "-i" on the command line and dofile() from within the interpreter, I don't why one way should take 15 seconds and the other way 6 minutes. So I decided to profile Lua under the various conditions. First, "lua -i show.lua / dofile('default.lua')": Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 97.71 314.31 314.31 2888775 0.00 0.00 luaS_newlstr 0.34 315.40 1.09 8932847 0.00 0.00 luaH_getstr 0.30 316.37 0.97 2154477 0.00 0.00 read_string 0.27 317.23 0.85 10442038 0.00 0.00 llex 0.13 317.63 0.41 67142148 0.00 0.00 save 0.08 317.89 0.26 3264403 0.00 0.00 addk 0.07 318.10 0.21 3891495 0.00 0.00 newkey [ snip ] Doing any other combination ("lua -i default.lua / dofile('show.lua')" or "lua / dofile('show.lua') dofile('default.lua')" or "lua / dofile('default.lua') dofile('show.lua')" results in the following profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 17.75 1.04 1.04 2154477 0.00 0.00 read_string 9.47 1.59 0.56 10442038 0.00 0.00 llex 9.39 2.15 0.55 2888775 0.00 0.00 luaS_newlstr 7.34 2.58 0.43 8932844 0.00 0.00 luaH_getstr 7.00 2.98 0.41 67142145 0.00 0.00 save 3.24 3.17 0.19 4 0.05 0.22 luaV_execute 2.82 3.34 0.17 704940 0.00 0.00 setnodevector 2.73 3.50 0.16 5422300 0.00 0.00 mainposition 2.30 3.63 0.14 3891495 0.00 0.00 newkey [ snip ] And yes, all three of those return *identical* profiling results. And I can verify that in all four cases, the entirety of the 80m script is loaded. -spc (Curiouser and curiouser ... ) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 19:04:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABL4CxC016914; Wed, 11 Nov 2009 19:04:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5917019131; Wed, 11 Nov 2009 19:03:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4686E1909C for ; Wed, 11 Nov 2009 19:03:42 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 374D31AA92EA for ; Wed, 11 Nov 2009 16:03:41 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nABL3f5k023755 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 16:03:41 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 16:03:41 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111210341.GA23636@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111112452.GA22594@mike.de> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Mike Pall once stated: > Luiz Henrique de Figueiredo wrote: > > > The "-i" option loads readline which as a side-effect initializes > > > the NLS locale for the current process from the environment variables. > > > > If available, readline is compiled into the interpreter. You don't need > > to use -i to activate it. Do you mean that when you do use interactive > > input then a function from the readline library gets called and only then > > the OS loads the readline library? And so readline is not loaded at all > > when running the interpreter in batch? > > I should have been more precise. The shared library is always > loaded (which is a waste without -i). The first time a readline > function is called (only with -i), it's initialized and it sets > the locale. > > You can verify that by comparing the output of these two commands: > strace -e open lua -v > strace -e open lua -i If you have the environment variables LANG or LC_* set, the output > of the 2nd command shows it opens lots of locale related files. I also did a generic build of Lua, to avoid the whole readline issue and the results are the same as before: "lua -i show.lua / dofile('default.lua')" takes 6 minutes, other combinations take 15 seconds or less. -spc (Just in case anyone asks) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 19:17:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABLHmRp018802; Wed, 11 Nov 2009 19:17:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB17219365; Wed, 11 Nov 2009 19:17:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5872E192C4 for ; Wed, 11 Nov 2009 19:17:20 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8KZ5-0005IQ-00; Wed, 11 Nov 2009 22:17:19 +0100 Date: Wed, 11 Nov 2009 22:17:14 +0100 From: Mike Pall To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111211714.GA18099@mike.de> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111205527.GA11512@brevard.conman.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sean Conner wrote: > 97.71 314.31 314.31 2888775 0.00 0.00 luaS_newlstr > 9.39 2.15 0.55 2888775 0.00 0.00 luaS_newlstr Umm, can you get a line-by-line profile? If not, then maybe compile lstring.c with -O2 -fno-inline and see what pops up. One explanation for this difference would be excessive string hash collisions. But I don't know how that could be triggered by the interactive mode (well, it creates a few strings). You may want to measure the length of the chain in luaS_newlstr and print a message if it exceeds (say) 50. The chain length should be somwhere between 1 and 3 on average. You could also trace the calls to luaS_resize. The string table usually grows and only occasionally shrinks. But there shouldn't be continuous resizing. --Mike From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 20:29:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABMTRKc027521; Wed, 11 Nov 2009 20:29:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67D3619353; Wed, 11 Nov 2009 20:28:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3603119235 for ; Wed, 11 Nov 2009 20:28:47 -0200 (BRST) Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id DAED4D4801C for ; Wed, 11 Nov 2009 23:28:42 +0100 (CET) Received: from [192.168.0.190] (pha90-1-88-183-120-3.fbx.proxad.net [88.183.120.3]) by smtp5-g21.free.fr (Postfix) with ESMTP id 09809D480B5 for ; Wed, 11 Nov 2009 23:28:39 +0100 (CET) From: Alexandre Becoulet To: lua@bazar2.conectiva.com.br Subject: QtLua library 1.1 released Date: Wed, 11 Nov 2009 23:28:39 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911112328.39300.alexandre.becoulet@free.fr> X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, QtLua library 1.1 has been released. Sources, examples and manual are available here: http://www.nongnu.org/libqtlua/ Changes are: * MVC classes were improved with drag and drop support and selection policy. * UserObject class has been added * Some usefull shortcut member functions have been added * Documentation has been updated. * Minor fixes QtLua is considered stable. -- Alexandre From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 20:53:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABMr8Sc029679; Wed, 11 Nov 2009 20:53:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0500193A6; Wed, 11 Nov 2009 20:52:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58303193A0 for ; Wed, 11 Nov 2009 20:52:38 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 54F301AA92EA for ; Wed, 11 Nov 2009 17:52:37 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nABMqbVV016094 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 17:52:37 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 17:52:37 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111225237.GA13831@brevard.conman.org> References: <20091110104637.GA6015@brevard.conman.org> <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111211714.GA18099@mike.de> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Mike Pall once stated: > Sean Conner wrote: > > 97.71 314.31 314.31 2888775 0.00 0.00 luaS_newlstr > > 9.39 2.15 0.55 2888775 0.00 0.00 luaS_newlstr > > Umm, can you get a line-by-line profile? If not, then maybe > compile lstring.c with -O2 -fno-inline and see what pops up. > > One explanation for this difference would be excessive string hash > collisions. But I don't know how that could be triggered by the > interactive mode (well, it creates a few strings). > > You may want to measure the length of the chain in luaS_newlstr > and print a message if it exceeds (say) 50. The chain length > should be somwhere between 1 and 3 on average. > > You could also trace the calls to luaS_resize. The string table > usually grows and only occasionally shrinks. But there shouldn't > be continuous resizing. Hmm ... interesting. In the six minute run, luaS_resize is called 469488 times, but in the other three cases, it's only called 15 times. And in looking over the profiler output, there are a lot of similarities, but some very curious differences as well. Six minute run: ----------------------------------------------- 0.00 0.00 1/469488 f_luaopen [136] 0.14 0.00 469487/469488 newlstr [53] [62] 0.0 0.14 0.00 469488 luaS_resize [62] 0.00 0.00 12/2101456 luaM_realloc_ [76] ----------------------------------------------- 15 second run: ----------------------------------------------- 0.01 0.00 1/15 f_luaopen [107] 0.08 0.00 14/15 newlstr [49] [56] 1.5 0.09 0.00 15 luaS_resize [56] 0.00 0.00 30/2101448 luaM_realloc_ [86] ----------------------------------------------- -spc (Perhaps some pathological case I'm hitting?) From lua-bounces@bazar2.conectiva.com.br Wed Nov 11 21:27:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nABNRHiF000384; Wed, 11 Nov 2009 21:27:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8511C1939B; Wed, 11 Nov 2009 21:26:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D523D19384 for ; Wed, 11 Nov 2009 21:26:40 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8MaE-0005S9-00; Thu, 12 Nov 2009 00:26:38 +0100 Date: Thu, 12 Nov 2009 00:26:23 +0100 From: Mike Pall To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091111232623.GA23880@mike.de> References: <4AFA35A2.7020903@danielstephens.com> <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111225237.GA13831@brevard.conman.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sean Conner wrote: > ----------------------------------------------- > 0.00 0.00 1/469488 f_luaopen [136] > 0.14 0.00 469487/469488 newlstr [53] > [62] 0.0 0.14 0.00 469488 luaS_resize [62] > 0.00 0.00 12/2101456 luaM_realloc_ [76] > ----------------------------------------------- Yes, that's an excessive number of calls to luaS_resize. But it still spends very little time in that function and it only causes 12 actual resizes. So I think it's hitting this check: if (G(L)->gcstate == GCSsweepstring) return; /* cannot resize during GC traverse */ What this probably means is that the string table needs to grow, but can't, because the GC is stuck in the sweepstring phase. It tries very often (on every string allocation), but never succeeds. This way the hash chains grow without bounds, which seriously destroys the performance. The #1 question is now: why is the GC stuck? Because usually every string allocation is accompanied with a GC check. And once the threshold is reached, the GC is driven forward and should quickly get out of the sweepstring phase. I think luaX_newstring() in llex.c must be the culprit. You can try to add a GC check just before the 'return ts' at line 123: luaC_checkGC(L); If this solves the problem, then you've found a bug in Lua. Congratulations -- it doesn't happen that often. :-) --Mike From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 00:30:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC2UTxe018116; Thu, 12 Nov 2009 00:30:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 197C419384; Thu, 12 Nov 2009 00:30:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 427C219169 for ; Thu, 12 Nov 2009 00:29:52 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 6C0D71AA92EA for ; Wed, 11 Nov 2009 21:29:51 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAC2Tp2x005243 for lua@bazar2.conectiva.com.br; Wed, 11 Nov 2009 21:29:51 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Wed, 11 Nov 2009 21:29:51 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091112022951.GA3325@brevard.conman.org> References: <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111232623.GA23880@mike.de> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Mike Pall once stated: > The #1 question is now: why is the GC stuck? Because usually every > string allocation is accompanied with a GC check. And once the > threshold is reached, the GC is driven forward and should quickly > get out of the sweepstring phase. > > I think luaX_newstring() in llex.c must be the culprit. You can > try to add a GC check just before the 'return ts' at line 123: > luaC_checkGC(L); > > If this solves the problem, then you've found a bug in Lua. > Congratulations -- it doesn't happen that often. :-) I tried that, and nope. Still takes six minutes. -spc (And I'd like to thank you for your help so far 8-) From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 04:53:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC6rcPM007897; Thu, 12 Nov 2009 04:53:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58695192E6; Thu, 12 Nov 2009 04:53:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1B95192D0 for ; Thu, 12 Nov 2009 04:53:01 -0200 (BRST) Received: by gxk26 with SMTP id 26so1794147gxk.1 for ; Wed, 11 Nov 2009 22:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=2LXwmvZHfDW5TXjvRZF7V72+HYnK1ZCDrCaxEE1tifA=; b=Z6WcGpnEQwmZJSm3Y+k5nvILCrSRPdyDYGArjw/7p/bSj6D/H/J9G8CVgbDl3H75vI u6s5q99dYbjqoIzSTV/fCD5PJfsIzMgjeW+5wnq31y/gKgn0Nh+Q0n3fb4C2OQPYQqqB RN+a+nMdpf06UNzfIxW90R1R8EGLMyoNuFhrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=wrxb9fE6HlcDT/Ubrfw5QZlnk+9xVjckCHr1lEmBB5dKjbYgaeonOQ9zxPl8qURLbk W3vCXBye4epWFjJBB8jSj6/rZLUqP+vDnrOy0blHmG7piEtaxZ9PmUQK0Qtie6ENT31Y tLlAn8IKJeGGTExHmV/dTy3c7eYAwAW+Z+rd4= Received: by 10.90.37.36 with SMTP id k36mr3752285agk.111.1258008779683; Wed, 11 Nov 2009 22:52:59 -0800 (PST) Received: from ?192.168.1.2? ([124.13.54.104]) by mx.google.com with ESMTPS id 39sm1197431yxd.45.2009.11.11.22.52.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Nov 2009 22:52:59 -0800 (PST) Message-ID: <4AFBB0C2.9000502@gmail.com> Date: Thu, 12 Nov 2009 14:52:50 +0800 From: KHMan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> In-Reply-To: <20091112022951.GA3325@brevard.conman.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Sean Conner wrote: > It was thus said that the Great Mike Pall once stated: >> The #1 question is now: why is the GC stuck? Because usually every >> string allocation is accompanied with a GC check. And once the >> threshold is reached, the GC is driven forward and should quickly >> get out of the sweepstring phase. >> >> I think luaX_newstring() in llex.c must be the culprit. You can >> try to add a GC check just before the 'return ts' at line 123: >> luaC_checkGC(L); >> >> If this solves the problem, then you've found a bug in Lua. >> Congratulations -- it doesn't happen that often. :-) > > I tried that, and nope. Still takes six minutes. > > -spc (And I'd like to thank you for your help so far 8-) Any chance you can post some equivalent script files for the list to hack on? Turns out this thingy might benefit if more people have their hands on something they can run and debug. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 06:12:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC8Cbf0014397; Thu, 12 Nov 2009 06:12:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C9060192CB; Thu, 12 Nov 2009 06:12:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EF40192A0 for ; Thu, 12 Nov 2009 06:12:08 -0200 (BRST) Received: by bwz27 with SMTP id 27so1908151bwz.21 for ; Thu, 12 Nov 2009 00:12:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.24.17 with SMTP id t17mr2739729bkb.142.1258013524328; Thu, 12 Nov 2009 00:12:04 -0800 (PST) In-Reply-To: <5e7d91620911110817nc788018xca414acc3f9d768e@mail.gmail.com> References: <20091109112841.4eeae459@trite.i.flarn.net.i.flarn.net> <5e7d91620911110817nc788018xca414acc3f9d768e@mail.gmail.com> Date: Thu, 12 Nov 2009 10:12:04 +0200 X-Google-Sender-Auth: 7e03d00abb853b40 Message-ID: Subject: Re: Unix Domain Sockets in Lua From: Cosmin Apreutesei To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > rock, though. I can think of two ways to do that, but I'm not sure > which is better: to patch the Makefile to make it build unix.so or to > change the rockspec to the builtin build type. obvious choice: change the rockspec to the builtin build type :) From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 07:04:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC94CmR018637; Thu, 12 Nov 2009 07:04:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D40AB193EB; Thu, 12 Nov 2009 07:03:45 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26347193E2 for ; Thu, 12 Nov 2009 07:03:40 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 535691AA92EC for ; Thu, 12 Nov 2009 04:03:38 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAC93bpO026535 for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 04:03:37 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Thu, 12 Nov 2009 04:03:37 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091112090337.GA22238@brevard.conman.org> References: <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFBB0C2.9000502@gmail.com> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great KHMan once stated: > > Any chance you can post some equivalent script files for the list > to hack on? Turns out this thingy might benefit if more people > have their hands on something they can run and debug. I think I can do that, but it probably won't be until Friday when I get a chance to randomize the data in the huge file (it's the headers of a ton of email since 1991). -spc From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 07:49:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC9nmPC022618; Thu, 12 Nov 2009 07:49:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38FC819409; Thu, 12 Nov 2009 07:49:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EDA49193F1 for ; Thu, 12 Nov 2009 07:49:12 -0200 (BRST) Received: by fxm21 with SMTP id 21so2002373fxm.21 for ; Thu, 12 Nov 2009 01:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=zN2O4PirAjK7b/M7N+mywANbzCxr4VMmhEcqrfTY/0k=; b=Wy8a02sNLph26vdo/x1v+kfSsVMB6SojeaXr3Z8+YK5skeFXqT2Ixsn2eTkkggvfRu 7AAWo/+0BKHWyrCIP5/4Wu+Ub2BwLioCz+sBrnLkb1rz+3+HR0+vVdfI/S8YZLgfGWna tfPW8VIxa/BxgOAbmsAyaTixKridglYLtGYrA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=qW1pzpKI+0tpoCgqbv7TydPfFWTEY7/yFzdV5YBaYk7m+ue7VOp0WMSg6mA9NTgbmx 1Rk6ZVpnr5hPsT2OwmWPFG+3q+V0Z3yrOs0ItrO88BMk+SC00dl3F1K7yzqsiCNNHNOZ R7Sp0hqQv5KMJKPvgPRsX9sC9Np+kPVwN3y0U= MIME-Version: 1.0 Received: by 10.216.90.74 with SMTP id d52mr623499wef.51.1258019350166; Thu, 12 Nov 2009 01:49:10 -0800 (PST) In-Reply-To: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> From: Jerome Vuarand Date: Thu, 12 Nov 2009 10:48:50 +0100 Message-ID: <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly To: Lua Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/10 Jerome Vuarand : > I'm trying to write a copas-like module that handles both incoming and > outgoing connections. Since the socket:connect operation can take some > time, and I may have other sockets ready to do something, I'm setting > the timeout to zero, I call connect, but then select is not working as > expected on Windows. > > Here is a test script: > > #!/usr/bin/env lua > > require 'socket' > > function test(ip, port) > local master = assert(socket.tcp()) > master:settimeout(0) > print(master) > local success,err = master:connect(ip, port) > print(master, success, err) > if not success and err=='timeout' then > socket.select({}, {master}) > success,err = master:connect(ip, port) > print(master, success,err) > end > end > > print("valid address 1") > test('127.0.0.1', 80) > print("valid address 2") > test('127.0.0.1', 2000) > print("invalid address") > test('127.0.0.1', 44444) > > Note that I have a server on port 80 (Apache), and a custom LuaSocket > server on port 2000. There is nothing on port 44444. > > On Linux, select returns as soon as the connection status is known. I > have to call connect again to determine if it succeeded or not, here > is the log: > > doub@blimbox:~/test$ lua test > valid address 1 > tcp{master}: 0x80738d4 > tcp{client}: 0x80738d4 nil timeout > tcp{client}: 0x80738d4 1 nil > valid address 2 > tcp{master}: 0x8075b0c > connection on PIC > tcp{client}: 0x8075b0c nil timeout > tcp{client}: 0x8075b0c 1 nil > invalid address > tcp{master}: 0x8077d4c > tcp{client}: 0x8077d4c nil timeout > tcp{client}: 0x8077d4c nil connection refused > doub@blimbox:~/test$ > > On Windows however, when the connection succeeds, the socket is > already connected and calling connect again triggers an error. And if > the connection fails, select never returns. Note the Ctrl+C in the log > that I had to do to kill the program : > > C:\test>lua test > valid address 1 > tcp{master}: 00465008 > tcp{client}: 00465008 nil timeout > tcp{client}: 00465008 nil already connected > valid address 2 > tcp{master}: 00467078 > tcp{client}: 00467078 nil timeout > tcp{client}: 00467078 nil already connected > invalid address > tcp{master}: 00469150 > tcp{client}: 00469150 nil timeout > ^C > C:\test> > > On both platforms I'm using LuaSocket 2.0.2. > > Can anybody else reproduce the problem ? Is there a known workaround ? > I haven't tried the 2.0.3 beta, should I ? Any help would be > appreciated. A quick test on a friend's mac shows that on OSX the behaviour is again different: on failure select returns, and connect returns nil,"connection failed", while on success select also returns, but connect returns nil,"already connected". Am I hitting some undefined use case of the BSD sockets API ? From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 07:56:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAC9ucrO023240; Thu, 12 Nov 2009 07:56:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3A96219428; Thu, 12 Nov 2009 07:56:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from redflag.CS.Princeton.EDU (redflag.CS.Princeton.EDU [128.112.136.72]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35B211941D for ; Thu, 12 Nov 2009 07:56:17 -0200 (BRST) Received: from opus.CS.Princeton.EDU (opus.CS.Princeton.EDU [128.112.155.165]) (authenticated bits=0) by redflag.CS.Princeton.EDU (8.13.8/8.13.8) with ESMTP id nAC9uEZj007598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 12 Nov 2009 04:56:15 -0500 (EST) Date: Thu, 12 Nov 2009 04:56:14 -0500 (EST) From: Diego Nehab To: Lua list Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly In-Reply-To: <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> Message-ID: References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=nai engine=5.3.00 definitions=5799 signatures=578974 X-Proofpoint-Spam-Reason: safe X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi, > A quick test on a friend's mac shows that on OSX the > behaviour is again different: on failure select returns, > and connect returns nil,"connection failed", while on > success select also returns, but connect returns > nil,"already connected". Am I hitting some undefined use > case of the BSD sockets API ? This is the expected behavior. "Already connected" is an error message that means there is no error. It is what you should get in this case and means connection succeeded. The failure you are getting is hitting you so quick that select is returning right away, so no problem there either. Can you tell me more about the error you get when you try to call connect() again on Windows? Regards, Diego From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 08:58:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACAwHHU030667; Thu, 12 Nov 2009 08:58:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC6FF1940F; Thu, 12 Nov 2009 08:57:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 48F8219324 for ; Thu, 12 Nov 2009 08:57:42 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACAvepO030594 for ; Thu, 12 Nov 2009 08:57:40 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nACAvdB05499; Thu, 12 Nov 2009 08:57:39 -0200 Date: Thu, 12 Nov 2009 08:57:38 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091112085738.A5488@lua.tecgraf.puc-rio.br> References: <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091112090337.GA22238@brevard.conman.org>; from sean@conman.org on Thu, Nov 12, 2009 at 04:03:37AM -0500 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > I think I can do that, but it probably won't be until Friday when I get a > chance to randomize the data in the huge file (it's the headers of a ton of > email since 1991). Changing the data will probably change the problem if it's related to hashing. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 09:17:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACBHN2Y000684; Thu, 12 Nov 2009 09:17:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3043C19474; Thu, 12 Nov 2009 09:17:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7980119418 for ; Thu, 12 Nov 2009 09:16:57 -0200 (BRST) Received: by bwz27 with SMTP id 27so2078476bwz.21 for ; Thu, 12 Nov 2009 03:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=qRCTewovpOLV5sPlBzv7wyc9ZWOAQ1SH6PW1BdRf9J8=; b=U6OUPknEmk/fWCaUjazoFfVPDH47RaRxftn13WMR2MX4695LvC134pHaqlrnOf7mgA 3ThFJzv4oDT5lCEIEyvfR4K278iWYWykNZtBluZhHjMg/tDjdUn1tlFa8KqsjTW3AXv9 GgXevv5OMR97Mmz7KeVquatEcOoRWN0GU8q70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=Hgn331VIchG91+rcKrbzY/2lxdgb1lQZSHp6Ao4TkDgki1j3nmOtL67J96CqDMt1M4 0dmj4dAFtBhfzQjhwyx99WpQazsY4HdO3tqfNJJlJrTFOalSu8QG1J17TQYeSqJ1kIiD 21khmEl72ggHMbQlBKSvrnj0ZVsgHltErXELg= MIME-Version: 1.0 Received: by 10.239.145.15 with SMTP id q15mr269785hba.121.1258024614745; Thu, 12 Nov 2009 03:16:54 -0800 (PST) Date: Thu, 12 Nov 2009 13:16:54 +0200 Message-ID: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> Subject: Coroutines and Go From: steve donovan To: Lua list Content-Type: text/plain; charset=windows-1252 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nACBHN2Y000684 http://golang.org/doc/go_lang_faq.html A most interesting paragraph: [[ Goroutines are part of making concurrency easy to use. The idea, which has been around for a while, is to multiplex independently executing functions—coroutines, really—onto a set of threads. When a coroutine blocks, such as by calling a blocking system call, the run-time automatically moves other coroutines on the same operating system thread to a different, runnable thread so they won't be blocked. The programmer sees none of this, which is the point. The result, which we call goroutines, can be very cheap: unless they spend a lot of time in long-running system calls, they cost little more than the memory for the stack. ]] We obviously don't need to be convinced about coroutines, but the idea of moving blocked ones to another thread is intriguing. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:02:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACC1vJt008595; Thu, 12 Nov 2009 10:01:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B5C7A1949A; Thu, 12 Nov 2009 10:01:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 62C4F19493 for ; Thu, 12 Nov 2009 10:01:15 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N8YMP-0005k6-Lj for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 12:01:09 +0000 Message-ID: <4AFBF905.3020004@cowlark.com> Date: Thu, 12 Nov 2009 12:01:09 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> In-Reply-To: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 steve donovan wrote: > http://golang.org/doc/go_lang_faq.html I've been looking at Go. It's interesting, but a bit of a mess --- it looks like the language grew organically rather than was designed. It suffers badly from keyword hell, with names like 'iota', 'len', 'cap', 'new', 'make' all being reserved. It's missing stuff like exceptions. There's a weird apologia for not having assert(). You can't use structs as map keys (I don't know about pointers). It's got a rather muddled mixture of pointer types and reference types. The word 'goroutine' should be taken out and shot. And personally, I think the syntax is appallingly ugly: func (p *ByteSlice) Write(data []byte) (n int, err os.Error) ...defines a method on 'pointer to ByteSlice' (you can define methods on pretty much any type, not just objects) with self called 'p', taking an array of bytes called 'data' as parameter, returning a tuple of int and os.Error. There's a lot about it to like. The defer keyword is interesting (you attach it to a statement and the statement is guaranteed to get executed on function exit, after the return statement). Slices are basically bounded pointers, and are used to pass around references to segments of arrays. It's got multiple return values. Being able to define methods on anything is nice, as in the above example. Interfaces work like in OCaml, where any type implementing the interface is considered an instance of the interface. And it's got goto! And it compiles into real machine code, which is a huge plus; ix86, amd64 and ARM, too. I don't know what the code is like, though. But IMO there's nothing here that makes a compelling reason to switch to Go from my current mix of C and Lua. [...] > We obviously don't need to be convinced about coroutines, but the idea > of moving blocked ones to another thread is intriguing. I'm a bit dubious about that concept. Unless it's doing something clever with asynchronous I/O, it'll need to allocate a new system thread for every blocked coroutine. So if you have a system with 100000 coroutines, and 50% of them end up blocked on system calls at the same time, won't the runtime suddenly have to allocate 50000 system threads? People may also find Issue #9 on their bug tracker amusing: http://code.google.com/p/go/issues/detail?id=9 - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr7+QEACgkQf9E0noFvlzinbACePBCi+1V5uKRYh4zvwYfiqcTd 8+4AnjuhKp2/FG8h3S9FCF8jfdRnEJvW =Fvnx -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:05:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACC5iKb009220; Thu, 12 Nov 2009 10:05:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0235E194A5; Thu, 12 Nov 2009 10:05:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B7D911949D for ; Thu, 12 Nov 2009 10:05:12 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nACC5Ae0022523 for ; Thu, 12 Nov 2009 10:05:10 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 404F554C03F; Thu, 12 Nov 2009 10:05:11 -0200 (BRST) Date: Thu, 12 Nov 2009 10:05:11 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091112120511.GB950@inf.puc-rio.br> References: <20091111050507.GA13917@brevard.conman.org> <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091111232623.GA23880@mike.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I think luaX_newstring() in llex.c must be the culprit. You can > try to add a GC check just before the 'return ts' at line 123: > luaC_checkGC(L); > > If this solves the problem, then you've found a bug in Lua. > Congratulations -- it doesn't happen that often. :-) I guess this is a bug in Lua even if it does not solve this particular problem. The idea of not calling the collector during a parse is that it creates very little garbage. But the possibility of the collector being held at a particular bad state is real. -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:13:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCDoZ9011416; Thu, 12 Nov 2009 10:13:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 42E9D194B0; Thu, 12 Nov 2009 10:13:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8B34194AA for ; Thu, 12 Nov 2009 10:13:18 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nACCDHcx023157 for ; Thu, 12 Nov 2009 10:13:17 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id BA5D154C03F; Thu, 12 Nov 2009 10:13:17 -0200 (BRST) Date: Thu, 12 Nov 2009 10:13:17 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: Coroutines and Go Message-ID: <20091112121317.GC950@inf.puc-rio.br> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFBF905.3020004@cowlark.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > People may also find Issue #9 on their bug tracker amusing: I guess the authors did not find it amusing ;) http://portal.acm.org/citation.cfm?doid=860575.860747 Go! for multi-threaded deliberative agents Proceedings of the second international joint conference on Autonomous agents and multiagent systems. Year of Publication: 2003 Authors: Keith L. Clark, Francis G. McCabe -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:15:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCFmZG011686; Thu, 12 Nov 2009 10:15:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0189F19481; Thu, 12 Nov 2009 10:15:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 884EF19322 for ; Thu, 12 Nov 2009 10:15:14 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so1879505fga.17 for ; Thu, 12 Nov 2009 04:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=eKa/bMFYUEQu4u3+Tzb/KdVbOZymF7YVbbeg/z99j84=; b=szk91rnNincDrhxjQ5mdYcYFJ+lzDQF+rM9COQdCOZpE5Y0SNSizokPg0hdxd+lvwj xXJ8YhC6n6sgRL5b4KYb8emETEHcUMfWG0JdKkCvbKURMl7y6CF3NVZPmD5aKx1ZhNlR IS8FOkyVdtiRX0OZXU3h7gouLWhhpka/JM7uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=oOl6rZZG/uWsFCiN7pdZF0nQhiu29440HGTWGdN9lxaaNiEH4yQs1xEp8lB6xdwR4Q nBkveC7SlXv+04srlEyxMrVT+OvZd2NoNepWB6Sp9JOwaXsrRnZ+iqY1JOVU0uV6PN5l Z9hNH59RQJEVzqYsuHyYFZFmeoAEdzv6BA5qA= MIME-Version: 1.0 Received: by 10.239.184.144 with SMTP id y16mr277821hbg.188.1258028110839; Thu, 12 Nov 2009 04:15:10 -0800 (PST) In-Reply-To: <4AFBF905.3020004@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> Date: Thu, 12 Nov 2009 14:15:10 +0200 Message-ID: <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> Subject: Re: Coroutines and Go From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 2:01 PM, David Given wrote: > > func (p *ByteSlice) Write(data []byte) (n int, err os.Error) That is nasty... > And it compiles into real machine code, which is a huge plus; ix86, > amd64 and ARM, too. I don't know what the code is like, though. Well, Mike will probably be able to run rings around it in a few months ;) > But IMO there's nothing here that makes a compelling reason to switch to > Go from my current mix of C and Lua. Well, that's it; it is a classic mixture. As a Slashdot poster put it, I "lack the mental bandwidth to jump on another bandwagon" > Unless it's doing something clever with asynchronous I/O, it'll need to > allocate a new system thread for every blocked coroutine. My understanding is that any coroutines on the blocked thread get moved onto a non-blocked thread, which does not sound too catastrophic. > People may also find Issue #9 on their bug tracker amusing: > http://code.google.com/p/go/issues/detail?id=9 I quote: "I propose this name : IHAUTNF*M*PL as the formal, official name. For day-to-day activities we could use "Issue 9". ;-) " Really, Go is a silly name. For instance, Boo is another well-engineered language from Brazil, but most people won't get beyond the name. In short, there are so many PLs that they're starting to stand on each others' feet. steve d. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:24:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCOtQa013296; Thu, 12 Nov 2009 10:24:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E947194BA; Thu, 12 Nov 2009 10:24:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78115194AA for ; Thu, 12 Nov 2009 10:24:18 -0200 (BRST) Received: by fxm21 with SMTP id 21so2167320fxm.21 for ; Thu, 12 Nov 2009 04:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IivE3ANKbSCbRj5N0x/rw8XUN4YlY/M1XC8LBnHduTc=; b=qMCtJ03pmPSaNDbldpsxytljr+UZBywyViezaX2/gBIsN/gXVrGrJTJz9EMDPXvVXr dz/HF2/PeQgxgA2y+a53aZMw8mJdtI4EDNSh51GLB7B+8mZA/sR9PNtTZGBRJ05Hgily HK+N4+5DYUnRnbYneeEpEPG+IcYnkjWZJ3qic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=D4RiUkHHxYtXh2Ibx+V2h6oAXQx853+XE3bRLmBaytYEjxAqbkjht+5LoW1P0371ce P5f9cW6GxpGR4jiBsvQKsOIRlwIkCGJAt0fD36e04VA1yCb1X3PUVe04zhsw7fR7jdmf qRl5jmv4kkXAxk4pH/B7OuLVHS0jiktjeugpE= MIME-Version: 1.0 Received: by 10.239.145.163 with SMTP id s35mr300354hba.42.1258028654406; Thu, 12 Nov 2009 04:24:14 -0800 (PST) In-Reply-To: <20091112121317.GC950@inf.puc-rio.br> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <20091112121317.GC950@inf.puc-rio.br> Date: Thu, 12 Nov 2009 14:24:14 +0200 Message-ID: <560972290911120424o16f938a9of2a937d0817bff45@mail.gmail.com> Subject: Re: Coroutines and Go From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 2:13 PM, Roberto Ierusalimschy wrote: > http://portal.acm.org/citation.cfm?doid=860575.860747 It's a very interesting paper. It would be cool if such concepts could be clearly expressed in Lua, since Go! is not exactly a beautiful language. Why don't people pick nice unique names that can be usefully searched for? From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:25:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCPT7g013452; Thu, 12 Nov 2009 10:25:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1337194AA; Thu, 12 Nov 2009 10:24:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40505194BD for ; Thu, 12 Nov 2009 10:24:49 -0200 (BRST) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id B0E9B187C2 for ; Thu, 12 Nov 2009 12:24:40 +0000 (GMT) Message-ID: <4AFBFE87.7040100@objmedia.demon.co.uk> Date: Thu, 12 Nov 2009 12:24:39 +0000 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: <4AFBF905.3020004@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > And personally, I think the syntax is appallingly ugly: > Agreed. I have to stop and look at the code to read it rather than just read it. Which for something which says it is C-like is very un-C-like. They seem proud of not having enumerations. I'd have thought the dreadful mistake of omitting them from Java (which has now added them back into the language) had been learned by now. "iota" seems to be a passing nod to the concept of monotonically increasing values (which is how most enums, but not all, work). But integers are not a typesafe substitute for enums. Perhaps I've missed something about Go and enumerations (I was tired when reading about it) but I think that is something that needs addressing. If I've got that wrong, someone please correct me. > There's a lot about it to like. Yes. They seem to have taken quite a few concepts from dynamic languages and type inference languages and added them. > The defer keyword is interesting (you > attach it to a statement and the statement is guaranteed to get executed > on function exit, after the return statement). Kind of like "finally", but for functions not exceptions. Very useful for cleanup. Anyone that has seen C code with "goto cleanupAndExit" in it will love defer. So much nicer (if it works like I think it should) > system calls at the same time, won't the runtime suddenly have to > allocate 50000 system threads? > And (on Windows) it will need to acquire 50GB (in 1MB contiguous chunks, 1MB per thread that needs its own stack) from somewhere for that. Ouch! Good luck with that :-) I hope they've planned some sort of recover mechanism for goroutines that can't be dumped to their own thread. Stephen From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:31:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCVPvS014686; Thu, 12 Nov 2009 10:31:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 192DC1951F; Thu, 12 Nov 2009 10:30:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nskntmtas06p.mx.bigpond.com (nskntmtas06p.mx.bigpond.com [61.9.168.152]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28D52194AE for ; Thu, 12 Nov 2009 10:30:39 -0200 (BRST) Received: from nskntotgx03p.mx.bigpond.com ([58.168.43.68]) by nskntmtas06p.mx.bigpond.com with ESMTP id <20091112123029.YQYK26025.nskntmtas06p.mx.bigpond.com@nskntotgx03p.mx.bigpond.com> for ; Thu, 12 Nov 2009 12:30:29 +0000 Received: from [10.0.0.8] (really [58.168.43.68]) by nskntotgx03p.mx.bigpond.com with ESMTP id <20091112123029.IYRR24930.nskntotgx03p.mx.bigpond.com@[10.0.0.8]> for ; Thu, 12 Nov 2009 12:30:29 +0000 Message-ID: <4AFBFD72.1090304@bigpond.net.au> Date: Thu, 12 Nov 2009 23:20:02 +1100 From: Benjamin Tolputt User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: <4AFBF905.3020004@cowlark.com> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nskntotgx03p.mx.bigpond.com from [58.168.43.68] using ID btolputt@bigpond.net.au at Thu, 12 Nov 2009 12:30:29 +0000 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote:
And it compiles into real machine code, which is a huge plus; ix86,
amd64 and ARM, too. I don't know what the code is like, though.
  

Well, we've got x86 in the form of LuaJIT (with version 2.0 looking pretty damn good).

On the lack of ARM support in LuaJIT 2.0 (& 1.x for that matter), I've often wondered why Mike Pall didn't use an existing assembler library. NanoJIT has (to my knowledge) the capability of producing ARM, i386, X64, PPC, etc machine code. It's not the only one out there, but it's one I know from following Mozilla code blogs.

I cannot help but wonder what performance hit might prevent the usage of said assemblers of DynASM and whether the small hit might be worth it for the capability of running machine code on many chipsets rather than Intel 32 bit only.

We obviously don't need to be convinced about coroutines, but the idea
of moving blocked ones to another thread is intriguing.
    

I'm a bit dubious about that concept.

Unless it's doing something clever with asynchronous I/O, it'll need to
allocate a new system thread for every blocked coroutine. So if you have
a system with 100000 coroutines, and 50% of them end up blocked on
system calls at the same time, won't the runtime suddenly have to
allocate 50000 system threads

It is my assumption that they simply have a preset number of threads running. Whenever one of these threads are "blocked" on an IO operation, coroutines in it's schedule get moved to other running threads. Say there are five threads, that means I can have five coroutines running simultaneous IO operations before the application blocks. This is not going to help much in IO-focused applications (like databases and the like) but not only would it be better than nothing, but the average application sounds like it would greatly benefit from this.

That said, I don't see how Lua could benefit from the concept. The coroutines are strongly bound to their global Lua state, which is tied to one thread at a time only. If there were a cheap way to move coroutines between states (assuming they make no reference to the global environment) - this would make an awesome modification to the basic Lua VM.

-- 
Regards,

Benjamin Tolputt
Analyst Programmer
From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:45:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCjP0t017524; Thu, 12 Nov 2009 10:45:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1ED5219522; Thu, 12 Nov 2009 10:44:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f171.google.com (mail-pz0-f171.google.com [209.85.222.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9409F19496 for ; Thu, 12 Nov 2009 10:44:38 -0200 (BRST) Received: by pzk1 with SMTP id 1so508362pzk.33 for ; Thu, 12 Nov 2009 04:44:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=mIqQDnFwcoiZLWxUMXbNDwFFfXYs1Lnw3LZYsu1liyI=; b=QBCguptoS2UCObrBCEvaBZw+x6StU3OdF/xaIiXQXeQrvfp2NDh1dYA6sGBFWE/S+t W6Zz4VqPx8wWd6bCvZ0/OnHWgjWg/DZ3fmmFfEPQxraV70ZqvQ6rfn3OOLoQ2V+0+i2A Y6H0AIzlDWyjY4AwYOaFELbzJEceQsEY5UPJ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=VpuuOOEWkVFm9t6GX8G+VLalFHxBrnHyUqy/0NBsW56lGxZUaZ2qH1ImdPMNG3uKyO YBLzGSlv6J6Qcml6P4fak4zv+tL4dyxobpqTpNZ+4UbEdBpIm+kKmYrYqIrkILu6fQGG X1lIsks8V0Nbh2JGp2mnJGTaQuNuFsNi0SMTg= Received: by 10.114.33.33 with SMTP id g33mr2664895wag.212.1258029868942; Thu, 12 Nov 2009 04:44:28 -0800 (PST) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 23sm1696075pxi.5.2009.11.12.04.44.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 12 Nov 2009 04:44:28 -0800 (PST) Message-ID: <4AFC031D.3020907@gmail.com> Date: Thu, 12 Nov 2009 20:44:13 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: <4AFBF905.3020004@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The most disturbing feature I found is, from the following quoting from http://golang.org/doc/go_mem.html: -- quote begins Another incorrect idiom is busy waiting for a value, as in: var a string var done bool func setup() { a = "hello, world"; done = true; } func main() { go setup(); for !done { } print(a); } As before, there is no guarantee that, in |main|, observing the write to |done| implies observing the write to |a|, so this program could print an empty string too. Worse, there is no guarantee that the write to |done| will ever be observed by |main|, since there are no synchronization events between the two threads. The loop in |main| is not guaranteed to finish. -- quote ends Anyway, from what I can learn from there website, the language is very promising. Regards Long David Given 写é“: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > steve donovan wrote: > >> http://golang.org/doc/go_lang_faq.html >> > > I've been looking at Go. It's interesting, but a bit of a mess --- it > looks like the language grew organically rather than was designed. It > suffers badly from keyword hell, with names like 'iota', 'len', 'cap', > 'new', 'make' all being reserved. It's missing stuff like exceptions. > There's a weird apologia for not having assert(). You can't use structs > as map keys (I don't know about pointers). It's got a rather muddled > mixture of pointer types and reference types. The word 'goroutine' > should be taken out and shot. > > And personally, I think the syntax is appallingly ugly: > > func (p *ByteSlice) Write(data []byte) (n int, err os.Error) > > ...defines a method on 'pointer to ByteSlice' (you can define methods on > pretty much any type, not just objects) with self called 'p', taking an > array of bytes called 'data' as parameter, returning a tuple of int and > os.Error. > > There's a lot about it to like. The defer keyword is interesting (you > attach it to a statement and the statement is guaranteed to get executed > on function exit, after the return statement). Slices are basically > bounded pointers, and are used to pass around references to segments of > arrays. It's got multiple return values. Being able to define methods on > anything is nice, as in the above example. Interfaces work like in > OCaml, where any type implementing the interface is considered an > instance of the interface. And it's got goto! > > And it compiles into real machine code, which is a huge plus; ix86, > amd64 and ARM, too. I don't know what the code is like, though. > > But IMO there's nothing here that makes a compelling reason to switch to > Go from my current mix of C and Lua. > > [...] > >> We obviously don't need to be convinced about coroutines, but the idea >> of moving blocked ones to another thread is intriguing. >> > > I'm a bit dubious about that concept. > > Unless it's doing something clever with asynchronous I/O, it'll need to > allocate a new system thread for every blocked coroutine. So if you have > a system with 100000 coroutines, and 50% of them end up blocked on > system calls at the same time, won't the runtime suddenly have to > allocate 50000 system threads? > > People may also find Issue #9 on their bug tracker amusing: > http://code.google.com/p/go/issues/detail?id=9 > > - -- > ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── > │ "There is nothing in the world so dangerous --- and I mean *nothing* > │ --- as a children's story that happens to be true." --- Master Li Kao, > │ _The Bridge of Birds_ > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkr7+QEACgkQf9E0noFvlzinbACePBCi+1V5uKRYh4zvwYfiqcTd > 8+4AnjuhKp2/FG8h3S9FCF8jfdRnEJvW > =Fvnx > -----END PGP SIGNATURE----- > From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:48:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCmEqU018176; Thu, 12 Nov 2009 10:48:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EC8719525; Thu, 12 Nov 2009 10:47:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E798F19526 for ; Thu, 12 Nov 2009 10:47:28 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nACClOmn086575 for ; Thu, 12 Nov 2009 13:47:24 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJOS+0rDbohc/2dsb2JhbADcJ4Q8BA Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 12 Nov 2009 13:47:24 +0100 Received: from [192.168.127.128] (host211-29-dynamic.31-79-r.retail.telecomitalia.it [79.31.29.211]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nACClNL9030315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Nov 2009 13:47:24 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFC03D8.7080106@erix.it> Date: Thu, 12 Nov 2009 13:47:20 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> In-Reply-To: <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > Well, that's it; it is a classic mixture. As a Slashdot poster put > it, I "lack the mental bandwidth to jump on another bandwagon" I see I'm not alone in thinking that there are more languages than problems to solve :-) Enrico From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:49:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCnHwU018485; Thu, 12 Nov 2009 10:49:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D4D67194BD; Thu, 12 Nov 2009 10:48:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 713F318C83 for ; Thu, 12 Nov 2009 10:48:43 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:53788) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1N8Z6L-00013x-3k (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Thu, 12 Nov 2009 12:48:37 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N8Z6L-0001ih-4V (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Thu, 12 Nov 2009 12:48:37 +0000 Date: Thu, 12 Nov 2009 12:48:37 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Coroutines and Go In-Reply-To: <4AFBFE87.7040100@objmedia.demon.co.uk> Message-ID: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFBFE87.7040100@objmedia.demon.co.uk> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 12 Nov 2009, Stephen Kellett wrote: > > They seem proud of not having enumerations. I'd have thought the dreadful > mistake of omitting them from Java (which has now added them back into the > language) had been learned by now. "iota" seems to be a passing nod to the > concept of monotonically increasing values (which is how most enums, but not > all, work). But integers are not a typesafe substitute for enums. Perhaps I've > missed something about Go and enumerations (I was tired when reading about it) > but I think that is something that needs addressing. If I've got that wrong, > someone please correct me. You can declare the type of a (set of) constant(s) making it safe since there's no implicit conversion (even if the type is just an alias). See for example the ByteSize enum defined at http://golang.org/doc/effective_go.html#constants Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:50:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCoZBL018914; Thu, 12 Nov 2009 10:50:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCD8D19530; Thu, 12 Nov 2009 10:50:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9726C192E9 for ; Thu, 12 Nov 2009 10:50:00 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:54182) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1N8Z7e-00024Q-4X (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Thu, 12 Nov 2009 12:49:58 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N8Z7e-0001vD-Ck (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Thu, 12 Nov 2009 12:49:58 +0000 Date: Thu, 12 Nov 2009 12:49:58 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Coroutines and Go In-Reply-To: <4AFC031D.3020907@gmail.com> Message-ID: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC031D.3020907@gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 12 Nov 2009, Cheng, Long wrote: > The most disturbing feature I found is, from the following quoting from > http://golang.org/doc/go_mem.html: The warnings towards the end of that page apply to any shared memory concurrent language, because the hardware only provides weak ordering guarantees. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 10:57:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACCuwxH020389; Thu, 12 Nov 2009 10:56:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEB9619536; Thu, 12 Nov 2009 10:56:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3D8A192E9 for ; Thu, 12 Nov 2009 10:56:26 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id nACCuLKO062785 for ; Thu, 12 Nov 2009 13:56:21 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAPWU+0rDbohc/2dsb2JhbACEdMZIkHaBMII4VAQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 12 Nov 2009 13:56:21 +0100 Received: from [192.168.127.128] (host211-29-dynamic.31-79-r.retail.telecomitalia.it [79.31.29.211]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nACCuKL9032037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Nov 2009 13:56:21 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFC05F1.2050606@erix.it> Date: Thu, 12 Nov 2009 13:56:17 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: <4AFBF905.3020004@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > People may also find Issue #9 on their bug tracker amusing: > http://code.google.com/p/go/issues/detail?id=9 I'm surprised nobody suggested "godot" :-) (the language you've been waiting for) Enrico From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 11:06:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACD6P8q022440; Thu, 12 Nov 2009 11:06:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6B1C194A9; Thu, 12 Nov 2009 11:05:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BC3351943F for ; Thu, 12 Nov 2009 11:05:43 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so850759fgb.17 for ; Thu, 12 Nov 2009 05:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=R/H/nVYbAWb720oTN8lHVOwPhUI6QGLcOXLbptiLmSI=; b=GDZEoE0zkV+PrX4BQlQgLSaILpEfg2GsI/EJYwK2oVHfo5t0ZWpK1rzbx4vZyryNA4 9w4eRePBeq+4XJLC+BL9ahuKh4+MWjI2MYHNWKS5rhI17rAQJPxsIbY7d2VVHdHTvzvT JYWwy4cVlN0TCieXQqsd/U9elQPFymIS7Ffz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jdl4n1sYTSajUNcEZb3GuLeqZ2QoWsgOj/9lKjz9ajtcqdY7aVQGhJVeSUeoZaboSJ /qEZ7DHMg0d1DAA1hUZeKNBP7DCc0XSgVxtMh1J0aw7mSor9QxuRhp7XJoMkk2QpykeO OYbAaHY6O5IYNUUIzUW6/2x8HZ/6iphjERgUI= MIME-Version: 1.0 Received: by 10.239.144.79 with SMTP id n15mr292313hba.107.1258031140177; Thu, 12 Nov 2009 05:05:40 -0800 (PST) In-Reply-To: <4AFC05F1.2050606@erix.it> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> Date: Thu, 12 Nov 2009 15:05:40 +0200 Message-ID: <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> Subject: Re: Coroutines and Go From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 2:56 PM, Enrico Colombini wrote: > I'm surprised nobody suggested "godot" :-) > (the language you've been waiting for) +1, that's good! New languages are fun, but often they're 'one trick ponies' (like Snobol in the 60s was very good at string matching, but it lost its niche eventually) Concurrency is where the action is ... but do we need a new language for that? From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 11:27:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACDQuKr026535; Thu, 12 Nov 2009 11:26:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8186919441; Thu, 12 Nov 2009 11:26:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 578B8189E1 for ; Thu, 12 Nov 2009 11:26:01 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N8ZgF-00034l-0t for ; Thu, 12 Nov 2009 13:25:43 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N8ZgV-00022q-HV for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 13:25:59 +0000 Date: Thu, 12 Nov 2009 13:25:59 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Coroutines and Go Message-ID: <20091112132559.10666b9d@trite.i.flarn.net.i.flarn.net> In-Reply-To: <4AFC05F1.2050606@erix.it> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 12 Nov 2009 13:56:17 +0100 Enrico Colombini wrote: > David Given wrote: > > People may also find Issue #9 on their bug tracker amusing: > > http://code.google.com/p/go/issues/detail?id=9 > > I'm surprised nobody suggested "godot" :-) > (the language you've been waiting for) ... but never arrives. B. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 11:46:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACDk7PA031252; Thu, 12 Nov 2009 11:46:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0940719369; Thu, 12 Nov 2009 11:45:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F0B32192E6 for ; Thu, 12 Nov 2009 11:45:35 -0200 (BRST) Received: by fxm21 with SMTP id 21so2255221fxm.21 for ; Thu, 12 Nov 2009 05:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=sAaeJ4ALJn/XRaXHagcfsTbRH+G73nmlLu/tnnENr0w=; b=gsfvq8Qw02DrMiyXKfdyUPFukfVHeuQWgpLRGEIbiLRvYCpVOebMpocEX0U4HOe+8A JjA+qzdFjllWrU4UQNT1aVOdjIuT6vBTpCSUPMmrnFmxtvjXZ/xWK7GV3U7Ltd28H+g8 L1WIrQe+z65SxhsU78NcMQl89QkMGqJFAPOQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=FJwdctF/r+SG36KOnOhc2UAKW87zSrL5Mr0nba4GDt5yeDyUoUlKzuDFeGLbh31Kbe q09uk83ia/w57GyLmYCbzCfHIEmCKQmi8umuBqqOlhpOEhanqHJw88kdxiG6zErOWurj iaUG8eiutB3SKEQn6exwkbZFECPgA40qkWWh0= MIME-Version: 1.0 Received: by 10.103.67.25 with SMTP id u25mr1309541muk.45.1258033533100; Thu, 12 Nov 2009 05:45:33 -0800 (PST) Date: Thu, 12 Nov 2009 07:45:33 -0600 Message-ID: Subject: [ANN] FXiTe 0.1 From: Jeff Pohlmeyer To: lua@bazar2.conectiva.com.br Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean FXiTe is an advanced cross-platform text editor built with the Fox GUI toolkit and the FXScintilla text widget. It features built-in syntax highlighting for 40+ languages, an embedded Lua scripting engine, macro recording and playback, multi-line regular expression search and replace, rudimentary ctags and calltip support, a flexible interface to external tools, and a built-in "message window" to capture the output of external commands such as compiler error messages, etc. Source code and precompiled binaries for Windows and Linux are available from: http://code.google.com/p/fxite/ Enjoy! - Jeff From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 11:52:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACDqKrc032424; Thu, 12 Nov 2009 11:52:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BAC6D194B2; Thu, 12 Nov 2009 11:51:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D42B91935E for ; Thu, 12 Nov 2009 11:51:54 -0200 (BRST) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 7A79C187C2 for ; Thu, 12 Nov 2009 12:52:17 +0000 (GMT) Message-ID: <4AFC0500.4050700@objmedia.demon.co.uk> Date: Thu, 12 Nov 2009 12:52:16 +0000 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFBFE87.7040100@objmedia.demon.co.uk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Tony Finch wrote: > You can declare the type of a (set of) constant(s) making it safe since > there's no implicit conversion (even if the type is just an alias). See > for example the ByteSize enum defined at > http://golang.org/doc/effective_go.html#constants > Thanks. That is a much better demonstration than the one in the documentation I read. Stephen From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 11:55:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACDtbfk000733; Thu, 12 Nov 2009 11:55:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6D84C1951B; Thu, 12 Nov 2009 11:55:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31F3E1947E for ; Thu, 12 Nov 2009 11:55:07 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8a8e-0005uY-8r for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 14:55:04 +0100 Received: from p5b2c24aa.dip.t-dialin.net ([91.44.36.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 14:55:04 +0100 Received: from dak by p5b2c24aa.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 14:55:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Coroutines and Go Date: Thu, 12 Nov 2009 14:42:09 +0100 Organization: Organization?!? Lines: 19 Message-ID: <878weboo5q.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <20091112121317.GC950@inf.puc-rio.br> <560972290911120424o16f938a9of2a937d0817bff45@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24aa.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:l+K+/hP8nwuvAyGFAx6MnppaX8k= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan writes: > On Thu, Nov 12, 2009 at 2:13 PM, Roberto Ierusalimschy > wrote: >> http://portal.acm.org/citation.cfm?doid=860575.860747 > > It's a very interesting paper. It would be cool if such concepts could > be clearly expressed in Lua, since Go! is not exactly a beautiful > language. > > Why don't people pick nice unique names that can be usefully searched for? I wrote sort of an Emacs editing plugin called Preview-LaTeX (it's no longer studly-caps by now). The first vanity searches for it made clear that the name choice was somewhat optimistic. Nowadays you would not guess. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 12:03:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACE2wQ5002232; Thu, 12 Nov 2009 12:02:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C43DC19549; Thu, 12 Nov 2009 12:02:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F31EE1953B for ; Thu, 12 Nov 2009 12:02:15 -0200 (BRST) Received: by fxm21 with SMTP id 21so2273689fxm.21 for ; Thu, 12 Nov 2009 06:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Hwve3sBZ6GWADGCT8Pio5hbauemVcInqM/f6YQUErJA=; b=rgepG1/np2oxErONsDjrH/4iQZxFV83rIHojsr+t6ZQhmaYC6EgXANaKs4r+QsmFiw XUBE5Yi+xqWA3P57c+OUxT4Bg9OHOijkXtfhb6eXAiuVuC/8R5WpQ/1sjbU7oKbUANm9 fE4H9jT+inj+HsftzIVW6kZ4yX5gJvZHYlYus= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FptsQHorBArb4I8yq5UQ3DohDOQm3OUxlGNOMy+Mh8S5T0YebRGU3nJXmc3TrSq1FK nASsVPmiClPBwFwAmEtHSD+h5yD6tIUOAv9Oz8KKjRKZf8E2eGMsx/EIIwG4rzbTlYGP RSVUdWljpQViEbdX4yDGCPAAFKtWgyDSj3x4o= MIME-Version: 1.0 Received: by 10.216.89.213 with SMTP id c63mr974535wef.211.1258034533159; Thu, 12 Nov 2009 06:02:13 -0800 (PST) In-Reply-To: References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> From: Jerome Vuarand Date: Thu, 12 Nov 2009 15:01:53 +0100 Message-ID: <89d273ba0911120601u48eeb069wb098e030e1baf4ac@mail.gmail.com> Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Diego Nehab : >> A quick test on a friend's mac shows that on OSX the >> behaviour is again different: on failure select returns, >> and connect returns nil,"connection failed", while on >> success select also returns, but connect returns >> nil,"already connected". Am I hitting some undefined use >> case of the BSD sockets API ? > > This is the expected behavior. "Already connected" is an > error message that means there is no error. It is what you > should get in this case and means connection succeeded. > The failure you are getting is hitting you so quick that > select is returning right away, so no problem there either. If this is the expected behaviour this is weird that Linux is not behaving that way. On Linux, the second call to connect on a successful connection returns 1,nil. > Can you tell me more about the error you get when you try to > call connect() again on Windows? If the connection succeeded, I get nil,"already connected". If the connection failed though, select never returns. If I don't call select, and just call connect in a loop, I get one nil,"timeout", then nil,"Operation already in progress" for some time, and then it starts again with a single nil,"timeout" and many nil,"Operation already in progress", and so on. While trying to solve the problems, I realized that according to the MSDN [1] the normal way to detect that a non-blocking connect failed, is to pass the socket to select in the third fd_set, exceptfds, the one that detects errors. After looking at the LuaSocket sources, it seems that this third set is never used, and not bound by socket.select. So I wrote the following function, that I named socket.selectex: static int global_selectex(lua_State *L) { int rtab, wtab, etab, itab, ret, ndirty; t_socket max_fd; fd_set rset, wset, eset; t_timeout tm; double t = luaL_optnumber(L, 4, -1); FD_ZERO(&rset); FD_ZERO(&wset); FD_ZERO(&eset); lua_settop(L, 4); lua_newtable(L); itab = lua_gettop(L); lua_newtable(L); rtab = lua_gettop(L); lua_newtable(L); wtab = lua_gettop(L); lua_newtable(L); etab = lua_gettop(L); max_fd = collect_fd(L, 1, SOCKET_INVALID, itab, &rset); ndirty = check_dirty(L, 1, rtab, &rset); t = ndirty > 0? 0.0: t; timeout_init(&tm, t, -1); timeout_markstart(&tm); max_fd = collect_fd(L, 2, max_fd, itab, &wset); max_fd = collect_fd(L, 3, max_fd, itab, &eset); ret = socket_select(max_fd+1, &rset, &wset, &eset, &tm); if (ret > 0 || ndirty > 0) { return_fd(L, &rset, max_fd+1, itab, rtab, ndirty); return_fd(L, &wset, max_fd+1, itab, wtab, 0); return_fd(L, &eset, max_fd+1, itab, etab, 0); make_assoc(L, rtab); make_assoc(L, wtab); make_assoc(L, etab); return 3; } else if (ret == 0) { lua_pushstring(L, "timeout"); return 4; } else { lua_pushstring(L, "error"); return 4; } } It takes another array before the timeout, and return another one before the msg if any. If I put the connecting socket in both write and error lists, it is returned in either one depending on the connection result. On success I don't have to call connect again to use the socket. I haven't tested it on Linux yet, but I think it should be feasible if you'd like to. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 12:51:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACEpqo9011547; Thu, 12 Nov 2009 12:51:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CA1F18BCD; Thu, 12 Nov 2009 12:51:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 176EA186E7 for ; Thu, 12 Nov 2009 12:51:16 -0200 (BRST) Received: by fxm21 with SMTP id 21so2326078fxm.21 for ; Thu, 12 Nov 2009 06:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=u5chbDMAr8IVWwrvgnTiWMuOjaw1BlzyfQGvlBUl0SU=; b=N6+ZcnYmGiJa8jYhxsAX+W3VRPm/Ame3Mlad8NNThR30W2Mpyul33O/hwW0BOPYLfq 7fDl2JL12Il9FgoVmkpdRqwTHYYtX1hcGizbcnGt9JXUlEUW4fwjiKs77+2a7CjtiAhc 0d30so9PRp+XWw8iyTcHiA91M15pF51fgXifU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MAA9nQWSVck/w0vU6Jh+1RJn59k3E/zZZduD0lhc7p2Y22SkDStLZUC4zZBREVjpkQ LKieXxBLhNagf9nor77PRma9Qbi+Q8lktagzEWMCEBgSZkiMojsjvqDx9gTiPfjHG14r KYp6TpNPA0YtdVHvPBd/cGCaD6jWJr20SEmXU= MIME-Version: 1.0 Received: by 10.223.103.25 with SMTP id i25mr454500fao.64.1258037472321; Thu, 12 Nov 2009 06:51:12 -0800 (PST) In-Reply-To: <4AFBF905.3020004@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> Date: Thu, 12 Nov 2009 14:51:12 +0000 Message-ID: Subject: Re: Coroutines and Go From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 12:01 PM, David Given wrote: > (...) [When using Go] You can't use structs > as map keys (I don't know about pointers). The specification page here: http://golang.org/doc/go_spec.html#Map_types ...says that both pointers and *interfaces* can be used as map key types. Which I would assume means that a struct can be used as long as it implements an interface that includes the comparison operators. This kind of conflicts with the FAQ question that only says that structs "do not" implement comparison, though: http://golang.org/doc/go_lang_faq.html#map_keys ...so, it's rather confusing. -Duncan From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 13:08:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACF8Mbw016332; Thu, 12 Nov 2009 13:08:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E54E19363; Thu, 12 Nov 2009 13:07:53 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc2-s35.bay0.hotmail.com (bay0-omc2-s35.bay0.hotmail.com [65.54.246.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8898192E3 for ; Thu, 12 Nov 2009 13:07:47 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc2-s35.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Nov 2009 07:07:43 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Thu, 12 Nov 2009 15:07:42 +0000 Message-ID: <4AFC24AB.4000801@my.erau.edu> Date: Thu, 12 Nov 2009 10:07:23 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC031D.3020907@gmail.com> In-Reply-To: <4AFC031D.3020907@gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Nov 2009 15:07:43.0652 (UTC) FILETIME=[E2A44640:01CA63A9] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cheng, Long wrote: > As before, there is no guarantee that, in |main|, observing the write to > |done| implies observing the write to |a|, so this program could print > an empty string too. Worse, there is no guarantee that the write to > |done| will ever be observed by |main|, since there are no > synchronization events between the two threads. The loop in |main| is > not guaranteed to finish. I don't really see a problem with this. It works the same in C++ for any decent compiler, and is one of the primary purposes of the keyword 'volatile.' -- Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 13:37:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACFbuOO022450; Thu, 12 Nov 2009 13:37:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87845193BD; Thu, 12 Nov 2009 13:37:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6749F19387 for ; Thu, 12 Nov 2009 13:37:17 -0200 (BRST) Received: by fxm21 with SMTP id 21so2375290fxm.21 for ; Thu, 12 Nov 2009 07:37:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=wqeqJAFOomxgvzm01l2Q+mRkSq/5yx+R/FI+n7mxBCk=; b=UlkywA740AilNK+m8ui/4IeZshinbMNHtB9IQQgTlR5YiTUPiYlIu6N9pdHaDdoZQJ 3L5K0e2QgDqlmaQunUZzLiSBuSZ2hV8ATGFS8f6d6t7vzSq+l35MWlPl0JTpCduLhfSZ sg6Qg41nKL5k57rdO+jsfxqLThBfj4aL5CRGg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=tB+BY7hxcSHdDK5TDnVkAiCC4XlVhMPpH37F3ONECWi7c5mn80QhIgPCTTO8/CX+XA mIbFiN0V1it2/+TSS6J8MC8kv9FPK48vbC6fsfrUVLMz1/H08PBqoXmcTvsTE6/Cr77t REaAXdZgbZXDLeorlXPaUIWBMvUkkTYVdldHE= MIME-Version: 1.0 Received: by 10.204.34.196 with SMTP id m4mr317921bkd.193.1258040234199; Thu, 12 Nov 2009 07:37:14 -0800 (PST) From: Matthew Wild Date: Thu, 12 Nov 2009 15:36:54 +0000 Message-ID: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> Subject: Tables vs closures for representing objects (and JITability) To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, I've come into a little debate recently. We're working on an API, which will be used to create *lots* of small objects. Performance is critical above everything else (don't shout at me for this :) ). The debate is whether to represent objects the standard way - as tables of methods (the methods being closures for efficiency), or as just a single closure each, that takes the method name as its first parameter, and has if/elseif. We're looking at about a dozen fixed methods max per object. The latter seems like it would win out, and produce less garbage, etc. The downsides are obvious - it isn't possible (well, easily) to add properties to the object dynamically- so I don't want to do it needlessly. Is this the only thing I'm trading for speed? One of the main things I'm also interested in is which approach would be most JIT-friendly. The latter representation of objects is uncommon, so I'm concerned LuaJIT may already be optimised for tables-as-objects, and I'll be wasting my time. In anticipation of replies... the argument that any gain wouldn't be noticeable and therefore isn't worth it doesn't really hold out... *everything* becomes noticeable once you multiply by a large number :) Thoughts? Matthew From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:05:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACG5UnO028901; Thu, 12 Nov 2009 14:05:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E43D6193C8; Thu, 12 Nov 2009 14:04:55 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.188]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B55B919389 for ; Thu, 12 Nov 2009 14:04:49 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so296080gvf.40 for ; Thu, 12 Nov 2009 08:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=XNJRzemsyhU9/1+cDDRk7Hn+rKIAoms3Ofgb4y4Cbfo=; b=ZFyAJ5JUtiIswpzC2CiNDXH0ShxVIvHQmbv33fRfmsaQfeWhtCv10IsYnNO7fphr8f O267QWWFRz0Vscs7d0aroCUyazgk2HNsSDV4H+wSV/Su+XdSHvFOGtdX1fC7Qzx0iQ9v 32KsdN8ePEuGBzf2HAEK34vUr3g7cSscLV/NU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=klD3NQsHAcmoqUxEscmRISZ70sMHo8FpRhJJDWrosiMa2oIpFwmvgkU2ugBA4iDMmr wywKn6Vuy/HUCrlNoEE5Ef2Vyx+/VJacWZHnCu0b7pKN9fUA/95RUnOEpWkLiZTrbTEz f+m5HmYfhBeKUZONWKm4dDwYAyTfTdmJitXGk= MIME-Version: 1.0 Received: by 10.216.86.200 with SMTP id w50mr1024837wee.173.1258041885338; Thu, 12 Nov 2009 08:04:45 -0800 (PST) In-Reply-To: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> References: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> From: Jerome Vuarand Date: Thu, 12 Nov 2009 17:04:25 +0100 Message-ID: <89d273ba0911120804i74bb51e1we270ee6b953054b2@mail.gmail.com> Subject: Re: Tables vs closures for representing objects (and JITability) To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Matthew Wild : > Hi all, > > I've come into a little debate recently. We're working on an API, > which will be used to create *lots* of small objects. Performance is > critical above everything else (don't shout at me for this :) ). > > The debate is whether to represent objects the standard way - as > tables of methods (the methods being closures for efficiency), or as > just a single closure each, that takes the method name as its first > parameter, and has if/elseif. We're looking at about a dozen fixed > methods max per object. With a list of 12 if/elseif cases, you have between 1 and 12 comparisons per method call. With a table index (ie. traditionnal methods), you have a single hash table lookup per method call. You can do a simple benchmark: - If a lookup is faster than a single comparison, go for the tables. - If a lookup is more expensive than 12 comparisons, go for the closures. - If a lookup costs something between 1 and 12 comparisons, the best choice depends on the usage patterns of your methods. With random usage, you will get an average of 6 comparisons (to compare with a single lookup). If method usage is uneven, you can optimise the closures by properly ordering the if/elseif clauses, and get less than 6 comparisons per call. > The latter seems like it would win out, and produce less garbage, etc. > The downsides are obvious - it isn't possible (well, easily) to add > properties to the object dynamically- so I don't want to do it > needlessly. Is this the only thing I'm trading for speed? > > One of the main things I'm also interested in is which approach would > be most JIT-friendly. The latter representation of objects is > uncommon, so I'm concerned LuaJIT may already be optimised for > tables-as-objects, and I'll be wasting my time. > > In anticipation of replies... the argument that any gain wouldn't be > noticeable and therefore isn't worth it doesn't really hold out... > *everything* becomes noticeable once you multiply by a large number :) A 0.0001% gain, even multiplied by a huge number, is still unnoticeable compared to total processing time (unless you can notice a 1 second improvement over two weeks of computing). From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:13:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGD7MU030587; Thu, 12 Nov 2009 14:13:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCB8519317; Thu, 12 Nov 2009 14:12:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D03EA19290 for ; Thu, 12 Nov 2009 14:12:28 -0200 (BRST) Received: by bwz27 with SMTP id 27so2397984bwz.21 for ; Thu, 12 Nov 2009 08:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=oWb7qjb4FwZBmHIPz6fuEdJTPv81APrQXoBr+8rkCX8=; b=khan4KT2SiLewkf6aDEbPOBr6/M1gjKeSsgtW/AkVjbEA47PLGaoJ1/ZakAVc68D+O A047osoJXIg3kaKvc0JCxNq/eilViG5ZXmt1rZ//S4ySOoFwvHNaJQ3ZUDm6Xlfp2612 GlN69qq0BS9ZMaFcUFAm4J1KMWAVpt15A1vuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=rtxInRsvtwO88p4L0ebffHI8WRBcDUC5WM+QyUHcKdtmLvq+v5uNMjbEaQ3vaxlLvI VN3rUosMttsCy8T22ZQ9R4A2riXoKqNWzEMZiTn5oOFfzix2fWe7LMoyOcWvS9OKSbr7 rkFjfV2m6Oju4ve2LJ7YHDMRtchE5F2W0J3VM= MIME-Version: 1.0 Received: by 10.216.86.200 with SMTP id w50mr1028796wee.173.1258042347158; Thu, 12 Nov 2009 08:12:27 -0800 (PST) In-Reply-To: <89d273ba0911120601u48eeb069wb098e030e1baf4ac@mail.gmail.com> References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> <89d273ba0911120601u48eeb069wb098e030e1baf4ac@mail.gmail.com> From: Jerome Vuarand Date: Thu, 12 Nov 2009 17:12:07 +0100 Message-ID: <89d273ba0911120812n1659bc11l25289c915b80c7a0@mail.gmail.com> Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Jerome Vuarand : > 2009/11/12 Diego Nehab : >>> A quick test on a friend's mac shows that on OSX the >>> behaviour is again different: on failure select returns, >>> and connect returns nil,"connection failed", while on >>> success select also returns, but connect returns >>> nil,"already connected". Am I hitting some undefined use >>> case of the BSD sockets API ? >> >> This is the expected behavior. "Already connected" is an >> error message that means there is no error. It is what you >> should get in this case and means connection succeeded. >> The failure you are getting is hitting you so quick that >> select is returning right away, so no problem there either. > > If this is the expected behaviour this is weird that Linux is not > behaving that way. On Linux, the second call to connect on a > successful connection returns 1,nil. > >> Can you tell me more about the error you get when you try to >> call connect() again on Windows? > > If the connection succeeded, I get nil,"already connected". If the > connection failed though, select never returns. If I don't call > select, and just call connect in a loop, I get one nil,"timeout", then > nil,"Operation already in progress" for some time, and then it starts > again with a single nil,"timeout" and many nil,"Operation already in > progress", and so on. > > While trying to solve the problems, I realized that according to the > MSDN [1] the normal way to detect that a non-blocking connect failed, > is to pass the socket to select in the third fd_set, exceptfds, the > one that detects errors. After looking at the LuaSocket sources, it > seems that this third set is never used, and not bound by > socket.select. So I wrote the following function, that I named > socket.selectex: > > static int global_selectex(lua_State *L) { > int rtab, wtab, etab, itab, ret, ndirty; > t_socket max_fd; > fd_set rset, wset, eset; > t_timeout tm; > double t = luaL_optnumber(L, 4, -1); > FD_ZERO(&rset); FD_ZERO(&wset); FD_ZERO(&eset); > lua_settop(L, 4); > lua_newtable(L); itab = lua_gettop(L); > lua_newtable(L); rtab = lua_gettop(L); > lua_newtable(L); wtab = lua_gettop(L); > lua_newtable(L); etab = lua_gettop(L); > max_fd = collect_fd(L, 1, SOCKET_INVALID, itab, &rset); > ndirty = check_dirty(L, 1, rtab, &rset); > t = ndirty > 0? 0.0: t; > timeout_init(&tm, t, -1); > timeout_markstart(&tm); > max_fd = collect_fd(L, 2, max_fd, itab, &wset); > max_fd = collect_fd(L, 3, max_fd, itab, &eset); > ret = socket_select(max_fd+1, &rset, &wset, &eset, &tm); > if (ret > 0 || ndirty > 0) { > return_fd(L, &rset, max_fd+1, itab, rtab, ndirty); > return_fd(L, &wset, max_fd+1, itab, wtab, 0); > return_fd(L, &eset, max_fd+1, itab, etab, 0); > make_assoc(L, rtab); > make_assoc(L, wtab); > make_assoc(L, etab); > return 3; > } else if (ret == 0) { > lua_pushstring(L, "timeout"); > return 4; > } else { > lua_pushstring(L, "error"); > return 4; > } > } > > It takes another array before the timeout, and return another one > before the msg if any. If I put the connecting socket in both write > and error lists, it is returned in either one depending on the > connection result. On success I don't have to call connect again to > use the socket. > > I haven't tested it on Linux yet, but I think it should be feasible if > you'd like to. It seems that on Linux, the socket is signaled as writable by select whether it is connected or connection failed. In both cases exceptfds is returned empty. So the following script still exhibits different behaviour on Windows and Linux : #!/usr/bin/env lua require 'socket' function test(ip, port) local master = assert(socket.tcp()) master:settimeout(0) print(master) local success,err = master:connect(ip, port) print(master, success, err) if not success and err=='timeout' then local _,send,errs = socket.selectex({}, {master}, {master}) print(#send, #errs) success,err = master:connect(ip, port) print(master, success,err) end end print("valid address") test('127.0.0.1', 80) print() print("invalid address") test('127.0.0.1', 44444) From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:14:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGE2ZI030793; Thu, 12 Nov 2009 14:14:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFB84193C0; Thu, 12 Nov 2009 14:13:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C39EF19290 for ; Thu, 12 Nov 2009 14:13:31 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N8cIb-0001yd-00; Thu, 12 Nov 2009 17:13:29 +0100 Date: Thu, 12 Nov 2009 17:13:04 +0100 From: Mike Pall To: Lua list Subject: Re: Tables vs closures for representing objects (and JITability) Message-ID: <20091112161304.GA2515@mike.de> References: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Matthew Wild wrote: > I've come into a little debate recently. We're working on an API, > which will be used to create *lots* of small objects. Performance is > critical above everything else (don't shout at me for this :) ). Measure first, then optimize. > The debate is whether to represent objects the standard way - as > tables of methods (the methods being closures for efficiency), That's what the __index table is for: shared method lookup across instances. Making them closures (over the instance?) is pointless. > or as just a single closure each, that takes the method name as > its first parameter, and has if/elseif. We're looking at about a > dozen fixed methods max per object. Why do you want to replace a hash table lookup with a chain of linear comparisons? Why do you think you can beat Lua's hash table lookup? Hint: you can't. > The latter seems like it would win out, and produce less garbage, etc. No it doesn't. Shared methods have zero per-instance cost. Adding a dozen closures for every instance is expensive. > The downsides are obvious - it isn't possible (well, easily) to add > properties to the object dynamically- so I don't want to do it > needlessly. Is this the only thing I'm trading for speed? Needless complexity comes to mind ... > One of the main things I'm also interested in is which approach would > be most JIT-friendly. The latter representation of objects is > uncommon, so I'm concerned LuaJIT may already be optimised for > tables-as-objects, and I'll be wasting my time. LJ2 very happily deals with metatables and can hoist most method lookups out of the inner loops. And the remaining hash table lookups with constant keys are extremely cheap (zero or one machine code instruction in the dependency chain). I doubt you can make that go any faster ... > In anticipation of replies... the argument that any gain wouldn't be > noticeable and therefore isn't worth it doesn't really hold out... > *everything* becomes noticeable once you multiply by a large number :) Ah, but, of course. The downsides of this strange approach will certainly be noticeable (especially once you're stuck with it). --Mike From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:22:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGMFXj002836; Thu, 12 Nov 2009 14:22:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08F8B193D2; Thu, 12 Nov 2009 14:21:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B3DAD19398 for ; Thu, 12 Nov 2009 14:21:40 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N8cQS-00065l-Iq for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 16:21:36 +0000 Message-ID: <4AFC3613.4020003@cowlark.com> Date: Thu, 12 Nov 2009 16:21:39 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> In-Reply-To: <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 steve donovan wrote: [...] > +1, that's good! New languages are fun, but often they're 'one trick > ponies' (like Snobol in the 60s was very good at string matching, but > it lost its niche eventually) [Warning: this message is almost entirely off topic.] There is nothing new under the sun. Have you seen Algol 68? As you might imagine, it's an Algol variant that came out in 1968. (Which makes it older than I am.) It begat Pascal, Modula, Oberon etc and is a cousin of C. (I think it's Lua's uncle.) There's a good Wikipedia page: http://en.wikipedia.org/wiki/ALGOL_68 It's a bit scary. It looks *just like a modern programming language*. It's got C-like types (although to be more accurate, C has Algol-68-like types). It's got user defined polymorphic perators (with user defined precedence). Keywords and identifiers occupy different namespaces. Identifiers can contain spaces! It's got block expressions. It's got OCCAM-like concurrency (there's a par keyword for running processes in parallel and built-in support for namespaces). You can use values before you define them! Most syntax elements have a short form and a long form, where the short form is designed for single statements and the long form for multiline statements. Example: # create a new type, 'vector', of an array of reals indexed 1..3 # mode vector = [1:3] real; # now create a matrix type similarly # mode matrix = [1:3, 1:3] real; # create some vectors # vector v1 := (1, 2, 3); vector v2 := (2, 3, 4); # create an operator that works on vectors # op + = (vector a, b) vector: begin vector out; for i from lwb a to upb a do out[i] := a[i] + b[i]; od; out # value of last expression in block is value of block # end # define a matrix from our vectors matrix m := (v1, v2, v1+v2); # get a reference to one of the rows of the matrix ref vector horizontal = m[2,]; # get a reference to one of the columns of the matrix ref vector vertical = m[,2]; There are a few features I haven't seen anywhere else, such as the universal loop construct which replaces both for...next and while...end, which I've never seen anywhere else: # loop in 'for' mode for i from 1 to 10 do print(i) od # ...and in 'while' mode while i < 10 do print(i); i := i + 1; od # ...and in both! for i from 1 to 10 while checkWhetherCancelled() do print(i) od # ...just loop, no counter! to 10 do print("Ten times!") od # ...minimum syntax do print("Loop forever") od # ...maximum syntax for i from 1 by 1 to 10 while checkWhetherCancelled() do print(i) od Algol-68 has some particularly interesting pointer semantics, nicer than C's IMO. This: int i; ...is actually sugar for: ref int i = loc int; 'loc int' is an expression that returns a new integer stored on the stack. (You can also say 'heap int' to create a new integer stored on the heap.) 'ref int' creates a pointer to an int. In other words, all variables are actually pointers. Unlike C, Algol-68 has distinct operations that work on the pointer and operations that work on the value; most operators will implicitly dereference their operands. If you want to, say, compare two references to see whether they're pointing at the same thing, there is a specific 'a is b' operator for doing so. Personally I think this is much more consistent and less ugly than C (and Go's) approach, where you have to know whether you're dealing with a pointer or a scalar before you can deal with it; but for some reason it's not a concept that seems to have taken off. ... So, to get back to the point: Go vs Algol-68. TBH, I think the 41-year-old language is richer, clearer and more expressive. It's certainly missing some features, like any form of object orientation, polymorphic functions, but the overall design is much more consistent and well thought-out. In 1968 Neil Armstrong was still pootling about in orbit and integrated circuits were rockets science. Why am I able to compare a language from this era with a contemporary one on an equal basis? Because, depressingly, state-of-the-art in programming languages hasn't moved much in those 41 years. I think that it's entirely plausible that if someone were to take the Algol-68 spec, redraft it in modern terminology (types instead of modes, names instead of variables, etc), update some of the odder areas such as transput, give it a catchy Web-2.0 name and produce a decent compiler for it, then it would be heralded as the next great development in programming languages. Which is kind of depressing... - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr8NhEACgkQf9E0noFvlzjT7wCeJ6tM6FcNlpMBx9RZOZ+ncWkO gxIAoN2sYYXwo/IkcFefMs+rg1/Rfvrz =cdpP -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:29:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGTKbQ004327; Thu, 12 Nov 2009 14:29:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C1E6193F4; Thu, 12 Nov 2009 14:28:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A9DB7193E4 for ; Thu, 12 Nov 2009 14:28:42 -0200 (BRST) Received: by fxm21 with SMTP id 21so2430729fxm.21 for ; Thu, 12 Nov 2009 08:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=2nIAnF4Pj78pgoID69ozKDmCg/HvbNgz6GgjGx19ikU=; b=RckBIYkLM44t1Hphg6ustkxxvdTM7vuibJlLMOm39/BpXWEiADd6T9L6g3ibis0Ru6 DAQjbSPmxmKl0LhAhzSpGzS1Q8N9ZIWdfnOc/b8P5zhMCiyiIPcYBXEIoNJZmK+F+Kh9 b8f1sG97ttXyMY+rzTiEFXTYioGTlotJUxJzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=CdPGb0k4CYzeHfJLrtMKC2fa/yLMQPkJNwI7y2QEuQsD+lMC1ySHUQ/4GVIWOvTRzN 7tC7xVG42Vl9LC4bKWuKYnPlkayDEb0xktvvL9z+9oYFVX1zpiGOG24P9VVq7qFr2RSZ aJeb+VePL0x5pB7D9Ws/20ahkfRKF9XO2uzdQ= MIME-Version: 1.0 Received: by 10.204.10.8 with SMTP id n8mr1174105bkn.48.1258043320306; Thu, 12 Nov 2009 08:28:40 -0800 (PST) In-Reply-To: <20091112161304.GA2515@mike.de> References: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> <20091112161304.GA2515@mike.de> From: Matthew Wild Date: Thu, 12 Nov 2009 16:28:20 +0000 Message-ID: <4db9cacb0911120828w1c00b636t517d6768b0325b89@mail.gmail.com> Subject: Re: Tables vs closures for representing objects (and JITability) To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Mike Pall : > Matthew Wild wrote: >> I've come into a little debate recently. We're working on an API, >> which will be used to create *lots* of small objects. Performance is >> critical above everything else (don't shout at me for this :) ). > > Measure first, then optimize. > >> The debate is whether to represent objects the standard way - as >> tables of methods (the methods being closures for efficiency), > > That's what the __index table is for: shared method lookup across > instances. Making them closures (over the instance?) is pointless. > >> or as just a single closure each, that takes the method name as >> its first parameter, and has if/elseif. We're looking at about a >> dozen fixed methods max per object. > > Why do you want to replace a hash table lookup with a chain of > linear comparisons? Why do you think you can beat Lua's hash table > lookup? Hint: you can't. > Fair enough :) >> The latter seems like it would win out, and produce less garbage, etc. > > No it doesn't. Shared methods have zero per-instance cost. Adding > a dozen closures for every instance is expensive. > The reason closures are used in the table methods are to avoid useless self.* table lookups, these *do* make a difference in benchmarks (though I'm expecting not so much in a JIT). The closure representation for objects would be a single function, and the methods would be contained in that. String comparisons in Lua are fast, and it if/elseif can be faster than table lookups. If LuaJIT gives us table lookups just as fast then that's good. >> The downsides are obvious - it isn't possible (well, easily) to add >> properties to the object dynamically- so I don't want to do it >> needlessly. Is this the only thing I'm trading for speed? > > Needless complexity comes to mind ... > I'm glancing over that for now - I'd still consider it less complex than having to write it all in C using the Lua API :) >> One of the main things I'm also interested in is which approach would >> be most JIT-friendly. The latter representation of objects is >> uncommon, so I'm concerned LuaJIT may already be optimised for >> tables-as-objects, and I'll be wasting my time. > > LJ2 very happily deals with metatables and can hoist most method > lookups out of the inner loops. And the remaining hash table > lookups with constant keys are extremely cheap (zero or one > machine code instruction in the dependency chain). I doubt you can > make that go any faster ... > That sounds great, but I had not dared hope just in case :) >> In anticipation of replies... the argument that any gain wouldn't be >> noticeable and therefore isn't worth it doesn't really hold out... >> *everything* becomes noticeable once you multiply by a large number :) > > Ah, but, of course. The downsides of this strange approach will > certainly be noticeable (especially once you're stuck with it). > Quite possibly. But being able to gauge the gains for sacrificing the "normal" way of doing things before making the decision (not) to is important I think. Thanks, Matthew From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:30:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGTvjm004450; Thu, 12 Nov 2009 14:29:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4E1AF19415; Thu, 12 Nov 2009 14:29:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A097193FB for ; Thu, 12 Nov 2009 14:29:00 -0200 (BRST) Received: by mail-fx0-f221.google.com with SMTP id 21so2430729fxm.21 for ; Thu, 12 Nov 2009 08:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=k/3pMu1Muw2tyqpIv3dfOYz/gL9Ss+ur3ZQsEN1x8E4=; b=Cdi21snlwJ85wRQMW4vWH95rk2coMMzkXfnpRChSjlHoPETXc4beimXkQ/RaP9mWIY GHBF5+YkJJUmWQYYDvzfhdoFyd5W+iEiDjr/0+Q+PODvb1C93czANg58vnqt5SwzUbM1 NCdQeSYEAWajq6JSsSwoJGQK4dcqT5Jf/z6Jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=o08lsTtpGFZHAG/In9nChODwImq1h7OKsLYA2zoTI6W95CpqtXGpVkpZbX6Bq00Yjh BPgmzQQGzWPO/SCIOsk70+LVewg2B3Dj8alnqpDh+Gbz/p4+hLCuC2xK9+7ZOyZT14uV DVHuAH/Ls4qa4x4v9vBxL14pH3U5OFFpszq10= MIME-Version: 1.0 Received: by 10.223.127.198 with SMTP id h6mr458816fas.102.1258043339070; Thu, 12 Nov 2009 08:28:59 -0800 (PST) In-Reply-To: <4AFC3613.4020003@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> From: Jim Whitehead II Date: Thu, 12 Nov 2009 16:28:39 +0000 Message-ID: <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> Subject: Re: Coroutines and Go To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 4:21 PM, David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > There is nothing new under the sun. > > Have you seen Algol 68? As you might imagine, it's an Algol variant that > came out in 1968. (Which makes it older than I am.) It begat Pascal, > Modula, Oberon etc and is a cousin of C. (I think it's Lua's uncle.) > There's a good Wikipedia page: > > http://en.wikipedia.org/wiki/ALGOL_68 > > It's a bit scary. It looks *just like a modern programming language*. > It's got C-like types (although to be more accurate, C has Algol-68-like > types). It's got user defined polymorphic perators (with user defined > precedence). Keywords and identifiers occupy different namespaces. > Identifiers can contain spaces! It's got block expressions. It's got > OCCAM-like concurrency (there's a par keyword for running processes in > parallel and built-in support for namespaces). You can use values before > you define them! Most syntax elements have a short form and a long form, > where the short form is designed for single statements and the long form > for multiline statements. The PAR keyword doesn't in any way approximate 'OCCAM-like' concurrency. Concurrency in occam is built around communication between distinct processes through explicit communication channels. Yes, the SEQ keyword is covered by the sequential nature of Algol-68, and the PAR keywords are roughly the same.. but that only begins to graze the surface of what OCCAM-like concurrency actually is. Perhaps I'm missing something, but I can't help but believe your claim is a bit over-reaching in this particular case. I'm not ignoring the rest of your post, because you certainly make a number of very clear and concise points, but as someone who works with occam-like concurrency on a daily basis I'd like some clarification on this point. - Jim From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:38:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGcI2p006045; Thu, 12 Nov 2009 14:38:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F29D1946C; Thu, 12 Nov 2009 14:37:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ADA78193E1 for ; Thu, 12 Nov 2009 14:37:34 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8cfo-00075o-CU for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 17:37:28 +0100 Received: from p5b2c24aa.dip.t-dialin.net ([91.44.36.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 17:37:28 +0100 Received: from dak by p5b2c24aa.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 17:37:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Coroutines and Go Date: Thu, 12 Nov 2009 17:37:04 +0100 Organization: Organization?!? Lines: 19 Message-ID: <87bpj7n1hq.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24aa.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:mHdnhC+8Ah96u89BHJ31dHCDOy0= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given writes: > In 1968 Neil Armstrong was still pootling about in orbit and > integrated circuits were rockets science. Why am I able to compare a > language from this era with a contemporary one on an equal basis? > Because, depressingly, state-of-the-art in programming languages > hasn't moved much in those 41 years. Oh yes it has. The state of the art is C++ family which can by now not offer the object orientation of Smalltalk (the whole point of message passing was object-contained control flow, which C++ methods don't offer) or the generic support of Ada (while stealing part of its syntax and wearing it like a hat on its feet), but has less than five times their complexity. And yes, I know the difference between a fifth and five times. Now if you sacrifice C++'s performance advantage, you get rid of half that complexity and land with Java or C#. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:42:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGgmrI007029; Thu, 12 Nov 2009 14:42:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E423193C1; Thu, 12 Nov 2009 14:42:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4C70F19398 for ; Thu, 12 Nov 2009 14:42:18 -0200 (BRST) Received: by yxe17 with SMTP id 17so2075720yxe.33 for ; Thu, 12 Nov 2009 08:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=66l1FZ9Jxkyp26y6HZZL3PZKs6TUBHYw1UpVwiRfVl8=; b=cnCbiqqA2uAyDZUtUF+FeDg0STC8yl/H4mjWcI211mWAEpeydeKFErVX9yHXC1hM4x DGLUvjQ4Q2vLiowbYFy9gnUm3vBlY6lmHfEjIXfz+sjJ+qdDJg1ven3aPtJ8Wa/wHPx4 17l5ArG4B9DZv/WEcnOSPajPBzu8CslkkrTnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YP6g0bXNpMysXfEUaued74ZC3UTEIyXk4oh/mWhGBbI7nc15Gg89P2/EjiihbovpBV DluENtnw5a72wxRvtoZykjY65Uz7otfoPpx9TWQIKga0wcCbTOlfUipGCzhCBh1CRWRF o7IUOMtcrIEtEmD26mO5QQqObXxR4fSSH0qDM= MIME-Version: 1.0 Received: by 10.90.12.19 with SMTP id 19mr4668701agl.96.1258044127915; Thu, 12 Nov 2009 08:42:07 -0800 (PST) In-Reply-To: <87bpj7n1hq.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <87bpj7n1hq.fsf@lola.goethe.zz> Date: Thu, 12 Nov 2009 16:42:07 +0000 Message-ID: <54e12800911120842y2491495at2eee7eb33d5b23e8@mail.gmail.com> Subject: Re: Coroutines and Go From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 11/12/09, David Kastrup wrote: > > Oh yes it has. The state of the art is C++ family which can by now not > offer the object orientation of Smalltalk (the whole point of message > passing was object-contained control flow, which C++ methods don't > offer) or the generic support of Ada (while stealing part of its syntax > and wearing it like a hat on its feet), but has less than five times > their complexity. And yes, I know the difference between a fifth and > five times. Now if you sacrifice C++'s performance advantage, you get > rid of half that complexity and land with Java or C#. > Java and C# don't feel much like an improvement either. -- -alex @asandroq http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:49:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGnrdu008810; Thu, 12 Nov 2009 14:49:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B79241949A; Thu, 12 Nov 2009 14:49:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A118E19398 for ; Thu, 12 Nov 2009 14:49:18 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so941863fgb.17 for ; Thu, 12 Nov 2009 08:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=HEC9tgIaRiL2BPpPbKoOPTaxYzQjId8PW3JZdNdSAFI=; b=Db1GoSU7vT0kn9GDnRz9LlxjNUlTwwm63AJnAzLHJyKzUBgGkVPX83Me1F6lDCJd4R vVH9Tp0y/Cv+VzqmBu+d7j+ZxhS0cJqJlvHpzPQFXSv6v+6zmODDeqxPQCkN8DglQYwc 0VR3wcECh9JyNkJ4g57O/T/875FYz2CVQtxTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=I4VdpHpS05e/h66Z4XIEGdVYm/0Br8NLeMpEuHNRyADWN6D3Pmuy5Eufwo3yE4uaix lHIDcxnK5ftbUSVJY9rFe5WbgKzHa/7TlOwAaazSE8/2PGU+6GMWRcSU4MHibZs5ONaE Uac4dBA7a3YEbhpzgqq7pgP7xJkyd9Qglr3YI= MIME-Version: 1.0 Received: by 10.216.85.137 with SMTP id u9mr946594wee.214.1258044556834; Thu, 12 Nov 2009 08:49:16 -0800 (PST) In-Reply-To: <4AFC3613.4020003@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> Date: Thu, 12 Nov 2009 11:49:16 -0500 Message-ID: Subject: Re: Coroutines and Go From: Leo Razoumov To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 2009-11-12, David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > [Warning: this message is almost entirely off topic.] > > There is nothing new under the sun. > > Have you seen Algol 68? As you might imagine, it's an Algol variant that > came out in 1968. (Which makes it older than I am.) It begat Pascal, > Modula, Oberon etc and is a cousin of C. (I think it's Lua's uncle.) > There's a good Wikipedia page: > > http://en.wikipedia.org/wiki/ALGOL_68 > > It's a bit scary. It looks *just like a modern programming language*. > It's got C-like types (although to be more accurate, C has Algol-68-like > types). It's got user defined polymorphic perators (with user defined > precedence). Keywords and identifiers occupy different namespaces. > Identifiers can contain spaces! It's got block expressions. It's got > OCCAM-like concurrency (there's a par keyword for running processes in > parallel and built-in support for namespaces). You can use values before > you define them! Most syntax elements have a short form and a long form, > where the short form is designed for single statements and the long form > for multiline statements. Yap! ALGOL-68 was my first programming language back in early 80-s. I ran my programs on a Polish minicomputer Odra-1305 with 256K of memory. Algol compiler did just fine. Algol-68 was, indeed, a beautiful language. --Leo-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:56:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGu9lq010465; Thu, 12 Nov 2009 14:56:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D034194B1; Thu, 12 Nov 2009 14:55:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 24E271943F for ; Thu, 12 Nov 2009 14:55:41 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145] helo=[10.0.2.15]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N8cxL-0007Wy-MO for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 16:55:35 +0000 Message-ID: <4AFC3E0A.8050709@cowlark.com> Date: Thu, 12 Nov 2009 16:55:38 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> In-Reply-To: <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Whitehead II wrote: [...] > The PAR keyword doesn't in any way approximate 'OCCAM-like' > concurrency. Concurrency in occam is built around communication > between distinct processes through explicit communication channels. > Yes, the SEQ keyword is covered by the sequential nature of Algol-68, > and the PAR keywords are roughly the same.. but that only begins to > graze the surface of what OCCAM-like concurrency actually is. Indeed, you're quite right. I did meant to mention channels, honest, but forgot. CSP concurrency is one of Go's nicer features. ...according to Wikipedia CSP was first described in a paper in 1978; Occam came out in 1983 (although it looks way older from the syntax). Perhaps Algol-68 simply predates it, which would explain why it has par but no channels. Anyone modernising the language would definitely need to add them. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr8PgcACgkQf9E0noFvlzhGvgCcDhLQatJUfUhW6KVRWFMf+PTV u/wAnjbOWm/dchOgWfjox7seJd5dx0Dk =v1QI -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 14:59:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACGxfSW012062; Thu, 12 Nov 2009 14:59:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 32FDF1946C; Thu, 12 Nov 2009 14:59:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C3827193E4 for ; Thu, 12 Nov 2009 14:59:08 -0200 (BRST) Received: by fxm21 with SMTP id 21so2462751fxm.21 for ; Thu, 12 Nov 2009 08:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=FxkGQNthlFbHeILTTBz+WVdr0h17kpMrmW0yBkY27u4=; b=lzcsNG6QmPFcMcuAw7QJnFkO0DJfdBmhA0DDcNxrT+rY9Nbf2iXn2/hjqZSCpT7hWc u5CoMIirMIHP1d1bI5R2nus1iTA8VpO7GowFxVyBIIRzWh54XUSbXeKIuFCIBcgHEBN1 g9JC+X/0nQcrL+R7K1AWoS4Hqdaj+HUISXEuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=aOSURIceLaAsF3CSCvx1gB5j3+DnfTxIA0RypnnH+3agDAOV9nOJLKZEW4tYetfCIQ /0dSmYiptJWMOKfQTBuhdLSVj5C8SKbWabm+is85kP7dgfK6UhknQm54gmMvXGwWzvVe t4Lm5qrljW78yGPS3EO8t9MfcGrATNxJnTZRU= MIME-Version: 1.0 Received: by 10.223.127.198 with SMTP id h6mr464135fas.102.1258045147085; Thu, 12 Nov 2009 08:59:07 -0800 (PST) In-Reply-To: <4AFC3E0A.8050709@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> <4AFC3E0A.8050709@cowlark.com> From: Jim Whitehead II Date: Thu, 12 Nov 2009 16:58:47 +0000 Message-ID: <5fe281d40911120858o30b88809m80f2b2d09ea28c98@mail.gmail.com> Subject: Re: Coroutines and Go To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nACGxfSW012062 On Thu, Nov 12, 2009 at 4:55 PM, David Given wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jim Whitehead II wrote: > [...] >> The PAR keyword doesn't in any way approximate 'OCCAM-like' >> concurrency.  Concurrency in occam is built around communication >> between distinct processes through explicit communication channels. >> Yes, the SEQ keyword is covered by the sequential nature of Algol-68, >> and the PAR keywords are roughly the same.. but that only begins to >> graze the surface of what OCCAM-like concurrency actually is. > > Indeed, you're quite right. I did meant to mention channels, honest, but > forgot. CSP concurrency is one of Go's nicer features. > > ...according to Wikipedia CSP was first described in a paper in 1978; > Occam came out in 1983 (although it looks way older from the syntax). > Perhaps Algol-68 simply predates it, which would explain why it has par > but no channels. Anyone modernising the language would definitely need > to add them. Indeed, being at the birthplace of CSP and a concurrency researcher I just happened to pick up on that specific bit of your email. I actually have a number of complaints about the current state of channel based communication in Go, but that's another topic entirely =) - Jim From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 15:14:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACHEMT1015799; Thu, 12 Nov 2009 15:14:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2EE3519524; Thu, 12 Nov 2009 15:13:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D26D193F4 for ; Thu, 12 Nov 2009 15:13:46 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nACHDioB022482 for ; Thu, 12 Nov 2009 15:13:44 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 34CE454C03F; Thu, 12 Nov 2009 15:13:45 -0200 (BRST) Date: Thu, 12 Nov 2009 15:13:45 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091112171345.GB14516@inf.puc-rio.br> References: <4AFA5F25.9070206@danielstephens.com> <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091112022951.GA3325@brevard.conman.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > The #1 question is now: why is the GC stuck? Because usually every > > string allocation is accompanied with a GC check. And once the > > threshold is reached, the GC is driven forward and should quickly > > get out of the sweepstring phase. > > > > I think luaX_newstring() in llex.c must be the culprit. You can > > try to add a GC check just before the 'return ts' at line 123: > > luaC_checkGC(L); > > > > If this solves the problem, then you've found a bug in Lua. > > Congratulations -- it doesn't happen that often. :-) > > I tried that, and nope. Still takes six minutes. Nevertheless it would be useful to check Mike's theory. A simple (and somewhat dirty ;) way to do it would be to add the following line at the beginning of luaS_resize (just after variable definitions): fprintf(stderr, "gcs: %d strgc: %d size: %d nuse: %d bytes: %d tsh: %d\n", G(L)->gcstate, G(L)->sweepstrgc, G(L)->strt.size, G(L)->strt.nuse, G(L)->totalbytes, G(L)->GCthreshold); (That will generate 469488 lines of output. But any chunk after the first thousand lines could give us some clue of what is going one. You can abort the run after the first few thousand lines.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 15:20:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACHK3VC017806; Thu, 12 Nov 2009 15:20:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8A5F19448; Thu, 12 Nov 2009 15:19:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6AF4193F4 for ; Thu, 12 Nov 2009 15:19:25 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so656120eye.39 for ; Thu, 12 Nov 2009 09:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=LDUEDzk1ct6ItxSSUWZyy3cTy+LTSsVAAedsmV+YRJY=; b=YhW+wKDhcnrAzwjXidoDPSMYww5zGZrL/975xYaxofyzIcqDGG94pH3WtQ3ffahqo4 au7RL2bJnbEo4XyyDK9c9mlCfQreUi69/9nGsBUHiuezC8gLj2RcarwHJM+4vBgPO41/ NbhpKZs8pvS9hyRRRHBjLv0M0hrhNc1tuXqFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fe4EI3dcgHwB7KavnWp3h/sFTcDIDqz+zc/qgOboW2xjUBfSk29RQEUrL49cCVjEBo LHPr4+4h9+6BdbS/VHXJCJrsmPjtGvwVepVDSqf864/7QwaFI3h6ESPeHbEtiPx3/g7n L6ipz77pA5ysJITuP4Nze547JZE6AxF7MnxLw= MIME-Version: 1.0 Received: by 10.213.27.8 with SMTP id g8mr887089ebc.58.1258046361960; Thu, 12 Nov 2009 09:19:21 -0800 (PST) In-Reply-To: <4AFC3613.4020003@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> Date: Thu, 12 Nov 2009 12:19:21 -0500 Message-ID: <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> Subject: Re: Coroutines and Go From: Chris To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 11:21 AM, David Given wrote: > this era with a contemporary one on an equal basis? Because, > depressingly, state-of-the-art in programming languages hasn't moved > much in those 41 years. Programming languages will never "move much" unless the underlying technology does. We're still using essentially the same hardware architecture that was designed before we even had electronics. While it's possible to create some super language that is totally different, the trade-offs will be too great when used with current hardware. I could make a car analogy here about steering wheels and gas pedals but I won't do it. ;) ===== I'm still trying to figure out how Go fits into the scheme of things. I mean, what is its target purpose. The current popular trend seems to be using very high level languages to control low-level components (eg. the web, Lua, Python, etc). Go is some sort of in-between low-level and high level thing like Java. I don't like that model because it has all the annoyances of a low-level language (verbose, compiled) with the performance concerns of a high-level language. Maybe its purpose is to be like Java except more suited for writing an operating system. For a long time I have been thinking about writing an OS in Lua. Just as an exercise. I know performance might be iffy; although with LuaJIT who knows. CR From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 15:30:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACHRhxH019506; Thu, 12 Nov 2009 15:27:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 944991952E; Thu, 12 Nov 2009 15:27:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD4A21943F for ; Thu, 12 Nov 2009 15:27:09 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8dRn-000117-2u for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 18:27:03 +0100 Received: from p5b2c24aa.dip.t-dialin.net ([91.44.36.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 18:27:03 +0100 Received: from dak by p5b2c24aa.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 18:27:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Coroutines and Go Date: Thu, 12 Nov 2009 18:26:41 +0100 Organization: Organization?!? Lines: 16 Message-ID: <87639fmz72.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24aa.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:FCEt3eHiLKFFnQx8bY8KsIlA60c= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Chris writes: > On Thu, Nov 12, 2009 at 11:21 AM, David Given wrote: >> this era with a contemporary one on an equal basis? Because, >> depressingly, state-of-the-art in programming languages hasn't moved >> much in those 41 years. > > Programming languages will never "move much" unless the underlying > technology does. We're still using essentially the same hardware > architecture that was designed before we even had electronics. Stack frames are newcomers. Older architectures had nothing to deal with recursion. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:06:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACI61X8027165; Thu, 12 Nov 2009 16:06:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD96419385; Thu, 12 Nov 2009 16:05:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sasl.smtp.pobox.com (b-pb-sasl-quonix.pobox.com [208.72.237.35]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 178F1192E5 for ; Thu, 12 Nov 2009 16:05:19 -0200 (BRST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 8790372309 for ; Thu, 12 Nov 2009 13:05:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; s=sasl; bh=6C/Tcny18rak9XHBFFuzNhLuopg=; b=eo1zwb IttUhabCsF1sdPyMfcNoElxxCz3cVXxVRfSoK2aX4sK9c+Xh5Wi2aAc+w7wXSwHd ps0/ECU1QTllgP08c4SKbNeeeg7YBID98Zdi1HInwWccKU5ICUOX453u+LY6d1jd 6vUK2qEXqLTsihp0qSNYxroR+7l0P2/R66ox0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; q=dns; s=sasl; b=ud/SA1d3Dqlna8Wy/EvJPvzpNqysdRnw Uwfwo+iK9rDTnwE2C/aRW5feaqkiXtX0PfBfsFtWI3SFWTghSYGoxSuCWNDyNc1V Yp+eBSOfnUHL4K9So5HgH0hRuK2NZVyxahCJ0O2F0Szmep7XAqtt2wh5D6M9MHPP b2P2cE3PmLc= Received: from b-pb-sasl-quonix. (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 85B6172308 for ; Thu, 12 Nov 2009 13:05:14 -0500 (EST) Received: from mail-yx0-f187.google.com (unknown [209.85.210.187]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 5DECE72307 for ; Thu, 12 Nov 2009 13:05:14 -0500 (EST) Received: by yxe17 with SMTP id 17so2161309yxe.33 for ; Thu, 12 Nov 2009 10:05:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.101.170.9 with SMTP id x9mr3210626ano.181.1258049113911; Thu, 12 Nov 2009 10:05:13 -0800 (PST) In-Reply-To: <87639fmz72.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> Date: Thu, 12 Nov 2009 18:05:13 +0000 Message-ID: <9a0c00530911121005g2c903a3di6cfde6fe6fe9e42f@mail.gmail.com> Subject: Re: Coroutines and Go From: Paul Hudson To: Lua list Content-Type: multipart/alternative; boundary=001636c92bba8b728e0478306211 X-Pobox-Relay-ID: ED4EB198-CFB5-11DE-AE5E-CF348C00A62A-32369995!b-pb-sasl-quonix.pobox.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c92bba8b728e0478306211 Content-Type: text/plain; charset=ISO-8859-1 > Stack frames are newcomers. Older architectures had nothing to deal with recursion True, but that didn't stop LISP happening - so maybe there's less of a connection between architecture availability and potential programming languages. --001636c92bba8b728e0478306211 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > Stack frames are newcomers. =A0Older architectures had nothing to deal with recursion

True, but that didn't stop LISP happening - so ma= ybe there's less of a connection between architecture availability and = potential programming languages.
--001636c92bba8b728e0478306211-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:08:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACI7oaj027827; Thu, 12 Nov 2009 16:07:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F19DA1941C; Thu, 12 Nov 2009 16:07:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout1.mclink.it (smtpout1.mclink.it [195.110.128.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98BC9193E4 for ; Thu, 12 Nov 2009 16:07:22 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout1.mclink.it (8.13.6/8.13.6) with ESMTP id nACI7IgG004100 for ; Thu, 12 Nov 2009 19:07:18 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAre+0rDbohc/2dsb2JhbADdZYQ8BA Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 12 Nov 2009 19:07:17 +0100 Received: from [192.168.127.128] (host211-29-dynamic.31-79-r.retail.telecomitalia.it [79.31.29.211]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nACI7HL9093708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Nov 2009 19:07:18 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFC4ED2.4040503@erix.it> Date: Thu, 12 Nov 2009 19:07:14 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> In-Reply-To: <87639fmz72.fsf@lola.goethe.zz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Kastrup wrote: > Stack frames are newcomers. Older architectures had nothing to deal > with recursion. It depends on your definition of "newcomers" :-) They were definitely not new in 1979 (Motorola's 6809 supported them) but keeping stuff in the stack was not uncommon even with the 6502, even without direct hardware support. (or did I misread your post?) (I was about to mention LISP, but Paul did) Enrico From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:33:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACIXapw002054; Thu, 12 Nov 2009 16:33:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A16CE193C4; Thu, 12 Nov 2009 16:33:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sasl.smtp.pobox.com (b-pb-sasl-quonix.pobox.com [208.72.237.35]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE1C01932B for ; Thu, 12 Nov 2009 16:32:57 -0200 (BRST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id E1847723EC for ; Thu, 12 Nov 2009 13:32:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; s=sasl; bh=AF0zHe9KxU8I4/LJ7OZd98CyK4Y=; b=e5/inr Qn6MW/M588//mEv51MtL8uxByvz6q8JYlxspHU8fnggi3gf3eaZS20+YOtws2YkW 0jvp/y0NBs9h7RhjOTisK6CsReh2uifkoBlbug1uv5Dmsjbo9Rk9gIJneX1jWLmH 06h062craLSl14T5d1NWYXCrBRDSBsqnI/DAw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; q=dns; s=sasl; b=r5klMto8Ghp+dLm5RKkoJJUjRypglJ7n ml6K5/0/kw2Bvgk3letYMRU+Sd4unErBv2xg89wukNKrvU/8KJzND4ieeXXf6jdb Xz2+3PvGdCkSWN7gej4SN4YLtj5bAmgGCgmxtrxamglk3lSc6HZoRd9Ph5QHkCU/ lp89yRRaoiM= Received: from b-pb-sasl-quonix. (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id DEBAC723EB for ; Thu, 12 Nov 2009 13:32:56 -0500 (EST) Received: from mail-gx0-f226.google.com (unknown [209.85.217.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id B16FB723EA for ; Thu, 12 Nov 2009 13:32:56 -0500 (EST) Received: by gxk26 with SMTP id 26so2295873gxk.1 for ; Thu, 12 Nov 2009 10:32:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.54.39 with SMTP id c39mr3304117ana.144.1258050775953; Thu, 12 Nov 2009 10:32:55 -0800 (PST) In-Reply-To: <87639fmz72.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> Date: Thu, 12 Nov 2009 18:32:55 +0000 Message-ID: <9a0c00530911121032r568cf860we12e0b44b6f4d1ab@mail.gmail.com> Subject: Re: Coroutines and Go From: Paul Hudson To: Lua list Content-Type: multipart/alternative; boundary=001485f792ca9c30c5047830c5e1 X-Pobox-Relay-ID: CC28CB80-CFB9-11DE-9BCB-CF348C00A62A-32369995!b-pb-sasl-quonix.pobox.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f792ca9c30c5047830c5e1 Content-Type: text/plain; charset=ISO-8859-1 > Stack frames are newcomers. Older architectures had nothing to deal with recursion True, but that didn't stop LISP happening - so mayb --001485f792ca9c30c5047830c5e1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > Stack frames are newcomers. =A0Older architectures had nothing to deal with recursion

True, but that didn't stop LISP happening - so ma= yb
--001485f792ca9c30c5047830c5e1-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:34:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACIYFLD002208; Thu, 12 Nov 2009 16:34:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 69D92193DB; Thu, 12 Nov 2009 16:33:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sasl.smtp.pobox.com (b-pb-sasl-sd.pobox.com [64.74.157.63]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C4A871932B for ; Thu, 12 Nov 2009 16:33:35 -0200 (BRST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 614058D200 for ; Thu, 12 Nov 2009 13:33:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; s=sasl; bh=cjeYJjuYMvzThGPLKta5u3o1LkI=; b=dGWAhG fLG+36VbPT/ZJfaHnis2AuxO9lFtIWugbI5UtNZ8qxev4vZZhn/TQhY/PFrM0ZuH cc46pBCo+R9Xw/J42m1MgkeqnAVP+hUmd45N779N7lA7Bb3XdS+yy5b0TVayuwmM J/KYfFiLCIFdYvbsFM+9rDOhbt5uuK3hCWVLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; q=dns; s=sasl; b=FtP4ugWSemCH6K+lQ1qcjsbFJSFrwJub buGSfVE0huJu/R5HYpGZpxYMGXE+kfly+/PWx+B/ZwfklPEsMtb/nbmGEki7Qo9b u4ci9N9uQEuV24UOyPBNfrhJhXmha3nxTui6Buv+IA4j581MCmZhkh3AsTPgYhi2 B232JFYPph0= Received: from b-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5C1AD8D1FF for ; Thu, 12 Nov 2009 13:33:31 -0500 (EST) Received: from mail-yw0-f202.google.com (unknown [209.85.211.202]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 2F59C8D1FA for ; Thu, 12 Nov 2009 13:33:30 -0500 (EST) Received: by ywh40 with SMTP id 40so554733ywh.33 for ; Thu, 12 Nov 2009 10:33:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.101.200.29 with SMTP id c29mr3288405anq.101.1258050810326; Thu, 12 Nov 2009 10:33:30 -0800 (PST) In-Reply-To: <9a0c00530911121032r568cf860we12e0b44b6f4d1ab@mail.gmail.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <9a0c00530911121032r568cf860we12e0b44b6f4d1ab@mail.gmail.com> Date: Thu, 12 Nov 2009 18:33:30 +0000 Message-ID: <9a0c00530911121033n28f6a496na7b61d64ed7d9841@mail.gmail.com> Subject: Re: Coroutines and Go From: Paul Hudson To: Lua list Content-Type: multipart/alternative; boundary=0016e68e802ca8b06b047830c771 X-Pobox-Relay-ID: E0B03E1C-CFB9-11DE-907C-73B7A4293987-32369995!b-pb-sasl-sd.pobox.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68e802ca8b06b047830c771 Content-Type: text/plain; charset=ISO-8859-1 2009/11/12 Paul Hudson > > Stack frames are newcomers. Older architectures had nothing to deal with > recursion > > True, but that didn't stop LISP happening - so maybe less connection > between architecture and language design? > --0016e68e802ca8b06b047830c771 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/11/12 Paul Hudson <phudson@pobox.com><= br>
> Stack frames are newcomers. =A0Older architectures h= ad nothing to deal with recursion

True, but tha= t didn't stop LISP happening - so maybe less connection between archite= cture and language design?

--0016e68e802ca8b06b047830c771-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:37:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACIbPBb002952; Thu, 12 Nov 2009 16:37:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEDEE1943F; Thu, 12 Nov 2009 16:36:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from sasl.smtp.pobox.com (b-pb-sasl-sd.pobox.com [64.74.157.63]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CEDBF19405 for ; Thu, 12 Nov 2009 16:36:44 -0200 (BRST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 6C64D8D24B for ; Thu, 12 Nov 2009 13:36:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; s=sasl; bh=28wgU0HmsgyW+z8skZytNaAXlNM=; b=jui8nr 1YBMDtt70IGlKlGmXiMoRZhyZ3d3ry8uFrBx3XKchzJ4MCJFs4t0UKLBI9X+Bni0 mV2TkO3/1p+D13EzkWODodEJkdmlPBqxISu5IRUsp+DerDQyHQjDmzNu+uzL8pkE K13GYolClxUTGEQsDCwYEcnH1W83dy2xNw7x0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to :content-type; q=dns; s=sasl; b=s9qLNLKD8q+/rNUOyNn/9OsZkkQjLAYs KMr/nmKaV6DsJVmh7P9bWILdiN2bRx0FgJ1uIYt/tQBGRiPk7C00Vxrow+5TnVQj CUsqfYJu9e6qg/ox5606fN6652gyYfjqX3UVvXnVcoZR+jgGzfpIAPKoSUZHeTlU qpvwaS3TcTo= Received: from b-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 677128D24A for ; Thu, 12 Nov 2009 13:36:43 -0500 (EST) Received: from mail-yw0-f202.google.com (unknown [209.85.211.202]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 3FF918D249 for ; Thu, 12 Nov 2009 13:36:43 -0500 (EST) Received: by ywh40 with SMTP id 40so557933ywh.33 for ; Thu, 12 Nov 2009 10:36:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.101.170.9 with SMTP id x9mr3293844ano.181.1258051002631; Thu, 12 Nov 2009 10:36:42 -0800 (PST) In-Reply-To: <4AFC4ED2.4040503@erix.it> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> Date: Thu, 12 Nov 2009 18:36:42 +0000 Message-ID: <9a0c00530911121036meb43fdi313d0d591df1148c@mail.gmail.com> Subject: Re: Coroutines and Go From: Paul Hudson To: Lua list Content-Type: multipart/alternative; boundary=001636c92bba1f099d047830d35f X-Pobox-Relay-ID: 5329CEAE-CFBA-11DE-B6E2-73B7A4293987-32369995!b-pb-sasl-sd.pobox.com X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c92bba1f099d047830d35f Content-Type: text/plain; charset=ISO-8859-1 (Sorry about the repeated messages) They were definitely not new in 1979 (Motorola's 6809 supported them) but > keeping stuff in the stack was not uncommon even with the 6502, even without > direct hardware support. > Way before that - the PDP-11 has hardware support for a stack, and I'll bet it wasn't the first. --001636c92bba1f099d047830d35f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable (Sorry about the repeated messages)

They were definitely not new in 1979 (Motorola's 6809 supported them) b= ut keeping stuff in the stack was not uncommon even with the 6502, even wit= hout direct hardware support.

Way before that - th= e PDP-11 has hardware support for a stack, and I'll bet it wasn't t= he first.

--001636c92bba1f099d047830d35f-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:46:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACIkQfC005433; Thu, 12 Nov 2009 16:46:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35D4E19434; Thu, 12 Nov 2009 16:45:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8AC79193EF for ; Thu, 12 Nov 2009 16:45:50 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N8efy-0005FW-CN for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 19:45:46 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N8efx-0008VB-SK for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 19:45:45 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> Date: Thu, 12 Nov 2009 19:45:45 +0100 In-Reply-To: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> (steve donovan's message of "Thu, 12 Nov 2009 13:16:54 +0200") Message-ID: <87k4xvmvja.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * steve donovan: > We obviously don't need to be convinced about coroutines, but the idea > of moving blocked ones to another thread is intriguing. This is called n:m threading. It's been tried for C-like languages, but it turned out to be less beneficial than expected. I believe GHC and Erlang/OTP still do this, but their run-time environments are rather different, of course. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 16:58:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACIwGlp007709; Thu, 12 Nov 2009 16:58:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F1B10193E3; Thu, 12 Nov 2009 16:57:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6319A19109 for ; Thu, 12 Nov 2009 16:57:30 -0200 (BRST) Received: by fxm21 with SMTP id 21so2587906fxm.21 for ; Thu, 12 Nov 2009 10:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=/WfQMSx3d/RlaMNTYE09SqLw/oupViIOdYZjc1YCeIs=; b=eeUVxw+k43mwvQTNqlsZJb1phhlfoGQFYfBJoT4Vqvanv7sJ2uf5ygTvlrOvYbsuGQ iTv0F+cyuE4NF6DqCCwq6llRdPGo3KWgmqEFUfWTetrMMr3k61GT28IK7z0KGxBRWbky RZq+2G32hQLN853n8tMrRT71UoX62fcPUtwSs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=xUKmDwqKh0ub9IhRCVyCSSbFAHrSLO+VTI+7WnM7xxERQTlLB5NR9fpF9MtIW1fN+D MMoS4s+hXcammlC/gT9+ywWkRXlhl7bB1/f880G6dykobt0a5l9Rca4EQW7IqMxDKazO bfEKY9UZfucie3jYrHI6TSTrJ4H2cYFpKIvbU= Received: by 10.204.34.3 with SMTP id j3mr3691161bkd.23.1258052248172; Thu, 12 Nov 2009 10:57:28 -0800 (PST) Received: from ?95.78.78.191? ([95.78.78.191]) by mx.google.com with ESMTPS id 14sm1018557fxm.3.2009.11.12.10.57.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Nov 2009 10:57:27 -0800 (PST) Date: Thu, 12 Nov 2009 21:52:39 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <192734543.20091112215239@gmail.com> To: David Given Subject: Re[2]: Coroutines and Go In-Reply-To: <4AFBF905.3020004@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello David, Thursday, November 12, 2009, 3:01:09 PM, you wrote: >> We obviously don't need to be convinced about coroutines, but the idea >> of moving blocked ones to another thread is intriguing. > I'm a bit dubious about that concept. > Unless it's doing something clever with asynchronous I/O, it'll need to > allocate a new system thread for every blocked coroutine. std implementation technique is that it looks like sync. call for user, but internally it works via async calls (for example, epoll queue). it is how it implemented in GHC (haskell), for example. they have reported that web server written in Haskell was running thousand of connections faster than Apache (used separate OS thread for every connection at those time) Writing High-Performance Server Applications in Haskell, Case Study: A Haskell Web Server, http://www.haskell.org/~simonmar/papers/web-server.ps.gz -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 17:07:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACJ7je2009767; Thu, 12 Nov 2009 17:07:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6CF121945E; Thu, 12 Nov 2009 17:07:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4EA831944A for ; Thu, 12 Nov 2009 17:07:03 -0200 (BRST) Received: by bwz27 with SMTP id 27so2583833bwz.21 for ; Thu, 12 Nov 2009 11:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5Jgaq1gfkvd7couRMYLlAgoDWklh5O4loee31bsOla0=; b=s+Bx4j0SFqVfv2UrcoBnS3hRYOg4gWRK8sZw6J1lRIeGVchE79BSzuYjBm60CrqF9v /QxqVVXLaRCr245AWjkZj5UGOjfJan6ckQf7TpWZ/1i4aaNtRv4iyR4c9IW22nUO8pM4 XZzpAF9rqWIvJCMiZFwrRYgFdO0PULtvRir/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=m4igA6FQXlPjs+ZCuX9IMQXsiGupIAPS+W6CaBjGeUs7/J+TNMzE0x0zqi0/sH85ka lI7AMG0+MGMvPCRRIiB3GMLfUJ/i2qmEuoY0PAtG6QV83KaDrunkX34Y5TAEJ/ToPptT w5wCdr9kzw3DTKsiO7eJcfRpvs4kZYpVy6cMs= Received: by 10.204.154.198 with SMTP id p6mr3667403bkw.131.1258052821961; Thu, 12 Nov 2009 11:07:01 -0800 (PST) Received: from ?95.78.78.191? ([95.78.78.191]) by mx.google.com with ESMTPS id 14sm1020346fxm.11.2009.11.12.11.07.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Nov 2009 11:07:00 -0800 (PST) Date: Thu, 12 Nov 2009 22:00:08 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <1375497145.20091112220008@gmail.com> To: David Given Subject: Re[2]: Coroutines and Go In-Reply-To: <4AFC3613.4020003@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello David, Thursday, November 12, 2009, 7:21:39 PM, you wrote: > circuits were rockets science. Why am I able to compare a language from > this era with a contemporary one on an equal basis? Because, > depressingly, state-of-the-art in programming languages hasn't moved > much in those 41 years. and you know Haskell, of course? algol-68 was too heavy for its times. now, Go is proposed as C successor, system-level PL, replacing assembler -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 17:08:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACJ8K4U009989; Thu, 12 Nov 2009 17:08:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A06D1949A; Thu, 12 Nov 2009 17:07:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A787D19458 for ; Thu, 12 Nov 2009 17:07:07 -0200 (BRST) Received: by bwz27 with SMTP id 27so2583871bwz.21 for ; Thu, 12 Nov 2009 11:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=pmre34xMB6rNVzyZPek8NpFXDIoMsDwafxILRtb54w8=; b=Ub4KTLulplscmyxbRwywvvUcbPAlGovHxiqzB34zqm749GNmDF4vbNvvtLfGBepZk4 3GGPW/Rzw+tmksrHQ1LUTJtsIOKV2QZYa9Oe4eHWUYWD+UOvu2oZSKbB2EAxTpbIwl6N 4WbypmNro7kGDmwTHmgtAp0sGvNT7mjUJvKkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=H1GeGG0M/4Ci5AC23vqSh9qO9oArigz4ZQHRGzy02JBNVbzpYOobOckgewRnQz5a87 PrtX0huORGW8KxclI4GgF9PMgVAaYrEpyhlIkPv+VnLeXQDtq3FeYD6Xht1x9jU753Tu Co5JSdGZKgjTXgaSfQSRfIbycWcIie2+6qKSE= Received: by 10.204.155.80 with SMTP id r16mr3677206bkw.133.1258052823673; Thu, 12 Nov 2009 11:07:03 -0800 (PST) Received: from ?95.78.78.191? ([95.78.78.191]) by mx.google.com with ESMTPS id 14sm1020346fxm.11.2009.11.12.11.07.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Nov 2009 11:07:02 -0800 (PST) Date: Thu, 12 Nov 2009 22:02:16 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <16110381056.20091112220216@gmail.com> To: Jim Whitehead II Subject: Re[2]: Coroutines and Go In-Reply-To: <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <5fe281d40911120828v28fa66d4ra4f78da4de55fcb4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Jim, Thursday, November 12, 2009, 7:28:39 PM, you wrote: > The PAR keyword doesn't in any way approximate 'OCCAM-like' > concurrency. i agree. occam primitives are based on CSP work, done later. at Algol68 time there were only ideas of semaphores and so, and afair they are also not in Algol68 -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 17:19:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACJJ3kC012052; Thu, 12 Nov 2009 17:19:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1A38B19438; Thu, 12 Nov 2009 17:18:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 55C7D1942D for ; Thu, 12 Nov 2009 17:18:34 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1N8fAt-00015I-DJ for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 20:17:43 +0100 Received: from p5b2c24aa.dip.t-dialin.net ([91.44.36.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 20:17:43 +0100 Received: from dak by p5b2c24aa.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2009 20:17:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: David Kastrup Subject: Re: Coroutines and Go Date: Thu, 12 Nov 2009 20:16:00 +0100 Organization: Organization?!? Lines: 25 Message-ID: <87k4xvlfke.fsf@lola.goethe.zz> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <9a0c00530911121036meb43fdi313d0d591df1148c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c24aa.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:Ewx8aAM8kmrDSN+PuXYNqK6NBWk= X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Paul Hudson writes: > (Sorry about the repeated messages) > > > They were definitely not new in 1979 (Motorola's 6809 supported them) but > keeping stuff in the stack was not uncommon even with the 6502, even > without direct hardware support. > > > Way before that - the PDP-11 has hardware support for a stack, and I'll bet it > wasn't the first. But we are not talking about the availability of index register based addressing. We are talking about it being equally efficient. Old architectures not even had a return stack. Later optimized with an explicit return jump instruction which did the same non-reentrable hackery. -- David Kastrup From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 17:54:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACJsb0j017994; Thu, 12 Nov 2009 17:54:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DC68B1944E; Thu, 12 Nov 2009 17:54:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6736519438 for ; Thu, 12 Nov 2009 17:54:04 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:45022) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1N8fk1-0007dQ-6I (Exim 4.70) (return-path ); Thu, 12 Nov 2009 19:54:01 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N8fk1-0005Ns-U8 (Exim 4.67) (return-path ); Thu, 12 Nov 2009 19:54:01 +0000 Date: Thu, 12 Nov 2009 19:54:01 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re[2]: Coroutines and Go In-Reply-To: <1375497145.20091112220008@gmail.com> Message-ID: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <1375497145.20091112220008@gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 12 Nov 2009, Bulat Ziganshin wrote: > > algol-68 was too heavy for its times. now, Go is proposed as C > successor, system-level PL, replacing assembler Go is at a similar level to Algol 68 or CLU - compiled, garbage collected, with rich data structures. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 18:13:47 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACKDhVn021109; Thu, 12 Nov 2009 18:13:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7EC0E19436; Thu, 12 Nov 2009 18:13:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1E0D4193E2 for ; Thu, 12 Nov 2009 18:13:08 -0200 (BRST) MIME-version: 1.0 Received: from [10.0.1.4] ([69.111.72.93]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KT000BGWIT5W060@asmtp026.mac.com> for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 12:12:43 -0800 (PST) From: Clark Snowdall Content-type: multipart/signed; boundary=Apple-Mail-4-576686515; protocol="application/pkcs7-signature"; micalg=sha1 Subject: UDP Broadcast Date: Thu, 12 Nov 2009 12:12:40 -0800 Message-id: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> To: lua@bazar2.conectiva.com.br X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-4-576686515 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Hello, I'm new to Lua ... so I hope my question isn't too basic. I'm trying to send a udp packet via broadcast. I have put together some test code: require 'socket' host = "localhost" port = 47808 udp, err = socket.udp() if not udp then print(err) os.exit() end udp:setoption('broadcast', true) err = udp:setsockname(host, port) if err == nil then print(err) os.exit() end udp:setpeername('10.0.1.255', 47808) result, err = udp:send('this is a test') --result, err = udp:sendto('this is a test', '10.0.1.255', 47808) if result == nil then print(err) os.exit() end udp:close() It appears to finish without any problems, but when I watch on wireshark the udp packet never appears anywhere. Am I doing something wrong in Lua? Am I perhaps doing something wrong with wireshark (even though I'm getting OTHER broadcast messages)? Any idea? Thanks, Snowdall --Apple-Mail-4-576686515 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJljCCBEYw ggOvoAMCAQICEGb9R+PCGeToms2Z3fU6yyQwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA1MTAyODAwMDAwMFoXDTE1MTAyNzIzNTk1OVow gd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp Z24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZl cmlzaWduLmNvbS9ycGEgKGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMjCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMnfrOfq+PgDFMQAktXBfjbCPO98chXLwKuMPRyV zm8eECw/AO2XJua2x+atQx0/pIdHR0w+VPhs+Mf8sZ69MHC8l7EDBeqV8a1AxUR6SwWi8mD81zpl Yu//EHuiVrvFTnAt1qIfPO2wQuhejVchrKaZ2RHp0hoHwHRHQgv8xTTq/ea6JNEdCBU3otdzzwFB L2OyOj++pRpu9MlKWz2VphW7NQIZ+dTvvI8OcXZZu0u2Ptb8Whb01g6J8kn+bAztFenZiHWcec5g J925rXXOL3OVekA6hXVJsLjfaLyrzROChRFQo+A8C67AClPN1zBvhTJGG+RJEMJs4q8fef/btLUC AwEAAaOB/zCB/DASBgNVHRMBAf8ECDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHFwEw KjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYTALBgNVHQ8EBAMCAQYw EQYJYIZIAYb4QgEBBAQDAgEGMC4GA1UdEQQnMCWkIzAhMR8wHQYDVQQDExZQcml2YXRlTGFiZWwz LTIwNDgtMTU1MB0GA1UdDgQWBBQRfV4ZfTwE32ps1qKKGj8x2DuUUjAxBgNVHR8EKjAoMCagJKAi hiBodHRwOi8vY3JsLnZlcmlzaWduLmNvbS9wY2ExLmNybDANBgkqhkiG9w0BAQUFAAOBgQA8o9oC YzrEk6qrctPcrVA4HgyeFkqIt+7r2f8PjZWg1rv6aguuYYTYaEeJ70+ssh9JQZtJM3aTi55uuUMc YL3C3Ioth8FFwBFyBBprJCpsb+f8BxMp0Hc6I+f1wYVoGb/GAVQgGa41gsxiPGEJxvTV67APpp8z hZrTcY5Qj5ndYjCCBUgwggQwoAMCAQICEBgvf/O/BFfpKY4BZsd7G3cwDQYJKoZIhvcNAQEFBQAw gd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp Z24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZl cmlzaWduLmNvbS9ycGEgKGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMjAeFw0w OTEwMzAwMDAwMDBaFw0xMDEwMzAyMzU5NTlaMIIBETEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4x HzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxRjBEBgNVBAsTPXd3dy52ZXJpc2lnbi5j b20vcmVwb3NpdG9yeS9SUEEgSW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMpOTgxHjAcBgNVBAsT FVBlcnNvbmEgTm90IFZhbGlkYXRlZDEzMDEGA1UECxMqRGlnaXRhbCBJRCBDbGFzcyAxIC0gTmV0 c2NhcGUgRnVsbCBTZXJ2aWNlMRcwFQYDVQQDFA5DbGFyayBTbm93ZGFsbDEfMB0GCSqGSIb3DQEJ ARYQc25vd2RhbGxAbWFjLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMt61T9V l4yaAjWhVHit4wZT0DvXcSnhvxrX/1VoAI+6k3OWquCQJEaAY3tLt05cNs8Io2QtRtclZyS00XYi FCjB3mWXlrmf4wDvQxz6CUlawLyPqbOVLOqqxuH92YDmsIEbUGHl0t9XNWHYbBT+lh5eSq1+xBsc lybe0pcNaIrh5dE45C1HzAbgf6beR4K9U6hL10KFkB6giB++QyXUoJk0R6qsIx+oxMb+/04Hfl6X F+KcvxHKoP1Zivue9sYzVIR5sKyhJYqwuHGQMPK2mim2mnL8PL/Or3nr5Kl+1kwlpWQVa+f0hhC6 H28CzVpMj4TVWht2RPBSPL8zHqDYFbcCAwEAAaOBzDCByTAJBgNVHRMEAjAAMEQGA1UdIAQ9MDsw OQYLYIZIAYb4RQEHFwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3Jw YTALBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwQGCCsGAQUFBwMCMEoGA1UdHwRDMEEw P6A9oDuGOWh0dHA6Ly9JbmRDMURpZ2l0YWxJRC1jcmwudmVyaXNpZ24uY29tL0luZEMxRGlnaXRh bElELmNybDANBgkqhkiG9w0BAQUFAAOCAQEAoqAk7YUnAv58uJtNWVoxe1aA5dJoJIAwghil28iR ZwS2vsNFFTL7YPsDp6Y/t17Gm1azntBlPVqIOkpKFWbLmlqSkbCYyfPMqbmtxy7izCR/3rMqrokq 17Vv9UyltSBF0n1rC0KSF1hUIDZf6LuaN7hCxHPDcThS1MidJla5+tpPCo0PBJZWrSx0BtT3FCsf tKQev4HB+p0X0bxF2kTpUPY/J5efSwtz1flR5aUZELuibnp0+iHFlYcUjtiC+oPWSTAVSUl6Bfuk 1tMuIuRomFmHNILhbgdmE9hVrEsAL2Gh9nZ+dQOcwGt/491qCTRz1qYm8u56pop7peseJRXGajGC BIswggSHAgEBMIHyMIHdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAd BgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBo dHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTA1MR4wHAYDVQQLExVQZXJzb25hIE5vdCBW YWxpZGF0ZWQxNzA1BgNVBAMTLlZlcmlTaWduIENsYXNzIDEgSW5kaXZpZHVhbCBTdWJzY3JpYmVy IENBIC0gRzICEBgvf/O/BFfpKY4BZsd7G3cwCQYFKw4DAhoFAKCCAm0wGAYJKoZIhvcNAQkDMQsG CSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkxMTEyMjAxMjQxWjAjBgkqhkiG9w0BCQQxFgQU R20Jl4/VnixQs0hiq2CIoxIZMSswggEDBgkrBgEEAYI3EAQxgfUwgfIwgd0xCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y azE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEg KGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUGA1UEAxMuVmVyaVNpZ24g Q2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMgIQGC9/878EV+kpjgFmx3sbdzCC AQUGCyqGSIb3DQEJEAILMYH1oIHyMIHdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24s IEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9m IHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTA1MR4wHAYDVQQLExVQZXJz b25hIE5vdCBWYWxpZGF0ZWQxNzA1BgNVBAMTLlZlcmlTaWduIENsYXNzIDEgSW5kaXZpZHVhbCBT dWJzY3JpYmVyIENBIC0gRzICEBgvf/O/BFfpKY4BZsd7G3cwDQYJKoZIhvcNAQEBBQAEggEAduJY jMvz2ZzuuNGcdAfd3bxN5irysi3pgKSl7cLYGBJF6WzLaiXalTtnYR7qx64jNe0kLqHTuJOFZcTP MMfbE4QYRMb7QSR4B51qK1/G9chVSkOczmoInKBz29dsM8OpDzA4k+4+j3SujRz0PzTSwZm4/VxJ g/CGfLbNxQ4cPCpv9Lw9em0d7XbPkIl6odxvGWcJdVRZLEWXECNzqZ/dbgrgTEAR1BvnXl6ChzDa 50QKvxR/1RDqfJeqvVBsuEVUIScMKAppx2Rysr5vrBTDyWT0thva/OHBp//4lEAlykahzxdmrQd0 c+I5648qf8zRHLQSMtn9lRA3GnfOjcfIqQAAAAAAAA== --Apple-Mail-4-576686515-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 18:46:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACKkjWm026563; Thu, 12 Nov 2009 18:46:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3138A19445; Thu, 12 Nov 2009 18:46:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D92DF19405 for ; Thu, 12 Nov 2009 18:46:12 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N8gYT-00089G-3a for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 21:46:09 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N8gYS-0000wy-G2 for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 21:46:08 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <87bpj7n1hq.fsf@lola.goethe.zz> Date: Thu, 12 Nov 2009 21:46:08 +0100 In-Reply-To: <87bpj7n1hq.fsf@lola.goethe.zz> (David Kastrup's message of "Thu, 12 Nov 2009 17:37:04 +0100") Message-ID: <87tywzjwtr.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * David Kastrup: > generic support of Ada (while stealing part of its syntax and > wearing it like a hat on its feet) C++ templates are strictly more powerful than Ada genrics. And C++ is one of the few languages which have open type-level functions (Ada isn't). From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 19:18:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACLIr6p030933; Thu, 12 Nov 2009 19:18:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2BA819423; Thu, 12 Nov 2009 19:18:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from efwdmzmail.efw.com (relay.efw.com [76.195.112.200]) by bazar2.conectiva.com.br (Postfix) with SMTP id F2A6119403 for ; Thu, 12 Nov 2009 19:17:43 -0200 (BRST) Received: from c4imexch1.efw.com (Not Verified[10.104.32.24]) by efwdmzmail.efw.com with MailMarshal (v6, 4, 6, 5922) id ; Thu, 12 Nov 2009 15:03:08 -0600 Received: from [10.104.20.9] ([10.104.20.9]) by c4imexch1.efw.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Nov 2009 16:17:40 -0500 Message-ID: <4AFC7B73.9060708@elbitsystems-us.com> Date: Thu, 12 Nov 2009 16:17:39 -0500 From: Doug Rogers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: UDP Broadcast References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> In-Reply-To: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Nov 2009 21:17:40.0194 (UTC) FILETIME=[90CFCC20:01CA63DD] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Clark Snowdall wrote: > require 'socket' > host = "localhost" > port = 47808 > udp, err = socket.udp() > if not udp then print(err) os.exit() end > udp:setoption('broadcast', true) > err = udp:setsockname(host, port) > if err == nil then print(err) os.exit() end This might need to be changed to do what you want. Make sure you're not getting a 'nil' printed on the screen - in which case the packet is never being sent. For a more reliable method of catching socket call errors, use assert(): assert(udp:setoption('broadcast', true)) assert(udp:setsockname(host, port)) -- Do the same for the rest. See http://www.lua.org/manual/5.1/manual.html#5.1 for the behavior of assert(); the return values from the socket calls are designed to interact with it for short scripts like this. Also, for me udp:setpeername() fails under Linux when I use 'localhost' in setsockname(). I have to set the host variable to be the local IP address on the Ethernet interface (to which I want to send). I'm not sure why this is so - perhaps use INADDR_ANY rather than 'localhost'? If these are not your problems, then I'm at a loss. I was able to capture the subnet broadcast packet using Wireshark; it's Ethernet address was broadcast. I set the filter to 'udp port 47808' and made the mods mentioned above. Doug ______________________________________________________________________________________ The information contained in this email transmission may contain proprietary and business sensitive information. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. Unauthorized interception of this e-mail is a violation of law. If you are not the intended recipient, please contact the sender by reply email and immediately destroy all copies of the original message. Any technical data and/or information provided with or in this email may be subject to U.S. export controls law. Export, diversion or disclosure contrary to U.S. law is prohibited. Such technical data or information is not to be exported from the U.S. or given to any foreign person in the U.S. without prior written authorization of Elbit Systems of America and the appropriate U.S. Government agency. From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:00:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACM0ghp005348; Thu, 12 Nov 2009 20:00:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 39224193E2; Thu, 12 Nov 2009 20:00:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-gx0-f226.google.com (mail-gx0-f226.google.com [209.85.217.226]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3EFB6193BD for ; Thu, 12 Nov 2009 20:00:04 -0200 (BRST) Received: by gxk26 with SMTP id 26so2506178gxk.1 for ; Thu, 12 Nov 2009 14:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=BPDauqSAAdGvs+sBHQbfkVrKmsRJEaoe1Uwi6MEDfLA=; b=iLVDmrOrnI0KPlVndmxm0G+q6LXLsyAP4GRA2T35O2V2+QNp9tBEYULKjno33+RVpQ GwN1YN3yf+R0iO/1B/DHoiTKrkUcqQZDxMfBub/UjNKnVsKgsp0p+7PVpKt4AaHW2kDn ImKnRKKghwN9fNJlBkcfTUGcdW5/tQYFsYpqE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sD6P13aRdASJPbB36VLuvGmGM1G2lsYvp9jz1m1tTUyOOIlf3o3wnLL17TlXEN2vrh 9R+QRiVXIEsifMLvcHQtFuIjwmCXXEZvUm+Af7DxktkC5PTUQBq+R5yK0tDvPbru+B6P GChtyavSct46DEoD/Yn2j/t6kBfn1dWflh57Q= MIME-Version: 1.0 Received: by 10.101.135.38 with SMTP id m38mr3745990ann.163.1258063200151; Thu, 12 Nov 2009 14:00:00 -0800 (PST) Date: Thu, 12 Nov 2009 20:00:00 -0200 Message-ID: Subject: Passing to Lua a table inside a table From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636c5c03f266ca5047833aaf3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5c03f266ca5047833aaf3 Content-Type: text/plain; charset=ISO-8859-1 Why cant I pass a table inside a table with the following code: //first table lua_newtable(lua_state); //second table inside the first table lua_newtable(lua_state); lua_pushstring(lua_state, "x"); //key lua_pushnumber(lua_state, (double)array[0]); //value lua_settable(lua_state, -3); lua_pushstring(lua_state, "y"); //key lua_pushnumber(lua_state, (double)array[1]); //value lua_settable(lua_state, -3); lua_pushstring(lua_state, "z"); //key lua_pushnumber(lua_state, (double)array[2]); //value lua_settable(lua_state, -3); //finish the second table and set it as index to the first table lua_rawseti(lua_state, -2, index); //set name of the first table lua_setglobal(lua_state, lua_table_name); --001636c5c03f266ca5047833aaf3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Why cant I pass a table inside a table with the following code:

=A0= =A0=A0=A0=A0=A0 //first table
=A0 =A0 =A0 =A0 lua_newtable(lua_state);=A0=A0=A0=A0=A0
=A0=A0=A0=A0=A0=A0 //second table inside the first ta= ble
=A0 =A0 =A0=A0 lua_newtable(lua_state);
=A0=A0=A0=A0
=A0=A0=A0=A0=A0=A0=A0 lua_pushstring(lua_state, "x&qu= ot;);=A0=A0=A0=A0=A0=A0=A0=A0 //key
=A0=A0=A0=A0=A0=A0=A0 lua_pushnumber= (lua_state, (double)array[0]);=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //value
= =A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_state, -3);

=A0=A0=A0=A0=A0= =A0=A0 lua_pushstring(lua_state, "y");=A0=A0=A0=A0=A0=A0=A0=A0 //= key
=A0=A0=A0=A0=A0=A0=A0 lua_pushnumber(lua_state, (double)array[1]);=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 //value
=A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_= state, -3);

=A0=A0=A0=A0=A0=A0=A0 lua_pushstring(lua_state, "z&= quot;);=A0=A0=A0=A0=A0=A0=A0=A0 //key
=A0=A0=A0=A0=A0=A0=A0 lua_pushnumb= er(lua_state, (double)array[2]);=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //value =A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_state, -3);
=A0
=A0=A0=A0=A0= =A0=A0=A0 //finish the second table and set it as index to the first table<= br>=A0=A0=A0=A0=A0=A0=A0 lua_rawseti(lua_state, -2, index);

=A0=A0= =A0=A0=A0=A0=A0 //set name of the first table
=A0 =A0 =A0 =A0 lua_setglo= bal(lua_state, lua_table_name);

--001636c5c03f266ca5047833aaf3-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:06:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACM6Rea006083; Thu, 12 Nov 2009 20:06:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E5B0719445; Thu, 12 Nov 2009 20:06:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33F1C1941E for ; Thu, 12 Nov 2009 20:06:00 -0200 (BRST) Received: by iwn8 with SMTP id 8so2154063iwn.33 for ; Thu, 12 Nov 2009 14:05:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.4.75 with SMTP id 11mr646140ibq.25.1258063557481; Thu, 12 Nov 2009 14:05:57 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Nov 2009 17:05:57 -0500 Message-ID: <790db3550911121405ye567221ued5de1a18c5604dc@mail.gmail.com> Subject: Re: Passing to Lua a table inside a table From: Patrick Donnelly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id nACM6Rea006083 On Thu, Nov 12, 2009 at 5:00 PM, zweifel wrote: > Why cant I pass a table inside a table with the following code: > >        //first table >         lua_newtable(lua_state); > >        //second table inside the first table >        lua_newtable(lua_state); > >         lua_pushstring(lua_state, "x");         //key >         lua_pushnumber(lua_state, (double)array[0]);            //value >         lua_settable(lua_state, -3); > >         lua_pushstring(lua_state, "y");         //key >         lua_pushnumber(lua_state, (double)array[1]);            //value >         lua_settable(lua_state, -3); > >         lua_pushstring(lua_state, "z");         //key >         lua_pushnumber(lua_state, (double)array[2]);            //value >         lua_settable(lua_state, -3); > >         //finish the second table and set it as index to the first table >         lua_rawseti(lua_state, -2, index); > >         //set name of the first table >         lua_setglobal(lua_state, lua_table_name); This code looks fine to me. You must be doing something else wrong? -- -Patrick Donnelly "Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows." - Benjamin Franklin From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:08:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACM8soS006393; Thu, 12 Nov 2009 20:08:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C7F419460; Thu, 12 Nov 2009 20:08:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pz0-f171.google.com (mail-pz0-f171.google.com [209.85.222.171]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95DFD19452 for ; Thu, 12 Nov 2009 20:08:22 -0200 (BRST) Received: by pzk1 with SMTP id 1so853935pzk.33 for ; Thu, 12 Nov 2009 14:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=UY/L3ZPMthzgU4oNIbHGFHgcwiJ8fQEW5uigXh1VnW0=; b=D3F9YDH1gsL8q6WZoJLOc9TBS5grSnMPDgjMAx8pSI17YX903qry+EjMTVNh6VtcDd JA7rgdwI4OcFx/PJpr1gPNI8exf8n4vjp7cCaSXlVJAn0+UEUbxrhODWdvFIkkED7Ic8 TGcmzMvjO+1cjEnRDB2kqVBWvqTbtF2O4qqPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=JsmTHapmVahq9Sh7fc6URGSsCRnWXlYkcbAXkl3QukPF+TJsTHXjQq8OJiOVWmt2Dc vgmHPWEIrbI5aOFoDBH2XpxXveVk764Jt/ZaavhqQs23DyKT4cTDrwvxGB6lZB1DkNyY xoyHz6BOSba+ux6A2TPDix5Mz+Afa5MikD8fE= MIME-Version: 1.0 Received: by 10.115.116.37 with SMTP id t37mr6770839wam.79.1258063698219; Thu, 12 Nov 2009 14:08:18 -0800 (PST) In-Reply-To: References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> From: corey johnson Date: Thu, 12 Nov 2009 14:07:58 -0800 Message-ID: <5a4c9d880911121407x559921e9l9c560b97c30c90c5@mail.gmail.com> Subject: Re: Userdata and the GC To: Lua list , mark@grubmah.com Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Oct 23, 2009 at 3:09 PM, Mark Hamburg wrote: > Create a userdata object that exists purely to get collected and have its > __gc metamethod called. When the metamethod gets called, scan the strong set > looking for objects with retain counts of 1 and remove them from the set. > Then create a new object to get collected on the next GC cycle. Provided the > number of objects is small, you can do the scan quickly. I'm just getting around to implementing the code from Mark but am not sure how this edge case would be handled. -- Note: Lua Proxy Userdata is what holds the reference to the obj-c object function dummyCode(array) -- array is an instance of an obj-c NSArray Object local thing = NSObject:alloc():init() -- Assume the Lua Proxy Userdata for 'thing' is automatically put into the strong set ... -- Misc Lua code. Assume the Lua garbage collector will be run during this code. Since 'thing' is -- not being retained by any other obj-c code (its retain count is 1) it is removed from the strong set. array:insertObject(thing) -- Now 'thing' has been retained by obj-c (its retain count is 2), but Lua has no way of knowing -- it should be added back into the strong set. thing = nil -- Now the Lua Proxy Userdata will be destroyed on the next garbage collection, yet the 'thing' obj-c object is still -- being used and will need the Lua Proxy Userdata end I may not have understood the implementation correctly. So any help you could give would be greatly appreciated! Corey From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:19:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACMJc1l008046; Thu, 12 Nov 2009 20:19:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 72F78193C8; Thu, 12 Nov 2009 20:19:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E62E0192EA for ; Thu, 12 Nov 2009 20:19:01 -0200 (BRST) Received: by pwi3 with SMTP id 3so1619621pwi.21 for ; Thu, 12 Nov 2009 14:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=iZrjDJtt91o4uRDj2ctNQpQUsAxiMD6+GP4hMEMhkUQ=; b=CFBzSQJBtkx+yYP9ZkADZQFy+8YUPu/KFpL/+sfjRlx+V6VO38JtxuDTJEmsZV6g6E Jsr4jOSoFSQilJro8QHChwUZIE9Hr+TUYo2cA2zFKJY2/HJoxvFhXktg6Bws265Z9FcM iCs+RtkPwb/VQkiUVeCiL7xhv7RSchFd6MVn8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Kv6ceL11Uruy1ogzUxgInfXKdoknlj1pT9gzeWArdKbVhvw0LgBLB888y6hQsr4fMe my28MIEsGKTMLGuySH4+sxW8OYrkOPOEi/wdUjhe9jO+WIsa2wm2wq3cZ1TGQu1XHxvd /F8MlKTPoMzfifr1Sgdk01Qqmg4rllr2Rshvo= MIME-Version: 1.0 Received: by 10.115.24.12 with SMTP id b12mr6734049waj.86.1258064337109; Thu, 12 Nov 2009 14:18:57 -0800 (PST) In-Reply-To: <5a4c9d880911121407x559921e9l9c560b97c30c90c5@mail.gmail.com> References: <5a4c9d880910231039p587045dft5cc5fec3bd5bf765@mail.gmail.com> <17eac67c0910231048pb0ca465x74f67e437c265049@mail.gmail.com> <5a4c9d880910231117y4a00fccx6a921b2e5185172e@mail.gmail.com> <17eac67c0910231253v22ec9dxf900f5560f0df585@mail.gmail.com> <5a4c9d880911121407x559921e9l9c560b97c30c90c5@mail.gmail.com> From: corey johnson Date: Thu, 12 Nov 2009 14:18:37 -0800 Message-ID: <5a4c9d880911121418h457d35c2w71970f4d6c70c0b4@mail.gmail.com> Subject: Re: Userdata and the GC To: Lua list , mark@grubmah.com Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nACMJc1l008046 Sorry for the code formatting, Here is a link to view the code more easily http://gist.github.com/233358 Corey On Thu, Nov 12, 2009 at 2:07 PM, corey johnson wrote: > function dummyCode(array) -- array is an instance of an obj-c NSArray Object >    local thing = NSObject:alloc():init() -- Assume the Lua Proxy > Userdata for 'thing' is automatically put into the strong set >    ... -- Misc Lua code. Assume the Lua garbage collector will be run > during this code. Since 'thing' is >        -- not being retained by any other obj-c code (its retain > count is 1) it is removed from the strong set. >    array:insertObject(thing) -- Now 'thing' has been retained by > obj-c (its retain count is 2), but Lua has no way of knowing >                                            -- it should be added back > into the strong set. >    thing = nil -- Now the Lua Proxy Userdata will be destroyed on the > next garbage collection, yet the 'thing' obj-c object is still >                    -- being used and will need the Lua Proxy Userdata > end From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:25:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACMPKnx008679; Thu, 12 Nov 2009 20:25:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C797719472; Thu, 12 Nov 2009 20:24:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0250A193DE for ; Thu, 12 Nov 2009 20:24:50 -0200 (BRST) Received: by ywh40 with SMTP id 40so776049ywh.33 for ; Thu, 12 Nov 2009 14:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+/MZkZa9fu5pMJHuO8TptsKz0RIMWr5lfdcwhNwBmAw=; b=shXKX6UBnpJwjRVs1vtsS2vYKdsMoF42VdMegRKnZOA4cRp/tZcAxatO5xWRSA3KlJ BMcDUOU6ZEVO/tK8ERmixWAFBmEReg6/yE7ZT0s58/q+x0w7/ClabgeSU2/NHCMlK/Px I0XOeBGhsvPXl91Vgse/8l4xIHwDk8zwyfnpg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=orOcPwCoG7uR4GgtU+WlgETbexN1qjQ6r3Z2fBEYA/xZe/Zg3xXpJH6nuXX9L7F4+j 8U03jWFEjideOlG+yMwiEj/S2dTvBShUT/btmSxkjRcKAxVPat2UPEqFexsfi0WnidV+ 4iZLX9H0+f3MJKi3/L10dvocZAmzsijOB9iXg= MIME-Version: 1.0 Received: by 10.101.177.13 with SMTP id e13mr3829592anp.95.1258064687144; Thu, 12 Nov 2009 14:24:47 -0800 (PST) In-Reply-To: <790db3550911121405ye567221ued5de1a18c5604dc@mail.gmail.com> References: <790db3550911121405ye567221ued5de1a18c5604dc@mail.gmail.com> Date: Thu, 12 Nov 2009 20:24:47 -0200 Message-ID: Subject: Re: Passing to Lua a table inside a table From: zweifel To: Lua list Content-Type: multipart/alternative; boundary=001636988b67c8204004783402fc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636988b67c8204004783402fc Content-Type: text/plain; charset=ISO-8859-1 Thanks a lot! 2009/11/12 Patrick Donnelly > On Thu, Nov 12, 2009 at 5:00 PM, zweifel wrote: > > Why cant I pass a table inside a table with the following code: > > > > //first table > > lua_newtable(lua_state); > > > > //second table inside the first table > > lua_newtable(lua_state); > > > > lua_pushstring(lua_state, "x"); //key > > lua_pushnumber(lua_state, (double)array[0]); //value > > lua_settable(lua_state, -3); > > > > lua_pushstring(lua_state, "y"); //key > > lua_pushnumber(lua_state, (double)array[1]); //value > > lua_settable(lua_state, -3); > > > > lua_pushstring(lua_state, "z"); //key > > lua_pushnumber(lua_state, (double)array[2]); //value > > lua_settable(lua_state, -3); > > > > //finish the second table and set it as index to the first table > > lua_rawseti(lua_state, -2, index); > > > > //set name of the first table > > lua_setglobal(lua_state, lua_table_name); > > > This code looks fine to me. You must be doing something else wrong? > > -- > -Patrick Donnelly > > "Let all men know thee, but no man know thee thoroughly: Men freely > ford that see the shallows." > > - Benjamin Franklin > -- God$ g++ -o earth earth.cpp -O3 -lanimals -lplants -lvirus http://fog.neopages.org/ --001636988b67c8204004783402fc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks a lot!

2009/11/12 Patrick Donnell= y <batrick@bat= bytes.com>
On Thu, Nov 12, 2009 at 5:00 PM, zweifel = <zweifel@gmail.com> wrote: > Why cant I pass a table inside a table with the following code:
>
> =A0=A0=A0=A0=A0=A0 //first table
> =A0 =A0 =A0 =A0 lua_newtable(lua_state);
>
> =A0=A0=A0=A0=A0=A0 //second table inside the first table
> =A0 =A0 =A0=A0 lua_newtable(lua_state);
>
> =A0=A0=A0=A0=A0=A0=A0 lua_pushstring(lua_state, "x");=A0=A0= =A0=A0=A0=A0=A0=A0 //key
> =A0=A0=A0=A0=A0=A0=A0 lua_pushnumber(lua_state, (double)array[0]);=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //value
> =A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_state, -3);
>
> =A0=A0=A0=A0=A0=A0=A0 lua_pushstring(lua_state, "y");=A0=A0= =A0=A0=A0=A0=A0=A0 //key
> =A0=A0=A0=A0=A0=A0=A0 lua_pushnumber(lua_state, (double)array[1]);=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //value
> =A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_state, -3);
>
> =A0=A0=A0=A0=A0=A0=A0 lua_pushstring(lua_state, "z");=A0=A0= =A0=A0=A0=A0=A0=A0 //key
> =A0=A0=A0=A0=A0=A0=A0 lua_pushnumber(lua_state, (double)array[2]);=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 //value
> =A0=A0=A0=A0=A0=A0=A0 lua_settable(lua_state, -3);
>
> =A0=A0=A0=A0=A0=A0=A0 //finish the second table and set it as index to= the first table
> =A0=A0=A0=A0=A0=A0=A0 lua_rawseti(lua_state, -2, index);
>
> =A0=A0=A0=A0=A0=A0=A0 //set name of the first table
> =A0 =A0 =A0 =A0 lua_setglobal(lua_state, lua_table_name);


This code looks fine to me. You must be doing something else wr= ong?

--
-Patrick Donnelly

"Let all men know thee, but no man know thee thoroughly: Men freely ford that see the shallows."

- Benjamin Franklin



--
God$ g++ -o eart= h earth.cpp -O3 -lanimals -lplants -lvirus

http://fog.neopages.org/
--001636988b67c8204004783402fc-- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 20:51:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACMpIqa011729; Thu, 12 Nov 2009 20:51:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C94819444; Thu, 12 Nov 2009 20:50:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FA6819323 for ; Thu, 12 Nov 2009 20:50:47 -0200 (BRST) Received: by yxe17 with SMTP id 17so2427798yxe.33 for ; Thu, 12 Nov 2009 14:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=j9P4bp3C/6NDEl51D+HZXojmBaRhn0Ng8NLe67lTszM=; b=SFnc2peFD9nCZBMihQCqW7gDzi+DNp5qoRc9vQwtQ1QcWVoIttlu2HDEERAbubHnGm VjWyAC/qDUFKwNbt796728yiGVFWB6gOPNfpzRz1e7F5VET+RiwSsCAVEagF/qKGum9U VTmcsjn1oE6reMUB53xGs4VNHD9kBGcspIkB0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=kGmDHoadlH78wRMTEfZnaYB/jhqbcDqiuvFUt77HeJPJxBU9KcEFg1Jcfq07s8ASI/ Enrc6nmxKNWUxMpKcPF0CSPF203KrAf2WyIcJ8+ykzTEoyEVOnn8E0ZqHem4ejcOXly+ JedkR7pB9y1aYQOL3QzLCq1m6OQoGXJk6bMyw= Received: by 10.100.81.1 with SMTP id e1mr2839723anb.73.1258066241166; Thu, 12 Nov 2009 14:50:41 -0800 (PST) Received: from ?128.130.5.100? (WPIS-64-140-206-242.worldpath.net [64.140.206.242]) by mx.google.com with ESMTPS id 9sm1498127yxf.23.2009.11.12.14.50.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 12 Nov 2009 14:50:39 -0800 (PST) Content-Type: text/plain; charset=us-ascii; format=flowed Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: Coroutines and Go From: Doug Currie In-Reply-To: <87k4xvlfke.fsf@lola.goethe.zz> Date: Thu, 12 Nov 2009 17:50:36 -0500 Content-Transfer-Encoding: 7bit Message-Id: <6B04BB96-1D54-49BC-8018-7FB8604B860B@gmail.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <9a0c00530911121036meb43fdi313d0d591df1148c@mail.gmail.com> <87k4xvlfke.fsf@lola.goethe.zz> To: Lua list X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 12, 2009, at 2:16 PM, David Kastrup wrote: > Old architectures not even had a return stack. http://en.wikipedia.org/wiki/Burroughs_large_systems e From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 21:47:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACNlrcn019481; Thu, 12 Nov 2009 21:47:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 583C219482; Thu, 12 Nov 2009 21:47:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from b.painless.aaisp.net.uk (b.painless.aaisp.net.uk [81.187.30.52]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0348119472 for ; Thu, 12 Nov 2009 21:47:17 -0200 (BRST) Received: from [81.187.191.218] (helo=gate.cowlark.com) by b.painless.aaisp.net.uk with esmtp (Exim 4.69) (envelope-from ) id 1N8jNT-00071U-Sw for lua@bazar2.conectiva.com.br; Thu, 12 Nov 2009 23:47:00 +0000 Received: from [10.0.0.2] (chur.local [10.0.0.1]) by gate.cowlark.com (Postfix) with ESMTP id CB5404A5C4 for ; Thu, 12 Nov 2009 23:46:56 +0000 (GMT) Received: from hilfy.local and verified by Spey connected from hilfy.local:39359 with envelope Message-ID: <4AFC9E6E.2010306@cowlark.com> Date: Thu, 12 Nov 2009 23:46:54 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> In-Reply-To: <4AFC4ED2.4040503@erix.it> X-Enigmail-Version: 0.96.0 OpenPGP: id=816F9738 Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nACNlrcn019481 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Enrico Colombini wrote: [...] > It depends on your definition of "newcomers" :-) > They were definitely not new in 1979 (Motorola's 6809 supported them) > but keeping stuff in the stack was not uncommon even with the 6502, even > without direct hardware support. I've tried making C compilers work on the 6502 and Z80; while they do have stacks, they only really like doing pushes and pops and are egregiously unoptimised for stack frame random access. Trying to do Algol-like languages is essentially an exercise in frustration. OTOH they do languages like Forth really well. One day I must hunt down a non-stack-frame block-oriented language that's suitable for this class of processor. There's also a class of languages that is stack frame oriented but which doesn't use stacks. Each function call essentially allocates a new frame on the heap. This makes coroutine creation essentially no more expensive than a normal function call, and also allows some really freaky stuff like continuations --- calling a function which records its current stack frame before returning, then jumping back to that stack frame later, causing the function to return again! I know Lisp has these, but my Lisp-fu is very weak. I don't know of any other languages (Smalltalk has sanitised continuations in that you can return from a method from a block defined inside that method, but only while the method is actually active, IIRC). I do know that you need really high-tech garbage collectors to make them at all efficient (which of course Lisp did). - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFK/J5uf9E0noFvlzgRAgcuAJ4pUjktM0KoMMJCdzlnvXvyMLSomACeNAP8 zwCjor+OuUEeBmM4S3WBcBU= =4krS -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 21:57:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nACNvJWK020455; Thu, 12 Nov 2009 21:57:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 538AC1948A; Thu, 12 Nov 2009 21:56:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB10B19472 for ; Thu, 12 Nov 2009 21:56:52 -0200 (BRST) Received: from [192.168.254.14] (os-dsl-0574.bmts.com [216.183.154.63]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id nACNueuV013601 for ; Thu, 12 Nov 2009 18:56:47 -0500 Message-ID: <4AFCA0B8.5020508@hempeldesigngroup.com> Date: Thu, 12 Nov 2009 18:56:40 -0500 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: <4AFBF905.3020004@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > And personally, I think the syntax is appallingly ugly: > > func (p *ByteSlice) Write(data []byte) (n int, err os.Error) > > ...defines a method on 'pointer to ByteSlice' (you can define methods on > pretty much any type, not just objects) with self called 'p', taking an > array of bytes called 'data' as parameter, returning a tuple of int and > os.Error. I'm glad somebody else shares my esthetics :-) Ralph From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 23:01:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD11mB9027196; Thu, 12 Nov 2009 23:01:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B3E6193D9; Thu, 12 Nov 2009 23:01:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BACCD192EA for ; Thu, 12 Nov 2009 23:01:06 -0200 (BRST) Received: by fxm21 with SMTP id 21so2928968fxm.21 for ; Thu, 12 Nov 2009 17:01:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=cHxOmf3TGFeqYaJpekzyXJDU1UEZaP6JbJ3p1wWuf/g=; b=L/x31GG2tmtDysE77YvCS+lVvP5IgczIUKCC3hu3BiufX7NtdGoh3MDt/wjYLF4dJX 5J90jKBtqNqGiLso4jzgLbHXlPVLBpbItIJzZfmx8y8W5jGC51LmegJ4CLCSq/aARKzt WNkUWE2o7qabAyXt3VrqRDRRhgM4oFK1jEWu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=N7xf+P8AP0C/K89Hw57OpMB5T2x/Pa7lEGErNExzYkrYmXg9IKbJ/DqoOpum9kZbEG ozzyM9j5RSbvAM8tVh5M2bBMcbyqY88+Kf7ZXJI1fV0t3SZU9AAiWpKGrHXc6VU1Ps4g qSrvPLmmshVelGg2tbEXKNacw0knNqDanxt0o= MIME-Version: 1.0 Received: by 10.216.88.136 with SMTP id a8mr1094285wef.77.1258074064264; Thu, 12 Nov 2009 17:01:04 -0800 (PST) In-Reply-To: <4AFC7B73.9060708@elbitsystems-us.com> References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> Date: Thu, 12 Nov 2009 17:01:04 -0800 Message-ID: <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> Subject: Re: UDP Broadcast From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, Nov 12, 2009 at 1:17 PM, Doug Rogers wrote: > Clark Snowdall wrote: > Also, for me udp:setpeername() fails under Linux when I use 'localhost' > in setsockname(). I have to set the host variable to be the local IP > address on the Ethernet interface (to which I want to send). I'm not > sure why this is so - perhaps use INADDR_ANY rather than 'localhost'? localhost isn't mapped to 127.0.0.1 automatically, it happens because localhost is in /etc/hosts: % grep localhost /etc/hosts 127.0.0.1 localhost ::1 ip6-localhost ip6-loopback Also, some DNS server setups map it that way. > If these are not your problems, then I'm at a loss. I was able to > capture the subnet broadcast packet using Wireshark; it's Ethernet > address was broadcast. I set the filter to 'udp port 47808' and made the > mods mentioned above. Clark, is it possible the subnet mask is not 255.255.255.0, as your bcast address assumes? ifconfig will tell you the bcast address, mine says this: eth0 Link encap:Ethernet HWaddr 00:16:17:75:D4:DA inet addr:192.168.41.177 Bcast:192.168.41.255 Mask:255.255.255.0 By default, the netmask for the 10.* IP addresses is 8, so your bcast addr would be 10.255.255.255, but its probably set to something else. http://en.wikipedia.org/wiki/IPv4#Private_networks Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 23:03:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD13WJS027370; Thu, 12 Nov 2009 23:03:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6F90C194A2; Thu, 12 Nov 2009 23:03:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C30219475 for ; Thu, 12 Nov 2009 23:03:06 -0200 (BRST) Received: by fxm21 with SMTP id 21so2930355fxm.21 for ; Thu, 12 Nov 2009 17:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DAD8XChI61MRDOsSFxhHieYmTx2Lj7xc1lxwWrBX6+g=; b=DHDf4EJMPrcbLgvhv/PNdPYvL6Nfb2K348UR4rv4cIArJJs6c+czdLi7N59PXx1obO iTLLsKQJZpXELCugTTak0VtQ//nfHeSeNiXFkAv3LDv53euyo3ca3MfDUMhqFiqP5Dnv sgcjFhqzSbwrCyE4sujjR35K7IJHl36PMvdMU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xg1nvMUVeP3SYKHsnwJkqEuHViMDMdjBXu9XqRWKqBUaVcia70n/Py2NtzTtHkWBY1 HCR1EMoS57ypzACWaB9OW2P56izj1A48Bwz07rfY2sV3UfkRCw6HadAQ/7jA0K1j0Gqp YBjP7k6krz5xTGuervR+XBLgnmUrhobu8e5C4= MIME-Version: 1.0 Received: by 10.216.86.206 with SMTP id w56mr1168295wee.1.1258074184139; Thu, 12 Nov 2009 17:03:04 -0800 (PST) In-Reply-To: <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> Date: Thu, 12 Nov 2009 17:03:04 -0800 Message-ID: <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> Subject: Re: UDP Broadcast From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Apologies, I typoed: On Thu, Nov 12, 2009 at 5:01 PM, Sam Roberts wrote: [snip] > By default, the netmask for the 10.* IP addresses is 8, so your bcast > addr would be 10.255.255.255, but its probably set to something else. That should be "255.0.0.0" > http://en.wikipedia.org/wiki/IPv4#Private_networks From lua-bounces@bazar2.conectiva.com.br Thu Nov 12 23:33:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD1Ww0I030831; Thu, 12 Nov 2009 23:32:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D79DE1951F; Thu, 12 Nov 2009 23:32:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C0A419448 for ; Thu, 12 Nov 2009 23:32:23 -0200 (BRST) Received: by bwz27 with SMTP id 27so2931503bwz.21 for ; Thu, 12 Nov 2009 17:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=r3rRIbmSHMSxEHYJvC340+F9Jh8za6TQ9X6IKkEtbjY=; b=L/78El9hfxM/PyCk5GkiTBZD8ZfW0IS3FnqK1m8Lcu8Jjpau+DGE12DBgDer3Bbh66 aXMnCcUbjdgYDBnpAlp7i/ufbD+H6gD1A6HSsLQCdaGyY1jz6mzMNL4Qi3AFpHn3Cgr8 yFqQNnbZmgU8ngzSeT8NWxIigRSvXZCE3K84A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=fzKzRWidoNLzkOXAiSarCy1SIdE1binSnNuPF1HpmQQpFDKlBZamxQuzSgh4IC96ic jpcIoYPCbY6bDgw3zSHDg7WAJLR8h01k9J55phe6pSiX9s5fDm+yELrUau9TBGC5tyc2 HToPis5XVRwhCtjSVwV/c0buyTjz08urWMp4k= MIME-Version: 1.0 Received: by 10.204.29.22 with SMTP id o22mr4215038bkc.78.1258075940964; Thu, 12 Nov 2009 17:32:20 -0800 (PST) In-Reply-To: <4db9cacb0905290329x8a98202ma2aa9fe76c589289@mail.gmail.com> References: <4db9cacb0905290329x8a98202ma2aa9fe76c589289@mail.gmail.com> From: Matthew Wild Date: Fri, 13 Nov 2009 01:31:59 +0000 Message-ID: <4db9cacb0911121731v469aa90am25eec995fdefe0dd@mail.gmail.com> Subject: Re: Lua at FOSDEM 2010 [was: Lua Workshop 2009] To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/5/29 Matthew Wild : > On Fri, May 29, 2009 at 9:57 AM, Rob Kendrick wrote: >> On Thu, 28 May 2009 22:45:17 -0300 > >> Are people on this side of the Atlantic who can't make it to >> Brazil interested perhaps in a mini-Workshop at FOSDEM in Feburary? >> > > Count me in, as I said in IRC I'm happy to help however I can also. > We have just under 2 weeks to apply for a devroom if we want one: http://fosdem.org/2010/call-developer-rooms Now the question is, do we? :) Are enough Lua folk planning to go to FOSDEM so as to make it worth it? See also http://fosdem.org/2010/call_for_stands and http://fosdem.org/2010/call_for_lightningtalks Matthew From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 00:41:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD2fhC8005686; Fri, 13 Nov 2009 00:41:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9011C19378; Fri, 13 Nov 2009 00:41:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2e.orange.fr (smtp2e.orange.fr [80.12.242.112]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 036FE193F4 for ; Fri, 13 Nov 2009 00:41:11 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e07.orange.fr (SMTP Server) with ESMTP id 09BAE80000A1 for ; Fri, 13 Nov 2009 03:41:07 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e07.orange.fr (SMTP Server) with ESMTP id F247980000A0 for ; Fri, 13 Nov 2009 03:41:06 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf2e07.orange.fr (SMTP Server) with ESMTP id B8CBC80000A1 for ; Fri, 13 Nov 2009 03:41:06 +0100 (CET) X-ME-UUID: 20091113024106757.B8CBC80000A1@mwinf2e07.orange.fr Date: Thu, 12 Nov 2009 16:52:08 +0100 From: spir To: *lua Subject: little questions Message-ID: <20091112165208.09957055@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Is there a standard way to iterate _only_ on keys / values of a table; or items of table used as a plain array? (have written iterators for that, but would prefere to use std way) * Is there a standard way to test for membership (in keys, values, items)? (I use the iterators above, but ditto) * Stdlib operations on strings and files can be written obj:op(). But this does not seem to work for tables. Am I right? Is there a reason for this? Is it possible to make the syntax uniform by assigning stdlib funcs defined on "table" to the type "table"? * Is there a way to make lua _implicitely_ use a "method" for print-ing? (thought __tostring was for this, but I can't make it work) * Is there a standard way to copy (clone) lua objects --especially tables? Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 00:57:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD2vVem006993; Fri, 13 Nov 2009 00:57:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 52C281953C; Fri, 13 Nov 2009 00:57:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2a.orange.fr (smtp2a.orange.fr [80.12.242.139]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E442F19533 for ; Fri, 13 Nov 2009 00:57:07 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a11.orange.fr (SMTP Server) with ESMTP id DCA1D7000336 for ; Fri, 13 Nov 2009 03:57:03 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a11.orange.fr (SMTP Server) with ESMTP id D089C700034E for ; Fri, 13 Nov 2009 03:57:03 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf2a11.orange.fr (SMTP Server) with ESMTP id 99F847000336 for ; Fri, 13 Nov 2009 03:57:03 +0100 (CET) X-ME-UUID: 20091113025703630.99F847000336@mwinf2a11.orange.fr Date: Fri, 13 Nov 2009 03:57:03 +0100 From: spir To: *lua Subject: proto-lua Message-ID: <20091113035703.18032dfe@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, Is there a prototype-base OO framework in/for lua (found only class-based ones)? Denis ------ la vita e estrany From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 02:13:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD4DpBr013690; Fri, 13 Nov 2009 02:13:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 054A219544; Fri, 13 Nov 2009 02:13:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD7A519520 for ; Fri, 13 Nov 2009 02:13:14 -0200 (BRST) Received: by fxm21 with SMTP id 21so51235fxm.21 for ; Thu, 12 Nov 2009 20:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=uXpcSUsW2fOPMqo3Cl01LANVnpJHiDr6J/khUR8jRGk=; b=rlzzMtPbm4o8gvj7p5yi/TireuV6U2siG/Cr4hi5GaKups62IyMH6L7w3lxbUTCFFG 2RO0+huQXGJmX9IzMJ7xPb9vJM+qa93wUv0CFMpH5FQIgGCamYiEUc9rLeymVo1PxOky ndRYA7/ToXfZQ96QBvJSW//ujIwmoRb5cnpWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=UVYYls+HjjbPRGXMfTQQgnCFLto9XABmqkcbNJwnI5/CNmBtdYCSL8bg3TiB+EB3k3 cj67mKbM8ryffSEJG3bf9KwDfrnybm8/j16hpNOrix1/hIJ8PLdanyh1xPm0GDqvza/D dX+Y38wOYzIGhs59Hd8zTJew1d88TpOd1T4qo= MIME-Version: 1.0 Received: by 10.204.32.16 with SMTP id a16mr2771930bkd.190.1258085592004; Thu, 12 Nov 2009 20:13:12 -0800 (PST) In-Reply-To: <4db9cacb0911120828w1c00b636t517d6768b0325b89@mail.gmail.com> References: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> <20091112161304.GA2515@mike.de> <4db9cacb0911120828w1c00b636t517d6768b0325b89@mail.gmail.com> From: Matthew Wild Date: Fri, 13 Nov 2009 04:12:50 +0000 Message-ID: <4db9cacb0911122012v7f2ddd39qd339793358a3f5cc@mail.gmail.com> Subject: Re: Tables vs closures for representing objects (and JITability) To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Matthew Wild : > 2009/11/12 Mike Pall : >> Matthew Wild wrote: >>> I've come into a little debate recently. We're working on an API, >>> which will be used to create *lots* of small objects. Performance is >>> critical above everything else (don't shout at me for this :) ). >> >> Measure first, then optimize. >> Someone pointed me to this page on the wiki, which is interesting: http://lua-users.org/wiki/ObjectBenchmarkTests I added the following code: ---------------- do local data = 0; addbenchmark("Closure object (best case)", "ob('test')", function (method) if method == "test" then data = data + 1; end end); end do local data = 0; addbenchmark("Closure object (worst case)", "ob('test')", function (method) if method == "test9" then elseif method == "test8" then elseif method == "test7" then elseif method == "test6" then elseif method == "test5" then elseif method == "test4" then elseif method == "test3" then elseif method == "test2" then elseif method == "test" then data = data + 1; end end); end ------------------------- And since no thread here would be complete without benchmarks, here's what I get (lower is better): Plain Lua: $ lua objtest.lua 26.34 Standard (solid) 29.2 Standard (metatable) 28.11 Object using closures (PiL 16.4) 16.51 Object using closures (noself) 12.29 Direct Access 2.45 Local Variable 16.09 Closure object (best case) 40.23 Closure object (worst case) LuaJIT 1.x: $ luajit -O3 objtest.lua 3.97 Standard (solid) 8.18 Standard (metatable) 4.86 Object using closures (PiL 16.4) 3.01 Object using closures (noself) 2.08 Direct Access 0.62 Local Variable 3.12 Closure object (best case) 4.28 Closure object (worst case) LuaJIT 2.x *without* JIT: $ luajit-2.0.0-beta1 -joff objtest.lua 6.55 Standard (solid) 12.64 Standard (metatable) 6.89 Object using closures (PiL 16.4) 5.87 Object using closures (noself) 3.16 Direct Access 0.91 Local Variable 4.35 Closure object (best case) 7.96 Closure object (worst case) LuaJIT 2.x *with* JIT: $ luajit-2.0.0-beta1 objtest.lua 0.19 Standard (solid) 0.19 Standard (metatable) 0.18 Object using closures (PiL 16.4) 0.19 Object using closures (noself) 0.19 Direct Access 0.19 Local Variable 0.18 Closure object (best case) 0.19 Closure object (worst case) ... which gives quite an interesting insight. And indeed, can't beat Lua's hash lookups. Much :) Matthew From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 02:31:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD4VVQq015211; Fri, 13 Nov 2009 02:31:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EE0041942A; Fri, 13 Nov 2009 02:31:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth05.prod.mesa1.secureserver.net (smtpauth05.prod.mesa1.secureserver.net [64.202.165.99]) by bazar2.conectiva.com.br (Postfix) with SMTP id 20EA919407 for ; Fri, 13 Nov 2009 02:31:06 -0200 (BRST) Received: (qmail 25048 invoked from network); 13 Nov 2009 04:31:02 -0000 Received: from unknown (98.117.140.83) by smtpauth05.prod.mesa1.secureserver.net (64.202.165.99) with ESMTP; 13 Nov 2009 04:31:02 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Tables vs closures for representing objects (and JITability) From: Mark Hamburg In-Reply-To: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> Date: Thu, 12 Nov 2009 20:31:04 -0800 Message-Id: <5C01B29A-569B-4592-96FF-2B0363AEBD38@grubmah.com> References: <4db9cacb0911120736r380ac4a1m9c099f947eea54a5@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAD4VVQq015211 You also need to figure out (e.g., through testing though sometimes reasoning will give you a decent answer) what actually matters for performance. For example, you are going with closures to avoid self.* lookups but that's a lot of memory allocations per object which will impact object creation (and collection) time, impact memory locality for object data, and impact overall memory footprint. There can be big differences in performance based on which cache you manage to fit in. Mark From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 02:50:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD4omBS016599; Fri, 13 Nov 2009 02:50:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E95A1952B; Fri, 13 Nov 2009 02:50:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from homiemail-a15.g.dreamhost.com (caiajhbdcaid.dreamhost.com [208.97.132.83]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 15901194B4 for ; Fri, 13 Nov 2009 02:50:19 -0200 (BRST) Received: from [10.1.1.2] (124-169-206-98.dyn.iinet.net.au [124.169.206.98]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 09C7476C065 for ; Thu, 12 Nov 2009 20:50:14 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Coroutines and Go From: Jacques Chester In-Reply-To: <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> Date: Fri, 13 Nov 2009 12:50:11 +0800 Content-Transfer-Encoding: 7bit Message-Id: <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 12/11/2009, at 8:15 PM, steve donovan wrote: > In short, there are so many PLs that they're starting to > stand on each others' feet. I read a few years back that the number of artificial languages has already surpassed the number of natural languages. Assuming that language names are evenly distributed amongst dictionary words, and further assuming that an average native language speaker has a day-to-day vocabulary of 5,000 words, we can surmise that every single-word name for a language has been taken by this stage. And if not yet, then soon! Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 03:00:32 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD50TkD017323; Fri, 13 Nov 2009 03:00:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8B81194A2; Fri, 13 Nov 2009 03:00:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp20.orange.fr (smtp20.orange.fr [80.12.242.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9434519417 for ; Fri, 13 Nov 2009 03:00:02 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2012.orange.fr (SMTP Server) with ESMTP id 8C1A820003F2 for ; Fri, 13 Nov 2009 05:59:58 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2012.orange.fr (SMTP Server) with ESMTP id 7E75C20003F7 for ; Fri, 13 Nov 2009 05:59:58 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf2012.orange.fr (SMTP Server) with ESMTP id 192CC20003F2 for ; Fri, 13 Nov 2009 05:59:58 +0100 (CET) X-ME-UUID: 20091113045958103.192CC20003F2@mwinf2012.orange.fr Date: Fri, 13 Nov 2009 05:59:57 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: Coroutines and Go Message-ID: <20091113055957.0f71a1f9@o> In-Reply-To: <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Fri, 13 Nov 2009 12:50:11 +0800, Jacques Chester thought: > > On 12/11/2009, at 8:15 PM, steve donovan wrote: > > > In short, there are so many PLs that they're starting to > > stand on each others' feet. > > I read a few years back that the number of artificial languages > has already surpassed the number of natural languages. Assuming > that language names are evenly distributed amongst dictionary > words, and further assuming that an average native language > speaker has a day-to-day vocabulary of 5,000 words, we can surmise > that every single-word name for a language has been taken by > this stage. > > And if not yet, then soon! Surely no: 'C' is no (english) word, 'php' neither, and I don't even dare to mention 'javascript'. What about 'lua'? Was not an english word, now may be in specialised dictionaries --as a proper noun. Most non-famous languages, not mainly intended for production, have names meaningful for their others, thus often non-english. (my own project's "codename" is 'claro') Denis -------------------------------- * la vita e estrany * site: http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 03:02:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD52Q1a017564; Fri, 13 Nov 2009 03:02:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4B1B81954D; Fri, 13 Nov 2009 03:02:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from homiemail-a23.g.dreamhost.com (caiajhbdccah.dreamhost.com [208.97.132.207]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 83BE219533 for ; Fri, 13 Nov 2009 03:02:06 -0200 (BRST) Received: from [10.1.1.2] (124-169-206-98.dyn.iinet.net.au [124.169.206.98]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPSA id B80DE4B0060 for ; Thu, 12 Nov 2009 21:02:04 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Coroutines and Go From: Jacques Chester In-Reply-To: <20091113055957.0f71a1f9@o> Date: Fri, 13 Nov 2009 13:02:00 +0800 Message-Id: <2331EA72-130C-4572-BF2A-01F1772FC170@chester.id.au> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> <20091113055957.0f71a1f9@o> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAD52Q1a017564 On 13/11/2009, at 12:59 PM, spir wrote: > Surely no: 'C' is no (english) word, 'php' neither, and I don't even dare to mention 'javascript'. Behold the most powerful phrase in academic English: "Assuming that ..." :D Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 04:47:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD6kwwY026126; Fri, 13 Nov 2009 04:46:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8809119419; Fri, 13 Nov 2009 04:46:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5633E19406 for ; Fri, 13 Nov 2009 04:46:19 -0200 (BRST) Received: by bwz27 with SMTP id 27so3078261bwz.21 for ; Thu, 12 Nov 2009 22:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=yfl5hdzuOju/NA01xaUdlJJIBFZ55bEmlrIM7ppLR7M=; b=ClLxf/GHnp3KXV8f7soAMjSb/OSa7xXc84Up9fjGWXUAiH0RQL55/kLNhkEM3HIBKW drfqaw0O/LQhjPAwwqx8X/06r4+HvlhUNfLpK1oGkfPD67Pi6GQVSwAMPA9UqKgFP3P2 KIZVabRhCa3B/FDVlmjntRFgqrtsUTO3whAfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PZvbQmQf4mRjBroJK7pROLZB29RdEHTncfMwQqTmnGeb5p/ASMf1DZ7DSNGBolb14x RtKEutNYLeCbmQ2rkmBf5XrUWgcZZrM/oEufhd1GqfJLxc9VNomCvaI8BWBNG4MSl681 1z72/l9QnLEydlWGD8lxghO20v3QpBCotn700= MIME-Version: 1.0 Received: by 10.239.130.35 with SMTP id 35mr402657hbh.31.1258094774784; Thu, 12 Nov 2009 22:46:14 -0800 (PST) In-Reply-To: <20091112165208.09957055@o> References: <20091112165208.09957055@o> Date: Fri, 13 Nov 2009 08:46:14 +0200 Message-ID: <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> Subject: Re: little questions From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAD6kwwY026126 On Thu, Nov 12, 2009 at 5:52 PM, spir wrote: > * Is there a standard way to iterate _only_ on keys / values of a table; or items of table used as a plain array? (have written iterators for that, but would prefere to use std way) None; you have done what any Lua programmer would do in this case! > * Stdlib operations on strings and files can be written obj:op(). But this does not seem to work for tables. Am I right? Is there a reason for this? Is it possible to make the syntax uniform by assigning stdlib funcs defined on "table" to the type "table"? It's possible that every new table gets a metatable pointing to 'table', so list:concat() etc. The Lua fork Idle does this. But (as has been pointed out before) it leads to confusion, because very often we define our own metatables. One idea is to define T() so that T{10,20,30} gives a table with the table functions as methods; this is at least explicit. > * Is there a way to make lua _implicitely_ use a "method" for print-ing? (thought __tostring was for this, but I can't make it work) If the table (or metadata) has a metatable which contains __tostring, then that does the trick, since print() uses tostring() which will use the metamethod __tostring. > * Is there a standard way to copy (clone) lua objects --especially tables? Again, no. Naturally, there have been attempts to provide libraries of these things, for instance: http://penlight.luaforge.net/ (Disclaimer: I did it) (There is also stdlib, although IHMO it seems a bit disorganized) steve d. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 06:15:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD8Fblk032274; Fri, 13 Nov 2009 06:15:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4CFB11940A; Fri, 13 Nov 2009 06:14:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4FE6719287 for ; Fri, 13 Nov 2009 06:14:48 -0200 (BRST) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091113081435.VIWH27507.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Fri, 13 Nov 2009 08:14:35 +0000 Received: from [192.168.1.2] (really [81.106.154.20]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20091113081434.FZOG2093.aamtaout03-winn.ispmail.ntl.com@[192.168.1.2]> for ; Fri, 13 Nov 2009 08:14:34 +0000 From: Peter Hickman Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/alternative; boundary=Apple-Mail-1-619998294 Subject: Re: proto-lua Date: Fri, 13 Nov 2009 08:14:32 +0000 In-Reply-To: <20091113035703.18032dfe@o> To: Lua list References: <20091113035703.18032dfe@o> Message-Id: X-Mailer: Apple Mail (2.1077) X-Cloudmark-Analysis: v=1.0 c=1 a=93Ubh6UdAAAA:8 a=wzJeFtTLqBOEuJUb6tAA:9 a=UQGvpMoMMj7KMjrzCscA:7 a=7jeT8IOSpm-vkngoAg0tn-hnis0A:4 a=ojJMr-TVm74A:10 a=7xnb-bOXsPAs0IymETEA:9 a=6LVoRjGykPu8OFXqIEkA:7 a=ngYrQVEIlGmogxQ_UB6HjsXABIkA:4 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1-619998294 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Well in the book Lua Gems (well worth a read) is the following code. At = least I think thats where I found this: = --------------------------------------------------------------------------= ---- -- Title: clone.lua -- Description: Prototype based object system -- Author: Kevin Baca -- Legal: Under the terms of the MIT License -- = http://www.opensource.org/licenses/mit-license.html -- -- Prototype-based programming is a style of object-oriented programming = in which=20 -- classes are not present, and behavior reuse (known as inheritance in = class-based -- languages) is performed via a process of cloning existing objects = that serve as=20 -- prototypes. This model can also be known as class-less, = prototype-oriented or=20 -- instance-based programming. --=20 -- Most of the code is basically the same as inherit.lua, but reduced to = only=20 -- the essentials needed to make "Prototype based programming" work. = More exactly=20 -- it allows prototype programming using cloning and prototype = delegation. Access=20 -- to a property not set in an object is delegated to it's prototype. = This code=20 -- uses the table table as the very basic prototype, and object as a = specialization=20 -- of table. The function object.isa is not strictly needed for the = prototype=20 -- paradigm, but more of a convenience. = --------------------------------------------------------------------------= ------ function clone( base_object, clone_object ) if type( base_object ) ~=3D "table" then return clone_object or base_object=20 end clone_object =3D clone_object or {} clone_object.__index =3D base_object return setmetatable(clone_object, clone_object) end function isa( clone_object, base_object ) local clone_object_type =3D type(clone_object) local base_object_type =3D type(base_object) if clone_object_type ~=3D "table" and base_object_type ~=3D = "table" then return clone_object_type =3D=3D base_object_type end local index =3D clone_object.__index local _isa =3D index =3D=3D base_object while not _isa and index ~=3D nil do index =3D index.__index _isa =3D index =3D=3D base_object end return _isa end object =3D clone( table, { clone =3D clone, isa =3D isa } ) --[[ Example usage -- testing "isa" foo =3D object:clone() bar =3D object:clone() baz =3D foo:clone() foo:isa(object) -- true bar:isa(foo) -- false baz:isa(foo) -- true --testing prototype delegation foo =3D object:clone() bar =3D foo:clone() function foo:speak() print(self.thoughts or "foo has no thoughts") end bar:speak() -- foo has no thoughts bar.thoughts =3D "I may be a clone, but I'm an individual!" bar:speak() --I may be a clone, but I'm an individual! --]] On 13 Nov 2009, at 02:57, spir wrote: > Hello, >=20 > Is there a prototype-base OO framework in/for lua (found only = class-based ones)? >=20 > Denis > ------ > la vita e estrany >=20 >=20 -- "Always code as if the guy who ends up maintaining your code will be a = violent psychopath who knows where you live." (Martin Golding) --Apple-Mail-1-619998294 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Well = in the book Lua Gems (well worth a read) is the following code. At least = I think thats where I found = this:


-----------------------------= -------------------------------------------------
-- Title: =               clone.lua
-- = Description:         Prototype based object = system
-- Author:             =  Kevin Baca
-- Legal:           =     Under the terms of the MIT License
--   =                    http://www.op= ensource.org/licenses/mit-license.html
--
-- = Prototype-based programming is a style of object-oriented programming in = which 
-- classes are not present, and behavior reuse = (known as inheritance in class-based
-- languages) is = performed via a process of cloning existing objects that serve = as 
-- prototypes. This model can also be known as = class-less, prototype-oriented or 
-- instance-based = programming.
-- 
-- Most of the code is = basically the same as inherit.lua, but reduced to = only 
-- the essentials needed to make "Prototype based = programming" work. More exactly 
-- it allows prototype = programming using cloning and prototype delegation. = Access 
-- to a property not set in an object is = delegated to it's prototype. This code 
-- uses the table = table as the very basic prototype, and object as a = specialization 
-- of table. The function object.isa is = not strictly needed for the prototype 
-- paradigm, but = more of a = convenience.
---------------------------------------------------= -----------------------------

function clone( = base_object, clone_object )
if type( base_object ) ~=3D = "table" then
return clone_object or = base_object 
end
= clone_object =3D clone_object or {}
= clone_object.__index =3D base_object
return = setmetatable(clone_object, = clone_object)
end

function isa( = clone_object, base_object )
local clone_object_type =3D = type(clone_object)
local base_object_type =3D = type(base_object)
if clone_object_type ~=3D "table" = and base_object_type ~=3D "table" then
= return clone_object_type =3D=3D base_object_type
= end
local index =3D = clone_object.__index
local _isa =3D index =3D=3D = base_object
while not _isa and index ~=3D nil = do
= index =3D index.__index
_isa =3D index =3D=3D = base_object
end
return = _isa
end

object =3D clone( table, { = clone =3D clone, isa =3D isa } = )

--[[
Example = usage

-- testing "isa"
foo =3D = object:clone()
bar =3D = object:clone()
baz =3D = foo:clone()

foo:isa(object) -- = true
= bar:isa(foo)    -- false
= baz:isa(foo)    -- true

--testing = prototype delegation

foo =3D = object:clone()
bar =3D = foo:clone()

function = foo:speak()
   print(self.thoughts or = "foo has no thoughts")
= end

bar:speak() -- foo has no = thoughts

bar.thoughts =3D "I may be a = clone, but I'm an individual!"
bar:speak() --I may be a clone, = but I'm an = individual!
--]]


On= 13 Nov 2009, at 02:57, spir wrote:

Hello,

Is there a prototype-base OO framework = in/for lua (found only class-based ones)?

Denis
------
la = vita e estrany



--

"Always code as if the guy = who ends up maintaining your code will be a violent psychopath who knows = where you live." (Martin Golding)


= --Apple-Mail-1-619998294-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 06:48:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD8mrQ1002651; Fri, 13 Nov 2009 06:48:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B61E41941A; Fri, 13 Nov 2009 06:48:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18E1C19426 for ; Fri, 13 Nov 2009 06:48:23 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nAD8mLXI029318 for ; Fri, 13 Nov 2009 09:48:21 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEANOr/ErDbohb/2dsb2JhbACEcr8dkRmBMII4VAQ Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 13 Nov 2009 09:48:21 +0100 Received: from [192.168.127.128] (host108-102-dynamic.50-79-r.retail.telecomitalia.it [79.50.102.108]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nAD8mKFc028315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 09:48:21 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFD1D51.4060503@erix.it> Date: Fri, 13 Nov 2009 09:48:17 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <4AFC9E6E.2010306@cowlark.com> In-Reply-To: <4AFC9E6E.2010306@cowlark.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean David Given wrote: > I've tried making C compilers work on the 6502 and Z80; while they do > have stacks, they only really like doing pushes and pops and are > egregiously unoptimised for stack frame random access. I don't remember if I ever looked into the produced code, but The Manx C compiler I used on the Apple II seemed to work fine. I don't think I measured its efficiency, though, because I used it mainly for high-level code. It would be interesting to dig it up and see what tricks it used. Anyway, that's why I mentioned the 6809: as far as I know, it was the first 8-bit CPU specifically designed to make stack frames easy to use (e.g. it had frame pointer-relative instructions). It turned out to be actually slower than the 6502 in my applications, but that's another matter :-) Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 07:44:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD9i9VW007273; Fri, 13 Nov 2009 07:44:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0E0CE19424; Fri, 13 Nov 2009 07:43:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from jtresaa1.miniserver.com (jtresaa1.miniserver.com [78.31.106.67]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 593D5193D9 for ; Fri, 13 Nov 2009 07:43:37 -0200 (BRST) Received: from [83.104.134.62] (objmedia.demon.co.uk [83.104.134.62]) by jtresaa1.miniserver.com (Postfix) with ESMTP id 3F16A18717 for ; Fri, 13 Nov 2009 09:43:31 +0000 (GMT) Message-ID: <4AFD2A44.1060503@objmedia.demon.co.uk> Date: Fri, 13 Nov 2009 09:43:32 +0000 From: Stephen Kellett Organization: Object Media Limited User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> In-Reply-To: <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Jacques Chester wrote: > I read a few years back that the number of artificial languages > has already surpassed the number of natural languages. Assuming > But shouldn't you really be counting the number of artificial languages that are in common use? Because that is what you are comparing with for natural languages. For example Cornish is a dead language and doesn't count towards the total of natural languages. No one knows how to speak it any more. I read somewhere that the people that study languages regard a language as effectively dead if the population speaking that language drops below a few thousand (I think it was 10,000) people. I guess they must make exceptions for these rain forest tribes that have small populations but a distinct language of their own. Stephen From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 07:47:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAD9lXxA007585; Fri, 13 Nov 2009 07:47:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AD86A1945A; Fri, 13 Nov 2009 07:47:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from dottedmag.net (burger.dottedmag.net [212.75.37.82]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4218A193D5 for ; Fri, 13 Nov 2009 07:47:09 -0200 (BRST) Received: from vertex (unknown [91.197.127.125]) by dottedmag.net (Postfix) with ESMTPSA id 14AAF8C03E for ; Fri, 13 Nov 2009 10:47:06 +0100 (CET) Received: from dottedmag by vertex with local (Exim 4.69) (envelope-from ) id 1N8skA-0005Cy-GY for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 15:47:02 +0600 From: Mikhail Gusarov To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <560972290911120415i6010a6aak9369f97c966c512d@mail.gmail.com> <92442E77-722C-4722-A463-61DA4AE35E56@chester.id.au> <4AFD2A44.1060503@objmedia.demon.co.uk> Date: Fri, 13 Nov 2009 15:46:58 +0600 In-Reply-To: <4AFD2A44.1060503@objmedia.demon.co.uk> (Stephen Kellett's message of "Fri, 13 Nov 2009 09:43:32 +0000") Message-ID: <87ljiaycx9.fsf@vertex.dottedmag.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --=-=-= Content-Transfer-Encoding: quoted-printable Twas brillig at 09:43:32 13.11.2009 UTC+00 when lua@objmedia.demon.co.uk di= d gyre and gimble: SK> I guess they must make exceptions for these rain forest tribes that SK> have small populations but a distinct language of their own. Soon they will need to make a exception for a these Google office tribes that have small population but a distinct Go language of their own :) =2D-=20 http://fossarchy.blogspot.com/ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJK/SsSAAoJEJ0g9lA+M4iIb5wP/1s/mc8rS7UTh0wFP91OWAF2 gBmcsdljyX6pff5rpTmCp1jVSAy3ILVK48VTNydavB/0RuIJbW6d01cTfNqnWhZr EVylQ7D/PQS0swm7C678M4p9tn+O8qG8XfqDF0xRMeu+0kaPfaLkrzR0Ml/k9wO8 3CkWM5MrRnL8XaRxOmg332ksjKK+0i8A4GWNBuwiUVmV8Fz2z2BP9XhiwwfJW+Un QqLJj/7CM0Kuz45Jp+o3vFqQ3tuf5Y8cOcCa9DdZUU/7soTD8goClc1zqZGEVLSq 2kYV/cVVjCGUmEhtAAKhZowxxXXnG9+2nihYu01BZfSKr+KexZfRr+1gBRtxnpuc paZ06MoF8LX5hqP+oJSu1Coltv62EURh1cBv7O/2CZLEkxmrQz8ifkk5PLBP5DR3 jI3XF6eJPOhSPnZ4BwSdfxCdFZmxlW6Unb8Kg1maGewL0iMSqudJ57Xo6ZauaiH+ MZGgbL4ihwEvly89Kv6jRaHJXU7tYN8+uf2HxCEQ1svgU+nFKN9+A5FJnM/+FyW4 qkeepko0SenelSBInobVxzqHndVamxvwP12MbUpgYD2vqKNwvAESgzi7LVKJV+m3 3ctnzcmqE4RQSBsE21Xzraawl1IBYDd3m2JBpsuC9Wtnsj5SomSmvRWqX2wcLt1m sB/k6QqhwOx6+YyHei50 =MxIv -----END PGP SIGNATURE----- --=-=-=-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:00:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADA0lUP008750; Fri, 13 Nov 2009 08:00:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6E2991934F; Fri, 13 Nov 2009 08:00:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fettunta.fettunta.org (fettunta.fettunta.org [67.207.129.222]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A6CB7192C3 for ; Fri, 13 Nov 2009 08:00:19 -0200 (BRST) Received: from localhost.localdomain (unknown [10.17.0.6]) by fettunta.fettunta.org (Postfix) with ESMTPS id 03D661848C for ; Fri, 13 Nov 2009 10:00:16 +0000 (UTC) Received: from tassi by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1N8swl-0001RN-IK for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 11:00:03 +0100 Date: Fri, 13 Nov 2009 11:00:03 +0100 From: Enrico Tassi To: lua@bazar2.conectiva.com.br Subject: Re: Lua at FOSDEM 2010 [was: Lua Workshop 2009] Message-ID: <20091113100003.GA4249@birba> Mail-Followup-To: lua@bazar2.conectiva.com.br References: <4db9cacb0905290329x8a98202ma2aa9fe76c589289@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4db9cacb0905290329x8a98202ma2aa9fe76c589289@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, May 29, 2009 at 11:29:15AM +0100, Matthew Wild wrote: > On Fri, May 29, 2009 at 9:57 AM, Rob Kendrick wrote: > > On Thu, 28 May 2009 22:45:17 -0300 > > > Are people on this side of the Atlantic who can't make it to > > Brazil interested perhaps in a mini-Workshop at FOSDEM in Feburary? > > > > Count me in, as I said in IRC I'm happy to help however I can also. I'd attend for sure +1 Cheers -- Enrico Tassi From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:01:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADA1ILd008847; Fri, 13 Nov 2009 08:01:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 57B9719443; Fri, 13 Nov 2009 08:00:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp27.orange.fr (smtp27.orange.fr [80.12.242.94]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A91A19372 for ; Fri, 13 Nov 2009 08:00:37 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2701.orange.fr (SMTP Server) with ESMTP id 2A18C1C00095 for ; Fri, 13 Nov 2009 11:00:32 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2701.orange.fr (SMTP Server) with ESMTP id 1D32F1C000A0 for ; Fri, 13 Nov 2009 11:00:32 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf2701.orange.fr (SMTP Server) with ESMTP id 4989D1C00095 for ; Fri, 13 Nov 2009 11:00:29 +0100 (CET) X-ME-UUID: 20091113100029301.4989D1C00095@mwinf2701.orange.fr Date: Fri, 13 Nov 2009 11:00:17 +0100 From: spir To: *lua Subject: iterators Message-ID: <20091113110017.04b259a5@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello, I find great that lua introduced proper iterators, including generators, without addition of any new language feature such as continuations and magic "yield" statements. Actually, the magic is rather done by lua under the hood but does not directly affect the user --if I understand correctly. Still, after a first lucky trial, I had rather hard and long time guessing how to properly interpret the syntax (esp the "invisible" variables) and consequentely how to implement iterators for various uses -- esp. the highly different cases of collection and generator iterators, respectively. I was surprised to endly discover that defining the iterator func (the actual data yielding one) inside the iterator allows getting rid of the said invisible vars alltogether. I may be wrong, sure, maybe in some cases they are needed, still maybe we could simplify the syntax in a way that would let using this great feature much more easily. I wrote a doc about this, but put it on the wiki for it's rather long: http://lua-users.org/wiki/SimplerForIterator (Took a risk if I'm totally wrong ;-) & hope it's not full of stupidity, because there it will remain -- but anyway a wiki is intended to be corrected.) Denis -------------------------------- * la vita e estrany * site: http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:09:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADA9nlx009644; Fri, 13 Nov 2009 08:09:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78AAA19477; Fri, 13 Nov 2009 08:09:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8460919372 for ; Fri, 13 Nov 2009 08:09:19 -0200 (BRST) Received: by bwz27 with SMTP id 27so3219385bwz.21 for ; Fri, 13 Nov 2009 02:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=9+G9gD8CiH+UW3qAhlcY8CQQeNgVWNyPz2FWUgGE0js=; b=RhCSovyA0ukpEiQ5l9XoqK2WoiP0e0Ix7fDw33+hcviNYzzJEF7ECeUXEKSzaHSK0F VIOavmj5fa9mRqbNqg/LG8aPqmnbbt+sHjYhMcNr2hBSCLyVgSJnTBdk8Zkz1el2kcU4 x9fM1fqdJ/qxt3tPg0Nct01YFRryhpuMFklsw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=cbbVvNvvmf7SwWceqmGuNrckUZ1iMTnKfA9guBWArfUmwTs9gHdhqe6RcXgsZfgspS 9mTBqjr1nfTFAeTzakgj6e605zq6ZRJGROK9pmRDMD5MF8lx6DEqcSxuUw6oKprCGb+r zljqesuT/oU0r6qvsiiX7TjuvmoE95fjZjtPI= MIME-Version: 1.0 Received: by 10.216.89.138 with SMTP id c10mr1349665wef.47.1258106955086; Fri, 13 Nov 2009 02:09:15 -0800 (PST) In-Reply-To: <20091112165208.09957055@o> References: <20091112165208.09957055@o> From: Jerome Vuarand Date: Fri, 13 Nov 2009 11:08:55 +0100 Message-ID: <89d273ba0911130208i1151cf35y50d52a8148ac7efb@mail.gmail.com> Subject: Re: little questions To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 spir : > * Is there a standard way to iterate _only_ on keys / values of a table; or items of table used as a plain array? (have written iterators for that, but would prefere to use std way) You can iterate on keys using the pairs iterator: local keys = pairs for k in keys(t) do print(key, t[k]) end To iterate over values, you would have to hide some iteration information in the closure returned by the iterator, which would then be unique to an iteration. This is a level of complexity above what pairs is doing (but it's still reasonnably doable). What is usually done is to skip the first iterator variable by naming it _ : for _,v in pairs(t) do print("value:", v) end > * Is there a standard way to test for membership (in keys, values, items)? (I use the iterators above, but ditto) You can test t[k]~=nil to check that a non-nil value is associated to key k in table t. To check for values you need to iterate over the table (and you may get several keys associated to a given value). > * Is there a standard way to copy (clone) lua objects --especially tables? There is no single way to do that. What about subtables ? Should they be referenced by the new table, or cloned too ? What about recursive references (t={}, t.itself = t) ? What about non-clonable members (full userdata) ? You need to answer all these questions before writing a table dump function, and my answers are probably not the same as yours. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:18:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAIIqt011157; Fri, 13 Nov 2009 08:18:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 860D919489; Fri, 13 Nov 2009 08:17:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AC21B19448 for ; Fri, 13 Nov 2009 08:17:45 -0200 (BRST) Received: by bwz27 with SMTP id 27so3227071bwz.21 for ; Fri, 13 Nov 2009 02:17:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=ES4izd5pPW2puaotZWjkZMtixVqAN0KJlnzg9/yL4GA=; b=AENge2TaLudCRlR8bX52UXTyNLY5YpoOeteM+KPKGhE2jSMLz2rsNg6/e9OeBTZPP2 mnf4JmEV598x+jkJC20ultR1flOGdMSOu14yBXI96RulVPhpr6oUETjhIDYX769/zaHI zXPaey2gHE5UFcrLwcU81wHQ2jPXdKaLke4uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=n8sDXHEPr4CQcWDnu1DXTByPeLp4EAasu0WkBcr3EvWyqLXHiPKkwyQW22c4bS2QWV 4FbzptSmPqFsltmUUYOHyEQUueV6jcNdBpn/tcSSQsv+mAxEX58CtSMb6Nl9oSorHvBZ 9iV8sUuv8tkZWIdL/URfr1ScKThd4on/7V7Ek= MIME-Version: 1.0 Received: by 10.216.93.17 with SMTP id k17mr617806wef.31.1258107463112; Fri, 13 Nov 2009 02:17:43 -0800 (PST) In-Reply-To: <20091113110017.04b259a5@o> References: <20091113110017.04b259a5@o> From: Jerome Vuarand Date: Fri, 13 Nov 2009 11:17:22 +0100 Message-ID: <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> Subject: Re: iterators To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADAIIqt011157 2009/11/13 spir : > I find great that lua introduced proper iterators, including generators, without addition of any new language feature such as continuations and magic "yield" statements. Actually, the magic is rather done by lua under the hood but does not directly affect the user --if I understand correctly. > Still, after a first lucky trial, I had rather hard and long time guessing how to properly interpret the syntax (esp the "invisible" variables) and consequentely how to implement iterators for various uses -- esp. the highly different cases of collection and generator iterators, respectively. I was surprised to endly discover that defining the iterator func (the actual data yielding one) inside the iterator allows getting rid of the said invisible vars alltogether. > I may be wrong, sure, maybe in some cases they are needed, still maybe we could simplify the syntax in a way that would let using this great feature much more easily. I wrote a doc about this, but put it on the wiki for it's rather long: > http://lua-users.org/wiki/SimplerForIterator > > (Took a risk if I'm totally wrong ;-) & hope it's not full of stupidity, because there it will remain -- but anyway a wiki is intended to be corrected.) Removing these "invisible" variables would force all iterator functions to be specially instanciated closures with upvalues. This is a performance hit. The following wouldn't be possible any longer : for k,v in next,t,nil do print(k, v) end On the other hand the current syntax doesn't force you to use these hidden variables. Just ignore them. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:26:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAQggQ012084; Fri, 13 Nov 2009 08:26:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DBB4419522; Fri, 13 Nov 2009 08:26:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2a.orange.fr (smtp2a.orange.fr [80.12.242.139]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F86019493 for ; Fri, 13 Nov 2009 08:26:08 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a12.orange.fr (SMTP Server) with ESMTP id E140C7000451 for ; Fri, 13 Nov 2009 11:26:01 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a12.orange.fr (SMTP Server) with ESMTP id D2C8B70005B2 for ; Fri, 13 Nov 2009 11:26:01 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf2a12.orange.fr (SMTP Server) with ESMTP id 9097F70005A7 for ; Fri, 13 Nov 2009 11:25:59 +0100 (CET) X-ME-UUID: 20091113102559592.9097F70005A7@mwinf2a12.orange.fr Date: Fri, 13 Nov 2009 11:25:59 +0100 From: spir To: *lua Subject: Re: little questions -- and lua toolkit Message-ID: <20091113112559.785574eb@o> In-Reply-To: <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> References: <20091112165208.09957055@o> <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Fri, 13 Nov 2009 08:46:14 +0200, steve donovan s'exprima ainsi: > On Thu, Nov 12, 2009 at 5:52 PM, spir wrote: > > * Is there a standard way to iterate _only_ on keys / values of a table; > > or items of table used as a plain array? (have written iterators for > > that, but would prefere to use std way) > > None; you have done what any Lua programmer would do in this case! ;-) I'm sure mine are clearer but less efficient than yours! > > * Stdlib operations on strings and files can be written obj:op(). But > > this does not seem to work for tables. Am I right? Is there a reason for > > this? Is it possible to make the syntax uniform by assigning stdlib funcs > > defined on "table" to the type "table"? > > It's possible that every new table gets a metatable pointing to > 'table', so list:concat() etc. The Lua fork Idle does this. But (as > has been pointed out before) it leads to confusion, because very often > we define our own metatables. One idea is to define T() so that > T{10,20,30} gives a table with the table functions as methods; this is > at least explicit. Ok, I will experiment with this. Do you mean name clashes; or maybe the lua equivalent of method lookup complications? Probably would opt for the explicit way... until I have an OO framework to make things clear. > > * Is there a way to make lua _implicitely_ use a "method" for print-ing? > > (thought __tostring was for this, but I can't make it work) > > If the table (or metadata) has a metatable which contains __tostring, > then that does the trick, since print() uses tostring() which will use > the metamethod __tostring. This is the point I don't get about metatables. How comes that lua does not "see" a method I _explicitely_ put on an object? It works when using obj.__tostring(obj) or obj:__tostring(); but when using print() or tostring() lua does not use __tostring. If you have some minutes free, would someone explain in a few words how the metamethod magic works under the hood, so why __tostring does not get called without abracadabra? > > * Is there a standard way to copy (clone) lua objects --especially tables? > > Again, no. > > Naturally, there have been attempts to provide libraries of these > things, for instance: > > http://penlight.luaforge.net/ > > (Disclaimer: I did it) > > (There is also stdlib, although IHMO it seems a bit disorganized) > > steve d. > Thank you Steve for your clear answers. And I'll have a look at your toolkit. By the way, as questions about everyday tools seem to launch numerous answers, I thought at starting a "LuaToolkit" wiki page (or rather directory page) on the topic. The "portal" could point to specific pages dedicated to table output (human), table serialization, table content (iteration, membership...), and so on. There, we could expose and comment various code snippets, evaluate them according to different criteria such as clarity, performance, etc. The main point beeing not to reinvent the wheel *worse*. What do you think? (There are numerous such pages and portalson the wiki, but rather about higher level and/or specific topics. This one would rather be for completing the everyday tools provided by the stdlib.) Denis -------------------------------- * la vita e estrany * site: http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:34:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAYSAu013153; Fri, 13 Nov 2009 08:34:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 96B5A1953B; Fri, 13 Nov 2009 08:34:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBD0C1935E for ; Fri, 13 Nov 2009 08:33:59 -0200 (BRST) Received: from know-smtpout-1.server.virginmedia.net ([62.254.123.1]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091113103347.IFNO17029.mtaout01-winn.ispmail.ntl.com@know-smtpout-1.server.virginmedia.net> for ; Fri, 13 Nov 2009 10:33:47 +0000 Received: from [78.147.255.225] (helo=taboche) by know-smtpout-1.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1N8tTP-0001xi-KO for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 10:33:47 +0000 From: Thomas Lauer To: Lua list Subject: Re: little questions Date: Fri, 13 Nov 2009 10:33:47 +0000 Organization: TL Message-ID: References: <20091112165208.09957055@o> <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> In-Reply-To: <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=SFBYNVl0AAAA:8 a=N49cKib8hv3HscajUdEA:9 a=NJkBCup8Z9goFWcA_xoA:7 a=HKjdlYsmmzk5lk87ZBuDuOYQoD0A:4 a=MSl-tDqOz04A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADAYSAu013153 steve donovan wrote: > On Thu, Nov 12, 2009 at 5:52 PM, spir wrote: > > * Stdlib operations on strings and files can be written obj:op(). > > But this does not seem to work for tables. Am I right? Is there > > a reason for this? Is it possible to make the syntax uniform by > > assigning stdlib funcs defined on "table" to the type "table"? > > It's possible that every new table gets a metatable pointing to > 'table', so list:concat() etc. The Lua fork Idle does this. But (as > has been pointed out before) it leads to confusion, because very often > we define our own metatables. It's not that easy. First, Idle only ever creates a metatable and initialises __index for tables created via an explicit call to table.new(). Tables created via t={} are plain tables w/o a metatable. So there's a choice to start with. Second, the idea that doing this leads per se to confusion is IMHO debatable. It all boils down to a design question: a majority, perhaps 75%, of the tables I use in my programs are "normal" tables (and I suspect for most Idle users this percentage is even higher). Having these tables behave out-of-the-box as spir described is clearly an advantage if most user-created tables don't need their own metatable mechanisms. Summary: someone who creates table t via t=table.new() and not via t={} *and* then wants to do some metatable magic with t is supposed to know what he or she is doing. I fail to see why this would lead to confusion: you can't have your cake and eat it. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:37:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAbZmr013575; Fri, 13 Nov 2009 08:37:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C5B521954C; Fri, 13 Nov 2009 08:37:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B70E119531 for ; Fri, 13 Nov 2009 08:37:07 -0200 (BRST) Received: by fxm21 with SMTP id 21so280122fxm.21 for ; Fri, 13 Nov 2009 02:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=XWt9JIrz0cJTcIjjFE0Qh9Kox9B1Y5XLoAwCRCG6Jjw=; b=hUnAhF3TspwlsFXrkYtAGglSj5ZxGXOmL1qiqmteMLkOF62XesCYUXbCcnz1gR5Gid OkxxdFq0xByjKMXBtLj4v3/phZ/q/Ghq4UiihNO9f3NiCAxMRV8pEr2OD11tFaq+zku6 2yA9BF3XIapBPKS1n+LY97T93SSJPTUbJq5eM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=naVYX8LLPkWeTZS0J9hGaPWzztnvtkQl2WbZSHaBHIfuVyIZvYe6Oul5m4nknKRLkt /10Ap4uFfHAUHp+4JWDlkPawmW/KbhCjMSGrLpPG3bAqPUSQ0i7X/Xp8eRIhBFDNNhRd eJCC8fRxo8VmYGhloqafJ3QVNYL16EyzZm7sw= MIME-Version: 1.0 Received: by 10.239.183.37 with SMTP id s37mr426689hbg.90.1258108624557; Fri, 13 Nov 2009 02:37:04 -0800 (PST) In-Reply-To: <20091113112559.785574eb@o> References: <20091112165208.09957055@o> <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> <20091113112559.785574eb@o> Date: Fri, 13 Nov 2009 12:37:04 +0200 Message-ID: <560972290911130237o462db534m6d363879e2bb6ed5@mail.gmail.com> Subject: Re: little questions -- and lua toolkit From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 12:25 PM, spir wrote: > Ok, I will experiment with this. Do you mean name clashes; or maybe the lua equivalent of method lookup complications? >Probably would opt for the explicit way... until I have an OO framework to make things clear. People would get used to saying list:concat() for any table, and then be disappointed when a object doesn't understand concat()! > This is the point I don't get about metatables. How comes that lua does not "see" a method I _explicitely_ put on an object? Ah, because it is _not_ an ordinary method! Lua does not ask 'does this object have a __tostring() method?', it asks 'does this object have a metatable with a __tostring() function?' But the confusion is easy to make. First, in most OOP languages you override the toString(),tostring(), whatever method. Second, in Lua we also use metatables for storing methods. > There, we could expose and comment various code snippets, evaluate them according to different criteria such as clarity, performance, etc. The main point beeing not to reinvent the wheel *worse*. > What do you think? Well, I agree! In fact a lot of people agree: http://lua-users.org/lists/lua-l/2009-09/msg00466.html The LuaSnippets project is coming on, but under the overall banner of a LuaForge replacement project. We are waiting for Andre to come back from holiday ;) steve d. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:38:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAcMlx013727; Fri, 13 Nov 2009 08:38:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 249BF19555; Fri, 13 Nov 2009 08:38:06 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.17]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8AB319550 for ; Fri, 13 Nov 2009 08:38:01 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id EA9BF20004DB for ; Fri, 13 Nov 2009 11:37:51 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id D719220004CF for ; Fri, 13 Nov 2009 11:37:51 +0100 (CET) Received: from o (AToulouse-553-1-205-44.w90-45.abo.wanadoo.fr [90.45.149.44]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id 5F3FE200018E for ; Fri, 13 Nov 2009 11:32:28 +0100 (CET) X-ME-UUID: 20091113103228390.5F3FE200018E@mwinf1906.orange.fr Date: Fri, 13 Nov 2009 11:32:27 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: little questions Message-ID: <20091113113227.1a40b284@o> In-Reply-To: <89d273ba0911130208i1151cf35y50d52a8148ac7efb@mail.gmail.com> References: <20091112165208.09957055@o> <89d273ba0911130208i1151cf35y50d52a8148ac7efb@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Fri, 13 Nov 2009 11:08:55 +0100, Jerome Vuarand s'exprima ainsi: [snip] Thanks for you hints, Jerome. > > * Is there a standard way to copy (clone) lua objects --especially tables? > > There is no single way to do that. What about subtables ? Should they > be referenced by the new table, or cloned too ? What about recursive > references (t={}, t.itself = t) ? What about non-clonable members > (full userdata) ? You need to answer all these questions before > writing a table dump function, and my answers are probably not the > same as yours. > You're right, for sure. Thought at upper level copy, so non-atomic items remain shared references. I have a clone() that just iterates at top-level. Denis -------------------------------- * la vita e estrany * site: http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 08:39:01 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADAcwT2013848; Fri, 13 Nov 2009 08:38:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B52941955C; Fri, 13 Nov 2009 08:38:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95E8719550 for ; Fri, 13 Nov 2009 08:38:32 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so1246969fgb.17 for ; Fri, 13 Nov 2009 02:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IQ6ypF/dfxs1HLMeCYyscnYTdCh22YkVKm8yXMGMiVk=; b=RvX4x4DAdwybvAX/Dv3cxYwvRYcTc2sV/4wbUSgaJI59d+vZjnJH2Y7kMFxl9Gme+2 EMtaZWWzH59KUXs7c6UeagnLFyhCfzTZEQYmcvugdnIF27nFYdIBRcWLx8D0t9acemuR ZBcc5ZthDYaCzD2vqH9T3SoOqMHInlclDlK3A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jhtXawHRuxNj0X6mDUBSkMi7dZ2o+rDJ9HOxApgYpGbyTTIBDPY4Cs9eXZRmxVmmOQ 6lTUM/Y69804PnK2Gb62KWVFH+RCR8X8deM5VimPra8l/XpJGuysq+Nxfsc5IDZQz7M4 hFq/pugubV2MLJ0QMEPRViM5hyEiMgAsv/BlA= MIME-Version: 1.0 Received: by 10.239.181.136 with SMTP id m8mr417266hbg.131.1258108711279; Fri, 13 Nov 2009 02:38:31 -0800 (PST) In-Reply-To: References: <20091112165208.09957055@o> <560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> Date: Fri, 13 Nov 2009 12:38:31 +0200 Message-ID: <560972290911130238g5900a460h4af6992d9de5b7c2@mail.gmail.com> Subject: Re: little questions From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 12:33 PM, Thomas Lauer wrote: > It's not that easy. First, Idle only ever creates a metatable and > initialises __index for tables created via an explicit call to > table.new(). Tables created via t={} are plain tables w/o a metatable. > So there's a choice to start with. Sorry, Thomas, then I misunderstood. Having it explicit removes all objections. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 09:19:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADBJDUM018812; Fri, 13 Nov 2009 09:19:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 63147192EF; Fri, 13 Nov 2009 09:18:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mx6.academ.org (mx3.academ.org [85.118.224.220]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AE44C1929E for ; Fri, 13 Nov 2009 09:18:39 -0200 (BRST) Received: from sat3 (host-10-204-42-23.academ.local [10.204.42.23]) (Authenticated sender: roj@academ.org) by mx6.academ.org (Postfix) with ESMTPA id 9D97F3844D89E for ; Fri, 13 Nov 2009 17:18:37 +0600 (NOVT) Message-ID: <005801ca6453$0adbf190$6600a8c0@sat3> From: "GrayFace" To: "Lua list" References: <20091112165208.09957055@o><560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> <560972290911130238g5900a460h4af6992d9de5b7c2@mail.gmail.com> Subject: Re: little questions Date: Fri, 13 Nov 2009 17:18:32 +0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx6.academ.org [0.0.0.0]); Fri, 13 Nov 2009 17:18:37 +0600 (NOVT) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: clamav-milter 0.95.1 at mail X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br Except for one - metatable. The most 'shallow copy' way is to keep the same metatable, but it may be good to make an exception: if the original table is its own metatable, the new table should also become its own metatable. ----- Original Message ----- From: steve donovan To: Lua list Sent: Friday, November 13, 2009 4:38 PM Subject: Re: little questions On Fri, Nov 13, 2009 at 12:33 PM, Thomas Lauer wrote: > It's not that easy. First, Idle only ever creates a metatable and > initialises __index for tables created via an explicit call to > table.new(). Tables created via t={} are plain tables w/o a metatable. > So there's a choice to start with. Sorry, Thomas, then I misunderstood. Having it explicit removes all objections. steve d. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:06:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADC6dud026993; Fri, 13 Nov 2009 10:06:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D125019454; Fri, 13 Nov 2009 10:06:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3176193AD for ; Fri, 13 Nov 2009 10:06:02 -0200 (BRST) Received: by yxe17 with SMTP id 17so2825083yxe.33 for ; Fri, 13 Nov 2009 04:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vByR/HvkWEnspbVtHk8mVjiwIMru3rT+Wfkb78Odx9w=; b=oJiYY19FaOLZd/bQnsNN2JIdCNz3ykHBhl+C9tahaQ9InO8iXVlK72MLKpiRr0gYfF hENTQYo7rfB+4VFVA5xB263MxWR/p9nPDtSiJSDrT8ZaOJcEs+UK9dCDy4rtVD5axSwk uFZvX9RwJNVqCMN2PcOqmenby3wcSLvhG/324= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aqonZh7mhNAFAwCvR5jNFDQxPKILqhIBC1s5hgqGn18bF1H5hF7raRVXBHD4974efL yk23yxlPio8gQ0kVUwfrgajKWVIJhdevbUmlmdF1DjuXR5z+xJ2YmgCD+vIeL8rYdN8p GrNqgo/mp6DD4/uKpeB9zmNnO3baJT/7HNAoA= MIME-Version: 1.0 Received: by 10.91.55.28 with SMTP id h28mr6512041agk.36.1258113953307; Fri, 13 Nov 2009 04:05:53 -0800 (PST) In-Reply-To: <4AFC9E6E.2010306@cowlark.com> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <4AFC9E6E.2010306@cowlark.com> Date: Fri, 13 Nov 2009 12:05:53 +0000 Message-ID: <54e12800911130405g3389a36ao7e955a0f92068097@mail.gmail.com> Subject: Re: Coroutines and Go From: Alex Queiroz To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hallo, On 11/12/09, David Given wrote: > > I know Lisp has these, but my Lisp-fu is very weak. I don't know of any > other languages (Smalltalk has sanitised continuations in that you can > return from a method from a block defined inside that method, but only > while the method is actually active, IIRC). I do know that you need > really high-tech garbage collectors to make them at all efficient (which > of course Lisp did). > Early Scheme implementors assumed that all call frames should go to the heap to allow first-class continuations. But in the early 80's this was proven wrong and the call frames moved to a true stack. At first the stack had to be copied to the heap at each continuation capture, but since them several better algorithms were devised. My own compiler uses a full stack copy. http://www.cs.indiana.edu/~dyb/pubs/3imp.pdf http://www.cs.indiana.edu/~dyb/pubs/stack.pdf http://www.springerlink.com/content/h5808n962434j275/fulltext.pdf -- -alex @asandroq http://www.ventonegro.org/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:20:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADCK0lm029461; Fri, 13 Nov 2009 10:20:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28393194A4; Fri, 13 Nov 2009 10:19:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5EE7719484 for ; Fri, 13 Nov 2009 10:19:30 -0200 (BRST) Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.4]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091113121917.EDXX17277.mtaout03-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Fri, 13 Nov 2009 12:19:17 +0000 Received: from [78.147.255.225] (helo=taboche) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1N8v7V-00012T-Mk for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 12:19:17 +0000 From: Thomas Lauer To: Lua list Subject: Re: little questions Date: Fri, 13 Nov 2009 12:19:17 +0000 Organization: TL Message-ID: References: <20091112165208.09957055@o><560972290911122246xea8d8abs1100e8e291f3b55b@mail.gmail.com> <560972290911130238g5900a460h4af6992d9de5b7c2@mail.gmail.com> <005801ca6453$0adbf190$6600a8c0@sat3> In-Reply-To: <005801ca6453$0adbf190$6600a8c0@sat3> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=8RloEfZUAAAA:8 a=SFBYNVl0AAAA:8 a=zDcnr4iU6dFx6V3y5gUA:9 a=IoFRxhrg-FexgV3z1CcA:7 a=tzqMzkepFLpYr3wBBwt3XMpxP4AA:4 a=O58u2wXj750A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADCK0lm029461 "GrayFace" wrote: > Except for one - metatable. The most 'shallow copy' way is to keep the same > metatable, but it may be good to make an exception: if the original table is > its own metatable, the new table should also become its own metatable. Well, the point here is exactly that there is no single "best way" to do these things. What is a "most" shallow copy? Or a "slightly less" shallow one? My reasoning when I put this t:xyz(...) metatable stuff in place was (and is) that it should work *out of the box* as it does for strings and files. Any fiddling with metatables beyond that is and always will be the responsibility of the user/programmer. > > ----- Original Message ----- > From: steve donovan > To: Lua list > Sent: Friday, November 13, 2009 4:38 PM > Subject: Re: little questions > > > On Fri, Nov 13, 2009 at 12:33 PM, Thomas Lauer > wrote: > > It's not that easy. First, Idle only ever creates a metatable and > > initialises __index for tables created via an explicit call to > > table.new(). Tables created via t={} are plain tables w/o a metatable. > > So there's a choice to start with. > > Sorry, Thomas, then I misunderstood. Having it explicit removes all > objections. > > steve d. > -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:38:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADCblMh000728; Fri, 13 Nov 2009 10:38:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D75AD193D8; Fri, 13 Nov 2009 10:37:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp20.orange.fr (smtp20.orange.fr [80.12.242.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2B7951931F for ; Fri, 13 Nov 2009 10:37:15 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id 846832000391 for ; Fri, 13 Nov 2009 13:37:10 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id 6B52A2000658 for ; Fri, 13 Nov 2009 13:37:10 +0100 (CET) Received: from o (AToulouse-553-1-137-122.w92-156.abo.wanadoo.fr [92.156.93.122]) by mwinf2002.orange.fr (SMTP Server) with ESMTP id 117812000391 for ; Fri, 13 Nov 2009 13:37:10 +0100 (CET) X-ME-UUID: 20091113123710717.117812000391@mwinf2002.orange.fr Date: Fri, 13 Nov 2009 13:37:09 +0100 From: spir To: *lua Subject: get time in ms? Message-ID: <20091113133709.45382dba@o> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello again, Is there a builtin or a lib tool? If not, how do you do it? (googling brought no sensible info on the topic) Thank you, Denis -------------------------------- * la vita e estrany * site: http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:40:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADCeEGG002289; Fri, 13 Nov 2009 10:40:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 961C519491; Fri, 13 Nov 2009 10:39:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 01AA819419 for ; Fri, 13 Nov 2009 10:39:44 -0200 (BRST) Received: by bwz27 with SMTP id 27so3367475bwz.21 for ; Fri, 13 Nov 2009 04:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-mailer:reply-to :x-priority:message-id:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=kv0ddtUcu/DYg+tF17lR3Ytkx8UrjFTwn+5bOs99xjE=; b=SuWUToNPppTF6i8pMNZRca+uaHEK25UsDbmHgt27RVqWIfjkA7EIcTg906+QxdX06V cK3NOfreBjtuChwzyrbkX/3VvWt6NvKrKn+Sdzoaz41TtE0GVVvIxL6B4JXIafpVVlwA +syD9hEg6I0T68QivGH7t6/bF5Xii0N1jsqsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-mailer:reply-to:x-priority:message-id:to:cc:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; b=ZlwiQb6wh7VZnVg1uIhW6nvL9+3LD4LdMftjiuHvPHlzWitpbJ4a73WeeISoFnPt/z GXOAHPmb8s2LYsQdtDcBOIqmwdztrWf5SwkmpNhXNTwadvPOwqNXGDXO4AJ2EPKpcNcG U6zGP6Hh2+C79ztA3nZAHT+HGEOZh52VztA58= Received: by 10.204.24.83 with SMTP id u19mr1506712bkb.22.1258115981531; Fri, 13 Nov 2009 04:39:41 -0800 (PST) Received: from ?95.78.78.191? ([95.78.78.191]) by mx.google.com with ESMTPS id 15sm1252794fxm.6.2009.11.13.04.39.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Nov 2009 04:39:41 -0800 (PST) Date: Fri, 13 Nov 2009 15:30:37 +0300 From: Bulat Ziganshin X-Mailer: The Bat! (v3.85.03) Professional X-Priority: 3 (Normal) Message-ID: <10736428.20091113153037@gmail.com> To: Tony Finch Subject: Re[3]: Coroutines and Go In-Reply-To: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <1375497145.20091112220008@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Lua list X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hello Tony, Thursday, November 12, 2009, 10:54:01 PM, you wrote: >> algol-68 was too heavy for its times. now, Go is proposed as C >> successor, system-level PL, replacing assembler > Go is at a similar level to Algol 68 or CLU - compiled, garbage collected, > with rich data structures. and it means that world was changed - what was a highest-level practical language those days, now is just an asm replacement -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:41:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADCf3Xo002572; Fri, 13 Nov 2009 10:41:03 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE35C19522; Fri, 13 Nov 2009 10:40:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF67F1949E for ; Fri, 13 Nov 2009 10:40:34 -0200 (BRST) Received: by fxm21 with SMTP id 21so403953fxm.21 for ; Fri, 13 Nov 2009 04:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=vx2MvOQHzyJqiO6nc4F/Dz4t67sEMKsyRMlMeQpPub4=; b=VeRmZKYv0Fb5O64bjNON31cwrUkJXG+zj+nUry51ef7TfGhVonQebWRGkTmUfV1+Gt ++w1oVK2CF9F01kV8Gp65WwIq1Lf+cJyDu+q41L1bhL2N2ZVsjdIB4NzW6p50okLUQcu nJewEK9LRcHiQvNAdP2UvMbwglmh+oKlu48Ys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gIG9mEhHnZSTwso3xGTgQ6RArztjzmje5cyQrcNC4PsFvdbP0XcckZTEKmTTCTHcJ6 OXWuVUPyC+EhLGgjtSwm8SfwfwoQNyl0TtZhemfczW5GAmUbbv2iZnT+5D4RRh/J+dyf TIm7bDILluCWFVkurRJHNDKGhLoVpB4D5uMH8= MIME-Version: 1.0 Received: by 10.223.15.92 with SMTP id j28mr620686faa.11.1258116033135; Fri, 13 Nov 2009 04:40:33 -0800 (PST) In-Reply-To: <20091113133709.45382dba@o> References: <20091113133709.45382dba@o> From: Jim Whitehead II Date: Fri, 13 Nov 2009 12:40:13 +0000 Message-ID: <5fe281d40911130440m4933312fg5bba1ee7e1837da0@mail.gmail.com> Subject: Re: get time in ms? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 12:37 PM, spir wrote: > Hello again, > > Is there a builtin or a lib tool? If not, how do you do it? > (googling brought no sensible info on the topic) I tend to use socket.gettime() from LuaSocket to get a higher precision timing. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 10:41:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADCfiCn002778; Fri, 13 Nov 2009 10:41:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3E4F818FD6; Fri, 13 Nov 2009 10:41:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E61B183AC for ; Fri, 13 Nov 2009 10:40:58 -0200 (BRST) Received: by mail-fx0-f221.google.com with SMTP id 21so403953fxm.21 for ; Fri, 13 Nov 2009 04:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=iMDppQ21nSC9miJTEveMB00ru1uN4TXTeo2CEilsVaQ=; b=qiyi/+iCVGHe9wUNdIgSiHjLh7CF/XpJxOhHSL06+tadANzdyKTIWu3lRJZJ+Ygbe5 szqy2QIkfoXYBS5HDK2+uppfff+nD+H4fE0wh9sSg124CZRJmIURobWaxwbNmA2RE5e1 RhWHAkgq6+5YZZVUpHSvAppPfN9W/+WVlznOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=w0kGlaHMvVdXCXF48S/ezmZp7MbSNlzPGK315boeQ1tUIlK2auRPe4UFfe9y7zWpzN mrp1rYYcejOOWZbOm8XDnwXMWmH9dnI2yLfO9zQMOMFUMqI5OeAm3iSYoz1gCtL7p6li 2j764tXHD4kmqV+Yf7VVaPqsWsMa1WVy3X70s= MIME-Version: 1.0 Received: by 10.239.145.142 with SMTP id s14mr423153hba.144.1258116057916; Fri, 13 Nov 2009 04:40:57 -0800 (PST) In-Reply-To: <20091113133709.45382dba@o> References: <20091113133709.45382dba@o> Date: Fri, 13 Nov 2009 14:40:57 +0200 Message-ID: <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> Subject: Re: get time in ms? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 2:37 PM, spir wrote: > Is there a builtin or a lib tool? If not, how do you do it? > (googling brought no sensible info on the topic) os.clock() is what you need - it's seconds since Lua started as a floating-point number. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:03:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADD38od008748; Fri, 13 Nov 2009 11:03:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC32219559; Fri, 13 Nov 2009 11:02:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id 54D1F19472 for ; Fri, 13 Nov 2009 11:02:34 -0200 (BRST) Received: (qmail invoked by alias); 13 Nov 2009 13:02:31 -0000 Received: from f053081003.adsl.alicedsl.de (EHLO [192.168.1.103]) [78.53.81.3] by mail.gmx.net (mp051) with SMTP; 13 Nov 2009 14:02:31 +0100 X-Authenticated: #3468078 X-Provags-ID: V01U2FsdGVkX184uvUJMqc4oqM9V62tQUH3KRUmIRpb5pzZ6OvySA nvkaCtJpLm1/7p Message-ID: <4AFD58E6.9000608@gmx.de> Date: Fri, 13 Nov 2009 14:02:30 +0100 From: Andreas Krinke User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: get time in ms? References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> In-Reply-To: <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.82 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > os.clock() is what you need - it's seconds since Lua started as a > floating-point number. os.clock() uses clock() from time.h which returns used processor time, not time since Lua started. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:05:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADD5pn0009512; Fri, 13 Nov 2009 11:05:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 88B8E19565; Fri, 13 Nov 2009 11:05:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8D99619561 for ; Fri, 13 Nov 2009 11:05:23 -0200 (BRST) Received: by fxm21 with SMTP id 21so430551fxm.21 for ; Fri, 13 Nov 2009 05:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=T6KrSnluZ5MrdBKmjB2YuowEpm14yGiu34UtM4HS7b0=; b=BohojvQkEB3k6sojFu0jtrsinP0zjktAfTPIFpD9HbNkJtD2A7R4RGTdhMHa8kAA1b v/vw8L8y1yzG5YBgdlTVtEkTN4Nk47Nah0AlhUODMA4yuv5kfz4rRjbUvtGUZxLkbwzx QH8PoE0PFkJ/efHdC4RCojOgYEyctmZH5pPFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TXH9y0t7i02Q6v0857FY1x4kRs0lzu5jEjNKPY9U03QGEg6x4FSqJKvaNievhScfC2 awpkXoZ1KU2+gv82m0ETh5hFuC1HUi7QzFoAJ2jx6j5+zZ1XzvHr+ykFAqYMaY3oWphH OIbeshFP0RdkILOgAcPwyYCxSOWQm2N+VyBAA= MIME-Version: 1.0 Received: by 10.239.173.204 with SMTP id g12mr408595hbf.190.1258117519215; Fri, 13 Nov 2009 05:05:19 -0800 (PST) In-Reply-To: <4AFD58E6.9000608@gmx.de> References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> <4AFD58E6.9000608@gmx.de> Date: Fri, 13 Nov 2009 15:05:19 +0200 Message-ID: <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> Subject: Re: get time in ms? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 3:02 PM, Andreas Krinke wrote: > os.clock() uses clock() from time.h which returns used processor time, > not time since Lua started. D:\downloads>lua -e "print(os.clock())" 0 ? From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:12:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDC9i0011797; Fri, 13 Nov 2009 11:12:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0B151956D; Fri, 13 Nov 2009 11:11:43 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from steel.pruts.nl (mail.pruts.nl [82.94.235.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 851E31955D for ; Fri, 13 Nov 2009 11:11:38 -0200 (BRST) Received: from localhost (localhost.localdomain [127.0.0.1]) by steel.pruts.nl (Postfix) with ESMTP id 156C3E20A5 for ; Fri, 13 Nov 2009 14:11:36 +0100 (CET) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: amavisd-new at pruts.nl Received: from steel.pruts.nl ([127.0.0.1]) by localhost (steel.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yS91b4WfhhUG for ; Fri, 13 Nov 2009 14:11:33 +0100 (CET) Received: by steel.pruts.nl (Postfix, from userid 1000) id 3088AE20B6; Fri, 13 Nov 2009 14:11:33 +0100 (CET) Date: Fri, 13 Nov 2009 14:11:33 +0100 From: Ico To: Lua list Subject: Re: get time in ms? Message-ID: <20091113131133.GH3735@pruts.nl> References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> <4AFD58E6.9000608@gmx.de> <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> X-Prutser: true X-PGP-key: 4202FA2F X-PGP-KeyServer: subkeys.pgp.net X-PGP-Fingerprint: F042 F5CD B0A6 EC6A CB80 A829 CACD A4B5 4202 FA2F User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Status: Clean * On 2009-11-13 steve donovan wrote : > On Fri, Nov 13, 2009 at 3:02 PM, Andreas Krinke wrote: > > os.clock() uses clock() from time.h which returns used processor time, > > not time since Lua started. > > D:\downloads>lua -e "print(os.clock())" > 0 Your program just used 0 seconds of processor time. ico@lapdoos:~$ lua -e "a=1; for i = 1, 1000000 do a=a+1 end; print(os.clock())" 0.09 This process was using the CPU for 0.09 seconds ico@lapdoos:~$ lua -e "os.execute('sleep 1'); print(os.clock())" 0 And this one, although running for 1 second, used 0 seconds of CPU time as well. The os.execute() call blocks until the child process finishes, and blocking system calls do not use the CPU. -- :wq ^X^Cy^K^X^C^C^C^C From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:14:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDEFTQ012365; Fri, 13 Nov 2009 11:14:16 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E64D19576; Fri, 13 Nov 2009 11:13:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 313D919570 for ; Fri, 13 Nov 2009 11:13:47 -0200 (BRST) Received: by bwz27 with SMTP id 27so3402837bwz.21 for ; Fri, 13 Nov 2009 05:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=5W56bj65zgGAla90mrSCQnrdIlBiKB2NoXYCAjPK8cw=; b=aNabWRK6yxomqmwkfTTW743zXoYqoGmRobyRMo7bWUbiD+iPq3W/EZoCkoaHtP3K36 ylecQeor8+YrcgfyH4S547HAERdLGKV6NnNkVkDjsDiOhCyNTdAB7ZR0HUr3suU1CHlT 7KZYqrgrrQ6+7bAVTEoJBIlry12NUCir75yCw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=f2EysAnR+3bk9hPxQDiNlo7XI0CXVckragWTAy93iwtFCVoNBwFf9GeRXYsPrA8tPS sTxfqsQb4Y0xzQ6XWa1/Q3oarRqPS2xid8AAuUXrSWjIVAr4/5bXtnrPw4c4CdYWKyR0 gNwbJoh+DdHwN81sH1HmZqEzcdBOjleHE69jk= MIME-Version: 1.0 Received: by 10.223.132.204 with SMTP id c12mr650533fat.80.1258118026101; Fri, 13 Nov 2009 05:13:46 -0800 (PST) In-Reply-To: <20091113131133.GH3735@pruts.nl> References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> <4AFD58E6.9000608@gmx.de> <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> <20091113131133.GH3735@pruts.nl> From: Jim Whitehead II Date: Fri, 13 Nov 2009 13:13:26 +0000 Message-ID: <5fe281d40911130513g3a1f14d6ge38c2090d44e7c01@mail.gmail.com> Subject: Re: get time in ms? To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADDEFTQ012365 On Fri, Nov 13, 2009 at 1:11 PM, Ico wrote: > > > * On 2009-11-13 steve donovan wrote  : > >> On Fri, Nov 13, 2009 at 3:02 PM, Andreas Krinke wrote: >> > os.clock() uses clock() from time.h which returns used processor time, >> > not time since Lua started. >> >> D:\downloads>lua -e "print(os.clock())" >> 0 > > Your program just used 0 seconds of processor time. > >  ico@lapdoos:~$ lua -e "a=1; for i = 1, 1000000 do a=a+1 end; print(os.clock())" >  0.09 > > This process was using the CPU for 0.09 seconds > >  ico@lapdoos:~$ lua -e "os.execute('sleep 1'); print(os.clock())" >  0 > > And this one, although running for 1 second, used 0 seconds of CPU time > as well. The os.execute() call blocks until the child process finishes, > and blocking system calls do not use the CPU. This is precisely why I use socket.gettime(). It gives you a number with ms precision that you can then compare to determine how much real time has passed. - Jim From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:14:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDErR5012516; Fri, 13 Nov 2009 11:14:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 594C91957C; Fri, 13 Nov 2009 11:14:12 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id 248F819577 for ; Fri, 13 Nov 2009 11:14:06 -0200 (BRST) Received: (qmail invoked by alias); 13 Nov 2009 13:14:03 -0000 Received: from f053081003.adsl.alicedsl.de (EHLO [192.168.1.103]) [78.53.81.3] by mail.gmx.net (mp034) with SMTP; 13 Nov 2009 14:14:03 +0100 X-Authenticated: #3468078 X-Provags-ID: V01U2FsdGVkX18a3rNKdsAa9lY8KO3Lzbph7u0ozBsZi7Mr1XDwUj oI3U+8NQ40W7rc Message-ID: <4AFD5B9A.8060306@gmx.de> Date: Fri, 13 Nov 2009 14:14:02 +0100 From: Andreas Krinke User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: get time in ms? References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> <4AFD58E6.9000608@gmx.de> <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> In-Reply-To: <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.65 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > On Fri, Nov 13, 2009 at 3:02 PM, Andreas Krinke wrote: >> os.clock() uses clock() from time.h which returns used processor time, >> not time since Lua started. > > D:\downloads>lua -e "print(os.clock())" > 0 > > ? > % cat test.lua print(os.clock()) io.stdin:read() print(os.clock()) % lua test.lua 0 Take your time to type a string 0 It's just using (nearly) no processor time. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:16:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDGaRG013047; Fri, 13 Nov 2009 11:16:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1AA61953F; Fri, 13 Nov 2009 11:16:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7E810194A8 for ; Fri, 13 Nov 2009 11:16:09 -0200 (BRST) Received: by bwz27 with SMTP id 27so3405415bwz.21 for ; Fri, 13 Nov 2009 05:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=AeNfKxm17zbXJ2yq7RRACFxD0xiZtrrlGwfADS94Q+E=; b=copjrr0WoSAKMTan3wMAAqsrEOXXtByB/czkuq7/ofFHrElzvq0eCAu9xnzg+JpaGN Jzd+ha9c1PRTvnIPyxMManwiGbEUoFG/jfB5OlvquTzdNWMe6DE+mmuwqF9XiMUQOGrP um+m+3tGvkfhUJtfL+H0s8xZNijY7EdFE2VUQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=azIGSKjaZfV6r+Dxxa0jpuQLP5X0ExXASN3+osRLwAGqaECqs3WinHKWFD8ByZcdXq 1Dl3iGgS1bdouIChMuY9bGnsuaTizyTwgSbDfhHU82sBPC2d1QsJG120jNr41NMMYBHf EQLTs68aDTEPUDr2KPx1I1TfRSCdJsEuyMX68= MIME-Version: 1.0 Received: by 10.239.143.215 with SMTP id l23mr449796hba.163.1258118167405; Fri, 13 Nov 2009 05:16:07 -0800 (PST) In-Reply-To: <20091113131133.GH3735@pruts.nl> References: <20091113133709.45382dba@o> <560972290911130440r46c57e6av3be124b72d2aafbd@mail.gmail.com> <4AFD58E6.9000608@gmx.de> <560972290911130505k43e90d10od335e3f543d9fd0@mail.gmail.com> <20091113131133.GH3735@pruts.nl> Date: Fri, 13 Nov 2009 15:16:07 +0200 Message-ID: <560972290911130516i440a6f18y9665a498ff712e4e@mail.gmail.com> Subject: Re: get time in ms? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, Nov 13, 2009 at 3:11 PM, Ico wrote: > And this one, although running for 1 second, used 0 seconds of CPU time > as well. The os.execute() call blocks until the child process finishes, > and blocking system calls do not use the CPU. Man, I learn new things everyday, and still try to give advice! From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:25:06 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDP1lJ014848; Fri, 13 Nov 2009 11:25:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A08519585; Fri, 13 Nov 2009 11:24:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28F8F19580 for ; Fri, 13 Nov 2009 11:24:19 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so941864eye.39 for ; Fri, 13 Nov 2009 05:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=6WyeHNAWQrEJVYMFpm4DrOHEaTeKW3UJGqetakG51dE=; b=umTi1CuwW6Nutqs61wl0rXl5AyJpP7IZsstXuZanVgikEGldgnG0v9blBld+PQUuOB kCOeJpFRSyOyOJNyVsThToNs365rSwg9YRazm4nohXC8LVnhmfGiwRkLHIn/ui2nCU8r BfM4NtSZNLS8k6eXHduL1kjHhR4+EaMtnPapI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=plkSeRSDSwejRtDd4IN3PSAOygwbsmN795J6CPjrmUn7HovY3kd/Ucc9iQyLb00FGE jRlCdKOTIcbyrnWUUqU3AoeKhviRtFgb/7kTgfvuplSZPW+Si4V043mQGbXAuHNyn1Rz QuVJqtr+WNRNs6fMKek4SWuO3Cv+e0ZFtznrU= MIME-Version: 1.0 Received: by 10.213.57.80 with SMTP id b16mr239784ebh.36.1258118656580; Fri, 13 Nov 2009 05:24:16 -0800 (PST) Date: Fri, 13 Nov 2009 14:24:16 +0100 Message-ID: Subject: Cannot redirect stderr From: Sergio Fadda To: Lua Content-Type: multipart/alternative; boundary=00c09ffb52df9c5ca604784093c1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00c09ffb52df9c5ca604784093c1 Content-Type: text/plain; charset=ISO-8859-1 Hi. I'm writing a standalone application (Win32... windowed) which integrates the LUA interpreter; the application uses LUA to export some features and I want to show console output in a separated window. Here's, a small _sample_ program that highlights my problem: #include #include "lua.h" #include "lauxlib.h" #include "lualib.h" int main(int argc, char **argv) { FILE *out, *err; lua_State *L = lua_open(); /* Stops collector during initialization */ lua_gc(L, LUA_GCSTOP, 0); /* Initializes other modules */ luaL_openlibs(L); /* Restarts garbage collector */ lua_gc(L, LUA_GCRESTART, 0); out = freopen("out.txt", "w", stdout); err = freopen("err.txt", "w", stderr); luaL_dostring(L, "print(\"test1\")"); luaL_dostring(L, "error(\"test2\")"); fclose(out); fclose(err); return 0; } The first print("test1") is executed correctly (writes the string in file "out.txt"), but the second error("test2") didn't write anything (neither in "out.txt" nor in "err.txt"). Googling, I've found the following solution, but it doesn't work for me: FILE **pf; FILE *out = fopen("out.txt", "w"); FILE *err = fopen("err.txt", "w"); lua_getglobal(sm_luaState, "io"); lua_pushstring(sm_luaState, "open"); lua_gettable(sm_luaState, -2); lua_getfenv(sm_luaState, -1); lua_getglobal(sm_luaState, "io"); lua_pushstring(sm_luaState, "stdout"); lua_gettable(sm_luaState, -2); pf = (FILE **)lua_touserdata(sm_luaState, -1); *pf = out; lua_rawseti(sm_luaState, -3, 2); lua_pushstring(sm_luaState, "stderr"); lua_gettable(sm_luaState, -2); pf = (FILE **)lua_touserdata(sm_luaState, -1); *pf = err; lua_rawseti(sm_luaState, -3, 0); lua_pop(sm_luaState, 5); luaL_dostring(L, "print(\"test1\")"); luaL_dostring(L, "error(\"test2\")"); fclose(out); fclose(err); This solution doesn't work even the first print. Does anybody can help me? Thanks. --00c09ffb52df9c5ca604784093c1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi.
I'm writing a standalone application (Win32... windowed) which i= ntegrates the LUA interpreter; the application uses LUA to export some feat= ures and I want to show console output in a separated window.
Here's= , a small _sample_ program that highlights my problem:

#include <stdio.h>
#inclu= de "lua.h"
#include "lauxlib.h"
#include "lu= alib.h"

int main(int argc, char **argv)
{
=A0=A0 FILE *ou= t, *err;

=A0=A0 lua_State *L =3D lua_open();

=A0=A0 /* Stops collector du= ring initialization */
=A0=A0 lua_gc(L, LUA_GCSTOP, 0);

=A0=A0 /*= Initializes other modules */
=A0=A0 luaL_openlibs(L);

=A0=A0 /* = Restarts garbage collector */
=A0=A0 lua_gc(L, LUA_GCRESTART, 0);

=A0=A0 out =3D freopen("out= .txt", "w", stdout);
=A0=A0 err =3D freopen("err.txt= ", "w", stderr);

=A0=A0 luaL_dostring(L, "print(= \"test1\")");
=A0=A0 luaL_dostring(L, "error(\"test2\")");

=A0= =A0 fclose(out);
=A0=A0 fclose(err);

=A0=A0 return 0;
}
The first print("test1") is executed correctly (writes th= e string in file "out.txt"), but the second error("test2&quo= t;) didn't write anyth= ing (neither in "out.txt" nor in "err.txt").
Googling, I've found the following solution, but it doesn't work fo= r me:

FILE **pf;
FILE *out =3D fopen("out.txt", "w"= ;);
FILE *err =3D fopen("err.txt", "w"= ;);

lua_getglobal(sm_luaState, "io&q= uot;);
lua_pushstring(sm_luaSt= ate, "open");
lua_gettable(sm_lu= aState, -2);
lua_getfenv(sm_luaState= , -1);
lua_getglobal(sm_luaState, "i= o");

lua_pushstring(sm_luaState, "stdout");=
lua_gettable(sm_luaState, -2);
pf =3D (FILE **)lua_tou= serdata(sm_luaState, -1);
*pf =3D out;
lua_rawseti(sm_luaState= , -3, 2);

lua_pushstring(sm_luaState, "stderr"); lua_gettable(sm_luaStat= e, -2);
pf =3D (FILE **)lua_touserdata(sm_= luaState, -1);
*pf =3D err;
lua_rawseti(sm_luaState, -3, 0);
lua_pop(sm_luaState, 5)= ;

luaL_dostring(L,=20 "print(\"test1\")");
luaL_dostring(L, "error(\&= quot;test2\")");

fclose(out);
fclose(err);

This solution doesn't work even the first print.
Does anybody can he= lp me?
Thanks.

--00c09ffb52df9c5ca604784093c1-- From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 11:28:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADDSOvp015620; Fri, 13 Nov 2009 11:28:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 409731958F; Fri, 13 Nov 2009 11:27:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EC75D1958B for ; Fri, 13 Nov 2009 11:27:51 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so189670fga.17 for ; Fri, 13 Nov 2009 05:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=rRIIijI8Na3o7jnRnlbgAYTyCDcRF4GI5EhwCTqXQUQ=; b=vrVI8Mg8InldaQjceucNMV0XJRy6feeSILvnvgZvrdYbWI6pmEDhIspE6sPBwKTaID gzgAswXcfqBv0S1fNfB9zbrr5/qky4QXiv1hnmPYfzPCRmdo9ySQWOHujb8OwGSyr+qU 7LAxMxGI1i36Ago7zyTHQg6BORu/D4KQaBGoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=SzXLaZgRISsTFuwocAb9w9QGwPO5BNIN/bJ0yVxOxlyB7Q/KRR1W9p2Y8p0DRy6AI8 pCq6T0n6H/WmX8p1n+XmH3V7xXKox+938E2NrCpFHYGiZCqC1cwSLqTr151pVbmvtlXO TPvHE1FU91CQ/okICT+TmPwV1zCVmo29UVRek= MIME-Version: 1.0 Received: by 10.216.93.15 with SMTP id k15mr350113wef.103.1258118869104; Fri, 13 Nov 2009 05:27:49 -0800 (PST) In-Reply-To: <89d273ba0911120812n1659bc11l25289c915b80c7a0@mail.gmail.com> References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> <89d273ba0911120601u48eeb069wb098e030e1baf4ac@mail.gmail.com> <89d273ba0911120812n1659bc11l25289c915b80c7a0@mail.gmail.com> From: Jerome Vuarand Date: Fri, 13 Nov 2009 14:27:29 +0100 Message-ID: <89d273ba0911130527l7254b14fjb3da8510d43a0e36@mail.gmail.com> Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/12 Jerome Vuarand : > It seems that on Linux, the socket is signaled as writable by select > whether it is connected or connection failed. In both cases exceptfds > is returned empty. So the following script still exhibits different > behaviour on Windows and Linux : Some food for thoughts : I've been given the following links, that show that non-blocking connect result detection is not trivial. http://cr.yp.to/docs/connect.html The windows behaviour now looks much simpler. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 12:02:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADE2VjJ023064; Fri, 13 Nov 2009 12:02:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E59BF19573; Fri, 13 Nov 2009 12:02:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F058419569 for ; Fri, 13 Nov 2009 12:01:54 -0200 (BRST) Received: from know-smtpout-3.server.virginmedia.net ([62.254.123.3]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091113140142.IYDZ17277.mtaout03-winn.ispmail.ntl.com@know-smtpout-3.server.virginmedia.net> for ; Fri, 13 Nov 2009 14:01:42 +0000 Received: from [78.147.255.225] (helo=taboche) by know-smtpout-3.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1N8wic-0003cp-Al for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 14:01:42 +0000 From: Thomas Lauer To: Lua list Subject: Re: Cannot redirect stderr Date: Fri, 13 Nov 2009 14:01:42 +0000 Organization: TL Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Cloudmark-Analysis: v=1.0 c=1 a=pGLkceISAAAA:8 a=AjNtXHXTAAAA:8 a=SFBYNVl0AAAA:8 a=duO6-Z8NEq6dODCwYfcA:9 a=JO7vsJGhvCksUeFd6MwA:7 a=n74POwja3SWm9Oh4dCPI92EmlAQA:4 a=6z085EloTYkA:10 a=alGS-iH00BUA:10 a=8vMD3tJdueIA:10 a=MSl-tDqOz04A:10 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADE2VjJ023064 Sergio Fadda wrote: > Hi. > I'm writing a standalone application (Win32... windowed) which integrates > the LUA interpreter; the application uses LUA to export some features and I > want to show console output in a separated window. I once wrote a plugin for the JPSoft command processor where I ran into this problem. See the following threads: http://lua-users.org/lists/lua-l/2008-07/msg00345.html http://lua-users.org/lists/lua-l/2008-06/msg00153.html http://lua-users.org/lists/lua-l/2008-07/msg00188.html I learned that redirecting I/O in a clean and foolproof manner is non-trivial. The solution I found for the plugin seems to work but it's at best a kludge. So if you want to show output in a *real* console window only (and not redirect to a file), your best bet is probably to write a small wrapper for the Win32 console IO functions and to redirect the print/error etc functions such that they use this wrapper. -- cheers thomasl web: http://thomaslauer.com/start From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 12:06:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADE6MGB023728; Fri, 13 Nov 2009 12:06:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9F6871952C; Fri, 13 Nov 2009 12:06:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from odin.funcom.com (odin.funcom.com [195.110.28.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CD4DD19497 for ; Fri, 13 Nov 2009 12:05:55 -0200 (BRST) Received: from christ-tmp.funcom.com ([195.110.28.242] helo=[127.0.0.1]) by odin.funcom.com with esmtp (Exim 4.63) (envelope-from ) id 1N8wmf-0001f6-OI for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 15:05:53 +0100 Message-ID: <4AFD67C1.90903@funcom.com> Date: Fri, 13 Nov 2009 15:05:53 +0100 From: Christian Tellefsen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Lua editors with remote debugging support Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 091113-0, 11/13/2009), Outbound message X-Antivirus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi again, Does anyone know of a good Windows Lua editor, free or commercial, that can - Attach to a Lua runtime inside a different application, preferably over the network. - Inspect, debug and run Lua inside that application. Visual Studio integration and/or support for Linux would be a plus. Cheers, Christian Tellefsen Funcom From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 12:10:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADEASit024820; Fri, 13 Nov 2009 12:10:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDCCF1957A; Fri, 13 Nov 2009 12:10:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 072E3194A3 for ; Fri, 13 Nov 2009 12:10:02 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1N8wqM-0000VF-W7 for ; Fri, 13 Nov 2009 14:09:43 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1N8wqd-00039f-Ja for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 14:09:59 +0000 Date: Fri, 13 Nov 2009 14:09:59 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: Cannot redirect stderr Message-ID: <20091113140959.5f80e1d6@trite.i.flarn.net.i.flarn.net> In-Reply-To: References: X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 13 Nov 2009 14:24:16 +0100 Sergio Fadda wrote: > I'm writing a standalone application (Win32... windowed) which > integrates the LUA interpreter; the application uses LUA to export > some features and I want to show console output in a separated window. > Here's, a small _sample_ program that highlights my problem: Firstly, Lua is not an acronym :) Secondly, does Windows have a call similar to UNIX's dup2? This lets you duplicate a file handle to a specific one (ie, so you can easily set what handles 1, 2 and 3 (stdout, in and err) go to. B. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 12:38:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADEc9xS029941; Fri, 13 Nov 2009 12:38:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 85FE819327; Fri, 13 Nov 2009 12:37:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66BDE192CF for ; Fri, 13 Nov 2009 12:37:31 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so959261eye.39 for ; Fri, 13 Nov 2009 06:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=A7RnD34Iexq3jrjSUMApbKXdU6sOk4bfE9b9mKe6/OA=; b=CStBiezFsl2ILHNDErq3VRos8jIM4Nhhn3luSuT5FuEEA4LG8C8LyBi/y3wWW5p6Qk TIQmQwvDRZhtr5ZVnhbicflrE5VMCcP+9Vy0jRmgNDvhYbF/QYqM/3SFRfRwqIH6dkHl ZBHCK2UYP1tTiUchdFqV6AlaeqkyDOTfzmobQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=u8NAWPgAK+8EEuAyGuQawX1GeGefyOJ5w9BhjkswOvTE5BFVhobuGd7KIrDq8ETASA CtFSyLf57dObWrHzJtinESLtybs9Bour0gAlvqTETyUKTvQ+exCA/VjzxFS2EiJHiS7N b5XLPoQZLGVg3DJwp2DWVlmP4ieSEt8gyrDUA= MIME-Version: 1.0 Received: by 10.213.100.161 with SMTP id y33mr3089378ebn.2.1258123046085; Fri, 13 Nov 2009 06:37:26 -0800 (PST) In-Reply-To: <4AFD67C1.90903@funcom.com> References: <4AFD67C1.90903@funcom.com> Date: Fri, 13 Nov 2009 14:37:26 +0000 Message-ID: <281754c30911130637h55eec0b5wb0b4d721ad27c9d9@mail.gmail.com> Subject: Re: Lua editors with remote debugging support From: Lee Hickey To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/13 Christian Tellefsen : > Hi again, > > Does anyone know of a good Windows Lua editor, free or commercial, that can > - Attach to a Lua runtime inside a different application, preferably over > the network. > - Inspect, debug and run Lua inside that application. I've found Decoda (http://www.unknownworlds.com/decoda) to do the job very well. Windows only though. Regards Lee. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 13:23:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADFNrHP006510; Fri, 13 Nov 2009 13:23:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AAE1E19287; Fri, 13 Nov 2009 13:23:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth12.prod.mesa1.secureserver.net (smtpauth12.prod.mesa1.secureserver.net [64.202.165.35]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4A32718F56 for ; Fri, 13 Nov 2009 13:23:16 -0200 (BRST) Received: (qmail 15635 invoked from network); 13 Nov 2009 15:23:10 -0000 Received: from unknown (98.117.140.83) by smtpauth12.prod.mesa1.secureserver.net (64.202.165.35) with ESMTP; 13 Nov 2009 15:23:10 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Coroutines and Go From: Mark Hamburg In-Reply-To: <4AFBF905.3020004@cowlark.com> Date: Fri, 13 Nov 2009 07:23:09 -0800 Message-Id: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nADFNrHP006510 On Nov 12, 2009, at 4:01 AM, David Given wrote: > And personally, I think the syntax is appallingly ugly: > > func (p *ByteSlice) Write(data []byte) (n int, err os.Error) > > ...defines a method on 'pointer to ByteSlice' (you can define methods on > pretty much any type, not just objects) with self called 'p', taking an > array of bytes called 'data' as parameter, returning a tuple of int and > os.Error. I think I see where this is going in that it seems to adopt the C notion of making declarations look like usage, but putting the type name afterward. It seems like a mix of C and Wirthian conventions. On the other hand, it's probably better formatted as: func( p* ByteSlice ) Write( data[] byte )( n int, err os.Error ) Still that's an awful lot to get out of positional notation. Oberon-2 used the same sort of declaration for self and it didn't bother me so I think it's the result type that seems to push things too far for me. func ( p* ByteSlice ) Write( data[] byte ) : ( n int, err os.Error ) Starts to look a bit better. But the Oberon-2 version would probably be more like: FUNCTION ( p: ByteSlicePtr ) Write ( data: ByteArray ) : ( n: INTEGER; err: OS.Error ) I'm still finding Write to feel lost in that notation, however. I haven't read the Go spec yet, but when I gathered it was going for essentially low-level but safe semantics, I have to say I immediately thought about Oberon which I've always viewed as Wirth's evolution toward C. Mark From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 14:18:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADGIGpf018175; Fri, 13 Nov 2009 14:18:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 67569192DA; Fri, 13 Nov 2009 14:17:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from antixlabs.com (starling.antixlabs.com [212.36.40.146]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4621A192A9 for ; Fri, 13 Nov 2009 14:17:20 -0200 (BRST) Received: from dg-pc.antix.biz ([172.22.67.145]) by antixlabs.com with esmtp (Exim 4.69) (envelope-from ) id 1N8ypj-00036G-A7 for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 16:17:11 +0000 Message-ID: <4AFD8687.9050703@cowlark.com> Date: Fri, 13 Nov 2009 16:17:11 +0000 From: David Given User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mark Hamburg wrote: [...] > On the other hand, it's probably better formatted as: > > func( p* ByteSlice ) Write( data[] byte )( n int, err os.Error ) Go's * type modifier binds to the type, not the variable name, so: var i, j *int; ...actually defines two pointers. [...] > I'm still finding Write to feel lost in that notation, however. Algol-68 doesn't have methods or return parameters, so the above would probably have to be written using pass-by-reference paramteres as: PROC Write = (REF []BYTE p, []BYTE data, REF INT n, REF OSError err): BEGIN ~ END Putting the [] before the type looks weird to my C-trained eyes, but I quite like the way the 'Write' is brought out to be the first non-keyword on the line. I also like Algol-68's implicit slice functionality --- Go's explicit differentiation between arrays and slices seems like a big step backwards, IMO. (In fact, a more Algol-68ish way of representing the append operation would be: PROC append = (REF FLEX []BYTE buffer, []BYTE data) VOID: FOR i FROM LWB data TO UPB data DO buffer[UPB buffer + 1] := data[i] OD; FLEX arrays automatically resize themselves... and does that inside of the loop look familiar? Particularly if you realise that you can rewrite it as: buffer[⌈buffer + 1] := data[i] Lua, of course, doesn't have explicit typing, but one obvious syntax extension for types would be: function append(buffer: ByteArray, data: const ByteArray): void But that's simply because it's convenient to put an optional : after each parameter. - -- ┌─── dg@cï½ï½—lï½ï½’k.cï½ï½ ───── http://www.cowlark.com ───── │ "There is nothing in the world so dangerous --- and I mean *nothing* │ --- as a children's story that happens to be true." --- Master Li Kao, │ _The Bridge of Birds_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr9hoQACgkQf9E0noFvlzjjRwCfU3rnCzZz6SUbww/6NeRCgv+I /nMAmwU1M5DU1R0IvkOhBJGpPwWpq7l9 =c31g -----END PGP SIGNATURE----- From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 15:19:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADHJX0d031950; Fri, 13 Nov 2009 15:19:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 28A1919131; Fri, 13 Nov 2009 15:19:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0578818CF8 for ; Fri, 13 Nov 2009 15:18:55 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id AD7A51AA92EC for ; Fri, 13 Nov 2009 12:18:53 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nADHIqrb016297 for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 12:18:52 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Fri, 13 Nov 2009 12:18:52 -0500 From: Sean Conner To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113171852.GA13887@brevard.conman.org> References: <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091112085738.A5488@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Luiz Henrique de Figueiredo once stated: > > I think I can do that, but it probably won't be until Friday when I get a > > chance to randomize the data in the huge file (it's the headers of a ton of > > email since 1991). > > Changing the data will probably change the problem if it's related to hashing. Apparently, changing the data did not change the behavior problems. And this does mean I've made available the problematic scripts. If anyone wants to try their hand at debugging this, you can download the scripts (plus some output from gprof) at http://www.flummxux.org/lua-big-script.tar.gz Warning: it's a 14M download. -spc From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 15:28:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADHS6X8001799; Fri, 13 Nov 2009 15:28:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8F95E191E8; Fri, 13 Nov 2009 15:27:44 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from nicole.bmts.com (nicole.bmts.com [216.183.128.225]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8CA6C191D5 for ; Fri, 13 Nov 2009 15:27:38 -0200 (BRST) Received: from [192.168.254.14] (cheetah-tiv-ppp787.bmts.com [216.183.134.9]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id nADHROKg003825 for ; Fri, 13 Nov 2009 12:27:32 -0500 Message-ID: <4AFD96FC.2010502@hempeldesigngroup.com> Date: Fri, 13 Nov 2009 12:27:24 -0500 From: Ralph Hempel User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Lua list Subject: Re: Coroutines and Go References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <4AFC9E6E.2010306@cowlark.com> <4AFD1D51.4060503@erix.it> In-Reply-To: <4AFD1D51.4060503@erix.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-brucetelecom.com-MailScanner-Information: Please contact Bruce Telecom 519.368.2000 for more information X-brucetelecom.com-MailScanner: Found to be clean X-brucetelecom.com-MailScanner-From: rhempel@hempeldesigngroup.com X-Spam-Status: No X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Enrico Colombini wrote: > David Given wrote: >> I've tried making C compilers work on the 6502 and Z80; while they do >> have stacks, they only really like doing pushes and pops and are >> egregiously unoptimised for stack frame random access. > > I don't remember if I ever looked into the produced code, but The Manx C > compiler I used on the Apple II seemed to work fine. I don't think I > measured its efficiency, though, because I used it mainly for high-level > code. It would be interesting to dig it up and see what tricks it used. If I recall correctly, there was an indirection register, but you could only offset up to 255 bytes away from it....not that anyone would be able to make much more local stack than that anyways :-) Ralph From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:07:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADI7UmW011013; Fri, 13 Nov 2009 16:07:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 369B81914C; Fri, 13 Nov 2009 16:06:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D0E6F18D64 for ; Fri, 13 Nov 2009 16:06:54 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADI6qTj004672 for ; Fri, 13 Nov 2009 16:06:52 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id C824754C03F; Fri, 13 Nov 2009 16:06:52 -0200 (BRST) Date: Fri, 13 Nov 2009 16:06:52 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113180652.GA20853@inf.puc-rio.br> References: <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091113171852.GA13887@brevard.conman.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Apparently, changing the data did not change the behavior problems. And > this does mean I've made available the problematic scripts. If anyone wants > to try their hand at debugging this, you can download the scripts (plus some > output from gprof) at > > http://www.flummxux.org/lua-big-script.tar.gz Is this address correct? roberto@arraial:~/tmp/t3$ wget http://www.flummxux.org/lua-big-script.tar.gz --2009-11-13 16:04:34-- http://www.flummxux.org/lua-big-script.tar.gz Resolving www.flummxux.org... failed: Name or service not known. wget: unable to resolve host address `www.flummxux.org' It's not just you! http://www.flummxux.org looks down from here. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:19:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADIJrox013989; Fri, 13 Nov 2009 16:19:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BE0731926F; Fri, 13 Nov 2009 16:19:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id 39383190DD for ; Fri, 13 Nov 2009 16:19:14 -0200 (BRST) Received: (qmail invoked by alias); 13 Nov 2009 18:19:11 -0000 Received: from f053081003.adsl.alicedsl.de (EHLO [192.168.1.103]) [78.53.81.3] by mail.gmx.net (mp057) with SMTP; 13 Nov 2009 19:19:11 +0100 X-Authenticated: #3468078 X-Provags-ID: V01U2FsdGVkX19GisZqykBGFlx8NqfhQOcfnpx/H6i1NCb6Zoph3F KZjkNwf4rqa9Wy Message-ID: <4AFDA31D.1090401@gmx.de> Date: Fri, 13 Nov 2009 19:19:09 +0100 From: Andreas Krinke User-Agent: Thunderbird 2.0.0.23 (X11/20091001) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <20091113180652.GA20853@inf.puc-rio.br> In-Reply-To: <20091113180652.GA20853@inf.puc-rio.br> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.82 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: > Is this address correct? Try this: http://www.flummux.org/lua-big-script.tar.gz From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:32:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADIWlAs017214; Fri, 13 Nov 2009 16:32:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BBE111914C; Fri, 13 Nov 2009 16:32:25 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3DE7218D64 for ; Fri, 13 Nov 2009 16:32:20 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N90vw-0007I8-Qd for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 10:31:44 -0800 Subject: Re: The Lua interpreter and large scripts From: Norbert Kiesel To: Lua list In-Reply-To: <20091113171852.GA13887@brevard.conman.org> References: <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 10:32:14 -0800 Message-ID: <1258137134.25692.5.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On my system[1], I get the following: defiant:/tmp/lua-big-script% time lua -i show.lua < dofile("default.lua") > os.exit() lua -i show.lua <<< 'dofile("default.lua") os.exit()' 4.33s user 0.33s system 99% cpu 4.667 total defiant:/tmp/lua-big-script% All other variants take about the same time. [1] Linux version 2.6.31-1-amd64 (Debian 2.6.31-1), 2 x Intel(R) Xeon(R) E5310 @ 1.60GHz, 8GB memory From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:37:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADIbfJ2018301; Fri, 13 Nov 2009 16:37:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 516CA19290; Fri, 13 Nov 2009 16:37:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3CEAB19235 for ; Fri, 13 Nov 2009 16:37:04 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADIaxqM007471 for ; Fri, 13 Nov 2009 16:36:59 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 291D754C03F; Fri, 13 Nov 2009 16:37:00 -0200 (BRST) Date: Fri, 13 Nov 2009 16:37:00 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113183700.GA22912@inf.puc-rio.br> References: <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <20091113180652.GA20853@inf.puc-rio.br> <4AFDA31D.1090401@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AFDA31D.1090401@gmx.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Roberto Ierusalimschy wrote: > > Is this address correct? > > Try this: > > http://www.flummux.org/lua-big-script.tar.gz This one works. Many thanks. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:39:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADIdsK2018926; Fri, 13 Nov 2009 16:39:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D253D192A4; Fri, 13 Nov 2009 16:39:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ppsw-1.csi.cam.ac.uk (ppsw-1.csi.cam.ac.uk [131.111.8.131]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F9DD1914C for ; Fri, 13 Nov 2009 16:39:31 -0200 (BRST) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:38201) by ppsw-1.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.151]:25) with esmtpa (EXTERNAL:fanf2) id 1N913J-0007Ye-4T (Exim 4.70) for lua@bazar2.conectiva.com.br (return-path ); Fri, 13 Nov 2009 18:39:21 +0000 Received: from fanf2 (helo=localhost) by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk) with local-esmtp id 1N913J-00054c-Bt (Exim 4.67) for lua@bazar2.conectiva.com.br (return-path ); Fri, 13 Nov 2009 18:39:21 +0000 Date: Fri, 13 Nov 2009 18:39:21 +0000 From: Tony Finch X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk To: Lua list Subject: Re: Coroutines and Go In-Reply-To: <4AFC9E6E.2010306@cowlark.com> Message-ID: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> <347397800911120919n45627c5ep80f95c7239210710@mail.gmail.com> <87639fmz72.fsf@lola.goethe.zz> <4AFC4ED2.4040503@erix.it> <4AFC9E6E.2010306@cowlark.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Thu, 12 Nov 2009, David Given wrote: > > There's also a class of languages that is stack frame oriented but which > doesn't use stacks. Each function call essentially allocates a new frame > on the heap. Some ML implementations (notably SML/NJ) do this, and (like Scheme) support first-class continuation capture. Tony. -- f.anthony.n.finch http://dotat.at/ GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS. MODERATE OR GOOD. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:47:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADIlICi020440; Fri, 13 Nov 2009 16:47:18 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D232192AE; Fri, 13 Nov 2009 16:46:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8EF161914C for ; Fri, 13 Nov 2009 16:46:48 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N919x-0007JC-0R for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 10:46:13 -0800 Subject: Re: The Lua interpreter and large scripts From: Norbert Kiesel To: Lua list In-Reply-To: <1258137134.25692.5.camel@defiant.tbdnetworks.com> References: <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 10:46:46 -0800 Message-ID: <1258138006.25692.10.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean results for all variants: lua <<< 'dofile("show.lua"); dofile("default.lua"); os.exit()' 4.28s user 0.42s system 99% cpu 4.703 total lua <<< 'dofile("default.lua"); dofile("show.lua"); os.exit()' 4.31s user 0.34s system 98% cpu 4.730 total Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("show.lua"); os.exit() lua -i default.lua <<< 'dofile("show.lua"); os.exit()' 4.36s user 0.37s system 99% cpu 4.772 total Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("default.lua"); os.exit() lua -i show.lua <<< 'dofile("default.lua"); os.exit()' 4.28s user 0.37s system 99% cpu 4.655 total So running show.lua before default.lua is a bit faster for me than the other way around, but all are in the same ballpark (+- 3% or so) From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 16:48:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADImRjh020675; Fri, 13 Nov 2009 16:48:27 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8915419172; Fri, 13 Nov 2009 16:48:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 852D419131 for ; Fri, 13 Nov 2009 16:48:02 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADIm1lO008770 for ; Fri, 13 Nov 2009 16:48:01 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 4D13E54C03F; Fri, 13 Nov 2009 16:48:02 -0200 (BRST) Date: Fri, 13 Nov 2009 16:48:02 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113184802.GA23380@inf.puc-rio.br> References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1258137134.25692.5.camel@defiant.tbdnetworks.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On my system[1], I get the following: > > defiant:/tmp/lua-big-script% time lua -i show.lua < dofile("default.lua") > os.exit() > EOF > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > dofile("default.lua") > > os.exit() > lua -i show.lua <<< 'dofile("default.lua") os.exit()' 4.33s user 0.33s > system 99% cpu 4.667 total > defiant:/tmp/lua-big-script% Mine took about 8 minutes... -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:11:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJB8Ov025354; Fri, 13 Nov 2009 17:11:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 125B5192A7; Fri, 13 Nov 2009 17:10:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B090719295 for ; Fri, 13 Nov 2009 17:10:27 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nADJANMT049717 for ; Fri, 13 Nov 2009 20:10:23 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJs9/UrDbohb/2dsb2JhbADWGoQ8BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:10:23 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJALFc043430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:10:23 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDAF1B.60002@erix.it> Date: Fri, 13 Nov 2009 20:10:19 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> In-Reply-To: <20091113184802.GA23380@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: > Mine took about 8 minutes... lua -i show.lua Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > dofile("default.lua") os.exit() About 8 seconds (Lua 5.1.2, Windows XP) Now I'll try with a later Lua version. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:14:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJEbha026074; Fri, 13 Nov 2009 17:14:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26B18192EE; Fri, 13 Nov 2009 17:13:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58809192DC for ; Fri, 13 Nov 2009 17:13:49 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N91ad-0001fe-22 for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 20:13:47 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N91ac-0006ZR-JX for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 20:13:46 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: The Lua interpreter and large scripts References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> Date: Fri, 13 Nov 2009 20:13:46 +0100 In-Reply-To: <20091113184802.GA23380@inf.puc-rio.br> (Roberto Ierusalimschy's message of "Fri, 13 Nov 2009 16:48:02 -0200") Message-ID: <87639eck5x.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Roberto Ierusalimschy: >> On my system[1], I get the following: >> >> defiant:/tmp/lua-big-script% time lua -i show.lua <> dofile("default.lua") >> os.exit() >> EOF >> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio >> > dofile("default.lua") >> > os.exit() >> lua -i show.lua <<< 'dofile("default.lua") os.exit()' 4.33s user 0.33s >> system 99% cpu 4.667 total >> defiant:/tmp/lua-big-script% > > Mine took about 8 minutes... On i386, I presume? Debian squeeze amd64 is fast, but the i386 version is much, much slower. It's already used 2.5 minutes of CPU time over here, and it's still running. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:16:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJE2t7025912; Fri, 13 Nov 2009 17:14:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 614CB192E6; Fri, 13 Nov 2009 17:13:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6247D192DC for ; Fri, 13 Nov 2009 17:13:34 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N91Zq-0007KV-Gk for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 11:12:58 -0800 Subject: Re: The Lua interpreter and large scripts From: Norbert Kiesel To: Lua list In-Reply-To: <4AFDAF1B.60002@erix.it> References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 11:13:32 -0800 Message-ID: <1258139612.25692.11.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 2009-11-13 at 20:10 +0100, Enrico Colombini wrote: > Roberto Ierusalimschy wrote: > > Mine took about 8 minutes... > > lua -i show.lua > Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > > dofile("default.lua") os.exit() > > About 8 seconds (Lua 5.1.2, Windows XP) 32bit or 64bit? From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:21:24 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJLKKa027787; Fri, 13 Nov 2009 17:21:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6891C19305; Fri, 13 Nov 2009 17:20:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E68E4192E0 for ; Fri, 13 Nov 2009 17:20:42 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id nADJKcwb079272 for ; Fri, 13 Nov 2009 20:20:38 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAPM//UrDbohb/2dsb2JhbADWFIQ8BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:20:38 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJKbFc044497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:20:38 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDB183.7030601@erix.it> Date: Fri, 13 Nov 2009 20:20:35 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> In-Reply-To: <4AFDAF1B.60002@erix.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Enrico Colombini wrote: > About 8 seconds (Lua 5.1.2, Windows XP) > > Now I'll try with a later Lua version. lua -i show.lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > dofile("default.lua") os.exit() About 6 minutes 10 seconds. Unless I made mistakes, it seems to be version-dependent. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:22:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJLv9K027930; Fri, 13 Nov 2009 17:21:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4559F19322; Fri, 13 Nov 2009 17:21:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 985DC190E0 for ; Fri, 13 Nov 2009 17:21:25 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADJLLOM011392 for ; Fri, 13 Nov 2009 17:21:21 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 0BA7D54C03F; Fri, 13 Nov 2009 17:21:22 -0200 (BRST) Date: Fri, 13 Nov 2009 17:21:22 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113192122.GA25174@inf.puc-rio.br> References: <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1258139612.25692.11.camel@defiant.tbdnetworks.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Fri, 2009-11-13 at 20:10 +0100, Enrico Colombini wrote: > > Roberto Ierusalimschy wrote: > > > Mine took about 8 minutes... > > > > lua -i show.lua > > Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > > > dofile("default.lua") os.exit() > > > > About 8 seconds (Lua 5.1.2, Windows XP) > > 32bit or 64bit? Mine is 32 bits. (Intel(R) Pentium(R) 4 CPU 2.93GHz, 1.5G ram, Ubuntu, Lua 5.1.4) -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:24:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJONId028352; Fri, 13 Nov 2009 17:24:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DA8A919357; Fri, 13 Nov 2009 17:23:58 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 367C91934D for ; Fri, 13 Nov 2009 17:23:53 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N91kK-0007Rw-00; Fri, 13 Nov 2009 20:23:48 +0100 Date: Fri, 13 Nov 2009 20:23:44 +0100 From: Mike Pall To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113192344.GA17816@mike.de> References: <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <1258138006.25692.10.camel@defiant.tbdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1258138006.25692.10.camel@defiant.tbdnetworks.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Norbert Kiesel wrote: > So running show.lua before default.lua is a bit faster for me than the > other way around, but all are in the same ballpark (+- 3% or so) Apparently it can only be triggered with a 32 bit Lua. And my patch seems to solve the problem. Maybe there's a less expensive place to put the GC check, though. None of the parsed strings are collected, so it's really only necessary to get the GC out of the sweepstring state. But the reader function could interfere, so it's probably better to add the check in luaX_newstring() as originally proposed. BTW: I found another problem: luaX_setinput() calls next() which in turn may call the reader function which in turn may run the GC. But the chunkname string is still unanchored. It's only anchored when open_func runs and anchors the prototype in the stack. It looks like this can't trigger right now, because of the lookahead check for the bytecode signature in f_parser. But it's a potential GC bug, if that behavior ever changes. --Mike From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:28:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJSNxc029696; Fri, 13 Nov 2009 17:28:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5658B1936B; Fri, 13 Nov 2009 17:27:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E00C919322 for ; Fri, 13 Nov 2009 17:27:53 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N91nh-0007Lq-Rq for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 11:27:17 -0800 Subject: Re: The Lua interpreter and large scripts From: Norbert Kiesel To: Lua list In-Reply-To: <87639eck5x.fsf@mid.deneb.enyo.de> References: <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <87639eck5x.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 11:27:51 -0800 Message-ID: <1258140471.25692.15.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On a virtual machine running lua 5.1.2 on 32bit Ubuntu 8.04.3, I get admin@dev-rc1:~/lua-big-script$ ./R lua <<< 'dofile("show.lua"); dofile("default.lua"); os.exit()' 7:37.29 total lua <<< 'dofile("default.lua"); dofile("show.lua"); os.exit()' 5.271 total Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > dofile("show.lua"); os.exit() lua -i default.lua <<< 'dofile("show.lua"); os.exit()' 5.265 total Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio > dofile("default.lua"); os.exit() lua -i show.lua <<< 'dofile("default.lua"); os.exit()' 7:43.17 total admin@dev-rc1:~/lua-big-script$ So -i does not make a difference, but show,default takes about 7.5 minutes and default,show about 6 seconds. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:37:03 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJaxUe031158; Fri, 13 Nov 2009 17:37:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A2301937A; Fri, 13 Nov 2009 17:36:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout3.mclink.it (smtpout3.mclink.it [195.110.128.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C9D01936E for ; Fri, 13 Nov 2009 17:36:27 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout3.mclink.it (8.13.6/8.13.6) with ESMTP id nADJaPWT082715 for ; Fri, 13 Nov 2009 20:36:25 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEACtE/UrDbohc/2dsb2JhbADWG4Q8BA Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:36:25 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJaOaK043154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:36:24 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDB535.2050206@erix.it> Date: Fri, 13 Nov 2009 20:36:21 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> In-Reply-To: <20091113192122.GA25174@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: > Mine is 32 bits. (Intel(R) Pentium(R) 4 CPU 2.93GHz, 1.5G ram, Ubuntu, > Lua 5.1.4) Mine too (Pentium 4HT, 2 GB, XP Home). Why does it not seem to happen with 5.1.2? Is it just a coincidence, or gc changed (sorry, I can't remember the changes). Playing with setpause/setstepmul does not seem to make a difference. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:37:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJbcNa031306; Fri, 13 Nov 2009 17:37:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18291192CF; Fri, 13 Nov 2009 17:11:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6A322192B7 for ; Fri, 13 Nov 2009 17:11:33 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADJBWY7010706 for ; Fri, 13 Nov 2009 17:11:32 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id BD6F754C03F; Fri, 13 Nov 2009 17:11:32 -0200 (BRST) Date: Fri, 13 Nov 2009 17:11:32 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113191132.GA24518@inf.puc-rio.br> References: <20091111072559.GA15532@brevard.conman.org> <20091111074823.GA12525@mike.de> <20091111100914.GA3132@magritte.tecgraf.puc-rio.br> <20091111112452.GA22594@mike.de> <20091111205527.GA11512@brevard.conman.org> <20091111211714.GA18099@mike.de> <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <20091112171345.GB14516@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091112171345.GB14516@inf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > > The #1 question is now: why is the GC stuck? Because usually every > > > string allocation is accompanied with a GC check. And once the > > > threshold is reached, the GC is driven forward and should quickly > > > get out of the sweepstring phase. > > > > > > I think luaX_newstring() in llex.c must be the culprit. You can > > > try to add a GC check just before the 'return ts' at line 123: > > > luaC_checkGC(L); > > > > > > If this solves the problem, then you've found a bug in Lua. > > > Congratulations -- it doesn't happen that often. :-) > > > > I tried that, and nope. Still takes six minutes. > > Nevertheless it would be useful to check Mike's theory. A simple (and > somewhat dirty ;) way to do it would be to add the following line > at the beginning of luaS_resize (just after variable definitions): > > fprintf(stderr, "gcs: %d strgc: %d size: %d nuse: %d bytes: %d tsh: %d\n", > G(L)->gcstate, G(L)->sweepstrgc, G(L)->strt.size, G(L)->strt.nuse, > G(L)->totalbytes, G(L)->GCthreshold); > > (That will generate 469488 lines of output. But any chunk after the > first thousand lines could give us some clue of what is going one. You > can abort the run after the first few thousand lines.) Adding those lines confirmed Mike's explanation. The GC is stopped in the sweepstring state, and so nuse keeps growing without resizing the string table (strt.size). However, adding the correction he suggested ("luaC_checkGC(ls->L);" on function luaX_newstring in llex.c) solved the problem here. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:43:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJh6IO032199; Fri, 13 Nov 2009 17:43:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9D240192CF; Fri, 13 Nov 2009 17:42:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.tbdnetworks.com (mail.tbdnetworks.com [64.2.17.69]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 26001192A7 for ; Fri, 13 Nov 2009 17:42:33 -0200 (BRST) Received: from defiant.tbdnetworks.com ([192.168.4.126]) by mail.tbdnetworks.com with esmtp (Exim 4.69) (envelope-from ) id 1N921s-0007Mb-Sy for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 11:41:56 -0800 Subject: Re: The Lua interpreter and large scripts From: Norbert Kiesel To: Lua list In-Reply-To: <4AFDB535.2050206@erix.it> References: <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> <4AFDB535.2050206@erix.it> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 11:42:29 -0800 Message-ID: <1258141349.25692.18.camel@defiant.tbdnetworks.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Fri, 2009-11-13 at 20:36 +0100, Enrico Colombini wrote: > Roberto Ierusalimschy wrote: > > Mine is 32 bits. (Intel(R) Pentium(R) 4 CPU 2.93GHz, 1.5G ram, Ubuntu, > > Lua 5.1.4) > > Mine too (Pentium 4HT, 2 GB, XP Home). > > Why does it not seem to happen with 5.1.2? Is it just a coincidence, or > gc changed (sorry, I can't remember the changes). For me it happened with 5.1.2 on 32bit Ubuntu as well. So if 5.1.2 really runs fast under 32bit XP, it's OS-dependent at least. From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:45:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJjeDC032722; Fri, 13 Nov 2009 17:45:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 250571938E; Fri, 13 Nov 2009 17:45:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5DA97192E6 for ; Fri, 13 Nov 2009 17:45:08 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nADJj62o057623 for ; Fri, 13 Nov 2009 20:45:06 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAI5G/UrDbohb/2dsb2JhbADWD4Q8BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:44:55 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJirFc046963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:44:54 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDB733.40900@erix.it> Date: Fri, 13 Nov 2009 20:44:51 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> <4AFDB535.2050206@erix.it> In-Reply-To: <4AFDB535.2050206@erix.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Doing a gc after loading "show.lua" brings down the time to a few seconds: collectgarbage() dofile("default.lua") os.exit() Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:47:21 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJlHfN000552; Fri, 13 Nov 2009 17:47:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D7BB01939E; Fri, 13 Nov 2009 17:46:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout2.mclink.it (smtpout2.mclink.it [195.110.128.201]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC02F19395 for ; Fri, 13 Nov 2009 17:46:47 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout2.mclink.it (8.13.6/8.13.6) with ESMTP id nADJkivV057974 for ; Fri, 13 Nov 2009 20:46:44 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAPtG/UrDbohc/2dsb2JhbACEcsAVkQmBMII4VAQ Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:46:31 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJkVaK044224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:46:31 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDB794.5050802@erix.it> Date: Fri, 13 Nov 2009 20:46:28 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> <4AFDB535.2050206@erix.it> <1258141349.25692.18.camel@defiant.tbdnetworks.com> In-Reply-To: <1258141349.25692.18.camel@defiant.tbdnetworks.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Norbert Kiesel wrote: > For me it happened with 5.1.2 on 32bit Ubuntu as well. So if 5.1.2 > really runs fast under 32bit XP, it's OS-dependent at least. Tried again: yes, it runs fast on mine with 5.1.2. Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:48:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJmqTX000996; Fri, 13 Nov 2009 17:48:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E2788193BA; Fri, 13 Nov 2009 17:48:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 453E1192EF for ; Fri, 13 Nov 2009 17:48:23 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADJmJiL013836 for ; Fri, 13 Nov 2009 17:48:19 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 3453354C03F; Fri, 13 Nov 2009 17:48:20 -0200 (BRST) Date: Fri, 13 Nov 2009 17:48:20 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113194820.GA26809@inf.puc-rio.br> References: <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> <4AFDB535.2050206@erix.it> <1258141349.25692.18.camel@defiant.tbdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1258141349.25692.18.camel@defiant.tbdnetworks.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > On Fri, 2009-11-13 at 20:36 +0100, Enrico Colombini wrote: > > Roberto Ierusalimschy wrote: > > > Mine is 32 bits. (Intel(R) Pentium(R) 4 CPU 2.93GHz, 1.5G ram, Ubuntu, > > > Lua 5.1.4) > > > > Mine too (Pentium 4HT, 2 GB, XP Home). > > > > Why does it not seem to happen with 5.1.2? Is it just a coincidence, or > > gc changed (sorry, I can't remember the changes). > > For me it happened with 5.1.2 on 32bit Ubuntu as well. So if 5.1.2 > really runs fast under 32bit XP, it's OS-dependent at least. This bug is "all"-dependent. Anything that changes the state of the garbage collector at that particular point affects it. That includes sizeof's, arguments in the command line (when creating the arg table), any detail in the programs being tested, etc. -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 17:54:22 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADJsIqk002006; Fri, 13 Nov 2009 17:54:19 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 70526193CD; Fri, 13 Nov 2009 17:53:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 927F81939C for ; Fri, 13 Nov 2009 17:53:48 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id nADJrhlU056229 for ; Fri, 13 Nov 2009 20:53:43 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAK9H/UrDbohb/2dsb2JhbADVeIQ8BA Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 13 Nov 2009 20:53:43 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nADJrgFc047853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Nov 2009 20:53:43 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4AFDB944.6030702@erix.it> Date: Fri, 13 Nov 2009 20:53:40 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: The Lua interpreter and large scripts References: <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <20091113184802.GA23380@inf.puc-rio.br> <4AFDAF1B.60002@erix.it> <1258139612.25692.11.camel@defiant.tbdnetworks.com> <20091113192122.GA25174@inf.puc-rio.br> <4AFDB535.2050206@erix.it> <1258141349.25692.18.camel@defiant.tbdnetworks.com> <20091113194820.GA26809@inf.puc-rio.br> In-Reply-To: <20091113194820.GA26809@inf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Roberto Ierusalimschy wrote: > This bug is "all"-dependent. Anything that changes the state of the > garbage collector at that particular point affects it. That includes > sizeof's, arguments in the command line (when creating the > arg table), any detail in the programs being tested, etc. So it's a true "phase of moon" bug in a literal sense :-) Enrico From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 18:05:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADK4xib005257; Fri, 13 Nov 2009 18:04:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E6D6019376; Fri, 13 Nov 2009 18:04:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C63618CF8 for ; Fri, 13 Nov 2009 18:04:35 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADK4Z46015879 for ; Fri, 13 Nov 2009 18:04:35 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 5FA5E54C03F; Fri, 13 Nov 2009 18:04:35 -0200 (BRST) Date: Fri, 13 Nov 2009 18:04:35 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113200435.GB26809@inf.puc-rio.br> References: <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <1258138006.25692.10.camel@defiant.tbdnetworks.com> <20091113192344.GA17816@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091113192344.GA17816@mike.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > BTW: I found another problem: luaX_setinput() calls next() which > in turn may call the reader function which in turn may run the GC. > But the chunkname string is still unanchored. It's only anchored > when open_func runs and anchors the prototype in the stack. The problem may aslo arise if a program stops the collector and then goes on creating a lot of strings. This is not very smart of the part of the program, but the price can get very high. Maybe a solution would be not to stop resizing during a sweepstring phase. (The resize function could collect itself the dead strings, or it could advance the collector until it finishes that phase. But I am not sure if this is worth the extra complexity.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Fri Nov 13 18:13:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nADKCxbY006544; Fri, 13 Nov 2009 18:12:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 161BD193B1; Fri, 13 Nov 2009 18:12:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C00711937B for ; Fri, 13 Nov 2009 18:12:36 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nADKCaT7016495 for ; Fri, 13 Nov 2009 18:12:36 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 9F40254C03F; Fri, 13 Nov 2009 18:12:36 -0200 (BRST) Date: Fri, 13 Nov 2009 18:12:36 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: The Lua interpreter and large scripts Message-ID: <20091113201236.GA27827@inf.puc-rio.br> References: <20091111225237.GA13831@brevard.conman.org> <20091111232623.GA23880@mike.de> <20091112022951.GA3325@brevard.conman.org> <4AFBB0C2.9000502@gmail.com> <20091112090337.GA22238@brevard.conman.org> <20091112085738.A5488@lua.tecgraf.puc-rio.br> <20091113171852.GA13887@brevard.conman.org> <1258137134.25692.5.camel@defiant.tbdnetworks.com> <1258138006.25692.10.camel@defiant.tbdnetworks.com> <20091113192344.GA17816@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091113192344.GA17816@mike.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > BTW: I found another problem: luaX_setinput() calls next() which > in turn may call the reader function which in turn may run the GC. > But the chunkname string is still unanchored. It's only anchored > when open_func runs and anchors the prototype in the stack. > > It looks like this can't trigger right now, because of the > lookahead check for the bytecode signature in f_parser. But it's a > potential GC bug, if that behavior ever changes. This already was fixed in 5.2. The current code is like this: TString *tname = luaS_new(L, name); setsvalue2s(L, L->top, tname); /* protect name */ incr_top(L); -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 00:23:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE2Mvje009137; Sat, 14 Nov 2009 00:22:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E342E1923D; Sat, 14 Nov 2009 00:22:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB3661903D for ; Sat, 14 Nov 2009 00:22:17 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1N98HF-00076T-1z for lua@bazar2.conectiva.com.br; Fri, 13 Nov 2009 18:22:13 -0800 From: "Robert G. Jakabosky" To: Lua list Subject: [PATCH] Re: The Lua interpreter and large scripts Date: Fri, 13 Nov 2009 19:22:11 -0700 User-Agent: KMail/1.9.10 References: <20091111225237.GA13831@brevard.conman.org> <20091113192344.GA17816@mike.de> <20091113200435.GB26809@inf.puc-rio.br> In-Reply-To: <20091113200435.GB26809@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_TRh/KOB46sHOJcf" Message-Id: <200911131822.11858.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Boundary-00=_TRh/KOB46sHOJcf Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 13, Roberto Ierusalimschy wrote: > > BTW: I found another problem: luaX_setinput() calls next() which > > in turn may call the reader function which in turn may run the GC. > > But the chunkname string is still unanchored. It's only anchored > > when open_func runs and anchors the prototype in the stack. The attached patch includes the fix for this from Lua 5.2 as described by Roberto Ierusalimschy in his other e-mail. > > The problem may aslo arise if a program stops the collector and then > goes on creating a lot of strings. This is not very smart of the part of > the program, but the price can get very high. Maybe a solution would be > not to stop resizing during a sweepstring phase. (The resize function > could collect itself the dead strings, or it could advance the collector > until it finishes that phase. But I am not sure if this is worth the > extra complexity.) > > -- Roberto The attached patch will do one step of the sweep strings phase of the GC from the string table resize function. This will get the GC out of the sweep strings phase so that the string table can be resized. Maybe it would be better to have it finish the whole sweep strings phase in the resize function, instead of just single stepping each time the resize function is called. New strings should still be safe for premature collection since they will be marked with the current white color and not get collected during the sweep string phase. I will update the Emergency GC patch to include these changes, even though it doesn't happen on this test case. -- Robert G. Jakabosky --Boundary-00=_TRh/KOB46sHOJcf Content-Type: text/x-diff; charset="iso 8859-15"; name="lua_sweep_strings.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="lua_sweep_strings.patch" diff --git a/src/lgc.c b/src/lgc.c index d9e0b78..89cafb5 100644 --- a/src/lgc.c +++ b/src/lgc.c @@ -552,6 +552,15 @@ static void atomic (lua_State *L) { g->estimate = g->totalbytes - udsize; /* first estimate */ } +static void sweepstrstep (global_State *g, lua_State *L) { + lu_mem old = g->totalbytes; + sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); + if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ + g->gcstate = GCSsweep; /* end sweep-string phase */ + lua_assert(old >= g->totalbytes); + g->estimate -= old - g->totalbytes; +} + static l_mem singlestep (lua_State *L) { global_State *g = G(L); @@ -570,12 +579,7 @@ static l_mem singlestep (lua_State *L) { } } case GCSsweepstring: { - lu_mem old = g->totalbytes; - sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); - if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ - g->gcstate = GCSsweep; /* end sweep-string phase */ - lua_assert(old >= g->totalbytes); - g->estimate -= old - g->totalbytes; + sweepstrstep(g, L); return GCSWEEPCOST; } case GCSsweep: { @@ -633,6 +637,15 @@ void luaC_step (lua_State *L) { } +int luaC_sweepstrgc (lua_State *L) { + global_State *g = G(L); + if (g->gcstate == GCSsweepstring) { + sweepstrstep(g, L); + return (g->gcstate == GCSsweepstring) ? 1 : 0; + } + return 0; +} + void luaC_fullgc (lua_State *L) { global_State *g = G(L); if (g->gcstate <= GCSpropagate) { diff --git a/src/lgc.h b/src/lgc.h index 5a8dc60..170fee2 100644 --- a/src/lgc.h +++ b/src/lgc.h @@ -101,6 +101,7 @@ LUAI_FUNC void luaC_callGCTM (lua_State *L); LUAI_FUNC void luaC_freeall (lua_State *L); LUAI_FUNC void luaC_step (lua_State *L); LUAI_FUNC void luaC_fullgc (lua_State *L); +LUAI_FUNC int luaC_sweepstrgc (lua_State *L); LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); diff --git a/src/lparser.c b/src/lparser.c index 1e2a9a8..31cc146 100644 --- a/src/lparser.c +++ b/src/lparser.c @@ -383,8 +383,11 @@ static void close_func (LexState *ls) { Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { struct LexState lexstate; struct FuncState funcstate; + TString *tname = luaS_new(L, name); + setsvalue2s(L, L->top, tname); /* protect name */ + incr_top(L); lexstate.buff = buff; - luaX_setinput(L, &lexstate, z, luaS_new(L, name)); + luaX_setinput(L, &lexstate, z, tname); open_func(&lexstate, &funcstate); funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ luaX_next(&lexstate); /* read first token */ diff --git a/src/lstring.c b/src/lstring.c index 4911315..fdb6f6a 100644 --- a/src/lstring.c +++ b/src/lstring.c @@ -23,7 +23,7 @@ void luaS_resize (lua_State *L, int newsize) { GCObject **newhash; stringtable *tb; int i; - if (G(L)->gcstate == GCSsweepstring) + if (luaC_sweepstrgc(L)) return; /* cannot resize during GC traverse */ newhash = luaM_newvector(L, newsize, GCObject *); tb = &G(L)->strt; --Boundary-00=_TRh/KOB46sHOJcf-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 01:01:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE31Eih011636; Sat, 14 Nov 2009 01:01:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 76EC719345; Sat, 14 Nov 2009 01:00:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from homiemail-a19.g.dreamhost.com (mailbigip.dreamhost.com [208.97.132.5]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D3B0B19327 for ; Sat, 14 Nov 2009 01:00:42 -0200 (BRST) Received: from [10.1.1.2] (203-206-112-146.dyn.iinet.net.au [203.206.112.146]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPSA id 3CFCC60405D for ; Fri, 13 Nov 2009 19:00:37 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Coroutines and Go From: Jacques Chester In-Reply-To: <4AFC3613.4020003@cowlark.com> Date: Sat, 14 Nov 2009 11:00:34 +0800 Content-Transfer-Encoding: 7bit Message-Id: References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFC05F1.2050606@erix.it> <560972290911120505k19d81d3eqd1a807d483be5703@mail.gmail.com> <4AFC3613.4020003@cowlark.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On 13/11/2009, at 12:21 AM, David Given wrote: > So, to get back to the point: Go vs Algol-68. TBH, I think the > 41-year-old language is richer, clearer and more expressive. Reddit'd. Cheers, JC. From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 02:44:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE4i5fc018497; Sat, 14 Nov 2009 02:44:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A895219355; Sat, 14 Nov 2009 02:43:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0C20192AE for ; Sat, 14 Nov 2009 02:43:24 -0200 (BRST) Received: by yxe17 with SMTP id 17so3513917yxe.33 for ; Fri, 13 Nov 2009 20:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=SGVQ2C45Ih2fACG4Wsxp32fSK7mbRKSBb1Vaf8s4uaw=; b=aoqhcXC3VPcIRNmmlQnMlUHTJn99AeEg0AWnxzB1vjyhgOl8CV+IclMw32CjotLyG/ ObVR7SD8ecbWHpvP8C9PsXl00LFWVVZpwLkSBUOtgX6JAa89qGl5QqFIWGXmMmiKV/Ks PpsLCPalyPT7m6cY3m9KLCdEn1UHjCbNv836s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; b=pkh2AeOCpcPxYPRyiE7/NbHHKsrpyKj/pBL7tJfTKEYmM8eY9gGlGGbaramOymYHLi 8V4r1OehkFISY/Yx9afQ7fRSyASCjWlYsW2pwbG4L0FlJeAQ+eiKbcFO3BvzgWPqGHUw sGrjpYOxm7skaFbnbcizWak8fa9wUtnf0RSao= Received: by 10.150.17.37 with SMTP id 37mr9304488ybq.285.1258173802472; Fri, 13 Nov 2009 20:43:22 -0800 (PST) Received: from IBM-73F5CA019D1 ([122.237.129.51]) by mx.google.com with ESMTPS id 20sm175068ywh.2.2009.11.13.20.43.20 (version=SSLv3 cipher=RC4-MD5); Fri, 13 Nov 2009 20:43:21 -0800 (PST) Date: Sat, 14 Nov 2009 12:43:14 +0800 From: "YangFan" To: "Lua list" Subject: LuaJIT 2 crashes on lua_pcall ? Message-ID: <200911141243123591007@gmail.com> X-mailer: Foxmail 6, 15, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi,Lua list I have a C++ program which embeds Lua interpreter and registers several classes, then replace the Lua interpreter dll with LuaJIT2's. I find that LuaJIT could not resolve userdata type index perfectly, if lua code attempts to call not exists methods in userdata, the C++ application just crashes, but the official Lua interpreter would return error message such as "No such operator define", "attempt to call method 'xxx' ( a nil value )" and so on. Regards YangFan missdeer@gmail.com 2009-11-14 From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 03:56:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE5uSUK024397; Sat, 14 Nov 2009 03:56:29 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 95F09192A7; Sat, 14 Nov 2009 03:56:04 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc2-s36.bay0.hotmail.com (bay0-omc2-s36.bay0.hotmail.com [65.54.246.172]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8B30019290 for ; Sat, 14 Nov 2009 03:55:58 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc2-s36.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 13 Nov 2009 21:55:52 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sat, 14 Nov 2009 05:55:51 +0000 Message-ID: <4AFE4650.3050101@my.erau.edu> Date: Sat, 14 Nov 2009 00:55:28 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT 2 crashes on lua_pcall ? References: <200911141243123591007@gmail.com> In-Reply-To: <200911141243123591007@gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Nov 2009 05:55:52.0952 (UTC) FILETIME=[1FF3E780:01CA64EF] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean YangFan wrote: > Hi,Lua list > > I have a C++ program which embeds Lua interpreter and registers several classes, then replace the Lua interpreter dll with LuaJIT2's. I find that LuaJIT could not resolve userdata type index perfectly, if lua code attempts to call not exists methods in userdata, the C++ application just crashes, but the official Lua interpreter would return error message such as "No such operator define", "attempt to call method 'xxx' ( a nil value )" and so on. > Do you have any kind of proof of your claims? I have not been able to reproduce your bug with any simple test cases. ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 06:58:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE8wNlk004956; Sat, 14 Nov 2009 06:58:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C8E12191AE; Sat, 14 Nov 2009 06:57:56 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A2C9118F75 for ; Sat, 14 Nov 2009 06:57:51 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1N9ES3-00058k-Pr for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 09:57:47 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1N9ES3-0001pl-Al for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 09:57:47 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: LuaSocket: asynchronous connect on Windows not behaving properly References: <89d273ba0911100921u1fbea7c0k89d52969455bb2bb@mail.gmail.com> <89d273ba0911120148w2400178cr390ece8376f7c4ef@mail.gmail.com> <89d273ba0911120601u48eeb069wb098e030e1baf4ac@mail.gmail.com> <89d273ba0911120812n1659bc11l25289c915b80c7a0@mail.gmail.com> <89d273ba0911130527l7254b14fjb3da8510d43a0e36@mail.gmail.com> Date: Sat, 14 Nov 2009 09:57:47 +0100 Message-ID: <87639da3g4.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Jerome Vuarand: > 2009/11/12 Jerome Vuarand : >> It seems that on Linux, the socket is signaled as writable by select >> whether it is connected or connection failed. In both cases exceptfds >> is returned empty. So the following script still exhibits different >> behaviour on Windows and Linux : > > Some food for thoughts : I've been given the following links, that > show that non-blocking connect result detection is not trivial. > > http://cr.yp.to/docs/connect.html Last updated nine years ago. getsockopt(SO_ERROR) is portable nowadays if you take care of both ways to return the error (int out parameter and errno). From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 06:58:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAE8wnoe005040; Sat, 14 Nov 2009 06:58:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C117819359; Sat, 14 Nov 2009 06:58:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9523C192D9 for ; Sat, 14 Nov 2009 06:58:10 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so489049fga.17 for ; Sat, 14 Nov 2009 00:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UtvWltsU5cIfp324j8ShiBFjEmh8irqwkmebr9bYikc=; b=Z6c1FKYKU+sNa6+nbM2h98FiMGdaTKpgUOjNMG4IQvK2pn5te7FPhcO2a+mgiMbKP6 GTw7u6oS5IAAUeMFWVes39Bt+trNdfUBNqFQWzh+9/cKrKAGe0aVXjfOtxfEOVR9bpb1 NkmFukR55yOh2FfEpTbZp3bckOG5Aqdsu1GV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Sw9xQ8S7woI7x6P4WLCnFXnHknYC5XlZOrmMYjvLxI3inD1UJw6/km+sTqS1Qd6bXH aXjx4DOJj5aP2jcC6UnqE5OHb/G2pcv8UaqiJWcwVSLPMHous0kOJBy17DHQjRCI3FWq xhKvQkuyRWWtjjaieLRBlyN2QTEpOYNMcNdJM= MIME-Version: 1.0 Received: by 10.86.133.38 with SMTP id g38mr2842817fgd.53.1258189088010; Sat, 14 Nov 2009 00:58:08 -0800 (PST) In-Reply-To: <20091113140959.5f80e1d6@trite.i.flarn.net.i.flarn.net> References: <20091113140959.5f80e1d6@trite.i.flarn.net.i.flarn.net> Date: Sat, 14 Nov 2009 09:58:07 +0100 Message-ID: <9386fb2d0911140058v2833307cy561467e8b2f80d9c@mail.gmail.com> Subject: Re: Cannot redirect stderr From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAE8wnoe005040 > Firstly, Lua is not an acronym :)  Secondly, does Windows have a call > similar to UNIX's dup2?  This lets you duplicate a file handle to a > specific one (ie, so you can easily set what handles 1, 2 and 3 > (stdout, in and err) go to. This page says it does. Haven't tested it. http://msdn.microsoft.com/en-us/library/8syseb29%28VS.80%29.aspx From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 08:06:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEA6aqG009437; Sat, 14 Nov 2009 08:06:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2C035192B6; Sat, 14 Nov 2009 08:06:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F05111928C for ; Sat, 14 Nov 2009 08:06:00 -0200 (BRST) Received: by ywh40 with SMTP id 40so1958510ywh.33 for ; Sat, 14 Nov 2009 02:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=t8Lw/W6NkrSHRSg/xcpycFZ8eV50QhXFZo1JGbIjWuI=; b=tvVwTb5idcCTdS6OBEq7Lzfh0zninuzTB7eUMpswJfK1BUy+OdYmQ8ky58hs73Cqb3 zjf4A2Kl1KH0IHuEhUEy3IrK1ZVPVVMG5+DeKQY4kNLPISQxOtQF9GclZjxL4VmS2L9x DoMqoA3qTFIbsA1tWV9oQuIlMNofGMdcJF4ZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OrVoe4EsEpy3q+aWnFTa7JcStGNwQ4mDvFpPp2+1DI9fnmzG8xWmmO+lXYJGqHe6hK zayWb1AGkIF3SrfXq5Qj+9BKm+Tk8DWgi+mI+jI6dspsRRPQGZIhIzQJwc+InuuBbleC iyGWhxC3+EFqXfJ6kQeCFjokbjOfJKuX+JwDo= MIME-Version: 1.0 Received: by 10.90.23.3 with SMTP id 3mr2065387agw.106.1258193157359; Sat, 14 Nov 2009 02:05:57 -0800 (PST) Date: Sat, 14 Nov 2009 18:05:57 +0800 Message-ID: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> Subject: is it possible to obtain registered functions list of a lua state? From: cloudage@gmail.com To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=00163628352c340943047851ecc3 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --00163628352c340943047851ecc3 Content-Type: text/plain; charset=ISO-8859-1 i registered lots of functions (via luabind) into a lua state and i wish to provide a function name auto complete feature in my script editor,so i need someway to obtain how many functions exists in a lua state and what`s everyone`s name,and even their signatures.is this possible? --00163628352c340943047851ecc3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable i registered lots of functions (via luabind) into a lua state and i wish to= provide a function name auto complete feature in my script editor,so i nee= d someway to obtain how many functions exists in a lua state and what`s eve= ryone`s name,and even their signatures.is<= /a> this possible? --00163628352c340943047851ecc3-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 08:09:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEA9750009626; Sat, 14 Nov 2009 08:09:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B072819378; Sat, 14 Nov 2009 08:08:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3182419357 for ; Sat, 14 Nov 2009 08:08:43 -0200 (BRST) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id 944B1EF728 for ; Sat, 14 Nov 2009 12:08:38 +0200 (EET) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A01E608A999; Sat, 14 Nov 2009 12:08:38 +0200 Received: from [192.168.1.2] (a88-114-94-144.elisa-laajakaista.fi [88.114.94.144]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 4DFD31C6384 for ; Sat, 14 Nov 2009 12:08:36 +0200 (EET) Message-Id: <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> From: Asko Kauppi To: Lua list In-Reply-To: <20091113133709.45382dba@o> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: get time in ms? Date: Sat, 14 Nov 2009 12:04:28 +0200 References: <20091113133709.45382dba@o> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Notice that the value returned by os.clock() is: ".. approximation of the amount in seconds of CPU time used by the program." It is not the "wall clock" time. If you need that in ms, you need to use LuaSocket, Lanes or some other C side binding to gettimeofday (2) on Posix and similar Win32 API. -asko spir kirjoitti 13.11.2009 kello 14:37: > Hello again, > > Is there a builtin or a lib tool? If not, how do you do it? > (googling brought no sensible info on the topic) > > Thank you, > Denis > -------------------------------- > * la vita e estrany * > > site: http://spir.wikidot.com/ > > > From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 10:39:17 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAECdEBH020302; Sat, 14 Nov 2009 10:39:14 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E069919357; Sat, 14 Nov 2009 10:38:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 38724192C1 for ; Sat, 14 Nov 2009 10:38:37 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAECcYDp001253 for ; Sat, 14 Nov 2009 10:38:36 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 0BE3C54C03F; Sat, 14 Nov 2009 10:38:35 -0200 (BRST) Date: Sat, 14 Nov 2009 10:38:34 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: [PATCH] Re: The Lua interpreter and large scripts Message-ID: <20091114123834.GA6490@inf.puc-rio.br> References: <20091111225237.GA13831@brevard.conman.org> <20091113192344.GA17816@mike.de> <20091113200435.GB26809@inf.puc-rio.br> <200911131822.11858.bobby@sharedrealm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911131822.11858.bobby@sharedrealm.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > I will update the Emergency GC patch to include these changes, even though it > doesn't happen on this test case. Lua 5.2 has a compile option for debugging that forces an emergency GC at every single memory allocation. It takes hours to run the tests, but it found several bugs that I do not think we could find otherwise. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 11:04:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAED4qb8022438; Sat, 14 Nov 2009 11:04:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5E0811939F; Sat, 14 Nov 2009 11:04:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BFB2219392 for ; Sat, 14 Nov 2009 11:04:22 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1N9IIf-00029q-5i for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 05:04:21 -0800 From: "Robert G. Jakabosky" To: Lua list Subject: Re: [PATCH] Re: The Lua interpreter and large scripts Date: Sat, 14 Nov 2009 06:04:19 -0700 User-Agent: KMail/1.9.10 References: <20091111225237.GA13831@brevard.conman.org> <200911131822.11858.bobby@sharedrealm.com> <20091114123834.GA6490@inf.puc-rio.br> In-Reply-To: <20091114123834.GA6490@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911140504.19697.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Saturday 14, Roberto Ierusalimschy wrote: > > I will update the Emergency GC patch to include these changes, even > > though it doesn't happen on this test case. > > Lua 5.2 has a compile option for debugging that forces an emergency GC at > every single memory allocation. It takes hours to run the tests, > but it found several bugs that I do not think we could find otherwise. Yup, I do basically the same thing when stress testing the EGC patch, I always remove that testing code before releasing a new patch since I was trying to keep the patch small (to late for that now). The next release will include a compile option to turn on the stress testing code. Are you doing a full/step GC on each allocation? Also is the GC only called during allocations where newsize > oldsize or on every call to 'l_alloc()'? When I do stress testing a full GC is only done when newsize > oldsize. Frees and array shrinks don't cause the GC to be called. Also I run all the test scripts under valgrind's memory checker tool to find all the bugs that don't cause a crash. -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 15:35:08 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEHZ58Z010959; Sat, 14 Nov 2009 15:35:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54F63191DC; Sat, 14 Nov 2009 15:34:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s62.bay0.hotmail.com (bay0-omc3-s62.bay0.hotmail.com [65.54.246.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C158718E1D for ; Sat, 14 Nov 2009 15:34:28 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s62.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 14 Nov 2009 09:34:19 -0800 Received: from [192.168.1.114] (70.119.100.122) by pod51004.outlook.com (10.14.148.63) with Microsoft SMTP Server (TLS) id 14.0.482.35; Sat, 14 Nov 2009 17:34:18 +0000 Message-ID: <4AFEEA03.9010808@my.erau.edu> Date: Sat, 14 Nov 2009 12:33:55 -0500 From: "Matthew P. Del Buono" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: Cannot redirect stderr References: <20091113140959.5f80e1d6@trite.i.flarn.net.i.flarn.net> <9386fb2d0911140058v2833307cy561467e8b2f80d9c@mail.gmail.com> In-Reply-To: <9386fb2d0911140058v2833307cy561467e8b2f80d9c@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Nov 2009 17:34:19.0706 (UTC) FILETIME=[B25319A0:01CA6550] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Pierre LeMoine wrote: >> Firstly, Lua is not an acronym :) Secondly, does Windows have a call >> similar to UNIX's dup2? This lets you duplicate a file handle to a >> specific one (ie, so you can easily set what handles 1, 2 and 3 >> (stdout, in and err) go to. > > This page says it does. Haven't tested it. > http://msdn.microsoft.com/en-us/library/8syseb29%28VS.80%29.aspx While that function exists, typically the mechanism through which to redirect stderr/stdout/stdin is through CreateProcess and CreatePipe: http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx I know it's a lot more work; it's just how it's done. If it's not a child process, you have a much simpler function: http://msdn.microsoft.com/en-us/library/ms686244(VS.85).aspx ====== Matthew P. Del Buono From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 16:33:38 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEIXZPS015270; Sat, 14 Nov 2009 16:33:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 65DB51929A; Sat, 14 Nov 2009 16:33:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3ECA5190FC for ; Sat, 14 Nov 2009 16:33:00 -0200 (BRST) MIME-version: 1.0 Received: from [10.0.1.4] ([69.106.136.63]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KT40028P3HZ0D50@asmtp023.mac.com> for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 10:32:24 -0800 (PST) From: Clark Snowdall Content-type: multipart/signed; boundary=Apple-Mail-1-743468890; protocol="application/pkcs7-signature"; micalg=sha1 Subject: Re: UDP Broadcast Date: Sat, 14 Nov 2009 10:32:22 -0800 In-reply-to: <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> To: Lua list References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> Message-id: X-Mailer: Apple Mail (2.1076) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --Apple-Mail-1-743468890 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Everyone, Thanks for the suggestions ... some of them were helpful. I've done some more exploration, and I think the issue is I can't send a UDP broadcast packet. I can see non-broadcast packets, but when I select the ip address for broadcast, it doesn't show up. Could it be something with my router? Or lua UDP doesn't really like broadcast? Any suggestions? Snowdall On Nov 12, 2009, at 5:03 PM, Sam Roberts wrote: > Apologies, I typoed: > > On Thu, Nov 12, 2009 at 5:01 PM, Sam Roberts > wrote: > [snip] >> By default, the netmask for the 10.* IP addresses is 8, so your bcast >> addr would be 10.255.255.255, but its probably set to something else. > > That should be "255.0.0.0" > >> http://en.wikipedia.org/wiki/IPv4#Private_networks --Apple-Mail-1-743468890 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJljCCBEYw ggOvoAMCAQICEGb9R+PCGeToms2Z3fU6yyQwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA1MTAyODAwMDAwMFoXDTE1MTAyNzIzNTk1OVow gd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp Z24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZl cmlzaWduLmNvbS9ycGEgKGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMjCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMnfrOfq+PgDFMQAktXBfjbCPO98chXLwKuMPRyV zm8eECw/AO2XJua2x+atQx0/pIdHR0w+VPhs+Mf8sZ69MHC8l7EDBeqV8a1AxUR6SwWi8mD81zpl Yu//EHuiVrvFTnAt1qIfPO2wQuhejVchrKaZ2RHp0hoHwHRHQgv8xTTq/ea6JNEdCBU3otdzzwFB L2OyOj++pRpu9MlKWz2VphW7NQIZ+dTvvI8OcXZZu0u2Ptb8Whb01g6J8kn+bAztFenZiHWcec5g J925rXXOL3OVekA6hXVJsLjfaLyrzROChRFQo+A8C67AClPN1zBvhTJGG+RJEMJs4q8fef/btLUC AwEAAaOB/zCB/DASBgNVHRMBAf8ECDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHFwEw KjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYTALBgNVHQ8EBAMCAQYw EQYJYIZIAYb4QgEBBAQDAgEGMC4GA1UdEQQnMCWkIzAhMR8wHQYDVQQDExZQcml2YXRlTGFiZWwz LTIwNDgtMTU1MB0GA1UdDgQWBBQRfV4ZfTwE32ps1qKKGj8x2DuUUjAxBgNVHR8EKjAoMCagJKAi hiBodHRwOi8vY3JsLnZlcmlzaWduLmNvbS9wY2ExLmNybDANBgkqhkiG9w0BAQUFAAOBgQA8o9oC YzrEk6qrctPcrVA4HgyeFkqIt+7r2f8PjZWg1rv6aguuYYTYaEeJ70+ssh9JQZtJM3aTi55uuUMc YL3C3Ioth8FFwBFyBBprJCpsb+f8BxMp0Hc6I+f1wYVoGb/GAVQgGa41gsxiPGEJxvTV67APpp8z hZrTcY5Qj5ndYjCCBUgwggQwoAMCAQICEBgvf/O/BFfpKY4BZsd7G3cwDQYJKoZIhvcNAQEFBQAw gd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp Z24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZl cmlzaWduLmNvbS9ycGEgKGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMjAeFw0w OTEwMzAwMDAwMDBaFw0xMDEwMzAyMzU5NTlaMIIBETEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4x HzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxRjBEBgNVBAsTPXd3dy52ZXJpc2lnbi5j b20vcmVwb3NpdG9yeS9SUEEgSW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMpOTgxHjAcBgNVBAsT FVBlcnNvbmEgTm90IFZhbGlkYXRlZDEzMDEGA1UECxMqRGlnaXRhbCBJRCBDbGFzcyAxIC0gTmV0 c2NhcGUgRnVsbCBTZXJ2aWNlMRcwFQYDVQQDFA5DbGFyayBTbm93ZGFsbDEfMB0GCSqGSIb3DQEJ ARYQc25vd2RhbGxAbWFjLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMt61T9V l4yaAjWhVHit4wZT0DvXcSnhvxrX/1VoAI+6k3OWquCQJEaAY3tLt05cNs8Io2QtRtclZyS00XYi FCjB3mWXlrmf4wDvQxz6CUlawLyPqbOVLOqqxuH92YDmsIEbUGHl0t9XNWHYbBT+lh5eSq1+xBsc lybe0pcNaIrh5dE45C1HzAbgf6beR4K9U6hL10KFkB6giB++QyXUoJk0R6qsIx+oxMb+/04Hfl6X F+KcvxHKoP1Zivue9sYzVIR5sKyhJYqwuHGQMPK2mim2mnL8PL/Or3nr5Kl+1kwlpWQVa+f0hhC6 H28CzVpMj4TVWht2RPBSPL8zHqDYFbcCAwEAAaOBzDCByTAJBgNVHRMEAjAAMEQGA1UdIAQ9MDsw OQYLYIZIAYb4RQEHFwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3Jw YTALBgNVHQ8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwQGCCsGAQUFBwMCMEoGA1UdHwRDMEEw P6A9oDuGOWh0dHA6Ly9JbmRDMURpZ2l0YWxJRC1jcmwudmVyaXNpZ24uY29tL0luZEMxRGlnaXRh bElELmNybDANBgkqhkiG9w0BAQUFAAOCAQEAoqAk7YUnAv58uJtNWVoxe1aA5dJoJIAwghil28iR ZwS2vsNFFTL7YPsDp6Y/t17Gm1azntBlPVqIOkpKFWbLmlqSkbCYyfPMqbmtxy7izCR/3rMqrokq 17Vv9UyltSBF0n1rC0KSF1hUIDZf6LuaN7hCxHPDcThS1MidJla5+tpPCo0PBJZWrSx0BtT3FCsf tKQev4HB+p0X0bxF2kTpUPY/J5efSwtz1flR5aUZELuibnp0+iHFlYcUjtiC+oPWSTAVSUl6Bfuk 1tMuIuRomFmHNILhbgdmE9hVrEsAL2Gh9nZ+dQOcwGt/491qCTRz1qYm8u56pop7peseJRXGajGC BIswggSHAgEBMIHyMIHdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAd BgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBo dHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTA1MR4wHAYDVQQLExVQZXJzb25hIE5vdCBW YWxpZGF0ZWQxNzA1BgNVBAMTLlZlcmlTaWduIENsYXNzIDEgSW5kaXZpZHVhbCBTdWJzY3JpYmVy IENBIC0gRzICEBgvf/O/BFfpKY4BZsd7G3cwCQYFKw4DAhoFAKCCAm0wGAYJKoZIhvcNAQkDMQsG CSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkxMTE0MTgzMjIzWjAjBgkqhkiG9w0BCQQxFgQU 9Fik9C+xgF33ka3RyyN+6U8VBPMwggEDBgkrBgEEAYI3EAQxgfUwgfIwgd0xCzAJBgNVBAYTAlVT MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y azE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEg KGMpMDUxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUGA1UEAxMuVmVyaVNpZ24g Q2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMgIQGC9/878EV+kpjgFmx3sbdzCC AQUGCyqGSIb3DQEJEAILMYH1oIHyMIHdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24s IEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9m IHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTA1MR4wHAYDVQQLExVQZXJz b25hIE5vdCBWYWxpZGF0ZWQxNzA1BgNVBAMTLlZlcmlTaWduIENsYXNzIDEgSW5kaXZpZHVhbCBT dWJzY3JpYmVyIENBIC0gRzICEBgvf/O/BFfpKY4BZsd7G3cwDQYJKoZIhvcNAQEBBQAEggEAHgUM RuRXrpLFYKRAQ0m2XlmHo0V5iVqLY/gJjdqkrtzTd1MrXVSMmRx/9pcLo+yoOF0iprZlKk8a0eZc NxuKxS9XYPhjmxGRj2TXK63sakV0oYhHZeJ971Q1TKJVEpgLiDDt9QhoZOPg4ZbEdu2Kjs+SnbAn M4QZP2IsxRHzN4W2bNJ8cQ0cEKnVZjpOYKYlK8HlywXtZkSWApdDQHtG3VTbnmr6wc6F0t1/w9Kn i4BhhhrScpX+OdzTZZBhaQ16XEKMFaQ/kvmBYEu0+o8H1WobQA7vhfFxJ1J7UQpdL/bZBEDyavkP 9r0kKkUex9zRM8SMBbT2J9+FyByOoNcoKgAAAAAAAA== --Apple-Mail-1-743468890-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 16:57:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEIvelE017334; Sat, 14 Nov 2009 16:57:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8340F19323; Sat, 14 Nov 2009 16:57:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64FF219271 for ; Sat, 14 Nov 2009 16:57:09 -0200 (BRST) Received: by fxm21 with SMTP id 21so1527523fxm.21 for ; Sat, 14 Nov 2009 10:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6Ms3Ak+jXBJL4OOlDOZtLt1S8HSxugVAfx0KsLrjUgg=; b=DeYDk2D3dB12Iz9TJynaoeZM/XbJBZA8JdHybdBk01JSHIZbve40OR7Wa64ZpCQxx+ 1n66+3dWKJhZV5ezKFUm9/c+lhRdlfSSUKqFbuTZOAfCRA2hTiN1/ARkEMjyRJ5dNbRr w2Wy9IwKaJV/AGb0bqDY8qu/QIG02/y6NJmNY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SlrsW9TqLjWBDzwxIaJDde62ZxOvajM82Fc7dUVRdJ0eyhJWwBXydABveWqnqQG/fk JaeaUQm4feiNEARXWnR0IJWXuuqc6KPc5uXl0Zw+aVOd5slql+qdCu6JXfGp0mfJ3fq2 dLZe44q13MdzVqmVatFczeglENXR7b70G68HA= MIME-Version: 1.0 Received: by 10.216.89.202 with SMTP id c52mr2007074wef.215.1258225022246; Sat, 14 Nov 2009 10:57:02 -0800 (PST) In-Reply-To: References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> Date: Sat, 14 Nov 2009 10:57:02 -0800 Message-ID: <17eac67c0911141057h9a6e05cif7a50245f34c1bc6@mail.gmail.com> Subject: Re: UDP Broadcast From: Sam Roberts To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAEIvelE017334 On Sat, Nov 14, 2009 at 10:32 AM, Clark Snowdall wrote: > Everyone, > > Thanks for the suggestions ... some of them were helpful. > > I've done some more exploration, and I think the issue is I can't send a UDP > broadcast packet.  I can see non-broadcast packets, but when I select the ip > address for broadcast, it doesn't show up.  Could it be something with my > router?  Or lua UDP doesn't really like broadcast?  Any suggestions? Which of the suggestions did you try? You still haven't said anything about your ethernet configuration information, particularly ifconfig output, and your code implies you are using a non-standard netmask. Doug reported success, and we send lots of broadcast and multicast traffic with luasocket without trouble, so its not luasocket itself. Cheers, Sam From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 17:33:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEJXLHL019893; Sat, 14 Nov 2009 17:33:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C3F61902A; Sat, 14 Nov 2009 17:32:54 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 47D2418F06 for ; Sat, 14 Nov 2009 17:32:49 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id 0C85D170C578 for ; Sat, 14 Nov 2009 14:32:48 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAEJWltj016245 for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 14:32:47 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Sat, 14 Nov 2009 14:32:47 -0500 From: Sean Conner To: Lua list Subject: Re: UDP Broadcast Message-ID: <20091114193247.GA13988@brevard.conman.org> References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Clark Snowdall once stated: > Everyone, > > Thanks for the suggestions ... some of them were helpful. > > I've done some more exploration, and I think the issue is I can't send > a UDP broadcast packet. I can see non-broadcast packets, but when I > select the ip address for broadcast, it doesn't show up. Could it be > something with my router? Or lua UDP doesn't really like broadcast? > Any suggestions? If you want to send a broadcast packet, you need to set an option on the socket to do so. In C (under Unix) this would be: rc = setsockopt(sock,SOL_SOCKET,SO_BROADCAST,&dummy,sizeof(dummy)); if (rc < 0) { perror("setsockopt(SO_BROADCAST)"); return(EXIT_FAILURE); } You'll need to find the equivilent under the Lua library you are using. -spc From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 17:44:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEJipfA020692; Sat, 14 Nov 2009 17:44:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 316971929D; Sat, 14 Nov 2009 17:44:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from brevard.conman.org (brevard.conman.org [66.252.224.242]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6EF20190AC for ; Sat, 14 Nov 2009 17:44:22 -0200 (BRST) Received: from brevard.conman.org (localhost [127.0.0.1]) by brevard.conman.org (Postfix) with ESMTP id A9327170C578 for ; Sat, 14 Nov 2009 14:44:21 -0500 (EST) Received: (from spc@localhost) by brevard.conman.org (8.13.1/8.13.1/Submit) id nAEJiLEJ018405 for lua@bazar2.conectiva.com.br; Sat, 14 Nov 2009 14:44:21 -0500 X-Authentication-Warning: brevard.conman.org: spc set sender to sean@conman.org using -f Date: Sat, 14 Nov 2009 14:44:21 -0500 From: Sean Conner To: Lua list Subject: Re: UDP Broadcast Message-ID: <20091114194421.GB13988@brevard.conman.org> References: <75546249-D327-4038-B3C9-E9A937F349FF@mac.com> <4AFC7B73.9060708@elbitsystems-us.com> <17eac67c0911121701r459b74aegace727abca85c584@mail.gmail.com> <17eac67c0911121703w222b6d2fm10a34978b1f1c99d@mail.gmail.com> <20091114193247.GA13988@brevard.conman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091114193247.GA13988@brevard.conman.org> User-Agent: Mutt/1.4.1i X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean It was thus said that the Great Sean Conner once stated: > It was thus said that the Great Clark Snowdall once stated: > > Everyone, > > > > Thanks for the suggestions ... some of them were helpful. > > > > I've done some more exploration, and I think the issue is I can't send > > a UDP broadcast packet. I can see non-broadcast packets, but when I > > select the ip address for broadcast, it doesn't show up. Could it be > > something with my router? Or lua UDP doesn't really like broadcast? > > Any suggestions? > > If you want to send a broadcast packet, you need to set an option on the > socket to do so. In C (under Unix) this would be: > > rc = setsockopt(sock,SOL_SOCKET,SO_BROADCAST,&dummy,sizeof(dummy)); > if (rc < 0) > { > perror("setsockopt(SO_BROADCAST)"); > return(EXIT_FAILURE); > } > > You'll need to find the equivilent under the Lua library you are using. I checked back and I see you are setting the broadcast flag. I checked an old project of mine (testing broadcast UDP packets) and I see that in the server side I have: local = "10.0.0.3:2020"; /* well, these are actually struct sockaddr */ remote = "10.0.0.255:2020"; /* but you get the idea ... */ sock = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP); setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&dummy,sizeof(dummy)); setsockopt(sock,SOL_SOCKET,SO_BROADCAST,&dummy,sizeof(dummy)); bind(sock,&local,sizeof(local)); while(1) { sendto(sock,data,sizeof(data),0,&remote,sizeof(remote)); } And oddly enough, in the client side: local = "10.0.0.2:2020"; sock = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP); setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&dummy,sizeof(dummy)); setsockopt(sock,SOL_SOCKET,SO_BROADCAST,&dummy,sizeof(dummy)); bind(sock,&local,sizeof(local)); while(1) { recvfrom(sock,&data,sizeof(data),0,&remote,&dum); } It looks like you need to set the recieving socket with the broadcast option as well. -spc From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 17:46:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEJjx5P020849; Sat, 14 Nov 2009 17:45:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68F191936F; Sat, 14 Nov 2009 17:45:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECC9A192E2 for ; Sat, 14 Nov 2009 17:45:33 -0200 (BRST) Received: by bwz27 with SMTP id 27so4508450bwz.21 for ; Sat, 14 Nov 2009 11:45:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=+0h3eF/xjXghWH4OQseMQdNhv7La/Bju7L+lwFYdHe8=; b=DSoEqq8lH2kTkKUUsOA1aHzildDVlWQBA5uSosDS1iSKG3LlDlcEHE7BkpjhMRSLoy HO9yoc4vfawMxdbgBacT51yWiimC60PyH37wV09RNj4/8o3zZab4+KDoXuQHzYkJXQEF vNGu3NQtaDMLChh77D8bpoxmFT5yRN5XoXXG4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SvWjJ3IJewzQhq+zfJEdSO+sOuBQnQj9doJc7QkNxJ/7RLAaXlrA4UOBQV9SvO/aoC ZCLOADzFPknWqnYRv09SBHBKo9zODnffBAOvlo1NulIVYeLWwujxFNn6CnaFwRztbnlT VCDUZn4NXLKKPpUNscvNwCUZ2mk8HjPSYaQHE= MIME-Version: 1.0 Received: by 10.216.90.137 with SMTP id e9mr1830861wef.141.1258227930857; Sat, 14 Nov 2009 11:45:30 -0800 (PST) Date: Sat, 14 Nov 2009 20:45:30 +0100 Message-ID: Subject: Reproducible floating point arithmetic in LuaJIT 2 From: Erik Lindroos To: Lua list Content-Type: multipart/alternative; boundary=0016e6d99cd7dd852404785a045f X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d99cd7dd852404785a045f Content-Type: text/plain; charset=ISO-8859-1 Hello, I'm trying to patch in reproducible (strictly IEEE 754) floating point arithmetic in LuaJIT 2. Only the interpreter is really affected as far as I can tell, since the JIT uses SSE2 exclusively. To patch the interpreter, I need to store some constants to scale down and up x87 floating point regs before/after multiplication and division. However, while patching lj_vm_foldarith, I noticed DynASM doesn't seem to relocate loads from globals correctly, e.g.: | ->x87_scaledown: | .byte 0,0,0,0,0,0,0,128,255,3 | fld tword [->x87_scaledown] This turns into a load from a bogus address, while calls to global labels are clearly relocated correctly. How would I solve this without e.g. writing the constant to the stack and load it from there every time? Sincerely, Erik Lindroos --0016e6d99cd7dd852404785a045f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I'm trying to patch in reproducible (strictly IEEE 754) f= loating point arithmetic in LuaJIT 2. Only the interpreter is really affect= ed as far as I can tell, since the JIT uses SSE2 exclusively.
To patch t= he interpreter, I need to store some constants to scale down and up x87 flo= ating point regs before/after multiplication and division.
However, while patching lj_vm_foldarith, I noticed DynASM doesn't seem = to relocate loads from globals correctly, e.g.:

|=A0 ->x87_scaled= own:
|=A0 .byte 0,0,0,0,0,0,0,128,255,3

|=A0 fld tword [->x87_= scaledown]

This turns into a load from a bogus address, while calls to global labe= ls are clearly relocated correctly.

How would I solve this without e= .g. writing the constant to the stack and load it from there every time?
Sincerely,
Erik Lindroos
--0016e6d99cd7dd852404785a045f-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 18:31:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEKVjjS024017; Sat, 14 Nov 2009 18:31:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 45904192A8; Sat, 14 Nov 2009 18:31:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D903519271 for ; Sat, 14 Nov 2009 18:31:14 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEKVD2k023970 for ; Sat, 14 Nov 2009 18:31:13 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAEKVBa14812; Sat, 14 Nov 2009 18:31:11 -0200 Date: Sat, 14 Nov 2009 18:31:11 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: Cannot redirect stderr Message-ID: <20091114183111.A14809@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from superatropo@gmail.com on Fri, Nov 13, 2009 at 02:24:16PM +0100 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > out = freopen("out.txt", "w", stdout); > err = freopen("err.txt", "w", stderr); > > luaL_dostring(L, "print(\"test1\")"); > luaL_dostring(L, "error(\"test2\")"); The Lua core does not write to stderr. (For that matter, it does not write at all.) Try checking the return value of luaL_dostring. If it's not 0, then the error message is at the top of the stack and you can print it where you like it. From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 18:52:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEKqNpY026147; Sat, 14 Nov 2009 18:52:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 771DF19373; Sat, 14 Nov 2009 18:52:03 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C7300192C7 for ; Sat, 14 Nov 2009 18:51:58 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAEKpwLe025892 for ; Sat, 14 Nov 2009 18:51:58 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 8AA2154C03F; Sat, 14 Nov 2009 18:51:58 -0200 (BRST) Date: Sat, 14 Nov 2009 18:51:58 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: [PATCH] Re: The Lua interpreter and large scripts Message-ID: <20091114205158.GA27459@inf.puc-rio.br> References: <20091111225237.GA13831@brevard.conman.org> <200911131822.11858.bobby@sharedrealm.com> <20091114123834.GA6490@inf.puc-rio.br> <200911140504.19697.bobby@sharedrealm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911140504.19697.bobby@sharedrealm.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Are you doing a full/step GC on each allocation? Also is the GC only called > during allocations where newsize > oldsize or on every call to 'l_alloc()'? Only when newsize > oldsize (that is, "real" allocations). Lua assumes that the allocator cannot fail when newsize <= oldsize, so the emergency collector will never be called in those cases. -- Roberto From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 18:54:09 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEKs6sm026279; Sat, 14 Nov 2009 18:54:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5329E1938C; Sat, 14 Nov 2009 18:53:49 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF67A19375 for ; Sat, 14 Nov 2009 18:53:43 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N9Pcs-0004ab-00; Sat, 14 Nov 2009 21:53:42 +0100 Date: Sat, 14 Nov 2009 21:53:24 +0100 From: Mike Pall To: Lua list Subject: Re: Reproducible floating point arithmetic in LuaJIT 2 Message-ID: <20091114205324.GA24540@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Erik Lindroos wrote: > I'm trying to patch in reproducible (strictly IEEE 754) floating point > arithmetic in LuaJIT 2. Only the interpreter is really affected as far as I > can tell, since the JIT uses SSE2 exclusively. The interpreter stores all intermediate results to stack slots, i.e. to IEEE 754 double precision FP numbers. This is equivalent to the -ffloat-store option of GCC or Java with strictfp. This does not solve the double rounding problem, though. > To patch the interpreter, I need to store some constants to scale down and > up x87 floating point regs before/after multiplication and division. Wouldn't it be easier to modify the interpreter to use SSE2, too? I could certainly add a compile-time option to select either of the two code paths (like the -DLUAJIT_CPU_NOCMOV option). [BTW: That still doesn't solve the various issues with the x87 transcendental functions or with pow().] > However, while patching lj_vm_foldarith, I noticed DynASM doesn't seem to > relocate loads from globals correctly, e.g.: DynASM does not deal with relocation. It's the driver program that's responsible for this (i.e. buildvm for LJ2). I simply didn't bother to add relocations for internal data references. It wouldn't be a real solution, anyway, because this doesn't work in a shared library or would necessitate text-relocations (which is frowned upon in many distros). And I really don't want to add GOT-relocations, since this is quite system-specific. > How would I solve this without e.g. writing the constant to the stack and > load it from there every time? The current interpreter is pure position-independent code and I want to keep it that way. I've used loads from upvalues or construction of constants on the stack to get around these limitations in some cases. I think this is fast enough. If you really need this to be maximally fast, I'd keep them in the global_State, which can be addressed via the DISPATCH register. But IMHO the better solution is to (optionally) use SSE2 in the interpreter, too. The intersection of the set of people who still have an x87-only box and the set of people who really need reproducible FP arithmetic is probably empty. --Mike From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 19:17:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAELHu9i028036; Sat, 14 Nov 2009 19:17:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18ED619375; Sat, 14 Nov 2009 19:17:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 21B4818CAD for ; Sat, 14 Nov 2009 19:17:22 -0200 (BRST) Received: by fxm21 with SMTP id 21so1590817fxm.21 for ; Sat, 14 Nov 2009 13:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=UIHR7GAKZ8OhLlZgmWlcWjhzGlA+K8yvykpZyCfa9ac=; b=bPmJoXNLoaHW3V8LzT3BB0MTUM0txL99bHp6i+62WnH0Ca96Jqfm9Afhez6EeVKBgM jv4c8qMcVq8q934ssqyTtrtmrMJsIXE7zYEay9oskV4zCFQc+W/9JU+Wf1cN1TlLoeug GnftLBPxY74evVMyzg6DQvRX7Gla1ODt49kFA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qKMjBYpaPoaF5CUB5B7/49AQvwkN50DpVcec9IVfwXZCmeyFpSXodz6nvU1kQ7XEae RDDcEo0S4IVNXhZPcLUZfiSBxShYaRlIgdHa86v5uzbCXhxvXPMd7G/PQscqJ4NmiWNG LxbKWexGEoWA+gO6Lm3xVbY1uXLrM1gHU1v6o= MIME-Version: 1.0 Received: by 10.216.90.198 with SMTP id e48mr210453wef.188.1258233441302; Sat, 14 Nov 2009 13:17:21 -0800 (PST) In-Reply-To: <20091114205324.GA24540@mike.de> References: <20091114205324.GA24540@mike.de> Date: Sat, 14 Nov 2009 22:17:21 +0100 Message-ID: Subject: Re: Reproducible floating point arithmetic in LuaJIT 2 From: Erik Lindroos To: Lua list Content-Type: multipart/alternative; boundary=0016e6dab70c50394104785b4dcc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6dab70c50394104785b4dcc Content-Type: text/plain; charset=ISO-8859-1 On Sat, Nov 14, 2009 at 9:53 PM, Mike Pall wrote: > The interpreter stores all intermediate results to stack slots, > i.e. to IEEE 754 double precision FP numbers. This is equivalent > to the -ffloat-store option of GCC or Java with strictfp. > > This does not solve the double rounding problem, though. > Indeed, that's what the down/up scaling is for. [BTW: That still doesn't solve the various issues with the x87 > transcendental functions or with pow().] > Yes, I will replace them with fdlibm derivatives. > The current interpreter is pure position-independent code and I > want to keep it that way. I've used loads from upvalues or > construction of constants on the stack to get around these > limitations in some cases. I think this is fast enough. If you > really need this to be maximally fast, I'd keep them in the > global_State, which can be addressed via the DISPATCH register. > Ah, I considered this, but DISPATCH isn't available in lj_vm_foldarith, right? Although, lj_vm_foldarith doesn't need to be very fast anyway. But IMHO the better solution is to (optionally) use SSE2 in the > interpreter, too. The intersection of the set of people who still > have an x87-only box and the set of people who really need > reproducible FP arithmetic is probably empty. > I agree it's almost not worth the bother, but I'd like to keep things as portable as possible unless it's a large effort. My particular application right now is something similar to http://love2d.org/ but with an easy network synchronization mechanism (which is what I need reproducible floating point for). Thank you, Erik Lindroos --0016e6dab70c50394104785b4dcc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Sat, Nov 14, 2009 at 9:53 PM, Mike Pall <mikelu-0911@mike.de= > wrote:
The interpreter stores all intermediate results to stack slots,
i.e. to IEEE 754 double precision FP numbers. This is equivalent
to the -ffloat-store option of GCC or Java with strictfp.

This does not solve the double rounding problem, though.

Indeed, that's what the down/up scaling is for.

[BTW: That still doesn't solve the various issues with the x87
transcendental functions or with pow().]

Yes, I wi= ll replace them with fdlibm derivatives.
=A0
The current interpreter is pure position-independent code and I
want to keep it that way. I've used loads from upvalues or
construction of constants on the stack to get around these
limitations in some cases. I think this is fast enough. If you
really need this to be maximally fast, I'd keep them in the
global_State, which can be addressed via the DISPATCH register.

Ah, I considered this, but DISPATCH isn't available in lj= _vm_foldarith, right?
Although, lj_vm_foldarith doesn't need to be v= ery fast anyway.

But IMHO the better solution is to (optionally) use SSE2 in the
interpreter, too. The intersection of the set of people who still
have an x87-only box and the set of people who really need
reproducible FP arithmetic is probably empty.

I ag= ree it's almost not worth the bother, but I'd like to keep things a= s portable as possible unless it's a large effort.
My particular app= lication right now is something similar to h= ttp://love2d.org/ but with an easy network synchronization
mechanism (which is what I need reproducible floating point for).
=

Thank you,
Erik Lindroos
--0016e6dab70c50394104785b4dcc-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 19:18:29 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAELIQd8028111; Sat, 14 Nov 2009 19:18:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66237193A8; Sat, 14 Nov 2009 19:18:02 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C1ED418CAD for ; Sat, 14 Nov 2009 19:17:57 -0200 (BRST) Received: by yxe17 with SMTP id 17so3828191yxe.33 for ; Sat, 14 Nov 2009 13:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=LJhIPqRhnPXhorHMpsAil3UrPwO70eZrfGhDNdiD2Ac=; b=bJGDEVexVtCh8ltPGHrPvydwCLBv59BAm8QZRb+2XdHNw95zgSp3mU9Rx6GtXnFANY OCFwueLNzOq829cu0lawyapJ8FhDkm715Ep4qeRJzq/y6SBddwUXEDSlOmwNa3KJfSH6 BuEseNa9jDnF80O1McbFfo0Uj3rig4JHMr1zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=xIudTruT2ujea18LbV1QY0hH16VPRx6dq6OQB2vUxjKJrcp376c/4b7EG9kPBz4q3k vp4lmJFghbFz2x3248vlnJ23B4LlocDXm19PjSTcZjP3sCrMH4BgrojNhINVkmmooFo9 MH2lFVgF4nIk8IomSdT+KbC0OZ6NhHxlhwzDE= MIME-Version: 1.0 Received: by 10.101.138.21 with SMTP id q21mr1804835ann.23.1258233476042; Sat, 14 Nov 2009 13:17:56 -0800 (PST) Date: Sat, 14 Nov 2009 21:17:56 +0000 Message-ID: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> Subject: Down-casting a C object to a Lua object From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=0016e68fcde5624fd004785b4f85 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e68fcde5624fd004785b4f85 Content-Type: text/plain; charset=ISO-8859-1 In short, does anyone know the Lua equivalent of the C++ code: DerivedClass d = (DerivedClass)baseClass; ? But only using Lua code, no C++. The base class object already has loads of things in it that I need in the derived class. I don't believe I can just use table.copy(t) because I don't think that gets everything. I've been stuck on this for days trying a variety of approaches. Any ideas? Thanks :) --0016e68fcde5624fd004785b4f85 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
In short, does anyone know the Lua equivalent of the C++ code:
DerivedClass d =3D (DerivedClass)baseClass;
?
But on= ly using Lua code, no C++.

The base class object a= lready has loads of things in it that I need in the derived class. I don= 9;t believe I can just use table.copy(t) because I don't think that get= s everything. I've been stuck on this for days trying a variety of appr= oaches.=A0Any ideas?

Thanks :)
--0016e68fcde5624fd004785b4f85-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 19:32:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAELWXND029063; Sat, 14 Nov 2009 19:32:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D904C191B7; Sat, 14 Nov 2009 19:32:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D614B1912F for ; Sat, 14 Nov 2009 19:32:04 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1393700eye.39 for ; Sat, 14 Nov 2009 13:32:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.96.83 with SMTP id g19mr3705157ebn.20.1258234322317; Sat, 14 Nov 2009 13:32:02 -0800 (PST) In-Reply-To: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> References: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> Date: Sat, 14 Nov 2009 21:32:02 +0000 X-Google-Sender-Auth: 5608e055db708a10 Message-ID: Subject: Re: Down-casting a C object to a Lua object From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAELWXND029063 Lua doesn't have any class or inheritance system built in, so it'll be hard to give an answer without first knowing what implementation of a class system you are using. On Sat, Nov 14, 2009 at 9:17 PM, Colm Sloan wrote: > In short, does anyone know the Lua equivalent of the C++ code: > DerivedClass d = (DerivedClass)baseClass; > ? > But only using Lua code, no C++. > The base class object already has loads of things in it that I need in the > derived class. I don't believe I can just use table.copy(t) because I don't > think that gets everything. I've been stuck on this for days trying a > variety of approaches. Any ideas? > Thanks :) From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 19:54:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAELsl7M030487; Sat, 14 Nov 2009 19:54:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7F928191F2; Sat, 14 Nov 2009 19:54:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CCB6E190FC for ; Sat, 14 Nov 2009 19:54:18 -0200 (BRST) Received: by fxm21 with SMTP id 21so1605619fxm.21 for ; Sat, 14 Nov 2009 13:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=yOin328USaQPTrpHUrMKkTRkRjCqpQo9qMoE9EGznOA=; b=S4ldKkuL6Vz//nKvEtIbjlrdjC2xPdZjuRgCApOVJnbKwMjho2JWaDhigilRDF208K 7Sd/XYpdN/Fn0V8AluXn66ZJLyxA4aw0BUJdowUSm6OpuW1PCmFi0MsnyhDomMmdIXwy 7T5KPCmjRfEW6ebnFzsMbBy+wIQ35FzgnmpXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=PwhL/afuXp19qt4DOCutDwxoOu2RZ/z0bpTlehWs4my2PHyyUgT2bSeSNfVsEONKri pBfL2qzwOTCTlxCIXc39JqDqKhzqhca4Goy1pxF+8n6P5cHLrxznGQn3YBaz12gktwsW aCSiLs9F1EHCHBb7TtpfhBqijvlg6aLieRuKw= MIME-Version: 1.0 Received: by 10.204.162.204 with SMTP id w12mr5199225bkx.18.1258235656104; Sat, 14 Nov 2009 13:54:16 -0800 (PST) In-Reply-To: References: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> From: Matthew Wild Date: Sat, 14 Nov 2009 21:53:56 +0000 Message-ID: <4db9cacb0911141353i356d390flf5865e685648a346@mail.gmail.com> Subject: Re: Down-casting a C object to a Lua object To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean 2009/11/14 Peter Cawley : > Lua doesn't have any class or inheritance system built in, so it'll be > hard to give an answer without first knowing what implementation of a > class system you are using. > > On Sat, Nov 14, 2009 at 9:17 PM, Colm Sloan wrote: >> In short, does anyone know the Lua equivalent of the C++ code: >> DerivedClass d = (DerivedClass)baseClass; >> ? >> But only using Lua code, no C++. >> The base class object already has loads of things in it that I need in the >> derived class. I don't believe I can just use table.copy(t) because I don't >> think that gets everything. It also doesn't have a table.copy()... Matthew PS. Peter Cawley top-posting, what is the world coming to? :) From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 20:05:50 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEM5lb5031330; Sat, 14 Nov 2009 20:05:47 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A6F1191C8; Sat, 14 Nov 2009 20:05:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4B8B18E5E for ; Sat, 14 Nov 2009 20:05:21 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N9QkC-0004dX-00; Sat, 14 Nov 2009 23:05:20 +0100 Date: Sat, 14 Nov 2009 23:04:55 +0100 From: Mike Pall To: Lua list Subject: Re: Reproducible floating point arithmetic in LuaJIT 2 Message-ID: <20091114220455.GA29491@mike.de> References: <20091114205324.GA24540@mike.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Erik Lindroos wrote: > [BTW: That still doesn't solve the various issues with the x87 > > transcendental functions or with pow().] > > Yes, I will replace them with fdlibm derivatives. Be careful about spilled registers when calling C functions. I've already added generic C call handling for compiled code, so you may want to wait for the next developer snapshot or the next beta before adding this. > Ah, I considered this, but DISPATCH isn't available in lj_vm_foldarith, > right? > Although, lj_vm_foldarith doesn't need to be very fast anyway. Yes, it's not available there and yes, performance of this function is not relevant. > > But IMHO the better solution is to (optionally) use SSE2 in the > > interpreter, too. The intersection of the set of people who still > > have an x87-only box and the set of people who really need > > reproducible FP arithmetic is probably empty. > > I agree it's almost not worth the bother, but I'd like to keep things as > portable as possible unless it's a large effort. Well, I'll need this for the x64 port, anyway. And only a dozen lines need to be changed (ignoring the transcendental functions). --Mike From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 20:14:33 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEMEUa4031913; Sat, 14 Nov 2009 20:14:30 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 02785193A5; Sat, 14 Nov 2009 20:14:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9010818E78 for ; Sat, 14 Nov 2009 20:14:00 -0200 (BRST) Received: by yxe17 with SMTP id 17so3846307yxe.33 for ; Sat, 14 Nov 2009 14:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bvYZVOpQq6ooeGqsCFPMuTvCS/Qw+c7nmfm70MRMxjk=; b=lIK5NvI8dECvA2bpNyCDkiaiK1ly6sO6X4STBEFw7+/JtdU/VE0h2ATki2a5JmHNhK 7VRY4aGZtNCV0Q5GlG+GUZE+yjkelUz9XpUx6ftkuGa2WzWarNXIFy9WeK/BzR+Zt20P B8Cv+8mJoPs5Pp2wtNUt2DJTI9h9AC8mgJ57g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=sG83FYpFLPe+gVqHMhm6HstdZ6w9aPRyVhDO2qzYx7uNf29nawt/CzcgNIQ0bVFaWb x0RkZILNKyPOTS+gdB6UMElr+eVtBshbM5evB7meJWitsdHr/yYbtuJpmW7lt/Ljxlh+ Swc6Km6ui+3vwGTT2ADjz209MN6uWEILiHDMg= MIME-Version: 1.0 Received: by 10.100.60.18 with SMTP id i18mr1682854ana.92.1258236838457; Sat, 14 Nov 2009 14:13:58 -0800 (PST) In-Reply-To: References: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> Date: Sat, 14 Nov 2009 22:13:58 +0000 Message-ID: <86a6bb870911141413x5822b9cdo5fb5e30617792910@mail.gmail.com> Subject: Re: Down-casting a C object to a Lua object From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=001485f6d596ccb3f704785c1762 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f6d596ccb3f704785c1762 Content-Type: text/plain; charset=ISO-8859-1 Sorry. I haven't used Lua for this kind of thing before so I'm not sure which details would be of use. I'll rename the classes for simplicity. I have a 'Person' class which exists entirely in C++. The Person setup function gives each Person lots of base values. I would like to be able to make a new class type, Solider, which is derived from Person. I want Soldier to exist entirely in Lua. Here's the bones of what I'm talking about: class 'Soldier' ( Person ) function Soldier:__init() end function Soldier:Setup() end function Soldier:Update() end The strange setup used in the program prevents me from doing something as simple as: function Soldier:Setup() self:PersonSetup() -- where all of the things would be set end Instead, I have to make a Person first in C++ and then cast it to a Soldier later with Lua like: //c++ void Person::Setup() { // set all Person things (there are a lot) //call Lua to make a new Soldier (__init) //try to fill that blank soldier with the values from this person but retain Soldier's Lua functions --this is the part I can't figure out } In C++, it'd just be a simple downcast like: Soldier s = (Soldier)thisPerson but I can't do that with a pure Lua class like Soldier because there is no C++ Soldier class, only a Lua one. I'm wondering how to get the data from the Person base class into the newly created blank Lua Soldier class. I hope they're the details you're looking for. I could really use any help anyone can offer on this. --001485f6d596ccb3f704785c1762 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry. I haven't used Lua for this kind of thing before so I'm not = sure which details would be of use.

I'll rename the = classes for simplicity. I have a 'Person' class which exists entire= ly in C++. The Person setup function gives each Person lots of base values.= I would like to be able to make a new class type, Solider, which is derive= d from Person. I want Soldier to exist entirely in Lua. Here's the bone= s of what I'm talking about:

class 'Soldier' ( Person )

<= /div>
function Soldier:__init()

end
=
function=A0Soldier:Setup()

end

function=A0Soldier:Update()

en= d

The strange setup used in the program prevents m= e from doing something as simple as:

function= =A0Soldier:Setup()
=A0=A0 =A0 self:PersonSetup() -- where all of the things would be set<= /div>
end

Instead, I have to make a Person fir= st in C++ and then cast it to a Soldier later with Lua like:
//c+= +
void Person::Setup()
{
=A0=A0 =A0 // set all Perso= n things (there are a lot)
=A0=A0 =A0=A0
=A0=A0 =A0 //c= all Lua to make a new Soldier (__init)
=A0=A0 =A0 //try to fill t= hat blank soldier with the values from this person but retain Soldier's= Lua functions --this is the part I can't figure out
}

In C++, it'd just be a simple downcast = like:
Soldier s =3D=A0(Soldier)thisPerson

but I can't do that with a pure Lua class like Soldier because there = is no C++ Soldier class, only a Lua one. I'm wondering how to get the d= ata from the Person base class into the newly created blank Lua Soldier cla= ss.

I hope they're the details you're looking for. = I could really use any help anyone can offer on this.
--001485f6d596ccb3f704785c1762-- From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 20:31:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEMVrCb000622; Sat, 14 Nov 2009 20:31:53 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5085E193BA; Sat, 14 Nov 2009 20:31:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBCE0192D0 for ; Sat, 14 Nov 2009 20:31:24 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1407057eye.39 for ; Sat, 14 Nov 2009 14:31:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.109.69 with SMTP id i5mr3670947ebp.11.1258237882894; Sat, 14 Nov 2009 14:31:22 -0800 (PST) In-Reply-To: <86a6bb870911141413x5822b9cdo5fb5e30617792910@mail.gmail.com> References: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> <86a6bb870911141413x5822b9cdo5fb5e30617792910@mail.gmail.com> Date: Sat, 14 Nov 2009 22:31:22 +0000 X-Google-Sender-Auth: 8bea5ea4f3fb6ac2 Message-ID: Subject: Re: Down-casting a C object to a Lua object From: Peter Cawley To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sat, Nov 14, 2009 at 10:13 PM, Colm Sloan wrote: > Sorry. I haven't used Lua for this kind of thing before so I'm not sure > which details would be of use. While the details you have given are useful, I'll re-iterate my point. Lua by default does not have any notion of classes, hence you must be using some variant or Lua, or addition to Lua, which adds a class system to Lua. At a guess, it looks like you are using luabind, but there are many other ways in which you can add a class system to Lua, and we need to know which one you are using (I assume you haven't written your own class system). From lua-bounces@bazar2.conectiva.com.br Sat Nov 14 20:52:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAEMqprf001949; Sat, 14 Nov 2009 20:52:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AB157190F9; Sat, 14 Nov 2009 20:52:26 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4D57318FF0 for ; Sat, 14 Nov 2009 20:52:21 -0200 (BRST) Received: by yxe17 with SMTP id 17so3858453yxe.33 for ; Sat, 14 Nov 2009 14:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=VVS8/RIkey3KnV737OQrcYLeaSOZIGH9jML6bOzazeg=; b=rPQYguXENTJfS3oIvtx56OhN75R88YCm8BdfN0Qzh3lcyaX6zAIzVNbFdskFAvdSrM 1+n6VXDwXSp4GUnbe2xpmxcaN3u6fpsCT/LtiQ78fw+BGYdzhZLy48nqeBH9JkbPX56C ihLjDHiRWK83K5gCRNqR9QlIko5KVa69hAOo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=unZ7yop19tfPQOJFRSaQZpt8bBzfTWNVyGmEr0XskKpVPsLHJbGIoRFkAx0i+cxDg9 92/gwdUN7OnxOTAhXQFIVhv7+GWiD0Xhdfb2VLclil+5Wlt1IFr0ZoscPSOgRsKOPfXM DcwDDc5lyoVQE0K94eppv9UtyrhfyTYb6K+tY= MIME-Version: 1.0 Received: by 10.101.169.26 with SMTP id w26mr2775886ano.5.1258239140108; Sat, 14 Nov 2009 14:52:20 -0800 (PST) In-Reply-To: References: <86a6bb870911141317n35bf6930sa6984488b1719fc0@mail.gmail.com> <86a6bb870911141413x5822b9cdo5fb5e30617792910@mail.gmail.com> Date: Sat, 14 Nov 2009 22:52:20 +0000 Message-ID: <86a6bb870911141452s34f6811dk72aeb75ca11a32ba@mail.gmail.com> Subject: Re: Down-casting a C object to a Lua object From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=001636d33e14fd1af504785ca088 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636d33e14fd1af504785ca088 Content-Type: text/plain; charset=ISO-8859-1 No, sorry. You're right. I'm using LuaBind. I'm amazed you figured that out from my post. Here's my most recent attempt: void Person::Setup( void ) { const char* className = m_LuaClassName;//"Soldier"; // trying to make a function on the fly to give me an empty object of specified Lua type char functionCode[ 384 ]; strcpy( functionCode, "function GetLuaVersion()\n" ); // assemble the line "return Class()" char returnClassLine[ 256 ]; strcpy( returnClassLine, "return " ); strcat( returnClassLine, className ); strcat( returnClassLine, "()\n" ); strcat( functionCode, returnClassLine ); strcat( functionCode, "end\n" ); luaL_dostring( L, functionCode ); //get the new 'Soldier' object m_LuaClassObject = luabind::call_function( GetLuaHandle()->GetLua(), "GetLuaVersion" ); //several attempts at moving the data from this (Person) into the Lua Soldier on the following lines luabind::call_member( m_LuaClassObject, "Setup" ); } --001636d33e14fd1af504785ca088 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable No, sorry. You're right. I'm using LuaBind. I'm amazed you figu= red that out from my post. Here's my most recent attempt:

=
void Person::Setup( void )
{
const char* className =3D m_Lua= ClassName;//"Soldier";
// trying to make a function= on the fly to give me an empty object of specified Lua type<= /div>
char function= Code[ 384 ];
strcpy( functionCode, "function GetLuaVersion()\n" )= ;

// assemble the line "return Class()"
char returnClassL= ine[ 256 ];
strcp= y( returnClassLine, "return " );
strcat( returnClassLine, classNa= me );
strca= t( returnClassLine, "()\n" );
strcat( functionCode, returnClassLi= ne );
strca= t( functionCode, "end\n" );

luaL_dostring(
<= div> L,
funct= ionCode
= );

//get the new 'Soldier' object
m_Lua= ClassObject =3D luabind::call_function<luabind::object>( GetLuaHandle= ()->GetLua(), "GetLuaVersion" );

//several a= ttempts at moving the data from this (Person) into the Lua Soldier on the f= ollowing lines
luabi= nd::call_member<void>( m_LuaClassObject, "Setup" );
}
--001636d33e14fd1af504785ca088-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 01:12:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAF3CkJs022095; Sun, 15 Nov 2009 01:12:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9C19D1936B; Sun, 15 Nov 2009 01:12:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 099BF192B3 for ; Sun, 15 Nov 2009 01:12:08 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id e12so665755fga.17 for ; Sat, 14 Nov 2009 19:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2pTuUO5bIe0eN8PORDxvb3xm8zXurg7fu283zIFPu8A=; b=hcNJitlQm8+bBqDmDRojh/M5+Gdhs1uzTD8/GfIpQnlIhKev53lz7cLyTv8G8VTin7 613VrF+cmn3D9/GHbtudYmIP7UdYmNevGl+Db0QJ3iREuBSxQSy8M0mOejkSQqG18aJN QNXS8AbLjzJspp6rX479cwDFXcJ7ia3YIua2c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZzOm0VIlH5E7aXnDvWaM4o7OCHveuIhRwvMb76YF6xGLCvoNqXsy7G2HMQhRbMopL3 vD8O3STfwKa74u/pY/Zd0B8zngRWpyl3PXVCCmrf0U5+AmoHy3JAuFbUyF0IM9xbS2Jm b4FuGjU17pXY3vUKj2EKyWeHOOLN0jutkFxHw= MIME-Version: 1.0 Received: by 10.223.21.15 with SMTP id h15mr934907fab.15.1258254726183; Sat, 14 Nov 2009 19:12:06 -0800 (PST) In-Reply-To: <4AFBFE87.7040100@objmedia.demon.co.uk> References: <560972290911120316yb0043e3i8bf39fa387814c54@mail.gmail.com> <4AFBF905.3020004@cowlark.com> <4AFBFE87.7040100@objmedia.demon.co.uk> Date: Sun, 15 Nov 2009 03:12:05 +0000 Message-ID: <6a3ae47e0911141912g717159abx18f7261da1290fe7@mail.gmail.com> Subject: Re: Coroutines and Go From: Robert Raschke To: Lua list Content-Type: multipart/alternative; boundary=0015174765b0fdbcd90478604126 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0015174765b0fdbcd90478604126 Content-Type: text/plain; charset=UTF-8 On Thu, Nov 12, 2009 at 12:24 PM, Stephen Kellett wrote: > They seem proud of not having enumerations. I'd have thought the dreadful > mistake of omitting them from Java (which has now added them back into the > language) had been learned by now. "iota" seems to be a passing nod to the > concept of monotonically increasing values (which is how most enums, but not > all, work). > Hmm, enums and iota, that rings a bell, ah yes, Limbo (from Inferno): http://www.vitanuova.com/inferno/papers/limbo.html (see section 6.2 Constant declarations) Rather elegant! Robby --0015174765b0fdbcd90478604126 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Nov 12, 2009 at 12:24 PM, Stephen Ke= llett <lua= @objmedia.demon.co.uk> wrote:
They seem proud of not having enumerations. I'd have thought the dreadf= ul mistake of omitting them from Java (which has now added them back into t= he language) had been learned by now. "iota" seems to be a passin= g nod to the concept of monotonically increasing values (which is how most = enums, but not all, work).

Hmm, enums and iota, that rings a bell, ah yes, Limbo= (from Inferno):

http://www.vitanuova.com/inferno/papers/limbo.html (see sec= tion 6.2 Constant declarations)

Rather elegant!

Robby

--0015174765b0fdbcd90478604126-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 01:30:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAF3UcqB023573; Sun, 15 Nov 2009 01:30:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0321719392; Sun, 15 Nov 2009 01:30:15 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4681B18DF1 for ; Sun, 15 Nov 2009 01:30:10 -0200 (BRST) Received: by iwn8 with SMTP id 8so3534918iwn.33 for ; Sat, 14 Nov 2009 19:30:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.170.201 with SMTP id e9mr788889ibz.17.1258255808599; Sat, 14 Nov 2009 19:30:08 -0800 (PST) Date: Sat, 14 Nov 2009 22:30:08 -0500 X-Google-Sender-Auth: 02c259e0730a5594 Message-ID: Subject: lua 1.0 patch - fixing compiler errors From: David Manura To: Lua list Content-Type: multipart/mixed; boundary=0050450181028233f104786082dc X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0050450181028233f104786082dc Content-Type: text/plain; charset=ISO-8859-1 Attached is a patch to allow Lua 1.0 to compile on gcc and msvc. Note that the changes in type.lua are to remove \r and ^Z chars causing failure. I'm not sure what floatingpoint.h was used for, but it seems safely removable. I didn't correct warnings: There's a warning about "void main" in gcc and additional warnings on msvc, plus more on gcc if -Wall is enabled. BTW, a CMake build with test suite is in [1], and it can also be deployed via "luadist install lua1". [1] http://repo.luadist.org/dists/LuaUtils/lua1/CMakeLists.txt --0050450181028233f104786082dc Content-Type: application/octet-stream; name="dist.patch" Content-Disposition: attachment; filename="dist.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g218284e0 ZGlmZiAtdXIgYS9pb2xpYi5jIGIvaW9saWIuYwotLS0gbHVhLTEuMC9pb2xpYi5jCTE5OTMtMDct MjggMDk6MTc6NTguMDAwMDAwMDAwIC0wNDAwCisrKyBiL2lvbGliLmMJMjAwOS0xMS0xNCAyMDo0 MjowNy4xMjUwMDAwMDAgLTA1MDAKQEAgLTEyLDEyICsxMiwxMiBAQAogI2luY2x1ZGUgPHN0ZGlv Lmg+CiAjaW5jbHVkZSA8Y3R5cGUuaD4KICNpZmRlZiBfX0dOVUNfXwotI2luY2x1ZGUgPGZsb2F0 aW5ncG9pbnQuaD4KKy8qICNpbmNsdWRlIDxmbG9hdGluZ3BvaW50Lmg+ICovCiAjZW5kaWYKIAog I2luY2x1ZGUgImx1YS5oIgogCi1zdGF0aWMgRklMRSAqaW49c3RkaW4sICpvdXQ9c3Rkb3V0Owor c3RhdGljIEZJTEUgKmluPU5VTEwsICpvdXQ9TlVMTDsKIAogLyoKICoqIE9wZW4gYSBmaWxlIHRv IHJlYWQuCkBAIC0zOTIsNiArMzkyLDggQEAKICovCiB2b2lkIGlvbGliX29wZW4gKHZvaWQpCiB7 CisgaW49c3RkaW47Cisgb3V0PXN0ZG91dDsKICBsdWFfcmVnaXN0ZXIgKCJyZWFkZnJvbSIsIGlv X3JlYWRmcm9tKTsKICBsdWFfcmVnaXN0ZXIgKCJ3cml0ZXRvIiwgIGlvX3dyaXRldG8pOwogIGx1 YV9yZWdpc3RlciAoInJlYWQiLCAgICAgaW9fcmVhZCk7CmRpZmYgLXVyIGEvbGV4X3l5LmMgYi9s ZXhfeXkuYwotLS0gYS9sZXhfeXkuYwkxOTkzLTA3LTI4IDA5OjEzOjMwLjAwMDAwMDAwMCAtMDQw MAorKysgYi9sZXhfeXkuYwkyMDA5LTExLTE0IDIwOjM2OjMwLjY1NjI1MDAwMCAtMDUwMApAQCAt MTcsNyArMTcsNyBAQAogaW50IHl5bW9yZmc7CiBleHRlcm4gY2hhciAqeXlzcHRyLCB5eXNidWZb XTsKIGludCB5eXRjaGFyOwotRklMRSAqeXlpbiA9IHtzdGRpbn0sICp5eW91dCA9IHtzdGRvdXR9 OworRklMRSAqeXlpbiA9IE5VTEwsICp5eW91dCA9IE5VTEw7CiBleHRlcm4gaW50IHl5bGluZW5v Owogc3RydWN0IHl5c3ZmIHsgCiAJc3RydWN0IHl5d29yayAqeXlzdG9mZjsKQEAgLTQyLDYgKzQy LDggQEAKIAogdm9pZCBsdWFfc2V0aW5wdXQgKElucHV0IGZuKQogeworIHl5aW4gPSBzdGRpbjsK KyB5eW91dCA9IHN0ZG91dDsKICBpbnB1dCA9IGZuOwogfQogCmRpZmYgLXVyIGEvb3Bjb2RlLmMg Yi9vcGNvZGUuYwotLS0gYS9vcGNvZGUuYwkxOTkzLTA3LTI4IDA5OjE3OjQ0LjAwMDAwMDAwMCAt MDQwMAorKysgYi9vcGNvZGUuYwkyMDA5LTExLTE0IDIwOjQwOjU4LjU3ODEyNTAwMCAtMDUwMApA QCAtOCw3ICs4LDcgQEAKICNpbmNsdWRlIDxzdGRsaWIuaD4KICNpbmNsdWRlIDxzdHJpbmcuaD4K ICNpZmRlZiBfX0dOVUNfXwotI2luY2x1ZGUgPGZsb2F0aW5ncG9pbnQuaD4KKy8qICNpbmNsdWRl IDxmbG9hdGluZ3BvaW50Lmg+ICovCiAjZW5kaWYKIAogI2luY2x1ZGUgIm9wY29kZS5oIgpkaWZm IC11ciBhL3R5cGUubHVhIGIvdHlwZS5sdWEKLS0tIGEvdHlwZS5sdWEJMTk5My0wNy0yOCAwOTox Nzo1NC4wMDAwMDAwMDAgLTA0MDAKKysrIGIvdHlwZS5sdWEJMjAwOS0xMS0xNCAyMToyOToyOC42 NTYyNTAwMDAgLTA1MDAKQEAgLTEsMzUgKzEsMzQgQEAKLSRkZWJ1Zw0KLQ0KLWZ1bmN0aW9uIGNo ZWNrIChvYmplY3QsIGNsYXNzKQ0KLSBsb2NhbCB2ID0gbmV4dChvYmplY3QsbmlsKTsNCi0gd2hp bGUgdiB+PSBuaWwgZG8NCi0gICBpZiBjbGFzc1t2XSA9IG5pbCB0aGVuIHByaW50KCJ1bmtub3du IGZpZWxkOiAiIC4uIHYpIA0KLSAgIGVsc2VpZiB0eXBlKG9iamVjdFt2XSkgfj0gY2xhc3Nbdl0u dHlwZSAgDQotICAgICB0aGVuIHByaW50KCJ3cm9uZyB0eXBlIGZvciBmaWVsZCAiIC4uIHYpDQot ICAgZW5kDQotICAgdiA9IG5leHQob2JqZWN0LHYpOw0KLSBlbmQNCi0gdiA9IG5leHQoY2xhc3Ms bmlsKTsNCi0gd2hpbGUgdiB+PSBuaWwgZG8NCi0gICBpZiBvYmplY3Rbdl0gPSBuaWwgdGhlbg0K LSAgICAgaWYgY2xhc3Nbdl0uZGVmYXVsdCB+PSBuaWwgdGhlbg0KLSAgICAgICBvYmplY3Rbdl0g PSBjbGFzc1t2XS5kZWZhdWx0DQotICAgICBlbHNlIHByaW50KCJmaWVsZCAiLi52Li4iIG5vdCBp bml0aWFsaXplZCIpDQotICAgICBlbmQNCi0gICBlbmQNCi0gICB2ID0gbmV4dChjbGFzcyx2KTsN Ci0gZW5kDQotZW5kDQotDQotdHlwZXRyaWxoYSA9IEB7eCA9IEB7ZGVmYXVsdCA9IDAsIHR5cGUg PSAibnVtYmVyIn0sDQotICAgICAgICAgICAgICAgeSA9IEB7ZGVmYXVsdCA9IDAsIHR5cGUgPSAi bnVtYmVyIn0sDQotICAgICAgICAgICAgICAgbmFtZSA9IEB7dHlwZSA9ICJzdHJpbmcifQ0KLSAg ICAgICAgICAgICAgfQ0KLQ0KLWZ1bmN0aW9uIHRyaWxoYSAodCkgIGNoZWNrKHQsdHlwZXRyaWxo YSkgZW5kDQotDQotdDEgPSBAdHJpbGhheyB4ID0gNCwgbmFtZSA9ICIzIn0NCi0NCi1hID0gIm5h Ii4uIm1lIg0KLQ0KLRoKXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCiskZGVidWcKKworZnVu Y3Rpb24gY2hlY2sgKG9iamVjdCwgY2xhc3MpCisgbG9jYWwgdiA9IG5leHQob2JqZWN0LG5pbCk7 Cisgd2hpbGUgdiB+PSBuaWwgZG8KKyAgIGlmIGNsYXNzW3ZdID0gbmlsIHRoZW4gcHJpbnQoInVu a25vd24gZmllbGQ6ICIgLi4gdikgCisgICBlbHNlaWYgdHlwZShvYmplY3Rbdl0pIH49IGNsYXNz W3ZdLnR5cGUgIAorICAgICB0aGVuIHByaW50KCJ3cm9uZyB0eXBlIGZvciBmaWVsZCAiIC4uIHYp CisgICBlbmQKKyAgIHYgPSBuZXh0KG9iamVjdCx2KTsKKyBlbmQKKyB2ID0gbmV4dChjbGFzcyxu aWwpOworIHdoaWxlIHYgfj0gbmlsIGRvCisgICBpZiBvYmplY3Rbdl0gPSBuaWwgdGhlbgorICAg ICBpZiBjbGFzc1t2XS5kZWZhdWx0IH49IG5pbCB0aGVuCisgICAgICAgb2JqZWN0W3ZdID0gY2xh c3Nbdl0uZGVmYXVsdAorICAgICBlbHNlIHByaW50KCJmaWVsZCAiLi52Li4iIG5vdCBpbml0aWFs aXplZCIpCisgICAgIGVuZAorICAgZW5kCisgICB2ID0gbmV4dChjbGFzcyx2KTsKKyBlbmQKK2Vu ZAorCit0eXBldHJpbGhhID0gQHt4ID0gQHtkZWZhdWx0ID0gMCwgdHlwZSA9ICJudW1iZXIifSwK KyAgICAgICAgICAgICAgIHkgPSBAe2RlZmF1bHQgPSAwLCB0eXBlID0gIm51bWJlciJ9LAorICAg ICAgICAgICAgICAgbmFtZSA9IEB7dHlwZSA9ICJzdHJpbmcifQorICAgICAgICAgICAgICB9CisK K2Z1bmN0aW9uIHRyaWxoYSAodCkgIGNoZWNrKHQsdHlwZXRyaWxoYSkgZW5kCisKK3QxID0gQHRy aWxoYXsgeCA9IDQsIG5hbWUgPSAiMyJ9CisKK2EgPSAibmEiLi4ibWUiCisK --0050450181028233f104786082dc-- From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 08:00:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFA04Or012023; Sun, 15 Nov 2009 08:00:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D955218ED1; Sun, 15 Nov 2009 07:59:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B725418E4C for ; Sun, 15 Nov 2009 07:59:24 -0200 (BRST) Received: by fxm21 with SMTP id 21so1783784fxm.21 for ; Sun, 15 Nov 2009 01:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=IsabIUyrXsRZHQMFO9fE+UIleGhtY7ANxfp143sH+T0=; b=xdeF9h2hq5zlBq5pp9FO9dYAKL6QFie2lale0lwkgRpqHZNh7qA60xV/x3ZoplM4Ks faq7PD2eGnGWmx8rA7Kw8PWlUL9escX8oyLVo/pMj65/6XVxukx3V0EP1RDivv8+Mh+Z G3p6kiTLStJD6M8CzAXlhdqL3PYVeRyIbvHyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=xdDLeNVSGy7Tx36R06q+8Efd32/hndmnIaAYuqA4xEAMh45YD0WzYaBUswXKyQUroN OBSOW9vXn5TkgsohTAtvCxP105EAdpjZOAWyyPaFZyfOd0TIbi5MZ/QVGLlkTebYTqJ1 qONSv4XxGUBJK854mhqqkJx9JmHz0IGE3PNFE= MIME-Version: 1.0 Received: by 10.239.139.76 with SMTP id s12mr631205hbs.78.1258279160961; Sun, 15 Nov 2009 01:59:20 -0800 (PST) Date: Sun, 15 Nov 2009 11:59:20 +0200 Message-ID: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> Subject: New metamethod for method lookup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi all, Naturally, this has been discussed before: http://lua-users.org/lists/lua-l/2009-06/msg00486.html Basically, there is a need to separate method lookup from field lookup, but in such a way that the old method is always available. Here is the problem case: say you wish to wrap a set as an object. Say also that you want s[val] to _reliably and always_ indicate the presence of val in the set s. Currently, this cannot be be done. If our set has an intersection() method, then s['intersection'] will always be a false positive, because we look up 'intersection' in the set's metatable if lookup fails. So we have to write this operation as a method call, say s:get(val) or s:exists(val) that uses rawget internally, which isn't so pretty or intuitive. The proposal which seems most Lua-like is to add a __methindex which when enabled will catch all method lookups. In its absence, then __index works for all lookups. I confess that I don't know what hoop-jumping the current Lua implementation would have to do to implement __methindex.( It may be easier to implement David Manura's suggestion of a __mcall) Also, this is probably a late feature request, since I suspect that Lua 5.2 is already nearly ready for release. steve d. From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 09:29:36 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFBTWF1019897; Sun, 15 Nov 2009 09:29:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ABEFF19370; Sun, 15 Nov 2009 09:29:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C070F19298 for ; Sun, 15 Nov 2009 09:29:02 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFBT0Y0019862 for ; Sun, 15 Nov 2009 09:29:00 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAFBSvP25062; Sun, 15 Nov 2009 09:28:57 -0200 Date: Sun, 15 Nov 2009 09:28:56 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: lua 1.0 patch - fixing compiler errors Message-ID: <20091115092856.A25054@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Sat, Nov 14, 2009 at 10:30:08PM -0500 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Attached is a patch to allow Lua 1.0 to compile on gcc and msvc. lua-all.tar.gz contains patched versions of Lua 1.0 and others. Did you try that? The diffs are below. diff ORIG/iolib.c ./iolib.c 20c20 < static FILE *in=stdin, *out=stdout; --- > static FILE *in=NULL, *out=NULL; 394a395 > in=stdin; out=stdout; diff ORIG/lex_yy.c ./lex_yy.c 20c20 < FILE *yyin = {stdin}, *yyout = {stdout}; --- > FILE *yyin = {NULL}, *yyout = {NULL}; diff ORIG/lua.c ./lua.c 33c33 < void main (int argc, char *argv[]) --- > int main (int argc, char *argv[]) 39c39 < return; --- > return 0; 51a52 > return 0; From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 13:13:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFFDDP2008087; Sun, 15 Nov 2009 13:13:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 80E68193B7; Sun, 15 Nov 2009 13:12:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by bazar2.conectiva.com.br (Postfix) with SMTP id E76F018F06 for ; Sun, 15 Nov 2009 13:12:35 -0200 (BRST) Received: (qmail invoked by alias); 15 Nov 2009 15:12:32 -0000 Received: from p5B0106E4.dip0.t-ipconnect.de (EHLO dialup) [91.1.6.228] by mail.gmx.net (mp070) with SMTP; 15 Nov 2009 16:12:32 +0100 X-Authenticated: #271361 X-Provags-ID: V01U2FsdGVkX19VEk5Vv01VojUHHKE1ELdtlkPfPD/3ogtBsmnzo9 Iut0tevEz9vl2G Date: Sun, 15 Nov 2009 16:12:31 +0100 From: Edgar Toernig To: Lua list Subject: Re: New metamethod for method lookup Message-Id: <20091115161231.4a63d257.froese@gmx.de> In-Reply-To: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.83 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean steve donovan wrote: > > The proposal which seems most Lua-like is to add a __methindex which > when enabled will catch all method lookups. In its absence, then > __index works for all lookups. +1 From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 16:00:30 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFI0QY5029518; Sun, 15 Nov 2009 16:00:26 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2F3A91909A; Sun, 15 Nov 2009 15:59:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3803718E78 for ; Sun, 15 Nov 2009 15:59:47 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id EA082C017F for ; Sun, 15 Nov 2009 12:59:44 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 15 Nov 2009 12:59:44 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=C63dxw94QaU6OTsoCN2PgHDPrx8=; b=kt7dnYCVTni/C3c/1p7IE0RibYNqCZ85pu7++1gxmD/5whxkm1/5XFh3z4JfkNX1vc8A94na0KJNSs+JsvEMKwH3KbTxeRddCL7LetoKNOKFMN2hU5MJYz3+AK961ST8rdJF396DJtB0cDrHozwicwko/C50qQ23JoT1e2K05WA= X-Sasl-enc: 0RZnudn0+pc/dSEqu/GqU38nU07VucSLJ7ViKE+3DLeu 1258307984 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 7CEEB4B0357 for ; Sun, 15 Nov 2009 12:59:44 -0500 (EST) Date: Sun, 15 Nov 2009 13:00:20 -0500 From: Jim Pryor To: Lua list Subject: Re: New metamethod for method lookup Message-ID: <20091115180020.GK11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 15, 2009 at 11:59:20AM +0200, steve donovan wrote: > Basically, there is a need to separate method lookup from field > lookup, but in such a way that the old method is always available. > > Here is the problem case: say you wish to wrap a set as an object. Say > also that you want s[val] to _reliably and always_ indicate the > presence of val in the set s. Currently, this cannot be be done. If > our set has an intersection() method, then s['intersection'] will > always be a false positive, because we look up 'intersection' in the > set's metatable if lookup fails. So we have to write this operation > as a method call, say s:get(val) or s:exists(val) that uses rawget > internally, which isn't so pretty or intuitive. A different pattern, which I like better and is achievable within Lua as it is today, is just don't bind methods to objects you want to permit arbitrary data keys on. Set = {} setmetatable(Set, {__call = function(cls,...) local obj = {} for i=1,select('#',...) do obj[select(i,...)] = true end return setmetatable(obj, Set) end}) function Set:intersection(other) -- blah blah -- end -- make some sets -- s1,s2 = Set(...), Set(...) -- get their intersection -- Set.intersection(s1, s2) That is, we don't ever make getmetatable(s1).__index == Set. You call Set.intersection(s1,...) not s1:intersection(...). In the same way you call table.remove(tbl,...) not tbl:remove(...). If you want inheritance, you can wrap that in too. You're just giving up the object-oriented syntax; you don't have to give up its power. -- One way to get inheritance local class_sentinel = {} setmetatable(Set, {__call = function(cls, ...) local obj = {} for i=1,select('#',...) do obj[select(i,...)] = true end obj[class_sentinel] = cls return setmetatable(obj, Set) end local function _intersection(self, other) local cls = self[class_sentinel] -- we assume that subclasses will have their bases as __index, so -- cls.intersection is always defined, even though it may just -- be == Set.intersection local meth = cls.intersection if meth ~= _intersection then return meth(self, other) else -- default Set.intersection implementation here -- end end Set.intersection = _intersection -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 16:29:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFITNo4032136; Sun, 15 Nov 2009 16:29:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D7CC192AD; Sun, 15 Nov 2009 16:28:59 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A0DDD19143 for ; Sun, 15 Nov 2009 16:28:54 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id F2D13BEFBD for ; Sun, 15 Nov 2009 13:28:53 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 15 Nov 2009 13:28:53 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=l4Z1CY2cp0GR1R65E80pmyf+Qtw=; b=E9eOttYQJof8iBq5zoyiYQVpLHpM8iQp+AJ2Kko6WHeVU1ga/WEl8ESBEz+8dm2Inyiup5Sr3EFg6Bfu5G27HWlhKxnIl+iTDHzlAapCEZyuz4XfqScbEPpGQheR6igVKCFX8gZewPhuCiv54VpSanP+N1eFqFnqw3Q4eMQL27o= X-Sasl-enc: ctEw5C+mBplVgeECwFj4OIr6ITTBZr1rncHOPW/bzEUX 1258309733 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 821C44B0390 for ; Sun, 15 Nov 2009 13:28:53 -0500 (EST) Date: Sun, 15 Nov 2009 13:29:29 -0500 From: Jim Pryor To: Lua list Subject: Re: New metamethod for method lookup Message-ID: <20091115182929.GL11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091115180020.GK11203@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 15, 2009 at 01:00:20PM -0500, Jim Pryor wrote: > If you want inheritance, you can wrap that in too. You're just giving up > the object-oriented syntax; you don't have to give up its power. > > -- One way to get inheritance > > local class_sentinel = {} > > setmetatable(Set, {__call = function(cls, ...) > local obj = {} > for i=1,select('#',...) do > obj[select(i,...)] = true > end > obj[class_sentinel] = cls > return setmetatable(obj, Set) > end > local function _intersection(self, other) > local cls = self[class_sentinel] > -- we assume that subclasses will have their bases as __index, so > -- cls.intersection is always defined, even though it may just > -- be == Set.intersection > local meth = cls.intersection > if meth ~= _intersection then > return meth(self, other) > else > -- default Set.intersection implementation here -- > end > end > Set.intersection = _intersection Or: setmetatable(Set, {__call = function(cls, ...) local obj = {} for i=1,select('#',...) do obj[select(i,...)] = true end return setmetatable(obj, cls) end local function _intersection(self, other) -- this relies on public metatables local cls = getmetatable(self) local meth if cls ~= Set then meth = cls.intersection end if meth and meth ~= _intersection then return meth(self, other) else -- default Set.intersection implementation here -- end end Set.intersection = _intersection -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 16:31:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFIUwj2032545; Sun, 15 Nov 2009 16:30:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF36F193BD; Sun, 15 Nov 2009 16:30:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2e.orange.fr (smtp2e.orange.fr [80.12.242.112]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5D1B19143 for ; Sun, 15 Nov 2009 16:30:24 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e11.orange.fr (SMTP Server) with ESMTP id CE0FD80000A3 for ; Sun, 15 Nov 2009 19:30:18 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e11.orange.fr (SMTP Server) with ESMTP id C1492800004E for ; Sun, 15 Nov 2009 19:30:18 +0100 (CET) Received: from o (AToulouse-553-1-132-13.w92-134.abo.wanadoo.fr [92.134.252.13]) by mwinf2e11.orange.fr (SMTP Server) with ESMTP id 898E580000A3 for ; Sun, 15 Nov 2009 19:30:18 +0100 (CET) X-ME-UUID: 20091115183018563.898E580000A3@mwinf2e11.orange.fr Date: Sun, 15 Nov 2009 19:30:17 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: New metamethod for method lookup Message-ID: <20091115193017.6e48d480@o> In-Reply-To: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Sun, 15 Nov 2009 11:59:20 +0200, steve donovan s'exprima ainsi: > The proposal which seems most Lua-like is to add a __methindex which > when enabled will catch all method lookups. In its absence, then > __index works for all lookups. Hello, Probably it's a stupid question (let's be bold!): I cannot figure out how __methindex solves the issue. Namely, how can the language guess whether s[x] is supposed to access a method or plain "data"? How does the language guess the programmer's intent, and accordingly decides to use __methindex or not? The way I see it is a general point with object types that are basically containers, like sets (or more commonly lists, mappings). There is a need to separate proper container data from "machinary" attributes under the hood. This is done for languages that have such types builtin, even if they have other transparent attributes (indeed, they have). As a consequence, for instance, iterating over a cointainer only shows the "real" data, as the user intends. If we implement a container in lua as is, we cannot add custom "machinary" slots without having them visible, as opposed to builtin behaviour - or can we? In other words, if I'm right on this, the container is no more a "clean sheet" (an expression I steal from Steve Dekorte, the author of Io language). Note that the issue is not strictly limited to methods (eg a list could hold metadata about its items), and can also appear for non-container types (which inherit custom "generic machinery" in addition to type-specific attributes). A solution I use is to have eg a "data" slot to which usual access (such as for iteration or membership test) is silently delegated. Non-data slots can only be accessed explicitely by name. Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 16:32:13 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFIW9tN000427; Sun, 15 Nov 2009 16:32:09 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 637B6193C6; Sun, 15 Nov 2009 16:31:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B968F19143 for ; Sun, 15 Nov 2009 16:31:38 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id D6E40BFC6A for ; Sun, 15 Nov 2009 13:31:37 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 15 Nov 2009 13:31:37 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=pc5s+OmV6kHUeub0UCFXLzSNAO0=; b=tCUWFDyQrDMYZKdsE/GiUpIfN6dsn1FewclixjA3OAH6dHKxcSeY1AEDdz2QkSi5ifkNmPXhas5hWNOysY4VMxTx6CCg/5O0Jq/yEXVdCVsgvJXZv8qK/2I7NZ65qi/xwPqJUYYql1AF2ksNiZpMacO0/EMPBWRhNLZKZ6zqrq4= X-Sasl-enc: a+XZQdWM4pRJfzH1qBIQqFxDTKTFt9GpZFxtZJldBv1j 1258309897 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 6D3C64B0392 for ; Sun, 15 Nov 2009 13:31:37 -0500 (EST) Date: Sun, 15 Nov 2009 13:32:13 -0500 From: Jim Pryor To: Lua list Subject: Re: New metamethod for method lookup Message-ID: <20091115183213.GM11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> <20091115182929.GL11203@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091115182929.GL11203@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 15, 2009 at 01:29:29PM -0500, Jim Pryor wrote: > setmetatable(Set, {__call = function(cls, ...) > local obj = {} > for i=1,select('#',...) do > obj[select(i,...)] = true > end > return setmetatable(obj, cls) > end In both examples that last line should be: > end}) -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 16:38:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFIchak000935; Sun, 15 Nov 2009 16:38:43 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 35E7F191D6; Sun, 15 Nov 2009 16:38:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth13.prod.mesa1.secureserver.net (smtpauth13.prod.mesa1.secureserver.net [64.202.165.37]) by bazar2.conectiva.com.br (Postfix) with SMTP id 0ED6A18F98 for ; Sun, 15 Nov 2009 16:38:14 -0200 (BRST) Received: (qmail 11490 invoked from network); 15 Nov 2009 18:38:10 -0000 Received: from unknown (98.117.140.83) by smtpauth13.prod.mesa1.secureserver.net (64.202.165.37) with ESMTP; 15 Nov 2009 18:38:10 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: New metamethod for method lookup From: Mark Hamburg In-Reply-To: <20091115161231.4a63d257.froese@gmx.de> Date: Sun, 15 Nov 2009 10:38:12 -0800 Message-Id: References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115161231.4a63d257.froese@gmx.de> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAFIchak000935 I implemented __methindex once before and as I recall it was fairly simple. The key comes in changing the logic of the SELF opcode. That opcodes job is to return the method to call and the object. It's current implementation is essentially: return gettable_event( obj, methodkey ), obj To implement __methindex, we change this to: return getmethod_event( obj, methodkey ), obj (Side note: It might be interesting to also allow overriding the value of obj, but I'm not going there with this analysis.) Here is the code for gettable_event: function gettable_event( table, key ) local h if type( table ) == 'table' then local v = rawget( table, key ) if v ~= nil then return v end h = metatable( table ).__index if h == nil then return nil end else h = metatable( table ).__index if h == nil then error( ... ) end if type( h ) == "function" then return h( table, key ) -- call the handler else return h[ key ] -- or repeat the operation on it end end One simple definition for getmethod_event to add support for __methindex would be to simply look for this entry first and otherwise treat it just like __index: function getmethod_event( obj, mkey ) local h if type( obj ) == 'table' then local v = rawget( obj, mkey ) if v ~= nil then return v end local mt = metatable( obj ) h = mt.__methodindex or mt.__index if h == nil then return nil end else local mt = metatable( obj ) h = mt.__methodindex or mt.__index if h == nil then error( ... ) end end if type( h ) == "function" then return h( obj, mkey ) -- call the handler else getmethod_event( h, mkey ) -- or repeat the operation on it end end This makes a couple of choices that are subject to discussion, however: * It doesn't solve the Set class problem because it puts the rawget ahead of the method table lookup. To avoid that, we would need to do something like the following: function getmethod_event( obj, mkey ) local mt = metatable( obj ) local h = mt.__methindex if h ~= nil then -- Fall through elseif type( obj ) == 'table' then local v = rawget( obj, mkey ) if v ~= nil then return v end h = mt.__index if h == nil then return nil end elseif mt h = mt.__index if h == nil then error( ... ) end end if type( h ) == "function" then return h( obj, mkey ) -- call the handler else getmethod_event( h, mkey ) -- or repeat the operation on it end end Note, however, that this construction makes it impossible to override a method inherited via __methindex within the object itself. Solving the Set class problem more or less seems to mandate that limitation, however. * I think there's probably room to debate whether we should continue following __methindex links after following an __index link. Broader issues also need to be considered: * This requires either library support -- mcall( obj, key, ... ) -- or syntactic support -- obj:[ key ]( ... ) -- for calling methods based on a variable rather than a constant. The syntactic support is fairly easy to add. * It would benefit from support for creating bound methods either via a library call -- mbind( obj, mkey ) -- or via syntax obj:mkey. To get the full benefits of the metamethod, however, one does not want to allow generic method lookup returning a function which can be called elsewhere. There are distinct performance and conceptual benefits to knowing that a method function was only accessed via a method lookup on its first parameter. * There are questions around whether there needs to be a corresponding assignment metamethod since one could no longer rely on the translation of function obj:method( ... ) ... end into obj.method = function( self, ... ) ... end As doing the right thing in the presence of __methindex and __newindex alone would not be able to overcome this since it would not know the context for the assignment. Despite these details to resolve, I add a hearty +1 to the concept because I think it makes it easier to catch or block a variety of errors and exploits and it simplifies the process of trying to implement both methods and properties. Mark From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 17:43:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFJhHcC005616; Sun, 15 Nov 2009 17:43:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8E45D18AF1; Sun, 15 Nov 2009 17:42:46 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2a.orange.fr (smtp2a.orange.fr [80.12.242.139]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4313318869 for ; Sun, 15 Nov 2009 17:42:41 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a14.orange.fr (SMTP Server) with ESMTP id 2BD9B80004DA for ; Sun, 15 Nov 2009 20:42:35 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2a14.orange.fr (SMTP Server) with ESMTP id 1FBD880004DE for ; Sun, 15 Nov 2009 20:42:35 +0100 (CET) Received: from o (AToulouse-553-1-132-13.w92-134.abo.wanadoo.fr [92.134.252.13]) by mwinf2a14.orange.fr (SMTP Server) with ESMTP id D77EB80004DA for ; Sun, 15 Nov 2009 20:42:34 +0100 (CET) X-ME-UUID: 20091115194234882.D77EB80004DA@mwinf2a14.orange.fr Date: Sun, 15 Nov 2009 20:42:34 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: New metamethod for method lookup Message-ID: <20091115204234.08f2e03a@o> In-Reply-To: <20091115180020.GK11203@vaio.jimpryor.net> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Sun, 15 Nov 2009 13:00:20 -0500, Jim Pryor s'exprima ainsi: > That is, we don't ever make getmetatable(s1).__index == Set. You call > Set.intersection(s1,...) not s1:intersection(...). In the same way you call > table.remove(tbl,...) not tbl:remove(...). > > If you want inheritance, you can wrap that in too. You're just giving up > the object-oriented syntax; you don't have to give up its power. Yes, that's a solution for the general issue I'm evoking in parallel post. Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 17:56:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFJtxbd006660; Sun, 15 Nov 2009 17:55:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 51E3318D02; Sun, 15 Nov 2009 17:55:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth13.prod.mesa1.secureserver.net (smtpauth13.prod.mesa1.secureserver.net [64.202.165.37]) by bazar2.conectiva.com.br (Postfix) with SMTP id 58B8D18C2F for ; Sun, 15 Nov 2009 17:55:34 -0200 (BRST) Received: (qmail 1291 invoked from network); 15 Nov 2009 19:55:26 -0000 Received: from unknown (98.117.140.83) by smtpauth13.prod.mesa1.secureserver.net (64.202.165.37) with ESMTP; 15 Nov 2009 19:55:26 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: New metamethod for method lookup From: Mark Hamburg In-Reply-To: <20091115204234.08f2e03a@o> Date: Sun, 15 Nov 2009 11:55:30 -0800 Message-Id: <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> <20091115204234.08f2e03a@o> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAFJtxbd006660 Arguments against: * It's an addition. (The default position should generally be to say "no".) * The semantics still need work. (Or at least say "not yet".) Arguments in favor: * It simplifies the implementation of objects with both methods and properties allowing method lookup to bypass a function call. (There was an alternate proposal a while back, I believe to allow a metatable entry that had to be a table and a fallback function beyond that.) * It makes it possible to guarantee that methods are only invoked with their associated objects thereby avoiding certain bugs and/or security holes and/or the need for extra type-checking. This thereby also potentially speeds methods. For example, userdata methods using a __methindex table for exposing methods could safely access their data via: native_type* self = (native_type*) lua_touserdata( L, 1 ); * On a related note, it means that accidental uses of obj.method() instead of obj:method() will generally result in an error at the call site rather than further on when something is unhappy about the value of self. Depending on the semantics chosen, it may or may not help with the case where there needs to be an overlap between the method namespace and the index namespace (e.g., for the Set class). (Another name for this proposal could be "separate namespaces for methods and keys" which feels odd to advocate for since I've long preferred LISP-1s to LISP-2s but the case here is a bit different.) Mark From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 21:14:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFNEDp5022046; Sun, 15 Nov 2009 21:14:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C925B18D5E; Sun, 15 Nov 2009 21:13:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-07.bluehost.com (outbound-mail-07.bluehost.com [69.89.17.207]) by bazar2.conectiva.com.br (Postfix) with SMTP id 4935518D02 for ; Sun, 15 Nov 2009 21:13:31 -0200 (BRST) Received: (qmail 21196 invoked by uid 0); 15 Nov 2009 23:13:29 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy1.bluehost.com with SMTP; 15 Nov 2009 23:13:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=eEUMFbz6CasKBgJB/8B11VXB59JZmYXhoP8K6eo/UMdLO9oS2ZplnhKHrU9u+0m/BIM56+8Zp19olI8HVJptuLbUxFuqnIv+6GSeXuXJ80cTKzkajJROdk4lKE7eoNkj; Received: from 64-203-156-199.dmt.ntelos.net ([64.203.156.199] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1N9oHg-0001JK-Hv for lua@bazar2.conectiva.com.br; Sun, 15 Nov 2009 16:13:28 -0700 Date: Sun, 15 Nov 2009 18:13:20 -0500 From: TNHarris To: Lua list Subject: Re: New metamethod for method lookup Message-ID: <20091115181320.734530b9@egeria.whoopdedo.org> In-Reply-To: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.203.156.199 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, 15 Nov 2009 11:59:20 +0200 steve donovan wrote: > > Basically, there is a need to separate method lookup from field > lookup, but in such a way that the old method is always available. > > Here is the problem case: say you wish to wrap a set as an object. Say > also that you want s[val] to _reliably and always_ indicate the > presence of val in the set s. Currently, this cannot be be done. If > our set has an intersection() method, then s['intersection'] will > always be a false positive, because we look up 'intersection' in the > set's metatable if lookup fails. So we have to write this operation > as a method call, say s:get(val) or s:exists(val) that uses rawget > internally, which isn't so pretty or intuitive. > What about dot syntax?. I'd expect set.intersection to not be the same thing as set['intersection'] in the object you describe. There's too many surprises if colon and dot did different things. And this doesn't have to be limited to functions, so calling it "method indexing" would be inexact. So the metafield could be __property, __field, __objindex, __metaindex. It would be used the same way as __index for dot and colon syntax. The API would also need new functions. How would you add new fields? object.field = function() end couldn't use __newindex. This proposal is also needed to create userdata objects that have methods and must be subscriptable. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Sun Nov 15 21:55:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAFNti1p025884; Sun, 15 Nov 2009 21:55:44 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5722018DE5; Sun, 15 Nov 2009 21:55:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out1.iinet.net.au (outbound.icp-qv1-irony-out1.iinet.net.au [203.59.1.106]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D519718C6A for ; Sun, 15 Nov 2009 21:55:10 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEACojAEvLO8Se/2dsb2JhbACRUMEUhDwEgm0 X-IronPort-AV: E=Sophos;i="4.44,748,1249228800"; d="scan'208";a="601627752" Received: from unknown (HELO Mania) ([203.59.196.158]) by outbound.icp-qv1-irony-out1.iinet.net.au with SMTP; 16 Nov 2009 07:55:02 +0800 Message-ID: <22C68AF76694459790A501AAB6434E36@Mania> From: "Alex Davies" To: "Lua list" References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com><20091115180020.GK11203@vaio.jimpryor.net><20091115204234.08f2e03a@o> <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> In-Reply-To: <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> Subject: Re: New metamethod for method lookup Date: Mon, 16 Nov 2009 07:54:54 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean One issue I have with the idea is there is no one way to index in Lua. Sometimes, even for function calls, you have to index from a variable in a string []. Other times the method : call is fine. Sometimes you just want to pass a different self, so . is applicable. So for this to work you'd need to add a "getmethod(table, key)" function, which is a bit tacky imo, but would work. Mark Hamburg wrote: > * It simplifies the implementation of objects with both methods and > properties allowing method lookup > to bypass a function call. (There was > an alternate proposal a while back, I believe to allow a metatable > entry > that had to be a table and a fallback function beyond that.) The proposal was to have a __proxy field in the metatable - on a nil result, the index is tried again in the __proxy value (usually a table). If that fails, the __index is called. This is an improvement in a number of ways. 1) As above, it simplifies objects with properties so that a function call isn't required to resolve methods. 2) __index is always treated like a function, improving virtualization. No "call it - unless it's a table in which case we'll index it" special treatment, allowing func tables (memoized functions, class constructors, etc) to be used as index functions. 3) Fully encompasses the existing system, so the existing behaviour can be replicated. Simple change to the VM too ;) - Alex From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 00:03:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG23kb8005596; Mon, 16 Nov 2009 00:03:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3ECCE18E78; Mon, 16 Nov 2009 00:03:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 98A3218DE5 for ; Mon, 16 Nov 2009 00:03:13 -0200 (BRST) Received: by pwi3 with SMTP id 3so2983180pwi.21 for ; Sun, 15 Nov 2009 18:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=s43AY9ImyKklFuaVVLO1OuKuzylyidejWjp0M4ZyJoA=; b=j+BZRoZmCnVwqhRvopDleQGzfyKcfl9mN4P/ZoFLOypPG/6OSyqz127HBB3ttRCFSz fJh2zo9T+Dxrc3ULvjR16vTjYDE7VbGKRgezKCxlE+nZqBiV4pILExpFYUUt2XzgxXf5 8cglKQWfU+l5eG6rA3M5J+OFcogNwBwakWI2M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=QiYtN5n6GBbU6gog8k0/L3YnxaD/lngeqUYk9lBHMdS5jrjY/Uxm1cqvYzprGm6us5 q/SYZh+ZbS7KZ56veqHmNPLDYsLpGZzQVuAy5F9bR3HssELcB8H445r2O1EMFtuDrdqg W75q5teLx79p11b6wcmT9o/LjDY2qIRJTW6ME= Received: by 10.115.132.12 with SMTP id j12mr8068718wan.121.1258336984080; Sun, 15 Nov 2009 18:03:04 -0800 (PST) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 20sm1096148pzk.13.2009.11.15.18.03.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 15 Nov 2009 18:03:03 -0800 (PST) Message-ID: <4B00B2D3.6040204@gmail.com> Date: Mon, 16 Nov 2009 10:02:59 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT 2 crashes on lua_pcall ? References: <200911141243123591007@gmail.com> In-Reply-To: <200911141243123591007@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean YangFan 写é“: > Hi,Lua list > > I have a C++ program which embeds Lua interpreter and registers several classes, then replace the Lua interpreter dll with LuaJIT2's. I find that Replacing lua dll with luajit dll may not work. You should recompile your code with luajit header files and link to luajit library. Regards Long From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 00:05:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG25deq005787; Mon, 16 Nov 2009 00:05:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 93EB51902A; Mon, 16 Nov 2009 00:05:19 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 093DD18D75 for ; Mon, 16 Nov 2009 00:05:14 -0200 (BRST) Received: by bwz27 with SMTP id 27so5210612bwz.21 for ; Sun, 15 Nov 2009 18:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=wQrxuv6OHvoGyXiN1+F979CauZAoOIK+b0LhamqYW2c=; b=FspjscFQg3GsBzhwvxnzBgcKjPHgiZ8xPSbiqwkpUHF7hHlF+W+cY6yNpU3paD8rAb bCMzCkv2NgY8W43KaQ5HiAK5ov6bSeO74tgeiPMoXWBEBNYxJN2NyZaQiV4+P92Ny8bf GUND8cwQAZY29YfPgfYdNbClhXr/XXqp4u3Ts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=VdIJti+HAohEDI4tj4k2SXyA8hudyF0YnHTF1PZD6e4KYcfTWEzRvEFahl5Ru9FRAf G3UVsh2j0Ur0pu4HT1AVuEy0Bzv7iZHFKrBbCsARyRgyMz87Syme09TND34zM8ew0QH9 fgTFG50BTjd7uiu6X5WGMrr01w+WZWOlzLKXs= MIME-Version: 1.0 Received: by 10.216.90.9 with SMTP id d9mr1097758wef.201.1258337113145; Sun, 15 Nov 2009 18:05:13 -0800 (PST) In-Reply-To: <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> <20091115204234.08f2e03a@o> <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> From: Jerome Vuarand Date: Mon, 16 Nov 2009 03:04:53 +0100 Message-ID: <89d273ba0911151804j56a7c499j128356a3064942b8@mail.gmail.com> Subject: Re: New metamethod for method lookup To: Lua list Content-Type: text/plain; charset=UTF-8 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAG25deq005787 2009/11/15 Mark Hamburg : > Arguments against: > > * It's an addition. (The default position should generally be to say "no".) Not only an addition, but a mere syntax addition. The code behind the new syntax can already be written with current Lua, the added value is nothing compared to for example tail calls or userdata environments, which are real features. Also sometimes people are confused by the dual aspect of table (ie. array and dictionary). This would add a third aspect to tables. Finally the proposal would break the fact that the colon syntax is a mere syntactic sugar. The beauty of Lua is that if you remove its few syntactic sugars, the core of the language is very simple, and can be truly mastered by normal people (as opposed to C, Javascript, or even Python). Adding yet another metamethod for an already defined behaviour (personnaly I'd ditch index and newindex on tables, and officialize newproxy instead), or another indirection level when a table value is nil, is just adding unnecessary complexity. > * The semantics still need work. (Or at least say "not yet".) > > Arguments in favor: > > * It simplifies the implementation of objects with both methods and properties allowing method lookup to bypass a function call. (There was an alternate proposal a while back, I believe to allow a metatable entry that had to be a table and a fallback function beyond that.) > > * It makes it possible to guarantee that methods are only invoked with their associated objects thereby avoiding certain bugs and/or security holes and/or the need for extra type-checking. This thereby also potentially speeds methods. For example, userdata methods using a __methindex table for exposing methods could safely access their data via: > > native_type* self = (native_type*) lua_touserdata( L, 1 ); > > * On a related note, it means that accidental uses of obj.method() instead of obj:method() will generally result in an error at the call site rather than further on when something is unhappy about the value of self. > > Depending on the semantics chosen, it may or may not help with the case where there needs to be an overlap between the method namespace and the index namespace (e.g., for the Set class). (Another name for this proposal could be "separate namespaces for methods and keys" which feels odd to advocate for since I've long preferred LISP-1s to LISP-2s but the case here is a bit different.) > > Mark > > From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 00:12:48 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG2Cjlg006751; Mon, 16 Nov 2009 00:12:45 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0EB1D18FD6; Mon, 16 Nov 2009 00:12:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth19.prod.mesa1.secureserver.net (smtpauth19.prod.mesa1.secureserver.net [64.202.165.30]) by bazar2.conectiva.com.br (Postfix) with SMTP id F042718E34 for ; Mon, 16 Nov 2009 00:12:13 -0200 (BRST) Received: (qmail 11301 invoked from network); 16 Nov 2009 02:12:09 -0000 Received: from unknown (98.117.140.83) by smtpauth19.prod.mesa1.secureserver.net (64.202.165.30) with ESMTP; 16 Nov 2009 02:12:09 -0000 Subject: Re: New metamethod for method lookup Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Mark Hamburg X-Priority: 3 In-Reply-To: <22C68AF76694459790A501AAB6434E36@Mania> Date: Sun, 15 Nov 2009 18:12:13 -0800 Message-Id: References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com><20091115180020.GK11203@vaio.jimpryor.net><20091115204234.08f2e03a@o> <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> <22C68AF76694459790A501AAB6434E36@Mania> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAG2Cjlg006751 On Nov 15, 2009, at 3:54 PM, Alex Davies wrote: > One issue I have with the idea is there is no one way to index in Lua. Sometimes, even for function calls, you have to index from a variable in a string []. Other times the method : call is fine. Sometimes you just want to pass a different self, so . is applicable. So for this to work you'd need to add a "getmethod(table, key)" function, which is a bit tacky imo, but would work. I called that out though, I think that part of the motivation for doing this actually argues against support for calling a method with a different self, so one wants: mcall( obj, mkey, ... ) or obj:[ mkey ]( ... ) The latter has the benefit of being able to compile to the same VM code and doesn't require a function call. It's also probably more efficient than the current obj[ mkey ]( obj, ... ) One also wants mbind( obj, mkey ) which returns a closure to invoke the method on the object. This could be sugared to obj:mkey though implementing it is more than just an isolated tweak to the compiler. Thanks for digging up the info on __proxy. This solves the properties v methods problem and does so without particularly complicating the semantics, but it does not provide the other benefits of __methindex with respect to things like making sure that methods are always accessed as methods. Mark From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 00:16:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG2GPWK007135; Mon, 16 Nov 2009 00:16:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 66DE519143; Mon, 16 Nov 2009 00:16:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-02.prod.phx3.secureserver.net (p3plsmtpa01-02.prod.phx3.secureserver.net [72.167.82.82]) by bazar2.conectiva.com.br (Postfix) with SMTP id 3125418E34 for ; Mon, 16 Nov 2009 00:15:58 -0200 (BRST) Received: (qmail 10041 invoked from network); 16 Nov 2009 02:15:56 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-02.prod.phx3.secureserver.net (72.167.82.82) with ESMTP; 16 Nov 2009 02:15:55 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: New metamethod for method lookup From: Mark Hamburg In-Reply-To: <89d273ba0911151804j56a7c499j128356a3064942b8@mail.gmail.com> Date: Sun, 15 Nov 2009 18:16:00 -0800 Message-Id: <3DE3AA71-706D-492F-92E1-BD805B3F448D@grubmah.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> <20091115204234.08f2e03a@o> <85B749EE-5992-408E-8E5D-47A6F0BA0800@grubmah.com> <89d273ba0911151804j56a7c499j128356a3064942b8@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAG2GPWK007135 On Nov 15, 2009, at 6:04 PM, Jerome Vuarand wrote: > Not only an addition, but a mere syntax addition. The code behind the > new syntax can already be written with current Lua, the added value is > nothing compared to for example tail calls or userdata environments, > which are real features. It is more than a syntax addition. The code cannot be written with current Lua because right now Lua provides no way to guarantee that a method is only invoked on the object with which it is associated. (Or at least no efficient way. One could have the method lookup return a closure that then ignored the first parameter passed to the call, but that would be immensely more expensive.) Mark From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 00:41:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG2fdiL009087; Mon, 16 Nov 2009 00:41:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5257218FD6; Mon, 16 Nov 2009 00:41:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14CF718E43 for ; Mon, 16 Nov 2009 00:41:02 -0200 (BRST) Received: by pwi3 with SMTP id 3so2997371pwi.21 for ; Sun, 15 Nov 2009 18:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=sEqhrUuFuXc8//0lZPR6urQA1axSd4qXdDfC5OFDe9k=; b=C0Yh/PnFLQu3h9ZT8GNlqyjD6DB/xZXs/PD3IbnBS6KZhlnQBVDmjsCewHvYY7Ikse pXDzD4JXEIQA9eQpEViIfDdgENqHynIYlOJB1YWH8vTQ/EoYVfbZ0FvFD6fD+olJvAgL pXdqRk266HK+a8+CrQaw8D4UP/uoNl2l3YPas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=fKZe0TQZRdyrstkpqtxvnjTCipsVtt+ZwjsnNyi1W/L3SXLFFWOqRw3xrvhhNr6QRn e545XwmBCCOUnlProktofcBIiYHsh4/eEFNITHLNsMKJw/U/o+KP3otwl9RgOuI1DWnA N26mZWy+yAoR6lwooAn8ViK4NUFERN42pm4ZA= Received: by 10.115.151.5 with SMTP id d5mr5994411wao.204.1258339260460; Sun, 15 Nov 2009 18:41:00 -0800 (PST) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 20sm1111565pzk.13.2009.11.15.18.40.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 15 Nov 2009 18:40:59 -0800 (PST) Message-ID: <4B00BBB7.3040309@gmail.com> Date: Mon, 16 Nov 2009 10:40:55 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: get time in ms? References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> In-Reply-To: <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The POSIX standard specifies os.clock() returning CPU time used. But microsoft POSIX library os.clock() returns wall time elapsed since the process started. You'd better avoid using it when your lua code is supposed to run both on Windows and Linux. We learned this a hard way. http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx Regards Long Asko Kauppi 写é“: > > Notice that the value returned by os.clock() is: > > ".. approximation of the amount in seconds of CPU time used by the > program." > > It is not the "wall clock" time. If you need that in ms, you need to > use LuaSocket, Lanes or some other C side binding to gettimeofday (2) > on Posix and similar Win32 API. > > -asko > > > > spir kirjoitti 13.11.2009 kello 14:37: > >> Hello again, >> >> Is there a builtin or a lib tool? If not, how do you do it? >> (googling brought no sensible info on the topic) >> >> Thank you, >> Denis >> -------------------------------- >> * la vita e estrany * >> >> site: http://spir.wikidot.com/ >> >> >> > From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 03:12:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG5Cm8a021406; Mon, 16 Nov 2009 03:12:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 49D8919289; Mon, 16 Nov 2009 03:12:20 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0A5D0191F2 for ; Mon, 16 Nov 2009 03:12:14 -0200 (BRST) Received: by yxe17 with SMTP id 17so4442103yxe.33 for ; Sun, 15 Nov 2009 21:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:references :subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=puuOMZ9F9rcCClWCPZTBAQQ0rREEzfQP/pAcjxwP+88=; b=RT+WVi7KQITPpQkHHkWUiPc1VnWgTocfgRFlq0YyNOa74Wv9F7ZsixR09F1VVRmSM+ xdbcESYmB37t44rSBUYK32VUkI6fIAGxVxiANSUYu/rO7tA00qEoaEEL69/a5xxSFER5 KgBkYIGlhC7RAkQzdNYJNgYt46WcxrLl+rYco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:references:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=am64zxtbvyNhygXRNTK4ZDp1ECV4e7xPYJDWzTNsQwyyEss2PFKV/5Wx77JB+98ADu yhrLycUgPOhmDTQHHBiwyhnp3L9z4ylNO+aCQVUJ8DqWMwg6tP+u7huoZJ6CwEsO3sVp mbzOpVM+CnOTCSNgMVgzYiMiMs+BYChc2E6ts= Received: by 10.90.18.33 with SMTP id 33mr1813091agr.113.1258348332557; Sun, 15 Nov 2009 21:12:12 -0800 (PST) Received: from IBM-73F5CA019D1 ([122.237.129.51]) by mx.google.com with ESMTPS id 8sm1201763yxb.25.2009.11.15.21.12.10 (version=SSLv3 cipher=RC4-MD5); Sun, 15 Nov 2009 21:12:11 -0800 (PST) Date: Mon, 16 Nov 2009 13:12:02 +0800 From: "=?utf-8?B?WWFuZ0Zhbg==?=" To: "=?utf-8?B?THVhIGxpc3Q=?=" References: <200911141243123591007@gmail.com> Subject: =?utf-8?B?UmU6IFJlOiBMdWFKSVQgMiBjcmFzaGVzIG9uIGx1YV9wY2FsbCA/?= Message-ID: <200911161311598432152@gmail.com> X-mailer: Foxmail 6, 15, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by tecgraf.puc-rio.br id nAG5Cm8a021406 Hi, Cheng, Long I think that's not true, LuaJIT is announced to be a drop-in replace of Lua, and provides Lua source level compatible with standard Lua C API. My problem here seems to illustrate a incompatible defect of LuaJIT. I can reproduce this at ease, and made a screen capturing film for the reproducing steps, but the mail list limites the mail size smaller than 40 KB, I cannot upload it there. Does any one give me an official explanation? Many thanks. ======= 2009-11-16 10:03:37 you wrote:======= > > >YangFan 写é“: >> Hi,Lua list >> >> I have a C++ program which embeds Lua interpreter and registers several classes, then replace the Lua interpreter dll with LuaJIT2's. I find that >Replacing lua dll with luajit dll may not work. You should recompile >your code with luajit header files and link to luajit library. > >Regards >Long = = = = = = = = = = = = = = = = = = = =         Regards         YangFan         missdeer@gmail.com           2009-11-16 From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 04:38:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG6buSr028004; Mon, 16 Nov 2009 04:37:56 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9403319297; Mon, 16 Nov 2009 04:37:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 845FC1909A for ; Mon, 16 Nov 2009 04:37:21 -0200 (BRST) Received: by fxm21 with SMTP id 21so2348206fxm.21 for ; Sun, 15 Nov 2009 22:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=zoCbbaMVtpUclJ5axtkAXQIbUD5iaicOROXeibri5mQ=; b=aaO3ZSoDZQZDbM41iHt0uIMngIi2VtGmBam4EzHhL5vAxZDeiyxKDUpM4+N3K5428i lqZkefN+o9Eb555gwhQ9MteOJG40EX/zSpv2VbCw/2hTnpmuLFkeeJGVePhD83rWatPT 9cPl+IAbW9M2aMqYYJA0HSDztyX9Ej9lnOmHc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AALi0yk2oJwZEepGbpJ5VzYb347VgihsqYX9kroh3TlaKFw0aKNffrBFG8Ql/hEl0g LPPzLtFGtFU3ze+N1XKyx5/OlhVyNURUZm5Vrh0fPQvRrsxUEchy0+oX8UvP895AGnoI X8tjVuoxLzJvMtdN+N+J7Ow0a4V0vZ8/wJcSY= MIME-Version: 1.0 Received: by 10.239.168.166 with SMTP id k38mr697828hbe.63.1258353439660; Sun, 15 Nov 2009 22:37:19 -0800 (PST) In-Reply-To: <20091115180020.GK11203@vaio.jimpryor.net> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115180020.GK11203@vaio.jimpryor.net> Date: Mon, 16 Nov 2009 08:37:19 +0200 Message-ID: <560972290911152237v3a44e9e5ladc7b090bf7d2b4d@mail.gmail.com> Subject: Re: New metamethod for method lookup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 15, 2009 at 8:00 PM, Jim Pryor wrote: > A different pattern, which I like better and is achievable within Lua as > it is today, is just don't bind methods to objects you want to permit > arbitrary data keys on. When we discussed the Set problem, David Manura felt this was the cleanest solution. Also, with Sets we can obviously use operator overloading, which does not use the method lookup mechanism. steve d. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 04:48:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG6mnwA028876; Mon, 16 Nov 2009 04:48:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FEA919287; Mon, 16 Nov 2009 04:48:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1F874190DD for ; Mon, 16 Nov 2009 04:48:20 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so2042200fgb.17 for ; Sun, 15 Nov 2009 22:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WLA29a2YuvXR/C0oSom3rf/udQ00w8T+mb/HVGmMQNs=; b=bSz3hCx+oIwLeKQwWQU9BdpDvF6wr/pzNaLZjzIwUxzsbeH3qqwSkQQAjTbT9wvDh/ PCjOEeVDkkB2MOvPqoTcAxFaMZFNQIZQu+qRhGOHtZKg+KIGKvP8Zw02W+7cjLgLfPX4 onomeUiL6R/7f93W6Ebo4PHht8mtyDDQpCrAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YBQcfur7r6OofonjeIG43A9T5snKQT2IFnK9Rj6f7+0/uwrgx2BD0aAPJqXBOwVHJ/ xCOiZCMwio3RQ1I4w1ayg3hLtAkbJJECaZRHE5Ewu30qRc8wmo5PHgdGkq9ieeW6JZYk 0aX+/7zG+HhxQYO1jhRiyxL8amXuJht6iV+ak= MIME-Version: 1.0 Received: by 10.239.181.136 with SMTP id m8mr765686hbg.131.1258354099255; Sun, 15 Nov 2009 22:48:19 -0800 (PST) In-Reply-To: <20091115181320.734530b9@egeria.whoopdedo.org> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> Date: Mon, 16 Nov 2009 08:48:19 +0200 Message-ID: <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> Subject: Re: New metamethod for method lookup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 16, 2009 at 1:13 AM, TNHarris wrote: > What about dot syntax?. I'd expect set.intersection to not be the same > thing as set['intersection'] in the object you describe. But any Lua programmer does expect this equivalence, it's as basic as p[i] == *(p + i) in C. > There's too many surprises if colon and dot did different things. And this doesn't > have to be limited to functions, so calling it "method indexing" would > be inexact. This is the part that worries me. We have a very simple mechanism, which still takes a little while to 'get' if you're new to it. Adding another layer of lookup may confuse people? Also, anything done to something as basic as method lookup must not hit performance. But we do have an generally awkward situation when trying to 'override the index operator' on metatable-based objects. MT.__index is MT, so we have to give MT its own MT (MMT), and make MMT.__index catch any unresolved lookups. steve d From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 04:59:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG6xo8x029827; Mon, 16 Nov 2009 04:59:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7FE7C192AD; Mon, 16 Nov 2009 04:59:33 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 87B6319198 for ; Mon, 16 Nov 2009 04:59:27 -0200 (BRST) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 5AB3E8C7F9; Mon, 16 Nov 2009 08:59:24 +0200 (EET) Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A0675457850; Mon, 16 Nov 2009 08:59:24 +0200 Received: from [192.168.1.2] (a88-114-94-144.elisa-laajakaista.fi [88.114.94.144]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 395001C638A; Mon, 16 Nov 2009 08:59:17 +0200 (EET) Message-Id: From: Asko Kauppi To: Lua list In-Reply-To: <4B00BBB7.3040309@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: get time in ms? Date: Mon, 16 Nov 2009 08:59:17 +0200 References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> X-Mailer: Apple Mail (2.936) X-Antivirus: VAMS X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAG6xo8x029827 Wouldn't this even be worthy of mentioning on the Lua manual page, if really so (that for Windows it's not the CPU time). Also, ability of reading wall clock time in ms would be a nice addition in Lua _itself_. It would need a small C function with one ifdef. No need to remind it's not ANSI C - I think some exceptions to that rule could really be worth it. -asko Cheng, Long kirjoitti 16.11.2009 kello 4:40: > The POSIX standard specifies os.clock() returning CPU time used. But > microsoft POSIX library os.clock() returns wall time elapsed since > the process started. You'd better avoid using it when your lua code > is supposed to run both on Windows and Linux. We learned this a hard > way. > http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx > > > Regards > Long > > Asko Kauppi 写é“: >> >> Notice that the value returned by os.clock() is: >> >> ".. approximation of the amount in seconds of CPU time used by the >> program." >> >> It is not the "wall clock" time. If you need that in ms, you need >> to use LuaSocket, Lanes or some other C side binding to >> gettimeofday (2) on Posix and similar Win32 API. >> >> -asko >> >> >> >> spir kirjoitti 13.11.2009 kello 14:37: >> >>> Hello again, >>> >>> Is there a builtin or a lib tool? If not, how do you do it? >>> (googling brought no sensible info on the topic) >>> >>> Thank you, >>> Denis >>> -------------------------------- >>> * la vita e estrany * >>> >>> site: http://spir.wikidot.com/ >>> >>> >>> >> From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 05:18:34 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG7IVdp031507; Mon, 16 Nov 2009 05:18:31 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 64D0A19315; Mon, 16 Nov 2009 05:18:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6BA53192EF for ; Mon, 16 Nov 2009 05:18:03 -0200 (BRST) Received: by fxm21 with SMTP id 21so2364396fxm.21 for ; Sun, 15 Nov 2009 23:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=rpd6mthoT7E9QtwKruKNCu5oWu52lkwJsL6qj+lhyi4=; b=c7oG0wApU/vai1OBlpEcpBXxYVdUX0GNGxNMpt1SF3qBt4WR5xcSZofVn1USznjqm6 2TRdZttl5l9PTPouR46dXDxEPloIvDDeJ1SewqQjUpydCajOf4Bhps3/6jZztkIe3k8X cosKmMih4FhnMwJsAzK312i6MEiUbAcmMCxoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Bb9XT/heCILdei4S7T+Gqs90sO1N8ODnZIORlA4tDDxgADk+1QLavWVKBIPBblA4XF XacYJlnEsBa+T4G45WSYyjRE8plhRPvqO8NyBHA2l+w2Ib15LTSnFmMACg5QxxmZBODy 2F3ZomkolWIPsGzEAbDm+qK58wsgU3A5I1/94= MIME-Version: 1.0 Received: by 10.239.179.89 with SMTP id c25mr724403hbg.156.1258355881834; Sun, 15 Nov 2009 23:18:01 -0800 (PST) In-Reply-To: References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> Date: Mon, 16 Nov 2009 09:18:01 +0200 Message-ID: <560972290911152318p77a4af57m2a5ce1ac64647a96@mail.gmail.com> Subject: Re: get time in ms? From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 16, 2009 at 8:59 AM, Asko Kauppi wrote: > Wouldn't this even be worthy of mentioning on the Lua manual page, if really > so (that for Windows it's not the CPU time). Definitely one for the FAQ ! A serious gotcha. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 06:23:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG8MxFJ004253; Mon, 16 Nov 2009 06:22:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9410719320; Mon, 16 Nov 2009 06:22:35 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout1.mclink.it (smtpout1.mclink.it [195.110.128.200]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A4A95192FD for ; Mon, 16 Nov 2009 06:22:30 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.214]) by smtpout1.mclink.it (8.13.6/8.13.6) with ESMTP id nAG8MS6m057270 for ; Mon, 16 Nov 2009 09:22:28 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkE1AHeaAEvDbohc/2dsb2JhbACEcpRBq2SPEoEwgjhUBA Received: from smail2.mclink.it ([195.110.136.92]) by mail.mclink.it with ESMTP; 16 Nov 2009 09:22:28 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail2.mclink.it (8.12.9p2/8.12.9) with ESMTP id nAG8MQaK017846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 16 Nov 2009 09:22:27 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4B010BC4.1070909@erix.it> Date: Mon, 16 Nov 2009 09:22:28 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: get time in ms? References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> In-Reply-To: <4B00BBB7.3040309@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Cheng, Long wrote: > The POSIX standard specifies os.clock() returning CPU time used. But > microsoft POSIX library os.clock() returns wall time elapsed since the > process started. You'd better avoid using it when your lua code is > supposed to run both on Windows and Linux. We learned this a hard way. > http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx Thanks! Now at last I understand why I didn't understand :-) I always used os.clock() as wall-clock time (on Windows) and was quite suprised at discovering it was intended to measure CPU time. What about the Mac? CPU time, I suppose, being Unix-based? Enrico From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 06:39:49 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG8dkE0005536; Mon, 16 Nov 2009 06:39:46 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2113219322; Mon, 16 Nov 2009 06:39:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp28.orange.fr (smtp28.orange.fr [80.12.242.101]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 79EF51929A for ; Mon, 16 Nov 2009 06:39:17 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2819.orange.fr (SMTP Server) with ESMTP id E634E8000137 for ; Mon, 16 Nov 2009 09:39:12 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2819.orange.fr (SMTP Server) with ESMTP id D9A1F8000120 for ; Mon, 16 Nov 2009 09:39:12 +0100 (CET) Received: from o (AToulouse-553-1-164-130.w92-156.abo.wanadoo.fr [92.156.108.130]) by mwinf2819.orange.fr (SMTP Server) with ESMTP id 932498000137 for ; Mon, 16 Nov 2009 09:39:12 +0100 (CET) X-ME-UUID: 20091116083912602.932498000137@mwinf2819.orange.fr Date: Mon, 16 Nov 2009 09:39:11 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: iterators Message-ID: <20091116093911.4e75fb0a@o> In-Reply-To: <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> References: <20091113110017.04b259a5@o> <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Fri, 13 Nov 2009 11:17:22 +0100, Jerome Vuarand s'exprima ainsi: > 2009/11/13 spir : > > I find great that lua introduced proper iterators, including generators, > > without addition of any new language feature such as continuations and > > magic "yield" statements. Actually, the magic is rather done by lua under > > the hood but does not directly affect the user --if I understand > > correctly. Still, after a first lucky trial, I had rather hard and long > > time guessing how to properly interpret the syntax (esp the "invisible" > > variables) and consequentely how to implement iterators for various uses > > -- esp. the highly different cases of collection and generator iterators, > > respectively. I was surprised to endly discover that defining the > > iterator func (the actual data yielding one) inside the iterator allows > > getting rid of the said invisible vars alltogether. I may be wrong, sure, > > maybe in some cases they are needed, still maybe we could simplify the > > syntax in a way that would let using this great feature much more easily. > > I wrote a doc about this, but put it on the wiki for it's rather long: > > http://lua-users.org/wiki/SimplerForIterator > > > > (Took a risk if I'm totally wrong ;-) & hope it's not full of stupidity, > > because there it will remain -- but anyway a wiki is intended to be > > corrected.) > > Removing these "invisible" variables would force all iterator > functions to be specially instanciated closures with upvalues. This is > a performance hit. The following wouldn't be possible any longer : > for k,v in next,t,nil do print(k, v) end > > On the other hand the current syntax doesn't force you to use these > hidden variables. Just ignore them. > Someone said a thread on lua-list requires some benchmark. Some, I did test for this thread. I hope these tests are properly done, because I'm not used to that (please tell me in a PM if ever there are things to change in the testing method) ... I was wondering whether performance penalty would mainly come from closure creation at loop initialisation time, or instead that calling a "closured" func with upvalue in a loop would be significantly slower. So, I wrote 2 versions of simple iteration on an array-table with a fake (empty) loop body: one with direct call to iteration func, one with closure. Then measured time (in seconds) for the following processes: -1- Many (33,333,333) loops on empty table (meaning each loop initialisation requires closure creation for the closure version, but then in both cases loop process is a single func call + a single test): result: 10 / 33. My interpretation: closure creation is clostly. But the test itself does not mirror any meaningful use case. -2- Single loop on a table with many (33,333,333) items: result: 17 / 19 My interpretation: this test is meaningful for the actual use case of walking through big arrays; but note there is no job done at all in the loop body, the test actually only measures the looping mechanics: with some job in the loop, the difference will reduce in proportion. The overhead for using a closure on an empty loop has an order of magnitude of 10%. (As far as I'm concerned, it's already neglectable even with empty loop.) Then for further information: I wondered about the "weight" (in time) of actual iteration through items, compared to loop initialisation. So, I repeated the first case for arrays of 10 items: -3- Many (3,333,333) loops on 10-items table. (Beware outside loop count is /10.) result: 10 / 16. My interpretation: once multiplied per ten, we get 100 / 160. The first case is as expected, as loop init is nearly nothing, then we simply call the func 10 times more. For the case of a closure, we can evaluate each func call to ~ 13, and the loop init/closure creation to ~ 20 (for 33,333,333 times repeting the whole thing). As a last test, I added some actual operation in the loop body (copy of the table): -4- single loop on 11,111,111-items array + copy result: 14 / 15 My interpretation: the times here are rather unstable (the other test where highly stable instable with only +/- 1 variation), varying with ~ 30% incertitude on my computer. Sometimes the closure version is even faster. Anyway, I would interpret this as meaning that, in the general case with non-empty arrays and some job in the loop body, the closure overhead is "very tiny". Below the code with results (cases are not in the same order). Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ -- iterators function next_item(array, index) if index < #array then index = index+1 return index, array[index] end end function items(array) local index = 0 local function next_item() if index < #array then index = index+1 return array[index] end end return next_item end require "os" -- 33,333,333 iterations on empty array + no-op --> 10 / 33 function empty() local array = {} local t0 = os.time() for i = 1,33333333 do for i,n in next_item, array, 0 do end end print ((os.time()-t0)) --> 11 local t0 = os.time() for i = 1,33333333 do for n in items(array) do end end print ((os.time()-t0)) --> 35 end -- 3,333,333 iterations on 10-item array + no-op --> 10 / 16 function ten() local array = {0,1,2,3,4,5,6,7,8,9} local t0 = os.time() for i = 1,3333333 do for i,n in next_item, array, 0 do end end print ((os.time()-t0)) --> 11 local t0 = os.time() for i = 1,3333333 do for n in items(array) do end end print ((os.time()-t0)) --> 16 end -- 1 iteration on 33,333,333-items array + no-op --> 17 /19 function full() local array = {} for i = 1,33333333 do table.insert(array, 0) end local t0 = os.time() for i,n in next_item, array, 0 do end print ((os.time()-t0)) --> 17 local t0 = os.time() for n in items(array) do end print ((os.time()-t0)) --> 19 end -- 1 iteration on 11,111,111-items array + copy --> 14 / 15 function copyfull() local array = {} for i = 1,11111111 do table.insert(array, 0) end a = {} local t0 = os.time() for i,n in next_item, array, 0 do a[#a+1]=n end print ((os.time()-t0)) --> 14 a = {} local t0 = os.time() for n in items(array) do a[#a+1]=n end print ((os.time()-t0)) --> 15 end function test() --~ empty() --~ ten() --~ full() copyfull() end test() From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 06:42:12 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG8g8He005771; Mon, 16 Nov 2009 06:42:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E398F1934C; Mon, 16 Nov 2009 06:41:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 204761932D for ; Mon, 16 Nov 2009 06:41:45 -0200 (BRST) Received: by ey-out-2122.google.com with SMTP id 22so1884116eye.39 for ; Mon, 16 Nov 2009 00:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pXg+qI7EifeZlTK5VxfYSzLvJvt+vbCRdpeGPR/qt5o=; b=YermNeWbqY+Vxeol9x5KzlPkrxAI7WhpnpkS+2gcOkPdiYOCYwKPXdyHWOXpg0JiQr L/0x1Mos7Sa16NUquzSzjgWxGSiEXrUbaeN7gaBTula8UhUR15Ty8xGKEDfPnBXa/rLW aaNnspbPxCoJzHHxlo8ZYDvCqO0hU/0XSJcnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ojv3sKt/adm6pYgx1t/VLOEXsHSZa7zEbRmOygVBIumqE89mv82LPOHBSZMguE1dOj pV42T11u6My1RrUdU50leRXuBNbao5tx/l+FoNMlTU8rI81FfXNDvON1kAFfE6Q64+Xx qTSGQP0aPeQcFVo4ZD8WrqBeyiHtBkdHCF82Q= MIME-Version: 1.0 Received: by 10.213.55.70 with SMTP id t6mr1567873ebg.11.1258360904419; Mon, 16 Nov 2009 00:41:44 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Nov 2009 09:41:44 +0100 Message-ID: Subject: Re: Cannot redirect stderr From: Sergio Fadda To: Lua Content-Type: multipart/alternative; boundary=001636026110b50ae5047878fab6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636026110b50ae5047878fab6 Content-Type: text/plain; charset=ISO-8859-1 Thanks to everybody for replies! Actually Luiz is right: LUA does not write to stderr; so I've resolved, reopening stdout and stderr and implementing an error handler just like in "lua.c". Thanks again! Sergio --001636026110b50ae5047878fab6 Content-Type: text/html; charset=ISO-8859-1 Thanks to everybody for replies!
Actually Luiz is right: LUA does not write to stderr; so I've resolved, reopening stdout and stderr and implementing an error handler just like in "lua.c"
.

Thanks again!
Sergio
--001636026110b50ae5047878fab6-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 06:54:37 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG8sYFk006777; Mon, 16 Nov 2009 06:54:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DF8C119353; Mon, 16 Nov 2009 06:54:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 31B6B1932B for ; Mon, 16 Nov 2009 06:54:09 -0200 (BRST) Received: by fxm21 with SMTP id 21so2421027fxm.21 for ; Mon, 16 Nov 2009 00:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=hvn8gzje3z6YypzVXJIuDE7LvV9P+nyirEeAzDPZbS4=; b=JMyN01e4GG7oj2omL+2MMGS7SRTllktIK7Y94I9bJt/Kjc/1CAyGxP7AIt4fQ5+RG1 Ve2C4Jai2M9j3nn470h8BVTXnZMf5X6MeS1gCQcQvLmQQ/+TkFLTHwVGPCkJg5RTb6pU sWusY0scvr3bsoQ+7gISpP44pWhF2paKuFC7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=dSlHKS8ckItL1ErPLRRmeHcTGA4/CORkIyx9Zcd05uU1Twccdk90D4IrNoLwpYZd/p ASh2kNxUpoWHvvNkT8BvSTlB14KncNVUKmN5joYf8exURocBl29vPhXNTiegD/kt3D+O x4qc9zfrgpWvdPlfmeO+B8t3jzXeDm8se1o7o= MIME-Version: 1.0 Received: by 10.223.143.12 with SMTP id s12mr1109655fau.30.1258361646871; Mon, 16 Nov 2009 00:54:06 -0800 (PST) In-Reply-To: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> References: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> Date: Mon, 16 Nov 2009 09:54:06 +0100 Message-ID: Subject: Re: is it possible to obtain registered functions list of a lua state? From: Michael Pruemm To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean You could iterate over the table _G and all module tables in package.loaded and look for entries with type 'function'. This is the closest you can get to getting a list of (global) functions from Lua. For a script editor, would also need to get names of local functions and functions on objects. There is no way of getting the former unless you parse the Lua code yourself and keep track of things. There is also no way to get a function signature because Lua functions do not declare how many arguments they take. -- Michael Pruemm Syntactic sugar causes cancer of the semicolon. - Alan J. Perlis From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 06:58:35 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAG8wWT0007072; Mon, 16 Nov 2009 06:58:32 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C47731935E; Mon, 16 Nov 2009 06:58:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-px0-f180.google.com (mail-px0-f180.google.com [209.85.216.180]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C31A19351 for ; Mon, 16 Nov 2009 06:58:11 -0200 (BRST) Received: by pxi10 with SMTP id 10so1008036pxi.33 for ; Mon, 16 Nov 2009 00:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Eje7r/xszvEX+vdrVGxPSRZ99X1oAHX6TP8NJvNjjQE=; b=i3orMu0S7gWydofhJfVO3QyIjiAHltzmQTZy0OutV/Zbhi7hfZfZPaKToECur79j1i lVzNc5xqQCWkajsYW/fjlCmJLfHLg2ysTkrGIoA7qgToGstk8eKmH1T5scWNIt575Unt WssNyCxfY5no1RVt5E/Ed28edm/9yLSbEFrSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=p0ahFr9i6zW6S3GcPKexWn0NtRiKqhwhoubo4FbviTJnDWW/OcyyQVjDYivslGaltV PHiOWUZYBLlN+gYb2BOAKHHkXTTozo5Izp9yb/afZ9x5g1tQxqTu6Fw1fp74XryCToL/ pVnqdvIk2OdvJvflTaqrxzOkA9J8HvusdQDN4= Received: by 10.114.68.17 with SMTP id q17mr6326856waa.113.1258361889010; Mon, 16 Nov 2009 00:58:09 -0800 (PST) Received: from ?192.168.80.209? ([60.12.227.4]) by mx.google.com with ESMTPS id 23sm4125603pxi.5.2009.11.16.00.58.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Nov 2009 00:58:08 -0800 (PST) Message-ID: <4B01141C.6090505@gmail.com> Date: Mon, 16 Nov 2009 16:58:04 +0800 From: "Cheng, Long" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: is it possible to obtain registered functions list of a lua state? References: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Michael Pruemm 写é“: > There is also no way to get a function signature because Lua functions > do not declare how many arguments they take. > > You can modify your binding library so that when bind function to lua you also store a function signature in a global table. Regards Long From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 08:34:23 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGAYLOo015863; Mon, 16 Nov 2009 08:34:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B9E40192DF; Mon, 16 Nov 2009 08:33:47 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 14D8E190D8 for ; Mon, 16 Nov 2009 08:33:42 -0200 (BRST) Received: by yxe17 with SMTP id 17so4570665yxe.33 for ; Mon, 16 Nov 2009 02:33:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=aCrRfMz4KufDw3LjDZVCTCyymKyUC0LLr3POc7x574o=; b=SDY0k0qlyiNIUz6ZfPTbK4S7P4vJHhLe2HcLZAHtmnFW1uQ/KGymZ4gLTj0UIpiI1y P2A7Gsx20ZjdJEOAQTheAbS3LoE+1t6lnuHVldr4oIjUSluk06X4EolvkhLmBmSAu2RP V1oLVQTKBrB55vOJXdf3NyTMZto9RI+frFZZc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=LxJ79DHEnAgqVJvOx4BRUiA3pGs8BO0aGGxCHw5Vw7AqwS1A7VNUVuOMPBwx8BZN8X Zu5pvZTAo58sEuA12bDdNpURCJU+RLQTkyCHea0CatD92btTiBRwsID1TYhmfrctQOdn JB0xKap3Y0+pbx3bEMFMI/PZcwb3bhZAWJSLQ= MIME-Version: 1.0 Received: by 10.101.165.16 with SMTP id s16mr5476732ano.60.1258367620263; Mon, 16 Nov 2009 02:33:40 -0800 (PST) In-Reply-To: <4B01141C.6090505@gmail.com> References: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> <4B01141C.6090505@gmail.com> Date: Mon, 16 Nov 2009 10:33:40 +0000 Message-ID: <86a6bb870911160233j78912a7ep2048a34ab9bcacea@mail.gmail.com> Subject: Re: is it possible to obtain registered functions list of a lua state? From: Colm Sloan To: Lua list Content-Type: multipart/alternative; boundary=001636c5c00800b0c404787a8bca X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001636c5c00800b0c404787a8bca Content-Type: text/plain; charset=ISO-8859-1 Cloudage, if you got that to work, I'd love to see your code. I'm working on a similar problem. --001636c5c00800b0c404787a8bca Content-Type: text/html; charset=ISO-8859-1 Cloudage, if you got that to work, I'd love to see your code. I'm working on a similar problem. --001636c5c00800b0c404787a8bca-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 08:56:51 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGAumcm018776; Mon, 16 Nov 2009 08:56:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC86319295; Mon, 16 Nov 2009 08:56:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7C71218BFD for ; Mon, 16 Nov 2009 08:56:23 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGAuMnc018738 for ; Mon, 16 Nov 2009 08:56:22 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAGAuLb28546; Mon, 16 Nov 2009 08:56:21 -0200 Date: Mon, 16 Nov 2009 08:56:20 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: is it possible to obtain registered functions list of a lua state? Message-ID: <20091116085620.A28543@lua.tecgraf.puc-rio.br> References: <15cdd41b0911140205g38db85b1g9c6070afd3be5cd1@mail.gmail.com> <4B01141C.6090505@gmail.com> <86a6bb870911160233j78912a7ep2048a34ab9bcacea@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <86a6bb870911160233j78912a7ep2048a34ab9bcacea@mail.gmail.com>; from colmsloan@gmail.com on Mon, Nov 16, 2009 at 10:33:40AM +0000 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Cloudage, if you got that to work, I'd love to see your code. I'm working on > a similar problem. http://www.lua.org/cgi-bin/demo?globals is a start. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 09:13:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGBD8Qc021146; Mon, 16 Nov 2009 09:13:08 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3BC75192A5; Mon, 16 Nov 2009 09:12:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 523C31902A for ; Mon, 16 Nov 2009 09:12:31 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1N9zVS-0006Cw-00; Mon, 16 Nov 2009 12:12:26 +0100 Date: Mon, 16 Nov 2009 12:12:19 +0100 From: Mike Pall To: Lua list Subject: Re: Re: LuaJIT 2 crashes on lua_pcall ? Message-ID: <20091116111219.GA6288@mike.de> References: <200911141243123591007@gmail.com> <200911161311598432152@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911161311598432152@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean YangFan wrote: > I think that's not true, LuaJIT is announced to be a drop-in > replace of Lua, and provides Lua source level compatible with > standard Lua C API. Yes, you can just replace the DLL. No need to recompile. But there's a general caveat on Windows: all C symbols (e.g. lua_pcall) are bound to a specific DLL name. This means that you need to keep the name of the Lua DLL (i.e. lua51.dll) for the LuaJIT DLL, too. If some parts of your code link to the LuaJIT DLL (because you used a new name), but other parts (like a loadable module) link to the Lua DLL, you are guaranteed to get a crash. > My problem here seems to illustrate a incompatible defect of > LuaJIT. I can reproduce this at ease, and made a screen > capturing film for the reproducing steps, but the mail list > limites the mail size smaller than 40 KB, I cannot upload it > there. Does any one give me an official explanation? A screen capture probably wouldn't help. I need a (small) test case that illustrates the problem. And I need source code to diagnose this, like a small C program plus a Lua program that shows the crash. That said, I have no other bug reports about lua_pcall. It's used in the stand-alone executable (luajit.exe) without problems. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 09:51:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGBp4Pj026861; Mon, 16 Nov 2009 09:51:05 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EF047192E0; Mon, 16 Nov 2009 09:50:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D88CE18E34 for ; Mon, 16 Nov 2009 09:50:20 -0200 (BRST) Received: by fxm21 with SMTP id 21so2579489fxm.21 for ; Mon, 16 Nov 2009 03:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=2HH3r2htRBZddb2l9TONjPsscC0jHO+6RixYk9om0kc=; b=bW3TgkTw4kbPHcgTFIwbHPx+HisnZA5IibYzIk1nNSKgYwhGh+o/EQJXgeUI/KRYEi pGLakNOHUNVMpKbGjMOGt3PzXFJYGPMurGKI8D56yCSPDAOyOZYsU5Qi63Zw9KxAFZVK qv2xAKnwLaeIUZ5/YiAqAPlJlkIlmqzfnD/N0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=TJcgOLCFjYcvfN778X8G9psx99r9ayIhRXpPU8EnrKQF8/PJJxSPmK7+2d1R+miOHo IDYEh+kVUDvyeRKoXzS96R13uNNgvrHfqEQGZo4892kv9iLM5UY3scZZCIcYdd4Ja78W +iylyN/q/WI9vT8HrGqa4SfbRU9nleayVrGPM= MIME-Version: 1.0 Received: by 10.239.141.155 with SMTP id c27mr734252hba.48.1258372218180; Mon, 16 Nov 2009 03:50:18 -0800 (PST) From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Mon, 16 Nov 2009 09:49:58 -0200 Message-ID: Subject: LuaJIT startup performance To: Lua list Content-Type: multipart/alternative; boundary=001485f6c76a0f570204787b9df6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f6c76a0f570204787b9df6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Is there a benchmark concerning LuaJIT performance on its first run (as compared to plain Lua)? Maybe the real question I'd like to ask is: would it hurt to run a cgi-base= d application using LuaJIT? Att. --=20 Lu=EDs Eduardo Jason Santos --001485f6c76a0f570204787b9df6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Is there a benchmark concerning LuaJIT performance on its first run (as com= pared to plain Lua)?

Maybe the real question I'd lik= e to ask is: would it hurt to run a cgi-based application using LuaJIT?

Att.
--
Lu=EDs Eduardo Jason Santos
--001485f6c76a0f570204787b9df6-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 10:10:11 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGC9wqE030785; Mon, 16 Nov 2009 10:10:00 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BB72F1932B; Mon, 16 Nov 2009 10:09:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DAB2719306 for ; Mon, 16 Nov 2009 10:09:31 -0200 (BRST) Received: from [93.172.95.188] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KT7007FQB3RKO60@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 14:09:28 +0200 (IST) Date: Mon, 16 Nov 2009 14:09:30 +0200 From: Shmuel Zeigerman Subject: luac and loadstring hang To: Lua list Message-id: <4B0140FA.4090808@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The string below, when fed to loadstring, causes the interpreter to hang. (Same behavior if this string is saved to file and then fed to luac). Lua 5.1.4, Windows XP SP2. -- test begin -- local str = "\27\76\117\97\81\0\1\4\4\4\8\0\7\0\0\0\64\49\46\108\117\97" .. "\0\0\0\0\0\0\0\0\0\0\0\2\2\3\0\0\0\1\0\0\14\0\0\0\30\0\128" .. "\0\1\0\0\0\3\0\0\0\0\0\0\23\64\0\0\0\0\3\0\0\0\1\0\0\0\2\0" .. "\0\0\2\0\0\0\1\0\0\0\2\0\0\0\102\0\1\0\0\0\2\0\0\0\0\0\0\0" loadstring(str) -- Shmuel From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 10:10:42 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGCAY9o031188; Mon, 16 Nov 2009 10:10:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 08C191934D; Mon, 16 Nov 2009 10:10:13 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33B8F19330 for ; Mon, 16 Nov 2009 10:10:08 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAGCA673021440 for ; Mon, 16 Nov 2009 10:10:06 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 32BE554C03F; Mon, 16 Nov 2009 10:10:07 -0200 (BRST) Date: Mon, 16 Nov 2009 10:10:07 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: get time in ms? Message-ID: <20091116121007.GA32472@inf.puc-rio.br> References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4B00BBB7.3040309@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > The POSIX standard specifies os.clock() returning CPU time used. But > microsoft POSIX library os.clock() returns wall time elapsed since the > process started. You'd better avoid using it when your lua code is > supposed to run both on Windows and Linux. We learned this a hard way. > http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx It is not the POSIX standard that specifies that clock() returns CPU time. It is the ISO (ANSI) C standard: ISO/IEC 9899:1999 (E) 7.23.2.1 The clock function The clock function returns the implementation’s best approximation to the processor time used by the program since the beginning of an implementation-defined era related only to the program invocation. To determine the time in seconds, the value returned by the clock function should be divided by the value of the macro CLOCKS_PER_SEC. If the processor time used is not available or its value cannot be represented, the function returns the value (clock_t)(-1). Windows should follow that standard too. (They say they do.) Of course, one can say that wall time is their "best approximation" to the processor time ;) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 10:20:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGCKM3g000632; Mon, 16 Nov 2009 10:20:22 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 090CB19355; Mon, 16 Nov 2009 10:20:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 728411934F for ; Mon, 16 Nov 2009 10:19:55 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGCJr2g000562 for ; Mon, 16 Nov 2009 10:19:53 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAGCJqw28743; Mon, 16 Nov 2009 10:19:52 -0200 Date: Mon, 16 Nov 2009 10:19:51 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: luac and loadstring hang Message-ID: <20091116101951.A28733@lua.tecgraf.puc-rio.br> References: <4B0140FA.4090808@013net.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4B0140FA.4090808@013net.net>; from shmuz@013net.net on Mon, Nov 16, 2009 at 02:09:30PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > The string below, when fed to loadstring, causes the interpreter to > hang. (Same behavior if this string is saved to file and then fed to > luac). Lua 5.1.4, Windows XP SP2. > > -- test begin -- > local str = > "\27\76\117\97\81\0\1\4\4\4\8\0\7\0\0\0\64\49\46\108\117\97" .. > "\0\0\0\0\0\0\0\0\0\0\0\2\2\3\0\0\0\1\0\0\14\0\0\0\30\0\128" .. > "\0\1\0\0\0\3\0\0\0\0\0\0\23\64\0\0\0\0\3\0\0\0\1\0\0\0\2\0" .. > "\0\0\2\0\0\0\1\0\0\0\2\0\0\0\102\0\1\0\0\0\2\0\0\0\0\0\0\0" > > loadstring(str) changing the last line to print(loadstring(str)) gives me this: nil binary string: bad constant in precompiled chunk but in an older machine it did hang. (Both are Linux machines.) From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 10:40:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGCdXXH004669; Mon, 16 Nov 2009 10:39:38 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CF3D8192D9; Mon, 16 Nov 2009 10:39:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 206FB19176 for ; Mon, 16 Nov 2009 10:39:05 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1NA0rG-0006Jm-00; Mon, 16 Nov 2009 13:39:02 +0100 Date: Mon, 16 Nov 2009 13:38:10 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT startup performance Message-ID: <20091116123810.GA8344@mike.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luís Eduardo Jason Santos wrote: > Is there a benchmark concerning LuaJIT performance on its first run (as > compared to plain Lua)? It's slightly faster. I've timed lua_open + luaL_openlibs in isolation. First immediately on process startup, then a second time after closing it, to eliminate effects of cache/TLB warmup. All times in microseconds on a 3GHz Core2 (lower is better): 1st 2nd --------------------------- 155 95 Lua 5.1.4 85 60 LuaJIT 2.0.0-beta2 But the main overhead comes from the process startup, shared library loading and resolving the symbol stubs. This is of course system dependent. With Linux it takes at least another 250 microseconds, even without loading readline. The standard Lua stand-alone program is linked with readline. Just loading the required shared libraries, without even using a single function of them, adds a whopping 900 microseconds to the total time! > Maybe the real question I'd like to ask is: would it hurt to run a cgi-based > application using LuaJIT? It wouldn't hurt. But you wouldn't see much of a difference, either. If the Lua code for request handling is only run once, it's probably not compiled at all. So you're not getting any benefit from a JIT compiler. Consider using FastCGI which eliminates the process startup overhead. And keep the same lua_State alive across many requests, so the Lua code can get compiled. This should give you much better performance. --Mike From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 10:42:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGCfxGC005299; Mon, 16 Nov 2009 10:41:59 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 68A7F19330; Mon, 16 Nov 2009 10:41:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AEF8419317 for ; Mon, 16 Nov 2009 10:41:33 -0200 (BRST) Received: from [93.172.95.188] by mxout5.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KT7007BKCL7KO70@mxout5.netvision.net.il> for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 14:41:32 +0200 (IST) Date: Mon, 16 Nov 2009 14:41:35 +0200 From: Shmuel Zeigerman Subject: Re: luac and loadstring hang In-reply-to: <20091116101951.A28733@lua.tecgraf.puc-rio.br> To: Lua list Message-id: <4B01487F.9040303@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean The test string was obtained the following way: File 1.lua local f = 23/4 f = f*f was compiled by luac.exe, then the 41-st character was deleted. -- Shmuel From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:13:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFDZsF004215; Mon, 16 Nov 2009 13:13:35 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF8871934F; Mon, 16 Nov 2009 13:12:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com [209.85.210.187]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 12AEC192B9 for ; Mon, 16 Nov 2009 13:12:36 -0200 (BRST) Received: by yxe17 with SMTP id 17so4772265yxe.33 for ; Mon, 16 Nov 2009 07:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=xtxHTkSkancoTcCK8b8U/8z9YI+jM1CVlXi4cHw+mIQ=; b=GgehT5QlPU0dXwIwgbVbz44qBx7iCBQd/PXVif3R0ij9ZyB65raJWJ/o411U5DbJ8A uF5rWsZgXPyN8Gj9iiwaS0nAVFdlvgaMp7r7YtmwBwEgEF4nECx9zxvXZXbwll/oVwA7 SKoa353nYIvIk/Wdelno8ZyMDGsbPTnN+lSKs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=GiNqlKG3aMRDKhwiIaSNedv9YDGIEMLgCa8R2Tb9d0pjtLXYCMB1ykvFYj4TpGtY6f I2RDxcesa5lR+r2nTRIRJUtTCAJ4MTb4MyCNbgoaoaxj/SzdVeWmDJtNxL//fA63Lwz4 9VvvH0TJB/skC014yH+4UooXzm/wG3rwfP7Ms= Received: by 10.101.154.22 with SMTP id g22mr398895ano.50.1258384351556; Mon, 16 Nov 2009 07:12:31 -0800 (PST) Received: from ?192.168.1.4? (r190-134-20-152.dialup.adsl.anteldata.net.uy [190.134.20.152]) by mx.google.com with ESMTPS id 20sm981261ywh.2.2009.11.16.07.12.29 (version=SSLv3 cipher=RC4-MD5); Mon, 16 Nov 2009 07:12:31 -0800 (PST) Subject: Re: get time in ms? From: Jorge To: Lua list In-Reply-To: <20091116121007.GA32472@inf.puc-rio.br> References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <20091116121007.GA32472@inf.puc-rio.br> Content-Type: text/plain; charset="UTF-8" Date: Mon, 16 Nov 2009 13:12:27 -0200 Message-ID: <1258384347.1580.3.camel@matroskin> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 2009-11-16 at 10:10 -0200, Roberto Ierusalimschy wrote: > Of course, one can say that wall time is their "best approximation" > to the processor time ;) They probably inherited the implementation from DOS. Everything is simpler with a single process ;) jorge From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:34:55 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFYqaL008215; Mon, 16 Nov 2009 13:34:52 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id B45A319344; Mon, 16 Nov 2009 13:34:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpauth17.prod.mesa1.secureserver.net (smtpauth17.prod.mesa1.secureserver.net [64.202.165.29]) by bazar2.conectiva.com.br (Postfix) with SMTP id 2BA76192AE for ; Mon, 16 Nov 2009 13:34:09 -0200 (BRST) Received: (qmail 19677 invoked from network); 16 Nov 2009 15:34:05 -0000 Received: from unknown (98.117.140.83) by smtpauth17.prod.mesa1.secureserver.net (64.202.165.29) with ESMTP; 16 Nov 2009 15:34:05 -0000 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: get time in ms? From: Mark Hamburg In-Reply-To: <20091116121007.GA32472@inf.puc-rio.br> Date: Mon, 16 Nov 2009 07:34:04 -0800 Message-Id: References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <20091116121007.GA32472@inf.puc-rio.br> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAGFYqaL008215 On Nov 16, 2009, at 4:10 AM, Roberto Ierusalimschy wrote: >> The POSIX standard specifies os.clock() returning CPU time used. But >> microsoft POSIX library os.clock() returns wall time elapsed since the >> process started. You'd better avoid using it when your lua code is >> supposed to run both on Windows and Linux. We learned this a hard way. >> http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx > > It is not the POSIX standard that specifies that clock() returns CPU > time. It is the ISO (ANSI) C standard: > > ISO/IEC 9899:1999 (E) > 7.23.2.1 The clock function > The clock function returns the implementation’s best approximation > to the processor time used by the program since the beginning > of an implementation-defined era related only to the program > invocation. To determine the time in seconds, the value returned > by the clock function should be divided by the value of the macro > CLOCKS_PER_SEC. If the processor time used is not available or > its value cannot be represented, the function returns the value > (clock_t)(-1). > > Windows should follow that standard too. (They say they do.) > > Of course, one can say that wall time is their "best approximation" > to the processor time ;) Sigh. At least I don't need to say nice things about Microsoft and Windows any more. ;-) At this point though the question for Microsoft would probably be: How many things will break if we fix this? After all it works as documented by Microsoft. It's just that their choice isn't standards compliant. Mark From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:40:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFadgD008904; Mon, 16 Nov 2009 13:36:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EBE5C1936C; Mon, 16 Nov 2009 13:36:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 028361935D for ; Mon, 16 Nov 2009 13:35:53 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFZlkT008568 for ; Mon, 16 Nov 2009 13:35:48 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAGFZkO29445; Mon, 16 Nov 2009 13:35:46 -0200 Date: Mon, 16 Nov 2009 13:35:46 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: luac and loadstring hang Message-ID: <20091116133546.A29373@lua.tecgraf.puc-rio.br> References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <4B01487F.9040303@013net.net>; from shmuz@013net.net on Mon, Nov 16, 2009 at 02:41:35PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br I ran some instrumentation and it seems that the program is spending a lot of time at one line in LoadConstants (lundump.c): static void LoadConstants(LoadState* S, Proto* f) { int i,n; n=LoadInt(S); << n = 50331648 f->k=luaM_newvector(S->L,n,TValue); << no problems here f->sizek=n; for (i=0; ik[i]); << takes a while here ... In my old Pentium II with 256Mb of memory running Linux the process is killed by the OS after a while. Roberto has suggested that it's probably a paging problem. In newer machines with larger memory the program runs correctly, aborting with a sensible error message (bad constant). From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:42:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFgYTJ009884; Mon, 16 Nov 2009 13:42:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3FB2719356; Mon, 16 Nov 2009 13:42:09 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AA25919351 for ; Mon, 16 Nov 2009 13:42:04 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAGFg4Nx009305 for ; Mon, 16 Nov 2009 13:42:04 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 83DAC54C03F; Mon, 16 Nov 2009 13:42:04 -0200 (BRST) Date: Mon, 16 Nov 2009 13:42:04 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: luac and loadstring hang Message-ID: <20091116154204.GB11531@inf.puc-rio.br> References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091116133546.A29373@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > In my old Pentium II with 256Mb of memory running Linux the process is > killed by the OS after a while. Roberto has suggested that it's probably > a paging problem. Actually "optimistic memory allocation". -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:48:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFmFWY011208; Mon, 16 Nov 2009 13:48:15 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 899C919378; Mon, 16 Nov 2009 13:47:42 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 770FF19373 for ; Mon, 16 Nov 2009 13:47:36 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFlYsH011005 for ; Mon, 16 Nov 2009 13:47:34 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAGFlXD29561; Mon, 16 Nov 2009 13:47:33 -0200 Date: Mon, 16 Nov 2009 13:47:32 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: luac and loadstring hang Message-ID: <20091116134732.B29497@lua.tecgraf.puc-rio.br> References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> <20091116154204.GB11531@inf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20091116154204.GB11531@inf.puc-rio.br>; from roberto@inf.puc-rio.br on Mon, Nov 16, 2009 at 01:42:04PM -0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > > In my old Pentium II with 256Mb of memory running Linux the process is > > killed by the OS after a while. Roberto has suggested that it's probably > > a paging problem. > > Actually "optimistic memory allocation". Right: "We learned that malloc should return NULL in case of out-of-memory. However, it is not the case in Linux. By default, Linux uses optimistic memory allocation strategy. Under this strategy, Linux assumes there always exists free memory. The memory region returns by malloc is not actually allocated until the process touches the memory region. This means the memory region returns by malloc may not be available. In case of out-of-memory, the OOM Killer in Linux will pick up one or more process to kill." http://ahlamnote.blogspot.com/2007/04/optimistic-memory-allocation-strategy.html From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 13:57:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGFv1QK012968; Mon, 16 Nov 2009 13:57:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 279BB1938E; Mon, 16 Nov 2009 13:56:37 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from flounder.pepperfish.net (flounder.pepperfish.net [87.237.62.181]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0B4A519384 for ; Mon, 16 Nov 2009 13:56:32 -0200 (BRST) Received: from cpc2-asht1-0-0-cust798.manc.cable.ntl.com ([80.5.55.31] helo=master) by flounder.pepperfish.net with esmtpsa (Exim 4.69 #1 (Debian)) id 1NA3w4-0000wr-VI for ; Mon, 16 Nov 2009 15:56:13 +0000 Received: from trite.i.flarn.net ([10.19.3.100] helo=trite.i.flarn.net.i.flarn.net) by master with esmtp (Exim 4.69) (envelope-from ) id 1NA3wL-0003yS-P7 for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 15:56:30 +0000 Date: Mon, 16 Nov 2009 15:56:29 +0000 From: Rob Kendrick To: lua@bazar2.conectiva.com.br Subject: Re: luac and loadstring hang Message-ID: <20091116155629.2a3d3360@trite.i.flarn.net.i.flarn.net> In-Reply-To: <20091116134732.B29497@lua.tecgraf.puc-rio.br> References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> <20091116154204.GB11531@inf.puc-rio.br> <20091116134732.B29497@lua.tecgraf.puc-rio.br> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 16 Nov 2009 13:47:32 -0200 Luiz Henrique de Figueiredo wrote: > > Actually "optimistic memory allocation". > > Right: > > "We learned that malloc should return NULL in case of out-of-memory. > However, it is not the case in Linux. By default, Linux uses > optimistic memory allocation strategy. Under this strategy, > Linux assumes there always exists free memory..." And any Firefox or OpenOffice users should be thankful, given how much memory these travesties allocate and then never touch :) You can turn off this over-commit by uttering the correct rune into /proc somewhere, if memory serves. B. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 14:01:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGG17In014018; Mon, 16 Nov 2009 14:01:07 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D459719359; Mon, 16 Nov 2009 14:00:39 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 229E21932B for ; Mon, 16 Nov 2009 14:00:33 -0200 (BRST) Received: by fxm21 with SMTP id 21so2849040fxm.21 for ; Mon, 16 Nov 2009 08:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=xqHDcs5YXlGSXw096A1NAQzehP/F61CkzL4lHis2piY=; b=J6NbC2/HVFDxXnzrm0dU09FHGpGs/YbT/0NuJNymQls/cZbiskAiMiCURj6EewaQPd NMIAXvrCBEyX5ej0SBi0bQnVDi/tMmHswf1LWojI6ijflCoWFv7Sxviph+QfBR/Jyoln VqTy5RFVq9/vsfr/e4VNV9hF1ofQo7LojhniY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=yIXHUWqw2H6GuIN+xPD8O3L5H5hx+ly8R+G2550ej/c2hidkylOhaYmvYSGw8LvHS3 66UsY9skpt3sORpfe/Uluo412x2XIRI+baKF52h/mRh6yG3DF10Bevi7fPpW5a+tTpN1 NttafVsjBtewIRyo6iplCjODmBfahp92dhABo= MIME-Version: 1.0 Received: by 10.223.98.19 with SMTP id o19mr1226253fan.82.1258387232297; Mon, 16 Nov 2009 08:00:32 -0800 (PST) Date: Mon, 16 Nov 2009 16:00:32 +0000 Message-ID: Subject: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Hi List, I am currently working on a Lua implementation of the "Diff, Match & Patch" API [1], based (heavily) on the Javascript version by Neil Fraser. I decided to try it out with LuaJIT 2.0.0 beta 2, and found that one of the tests was failing, but not if I called jit.off() first. I have been investigating and unfortunately it seems like changing almost anything stops the problem from occurring, so I have not been able to simplify the test case very much and instead have just added some debug output to the module and will include the whole thing. I hope that it is reproducible on other peoples' machines, I have not been able to try it out on anything other than my own system (Windows Vista laptop, LuaJIT compiled with Visual C++ 2005 Express). You can get a work-in-progress version of diff_match_patch.lua from: http://pastebin.com/f70006a0b ...save it as "diff_match_patch.lua" in a require-able path and run this short test script from the LuaJIT command prompt: local dmp = require 'diff_match_patch' jit.off() dmp.settings{Match_Distance=100, Match_Threshold=0.5} assert(6 == dmp.match_bitap('abcdefghijk', 'fgh', 6)) assert(6 == dmp.match_bitap('abcdefghijk', 'fgh', 1)) assert(5 == dmp.match_bitap('abcdefghijk', 'efxhi', 1)) assert(3 == dmp.match_bitap('abcdefghijk', 'cdefxyhijk', 6)) What should happen is that you will see a lot of pairs of values separated by a double-dash, e.g.: -- 1 1 -- 2 2 -- Each pair of values should be either the same number twice, or nil and 0. Hopefully, this is the output you will get at this point. None of the assertions in the code should fail. Now comment out the jit.off() line, and run it again. (You may need to start a new session of the command prompt, I'm not sure.) What happens for me is the final assertion fails, and reading back the pairs of values, in a lot of cases towards the end, the first number is not zero or nil but the second value *is* zero (which shouldn't be possible): -- 64 0 -- 128 0 -- 256 0 -- 512 0 -- . . . luajit.exe: runtests.lua:7: assertion failed! Look at the for-loop starting at line 1660 of diff_match_patch.lua to see where these values get output. (In fact they are written to a table first then output outside of the loop - using print() or string concatenation inside the loop stops the behaviour from happening for me.) -Duncan [1] http://google-diff-match-patch.googlecode.com/ From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 14:08:20 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGG8HSP015507; Mon, 16 Nov 2009 14:08:17 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D51F41939C; Mon, 16 Nov 2009 14:07:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mxout3.netvision.net.il (mxout3.netvision.net.il [194.90.6.2]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2364D19349 for ; Mon, 16 Nov 2009 14:07:40 -0200 (BRST) Received: from [93.173.107.16] by mxout3.netvision.net.il (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0KT700FQ9M43JS40@mxout3.netvision.net.il> for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 18:07:16 +0200 (IST) Date: Mon, 16 Nov 2009 18:07:20 +0200 From: Shmuel Zeigerman Subject: Re: luac and loadstring hang In-reply-to: <20091116133546.A29373@lua.tecgraf.puc-rio.br> To: Lua list Message-id: <4B0178B8.5040601@013net.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > In my old Pentium II with 256Mb of memory running Linux the process is > killed by the OS after a while. Roberto has suggested that it's probably > a paging problem. In newer machines with larger memory the program runs > correctly, aborting with a sensible error message (bad constant). Yes, my machine is old and also has 256 MB of memory. Now that I was testing more thoroughly, I had the test finished with an error message on both Windows and Ubuntu, it just took a long time to finish (Windows = 85 sec., Ubuntu = 13 sec.) -- Shmuel From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:02:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGH2JQF002198; Mon, 16 Nov 2009 15:02:20 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CE5DF193B1; Mon, 16 Nov 2009 15:01:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from asmtpout030.mac.com (asmtpout030.mac.com [17.148.16.105]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BDC991936C for ; Mon, 16 Nov 2009 15:01:21 -0200 (BRST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [192.168.1.34] ([92.104.14.51]) by asmtp030.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KT70078FOL3HV50@asmtp030.mac.com> for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 09:01:12 -0800 (PST) Subject: Re: LuaJIT startup performance From: Petite Abeille In-reply-to: <20091116123810.GA8344@mike.de> Date: Mon, 16 Nov 2009 18:00:39 +0100 Message-id: References: <20091116123810.GA8344@mike.de> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 16, 2009, at 1:38 PM, Mike Pall wrote: > It wouldn't hurt. But you wouldn't see much of a difference, > either. If the Lua code for request handling is only run once, > it's probably not compiled at all. So you're not getting any > benefit from a JIT compiler. While at this conjuncture the JIT itself doesn't make much of a difference for a typical Web app, the VM does: % lua -v Nanoki.lua . 0 1080 Requests per second: 773.17 [#/sec] (mean) % luajit -v Nanoki.lua . 0 1080 Requests per second: 1174.19 [#/sec] (mean) % luajit -v -joff Nanoki.lua . 0 1080 Requests per second: 1167.37 [#/sec] (mean) http://article.gmane.org/gmane.comp.lang.lua.general/58851 Also, if the "CGI" type launcher supports persistent connections by reusing a process for the lifetime of a connection, then one might benefit from the JIT itself at some point. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:10:27 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHAOjN004172; Mon, 16 Nov 2009 15:10:24 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 803AD1937C; Mon, 16 Nov 2009 15:09:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 16C5119359 for ; Mon, 16 Nov 2009 15:09:47 -0200 (BRST) Received: by iwn8 with SMTP id 8so4351845iwn.33 for ; Mon, 16 Nov 2009 09:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DxaqDOeCWZd5CYfM0utI5yPDbIpeVF4GqtbedaOe6CQ=; b=LtQMK1tKU/KFx26iPRkLsXDJnxiUQsdIsznT/BjJCjH17h+vWfWY4akKzWXfBZwM4z uY3umX1JkYMMmRY0kkKUWhRITqSHfypSPQja5E9avj4ApL7NmuqiZeaKHhzErKtyTlbT zjfz1pYlMQtNAMUxgJKdIl7jvcIQk5gamVZ2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hwDKCuRGIo0MITOMW9sxTF1uu3Z0A1VL9CwSyIIJ8hmwcTNBAGC6IJrnr2IO1WPcEZ /ydstWJ7FMcpWVINb/1+tkzYVQZmNMb/EFiRGf4tpUFz3N4M4BYlu+BhvSidkW+zl1yJ KM1P8SV7oNszUDejJTugZTu3lc4F38+WjEnEE= MIME-Version: 1.0 Received: by 10.231.61.195 with SMTP id u3mr51030ibh.12.1258391228255; Mon, 16 Nov 2009 09:07:08 -0800 (PST) In-Reply-To: References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <20091116121007.GA32472@inf.puc-rio.br> Date: Mon, 16 Nov 2009 18:07:08 +0100 Message-ID: <9386fb2d0911160907s5414da72r8fc2663a7677d5f1@mail.gmail.com> Subject: Re: get time in ms? From: Pierre LeMoine To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > At this point though the question for Microsoft would probably be: How many things will break if we fix this? After all it works as documented by Microsoft. It's just that their choice isn't standards compliant. I'm confused. What standards are we talking about? /Pierre From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:15:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHDX4M004860; Mon, 16 Nov 2009 15:13:34 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BD61B193BB; Mon, 16 Nov 2009 15:13:00 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtpout4.mclink.it (smtpout4.mclink.it [195.110.128.205]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4640E19399 for ; Mon, 16 Nov 2009 15:12:53 -0200 (BRST) Received: from mailhubirp.mclink.it (mailhubirp.mclink.it [195.110.128.218]) by smtpout4.mclink.it (8.13.6/8.13.6) with ESMTP id nAGHCoCO063650 for ; Mon, 16 Nov 2009 18:12:50 +0100 (CET) (envelope-from erix@erix.it) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ajk1ACcXAUvDbohb/2dsb2JhbACZM71whDwE Received: from smail1.mclink.it ([195.110.136.91]) by mail.mclink.it with ESMTP; 16 Nov 2009 18:12:51 +0100 Received: from [192.168.127.128] (host254-98-dynamic.45-79-r.retail.telecomitalia.it [79.45.98.254]) (authenticated bits=0) by smail1.mclink.it (8.12.9p2/8.12.9) with ESMTP id nAGHCmK9019164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 16 Nov 2009 18:12:49 +0100 (CET) (envelope-from erix@erix.it) Message-ID: <4B018812.2030904@erix.it> Date: Mon, 16 Nov 2009 18:12:50 +0100 From: Enrico Colombini User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: luac and loadstring hang References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> <20091116154204.GB11531@inf.puc-rio.br> <20091116134732.B29497@lua.tecgraf.puc-rio.br> In-Reply-To: <20091116134732.B29497@lua.tecgraf.puc-rio.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Luiz Henrique de Figueiredo wrote: > "We learned that malloc should return NULL in case of out-of-memory. > However, it is not the case in Linux. By default, Linux uses > optimistic memory allocation strategy. Under this strategy, > Linux assumes there always exists free memory. The memory region > returns by malloc is not actually allocated until the process > touches the memory region. This means the memory region returns > by malloc may not be available. In case of out-of-memory, the > OOM Killer in Linux will pick up one or more process to kill." > http://ahlamnote.blogspot.com/2007/04/optimistic-memory-allocation-strategy.html The number of things one learns just by reading this list is amazing! Today I've already been surprised twice :-) Enrico From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:17:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHHeYx005944; Mon, 16 Nov 2009 15:17:40 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id ECC88193C4; Mon, 16 Nov 2009 15:17:07 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 58556193BF for ; Mon, 16 Nov 2009 15:17:01 -0200 (BRST) Received: by bwz27 with SMTP id 27so5884239bwz.21 for ; Mon, 16 Nov 2009 09:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=uNG9fcBxrex8WtcxnzaTKPMMmDX7EdM6C6xPXQ+LOZA=; b=KBe5xE7tHJ/ctkA3a189Cut4NpX/SoQrl6AEgdgaFgZ2rIFjsGRDTOmacXeG1F8J/U 1JXPQsRfIL/tte9RWS22WCTSI0FFbnAVfBUdKXzPpojAjvGSaF4JPR6MNBbT3RYsjRUb bujtiRW/dsJ0o9p+4Yr8wZJp0wznmuJCWhIac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=YVB5jhnVtEg8zci0v8mGtFGRj585ZQ8VsxNzXyyys9tqhFHUGfexT4EGofmcUh1BJV Q5FkKq9URfe/IR+4qWQEub7cvxzEpZ5vNmmMvtz0Il674oYK/zsCbC9niWoONYpmlMEa 3z8XF4fbDKSQaFxL11lqE8Iv+buKP29lwAKkY= Received: by 10.102.235.5 with SMTP id i5mr3844999muh.36.1258391819789; Mon, 16 Nov 2009 09:16:59 -0800 (PST) Received: from ?192.168.1.34? (51-14.104-92.cust.bluewin.ch [92.104.14.51]) by mx.google.com with ESMTPS id w5sm12082514mue.7.2009.11.16.09.16.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Nov 2009 09:16:59 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: get time in ms? From: Petite Abeille In-Reply-To: <4B010BC4.1070909@erix.it> Date: Mon, 16 Nov 2009 18:16:28 +0100 Content-Transfer-Encoding: 7bit Message-Id: <4A848365-5708-4D8D-8447-3A39FF5E6099@gmail.com> References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <4B010BC4.1070909@erix.it> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Nov 16, 2009, at 9:22 AM, Enrico Colombini wrote: > What about the Mac? CPU time, I suppose, being Unix-based? CPU time, yes. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:23:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHNWpA007703; Mon, 16 Nov 2009 15:23:33 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2A3AC1937F; Mon, 16 Nov 2009 15:23:01 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1C8B819235 for ; Mon, 16 Nov 2009 15:22:54 -0200 (BRST) Received: by ywh40 with SMTP id 40so3274203ywh.33 for ; Mon, 16 Nov 2009 09:22:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=JeNdOaboMbeUWukivEOspm2vtCyE37pdZdxe/ZC37h0=; b=bPT0hcYAA6Hge8oOumbUZTXQQK6HYST6yPgHWZ23GG1KfAjkIMu9JTu0O3EddjanI3 LtES4cLTdkDDJxYUg5Tn0Gtkuv9BHTXglDNePK7YaxY5h0yP8Jc0Yp4bH1VEX2t6ropy yoLtBtVvdZLgh13uoSyKDtMqcXogjdPxCcr+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ar9EPeE1zcewT06PerlmnMvgVdybYoLYapZNGyl65ze2FPoVPWso2FPgIUIOyaKJL6 a8InP9U2vF0zaSgCPrrvhF4qKcbHynqS74I74HTCimIWBcZe+wuj/RcZRphyuvWtq+gn EtKhMDs7awuvGVx4XM9WKpfelZNDVsIvP6zYs= MIME-Version: 1.0 Received: by 10.239.183.23 with SMTP id s23mr767206hbg.56.1258392171108; Mon, 16 Nov 2009 09:22:51 -0800 (PST) In-Reply-To: <20091116123810.GA8344@mike.de> References: <20091116123810.GA8344@mike.de> From: =?ISO-8859-1?Q?Lu=EDs_Eduardo_Jason_Santos?= Date: Mon, 16 Nov 2009 15:22:31 -0200 Message-ID: Subject: Re: LuaJIT startup performance To: Lua list Content-Type: multipart/alternative; boundary=001485f7755658db480478804284 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --001485f7755658db480478804284 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Nov 16, 2009 at 10:38 AM, Mike Pall wrote: > > Maybe the real question I'd like to ask is: would it hurt to run a > cgi-based > > application using LuaJIT? > > It wouldn't hurt. But you wouldn't see much of a difference, > either. If the Lua code for request handling is only run once, > it's probably not compiled at all. So you're not getting any > benefit from a JIT compiler. > > I know, but there are some cases where there are a number of repetitive tasks to be performed, and I just wanted to have these cases covered in cas= e there was nothing to lose for the ordinary cases. > Consider using FastCGI which eliminates the process startup > overhead. And keep the same lua_State alive across many requests, > so the Lua code can get compiled. This should give you much better > performance. > > I know, but as I need to install in several environments, I'd like to kee= p most possibilities open (and CGI is the most problematic in terms of performance). --=20 Lu=EDs Eduardo Jason Santos --001485f7755658db480478804284 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Nov 16, 2009 at 10:38 AM, Mike Pall <mikelu-0911@mike.d= e> wrote:
> Maybe the real question I'd like to ask is: woul= d it hurt to run a cgi-based
> application using LuaJIT?

It wouldn't hurt. But you wouldn't see much of a difference,<= br> either. If the Lua code for request handling is only run once,
it's probably not compiled at all. So you're not getting any
benefit from a JIT compiler.

I know, but there are some cases where there are a nu= mber of repetitive tasks to be performed, and I just wanted to have these c= ases covered in case there was nothing to lose for the ordinary cases.
=A0
Consider using FastCGI which eliminates the process startup
overhead. And keep the same lua_State alive across many requests,
so the Lua code can get compiled. This should give you much better
performance.

I know, but as I need to install in several environmen= ts, I'd like to keep most possibilities open (and CGI is the most probl= ematic in terms of performance).
=A0
--
Lu=EDs Eduardo Jason Santos
--001485f7755658db480478804284-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:54:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHsmAp016337; Mon, 16 Nov 2009 15:54:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 74737193D3; Mon, 16 Nov 2009 15:54:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 33FDC1937C for ; Mon, 16 Nov 2009 15:54:03 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1NA5m2-0002vd-J5 for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 18:53:58 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1NA5m0-0007Je-Kv for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 18:53:56 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: luac and loadstring hang References: <4B0140FA.4090808@013net.net> <20091116101951.A28733@lua.tecgraf.puc-rio.br> <4B01487F.9040303@013net.net> <20091116133546.A29373@lua.tecgraf.puc-rio.br> <20091116154204.GB11531@inf.puc-rio.br> <20091116134732.B29497@lua.tecgraf.puc-rio.br> <20091116155629.2a3d3360@trite.i.flarn.net.i.flarn.net> Date: Mon, 16 Nov 2009 18:53:56 +0100 In-Reply-To: <20091116155629.2a3d3360@trite.i.flarn.net.i.flarn.net> (Rob Kendrick's message of "Mon, 16 Nov 2009 15:56:29 +0000") Message-ID: <87einy5paj.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Rob Kendrick: > You can turn off this over-commit by uttering the correct rune > into /proc somewhere, if memory serves. vm.overcommit_memory = 2 is the magic incantation. Some garbage collectors don't work as a result, though, because they allocate the heap as one block at program start. SBCL is pretty obnoxious in this regard because it scales its heap so that you can only start one or two instances in parallel, no matter how much additional swap you add. I tend to use it on most machines, though, because it makes OOM failures somewhat more predictable. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 15:55:43 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGHtasj016676; Mon, 16 Nov 2009 15:55:39 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5443B18EBE; Mon, 16 Nov 2009 15:54:41 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from p3plsmtpa01-09.prod.phx3.secureserver.net (p3plsmtpa01-09.prod.phx3.secureserver.net [72.167.82.89]) by bazar2.conectiva.com.br (Postfix) with SMTP id 330E118A87 for ; Mon, 16 Nov 2009 15:54:35 -0200 (BRST) Received: (qmail 25800 invoked from network); 16 Nov 2009 17:54:31 -0000 Received: from unknown (98.117.140.83) by p3plsmtpa01-09.prod.phx3.secureserver.net (72.167.82.89) with ESMTP; 16 Nov 2009 17:54:31 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: get time in ms? From: Mark Hamburg In-Reply-To: <9386fb2d0911160907s5414da72r8fc2663a7677d5f1@mail.gmail.com> Date: Mon, 16 Nov 2009 09:54:33 -0800 Message-Id: <80AC9543-6453-4072-A7F2-0830087F5EFA@grubmah.com> References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <20091116121007.GA32472@inf.puc-rio.br> <9386fb2d0911160907s5414da72r8fc2663a7677d5f1@mail.gmail.com> To: Lua list X-Mailer: Apple Mail (2.1077) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAGHtasj016676 On Nov 16, 2009, at 9:07 AM, Pierre LeMoine wrote: >> At this point though the question for Microsoft would probably be: How many things will break if we fix this? After all it works as documented by Microsoft. It's just that their choice isn't standards compliant. > I'm confused. What standards are we talking about? Microsoft's C library is evidently non-compliant with the ISO C standard. On the other hand, it is compliant with their documented behavior and there are probably a lot of Windows applications that depend on that behavior. Messing up standards compliance with a successful product makes for painful choices all around -- but Microsoft has plenty of experience with that. Mark From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 16:09:25 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGI9Lj1019993; Mon, 16 Nov 2009 16:09:21 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 4A8C5193D4; Mon, 16 Nov 2009 16:08:48 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0D04D193C8 for ; Mon, 16 Nov 2009 16:08:42 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAGI8fCY023306 for ; Mon, 16 Nov 2009 16:08:41 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id DFFE454C03F; Mon, 16 Nov 2009 16:08:41 -0200 (BRST) Date: Mon, 16 Nov 2009 16:08:41 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: get time in ms? Message-ID: <20091116180841.GA18337@inf.puc-rio.br> References: <20091113133709.45382dba@o> <41A3E1C9-B150-407B-95DC-F93A16DF21AA@dnainternet.net> <4B00BBB7.3040309@gmail.com> <20091116121007.GA32472@inf.puc-rio.br> <9386fb2d0911160907s5414da72r8fc2663a7677d5f1@mail.gmail.com> <80AC9543-6453-4072-A7F2-0830087F5EFA@grubmah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80AC9543-6453-4072-A7F2-0830087F5EFA@grubmah.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > Microsoft's C library is evidently non-compliant with the ISO C > standard. On the other hand, it is compliant with their documented > behavior [...] Not exactly, because its documented behavior also claims that it is compliant (or "compatible") with ANSI C. -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 17:01:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGJ11NP001786; Mon, 16 Nov 2009 17:01:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 9B7721936F; Mon, 16 Nov 2009 16:27:30 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A533D1934D for ; Mon, 16 Nov 2009 16:27:24 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1NA6IK-0006n9-00; Mon, 16 Nov 2009 19:27:20 +0100 Date: Mon, 16 Nov 2009 19:27:11 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 Message-ID: <20091116182711.GA22497@mike.de> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Duncan Cross wrote: > What happens for me is > the final assertion fails, and reading back the pairs of values, in a lot of > cases towards the end, the first number is not zero or nil but the second > value *is* zero (which shouldn't be possible): Thank you for the report and the test case! It's a bug in the bytecode generation for some conditionals, which shows only in compiled code. Patch attached. BTW: You'll get better performance if you don't fill the rd[] array backwards. It degrades into a hash table in this case. You could just do a quick forward fill before the loop: for j=start,finish do rd[j] = 0 end --Mike --qMm9M+Fa2AknHoGS Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="beta2_condbc.patch" --- a/src/lj_parse.c +++ b/src/lj_parse.c @@ -636,6 +636,7 @@ static void invertjump(FuncState *fs, ExpDesc *e) static BCPos jumponcond(FuncState *fs, ExpDesc *e, int cond) { + BCPos pc; if (e->k == VRELOCABLE) { BCIns *i = bcptr(fs, e); if (bc_op(*i) == BC_NOT) { @@ -648,9 +649,10 @@ static BCPos jumponcond(FuncState *fs, ExpDesc *e, int cond) reserveregs(fs, 1); discharge2reg(fs, e, fs->freereg-1); } - freeexp(fs, e); emitAD(fs, cond ? BC_ISTC : BC_ISFC, NO_REG, e->u.s.info); - return emit_jump(fs); + pc = emit_jump(fs); + freeexp(fs, e); + return pc; } static void goiftrue(FuncState *fs, ExpDesc *e) --qMm9M+Fa2AknHoGS-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 17:08:15 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGJ7XKm003113; Mon, 16 Nov 2009 17:07:36 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 78A8C1936C; Mon, 16 Nov 2009 17:06:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f221.google.com (mail-fx0-f221.google.com [209.85.220.221]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 094D41934F for ; Mon, 16 Nov 2009 17:06:50 -0200 (BRST) Received: by fxm21 with SMTP id 21so3046730fxm.21 for ; Mon, 16 Nov 2009 11:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5UdTKlCxsEA3qExXZpDNkvblO7WEpp5HZtNPrlfb2/g=; b=mupasKwpT49VE6nb2fwc4BpOCLsgO9HF8NzcBs8W0Jo2Y9QerDLacGQhESR8/XYqMK Zn/0c6d9nYOlZB29ryhNrvSN9n1tG9wtYxo0z5icYOmP+DD5fj8vuvSkSJoP0HNjX9W0 RO37NJAH5V2It/+bul6LtmlZQwNFZwrk0mD5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=woW2qbhp4vOFhUr5UnTUWaIuDF17M41OgoW2tGnXeumv+KGb3jFOf3SYZjawP5xkWr oZuTuft1nwrx5K0JjUaWkjm+nu1ehBNvQynbic27KmldXZbz+hpwGDUXLQXGyx19Hsz4 3vmmcSJhgXjl6OxZTiwLfI6kBrroIzWlLrXPw= MIME-Version: 1.0 Received: by 10.223.24.87 with SMTP id u23mr1272999fab.81.1258398408172; Mon, 16 Nov 2009 11:06:48 -0800 (PST) In-Reply-To: <20091116182711.GA22497@mike.de> References: <20091116182711.GA22497@mike.de> Date: Mon, 16 Nov 2009 19:06:48 +0000 Message-ID: Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 From: Duncan Cross To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAGJ7XKm003113 On Mon, Nov 16, 2009 at 6:27 PM, Mike Pall wrote: > Duncan Cross wrote: >> What happens for me is >> the final assertion fails, and reading back the pairs of values, in a lot of >> cases towards the end, the first number is not zero or nil but the second >> value *is* zero (which shouldn't be possible): > > Thank you for the report and the test case! It's a bug in the > bytecode generation for some conditionals, which shows only in > compiled code. Patch attached. Great! Now all the tests run perfectly. (And, of course, quickly.) > BTW: You'll get better performance if you don't fill the rd[] > array backwards. It degrades into a hash table in this case. > You could just do a quick forward fill before the loop: >  for j=start,finish do rd[j] = 0 end Ah, yeah, good point. Thanks! -Duncan From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 18:34:58 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGKYt3u021878; Mon, 16 Nov 2009 18:34:55 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6B2BA19219; Mon, 16 Nov 2009 18:34:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0C6D518FDF for ; Mon, 16 Nov 2009 18:34:19 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGKYHJT021521 for ; Mon, 16 Nov 2009 18:34:17 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAGKYG730432; Mon, 16 Nov 2009 18:34:16 -0200 Date: Mon, 16 Nov 2009 18:34:16 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 Message-ID: <20091116183416.B30402@lua.tecgraf.puc-rio.br> References: <20091116182711.GA22497@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from duncan.cross@gmail.com on Mon, Nov 16, 2009 at 07:06:48PM +0000 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > BTW: You'll get better performance if you don't fill the rd[] > array backwards. It degrades into a hash table in this case. That probably also applies to plain Lua. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 19:56:26 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGLuNmF001649; Mon, 16 Nov 2009 19:56:23 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C123F1932B; Mon, 16 Nov 2009 19:55:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F2EE2192A5 for ; Mon, 16 Nov 2009 19:55:45 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so2382563fgb.17 for ; Mon, 16 Nov 2009 13:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=tjBsY3BuQYYmbVl1kGqiSNChGhxi4Sp4Cl6lY1DsZko=; b=qMGJsQPmX/o3mSICUVZvMFd+5ypkM9ToMq8tH5d+Veh7SBbVmnaN5YTRLDlTFDPHRt /ndvG65kEALdK8jRtyTVap8q5tNGyI1qnyqhOdvLS6amo2I/Onc5hfCa5N4hle32EG6I ezzLU1AQ95TijSwK99HdP5kjGNksHISpWJPAA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=XCT+YbCSKljDi0JzSBWSAqyJZqRS5eopKGXKVK8GLkPP0AUl+BXmcuUC1yNTTYV19v B68ppGjdCnq2ajlnBxJMvT4Cv2xxtpkgQq9RIfeSzIMpxZ7k7FHKA4yBI5fVFNL4uxmr OOu5HwWEQTA/p5kUaYQGsAGfjFhTpx3yOUQhI= MIME-Version: 1.0 Received: by 10.103.125.17 with SMTP id c17mr3677167mun.16.1258408543578; Mon, 16 Nov 2009 13:55:43 -0800 (PST) Date: Mon, 16 Nov 2009 16:55:43 -0500 Message-ID: <372b07510911161355w5630e509rb8c5a8664249fa9d@mail.gmail.com> Subject: function pointers in Lua From: cynthia powers To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=0016e65c7dc238ec2a04788412b6 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e65c7dc238ec2a04788412b6 Content-Type: text/plain; charset=ISO-8859-1 Hi. still a Lua newbie.. How do you specify function pointers in lua, and more importantly call them? This case does not seem to work for me: A.lua: function_1 (..., my_function, ..) .. while (Hi.
still a Lua newbie..
How do you specify function pointers in lua, and more importantly call= them?
This case does not seem to work for me:
=A0
A.lua:
=A0
function_1 (..., my_function, ..)
..
while (<a function defined in c-world) do
=A0=A0=A0 my_function()
end
..
end
=A0
function_1 (.., my_function,..)
=A0
=A0
thanks
cynthia
--0016e65c7dc238ec2a04788412b6-- From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 21:16:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAGNG2uf009484; Mon, 16 Nov 2009 21:16:02 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E088D19288; Mon, 16 Nov 2009 21:15:27 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id CC0621917B for ; Mon, 16 Nov 2009 21:15:21 -0200 (BRST) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id XIF10814 for ; Tue, 17 Nov 2009 10:15:14 +1100 Message-ID: <4B01DD02.4040807@infinite-interactive.com> Date: Tue, 17 Nov 2009 10:15:14 +1100 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: function pointers in Lua References: <372b07510911161355w5630e509rb8c5a8664249fa9d@mail.gmail.com> In-Reply-To: <372b07510911161355w5630e509rb8c5a8664249fa9d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Works for me, the problem must be elsewhere. === start code === function my_function() print("foo") end function function_1(my_function) my_function() end function_1(my_function) --> foo === end code === Mark Feldman cynthia powers wrote: > Hi. > still a Lua newbie.. > How do you specify function pointers in lua, and more importantly call > them? > This case does not seem to work for me: > > A.lua: > > function_1 (..., my_function, ..) > .. > while (
my_function() > end > .. > end > > function_1 (.., my_function,..) > > > thanks > cynthia This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 22:29:53 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH0ToAl016433; Mon, 16 Nov 2009 22:29:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 253CE19289; Mon, 16 Nov 2009 22:29:18 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from exu.inf.puc-rio.br (exu.inf.puc-rio.br [139.82.16.3]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 94924190B5 for ; Mon, 16 Nov 2009 22:29:12 -0200 (BRST) Received: from localhost.localdomain (arraial.inf.puc-rio.br [139.82.20.63]) by exu.inf.puc-rio.br (8.13.8/8.13.8) with ESMTP id nAH0T98p024106 for ; Mon, 16 Nov 2009 22:29:11 -0200 Received: by localhost.localdomain (Postfix, from userid 1000) id 4A2CA54C03F; Mon, 16 Nov 2009 22:29:10 -0200 (BRST) Date: Mon, 16 Nov 2009 22:29:10 -0200 From: Roberto Ierusalimschy To: Lua list Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 Message-ID: <20091117002910.GA5414@inf.puc-rio.br> References: <20091116182711.GA22497@mike.de> <20091116183416.B30402@lua.tecgraf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091116183416.B30402@lua.tecgraf.puc-rio.br> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean > > BTW: You'll get better performance if you don't fill the rd[] > > array backwards. It degrades into a hash table in this case. > > That probably also applies to plain Lua. It degrades into a hash while it is being filled, but when it finishes I think the result is always a pure array. (I proved this some time ago, but I am not sure the algorithm is still exactly the same.) -- Roberto From lua-bounces@bazar2.conectiva.com.br Mon Nov 16 23:51:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH1pn0F025320; Mon, 16 Nov 2009 23:51:49 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E029619169; Mon, 16 Nov 2009 23:51:14 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound-mail-28.bluehost.com (outbound-mail-28.bluehost.com [69.89.17.198]) by bazar2.conectiva.com.br (Postfix) with SMTP id 19EB218FC9 for ; Mon, 16 Nov 2009 23:51:08 -0200 (BRST) Received: (qmail 313 invoked by uid 0); 17 Nov 2009 01:51:05 -0000 Received: from unknown (HELO host266.hostmonster.com) (74.220.215.66) by outboundproxy2.bluehost.com with SMTP; 17 Nov 2009 01:51:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=whoopdedo.org; h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:Organization:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=E5FwucD6i7f49Ca2IO8ZBNLNq6JAMzddWZxYA/ux3XiB3rIcPK16Gbjmtvc3OYNE5UTOVERMx9vplJ0rdD8yuyYL7kGn78NpNfwwh86Ex3Tr3aeju7CSnAeVVdhG+KOR; Received: from 64-203-156-199.dmt.ntelos.net ([64.203.156.199] helo=whoopdedo.org) by host266.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NADDl-0007Kr-Da for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 18:51:05 -0700 Date: Mon, 16 Nov 2009 20:50:59 -0500 From: TNHarris To: Lua list Subject: Re: New metamethod for method lookup Message-ID: <20091116205059.61de7772@egeria.whoopdedo.org> In-Reply-To: <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> Organization: WhoopDeDo.org X-Mailer: Sylpheed-Claws 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Identified-User: {2390:host266.hostmonster.com:whoopded:whoopdedo.org} {sentby:smtp auth 64.203.156.199 authed with whoopdedo+whoopdedo.org} X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, 16 Nov 2009 08:48:19 +0200 steve donovan wrote: > > But any Lua programmer does expect this equivalence, it's as basic as > p[i] == *(p + i) in C. > Just as it's expected for T:F() to do the same thing as T.F(T). Either way, an assumption needs to be altered. And there's also the case of wanting to call a variable method name. You wouldn't be able to do T[V](T) anymore. > This is the part that worries me. We have a very simple mechanism, > which still takes a little while to 'get' if you're new to it. Adding > another layer of lookup may confuse people? > > Also, anything done to something as basic as method lookup must not > hit performance. > I'm less enthusiastic about the proposal today than yesterday. Perhaps the difficulty with __index is to remind us that Lua is not an OO language and we shouldn't be trying to make it one. I'm also reminded how you can use __call for subscripting. Instead of s['intersection'] you'd say s('intersection') and it doesn't step on the toes of s.intersection. -- tom telliamed@whoopdedo.org From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 00:15:02 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH2EwlW028260; Tue, 17 Nov 2009 00:14:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E807919299; Tue, 17 Nov 2009 00:14:32 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 335D718658 for ; Tue, 17 Nov 2009 00:14:21 -0200 (BRST) Received: by ywh40 with SMTP id 40so3716550ywh.33 for ; Mon, 16 Nov 2009 18:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:references :subject:message-id:x-mailer:mime-version:content-type; bh=fXdwodG3Anb+hWDv6/At11HY4kh8WbOQgLBv00nWNVw=; b=NjwTcM9MzBJJQXl0C5LiMZ3UwXGp9pHKNz0OdIcNlURomvNaTJvtSEqiC1xz/xQJbN IkayX3iuz4YYzf4Mu0yelAGHN7orkxdXTxudYyru9Ko4e3B4ZE29/xditRiClx3s26Q3 GvQrMCFwWsJ7mKioDU6Z29Dg7fivuHZWZejwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:references:subject:message-id:x-mailer:mime-version :content-type; b=nkZDhopagmCweHkglRE44DxoJV9QsENrZOupIBGc6aRFLMwh9pUIuPQ65u6MJD/IfG aJFyyqBE9z/uWCWclgLjS7gjEAQR3D9nnTEo7io/d8Q+jA8KDdhIsxJ+pGsImIn6QV57 XrfrMhmQ2NEAHC7xS11iOlkJJU4z+8HhYoq2E= Received: by 10.90.42.39 with SMTP id p39mr5532444agp.86.1258424058973; Mon, 16 Nov 2009 18:14:18 -0800 (PST) Received: from IBM-73F5CA019D1 ([122.237.129.51]) by mx.google.com with ESMTPS id 39sm1339090yxd.9.2009.11.16.18.14.16 (version=SSLv3 cipher=RC4-MD5); Mon, 16 Nov 2009 18:14:17 -0800 (PST) Date: Tue, 17 Nov 2009 10:14:15 +0800 From: "YangFan" To: "Lua list" References: <200911141243123591007@gmail.com>, <200911161311598432152@gmail.com> Subject: Re: Re: Re: LuaJIT 2 crashes on lua_pcall ? Message-ID: <200911171014125317651@gmail.com> X-mailer: Foxmail 6, 15, 201, 22 [cn] Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====001_Dragon857538805642_=====" X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean This is a multi-part message in MIME format. --=====001_Dragon857538805642_===== Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 SGkgTWlrZSwNCj4NCj5CdXQgdGhlcmUncyBhIGdlbmVyYWwgY2F2ZWF0IG9uIFdpbmRvd3M6IGFs bCBDIHN5bWJvbHMgKGUuZy4NCj5sdWFfcGNhbGwpIGFyZSBib3VuZCB0byBhIHNwZWNpZmljIERM TCBuYW1lLiBUaGlzIG1lYW5zIHRoYXQgeW91DQo+bmVlZCB0byBrZWVwIHRoZSBuYW1lIG9mIHRo ZSBMdWEgRExMIChpLmUuIGx1YTUxLmRsbCkgZm9yIHRoZQ0KPkx1YUpJVCBETEwsIHRvby4NCg0K SSdtIHN1cmUgSSB1c2UgdGhlIHNhbWUgRExMIG5hbWUuDQoNCj4NCj5JZiBzb21lIHBhcnRzIG9m IHlvdXIgY29kZSBsaW5rIHRvIHRoZSBMdWFKSVQgRExMIChiZWNhdXNlIHlvdQ0KPnVzZWQgYSBu ZXcgbmFtZSksIGJ1dCBvdGhlciBwYXJ0cyAobGlrZSBhIGxvYWRhYmxlIG1vZHVsZSkgbGluayB0 bw0KPnRoZSBMdWEgRExMLCB5b3UgYXJlIGd1YXJhbnRlZWQgdG8gZ2V0IGEgY3Jhc2guDQo+DQo+ DQo+QSBzY3JlZW4gY2FwdHVyZSBwcm9iYWJseSB3b3VsZG4ndCBoZWxwLiBJIG5lZWQgYSAoc21h bGwpIHRlc3QNCj5jYXNlIHRoYXQgaWxsdXN0cmF0ZXMgdGhlIHByb2JsZW0uIEFuZCBJIG5lZWQg c291cmNlIGNvZGUgdG8NCj5kaWFnbm9zZSB0aGlzLCBsaWtlIGEgc21hbGwgQyBwcm9ncmFtIHBs dXMgYSBMdWEgcHJvZ3JhbSB0aGF0DQo+c2hvd3MgdGhlIGNyYXNoLg0KDQpJIGhhdmUgd3JpdHRl biBhIHBpZWNlIG9mIGNwcCBjb2RlLCBpdCB3b3JrcyB1bmRlciBXaW5kb3dzIFhQIFBybyBTUDMs DQpzaG91bGQgYmUgY29tcGlsZWQgYnkgVkMyMDA4IHdpdGggbHVhYmluZCAwLjguMSB3aGljaCBk ZXBlbmRzIG9uIGJvb3N0DQpsaWJyYXJ5LiBBbHNvIGEgbHVhIHRlc3QgZnVuY3Rpb24gd2hpY2gg d2lsbCBiZSBjYWxsZWQgZnJvbSBjcHAgc291cmNlIGNvZGUuDQpTZWUgdGhlIGF0dGFjaG1lbnQu DQoNCkJ1aWxkIHRoaXMgcHJvamVjdCwgdGhlbiBydW4gdGhlIGV4ZWN1dGFibGUgd2l0aCBlaXRo ZXIgTHVhSklUIGRsbCBvciBvZmZpY2lhbA0KTHVhIGRsbC4gWW91IGNhbiBzZWUgYWZ0ZXIgcHJp bnRpbmcgMywgb2ZmaWNpYWwgTHVhIHdpbGwgcHVzaCBhbiBlcnJvciBtZXNzYWdlLCANCmJ1dCBM dWFKSVQganVzdCBjcmFzaGVzLg0KPg0KPlRoYXQgc2FpZCwgSSBoYXZlIG5vIG90aGVyIGJ1ZyBy ZXBvcnRzIGFib3V0IGx1YV9wY2FsbC4gSXQncyB1c2VkDQo+aW4gdGhlIHN0YW5kLWFsb25lIGV4 ZWN1dGFibGUgKGx1YWppdC5leGUpIHdpdGhvdXQgcHJvYmxlbXMuDQoNClllcywgSSBzZWUuIFNv IEkgZ3Vlc3MgbWF5YmUgbHVhaml0LmV4ZSBjYXRjaGVzIHRoZSBmYWxzZSBidXQgdGhlIGludGVy cHJldGVyIA0KY29yZSBkb2VzIG5vdC4NCj4NCj4tLU1pa2UNCg0KPSA9ID0gPSA9ID0gPSA9ID0g PSA9ID0gPSA9ID0gPSA9ID0gPSA9DQoJCQkNCg0KoaGhoaGhoaGhoaGhoaGhoVJlZ2FyZHMNCg0K IA0KCQkJCSANCqGhoaGhoaGhoaGhoaGhoaFZYW5nRmFuDQqhoaGhoaGhoaGhoaGhoaGhbWlzc2Rl ZXJAZ21haWwuY29tDQqhoaGhoaGhoaGhoaGhoaGhoaGhoTIwMDktMTEtMTcNCg== --=====001_Dragon857538805642_===== Content-Type: application/octet-stream; name="lua_pcall.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="lua_pcall.zip" UEsDBBQAAAAIAGVOcTvqV06ikgAAAN0AAAAQAAAAbHVhQ2xhc3NUZXN0Lmx1YU2OPQvCMBCGZwv9 Dze2Qwt+TAWnToIOgnuJl9MG04vkQ/Dfm2BJe9Nx9zwv7yMwemUY0Ao3Dp6cr+qygDi3uF+MDJra 55C49Ni8rWJfbWdGGxQaEI5ruj8H0WvhXLq110D2e2LnBSOtInZzBHYfoZUcJpruZKsaoGnAvDK3 Twp2ijNGC+dGE7T8l8/GIRrEsix+UEsDBBQAAAAIANBIcTtKvXxRWQEAAHMDAAANAAAAbHVhX3Bj YWxsLnNsbqWSv07DMBDGZyLlHaKwFKmO7DaiycBgJzEMgCoiwYjcxKmMTBzlT5fSJ2PgkXgFHJFE Ka0QKpu/+853P9/58/3DNO5EUqpKZbX1KKqGSSuum1QoK1ayqYXKLSokn1pUla9M5/CyaoMIOhCa xvmPSzMIPdNYluqFJ/XE3nok8IOIeMAjLgYIhRB4IUIAQgwDH2nXne3sC+vKsmXDnouESWlPR8LZ JIWu1sa2FNPARRSDhUsIcAPfB/gyjACklIRoMceUoJ1tGlGedgSmcS3ViknTOPs+xDqo8Sf94wKV Z2LdlKwVS8nqTD+zanmKkvdJ+vZZyFfN+u1J5POZNkeqNR+45Kzig93pIUED7bU/wOlwf6FRVT3G +dssnBGng3WrDQ+y9T7/idVII2TqwJNr9SM6ZOucf1bs+E5ZRj9nvZSCl7Xgx/7DjUgHfa9SrjMo vo2jow2GiGl8AVBLAwQUAAAACADKUHE7kUxKg7wEAABXEQAAEAAAAGx1YV9wY2FsbC52Y3Byb2rt WG1v0zAQ/gwS/2GK+ABCaZuk6wtZQXlpoKKDaWUbHyohx7m2ZkkcnGS0vPx3zknabmWFAAIJCWmu 7PPd+R7f+R5lR0+XUXhwBSJlPB4oWqOlHEBMecDi+UCZ+7qh6crTJ/fuHp2zNCfhJMsDxk8Efwc0 u3f3TjV7vUpgoJQqB86jRwpuna+d9hutlhS8JBEqhTl5m1AShsrW/NnZyB0onzzLc9qaZ6ndtm2r baffV62OO1Rbnme7WtewPFv7Is1OOc+ktzQhdNflC1h94CIYKBcsNnR5gJS+JmIOmSfQCHcvzzeA +52OZkiNJziOTkKSzbiIUrnaLuWiCL/yqkhBs7Bo3jA5es156LEQylXz5tLh8YzNc0EyPLsQ7ciu neOCn88/b0+78yrPkjxzmcD74mI1UO4/mPAwl2YofHj/wQ1P0snD0nAUZyAiCBjJ4Jr5foMb8jKz WrWzIIJQdDeBbCMscJTIcbYBcO6cCLBzFgbDK4gzuV3qN/caOHma8aiwqaP+5njskow8gxgEQVB1 bC7An4C4YhSwMparn7I9HrnjOnrO2OFRglnfeJXpSzIWsY/FnQ6UViW1goBJCQlHMQ3zYJMgBulA cR5Pj1cTvHP4gGPqFK+yfIFTvNOAi1TQKVa/z+LArK09ZeVZVQyYpkRwCmnKhQszFhcR4fEXo5eG br51h/bZM/Ot8+rl5NV4WBkdo1pEwlPwZbYGSibytT+bpIye5jHiBWcB9BJdGdVeJR4zXxCx2srP UjhB4OW1Bc+BBCC2t3RBRIxYxnAF4dameCGjWL694la9YjJQ2ut9lhI/hEkClM0YrZykqNDT+sqP ck1iMofgFFKeCwpVQmuVya/YIPgxiy9rvxSpXHr+ppBcSDDZ2MOLEgqZX9VH0MD5AS4OG5qcSsNN W5E9arejTO8/qNpz0RsasFxnWJ6O9SogwnAJpkSvNqrnBLupuVEfk9yfrNIMok0HqbrzMaELFstu 8yP4loygzj1hGtkM0lp3+sZF9Uuoo2qntK6qt3R4UkfRShJkJazUmhXD02x/dz1q3mji36eaUwiB pPBPkM3Fgoeydc+Rya+31P9s9BtstH6+w1g2TEyhYDH2cC+PaUEF5fP9dyjr5TeU9S337KJegy1I RrYXjKTE/QcoyvhPUbdQ1C5D7WMb7TfZpip+OIUZCIwC0t1icF4du9Zrj4flZ5D+n6b+Gk3tiMoP p22mSpWd9eYLq5giY1wjt0lR6AeFSnl0qTJQaJKY1KT4t1yaAcxMHoQmw7FI3pk+yUySRnIsS7Oz mL3PYRQgjAI9fq+2PadrdD1NdbrWodo2uh3VanU6qm4Zuts91C3d875co6Uy0qobQYgAr+CEZIuB 0phGhMUNDEmqb/Wb0qC6qjLuPTDLfnQbzIW5QKALxLiITBaHOKi5TIO9qPpGv39o9Fpqr2+7attv tdVeb2irHf3Qs4eH+tD27ApVncjWvea22AQ1GeUmzYXpR4kZhHNTUB1HZmI/MMU8NedsZr5L5jig +DEFpEsTg53JHzOJ5+YHcrUXTKfrWh3L7qher9VS27TVU3t211J7hm1rumZZbkvbA6acVyX2LOQ+ Cavy2y6Omrf8WwTlXwFQSwMEFAAAAAgA3U5xO+44JYrHAgAAWAcAAAgAAABtYWluLmNwcH1UbWvb MBD+Hsh/UD0Y9vCy9GteCqFs7cDtuiZlg7YYRb4kAtkykpyylf736cWOLSerEizp7p57132gBWFV Bmj2ixYZf5Gj3cVw0FLljr3gkvaolEslAOddYsAqPNqVZdAV1LS11vul3g1fY4aDStJiiwqcgywx ASRVNj2mOpThaJ2lwNscI8LzHAoVMrqOUdC4p29BpMX0jzAsJbpMKnxpTiuQajh4HQ5KQfdYwWQ4 QHpJhRUlvtgnlKfl90KzCgJTjajWjBIH8CXDyBFf9eaW9qtSaDZDwUbwHBHFRWCuUGRs6qTehgN3 2HOaoT1mNEtzyNcg3lN3JQCUTsvZCXXvhfKzAvGnCeaEAbpB4Vkn3lriINWujhCaowJefFO1O61L 9RKgKlF00a3jb7akPY+962Tim719SBILssnbppuqICYq7etR9mt2N2HWM1oolGNanMJdA2M8Nh2X lgQzhpR2wsu5BViBpU44fEIJmtsrL0GrnLb8LQmTGCUPi/Tqcrn6cRejcTRF6CCQWIhuWRkmNa5p 9cnEsBzZMXKeVQyMwsDk5cZeg8iw2lw/+hWzTyCdeQm9CAPvHkQ+ZpTBJgy6XRnE6GOvJl12Hy+J dr2htW71lrXi9eYJMx6/Z+c5Npk5UulKbnS5Uwf1XOfyuDj3X5erxf3K1qfuhx0WSP7V7iyJoKV6 vFn8Tu8Wq+tnXezX8VstdgV1Ib5RBrd6Xi1C06BxFxqjBtsov8Nqdw8531vYsgSyCDuARkyPVoJV Krs8Xf2nJ9ZJ0khfggbhvqa9CxCCCzR3bZbxDXW90zPTDAAnHqH/jR+bMWWGvZ5ARs/n8+jwJNr+ c8+Gl0biXLe6W/VrdxswCZ6VQz1AbRlfY2ZbnAgsd6l5e4fgGl+bp2kFx+4fobO5/h6Nrn4Y78Zx gByH4s+2emt7iTAuoX7D7cQbm3nzD1BLAQIUABQAAAAIAGVOcTvqV06ikgAAAN0AAAAQAAAAAAAA AAAAIAAAAAAAAABsdWFDbGFzc1Rlc3QubHVhUEsBAhQAFAAAAAgA0EhxO0q9fFFZAQAAcwMAAA0A AAAAAAAAAAAgAAAAwAAAAGx1YV9wY2FsbC5zbG5QSwECFAAUAAAACADKUHE7kUxKg7wEAABXEQAA EAAAAAAAAAAAACAAAABEAgAAbHVhX3BjYWxsLnZjcHJvalBLAQIUABQAAAAIAN1OcTvuOCWKxwIA AFgHAAAIAAAAAAAAAAAAIAAAAC4HAABtYWluLmNwcFBLBQYAAAAABAAEAO0AAAAbCgAAAAA= --=====001_Dragon857538805642_=====-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 02:51:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH4p1nm011958; Tue, 17 Nov 2009 02:51:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id EB9EF1935E; Tue, 17 Nov 2009 02:50:28 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.223.178]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 718A9192A4 for ; Tue, 17 Nov 2009 02:50:23 -0200 (BRST) Received: by iwn8 with SMTP id 8so4827343iwn.33 for ; Mon, 16 Nov 2009 20:50:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.182.130 with SMTP id a44mr1082531iba.18.1258433422205; Mon, 16 Nov 2009 20:50:22 -0800 (PST) In-Reply-To: <20091115092856.A25054@lua.tecgraf.puc-rio.br> References: <20091115092856.A25054@lua.tecgraf.puc-rio.br> Date: Mon, 16 Nov 2009 23:50:22 -0500 X-Google-Sender-Auth: 19cccf5a6cf115dd Message-ID: Subject: Re: lua 1.0 patch - fixing compiler errors From: David Manura To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Sun, Nov 15, 2009 at 6:28 AM, Luiz Henrique de Figueiredo wrote: > lua-all.tar.gz contains patched versions of Lua 1.0 and others. Did you try that? Nope, but it looks like that would do. From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 02:59:16 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH4xBlX012588; Tue, 17 Nov 2009 02:59:12 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D21B419375; Tue, 17 Nov 2009 02:58:51 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.neoawareness.com (mail.neoawareness.com [67.223.232.27]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D8EF219357 for ; Tue, 17 Nov 2009 02:58:46 -0200 (BRST) Received: from localhost ([127.0.0.1] helo=neo6.sharedrealm.com) by mail.neoawareness.com with esmtpa (Exim 4.69) (envelope-from ) id 1NAG9M-00055Z-RF for lua@bazar2.conectiva.com.br; Mon, 16 Nov 2009 20:58:44 -0800 From: "Robert G. Jakabosky" To: Lua list Subject: [ANN] Emergency GC patch release 5 for Lua 5.1.4 Date: Mon, 16 Nov 2009 21:58:43 -0700 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Message-Id: <200911162058.43671.bobby@sharedrealm.com> X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bobby@sharedrealm.com X-SA-Exim-Scanned: No (on mail.neoawareness.com); SAEximRunCond expanded to false X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAH4xBlX012588 The Emergency GC patch makes it safe to call the Lua garbage collector after a memory allocation has failed.  This allows the garbage collector to free some memory so that the failed allocation can be retried.  The patch also add support for setting a limit on how much memory Lua scripts can allocate. This new release include the sweep strings fix (i.e. to fix the bug with loading large script files). Also a new compile option LUA_STRESS_EMERGENCY_GC has been add to luaconf.h to enable stress testing of the Emergency GC. Here is the new patch: http://lua-users.org/files/wiki_insecure/power_patches/5.1/emergency_gc-5.1.4-r5.patch Here is more info about the Emergency GC patch: http://lua-users.org/wiki/EmergencyGarbageCollector -- Robert G. Jakabosky From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 04:19:57 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH6JssJ020821; Tue, 17 Nov 2009 04:19:54 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BCA651936B; Tue, 17 Nov 2009 04:19:23 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D31801932B for ; Tue, 17 Nov 2009 04:19:12 -0200 (BRST) Received: by fxm7 with SMTP id 7so6603914fxm.29 for ; Mon, 16 Nov 2009 22:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZFE3LN6/+EaO0tHWE/9bNb31F20YGikXcq8PkWufGhQ=; b=JLBlqfS010sXuNMsShG7e8kGHdb68IgJakiJ7IOC7gUJOJx/GxvXxNvzYWzUZ78/t3 pvNsw0sFoSFUu4j7wYx2FnR4gslH08yzEUcBhGTLhXrOA+2QdIymi24CyBaG21XJ6H1L U6VqMTF04TylontbEupzv0CANLXY2OcIW7pPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=K89vGuW0dpx+ESiMNyu5t4rund87JiX94vG7CHISrc+aHAYVJLw6zu2otjqbd/HWQA kgEFruUWrjtw71tnQYtwqpCGhDNhf40x6FOk70CfIYpOtDRm2L2+LeCp7dvUR1hfPs0u WJeAK9qtdq8tDNT7ofPMi7XF+r2h4t7qnM9q0= MIME-Version: 1.0 Received: by 10.204.26.147 with SMTP id e19mr3930920bkc.149.1258438750082; Mon, 16 Nov 2009 22:19:10 -0800 (PST) In-Reply-To: <20091116205059.61de7772@egeria.whoopdedo.org> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> <20091116205059.61de7772@egeria.whoopdedo.org> Date: Tue, 17 Nov 2009 08:19:10 +0200 Message-ID: <560972290911162219v55eb2a26r8e2705c316d31cfe@mail.gmail.com> Subject: Re: New metamethod for method lookup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 17, 2009 at 3:50 AM, TNHarris wrote: > I'm less enthusiastic about the proposal today than yesterday. Perhaps > the difficulty with __index is to remind us that Lua is not an OO > language and we shouldn't be trying to make it one. Similar feelings here. > I'm also reminded how you can use __call for subscripting. Instead of > s['intersection'] you'd say s('intersection') and it doesn't step on the > toes of s.intersection. Now that has promise as a notation! (Also, as lhf points out, you can have multiple array indices and it looks just like Fortran) But, s("intersection") = true won't fly, alas. Has to be s:add("intersection") or something like that. A general observation: making objects callable all over the place can make debugging somewhat difficult. For instance, it pleased me at one time to have s(i) meaning 'i th character of the string s' but passing around callable strings caused odd error messages - we often depend on simply being told, 'look you have not passed me a function' steve d. From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 06:47:39 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH8lbpt001650; Tue, 17 Nov 2009 06:47:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5D9B2193AD; Tue, 17 Nov 2009 06:47:10 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2e.orange.fr (smtp2e.orange.fr [80.12.242.113]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 164FA192FD for ; Tue, 17 Nov 2009 06:47:06 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e17.orange.fr (SMTP Server) with ESMTP id 6CFDC80000A1 for ; Tue, 17 Nov 2009 09:47:02 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e17.orange.fr (SMTP Server) with ESMTP id 6116B8000042 for ; Tue, 17 Nov 2009 09:47:02 +0100 (CET) Received: from o (AToulouse-553-1-198-229.w90-45.abo.wanadoo.fr [90.45.22.229]) by mwinf2e17.orange.fr (SMTP Server) with ESMTP id EF22F80000A1 for ; Tue, 17 Nov 2009 09:46:59 +0100 (CET) X-ME-UUID: 20091117084659979.EF22F80000A1@mwinf2e17.orange.fr Date: Tue, 17 Nov 2009 09:46:59 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: New metamethod for method lookup Message-ID: <20091117094659.3a56cc7d@o> In-Reply-To: <560972290911162219v55eb2a26r8e2705c316d31cfe@mail.gmail.com> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> <20091116205059.61de7772@egeria.whoopdedo.org> <560972290911162219v55eb2a26r8e2705c316d31cfe@mail.gmail.com> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 17 Nov 2009 08:19:10 +0200, steve donovan stated: > A general observation: making objects callable all over the place can > make debugging somewhat difficult. For instance, it pleased me at one > time to have s(i) meaning 'i th character of the string s' but passing > around callable strings caused odd error messages - we often depend on > simply being told, 'look you have not passed me a function' More generally, overloading abuse or misuse can lead to really undebuggable issues. (painfully bites!) Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 07:05:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH95aRd003093; Tue, 17 Nov 2009 07:05:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 23CB7192AA; Tue, 17 Nov 2009 07:05:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by bazar2.conectiva.com.br (Postfix) with ESMTP id BF0F018D60 for ; Tue, 17 Nov 2009 07:05:10 -0200 (BRST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NAJzp-0007vp-8a for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 10:05:09 +0100 Received: from c-71-227-231-249.hsd1.wa.comcast.net ([71.227.231.249]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2009 10:05:09 +0100 Received: from stefan by c-71-227-231-249.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2009 10:05:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: lua@bazar2.conectiva.com.br From: stefan Subject: Re: LuaJIT startup performance Date: Tue, 17 Nov 2009 01:04:47 -0800 Lines: 31 Message-ID: References: <20091116123810.GA8344@mike.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-227-231-249.hsd1.wa.comcast.net User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Petite Abeille wrote: > On Nov 16, 2009, at 1:38 PM, Mike Pall wrote: > >> It wouldn't hurt. But you wouldn't see much of a difference, >> either. If the Lua code for request handling is only run once, >> it's probably not compiled at all. So you're not getting any >> benefit from a JIT compiler. > > While at this conjuncture the JIT itself doesn't make much of a difference for a typical Web app, the VM does: > > % lua -v Nanoki.lua . 0 1080 > Requests per second: 773.17 [#/sec] (mean) > % luajit -v Nanoki.lua . 0 1080 > Requests per second: 1174.19 [#/sec] (mean) > % luajit -v -joff Nanoki.lua . 0 1080 > Requests per second: 1167.37 [#/sec] (mean) > > http://article.gmane.org/gmane.comp.lang.lua.general/58851 > > Also, if the "CGI" type launcher supports persistent connections by reusing a process for the lifetime of a connection, then one might benefit from the JIT itself at some point. > > Hmmm... I suppose I will take the hint and try a JIT build of luafcgid. I have been itching to bench my new toy on an AMD LX800 box that is laying around (ALIX 2 series). Any suggestions for a suitable test script? It would be more compelling if it actually accomplished some (semi)useful work. I was thinking of creating some fractal JPGs using GD, but then someone smacked me and I woke up. Perhaps if it made a simple custom PDF based on the URL parameters? From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 07:55:52 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAH9tnJn007858; Tue, 17 Nov 2009 07:55:50 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 40B80193BF; Tue, 17 Nov 2009 07:55:22 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 2D2D3193B0 for ; Tue, 17 Nov 2009 07:55:15 -0200 (BRST) Received: by bwz27 with SMTP id 27so149590bwz.21 for ; Tue, 17 Nov 2009 01:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5k2pyBmnOJXsou+PnXmV3DYm24JOIoNT9zKbChSfB+M=; b=WzxcHYLSgJrRAVef0yGA/BanZqnhg9GnOQDURhay4jlVKutO1oG5FeatnyEihAd8IG 3B5a1OGc1a4xg23wabLe4k3wKQSa1JY6WnsDKmaQYkE305X95agn3B9cAwUpwJ/G5Tvf DEncYjwZ59Qsmdus8VPe1uX+AAyEwG8xTMKio= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=leRfUXhqKrERnXgOHOfA7HBGWrMIGoZdFIp34AQhTgmS8TbWk3Dk04bbXhRZ8VtP6w FYF3SdMzS2dRpAwbJVKeQUZrZjAvPfgWgbfQ53p6GkNzJIK65o02W0OdwtbI0y9hk9SH M/voziPLTgT8/0G+wDKhzmT2430qWiTFQDOHY= MIME-Version: 1.0 Received: by 10.204.7.88 with SMTP id c24mr1252474bkc.17.1258451713644; Tue, 17 Nov 2009 01:55:13 -0800 (PST) In-Reply-To: <20091117094659.3a56cc7d@o> References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> <20091116205059.61de7772@egeria.whoopdedo.org> <560972290911162219v55eb2a26r8e2705c316d31cfe@mail.gmail.com> <20091117094659.3a56cc7d@o> Date: Tue, 17 Nov 2009 11:55:13 +0200 Message-ID: <560972290911170155w4525153ao12b695bca0f984ab@mail.gmail.com> Subject: Re: New metamethod for method lookup From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 17, 2009 at 10:46 AM, spir wrote: > More generally, overloading abuse or misuse can lead to really undebuggable issues. (painfully bites!) Oh yes! A programmer needs to need a special driver's license to overload operators ;) The concept isn't difficult, but using it sensibly (and not for 'fun') is tricky. Another use of defining __call that isn't such a good idea: for an object to return its iterator for val in obj() do ... end Much better to say obj:iter() explicitly. From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 09:14:59 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHBEuu0017415; Tue, 17 Nov 2009 09:14:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 8C0B3193C0; Tue, 17 Nov 2009 09:14:05 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.185]) by bazar2.conectiva.com.br (Postfix) with ESMTP id AF35619381 for ; Tue, 17 Nov 2009 09:13:59 -0200 (BRST) Received: by gv-out-0910.google.com with SMTP id l14so766810gvf.40 for ; Tue, 17 Nov 2009 03:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=bg371REWsni2a7xmtBbl0OEG2sIJe2M9hGFKCVtDOAQ=; b=aivKZ2tJfRdeRGYNBzpeqgTAIpkUiV8J2CHR5qyQSqPZyKt4G48i68aU+SOJ7LCYUv AFT4wkQ8twNzAUOjESgKw5ztpYIqCR3onv46meMyV4i8fgYroZXWj/BNuDhYGanMb72O 7wK4gFpbzv++T2oCGfIwe090kGSBbSBPfIAyM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=owX47wvyLQRnjOTfGS6VtTYriI0Td0dsfF4zy2TRkoqMA8AL1XVAH1c5Rs4YX2KL2I sOHtdsQ25gO/bxYBTj/UdiGSbr2f4ZHLsp1zaqnPsbiiq7GeCmO6P/O/qI0TBsiPvKWF Oxh7q3F4c/2Tyqu0KC9ZH2evxZHsx65JihHGY= MIME-Version: 1.0 Received: by 10.213.1.28 with SMTP id 28mr2493570ebd.70.1258456434184; Tue, 17 Nov 2009 03:13:54 -0800 (PST) Date: Tue, 17 Nov 2009 12:13:54 +0100 X-Google-Sender-Auth: 5851b819315508d6 Message-ID: <3485df560911170313w7f587dd8ndd27b825cd8aabd7@mail.gmail.com> Subject: Use of Sockets and file descriptors to cooperate with Freeswitch (media/telephony platform) From: =?ISO-8859-2?Q?Tomek_=A3abacki?= To: lua@bazar2.conectiva.com.br Content-Type: multipart/alternative; boundary=000e0cdfcdb6b991f104788f3851 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --000e0cdfcdb6b991f104788f3851 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Hello there. I'm in trouble with connecting to FreeSWITCH by the ESL.ESLconnection() and it's blocking me to do more progress with my work..= . and further exploring FreeSwitch platform. The problem is in ESL.ESLconnection() function - its first argument has to be (int) socket, so as I suppose it's right to use the lua's getfd() function in this case. But... as it can be observed in Wireshark, the execution of ESL.ESLconnection() function looks like that: * send "conenct" message * send RST packet that reset current Socket Connection I wonder if I made mistake while compiling ESL library, or maybe there is a problem with configuration of Socket at Lua's side? Is there any bug, in code below - althrought I regularly programming, I'm newbie in Lua and mayb= e there is some kind of specific lua construction of socket? #! /usr/bin/lua require("socket") require("ESL") -- socket set-up ServerPort =3D 8086 server =3D assert(socket.bind("*", ServerPort)) -- waiting, in the loop, for the client while true do client, err =3D server:accept() con =3D ESL.ESLconnection(client:getfd()) print (con:connected()) end --=20 Pozdrawiam, Tomek =A3abacki, http://labacki.com --000e0cdfcdb6b991f104788f3851 Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Hello there. I'm in trouble with connecting to FreeSWITCH by the ESL.ESLconnection() and it's blocking me to do more progress with my work... and further exploring FreeSwitch platform.

The problem is in= ESL.ESLconnection() function - its first argument has to be (int) socket, = so as I suppose it's right to use the lua's getfd() function in thi= s case. But... as it can be observed in Wireshark, the execution of ESL.ESL= connection() function looks like that:

* send "conenct" message
* send RST packet that reset curr= ent Socket Connection

I wonder if I made mistake while compiling ESL= library, or maybe there is a problem with configuration of Socket at Lua&#= 39;s side? Is there any bug, in code below - althrought I regularly program= ming, I'm newbie in Lua and maybe there is some kind of specific lua co= nstruction of socket?

#! /usr/bin/lua
require("socket")
require("ESL")

-- socket set-up
ServerPort =3D 8086
server =3D assert(socket.bind("*", ServerPort))

-- waiting, in the loop, for the client
while true do
=A0=A0client, err =3D server:accept()
=A0=A0con =3D ESL.ESLconnection(client:getfd())
=A0=A0print (con:connected())
end

--
Pozdrawiam,
Tomek =A3abacki,
http://labacki.com
--000e0cdfcdb6b991f104788f3851-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 09:30:00 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHBTuqL019486; Tue, 17 Nov 2009 09:29:57 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13947193BB; Tue, 17 Nov 2009 09:29:29 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 0FAE819375 for ; Tue, 17 Nov 2009 09:29:22 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHBTJdI019443 for ; Tue, 17 Nov 2009 09:29:19 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAHBTIK32746; Tue, 17 Nov 2009 09:29:18 -0200 Date: Tue, 17 Nov 2009 09:29:17 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: lua 1.0 patch - fixing compiler errors Message-ID: <20091117092917.A32736@lua.tecgraf.puc-rio.br> References: <20091115092856.A25054@lua.tecgraf.puc-rio.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from dm.lua@math2.org on Mon, Nov 16, 2009 at 11:50:22PM -0500 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > On Sun, Nov 15, 2009 at 6:28 AM, Luiz Henrique de Figueiredo wrote: > > lua-all.tar.gz contains patched versions of Lua 1.0 and others. Did you try that? > > Nope, but it looks like that would do. Here is the original announcement: http://lua-users.org/lists/lua-l/2007-05/msg00366.html From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 09:30:45 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHBUfIJ019675; Tue, 17 Nov 2009 09:30:42 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A5057193D7; Tue, 17 Nov 2009 09:30:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from maia.amarino.de (amarino.de [193.197.187.9]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C92AF193CD for ; Tue, 17 Nov 2009 09:30:06 -0200 (BRST) Received: from localhost by maia.amarino.de with local id 1NAMG3-0003Co-00; Tue, 17 Nov 2009 12:30:03 +0100 Date: Tue, 17 Nov 2009 12:29:52 +0100 From: Mike Pall To: Lua list Subject: Re: LuaJIT 2 crashes on lua_pcall ? Message-ID: <20091117112952.GA6945@mike.de> References: <200911161311598432152@gmail.com> <200911171014125317651@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <200911171014125317651@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline YangFan wrote: > I have written a piece of cpp code, it works under Windows XP Pro SP3, > should be compiled by VC2008 with luabind 0.8.1 which depends on boost > library. Also a lua test function which will be called from cpp source code. > See the attachment. > > Build this project, then run the executable with either LuaJIT dll or official > Lua dll. You can see after printing 3, official Lua will push an error message, > but LuaJIT just crashes. Thank you for the test case! I can reproduce the problem now (it's not in lua_pcall). Patch attached. --Mike --k+w/mQv8wyuph6w0 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="beta2_lua_tocfunction.patch" --- a/src/lj_api.c +++ b/src/lj_api.c @@ -486,8 +486,12 @@ LUA_API size_t lua_objlen(lua_State *L, int idx) LUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx) { cTValue *o = index2adr(L, idx); - ASMFunction gate = funcV(o)->c.gate; - return (gate == lj_gate_c || gate == lj_gate_cwrap) ? funcV(o)->c.f : NULL; + if (tvisfunc(o)) { + ASMFunction gate = funcV(o)->c.gate; + if (gate == lj_gate_c || gate == lj_gate_cwrap) + return funcV(o)->c.f; + } + return NULL; } LUA_API void *lua_touserdata(lua_State *L, int idx) --k+w/mQv8wyuph6w0-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 10:03:14 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHC3BFZ025675; Tue, 17 Nov 2009 10:03:11 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE50E193C6; Tue, 17 Nov 2009 10:02:38 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 54A55193C0 for ; Tue, 17 Nov 2009 10:02:33 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1NAMjx-0005hi-EB for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 14:00:57 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Date: Tue, 17 Nov 2009 14:02:40 +0200 Subject: expression as statement MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean What is the preferred way of writing subj. in Lua? Say, I want to write code that does '#' on value x. I can write: while #x do break end do local _ = #x end (function () return #x end)() ... and so on. Is there something that has least runtime and size overhead, i.e. doesn't create extra branches or stack allocations in bytecode? From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 10:11:05 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHCB0Ih027849; Tue, 17 Nov 2009 10:11:01 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 733BC193D9; Tue, 17 Nov 2009 10:10:31 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 86C8C193D3 for ; Tue, 17 Nov 2009 10:10:25 -0200 (BRST) Received: by bwz23 with SMTP id 23so6896690bwz.29 for ; Tue, 17 Nov 2009 04:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CAeGvyinXk8oS/XSoNl46LIVflOri5NfI6EbguJWahg=; b=kPGsnJa4fwHqZeIQnUUiEr6qUXRTBRpjTUkGiM1/BG3ZfoLroIlm2ThBS/+WDyQKki 0C+3PTao4DqrWJS6DGcsge3rcj+5duwePGvSt+4n7Mq+Fdy1yh1UMR3hKOK9VE0rF7LN RbZ4PJrBtG9hEiXLFE4MarByrUmqaj7ONy33M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pNii3FjS/udpSX/M8BEUzmJgqPdNc/7MeSoOk6eyZPQ1+H9LVc8g18qxS5/TP8oWAq IxnvgyftuBfsoa+2IElkrqxOQEsmfA+cH6FXwBkplW0xGNUrmkknvrmodw5yewxNds8v l7lzpbGZ1poV3FNXZv3zm267NZQOIUo1YgM8Y= MIME-Version: 1.0 Received: by 10.239.190.216 with SMTP id y24mr943526hbh.185.1258459822592; Tue, 17 Nov 2009 04:10:22 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Nov 2009 14:10:22 +0200 Message-ID: <560972290911170410y4e430082r687311bee49633da@mail.gmail.com> Subject: Re: expression as statement From: steve donovan To: Lua list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by tecgraf.puc-rio.br id nAHCB0Ih027849 On Tue, Nov 17, 2009 at 2:02 PM, Juris Kalnins wrote: >  while #x do break end >  do local _ = #x end >  (function () return #x end)() OK, assuming that '#' stands not for its usual meaning (in which case first statement always returns immediately) The second is definitely the best; is the idea to execute the operation for its side-effect? Why go to the trouble of wrapping this in a function? From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 10:15:07 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHCF39p029071; Tue, 17 Nov 2009 10:15:04 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 37D64190C7; Tue, 17 Nov 2009 10:14:36 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from tecgraf.puc-rio.br (duchamp.tecgraf.puc-rio.br [139.82.85.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 959AD18D5E for ; Tue, 17 Nov 2009 10:14:30 -0200 (BRST) Received: from lua.tecgraf.puc-rio.br (lua [10.0.8.54]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHCEK1e028651 for ; Tue, 17 Nov 2009 10:14:22 -0200 Received: by lua.tecgraf.puc-rio.br (8.11.6) id nAHCEJm00474; Tue, 17 Nov 2009 10:14:19 -0200 Date: Tue, 17 Nov 2009 10:14:19 -0200 From: Luiz Henrique de Figueiredo To: Lua list Subject: Re: expression as statement Message-ID: <20091117101419.A413@lua.tecgraf.puc-rio.br> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from juris@mt.lv on Tue, Nov 17, 2009 at 02:02:40PM +0200 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br > Say, I want to write code that does '#' on value x. I can write: > > while #x do break end > do local _ = #x end > (function () return #x end)() > > Is there something that has least runtime and size overhead, > i.e. doesn't create extra branches or stack allocations in bytecode? There's also repeat until #x assuming (as you are) that #x does not return false... But this generates the simplest bytecode: do local _ = #x end From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 10:35:41 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHCZaeH000806; Tue, 17 Nov 2009 10:35:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A02CD193CB; Tue, 17 Nov 2009 10:34:40 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bute.mt.lv (bute.mt.lv [159.148.172.195]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E48CF193C0 for ; Tue, 17 Nov 2009 10:34:35 -0200 (BRST) Received: from [10.0.0.70] (helo=juris-desktop) by bute.mt.lv with esmtp (Exim 4.69) (envelope-from ) id 1NANEu-0008LU-2Z for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 14:32:56 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Lua list" Subject: Re: expression as statement References: <20091117101419.A413@lua.tecgraf.puc-rio.br> Date: Tue, 17 Nov 2009 14:34:39 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Juris Kalnins" Message-ID: In-Reply-To: <20091117101419.A413@lua.tecgraf.puc-rio.br> User-Agent: Opera Mail/10.10 (Linux) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, 17 Nov 2009 14:14:19 +0200, Luiz Henrique de Figueiredo wrote: > There's also > repeat until #x > assuming (as you are) that #x does not return false... > But this generates the simplest bytecode: > do local _ = #x end Many thanks. From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 11:24:04 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHDNvwr010669; Tue, 17 Nov 2009 11:23:58 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id C0BB5193E5; Tue, 17 Nov 2009 11:23:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 18C80193DC for ; Tue, 17 Nov 2009 11:23:03 -0200 (BRST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id C8565C0CA3 for ; Tue, 17 Nov 2009 08:22:49 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 17 Nov 2009 08:22:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=kiwve+Yc5yaRxQGFLt5GlZgnreA=; b=dZU/H2O2v+UlKhcqJY/g6mVTxkeKIL7G/BU+ANSo2440C1CHahFvewkv8PNbC9X9LY96rg6kQ/3Tc1HMSmCu0gS5m1/Xspsm1iMYlwNHqFO+P9ytwGg3NVORW8UaWp1/lstMPuARiKNLr1Fau7t23O2mko+S0HaHjhJm+PlBY0w= X-Sasl-enc: NSEPiSr62QIV9BzY4uyfff3rzubvDL0NWuCWqo4Uzg3G 1258464169 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3F7134B244C for ; Tue, 17 Nov 2009 08:22:49 -0500 (EST) Date: Tue, 17 Nov 2009 08:23:24 -0500 From: Jim Pryor To: Lua list Subject: Re: iterators Message-ID: <20091117132324.GN11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20091113110017.04b259a5@o> <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> <20091116093911.4e75fb0a@o> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091116093911.4e75fb0a@o> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 16, 2009 at 09:39:11AM +0100, spir wrote: > Someone said a thread on lua-list requires some benchmark. Some, I did test for this thread. I hope these tests are properly done, because I'm not used to that (please tell me in a PM if ever there are things to change in the testing method) ... > > I was wondering whether performance penalty would mainly come from closure creation at loop initialisation time, or instead that calling a "closured" func with upvalue in a loop would be significantly slower. So, I wrote 2 versions of simple iteration on an array-table with a fake (empty) loop body: one with direct call to iteration func, one with closure. Then measured time (in seconds) for the following processes: > > -1- Many (33,333,333) loops on empty table (meaning each loop initialisation requires closure creation for the closure version, but then in both cases loop process is a single func call + a single test): > result: 10 / 33. > My interpretation: closure creation is clostly. But the test itself does not mirror any meaningful use case. > > -2- Single loop on a table with many (33,333,333) items: > result: 17 / 19 > My interpretation: this test is meaningful for the actual use case of walking through big arrays; but note there is no job done at all in the loop body, the test actually only measures the looping mechanics: with some job in the loop, the difference will reduce in proportion. The overhead for using a closure on an empty loop has an order of magnitude of 10%. (As far as I'm concerned, it's already neglectable even with empty loop.) > > Then for further information: I wondered about the "weight" (in time) of actual iteration through items, compared to loop initialisation. So, I repeated the first case for arrays of 10 items: > > -3- Many (3,333,333) loops on 10-items table. (Beware outside loop count is /10.) > result: 10 / 16. > My interpretation: once multiplied per ten, we get 100 / 160. The first case is as expected, as loop init is nearly nothing, then we simply call the func 10 times more. For the case of a closure, we can evaluate each func call to ~ 13, and the loop init/closure creation to ~ 20 (for 33,333,333 times repeting the whole thing). > > As a last test, I added some actual operation in the loop body (copy of the table): > -4- single loop on 11,111,111-items array + copy > result: 14 / 15 > My interpretation: the times here are rather unstable (the other test where highly stable instable with only +/- 1 variation), varying with ~ 30% incertitude on my computer. Sometimes the closure version is even faster. > Anyway, I would interpret this as meaning that, in the general case with non-empty arrays and some job in the loop body, the closure overhead is "very tiny". The performance hit from using closures isn't going to come from time spent creating the closure, that's pretty fast. The problem is that all those closures use heap space, and if you create a lot of them, they're going to need to be garbage collected later. If you only have one loop---it doesn't matter how many iteration steps it involves---then only one object is getting created and so the garbage collection costs will be negligible. You're basically just testing here how much it slows down a function to lookup its upvalues. And the answer is, hardly any slowdown. But if you have a lot of loops in your code and every loop creates a closure (that might have otherwise been avoided, see below), then there's going to be a lot more garbage that needs collecting and that's where the performance costs will be. Note that what matters is how many loops there are, not how many iterations in a given loop. In some cases the second and third argument to an iteration function aren't enough and you have to keep track of more state. One way to do this is by making the second argument a temporary table; another way is by using a closure. Here you're going to face the performance effects of having a new object that needs to be garbage collected either way. I just go with whichever object would be smaller (a closure is smaller for up to about 4 upvalues; after that the table is smaller). -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 11:31:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHDVlac012504; Tue, 17 Nov 2009 11:31:48 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7CD73193F1; Tue, 17 Nov 2009 11:31:11 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D6B34193E3 for ; Tue, 17 Nov 2009 11:31:05 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 718D2C12F0 for ; Tue, 17 Nov 2009 08:31:04 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 17 Nov 2009 08:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=r9nPKzA99sv2hsZgpeQyXnGTvT4=; b=DK8IncqbkV8h9OHBjVOy0cDo3vqzTHFXLzSc5RiGX2Dp+ginttDIiTn9axFp8BEqxJs59ALJo2xbND3PCZ/gD9KGLkLsVvnKNV/HH/5gSr7BTseXS/HYGAy31vD9wflY/G4UQ1tU4HcsHWZQh4gyi/b5JUnVRbKVdwPp7vnmr3Q= X-Sasl-enc: N87hu85aSZ+aWaVvdE41QndtjLqaG6DAGsRhnaiHEPr9 1258464664 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0A22F4B246B for ; Tue, 17 Nov 2009 08:31:03 -0500 (EST) Date: Tue, 17 Nov 2009 08:31:39 -0500 From: Jim Pryor To: Lua list Subject: Re: iterators Message-ID: <20091117133139.GO11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20091113110017.04b259a5@o> <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> <20091116093911.4e75fb0a@o> <20091117132324.GN11203@vaio.jimpryor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091117132324.GN11203@vaio.jimpryor.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Tue, Nov 17, 2009 at 08:23:24AM -0500, Jim Pryor wrote: > If you only have one > loop---it doesn't matter how many iteration steps it involves---then > only one object is getting created and so the garbage collection costs > will be negligible. You're basically just testing here how much it slows > down a function to lookup its upvalues. And the answer is, hardly any > slowdown. Sorry, I looked at your code again. I was wrong. You're not just running through a single loop for each case, you are correctly creating the loop multiple times. However, your testing code doesn't do anything to manage when the garbage collection costs are incurred. So for that reason you can't rely on it for insight into the performance costs at issue here. It would be better to insert a collectgarbage("collect") before the print(os.time()-t0) in each block. -- Jim Pryor jim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 11:43:31 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHDhRMK015937; Tue, 17 Nov 2009 11:43:28 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 202C5193DE; Tue, 17 Nov 2009 11:42:50 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 7A0AF19398 for ; Tue, 17 Nov 2009 11:42:40 -0200 (BRST) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 1139DC1337 for ; Tue, 17 Nov 2009 08:42:35 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 17 Nov 2009 08:42:35 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; s=smtpout; bh=DSgInhEm+bq6r6OlLya0tVPR4iQ=; b=JOAurmImQyIHZMviN8N5Wj2ybt1Hus+Ra7kAg3wZtdh05oOxH7Mcha5rvRE4QhtmQSZG3Q9hKtAWp0tcXetG5bfEDVFj4Ne/Dp+3gJlEjjQ0nU2MRId8t2xvCrXXEiKDutmBN5HFT4g+BbzRiQhBexpJ941Y0KC4+3prRNAmf90= X-Sasl-enc: FZ9KzVNx944vEvCA58i8yxA5fJF/JhTipZv2JMvoZqk9 1258465354 Received: from localhost (user-12lcuct.cable.mindspring.com [69.86.121.157]) by mail.messagingengine.com (Postfix) with ESMTPSA id A01084B249C for ; Tue, 17 Nov 2009 08:42:34 -0500 (EST) Date: Tue, 17 Nov 2009 08:43:10 -0500 From: Jim Pryor To: Lua list Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 Message-ID: <20091117134310.GP11203@vaio.jimpryor.net> Mail-Followup-To: Lua list References: <20091116182711.GA22497@mike.de> <20091116183416.B30402@lua.tecgraf.puc-rio.br> <20091117002910.GA5414@inf.puc-rio.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091117002910.GA5414@inf.puc-rio.br> User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean On Mon, Nov 16, 2009 at 10:29:10PM -0200, Roberto Ierusalimschy wrote: > > > BTW: You'll get better performance if you don't fill the rd[] > > > array backwards. It degrades into a hash table in this case. > > > > That probably also applies to plain Lua. > > It degrades into a hash while it is being filled, but when it finishes > I think the result is always a pure array. (I proved this some time > ago, but I am not sure the algorithm is still exactly the same.) Do you mean if I do this: tbl = {[2]=20,[3]=30,[4]=40} -- now tbl is all hash tbl[1]=10 At the last step an array part big enough to hold 4 elements will be created, and all the pairs formerly in the hash part will be removed from there and copied over to the array part? -- Profjim profjim@jimpryor.net From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 14:44:46 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHGidNr025953; Tue, 17 Nov 2009 14:44:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id F195D1940A; Tue, 17 Nov 2009 14:43:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.18]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 77799193FD for ; Tue, 17 Nov 2009 14:43:52 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1922.orange.fr (SMTP Server) with ESMTP id 0D6262000066 for ; Tue, 17 Nov 2009 17:43:45 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1922.orange.fr (SMTP Server) with ESMTP id EEDC2200007E for ; Tue, 17 Nov 2009 17:43:44 +0100 (CET) Received: from o (AToulouse-553-1-160-155.w92-156.abo.wanadoo.fr [92.156.104.155]) by mwinf1922.orange.fr (SMTP Server) with ESMTP id A33B82000078 for ; Tue, 17 Nov 2009 17:43:44 +0100 (CET) X-ME-UUID: 20091117164344668.A33B82000078@mwinf1922.orange.fr Date: Tue, 17 Nov 2009 17:43:44 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: iterators Message-ID: <20091117174344.0c27d326@o> In-Reply-To: <20091117132324.GN11203@vaio.jimpryor.net> References: <20091113110017.04b259a5@o> <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> <20091116093911.4e75fb0a@o> <20091117132324.GN11203@vaio.jimpryor.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 17 Nov 2009 08:23:24 -0500, Jim Pryor stated: [...] > > The performance hit from using closures isn't going to come from time > spent creating the closure, that's pretty fast. The problem is that all > those closures use heap space, and if you create a lot of them, they're > going to need to be garbage collected later. Right, thank you for the information. Actually, GC (and memory management in general) is not something I spontaneously think at. Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 14:47:28 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHGlOfu026630; Tue, 17 Nov 2009 14:47:25 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A1DC419413; Tue, 17 Nov 2009 14:46:57 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp2e.orange.fr (smtp2e.orange.fr [80.12.242.111]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A8A6C19408 for ; Tue, 17 Nov 2009 14:46:51 -0200 (BRST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e01.orange.fr (SMTP Server) with ESMTP id E0E048000478 for ; Tue, 17 Nov 2009 17:46:44 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e01.orange.fr (SMTP Server) with ESMTP id D31948000473 for ; Tue, 17 Nov 2009 17:46:44 +0100 (CET) Received: from o (AToulouse-553-1-160-155.w92-156.abo.wanadoo.fr [92.156.104.155]) by mwinf2e01.orange.fr (SMTP Server) with ESMTP id A0E768000478 for ; Tue, 17 Nov 2009 17:46:44 +0100 (CET) X-ME-UUID: 20091117164644659.A0E768000478@mwinf2e01.orange.fr Date: Tue, 17 Nov 2009 17:46:44 +0100 From: spir To: lua@bazar2.conectiva.com.br Subject: Re: iterators Message-ID: <20091117174644.66ca5648@o> In-Reply-To: <20091117133139.GO11203@vaio.jimpryor.net> References: <20091113110017.04b259a5@o> <89d273ba0911130217o4253e931g8b6111e1772fc1dd@mail.gmail.com> <20091116093911.4e75fb0a@o> <20091117132324.GN11203@vaio.jimpryor.net> <20091117133139.GO11203@vaio.jimpryor.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Le Tue, 17 Nov 2009 08:31:39 -0500, Jim Pryor stated: > On Tue, Nov 17, 2009 at 08:23:24AM -0500, Jim Pryor wrote: > > If you only have one > > loop---it doesn't matter how many iteration steps it involves---then > > only one object is getting created and so the garbage collection costs > > will be negligible. You're basically just testing here how much it slows > > down a function to lookup its upvalues. And the answer is, hardly any > > slowdown. > > Sorry, I looked at your code again. I was wrong. You're not just running > through a single loop for each case, you are correctly creating the loop > multiple times. > > However, your testing code doesn't do anything to manage when the > garbage collection costs are incurred. So for that reason you can't rely > on it for insight into the performance costs at issue here. > > It would be better to insert a > collectgarbage("collect") > before the > print(os.time()-t0) > in each block. Thank you for the hint. (Next time I need to time something, I'll probably think at including GC if relevant). Denis -------------------------------- * la vita e estrany * http://spir.wikidot.com/ From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 15:06:56 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHH6o9L031720; Tue, 17 Nov 2009 15:06:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 1B1311941C; Tue, 17 Nov 2009 15:06:21 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5796C19406 for ; Tue, 17 Nov 2009 15:06:16 -0200 (BRST) Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1NARVO-00070n-7G for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 18:06:14 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1NARVN-0007nM-Lu for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 18:06:13 +0100 From: Florian Weimer To: lua@bazar2.conectiva.com.br Subject: Re: Interning strings considered harmful (somewhat) References: <87eiorabk2.fsf@mid.deneb.enyo.de> <20091026161103.GA12846@inf.puc-rio.br> Date: Tue, 17 Nov 2009 18:06:13 +0100 In-Reply-To: <20091026161103.GA12846@inf.puc-rio.br> (Roberto Ierusalimschy's message of "Mon, 26 Oct 2009 14:11:03 -0200") Message-ID: <874ootytbu.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean * Roberto Ierusalimschy: > (BTW, simply dropping the skip in the hash function does solve the > "problem"; just add a "step = 1" in lstring.c to check. But it creates a > new one: the hash function becomes too expensive for long strings.) I went ahead and replaced the hash function with Jenkins' lookup3.c. The impact on microbenchmarks was rather mixed. For reading text files line by line, with somewhat regular content, there was a small speed-up (despite line lengths generally above 32 bytes). Fasta was slower, k-nucleotide was faster. Reading large, mostly random strings will be significantly slower, but for quite regular strings, lookup3.c's better mixing seems to pay off. From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 17:41:19 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAHJfD2W005037; Tue, 17 Nov 2009 17:41:13 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id A90761941A; Tue, 17 Nov 2009 17:40:34 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by bazar2.conectiva.com.br (Postfix) with ESMTP id E87EE19408 for ; Tue, 17 Nov 2009 17:40:28 -0200 (BRST) Received: by fg-out-1718.google.com with SMTP id l26so160061fgb.17 for ; Tue, 17 Nov 2009 11:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=GVvsokiqgkubZmfSNKxMZs7xirOVN9cWGcLenqnfi9U=; b=RqNqRnFKiV+XBxljsRuuyLzbq/Rep9EF3m90ryJAZmz0vCfDRsHvJd7tdqIapPiOQ4 5cU5j5hEPjyNodKkDFas5hP4k1tb/FUsS1mYQP4LoQImwsas76PVf5Cu5M+3pK4wGTnf Xjt9WcnGXW69j7l2+CjZC69q4KrYMh1ckYvpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=x9nt06I/mL6KvrvG8pjmmQv9v/l0AIj4nJbqdrvPvBAvQ+t+DblpzpuCQuZ0qDRECM BQNtLviv3cC/oiFtY6dfSdAxRYjuWrCkbRsFtPkBsPusJC/qbwTsezLexhAIbyHU96nu TchX5XU8AezqMbKYDnFzjQY44UcSMWhLoeUF8= MIME-Version: 1.0 Received: by 10.216.90.1 with SMTP id d1mr2247761wef.136.1258486825724; Tue, 17 Nov 2009 11:40:25 -0800 (PST) In-Reply-To: References: <42lte5tcv6nf0r3n0g03d3njeiaa1j4qak@thomaslauer.com> <4ff79edb0911021245t6eb7138flb748396210afa1a6@mail.gmail.com> Date: Tue, 17 Nov 2009 13:40:25 -0600 Message-ID: <990ce51e0911171140l38b0df3bs70ca0628fa62a6ba@mail.gmail.com> Subject: Re: [ANN] Idle v1.0 From: Kurt Nordstrom To: Lua list Content-Type: multipart/alternative; boundary=0016e6d99f2633ac670478964c2a X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --0016e6d99f2633ac670478964c2a Content-Type: text/plain; charset=ISO-8859-1 Huh, it looks interesting. The addition of the __usedindex metamethod seems like a huge boon in making protected access tables/objects. I've wondered why Vanilla Lua doesn't have something like that. -Kurt -- http://www.blar.net/kurt/blog/ --0016e6d99f2633ac670478964c2a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Huh, it looks interesting.=A0 The addition of the __usedindex metamethod se= ems like a huge boon in making protected access tables/objects.=A0 I've= wondered why Vanilla Lua doesn't have something like that.

-Kur= t
--
http://www.blar.net/kurt/= blog/
--0016e6d99f2633ac670478964c2a-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 22:16:40 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAI0GaRd020937; Tue, 17 Nov 2009 22:16:37 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id D687E19413; Tue, 17 Nov 2009 22:15:52 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from smtp-na3.ea.com (smtp-na3.ea.com [159.153.6.7]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 6C153193AB for ; Tue, 17 Nov 2009 22:15:47 -0200 (BRST) Received: from na-casht2.rws.ad.ea.com (na-casht2.rws.ad.ea.com [10.30.204.159]) by smtp-na3.ea.com (Switch-3.3.0/Switch-3.3.0) with ESMTP id nAI0Fgdr017861 for ; Tue, 17 Nov 2009 16:15:43 -0800 Received: from NA-MAIL-2-2.rws.ad.ea.com ([10.250.0.16]) by na-casht2.rws.ad.ea.com ([10.30.204.159]) with mapi; Tue, 17 Nov 2009 16:15:41 -0800 From: "Martin, Marcus" To: Lua list Date: Tue, 17 Nov 2009 16:15:37 -0800 Subject: Lua Registry Question Thread-Topic: Lua Registry Question Thread-Index: Acpn5EDzFD/pgSFaT5KB5tEoX7RE6g== Message-ID: <0823F997E9D55A4288A9489A90DBF12ADF8438AB71@NA-MAIL-2-2.rws.ad.ea.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_0823F997E9D55A4288A9489A90DBF12ADF8438AB71NAMAIL22rwsad_" MIME-Version: 1.0 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_0823F997E9D55A4288A9489A90DBF12ADF8438AB71NAMAIL22rwsad_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have an embedded Lua environment in an application. I have some C++ code = that creates tables of data, adds the tables to the Lua registry, and relea= ses the table from the registry when we are done with the table I am pretty sure, that I am not releasing all references to some tables bec= ause I see unbound memory growth. Is there a way to monitor the growth of t= he Lua registry? How about any techniques or tools to help find where I am = not releasing the tables correctly? Marcus --_000_0823F997E9D55A4288A9489A90DBF12ADF8438AB71NAMAIL22rwsad_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have an embedded Lua environment in an application. I have some C++ code that creates tables of data, adds the tables to the Lua registry, and releases the table from the registry when we are done with the table

 =

I am pretty sure, that I= am not releasing all references to some tables because I see unbound memory growth= . Is there a way to monitor the growth of the Lua registry? How about any techni= ques or tools to help find where I am not releasing the tables correctly?

 =

Marcus

 

--_000_0823F997E9D55A4288A9489A90DBF12ADF8438AB71NAMAIL22rwsad_-- From lua-bounces@bazar2.conectiva.com.br Tue Nov 17 23:17:54 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAI1Ho88030410; Tue, 17 Nov 2009 23:17:51 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 302861926C; Tue, 17 Nov 2009 23:17:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from bay0-omc3-s47.bay0.hotmail.com (bay0-omc3-s47.bay0.hotmail.com [65.54.246.206]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 60FEF18D8F for ; Tue, 17 Nov 2009 23:17:11 -0200 (BRST) Received: from SN1PRD0201HT003.namprd02.prod.outlook.com ([65.55.94.9]) by bay0-omc3-s47.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Nov 2009 17:17:02 -0800 Received: from SN1PRD0201MB019.namprd02.prod.outlook.com ([169.254.4.18]) by SN1PRD0201HT003.namprd02.prod.outlook.com ([169.254.56.18]) with mapi; Wed, 18 Nov 2009 01:17:02 +0000 From: "Del Buono, Matthew Paul" To: Lua list Subject: Re: Lua Registry Question Thread-Topic: Lua Registry Question Thread-Index: Acpn5EDzFD/pgSFaT5KB5tEoX7RE6gACJFCA Date: Wed, 18 Nov 2009 01:16:57 +0000 Message-ID: <410091357.91479.1258507020087.JavaMail.rim@bda2157.bisx.prod.on.blackberry> References: <0823F997E9D55A4288A9489A90DBF12ADF8438AB71@NA-MAIL-2-2.rws.ad.ea.com> In-Reply-To: <0823F997E9D55A4288A9489A90DBF12ADF8438AB71@NA-MAIL-2-2.rws.ad.ea.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-rim-org-msg-ref-id: 1680688721 Content-Type: multipart/alternative; boundary="_000_410091357914791258507020087JavaMailrimbda2157bisxprodon_" MIME-Version: 1.0 X-OriginalArrivalTime: 18 Nov 2009 01:17:02.0544 (UTC) FILETIME=[D5813D00:01CA67EC] X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean --_000_410091357914791258507020087JavaMailrimbda2157bisxprodon_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable The registry is just a table. Accordingly you can simply push it onto the s= tack for inspection from C and return it from lua. There is also a function= in the debug library to do just that. Matt Sent from my Verizon Wireless BlackBerry ________________________________ From: "Martin, Marcus" Date: Tue, 17 Nov 2009 16:15:37 -0800 To: Lua list Subject: Lua Registry Question I have an embedded Lua environment in an application. I have some C++ code = that creates tables of data, adds the tables to the Lua registry, and relea= ses the table from the registry when we are done with the table I am pretty sure, that I am not releasing all references to some tables bec= ause I see unbound memory growth. Is there a way to monitor the growth of t= he Lua registry? How about any techniques or tools to help find where I am = not releasing the tables correctly? Marcus --_000_410091357914791258507020087JavaMailrimbda2157bisxprodon_ Content-Type: text/html; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable The registry is just a = table. Accordingly you can simply push it onto the stack for inspection fro= m C and return it from lua. There is also a function in the debug library t= o do just that.

Matt

Sent from my Verizon Wireless BlackBerry

<= hr>
From: "Martin, Marcus" <mamartin@ea.com>
Date: Tue, 17 Nov 2009 16:15:37 -0800
To: Lua list<lua@bazar2.conectiva.com.br>
Subject: Lua= Registry Question

I have an embedded Lua environment in an application. I have some C++ code that creates ta= bles of data, adds the tables to the Lua registry, and releases the table from the registry when we are done with the table

 

I am pretty sure, that= I am not releasing all references to some tables because I see unbound memory growth= . Is there a way to monitor the growth of the Lua registry? How about any techni= ques or tools to help find where I am not releasing the tables correctly?

 

Marcus

 

--_000_410091357914791258507020087JavaMailrimbda2157bisxprodon_-- From lua-bounces@bazar2.conectiva.com.br Wed Nov 18 00:30:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAI2Tce9005245; Wed, 18 Nov 2009 00:29:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 3B7AB19443; Wed, 18 Nov 2009 00:29:08 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from outbound.icp-qv1-irony-out4.iinet.net.au (unknown [203.59.1.104]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 84B7F1942A for ; Wed, 18 Nov 2009 00:28:52 -0200 (BRST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwEALrqAkt8qSDl/2dsb2JhbACRNsUQhDsEgW+BAg X-IronPort-AV: E=Sophos;i="4.44,762,1249228800"; d="scan'208";a="482948796" Received: from unknown (HELO Mania) ([124.169.32.229]) by outbound.icp-qv1-irony-out4.iinet.net.au with SMTP; 18 Nov 2009 10:28:44 +0800 Message-ID: From: "Alex Davies" To: "Lua list" References: <87eiorabk2.fsf@mid.deneb.enyo.de><20091026161103.GA12846@inf.puc-rio.br> <874ootytbu.fsf@mid.deneb.enyo.de> In-Reply-To: <874ootytbu.fsf@mid.deneb.enyo.de> Subject: Re: Interning strings considered harmful (somewhat) Date: Wed, 18 Nov 2009 10:28:26 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean Florian Weimer wrote: > I went ahead and replaced the hash function with Jenkins' lookup3.c. > The impact on microbenchmarks was rather mixed. For reading text > files line by line, with somewhat regular content, there was a small > speed-up (despite line lengths generally above 32 bytes). Fasta was > slower, k-nucleotide was faster. Reading large, mostly random strings > will be significantly slower, but for quite regular strings, > lookup3.c's better mixing seems to pay off. A nice surprise that you noticed speed up. I have to ask though, from a security point of view - is there any point in replacing one non-cryptographic hash with another? Note Jenkins' stern warning that the algorithm should not be used for cryptographic purposes, and indeed his hash is almost as vulnerable as the Lua one - a quick google search for "jenkins lookup3.c attack" gives this: http://www.team5150.com/~andrew/blog/2007/03/breaking_superfasthash.html, among other things. The author writes that you should randomize a, b and c, preventing his attack (although likely still leaving it open to others - again, it's not a cryptographic hash), which sounds sensible. - Alex From lua-bounces@bazar2.conectiva.com.br Wed Nov 18 01:47:44 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAI3lenL012841; Wed, 18 Nov 2009 01:47:41 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id DE1C6192AA; Wed, 18 Nov 2009 01:20:24 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mail.infinite-interactive.com (203-173-41-114.perm.iinet.net.au [203.173.41.114]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 17DFD190AC for ; Wed, 18 Nov 2009 01:20:17 -0200 (BRST) Received: from [10.1.2.32] ([10.1.2.32]) by mail.infinite-interactive.com (IceWarp 9.4.2) with ASMTP id ZOM01310 for ; Wed, 18 Nov 2009 14:20:10 +1100 Message-ID: <4B0367EA.1070506@infinite-interactive.com> Date: Wed, 18 Nov 2009 14:20:10 +1100 From: Mark Feldman User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: New metamethod for method lookup References: <560972290911150159l45a84d6dsacf0475d864710d6@mail.gmail.com> <20091115181320.734530b9@egeria.whoopdedo.org> <560972290911152248t78d5033ct2ecaf1a73a46a6f2@mail.gmail.com> <20091116205059.61de7772@egeria.whoopdedo.org> In-Reply-To: <20091116205059.61de7772@egeria.whoopdedo.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean TNHarris wrote: > I'm less enthusiastic about the proposal today than yesterday. Perhaps > the difficulty with __index is to remind us that Lua is not an OO > language and we shouldn't be trying to make it one. > True, but there are some (relatively) minor changes that could be made which would open up a lot of features available to other languages that are more OO-friendly. One of the problems I've encountered with __index is that it prevents you from efficiently implementing virtual data members. Consider the case where "child" has a metatable "parent", and "parent" has a metatable "grandparent". Grandparent contains an __index function to catch any non-members that are accessed and handles them accordingly. However, when grandparent.__index is called, the value of self is set to parent, not child, which is totally contrary to the whole concept of "self": === local grandparent = {type="grandparent", __index =function(self, _) return self.type end} local parent = setmetatable({type="parent"}, grandparent) parent.__index = parent child = setmetatable({type="child"}, parent) print(child.foo) --> parent === The only way for grandparent to get access to the proper value of self (i.e. child) is to also add an __index function to parent and pass it down the chain explicitly, which immediately shadows all members of grandparent from ever being called directly. This is not a contrived example, it's a direct analogy to OOP cases where grandparent is a base class, parent is a derived class and child is an instance of derived. Derived (parent) has to __index itself so that operators work properly on the instance, so the only way to efficiently implement virtual data members in this case is to change the VM so that either the value of self passed into settable remains constant as you traverse the metatable chain, or pass that value in as a third parameter into grandparent.__index. It's a negligable change to the VM that only effects __index function calls (which are slow anyway) but it would immediately add the ability to implement efficient virtual data members to inheritence heirarchies, which is a very useful feature of other OOP languages. Mark Feldman This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From lua-bounces@bazar2.conectiva.com.br Wed Nov 18 02:28:10 2009 Return-Path: Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [200.140.247.68]) by tecgraf.puc-rio.br (8.12.11.20060308/8.12.11) with ESMTP id nAI4S67I017528; Wed, 18 Nov 2009 02:28:06 -0200 Received: from bazar2.conectiva.com.br (bazar2.conectiva.com.br [127.0.0.1]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 13F251942B; Wed, 18 Nov 2009 02:27:16 -0200 (BRST) X-Original-To: lua@bazar2.conectiva.com.br Delivered-To: lua@bazar2.conectiva.com.br Received: from mailer.cheeseplant.org (adsl-71-158-244-138.dsl.pltn13.sbcglobal.net [71.158.244.138]) by bazar2.conectiva.com.br (Postfix) with ESMTP id 5754A193AD for ; Wed, 18 Nov 2009 02:27:11 -0200 (BRST) Received: from globule.home.cheeseplant.org ([10.1.1.1] helo=quad.home.cheeseplant.org) by mailer.cheeseplant.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NAc8K-0007QY-30 for lua@bazar2.conectiva.com.br; Tue, 17 Nov 2009 20:27:08 -0800 Message-ID: <4B037799.10705@danielstephens.com> Date: Tue, 17 Nov 2009 20:27:05 -0800 From: Daniel Stephens User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Lua list Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0 References: <20091116182711.GA22497@mike.de> <20091116183416.B30402@lua.tecgraf.puc-rio.br> <20091117002910.GA5414@inf.puc-rio.br> <20091117134310.GP11203@vaio.jimpryor.net> In-Reply-To: <20091117134310.GP11203@vaio.jimpryor.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: lua@bazar2.conectiva.com.br X-Mailman-Version: 2.1.6 Precedence: list Reply-To: Lua list List-Id: Lua list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: lua-bounces@bazar2.conectiva.com.br Errors-To: lua-bounces@bazar2.conectiva.com.br X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on duchamp.tecgraf.puc-rio.br X-Virus-Status: Clean In that particular case, it probably will, since the initial tbl would have been initialized with exactly enough space to hold its original contents (Due to the compiler analyzing the initialization code and counting hash-versus-array parts), and so assigning the new member will cause it to be re-allocated (and thusly "optimized"). Last time I adventured into this bit of the lua code, lua will only do such re-balancing when it needs to grow either the hash or array part (I'm not sure if GC plays into this, i.e. whether a table with lots of free space would be re-balanced, I dont /think/ it does, but at the time I was primarily concerned with table creation so GC didn't really factor into it). Daniel. Jim Pryor wrote: > On Mon, Nov 16, 2009 at 10:29:10PM -0200, Roberto Ierusalimschy wrote: > >>>> BTW: You'll get better performance if you don't fill the rd[] >>>> array backwards. It degrades into a hash table in this case. >>>> >>> That probably also applies to plain Lua. >>> >> It degrades into a hash while it is being filled, but when it finishes >> I think the result is always a pure array. (I proved this some time >> ago, but I am not sure the algorithm is still exactly the same.) >> > > > Do you mean if I do this: > > tbl = {[2]=20,[3]=30,[4]=40} > -- now tbl is all hash > > tbl[1]=10 > > At the last step an array part big enough to hold 4 elements will be > created, and all the pairs formerly in the hash part will be removed > from there and copied over to the array part? > >